0% found this document useful (0 votes)
121 views79 pages

WD Experts

WD experts

Uploaded by

Zakhar NuNrg
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
121 views79 pages

WD Experts

WD experts

Uploaded by

Zakhar NuNrg
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 79

CD354

Web Dynpro for Java


– Expert
Contributing Speakers

Marco Ertel
Product Management, SAP AG

Bertram Ganz
Development, SAP AG

Jeff Gebo
NetWeaver Foundation RIG, SAP LABS LLC

Ron Hendrickx
NetWeaver Foundation RIG, SAP LABS LLC

Jens Ittel
Development, SAP AG

© SAP AG 2006, SAP TechEd ’06 / CD354 / 2


Adaptive Web Service Model

Componentization in Practice

Outlook
Why WebServices?

Web Services

act like a black-box that may require input and deliver


a result

work on top of any communication technology stack

can be published, discovered and invoked based on open


technology standards

work in synchronous and asynchronous scenarios

facilitate integration within an enterprise as well as cross


enterprises

© SAP AG 2006, SAP TechEd ’06 / CD354 / 4


Why a New WebService Model?

Security issues
„ Only user and password was possible
„ No SSO

Service provider has to be in the source code

No support for debugging and tracing

Internal structure too complex for maintenance

© SAP AG 2006, SAP TechEd ’06 / CD354 / 5


Advantages of the Adaptive Web Service Model

WS logical destinations
„ configuration of connection, authentication, encryption settings
„ currently only for WS providers supporting WSIL

Tracing of model content / SOAP traffic for problem


analysis
„ model metadata, data
„ http-request/-response for SOAP calls

Access WS-Runtime Service Extension Interfaces


„ modify HTTP, SOAP, security settings via API (e.g. to set non-SAP SSO
cookie)

© SAP AG 2006, SAP TechEd ’06 / CD354 / 6


Using Web Services With Logical Destinations

Development Consolidation
Transport
Service Provider Service Provider
System System

WS A WS B WS A WS B

Destination

ApplicationApplication ApplicationApplication
X Y X Y
Service Consumer Service Consumer
System System

Administrator Developer
Tasks Tasks
© SAP AG 2006, SAP TechEd ’06 / CD354 / 7
The Old And The New Model on One Page

Adaptive WS Model (Old) Web service Model


CMI implementation, generic + typed No CMI impl., only typed model through
model generation at design-time

Advanced security settings supported No support for advanced security


via WS-R Service Extension Interfaces settings (non-SAP SSO authentication
tickets)
Runtime settings configurable at Runtime settings stored at design-time;
runtime through WS-Runtime not configurable at runtime (e.g.
configuration and WS destinations internet proxy, authentication, …)
Improved support for WSDL / XML Limited set of XML schema definition
schema constructs; better knowledge support (e.g. no support for multidim.
about limitations arrays, anonymous types, …)
Typed model classes based on generic Based only on code generation at
base and/or delegation classes, bug design-time Æ every bug fix requires
fixes possible without new code recompilation and re-deployment of
generation application
Renaming of model classes possible No model class renaming

© SAP AG 2006, SAP TechEd ’06 / CD354 / 8


Still Some Open Issues …

Remove limitations for certain WSDL/XML schema


constructs
„ support xsd:any, ...

Improve type support at design-time (typed model)


„ logical dictionary containing Java DDic types corresponding to
WSDL/XSD-Types

WS logical destinations
„ support for destinations based on WSDL instead of WSIL

© SAP AG 2006, SAP TechEd ’06 / CD354 / 9


Timeline for Availability

„ NW04 SP16, NW04s SP7: Controlled availability


(IDE config. switch)

„ NW04 SP17, NW04s SP8: General availability

The old model is already deprecated and will be removed


(only from the IDE) in one of the next Service Packs!

© SAP AG 2006, SAP TechEd ’06 / CD354 / 10


How to Use the Model: 1st Step

Create the destinations in the Visual Administrator

© SAP AG 2006, SAP TechEd ’06 / CD354 / 11


How to Use the Model: 2nd Step

Import the Web Service with the new


