Merged V2.0-BUG-FIX to V2.0 :

43623: RM-541 (Error shown in firebug when the details page of a record is open)
   43661: RM-550 (JS Error while declaring a record)



git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/modules/recordsmanagement/BRANCHES/V2.0@43714 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Roy Wetherall
2012-11-20 05:26:10 +00:00
4 changed files with 367 additions and 377 deletions

View File

@@ -2,6 +2,10 @@
{ {
"data": "data":
{ {
<#if nextaction.notFound?? && nextaction.notFound>
"notFound": ${nextaction.notFound?string},
"message": "${nextaction.message}"
<#else>
"url": "${nextaction.url}", "url": "${nextaction.url}",
"name": "${nextaction.name}", "name": "${nextaction.name}",
"label": "${nextaction.label}", "label": "${nextaction.label}",
@@ -30,6 +34,7 @@
}<#if event_has_next>,</#if> }<#if event_has_next>,</#if>
</#list> </#list>
] ]
</#if>
} }
} }
</#escape> </#escape>

View File

@@ -29,6 +29,7 @@ import java.util.Set;
import org.alfresco.error.AlfrescoRuntimeException; import org.alfresco.error.AlfrescoRuntimeException;
import org.alfresco.module.org_alfresco_module_rm.action.RMActionExecuterAbstractBase; import org.alfresco.module.org_alfresco_module_rm.action.RMActionExecuterAbstractBase;
import org.alfresco.repo.action.executer.ActionExecuterAbstractBase;
import org.alfresco.repo.security.authentication.AuthenticationUtil; import org.alfresco.repo.security.authentication.AuthenticationUtil;
import org.alfresco.service.cmr.action.Action; import org.alfresco.service.cmr.action.Action;
import org.alfresco.service.cmr.dictionary.AspectDefinition; import org.alfresco.service.cmr.dictionary.AspectDefinition;
@@ -56,8 +57,7 @@ public class DeclareRecordAction extends RMActionExecuterAbstractBase
private static Log logger = LogFactory.getLog(DeclareRecordAction.class); private static Log logger = LogFactory.getLog(DeclareRecordAction.class);
/** /**
* @see org.alfresco.repo.action.executer.ActionExecuterAbstractBase#executeImpl(org.alfresco.service.cmr.action.Action, * @see org.alfresco.repo.action.executer.ActionExecuterAbstractBase#executeImpl(org.alfresco.service.cmr.action.Action, org.alfresco.service.cmr.repository.NodeRef)
* org.alfresco.service.cmr.repository.NodeRef)
*/ */
@Override @Override
protected void executeImpl(Action action, NodeRef actionedUponNodeRef) protected void executeImpl(Action action, NodeRef actionedUponNodeRef)
@@ -81,7 +81,8 @@ public class DeclareRecordAction extends RMActionExecuterAbstractBase
} }
else else
{ {
throw new AlfrescoRuntimeException(buildMissingPropertiesErrorString(missingProperties)); logger.debug(buildMissingPropertiesErrorString(missingProperties));
action.setParameterValue(ActionExecuterAbstractBase.PARAM_RESULT, "missingProperties");
} }
} }
} }
@@ -107,8 +108,7 @@ public class DeclareRecordAction extends RMActionExecuterAbstractBase
/** /**
* Helper method to check whether all the mandatory properties of the node have been set * Helper method to check whether all the mandatory properties of the node have been set
* *
* @param nodeRef * @param nodeRef node reference
* node reference
* @return boolean true if all mandatory properties are set, false otherwise * @return boolean true if all mandatory properties are set, false otherwise
*/ */
private boolean mandatoryPropertiesSet(NodeRef nodeRef, List<String> missingProperties) private boolean mandatoryPropertiesSet(NodeRef nodeRef, List<String> missingProperties)
@@ -203,23 +203,9 @@ public class DeclareRecordAction extends RMActionExecuterAbstractBase
{ {
return true; return true;
} }
else
{
if (throwException)
{
throw new AlfrescoRuntimeException(buildMissingPropertiesErrorString(missingProperties));
} }
else
{
return false; return false;
} }
}
}
else
{
return false;
}
}
else else
{ {
if (throwException) if (throwException)

View File

@@ -23,8 +23,6 @@ import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import javax.servlet.http.HttpServletResponse;
import org.alfresco.model.ContentModel; import org.alfresco.model.ContentModel;
import org.alfresco.module.org_alfresco_module_rm.disposition.DispositionAction; import org.alfresco.module.org_alfresco_module_rm.disposition.DispositionAction;
import org.alfresco.module.org_alfresco_module_rm.event.EventCompletionDetails; import org.alfresco.module.org_alfresco_module_rm.event.EventCompletionDetails;
@@ -68,9 +66,12 @@ public class DispositionLifecycleGet extends DispositionAbstractBase
DispositionAction nextAction = this.dispositionService.getNextDispositionAction(nodeRef); DispositionAction nextAction = this.dispositionService.getNextDispositionAction(nodeRef);
if (nextAction == null) if (nextAction == null)
{ {
status.setCode(HttpServletResponse.SC_NOT_FOUND, Map<String, Object> nextActionModel = new HashMap<String, Object>(2);
"Node " + nodeRef.toString() + " does not have a disposition lifecycle"); nextActionModel.put("notFound", true);
return null; nextActionModel.put("message", "Node " + nodeRef.toString() + " does not have a disposition lifecycle");
Map<String, Object> model = new HashMap<String, Object>(1);
model.put("nextaction", nextActionModel);
return model;
} }
else else
{ {

View File

@@ -86,7 +86,7 @@ public class RmActionPost extends DeclarativeWebScript
} }
String actionName = null; String actionName = null;
List<NodeRef> targetNodeRefs = null; List<NodeRef> targetNodeRefs = new ArrayList<NodeRef>(1);
Map<String, Serializable> actionParams = new HashMap<String, Serializable>(3); Map<String, Serializable> actionParams = new HashMap<String, Serializable>(3);
try try
@@ -103,7 +103,6 @@ public class RmActionPost extends DeclarativeWebScript
if (jsonObj.has(PARAM_NODE_REF) == true) if (jsonObj.has(PARAM_NODE_REF) == true)
{ {
NodeRef nodeRef = new NodeRef(jsonObj.getString(PARAM_NODE_REF)); NodeRef nodeRef = new NodeRef(jsonObj.getString(PARAM_NODE_REF));
targetNodeRefs = new ArrayList<NodeRef>(1);
targetNodeRefs.add(nodeRef); targetNodeRefs.add(nodeRef);
} }
if (jsonObj.has(PARAM_NODE_REFS) == true) if (jsonObj.has(PARAM_NODE_REFS) == true)
@@ -124,10 +123,9 @@ public class RmActionPost extends DeclarativeWebScript
if (jsonObj.has(PARAM_PARAMS)) if (jsonObj.has(PARAM_PARAMS))
{ {
JSONObject paramsObj = jsonObj.getJSONObject(PARAM_PARAMS); JSONObject paramsObj = jsonObj.getJSONObject(PARAM_PARAMS);
for (Iterator iter = paramsObj.keys(); iter.hasNext(); ) for (Iterator<String> iter = paramsObj.keys(); iter.hasNext(); )
{ {
Object nextKey = iter.next(); String nextKeyString = iter.next();
String nextKeyString = (String)nextKey;
Object nextValue = paramsObj.get(nextKeyString); Object nextValue = paramsObj.get(nextKeyString);
// Check for date values // Check for date values