mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-24 17:32:48 +00:00
. 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:
@@ -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
|
||||
*
|
||||
|
Reference in New Issue
Block a user