Skip to Content
Author's profile photo Former Member

Access KM files from ear file (iView in portal) in NW 7.31

In this blog describes the issues faced while accessing  KM files from ear file (iView in portal) in NW 7.31


You have created a ear file project in NWDS and need to access KM files or folders

Issues faced

  1. How to get required KM API?

          By default NWDS is not having KM related dependencies , you need to download below two SCA files from Service market place relevant to your server           version.

          KMCCM and KMCWPC

          Then import these sca files into NWDS from development infrastructure perspective.

          Next step is in development infrastructure perspective click in KMC-CM SCA file-> in Component properties-> overview tab->Archive store ->select the           downloaded SCA file and upload.

   2. Adding KM API jar files to ear file?

          Right click ear file project->Properties->Java build path->Add external Jars then select KM API from           “LocalDevelopment\KMC-          CM\\tc\km\frwk\_comp\gen\default\public\api\lib\java”

          Next is the important step in ear project-> dist-> portal-INF->portalapp.xml->Application Tab->SharingReference -> add this value           “” . Now you can access KM related classes in ear file.

           Below code is an example to access files from a KM folder and lists users having access to file.

      IResourceFactory resourceFactory = ResourceFactory.getInstance();             

      com.sapportals.wcm.repository.IResourceContext resourceContext =      ResourceFactory.getInstance().getServiceContextUME(“cmadmin_service”);       

            RID rid = RID.getRID(“/documents/Files “);

            com.sapportals.wcm.repository.IResource resourceN = resourceFactory.getResource(rid, resourceContext);



                  ICollection collection=(ICollection)resourceN;

                  IResourceList resourceList=collection.getChildren();

                  IResourceListIterator iterator=resourceList.listIterator();




                              IResource resource2=(IResource);                           

                              ISecurityManager securityManager      =resource2.getRepositoryManager().getSecurityManager(resource2);

                              IResourceAclManager irm =((IAclSecurityManager)securityManager).getAclManager();

                              IResourceAcl resourceAcl = irm.getAcl(resource2);                                                 

                        IResourceAclEntryList list = resourceAcl.getEntries();

                              IResourceAclEntryListIterator iteratorAcl = list.iterator();                 

                        while (iteratorAcl.hasNext()){

                        IResourceAclEntry entry =;





                        } catch ( Exception e) {

                                System.err.println(“exception: “ + e.getLocalizedMessage());






Rakesh Mathew

Assigned Tags

      Be the first to leave a comment
      You must be Logged on to comment or reply to a post.