@Test public void testSingleTargetSinglePropertyByPath() throws OperationException { String schema = "dublincore"; String property = "title"; assertTrue(source.hasSchema(schema)); source.setProperty(schema, property, source.getName()); session.saveDocument(source); assertTrue(target1.hasSchema(schema)); target1.setProperty(schema, property, target1.getName()); session.saveDocument(target1); context.setInput(target1); OperationChain chain = new OperationChain("testSingleTargetSinglePropertyByPath"); chain.add(CopySchema.ID).set("sourcePath", source.getPath().toString()).set("schema", schema); target1 = (DocumentModel)service.run(context, chain); assertEquals(source.getProperty(schema, property), target1.getProperty(schema, property)); }
@OperationMethod(collector = DocumentModelCollector.class) public DocumentModel run(DocumentModel target) throws OperationException { DocumentModel source = getDocumentFromIdOrPath(); copySchemaProperties(source, target); if (saveDocument) { target = session.saveDocument(target); if (save) { session.save(); } } return target; }
CopySchema { @OperationMethod(collector = DocumentModelCollector.class) public DocumentModel run(DocumentModel target) throws OperationException { DocumentModel source = getDocumentFromIdOrPath(); copySchemaProperties(source, target); if (saveDocument) { target = session.saveDocument(target); if (save) { session.save(); } } return target; } }
CopySchema { @OperationMethod(collector = DocumentModelCollector.class) public DocumentModel run(DocumentModel target) throws OperationException { DocumentModel source = getDocumentFromIdOrPath(); copySchemaProperties(source, target); if (saveDocument) { target = session.saveDocument(target); if (save) { session.save(); } } return target; }  }
CopySchema { @OperationMethod(collector = DocumentModelCollector.class) public DocumentModel run(DocumentModel target) throws OperationException { DocumentModel source = getDocumentFromIdOrPath(); copySchemaProperties(source, target); if (saveDocument) { target = session.saveDocument(target); if (save) { session.save(); } } return target; }  @OperationMethod(collector = DocumentModelCollector.class) DocumentModel run(DocumentModel target); }
CopySchema { @OperationMethod(collector = DocumentModelCollector.class) public DocumentModel run(DocumentModel target) throws OperationException { DocumentModel source = getDocumentFromIdOrPath(); copySchemaProperties(source, target); if (saveDocument) { target = session.saveDocument(target); if (save) { session.save(); } } return target; }  @OperationMethod(collector = DocumentModelCollector.class) DocumentModel run(DocumentModel target); static final String ID; }