@Test public void shouldCreateProxyLiveFromProxyAfterModification() { doc.setPropertyValue("dc:title", "Test2"); doc = session.saveDocument(doc); session.save(); DocumentModel proxy = session.publishDocument(doc, folder, true); DocumentModel result = operation.run(proxy); assertNotNull(result); assertEquals(doc.getPathAsString(), result.getPathAsString()); assertEquals(doc.getId(), result.getId()); }
@OperationMethod(collector = DocumentModelCollector.class) public DocumentModel run(DocumentModel input) { DocumentModel doc = session.getSourceDocument(input.getRef()); for (int i = 0; i < MAX_ITERATION && !isLive(doc); i++) { doc = session.getSourceDocument(doc.getRef()); } return doc; }
GetLiveDocument { @OperationMethod(collector = DocumentModelCollector.class) public DocumentModel run(DocumentModel input) { DocumentModel doc = session.getSourceDocument(input.getRef()); for (int i = 0; i < MAX_ITERATION && !isLive(doc); i++) { doc = session.getSourceDocument(doc.getRef()); } return doc; } }
GetLiveDocument { @OperationMethod(collector = DocumentModelCollector.class) public DocumentModel run(DocumentModel input) { DocumentModel doc = session.getSourceDocument(input.getRef()); for (int i = 0; i < MAX_ITERATION && !isLive(doc); i++) { doc = session.getSourceDocument(doc.getRef()); } return doc; }  }
GetLiveDocument { @OperationMethod(collector = DocumentModelCollector.class) public DocumentModel run(DocumentModel input) { DocumentModel doc = session.getSourceDocument(input.getRef()); for (int i = 0; i < MAX_ITERATION && !isLive(doc); i++) { doc = session.getSourceDocument(doc.getRef()); } return doc; }  @OperationMethod(collector = DocumentModelCollector.class) DocumentModel run(DocumentModel input); }
GetLiveDocument { @OperationMethod(collector = DocumentModelCollector.class) public DocumentModel run(DocumentModel input) { DocumentModel doc = session.getSourceDocument(input.getRef()); for (int i = 0; i < MAX_ITERATION && !isLive(doc); i++) { doc = session.getSourceDocument(doc.getRef()); } return doc; }  @OperationMethod(collector = DocumentModelCollector.class) DocumentModel run(DocumentModel input); static final String ID; }