test_class.file: geoserver/webapp/api-composer/src/test/java/com/boundlessgeo/geoserver/api/controllers/IOTest.java
test_class.identifier: IOTest
test_case.body: @Test
      public void TestSchema() {
          SimpleFeatureTypeBuilder builder = new SimpleFeatureTypeBuilder();
          builder.setName("test_schema");
          builder.setCRS(DefaultGeographicCRS.WGS84);
          
          builder.add("the_geom", Point.class);
          builder.add("other_geom", Point.class);
          builder.setDefaultGeometry("other_geom");
          builder.length(15).add("name", String.class);
          
          final SimpleFeatureType type = builder.buildFeatureType();
          
          JSONObj schema = IO.schema(new JSONObj(), type, false);
          assertEquals("test_schema", schema.get("name"));
          assertEquals("other_geom", schema.get("defaultGeometry"));
      }
test_case.class_method_signature: IOTest.TestSchema()
test_case.full_signature: @Test public void TestSchema()
test_case.identifier: TestSchema
test_case.invocations: setName setCRS add add setDefaultGeometry add length buildFeatureType schema assertEquals get assertEquals get
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void TestSchema()
focal_class.declarator: DATE_FORMAT = "yyyy-MM-dd'T'HH:mm:ssXXX"
focal_class.modifier: static final
focal_class.original_string: static final String DATE_FORMAT = "yyyy-MM-dd'T'HH:mm:ssXXX";
focal_class.type: String
focal_class.var_name: DATE_FORMAT
focal_class.declarator: LOG = Logging.getLogger(IO.class)
focal_class.modifier: static
focal_class.original_string: static Logger LOG = Logging.getLogger(IO.class);
focal_class.type: Logger
focal_class.var_name: LOG
focal_class.declarator: PRETTY_TIME = new PrettyTime()
focal_class.modifier: private static
focal_class.original_string: private static PrettyTime PRETTY_TIME = new PrettyTime();
focal_class.type: PrettyTime
focal_class.var_name: PRETTY_TIME
focal_class.file: geoserver/webapp/api-composer/src/main/java/com/boundlessgeo/geoserver/api/controllers/IO.java
focal_class.identifier: IO
focal_class.class_method_signature: IO.proj(JSONObj obj, CoordinateReferenceSystem crs, String srs)
focal_class.full_signature: public static JSONObj proj(JSONObj obj, CoordinateReferenceSystem crs, String srs)
focal_class.identifier: proj
focal_class.modifiers: public static
focal_class.parameters: (JSONObj obj, CoordinateReferenceSystem crs, String srs)
focal_class.return: JSONObj
focal_class.signature: JSONObj proj(JSONObj obj, CoordinateReferenceSystem crs, String srs)
focal_class.class_method_signature: IO.bounds(JSONObj obj, org.opengis.geometry.Envelope bbox)
focal_class.full_signature: public static JSONObj bounds(JSONObj obj, org.opengis.geometry.Envelope bbox)
focal_class.identifier: bounds
focal_class.modifiers: public static
focal_class.parameters: (JSONObj obj, org.opengis.geometry.Envelope bbox)
focal_class.return: JSONObj
focal_class.signature: JSONObj bounds(JSONObj obj, org.opengis.geometry.Envelope bbox)
focal_class.class_method_signature: IO.bounds(JSONObj obj)
focal_class.full_signature: public static Envelope bounds(JSONObj obj)
focal_class.identifier: bounds
focal_class.modifiers: public static
focal_class.parameters: (JSONObj obj)
focal_class.return: Envelope
focal_class.signature: Envelope bounds(JSONObj obj)
focal_class.class_method_signature: IO.crs(JSONObj obj)
focal_class.full_signature: public static CoordinateReferenceSystem crs(JSONObj obj)
focal_class.identifier: crs
focal_class.modifiers: public static
focal_class.parameters: (JSONObj obj)
focal_class.return: CoordinateReferenceSystem
focal_class.signature: CoordinateReferenceSystem crs(JSONObj obj)
focal_class.class_method_signature: IO.srs(JSONObj obj)
focal_class.full_signature: public static String srs(JSONObj obj)
focal_class.identifier: srs
focal_class.modifiers: public static
focal_class.parameters: (JSONObj obj)
focal_class.return: String
focal_class.signature: String srs(JSONObj obj)
focal_class.class_method_signature: IO.workspace(JSONObj obj, WorkspaceInfo workspace, NamespaceInfo namespace, boolean isDefault)
focal_class.full_signature: public static JSONObj workspace(JSONObj obj, WorkspaceInfo workspace, NamespaceInfo namespace, boolean isDefault)
focal_class.identifier: workspace
focal_class.modifiers: public static
focal_class.parameters: (JSONObj obj, WorkspaceInfo workspace, NamespaceInfo namespace, boolean isDefault)
focal_class.return: JSONObj
focal_class.signature: JSONObj workspace(JSONObj obj, WorkspaceInfo workspace, NamespaceInfo namespace, boolean isDefault)
focal_class.class_method_signature: IO.title(LayerInfo layer)
focal_class.full_signature: static Object title(LayerInfo layer)
focal_class.identifier: title
focal_class.modifiers: static
focal_class.parameters: (LayerInfo layer)
focal_class.return: Object
focal_class.signature: Object title(LayerInfo layer)
focal_class.class_method_signature: IO.description(LayerInfo layer)
focal_class.full_signature: static Object description(LayerInfo layer)
focal_class.identifier: description
focal_class.modifiers: static
focal_class.parameters: (LayerInfo layer)
focal_class.return: Object
focal_class.signature: Object description(LayerInfo layer)
focal_class.class_method_signature: IO.layer(JSONObj json, LayerInfo info, HttpServletRequest req)
focal_class.full_signature: public static JSONObj layer(JSONObj json, LayerInfo info, HttpServletRequest req)
focal_class.identifier: layer
focal_class.modifiers: public static
focal_class.parameters: (JSONObj json, LayerInfo info, HttpServletRequest req)
focal_class.return: JSONObj
focal_class.signature: JSONObj layer(JSONObj json, LayerInfo info, HttpServletRequest req)
focal_class.class_method_signature: IO.layerDetails(JSONObj obj, PublishedInfo layer, HttpServletRequest req)
focal_class.full_signature: public static JSONObj layerDetails(JSONObj obj, PublishedInfo layer, HttpServletRequest req)
focal_class.identifier: layerDetails
focal_class.modifiers: public static
focal_class.parameters: (JSONObj obj, PublishedInfo layer, HttpServletRequest req)
focal_class.return: JSONObj
focal_class.signature: JSONObj layerDetails(JSONObj obj, PublishedInfo layer, HttpServletRequest req)
focal_class.class_method_signature: IO.layerDetails(JSONObj obj, LayerGroupInfo group, HttpServletRequest req)
focal_class.full_signature: public static JSONObj layerDetails(JSONObj obj, LayerGroupInfo group, HttpServletRequest req)
focal_class.identifier: layerDetails
focal_class.modifiers: public static
focal_class.parameters: (JSONObj obj, LayerGroupInfo group, HttpServletRequest req)
focal_class.return: JSONObj
focal_class.signature: JSONObj layerDetails(JSONObj obj, LayerGroupInfo group, HttpServletRequest req)
focal_class.class_method_signature: IO.layerDetails(JSONObj obj, LayerInfo layer, HttpServletRequest req)
focal_class.full_signature: @SuppressWarnings("unchecked") public static JSONObj layerDetails(JSONObj obj, LayerInfo layer, HttpServletRequest req)
focal_class.identifier: layerDetails
focal_class.modifiers: @SuppressWarnings("unchecked") public static
focal_class.parameters: (JSONObj obj, LayerInfo layer, HttpServletRequest req)
focal_class.return: JSONObj
focal_class.signature: JSONObj layerDetails(JSONObj obj, LayerInfo layer, HttpServletRequest req)
focal_class.class_method_signature: IO.type(ResourceInfo r)
focal_class.full_signature: static String type(ResourceInfo r)
focal_class.identifier: type
focal_class.modifiers: static
focal_class.parameters: (ResourceInfo r)
focal_class.return: String
focal_class.signature: String type(ResourceInfo r)
focal_class.class_method_signature: IO.geometry(LayerInfo layer)
focal_class.full_signature: static String geometry(LayerInfo layer)
focal_class.identifier: geometry
focal_class.modifiers: static
focal_class.parameters: (LayerInfo layer)
focal_class.return: String
focal_class.signature: String geometry(LayerInfo layer)
focal_class.class_method_signature: IO.bbox( JSONObj bbox, LayerGroupInfo l )
focal_class.full_signature: public static JSONObj bbox( JSONObj bbox, LayerGroupInfo l )
focal_class.identifier: bbox
focal_class.modifiers: public static
focal_class.parameters: ( JSONObj bbox, LayerGroupInfo l )
focal_class.return: JSONObj
focal_class.signature: JSONObj bbox( JSONObj bbox, LayerGroupInfo l )
focal_class.class_method_signature: IO.bbox( JSONObj bbox, ResourceInfo r )
focal_class.full_signature: public static JSONObj bbox( JSONObj bbox, ResourceInfo r )
focal_class.identifier: bbox
focal_class.modifiers: public static
focal_class.parameters: ( JSONObj bbox, ResourceInfo r )
focal_class.return: JSONObj
focal_class.signature: JSONObj bbox( JSONObj bbox, ResourceInfo r )
focal_class.class_method_signature: IO.schema( JSONObj schema, FeatureType type, boolean details)
focal_class.full_signature: public static JSONObj schema( JSONObj schema, FeatureType type, boolean details)
focal_class.identifier: schema
focal_class.modifiers: public static
focal_class.parameters: ( JSONObj schema, FeatureType type, boolean details)
focal_class.return: JSONObj
focal_class.signature: JSONObj schema( JSONObj schema, FeatureType type, boolean details)
focal_class.class_method_signature: IO.feature( JSONArr arr, Feature feature)
focal_class.full_signature: public static JSONArr feature( JSONArr arr, Feature feature)
focal_class.identifier: feature
focal_class.modifiers: public static
focal_class.parameters: ( JSONArr arr, Feature feature)
focal_class.return: JSONArr
focal_class.signature: JSONArr feature( JSONArr arr, Feature feature)
focal_class.class_method_signature: IO.features( JSONArr arr, FeatureCollection<FeatureType, Feature> features)
focal_class.full_signature: public static JSONArr features( JSONArr arr, FeatureCollection<FeatureType, Feature> features)
focal_class.identifier: features
focal_class.modifiers: public static
focal_class.parameters: ( JSONArr arr, FeatureCollection<FeatureType, Feature> features)
focal_class.return: JSONArr
focal_class.signature: JSONArr features( JSONArr arr, FeatureCollection<FeatureType, Feature> features)
focal_class.class_method_signature: IO.schemaGrid( JSONObj schema, CoverageInfo info, boolean details )
focal_class.full_signature: public static JSONObj schemaGrid( JSONObj schema, CoverageInfo info, boolean details )
focal_class.identifier: schemaGrid
focal_class.modifiers: public static
focal_class.parameters: ( JSONObj schema, CoverageInfo info, boolean details )
focal_class.return: JSONObj
focal_class.signature: JSONObj schemaGrid( JSONObj schema, CoverageInfo info, boolean details )
focal_class.class_method_signature: IO.schemaGrid( JSONObj schema, CoordinateReferenceSystem crs, boolean details)
focal_class.full_signature: public static JSONObj schemaGrid( JSONObj schema, CoordinateReferenceSystem crs, boolean details)
focal_class.identifier: schemaGrid
focal_class.modifiers: public static
focal_class.parameters: ( JSONObj schema, CoordinateReferenceSystem crs, boolean details)
focal_class.return: JSONObj
focal_class.signature: JSONObj schemaGrid( JSONObj schema, CoordinateReferenceSystem crs, boolean details)
focal_class.class_method_signature: IO.store(JSONObj obj, StoreInfo store, HttpServletRequest req, GeoServer geoServer)
focal_class.full_signature: public static JSONObj store(JSONObj obj, StoreInfo store, HttpServletRequest req, GeoServer geoServer)
focal_class.identifier: store
focal_class.modifiers: public static
focal_class.parameters: (JSONObj obj, StoreInfo store, HttpServletRequest req, GeoServer geoServer)
focal_class.return: JSONObj
focal_class.signature: JSONObj store(JSONObj obj, StoreInfo store, HttpServletRequest req, GeoServer geoServer)
focal_class.class_method_signature: IO.storeDetails(JSONObj json, StoreInfo store, HttpServletRequest req, GeoServer geoServer)
focal_class.full_signature: public static JSONObj storeDetails(JSONObj json, StoreInfo store, HttpServletRequest req, GeoServer geoServer)
focal_class.identifier: storeDetails
focal_class.modifiers: public static
focal_class.parameters: (JSONObj json, StoreInfo store, HttpServletRequest req, GeoServer geoServer)
focal_class.return: JSONObj
focal_class.signature: JSONObj storeDetails(JSONObj json, StoreInfo store, HttpServletRequest req, GeoServer geoServer)
focal_class.class_method_signature: IO.layerCount(StoreInfo store, GeoServer geoServer)
focal_class.full_signature: static int layerCount(StoreInfo store, GeoServer geoServer)
focal_class.identifier: layerCount
focal_class.modifiers: static
focal_class.parameters: (StoreInfo store, GeoServer geoServer)
focal_class.return: int
focal_class.signature: int layerCount(StoreInfo store, GeoServer geoServer)
focal_class.class_method_signature: IO.layers(ResourceInfo r, JSONArr list, GeoServer geoServer)
focal_class.full_signature: private static JSONArr layers(ResourceInfo r, JSONArr list, GeoServer geoServer)
focal_class.identifier: layers
focal_class.modifiers: private static
focal_class.parameters: (ResourceInfo r, JSONArr list, GeoServer geoServer)
focal_class.return: JSONArr
focal_class.signature: JSONArr layers(ResourceInfo r, JSONArr list, GeoServer geoServer)
focal_class.class_method_signature: IO.layers(StoreInfo store, JSONArr list, GeoServer geoServer)
focal_class.full_signature: private static JSONArr layers(StoreInfo store, JSONArr list, GeoServer geoServer)
focal_class.identifier: layers
focal_class.modifiers: private static
focal_class.parameters: (StoreInfo store, JSONArr list, GeoServer geoServer)
focal_class.return: JSONArr
focal_class.signature: JSONArr layers(StoreInfo store, JSONArr list, GeoServer geoServer)
focal_class.class_method_signature: IO.resources(StoreInfo store, JSONArr list, GeoServer geoServer)
focal_class.full_signature: @SuppressWarnings("unchecked") private static JSONArr resources(StoreInfo store, JSONArr list, GeoServer geoServer)
focal_class.identifier: resources
focal_class.modifiers: @SuppressWarnings("unchecked") private static
focal_class.parameters: (StoreInfo store, JSONArr list, GeoServer geoServer)
focal_class.return: JSONArr
focal_class.signature: JSONArr resources(StoreInfo store, JSONArr list, GeoServer geoServer)
focal_class.class_method_signature: IO.resource(JSONObj obj, StoreInfo store, String name, GeoServer geoServer)
focal_class.full_signature: public static JSONObj resource(JSONObj obj, StoreInfo store, String name, GeoServer geoServer)
focal_class.identifier: resource
focal_class.modifiers: public static
focal_class.parameters: (JSONObj obj, StoreInfo store, String name, GeoServer geoServer)
focal_class.return: JSONObj
focal_class.signature: JSONObj resource(JSONObj obj, StoreInfo store, String name, GeoServer geoServer)
focal_class.class_method_signature: IO.listResources(StoreInfo store)
focal_class.full_signature: private static Iterable<String> listResources(StoreInfo store)
focal_class.identifier: listResources
focal_class.modifiers: private static
focal_class.parameters: (StoreInfo store)
focal_class.return: Iterable<String>
focal_class.signature: Iterable<String> listResources(StoreInfo store)
focal_class.class_method_signature: IO.source(StoreInfo store, GeoServer geoServer)
focal_class.full_signature: private static String source(StoreInfo store, GeoServer geoServer)
focal_class.identifier: source
focal_class.modifiers: private static
focal_class.parameters: (StoreInfo store, GeoServer geoServer)
focal_class.return: String
focal_class.signature: String source(StoreInfo store, GeoServer geoServer)
focal_class.class_method_signature: IO.source(File file, GeoServerDataDirectory dataDir)
focal_class.full_signature: private static String source(File file, GeoServerDataDirectory dataDir)
focal_class.identifier: source
focal_class.modifiers: private static
focal_class.parameters: (File file, GeoServerDataDirectory dataDir)
focal_class.return: String
focal_class.signature: String source(File file, GeoServerDataDirectory dataDir)
focal_class.class_method_signature: IO.source(URL url, GeoServerDataDirectory dataDir)
focal_class.full_signature: private static String source(URL url, GeoServerDataDirectory dataDir)
focal_class.identifier: source
focal_class.modifiers: private static
focal_class.parameters: (URL url, GeoServerDataDirectory dataDir)
focal_class.return: String
focal_class.signature: String source(URL url, GeoServerDataDirectory dataDir)
focal_class.class_method_signature: IO.sourceURL(String url, GeoServerDataDirectory dataDir)
focal_class.full_signature: private static String sourceURL(String url, GeoServerDataDirectory dataDir)
focal_class.identifier: sourceURL
focal_class.modifiers: private static
focal_class.parameters: (String url, GeoServerDataDirectory dataDir)
focal_class.return: String
focal_class.signature: String sourceURL(String url, GeoServerDataDirectory dataDir)
focal_class.class_method_signature: IO.sourceFile(String file, GeoServerDataDirectory dataDir)
focal_class.full_signature: private static String sourceFile(String file, GeoServerDataDirectory dataDir)
focal_class.identifier: sourceFile
focal_class.modifiers: private static
focal_class.parameters: (String file, GeoServerDataDirectory dataDir)
focal_class.return: String
focal_class.signature: String sourceFile(String file, GeoServerDataDirectory dataDir)
focal_class.class_method_signature: IO.date(JSONObj obj, Date date)
focal_class.full_signature: static JSONObj date(JSONObj obj, Date date)
focal_class.identifier: date
focal_class.modifiers: static
focal_class.parameters: (JSONObj obj, Date date)
focal_class.return: JSONObj
focal_class.signature: JSONObj date(JSONObj obj, Date date)
focal_class.class_method_signature: IO.metadata(JSONObj obj, Info i)
focal_class.full_signature: static JSONObj metadata(JSONObj obj, Info i)
focal_class.identifier: metadata
focal_class.modifiers: static
focal_class.parameters: (JSONObj obj, Info i)
focal_class.return: JSONObj
focal_class.signature: JSONObj metadata(JSONObj obj, Info i)
focal_class.class_method_signature: IO.error(JSONObj json, Throwable error)
focal_class.full_signature: public static JSONObj error(JSONObj json, Throwable error)
focal_class.identifier: error
focal_class.modifiers: public static
focal_class.parameters: (JSONObj json, Throwable error)
focal_class.return: JSONObj
focal_class.signature: JSONObj error(JSONObj json, Throwable error)
focal_class.class_method_signature: IO.param(JSONObj json, Parameter<?> p)
focal_class.full_signature: public static JSONObj param(JSONObj json, Parameter<?> p)
focal_class.identifier: param
focal_class.modifiers: public static
focal_class.parameters: (JSONObj json, Parameter<?> p)
focal_class.return: JSONObj
focal_class.signature: JSONObj param(JSONObj json, Parameter<?> p)
focal_class.class_method_signature: IO.param(JSONObj json, Format g)
focal_class.full_signature: public static void param(JSONObj json, Format g)
focal_class.identifier: param
focal_class.modifiers: public static
focal_class.parameters: (JSONObj json, Format g)
focal_class.return: void
focal_class.signature: void param(JSONObj json, Format g)
focal_class.class_method_signature: IO.safeValue(Object value)
focal_class.full_signature: static private Object safeValue(Object value)
focal_class.identifier: safeValue
focal_class.modifiers: static private
focal_class.parameters: (Object value)
focal_class.return: Object
focal_class.signature: Object safeValue(Object value)
focal_class.class_method_signature: IO.url(HttpServletRequest req, String path, Object ... args)
focal_class.full_signature: public static Object url(HttpServletRequest req, String path, Object ... args)
focal_class.identifier: url
focal_class.modifiers: public static
focal_class.parameters: (HttpServletRequest req, String path, Object ... args)
focal_class.return: Object
focal_class.signature: Object url(HttpServletRequest req, String path, Object ... args)
focal_class.class_method_signature: IO.ref(JSONObj obj, Ref ref)
focal_class.full_signature: public static JSONObj ref(JSONObj obj, Ref ref)
focal_class.identifier: ref
focal_class.modifiers: public static
focal_class.parameters: (JSONObj obj, Ref ref)
focal_class.return: JSONObj
focal_class.signature: JSONObj ref(JSONObj obj, Ref ref)
focal_method.body: public static JSONObj schema( JSONObj schema, FeatureType type, boolean details){
          if( type != null ){
              schema.put("name", type.getName().getLocalPart() );
              schema.put("namespace", type.getName().getNamespaceURI() );
              schema.put("simple", type instanceof SimpleFeatureType );
              if (null != type.getGeometryDescriptor()) {
                  schema.put("defaultGeometry", type.getGeometryDescriptor().getName().getLocalPart());
              }
              JSONArr attributes = schema.putArray("attributes");
              for( PropertyDescriptor d : type.getDescriptors() ){
                  PropertyType t = d.getType();
                  final String NAME = d.getName().getLocalPart();
                  String kind;
                  if (d instanceof GeometryDescriptor){
                      kind = "geometry";
                  }
                  else if( d instanceof AttributeDescriptor){
                      kind = "attribute";
                  }
                  else if (d instanceof AssociationDescriptor){
                      kind = "association";
                  }
                  else {
                      kind = "property";
                  }
                  JSONObj property = attributes.addObject()
                      .put("name", NAME )
                      .put("property", kind )
                      .put("type", t.getBinding().getSimpleName() );
                  
                  if( d instanceof GeometryDescriptor){
                      GeometryDescriptor g = (GeometryDescriptor) d;
                      proj( property.putObject("proj"), g.getCoordinateReferenceSystem(), null );
                  }
  
                  if( details){
                      property
                          .put("namespace", d.getName().getNamespaceURI() )
                          .put("description", t.getDescription() )
                          .put("min-occurs",d.getMinOccurs() )
                          .put("max-occurs",d.getMaxOccurs() )
                          .put("nillable",d.isNillable());
                  
                      int length = FeatureTypes.getFieldLength(d);
                      if( length != FeatureTypes.ANY_LENGTH ){
                          property.put("length", length );
                      }
                      
                      if( d instanceof AttributeDescriptor){
                          AttributeDescriptor a = (AttributeDescriptor) d;
                          property.put("default-value", a.getDefaultValue() );
                      }
                      if( !t.getRestrictions().isEmpty() ){
                          JSONArr validate = property.putArray("validate");
                          for( Filter f : t.getRestrictions() ){
                              String cql;
                              try {
                                  Filter clean = (Filter) f.accept( new DuplicatingFilterVisitor(){
                                      public PropertyName visit(PropertyName e, Object extraData ){
                                          String n = e.getPropertyName();
                                          return getFactory(extraData).property(
                                                  ".".equals(n) ? NAME : n,
                                                  e.getNamespaceContext());
                                      }
                                  }, null );
                                  cql = ECQL.toCQL(clean);
                              }
                              catch (Throwable ignore ){
                                  ignore.printStackTrace();
                                  cql = f.toString();
                              }
                              validate.add( cql );
                          }                    
                      }
                  }
              }
          }
          return schema;
      }
focal_method.class_method_signature: IO.schema( JSONObj schema, FeatureType type, boolean details)
focal_method.full_signature: public static JSONObj schema( JSONObj schema, FeatureType type, boolean details)
focal_method.identifier: schema
focal_method.invocations: put getLocalPart getName put getNamespaceURI getName put getGeometryDescriptor put getLocalPart getName getGeometryDescriptor putArray getDescriptors getType getLocalPart getName put put put addObject getSimpleName getBinding proj putObject getCoordinateReferenceSystem put put put put put getNamespaceURI getName getDescription getMinOccurs getMaxOccurs isNillable getFieldLength put put getDefaultValue isEmpty getRestrictions putArray getRestrictions accept getPropertyName property getFactory equals getNamespaceContext toCQL printStackTrace toString add
focal_method.modifiers: public static
focal_method.parameters: ( JSONObj schema, FeatureType type, boolean details)
focal_method.return: JSONObj
focal_method.signature: JSONObj schema( JSONObj schema, FeatureType type, boolean details)