view flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/ManagedFacetAdapter.java @ 986:70545233f8ee

Datacage: Add users at initial scan. flys-artifacts/trunk@2418 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Sascha L. Teichmann <sascha.teichmann@intevation.de>
date Thu, 28 Jul 2011 15:07:20 +0000
parents 59ae2a823e73
children b1b0a0b61845
line wrap: on
line source
package de.intevation.flys.artifacts.model;

import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.Node;

import de.intevation.artifacts.ArtifactNamespaceContext;

import de.intevation.artifactdatabase.state.Facet;

import de.intevation.artifacts.common.utils.XMLUtils.ElementCreator;


public class ManagedFacetAdapter extends ManagedFacet {

    protected Facet facet;


    public ManagedFacetAdapter(Facet facet, String uuid, int pos, int active) {
        super(
            facet.getName(),
            facet.getIndex(),
            facet.getDescription(),
            uuid,
            pos,
            active);

        this.facet = facet;
    }


    @Override
    public Node toXML(Document doc) {
        ElementCreator ec = new ElementCreator(
            doc,
            ArtifactNamespaceContext.NAMESPACE_URI,
            ArtifactNamespaceContext.NAMESPACE_PREFIX);

        Element e = (Element) facet.toXML(doc);
        ec.addAttr(e, "artifact", getArtifact(), true);
        ec.addAttr(e, "facet", getName(), true);
        ec.addAttr(e, "pos", String.valueOf(getPosition()), true);
        ec.addAttr(e, "active", String.valueOf(getActive()), true);

        return e;
    }
}

http://dive4elements.wald.intevation.org