<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss 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/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">

<channel>
	<title>Edwin Vriethoff</title>
	
	<link>http://edwin.vriethoff.net</link>
	<description>Edwin Vriethoff</description>
	<lastBuildDate>Fri, 04 Jun 2010 06:16:41 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/EdwinDotNet" /><feedburner:info uri="edwindotnet" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><feedburner:feedFlare href="http://add.my.yahoo.com/rss?url=http%3A%2F%2Ffeeds.feedburner.com%2FEdwinDotNet" src="http://us.i1.yimg.com/us.yimg.com/i/us/my/addtomyyahoo4.gif">Subscribe with My Yahoo!</feedburner:feedFlare><feedburner:feedFlare href="http://www.newsgator.com/ngs/subscriber/subext.aspx?url=http%3A%2F%2Ffeeds.feedburner.com%2FEdwinDotNet" src="http://www.newsgator.com/images/ngsub1.gif">Subscribe with NewsGator</feedburner:feedFlare><feedburner:feedFlare href="http://feeds.my.aol.com/add.jsp?url=http%3A%2F%2Ffeeds.feedburner.com%2FEdwinDotNet" src="http://o.aolcdn.com/favorites.my.aol.com/webmaster/ffclient/webroot/locale/en-US/images/myAOLButtonSmall.gif">Subscribe with My AOL</feedburner:feedFlare><feedburner:feedFlare href="http://www.bloglines.com/sub/http://feeds.feedburner.com/EdwinDotNet" src="http://www.bloglines.com/images/sub_modern11.gif">Subscribe with Bloglines</feedburner:feedFlare><feedburner:feedFlare href="http://www.netvibes.com/subscribe.php?url=http%3A%2F%2Ffeeds.feedburner.com%2FEdwinDotNet" src="http://www.netvibes.com/img/add2netvibes.gif">Subscribe with Netvibes</feedburner:feedFlare><feedburner:feedFlare href="http://fusion.google.com/add?feedurl=http%3A%2F%2Ffeeds.feedburner.com%2FEdwinDotNet" src="http://buttons.googlesyndication.com/fusion/add.gif">Subscribe with Google</feedburner:feedFlare><feedburner:feedFlare href="http://www.pageflakes.com/subscribe.aspx?url=http%3A%2F%2Ffeeds.feedburner.com%2FEdwinDotNet" src="http://www.pageflakes.com/ImageFile.ashx?instanceId=Static_4&amp;fileName=ATP_blu_91x17.gif">Subscribe with Pageflakes</feedburner:feedFlare><feedburner:browserFriendly>A blog with tips and info about .NET, C# , Sharepoint en BizTalk written by Edwin Vriethoff.</feedburner:browserFriendly><item>
		<title>How to get a good visual presentation of the SharePoint 2010 Visio Web Access web part.</title>
		<link>http://feedproxy.google.com/~r/EdwinDotNet/~3/QNqMMWo3nWk/</link>
		<comments>http://edwin.vriethoff.net/2010/06/03/how-to-get-a-good-visual-presentation-of-the-sharepoint-2010-visio-web-access-web-part/#comments</comments>
		<pubDate>Thu, 03 Jun 2010 15:27:02 +0000</pubDate>
		<dc:creator>Edwin Vriethoff</dc:creator>
				<category><![CDATA[BizTalk]]></category>
		<category><![CDATA[2010]]></category>
		<category><![CDATA[KPI]]></category>
		<category><![CDATA[Office]]></category>
		<category><![CDATA[Positioning]]></category>
		<category><![CDATA[rendering]]></category>
		<category><![CDATA[settings]]></category>
		<category><![CDATA[Visio]]></category>
		<category><![CDATA[web part]]></category>
		<category><![CDATA[xml]]></category>

		<guid isPermaLink="false">http://edwin.vriethoff.net/?p=443</guid>
		<description><![CDATA[A great new feature of SharePoint 2010, is the online rendering of Visio forms. It allows you to visualize process status information and it also offers more advanced options for KPI visualization.
However, the default display behavior of the Visio Web Access part is a bit nasty, especially when you try to display information inline of [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://edwin.vriethoff.net/wp-content/visio_logo.png" alt="visio_logo" title="visio_logo" width="77" height="77" class="alignnone size-full wp-image-451" align="left"/>A great new feature of SharePoint 2010, is the online rendering of Visio forms. It allows you to visualize process status information and it also offers more advanced options for KPI visualization.</p>
<p>However, the default display behavior of the Visio Web Access part is a bit nasty, especially when you try to display information inline of the page. The content position of the Visio document is positioned completely wrong and the user has to correct the zoom or even has to drag the information. As you can see in the example below, my Visio information is shown incorrectly.</p>
<p><a href="http://edwin.vriethoff.net/wp-content/visio_display_problem.png"  target="_blank"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="visio_display_problem" src="http://edwin.vriethoff.net/wp-content/visio_display_problem_thumb.png" border="0" alt="visio_display_problem" width="320" height="217" /></a></p>
<p>This problem can be fixed by modifying the XML configuration of the web part. Before you can modify the XML configuration, make sure you enable the checkbox of the web part option &#8220;Override the Web Drawing&#8217;s default initial view using the web part&#8217;s current page, pan and zoom&#8221;. Never turn off this option again, because it will completely reset the view settings in the xml.</p>
<p><a href="http://edwin.vriethoff.net/wp-content/visio_display_problem_webpart_settings.png"  target="_blank"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="visio_display_problem_webpart_settings" src="http://edwin.vriethoff.net/wp-content/visio_display_problem_webpart_settings_thumb.png" border="0" alt="visio_display_problem_webpart_settings" width="209" height="320" /></a></p>
<p>After you have saved the web part with the override setting, export it to your desktop and open it in an editor. Notepad will do fine. Search inside the XML for a property called &#8220;ViewSettings&#8221;.</p>
<div class="code">
&lt;property name=&#8221;HelpUrl&#8221; type=&#8221;string&#8221; /&gt;<br />
&lt;property name=&#8221;ExportMode&#8221; type=&#8221;exportmode&#8221;&gt;All&lt;/property&gt;</p>
<div style='background-color: yellow;'>&lt;property name=&#8221;ViewSettings&#8221; type=&#8221;string&#8221;&gt;{&#8221;pageIndex&#8221;:0,&#8221;viewBounds&#8221;:{&#8221;x&#8221;:120,&#8221;y&#8221;:0,&#8221;width&#8221;:489, &#8220;height&#8221;:175},&#8221;zoomValue&#8221;:90}&lt;/property&gt;</div>
<p>&lt;property name=&#8221;OverrideViewSettings&#8221; type=&#8221;bool&#8221;&gt;True&lt;/property&gt;<br />
&lt;property name=&#8221;AllowClose&#8221; type=&#8221;bool&#8221;&gt;True&lt;/property&gt;
</p></div>
<p>This property allows you to alter the default display option of the web part, but only when the property &#8220;OverrideViewSettings&#8221; is set to true. Try to play around with the X and Y setting and perhaps the zoomValue. Save the web part file and import it again to your page. You might have to repeat the process a few times to get it right, but after a few tries the web part will show your information correctly. This way Visio is a great option to show KPI information.</p>
<p><a href="http://edwin.vriethoff.net/wp-content/visio_display_problem_corrected.png"  target="_blank"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="visio_display_problem_corrected" src="http://edwin.vriethoff.net/wp-content/visio_display_problem_corrected_thumb.png" border="0" alt="visio_display_problem_corrected" width="320" height="208" /></a></p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/EdwinDotNet?a=QNqMMWo3nWk:xAggM9SRYLY:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/EdwinDotNet?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/EdwinDotNet?a=QNqMMWo3nWk:xAggM9SRYLY:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/EdwinDotNet?i=QNqMMWo3nWk:xAggM9SRYLY:D7DqB2pKExk" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/EdwinDotNet?a=QNqMMWo3nWk:xAggM9SRYLY:7Q72WNTAKBA"><img src="http://feeds.feedburner.com/~ff/EdwinDotNet?d=7Q72WNTAKBA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/EdwinDotNet?a=QNqMMWo3nWk:xAggM9SRYLY:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/EdwinDotNet?i=QNqMMWo3nWk:xAggM9SRYLY:F7zBnMyn0Lo" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/EdwinDotNet/~4/QNqMMWo3nWk" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://edwin.vriethoff.net/2010/06/03/how-to-get-a-good-visual-presentation-of-the-sharepoint-2010-visio-web-access-web-part/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://edwin.vriethoff.net/2010/06/03/how-to-get-a-good-visual-presentation-of-the-sharepoint-2010-visio-web-access-web-part/</feedburner:origLink></item>
		<item>
		<title>Unleash extra power to SharePoint 2007 Workflows</title>
		<link>http://feedproxy.google.com/~r/EdwinDotNet/~3/2Y2FeKdlgxg/</link>
		<comments>http://edwin.vriethoff.net/2010/04/04/unleash-extra-power-to-sharepoint-2007-workflows/#comments</comments>
		<pubDate>Sun, 04 Apr 2010 12:06:25 +0000</pubDate>
		<dc:creator>Edwin Vriethoff</dc:creator>
				<category><![CDATA[SharePoint]]></category>
		<category><![CDATA[Tools]]></category>
		<category><![CDATA[action]]></category>
		<category><![CDATA[demo]]></category>
		<category><![CDATA[sharepoint designer]]></category>
		<category><![CDATA[tutorial]]></category>
		<category><![CDATA[webservice]]></category>
		<category><![CDATA[workflow]]></category>
		<category><![CDATA[xml]]></category>
		<category><![CDATA[xpath]]></category>

		<guid isPermaLink="false">http://edwin.vriethoff.net/?p=384</guid>
		<description><![CDATA[I&#8217;m very enthusiastic about the Nintex Workflow product. With Nintex Workflow it is possible to build very advanced workflows. The downside of course, is that that Nintex is a 3rd party product and therefore it isn&#8217;t available in all my projects. In that case I will have to rely on the normal SharePoint Designer Workflows.
The [...]]]></description>
			<content:encoded><![CDATA[<p><img title="unleash_power_to_sharepoint_workflows" src="http://edwin.vriethoff.net/wp-content/unleash_power_to_sharepoint_workflows.png" alt="unleash_power_to_sharepoint_workflows" width="140" height="105" align="right" />I&#8217;m very enthusiastic about the Nintex Workflow product. With Nintex Workflow it is possible to build very advanced workflows. The downside of course, is that that Nintex is a 3rd party product and therefore it isn&#8217;t available in all my projects. In that case I will have to rely on the normal SharePoint Designer Workflows.</p>
<p>The problem with normal workflow actions is that they are designed to work inside a single web. It is not possible, for example, to create a new list item in a different web. Creating list items in different webs is a very powerful feature, because it allows us to interact with different site areas and we might also want to initiate new workflows over there.</p>
<p>To overcome the short come of these standard workflow actions, we can use the SharePoint web services. But there is one major problem: SharePoint Designer Workflows don&#8217;t have a workflow action that allows you to call SharePoint web services.</p>
<p>Luckily I found a project at CodePlex which allows us to do just that. The <a href="http://ilovesharepoint.codeplex.com/" onclick="javascript:pageTracker._trackPageview('/outbound/article/ilovesharepoint.codeplex.com');" target="_blank">iLoveSharePoint</a> project contains a subproject with the name SharePoint Designer Actions V1.0. Download this expansion for SharePoint Designer and install it at your SharePoint farm.</p>
<p>Below I will provide a few demonstration steps that will use the following new SharePoint Designer Actions from <a href="http://ilovesharepoint.codeplex.com/" onclick="javascript:pageTracker._trackPageview('/outbound/article/ilovesharepoint.codeplex.com');" target="_blank">iLoveSharePoint</a>:</p>
<ul>
<li>Call a WebService</li>
<li>Query XML</li>
</ul>
<p>The “Call a WebService” action will allow us to communicate with the Microsoft SharePoint web services and provides us with an almost unlimited range of extra development possibilities. The small downside is that these actions are advanced and that it takes some time to configure them.</p>
<p><strong><span id="more-384"></span>Step 1: Create the required sites and lists</strong><br />
For this demo we have to prepare the SharePoint environment with 2 blank sites.</p>
<p>Create a site which will function as the parent site. Give it the name &#8220;Demo&#8221; and create a standard list with the name &#8220;SourceList&#8221;.</p>
<p>Continue with the creation of a second site. This site should be a sub site of the demo site. Give it the name &#8220;Sub Site&#8221;.  Add a new standard list with the name &#8220;TargetList&#8221; and also add an extra column with the name &#8220;Information&#8221;.</p>
<p>In my demo the urls are</p>
<ul>
<li>http://moss2007dev/Demo</li>
<li>http://moss2007dev/Demo/SubSite</li>
</ul>
<p><a href="http://edwin.vriethoff.net/wp-content/1_sites_and_lists.png"  target="_blank"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="1_sites_and_lists" src="http://edwin.vriethoff.net/wp-content/1_sites_and_lists_thumb.png" border="0" alt="1_sites_and_lists" width="240" height="235" /></a></p>
<p><strong>Step 2: Use SharePoint Designer to create a new workflow </strong></p>
<p>Start SharePoint Designer and open the Demo site we just created.</p>
<p>From the file menu choose to create a new workflow.</p>
<p>Name our workflow &#8220;WebServiceDemo&#8221; and attach it to the &#8220;SourceList&#8221;.</p>
<p>Choose to start the workflow manually and when a new item is created.</p>
<p><a href="http://edwin.vriethoff.net/wp-content/2_define_new_workflow.png"  target="_blank"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="2_define_new_workflow" src="http://edwin.vriethoff.net/wp-content/2_define_new_workflow_thumb.png" border="0" alt="2_define_new_workflow" width="240" height="249" /></a></p>
<p><strong>Step 3: Create the first step</strong></p>
<p>We will now add our first step. During this first step we will call the lists.asmx web service and create a new item in the Sub site &#8220;TargetList&#8221; list.</p>
<p>Give a name to the first step like &#8220;Create an item in the Sub Site target list.&#8221;</p>
<p>SharePoint designer won’t be able to create an item in the &#8220;TargetList&#8221; because it is not located in the Demo site. To work around this issue we will use the SharePoint Web services.</p>
<p>Add a new action to the first step and search for the &#8220;Call a Web Service&#8221; action. This action should be available if you installed the <a href="http://ilovesharepoint.codeplex.com/" onclick="javascript:pageTracker._trackPageview('/outbound/article/ilovesharepoint.codeplex.com');" target="_blank">iLoveSharePoint</a> SharePoint Designer actions.</p>
<p>The &#8220;Call a Web Service&#8221; action accepts a few parameters:</p>
<ul>
<li><strong>Address</strong> &#8211; Url to the web services</li>
<li><strong>SOAP Version</strong> &#8211; Soap version to use</li>
<li><strong>SOAP Action</strong> &#8211; Redundant in our case</li>
<li><strong>Envelope</strong> &#8211; The XML message we&#8217;ll send to the web service</li>
<li><strong>Response</strong> &#8211; The XML message returned from the web service</li>
<li><strong>User</strong> – Username</li>
<li><strong>Password</strong> &#8211; Password for the specified user</li>
</ul>
<p>In all our web service calls we will not specify the SOAP Action and the User/Password combination. Without any provided credentials the web service will be executed using the service account.</p>
<p>I do also always specify the SOAP Version as 1.2.</p>
<p>Now let&#8217;s provide the parameters with some data:</p>
<p><strong>Address</strong><br />
http://moss2007dev/Demo/SubSite/_vti_bin/lists.asmx</p>
<p><strong>SOAP Version<br />
</strong>Soap 1.2</p>
<p><strong>Envelope<br />
</strong></p>
<div class="code">&lt;?xml version=&#8221;1.0&#8243; encoding=&#8221;utf-8&#8243;?&gt;<br />
&lt;soap12:Envelope xmlns:xsi=&#8221;http://www.w3.org/2001/XMLSchema-instance&#8221; xmlns:xsd=&#8221;http://www.w3.org/2001/XMLSchema&#8221; xmlns:soap12=&#8221;http://www.w3.org/2003/05/soap-envelope&#8221;&gt;<br />
&lt;soap12:Body&gt;<br />
&lt;UpdateListItems xmlns=&#8221;http://schemas.microsoft.com/sharepoint/soap/&#8221;&gt;<br />
&lt;listName&gt;TargetList&lt;/listName&gt;<br />
&lt;updates&gt;<br />
&lt;Batch&gt;<br />
&lt;Method ID=&#8221;1&#8243; Cmd=&#8221;New&#8221;&gt;<br />
&lt;Field Name=&#8221;ID&#8221;&gt;New&lt;/Field&gt;<br />
&lt;Field Name=&#8221;Title&#8221;&gt;Item created by Demo site&lt;/Field&gt;<br />
&lt;Field Name=&#8221;Information&#8221;&gt;[%SourceList:Title%]&lt;/Field&gt;<br />
&lt;/Method&gt;<br />
&lt;/Batch&gt;<br />
&lt;/updates&gt;<br />
&lt;/UpdateListItems&gt;<br />
&lt;/soap12:Body&gt;<br />
&lt;/soap12:Envelope&gt;</div>
<p><strong>Response</strong><br />
Store the response in a string variable called &#8220;WorkflowResponse&#8221;.</p>
<p>We have now completed the first step in our workflow and we should be able to create a list item in the &#8220;Sub Site&#8221; by adding a new item in the &#8220;SourceList&#8221; list located at the Demo site.</p>
<p>Save and publish the workflow.</p>
<p><a href="http://edwin.vriethoff.net/wp-content/3_first_step_call_webservice.png"  target="_blank"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="3_first_step_call_webservice" src="http://edwin.vriethoff.net/wp-content/3_first_step_call_webservice_thumb.png" border="0" alt="3_first_step_call_webservice" width="240" height="249" /></a></p>
<p><strong>Step 4: Check and run the workflow. </strong></p>
<p>Navigate to the Demo site and open the &#8220;SourceList&#8221; list. Create a new item and provide the value &#8220;Hello World&#8221; as Title, because every demo should include a &#8220;Hello World&#8221; example, right?</p>
<p>If everything works correctly the &#8220;SourceList&#8221; list should show a &#8220;WebServiceDemo&#8221; column with the value &#8220;Completed&#8221;.</p>
<p>Navigate to our &#8220;Sub Site&#8221; en open the &#8220;TargetList&#8221; list. Our new list item should be shown here!</p>
<p><a href="http://edwin.vriethoff.net/wp-content/4_item_created_by_webservices.png"  target="_blank"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="4_item_created_by_webservices" src="http://edwin.vriethoff.net/wp-content/4_item_created_by_webservices_thumb.png" border="0" alt="4_item_created_by_webservices" width="240" height="191" /></a></p>
<p><strong>Step 5: Create a demo workflow in the &#8220;Sub Site&#8221; site </strong></p>
<p>An interesting scenario would be that we trigger a new workflow when an item is created in the &#8220;TargetList&#8221; list. To demonstrate this open the &#8220;Sub site&#8221; site in SharePoint designer and create a new workflow on the &#8220;TargetList&#8221; list.</p>
<p>Name the workflow &#8220;UpdateTitleField&#8221; and attach it to the &#8220;TargetList&#8221; list.</p>
<p>Choose to start the workflow manually and when a new item is created.</p>
<p><a href="http://edwin.vriethoff.net/wp-content/5_new_workflow_update_title.png"  target="_blank"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="5_new_workflow_update_title" src="http://edwin.vriethoff.net/wp-content/5_new_workflow_update_title_thumb.png" border="0" alt="5_new_workflow_update_title" width="240" height="249" /></a></p>
<p><strong>Step 6: Configure the first step to update the Title field </strong></p>
<p>Give a name to the first step like &#8220;Update the title field&#8221;.</p>
<p>Add a new action to the step and search for the &#8220;Set Field in Current Item&#8221; action.</p>
<p>Configure the action to update the &#8220;Title&#8221; field and set the value to &#8220;Updated by Workflow&#8221;.</p>
<p>Save the new workflow.</p>
<p><a href="http://edwin.vriethoff.net/wp-content/6_update_the_title_field.png"  target="_blank"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="6_update_the_title_field" src="http://edwin.vriethoff.net/wp-content/6_update_the_title_field_thumb.png" border="0" alt="6_update_the_title_field" width="240" height="249" /></a></p>
<p><strong>Step 7: Test the &#8220;UpdateTitleField&#8221; workflow </strong></p>
<p>Navigate to the &#8220;TargetList&#8221; list and open the item menu of our first created item.</p>
<p>Choose the option &#8220;Workflows&#8221;.</p>
<p>You will now see a screen with all available workflows. Click the &#8220;UpdateTitleField&#8221; workflow and start the workflow.</p>
<p>The workflow should complete and update the title field of the item.</p>
<p><a href="http://edwin.vriethoff.net/wp-content/7_completed_update_title_workflow.png"  target="_blank"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="7_completed_update_title_workflow" src="http://edwin.vriethoff.net/wp-content/7_completed_update_title_workflow_thumb.png" border="0" alt="7_completed_update_title_workflow" width="240" height="97" /></a></p>
<p><strong>Step 8: Test the complete flow </strong></p>
<p>We have now completed our flow:</p>
<ol>
<li>An item is manually created in the &#8220;SourceList&#8221; list</li>
<li>The &#8220;WebServiceDemo&#8221; workflow is triggered</li>
<li>An information list item is created via the web service call in the &#8220;TargetList&#8221; list</li>
<li>The &#8220;UpdateTitleField&#8221; workflow should be triggered</li>
<li>The title of the list item is updated</li>
</ol>
<p>So let&#8217;s start by creating the manual item at the Demo site. Now quickly navigate to the &#8220;Sub site&#8221; to see the result. But you’ll probably see that step 4 of our flow didn&#8217;t trigger! It didn&#8217;t work as it should.</p>
<p>If it did work correctly you are in luck because your AppPool identity was differently configured. In most cases the service account is not allowed to auto start workflows.</p>
<p>This behavior is explained by Microsoft in <a href="http://support.microsoft.com/kb/947284/en-us" onclick="javascript:pageTracker._trackPageview('/outbound/article/support.microsoft.com');" target="_blank">KB947284</a>:</p>
<p>&#8220;This behavior occurs because a security fix in Windows SharePoint Services 3.0 SP1 prevents declarative workflows from starting automatically under the system account.&#8221;</p>
<p><a href="http://edwin.vriethoff.net/wp-content/8_workflow_is_not_triggered.png"  target="_blank"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="8_workflow_is_not_triggered" src="http://edwin.vriethoff.net/wp-content/8_workflow_is_not_triggered_thumb.png" border="0" alt="8_workflow_is_not_triggered" width="240" height="192" /></a></p>
<p><strong>Step 9: Collect the item url of the newly created item </strong></p>
<p>To overcome the auto start problem we can trigger the workflow with a web service call.</p>
<p>For this call we need the path of the new item and the templateID of the workflow. In this demo we will retrieve the templateID in the workflow, but once you know the templateId you can of course hardcode it in your web service call to minimize the system load.</p>
<p>Create a new step in the &#8220;WebServiceDemo&#8221; workflow and name it &#8220;Collect WF parameters&#8221;.</p>
<p>Add a new action. This time we will use the <a href="http://ilovesharepoint.codeplex.com/" onclick="javascript:pageTracker._trackPageview('/outbound/article/ilovesharepoint.codeplex.com');" target="_blank">iLoveSharepoint</a> &#8220;Query XML&#8221; action.</p>
<p>The &#8220;Query XML&#8221; action accepts 3 parameters:</p>
<ul>
<li><strong>XML Input</strong> &#8211; the XML to be processed</li>
<li><strong>XPath</strong> &#8211; The XPath query to run</li>
<li><strong>Result</strong> &#8211; The variable in which the result will be stored</li>
</ul>
<p>Let&#8217;s provide the parameters with some data:</p>
<p><strong>XML Input<br />
</strong>Variable: WorkflowResponse</p>
<p><strong>XPath</strong><br />
//@ows_EncodedAbsUrl</p>
<p><strong>Result<br />
</strong>Create a new string variable with the name &#8220;ItemUrl&#8221;</p>
<p>To be able to analyze any result, add a second action of the type &#8220;Log to History List&#8221;. This action will write given information into the workflow history list. Configure the action to log the variable &#8220;ItemUrl&#8221;.</p>
<p>Save the workflow with our latest changes.</p>
<p><a href="http://edwin.vriethoff.net/wp-content/9_collect_item_url.png"  target="_blank"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="9_collect_item_url" src="http://edwin.vriethoff.net/wp-content/9_collect_item_url_thumb.png" border="0" alt="9_collect_item_url" width="240" height="249" /></a></p>
<p><strong>Step 10: Run the workflow and see if the new item url is collected </strong></p>
<p>We will now check if the item url is logged in workflow history.</p>
<p>Navigate to the &#8220;SourceList&#8221; list and create a new item.</p>
<p>After submit wait until the workflow &#8220;WebServiceDemo&#8221; is completed and then click the completed link.</p>
<p>You will find the workflow history on this page and you should see the url of the new item.</p>
<p><a href="http://edwin.vriethoff.net/wp-content/10_wf_history_listitem_url.png"  target="_blank"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="10_wf_history_listitem_url" src="http://edwin.vriethoff.net/wp-content/10_wf_history_listitem_url_thumb.png" border="0" alt="10_wf_history_listitem_url" width="240" height="53" /></a></p>
<p><strong>Step 11: Collect the TemplateID of the workflow </strong></p>
<p>To retrieve the TemplateID of a workflow we can use workflow.asmx web service.</p>
<p>Open the “WebServiceDemo” again in SharePoint designer and load the &#8220;Collect WF parameters&#8221; step.</p>
<p>Add a new &#8220;Call a Web Service&#8221; action and provide the following parameters:</p>
<p><strong>Address</strong><br />
http://moss2007dev/Demo/SubSite/_vti_bin/workflow.asmx</p>
<p><strong>SOAP Version</strong><br />
Soap 1.2</p>
<p><strong>Envelope<br />
</strong></p>
<div class="code">&lt;?xml version=&#8221;1.0&#8243; encoding=&#8221;utf-8&#8243;?&gt;<br />
&lt;soap12:Envelope xmlns:xsi=&#8221;http://www.w3.org/2001/XMLSchema-instance&#8221; xmlns:xsd=&#8221;http://www.w3.org/2001/XMLSchema&#8221; xmlns:soap12=&#8221;http://www.w3.org/2003/05/soap-envelope&#8221;&gt;<br />
&lt;soap12:Body&gt;<br />
&lt;GetTemplatesForItem xmlns=&#8221;http://schemas.microsoft.com/sharepoint/soap/workflow/&#8221;&gt;<br />
&lt;item&gt;[%Variable: ItemUrl%]&lt;/item&gt;<br />
&lt;/GetTemplatesForItem&gt;<br />
&lt;/soap12:Body&gt;<br />
&lt;/soap12:Envelope&gt;</div>
<p><strong>Response</strong><br />
Store the response in the existing variable called &#8220;WorkflowResponse&#8221;.</p>
<p>To query the Workflow Template Id add a new &#8220;Query XML&#8221; action and use the following parameters:</p>
<p><strong>XML Input</strong><br />
Variable: WorkflowResponse</p>
<p><strong>XPath</strong><br />
//@TemplateId[1]</p>
<p><strong>Result</strong><br />
Create a new string variable with the name &#8220;WFTemplateID&#8221;.</p>
<p>Note that the workflow result is returning namespaces. Because of the namespaces it is quite difficult to do a full XPath query. The //@TemplateId XPath works but when you have more as 1 workflow on the list, play with the [index] option to find the correct templateID.</p>
<p>Finish the &#8220;Collect WF parameters&#8221; step by logging the &#8220;WFTemplateID&#8221; into the history list.</p>
<p><a href="http://edwin.vriethoff.net/wp-content/11_wf_collect_template_id.png"  target="_blank"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="11_wf_collect_template_id" src="http://edwin.vriethoff.net/wp-content/11_wf_collect_template_id_thumb.png" border="0" alt="11_wf_collect_template_id" width="240" height="249" /></a></p>
<p><strong>Step 12: Check the workflow history for the Workflow Template ID </strong></p>
<p>We will now check if the workflow TemplateID is logged in workflow history.</p>
<p>Navigate to the &#8220;SourceList&#8221; list and create a new item.</p>
<p>After submit wait until the workflow &#8220;WebServiceDemo&#8221; is completed and then click the completed link.</p>
<p>You will find the workflow history on this page and you should see the ID of the Workflow Template ID.</p>
<p><a href="http://edwin.vriethoff.net/wp-content/12_WF_history_logged_WFtemplateID.png"  target="_blank"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="12_WF_history_logged_WFtemplateID" src="http://edwin.vriethoff.net/wp-content/12_WF_history_logged_WFtemplateID_thumb.png" border="0" alt="12_WF_history_logged_WFtemplateID" width="240" height="53" /></a></p>
<p><strong>Step 13: Start the &#8220;UpdateTitleField&#8221; workflow via a web service call</strong></p>
<p>We now have all the information required to start the &#8220;UpdateTitleField&#8221; workflow on the automatically created items.</p>
<p>Open the &#8220;WebServiceDemo&#8221; workflow again in SharePoint designer and add a third step with the name &#8220;Start UpdateTitleField workflow&#8221;.</p>
<p>We only need to add a single workflow action here of the type &#8220;Call a Web Service&#8221;.</p>
<p>We configure the parameters to use the “StartWorkflow” action of the workflows.asmx web service:</p>
<p><strong>Address</strong><br />
http://moss2007dev/Demo/SubSite/_vti_bin/workflow.asmx</p>
<p><strong>SOAP Version</strong><br />
Soap 1.2</p>
<p><strong>Envelope</strong></p>
<div class="code">&lt;?xml version=&#8221;1.0&#8243; encoding=&#8221;utf-8&#8243;?&gt;<br />
&lt;soap12:Envelope xmlns:xsi=&#8221;http://www.w3.org/2001/XMLSchema-instance&#8221; xmlns:xsd=&#8221;http://www.w3.org/2001/XMLSchema&#8221; xmlns:soap12=&#8221;http://www.w3.org/2003/05/soap-envelope&#8221;&gt;<br />
&lt;soap12:Body&gt;<br />
&lt;StartWorkflow xmlns=&#8221;http://schemas.microsoft.com/sharepoint/soap/workflow/&#8221;&gt;<br />
&lt;item&gt;[%Variable: ItemUrl%]&lt;/item&gt;<br />
&lt;templateId&gt;[%Variable: WFTemplateID%]&lt;/templateId&gt;<br />
&lt;workflowParameters&gt;&lt;Data /&gt;&lt;/workflowParameters&gt;<br />
&lt;/StartWorkflow&gt;<br />
&lt;/soap12:Body&gt;<br />
&lt;/soap12:Envelope&gt;</div>
<p>Save the workflow when you are finished configuring the action.</p>
<p><a href="http://edwin.vriethoff.net/wp-content/13_start_workflow_webservice_call.png"  target="_blank"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="13_start_workflow_webservice_call" src="http://edwin.vriethoff.net/wp-content/13_start_workflow_webservice_call_thumb.png" border="0" alt="13_start_workflow_webservice_call" width="240" height="249" /></a></p>
<p><strong>Step 14: Run the final test</strong></p>
<p>We should now have really completed our flow.</p>
<ol>
<li>An list item is manually created in the &#8220;SourceList&#8221; list</li>
<li>The &#8220;WebServiceDemo&#8221; workflow is triggered</li>
<li>An information list item is created via the web service call in the &#8220;TargetList&#8221; list</li>
<li>The &#8220;UpdateTitleField&#8221; workflow should be triggered</li>
<li>The title of the list item is updated</li>
</ol>
<p>So let&#8217;s try it again. Navigate to the &#8220;SourceList&#8221; list and create a new item. Check if the &#8220;UpdateTitleField&#8221; workflow completes successfully and then navigate to the &#8220;Sub site&#8221; and the &#8220;TargetList&#8221; list to check the result.</p>
<p>If the configuration was successful you will now see that all the steps in our flow completed successfully!</p>
<p><a href="http://edwin.vriethoff.net/wp-content/14_complete_finished_workflows.png"  target="_blank"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="14_complete_finished_workflows" src="http://edwin.vriethoff.net/wp-content/14_complete_finished_workflows_thumb.png" border="0" alt="14_complete_finished_workflows" width="240" height="211" /></a></p>
<p>This demonstration showed you how to</p>
<ul>
<li>Call web services from SharePoint designer</li>
<li>Extract xml values from the web service responses</li>
<li>Trigger a workflow via a web service call</li>
</ul>
<p>Thanks to the <a href="http://ilovesharepoint.codeplex.com/" onclick="javascript:pageTracker._trackPageview('/outbound/article/ilovesharepoint.codeplex.com');" target="_blank">iLoveSharePoint</a> SharePoint Designer Actions you have a lot of new workflow possibilities. Enjoy and be creative!</p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/EdwinDotNet?a=2Y2FeKdlgxg:UGfiSaSHnLo:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/EdwinDotNet?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/EdwinDotNet?a=2Y2FeKdlgxg:UGfiSaSHnLo:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/EdwinDotNet?i=2Y2FeKdlgxg:UGfiSaSHnLo:D7DqB2pKExk" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/EdwinDotNet?a=2Y2FeKdlgxg:UGfiSaSHnLo:7Q72WNTAKBA"><img src="http://feeds.feedburner.com/~ff/EdwinDotNet?d=7Q72WNTAKBA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/EdwinDotNet?a=2Y2FeKdlgxg:UGfiSaSHnLo:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/EdwinDotNet?i=2Y2FeKdlgxg:UGfiSaSHnLo:F7zBnMyn0Lo" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/EdwinDotNet/~4/2Y2FeKdlgxg" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://edwin.vriethoff.net/2010/04/04/unleash-extra-power-to-sharepoint-2007-workflows/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		<feedburner:origLink>http://edwin.vriethoff.net/2010/04/04/unleash-extra-power-to-sharepoint-2007-workflows/</feedburner:origLink></item>
		<item>
		<title>Front-end file system cache problems might occur after a SharePoint configuration database restore.</title>
		<link>http://feedproxy.google.com/~r/EdwinDotNet/~3/wRGLTRsrhWw/</link>
		<comments>http://edwin.vriethoff.net/2010/03/25/front-end-file-system-cache-problems-might-occur-after-a-sharepoint-configuration-database-restore/#comments</comments>
		<pubDate>Thu, 25 Mar 2010 16:41:57 +0000</pubDate>
		<dc:creator>Edwin Vriethoff</dc:creator>
				<category><![CDATA[Errors]]></category>
		<category><![CDATA[SQL Server]]></category>
		<category><![CDATA[SharePoint]]></category>
		<category><![CDATA[Cache]]></category>
		<category><![CDATA[Configuration database]]></category>
		<category><![CDATA[deployment]]></category>
		<category><![CDATA[Infopath]]></category>
		<category><![CDATA[KB]]></category>
		<category><![CDATA[WSP]]></category>

		<guid isPermaLink="false">http://edwin.vriethoff.net/?p=370</guid>
		<description><![CDATA[Last week I was working at a client who just restored one of their SharePoint environments because of a site error. Everything was functioning like normal, until we discovered a major issue with the InfoPath forms publishing mechanism.
For some of the Infopath forms we received an error while upgrading the form to a newer version. The [...]]]></description>
			<content:encoded><![CDATA[<p><img title="database_restore_file_cache_problems" src="http://edwin.vriethoff.net/wp-content/database_restore_file_cache_problems.jpg" alt="database_restore_file_cache_problems" width="140" height="142" align="left" />Last week I was working at a client who just restored one of their SharePoint environments because of a site error. Everything was functioning like normal, until we discovered a major issue with the InfoPath forms publishing mechanism.</p>
<p>For some of the Infopath forms we received an error while upgrading the form to a newer version. The error statement told us that we could not update the form because of an object in the database with the same ID.</p>
<p>To resolve the error we tried to remove the existing form, but instead of removing the form, SharePoint decided to do the opposite and it tried to start some kind of upgrade process. We had no more options to upgrade or even delete the existing form.</p>
<p><span id="more-370"></span>We knew that SharePoint generates a WSP for each InfoPath form that is published in the Central Administration. The deployment status of each WSP file can be seen in the Solution Management section. Right here we found the source of our problem. The Solution Management page informed us that the WSP package of the forms where Globally deployed, but they gave an Error status. The error status blocked every option to retract or re-deploy the WSP. Looking at the error details the following message was displayed:</p>
<div class="Code">SharePointServer : C:\WINDOWS\Temp\solution-fc4c343f-f8f7-4724-b6c0-8e658496bda9\form-template_myform.wsp could not be created because the contents could not be found under id 4795693a-2ec7-4a92-810f-eb9931a498e6 in the configuration database.</div>
<p>Somehow the environment was thinking that the content of the missing WSP package was deployed.</p>
<p>Finally the IT Pro of our client found the solution for the problem in <a href="http://support.microsoft.com/kb/939308" onclick="javascript:pageTracker._trackPageview('/outbound/article/support.microsoft.com');" target="_blank">KB939308</a>. It turns out that after a database restore, the contents of the file system cache on the front-end servers can be different from that of the contents of the configuration database.</p>
<p>The only way to fix this is by performing some manual steps:</p>
<ol>
<li>All the XML configuration files have to be removed from the SharePoint config directory.</li>
<li>The contents of the cache.ini file has to be cleared.</li>
<li>The Windows SharePoint Services Timer has to be restarted.</li>
</ol>
<p>A detailed guide of these steps is provided in the description of <a href="http://support.microsoft.com/kb/939308" onclick="javascript:pageTracker._trackPageview('/outbound/article/support.microsoft.com');" target="_blank">KB939308</a>.</p>
<p>So next time if you have to do a database restore of your SharePoint Server, keep in mind some cache problems might occur.</p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/EdwinDotNet?a=wRGLTRsrhWw:Y3qEq8XEZzQ:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/EdwinDotNet?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/EdwinDotNet?a=wRGLTRsrhWw:Y3qEq8XEZzQ:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/EdwinDotNet?i=wRGLTRsrhWw:Y3qEq8XEZzQ:D7DqB2pKExk" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/EdwinDotNet?a=wRGLTRsrhWw:Y3qEq8XEZzQ:7Q72WNTAKBA"><img src="http://feeds.feedburner.com/~ff/EdwinDotNet?d=7Q72WNTAKBA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/EdwinDotNet?a=wRGLTRsrhWw:Y3qEq8XEZzQ:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/EdwinDotNet?i=wRGLTRsrhWw:Y3qEq8XEZzQ:F7zBnMyn0Lo" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/EdwinDotNet/~4/wRGLTRsrhWw" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://edwin.vriethoff.net/2010/03/25/front-end-file-system-cache-problems-might-occur-after-a-sharepoint-configuration-database-restore/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://edwin.vriethoff.net/2010/03/25/front-end-file-system-cache-problems-might-occur-after-a-sharepoint-configuration-database-restore/</feedburner:origLink></item>
		<item>
		<title>Visual Studio and SharePoint 2010 new SPSite returns FileNotFoundException</title>
		<link>http://feedproxy.google.com/~r/EdwinDotNet/~3/SHERyPS9GTg/</link>
		<comments>http://edwin.vriethoff.net/2010/03/22/visual-studio-and-sharepoint-2010-new-spweb-returns-filenotfoundexception/#comments</comments>
		<pubDate>Mon, 22 Mar 2010 11:26:50 +0000</pubDate>
		<dc:creator>Edwin Vriethoff</dc:creator>
				<category><![CDATA[Errors]]></category>
		<category><![CDATA[SharePoint]]></category>
		<category><![CDATA[.Net 3.5]]></category>
		<category><![CDATA[2010]]></category>
		<category><![CDATA[64 bit]]></category>
		<category><![CDATA[console]]></category>
		<category><![CDATA[exception]]></category>
		<category><![CDATA[File Not Found]]></category>
		<category><![CDATA[framework]]></category>
		<category><![CDATA[platform]]></category>
		<category><![CDATA[spsite]]></category>
		<category><![CDATA[spweb]]></category>

		<guid isPermaLink="false">http://edwin.vriethoff.net/?p=352</guid>
		<description><![CDATA[While writing my first console application to communicate with SharePoint 2010, I was surprised to receive a FileNotFoundException during the creation of a new SPSite.
The line
SPWeb web = new SPSite(&#8221;http://localhost/&#8221;).OpenWeb();
returned the error statement:
FileNotFoundException was unhandled:
The Web application at http://localhost/ could not be found. Verify that you have typed the URL correctly. If the URL should [...]]]></description>
			<content:encoded><![CDATA[<p>While writing my first console application to communicate with SharePoint 2010, I was surprised to receive a FileNotFoundException during the creation of a new SPSite.</p>
<p>The line</p>
<div class="code">SPWeb web = new SPSite(&#8221;http://localhost/&#8221;).OpenWeb();</div>
<p>returned the error statement:</p>
<div style="border: solid 1px grey; padding: 5px;">FileNotFoundException was unhandled:<br />
The Web application at http://localhost/ could not be found. Verify that you have typed the URL correctly. If the URL should be serving existing content, the system administrator may need to add a new request URL mapping to the intended application.</div>
<p><a href="http://edwin.vriethoff.net/wp-content/FileNotFoundException.jpg"  target="_blank"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="FileNotFoundException" src="http://edwin.vriethoff.net/wp-content/FileNotFoundException_thumb.jpg" border="0" alt="FileNotFoundException" width="240" height="204" /></a></p>
<p>At first I assumed that the error was caused by invalid user rights, but after some searching <a href="http://social.technet.microsoft.com/Forums/en-GB/sharepoint2010programming/thread/f3e6826d-1a02-4597-90ed-81b2769d97c9" onclick="javascript:pageTracker._trackPageview('/outbound/article/social.technet.microsoft.com');" target="_blank">this forum post at Microsoft Technet</a> came up with the right solution.</p>
<p>By default the console project is build for the .Net 4 framework and and the x86 platform. Because SharePoint is only available as a 64bit version, the console app should also be compiled for the 64bit platform.</p>
<p><a href="http://edwin.vriethoff.net/wp-content/Update_Platform_To_x64_FileNotFoundException.jpg"  target="_blank"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="Update_Platform_To_x64_FileNotFoundException" src="http://edwin.vriethoff.net/wp-content/Update_Platform_To_x64_FileNotFoundException_thumb.jpg" border="0" alt="Update_Platform_To_x64_FileNotFoundException" width="240" height="172" /></a></p>
<p>By changing the framework to .Net 3.5 and the target platform to x64 the issue was resolved.</p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/EdwinDotNet?a=SHERyPS9GTg:gu8fUsix3J0:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/EdwinDotNet?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/EdwinDotNet?a=SHERyPS9GTg:gu8fUsix3J0:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/EdwinDotNet?i=SHERyPS9GTg:gu8fUsix3J0:D7DqB2pKExk" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/EdwinDotNet?a=SHERyPS9GTg:gu8fUsix3J0:7Q72WNTAKBA"><img src="http://feeds.feedburner.com/~ff/EdwinDotNet?d=7Q72WNTAKBA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/EdwinDotNet?a=SHERyPS9GTg:gu8fUsix3J0:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/EdwinDotNet?i=SHERyPS9GTg:gu8fUsix3J0:F7zBnMyn0Lo" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/EdwinDotNet/~4/SHERyPS9GTg" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://edwin.vriethoff.net/2010/03/22/visual-studio-and-sharepoint-2010-new-spweb-returns-filenotfoundexception/feed/</wfw:commentRss>
		<slash:comments>17</slash:comments>
		<feedburner:origLink>http://edwin.vriethoff.net/2010/03/22/visual-studio-and-sharepoint-2010-new-spweb-returns-filenotfoundexception/</feedburner:origLink></item>
		<item>
		<title>SharePoint 2010 Mobile Web Part development</title>
		<link>http://feedproxy.google.com/~r/EdwinDotNet/~3/FNI5yO0P_ew/</link>
		<comments>http://edwin.vriethoff.net/2010/01/17/sharepoint-2010-mobile-web-part-development/#comments</comments>
		<pubDate>Sun, 17 Jan 2010 20:15:13 +0000</pubDate>
		<dc:creator>Edwin Vriethoff</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[SharePoint]]></category>
		<category><![CDATA[2010]]></category>
		<category><![CDATA[demo]]></category>
		<category><![CDATA[Mobile]]></category>
		<category><![CDATA[web part]]></category>

		<guid isPermaLink="false">http://edwin.vriethoff.net/?p=321</guid>
		<description><![CDATA[ For a SharePoint 2010 demo i&#8217;m building a web part that should be accessible by Mobile devices. In SharePint 2010 all mobile devices are redirected by default to the mobile SharePoint rendering engine.
The mobile rendering engine of SharePoint provides mobile users access to the sites with a completely stripped interface. Its main function is [...]]]></description>
			<content:encoded><![CDATA[<p><img style="border-bottom: 0px; border-left: 0px; display: inline; margin-left: 0px; border-top: 0px; margin-right: 0px; border-right: 0px" title="mobiledevice" src="http://edwin.vriethoff.net/wp-content/mobiledevice.jpg" border="0" alt="mobiledevice" width="125" height="137" align="left" /> For a SharePoint 2010 demo i&#8217;m building a web part that should be accessible by Mobile devices. In SharePint 2010 all mobile devices are redirected by default to the mobile SharePoint rendering engine.</p>
<p>The mobile rendering engine of SharePoint provides mobile users access to the sites with a completely stripped interface. Its main function is to list all libraries and to provide basic access to them. For wiki and blog sites the rendering engine also provides some content rendering.</p>
<p>To keep the amount of data as low as possible, almost all web parts are completely stripped from the mobile site. Only when a web part developer provided a special mobile version of the web part, the web part will be accessible in the interface and to keep the mobile screen as empty as possible, the user must first expand the web part via its title to see it.</p>
<p>Documentation about SharePoint Mobile development is provided at <a href="http://msdn.microsoft.com/en-us/library/ms464268(office.14).aspx" onclick="javascript:pageTracker._trackPageview('/outbound/article/msdn.microsoft.com');" target="_blank">MSDN</a>. At first it all looks quite complex, but building a mobile version of a web part is actually not that hard. Below I will explain the required steps with a &#8216;Hello world&#8217; example. For this sample I will not rename the default object names provided by the Visual Studio templates.</p>
<p><span id="more-321"></span><br />
<strong>Create a sample site</strong></p>
<p>In this sample we begin with a fresh empty site. Create a new “Blank Site” and call it “Mobile Demo”.</p>
<p><a href="http://edwin.vriethoff.net/wp-content/sp2010mobiledev_step1.jpg"  target="_blank"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="Create a sample site" src="http://edwin.vriethoff.net/wp-content/sp2010mobiledev_step1_thumb.jpg" border="0" alt="Create a sample site" width="240" height="185" /></a></p>
<p><strong>Create a Visual Studio 2010 Visual Web Part Project</strong></p>
<p>Visual studio 2010 includes a full set of SharePoint templates. These templates automatically publish and debug the project to your SharePoint environment.</p>
<p>Start a new “Visual Web Part Project” and name it “MobileWebPartDemo”.</p>
<p><a href="http://edwin.vriethoff.net/wp-content/sp2010mobiledev_step2.jpg"  target="_blank"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="Create a Visual Studio 2010 Visual Web Part Project" src="http://edwin.vriethoff.net/wp-content/sp2010mobiledev_step2_thumb.jpg" border="0" alt="Create a Visual Studio 2010 Visual Web Part Project" width="240" height="213" /></a></p>
<p><strong>Add a literal with the “hello world” message</strong></p>
<p>We will now create the normal SharePoint web part. We only show a sample message by adding a literal to the web part controls.</p>
<p>Open the class file “VisualWebPart1UserControl.ascx.cs” and add the following code to the load event:</p>
<div class="code">Literal litHello = new Literal();<br />
litHello.Text = &#8220;Hello World. This is the normal SharePoint web part.&#8221;;<br />
Controls.Add(litHello);</div>
<p><a href="http://edwin.vriethoff.net/wp-content/sp2010mobiledev_step3.jpg"  target="_blank"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="Add a literal with the “hello world” message" src="http://edwin.vriethoff.net/wp-content/sp2010mobiledev_step3_thumb.jpg" border="0" alt="Add a literal with the “hello world” message" width="240" height="192" /></a></p>
<p><strong>Build and add the web part to the page</strong></p>
<p>Press F5 to compile and build the web part. Internet explorer will start. Browse to the “Mobile demo” sample site and open the default page in edit mode. Add a new web part. Inside the “Custom” category you will find our demo web part. Add “VisualWebPart1” to the page.</p>
<p><a href="http://edwin.vriethoff.net/wp-content/sp2010mobiledev_step4.jpg"  target="_blank"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="Build and add the web part to the page" src="http://edwin.vriethoff.net/wp-content/sp2010mobiledev_step4_thumb.jpg" border="0" alt="Build and add the web part to the page" width="240" height="256" /></a></p>
<p><strong>Preview the site</strong></p>
<p>Exit the edit mode of the page. You will now see your site and the web part as normal users will see it.</p>
<p><a href="http://edwin.vriethoff.net/wp-content/sp2010mobiledev_step5.jpg"  target="_blank"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="Preview the site" src="http://edwin.vriethoff.net/wp-content/sp2010mobiledev_step5_thumb.jpg" border="0" alt="Preview the site" width="240" height="256" /></a></p>
<p><strong>Preview the mobile site</strong></p>
<p>To view the web site in mobile view, type a “/m” after the normal site url. For example: “http://localhost/mobiledemo/m/”.</p>
<p>At this moment the website is rendered in the mobile view. But hey! We don’t see the web part we just published. This is because the engine strips all normal web parts to keep the data transfer as low as possible. Only mobile optimized web parts will be shown.</p>
<p><a href="http://edwin.vriethoff.net/wp-content/sp2010mobiledev_step6.jpg"  target="_blank"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="Preview the mobile site" src="http://edwin.vriethoff.net/wp-content/sp2010mobiledev_step6_thumb.jpg" border="0" alt="Preview the mobile site" width="134" height="320" /></a></p>
<p><strong>Create the mobile (adapter) version of our web part</strong></p>
<p>To add our web part to the mobile version of the site we must provide SharePoint with a mobile optimized version of our web part. We do this by adding a new class. Microsoft calls this class an adapter.</p>
<p>Add a new class and name it “VisualWebPart1MobileAdapter.cs”. Note that we added the name of our web part in front and added the text “MobileAdapter” at the end.</p>
<p>Microsoft recommends to use the namespace “SharePoint. WebPartPages.MobileAdapters” so modify the namespace to use “MobileWebPartDemo.SharePoint.WebPartPages .MobileAdapters”.</p>
<p>Our class should inherit the “WebPartMobileAdapter” class.</p>
<p>The adapter does not use the “OnLoad” event. Instead it uses the “CreateControlsForDetailView” to render. Override this class and add the following code:</p>
<div class="code">Literal litHello = new Literal();<br />
litHello.Text = &#8220;Hello World. This is the Mobile version of the SharePoint web part.&#8221;;<br />
Controls.Add(litHello);</div>
<p><a href="http://edwin.vriethoff.net/wp-content/sp2010mobiledev_step7.jpg"  target="_blank"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="Create the mobile (adapter) version of our web part" src="http://edwin.vriethoff.net/wp-content/sp2010mobiledev_step7_thumb.jpg" border="0" alt="Create the mobile (adapter) version of our web part" width="240" height="192" /></a></p>
<p><strong>Add the adapter to the safe controls</strong></p>
<p>SharePoint should know that the adapter web part is a safe control. We did not have to add the normal web part as safe control, because the project template already fixed this for use. However, we still have to add the mobile version.</p>
<p>Open the web.config file of your SharePoint IIS site (example: C:\inetpub\wwwroot\wss\VirtualDirectories\80) and add the line below into the safecontrols section. Replace the PublicKeyToken with your own key!</p>
<div class="code">&lt;SafeControl Assembly=&#8221;MobileWebPartDemo, Version=1.0.0.0, Culture=neutral, PublicKeyToken=41167d0e1c5a217f&#8221; namespace=&#8221;MobileWebPartDemo.SharePoint.WebPartPages.MobileAdapters&#8221; TypeName=&#8221;*&#8221; Safe=&#8221;True&#8221; SafeAgainstScript=&#8221;False&#8221; /&gt;</div>
<p><strong>Configure the compat.browser file to use our mobile web part</strong></p>
<p>SharePoint must be told that there is a mobile optimized version available for our web part. Basically we are going to tell SharePoint that if there is web part “Normal” on the page, it should load version “Mobile”. Without this configuration SharePoint would just strip our web part like before.</p>
<p>Inside your SharePoint IIS directory you will see a directory “App_Browsers” and inside that directory is a file called “compat.browser”. Load this file in the editor.</p>
<p>At the top of this file you will find a “controlAdapters” section. Add the line below to this section:</p>
<div class="code">&lt;adapter controlType=&#8221;MobileWebPartDemo.VisualWebPart1.VisualWebPart1, MobileWebPartDemo, Version=1.0.0.0, Culture=neutral, PublicKeyToken=41167d0e1c5a217f&#8221; adapterType=&#8221;MobileWebPartDemo.SharePoint .WebPartPages.MobileAdapters.VisualWebPart1MobileAdapter, MobileWebPartDemo, Version=1.0.0.0, Culture=neutral, PublicKeyToken=41167d0e1c5a217f&#8221; /&gt;</div>
<p>Again, replace the PublicKeyToken with your own key! Safe the configuration and exit the file.</p>
<p><a href="http://edwin.vriethoff.net/wp-content/sp2010mobiledev_step8.jpg"  target="_blank"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="Configure the compat.browser file to use our mobile web part" src="http://edwin.vriethoff.net/wp-content/sp2010mobiledev_step8_thumb.jpg" border="0" alt="Configure the compat.browser file to use our mobile web part" width="240" height="184" /></a></p>
<p><strong>Rebuild the project and reload the mobile demo site</strong></p>
<p>We finished the required steps to provide SharePoint with a web part that is optimized for the mobile page. Press F5 to build and deploy our project and re-open the mobile view of our demo site. And wow it’s almost magic! The title of our web part has suddenly appeared.</p>
<p><a href="http://edwin.vriethoff.net/wp-content/sp2010mobiledev_step9.jpg"  target="_blank"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="Rebuild the project and reload the mobile demo site" src="http://edwin.vriethoff.net/wp-content/sp2010mobiledev_step9_thumb.jpg" border="0" alt="Rebuild the project and reload the mobile demo site" width="134" height="320" /></a></p>
<p><strong>Expand the web part</strong></p>
<p>To keep the mobile screen as empty as possible, not all web parts are automatically visible. Just click the title of the web part and it will be rendered.</p>
<p><a href="http://edwin.vriethoff.net/wp-content/sp2010mobiledev_step10.jpg"  target="_blank"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="Expand the web part" src="http://edwin.vriethoff.net/wp-content/sp2010mobiledev_step10_thumb.jpg" border="0" alt="Expand the web part" width="134" height="320" /></a></p>
<p>And that’s it. This is all the information required to start developing web parts for the SharePoint Mobile pages. Enjoy!</p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/EdwinDotNet?a=FNI5yO0P_ew:XUsfT8zEex4:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/EdwinDotNet?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/EdwinDotNet?a=FNI5yO0P_ew:XUsfT8zEex4:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/EdwinDotNet?i=FNI5yO0P_ew:XUsfT8zEex4:D7DqB2pKExk" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/EdwinDotNet?a=FNI5yO0P_ew:XUsfT8zEex4:7Q72WNTAKBA"><img src="http://feeds.feedburner.com/~ff/EdwinDotNet?d=7Q72WNTAKBA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/EdwinDotNet?a=FNI5yO0P_ew:XUsfT8zEex4:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/EdwinDotNet?i=FNI5yO0P_ew:XUsfT8zEex4:F7zBnMyn0Lo" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/EdwinDotNet/~4/FNI5yO0P_ew" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://edwin.vriethoff.net/2010/01/17/sharepoint-2010-mobile-web-part-development/feed/</wfw:commentRss>
		<slash:comments>17</slash:comments>
		<feedburner:origLink>http://edwin.vriethoff.net/2010/01/17/sharepoint-2010-mobile-web-part-development/</feedburner:origLink></item>
	</channel>
</rss>

