Expression > Forums Home > Expression Studio Forums > Expression Media > Importing more than 10 custom fields
Ask a questionAsk a question
 

AnswerImporting more than 10 custom fields

  • Thursday, May 15, 2008 1:08 PMJonathan Palmer WCS Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     

    I am trying to convert Excel data into Microsoft Expression data.

    I have developed a small Excel tool that creates XML for importing.

    It works perfectly provided the number of custom fields is less than 10.

    When the number of custom fields exceeds 10 the values of the fields are imported correctly.

    I noticed when I have a catologue with 11 fields which I then export and import, I also have the same issue (i.e. that the values of the custom fields are not preserved).

    Any advice on how to import more than 10 custom fields?


    Jonathan

Answers

  • Thursday, May 15, 2008 10:55 PMian.w Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     AnswerHas Code
    Anita,

    There is a bug in xMedia2 that has been present since at least MediaPro v3.  I reported it to the iView Support Team in September 2007 and it was logged under ticket #2007090710000011.

    To see the problem you need to create a catalogue with a single image.  Now add the 16 allowed custom fields.  To see this better you should number the fields e.g. Custom01, Custom02 through to Custom16.  Note the leading zeroes!  Against each of these custom fields I have assigned a value that is also numbered.  Against Custom01 is a value of Test01, through to Custom16 being Test16.

    Assign the image to all these custom fields and then save the catalog.  Now export it to XML.  In the XML you will have at the top a list of the custom fields:

    <UserFieldList> 
        <UserFieldDefinition>Custom01</UserFieldDefinition> 
        <UserFieldDefinition>Custom02</UserFieldDefinition> 
        <UserFieldDefinition>Custom03</UserFieldDefinition> 
        <UserFieldDefinition>Custom04</UserFieldDefinition> 
        <UserFieldDefinition>Custom05</UserFieldDefinition> 
        <UserFieldDefinition>Custom06</UserFieldDefinition> 
        <UserFieldDefinition>Custom07</UserFieldDefinition> 
        <UserFieldDefinition>Custom08</UserFieldDefinition> 
        <UserFieldDefinition>Custom09</UserFieldDefinition> 
        <UserFieldDefinition>Custom10</UserFieldDefinition> 
        <UserFieldDefinition>Custom11</UserFieldDefinition> 
        <UserFieldDefinition>Custom12</UserFieldDefinition> 
        <UserFieldDefinition>Custom13</UserFieldDefinition> 
        <UserFieldDefinition>Custom14</UserFieldDefinition> 
        <UserFieldDefinition>Custom15</UserFieldDefinition> 
        <UserFieldDefinition>Custom16</UserFieldDefinition> 
    </UserFieldList> 

    Then against the image you will have the links between the image and the custom fields i.e.

    <UserFields> 
        <UserField_1>Test01</UserField_1> 
        <UserField_2>Test02</UserField_2> 
        <UserField_3>Test03</UserField_3> 
        <UserField_4>Test04</UserField_4> 
        <UserField_5>Test05</UserField_5> 
        <UserField_6>Test06</UserField_6> 
        <UserField_7>Test07</UserField_7> 
        <UserField_8>Test08</UserField_8> 
        <UserField_9>Test09</UserField_9> 
        <UserField_10>Test10</UserField_10> 
        <UserField_11>Test11</UserField_11> 
        <UserField_12>Test12</UserField_12> 
        <UserField_13>Test13</UserField_13> 
        <UserField_14>Test14</UserField_14> 
        <UserField_15>Test15</UserField_15> 
        <UserField_16>Test16</UserField_16> 
    </UserFields> 

    Close the current catalog and use the import XML function to create a new version of the catalog.  Once you display the custom fields you will see the problem.  Against Custom01 is Test01.  However against Custom02 is Test10.  Custom03 is Test11 through to Custom08 being Test16.  At this point Custom09 is Test02 through to Custom16 being Test09.  If you export this 'new' catalog to XML the UserFieldList is as before.  However the UserFields against the image show the incorrect order as:

    <UserFields> 
        <UserField_1>Test01</UserField_1> 
        <UserField_2>Test10</UserField_2> 
        <UserField_3>Test11</UserField_3> 
        <UserField_4>Test12</UserField_4> 
        <UserField_5>Test13</UserField_5> 
        <UserField_6>Test14</UserField_6> 
        <UserField_7>Test15</UserField_7> 
        <UserField_8>Test16</UserField_8> 
        <UserField_9>Test02</UserField_9> 
        <UserField_10>Test03</UserField_10> 
        <UserField_11>Test04</UserField_11> 
        <UserField_12>Test05</UserField_12> 
        <UserField_13>Test06</UserField_13> 
        <UserField_14>Test07</UserField_14> 
        <UserField_15>Test08</UserField_15> 
        <UserField_16>Test09</UserField_16> 
    </UserFields> 

    As I suggested when logging this bug 9 months ago it is probably a 'sorting' issue.  This is because UserField_10 comes between UserField_1 and UserField_2.  If the XML field names had included leading zeroes the problem may not have occured, although not knowing how xMedia works under the bonnet I cannot be sure.

    I use XML extensively at work and hard-wiring field numbers into element names is extremely poor design.  The field number should be an attribute or even replaced by the field name e.g.

    <UserFields>    
        <UserField number="1">Test01</UserField> 
        <UserField number="2">Test02</UserField> 
    </UserFields> 

    or

    <UserFields>    
        <UserField name="Custom01">Test01</UserField> 
        <UserField name="Custom02">Test02</UserField> 
    </UserFields> 

    This would allow the number of custom fields, at least from the XML point of view, to be limitless.

    I hope this explains the problem.  I look forward to a solution!



    Jonathan,

    For your Excel script it may be possible to "fix" this problem by messing up the order of fields in the output so that they match what xMedia can handle i.e. against UserField_2 is the value for UserField_10 and so on.  If this works then it's a horrible workaround, but may be better than other options.  It will be messy if your script has to handle a variable number of custom fields.


    Regards,

    Ian

