Package org.vfny.geoserver.config

Examples of org.vfny.geoserver.config.DataConfig


    private TreeSet styles;
   
    public void reset(ActionMapping arg0, HttpServletRequest request) {
        super.reset(arg0, request);
        ServletContext context = getServlet().getServletContext();
        DataConfig config = ConfigRequests.getDataConfig(request);

        styles = new TreeSet();
        Iterator i = config.getStyles().values().iterator();
        boolean defaultSet = false;
        while(i.hasNext()){
          StyleConfig sc = (StyleConfig)i.next();
          if(sc.isDefault()){
            styles.add(sc.getId()+"*");
 
View Full Code Here


        super.reset(mapping, request);

        enabledChecked = false;

        ServletContext context = getServlet().getServletContext();
        DataConfig config = (DataConfig) context.getAttribute(DataConfig.CONFIG_KEY);

        namespaces = new TreeSet(config.getNameSpaces().keySet());

        DataStoreConfig dsConfig = Requests.getUserContainer(request).getDataStoreConfig();

        if (dsConfig == null) {
            // something is horribly wrong no DataStoreID selected!
            // The JSP needs to not include us if there is no
            // selected DataStore
            //
            throw new RuntimeException(
                "selectedDataStoreId required in Session");
        }

        dataStoreId = dsConfig.getId();
        description = dsConfig.getAbstract();
        enabled = dsConfig.isEnabled();
        namespaceId = dsConfig.getNameSpaceId();
        if (namespaceId.equals("")) {
          namespaceId = config.getDefaultNameSpace().getPrefix();
        }

        //Retrieve connection params
        DataStoreFactorySpi factory = dsConfig.getFactory();
        Param[] params = factory.getParametersInfo();
View Full Code Here

     */
    public void reset(ActionMapping mapping, HttpServletRequest request) {
        super.reset(mapping, request);

        ServletContext context = getServlet().getServletContext();
        DataConfig config = ConfigRequests.getDataConfig(request);

        UserContainer user = Requests.getUserContainer(request);

        // Richard can we please use this to store stuff?
        FeatureTypeConfig ftConfig; //= user.getFeatureTypeConfig();
View Full Code Here

    public ActionErrors validate(ActionMapping mapping,
        HttpServletRequest request) {
        ActionErrors errors = new ActionErrors();

        DataConfig data = ConfigRequests.getDataConfig(request);

        // check name exists in current DataStore?
        if ("".equals(latLonBoundingBoxMinX)
         || "".equals(latLonBoundingBoxMinY)
         || "".equals(latLonBoundingBoxMaxX)
View Full Code Here

public class DataFeatureTypesNewForm extends ActionForm {
    String selectedNewFeatureType;
    HttpServletRequest request;

    public SortedSet getNewFeatureTypes() {
        DataConfig dataConfig = (DataConfig) request.getSession()
                                                    .getServletContext()
                                                    .getAttribute(DataConfig.CONFIG_KEY);

        TreeSet out = new TreeSet(dataConfig.getFeatureTypeIdentifiers(getServlet().getServletContext()));
        out.removeAll(dataConfig.getFeaturesTypes().keySet());

        return out;
    }
View Full Code Here

 
    public void reset(ActionMapping arg0, HttpServletRequest request) {
      validationReport = null;
        super.reset(arg0, request);
        DataConfig config = ConfigRequests.getDataConfig( request );

        UserContainer user = Requests.getUserContainer( request );
        StyleConfig style = user.getStyle();
        fullyValidate = true; //default value
        fullyValidateChecked = false; //required by html:checkbox
        if (style == null) {
            // Should not happen (unless they bookmark)
            styleID = "";
            _default = config.getStyles().isEmpty();
            filename = "";
            sldFile= null ;
        }
        else {
            styleID = style.getId();
View Full Code Here

        this.request = request;

        defaultChecked = false;

        ServletContext context = getServlet().getServletContext();
        DataConfig config = (DataConfig) context.getAttribute(DataConfig.CONFIG_KEY);

        NameSpaceConfig nsConfig;

        nsConfig = Requests.getUserContainer(request).getNamespaceConfig();
View Full Code Here

        this.selectedFeatureTypeName = selectedFeatureTypeName;
    }

    public Set getTypeNames() {
        ServletContext context = getServlet().getServletContext();
        DataConfig config = (DataConfig) context.getAttribute(DataConfig.CONFIG_KEY);

        return config.getFeaturesTypes().keySet();
    }
View Full Code Here

        }
        selectedNamespace=user.getPrefix();
       
        // populate and sort available namespaces
        //
        DataConfig config = ConfigRequests.getDataConfig(request);       
        namespaces = new TreeSet(config.getNameSpaces().keySet());
        String def = config.getDefaultNameSpace().getPrefix();
        if (namespaces.contains(def)) {
          namespaces.remove(def);
          namespaces.add(def+"*");
        }
    }
View Full Code Here

        action = "";

        ServletContext context = getServlet().getServletContext();

        DataConfig config = ConfigRequests.getDataConfig(request);
        UserContainer user = Requests.getUserContainer(request);

        FeatureTypeConfig type = user.getFeatureTypeConfig();

        if (type == null) {
            System.out.println("Type is not there");

            // Not sure what to do, user must have bookmarked?
            return; // Action should redirect to Select screen?
        }

        this.dataStoreId = type.getDataStoreId();
        this.styleId = type.getDefaultStyle();

        description = type.getAbstract();

        Envelope bounds = type.getLatLongBBox();

        if ((bounds == null) || bounds.isNull()) {
            minX = "";
            minY = "";
            maxY = "";
            maxX = "";
        } else {
            minX = Double.toString(bounds.getMinX());
            minY = Double.toString(bounds.getMinY());
            maxX = Double.toString(bounds.getMaxX());
            maxY = Double.toString(bounds.getMaxY());
        }

        typeName = type.getName();
        setSRS(Integer.toString(type.getSRS())); // doing it this way also sets SRSWKT

       
        title = type.getTitle();

        System.out.println("rest based on schemaBase: " + type.getSchemaBase());

        // Generate ReadOnly list of Attributes
        //
        DataStoreConfig dataStoreConfig = config.getDataStore(dataStoreId);
        FeatureType featureType = null;

        try {
            DataStore dataStore = dataStoreConfig.findDataStore(getServlet()
                                                                    .getServletContext());
            featureType = dataStore.getSchema(typeName);
        } catch (IOException e) {
            // DataStore unavailable!
        }

        if (((type.getSchemaBase() == null)
                || "--".equals(type.getSchemaBase()))
                || (type.getSchemaAttributes() == null)) {
            //We are using the generated attributes
            this.schemaBase = "--";
            this.schemaName = typeName + "_Type";
            this.attributes = new LinkedList();

            // Generate ReadOnly list of Attributes
            //
            List generated = DataTransferObjectFactory.generateAttributes(featureType);
            this.attributes = attributesDisplayList(generated);
            addList = Collections.EMPTY_LIST;
        } else {
            this.schemaBase = type.getSchemaBase();
            this.schemaName = type.getSchemaName();
            this.attributes = new LinkedList();

            //
            // Need to add read only AttributeDisplay for each required attribute
            // defined by schemaBase
            //
            List schemaAttributes = DataTransferObjectFactory
                .generateRequiredAttributes(schemaBase);
            attributes.addAll(attributesDisplayList(schemaAttributes));
            attributes.addAll(attributesFormList(type.getSchemaAttributes(),
                    featureType));
            addList = new ArrayList(featureType.getAttributeCount());

            for (int i = 0; i < featureType.getAttributeCount(); i++) {
                String attributeName = featureType.getAttributeType(i).getName();

                if (lookUpAttribute(attributeName) == null) {
                    addList.add(attributeName);
                }
            }
        }

        StringBuffer buf = new StringBuffer();

        for (Iterator i = type.getKeywords().iterator(); i.hasNext();) {
            String keyword = (String) i.next();
            buf.append(keyword);

            if (i.hasNext()) {
                buf.append(" ");
            }
        }

        this.keywords = buf.toString();

        styles = new TreeSet();

        for (Iterator i = config.getStyles().values().iterator(); i.hasNext();) {
            StyleConfig sc = (StyleConfig) i.next();
            styles.add(sc.getId());

            if (sc.isDefault()) {
                if ((styleId == null) || styleId.equals("")) {
View Full Code Here

TOP

Related Classes of org.vfny.geoserver.config.DataConfig

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.