//creo la nueva carpeta
companyHomeParent = setCompanyHomeTiWorksFolder(storeRef, pathFolder,numeracion,documento.getId());
String queryString = "+PATH:\"" + pathFolder+ "/tw:" + nombreCarpeta +"//*\""
+ "+TYPE:\""+Constants.TYPE_FOLDER+"\"";
//recupero los hijos de la antigua carpeta
List<Content> lista = getQueryResults(queryString, storeRef);
if(lista.size()>0){
int tama = lista.size();
Reference[] ref =new Reference[tama];
for(int i=0; i<tama; i++)
ref[i] = lista.get(i).getNode();
Predicate predicate =new Predicate(ref, storeRef, null);
//copio los hijos en la nueva carpeta
CMLCopy ccopy = new CMLCopy(companyHomeParent, null, null, null, predicate, null, true);
// Construimos el bloque CML
CML cml = new CML();
cml.setCopy(new CMLCopy[] {ccopy});
// Ejecutamos el bloque CML
WebServiceFactory.getRepositoryService().update(cml);
}
gest.borraCarpetaAlfresco(nombreCarpeta);
ParentReference companyHomeParent = null;
try {
//Therefore a reference to the maybe not existent space is required
System.out.println("Entering pathFolder " + pathFolder);
System.out.println("Entering space " + nombreCarpeta);
Reference space = new Reference(storeRef, null, pathFolder+ "/cm:" + nombreCarpeta);
WebServiceFactory.getRepositoryService().get(new Predicate(new Reference[]{space}, storeRef, null));
System.out.println("inicio UtilsAlfresco:getCompanyHomeParentFolder–>Recupera una carpeta que ya existe");
//Recupera una carpeta que ya existe
companyHomeParent = new ParentReference(storeRef, null, pathFolder+ "/cm:" + nombreCarpeta, Constants.ASSOC_CONTAINS, nombreCarpeta);
}catch (Exception e){
//si la carpeta no existe la creo como nueva.
companyHomeParent = getCompanyHomeParentNewFolder(storeRef,nombreCarpeta, pathFolder);
}
Content from pre 2016 and from language groups that have been closed.
Content is read-only.
By using this site, you are agreeing to allow us to collect and use cookies as outlined in Alfresco’s Cookie Statement and Terms of Use (and you have a legitimate interest in Alfresco and our products, authorizing us to contact you in such methods). If you are not ok with these terms, please do not use this website.