As we transition to the new Hyland Community, some post links may be temporarily disrupted as we finalize redirects. We apologize for the inconvenience and are working to resolve this as quickly as possible. Details.
CMLCopy copy = new CMLCopy(); copy.setTo(destinationChildReference); copy.setChildren(true); copy.setAssociationType(Constants.ASSOC_CONTAINS); copy.setWhere(new Predicate(new Reference[] { sourceReference }, STORE, null)); CML cml = new CML(); cml.setCopy(new CMLCopy[] { copy }); getRepositoryService().update(cml);
public boolean checkIfExistOnAlfresco(String yourSpacePath){ try { AuthenticationUtils.startSession(username, password); Store store = new Store(Constants.WORKSPACE_STORE, "SpacesStore"); Reference reference = new Reference(STORE, null, yourSpacePath); WebServiceFactory.getRepositoryService().get(new Predicate(new Reference[]{reference}, STORE, null)); return true; } catch (Exception exception) { return false; } finally { AuthenticationUtils.endSession(); } }