How to list information about all Alfresco's files (Postgres SQL)?

余生颓废 提交于 2019-12-24 09:13:09

问题


A file node representation in Alfresco persistent layer:

  • content is stored in ALFRESCO_HOME\alf_data\contentstore\ folder
  • metadata are stored in relational database (default: PostgreSQL)
  • information for text searching (Lucene) are stored in Solr's document database

Which Postgres tables are used to keep metadata of new uploaded file? How to list information about all Alfresco's files (Postgres SQL)?


回答1:


The tables that keep files metadata:

Listing information about all Alfresco's files - Postgres SQL:

SELECT 
  n.id, 
  npn.string_value as filename,
  cu.content_size,
  cu.content_url,   
  n.uuid, 
  n.audit_created
FROM alf_node as n
  join alf_node_properties npn on 
     (npn.node_id=n.id and npn.actual_type_n=6 and npn.qname_id in 
       (select id from alf_qname where local_name='name'))
  join alf_node_properties npc on 
     (npc.node_id=n.id and npc.actual_type_n=21 and npc.qname_id in 
       (select id from alf_qname where local_name='content'))
  join alf_content_data cd on (cd.id = npc.long_value)
  join alf_content_url cu on (cd.content_url_id = cu.id)
where 
  n.type_qname_id in (
    select id from alf_qname where local_name='content'
  )


来源:https://stackoverflow.com/questions/41144522/how-to-list-information-about-all-alfrescos-files-postgres-sql

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!