mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-31 17:39:05 +00:00
RM-4326: undo some formatting
This commit is contained in:
@@ -375,10 +375,10 @@
|
|||||||
|
|
||||||
<!-- File Plan Service -->
|
<!-- File Plan Service -->
|
||||||
|
|
||||||
<bean id="rootContainerCache" class="org.alfresco.repo.cache.DefaultSimpleCache" />
|
<bean id="rootContainerCache" class="org.alfresco.repo.cache.DefaultSimpleCache" />
|
||||||
|
|
||||||
<bean id="filePlanService"
|
<bean id="filePlanService"
|
||||||
parent="baseService"
|
parent="baseService"
|
||||||
class="org.alfresco.module.org_alfresco_module_rm.fileplan.FilePlanServiceImpl">
|
class="org.alfresco.module.org_alfresco_module_rm.fileplan.FilePlanServiceImpl">
|
||||||
<property name="rootContainerCache" ref="rootContainerCache" />
|
<property name="rootContainerCache" ref="rootContainerCache" />
|
||||||
</bean>
|
</bean>
|
||||||
@@ -568,9 +568,9 @@
|
|||||||
parent="baseService">
|
parent="baseService">
|
||||||
<property name="nodeService" ref="nodeService"/>
|
<property name="nodeService" ref="nodeService"/>
|
||||||
<property name="filePlanService" ref="filePlanService" />
|
<property name="filePlanService" ref="filePlanService" />
|
||||||
<property name="filePlanRoleService" ref="filePlanRoleService" />
|
<property name="filePlanRoleService" ref="filePlanRoleService" />
|
||||||
<property name="authorityService" ref="authorityService"/>
|
<property name="authorityService" ref="authorityService"/>
|
||||||
<property name="permissionService" ref="permissionService"/>
|
<property name="permissionService" ref="permissionService"/>
|
||||||
<property name="transactionService" ref="transactionService"/>
|
<property name="transactionService" ref="transactionService"/>
|
||||||
</bean>
|
</bean>
|
||||||
|
|
||||||
@@ -1062,8 +1062,8 @@
|
|||||||
</bean>
|
</bean>
|
||||||
|
|
||||||
<bean id="recordMetadataAspectBootstrap" class="org.alfresco.module.org_alfresco_module_rm.record.RecordMetadataBootstrap" init-method="init" abstract="true">
|
<bean id="recordMetadataAspectBootstrap" class="org.alfresco.module.org_alfresco_module_rm.record.RecordMetadataBootstrap" init-method="init" abstract="true">
|
||||||
<property name="recordService" ref="recordService"/>
|
<property name="recordService" ref="recordService"/>
|
||||||
<property name="namespaceService" ref="namespaceService"/>
|
<property name="namespaceService" ref="namespaceService"/>
|
||||||
</bean>
|
</bean>
|
||||||
|
|
||||||
<bean id="RecordService" class="org.springframework.aop.framework.ProxyFactoryBean">
|
<bean id="RecordService" class="org.springframework.aop.framework.ProxyFactoryBean">
|
||||||
|
@@ -77,8 +77,8 @@ public class RmSiteType extends BaseBehaviourBean
|
|||||||
NodeServicePolicies.BeforeDeleteNodePolicy,
|
NodeServicePolicies.BeforeDeleteNodePolicy,
|
||||||
NodeServicePolicies.OnCreateChildAssociationPolicy
|
NodeServicePolicies.OnCreateChildAssociationPolicy
|
||||||
{
|
{
|
||||||
/** Constant values */
|
/** Constant values */
|
||||||
public static final String COMPONENT_DOCUMENT_LIBRARY = "documentLibrary";
|
public static final String COMPONENT_DOCUMENT_LIBRARY = "documentLibrary";
|
||||||
public static final String DEFAULT_SITE_NAME = "rm";
|
public static final String DEFAULT_SITE_NAME = "rm";
|
||||||
public static final QName DEFAULT_FILE_PLAN_TYPE = TYPE_FILE_PLAN;
|
public static final QName DEFAULT_FILE_PLAN_TYPE = TYPE_FILE_PLAN;
|
||||||
|
|
||||||
@@ -103,8 +103,8 @@ public class RmSiteType extends BaseBehaviourBean
|
|||||||
*/
|
*/
|
||||||
public void setSiteService(SiteService siteService)
|
public void setSiteService(SiteService siteService)
|
||||||
{
|
{
|
||||||
this.siteService = siteService;
|
this.siteService = siteService;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param recordsManagementSearchService records management search service
|
* @param recordsManagementSearchService records management search service
|
||||||
@@ -139,39 +139,39 @@ public class RmSiteType extends BaseBehaviourBean
|
|||||||
*/
|
*/
|
||||||
public void registerFilePlanType(QName siteType, QName filePlanType)
|
public void registerFilePlanType(QName siteType, QName filePlanType)
|
||||||
{
|
{
|
||||||
ParameterCheck.mandatory("siteType", siteType);
|
ParameterCheck.mandatory("siteType", siteType);
|
||||||
ParameterCheck.mandatory("filePlanType", filePlanType);
|
ParameterCheck.mandatory("filePlanType", filePlanType);
|
||||||
|
|
||||||
// check that the registered site type is a subtype of rma:rmsite
|
// check that the registered site type is a subtype of rma:rmsite
|
||||||
if (!dictionaryService.isSubClass(siteType, TYPE_RM_SITE))
|
if (!dictionaryService.isSubClass(siteType, TYPE_RM_SITE))
|
||||||
{
|
{
|
||||||
throw new AlfrescoRuntimeException(
|
throw new AlfrescoRuntimeException(
|
||||||
"Can't register site type, because site type is not a sub type of rma:rmsite (siteType=" + siteType.toString() + ")");
|
"Can't register site type, because site type is not a sub type of rma:rmsite (siteType=" + siteType.toString() + ")");
|
||||||
}
|
}
|
||||||
|
|
||||||
// check that the registered file plan type is a sub type of rma:filePlan
|
// check that the registered file plan type is a sub type of rma:filePlan
|
||||||
if (!dictionaryService.isSubClass(filePlanType, TYPE_FILE_PLAN))
|
if (!dictionaryService.isSubClass(filePlanType, TYPE_FILE_PLAN))
|
||||||
{
|
{
|
||||||
throw new AlfrescoRuntimeException(
|
throw new AlfrescoRuntimeException(
|
||||||
"Can't register file plan type, because site type is not a sub type of rma:filePlan (filePlanType=" + filePlanType.toString() + ")");
|
"Can't register file plan type, because site type is not a sub type of rma:filePlan (filePlanType=" + filePlanType.toString() + ")");
|
||||||
}
|
}
|
||||||
|
|
||||||
// add site and file plan types to map
|
// add site and file plan types to map
|
||||||
mapFilePlanType.put(siteType, filePlanType);
|
mapFilePlanType.put(siteType, filePlanType);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see org.alfresco.repo.node.NodeServicePolicies.OnCreateNodePolicy#onCreateNode(org.alfresco.service.cmr.repository.ChildAssociationRef)
|
* @see org.alfresco.repo.node.NodeServicePolicies.OnCreateNodePolicy#onCreateNode(org.alfresco.service.cmr.repository.ChildAssociationRef)
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
@Behaviour
|
@Behaviour
|
||||||
(
|
(
|
||||||
kind = BehaviourKind.CLASS,
|
kind = BehaviourKind.CLASS,
|
||||||
notificationFrequency = NotificationFrequency.FIRST_EVENT
|
notificationFrequency = NotificationFrequency.FIRST_EVENT
|
||||||
)
|
)
|
||||||
public void onCreateNode(ChildAssociationRef childAssocRef)
|
public void onCreateNode(ChildAssociationRef childAssocRef)
|
||||||
{
|
{
|
||||||
final NodeRef rmSite = childAssocRef.getChildRef();
|
final NodeRef rmSite = childAssocRef.getChildRef();
|
||||||
|
|
||||||
// Do not execute behaviour if this has been created in the archive store
|
// Do not execute behaviour if this has been created in the archive store
|
||||||
if(rmSite.getStoreRef().equals(StoreRef.STORE_REF_ARCHIVE_SPACESSTORE))
|
if(rmSite.getStoreRef().equals(StoreRef.STORE_REF_ARCHIVE_SPACESSTORE))
|
||||||
@@ -186,52 +186,52 @@ public class RmSiteType extends BaseBehaviourBean
|
|||||||
{
|
{
|
||||||
public Object doWork()
|
public Object doWork()
|
||||||
{
|
{
|
||||||
SiteInfo siteInfo = siteService.getSite(rmSite);
|
SiteInfo siteInfo = siteService.getSite(rmSite);
|
||||||
if (siteInfo != null)
|
if (siteInfo != null)
|
||||||
{
|
{
|
||||||
// Create the file plan component
|
// Create the file plan component
|
||||||
siteService.createContainer(siteInfo.getShortName(), COMPONENT_DOCUMENT_LIBRARY, getFilePlanType(siteInfo), null);
|
siteService.createContainer(siteInfo.getShortName(), COMPONENT_DOCUMENT_LIBRARY, getFilePlanType(siteInfo), null);
|
||||||
|
|
||||||
// Add the reports
|
// Add the reports
|
||||||
recordsManagementSearchService.addReports(siteInfo.getShortName());
|
recordsManagementSearchService.addReports(siteInfo.getShortName());
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}, AuthenticationUtil.getAdminUserName());
|
}, AuthenticationUtil.getAdminUserName());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the file plan type for the given site.
|
* Get the file plan type for the given site.
|
||||||
*
|
*
|
||||||
* @param siteInfo site info
|
* @param siteInfo site info
|
||||||
* @return QName file plan type to create as a container
|
* @return QName file plan type to create as a container
|
||||||
* @since 2.2
|
* @since 2.2
|
||||||
*/
|
*/
|
||||||
private QName getFilePlanType(SiteInfo siteInfo)
|
private QName getFilePlanType(SiteInfo siteInfo)
|
||||||
{
|
{
|
||||||
ParameterCheck.mandatory("siteInfo", siteInfo);
|
ParameterCheck.mandatory("siteInfo", siteInfo);
|
||||||
|
|
||||||
// set default file plan
|
// set default file plan
|
||||||
QName result = DEFAULT_FILE_PLAN_TYPE;
|
QName result = DEFAULT_FILE_PLAN_TYPE;
|
||||||
|
|
||||||
// check to see if there is an 'override' for the file plan type given the site type
|
// check to see if there is an 'override' for the file plan type given the site type
|
||||||
QName siteType = nodeService.getType(siteInfo.getNodeRef());
|
QName siteType = nodeService.getType(siteInfo.getNodeRef());
|
||||||
if (mapFilePlanType.containsKey(siteType))
|
if (mapFilePlanType.containsKey(siteType))
|
||||||
{
|
{
|
||||||
result = mapFilePlanType.get(siteType);
|
result = mapFilePlanType.get(siteType);
|
||||||
}
|
}
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Ensure that the visibility of a RM site can not be changed to anything but public.
|
* Ensure that the visibility of a RM site can not be changed to anything but public.
|
||||||
*
|
*
|
||||||
* TODO support other site visibilities
|
* TODO support other site visibilities
|
||||||
*
|
*
|
||||||
* @see org.alfresco.repo.node.NodeServicePolicies.OnUpdatePropertiesPolicy#onUpdateProperties(org.alfresco.service.cmr.repository.NodeRef, java.util.Map, java.util.Map)
|
* @see org.alfresco.repo.node.NodeServicePolicies.OnUpdatePropertiesPolicy#onUpdateProperties(org.alfresco.service.cmr.repository.NodeRef, java.util.Map, java.util.Map)
|
||||||
*/
|
*/
|
||||||
@Behaviour
|
@Behaviour
|
||||||
(
|
(
|
||||||
kind = BehaviourKind.CLASS,
|
kind = BehaviourKind.CLASS,
|
||||||
|
@@ -61,7 +61,6 @@ import org.junit.Before;
|
|||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
import org.mockito.ArgumentCaptor;
|
import org.mockito.ArgumentCaptor;
|
||||||
import org.mockito.InjectMocks;
|
import org.mockito.InjectMocks;
|
||||||
import org.mockito.Mock;
|
|
||||||
import org.mockito.Spy;
|
import org.mockito.Spy;
|
||||||
import org.mockito.invocation.InvocationOnMock;
|
import org.mockito.invocation.InvocationOnMock;
|
||||||
import org.mockito.stubbing.Answer;
|
import org.mockito.stubbing.Answer;
|
||||||
@@ -83,9 +82,6 @@ public class HoldServiceImplUnitTest extends BaseUnitTest
|
|||||||
protected NodeRef hold;
|
protected NodeRef hold;
|
||||||
protected NodeRef hold2;
|
protected NodeRef hold2;
|
||||||
|
|
||||||
@Mock
|
|
||||||
private HoldType mockedHoldType;
|
|
||||||
|
|
||||||
@Spy @InjectMocks HoldServiceImpl holdService;
|
@Spy @InjectMocks HoldServiceImpl holdService;
|
||||||
|
|
||||||
@Before
|
@Before
|
||||||
|
Reference in New Issue
Block a user