changeset 6598:ca56c4e6a755

Mark staticwqkms that are loaded as officiallines recommendation as official This allows special case handling of them.
author Andre Heinecke <aheinecke@intevation.de>
date Thu, 18 Jul 2013 13:12:39 +0200
parents 27f5182996ea
children 38ee580a30cb
files artifacts/doc/conf/meta-data.xml artifacts/src/main/java/org/dive4elements/river/artifacts/StaticWQKmsArtifact.java
diffstat 2 files changed, 17 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/artifacts/doc/conf/meta-data.xml	Thu Jul 18 12:47:21 2013 +0200
+++ b/artifacts/doc/conf/meta-data.xml	Thu Jul 18 13:12:39 2013 +0200
@@ -2420,8 +2420,8 @@
             <officiallines>
               <dc:for-each>
                 <column name="{$olname}"
-                      ids="additionals-wstv-{$wstcolpos}-{$wstid}"
-                      factory="staticwqkms" target_out="{$out}"/>
+                  ids="official-wstv-{$wstcolpos}-{$wstid}"
+                  factory="staticwqkms" target_out="{$out}"/>
               </dc:for-each>
             </officiallines>
           </dc:if>
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/StaticWQKmsArtifact.java	Thu Jul 18 12:47:21 2013 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/StaticWQKmsArtifact.java	Thu Jul 18 13:12:39 2013 +0200
@@ -59,6 +59,8 @@
 
     private static final String NAME = "staticwqkms";
 
+    private boolean official = false;
+
     static {
         // TODO: Move to configuration.
         FacetActivity.Registry.getInstance().register(
@@ -85,6 +87,10 @@
 
     /**
      * Gets called from factory, to set things up.
+     *
+     * If the id's string starts with official- it will be treated as
+     * an Artifact containing official data for the according special
+     * case handling.
      */
     @Override
     public void setup(
@@ -106,6 +112,10 @@
         if (code != null) {
             String [] parts = code.split("-");
 
+            if (parts.length >= 1) {
+                official = parts[0].toLowerCase().equals("official");
+            }
+
             if (parts.length >= 4) {
                 int col = Integer.parseInt(parts[2]);
                 int wst = Integer.parseInt(parts[3]);
@@ -222,5 +232,10 @@
         return Lines.createWaterLines(points, wAtKm);
     }
     // TODO implement deepCopy.
+
+    public boolean isOfficial()
+    {
+        return official;
+    }
 }
 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf-8 :

http://dive4elements.wald.intevation.org