我將入站規則添加到露天的文件夾中。我如何確定它剛剛創建的節點,還是從另一個文件夾中移出的?Alfresco入站規則
回答
創建新文件夾時,可以使用下一個片段添加新行爲。此示例將針對存儲庫中創建的每個文件夾觸發。你必須自己實現你實際要做的事情。
public class SalesProjectFolderBehaviour implements NodeServicePolicies.OnCreateNodePolicy{
/** The policy component. */
private PolicyComponent policyComponent;
/** The on create node behaviour. */
private Behaviour onCreateNodeBehaviour;
/** The service registry. */
private ServiceRegistry serviceRegistry;
/**
* Inits the.
*/
public void init()
{
LOG.error("initializing the behaviours");
// Create behaviours
this.onCreateNodeBehaviour = new JavaBehaviour(this, "onCreateNode",
NotificationFrequency.TRANSACTION_COMMIT);
// Bind behaviours to node policies
this.policyComponent.bindClassBehaviour(QName.createQName(
NamespaceService.ALFRESCO_URI, "onCreateNode"),
org.alfresco.model.ContentModel.TYPE_FOLDER, this.onCreateNodeBehaviour);
}
/* (non-Javadoc)
* @see org.alfresco.repo.node.NodeServicePolicies.OnCreateNodePolicy#onCreateNode(org.alfresco.service.cmr.repository.ChildAssociationRef)
*/
@Override
public void onCreateNode(ChildAssociationRef childAssocRef) {
LOG.trace("created new folder!");
}
}
OP正在尋找文件夾規則的幫助,而不是行爲。 – 2013-02-13 23:54:33
嗨Jeff 行爲的實現不能像文件夾規則一樣嗎?我知道我的答案不是入站規則,但它可以完成同樣的事情。 – Qkyrie 2013-02-14 08:11:48
嗨Qkyrie,謝謝你的回答,但我不想用我的邏輯使用策略。 – mrgrechkinn 2013-02-14 10:06:38
- 1. 自定義規則Alfresco
- 2. Alfresco:文件夾之間的規則
- 3. 在IIS中添加入站規則[UrlRewite]
- 4. Snort網站攔截規則
- 5. URL tuckey - 出站規則
- 6. Alfresco大規模刪除
- 7. 寫入.htaccess規則
- 8. 導入css規則
- 9. 將RTF轉換爲PDF到一個規則到Alfresco
- 10. Alfresco的:相關的文件夾觸發規則
- 11. 全球門戶網站規則和輔助功能規則?
- 12. Alfresco提升網站效果
- 13. 獲取Alfresco網站我是
- 14. 將規則注入spock規範
- 15. 入站規則更改未更新到實例
- 16. URL重寫IIS 7的入站規則替換cookie的值
- 17. 解決Azure入站安全規則不起作用
- 18. IIS Url重寫入站規則進程查詢字符串
- 19. azure cli 2.0如何添加入站nat規則?
- 20. EC2實例入站規則不起作用
- 21. Azure虛擬機 - 創建TCP入站規則
- 22. 如何使用DNS爲EC2添加入站安全規則?
- 23. Windows防火牆入站規則和環境PATH變量
- 24. iis se友好的url - 入站規則 - 可選參數?
- 25. 在DSC腳本添加入站重寫規則不起作用
- 26. 什麼是輸入規則?
- 27. ESLint導入規則錯誤
- 28. 用Javascript插入CSS規則
- 29. Sitecore插入選項規則
解決方法:對於新節點「cm:created」等於「cm:modified」。所以我檢查「cm:created」是否等於「cm:modified」這是一個新節點。 – mrgrechkinn 2013-02-14 10:08:37