use of net.opengis.ows.x11.DomainMetadataType in project sldeditor by robward-scisys.
the class GeoServerWPSClient method getInputParameter.
/**
* Gets the input parameter.
*
* @param typeOfData the type of data
* @param dataInputs the data inputs
* @return the input parameter
*/
@SuppressWarnings("unused")
private boolean getInputParameter(DataTypeEnum typeOfData, DataInputsType dataInputs) {
for (Object dataInput : dataInputs.getInput()) {
InputDescriptionType input = (InputDescriptionType) dataInput;
if (input instanceof InputDescriptionType) {
InputDescriptionType inputDescription = (InputDescriptionType) input;
LiteralInputType literal = inputDescription.getLiteralData();
if (literal != null) {
DomainMetadataType dataType = literal.getDataType();
// System.out.println(dataType.getValue() + "/" + dataType.getReference());
} else {
SupportedCRSsType bbox = inputDescription.getBoundingBoxData();
if (bbox != null) {
// System.out.println(bbox);
} else {
SupportedComplexDataType complex = inputDescription.getComplexData();
if (complex != null) {
ComplexDataCombinationsType parameterDataType = complex.getSupported();
if (isGeometry(typeOfData, parameterDataType)) {
return true;
}
}
}
}
}
}
return false;
}
use of net.opengis.ows.x11.DomainMetadataType in project sldeditor by robward-scisys.
the class GeoServerWPSClient method getOutputParameter.
/**
* Gets the input parameter.
*
* @param typeOfData the type of data
* @param dataInputs the data inputs
* @return the input parameter
*/
/*
private boolean getInputParameter(DataTypeEnum typeOfData, DataInputsType dataInputs) {
ConsoleManager.getInstance().information(this,
"Inputs");
for (Object dataInput : dataInputs.getInput()) {
InputDescriptionType input = (InputDescriptionType) dataInput;
if (input instanceof InputDescriptionType) {
InputDescriptionType inputDescription = (InputDescriptionType) input;
LiteralInputType literal = inputDescription.getLiteralData();
if (literal != null) {
DomainMetadataType dataType = literal.getDataType();
ConsoleManager.getInstance().information(this,
dataType.getValue());
} else {
SupportedCRSsType bbox = inputDescription.getBoundingBoxData();
if (bbox != null) {
ConsoleManager.getInstance().information(this,
"BBox");
} else {
SupportedComplexDataType complex = inputDescription.getComplexData();
if (complex != null) {
ComplexDataCombinationsType parameterDataType = complex.getSupported();
if (isGeometry(typeOfData, parameterDataType)) {
return true;
}
}
}
}
}
}
return false;
}
*/
/**
* Gets the output parameter.
*
* @param typeOfData the type of data
* @param processOutputs the process outputs
* @return the output parameter
*/
private boolean getOutputParameter(DataTypeEnum typeOfData, ProcessOutputsType processOutputs) {
ConsoleManager.getInstance().information(this, "Outputs");
for (Object o : processOutputs.getOutput()) {
if (o instanceof OutputDescriptionType) {
OutputDescriptionType oo = (OutputDescriptionType) o;
LiteralOutputType literal = oo.getLiteralOutput();
if (literal != null) {
DomainMetadataType dataType = literal.getDataType();
if (dataType != null) {
ConsoleManager.getInstance().information(this, dataType.getValue());
}
} else {
SupportedCRSsType bbox = oo.getBoundingBoxOutput();
if (bbox != null) {
ConsoleManager.getInstance().information(this, "BBox");
} else {
SupportedComplexDataType complex = oo.getComplexOutput();
if (complex != null) {
ComplexDataCombinationsType parameterDataType = complex.getSupported();
if (isGeometry(typeOfData, parameterDataType)) {
return true;
}
}
}
}
}
}
return false;
}
use of net.opengis.ows.x11.DomainMetadataType in project sldeditor by robward-scisys.
the class SelectedProcessFunctionTest method testSetSelectedCustomFunction.
/**
* Test method for {@link
* com.sldeditor.rendertransformation.SelectedProcessFunction#setSelectedCustomFunction(net.opengis.wps10.ProcessDescriptionType)}.
*/
@SuppressWarnings({ "unchecked", "rawtypes" })
@Test
public void testSetSelectedCustomFunction() {
ProcessDescriptionType process = Wps10FactoryImpl.init().createProcessDescriptionType();
CodeType codeType = Ows11FactoryImpl.init().createCodeType();
String expectedFunctionName = "JTS:area";
codeType.setValue(expectedFunctionName);
process.setIdentifier(codeType);
InputDescriptionType inputDescription = Wps10FactoryImpl.init().createInputDescriptionType();
CodeType codeType2 = Ows11FactoryImpl.init().createCodeType();
codeType2.setValue("dummyParameter");
inputDescription.setIdentifier(codeType2);
inputDescription.setMinOccurs(BigInteger.valueOf(1));
inputDescription.setMaxOccurs(BigInteger.valueOf(1));
LiteralInputType literal = Wps10FactoryImpl.init().createLiteralInputType();
DomainMetadataType domainType = Ows11FactoryImpl.init().createDomainMetadataType();
domainType.setValue("xs:int");
literal.setDefaultValue("1234");
literal.setDataType(domainType);
inputDescription.setLiteralData(literal);
DataInputsType dataInputs = Wps10FactoryImpl.init().createDataInputsType();
EList dataInputList = dataInputs.getInput();
dataInputList.add(inputDescription);
process.setDataInputs(dataInputs);
LanguageStringType title = Ows11FactoryImpl.init().createLanguageStringType();
title.setValue(expectedFunctionName);
process.setTitle(title);
SelectedProcessFunction obj = new SelectedProcessFunction();
obj.setSelectedCustomFunction(process);
assertFalse(obj.isBuiltInSelected());
assertTrue(obj.getFunctionName().getLocalPart().compareTo(expectedFunctionName) == 0);
assertEquals(1, obj.getRowCount());
assertFalse(obj.extractParameters().isEmpty());
obj.setSelectedCustomFunction(null);
assertFalse(obj.isBuiltInSelected());
assertNull(obj.getFunctionName());
assertEquals(0, obj.getRowCount());
assertTrue(obj.extractParameters().isEmpty());
}
use of net.opengis.ows.x11.DomainMetadataType in project sldeditor by robward-scisys.
the class CustomProcessFunctionTest method createProcessDescription.
/**
* Creates the process description.
*
* @param type the type
* @param defaultValue the default value
* @param minOccurs the min occurs
* @param maxOccurs the max occurs
* @return the process function parameter value
*/
@SuppressWarnings({ "unchecked", "rawtypes" })
private ProcessFunctionParameterValue createProcessDescription(String type, String defaultValue, int minOccurs, int maxOccurs) {
ProcessDescriptionType process = Wps10FactoryImpl.init().createProcessDescriptionType();
CodeType codeType = Ows11FactoryImpl.init().createCodeType();
codeType.setValue("JTS:area");
process.setIdentifier(codeType);
CodeType codeType2 = Ows11FactoryImpl.init().createCodeType();
codeType2.setValue("dummyParameter");
InputDescriptionType inputDescription = Wps10FactoryImpl.init().createInputDescriptionType();
inputDescription.setIdentifier(codeType2);
inputDescription.setMinOccurs(BigInteger.valueOf(minOccurs));
inputDescription.setMaxOccurs(BigInteger.valueOf(maxOccurs));
LiteralInputType literal = Wps10FactoryImpl.init().createLiteralInputType();
DomainMetadataType domainType = Ows11FactoryImpl.init().createDomainMetadataType();
domainType.setValue(type);
literal.setDefaultValue(defaultValue);
literal.setDataType(domainType);
inputDescription.setLiteralData(literal);
DataInputsType dataInputs = Wps10FactoryImpl.init().createDataInputsType();
EList dataInputList = dataInputs.getInput();
dataInputList.add(inputDescription);
process.setDataInputs(dataInputs);
CustomProcessFunction obj = new CustomProcessFunction();
List<ProcessFunctionParameterValue> valueList = obj.extractParameters(process);
assertEquals(1, valueList.size(), type);
ProcessFunctionParameterValue value = valueList.get(0);
assertEquals(minOccurs, value.getMinOccurences(), type);
assertEquals(maxOccurs, value.getMaxOccurences(), type);
return value;
}
Aggregations