Вы находитесь на странице: 1из 21

SAP Composite Application

Framework

Integrating KM with
CAF UI Patterns

Version 1.00 – July 2006


SAP AG
Neurottstraße 16
69190 Walldorf
Germany
T +49/18 05/34 34 24
F +49/18 05/34 34 20
www.sap.com

SAP, R/3, mySAP, mySAP.com, xApps, xApp, SAP NetWeaver,


© Copyright 2005 SAP AG. All rights reserved. and other SAP products and services mentioned herein as well as
their respective logos are trademarks or registered trademarks of
No part of this publication may be reproduced or transmitted in SAP AG in Germany and in several other countries all over the
any form or for any purpose without the express permission of world. All other product and service names mentioned are the
SAP AG. The information contained herein may be changed trademarks of their respective companies. Data contained in this
without prior notice. document serves informational purposes only. National product
specifications may vary.
Some software products marketed by SAP AG and its distributors
contain proprietary software components of other software
vendors.
These materials are subject to change without notice. These
Microsoft, Windows, Outlook, and PowerPoint are registered materials are provided by SAP AG and its affiliated companies
trademarks of Microsoft Corporation. ("SAP Group") for informational purposes
only, without representation or warranty of any kind, and SAP
IBM, DB2, DB2 Universal Database, OS/2, Parallel Sysplex, Group shall not be liable for errors or omissions with respect to
MVS/ESA, AIX, S/390, AS/400, OS/390, OS/400, iSeries, the materials. The only warranties for SAP Group products and
pSeries, xSeries, zSeries, z/OS, AFP, Intelligent Miner, services are those that are set forth in the express warranty
WebSphere, Netfinity, Tivoli, and Informix are trademarks or statements accompanying such products and services, if any.
registered trademarks of IBM Corporation in the United States Nothing herein should be construed as constituting an additional
and/or other countries. warranty.

Oracle is a registered trademark of Oracle Corporation.


Disclaimer
UNIX, X/Open, OSF/1, and Motif are registered trademarks of Some components of this product are based on Java™. Any code
the Open Group. change in these components may cause unpredictable and severe
malfunctions and is therefore expressively prohibited, as is any
Citrix, ICA, Program Neighborhood, MetaFrame, WinFrame, decompilation of these components.
VideoFrame, and MultiWin are trademarks or registered
trademarks of Citrix Systems, Inc. Any Java™ Source Code delivered with this product is only to be
used by SAP’s Support Services and may not be modified or
HTML, XML, XHTML and W3C are trademarks or registered altered in any way.
trademarks of W3C®, World Wide Web Consortium,
Massachusetts Institute of Technology.

Java is a registered trademark of Sun Microsystems, Inc.

JavaScript is a registered trademark of Sun Microsystems, Inc.,


used under license for technology invented and implemented by
Netscape.

MaxDB is a trademark of MySQL AB, Sweden.


Typographic Conventions Icons

Type Style Represents Icon Meaning


Example Text Words or characters quoted from Caution
the screen. These include field
names, screen titles, Example
pushbuttons labels, menu
names, menu paths, and menu
options. Note

Cross-references to other Recommendation


documentation.
Example text Emphasized words or phrases in Syntax
body text, graphic titles, and
table titles.
EXAMPLE TEXT Technical names of system
objects. These include report
names, program names,
transaction codes, table names,
and key concepts of a
programming language when
they are surrounded by body
text, for example, SELECT and
INCLUDE.
Example text Output on the screen. This
includes file and directory names
and their paths, messages,
names of variables and
parameters, source text, and
names of installation, upgrade
and database tools.
Example text Exact user entry. These are
words or characters that you
enter in the system exactly as
they appear in the
documentation.
<Example text> Variable user entry. Angle
brackets indicate that you
replace these words and
characters with appropriate
entries to make entries in the
system.
EXAMPLE TEXT Keys on the keyboard, for
example, F2 or ENTER.
Contents
Prerequisites.............................................................................................................................. 1
Applicable Releases........................................................................................................... 1
Disclaimer........................................................................................................................... 1
CAF Runtime Property Settings ................................................................................................ 1
Enterprise Portal Settings.......................................................................................................... 3
Integrating CAF with KM............................................................................................................ 6
Prerequisites
Before you start with this tutorial you should have installed the following Software:
• SAP Web Application Server Java 7.0
• Portal / KM Server
• SAP NetWeaver Developer Studio 7.0

This tutorial is based on the following How-to Guides:


• Create an Application Service

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.

CAF Runtime Property Settings


If the CAF and the KM are installed on the same J2EE engine, follow the steps given below to
configure the CAF and KM.

1) Launch the J2EE Visual Admin Tool. Navigate to Services->Configuration Adapter.


Go to the tab Runtime -> Display Configuration. Navigate to Configuration -> apps ->
sap.com -> caf~runtime~ear -> appcfg.

-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>

Save the settings and restart the J2EE engine.

Enterprise Portal Settings


Now we need to perform some configurations of the KM Server for the CAF to communicate to
the KM.

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.

Save the changes.

2) The next step is to setup a CAF Repository Manager.

Navigate to the page System Administration -> System Configuration -> Knowledge
Management -> Configura-tion -> Content Management -> Repository Managers ->
CAF Repository

Create a new CAF Repository with the following settings.

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

Save the changes.

-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.

3) Now we will create UI patterns to deal with documents.

Launch the URL


http://<was_host>:<was_port>/webdynpro/dispatcher/sap.com/caf~UI~configbrowser/
ConfigBrowser

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

The list if attributes of Document entity will be displayed.

Select the field’s title, link and description.

Select Popup as New Attachment Mode. This will lead to the new attachment window
opened as a popup.

Select the checkbox Allow Document Edit.

-8-
Enter “Attach Itinerary” in the Terminology for Attachment field. This is the title of the
Attachment list screen.

Enter 5 in Number of Visible Rows field.

4) The next step is to configure the New Attachment pattern.


Enter the name newAttachItinerary in the Configuration Name for New Attachment
field. Click on the Configure button.

The New Attachment pattern screen will be opened.

-9-
The New Profile section defines the data source of the document. Select all the three
checkboxes.

Enter the Title “Select Itinerary”.

Enter browse_km_Itinerary as the Browse UI to select KM resource and


browse_km_Target as the Browse UI to select target KM folder.

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.

Save the settings and return to the New Attachments screen.

Click on the second Configure button. The File Select pattern for browse_km_Target
will be displayed. Enter the following.

Name for Top level label: KM


Start Directory: /documents_xapps
Max number of rows to be displayed: 10
Select Directory.

Save the settings and return to New Attachments screen.

- 11 -
Save the New Attachment configurations and return to the Attachments screen.

Save the Attachment configuration.

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.

This completes the configuration for the KM UI pattern.

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.

World Wide Web: http://www.sap.com


Name: testLink

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 -

Оценить