wizard

© SAP AG 2006, SAP TechEd ’06 / CD354 / 12


How to Use the Model: 3rd Step

Bind the context to the model

© SAP AG 2006, SAP TechEd ’06 / CD354 / 13


How to Use the Model: 4th Step

Implement the methods

//@@begin wdDoInit()

EmployeeModel model = new EmployeeModel();

wdContext.nodeRequest_GetProjectListByEmployee().bind
(new Request_GetProjectListByEmployee(model));

wdContext.nodeRequest_GetAllEmployees2().bind(new
Request_GetAllEmployees2(model));

//@@end

© SAP AG 2006, SAP TechEd ’06 / CD354 / 14


How to Use the Model: Calling With Input Data

//create model instance


EmployeeModel model = new EmployeeModel();
//bind model object to WD context
wdContext.nodeRequest_GetProjectListByEmployee().bind(new
Request_GetProjectListByEmployee(model));
//get model object
Request_GetProjectListByEmployee req =
wdContext.currentRequest_GetProjectListByEmployeeElement().modelO
bject();
//create new relation object
GetProjectListByEmployee prol = new GetProjectListByEmployee(new
EmployeeModel());
//set necessary parameters
prol.setId(id);
//set relation object to model object
req.setGetProjectListByEmployee(prol);
//execute model
try{req.execute();}catch (Exception e){}

„ Model object creation always requires a model instance (contrary to e.g. Adaptive
RFC model)
„ Model instance is not created / maintained by the Adaptive WS model

© SAP AG 2006, SAP TechEd ’06 / CD354 / 15


How to Find Errors in the Communication

Request_NumberToWords requestMO =
wdContext.currentRequest_NumberToWordsElement().modelObject();
if (logger.beDebug()) {
requestMO.wdSetInvocationLogEnabled(true);
}
try {
requestMO.execute();
wdContext.nodeResponse().invalidate(); //update context from model
} catch(Exception ce) {
wdComponentAPI.getMessageManager().reportException(ce.getMessage(),
false);
}
logger.debugT(requestMO.wdGetRequestLog()); //request log (header + SOAP
request)
logger.debugT(requestMO.wdGetResponseLog()); //response log (header + SOAP
response)
logger.debugT(requestMO.associatedModelClassInfo().getModelInfo().toString())
; //model metadata in XML format
logger.debugT(requestMO.toString()); //model object tree in XML format

„ Switch on logging is needed to create request / response log for a call (should only
be done for problem analysis purposes)
„ request / response log contain complete http-request/-response
„ toString() methods on model metadata / model object provides XML representation

© SAP AG 2006, SAP TechEd ’06 / CD354 / 16


How to Modify Technical Settings per Call

„ WS invocation can be influenced by implementing callback methods defined in the


interface IWDWSInvocationModifier.

„ Only to be used if really needed as it allows for modifications on “technical“ level!

„ From the port parameter passed a WS-Runtime „Service Extension Interface“ can
be created which allows typed access to invocation settings

„ Current SEIs / factories are:


com.sap.engine.services.webservices.espbase.client.api.HTTPControlInterface / HTTPControlFactory
com.sap.engine.services.webservices.espbase.client.api. SOAPHeaderInterface / SOAPHeaderIFactory
com.sap.engine.services.webservices.espbase.client.api.SessionInterface / SessionInterfaceFactory

Request_NumberToWords requestMO = new Request_NumberToWords(model);


requestMO.wdSetInvocationModifier(new IWDWSInvocationModifier() {
public void doModifyInvocation(Object port) {
HTTPControlInterface httpItf =
HTTPControlFactory.getInterface(port);
//timeout for this WS invocation is 120 sec; don’t use global config.
setting of WS-Runtime
httpItf.setSocketTimeout(120000);
}
public void doModifyAfterInvocation() {
}});

© SAP AG 2006, SAP TechEd ’06 / CD354 / 17


Adaptive Web Service Model

Componentization in Practice

Outlook
The Customer‘s Development Task

“Implement a Web Dynpro


