Slide.Show and SharePoint: Part III - Deploy and final config

This is a multi-part series. The other parts can be found at

In part II, I wrote about how to get the data out of SharePoint in a dynamic way using a custom ASP.NET web page which did the hard work for us. The last part of this series is getting that code to work on the SharePoint server. The first step is to create a folder on the server where you will put these files (available at the end of the post). This should be outside your SharePoint directory, something like c:\inetpub\wwwroot\addons would be a good place. Next you need to create a virtual directory on your SharePoint site in IIS which points to that folder. The defaults for the virtual directory will be fine, however from a safety point of view I would recommend it runs in it’s own application pool.

If you just created a ASP.NET application though and put it in there it would fail because the web.config file from SharePoint does some odd things. To get around that you need to few things to it. First clear all the inherited assemblies away (see line 6 below), this has the downside that all the defaults from the machine.config also disappear so you need to add the ones you need back (lines 7 to 13). Next you need to clear all inherited httpModules (see line 19) and lastly you need to increase the trust of this application to full (line 21). Since this is on a virtual directory this has the advantage that you are not messing with the SharePoint config and your SharePoint server will continue to run happily.

   1: <?xml version="1.0"?>
   2: <configuration>
   3:     <system.web>
   4:         <compilation debug="true">
   5:             <assemblies>
   6:                 <clear/>
   7:                 <add assembly="System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
   8:                 <add assembly="System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>
   9:                 <add assembly="System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>
  10:                 <add assembly="System.Web.Services, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>
  11:                 <add assembly="System.Xml, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
  12:                 <add assembly="System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
  13:                 <add assembly="ListMonkey"/>
  14:             </assemblies>
  15:         </compilation>
  16:         <authentication mode="Windows"/>
  17:         <customErrors mode="Off"/>
  18:         <httpModules>
  19:             <clear/>
  20:         </httpModules>
  21:         <trust level="Full"/>
  22:     </system.web>    
  23: </configuration>

That is really all the config you need for the application to run, however don’t forget the config for Slide.Show to run we looked at in parts 1 and 2.

Next up is briefly looking at how the application works. Firstly override render method of the ASP.NET page. In there I do a lot of validation of the inputs which are provided in the query string. This is also an opportunity to set defaults if certain values are not provided. Next, and very importantly, I set the output to be text/xml (this tells the client, in our case JavaScript what to expect). To do this I do:

   1: Response.ContentType = "text/xml";

Then I call the lists web service of SharePoint which returns the results, which are parsed and rendered to XML (I am unfortunately using XMLNode still when I wrote this, instead of the beautiful XElement stuff… but I digress) and to the screen using:

   1: Response.Write(outputDocument.OuterXml);

This XML is in the format Slide.Show expects and so it’s configuration system we setup last time can just use it! All of this gives us a real time integration into SharePoint with Slide.Show!!! :)

As promised the files are available for download. It has occured that the download gets corrupted for some reason, if that is the case I recommend using this download, which is compressed with 7-Zip. NOTE: I have not tested this beyond my own simple tests and your mileage may vary. If you have problems please post a comment here I and will respond.

The files also include the source if you are interested to see what late night coding after months of no coding produces (may not be my finest work… looking over it as I wrote this I felt the need to refractor grow).

Have you tried the code on ie7 / Chrome / Firefox

I am getting it to work only on IE8!

Nope

I can browse to the slideshow.aspx page, but it throws an error. I have the application running on the server such that I view the slideshow.aspx page in a browser (as an attempt to verify that the page is working) and it is throwing a 404 error in the getList function. I've used both a GUID and list name and if I leave out any of the required query string requirements the error returned is that of slideshow.aspx telling me to provide the url (or the list name if that's not provided), so I know the application is up and running. Am I missing something here? It seems like I'm so close to getting this to work.

Thanks (also, if I can get the slideshow.aspx to work, is it the same schema for Slide.Show 2?)

