10-29-2009 11:56 AM
Query query = new Query(Constants.QUERY_LANG_LUCENE,
"+PARENT:\"workspace://SpacesStore/"+ nodes[0].getReference().getUuid() + "\" +TEXT:\"" + searchValue + "\"");
// Execute the query
QueryResult queryResult = repositoryService.query(STORE, query, false);
// Display the results
ResultSet resultSet = queryResult.getResultSet();
ResultSetRow[] rows = resultSet.getRows();
if (rows != null)
{
// Get the infomation from the result set
for(ResultSetRow row : rows)
{
String nodeId = row.getNode().getId();
ContentResult contentResult = new ContentResult(nodeId);
ResultSetRowNode node = row.getNode();
Reference ref1 = new Reference(STORE, node.getId(), null);
Query query2 = null;
Node[] noderesult = null;
noderesult = WebServiceFactory.getRepositoryService().get(new Predicate(new Reference[] { ref1 }, STORE, query2));
//Recorremos cada nodo-hijo devuelto, normalmente 1.
for (int x1 = 0; x1 < noderesult.length; x1++) {
Node row1 = noderesult[x1];
//Recorremos las Propiedades
for (NamedValue namedValue : row1.getProperties())
…
SearchParameters sp = new SearchParameters();
sp.addStore(getStoreRef());
sp.setLanguage(SearchService.LANGUAGE_LUCENE);
sp.setQuery("TYPE:\"{http://www.alfresco.org/model/content/1.0}content\"");
results = serviceRegistry.getSearchService().query(sp);
for(ResultSetRow row : results){
NodeRef currentNodeRef = row.getNodeRef();
…
}
11-09-2009 06:39 AM
………….
………….
Query query = new Query(Constants.QUERY_LANG_LUCENE, "PATH:\"/app:company_home/cm:my_folder//*\" + @cm\\:name:plantilla*");
// Execute the query
final Store STORE = new Store(Constants.WORKSPACE_STORE, "SpacesStore");
QueryResult queryResult = repositoryService.query(STORE, query, false);
// Display the results
ResultSet results = queryResult.getResultSet();
ResultSetRow[] rows = results.getRows();
System.out.println("La busqueda da algo asi:");
if(rows != null){
for(ResultSetRow row : rows){
for (NamedValue namedValue : row.getColumns()){
if (namedValue.getName().endsWith("path") == true)
System.out.println(namedValue.getValue());
if (namedValue.getName().endsWith(Constants.PROP_CREATED) == true)
System.out.println(namedValue.getValue());
else if (namedValue.getName().endsWith(Constants.PROP_NAME) == true){
System.out.println(namedValue.getValue());
else if (namedValue.getName().endsWith(Constants.PROP_DESCRIPTION) == true){
System.out.println(namedValue.getValue());
………….
………….
………….
}
11-18-2009 07:44 AM
Tags
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.