application for viewing Sales
Opportunities.
The application architecture must allow
the replacement of the standard viewer UI
with a custom viewer UI.
This flexible UI must be based on
configuration so that no re-deployment of
the application is required”.

Web Dynpro
Customer Application
Developer

© SAP AG 2006, SAP TechEd ’06 / CD354 / 19


VERSION_01 – The Monolithic Component Dead End

„I just develop a „He won‘t succeed


single Web Dynpro with this approach.
Component in a A single monolithic
single DC and put it component will never
all together there.“ ever fulfill the
customer
requirement; that‘s a
dead end!“

© SAP AG 2006, SAP TechEd ’06 / CD354 / 20


VERSION_01
The Monolithic
Component
Dead End

DC 1
My UI + Cust UI Model
Model Interface

© SAP AG 2006, SAP TechEd ’06 / CD354 / 21


Web Dynpro Components Versus Web Dynpro DCs

Web Dynpro Components …

1 are the fundamental blocks which build Web Dynpro


applications.
2 have a specific component architecture.
3 are the only unit of reuse in Web Dynpro

Web Dynpro Development Components (DCs)

4 are units for packaging, building and transportation in


SAP's infrastructure (NWDI).

5 can have usage dependencies to entities in other DCs

© SAP AG 2006, SAP TechEd ’06 / CD354 / 22


Web Dynpro Component Architecture

Visual Facet Controller Facet


Component Interface View(s) Component Interface Controller

1
1 Custom
Custom Component
1 Interface View
Controller
Controller Controller
Window Controller
Window
Window

n Custom
Custom
Custom
Controller
Controller
Controller
m
View
View
View View
View
View
Layout
Layout
Layout 1 1 Controller

View Composition
Web Dynpro Component

Model Interface

© SAP AG 2006, SAP TechEd ’06 / CD354 / 23


The Drawbacks of Monolithic Components

Monolithic Components are contrary to the following


development principles …

1 Correctness 5 Maintainability
2 Scalability 6 Flexibility
3 Productivity 7 Understandability
4 Reusability 8 Composability

The major goal of this lesson is how to become a …

Web Dynpro COP


(Component-Oriented Programmer)

© SAP AG 2006, SAP TechEd ’06 / CD354 / 24


VERSION_02 – Separating Model from UI Components

„How can I create separate UIs


accessing the same model?
When splitting the UI in separate UI
Components and DCs I must also
separate the Model to avoid
redundancies.“
„That‘s good.
He now starts thinking
in components.“

© SAP AG 2006, SAP TechEd ’06 / CD354 / 25


VERSION_02
Separating
Model from UI
Components

My UI Cust UI

DC 1 DC 2

DC 3
Model
Model
Interface

© SAP AG 2006, SAP TechEd ’06 / CD354 / 26


The Interfaces of a Web Dynpro Component

Visual Facet Controller Facet

Component Component
Interface Interface
View(s) Controller
Web 5 2 Programmatic
Dynpro 6 3 Facet
ƒ Methods
Application
ƒ Events

Web Dynpro
7 Component
Visual Facet Data Binding
ƒ Startup Plugs 1 Facet
ƒ Inbound Plugs Components are the 4 ƒ (External)
ƒ Outbound Plugs blocks which build Web Context
ƒ Exit Plugs Dynpro Applications Mapping

© SAP AG 2006, SAP TechEd ’06 / CD354 / 27


Component Usage Relations

Component Usage

„ The parent component Parent


must explicitly define a Component
component usage relation
to embed another child
component use Child
component Component
„ It acts like a variable
referring to component or
component interface
definition

„ At runtime it is associated
with a concrete component
instance

© SAP AG 2006, SAP TechEd ’06 / CD354 / 28


Component Usage Versus Component Instance
IWDComponentUsage IWDExternal-API

UI Component Model Design


Component 1 n Usage 1 1 Component Time

creatComponent()

Instance: Instance: Instance:


UI IWDCom- Model Runtime
Component ponentUsage Component

Component Component
Usage Instance
„ At runtime the component usage is represented by an object of
type IWDComponentUsage.

„ It acts as a component factory for the creation and the


