Mercurial > dive4elements > river
annotate flys-client/src/main/java/de/intevation/flys/client/client/FLYS.java @ 4557:ebc22575e413
Get rid of the footer and the spacer in the flys webpage
author | Björn Ricks <bjoern.ricks@intevation.de> |
---|---|
date | Fri, 16 Nov 2012 14:24:38 +0100 |
parents | 03de5c424f95 |
children | 2fab2679eec9 |
rev | line source |
---|---|
0
4e8be5e7855f
Start of a GWT based client for FLYS-3.0
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
1 package de.intevation.flys.client.client; |
4e8be5e7855f
Start of a GWT based client for FLYS-3.0
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
2 |
4e8be5e7855f
Start of a GWT based client for FLYS-3.0
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
3 import com.google.gwt.core.client.EntryPoint; |
2
bc5d4d2297b9
Introduced a service that retrieves the user who is currently logged in. This user is displayed in the menu bar.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1
diff
changeset
|
4 import com.google.gwt.core.client.GWT; |
605
9e30c776cbef
Improved the exception handling.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
600
diff
changeset
|
5 import com.google.gwt.event.shared.UmbrellaException; |
2
bc5d4d2297b9
Introduced a service that retrieves the user who is currently logged in. This user is displayed in the menu bar.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1
diff
changeset
|
6 import com.google.gwt.user.client.rpc.AsyncCallback; |
9
8facd8545a12
Added a global configuration for the client and classes providing methods to retrieve these information.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
6
diff
changeset
|
7 import com.google.gwt.xml.client.XMLParser; |
3989
ccac1279eb41
More robust exception handler (#897)
Christian Lins <christian.lins@intevation.de>
parents:
3980
diff
changeset
|
8 |
217
907b61e4d702
Improved the exception handling - added warnings for user authentication errors and errors that occur while fetching supported rivers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
101
diff
changeset
|
9 import com.smartgwt.client.util.SC; |
3501
0de0ef04bcdc
Delete empty project after closing CollectionView (#785).
Christian Lins <christian.lins@intevation.de>
parents:
3381
diff
changeset
|
10 import com.smartgwt.client.widgets.HTMLPane; |
605
9e30c776cbef
Improved the exception handling.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
600
diff
changeset
|
11 import com.smartgwt.client.widgets.Window; |
3501
0de0ef04bcdc
Delete empty project after closing CollectionView (#785).
Christian Lins <christian.lins@intevation.de>
parents:
3381
diff
changeset
|
12 import com.smartgwt.client.widgets.events.CloseClickEvent; |
557
92c200887b20
#21 There might be just a single window for each project now. Users can't open a project twice.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
229
diff
changeset
|
13 import com.smartgwt.client.widgets.events.CloseClickHandler; |
3501
0de0ef04bcdc
Delete empty project after closing CollectionView (#785).
Christian Lins <christian.lins@intevation.de>
parents:
3381
diff
changeset
|
14 import com.smartgwt.client.widgets.layout.HLayout; |
0de0ef04bcdc
Delete empty project after closing CollectionView (#785).
Christian Lins <christian.lins@intevation.de>
parents:
3381
diff
changeset
|
15 import com.smartgwt.client.widgets.layout.VLayout; |
6
e2b3966b40ca
Added a workspace that handles the collection windows. New button to open a new collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
4
diff
changeset
|
16 |
611
854312c0528c
#21 Newly created projects cannot be opened twice.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
605
diff
changeset
|
17 import de.intevation.flys.client.client.event.CollectionChangeEvent; |
854312c0528c
#21 Newly created projects cannot be opened twice.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
605
diff
changeset
|
18 import de.intevation.flys.client.client.event.CollectionChangeHandler; |
9
8facd8545a12
Added a global configuration for the client and classes providing methods to retrieve these information.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
6
diff
changeset
|
19 import de.intevation.flys.client.client.services.ArtifactService; |
8facd8545a12
Added a global configuration for the client and classes providing methods to retrieve these information.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
6
diff
changeset
|
20 import de.intevation.flys.client.client.services.ArtifactServiceAsync; |
3865
436eec3be6ff
Allow to create a discharge curve from a gauge info
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
3698
diff
changeset
|
21 import de.intevation.flys.client.client.services.CreateCollectionService; |
436eec3be6ff
Allow to create a discharge curve from a gauge info
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
3698
diff
changeset
|
22 import de.intevation.flys.client.client.services.CreateCollectionServiceAsync; |
225
9040663aee01
Filled the context menu point 'Open project' of the ProjectList with life - it opens a new window displaying the parameterization of the selected project.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
217
diff
changeset
|
23 import de.intevation.flys.client.client.services.DescribeCollectionService; |
9040663aee01
Filled the context menu point 'Open project' of the ProjectList with life - it opens a new window displaying the parameterization of the selected project.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
217
diff
changeset
|
24 import de.intevation.flys.client.client.services.DescribeCollectionServiceAsync; |
9040663aee01
Filled the context menu point 'Open project' of the ProjectList with life - it opens a new window displaying the parameterization of the selected project.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
217
diff
changeset
|
25 import de.intevation.flys.client.client.services.GetArtifactService; |
9040663aee01
Filled the context menu point 'Open project' of the ProjectList with life - it opens a new window displaying the parameterization of the selected project.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
217
diff
changeset
|
26 import de.intevation.flys.client.client.services.GetArtifactServiceAsync; |
29
44c63e7fd0d0
Added a service to list the supported rivers of the artifact server. The FLYS instance serves a method that retrieves this list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
28
diff
changeset
|
27 import de.intevation.flys.client.client.services.RiverService; |
44c63e7fd0d0
Added a service to list the supported rivers of the artifact server. The FLYS instance serves a method that retrieves this list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
28
diff
changeset
|
28 import de.intevation.flys.client.client.services.RiverServiceAsync; |
2
bc5d4d2297b9
Introduced a service that retrieves the user who is currently logged in. This user is displayed in the menu bar.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1
diff
changeset
|
29 import de.intevation.flys.client.client.services.UserService; |
bc5d4d2297b9
Introduced a service that retrieves the user who is currently logged in. This user is displayed in the menu bar.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1
diff
changeset
|
30 import de.intevation.flys.client.client.services.UserServiceAsync; |
6
e2b3966b40ca
Added a workspace that handles the collection windows. New button to open a new collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
4
diff
changeset
|
31 import de.intevation.flys.client.client.ui.CollectionView; |
3501
0de0ef04bcdc
Delete empty project after closing CollectionView (#785).
Christian Lins <christian.lins@intevation.de>
parents:
3381
diff
changeset
|
32 import de.intevation.flys.client.client.ui.FLYSFooter; |
27
e4155a6833a9
Integrated a header that contains a FLYS and a BfG logo.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
25
diff
changeset
|
33 import de.intevation.flys.client.client.ui.FLYSHeader; |
1
0e22a19852e7
Removed useless auto generated classes and added first ui elements with i18n support.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
0
diff
changeset
|
34 import de.intevation.flys.client.client.ui.FLYSView; |
6
e2b3966b40ca
Added a workspace that handles the collection windows. New button to open a new collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
4
diff
changeset
|
35 import de.intevation.flys.client.client.ui.FLYSWorkspace; |
1
0e22a19852e7
Removed useless auto generated classes and added first ui elements with i18n support.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
0
diff
changeset
|
36 import de.intevation.flys.client.client.ui.MainMenu; |
4
89976499e013
Implemented a ProjectList and added a mockup that displays two collections in that list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2
diff
changeset
|
37 import de.intevation.flys.client.client.ui.ProjectList; |
3501
0de0ef04bcdc
Delete empty project after closing CollectionView (#785).
Christian Lins <christian.lins@intevation.de>
parents:
3381
diff
changeset
|
38 import de.intevation.flys.client.shared.model.Artifact; |
0de0ef04bcdc
Delete empty project after closing CollectionView (#785).
Christian Lins <christian.lins@intevation.de>
parents:
3381
diff
changeset
|
39 import de.intevation.flys.client.shared.model.Collection; |
0de0ef04bcdc
Delete empty project after closing CollectionView (#785).
Christian Lins <christian.lins@intevation.de>
parents:
3381
diff
changeset
|
40 import de.intevation.flys.client.shared.model.CollectionItem; |
0de0ef04bcdc
Delete empty project after closing CollectionView (#785).
Christian Lins <christian.lins@intevation.de>
parents:
3381
diff
changeset
|
41 import de.intevation.flys.client.shared.model.River; |
0de0ef04bcdc
Delete empty project after closing CollectionView (#785).
Christian Lins <christian.lins@intevation.de>
parents:
3381
diff
changeset
|
42 import de.intevation.flys.client.shared.model.User; |
0de0ef04bcdc
Delete empty project after closing CollectionView (#785).
Christian Lins <christian.lins@intevation.de>
parents:
3381
diff
changeset
|
43 |
0de0ef04bcdc
Delete empty project after closing CollectionView (#785).
Christian Lins <christian.lins@intevation.de>
parents:
3381
diff
changeset
|
44 import java.util.ArrayList; |
0de0ef04bcdc
Delete empty project after closing CollectionView (#785).
Christian Lins <christian.lins@intevation.de>
parents:
3381
diff
changeset
|
45 import java.util.List; |
3698
8e69aca69074
Catch MissingResourceException on unexpected server exceptions.
Christian Lins <christian.lins@intevation.de>
parents:
3696
diff
changeset
|
46 import java.util.MissingResourceException; |
3501
0de0ef04bcdc
Delete empty project after closing CollectionView (#785).
Christian Lins <christian.lins@intevation.de>
parents:
3381
diff
changeset
|
47 import java.util.Set; |
1
0e22a19852e7
Removed useless auto generated classes and added first ui elements with i18n support.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
0
diff
changeset
|
48 |
0
4e8be5e7855f
Start of a GWT based client for FLYS-3.0
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
49 |
4e8be5e7855f
Start of a GWT based client for FLYS-3.0
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
50 /** |
4e8be5e7855f
Start of a GWT based client for FLYS-3.0
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
51 * Entry point classes define <code>onModuleLoad()</code>. |
1
0e22a19852e7
Removed useless auto generated classes and added first ui elements with i18n support.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
0
diff
changeset
|
52 * |
0e22a19852e7
Removed useless auto generated classes and added first ui elements with i18n support.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
0
diff
changeset
|
53 * @author <a href="mailto:ingo.weinzierl@intevation.de">Ingo Weinzierl</a> |
0
4e8be5e7855f
Start of a GWT based client for FLYS-3.0
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
54 */ |
611
854312c0528c
#21 Newly created projects cannot be opened twice.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
605
diff
changeset
|
55 public class FLYS implements EntryPoint, CollectionChangeHandler { |
0
4e8be5e7855f
Start of a GWT based client for FLYS-3.0
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
56 |
217
907b61e4d702
Improved the exception handling - added warnings for user authentication errors and errors that occur while fetching supported rivers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
101
diff
changeset
|
57 /** The message class that provides i18n strings.*/ |
907b61e4d702
Improved the exception handling - added warnings for user authentication errors and errors that occur while fetching supported rivers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
101
diff
changeset
|
58 protected FLYSConstants MSG = GWT.create(FLYSConstants.class); |
907b61e4d702
Improved the exception handling - added warnings for user authentication errors and errors that occur while fetching supported rivers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
101
diff
changeset
|
59 |
2
bc5d4d2297b9
Introduced a service that retrieves the user who is currently logged in. This user is displayed in the menu bar.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1
diff
changeset
|
60 /** The UserService used to retrieve information about the current user. */ |
bc5d4d2297b9
Introduced a service that retrieves the user who is currently logged in. This user is displayed in the menu bar.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1
diff
changeset
|
61 protected UserServiceAsync userService = GWT.create(UserService.class); |
bc5d4d2297b9
Introduced a service that retrieves the user who is currently logged in. This user is displayed in the menu bar.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1
diff
changeset
|
62 |
29
44c63e7fd0d0
Added a service to list the supported rivers of the artifact server. The FLYS instance serves a method that retrieves this list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
28
diff
changeset
|
63 /** The RiverService used to retrieve the supported rivers of the server.*/ |
44c63e7fd0d0
Added a service to list the supported rivers of the artifact server. The FLYS instance serves a method that retrieves this list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
28
diff
changeset
|
64 protected RiverServiceAsync riverService = GWT.create(RiverService.class); |
44c63e7fd0d0
Added a service to list the supported rivers of the artifact server. The FLYS instance serves a method that retrieves this list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
28
diff
changeset
|
65 |
9
8facd8545a12
Added a global configuration for the client and classes providing methods to retrieve these information.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
6
diff
changeset
|
66 /** The ArtifactService used to communicate with the Artifact server. */ |
8facd8545a12
Added a global configuration for the client and classes providing methods to retrieve these information.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
6
diff
changeset
|
67 protected ArtifactServiceAsync artifactService = |
8facd8545a12
Added a global configuration for the client and classes providing methods to retrieve these information.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
6
diff
changeset
|
68 GWT.create(ArtifactService.class); |
8facd8545a12
Added a global configuration for the client and classes providing methods to retrieve these information.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
6
diff
changeset
|
69 |
225
9040663aee01
Filled the context menu point 'Open project' of the ProjectList with life - it opens a new window displaying the parameterization of the selected project.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
217
diff
changeset
|
70 /** The ArtifactService used to communicate with the Artifact server. */ |
9040663aee01
Filled the context menu point 'Open project' of the ProjectList with life - it opens a new window displaying the parameterization of the selected project.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
217
diff
changeset
|
71 protected DescribeCollectionServiceAsync describeCollectionService = |
9040663aee01
Filled the context menu point 'Open project' of the ProjectList with life - it opens a new window displaying the parameterization of the selected project.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
217
diff
changeset
|
72 GWT.create(DescribeCollectionService.class); |
9040663aee01
Filled the context menu point 'Open project' of the ProjectList with life - it opens a new window displaying the parameterization of the selected project.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
217
diff
changeset
|
73 |
9040663aee01
Filled the context menu point 'Open project' of the ProjectList with life - it opens a new window displaying the parameterization of the selected project.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
217
diff
changeset
|
74 /** The GetArtifactService used to open an existing collection. */ |
9040663aee01
Filled the context menu point 'Open project' of the ProjectList with life - it opens a new window displaying the parameterization of the selected project.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
217
diff
changeset
|
75 protected GetArtifactServiceAsync getArtifactService = |
9040663aee01
Filled the context menu point 'Open project' of the ProjectList with life - it opens a new window displaying the parameterization of the selected project.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
217
diff
changeset
|
76 GWT.create(GetArtifactService.class); |
9040663aee01
Filled the context menu point 'Open project' of the ProjectList with life - it opens a new window displaying the parameterization of the selected project.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
217
diff
changeset
|
77 |
3865
436eec3be6ff
Allow to create a discharge curve from a gauge info
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
3698
diff
changeset
|
78 /** The CreateCollectionServiceAsync used to create a new collection */ |
436eec3be6ff
Allow to create a discharge curve from a gauge info
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
3698
diff
changeset
|
79 protected CreateCollectionServiceAsync collectionService = |
436eec3be6ff
Allow to create a discharge curve from a gauge info
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
3698
diff
changeset
|
80 GWT.create(CreateCollectionService.class); |
225
9040663aee01
Filled the context menu point 'Open project' of the ProjectList with life - it opens a new window displaying the parameterization of the selected project.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
217
diff
changeset
|
81 |
864
c0e13cf826d7
Cosmetics, doc.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
845
diff
changeset
|
82 /** The menu bar at the top of the application. */ |
2
bc5d4d2297b9
Introduced a service that retrieves the user who is currently logged in. This user is displayed in the menu bar.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1
diff
changeset
|
83 protected MainMenu menu; |
4
89976499e013
Implemented a ProjectList and added a mockup that displays two collections in that list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2
diff
changeset
|
84 |
3549
6a8f83c538e3
Merged revisions 5384 via svnmerge from
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
3501
diff
changeset
|
85 /** The content window. It takes the whole space beneath the menu bar. */ |
2
bc5d4d2297b9
Introduced a service that retrieves the user who is currently logged in. This user is displayed in the menu bar.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1
diff
changeset
|
86 protected FLYSView view; |
bc5d4d2297b9
Introduced a service that retrieves the user who is currently logged in. This user is displayed in the menu bar.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1
diff
changeset
|
87 |
864
c0e13cf826d7
Cosmetics, doc.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
845
diff
changeset
|
88 /** The project list that displays the projects of the user. */ |
4
89976499e013
Implemented a ProjectList and added a mockup that displays two collections in that list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2
diff
changeset
|
89 protected ProjectList projectList; |
89976499e013
Implemented a ProjectList and added a mockup that displays two collections in that list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2
diff
changeset
|
90 |
864
c0e13cf826d7
Cosmetics, doc.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
845
diff
changeset
|
91 /** The FLYSWorkspace. */ |
6
e2b3966b40ca
Added a workspace that handles the collection windows. New button to open a new collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
4
diff
changeset
|
92 protected FLYSWorkspace workspace; |
e2b3966b40ca
Added a workspace that handles the collection windows. New button to open a new collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
4
diff
changeset
|
93 |
864
c0e13cf826d7
Cosmetics, doc.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
845
diff
changeset
|
94 /** The user who is currently logged in. */ |
25
2da6be38d8b6
Added a User interface and a default implementation to handle users in this client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
14
diff
changeset
|
95 protected User currentUser; |
2da6be38d8b6
Added a User interface and a default implementation to handle users in this client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
14
diff
changeset
|
96 |
864
c0e13cf826d7
Cosmetics, doc.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
845
diff
changeset
|
97 /** The list of rivers supported by the server. */ |
29
44c63e7fd0d0
Added a service to list the supported rivers of the artifact server. The FLYS instance serves a method that retrieves this list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
28
diff
changeset
|
98 protected River[] rivers; |
44c63e7fd0d0
Added a service to list the supported rivers of the artifact server. The FLYS instance serves a method that retrieves this list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
28
diff
changeset
|
99 |
864
c0e13cf826d7
Cosmetics, doc.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
845
diff
changeset
|
100 /** This list is used to track the opened projects. */ |
557
92c200887b20
#21 There might be just a single window for each project now. Users can't open a project twice.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
229
diff
changeset
|
101 protected List<String> openProjects; |
92c200887b20
#21 There might be just a single window for each project now. Users can't open a project twice.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
229
diff
changeset
|
102 |
2
bc5d4d2297b9
Introduced a service that retrieves the user who is currently logged in. This user is displayed in the menu bar.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1
diff
changeset
|
103 |
4062
145980c21700
Handle error conditions more robust.
Christian Lins <christian.lins@intevation.de>
parents:
3989
diff
changeset
|
104 public static String getExceptionString(FLYSConstants msg, Throwable caught) { |
3989
ccac1279eb41
More robust exception handler (#897)
Christian Lins <christian.lins@intevation.de>
parents:
3980
diff
changeset
|
105 try { |
4062
145980c21700
Handle error conditions more robust.
Christian Lins <christian.lins@intevation.de>
parents:
3989
diff
changeset
|
106 return msg.getString(caught.getMessage()); |
3989
ccac1279eb41
More robust exception handler (#897)
Christian Lins <christian.lins@intevation.de>
parents:
3980
diff
changeset
|
107 } |
ccac1279eb41
More robust exception handler (#897)
Christian Lins <christian.lins@intevation.de>
parents:
3980
diff
changeset
|
108 catch(MissingResourceException ex) { |
ccac1279eb41
More robust exception handler (#897)
Christian Lins <christian.lins@intevation.de>
parents:
3980
diff
changeset
|
109 // There are some server error exceptions with |
ccac1279eb41
More robust exception handler (#897)
Christian Lins <christian.lins@intevation.de>
parents:
3980
diff
changeset
|
110 // varying text messages that cannot be localized |
ccac1279eb41
More robust exception handler (#897)
Christian Lins <christian.lins@intevation.de>
parents:
3980
diff
changeset
|
111 // easily. In this rare cases, use the plain |
ccac1279eb41
More robust exception handler (#897)
Christian Lins <christian.lins@intevation.de>
parents:
3980
diff
changeset
|
112 // exception message. |
ccac1279eb41
More robust exception handler (#897)
Christian Lins <christian.lins@intevation.de>
parents:
3980
diff
changeset
|
113 GWT.log("Missing resource for: " + caught.getMessage()); |
ccac1279eb41
More robust exception handler (#897)
Christian Lins <christian.lins@intevation.de>
parents:
3980
diff
changeset
|
114 return caught.getLocalizedMessage(); |
ccac1279eb41
More robust exception handler (#897)
Christian Lins <christian.lins@intevation.de>
parents:
3980
diff
changeset
|
115 } |
ccac1279eb41
More robust exception handler (#897)
Christian Lins <christian.lins@intevation.de>
parents:
3980
diff
changeset
|
116 } |
ccac1279eb41
More robust exception handler (#897)
Christian Lins <christian.lins@intevation.de>
parents:
3980
diff
changeset
|
117 |
1
0e22a19852e7
Removed useless auto generated classes and added first ui elements with i18n support.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
0
diff
changeset
|
118 /** |
0e22a19852e7
Removed useless auto generated classes and added first ui elements with i18n support.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
0
diff
changeset
|
119 * This is the entry point method. |
0e22a19852e7
Removed useless auto generated classes and added first ui elements with i18n support.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
0
diff
changeset
|
120 */ |
3501
0de0ef04bcdc
Delete empty project after closing CollectionView (#785).
Christian Lins <christian.lins@intevation.de>
parents:
3381
diff
changeset
|
121 @Override |
1
0e22a19852e7
Removed useless auto generated classes and added first ui elements with i18n support.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
0
diff
changeset
|
122 public void onModuleLoad() { |
557
92c200887b20
#21 There might be just a single window for each project now. Users can't open a project twice.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
229
diff
changeset
|
123 openProjects = new ArrayList<String>(); |
0
4e8be5e7855f
Start of a GWT based client for FLYS-3.0
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
124 |
787
4e0b73b7113b
Added new UI providers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
611
diff
changeset
|
125 //GWT.setUncaughtExceptionHandler(new GWT.UncaughtExceptionHandler() { |
4e0b73b7113b
Added new UI providers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
611
diff
changeset
|
126 // public void onUncaughtException(Throwable e) { |
4e0b73b7113b
Added new UI providers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
611
diff
changeset
|
127 // showWarning(e); |
4e0b73b7113b
Added new UI providers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
611
diff
changeset
|
128 // } |
4e0b73b7113b
Added new UI providers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
611
diff
changeset
|
129 //}); |
605
9e30c776cbef
Improved the exception handling.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
600
diff
changeset
|
130 |
1
0e22a19852e7
Removed useless auto generated classes and added first ui elements with i18n support.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
0
diff
changeset
|
131 VLayout vertical = new VLayout(); |
0e22a19852e7
Removed useless auto generated classes and added first ui elements with i18n support.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
0
diff
changeset
|
132 vertical.setLayoutMargin(1); |
0e22a19852e7
Removed useless auto generated classes and added first ui elements with i18n support.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
0
diff
changeset
|
133 vertical.setWidth100(); |
0e22a19852e7
Removed useless auto generated classes and added first ui elements with i18n support.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
0
diff
changeset
|
134 vertical.setHeight100(); |
0
4e8be5e7855f
Start of a GWT based client for FLYS-3.0
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
135 |
6
e2b3966b40ca
Added a workspace that handles the collection windows. New button to open a new collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
4
diff
changeset
|
136 menu = new MainMenu(this); |
2
bc5d4d2297b9
Introduced a service that retrieves the user who is currently logged in. This user is displayed in the menu bar.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1
diff
changeset
|
137 view = new FLYSView(); |
1
0e22a19852e7
Removed useless auto generated classes and added first ui elements with i18n support.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
0
diff
changeset
|
138 |
27
e4155a6833a9
Integrated a header that contains a FLYS and a BfG logo.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
25
diff
changeset
|
139 vertical.addMember(new FLYSHeader()); |
1
0e22a19852e7
Removed useless auto generated classes and added first ui elements with i18n support.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
0
diff
changeset
|
140 vertical.addMember(menu); |
0e22a19852e7
Removed useless auto generated classes and added first ui elements with i18n support.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
0
diff
changeset
|
141 vertical.addMember(view); |
0e22a19852e7
Removed useless auto generated classes and added first ui elements with i18n support.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
0
diff
changeset
|
142 |
797
cc3f481e9484
Introduced GwtOpenLayers to bring up maps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
787
diff
changeset
|
143 vertical.draw(); |
2
bc5d4d2297b9
Introduced a service that retrieves the user who is currently logged in. This user is displayed in the menu bar.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1
diff
changeset
|
144 |
9
8facd8545a12
Added a global configuration for the client and classes providing methods to retrieve these information.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
6
diff
changeset
|
145 initConfiguration(); |
229
924da6695800
Each service is now called with the name of the current locale to set the request object's locale manually in the HttpClient.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
225
diff
changeset
|
146 |
924da6695800
Each service is now called with the name of the current locale to set the request object's locale manually in the HttpClient.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
225
diff
changeset
|
147 Config config = Config.getInstance(); |
924da6695800
Each service is now called with the name of the current locale to set the request object's locale manually in the HttpClient.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
225
diff
changeset
|
148 String locale = config.getLocale(); |
9
8facd8545a12
Added a global configuration for the client and classes providing methods to retrieve these information.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
6
diff
changeset
|
149 |
1425
bc06a671ef60
Removed the URL parameter from service calls. The service
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1294
diff
changeset
|
150 userService.getCurrentUser(locale, new AsyncCallback<User>() { |
3501
0de0ef04bcdc
Delete empty project after closing CollectionView (#785).
Christian Lins <christian.lins@intevation.de>
parents:
3381
diff
changeset
|
151 @Override |
2
bc5d4d2297b9
Introduced a service that retrieves the user who is currently logged in. This user is displayed in the menu bar.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1
diff
changeset
|
152 public void onFailure(Throwable caught) { |
bc5d4d2297b9
Introduced a service that retrieves the user who is currently logged in. This user is displayed in the menu bar.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1
diff
changeset
|
153 GWT.log("Could not find a logged in user."); |
4062
145980c21700
Handle error conditions more robust.
Christian Lins <christian.lins@intevation.de>
parents:
3989
diff
changeset
|
154 String msg = getExceptionString(MSG, caught); |
3698
8e69aca69074
Catch MissingResourceException on unexpected server exceptions.
Christian Lins <christian.lins@intevation.de>
parents:
3696
diff
changeset
|
155 SC.warn(msg); |
2
bc5d4d2297b9
Introduced a service that retrieves the user who is currently logged in. This user is displayed in the menu bar.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1
diff
changeset
|
156 } |
bc5d4d2297b9
Introduced a service that retrieves the user who is currently logged in. This user is displayed in the menu bar.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1
diff
changeset
|
157 |
3501
0de0ef04bcdc
Delete empty project after closing CollectionView (#785).
Christian Lins <christian.lins@intevation.de>
parents:
3381
diff
changeset
|
158 @Override |
2
bc5d4d2297b9
Introduced a service that retrieves the user who is currently logged in. This user is displayed in the menu bar.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1
diff
changeset
|
159 public void onSuccess(User user) { |
25
2da6be38d8b6
Added a User interface and a default implementation to handle users in this client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
14
diff
changeset
|
160 GWT.log("Found a user. Set '"+ user.getName() + "'"); |
2da6be38d8b6
Added a User interface and a default implementation to handle users in this client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
14
diff
changeset
|
161 setCurrentUser(user); |
2da6be38d8b6
Added a User interface and a default implementation to handle users in this client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
14
diff
changeset
|
162 |
2
bc5d4d2297b9
Introduced a service that retrieves the user who is currently logged in. This user is displayed in the menu bar.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1
diff
changeset
|
163 menu.setCurrentUser(user); |
4
89976499e013
Implemented a ProjectList and added a mockup that displays two collections in that list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2
diff
changeset
|
164 |
225
9040663aee01
Filled the context menu point 'Open project' of the ProjectList with life - it opens a new window displaying the parameterization of the selected project.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
217
diff
changeset
|
165 projectList = new ProjectList(FLYS.this, user); |
6
e2b3966b40ca
Added a workspace that handles the collection windows. New button to open a new collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
4
diff
changeset
|
166 workspace = new FLYSWorkspace(); |
4
89976499e013
Implemented a ProjectList and added a mockup that displays two collections in that list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
2
diff
changeset
|
167 view.setProjectList(projectList); |
6
e2b3966b40ca
Added a workspace that handles the collection windows. New button to open a new collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
4
diff
changeset
|
168 view.setFLYSWorkspace(workspace); |
217
907b61e4d702
Improved the exception handling - added warnings for user authentication errors and errors that occur while fetching supported rivers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
101
diff
changeset
|
169 |
907b61e4d702
Improved the exception handling - added warnings for user authentication errors and errors that occur while fetching supported rivers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
101
diff
changeset
|
170 readRivers(); |
2
bc5d4d2297b9
Introduced a service that retrieves the user who is currently logged in. This user is displayed in the menu bar.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1
diff
changeset
|
171 } |
bc5d4d2297b9
Introduced a service that retrieves the user who is currently logged in. This user is displayed in the menu bar.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
1
diff
changeset
|
172 }); |
0
4e8be5e7855f
Start of a GWT based client for FLYS-3.0
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
173 } |
6
e2b3966b40ca
Added a workspace that handles the collection windows. New button to open a new collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
4
diff
changeset
|
174 |
e2b3966b40ca
Added a workspace that handles the collection windows. New button to open a new collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
4
diff
changeset
|
175 |
605
9e30c776cbef
Improved the exception handling.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
600
diff
changeset
|
176 public void showWarning(Throwable e) { |
9e30c776cbef
Improved the exception handling.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
600
diff
changeset
|
177 StringBuilder sb = new StringBuilder(); |
9e30c776cbef
Improved the exception handling.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
600
diff
changeset
|
178 sb.append("<tt>"); |
9e30c776cbef
Improved the exception handling.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
600
diff
changeset
|
179 |
9e30c776cbef
Improved the exception handling.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
600
diff
changeset
|
180 if (e instanceof UmbrellaException) { |
9e30c776cbef
Improved the exception handling.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
600
diff
changeset
|
181 UmbrellaException u = (UmbrellaException) e; |
9e30c776cbef
Improved the exception handling.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
600
diff
changeset
|
182 Set<Throwable> throwables = u.getCauses(); |
9e30c776cbef
Improved the exception handling.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
600
diff
changeset
|
183 |
9e30c776cbef
Improved the exception handling.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
600
diff
changeset
|
184 for (Throwable t: throwables) { |
9e30c776cbef
Improved the exception handling.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
600
diff
changeset
|
185 sb.append(t.getLocalizedMessage()); |
9e30c776cbef
Improved the exception handling.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
600
diff
changeset
|
186 sb.append("<br>"); |
9e30c776cbef
Improved the exception handling.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
600
diff
changeset
|
187 } |
9e30c776cbef
Improved the exception handling.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
600
diff
changeset
|
188 } |
9e30c776cbef
Improved the exception handling.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
600
diff
changeset
|
189 else { |
9e30c776cbef
Improved the exception handling.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
600
diff
changeset
|
190 sb.append(e.getLocalizedMessage()); |
9e30c776cbef
Improved the exception handling.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
600
diff
changeset
|
191 } |
9e30c776cbef
Improved the exception handling.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
600
diff
changeset
|
192 |
9e30c776cbef
Improved the exception handling.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
600
diff
changeset
|
193 sb.append("</tt>"); |
9e30c776cbef
Improved the exception handling.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
600
diff
changeset
|
194 |
9e30c776cbef
Improved the exception handling.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
600
diff
changeset
|
195 Window w = new Window(); |
9e30c776cbef
Improved the exception handling.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
600
diff
changeset
|
196 w.setTitle(MSG.unexpected_exception()); |
9e30c776cbef
Improved the exception handling.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
600
diff
changeset
|
197 w.setWidth(550); |
9e30c776cbef
Improved the exception handling.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
600
diff
changeset
|
198 w.setHeight(300); |
9e30c776cbef
Improved the exception handling.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
600
diff
changeset
|
199 w.centerInPage(); |
9e30c776cbef
Improved the exception handling.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
600
diff
changeset
|
200 w.setCanDragResize(true); |
9e30c776cbef
Improved the exception handling.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
600
diff
changeset
|
201 |
9e30c776cbef
Improved the exception handling.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
600
diff
changeset
|
202 HTMLPane p = new HTMLPane(); |
9e30c776cbef
Improved the exception handling.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
600
diff
changeset
|
203 p.setContents(sb.toString()); |
9e30c776cbef
Improved the exception handling.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
600
diff
changeset
|
204 |
9e30c776cbef
Improved the exception handling.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
600
diff
changeset
|
205 w.addItem(p); |
9e30c776cbef
Improved the exception handling.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
600
diff
changeset
|
206 w.show(); |
9e30c776cbef
Improved the exception handling.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
600
diff
changeset
|
207 } |
9e30c776cbef
Improved the exception handling.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
600
diff
changeset
|
208 |
9e30c776cbef
Improved the exception handling.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
600
diff
changeset
|
209 |
6
e2b3966b40ca
Added a workspace that handles the collection windows. New button to open a new collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
4
diff
changeset
|
210 /** |
9
8facd8545a12
Added a global configuration for the client and classes providing methods to retrieve these information.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
6
diff
changeset
|
211 * This method should be called at system start. It initialzes the client |
8facd8545a12
Added a global configuration for the client and classes providing methods to retrieve these information.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
6
diff
changeset
|
212 * configuration. |
8facd8545a12
Added a global configuration for the client and classes providing methods to retrieve these information.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
6
diff
changeset
|
213 */ |
8facd8545a12
Added a global configuration for the client and classes providing methods to retrieve these information.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
6
diff
changeset
|
214 protected void initConfiguration() { |
8facd8545a12
Added a global configuration for the client and classes providing methods to retrieve these information.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
6
diff
changeset
|
215 String xml = FLYSResources.INSTANCE.initialConfiguration().getText(); |
8facd8545a12
Added a global configuration for the client and classes providing methods to retrieve these information.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
6
diff
changeset
|
216 Config.getInstance(XMLParser.parse(xml)); |
8facd8545a12
Added a global configuration for the client and classes providing methods to retrieve these information.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
6
diff
changeset
|
217 } |
8facd8545a12
Added a global configuration for the client and classes providing methods to retrieve these information.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
6
diff
changeset
|
218 |
8facd8545a12
Added a global configuration for the client and classes providing methods to retrieve these information.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
6
diff
changeset
|
219 |
8facd8545a12
Added a global configuration for the client and classes providing methods to retrieve these information.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
6
diff
changeset
|
220 /** |
25
2da6be38d8b6
Added a User interface and a default implementation to handle users in this client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
14
diff
changeset
|
221 * Returns the user that is currently logged in. |
2da6be38d8b6
Added a User interface and a default implementation to handle users in this client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
14
diff
changeset
|
222 * |
2da6be38d8b6
Added a User interface and a default implementation to handle users in this client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
14
diff
changeset
|
223 * @return the current user. |
2da6be38d8b6
Added a User interface and a default implementation to handle users in this client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
14
diff
changeset
|
224 */ |
2da6be38d8b6
Added a User interface and a default implementation to handle users in this client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
14
diff
changeset
|
225 public User getCurrentUser() { |
2da6be38d8b6
Added a User interface and a default implementation to handle users in this client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
14
diff
changeset
|
226 return currentUser; |
2da6be38d8b6
Added a User interface and a default implementation to handle users in this client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
14
diff
changeset
|
227 } |
2da6be38d8b6
Added a User interface and a default implementation to handle users in this client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
14
diff
changeset
|
228 |
2da6be38d8b6
Added a User interface and a default implementation to handle users in this client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
14
diff
changeset
|
229 |
2da6be38d8b6
Added a User interface and a default implementation to handle users in this client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
14
diff
changeset
|
230 /** |
2da6be38d8b6
Added a User interface and a default implementation to handle users in this client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
14
diff
changeset
|
231 * Sets the current user. |
2da6be38d8b6
Added a User interface and a default implementation to handle users in this client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
14
diff
changeset
|
232 */ |
2da6be38d8b6
Added a User interface and a default implementation to handle users in this client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
14
diff
changeset
|
233 public void setCurrentUser(User user) { |
2da6be38d8b6
Added a User interface and a default implementation to handle users in this client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
14
diff
changeset
|
234 currentUser = user; |
2da6be38d8b6
Added a User interface and a default implementation to handle users in this client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
14
diff
changeset
|
235 } |
2da6be38d8b6
Added a User interface and a default implementation to handle users in this client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
14
diff
changeset
|
236 |
2da6be38d8b6
Added a User interface and a default implementation to handle users in this client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
14
diff
changeset
|
237 |
2da6be38d8b6
Added a User interface and a default implementation to handle users in this client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
14
diff
changeset
|
238 /** |
28
dfdb927b137d
Improved the main menu - added further buttons (clickable labels).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
27
diff
changeset
|
239 * Returns the project list. |
dfdb927b137d
Improved the main menu - added further buttons (clickable labels).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
27
diff
changeset
|
240 */ |
dfdb927b137d
Improved the main menu - added further buttons (clickable labels).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
27
diff
changeset
|
241 public ProjectList getProjectList() { |
dfdb927b137d
Improved the main menu - added further buttons (clickable labels).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
27
diff
changeset
|
242 return projectList; |
dfdb927b137d
Improved the main menu - added further buttons (clickable labels).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
27
diff
changeset
|
243 } |
dfdb927b137d
Improved the main menu - added further buttons (clickable labels).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
27
diff
changeset
|
244 |
dfdb927b137d
Improved the main menu - added further buttons (clickable labels).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
27
diff
changeset
|
245 |
dfdb927b137d
Improved the main menu - added further buttons (clickable labels).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
27
diff
changeset
|
246 /** |
600
347cf4a5a486
Open projects are removed from screen if the user deletes them (via project list).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
557
diff
changeset
|
247 * Returns the projects workspace that contains all project windows. |
347cf4a5a486
Open projects are removed from screen if the user deletes them (via project list).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
557
diff
changeset
|
248 * |
347cf4a5a486
Open projects are removed from screen if the user deletes them (via project list).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
557
diff
changeset
|
249 * @return the FLYSWorkspace. |
347cf4a5a486
Open projects are removed from screen if the user deletes them (via project list).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
557
diff
changeset
|
250 */ |
347cf4a5a486
Open projects are removed from screen if the user deletes them (via project list).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
557
diff
changeset
|
251 public FLYSWorkspace getWorkspace() { |
347cf4a5a486
Open projects are removed from screen if the user deletes them (via project list).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
557
diff
changeset
|
252 return workspace; |
347cf4a5a486
Open projects are removed from screen if the user deletes them (via project list).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
557
diff
changeset
|
253 } |
347cf4a5a486
Open projects are removed from screen if the user deletes them (via project list).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
557
diff
changeset
|
254 |
347cf4a5a486
Open projects are removed from screen if the user deletes them (via project list).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
557
diff
changeset
|
255 |
347cf4a5a486
Open projects are removed from screen if the user deletes them (via project list).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
557
diff
changeset
|
256 /** |
29
44c63e7fd0d0
Added a service to list the supported rivers of the artifact server. The FLYS instance serves a method that retrieves this list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
28
diff
changeset
|
257 * Returns a list of rivers supported by the artifact server. |
44c63e7fd0d0
Added a service to list the supported rivers of the artifact server. The FLYS instance serves a method that retrieves this list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
28
diff
changeset
|
258 * |
44c63e7fd0d0
Added a service to list the supported rivers of the artifact server. The FLYS instance serves a method that retrieves this list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
28
diff
changeset
|
259 * @return a list of rivers supported by the artifact server. |
44c63e7fd0d0
Added a service to list the supported rivers of the artifact server. The FLYS instance serves a method that retrieves this list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
28
diff
changeset
|
260 */ |
44c63e7fd0d0
Added a service to list the supported rivers of the artifact server. The FLYS instance serves a method that retrieves this list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
28
diff
changeset
|
261 public River[] getRivers() { |
217
907b61e4d702
Improved the exception handling - added warnings for user authentication errors and errors that occur while fetching supported rivers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
101
diff
changeset
|
262 return rivers; |
907b61e4d702
Improved the exception handling - added warnings for user authentication errors and errors that occur while fetching supported rivers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
101
diff
changeset
|
263 } |
29
44c63e7fd0d0
Added a service to list the supported rivers of the artifact server. The FLYS instance serves a method that retrieves this list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
28
diff
changeset
|
264 |
44c63e7fd0d0
Added a service to list the supported rivers of the artifact server. The FLYS instance serves a method that retrieves this list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
28
diff
changeset
|
265 |
217
907b61e4d702
Improved the exception handling - added warnings for user authentication errors and errors that occur while fetching supported rivers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
101
diff
changeset
|
266 protected void readRivers() { |
229
924da6695800
Each service is now called with the name of the current locale to set the request object's locale manually in the HttpClient.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
225
diff
changeset
|
267 Config config = Config.getInstance(); |
924da6695800
Each service is now called with the name of the current locale to set the request object's locale manually in the HttpClient.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
225
diff
changeset
|
268 String locale = config.getLocale(); |
924da6695800
Each service is now called with the name of the current locale to set the request object's locale manually in the HttpClient.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
225
diff
changeset
|
269 |
1425
bc06a671ef60
Removed the URL parameter from service calls. The service
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1294
diff
changeset
|
270 riverService.list(locale, new AsyncCallback<River[]>() { |
3501
0de0ef04bcdc
Delete empty project after closing CollectionView (#785).
Christian Lins <christian.lins@intevation.de>
parents:
3381
diff
changeset
|
271 @Override |
217
907b61e4d702
Improved the exception handling - added warnings for user authentication errors and errors that occur while fetching supported rivers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
101
diff
changeset
|
272 public void onFailure(Throwable caught) { |
907b61e4d702
Improved the exception handling - added warnings for user authentication errors and errors that occur while fetching supported rivers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
101
diff
changeset
|
273 GWT.log("Could not recieve a list of rivers."); |
4062
145980c21700
Handle error conditions more robust.
Christian Lins <christian.lins@intevation.de>
parents:
3989
diff
changeset
|
274 SC.warn(getExceptionString(MSG, caught)); |
217
907b61e4d702
Improved the exception handling - added warnings for user authentication errors and errors that occur while fetching supported rivers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
101
diff
changeset
|
275 } |
907b61e4d702
Improved the exception handling - added warnings for user authentication errors and errors that occur while fetching supported rivers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
101
diff
changeset
|
276 |
3501
0de0ef04bcdc
Delete empty project after closing CollectionView (#785).
Christian Lins <christian.lins@intevation.de>
parents:
3381
diff
changeset
|
277 @Override |
217
907b61e4d702
Improved the exception handling - added warnings for user authentication errors and errors that occur while fetching supported rivers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
101
diff
changeset
|
278 public void onSuccess(River[] newRivers) { |
907b61e4d702
Improved the exception handling - added warnings for user authentication errors and errors that occur while fetching supported rivers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
101
diff
changeset
|
279 GWT.log("Retrieved " + newRivers.length + " new rivers."); |
907b61e4d702
Improved the exception handling - added warnings for user authentication errors and errors that occur while fetching supported rivers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
101
diff
changeset
|
280 rivers = newRivers; |
907b61e4d702
Improved the exception handling - added warnings for user authentication errors and errors that occur while fetching supported rivers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
101
diff
changeset
|
281 } |
907b61e4d702
Improved the exception handling - added warnings for user authentication errors and errors that occur while fetching supported rivers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
101
diff
changeset
|
282 }); |
29
44c63e7fd0d0
Added a service to list the supported rivers of the artifact server. The FLYS instance serves a method that retrieves this list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
28
diff
changeset
|
283 } |
44c63e7fd0d0
Added a service to list the supported rivers of the artifact server. The FLYS instance serves a method that retrieves this list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
28
diff
changeset
|
284 |
44c63e7fd0d0
Added a service to list the supported rivers of the artifact server. The FLYS instance serves a method that retrieves this list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
28
diff
changeset
|
285 |
44c63e7fd0d0
Added a service to list the supported rivers of the artifact server. The FLYS instance serves a method that retrieves this list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
28
diff
changeset
|
286 /** |
6
e2b3966b40ca
Added a workspace that handles the collection windows. New button to open a new collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
4
diff
changeset
|
287 * This method creates a new CollectionView and adds it to the workspace. |
217
907b61e4d702
Improved the exception handling - added warnings for user authentication errors and errors that occur while fetching supported rivers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
101
diff
changeset
|
288 * <b>NOTE</b>The user needs to be logged in and there need to at least one |
907b61e4d702
Improved the exception handling - added warnings for user authentication errors and errors that occur while fetching supported rivers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
101
diff
changeset
|
289 * river - otherwise a warning is displayed and no CollectionView is |
907b61e4d702
Improved the exception handling - added warnings for user authentication errors and errors that occur while fetching supported rivers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
101
diff
changeset
|
290 * created. |
6
e2b3966b40ca
Added a workspace that handles the collection windows. New button to open a new collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
4
diff
changeset
|
291 */ |
e2b3966b40ca
Added a workspace that handles the collection windows. New button to open a new collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
4
diff
changeset
|
292 public void newProject() { |
217
907b61e4d702
Improved the exception handling - added warnings for user authentication errors and errors that occur while fetching supported rivers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
101
diff
changeset
|
293 if (getCurrentUser() == null) { |
907b61e4d702
Improved the exception handling - added warnings for user authentication errors and errors that occur while fetching supported rivers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
101
diff
changeset
|
294 SC.warn(MSG.error_not_logged_in()); |
907b61e4d702
Improved the exception handling - added warnings for user authentication errors and errors that occur while fetching supported rivers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
101
diff
changeset
|
295 return; |
907b61e4d702
Improved the exception handling - added warnings for user authentication errors and errors that occur while fetching supported rivers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
101
diff
changeset
|
296 } |
907b61e4d702
Improved the exception handling - added warnings for user authentication errors and errors that occur while fetching supported rivers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
101
diff
changeset
|
297 |
907b61e4d702
Improved the exception handling - added warnings for user authentication errors and errors that occur while fetching supported rivers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
101
diff
changeset
|
298 if (getRivers() == null) { |
907b61e4d702
Improved the exception handling - added warnings for user authentication errors and errors that occur while fetching supported rivers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
101
diff
changeset
|
299 SC.warn(MSG.error_no_rivers_found()); |
907b61e4d702
Improved the exception handling - added warnings for user authentication errors and errors that occur while fetching supported rivers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
101
diff
changeset
|
300 readRivers(); |
907b61e4d702
Improved the exception handling - added warnings for user authentication errors and errors that occur while fetching supported rivers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
101
diff
changeset
|
301 |
907b61e4d702
Improved the exception handling - added warnings for user authentication errors and errors that occur while fetching supported rivers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
101
diff
changeset
|
302 return; |
907b61e4d702
Improved the exception handling - added warnings for user authentication errors and errors that occur while fetching supported rivers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
101
diff
changeset
|
303 } |
907b61e4d702
Improved the exception handling - added warnings for user authentication errors and errors that occur while fetching supported rivers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
101
diff
changeset
|
304 |
100
95b30a5d6350
Bugfix: A collection view just creates a single time a new collection - even if we step back to a previous state and go forward afterwards.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
97
diff
changeset
|
305 CollectionView view = new CollectionView(this); |
557
92c200887b20
#21 There might be just a single window for each project now. Users can't open a project twice.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
229
diff
changeset
|
306 workspace.addView("new-project", view); |
97
0bec0112c8b3
Integrated the ProjectList into the client. Now, the Collections of a user are displayed in the list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
80
diff
changeset
|
307 |
0bec0112c8b3
Integrated the ProjectList into the client. Now, the Collections of a user are displayed in the list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
80
diff
changeset
|
308 view.addCollectionChangeHandler(getProjectList()); |
9
8facd8545a12
Added a global configuration for the client and classes providing methods to retrieve these information.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
6
diff
changeset
|
309 } |
8facd8545a12
Added a global configuration for the client and classes providing methods to retrieve these information.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
6
diff
changeset
|
310 |
8facd8545a12
Added a global configuration for the client and classes providing methods to retrieve these information.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
6
diff
changeset
|
311 |
557
92c200887b20
#21 There might be just a single window for each project now. Users can't open a project twice.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
229
diff
changeset
|
312 protected void lockProject(String uuid) { |
92c200887b20
#21 There might be just a single window for each project now. Users can't open a project twice.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
229
diff
changeset
|
313 if (isProjectLocked(uuid)) { |
92c200887b20
#21 There might be just a single window for each project now. Users can't open a project twice.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
229
diff
changeset
|
314 return; |
92c200887b20
#21 There might be just a single window for each project now. Users can't open a project twice.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
229
diff
changeset
|
315 } |
92c200887b20
#21 There might be just a single window for each project now. Users can't open a project twice.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
229
diff
changeset
|
316 |
92c200887b20
#21 There might be just a single window for each project now. Users can't open a project twice.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
229
diff
changeset
|
317 openProjects.add(uuid); |
92c200887b20
#21 There might be just a single window for each project now. Users can't open a project twice.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
229
diff
changeset
|
318 } |
92c200887b20
#21 There might be just a single window for each project now. Users can't open a project twice.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
229
diff
changeset
|
319 |
92c200887b20
#21 There might be just a single window for each project now. Users can't open a project twice.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
229
diff
changeset
|
320 |
92c200887b20
#21 There might be just a single window for each project now. Users can't open a project twice.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
229
diff
changeset
|
321 protected void unlockProject(String uuid) { |
92c200887b20
#21 There might be just a single window for each project now. Users can't open a project twice.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
229
diff
changeset
|
322 openProjects.remove(uuid); |
92c200887b20
#21 There might be just a single window for each project now. Users can't open a project twice.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
229
diff
changeset
|
323 } |
92c200887b20
#21 There might be just a single window for each project now. Users can't open a project twice.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
229
diff
changeset
|
324 |
92c200887b20
#21 There might be just a single window for each project now. Users can't open a project twice.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
229
diff
changeset
|
325 |
3549
6a8f83c538e3
Merged revisions 5384 via svnmerge from
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
3501
diff
changeset
|
326 /** Whether project uuid is currently opened. */ |
557
92c200887b20
#21 There might be just a single window for each project now. Users can't open a project twice.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
229
diff
changeset
|
327 protected boolean isProjectLocked(String uuid) { |
92c200887b20
#21 There might be just a single window for each project now. Users can't open a project twice.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
229
diff
changeset
|
328 return openProjects.contains(uuid); |
92c200887b20
#21 There might be just a single window for each project now. Users can't open a project twice.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
229
diff
changeset
|
329 } |
92c200887b20
#21 There might be just a single window for each project now. Users can't open a project twice.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
229
diff
changeset
|
330 |
92c200887b20
#21 There might be just a single window for each project now. Users can't open a project twice.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
229
diff
changeset
|
331 |
3549
6a8f83c538e3
Merged revisions 5384 via svnmerge from
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
3501
diff
changeset
|
332 /** Opens (or bring into foreground) project with given id. */ |
557
92c200887b20
#21 There might be just a single window for each project now. Users can't open a project twice.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
229
diff
changeset
|
333 public void openProject(final String collectionID) { |
225
9040663aee01
Filled the context menu point 'Open project' of the ProjectList with life - it opens a new window displaying the parameterization of the selected project.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
217
diff
changeset
|
334 if (collectionID == null) { |
9040663aee01
Filled the context menu point 'Open project' of the ProjectList with life - it opens a new window displaying the parameterization of the selected project.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
217
diff
changeset
|
335 return; |
9040663aee01
Filled the context menu point 'Open project' of the ProjectList with life - it opens a new window displaying the parameterization of the selected project.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
217
diff
changeset
|
336 } |
9040663aee01
Filled the context menu point 'Open project' of the ProjectList with life - it opens a new window displaying the parameterization of the selected project.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
217
diff
changeset
|
337 |
557
92c200887b20
#21 There might be just a single window for each project now. Users can't open a project twice.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
229
diff
changeset
|
338 if (isProjectLocked(collectionID)) { |
92c200887b20
#21 There might be just a single window for each project now. Users can't open a project twice.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
229
diff
changeset
|
339 workspace.bringUp(collectionID); |
92c200887b20
#21 There might be just a single window for each project now. Users can't open a project twice.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
229
diff
changeset
|
340 return; |
92c200887b20
#21 There might be just a single window for each project now. Users can't open a project twice.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
229
diff
changeset
|
341 } |
92c200887b20
#21 There might be just a single window for each project now. Users can't open a project twice.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
229
diff
changeset
|
342 |
92c200887b20
#21 There might be just a single window for each project now. Users can't open a project twice.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
229
diff
changeset
|
343 lockProject(collectionID); |
92c200887b20
#21 There might be just a single window for each project now. Users can't open a project twice.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
229
diff
changeset
|
344 |
225
9040663aee01
Filled the context menu point 'Open project' of the ProjectList with life - it opens a new window displaying the parameterization of the selected project.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
217
diff
changeset
|
345 GWT.log("Open existing project: " + collectionID); |
9040663aee01
Filled the context menu point 'Open project' of the ProjectList with life - it opens a new window displaying the parameterization of the selected project.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
217
diff
changeset
|
346 |
229
924da6695800
Each service is now called with the name of the current locale to set the request object's locale manually in the HttpClient.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
225
diff
changeset
|
347 Config config = Config.getInstance(); |
924da6695800
Each service is now called with the name of the current locale to set the request object's locale manually in the HttpClient.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
225
diff
changeset
|
348 final String locale = config.getLocale(); |
225
9040663aee01
Filled the context menu point 'Open project' of the ProjectList with life - it opens a new window displaying the parameterization of the selected project.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
217
diff
changeset
|
349 |
1425
bc06a671ef60
Removed the URL parameter from service calls. The service
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1294
diff
changeset
|
350 describeCollectionService.describe(collectionID, locale, |
225
9040663aee01
Filled the context menu point 'Open project' of the ProjectList with life - it opens a new window displaying the parameterization of the selected project.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
217
diff
changeset
|
351 new AsyncCallback<Collection>() { |
3501
0de0ef04bcdc
Delete empty project after closing CollectionView (#785).
Christian Lins <christian.lins@intevation.de>
parents:
3381
diff
changeset
|
352 @Override |
225
9040663aee01
Filled the context menu point 'Open project' of the ProjectList with life - it opens a new window displaying the parameterization of the selected project.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
217
diff
changeset
|
353 public void onFailure(Throwable caught) { |
4062
145980c21700
Handle error conditions more robust.
Christian Lins <christian.lins@intevation.de>
parents:
3989
diff
changeset
|
354 SC.warn(getExceptionString(MSG, caught)); |
225
9040663aee01
Filled the context menu point 'Open project' of the ProjectList with life - it opens a new window displaying the parameterization of the selected project.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
217
diff
changeset
|
355 } |
9040663aee01
Filled the context menu point 'Open project' of the ProjectList with life - it opens a new window displaying the parameterization of the selected project.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
217
diff
changeset
|
356 |
3501
0de0ef04bcdc
Delete empty project after closing CollectionView (#785).
Christian Lins <christian.lins@intevation.de>
parents:
3381
diff
changeset
|
357 @Override |
225
9040663aee01
Filled the context menu point 'Open project' of the ProjectList with life - it opens a new window displaying the parameterization of the selected project.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
217
diff
changeset
|
358 public void onSuccess(Collection c) { |
9040663aee01
Filled the context menu point 'Open project' of the ProjectList with life - it opens a new window displaying the parameterization of the selected project.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
217
diff
changeset
|
359 final Collection collection = c; |
1294
94d4f040da3a
Bugfix: #326 Made the process of opening existing project more robust if the collection has no artifact set.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
864
diff
changeset
|
360 |
94d4f040da3a
Bugfix: #326 Made the process of opening existing project more robust if the collection has no artifact set.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
864
diff
changeset
|
361 if (collection.getItemLength() == 0) { |
94d4f040da3a
Bugfix: #326 Made the process of opening existing project more robust if the collection has no artifact set.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
864
diff
changeset
|
362 CollectionView view = new CollectionView( |
94d4f040da3a
Bugfix: #326 Made the process of opening existing project more robust if the collection has no artifact set.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
864
diff
changeset
|
363 FLYS.this, collection, null); |
94d4f040da3a
Bugfix: #326 Made the process of opening existing project more robust if the collection has no artifact set.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
864
diff
changeset
|
364 |
94d4f040da3a
Bugfix: #326 Made the process of opening existing project more robust if the collection has no artifact set.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
864
diff
changeset
|
365 view.addCollectionChangeHandler( |
94d4f040da3a
Bugfix: #326 Made the process of opening existing project more robust if the collection has no artifact set.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
864
diff
changeset
|
366 getProjectList()); |
94d4f040da3a
Bugfix: #326 Made the process of opening existing project more robust if the collection has no artifact set.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
864
diff
changeset
|
367 view.addCloseClickHandler( |
94d4f040da3a
Bugfix: #326 Made the process of opening existing project more robust if the collection has no artifact set.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
864
diff
changeset
|
368 new CloseCollectionViewHandler( |
94d4f040da3a
Bugfix: #326 Made the process of opening existing project more robust if the collection has no artifact set.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
864
diff
changeset
|
369 FLYS.this, collectionID)); |
94d4f040da3a
Bugfix: #326 Made the process of opening existing project more robust if the collection has no artifact set.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
864
diff
changeset
|
370 |
94d4f040da3a
Bugfix: #326 Made the process of opening existing project more robust if the collection has no artifact set.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
864
diff
changeset
|
371 workspace.addView(collectionID, view); |
94d4f040da3a
Bugfix: #326 Made the process of opening existing project more robust if the collection has no artifact set.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
864
diff
changeset
|
372 |
94d4f040da3a
Bugfix: #326 Made the process of opening existing project more robust if the collection has no artifact set.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
864
diff
changeset
|
373 return; |
94d4f040da3a
Bugfix: #326 Made the process of opening existing project more robust if the collection has no artifact set.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
864
diff
changeset
|
374 } |
94d4f040da3a
Bugfix: #326 Made the process of opening existing project more robust if the collection has no artifact set.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
864
diff
changeset
|
375 |
3381
6b5920c7ea6e
Cosmetics, docs.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1619
diff
changeset
|
376 final CollectionItem item = c.getItem(0); |
225
9040663aee01
Filled the context menu point 'Open project' of the ProjectList with life - it opens a new window displaying the parameterization of the selected project.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
217
diff
changeset
|
377 |
9040663aee01
Filled the context menu point 'Open project' of the ProjectList with life - it opens a new window displaying the parameterization of the selected project.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
217
diff
changeset
|
378 if (item == null) { |
9040663aee01
Filled the context menu point 'Open project' of the ProjectList with life - it opens a new window displaying the parameterization of the selected project.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
217
diff
changeset
|
379 SC.warn(MSG.error_load_parameterization()); |
9040663aee01
Filled the context menu point 'Open project' of the ProjectList with life - it opens a new window displaying the parameterization of the selected project.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
217
diff
changeset
|
380 return; |
9040663aee01
Filled the context menu point 'Open project' of the ProjectList with life - it opens a new window displaying the parameterization of the selected project.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
217
diff
changeset
|
381 } |
9040663aee01
Filled the context menu point 'Open project' of the ProjectList with life - it opens a new window displaying the parameterization of the selected project.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
217
diff
changeset
|
382 |
9040663aee01
Filled the context menu point 'Open project' of the ProjectList with life - it opens a new window displaying the parameterization of the selected project.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
217
diff
changeset
|
383 getArtifactService.getArtifact( |
229
924da6695800
Each service is now called with the name of the current locale to set the request object's locale manually in the HttpClient.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
225
diff
changeset
|
384 locale, |
225
9040663aee01
Filled the context menu point 'Open project' of the ProjectList with life - it opens a new window displaying the parameterization of the selected project.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
217
diff
changeset
|
385 item.identifier(), |
9040663aee01
Filled the context menu point 'Open project' of the ProjectList with life - it opens a new window displaying the parameterization of the selected project.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
217
diff
changeset
|
386 item.hash(), |
9040663aee01
Filled the context menu point 'Open project' of the ProjectList with life - it opens a new window displaying the parameterization of the selected project.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
217
diff
changeset
|
387 new AsyncCallback<Artifact>() { |
3501
0de0ef04bcdc
Delete empty project after closing CollectionView (#785).
Christian Lins <christian.lins@intevation.de>
parents:
3381
diff
changeset
|
388 @Override |
225
9040663aee01
Filled the context menu point 'Open project' of the ProjectList with life - it opens a new window displaying the parameterization of the selected project.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
217
diff
changeset
|
389 public void onFailure(Throwable caught) { |
557
92c200887b20
#21 There might be just a single window for each project now. Users can't open a project twice.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
229
diff
changeset
|
390 unlockProject(collectionID); |
4062
145980c21700
Handle error conditions more robust.
Christian Lins <christian.lins@intevation.de>
parents:
3989
diff
changeset
|
391 SC.warn(getExceptionString(MSG, caught)); |
225
9040663aee01
Filled the context menu point 'Open project' of the ProjectList with life - it opens a new window displaying the parameterization of the selected project.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
217
diff
changeset
|
392 } |
9040663aee01
Filled the context menu point 'Open project' of the ProjectList with life - it opens a new window displaying the parameterization of the selected project.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
217
diff
changeset
|
393 |
3501
0de0ef04bcdc
Delete empty project after closing CollectionView (#785).
Christian Lins <christian.lins@intevation.de>
parents:
3381
diff
changeset
|
394 @Override |
225
9040663aee01
Filled the context menu point 'Open project' of the ProjectList with life - it opens a new window displaying the parameterization of the selected project.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
217
diff
changeset
|
395 public void onSuccess(Artifact artifact) { |
9040663aee01
Filled the context menu point 'Open project' of the ProjectList with life - it opens a new window displaying the parameterization of the selected project.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
217
diff
changeset
|
396 CollectionView view = new CollectionView( |
9040663aee01
Filled the context menu point 'Open project' of the ProjectList with life - it opens a new window displaying the parameterization of the selected project.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
217
diff
changeset
|
397 FLYS.this, collection, artifact); |
9040663aee01
Filled the context menu point 'Open project' of the ProjectList with life - it opens a new window displaying the parameterization of the selected project.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
217
diff
changeset
|
398 |
9040663aee01
Filled the context menu point 'Open project' of the ProjectList with life - it opens a new window displaying the parameterization of the selected project.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
217
diff
changeset
|
399 view.addCollectionChangeHandler( |
9040663aee01
Filled the context menu point 'Open project' of the ProjectList with life - it opens a new window displaying the parameterization of the selected project.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
217
diff
changeset
|
400 getProjectList()); |
557
92c200887b20
#21 There might be just a single window for each project now. Users can't open a project twice.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
229
diff
changeset
|
401 view.addCloseClickHandler( |
92c200887b20
#21 There might be just a single window for each project now. Users can't open a project twice.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
229
diff
changeset
|
402 new CloseCollectionViewHandler( |
92c200887b20
#21 There might be just a single window for each project now. Users can't open a project twice.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
229
diff
changeset
|
403 FLYS.this, collectionID)); |
225
9040663aee01
Filled the context menu point 'Open project' of the ProjectList with life - it opens a new window displaying the parameterization of the selected project.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
217
diff
changeset
|
404 |
557
92c200887b20
#21 There might be just a single window for each project now. Users can't open a project twice.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
229
diff
changeset
|
405 workspace.addView(collectionID, view); |
225
9040663aee01
Filled the context menu point 'Open project' of the ProjectList with life - it opens a new window displaying the parameterization of the selected project.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
217
diff
changeset
|
406 } |
9040663aee01
Filled the context menu point 'Open project' of the ProjectList with life - it opens a new window displaying the parameterization of the selected project.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
217
diff
changeset
|
407 }); |
9040663aee01
Filled the context menu point 'Open project' of the ProjectList with life - it opens a new window displaying the parameterization of the selected project.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
217
diff
changeset
|
408 |
9040663aee01
Filled the context menu point 'Open project' of the ProjectList with life - it opens a new window displaying the parameterization of the selected project.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
217
diff
changeset
|
409 } |
9040663aee01
Filled the context menu point 'Open project' of the ProjectList with life - it opens a new window displaying the parameterization of the selected project.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
217
diff
changeset
|
410 }); |
9040663aee01
Filled the context menu point 'Open project' of the ProjectList with life - it opens a new window displaying the parameterization of the selected project.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
217
diff
changeset
|
411 } |
9040663aee01
Filled the context menu point 'Open project' of the ProjectList with life - it opens a new window displaying the parameterization of the selected project.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
217
diff
changeset
|
412 |
9040663aee01
Filled the context menu point 'Open project' of the ProjectList with life - it opens a new window displaying the parameterization of the selected project.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
217
diff
changeset
|
413 |
611
854312c0528c
#21 Newly created projects cannot be opened twice.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
605
diff
changeset
|
414 public void closeProject(String uuid) { |
854312c0528c
#21 Newly created projects cannot be opened twice.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
605
diff
changeset
|
415 unlockProject(uuid); |
854312c0528c
#21 Newly created projects cannot be opened twice.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
605
diff
changeset
|
416 workspace.destroyProject(uuid); |
854312c0528c
#21 Newly created projects cannot be opened twice.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
605
diff
changeset
|
417 } |
854312c0528c
#21 Newly created projects cannot be opened twice.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
605
diff
changeset
|
418 |
854312c0528c
#21 Newly created projects cannot be opened twice.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
605
diff
changeset
|
419 |
9
8facd8545a12
Added a global configuration for the client and classes providing methods to retrieve these information.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
6
diff
changeset
|
420 /** |
8facd8545a12
Added a global configuration for the client and classes providing methods to retrieve these information.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
6
diff
changeset
|
421 * Create a new Artifact. |
8facd8545a12
Added a global configuration for the client and classes providing methods to retrieve these information.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
6
diff
changeset
|
422 */ |
8facd8545a12
Added a global configuration for the client and classes providing methods to retrieve these information.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
6
diff
changeset
|
423 public void newArtifact(String factory) { |
229
924da6695800
Each service is now called with the name of the current locale to set the request object's locale manually in the HttpClient.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
225
diff
changeset
|
424 Config config = Config.getInstance(); |
924da6695800
Each service is now called with the name of the current locale to set the request object's locale manually in the HttpClient.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
225
diff
changeset
|
425 String locale = config.getLocale(); |
14
fe2f4d1dd784
Integrated the httpclient for the communication between client and server. It is now possible to create a new WINFO artifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
9
diff
changeset
|
426 |
1425
bc06a671ef60
Removed the URL parameter from service calls. The service
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1294
diff
changeset
|
427 artifactService.create(locale, factory, null, |
229
924da6695800
Each service is now called with the name of the current locale to set the request object's locale manually in the HttpClient.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
225
diff
changeset
|
428 new AsyncCallback<Artifact>() { |
3501
0de0ef04bcdc
Delete empty project after closing CollectionView (#785).
Christian Lins <christian.lins@intevation.de>
parents:
3381
diff
changeset
|
429 @Override |
229
924da6695800
Each service is now called with the name of the current locale to set the request object's locale manually in the HttpClient.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
225
diff
changeset
|
430 public void onFailure(Throwable caught) { |
924da6695800
Each service is now called with the name of the current locale to set the request object's locale manually in the HttpClient.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
225
diff
changeset
|
431 GWT.log("Could not create the new artifact."); |
4062
145980c21700
Handle error conditions more robust.
Christian Lins <christian.lins@intevation.de>
parents:
3989
diff
changeset
|
432 SC.warn(getExceptionString(MSG, caught)); |
229
924da6695800
Each service is now called with the name of the current locale to set the request object's locale manually in the HttpClient.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
225
diff
changeset
|
433 } |
9
8facd8545a12
Added a global configuration for the client and classes providing methods to retrieve these information.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
6
diff
changeset
|
434 |
3501
0de0ef04bcdc
Delete empty project after closing CollectionView (#785).
Christian Lins <christian.lins@intevation.de>
parents:
3381
diff
changeset
|
435 @Override |
229
924da6695800
Each service is now called with the name of the current locale to set the request object's locale manually in the HttpClient.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
225
diff
changeset
|
436 public void onSuccess(Artifact artifact) { |
924da6695800
Each service is now called with the name of the current locale to set the request object's locale manually in the HttpClient.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
225
diff
changeset
|
437 GWT.log("Successfully created a new artifact."); |
924da6695800
Each service is now called with the name of the current locale to set the request object's locale manually in the HttpClient.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
225
diff
changeset
|
438 } |
9
8facd8545a12
Added a global configuration for the client and classes providing methods to retrieve these information.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
6
diff
changeset
|
439 }); |
6
e2b3966b40ca
Added a workspace that handles the collection windows. New button to open a new collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
4
diff
changeset
|
440 } |
557
92c200887b20
#21 There might be just a single window for each project now. Users can't open a project twice.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
229
diff
changeset
|
441 |
3865
436eec3be6ff
Allow to create a discharge curve from a gauge info
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
3698
diff
changeset
|
442 public void newGaugeDischargeCurve(String river, Long gaugeref) { |
436eec3be6ff
Allow to create a discharge curve from a gauge info
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
3698
diff
changeset
|
443 Config config = Config.getInstance(); |
436eec3be6ff
Allow to create a discharge curve from a gauge info
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
3698
diff
changeset
|
444 |
436eec3be6ff
Allow to create a discharge curve from a gauge info
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
3698
diff
changeset
|
445 final String locale = config.getLocale(); |
436eec3be6ff
Allow to create a discharge curve from a gauge info
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
3698
diff
changeset
|
446 final String riv = river; |
436eec3be6ff
Allow to create a discharge curve from a gauge info
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
3698
diff
changeset
|
447 final Long ref = gaugeref; |
436eec3be6ff
Allow to create a discharge curve from a gauge info
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
3698
diff
changeset
|
448 final FLYS flys = this; |
436eec3be6ff
Allow to create a discharge curve from a gauge info
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
3698
diff
changeset
|
449 |
436eec3be6ff
Allow to create a discharge curve from a gauge info
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
3698
diff
changeset
|
450 User user = getCurrentUser(); |
436eec3be6ff
Allow to create a discharge curve from a gauge info
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
3698
diff
changeset
|
451 |
436eec3be6ff
Allow to create a discharge curve from a gauge info
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
3698
diff
changeset
|
452 if (user == null) { |
436eec3be6ff
Allow to create a discharge curve from a gauge info
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
3698
diff
changeset
|
453 SC.warn(MSG.error_not_logged_in()); |
436eec3be6ff
Allow to create a discharge curve from a gauge info
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
3698
diff
changeset
|
454 return; |
436eec3be6ff
Allow to create a discharge curve from a gauge info
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
3698
diff
changeset
|
455 } |
436eec3be6ff
Allow to create a discharge curve from a gauge info
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
3698
diff
changeset
|
456 |
436eec3be6ff
Allow to create a discharge curve from a gauge info
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
3698
diff
changeset
|
457 collectionService.create(locale, user.identifier(), |
436eec3be6ff
Allow to create a discharge curve from a gauge info
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
3698
diff
changeset
|
458 new AsyncCallback<Collection>() { |
436eec3be6ff
Allow to create a discharge curve from a gauge info
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
3698
diff
changeset
|
459 @Override |
436eec3be6ff
Allow to create a discharge curve from a gauge info
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
3698
diff
changeset
|
460 public void onFailure(Throwable caught) { |
436eec3be6ff
Allow to create a discharge curve from a gauge info
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
3698
diff
changeset
|
461 GWT.log("Could not create new collection."); |
4062
145980c21700
Handle error conditions more robust.
Christian Lins <christian.lins@intevation.de>
parents:
3989
diff
changeset
|
462 SC.warn(getExceptionString(MSG, caught)); |
3865
436eec3be6ff
Allow to create a discharge curve from a gauge info
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
3698
diff
changeset
|
463 } |
436eec3be6ff
Allow to create a discharge curve from a gauge info
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
3698
diff
changeset
|
464 |
436eec3be6ff
Allow to create a discharge curve from a gauge info
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
3698
diff
changeset
|
465 @Override |
436eec3be6ff
Allow to create a discharge curve from a gauge info
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
3698
diff
changeset
|
466 public void onSuccess(Collection collection) { |
436eec3be6ff
Allow to create a discharge curve from a gauge info
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
3698
diff
changeset
|
467 GWT.log("Successfully created a new collection."); |
436eec3be6ff
Allow to create a discharge curve from a gauge info
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
3698
diff
changeset
|
468 final Collection col = collection; |
3980 | 469 artifactService.createGaugeDischargeCurveArtifact( |
3865
436eec3be6ff
Allow to create a discharge curve from a gauge info
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
3698
diff
changeset
|
470 col, locale, riv, ref, |
436eec3be6ff
Allow to create a discharge curve from a gauge info
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
3698
diff
changeset
|
471 new AsyncCallback<Artifact>() { |
436eec3be6ff
Allow to create a discharge curve from a gauge info
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
3698
diff
changeset
|
472 @Override |
436eec3be6ff
Allow to create a discharge curve from a gauge info
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
3698
diff
changeset
|
473 public void onFailure(Throwable caught) { |
436eec3be6ff
Allow to create a discharge curve from a gauge info
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
3698
diff
changeset
|
474 GWT.log("Could not create the new artifact."); |
4062
145980c21700
Handle error conditions more robust.
Christian Lins <christian.lins@intevation.de>
parents:
3989
diff
changeset
|
475 SC.warn(getExceptionString(MSG, caught)); |
3865
436eec3be6ff
Allow to create a discharge curve from a gauge info
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
3698
diff
changeset
|
476 } |
436eec3be6ff
Allow to create a discharge curve from a gauge info
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
3698
diff
changeset
|
477 |
436eec3be6ff
Allow to create a discharge curve from a gauge info
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
3698
diff
changeset
|
478 @Override |
436eec3be6ff
Allow to create a discharge curve from a gauge info
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
3698
diff
changeset
|
479 public void onSuccess(Artifact artifact) { |
436eec3be6ff
Allow to create a discharge curve from a gauge info
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
3698
diff
changeset
|
480 GWT.log("Successfully created a new artifact."); |
436eec3be6ff
Allow to create a discharge curve from a gauge info
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
3698
diff
changeset
|
481 CollectionView view = new CollectionView(flys, |
436eec3be6ff
Allow to create a discharge curve from a gauge info
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
3698
diff
changeset
|
482 col, artifact); |
4141
b3bc5e9ba912
Fix for part a) and c) in issue #918
Björn Ricks <bjoern.ricks@intevation.de>
parents:
4062
diff
changeset
|
483 workspace.addView(col.identifier(), view); |
3865
436eec3be6ff
Allow to create a discharge curve from a gauge info
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
3698
diff
changeset
|
484 |
436eec3be6ff
Allow to create a discharge curve from a gauge info
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
3698
diff
changeset
|
485 view.addCollectionChangeHandler(getProjectList()); |
4141
b3bc5e9ba912
Fix for part a) and c) in issue #918
Björn Ricks <bjoern.ricks@intevation.de>
parents:
4062
diff
changeset
|
486 view.addCloseClickHandler( |
b3bc5e9ba912
Fix for part a) and c) in issue #918
Björn Ricks <bjoern.ricks@intevation.de>
parents:
4062
diff
changeset
|
487 new CloseCollectionViewHandler( |
b3bc5e9ba912
Fix for part a) and c) in issue #918
Björn Ricks <bjoern.ricks@intevation.de>
parents:
4062
diff
changeset
|
488 FLYS.this, col.identifier())); |
b3bc5e9ba912
Fix for part a) and c) in issue #918
Björn Ricks <bjoern.ricks@intevation.de>
parents:
4062
diff
changeset
|
489 projectList.updateUserCollections(); |
3865
436eec3be6ff
Allow to create a discharge curve from a gauge info
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
3698
diff
changeset
|
490 } |
436eec3be6ff
Allow to create a discharge curve from a gauge info
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
3698
diff
changeset
|
491 }); |
436eec3be6ff
Allow to create a discharge curve from a gauge info
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
3698
diff
changeset
|
492 } |
436eec3be6ff
Allow to create a discharge curve from a gauge info
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
3698
diff
changeset
|
493 }); |
436eec3be6ff
Allow to create a discharge curve from a gauge info
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
3698
diff
changeset
|
494 } |
557
92c200887b20
#21 There might be just a single window for each project now. Users can't open a project twice.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
229
diff
changeset
|
495 |
3501
0de0ef04bcdc
Delete empty project after closing CollectionView (#785).
Christian Lins <christian.lins@intevation.de>
parents:
3381
diff
changeset
|
496 @Override |
611
854312c0528c
#21 Newly created projects cannot be opened twice.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
605
diff
changeset
|
497 public void onCollectionChange(CollectionChangeEvent event) { |
854312c0528c
#21 Newly created projects cannot be opened twice.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
605
diff
changeset
|
498 Collection oldC = event.getOldValue(); |
854312c0528c
#21 Newly created projects cannot be opened twice.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
605
diff
changeset
|
499 |
854312c0528c
#21 Newly created projects cannot be opened twice.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
605
diff
changeset
|
500 if (oldC == null) { |
854312c0528c
#21 Newly created projects cannot be opened twice.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
605
diff
changeset
|
501 Collection newC = event.getNewValue(); |
854312c0528c
#21 Newly created projects cannot be opened twice.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
605
diff
changeset
|
502 lockProject(newC.identifier()); |
854312c0528c
#21 Newly created projects cannot be opened twice.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
605
diff
changeset
|
503 } |
854312c0528c
#21 Newly created projects cannot be opened twice.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
605
diff
changeset
|
504 } |
854312c0528c
#21 Newly created projects cannot be opened twice.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
605
diff
changeset
|
505 |
854312c0528c
#21 Newly created projects cannot be opened twice.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
605
diff
changeset
|
506 |
557
92c200887b20
#21 There might be just a single window for each project now. Users can't open a project twice.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
229
diff
changeset
|
507 |
92c200887b20
#21 There might be just a single window for each project now. Users can't open a project twice.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
229
diff
changeset
|
508 /** |
92c200887b20
#21 There might be just a single window for each project now. Users can't open a project twice.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
229
diff
changeset
|
509 * This CloseClickHandler is used to remove lock on a specific Collection so |
92c200887b20
#21 There might be just a single window for each project now. Users can't open a project twice.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
229
diff
changeset
|
510 * that is might be opened again. |
92c200887b20
#21 There might be just a single window for each project now. Users can't open a project twice.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
229
diff
changeset
|
511 */ |
611
854312c0528c
#21 Newly created projects cannot be opened twice.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
605
diff
changeset
|
512 public class CloseCollectionViewHandler implements CloseClickHandler { |
557
92c200887b20
#21 There might be just a single window for each project now. Users can't open a project twice.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
229
diff
changeset
|
513 protected FLYS flys; |
92c200887b20
#21 There might be just a single window for each project now. Users can't open a project twice.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
229
diff
changeset
|
514 protected String uuid; |
92c200887b20
#21 There might be just a single window for each project now. Users can't open a project twice.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
229
diff
changeset
|
515 |
92c200887b20
#21 There might be just a single window for each project now. Users can't open a project twice.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
229
diff
changeset
|
516 public CloseCollectionViewHandler(FLYS flys, String uuid) { |
92c200887b20
#21 There might be just a single window for each project now. Users can't open a project twice.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
229
diff
changeset
|
517 this.flys = flys; |
92c200887b20
#21 There might be just a single window for each project now. Users can't open a project twice.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
229
diff
changeset
|
518 this.uuid = uuid; |
92c200887b20
#21 There might be just a single window for each project now. Users can't open a project twice.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
229
diff
changeset
|
519 } |
92c200887b20
#21 There might be just a single window for each project now. Users can't open a project twice.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
229
diff
changeset
|
520 |
3501
0de0ef04bcdc
Delete empty project after closing CollectionView (#785).
Christian Lins <christian.lins@intevation.de>
parents:
3381
diff
changeset
|
521 @Override |
1619
f8c03d3af300
Reactivated the Enterprise Blue theme. Fixes some icon and image issues in IE8.
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1493
diff
changeset
|
522 public void onCloseClick(CloseClickEvent event) { |
611
854312c0528c
#21 Newly created projects cannot be opened twice.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
605
diff
changeset
|
523 flys.closeProject(uuid); |
557
92c200887b20
#21 There might be just a single window for each project now. Users can't open a project twice.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
229
diff
changeset
|
524 } |
92c200887b20
#21 There might be just a single window for each project now. Users can't open a project twice.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
229
diff
changeset
|
525 } |
0
4e8be5e7855f
Start of a GWT based client for FLYS-3.0
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
526 } |
1
0e22a19852e7
Removed useless auto generated classes and added first ui elements with i18n support.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
0
diff
changeset
|
527 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : |