CapableObjects forum



can't export Blob/Text fields to XML

Posted By efim 2010-05-15 23:48:04
Add to Favorites0
Author Message
efim
 Posted 2010-05-15 23:48:04
Supreme Being

Supreme Being - (1 650 reputation)Supreme Being - (1 650 reputation)Supreme Being - (1 650 reputation)Supreme Being - (1 650 reputation)Supreme Being - (1 650 reputation)Supreme Being - (1 650 reputation)Supreme Being - (1 650 reputation)Supreme Being - (1 650 reputation)Supreme Being - (1 650 reputation)

Group: Forum Members
Last Active: 2012-04-21 00:03:27
Posts: 252, Visits: 854
Hi,

I'm using this sample of Jonas to export/import eco instances to and back from xml: http://www.capableobjects.com/apps/InstantForum414/Topic3343-4-1.aspx?Highlight=Export

It works quite well till a Blob/Text attribute was attached to the class to be exported. As I found no value was copied in result XML at all. Do I miss something using this routine? It should be the matter of DatablockConverter.ConvertToXml.

/Efim

HansKarlsen
 Posted 2010-06-05 11:03:27
Supreme Being

Supreme Being - (3 009 reputation)Supreme Being - (3 009 reputation)Supreme Being - (3 009 reputation)Supreme Being - (3 009 reputation)Supreme Being - (3 009 reputation)Supreme Being - (3 009 reputation)Supreme Being - (3 009 reputation)Supreme Being - (3 009 reputation)Supreme Being - (3 009 reputation)

Group: Administrators
Last Active: Yesterday @ 18:25:39
Posts: 446, Visits: 2 654
I am not sure that what I found is related but it confused me for several hours.

I had a XMLPersistanceMapper saving my stuff , and I did not have any problems
I added a Image:Image attribute, and also added a button opening up a file dialog to assing a picture to the bytearray that the Image attribute was implemented as.

And then my app stopped working. I simply would not save any data at all to the xml file after I had assigned something to the byte array...

It turned out that there was an undocumented feature in the XMLPersistanceMapper that when working with relative paths like "./data.xml" it did Directory.GetCurrent() - and it did this for each save... So when I had found and assigned a picture I had also changed the result of Directory.GetCurrent()... Sneaky...

The XMLPersistanceMapper is updated in the later builds to use the  Directory.GetCurrent() the first time only and then keep on to the result so that you keep saving to the same place you loaded from...

efim
 Posted 2011-12-06 13:24:14
Supreme Being

Supreme Being - (1 650 reputation)Supreme Being - (1 650 reputation)Supreme Being - (1 650 reputation)Supreme Being - (1 650 reputation)Supreme Being - (1 650 reputation)Supreme Being - (1 650 reputation)Supreme Being - (1 650 reputation)Supreme Being - (1 650 reputation)Supreme Being - (1 650 reputation)

Group: Forum Members
Last Active: 2012-04-21 00:03:27
Posts: 252, Visits: 854
Hi Hans,

a long time before...

I guess I fond the reason in my case. The export began to work for Blob after the attribute value has been accessed, e.g. var dummy = classInstance.Icon; (Icon is the attribute name).
Could it be the matter of setting Delayed Fetch for this attribute in the model? However it is set to false



/Efim

Similar Topics

Expand / Collapse

Reading This Topic

Expand / Collapse

Back To Top