destruction of a single child component instance.

© SAP AG 2006, SAP TechEd ’06 / CD354 / 29


Managing Component Lifecycles

Lifecycle Property of a Component Usage

createOnDemand:Web Dynpro Runtime automatically creates


a component instance on demand (e.g. when the
component gets visible on the UI) and destroys it again

manual: component instance lifecycle must be programmatically


managed by the the application developer using the
IWDComponentUsage-API

© SAP AG 2006, SAP TechEd ’06 / CD354 / 30


Components and Usage Relations
requires
1 2 3

Component Controller to Controller to


to Component Component Usage Component
= = Interface Controller
Component Usage Usage of a =
Component Usage Usage of a
„ Component Reuse Component Interface
„ Separation of Controller
Concerns „ Lifecycle „ Context Mapping
„ Emebedding Management „ Serverside Eventing
Interface Views „ Method Calls

© SAP AG 2006, SAP TechEd ’06 / CD354 / 31


Web Dynpro DCs – Allowing Reuse and Extensibility

Package Web Dynpro Components into Development


Components
„ A development component is …
– unit for packaging, building and transportation in SAP's infrastructure (NWDI)
– mapped to a project in the NetWeaver Developer Studio
„ Development Components can have usage dependencies, which must
be defined explicitly.
„ Public Parts of a Development Component expose visible entities inside
a DC to entities outside a DC.

Public Part

Web Dynpro
Web Dynpro Development
Model
Component Component
Component
(DC)

© SAP AG 2006, SAP TechEd ’06 / CD354 / 32


DC Separation of Web Dynpro Entities

Web Dynpro DC

UI
Component

UI DC DC Usage Relation

Public Part

add to PP

Model Model
Component Interface

Model DC Web Dynpro DC

© SAP AG 2006, SAP TechEd ’06 / CD354 / 33


VERSION_03 – Adding a Root Component

„Starting different UIs with different


application URLs is not „Exactly.
„configurable“! Web Dynpro
Components can
I must create a single root easily be embedded
component to visually embed my into view
two UI component interface views. compositions using
the special
This root component can then be ViewContainer-
started with one application URL.“ UIElement.

© SAP AG 2006, SAP TechEd ’06 / CD354 / 34


VERSION_03
Adding a Root
Component

Root

My UI Cust UI
DC 1 DC 4 DC 2

DC 3
Model Model
Interface
© SAP AG 2006, SAP TechEd ’06 / CD354 / 35
What‘s a Root Component

The Root Component of a Web Dynpro Application

„ Single point of entry for a component-based Web Dynpro


application

„ Exposes component interfaces view(s) to Web Dynpro


application(s) to be started in a Web Dynpro Client

„ Embeds other components like …


– UI components for user interaction
Root
– Model component
– Reusable service components
My UI Cust UI

„ Manages manual
lifecycles of used components Model

Model
Interface

© SAP AG 2006, SAP TechEd ’06 / CD354 / 36


Emebdding Component Interface Views

Component Interface View RootView in View Designer

Visual interface of a Web Dynpro


component which can be embedded
in a Window like a conventional
view.

To be embedded in a view layout ViewContainer-


using the ViewContainerUIElement. UIElement

Web Dynpro
Explorer

Component
Inteface View

Window in Navigation Modeler

© SAP AG 2006, SAP TechEd ’06 / CD354 / 37


VERSION_04 – Defining External Context Mapping

„How can I access model data „Yes, that‘s a


in a UI component whithout feasible alternative.
defining a model component
usage? It is code-free and
needs no model
I will apply external context component usage in
mapping instead to feed both UI the UI components.
components with model data.“ But the model usage
is still needed“

© SAP AG 2006, SAP TechEd ’06 / CD354 / 38


VERSION_04
Defining External
Context Mapping

Root

My UI Cust UI
DC 1 DC 4 DC 2

DC 4
Model
Model
Interface
© SAP AG 2006, SAP TechEd ’06 / CD354 / 39
External Context Mapping

External Context Mapping allows to map the interface context of


a child component to the data context of the parent component.

External Context Mapping Preparation


