. JavaScript API improvements

. Template API improvements
. Fixed a couple more UTF-8 code file warnings when compiling the source

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@3473 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Kevin Roast
2006-08-09 12:51:42 +00:00
parent e7e4efb6c0
commit d24a815b79
8 changed files with 183 additions and 42 deletions

View File

@@ -80,6 +80,40 @@ public final class Search implements Scopeable
this.scope = scope;
}
/**
* Find a single Node by the Node reference
*
* @param ref The NodeRef of the Node to find
*
* @return the Node if found or null if failed to find
*/
public Node findNode(NodeRef ref)
{
return findNode(ref.toString());
}
/**
* Find a single Node by the Node reference
*
* @param ref The fully qualified NodeRef in String format
*
* @return the Node if found or null if failed to find
*/
public Node findNode(String ref)
{
String query = ref.replace(":", "\\:");
query = query.replace("/", "\\/");
Node[] result = query("ID:" + query);
if (result.length == 1)
{
return result[0];
}
else
{
return null;
}
}
/**
* Execute a Lucene search
*