AnsweredAssumed Answered

Need precisions about CML

Question asked by sam69 on Jul 28, 2006
Latest reply on Nov 15, 2006 by quale
Hello !

I am using the webservices, and I think there is a lack of documentation (even javadoc). Do you know if there is a javadoc somewhere ?

For example, I need to move a file from a space to another (which is a simple task). But I can't find an example to do that, and no documentation about CML. Except this schema : http://wiki.alfresco.com/wiki/CML.

I have just the method signature :
CMLMove(ParentReference to, String to_id, String associationType, String childName, Predicate where, String where_id) {
To means destination ? or is it where ? I am lost ;-)
So i tried with the following code :

Store STORE = new Store(StoreEnum.workspace, "SpacesStore");
    Predicate predicatSource = new Predicate(new Reference[]{new Reference(STORE, iDRessourceToMove, null)}, null, null);
    ParentReference parentRefDestination = new ParentReference(ConnecteurGEDAlfresco.STORE, IdDestination, null, Constants.ASSOC_CONTAINS, null);
    CMLMove cmlMove = new CMLMove(parentRefDestination, IdDestination, Constants.ASSOC_CONTAINS, "TEST", predicatSource, iDRessourceToMove);
    CML cml = new CML();
    cml.setMove(new CMLMove[]{cmlMove});
    UpdateResult[] results = WebServiceFactory.getRepositoryService().update(cml);
But it's not working (and it's not throwing any exception)
Any ideas ?

NB : I am waiting for the 1.4 release impatiently (with the much simplier File webservice)
NB2 : Alfresco is a great product :-)

Outcomes