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 049869a6c1
commit 54b89a0973
23 changed files with 833 additions and 792 deletions

View File

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

View File

@@ -8,4 +8,4 @@ module.title=Records Management
module.description=Alfresco Record Management Extension
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="tenantService" ref="tenantService"/>
<property name="nodeDAO" ref="nodeDAO"/>
<property name="nodeService" ref="nodeService"/>
<property name="qnameDAO" ref="qnameDAO"/>
<property name="localeDAO" ref="localeDAO"/>
<property name="contentDataDAO" ref="contentDataDAO"/>

View File

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

View File

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

View File

@@ -84,7 +84,7 @@ public class SplitEmailAction extends RMActionExecuterAbstractBase
Map<QName, AssociationDefinition> map = recordsManagementAdminService.getCustomReferenceDefinitions();
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();
break;

View File

@@ -818,7 +818,7 @@ public class RecordsManagementAuditServiceImpl
if (nodeTypeQname != null)
{
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))
@@ -1291,7 +1291,7 @@ public class RecordsManagementAuditServiceImpl
PropertyDefinition propDef = this.dictionaryService.getProperty(property);
if (propDef != null)
{
label = propDef.getTitle();
label = propDef.getTitle(dictionaryService);
}
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
{
/** 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 */
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.processor.AbstractFilter;
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.repository.NodeRef;
import org.alfresco.service.cmr.repository.NodeService;
@@ -60,6 +61,7 @@ public abstract class RecordsManagementFormFilter<ItemType> extends AbstractFilt
protected RecordsManagementService rmService;
protected RecordsManagementAdminService rmAdminService;
protected RecordService recordService;
protected DictionaryService dictionaryService;
/**
* Sets the NamespaceService instance
@@ -119,6 +121,14 @@ public abstract class RecordsManagementFormFilter<ItemType> extends AbstractFilt
this.recordService = recordService;
}
/**
* @param dictionaryService dictionary service
*/
public void setDictionaryService(DictionaryService dictionaryService)
{
this.dictionaryService = dictionaryService;
}
/**
* Add property fields to group
*
@@ -140,7 +150,7 @@ public abstract class RecordsManagementFormFilter<ItemType> extends AbstractFilt
Serializable value = nodeService.getProperty(nodeRef, entry.getKey());
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);

View File

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

View File

@@ -129,7 +129,7 @@ public class RecordsManagementTypeFormFilter extends RecordsManagementFormFilter
// setup field definition for each custom property
Collection<PropertyDefinition> properties = customProps.values();
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);
}
}

View File

@@ -162,7 +162,7 @@ public class JSONConversionComponent extends org.alfresco.repo.jscript.app.JSONC
if (unfiledRecordContainer != null)
{
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();
rmNodeValues.put("type", useShortQName ? type.toPrefixString(namespaceService) : type.toString());
}

View File

@@ -245,7 +245,7 @@ public class RecordsManagementNotificationHelper implements RecordsManagementMod
notificationContext.setAsyncNotification(false);
notificationContext.setIgnoreNotificationFailure(true);
notificationContext.setBodyTemplate(getDueForReviewTemplate());
notificationContext.setBodyTemplate(getDueForReviewTemplate().toString());
Map<String, Serializable> args = new HashMap<String, Serializable>(1, 1.0f);
args.put("records", (Serializable)records);
args.put("site", getSiteName(root));
@@ -286,7 +286,7 @@ public class RecordsManagementNotificationHelper implements RecordsManagementMod
notificationContext.setAsyncNotification(false);
notificationContext.setIgnoreNotificationFailure(true);
notificationContext.setBodyTemplate(supersededTemplate);
notificationContext.setBodyTemplate(supersededTemplate.toString());
Map<String, Serializable> args = new HashMap<String, Serializable>(1, 1.0f);
args.put("record", record);
args.put("site", getSiteName(root));
@@ -337,7 +337,7 @@ public class RecordsManagementNotificationHelper implements RecordsManagementMod
notificationContext.setIgnoreNotificationFailure(true);
notificationContext.addTo(recordCreator);
notificationContext.setSubject(I18NUtil.getMessage(MSG_SUBJECT_RECORD_REJECTED));
notificationContext.setBodyTemplate(getRejectedTemplate());
notificationContext.setBodyTemplate(getRejectedTemplate().toString());
notificationContext.setTemplateArgs(args);
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.service.cmr.dictionary.AssociationDefinition;
import org.alfresco.service.cmr.dictionary.ChildAssociationDefinition;
import org.alfresco.service.cmr.dictionary.DictionaryService;
import org.alfresco.service.namespace.QName;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@@ -54,12 +55,18 @@ public class CustomReferenceDefinitionsGet extends DeclarativeWebScript
private static Log logger = LogFactory.getLog(CustomReferenceDefinitionsGet.class);
private RecordsManagementAdminService rmAdminService;
private DictionaryService dictionaryService;
public void setRecordsManagementAdminService(RecordsManagementAdminService rmAdminService)
{
this.rmAdminService = rmAdminService;
}
public void setDictionaryService(DictionaryService dictionaryService)
{
this.dictionaryService = dictionaryService;
}
@Override
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());
// 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 (nextTitle != null)

View File

@@ -26,6 +26,7 @@ import java.util.Map;
import org.alfresco.model.ContentModel;
import org.alfresco.module.org_alfresco_module_rm.RecordsManagementAdminService;
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.ChildAssociationRef;
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 RecordsManagementAdminService rmAdminService;
private DictionaryService dictionaryService;
public void setRecordsManagementAdminService(RecordsManagementAdminService rmAdminService)
{
this.rmAdminService = rmAdminService;
}
public void setDictionaryService(DictionaryService dictionaryService)
{
this.dictionaryService = dictionaryService;
}
@Override
public Map<String, Object> executeImpl(WebScriptRequest req, Status status, Cache cache)
{
@@ -132,7 +139,7 @@ public class CustomRefsGet extends AbstractRmWebScript
if (assDef != null)
{
String compoundTitle = assDef.getTitle();
String compoundTitle = assDef.getTitle(dictionaryService);
data.put(REF_ID, typeQName.getLocalName());
@@ -166,7 +173,7 @@ public class CustomRefsGet extends AbstractRmWebScript
if (assDef != null)
{
data.put(LABEL, assDef.getTitle());
data.put(LABEL, assDef.getTitle(dictionaryService));
data.put(REF_ID, typeQName.getLocalName());
data.put(REFERENCE_TYPE, CustomReferenceType.BIDIRECTIONAL.toString());
data.put(SOURCE_REF, assRef.getSourceRef().toString());

View File

@@ -96,7 +96,7 @@ public class CustomisableGet extends DeclarativeWebScript
if (definition != null)
{
String name = qname.toPrefixString(namespaceService);
String title = definition.getTitle();
String title = definition.getTitle(dictionaryService);
if (title == null || title.length() == 0)
{
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.property.DispositionProperty;
import org.alfresco.service.cmr.dictionary.DictionaryService;
import org.alfresco.service.cmr.dictionary.PropertyDefinition;
import org.alfresco.service.namespace.NamespaceService;
import org.alfresco.service.namespace.QName;
@@ -42,6 +43,7 @@ public class DispositionPropertiesGet extends DeclarativeWebScript
{
protected DispositionService dispositionService;
protected NamespaceService namespaceService;
protected DictionaryService dictionaryService;
/**
* Sets the disposition service
@@ -63,6 +65,16 @@ public class DispositionPropertiesGet extends DeclarativeWebScript
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)
*/
@@ -87,7 +99,7 @@ public class DispositionPropertiesGet extends DeclarativeWebScript
if (propDef != null)
{
Map<String, String> item = new HashMap<String, String>(2);
String propTitle = propDef.getTitle();
String propTitle = propDef.getTitle(dictionaryService);
if (propTitle == null || propTitle.length() == 0)
{
propTitle = StringUtils.capitalize(propName.getLocalName());

View File

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

View File

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

View File

@@ -105,7 +105,7 @@ public class RMSearchPropertiesGet extends DeclarativeWebScript
}
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);
}
@@ -167,7 +167,7 @@ public class RMSearchPropertiesGet extends DeclarativeWebScript
QName qName = propertyDefinition.getName().getPrefixedQName(namespaceService);
this.prefix = QName.splitPrefixedQName(qName.toPrefixString())[0];
this.shortName = qName.getLocalName();
this.label = propertyDefinition.getTitle();
this.label = propertyDefinition.getTitle(dictionaryService);
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());
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_PROPERTY_DETAILS, propdef.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
Collections.sort(props, new DictionaryComparators.PropertyDefinitionComparator());
Collections.sort(props, new DictionaryComparators.PropertyDefinitionComparator(dictionaryservice));
// Pass list of property definitions to template
Map<String, Object> model = new HashMap<String, Object>();

View File

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