cancel
Showing results for 
Search instead for 
Did you mean: 

Get Resultlist of ResourceListFilter

Former Member
0 Kudos

Hi,

I need to develop a Java iView which uses a ResourceListFilter. For this solution I think I don't really need a CollectionListRenderer and a LayoutSet. Is there a way to directly use the ResoureceListFilter, point it to a folder and get the filter result?

Can you tell me where exactly in the API I can read more about the ResourceListFilters?

Thanks in advance.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Timo

The real advantage of ResourcListFilter comes into play only when you use it along with a CollectionRenderer. The ResourceListFilter is invoked first and a sublist is presented to the CollectionRenderer to render.

Technically there isnt much difference between a filter you might write and a ResourceListFilter. However when you are writing a Java Iview you will need to write code to handle "pointing to documents" while this is automatically taken care of in the CollectionRenderer.

Regards

Pran

Former Member
0 Kudos

Hi,

thanks for you answers. What I need in my Java iView is only the filter result, because then I need to work with it in the Java iView, afterwards the result is displayed to the user, that's why I think I don't need a CollectionListRenderer and a LayoutSet.

Former Member
0 Kudos

Hi Timo,

You can do that , by creating an instance of your ResourceListFilter and call filterResource list explicitly

Regards

Pran

Former Member
0 Kudos

Hi Pran,

How? Do you know an example? My problem is also where in the Javadoc can I read about the ResourceListFilter, I don't find it?

How do I assign the ResourceListFilter to a folder?

Thanks a lot.

Former Member
0 Kudos

Hi Timo,

The link i have given u contains sample code on ResourceList Filter.

You can assign the filter at the Layoutset level. Find the layout set which is being used by the iview and assign the filter there.

Regards

Prakash

Former Member
0 Kudos

Hi Prakash,

thanks for your answer. I already read that document, but I think it's not exactly what I need. I know how to develop the ResourceListFilter, but I think in my case I don't need the CollectionListRenderer and the LayoutSet. I what to directly get the filter result from the ResourceListFilter.

Kind regards,

Timo

Former Member
0 Kudos

Hi Timo,

You must have the IResourceList object which contains the list of all the resources. You can loop through this list and filter from that to create a new list.

Regards

Prakash

Former Member
0 Kudos

Hi Timo

Assuming you have written resorucelistfilter (ResourceFilter) . This is one way of filtering.


IUser user = WPUMFactory.getUserFactory().getEP5User(request.getUser());
IResourceContext ctxt = new ResourceContext(user);
RID rid = RID.getRID("<get rid through query string or config or request>"); 
IResource resource = ResourceFactory.getInstance().getResource(rid, ctxt);
ICollection collection = null;
IResourceList reslist = null;
if(resource.isCollection()){
 collection = (ICollection)resource;
 reslist = collection.getChildren();
}
if(reslist != null)
new ResourceFilter().filterResourceList(reslist,null);

But for you are trying to achieve I would suggest you use a collection renderer.

Regards

Pran

Former Member
0 Kudos

Hi Pran,

that helps a lot. Well, for my solution I'm filtering HTML pages and after filtering I always should have only one file left, and this HTML page should be displayed then. That's why I think I don't need a CollectionListRenderer.

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Timo,

Check out this article which tells you how to write a ResourceListFilter

https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/kmc/implementing resource list filters for flexible ui navigation/index.htm

Regards

Prakash