05 Controllers and Context Programming
Transcript of 05 Controllers and Context Programming
-
7/24/2019 05 Controllers and Context Programming
1/19
Page 1 Protection notice / Copyright Siemens AG 2007. All rights reserved.
Controller and Context Programming
-
7/24/2019 05 Controllers and Context Programming
2/19
Page 2 Protection notice / Copyright Siemens AG 2007. All rights reserved.
Standard Controller Hook Methods
Controller
Implementation
Standard
Hoo
!ethods
Instance
!ethods
Conte"t
Root Node
#e$%ired
Controllers
Controller
Inter&ace
'ther ()Controllers
C%stom
Controller
*%siness
+ogic
,!odels-
Created by explicit declaration or coding Created by the Web Dynpro rame!ork "WD#
Component
sage'ther ()
Components
-
7/24/2019 05 Controllers and Context Programming
3/19
Page $ Protection notice / Copyright Siemens AG 2007. All rights reserved.
Standard Hook Methods %or allcontrollers
&ll controllers ha'e these t!o standard hook methods(
)he method !ill only be called d*ring the controller+s li%ecycle i% theycontain coding(
method ())'II.
endmethod.method ())'1I.
endmethod.
-
7/24/2019 05 Controllers and Context Programming
4/19
Page , Protection notice / Copyright Siemens AG 2007. All rights reserved.
Controller -nstance Methods
Controller
Implementation
Standard
Hoo
!ethods
Instance
!ethods
Conte"t
Root Node
#e$%ired
Controllers
Controller
Inter&ace
'ther ()
Controllers
C%stom
Controller
*%siness+ogic
,!odels-
Created by explicit declaration or coding Created by the Web Dynpro rame!ork "WD#
Component
sage
'ther ()
Components
-
7/24/2019 05 Controllers and Context Programming
5/19
Page . Protection notice / Copyright Siemens AG 2007. All rights reserved.
Controller &ttrib*tes and /tility methods
&ttrib*tes %or the controller can be created "p*blic or pri'ate#
Ar3itrary methods can 3e created 4 55.
-
7/24/2019 05 Controllers and Context Programming
6/19
Page 0 Protection notice / Copyright Siemens AG 2007. All rights reserved.
Standard Controller &ttrib*tesWDCN)34) and WD)H-S
()6C'1 and ()6HIS
present in any WD controller "except inter%ace and inter%ace 'ie!controller#(
WD)H-S 5 sel% re%erence o% the local inter%ace6 type depends on thecontroller type(
WDCN)34) 5 re%erence to the context o% associated controller(
-
7/24/2019 05 Controllers and Context Programming
7/19Page 7 Protection notice / Copyright Siemens AG 2007. All rights reserved.
Standard Controller &ttrib*teWDCMPCN)R883R
()6C'!P6C'#'++1#
present in any WD controller(
re%erence to the component controller !ith access to all p*blic methodsand attrib*tes(
&ttrib*te !ill a*tomatically assigned to all 'ie! controllers !hen a 'ie!is created(
or all other controller the WDCMPCN)R883R attrib*te!illbe assigned6 !hen the properties o% the controller the componentcontroller is *sed(
-
7/24/2019 05 Controllers and Context Programming
8/19Page 9 Protection notice / Copyright Siemens AG 2007. All rights reserved.
Standard Hook Methods : ComponentController
otenly a component controller has these hook methods(
())'*18'#1A9IGAI'-t is exec*ted be%ore the na'igation stack is processed
())'P'SP#'C1SSIG
Data %rom m*ltiple components can be 'alidated be%ore the next step isexec*te
-
7/24/2019 05 Controllers and Context Programming
9/19Page ; Protection notice / Copyright Siemens AG 2007. All rights reserved.
&ccess to &ttrib*te o% Node 3lement -
8lights ..nC&RR-DCNN-D2C&RR-D
CNN-D:C&RR-D
CNN-D
Context Root
-
7/24/2019 05 Controllers and Context Programming
10/19Page 1< Protection notice / Copyright Siemens AG 2007. All rights reserved.
&ccess to &ttrib*te o% Node 3lement --
8lights..nC&RR-D
CNN-D2C&RR-D
CNN-D:C&RR-D
CNN-D
Context Root
-
7/24/2019 05 Controllers and Context Programming
11/19Page 11Protection notice / Copyright Siemens AG 2007. All rights reserved.
&ccess to &ttrib*te o% Node 3lement ---
8lights
..nC&RR-D
CNN-D2C&RR-D
CNN-D :C&RR-D
CNN-D
Context Root
-
7/24/2019 05 Controllers and Context Programming
12/19Page 12 Protection notice / Copyright Siemens AG 2007. All rights reserved.
&ccess to all Static &ttrib*tes o% aNode 3lement
8lights..nC&RR-D
CNN-D2C&RR-D
CNN-D:C&RR-D
CNN-D
Context Root
-
7/24/2019 05 Controllers and Context Programming
13/19Page 1$ Protection notice / Copyright Siemens AG 2007. All rights reserved.
&ccess to all 3lements o% a Node
8lights..nC&RR-D
CNN-D2C&RR-D
CNN-D:C&RR-D
CNN-D
Context Root
-
7/24/2019 05 Controllers and Context Programming
14/19Page 1, Protection notice / Copyright Siemens AG 2007. All rights reserved.
=inding o% an 3lement to a Node -
8+IGHSContext Root
-
7/24/2019 05 Controllers and Context Programming
15/19Page 1. Protection notice / Copyright Siemens AG 2007. All rights reserved.
=inding o% an 3lement to a Node --
8+IGHSContext Root
-
7/24/2019 05 Controllers and Context Programming
16/19Page 10 Protection notice / Copyright Siemens AG 2007. All rights reserved.
=inding o% an 3lement to a Node ---
8+IGHS
Context Root
-
7/24/2019 05 Controllers and Context Programming
17/19Page 17 Protection notice / Copyright Siemens AG 2007. All rights reserved.
8+IGHSContext Root
data: Node_Flights type ref to If_Wd_Context_Node0 First_flight_lem type ref to If_Wd_Context_lement.
* navigate from
-
7/24/2019 05 Controllers and Context Programming
18/19
Page 19 Protection notice / Copyright Siemens AG 2007. All rights reserved.
Static &ttrib*tes and =inding o% a3lement to a Node
data: Node_Flights type ref to If_Wd_Context_Node0 &tr4_flights type If_Component'ontroller("lement_flights.
* navigate from .* 5ind ne) element to node Node_flights"5ind_str4't4re+ ne)_item ( &tr4_flights
&T_INITI1#_#7NT& ( a5ap_false -.
-
7/24/2019 05 Controllers and Context Programming
19/19
Page 1; Protection notice / Copyright Siemens AG 2007. All rights reserved.
8+IGHSContext Root
. append &tr4_flights to lt_flights.
* get node referen'e Node_Flights ( )d_'ontext"get_'hild_node+ F#I$%T& -.
* 5ind lo'al ta5le Node Flights"5ind ta5le+ lt flights -.
C&RR-D
CNN-D
:
Ita3