
When you begin development, in a preparatory phase, you need to enhance the portal project with items required for KM. If no wizard is available to automatically perform this task, you need to proceed manually. This involves:
To add the created configuration to the development component (DC) build, you have to add as a resource root the src.config folder for your DC by choosing the DC → Component Properties tab → Folders tab → Add Resource Root, select the src.config folder and choose OK.
Defining the Deployment Descriptor
When you run your new KM component in the portal, it needs to access various portal applications. You use the deployment descriptor in the project to inform the portal runtime (PRT) of these applications. The deployment descriptor is the XML file portalapp.xml that is located in the project under dist\ portal-inf
To specify components required at runtime:
For Knowledge Management, you reference the xxx tc/km/frwk and tc/km/nonwdui For Portal applications, you identify the name of the applications in the application name element of the corresponding portalapp.xml file. You can find the file by navigating to the deployed package on the portal.
Examples of portal applications that you often need to reference are: User management, HTMLB, JCO and the portal navigation service.
application nameName of the portal archive file. This is the name you assign to the EAR file that you deploy in the portal when you have completed your development project.
SharingReferenceComma-separated list of portal applications whose API is accessed at runtime
The example shows the entries in a portalapp.xml file.
<?xml version="1.0" encoding="utf-8"?>
<application name="com.sap.ides.kmc.samples" alias="com.sap.ides.kmc.samples">
<application-config>
<property name="SharingReference" value="com.sap.portal.runtime.config, com.sap.portal.runtime.config.component, usermanagement, tc~km~frwk, tc~km~nonwdui, com.sap.portal.ivs.connectorservice"/>
</application-config>
<components/>
<services/>
</application>
Extensions Only: Creating a Portal Service
If you are developing an extension without using a wizard, you add a portal service to your project. The purpose of the service is to ensure that the extension's class loader is registered with the repository framework at startup. As a consequence, at runtime, all components that are required for the execution of the extension will be available for the KM component runtime (CRT). The CRTs class loader loads the classes dynamically using Java reflection mechanisms.
To implement the portal service, you:
If you are developing an extension with a wizard, you must check whether a value for the KEY is entered in the IRFServiceWrapper interface as described below.
Creating a Service and Implementing a Service Wrapper Class
You create a portal service with a plugin in the SAP NetWeaver Developer Studio:
Entering the Service in the Deployment Descriptor
Open the deployment descriptor dist\ portal-inf \portalapp.xml for your KMC component. Add the new service you created as shown in the example below. To do this, add a service element that names the portal service and properties as follows:
service name Name you assigned to the service. A fully qualified portal service name is constructed as follows:<application name>.<portal service name>
className Fully qualified name of the class
startup Set to true to ensure that the portal runtime starts the service at startup and that the CRTClassLoader registration is executed automatically.
Adding a Service to the Deployment Descriptor
<?xml version="1.0" encoding="utf-8"?> <application name="com.sap.ides.kmc.samples" alias="com.sap.ides.kmc.samples"> <application-config> <property name="releasable" value="false"/> <property name="startup" value="true"/> <property name="ClassLoadingPolicy" value="CoreAccessInAPI,transitive"/> <property name="DeploymentPolicy" value="5.0"/> <property name="SharingReference" value="com.sap.portal.runtime. config, com.sap.portal.runtime.config.component, usermanagement, tc~km~frwk, tc~km~nonwdui, com.sap.portal.ivs.connectorservice"/> </application-config> <components/> <services> <service name="RFServiceWrapper"> <service-config> <property name="className" value="com.sap.ides.kmc.portalservicewrapper.PortalServiceWrapper"/> <property name="startup" value="true"/> </service-config> </service> </services> </application>
Result
The portal service interacts with the portal runtime as follows: