on 04-30-2008 2:48 PM
Hi All,
How to reterive the KM Folder (root\documents\Images) using API?
Regards
Thillai
Hi,
try{
IUser contextUser = (IUser) ((IPortalComponentRequest) this.getRequest()).getUser().getUser();
ResourceContext resourceContext = new ResourceContext(contextUser);
RID rid = RID.getRID("\documents\Images");
IResource resource = (IResource) ResourceFactory.getInstance().getResource(rid, resourceContext);
}
catch(Exception e)
{
}
u can then use the resource object.
Mr.Chowdary
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Check this:
RID rid =RID.getRID("/documents/Images");
IUser contextUser = (IUser) ((IPortalComponentRequest) this.getRequest()).getUser().getUser();
ResourceContext resourceContext = new ResourceContext(contextUser);
public static IResource getResource(RID rid, IResourceContext resourceContext) {
IResource resource = null;
if (rid == null || StringUtils.isEmpty(rid.toString())) {
return resource;
}
try {
resource = (IResource) ResourceFactory.getInstance().getResource(rid, resourceContext);
} catch (AuthorizationRequiredException e) {
logger.severe(e, logger_infos + "Exception AuthorizationRequiredException caught" + e.getMessage());
} catch (ResourceException e) {
logger.severe(e, logger_infos + "Exception ResourceException caught" + e.getMessage());
}
if (resource == null) {
logger.warning(logger_infos + "getResource resource=[null]");
} else {
logger.info("getResource resource=[" + resource.getDisplayName() + "]");
}
return resource;
}
This code brings the folder which you should cast it to ICollection object and iterate on the children.
Also check the KM API:
http://help.sap.com/javadocs/NW04S/current/km/index.html
Regards,
Praveen Gudapati
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
95 | |
11 | |
10 | |
9 | |
9 | |
7 | |
6 | |
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.