-using NLog;\r
-using System;\r
-using System.IO;\r
-using System.Windows.Forms;\r
-using System.Text;\r
+using MaestroShared.Commons;\r
using MaestroShared.Configuration;\r
-using MaestroShared.Target;\r
using MaestroShared.Metadata;\r
-using MaestroShared.Commons;\r
using MaestroShared.Model;\r
+using MaestroShared.Target;\r
+using NLog;\r
+using System;\r
+using System.IO;\r
+using System.Text;\r
+using System.Windows.Forms;\r
\r
namespace MaestroShared.Targets {\r
\r
DeleteAfterCopy();\r
\r
ExecuteCompleted();\r
- }\r
- catch (Exception e) {\r
+ workFlowAction.successful = true;\r
+ } catch (Exception e) {\r
Status = ERROR;\r
Message = e.Message;\r
workFlowAction.description = Message;\r
+ workFlowAction.successful = false;\r
logger.Error(e);\r
- if (Parameters.TargetConfig.SendEmailOnError && !String.IsNullOrEmpty(Parameters.TargetConfig.ErrorEmailRecipient) && !String.IsNullOrEmpty(Parameters.TargetConfig.ErrorEmailPattern))\r
+ if (Parameters.TargetConfig.SendEmailOnError && !string.IsNullOrEmpty(Parameters.TargetConfig.ErrorEmailRecipient) && !String.IsNullOrEmpty(Parameters.TargetConfig.ErrorEmailPattern))\r
SendEmail(Parameters.TargetConfig.ErrorEmailRecipient, Parameters.TargetConfig.ErrorEmailPattern);\r
- }\r
- finally {\r
+ } finally {\r
AfterExecute();\r
}\r
logger.Info(PROCESSING_COMPLETED, InputName);\r
Message = "A célállomány már létezik és el van fogadva, felülírása nem lehetséges.";\r
Status = SKIPPED;\r
return false;\r
- } else \r
+ } else\r
DeleteFile(currentFile);\r
- }\r
- else {\r
+ } else {\r
Message = "A célállomány létezik, felülírása a konfiuráció alapján nem lehetséges.";\r
Status = SKIPPED;\r
return false;\r
logger.Trace(Strings.ENTRY);\r
workFlowAction.description = SUCCESS;\r
base.ExecuteCompleted();\r
- workFlowAction.successful = true;\r
if (Parameters.TargetConfig.NexioServer)\r
UploadNexioMetadata();\r
else {\r
try {\r
string message = GetDynamicText(messagePattern);\r
Parameters.MediaCubeApi.Notify(to, message);\r
- }\r
- catch (Exception e) {\r
+ } catch (Exception e) {\r
MessageBox.Show(parent, e.Message);\r
}\r
logger.Trace(Strings.EXIT);\r
try {\r
\r
Parameters?.MediaCubeApi?.Create<WorkflowAction>(workFlowAction);\r
- }\r
- catch (Exception e) {\r
+ } catch (Exception e) {\r
logger.Error(e);\r
MessageBox.Show(parent, e.Message);\r
}\r
.sort(new BasicDBObject("name", 1));\r
if (find.hasNext())\r
result = find.toArray();\r
+\r
return result;\r
}\r
\r
public List<DBObject> getRundownStories(long id, BasicDBObject fields) {\r
List<DBObject> result = null;\r
DBCollection collection = db.getCollection(STORY_COLLECTION);\r
- DBCursor find = collection.find(new BasicDBObject(REF_RUNDOWN, new BasicDBObject($ELEMMATCH, new BasicDBObject(ID, id))), fields)\r
+ DBCursor find = collection.find(new BasicDBObject(REF_RUNDOWN, new BasicDBObject($ELEMMATCH, new BasicDBObject(ID, id))))\r
.sort(new BasicDBObject("name", 1));\r
if (find.hasNext())\r
result = find.toArray();\r
+\r
+ if (result != null) {\r
+ result.forEach(o -> {\r
+ List<BasicDBObject> rds = NoSQLUtils.asList((BasicDBObject) o, REF_RUNDOWN);\r
+ if (rds != null) {\r
+ for (BasicDBObject rd : rds) {\r
+ long rundownID = NoSQLUtils.asLong(rd, ID);\r
+ if (rundownID == id) {\r
+ long position = NoSQLUtils.asLong(rd, POSITION);\r
+ o.put(POSITION, position);\r
+ break;\r
+ }\r
+ }\r
+ }\r
+ });\r
+ }\r
+\r
+ Collections.sort(result, (o1, o2) -> {\r
+ long pos1 = NoSQLUtils.asLong((BasicDBObject) o1, POSITION);\r
+ long pos2 = NoSQLUtils.asLong((BasicDBObject) o2, POSITION);\r
+ return (pos1 < pos2 ? -1 : (pos1 == pos2 ? 0 : 1));\r
+ });\r
return result;\r
}\r
\r
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;
+import java.util.TimeZone;
import javax.ws.rs.Consumes;
import javax.ws.rs.GET;
StringBuilder sb = new StringBuilder();
List<BasicDBObject> rundowns = ListUtils.cast(octopusService.getRundowns(null));
- SimpleDateFormat sdt = new SimpleDateFormat("yyyy.MM.dd hh:mm");
+ SimpleDateFormat sdt = new SimpleDateFormat("yyyy.MM.dd HH:mm");
+ sdt.setTimeZone(TimeZone.getTimeZone("Europe/Prague"));
for (BasicDBObject rundown : rundowns) {
String name = rundown.getString(IOctopusAPI.NAME);
}
result = Response.ok(sb.toString()).build();
+ // String a = TimeZone.getDefault().getDisplayName();
+ // String b = TimeZone.getDefault().getID();
+ // result = Response.ok(b + " " + a).build();
} catch (Exception e) {
result = createErrorResponse(e);
}