Package org.geoserver.csw.records

Examples of org.geoserver.csw.records.RecordDescriptor


        // mark the time the request started
        Date timestamp = new Date();
       
        try {
            // build the queries
            RecordDescriptor rd = getRecordDescriptor(request);           
            List<Query> queries = toGtQueries(rd, request.getId(), request);
                       
           
            // compute the number of records matched (in validate mode this is also a quick way
            // to check the request)
View Full Code Here


        // mark the time the request started
        Date timestamp = new Date();

        try {
            // build the queries           
          RecordDescriptor outputRd = getRecordDescriptor(request);
            QueryType cswQuery = (QueryType) request.getQuery();
            List<Query> queries = toGtQueries(outputRd, cswQuery, request);
            // see how many records we have to return
            int maxRecords;
            if(request.getMaxRecords() == null) {
View Full Code Here

            if (!supportedTypes.contains(typeName)) {
                throw new ServiceException("Unsupported record type " + typeName,
                        ServiceException.INVALID_PARAMETER_VALUE, "typeNames");
            }
           
            RecordDescriptor rd = getRecordDescriptor(typeName);
           
            Query q = new Query(typeName.getLocalPart());
            q.setFilter(filter);
            q.setProperties(getPropertyNames(outputRd, query));
            q.setSortBy(query.getSortBy());
            try {
                q.setNamespace(new URI(typeName.getNamespaceURI()));
            } catch (URISyntaxException e) { }
           
            // perform some necessary query adjustments
            Query adapted = rd.adaptQuery(q);    
           
            // the specification demands that we throw an error if a spatial operator
            // is used against a non spatial property
            if(q.getFilter() != null) {
                rd.verifySpatialFilters(q.getFilter());
            }
           
            //smuggle base url
            adapted.getHints().put(KEY_BASEURL, request.getBaseUrl());
                       
View Full Code Here

        return ft.toArray(new RecordDescriptor[ft.size()]);
    }

    @Override
    public CloseableIterator<String> getDomain(Name typeName, final Name attributeName) throws IOException {
        final RecordDescriptor rd = descriptorByType.get(typeName);

        if (rd==null) {
            throw new IOException(typeName + " is not a supported type");
        }
   
        // do we have such attribute?
        final PropertyName property = rd.translateProperty(attributeName);
        AttributeDescriptor ad = (AttributeDescriptor) property.evaluate(rd.getFeatureType());
        if(ad == null) {
            return new CloseableIteratorAdapter<String>(new ArrayList<String>().iterator());
        }

        // build the query against csw:record
        Query q = new Query(typeName.getLocalPart());
       
        q.setProperties(Arrays.asList(translateProperty(rd, attributeName)));
       
        // collect the values without duplicates
        final Set<String> values = new HashSet<String>();
        getRecords(q, Transaction.AUTO_COMMIT, rd.getOutputSchema()).accepts(new FeatureVisitor() {
           
            @Override
            public void visit(Feature feature) {
                Property prop = (Property) property.evaluate(feature);
                if (prop != null)
View Full Code Here

        return new CloseableIteratorAdapter<String>(result.iterator());
    }
   
    @Override
    public FeatureCollection getRecords(Query q, Transaction t, String outputSchema) throws IOException {
        RecordDescriptor rd;
        Name typeName = null;
        if (q.getTypeName() == null) {
            typeName = CSWRecordDescriptor.RECORD_DESCRIPTOR.getName();
        } else if(q.getNamespace() != null) {
            typeName = new NameImpl(q.getNamespace().toString(), q.getTypeName());
        } else {
            typeName = new NameImpl(q.getTypeName());
        }
        rd = descriptorByType.get(typeName);
       
        RecordDescriptor rdOutput;
        if (outputSchema == null || "".equals(outputSchema)) {
          rdOutput = descriptorByOutputSchema.get(CSWRecordDescriptor.getInstance().getOutputSchema());
        } else {
          rdOutput = descriptorByOutputSchema.get(outputSchema);
        }
View Full Code Here

    public RecordDescriptor get(Object key) {
        if(!(key instanceof Name)) {
            return null;
        }
        Name name = (Name) key;
        RecordDescriptor descriptor = super.get(key);
        if(descriptor == null && name.getNamespaceURI() == null) {
            // relaxed match, see if we can find the record without the namespace
            for (Map.Entry<Name, RecordDescriptor> entry : entrySet()) {
                if(entry.getKey().getLocalPart().equals(name.getLocalPart())) {
                    return entry.getValue();
View Full Code Here

TOP

Related Classes of org.geoserver.csw.records.RecordDescriptor

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.