All Replies

  • Thursday, May 15, 2008 9:29 PMAnita OakleyMSFT, ModeratorUsers MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     

    Hello Jonathan,

    I don't have your Excel tool, of course, but when I export through Make XML data file, and then import into a new catalog, I'm not seeing a problem with the values in my custom fields. Is that how you exported/imported?


    Regards, Anita Oakley
  • Thursday, May 15, 2008 10:55 PMian.w Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     AnswerHas Code
    Anita,

    There is a bug in xMedia2 that has been present since at least MediaPro v3.  I reported it to the iView Support Team in September 2007 and it was logged under ticket #2007090710000011.

    To see the problem you need to create a catalogue with a single image.  Now add the 16 allowed custom fields.  To see this better you should number the fields e.g. Custom01, Custom02 through to Custom16.  Note the leading zeroes!  Against each of these custom fields I have assigned a value that is also numbered.  Against Custom01 is a value of Test01, through to Custom16 being Test16.

    Assign the image to all these custom fields and then save the catalog.  Now export it to XML.  In the XML you will have at the top a list of the custom fields:

    <UserFieldList> 
        <UserFieldDefinition>Custom01</UserFieldDefinition> 
        <UserFieldDefinition>Custom02</UserFieldDefinition> 
        <UserFieldDefinition>Custom03</UserFieldDefinition> 
        <UserFieldDefinition>Custom04</UserFieldDefinition> 
        <UserFieldDefinition>Custom05</UserFieldDefinition> 
        <UserFieldDefinition>Custom06</UserFieldDefinition> 
        <UserFieldDefinition>Custom07</UserFieldDefinition> 
        <UserFieldDefinition>Custom08</UserFieldDefinition> 
        <UserFieldDefinition>Custom09</UserFieldDefinition> 
        <UserFieldDefinition>Custom10</UserFieldDefinition> 
        <UserFieldDefinition>Custom11</UserFieldDefinition> 
        <UserFieldDefinition>Custom12</UserFieldDefinition> 
        <UserFieldDefinition>Custom13</UserFieldDefinition> 
        <UserFieldDefinition>Custom14</UserFieldDefinition> 
        <UserFieldDefinition>Custom15</UserFieldDefinition> 
        <UserFieldDefinition>Custom16</UserFieldDefinition> 
    </UserFieldList> 

    Then against the image you will have the links between the image and the custom fields i.e.

    <UserFields> 
        <UserField_1>Test01</UserField_1> 
        <UserField_2>Test02</UserField_2> 
        <UserField_3>Test03</UserField_3> 
        <UserField_4>Test04</UserField_4> 
        <UserField_5>Test05</UserField_5> 
        <UserField_6>Test06</UserField_6> 
        <UserField_7>Test07</UserField_7> 
        <UserField_8>Test08</UserField_8> 
        <UserField_9>Test09</UserField_9> 
        <UserField_10>Test10</UserField_10> 
        <UserField_11>Test11</UserField_11> 
        <UserField_12>Test12</UserField_12> 
        <UserField_13>Test13</UserField_13> 
        <UserField_14>Test14</UserField_14> 
        <UserField_15>Test15</UserField_15> 
        <UserField_16>Test16</UserField_16> 
    </UserFields> 

    Close the current catalog and use the import XML function to create a new version of the catalog.  Once you display the custom fields you will see the problem.  Against Custom01 is Test01.  However against Custom02 is Test10.  Custom03 is Test11 through to Custom08 being Test16.  At this point Custom09 is Test02 through to Custom16 being Test09.  If you export this 'new' catalog to XML the UserFieldList is as before.  However the UserFields against the image show the incorrect order as:

    <UserFields> 
        <UserField_1>Test01</UserField_1> 
        <UserField_2>Test10</UserField_2> 
        <UserField_3>Test11</UserField_3> 
        <UserField_4>Test12</UserField_4> 
        <UserField_5>Test13</UserField_5> 
        <UserField_6>Test14</UserField_6> 
        <UserField_7>Test15</UserField_7> 
        <UserField_8>Test16</UserField_8> 
        <UserField_9>Test02</UserField_9> 
        <UserField_10>Test03</UserField_10> 
        <UserField_11>Test04</UserField_11> 
        <UserField_12>Test05</UserField_12> 
        <UserField_13>Test06</UserField_13> 
        <UserField_14>Test07</UserField_14> 
        <UserField_15>Test08</UserField_15> 
        <UserField_16>Test09</UserField_16> 
    </UserFields> 

    As I suggested when logging this bug 9 months ago it is probably a 'sorting' issue.  This is because UserField_10 comes between UserField_1 and UserField_2.  If the XML field names had included leading zeroes the problem may not have occured, although not knowing how xMedia works under the bonnet I cannot be sure.

    I use XML extensively at work and hard-wiring field numbers into element names is extremely poor design.  The field number should be an attribute or even replaced by the field name e.g.

    <UserFields>    
        <UserField number="1">Test01</UserField> 
        <UserField number="2">Test02</UserField> 
    </UserFields> 

    or

    <UserFields>    
        <UserField name="Custom01">Test01</UserField> 
        <UserField name="Custom02">Test02</UserField> 
    </UserFields> 

    This would allow the number of custom fields, at least from the XML point of view, to be limitless.

    I hope this explains the problem.  I look forward to a solution!



    Jonathan,

    For your Excel script it may be possible to "fix" this problem by messing up the order of fields in the output so that they match what xMedia can handle i.e. against UserField_2 is the value for UserField_10 and so on.  If this works then it's a horrible workaround, but may be better than other options.  It will be messy if your script has to handle a variable number of custom fields.


    Regards,

    Ian
  • Friday, June 26, 2009 12:39 PMGerrt Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    Dear Jonathan,

    could you possibly, in some way, help me out with this tool? I have a Excel sheet, that I would like to make a catalogue of. I have looked at a way to make it into XML, but my knowledge of XML-tools is too limited.

    Gerrit Netten,
    Amsterdam