Mercurial > dive4elements > river
annotate gwt-client/src/main/java/org/dive4elements/river/client/client/FLYS.java @ 7597:fca46ce8e4f5
(issue1225) Implement Magic labels.
There is now a new value in the chartsettings "Suggested Label" which
is hidden in the property editor. A suggested label is the label that
combines the label's of all processors that wrote data to an axis.
This suggested label is set as the label when the user has not
overwritten the label.
author | Andre Heinecke <aheinecke@intevation.de> |
---|---|
date | Mon, 25 Nov 2013 14:58:14 +0100 |
parents | d19a0ffb9ccf |
children | 519023ce3500 |
rev | line source |
---|---|
5861
172338b1407f
GWT client: Added copyright header.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5838
diff
changeset
|
1 /* Copyright (C) 2011, 2012, 2013 by Bundesanstalt für Gewässerkunde |
172338b1407f
GWT client: Added copyright header.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5838
diff
changeset
|
2 * Software engineering by Intevation GmbH |
172338b1407f
GWT client: Added copyright header.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5838
diff
changeset
|
3 * |
5993
ea9eef426962
Removed trailing whitespace.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5861
diff
changeset
|
4 * This file is Free Software under the GNU AGPL (>=v3) |
5861
172338b1407f
GWT client: Added copyright header.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5838
diff
changeset
|
5 * and comes with ABSOLUTELY NO WARRANTY! Check out the |
5993
ea9eef426962
Removed trailing whitespace.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5861
diff
changeset
|
6 * documentation coming with Dive4Elements River for details. |
5861
172338b1407f
GWT client: Added copyright header.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5838
diff
changeset
|
7 */ |
172338b1407f
GWT client: Added copyright header.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5838
diff
changeset
|
8 |
5835
821a02bbfb4e
Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5834
diff
changeset
|
9 package org.dive4elements.river.client.client; |
0
4e8be5e7855f
Start of a GWT based client for FLYS-3.0
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
10 |
4e8be5e7855f
Start of a GWT based client for FLYS-3.0
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
11 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
|
12 import com.google.gwt.core.client.GWT; |
605
9e30c776cbef
Improved the exception handling.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
600
diff
changeset
|
13 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
|
14 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
|
15 import com.google.gwt.xml.client.XMLParser; |
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
|
16 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
|
17 import com.smartgwt.client.widgets.HTMLPane; |
605
9e30c776cbef
Improved the exception handling.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
600
diff
changeset
|
18 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
|
19 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
|
20 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
|
21 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
|
22 |
6475
b0b0ba6e7bb0
Add client side servlets and service stubs for ServerInfoService.
Christian Lins <christian.lins@intevation.de>
parents:
6132
diff
changeset
|
23 import java.util.ArrayList; |
b0b0ba6e7bb0
Add client side servlets and service stubs for ServerInfoService.
Christian Lins <christian.lins@intevation.de>
parents:
6132
diff
changeset
|
24 import java.util.List; |
b0b0ba6e7bb0
Add client side servlets and service stubs for ServerInfoService.
Christian Lins <christian.lins@intevation.de>
parents:
6132
diff
changeset
|
25 import java.util.Map; |
b0b0ba6e7bb0
Add client side servlets and service stubs for ServerInfoService.
Christian Lins <christian.lins@intevation.de>
parents:
6132
diff
changeset
|
26 import java.util.MissingResourceException; |
b0b0ba6e7bb0
Add client side servlets and service stubs for ServerInfoService.
Christian Lins <christian.lins@intevation.de>
parents:
6132
diff
changeset
|
27 import java.util.Set; |
b0b0ba6e7bb0
Add client side servlets and service stubs for ServerInfoService.
Christian Lins <christian.lins@intevation.de>
parents:
6132
diff
changeset
|
28 |
5835
821a02bbfb4e
Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5834
diff
changeset
|
29 import org.dive4elements.river.client.client.event.CollectionChangeEvent; |
821a02bbfb4e
Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5834
diff
changeset
|
30 import org.dive4elements.river.client.client.event.CollectionChangeHandler; |
821a02bbfb4e
Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5834
diff
changeset
|
31 import org.dive4elements.river.client.client.services.ArtifactService; |
821a02bbfb4e
Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5834
diff
changeset
|
32 import org.dive4elements.river.client.client.services.ArtifactServiceAsync; |
821a02bbfb4e
Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5834
diff
changeset
|
33 import org.dive4elements.river.client.client.services.CreateCollectionService; |
821a02bbfb4e
Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5834
diff
changeset
|
34 import org.dive4elements.river.client.client.services.CreateCollectionServiceAsync; |
821a02bbfb4e
Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5834
diff
changeset
|
35 import org.dive4elements.river.client.client.services.DescribeCollectionService; |
821a02bbfb4e
Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5834
diff
changeset
|
36 import org.dive4elements.river.client.client.services.DescribeCollectionServiceAsync; |
821a02bbfb4e
Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5834
diff
changeset
|
37 import org.dive4elements.river.client.client.services.GetArtifactService; |
821a02bbfb4e
Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5834
diff
changeset
|
38 import org.dive4elements.river.client.client.services.GetArtifactServiceAsync; |
821a02bbfb4e
Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5834
diff
changeset
|
39 import org.dive4elements.river.client.client.services.RiverService; |
821a02bbfb4e
Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5834
diff
changeset
|
40 import org.dive4elements.river.client.client.services.RiverServiceAsync; |
6475
b0b0ba6e7bb0
Add client side servlets and service stubs for ServerInfoService.
Christian Lins <christian.lins@intevation.de>
parents:
6132
diff
changeset
|
41 import org.dive4elements.river.client.client.services.ServerInfoService; |
b0b0ba6e7bb0
Add client side servlets and service stubs for ServerInfoService.
Christian Lins <christian.lins@intevation.de>
parents:
6132
diff
changeset
|
42 import org.dive4elements.river.client.client.services.ServerInfoServiceAsync; |
5835
821a02bbfb4e
Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5834
diff
changeset
|
43 import org.dive4elements.river.client.client.services.UserService; |
821a02bbfb4e
Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5834
diff
changeset
|
44 import org.dive4elements.river.client.client.services.UserServiceAsync; |
821a02bbfb4e
Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5834
diff
changeset
|
45 import org.dive4elements.river.client.client.ui.CollectionView; |
821a02bbfb4e
Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5834
diff
changeset
|
46 import org.dive4elements.river.client.client.ui.FLYSHeader; |
821a02bbfb4e
Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5834
diff
changeset
|
47 import org.dive4elements.river.client.client.ui.FLYSView; |
821a02bbfb4e
Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5834
diff
changeset
|
48 import org.dive4elements.river.client.client.ui.FLYSWorkspace; |
821a02bbfb4e
Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5834
diff
changeset
|
49 import org.dive4elements.river.client.client.ui.ProjectList; |
6475
b0b0ba6e7bb0
Add client side servlets and service stubs for ServerInfoService.
Christian Lins <christian.lins@intevation.de>
parents:
6132
diff
changeset
|
50 import org.dive4elements.river.client.client.ui.wq.WQAutoTabSet; |
5835
821a02bbfb4e
Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5834
diff
changeset
|
51 import org.dive4elements.river.client.shared.model.Artifact; |
821a02bbfb4e
Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5834
diff
changeset
|
52 import org.dive4elements.river.client.shared.model.Collection; |
821a02bbfb4e
Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5834
diff
changeset
|
53 import org.dive4elements.river.client.shared.model.CollectionItem; |
821a02bbfb4e
Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5834
diff
changeset
|
54 import org.dive4elements.river.client.shared.model.GaugeInfo; |
821a02bbfb4e
Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5834
diff
changeset
|
55 import org.dive4elements.river.client.shared.model.River; |
821a02bbfb4e
Fixed internal java dependencies
Sascha L. Teichmann <teichmann@intevation.de>
parents:
5834
diff
changeset
|
56 import org.dive4elements.river.client.shared.model.User; |
3501
0de0ef04bcdc
Delete empty project after closing CollectionView (#785).
Christian Lins <christian.lins@intevation.de>
parents:
3381
diff
changeset
|
57 |
0
4e8be5e7855f
Start of a GWT based client for FLYS-3.0
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
58 |
4e8be5e7855f
Start of a GWT based client for FLYS-3.0
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
59 /** |
4e8be5e7855f
Start of a GWT based client for FLYS-3.0
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
60 * 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
|
61 * |
0e22a19852e7
Removed useless auto generated classes and added first ui elements with i18n support.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
0
diff
changeset
|
62 * @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
|
63 */ |
611
854312c0528c
#21 Newly created projects cannot be opened twice.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
605
diff
changeset
|
64 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
|
65 |
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
|
66 /** 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
|
67 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
|
68 |
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
|
69 /** 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
|
70 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
|
71 |
6475
b0b0ba6e7bb0
Add client side servlets and service stubs for ServerInfoService.
Christian Lins <christian.lins@intevation.de>
parents:
6132
diff
changeset
|
72 protected ServerInfoServiceAsync serverInfoService = GWT.create(ServerInfoService.class); |
b0b0ba6e7bb0
Add client side servlets and service stubs for ServerInfoService.
Christian Lins <christian.lins@intevation.de>
parents:
6132
diff
changeset
|
73 |
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
|
74 /** 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
|
75 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
|
76 |
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
|
77 /** 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
|
78 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
|
79 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
|
80 |
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 /** 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
|
82 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
|
83 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
|
84 |
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
|
85 /** 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
|
86 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
|
87 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
|
88 |
3865
436eec3be6ff
Allow to create a discharge curve from a gauge info
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
3698
diff
changeset
|
89 /** 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
|
90 protected CreateCollectionServiceAsync collectionService = |
436eec3be6ff
Allow to create a discharge curve from a gauge info
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
3698
diff
changeset
|
91 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
|
92 |
4603
7b8063c2d589
Use the FLYSHeader instead of the MainMenu
Björn Ricks <bjoern.ricks@intevation.de>
parents:
4601
diff
changeset
|
93 /** The content window. It takes the whole space beneath the header. */ |
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
|
94 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
|
95 |
864
c0e13cf826d7
Cosmetics, doc.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
845
diff
changeset
|
96 /** 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
|
97 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
|
98 |
864
c0e13cf826d7
Cosmetics, doc.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
845
diff
changeset
|
99 /** 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
|
100 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
|
101 |
864
c0e13cf826d7
Cosmetics, doc.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
845
diff
changeset
|
102 /** 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
|
103 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
|
104 |
864
c0e13cf826d7
Cosmetics, doc.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
845
diff
changeset
|
105 /** 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
|
106 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
|
107 |
864
c0e13cf826d7
Cosmetics, doc.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
845
diff
changeset
|
108 /** 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
|
109 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
|
110 |
4603
7b8063c2d589
Use the FLYSHeader instead of the MainMenu
Björn Ricks <bjoern.ricks@intevation.de>
parents:
4601
diff
changeset
|
111 private FLYSHeader header; |
7b8063c2d589
Use the FLYSHeader instead of the MainMenu
Björn Ricks <bjoern.ricks@intevation.de>
parents:
4601
diff
changeset
|
112 |
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
|
113 |
4062
145980c21700
Handle error conditions more robust.
Christian Lins <christian.lins@intevation.de>
parents:
3989
diff
changeset
|
114 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
|
115 try { |
4062
145980c21700
Handle error conditions more robust.
Christian Lins <christian.lins@intevation.de>
parents:
3989
diff
changeset
|
116 return msg.getString(caught.getMessage()); |
3989
ccac1279eb41
More robust exception handler (#897)
Christian Lins <christian.lins@intevation.de>
parents:
3980
diff
changeset
|
117 } |
ccac1279eb41
More robust exception handler (#897)
Christian Lins <christian.lins@intevation.de>
parents:
3980
diff
changeset
|
118 catch(MissingResourceException ex) { |
ccac1279eb41
More robust exception handler (#897)
Christian Lins <christian.lins@intevation.de>
parents:
3980
diff
changeset
|
119 // There are some server error exceptions with |
ccac1279eb41
More robust exception handler (#897)
Christian Lins <christian.lins@intevation.de>
parents:
3980
diff
changeset
|
120 // varying text messages that cannot be localized |
ccac1279eb41
More robust exception handler (#897)
Christian Lins <christian.lins@intevation.de>
parents:
3980
diff
changeset
|
121 // easily. In this rare cases, use the plain |
ccac1279eb41
More robust exception handler (#897)
Christian Lins <christian.lins@intevation.de>
parents:
3980
diff
changeset
|
122 // exception message. |
ccac1279eb41
More robust exception handler (#897)
Christian Lins <christian.lins@intevation.de>
parents:
3980
diff
changeset
|
123 GWT.log("Missing resource for: " + caught.getMessage()); |
ccac1279eb41
More robust exception handler (#897)
Christian Lins <christian.lins@intevation.de>
parents:
3980
diff
changeset
|
124 return caught.getLocalizedMessage(); |
ccac1279eb41
More robust exception handler (#897)
Christian Lins <christian.lins@intevation.de>
parents:
3980
diff
changeset
|
125 } |
ccac1279eb41
More robust exception handler (#897)
Christian Lins <christian.lins@intevation.de>
parents:
3980
diff
changeset
|
126 } |
ccac1279eb41
More robust exception handler (#897)
Christian Lins <christian.lins@intevation.de>
parents:
3980
diff
changeset
|
127 |
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
|
128 /** |
0e22a19852e7
Removed useless auto generated classes and added first ui elements with i18n support.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
0
diff
changeset
|
129 * 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
|
130 */ |
3501
0de0ef04bcdc
Delete empty project after closing CollectionView (#785).
Christian Lins <christian.lins@intevation.de>
parents:
3381
diff
changeset
|
131 @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
|
132 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
|
133 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
|
134 |
787
4e0b73b7113b
Added new UI providers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
611
diff
changeset
|
135 //GWT.setUncaughtExceptionHandler(new GWT.UncaughtExceptionHandler() { |
4e0b73b7113b
Added new UI providers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
611
diff
changeset
|
136 // public void onUncaughtException(Throwable e) { |
4e0b73b7113b
Added new UI providers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
611
diff
changeset
|
137 // showWarning(e); |
4e0b73b7113b
Added new UI providers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
611
diff
changeset
|
138 // } |
4e0b73b7113b
Added new UI providers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
611
diff
changeset
|
139 //}); |
605
9e30c776cbef
Improved the exception handling.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
600
diff
changeset
|
140 |
6475
b0b0ba6e7bb0
Add client side servlets and service stubs for ServerInfoService.
Christian Lins <christian.lins@intevation.de>
parents:
6132
diff
changeset
|
141 initConfiguration(); |
b0b0ba6e7bb0
Add client side servlets and service stubs for ServerInfoService.
Christian Lins <christian.lins@intevation.de>
parents:
6132
diff
changeset
|
142 |
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
|
143 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
|
144 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
|
145 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
|
146 vertical.setHeight100(); |
0
4e8be5e7855f
Start of a GWT based client for FLYS-3.0
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
147 |
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
|
148 view = new FLYSView(); |
4603
7b8063c2d589
Use the FLYSHeader instead of the MainMenu
Björn Ricks <bjoern.ricks@intevation.de>
parents:
4601
diff
changeset
|
149 header = new FLYSHeader(this); |
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
|
150 |
4603
7b8063c2d589
Use the FLYSHeader instead of the MainMenu
Björn Ricks <bjoern.ricks@intevation.de>
parents:
4601
diff
changeset
|
151 vertical.addMember(header); |
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
|
152 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
|
153 |
797
cc3f481e9484
Introduced GwtOpenLayers to bring up maps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
787
diff
changeset
|
154 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
|
155 |
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
|
156 Config config = Config.getInstance(); |
6479
ac6c41fcae55
Use help-url provided by ServerInfoService (fix for #1197).
Christian Lins <christian.lins@intevation.de>
parents:
6475
diff
changeset
|
157 final 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
|
158 |
6475
b0b0ba6e7bb0
Add client side servlets and service stubs for ServerInfoService.
Christian Lins <christian.lins@intevation.de>
parents:
6132
diff
changeset
|
159 serverInfoService.getConfig(locale, new AsyncCallback<Map<String,String>>() { |
b0b0ba6e7bb0
Add client side servlets and service stubs for ServerInfoService.
Christian Lins <christian.lins@intevation.de>
parents:
6132
diff
changeset
|
160 |
b0b0ba6e7bb0
Add client side servlets and service stubs for ServerInfoService.
Christian Lins <christian.lins@intevation.de>
parents:
6132
diff
changeset
|
161 @Override |
b0b0ba6e7bb0
Add client side servlets and service stubs for ServerInfoService.
Christian Lins <christian.lins@intevation.de>
parents:
6132
diff
changeset
|
162 public void onSuccess(Map<String, String> result) { |
b0b0ba6e7bb0
Add client side servlets and service stubs for ServerInfoService.
Christian Lins <christian.lins@intevation.de>
parents:
6132
diff
changeset
|
163 GWT.log("serverInfoService.callBack.onSuccess"); |
b0b0ba6e7bb0
Add client side servlets and service stubs for ServerInfoService.
Christian Lins <christian.lins@intevation.de>
parents:
6132
diff
changeset
|
164 GWT.log("help-url=" + result.get("help-url")); |
6479
ac6c41fcae55
Use help-url provided by ServerInfoService (fix for #1197).
Christian Lins <christian.lins@intevation.de>
parents:
6475
diff
changeset
|
165 Config.getInstance().setWikiUrl(result.get("help-url")); |
ac6c41fcae55
Use help-url provided by ServerInfoService (fix for #1197).
Christian Lins <christian.lins@intevation.de>
parents:
6475
diff
changeset
|
166 |
ac6c41fcae55
Use help-url provided by ServerInfoService (fix for #1197).
Christian Lins <christian.lins@intevation.de>
parents:
6475
diff
changeset
|
167 // Start user service; somewhat nested here... |
6480
d19a0ffb9ccf
More robustness in FLYS.onModuleLoad() service calls.
Christian Lins <christian.lins@intevation.de>
parents:
6479
diff
changeset
|
168 startUserService(locale); |
6475
b0b0ba6e7bb0
Add client side servlets and service stubs for ServerInfoService.
Christian Lins <christian.lins@intevation.de>
parents:
6132
diff
changeset
|
169 } |
b0b0ba6e7bb0
Add client side servlets and service stubs for ServerInfoService.
Christian Lins <christian.lins@intevation.de>
parents:
6132
diff
changeset
|
170 |
b0b0ba6e7bb0
Add client side servlets and service stubs for ServerInfoService.
Christian Lins <christian.lins@intevation.de>
parents:
6132
diff
changeset
|
171 @Override |
b0b0ba6e7bb0
Add client side servlets and service stubs for ServerInfoService.
Christian Lins <christian.lins@intevation.de>
parents:
6132
diff
changeset
|
172 public void onFailure(Throwable caught) { |
6479
ac6c41fcae55
Use help-url provided by ServerInfoService (fix for #1197).
Christian Lins <christian.lins@intevation.de>
parents:
6475
diff
changeset
|
173 GWT.log("Could not read server information."); |
ac6c41fcae55
Use help-url provided by ServerInfoService (fix for #1197).
Christian Lins <christian.lins@intevation.de>
parents:
6475
diff
changeset
|
174 String msg = getExceptionString(MSG, caught); |
ac6c41fcae55
Use help-url provided by ServerInfoService (fix for #1197).
Christian Lins <christian.lins@intevation.de>
parents:
6475
diff
changeset
|
175 SC.warn(msg); |
6480
d19a0ffb9ccf
More robustness in FLYS.onModuleLoad() service calls.
Christian Lins <christian.lins@intevation.de>
parents:
6479
diff
changeset
|
176 startUserService(locale); |
d19a0ffb9ccf
More robustness in FLYS.onModuleLoad() service calls.
Christian Lins <christian.lins@intevation.de>
parents:
6479
diff
changeset
|
177 } |
d19a0ffb9ccf
More robustness in FLYS.onModuleLoad() service calls.
Christian Lins <christian.lins@intevation.de>
parents:
6479
diff
changeset
|
178 }); |
d19a0ffb9ccf
More robustness in FLYS.onModuleLoad() service calls.
Christian Lins <christian.lins@intevation.de>
parents:
6479
diff
changeset
|
179 } |
d19a0ffb9ccf
More robustness in FLYS.onModuleLoad() service calls.
Christian Lins <christian.lins@intevation.de>
parents:
6479
diff
changeset
|
180 |
d19a0ffb9ccf
More robustness in FLYS.onModuleLoad() service calls.
Christian Lins <christian.lins@intevation.de>
parents:
6479
diff
changeset
|
181 protected void startUserService(String locale) { |
d19a0ffb9ccf
More robustness in FLYS.onModuleLoad() service calls.
Christian Lins <christian.lins@intevation.de>
parents:
6479
diff
changeset
|
182 userService.getCurrentUser(locale, new AsyncCallback<User>() { |
d19a0ffb9ccf
More robustness in FLYS.onModuleLoad() service calls.
Christian Lins <christian.lins@intevation.de>
parents:
6479
diff
changeset
|
183 @Override |
d19a0ffb9ccf
More robustness in FLYS.onModuleLoad() service calls.
Christian Lins <christian.lins@intevation.de>
parents:
6479
diff
changeset
|
184 public void onFailure(Throwable caught) { |
d19a0ffb9ccf
More robustness in FLYS.onModuleLoad() service calls.
Christian Lins <christian.lins@intevation.de>
parents:
6479
diff
changeset
|
185 GWT.log("Could not find a logged in user."); |
d19a0ffb9ccf
More robustness in FLYS.onModuleLoad() service calls.
Christian Lins <christian.lins@intevation.de>
parents:
6479
diff
changeset
|
186 String msg = getExceptionString(MSG, caught); |
d19a0ffb9ccf
More robustness in FLYS.onModuleLoad() service calls.
Christian Lins <christian.lins@intevation.de>
parents:
6479
diff
changeset
|
187 SC.warn(msg); |
d19a0ffb9ccf
More robustness in FLYS.onModuleLoad() service calls.
Christian Lins <christian.lins@intevation.de>
parents:
6479
diff
changeset
|
188 } |
d19a0ffb9ccf
More robustness in FLYS.onModuleLoad() service calls.
Christian Lins <christian.lins@intevation.de>
parents:
6479
diff
changeset
|
189 |
d19a0ffb9ccf
More robustness in FLYS.onModuleLoad() service calls.
Christian Lins <christian.lins@intevation.de>
parents:
6479
diff
changeset
|
190 @Override |
d19a0ffb9ccf
More robustness in FLYS.onModuleLoad() service calls.
Christian Lins <christian.lins@intevation.de>
parents:
6479
diff
changeset
|
191 public void onSuccess(User user) { |
d19a0ffb9ccf
More robustness in FLYS.onModuleLoad() service calls.
Christian Lins <christian.lins@intevation.de>
parents:
6479
diff
changeset
|
192 GWT.log("Found a user. Set '"+ user.getName() + "'"); |
d19a0ffb9ccf
More robustness in FLYS.onModuleLoad() service calls.
Christian Lins <christian.lins@intevation.de>
parents:
6479
diff
changeset
|
193 setCurrentUser(user); |
d19a0ffb9ccf
More robustness in FLYS.onModuleLoad() service calls.
Christian Lins <christian.lins@intevation.de>
parents:
6479
diff
changeset
|
194 |
d19a0ffb9ccf
More robustness in FLYS.onModuleLoad() service calls.
Christian Lins <christian.lins@intevation.de>
parents:
6479
diff
changeset
|
195 header.setCurrentUser(user); |
d19a0ffb9ccf
More robustness in FLYS.onModuleLoad() service calls.
Christian Lins <christian.lins@intevation.de>
parents:
6479
diff
changeset
|
196 |
d19a0ffb9ccf
More robustness in FLYS.onModuleLoad() service calls.
Christian Lins <christian.lins@intevation.de>
parents:
6479
diff
changeset
|
197 projectList = new ProjectList(FLYS.this, user); |
d19a0ffb9ccf
More robustness in FLYS.onModuleLoad() service calls.
Christian Lins <christian.lins@intevation.de>
parents:
6479
diff
changeset
|
198 workspace = new FLYSWorkspace(FLYS.this); |
d19a0ffb9ccf
More robustness in FLYS.onModuleLoad() service calls.
Christian Lins <christian.lins@intevation.de>
parents:
6479
diff
changeset
|
199 view.setProjectList(projectList); |
d19a0ffb9ccf
More robustness in FLYS.onModuleLoad() service calls.
Christian Lins <christian.lins@intevation.de>
parents:
6479
diff
changeset
|
200 view.setFLYSWorkspace(workspace); |
d19a0ffb9ccf
More robustness in FLYS.onModuleLoad() service calls.
Christian Lins <christian.lins@intevation.de>
parents:
6479
diff
changeset
|
201 |
d19a0ffb9ccf
More robustness in FLYS.onModuleLoad() service calls.
Christian Lins <christian.lins@intevation.de>
parents:
6479
diff
changeset
|
202 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
|
203 } |
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
|
204 }); |
0
4e8be5e7855f
Start of a GWT based client for FLYS-3.0
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
205 } |
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
|
206 |
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
|
207 |
605
9e30c776cbef
Improved the exception handling.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
600
diff
changeset
|
208 public void showWarning(Throwable e) { |
9e30c776cbef
Improved the exception handling.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
600
diff
changeset
|
209 StringBuilder sb = new StringBuilder(); |
9e30c776cbef
Improved the exception handling.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
600
diff
changeset
|
210 sb.append("<tt>"); |
9e30c776cbef
Improved the exception handling.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
600
diff
changeset
|
211 |
9e30c776cbef
Improved the exception handling.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
600
diff
changeset
|
212 if (e instanceof UmbrellaException) { |
9e30c776cbef
Improved the exception handling.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
600
diff
changeset
|
213 UmbrellaException u = (UmbrellaException) e; |
9e30c776cbef
Improved the exception handling.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
600
diff
changeset
|
214 Set<Throwable> throwables = u.getCauses(); |
9e30c776cbef
Improved the exception handling.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
600
diff
changeset
|
215 |
9e30c776cbef
Improved the exception handling.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
600
diff
changeset
|
216 for (Throwable t: throwables) { |
9e30c776cbef
Improved the exception handling.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
600
diff
changeset
|
217 sb.append(t.getLocalizedMessage()); |
9e30c776cbef
Improved the exception handling.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
600
diff
changeset
|
218 sb.append("<br>"); |
9e30c776cbef
Improved the exception handling.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
600
diff
changeset
|
219 } |
9e30c776cbef
Improved the exception handling.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
600
diff
changeset
|
220 } |
9e30c776cbef
Improved the exception handling.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
600
diff
changeset
|
221 else { |
9e30c776cbef
Improved the exception handling.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
600
diff
changeset
|
222 sb.append(e.getLocalizedMessage()); |
9e30c776cbef
Improved the exception handling.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
600
diff
changeset
|
223 } |
9e30c776cbef
Improved the exception handling.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
600
diff
changeset
|
224 |
9e30c776cbef
Improved the exception handling.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
600
diff
changeset
|
225 sb.append("</tt>"); |
9e30c776cbef
Improved the exception handling.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
600
diff
changeset
|
226 |
9e30c776cbef
Improved the exception handling.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
600
diff
changeset
|
227 Window w = new Window(); |
9e30c776cbef
Improved the exception handling.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
600
diff
changeset
|
228 w.setTitle(MSG.unexpected_exception()); |
9e30c776cbef
Improved the exception handling.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
600
diff
changeset
|
229 w.setWidth(550); |
9e30c776cbef
Improved the exception handling.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
600
diff
changeset
|
230 w.setHeight(300); |
9e30c776cbef
Improved the exception handling.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
600
diff
changeset
|
231 w.centerInPage(); |
9e30c776cbef
Improved the exception handling.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
600
diff
changeset
|
232 w.setCanDragResize(true); |
9e30c776cbef
Improved the exception handling.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
600
diff
changeset
|
233 |
9e30c776cbef
Improved the exception handling.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
600
diff
changeset
|
234 HTMLPane p = new HTMLPane(); |
9e30c776cbef
Improved the exception handling.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
600
diff
changeset
|
235 p.setContents(sb.toString()); |
9e30c776cbef
Improved the exception handling.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
600
diff
changeset
|
236 |
9e30c776cbef
Improved the exception handling.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
600
diff
changeset
|
237 w.addItem(p); |
9e30c776cbef
Improved the exception handling.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
600
diff
changeset
|
238 w.show(); |
9e30c776cbef
Improved the exception handling.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
600
diff
changeset
|
239 } |
9e30c776cbef
Improved the exception handling.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
600
diff
changeset
|
240 |
9e30c776cbef
Improved the exception handling.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
600
diff
changeset
|
241 |
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
|
242 /** |
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
|
243 * 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
|
244 * 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
|
245 */ |
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
|
246 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
|
247 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
|
248 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
|
249 } |
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
|
250 |
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
|
251 |
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
|
252 /** |
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
|
253 * 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
|
254 * |
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
|
255 * @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
|
256 */ |
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
|
257 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
|
258 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
|
259 } |
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
|
260 |
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
|
261 |
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
|
262 /** |
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
|
263 * 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
|
264 */ |
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
|
265 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
|
266 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
|
267 } |
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
|
268 |
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
|
269 |
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
|
270 /** |
28
dfdb927b137d
Improved the main menu - added further buttons (clickable labels).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
27
diff
changeset
|
271 * Returns the project list. |
dfdb927b137d
Improved the main menu - added further buttons (clickable labels).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
27
diff
changeset
|
272 */ |
dfdb927b137d
Improved the main menu - added further buttons (clickable labels).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
27
diff
changeset
|
273 public ProjectList getProjectList() { |
dfdb927b137d
Improved the main menu - added further buttons (clickable labels).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
27
diff
changeset
|
274 return projectList; |
dfdb927b137d
Improved the main menu - added further buttons (clickable labels).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
27
diff
changeset
|
275 } |
dfdb927b137d
Improved the main menu - added further buttons (clickable labels).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
27
diff
changeset
|
276 |
dfdb927b137d
Improved the main menu - added further buttons (clickable labels).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
27
diff
changeset
|
277 |
dfdb927b137d
Improved the main menu - added further buttons (clickable labels).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
27
diff
changeset
|
278 /** |
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
|
279 * 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
|
280 * |
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
|
281 * @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
|
282 */ |
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
|
283 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
|
284 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
|
285 } |
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
|
286 |
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
|
287 |
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
|
288 /** |
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
|
289 * 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
|
290 * |
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
|
291 * @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
|
292 */ |
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
|
293 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
|
294 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
|
295 } |
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
|
296 |
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
|
297 |
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
|
298 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
|
299 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
|
300 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
|
301 |
1425
bc06a671ef60
Removed the URL parameter from service calls. The service
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1294
diff
changeset
|
302 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
|
303 @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
|
304 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
|
305 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
|
306 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
|
307 } |
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
|
308 |
3501
0de0ef04bcdc
Delete empty project after closing CollectionView (#785).
Christian Lins <christian.lins@intevation.de>
parents:
3381
diff
changeset
|
309 @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
|
310 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
|
311 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
|
312 rivers = newRivers; |
6132
766cba02ae4a
Start up a new project on load.
Raimund Renkert <rrenkert@intevation.de>
parents:
6033
diff
changeset
|
313 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
|
314 } |
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
|
315 }); |
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
|
316 } |
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
|
317 |
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
|
318 |
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
|
319 /** |
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
|
320 * 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
|
321 * <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
|
322 * 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
|
323 * 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
|
324 */ |
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
|
325 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
|
326 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
|
327 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
|
328 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
|
329 } |
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
|
330 |
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
|
331 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
|
332 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
|
333 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
|
334 |
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
|
335 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
|
336 } |
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
|
337 |
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
|
338 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
|
339 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
|
340 |
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
|
341 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
|
342 } |
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
|
343 |
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
|
344 |
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
|
345 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
|
346 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
|
347 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
|
348 } |
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
|
349 |
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
|
350 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
|
351 } |
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
|
352 |
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
|
353 |
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
|
354 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
|
355 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
|
356 } |
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
|
357 |
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
|
358 |
3549
6a8f83c538e3
Merged revisions 5384 via svnmerge from
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
3501
diff
changeset
|
359 /** 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
|
360 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
|
361 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
|
362 } |
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
|
363 |
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
|
364 |
3549
6a8f83c538e3
Merged revisions 5384 via svnmerge from
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
3501
diff
changeset
|
365 /** 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
|
366 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
|
367 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
|
368 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
|
369 } |
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
|
370 |
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
|
371 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
|
372 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
|
373 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
|
374 } |
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
|
375 |
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
|
376 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
|
377 |
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
|
378 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
|
379 |
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
|
380 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
|
381 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
|
382 |
1425
bc06a671ef60
Removed the URL parameter from service calls. The service
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1294
diff
changeset
|
383 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
|
384 new AsyncCallback<Collection>() { |
3501
0de0ef04bcdc
Delete empty project after closing CollectionView (#785).
Christian Lins <christian.lins@intevation.de>
parents:
3381
diff
changeset
|
385 @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
|
386 public void onFailure(Throwable caught) { |
4062
145980c21700
Handle error conditions more robust.
Christian Lins <christian.lins@intevation.de>
parents:
3989
diff
changeset
|
387 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
|
388 } |
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 |
3501
0de0ef04bcdc
Delete empty project after closing CollectionView (#785).
Christian Lins <christian.lins@intevation.de>
parents:
3381
diff
changeset
|
390 @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
|
391 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
|
392 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
|
393 |
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
|
394 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
|
395 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
|
396 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
|
397 |
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
|
398 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
|
399 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
|
400 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
|
401 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
|
402 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
|
403 |
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
|
404 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
|
405 |
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
|
406 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
|
407 } |
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
|
408 |
3381
6b5920c7ea6e
Cosmetics, docs.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
1619
diff
changeset
|
409 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
|
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 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
|
412 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
|
413 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
|
414 } |
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
|
415 |
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
|
416 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
|
417 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
|
418 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
|
419 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
|
420 new AsyncCallback<Artifact>() { |
3501
0de0ef04bcdc
Delete empty project after closing CollectionView (#785).
Christian Lins <christian.lins@intevation.de>
parents:
3381
diff
changeset
|
421 @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
|
422 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
|
423 unlockProject(collectionID); |
4062
145980c21700
Handle error conditions more robust.
Christian Lins <christian.lins@intevation.de>
parents:
3989
diff
changeset
|
424 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
|
425 } |
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
|
426 |
3501
0de0ef04bcdc
Delete empty project after closing CollectionView (#785).
Christian Lins <christian.lins@intevation.de>
parents:
3381
diff
changeset
|
427 @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
|
428 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
|
429 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
|
430 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
|
431 |
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
|
432 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
|
433 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
|
434 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
|
435 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
|
436 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
|
437 |
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
|
438 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
|
439 } |
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
|
440 }); |
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
|
441 |
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
|
442 } |
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
|
443 }); |
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
|
444 } |
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
|
445 |
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
|
446 |
611
854312c0528c
#21 Newly created projects cannot be opened twice.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
605
diff
changeset
|
447 public void closeProject(String uuid) { |
854312c0528c
#21 Newly created projects cannot be opened twice.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
605
diff
changeset
|
448 unlockProject(uuid); |
854312c0528c
#21 Newly created projects cannot be opened twice.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
605
diff
changeset
|
449 workspace.destroyProject(uuid); |
854312c0528c
#21 Newly created projects cannot be opened twice.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
605
diff
changeset
|
450 } |
854312c0528c
#21 Newly created projects cannot be opened twice.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
605
diff
changeset
|
451 |
854312c0528c
#21 Newly created projects cannot be opened twice.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
605
diff
changeset
|
452 |
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
|
453 /** |
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
|
454 * 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
|
455 */ |
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
|
456 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
|
457 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
|
458 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
|
459 |
1425
bc06a671ef60
Removed the URL parameter from service calls. The service
Raimund Renkert <raimund.renkert@intevation.de>
parents:
1294
diff
changeset
|
460 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
|
461 new AsyncCallback<Artifact>() { |
3501
0de0ef04bcdc
Delete empty project after closing CollectionView (#785).
Christian Lins <christian.lins@intevation.de>
parents:
3381
diff
changeset
|
462 @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
|
463 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
|
464 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
|
465 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
|
466 } |
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
|
467 |
3501
0de0ef04bcdc
Delete empty project after closing CollectionView (#785).
Christian Lins <christian.lins@intevation.de>
parents:
3381
diff
changeset
|
468 @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
|
469 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
|
470 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
|
471 } |
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
|
472 }); |
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
|
473 } |
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
|
474 |
4981
0e6e44e6725f
flys-client: (first draft) In GaugeInfo show link to show main values.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4607
diff
changeset
|
475 |
0e6e44e6725f
flys-client: (first draft) In GaugeInfo show link to show main values.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4607
diff
changeset
|
476 /** Opens a window with Main Values from gauge. */ |
0e6e44e6725f
flys-client: (first draft) In GaugeInfo show link to show main values.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4607
diff
changeset
|
477 public void newGaugeMainValueTable(GaugeInfo gauge) { |
0e6e44e6725f
flys-client: (first draft) In GaugeInfo show link to show main values.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4607
diff
changeset
|
478 Window mainValueView = new Window(); |
4990
eee722bc85da
FLYS: For Gauge Main Value view, avoid corner cases of gauge range.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4985
diff
changeset
|
479 |
eee722bc85da
FLYS: For Gauge Main Value view, avoid corner cases of gauge range.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4985
diff
changeset
|
480 // Take middle to avoid issues at borders. |
eee722bc85da
FLYS: For Gauge Main Value view, avoid corner cases of gauge range.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4985
diff
changeset
|
481 double km = (gauge.getKmEnd() + gauge.getKmStart())/2d; |
4985
8c9567dd2e60
Fix i18n in GaugeInfo Basedataview. Include Q values.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4981
diff
changeset
|
482 mainValueView.addItem(new WQAutoTabSet(gauge.getRiverName(), |
4990
eee722bc85da
FLYS: For Gauge Main Value view, avoid corner cases of gauge range.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4985
diff
changeset
|
483 new double[] {km, km})); |
5033
ef289466917a
Resized main value window.
Raimund Renkert <rrenkert@intevation.de>
parents:
4990
diff
changeset
|
484 mainValueView.setWidth(450); |
ef289466917a
Resized main value window.
Raimund Renkert <rrenkert@intevation.de>
parents:
4990
diff
changeset
|
485 mainValueView.setHeight(600); |
4981
0e6e44e6725f
flys-client: (first draft) In GaugeInfo show link to show main values.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4607
diff
changeset
|
486 |
5033
ef289466917a
Resized main value window.
Raimund Renkert <rrenkert@intevation.de>
parents:
4990
diff
changeset
|
487 mainValueView.setMaximized(false); |
ef289466917a
Resized main value window.
Raimund Renkert <rrenkert@intevation.de>
parents:
4990
diff
changeset
|
488 mainValueView.centerInPage(); |
4981
0e6e44e6725f
flys-client: (first draft) In GaugeInfo show link to show main values.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4607
diff
changeset
|
489 mainValueView.setCanDragReposition(true); |
0e6e44e6725f
flys-client: (first draft) In GaugeInfo show link to show main values.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4607
diff
changeset
|
490 mainValueView.setCanDragResize(true); |
0e6e44e6725f
flys-client: (first draft) In GaugeInfo show link to show main values.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4607
diff
changeset
|
491 mainValueView.setShowMaximizeButton(true); |
0e6e44e6725f
flys-client: (first draft) In GaugeInfo show link to show main values.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4607
diff
changeset
|
492 mainValueView.setKeepInParentRect(true); |
0e6e44e6725f
flys-client: (first draft) In GaugeInfo show link to show main values.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4607
diff
changeset
|
493 |
4985
8c9567dd2e60
Fix i18n in GaugeInfo Basedataview. Include Q values.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4981
diff
changeset
|
494 mainValueView.setTitle(MSG.mainvalues() + " " + gauge.getName() + " (" + gauge.getRiverName() + ")" ); |
4981
0e6e44e6725f
flys-client: (first draft) In GaugeInfo show link to show main values.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4607
diff
changeset
|
495 workspace.addChild(mainValueView); |
0e6e44e6725f
flys-client: (first draft) In GaugeInfo show link to show main values.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4607
diff
changeset
|
496 } |
0e6e44e6725f
flys-client: (first draft) In GaugeInfo show link to show main values.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
4607
diff
changeset
|
497 |
6033
b73a55a5e536
Doc and TODO issue1081
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
5993
diff
changeset
|
498 |
b73a55a5e536
Doc and TODO issue1081
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
5993
diff
changeset
|
499 /** Open window with gauges discharge curve. */ |
3865
436eec3be6ff
Allow to create a discharge curve from a gauge info
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
3698
diff
changeset
|
500 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
|
501 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
|
502 |
436eec3be6ff
Allow to create a discharge curve from a gauge info
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
3698
diff
changeset
|
503 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
|
504 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
|
505 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
|
506 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
|
507 |
436eec3be6ff
Allow to create a discharge curve from a gauge info
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
3698
diff
changeset
|
508 User user = getCurrentUser(); |
436eec3be6ff
Allow to create a discharge curve from a gauge info
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
3698
diff
changeset
|
509 |
436eec3be6ff
Allow to create a discharge curve from a gauge info
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
3698
diff
changeset
|
510 if (user == null) { |
436eec3be6ff
Allow to create a discharge curve from a gauge info
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
3698
diff
changeset
|
511 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
|
512 return; |
436eec3be6ff
Allow to create a discharge curve from a gauge info
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
3698
diff
changeset
|
513 } |
436eec3be6ff
Allow to create a discharge curve from a gauge info
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
3698
diff
changeset
|
514 |
6033
b73a55a5e536
Doc and TODO issue1081
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents:
5993
diff
changeset
|
515 // TODO 1081, this collection needs to be added a mainvalue artifact |
3865
436eec3be6ff
Allow to create a discharge curve from a gauge info
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
3698
diff
changeset
|
516 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
|
517 new AsyncCallback<Collection>() { |
436eec3be6ff
Allow to create a discharge curve from a gauge info
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
3698
diff
changeset
|
518 @Override |
436eec3be6ff
Allow to create a discharge curve from a gauge info
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
3698
diff
changeset
|
519 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
|
520 GWT.log("Could not create new collection."); |
4062
145980c21700
Handle error conditions more robust.
Christian Lins <christian.lins@intevation.de>
parents:
3989
diff
changeset
|
521 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
|
522 } |
436eec3be6ff
Allow to create a discharge curve from a gauge info
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
3698
diff
changeset
|
523 |
436eec3be6ff
Allow to create a discharge curve from a gauge info
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
3698
diff
changeset
|
524 @Override |
436eec3be6ff
Allow to create a discharge curve from a gauge info
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
3698
diff
changeset
|
525 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
|
526 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
|
527 final Collection col = collection; |
3980 | 528 artifactService.createGaugeDischargeCurveArtifact( |
3865
436eec3be6ff
Allow to create a discharge curve from a gauge info
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
3698
diff
changeset
|
529 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
|
530 new AsyncCallback<Artifact>() { |
436eec3be6ff
Allow to create a discharge curve from a gauge info
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
3698
diff
changeset
|
531 @Override |
436eec3be6ff
Allow to create a discharge curve from a gauge info
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
3698
diff
changeset
|
532 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
|
533 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
|
534 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
|
535 } |
436eec3be6ff
Allow to create a discharge curve from a gauge info
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
3698
diff
changeset
|
536 |
436eec3be6ff
Allow to create a discharge curve from a gauge info
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
3698
diff
changeset
|
537 @Override |
436eec3be6ff
Allow to create a discharge curve from a gauge info
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
3698
diff
changeset
|
538 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
|
539 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
|
540 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
|
541 col, artifact); |
4141
b3bc5e9ba912
Fix for part a) and c) in issue #918
Björn Ricks <bjoern.ricks@intevation.de>
parents:
4062
diff
changeset
|
542 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
|
543 |
436eec3be6ff
Allow to create a discharge curve from a gauge info
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
3698
diff
changeset
|
544 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
|
545 view.addCloseClickHandler( |
b3bc5e9ba912
Fix for part a) and c) in issue #918
Björn Ricks <bjoern.ricks@intevation.de>
parents:
4062
diff
changeset
|
546 new CloseCollectionViewHandler( |
b3bc5e9ba912
Fix for part a) and c) in issue #918
Björn Ricks <bjoern.ricks@intevation.de>
parents:
4062
diff
changeset
|
547 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
|
548 projectList.updateUserCollections(); |
3865
436eec3be6ff
Allow to create a discharge curve from a gauge info
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
3698
diff
changeset
|
549 } |
436eec3be6ff
Allow to create a discharge curve from a gauge info
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
3698
diff
changeset
|
550 }); |
436eec3be6ff
Allow to create a discharge curve from a gauge info
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
3698
diff
changeset
|
551 } |
436eec3be6ff
Allow to create a discharge curve from a gauge info
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
3698
diff
changeset
|
552 }); |
436eec3be6ff
Allow to create a discharge curve from a gauge info
Bjoern Ricks <bjoern.ricks@intevation.de>
parents:
3698
diff
changeset
|
553 } |
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
|
554 |
5503
b660090b417d
Create a new sq relation project on measurement station record click.
Raimund Renkert <rrenkert@intevation.de>
parents:
5033
diff
changeset
|
555 public void newSQRelation(String river, int measurementStation) { |
b660090b417d
Create a new sq relation project on measurement station record click.
Raimund Renkert <rrenkert@intevation.de>
parents:
5033
diff
changeset
|
556 Config config = Config.getInstance(); |
b660090b417d
Create a new sq relation project on measurement station record click.
Raimund Renkert <rrenkert@intevation.de>
parents:
5033
diff
changeset
|
557 |
b660090b417d
Create a new sq relation project on measurement station record click.
Raimund Renkert <rrenkert@intevation.de>
parents:
5033
diff
changeset
|
558 final String locale = config.getLocale(); |
b660090b417d
Create a new sq relation project on measurement station record click.
Raimund Renkert <rrenkert@intevation.de>
parents:
5033
diff
changeset
|
559 final String riv = river; |
b660090b417d
Create a new sq relation project on measurement station record click.
Raimund Renkert <rrenkert@intevation.de>
parents:
5033
diff
changeset
|
560 final int mStation = measurementStation; |
b660090b417d
Create a new sq relation project on measurement station record click.
Raimund Renkert <rrenkert@intevation.de>
parents:
5033
diff
changeset
|
561 final FLYS flys = this; |
b660090b417d
Create a new sq relation project on measurement station record click.
Raimund Renkert <rrenkert@intevation.de>
parents:
5033
diff
changeset
|
562 |
b660090b417d
Create a new sq relation project on measurement station record click.
Raimund Renkert <rrenkert@intevation.de>
parents:
5033
diff
changeset
|
563 User user = getCurrentUser(); |
b660090b417d
Create a new sq relation project on measurement station record click.
Raimund Renkert <rrenkert@intevation.de>
parents:
5033
diff
changeset
|
564 |
b660090b417d
Create a new sq relation project on measurement station record click.
Raimund Renkert <rrenkert@intevation.de>
parents:
5033
diff
changeset
|
565 if (user == null) { |
b660090b417d
Create a new sq relation project on measurement station record click.
Raimund Renkert <rrenkert@intevation.de>
parents:
5033
diff
changeset
|
566 SC.warn(MSG.error_not_logged_in()); |
b660090b417d
Create a new sq relation project on measurement station record click.
Raimund Renkert <rrenkert@intevation.de>
parents:
5033
diff
changeset
|
567 return; |
b660090b417d
Create a new sq relation project on measurement station record click.
Raimund Renkert <rrenkert@intevation.de>
parents:
5033
diff
changeset
|
568 } |
b660090b417d
Create a new sq relation project on measurement station record click.
Raimund Renkert <rrenkert@intevation.de>
parents:
5033
diff
changeset
|
569 |
b660090b417d
Create a new sq relation project on measurement station record click.
Raimund Renkert <rrenkert@intevation.de>
parents:
5033
diff
changeset
|
570 collectionService.create(locale, user.identifier(), |
b660090b417d
Create a new sq relation project on measurement station record click.
Raimund Renkert <rrenkert@intevation.de>
parents:
5033
diff
changeset
|
571 new AsyncCallback<Collection>() { |
b660090b417d
Create a new sq relation project on measurement station record click.
Raimund Renkert <rrenkert@intevation.de>
parents:
5033
diff
changeset
|
572 @Override |
b660090b417d
Create a new sq relation project on measurement station record click.
Raimund Renkert <rrenkert@intevation.de>
parents:
5033
diff
changeset
|
573 public void onFailure(Throwable caught) { |
b660090b417d
Create a new sq relation project on measurement station record click.
Raimund Renkert <rrenkert@intevation.de>
parents:
5033
diff
changeset
|
574 GWT.log("Could not create new collection."); |
b660090b417d
Create a new sq relation project on measurement station record click.
Raimund Renkert <rrenkert@intevation.de>
parents:
5033
diff
changeset
|
575 SC.warn(getExceptionString(MSG, caught)); |
b660090b417d
Create a new sq relation project on measurement station record click.
Raimund Renkert <rrenkert@intevation.de>
parents:
5033
diff
changeset
|
576 } |
b660090b417d
Create a new sq relation project on measurement station record click.
Raimund Renkert <rrenkert@intevation.de>
parents:
5033
diff
changeset
|
577 |
b660090b417d
Create a new sq relation project on measurement station record click.
Raimund Renkert <rrenkert@intevation.de>
parents:
5033
diff
changeset
|
578 @Override |
b660090b417d
Create a new sq relation project on measurement station record click.
Raimund Renkert <rrenkert@intevation.de>
parents:
5033
diff
changeset
|
579 public void onSuccess(Collection collection) { |
b660090b417d
Create a new sq relation project on measurement station record click.
Raimund Renkert <rrenkert@intevation.de>
parents:
5033
diff
changeset
|
580 GWT.log("Successfully created a new collection."); |
b660090b417d
Create a new sq relation project on measurement station record click.
Raimund Renkert <rrenkert@intevation.de>
parents:
5033
diff
changeset
|
581 final Collection col = collection; |
b660090b417d
Create a new sq relation project on measurement station record click.
Raimund Renkert <rrenkert@intevation.de>
parents:
5033
diff
changeset
|
582 artifactService.createSQRelationArtifact( |
b660090b417d
Create a new sq relation project on measurement station record click.
Raimund Renkert <rrenkert@intevation.de>
parents:
5033
diff
changeset
|
583 col, locale, riv, mStation, |
b660090b417d
Create a new sq relation project on measurement station record click.
Raimund Renkert <rrenkert@intevation.de>
parents:
5033
diff
changeset
|
584 new AsyncCallback<Artifact>() { |
b660090b417d
Create a new sq relation project on measurement station record click.
Raimund Renkert <rrenkert@intevation.de>
parents:
5033
diff
changeset
|
585 @Override |
b660090b417d
Create a new sq relation project on measurement station record click.
Raimund Renkert <rrenkert@intevation.de>
parents:
5033
diff
changeset
|
586 public void onFailure(Throwable caught) { |
b660090b417d
Create a new sq relation project on measurement station record click.
Raimund Renkert <rrenkert@intevation.de>
parents:
5033
diff
changeset
|
587 GWT.log("Could not create the new artifact."); |
b660090b417d
Create a new sq relation project on measurement station record click.
Raimund Renkert <rrenkert@intevation.de>
parents:
5033
diff
changeset
|
588 SC.warn(getExceptionString(MSG, caught)); |
b660090b417d
Create a new sq relation project on measurement station record click.
Raimund Renkert <rrenkert@intevation.de>
parents:
5033
diff
changeset
|
589 } |
b660090b417d
Create a new sq relation project on measurement station record click.
Raimund Renkert <rrenkert@intevation.de>
parents:
5033
diff
changeset
|
590 |
b660090b417d
Create a new sq relation project on measurement station record click.
Raimund Renkert <rrenkert@intevation.de>
parents:
5033
diff
changeset
|
591 @Override |
b660090b417d
Create a new sq relation project on measurement station record click.
Raimund Renkert <rrenkert@intevation.de>
parents:
5033
diff
changeset
|
592 public void onSuccess(Artifact artifact) { |
b660090b417d
Create a new sq relation project on measurement station record click.
Raimund Renkert <rrenkert@intevation.de>
parents:
5033
diff
changeset
|
593 GWT.log("Successfully created a new artifact."); |
b660090b417d
Create a new sq relation project on measurement station record click.
Raimund Renkert <rrenkert@intevation.de>
parents:
5033
diff
changeset
|
594 CollectionView view = new CollectionView(flys, |
b660090b417d
Create a new sq relation project on measurement station record click.
Raimund Renkert <rrenkert@intevation.de>
parents:
5033
diff
changeset
|
595 col, artifact); |
b660090b417d
Create a new sq relation project on measurement station record click.
Raimund Renkert <rrenkert@intevation.de>
parents:
5033
diff
changeset
|
596 workspace.addView(col.identifier(), view); |
b660090b417d
Create a new sq relation project on measurement station record click.
Raimund Renkert <rrenkert@intevation.de>
parents:
5033
diff
changeset
|
597 |
b660090b417d
Create a new sq relation project on measurement station record click.
Raimund Renkert <rrenkert@intevation.de>
parents:
5033
diff
changeset
|
598 view.addCollectionChangeHandler(getProjectList()); |
b660090b417d
Create a new sq relation project on measurement station record click.
Raimund Renkert <rrenkert@intevation.de>
parents:
5033
diff
changeset
|
599 view.addCloseClickHandler( |
b660090b417d
Create a new sq relation project on measurement station record click.
Raimund Renkert <rrenkert@intevation.de>
parents:
5033
diff
changeset
|
600 new CloseCollectionViewHandler( |
b660090b417d
Create a new sq relation project on measurement station record click.
Raimund Renkert <rrenkert@intevation.de>
parents:
5033
diff
changeset
|
601 FLYS.this, col.identifier())); |
b660090b417d
Create a new sq relation project on measurement station record click.
Raimund Renkert <rrenkert@intevation.de>
parents:
5033
diff
changeset
|
602 projectList.updateUserCollections(); |
b660090b417d
Create a new sq relation project on measurement station record click.
Raimund Renkert <rrenkert@intevation.de>
parents:
5033
diff
changeset
|
603 } |
b660090b417d
Create a new sq relation project on measurement station record click.
Raimund Renkert <rrenkert@intevation.de>
parents:
5033
diff
changeset
|
604 }); |
b660090b417d
Create a new sq relation project on measurement station record click.
Raimund Renkert <rrenkert@intevation.de>
parents:
5033
diff
changeset
|
605 } |
b660090b417d
Create a new sq relation project on measurement station record click.
Raimund Renkert <rrenkert@intevation.de>
parents:
5033
diff
changeset
|
606 }); |
b660090b417d
Create a new sq relation project on measurement station record click.
Raimund Renkert <rrenkert@intevation.de>
parents:
5033
diff
changeset
|
607 } |
b660090b417d
Create a new sq relation project on measurement station record click.
Raimund Renkert <rrenkert@intevation.de>
parents:
5033
diff
changeset
|
608 |
3501
0de0ef04bcdc
Delete empty project after closing CollectionView (#785).
Christian Lins <christian.lins@intevation.de>
parents:
3381
diff
changeset
|
609 @Override |
611
854312c0528c
#21 Newly created projects cannot be opened twice.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
605
diff
changeset
|
610 public void onCollectionChange(CollectionChangeEvent event) { |
854312c0528c
#21 Newly created projects cannot be opened twice.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
605
diff
changeset
|
611 Collection oldC = event.getOldValue(); |
854312c0528c
#21 Newly created projects cannot be opened twice.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
605
diff
changeset
|
612 |
854312c0528c
#21 Newly created projects cannot be opened twice.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
605
diff
changeset
|
613 if (oldC == null) { |
854312c0528c
#21 Newly created projects cannot be opened twice.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
605
diff
changeset
|
614 Collection newC = event.getNewValue(); |
854312c0528c
#21 Newly created projects cannot be opened twice.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
605
diff
changeset
|
615 lockProject(newC.identifier()); |
854312c0528c
#21 Newly created projects cannot be opened twice.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
605
diff
changeset
|
616 } |
854312c0528c
#21 Newly created projects cannot be opened twice.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
605
diff
changeset
|
617 } |
854312c0528c
#21 Newly created projects cannot be opened twice.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
605
diff
changeset
|
618 |
854312c0528c
#21 Newly created projects cannot be opened twice.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
605
diff
changeset
|
619 |
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
|
620 |
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
|
621 /** |
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
|
622 * 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
|
623 * 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
|
624 */ |
611
854312c0528c
#21 Newly created projects cannot be opened twice.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
605
diff
changeset
|
625 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
|
626 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
|
627 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
|
628 |
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
|
629 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
|
630 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
|
631 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
|
632 } |
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
|
633 |
3501
0de0ef04bcdc
Delete empty project after closing CollectionView (#785).
Christian Lins <christian.lins@intevation.de>
parents:
3381
diff
changeset
|
634 @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
|
635 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
|
636 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
|
637 } |
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
|
638 } |
4601
16c19d4f1833
Add methods to hide and show the project list in FLYS class
Björn Ricks <bjoern.ricks@intevation.de>
parents:
4562
diff
changeset
|
639 |
16c19d4f1833
Add methods to hide and show the project list in FLYS class
Björn Ricks <bjoern.ricks@intevation.de>
parents:
4562
diff
changeset
|
640 public boolean isProjectListVisible() { |
16c19d4f1833
Add methods to hide and show the project list in FLYS class
Björn Ricks <bjoern.ricks@intevation.de>
parents:
4562
diff
changeset
|
641 if (this.projectList == null) { |
16c19d4f1833
Add methods to hide and show the project list in FLYS class
Björn Ricks <bjoern.ricks@intevation.de>
parents:
4562
diff
changeset
|
642 return true; |
16c19d4f1833
Add methods to hide and show the project list in FLYS class
Björn Ricks <bjoern.ricks@intevation.de>
parents:
4562
diff
changeset
|
643 } |
16c19d4f1833
Add methods to hide and show the project list in FLYS class
Björn Ricks <bjoern.ricks@intevation.de>
parents:
4562
diff
changeset
|
644 return this.projectList.isVisible(); |
16c19d4f1833
Add methods to hide and show the project list in FLYS class
Björn Ricks <bjoern.ricks@intevation.de>
parents:
4562
diff
changeset
|
645 } |
16c19d4f1833
Add methods to hide and show the project list in FLYS class
Björn Ricks <bjoern.ricks@intevation.de>
parents:
4562
diff
changeset
|
646 |
16c19d4f1833
Add methods to hide and show the project list in FLYS class
Björn Ricks <bjoern.ricks@intevation.de>
parents:
4562
diff
changeset
|
647 public void hideProjectList() { |
16c19d4f1833
Add methods to hide and show the project list in FLYS class
Björn Ricks <bjoern.ricks@intevation.de>
parents:
4562
diff
changeset
|
648 if (this.projectList != null) { |
16c19d4f1833
Add methods to hide and show the project list in FLYS class
Björn Ricks <bjoern.ricks@intevation.de>
parents:
4562
diff
changeset
|
649 this.projectList.hide(); |
16c19d4f1833
Add methods to hide and show the project list in FLYS class
Björn Ricks <bjoern.ricks@intevation.de>
parents:
4562
diff
changeset
|
650 } |
16c19d4f1833
Add methods to hide and show the project list in FLYS class
Björn Ricks <bjoern.ricks@intevation.de>
parents:
4562
diff
changeset
|
651 } |
16c19d4f1833
Add methods to hide and show the project list in FLYS class
Björn Ricks <bjoern.ricks@intevation.de>
parents:
4562
diff
changeset
|
652 |
16c19d4f1833
Add methods to hide and show the project list in FLYS class
Björn Ricks <bjoern.ricks@intevation.de>
parents:
4562
diff
changeset
|
653 public void openProjectList() { |
16c19d4f1833
Add methods to hide and show the project list in FLYS class
Björn Ricks <bjoern.ricks@intevation.de>
parents:
4562
diff
changeset
|
654 if (this.projectList != null) { |
16c19d4f1833
Add methods to hide and show the project list in FLYS class
Björn Ricks <bjoern.ricks@intevation.de>
parents:
4562
diff
changeset
|
655 this.projectList.show(); |
16c19d4f1833
Add methods to hide and show the project list in FLYS class
Björn Ricks <bjoern.ricks@intevation.de>
parents:
4562
diff
changeset
|
656 } |
16c19d4f1833
Add methods to hide and show the project list in FLYS class
Björn Ricks <bjoern.ricks@intevation.de>
parents:
4562
diff
changeset
|
657 } |
4604
488db475613d
Add methods to hide and show the manage projects button of the header
Björn Ricks <bjoern.ricks@intevation.de>
parents:
4603
diff
changeset
|
658 |
488db475613d
Add methods to hide and show the manage projects button of the header
Björn Ricks <bjoern.ricks@intevation.de>
parents:
4603
diff
changeset
|
659 public void hideHeaderProjectButton() { |
488db475613d
Add methods to hide and show the manage projects button of the header
Björn Ricks <bjoern.ricks@intevation.de>
parents:
4603
diff
changeset
|
660 this.header.hideProjectButton(); |
488db475613d
Add methods to hide and show the manage projects button of the header
Björn Ricks <bjoern.ricks@intevation.de>
parents:
4603
diff
changeset
|
661 } |
488db475613d
Add methods to hide and show the manage projects button of the header
Björn Ricks <bjoern.ricks@intevation.de>
parents:
4603
diff
changeset
|
662 |
488db475613d
Add methods to hide and show the manage projects button of the header
Björn Ricks <bjoern.ricks@intevation.de>
parents:
4603
diff
changeset
|
663 public void shoHeaderProjectButton() { |
488db475613d
Add methods to hide and show the manage projects button of the header
Björn Ricks <bjoern.ricks@intevation.de>
parents:
4603
diff
changeset
|
664 this.header.showProjectButton(); |
488db475613d
Add methods to hide and show the manage projects button of the header
Björn Ricks <bjoern.ricks@intevation.de>
parents:
4603
diff
changeset
|
665 } |
0
4e8be5e7855f
Start of a GWT based client for FLYS-3.0
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
666 } |
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
|
667 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : |