use of alma.acscourse.xmlbinding.myxmlconfigdata.MyNestedDataT in project ACS by ACS-Community.
the class Mount6Impl method createMyXmlConfigData.
/**
* Creates and returns binding classes which the container will automatically serialize to the following XML
* string which can be seen for example in the objexp client.
* <verbatim>
* <?xml version="1.0" encoding="ISO-8859-1"?><br>
* <ns1:MyXmlConfigData someAttribute="great attribute here!" xmlns:ns1="AlmaTest/MyXmlConfigData"><br>
* <ns1:MyXmlConfigDataEntity<br>
* entityIdEncrypted="-- id encryption not yet implemented --"<br>
* entityId="uid://X96fe17ec9c9de1be/X00000000" entityTypeName="MyXmlConfigData"/><br>
* <ns1:myStringData>string child elements looks like a string attribute
* when using binding classes...</ns1:myStringData><br>
* <ns1:childData><br>
* <ns1:someNestedData/><br>
* <ns1:someOtherData>one more silly string</ns1:someOtherData><br>
* </ns1:childData><br>
* </ns1:MyXmlConfigData><br>
* </verbatim>
*/
public MyXmlConfigData createMyXmlConfigData() {
MyXmlConfigData xmlData = new MyXmlConfigData();
try {
EntityT entity = new EntityT();
// the next line could be omitted if we had defined a subtype of EntityT in the XML schema,
// as it is done in the schemas of module acstestentities
entity.setEntityTypeName("MyXmlConfigData");
m_containerServices.assignUniqueEntityId(entity);
xmlData.setMyXmlConfigDataEntity(entity);
// note how we use the type-safe methods: "SomeAttribute" and "MyStringData" are names derived from the schema
xmlData.setSomeAttribute("great attribute here!");
xmlData.setMyStringData("string child elements looks like a string attribute when using binding classes...");
MyNestedDataT childData = new MyNestedDataT();
childData.setSomeOtherData("one more silly string");
xmlData.setChildData(childData);
// of the possible 0..7 (grand)child elements, we just add 1
MyNestedDataT grandchildData = new MyNestedDataT();
childData.addSomeNestedData(grandchildData);
} catch (AcsJContainerServicesEx e) {
m_logger.log(Level.SEVERE, "failed to create ObsProposal. ", e);
}
return xmlData;
}
Aggregations