List<DatosFactura> contenedor = new ArrayList<DatosFactura>();
String lineafichero = new String();
DatosFactura fact = null;
NodeRef nodo = null;
// Obtemos a referencia o espacio Mes de Diccionario de Datos
String espaciomes = nodoEsp.getName();
logger.info("path del nodo" + nodoEsp.getPath());
logger.info("nombre del espacio mes "+espaciomes);
String stringQuery = "+PATH:\""+ nodoEsp.getNodePath().toString()+"/*\"";
logger.info("path string query "+stringQuery);
StoreRef storeRef_aux = StoreRef.STORE_REF_WORKSPACE_SPACESSTORE;
ResultSet results_aux = services.getSearchService()
.query(storeRef_aux,
SearchService.LANGUAGE_LUCENE,
stringQuery);
logger.info("resultados de la busqueda " + results_aux.getNodeRefs());
List<NodeRef> documentos = results_aux.getNodeRefs();
logger.info("Numero de documentos encontrados " + documentos.size());
if (!documentos.isEmpty()) {
logger.info("Numero de documentos encontrados"+documentos.size());
Iterator<NodeRef> iter = documentos.iterator();
logger.info("iterador "+documentos.iterator());
while (iter.hasNext()) {
Node documento = new Node(iter.next());
logger.info("nodo "+documento.getName());
logger.info("fecha "+documento.getProperties().get(FacturaModel.Alf_Fecha).toString());
fact = new DatosFactura(
(Date)(documento.getProperties().get(FacturaModel.Alf_Fecha)),
documento.getProperties().get(FacturaModel.Alf_CIF).toString(),
documento.getProperties().get(FacturaModel.Alf_NumFactura).toString(),
documento.getProperties().get(FacturaModel.Alf_Base).toString(),
documento.getProperties().get(FacturaModel.Alf_IVA).toString(),
documento.getProperties().get(FacturaModel.Alf_Total).toString());
contenedor.add(fact);
logger.info("contenedor "+contenedor);
}
}
10:10:05,312 INFO [org.alfresco.sample.Cierre_Mes_Dialog] Entra a evaluar el espacio
10:10:05,312 INFO [org.alfresco.sample.Cierre_Mes_Dialog] path de revisadas +PATH:"/app:company_home/cm:Entrada_Facturas/cm:Revision_Factura/cm:Revisar/*"+TYPE:"{http://www.alfresco.org/model/content/1.0}content"
10:10:05,343 INFO [org.alfresco.sample.Cierre_Mes_Dialog] el resultset []
10:10:05,343 INFO [org.alfresco.sample.Cierre_Mes_Dialog] Node Type: {http://www.alfresco.org/model/content/1.0}folder
Node Properties: {{http://www.alfresco.org/model/content/1.0}name=Agosto, {http://www.alfresco.org/model/content/1.0}creator=admin, {http://www.alfresco.org/model/content/1.0}modified=Thu Sep 10 16:27:26 CEST 2009, {http://www.alfresco.org/model/application/1.0}icon=space-icon-default, {FacturaModel.model}Abierto=true, {http://www.alfresco.org/model/system/1.0}store-protocol=workspace, {http://www.alfresco.org/model/content/1.0}created=Thu Sep 10 16:27:06 CEST 2009, {http://www.alfresco.org/model/system/1.0}store-identifier=SpacesStore, {http://www.alfresco.org/model/content/1.0}title=, {http://www.alfresco.org/model/system/1.0}node-dbid=1074, {http://www.alfresco.org/model/system/1.0}node-uuid=74c0d378-517a-4ee0-b05d-b362abd05b40, {http://www.alfresco.org/model/content/1.0}modifier=admin, {http://www.alfresco.org/model/content/1.0}description=}
Node Aspects: [{http://www.alfresco.org/model/application/1.0}uifacets, {http://www.alfresco.org/model/content/1.0}auditable, {http://www.alfresco.org/model/system/1.0}referenceable, {FacturaModel.model}EspacioAbierto]
10:10:05,359 INFO [org.alfresco.sample.Cierre_Mes_Dialog] propieadedes del nodeEsp{{http://www.alfresco.org/model/content/1.0}name=Agosto, {http://www.alfresco.org/model/content/1.0}creator=admin, {http://www.alfresco.org/model/content/1.0}modified=Thu Sep 10 16:27:26 CEST 2009, {http://www.alfresco.org/model/application/1.0}icon=space-icon-default, {FacturaModel.model}Abierto=true, {http://www.alfresco.org/model/system/1.0}store-protocol=workspace, {http://www.alfresco.org/model/content/1.0}created=Thu Sep 10 16:27:06 CEST 2009, {http://www.alfresco.org/model/system/1.0}store-identifier=SpacesStore, {http://www.alfresco.org/model/content/1.0}title=, {http://www.alfresco.org/model/system/1.0}node-dbid=1074, {http://www.alfresco.org/model/system/1.0}node-uuid=74c0d378-517a-4ee0-b05d-b362abd05b40, {http://www.alfresco.org/model/content/1.0}modifier=admin, {http://www.alfresco.org/model/content/1.0}description=}
10:10:05,359 INFO [org.alfresco.sample.Cierre_Mes_Dialog] Estado del mestrue
10:10:06,859 INFO [org.alfresco.sample.Cierre_Mes_Dialog] Entra a evaluar el espacio
10:10:06,859 INFO [org.alfresco.sample.Cierre_Mes_Dialog] path de revisadas +PATH:"/app:company_home/cm:Entrada_Facturas/cm:Revision_Factura/cm:Revisar/*"+TYPE:"{http://www.alfresco.org/model/content/1.0}content"
10:10:06,890 INFO [org.alfresco.sample.Cierre_Mes_Dialog] el resultset []
10:10:06,890 INFO [org.alfresco.sample.Cierre_Mes_Dialog] Node Type: {http://www.alfresco.org/model/content/1.0}folder
Node Properties: {{http://www.alfresco.org/model/content/1.0}name=Agosto, {http://www.alfresco.org/model/content/1.0}creator=admin, {http://www.alfresco.org/model/content/1.0}modified=Thu Sep 10 16:27:26 CEST 2009, {http://www.alfresco.org/model/application/1.0}icon=space-icon-default, {FacturaModel.model}Abierto=true, {http://www.alfresco.org/model/system/1.0}store-protocol=workspace, {http://www.alfresco.org/model/content/1.0}created=Thu Sep 10 16:27:06 CEST 2009, {http://www.alfresco.org/model/system/1.0}store-identifier=SpacesStore, {http://www.alfresco.org/model/content/1.0}title=, {http://www.alfresco.org/model/system/1.0}node-dbid=1074, {http://www.alfresco.org/model/system/1.0}node-uuid=74c0d378-517a-4ee0-b05d-b362abd05b40, {http://www.alfresco.org/model/content/1.0}modifier=admin, {http://www.alfresco.org/model/content/1.0}description=}
Node Aspects: [{http://www.alfresco.org/model/application/1.0}uifacets, {http://www.alfresco.org/model/content/1.0}auditable, {http://www.alfresco.org/model/system/1.0}referenceable, {FacturaModel.model}EspacioAbierto]
10:10:06,890 INFO [org.alfresco.sample.Cierre_Mes_Dialog] propieadedes del nodeEsp{{http://www.alfresco.org/model/content/1.0}name=Agosto, {http://www.alfresco.org/model/content/1.0}creator=admin, {http://www.alfresco.org/model/content/1.0}modified=Thu Sep 10 16:27:26 CEST 2009, {http://www.alfresco.org/model/application/1.0}icon=space-icon-default, {FacturaModel.model}Abierto=true, {http://www.alfresco.org/model/system/1.0}store-protocol=workspace, {http://www.alfresco.org/model/content/1.0}created=Thu Sep 10 16:27:06 CEST 2009, {http://www.alfresco.org/model/system/1.0}store-identifier=SpacesStore, {http://www.alfresco.org/model/content/1.0}title=, {http://www.alfresco.org/model/system/1.0}node-dbid=1074, {http://www.alfresco.org/model/system/1.0}node-uuid=74c0d378-517a-4ee0-b05d-b362abd05b40, {http://www.alfresco.org/model/content/1.0}modifier=admin, {http://www.alfresco.org/model/content/1.0}description=}
10:10:06,890 INFO [org.alfresco.sample.Cierre_Mes_Dialog] Estado del mestrue
10:10:06,890 INFO [org.alfresco.sample.Cierre_Mes_Dialog] Entra en producir fichero
10:10:06,890 INFO [org.alfresco.sample.Cierre_Mes_Dialog] path del nodo/{http://www.alfresco.org/model/application/1.0}company_home/{http://www.alfresco.org/model/content/1....
10:10:06,890 INFO [org.alfresco.sample.Cierre_Mes_Dialog] path string query +PATH:"/{http://www.alfresco.org/model/application/1.0}company_home/{http://www.alfresco.org/model/content/1...."
10:10:06,890 INFO [org.alfresco.sample.Cierre_Mes_Dialog] resultados de la busqueda org.alfresco.repo.security.permissions.impl.acegi.FilteringResultSet@8d1c76
10:10:06,890 INFO [org.alfresco.sample.Cierre_Mes_Dialog] Numero de documentos encontrados1
10:10:06,890 INFO [org.alfresco.sample.Cierre_Mes_Dialog] Numero de documentos encontrados1
10:10:06,890 INFO [org.alfresco.sample.Cierre_Mes_Dialog] iterador java.util.AbstractList$Itr@47b87f
10:10:06,906 INFO [org.alfresco.sample.Cierre_Mes_Dialog] nodo f952affe-8146-409e-a56f-e52daf4ef4cf
10:10:06,906 ERROR [org.alfresco.web.ui.common.Utils] Unable to delete File due to system error: null
java.lang.NullPointerException
nodo f952affe-8146-409e-a56f-e52daf4ef4cf
logger.info("nodo "+documento.getName());
segun sale en el log :10:10:06,906 INFO [org.alfresco.sample.Cierre_Mes_Dialog] nodo f952affe-8146-409e-a56f-e52daf4ef4cf
logger.info("fecha "+documento.getProperties().get(FacturaModel.Alf_Fecha).toString());
logger.info("nodo "+documento.getName());
nodo f952affe-8146-409e-a56f-e52daf4ef4cfque buscando en el node browser, corresponde con el espacio "workspace://SpacesStore", este espacio no tiene estos metadatos obligatorios, y por eso da null. Otra cosa es que, por muchos documentos que tenga guardados en ese espacio, la búsqueda solo encuentra uno. Probé varias maneras, y no creo que el fallo esté en el path que le paso. Estoy un poco perdido. Muchas gracias por tu respuesta y por tu tiempo.
String stringQuery = "+PATH:\""+ nodoEsp.getNodePath().toString()+"/*\"";
"+PATH:\"/app:company_home/cm:Entrada_Facturas/cm:Revision_Factura/cm:Aprobadas/cm:A_2007/cm:Julio";
logger.info("path del nodo" + nodoEsp.getPath());
logger.info("nombre del espacio mes "+espaciomes);
String stringQuery = "+PATH:\""+ nodoEsp.getNodePath().toString()+"/*\"";
logger.info("path string query "+stringQuery);
StoreRef storeRef_aux = StoreRef.STORE_REF_WORKSPACE_SPACESSTORE;
ResultSet results_aux = services.getSearchService()
.query(storeRef_aux,
SearchService.LANGUAGE_LUCENE,
stringQuery);
path string query +PATH:"/{http://www.alfresco.org/model/application/1.0}company_home/{http://www.alfresco.org/model/content/1...."
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.