„ The „externally mappable“ context elements of the child component‘s
interface context must be defined as isInput=true elements.

External Context Mapping Definition


„ The context mapping relation is externally defined by the parent
component on a child component usage level.

Note
Top-level context attributes cannot be declared as input elements and are
thus not externally mappable.

Define such attributes in a top-level context node with cardinality 1..1 instead.

© SAP AG 2006, SAP TechEd ’06 / CD354 / 40


External Context Mapping Chain in VERSION_04

External Context Mapping Root


Component

Model UI
Component Usage Component Usage

isInput=true
Component Component
Interface Context Interface Context

Component
Component Context
Context

View
Model Context
Component
UI Component

© SAP AG 2006, SAP TechEd ’06 / CD354 / 41


VERS_04
30 Minutes

EXERCISE 1
External Context
Mapping
© SAP AG 2006, SAP TechEd ’06 / CD354 / 42
VERSION_04 – Applying the Component Interface Strategy

„I must overcome the tight


coupling of the Root component „Correct. With
with the two UI components! Component Interface
At design time I do not know the Definitions
customer‘s UI component he can apply the
implementation yet. I only know Strategy Pattern in
the contract it must fulfill.“ Web Dynpro.“

© SAP AG 2006, SAP TechEd ’06 / CD354 / 43


VERSION_05
Applying the
Component Inter-
face Strategy

Component Interface Definition

<<CID>>
Root
IUI
DC 4 DC 5

DC 3 DC 1 DC 2

Model
Model My UI Cust UI
Interface

© SAP AG 2006, SAP TechEd ’06 / CD354 / 44


Java Interfaces and the Strategy Design Pattern

Java Interfaces
<<class>> <<interface>>
„ In Java an interface is a Sale IPayment
type, just as a class is a
type.

„ Like a class an interface CreditCard Cash


defines methods but never Payment Payment
Design Time
implements them.
Runtime
„ An interface is an
abstraction of a class <<class>>
<<class>>
independent from its 1 CreditCard
Sale
implementation. Payment

<<class>>
<<class>>
2 Cash
Sale
Payment

© SAP AG 2006, SAP TechEd ’06 / CD354 / 45


Java Interfaces and the Strategy Design Pattern

The Strategy Design Pattern in Java


Define a family of algorithms, encapsulate each one, and
make them interchangeable. Strategy lets the algorithm vary
independently from clients that use it.*

It embodies two main OO design principles:


„ encapsulate the concept that varies
„ program to an interface, not an implementation.

Good software = loosely coupled collection of interchangeable parts

Bad software = monolithic, tightly coupled system

Loose coupling makes your software much more extensible,


maintainable, and reusable.

© SAP AG 2006, SAP TechEd ’06 / CD354 / 46


* Chapter 1 of the Gang of Four‘s (GOF) Design Patterns
Strategy Pattern and Component Interface Definitions

Component Interface Component


Definitions (CIDs) Interface Definition
(Suffix CompI)
Allow decoupling Web Dynpro Root
Components Component
„ Define a component interface
without an implementation
<<CID>>
„ Interface can be implemented ISalesOppUI
by one or more components manage
lifecycle
Benefits J Decoupling
„ Component user can program implement
against separately defined
component interface
(implementation is hidden)
MyUI CustUI
„ Component implementation Component Component
can be provided (or selected)
later on (plug-in concept)

© SAP AG 2006, SAP TechEd ’06 / CD354 / 47


Component Instance Creations at Runtime

Root Component <<CID>>


Component Usage ISalesOppUI

implements
Design Time

creatComponent() Runtime

RootComp: IWDComp.Usg.: MyUIComp:


Component Component Component t1
Instance Usage Instance

CustUIComp:
Component t2
Instance

© SAP AG 2006, SAP TechEd ’06 / CD354 / 48


Using Component Interface Definitions at Design Time

With a Component Interface Usage you can …

„ Embed component interface views

„ Define navigation plugs

„ Define context mapping relations

„ Subscribe to component interface events

„ Invoke the IExternal-API of the component interface in your


custom code

This means, at design time you can …

