Mercurial > dive4elements > gnv-client
changeset 38:fccf90761825
Format Code to max 80 Chars per Row better Formatter choosen
gnv/trunk@174 c6561f87-3c4e-4783-a992-168aeb5c3f6f
line wrap: on
line diff
--- a/gnv/src/main/java/de/intevation/gnv/action/ArtifactDatabaseActionBase.java Fri Oct 02 08:55:23 2009 +0000 +++ b/gnv/src/main/java/de/intevation/gnv/action/ArtifactDatabaseActionBase.java Fri Oct 02 09:10:36 2009 +0000 @@ -42,8 +42,8 @@ */ @Override public ActionForward execute(ActionMapping mapping, ActionForm form, - HttpServletRequest request, HttpServletResponse response) - throws Exception { + HttpServletRequest request, + HttpServletResponse response) throws Exception { log.debug("ArtifactDatabaseActionBase.execute"); ActionForward forward = mapping.findForward(SUCCSESS_FORWARD_ID); return forward;
--- a/gnv/src/main/java/de/intevation/gnv/action/ChangeOptionsAction.java Fri Oct 02 08:55:23 2009 +0000 +++ b/gnv/src/main/java/de/intevation/gnv/action/ChangeOptionsAction.java Fri Oct 02 09:10:36 2009 +0000 @@ -45,8 +45,8 @@ @Override public ActionForward execute(ActionMapping mapping, ActionForm form, - HttpServletRequest request, HttpServletResponse response) - throws Exception { + HttpServletRequest request, + HttpServletResponse response) throws Exception { log.debug("NextArtifactStepAction.execute"); try { SessionModel sm = SessionModelFactory.getInstance() @@ -98,7 +98,7 @@ .getReachableStates().isEmpty())); if (ad.getReachableStates() != null - && !ad.getReachableStates().isEmpty()) { + && !ad.getReachableStates().isEmpty()) { } else { request.setAttribute("diagramm", true); }
--- a/gnv/src/main/java/de/intevation/gnv/action/DoExportAction.java Fri Oct 02 08:55:23 2009 +0000 +++ b/gnv/src/main/java/de/intevation/gnv/action/DoExportAction.java Fri Oct 02 09:10:36 2009 +0000 @@ -28,7 +28,8 @@ @Override protected void setHeaders(String target, String mimeType, - HttpServletResponse response, HttpServletRequest request) { + HttpServletResponse response, + HttpServletRequest request) { log.debug("DoExportAction.setHeaders"); try { super.setHeaders(target, mimeType, response, request); @@ -36,7 +37,7 @@ if (target.equalsIgnoreCase("chart")) { fileName = fileName - + mimeType.substring(mimeType.indexOf("/") + 1); + + mimeType.substring(mimeType.indexOf("/") + 1); } else if (target.equalsIgnoreCase("CSV")) { fileName = fileName + "csv"; } else { @@ -44,7 +45,7 @@ } log.debug("FileName for Export: " + fileName); response.setHeader("Content-Disposition", "attachment;filename=" - + fileName); + + fileName); } catch (Exception e) { log.error(e, e); }
--- a/gnv/src/main/java/de/intevation/gnv/action/DoOutputAction.java Fri Oct 02 08:55:23 2009 +0000 +++ b/gnv/src/main/java/de/intevation/gnv/action/DoOutputAction.java Fri Oct 02 09:10:36 2009 +0000 @@ -51,8 +51,8 @@ */ @Override public ActionForward execute(ActionMapping mapping, ActionForm form, - HttpServletRequest request, HttpServletResponse response) - throws Exception { + HttpServletRequest request, + HttpServletResponse response) throws Exception { log.debug("DoOutputAction.execute"); try { String target = request.getParameter("target"); @@ -99,7 +99,7 @@ log.error("Outputmode wird nicht unterstützt."); } else if (!outputMode.getMimeType().equals(mimeType)) { log.error("MimeType " + mimeType - + " wird nicht unterstützt."); + + " wird nicht unterstützt."); } // TODO FIXME: Fehlerbehandlung } @@ -114,7 +114,8 @@ } protected void setHeaders(String target, String mimeType, - HttpServletResponse response, HttpServletRequest request) { + HttpServletResponse response, + HttpServletRequest request) { response.setHeader("Content-Type", mimeType); }
--- a/gnv/src/main/java/de/intevation/gnv/action/FetchArtifactFactoriesAction.java Fri Oct 02 08:55:23 2009 +0000 +++ b/gnv/src/main/java/de/intevation/gnv/action/FetchArtifactFactoriesAction.java Fri Oct 02 09:10:36 2009 +0000 @@ -41,8 +41,8 @@ */ @Override public ActionForward execute(ActionMapping mapping, ActionForm form, - HttpServletRequest request, HttpServletResponse response) - throws Exception { + HttpServletRequest request, + HttpServletResponse response) throws Exception { log.debug("ArtifactDatabaseActionBase.execute"); try { Collection<ArtifactObject> artifactFactories = ArtifactDatabaseClientFactory
--- a/gnv/src/main/java/de/intevation/gnv/action/NextArtifactStepAction.java Fri Oct 02 08:55:23 2009 +0000 +++ b/gnv/src/main/java/de/intevation/gnv/action/NextArtifactStepAction.java Fri Oct 02 09:10:36 2009 +0000 @@ -53,8 +53,8 @@ */ @Override public ActionForward execute(ActionMapping mapping, ActionForm form, - HttpServletRequest request, HttpServletResponse response) - throws Exception { + HttpServletRequest request, + HttpServletResponse response) throws Exception { try { log.debug("NextArtifactStepAction.execute"); SessionModel sm = SessionModelFactory.getInstance() @@ -75,16 +75,16 @@ ArtifactDatabaseClient adc = ArtifactDatabaseClientFactory .getInstance().getArtifactDatabaseClient(); if (ad.getReachableStates() != null - && !ad.getReachableStates().isEmpty()) { + && !ad.getReachableStates().isEmpty()) { // TODO: Woher kommt der zu erreichende Status; String target = null; if (ad.getReachableStates().size() > 1) { target = request.getParameter("product"); // TODO HACK for - // Propducts every - // other Step has - // currently only - // one reachable - // state. + // Propducts every + // other Step has + // currently only + // one reachable + // state. } else { target = ad.getReachableStates().iterator().next(); }
--- a/gnv/src/main/java/de/intevation/gnv/action/SelectArtifactFactoryAction.java Fri Oct 02 08:55:23 2009 +0000 +++ b/gnv/src/main/java/de/intevation/gnv/action/SelectArtifactFactoryAction.java Fri Oct 02 09:10:36 2009 +0000 @@ -40,8 +40,8 @@ */ @Override public ActionForward execute(ActionMapping mapping, ActionForm form, - HttpServletRequest request, HttpServletResponse response) - throws Exception { + HttpServletRequest request, + HttpServletResponse response) throws Exception { log.debug("SelectArtifactFactoryAction.execute"); String selectedArtifactFactoryID = request .getParameter("artifactFactory");
--- a/gnv/src/main/java/de/intevation/gnv/action/sessionmodel/DefaultSessionModel.java Fri Oct 02 08:55:23 2009 +0000 +++ b/gnv/src/main/java/de/intevation/gnv/action/sessionmodel/DefaultSessionModel.java Fri Oct 02 09:10:36 2009 +0000 @@ -74,7 +74,7 @@ * @see de.intevation.gnv.action.sessionmodel.SessionModel#setArtifacteFactories(java.util.Collection) */ public void setArtifacteFactories( - Collection<ArtifactObject> artifactFactories) { + Collection<ArtifactObject> artifactFactories) { this.artifactFactories = artifactFactories; }
--- a/gnv/src/main/java/de/intevation/gnv/artifactdatabase/client/ArtifactDatabaseClient.java Fri Oct 02 08:55:23 2009 +0000 +++ b/gnv/src/main/java/de/intevation/gnv/artifactdatabase/client/ArtifactDatabaseClient.java Fri Oct 02 09:10:36 2009 +0000 @@ -29,7 +29,7 @@ * @throws ArtifactDatabaseClientException */ public Collection<ArtifactObject> getArtifactFactories() - throws ArtifactDatabaseClientException; + throws ArtifactDatabaseClientException; /** * @@ -38,7 +38,7 @@ * @throws ArtifactDatabaseClientException */ public ArtifactObject createNewArtifact(ArtifactObject artifactFactory) - throws ArtifactDatabaseClientException; + throws ArtifactDatabaseClientException; /** * @@ -47,8 +47,9 @@ * @throws ArtifactDatabaseClientException */ public ArtifactDescription getCurrentStepDescription( - ArtifactObject artifactFactory, ArtifactObject currentArtifact) - throws ArtifactDatabaseClientException; + ArtifactObject artifactFactory, + ArtifactObject currentArtifact) + throws ArtifactDatabaseClientException; /** * @@ -59,10 +60,12 @@ * @return * @throws ArtifactDatabaseClientException */ - public ArtifactDescription doNextStep(ArtifactObject artifactFactory, - ArtifactObject currentArtifact, String target, - Collection<InputParameter> inputParameter) - throws ArtifactDatabaseClientException; + public ArtifactDescription doNextStep( + ArtifactObject artifactFactory, + ArtifactObject currentArtifact, + String target, + Collection<InputParameter> inputParameter) + throws ArtifactDatabaseClientException; /** * @param artifactFactory @@ -72,9 +75,9 @@ * @throws ArtifactDatabaseClientException */ public void doFeed(ArtifactObject artifactFactory, - ArtifactObject currentArtifact, - Collection<InputParameter> inputParameter) - throws ArtifactDatabaseClientException; + ArtifactObject currentArtifact, + Collection<InputParameter> inputParameter) + throws ArtifactDatabaseClientException; /** * @@ -86,10 +89,10 @@ * @throws ArtifactDatabaseClientException */ public void doOutput(ArtifactObject artifactFactory, - ArtifactObject currentArtifact, OutputStream stream, - String targetName, String mimeType, - Collection<InputParameter> inputParameter) - throws ArtifactDatabaseClientException; + ArtifactObject currentArtifact, OutputStream stream, + String targetName, String mimeType, + Collection<InputParameter> inputParameter) + throws ArtifactDatabaseClientException; /** * @param artifactFactory @@ -98,6 +101,7 @@ * @throws ArtifactDatabaseClientException */ public Collection<ArtifactStatisticValue> calculateStatistics( - ArtifactObject artifactFactory, ArtifactObject currentArtifact) - throws ArtifactDatabaseClientException; + ArtifactObject artifactFactory, + ArtifactObject currentArtifact) + throws ArtifactDatabaseClientException; }
--- a/gnv/src/main/java/de/intevation/gnv/artifactdatabase/client/DefaultArtifactDatabaseClient.java Fri Oct 02 08:55:23 2009 +0000 +++ b/gnv/src/main/java/de/intevation/gnv/artifactdatabase/client/DefaultArtifactDatabaseClient.java Fri Oct 02 09:10:36 2009 +0000 @@ -83,7 +83,7 @@ * @see de.intevation.gnv.artifactdatabase.client.ArtifactDatabaseClient#getArtifactFactories() */ public Collection<ArtifactObject> getArtifactFactories() - throws ArtifactDatabaseClientException { + throws ArtifactDatabaseClientException { Collection<ArtifactObject> resultValues = null; if (!initialized) { this.initialize(); @@ -109,7 +109,7 @@ } private Collection<ArtifactObject> getArtifactFactories(Document document, - String server) { + String server) { XMLUtils xmlUtils = new XMLUtils(); NodeList artifactFactories = xmlUtils.getNodeSetXPath(document, "/result/factories/factory"); @@ -134,7 +134,7 @@ * @throws IOException */ private Document doGetRequest(String requestUrl) throws IOException, - ArtifactDatabaseClientException { + ArtifactDatabaseClientException { return this.doGetRequest(requestUrl, null); } @@ -142,7 +142,8 @@ * @throws IOException */ private Document doGetRequest(String requestUrl, Document requestBody) - throws IOException, ArtifactDatabaseClientException { + throws IOException, + ArtifactDatabaseClientException { XMLUtils xmlUtils = new XMLUtils(); Representation output = doGetRequestInternal(requestUrl, requestBody); Document document = xmlUtils.readDocument(output.getStream()); @@ -156,7 +157,7 @@ * @return */ private Representation doGetRequestInternal(String requestUrl, - Document requestBody) { + Document requestBody) { Client client = new Client(Protocol.HTTP); Request request = new Request(Method.GET, requestUrl); if (requestBody != null) { @@ -176,7 +177,7 @@ * @throws IOException */ private InputStream doPostRequest(String requestUrl, Document requestBody) - throws IOException { + throws IOException { log.debug("##################################################"); log.debug(new XMLUtils().writeDocument2String(requestBody)); log.debug("##################################################"); @@ -211,7 +212,7 @@ * @see de.intevation.gnv.artifactdatabase.client.ArtifactDatabaseClient#createNewArtifact(de.intevation.gnv.artifactdatabase.objects.ArtifactObject) */ public ArtifactObject createNewArtifact(ArtifactObject artifactFactory) - throws ArtifactDatabaseClientException { + throws ArtifactDatabaseClientException { try { Document request = this.createCreateRequestBody(artifactFactory @@ -269,8 +270,9 @@ * @throws IOException */ private Document doPostRequest(ArtifactObject artifactFactory, - Document request, String suburl) throws IOException, - ArtifactDatabaseClientException { + Document request, String suburl) + throws IOException, + ArtifactDatabaseClientException { XMLUtils xmlUtils = new XMLUtils(); String url = ((ArtifactFactory) artifactFactory).getDataBaseUrl(); InputStream is = this.doPostRequest(url + "/" + suburl, request); @@ -284,8 +286,9 @@ * de.intevation.gnv.artifactdatabase.objects.ArtifactObject) */ public ArtifactDescription getCurrentStepDescription( - ArtifactObject artifactFactory, ArtifactObject currentArtifact) - throws ArtifactDatabaseClientException { + ArtifactObject artifactFactory, + ArtifactObject currentArtifact) + throws ArtifactDatabaseClientException { try { String url = this.getArtifactUrl(artifactFactory, currentArtifact); Document result = this.doGetRequest(url); @@ -302,14 +305,15 @@ * @return */ private String getArtifactUrl(ArtifactObject artifactFactory, - ArtifactObject currentArtifact) { + ArtifactObject currentArtifact) { String url = ((ArtifactFactory) artifactFactory).getDataBaseUrl() - + "/artifact/" + currentArtifact.getId(); + + "/artifact/" + currentArtifact.getId(); return url; } private ArtifactDescription readDescription(Document document, - ArtifactObject artifact) throws ArtifactDatabaseClientException { + ArtifactObject artifact) + throws ArtifactDatabaseClientException { // Check if there was an Error or Exception reported from the // ArtifactDatabase this.check4ExceptionReport(document); @@ -403,10 +407,12 @@ * de.intevation.gnv.artifactdatabase.objects.ArtifactObject, * java.lang.String, java.util.Collection) */ - public ArtifactDescription doNextStep(ArtifactObject artifactFactory, - ArtifactObject currentArtifact, String target, - Collection<InputParameter> inputParameter) - throws ArtifactDatabaseClientException { + public ArtifactDescription doNextStep( + ArtifactObject artifactFactory, + ArtifactObject currentArtifact, + String target, + Collection<InputParameter> inputParameter) + throws ArtifactDatabaseClientException { try { // 1 Feed @@ -428,8 +434,9 @@ } } - private Document createFeedRequestBody(ArtifactObject currentArtifact, - Collection<InputParameter> inputParameter) { + private Document createFeedRequestBody( + ArtifactObject currentArtifact, + Collection<InputParameter> inputParameter) { Document document = new XMLUtils().newDocument(); Node rootNode = this.createRootNode(document); @@ -458,8 +465,8 @@ * @param rootNode */ private Node createParameterNodes( - Collection<InputParameter> inputParameter, Document document, - String nodeName) { + Collection<InputParameter> inputParameter, + Document document, String nodeName) { Element dataNode = this.createArtifactElement(document, nodeName); if (inputParameter != null) { @@ -484,7 +491,7 @@ } private Document createAdvanceRequestBody(ArtifactObject currentArtifact, - String target) { + String target) { Document document = new XMLUtils().newDocument(); Node rootNode = this.createRootNode(document); @@ -512,10 +519,10 @@ * java.util.Collection) */ public void doOutput(ArtifactObject artifactFactory, - ArtifactObject currentArtifact, OutputStream stream, - String targetName, String mimeType, - Collection<InputParameter> inputParameter) - throws ArtifactDatabaseClientException { + ArtifactObject currentArtifact, OutputStream stream, + String targetName, String mimeType, + Collection<InputParameter> inputParameter) + throws ArtifactDatabaseClientException { try { XMLUtils xmlUtils = new XMLUtils(); Document requestBody = this.createOutRequestBody(currentArtifact, @@ -523,7 +530,7 @@ String requestUrl = this.getArtifactUrl(artifactFactory, currentArtifact) - + "/" + targetName; + + "/" + targetName; InputStream is = this.doPostRequest(requestUrl, requestBody); byte[] b = new byte[4096]; @@ -537,9 +544,11 @@ } } - private Document createOutRequestBody(ArtifactObject currentArtifact, - String target, String mimeType, - Collection<InputParameter> inputParameter) { + private Document createOutRequestBody( + ArtifactObject currentArtifact, + String target, + String mimeType, + Collection<InputParameter> inputParameter) { Document document = new XMLUtils().newDocument(); Node rootNode = this.createRootNode(document); @@ -576,9 +585,9 @@ * java.util.Collection) */ public void doFeed(ArtifactObject artifactFactory, - ArtifactObject currentArtifact, - Collection<InputParameter> inputParameter) - throws ArtifactDatabaseClientException { + ArtifactObject currentArtifact, + Collection<InputParameter> inputParameter) + throws ArtifactDatabaseClientException { try { Document feedDocument = this.createFeedRequestBody(currentArtifact, @@ -595,7 +604,7 @@ } private void check4ExceptionReport(Document document) - throws ArtifactDatabaseClientException { + throws ArtifactDatabaseClientException { String message = new XMLUtils().getStringXPath(document, "/exceptionreport/exception"); @@ -606,8 +615,9 @@ } public Collection<ArtifactStatisticValue> calculateStatistics( - ArtifactObject artifactFactory, ArtifactObject currentArtifact) - throws ArtifactDatabaseClientException { + ArtifactObject artifactFactory, + ArtifactObject currentArtifact) + throws ArtifactDatabaseClientException { log.debug("DefaultArtifactDatabaseClient.calculateStatistics"); Collection<ArtifactStatisticValue> result; try { @@ -615,7 +625,7 @@ String targetName = "statistics"; String requestUrl = this.getArtifactUrl(artifactFactory, currentArtifact) - + "/" + targetName; + + "/" + targetName; Document requestBody = this.createOutRequestBody(currentArtifact, targetName, "text/xml", null); XMLUtils xmlUtils = new XMLUtils();
--- a/gnv/src/main/java/de/intevation/gnv/propertiesreader/PropertiesReaderFactory.java Fri Oct 02 08:55:23 2009 +0000 +++ b/gnv/src/main/java/de/intevation/gnv/propertiesreader/PropertiesReaderFactory.java Fri Oct 02 09:10:36 2009 +0000 @@ -73,7 +73,7 @@ (Map<String, String>) config); } else { log.error("No PropertiesReader for Instance " - + config.getClass().getName()); + + config.getClass().getName()); } }
--- a/gnv/src/main/java/de/intevation/gnv/servlet/GNVActionServlet.java Fri Oct 02 08:55:23 2009 +0000 +++ b/gnv/src/main/java/de/intevation/gnv/servlet/GNVActionServlet.java Fri Oct 02 09:10:36 2009 +0000 @@ -43,7 +43,7 @@ super.init(config); try { String path = config.getServletContext().getRealPath("/") - + config.getInitParameter(LOGGINIG_CONFIG_FILE_ID); + + config.getInitParameter(LOGGINIG_CONFIG_FILE_ID); PropertyConfigurator.configure(path); log = Logger.getLogger(GNVActionServlet.class); } catch (Exception e) {
--- a/gnv/src/main/java/de/intevation/gnv/util/XMLUtils.java Fri Oct 02 08:55:23 2009 +0000 +++ b/gnv/src/main/java/de/intevation/gnv/util/XMLUtils.java Fri Oct 02 09:10:36 2009 +0000 @@ -92,13 +92,14 @@ } public final String xpathString(Object root, String query, - NamespaceContext namespaceContext) { + NamespaceContext namespaceContext) { return (String) xpath(root, query, XPathConstants.STRING, namespaceContext); } public static final Object xpath(Object root, String query, - QName returnType, NamespaceContext namespaceContext) { + QName returnType, + NamespaceContext namespaceContext) { if (root == null) { return null; } @@ -200,8 +201,9 @@ * @throws TransformerException */ private String writeDOMSource2String(DOMSource source) - throws TransformerFactoryConfigurationError, - TransformerConfigurationException, TransformerException { + throws TransformerFactoryConfigurationError, + TransformerConfigurationException, + TransformerException { TransformerFactory transformerFactory = TransformerFactory .newInstance(); Transformer transformer = transformerFactory.newTransformer();
--- a/gnv/src/main/java/de/intevation/gnv/util/XSLTransformer.java Fri Oct 02 08:55:23 2009 +0000 +++ b/gnv/src/main/java/de/intevation/gnv/util/XSLTransformer.java Fri Oct 02 09:10:36 2009 +0000 @@ -38,7 +38,7 @@ } public String transform(Node toTransform, String encoding, - String templateFileName) { + String templateFileName) { String resultValue = null; try { XMLUtils xmlUtils = new XMLUtils();