on 09-19-2013 10:49 AM
Hi Experts.
I want to display the KM Resources (fodler,sub folders, document etc...) of selected Group using Webdynpro java (NWDS 7.0.1).
First I have extracted the all Groups in table using Webdynpro java. Next I have tried to get the KM Resources using selected Group from table.
But I am getting compile time error messages
IResourceContext resourceContext = new ResourceContext(ep5Group);". The error is "The constructor ResourceContext(IGroup) is undefined"
Please help me.
Here I have attached the coding which I had tried.
groupFact = UMFactory.getGroupFactory();
IGroupSearchFilter groupFilt = groupFact.getGroupSearchFilter();
groupFilt.setUniqueName("*", ISearchAttribute.LIKE_OPERATOR, false);
ISearchResult result = groupFact.searchGroups(groupFilt);
if(result.getState() == ISearchResult.SEARCH_RESULT_OK) {
wdComponentAPI.getMessageManager().reportSuccess("result:" +result.size());
while(result.hasNext()) {
String uniqId = (String)result.next();
IGroup thisGroup = groupFact.getGroup(uniqId);
com.sapportals.portal.security.usermanagement.IGroup ep5Group = null;
ep5Group = (com.sapportals.portal.security.usermanagement.IGroup)UMFactory.getGroupFactory().getGroup(thisGroup.getDisplayName());
IResourceContext context = new ResourceContext(ep5Group);
RID rid = RID.getRID("/documents/CCElectronics Content/Folder View/");
IResource resource = ResourceFactory.getInstance().getResource(rid, context);
if(resource.isCollection() == true) {
ICollection collection = (ICollection)resource;
IResourceList resourceList = collection.getChildren();
if(resourceList.size()>0) {
IResourceListIterator resourceListIterator = resourceList.listIterator();
for(IResourceListIterator itr = collection.getChildren().listIterator(); itr.hasNext();) {
IResource res = (IResource)itr.next();
wdComponentAPI.getMessageManager().reportSuccess("KM Content1:" + res.getDisplayName());
wdComponentAPI.getMessageManager().reportSuccess("KM Content2:" + res.getDisplayName(true));
}
}
}
}
}
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
Regards,
Ramireddy
Done.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Reddy,
ResourceContext is defined for Iuser inly, not iGroup
IResourceContext resourceContext = new ResourceContext(ep5Group);
this will not work, you should use
ResourceContext getInstance(com.sap.security.api.IUser user, Locale fallbackLocale)
Hope this helps!!
Regards
Vijay Kalluri
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
83 | |
23 | |
11 | |
9 | |
8 | |
5 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.