Skip to Content
0
Former Member
Jun 28, 2005 at 03:33 AM

How to get taxonomy of a resource??

37 Views

I've tried to get the taxonomy of a resource by two ways:

1) By getting the propierty "categories" in the namespace "http://sapportals.com/xmlns/cm/rendering" but it doesn't work ( the resource already has a taxonomy assigned).

2) with this code that supposed to get the taxonomy of the resource but it doesn't and just takes the taxonomies of the "DT" index...

IIndexService indexService = (IIndexService)ResourceFactory.getInstance().getServiceFactory().getService(IServiceTypesConst.INDEX_SERVICE);
				
IClassificationIndex classificationIndex = (IClassificationIndex)indexService.getIndex("DT");
				
if(classificationIndex == null){
      response.write("classificationInde null");
}else{
	IDocClassificationMap docClassification  = classificationIndex.getDocClassification(res);
	Iterator iterTaxonomias = docClassification.getTaxonomyNameSet().iterator();
	int i = 0;
	while(iterTaxonomias.hasNext()){
	      String nombre_taxonomia = (String) iterTaxonomias.next();
	      response.write("taxonomy " + i +" : " + nombre_taxonomia+"<br>");
							i++;
       }
}

Please help, I don't know where else to search...