07-28-2006 09:10 AM
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 😉
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)08-07-2006 09:06 AM
08-08-2006 11:38 AM
09-18-2006 11:52 AM
09-19-2006 04:06 AM
09-19-2006 06:02 AM
10-03-2006 12:41 PM
/**Create relationship with the destination folder and the element to move */
ParentReference dossierDestinationParentRef = new ParentReference();
dossierDestinationParentRef.setStore(ConnecteurGEDAlfresco.STORE);
dossierDestinationParentRef.setUuid(IDElemDestination);
dossierDestinationParentRef.setAssociationType(Constants.ASSOC_CONTAINS);
dossierDestinationParentRef.setChildName(nomElementADeplacer);
/** Create the ref of the element to move */
Reference sourceRef = new Reference();
sourceRef.setStore(ConnecteurGEDAlfresco.STORE);
sourceRef.setUuid(iDElementADeplacer);
/** Move */
CMLMove deplacer = new CMLMove();
/** destination folder : */
deplacer.setTo(dossierDestinationParentRef);
/** element to move */
deplacer.setWhere(new Predicate(new Reference[]{sourceRef}, null, null));
/** Execute command */
CML cmlDeplacer = new CML();
cmlDeplacer.setMove(new CMLMove[]{deplacer});
UpdateResult[] results;
results = this.getWebServiceFactory().getRepositoryService().update(cmlDeplacer);
10-07-2006 02:20 PM
I have tested with the 1.4 RC1, and it's working now !
Thanks for the correction.
Here is my code for moving an element to a folder, if it can help someone (I added english commentaries, because I develop in French )
/**Create relationship with the destination folder and the element to move */
ParentReference dossierDestinationParentRef = new ParentReference();
dossierDestinationParentRef.setStore(ConnecteurGEDAlfresco.STORE);
dossierDestinationParentRef.setUuid(IDElemDestination);
dossierDestinationParentRef.setAssociationType(Constants.ASSOC_CONTAINS);
dossierDestinationParentRef.setChildName(nomElementADeplacer);
/** Create the ref of the element to move */
Reference sourceRef = new Reference();
sourceRef.setStore(ConnecteurGEDAlfresco.STORE);
sourceRef.setUuid(iDElementADeplacer);
/** Move */
CMLMove deplacer = new CMLMove();
/** destination folder : */
deplacer.setTo(dossierDestinationParentRef);
/** element to move */
deplacer.setWhere(new Predicate(new Reference[]{sourceRef}, null, null));
/** Execute command */
CML cmlDeplacer = new CML();
cmlDeplacer.setMove(new CMLMove[]{deplacer});
UpdateResult[] results;
results = this.getWebServiceFactory().getRepositoryService().update(cmlDeplacer);
10-09-2006 03:05 AM
10-25-2006 04:09 AM
public static void copy(String nomFichier, String idFichier, String idNouveauFichier,String ciblePath, String depPath) throws Exception
{
/**Create relationship with the destination folder and the element to move */
ParentReference dossierDestinationParentRef = new ParentReference();
dossierDestinationParentRef.setStore(STORE);
dossierDestinationParentRef.setPath(ciblePath);
//dossierDestinationParentRef.setUuid(idNouveauFichier);
dossierDestinationParentRef.setAssociationType(Constants.ASSOC_CONTAINS);
dossierDestinationParentRef.setChildName(nomFichier);
/** Create the ref of the element to move */
Reference sourceRef = new Reference();
sourceRef.setStore(STORE);
//sourceRef.setPath(depPath);
sourceRef.setUuid(idFichier);
/** Move */
CMLMove deplacer = new CMLMove();
/** destination folder : */
deplacer.setTo(dossierDestinationParentRef);
/** element to move */
deplacer.setWhere(new Predicate(new Reference[]{sourceRef}, null, null));
/** Execute command */
CML cmlDeplacer = new CML();
cmlDeplacer.setMove(new CMLMove[]{deplacer});
UpdateResult[] results = WebServiceFactory.getRepositoryService().update(cmlDeplacer);
}
Tags
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.