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.
public boolean addLink(Node object, Node destination) { boolean result = false; try { ParentReference to = new ParentReference( Constant.STORE, destination.getReference().getUuid(), destination.getReference().getPath(), Constants.ASSOC_CONTAINS, Constants.ASSOC_CONTAINS); Predicate where = new Predicate( new Reference[] { object.getReference() }, null, null ); CMLAddChild addChild = new CMLAddChild(); addChild.setTo(to); addChild.setWhere(where); CML cml = new CML(); cml.setAddChild(new CMLAddChild[] {addChild}); UpdateResult[] updateResult = repositoryService.update(cml); result = (updateResult != null); } catch(RepositoryFault e) { System.out.println("RepositoryFault: " + e.getMessage() + "\n" + e.getStackTrace()); } catch(RemoteException e) { System.out.println("RemoteException: " + e.getMessage()); } return result; }