RM dependency upgrade (4.2.d)

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/modules/recordsmanagement/HEAD@49264 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Tuna Aksoy
2013-04-15 20:49:23 +00:00
parent 4654fbacce
commit ae3a4f8b8e
23 changed files with 833 additions and 792 deletions

View File

@@ -199,6 +199,7 @@
<property name="recordsManagementService" ref="recordsManagementService"/> <property name="recordsManagementService" ref="recordsManagementService"/>
<property name="recordService" ref="recordService"/> <property name="recordService" ref="recordService"/>
<property name="recordsManagementAdminService" ref="recordsManagementAdminService"/> <property name="recordsManagementAdminService" ref="recordsManagementAdminService"/>
<property name="dictionaryService" ref="DictionaryService" />
</bean> </bean>
<bean id="rmNodeFormFilter" <bean id="rmNodeFormFilter"

View File

@@ -8,4 +8,4 @@ module.title=Records Management
module.description=Alfresco Record Management Extension module.description=Alfresco Record Management Extension
module.version=2.1 module.version=2.1
module.repo.version.min=4.1.3 module.repo.version.min=4.2

View File

@@ -1399,6 +1399,7 @@
<property name="dictionaryService" ref="dictionaryService"/> <property name="dictionaryService" ref="dictionaryService"/>
<property name="tenantService" ref="tenantService"/> <property name="tenantService" ref="tenantService"/>
<property name="nodeDAO" ref="nodeDAO"/> <property name="nodeDAO" ref="nodeDAO"/>
<property name="nodeService" ref="nodeService"/>
<property name="qnameDAO" ref="qnameDAO"/> <property name="qnameDAO" ref="qnameDAO"/>
<property name="localeDAO" ref="localeDAO"/> <property name="localeDAO" ref="localeDAO"/>
<property name="contentDataDAO" ref="contentDataDAO"/> <property name="contentDataDAO" ref="contentDataDAO"/>

View File

@@ -68,6 +68,7 @@
class="org.alfresco.module.org_alfresco_module_rm.script.CustomReferenceDefinitionsGet" class="org.alfresco.module.org_alfresco_module_rm.script.CustomReferenceDefinitionsGet"
parent="webscript"> parent="webscript">
<property name="recordsManagementAdminService" ref="RecordsManagementAdminService" /> <property name="recordsManagementAdminService" ref="RecordsManagementAdminService" />
<property name="dictionaryService" ref="DictionaryService" />
</bean> </bean>
<!-- REST impl for PUT Custom Reference Definitions --> <!-- REST impl for PUT Custom Reference Definitions -->
@@ -89,6 +90,7 @@
class="org.alfresco.module.org_alfresco_module_rm.script.CustomRefsGet" class="org.alfresco.module.org_alfresco_module_rm.script.CustomRefsGet"
parent="rmBaseWebscript"> parent="rmBaseWebscript">
<property name="recordsManagementAdminService" ref="RecordsManagementAdminService" /> <property name="recordsManagementAdminService" ref="RecordsManagementAdminService" />
<property name="dictionaryService" ref="DictionaryService" />
</bean> </bean>
<!-- REST impl for POST Custom Reference Instance --> <!-- REST impl for POST Custom Reference Instance -->
@@ -155,6 +157,7 @@
parent="webscript"> parent="webscript">
<property name="dispositionService" ref="DispositionService" /> <property name="dispositionService" ref="DispositionService" />
<property name="namespaceService" ref="NamespaceService" /> <property name="namespaceService" ref="NamespaceService" />
<property name="dictionaryService" ref="DictionaryService" />
</bean> </bean>
<!-- REST impl for GET Records MetaData aspects --> <!-- REST impl for GET Records MetaData aspects -->

View File

