\r
public class CopyForArchiveNEXIOMaterialsStep extends JobStep {\r
private static final String SCHEDULED_FORMAT = "yyyy.MM.dd HH:mm";\r
- private static final Logger logger = LogManager.getLogger();\r
+ private static final Logger logger = LogManager.getLogger("CopyForArchiveNEXIOMaterialsStep");\r
private static final String UTF_8 = "utf-8";\r
private static final String JSON_EXT = ".json";\r
private static final String XML_EXT = ".xml";\r
private static final String DURATION = "duration";\r
private static final String MXFEXT = ".MXF";\r
- private static final String NEXIOCLIPS = "nexioclips";\r
+ private static final String NEXIOCLIPS = SystemConfiguration.getInstance().value("services.nexio.collection-name", "nexioclips");\r
private static final String LONGNAMEID = "longnameid";\r
private static final String ARCHIVEDRUNDOWNS = "archivedrundowns";\r
private static final String ID = "id";\r
public Object[] execute(int nexioPort, String nexioUserName, String nexioPassword, String archiveFtp, String archiveUserName, String archivePassword,\r
int daysBeforeNow, int nexioKillDateDays, String nexioAgency, IJobEngine jobEngine, IJobRuntime jobRuntime) throws Exception {\r
systemMarker = getMarker();\r
- logger.info(systemMarker, "test");\r
+ logger.debug(systemMarker, "debug test");\r
setAndCheck(nexioPort, nexioUserName, nexioPassword, archiveFtp, archiveUserName, archivePassword, nexioKillDateDays, nexioAgency, jobEngine);\r
octopusAPI = new OctopusAPI();\r
Calendar scheduledDate = Calendar.getInstance();\r
private FileArchive processMosObject(BasicDBObject rundown, BasicDBObject story, BasicDBObject mosObject) throws Exception {\r
String mosID = mosObject.getString(IOctopusAPI.OBJ_ID);\r
if (MetadataTypeDetector.GuessMetadataType(mosID) != MetadataType.OctopusPlaceholder) {\r
- logger.trace(systemMarker, "Skipping MOS object {}", mosID);\r
+ logger.info(systemMarker, "Skipping MOS object {}", mosID);\r
return null;\r
}\r
DBCollection clips = db.getCollection(NEXIOCLIPS);\r
BasicDBObject clip = (BasicDBObject) clips.findOne(new BasicDBObject(LONGNAMEID, mosID));\r
if (clip == null) {\r
- logger.debug(systemMarker, "File {} NOT exists", mosID);\r
+ logger.info(systemMarker, "File {} NOT exists", mosID);\r
return null;\r
//throw new Exception(String.format("File NOT exists %s", mosID));\r
} else {\r
long duration = NoSQLUtils.asLong(clip, DURATION);\r
\r
if (duration == 0) {\r
- logger.debug(systemMarker, "File {} exists with 0 frame length", mosID);\r
+ logger.info(systemMarker, "File {} exists with 0 frame length", mosID);\r
return null;\r
}\r
if (duration == 1) {\r
- logger.debug(systemMarker, "File {} exists with 1 frame length", mosID);\r
+ logger.info(systemMarker, "File {} exists with 1 frame length", mosID);\r
return null;\r
}\r
return new FileArchive(mosID, duration);\r
if (!demo)\r
logger.info(systemMarker, "Processing rundown {} {}", rundownID, rundown.getString(IOctopusAPI.NAME));\r
List<DBObject> stories = octopusAPI.getRundownFullStories(rundownID);\r
- if (stories == null)\r
+ if (stories == null) {\r
+ logger.info(systemMarker, "Rundown {} {} is empty", rundownID, rundown.getString(IOctopusAPI.NAME));\r
return null;\r
+ }\r
RundownArchive result = new RundownArchive();\r
\r
long id = NoSQLUtils.asLong(rundown, IOctopusAPI.ID);\r
if (id == 0)\r
return null;\r
String name = NoSQLUtils.asString(NoSQLUtils.asDBObject(rundown, IOctopusAPI.RUNDOWN_TYPE), IOctopusAPI.NAME);\r
- if (StringUtils.isBlank(name))\r
+ if (StringUtils.isBlank(name)) {\r
+ logger.info(systemMarker, "Rundown {} {} type is empty", rundownID, rundown.getString(IOctopusAPI.NAME));\r
return null;\r
+ }\r
String channel = NoSQLUtils.asString(NoSQLUtils.asDBObject(rundown, IOctopusAPI.CHANNEL), IOctopusAPI.NAME);\r
Date scheduledStart = rundown.getDate(IOctopusAPI.SCHEDULED_START);\r
- if (scheduledStart == null)\r
+ if (scheduledStart == null) {\r
+ logger.info(systemMarker, "Rundown {} {} schedule is empty", rundownID, rundown.getString(IOctopusAPI.NAME));\r
return null;\r
+ }\r
String start = CalendarUtils.toString(CalendarUtils.createCalendar(scheduledStart), SCHEDULED_FORMAT);\r
result.setScheduleDate(scheduledStart);\r
result.setItemHouseId(String.valueOf(id));\r
result.setItemTitle(String.format("%s %s %s", start, name, channel));\r
\r
+ logger.info(systemMarker, "Processing stories in rundown {} {}", rundownID, rundown.getString(IOctopusAPI.NAME));\r
for (DBObject s : stories) {\r
StoryArchive storyArchive = processStory(rundown, s);\r
if (storyArchive == null)\r
private void processRundowns(List<DBObject> rundowns) {\r
\r
//TODO kiveni publikálás előtt\r
- //db.getCollection(ARCHIVEDRUNDOWNS).drop();\r
+ //db.getCollection(v).drop();\r
List<BasicDBObject> archivedRundowns = queryArchivedRundowns();\r
\r
logger.info(systemMarker, "Found {} rundowns to archive", archivedRundowns.size());\r
private StoryArchive processStory(BasicDBObject rundown, DBObject s) throws Exception {\r
BasicDBObject story = (BasicDBObject) s;\r
String parentStoryID = story.getString(IOctopusAPI.PARENT_STORY_ID);\r
+ String storyID = story.getString(IOctopusAPI.ID);\r
+ \r
if (StringUtils.isBlank(parentStoryID)) {\r
logger.warn(systemMarker, "Story parentStoryID is null: {}", story.toPrettyString(null));\r
return null;\r
- } else\r
- logger.info(systemMarker, "Processing story {}", parentStoryID);\r
+ } else {\r
+ if ("475048225".equals(storyID))\r
+ logger.info(systemMarker, "Processing story {}", story.toPrettyString(null));\r
+ }\r
List<BasicDBObject> mosObjects = NoSQLUtils.asList(story, IOctopusAPI.MOS_OBJECTS);\r
if (mosObjects == null) {\r
- logger.info(systemMarker, "No MOS in story {}: {}", parentStoryID, story.toPrettyString(null));\r
- \r
+ logger.debug(systemMarker, "No MOS in story {}", storyID);\r
return null;\r
}\r
StoryArchive storyArchive = null;\r