annotate flys-client/src/main/java/de/intevation/flys/client/client/FLYS.java @ 1294:94d4f040da3a

Bugfix: #326 Made the process of opening existing project more robust if the collection has no artifact set. flys-client/trunk@2909 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Ingo Weinzierl <ingo.weinzierl@intevation.de>
date Mon, 10 Oct 2011 06:38:35 +0000
parents c0e13cf826d7
children bc06a671ef60
rev   line source
0
4e8be5e7855f Start of a GWT based client for FLYS-3.0
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
1 package de.intevation.flys.client.client;
4e8be5e7855f Start of a GWT based client for FLYS-3.0
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
2
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
3 import java.util.ArrayList;
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
4 import java.util.List;
605
9e30c776cbef Improved the exception handling.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 600
diff changeset
5 import java.util.Set;
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
6
0
4e8be5e7855f Start of a GWT based client for FLYS-3.0
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
7 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
8 import com.google.gwt.core.client.GWT;
605
9e30c776cbef Improved the exception handling.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 600
diff changeset
9 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
10 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
11 import com.google.gwt.xml.client.XMLParser;
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
12
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
13 import com.smartgwt.client.util.SC;
605
9e30c776cbef Improved the exception handling.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 600
diff changeset
14 import com.smartgwt.client.widgets.Window;
9e30c776cbef Improved the exception handling.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 600
diff changeset
15 import com.smartgwt.client.widgets.HTMLPane;
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
16 import com.smartgwt.client.widgets.layout.VLayout;
80
a26489e55730 Added footer and a spacer to the webpage layout.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 29
diff changeset
17 import com.smartgwt.client.widgets.layout.HLayout;
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
18 import com.smartgwt.client.widgets.events.CloseClickHandler;
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
19 import com.smartgwt.client.widgets.events.CloseClientEvent;
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
20
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
21 import de.intevation.flys.client.shared.model.Artifact;
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
22 import de.intevation.flys.client.shared.model.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
23 import de.intevation.flys.client.shared.model.CollectionItem;
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
24 import de.intevation.flys.client.shared.model.River;
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
25 import de.intevation.flys.client.shared.model.User;
6
e2b3966b40ca Added a workspace that handles the collection windows. New button to open a new collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 4
diff changeset
26
611
854312c0528c #21 Newly created projects cannot be opened twice.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 605
diff changeset
27 import de.intevation.flys.client.client.event.CollectionChangeEvent;
854312c0528c #21 Newly created projects cannot be opened twice.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 605
diff changeset
28 import de.intevation.flys.client.client.event.CollectionChangeHandler;
9
8facd8545a12 Added a global configuration for the client and classes providing methods to retrieve these information.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 6
diff changeset
29 import de.intevation.flys.client.client.services.ArtifactService;
8facd8545a12 Added a global configuration for the client and classes providing methods to retrieve these information.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 6
diff changeset
30 import de.intevation.flys.client.client.services.ArtifactServiceAsync;
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
31 import de.intevation.flys.client.client.services.DescribeCollectionService;
9040663aee01 Filled the context menu point 'Open project' of the ProjectList with life - it opens a new window displaying the parameterization of the selected project.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 217
diff changeset
32 import de.intevation.flys.client.client.services.DescribeCollectionServiceAsync;
9040663aee01 Filled the context menu point 'Open project' of the ProjectList with life - it opens a new window displaying the parameterization of the selected project.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 217
diff changeset
33 import de.intevation.flys.client.client.services.GetArtifactService;
9040663aee01 Filled the context menu point 'Open project' of the ProjectList with life - it opens a new window displaying the parameterization of the selected project.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 217
diff changeset
34 import de.intevation.flys.client.client.services.GetArtifactServiceAsync;
29
44c63e7fd0d0 Added a service to list the supported rivers of the artifact server. The FLYS instance serves a method that retrieves this list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 28
diff changeset
35 import de.intevation.flys.client.client.services.RiverService;
44c63e7fd0d0 Added a service to list the supported rivers of the artifact server. The FLYS instance serves a method that retrieves this list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 28
diff changeset
36 import de.intevation.flys.client.client.services.RiverServiceAsync;
2
bc5d4d2297b9 Introduced a service that retrieves the user who is currently logged in. This user is displayed in the menu bar.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1
diff changeset
37 import de.intevation.flys.client.client.services.UserService;
bc5d4d2297b9 Introduced a service that retrieves the user who is currently logged in. This user is displayed in the menu bar.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1
diff changeset
38 import de.intevation.flys.client.client.services.UserServiceAsync;
6
e2b3966b40ca Added a workspace that handles the collection windows. New button to open a new collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 4
diff changeset
39 import de.intevation.flys.client.client.ui.CollectionView;
27
e4155a6833a9 Integrated a header that contains a FLYS and a BfG logo.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 25
diff changeset
40 import de.intevation.flys.client.client.ui.FLYSHeader;
1
0e22a19852e7 Removed useless auto generated classes and added first ui elements with i18n support.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 0
diff changeset
41 import de.intevation.flys.client.client.ui.FLYSView;
6
e2b3966b40ca Added a workspace that handles the collection windows. New button to open a new collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 4
diff changeset
42 import de.intevation.flys.client.client.ui.FLYSWorkspace;
1
0e22a19852e7 Removed useless auto generated classes and added first ui elements with i18n support.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 0
diff changeset
43 import de.intevation.flys.client.client.ui.MainMenu;
4
89976499e013 Implemented a ProjectList and added a mockup that displays two collections in that list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2
diff changeset
44 import de.intevation.flys.client.client.ui.ProjectList;
80
a26489e55730 Added footer and a spacer to the webpage layout.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 29
diff changeset
45 import de.intevation.flys.client.client.ui.FLYSFooter;
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
46
0
4e8be5e7855f Start of a GWT based client for FLYS-3.0
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
47
4e8be5e7855f Start of a GWT based client for FLYS-3.0
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
48 /**
4e8be5e7855f Start of a GWT based client for FLYS-3.0
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
49 * 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
50 *
0e22a19852e7 Removed useless auto generated classes and added first ui elements with i18n support.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 0
diff changeset
51 * @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
52 */
611
854312c0528c #21 Newly created projects cannot be opened twice.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 605
diff changeset
53 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
54
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
55 /** 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
56 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
57
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
58 /** 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
59 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
60
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
61 /** 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
62 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
63
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
64 /** 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
65 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
66 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
67
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
68 /** 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
69 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
70 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
71
9040663aee01 Filled the context menu point 'Open project' of the ProjectList with life - it opens a new window displaying the parameterization of the selected project.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 217
diff changeset
72 /** 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
73 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
74 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
75
9040663aee01 Filled the context menu point 'Open project' of the ProjectList with life - it opens a new window displaying the parameterization of the selected project.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 217
diff changeset
76
864
c0e13cf826d7 Cosmetics, doc.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 845
diff changeset
77 /** The menu bar at the top of the application. */
2
bc5d4d2297b9 Introduced a service that retrieves the user who is currently logged in. This user is displayed in the menu bar.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1
diff changeset
78 protected MainMenu menu;
4
89976499e013 Implemented a ProjectList and added a mockup that displays two collections in that list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2
diff changeset
79
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
80 /** The content window. It takes the whole space beneath the menu bar.*/
2
bc5d4d2297b9 Introduced a service that retrieves the user who is currently logged in. This user is displayed in the menu bar.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1
diff changeset
81 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
82
864
c0e13cf826d7 Cosmetics, doc.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 845
diff changeset
83 /** 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
84 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
85
864
c0e13cf826d7 Cosmetics, doc.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 845
diff changeset
86 /** 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
87 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
88
80
a26489e55730 Added footer and a spacer to the webpage layout.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 29
diff changeset
89 /** The footer. */
a26489e55730 Added footer and a spacer to the webpage layout.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 29
diff changeset
90 protected FLYSFooter footer;
a26489e55730 Added footer and a spacer to the webpage layout.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 29
diff changeset
91
864
c0e13cf826d7 Cosmetics, doc.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 845
diff changeset
92 /** 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
93 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
94
864
c0e13cf826d7 Cosmetics, doc.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 845
diff changeset
95 /** 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
96 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
97
864
c0e13cf826d7 Cosmetics, doc.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 845
diff changeset
98 /** 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
99 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
100
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
101
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
102 /**
0e22a19852e7 Removed useless auto generated classes and added first ui elements with i18n support.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 0
diff changeset
103 * 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
104 */
0e22a19852e7 Removed useless auto generated classes and added first ui elements with i18n support.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 0
diff changeset
105 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
106 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
107
787
4e0b73b7113b Added new UI providers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 611
diff changeset
108 //GWT.setUncaughtExceptionHandler(new GWT.UncaughtExceptionHandler() {
4e0b73b7113b Added new UI providers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 611
diff changeset
109 // public void onUncaughtException(Throwable e) {
4e0b73b7113b Added new UI providers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 611
diff changeset
110 // showWarning(e);
4e0b73b7113b Added new UI providers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 611
diff changeset
111 // }
4e0b73b7113b Added new UI providers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 611
diff changeset
112 //});
605
9e30c776cbef Improved the exception handling.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 600
diff changeset
113
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
114 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
115 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
116 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
117 vertical.setHeight100();
0
4e8be5e7855f Start of a GWT based client for FLYS-3.0
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
118
80
a26489e55730 Added footer and a spacer to the webpage layout.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 29
diff changeset
119 HLayout spacerBar = new HLayout();
a26489e55730 Added footer and a spacer to the webpage layout.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 29
diff changeset
120 spacerBar.setWidth("100%");
a26489e55730 Added footer and a spacer to the webpage layout.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 29
diff changeset
121 spacerBar.setHeight("20px");
a26489e55730 Added footer and a spacer to the webpage layout.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 29
diff changeset
122 spacerBar.setStyleName("bgBlueLight");
a26489e55730 Added footer and a spacer to the webpage layout.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 29
diff changeset
123
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
124 menu = new MainMenu(this);
2
bc5d4d2297b9 Introduced a service that retrieves the user who is currently logged in. This user is displayed in the menu bar.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1
diff changeset
125 view = new FLYSView();
80
a26489e55730 Added footer and a spacer to the webpage layout.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 29
diff changeset
126 footer = new FLYSFooter(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
127
27
e4155a6833a9 Integrated a header that contains a FLYS and a BfG logo.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 25
diff changeset
128 vertical.addMember(new FLYSHeader());
1
0e22a19852e7 Removed useless auto generated classes and added first ui elements with i18n support.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 0
diff changeset
129 vertical.addMember(menu);
80
a26489e55730 Added footer and a spacer to the webpage layout.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 29
diff changeset
130 vertical.addMember(spacerBar);
1
0e22a19852e7 Removed useless auto generated classes and added first ui elements with i18n support.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 0
diff changeset
131 vertical.addMember(view);
80
a26489e55730 Added footer and a spacer to the webpage layout.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 29
diff changeset
132 vertical.addMember(footer);
1
0e22a19852e7 Removed useless auto generated classes and added first ui elements with i18n support.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 0
diff changeset
133
797
cc3f481e9484 Introduced GwtOpenLayers to bring up maps.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 787
diff changeset
134 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
135
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
136 initConfiguration();
229
924da6695800 Each service is now called with the name of the current locale to set the request object's locale manually in the HttpClient.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 225
diff changeset
137
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
138 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
139 String url = config.getServerUrl();
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
140 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
141
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
142 getRivers();
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
143
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
144 userService.getCurrentUser(url, locale, new AsyncCallback<User>() {
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
145 public void onFailure(Throwable caught) {
bc5d4d2297b9 Introduced a service that retrieves the user who is currently logged in. This user is displayed in the menu bar.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1
diff changeset
146 GWT.log("Could not find a logged in user.");
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
147 SC.warn(MSG.getString(caught.getMessage()));
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 }
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
149
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
150 public void onSuccess(User user) {
25
2da6be38d8b6 Added a User interface and a default implementation to handle users in this client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 14
diff changeset
151 GWT.log("Found a user. Set '"+ user.getName() + "'");
2da6be38d8b6 Added a User interface and a default implementation to handle users in this client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 14
diff changeset
152 setCurrentUser(user);
2da6be38d8b6 Added a User interface and a default implementation to handle users in this client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 14
diff changeset
153
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
154 menu.setCurrentUser(user);
4
89976499e013 Implemented a ProjectList and added a mockup that displays two collections in that list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2
diff changeset
155
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
156 projectList = new ProjectList(FLYS.this, user);
6
e2b3966b40ca Added a workspace that handles the collection windows. New button to open a new collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 4
diff changeset
157 workspace = new FLYSWorkspace();
4
89976499e013 Implemented a ProjectList and added a mockup that displays two collections in that list.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 2
diff changeset
158 view.setProjectList(projectList);
6
e2b3966b40ca Added a workspace that handles the collection windows. New button to open a new collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 4
diff changeset
159 view.setFLYSWorkspace(workspace);
217
907b61e4d702 Improved the exception handling - added warnings for user authentication errors and errors that occur while fetching supported rivers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 101
diff changeset
160
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
161 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
162 }
bc5d4d2297b9 Introduced a service that retrieves the user who is currently logged in. This user is displayed in the menu bar.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 1
diff changeset
163 });
0
4e8be5e7855f Start of a GWT based client for FLYS-3.0
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
164 }
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
165
e2b3966b40ca Added a workspace that handles the collection windows. New button to open a new collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 4
diff changeset
166
605
9e30c776cbef Improved the exception handling.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 600
diff changeset
167 public void showWarning(Throwable e) {
9e30c776cbef Improved the exception handling.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 600
diff changeset
168 StringBuilder sb = new StringBuilder();
9e30c776cbef Improved the exception handling.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 600
diff changeset
169 sb.append("<tt>");
9e30c776cbef Improved the exception handling.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 600
diff changeset
170
9e30c776cbef Improved the exception handling.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 600
diff changeset
171 if (e instanceof UmbrellaException) {
9e30c776cbef Improved the exception handling.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 600
diff changeset
172 UmbrellaException u = (UmbrellaException) e;
9e30c776cbef Improved the exception handling.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 600
diff changeset
173 Set<Throwable> throwables = u.getCauses();
9e30c776cbef Improved the exception handling.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 600
diff changeset
174
9e30c776cbef Improved the exception handling.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 600
diff changeset
175 for (Throwable t: throwables) {
9e30c776cbef Improved the exception handling.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 600
diff changeset
176 sb.append(t.getLocalizedMessage());
9e30c776cbef Improved the exception handling.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 600
diff changeset
177 sb.append("<br>");
9e30c776cbef Improved the exception handling.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 600
diff changeset
178 }
9e30c776cbef Improved the exception handling.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 600
diff changeset
179 }
9e30c776cbef Improved the exception handling.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 600
diff changeset
180 else {
9e30c776cbef Improved the exception handling.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 600
diff changeset
181 sb.append(e.getLocalizedMessage());
9e30c776cbef Improved the exception handling.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 600
diff changeset
182 }
9e30c776cbef Improved the exception handling.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 600
diff changeset
183
9e30c776cbef Improved the exception handling.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 600
diff changeset
184 sb.append("</tt>");
9e30c776cbef Improved the exception handling.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 600
diff changeset
185
9e30c776cbef Improved the exception handling.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 600
diff changeset
186 Window w = new Window();
9e30c776cbef Improved the exception handling.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 600
diff changeset
187 w.setTitle(MSG.unexpected_exception());
9e30c776cbef Improved the exception handling.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 600
diff changeset
188 w.setWidth(550);
9e30c776cbef Improved the exception handling.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 600
diff changeset
189 w.setHeight(300);
9e30c776cbef Improved the exception handling.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 600
diff changeset
190 w.centerInPage();
9e30c776cbef Improved the exception handling.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 600
diff changeset
191 w.setCanDragResize(true);
9e30c776cbef Improved the exception handling.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 600
diff changeset
192
9e30c776cbef Improved the exception handling.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 600
diff changeset
193 HTMLPane p = new HTMLPane();
9e30c776cbef Improved the exception handling.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 600
diff changeset
194 p.setContents(sb.toString());
9e30c776cbef Improved the exception handling.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 600
diff changeset
195
9e30c776cbef Improved the exception handling.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 600
diff changeset
196 w.addItem(p);
9e30c776cbef Improved the exception handling.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 600
diff changeset
197 w.show();
9e30c776cbef Improved the exception handling.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 600
diff changeset
198 }
9e30c776cbef Improved the exception handling.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 600
diff changeset
199
9e30c776cbef Improved the exception handling.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 600
diff changeset
200
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
201 /**
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
202 * 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
203 * 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
204 */
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
205 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
206 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
207 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
208 }
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
209
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
210
8facd8545a12 Added a global configuration for the client and classes providing methods to retrieve these information.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 6
diff changeset
211 /**
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
212 * 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
213 *
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
214 * @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
215 */
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
216 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
217 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
218 }
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
219
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
220
2da6be38d8b6 Added a User interface and a default implementation to handle users in this client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 14
diff changeset
221 /**
2da6be38d8b6 Added a User interface and a default implementation to handle users in this client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 14
diff changeset
222 * 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
223 */
2da6be38d8b6 Added a User interface and a default implementation to handle users in this client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 14
diff changeset
224 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
225 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
226 }
2da6be38d8b6 Added a User interface and a default implementation to handle users in this client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 14
diff changeset
227
2da6be38d8b6 Added a User interface and a default implementation to handle users in this client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 14
diff changeset
228
2da6be38d8b6 Added a User interface and a default implementation to handle users in this client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 14
diff changeset
229 /**
28
dfdb927b137d Improved the main menu - added further buttons (clickable labels).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 27
diff changeset
230 * Returns the project list.
dfdb927b137d Improved the main menu - added further buttons (clickable labels).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 27
diff changeset
231 */
dfdb927b137d Improved the main menu - added further buttons (clickable labels).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 27
diff changeset
232 public ProjectList getProjectList() {
dfdb927b137d Improved the main menu - added further buttons (clickable labels).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 27
diff changeset
233 return projectList;
dfdb927b137d Improved the main menu - added further buttons (clickable labels).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 27
diff changeset
234 }
dfdb927b137d Improved the main menu - added further buttons (clickable labels).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 27
diff changeset
235
dfdb927b137d Improved the main menu - added further buttons (clickable labels).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 27
diff changeset
236
dfdb927b137d Improved the main menu - added further buttons (clickable labels).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 27
diff changeset
237 /**
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
238 * 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
239 *
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
240 * @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
241 */
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
242 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
243 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
244 }
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
245
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
246
347cf4a5a486 Open projects are removed from screen if the user deletes them (via project list).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 557
diff changeset
247 /**
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
248 * 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
249 *
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
250 * @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
251 */
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
252 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
253 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
254 }
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
255
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
256
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
257 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
258 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
259 String url = config.getServerUrl();
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
260 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
261
217
907b61e4d702 Improved the exception handling - added warnings for user authentication errors and errors that occur while fetching supported rivers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 101
diff changeset
262 GWT.log("Fetch rivers from server '" + url + "'");
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
263
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
264 riverService.list(url, locale, new AsyncCallback<River[]>() {
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
265 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
266 GWT.log("Could not recieve a list of 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
267 SC.warn(MSG.getString(caught.getMessage()));
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
268 }
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
269
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
270 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
271 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
272 rivers = newRivers;
907b61e4d702 Improved the exception handling - added warnings for user authentication errors and errors that occur while fetching supported rivers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 101
diff changeset
273 }
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
274 });
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
275 }
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
276
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
277
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
278 /**
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
279 * 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
280 * <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
281 * 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
282 * 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
283 */
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
284 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
285 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
286 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
287 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
288 }
907b61e4d702 Improved the exception handling - added warnings for user authentication errors and errors that occur while fetching supported rivers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 101
diff changeset
289
907b61e4d702 Improved the exception handling - added warnings for user authentication errors and errors that occur while fetching supported rivers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 101
diff changeset
290 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
291 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
292 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
293
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;
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 }
907b61e4d702 Improved the exception handling - added warnings for user authentication errors and errors that occur while fetching supported rivers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 101
diff changeset
296
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
297 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
298 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
299
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
300 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
301 }
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
302
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
303
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
304 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
305 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
306 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
307 }
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
308
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
309 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
310 }
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
311
92c200887b20 #21 There might be just a single window for each project now. Users can't open a project twice.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 229
diff changeset
312
92c200887b20 #21 There might be just a single window for each project now. Users can't open a project twice.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 229
diff changeset
313 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
314 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
315 }
92c200887b20 #21 There might be just a single window for each project now. Users can't open a project twice.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 229
diff changeset
316
92c200887b20 #21 There might be just a single window for each project now. Users can't open a project twice.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 229
diff changeset
317
92c200887b20 #21 There might be just a single window for each project now. Users can't open a project twice.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 229
diff changeset
318 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
319 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
320 }
92c200887b20 #21 There might be just a single window for each project now. Users can't open a project twice.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 229
diff changeset
321
92c200887b20 #21 There might be just a single window for each project now. Users can't open a project twice.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 229
diff changeset
322
92c200887b20 #21 There might be just a single window for each project now. Users can't open a project twice.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 229
diff changeset
323 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
324 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
325 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
326 }
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
327
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
328 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
329 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
330 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
331 }
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
332
92c200887b20 #21 There might be just a single window for each project now. Users can't open a project twice.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 229
diff changeset
333 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
334
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
335 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
336
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
337 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
338 final String url = config.getServerUrl();
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
339 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
340
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
341 describeCollectionService.describe(collectionID, url, 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
342 new AsyncCallback<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
343 public void onFailure(Throwable caught) {
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
344 SC.warn(MSG.getString(caught.getMessage()));
9040663aee01 Filled the context menu point 'Open project' of the ProjectList with life - it opens a new window displaying the parameterization of the selected project.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 217
diff changeset
345 }
9040663aee01 Filled the context menu point 'Open project' of the ProjectList with life - it opens a new window displaying the parameterization of the selected project.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 217
diff changeset
346
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
347 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
348 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
349
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
350 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
351 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
352 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
353
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
354 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
355 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
356 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
357 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
358 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
359
94d4f040da3a Bugfix: #326 Made the process of opening existing project more robust if the collection has no artifact set.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 864
diff changeset
360 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
361
94d4f040da3a Bugfix: #326 Made the process of opening existing project more robust if the collection has no artifact set.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 864
diff changeset
362 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
363 }
94d4f040da3a Bugfix: #326 Made the process of opening existing project more robust if the collection has no artifact set.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 864
diff changeset
364
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
365 final CollectionItem item = c.getItem(0);
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
366
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 (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
368 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
369 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
370 }
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
371
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
372 getArtifactService.getArtifact(
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
373 url,
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
374 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
375 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
376 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
377 new AsyncCallback<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
378 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
379 unlockProject(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
380 SC.warn(MSG.getString(caught.getMessage()));
9040663aee01 Filled the context menu point 'Open project' of the ProjectList with life - it opens a new window displaying the parameterization of the selected project.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 217
diff changeset
381 }
9040663aee01 Filled the context menu point 'Open project' of the ProjectList with life - it opens a new window displaying the parameterization of the selected project.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 217
diff changeset
382
9040663aee01 Filled the context menu point 'Open project' of the ProjectList with life - it opens a new window displaying the parameterization of the selected project.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 217
diff changeset
383 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
384 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
385 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
386
9040663aee01 Filled the context menu point 'Open project' of the ProjectList with life - it opens a new window displaying the parameterization of the selected project.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 217
diff changeset
387 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
388 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
389 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
390 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
391 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
392
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
393 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
394 }
9040663aee01 Filled the context menu point 'Open project' of the ProjectList with life - it opens a new window displaying the parameterization of the selected project.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 217
diff changeset
395 });
9040663aee01 Filled the context menu point 'Open project' of the ProjectList with life - it opens a new window displaying the parameterization of the selected project.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 217
diff changeset
396
9040663aee01 Filled the context menu point 'Open project' of the ProjectList with life - it opens a new window displaying the parameterization of the selected project.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 217
diff changeset
397 }
9040663aee01 Filled the context menu point 'Open project' of the ProjectList with life - it opens a new window displaying the parameterization of the selected project.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 217
diff changeset
398 });
9040663aee01 Filled the context menu point 'Open project' of the ProjectList with life - it opens a new window displaying the parameterization of the selected project.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 217
diff changeset
399 }
9040663aee01 Filled the context menu point 'Open project' of the ProjectList with life - it opens a new window displaying the parameterization of the selected project.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 217
diff changeset
400
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
401
611
854312c0528c #21 Newly created projects cannot be opened twice.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 605
diff changeset
402 public void closeProject(String uuid) {
854312c0528c #21 Newly created projects cannot be opened twice.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 605
diff changeset
403 unlockProject(uuid);
854312c0528c #21 Newly created projects cannot be opened twice.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 605
diff changeset
404 workspace.destroyProject(uuid);
854312c0528c #21 Newly created projects cannot be opened twice.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 605
diff changeset
405 }
854312c0528c #21 Newly created projects cannot be opened twice.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 605
diff changeset
406
854312c0528c #21 Newly created projects cannot be opened twice.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 605
diff changeset
407
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
408 /**
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
409 * 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
410 */
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
411 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
412 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
413 String url = config.getServerUrl();
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
414 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
415
845
4db672cdacb2 Added outs/facet filters when creation new artifacts.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 807
diff changeset
416 artifactService.create(url, 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
417 new AsyncCallback<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
418 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
419 GWT.log("Could not create the 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
420 SC.warn(MSG.getString(caught.getMessage()));
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
421 }
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
422
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
423 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
424 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
425 }
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
426 });
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
427 }
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
428
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
429
611
854312c0528c #21 Newly created projects cannot be opened twice.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 605
diff changeset
430 public void onCollectionChange(CollectionChangeEvent event) {
854312c0528c #21 Newly created projects cannot be opened twice.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 605
diff changeset
431 Collection oldC = event.getOldValue();
854312c0528c #21 Newly created projects cannot be opened twice.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 605
diff changeset
432
854312c0528c #21 Newly created projects cannot be opened twice.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 605
diff changeset
433 if (oldC == null) {
854312c0528c #21 Newly created projects cannot be opened twice.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 605
diff changeset
434 Collection newC = event.getNewValue();
854312c0528c #21 Newly created projects cannot be opened twice.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 605
diff changeset
435 lockProject(newC.identifier());
854312c0528c #21 Newly created projects cannot be opened twice.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 605
diff changeset
436 }
854312c0528c #21 Newly created projects cannot be opened twice.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 605
diff changeset
437 }
854312c0528c #21 Newly created projects cannot be opened twice.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 605
diff changeset
438
854312c0528c #21 Newly created projects cannot be opened twice.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 605
diff changeset
439
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
440
92c200887b20 #21 There might be just a single window for each project now. Users can't open a project twice.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 229
diff changeset
441 /**
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
442 * 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
443 * 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
444 */
611
854312c0528c #21 Newly created projects cannot be opened twice.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 605
diff changeset
445 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
446 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
447 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
448
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
449 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
450 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
451 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
452 }
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
453
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
454 public void onCloseClick(CloseClientEvent event) {
611
854312c0528c #21 Newly created projects cannot be opened twice.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 605
diff changeset
455 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
456 }
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
457 }
0
4e8be5e7855f Start of a GWT based client for FLYS-3.0
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
458 }
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
459 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :

http://dive4elements.wald.intevation.org