It is most likely that the URL to the list (i.e. the url parameter) is incorrect. The way to test it is to log on to the SharePoint server, and try browse to that URL. That should return a webservice.
rmaclean said: "We don't connect CEWP with the page, we connect Slide.Show with the page." what do you mean by that? My slideshow.aspx gives me a correct xml file and I have tested the flickr sample on my site and verified that it works. However, I do not understand how to use the .xml i get by calling slideshow. Where do I use this, I first thought I could just write in the content editor part (along with the other part of the javascript code): [...] new SlideShow.Control(new SlideShow.XmlConfigProvider({ url: "http://sharepoint/addons/slideshow.aspx?url=http://sharepoint/site/_vti_bin/lists.asmx&list=Photo%20Gallery&group=true&random=false&limit=20" })); [...] But now I see that SlideShow.XmlConfigProvider refers to a configuration.xml. So where do I write: http://sharepoint/addons/slideshow.aspx?url=http://sharepoint/site/_vti_bin/lists.asmx&list=Photo%20Gallery&group=true&random=false&limit=20? I don't want to use a static Data.xml of course, I want the slideshow.aspx to return it to me every time I load the page. It would have been great if I could define the data.xml in the content editor web part so I could use different picture galleries on different sites. Is this possible? And how do I write the configuration.xml? Looking forward to hearing from you! Thanks
Thanks for a great series, with your instructions I have been able to create both the sharepoint components, and the web application to create structure the data as required. Both parts are working great independantly that being, the sharepoint CEWP displays the samples properly, and I can place a call to the ASP.NET webpage and get the data structure returned to me in the page.
Hello Robert, Thank you very much for the post. Do you recommend any approach to display multiple albums? Slide.Show 2 has a feature to display multiple albums. How can we modify the SlideShow.aspx.cs to render multiple album? Thanks again. Regards, OakMan
NOTE: throughout this document, I use square brackets "[ ]" instead of the less than/greater than symbols normally used in XML files "< >" so that my code will show up in this comment properly, as my code was getting stripped out by the filtering applied to the comments. The way Slide.Show is set up, if you change the Configuration.xml file to use a seperate Data.xml file (by adding the line: [dataProvider type="XmlDataProvider" /] at the end of your Configuration.xml file), it will look for that Data.xml file in the same location as the page calling the SlideShow library. For some of us who work with SharePoint but don't have physical access to the server SharePoint is running on, this becomes an impossible feat. After doing a little bit of searching, I found that you can override the default location the Configuration file wants to try and load Data.xml from by expanding the "dataProvider" node like so: [dataProvider type="XmlDataProvider"] [option name="url" value="http://[your SP site]/[your sp document library]/Data.xml" /] [/dataProvider] NOTICE that the initial [dataProvider] statement no longer ends with "/]" and is a more traditional [tag][/tag] pair now. If you are having pathing issues while refering to image locations within Data.xml, you can use full-blown urls to reference your images in that file and it works fine: [slide title="Test Slide Title #2" description="Slide Description #2" image="http://[your sp site]/[your picture library]/image.jpg" thumbnail="http://[your sp site]/[your picture library]/_t/image_jpg.jpg" /] NOTICE that SharePoint will automatically make thumbnail images when you upload your pictures into a picture library, and it places them in a special sub-directory off of your main picture library called "/_t/". It will also create a new name for your thumbnail version of your image like so: ORIGINAL IMAGE: image.jpg THUMBNAIL IMAGE: image_jpg.jpg ORIGINAL IMAGE: image.gif THUMBNAIL IMAGE: image_gif.gif Just what I discovered when working with this product today. The tutorial totally had me on the right path for success so thank you very much for this!
Very cool - thanks for sharing
Please fix this as I am very keen to get this up and running on my website I use with family for our family tree. Simply want them to be able to see pics randomly from my picture library
There is two download links a zip one and a 7z one. Grab the 7z one if you are also having the problem as it doesn't get corrupted when downloading like the zip one seems to.
Hello sir I have a small problem. after I upload and downloaded via the browser (download via FTP is fine) it somehow goes from a normal zip to a gzip file?! It may be proxy or browser related, or maybe something on the server
There is two download links a zip one and a 7z one. Grab the 7z one if you are also having the problem as it doesn't get corrupted when downloading like the zip one seems to.
Its realy good,very helper thanks. .

[...] will just make things like Slide.Show integration or jQuery integration so much [...]

http://www.sadev.co.za/files/blogimages/Sli.ShowandSharePointPartIIIDeployandfin_CB8B/Slide.Show.Demo.zip Robert, I kindly ask you to look into and fix the following link. I am still not able to open the archive zip. Would you please redo and and post it. Using Winzip 11.2 Thank you Jim Houston
It's very odd, the file is fine on my machine. But after it is uploaded and downloaded via the browser (download via FTP is fine) it somehow goes from a normal zip to a gzip file?! It may be proxy or browser related, or maybe something on the server. I don't know. What I have done is uploaded another version of the files in 7Zip format which don't seem to have this problem. You can get the files from: http://www.sadev.co.za/files/blogimages/Sli.ShowandSharePointPartIIIDeployandfin_CB8B/slide.show.7z 7-Zip can be downloaded for free from www.7-zip.org
Hey there! Thanks for a great series, with your instructions I have been able to create both the sharepoint components, and the web application to create structure the data as required. Both parts are working great independantly (that being, the sharepoint CEWP displays the samples properly, and I can place a call to the ASP.NET webpage and get the data structure returned to me in the page.) Now here's the part where I feel stupid, because I have been going over this for the better part of a week now, and I know I have to be missing something simple and it's staring me directly in the face. How do I connect the two? How do I get the CEWP in Sharepoint, to consume the data provided by the ASP.NET web page? Thanks in advance for any assistance that you can provide! Jay
In part two when you configure Slide.Show you are able to tell it where to get the XML file with the list of images to show and we use a URL to the ASP.NET page to do it. We don't connect CEWP with the page, we connect Slide.Show with the page.
I like others have been trying to understand Part II. Your indicate you have created an asp.net file call slideshow.aspx and place it in the "addon" directory under your IIS as a virtual directory etc. You have also place in that directory a new machine.config file. I am assuming in the end the javascript place in the content editor will point to have the slide.show data provider point to this new slideshow.aspx page. The problem is the zip file you put up that has the files you speak about does not open properly. I have to download it from a couple of locations that had winzip on them vers 10 and 11 and it is telling me your file is not valid. Please fix this as I am very keen to get this up and running on my website I use with family for our family tree. Simply want them to be able to see pics randomly from my picture library. Thanks Jim
In part two when you configure Slide.Show you are able to tell it where to get the XML file with the list of images to show and we use a URL to the ASP.NET page to do it. We don't connect CEWP with the page, we connect Slide.Show with the page.

[...] Slide.Show and SharePoint: Part III – Deploy and final config [...]

[...] Slide.Show and SharePoint: Part III – Deploy and final config [...]

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

Post new comment

The content of this field is kept private and will not be shown publicly. If you have a Gravatar account associated with the e-mail address you provide, it will be used to display your avatar.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.
  • Syntax highlight code surrounded by the <pre class="brush: lang">...</pre> tags, where lang is one of the following language brushes: as3, applescript, bash, csharp, coldfusion, cpp, css, delphi, diff, erlang, groovy, jscript, java, javafx, perl, php, plain, powershell, python, ruby, sass, scala, sql, vb, xml.

More information about formatting options