litesoft
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
|
package org.litesoft.GWT.eventbus;
import java.util.*;
import org.litesoft.GWT.eventbus.client.*;
import org.litesoft.GWT.eventbus.client.eventpackages.*;
import org.litesoft.GWT.eventbus.client.nonpublic.*;
import org.litesoft.GWT.eventbus.server.*;
import com.google.gwt.user.client.*;
@SuppressWarnings({"UnusedDeclaration"})
public class Documentation_OpenNewWindowProcess
{
// Client(1)/Server Initiated
public void step1( EventBus pEventBus )
{
RequestNewClientEventPackage zPackage = new RequestNewClientEventPackage( "Client" );
// or subclass if new Child needs data from the Parent...
pEventBus.publish( zPackage );
}
// Server Response
public void step2( EventBus pEventBus, String zNewEncodedClientId )
{
/**
* @see AbstractServerApp.RequestNewClientListener eventReceivedVia(...)
*/
// create a new clientIdNumber for the new window
// creates a new Temporary ServerEventBus with the new window's clientIdNumber and
// pInitialEventForNewWindow and all the current ServerEventBus' Broser Data
pEventBus.publish( new OpenNewClientEventPackage( "Server", zNewEncodedClientId ) );
}
// Client(1) Response
public void step3( String pOurURL, String pWindowNameBase, OpenNewClientEventPackage pEvent )
{
/**
* @see AbstractClientEventBusApp.OpenNewClientListener eventReceivedVia(...)
*/
Window.open( pOurURL, //
pWindowNameBase + pEvent.getNewEncodedClientId(), //
"" ); // New Window Options
}
// Client(2) Initialization
public void step4()
{
/**
* @see AbstractClientEventBusApp onModuleLoad
*/
// String zEncodedClientId = getEncodedClientId(); **** extracted from the Window name!
// rpc to server - initialize( pEncodedClientId )
/**
* @see AbstractServerApp initialize(...)
*/
}
// Server Response
public AppInitializationResult step5( int pClientIdNumber, String pEncodeEncodedClientId,
String zApplicationVersion, AuthenticationData zAuthenticationData )
{
/**
* @see AbstractServerApp initialize(...) initializeForBrowserPageRequest(...)
*/
// get existing ServerEventBus for pClientIdNumber (Temporary ServerEventBus from step2)
// creates a new 'real' ServerEventBus with the pClientIdNumber and
// existing ServerEventBus for pClientIdNumber's Broser Data
// register/subscribe all listeners for server side new client
ChannelServicePackage eventsResultingFromRegisterSubscribe = null;
// rpc respond with
return new AppInitializationResult( pClientIdNumber, //
pEncodeEncodedClientId, //
new HashMap<String, String>(), // Client Config Data
eventsResultingFromRegisterSubscribe, //
zApplicationVersion, //
zAuthenticationData );
}
// Client(2) Initialization
public void step6( AppInitializationResult result )
{
/**
* @see AbstractClientEventBusApp.MyAsyncCallback onSuccess
*/
// Set the Windows Title if debugging
// UtilsGwt.setWindowTitleWithWindowName( Window.getTitle() );
// create ClientEventBus (ceb) in suspend mode
ChannelServicePackage events = result.getChannelServicePackage();
// propagate events to ClientEventBus
// register/subscribe:
// initialSubscriptions( ceb );
// addEventListenersForNewClient( ClientEventBus pClientEventBus )
// release() the ClientEventBus distribute all the saved up events
// call finalPrep / appReady with
// ClientEventBus,
result.getAuthenticationData();
}
}
|
Revision |
Author |
Commited |
Message |
2
|
GeorgeS
|
Sun 07 Feb, 2010 12:50:58 +0000 |
|