Hola a todos.Soy bastante nuevo en este mundillo y tengo algunos problemillas a la hora de crear un link de un documento de alfresco mediante los webservices.Buscando por ahí encontré el siguiente código, que al parecer no funciona ya que me salta una excepción y no doy con el problema.
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;
}
Para los nodos object y destinatation, los he creado de la siguiente forma (la cual puede estar mal
):
Reference reference1 = new Reference(STORE, null, "/app:company_home/cm:ArchivoOrigen.txt");
Node object=new Node(reference1,"prueba",null,null);
Reference reference2 = new Reference(STORE, null, "/app:company_home");
Node destination=new Node(reference2,"prueba",null,null);
Espero que a alguien se le ilumine la bombillita, porque a mi no se me ilumina na de na
Muchas gracias