AnsweredAssumed Answered

ServiceRegistry

Question asked by sarag on Jun 8, 2006
Latest reply on Jun 13, 2006 by davidc
Hi!

On this code to get a NodeRef from a node-uuid:

public static NodeRef getNodeByUUID(ServiceRegistry serviceRegistry, StoreRef storeRef, String uuId) throws Exception{ 
       
       SearchService searchService = serviceRegistry.getSearchService();
        String searchString = "@sys\\:node-uuid:\"" + uuId + "\"";
         ResultSet rs = searchService.query(storeRef,SearchService.LANGUAGE_LUCENE, searchString );
        if (rs==null){
           return(null);
        }
        int nbRecords = rs.length();
        NodeRef nodeRef;
        if (nbRecords < 1) {
           nodeRef=null;
        }
        else nodeRef = rs.getNodeRef(0);
        rs.close();
        return(nodeRef);
    }

Where can I get the ServiceRegistry?

Thanks on advance

Outcomes