本文介绍了cm:countable方面如何在露天工作?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我添加了:

        <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:


  1. nodeService.getAspects(nodeRef)定义的项目方面,此列表中显示 cm:countable

  2. nodeService.getProperty(nodeRef,QName .createQName( http://www.alfresco.org/model/content/1.0,可数))返回null。

  3. nodeService.getProperties(nodeRef)返回所有属性,但没有 countable 键。

  1. nodeService.getAspects(nodeRef) return all defined aspects for item, cm:countable presents in this list.
  2. nodeService.getProperty(nodeRef, QName.createQName("http://www.alfresco.org/model/content/1.0", "countable")) return null.
  3. nodeService.getProperties(nodeRef) returns all properties but no countable key is present.

我在露天资源中进行搜索,发现 CounterIncrementActionExecuter 是扩展的 ActionExecuterAbstractBase 并定义了 executeImpl ,但是:

I have search in alfresco sources and found CounterIncrementActionExecuter is extends ActionExecuterAbstractBase and defines executeImpl, but:


  1. executeImpl 在创建新列表项时不会被调用。

  2. ActionExecuterAbstractBase#isApplicableType 也不会被调用。

  3. ActionExecuterAbstractBase#isApplicableType applicableTypes 变量处看 CounterIncrementActionExecuter 中明确显示。因此,尚不清楚应如何填充它以及何时填充。

  1. executeImpl is not invoked at new list item creation.
  2. ActionExecuterAbstractBase#isApplicableType also not invoked.
  3. ActionExecuterAbstractBase#isApplicableType "looks" at applicableTypes variable which is not populatd explicitly in CounterIncrementActionExecuter. 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方面如何在露天工作?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-26 20:11