<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Dave Cavins &#187; web services</title>
	<atom:link href="http://davecavins.com/tag/web-services/feed/" rel="self" type="application/rss+xml" />
	<link>http://davecavins.com</link>
	<description>web design, SharePoint customization &#38; random stuff</description>
	<lastBuildDate>Tue, 27 Dec 2011 14:22:18 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
		<item>
		<title>Image Slideshow with captions</title>
		<link>http://davecavins.com/2009/11/slideshow-with-captions/</link>
		<comments>http://davecavins.com/2009/11/slideshow-with-captions/#comments</comments>
		<pubDate>Tue, 10 Nov 2009 17:12:01 +0000</pubDate>
		<dc:creator>davecavins</dc:creator>
				<category><![CDATA[General SharePoint]]></category>
		<category><![CDATA[SharePoint Design]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[SharePoint]]></category>
		<category><![CDATA[slideshow]]></category>
		<category><![CDATA[web services]]></category>
		<category><![CDATA[webparts]]></category>

		<guid isPermaLink="false">http://davecavins.com/?p=245</guid>
		<description><![CDATA[This is a very simple image slide show script that uses jQuery, SharePoint webservices and the default images library to show images with captions. All the content is pulled from default fields in the images library but feel free to add more fields and customize the code to fit your needs.  Setup To get this [...]


Related posts:<ol><li><a href='http://davecavins.com/2009/07/annoucement-slider-using-web-services/' rel='bookmark' title='Annoucements Slider using SP Web Services'>Annoucements Slider using SP Web Services</a></li>
<li><a href='http://davecavins.com/2009/10/suggestions-foto-the-sharepoint-search-box-part-2/' rel='bookmark' title='Adding Suggestions to the Sharepoint search box : Part 2'>Adding Suggestions to the Sharepoint search box : Part 2</a></li>
<li><a href='http://davecavins.com/2009/11/sharepoint-vertical-news-ticker/' rel='bookmark' title='SharePoint Vertical News Ticker'>SharePoint Vertical News Ticker</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>This is a very simple image slide show script that uses jQuery, SharePoint webservices and the default images library to show images with captions. All the content is pulled from default fields in the images library but feel free to add more fields and customize the code to fit your needs. </p>
<div id="attachment_331" class="wp-caption aligncenter" style="width: 464px"><img class="size-full wp-image-331" title="slideshow" src="http://davecavins.com/wp-content/uploads/2009/10/slideshow.jpg" alt="Slide show with captions" width="454" height="301" /><p class="wp-caption-text">Slide show with captions</p></div>
<p><span id="more-245"></span></p>
<h2>Setup</h2>
<p>To get this slideshow up and running there are a few things we have to do to prepare.</p>
<ol>
<li>Create a standard image library.  You can add additional fields if needed but the list needs to have all of the out of the box fields.</li>
<li><a href="http://jquery.com" target="_blank" rel="nofollow">Get jQuery</a>.  Either link to the <a href="http://ajax.googleapis.com/ajax/libs/jquery/1.3.1/jquery.min.js" target="_blank" rel="nofollow">latest version from Google</a> or download it and put it in a location on your server.</li>
<li><a href="http://www.serie3.info/s3slider/index.php" target="_blank">Download the s3 slider plugin</a> and put it somewhere on your server.</li>
</ol>
<h2>Querying the SharePoint List</h2>
<p>I am using the <a href="http://weblogs.asp.net/jan/archive/2009/05/06/querying-sharepoint-list-items-using-jquery.aspx" rel="nofollow" target="_blank">techniques described by Jan Tielnes</a> for querying SP lists with javascript.  Here is the code.</p>
<pre class="brush: jscript; title: ; notranslate">
&lt;script type=&quot;text/javascript&quot; language=&quot;javascript&quot; src=&quot;Scripts/jquery-1[1].3.2.min.js&quot;&gt;&lt;/script&gt;
&lt;script type=&quot;text/javascript&quot; language=&quot;javascript&quot; src=&quot;Scripts/s3Slider.js
&quot;&gt;&lt;/script&gt;
&lt;script type=&quot;text/javascript&quot;&gt;
    $(document).ready(function() {
        var soapEnv =
            &quot;&lt;soapenv:Envelope xmlns:soapenv='http://schemas.xmlsoap.org/soap/envelope/'&gt; \
                &lt;soapenv:Body&gt; \
                     &lt;GetListItems xmlns='http://schemas.microsoft.com/sharepoint/soap/'&gt; \
                        &lt;listName&gt;Pictures&lt;/listName&gt; \
                         &lt;viewFields&gt; \
                            &lt;ViewFields&gt; \
                               &lt;FieldRef Name='Title' /&gt; \
                               &lt;FieldRef Name='FileDirRef' /&gt; \
                               &lt;FieldRef Name='NameOrTitle' /&gt; \
                               &lt;FieldRef Name='FileRef' /&gt; \
                               &lt;FieldRef Name='ID' /&gt; \
                               &lt;FieldRef Name='Description' /&gt; \
                               &lt;FieldRef Name='FileType' /&gt; \
                           &lt;/ViewFields&gt; \
                        &lt;/viewFields&gt; \
                    &lt;/GetListItems&gt; \
                &lt;/soapenv:Body&gt; \
            &lt;/soapenv:Envelope&gt;&quot;;
        $.ajax({
            url: &quot;_vti_bin/lists.asmx&quot;,
            type: &quot;POST&quot;,
            dataType: &quot;xml&quot;,
            data: soapEnv,
            complete: processResult,
            contentType: &quot;text/xml; charset=\&quot;utf-8\&quot;&quot;
        });
    });
    function processResult(xData, status) {
        $(xData.responseXML).find(&quot;z\\:row&quot;).each(function() {
            var urlValue = $(this).attr(&quot;ows_FileDirRef&quot;);
                                                var urlArray;
                                                var urlName;
                                                     if (urlValue == undefined)
                                {
                                urlName = &quot;- - -&quot;;
                }
                else {
                                urlArray = urlValue.split(&quot;;#&quot;);
                                urlName= urlArray[1];
                }
                                                var thumbUrl = $(this).attr(&quot;ows_NameOrTitle&quot;);
                                                var thumbArray;
                                                var thumb;          

                                                     if (thumbUrl == undefined)
                                {
                                thumb = &quot;- - -&quot;;
                }
                else {
                                thumbArray = thumbUrl.split(&quot;.&quot;);
                                thumb= thumbArray[0];
                }
            var liHtml = &quot;&lt;li class='s3sliderImage'&gt;&lt;img src='/&quot; + urlName + &quot;/_w/&quot; + thumb +&quot;_&quot; + $(this).attr(&quot;ows_FileType&quot;) + &quot;.jpg'/&gt;&lt;span&gt;&lt;a href='&quot; + urlName + thumb + &quot;.&quot; + $(this).attr(&quot;ows_FileType&quot;) + &quot;'&gt;View Larger&lt;/a&gt;&lt;h3&gt;&quot; + $(this).attr(&quot;ows_Title&quot;) + &quot;&lt;/h3&gt;&quot; + $(this).attr(&quot;ows_Description&quot;) + &quot;&lt;/span&gt;&lt;/li&gt;&quot;;
            $(&quot;#s3sliderContent&quot;).append(liHtml);
        });
        $('#s3slider').s3Slider({timeOut: 4000 });
}
&lt;/script&gt;
&lt;div id=&quot;s3slider&quot; &gt;
   &lt;ul id=&quot;s3sliderContent&quot; /&gt;
&lt;/div&gt;
</pre>
<h3>Configuring the query.</h3>
<p>In the code above I am querying a list named &#8216;Pictures&#8217; and returning the title, link to the file, file name, file type, description and the ID. To change the name of the list just update this tag with the appropriate list name.</p>
<pre class="brush: plain; title: ; notranslate">&lt;listName&gt;Name of the List you want to use&lt;/listName&gt;</pre>
<p><strong>Note:</strong> If you have renamed a default Image library the name may not have actually changed from SharePoint&#8217;s perspective so double check by browsing to the list and reading the URL string.</p>
<p>If you want to include data from other fields in the html output just add the field names to the &#8216;ViewFields&#8217; section of the soap envelope.</p>
<pre class="brush: plain; title: ; notranslate"> &lt;FieldRef Name='NameOfField' /&gt; \</pre>
<p>You will also need to add a reference to the field in the &#8216;liHtml&#8217; variable. When referencing fields in the variable remember to put &#8216;ows_&#8217; in front of the field name.</p>
<p>Remember the field name that is displayed through the SharePoint UI is not always the real field name.  In this post <a title="Find field names in SharePoint" rel="nofollow" href="http://www.heathersolomon.com/blog/articles/CustomItemStyle.aspx" target="_blank">Heather Solomon describes a good way to find the real field names</a>.</p>
<h2>The CSS</h2>
<p>I made a few changes to the CSS to set the size of the slideshow and the colors and fonts for the captions</p>
<pre class="brush: css; title: ; notranslate">
 #s3slider {width: 450px; height: 300px; position: relative; overflow: hidden; border:1px solid #666;}
#s3sliderContent {width: 450px; position: absolute; top: 0; margin-left: 0;}
.s3sliderImage {float: left; position: relative; display: none;}
.s3sliderImage span {
   position: absolute;
   left: 0;
   font: 10px/15px Arial, Helvetica, sans-serif;
   padding: 5px 13px;
   width: 449px;
   background-color: #fff;
   filter: alpha(opacity=70);
   -moz-opacity: 0.7;
   -khtml-opacity: 0.7;
   opacity: 0.7;
   color: #000;
   display: none;
   top: 0;
}
.s3sliderImage span h3{margin:1px;	padding:1px; font:normal italic 18px/14px Georgia, serif;}
.s3sliderImage span a{float:right;color:#fff;background:#333;padding:2px;text-decoration:none;margin-top:5px;}
.clear {clear: both;}
</pre>
<p><a href="http://davecavins.com/wp-content/uploads/2009/11/ImageSlideShowWithCaptions.dwp" target="_blank" rel="nofollow">Download all the the code in a .dwp here</a></p>


<p>Related posts:<ol><li><a href='http://davecavins.com/2009/07/annoucement-slider-using-web-services/' rel='bookmark' title='Annoucements Slider using SP Web Services'>Annoucements Slider using SP Web Services</a></li>
<li><a href='http://davecavins.com/2009/10/suggestions-foto-the-sharepoint-search-box-part-2/' rel='bookmark' title='Adding Suggestions to the Sharepoint search box : Part 2'>Adding Suggestions to the Sharepoint search box : Part 2</a></li>
<li><a href='http://davecavins.com/2009/11/sharepoint-vertical-news-ticker/' rel='bookmark' title='SharePoint Vertical News Ticker'>SharePoint Vertical News Ticker</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://davecavins.com/2009/11/slideshow-with-captions/feed/</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
		<item>
		<title>Annoucements Slider using SP Web Services</title>
		<link>http://davecavins.com/2009/07/annoucement-slider-using-web-services/</link>
		<comments>http://davecavins.com/2009/07/annoucement-slider-using-web-services/#comments</comments>
		<pubDate>Fri, 17 Jul 2009 17:00:12 +0000</pubDate>
		<dc:creator>davecavins</dc:creator>
				<category><![CDATA[SharePoint Design]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[SharePoint]]></category>
		<category><![CDATA[web services]]></category>

		<guid isPermaLink="false">http://davecavins.com/?p=146</guid>
		<description><![CDATA[This is a simple news slider I put together using SharePoint web services, jQuery and the Easy Slider Plugin from CSS Globe. You can get the plugin here. The Web Part points to the local site&#8217;s Annoucements list and display the title, body and a link to view the item. The jQuery connection to the [...]


Related posts:<ol><li><a href='http://davecavins.com/2009/11/sharepoint-vertical-news-ticker/' rel='bookmark' title='SharePoint Vertical News Ticker'>SharePoint Vertical News Ticker</a></li>
<li><a href='http://davecavins.com/2009/11/slideshow-with-captions/' rel='bookmark' title='Image Slideshow with captions'>Image Slideshow with captions</a></li>
<li><a href='http://davecavins.com/2009/05/dynamic-drive-featured-content-slider-v24-in-sharepoint/' rel='bookmark' title='Dynamic Drive&#8217;s Featured Content Slider in Sharepoint'>Dynamic Drive&#8217;s Featured Content Slider in Sharepoint</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>This is a simple news slider I put together using SharePoint web services, jQuery and the Easy Slider Plugin from CSS Globe. You can <a href="http://cssglobe.com/post/4004/easy-slider-15-the-easiest-jquery-plugin-for-sliding" target="_blank">get the plugin here</a>. The Web Part points to the local site&#8217;s Annoucements list and display the title, body and a link to view the item. The jQuery connection to the SharePoint web service is based on code from <a href="http://weblogs.asp.net/jan/default.aspx" target="_blank">Jan Tielens</a>.</p>
<p><img class="aligncenter" src="http://davecavins.com/wp-content/uploads/2009/07/slider.jpg" alt="" width="500" height="232" /></p>
<p><span id="more-146"></span></p>
<h2>Installation</h2>
<p><strong>4 simple steps.</strong></p>
<ol>
<li>Paste the code below into a Content Editor Web Part (CEWP) on your page.</li>
<li>Change the link to jQuery if needed. The code references the jQuery library on Google Code so if you are working in an isolated environment or already have jQuery on your server just change the link (its on the first line).</li>
<li>Put the Easy Slider code in a document library and adjust the link to it on the second line of the code.</li>
<li>Update the CSS to match your site (The CSS can be moved to an external file or added to your custom theme).</li>
</ol>
<h2>Code</h2>
<p><a href="http://davecavins.com/wp-content/uploads/2009/07/AnnouncementsSlider.dwp" target="_blank">Download the .dwp here</a></p>
<pre class="brush: plain; title: ; notranslate">
/*Link to jQuery change this to point to where you have the jQuery files */
&lt;script type=&quot;text/javascript&quot; src=&quot;js/jquery-1.3.2.min.js&quot;&gt;&lt;/script&gt;
/*Change this to point to the plugin file on your sever */
&lt;script type=&quot;text/javascript&quot; src= js/easySlider1.5.js&gt;&lt;/script&gt;
&lt;script type=&quot;text/javascript&quot;&gt;
       $(document).ready(function() {
        var soapEnv =
            &quot;&lt;soapenv:Envelope xmlns:soapenv='http://schemas.xmlsoap.org/soap/envelope/'&gt; \
                &lt;soapenv:Body&gt; \
                     &lt;GetListItems xmlns='http://schemas.microsoft.com/sharepoint/soap/'&gt; \
                        &lt;listName&gt;Announcements&lt;/listName&gt; \
                         &lt;viewFields&gt; \
                            &lt;ViewFields&gt; \
                               &lt;FieldRef Name='Title' /&gt; \
                               &lt;FieldRef Name='Body' /&gt; \
                               &lt;FieldRef Name='ID' /&gt; \
				&lt;FieldRef Name='FileDirRef' /&gt; \
                           &lt;/ViewFields&gt; \
                        &lt;/viewFields&gt; \
                    &lt;/GetListItems&gt; \
                &lt;/soapenv:Body&gt; \
            &lt;/soapenv:Envelope&gt;&quot;;

        $.ajax({
            url: &quot;_vti_bin/lists.asmx&quot;,
            type: &quot;POST&quot;,
            dataType: &quot;xml&quot;,
            data: soapEnv,
            complete: processResult,
            contentType: &quot;text/xml; charset=\&quot;utf-8\&quot;&quot;
        });
    });

    function processResult(xData, status) {
        $(xData.responseXML).find(&quot;z\\:row&quot;).each(function() {
        	var teaser = $(this).attr(&quot;ows_Body&quot;);
        	var teaserText = teaser.slice(0,500);
        	var urlValue = $(this).attr(&quot;ows_FileDirRef&quot;);
			var urlArray;
			var urlName;
			     if (urlValue == undefined)
	    	{
      		urlName = &quot;- - -&quot;;
        	}
        	else {
        		urlArray = urlValue.split(&quot;;#&quot;);
        		urlName= urlArray[1];
        	}

            var liHtml = &quot;&lt;li&gt;&lt;h5&gt;&quot;	+ $(this).attr(&quot;ows_Title&quot;) + &quot;&lt;/h5&gt;&lt;p&gt;&quot; + teaserText +
            &quot;&lt;br/&gt;&lt;a class='readMore' href='/&quot; + urlName + &quot;/Dispform.aspx?ID=&quot; + + $(this).attr(&quot;ows_ID&quot;) + &quot;'&gt;Read More&lt;a/&gt;&lt;/p&gt;&lt;/li&gt;&quot;;
            $(&quot;#tasksUL&quot;).append(liHtml);
        });
        $(&quot;#slider&quot;).easySlider({
			controlsBefore:	'&lt;div id=&quot;controls2&quot;&gt;',
			controlsAfter:	'&lt;/div&gt;',
			auto: true,
			continuous: true,
			//vertical: true,
			prevText: '&lt; Prev',
			nextText: 'Next &gt;',
			speed: 1000,
			pause: 4000
			});
        }
&lt;/script&gt;
&lt;style type=&quot;text/css&quot;&gt;
#slider{font-size:x-small; background:#E2EFFF;}
#slider h5{padding:5px; font-size:small; color:#315F9B; letter-spacing:-1px; line-height:20px;margin:0px;}
#slider div {font-size: x-small; padding:0px; margin:3px;}
#slider ul, #slider li{margin:0; padding:0; list-style:none;}
#slider li{width:600px;	height:241px; overflow:hidden; padding:0px;}
#controls2 {padding:3px 0 0 0; text-align:right; width:600px;}
.readMore {margin:3px;padding:2px;background:#F7FBFF;}
#prevBtn, #nextBtn{}
#nextBtn{}
#prevBtn a, #nextBtn a{font-size:x-small;}
#nextBtn a{}
&lt;/style&gt;
   	&lt;div id=&quot;slider&quot;&gt;
		&lt;ul id=&quot;tasksUL&quot;/&gt;
	&lt;/div&gt;
</pre>
<h2>Enjoy</h2>
<p><strong>Notes</strong><br />
Announcements with really long bodies will get cut off because the div that holds the contents has a fixed height. This can be adjusted in the CSS. Long titles could also cause a problem if they wrap to multiple lines. One other thing to watch out for is inline styles applied by the WYSIWYG editor on the body of the announcement. They can override the default styles and cause items to look different.</p>
<p><strong>Changing whats displayed</strong><br />
To change which fields are displayed edit the section and add a tag for the fields you want to reference. If you have customized your list or renamed fields the names that appear on the column headings and on the list settings page may not be correct. The fastest way to find the real name of a field is to go to the list settings page and click on the name of the column to edit it. On the edit page look at the very end of the URL and it will say Field=[real name of your field].</p>
<p>Once you have edited the added the all you need to do is edit the liHtml var to include the new field in the output html. To show the field just use this $(this).attr(&#8220;ows_MyFieldName&#8221;).</p>
<p><strong>Upate</strong><br />
New Stlyes for the slider. A little less grey and will match better with a default SharePoint theme</p>
<pre class="brush: css; title: ; notranslate">&lt;style type=&quot;text/css&quot;&gt;
#slider{font-size:x-small; background:#E2EFFF;}
#slider h5{padding:5px; font-size:small; color:#315F9B;
letter-spacing:-1px; line-height:20px;margin:0px;}
#slider div {font-size: x-small; padding:0px; margin:3px;}#slider ul, #slider li{margin:0; padding:0; list-style:none;}#slider li{width:600px;	height:241px; overflow:hidden; padding:0px;}#controls2 {padding:3px 0 0 0; text-align:right; width:600px;}.readMore {margin:3px;padding:2px;background:#F7FBFF;}#prevBtn, #nextBtn{}#nextBtn{}#prevBtn a, #nextBtn a{font-size:x-small;}#nextBtn a{}&lt;/style&gt;</pre>
<p><strong>Conclusion</strong><br />
This is very basic but provides some nice functionality and can be easily styled to match your site. Because it uses the web service instead of a data view webpart it is portable and will work on any site with an announcements list. With some more work on the JavaScript it would be simple to limit the amount of text from the body that is displayed.</p>


<p>Related posts:<ol><li><a href='http://davecavins.com/2009/11/sharepoint-vertical-news-ticker/' rel='bookmark' title='SharePoint Vertical News Ticker'>SharePoint Vertical News Ticker</a></li>
<li><a href='http://davecavins.com/2009/11/slideshow-with-captions/' rel='bookmark' title='Image Slideshow with captions'>Image Slideshow with captions</a></li>
<li><a href='http://davecavins.com/2009/05/dynamic-drive-featured-content-slider-v24-in-sharepoint/' rel='bookmark' title='Dynamic Drive&#8217;s Featured Content Slider in Sharepoint'>Dynamic Drive&#8217;s Featured Content Slider in Sharepoint</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://davecavins.com/2009/07/annoucement-slider-using-web-services/feed/</wfw:commentRss>
		<slash:comments>21</slash:comments>
		</item>
	</channel>
</rss>

