Examples of AttributeTypeInfoDTO


Examples of org.vfny.geoserver.global.dto.AttributeTypeInfoDTO

                    if (featureTypeDTO.getSchemaAttributes() != null) {
                        for (Iterator a = featureTypeDTO.getSchemaAttributes()
                                                        .iterator();
                                a.hasNext();) {
                            AttributeTypeInfoDTO attribDTO = (AttributeTypeInfoDTO) a
                                .next();
                            String attributeName = attribDTO.getName();

                            if (!attributeNames.contains(attributeName)) {
                                if (ATTRIBUTENames.contains(
                                            attributeName.toUpperCase())) {
                                    LOGGER.severe("FeatureTypeInfo " + key
View Full Code Here

Examples of org.vfny.geoserver.global.dto.AttributeTypeInfoDTO

    public void setType(String type) {
        this.type = type;
    }
   
    public AttributeTypeInfoDTO toDTO(){
      AttributeTypeInfoDTO dto = new AttributeTypeInfoDTO();
      dto.setNillable(nillable);
      dto.setName(name);
      dto.setMaxOccurs(maxOccurs);
      dto.setMinOccurs(minOccurs);
      if(type!=TYPE_FRAGMENT){
        dto.setComplex(false);
        dto.setType(type);
      }else{
        dto.setComplex(true);
        dto.setType(fragment);
      }
      return dto;
    }
View Full Code Here

Examples of org.vfny.geoserver.global.dto.AttributeTypeInfoDTO

        fragment = config.getFragment();
       
        attributeType = attribute;
    }  
    public AttributeTypeInfoDTO toDTO(){
        AttributeTypeInfoDTO dto = new AttributeTypeInfoDTO();
        dto.setName( name );
        dto.setNillable( nillable );
        dto.setMinOccurs( Integer.parseInt( minOccurs ) );
        dto.setMaxOccurs( Integer.parseInt( maxOccurs ) );
       
        if( AttributeTypeInfoConfig.TYPE_FRAGMENT.equals(type) ){
            dto.setComplex( true );
            dto.setType( fragment );
        }
        else {
            dto.setComplex( false );
            dto.setType( type );                       
        }       
        return dto;       
    }
View Full Code Here

Examples of org.vfny.geoserver.global.dto.AttributeTypeInfoDTO

        String attributeName) {
        AttributeTypeInfo info = null;

        if (schema != null) {
            for (Iterator i = schema.iterator(); i.hasNext();) {
                AttributeTypeInfoDTO dto = (AttributeTypeInfoDTO) i.next();
                info = new AttributeTypeInfo(dto);
            }

            DataStore dataStore = data.getDataStoreInfo(dataStoreId)
                                      .getDataStore();
View Full Code Here

Examples of org.vfny.geoserver.global.dto.AttributeTypeInfoDTO

    public Object getMetaData(String key) {
        return meta.get(key);
    }
   
    Object toDTO(){
      AttributeTypeInfoDTO dto = new AttributeTypeInfoDTO();
      dto.setComplex(isComplex);
      dto.setMaxOccurs(maxOccurs);
      dto.setMinOccurs(minOccurs);
      dto.setName(name);
      dto.setNillable(nillable);
      dto.setType(typeName);
    return dto;
    }
View Full Code Here

Examples of org.vfny.geoserver.global.dto.AttributeTypeInfoDTO

        cw.openTag("xs:extension", m);
        cw.openTag("xs:sequence");

        for (int i = 0; i < fs.getSchemaAttributes().size(); i++) {
            AttributeTypeInfoDTO ati = (AttributeTypeInfoDTO) fs.getSchemaAttributes()
                                                                .get(i);
            m = new HashMap();
            m.put("nillable", "" + ati.isNillable());
            m.put("minOccurs", "" + ati.getMinOccurs());
            m.put("maxOccurs", "" + ati.getMaxOccurs());

            NameSpaceTranslator nst1 = NameSpaceTranslatorFactory.getInstance()
                                                                 .getNameSpaceTranslator("xs");
            NameSpaceTranslator nst2 = NameSpaceTranslatorFactory.getInstance()
                                                                 .getNameSpaceTranslator("gml");

            if (!ati.isComplex()) {
                if (ati.getName() == ati.getType()) {
                    String r = "";
                    NameSpaceElement nse = nst1.getElement(ati.getType());

                    if (nse == null) {
                        nse = nst2.getElement(ati.getType());
                    }

                    r = nse.getQualifiedTypeRefName();
                    m.put("ref", r);
                } else {
                    m.put("name", ati.getName());

                    String r = "";
                    NameSpaceElement nse = nst1.getElement(ati.getType());

                    if (nse == null) {
                        nse = nst2.getElement(ati.getType());
                    }

                    r = nse.getQualifiedTypeRefName();

                    m.put("type", r);
                }

                cw.attrTag("xs:element", m);
            } else {
                m.put("name", ati.getName());
                cw.openTag("xs:element", m);
                cw.writeln(ati.getType());
                cw.closeTag("xs:element");
            }
        }

        cw.closeTag("xs:sequence");
View Full Code Here

Examples of org.vfny.geoserver.global.dto.AttributeTypeInfoDTO

        for (int i = 0; i < nl.getLength(); i++) {
            // one element now
            elem = (Element) nl.item(i);

            AttributeTypeInfoDTO ati = new AttributeTypeInfoDTO();
            String name = ReaderUtils.getAttribute(elem, "name", false);
            String ref = ReaderUtils.getAttribute(elem, "ref", false);
            String type = ReaderUtils.getAttribute(elem, "type", false);

            NameSpaceTranslator nst1 = NameSpaceTranslatorFactory.getInstance()
                                                                 .getNameSpaceTranslator("xs");
            NameSpaceTranslator nst2 = NameSpaceTranslatorFactory.getInstance()
                                                                 .getNameSpaceTranslator("gml");

            if ((ref != null) && (ref != "")) {
                ati.setComplex(false);
                nse = nst1.getElement(ref);

                if (nse == null) {
                    nse = nst2.getElement(ref);
                }

                String tmp = nse.getTypeRefName();

                //tmp = Character.toLowerCase(tmp.charAt(0)) + tmp.substring(1);
                ati.setType(tmp);
                ati.setName(tmp);
            } else {
                ati.setName(name);

                if ((type != null) && (type != "")) {
                    nse = nst1.getElement(type);

                    if (nse == null) {
                        nse = nst2.getElement(type);
                    }

                    String tmp = nse.getTypeRefName();

                    ati.setType(tmp);
                    ati.setComplex(false);
                } else {
                    Element tmp = ReaderUtils.getFirstChildElement(elem);
                    OutputFormat format = new OutputFormat(tmp.getOwnerDocument());
                    format.setLineSeparator(LineSeparator.Windows);
                    format.setIndenting(true);
                    format.setLineWidth(0);
                    format.setPreserveSpace(true);

                    StringWriter sw = new StringWriter();
                    XMLSerializer serializer = new XMLSerializer(sw, format);

                    try {
                        serializer.asDOMSerializer();
                        serializer.serialize(tmp);
                    } catch (IOException e) {
                        throw new ConfigurationException(e);
                    }

                    ati.setType(elem.toString());
                    ati.setComplex(true);
                }
            }

            ati.setNillable(ReaderUtils.getBooleanAttribute(elem, "nillable",
                    false, true));
            ati.setMaxOccurs(ReaderUtils.getIntAttribute(elem, "maxOccurs",
                    false, 1));
            ati.setMinOccurs(ReaderUtils.getIntAttribute(elem, "minOccurs",
                    false, 1));
            list.add(ati);
        }

        featureTypeInfoDTO.setSchemaAttributes(list);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.