Fix the path being set on the Reference objects as it wasn't a valid XPath. Added some unit tests to clear up AR-1186.

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@4993 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Roy Wetherall
2007-02-01 11:19:20 +00:00
parent fccfa9fc65
commit fd6e9643b9
9 changed files with 38 additions and 37 deletions

View File

@@ -309,7 +309,7 @@ public class Utils
* The node to create a Reference for
* @return The Reference
*/
public static Reference convertToReference(NodeService nodeService, NodeRef node)
public static Reference convertToReference(NodeService nodeService, NamespaceService namespaceService, NodeRef node)
{
Reference ref = new Reference();
Store store = new Store(node.getStoreRef().getProtocol(), node.getStoreRef().getIdentifier());
@@ -322,11 +322,11 @@ public class Utils
{
if (logger.isDebugEnabled())
{
logger.debug("setting path for reference to: " + nodeService.getPath(node).toString());
logger.debug("setting path for reference to: " + nodeService.getPath(node).toPrefixString(namespaceService));
}
// so clients can get the path too
ref.setPath(nodeService.getPath(node).toString());
ref.setPath(nodeService.getPath(node).toPrefixString(namespaceService));
}
return ref;
@@ -560,12 +560,13 @@ public class Utils
*/
public static Version convertToVersion(
NodeService nodeService,
NamespaceService namespaceService,
org.alfresco.service.cmr.version.Version version)
{
Version webServiceVersion = new Version();
// Set the basic properties
webServiceVersion.setId(Utils.convertToReference(nodeService, version
webServiceVersion.setId(Utils.convertToReference(nodeService, namespaceService, version
.getFrozenStateNodeRef()));
webServiceVersion.setCreator(version.getCreator());
webServiceVersion.setLabel(version.getVersionLabel());