cancel
Showing results for 
Search instead for 
Did you mean: 

Moving folders with AWS

fbertos
Champ in-the-making
Champ in-the-making
Hi,

I've intended moving folders with Alfresco Web Services using CMLMove class, without success.

I dont get any error, but the folder doesnt move.

Can anybody help me?

Is it possible using this method for moving folders?

What means the where_id and to_id parameters? If I dont specify the to_id parameter, I get an "Not Nullable Exception" error for to_id parameter…

The code is:
        String name = "test";
        Store STORE = new Store(StoreEnum.workspace, "SpacesStore");
        Reference reference = new Reference(STORE, null, path);
        Reference parent = new Reference(STORE, null, pathParent);
        Predicate predicate = new Predicate(new Reference[]{reference}, STORE, null);
        ParentReference parentReference = new ParentReference(
                STORE,
                parent.getUuid(),
                parent.getPath(),
                Constants.ASSOC_CONTAINS,
                name);
        CMLMove move = new CMLMove();
        move.setChildName(name);
        move.setTo(parentReference);
        move.setWhere(predicate);
        move.setTo_id(name);
        CML cml = new CML();
        cml.setMove(new CMLMove[]{move});
        repositoryService.update(cml);

Thanks a lot.

fbertos.
1 REPLY 1

sam69
Champ in-the-making
Champ in-the-making