本文整理汇总了Java中org.alfresco.repo.node.NodeServicePolicies类的典型用法代码示例。如果您正苦于以下问题:Java NodeServicePolicies类的具体用法?Java NodeServicePolicies怎么用?Java NodeServicePolicies使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
NodeServicePolicies类属于org.alfresco.repo.node包,在下文中一共展示了NodeServicePolicies类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: init
import org.alfresco.repo.node.NodeServicePolicies; //导入依赖的package包/类
public void init()
{
PropertyCheck.mandatory(this, "diskInterface", diskInterface);
PropertyCheck.mandatory(this, "diskSizeInterface", diskSizeInterface);
PropertyCheck.mandatory(this, "ioctltInterface", ioctlInterface);
PropertyCheck.mandatory(this, "fileInfoCache", fileInfoCache);
PropertyCheck.mandatory(this, "fileLockingInterface", getFileLockingInterface());
PropertyCheck.mandatory(this, "opLockInterface", getOpLockInterface());
PropertyCheck.mandatory(this, "fileLockingInterface", fileLockingInterface);
PropertyCheck.mandatory(this, "policyComponent", getPolicyComponent());
getPolicyComponent().bindClassBehaviour( NodeServicePolicies.OnDeleteNodePolicy.QNAME,
this, new JavaBehaviour(this, "onDeleteNode"));
getPolicyComponent().bindClassBehaviour( NodeServicePolicies.OnMoveNodePolicy.QNAME,
this, new JavaBehaviour(this, "onMoveNode"));
}
示例2: init
import org.alfresco.repo.node.NodeServicePolicies; //导入依赖的package包/类
/**
* Registers to listen for events of interest.
* @since 3.5.0
*/
public void init()
{
policyComponent.bindClassBehaviour(
NodeServicePolicies.OnCreateNodePolicy.QNAME,
ContentModel.TYPE_THUMBNAIL,
new JavaBehaviour(this, "onCreateNode", Behaviour.NotificationFrequency.EVERY_EVENT));
policyComponent.bindClassBehaviour(
NodeServicePolicies.BeforeCreateNodePolicy.QNAME,
ContentModel.TYPE_FAILED_THUMBNAIL,
new JavaBehaviour(this, "beforeCreateNode", Behaviour.NotificationFrequency.EVERY_EVENT));
policyComponent.bindClassBehaviour(
NodeServicePolicies.OnDeleteNodePolicy.QNAME,
ContentModel.TYPE_THUMBNAIL,
new JavaBehaviour(this, "onDeleteNode", Behaviour.NotificationFrequency.EVERY_EVENT));
// Register copy class behaviour
this.policyComponent.bindClassBehaviour(
CopyServicePolicies.OnCopyNodePolicy.QNAME,
ContentModel.ASPECT_THUMBNAIL_MODIFICATION,
new JavaBehaviour(this, "getCopyCallback"));
transactionListener = new ThumbnailTransactionListenerAdapter();
}
示例3: init
import org.alfresco.repo.node.NodeServicePolicies; //导入依赖的package包/类
/**
* Initialise the Multilingual Aspect
*
* Ensures that the {@link ContentModel#ASPECT_MULTILINGUAL_DOCUMENT ml document aspect}
*/
public void init()
{
this.policyComponent.bindClassBehaviour(
CopyServicePolicies.OnCopyNodePolicy.QNAME,
ContentModel.ASPECT_MULTILINGUAL_DOCUMENT,
new JavaBehaviour(this, "getCopyCallback"));
this.policyComponent.bindAssociationBehaviour(
NodeServicePolicies.BeforeDeleteChildAssociationPolicy.QNAME,
ContentModel.TYPE_MULTILINGUAL_CONTAINER,
ContentModel.ASSOC_MULTILINGUAL_CHILD,
new JavaBehaviour(this, "beforeDeleteChildAssociation"));
this.policyComponent.bindClassBehaviour(
NodeServicePolicies.OnUpdatePropertiesPolicy.QNAME,
ContentModel.ASPECT_MULTILINGUAL_DOCUMENT,
new JavaBehaviour(this, "onUpdateProperties"));
}
示例4: init
import org.alfresco.repo.node.NodeServicePolicies; //导入依赖的package包/类
/**
* Service initialise
*/
public void init()
{
// Set up a temporary store
this.tempStore = new FileContentStore(this.applicationContext, TempFileProvider.getTempDir().getAbsolutePath());
// Bind on update properties behaviour
this.policyComponent.bindClassBehaviour(
NodeServicePolicies.OnUpdatePropertiesPolicy.QNAME,
this,
new JavaBehaviour(this, "onUpdateProperties"));
// Register on content update policy
this.onContentUpdateDelegate = this.policyComponent.registerClassPolicy(OnContentUpdatePolicy.class);
this.onContentPropertyUpdateDelegate = this.policyComponent.registerClassPolicy(OnContentPropertyUpdatePolicy.class);
this.onContentReadDelegate = this.policyComponent.registerClassPolicy(OnContentReadPolicy.class);
}
示例5: registerRuleTrigger
import org.alfresco.repo.node.NodeServicePolicies; //导入依赖的package包/类
/**
* @see org.alfresco.repo.rule.ruletrigger.RuleTrigger#registerRuleTrigger()
*/
public void registerRuleTrigger()
{
if (isClassBehaviour == true)
{
this.policyComponent.bindClassBehaviour(
QName.createQName(NamespaceService.ALFRESCO_URI, POLICY),
this,
new JavaBehaviour(this, POLICY));
}
else
{
this.policyComponent.bindAssociationBehaviour(
QName.createQName(NamespaceService.ALFRESCO_URI, POLICY),
this,
new JavaBehaviour(this, POLICY));
}
this.policyComponent.bindClassBehaviour(
NodeServicePolicies.BeforeMoveNodePolicy.QNAME,
this,
new JavaBehaviour(this, NodeServicePolicies.BeforeMoveNodePolicy.QNAME.getLocalName()));
}
示例6: init
import org.alfresco.repo.node.NodeServicePolicies; //导入依赖的package包/类
/**
* The initialise method. Register our policies.
*/
public void init()
{
checkMandatoryProperties();
// Register interest in the beforeDeleteNode policy - note: currently for content only !!
policyComponent.bindClassBehaviour(
QName.createQName(NamespaceService.ALFRESCO_URI, "beforeDeleteNode"),
ContentModel.TYPE_CONTENT,
new JavaBehaviour(this, "beforeDeleteNode"));
//Register interest in the onCopyNodePolicy to block copying of quick share metadta
policyComponent.bindClassBehaviour(
CopyServicePolicies.OnCopyNodePolicy.QNAME,
QuickShareModel.ASPECT_QSHARE,
new JavaBehaviour(this, "getCopyCallback"));
this.policyComponent.bindClassBehaviour(
NodeServicePolicies.OnRestoreNodePolicy.QNAME,
QuickShareModel.ASPECT_QSHARE,
new JavaBehaviour(this, "onRestoreNode"));
}
示例7: test2ClasspathLocationBehaviour
import org.alfresco.repo.node.NodeServicePolicies; //导入依赖的package包/类
public void test2ClasspathLocationBehaviour()
{
// Register the onCreateNode behaviour script
ScriptLocation location = new ClasspathScriptLocation("org/alfresco/repo/jscript/test_onCreateNode_cmContent.js");
ScriptBehaviour behaviour = new ScriptBehaviour(this.serviceRegistry, location);
this.policyComponent.bindClassBehaviour(
QName.createQName(NodeServicePolicies.OnCreateNodePolicy.NAMESPACE, "onCreateNode"),
ContentModel.TYPE_CONTENT,
behaviour);
// Create a content node
Map<QName, Serializable> props = new HashMap<QName, Serializable>(1);
props.put(ContentModel.PROP_NAME, "myDoc.txt");
ChildAssociationRef childAssoc = this.nodeService.createNode(
this.folderNodeRef,
ContentModel.ASSOC_CONTAINS,
QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, "myDoc.txt"),
ContentModel.TYPE_CONTENT,
props);
// Since the behavoiour will have been run check that the titled aspect has been applied
assertTrue(this.nodeService.hasAspect(childAssoc.getChildRef(), ContentModel.ASPECT_TITLED));
}
示例8: init
import org.alfresco.repo.node.NodeServicePolicies; //导入依赖的package包/类
/**
* Registers to listen for events of interest.
* @since 3.5.0
*/
public void init()
{
policyComponent.bindClassBehaviour(
NodeServicePolicies.OnCreateNodePolicy.QNAME,
ContentModel.TYPE_THUMBNAIL,
new JavaBehaviour(this, "onCreateNode", Behaviour.NotificationFrequency.EVERY_EVENT));
policyComponent.bindClassBehaviour(
NodeServicePolicies.BeforeCreateNodePolicy.QNAME,
ContentModel.TYPE_FAILED_THUMBNAIL,
new JavaBehaviour(this, "beforeCreateNode", Behaviour.NotificationFrequency.EVERY_EVENT));
policyComponent.bindClassBehaviour(
NodeServicePolicies.OnDeleteNodePolicy.QNAME,
ContentModel.TYPE_THUMBNAIL,
new JavaBehaviour(this, "onDeleteNode", Behaviour.NotificationFrequency.EVERY_EVENT));
transactionListener = new ThumbnailTransactionListenerAdapter();
}
示例9: init
import org.alfresco.repo.node.NodeServicePolicies; //导入依赖的package包/类
/**
* Initialisation method
*/
public void init()
{
getPolicyComponent().bindClassBehaviour(
NodeServicePolicies.OnAddAspectPolicy.QNAME,
ASPECT_RECORD,
new JavaBehaviour(this, "onAddRecord", TRANSACTION_COMMIT));
getPolicyComponent().bindClassBehaviour(
NodeServicePolicies.OnMoveNodePolicy.QNAME,
ASPECT_RECORD,
new JavaBehaviour(this, "onMoveRecord", TRANSACTION_COMMIT));
getPolicyComponent().bindClassBehaviour(
NodeServicePolicies.OnMoveNodePolicy.QNAME,
TYPE_RECORD_CATEGORY,
new JavaBehaviour(this, "onMoveNode", TRANSACTION_COMMIT));
}
示例10: init
import org.alfresco.repo.node.NodeServicePolicies; //导入依赖的package包/类
/**
* Init method
*/
public void init()
{
// bind policies
beforeFileRecord = policyComponent.registerClassPolicy(BeforeFileRecord.class);
onFileRecord = policyComponent.registerClassPolicy(OnFileRecord.class);
// bind behaviours
policyComponent.bindAssociationBehaviour(
NodeServicePolicies.OnCreateChildAssociationPolicy.QNAME,
TYPE_RECORD_FOLDER,
ContentModel.ASSOC_CONTAINS,
onCreateChildAssociation);
policyComponent.bindAssociationBehaviour(
NodeServicePolicies.BeforeDeleteChildAssociationPolicy.QNAME,
ContentModel.TYPE_FOLDER,
ContentModel.ASSOC_CONTAINS,
onDeleteDeclaredRecordLink);
}
示例11: init
import org.alfresco.repo.node.NodeServicePolicies; //导入依赖的package包/类
public void init()
{
PropertyCheck.mandatory(this, "policyComponent", policyComponent);
PropertyCheck.mandatory(this, "behaviourFilter", behaviourFilter);
PropertyCheck.mandatory(this, "ruleService", ruleService);
PropertyCheck.mandatory(this, "nodeService", nodeService);
this.policyComponent.bindClassBehaviour(
CopyServicePolicies.OnCopyNodePolicy.QNAME,
RuleModel.ASPECT_RULES,
new JavaBehaviour(this, "getCopyCallback"));
this.policyComponent.bindClassBehaviour(
CopyServicePolicies.OnCopyCompletePolicy.QNAME,
RuleModel.ASPECT_RULES,
new JavaBehaviour(this, "onCopyComplete"));
this.policyComponent.bindClassBehaviour(
NodeServicePolicies.OnAddAspectPolicy.QNAME,
RuleModel.ASPECT_RULES,
new JavaBehaviour(this, "onAddAspect"));
this.policyComponent.bindClassBehaviour(
NodeServicePolicies.BeforeRemoveAspectPolicy.QNAME,
RuleModel.ASPECT_RULES,
new JavaBehaviour(this, "beforeRemoveAspect"));
this.policyComponent.bindClassBehaviour(
NodeServicePolicies.BeforeDeleteNodePolicy.QNAME,
RuleModel.ASPECT_RULES,
new JavaBehaviour(this, "beforeDeleteNode"));
}
示例12: registerRuleTrigger
import org.alfresco.repo.node.NodeServicePolicies; //导入依赖的package包/类
/**
* {@inheritDoc}
*/
public void registerRuleTrigger()
{
if (isClassBehaviour == true)
{
this.policyComponent.bindClassBehaviour(
QName.createQName(NamespaceService.ALFRESCO_URI, POLICY),
this,
new JavaBehaviour(this, POLICY));
}
else
{
this.policyComponent.bindAssociationBehaviour(
QName.createQName(NamespaceService.ALFRESCO_URI, POLICY),
this,
new JavaBehaviour(this, POLICY));
}
for (QName ignoreAspect : getIgnoredAspects())
{
// Register interest in the addition and removal of the sys:noContent aspect
this.policyComponent.bindClassBehaviour(
NodeServicePolicies.OnAddAspectPolicy.QNAME,
ignoreAspect,
new JavaBehaviour(this, "onAddAspect", NotificationFrequency.EVERY_EVENT));
this.policyComponent.bindClassBehaviour(
NodeServicePolicies.OnRemoveAspectPolicy.QNAME,
ignoreAspect,
new JavaBehaviour(this, "onRemoveAspect", NotificationFrequency.EVERY_EVENT));
}
}
示例13: init
import org.alfresco.repo.node.NodeServicePolicies; //导入依赖的package包/类
/**
* Initialise method
*/
public void init()
{
// Register the policies
onCopyNodeDelegate = policyComponent.registerClassPolicy(CopyServicePolicies.OnCopyNodePolicy.class);
onCopyCompleteDelegate = policyComponent.registerClassPolicy(CopyServicePolicies.OnCopyCompletePolicy.class);
beforeCopyDelegate = policyComponent.registerClassPolicy(CopyServicePolicies.BeforeCopyPolicy.class);
// Register policy behaviours
this.policyComponent.bindAssociationBehaviour(
NodeServicePolicies.BeforeDeleteAssociationPolicy.QNAME,
ContentModel.ASPECT_COPIEDFROM,
ContentModel.ASSOC_ORIGINAL,
new JavaBehaviour(this, "beforeDeleteOriginalAssociation"));
this.policyComponent.bindClassBehaviour(
CopyServicePolicies.OnCopyNodePolicy.QNAME,
ContentModel.ASPECT_COPIEDFROM,
new JavaBehaviour(this, "getCallbackForCopiedFromAspect"));
this.policyComponent.bindClassBehaviour(
CopyServicePolicies.OnCopyNodePolicy.QNAME,
ContentModel.TYPE_FOLDER,
new JavaBehaviour(this, "getCallbackForFolderType"));
this.policyComponent.bindClassBehaviour(
CopyServicePolicies.OnCopyNodePolicy.QNAME,
ContentModel.ASPECT_OWNABLE,
new JavaBehaviour(this, "getCallbackForOwnableAspect"));
}
示例14: init
import org.alfresco.repo.node.NodeServicePolicies; //导入依赖的package包/类
public void init()
{
PropertyCheck.mandatory(this, "policyComponent", policyComponent);
PropertyCheck.mandatory(this, "behaviourFilter", behaviourFilter);
PropertyCheck.mandatory(this, "ruleService", ruleService);
PropertyCheck.mandatory(this, "nodeService", nodeService);
this.policyComponent.bindAssociationBehaviour(
NodeServicePolicies.OnDeleteAssociationPolicy.QNAME,
ActionModel.TYPE_ACTION_SCHEDULE,
ActionModel.ASSOC_SCHEDULED_ACTION,
new JavaBehaviour(this, "onDeleteAssociation"));
this.policyComponent.bindClassBehaviour(
CopyServicePolicies.OnCopyNodePolicy.QNAME,
ActionModel.ASPECT_ACTIONS,
new JavaBehaviour(this, "getCopyCallback"));
this.policyComponent.bindClassBehaviour(
CopyServicePolicies.OnCopyCompletePolicy.QNAME,
ActionModel.ASPECT_ACTIONS,
new JavaBehaviour(this, "onCopyComplete"));
this.policyComponent.bindClassBehaviour(
QName.createQName(NamespaceService.ALFRESCO_URI, "onAddAspect"),
ActionModel.ASPECT_ACTIONS,
new JavaBehaviour(this, "onAddAspect"));
}
示例15: test1EnableDisableBehaviour
import org.alfresco.repo.node.NodeServicePolicies; //导入依赖的package包/类
public void test1EnableDisableBehaviour()
{
// Register the onCreateNode behaviour script
ScriptLocation location = new ClasspathScriptLocation("org/alfresco/repo/jscript/test_onCreateNode_cmContent.js");
ScriptBehaviour behaviour = new ScriptBehaviour(this.serviceRegistry, location);
this.policyComponent.bindClassBehaviour(
QName.createQName(NodeServicePolicies.OnCreateNodePolicy.NAMESPACE, "onCreateNode"),
ContentModel.TYPE_CONTENT,
behaviour);
behaviour.disable();
// Create a content node
Map<QName, Serializable> props = new HashMap<QName, Serializable>(1);
props.put(ContentModel.PROP_NAME, "myDoc.txt");
ChildAssociationRef childAssoc = this.nodeService.createNode(
this.folderNodeRef,
ContentModel.ASSOC_CONTAINS,
QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, "myDoc.txt"),
ContentModel.TYPE_CONTENT,
props);
assertFalse(this.nodeService.hasAspect(childAssoc.getChildRef(), ContentModel.ASPECT_TITLED));
behaviour.enable();
Map<QName, Serializable> props2 = new HashMap<QName, Serializable>(1);
props2.put(ContentModel.PROP_NAME, "myDoc1.txt");
ChildAssociationRef childAssoc2 = this.nodeService.createNode(
this.folderNodeRef,
ContentModel.ASSOC_CONTAINS,
QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, "myDoc1.txt"),
ContentModel.TYPE_CONTENT,
props2);
assertTrue(this.nodeService.hasAspect(childAssoc2.getChildRef(), ContentModel.ASPECT_TITLED));
}