mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-31 17:39:05 +00:00
Merge recordsmanagement/DEV/DODRECERT to recordsmanagement/BRANCHES/V2.0.1.x for:
RM-904: Actions are missing within Records Management Site for Record Series and its children: r51134: DOD Recert: Upgrade issues * added patch to fill in missing file plan root node reference * default site id set when retrieving saved searches git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/modules/recordsmanagement/BRANCHES/V2.0.1.x@55365 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -1,2 +1,3 @@
|
||||
log4j.logger.org.alfresco.module.org_alfresco_module_rm.caveat=warn
|
||||
log4j.logger.org.alfresco.module.org_alfresco_module_rm.security.RMMethodSecurityPostProcessor=warn
|
||||
log4j.logger.org.alfresco.module.org_alfresco_module_rm.patch=debug
|
||||
|
@@ -576,7 +576,6 @@
|
||||
|
||||
<!-- rma:filePlanComponent is a marker interface for all things RM -->
|
||||
<!-- Security uses it as a key to determine which implementation to use -->
|
||||
<!-- TODO ... this should not be called "filePlan" as it is DOD specific terminology -->
|
||||
<aspect name="rma:filePlanComponent">
|
||||
<title>File Plan Component</title>
|
||||
<archive>false</archive>
|
||||
|
@@ -31,5 +31,21 @@
|
||||
<property name="retryingTransactionHelper" ref="retryingTransactionHelper"/>
|
||||
<property name="qnameDAO" ref="qnameDAO"/>
|
||||
</bean>
|
||||
|
||||
<bean id="org_alfresco_module_rm_RMv2FilePlanNodeRefPatch"
|
||||
parent="module.baseComponent"
|
||||
class="org.alfresco.module.org_alfresco_module_rm.patch.RMv2FilePlanNodeRefPatch">
|
||||
<property name="moduleId" value="org_alfresco_module_rm"/>
|
||||
<property name="name" value="org_alfresco_module_rm_RMv2FilePlanNodeRefPatch"/>
|
||||
<property name="description" value="Patches the existing RM data with the root file plan values."/>
|
||||
<property name="sinceVersion" value="2.0"/>
|
||||
<property name="appliesFromVersion" value="2.0"/>
|
||||
<property name="patchDAO" ref="patchDAO"/>
|
||||
<property name="nodeDAO" ref="nodeDAO" />
|
||||
<property name="qnameDAO" ref="qnameDAO"/>
|
||||
<property name="nodeService" ref="NodeService"/>
|
||||
<property name="recordsManagementService" ref="RecordsManagementService" />
|
||||
<property name="behaviourFilter" ref="policyBehaviourFilter"/>
|
||||
</bean>
|
||||
|
||||
</beans>
|
@@ -0,0 +1,134 @@
|
||||
/*
|
||||
* Copyright (C) 2005-2011 Alfresco Software Limited.
|
||||
*
|
||||
* This file is part of Alfresco
|
||||
*
|
||||
* Alfresco is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Alfresco is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public License
|
||||
* along with Alfresco. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package org.alfresco.module.org_alfresco_module_rm.patch;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.alfresco.module.org_alfresco_module_rm.RecordsManagementService;
|
||||
import org.alfresco.module.org_alfresco_module_rm.dod5015.DOD5015Model;
|
||||
import org.alfresco.module.org_alfresco_module_rm.model.RecordsManagementModel;
|
||||
import org.alfresco.repo.domain.node.NodeDAO;
|
||||
import org.alfresco.repo.domain.patch.PatchDAO;
|
||||
import org.alfresco.repo.domain.qname.QNameDAO;
|
||||
import org.alfresco.repo.module.AbstractModuleComponent;
|
||||
import org.alfresco.repo.policy.BehaviourFilter;
|
||||
import org.alfresco.service.cmr.repository.NodeRef;
|
||||
import org.alfresco.service.cmr.repository.NodeService;
|
||||
import org.alfresco.service.namespace.QName;
|
||||
import org.alfresco.util.Pair;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.springframework.beans.factory.BeanNameAware;
|
||||
|
||||
/**
|
||||
* RM v2.0 File Plan Node Ref Patch
|
||||
*
|
||||
* @author Roy Wetherall
|
||||
*/
|
||||
public class RMv2FilePlanNodeRefPatch extends AbstractModuleComponent
|
||||
implements BeanNameAware, RecordsManagementModel, DOD5015Model
|
||||
{
|
||||
/** Logger */
|
||||
private static Log logger = LogFactory.getLog(RMv2FilePlanNodeRefPatch.class);
|
||||
|
||||
private NodeService nodeService;
|
||||
private RecordsManagementService recordsManagementService;
|
||||
private BehaviourFilter behaviourFilter;
|
||||
private PatchDAO patchDAO;
|
||||
private NodeDAO nodeDAO;
|
||||
private QNameDAO qnameDAO;
|
||||
|
||||
public void setNodeService(NodeService nodeService)
|
||||
{
|
||||
this.nodeService = nodeService;
|
||||
}
|
||||
|
||||
public void setRecordsManagementService(RecordsManagementService recordsManagementService)
|
||||
{
|
||||
this.recordsManagementService = recordsManagementService;
|
||||
}
|
||||
|
||||
public void setBehaviourFilter(BehaviourFilter behaviourFilter)
|
||||
{
|
||||
this.behaviourFilter = behaviourFilter;
|
||||
}
|
||||
|
||||
public void setPatchDAO(PatchDAO patchDAO)
|
||||
{
|
||||
this.patchDAO = patchDAO;
|
||||
}
|
||||
|
||||
public void setNodeDAO(NodeDAO nodeDAO)
|
||||
{
|
||||
this.nodeDAO = nodeDAO;
|
||||
}
|
||||
|
||||
public void setQnameDAO(QNameDAO qnameDAO)
|
||||
{
|
||||
this.qnameDAO = qnameDAO;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see org.alfresco.repo.module.AbstractModuleComponent#executeInternal()
|
||||
*/
|
||||
@Override
|
||||
protected void executeInternal() throws Throwable
|
||||
{
|
||||
if (logger.isDebugEnabled() == true)
|
||||
{
|
||||
logger.debug("RM Module RMv2FilePlanNodeRef Patch ...");
|
||||
}
|
||||
|
||||
Pair<Long, QName> aspectPair = qnameDAO.getQName(ASPECT_FILE_PLAN_COMPONENT);
|
||||
if (aspectPair != null)
|
||||
{
|
||||
List<Long> records = patchDAO.getNodesByAspectQNameId(aspectPair.getFirst(), 0L, patchDAO.getMaxAdmNodeID());
|
||||
|
||||
if (logger.isDebugEnabled() == true)
|
||||
{
|
||||
logger.debug(" ... updating " + records.size() + " items" );
|
||||
}
|
||||
|
||||
behaviourFilter.disableBehaviour();
|
||||
try
|
||||
{
|
||||
for (Long record : records)
|
||||
{
|
||||
Pair<Long, NodeRef> recordPair = nodeDAO.getNodePair(record);
|
||||
NodeRef recordNodeRef = recordPair.getSecond();
|
||||
|
||||
if (nodeService.getProperty(recordNodeRef, PROP_ROOT_NODEREF) == null)
|
||||
{
|
||||
nodeService.setProperty(recordNodeRef, PROP_ROOT_NODEREF, recordsManagementService.getFilePlan(recordNodeRef));
|
||||
}
|
||||
}
|
||||
}
|
||||
finally
|
||||
{
|
||||
behaviourFilter.enableBehaviour();
|
||||
}
|
||||
}
|
||||
|
||||
if (logger.isDebugEnabled() == true)
|
||||
{
|
||||
logger.debug(" ... complete RM Module RMv2FilePlanNodeRef Patch");
|
||||
}
|
||||
|
||||
}
|
||||
}
|
@@ -43,7 +43,7 @@ public class RMv2ModelPatch extends AbstractModuleComponent
|
||||
implements BeanNameAware, RecordsManagementModel, DOD5015Model
|
||||
{
|
||||
/** Logger */
|
||||
private static Log logger = LogFactory.getLog(NotificationTemplatePatch.class);
|
||||
private static Log logger = LogFactory.getLog(RMv2ModelPatch.class);
|
||||
|
||||
private static long BATCH_SIZE = 100000L;
|
||||
|
||||
@@ -80,7 +80,7 @@ public class RMv2ModelPatch extends AbstractModuleComponent
|
||||
{
|
||||
if (logger.isDebugEnabled() == true)
|
||||
{
|
||||
logger.debug("RM Module NotificationTemplatePatch ...");
|
||||
logger.debug("RM Module RMv2ModelPatch ...");
|
||||
}
|
||||
|
||||
updateQName(QName.createQName(DOD_URI, "filePlan"), TYPE_FILE_PLAN, "TYPE");
|
||||
|
@@ -89,6 +89,8 @@ public class SavedSearchDetails extends ReportDetails
|
||||
public static final String SORT = "sort";
|
||||
public static final String PARAMS = "params";
|
||||
|
||||
private static final String DEFAULT_SITE_ID = "rm";
|
||||
|
||||
/** Site id */
|
||||
private String siteId;
|
||||
|
||||
@@ -117,11 +119,11 @@ public class SavedSearchDetails extends ReportDetails
|
||||
JSONObject search = new JSONObject(jsonString);
|
||||
|
||||
// Get the site id
|
||||
if (search.has(SITE_ID) == false)
|
||||
String siteId = DEFAULT_SITE_ID;
|
||||
if (search.has(SITE_ID) == true)
|
||||
{
|
||||
throw new AlfrescoRuntimeException("Can not create saved search details from json, because required siteid is not present. " + jsonString);
|
||||
}
|
||||
String siteId = search.getString(SITE_ID);
|
||||
siteId = search.getString(SITE_ID);
|
||||
}
|
||||
|
||||
// Get the name
|
||||
if (search.has(NAME) == false)
|
||||
|
Reference in New Issue
Block a user