RM-389 - RM 2.0: 'Custom Metadata' has 'Record Series' after upgrade from RM 1.0

* migrated record series, despite extending record category, don't have the record category custom properties shown in the UI
  * record series is labeled as 'deprecated' in the edit custom properties console
  * some re-org of 'compatibility' code



git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/modules/recordsmanagement/BRANCHES/V2.0@37271 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Roy Wetherall
2012-05-31 00:16:34 +00:00
parent eba5c0e1f3
commit c166cf0ef6
7 changed files with 63 additions and 22 deletions

View File

@@ -39,7 +39,7 @@ import org.alfresco.module.org_alfresco_module_rm.RecordsManagementPolicies.OnCr
import org.alfresco.module.org_alfresco_module_rm.RecordsManagementPolicies.OnRemoveReference;
import org.alfresco.module.org_alfresco_module_rm.caveat.RMListOfValuesConstraint;
import org.alfresco.module.org_alfresco_module_rm.caveat.RMListOfValuesConstraint.MatchLogic;
import org.alfresco.module.org_alfresco_module_rm.dod5015.DOD5015Model;
import org.alfresco.module.org_alfresco_module_rm.compatibility.CompatibilityModel;
import org.alfresco.module.org_alfresco_module_rm.model.RecordsManagementCustomModel;
import org.alfresco.module.org_alfresco_module_rm.model.RecordsManagementModel;
import org.alfresco.repo.content.MimetypeMap;
@@ -428,25 +428,25 @@ public class RecordsManagementAdminServiceImpl implements RecordsManagementAdmin
if (prefixString == null)
{
// Backward compatibility from previous RM V1.0 custom models
if ("customRecordProperties".equals(name) == true)
if (CompatibilityModel.NAME_CUSTOM_RECORD_PROPERTIES.equals(name) == true)
{
type = RecordsManagementModel.ASPECT_RECORD;
}
else if ("customRecordFolderProperties".equals(name) == true)
else if (CompatibilityModel.NAME_CUSTOM_RECORD_FOLDER_PROPERTIES.equals(name) == true)
{
type = RecordsManagementModel.TYPE_RECORD_FOLDER;
}
else if ("customRecordCategoryProperties".equals(name) == true)
else if (CompatibilityModel.NAME_CUSTOM_RECORD_CATEGORY_PROPERTIES.equals(name) == true)
{
type = RecordsManagementModel.TYPE_RECORD_CATEGORY;
}
else if ("customRecordSeriesProperties".equals(name) == true)
else if (CompatibilityModel.NAME_CUSTOM_RECORD_SERIES_PROPERTIES.equals(name) == true)
{
// Only add the deprecated record series type as customisable if
// a v1.0 installation has added custom properties
if (aspectDef.getProperties().size() != 0)
{
type = DOD5015Model.TYPE_RECORD_SERIES;
type = CompatibilityModel.TYPE_RECORD_SERIES;
}
}
}

View File

@@ -32,9 +32,6 @@ public interface DOD5015Model
public static final String DOD_URI = "http://www.alfresco.org/model/dod5015/1.0";
public static final String DOD_PREFIX = "dod";
// Record series DOD type
public static final QName TYPE_RECORD_SERIES = QName.createQName(DOD_URI, "recordSeries");
// DOD 5015 Custom Type aspects and their properties
// Scanned Record
public static final QName ASPECT_SCANNED_RECORD = QName.createQName(DOD_URI, "scannedRecord");

View File

@@ -24,6 +24,7 @@ import java.util.Set;
import org.alfresco.model.ImapModel;
import org.alfresco.module.org_alfresco_module_rm.FilePlanComponentKind;
import org.alfresco.module.org_alfresco_module_rm.compatibility.CompatibilityModel;
import org.alfresco.module.org_alfresco_module_rm.disposition.DispositionSchedule;
import org.alfresco.module.org_alfresco_module_rm.disposition.DispositionScheduleImpl;
import org.alfresco.module.org_alfresco_module_rm.disposition.DispositionService;
@@ -148,6 +149,15 @@ public class RecordsManagementNodeFormFilter extends RecordsManagementFormFilter
protected void addCustomPropertyFieldsToGroup(Form form, NodeRef nodeRef)
{
Set<QName> customisables = rmAdminService.getCustomisable(nodeRef);
// Compatibility support: don't show category properties if node of type series
QName type = nodeService.getType(nodeRef);
if (CompatibilityModel.TYPE_RECORD_SERIES.equals(type) == true)
{
// remove record category from the list of customisable types to apply to the form
customisables.remove(TYPE_RECORD_CATEGORY);
}
for (QName customisable : customisables)
{
addPropertyFieldsToGroup(form, rmAdminService.getCustomPropertyDefinitions(customisable), CUSTOM_RM_FIELD_GROUP_ID);
@@ -157,6 +167,7 @@ public class RecordsManagementNodeFormFilter extends RecordsManagementFormFilter
protected void addRecordMetadataPropertyFieldsToGroup(Form form, NodeRef nodeRef)
{
Set<QName> aspects = rmService.getRecordMetaDataAspects();
for (QName aspect : aspects)
{
if (nodeService.hasAspect(nodeRef, aspect) == true)

View File

@@ -18,7 +18,7 @@
*/
package org.alfresco.module.org_alfresco_module_rm.script;
import org.alfresco.module.org_alfresco_module_rm.dod5015.DOD5015Model;
import org.alfresco.module.org_alfresco_module_rm.compatibility.CompatibilityModel;
import org.alfresco.module.org_alfresco_module_rm.model.RecordsManagementModel;
import org.alfresco.service.namespace.QName;
@@ -53,7 +53,7 @@ public class BaseCustomPropertyWebScript extends AbstractRmWebScript
}
else if ("recordSeries".equalsIgnoreCase(elementName) == true)
{
return DOD5015Model.TYPE_RECORD_SERIES;
return CompatibilityModel.TYPE_RECORD_SERIES;
}
else
{