Академический Документы
Профессиональный Документы
Культура Документы
Framework
Integrating KM with
CAF UI Patterns
Additionally you should have configured CAF as described in the How-to Guide “Installation and
Configuration Guide”.
Applicable Releases
This tutorial is compatible with the following releases:
• SAP NetWeaver ’04s
• SAP Composite Application Framework (CAF) 7.0
Disclaimer
Any software coding and/or code lines / strings ("Code") included in this documentation are only
examples and are not intended to be used in a productive system environment. The Code is only
intended better explain and visualize the syntax and phrasing rules of certain coding. SAP does
not warrant the correctness and completeness of the Code given herein, and SAP shall not be
liable for errors or damages caused by the usage of the Code, except if such damages were
caused by SAP intentionally or grossly negligent.
-1-
2) Switch to Edit mode and open the properties file Propertysheet
application.global.properties.
-2-
Enter custom values for the following entries.
Field Value
KM_MACHINE_ADDRESS The address of the machine where KM is installed
KM_MACHINE_PORT The KM Port
KM_REPOSITORY /caf-<J2EE_MACHINE_NAME>
IDX_PREFIX CAF-<J2EE_MACHINE_NAME>
1) Launch the Portal (KM) and login with the User who has System Administration role.
First we will setup a CAF Security Manager which regulates the access of KM from
CAF.
Navigate to the pages System Administration -> System Configuration -> Knowledge
Management -> Content Management.
Switch to the Advanced mode (using the menu on the top). Go to Repository
Managers -> Security Managers->CAF Security Manager.
-3-
Create a new CAF Security Manager and enter the following settings.
Field Value
Name CAFSecurityManager_<J2EE_MACHINE_NAME>_<SYSTEM_ID> (e.g.
CAFSecurityManager_EPMWXXX_C03)
Permission com.sapportals.wcm.control.security.DefaultPermissionControl
Rendering
Class
List of sap.com/caf.core/Document
invisible
business
objects
URL of CAF http://<J2EE_MACHINE_NAME>:<PORT>/CAFDataService/Config?styl
Web Service e=rpc_enc
Note: Ensure that the J2EE machine name and port are correct.
List of Users Add the portal (km) user name here
with full
Use this field only in case you want to explore the CAF Repository
access.
through Portal.
Navigate to the page System Administration -> System Configuration -> Knowledge
Management -> Configura-tion -> Content Management -> Repository Managers ->
CAF Repository
Field Value
Repository caf-<J2EE_MACHINE>
name
Note: This is the same as that of the KM_REPOSITORY property that
we entered in the J2EE engine, without forward slash.
Prefix /caf-<J2EE_MACHINE>
-4-
Note: This is the same as that of the KM_REPOSITORY property that
we entered in the J2EE engine.
URL of CAF http://<J2EE_MACHINE
Web Service >:<PORT>/CAFDataService/Config?style=rpc_enc
Note: Ensure that the J2EE machine name and port are correct.
URL for CAF http://<J2EE_MACHINE
Object Editor >:<PORT>/webdynpro/dispatcher/sap.com/caf~UI~ptn~objecteditor/Obj
ectEditor?app.parameter1=<guid>&app.parameter2=E&app.configName
=<configuration>
Active selected
(Checkbox)
Security Select the security manager that we created in the Section 2.
Manager
List of sap.com/caf.core/Document
objects that
are editable
view CAF
Object Editor
-5-
Integrating CAF with KM
In the following sections we will discuss how to use different KM related UI Patterns
and attach documents to the CAF Entities. We will consider a business scenario
where we attach a Travel Itinerary document to instances of Travel entity services.
1) For attaching documents, we use the CAF core entity service called Document
(sap.com/caf.core/Document).
In the NetWeaver IDE, open the Travel Entity service. Switch to the Attributes tab.
Add Document as a related entity to the Travel entity.
Change the name of the related entity to itinerary, and description to Itinerary.
-6-
2) Save, generate project code, build and deploy the DC.
Select Attachments from the Pattern list and click on the button New Configuration.
Enter the following values and click the button Show Attachment Attributes.
-7-
Field Value
Configuration travel_Itinerary
Name
Service sap.com/carpool/TravelService
Module
Aspect for Travel
object
Relation Name itinerary
for attachment
Related Object sap.com/carpool/Travel
Name
Select Popup as New Attachment Mode. This will lead to the new attachment window
opened as a popup.
-8-
Enter “Attach Itinerary” in the Terminology for Attachment field. This is the title of the
Attachment list screen.
-9-
The New Profile section defines the data source of the document. Select all the three
checkboxes.
Click on the first Configure button. The File Select pattern for browse_km_Itinerary
will be displayed. Enter the following.
- 10 -
Name for Top level label: KM
Start Directory: /documents_xapps
Max number of rows to be displayed: 10
Select File.
Click on the second Configure button. The File Select pattern for browse_km_Target
will be displayed. Enter the following.
- 11 -
Save the New Attachment configurations and return to the Attachments screen.
5) Now we need to add this Attachment pattern to an Object Editor pattern for Travel.
Create a new Object Editor configuration for Travel entity with the following settings.
Field Value
Configuration create_TravelWithItinerary
Name
Service sap.com/carpool/TravelService
Header Aspect Travel
Fields to be ID, Start Date
shown in
Object Editor
Button Name Submit
Title of Object Create Travel and Attach Itinerary
to appear in
header
Add a tab to the object editor for the associated Aspect itinerary, with the following
settings:
Field Value
Name to Travel Itinerary
appear on Tab
Associated Itinerary
Aspect
Component com.sap.caf.ui.ptn.objecteditor.tabcomp.DummyComponent
- 12 -
Name
Development sap.com/caf~UI~ptn~attachments
Component
Configuration Travel_itinerary
Name
Select the newly added tab and click on the Save and Return button.
6) Now let us test the UI pattern. Preview the pattern or launch the URL
http://<was_host>:<was_port>/webdynpro/dispatcher/sap.com/caf~UI~ptn~objectedit
or/ObjectEditor?app.configName=create_TravelWithItinerary
Enter an ID (36 digits) and a Start Date. Click on the Add button. The File select
popup will be displayed.
- 13 -
Select a file from your file server and click on OK. Here the source of the file is your
local computer.
Click on the Add button again. This time select World Wide Web as the File Source.
Enter the following details.
Please note that the name should not contain any spaces or special characters, as
this name will be used to form an URL.
- 14 -
Click OK. The link will be added to the document list.
Click on the Submit button. This will now create an instance of Travel entity, create
instances of Document entity, attach them to the Travel instance and check the
document into the KM server.
- 15 -
- 16 -
www.sap.com/netweaver
- 17 -