Mercurial > dive4elements > gnv-client
diff gnv-artifacts/src/main/java/de/intevation/gnv/transition/TransitionBase.java @ 118:5ebc059064a6
Adding Languagetransfer to the ArtifactDatabase to the GNV-Client
gnv-artifacts/trunk@181 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Tim Englich <tim.englich@intevation.de> |
---|---|
date | Mon, 05 Oct 2009 07:52:13 +0000 |
parents | ef157bd2fa92 |
children | 7fb9441dd8af |
line wrap: on
line diff
--- a/gnv-artifacts/src/main/java/de/intevation/gnv/transition/TransitionBase.java Fri Oct 02 14:24:47 2009 +0000 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/transition/TransitionBase.java Mon Oct 05 07:52:13 2009 +0000 @@ -11,7 +11,6 @@ import java.util.HashSet; import java.util.Iterator; import java.util.List; -import java.util.Locale; import java.util.Map; import java.util.Set; @@ -117,7 +116,7 @@ * @see de.intevation.gnv.transition.Transition#setup(org.w3c.dom.Node) */ public void setup(Node configuration) { - + log.debug("TransitionBase.setup"); this.id = Config.getStringXPath(configuration,"@id"); this.description = Config.getStringXPath(configuration,"@description"); @@ -254,6 +253,7 @@ } private Object getDescribeData(String name){ + log.debug("TransitionBase.getDescribeData"); if (this.descibeData != null){ Iterator<Object> it = this.descibeData.iterator(); while (it.hasNext()){ @@ -339,6 +339,7 @@ } private String prepareInputData4DateDBQuery(String value){ + log.debug("TransitionBase.prepareInputData4DateDBQuery"); if (value != null){ String[] values = value.split(","); String newValue = ""; @@ -355,6 +356,7 @@ return value; } private String prepareInputData4DBQuery(String value){ + log.debug("TransitionBase.prepareInputData4DBQuery"); if (value != null){ String[] values = value.split(","); String newValue = ""; @@ -375,6 +377,7 @@ * @param result */ protected void purifyResult(Collection<Result> result, String uuid) { + log.debug("TransitionBase.purifyResult"); if (this.descibeData == null){ this.descibeData = new ArrayList<Object>(); } @@ -392,8 +395,7 @@ * @see de.intevation.gnv.transition.Transition#describe(org.w3c.dom.Document, org.w3c.dom.Node, de.intevation.artifacts.CallMeta) */ public void describe(Document document, Node rootNode, CallMeta callMeta) { - - Locale locale = callMeta.getPreferredLocale(RessourceFactory.getInstance().getSupportedLocales()); + log.debug("TransitionBase.describe"); if(this.descibeData != null){ ArtifactXMLUtilities xmlutilities = new ArtifactXMLUtilities(); Iterator<Object> it = this.descibeData.iterator(); @@ -421,7 +423,7 @@ selectNode.setAttribute("ref", name); Element lableNode = xmlutilities.createXFormElement(document, "label"); - lableNode.setTextContent(RessourceFactory.getInstance().getRessource(locale, name, name)); + lableNode.setTextContent(RessourceFactory.getInstance().getRessource(callMeta.getLanguages(), name, name)); Element choiceNode = xmlutilities.createXFormElement(document, "choices"); Collection<KeyValueDescibeData> values = (Collection<KeyValueDescibeData>)o; @@ -470,7 +472,7 @@ Element inputMinNode = xmlutilities.createXFormElement(document, "input"); inputMinNode.setAttribute("ref", "minvalue"); Element inputMinLableNode = xmlutilities.createXFormElement(document, "label"); - inputMinLableNode.setTextContent(RessourceFactory.getInstance().getRessource(locale, "minvalue", "minvalue")); + inputMinLableNode.setTextContent(RessourceFactory.getInstance().getRessource(callMeta.getLanguages(), "minvalue", "minvalue")); inputMinNode.appendChild(inputMinLableNode); Element inputMinValueNode = xmlutilities.createXFormElement(document, "value"); @@ -480,7 +482,7 @@ Element inputMaxNode = xmlutilities.createXFormElement(document, "input"); inputMaxNode.setAttribute("ref", "maxvalue"); Element inputMaxLableNode = xmlutilities.createXFormElement(document, "label"); - inputMaxLableNode.setTextContent(RessourceFactory.getInstance().getRessource(locale, "maxvalue", "maxvalue")); + inputMaxLableNode.setTextContent(RessourceFactory.getInstance().getRessource(callMeta.getLanguages(), "maxvalue", "maxvalue")); inputMaxNode.appendChild(inputMaxLableNode); Element inputMaxValueNode = xmlutilities.createXFormElement(document, "value"); @@ -503,7 +505,7 @@ inputNode.setAttribute("ref", svdb.getName()); Element inputLableNode = xmlutilities.createXFormElement(document, "label"); - inputLableNode.setTextContent(RessourceFactory.getInstance().getRessource(locale, svdb.getName(), svdb.getName())); + inputLableNode.setTextContent(RessourceFactory.getInstance().getRessource(callMeta.getLanguages(), svdb.getName(), svdb.getName())); inputNode.appendChild(inputLableNode); Element inputValueNode = xmlutilities.createXFormElement(document, "value");