# HG changeset patch # User Felix Wolfsteller # Date 1326704316 0 # Node ID 6431b7efe240bba060ab82d847b79ad80de0d210 # Parent 1f51f3c46efe55fe7d4b641e3a94fdd9157fff47 Cosmetics. artifacts/trunk@3680 c6561f87-3c4e-4783-a992-168aeb5c3f6f diff -r 1f51f3c46efe -r 6431b7efe240 artifact-database/src/main/java/de/intevation/artifactdatabase/DefaultArtifact.java --- a/artifact-database/src/main/java/de/intevation/artifactdatabase/DefaultArtifact.java Wed Jan 11 10:58:34 2012 +0000 +++ b/artifact-database/src/main/java/de/intevation/artifactdatabase/DefaultArtifact.java Mon Jan 16 08:58:36 2012 +0000 @@ -36,6 +36,7 @@ */ protected String identifier; + /** * Default constructor. */ @@ -58,6 +59,7 @@ return this.identifier; } + public String hash() { String hash = String.valueOf(hashCode()); if (logger.isDebugEnabled()) { @@ -113,8 +115,12 @@ } } - public void setup(String identifier, ArtifactFactory factory, - Object context, CallMeta callMeta, Document data) { + public void setup(String identifier, + ArtifactFactory factory, + Object context, + CallMeta callMeta, + Document data) + { if (logger.isDebugEnabled()) { logger.debug("DefaultArtifact.setup: " + identifier); } diff -r 1f51f3c46efe -r 6431b7efe240 artifact-database/src/main/java/de/intevation/artifactdatabase/DefaultArtifactCollectionFactory.java --- a/artifact-database/src/main/java/de/intevation/artifactdatabase/DefaultArtifactCollectionFactory.java Wed Jan 11 10:58:34 2012 +0000 +++ b/artifact-database/src/main/java/de/intevation/artifactdatabase/DefaultArtifactCollectionFactory.java Mon Jan 16 08:58:36 2012 +0000 @@ -134,7 +134,13 @@ ArtifactCollection collection = (ArtifactCollection) clazz.newInstance(); - collection.setup(identifier, name, creationTime, ttl, this, context, data); + collection.setup(identifier, + name, + creationTime, + ttl, + this, + context, + data); return collection; } diff -r 1f51f3c46efe -r 6431b7efe240 artifact-database/src/main/java/de/intevation/artifactdatabase/state/AbstractState.java --- a/artifact-database/src/main/java/de/intevation/artifactdatabase/state/AbstractState.java Wed Jan 11 10:58:34 2012 +0000 +++ b/artifact-database/src/main/java/de/intevation/artifactdatabase/state/AbstractState.java Mon Jan 16 08:58:36 2012 +0000 @@ -47,15 +47,15 @@ * the configuration. */ public static final String XPATH_DESCRIPTION = "@description"; - /** The XPath to the output nodes of the state configuration.*/ + /** The XPath to the output nodes of the state configuration. */ public static final String XPATH_OUTPUT_MODES = "outputmodes/outputmode"; /** The XPath to the list of facets relative to the output mode it belongs - * to.*/ + * to. */ public static final String XPATH_FACETS = "facets/facet"; - /** The logger that is used in this class.*/ + /** The logger that is used in this class. */ private static Logger logger = Logger.getLogger(AbstractState.class); @@ -68,7 +68,7 @@ /** The data provided by this state. */ protected Map data; - /** A list of output modes which are available for this state.*/ + /** A list of output modes which are available for this state. */ protected List outputs; @@ -88,7 +88,6 @@ this.id = id; this.description = description; - } diff -r 1f51f3c46efe -r 6431b7efe240 artifact-database/src/main/java/de/intevation/artifactdatabase/state/DefaultFacet.java --- a/artifact-database/src/main/java/de/intevation/artifactdatabase/state/DefaultFacet.java Wed Jan 11 10:58:34 2012 +0000 +++ b/artifact-database/src/main/java/de/intevation/artifactdatabase/state/DefaultFacet.java Mon Jan 16 08:58:36 2012 +0000 @@ -60,33 +60,19 @@ } - /** - * Copies name, index and description of other facet. - */ - public void set(Facet other) { - index = other.getIndex(); - name = other.getName(); - description = other.getDescription(); - } - - - public Facet deepCopy() { - DefaultFacet copy = new DefaultFacet(); - copy.set(this); - return copy; - } - - + /** Get index. */ public int getIndex() { return index; } + /** Returns the name ('type'). */ public String getName() { return name; } + /** Returns the description (e.g. displayed in gui). */ public String getDescription() { return description; } @@ -125,15 +111,7 @@ } - public String toString() { - return new StringBuilder("name = '") - .append(name).append("', index = ") - .append(index).append(", description = '") - .append(description).append("'") - .toString(); - } - - + /** Create a xml represantation. */ public Node toXML(Document doc) { ElementCreator ec = new ElementCreator( doc, @@ -147,5 +125,33 @@ return facet; } + + + /** Create a string representation. */ + public String toString() { + return new StringBuilder("name = '") + .append(name).append("', index = ") + .append(index).append(", description = '") + .append(description).append("'") + .toString(); + } + + + /** + * Copies name, index and description of other facet. + */ + public void set(Facet other) { + index = other.getIndex(); + name = other.getName(); + description = other.getDescription(); + } + + + /** Create a deep copy of this facet. */ + public Facet deepCopy() { + DefaultFacet copy = new DefaultFacet(); + copy.set(this); + return copy; + } } // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf-8 : diff -r 1f51f3c46efe -r 6431b7efe240 artifacts-common/src/main/java/de/intevation/artifacts/common/utils/ClientProtocolUtils.java --- a/artifacts-common/src/main/java/de/intevation/artifacts/common/utils/ClientProtocolUtils.java Wed Jan 11 10:58:34 2012 +0000 +++ b/artifacts-common/src/main/java/de/intevation/artifacts/common/utils/ClientProtocolUtils.java Mon Jan 16 08:58:36 2012 +0000 @@ -42,7 +42,6 @@ public static final String XPATH_OUTPUT_MODES = "/art:result/art:outputmodes/art:output"; - /** The XPath to the select node relative to the dynamic UI node in the * DESCRIBE document. */ public static final String XPATH_DATA_SELECT = "art:select"; diff -r 1f51f3c46efe -r 6431b7efe240 artifacts-common/src/main/java/de/intevation/artifacts/common/utils/XMLUtils.java --- a/artifacts-common/src/main/java/de/intevation/artifacts/common/utils/XMLUtils.java Wed Jan 11 10:58:34 2012 +0000 +++ b/artifacts-common/src/main/java/de/intevation/artifacts/common/utils/XMLUtils.java Mon Jan 16 08:58:36 2012 +0000 @@ -149,7 +149,6 @@ else { element.setAttribute(name, value); } - } } // class ElementCreator