<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>.NET / SAP / SharePoint / Silverlight Development</title>
	<atom:link href="http://jbaurle.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://jbaurle.wordpress.com</link>
	<description>Jürgen Bäurles Blog on .NET development and the integration of .NET with SAP/R3.</description>
	<lastBuildDate>Mon, 19 Sep 2011 17:28:33 +0000</lastBuildDate>
	<language>de</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='jbaurle.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>.NET / SAP / SharePoint / Silverlight Development</title>
		<link>http://jbaurle.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://jbaurle.wordpress.com/osd.xml" title=".NET / SAP / SharePoint / Silverlight Development" />
	<atom:link rel='hub' href='http://jbaurle.wordpress.com/?pushpress=hub'/>
		<item>
		<title>FluentSP &#8211; The Fluent SharePoint API</title>
		<link>http://jbaurle.wordpress.com/2011/09/19/fluentsp-the-fluent-sharepoint-api/</link>
		<comments>http://jbaurle.wordpress.com/2011/09/19/fluentsp-the-fluent-sharepoint-api/#comments</comments>
		<pubDate>Mon, 19 Sep 2011 16:53:53 +0000</pubDate>
		<dc:creator>Jürgen Bäurle</dc:creator>
		
		<guid isPermaLink="false">https://jbaurle.wordpress.com/2011/09/19/fluentsp-the-fluent-sharepoint-api/</guid>
		<description><![CDATA[Download FluentSP 1.0 from Codeplex.com More information on my new homepage at http://www.parago.net Once you are doing a lot of SharePoint programming you know you often have to write lengthy pieces of code to implement simple tasks like querying SharePoint lists. Nowadays you can read a lot of fluent APIs or fluent interface. For instance, [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jbaurle.wordpress.com&amp;blog=1409398&amp;post=383&amp;subd=jbaurle&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><a href="http://fluentsp.codeplex.com/" target="_blank">Download FluentSP 1.0 from Codeplex.com</a></p>
<p><a href="http://www.parago.de/" target="_blank">More information on my new homepage at http://www.parago.net</a></p>
<p>Once you are doing a lot of SharePoint programming you know you often have to write lengthy pieces of code to implement simple tasks like querying SharePoint lists. Nowadays you can read a lot of fluent APIs or fluent interface. For instance, jQuery, a JavaScript library that had successfully introduced a fluent API to handle the hierarchical structure of the HTML documents. </p>
<p>Today, I want to introduce a small library I have developed, FluentSP, a modern fluent interface around the classic SharePoint 2010 API. By using FluentSP instead of the classic SharePoint API, you will be able to chain methods and act on sets of items of the underlying SharePoint objects. </p>
<p><i>What is a fluent API?</i>    <br />Checkout this CodeProject article <a href="http://www.codeproject.com/KB/WPF/fluentAPI.aspx" target="_blank">A Look at Fluent APIs</a> and the Wikipedia article <a href="http://en.wikipedia.org/wiki/Fluent_interface" target="_blank">Fluent interface</a>.</p>
<p>To start into the fluent API you call the <b>Use()</b> method on <i>SPSite</i>, <i>SPWeb</i>, <i>SPWebCollection</i> or <i>SPListCollection</i>. The Use() method is implemented as an extension method that will return the entry facade object (see facade table below). Another entry point to the fluent API is the static class <b>FluentSP</b> with its static methods CurrentSite, CurrentWeb, CurrentLists or RootWebLists.</p>
<div style="display:inline;float:none;margin:0;padding:0;" id="scid:f32c3428-b7e9-4f15-a8ea-c502c7ff2e88:d2a9627a-4c29-447a-a1e1-0a0e3a36ee90" class="class">
<pre class="brush: c#;">SPContext.Current.Site.Use()... // =&gt; Returns the SPSiteFacade as entry point

// OR:
FluentSP.CurrentSite()...       // =&gt; Returns the SPSiteFacade as entry point </pre>
</div>
<p>Using the entry facade instance you can start chaining the available facade methods as follows:</p>
<div style="display:inline;float:none;margin:0;padding:0;" id="scid:f32c3428-b7e9-4f15-a8ea-c502c7ff2e88:d9dd536a-40d3-47ad-b4bb-a3e47048f11a" class="class">
<pre class="brush: c#;">FluentSP.CurrentSite().Web(&quot;Home&quot;).List(&quot;Tasks&quot;).Items().ForEach(i =&gt; // Do something with the item i of type SPListItem...);

// OR:
FluentSP.CurrentSite()
  .Web(&quot;Home&quot;)
    .List(&quot;Tasks&quot;)
      .Items()
      .ForEach(i =&gt; // Do something with...);</pre>
</div>
<p>Each facade object is actually wrapping an underlying data item, for instance the SPSiteFacade class is the fluent wrapper of the SPSite class. Depending on what kind of facade methods you are calling the method is returning either the current facade instance (e.g., ForEach() or Where()) or the method is returning a new child facade object (e.g. Items()). During the process of chaining methods in such a way you will build up a tree or hierarchy of facade instances. In order to step back to the parent or previous facade instance you need to call the End() method:</p>
<div style="display:inline;float:none;margin:0;padding:0;" id="scid:f32c3428-b7e9-4f15-a8ea-c502c7ff2e88:baeb4a9d-311b-4103-a3e8-cad67410cdb9" class="class">
<pre class="brush: c#;">site.Use()
       .RootWeb()
         .Site()
       .End()		// Returns SPWebFacade  as parent facade
         .Site()
       .End()		// Returns SPWebFacade  as parent facade
     .End();		// Returns SPSiteFacade as parent facade</pre>
</div>
<p>FluentSP is currently missing a number of possible useful methods, but you can easily extend the FluentSP API with custom facade classes and extension methods, see below and source code for implementation examples.<br />
  <br /><strong></strong></p>
<p><strong>Samples</strong></p>
<div style="display:inline;float:none;margin:0;padding:0;" id="scid:f32c3428-b7e9-4f15-a8ea-c502c7ff2e88:2cdd2c2d-f7c0-48d0-8610-ec9ef4aa3e5b" class="class">
<pre class="brush: c#;">SPSite site = SPContext.Current.Site;

// ----------------------------

// Outputs titles of all lists of the root web where the list title starts with T
site.Use().RootWeb().Lists().Where(l =&gt; l.Title.StartsWith(&quot;T&quot;)).ForEach(l =&gt; Console.WriteLine(l.Title));

// Outputs titles of all lists of the root web where the list title ends with a ts (using RegEx)
site.Use().RootWeb().Lists(&quot;ts$&quot;).ForEach(l =&gt; Console.WriteLine(l.Title)).Count(out c);

// Outputs titles of all lists of the root web in ascending order where the starts with T
site.Use().RootWeb().Lists().Where(l =&gt; l.Title.StartsWith(&quot;T&quot;)).OrderBy(l =&gt; l.Title).ForEach(l =&gt; Console.WriteLine(l.Title));

// Outputs titles of all lists of the root web in descending order where the starts with T
site.Use()
    .RootWeb()
      .Lists()
      .Where(l =&gt; l.Title.StartsWith(&quot;T&quot;))
      .OrderByDescending(l =&gt; l.Title)
      .ForEach(l =&gt; Console.WriteLine(l.Title));

// ----------------------------

// Delete all items in the Members list, then add 7 new members and then select and output
// the titles of a few of the newly created items
site.Use()
    .RootWeb()
      .List(&quot;Members&quot;)
      .Do(w =&gt; Console.WriteLine(&quot;Deleting all members...&quot;))
       .Items()
       .Delete()
      .End()
      .Do(w =&gt; Console.WriteLine(&quot;Adding all members...&quot;))
      .AddItems(7, (i, c) =&gt; i[&quot;Title&quot;] = &quot;Member &quot; + c)
       .Items()
       .Skip(2)
       .TakeUntil(i =&gt; ((string)i[&quot;Title&quot;]).EndsWith(&quot;6&quot;))
       .ForEach(i =&gt; Console.WriteLine(i[&quot;Title&quot;]));

// ----------------------------

// Search for lists that are created by specific a user and depending on the results
// displays different messages by calling the IfAny or IfEmpty methods
site.Use()
    .RootWeb()
      .Lists()
      .ThatAreCreatedBy(&quot;Unknown User&quot;)
      .IfAny(f =&gt; f.ForEach(l =&gt; Console.WriteLine(l.Title)))
      .IfAny(l =&gt; l.Title.StartsWith(&quot;M&quot;), f =&gt; Console.WriteLine(&quot;Lists found that starts with M*&quot;))
      .IfEmpty(f =&gt; Console.WriteLine(&quot;No lists found for user&quot;))
    .End()
    .Do(w =&gt; Console.WriteLine(&quot;---&quot;))
      .Lists()
      .ThatAreCreatedBy(&quot;System Account&quot;)
      .IfAny(f =&gt; f.ForEach(l =&gt; Console.WriteLine(l.Title)));

// ----------------------------

var items = new List&lt;SPListItem&gt;();

// Query with Skip and TakeUnitl methods
site.Use().RootWeb().List(&quot;Members&quot;).Items().Skip(2).TakeUntil(i =&gt; i.Title.EndsWith(&quot;5&quot;)).ForEach(i =&gt; { items.Add(i); Console.WriteLine(i.Title); });

// Query with Skip and TakeWhile methods
site.Use()
    .RootWeb()
      .List(&quot;Members&quot;)
       .Items()
       .Skip(2)
       .TakeWhile(i =&gt; i.Title.StartsWith(&quot;Member&quot;))
       .ForEach(i =&gt; { items.Add(i); Console.WriteLine(i.Title); })
      .End()
       .Items()
       .Where(i =&gt; i.Title == &quot;XYZ&quot;)
       .ForEach(i =&gt; { items.Add(i); Console.WriteLine(i.Title); });

// ----------------------------

// Adds new items using the Do method with the passed facade object
site.Use()
    .RootWeb()
    .AllowUnsafeUpdates()
      .List(&quot;Members&quot;)
      .Do((f, l) =&gt; {
        for(int c = 1; c &lt;= 5; c++)
          f.AddItem(i =&gt; i[&quot;Title&quot;] = &quot;Standard Member #&quot; + c);
      })
      .AddItem(i =&gt; i[&quot;Title&quot;] = &quot;Premium Member&quot;)
       .Items()
        .OrderBy(i =&gt; i.Title)
        .ForEach(i =&gt; Console.WriteLine(i[&quot;Title&quot;]));</pre>
</div>
<p><b>Extensibility Samples</b></p>
<div style="display:inline;float:none;margin:0;padding:0;" id="scid:f32c3428-b7e9-4f15-a8ea-c502c7ff2e88:310b9254-3296-4e21-9f4a-b355cec0081b" class="class">
<pre class="brush: c#;">// This sample is using the ThatAreCreatedBy extension method defined in Extensions.cs to show how to extend the fluent API
site.Use()
        .RootWeb()
          .Lists()
          .ThatAreCreatedBy(&quot;System Account&quot;, &quot;jbaurle&quot;)
          .Count(c =&gt; Console.WriteLine(&quot;Lists found: {0}&quot;, c))
          .ForEach(l =&gt; Console.WriteLine(l.Title));

// This sample uses the new SPWebApplicationFacade extenion defined in SPwebApplicationFacade.cs to show how to extend the fluent API
site.WebApplication.Use()
              .Sites()
              .ForEach(i =&gt; Console.WriteLine(i.Url));

// This sample uses an alternative implementation for SPSiteFacade defined in SPSiteFacadeAlternate.cs to show how to extend the fluent API
site.WebApplication.Use().WithFirstSite().DoSomething();
site.Use&lt;SPSiteFacadeAlternate&lt;BaseFacade&gt;&gt;().DoSomething();</pre>
</div>
<p>The custom method ThatAreCreatedBy which is used in the first query of the extensibility samples is implemented as follows:</p>
<div style="display:inline;float:none;margin:0;padding:0;" id="scid:f32c3428-b7e9-4f15-a8ea-c502c7ff2e88:3687795f-1367-4880-b7f5-d5f2c0283133" class="class">
<pre class="brush: c#;">static class Extensions
{
  public static SPListCollectionFacade&lt;TParentFacade&gt; ThatAreCreatedBy&lt;TParentFacade&gt;(this SPListCollectionFacade&lt;TParentFacade&gt; facade, params string[] names)
    where TParentFacade : BaseFacade
  {
    // NOTE: This sample uses the GetCollection method of the given facade instance to retrieve the current
    // collection and adds the its query (see LINQ Deferred Execution). The Set method updates the
    // underlying collection. The GetCurrentFacade method will then return the current facade to allow
    // method chaining.

    if(names.Length &gt; 0)
      facade.Set(facade.GetCollection().Where(i =&gt; names.Contains(i.Author.Name)));

    return facade.GetCurrentFacade();
  }
}</pre>
</div>
<p>For more samples and details check out the source code you can download from <a href="http://fluentsp.codeplex.com/" target="_blank">Codeplex</a>.</p>
<p><b>Built-In Facades and Methods</b></p>
<p>See <a href="http://fluentsp.codeplex.com/" target="_blank">Codeplex</a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/jbaurle.wordpress.com/383/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/jbaurle.wordpress.com/383/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/jbaurle.wordpress.com/383/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/jbaurle.wordpress.com/383/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/jbaurle.wordpress.com/383/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/jbaurle.wordpress.com/383/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/jbaurle.wordpress.com/383/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/jbaurle.wordpress.com/383/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/jbaurle.wordpress.com/383/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/jbaurle.wordpress.com/383/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/jbaurle.wordpress.com/383/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/jbaurle.wordpress.com/383/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/jbaurle.wordpress.com/383/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/jbaurle.wordpress.com/383/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jbaurle.wordpress.com&amp;blog=1409398&amp;post=383&amp;subd=jbaurle&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://jbaurle.wordpress.com/2011/09/19/fluentsp-the-fluent-sharepoint-api/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/1fbb1d3d9999f985eccdd0a4b2a6e14c?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">jbaurle</media:title>
		</media:content>
	</item>
		<item>
		<title>How To Implement A Generic Template Engine For SharePoint 2010 Using DotLiquid</title>
		<link>http://jbaurle.wordpress.com/2011/05/04/how-to-implement-a-generic-template-engine-for-sharepoint-2010-using-dotliquid/</link>
		<comments>http://jbaurle.wordpress.com/2011/05/04/how-to-implement-a-generic-template-engine-for-sharepoint-2010-using-dotliquid/#comments</comments>
		<pubDate>Wed, 04 May 2011 10:09:01 +0000</pubDate>
		<dc:creator>Jürgen Bäurle</dc:creator>
				<category><![CDATA[ASP.NET (MVC)]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[SharePoint]]></category>
		<category><![CDATA[DotLiquid]]></category>
		<category><![CDATA[Liquid]]></category>
		<category><![CDATA[Mail Templates]]></category>
		<category><![CDATA[Template Engine]]></category>

		<guid isPermaLink="false">https://jbaurle.wordpress.com/?p=335</guid>
		<description><![CDATA[*** NEW! My blog moved to my homepage at http://www.parago.de! *** During the process of creating a complex SharePoint application you often need to send mails and create text files based on SharePoint data elements like SPListItem or SPWeb. Mail templates for instance mostly contain specific list item data. It would be helpful sometimes if the [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jbaurle.wordpress.com&amp;blog=1409398&amp;post=335&amp;subd=jbaurle&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><strong>*** NEW! My blog moved to my homepage at <a title="http://www.parago.de" href="http://www.parago.de/" target="_blank">http://www.parago.de</a>! ***</strong></p>
<p>During the process of creating a complex SharePoint application you often need to send mails and create text files based on SharePoint data elements like SPListItem or SPWeb. Mail templates for instance mostly contain specific list item data. It would be helpful sometimes if the text generation itself is template-driven.</p>
<p>This article shows how to implement a generic template manager based on the free DotLiquid templating system with SharePoint specific extensions. This allows you for example to iterate through all SharePoint lists available within a SiteCollection and render only details for lists which contain Task in their title:</p>
<div id="scid:f32c3428-b7e9-4f15-a8ea-c502c7ff2e88:08a8ec5f-3495-4aa2-a17a-a9ba9c5da503" class="wlWriterEditableSmartContent" style="display:inline;float:none;margin:0;padding:0;">
<pre class="brush: c#;">&lt;p&gt;All task lists for the current web '{{SP.Web.Title}}' and site '{{SP.Site.Url}}'
  &lt;ul&gt;
    {% for list in SP.Lists %}
      {% if list.Title contains 'Task' %}
        &lt;li&gt;&lt;i&gt;{{list.Title}}&lt;/i&gt; with ID '{{Slist.ID|upcase}}' (&lt;i&gt;(Created:
                                                     {{list.Created|sp_format_date}})&lt;/i&gt;&lt;/li&gt;
      {% endif %}
    {% endfor %}
  &lt;/ul&gt;
&lt;/p&gt;
&lt;p&gt;All lists for current web '{{SP.Site.RootWeb.Title}}' created by the 'splists' tag
  &lt;ul&gt;{% splists '&lt;li&gt;{0}&lt;/li&gt;' %}&lt;/ul&gt;
&lt;/p&gt;</pre>
</div>
<p>The screenshot below shows the result of the rendered template sample:</p>
<p><a href="http://jbaurle.files.wordpress.com/2011/05/templateengine.png"><img style="background-image:none;padding-left:0;padding-right:0;display:inline;padding-top:0;border-width:0;" title="TemplateEngine" src="http://jbaurle.files.wordpress.com/2011/05/templateengine_thumb.png?w=644&#038;h=396" alt="TemplateEngine" width="644" height="396" border="0" /></a></p>
<p>Of course the technique implemented in this article can also be used in conjunction with other technologies or applications, it’s not only SharePoint related.</p>
<p><strong>DotLiquid Template Engine</strong></p>
<p>The DotLiquid template engine is a C# port of the Ruby’s Liquid templating system and is available for .NET 3.5 and above. DotLiquid is open source and can be downloaded at dotliquidmarkup.org. The software is also available as NuGet package for Visual Studio.</p>
<p>The templating system includes features like variable, text replacement, conditional evaluation and loop statements that are similar to common programming languages. The language elements consists of tags and filter constructs.</p>
<p>The engine can also be easily extended by implementing and adding custom filters and/or tags. This article actually shows how to extend the DotLiquid and implement SharePoint specific parts.</p>
<p>The following sample shows a Liquid template file:</p>
<div id="scid:f32c3428-b7e9-4f15-a8ea-c502c7ff2e88:a0b114df-2162-480e-b870-a5d121b49da0" class="wlWriterEditableSmartContent" style="display:inline;float:none;margin:0;padding:0;">
<pre class="brush: c#;">&lt;p&gt;{{ user.name | upcase }} has to do:&lt;/p&gt;

&lt;ul&gt;
{% for item in user.tasks -%}
  &lt;li&gt;{{ item.name }}&lt;/li&gt;
{% endfor -%}
&lt;/ul&gt;</pre>
</div>
<p>Output markup is surrounded by curly brackets {{…}} and tag markup by {%&#8230;%}. Output markup can take filter definitions like upcase. Filters are simple static methods, where the first parameter is always the output of the left side of the filter and the return value of the filter will be the new left value when the next filter is run. When there are no more filters, the template will receive the resulting string.</p>
<p>There are a big number of standard filters available to use, but later on we will implement a custom filter method for SharePoint. The result of the above rendered template looks like:</p>
<div id="scid:f32c3428-b7e9-4f15-a8ea-c502c7ff2e88:942e6c93-5134-4c80-8ded-f3c3771ea613" class="wlWriterEditableSmartContent" style="display:inline;float:none;margin:0;padding:0;">
<pre class="brush: c#;">&lt;p&gt;TIM JONES has to do:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Documentation&lt;/li&gt;
  &lt;li&gt;Code comments&lt;/li&gt;
&lt;/ul&gt;</pre>
</div>
<p>To pass variables and render the template you first need to parse the template and the then just call the Render method with the variable values:</p>
<div id="scid:f32c3428-b7e9-4f15-a8ea-c502c7ff2e88:0e617f5e-ecde-4712-b209-aeee9fd5492f" class="wlWriterEditableSmartContent" style="display:inline;float:none;margin:0;padding:0;">
<pre class="brush: c#;">string templateCode = @"&lt;ul&gt;
{% for item in user.tasks -%}
  &lt;li&gt;{{ item.name }}&lt;/li&gt;
{% endfor -%}
&lt;/ul&gt;";

Template template = Template.Parse(templateCode);

string result = template.Render(Hash.FromAnonymousObject(new {
                                    user = new User
                                    {
                                      Name = "Tim Jones",
                                      Tasks = new List&lt;Task&gt; {
                                        new Task { Name = "Documentation" },
                                        new Task { Name = "Code comments" }
                                      }
                                    }}));

public class User : Drop
{
	public string Name { get; set; }
	public List&lt;Task&gt; Tasks { get; set; }
}

public class Task : Drop
{
	public string Name { get; set;	 }
}</pre>
</div>
<p>The User and Task classes inherit from the Drop class. This is an important class in DotLiquid. The next sections explains the class in more detail. It is out of scope of this article to discuss all the features for DotLiquid in detail. For more information please see the homepage of DotLiquid (dotliquidmarkup.org) or the website of the original creator of the Liquid template language at liquidmarkup.org. You will find there a lot of manuals and sample code.</p>
<p><strong>Template Manager</strong></p>
<p>The TemplateManager class is a wrapper over the DotLiquid template engine and provides SharePoint support. The class allows to cache parsed templates, to register tags and filters and render them using a top-level custom Drop class named SharePointDrop:</p>
<div id="scid:f32c3428-b7e9-4f15-a8ea-c502c7ff2e88:24bd1fe7-ac82-4e6c-bc86-deae0eb3bcee" class="wlWriterEditableSmartContent" style="display:inline;float:none;margin:0;padding:0;">
<pre class="brush: c#;">internal class TemplateManager
{
  public Dictionary&lt;string, Template&gt; Templates { get; protected set; }

  public TemplateManager()
  {
    Templates = new Dictionary&lt;string, Template&gt;();
  }

  public void AddTemplate(string name, string template)
  {
    if(string.IsNullOrEmpty(name))
      throw new ArgumentNullException("name");
    if(string.IsNullOrEmpty(template))
      throw new ArgumentNullException("template");

    if(Templates.ContainsKey(name))
      Templates[name] = Template.Parse(template);
    else
      Templates.Add(name, Template.Parse(template));
  }

  public void RegisterTag&lt;T&gt;(string tagName) where T : Tag, new()
  {
    Template.RegisterTag&lt;T&gt;(tagName);
  }

  public void RegisterFilter(Type type)
  {
    Template.RegisterFilter(type);
  }

  public string Render(string nameOrTemplate, IDictionary&lt;string, object&gt; values)
  {
    Template template;

    if(Templates.ContainsKey(nameOrTemplate))
      template = Templates[nameOrTemplate];
    else
      template = Template.Parse(nameOrTemplate);

    SharePointDrop sp = new SharePointDrop();

    if(values != null)
    {
      foreach(KeyValuePair&lt;string, object&gt; kvp in values)
        sp.AddValue(kvp.Key, kvp.Value);
    }

    return template.Render(new RenderParameters { LocalVariables =
             Hash.FromAnonymousObject(new { SP = sp }), RethrowErrors = true });
  }
}</pre>
</div>
<p>The Render method is using the SharePointDrop class to support objects like SPListItem or SPListCollection. The Drop class as key concept of DotLiquid must be explained in detail. The DotLiquid template engine is focusing on making templates safe. A Drop is a class which allows you to export DOM like objects. DotLiquid, by default, only accepts a limited number of types as parameters to the Render method. These data types include the .NET primitive types (integer, float, string, etc.), and some collection types including IDictionary, IList and IIndexable (a custom DotLiquid interface).</p>
<p>If DotLiquid would support arbitrary types, then it could result in properties or methods being unintentionally exposed to template authors. To prevent this, DotLiquid templating system uses Drop classes that use an opt-in approach to exposing object data.</p>
<p>The code following shows the SharePointDrop implementation:</p>
<div id="scid:f32c3428-b7e9-4f15-a8ea-c502c7ff2e88:a2acc28e-a555-4bc7-8277-fa299b5b1c61" class="wlWriterEditableSmartContent" style="display:inline;float:none;margin:0;padding:0;">
<pre class="brush: c#;">internal class SharePointDrop : Drop
{
  Dictionary&lt;string, object&gt; _values;

  public SharePointDrop()
  {
    _values = new Dictionary&lt;string, object&gt;();

    if(SPContext.Current != null)
      _values.Add("Site", SPContext.Current.Site);
    if(SPContext.Current != null)
      _values.Add("Web", SPContext.Current.Web);
    if(SPContext.Current != null)
      _values.Add("User", SPContext.Current.Web.CurrentUser);

    _values.Add("Date", DateTime.Now);
    _values.Add("DateISO8601",
                   SPUtility.CreateISO8601DateTimeFromSystemDateTime(DateTime.Now));

    // TODO: Add more default values
  }

  public void AddValue(string name, object value)
  {
    if(string.IsNullOrEmpty(name))
      throw new ArgumentNullException("name");

    if(_values.ContainsKey(name))
      _values[name] = value;
    else
      _values.Add(name, value);
  }

  public override object BeforeMethod(string method)
  {
    if(!string.IsNullOrEmpty(method) &amp;&amp; _values.ContainsKey(method))
      return DropHelper.MayConvertToDrop(_values[method]);

    return null;
  }
}</pre>
</div>
<p>The SharePointDrop class main objective is to solve the problem of casting unsupported data types like SPListItem or SPListItemCollection and other SharePoint related types. Therefore the class is overriding the BeforeMethod method of the Drop class to analyse the requested variable value. If the variable is available in the value context the method will try to cast the data type to a known Drop type by calling the MayConvertToDrop method of the DropHelper class:</p>
<div id="scid:f32c3428-b7e9-4f15-a8ea-c502c7ff2e88:d8feb368-37c5-49ba-8b2c-103b907c69b6" class="wlWriterEditableSmartContent" style="display:inline;float:none;margin:0;padding:0;">
<pre class="brush: c#;">public static object MayConvertToDrop(object value)
{
  if(value != null)
  {
    // TODO: Add your own drop implementations here

    if(value is SPList)
      return new SPPropertyDrop(value);
    if(value is SPListCollection)
      return ConvertDropableList&lt;SPPropertyDrop, SPList&gt;(value as ICollection);
    if(value is SPListItem)
      return new SPListItemDrop(value as SPListItem);
    if(value is SPListItemCollection)
      return ConvertDropableList&lt;SPListItemDrop, SPListItem&gt;(value as ICollection);
    if(value is SPWeb)
      return new SPPropertyDrop(value);
    if(value is SPSite)
      return new SPPropertyDrop(value);
    if(value is SPUser)
      return new SPPropertyDrop(value);
    if(value is Uri)
      return ((Uri)value).ToString();
    if(value is Guid)
      return ((Guid)value).ToString("B");
  }

  return value;
}</pre>
</div>
<p>The SPListItemDrop class for instance is returning the value of the requested field:</p>
<div id="scid:f32c3428-b7e9-4f15-a8ea-c502c7ff2e88:f6f433e1-e6d0-4d00-aeec-ee4b9b1544d4" class="wlWriterEditableSmartContent" style="display:inline;float:none;margin:0;padding:0;">
<pre class="brush: c#;">internal class SPListItemDrop : SPDropBase
{
  public SPListItem ListItem { get { return DropableObject as SPListItem; } }

  public SPListItemDrop()
  {
  }

  public SPListItemDrop(SPListItem listItem)
  {
    DropableObject = listItem;
  }

  public override object BeforeMethod(string method)
  {
    if(!string.IsNullOrEmpty(method))
    {
      StringBuilder sb = new StringBuilder();
      string name = method + "\n";

      for(int i = 0; i &lt; name.Length; i++)
      {
        if(name[i] == '\n')
          continue;
        if(name[i] == '_')
        {
          if(name[i + 1] != '_')
            sb.Append(' ');
          else
          {
            i++;
            sb.Append('_');
          }
        }
        else
          sb.Append(name[i]);
      }

      name = sb.ToString();

      if(ListItem.Fields.ContainsField(name))
        return DropHelper.MayConvertToDrop(ListItem[name]);
    }

    return null;
  }
}</pre>
</div>
<p>The method parameter (field name of the SPListItem) of the BeforeMethod method can contain underscores which are replaced by spaces. So, field names with spaces like Start Date of the Task item must be defined in the template as {{task.Start_Date}}.</p>
<p>The SPPropertyDrop class, also part of the solution of this article, is a generic Drop implementation which exposes all properties of an object and may cast them if needed into an Drop objects again. For implementation details see the source code.</p>
<p><strong>Filters and Tags</strong></p>
<p>The solution is also providing a custom filter and tag implementation. The filter called sp_format_date (see template above) is implemented by the method SPFormatDate and is calling the FormatDate method of the class SPUtility form the SharePoint API:</p>
<div id="scid:f32c3428-b7e9-4f15-a8ea-c502c7ff2e88:f946a813-7f12-441a-9369-5ca0bbd1ddda" class="wlWriterEditableSmartContent" style="display:inline;float:none;margin:0;padding:0;">
<pre class="brush: c#;">internal static class SPFilters
{
  public static object SPFormatDate(object input)
  {
    DateTime dt = DateTime.MinValue;

    if(input is string)
    {
      try
      {
        dt = SPUtility.ParseDate(SPContext.Current.Web, input as string,
               SPDateFormat.DateOnly, false);
      }
      catch { }
    }
    else if(input is DateTime)
      dt = (DateTime)input;

    if(dt != DateTime.MinValue &amp;&amp; dt != DateTime.MaxValue &amp;&amp; SPContext.Current != null)
      return SPUtility.FormatDate(SPContext.Current.Web, (DateTime)input,
               SPDateFormat.DateOnly);

    return input;
  }
}</pre>
</div>
<p>The custom tag named splists is returning a formatted list of all SPList object names of the current web (see template above):</p>
<div id="scid:f32c3428-b7e9-4f15-a8ea-c502c7ff2e88:fbc9ba06-7b1b-46c8-91f3-e673b2d35539" class="wlWriterEditableSmartContent" style="display:inline;float:none;margin:0;padding:0;">
<pre class="brush: c#;">internal class SPListsTag : Tag
{
  string _format;

  public override void Initialize(string tagName, string markup, List&lt;string&gt; tokens)
  {
    base.Initialize(tagName, markup, tokens);

    if(string.IsNullOrEmpty(markup))
      _format = "{0}";
    else
      _format = markup.Trim().Trim("\"".ToCharArray()).Trim("'".ToCharArray());
  }

  public override void Render(Context context, StreamWriter result)
  {
    base.Render(context, result);

    if(SPContext.Current != null &amp;&amp; !string.IsNullOrEmpty(_format))
    {
      foreach(SPList list in SPContext.Current.Web.Lists)
        result.Write(string.Format(_format, list.Title));
    }
  }
}</pre>
</div>
<p><a href="http://content.parago.de/samples/SP2010TemplateEngine.zip">Download Source Code</a> | <a href="http://content.parago.de/articles/SP2010TemplateEngine/HowToImplementAGenericTemplateEngineForSharePoint2010UsingDotLiquid.pdf">Download Article (PDF)</a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/jbaurle.wordpress.com/335/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/jbaurle.wordpress.com/335/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/jbaurle.wordpress.com/335/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/jbaurle.wordpress.com/335/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/jbaurle.wordpress.com/335/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/jbaurle.wordpress.com/335/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/jbaurle.wordpress.com/335/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/jbaurle.wordpress.com/335/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/jbaurle.wordpress.com/335/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/jbaurle.wordpress.com/335/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/jbaurle.wordpress.com/335/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/jbaurle.wordpress.com/335/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/jbaurle.wordpress.com/335/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/jbaurle.wordpress.com/335/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jbaurle.wordpress.com&amp;blog=1409398&amp;post=335&amp;subd=jbaurle&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://jbaurle.wordpress.com/2011/05/04/how-to-implement-a-generic-template-engine-for-sharepoint-2010-using-dotliquid/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/1fbb1d3d9999f985eccdd0a4b2a6e14c?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">jbaurle</media:title>
		</media:content>

		<media:content url="http://jbaurle.files.wordpress.com/2011/05/templateengine_thumb.png" medium="image">
			<media:title type="html">TemplateEngine</media:title>
		</media:content>
	</item>
		<item>
		<title>How To Use SharePoint 2010 Secure Store As Single Sign-On Service For SAP Applications Using ERPConnect</title>
		<link>http://jbaurle.wordpress.com/2011/04/30/how-to-use-sharepoint-2010-secure-store-as-single-sign-on-service-for-sap-applications-using-erpconnect/</link>
		<comments>http://jbaurle.wordpress.com/2011/04/30/how-to-use-sharepoint-2010-secure-store-as-single-sign-on-service-for-sap-applications-using-erpconnect/#comments</comments>
		<pubDate>Sat, 30 Apr 2011 08:54:50 +0000</pubDate>
		<dc:creator>Jürgen Bäurle</dc:creator>
				<category><![CDATA[SAP]]></category>
		<category><![CDATA[SharePoint]]></category>
		<category><![CDATA[ERPConnect]]></category>
		<category><![CDATA[Secure Store Service]]></category>
		<category><![CDATA[Single Sign-on]]></category>
		<category><![CDATA[SSO]]></category>

		<guid isPermaLink="false">https://jbaurle.wordpress.com/?p=317</guid>
		<description><![CDATA[*** NEW! My blog moved to my homepage at http://www.parago.de! *** The Secure Store Service in SharePoint 2010 replaces the Single Sign-on Shared Service of MOSS 2007 and provides an easy way to map user credentials of external resources like SAP systems to Windows users. During the process of developing SAP interfaces using the very handy [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jbaurle.wordpress.com&amp;blog=1409398&amp;post=317&amp;subd=jbaurle&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><strong>*** NEW! My blog moved to my homepage at <a title="http://www.parago.de" href="http://www.parago.de/" target="_blank">http://www.parago.de</a>! ***</strong></p>
<p>The Secure Store Service in SharePoint 2010 replaces the Single Sign-on Shared Service of MOSS 2007 and provides an easy way to map user credentials of external resources like SAP systems to Windows users. During the process of developing SAP interfaces using the very handy ERPConnect library from Theobald Software you have to open a R3 connection with the SAP system using SAP account credentials (username and password).</p>
<p>In most cases you will use a so called technical user with limited access rights to execute or query objects in SAP, but a SAP system saves a lot of sensitive data which cannot all be shown to all users. So, creating a new secure store in SharePoint 2010 to save the SAP user credentials will be the solution. Accessing the secure store from program code is quite simple.</p>
<p>A trail version of the ERPConnect library can be downloaded at <a href="http://www.theobald-software.com">www.theobald-software.com</a>.</p>
<p><strong>Secure Store Configuration</strong></p>
<p>The Secure Store Service will be managed by the Central Administration (CA) of SharePoint 2010 under <em>Application Management &gt; Manage service applications &gt; Secure Store Service</em>:</p>
<p><a href="http://jbaurle.files.wordpress.com/2011/04/screenshot1.png"><img style="background-image:none;padding-left:0;padding-right:0;display:inline;padding-top:0;border-width:0;" title="Screenshot1" src="http://jbaurle.files.wordpress.com/2011/04/screenshot1_thumb.png?w=644&#038;h=227" alt="Screenshot1" width="644" height="227" border="0" /></a></p>
<p>As the screenshot above shows is it possible to create multiple target applications within one Secure Store Service.</p>
<p>Clicking the New button will open the Create New Secure Store Target Application page. In this dialog you have to enter the new Target Application ID, a display name, a contact email address and other application related details (see screenshot below).</p>
<p><a href="http://jbaurle.files.wordpress.com/2011/04/screenshot2.png"><img style="background-image:none;padding-left:0;padding-right:0;display:inline;padding-top:0;border-width:0;" title="Screenshot2" src="http://jbaurle.files.wordpress.com/2011/04/screenshot2_thumb.png?w=644&#038;h=341" alt="Screenshot2" width="644" height="341" border="0" /></a></p>
<p>Next, the application fields must be defined:</p>
<p><a href="http://jbaurle.files.wordpress.com/2011/04/screenshot3.png"><img style="background-image:none;padding-left:0;padding-right:0;display:inline;padding-top:0;border-width:0;" title="Screenshot3" src="http://jbaurle.files.wordpress.com/2011/04/screenshot3_thumb.png?w=644&#038;h=248" alt="Screenshot3" width="644" height="248" border="0" /></a></p>
<p>It’s important to select the field type User Name and Password, because our implementation later on will check the target application for those two field types.</p>
<p>In the last dialog step the application administrator must be defined. After defining the administrator and clicking the Ok button SharePoint is creating a new secure store:</p>
<p><a href="http://jbaurle.files.wordpress.com/2011/04/screenshot5.png"><img style="background-image:none;padding-left:0;padding-right:0;display:inline;padding-top:0;border-width:0;" title="Screenshot5" src="http://jbaurle.files.wordpress.com/2011/04/screenshot5_thumb.png?w=644&#038;h=203" alt="Screenshot5" width="644" height="203" border="0" /></a></p>
<p>Next, the Windows users must be mapped to the SAP user credentails. Therefore mark the checkbox for the newly created secure store SAPCredentialsStore and click the Set button in the toolbar. This opens the following dialog:</p>
<p><a href="http://jbaurle.files.wordpress.com/2011/04/screenshot6.png"><img style="background-image:none;padding-left:0;padding-right:0;display:inline;padding-top:0;border-width:0;" title="Screenshot6" src="http://jbaurle.files.wordpress.com/2011/04/screenshot6_thumb.png?w=644&#038;h=440" alt="Screenshot6" width="644" height="440" border="0" /></a></p>
<p>The Credential Owner is the Windows user for whom the SAP user credentials will be set. Enter the SAP username and password and click the Ok button to save them.</p>
<p>That’s it !</p>
<p><strong>Secure Store Programming</strong></p>
<p>Accessing the secure store by code is simple. We implement a SecureStore class which will encapsulate all the access logic. A second class called SecureStoreCredentials contains the retrieved user credentials returned by the method GetCurrentCredentials of the SecureStore class.</p>
<p>But first, we need to create a Visual Studio 2010 SharePoint project and reference a couple of assemblies. You can directly enter the file paths in the Reference dialog (Browse tab) to add the assemblies:</p>
<p><em>Microsoft.BusinessData.dll</em><br />
C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\ISAPI\Microsoft.BusinessData.dll</p>
<p><em>Microsoft.Office.SecureStoreService.dll<br />
</em>C:\Windows\assembly\GAC_MSIL\Microsoft.Office.SecureStoreService\14.0.0.0__71e9bce111e9429c\Microsoft.Office.SecureStoreService.dll</p>
<p>The following code shows the SecureStore class implementation:</p>
<div id="scid:f32c3428-b7e9-4f15-a8ea-c502c7ff2e88:ee6cfa12-2c0b-49b2-865b-7a56f53e9261" class="wlWriterEditableSmartContent" style="display:inline;float:none;margin:0;padding:0;">
<pre class="brush: c#;">internal class SecureStore
{
  public string ApplicationId { get; private set; }

  public SecureStore(string applicationId)
  {
    if(string.IsNullOrEmpty(applicationId))
      throw new ArgumentNullException("applicationId");
    if(!IsApplicationValid(applicationId))
      throw new ArgumentException(string.Format("Target application with ID '{0}' is not defined.", applicationId));

    ApplicationId = applicationId;
  }

  public SecureStoreCredentials GetCurrentCredentials()
  {
    SecureStoreProvider provider = new SecureStoreProvider { Context = SPServiceContext.Current };
    string userName = string.Empty;
    string password = string.Empty;

    using(SecureStoreCredentialCollection data = provider.GetCredentials(ApplicationId))
    {
      foreach(ISecureStoreCredential c in data)
      {
        if(c != null)
        {
          if(c.CredentialType == SecureStoreCredentialType.UserName)
            userName = GetDecryptedCredentialString(c.Credential);
          else if(c.CredentialType == SecureStoreCredentialType.Password)
            password = GetDecryptedCredentialString(c.Credential);
        }
      }
    }

    if(string.IsNullOrEmpty(userName) || string.IsNullOrEmpty(password))
      throw new SecureStoreException("Credentials for the current Windows user are not valid or not defined.");

    return new SecureStoreCredentials(userName, password);
  }

  public static bool IsApplicationValid(string applicationId)
  {
    if(string.IsNullOrEmpty(applicationId))
      throw new ArgumentNullException("applicationId");

    SecureStoreProvider provider = new SecureStoreProvider { Context = SPServiceContext.Current };

    foreach(TargetApplication application in provider.GetTargetApplications())
    {
      if(application.ApplicationId == applicationId)
      {
        ReadOnlyCollection&lt;ITargetApplicationField&gt; fields = provider.GetTargetApplicationFields(applicationId);
        bool existsUserNameDefinition = false;
        bool existsPasswordDefinition = false;

        foreach(TargetApplicationField field in fields)
        {
          if(field.CredentialType == SecureStoreCredentialType.UserName)
            existsUserNameDefinition = true;
          else if(field.CredentialType == SecureStoreCredentialType.Password)
            existsPasswordDefinition = true;
        }

        if(existsUserNameDefinition &amp;&amp; existsPasswordDefinition)
          return true;
      }
    }

    return false;
  }

  public static string GetDecryptedCredentialString(SecureString secureString)
  {
    IntPtr p = Marshal.SecureStringToBSTR(secureString);

    try
    {
      return Marshal.PtrToStringUni(p);
    }
    finally
    {
      if(p != IntPtr.Zero)
        Marshal.FreeBSTR(p);
    }
  }
}</pre>
</div>
<p>The constructor checks if an application ID is passed and if it’s valid by calling the static method IsApplicationValid. In first place, the IsApplicationValid method is creating an instance of the SecureStoreProvider class to get access to Secure Store Service. The SecureStoreProvider class provides all methods to talk to the SharePoint service. Then, the method queries for all target applications and checks for the given application. If the application has been created and can be found, the method will analyse the application field definitions. The IsApplicationValid method then looks for two fields of type User Name and Password (see above).</p>
<p>The GetCurrentCredentials method is actually trying to get the SAP user credentials from the store. The method is creating an instance of the SecureStoreProvider class to get access to service and then calls the GetCredentials method of the provider class. If credentials are available the method decrypt the username and password from type SecureString using the internal method GetDecryptedCredentialString. It then will wrap and return the data into an instance of the SecureStoreCredentails class.</p>
<p>For more details of the implementation see the source code.</p>
<p><strong>Accessing SAP Using The Secure Store Credentials</strong></p>
<p>The sample and test code calls the SAP function module SD_RFC_CUSTOMER_GET to retrieve all customer data that match certain criteria (where NAME1 starts with Te*):</p>
<p><a href="http://jbaurle.files.wordpress.com/2011/04/screenshot7.png"><img style="background-image:none;padding-left:0;padding-right:0;display:inline;padding-top:0;border-width:0;" title="Screenshot7" src="http://jbaurle.files.wordpress.com/2011/04/screenshot7_thumb.png?w=644&#038;h=442" alt="Screenshot7" width="644" height="442" border="0" /></a></p>
<p>The following code shows the implementation of the Test button click event:</p>
<div id="scid:f32c3428-b7e9-4f15-a8ea-c502c7ff2e88:a440df40-cc05-4371-ac9d-9319368dbc7f" class="wlWriterEditableSmartContent" style="display:inline;float:none;margin:0;padding:0;">
<pre class="brush: c#;">protected void OnTestButtonClick(object sender, EventArgs e)
{
  string licenseKey = "&lt;LICENSEKEY&gt;";
  string connectionStringFormat = "CLIENT=800 LANG=EN USER={0} PASSWD={1} ASHOST=HAMLET ...";

  R3Connection connection = null;

  try
  {
    LIC.SetLic(licenseKey);

    ...

    SecureStoreCredentials credentials =
      new SecureStore(ApplicationID.Text).GetCurrentCredentials();
    string connectionstring =
      string.Format(connectionStringFormat, credentials.UserName, credentials.Password);

    connection = new R3Connection(connectionstring);
    connection.Open();

    RFCFunction function = connection.CreateFunction("SD_RFC_CUSTOMER_GET");
    function.Exports["NAME1"].ParamValue = "Te*";
    function.Execute();

    ResultGrid.DataSource = function.Tables["CUSTOMER_T"].ToADOTable();
    ResultGrid.DataBind();

    OutputLabel.Text = string.Format("The test called...",
      ApplicationID.Text, Web.CurrentUser.Name, Web.CurrentUser.LoginName,
      credentials.UserName);
  }
  catch(Exception ex)
  {
    WriteErrorMessage(ex.Message);
  }
  finally
  {
    if(connection != null &amp;&amp; connection.Ping())
      connection.Close();
  }
}</pre>
</div>
<p>The interesting part is the retrieval of the SAP user credentials from the secure store defined in the text box named ApplicationID. The application ID will be passed as parameter to the constructor of the SecureStore class. After creating the instance the method GetCurrentCredentials will be called to ask the store for the credentials of the current Windows user.</p>
<p>After the user credential query has been successfully executed the SAP connection string will be constructed. Then the connection string will then be used to create an instance of the R3Connection class to connect with the SAP system. The remaining code is just calling the function module SD_RFC_CUSTOMER_GET and binding the result to the SPGridView.</p>
<p><a href="http://content.parago.de/samples/SP2010SecureStoreSAP.zip">Download Source Code</a> | <a href="http://content.parago.de/articles/SP2010SecureStoreSAP/HowToUseSharePoint2010SecureStoreAsSingleSignOnServiceForSAPApplicationsUsingERPConnect.pdf">Download Article (PDF)</a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/jbaurle.wordpress.com/317/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/jbaurle.wordpress.com/317/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/jbaurle.wordpress.com/317/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/jbaurle.wordpress.com/317/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/jbaurle.wordpress.com/317/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/jbaurle.wordpress.com/317/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/jbaurle.wordpress.com/317/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/jbaurle.wordpress.com/317/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/jbaurle.wordpress.com/317/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/jbaurle.wordpress.com/317/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/jbaurle.wordpress.com/317/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/jbaurle.wordpress.com/317/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/jbaurle.wordpress.com/317/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/jbaurle.wordpress.com/317/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jbaurle.wordpress.com&amp;blog=1409398&amp;post=317&amp;subd=jbaurle&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://jbaurle.wordpress.com/2011/04/30/how-to-use-sharepoint-2010-secure-store-as-single-sign-on-service-for-sap-applications-using-erpconnect/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/1fbb1d3d9999f985eccdd0a4b2a6e14c?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">jbaurle</media:title>
		</media:content>

		<media:content url="http://jbaurle.files.wordpress.com/2011/04/screenshot1_thumb.png" medium="image">
			<media:title type="html">Screenshot1</media:title>
		</media:content>

		<media:content url="http://jbaurle.files.wordpress.com/2011/04/screenshot2_thumb.png" medium="image">
			<media:title type="html">Screenshot2</media:title>
		</media:content>

		<media:content url="http://jbaurle.files.wordpress.com/2011/04/screenshot3_thumb.png" medium="image">
			<media:title type="html">Screenshot3</media:title>
		</media:content>

		<media:content url="http://jbaurle.files.wordpress.com/2011/04/screenshot5_thumb.png" medium="image">
			<media:title type="html">Screenshot5</media:title>
		</media:content>

		<media:content url="http://jbaurle.files.wordpress.com/2011/04/screenshot6_thumb.png" medium="image">
			<media:title type="html">Screenshot6</media:title>
		</media:content>

		<media:content url="http://jbaurle.files.wordpress.com/2011/04/screenshot7_thumb.png" medium="image">
			<media:title type="html">Screenshot7</media:title>
		</media:content>
	</item>
		<item>
		<title>How To Implement A Modern Progress Dialog For WPF Applications</title>
		<link>http://jbaurle.wordpress.com/2011/04/22/how-to-implement-a-modern-progress-dialog-for-wpf-applications/</link>
		<comments>http://jbaurle.wordpress.com/2011/04/22/how-to-implement-a-modern-progress-dialog-for-wpf-applications/#comments</comments>
		<pubDate>Fri, 22 Apr 2011 19:13:49 +0000</pubDate>
		<dc:creator>Jürgen Bäurle</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[WPF]]></category>
		<category><![CDATA[Background Process]]></category>
		<category><![CDATA[BackgroundWorker]]></category>
		<category><![CDATA[progress bar]]></category>
		<category><![CDATA[Progress Dialog]]></category>

		<guid isPermaLink="false">https://jbaurle.wordpress.com/?p=309</guid>
		<description><![CDATA[*** NEW! My blog moved to my homepage at http://www.parago.de! *** Developing a Windows Presentation Foundation (WPF) application requires sometimes to execute an asynchronous task with long-running execution steps, e.g. calling a web service. If those steps are triggered by user interactions, you want show a progress dialog to block the user interface and display detail [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jbaurle.wordpress.com&amp;blog=1409398&amp;post=309&amp;subd=jbaurle&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><strong>*** NEW! My blog moved to my homepage at <a title="http://www.parago.de" href="http://www.parago.de/" target="_blank">http://www.parago.de</a>! ***</strong></p>
<p>Developing a Windows Presentation Foundation (WPF) application requires sometimes to execute an asynchronous task with long-running execution steps, e.g. calling a web service. If those steps are triggered by user interactions, you want show a progress dialog to block the user interface and display detail step information. In some cases you also want to allow the user to stop the long-running task by clicking a Cancel button.</p>
<p>The following screenshots show some samples of progress dialogs implemented in this blog entry:</p>
<p><a href="http://jbaurle.files.wordpress.com/2011/04/image.png"><img style="background-image:none;padding-left:0;padding-right:0;display:inline;padding-top:0;border-width:0;margin:0;" title="image" src="http://jbaurle.files.wordpress.com/2011/04/image_thumb.png?w=244&#038;h=97" alt="image" width="244" height="97" border="0" /></a></p>
<p><a href="http://jbaurle.files.wordpress.com/2011/04/image1.png"><img style="background-image:none;padding-left:0;padding-right:0;display:inline;padding-top:0;border-width:0;margin:0;" title="image" src="http://jbaurle.files.wordpress.com/2011/04/image_thumb1.png?w=244&#038;h=97" alt="image" width="244" height="97" border="0" /></a></p>
<p><a href="http://jbaurle.files.wordpress.com/2011/04/image2.png"><img style="background-image:none;padding-left:0;padding-right:0;display:inline;padding-top:0;border-width:0;margin:0;" title="image" src="http://jbaurle.files.wordpress.com/2011/04/image_thumb2.png?w=244&#038;h=97" alt="image" width="244" height="97" border="0" /></a></p>
<p><a href="http://jbaurle.files.wordpress.com/2011/04/image3.png"><img style="background-image:none;padding-left:0;padding-right:0;display:inline;padding-top:0;border-width:0;margin:0;" title="image" src="http://jbaurle.files.wordpress.com/2011/04/image_thumb3.png?w=244&#038;h=89" alt="image" width="244" height="89" border="0" /></a></p>
<p>This article will show how to implement such progress dialogs in WPF with C#. All of the above dialogs can be used with one implementation. The solution will also show how to hide the close button of a window, which is officially not supported by WPF.</p>
<p>The code snippet below shows how to use and display such a progress dialog:</p>
<div id="scid:f32c3428-b7e9-4f15-a8ea-c502c7ff2e88:2909b695-2e79-4c59-8052-8c72484504b9" class="wlWriterEditableSmartContent" style="display:inline;float:none;margin:0;padding:0;">
<pre class="brush: c#;">ProgressDialogResult result = ProgressDialog.Execute(this, "Loading data...", () =&gt; {

  // TODO: Do your work here!

});

if(result.OperationFailed)
  MessageBox.Show("ProgressDialog failed.");
else
  MessageBox.Show("ProgressDialog successfully executed.");</pre>
</div>
<p>The ProcessDialog class provides a number of static Execute methods (overrides) to easily setup a long-running task with a dialog window. The first parameter always defines the parent window in order to center the process dialog relative to the parent window. The second parameter is the text message displayed in all dialogs. The third parameter is the asynchronous method itself.</p>
<p>The fourth parameter allows to pass additional settings. Those dialog settings, represented by an instance of the ProcessDialogSettings class, define if the dialog shows a sub label, has a Cancel button or displays the progress bar itself in percentage or indeterminate. Predefined settings are also defined as static properties.</p>
<p>Using lambda expressions in C#, it is very comfortable to start a long-running task and displaying the dialog. You can also communicate with the progress dialog to report messages to the user by calling the Report method of the ProgressDialog class:</p>
<div id="scid:f32c3428-b7e9-4f15-a8ea-c502c7ff2e88:f45de43c-d914-4339-aa3d-84eccb1dc59a" class="wlWriterEditableSmartContent" style="display:inline;float:none;margin:0;padding:0;">
<pre class="brush: c#;">ProgressDialogResult result = ProgressDialog.Execute(this, "Loading data...", (bw) =&gt; {

  ProgressDialog.Report(bw, "Connecting to the server...");

  // TODO: Connect to the server

  ProgressDialog.Report(bw, "Reading metadata...");

  // TODO: Reading metadata

}, ProgressDialogSettings.WithSubLabel);</pre>
</div>
<p>The two samples above did not show a Cancel button. The next code shows a progress dialog with a Cancel button including code to check if the long-running code must be cancelled:</p>
<div id="scid:f32c3428-b7e9-4f15-a8ea-c502c7ff2e88:0c414dd1-3358-4146-b32c-42da673448c3" class="wlWriterEditableSmartContent" style="display:inline;float:none;margin:0;padding:0;">
<pre class="brush: c#;">int millisecondsTimeout = 1500;

ProgressDialogResult result = ProgressDialog.Execute(this, "Loading data", (bw, we) =&gt; {

  for(int i = 1; i &lt;= 5; i++)
  {
    if(ProgressDialog.ReportWithCancellationCheck(bw, we, "Executing step {0}/5...", i))
      return;

    Thread.Sleep(millisecondsTimeout);
  }

  // So this check in order to avoid default processing after the Cancel button has been
  // pressed. This call will set the Cancelled flag on the result structure.
  ProgressDialog.CheckForPendingCancellation(bw, we);

}, ProgressDialogSettings.WithSubLabelAndCancel);

if(result.Cancelled)
  MessageBox.Show("ProgressDialog cancelled.");
else if(result.OperationFailed)
  MessageBox.Show("ProgressDialog failed.");
else
  MessageBox.Show("ProgressDialog successfully executed.");</pre>
</div>
<p>Calling the ReportWithCancellationCheck method will check for a pending cancellation request (from the UI) and will may set the Cancel property of the DoWorkEventArgs class passed from the underlying BackgroundWorker object to True. Otherwise the method will display the message and continue processing.</p>
<p>The Exceute method of the ProgressDialog class will return an instance of the ProgressDialogResult class that returns the status of the execution. Thrown exceptions in the task method will be stored in the Error property if the OperationFailed property is set to True. For more samples see the Visual Studio 2010 solution you can download from my homepage.</p>
<p>The ProgressDialog window contains the main application logic. The above described static Execute methods will internally call the ExecuteInternal method to create an instance of the ProgressDialog window passing and setting all necessary values. Then the Execute method with the asynchronous method as parameter is called:</p>
<div id="scid:f32c3428-b7e9-4f15-a8ea-c502c7ff2e88:4835e7c9-2ba7-4b62-9e26-a3a95bc9013e" class="wlWriterEditableSmartContent" style="display:inline;float:none;margin:0;padding:0;">
<pre class="brush: c#;">internal static ProgressDialogResult ExecuteInternal(Window owner, string label,
  object operation, ProgressDialogSettings settings)
{
  ProgressDialog dialog = new ProgressDialog(settings);
  dialog.Owner = owner;

  if(!string.IsNullOrEmpty(label))
    dialog.Label = label;

  return dialog.Execute(operation);
}</pre>
</div>
<p>The operation method can be a delegate of the following type:</p>
<p>· Action</p>
<p>· Action&lt;BackgroundWorker&gt;</p>
<p>· Action&lt;BackgroundWorker, DoWorkEventArgs&gt;</p>
<p>· Func&lt;object&gt;</p>
<p>· Func&lt;BackgroundWorker, object&gt;</p>
<p>· Func&lt;BackgroundWorker, DoWorkEventArgs, object&gt;</p>
<p>The Func types can return a value that will be used to set the Result property of the ProgressDialogResult class.</p>
<p>The Excute method is implemented as follows:</p>
<div id="scid:f32c3428-b7e9-4f15-a8ea-c502c7ff2e88:bb5b828f-441f-4038-95b4-d550f4b647f6" class="wlWriterEditableSmartContent" style="display:inline;float:none;margin:0;padding:0;">
<pre class="brush: c#;">internal ProgressDialogResult Execute(object operation)
{
  if(operation == null)
    throw new ArgumentNullException("operation");

  ProgressDialogResult result = null;

  _isBusy = true;

  _worker = new BackgroundWorker();
  _worker.WorkerReportsProgress = true;
  _worker.WorkerSupportsCancellation = true;

  _worker.DoWork +=
    (s, e) =&gt; {
      if(operation is Action)
        ((Action)operation)();
      else if(operation is Action&lt;BackgroundWorker&gt;)
        ((Action&lt;BackgroundWorker&gt;)operation)(s as BackgroundWorker);
      else if(operation is Action&lt;BackgroundWorker, DoWorkEventArgs&gt;)
        ((Action&lt;BackgroundWorker, DoWorkEventArgs&gt;)operation)(s as BackgroundWorker, e);
      else if(operation is Func&lt;object&gt;)
        e.Result = ((Func&lt;object&gt;)operation)();
      else if(operation is Func&lt;BackgroundWorker, object&gt;)
        e.Result = ((Func&lt;BackgroundWorker, object&gt;)operation)(s as BackgroundWorker);
      else if(operation is Func&lt;BackgroundWorker, DoWorkEventArgs, object&gt;)
        e.Result = ((Func&lt;BackgroundWorker, DoWorkEventArgs, object&gt;)operation)(s as BackgroundWorker, e);
      else
        throw new InvalidOperationException("Operation type is not supoorted");
    };

  _worker.RunWorkerCompleted +=
    (s, e) =&gt; {
      result = new ProgressDialogResult(e);
      Dispatcher.BeginInvoke(DispatcherPriority.Send, (SendOrPostCallback)delegate {
        _isBusy = false;
        Close();
      }, null);
    };

  _worker.ProgressChanged +=
    (s, e) =&gt; {
      if(!_worker.CancellationPending)
      {
        SubLabel = (e.UserState as string) ?? string.Empty;
        ProgressBar.Value = e.ProgressPercentage;
      }
    };

  _worker.RunWorkerAsync();

  ShowDialog();

  return result;
}</pre>
</div>
<p>The ProgressDialog class is using internally a BackgroundWorker object to handle the asynchronous execution of the task or operation method.</p>
<p>For more details of the implementation see the source code.</p>
<p><a href="http://content.parago.de/samples/ProgressDialog.zip">Download Source Code</a></p>
<p><a href="http://content.parago.de/articles/ProgressDialog/HowToImplementAModernProgressDialogForWPFApplications.pdf">Download Article (PDF)</a></p>
<p><strong>UPDATE:</strong></p>
<p>I wrote a second edition of the progress dialog which is using a ProgressDialogContext class to access BackgroundWorker and the DoWorkEventArgs. Also, all Report methods moved to the context class. So, you can basically use the static ProgressDialog.Current property within the asynchronous method and its sub methods to report to the progress dialog. This usefully if you call a chain of methods in which you have to report messages to the dialog and may need to cancel the process.</p>
<p><a href="http://content.parago.de/samples/ProgressDialogEx.zip">Download Source Code with ProgresDialogContext class</a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/jbaurle.wordpress.com/309/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/jbaurle.wordpress.com/309/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/jbaurle.wordpress.com/309/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/jbaurle.wordpress.com/309/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/jbaurle.wordpress.com/309/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/jbaurle.wordpress.com/309/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/jbaurle.wordpress.com/309/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/jbaurle.wordpress.com/309/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/jbaurle.wordpress.com/309/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/jbaurle.wordpress.com/309/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/jbaurle.wordpress.com/309/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/jbaurle.wordpress.com/309/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/jbaurle.wordpress.com/309/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/jbaurle.wordpress.com/309/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jbaurle.wordpress.com&amp;blog=1409398&amp;post=309&amp;subd=jbaurle&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://jbaurle.wordpress.com/2011/04/22/how-to-implement-a-modern-progress-dialog-for-wpf-applications/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/1fbb1d3d9999f985eccdd0a4b2a6e14c?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">jbaurle</media:title>
		</media:content>

		<media:content url="http://jbaurle.files.wordpress.com/2011/04/image_thumb.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>

		<media:content url="http://jbaurle.files.wordpress.com/2011/04/image_thumb1.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>

		<media:content url="http://jbaurle.files.wordpress.com/2011/04/image_thumb2.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>

		<media:content url="http://jbaurle.files.wordpress.com/2011/04/image_thumb3.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>
	</item>
		<item>
		<title>How To Implement A Custom SharePoint 2010 Logging Service For ULS And Windows Event Log</title>
		<link>http://jbaurle.wordpress.com/2011/01/16/how-to-implement-a-custom-sharepoint-2010-logging-service-for-uls-and-windows-event-log/</link>
		<comments>http://jbaurle.wordpress.com/2011/01/16/how-to-implement-a-custom-sharepoint-2010-logging-service-for-uls-and-windows-event-log/#comments</comments>
		<pubDate>Sun, 16 Jan 2011 17:45:00 +0000</pubDate>
		<dc:creator>Jürgen Bäurle</dc:creator>
				<category><![CDATA[ASP.NET (MVC)]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[SharePoint]]></category>
		<category><![CDATA[CA]]></category>
		<category><![CDATA[Central Administration]]></category>
		<category><![CDATA[Logging]]></category>
		<category><![CDATA[SharePoint 2010]]></category>
		<category><![CDATA[SPDiagnosticsArea]]></category>
		<category><![CDATA[SPDiagnosticsCategory]]></category>
		<category><![CDATA[ULS]]></category>
		<category><![CDATA[Windows Event Log]]></category>

		<guid isPermaLink="false">https://jbaurle.wordpress.com/?p=277</guid>
		<description><![CDATA[Prior to Microsoft SharePoint 2010 there was no official documented way to programmatically use the built-in ULS service (Unified Logging Service) to log own custom messages. There are still solutions available on the internet that can be used, but SharePoint 2010 now supports full-blown logging service support. To log a message to the SharePoint log [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jbaurle.wordpress.com&amp;blog=1409398&amp;post=277&amp;subd=jbaurle&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Prior to Microsoft SharePoint 2010 there was no official documented way to programmatically use the built-in ULS service (Unified Logging Service) to log own custom messages. There are still solutions available on the internet that can be used, but SharePoint 2010 now supports full-blown logging service support.</p>
<p>To log a message to the SharePoint log files just call the WriteTrace method of the SPDiagnosticsService class:</p>
<div style="display:inline;float:none;margin:0;padding:0;" id="scid:f32c3428-b7e9-4f15-a8ea-c502c7ff2e88:0da8d9ad-0586-4777-b3db-212730485931" class="wlWriterEditableSmartContent">
<pre class="brush: c#;">SPDiagnosticsService.Local.WriteTrace(0, new SPDiagnosticsCategory("My Category", TraceSeverity.Medium, EventSeverity.Information), TraceSeverity.Medium, "My log message");
</pre>
</div>
<p>The problem with this technique is that the log entry does not contain any category information, instead SharePoint uses the value &quot;Unknown&quot;:</p>
<p><a href="http://jbaurle.files.wordpress.com/2011/01/image.png"><img style="background-image:none;padding-left:0;padding-right:0;display:inline;padding-top:0;border-width:0;" title="image" border="0" alt="image" src="http://jbaurle.files.wordpress.com/2011/01/image_thumb.png?w=909&#038;h=40" width="909" height="40" /></a></p>
<p>Of course, that does not matter if someone develops small solutions. Developing custom solutions you may want to implement an own logging service with custom categories and UI integration within the Central Administration (CA) of SharePoint 2010.</p>
<p>This article shows how to develop a custom logging service that integrates with the Diagnostic Logging UI of the Central Administration:</p>
<p><a href="http://jbaurle.files.wordpress.com/2011/01/image1.png"><img style="background-image:none;padding-left:0;padding-right:0;display:inline;padding-top:0;border-width:0;" title="image" border="0" alt="image" src="http://jbaurle.files.wordpress.com/2011/01/image_thumb1.png?w=549&#038;h=399" width="549" height="399" /></a></p>
<p><b>Custom Logging Service</b></p>
<p>A custom logging service must inherit from the SPDiagnosticsServiceBase class. This is the base class for diagnostic services in SharePoint and it offers the option to log messages to log files via ULS and to the Windows Event Log. By overriding the ProvideAreas method the service provides information about diagnostic areas, categories and logging levels. A diagnostic area is a logical container of one or more categories.</p>
<p>The sample service defines one diagnostic area and one category (used by application pages) for this area:</p>
<div style="display:inline;float:none;margin:0;padding:0;" id="scid:f32c3428-b7e9-4f15-a8ea-c502c7ff2e88:85f8b1d4-2ffa-4cd0-8e29-6d4be880f804" class="wlWriterEditableSmartContent">
<pre class="brush: c#;">[Guid("D64DEDE4-3D1D-42CC-AF40-DB09F0DFA309")]
public class LoggingService : SPDiagnosticsServiceBase
{
  public static class Categories
  {
    public static string ApplicationPages = "Application Pages";
  }

  public static LoggingService Local
  {
    get { return SPFarm.Local.Services.GetValue(DefaultName); }
  }

  public static string DefaultName
  {
    get { return "Parago Logging Service"; }
  }

  public static string AreaName
  {
    get { return "Parago"; }
  }

  protected override IEnumerable ProvideAreas()
  {
    List areas = new List
    {
      new SPDiagnosticsArea(AreaName, 0, 0, false, new List
      {
        new SPDiagnosticsCategory(Categories.ApplicationPages, null, TraceSeverity.Medium,
              EventSeverity.Information, 0, 0, false, true)
      })
    };

    return areas;
  }

  // . . .

}
</pre>
</div>
<p>The area name as well as the category names will be also shown in the Diagnostic Logging UI of the CA. It is also possible to define a resource DLL to localize the names. </p>
<p>The service will offer the two static methods WriteTrace and WriteEvent. WriteTrace writes the log message to the SharePoint log files, usually saved in the SharePoint folder <i>C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\LOGS</i>. </p>
<p>The WriteEvent writes the log message to the Windows Event Log. The event source is called like the AreaName and later on created within the FeatureReceiver:</p>
<div style="display:inline;float:none;margin:0;padding:0;" id="scid:f32c3428-b7e9-4f15-a8ea-c502c7ff2e88:aa3349d6-6085-48ed-9b1c-9560e3a303e5" class="wlWriterEditableSmartContent">
<pre class="brush: c#;">[Guid("D64DEDE4-3D1D-42CC-AF40-DB09F0DFA309")]
public class LoggingService : SPDiagnosticsServiceBase
{

  ...

  public static void WriteTrace(string categoryName, TraceSeverity traceSeverity,
    string message)
  {
    if(string.IsNullOrEmpty(message))
      return;

    try
    {
      LoggingService service = Local;

      if(service != null)
      {
        SPDiagnosticsCategory category = service.Areas[AreaName].Categories[categoryName];
        service.WriteTrace(1, category, traceSeverity, message);
      }
    }
    catch { }
  }

  public static void WriteEvent(string categoryName, EventSeverity eventSeverity,
    string message)
  {
    if(string.IsNullOrEmpty(message))
      return;

    try
    {
      LoggingService service = Local;

      if(service != null)
      {
        SPDiagnosticsCategory category = service.Areas[AreaName].Categories[categoryName];
        service.WriteEvent(1, category, eventSeverity, message);
      }
    }
    catch { }
  }
}</pre>
</div>
<p>The usage of the new custom logging service is quite simple: </p>
<p>&#160;</p>
<div style="display:inline;float:none;margin:0;padding:0;" id="scid:f32c3428-b7e9-4f15-a8ea-c502c7ff2e88:f91aa421-e99b-4430-814d-7a5160d59f4f" class="wlWriterEditableSmartContent">
<pre class="brush: c#;">// ULS Logging
LoggingService.WriteTrace(LoggingService.Categories.ApplicationPages,
  TraceSeverity.Medium, "...");

// Windows Event Log
LoggingService.WriteEvent(LoggingService.Categories.ApplicationPages,
  EventSeverity.Information, "...");
</pre>
</div>
<p>Next, we need to register it with SharePoint. </p>
<p><b>Service Registration</b> </p>
<p>The custom logging service must be registered with SharePoint 2010 to show up in the Diagnostic Logging UI of the CA. The event sources also must be created on each server of the SharePoint farm. These two registration steps can be bundle within the FeatureActivated override method of the FeatureReceiver.</p>
<div style="display:inline;float:none;margin:0;padding:0;" id="scid:f32c3428-b7e9-4f15-a8ea-c502c7ff2e88:5fb08e5e-0137-426c-9ae8-03e874a9cbb1" class="wlWriterEditableSmartContent">
<pre class="brush: c#;">[Guid("50CA5F69-381F-4C2A-BE6C-F28219AFF20C")]
public class FeatureEventReceiver : SPFeatureReceiver
{
  const string EventLogApplicationRegistryKeyPath =
    @"SYSTEM\CurrentControlSet\services\eventlog\Application";

  public override void FeatureActivated(SPFeatureReceiverProperties properties)
  {
    RegisterLoggingService(properties);
  } 

  public override void FeatureDeactivating(SPFeatureReceiverProperties properties)
  {
    UnRegisterLoggingService(properties);
  }

  static void RegisterLoggingService(SPFeatureReceiverProperties properties)
  {
    SPFarm farm = properties.Definition.Farm;

    if(farm != null)
    {
      LoggingService service = LoggingService.Local;

      if(service == null)
      {
        service = new LoggingService();
        service.Update();

        if(service.Status != SPObjectStatus.Online)
          service.Provision();
      }

      foreach(SPServer server in farm.Servers)
      {
        RegistryKey baseKey = RegistryKey.OpenRemoteBaseKey(RegistryHive.LocalMachine,
                                server.Address);

        if(baseKey != null)
        {
          RegistryKey eventLogKey = baseKey.OpenSubKey(EventLogApplicationRegistryKeyPath,
                                      true);

          if(eventLogKey != null)
          {
            RegistryKey loggingServiceKey = eventLogKey.OpenSubKey(LoggingService.AreaName);

            if(loggingServiceKey == null)
            {
              loggingServiceKey = eventLogKey.CreateSubKey(LoggingService.AreaName,
                                   RegistryKeyPermissionCheck.ReadWriteSubTree);
              loggingServiceKey.SetValue("EventMessageFile",
                @"C:\Windows\Microsoft.NET\Framework\v2.0.50727\EventLogMessages.dll",
                RegistryValueKind.String);
            }
          }
        }
      }
    }
  }

  static void UnRegisterLoggingService(SPFeatureReceiverProperties properties)
  {
    SPFarm farm = properties.Definition.Farm;

    if(farm != null)
    {
      LoggingService service = LoggingService.Local;

      if(service != null)
        service.Delete();

      foreach(SPServer server in farm.Servers)
      {
        RegistryKey baseKey = RegistryKey.OpenRemoteBaseKey(RegistryHive.LocalMachine,
                                server.Address);

        if(baseKey != null)
        {
          RegistryKey eventLogKey = baseKey.OpenSubKey(EventLogApplicationRegistryKeyPath,
                                      true);

          if(eventLogKey != null)
          {
            RegistryKey loggingServiceKey = eventLogKey.OpenSubKey(LoggingService.AreaName);

            if(loggingServiceKey != null)
              eventLogKey.DeleteSubKey(LoggingService.AreaName);
          }
        }
      }
    }
  }
}</pre>
</div>
<p>The FeatureActivated override is calling the RegisterLoggingService helper method to register with the SharePoint system if the service is not already available. Since one of the base classes of LoggingService is the SPService class which provides an Update and Provision method, we can register the new service farm-wide. </p>
<p>The second step is to create a new Windows Event Log source. Therefore we have to go through the collection of SharePoint farm servers and remotely add the new source by generating registry entries on each server. </p>
<p>To unregister we redo the registration steps by overriding FeatureDeactivating method of the FeatureReceiver class. The UnRegisterLoggingService method then deletes the service and removes all registry keys on all servers in the SharePoint farm. </p>
<p>The sample solution also created an application page to test the logging service. The source code is available as download. </p>
<p><a href="http://jbaurle.files.wordpress.com/2011/01/image2.png"><img style="background-image:none;padding-left:0;padding-right:0;display:inline;padding-top:0;border-width:0;" title="image" border="0" alt="image" src="http://jbaurle.files.wordpress.com/2011/01/image_thumb2.png?w=613&#038;h=200" width="613" height="200" /></a> </p>
<p>Enter a test message and press the Log button. The message will be logged to the Windows Event Log: </p>
<p>And to the SharePoint log files: </p>
<p><a href="http://jbaurle.files.wordpress.com/2011/01/image3.png"><img style="background-image:none;padding-left:0;padding-right:0;display:inline;padding-top:0;border-width:0;" title="image" border="0" alt="image" src="http://jbaurle.files.wordpress.com/2011/01/image_thumb3.png?w=613&#038;h=46" width="613" height="46" /></a> </p>
<p>That’s it. </p>
<p><a href="http://content.parago.de/samples/SP2010Logging.zip">Download Source Code</a> | <a href="http://content.parago.de/articles/SP2010Logging/HowToImplementACustomSharePoint2010LoggingService.pdf">Download PDF Version</a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/jbaurle.wordpress.com/277/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/jbaurle.wordpress.com/277/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/jbaurle.wordpress.com/277/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/jbaurle.wordpress.com/277/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/jbaurle.wordpress.com/277/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/jbaurle.wordpress.com/277/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/jbaurle.wordpress.com/277/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/jbaurle.wordpress.com/277/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/jbaurle.wordpress.com/277/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/jbaurle.wordpress.com/277/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/jbaurle.wordpress.com/277/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/jbaurle.wordpress.com/277/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/jbaurle.wordpress.com/277/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/jbaurle.wordpress.com/277/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jbaurle.wordpress.com&amp;blog=1409398&amp;post=277&amp;subd=jbaurle&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://jbaurle.wordpress.com/2011/01/16/how-to-implement-a-custom-sharepoint-2010-logging-service-for-uls-and-windows-event-log/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/1fbb1d3d9999f985eccdd0a4b2a6e14c?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">jbaurle</media:title>
		</media:content>

		<media:content url="http://jbaurle.files.wordpress.com/2011/01/image_thumb.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>

		<media:content url="http://jbaurle.files.wordpress.com/2011/01/image_thumb1.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>

		<media:content url="http://jbaurle.files.wordpress.com/2011/01/image_thumb2.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>

		<media:content url="http://jbaurle.files.wordpress.com/2011/01/image_thumb3.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>
	</item>
		<item>
		<title>New article about integrating SAP business data in Silverlight 4 clients using WCF RIA Services and LINQ to SAP</title>
		<link>http://jbaurle.wordpress.com/2010/11/17/new-article-about-integrating-sap-business-data-in-silverlight-4-clients-using-wcf-ria-services-and-linq-to-sap/</link>
		<comments>http://jbaurle.wordpress.com/2010/11/17/new-article-about-integrating-sap-business-data-in-silverlight-4-clients-using-wcf-ria-services-and-linq-to-sap/#comments</comments>
		<pubDate>Wed, 17 Nov 2010 13:33:08 +0000</pubDate>
		<dc:creator>Jürgen Bäurle</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[SAP]]></category>
		<category><![CDATA[Silverlight]]></category>
		<category><![CDATA[.NET 4]]></category>
		<category><![CDATA[.NET Integration]]></category>
		<category><![CDATA[LINQ]]></category>
		<category><![CDATA[LINQ to SAP]]></category>
		<category><![CDATA[SAP R/3]]></category>
		<category><![CDATA[Silverlight 4]]></category>
		<category><![CDATA[Theobald Softwrae]]></category>
		<category><![CDATA[WCF]]></category>
		<category><![CDATA[WCF RIA Services]]></category>

		<guid isPermaLink="false">https://jbaurle.wordpress.com/2010/11/17/new-article-about-integrating-sap-business-data-in-silverlight-4-clients-using-wcf-ria-services-and-linq-to-sap/</guid>
		<description><![CDATA[I wrote a new article about SAP and Silverlight on CodeProject.com (How To Access SAP Business Data From Silverlight 4 Clients Using WCF RIA Services And LINQ to SAP). This article describes how to access and integrate SAP customer data in Silverlight using WCF RIA Services and LINQ to SAP (ERPConnect.net from Theobald Software). The [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jbaurle.wordpress.com&amp;blog=1409398&amp;post=259&amp;subd=jbaurle&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I wrote a new article about SAP and Silverlight on <a href="http://www.codeproject.com/KB/silverlight/SAP2Silverlight.aspx" target="_blank">CodeProject.com</a> (How To Access SAP Business Data From Silverlight 4 Clients Using WCF RIA Services And LINQ to SAP).</p>
<p>This article describes how to access and integrate SAP customer data in Silverlight using WCF RIA Services and LINQ to SAP (ERPConnect.net from Theobald Software).</p>
<p>The article is also available as <a href="http://content.parago.de/articles/SAP2Silverlight/HowToAccessSAPBusinessDataFromSilverlight4ClientsUsingWCFRIAServices.pdf" target="_blank">PDF file at the Parago website</a>.</p>
<p>Feel free to send me your feedback.   </p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/jbaurle.wordpress.com/259/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/jbaurle.wordpress.com/259/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/jbaurle.wordpress.com/259/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/jbaurle.wordpress.com/259/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/jbaurle.wordpress.com/259/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/jbaurle.wordpress.com/259/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/jbaurle.wordpress.com/259/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/jbaurle.wordpress.com/259/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/jbaurle.wordpress.com/259/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/jbaurle.wordpress.com/259/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/jbaurle.wordpress.com/259/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/jbaurle.wordpress.com/259/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/jbaurle.wordpress.com/259/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/jbaurle.wordpress.com/259/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jbaurle.wordpress.com&amp;blog=1409398&amp;post=259&amp;subd=jbaurle&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://jbaurle.wordpress.com/2010/11/17/new-article-about-integrating-sap-business-data-in-silverlight-4-clients-using-wcf-ria-services-and-linq-to-sap/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/1fbb1d3d9999f985eccdd0a4b2a6e14c?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">jbaurle</media:title>
		</media:content>
	</item>
		<item>
		<title>Using A Custom Authentication Provider For The SharePoint 2010 BCS Administration Object Model</title>
		<link>http://jbaurle.wordpress.com/2010/11/15/using-a-custom-authentication-provider-for-the-sharepoint-2010-bcs-administration-object-model/</link>
		<comments>http://jbaurle.wordpress.com/2010/11/15/using-a-custom-authentication-provider-for-the-sharepoint-2010-bcs-administration-object-model/#comments</comments>
		<pubDate>Mon, 15 Nov 2010 07:45:39 +0000</pubDate>
		<dc:creator>Jürgen Bäurle</dc:creator>
				<category><![CDATA[SharePoint]]></category>
		<category><![CDATA[Authentication Provider]]></category>
		<category><![CDATA[BCS]]></category>
		<category><![CDATA[Business Connectivity Services]]></category>
		<category><![CDATA[SharePoint 2010]]></category>
		<category><![CDATA[SP2010]]></category>

		<guid isPermaLink="false">http://jbaurle.wordpress.com/?p=245</guid>
		<description><![CDATA[The SharePoint 2010 Business Connectivity Services (BCS) are providing an Administration Object Model to manage all kind of BCS objects. You can use the an Administration Object Model to programmatically create BDC models, LOB system and instances, Entities and Methods. The Microsoft SharePoint Designer is using the object model itself to let you generate External [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jbaurle.wordpress.com&amp;blog=1409398&amp;post=245&amp;subd=jbaurle&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>The SharePoint 2010 Business Connectivity Services (BCS) are providing an Administration Object Model to manage all kind of BCS objects. You can use the an Administration Object Model to programmatically create BDC models, LOB system and instances, Entities and Methods. The Microsoft SharePoint Designer is using the object model itself to let you generate External Content Types (ECT).</p>
<p>The sample code is this blog entry is a WPF client application which will read all BDC model names and display them in a ListView control. The application allows the user to enter credentials other than the current Windows user:</p>
<p><img alt="" src="http://jbaurle.files.wordpress.com/2010/11/111510_0745_usingacusto1.png?w=604" /></p>
<p>The starting point to access the BCS data is the <em>AdministrationMetadataCatalog</em> class. This class is part of the <em>Microsoft.SharePoint.BusinessData.Administration.Client.dll </em>library and namespace. You also need a reference to the <em>Microsoft.BusinessData.dll</em> library.</p>
<p>In order to create an instance of the AdministrationMetadataCatalog class with custom credentials we have to call the GetCatalog method. We need to pass a custom authentication provider as parameter to GetCatalog. A custom authentication provider is a class which implements the <em>ILobiAuthenticationProvider</em> interface. The interface is quite simple, it just asks you to return the user ID (including the domain name) and the according password.</p>
<p>Here the code of your custom authentication provider:</p>
<pre>
<pre class="brush: csharp;">
internal class SharePointConnection : ILobiAuthenticationProvider
{
    // . . .

    public SharePointConnection(string userId, string password)
    {
        UserId = userId;
        Password = password;
    }

    public AuthenticationScheme GetAuthenticationScheme(string server, string serverUrl)
    {
        return AuthenticationScheme.RunAs;
    } 

    public string GetCookie(string server, string serverUrl)
    {
        return &quot;BCSCustomAuthenticationProvider&quot;;
    }

    public string GetUserId(string server, string serverUrl)
    {
        return UserId;
    }

    public string GetPassword(string server, string serverUrl)
    {
        return Password;
    }
}
</pre>
</pre>
<p>Here the sample on how to use the provider: </p>
<pre>
<pre class="brush: csharp;">

// Create instance of custom authentication provider
SharePointConnection spc = new SharePointConnection(UserIdText.Text, PasswordText.Text); 

// Create catalog instance using the custom authentication provider
AdministrationMetadataCatalog catalog = AdministrationMetadataCatalog.GetCatalog(SiteURLText.Text, spc);

ModelsListView.ItemsSource = catalog.GetModels(&quot;*&quot;).Select(m =&gt; m.Name); 
</pre>
</pre>
<p><strong>Important</strong>: If you create your own WPF application using the BCS Administration Object Model and reference the Microsoft.SharePoint.BusinessData.Administration.Client.dll library, you need to set the Platform Target to &quot;Any CPU&quot; in the application settings page, otherwise the project will not compile.</p>
<p><a href="http://content.parago.de/samples/BCSCustomAuthenticationProvider.zip">Download Source-Code</a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/jbaurle.wordpress.com/245/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/jbaurle.wordpress.com/245/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/jbaurle.wordpress.com/245/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/jbaurle.wordpress.com/245/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/jbaurle.wordpress.com/245/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/jbaurle.wordpress.com/245/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/jbaurle.wordpress.com/245/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/jbaurle.wordpress.com/245/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/jbaurle.wordpress.com/245/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/jbaurle.wordpress.com/245/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/jbaurle.wordpress.com/245/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/jbaurle.wordpress.com/245/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/jbaurle.wordpress.com/245/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/jbaurle.wordpress.com/245/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jbaurle.wordpress.com&amp;blog=1409398&amp;post=245&amp;subd=jbaurle&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://jbaurle.wordpress.com/2010/11/15/using-a-custom-authentication-provider-for-the-sharepoint-2010-bcs-administration-object-model/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/1fbb1d3d9999f985eccdd0a4b2a6e14c?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">jbaurle</media:title>
		</media:content>

		<media:content url="http://jbaurle.files.wordpress.com/2010/11/111510_0745_usingacusto1.png" medium="image" />
	</item>
		<item>
		<title>New article about integrating SAP data into SharePoint 2010</title>
		<link>http://jbaurle.wordpress.com/2010/08/16/new-article-about-integrating-sap-data-into-sharepoint-2010/</link>
		<comments>http://jbaurle.wordpress.com/2010/08/16/new-article-about-integrating-sap-data-into-sharepoint-2010/#comments</comments>
		<pubDate>Mon, 16 Aug 2010 15:38:48 +0000</pubDate>
		<dc:creator>Jürgen Bäurle</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[SAP]]></category>
		<category><![CDATA[SharePoint]]></category>
		<category><![CDATA[BCS]]></category>
		<category><![CDATA[Business Connectivity Services]]></category>
		<category><![CDATA[LINQ]]></category>
		<category><![CDATA[LINQ to ERP]]></category>
		<category><![CDATA[LINQ to SAP]]></category>
		<category><![CDATA[SAP and .NET]]></category>
		<category><![CDATA[SAP integration]]></category>
		<category><![CDATA[SharePoint 2010]]></category>

		<guid isPermaLink="false">http://jbaurle.wordpress.com/?p=98</guid>
		<description><![CDATA[I wrote a new article about SharePoint 2010, SAP and BCS (Business Connectivity Services). I have published this article and a demo project with source code on Codeproject: How To Integrate SAP Business Data Into SharePoint 2010 Using Business Connectivity Services And LINQ to SAP A PDF version of the article can be downloaded from [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jbaurle.wordpress.com&amp;blog=1409398&amp;post=98&amp;subd=jbaurle&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I wrote a new article about SharePoint 2010, SAP and BCS (Business Connectivity Services). I have published this article and a demo project with source code on Codeproject:
</p>
<p><a href="http://www.codeproject.com/KB/sharepoint/SP2010SAPToBCS.aspx" target="_blank">How To Integrate SAP Business Data Into SharePoint 2010 Using Business Connectivity Services And LINQ to SAP</a>
	</p>
<p>A PDF version of the article can be downloaded from my <a href="http://content.parago.de/jarticles/SP2010ERPConnectToBCS/HowToIntegrateSAPBusinessDataIntoSharePoint2010UsingBusinessConnectivityServicesAndLINQtoSAP.pdf" target="_blank">Homepage</a>.
</p>
<p>Feel free to send me your feedback.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/jbaurle.wordpress.com/98/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/jbaurle.wordpress.com/98/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/jbaurle.wordpress.com/98/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/jbaurle.wordpress.com/98/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/jbaurle.wordpress.com/98/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/jbaurle.wordpress.com/98/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/jbaurle.wordpress.com/98/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/jbaurle.wordpress.com/98/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/jbaurle.wordpress.com/98/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/jbaurle.wordpress.com/98/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/jbaurle.wordpress.com/98/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/jbaurle.wordpress.com/98/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/jbaurle.wordpress.com/98/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/jbaurle.wordpress.com/98/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jbaurle.wordpress.com&amp;blog=1409398&amp;post=98&amp;subd=jbaurle&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://jbaurle.wordpress.com/2010/08/16/new-article-about-integrating-sap-data-into-sharepoint-2010/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/1fbb1d3d9999f985eccdd0a4b2a6e14c?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">jbaurle</media:title>
		</media:content>
	</item>
		<item>
		<title>New article about implementing a SharePoint entity repository</title>
		<link>http://jbaurle.wordpress.com/2010/08/08/new-article-about-implementing-a-sharepoint-entity-repository/</link>
		<comments>http://jbaurle.wordpress.com/2010/08/08/new-article-about-implementing-a-sharepoint-entity-repository/#comments</comments>
		<pubDate>Sun, 08 Aug 2010 20:21:54 +0000</pubDate>
		<dc:creator>Jürgen Bäurle</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[SAP]]></category>
		<category><![CDATA[SharePoint]]></category>
		<category><![CDATA[BAL]]></category>
		<category><![CDATA[business logic]]></category>
		<category><![CDATA[DAL]]></category>
		<category><![CDATA[data access logic]]></category>
		<category><![CDATA[entity]]></category>
		<category><![CDATA[repository]]></category>
		<category><![CDATA[SAP and .NET]]></category>
		<category><![CDATA[SAP integration]]></category>
		<category><![CDATA[SharePoint 2010]]></category>
		<category><![CDATA[T4 engine]]></category>
		<category><![CDATA[T4 template]]></category>
		<category><![CDATA[templating]]></category>

		<guid isPermaLink="false">http://jbaurle.wordpress.com/?p=94</guid>
		<description><![CDATA[I wrote a new article about SharePoint on CodeProject.com (How To Implement A Generic Entity List Repository And Business Logic For SharePoint 2010 Using The T4 Templating Engine). This article describes how to implement a generic, extensible entity list repository and business logic for SharePoint 2010 using the T4 templating engine (Text Template Transformation Toolkit). [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jbaurle.wordpress.com&amp;blog=1409398&amp;post=94&amp;subd=jbaurle&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I wrote a new article about SharePoint on <a href="http://www.codeproject.com/KB/sharepoint/SP2010T4EntityRepository.aspx" target="_blank">CodeProject.com</a> (How To Implement A Generic Entity List Repository And Business Logic For SharePoint 2010 Using The T4 Templating Engine).
</p>
<p>This article describes how to implement a generic, extensible entity list repository and business logic for SharePoint 2010 using the T4 templating engine (Text Template Transformation Toolkit).
</p>
<p>The article is also available as PDF file at the Parago <a href="http://www.parago.de/jbaurle" target="_blank">website</a>.
</p>
<p>Feel free to send me your feedback.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/jbaurle.wordpress.com/94/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/jbaurle.wordpress.com/94/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/jbaurle.wordpress.com/94/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/jbaurle.wordpress.com/94/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/jbaurle.wordpress.com/94/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/jbaurle.wordpress.com/94/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/jbaurle.wordpress.com/94/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/jbaurle.wordpress.com/94/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/jbaurle.wordpress.com/94/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/jbaurle.wordpress.com/94/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/jbaurle.wordpress.com/94/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/jbaurle.wordpress.com/94/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/jbaurle.wordpress.com/94/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/jbaurle.wordpress.com/94/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jbaurle.wordpress.com&amp;blog=1409398&amp;post=94&amp;subd=jbaurle&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://jbaurle.wordpress.com/2010/08/08/new-article-about-implementing-a-sharepoint-entity-repository/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/1fbb1d3d9999f985eccdd0a4b2a6e14c?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">jbaurle</media:title>
		</media:content>
	</item>
		<item>
		<title>Online Mind Mapping Tool In Silverlight</title>
		<link>http://jbaurle.wordpress.com/2010/03/02/online-mind-mapping-tool-in-silverlight/</link>
		<comments>http://jbaurle.wordpress.com/2010/03/02/online-mind-mapping-tool-in-silverlight/#comments</comments>
		<pubDate>Tue, 02 Mar 2010 21:37:32 +0000</pubDate>
		<dc:creator>Jürgen Bäurle</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Silverlight]]></category>
		<category><![CDATA[mind mapping]]></category>
		<category><![CDATA[mindmap]]></category>

		<guid isPermaLink="false">http://jbaurle.wordpress.com/?p=86</guid>
		<description><![CDATA[Last year I&#8217;ve developed a prototype of an Online Mind Mapping Tool in Silverlight. Finally I&#8217;ve published a still very buggy version of the tool at http://www.mindbak.com. Just try it out and give me feedback.<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jbaurle.wordpress.com&amp;blog=1409398&amp;post=86&amp;subd=jbaurle&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Last year I&#8217;ve developed a prototype of an Online Mind Mapping Tool in Silverlight.
</p>
<p>Finally I&#8217;ve published a still very buggy version of the tool at <a href="http://www.mindbak.com">http://www.mindbak.com</a>. Just try it out and give me feedback.
</p>
<p><img src="http://jbaurle.files.wordpress.com/2010/08/030210_2337_prototypeon1.png?w=604" alt="" /></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/jbaurle.wordpress.com/86/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/jbaurle.wordpress.com/86/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/jbaurle.wordpress.com/86/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/jbaurle.wordpress.com/86/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/jbaurle.wordpress.com/86/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/jbaurle.wordpress.com/86/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/jbaurle.wordpress.com/86/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/jbaurle.wordpress.com/86/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/jbaurle.wordpress.com/86/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/jbaurle.wordpress.com/86/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/jbaurle.wordpress.com/86/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/jbaurle.wordpress.com/86/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/jbaurle.wordpress.com/86/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/jbaurle.wordpress.com/86/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=jbaurle.wordpress.com&amp;blog=1409398&amp;post=86&amp;subd=jbaurle&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://jbaurle.wordpress.com/2010/03/02/online-mind-mapping-tool-in-silverlight/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/1fbb1d3d9999f985eccdd0a4b2a6e14c?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">jbaurle</media:title>
		</media:content>

		<media:content url="http://jbaurle.files.wordpress.com/2010/08/030210_2337_prototypeon1.png" medium="image" />
	</item>
	</channel>
</rss>
