use of org.geotoolkit.ows.xml.v110.OperationsMetadata in project ddf by codice.
the class TestCswEndpoint method verifyOperationsMetadata.
/**
* Helper method to verify the OperationsMetadata section matches the endpoint's definition
*
* @param ct The CapabilitiesType to verify
*/
private void verifyOperationsMetadata(CapabilitiesType ct) {
OperationsMetadata om = ct.getOperationsMetadata();
List<Operation> opList = om.getOperation();
ArrayList<String> opNames = new ArrayList<>();
for (Operation op : opList) {
opNames.add(op.getName());
if (StringUtils.equals(CswConstants.TRANSACTION, op.getName()) || StringUtils.equals(CswConstants.GET_RECORDS, op.getName())) {
for (DomainType parameter : op.getParameter()) {
if (StringUtils.equals(CswConstants.CONSTRAINT_LANGUAGE_PARAMETER, parameter.getName())) {
assertThat(parameter.getValue(), contains(CswConstants.CONSTRAINT_LANGUAGE_FILTER, CswConstants.CONSTRAINT_LANGUAGE_CQL));
} else if (StringUtils.equals(CswConstants.TYPE_NAMES_PARAMETER, parameter.getName())) {
// TODO : Remove conditional when GMD Metacard Transformer is merged (DDF-1976)
if (StringUtils.equals(op.getName(), CswConstants.TRANSACTION)) {
assertThat(parameter.getValue(), contains(CswConstants.CSW_RECORD));
} else {
assertThat(parameter.getValue(), hasItems(CswConstants.CSW_RECORD, GmdConstants.GMD_METACARD_TYPE_NAME));
}
}
}
}
}
assertThat(opNames.contains(CswConstants.GET_CAPABILITIES), is(true));
assertThat(opNames.contains(CswConstants.DESCRIBE_RECORD), is(true));
assertThat(opNames.contains(CswConstants.GET_RECORDS), is(true));
assertThat(opNames.contains(CswConstants.GET_RECORD_BY_ID), is(true));
assertThat(opNames.contains(CswConstants.TRANSACTION), is(true));
}
use of org.geotoolkit.ows.xml.v110.OperationsMetadata in project geotoolkit by Geomatys.
the class CapabilitiesType method applySections.
@Override
public CapabilitiesType applySections(Sections sections) {
if (sections == null) {
sections = new SectionsType("All");
}
ServiceIdentification si = null;
ServiceProvider sp = null;
OperationsMetadata om = null;
ContentsType ct = null;
// we add the static sections if the are included in the requested sections
if (sections.containsSection("ServiceProvider") || sections.containsSection("All")) {
sp = getServiceProvider();
}
if (sections.containsSection("ServiceIdentification") || sections.containsSection("All")) {
si = getServiceIdentification();
}
if (sections.containsSection("OperationsMetadata") || sections.containsSection("All")) {
om = getOperationsMetadata();
}
// if the user does not request the contents section we can return the result.
if (sections.containsSection("Contents") || sections.containsSection("All")) {
ct = contents;
}
return new CapabilitiesType(si, sp, om, "2.0.1", getUpdateSequence(), ct, getServiceMetadata());
}
use of org.geotoolkit.ows.xml.v110.OperationsMetadata in project geotoolkit by Geomatys.
the class Capabilities method applySections.
@Override
public AbstractCapabilitiesCore applySections(final Sections sections) {
// we prepare the different parts response document
ServiceIdentification si = null;
ServiceProvider sp = null;
OperationsMetadata om = null;
FilterCapabilities fc = null;
Contents cont = null;
// we enter the information for service identification.
if (sections.containsSection("ServiceIdentification") || sections.containsSection("All")) {
si = getServiceIdentification();
}
// we enter the information for service provider.
if (sections.containsSection("ServiceProvider") || sections.containsSection("All")) {
sp = getServiceProvider();
}
// we enter the operation Metadata
if (sections.containsSection("OperationsMetadata") || sections.containsSection("All")) {
om = getOperationsMetadata();
}
// we enter the information filter capablities.
if (sections.containsSection("Filter_Capabilities") || sections.containsSection("All")) {
fc = filterCapabilities;
}
if (sections.containsSection("Contents") || sections.containsSection("All")) {
cont = contents;
}
// we build and normalize the document
return new Capabilities(si, sp, om, "1.0.0", getUpdateSequence(), fc, cont);
}
use of org.geotoolkit.ows.xml.v110.OperationsMetadata in project geotoolkit by Geomatys.
the class CapabilitiesType method applySections.
@Override
public AbstractCapabilitiesCore applySections(final Sections sections) {
// we prepare the different parts response document
ServiceIdentification si = null;
ServiceProvider sp = null;
OperationsMetadata om = null;
FilterCapabilities fc = null;
ContentsType cont = null;
// we enter the information for service identification.
if (sections.containsSection("ServiceIdentification") || sections.containsSection("All")) {
si = getServiceIdentification();
}
// we enter the information for service provider.
if (sections.containsSection("ServiceProvider") || sections.containsSection("All")) {
sp = getServiceProvider();
}
// we enter the operation Metadata
if (sections.containsSection("OperationsMetadata") || sections.containsSection("All")) {
om = getOperationsMetadata();
}
// we enter the information filter capablities.
if (sections.containsSection("Filter_Capabilities") || sections.containsSection("All")) {
fc = filterCapabilities;
}
if (sections.containsSection("Contents") || sections.containsSection("All")) {
if (contents != null) {
cont = contents.contents;
}
}
// we build and normalize the document
return new CapabilitiesType(si, sp, om, "2.0.0", getUpdateSequence(), fc, cont, extension);
}
use of org.geotoolkit.ows.xml.v110.OperationsMetadata in project geotoolkit by Geomatys.
the class CapabilitiesType method applySections.
@Override
public CapabilitiesType applySections(final Sections sections) {
ServiceIdentification si = null;
ServiceProvider sp = null;
OperationsMetadata om = null;
// we enter the information for service identification.
if (sections.containsSection("ServiceIdentification") || sections.containsSection("All")) {
si = getServiceIdentification();
}
// we enter the information for service provider.
if (sections.containsSection("ServiceProvider") || sections.containsSection("All")) {
sp = getServiceProvider();
}
// we enter the operation Metadata
if (sections.containsSection("OperationsMetadata") || sections.containsSection("All")) {
om = getOperationsMetadata();
}
return new CapabilitiesType(si, sp, om, "2.0.2", getUpdateSequence());
}
Aggregations