# HG changeset patch # User Sascha L. Teichmann # Date 1342709956 0 # Node ID 1bb6fb621167fc3f8e79e31e9a18f2606d7f6c16 # Parent 4c4d88c0af6ae934c46511fde6e661e425e669b3 FixA: Added stub for the "Ausgelagerte Wasserspiegellagen" calculation. flys-artifacts/trunk@5067 c6561f87-3c4e-4783-a992-168aeb5c3f6f diff -r 4c4d88c0af6a -r 1bb6fb621167 flys-artifacts/ChangeLog --- a/flys-artifacts/ChangeLog Thu Jul 19 14:27:20 2012 +0000 +++ b/flys-artifacts/ChangeLog Thu Jul 19 14:59:16 2012 +0000 @@ -1,3 +1,18 @@ +2012-07-19 Sascha L. Teichmann + + * src/main/java/de/intevation/flys/artifacts/model/fixings/FixRealizingCalculation.java: + New. Stub for 'Ausgelagerte Wasserspiegellagen' calculation. + + * src/main/java/de/intevation/flys/artifacts/access/FixRealizingAccess.java: + New. Stub for accessing the artifact to extract the relevant parameters + for the 'ausgelagerte Wasserspiegellagen' calculation. + + * src/main/java/de/intevation/flys/artifacts/states/fixation/FixRealizingCompute.java: + Call the calculation if the state is reached. + + * src/main/java/de/intevation/flys/artifacts/states/DefaultState.java: + Removed trailing whitespace. + 2012-07-19 Sascha L. Teichmann * src/main/java/de/intevation/flys/artifacts/states/fixation/FixationVolmerCompute.java: diff -r 4c4d88c0af6a -r 1bb6fb621167 flys-artifacts/src/main/java/de/intevation/flys/artifacts/access/FixRealizingAccess.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/access/FixRealizingAccess.java Thu Jul 19 14:59:16 2012 +0000 @@ -0,0 +1,19 @@ +package de.intevation.flys.artifacts.access; + +import de.intevation.flys.artifacts.FLYSArtifact; + +import org.apache.log4j.Logger; + +public class FixRealizingAccess +extends Access +{ + private static Logger log = Logger.getLogger(FixRealizingAccess.class); + + public FixRealizingAccess() { + } + + public FixRealizingAccess(FLYSArtifact artifact) { + super(artifact); + } +} +// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : diff -r 4c4d88c0af6a -r 1bb6fb621167 flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/fixings/FixRealizingCalculation.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/fixings/FixRealizingCalculation.java Thu Jul 19 14:59:16 2012 +0000 @@ -0,0 +1,28 @@ +package de.intevation.flys.artifacts.model.fixings; + +import de.intevation.flys.artifacts.access.FixRealizingAccess; + +import de.intevation.flys.artifacts.model.Calculation; +import de.intevation.flys.artifacts.model.CalculationResult; + +import org.apache.log4j.Logger; + +public class FixRealizingCalculation +extends Calculation +{ + private static Logger log = + Logger.getLogger(FixRealizingCalculation.class); + + public FixRealizingCalculation() { + } + + public FixRealizingCalculation(FixRealizingAccess access) { + // TODO: Implement me! + } + + public CalculationResult calculate() { + // TODO: Implement me! + return null; + } +} +// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : diff -r 4c4d88c0af6a -r 1bb6fb621167 flys-artifacts/src/main/java/de/intevation/flys/artifacts/states/DefaultState.java --- a/flys-artifacts/src/main/java/de/intevation/flys/artifacts/states/DefaultState.java Thu Jul 19 14:27:20 2012 +0000 +++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/states/DefaultState.java Thu Jul 19 14:59:16 2012 +0000 @@ -198,7 +198,7 @@ /** * This method returns the default value and description for data. * Note, that this method returns the defaults only if USE_DEFAULTS - * is set; otherwise, null is returned. + * is set; otherwise, null is returned. * @param context The CallContext used for i18n. * @param data The data objects that the defaults are for. * @return a String[] with [default value, default label]. diff -r 4c4d88c0af6a -r 1bb6fb621167 flys-artifacts/src/main/java/de/intevation/flys/artifacts/states/fixation/FixRealizingCompute.java --- a/flys-artifacts/src/main/java/de/intevation/flys/artifacts/states/fixation/FixRealizingCompute.java Thu Jul 19 14:27:20 2012 +0000 +++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/states/fixation/FixRealizingCompute.java Thu Jul 19 14:59:16 2012 +0000 @@ -1,9 +1,23 @@ package de.intevation.flys.artifacts.states.fixation; -import org.apache.log4j.Logger; +import de.intevation.artifactdatabase.state.Facet; + +import de.intevation.artifacts.CallContext; + +import de.intevation.flys.artifacts.FLYSArtifact; + +import de.intevation.flys.artifacts.access.FixRealizingAccess; + +import de.intevation.flys.artifacts.model.CalculationResult; +import de.intevation.flys.artifacts.model.ReportFacet; + +import de.intevation.flys.artifacts.model.fixings.FixRealizingCalculation; import de.intevation.flys.artifacts.states.DefaultState; +import java.util.List; + +import org.apache.log4j.Logger; /** * @author Raimund Renkert @@ -11,13 +25,48 @@ public class FixRealizingCompute extends DefaultState { /** The logger used in this class. */ - private static Logger logger = Logger.getLogger(FixRealizingCompute.class); - + private static Logger log = Logger.getLogger(FixRealizingCompute.class); /** * The default constructor that initializes an empty State object. */ public FixRealizingCompute() { } + + @Override + public Object computeAdvance( + FLYSArtifact artifact, + String hash, + CallContext context, + List facets, + Object old + ) { + log.debug("FixRealizingCompute.computeAdvance"); + + CalculationResult res; + + FixRealizingAccess access = + new FixRealizingAccess(artifact); + + if (old instanceof CalculationResult) { + res = (CalculationResult)old; + } + else { + FixRealizingCalculation calc = new FixRealizingCalculation(access); + res = calc.calculate(); + } + + if (facets == null) { + return res; + } + + if (res.getReport().hasProblems()) { + facets.add(new ReportFacet(ComputeType.ADVANCE, hash, id)); + } + + // TODO: Added facets + + return res; + } } // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf-8 :