on 09-12-2008 7:14 AM
Hello!
I'm just a beginner in KM, that's why have some simple questions.
I want to get List of files in folder, like that list appear in "KM Content" in Administration.
What code will solve my problem?
Seems like I found solution:
ICollection currentFolder = null;
currentFolder =(ICollection) ResourceFactory.getInstance().getResource(rid,context);
IResourceList children = null;
children = currentFolder.getChildren();
children.get(i).getName().toString()
But can I get GUID of file? Can't find solution for this..
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Found Example:
import com.sapportals.wcm.service.urimapper.IUriMapperService;
IUriMapperService ums = UriMapperServiceFactory.getInstance();
But I can't find library that contents UriMapperServiceFactory.
(com.sapportals.wcm.service.urimapper.UriMapperServiceFactory)
Any body know where that lib is located? Or e-mail to me?
You need to get the instance from the service factor (see http://help.sap.com/javadocs/NW04S/current/km/com/sapportals/wcm/service/ServiceFactory.html).
Hi,
about gettong the GUID from RID see my reply here: [https://www.sdn.sap.com/irj/sdn/thread?messageID=6077407#6077407|https://www.sdn.sap.com/irj/sdn/thread?messageID=6077407#6077407]
The required lib you can find on portal filesystem here:
\usr\sap\XXX\JCXX\j2ee\cluster\server0\apps\sap.com\irj\servlet_jsp\irj\root\WEB-INF\portal\portalapps\com.sap.netweaver.bc.rf.service\lib\bc.rf.global.service.urimapper_api.jar
Hope that helps,
Romano
Thanks, But on this line raise exception:
IUriMapperService uriservice = (IUriMapperService )ResourceFactory.getInstance().getServiceFactory().getService("UriMapperService");
An exception occurred while processing a request for :
iView : N/A
Component Name : N/A
com.sapportals.wcm.service.urimapper.IUriMapperService.
Hi,
not sure (you should send the stackTrace from the defaultTrace.log) but maybe you have forgot to add the sharing reference to the portalapp.xml of your project:
...
<application>
<application-config>
<property name="SharingReference" value="knowledgemanagement"/>
</application-config>
<components>
...
Romano
Hi Paul,
for sure it has...at least in my portal version...this works for me - I've tried:
RID rid = RID.getRID("/documents/");
IUriMapperService uriMapperService = (IUriMapperService) ResourceFactory.getInstance().getServiceFactory().getService("UriMapperService");
RID guid = uriMapperService.getGuidRIDFromRID(rid); // "493a20804adfb2be5ba2980b435501a8-989g75632safr4df7ga2980b894742a8";
RID rid2 = uriMapperService.getRIDFromGuidRID(guid); // /documents
response.write("RID:" + rid + ", GUID:" + guid + ", RID2:" + rid2);
What is your EP version?
Romano
Would you be using WebDynpro to display?
Thanks,
GLM
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.