on 09-30-2008 8:35 AM
Hi everybody,
I am trying to get a list in java with all files that are contained in a Taxonomy folder.
Now I have the following function to acces a Taxonomy folder and return a list of all the accessRIDs from the documents in this folder:
List xmlforms = null;
try
{
ep5User = WPUMFactory.getUserFactory().getEP5User(user);
IResourceContext context = new ResourceContext(ep5User);
RID pathRID = RID.getRID("taxonomies/DemoNews/DemoNews/All%20Items/");
com.sapportals.wcm.repository.IResource resource = com.sapportals.wcm.repository.ResourceFactory.getInstance().getResource(pathRID,context);
if(resource.isCollection())
{
xmlforms = new ArrayList();
ICollection collection = (ICollection)resource;
IResourceListIterator it = collection.getChildren().listIterator();
while(it.hasNext())
{
IResource res = (IResource)it.next();
if(!res.isCollection())
{
xmlforms.add(res.getAccessRID());
}
}
}
}catch (Exception e) {
e.printStackTrace();
}
finally
{}
return xmlforms;
But when I execute this function it gives me a nullpointer. So the function isn't putting anything in the list.
However, when I change the RID of the folder to iterate to for example "/documents/news" then it works fine.
So my question is if it is possible to access the "/Taxonomies" directory using the KM API?
Thanks in advance
Kind regards
Wouter Delellio
Hi,
The best would be to post here the defaultTrace log to see, on which line of the code is the exception thrown. Maybe you just define the wrong RID.
Instead of:
taxonomies/DemoNews/DemoNews/All%20Items/
try:
/taxonomies/DemoNews/DemoNews/All Items/
(note the forst slash and the space between "All" "Items").
Romano
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
85 | |
10 | |
10 | |
9 | |
7 | |
6 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.