Sandeep,

just trying to follow up your initial offer. Did you get anywhere
following my instructions, or do you want me to expand things further ?

Regards
Werner Guttmann

Werner Guttmann wrote:
> What ever you prefer ... if you download the Castor sources, there's
> some HOW-To documents to be found in src/how-to. Just grab any of them
> and tweak them to your needs. Once you have got something ready, create
> a new Jira issue, attach your HOW-TO, and I'll take care of th erest.
> 
> Werner
> 
> Sandeep Khanna wrote:
> 
>>Sure.
>>
>>In the past couple of days trying to evaulate, compare and use the two
>>XML binding frameworks Jibx & Castor has taught me quite a lot about
>>them. I can share this knowledge too.
>>
>>Regards,
>>Sandeep Khanna
>>
>>On Fri, 2006-01-13 at 17:48 +0100, Werner Guttmann wrote:
>>
>>
>>>Sandeep,
>>>
>>>how would you feel to provide us with a short HOW-TO on this very
>>>subject ?  If I provided you with a stub document, would you be willing
>>>to fill in the details ... as a kind of nice feedback to the ones who
>>>helped you and the community in general ?
>>>
>>>Werner
>>>
>>>Sandeep Khanna wrote:
>>>
>>>
>>>>Thank you guys. I did find that discussion thread
>>>>http://www.mail-archive.com/[email protected]/msg01937.html
>>>>
>>>>The way I got it to work is:
>>>>1. Removing the type="com.adminserver.dcl.ClientFieldDcl" from the
>>>><field> element. Wonder how that really matters for printing the 'key'
>>>>as an attribute or an element!
>>>>
>>>>Before:
>>>><field name="fields" type="com.adminserver.dcl.ClientFieldDcl"
>>>>get-method="getFields" set-method="setFields" collection="map">
>>>>   <bind-xml name="entry" node="element" location="Fields">
>>>>       <class name="org.exolab.castor.mapping.MapItem">
>>>>           <field name="key" type="java.lang.String">
>>>>               <bind-xml name="key" node="attribute"/>
>>>>           </field>
>>>>           <field name="value"
>>>>type="com.adminserver.dcl.ClientFieldDcl">
>>>>               <bind-xml name="AsClientField"/>
>>>>           </field>
>>>>       </class>
>>>>   </bind-xml>
>>>></field>
>>>>
>>>>After:
>>>><field name="fields" get-method="getFields" set-method="setFields"
>>>>collection="map">
>>>>   <bind-xml name="entry" node="element" location="Fields">
>>>>       <class name="org.exolab.castor.mapping.MapItem">
>>>>           <field name="key" type="java.lang.String">
>>>>               <bind-xml name="key" node="attribute"/>
>>>>           </field>
>>>>           <field name="value"
>>>>type="com.adminserver.dcl.ClientFieldDcl">
>>>>               <bind-xml name="AsClientField"/>
>>>>           </field>
>>>>       </class>
>>>>   </bind-xml>
>>>></field>
>>>>
>>>>--Sandeep Khanna
>>>>
>>>>On Fri, 2006-01-13 at 14:18 +0100, Ralf Joachim wrote:
>>>>
>>>>
>>>>
>>>>>Hi Sandeep,
>>>>>
>>>>>I suggest you to search the mail archive as I am sure we had a similare
>>>>>discussion (key as attribute) during the last month on user mailing list.
>>>>>
>>>>>Regards
>>>>>Ralf
>>>>>Castor JDO, committer
>>>>>
>>>>>
>>>>>Sandeep Khanna schrieb:
>>>>>
>>>>>
>>>>>
>>>>>>Adam,
>>>>>>
>>>>>>Thank you for your prompt reply.
>>>>>>
>>>>>>Kindly read inline comments.
>>>>>>
>>>>>>On Fri, 2006-01-13 at 02:02 -0500, Adam Kramer wrote:
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>>Hi Sandeep,
>>>>>>>
>>>>>>>Read Below...
>>>>>>>
>>>>>>>Sandeep Khanna wrote:
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>>Castor is not putting HashMap 'key' information as attribute as
>>>>>>>>configured in the mapping file.
>>>>>>>>
>>>>>>>
>>>>>>>I'm not positive this will work, but try taking the type attribute off 
>>>>>>>the Map collection field. For instance, without the type attribute in 
>>>>>>>the 'fields' field:
>>>>>>><field name="fields" collection="map">
>>>>>>
>>>>>>
>>>>>>This is what I have now:
>>>>>>
>>>>>><Fields>
>>>>>>  <entry>
>>>>>>      <key>AgentNumber</key>
>>>>>>      <value>
>>>>>>          <FieldTypeCode>02</FieldTypeCode>
>>>>>>
>>>>>><ClientGUID>08250B8D-2F22-4834-A995-F414194EA8D4</ClientGUID>
>>>>>>          <FieldName>AgentNumber</FieldName>
>>>>>>      </value>
>>>>>>  </entry>
>>>>>>  <entry>
>>>>>>      <key>MaritalStatus</key>
>>>>>>      <value>
>>>>>>          <TextValue>00</TextValue>
>>>>>>          <FieldTypeCode>02</FieldTypeCode>
>>>>>>
>>>>>><ClientGUID>08250B8D-2F22-4834-A995-F414194EA8D4</ClientGUID>
>>>>>>          <FieldName>MaritalStatus</FieldName>
>>>>>>      </value>
>>>>>>  </entry>
>>>>>></Fields>
>>>>>>
>>>>>>
>>>>>>And, this is what I want it to be:
>>>>>>
>>>>>><Fields size="2">
>>>>>>  <entry key="AgentNumber">
>>>>>>      <AsClientField>
>>>>>>
>>>>>><ClientGUID>08250B8D-2F22-4834-A995-F414194EA8D4</ClientGUID>
>>>>>>          <FieldName>AgentNumber</FieldName>
>>>>>>          <FieldTypeCode>02</FieldTypeCode>
>>>>>>      </AsClientField>
>>>>>>  </entry>
>>>>>>  <entry key="MaritalStatus">
>>>>>>      <AsClientField>
>>>>>>
>>>>>><ClientGUID>08250B8D-2F22-4834-A995-F414194EA8D4</ClientGUID>
>>>>>>          <FieldName>MaritalStatus</FieldName>
>>>>>>          <TextValue>00</TextValue>
>>>>>>          <FieldTypeCode>02</FieldTypeCode>
>>>>>>      </AsClientField>
>>>>>>  </entry>
>>>>>></Fields>
>>>>>>
>>>>>>>>In order for the generated XML to be Jibx compliant (this is for
>>>>>>>>comparing Castor & Jibx marshall/unmarshall similar documents)
>>>>>>>>
>>>>>>>>Also, the following code was generated with:
>>>>>>>>Marshaller marshaller = new Marshaller( new
>>>>>>>>FileWriter( "AsXml-Castor.xml", false ) );
>>>>>>>>marshaller.setMapping( mapping );
>>>>>>>>marshaller.setSuppressNamespaces( false );
>>>>>>>>marshaller.setSuppressXSIType( false );
>>>>>>>>marshaller.marshal( clientDcl );
>>>>>>>
>>>>>>>If you are trying to suppress XSI types and namespaces, you should be 
>>>>>>>setting those to true, not false, so:
>>>>>>>marshaller.setSuppressNamespaces( true );
>>>>>>>marshaller.setSuppressXSIType( true );
>>>>>>
>>>>>>
>>>>>>I haven't tried that yet. But, it makes more sense than what I had.
>>>>>>
>>>>>>All that staring at the screen all day just got to me.
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>>>Mapping file:
>>>>>>>>
>>>>>>>><?xml version="1.0" encoding="UTF-8"?>
>>>>>>>><mapping>
>>>>>>>><!--
>>>>>>>>=================================================================== -->
>>>>>>>><!-- Mapping for class com.adminserver.dcl.ClientDcl
>>>>>>>>-->
>>>>>>>><!--
>>>>>>>>=================================================================== -->
>>>>>>>><class name="com.adminserver.dcl.ClientDcl" identity="clientGuid"
>>>>>>>>access="shared"
>>>>>>>>auto-complete="false">
>>>>>>>><field name="lastName" type="string" get-method="getLastName"
>>>>>>>>set-method="setLastName">
>>>>>>>><bind-xml name="LastName" node="element"/>
>>>>>>>></field>
>>>>>>>><field name="fields" type="com.adminserver.dcl.ClientFieldDcl"
>>>>>>>>get-method="getFields"
>>>>>>>>set-method="setFields" collection="map">
>>>>>>>><bind-xml name="entry" node="element" location="Fields">
>>>>>>>><class name="org.exolab.castor.mapping.MapItem">
>>>>>>>><field name="key" type="java.lang.String">
>>>>>>>><bind-xml name="key" node="attribute"/>
>>>>>>>></field>
>>>>>>>><field name="value"
>>>>>>>>type="com.adminserver.dcl.ClientFieldDcl">
>>>>>>>><bind-xml name="value"/>
>>>>>>>></field>
>>>>>>>></class>
>>>>>>>></bind-xml>
>>>>>>>></field>
>>>>>>>></class>
>>>>>>>><!--
>>>>>>>>=================================================================== -->
>>>>>>>><!-- Mapping for class com.adminserver.dcl.ClientFieldDcl
>>>>>>>>-->
>>>>>>>><!--
>>>>>>>>=================================================================== -->
>>>>>>>><class name="com.adminserver.dcl.ClientFieldDcl"
>>>>>>>>identity="clientGuid fieldName" access="shared"
>>>>>>>>auto-complete="false">
>>>>>>>><description>AsClientField</description>
>>>>>>>><cache-type type="count-limited"/>
>>>>>>>><map-to table="AsClientField" xml="AsClientField"/>
>>>>>>>><field name="clientGuid" type="string"
>>>>>>>>get-method="getClientGuid" set-method="setClientGuid">
>>>>>>>><bind-xml name="ClientGUID" node="element"/>
>>>>>>>></field>
>>>>>>>><field name="fieldName" type="string" get-method="getFieldName"
>>>>>>>>set-method="setFieldName">
>>>>>>>><bind-xml name="FieldName" node="element"/>
>>>>>>>></field>
>>>>>>>><field name="textValue" type="string" get-method="getTextValue"
>>>>>>>>set-method="setTextValue">
>>>>>>>><bind-xml name="TextValue" node="element"/>
>>>>>>>></field>
>>>>>>>><field name="fieldTypeCode" type="string"
>>>>>>>>get-method="getFieldTypeCode"
>>>>>>>>set-method="setFieldTypeCode">
>>>>>>>><bind-xml name="FieldTypeCode" node="element"/>
>>>>>>>></field>
>>>>>>>></class>
>>>>>>>></mapping>
>>>>>>>>
>>>>>>>>Any ideas?
>>>>>>>>
>>>>>>>>--Sandeep Khanna
>>>>>>>>
>>>>>>>
>>>>>>>Best,
>>>>>>>Adam
>>>>>>
>>>>>>
>>>>>>--Sandeep Khanna
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>>-------------------------------------------------
>>>>>>>If you wish to unsubscribe from this list, please 
>>>>>>>send an empty message to the following address:
>>>>>>>
>>>>>>>[EMAIL PROTECTED]
>>>>>>>-------------------------------------------------
>>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>-------------------------------------------------
>>>>>>If you wish to unsubscribe from this list, please 
>>>>>>send an empty message to the following address:
>>>>>>
>>>>>>[EMAIL PROTECTED]
>>>>>>-------------------------------------------------
>>>>>>
>>>>>
>>>>>-------------------------------------------------
>>>>>If you wish to unsubscribe from this list, please 
>>>>>send an empty message to the following address:
>>>>>
>>>>>[EMAIL PROTECTED]
>>>>>-------------------------------------------------
>>>>>
>>>>
>>>>
>>>>
>>>>-------------------------------------------------
>>>>If you wish to unsubscribe from this list, please 
>>>>send an empty message to the following address:
>>>>
>>>>[EMAIL PROTECTED]
>>>>-------------------------------------------------
>>>>
>>>>
>>>
>>>
>>>-------------------------------------------------
>>>If you wish to unsubscribe from this list, please 
>>>send an empty message to the following address:
>>>
>>>[EMAIL PROTECTED]
>>>-------------------------------------------------
>>>
>>
>>
>>
>>-------------------------------------------------
>>If you wish to unsubscribe from this list, please 
>>send an empty message to the following address:
>>
>>[EMAIL PROTECTED]
>>-------------------------------------------------
>>
>>
> 
> 
> 
> -------------------------------------------------
> If you wish to unsubscribe from this list, please 
> send an empty message to the following address:
> 
> [EMAIL PROTECTED]
> -------------------------------------------------
> 
> 


-------------------------------------------------
If you wish to unsubscribe from this list, please 
send an empty message to the following address:

[EMAIL PROTECTED]
-------------------------------------------------

Reply via email to