Mercurial > dive4elements > river
comparison flys-client/src/main/java/de/intevation/flys/client/client/ui/CollectionView.java @ 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.
flys-client/trunk@1681 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Ingo Weinzierl <ingo.weinzierl@intevation.de> |
---|---|
date | Thu, 14 Apr 2011 07:53:01 +0000 |
parents | bbe32496dc84 |
children | 47fe77a1bac7 |
comparison
equal
deleted
inserted
replaced
228:bbe32496dc84 | 229:924da6695800 |
---|---|
159 * @param ownerId The uuid of the user that should own the new collection. | 159 * @param ownerId The uuid of the user that should own the new collection. |
160 */ | 160 */ |
161 protected void createNewCollection(String ownerId) { | 161 protected void createNewCollection(String ownerId) { |
162 GWT.log("CollectionView.createNewCollection"); | 162 GWT.log("CollectionView.createNewCollection"); |
163 | 163 |
164 Config config = Config.getInstance(); | 164 Config config = Config.getInstance(); |
165 final String serverUrl = config.getServerUrl(); | 165 final String url = config.getServerUrl(); |
166 final String locale = config.getLocale(); | |
166 | 167 |
167 createCollectionService.create( | 168 createCollectionService.create( |
168 serverUrl, ownerId, | 169 url, locale, ownerId, |
169 new AsyncCallback<Collection>() { | 170 new AsyncCallback<Collection>() { |
170 public void onFailure(Throwable caught) { | 171 public void onFailure(Throwable caught) { |
171 GWT.log("Could not create the new collection."); | 172 GWT.log("Could not create the new collection."); |
172 SC.warn(messages.getString(caught.getMessage())); | 173 SC.warn(messages.getString(caught.getMessage())); |
173 } | 174 } |
174 | 175 |
175 public void onSuccess(Collection collection) { | 176 public void onSuccess(Collection collection) { |
176 GWT.log("Successfully created a new collection."); | 177 GWT.log("Successfully created a new collection."); |
177 | 178 |
178 Artifact artifact = getArtifact(); | 179 Artifact artifact = getArtifact(); |
179 addArtifactService.add(collection, artifact, serverUrl, | 180 addArtifactService.add(collection, artifact, url, locale, |
180 new AsyncCallback<Collection>() { | 181 new AsyncCallback<Collection>() { |
181 | 182 |
182 public void onFailure(Throwable caught) { | 183 public void onFailure(Throwable caught) { |
183 GWT.log("An error occured while adding artifact."); | 184 GWT.log("An error occured while adding artifact."); |
184 SC.warn(messages.getString(caught.getMessage())); | 185 SC.warn(messages.getString(caught.getMessage())); |
272 OutputMode[] outs = desc.getOutputModes(); | 273 OutputMode[] outs = desc.getOutputModes(); |
273 | 274 |
274 setArtifact(art); | 275 setArtifact(art); |
275 clearOutputTabs(); | 276 clearOutputTabs(); |
276 | 277 |
277 Collection collection = getCollection(); | 278 Collection c = getCollection(); |
278 | 279 |
279 if (outs != null && collection == null) { | 280 if (outs != null && c == null) { |
280 User user = getFlys().getCurrentUser(); | 281 User user = getFlys().getCurrentUser(); |
281 createNewCollection(user.identifier()); | 282 createNewCollection(user.identifier()); |
282 } | 283 } |
283 else if (outs != null && collection != null) { | 284 else if (outs != null && c != null) { |
284 Config config = Config.getInstance(); | 285 Config config = Config.getInstance(); |
285 String url = config.getServerUrl(); | 286 String url = config.getServerUrl(); |
286 | 287 String locale = config.getLocale(); |
287 describeCollectionService.describe(collection.identifier(), url, | 288 |
289 describeCollectionService.describe(c.identifier(), url, locale, | |
288 new AsyncCallback<Collection>() { | 290 new AsyncCallback<Collection>() { |
289 public void onFailure(Throwable caught) { | 291 public void onFailure(Throwable caught) { |
290 GWT.log("Could not DESCRIBE collection."); | 292 GWT.log("Could not DESCRIBE collection."); |
291 SC.warn(messages.getString(caught.getMessage())); | 293 SC.warn(messages.getString(caught.getMessage())); |
292 } | 294 } |