# HG changeset patch # User Felix Wolfsteller # Date 1319793754 0 # Node ID b503d92dd709049b72dbb1078db8137dcc5791b2 # Parent 2fe270661b207a9a2ebaedf530c38ec533c40165 Cosmetics, docs. flys-artifacts/trunk@3102 c6561f87-3c4e-4783-a992-168aeb5c3f6f diff -r 2fe270661b20 -r b503d92dd709 flys-artifacts/ChangeLog --- a/flys-artifacts/ChangeLog Fri Oct 28 09:08:48 2011 +0000 +++ b/flys-artifacts/ChangeLog Fri Oct 28 09:22:34 2011 +0000 @@ -1,3 +1,10 @@ +2011-10-28 Felix Wolfsteller + + * src/main/java/de/intevation/flys/collections/AttributeWriter.java, + src/main/java/de/intevation/flys/artifacts/model/WstValueTableFactory.java, + src/main/java/de/intevation/flys/collections/FLYSArtifactCollection.java: + Cosmetics, doc. + 2011-10-28 Felix Wolfsteller Let OutputParser and AttributeParser collect all facets on the way. diff -r 2fe270661b20 -r b503d92dd709 flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/WstValueTableFactory.java --- a/flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/WstValueTableFactory.java Fri Oct 28 09:08:48 2011 +0000 +++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/WstValueTableFactory.java Fri Oct 28 09:22:34 2011 +0000 @@ -103,6 +103,9 @@ return new WstValueTable(columns, rows); } + /** + * @param kind Kind of wst. + */ protected static Wst loadWst(Session session, River river, int kind) { Query query = session.createQuery(HQL_WST); query.setParameter("river", river); diff -r 2fe270661b20 -r b503d92dd709 flys-artifacts/src/main/java/de/intevation/flys/collections/AttributeWriter.java --- a/flys-artifacts/src/main/java/de/intevation/flys/collections/AttributeWriter.java Fri Oct 28 09:08:48 2011 +0000 +++ b/flys-artifacts/src/main/java/de/intevation/flys/collections/AttributeWriter.java Fri Oct 28 09:22:34 2011 +0000 @@ -26,7 +26,7 @@ /** * Create attribute- element of describe document of an ArtifactCollection. * The attribute-element contains the merged output of all outputmodes and - * facets that are part of the collection. + * facets that are part of the collection. */ public class AttributeWriter { @@ -45,7 +45,7 @@ * Attributes not present in newAttr will not be included in the document. * @param db Database to fetch artifacts. * @param oldAttr "Old" (possibly user-changed) outputs. - * @param newAttr "New" (eventually re-read in its original, unchagnged + * @param newAttr "New" (eventually re-read in its original, unchanged * form) outputs. */ public AttributeWriter( @@ -62,10 +62,12 @@ /** * Create document by merging outputs given in * constructor. + * * The "new" set rules about existance of attributes, so anything not * present in it will not be included in the resulting document. * The "old" set rules about the content of attributes (as user changes * are recorded here and not in the new set). + * * @return document with merged outputs as described. */ protected Document write() { @@ -180,7 +182,7 @@ if (newMF.getPosition() == oldMF.getPosition()) { conflicts = true; logger.debug("Positional conflict while merging " + - "facets, pushing newest facet 1 up ("+newMF.getPosition()+")"); + "facets, pushing newest facet 1 up (" + newMF.getPosition() + ")"); newMF.setPosition(newMF.getPosition() + 1); break; } diff -r 2fe270661b20 -r b503d92dd709 flys-artifacts/src/main/java/de/intevation/flys/collections/FLYSArtifactCollection.java --- a/flys-artifacts/src/main/java/de/intevation/flys/collections/FLYSArtifactCollection.java Fri Oct 28 09:08:48 2011 +0000 +++ b/flys-artifacts/src/main/java/de/intevation/flys/collections/FLYSArtifactCollection.java Fri Oct 28 09:22:34 2011 +0000 @@ -58,7 +58,9 @@ public static final String XPATH_OUT_TYPE = "/art:action/@art:type"; - public static final String XPATH_MASTER_UUID = "/art:artifact-collection/art:artifact/@art:uuid"; + /** Xpath to master artifacts uuid. */ + public static final String XPATH_MASTER_UUID = + "/art:artifact-collection/art:artifact/@art:uuid"; public static final String XPATH_LOADED_RECOMMENDATIONS = "/art:attribute/art:loaded-recommendations"; @@ -197,13 +199,11 @@ log.info("-> Output subtype = " + subtype); OutGenerator generator = null; - if (type != null && type.length() > 0) { - if (type.indexOf("chartinfo") > 0) { - generator = getOutGenerator(context, type, subtype); - } - else { - generator = getOutGenerator(context, name, subtype); - } + if (type != null + && type.length() > 0 + && type.indexOf("chartinfo") > 0) + { + generator = getOutGenerator(context, type, subtype); } else { generator = getOutGenerator(context, name, subtype); @@ -222,17 +222,16 @@ try{ ArtifactDatabase db = context.getDatabase(); CallMeta callMeta = context.getMeta(); - Document document = - db.getCollectionsMasterArtifact(identifier(), callMeta); - - //log.debug(XMLUtils.toString(document)); + Document document = db.getCollectionsMasterArtifact( + identifier(), callMeta); String masterUUID = XMLUtils.xpathString( - document, XPATH_MASTER_UUID, ArtifactNamespaceContext.INSTANCE); + document, XPATH_MASTER_UUID, ArtifactNamespaceContext.INSTANCE); log.debug("Will set master Artifact to uuid: " + masterUUID); generator.setMasterArtifact(getArtifact(masterUUID, context)); - } catch (ArtifactDatabaseException adb) { + } + catch (ArtifactDatabaseException adb) { log.error(adb, adb); } @@ -357,7 +356,8 @@ /** - * Returns the attribute for a specific output type. + * Returns the "attribute" (part of description document) for a specific + * output type. * * @param output The name of the desired output type. *