/** * Configures the gml2 context. * * <p>The following classes are registered: * * <ul> * <li>{@link CoordinateArraySequenceFactory} under {@link CoordinateSequenceFactory} * <li>{@link GeometryFactory} * <li>{@link FeatureTypeCache} * <li>{@link DefaultFeatureCollections} * </ul> */ public void configureContext(MutablePicoContainer container) { super.configureContext(container); container.registerComponentInstance(new FeatureTypeCache()); container.registerComponentInstance( CoordinateSequenceFactory.class, CoordinateArraySequenceFactory.instance()); container.registerComponentImplementation(GeometryFactory.class); container.registerComponentImplementation(DefaultFeatureCollections.class); container.registerComponentInstance(srsSyntax); }
public static void initWfsConfiguration( Configuration config, GeoServer gs, FeatureTypeSchemaBuilder schemaBuilder) { MutablePicoContainer context = config.getContext(); // seed the cache with entries from the catalog FeatureTypeCache featureTypeCache = new FeatureTypeCache(); Collection featureTypes = gs.getCatalog().getFeatureTypes(); for (Iterator f = featureTypes.iterator(); f.hasNext(); ) { FeatureTypeInfo meta = (FeatureTypeInfo) f.next(); if (!meta.enabled()) { continue; } FeatureType featureType = null; try { featureType = meta.getFeatureType(); } catch (Exception e) { throw new RuntimeException(e); } featureTypeCache.put(featureType); } // add the wfs handler factory to handle feature elements context.registerComponentInstance(featureTypeCache); context.registerComponentInstance(new WFSHandlerFactory(gs.getCatalog(), schemaBuilder)); }
@Override public void put(FeatureType type) { // only add to cache if the feature type has been parsed from schema if (Boolean.TRUE.equals( type.getUserData().get(GML2ParsingUtils.PARSED_FROM_SCHEMA_KEY))) { super.put(type); } else { dynamicTypeFound = true; } } };
@Override public FeatureType get(Name name) { // first look up into the parent cache FeatureType featureType = super.get(name); if (featureType == null) { // look up in catalog FeatureTypeInfo meta = catalog.getFeatureTypeByName(name); if (meta != null) { try { featureType = meta.getFeatureType(); // throw into the cache put(featureType); } catch (Exception e) { LOGGER.log( Level.WARNING, "Could not load underlying feature type for type " + meta.getName(), e); } } } return featureType; } }
/** * Configures the gml3 context. * * <p>The following factories are registered: * * <ul> * <li>{@link CoordinateArraySequenceFactory} under {@link CoordinateSequenceFactory} * <li>{@link GeometryFactory} * </ul> */ public void configureContext(MutablePicoContainer container) { container.registerComponentInstance(Gml4wcsFactory.eINSTANCE); container.registerComponentInstance(new FeatureTypeCache()); container.registerComponentImplementation(FeaturePropertyExtractor.class); // factories container.registerComponentInstance( CoordinateSequenceFactory.class, CoordinateArraySequenceFactory.instance()); container.registerComponentImplementation(GeometryFactory.class); container.registerComponentImplementation(DefaultFeatureCollections.class); } }
/** * Configures the gml3 context. * * <p>The following factories are registered: * * <ul> * <li>{@link CoordinateArraySequenceFactory} under {@link CoordinateSequenceFactory} * <li>{@link GeometryFactory} * </ul> */ public void configureContext(MutablePicoContainer container) { super.configureContext(container); container.registerComponentInstance(new FeatureTypeCache()); container.registerComponentInstance(new XSDIdRegistry()); // factories container.registerComponentInstance( CoordinateSequenceFactory.class, CoordinateArraySequenceFactory.instance()); container.registerComponentInstance( geometryFactory == null ? new GeometryFactory() : geometryFactory); container.registerComponentInstance(new GML3EncodingUtils()); container.registerComponentInstance(new ArcParameters()); container.registerComponentInstance(srsSyntax); if (numDecimals >= 0) { CoordinateFormatter formatter = new CoordinateFormatter(numDecimals); formatter.setForcedDecimal(forceDecimalEncoding); formatter.setPadWithZeros(padWithZeros); container.registerComponentInstance(formatter); } }
/** * Configures the gml3 context. * <p> * The following factories are registered: * <ul> * <li>{@link CoordinateArraySequenceFactory} under {@link CoordinateSequenceFactory} * <li>{@link GeometryFactory} * </ul> * </p> */ public void configureContext(MutablePicoContainer container) { super.configureContext(container); container.registerComponentInstance(new FeatureTypeCache()); container.registerComponentImplementation(FeaturePropertyExtractor.class); //factories container.registerComponentInstance(CoordinateSequenceFactory.class, CoordinateArraySequenceFactory.instance()); container.registerComponentImplementation(GeometryFactory.class); } }
/** * Configures the gml3 context. * <p> * The following factories are registered: * <ul> * <li>{@link CoordinateArraySequenceFactory} under {@link CoordinateSequenceFactory} * <li>{@link GeometryFactory} * </ul> * </p> */ public void configureContext(MutablePicoContainer container) { super.configureContext(container); container.registerComponentInstance(new FeatureTypeCache()); container.registerComponentImplementation(FeaturePropertyExtractor.class); //factories container.registerComponentInstance(CoordinateSequenceFactory.class, CoordinateArraySequenceFactory.instance()); container.registerComponentImplementation(GeometryFactory.class); } }
/** * Configures the gml2 context. * <p> * The following classes are registered: * <ul> * <li>{@link CoordinateArraySequenceFactory} under {@link CoordinateSequenceFactory} * <li>{@link GeometryFactory} * <li>{@link FeatureTypeCache} * <li>{@link DefaultFeatureCollections} * </ul> * </p> */ public void configureContext(MutablePicoContainer container) { super.configureContext(container); container.registerComponentInstance(new FeatureTypeCache()); container.registerComponentInstance(CoordinateSequenceFactory.class, CoordinateArraySequenceFactory.instance()); container.registerComponentImplementation(GeometryFactory.class); container.registerComponentImplementation(DefaultFeatureCollections.class); } }
/** * Configures the gml3 context. * <p> * The following factories are registered: * <ul> * <li>{@link CoordinateArraySequenceFactory} under {@link CoordinateSequenceFactory} * <li>{@link GeometryFactory} * </ul> * </p> */ public void configureContext(MutablePicoContainer container) { super.configureContext(container); container.registerComponentInstance(new FeatureTypeCache()); container.registerComponentInstance(new XSDIdRegistry()); //factories container.registerComponentInstance(CoordinateSequenceFactory.class, CoordinateArraySequenceFactory.instance()); container.registerComponentImplementation(GeometryFactory.class); container.registerComponentInstance(new GML3EncodingUtils()); if (isExtendedArcSurfaceSupport()) { container.registerComponentInstance(new ArcParameters()); } container.registerComponentInstance(srsSyntax); } }