mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
Update behaviour bindings to be consistently on 'init' (rather than 'afterPropertiesSet'). Pre-cursor to future improvements of dictionary / policy binding 'bootstrap' sequence.
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@13985 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -357,7 +357,7 @@
|
|||||||
</property>
|
</property>
|
||||||
</bean>
|
</bean>
|
||||||
|
|
||||||
<bean name="homeFolderManager" class="org.alfresco.repo.security.person.HomeFolderManager">
|
<bean name="homeFolderManager" class="org.alfresco.repo.security.person.HomeFolderManager" init-method="init">
|
||||||
<property name="nodeService">
|
<property name="nodeService">
|
||||||
<ref bean="nodeService" />
|
<ref bean="nodeService" />
|
||||||
</property>
|
</property>
|
||||||
|
@@ -734,7 +734,7 @@
|
|||||||
<!-- Lock Service -->
|
<!-- Lock Service -->
|
||||||
<!-- -->
|
<!-- -->
|
||||||
|
|
||||||
<bean id="lockService" class="org.alfresco.repo.lock.LockServiceImpl" init-method="initialise">
|
<bean id="lockService" class="org.alfresco.repo.lock.LockServiceImpl" init-method="init">
|
||||||
<property name="nodeService">
|
<property name="nodeService">
|
||||||
<ref bean="nodeService" />
|
<ref bean="nodeService" />
|
||||||
</property>
|
</property>
|
||||||
|
@@ -2,7 +2,7 @@
|
|||||||
<!DOCTYPE beans PUBLIC '-//SPRING//DTD BEAN//EN' 'http://www.springframework.org/dtd/spring-beans.dtd'>
|
<!DOCTYPE beans PUBLIC '-//SPRING//DTD BEAN//EN' 'http://www.springframework.org/dtd/spring-beans.dtd'>
|
||||||
|
|
||||||
<beans>
|
<beans>
|
||||||
<bean id="ownableService" class="org.alfresco.repo.ownable.impl.OwnableServiceImpl">
|
<bean id="ownableService" class="org.alfresco.repo.ownable.impl.OwnableServiceImpl" init-method="init">
|
||||||
<property name="nodeService">
|
<property name="nodeService">
|
||||||
<ref bean="nodeService"/>
|
<ref bean="nodeService"/>
|
||||||
</property>
|
</property>
|
||||||
|
@@ -39,7 +39,7 @@
|
|||||||
<bean id="permissionServiceImpl" class="org.alfresco.repo.security.permissions.noop.PermissionServiceNOOPImpl" />
|
<bean id="permissionServiceImpl" class="org.alfresco.repo.security.permissions.noop.PermissionServiceNOOPImpl" />
|
||||||
-->
|
-->
|
||||||
|
|
||||||
<bean id="permissionServiceImpl" class="org.alfresco.repo.security.permissions.impl.PermissionServiceImpl">
|
<bean id="permissionServiceImpl" class="org.alfresco.repo.security.permissions.impl.PermissionServiceImpl" init-method="init">
|
||||||
<property name="nodeService">
|
<property name="nodeService">
|
||||||
<ref bean="mtAwareNodeService" />
|
<ref bean="mtAwareNodeService" />
|
||||||
</property>
|
</property>
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C) 2005-2007 Alfresco Software Limited.
|
* Copyright (C) 2005-2009 Alfresco Software Limited.
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or
|
* This program is free software; you can redistribute it and/or
|
||||||
* modify it under the terms of the GNU General Public License
|
* modify it under the terms of the GNU General Public License
|
||||||
@@ -182,7 +182,7 @@ public class LockServiceImpl implements LockService,
|
|||||||
/**
|
/**
|
||||||
* Initialise methods called by Spring framework
|
* Initialise methods called by Spring framework
|
||||||
*/
|
*/
|
||||||
public void initialise()
|
public void init()
|
||||||
{
|
{
|
||||||
// Register the various class behaviours to enable lock checking
|
// Register the various class behaviours to enable lock checking
|
||||||
this.policyComponent.bindAssociationBehaviour(
|
this.policyComponent.bindAssociationBehaviour(
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C) 2005-2007 Alfresco Software Limited.
|
* Copyright (C) 2005-2009 Alfresco Software Limited.
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or
|
* This program is free software; you can redistribute it and/or
|
||||||
* modify it under the terms of the GNU General Public License
|
* modify it under the terms of the GNU General Public License
|
||||||
@@ -109,7 +109,10 @@ public class OwnableServiceImpl implements OwnableService, InitializingBean, Nod
|
|||||||
{
|
{
|
||||||
throw new IllegalArgumentException("Property 'policyComponent' has not been set");
|
throw new IllegalArgumentException("Property 'policyComponent' has not been set");
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void init()
|
||||||
|
{
|
||||||
policyComponent.bindClassBehaviour(QName.createQName(NamespaceService.ALFRESCO_URI, "onAddAspect"), ContentModel.ASPECT_OWNABLE, new JavaBehaviour(this, "onAddAspect"));
|
policyComponent.bindClassBehaviour(QName.createQName(NamespaceService.ALFRESCO_URI, "onAddAspect"), ContentModel.ASPECT_OWNABLE, new JavaBehaviour(this, "onAddAspect"));
|
||||||
policyComponent.bindClassBehaviour(QName.createQName(NamespaceService.ALFRESCO_URI, "onUpdateProperties"), ContentModel.ASPECT_OWNABLE, new JavaBehaviour(this, "onUpdateProperties"));
|
policyComponent.bindClassBehaviour(QName.createQName(NamespaceService.ALFRESCO_URI, "onUpdateProperties"), ContentModel.ASPECT_OWNABLE, new JavaBehaviour(this, "onUpdateProperties"));
|
||||||
policyComponent.bindClassBehaviour(QName.createQName(NamespaceService.ALFRESCO_URI, "onRemoveAspect"), ContentModel.ASPECT_OWNABLE, new JavaBehaviour(this,
|
policyComponent.bindClassBehaviour(QName.createQName(NamespaceService.ALFRESCO_URI, "onRemoveAspect"), ContentModel.ASPECT_OWNABLE, new JavaBehaviour(this,
|
||||||
@@ -121,7 +124,6 @@ public class OwnableServiceImpl implements OwnableService, InitializingBean, Nod
|
|||||||
policyComponent.bindClassBehaviour(QName.createQName(NamespaceService.ALFRESCO_URI, "onRemoveAspect"), ContentModel.ASPECT_AUDITABLE, new JavaBehaviour(this,
|
policyComponent.bindClassBehaviour(QName.createQName(NamespaceService.ALFRESCO_URI, "onRemoveAspect"), ContentModel.ASPECT_AUDITABLE, new JavaBehaviour(this,
|
||||||
"onRemoveAspect"));
|
"onRemoveAspect"));
|
||||||
policyComponent.bindClassBehaviour(QName.createQName(NamespaceService.ALFRESCO_URI, "onDeleteNode"), ContentModel.ASPECT_AUDITABLE, new JavaBehaviour(this, "onDeleteNode"));
|
policyComponent.bindClassBehaviour(QName.createQName(NamespaceService.ALFRESCO_URI, "onDeleteNode"), ContentModel.ASPECT_AUDITABLE, new JavaBehaviour(this, "onDeleteNode"));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// OwnableService implmentation
|
// OwnableService implmentation
|
||||||
|
@@ -287,12 +287,16 @@ public class PermissionServiceImpl implements PermissionServiceSPI, Initializing
|
|||||||
throw new IllegalArgumentException("Property 'aclDaoComponent' has not been set");
|
throw new IllegalArgumentException("Property 'aclDaoComponent' has not been set");
|
||||||
}
|
}
|
||||||
|
|
||||||
policyComponent.bindClassBehaviour(QName.createQName(NamespaceService.ALFRESCO_URI, "onMoveNode"), ContentModel.TYPE_BASE, new JavaBehaviour(this, "onMoveNode"));
|
|
||||||
|
|
||||||
allPermissionReference = getPermissionReference(ALL_PERMISSIONS);
|
allPermissionReference = getPermissionReference(ALL_PERMISSIONS);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void init()
|
||||||
|
{
|
||||||
|
policyComponent.bindClassBehaviour(QName.createQName(NamespaceService.ALFRESCO_URI, "onMoveNode"), ContentModel.TYPE_BASE, new JavaBehaviour(this, "onMoveNode"));
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// Permissions Service
|
// Permissions Service
|
||||||
//
|
//
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (C) 2005-2007 Alfresco Software Limited.
|
* Copyright (C) 2005-2009 Alfresco Software Limited.
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or
|
* This program is free software; you can redistribute it and/or
|
||||||
* modify it under the terms of the GNU General Public License
|
* modify it under the terms of the GNU General Public License
|
||||||
@@ -36,14 +36,13 @@ import org.alfresco.service.cmr.repository.NodeService;
|
|||||||
import org.alfresco.service.cmr.repository.datatype.DefaultTypeConverter;
|
import org.alfresco.service.cmr.repository.datatype.DefaultTypeConverter;
|
||||||
import org.alfresco.service.namespace.NamespaceService;
|
import org.alfresco.service.namespace.NamespaceService;
|
||||||
import org.alfresco.service.namespace.QName;
|
import org.alfresco.service.namespace.QName;
|
||||||
import org.springframework.beans.factory.InitializingBean;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Manage home folder creation by binding to events from the cm:person type.
|
* Manage home folder creation by binding to events from the cm:person type.
|
||||||
*
|
*
|
||||||
* @author Andy Hind
|
* @author Andy Hind
|
||||||
*/
|
*/
|
||||||
public class HomeFolderManager implements InitializingBean, NodeServicePolicies.OnCreateNodePolicy
|
public class HomeFolderManager implements NodeServicePolicies.OnCreateNodePolicy
|
||||||
{
|
{
|
||||||
|
|
||||||
private PolicyComponent policyComponent;
|
private PolicyComponent policyComponent;
|
||||||
@@ -65,7 +64,7 @@ public class HomeFolderManager implements InitializingBean, NodeServicePolicies.
|
|||||||
/**
|
/**
|
||||||
* Bind the class behaviour to this implementation
|
* Bind the class behaviour to this implementation
|
||||||
*/
|
*/
|
||||||
public void afterPropertiesSet() throws Exception
|
public void init() throws Exception
|
||||||
{
|
{
|
||||||
if (enableHomeFolderCreationAsPeopleAreCreated)
|
if (enableHomeFolderCreationAsPeopleAreCreated)
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user