PostgreSQL
 sql >> Database >  >> RDS >> PostgreSQL

Come ottenere il nome di un documento in Alfresco con SQL?

Aggiornato

Quindi ecco l'SQL che devi usare, questo per cm:content digita:

select nd.audit_creator as creator, 
       np.string_value as document_name, 
       nd.audit_created as created_on
  from alf_node as nd, alf_node_properties as np, 
       alf_namespace ns, alf_qname qn, alf_qname qn1
 where nd.id=np.node_id
   and qn.ns_id = ns.id
   and nd.type_qname_id = qn.id
   and ns.uri = 'http://www.alfresco.org/model/content/1.0'
   and qn.local_name = 'content'
   and qn1.ns_id = ns.id
   and np.qname_id = qn1.id
   and qn1.local_name = 'name'
   and nd.audit_created > '2015-05-06 14:59:00';

Restituirà il nome del documento leggibile dall'uomo, il nome utente del creatore e la data di creazione del documento.

E se hai un tipo di documento personalizzato, diciamo ep:content con spazio dei nomi http://www.mycomp.com/model/epersonnel/1.0 questa query farà il lavoro:

select nd.audit_creator as creator, 
       np.string_value as document_name, 
       nd.audit_created as created_on
  from alf_node as nd, alf_node_properties as np, 
       alf_namespace ns, alf_namespace ns1, alf_qname qn, alf_qname qn1
 where nd.id=np.node_id
   and qn.ns_id = ns.id
   and nd.type_qname_id = qn.id
   and ns.uri = 'http://www.mycomp.com/model/epersonnel/1.0'
   and qn.local_name = 'content'
   and ns1.uri = 'http://www.alfresco.org/model/content/1.0'
   and np.qname_id = qn1.id
   and qn1.ns_id = ns1.id
   and qn1.local_name = 'name'
   and nd.audit_created > '2015-05-06 14:59:00';