RM-550 (JS Error while declaring a record)

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/modules/recordsmanagement/BRANCHES/V2.0-BUG-FIX@43661 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Tuna Aksoy
2012-11-16 15:05:06 +00:00
parent 08cc495c65
commit d4a6a842ba
2 changed files with 325 additions and 341 deletions

View File

@@ -29,6 +29,7 @@ import java.util.Set;
import org.alfresco.error.AlfrescoRuntimeException;
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.service.cmr.action.Action;
import org.alfresco.service.cmr.dictionary.AspectDefinition;
@@ -56,8 +57,7 @@ public class DeclareRecordAction extends RMActionExecuterAbstractBase
private static Log logger = LogFactory.getLog(DeclareRecordAction.class);
/**
* @see org.alfresco.repo.action.executer.ActionExecuterAbstractBase#executeImpl(org.alfresco.service.cmr.action.Action,
* org.alfresco.service.cmr.repository.NodeRef)
* @see org.alfresco.repo.action.executer.ActionExecuterAbstractBase#executeImpl(org.alfresco.service.cmr.action.Action, org.alfresco.service.cmr.repository.NodeRef)
*/
@Override
protected void executeImpl(Action action, NodeRef actionedUponNodeRef)
@@ -81,7 +81,8 @@ public class DeclareRecordAction extends RMActionExecuterAbstractBase
}
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
*
* @param nodeRef
* node reference
* @param nodeRef node reference
* @return boolean true if all mandatory properties are set, false otherwise
*/
private boolean mandatoryPropertiesSet(NodeRef nodeRef, List<String> missingProperties)
@@ -203,23 +203,9 @@ public class DeclareRecordAction extends RMActionExecuterAbstractBase
{
return true;
}
else
{
if (throwException)
{
throw new AlfrescoRuntimeException(buildMissingPropertiesErrorString(missingProperties));
}
else
{
return false;
}
}
}
else
{
return false;
}
}
else
{
if (throwException)

View File

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