问题描述
我添加了:
<mandatory-aspects>
<aspect>cm:countable</aspect>
</mandatory-aspects>
要列出定义,因此每个项目都应具有增量字段。但是,当创建列表项时,nothig发生了。我检查了以下代码:
To list definition, so every item should have "increment" field. But when list items are created nothig happened. I have check the follwoing code:
-
nodeService.getAspects(nodeRef)
定义的项目方面,此列表中显示cm:countable
。 -
nodeService.getProperty(nodeRef,QName .createQName( http://www.alfresco.org/model/content/1.0,可数))
返回null。 -
nodeService.getProperties(nodeRef)
返回所有属性,但没有countable
键。
nodeService.getAspects(nodeRef)
return all defined aspects for item,cm:countable
presents in this list.nodeService.getProperty(nodeRef, QName.createQName("http://www.alfresco.org/model/content/1.0", "countable"))
return null.nodeService.getProperties(nodeRef)
returns all properties but nocountable
key is present.
我在露天资源中进行搜索,发现 CounterIncrementActionExecuter
是扩展的 ActionExecuterAbstractBase
并定义了 executeImpl
,但是:
I have search in alfresco sources and found CounterIncrementActionExecuter
is extends ActionExecuterAbstractBase
and defines executeImpl
, but:
-
executeImpl
在创建新列表项时不会被调用。 -
ActionExecuterAbstractBase#isApplicableType
也不会被调用。 -
ActionExecuterAbstractBase#isApplicableType
在applicableTypes
变量处看 不在CounterIncrementActionExecuter
中明确显示。因此,尚不清楚应如何填充它以及何时填充。
executeImpl
is not invoked at new list item creation.ActionExecuterAbstractBase#isApplicableType
also not invoked.ActionExecuterAbstractBase#isApplicableType
"looks" atapplicableTypes
variable which is not populatd explicitly inCounterIncrementActionExecuter
. So it is unclear how it should be populated and when.
所以问题是- cm如何:可计数
方面实际上在露天工作吗?
So the question is - how does cm:countable
aspect actually works in alfresco?
UDPATE
我看到计数器在Java代码中增加了。那么,将它与一个数据库和连接到数据库的多个露天实例一起使用是否安全?
As I see counter is incremented in java code. So is safe to use it with one database and multuple alfresco instances connected to db?
推荐答案
Alfresco管理员通常使用此方面当节点被服务击中时,它将自动增加数字(整数)属性的值。通常仅由Alfresco管理员使用。
This aspect is used generally by Alfresco administrator.It automatically increments the value of a number (integer) property when node is hit by services. This will generally only be used by Alfresco Administrators
cm:countable 方面具有名为 cm:counter 的属性,
cm:countable aspect has property called cm:counter which keeps track of current count.
因此,您用于获取属性的代码应该是。
So, your code for fetching property should be.
nodeService.getProperty(nodeRef, QName.createQName("http://www.alfresco.org/model/content/1.0", "counter"))
现在,它基于与该方面相关的政策起作用。因此,无论何时调用节点,该计数器都会递增。
Now it works based on policy which is tied to that aspect. So, whenever node is invoked that counter is incremented.
这篇关于cm:countable方面如何在露天工作?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!