WD Experts
WD Experts
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
Componentization in Practice
Outlook
Why WebServices?
Web Services
Security issues
Only user and password was possible
No SSO
WS logical destinations
configuration of connection, authentication, encryption settings
currently only for WS providers supporting WSIL
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
WS logical destinations
support for destinations based on WSDL instead of WSIL
//@@begin wdDoInit()
wdContext.nodeRequest_GetProjectListByEmployee().bind
(new Request_GetProjectListByEmployee(model));
wdContext.nodeRequest_GetAllEmployees2().bind(new
Request_GetAllEmployees2(model));
//@@end
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
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
From the port parameter passed a WS-Runtime „Service Extension Interface“ can
be created which allows typed access to invocation settings
Componentization in Practice
Outlook
The Customer‘s Development Task
Web Dynpro
Customer Application
Developer
DC 1
My UI + Cust UI Model
Model Interface
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
1 Correctness 5 Maintainability
2 Scalability 6 Flexibility
3 Productivity 7 Understandability
4 Reusability 8 Composability
My UI Cust UI
DC 1 DC 2
DC 3
Model
Model
Interface
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
Component Usage
At runtime it is associated
with a concrete component
instance
creatComponent()
Component Component
Usage Instance
At runtime the component usage is represented by an object of
type IWDComponentUsage.
Public Part
Web Dynpro
Web Dynpro Development
Model
Component Component
Component
(DC)
Web Dynpro DC
UI
Component
UI DC DC Usage Relation
Public Part
add to PP
Model Model
Component Interface
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
Manages manual
lifecycles of used components Model
Model
Interface
Web Dynpro
Explorer
Component
Inteface View
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
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.
Model UI
Component Usage Component Usage
isInput=true
Component Component
Interface Context Interface Context
Component
Component Context
Context
View
Model Context
Component
UI Component
EXERCISE 1
External Context
Mapping
© SAP AG 2006, SAP TechEd ’06 / CD354 / 42
VERSION_04 – Applying the Component Interface Strategy
<<CID>>
Root
IUI
DC 4 DC 5
DC 3 DC 1 DC 2
Model
Model My UI Cust UI
Interface
Java Interfaces
<<class>> <<interface>>
In Java an interface is a Sale IPayment
type, just as a class is a
type.
<<class>>
<<class>>
2 Cash
Sale
Payment
implements
Design Time
creatComponent() Runtime
CustUIComp:
Component t2
Instance
work with a component interface definition in the same way like you
work with a component implementation.
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
}
DC name entered in
the NW Dev Studio
itelo.com/teched~cd354~so~verso~custui
deployable
object name
com.itelo.teched.cd354.vers05.comp.custui.CustUIComp
Component
Locator
<<CID>>
Config Root
IUI
DC 6 DC 3 DC 5
DC 2 DC 1 DC 2
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
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)
LocatorComp.java
© SAP AG 2006, SAP TechEd ’06 / CD354 / 61
Visual Admin – Configuring the Component Implementation
Browser
Refresh
EXERCISE 2
Configuring the used UI
Component Implementation
© SAP AG 2006, SAP TechEd ’06 / CD354 / 64
Summary
Componentization in Practice
Column Layout
ColumnLayout
MatrixLayout
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.
Runtime
Navigation Links
Create navigation links without
adding plugs first
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
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/
Thank You !