@Test public void shouldNotSaveTheDocument() throws Exception { source.setPropertyValue("common:icon-expanded", "icon-expanded-source"); source = session.saveDocument(source); target1.setPropertyValue("common:icon-expanded", "icon-expanded-target1"); target1 = session.saveDocument(target1); context.setInput(target1); OperationChain chain = new OperationChain("testSaveParameters_1"); chain.add(CopySchema.ID).set("sourceId", source.getId()).set("schema", "common").set("saveDocument", false); service.run(context, chain); String value = (String) target1.getPropertyValue("common:icon-expanded"); assertEquals("icon-expanded-source", value); target1.refresh(); value = (String) target1.getPropertyValue("common:icon-expanded"); assertEquals("icon-expanded-target1", value); }
@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; }