work with a component interface definition in the same way like you
work with a component implementation.

© SAP AG 2006, SAP TechEd ’06 / CD354 / 49


CIDs and Component Lifecycle Management

Creating Component Instance for a CID Usage

Naturally a component usage which points to a CID (component


interface usage) has a manual lifecycle.

To create a component instance for a component interface usage


you must pass the fully qualified component name to the
IWDComponentUsage-API:

public void createComponent(


java.lang.String componentName,
java.lang.String deployableObjectName)

© SAP AG 2006, SAP TechEd ’06 / CD354 / 50


Code Sample – Creating a Component Instance

Creating a Component Instance for a CID Usage


//@@begin javadoc:createUICompInstance()
/** Declared method. */
//@@end
public void createUICompInstance( )
{
//@@begin createUICompInstance()
IWDComponentUsage iSalesOppUICompUsg =
wdThis.wdGetISalesOppUIComponentUsage();

if (iSalesOppUICompUsg.hasActiveComponent())
iSalesOppUICompUsg.deleteComponent();
else
iSalesOppUICompUsg.createComponent(
"com.itelo.teched.cd354.so.vers05.comp.myui.MyUIComp",
"itelo.com/teched~cd354~so~vers05~myui");
//@@end
}

© SAP AG 2006, SAP TechEd ’06 / CD354 / 51


Fully Qualified DC Name = Deployable Object Name

The deployable object name (fully qualified DC name ) of a


deployed Web Dynpro DC can be read from the telnet console:

DC name entered in
the NW Dev Studio

itelo.com/teched~cd354~so~verso~custui
deployable
object name

© SAP AG 2006, SAP TechEd ’06 / CD354 / 52


F. Q. Component Name = Deployable Object Part Name

The deployable object part name (component name ) of a Web


Dynpro component can be read from the component controller‘s
Properties tab: <package name>.<component name>

com.itelo.teched.cd354.vers05.comp.custui.CustUIComp

© SAP AG 2006, SAP TechEd ’06 / CD354 / 53


VERSION_06 – Configuring UI Component Implementations

„Finally I eliminate the hard-coded


component instance creation. „Congratu-
To change the UI component lations, you
implementation without modifying found the best
the controller code I develop a solution:
Locator component which Dependency
determines the component Injection applied
implementation configured by an to Web Dynpro
Admin“. Components!“

© SAP AG 2006, SAP TechEd ’06 / CD354 / 54


VERSION_06
Configuring UI
Component Im-
plementations

Component
Locator

<<CID>>
Config Root
IUI
DC 6 DC 3 DC 5

DC 2 DC 1 DC 2

Model Model My UI Cust UI


Interface

© SAP AG 2006, SAP TechEd ’06 / CD354 / 55


Final Component Architecture

configure used
component
implementation
SAP J2EE Administrator
Engine DB

read
configu-
ration

<<CID>>
LocatorComp RootComp
ISalesOppUI
DC 6 DC 3 DC 5

DC 2 DC 1 DC 2

Model ModelComp MyUIComp Cust UIComp


Interface

© SAP AG 2006, SAP TechEd ’06 / CD354 / 56


Using a Locator Component for Dependency Injection

What the Locator Component does …

„ Deploys the default configuration (fully qualified component


name) of the component implementation to be used by the root
component
„ Reads the configured component name from the database at
runtime (IWDConfiguration-API, WDConfiguration
service class)
„ Exposes the configuration data to the root component via its
interface context. The root component can access this data based
on context mapping.

Context-based Dependency Injection

With this approach the root component has no designtime dependency


to the component implementation. The locator component injects this
dependency to the root component at runtime via context mapping.

© SAP AG 2006, SAP TechEd ’06 / CD354 / 57


Configuration Properties File

„ The configuration properties file uiCompImpl.properties


is deployed with the Web Dynpro DC comprising the Locator
Component.

„ Two keys-value pairs specify the fully qualified name of the


default component implementation to be created at runtime.

Web Dynpro DC comprising the Locator Component

© SAP AG 2006, SAP TechEd ’06 / CD354 / 58


