Mercurial > dive4elements > river
comparison artifacts/src/main/java/org/dive4elements/river/artifacts/D4EArtifact.java @ 7676:da412a6c4f39
Cosmetics, doc.
author | Felix Wolfsteller <felix.wolfsteller@intevation.de> |
---|---|
date | Mon, 09 Dec 2013 10:31:24 +0100 |
parents | 60a5fc522ec4 |
children | 56001dce01dd |
comparison
equal
deleted
inserted
replaced
7675:7e4c5bd86227 | 7676:da412a6c4f39 |
---|---|
116 * Used to generates "view" on the facets (hides facets not matching the | 116 * Used to generates "view" on the facets (hides facets not matching the |
117 * filter in output of collection); out -> facets. | 117 * filter in output of collection); out -> facets. |
118 */ | 118 */ |
119 protected Map<String, List<Facet>> filterFacets; | 119 protected Map<String, List<Facet>> filterFacets; |
120 | 120 |
121 /** To which out this artifacts facets are bound by default. */ | |
121 private String boundToOut; | 122 private String boundToOut; |
123 | |
122 | 124 |
123 /** | 125 /** |
124 * Interface to a global facet filter. | 126 * Interface to a global facet filter. |
125 */ | 127 */ |
126 public interface FacetFilter { | 128 public interface FacetFilter { |
1295 | 1297 |
1296 return gen; | 1298 return gen; |
1297 } | 1299 } |
1298 | 1300 |
1299 /** If we use a facet filter that bases the list of compatible facets | 1301 /** If we use a facet filter that bases the list of compatible facets |
1300 * on the output this artifact is bound to then this returns true */ | 1302 * on the output this artifact is bound to then return true. */ |
1301 public boolean usesOutputGlobalFacetFilter() { | 1303 public boolean usesOutputGlobalFacetFilter() { |
1302 if (boundToOut == null || boundToOut.isEmpty()) { | 1304 if (boundToOut == null || boundToOut.isEmpty()) { |
1303 return false; | 1305 return false; |
1304 } | 1306 } |
1305 | 1307 |
1308 .get(RiverContext.FACETFILTER_KEY); | 1310 .get(RiverContext.FACETFILTER_KEY); |
1309 | 1311 |
1310 return facetFilter != null; | 1312 return facetFilter != null; |
1311 } | 1313 } |
1312 | 1314 |
1313 /** If a global facet filter and a bounded out are defined | 1315 /** |
1314 * use them to eliminate unwished facets. | 1316 * If a global facet filter and a bounded out are defined |
1317 * use them to eliminate unwished facets. | |
1315 */ | 1318 */ |
1316 protected List<Facet> applyGlobalFilterFacets(List<Facet> facets) { | 1319 protected List<Facet> applyGlobalFilterFacets(List<Facet> facets) { |
1317 if (!usesOutputGlobalFacetFilter()) { | 1320 if (!usesOutputGlobalFacetFilter()) { |
1318 return facets; | 1321 return facets; |
1319 } | 1322 } |
1431 return compute(context, hash, current, type, generateFacets); | 1434 return compute(context, hash, current, type, generateFacets); |
1432 } | 1435 } |
1433 | 1436 |
1434 | 1437 |
1435 /** | 1438 /** |
1436 * Like compute, but identify State by it id (string). | 1439 * Like compute, but identify State by its id (string). |
1437 */ | 1440 */ |
1438 public Object compute( | 1441 public Object compute( |
1439 CallContext context, | 1442 CallContext context, |
1440 String hash, | 1443 String hash, |
1441 String stateID, | 1444 String stateID, |
1524 } | 1527 } |
1525 } | 1528 } |
1526 } | 1529 } |
1527 | 1530 |
1528 /** | 1531 /** |
1529 * Sets the facets for an ID | 1532 * Sets the facets for an ID, which is normally a state ID. |
1530 * | |
1531 * Normally the id is a state ID. | |
1532 * | 1533 * |
1533 * @param id ID to map the facets to | 1534 * @param id ID to map the facets to |
1534 * @param facets List of facets to be stored | 1535 * @param facets List of facets to be stored |
1535 */ | 1536 */ |
1536 protected void addFacets(String id, List<Facet> facets) { | 1537 protected void addFacets(String id, List<Facet> facets) { |
1653 | 1654 |
1654 destroyStates(toDestroy, context); | 1655 destroyStates(toDestroy, context); |
1655 } | 1656 } |
1656 | 1657 |
1657 /** | 1658 /** |
1658 * Return the Facets which a state provides | 1659 * Return the Facets which a state provides. |
1659 * @param stateid String that identifies the state | 1660 * @param stateid String that identifies the state |
1660 * @return List of Facets belonging to the state identifier | 1661 * @return List of Facets belonging to the state identifier |
1661 */ | 1662 */ |
1662 protected List<Facet> getFacets(String stateid) { | 1663 protected List<Facet> getFacets(String stateid) { |
1663 return facets.get(stateid); | 1664 return facets.get(stateid); |
1666 public String getBoundToOut() { | 1667 public String getBoundToOut() { |
1667 return boundToOut; | 1668 return boundToOut; |
1668 } | 1669 } |
1669 | 1670 |
1670 /** | 1671 /** |
1671 * Binds this artifact and all its facet to an out | 1672 * Binds this artifact and all its facet to an out. |
1672 */ | 1673 */ |
1673 public void setBoundToOut(String out) { | 1674 public void setBoundToOut(String out) { |
1674 boundToOut = out; | 1675 boundToOut = out; |
1675 for (List<Facet> stateFacets: facets.values()) { | 1676 for (List<Facet> stateFacets: facets.values()) { |
1676 for (Facet fac: stateFacets) { | 1677 for (Facet fac: stateFacets) { |