mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-31 17:39:05 +00:00
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:
@@ -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)
|
||||||
|
@@ -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
|
||||||
|
Reference in New Issue
Block a user