Mercurial > dive4elements > river
comparison artifacts/src/main/java/org/dive4elements/river/artifacts/datacage/Recommendations.java @ 6400:25230bc3137c
Datacage: Store the official lines of an artifact under the key 'official-lines'. Can be treated with <dc:container-context>.
author | Sascha L. Teichmann <teichmann@intevation.de> |
---|---|
date | Fri, 21 Jun 2013 23:35:01 +0200 |
parents | d0f01bc92fd0 |
children | e89e5163973f |
comparison
equal
deleted
inserted
replaced
6399:10fe6758dfb0 | 6400:25230bc3137c |
---|---|
43 | 43 |
44 import org.dive4elements.artifactdatabase.data.StateData; | 44 import org.dive4elements.artifactdatabase.data.StateData; |
45 | 45 |
46 import org.dive4elements.river.artifacts.datacage.templating.Builder; | 46 import org.dive4elements.river.artifacts.datacage.templating.Builder; |
47 import org.dive4elements.river.artifacts.datacage.templating.BuilderPool; | 47 import org.dive4elements.river.artifacts.datacage.templating.BuilderPool; |
48 import org.dive4elements.river.artifacts.model.OfficialLineFinder; | |
48 | 49 |
49 | 50 |
50 /** | 51 /** |
51 * Also accessible as Singleton with getInstance(). | 52 * Also accessible as Singleton with getInstance(). |
52 */ | 53 */ |
134 public BuilderPool getBuilderPool() { | 135 public BuilderPool getBuilderPool() { |
135 return builderPoolProvider.getBuilderPool(); | 136 return builderPoolProvider.getBuilderPool(); |
136 } | 137 } |
137 | 138 |
138 protected static void artifactToParameters( | 139 protected static void artifactToParameters( |
139 D4EArtifact artifact, | 140 D4EArtifact artifact, |
140 Map<String, Object> parameters | 141 Map<String, Object> parameters |
141 ) { | 142 ) { |
142 parameters.put("CURRENT-STATE-ID", artifact.getCurrentStateId()); | 143 parameters.put("CURRENT-STATE-ID", artifact.getCurrentStateId()); |
143 parameters.put("ARTIFACT-ID", artifact.identifier()); | 144 parameters.put("ARTIFACT-ID", artifact.identifier()); |
144 | 145 |
148 continue; | 149 continue; |
149 } | 150 } |
150 String key = sd.getName().replace('.', '-').toUpperCase(); | 151 String key = sd.getName().replace('.', '-').toUpperCase(); |
151 parameters.put(key, value); | 152 parameters.put(key, value); |
152 } | 153 } |
154 | |
155 // XXX: THIS IS THE HACK TO BRING THE OFFICIAL LINES INTO THE DATACAGE! | |
156 parameters.put( | |
157 "OFFICIAL-LINES", OfficialLineFinder.findOfficialLines(artifact)); | |
153 } | 158 } |
154 | 159 |
155 /** | 160 /** |
156 * Put Key/Values from \param src to \param dst, but uppercase | 161 * Put Key/Values from \param src to \param dst, but uppercase |
157 * both Keys and Values. | 162 * both Keys and Values. |
169 /** | 174 /** |
170 * Append recommendations to \param result. | 175 * Append recommendations to \param result. |
171 * @param extraParameters parameters (typicall example: 'recommended') | 176 * @param extraParameters parameters (typicall example: 'recommended') |
172 */ | 177 */ |
173 public void recommend( | 178 public void recommend( |
174 D4EArtifact artifact, | 179 D4EArtifact artifact, |
175 String userId, | 180 String userId, |
176 String [] outs, | 181 String [] outs, |
177 Map<String, Object> extraParameters, | 182 Map<String, Object> extraParameters, |
178 Node result | 183 Node result |
179 ) { | 184 ) { |