# HG changeset patch # User Ingo Weinzierl # Date 1336031723 0 # Node ID fd32dc33a24c8c8e529ef16642427fc170598b45 # Parent e08f1475facc33a5b614e8fdd298f6875f367c8d Added a method State.getHelpText(). artifacts/trunk@4338 c6561f87-3c4e-4783-a992-168aeb5c3f6f diff -r e08f1475facc -r fd32dc33a24c ChangeLog --- a/ChangeLog Wed May 02 16:42:24 2012 +0000 +++ b/ChangeLog Thu May 03 07:55:23 2012 +0000 @@ -1,3 +1,9 @@ +2012-05-03 Ingo Weinzierl + + * artifact-database/src/main/java/de/intevation/artifactdatabase/state/State.java, + artifact-database/src/main/java/de/intevation/artifactdatabase/state/AbstractState.java: + Defined and implemented a method getHelpText(). + 2012-05-02 Sascha L. Teichmann * artifacts-common/src/main/java/de/intevation/artifacts/common/utils/XSLTransformer.java: diff -r e08f1475facc -r fd32dc33a24c artifact-database/src/main/java/de/intevation/artifactdatabase/state/AbstractState.java --- a/artifact-database/src/main/java/de/intevation/artifactdatabase/state/AbstractState.java Wed May 02 16:42:24 2012 +0000 +++ b/artifact-database/src/main/java/de/intevation/artifactdatabase/state/AbstractState.java Thu May 03 07:55:23 2012 +0000 @@ -47,6 +47,9 @@ * the configuration. */ public static final String XPATH_DESCRIPTION = "@description"; + /** The XPath that points to the help text.*/ + public static final String XPATH_HELP_TEXT = "@helpText"; + /** The XPath to the output nodes of the state configuration. */ public static final String XPATH_OUTPUT_MODES = "outputmodes/outputmode"; @@ -65,6 +68,9 @@ /** The description of the state. */ protected String description; + /** The help text for this state.*/ + protected String helpText; + /** The data provided by this state. */ protected Map data; @@ -91,6 +97,12 @@ } + public AbstractState(String id, String description, String helpText) { + this(id, description); + this.helpText = helpText; + } + + /** * Returns the ID of the state. * @@ -132,6 +144,26 @@ /** + * Returns the help text of this state. + * + * @return the help text. + */ + public String getHelpText() { + return helpText; + } + + + /** + * Set the help text for this state. + * + * @param helpText The help text. + */ + public void setHelpText(String helpText) { + this.helpText = helpText; + } + + + /** * Returns the data of the state. * * @return the data of the state. @@ -197,6 +229,9 @@ description = (String) XMLUtils.xpath( config, XPATH_DESCRIPTION, XPathConstants.STRING); + helpText = (String) XMLUtils.xpath( + config, XPATH_HELP_TEXT, XPathConstants.STRING); + setupOutputs(config); } diff -r e08f1475facc -r fd32dc33a24c artifact-database/src/main/java/de/intevation/artifactdatabase/state/State.java --- a/artifact-database/src/main/java/de/intevation/artifactdatabase/state/State.java Wed May 02 16:42:24 2012 +0000 +++ b/artifact-database/src/main/java/de/intevation/artifactdatabase/state/State.java Thu May 03 07:55:23 2012 +0000 @@ -47,6 +47,14 @@ /** + * Returns the help text configured for the state. + * + * @return the help text configured for the state. + */ + public String getHelpText(); + + + /** * Returns the data provided by this state. * * @return the data stored in this state.