Search in sources :

Example 1 with LanguageStringType

use of net.opengis.ows11.LanguageStringType 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());
}
Also used : DomainMetadataType(net.opengis.ows11.DomainMetadataType) SelectedProcessFunction(com.sldeditor.rendertransformation.SelectedProcessFunction) InputDescriptionType(net.opengis.wps10.InputDescriptionType) EList(org.eclipse.emf.common.util.EList) LanguageStringType(net.opengis.ows11.LanguageStringType) ProcessDescriptionType(net.opengis.wps10.ProcessDescriptionType) DataInputsType(net.opengis.wps10.DataInputsType) CodeType(net.opengis.ows11.CodeType) LiteralInputType(net.opengis.wps10.LiteralInputType) Test(org.junit.Test)

Example 2 with LanguageStringType

use of net.opengis.ows11.LanguageStringType in project arctic-sea by 52North.

the class OwsEncoderv110 method encodeOwsLanguageString.

private LanguageStringType encodeOwsLanguageString(LocalizedString ls) {
    LanguageStringType lst = LanguageStringType.Factory.newInstance(getXmlOptions());
    lst.setStringValue(ls.getText());
    lst.setLang(LocaleHelper.encode(ls.getLang()));
    return lst;
}
Also used : LanguageStringType(net.opengis.ows.x11.LanguageStringType)

Aggregations

SelectedProcessFunction (com.sldeditor.rendertransformation.SelectedProcessFunction)1 LanguageStringType (net.opengis.ows.x11.LanguageStringType)1 CodeType (net.opengis.ows11.CodeType)1 DomainMetadataType (net.opengis.ows11.DomainMetadataType)1 LanguageStringType (net.opengis.ows11.LanguageStringType)1 DataInputsType (net.opengis.wps10.DataInputsType)1 InputDescriptionType (net.opengis.wps10.InputDescriptionType)1 LiteralInputType (net.opengis.wps10.LiteralInputType)1 ProcessDescriptionType (net.opengis.wps10.ProcessDescriptionType)1 EList (org.eclipse.emf.common.util.EList)1 Test (org.junit.Test)1