felix@2172: package de.intevation.flys.artifacts.states; felix@2172: felix@2172: import java.util.List; felix@2172: felix@2172: import org.apache.log4j.Logger; felix@2172: felix@2172: import de.intevation.artifacts.CallMeta; felix@2172: import de.intevation.artifacts.CallContext; felix@2172: felix@2172: import de.intevation.artifactdatabase.state.Facet; felix@2172: felix@2172: import de.intevation.flys.artifacts.FLYSArtifact; felix@2172: felix@2172: import de.intevation.flys.artifacts.model.ManualPointsFacet; felix@2172: import de.intevation.flys.artifacts.model.FacetTypes; felix@2172: felix@2172: import de.intevation.flys.artifacts.resources.Resources; felix@2172: felix@2172: felix@2172: /** felix@2172: * The only state for an ManualPointArtifact. felix@2172: */ felix@2172: public class ManualPointsSingleState felix@2172: extends DefaultState felix@2172: implements FacetTypes felix@2172: { felix@2172: /** Developer-centric description of facet. */ felix@2172: public static final String I18N_DESCRIPTION = "facet.longitudinal_section.manualpoint"; felix@2172: felix@2172: /** The logger that is used in this state. */ felix@2172: private static final Logger logger = Logger.getLogger(ManualPointsSingleState.class); felix@2172: felix@2172: felix@2172: /** felix@2172: * Add an ManualPointsFacet to list of Facets. felix@2172: * felix@2172: * @param artifact Ignored. felix@2172: * @param hash Ignored. felix@2172: * @param context Ignored. felix@2172: * @param meta CallMeta to be used for internationalization. felix@2172: * @param facets List to add ManualPointsFacet to. felix@2172: * felix@2172: * @return null. felix@2172: */ felix@2172: public Object compute( felix@2172: FLYSArtifact artifact, felix@2172: String hash, felix@2172: CallMeta meta, felix@2172: List facets felix@2172: ) { felix@2172: logger.debug("ManualPointsSingleState.computeInit()"); felix@2172: felix@2172: ManualPointsFacet facet = new ManualPointsFacet( felix@2172: 0, felix@2172: MANUALPOINTS, felix@2181: Resources.getMsg(meta, "manualpoints", "Manuel Points")); felix@2172: felix@2172: facets.add(facet); felix@2172: felix@2172: return null; felix@2172: } felix@2172: felix@2172: felix@2172: @Override felix@2172: public Object computeInit( felix@2172: FLYSArtifact artifact, felix@2172: String hash, felix@2172: Object context, felix@2172: CallMeta meta, felix@2172: List facets felix@2172: ) { felix@2172: return compute(artifact, hash, meta, facets); felix@2172: } felix@2172: felix@2172: felix@2172: @Override felix@2172: public Object computeFeed( felix@2172: FLYSArtifact artifact, felix@2172: String hash, felix@2172: CallContext context, felix@2172: List facets, felix@2172: Object old felix@2172: ) { felix@2172: return compute(artifact, hash, context.getMeta(), facets); felix@2172: } felix@2172: } felix@2172: // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf-8 :