comparison gwt-client/src/main/java/org/dive4elements/river/client/client/FLYS.java @ 6479:ac6c41fcae55

Use help-url provided by ServerInfoService (fix for #1197). Required some changes in FLYS.onModuleLoad(), should be reviewed by someone.
author Christian Lins <christian.lins@intevation.de>
date Thu, 27 Jun 2013 17:36:51 +0200
parents b0b0ba6e7bb0
children d19a0ffb9ccf
comparison
equal deleted inserted replaced
6478:6e54f72b4caf 6479:ac6c41fcae55
152 vertical.addMember(view); 152 vertical.addMember(view);
153 153
154 vertical.draw(); 154 vertical.draw();
155 155
156 Config config = Config.getInstance(); 156 Config config = Config.getInstance();
157 String locale = config.getLocale(); 157 final String locale = config.getLocale();
158 158
159 serverInfoService.getConfig(locale, new AsyncCallback<Map<String,String>>() { 159 serverInfoService.getConfig(locale, new AsyncCallback<Map<String,String>>() {
160 160
161 @Override 161 @Override
162 public void onSuccess(Map<String, String> result) { 162 public void onSuccess(Map<String, String> result) {
163 GWT.log("serverInfoService.callBack.onSuccess"); 163 GWT.log("serverInfoService.callBack.onSuccess");
164 GWT.log("help-url=" + result.get("help-url")); 164 GWT.log("help-url=" + result.get("help-url"));
165 Config.getInstance().setWikiUrl(result.get("help-url"));
166
167 // Start user service; somewhat nested here...
168 userService.getCurrentUser(locale, new AsyncCallback<User>() {
169 @Override
170 public void onFailure(Throwable caught) {
171 GWT.log("Could not find a logged in user.");
172 String msg = getExceptionString(MSG, caught);
173 SC.warn(msg);
174 }
175
176 @Override
177 public void onSuccess(User user) {
178 GWT.log("Found a user. Set '"+ user.getName() + "'");
179 setCurrentUser(user);
180
181 header.setCurrentUser(user);
182
183 projectList = new ProjectList(FLYS.this, user);
184 workspace = new FLYSWorkspace(FLYS.this);
185 view.setProjectList(projectList);
186 view.setFLYSWorkspace(workspace);
187
188 readRivers();
189 }
190 });
165 } 191 }
166 192
167 @Override 193 @Override
168 public void onFailure(Throwable caught) { 194 public void onFailure(Throwable caught) {
169 GWT.log("serverInfoService.callBack.onFailure"); 195 GWT.log("Could not read server information.");
170 196 String msg = getExceptionString(MSG, caught);
171 } 197 SC.warn(msg);
172 });
173
174 userService.getCurrentUser(locale, new AsyncCallback<User>() {
175 @Override
176 public void onFailure(Throwable caught) {
177 GWT.log("Could not find a logged in user.");
178 String msg = getExceptionString(MSG, caught);
179 SC.warn(msg);
180 }
181
182 @Override
183 public void onSuccess(User user) {
184 GWT.log("Found a user. Set '"+ user.getName() + "'");
185 setCurrentUser(user);
186
187 header.setCurrentUser(user);
188
189 projectList = new ProjectList(FLYS.this, user);
190 workspace = new FLYSWorkspace(FLYS.this);
191 view.setProjectList(projectList);
192 view.setFLYSWorkspace(workspace);
193
194 readRivers();
195 } 198 }
196 }); 199 });
197 } 200 }
198 201
199 202

http://dive4elements.wald.intevation.org