Subversion Repository Public Repository

litesoft

Diff Revisions 949 vs 950 for /trunk/Java/DATT/src/org/litesoft/datt/client/DATT.java

Diff revisions: vs.
  @@ -1,243 +1,242 @@
1 - package org.litesoft.datt.client;
2 -
3 - import org.litesoft.GWT.client.*;
4 - import org.litesoft.GWT.client.command.*;
5 - import org.litesoft.GWT.client.command.queue.*;
6 - import org.litesoft.GWT.client.context.*;
7 - import org.litesoft.GWT.client.dev.*;
8 - import org.litesoft.GWT.client.logging.*;
9 - import org.litesoft.GWT.client.rpc.*;
10 - import org.litesoft.GWT.client.view.*;
11 - import org.litesoft.GWT.client.widgets.*;
12 - import org.litesoft.GWT.client.widgets.datatables.*;
13 - import org.litesoft.bo.views.*;
14 - import org.litesoft.bo.views.communication.*;
15 - import org.litesoft.commonfoundation.base.*;
16 - import org.litesoft.commonfoundation.typeutils.*;
17 - import org.litesoft.commonfoundation.typeutils.gregorian.*;
18 - import org.litesoft.core.*;
19 - import org.litesoft.datt.client.accessors.*;
20 - import org.litesoft.datt.client.boviews.*;
21 - import org.litesoft.datt.client.ui.views.admin.*;
22 - import org.litesoft.datt.client.ui.views.home.*;
23 - import org.litesoft.datt.client.ui.views.stories.*;
24 - import org.litesoft.datt.client.ui.widgets.*;
25 - import org.litesoft.logger.*;
26 - import org.litesoft.loggerconfig.*;
27 - import org.litesoft.security.*;
28 - import org.litesoft.uispecification.*;
29 -
30 - import com.google.gwt.user.client.*;
31 - import com.google.gwt.user.client.rpc.*;
32 - import com.google.gwt.user.client.ui.*;
33 -
34 - public class DATT extends AbstractClientMainAppEntryPoint implements ViewDefs,
35 - RestrictedResourceSwitcherCallBack {
36 - static {
37 - UserViewAccessControlFactory.setViewDefSecuritySets( ViewDefs.SECURITY_SETS );
38 - }
39 -
40 - private VACMproxy mACM = new VACMproxy();
41 -
42 - // pull in all the factories. This can be broken out into different modules if compile becomes too slow.
43 - private ViewManagerImpl mVM = new ViewManagerImpl( mACM, //
44 - // Admin
45 - new ChangePasswordFactory<UserView>( HOME_SECTION_ADMIN, ADMIN_CHANGE_PASSWORD ), //
46 - new MyProfileFactory(), //
47 - new ReportsFactory(), //
48 - new UsersFactory(), //
49 - new StoriesFactory(), //
50 - new StoryTasksFactory(), //
51 - new ReprioritizeFactory(), //
52 - new InitialPrioritizingFactory(), //
53 - new MergeStoriesFactory(), //
54 - new MergeStoriesStepTwoFactory(), //
55 - new MergeStoriesStepThreeFactory(), //
56 - new RestrictedResourceEditorFactory(), //
57 - new RestrictedResourceManagementFactory(), //
58 - // Reports...
59 - // new MedicationTrackingReportFactory(), //
60 - // HOME!
61 - new HomeFactory() );
62 -
63 - public DATT() {
64 - super( new AppNames( "Distributed Agile Team Tracker", "DATT" ) );
65 -
66 - // add in all the factory-less screens. This can be broken out into different modules if compile becomes too slow.
67 - // mVM.add( ADMIN_RESTRICTED_RESOURCE_MANAGEMENT );
68 - }
69 -
70 - @Override
71 - public void onAppLoad() {
72 - System.out.println( "DevMode " + Dev.state() );
73 -
74 - replaceAppPanel();
75 -
76 - super.onAppLoad();
77 -
78 - CScomm.setInstance( new GwtCScomm( null, mVM, new AppInitializationCallback() ) );
79 - }
80 -
81 - public void finishAppLoad() {
82 - ClientContext zContext = ClientContext.get();
83 -
84 - Dev.init( zContext );
85 -
86 - AppPanel zAppPanel = new AppPanel( Dev.isDevMode() ? 1 : 0 ); // 1 = see Red Line
87 -
88 - CurrentUserViewAccessor zCUA = new CurrentUserViewAccessor( zAppPanel, mACM );
89 - CurrentRestrictedResourceViewAccessor zCSA = new CurrentRestrictedResourceViewAccessor( zAppPanel );
90 - CurrentRestrictedResourceOptionsAccessor zCRROA = new CurrentRestrictedResourceOptionsAccessor( new RestrictedResourceSwitcher( zAppPanel, this ) );
91 -
92 - WindowSizingPanel.setContent( zAppPanel );
93 -
94 - UserViewDataProvider zUserViewDataProvider = UserViewDataProvider.getInstance();
95 -
96 - RestrictedResourcePickerDialogViewFactory zRRPDF =
97 - new RestrictedResourcePickerDialogFactory<RestrictedResourceView>( "Select Queue", RestrictedResourceViewDataProvider.getInstance(),
98 - RestrictedResourceViewMetaData.getInstance(),
99 - new RestrictedResourceViewSupportFactory<RestrictedResourceView>() {
100 - @Override
101 - public TableDataReloadable createTable(
102 - FilteringTableModel<RestrictedResourceView> pFilter,
103 - TableClickCommand<RestrictedResourceView>
104 - pRestrictedResourceViewTableClickCommand ) {
105 - return new RestrictedResourceViewTable( pFilter,
106 - pRestrictedResourceViewTableClickCommand );
107 - }
108 -
109 - @Override
110 - public QBEinputPanelAccessorWithCtrlMap<RestrictedResourceView>
111 - createFieldPanel() {
112 - return new RestrictedResourcePickerFieldsPanel();
113 - }
114 - } );
115 -
116 - zContext.set( CurrentRestrictedResourceViewAccessor.class, zCSA );
117 - zContext.set( AbstractCurrentRestrictedResourceViewAccessor.class, zCSA );
118 -
119 - zContext.set( CurrentUserViewAccessor.class, zCUA );
120 - zContext.set( AbstractCurrentUserViewAccessor.class, zCUA );
121 -
122 - zContext.set( LoginServerStateChecker.class, zUserViewDataProvider );
123 - zContext.set( SecurityUserViewDataProvider.class, zUserViewDataProvider );
124 -
125 - zContext.set( SecurityUserViewMetaData.class, UserViewMetaData.getInstance() );
126 -
127 - zContext.set( SuspendDialogViewFactory.class, new SuspendDialogFactory<UserView>() );
128 - zContext.set( LoginDialogViewFactory.class, new LoginDialogFactory<UserView>() );
129 - zContext.set( LoginPasswordResetDialogViewFactory.class, new ResetPasswordDialogFactory<UserView>() );
130 -
131 - zContext.set( ViewAccessControlManager.class, mACM );
132 - zContext.set( CurrentRestrictedResourceOptionsAccessor.class, zCRROA );
133 - zContext.set( RestrictedResourcePickerDialogViewFactory.class, zRRPDF );
134 - zContext.set( LoginPasswordResetAccessor.class, zCUA );
135 - zContext.set( StatusMessageSinc.class, zAppPanel );
136 - zContext.set( SingleWidgetPanel.class, zAppPanel );
137 - zContext.set( PageRefreshableProxy.class, zAppPanel );
138 - zContext.set( CommandQueue.class, new CommandQueue() );
139 - zContext.set( ScreenViewShower.class, mVM );
140 - zContext.set( DialogViewShower.class, mVM );
141 - zContext.set( ViewFactoryAccessor.class, mVM );
142 - zContext.set( NextDemoUserRequestHandler.class, new NextDemoUserRequestHandlerImpl() );
143 -
144 - mVM.initialize();
145 -
146 - System.err.println( new UtilDateAdaptor() + " | Application Client Ready" );
147 -
148 - PaddingProperty.setDefaults( 2, 10, 2, 6 );
149 -
150 - zAppPanel.setInfoMessage( "Hello" );
151 - }
152 -
153 - protected void initializeLoggerFactory() {
154 - //noinspection NonJREEmulationClassesInClientCode
155 - LoggerFactory.init( new ConfigurationLoggerLevel(), BrowserAsLogSyncFactory.INSTANCE );
156 - }
157 -
158 - private class AppInitializationCallback implements AsyncCallback<AppInitializationResult> {
159 - @Override
160 - public void onFailure( Throwable pThrowable ) {
161 - String message;
162 -
163 - if ( pThrowable instanceof InvocationException ) {
164 - // see javadoc for InvocationException
165 - message = "A connection could not be established with the server";
166 - } else if ( pThrowable instanceof IncompatibleRemoteServiceException ) {
167 - /*
168 - * This _should_ not happen to users, so long as the .nocache
169 - * file isn't cached by the client.
170 - */
171 - message = "Client and server versions are incompatible. Try ctrl-clicking\n" + //
172 - "or shift-clicking the browser refresh button, or clearing your\n" + //
173 - "browser's cache in 'Internet Options' / your browser's preferences. ";
174 - } else {
175 - // probably an application-specific execption on the server
176 - message = "An application error occured on the server";
177 - }
178 -
179 - reportFailure( pThrowable, "onFailure()", message );
180 - }
181 -
182 - @Override
183 - public void onSuccess( AppInitializationResult result ) {
184 - System.err.println( new UtilDateAdaptor() + " | Client AppInitialization" );
185 -
186 - if ( result == null ) {
187 - UtilsGwt.closeWindowNoConfirm( 5 );
188 - return;
189 - }
190 -
191 - try {
192 - new ClientConfiguration( result.getClientConfig() ); // This line must preceed the next
193 - initializeLoggerFactory(); // ......................... This line must follow the previous
194 -
195 - AlertManager.setVersion( "Version " + result.getApplicationVersion() );
196 -
197 - finishAppLoad();
198 - }
199 - catch ( RuntimeException e ) {
200 - reportFailure( e, "onSuccess()", null );
201 - }
202 - }
203 -
204 - private void reportFailure( Throwable pThrowable, String method, String message ) {
205 - pThrowable.printStackTrace(); // prints the trace in the GWT hosted shell
206 - String html = "<h1>Application Initialization Failed</h1>" + //
207 - "<p>" + message + "</p>" + //
208 - "<p>at " + ClassName.simple( this ) + "." + method + "</p>" + //
209 - "<p>Exception: </p>" + //
210 - "<p><pre>" + pThrowable + "</pre></p>";
211 - DOM.setInnerHTML( RootPanel.getBodyElement(), html );
212 - }
213 - }
214 -
215 - private static class NextDemoUserRequestHandlerImpl implements NextDemoUserRequestHandler {
216 - @Override
217 - public void nextDemoUser() {
218 - UserViewDataProvider.getInstance().nextDemoUser( new SimpleDataProviderCallBack() {
219 - @Override
220 - public void error( String pError ) {
221 - new ShowScreenCommand( ViewDefs.HOME, pError ).execute();
222 - }
223 - } );
224 - }
225 - }
226 -
227 - @Override
228 - public void switchToRestrictedResource( AlternateRestrictedResourceOption pAlternateOption ) {
229 - UserViewDataProvider.getInstance().attemptSwitchToRestrictedResource( (RestrictedResourceView) pAlternateOption, new SimpleDataProviderCallBack() {
230 - @Override
231 - public void error( String pError ) {
232 - if ( Strings.isNullOrEmpty( pError ) ) {
233 - PageRefreshableProxy zRefreshableProxy = ClientContext.get().checkGet( PageRefreshableProxy.class );
234 - if ( zRefreshableProxy != null ) {
235 - zRefreshableProxy.refreshPage();
236 - return;
237 - }
238 - }
239 - new ShowScreenCommand( ViewDefs.HOME, pError ).execute();
240 - }
241 - } );
242 - }
243 - }
1 + package org.litesoft.datt.client;
2 +
3 + import org.litesoft.GWT.client.*;
4 + import org.litesoft.GWT.client.command.*;
5 + import org.litesoft.GWT.client.command.queue.*;
6 + import org.litesoft.GWT.client.context.*;
7 + import org.litesoft.GWT.client.dev.*;
8 + import org.litesoft.GWT.client.logging.*;
9 + import org.litesoft.GWT.client.rpc.*;
10 + import org.litesoft.GWT.client.view.*;
11 + import org.litesoft.GWT.client.widgets.*;
12 + import org.litesoft.GWT.client.widgets.datatables.*;
13 + import org.litesoft.bo.views.*;
14 + import org.litesoft.bo.views.communication.*;
15 + import org.litesoft.commonfoundation.base.*;
16 + import org.litesoft.commonfoundation.typeutils.gregorian.*;
17 + import org.litesoft.core.*;
18 + import org.litesoft.datt.client.accessors.*;
19 + import org.litesoft.datt.client.boviews.*;
20 + import org.litesoft.datt.client.ui.views.admin.*;
21 + import org.litesoft.datt.client.ui.views.home.*;
22 + import org.litesoft.datt.client.ui.views.stories.*;
23 + import org.litesoft.datt.client.ui.widgets.*;
24 + import org.litesoft.logger.*;
25 + import org.litesoft.loggerconfig.*;
26 + import org.litesoft.security.*;
27 + import org.litesoft.uispecification.*;
28 +
29 + import com.google.gwt.user.client.*;
30 + import com.google.gwt.user.client.rpc.*;
31 + import com.google.gwt.user.client.ui.*;
32 +
33 + public class DATT extends AbstractClientMainAppEntryPoint implements ViewDefs,
34 + RestrictedResourceSwitcherCallBack {
35 + static {
36 + UserViewAccessControlFactory.setViewDefSecuritySets( ViewDefs.SECURITY_SETS );
37 + }
38 +
39 + private VACMproxy mACM = new VACMproxy();
40 +
41 + // pull in all the factories. This can be broken out into different modules if compile becomes too slow.
42 + private ViewManagerImpl mVM = new ViewManagerImpl( mACM, //
43 + // Admin
44 + new ChangePasswordFactory<UserView>( HOME_SECTION_ADMIN, ADMIN_CHANGE_PASSWORD ), //
45 + new MyProfileFactory(), //
46 + new ReportsFactory(), //
47 + new UsersFactory(), //
48 + new StoriesFactory(), //
49 + new StoryTasksFactory(), //
50 + new ReprioritizeFactory(), //
51 + new InitialPrioritizingFactory(), //
52 + new MergeStoriesFactory(), //
53 + new MergeStoriesStepTwoFactory(), //
54 + new MergeStoriesStepThreeFactory(), //
55 + new RestrictedResourceEditorFactory(), //
56 + new RestrictedResourceManagementFactory(), //
57 + // Reports...
58 + // new MedicationTrackingReportFactory(), //
59 + // HOME!
60 + new HomeFactory() );
61 +
62 + public DATT() {
63 + super( new AppNames( "Distributed Agile Team Tracker", "DATT" ) );
64 +
65 + // add in all the factory-less screens. This can be broken out into different modules if compile becomes too slow.
66 + // mVM.add( ADMIN_RESTRICTED_RESOURCE_MANAGEMENT );
67 + }
68 +
69 + @Override
70 + public void onAppLoad() {
71 + System.out.println( "DevMode " + Dev.state() );
72 +
73 + replaceAppPanel();
74 +
75 + super.onAppLoad();
76 +
77 + CScomm.setInstance( new GwtCScomm( null, mVM, new AppInitializationCallback() ) );
78 + }
79 +
80 + public void finishAppLoad() {
81 + ClientContext zContext = ClientContext.get();
82 +
83 + Dev.init( zContext );
84 +
85 + AppPanel zAppPanel = new AppPanel( Dev.isDevMode() ? 1 : 0 ); // 1 = see Red Line
86 +
87 + CurrentUserViewAccessor zCUA = new CurrentUserViewAccessor( zAppPanel, mACM );
88 + CurrentRestrictedResourceViewAccessor zCSA = new CurrentRestrictedResourceViewAccessor( zAppPanel );
89 + CurrentRestrictedResourceOptionsAccessor zCRROA = new CurrentRestrictedResourceOptionsAccessor( new RestrictedResourceSwitcher( zAppPanel, this ) );
90 +
91 + WindowSizingPanel.setContent( zAppPanel );
92 +
93 + UserViewDataProvider zUserViewDataProvider = UserViewDataProvider.getInstance();
94 +
95 + RestrictedResourcePickerDialogViewFactory zRRPDF =
96 + new RestrictedResourcePickerDialogFactory<RestrictedResourceView>( "Select Queue", RestrictedResourceViewDataProvider.getInstance(),
97 + RestrictedResourceViewMetaData.getInstance(),
98 + new RestrictedResourceViewSupportFactory<RestrictedResourceView>() {
99 + @Override
100 + public TableDataReloadable createTable(
101 + FilteringTableModel<RestrictedResourceView> pFilter,
102 + TableClickCommand<RestrictedResourceView>
103 + pRestrictedResourceViewTableClickCommand ) {
104 + return new RestrictedResourceViewTable( pFilter,
105 + pRestrictedResourceViewTableClickCommand );
106 + }
107 +
108 + @Override
109 + public QBEinputPanelAccessorWithCtrlMap<RestrictedResourceView>
110 + createFieldPanel() {
111 + return new RestrictedResourcePickerFieldsPanel();
112 + }
113 + } );
114 +
115 + zContext.set( CurrentRestrictedResourceViewAccessor.class, zCSA );
116 + zContext.set( AbstractCurrentRestrictedResourceViewAccessor.class, zCSA );
117 +
118 + zContext.set( CurrentUserViewAccessor.class, zCUA );
119 + zContext.set( AbstractCurrentUserViewAccessor.class, zCUA );
120 +
121 + zContext.set( LoginServerStateChecker.class, zUserViewDataProvider );
122 + zContext.set( SecurityUserViewDataProvider.class, zUserViewDataProvider );
123 +
124 + zContext.set( SecurityUserViewMetaData.class, UserViewMetaData.getInstance() );
125 +
126 + zContext.set( SuspendDialogViewFactory.class, new SuspendDialogFactory<UserView>() );
127 + zContext.set( LoginDialogViewFactory.class, new LoginDialogFactory<UserView>() );
128 + zContext.set( LoginPasswordResetDialogViewFactory.class, new ResetPasswordDialogFactory<UserView>() );
129 +
130 + zContext.set( ViewAccessControlManager.class, mACM );
131 + zContext.set( CurrentRestrictedResourceOptionsAccessor.class, zCRROA );
132 + zContext.set( RestrictedResourcePickerDialogViewFactory.class, zRRPDF );
133 + zContext.set( LoginPasswordResetAccessor.class, zCUA );
134 + zContext.set( StatusMessageSinc.class, zAppPanel );
135 + zContext.set( SingleWidgetPanel.class, zAppPanel );
136 + zContext.set( PageRefreshableProxy.class, zAppPanel );
137 + zContext.set( CommandQueue.class, new CommandQueue() );
138 + zContext.set( ScreenViewShower.class, mVM );
139 + zContext.set( DialogViewShower.class, mVM );
140 + zContext.set( ViewFactoryAccessor.class, mVM );
141 + zContext.set( NextDemoUserRequestHandler.class, new NextDemoUserRequestHandlerImpl() );
142 +
143 + mVM.initialize();
144 +
145 + System.err.println( new UtilDateAdaptor() + " | Application Client Ready" );
146 +
147 + PaddingProperty.setDefaults( 2, 10, 2, 6 );
148 +
149 + zAppPanel.setInfoMessage( "Hello" );
150 + }
151 +
152 + protected void initializeLoggerFactory() {
153 + //noinspection NonJREEmulationClassesInClientCode
154 + LoggerFactory.init( new ConfigurationLoggerLevel(), BrowserAsLogSyncFactory.INSTANCE );
155 + }
156 +
157 + private class AppInitializationCallback implements AsyncCallback<AppInitializationResult> {
158 + @Override
159 + public void onFailure( Throwable pThrowable ) {
160 + String message;
161 +
162 + if ( pThrowable instanceof InvocationException ) {
163 + // see javadoc for InvocationException
164 + message = "A connection could not be established with the server";
165 + } else if ( pThrowable instanceof IncompatibleRemoteServiceException ) {
166 + /*
167 + * This _should_ not happen to users, so long as the .nocache
168 + * file isn't cached by the client.
169 + */
170 + message = "Client and server versions are incompatible. Try ctrl-clicking\n" + //
171 + "or shift-clicking the browser refresh button, or clearing your\n" + //
172 + "browser's cache in 'Internet Options' / your browser's preferences. ";
173 + } else {
174 + // probably an application-specific execption on the server
175 + message = "An application error occured on the server";
176 + }
177 +
178 + reportFailure( pThrowable, "onFailure()", message );
179 + }
180 +
181 + @Override
182 + public void onSuccess( AppInitializationResult result ) {
183 + System.err.println( new UtilDateAdaptor() + " | Client AppInitialization" );
184 +
185 + if ( result == null ) {
186 + UtilsGwt.closeWindowNoConfirm( 5 );
187 + return;
188 + }
189 +
190 + try {
191 + new ClientConfiguration( result.getClientConfig() ); // This line must preceed the next
192 + initializeLoggerFactory(); // ......................... This line must follow the previous
193 +
194 + AlertManager.setVersion( "Version " + result.getApplicationVersion() );
195 +
196 + finishAppLoad();
197 + }
198 + catch ( RuntimeException e ) {
199 + reportFailure( e, "onSuccess()", null );
200 + }
201 + }
202 +
203 + private void reportFailure( Throwable pThrowable, String method, String message ) {
204 + pThrowable.printStackTrace(); // prints the trace in the GWT hosted shell
205 + String html = "<h1>Application Initialization Failed</h1>" + //
206 + "<p>" + message + "</p>" + //
207 + "<p>at " + ClassName.simple( this ) + "." + method + "</p>" + //
208 + "<p>Exception: </p>" + //
209 + "<p><pre>" + pThrowable + "</pre></p>";
210 + DOM.setInnerHTML( RootPanel.getBodyElement(), html );
211 + }
212 + }
213 +
214 + private static class NextDemoUserRequestHandlerImpl implements NextDemoUserRequestHandler {
215 + @Override
216 + public void nextDemoUser() {
217 + UserViewDataProvider.getInstance().nextDemoUser( new SimpleDataProviderCallBack() {
218 + @Override
219 + public void error( String pError ) {
220 + new ShowScreenCommand( ViewDefs.HOME, pError ).execute();
221 + }
222 + } );
223 + }
224 + }
225 +
226 + @Override
227 + public void switchToRestrictedResource( AlternateRestrictedResourceOption pAlternateOption ) {
228 + UserViewDataProvider.getInstance().attemptSwitchToRestrictedResource( (RestrictedResourceView) pAlternateOption, new SimpleDataProviderCallBack() {
229 + @Override
230 + public void error( String pError ) {
231 + if ( Currently.isNullOrEmpty( pError ) ) {
232 + PageRefreshableProxy zRefreshableProxy = ClientContext.get().checkGet( PageRefreshableProxy.class );
233 + if ( zRefreshableProxy != null ) {
234 + zRefreshableProxy.refreshPage();
235 + return;
236 + }
237 + }
238 + new ShowScreenCommand( ViewDefs.HOME, pError ).execute();
239 + }
240 + } );
241 + }
242 + }