\r
[TestMethod]\r
public void TestCreate() {\r
- JobEngineAPI client = new JobEngineAPI("http://localhost:8080/services/rest/jobengine/", null, null, 100);\r
+ MediaCubeApi client = new MediaCubeApi("http://localhost:8080/services/rest/jobengine/", null, null, 100);\r
\r
WorkflowAction item = new WorkflowAction();\r
item.description = "description";\r
\r
[TestMethod]\r
public void TestCreateMany() {\r
- JobEngineAPI client = new JobEngineAPI("http://localhost:8080/services/rest/jobengine/", null, null, 100);\r
+ MediaCubeApi client = new MediaCubeApi("http://localhost:8080/services/rest/jobengine/", null, null, 100);\r
\r
for (int i = 0; i < 10; i++) {\r
WorkflowAction item = new WorkflowAction();\r
\r
[TestMethod]\r
public void TestItem() {\r
- JobEngineAPI client = new JobEngineAPI("http://localhost:8080/services/rest/jobengine/", null, null, 100);\r
+ MediaCubeApi client = new MediaCubeApi("http://localhost:8080/services/rest/jobengine/", null, null, 100);\r
client.Item();\r
}\r
}\r
this.backgroundWorker1 = new System.ComponentModel.BackgroundWorker();\r
this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel();\r
this.label_stuffID = new System.Windows.Forms.Label();\r
- this.label_stuffTitle = new System.Windows.Forms.Label();\r
this.label_stuffDescription = new System.Windows.Forms.Label();\r
this.label_mediaID = new System.Windows.Forms.Label();\r
this.label_mediaTitle = new System.Windows.Forms.Label();\r
this.textBox_mediaID = new System.Windows.Forms.TextBox();\r
this.textBox_mediaTitle = new System.Windows.Forms.TextBox();\r
this.textBox_mediaDescription = new System.Windows.Forms.TextBox();\r
+ this.label_stuffTitle = new System.Windows.Forms.Label();\r
+ this.groupBox1 = new System.Windows.Forms.GroupBox();\r
+ this.button_cancel = new System.Windows.Forms.Button();\r
+ this.button_ok = new System.Windows.Forms.Button();\r
this.tableLayoutPanel1.SuspendLayout();\r
+ this.groupBox1.SuspendLayout();\r
this.SuspendLayout();\r
// \r
// tableLayoutPanel1\r
this.tableLayoutPanel1.Controls.Add(this.textBox_mediaTitle, 1, 4);\r
this.tableLayoutPanel1.Controls.Add(this.textBox_mediaDescription, 1, 5);\r
this.tableLayoutPanel1.Controls.Add(this.label_stuffTitle, 0, 1);\r
- this.tableLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill;\r
+ this.tableLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Top;\r
this.tableLayoutPanel1.Location = new System.Drawing.Point(0, 0);\r
this.tableLayoutPanel1.Name = "tableLayoutPanel1";\r
this.tableLayoutPanel1.RowCount = 6;\r
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 16.66667F));\r
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 16.66667F));\r
this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 16.66667F));\r
- this.tableLayoutPanel1.Size = new System.Drawing.Size(318, 330);\r
+ this.tableLayoutPanel1.Size = new System.Drawing.Size(324, 330);\r
this.tableLayoutPanel1.TabIndex = 0;\r
// \r
// label_stuffID\r
this.label_stuffID.Dock = System.Windows.Forms.DockStyle.Top;\r
this.label_stuffID.Location = new System.Drawing.Point(3, 0);\r
this.label_stuffID.Name = "label_stuffID";\r
- this.label_stuffID.Size = new System.Drawing.Size(87, 13);\r
+ this.label_stuffID.Size = new System.Drawing.Size(89, 13);\r
this.label_stuffID.TabIndex = 0;\r
this.label_stuffID.Text = "Anyag azonosító";\r
// \r
- // label_stuffTitle\r
- // \r
- this.label_stuffTitle.AutoSize = true;\r
- this.label_stuffTitle.Location = new System.Drawing.Point(3, 55);\r
- this.label_stuffTitle.Name = "label_stuffTitle";\r
- this.label_stuffTitle.Size = new System.Drawing.Size(58, 13);\r
- this.label_stuffTitle.TabIndex = 1;\r
- this.label_stuffTitle.Text = "Anyag cím";\r
- // \r
// label_stuffDescription\r
// \r
this.label_stuffDescription.AutoSize = true;\r
- this.label_stuffDescription.Location = new System.Drawing.Point(3, 110);\r
+ this.label_stuffDescription.Location = new System.Drawing.Point(3, 108);\r
this.label_stuffDescription.Name = "label_stuffDescription";\r
this.label_stuffDescription.Size = new System.Drawing.Size(66, 13);\r
this.label_stuffDescription.TabIndex = 2;\r
// label_mediaID\r
// \r
this.label_mediaID.AutoSize = true;\r
- this.label_mediaID.Location = new System.Drawing.Point(3, 165);\r
+ this.label_mediaID.Location = new System.Drawing.Point(3, 162);\r
this.label_mediaID.Name = "label_mediaID";\r
this.label_mediaID.Size = new System.Drawing.Size(86, 13);\r
this.label_mediaID.TabIndex = 3;\r
// label_mediaTitle\r
// \r
this.label_mediaTitle.AutoSize = true;\r
- this.label_mediaTitle.Location = new System.Drawing.Point(3, 220);\r
+ this.label_mediaTitle.Location = new System.Drawing.Point(3, 216);\r
this.label_mediaTitle.Name = "label_mediaTitle";\r
this.label_mediaTitle.Size = new System.Drawing.Size(57, 13);\r
this.label_mediaTitle.TabIndex = 4;\r
// label_mediaDescription\r
// \r
this.label_mediaDescription.AutoSize = true;\r
- this.label_mediaDescription.Location = new System.Drawing.Point(3, 275);\r
+ this.label_mediaDescription.Location = new System.Drawing.Point(3, 270);\r
this.label_mediaDescription.Name = "label_mediaDescription";\r
this.label_mediaDescription.Size = new System.Drawing.Size(65, 13);\r
this.label_mediaDescription.TabIndex = 5;\r
// textBox_stuffID\r
// \r
this.textBox_stuffID.Dock = System.Windows.Forms.DockStyle.Top;\r
- this.textBox_stuffID.Location = new System.Drawing.Point(96, 3);\r
+ this.textBox_stuffID.Location = new System.Drawing.Point(98, 3);\r
this.textBox_stuffID.Name = "textBox_stuffID";\r
- this.textBox_stuffID.Size = new System.Drawing.Size(219, 20);\r
+ this.textBox_stuffID.Size = new System.Drawing.Size(223, 20);\r
this.textBox_stuffID.TabIndex = 6;\r
// \r
// textBox_stuffTitle\r
// \r
this.textBox_stuffTitle.Dock = System.Windows.Forms.DockStyle.Top;\r
- this.textBox_stuffTitle.Location = new System.Drawing.Point(96, 58);\r
+ this.textBox_stuffTitle.Location = new System.Drawing.Point(98, 57);\r
this.textBox_stuffTitle.Name = "textBox_stuffTitle";\r
- this.textBox_stuffTitle.Size = new System.Drawing.Size(219, 20);\r
+ this.textBox_stuffTitle.Size = new System.Drawing.Size(223, 20);\r
this.textBox_stuffTitle.TabIndex = 7;\r
// \r
// textBox_stuffDescription\r
// \r
- this.textBox_stuffDescription.Dock = System.Windows.Forms.DockStyle.Top;\r
- this.textBox_stuffDescription.Location = new System.Drawing.Point(96, 113);\r
+ this.textBox_stuffDescription.Dock = System.Windows.Forms.DockStyle.Fill;\r
+ this.textBox_stuffDescription.Location = new System.Drawing.Point(98, 111);\r
+ this.textBox_stuffDescription.Multiline = true;\r
this.textBox_stuffDescription.Name = "textBox_stuffDescription";\r
- this.textBox_stuffDescription.Size = new System.Drawing.Size(219, 20);\r
+ this.textBox_stuffDescription.ScrollBars = System.Windows.Forms.ScrollBars.Both;\r
+ this.textBox_stuffDescription.Size = new System.Drawing.Size(223, 48);\r
this.textBox_stuffDescription.TabIndex = 8;\r
// \r
// textBox_mediaID\r
// \r
this.textBox_mediaID.Dock = System.Windows.Forms.DockStyle.Top;\r
- this.textBox_mediaID.Location = new System.Drawing.Point(96, 168);\r
+ this.textBox_mediaID.Location = new System.Drawing.Point(98, 165);\r
this.textBox_mediaID.Name = "textBox_mediaID";\r
- this.textBox_mediaID.Size = new System.Drawing.Size(219, 20);\r
+ this.textBox_mediaID.Size = new System.Drawing.Size(223, 20);\r
this.textBox_mediaID.TabIndex = 9;\r
// \r
// textBox_mediaTitle\r
// \r
this.textBox_mediaTitle.Dock = System.Windows.Forms.DockStyle.Top;\r
- this.textBox_mediaTitle.Location = new System.Drawing.Point(96, 223);\r
+ this.textBox_mediaTitle.Location = new System.Drawing.Point(98, 219);\r
this.textBox_mediaTitle.Name = "textBox_mediaTitle";\r
- this.textBox_mediaTitle.Size = new System.Drawing.Size(219, 20);\r
+ this.textBox_mediaTitle.Size = new System.Drawing.Size(223, 20);\r
this.textBox_mediaTitle.TabIndex = 10;\r
// \r
// textBox_mediaDescription\r
// \r
- this.textBox_mediaDescription.Dock = System.Windows.Forms.DockStyle.Top;\r
- this.textBox_mediaDescription.Location = new System.Drawing.Point(96, 278);\r
+ this.textBox_mediaDescription.Dock = System.Windows.Forms.DockStyle.Fill;\r
+ this.textBox_mediaDescription.Location = new System.Drawing.Point(98, 273);\r
+ this.textBox_mediaDescription.Multiline = true;\r
this.textBox_mediaDescription.Name = "textBox_mediaDescription";\r
- this.textBox_mediaDescription.Size = new System.Drawing.Size(219, 20);\r
+ this.textBox_mediaDescription.ScrollBars = System.Windows.Forms.ScrollBars.Both;\r
+ this.textBox_mediaDescription.Size = new System.Drawing.Size(223, 54);\r
this.textBox_mediaDescription.TabIndex = 11;\r
// \r
+ // label_stuffTitle\r
+ // \r
+ this.label_stuffTitle.AutoSize = true;\r
+ this.label_stuffTitle.Location = new System.Drawing.Point(3, 54);\r
+ this.label_stuffTitle.Name = "label_stuffTitle";\r
+ this.label_stuffTitle.Size = new System.Drawing.Size(58, 13);\r
+ this.label_stuffTitle.TabIndex = 1;\r
+ this.label_stuffTitle.Text = "Anyag cím";\r
+ // \r
+ // groupBox1\r
+ // \r
+ this.groupBox1.Controls.Add(this.button_cancel);\r
+ this.groupBox1.Controls.Add(this.button_ok);\r
+ this.groupBox1.Dock = System.Windows.Forms.DockStyle.Fill;\r
+ this.groupBox1.Location = new System.Drawing.Point(0, 330);\r
+ this.groupBox1.Name = "groupBox1";\r
+ this.groupBox1.Size = new System.Drawing.Size(324, 58);\r
+ this.groupBox1.TabIndex = 1;\r
+ this.groupBox1.TabStop = false;\r
+ // \r
+ // button_cancel\r
+ // \r
+ this.button_cancel.Dock = System.Windows.Forms.DockStyle.Right;\r
+ this.button_cancel.ForeColor = System.Drawing.SystemColors.ControlText;\r
+ this.button_cancel.Location = new System.Drawing.Point(171, 16);\r
+ this.button_cancel.Name = "button_cancel";\r
+ this.button_cancel.Size = new System.Drawing.Size(75, 39);\r
+ this.button_cancel.TabIndex = 0;\r
+ this.button_cancel.Text = "Cancel";\r
+ this.button_cancel.UseVisualStyleBackColor = true;\r
+ // \r
+ // button_ok\r
+ // \r
+ this.button_ok.Dock = System.Windows.Forms.DockStyle.Right;\r
+ this.button_ok.Location = new System.Drawing.Point(246, 16);\r
+ this.button_ok.Name = "button_ok";\r
+ this.button_ok.Size = new System.Drawing.Size(75, 39);\r
+ this.button_ok.TabIndex = 1;\r
+ this.button_ok.Text = "OK";\r
+ this.button_ok.UseVisualStyleBackColor = true;\r
+ this.button_ok.Click += new System.EventHandler(this.button_ok_Click);\r
+ // \r
// ArchiveMetadata\r
// \r
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);\r
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;\r
- this.ClientSize = new System.Drawing.Size(318, 330);\r
+ this.ClientSize = new System.Drawing.Size(324, 388);\r
+ this.Controls.Add(this.groupBox1);\r
this.Controls.Add(this.tableLayoutPanel1);\r
this.Name = "ArchiveMetadata";\r
this.Text = "ArchiveMetadata";\r
this.tableLayoutPanel1.ResumeLayout(false);\r
this.tableLayoutPanel1.PerformLayout();\r
+ this.groupBox1.ResumeLayout(false);\r
this.ResumeLayout(false);\r
\r
}\r
private System.Windows.Forms.TextBox textBox_mediaID;\r
private System.Windows.Forms.TextBox textBox_mediaTitle;\r
private System.Windows.Forms.TextBox textBox_mediaDescription;\r
+ private System.Windows.Forms.GroupBox groupBox1;\r
+ private System.Windows.Forms.Button button_cancel;\r
+ private System.Windows.Forms.Button button_ok;\r
}\r
}
\ No newline at end of file
\r
public ArchiveMetadata(ArchiveMetadataModel model) : this() {\r
this.model = model;\r
+ FillTheTextBoxes();\r
}\r
\r
public ArchiveMetadata() {\r
InitializeComponent();\r
- FillTheTextBoxes();\r
}\r
\r
private void FillTheTextBoxes() {\r
textBox_mediaTitle.Text = model.MediaTitle;\r
textBox_mediaDescription.Text = model.MediaDescription;\r
}\r
+\r
+ private void button_ok_Click(object sender, System.EventArgs e) {\r
+ //todo\r
+ }\r
}\r
}\r
using System.Collections.Generic;\r
using System.ComponentModel;\r
using System.Text.RegularExpressions;\r
-\r
+using JobEngineClient;\r
namespace Maestro {\r
public partial class MaestroForm {\r
private MetadataInfo selectedMetadata;\r
private List<Segment> segments = new List<Segment>();\r
+ private MediaCubeApi mediaCubeApi;\r
\r
public MetadataInfo SelectedMetadata {\r
get {\r
private void InitializeMetadata() {\r
InitializeOctopusSelector();\r
InitializeTrafficSelector();\r
+ InitializeMediaCubeApi();\r
}\r
\r
private void InitializeTrafficSelector() {\r
octopusIDSelector.IDChangedEvent += OnOctopusIDSelected;\r
}\r
\r
+ private void InitializeMediaCubeApi() {\r
+ MediaCubeMetadata metadata = Configuration.Metadatas.Where(m => { return m is MediaCubeMetadata; }).FirstOrDefault() as MediaCubeMetadata;\r
+ if (metadata == null)\r
+ return;\r
+ mediaCubeApi = new MediaCubeApi(metadata.Server.Address.ToString(), metadata.Server.UserName, metadata.Server.Password, metadata.Server.Timeout);\r
+ }\r
+\r
private void OnOctopusIDSelected(string selectedID) {\r
SelectedMetadata = new MetadataInfo() {\r
Kind = MetadataType.OctopusStory,\r
ArchiveMetadata form = null;\r
IDTypes idType = GetTypeOfSelectedMetadata();\r
ArchiveMetadataModel model = new ArchiveMetadataModel();\r
+ Cursor.Current = Cursors.WaitCursor;\r
if (idType == IDTypes.OctopusID)\r
FillTheModelFromOctopus(model);\r
else if (idType == IDTypes.TrafficID)\r
FillTheModelFromTraffic(model);\r
- //form = new ArchiveMetadata(model);\r
- //form.ShowDialog();\r
+ form = new ArchiveMetadata(model);\r
+ form.ShowDialog();\r
}\r
\r
private void FillTheModelFromTraffic(ArchiveMetadataModel model) {\r
- throw new NotImplementedException();\r
+ string id = selectedMetadata.ID;\r
+ TrafficAPI api = trafficIDSelector.trafficAPI;\r
+ List<ArchiveMatadataWrapper> result = api.SearchArchiveMetadata(id); ;\r
+ ArchiveMatadataWrapper actualResult = result[0];\r
+ model.StuffID = actualResult.ProgID;\r
+ model.StuffTitle = actualResult.ProgTitle;\r
+ model.StuffDescription = actualResult.ProgDescription;\r
+ model.MediaID = actualResult.EpisodeID;\r
+ model.MediaTitle = String.IsNullOrEmpty(actualResult.EpisodeTitle) ? actualResult.EpisodeTitle : actualResult.ProgTitle;\r
+ model.MediaDescription = actualResult.EpisodeDescription;\r
}\r
\r
private void FillTheModelFromOctopus(ArchiveMetadataModel model) {\r
string id = selectedMetadata.ID;\r
OctopusAPI api = octopusIDSelector.GetClient();\r
- List<Story> stories = api.GetStoriesById(id).ToList();\r
+ IEnumerable<Story> storyEnum = api.GetStoriesById(id);\r
+ if (storyEnum != null) {\r
+ FillModelFromStories(model, storyEnum.ToList(), api);\r
+ } else {\r
+ //List<MosObject> mosObjectsEnum = api.GetMosObjectsByID(id).ToList();\r
+ //MosObject mosObject = mosObjectsEnum[0];\r
+ List<Story> stories = api.GetStoriesByPlaceHolderId(id).ToList();\r
+ FillModelFromStories(model, stories, api);\r
+ //todo ha mosObject, mivel töltsem fel a model-t?\r
+ }\r
+ }\r
+\r
+ private void FillModelFromStories(ArchiveMetadataModel model, List<Story> stories, OctopusAPI api) {\r
Story story = stories[0];\r
if (story.StoryFolders != null) {\r
- List<StoryFolder> storyFolders = api.GetStoryFoldersByStoryID(id).ToList();\r
- //lehet több mappában is a story?\r
+ List<StoryFolder> storyFolders = api.GetStoryFoldersByStoryID(story.ID).ToList();\r
StoryFolder folder = storyFolders[0];\r
model.StuffID = folder.ID;\r
model.StuffTitle = folder.Name;\r
+ //leírás a story body a jsonos\r
} else if (story.Rundowns != null) {\r
- List<Rundown> rundowns = api.GetRundownsByStoryID(id).ToList();\r
+ List<Rundown> rundowns = api.GetRundownsByStoryID(story.ID).ToList();\r
Rundown rundown = rundowns[0];\r
model.StuffID = rundown.ID;\r
model.StuffTitle = rundown.Name;\r
model.MediaID = story.ID;\r
model.MediaTitle = story.Name;\r
model.MediaDescription = story.Script;\r
-\r
}\r
\r
private IDTypes GetTypeOfSelectedMetadata() {\r
//ISourceItem actualFile = new FileSourceItem() { FileInfo = new System.IO.FileInfo(actual), };\r
ISourceItem selectedFile = GetSourceItemFromBindingSource(actual);//bindingSource.Current as ISourceItem;\r
string id = selectedMetadata.ID;\r
- object[] parameters = new object[] { this, Configuration.Source, target, selectedFile.Name, id, segments };\r
+ object[] parameters = new object[] { this, Configuration.Source, target, selectedFile.Name, id, segments, mediaCubeApi };\r
ITargetProcessor processor = (ITargetProcessor)Activator.CreateInstance(type, parameters);\r
processors.Add(processor);\r
}\r
{\r
"$type": "MediaCubeMetadata",\r
"server": {\r
- "address": "ftp://localhost:21/out",\r
+ "address": "http://localhost:8080/services/rest/jobengine/",\r
"userName": "dani",\r
"password": "dani"\r
}\r
{\r
"$type": "MediaCubeMetadata",\r
"server": {\r
- "address": "ftp://localhost:21/out",\r
+ "address": "http://localhost:8080/services/rest/jobengine/",\r
"userName": "dani",\r
"password": "dani"\r
}\r
public DataGridViewColumn[] Columns {\r
get {\r
DataGridViewColumn[] result = new DataGridViewColumn[] {\r
- //todo DataPropertyName-et is át kell írni?\r
new DataGridViewTextBoxColumn(){\r
DataPropertyName = "Name",\r
HeaderText = StringResources.NEV,\r
using System.Collections.Generic;\r
using TrafficClient;\r
using Model;\r
+using JobEngineClient;\r
\r
namespace Maestro.Targets {\r
\r
protected FtpClient targetFTP;\r
protected FileInfo inputFile;\r
private string workingDir;\r
+ private MediaCubeApi mediaCubeApi;\r
+\r
public WorkflowAction workFlowAction { get; set; }\r
\r
- public FTPTargetProcessor(Control parent, Source sourceConfig, Target targetConfig, string inputFileName, string id, List<Segment> segments) : base(parent, targetConfig, segments) {\r
+ public FTPTargetProcessor(Control parent, Source sourceConfig, Target targetConfig, string inputFileName, string id, List<Segment> segments, MediaCubeApi mediaCubeApi) : base(parent, targetConfig, segments) {\r
FtpTrace.LogFunctions = false;\r
+ this.mediaCubeApi = mediaCubeApi;\r
this.targetConfig = targetConfig;\r
Uri inputUri = new Uri(String.Format("{0}/{1}", sourceConfig.Local.Address.LocalPath, inputFileName));\r
inputFile = new FileInfo(inputUri.LocalPath); \r
TerminateClient(targetFTP);\r
Finished = DateTime.Now;\r
workFlowAction.finished = Finished;\r
+ SendWorkFlowAction();\r
}\r
logger.Info(PROCESSING_COMPLETED, inputFile.Name);\r
return result;\r
}\r
\r
+ private void SendWorkFlowAction() {\r
+ try {\r
+ mediaCubeApi.Create(workFlowAction);\r
+ } catch (Exception e) {\r
+ MessageBox.Show(parent , e.Message);\r
+ }\r
+ }\r
+\r
private void SetSubFolder(Connection connection) {\r
Uri address = connection.Address;\r
if (targetConfig.CreateSubFolder)\r
using System.Windows.Forms;\r
using System.Collections.Generic;\r
using TrafficClient;\r
+using JobEngineClient;\r
\r
namespace Maestro.Targets {\r
\r
private Logger logger = LogManager.GetCurrentClassLogger();\r
private Source sourceConfig;\r
\r
- public FXPTargetProcessor(Control parent, Source sourceConfig, Target targetConfig, string inputFileName, string id, List<Segment> segments) :\r
- base(parent, sourceConfig, targetConfig, inputFileName, id, segments) {\r
+ public FXPTargetProcessor(Control parent, Source sourceConfig, Target targetConfig, string inputFileName, string id, List<Segment> segments, MediaCubeApi mediaCubeApi ) :\r
+ base(parent, sourceConfig, targetConfig, inputFileName, id, segments, mediaCubeApi) {\r
this.sourceConfig = sourceConfig;\r
}\r
\r
private DateTime finished;\r
private string input;\r
private string output;\r
- private Control parent;\r
private int progress;\r
+ protected Control parent;\r
protected Target targetConfig;\r
protected TrafficAPI client;\r
protected List<Segment> segments;\r
using System.Runtime.Serialization;\r
\r
namespace JobEngineClient {\r
- public class JobEngineAPI {\r
+ public class MediaCubeApi {\r
private const string DATEFORMAT = "yyyy'-'MM'-'dd'T'HH':'mm':'ssK";\r
private static Logger logger = LogManager.GetCurrentClassLogger();\r
private RestClient client;\r
private string user;\r
private string pwd;\r
\r
- public JobEngineAPI(string address, string user, string pwd, int timeout) {\r
+ public MediaCubeApi(string address, string user, string pwd, int timeout) {\r
this.user = user;\r
this.pwd = pwd;\r
client = new RestClient(address) {\r
</Reference>\r
</ItemGroup>\r
<ItemGroup>\r
- <Compile Include="JobEngineAPI.cs" />\r
+ <Compile Include="MediaCubeApi.cs" />\r
<Compile Include="NexioAPI.cs" />\r
<Compile Include="NotificationMessage.cs" />\r
<Compile Include="Notifier.cs" />\r
return result;\r
}\r
\r
-\r
public IEnumerable<MosObject> GetMosObjectsByID(String id) {\r
IEnumerable<MosObject> result = null;\r
try {\r
catch (Exception e) { }\r
return result;\r
}\r
+\r
+ public IEnumerable<Rundown> GetRundownsByPlaceHolderId(string placeHolderID) {\r
+ IEnumerable<Rundown> result = null;\r
+ try {\r
+ var request = new RestRequest("getRundownsByPlaceHolderId/{id}", Method.GET);\r
+ request.AddParameter("id", placeHolderID, ParameterType.UrlSegment);\r
+ var response = client.Execute<JsonArray>(request);\r
+ if (response.ContentLength == 0)\r
+ return null;\r
+ JArray resultObject = JArray.Parse(response.Content);\r
+\r
+ result = resultObject.Children().Select(d => {\r
+ Rundown r = new Rundown {\r
+ ID = d["id"].ToString(),\r
+ Name = d["name"].ToString(),\r
+ Start = d["scheduledStart"].ToString()\r
+ };\r
+ logger.Debug($"{r}");\r
+ return r;\r
+ });\r
+ }\r
+ catch (Exception e) {\r
+ //log e.Message ??\r
+ }\r
+ return result;\r
+ }\r
+\r
+ public IEnumerable<StoryFolder> GetStoryFoldersByPlaceHolderId(string placeHolderID) {\r
+ IEnumerable<StoryFolder> result = null;\r
+ try {\r
+ var request = new RestRequest("getStoryFoldersByPlaceHolderId/{id}", Method.GET);\r
+ request.AddParameter("id", placeHolderID, ParameterType.UrlSegment);\r
+ var response = client.Execute<JsonArray>(request);\r
+ if (response.ContentLength == 0)\r
+ return null;\r
+ JArray resultObject = JArray.Parse(response.Content);\r
+\r
+ result = resultObject.Children().Select(d => {\r
+ StoryFolder r = new StoryFolder {\r
+ ID = d["id"].ToString(),\r
+ Name = d["name"].ToString()\r
+ };\r
+ logger.Debug($"{r}");\r
+ return r;\r
+ });\r
+ }\r
+ catch (Exception e) {\r
+ //log e.Message ??\r
+ }\r
+ return result;\r
+ }\r
+\r
+ public IEnumerable<Story> GetStoriesByPlaceHolderId(string placeHolderID) {\r
+ IEnumerable<Story> result = null;\r
+ try {\r
+ var request = new RestRequest("getStoriesByPlaceHolderId/{id}", Method.GET);\r
+ request.AddParameter("id", placeHolderID, ParameterType.UrlSegment);\r
+ var response = client.Execute<JsonArray>(request);\r
+ if (response.ContentLength == 0)\r
+ return null;\r
+ JArray resultObject = JArray.Parse(response.Content);\r
+\r
+ result = resultObject.Children().Select(d => {\r
+ List<MosObject> objs = GetMosObjectsFromStory(d);\r
+ Story r = new Story {\r
+ ID = d["id"].ToString(),\r
+ Name = d["name"].ToString(),\r
+ MosObjects = objs.ToArray()\r
+ };\r
+ if (d["script"] != null) {\r
+ r.Script = d["script"].ToString();\r
+ }\r
+ if (d["story_folder"] != null)\r
+ r.StoryFolders = GetStoryFolderFromStory(d).ToArray();\r
+ if (d["rundown"] != null)\r
+ r.Rundowns = GetRundownFromStory(d).ToArray();\r
+ logger.Debug($"{r}");\r
+ return r;\r
+ }).OrderBy(r => {\r
+ return r.ID;\r
+ });\r
+ }\r
+ catch (Exception e) { }\r
+ return result;\r
+ }\r
}\r
}\r
--- /dev/null
+namespace TrafficClient {\r
+ partial class CustomDataGridView {\r
+ /// <summary> \r
+ /// Required designer variable.\r
+ /// </summary>\r
+ private System.ComponentModel.IContainer components = null;\r
+\r
+ /// <summary> \r
+ /// Clean up any resources being used.\r
+ /// </summary>\r
+ /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>\r
+ protected override void Dispose(bool disposing) {\r
+ if (disposing && (components != null)) {\r
+ components.Dispose();\r
+ }\r
+ base.Dispose(disposing);\r
+ }\r
+\r
+ #region Component Designer generated code\r
+\r
+ /// <summary> \r
+ /// Required method for Designer support - do not modify \r
+ /// the contents of this method with the code editor.\r
+ /// </summary>\r
+ private void InitializeComponent() {\r
+ components = new System.ComponentModel.Container();\r
+ //this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;\r
+ \r
+ }\r
+\r
+ #endregion\r
+ }\r
+}\r
--- /dev/null
+using System;\r
+using System.Collections.Generic;\r
+using System.ComponentModel;\r
+using System.Drawing;\r
+using System.Data;\r
+using System.Linq;\r
+using System.Text;\r
+using System.Threading.Tasks;\r
+using System.Windows.Forms;\r
+\r
+namespace TrafficClient {\r
+ public partial class CustomDataGridView : DataGridView {\r
+ public CustomDataGridView() {\r
+ InitializeComponent();\r
+ this.HorizontalScrollBar.Visible = true;\r
+ this.HorizontalScrollBar.VisibleChanged += new EventHandler(HorizontalScrollBar_VisibleChanged);\r
+ //this.HorizontalScrollBar.SetBounds(this.HorizontalScrollBar.Location.X, this.HorizontalScrollBar.Location.Y, this.VerticalScrollBar.Width, this.Height);\r
+ }\r
+\r
+ void HorizontalScrollBar_VisibleChanged(object sender, EventArgs e) {\r
+ this.VerticalScrollBar.Visible = true;\r
+ }\r
+ }\r
+}\r
}\r
}\r
\r
+ /// <summary>\r
+ /// Looks up a localized string similar to Következő adás időpontja.\r
+ /// </summary>\r
+ internal static string KOVETKEZO_ADASNAP {\r
+ get {\r
+ return ResourceManager.GetString("KOVETKEZO_ADASNAP", resourceCulture);\r
+ }\r
+ }\r
+ \r
/// <summary>\r
/// Looks up a localized string similar to Mégse.\r
/// </summary>\r
<data name="KERESES_EREDMENYE" xml:space="preserve">\r
<value>Keresés eredménye</value>\r
</data>\r
+ <data name="KOVETKEZO_ADASNAP" xml:space="preserve">\r
+ <value>Következő adás időpontja</value>\r
+ </data>\r
<data name="MEGSE" xml:space="preserve">\r
<value>Mégse</value>\r
</data>\r
cliFSPReader = new CliFSPReader();\r
}\r
\r
- //public List<MamResultWrapper> DateSearch(DateTime from, DateTime to)\r
- //{\r
- // List<clIFsp_EC_MAMResult> sqlResult = null;\r
- // List<MamResultWrapper> result = null;\r
- // SqlConnection connection = new SqlConnection(connectionString);\r
-\r
- // try\r
- // {\r
- // //ez kell?\r
- // if (connection.State != ConnectionState.Open)\r
- // {\r
- // connection.Close();\r
- // connection.Open();\r
- // }\r
-\r
- // using (SqlCommand cmd = new SqlCommand("dbo.clIFsp_EC_MAM", connection))\r
- // {\r
- // cmd.CommandType = CommandType.StoredProcedure;\r
- // cmd.Parameters.AddWithValue("@Operation", 1001);\r
- // cmd.Parameters.AddWithValue("@@@Options", 0);\r
- // cmd.Parameters.AddWithValue("@@ItemID", DBNull.Value);\r
- // cmd.Parameters.AddWithValue("@@DateParam1", from.Date);\r
- // cmd.Parameters.AddWithValue("@@DateParam2", to.Date);\r
- // using (SqlDataReader reader = cmd.ExecuteReader())\r
- // {\r
- // while (reader.Read())\r
- // {\r
- // if (sqlResult == null)\r
- // sqlResult = new List<clIFsp_EC_MAMResult>();\r
- // clIFsp_EC_MAMResult item = ToclIFsp_MAMResult(reader);\r
- // sqlResult.Add(item);\r
- // }\r
- // }\r
- // }\r
- // result = resultProcess(sqlResult);\r
- // }\r
- // catch (Exception e)\r
- // {\r
- // Debug.WriteLine(e.Message);\r
- // }\r
- // finally\r
- // {\r
- // connection.Close();\r
- // }\r
- // return result;\r
- //}\r
-\r
public List<MamResultWrapper> Search(string strParam, DateTime? from, DateTime? to, bool missingCopia) {\r
List<clIFsp_EC_MAMResult> sqlResult = null;\r
List<MamResultWrapper> result = null;\r
EpisodeTitle = actual.v_EpTitle,\r
Title = actual.v_ProgTitle,\r
EpisodeNumber = actual.v_EpisodeID,\r
- VariantID = actual.v_VariantID.HasValue ? actual.v_VariantID.Value : -1\r
+ VariantID = actual.v_VariantID.HasValue ? actual.v_VariantID.Value : -1,\r
+ Episode = actual.v_Episode.HasValue ? actual.v_Episode.Value : (short)-1,\r
+ NextBroadcastDate = actual.v_NextBroadcastDate\r
};\r
result.Add(actualObject);\r
}\r
}\r
return result;\r
}\r
+\r
+ public List<ArchiveMatadataWrapper> SearchArchiveMetadata(string strParam) {\r
+ List<clIFsp_EC_MAMResult> sqlResult = null;\r
+ List<ArchiveMatadataWrapper> result = null;\r
+ try {\r
+ TryConnect();\r
+ using (SqlCommand cmd = new SqlCommand("dbo.clIFsp_EC_MAM", connection)) {\r
+ cmd.CommandType = CommandType.StoredProcedure;\r
+ cmd.Parameters.AddWithValue("@Operation", 1001);\r
+ cmd.Parameters.AddWithValue("@@@Options", 40);\r
+ cmd.Parameters.AddWithValue("@@ItemID", DBNull.Value);\r
+ cmd.Parameters.AddWithValue("@@StrParam1", strParam);\r
+ sqlResult = ExecuteAndRead(cmd);\r
+ result = ProcessArchiveResult(sqlResult);\r
+ }\r
+ }\r
+ catch (Exception e) {\r
+ logger.Error(e.Message);\r
+ throw e;\r
+ }\r
+ finally {\r
+ connection.Close();\r
+ }\r
+ return result;\r
+ }\r
+\r
+ private List<ArchiveMatadataWrapper> ProcessArchiveResult(List<clIFsp_EC_MAMResult> sqlResult) {\r
+ if (sqlResult == null)\r
+ return null;\r
+ List<ArchiveMatadataWrapper> result = new List<ArchiveMatadataWrapper>();\r
+ foreach (clIFsp_EC_MAMResult actual in sqlResult) {\r
+ ArchiveMatadataWrapper actualObject = new ArchiveMatadataWrapper() {\r
+ EpisodeID = actual.v_EpisodeID,\r
+ EpisodeTitle = actual.v_EpTitle,\r
+ ProgID = actual.v_ProgrammeID.ToString(),\r
+ ProgTitle = actual.v_ProgTitle,\r
+ };\r
+ result.Add(actualObject);\r
+ }\r
+ return result;\r
+ }\r
}\r
}\r
</ItemGroup>\r
<ItemGroup>\r
<Compile Include="clIFsp_EC_SegmentResult.cs" />\r
+ <Compile Include="CustomDataGridView.cs">\r
+ <SubType>Component</SubType>\r
+ </Compile>\r
+ <Compile Include="CustomDataGridView.Designer.cs">\r
+ <DependentUpon>CustomDataGridView.cs</DependentUpon>\r
+ </Compile>\r
<Compile Include="Reader.cs" />\r
<Compile Include="Resources.Designer.cs">\r
<AutoGen>True</AutoGen>\r
private void InitializeComponent()\r
{\r
this.components = new System.ComponentModel.Container();\r
- System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle();\r
this.trafficAPIBindingSource = new System.Windows.Forms.BindingSource(this.components);\r
this.backgroundWorker1 = new System.ComponentModel.BackgroundWorker();\r
this.backgroundWorker2 = new System.ComponentModel.BackgroundWorker();\r
this.backgroundWorker3 = new System.ComponentModel.BackgroundWorker();\r
this.backgroundWorker4 = new System.ComponentModel.BackgroundWorker();\r
- this.dataGridView1 = new System.Windows.Forms.DataGridView();\r
this.panel1 = new System.Windows.Forms.Panel();\r
+ this.dataGridView1 = new TrafficClient.CustomDataGridView();\r
this.scheduledDate = new System.Windows.Forms.DateTimePicker();\r
this.textBox1 = new System.Windows.Forms.TextBox();\r
this.searchButton = new System.Windows.Forms.Button();\r
this.tableLayoutPanelSearch = new System.Windows.Forms.TableLayoutPanel();\r
this.panel2 = new System.Windows.Forms.Panel();\r
((System.ComponentModel.ISupportInitialize)(this.trafficAPIBindingSource)).BeginInit();\r
- ((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).BeginInit();\r
this.panel1.SuspendLayout();\r
+ ((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).BeginInit();\r
this.flowLayoutPanel1.SuspendLayout();\r
this.tableLayoutPanelSearch.SuspendLayout();\r
this.panel2.SuspendLayout();\r
this.SuspendLayout();\r
// \r
+ // panel1\r
+ // \r
+ this.panel1.Controls.Add(this.dataGridView1);\r
+ this.panel1.Dock = System.Windows.Forms.DockStyle.Fill;\r
+ this.panel1.Location = new System.Drawing.Point(0, 62);\r
+ this.panel1.Name = "panel1";\r
+ this.panel1.Size = new System.Drawing.Size(263, 217);\r
+ this.panel1.TabIndex = 11;\r
+ // \r
// dataGridView1\r
// \r
this.dataGridView1.AllowUserToAddRows = false;\r
this.dataGridView1.AllowUserToDeleteRows = false;\r
this.dataGridView1.AllowUserToResizeRows = false;\r
this.dataGridView1.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.DisplayedCells;\r
- this.dataGridView1.AutoSizeRowsMode = System.Windows.Forms.DataGridViewAutoSizeRowsMode.DisplayedCells;\r
this.dataGridView1.BackgroundColor = System.Drawing.Color.White;\r
this.dataGridView1.BorderStyle = System.Windows.Forms.BorderStyle.None;\r
this.dataGridView1.CellBorderStyle = System.Windows.Forms.DataGridViewCellBorderStyle.Raised;\r
this.dataGridView1.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;\r
- dataGridViewCellStyle1.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;\r
- dataGridViewCellStyle1.BackColor = System.Drawing.SystemColors.Window;\r
- dataGridViewCellStyle1.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(238)));\r
- dataGridViewCellStyle1.ForeColor = System.Drawing.SystemColors.ControlText;\r
- dataGridViewCellStyle1.SelectionBackColor = System.Drawing.Color.Gainsboro;\r
- dataGridViewCellStyle1.SelectionForeColor = System.Drawing.Color.Black;\r
- dataGridViewCellStyle1.WrapMode = System.Windows.Forms.DataGridViewTriState.False;\r
- this.dataGridView1.DefaultCellStyle = dataGridViewCellStyle1;\r
this.dataGridView1.Dock = System.Windows.Forms.DockStyle.Fill;\r
this.dataGridView1.EditMode = System.Windows.Forms.DataGridViewEditMode.EditProgrammatically;\r
this.dataGridView1.Location = new System.Drawing.Point(0, 0);\r
- this.dataGridView1.Margin = new System.Windows.Forms.Padding(6);\r
this.dataGridView1.MultiSelect = false;\r
this.dataGridView1.Name = "dataGridView1";\r
- this.dataGridView1.RowHeadersVisible = false;\r
- this.dataGridView1.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect;\r
this.dataGridView1.Size = new System.Drawing.Size(263, 217);\r
- this.dataGridView1.TabIndex = 1;\r
+ this.dataGridView1.TabIndex = 0;\r
this.dataGridView1.CellContentClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.dataGridView1_CellContentClick);\r
this.dataGridView1.CellDoubleClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.dataGridView1_CellDoubleClick);\r
// \r
- // panel1\r
- // \r
- this.panel1.Controls.Add(this.dataGridView1);\r
- this.panel1.Dock = System.Windows.Forms.DockStyle.Fill;\r
- this.panel1.Location = new System.Drawing.Point(0, 62);\r
- this.panel1.Name = "panel1";\r
- this.panel1.Size = new System.Drawing.Size(263, 217);\r
- this.panel1.TabIndex = 11;\r
- // \r
// scheduledDate\r
// \r
this.scheduledDate.CustomFormat = " ";\r
this.Name = "TrafficIDSelector";\r
this.Size = new System.Drawing.Size(263, 279);\r
((System.ComponentModel.ISupportInitialize)(this.trafficAPIBindingSource)).EndInit();\r
- ((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).EndInit();\r
this.panel1.ResumeLayout(false);\r
+ ((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).EndInit();\r
this.flowLayoutPanel1.ResumeLayout(false);\r
this.flowLayoutPanel1.PerformLayout();\r
this.tableLayoutPanelSearch.ResumeLayout(false);\r
private System.ComponentModel.BackgroundWorker backgroundWorker3;\r
private System.ComponentModel.BackgroundWorker backgroundWorker4;\r
private System.Windows.Forms.Panel panel1;\r
- private System.Windows.Forms.DataGridView dataGridView1;\r
private System.Windows.Forms.DateTimePicker scheduledDate;\r
private System.Windows.Forms.TextBox textBox1;\r
private System.Windows.Forms.Button searchButton;\r
private System.Windows.Forms.RadioButton radioButtonPromo;\r
private System.Windows.Forms.RadioButton radioButtonAD;\r
private System.Windows.Forms.Panel panel2;\r
+ private CustomDataGridView dataGridView1;\r
}\r
}\r
using System.Windows.Forms;\r
using System;\r
using System.Drawing;\r
+using System.ComponentModel;\r
\r
namespace TrafficClient {\r
public delegate void OnSelectedIDChanged(string ID, int variantID);\r
public TrafficIDSelector() {\r
InitializeComponent();\r
InitializeTexts();\r
- test();\r
+ //test();\r
panel1.Dock = DockStyle.Fill;\r
+\r
}\r
\r
private void test() {\r
HeaderText = Resources.TRAFFIC_ID\r
},\r
new DataGridViewTextBoxColumn() {\r
- AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill,\r
+ AutoSizeMode = DataGridViewAutoSizeColumnMode.DisplayedCells,\r
DataPropertyName = "Title",\r
HeaderText = Resources.CIM\r
},\r
new DataGridViewTextBoxColumn() {\r
- AutoSizeMode = DataGridViewAutoSizeColumnMode.ColumnHeader,\r
+ AutoSizeMode = DataGridViewAutoSizeColumnMode.DisplayedCells,\r
DataPropertyName = "EpisodeTitle",\r
HeaderText = Resources.EPIZOD_CIM\r
},\r
new DataGridViewTextBoxColumn() {\r
- AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill,\r
- DataPropertyName = "EpisodeNumber",\r
+ AutoSizeMode = DataGridViewAutoSizeColumnMode.DisplayedCells,\r
+ DataPropertyName = "Episode",\r
HeaderText = Resources.EPIZOD\r
+ },\r
+ new DataGridViewTextBoxColumn() {\r
+ AutoSizeMode = DataGridViewAutoSizeColumnMode.DisplayedCells,\r
+ DataPropertyName = "NextBroadcastDate",\r
+ HeaderText = Resources.KOVETKEZO_ADASNAP\r
}\r
}\r
);\r
return;\r
}\r
dataGridView1.DataSource = result;\r
+ //dataGridView1.Sort(dataGridView1.Columns[5], ListSortDirection.Ascending);\r
}\r
\r
private void textBox1_KeyDown(object sender, KeyEventArgs e) {\r
else\r
res.Selected = false;\r
if (checkBoxCell.Value.Equals(true)) {\r
- \r
+\r
IDChangedEvent?.Invoke(res.MediaID, res.VariantID);\r
} else\r
IDChangedEvent?.Invoke(string.Empty, 0);\r
public string Title { get; set; }\r
public string EpisodeTitle { get; set; }\r
public string EpisodeNumber { get; set; }\r
-\r
public int VariantID { get; set; }\r
+ public short Episode { get; set; }\r
+ public DateTime? NextBroadcastDate { get; set; }\r
+ }\r
+\r
+ public class ArchiveMatadataWrapper {\r
+\r
+ public string ProgTitle { get; set; }\r
+ public string ProgDescription { get; set; }\r
+ public string ProgID { get; set; }\r
+ public string EpisodeTitle { get; set; }\r
+ public string EpisodeDescription { get; set; }\r
+ public string EpisodeID { get; set; }\r
}\r
}\r
\r
List<DBObject> getStoryFoldersByPlaceHolderId(String placeHolderID);\r
\r
+ List<DBObject> getStoriesByPlaceHolderId(String placeHolderID);\r
+ \r
List<DBObject> getStories();\r
\r
List<DBObject> getStoriesByIDRegex(String id);\r
}\r
return mosObjectsResult;\r
}\r
+\r
+ @Override\r
+ public List<DBObject> getStoriesByPlaceHolderId(String placeHolderID) {\r
+ List<DBObject> result = new ArrayList<>();\r
+ DBCollection storyCollection = db.getCollection(STORY_COLLECTION_NAME);\r
+ DBCollection rundownCollection = db.getCollection(RUNDOWN_COLLECTION_NAME);\r
+ BasicDBObject globalId = new BasicDBObject("id", placeHolderID);\r
+ BasicDBObject elemmatch = new BasicDBObject("$elemMatch", globalId);\r
+ BasicDBObject mosObjects = new BasicDBObject("mosObjects", elemmatch);\r
+ \r
+ DBCursor find = storyCollection.find(mosObjects);\r
+ if(find.hasNext())\r
+ result.add(find.next());\r
+ //result = getRundownsByReferences(find, rundownCollection, queryedRundownsFromStoryCollection, RUNDOWN);\r
+ return result;\r
+ }\r
}\r
\r
List<DBObject> actual = sut.getStoryFolders(62549297);\r
}\r
-\r
+ \r
+ @Test\r
+ public void getStoriesByPlaceHolderIdTest() throws SQLException {\r
+ sut = new OctopusAPI();\r
+ \r
+ List<DBObject> actual = sut.getStoriesByPlaceHolderId("1589225");\r
+ \r
+ Assert.assertFalse(actual.isEmpty());\r
+ }\r
+ \r
@Test\r
public void getStoryFoldersTest() throws SQLException {\r
sut = new OctopusAPI();\r
logger.trace("Entry");
Response result = null;
try {
- List<DBObject> stories = octopusService.getMosObjectsByID(id);
- result = Response.ok(stories).build();
+ List<DBObject> mosObjects = octopusService.getMosObjectsByID(id);
+ result = Response.ok(mosObjects).build();
} catch (Exception e) {
result = createErrorResponse(e);
}
logger.trace("Entry");
Response result = null;
try {
- List<DBObject> stories = octopusService.getStoryFolders(Long.parseLong(id));
- result = Response.ok(stories).build();
+ List<DBObject> storyFolders = octopusService.getStoryFolders(Long.parseLong(id));
+ result = Response.ok(storyFolders).build();
} catch (Exception e) {
result = createErrorResponse(e);
}
logger.trace("Entry");
Response result = null;
try {
- List<DBObject> stories = octopusService.getRundownByStoryID(Long.parseLong(id));
- result = Response.ok(stories).build();
+ List<DBObject> rundowns = octopusService.getRundownByStoryID(Long.parseLong(id));
+ result = Response.ok(rundowns).build();
+ } catch (Exception e) {
+ result = createErrorResponse(e);
+ }
+ logger.trace("Exit");
+ return result;
+ }
+
+ @GET
+ @Path("/getRundownsByPlaceHolderId/{id}")
+ @Consumes({ MediaType.APPLICATION_JSON })
+ @Produces({ MediaType.APPLICATION_JSON })
+ public Response getRundownsByPlaceHolderId(@PathParam("id") String id) {
+ logger.trace("Entry");
+ Response result = null;
+ try {
+ List<DBObject> rundowns = octopusService.getRundownsByPlaceHolderId(id);
+ result = Response.ok(rundowns).build();
+ } catch (Exception e) {
+ result = createErrorResponse(e);
+ }
+ logger.trace("Exit");
+ return result;
+ }
+
+ @GET
+ @Path("/getStoryFoldersByPlaceHolderId/{id}")
+ @Consumes({ MediaType.APPLICATION_JSON })
+ @Produces({ MediaType.APPLICATION_JSON })
+ public Response getStoryFoldersByPlaceHolderId(@PathParam("id") String id) {
+ logger.trace("Entry");
+ Response result = null;
+ try {
+ List<DBObject> storyFolders = octopusService.getStoryFoldersByPlaceHolderId(id);
+ result = Response.ok(storyFolders).build();
} catch (Exception e) {
result = createErrorResponse(e);
}
return result;
}
+ @GET
+ @Path("/getStoriesByPlaceHolderId/{id}")
+ @Consumes({ MediaType.APPLICATION_JSON })
+ @Produces({ MediaType.APPLICATION_JSON })
+ public Response getStoriesByPlaceHolderId(@PathParam("id") String id) {
+ logger.trace("Entry");
+ Response result = null;
+ try {
+ List<DBObject> stories = octopusService.getStoriesByPlaceHolderId(id);
+ result = Response.ok(stories).build();
+ } catch (Exception e) {
+ result = createErrorResponse(e);
+ }
+ logger.trace("Exit");
+ return result;
+ }
}
\ No newline at end of file