@@ -421,7 +421,7 @@ public class RecordsManagementAdminServiceImpl implements RecordsManagementAdmin
if (name.endsWith("Properties") == true) if (name.endsWith("Properties") == true)
{ {
QName type = null; QName type = null;
String prefixString = aspectDef.getDescription(); String prefixString = aspectDef.getDescription(dictionaryService);
if (prefixString == null) if (prefixString == null)
{ {
// Backward compatibility from previous RM V1.0 custom models // Backward compatibility from previous RM V1.0 custom models
@@ -1183,7 +1183,7 @@ public class RecordsManagementAdminServiceImpl implements RecordsManagementAdmin
{ {
for (AssociationDefinition associationDefinition : getCustomReferenceDefinitions().values()) for (AssociationDefinition associationDefinition : getCustomReferenceDefinitions().values())
{ {
if (associationDefinition.getTitle().equalsIgnoreCase(label)) if (associationDefinition.getTitle(dictionaryService).equalsIgnoreCase(label))
{ {
return true; return true;
} }

View File

@@ -84,7 +84,7 @@ public class SplitEmailAction extends RMActionExecuterAbstractBase
Map<QName, AssociationDefinition> map = recordsManagementAdminService.getCustomReferenceDefinitions(); Map<QName, AssociationDefinition> map = recordsManagementAdminService.getCustomReferenceDefinitions();
for (Map.Entry<QName, AssociationDefinition> entry : map.entrySet()) for (Map.Entry<QName, AssociationDefinition> entry : map.entrySet())
{ {
if (compoundId.equals(entry.getValue().getTitle()) == true) if (compoundId.equals(entry.getValue().getTitle(dictionaryService)) == true)
{ {
relationshipQName = entry.getKey(); relationshipQName = entry.getKey();
break; break;

View File

@@ -818,7 +818,7 @@ public class RecordsManagementAuditServiceImpl
if (nodeTypeQname != null) if (nodeTypeQname != null)
{ {
TypeDefinition typeDef = dictionaryService.getType(nodeTypeQname); TypeDefinition typeDef = dictionaryService.getType(nodeTypeQname);
nodeType = (typeDef != null) ? typeDef.getTitle() : null; nodeType = (typeDef != null) ? typeDef.getTitle(dictionaryService) : null;
} }
} }
else if (values.containsKey(RecordsManagementAuditService.RM_AUDIT_DATA_LOGIN_USERNAME)) else if (values.containsKey(RecordsManagementAuditService.RM_AUDIT_DATA_LOGIN_USERNAME))
@@ -1291,7 +1291,7 @@ public class RecordsManagementAuditServiceImpl
PropertyDefinition propDef = this.dictionaryService.getProperty(property); PropertyDefinition propDef = this.dictionaryService.getProperty(property);
if (propDef != null) if (propDef != null)
{ {
label = propDef.getTitle(); label = propDef.getTitle(dictionaryService);
} }
if (label == null) if (label == null)

View File

@@ -39,7 +39,7 @@ import org.alfresco.service.namespace.QName;
public class RFC822MetadataExtracter extends org.alfresco.repo.content.metadata.RFC822MetadataExtracter public class RFC822MetadataExtracter extends org.alfresco.repo.content.metadata.RFC822MetadataExtracter
{ {
/** Reference to default properties */ /** Reference to default properties */
private static final String PROPERTIES_URL = "org/alfresco/repo/content/metadata/RFC822MetadataExtracter.properties"; private static final String PROPERTIES_URL = "alfresco/metadata/RFC822MetadataExtracter.properties";
/** Node service */ /** Node service */
private NodeService nodeService; private NodeService nodeService;

View File

@@ -32,6 +32,7 @@ import org.alfresco.repo.forms.Form;
import org.alfresco.repo.forms.FormData; import org.alfresco.repo.forms.FormData;
import org.alfresco.repo.forms.processor.AbstractFilter; import org.alfresco.repo.forms.processor.AbstractFilter;
import org.alfresco.repo.forms.processor.node.FieldUtils; import org.alfresco.repo.forms.processor.node.FieldUtils;
import org.alfresco.service.cmr.dictionary.DictionaryService;
import org.alfresco.service.cmr.dictionary.PropertyDefinition; import org.alfresco.service.cmr.dictionary.PropertyDefinition;
import org.alfresco.service.cmr.repository.NodeRef; import org.alfresco.service.cmr.repository.NodeRef;
import org.alfresco.service.cmr.repository.NodeService; import org.alfresco.service.cmr.repository.NodeService;
@@ -60,6 +61,7 @@ public abstract class RecordsManagementFormFilter<ItemType> extends AbstractFilt
protected RecordsManagementService rmService; protected RecordsManagementService rmService;
protected RecordsManagementAdminService rmAdminService; protected RecordsManagementAdminService rmAdminService;
protected RecordService recordService; protected RecordService recordService;
protected DictionaryService dictionaryService;
/** /**
* Sets the NamespaceService instance * Sets the NamespaceService instance
@@ -119,6 +121,14 @@ public abstract class RecordsManagementFormFilter<ItemType> extends AbstractFilt
this.recordService = recordService; this.recordService = recordService;
} }
/**
* @param dictionaryService dictionary service
*/
public void setDictionaryService(DictionaryService dictionaryService)
{
this.dictionaryService = dictionaryService;
}
/** /**
* Add property fields to group * Add property fields to group
* *
@@ -140,7 +150,7 @@ public abstract class RecordsManagementFormFilter<ItemType> extends AbstractFilt
Serializable value = nodeService.getProperty(nodeRef, entry.getKey()); Serializable value = nodeService.getProperty(nodeRef, entry.getKey());
FieldGroup group = new FieldGroup(setId, null, false, false, null); FieldGroup group = new FieldGroup(setId, null, false, false, null);
Field field = FieldUtils.makePropertyField(prop, value, group, namespaceService); Field field = FieldUtils.makePropertyField(prop, value, group, namespaceService, dictionaryService);
form.addField(field); form.addField(field);

View File

@@ -213,7 +213,7 @@ public class RecordsManagementNodeFormFilter extends RecordsManagementFormFilter
if (propDef != null) if (propDef != null)
{ {
Field field = FieldUtils.makePropertyField(propDef, null, null, namespaceService); Field field = FieldUtils.makePropertyField(propDef, null, null, namespaceService, dictionaryService);
form.addField(field); form.addField(field);
} }
else if (logger.isWarnEnabled()) else if (logger.isWarnEnabled())

View File

@@ -129,7 +129,7 @@ public class RecordsManagementTypeFormFilter extends RecordsManagementFormFilter
// setup field definition for each custom property // setup field definition for each custom property
Collection<PropertyDefinition> properties = customProps.values(); Collection<PropertyDefinition> properties = customProps.values();
FieldGroup group = new FieldGroup(CUSTOM_RM_FIELD_GROUP_ID, null, false, false, null); FieldGroup group = new FieldGroup(CUSTOM_RM_FIELD_GROUP_ID, null, false, false, null);
List<Field> fields = FieldUtils.makePropertyFields(properties, group, namespaceService); List<Field> fields = FieldUtils.makePropertyFields(properties, group, namespaceService, dictionaryService);
form.addFields(fields); form.addFields(fields);
} }
} }

View File

@@ -162,7 +162,7 @@ public class JSONConversionComponent extends org.alfresco.repo.jscript.app.JSONC
if (unfiledRecordContainer != null) if (unfiledRecordContainer != null)
{ {
rmNodeValues.put("unfiledRecordContainer", unfiledRecordContainer.toString()); rmNodeValues.put("unfiledRecordContainer", unfiledRecordContainer.toString());
rmNodeValues.put("properties", propertiesToJSON(unfiledRecordContainer, useShortQName)); rmNodeValues.put("properties", propertiesToJSON(unfiledRecordContainer, nodeService.getProperties(unfiledRecordContainer), useShortQName));
QName type = fileFolderService.getFileInfo(unfiledRecordContainer).getType(); QName type = fileFolderService.getFileInfo(unfiledRecordContainer).getType();
rmNodeValues.put("type", useShortQName ? type.toPrefixString(namespaceService) : type.toString()); rmNodeValues.put("type", useShortQName ? type.toPrefixString(namespaceService) : type.toString());
} }

View File

@@ -245,7 +245,7 @@ public class RecordsManagementNotificationHelper implements RecordsManagementMod
notificationContext.setAsyncNotification(false); notificationContext.setAsyncNotification(false);
notificationContext.setIgnoreNotificationFailure(true); notificationContext.setIgnoreNotificationFailure(true);
notificationContext.setBodyTemplate(getDueForReviewTemplate()); notificationContext.setBodyTemplate(getDueForReviewTemplate().toString());
Map<String, Serializable> args = new HashMap<String, Serializable>(1, 1.0f); Map<String, Serializable> args = new HashMap<String, Serializable>(1, 1.0f);
args.put("records", (Serializable)records); args.put("records", (Serializable)records);
args.put("site", getSiteName(root)); args.put("site", getSiteName(root));
@@ -286,7 +286,7 @@ public class RecordsManagementNotificationHelper implements RecordsManagementMod
notificationContext.setAsyncNotification(false); notificationContext.setAsyncNotification(false);
notificationContext.setIgnoreNotificationFailure(true); notificationContext.setIgnoreNotificationFailure(true);
notificationContext.setBodyTemplate(supersededTemplate); notificationContext.setBodyTemplate(supersededTemplate.toString());
Map<String, Serializable> args = new HashMap<String, Serializable>(1, 1.0f); Map<String, Serializable> args = new HashMap<String, Serializable>(1, 1.0f);
args.put("record", record); args.put("record", record);
args.put("site", getSiteName(root)); args.put("site", getSiteName(root));
@@ -337,7 +337,7 @@ public class RecordsManagementNotificationHelper implements RecordsManagementMod
notificationContext.setIgnoreNotificationFailure(true); notificationContext.setIgnoreNotificationFailure(true);
notificationContext.addTo(recordCreator); notificationContext.addTo(recordCreator);
notificationContext.setSubject(I18NUtil.getMessage(MSG_SUBJECT_RECORD_REJECTED)); notificationContext.setSubject(I18NUtil.getMessage(MSG_SUBJECT_RECORD_REJECTED));
notificationContext.setBodyTemplate(getRejectedTemplate()); notificationContext.setBodyTemplate(getRejectedTemplate().toString());
notificationContext.setTemplateArgs(args); notificationContext.setTemplateArgs(args);
notificationService.sendNotification(EMailNotificationProvider.NAME, notificationContext); notificationService.sendNotification(EMailNotificationProvider.NAME, notificationContext);

View File

@@ -29,6 +29,7 @@ import javax.servlet.http.HttpServletResponse;
import org.alfresco.module.org_alfresco_module_rm.RecordsManagementAdminService; import org.alfresco.module.org_alfresco_module_rm.RecordsManagementAdminService;
import org.alfresco.service.cmr.dictionary.AssociationDefinition; import org.alfresco.service.cmr.dictionary.AssociationDefinition;
import org.alfresco.service.cmr.dictionary.ChildAssociationDefinition; import org.alfresco.service.cmr.dictionary.ChildAssociationDefinition;
import org.alfresco.service.cmr.dictionary.DictionaryService;
import org.alfresco.service.namespace.QName; import org.alfresco.service.namespace.QName;
import org.apache.commons.logging.Log; import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory; import org.apache.commons.logging.LogFactory;
@@ -54,12 +55,18 @@ public class CustomReferenceDefinitionsGet extends DeclarativeWebScript
private static Log logger = LogFactory.getLog(CustomReferenceDefinitionsGet.class); private static Log logger = LogFactory.getLog(CustomReferenceDefinitionsGet.class);
private RecordsManagementAdminService rmAdminService; private RecordsManagementAdminService rmAdminService;
private DictionaryService dictionaryService;
public void setRecordsManagementAdminService(RecordsManagementAdminService rmAdminService) public void setRecordsManagementAdminService(RecordsManagementAdminService rmAdminService)
{ {
this.rmAdminService = rmAdminService; this.rmAdminService = rmAdminService;
} }
public void setDictionaryService(DictionaryService dictionaryService)
{
this.dictionaryService = dictionaryService;
}
@Override @Override
public Map<String, Object> executeImpl(WebScriptRequest req, Status status, Cache cache) public Map<String, Object> executeImpl(WebScriptRequest req, Status status, Cache cache)
{ {
@@ -113,7 +120,7 @@ public class CustomReferenceDefinitionsGet extends DeclarativeWebScript
data.put(REFERENCE_TYPE, referenceType.toString()); data.put(REFERENCE_TYPE, referenceType.toString());
// It is the title which stores either the label, or the source and target. // It is the title which stores either the label, or the source and target.
String nextTitle = nextValue.getTitle(); String nextTitle = nextValue.getTitle(dictionaryService);
if (CustomReferenceType.PARENT_CHILD.equals(referenceType)) if (CustomReferenceType.PARENT_CHILD.equals(referenceType))
{ {
if (nextTitle != null) if (nextTitle != null)

View File

@@ -26,6 +26,7 @@ import java.util.Map;
import org.alfresco.model.ContentModel; import org.alfresco.model.ContentModel;
import org.alfresco.module.org_alfresco_module_rm.RecordsManagementAdminService; import org.alfresco.module.org_alfresco_module_rm.RecordsManagementAdminService;
import org.alfresco.service.cmr.dictionary.AssociationDefinition; import org.alfresco.service.cmr.dictionary.AssociationDefinition;
import org.alfresco.service.cmr.dictionary.DictionaryService;
import org.alfresco.service.cmr.repository.AssociationRef; import org.alfresco.service.cmr.repository.AssociationRef;
import org.alfresco.service.cmr.repository.ChildAssociationRef; import org.alfresco.service.cmr.repository.ChildAssociationRef;
import org.alfresco.service.cmr.repository.NodeRef; import org.alfresco.service.cmr.repository.NodeRef;
@@ -59,12 +60,18 @@ public class CustomRefsGet extends AbstractRmWebScript
private static Log logger = LogFactory.getLog(CustomRefsGet.class); private static Log logger = LogFactory.getLog(CustomRefsGet.class);
private RecordsManagementAdminService rmAdminService; private RecordsManagementAdminService rmAdminService;
private DictionaryService dictionaryService;
public void setRecordsManagementAdminService(RecordsManagementAdminService rmAdminService) public void setRecordsManagementAdminService(RecordsManagementAdminService rmAdminService)
{ {
this.rmAdminService = rmAdminService; this.rmAdminService = rmAdminService;
} }
public void setDictionaryService(DictionaryService dictionaryService)
{
this.dictionaryService = dictionaryService;
}
@Override @Override
public Map<String, Object> executeImpl(WebScriptRequest req, Status status, Cache cache) public Map<String, Object> executeImpl(WebScriptRequest req, Status status, Cache cache)
{ {
@@ -132,7 +139,7 @@ public class CustomRefsGet extends AbstractRmWebScript
if (assDef != null) if (assDef != null)
{ {
String compoundTitle = assDef.getTitle(); String compoundTitle = assDef.getTitle(dictionaryService);
data.put(REF_ID, typeQName.getLocalName()); data.put(REF_ID, typeQName.getLocalName());
@@ -166,7 +173,7 @@ public class CustomRefsGet extends AbstractRmWebScript
if (assDef != null) if (assDef != null)
{ {
data.put(LABEL, assDef.getTitle()); data.put(LABEL, assDef.getTitle(dictionaryService));
data.put(REF_ID, typeQName.getLocalName()); data.put(REF_ID, typeQName.getLocalName());
data.put(REFERENCE_TYPE, CustomReferenceType.BIDIRECTIONAL.toString()); data.put(REFERENCE_TYPE, CustomReferenceType.BIDIRECTIONAL.toString());
data.put(SOURCE_REF, assRef.getSourceRef().toString()); data.put(SOURCE_REF, assRef.getSourceRef().toString());

View File

@@ -96,7 +96,7 @@ public class CustomisableGet extends DeclarativeWebScript
if (definition != null) if (definition != null)
{ {
String name = qname.toPrefixString(namespaceService); String name = qname.toPrefixString(namespaceService);
String title = definition.getTitle(); String title = definition.getTitle(dictionaryService);
if (title == null || title.length() == 0) if (title == null || title.length() == 0)
{ {
title = qname.getLocalName(); title = qname.getLocalName();

View File

@@ -26,6 +26,7 @@ import java.util.Map;
import org.alfresco.module.org_alfresco_module_rm.disposition.DispositionService; import org.alfresco.module.org_alfresco_module_rm.disposition.DispositionService;
import org.alfresco.module.org_alfresco_module_rm.disposition.property.DispositionProperty; import org.alfresco.module.org_alfresco_module_rm.disposition.property.DispositionProperty;
import org.alfresco.service.cmr.dictionary.DictionaryService;
import org.alfresco.service.cmr.dictionary.PropertyDefinition; import org.alfresco.service.cmr.dictionary.PropertyDefinition;
import org.alfresco.service.namespace.NamespaceService; import org.alfresco.service.namespace.NamespaceService;
import org.alfresco.service.namespace.QName; import org.alfresco.service.namespace.QName;
@@ -42,6 +43,7 @@ public class DispositionPropertiesGet extends DeclarativeWebScript
{ {
protected DispositionService dispositionService; protected DispositionService dispositionService;
protected NamespaceService namespaceService; protected NamespaceService namespaceService;
protected DictionaryService dictionaryService;
/** /**
* Sets the disposition service * Sets the disposition service
@@ -63,6 +65,16 @@ public class DispositionPropertiesGet extends DeclarativeWebScript
this.namespaceService = namespaceService; this.namespaceService = namespaceService;
} }
/**
* Sets the DictionaryService instance
*
* @param dictionaryService The DictionaryService instance
*/
public void setDictionaryService(DictionaryService dictionaryService)
{
this.dictionaryService = dictionaryService;
}
/* /*
* @see org.alfresco.web.scripts.DeclarativeWebScript#executeImpl(org.alfresco.web.scripts.WebScriptRequest, org.alfresco.web.scripts.Status, org.alfresco.web.scripts.Cache) * @see org.alfresco.web.scripts.DeclarativeWebScript#executeImpl(org.alfresco.web.scripts.WebScriptRequest, org.alfresco.web.scripts.Status, org.alfresco.web.scripts.Cache)
*/ */
@@ -87,7 +99,7 @@ public class DispositionPropertiesGet extends DeclarativeWebScript
if (propDef != null) if (propDef != null)
{ {
Map<String, String> item = new HashMap<String, String>(2); Map<String, String> item = new HashMap<String, String>(2);
String propTitle = propDef.getTitle(); String propTitle = propDef.getTitle(dictionaryService);
if (propTitle == null || propTitle.length() == 0) if (propTitle == null || propTitle.length() == 0)
{ {
propTitle = StringUtils.capitalize(propName.getLocalName()); propTitle = StringUtils.capitalize(propName.getLocalName());

View File

@@ -259,7 +259,7 @@ public class ListOfValuesGet extends DeclarativeWebScript
if (propDef != null) if (propDef != null)
{ {
Map<String, String> item = new HashMap<String, String>(2); Map<String, String> item = new HashMap<String, String>(2);
String propTitle = propDef.getTitle(); String propTitle = propDef.getTitle(ddService);
if (propTitle == null || propTitle.length() == 0) if (propTitle == null || propTitle.length() == 0)
{ {
propTitle = StringUtils.capitalize(propName.getLocalName()); propTitle = StringUtils.capitalize(propName.getLocalName());

View File

@@ -94,7 +94,7 @@ public class RecordMetaDataAspectsGet extends DeclarativeWebScript
if (aspectDefinition != null) if (aspectDefinition != null)
{ {
// Fet the label from the aspect definition // Fet the label from the aspect definition
label = aspectDefinition.getTitle(); label = aspectDefinition.getTitle(dictionaryService);
} }
aspect.put("value", label); aspect.put("value", label);

View File

@@ -105,7 +105,7 @@ public class RMSearchPropertiesGet extends DeclarativeWebScript
} }
AspectDefinition aspectDefinition = dictionaryService.getAspect(aspect); AspectDefinition aspectDefinition = dictionaryService.getAspect(aspect);
Group group = new Group(aspect.getLocalName(), aspectDefinition.getTitle(), propObjs); Group group = new Group(aspect.getLocalName(), aspectDefinition.getTitle(dictionaryService), propObjs);
groups.add(group); groups.add(group);
} }
@@ -167,7 +167,7 @@ public class RMSearchPropertiesGet extends DeclarativeWebScript
QName qName = propertyDefinition.getName().getPrefixedQName(namespaceService); QName qName = propertyDefinition.getName().getPrefixedQName(namespaceService);
this.prefix = QName.splitPrefixedQName(qName.toPrefixString())[0]; this.prefix = QName.splitPrefixedQName(qName.toPrefixString())[0];
this.shortName = qName.getLocalName(); this.shortName = qName.getLocalName();
this.label = propertyDefinition.getTitle(); this.label = propertyDefinition.getTitle(dictionaryService);
this.type = propertyDefinition.getDataType().getName().getLocalName(); this.type = propertyDefinition.getDataType().getName().getLocalName();
} }

View File

@@ -196,7 +196,7 @@ public class RmClassesGet extends DictionaryWebServiceBase implements RecordsMan
} }
List<ClassDefinition> classDefinitions = new ArrayList<ClassDefinition>(classdef.values()); List<ClassDefinition> classDefinitions = new ArrayList<ClassDefinition>(classdef.values());
Collections.sort(classDefinitions, new DictionaryComparators.ClassDefinitionComparator()); Collections.sort(classDefinitions, new DictionaryComparators.ClassDefinitionComparator(dictionaryservice));
model.put(MODEL_PROP_KEY_CLASS_DEFS, classDefinitions); model.put(MODEL_PROP_KEY_CLASS_DEFS, classDefinitions);
model.put(MODEL_PROP_KEY_PROPERTY_DETAILS, propdef.values()); model.put(MODEL_PROP_KEY_PROPERTY_DETAILS, propdef.values());
model.put(MODEL_PROP_KEY_ASSOCIATION_DETAILS, assocdef.values()); model.put(MODEL_PROP_KEY_ASSOCIATION_DETAILS, assocdef.values());

View File

@@ -147,7 +147,7 @@ public class RmPropertiesGet extends DictionaryWebServiceBase implements Records
} }
// Order property definitions by title // Order property definitions by title
Collections.sort(props, new DictionaryComparators.PropertyDefinitionComparator()); Collections.sort(props, new DictionaryComparators.PropertyDefinitionComparator(dictionaryservice));
// Pass list of property definitions to template // Pass list of property definitions to template
Map<String, Object> model = new HashMap<String, Object>(); Map<String, Object> model = new HashMap<String, Object>();

View File

@@ -214,8 +214,8 @@ public class RecordsManagementAdminServiceImplTest extends BaseRMTestCase
PropertyDefinition propDef = propDefs.get(result); PropertyDefinition propDef = propDefs.get(result);
assertNotNull(propDef); assertNotNull(propDef);
assertEquals(DataTypeDefinition.TEXT, propDef.getDataType().getName()); assertEquals(DataTypeDefinition.TEXT, propDef.getDataType().getName());
assertEquals("Description", propDef.getDescription()); assertEquals("Description", propDef.getDescription(dictionaryService));
assertEquals("Label1", propDef.getTitle()); assertEquals("Label1", propDef.getTitle(dictionaryService));
} }
finally finally
{ {
@@ -259,8 +259,8 @@ public class RecordsManagementAdminServiceImplTest extends BaseRMTestCase
PropertyDefinition propDef = propDefs.get(result); PropertyDefinition propDef = propDefs.get(result);
assertNotNull(propDef); assertNotNull(propDef);
assertEquals(DataTypeDefinition.TEXT, propDef.getDataType().getName()); assertEquals(DataTypeDefinition.TEXT, propDef.getDataType().getName());
assertEquals("Description", propDef.getDescription()); assertEquals("Description", propDef.getDescription(dictionaryService));
assertEquals("Label2", propDef.getTitle()); assertEquals("Label2", propDef.getTitle(dictionaryService));
} }
finally finally
{ {
@@ -310,8 +310,8 @@ public class RecordsManagementAdminServiceImplTest extends BaseRMTestCase
PropertyDefinition propDef = propDefs.get(result); PropertyDefinition propDef = propDefs.get(result);
assertNotNull(propDef); assertNotNull(propDef);
assertEquals(DataTypeDefinition.TEXT, propDef.getDataType().getName()); assertEquals(DataTypeDefinition.TEXT, propDef.getDataType().getName());
assertEquals("Description", propDef.getDescription()); assertEquals("Description", propDef.getDescription(dictionaryService));
assertEquals("Label3", propDef.getTitle()); assertEquals("Label3", propDef.getTitle(dictionaryService));
assertEquals("default", propDef.getDefaultValue()); assertEquals("default", propDef.getDefaultValue());
assertFalse(propDef.isMandatory()); assertFalse(propDef.isMandatory());
assertFalse(propDef.isMultiValued()); assertFalse(propDef.isMultiValued());
@@ -411,8 +411,8 @@ public class RecordsManagementAdminServiceImplTest extends BaseRMTestCase
PropertyDefinition propDef = propDefs.get(result); PropertyDefinition propDef = propDefs.get(result);
assertNotNull(propDef); assertNotNull(propDef);
assertEquals(DataTypeDefinition.TEXT, propDef.getDataType().getName()); assertEquals(DataTypeDefinition.TEXT, propDef.getDataType().getName());
assertEquals("Description", propDef.getDescription()); assertEquals("Description", propDef.getDescription(dictionaryService));
assertEquals("Label", propDef.getTitle()); assertEquals("Label", propDef.getTitle(dictionaryService));
} }
}); });
@@ -456,8 +456,8 @@ public class RecordsManagementAdminServiceImplTest extends BaseRMTestCase
PropertyDefinition propDef = propDefs.get(result); PropertyDefinition propDef = propDefs.get(result);
assertNotNull(propDef); assertNotNull(propDef);
assertEquals(DataTypeDefinition.TEXT, propDef.getDataType().getName()); assertEquals(DataTypeDefinition.TEXT, propDef.getDataType().getName());
assertEquals("Description", propDef.getDescription()); assertEquals("Description", propDef.getDescription(dictionaryService));
assertEquals("Label", propDef.getTitle()); assertEquals("Label", propDef.getTitle(dictionaryService));
} }
}); });
} }
@@ -679,7 +679,7 @@ public class RecordsManagementAdminServiceImplTest extends BaseRMTestCase
{ {
System.out.println(" - " + prop.toString()); System.out.println(" - " + prop.toString());
String propId = props.get(prop).getTitle(); String propId = props.get(prop).getTitle(dictionaryService);
assertNotNull("null client-id for " + prop, propId); assertNotNull("null client-id for " + prop, propId);
System.out.println(" " + propId); System.out.println(" " + propId);
@@ -701,7 +701,7 @@ public class RecordsManagementAdminServiceImplTest extends BaseRMTestCase
for (QName reference : references.keySet()) for (QName reference : references.keySet())
{ {
System.out.println(" - " + reference.toString()); System.out.println(" - " + reference.toString());
System.out.println(" " + references.get(reference).getTitle()); System.out.println(" " + references.get(reference).getTitle(dictionaryService));
} }
return null; return null;
} }
@@ -720,7 +720,7 @@ public class RecordsManagementAdminServiceImplTest extends BaseRMTestCase
for (ConstraintDefinition constraint : constraints) for (ConstraintDefinition constraint : constraints)
{ {
System.out.println(" - " + constraint.getName()); System.out.println(" - " + constraint.getName());
System.out.println(" " + constraint.getTitle()); System.out.println(" " + constraint.getTitle(dictionaryService));
} }
return null; return null;
} }
@@ -842,7 +842,7 @@ public class RecordsManagementAdminServiceImplTest extends BaseRMTestCase
{ {
if (conDef.getName().equals(testCon)) if (conDef.getName().equals(testCon))
{ {
assertEquals(conTitle, conDef.getTitle()); assertEquals(conTitle, conDef.getTitle(dictionaryService));
Constraint con = conDef.getConstraint(); Constraint con = conDef.getConstraint();
assertTrue(con instanceof RMListOfValuesConstraint); assertTrue(con instanceof RMListOfValuesConstraint);
@@ -891,7 +891,7 @@ public class RecordsManagementAdminServiceImplTest extends BaseRMTestCase
{ {
if (conDef.getName().equals(testCon)) if (conDef.getName().equals(testCon))
{ {
assertEquals(conTitle, conDef.getTitle()); assertEquals(conTitle, conDef.getTitle(dictionaryService));
Constraint con = conDef.getConstraint(); Constraint con = conDef.getConstraint();
assertTrue(con instanceof RMListOfValuesConstraint); assertTrue(con instanceof RMListOfValuesConstraint);