Topic: Separate Settings and Images XML

I have several (dozens) of galleries, so every time I want to change the look of my site, I have to manually recreate and upload every single gallery.xml, even though the images themselves remain exactly the same. This goes against the OO design principles of separating content from presentation.

There is an XML standard called XInclude that you could (should) support. It would allow to xi:include another .xml, as in the following example:

<?xml version="1.0" encoding="utf-8" ?>
<simpleviewergallery
  <xi:include href="/settings.xml"/>
>
<image imageURL="images/dsc_5601.jpg" thumbURL="thumbnails/dsc_5601.jpg" linkURL="" linkTarget="" ><caption>dsc_5601.jpg</caption></image>
//....
</simpleviewergallery>

Thanks,

R.

Re: Separate Settings and Images XML

Thank's for the suggestion.  You don't have to recreate all of your galleries, you can make presets in svBuilder or you can replace the settings at the top of your XMLs using a text editor. If that is not you your like you can set the setting in one place such as your HTML or JavaScript or ActionScript instead of the XMLs.

Mike Richards
SimpleViewer Support Team.

Re: Separate Settings and Images XML

Thanks Mike,

   "Using a text editor" as you mentioned involves the following steps:
1) Change settings to one gallery using svBuilder
2) Open this gallery and copy new settings to clipboard

then:
1) Navigate to another local gallery using Windows Explorer
2) Locate and open gallery.xml in text editor
3) Paste over the new settings from clipboard
4) Save the file
5) Upload the file to the web server using FTP

Repeat this for 48 galleries... (about an hour's work)

Whereas if I had XInclude, I would:

1) Change settings to master gallery using svBuilder
2) Upload master to web server using FTP (about 3 minutes work)

Setting the parameters in HTML or ActionScript doesn't work for me. I like to use svBuilder to see the results immediately. svBuilder cannot generate the HTML or ActionScript commands!

Another way besides XInclude that would work is to simply separate the settings XML from the images XML:

flashvars.gallerySettingsURL = "gallerySettings.xml";
flashvars.galleryImagesURL = "galleryImages.xml";

Please! The user community needs this!

Regards,

Richard

Re: Separate Settings and Images XML

I agree with rblouin, it will simplify the maintenance of galleries. A similar suggestion was posted a while ago: http://www.simpleviewer.net/forum/viewt … p?id=10941

Re: Separate Settings and Images XML

How often do you both change the look and feel of your galleries?

Mike Richards
SimpleViewer Support Team.

Re: Separate Settings and Images XML

The crude answer would be "often enough for it to be a serious pain". The real answer is between once a week and once a month. Once a week for me means up to 2,000 of these "edits" a year.

But there are other issues to consider as well. As a career OO developer, I know from experience that it is not by chance that the world has discovered that it is wise to separate presentation from content. For example, imagine for a moment that you would want the web user (the viewer of your galleries) to parameterize how he wants all the galleries to look. As a PHP or Java developer, you would have to remember these user preferences somewhere, so as to be able to restore them when he logs in. Now, either you devise a convoluted scheme where you somehow store his settings and then dynamically re-create the top portion of all the gallery.xml as he's viewing them, or you simply store them directly as a gallerySettings.xml and just point a flashVars to it. Do you see the advantages?

By the way, the neat way to implement this is not to depreate galleryURL. Keep galleryURL, but add gallerySettingsURL and galleryImagesURL. Setting either one (or both) of the latter would simply override whatever is in the file pointed to by galleryURL. This way you keep backwards compatibility and it makes upgrading svBuilder and svManager much easier.

Thanks again for your interest, and an otherwise excellent product!

Regards,

R.

Last edited by rblouin (2010-08-24 19:21:58)

Re: Separate Settings and Images XML

I agree this is a useful feature. We are investigating adding this in the next version of SimpleViewer.

Felix Turner
SimpleViewer Support Team.