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 */ /** NodeRef pattern */
private static final Pattern nodeRefPattern = Pattern.compile(".+://.+/.+"); private static final Pattern nodeRefPattern = Pattern.compile(".+://.+/.+");
/** QName pattern */
private static final Pattern qnamePattern = Pattern.compile(".+:[^=,]+");
/** Records management service */ /** Records management service */
private RecordsManagementService rmService; private RecordsManagementService rmService;
@@ -103,14 +106,18 @@ public class RMMetaDataGet extends DeclarativeWebScript
if (nodeRef == null || nodeRef.length() == 0) if (nodeRef == null || nodeRef.length() == 0)
{ {
String type = req.getParameter(PARAM_TYPE); String type = req.getParameter(PARAM_TYPE);
if (type != null && type.length() != 0) if (type != null && type.length() != 0 && type.indexOf(':') != -1)
{ {
QName qname = QName.createQName(type, namespaceService); Matcher m = qnamePattern.matcher(type);
FilePlanComponentKind kind = rmService.getFilePlanComponentKindFromType(qname); if (m.matches() == true)
if (kind != null) {
{ QName qname = QName.createQName(type, namespaceService);
result = kind.toString(); FilePlanComponentKind kind = rmService.getFilePlanComponentKindFromType(qname);
} if (kind != null)
{
result = kind.toString();
}
}
} }
} }
else else