@Test public void testFolderCreation() throws OperationException { try (OperationContext ctx = new OperationContext(session)) { ctx.setInput(parent); Map<String, Serializable> params = new HashMap<>(); params.put("title", "bar"); DocumentModel doc = (DocumentModel) service.run(ctx, FileManagerCreateFolder.ID, params); assertNotNull(doc); assertNotNull(doc.getId()); assertEquals("Folder", doc.getType()); assertEquals("bar", doc.getName()); assertEquals("/foo/bar", doc.getPathAsString()); assertEquals("bar", doc.getTitle()); } }
@OperationMethod public DocumentModel run(DocumentModel parent) throws IOException { DocumentModel doc = fileManager.createFolder(session, title, parent.getPathAsString(), overwrite); if (properties != null) { DocumentHelper.setProperties(session, doc, properties); if (doc.isDirty()) { doc = session.saveDocument(doc); } } return doc; }
FileManagerCreateFolder { @OperationMethod public DocumentModel run(DocumentModel parent) throws IOException { DocumentModel doc = fileManager.createFolder(session, title, parent.getPathAsString(), overwrite); if (properties != null) { DocumentHelper.setProperties(session, doc, properties); if (doc.isDirty()) { doc = session.saveDocument(doc); } } return doc; } }
FileManagerCreateFolder { @OperationMethod public DocumentModel run(DocumentModel parent) throws IOException { DocumentModel doc = fileManager.createFolder(session, title, parent.getPathAsString(), overwrite); if (properties != null) { DocumentHelper.setProperties(session, doc, properties); if (doc.isDirty()) { doc = session.saveDocument(doc); } } return doc; }  }
FileManagerCreateFolder { @OperationMethod public DocumentModel run(DocumentModel parent) throws IOException { DocumentModel doc = fileManager.createFolder(session, title, parent.getPathAsString(), overwrite); if (properties != null) { DocumentHelper.setProperties(session, doc, properties); if (doc.isDirty()) { doc = session.saveDocument(doc); } } return doc; }  @OperationMethod DocumentModel run(DocumentModel parent); }
FileManagerCreateFolder { @OperationMethod public DocumentModel run(DocumentModel parent) throws IOException { DocumentModel doc = fileManager.createFolder(session, title, parent.getPathAsString(), overwrite); if (properties != null) { DocumentHelper.setProperties(session, doc, properties); if (doc.isDirty()) { doc = session.saveDocument(doc); } } return doc; }  @OperationMethod DocumentModel run(DocumentModel parent); static final String ID; }