cancel
Showing results for 
Search instead for 
Did you mean: 

Need precisions about CML

sam69
Champ in-the-making
Champ in-the-making
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 🙂
11 REPLIES 11

sam69
Champ in-the-making
Champ in-the-making
Your error message is not very explicit…

This code is just a copy past from my application (coded in french).

In my app, I have a getter for the WebServiceFactory (this.getWebServiceFactory()), but you have to get the repositoryService in you own way, like in the Alfresco webService sample for example.

quale
Champ in-the-making
Champ in-the-making
Hello everybody,
we are in a big trouble with this issue.  Our problem is that we're using the version 1.2 with many customizations and we cannot migrate to a newer version of Alfresco (not in an easy way).  Is there a way to apply a patch to the 1.2 version to correct the problem with copy and move?

Thank you in advance.
Quale