Code Sample – Reading Configuration Data (1)

Reading a Configuration File with the WDConfiguration-API


public void readConfiguration( )
{
//@@begin readConfiguration()
try {
// load configuration properties file.
IWDConfiguration configuration =
WDConfiguration.getConfigurationByName(
wdComponentAPI.getDeployableObjectPart(),
"uiCompImpl");

}
catch (WDInvalidConfigParameterException e) {

} catch (WDConfigurationNotFoundException e) {

}
//@@end
} LocatorComp.java
© SAP AG 2006, SAP TechEd ’06 / CD354 / 59
Code Sample – Reading Configuration Data (2)

Reading a Configuration File with the WDConfiguration-API


public void readConfiguration( )
{
//@@begin readConfiguration()
try {

// read configuration data.
wdContext.currentConfiguredUICompImplElement()
.setDCName(configuration.getStringEntry(
ConfigKey.DC_NAME));

wdContext.currentConfiguredUICompImplElement()
.setComponentName(configuration.getStringEntry(
ConfigKey.COMP_NAME));
}
catch (WDInvalidConfigParameterException e) {

} catch (WDConfigurationNotFoundException e) {

}
//@@end LocatorComp.java
}
© SAP AG 2006, SAP TechEd ’06 / CD354 / 60
Code Sample – Reading Configuration Data (3)

Reading a Configuration File with the WDConfiguration-API


public void readConfiguration( )
{
//@@begin readConfiguration()
try {

}
catch (WDInvalidConfigParameterException e) {
wdComponentAPI.getMessageManager()
.reportException(e.getLocalizedMessage(), true);
} catch (WDConfigurationNotFoundException e) {
wdComponentAPI.getMessageManager()
.reportException(e.getLocalizedMessage(), true);
}
//@@end
}

LocatorComp.java
© SAP AG 2006, SAP TechEd ’06 / CD354 / 61
Visual Admin – Configuring the Component Implementation

The deployed configuration file can be edited in the Visual


Administrator using the Configuration Adapter Service

© SAP AG 2006, SAP TechEd ’06 / CD354 / 62


Refreshing the Configured Sales Opportunities Application

Browser
Refresh

© SAP AG 2006, SAP TechEd ’06 / CD354 / 63


VERS_06
30 Minutes

EXERCISE 2
Configuring the used UI
Component Implementation
© SAP AG 2006, SAP TechEd ’06 / CD354 / 64
Summary

„ Web Dynpro Components are the key to extensible,


reusable and manageable Web Dynpro software.

„ The NetWeaver Development Infrastructure provides


functions for jointly developing professional, component-
based Web Dynpro applications.

„ Web Dynpro Component Interfaces are used to loosely


couple client components with the implementing service
components.

„ A Locator Component is used to retrieve the fully


qualified name of the configured component
implementation at runtime (context-based dependency
injection)

© SAP AG 2006, SAP TechEd ’06 / CD354 / 65


Adaptive Web Service Model

Componentization in Practice

Web Dynpro in the Next Major Release …


Component Architecture – Window Plugs

Introduced Inbound and Outbound Plugs for Windows

Simplified navigation across component borders


„ Allow non-view-triggered navigation
– requires no serverside eventing + navigation dispatcher view like in NW04
and NW04s
„ Plugs can now be defined for windows
„ Plugs can be fired within the new window controllers …

© SAP AG 2006, SAP TechEd ’06 / CD354 / 67


Component Architecture – Window Controller

A Window Controller can have the following declarations …


„ Required controllers i.e. controller usage relations
„ Window properties: Title, Help Link, Help Description, Custom Padding
(disable default padding around the window border)
„ Plugs (see nexts slide) like in Views
„ Public controller methods
„ Context
„ Interface View Implementations
„ Window View Containers (correspond to ViewContainerUIElements
within View layouts)

© SAP AG 2006, SAP TechEd ’06 / CD354 / 68


Secondary Help

Display Secondary Help texts in a sidebar

Based on NW Portal Technology

© SAP AG 2006, SAP TechEd ’06 / CD354 / 69


