Mercurial > dive4elements > river
comparison flys-client/src/main/java/de/intevation/flys/client/client/ui/DatacageWindow.java @ 811:8fa303586f14
Pass user id to the meta data service.
flys-client/trunk@2466 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Sascha L. Teichmann <sascha.teichmann@intevation.de> |
---|---|
date | Mon, 08 Aug 2011 11:02:45 +0000 |
parents | ba1b27b7d282 |
children | 70b728a9f4e8 |
comparison
equal
deleted
inserted
replaced
810:a443dd6566b8 | 811:8fa303586f14 |
---|---|
20 import de.intevation.flys.client.shared.model.Artifact; | 20 import de.intevation.flys.client.shared.model.Artifact; |
21 import de.intevation.flys.client.shared.model.ArtifactDescription; | 21 import de.intevation.flys.client.shared.model.ArtifactDescription; |
22 import de.intevation.flys.client.shared.model.Data; | 22 import de.intevation.flys.client.shared.model.Data; |
23 import de.intevation.flys.client.shared.model.DataList; | 23 import de.intevation.flys.client.shared.model.DataList; |
24 import de.intevation.flys.client.shared.model.DataItem; | 24 import de.intevation.flys.client.shared.model.DataItem; |
25 import de.intevation.flys.client.shared.model.User; | |
25 | 26 |
26 import de.intevation.flys.client.client.FLYSConstants; | 27 import de.intevation.flys.client.client.FLYSConstants; |
27 import de.intevation.flys.client.client.Config; | 28 import de.intevation.flys.client.client.Config; |
28 | 29 |
29 import de.intevation.flys.client.client.services.MetaDataService; | 30 import de.intevation.flys.client.client.services.MetaDataService; |
41 protected FLYSConstants messages = | 42 protected FLYSConstants messages = |
42 GWT.create(FLYSConstants.class); | 43 GWT.create(FLYSConstants.class); |
43 | 44 |
44 | 45 |
45 protected Artifact artifact; | 46 protected Artifact artifact; |
47 protected User user; | |
46 | 48 |
47 protected TreeGrid treeGrid; | 49 protected TreeGrid treeGrid; |
48 | 50 |
49 protected Layout layout; | 51 protected Layout layout; |
50 | 52 |
51 | 53 |
52 public DatacageWindow(Artifact artifact) { | 54 public DatacageWindow(Artifact artifact, User user) { |
53 this.artifact = artifact; | 55 this.artifact = artifact; |
56 this.user = user; | |
54 | 57 |
55 setWidth(200); | 58 setWidth(250); |
56 setHeight(300); | 59 setHeight(400); |
57 | 60 |
58 layout = new VLayout(); | 61 layout = new VLayout(); |
59 layout.setWidth100(); | 62 layout.setWidth100(); |
60 | 63 |
61 addItem(layout); | 64 addItem(layout); |
66 treeGrid.setHeight100(); | 69 treeGrid.setHeight100(); |
67 | 70 |
68 layout.addMember(treeGrid); | 71 layout.addMember(treeGrid); |
69 | 72 |
70 String river = findRiver(); | 73 String river = findRiver(); |
74 // TODO: i18n | |
71 setTitle("Datenkorb: " + river); | 75 setTitle("Datenkorb: " + river); |
72 setShowMinimizeButton(false); | 76 setShowMinimizeButton(false); |
73 setIsModal(true); | 77 setIsModal(true); |
74 setShowModalMask(true); | 78 setShowModalMask(true); |
75 setCanDragResize(true); | 79 setCanDragResize(true); |
76 | 80 |
77 centerInPage(); | 81 centerInPage(); |
78 | 82 |
79 triggerTreeBuilding(river); | 83 triggerTreeBuilding(); |
80 } | 84 } |
81 | 85 |
82 protected void triggerTreeBuilding(String river) { | 86 protected void triggerTreeBuilding() { |
83 Config config = Config.getInstance(); | 87 Config config = Config.getInstance(); |
84 String url = config.getServerUrl(); | 88 String url = config.getServerUrl(); |
85 String locale = config.getLocale(); | 89 String locale = config.getLocale(); |
86 | 90 |
91 String artifactId = artifact.getUuid(); | |
92 String userId = user != null ? user.identifier() : null; | |
93 | |
87 metaDataService.getMetaData( | 94 metaDataService.getMetaData( |
88 url, locale, river, | 95 url, locale, |
96 artifactId, | |
97 userId, | |
89 new AsyncCallback<DataCageTree>() { | 98 new AsyncCallback<DataCageTree>() { |
90 public void onFailure(Throwable caught) { | 99 public void onFailure(Throwable caught) { |
91 GWT.log("Could not load meta data."); | 100 GWT.log("Could not load meta data."); |
92 SC.warn(messages.getString(caught.getMessage())); | 101 SC.warn(messages.getString(caught.getMessage())); |
93 } | 102 } |