How to get the name of a category?

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-18-2006 08:07 AM
Hi
I need to get the name of a category of a Node.
By this way: (where row is a ResultSetRow)
I get the reference to Category Node:
But…How can get the name?
Thank!
I need to get the name of a category of a Node.
By this way: (where row is a ResultSetRow)
row.getColumns(y).getValue()
I get the reference to Category Node:
workspace://SpacesStore/9472c578-c478-11da-8be5-db2bb273e6f3
But…How can get the name?
Thank!
Labels:
- Labels:
-
Archive
4 REPLIES 4

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-19-2006 05:13 AM
I try by other way..but i cant do it:
Where predicate is:
And Row is a ResultSetRow…
But in this code i received an error:
Any ideas?
CategoriesResult[] categorias = null;categorias = WebServiceFactory.getClassificationService().getCategories(predicate);
Where predicate is:
Reference reference = new Reference(STORE, row.getNode().getId(), null);Predicate predicate = new Predicate(new Reference[]{reference}, null, null);
And Row is a ResultSetRow…
But in this code i received an error:
Type mismatch: cannot convert from CategoriesResult[] to CategoriesResult[]
Any ideas?

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-19-2006 05:18 AM
hi
you can retrieve the name of a node by :
you can retrieve the name of a node by :
Repository.getNameForNode(nodeService,nodeRef)

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-19-2006 05:42 AM
Ok But i want make this by an Web Services.

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-20-2006 12:22 PM
I solved the problem by this way:
1?) I have some ID's of any Categories (String)
I want get the name of theses categories so…
2?) i created a method that build a query, this query return all Categories (Nodes) that the uid is equals to ID:
1?) I have some ID's of any Categories (String)
I want get the name of theses categories so…
2?) i created a method that build a query, this query return all Categories (Nodes) that the uid is equals to ID:
public static List<String> SearchCategoty (String[] lista) throws ServiceException, RemoteException, RepositoryFault { /** * A partir de un String[] con los ID de la categor?a, obtengo sus nombres a trav?s de una b?squeda */ StringBuilder idQuery = new StringBuilder(128); List<String> Categorias = new ArrayList<String>(lista.length); for (String c: lista){ c=c.trim(); if (idQuery.length() != 0){ idQuery.append("\" OR ID:\""); } idQuery.append©; } RepositoryServiceSoapBindingStub repositoryService = WebServiceFactory.getRepositoryService(); String pathQuery="ID:\"" + idQuery.toString() + "\"" ; Query queryCategory = new Query(QueryLanguageEnum.lucene, pathQuery); QueryResult queryResultCat = repositoryService.query(STORE, queryCategory, false); ResultSet resultSetCat = queryResultCat.getResultSet(); ResultSetRow rowsCat[] = resultSetCat.getRows(); // Compruebo que no haya elementos repetidos y retorno una lista de Strings if (rowsCat != null){ for (ResultSetRow row: rowsCat){ NamedValue columns[] = row.getColumns(); for (NamedValue col: columns){ if (col.getName().endsWith("name")){ col.getValue(); if (Categorias.contains(col.getValue())){ break; }else{ Categorias.add(col.getValue()); } } } } } return Categorias; }
