如何使用SQL在Alfresco中获取文档名称? [英] How to get the name of a document in Alfresco with SQL?
问题描述
如何从Alfresco数据库(PostgreSQL)中检索文档的名称?我正在尝试获取给定用户创建的文档列表,例如管理员,从开始日期开始,例如2015-05-03:
How to retrieve the name of a document from the Alfresco database (PostgreSQL)? I'm trying to get a list of documents created by a given user, e.g. admin, from a starting date, e.g. 2015-05-03:
SELECT child.child_node_name, node.audit_created
FROM alf_child_assoc child, alf_node node, alf_node_properties prop, alf_qname qname
WHERE child.child_node_id = node.id
AND node.id = prop.node_id
AND prop.qname_id = qname.id
AND qname.local_name = 'content'
AND node.audit_creator = 'admin'
AND node.audit_created > '2015-05-03'
ORDER BY node.audit_created
如何获取实际值文件,而不是所有内容项?
因为现在它还显示完整的节点引用,所以我只想要文档的可读名称。有什么建议吗?
How do I get actual documents and not all content items? Because now it also displays full node references and I just want the human readable name of a document. Any suggestions?
顺便说一句,我在后端(存储库)上工作,而不是在共享上工作。我正在使用Alfresco 5.0.1。
By the way, I'm working on the back-end (Repository), not on Share. And I'm using Alfresco 5.0.1.
推荐答案
基于其他查询,我创建了以下查询:
Based on the other anwsers I created this query:
SELECT string_value AS document_name, audit_created AS creation_date
FROM alf_node node
INNER JOIN alf_node_properties ON (id=node_id)
INNER JOIN alf_qname ON (qname_id=alf_qname.id)
WHERE ns_id IN
(SELECT ns.id FROM alf_namespace AS ns
WHERE ns.uri='http://www.alfresco.org/model/content/1.0')
AND local_name='name'
AND audit_creator = 'admin'
AND audit_created > '2015-05-06'
ORDER BY audit_created;
这样,您不必知道qname_id。
This way you don't have to know the qname_id.
谢谢Sam,Gagravarr和streetturtle。
Thank you Sam, Gagravarr and streetturtle.
这篇关于如何使用SQL在Alfresco中获取文档名称?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!