<?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>Life on Planet Groove &#187; SharePoint</title>
	<atom:link href="http://www.lifeonplanetgroove.com/blog/index.php/category/tech/sharepoint/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.lifeonplanetgroove.com/blog</link>
	<description>Adam Toth's Blog</description>
	<lastBuildDate>Thu, 27 May 2010 21:07:53 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Creating a Custom Metadata Editor Plugin for Colligo for SharePoint</title>
		<link>http://www.lifeonplanetgroove.com/blog/index.php/2010/05/27/creating-a-custom-metadata-editor-plugin-for-colligo-for-sharepoint/</link>
		<comments>http://www.lifeonplanetgroove.com/blog/index.php/2010/05/27/creating-a-custom-metadata-editor-plugin-for-colligo-for-sharepoint/#comments</comments>
		<pubDate>Thu, 27 May 2010 21:07:00 +0000</pubDate>
		<dc:creator>Adam Toth</dc:creator>
				<category><![CDATA[SharePoint]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[Colligo Contributor]]></category>

		<guid isPermaLink="false">http://www.lifeonplanetgroove.com/blog/?p=421</guid>
		<description><![CDATA[Just wrapped up a project developing a custom metadata editor to plugin to the Colligo Contributor for SharePoint client.
If you aren’t familiar with Colligo, it’s a desktop client application/outlook add-in/explorer file manager, that enables users to save documents or emails directly to SharePoint, and be prompted for metadata at the time of saving.
Colligo reads the [...]]]></description>
			<content:encoded><![CDATA[<p>Just wrapped up a project developing a custom metadata editor to plugin to the Colligo Contributor for SharePoint client.</p>
<p>If you aren’t familiar with Colligo, it’s a desktop client application/outlook add-in/explorer file manager, that enables users to save documents or emails directly to SharePoint, and be prompted for metadata at the time of saving.</p>
<p>Colligo reads the content type of the target lists/libraries, and generates a default form very similar to what SharePoint does with the default EditForm.aspx ListForm web part. If you don’t like the default form, or need to customize the metadata entry experience (for example custom validation, pulling from external data sources, inter-dependent controls), you can develop a custom editor and show your own Windows Forms-based form to the user.</p>
<p><a href="http://www.lifeonplanetgroove.com/blog/wp-content/uploads/2010/05/image.png"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="Colligo default editor form" border="0" alt="Colligo default editor form" src="http://www.lifeonplanetgroove.com/blog/wp-content/uploads/2010/05/image_thumb.png" width="240" height="224" /></a>     <br /><font size="1">The default Colligo Editor form, shown here when adding a new Announcement.</font></p>
<h3>How to Start</h3>
<p>To start developing a custom editor, begin by installing Colligo Contributor, and obtaining your product and sdk keys from Colligo.</p>
<p>Create a new Visual Studio Class Library project, and add a reference to the Colligo dlls in the GAC.</p>
<p>Add the necessary using statements: </p>
<div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper">
<div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet">
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #0000ff">using</span> Colligo;</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #0000ff">using</span> Colligo.Properties;</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #0000ff">using</span> Colligo.Util;</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #0000ff">using</span> Colligo.WML.MetaData;</pre>
<p><!--CRLF--></div>
</div>
<p>Change your class to inherit from the ICustomEditor class:</p>
<div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper">
<div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet">
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #0000ff">namespace</span> MyNamespace</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">{</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">    <span style="color: #0000ff">public</span> <span style="color: #0000ff">class</span> MyCustomEditor : ICustomEditor</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">    {</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">&#160;</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">    }</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">}</pre>
<p><!--CRLF--></div>
</div>
<p>Implement the Interface methods:</p>
<div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper">
<div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet">
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #0000ff">namespace</span> MyNamespace</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">{</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">    <span style="color: #0000ff">public</span> <span style="color: #0000ff">class</span> MyCustomEditor : ICustomEditor</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">    {</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">&#160;</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">        <span style="color: #008000">// SDK Key</span></pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">        <span style="color: #0000ff">private</span> <span style="color: #0000ff">const</span> <span style="color: #0000ff">string</span> SDK_KEY = <span style="color: #006080">&quot;XXXXX-XXXXX-XXXXX-XXXXX-XXXXX&quot;</span>;</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">&#160;</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">        <span style="color: #cc6633">#region</span> ICustomEditor Members</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">&#160;</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">        <span style="color: #0000ff">public</span> <span style="color: #0000ff">string</span> GetSdkKey()</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">        {</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">            <span style="color: #0000ff">return</span> SDK_KEY;</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">        }</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">&#160;</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">        <span style="color: #0000ff">public</span> EditorResult ShowEditor(IEditContext context)</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">        {</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">            <span style="color: #008000">// Show your form here</span></pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">&#160;</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">        }</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">&#160;</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">        <span style="color: #0000ff">public</span> ResolveConflictResult ShowResolveConflictDialog(IResolveConflictContext context)</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">        {</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">            <span style="color: #0000ff">return</span> ResolveConflictResult.UseDefaultResolveDialog;</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">        }</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">&#160;</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">        <span style="color: #cc6633">#endregion</span></pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">&#160;</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">    }</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">}</pre>
<p><!--CRLF--></div>
</div>
<p>In the ShowEditor method, this is where you can create an instance of a Windows Form, and call the ShowDialog method on it. You can also pre-validate and avoid showing your form for situations that are not appropriate.</p>
<div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper">
<div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet">
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"><span style="color: #0000ff">public</span> EditorResult ShowEditor(IEditContext context)</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">{</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">&#160;</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">    <span style="color: #008000">// Check if this is something we care about</span></pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">    <span style="color: #0000ff">if</span> (!context.List.IsDocumentLibrary)</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">    {</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">        <span style="color: #0000ff">return</span> EditorResult.UseDefaultEditor;</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">    }</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">    <span style="color: #0000ff">if</span> (!<span style="color: #0000ff">string</span>.Equals(context.List.Name, <span style="color: #006080">&quot;Private Documents&quot;</span>, StringComparison.CurrentCultureIgnoreCase) &amp;&amp;</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">        !<span style="color: #0000ff">string</span>.Equals(context.List.Name, <span style="color: #006080">&quot;Public Documents&quot;</span>, StringComparison.CurrentCultureIgnoreCase))</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">    {</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">        <span style="color: #0000ff">return</span> EditorResult.UseDefaultEditor;</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">    }</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">&#160;</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">    <span style="color: #008000">// Only show for Create/Edit (use the default Colligo form for Viewing)</span></pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">    <span style="color: #0000ff">if</span> (context.EditorMode == EditorMode.Create || context.EditorMode == EditorMode.Edit)</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">    {</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">        <span style="color: #0000ff">using</span> (myCustomWindowsForm myForm = <span style="color: #0000ff">new</span> myCustomWindowsForm(context))</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">        {</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">            DialogResult createResult = DialogResult.None;</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">&#160;</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">            createResult = myForm.ShowDialog(context.Parent);</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">&#160;</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">            <span style="color: #0000ff">switch</span> (createResult)</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">            {</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">                <span style="color: #0000ff">case</span> DialogResult.Cancel:</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">                    <span style="color: #0000ff">return</span> EditorResult.Cancel;</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">                <span style="color: #0000ff">case</span> DialogResult.OK:</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">                    <span style="color: #0000ff">return</span> EditorResult.OK;</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">                <span style="color: #0000ff">case</span> DialogResult.No:</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">                    <span style="color: #0000ff">return</span> EditorResult.UseDefaultEditor;</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">            }</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">        }</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">    }</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">    <span style="color: #0000ff">else</span></pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">    {</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">        <span style="color: #008000">// View - Show the default editor</span></pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">        <span style="color: #0000ff">return</span> EditorResult.UseDefaultEditor;</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">    }</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">&#160;</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">    <span style="color: #008000">// Fall through</span></pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">    <span style="color: #0000ff">return</span> EditorResult.OK;</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">&#160;</pre>
<p><!--CRLF--></p>
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">}</pre>
<p><!--CRLF--></div>
</div>
</p>
<p>Notice I am passing in the IEditContext instance into my form’s constructor. The IEditContext object has all the goodies in it, and will give you access to the list, the web, the content types, list item metadata, etc.).</p>
<h3>What to Consider</h3>
<p>Some basic things to consider are:</p>
<ul>
<li>Which scenarios will your editor cover? View, Create, Edit?</li>
<li>Is this only for documents, or list items, or both? </li>
<li>Will you support content types? A list/library can be configured with multiple content types, which you will need to create a UI for selecting/changing if you decide to support that. </li>
<li>How will you handle multiple files? Will you enable setting different data for each item, or will you force all items to use the same entered metadata? Think carefully about the “Name” field for documents in document libraries. You want to make sure that the same name is not used for multiple documents. </li>
<li>Will you allow changing folders (for document libraries with folders enabled)? If so, you’ll need to build this UI. </li>
</ul>
<p>There are a number of ways/methods that may kick off the display of your form, and you need to consider each of these:</p>
<ul>
<li>User selects New &gt; Item from within Colligo Contributor </li>
<ul>
<li>This is similar to the New &gt; [Content Type] menu directly in SharePoint. You can expect that EditorContext.ContentType and EditorContext.ListItems[0].ContentType will not be null. </li>
</ul>
<li>User selects Upload from within Colligo Contributor </li>
<ul>
<li>This is similar to Upload Document from within SharePoint. EditorContext.ContentType and EditorContext.ListItems[0].ContentType may be null. </li>
</ul>
<li>User drags/drops a single file onto Colligo Contributor </li>
<ul>
<li>EditorContext.ContentType and EditorContext.ListItems[0].ContentType may be null. </li>
</ul>
<li>User drags/drops multiple files onto Colligo Contributor </li>
<ul>
<li>EditorContext.ContentType and EditorContext.ListItems[0].ContentType may be null. </li>
</ul>
<li>User performs a single File &gt; Save As from within an application </li>
<ul>
<li>EditorContext.ContentType and EditorContext.ListItems[0].ContentType may be null. </li>
</ul>
<li>User drags/drops multiple files onto the Colligo area in Windows Explorer </li>
<ul>
<li>EditorContext.ContentType and EditorContext.ListItems[0].ContentType may be null.</li>
</ul>
<li>User selects Edit Properties from within Colligo Contributor </li>
<ul>
<li>Need to grab existing values and prepopulate your controls. EditorContext.ContentType and EditorContext.ListItems[0].ContentType will not be null. </li>
</ul>
</ul>
<h3>
  <br />Some Gotchas</h3>
<p>Following are some gotchas to be aware of:</p>
<h4>Check for Null</h4>
<p>Don’t make any assumptions about any of the items in the IEditContext object. ContentTypes may be null, Fields may not exist or be null, other relevant ILists in the Web may not be synchronized locally, and will be null, etc., etc., etc. Check everything for null first, and test everything that returns a collection/array for Count and Length &gt; 0. If there are fields/lists/lookup column values that your form expects, check for the existence of these things right away, and exit if you don’t find them.</p>
<h4>Parent Windows</h4>
<p>If your form is called via the Save As dialog from an application (or via the FileManager), the ParentWindow handle may not be valid, so be careful with the ShowDialog(IWin32Window) overload, which threw a System.ComponentModel.Win32Exception for me. I had to wrap my ShowDialog(context.Parent) in a try&gt;catch, and then try it without any parameters (ShowDialog() ).</p>
<h4>Custom Field Types</h4>
<p>If you are using any custom field types, be really careful to make sure and store the data in the proper format. My customer was using a couple of custom field types found on CodePlex, and one of them extended the Lookup field, and it took me a few traces with Fiddler to figure out that it wanted its values in lookup column format (“52;#ItemName”);</p>
</p>
</p>
</p>
<h4>Site Lookup Columns</h4>
<p>If you have any lookup columns that are defined in higher-level sites, and you are using those site columns in lists located in subsites, then Colligo will not be able to see the lookup values. In order to implement these scenarios, you will have to force your users to synchronize the higher level sites as well as the subsites.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.lifeonplanetgroove.com/blog/index.php/2010/05/27/creating-a-custom-metadata-editor-plugin-for-colligo-for-sharepoint/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Filtering XML output of SPListItemCollection using Linq to XML</title>
		<link>http://www.lifeonplanetgroove.com/blog/index.php/2010/05/26/filtering-xml-output-of-splistitemcollection-using-linq-to-xml/</link>
		<comments>http://www.lifeonplanetgroove.com/blog/index.php/2010/05/26/filtering-xml-output-of-splistitemcollection-using-linq-to-xml/#comments</comments>
		<pubDate>Wed, 26 May 2010 20:57:45 +0000</pubDate>
		<dc:creator>Adam Toth</dc:creator>
				<category><![CDATA[SharePoint]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[Linq to XML]]></category>
		<category><![CDATA[Linq2XML]]></category>
		<category><![CDATA[SPListItemCollection]]></category>
		<category><![CDATA[XLinq]]></category>

		<guid isPermaLink="false">http://www.lifeonplanetgroove.com/blog/index.php/2010/05/26/filtering-xml-output-of-splistitemcollection-using-linq-to-xml/</guid>
		<description><![CDATA[I’ve been writing a slurry of code to return list item XML so that it can be parsed and consumed by AJAX components on the client side. Since Lists.asmx does not work in anonymous access scenarios, I’ve been creating many proxy .ashx Http Handlers installed in the LAYOUTS directory, to query via the object model [...]]]></description>
			<content:encoded><![CDATA[<p>I’ve been writing a slurry of code to return list item XML so that it can be parsed and consumed by AJAX components on the client side. Since Lists.asmx does not work in anonymous access scenarios, I’ve been creating many proxy .ashx Http Handlers installed in the LAYOUTS directory, to query via the object model and return the XML of the list items, using the .Xml property of a SPListItemCollection.</p>
<p>I had one particular scenario where I couldn’t pre-filter the items in the collection with an SPQuery object (too complicated a query for CAML), so I needed a way to filter the SPListItemCollection afterwards using C#, before returning the XML.</p>
<p>The SPListItemCollection offers the .Delete() and .DeleteItemById() methods, however they will commit the deletion back to SharePoint. I wanted to simply remove some items from the in-memory collection, not delete the items from the server. There was no way that I could see to remove items from an SPListItemCollection in memory only.</p>
<p>I looked into sub-classing or extending the SPListItemCollection class, but there is no public constructor in the base class, and no way to get at the logic behind the .Xml property without nasty reflection.</p>
<p>I ultimately ended up resorting to using Linq to XML to delete the rows directly from the returned XML, and then adjusted the ItemCount accordingly.</p>
<p>Here’s the code:</p>
<div id="codeSnippetWrapper" style="border: 1px solid silver; text-align: left; padding: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; width: 97.5%; font-family: 'Courier New',courier,monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; cursor: text;">
<div id="codeSnippet" style="border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: #f4f4f4; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible;">
<pre style="border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible;"><span style="color: #008000;">// Get the list items from a list</span></pre>
<p><!--CRLF--></p>
<pre style="border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible;">SPListItemCollection items = myList.GetItems(mySPQuery);</pre>
<p><!--CRLF--></p>
<pre style="border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible;"></pre>
<p><!--CRLF--></p>
<pre style="border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible;"><span style="color: #008000;">// Get the xml of the list items</span></pre>
<p><!--CRLF--></p>
<pre style="border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible;">itemXml = surveyItems.Xml;</pre>
<p><!--CRLF--></p>
<pre style="border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible;"></pre>
<p><!--CRLF--></p>
<pre style="border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible;">XNamespace z = <span style="color: #006080;">"#RowsetSchema"</span>;</pre>
<p><!--CRLF--></p>
<pre style="border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible;">XDocument xdoc = XDocument.Parse(itemXml);</pre>
<p><!--CRLF--></p>
<pre style="border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible;"></pre>
<p><!--CRLF--></p>
<pre style="border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible;">IEnumerable&lt;XElement&gt; rows = xdoc.Root.Descendants(z + <span style="color: #006080;">"row"</span>);</pre>
<p><!--CRLF--></p>
<pre style="border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible;">List&lt;XElement&gt; rowsToDelete = <span style="color: #0000ff;">new</span> List&lt;XElement&gt;();</pre>
<p><!--CRLF--></p>
<pre style="border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible;"></pre>
<p><!--CRLF--></p>
<pre style="border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible;"><span style="color: #0000ff;">foreach</span> (XElement row <span style="color: #0000ff;">in</span> rows)</pre>
<p><!--CRLF--></p>
<pre style="border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible;">{</pre>
<p><!--CRLF--></p>
<pre style="border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible;">    <span style="color: #008000;">// Here is where you can test for a condition, and decide to remove a row</span></pre>
<p><!--CRLF--></p>
<pre style="border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible;">    <span style="color: #0000ff;">if</span> (row.Attribute(<span style="color: #006080;">"ows_Title"</span>).Value.Contains(<span style="color: #006080;">"Some string to filter on"</span>))</pre>
<p><!--CRLF--></p>
<pre style="border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible;">    {</pre>
<p><!--CRLF--></p>
<pre style="border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible;">        rowsToDelete.Add(row);</pre>
<p><!--CRLF--></p>
<pre style="border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible;">    }</pre>
<p><!--CRLF--></p>
<pre style="border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible;">}</pre>
<p><!--CRLF--></p>
<pre style="border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible;"></pre>
<p><!--CRLF--></p>
<pre style="border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible;"><span style="color: #0000ff;">while</span> (rowsToDelete.Count &gt; 0)</pre>
<p><!--CRLF--></p>
<pre style="border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible;">{</pre>
<p><!--CRLF--></p>
<pre style="border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible;">    <span style="color: #008000;">// Update the parent row count</span></pre>
<p><!--CRLF--></p>
<pre style="border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible;">    <span style="color: #0000ff;">int</span> rowCount = Convert.ToInt32(rowsToDelete[0].Parent.Attribute(<span style="color: #006080;">"ItemCount"</span>).Value);</pre>
<p><!--CRLF--></p>
<pre style="border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible;">    rowsToDelete[0].Parent.Attribute(<span style="color: #006080;">"ItemCount"</span>).Value = (rowCount - 1).ToString();</pre>
<p><!--CRLF--></p>
<pre style="border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible;">    rowsToDelete[0].Remove();</pre>
<p><!--CRLF--></p>
<pre style="border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible;">    rowsToDelete.RemoveAt(0);</pre>
<p><!--CRLF--></p>
<pre style="border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible;">}</pre>
<p><!--CRLF--></p>
<pre style="border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible;"></pre>
<p><!--CRLF--></p>
<pre style="border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible;"><span style="color: #008000;">// Get the newly filtered xml</span></pre>
<p><!--CRLF--></p>
<pre style="border-style: none; text-align: left; padding: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible;">itemXml = xdoc.ToString()</pre>
<p><!--CRLF--></p>
</div>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.lifeonplanetgroove.com/blog/index.php/2010/05/26/filtering-xml-output-of-splistitemcollection-using-linq-to-xml/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PDC Day 1 KeyNote Notes</title>
		<link>http://www.lifeonplanetgroove.com/blog/index.php/2009/11/18/pdc-day-1-keynote-notes/</link>
		<comments>http://www.lifeonplanetgroove.com/blog/index.php/2009/11/18/pdc-day-1-keynote-notes/#comments</comments>
		<pubDate>Wed, 18 Nov 2009 15:53:55 +0000</pubDate>
		<dc:creator>Adam Toth</dc:creator>
				<category><![CDATA[ASP.NET]]></category>
		<category><![CDATA[SharePoint]]></category>
		<category><![CDATA[Silverlight]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[WCF]]></category>
		<category><![CDATA[WF]]></category>
		<category><![CDATA[WPF]]></category>
		<category><![CDATA[WinForms]]></category>
		<category><![CDATA[appfabric]]></category>
		<category><![CDATA[azure]]></category>
		<category><![CDATA[pdc09]]></category>

		<guid isPermaLink="false">http://www.lifeonplanetgroove.com/blog/index.php/2009/11/18/pdc-day-1-keynote-notes/</guid>
		<description><![CDATA[
Windows Azure Improvements since last year:
Support PHP, CGI, Apache, other frameworks
Expose very low-level programming efforts (not just .NET).      Example was a C++ app with pointers exposed as an Azure service
Identity framework (support passing tokens from federated locations i.e. onsite AD instance)


SQL Azure Improvements since last year:
Not just RESTful consumption of [...]]]></description>
			<content:encoded><![CDATA[<ol>
<p>Windows Azure Improvements since last year:</p>
<li>Support PHP, CGI, Apache, other frameworks</li>
<li>Expose very low-level programming efforts (not just .NET).      <br />Example was a C++ app with pointers exposed as an Azure service</li>
<li>Identity framework (support passing tokens from federated locations i.e. onsite AD instance)</li>
</ol>
<ol>
<p>SQL Azure Improvements since last year:</p>
<li>Not just RESTful consumption of services anymore</li>
<li>Works with standard TDS based tools (SQL management studio)</li>
</ol>
<ol>
<p>Microsoft has a vision of &quot;Three screens and a Cloud&quot;.</p>
<p>The screens include:</p>
<li>Mobile devices</li>
<li>Desktop computers</li>
<li>Internet connected TVs
<p>They can all be united by data and services in the cloud.</p>
</li>
</ol>
<p><a href="http://pinpoint.microsoft.com/en-US/Dallas" target="_blank">Public Data in the Cloud (Codename &quot;Dallas&quot;)</a>. </p>
<p>Repository for public data sets that can be consumed in any number of ways (and easily by Azure)</p>
<p>Accessed through Microsoft PinPoint</p>
<p><a href="http://www.microsoft.com/windowsazure/developers/dallas/" target="_blank">Sign up for a CTP key</a></p>
<p>Some data includes NASA mars photos, GIS data, AP News articles</p>
<p><strong>PinPoint</strong>:</p>
<p>Centralized marketplace for partner providers, Azure ISVs and implementers, and gateway to &quot;Dallas&quot; public Data.</p>
<p>&quot;System Center&quot; will plugin to Azure to monitor your Azure instances, check to meet SLAs, and enable you to scale up the Azure instances directly.</p>
<p>2010 will include ability to have the Azure cloud be able to establish a network connection to on-premise resources (i.e. self hosted SQL Server)</p>
<p>WordPress is moving to Windows Azure</p>
]]></content:encoded>
			<wfw:commentRss>http://www.lifeonplanetgroove.com/blog/index.php/2009/11/18/pdc-day-1-keynote-notes/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Review &#8211; Accessibility Kit for SharePoint – Half Finished Product?</title>
		<link>http://www.lifeonplanetgroove.com/blog/index.php/2009/06/25/review-accessibility-kit-for-sharepoint-half-finished-product/</link>
		<comments>http://www.lifeonplanetgroove.com/blog/index.php/2009/06/25/review-accessibility-kit-for-sharepoint-half-finished-product/#comments</comments>
		<pubDate>Thu, 25 Jun 2009 22:29:54 +0000</pubDate>
		<dc:creator>Adam Toth</dc:creator>
				<category><![CDATA[SharePoint]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[accessibility kit for SharePoint]]></category>
		<category><![CDATA[aks]]></category>
		<category><![CDATA[wcag]]></category>

		<guid isPermaLink="false">http://www.lifeonplanetgroove.com/blog/index.php/2009/06/25/review-accessibility-kit-for-sharepoint-half-finished-product/</guid>
		<description><![CDATA[Rating: 2 out of 5 stars
I’m implementing the AKS for a customer, and I’m having a hard time understanding how this product actually made it to a public release. It feels like a product that is half finished, that was used as a springboard to creating a commercial product, while leaving the original free version [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Rating:</strong> 2 out of 5 stars</p>
<p>I’m implementing the AKS for a customer, and I’m having a hard time understanding how this product actually made it to a public release. It feels like a product that is half finished, that was used as a springboard to creating a commercial product, while leaving the original free version to the wayside. If you are considering working with this, you might want to read about the frustrations I encountered below:</p>
<h3>Installation experience – Where are those .bat files?</h3>
<p>When you download the AKS, you’ll get a zip file, which contains a folder and a single EXE installer.</p>
<p>Running the installer will perform the following tasks:</p>
<ol>
<li>Installs control adapters and reference files into an AKS folder in your Program Files directory.</li>
<li>Copies a feature and master pages/css styles to the /12/Templates/Features folder in your SharePoint installation (if you are running 32 bit).</li>
<li>Creates a Start Menu icon group for AKS tasks and links.</li>
</ol>
<p>After running through the installer, a quick look at the “Welcome to the Accessibility Kit…” PDF informs you that you need to install and activate the feature:</p>
<blockquote><p>The AKS Feature<br />
The AKS Feature is not the AKS Kit but a part of the Kit that works as a feature in MOSS. The AKS<br />
Feature installs the Example Master pages and the Modified CSS. You must install this by<br />
selecting Install AKS Feature from the Start Menu:  Start | All Programs | AKS by HiSoftware |<br />
AKS Feature install.  Once the feature is installed, you will still need to activate it within your<br />
SharePoint application through: Site Settings | Site Collection Features. <strong><em>Please note if you are<br />
on a 64 Bit server please follow the 64 Bit instructions.</em></strong></p></blockquote>
<p>I looked all over for those “<strong>64 bit instructions</strong>”, but there was nothing. There was a “64bit Feature Install” icon in the Start Menu, but no text anywhere instructing me to click on it.</p>
<p>I figured out that to install the feature, you need to click on either the 64bit Feature Install icon or the AKS Feature Install icon in the Start menu (<em>note that the shortcuts are only created for the current user, and there is no way to tell the installer to install for everyone</em>). If you run these shortcuts from the Start menu, the command window will flash, execute, and then immediately disappear, before you can check if it finished successfully or not. On a 64 bit server, you’ll see a flash of xcopy commands that copy styles and master pages into the /12 folders.</p>
<p>I wanted to be sure that it installed, so I tried to find the location of the batch file so I could run it again in a command prompt and actually see the result. I right-clicked the shortcut and went to Properties to figure out the target location, and it was greyed out:</p>
<p><a href="http://www.lifeonplanetgroove.com/blog/wp-content/uploads/2009/06/image2.png"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" src="http://www.lifeonplanetgroove.com/blog/wp-content/uploads/2009/06/image-thumb2.png" border="0" alt="image" width="381" height="537" /></a></p>
<p>I looked for the bat file in the Program Files directory, but no luck. Yuck! A .bat file that I can’t see or easily get to?</p>
<p>I figured out that it installed, because I then saw the feature in my Site Collection Features page. I activated it, and then tried to take a look at the master pages and styles.</p>
<h3>Control Adapters – Incorrect C#</h3>
<p>The AKS comes with several control adapters that rewrite some of the out-of-box control html to make it more compliant. Some of the C# adapter files have mistakes in the C# code that make them not able to compile. For example, in the Web Part Zone Smart Adapter for WCAG2.0, there is an extra curly brace, and even a reference to a variable that is not even declared in the file anywhere:</p>
<div id="codeSnippetWrapper" style="border: 1px solid silver; margin: 20px 0px 10px; padding: 4px; overflow: auto; text-align: left; line-height: 12pt; background-color: #f4f4f4; width: 97.5%; font-family: 'Courier New',courier,monospace; direction: ltr; max-height: 200px; font-size: 8pt; cursor: text;">
<div id="codeSnippet" style="border-style: none; padding: 0px; overflow: visible; text-align: left; line-height: 12pt; background-color: #f4f4f4; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt;">
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; text-align: left; line-height: 12pt; background-color: white; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt;"><span id="lnum1" style="color: #606060">   1:</span> <span style="color: #0000ff">else</span></pre>
<p><!--CRLF--></p>
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; text-align: left; line-height: 12pt; background-color: #f4f4f4; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt;"><span id="lnum2" style="color: #606060">   2:</span> {</pre>
<p><!--CRLF--></p>
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; text-align: left; line-height: 12pt; background-color: white; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt;"><span id="lnum3" style="color: #606060">   3:</span></pre>
<p><!--CRLF--></p>
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; text-align: left; line-height: 12pt; background-color: #f4f4f4; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt;"><span id="lnum4" style="color: #606060">   4:</span>     } <span style="color: #008000">// &lt;-- Extra brace?</span></pre>
<p><!--CRLF--></p>
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; text-align: left; line-height: 12pt; background-color: white; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt;"><span id="lnum5" style="color: #606060">   5:</span></pre>
<p><!--CRLF--></p>
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; text-align: left; line-height: 12pt; background-color: #f4f4f4; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt;"><span id="lnum6" style="color: #606060">   6:</span>     <span style="color: #008000">//Output sOutputBuilder to be rendered</span></pre>
<p><!--CRLF--></p>
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; text-align: left; line-height: 12pt; background-color: white; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt;"><span id="lnum7" style="color: #606060">   7:</span>     oOutput.Write(sOutputBuilder.ToString()); <span style="color: #008000">// &lt;-- sOutputBuilder is never declared in this file!</span></pre>
<p><!--CRLF--></p>
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; text-align: left; line-height: 12pt; background-color: #f4f4f4; width: 100%; font-family: 'Courier New',courier,monospace; direction: ltr; color: black; font-size: 8pt;"><span id="lnum8" style="color: #606060">   8:</span> }</pre>
<p><!--CRLF--></div>
</div>
<h3>“Smart Adapters” (not too bright)</h3>
<p>The AKS comes with several “Smart” control adapters (adapters that do not need a lot of configuration). The Web Part Zone Smart Adapter sounded like it had some promise, as it would convert a web part zone to use divs instead of tables.</p>
<p>However, when you install it, it has the side effect of not rendering any of your web part’s “Titles”. If you want to use the headers that come with the web parts, then this control will not work for you. It also prevented viewing web parts in Design mode, they would just disappear from the page.</p>
<p>Finally, it was hard to see the point of using the adapters at all, as all they appeared to do was add some labels to blogs, wikis, and search boxes. They will certainly not do anything at all if you use the CKS EBE or Wiki versions, or if you have customized/branded the search controls.</p>
<h3>Master pages and styles do not exist!</h3>
<p>Once you install the feature, a set of master pages and css styles will get installed to the master page and style library galleries for your site collection. I cracked open SharePoint designer, tried to open a master page, and got a nasty error message that the file did not exist and could not be opened.</p>
<p>In order to open the file, I had to run through the SharePoint UI, and “Publish” each master page and CSS style before I could access it via SharePoint designer. There was no mention of this anywhere in the documentation.</p>
<h3>Relative font sizes? Good luck!</h3>
<p>The AKS stylesheets attempt to change all SharePoint font size declarations into relative sizes in ems, rather than fixed pixel/point sizes. This might work fine for anonymous internet site pages, but if you will ever let your visitors view any of the system pages like list new/edit/upload pages or use out-of-box web parts, good luck tweaking styles for a month to get things right.</p>
<h3>Woops, what about default.master?</h3>
<p>The AKS installs alternate versions of the out-of-box publishing master pages, such as BlueBand.master, BlackBand.master, etc. I don’t know about you, but none of my customers have ever started from those master pages on internet sites, and all my intranet applications make heavy use of default.master. I was really disappointed to see that there was no alternate version of default.master.</p>
<h3>HCCE – Nothing but trouble</h3>
<p>The HiSoftware Code Compliance Kit (HCCE) is a SharePoint event handler that will look for a certain string of text in your SharePoint web pages, and replace it with different (possibly more accessible) text. You use a text file in which you specify pipe-delimited lines of text to find and replace (e.g. “Text to find|Text to replace with”). The HCCE has the following problems when implemented:</p>
<ul>
<li>There is only a debug build provided (no release version).</li>
<li>There is no source code (you cannot recompile).</li>
<li>There is no regex option for pattern matching. All strings must be matched and replaced exactly.</li>
<li>The DLL looks for a hard-coded path to the configuration text file in C:\Program Files\HiSoftware… This doesn’t work on 64bit systems because the installer installs to Program Files (x86). Since you can’t recompile the DLL, your only option is to copy the text file to the Program Files directory.</li>
<li>Once you implement the feature, your <a href="https://aks.hisoftware.com/Community/Lists/AKS%20Discussion%20Board/Flat.aspx?RootFolder=%2fCommunity%2fLists%2fAKS%20Discussion%20Board%2fHCCE%20Issue%20%2d%20User%20details%20outside%20HTML&amp;FolderCTID=0x012002008FC8608D3EEDD5409AF56558357C6785&amp;TopicsView=https%3A%2F%2Faks%2Ehisoftware%2Ecom%2FCommunity%2FLists%2FAKS%2520Discussion%2520Board%2FAllItems%2Easpx" target="_blank">SharePoint Welcome menu will get rendered above the &lt;html&gt; tag</a>, causing it to appear at the top of your screen and out of place. Several posts about this, and no response at all from HiSoftware.</li>
<li>The install/uninstall .bat files do not work, and need to be adjusted for 64bit machines. Why no WSP?</li>
</ul>
<h3>Conclusion</h3>
<p>Poorly documented, sloppily put together, and full of holes and mistakes, I was very disappointed in the AKS. Coupled with a total lack of support and responsiveness to issues on their web site, I think it reflects poorly on HiSoftware as a company.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.lifeonplanetgroove.com/blog/index.php/2009/06/25/review-accessibility-kit-for-sharepoint-half-finished-product/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
		<item>
		<title>BDC Picker.aspx QueryString Triggers Firewall Security</title>
		<link>http://www.lifeonplanetgroove.com/blog/index.php/2009/06/15/bdc-pickeraspx-querystring-triggers-firewall-security/</link>
		<comments>http://www.lifeonplanetgroove.com/blog/index.php/2009/06/15/bdc-pickeraspx-querystring-triggers-firewall-security/#comments</comments>
		<pubDate>Mon, 15 Jun 2009 17:00:00 +0000</pubDate>
		<dc:creator>Adam Toth</dc:creator>
				<category><![CDATA[SharePoint]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[BDC]]></category>

		<guid isPermaLink="false">http://www.lifeonplanetgroove.com/blog/index.php/2009/06/15/bdc-pickeraspx-querystring-triggers-firewall-security/</guid>
		<description><![CDATA[The implementation of the BDC entity picker dialog (opened with the Browse button) can cause some firewall and security software to think a worm or sql injection attack is happening and block the traffic.
The manner in which properties and entity IDs are encoded into long query string values makes the urls appear to be injection [...]]]></description>
			<content:encoded><![CDATA[<p>The implementation of the BDC entity picker dialog (opened with the Browse button) can cause some firewall and security software to think a worm or sql injection attack is happening and block the traffic.</p>
<p>The manner in which properties and entity IDs are encoded into long query string values makes the urls appear to be injection attacks. On a particular client’s BDC application, the picker dialog used a url similar to the following:</p>
<p><span style="text-decoration: underline;">http://domainname.org/_layouts/Picker.aspx?MultiSelect=False&amp;CustomProperty=uU2hhcmVQb2ludC5Qb3J0YWwsIFZlcnNpb249MTIuMC4wLAF%2F%2FAQAAAAAAAA9QcmltYXJ5Q29sdW1uSWQQU3lzdGVtSW5zdGFuY2VAAA<br />
AAAMAgAAAF9NaWNyb3NvZnQjAsIEN1bHR1cmU9bmV1dHJhbCwgUHVibG<br />
ljS2V5VG9rZW49NzFlOWJjZTExMWU5NDI5YwUBAAAAPk1pYAEAAAD%2F%2F%23Jvc29mdC5TaGFyZVBvaW50LlBvcnRhbC5XZWJDb250cm9scy5JdGVtUGlja2<br />
VyRXh0ZW5kZWREYXRhB<br />
JZAhFbnRpdHlJZBNTZWNvbmRhcnlDb2&#215;1bW<br />
5zSWRzAAAABw8PDw8CAAAANw4AAAcOAAAIDgAACQMAAAAPAwAAAAAAA<br />
AAPCwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA<br />
3D&amp;EntitySeparator=%00&amp;DialogTitle=Choose%20User&amp;DialogImage=%2F_layouts%2Fimages%2Fbizpicker.gif&amp;PickerDialogType=Microsoft.SharePoint.Portal.WebControls.ItemPickerDialog%2C%20Microsoft.SharePoint.Portal%2C%20Version%3D12.0.0.0%2C%20Culture%3Dneutral%2C%20PublicKeyToken%3D71e9bce111e9429c&amp;DefaultSearch=</span></p>
<p>Using the HTTP GET for this kind of thing is a bad idea, and I hope that Microsoft fixes this in the future.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.lifeonplanetgroove.com/blog/index.php/2009/06/15/bdc-pickeraspx-querystring-triggers-firewall-security/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WSS Script for non-AD Installation</title>
		<link>http://www.lifeonplanetgroove.com/blog/index.php/2009/04/23/wss-script-for-non-ad-installation/</link>
		<comments>http://www.lifeonplanetgroove.com/blog/index.php/2009/04/23/wss-script-for-non-ad-installation/#comments</comments>
		<pubDate>Thu, 23 Apr 2009 16:48:59 +0000</pubDate>
		<dc:creator>Adam Toth</dc:creator>
				<category><![CDATA[SharePoint]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[psconfig]]></category>
		<category><![CDATA[WSS]]></category>

		<guid isPermaLink="false">http://www.lifeonplanetgroove.com/blog/?p=363</guid>
		<description><![CDATA[Here is a script for configuring WSS 3.0 installation without Active Directory, where SQL Server resides on a separate box:
psconfig -cmd -configdb -create -server DBSERVERNAME -database wss_admin_config -user WSSSERVER\AppPoolAccountName -password p@ssword -dbuser SQLDBUSERNAME -dbpassword p@ssword -admincontentdatabase wss_admin_content
Based on the post here:
http://blogs.msdn.com/fooshen/archive/2007/02/01/installing-moss-without-ad.aspx
]]></description>
			<content:encoded><![CDATA[<p>Here is a script for configuring WSS 3.0 installation without Active Directory, where SQL Server resides on a separate box:</p>
<p>psconfig -cmd -configdb -create -server DBSERVERNAME -database wss_admin_config -user WSSSERVER\AppPoolAccountName -password p@ssword -dbuser SQLDBUSERNAME -dbpassword p@ssword -admincontentdatabase wss_admin_content</p>
<p>Based on the post here:</p>
<p>http://blogs.msdn.com/fooshen/archive/2007/02/01/installing-moss-without-ad.aspx</p>
]]></content:encoded>
			<wfw:commentRss>http://www.lifeonplanetgroove.com/blog/index.php/2009/04/23/wss-script-for-non-ad-installation/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Spam your own Blog so you can be a SharePoint MVP!</title>
		<link>http://www.lifeonplanetgroove.com/blog/index.php/2009/04/15/spam-your-own-blog-so-you-can-be-a-sharepoint-mvp/</link>
		<comments>http://www.lifeonplanetgroove.com/blog/index.php/2009/04/15/spam-your-own-blog-so-you-can-be-a-sharepoint-mvp/#comments</comments>
		<pubDate>Wed, 15 Apr 2009 17:10:48 +0000</pubDate>
		<dc:creator>Adam Toth</dc:creator>
				<category><![CDATA[SharePoint]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[MVP]]></category>
		<category><![CDATA[spam]]></category>

		<guid isPermaLink="false">http://www.lifeonplanetgroove.com/blog/index.php/2009/04/15/spam-your-own-blog-so-you-can-be-a-sharepoint-mvp/</guid>
		<description><![CDATA[Ahh, my rant for today.
With the announcement of the name for the next version of SharePoint on the OFFICIAL SharePoint team blog, I am waiting for the inevitable flood of pingbacks, trackbacks, and reposts about this in my RSS reader. This will be similar to the flood of reposts about “SharePoint Designer is now Free!” [...]]]></description>
			<content:encoded><![CDATA[<p>Ahh, my rant for today.</p>
<p>With the announcement of the name for the next version of SharePoint on the OFFICIAL SharePoint team blog, I am waiting for the inevitable flood of pingbacks, trackbacks, and reposts about this in my RSS reader. This will be similar to the flood of reposts about “SharePoint Designer is now Free!” I got a week ago. Same goes for the endless stream of tweets and retweets.</p>
<p>Is it really necessary to repost items from the official SharePoint team blog? If you are interested in SharePoint, you should be following this blog already, no?</p>
<p>I think much of this is a direct result of the MVP system and its requirements. When considering candidates for MVP, the quantity of blog posts, page hits, and comments are a big factor. I’ve seen some bloggers with high-quality posts get passed on as MVPs due to low numbers in their web stats. Are some bloggers trying to up their post counts? Is anybody monitoring quality as well as quantity? </p>
<p>I just can’t help but feel that this race to MVP status is encouraging this. Same goes for the MSDN SharePoint forums, where people seem to be falling all over themselves to answer questions as quickly as possible, without providing quality answers or even understanding the questions.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.lifeonplanetgroove.com/blog/index.php/2009/04/15/spam-your-own-blog-so-you-can-be-a-sharepoint-mvp/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>SharePoint Field Names have 32 Character Limit &#8211; So Do Replicated Profile Property Names</title>
		<link>http://www.lifeonplanetgroove.com/blog/index.php/2009/04/13/sharepoint-field-names-have-32-character-limit-so-do-replicated-profile-property-names/</link>
		<comments>http://www.lifeonplanetgroove.com/blog/index.php/2009/04/13/sharepoint-field-names-have-32-character-limit-so-do-replicated-profile-property-names/#comments</comments>
		<pubDate>Mon, 13 Apr 2009 17:14:39 +0000</pubDate>
		<dc:creator>Adam Toth</dc:creator>
				<category><![CDATA[SharePoint]]></category>
		<category><![CDATA[Technology]]></category>

		<guid isPermaLink="false">http://www.lifeonplanetgroove.com/blog/index.php/2009/04/13/sharepoint-field-names-have-32-character-limit-so-do-replicated-profile-property-names/</guid>
		<description><![CDATA[I ran into a situation where I created a User Profile Property with the Replicable checkbox set, which had a really long name. There were no errors when saving the profile property, however later on I started receiving errors in the Event Log:
failure trying to synch site [guid] for ContentDB [guid] WebApp [guid].&#160; Exception message [...]]]></description>
			<content:encoded><![CDATA[<p>I ran into a situation where I created a User Profile Property with the Replicable checkbox set, which had a really long name. There were no errors when saving the profile property, however later on I started receiving errors in the Event Log:</p>
<p>failure trying to synch site [guid] for ContentDB [guid] WebApp [guid].&#160; Exception message was A WSS internal name for profile property &#8216;ProfilePropertyWithReallyLongName&#8217; could not be found..</p>
<p>Apparently SharePoint has a limit of 32 characters for Internal Field Names. This will also apply to Replicable User Profile Properties since they will get synced down to the WSS Content DB in the UserInfo list.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.lifeonplanetgroove.com/blog/index.php/2009/04/13/sharepoint-field-names-have-32-character-limit-so-do-replicated-profile-property-names/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>SharePoint May Break Hyperlinks in Workflow Task Emails</title>
		<link>http://www.lifeonplanetgroove.com/blog/index.php/2009/04/09/sharepoint-may-break-hyperlinks-in-workflow-task-emails/</link>
		<comments>http://www.lifeonplanetgroove.com/blog/index.php/2009/04/09/sharepoint-may-break-hyperlinks-in-workflow-task-emails/#comments</comments>
		<pubDate>Thu, 09 Apr 2009 19:54:00 +0000</pubDate>
		<dc:creator>Adam Toth</dc:creator>
				<category><![CDATA[SharePoint]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[task]]></category>
		<category><![CDATA[workflow]]></category>

		<guid isPermaLink="false">http://www.lifeonplanetgroove.com/blog/?p=312</guid>
		<description><![CDATA[I ran into an issue where hyperlinks in workflow task emails where being automatically changed by SharePoint from absolute hyperlinks to relative ones.
Scenario:

You create a custom Visual Studio workflow and use the CreateTask activity.
You set your SPWorkflowTaskProperties.Description property to some HTML text.
In your Description HTML text, you have an html hyperlink &#60;a&#62; tag whose href=”” [...]]]></description>
			<content:encoded><![CDATA[<p>I ran into an issue where hyperlinks in workflow task emails where being automatically changed by SharePoint from absolute hyperlinks to relative ones.</p>
<p><strong>Scenario:</strong></p>
<ol>
<li>You create a custom Visual Studio workflow and use the CreateTask activity.</li>
<li>You set your SPWorkflowTaskProperties.Description property to some HTML text.</li>
<li>In your Description HTML text, you have an html hyperlink &lt;a&gt; tag whose href=”” attribute contains an absolute hyperlink to a resource in the same SharePoint farm (i.e. a list item).</li>
<li>Example: “Please review &lt;a href=”http://yourserver/site/lists/yourlist/dispform.aspx?ID=1”&gt;contract #12345&lt;/a&gt;”.</li>
</ol>
<p><strong>Goal:</strong></p>
<p>Users will receive the task email, and be able to click on the absolute URL in the email body to navigate to the SharePoint resource.</p>
<p><strong>Problem:</strong></p>
<p>It appears that SharePoint parses this HTML and readjusts the hyperlink and makes it relative.</p>
<p>Example: “Please review &lt;a href=”/lists/yourlist/dispform.aspx?ID=1”&gt;contract #12345&lt;/a&gt;”</p>
<p>This effectively breaks the hyperlink in the email client.</p>
<p>The only workaround was to get rid of the &lt;a&gt; tag and write out the hyperlink in full. For example:</p>
<p>“Please review contract #12345 (<a rel="nofollow" href="http://yourserver/site/lists/yourlist/dispform.aspx?ID=1">http://yourserver/site/lists/yourlist/dispform.aspx?ID=1</a>)”.</p>
<p>In this manner, SharePoint did not adjust the hyperlink at all.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.lifeonplanetgroove.com/blog/index.php/2009/04/09/sharepoint-may-break-hyperlinks-in-workflow-task-emails/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>BDC Error &#8211; Type does not match DotNet type of TypeDescriptor</title>
		<link>http://www.lifeonplanetgroove.com/blog/index.php/2009/04/09/bdc-error-type-does-not-match-dotnet-type-of-typedescriptor/</link>
		<comments>http://www.lifeonplanetgroove.com/blog/index.php/2009/04/09/bdc-error-type-does-not-match-dotnet-type-of-typedescriptor/#comments</comments>
		<pubDate>Thu, 09 Apr 2009 18:36:40 +0000</pubDate>
		<dc:creator>Adam Toth</dc:creator>
				<category><![CDATA[SharePoint]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[BDC]]></category>

		<guid isPermaLink="false">http://www.lifeonplanetgroove.com/blog/index.php/2009/04/09/bdc-error-type-does-not-match-dotnet-type-of-typedescriptor/</guid>
		<description><![CDATA[I ran into a BDC error, “Type does not match DotNet type of TypeDescriptor”, with a particular application definition I wrote. In this case, I had a specific finder method that took one input parameter (the identifier) that was of type System.Decimal. It turns out I didn’t specify a default value in the TypeDescriptor for [...]]]></description>
			<content:encoded><![CDATA[<p>I ran into a BDC error, “Type does not match DotNet type of TypeDescriptor”, with a particular application definition I wrote. In this case, I had a specific finder method that took one input parameter (the identifier) that was of type System.Decimal. It turns out I didn’t specify a default value in the TypeDescriptor for this input parameter in my XML definition. It looks like when you don’t set a default value, it will automatically set one for you and assign it a type of System.String. I was able to see this when I exported the BDC definition fresh, and noticed that SharePoint automatically added this default value and type for me.</p>
<p>Rule of thumb, always specify a default value for each input parameter.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.lifeonplanetgroove.com/blog/index.php/2009/04/09/bdc-error-type-does-not-match-dotnet-type-of-typedescriptor/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Workflow Task Locked when AssignedTo Changed to Support Multiple Selections</title>
		<link>http://www.lifeonplanetgroove.com/blog/index.php/2009/04/03/workflow-task-locked-when-assignedto-changed-to-support-multiple-selections/</link>
		<comments>http://www.lifeonplanetgroove.com/blog/index.php/2009/04/03/workflow-task-locked-when-assignedto-changed-to-support-multiple-selections/#comments</comments>
		<pubDate>Fri, 03 Apr 2009 17:53:21 +0000</pubDate>
		<dc:creator>Adam Toth</dc:creator>
				<category><![CDATA[SharePoint]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[OnTaskChanged]]></category>
		<category><![CDATA[task]]></category>
		<category><![CDATA[workflow]]></category>

		<guid isPermaLink="false">http://www.lifeonplanetgroove.com/blog/index.php/2009/04/03/workflow-task-locked-when-assignedto-changed-to-support-multiple-selections/</guid>
		<description><![CDATA[This is an old one, but some co-workers ran into this again recently on a project.
When you have a SharePoint workflow that assigns tasks (either Designer or Visual Studio workflow), when you change the Assigned To column on the task list to allow Multiple Selections, your workflow will hang and become unresponsive when a user [...]]]></description>
			<content:encoded><![CDATA[<p>This is an old one, but some co-workers ran into this again recently on a project.</p>
<p>When you have a SharePoint workflow that assigns tasks (either Designer or Visual Studio workflow), when you change the Assigned To column on the task list to allow Multiple Selections, your workflow will hang and become unresponsive when a user edits the task. You’ll receive a message about the task being locked (“This task is currently locked by a running workflow and cannot be edited”). OnTaskChanged events will no longer fire and your workflow will be stuck and unrecoverable.</p>
<p>There is no hotfix or workaround for this, so you simply cannot have the assigned to column support multiple users or groups. Just use a single group instead.</p>
<p>Following are some other resources discussing this:</p>
<ul>
<li><a title="http://www.eggheadcafe.com/conversation.aspx?messageid=32931131&amp;threadid=32931131" href="http://www.eggheadcafe.com/conversation.aspx?messageid=32931131&amp;threadid=32931131">http://www.eggheadcafe.com/conversation.aspx?messageid=32931131&amp;threadid=32931131</a></li>
<li><a title="http://connect.microsoft.com/wf/feedback/ViewFeedback.aspx?FeedbackID=273487" href="http://connect.microsoft.com/wf/feedback/ViewFeedback.aspx?FeedbackID=273487">http://connect.microsoft.com/wf/feedback/ViewFeedback.aspx?FeedbackID=273487</a></li>
<li><a title="http://social.technet.microsoft.com/Forums/en-US/sharepointworkflow/thread/8ec834b6-5408-4079-bdfb-b88d341b36bf/" href="http://social.technet.microsoft.com/Forums/en-US/sharepointworkflow/thread/8ec834b6-5408-4079-bdfb-b88d341b36bf/">http://social.technet.microsoft.com/Forums/en-US/sharepointworkflow/thread/8ec834b6-5408-4079-bdfb-b88d341b36bf/</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.lifeonplanetgroove.com/blog/index.php/2009/04/03/workflow-task-locked-when-assignedto-changed-to-support-multiple-selections/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>SharePoint Document Converter to PDF Using Oracle Outside In (How-to)</title>
		<link>http://www.lifeonplanetgroove.com/blog/index.php/2009/03/19/sharepoint-document-converter-to-pdf-using-oracle-outside-in-how-to/</link>
		<comments>http://www.lifeonplanetgroove.com/blog/index.php/2009/03/19/sharepoint-document-converter-to-pdf-using-oracle-outside-in-how-to/#comments</comments>
		<pubDate>Thu, 19 Mar 2009 19:55:45 +0000</pubDate>
		<dc:creator>Adam Toth</dc:creator>
				<category><![CDATA[SharePoint]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[Document Converter]]></category>
		<category><![CDATA[MOSS]]></category>
		<category><![CDATA[Oracle]]></category>
		<category><![CDATA[Outside In]]></category>
		<category><![CDATA[PDF]]></category>

		<guid isPermaLink="false">http://www.lifeonplanetgroove.com/blog/index.php/2009/03/19/sharepoint-document-converter-to-pdf-using-oracle-outside-in-how-to/</guid>
		<description><![CDATA[I’ve seen several examples of creating document converters in SharePoint that convert documents to PDF format, using tools like Aspose and other print-based solutions.
I recently did a proof of concept for a customer that used a different product, Outside In PDF Export from Oracle. This is an interpretive converter that can take a slew of [...]]]></description>
			<content:encoded><![CDATA[<p>I’ve seen several examples of creating document converters in SharePoint that convert documents to PDF format, using tools like Aspose and other print-based solutions.</p>
<p>I recently did a proof of concept for a customer that used a different product, Outside In PDF Export from Oracle. This is an interpretive converter that can take a slew of file formats (including MS Office) and automatically convert them into a PDF file. If you aren’t familiar with PDF conversion, there are two basic kinds:</p>
<ul>
<li><strong>Print based conversion</strong> – This is the Acrobat Distiller approach. Uses a printer driver that accepts the PostScript output from an application (such as Microsoft Word), and converts it to PDF. This approach results in the most accurate conversions, but is hardest to automate because it involves opening the native application and automating its “Print” functionality. </li>
<li><strong>Interpretive conversion</strong> – This is an approach that reads the contents of a native file format and translates the contents into PDF format. This results in potentially less accurate conversions, but is much easier to automate. </li>
</ul>
<p>Outside In, and in particular the PDF Export SDK, is an EXE and set of DLLs that contains logic to covert over 400 different file types to PDF. In combination with Transformation Server (a web services wrapper to PDF Export), you can create SharePoint Document Converters that will convert your documents to PDF format.</p>
<h3>How I Did It</h3>
<p>For the proof of concept, I followed these steps to get it working</p>
<ul>
<li>Download PDF Export, Transformation Server, and SrvAny.exe. </li>
<li>Install and Configure the Transformation Server and Web Service </li>
<li>Develop and Install the Document Converter </li>
</ul>
<h3>Download of PDF Export 8.3.0 and Transformation Server 8.2.0</h3>
<p>You can download both products here: </p>
<p><a title="http://www.oracle.com/technology/products/content-management/oit/oit_dl_otn.html" href="http://www.oracle.com/technology/products/content-management/oit/oit_dl_otn.html">http://www.oracle.com/technology/products/content-management/oit/oit_dl_otn.html</a></p>
<p>You’ll have to register with an Oracle account to get it, but it is a freely available trial version, and does not appear to have any trial expiration limitations.</p>
<p>You will also need SrvAny.exe to run Transformation Server as a Windows Service. I found this site that had a download:</p>
<p><a title="http://www.tacktech.com/display.cfm?ttid=197" href="http://www.tacktech.com/display.cfm?ttid=197">http://www.tacktech.com/display.cfm?ttid=197</a></p>
<h3>Install and Configure the Transformation Server and Web Service</h3>
<h3></h3>
<h3></h3>
<p>Extract the contents of the Transformation Server zip you downloaded to a folder on your server that will do the document conversions (e.g. “C:\PDFConverter”). There will be a bunch of dlls, some wsdl files (we’ll use those later), some EXE’s (which are run as a service), and some XML config files.</p>
<p>Transformation Server doesn’t really know anything about PDF generation, it is just a web service wrapper, so we’ll need to place the PDF Export library into our folder so it can use it. Extract the contents of PDF Export 8.3.0 to a separate folder on your machine. Grab <strong>every DLL</strong> in the root folder, as well as <strong>exporter.exe</strong>, <strong>px.cfg</strong>, and <strong>cmmap000.bin</strong> and copy those files into “C:\PDFConverter”.</p>
<p>Open the file called server_startup.xml in “C:\PDFConverter”. This configures the service to listen on a specific port and hostname/ip address. I went ahead and changed the port, but you can leave it as is if you wish, just make note of the port for later:</p>
<div style="border-right: gray 1px solid; padding-right: 4px; border-top: gray 1px solid; padding-left: 4px; font-size: 8pt; padding-bottom: 4px; margin: 20px 0px 10px; overflow: auto; border-left: gray 1px solid; width: 97.5%; cursor: text; max-height: 200px; line-height: 12pt; padding-top: 4px; border-bottom: gray 1px solid; font-family: consolas, &#39;Courier New&#39;, courier, monospace; background-color: #f4f4f4">
<div style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #008000">&lt;!--Connections are the TCP/IP socket connections that the server accepts from clients.--&gt;</span></pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #0000ff">&lt;</span><span style="color: #800000">connectionsInfo</span> <span style="color: #ff0000">xsi:type</span><span style="color: #0000ff">=&quot;tss:ConnectionsInfo&quot;</span><span style="color: #0000ff">&gt;</span></pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">    <span style="color: #008000">&lt;!--The serverName is the host name, or dotted IP address that the server will use when establishing its presence on the network.--&gt;</span></pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">    <span style="color: #0000ff">&lt;</span><span style="color: #800000">serverName</span> <span style="color: #ff0000">xsi:type</span><span style="color: #0000ff">=&quot;xsd:string&quot;</span><span style="color: #0000ff">&gt;</span>localhost<span style="color: #0000ff">&lt;/</span><span style="color: #800000">serverName</span><span style="color: #0000ff">&gt;</span></pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">    <span style="color: #008000">&lt;!--The port is the TCP/IP port that the server will establish a listener on for accepting connections.--&gt;</span></pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">    <span style="color: #0000ff">&lt;</span><span style="color: #800000">port</span> <span style="color: #ff0000">xsi:type</span><span style="color: #0000ff">=&quot;xsd:unsignedInt&quot;</span><span style="color: #0000ff">&gt;</span>9000<span style="color: #0000ff">&lt;/</span><span style="color: #800000">port</span><span style="color: #0000ff">&gt;</span></pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">    <span style="color: #008000">&lt;!--The server will disconnect idle connections that have remained idle for too long. The activityTimeout sets the period of time a connection must be idle before it will be disconnected by the server.--&gt;</span></pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">    <span style="color: #0000ff">&lt;</span><span style="color: #800000">activityTimeoutSecs</span> <span style="color: #ff0000">xsi:type</span><span style="color: #0000ff">=&quot;xsd:unsignedInt&quot;</span><span style="color: #0000ff">&gt;</span>1800<span style="color: #0000ff">&lt;/</span><span style="color: #800000">activityTimeoutSecs</span><span style="color: #0000ff">&gt;</span></pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #0000ff">&lt;/</span><span style="color: #800000">connectionsInfo</span><span style="color: #0000ff">&gt;</span></pre>
</p></div>
</div>
<p>Go ahead and double-click <strong>tsmanager.exe</strong> to make sure it is working. It should open a console window and show you what host/port it is listening on.</p>
<p><a href="http://www.lifeonplanetgroove.com/blog/wp-content/uploads/2009/03/clip-image002.jpg"><img title="tsmanager console" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="195" alt="tsmanager console" src="http://www.lifeonplanetgroove.com/blog/wp-content/uploads/2009/03/clip-image002-thumb.jpg" width="560" border="0" /></a></p>
<p>Press <strong>Ctrl + C</strong> to quit.</p>
<p>Now we need to run this program as a service, so that it is always available, even when nobody is logged on to the server. Place <strong>instsrv.exe</strong> and <strong>srvany.exe</strong> in your C:\PDFConverter folder. Run the following command prompt:</p>
<div style="border-right: gray 1px solid; padding-right: 4px; border-top: gray 1px solid; padding-left: 4px; font-size: 8pt; padding-bottom: 4px; margin: 20px 0px 10px; overflow: auto; border-left: gray 1px solid; width: 97.5%; cursor: text; max-height: 200px; line-height: 12pt; padding-top: 4px; border-bottom: gray 1px solid; font-family: consolas, &#39;Courier New&#39;, courier, monospace; background-color: #f4f4f4">
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">C:\PDFConverter<span style="color: #0000ff">&gt;</span>instsrv.exe &quot;Transformation Server&quot; c:\PDFConverter\srvany.exe 

The service was successfuly added! Make sure that you go into the Control Panel
and use the Services applet to change the Account Name and Password that this
newly installed service will use for its Security Context.</pre>
</div>
<p>Open <strong>regedit</strong>, and browse to <strong>HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Transformation Server</strong>.</p>
<p>Create a new key called <strong>Parameters</strong>, and add a new string value inside this key called <strong>Application</strong>, with a value of <strong>C:\PDFConverter\tsmanager.exe</strong>.</p>
<p><a href="http://www.lifeonplanetgroove.com/blog/wp-content/uploads/2009/03/clip-image0026.jpg"><img title="ts registry entries" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="291" alt="ts registry entries" src="http://www.lifeonplanetgroove.com/blog/wp-content/uploads/2009/03/clip-image0026-thumb.jpg" width="617" border="0" /></a></p>
<p>Go to the services console and start the <strong>Transformation Server</strong> service. Optionally, you can also go to the Properties for this service account, and change the Identity that this service runs under.</p>
<h3>Develop the Document Converter</h3>
<p>Create a new .NET C# console application project and solution from within Visual Studio 2008, called PDFConverter.</p>
<p>Right-click the project in Solution Explorer and choose <strong>Add Service Reference…</strong></p>
<p>Since the wsdl files for Transformation Server are not compliant with WCF services, choose the <strong>Advanced…</strong> button on the <strong>Add Service Reference</strong> dialog, and then choose the <strong>Add Web Reference…</strong> button to add a .NET 2.0 style web service reference. In the Add Web Reference dialog, enter the path to the wsdl file: C:\PDFConverter\transform_net_2005.wsdl. Hit Go.</p>
<p>Once your web reference has resolved, enter <strong>TransformationServer</strong> in the <strong>Web reference name</strong> box and click the <strong>Add Reference</strong> button.</p>
<p>Open your <strong>Properties/Settings.settings</strong> file. There will be one setting in the file for the web service URL. Change this to the right hostname/port in your server_settings.xml for Transformation Server. Make sure to include a trailing “<strong>/transform</strong>” on the end, e.g.:</p>
<p><strong>http://localhost:9000/transform</strong></p>
<p>A document converter is just a console EXE that is called by SharePoint with command line arguments, so we’ll setup our console app to handle the arguments. In <strong>Program.cs</strong>, before <strong>static void Main</strong>, add the following code (<a href="http://msdn.microsoft.com/en-us/library/bb897921.aspx" target="_blank">taken from the WSS SDK here</a>):</p>
<div style="border-right: gray 1px solid; padding-right: 4px; border-top: gray 1px solid; padding-left: 4px; font-size: 8pt; padding-bottom: 4px; margin: 20px 0px 10px; overflow: auto; border-left: gray 1px solid; width: 97.5%; cursor: text; max-height: 200px; line-height: 12pt; padding-top: 4px; border-bottom: gray 1px solid; font-family: consolas, &#39;Courier New&#39;, courier, monospace; background-color: #f4f4f4">
<div style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #cc6633">#region</span> Argument Handling Data</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">&#160;</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #0000ff">private</span> <span style="color: #0000ff">enum</span> ArgumentCode</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">{</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">    Help,</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">    InputFile,</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">    OutputFile,</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">    LogFile,</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">    ConfigFile</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">}</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">&#160;</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #0000ff">private</span> <span style="color: #0000ff">struct</span> ArgumentPair</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">{</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">    <span style="color: #0000ff">public</span> ArgumentPair(ArgumentCode c, <span style="color: #0000ff">string</span> s)</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">    {</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">        <span style="color: #0000ff">this</span>.argType = c;</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">        <span style="color: #0000ff">this</span>.argFlagString = s;</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">    }</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">&#160;</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">    <span style="color: #0000ff">public</span> ArgumentCode argType;</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">    <span style="color: #0000ff">public</span> <span style="color: #0000ff">string</span> argFlagString;</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">}</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">&#160;</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #0000ff">private</span> <span style="color: #0000ff">static</span> ArgumentPair[] PossibleArguments = <span style="color: #0000ff">new</span> ArgumentPair[] {</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">    <span style="color: #0000ff">new</span> ArgumentPair(ArgumentCode.Help, <span style="color: #006080">&quot;-?&quot;</span>),</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">    <span style="color: #0000ff">new</span> ArgumentPair(ArgumentCode.Help, <span style="color: #006080">&quot;-help&quot;</span>),</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">    <span style="color: #0000ff">new</span> ArgumentPair(ArgumentCode.InputFile, <span style="color: #006080">&quot;-in&quot;</span>),</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">    <span style="color: #0000ff">new</span> ArgumentPair(ArgumentCode.OutputFile, <span style="color: #006080">&quot;-out&quot;</span>),</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">    <span style="color: #0000ff">new</span> ArgumentPair(ArgumentCode.LogFile, <span style="color: #006080">&quot;-log&quot;</span>),</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">    <span style="color: #0000ff">new</span> ArgumentPair(ArgumentCode.ConfigFile, <span style="color: #006080">&quot;-config&quot;</span>),</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">};</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">&#160;</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #0000ff">private</span> <span style="color: #0000ff">static</span> Dictionary&lt;ArgumentCode, <span style="color: #0000ff">string</span>&gt; actualArguments = <span style="color: #0000ff">new</span> Dictionary&lt;ArgumentCode, <span style="color: #0000ff">string</span>&gt;();</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">&#160;</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #cc6633">#endregion</span></pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">&#160;</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #008000">/// &lt;summary&gt;</span></pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #008000">/// Prints out the usage help to the console.</span></pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #008000">/// &lt;/summary&gt;</span></pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #0000ff">static</span> <span style="color: #0000ff">void</span> PrintUsage()</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">{</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">    Console.WriteLine(<span style="color: #006080">&quot;Usage: {0} -in &lt;inputfilename&gt; -out &lt;outputfilename&gt; -config &lt;configfilename&gt; [-log &lt;logfilename&gt;]&quot;</span>,</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">                      Assembly.GetExecutingAssembly().ManifestModule.Name);</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">}</pre>
</p></div>
</div>
<p>Add the following code inside static void Main:</p>
<div style="border-right: gray 1px solid; padding-right: 4px; border-top: gray 1px solid; padding-left: 4px; font-size: 8pt; padding-bottom: 4px; margin: 20px 0px 10px; overflow: auto; border-left: gray 1px solid; width: 97.5%; cursor: text; max-height: 200px; line-height: 12pt; padding-top: 4px; border-bottom: gray 1px solid; font-family: consolas, &#39;Courier New&#39;, courier, monospace; background-color: #f4f4f4">
<div style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #cc6633">#region</span> Argument Handling Code</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #008000">// Read arguments.</span></pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #0000ff">for</span> (<span style="color: #0000ff">int</span> i = 0; i &lt; args.Length; i++)</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">{</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">    <span style="color: #0000ff">bool</span> argumentValid = <span style="color: #0000ff">false</span>;</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">    <span style="color: #0000ff">foreach</span> (ArgumentPair ap <span style="color: #0000ff">in</span> PossibleArguments)</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">    {</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">        <span style="color: #0000ff">if</span> (String.Compare(ap.argFlagString, args[i], StringComparison.OrdinalIgnoreCase) == 0)</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">        {</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">            <span style="color: #0000ff">switch</span> (ap.argType)</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">            {</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">                <span style="color: #0000ff">case</span> ArgumentCode.Help:</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">                    PrintUsage();</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">                    <span style="color: #0000ff">return</span>;</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">&#160;</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">                <span style="color: #0000ff">case</span> ArgumentCode.InputFile:</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">                <span style="color: #0000ff">case</span> ArgumentCode.OutputFile:</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">                <span style="color: #0000ff">case</span> ArgumentCode.ConfigFile:</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">                <span style="color: #0000ff">case</span> ArgumentCode.LogFile:</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">                    <span style="color: #0000ff">if</span> (i + 1 &lt; args.Length)</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">                    {</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">                        actualArguments[ap.argType] = args[i + 1];</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">                        i++;</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">                        argumentValid = <span style="color: #0000ff">true</span>;</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">                    }</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">                    <span style="color: #0000ff">break</span>;</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">            }</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">            <span style="color: #0000ff">break</span>;</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">        }</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">    }</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">&#160;</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">    <span style="color: #0000ff">if</span> (!argumentValid)</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">    {</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">        Console.WriteLine(<span style="color: #006080">&quot;unknown argument {0}&quot;</span>, args[i]);</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">        PrintUsage();</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">        <span style="color: #0000ff">return</span>;</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">    }</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">}</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">&#160;</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #008000">// Validate arguments.</span></pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #0000ff">if</span> (!actualArguments.ContainsKey(ArgumentCode.InputFile) ||</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">    String.IsNullOrEmpty(actualArguments[ArgumentCode.InputFile]) ||</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">    !actualArguments.ContainsKey(ArgumentCode.OutputFile) ||</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">    String.IsNullOrEmpty(actualArguments[ArgumentCode.OutputFile]) ||</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">    !actualArguments.ContainsKey(ArgumentCode.ConfigFile) ||</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">    String.IsNullOrEmpty(actualArguments[ArgumentCode.ConfigFile]))</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">{</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">    Console.WriteLine(<span style="color: #006080">&quot;required argument missing&quot;</span>);</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">    PrintUsage();</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">    <span style="color: #0000ff">return</span>;</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">}</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">&#160;</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #cc6633">#endregion</span></pre>
</p></div>
</div>
<p>Now that the command line arguments can be parsed, it is time to use the web service and do the document conversion. The Transformation Server download contained some code samples for C#, and I was able to basically use as-is, only modifying the input and output file paths. After the argument handling code in <strong>static void Main</strong>, add the following code:</p>
<div style="border-right: gray 1px solid; padding-right: 4px; border-top: gray 1px solid; padding-left: 4px; font-size: 8pt; padding-bottom: 4px; margin: 20px 0px 10px; overflow: auto; border-left: gray 1px solid; width: 97.5%; cursor: text; max-height: 200px; line-height: 12pt; padding-top: 4px; border-bottom: gray 1px solid; font-family: consolas, &#39;Courier New&#39;, courier, monospace; background-color: #f4f4f4">
<div style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">TransformationServer.transform t = <span style="color: #0000ff">new</span> TransformationServer.transform();</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">&#160;</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">TransformationServer.IOSpec source = <span style="color: #0000ff">new</span> TransformationServer.IOSpec();</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">source.spec = <span style="color: #0000ff">new</span> TransformationServer.stringData();</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">source.spec.base64 = <span style="color: #0000ff">false</span>;</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">source.spec.charset = TransformationServer.CharacterSetEnum.windows1250;</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">source.spec.str = actualArguments[ArgumentCode.InputFile];</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">source.specType = <span style="color: #006080">&quot;path&quot;</span>;</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">TransformationServer.IOSpec sink = <span style="color: #0000ff">new</span> TransformationServer.IOSpec();</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">sink.spec = <span style="color: #0000ff">new</span> TransformationServer.stringData();</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">sink.spec.base64 = <span style="color: #0000ff">false</span>;</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">sink.spec.charset = TransformationServer.CharacterSetEnum.windows1250;</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">sink.spec.str = actualArguments[ArgumentCode.OutputFile];</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">sink.specType = <span style="color: #006080">&quot;path&quot;</span>;</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #0000ff">string</span> outputFormat = <span style="color: #006080">&quot;pdf&quot;</span>;</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #0000ff">string</span> optionSet = <span style="color: #006080">&quot;&quot;</span>;</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">TransformationServer.Option[] options = <span style="color: #0000ff">new</span> TransformationServer.Option[0];</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">TransformationServer.stringData resultMsg;</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">TransformationServer.IOSpec[] resultDocs;</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">UInt32 result = t.Transform(source, sink, outputFormat, optionSet, options, <span style="color: #0000ff">out</span> resultMsg, <span style="color: #0000ff">out</span> resultDocs);</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">Console.WriteLine(<span style="color: #006080">&quot;The result is {0} {1}&quot;</span>, result, resultMsg.str);</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #0000ff">foreach</span> (TransformationServer.IOSpec ios <span style="color: #0000ff">in</span> resultDocs)</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">{</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">    ASCIIEncoding encoding = <span style="color: #0000ff">new</span> ASCIIEncoding();</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">    <span style="color: #0000ff">string</span> constructedString = encoding.GetString(Convert.FromBase64String(ios.spec.str));</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">    Console.WriteLine(<span style="color: #006080">&quot; {0}&quot;</span>, constructedString);</pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">}</pre>
</p></div>
</div>
<p>Most of this code is cut-and-paste from the sample, and we are just swapping the input file path (source.spec.str) and output file path (sink.spec.str) with the arguments from the command line.</p>
<h3>Installing the Converter</h3>
<p>To install the converter, you need to create a feature file, install the feature, and place the converter EXE in the proper directory.</p>
<p>Create a feature.xml file and add the following:</p>
<div style="border-right: gray 1px solid; padding-right: 4px; border-top: gray 1px solid; padding-left: 4px; font-size: 8pt; padding-bottom: 4px; margin: 20px 0px 10px; overflow: auto; border-left: gray 1px solid; width: 97.5%; cursor: text; max-height: 200px; line-height: 12pt; padding-top: 4px; border-bottom: gray 1px solid; font-family: consolas, &#39;Courier New&#39;, courier, monospace; background-color: #f4f4f4">
<div style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #0000ff">&lt;</span><span style="color: #800000">Feature</span> <span style="color: #ff0000">xmlns</span><span style="color: #0000ff">=&quot;http://schemas.microsoft.com/sharepoint/&quot;</span></pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">    <span style="color: #ff0000">Id</span><span style="color: #0000ff">=&quot;{9E2A5231-0D81-4de8-8504-36A61026680E}&quot;</span></pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">    <span style="color: #ff0000">Title</span><span style="color: #0000ff">=&quot;PDF Converter&quot;</span></pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">    <span style="color: #ff0000">Description</span><span style="color: #0000ff">=&quot;PDF Converter.&quot;</span></pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">    <span style="color: #ff0000">Scope</span><span style="color: #0000ff">=&quot;WebApplication&quot;</span><span style="color: #0000ff">&gt;</span></pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">  <span style="color: #0000ff">&lt;</span><span style="color: #800000">ElementManifests</span><span style="color: #0000ff">&gt;</span></pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">    <span style="color: #0000ff">&lt;</span><span style="color: #800000">ElementManifest</span> <span style="color: #ff0000">Location</span><span style="color: #0000ff">=&quot;Elements.xml&quot;</span><span style="color: #0000ff">/&gt;</span></pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">    <span style="color: #0000ff">&lt;</span><span style="color: #800000">ElementFile</span> <span style="color: #ff0000">Location</span><span style="color: #0000ff">=&quot;PDFConverter.exe&quot;</span><span style="color: #0000ff">/&gt;</span></pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">  <span style="color: #0000ff">&lt;/</span><span style="color: #800000">ElementManifests</span><span style="color: #0000ff">&gt;</span></pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #0000ff">&lt;/</span><span style="color: #800000">Feature</span><span style="color: #0000ff">&gt;</span></pre>
</p></div>
</div>
<p>Create an Elements.xml file, and add the following code. You can create as many document converter nodes as you need for each file type you want to convert (just make sure each has a unique guid).</p>
<div style="border-right: gray 1px solid; padding-right: 4px; border-top: gray 1px solid; padding-left: 4px; font-size: 8pt; padding-bottom: 4px; margin: 20px 0px 10px; overflow: auto; border-left: gray 1px solid; width: 97.5%; cursor: text; max-height: 200px; line-height: 12pt; padding-top: 4px; border-bottom: gray 1px solid; font-family: consolas, &#39;Courier New&#39;, courier, monospace; background-color: #f4f4f4">
<div style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"><span style="color: #0000ff">&lt;</span><span style="color: #800000">Elements</span> <span style="color: #ff0000">xmlns</span><span style="color: #0000ff">=&quot;http://schemas.microsoft.com/sharepoint/&quot;</span><span style="color: #0000ff">&gt;</span></pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">  <span style="color: #0000ff">&lt;</span><span style="color: #800000">DocumentConverter</span> <span style="color: #ff0000">Id</span><span style="color: #0000ff">=&quot;{513130EB-A1BC-46d3-919C-1E00B6BCA742}&quot;</span></pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">      <span style="color: #ff0000">Name</span><span style="color: #0000ff">=&quot;DOCX to PDF Converter&quot;</span></pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">      <span style="color: #ff0000">App</span><span style="color: #0000ff">=&quot;PDFConverter.exe&quot;</span></pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">      <span style="color: #ff0000">From</span><span style="color: #0000ff">=&quot;docx&quot;</span></pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">      <span style="color: #ff0000">To</span><span style="color: #0000ff">=&quot;pdf&quot;</span></pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">    <span style="color: #0000ff">/&gt;</span></pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">  <span style="color: #0000ff">&lt;</span><span style="color: #800000">DocumentConverter</span> <span style="color: #ff0000">Id</span><span style="color: #0000ff">=&quot;{E7374437-157E-4fb4-A4E9-A19026BAE17A}&quot;</span></pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">    <span style="color: #ff0000">Name</span><span style="color: #0000ff">=&quot;VSD to PDF Converter&quot;</span></pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">    <span style="color: #ff0000">App</span><span style="color: #0000ff">=&quot;PDFConverter.exe&quot;</span></pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">    <span style="color: #ff0000">From</span><span style="color: #0000ff">=&quot;vsd&quot;</span></pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">    <span style="color: #ff0000">To</span><span style="color: #0000ff">=&quot;pdf&quot;</span></pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">    <span style="color: #0000ff">/&gt;</span></pre>
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"><span style="color: #0000ff">&lt;/</span><span style="color: #800000">Elements</span><span style="color: #0000ff">&gt;</span></pre>
</p></div>
</div>
<p>Place both these files in a folder called <strong>PDFConverter</strong> in your <strong>…/12/TEMPLATE/Features</strong> folder, and use stsadm to activate the feature on a particular web application.</p>
<div style="border-right: gray 1px solid; padding-right: 4px; border-top: gray 1px solid; padding-left: 4px; font-size: 8pt; padding-bottom: 4px; margin: 20px 0px 10px; overflow: auto; border-left: gray 1px solid; width: 97.5%; cursor: text; max-height: 200px; line-height: 12pt; padding-top: 4px; border-bottom: gray 1px solid; font-family: consolas, &#39;Courier New&#39;, courier, monospace; background-color: #f4f4f4">
<pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &#39;Courier New&#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\BIN<span style="color: #0000ff">&gt;</span>stsadm
-o installfeature -name PDFConverter 

Operation completed successfully.  

C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\BIN<span style="color: #0000ff">&gt;</span>stsadm
-o activatefeature -name PDFConverter -url http://mossdev:8080 

Operation completed successfully.</pre>
</div>
<p>After activating the feature, go to Central Administration, Applications tab, and click the <strong>Document Conversions</strong> link. Ensure that your web application has document conversions turned on. You should see your document converters in the list at the bottom of the screen:</p>
<p><a href="http://www.lifeonplanetgroove.com/blog/wp-content/uploads/2009/03/clip-image0028.jpg"><img title="Document Conversion Settings" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="168" alt="Document Conversion Settings" src="http://www.lifeonplanetgroove.com/blog/wp-content/uploads/2009/03/clip-image0028-thumb.jpg" width="244" border="0" /></a></p>
<p>Since you are using a Web Service, a proxy class needs to be generated dynamically, and so you’ll need to give your SharePoint Document Conversion User Account rights to create this in <strong>C:\Windows\Temp</strong> (or whatever your system temp directory is). Grant <strong>List Folder Contents</strong> and <strong>Read</strong> permissions to the Document Conversion account (usually a local machine account that starts with “HVU_”) on your Temp folder.</p>
<p>The Document Conversion service stores temporary documents in the following folder: <strong>C:\Program Files\Microsoft Office Servers\12.0\BIN\HtmlTrLauncher</strong>. By default, this folder only grants the Document Conversion User account access. Since the Transformation Server windows service is running under its own account, you need to give this account access to the folder. Grant the account that your Transformation Server windows service is running under <strong>Read</strong> and <strong>Write</strong> access to this folder.</p>
<p>The last step involves copying over your compiled console EXE and exe.config file into the following SharePoint folder (the actual path may vary depending on your setup, but you should be able to find the TransformApps folder):</p>
<p><strong>C:\Program Files\Microsoft Office Servers\12.0\TransformApps</strong></p>
<h3>Results</h3>
<p>Navigate to your SharePoint site. Upload a document into your document library (make sure it is a file extension that you’ve configured in your Elements.xml file). Open the drop down menu and choose <strong>Convert Document</strong>. Your document converter should appear in the list. Run the conversion. After around a minute if you refresh your document library and all went well, you should see your PDF file in the library.</p>
<p><a href="http://www.lifeonplanetgroove.com/blog/wp-content/uploads/2009/03/clip-image0023.jpg"><img title="Generated PDF in document library" style="border-right: 0px; border-top: 0px; display: inline; border-left: 0px; border-bottom: 0px" height="184" alt="Generated PDF in document library" src="http://www.lifeonplanetgroove.com/blog/wp-content/uploads/2009/03/clip-image0023-thumb.jpg" width="244" border="0" /></a></p>
<p>Here is a picture of a generated Visio document in PDF format, not too bad:</p>
</p>
<p><a href="http://www.lifeonplanetgroove.com/blog/wp-content/uploads/2009/03/clip-image0021.jpg"><img title="exported visio file" style="border-right: 0px; border-top: 0px; display: inline; border-left: 0px; border-bottom: 0px" height="244" alt="exported visio file" src="http://www.lifeonplanetgroove.com/blog/wp-content/uploads/2009/03/clip-image0021-thumb.jpg" width="220" border="0" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.lifeonplanetgroove.com/blog/index.php/2009/03/19/sharepoint-document-converter-to-pdf-using-oracle-outside-in-how-to/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Using Feature XML Files to Store Timer Job Configuration Settings</title>
		<link>http://www.lifeonplanetgroove.com/blog/index.php/2009/03/06/using-feature-xml-files-to-store-timer-job-configuration-settings/</link>
		<comments>http://www.lifeonplanetgroove.com/blog/index.php/2009/03/06/using-feature-xml-files-to-store-timer-job-configuration-settings/#comments</comments>
		<pubDate>Fri, 06 Mar 2009 22:20:11 +0000</pubDate>
		<dc:creator>Adam Toth</dc:creator>
				<category><![CDATA[SharePoint]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[Configuration]]></category>
		<category><![CDATA[Features]]></category>
		<category><![CDATA[Timer Jobs]]></category>

		<guid isPermaLink="false">http://www.lifeonplanetgroove.com/blog/index.php/2009/03/06/using-feature-xml-files-to-store-timer-job-configuration-settings/</guid>
		<description><![CDATA[While working on a Timer Job project, I needed a flexible way to store one-time configuration settings. I was using a SharePoint Feature and FeatureReceiver to install and activate the Timer Job, so I decided to use the Feature.XML file as a repository for the initial configuration settings Job.
I used the Properties node of the [...]]]></description>
			<content:encoded><![CDATA[<p>While working on a Timer Job project, I needed a flexible way to store one-time configuration settings. I was using a SharePoint Feature and FeatureReceiver to install and activate the Timer Job, so I decided to use the Feature.XML file as a repository for the initial configuration settings Job.</p>
<p>I used the Properties node of the feature.xml file to store the settings:</p>
<div style="border: 1px solid gray; margin: 20px 0px 10px; padding: 4px; overflow: auto; font-size: 8pt; width: 97.5%; cursor: text; max-height: 200px; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: #f4f4f4;">
<div style="border-style: none; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: #f4f4f4;">
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: white;">&lt;Feature xmlns=<span style="color: #006080">"http://schemas.microsoft.com/sharepoint/"</span>...&gt;</pre>
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: #f4f4f4;">  &lt;Properties xmlns=<span style="color: #006080">"http://schemas.microsoft.com/sharepoint/"</span>&gt;</pre>
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: white;">    &lt;!-- The name of the timer job (will appear <span style="color: #0000ff">in</span> Central Admin). --&gt;</pre>
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: #f4f4f4;">    &lt;Property Key=<span style="color: #006080">"JobTitle"</span> Value=<span style="color: #006080">"Your Timer Job Name Here"</span>/&gt;</pre>
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: white;">    &lt;!-- Connection String that the TimerJob will use --&gt;</pre>
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: #f4f4f4;">    &lt;Property Key=<span style="color: #006080">"ConnString"</span> Value=<span style="color: #006080">"ConnectionString..."</span>/&gt;</pre>
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: white;">    &lt;!-- The schedule to run the job <span style="color: #0000ff">in</span> (24 hour format) --&gt;</pre>
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: #f4f4f4;">    &lt;Property Key=<span style="color: #006080">"Schedule"</span> Value=<span style="color: #006080">"daily at 02:00:00"</span>/&gt;</pre>
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: white;">  &lt;/Properties&gt;</pre>
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: #f4f4f4;">&lt;/Feature&gt;</pre>
</div>
</div>
<p>Then, during the FeatureActivated event, I passed those values into the Properties bag on the Timer Job class:</p>
<div style="border: 1px solid gray; margin: 20px 0px 10px; padding: 4px; overflow: auto; font-size: 8pt; width: 97.5%; cursor: text; max-height: 200px; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: #f4f4f4;">
<div style="border-style: none; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: #f4f4f4;">
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: white;"><span style="color: #0000ff">public</span> <span style="color: #0000ff">override</span> <span style="color: #0000ff">void</span> FeatureActivated(SPFeatureReceiverProperties properties)</pre>
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: #f4f4f4;">{</pre>
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: white;"></pre>
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: #f4f4f4;">    <span style="color: #008000">// Get all the properties from the feature.xml file</span></pre>
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: white;">    <span style="color: #0000ff">string</span> jobTitle = properties.Feature.Properties[<span style="color: #006080">"JobTitle"</span>].Value;</pre>
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: #f4f4f4;">    <span style="color: #0000ff">string</span> connString = properties.Feature.Properties[<span style="color: #006080">"ConnString"</span>].Value;</pre>
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: white;">    <span style="color: #0000ff">string</span> dailySchedule = properties.Feature.Properties[<span style="color: #006080">"Schedule"</span>].Value;</pre>
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: #f4f4f4;"></pre>
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: white;">    <span style="color: #008000">// Create the job.</span></pre>
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: #f4f4f4;">    CustomTimerJob customTimerJob = <span style="color: #0000ff">new</span> CustomTimerJob((SPWebApplication)properties.Feature.Parent, jobTitle);</pre>
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: white;"></pre>
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: #f4f4f4;">    <span style="color: #008000">// Set the properties for the job to run properly</span></pre>
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: white;">    customTimerJob.Properties.Add(<span style="color: #006080">"ConnString"</span>, connString);</pre>
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: #f4f4f4;">    customTimerJob.Properties.Add(<span style="color: #006080">"Schedule"</span>, dailySchedule);</pre>
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: white;"></pre>
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: #f4f4f4;">    <span style="color: #008000">// Set the schedule</span></pre>
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: white;">    SPSchedule mainSchedule = SPSchedule.FromString(dailySchedule);</pre>
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: #f4f4f4;">    customTimerJob.Schedule = mainSchedule;</pre>
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: white;"></pre>
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: #f4f4f4;">    <span style="color: #008000">// Activate the schedule</span></pre>
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: white;">    customTimerJob.Update();</pre>
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: #f4f4f4;"></pre>
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: white;">}</pre>
</div>
</div>
<p>Then, in the Timer Job’s Execute method, grabbed those settings and used them:</p>
<div style="border: 1px solid gray; margin: 20px 0px 10px; padding: 4px; overflow: auto; font-size: 8pt; width: 97.5%; cursor: text; max-height: 200px; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: #f4f4f4;">
<div style="border-style: none; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: #f4f4f4;">
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: white;"><span style="color: #0000ff">public</span> <span style="color: #0000ff">override</span> <span style="color: #0000ff">void</span> Execute(Guid targetInstanceId)</pre>
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: #f4f4f4;">{</pre>
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: white;">    <span style="color: #008000">// Set up configuration values</span></pre>
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: #f4f4f4;">    <span style="color: #0000ff">string</span> connString = <span style="color: #0000ff">this</span>.Properties[<span style="color: #006080">"ConnString"</span>] <span style="color: #0000ff">as</span> <span style="color: #0000ff">string</span>;</pre>
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: white;"></pre>
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: #f4f4f4;">    ...</pre>
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: white;">}</pre>
</div>
</div>
<p>I didn’t have a need to make run-time changes to the configuration settings, so this worked out really well. To change the defaults and apply new settings, the process was as simple as:</p>
<ul>
<li>Deactivate the feature (uninstalls the Timer Job)</li>
<li>Change the feature.xml file</li>
<li>Re-activate the feature</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.lifeonplanetgroove.com/blog/index.php/2009/03/06/using-feature-xml-files-to-store-timer-job-configuration-settings/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Performance Optimizations for Large Programmatic User Profile Imports</title>
		<link>http://www.lifeonplanetgroove.com/blog/index.php/2009/03/05/performance-optimizations-for-large-programmatic-user-profile-imports/</link>
		<comments>http://www.lifeonplanetgroove.com/blog/index.php/2009/03/05/performance-optimizations-for-large-programmatic-user-profile-imports/#comments</comments>
		<pubDate>Fri, 06 Mar 2009 00:11:49 +0000</pubDate>
		<dc:creator>Adam Toth</dc:creator>
				<category><![CDATA[SharePoint]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[Audience Targeting]]></category>
		<category><![CDATA[Forms Authentication]]></category>
		<category><![CDATA[Timer Jobs]]></category>
		<category><![CDATA[User Profile Import]]></category>

		<guid isPermaLink="false">http://www.lifeonplanetgroove.com/blog/?p=226</guid>
		<description><![CDATA[I’m working on a project that imports over 1 million users from an Oracle database used with SharePoint/Forms Authentication into the SharePoint user profile store. This is done as a custom SharePoint timer job that pulls the users from the DB and creates/updates User Profiles through the SharePoint API.
When running a job on a recordset [...]]]></description>
			<content:encoded><![CDATA[<p>I’m working on a project that imports over 1 million users from an Oracle database used with SharePoint/Forms Authentication into the SharePoint user profile store. This is done as a custom SharePoint timer job that pulls the users from the DB and creates/updates User Profiles through the SharePoint API.</p>
<p>When running a job on a recordset of this size, there are several things to strive for:</p>
<ul>
<li>Limit the time that the process needs to run (jobs can take days and overlap themselves)</li>
<li>Reduce memory usage (the OWSTIMER.exe can already consume quite a bit with the regular timer jobs)</li>
</ul>
<p>Two ways you can achieve this:</p>
<ul>
<li>Avoid UserExists() method</li>
<li>Use a DataReader if possible<br />
  </li>
</ul>
<h3>Avoid UserExists() method</h3>
<p>Most code samples on the web that deal with programmatic creation of User Profiles will show code such as this:</p>
<div style="font-size: 8pt; margin: 20px 0px 10px; overflow: auto; width: 97.5%; cursor: text; max-height: 200px; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: #f4f4f4; border: gray 1px solid; padding: 4px;">
<div style="font-size: 8pt; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: #f4f4f4; border-style: none; padding: 0px;">
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: white; border-style: none; padding: 0px;"><span style="color: #0000ff">if</span> (profileManager.UserExists(accountName)</pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: #f4f4f4; border-style: none; padding: 0px;">{</pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: white; border-style: none; padding: 0px;">    userProfile = profileManager.GetUserProfile(accountName)...</pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: #f4f4f4; border-style: none; padding: 0px;">}</pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: white; border-style: none; padding: 0px;"><span style="color: #0000ff">else</span></pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: #f4f4f4; border-style: none; padding: 0px;">{</pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: white; border-style: none; padding: 0px;">    userProfile = profileManager.CreateUserProfile(accountName)...</pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: #f4f4f4; border-style: none; padding: 0px;">}</pre>
</div>
</div>
<p>On small recordsets, this is fine, but for large recordsets the UserExists method represents a bottleneck that can increase the duration that your process runs. In addition, in the code above, you will unknowingly call this method a second useless time, because the CreateUserProfile() method internally calls UserExists() as well.</p>
<p>There are two ways to avoid this method:</p>
<ul>
<li>Cache profile IDs in a Dictionary/Hashtable type object</li>
<li>Use reflection to create user profiles</li>
</ul>
<h4>Cache Profile IDs (and MemberGroup IDs too)</h4>
<p>The UserProfileManager object is an IEnumerable that you can iterate over and access all the Profiles in SharePoint. Caching the IDs of these profiles up front enables you to index into a Dictionary object to see if your profile exists, rather than hitting SQL Server with UserExists(). The following code helped to reduce processing time significantly (you take a hit up front, but it’s far less than the delay imposed by UserExists over large recordsets):</p>
<div style="font-size: 8pt; margin: 20px 0px 10px; overflow: auto; width: 97.5%; cursor: text; max-height: 200px; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: #f4f4f4; border: gray 1px solid; padding: 4px;">
<div style="font-size: 8pt; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: #f4f4f4; border-style: none; padding: 0px;">
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: white; border-style: none; padding: 0px;">Dictionary&lt;<span style="color: #0000ff">string</span>, Guid&gt; cachedProfiles = <span style="color: #0000ff">new</span> Dictionary&lt;<span style="color: #0000ff">string</span>, Guid&gt;();</pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: #f4f4f4; border-style: none; padding: 0px;"><span style="color: #0000ff">foreach</span>(UserProfile profile <span style="color: #0000ff">in</span> profileManager)</pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: white; border-style: none; padding: 0px;">{</pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: #f4f4f4; border-style: none; padding: 0px;">    cachedProfiles.Add(profile.AccountName, profile.ID);</pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: white; border-style: none; padding: 0px;">}</pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: #f4f4f4; border-style: none; padding: 0px;">...</pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: white; border-style: none; padding: 0px;"><span style="color: #0000ff">if</span>(cachedProfiles.ContainsKey(accountName)</pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: #f4f4f4; border-style: none; padding: 0px;">{</pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: white; border-style: none; padding: 0px;">    ...</pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: #f4f4f4; border-style: none; padding: 0px;">}</pre>
</div>
</div>
<p>In addition, caching the Guid of the <a href="http://msdn.microsoft.com/en-us/library/microsoft.office.server.userprofiles.userprofile.aspx" target="_blank">UserProfile</a> lets you later use the overloaded method of GetUserProfile() that takes a Guid as a parameter, which seems to perform slightly better than the alternative that takes a string for AccountName.</p>
<p>This approach also works very well when importing large numbers of MemberGroups:</p>
<div style="font-size: 8pt; margin: 20px 0px 10px; overflow: auto; width: 97.5%; cursor: text; max-height: 200px; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: #f4f4f4; border: gray 1px solid; padding: 4px;">
<div style="font-size: 8pt; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: #f4f4f4; border-style: none; padding: 0px;">
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: white; border-style: none; padding: 0px;"><span style="color: #0000ff">foreach</span> (MemberGroup memberGroup <span style="color: #0000ff">in</span> memberGroupManager)</pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: #f4f4f4; border-style: none; padding: 0px;">{</pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: white; border-style: none; padding: 0px;">    cachedMemberGroups.Add(memberGroup.DisplayName, memberGroup.Id);</pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: #f4f4f4; border-style: none; padding: 0px;">}</pre>
</div>
</div>
<p><strong>NOTE:</strong> If you are wondering why not simply cache the entire UserProfile in the Dictionary (Dictionary&lt;string, UserProfile&gt;), the memory usage for this will be much higher, which will undo any gains by avoiding UserExists().</p>
<h4>Use Reflection to Create User Profiles</h4>
<p>The UserProfileManager’s CreateUserProfile() method internally calls the UserExists method, and then calls an internal constructor on the UserProfile object to actually create the profile. By using reflection, you can call this internal constructor yourself and avoid UserExists():</p>
<div style="font-size: 8pt; margin: 20px 0px 10px; overflow: auto; width: 97.5%; cursor: text; max-height: 200px; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: #f4f4f4; border: gray 1px solid; padding: 4px;">
<div style="font-size: 8pt; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: #f4f4f4; border-style: none; padding: 0px;">
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: white; border-style: none; padding: 0px;"><span style="color: #008000">// Get some reflected information about the UserProfile object for later use</span></pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: #f4f4f4; border-style: none; padding: 0px;">ConstructorInfo ci = <span style="color: #0000ff">typeof</span>(UserProfile).GetConstructor(</pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: white; border-style: none; padding: 0px;">BindingFlags.NonPublic | BindingFlags.Instance,</pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: #f4f4f4; border-style: none; padding: 0px;"><span style="color: #0000ff">null</span>,</pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: white; border-style: none; padding: 0px;"><span style="color: #0000ff">new</span> Type[] { <span style="color: #0000ff">typeof</span>(UserProfileManager), <span style="color: #0000ff">typeof</span>(<span style="color: #0000ff">string</span>), <span style="color: #0000ff">typeof</span>(<span style="color: #0000ff">string</span>) },</pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: #f4f4f4; border-style: none; padding: 0px;"><span style="color: #0000ff">null</span>);</pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: white; border-style: none; padding: 0px;"> </pre>
</div>
</div>
<p>Once you’ve got the reflected information, you can use the following code to create your UserProfile:</p>
<div style="font-size: 8pt; margin: 20px 0px 10px; overflow: auto; width: 97.5%; cursor: text; max-height: 200px; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: #f4f4f4; border: gray 1px solid; padding: 4px;">
<div style="font-size: 8pt; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: #f4f4f4; border-style: none; padding: 0px;">
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: white; border-style: none; padding: 0px;"><span style="color: #0000ff">if</span> (cachedProfiles.ContainsKey(accountName))</pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: #f4f4f4; border-style: none; padding: 0px;">{</pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: white; border-style: none; padding: 0px;">    <span style="color: #008000">// Get existing profile...</span></pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: #f4f4f4; border-style: none; padding: 0px;">}</pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: white; border-style: none; padding: 0px;"><span style="color: #0000ff">else</span></pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: #f4f4f4; border-style: none; padding: 0px;">{</pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: white; border-style: none; padding: 0px;">    <span style="color: #008000">// Create new profile</span></pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: #f4f4f4; border-style: none; padding: 0px;">    UserProfile newProfile = (UserProfile)ci.Invoke(<span style="color: #0000ff">new</span> <span style="color: #0000ff">object</span>[] { profileManager, accountName, displayName });</pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: white; border-style: none; padding: 0px;">}</pre>
</div>
</div>
<p><strong>NOTE:</strong> I’ve tried creating a user profile in this manner that already existed to see what would happen. The existing profile was updated, and I did not get any duplicate records in the SharePoint db. It appears the SQL under the hood already takes care of avoiding duplicates. General cautions about reflection still apply here though (API may change, etc.).</p>
<h3>Use a DataReader if Possible</h3>
<p>Instead of pulling a huge recordset into a DataTable, DataSet, or into a collection of custom objects, try to process your records one at a time using a data reader if your data source permits. This will keep memory usage down, as the garbage collector will dispose frequently any variables you create within a while(reader.Read()) loop. A DataTable with 1 million records in it will take up tons of memory on top of the large memory consumption that OWSTIMER.exe does already.</p>
<div style="font-size: 8pt; margin: 20px 0px 10px; overflow: auto; width: 97.5%; cursor: text; max-height: 200px; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: #f4f4f4; border: gray 1px solid; padding: 4px;">
<div style="font-size: 8pt; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: #f4f4f4; border-style: none; padding: 0px;">
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: white; border-style: none; padding: 0px;"><span style="color: #0000ff">using</span> (OracleConnection conn = <span style="color: #0000ff">new</span> OracleConnection(_connectionString))</pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: #f4f4f4; border-style: none; padding: 0px;">{</pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: white; border-style: none; padding: 0px;"> </pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: #f4f4f4; border-style: none; padding: 0px;">    <span style="color: #0000ff">using</span> (OracleCommand cmd = <span style="color: #0000ff">new</span> OracleCommand(_sqlGetAllUsers, conn))</pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: white; border-style: none; padding: 0px;">    {</pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: #f4f4f4; border-style: none; padding: 0px;">        conn.Open();</pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: white; border-style: none; padding: 0px;"> </pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: #f4f4f4; border-style: none; padding: 0px;">        OracleDataReader rdr = cmd.ExecuteReader();</pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: white; border-style: none; padding: 0px;"> </pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: #f4f4f4; border-style: none; padding: 0px;">        <span style="color: #0000ff">if</span>(!rdr.HasRows())</pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: white; border-style: none; padding: 0px;">        {</pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: #f4f4f4; border-style: none; padding: 0px;">            <span style="color: #0000ff">return</span>;</pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: white; border-style: none; padding: 0px;">        }</pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: #f4f4f4; border-style: none; padding: 0px;"> </pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: white; border-style: none; padding: 0px;">        <span style="color: #0000ff">while</span> (rdr.Read())</pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: #f4f4f4; border-style: none; padding: 0px;">        {</pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: white; border-style: none; padding: 0px;">            UserProfile profile = <span style="color: #0000ff">null</span>;</pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: #f4f4f4; border-style: none; padding: 0px;">            <span style="color: #0000ff">string</span> accountName = rdr[<span style="color: #006080">"ACCOUNT_NAME"</span>] <span style="color: #0000ff">as</span> <span style="color: #0000ff">string</span>;</pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: white; border-style: none; padding: 0px;">            <span style="color: #0000ff">string</span> firstName = rdr[<span style="color: #006080">"FIRST_NAME"</span>] <span style="color: #0000ff">as</span> <span style="color: #0000ff">string</span>;</pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: #f4f4f4; border-style: none; padding: 0px;">            <span style="color: #0000ff">string</span> lastName = rdr[<span style="color: #006080">"LAST_NAME"</span>] <span style="color: #0000ff">as</span> <span style="color: #0000ff">string</span>;</pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: white; border-style: none; padding: 0px;"> </pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: #f4f4f4; border-style: none; padding: 0px;">            <span style="color: #0000ff">if</span> (cachedProfiles.ContainsKey(accountName))</pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: white; border-style: none; padding: 0px;">            {</pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: #f4f4f4; border-style: none; padding: 0px;">                profile = profileManager.GetUserProfile(cachedProfiles[accountName]);</pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: white; border-style: none; padding: 0px;">            }</pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: #f4f4f4; border-style: none; padding: 0px;">            <span style="color: #0000ff">else</span></pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: white; border-style: none; padding: 0px;">            {</pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: #f4f4f4; border-style: none; padding: 0px;">                profile = (UserProfile)ci.Invoke(<span style="color: #0000ff">new</span> <span style="color: #0000ff">object</span>[] { profileManager, accountName, displayName });</pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: white; border-style: none; padding: 0px;">                cachedProfiles.Add(accountName, profile.ID);</pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: #f4f4f4; border-style: none; padding: 0px;">            }</pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: white; border-style: none; padding: 0px;"> </pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: #f4f4f4; border-style: none; padding: 0px;">            <span style="color: #0000ff">if</span> (!<span style="color: #0000ff">string</span>.IsNullOrEmpty(firstName))</pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: white; border-style: none; padding: 0px;">            {</pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: #f4f4f4; border-style: none; padding: 0px;">                profile[<span style="color: #006080">"FirstName"</span>].Value = firstName;</pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: white; border-style: none; padding: 0px;">            }</pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: #f4f4f4; border-style: none; padding: 0px;">            <span style="color: #0000ff">if</span> (!<span style="color: #0000ff">string</span>.IsNullOrEmpty(lastName))</pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: white; border-style: none; padding: 0px;">            {</pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: #f4f4f4; border-style: none; padding: 0px;">                profile[<span style="color: #006080">"LastName"</span>].Value = lastName;</pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: white; border-style: none; padding: 0px;">            }</pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: #f4f4f4; border-style: none; padding: 0px;">            <span style="color: #008000">// ... </span></pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: white; border-style: none; padding: 0px;">            profile.Commit();</pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: #f4f4f4; border-style: none; padding: 0px;"> </pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: white; border-style: none; padding: 0px;">        }</pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: #f4f4f4; border-style: none; padding: 0px;"> </pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: white; border-style: none; padding: 0px;">        rdr.Close();</pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: #f4f4f4; border-style: none; padding: 0px;">        rdr.Dispose();</pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: white; border-style: none; padding: 0px;"> </pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: #f4f4f4; border-style: none; padding: 0px;">    }</pre>
<pre style="font-size: 8pt; margin: 0em; overflow: visible; width: 100%; color: black; line-height: 12pt; font-family: consolas, 'Courier New', courier, monospace; background-color: white; border-style: none; padding: 0px;">}</pre>
</div>
</div>
<p>Of course other best practices also apply, such as:</p>
<ul>
<li>Getting pages of records, rather than all at once</li>
<li>Implementing incremental change queries rather than all records all the time</li>
<li>Only getting what you need from the data source</li>
<li>Disposing your objects and data connections properly</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.lifeonplanetgroove.com/blog/index.php/2009/03/05/performance-optimizations-for-large-programmatic-user-profile-imports/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Access Denied When Editing SharePoint Designer Workflow Task</title>
		<link>http://www.lifeonplanetgroove.com/blog/index.php/2009/03/04/access-denied-when-editing-sharepoint-designer-workflow-task/</link>
		<comments>http://www.lifeonplanetgroove.com/blog/index.php/2009/03/04/access-denied-when-editing-sharepoint-designer-workflow-task/#comments</comments>
		<pubDate>Thu, 05 Mar 2009 00:38:04 +0000</pubDate>
		<dc:creator>Adam Toth</dc:creator>
				<category><![CDATA[SharePoint]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[Access denied]]></category>
		<category><![CDATA[task form]]></category>
		<category><![CDATA[workflow]]></category>

		<guid isPermaLink="false">http://www.lifeonplanetgroove.com/blog/index.php/2009/03/04/access-denied-when-editing-sharepoint-designer-workflow-task/</guid>
		<description><![CDATA[Recently I saw an access denied error when a user tried to edit a SharePoint Designer workflow task. The error did not occur if the user was a site collection administrator, but did occur even if they had full control to the site, list, and task list.
Running through the Request Access pages, it appeared that [...]]]></description>
			<content:encoded><![CDATA[<p>Recently I saw an access denied error when a user tried to edit a SharePoint Designer workflow task. The error did not occur if the user was a site collection administrator, but did occur even if they had full control to the site, list, and task list.</p>
<p>Running through the Request Access pages, it appeared that SharePoint did not think the user had rights to the task list, even though they did after thoroughly checking permissions. </p>
<p>I figured that it was having trouble with permissions to the ASPX pages from the Designer-generated tasks forms, so I solved it by doing the following:</p>
<ul>
<li>Open the site in SharePoint designer</li>
<li>Locate the “Workflows” node in the tree view.</li>
<li>Right-click “Workflows” and select Properties.</li>
<li>Click the Security tab.</li>
<li>Choose the option to manage permissions from the browser.</li>
</ul>
<p>It turns out that this “Workflows” node is actually a SharePoint folder object, and it turned out that this folder did not inherit permissions from the parent. The web page for managing permissions that came up showed me this, and enabled me to reinherit permissions and fix the problem.</p>
<p>I’m not sure why that folder didn’t inherit permissions though, I’d never seen that before.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.lifeonplanetgroove.com/blog/index.php/2009/03/04/access-denied-when-editing-sharepoint-designer-workflow-task/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Solving 403 error after activating SharePoint feature</title>
		<link>http://www.lifeonplanetgroove.com/blog/index.php/2009/02/27/solving-403-error-after-activating-sharepoint-feature/</link>
		<comments>http://www.lifeonplanetgroove.com/blog/index.php/2009/02/27/solving-403-error-after-activating-sharepoint-feature/#comments</comments>
		<pubDate>Fri, 27 Feb 2009 21:56:04 +0000</pubDate>
		<dc:creator>Adam Toth</dc:creator>
				<category><![CDATA[SharePoint]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[403 error]]></category>
		<category><![CDATA[Features]]></category>

		<guid isPermaLink="false">http://www.lifeonplanetgroove.com/blog/?p=220</guid>
		<description><![CDATA[After activating a custom SharePoint feature I created, the web application I activated it on stopped responding, and gave me a 403 forbidden error.
This link from MSDN (see the Notes section) helped me to identify that the NTFS permissions were screwed up on the feature folder and files (since I created them through windows explorer). [...]]]></description>
			<content:encoded><![CDATA[<p>After activating a custom SharePoint feature I created, the web application I activated it on stopped responding, and gave me a 403 forbidden error.</p>
<p><a href="http://msdn.microsoft.com/en-us/library/ms460318.aspx" target="_blank">This link from MSDN</a> (see the Notes section) helped me to identify that the NTFS permissions were screwed up on the feature folder and files (since I created them through windows explorer). Re-inheriting permissions from the parent “Features” folder solved the problem.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.lifeonplanetgroove.com/blog/index.php/2009/02/27/solving-403-error-after-activating-sharepoint-feature/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Resources for Creating Custom Timer Jobs</title>
		<link>http://www.lifeonplanetgroove.com/blog/index.php/2009/02/27/resources-for-creating-custom-timer-jobs/</link>
		<comments>http://www.lifeonplanetgroove.com/blog/index.php/2009/02/27/resources-for-creating-custom-timer-jobs/#comments</comments>
		<pubDate>Fri, 27 Feb 2009 18:45:00 +0000</pubDate>
		<dc:creator>Adam Toth</dc:creator>
				<category><![CDATA[SharePoint]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[Features]]></category>
		<category><![CDATA[Logging]]></category>
		<category><![CDATA[Timer Jobs]]></category>

		<guid isPermaLink="false">http://www.lifeonplanetgroove.com/blog/?p=219</guid>
		<description><![CDATA[After finishing up a custom timer job project, I relied on several resources to get the job done. here are some links I found very helpful:

Andrew Connel’s articles:

http://andrewconnell.com/blog/archive/2007/01/10/5704.aspx 
http://www.andrewconnell.com/blog/articles/CreatingCustomSharePointTimerJobs.aspx 
http://andrewconnell.com/blog/archive/2007/07/02/6067.aspx 
http://www.andrewconnell.com/blog/archive/2008/04/15/More-help-on-creating-custom-timer-jobs-and-a-useful.aspx 


MSDN article &#8211; http://msdn2.microsoft.com/en-us/library/cc406686.aspx 
Logging &#8211; http://trentacular.com/2008/12/sharepoint-logging-and-microsofts-trace-log-provider/ 
Scheduling using more natural language &#8211; http://blogs.msdn.com/markarend/archive/2007/01/16/spschedule-fromstring-recurrencevalue-syntax-format-for-recurrence-value.aspx 
Feature Help:

xmlns comment at bottom of this page: http://msdn.microsoft.com/en-us/library/ms436075.aspx 
Debugging [...]]]></description>
			<content:encoded><![CDATA[<p>After finishing up a custom timer job project, I relied on several resources to get the job done. here are some links I found very helpful:</p>
<ul>
<li>Andrew Connel’s articles:
<ul>
<li><a title="http://andrewconnell.com/blog/archive/2007/01/10/5704.aspx" href="http://andrewconnell.com/blog/archive/2007/01/10/5704.aspx">http://andrewconnell.com/blog/archive/2007/01/10/5704.aspx</a> </li>
<li><a title="http://www.andrewconnell.com/blog/articles/CreatingCustomSharePointTimerJobs.aspx" href="http://www.andrewconnell.com/blog/articles/CreatingCustomSharePointTimerJobs.aspx">http://www.andrewconnell.com/blog/articles/CreatingCustomSharePointTimerJobs.aspx</a> </li>
<li><a title="http://andrewconnell.com/blog/archive/2007/07/02/6067.aspx" href="http://andrewconnell.com/blog/archive/2007/07/02/6067.aspx">http://andrewconnell.com/blog/archive/2007/07/02/6067.aspx</a> </li>
<li><a title="http://www.andrewconnell.com/blog/archive/2008/04/15/More-help-on-creating-custom-timer-jobs-and-a-useful.aspx" href="http://www.andrewconnell.com/blog/archive/2008/04/15/More-help-on-creating-custom-timer-jobs-and-a-useful.aspx">http://www.andrewconnell.com/blog/archive/2008/04/15/More-help-on-creating-custom-timer-jobs-and-a-useful.aspx</a> </li>
</ul>
</li>
<li>MSDN article &#8211; <a title="http://msdn2.microsoft.com/en-us/library/cc406686.aspx" href="http://msdn2.microsoft.com/en-us/library/cc406686.aspx">http://msdn2.microsoft.com/en-us/library/cc406686.aspx</a> </li>
<li>Logging &#8211; <a title="http://trentacular.com/2008/12/sharepoint-logging-and-microsofts-trace-log-provider/" href="http://trentacular.com/2008/12/sharepoint-logging-and-microsofts-trace-log-provider/">http://trentacular.com/2008/12/sharepoint-logging-and-microsofts-trace-log-provider/</a> </li>
<li>Scheduling using more natural language &#8211; <a title="http://blogs.msdn.com/markarend/archive/2007/01/16/spschedule-fromstring-recurrencevalue-syntax-format-for-recurrence-value.aspx" href="http://blogs.msdn.com/markarend/archive/2007/01/16/spschedule-fromstring-recurrencevalue-syntax-format-for-recurrence-value.aspx">http://blogs.msdn.com/markarend/archive/2007/01/16/spschedule-fromstring-recurrencevalue-syntax-format-for-recurrence-value.aspx</a> </li>
<li>Feature Help:
<ul>
<li>xmlns comment at bottom of this page: <a title="http://msdn.microsoft.com/en-us/library/ms436075.aspx" href="http://msdn.microsoft.com/en-us/library/ms436075.aspx">http://msdn.microsoft.com/en-us/library/ms436075.aspx</a> </li>
<li>Debugging feature receivers: <a title="http://bphillips76.spaces.live.com/blog/cns!F9B548E4C21D6166!445.entry" href="http://bphillips76.spaces.live.com/blog/cns!F9B548E4C21D6166!445.entry">http://bphillips76.spaces.live.com/blog/cns!F9B548E4C21D6166!445.entry</a> </li>
<li>Note section of this page, talking about proper permissions necessary for your feature files: <a title="http://msdn.microsoft.com/en-us/library/ms460318.aspx" href="http://msdn.microsoft.com/en-us/library/ms460318.aspx">http://msdn.microsoft.com/en-us/library/ms460318.aspx</a> </li>
</ul>
</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.lifeonplanetgroove.com/blog/index.php/2009/02/27/resources-for-creating-custom-timer-jobs/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Switch Views when InfoPath Form is Opened</title>
		<link>http://www.lifeonplanetgroove.com/blog/index.php/2008/09/16/switch-views-when-infopath-form-is-opened/</link>
		<comments>http://www.lifeonplanetgroove.com/blog/index.php/2008/09/16/switch-views-when-infopath-form-is-opened/#comments</comments>
		<pubDate>Tue, 16 Sep 2008 22:51:39 +0000</pubDate>
		<dc:creator>Adam Toth</dc:creator>
				<category><![CDATA[InfoPath]]></category>
		<category><![CDATA[SharePoint]]></category>

		<guid isPermaLink="false">/toth/archive/2008/09/16/switch-views-when-infopath-form-is-opened.aspx</guid>
		<description><![CDATA[I designed a form for a client that had several different views, and I needed a way to display a specific view when the form was opened. This was easy, but took me a bit to figure out.

Go to Tools &#62; Form Options.
Click the Open and Save option.
Click the Rules button, and add rules and [...]]]></description>
			<content:encoded><![CDATA[<p>I designed a form for a client that had several different views, and I needed a way to display a specific view when the form was opened. This was easy, but took me a bit to figure out.</p>
<ol>
<li>Go to <strong>Tools &gt; Form Options</strong>.</li>
<li>Click the <strong>Open and Save</strong> option.</li>
<li>Click the <strong>Rules</strong> button, and add rules and actions to switch views.</li>
</ol>
<p>With this method, I was able to set a field on form submittal to indicate which view was last active. When the submitted form was re-opened, I was able to use a conditional rule to switch to that last active view.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.lifeonplanetgroove.com/blog/index.php/2008/09/16/switch-views-when-infopath-form-is-opened/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Make InfoPath Contact Selector Required in Browser-Enabled Forms</title>
		<link>http://www.lifeonplanetgroove.com/blog/index.php/2008/09/16/make-infopath-contact-selector-required-in-browser-enabled-forms/</link>
		<comments>http://www.lifeonplanetgroove.com/blog/index.php/2008/09/16/make-infopath-contact-selector-required-in-browser-enabled-forms/#comments</comments>
		<pubDate>Tue, 16 Sep 2008 22:38:43 +0000</pubDate>
		<dc:creator>Adam Toth</dc:creator>
				<category><![CDATA[InfoPath]]></category>
		<category><![CDATA[SharePoint]]></category>

		<guid isPermaLink="false">/toth/archive/2008/09/16/make-infopath-contact-selector-required-in-browser-enabled-forms.aspx</guid>
		<description><![CDATA[If you&#8217;ve used the InfoPath Contact Selector before, you might have seen that it does not support validation like other InfoPath controls do. There is no option on the Properties dialog for the control to make it a required field. To work around this, I used a combination of rules and conditional formatting to prevent [...]]]></description>
			<content:encoded><![CDATA[<p>If you&#8217;ve used the InfoPath Contact Selector before, you might have seen that it does not support validation like other InfoPath controls do. There is no option on the Properties dialog for the control to make it a required field. To work around this, I used a combination of rules and conditional formatting to prevent the form from being submitted if the control does not have a value.</p>
<p>The easiest way to do this is to create conditional rules in the Submit Options dialog:</p>
<ol>
<li>Configure your form and add a Contact Selector control (<a href="http://msdn.microsoft.com/en-us/library/ms558892.aspx" target="_blank">see this article for instructions</a>). </li>
<li>Go to <strong>Tools &gt; Submit Options</strong>. </li>
<li>Make sure that <strong>Allow Users to Submit this Form</strong> is checked. </li>
<li>Click the option to <strong>Perform custom action using rules</strong>. </li>
<li>Click the <strong>Rules&#8230;</strong> button. </li>
<li>In the Rules dialog, click the <strong>Add&#8230;</strong> button. </li>
<li>In the Rule dialog, click the <strong>Set Condition&#8230;</strong> button. </li>
<li>In the Condition dialog, pull down the first dropdown, choose <strong>Select a field or group&#8230;</strong>, and drill down and choose the <strong>DisplayName</strong> field from your data connection. Select i<strong>s blank</strong> in the second dropdown. </li>
<li>Click the <strong>And&gt;</strong> button to add a second condition. </li>
<li>In the last dropdown on the first condition, change it from <strong>And</strong> to <strong>Or</strong>. </li>
<li>In the second condition, select the <strong>DisplayName</strong> field again, and choose <strong>is not present</strong> for the condition. Your two conditions should look like this: </li>
<li>
<div class="wlWriterSmartContent" id="scid:51CF81A4-8F44-4a2c-8837-198C090B9994:8c5c7a5c-1165-4377-9310-5424cd2644f1" style="padding-right: 0px; display: inline; padding-left: 0px; float: none; padding-bottom: 0px; margin: 0px; padding-top: 0px">
<p><img style="border-top-width: 2px; border-left-width: 2px; border-bottom-width: 2px; border-right-width: 2px" height="97" alt="" src="http://lh5.ggpht.com/adam.toth/SNAw0BKwCxI/AAAAAAAAAEE/jtmA5uzot_0/s400/contactselectorconditions.jpg" width="400" /></p>
</p></div>
</li>
<li>Click <strong>OK</strong>. In the Rule dialog, do not add any Actions. Check the box to <strong>Stop processing rules when this rule finishes</strong>. </li>
<li>Make sure that this rule appears first in the list of Rules. </li>
</ol>
<p>The only downside to this approach is that there is no visual to the user, since InfoPath Forms Services does not support showing a dialog message. The form will just not do anything. To get an even better user experience, You can hide the Submit option from the Toolbar, and use your own Submit buttons with Conditional Formatting:</p>
<ol>
<li>Drag a button on the page. </li>
<li>Right-click and choose <strong>Conditional Formatting&#8230;</strong>. </li>
<li>Click <strong>Add&#8230;</strong> to add conditions. </li>
<li>In the Condition dialog, add the two conditions in steps 8-11 above, and choose Disable this Control.     <br /> 
<div class="wlWriterSmartContent" id="scid:51CF81A4-8F44-4a2c-8837-198C090B9994:fb2425c7-c2d8-4b96-9c13-535fecc99f58" style="padding-right: 0px; display: inline; padding-left: 0px; float: none; padding-bottom: 0px; margin: 0px; padding-top: 0px">
<p><img style="border-top-width: 2px; border-left-width: 2px; border-bottom-width: 2px; border-right-width: 2px" height="206" alt="" src="http://lh5.ggpht.com/adam.toth/SNAzu4N5XwI/AAAAAAAAAEI/hMjaDPoYJSk/s400/contactselectorconditionalformatting.jpg" width="400" /></p>
</p></div>
</li>
</ol>
<p>Now, your submit button will be disabled until the user picks a person.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.lifeonplanetgroove.com/blog/index.php/2008/09/16/make-infopath-contact-selector-required-in-browser-enabled-forms/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>My SharePoint Sites Links Missing &#8211; Fix</title>
		<link>http://www.lifeonplanetgroove.com/blog/index.php/2008/08/26/my-sharepoint-sites-links-missing-fix/</link>
		<comments>http://www.lifeonplanetgroove.com/blog/index.php/2008/08/26/my-sharepoint-sites-links-missing-fix/#comments</comments>
		<pubDate>Tue, 26 Aug 2008 22:26:51 +0000</pubDate>
		<dc:creator>Adam Toth</dc:creator>
				<category><![CDATA[SharePoint]]></category>

		<guid isPermaLink="false">/toth/archive/2008/08/26/my-sharepoint-sites-links-missing-fix.aspx</guid>
		<description><![CDATA[One client had a problem with profile and membership synchronization, and the &#8220;My SharePoint Sites&#8221; links would not appear for anyone. This also affected the &#8220;SharePoint Sites&#8221; and &#8220;Membership&#8221; web parts on users&#8217; MySites &#8211; no SharePoint related links would show up in these parts.
We verified that users were explicitly added into the &#8220;Members&#8221; group [...]]]></description>
			<content:encoded><![CDATA[<p>One client had a problem with profile and membership synchronization, and the &#8220;My SharePoint Sites&#8221; links would not appear for anyone. This also affected the &#8220;SharePoint Sites&#8221; and &#8220;Membership&#8221; web parts on users&#8217; MySites &#8211; no SharePoint related links would show up in these parts.</p>
<p>We verified that users were explicitly added into the &#8220;Members&#8221; group of SharePoint sites, we performed full crawls and ran all the timer jobs. Still no dice.</p>
<p>Eventually, a support ticket with MS revealed that having the Content Database set to Offline prevented that functionality from working.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.lifeonplanetgroove.com/blog/index.php/2008/08/26/my-sharepoint-sites-links-missing-fix/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>
