Changing the path to Data.xml / Caching in IE

Jan 29, 2008 at 8:31 AM
Hi All,

I have checked the source but I'm not a JS / XML expert and am struggling to change the paths used by the slideshow.

My application is for an image library, so people get lightboxes (just a list of images) they are currently working on.
I'm generating the following config and data files, and launching with the following script tag.

The problem is I can only get it to work if the Config and Data files are in the current directory which is no good on
a multi user system. Also, when the data files change IE will have cached Data.xml so never changes the list of images.
I could generate a fresh temporary directory with a different name each time to force a re-read but is there a neater
way to get IE to recheck the Data.xml? Firefox does not have this caching problem. I can get round this one so the
main question is, how do I specify a particular directory for the control to read the Config and Data XML files from?

Thanks

Steve

<script type='text/javascript'>
new SlideShow.Control(new SlideShow.XmlConfigProvider( { url:"tmp/silverlight/53733/Configuration.xml" },{ url:"tmp/silverlight/53733/Data.xml" }));
</script>

// tmp/silverlight/53733/Configuration.xml

<configuration width='800' height='600' background='Black'>
<modules>
<module type='SlideViewer' />
<module type='ProgressBar' />
<module type='SlideDescription' />
<module type='NavigationTray'>
<option name='thumbnailViewer.left' value='83' />
</module>
</modules>
<transitions>
<transition type='FadeTransition' name='CrossFadeTransition' />
<transition type='WipeTransition' name='WipeRightTransition'>
<option name='direction' value='Right' />
</transition>
</transitions>
<dataProvider type='XmlDataProvider'>
<option url='tmp/silverlight/53733/Data.xml' />
</dataProvider>
</configuration>

// tmp/silverlight/53733/Data.xml
<data transition='CrossFadeTransition'>
<album title='Album Title #1' description='Album Description #1'>
<slide title='Slide Title #44398' description='Image 44398 : /f/d/a/520c4779.jpg' image='tmp/f/d/a/520c4779.jpg' thumbnail='tmp/f/d/a/520c4779.jpg' />
<slide title='Slide Title #46450' description='Image 46450 : /d/e/2/b4b40344.jpg' image='tmp/d/e/2/b4b40344.jpg' thumbnail='tmp/d/e/2/b4b40344.jpg' />
<slide title='Slide Title #44697' description='Image 44697 : /f/3/9/23857f3c.jpg' image='tmp/f/3/9/23857f3c.jpg' thumbnail='tmp/f/3/9/23857f3c.jpg' />
<slide title='Slide Title #44931' description='Image 44931 : /c/9/a/033e1b00.jpg' image='tmp/c/9/a/033e1b00.jpg' thumbnail='tmp/c/9/a/033e1b00.jpg' />
<slide title='Slide Title #47275' description='Image 47275 : /4/1/4/b766bb81.jpg' image='tmp/4/1/4/b766bb81.jpg' thumbnail='tmp/4/1/4/b766bb81.jpg' />
<slide title='Slide Title #47812' description='Image 47812 : /6/1/9/65fe3941.jpg' image='tmp/6/1/9/65fe3941.jpg' thumbnail='tmp/6/1/9/65fe3941.jpg' />
<slide title='Slide Title #45529' description='Image 45529 : /f/e/1/4d8d1a06.jpg' image='tmp/f/e/1/4d8d1a06.jpg' thumbnail='tmp/f/e/1/4d8d1a06.jpg' />
</album></data>
Developer
Jan 30, 2008 at 3:16 AM
Hi Sukerman

Keep in mind you dont have to have a physical "configuration.xml" or "data.xml" file. For example, you can also pass in an .ashx to handle creating an xml document for you on the fly. The .asx could easily handle the caching problems by setting its own policies to expire the cache based on querystringparams for example.

Since you are integrating this into an exiting application with its own methodology of where it places the images, I think you would be better creating an .ashx handler that would dynically create the data.xml based on the specifics of the particular user/direcotry etc.