简体   繁体   English

是否可以获取Alfresco中的节点类型(甚至属性类型)列表?

[英]Is it possible to get a list of node types (or even property types) in Alfresco?

Is there a way that I can call alfresco via webscript and get back a list of node types or list of node properties that are available? 有没有一种方法可以通过Web脚本调用alfresco,并获取可用的节点类型列表或节点属性列表? So if there are three different node types (cm:content, cm:folder, and cm:foo), I'd get that three returned to me (and not actually nodes that are one of these three types)? 因此,如果有三个不同的节点类型(厘米:内容,厘米:文件夹,然后厘米:富),我会得到三个还给我(而不是实际上是这三种类型中的一个节点)?

Reason why I'm asking is that I would like to query the server for available search fields to be used in a database search. 我之所以要问的原因是,我想向服务器查询要在数据库搜索中使用的可用搜索字段。 If it helps, I'm using extjs library with Alfresco (opsoro), and using lucene search atm. 如果有帮助,我将extjs库与Alfresco(opsoro)结合使用,并使用lucene搜索atm。 Any help into the right direction would be greatly appreciated. 任何对正确方向的帮助将不胜感激。 Thanks! 谢谢!

I don't think such a webscript exists. 我认为不存在这样的网页脚本。 You can find all the webscripts provided by alfresco looking at the url http://host/alfresco/service/index . 您可以在网址http:// host / alfresco / service / index上找到alfresco提供的所有Web脚本。

What you can do is implement the webscript yourself and then just access it normaly like you would any other webscript. 您可以做的是自己实施该Web脚本,然后像访问其他任何Web脚本一样正常访问它。 More info on how to implement webscripts here . 有关如何实施Web脚本的更多信息,请参见此处

You can use Get Class Definitions web script, it returns all the metadata related to the given content type. 您可以使用“ Get Class Definitions Web脚本,它返回与给定内容类型相关的所有元数据。 The url is as follows, just pass the name of the class you want, eg cm_content . 网址如下,只需传递您想要的类的名称,例如cm_content

http://your.host/alfresco/service/api/classes/{className}

It will dump the metadata as JSON. 它将元数据转储为JSON。 I actually answered a very similar question, see How to get list of aspects in the systems 我实际上回答了一个非常类似的问题,请参阅如何获取系统中各个方面的列表

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM