RM-492: RMMetaDataGet: Namespace prefix Alfresco is not mapped to a namespace URI

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/modules/recordsmanagement/BRANCHES/V2.0-BUG-FIX@41263 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Roy Wetherall
2012-09-05 06:05:09 +00:00
parent 76ef6c3f33
commit b3a55b168e

View File

@@ -53,6 +53,9 @@ public class RMMetaDataGet extends DeclarativeWebScript
/** NodeRef pattern */
private static final Pattern nodeRefPattern = Pattern.compile(".+://.+/.+");
/** QName pattern */
private static final Pattern qnamePattern = Pattern.compile(".+:[^=,]+");
/** Records management service */
private RecordsManagementService rmService;
@@ -103,7 +106,10 @@ public class RMMetaDataGet extends DeclarativeWebScript
if (nodeRef == null || nodeRef.length() == 0)
{
String type = req.getParameter(PARAM_TYPE);
if (type != null && type.length() != 0)
if (type != null && type.length() != 0 && type.indexOf(':') != -1)
{
Matcher m = qnamePattern.matcher(type);
if (m.matches() == true)
{
QName qname = QName.createQName(type, namespaceService);
FilePlanComponentKind kind = rmService.getFilePlanComponentKindFromType(qname);
@@ -113,6 +119,7 @@ public class RMMetaDataGet extends DeclarativeWebScript
}
}
}
}
else
{
// quick test before running slow match for full NodeRef pattern