Search in sources :

Example 1 with MyXmlConfigData

use of alma.acscourse.xmlbinding.myxmlconfigdata.MyXmlConfigData 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>
	 * 	  &lt;?xml version=&quot;1.0&quot; encoding=&quot;ISO-8859-1&quot;?&gt;<br>
	 * 	  &lt;ns1:MyXmlConfigData someAttribute=&quot;great attribute here!&quot; xmlns:ns1=&quot;AlmaTest/MyXmlConfigData&quot;&gt;<br>
	 * 	  &lt;ns1:MyXmlConfigDataEntity<br>
	 * 	  entityIdEncrypted=&quot;-- id encryption not yet implemented --&quot;<br>
	 * 	  entityId=&quot;uid://X96fe17ec9c9de1be/X00000000&quot; entityTypeName=&quot;MyXmlConfigData&quot;/&gt;<br>
	 * 	  &lt;ns1:myStringData&gt;string child elements looks like a string attribute 
	 * 	  when using binding classes...&lt;/ns1:myStringData&gt;<br>
	 * 	  &lt;ns1:childData&gt;<br>
	 * 	  &lt;ns1:someNestedData/&gt;<br>
	 * 	  &lt;ns1:someOtherData&gt;one more silly string&lt;/ns1:someOtherData&gt;<br>
	 * 	  &lt;/ns1:childData&gt;<br>
	 * 	  &lt;/ns1:MyXmlConfigData&gt;<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;
}
Also used : MyXmlConfigData(alma.acscourse.xmlbinding.myxmlconfigdata.MyXmlConfigData) MyNestedDataT(alma.acscourse.xmlbinding.myxmlconfigdata.MyNestedDataT) EntityT(alma.entities.commonentity.EntityT) AcsJContainerServicesEx(alma.JavaContainerError.wrappers.AcsJContainerServicesEx)

Aggregations

AcsJContainerServicesEx (alma.JavaContainerError.wrappers.AcsJContainerServicesEx)1 MyNestedDataT (alma.acscourse.xmlbinding.myxmlconfigdata.MyNestedDataT)1 MyXmlConfigData (alma.acscourse.xmlbinding.myxmlconfigdata.MyXmlConfigData)1 EntityT (alma.entities.commonentity.EntityT)1