We are going to create a new folder in KM using Web dynpro java.We can create the folder in the KM manually , our aim is to create the folder programmatically through Web dynpro java using KM API’s.
Step1 : Creating Web dynpro Project Open NWDS –> File –> New –> Web dynpro Development Component
Creating a KM Folder Programmatically
Give the appropriate name and click on Finish.
KM
We need to set the two class path variables.Choose Window–> Preferences –>Class path variable and click on New 1. Give the name as WEBAS_HOME and provide the following path \usr\sap\\JC\j2ee\cluster\server (for example: c:\usr\sap\F48\JC30\j2ee\cluster\server0) 2. Give the name as PORTAL_HOME and provide the following path WEBAS_HOME\apps\sap.com\irj\servlet_jsp\irj\root\WEB-INF\portal\ (for example: c:\usr\sap\F48\JC30\j2ee\cluster\server0\apps\sap.com\irj\servlet_jsp\irj\root\WEB-INF\portal\)
KM
After giving the class path variable we need to set Java Build path. Right click on the project –>properties –> Add Variable We need to add the following jars 1.prtapi.jar 2.comman_api.jar 3.framework_api.jar 4.util_api.jar 5.urlgenerator_api.jar 6.public_api.jar 7.com.sap.portal.service_api.jar 8.com.sap.portal.usermanagementapi.jar 9.com.sap.security.api.ep5.jar
KM
And in the web dynpro references tab we need to insert the following path.For opening Web dynpro references right click on the project–>select properties–>select web dynpro and select sharing References as shown in the below screen shot. PORTAL:sap.com/com.sap.km.application
Write the following code to Creation of new folder and uploading the files into KM
Finally build and deploy the project.login to the portal for the creation of the Web dynpro for java Iview. Go to Content Administration and create new –>Iview and select the appropriate component and finally click on finish to create the Iview.
Need Help:
In case you need assistance on SAP Support Services, please contact us. Please send us your questions, comments or assistance request and our team would be glad to assist you.