Package org.lightadmin.core.config.domain.configuration

Examples of org.lightadmin.core.config.domain.configuration.DefaultEntityMetadataConfigurationUnitBuilderTest$DomainType


    private void addParameter(Node node, Ows10Factory ows10Factory, OperationType operationType,
            String parameterName) {
        Node paramParentNode = node.getChild(parameterName);
        List<String> paramValues = childNames(paramParentNode);

        DomainType domain = ows10Factory.createDomainType();
        domain.setName(parameterName);

        for (String paramValue : paramValues) {
            domain.getValue().add(paramValue);
        }
        operationType.getParameter().add(domain);
    }
View Full Code Here


        assertEquals("GetRecords", gr.getName());
        DCPType dcp = (DCPType) gr.getDCP().get(0);
        RequestMethodType rm = (RequestMethodType) dcp.getHTTP().getPost().get(0);
        assertEquals("http://tc22-test:9090/soapService/services/CSWDiscovery", rm.getHref());
        assertEquals(6, gr.getParameter().size());
        DomainType param = (DomainType) gr.getParameter().get(0);
        assertEquals("TypeName", param.getName());
        assertEquals("gmd:MD_Metadata", param.getValue().get(0));
        assertEquals("csw:Record", param.getValue().get(1));
        assertEquals(2, gr.getConstraint().size());
        DomainType ct = (DomainType) gr.getConstraint().get(0);
        assertEquals("SupportedISOQueryables", ct.getName());
        assertEquals(25, ct.getValue().size());
        assertEquals("RevisionDate", ct.getValue().get(0));
        assertEquals("OperatesOnWithOpName", ct.getValue().get(24));
       
        /** This fails, caps are not getting parsed **/
        FilterCapabilities filterCapabilities = caps.getFilterCapabilities();
        assertNotNull(filterCapabilities);
        SpatialCapabilities spatial = filterCapabilities.getSpatialCapabilities();
View Full Code Here

  public CapabilitiesType decorate(CapabilitiesType caps, CatalogStore store) {
    // amend GetRecords
    OperationsMetadataType operations = caps.getOperationsMetadata();
    OperationType gro = getOperation("GetRecords", operations);

    DomainType outputFormats = getParameter("outputFormat", gro);
    outputFormats.getValue().add("text/xml");

    return caps;
  }
