comparison flys-client/src/main/java/de/intevation/flys/client/client/ui/CollectionView.java @ 26:c19985f75118

Implemented a service that triggers the artifact-collection creation in the artifact server. flys-client/trunk@1413 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Ingo Weinzierl <ingo.weinzierl@intevation.de>
date Mon, 07 Mar 2011 13:47:55 +0000
parents dc086030e6a3
children 5709bd8f4d7c
comparison
equal deleted inserted replaced
25:2da6be38d8b6 26:c19985f75118
34 import de.intevation.flys.client.client.event.StepForwardEvent; 34 import de.intevation.flys.client.client.event.StepForwardEvent;
35 import de.intevation.flys.client.client.event.StepForwardHandler; 35 import de.intevation.flys.client.client.event.StepForwardHandler;
36 import de.intevation.flys.client.client.event.CollectionChangeHandler; 36 import de.intevation.flys.client.client.event.CollectionChangeHandler;
37 import de.intevation.flys.client.client.services.ArtifactService; 37 import de.intevation.flys.client.client.services.ArtifactService;
38 import de.intevation.flys.client.client.services.ArtifactServiceAsync; 38 import de.intevation.flys.client.client.services.ArtifactServiceAsync;
39 import de.intevation.flys.client.client.services.CreateCollectionService;
40 import de.intevation.flys.client.client.services.CreateCollectionServiceAsync;
39 41
40 42
41 /** 43 /**
42 * @author <a href="mailto:ingo.weinzierl@intevation.de">Ingo Weinzierl</a> 44 * @author <a href="mailto:ingo.weinzierl@intevation.de">Ingo Weinzierl</a>
43 */ 45 */
48 { 50 {
49 /** The ArtifactService used to communicate with the Artifact server. */ 51 /** The ArtifactService used to communicate with the Artifact server. */
50 protected ArtifactServiceAsync artifactService = 52 protected ArtifactServiceAsync artifactService =
51 GWT.create(ArtifactService.class); 53 GWT.create(ArtifactService.class);
52 54
55 /** The ArtifactService used to communicate with the Artifact server. */
56 protected CreateCollectionServiceAsync createCollectionService =
57 GWT.create(CreateCollectionService.class);
58
53 /** The message class that provides i18n strings.*/ 59 /** The message class that provides i18n strings.*/
54 FLYSMessages messages = GWT.create(FLYSMessages.class); 60 FLYSMessages messages = GWT.create(FLYSMessages.class);
55 61
56 /** The FLYS instance used to call services.*/ 62 /** The FLYS instance used to call services.*/
57 protected FLYS flys; 63 protected FLYS flys;
122 if (isNew()) { 128 if (isNew()) {
123 tabs.setTabTitle(0, "MODUL"); 129 tabs.setTabTitle(0, "MODUL");
124 tabs.updateTab(0, renderNew()); 130 tabs.updateTab(0, renderNew());
125 } 131 }
126 } 132 }
133
134
135 /**
136 * This method triggers the CreateCollectionService to create a new
137 * collection in the artifact server.
138 *
139 * @param ownerId The uuid of the user that should own the new collection.
140 */
141 protected void createNewCollection(String ownerId) {
142 Config config = Config.getInstance();
143 String serverUrl = config.getServerUrl();
144
145 createCollectionService.create(
146 serverUrl, ownerId,
147 new AsyncCallback<String>() {
148 public void onFailure(Throwable caught) {
149 GWT.log("Could not create the new collection.");
150 GWT.log(caught.getMessage());
151 }
152
153 public void onSuccess(String uuid) {
154 GWT.log("Successfully created a new collection.");
155 GWT.log("NEW collection uuid: " + uuid);
156 }
157 });
158 }
159
160
161 protected FLYS getFlys() {
162 return flys;
163 }
164
127 165
128 166
129 /** 167 /**
130 * This method registers a new ValueChangeHandler. 168 * This method registers a new ValueChangeHandler.
131 * 169 *

http://dive4elements.wald.intevation.org