Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Import-Package: org.apache.commons.io.filefilter;version="2.2.0",
org.apache.commons.io.output;version="2.2.0",
+ org.apache.commons.logging,
org.apache.commons.net.ftp;version="3.6.0",
org.apache.ibatis.jdbc;version="3.5.2",
org.codehaus.groovy.control;version="3.0.3",
octopus:\r
api:\r
address: http://192.168.224.128:91/api/v1\r
- user: mama\r
+ user: mam\r
password: napocska\r
# rundowns-collection-name: rundowns\r
# stories-collection-name: stories\r
package hu.user.mediacube.executors.tests;\r
\r
-import java.util.Date;\r
import java.util.List;\r
\r
import org.junit.Test;\r
\r
-import com.ibm.nosql.json.api.DBObject;\r
+import com.ibm.nosql.json.api.BasicDBObject;\r
\r
+import user.commons.configuration.SystemConfiguration;\r
+import user.commons.nosql.NoSQLUtils;\r
import user.commons.octopus.IOctopusAPI;\r
-import user.commons.octopus.OctopusAPI;\r
+import user.jobengine.server.steps.shared.OctopusDataMiner;\r
\r
public class OctopusTests {\r
+ private OctopusDataMiner sut = null;\r
+\r
@Test\r
public void test0() throws Exception {\r
- IOctopusAPI api = new OctopusAPI();\r
- List<DBObject> rundowns = api.getRundowns(new Date());\r
+ String address = SystemConfiguration.getInstance().value("services.octopus.api.address");\r
+ String user = SystemConfiguration.getInstance().value("services.octopus.api.user");\r
+ String pwd = SystemConfiguration.getInstance().value("services.octopus.api.password");\r
+\r
+ sut = new OctopusDataMiner(address, user, pwd);\r
+ List<BasicDBObject> rundowns = NoSQLUtils.asList(sut.queryRundowns());\r
rundowns.forEach(r -> processRundown(r));\r
}\r
\r
- private void processRundown(DBObject r) {\r
+ private void processRundown(BasicDBObject r) {\r
// NoSQLUtils.asString(r, null))\r
- System.out.println(r);\r
+ String rundownId = r.getString(IOctopusAPI.ID);\r
+ Object rundownName = r.get(IOctopusAPI.NAME);\r
+ System.out.println(rundownId + " - " + rundownName);\r
+\r
+ List<BasicDBObject> slugs = NoSQLUtils.asList(sut.queryRundown(r, OctopusDataMiner.FIELDS_RUNDOWN_STORYIDS),\r
+ OctopusDataMiner.SLUGS);\r
+ if (slugs != null)\r
+ slugs.forEach(s -> processSlug(s));\r
+ }\r
+\r
+ private void processSlug(BasicDBObject s) {\r
+ long storyId = s.getLong(IOctopusAPI.STORYID);\r
+ BasicDBObject story = sut.queryStory(storyId);\r
+ sut.normalizeStory(story);\r
+ String location = story.getString(IOctopusAPI.LOCATION);\r
+ if (location != null)\r
+ System.out.println(story.toPrettyString(""));\r
}\r
\r
}\r
import user.jobengine.server.steps.ArchiveItem;\r
import user.jobengine.server.steps.TSMExtendedRetrieveStep;\r
import user.jobengine.server.steps.shared.EscortFiles;\r
-import user.jobengine.server.steps.shared.ExternalCommandExecutor;\r
import user.jobengine.server.steps.shared.FFMpeg;\r
import user.jobengine.server.steps.shared.MediaCubeClient;\r
\r
\r
@Test\r
public void test999995() throws Exception {\r
+ // (InformOption_HTML(\r
long progress[] = { 0, 0 };\r
- System.setProperty("user.dir", "c:\\temp");\r
- System.setProperty("jna.library.path", "c:\\temp");\r
- System.setProperty("java.library.path", "c:\\temp");\r
- MediaArea ma = new MediaArea(Paths.get("c:\\_workspace\\data\\video\\1.mxf"));\r
- System.out.println(ma.inform());\r
- ma.process();\r
- System.out.println(ma.getFrameCount());\r
-\r
- ExternalCommandExecutor executor = new ExternalCommandExecutor();\r
- executor.execute("profile1", "c:\\_workspace\\data\\video\\1.mxf", "c:\\_video\\test1.mp4", e -> {\r
- String[] values = e.split("=");\r
- if ("frame".equals(values[0])) {\r
- progress[1] = Integer.parseInt(values[1]);\r
-\r
- long p = (int) (progress[1] * 100) / progress[0];\r
- if (p > 0)\r
- System.out.println(p);\r
- }\r
- });\r
+ System.setProperty("user.dir", "c:/apps/MediaInfo");\r
+ System.setProperty("jna.library.path", "c:/apps/MediaInfo");\r
+ System.setProperty("java.library.path", "c:/apps/MediaInfo");\r
+ MediaArea ma = new MediaArea(Paths.get("d:/output.mov"));\r
+ BasicDBObject informJSON = ma.informJSON();\r
+\r
+ System.out.println(informJSON.toPrettyString(""));\r
+\r
+// ma.process();\r
+// System.out.println(ma.getFrameCount());\r
+//\r
+// ExternalCommandExecutor executor = new ExternalCommandExecutor();\r
+// executor.execute("profile1", "c:\\_workspace\\data\\video\\1.mxf", "c:\\_video\\test1.mp4", e -> {\r
+// String[] values = e.split("=");\r
+// if ("frame".equals(values[0])) {\r
+// progress[1] = Integer.parseInt(values[1]);\r
+//\r
+// long p = (int) (progress[1] * 100) / progress[0];\r
+// if (p > 0)\r
+// System.out.println(p);\r
+// }\r
+// });\r
}\r
\r
@Test\r
public class ValidateProResStep extends JobStep {\r
private static final double FRAMERATE = 23.976;\r
private static final String PRORES = "PRORES";\r
+ private static final String _422_HQ = "422 HQ";\r
private static final Logger logger = LogManager.getLogger();\r
\r
@StepEntry\r
Map<String, MediaArea> result = inputFiles.entrySet().stream().filter(fileEntry -> {\r
String fileLocation = fileEntry.getKey();\r
MediaArea mediaArea = inputFiles.get(fileLocation);\r
- String videoFormat = mediaArea.getFormat();\r
- boolean isProRes = mediaArea.getFrameRate() == FRAMERATE && videoFormat != null\r
- && videoFormat.toUpperCase().equals(PRORES);\r
+\r
+ boolean isProRes = isProRes(mediaArea);\r
+\r
logger.info(getMarker(), "{} is PRORES {}", fileLocation, isProRes);\r
i[0]++;\r
progress[0] = i[0] * 100 / inputFiles.size();\r
\r
return new Object[] { result };\r
}\r
+\r
+ private boolean isProRes(MediaArea mediaArea) {\r
+ boolean isProRes = mediaArea.getFrameRate() == FRAMERATE;\r
+ isProRes = PRORES.equals(mediaArea.getFormat()) && isProRes;\r
+ isProRes = _422_HQ.equals(mediaArea.getFormatProfileName()) && isProRes;\r
+ return isProRes;\r
+ }\r
}\r
private static final String SAVING_STORY_ID = "Saving story {}";\r
private static final String FIELDS_STORIES = "id,name,modified,type,format,mosObjects,script,scheduleFrom,scheduleTo,customColumns,CustomColumn.label,CustomColumn.value,reporters,User.longName,User.userName,descriptions,StoryDescription.text";\r
private static final String FIELDS_RUNDOWN = "id,name,modified,scheduledStart,channel,Channel.name,rundownType,RundownType.name";\r
- private static final String FIELDS_RUNDOWN_STORYIDS = "id,slugs,Slug.storyId,Slug.position";\r
+ public static final String FIELDS_RUNDOWN_STORYIDS = "id,slugs,Slug.storyId,Slug.position";\r
+ public static final String SLUGS = "slugs";\r
private static final String FIELDS_STORYFOLDER = "id,name,modified";\r
private static final String FIELDS_STORYFOLDER_STORYIDS = "id,stories,Story.id";\r
private static final String RUNDOWN = "Rundown";\r
if (objId == null)\r
continue;\r
\r
- logger.info("MOS ID: {}", objId);\r
+ // logger.info("MOS ID: {}", objId);\r
\r
MetadataType metadataType = MetadataTypeDetector.GuessMetadataType(objId);\r
if (!MetadataType.OctopusPlaceholder.equals(metadataType)\r
return rundowns;\r
}\r
\r
- private BasicDBObject queryRundown(BasicDBObject rundown, String fields) {\r
+ public BasicDBObject queryRundown(BasicDBObject rundown, String fields) {\r
logger.trace(ENTER);\r
BasicDBObject result = null;\r
long id = NoSQLUtils.asLong(rundown, IOctopusAPI.ID);\r
return result;\r
}\r
\r
- private BasicDBList queryRundowns() {\r
+ public BasicDBList queryRundowns() {\r
logger.trace(ENTER);\r
BasicDBList result = null;\r
Builder query = query(RUNDOWN, FIELDS_RUNDOWN);\r
return result;\r
}\r
\r
- private BasicDBObject queryStory(long storyID) {\r
+ public BasicDBObject queryStory(long storyID) {\r
logger.trace(ENTER);\r
BasicDBObject result = null;\r
Response response = query(String.format("%s/%d", STORY, storyID), FIELDS_STORIES).get();\r
logger.error("Missing id in story {}", story.toPrettyString(null));\r
return;\r
}\r
- long storyID = story.getLong(IOctopusAPI.ID);\r
\r
- story.put(IOctopusAPI.MODIFIED, toDate(story, IOctopusAPI.MODIFIED));\r
- story.put(IOctopusAPI.SCHEDULEFROM, toDate(story, IOctopusAPI.SCHEDULEFROM));\r
- story.put(IOctopusAPI.SCHEDULETO, toDate(story, IOctopusAPI.SCHEDULETO));\r
+ normalizeStory(story);\r
+\r
+ long storyID = story.getLong(IOctopusAPI.ID);\r
BasicDBList rundownRef = storyRundowns.get(storyID);\r
BasicDBList storyFolderRef = storyStoryFolders.get(storyID);\r
- BasicDBList modifiedMOS = extractRelevantMOSObjects(story);\r
DBCollection collection = db.getCollection(IOctopusAPI.STORY_COLLECTION);\r
-\r
if (rundownRef != null)\r
story.put(IOctopusAPI.REF_RUNDOWN, rundownRef);\r
if (storyFolderRef != null)\r
story.put(IOctopusAPI.REF_STORYFOLDER, storyFolderRef);\r
\r
+ logger.debug(SAVING_STORY_ID, storyID);\r
+ setObjectID(currentStories, storyID, story);\r
+ if (!disableWrite)\r
+ collection.save(story);\r
+ logger.trace(EXIT);\r
+ }\r
+\r
+ public void normalizeStory(BasicDBObject story) {\r
+ story.put(IOctopusAPI.MODIFIED, toDate(story, IOctopusAPI.MODIFIED));\r
+ story.put(IOctopusAPI.SCHEDULEFROM, toDate(story, IOctopusAPI.SCHEDULEFROM));\r
+ story.put(IOctopusAPI.SCHEDULETO, toDate(story, IOctopusAPI.SCHEDULETO));\r
+\r
String scriptContent = extractScriptContent(story);\r
story.put(IOctopusAPI.SCRIPT_CONTENT, scriptContent);\r
- story.remove(IOctopusAPI.SCRIPT);\r
\r
+ BasicDBList modifiedMOS = extractRelevantMOSObjects(story);\r
if (modifiedMOS == null || modifiedMOS.isEmpty())\r
story.remove(IOctopusAPI.MOS_OBJECTS);\r
else\r
story.put(IOctopusAPI.MOS_OBJECTS, modifiedMOS);\r
\r
BasicDBObject customColumns = getCustomColumns(story);\r
+ logger.info(customColumns.toPrettyString(""));\r
String parentStoryId = NoSQLUtils.asString(customColumns, IOctopusAPI.PARENT_STORY_ID);\r
if (parentStoryId == null) {\r
- logger.warn("Missing {} in story", IOctopusAPI.PARENT_STORY_ID, story.toPrettyString(null));\r
- story.append(IOctopusAPI.PARENT_STORY_ID, storyID);\r
- } else\r
- story.append(IOctopusAPI.PARENT_STORY_ID, parentStoryId);\r
-\r
+ // logger.warn("Missing {} in story", IOctopusAPI.PARENT_STORY_ID,\r
+ // story.toPrettyString(null));\r
+ parentStoryId = story.getString(IOctopusAPI.ID);\r
+ }\r
+ story.append(IOctopusAPI.PARENT_STORY_ID, parentStoryId);\r
String location = NoSQLUtils.asString(customColumns, IOctopusAPI.LOCATION_HU);\r
- story.append(IOctopusAPI.LOCATION, location);\r
- story.append(IOctopusAPI.DESCRIPTIONS, getDescriptions(story));\r
+ if (location != null && location.trim().length() > 0)\r
+ story.append(IOctopusAPI.LOCATION, location);\r
\r
- story.remove(IOctopusAPI.CUSTOM_COLUMNS);\r
+ String descriptions = getDescriptions(story);\r
+ if (descriptions != null && descriptions.trim().length() > 0)\r
+ story.append(IOctopusAPI.DESCRIPTIONS, descriptions);\r
\r
- logger.debug(SAVING_STORY_ID, storyID);\r
- setObjectID(currentStories, storyID, story);\r
- if (!disableWrite)\r
- collection.save(story);\r
- logger.trace(EXIT);\r
+ story.remove(IOctopusAPI.CUSTOM_COLUMNS);\r
+ story.remove(IOctopusAPI.SCRIPT);\r
+ story.remove(IOctopusAPI.DESCRIPTIONS);\r
}\r
\r
private void storeStoryFolder(BasicDBObject storyFolder) {\r
package user.commons.mediaarea;\r
\r
import java.nio.file.Path;\r
+import java.util.Collections;\r
+import java.util.Map;\r
+\r
+import com.ibm.nosql.json.api.BasicDBObject;\r
\r
public class MediaArea {\r
\r
private String formatProfile = "";\r
private long frameCount;\r
private double frameRate;\r
- private String format;\r
+ private String format = "";\r
\r
public MediaArea(Path filePath) {\r
this.filePath = filePath;\r
return result;\r
}\r
\r
+ public BasicDBObject informJSON() {\r
+ BasicDBObject result = null;\r
+ // auto closable\r
+ try (MediaInfo mi = new MediaInfo(filePath.toAbsolutePath().toString())) {\r
+ Map<String, MediaMetadata> data = InformParser.parse(mi.inform());\r
+\r
+ result = new BasicDBObject();\r
+ for (MediaMetadata md : data.values()) {\r
+ result.append(md.getType(),\r
+ new BasicDBObject(Collections.<String, Object>unmodifiableMap(md.getMetaData())));\r
+ }\r
+\r
+ } catch (Exception ex) {\r
+ throw new RuntimeException(ex);\r
+ }\r
+ return result;\r
+ }\r
+\r
public void process() throws Exception {\r
// auto closable\r
try (MediaInfo mi = new MediaInfo(filePath.toAbsolutePath().toString())) {\r
import user.commons.nosql.NoSQLUtils;\r
\r
public class OctopusAPI implements IOctopusAPI {\r
- //private static final Logger logger = LogManager.getLogger();\r
+ // private static final Logger logger = LogManager.getLogger();\r
\r
public OctopusAPI() throws SQLException {\r
\r
}\r
}\r
\r
- private List<DBObject> getReferencedObjects(List<DBObject> stories, String referenceCollectionName, String referenceField) {\r
+ private List<DBObject> getReferencedObjects(List<DBObject> stories, String referenceCollectionName,\r
+ String referenceField) {\r
List<Long> ids = null;\r
for (DBObject story : stories) {\r
if (story == null)\r
\r
@Override\r
public String getRundownContent(long id) {\r
- BasicDBObject fields = new BasicDBObject(ID, 1).append(PARENT_STORY_ID, 1)\r
- .append(NAME, 1)\r
- .append(MODIFIED, 1)\r
- .append(REF_RUNDOWN, 1)\r
- .append(FORMAT, 1)\r
- .append(MOS_OBJECTS, 1)\r
- .append(SCRIPT_CONTENT, 1);\r
+ BasicDBObject fields = new BasicDBObject(ID, 1).append(PARENT_STORY_ID, 1).append(NAME, 1).append(MODIFIED, 1)\r
+ .append(REF_RUNDOWN, 1).append(FORMAT, 1).append(MOS_OBJECTS, 1).append(SCRIPT_CONTENT, 1);\r
List<DBObject> stories = getRundownStories(id, fields);\r
return getRundownContent(stories);\r
}\r
List<DBObject> result = null;\r
DB db = NoSQLUtils.getNoSQLDB();\r
DBCollection collection = db.getCollection(STORY_COLLECTION);\r
- DBCursor find = collection.find(new BasicDBObject(REF_RUNDOWN, new BasicDBObject($ELEMMATCH, new BasicDBObject(ID, id))))\r
+ DBCursor find = collection\r
+ .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
@Override\r
public List<DBObject> getRundowns(Date scheduledDate) {\r
List<DBObject> result = null;\r
- //ensureDB();\r
+ // ensureDB();\r
DB db1 = NoSQLUtils.getNoSQLDB();\r
\r
DBCollection collection = db1.getCollection(RUNDOWN_COLLECTION);\r
if (scheduledDate == null) {\r
query = builder.get();\r
} else {\r
- query = builder\r
- .and(QueryBuilder.start(SCHEDULED_START).greaterThanEquals(calStart.getTime()).get(),\r
- QueryBuilder.start(SCHEDULED_START).lessThan(calStop.getTime()).get())\r
- .get();\r
+ query = builder.and(QueryBuilder.start(SCHEDULED_START).greaterThanEquals(calStart.getTime()).get(),\r
+ QueryBuilder.start(SCHEDULED_START).lessThan(calStop.getTime()).get()).get();\r
}\r
\r
- //logger.info(query);\r
+ // logger.info(query);\r
DBCursor find = collection.find(query).sort(new BasicDBObject(SCHEDULED_START, new BasicDBList(1, $DATE)));\r
if (find.hasNext())\r
result = find.toArray();\r
\r
@Override\r
public List<DBObject> getRundownsByPlaceHolderID(String id) {\r
- //db.testStoryCollection.find({"mosObjects": {$elemMatch: {"globalId": "OCTOPUS-ECHOTV-2429902"}}})\r
+ // db.testStoryCollection.find({"mosObjects": {$elemMatch: {"globalId":\r
+ // "OCTOPUS-ECHOTV-2429902"}}})\r
DB db = NoSQLUtils.getNoSQLDB();\r
DBCollection storyCollection = db.getCollection(STORY_COLLECTION);\r
- BasicDBObject criteria = new BasicDBObject(MOS_OBJECTS, new BasicDBObject($ELEMMATCH, new BasicDBObject(OBJ_ID, id)));\r
+ BasicDBObject criteria = new BasicDBObject(MOS_OBJECTS,\r
+ new BasicDBObject($ELEMMATCH, new BasicDBObject(OBJ_ID, id)));\r
DBCursor find = storyCollection.find(criteria, new BasicDBObject(REF_RUNDOWN, 1));\r
- //List<DBObject> rundowns = NoSQLUtils.asList(find);\r
+ // List<DBObject> rundowns = NoSQLUtils.asList(find);\r
if (!find.hasNext()) {\r
find.close();\r
return null;\r
DBCollection collection = db.getCollection(STORY_COLLECTION);\r
DBCursor find = collection\r
.find(new BasicDBObject(REF_RUNDOWN, new BasicDBObject($ELEMMATCH, new BasicDBObject(ID, id))),\r
- new BasicDBObject(ID, 1).append(PARENT_STORY_ID, 1)\r
- .append(NAME, 1)\r
- .append(MODIFIED, 1)\r
- .append(REF_RUNDOWN, 1)\r
- .append(FORMAT, 1)\r
- .append(MOS_OBJECTS, 1))\r
+ new BasicDBObject(ID, 1).append(PARENT_STORY_ID, 1).append(NAME, 1).append(MODIFIED, 1)\r
+ .append(REF_RUNDOWN, 1).append(FORMAT, 1).append(MOS_OBJECTS, 1))\r
.sort(new BasicDBObject("name", 1));\r
if (find.hasNext())\r
result = find.toArray();\r
List<DBObject> result = null;\r
DB db = NoSQLUtils.getNoSQLDB();\r
DBCollection collection = db.getCollection(STORY_COLLECTION);\r
- DBCursor find = collection.find(new BasicDBObject(REF_RUNDOWN, new BasicDBObject($ELEMMATCH, new BasicDBObject(ID, id))))\r
+ DBCursor find = collection\r
+ .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
List<DBObject> result = null;\r
DB db = NoSQLUtils.getNoSQLDB();\r
DBCollection collection = db.getCollection(STORY_COLLECTION);\r
- DBCursor find = collection.find(new BasicDBObject(), new BasicDBObject("mosObjects", 1).append("_id", 0)).limit(1000);\r
+ DBCursor find = collection.find(new BasicDBObject(), new BasicDBObject("mosObjects", 1).append("_id", 0))\r
+ .limit(1000);\r
if (find.hasNext())\r
result = find.toArray();\r
return result;\r
\r
@Override\r
public List<DBObject> getStoriesByParentStoryID(String id) {\r
- //Pattern regex = Pattern.compile(id, Pattern.CASE_INSENSITIVE);\r
- //BasicDBObject query = new BasicDBObject("id", Pattern.compile(id));\r
+ // Pattern regex = Pattern.compile(id, Pattern.CASE_INSENSITIVE);\r
+ // BasicDBObject query = new BasicDBObject("id", Pattern.compile(id));\r
List<DBObject> result = null;\r
DB db = NoSQLUtils.getNoSQLDB();\r
DBCollection collection = db.getCollection(STORY_COLLECTION);\r
List<DBObject> result = new ArrayList<>();\r
DB db = NoSQLUtils.getNoSQLDB();\r
DBCollection storyCollection = db.getCollection(STORY_COLLECTION);\r
- BasicDBObject criteria = new BasicDBObject(MOS_OBJECTS, new BasicDBObject($ELEMMATCH, new BasicDBObject(OBJ_ID, id)));\r
+ BasicDBObject criteria = new BasicDBObject(MOS_OBJECTS,\r
+ new BasicDBObject($ELEMMATCH, new BasicDBObject(OBJ_ID, id)));\r
DBCursor find = storyCollection.find(criteria);\r
if (find.hasNext()) {\r
result = find.toArray();\r
public List<DBObject> getStoryFoldersByParentStoryID(String id) {\r
DB db = NoSQLUtils.getNoSQLDB();\r
DBCollection storyCollection = db.getCollection(STORY_COLLECTION);\r
- DBCursor find = storyCollection.find(new BasicDBObject(PARENT_STORY_ID, id), new BasicDBObject(REF_STORYFOLDER, 1));\r
+ DBCursor find = storyCollection.find(new BasicDBObject(PARENT_STORY_ID, id),\r
+ new BasicDBObject(REF_STORYFOLDER, 1));\r
if (!find.hasNext())\r
return null;\r
return getReferencedObjects(find.toArray(), FOLDER_COLLECTION, REF_STORYFOLDER);\r
public List<DBObject> getStoryFoldersByPlaceHolderID(String id) {\r
DB db = NoSQLUtils.getNoSQLDB();\r
DBCollection storyCollection = db.getCollection(STORY_COLLECTION);\r
- BasicDBObject criteria = new BasicDBObject(MOS_OBJECTS, new BasicDBObject($ELEMMATCH, new BasicDBObject(OBJ_ID, id)));\r
+ BasicDBObject criteria = new BasicDBObject(MOS_OBJECTS,\r
+ new BasicDBObject($ELEMMATCH, new BasicDBObject(OBJ_ID, id)));\r
DBCursor find = storyCollection.find(criteria, new BasicDBObject(REF_STORYFOLDER, 1));\r
if (!find.hasNext())\r
return null;\r
List<DBObject> result = null;\r
DB db = NoSQLUtils.getNoSQLDB();\r
DBCollection collection = db.getCollection(STORY_COLLECTION);\r
- DBCursor find = collection\r
- .find(new BasicDBObject(REF_STORYFOLDER, new BasicDBObject($ELEMMATCH, new BasicDBObject(ID, storyFolderId))),\r
- new BasicDBObject(ID, 1).append(PARENT_STORY_ID, 1)\r
- .append(NAME, 1)\r
- .append(MODIFIED, 1)\r
- .append(REF_STORYFOLDER, 1)\r
- .append(FORMAT, 1)\r
- .append(MOS_OBJECTS, 1))\r
+ DBCursor find = collection.find(\r
+ new BasicDBObject(REF_STORYFOLDER, new BasicDBObject($ELEMMATCH, new BasicDBObject(ID, storyFolderId))),\r
+ new BasicDBObject(ID, 1).append(PARENT_STORY_ID, 1).append(NAME, 1).append(MODIFIED, 1)\r
+ .append(REF_STORYFOLDER, 1).append(FORMAT, 1).append(MOS_OBJECTS, 1))\r
.sort(new BasicDBObject(NAME, 1));\r
if (find.hasNext())\r
result = find.toArray();\r
List<DBObject> result = null;\r
DB db = NoSQLUtils.getNoSQLDB();\r
DBCollection collection = db.getCollection(STORY_COLLECTION);\r
- DBCursor find = collection.find(new BasicDBObject(REF_STORYFOLDER, new BasicDBObject($ELEMMATCH, new BasicDBObject(ID, storyFolderId))), fields)\r
+ DBCursor find = collection\r
+ .find(new BasicDBObject(REF_STORYFOLDER,\r
+ new BasicDBObject($ELEMMATCH, new BasicDBObject(ID, storyFolderId))), fields)\r
.sort(new BasicDBObject(NAME, 1));\r
if (find.hasNext())\r
result = find.toArray();\r