public void init() { policyComponent.bindClassBehaviour( POLICY_BEFORE_CREATE_VERSION, TYPE_VERSION_BASELINED_CONTENT, new JavaBehaviour(this, "beforeCreateVersion")); policyComponent.bindClassBehaviour( POLICY_CALCULATE_VERSION_LABEL, TYPE_VERSION_BASELINED_CONTENT, new JavaBehaviour(this, "calculateVersionLabel")); }
public void init() { policyComponent.bindClassBehaviour( BeforeDeleteNodePolicy.QNAME, ContentModel.TYPE_PERSON, new JavaBehaviour(this, "beforeDeleteNodePerson")); deletePersonTransactionListener = new FeedCleanerDeletePersonTransactionListener(); policyComponent.bindClassBehaviour( BeforeDeleteNodePolicy.QNAME, SiteModel.TYPE_SITE, new JavaBehaviour(this, "beforeDeleteNodeSite")); deleteSiteTransactionListener = new FeedCleanerDeleteSiteTransactionListener(); }
/** Initialise - after bootstrap of schema and tenant admin service */ public void init() { PropertyCheck.mandatory(this, "dictionaryDAO", dictionaryDAO); PropertyCheck.mandatory(this, "contentService", contentService); PropertyCheck.mandatory(this, "nodeService", nodeService); PropertyCheck.mandatory(this, "tenantAdminService", tenantAdminService); PropertyCheck.mandatory(this, "namespaceService", namespaceService); PropertyCheck.mandatory(this, "messageService", messageService); PropertyCheck.mandatory(this, "transactionService", transactionService); PropertyCheck.mandatory(this, "policyComponent", policyComponent); if (onLoadDynamicModelDelegate == null) { onLoadDynamicModelDelegate = policyComponent.registerClassPolicy(DynamicModelPolicies.OnLoadDynamicModel.class); } transactionService .getRetryingTransactionHelper() .doInTransaction( new RetryingTransactionCallback<Object>() { public Object execute() throws Exception { onDictionaryInit(); initMessages(); return (Object) null; } }, transactionService.isReadOnly(), false); }
public void notifyDynamicModelLoaded(DynamicModelInfo entry) { if (onLoadDynamicModelDelegate == null) { onLoadDynamicModelDelegate = policyComponent.registerClassPolicy(DynamicModelPolicies.OnLoadDynamicModel.class); } DynamicModelPolicies.OnLoadDynamicModel policy = onLoadDynamicModelDelegate.get(ContentModel.TYPE_CONTENT); policy.onLoadDynamicModel(entry.model, entry.nodeRef); }
/** Initialise the dictionary, ensuring that a transaction is available */ @Override public void onDictionaryInit() { if (onLoadDynamicModelDelegate == null) { onLoadDynamicModelDelegate = policyComponent.registerClassPolicy(DynamicModelPolicies.OnLoadDynamicModel.class); } RetryingTransactionCallback<Void> initCallback = new RetryingTransactionCallback<Void>() { @Override public Void execute() throws Throwable { onDictionaryInitInTxn(); return null; } }; transactionService.getRetryingTransactionHelper().doInTransaction(initCallback, true, false); }
/** Initialise method */ public void init() { // Register the policies beforeCheckOut = policyComponent.registerClassPolicy(CheckOutCheckInServicePolicies.BeforeCheckOut.class); onCheckOut = policyComponent.registerClassPolicy(CheckOutCheckInServicePolicies.OnCheckOut.class); beforeCheckIn = policyComponent.registerClassPolicy(CheckOutCheckInServicePolicies.BeforeCheckIn.class); onCheckIn = policyComponent.registerClassPolicy(CheckOutCheckInServicePolicies.OnCheckIn.class); beforeCancelCheckOut = policyComponent.registerClassPolicy( CheckOutCheckInServicePolicies.BeforeCancelCheckOut.class); onCancelCheckOut = policyComponent.registerClassPolicy(CheckOutCheckInServicePolicies.OnCancelCheckOut.class); }
public void init() { this.onAddFavouriteDelegate = policyComponent.registerClassPolicy(OnAddFavouritePolicy.class); this.onRemoveFavouriteDelegate = policyComponent.registerClassPolicy(OnRemoveFavouritePolicy.class); }