Sample java webscript for search
public class SampleWebscrip extends DeclarativeWebScript
{
private NodeService nodeService;
private NamespaceService namespaceService;
private SearchService searchService;
private FileFolderService fileFolderService;
protected Map<String, Object> executeImpl(WebScriptRequest req, Status status, Cache cache)
{
String luceneRequest = "ASPECT:\"cm:testAspect\"";
ResultSet rs = null;
try {
logger.debug("Query for existing cm:referencing.");
rs = searchService.query(StoreRef.STORE_REF_WORKSPACE_SPACESSTORE, SearchService.LANGUAGE_FTS_ALFRESCO, luceneRequest);
logger.debug("Processing query results");
for (ResultSetRow r : rs) {
NodeRef nRef = null;
try
{
nRef = r.getNodeRef();
String nodenamespace = nodeService.getType(nRef).getNamespaceURI();
}
Map<String, Object> model = new HashMap<String, Object>();
model.put("success", “anymessage”);
return model;
}
}
Comments
Post a Comment