. Checkpoint for the Rhino JavaScript engine integration:

- Additions to the Alfresco JavaScript data-model
. JUnit test for each entry point into Rhino and the ScriptService
  - tests for various API calls on the Scriptable Node object
. More javadoc clean-up in templating and script services

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@2726 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Kevin Roast
2006-04-28 10:56:48 +00:00
parent fff0a5d49c
commit 2b251c922b
8 changed files with 422 additions and 76 deletions

View File

@@ -450,27 +450,30 @@ public final class QName implements QNamePattern, Serializable, Cloneable
throw new IllegalArgumentException("str parameter is mandatory");
}
if (str.charAt(0) != NAMESPACE_BEGIN && str.indexOf(NAMESPACE_PREFIX) != -1)
if (str.charAt(0) != NAMESPACE_BEGIN)
{
// get the prefix and resolve to the uri
int end = str.indexOf(NAMESPACE_PREFIX);
String prefix = str.substring(0, end);
String localName = str.substring(end + 1);
String uri = prefixResolver.getNamespaceURI(prefix);
if (uri != null)
if (str.indexOf(NAMESPACE_PREFIX) != -1)
{
result = new StringBuilder(64).append(NAMESPACE_BEGIN).append(uri).append(NAMESPACE_END).append(
localName).toString();
// get the prefix and resolve to the uri
int end = str.indexOf(NAMESPACE_PREFIX);
String prefix = str.substring(0, end);
String localName = str.substring(end + 1);
String uri = prefixResolver.getNamespaceURI(prefix);
if (uri != null)
{
result = new StringBuilder(64).append(NAMESPACE_BEGIN).append(uri).append(NAMESPACE_END)
.append(localName).toString();
}
}
else
{
// there's no namespace so prefix with Alfresco's Content Model
result = new StringBuilder(64).append(NAMESPACE_BEGIN).append(NamespaceService.CONTENT_MODEL_1_0_URI)
.append(NAMESPACE_END).append(str).toString();
}
}
else if (str.charAt(0) != NAMESPACE_BEGIN)
{
// there's no namespace so prefix with Alfresco's Content Model
result = new StringBuilder(64).append(NAMESPACE_BEGIN).append(NamespaceService.CONTENT_MODEL_1_0_URI)
.append(NAMESPACE_END).append(str).toString();
}
return result;
}
}