public bool ok { get; set; }\r
public string userName { get; set; }\r
public string mediaType { get; set; }\r
+ public long duration { get; set; }\r
\r
public override string ToString() {\r
return JsonConvert.SerializeObject(this, Formatting.Indented);\r
EnsureDirectoryExistence(statusWorkDir);\r
string fileName = String.Format(METADATA_FILE, OutputName);\r
//logger.Debug("Creating METADATA file {0}", fileName);\r
+ Parameters.ArchiveMetadata.duration = Parameters.Frames;\r
byte[] content = Encoding.UTF8.GetBytes(Parameters.ArchiveMetadata.ToString());\r
string ouputPath = GetOutputFilePath(statusWorkDir, fileName);\r
UploadContent(ouputPath, content);\r
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>\r
+<jobtemplate name="Felhasználói archiválás">\r
+ <declarations>\r
+ <parameters>\r
+ <parameter name="sourcePath" type="java.lang.String" />\r
+ <parameter name="globalSourcePath" type="java.lang.String" />\r
+ <parameter name="transcoderTargetPath" type="java.lang.String" />\r
+ <parameter name="webPath" type="java.lang.String" />\r
+ <parameter name="killDateDays" type="java.lang.Integer" />\r
+ <parameter name="limit" type="java.lang.Integer" />\r
+ </parameters>\r
+ <variables>\r
+ <variable name="archiveList" type="java.util.ArrayList" />\r
+ </variables>\r
+ </declarations>\r
+ <commands>\r
+ <calljobstep id="step1" type="user.jobengine.server.steps.ArchiveListBuilderStep" weight="1">\r
+ <inputs>\r
+ <input>\r
+ <parameter name="sourcePath" />\r
+ </input>\r
+ <input>\r
+ <parameter name="limit" />\r
+ </input>\r
+ </inputs>\r
+ <outputs>\r
+ <output>\r
+ <variable name="archiveList" />\r
+ </output>\r
+ </outputs>\r
+ </calljobstep>\r
+\r
+ <calljobstep id="step2" type="user.jobengine.server.steps.ArchiveMaterialSubmitStep" weight="1">\r
+ <inputs>\r
+ <input>\r
+ <parameter name="globalSourcePath" />\r
+ </input>\r
+ <input>\r
+ <variable name="archiveList" />\r
+ </input>\r
+ <input>\r
+ <parameter name="transcoderTargetPath" />\r
+ </input>\r
+ <input>\r
+ <parameter name="webPath" />\r
+ </input>\r
+ <input>\r
+ <parameter name="killDateDays" />\r
+ </input>\r
+ </inputs>\r
+ </calljobstep>\r
+ </commands>\r
+</jobtemplate>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>\r
-<jobtemplate name="Felhasználói archiválás" multiInstance="true">\r
+<jobtemplate name="Felhasználói archiválás">\r
<declarations>\r
<parameters>\r
<parameter name="sourcePath" type="java.lang.String" />\r
public Object[] execute(String globalSourcePath, ArrayList<ArchiveItem> archiveList, String transcoderTargetPath, String webPath, int killDateDays,\r
IJobEngine jobEngine, IJobRuntime jobRuntime) throws Exception {\r
marker = jobRuntime.getMarker();\r
+ if (archiveList == null || archiveList.size() == 0)\r
+ return null;\r
+\r
if (jobRuntime.forkPrepare()) {\r
for (int i = 0; i < archiveList.size(); i++) {\r
ArchiveItem archiveItem = archiveList.get(i);\r
int killDateDays, IJobEngine jobEngine, IJobRuntime jobRuntime) throws Exception {\r
marker = (MediaCubeMarker) jobRuntime.getMarker();\r
marker.setTo(recipient);\r
+\r
+ if (basket == null || basket.size() == 0)\r
+ return null;\r
setProgress(10);\r
if (jobRuntime.forkPrepare()) {\r
for (Media mediaCubeMedia : basket) {\r
import java.nio.file.Paths;\r
import java.sql.SQLException;\r
import java.text.SimpleDateFormat;\r
+import java.time.LocalDateTime;\r
+import java.time.ZoneId;\r
import java.util.ArrayList;\r
+import java.util.Calendar;\r
import java.util.Date;\r
import java.util.HashMap;\r
import java.util.List;\r
import com.ibm.nosql.json.JSONUtil;\r
import com.ibm.nosql.json.api.BasicDBList;\r
import com.ibm.nosql.json.api.BasicDBObject;\r
+import com.ibm.nosql.json.api.DB;\r
+import com.ibm.nosql.json.api.DBCollection;\r
+import com.ibm.nosql.json.api.DBCursor;\r
import com.ibm.nosql.json.api.DBObject;\r
\r
+import user.commons.CalendarUtils;\r
+import user.commons.ListUtils;\r
import user.commons.nosql.NoSQLUtils;\r
import user.commons.octopus.IOctopusAPI;\r
import user.commons.octopus.OctopusAPI;\r
assertNotNull(stepClass);\r
}\r
\r
+ @Test\r
+ public void test7() throws Exception {\r
+ DB db = NoSQLUtils.getNoSQLDB();\r
+ DBCollection collection = db.getCollection("daily_news_history");\r
+ DBCursor cursor = collection.find(new BasicDBObject(), new BasicDBObject("dateTime", 1));\r
+ List<BasicDBObject> items = ListUtils.cast(cursor.toArray());\r
+ for (BasicDBObject item : items) {\r
+ Date date = item.getDate("dateTime");\r
+ int hour = date.getHours();\r
+ if (hour > 0) {\r
+ LocalDateTime ld = date.toInstant().atZone(ZoneId.systemDefault()).toLocalDateTime();\r
+ ld = ld.minusHours(1);\r
+ Date ndate = Date.from(ld.atZone(ZoneId.systemDefault()).toInstant());\r
+ System.out.println(item.getID() + " " + date + " " + ndate);\r
+ item.put("dateTime", ndate);\r
+ collection.save(item);\r
+ } else\r
+ System.out.println(date);\r
+ }\r
+ //collection.remove(new BasicDBObject("_id", ObjectId.massageToObjectId("5acee7ea3ff2a7bed079b13e")));\r
+ }\r
+\r
+ @Test\r
+ public void test8() throws Exception {\r
+ DB db = NoSQLUtils.getNoSQLDB();\r
+ DBCollection collection = db.getCollection("daily_news_history");\r
+ Calendar scheduledDate = CalendarUtils.createZeroCalendar();\r
+ //scheduledDate.setTimeZone(TimeZone.getTimeZone("Europe/Budapest"));\r
+\r
+ for (int i = 0; i < 30; i++) {\r
+ scheduledDate.add(Calendar.DAY_OF_YEAR, -1);\r
+ System.out.println(scheduledDate.getTime());\r
+ DBCursor cursor = collection.find(new BasicDBObject("dateTime", scheduledDate.getTime()));\r
+ List<BasicDBObject> items = ListUtils.cast(cursor.toArray());\r
+ for (BasicDBObject item : items) {\r
+ Date date = item.getDate("dateTime");\r
+ System.out.println(date);\r
+ }\r
+ }\r
+\r
+ //collection.remove(new BasicDBObject("_id", ObjectId.massageToObjectId("5acee7ea3ff2a7bed079b13e")));\r
+ }\r
+\r
// @Test\r
// public void test7() throws Exception {\r
// String x = "aaaassss";\r
import java.util.Collections;\r
import java.util.Date;\r
import java.util.List;\r
+import java.util.TimeZone;\r
\r
import org.apache.logging.log4j.LogManager;\r
import org.apache.logging.log4j.Logger;\r
@AfterCompose\r
public void afterCompose(@ContextParam(ContextType.VIEW) Component view) {\r
Selectors.wireComponents(view, this, false);\r
- Calendar calendar = CalendarUtils.createZeroCalendar();\r
- calendar.add(Calendar.DAY_OF_YEAR, -1);\r
- //calendar.setTimeZone(TimeZone.getTimeZone("Europe/Budapest"));\r
- setSelectedDate(calendar.getTime());\r
+ // Calendar calendar = CalendarUtils.createZeroCalendar();\r
+ // calendar.add(Calendar.DAY_OF_YEAR, -1);\r
+ // setSelectedDate(calendar.getTime());\r
+ setSelectedDate(new Date());\r
}\r
\r
private void clearChart(Charts charts) {\r
initChart(typeChartSumDuration);\r
initChart(planChart);\r
\r
- // Calendar scheduledDate = CalendarUtils.createZeroCalendar(selectedDate);\r
- // scheduledDate.setTimeZone(TimeZone.getTimeZone("Europe/Budapest"));\r
+ Calendar scheduledDate = CalendarUtils.createZeroCalendar(selectedDate);\r
+ scheduledDate.setTimeZone(TimeZone.getTimeZone("Europe/Budapest"));\r
\r
- BasicDBObject dateFilter = new BasicDBObject("dateTime", selectedDate);\r
+ BasicDBObject dateFilter = new BasicDBObject("dateTime", scheduledDate.getTime());\r
BasicDBObject dailyData = (BasicDBObject) collection.findOne(dateFilter);\r
if (dailyData == null) {\r
return;\r