View Full Code Here

        + operationName);
  }

  private DomainType getParameter(String parameterName,
      OperationType operation) {
    DomainType result = getParameterIfExists(parameterName, operation);
    if (result == null) {
      throw new IllegalArgumentException("Could not find parameter "
          + parameterName);
    } else {
      return result;
View Full Code Here

  }

  private DomainType getParameterIfExists(String parameterName,
      OperationType operation) {
    for (Object o : operation.getParameter()) {
      DomainType dt = (DomainType) o;
      if (parameterName.equals(dt.getName())) {
        return dt;
      }
    }

    return null;
View Full Code Here

        RequestMethodType describeRecordPost = owsf.createRequestMethodType();
        describeRecordPost.setHref(describeRecordHref);

        // - DescribeRecord - constraints
        DomainType describeRecordPostConstraints = owsf.createDomainType();
        describeRecordPostConstraints.setName("PostEncoding");
        describeRecordPostConstraints.getValue().add("XML");

        describeRecordPost.getConstraint().add(describeRecordPostConstraints);
        describeRecordHTTP.getPost().add(describeRecordPost);

        // - Parameters
View Full Code Here

        RequestMethodType getRecordsPost = owsf.createRequestMethodType();
        getRecordsPost.setHref(getRecordsHref);

        // - GetRecords - constraints
        DomainType getRecordsPostConstraints = owsf.createDomainType();
        getRecordsPostConstraints.setName("PostEncoding");
        getRecordsPostConstraints.getValue().add("XML");

        getRecordsPost.getConstraint().add(getRecordsPostConstraints);
        getRecordsHTTP.getPost().add(getRecordsPost);

        // - Parameters
        for (DomainType param : operationParameters.get("GetRecords"))
        {
            // clone the object, as the caps decorators might want to modify it
            getRecords.getParameter().add(EcoreUtil.copy(param));
        }

        // - Constraints
        for (DomainType constraint : operationConstraints.get("GetRecords"))
        {
            // clone the object, as the caps decorators might want to modify it
            getRecords.getConstraint().add(EcoreUtil.copy(constraint));
        }
       
        // the additional queriables based on the store
        try {
            for(RecordDescriptor rd : store.getRecordDescriptors()) {              
                List<Name> queriables = store.getCapabilities().getQueriables(rd.getFeatureDescriptor().getName() );
                if(queriables != null && queriables.size() > 0) {
                    DomainType dt = owsf.createDomainType();
                    dt.setName(rd.getQueryablesDescription());                   
                    NamespaceSupport nss = rd.getNamespaceSupport();
                       
                    for (Name q : queriables) {                      
                        String prefix = nss.getPrefix(q.getNamespaceURI());
                        dt.getValue().add(prefix==null? q.getLocalPart() : prefix + ":" + q.getLocalPart());
                    }                       
                    getRecords.getConstraint().add(dt);
                }
               
            }
           
            DomainType dt = owsf.createDomainType();
            dt.setName("XPathQueryables");
            dt.getValue().add("allowed");
            getRecords.getConstraint().add(dt);
           
        } catch (IOException e) {
            LOGGER.log(Level.WARNING, "Failed to encode getRecords additional queriables", e);
        }
View Full Code Here

        RequestMethodType getRecordByIdPost = owsf.createRequestMethodType();
        getRecordByIdPost.setHref(getRecordByIdHref);

        // - GetRecordById - constraints
        DomainType getRecordByIdPostConstraints = owsf.createDomainType();
        getRecordByIdPostConstraints.setName("PostEncoding");
        getRecordByIdPostConstraints.getValue().add("XML");

        getRecordByIdPost.getConstraint().add(getRecordByIdPostConstraints);
        getRecordByIdHTTP.getPost().add(getRecordByIdPost);
       
        // - Parameters
View Full Code Here

        RequestMethodType getDomainPost = owsf.createRequestMethodType();
        getDomainPost.setHref(getDomainHref);

        // - GetDomain - constraints
        DomainType getDomainPostConstraints = owsf.createDomainType();
        getDomainPostConstraints.setName("PostEncoding");
        getDomainPostConstraints.getValue().add("XML");

        getDomainPost.getConstraint().add(getDomainPostConstraints);
        getDomainHTTP.getPost().add(getDomainPost);

        // - Fixed Parameters
        for (DomainType param : operationParameters.get("GetDomain"))
        {
            // clone the object, as the caps decorators might want to modify it
            getDomain.getParameter().add(EcoreUtil.copy(param));
        }
       
        // The domain queriables list from the catalog store
        try {
            Set<String> summary = new HashSet<String>();
            for (RecordDescriptor rd : store.getRecordDescriptors()) {
                List<Name> queriables = store.getCapabilities().getDomainQueriables(rd.getFeatureDescriptor().getName());

                if (queriables != null && queriables.size() > 0) {
                    NamespaceSupport nss = rd.getNamespaceSupport();
                    for (Name q : queriables) {                       
                        String prefix = nss.getPrefix(q.getNamespaceURI());
                        summary.add(prefix==null? q.getLocalPart() : prefix + ":" + q.getLocalPart());
                    }

                }
            }
               
            if(summary.size() > 0) {
                List<String> sorted = new ArrayList<String>(summary);
                Collections.sort(sorted);
                DomainType dt = owsf.createDomainType();
                dt.setName("PropertyName");
                for (String name : sorted) {
                    dt.getValue().add(name);
                }
                getDomain.getParameter().add(dt);
            }
        } catch (IOException e) {
            LOGGER.log(Level.WARNING, "Failed to encode getDomain ParameterName values", e);
View Full Code Here

        RequestMethodType transactionPost = owsf.createRequestMethodType();
        transactionPost.setHref(transactionHref);

        // - Transaction - constraints
        DomainType transactionPostConstraints = owsf.createDomainType();
        transactionPostConstraints.setName("PostEncoding");
        transactionPostConstraints.getValue().add("XML");

        transactionPost.getConstraint().add(transactionPostConstraints);
        transactionHTTP.getPost().add(transactionPost);
       
        // - Parameters
View Full Code Here

TOP

Related Classes of org.lightadmin.core.config.domain.configuration.DefaultEntityMetadataConfigurationUnitBuilderTest$DomainType

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.