I think, with the function
MetadataType.getAbstractMetaDataGroup().add(EStructuralFeature feature,
Object value) you can add the href-attribute. But how to create the
EStructuralFeature??

I tried it with loading the EStructuralFeature "href" from the ecore-model
"ows11.ecore"

URI uri = URI.createFileURI(new File("Q:/ows11.ecore").getAbsolutePath());
EcoreResourceFactoryImpl ecoreResourceFactory = new
EcoreResourceFactoryImpl();
Resource ecoreResource = ecoreResourceFactory.createResource(uri);

try {
        ecoreResource.load(Collections.EMPTY_MAP);
     } catch (IOException e) {
     // TODO Auto-generated catch block
        e.printStackTrace();
    }

EList<EObject> elist = ecoreResource.getContents();
EPackageImpl epi = (EPackageImpl)elist.get(0);
EClassImpl ec = (EClassImpl)epi.getEClassifiers().get(0);
EStructuralFeature href = ec.getEStructuralFeatures().get(2);

MetadataType mt = owsf.createMetadataType();
mt.setAbout("tag");
mt.setTitle("titel");
mt.getAbstractMetaDataGroup().add(href, "reference");

I got the error "The feature 'href's type 'null' does not permit a value of
type 'java.lang.String'"

I thought, the EType of href isn't defined.
I loaded the XMLType.ecore in the same way as the ows11.ecore and extracted
the EDataType AnySimpleType. Then I initialized the href's EType with this
value.

Next error: Invalid entry feature 'AbstractReferenceBaseType.href'

Does somebody has an idea (perhaps the right solution???)



--
View this message in context: 
http://osgeo-org.1560.x6.nabble.com/WPS-DescribeProcess-metadata-element-in-GeoServer-tp5082811p5086537.html
Sent from the GeoServer - User mailing list archive at Nabble.com.

------------------------------------------------------------------------------
Android is increasing in popularity, but the open development platform that
developers love is also attractive to malware creators. Download this white
paper to learn more about secure code signing practices that can help keep
Android apps secure.
http://pubads.g.doubleclick.net/gampad/clk?id=65839951&iu=/4140/ostg.clktrk
_______________________________________________
Geoserver-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geoserver-users

Reply via email to