New Calendar UI Element (1)

New Outlook-like Calendar UI Element with year, week and day


perspectives

© SAP AG 2006, SAP TechEd ’06 / CD354 / 70


New Column Layout

Column Layout

Allows aligned positioning of UI Elements across container borders

Solves complex lay outing problems concerning vertical alignments


(for example alignment of form fields in different groups)

ColumnLayout

MatrixLayout

© SAP AG 2006, SAP TechEd ’06 / CD354 / 71


Further Table Enhancements

„ Grouping (like Outlook – grouping by today, yesterday, week etc.)


„ Grid lines can be switched of, Hide vertical grid lines only
„ Fixed rows and columns
„ Hierarchical headers
„ Grouping values
„ Cell variants
„ Selection FineTuning
– Select/deselect all
– Selectable columns
– Selection menu
– Prevent selection of certain rows
„ Disable row selection
„ Multi sorting ability and visualize filtered column
„ Better support of popup menus (header, disable etc.)
„ Scroll Bar instead of paging buttons

© SAP AG 2006, SAP TechEd ’06 / CD354 / 72


Changes in the Tools for Web Dynpro

Component Modeler
New graphical tool for creation of …
„ Web Dynpro Components
„ Component Interface Definitions,
implementations and inheritance
relations
„ Models and Model Usages
It serves as the main entry point for
Web Dynpro development and
provides an architectural overview
of your Wed Dynpro Components.

© SAP AG 2006, SAP TechEd ’06 / CD354 / 73


Changes in the Tools for Web Dynpro

Designtime (SAP NetWeaver Developer Studio)

Improved WYSIWYG preview in View Editor


Designtime

Runtime

© SAP AG 2006, SAP TechEd ’06 / CD354 / 74


Changes in the Tools for Web Dynpro

Data Modeler Improvements


„ Comes up as an Eclipse Editor

Navigation Links
„ Create navigation links without
adding plugs first

Web Dynpro Explorer


„ Filter various project types

Context Debugger
„ Browsing of context structures to explore nodes, node elements and attributes
„ On-the-fly changing an attribute's value as long as it is string-based or primitive
„ Providing additional properties of nodes and attributes (in Properties View)
„ Navigation from a selected Context object in debugger to its design-time source
in Context editor

© SAP AG 2006, SAP TechEd ’06 / CD354 / 75


Summary – Web Dynpro Highlights in the Next Release

„ Enhanced Web Dynpro UI Element Library with new elements and


new ColumnLayout
– RowRepeater, Calendar, MessageBasedTrigger, FormattedTextView
– ColumnLayout solves complex alignment problems across container
borders

„ Highly Enhanced Component Architecture


– Window Controller, Window Plugs
– View Containers within Component Interface View Definitions
– Inheritance of Component Interfaces

„ Support of CCTS Data types within Web Dynpro Context and UI


„ Enhanced Context capabilities
– Universal context elements overcome separation in value/model
elements
– CMI-based: Paging, Sorting, Filtering

„ Much More ….
© SAP AG 2006, SAP TechEd ’06 / CD354 / 76
Further Information

Î Public Web
www.sap.com
SAP Developer Network: www.sdn.sap.com Î Applications Server Î
Web Dynpro
SAP Customer Services Network: www.sap.com/services/

Î Related SAP Education Training Opportunities


http://www.sap.com/education/

Î Related Workshops/Lectures at SAP TechEd 2006


CD155, Web Dynpro Java- Grasping the Basics
CD108, User Interface Framework Discussion: Web Dynpro, JavaServer
Faces, Struts and Others
SOA111, User Interface Strategy for SAP

© SAP AG 2006, SAP TechEd ’06 / CD354 / 77


THANK YOU FOR YOUR
ATTENTION !

QUESTIONS – SUGGESTIONS – DISCUSSION

© SAP AG 2006, SAP TechEd ’06 / CD354 / 78


Feedback
Please complete your session evaluation.

Be courteous — deposit your trash,


and do not take the handouts for the following session.

Thank You !

© SAP AG 2006, SAP TechEd ’06 / CD354 / 79

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy