<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:pingback="http://madskills.com/public/xml/rss/module/pingback/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:dc="http://purl.org/dc/elements/1.1/" version="2.0">
  <channel>
    <title>The Efficient Coder</title>
    <link>http://www.efficientcoder.net/</link>
    <description>There has got to be a better way of communicating with our computers!</description>
    <language>en-us</language>
    <copyright>Kevin D. Wolf</copyright>
    <lastBuildDate>Fri, 09 Feb 2007 15:44:00 GMT</lastBuildDate>
    <generator>newtelligence dasBlog 1.8.5223.2</generator>
    <managingEditor>kevinw@software-logistics.com</managingEditor>
    <webMaster>kevinw@software-logistics.com</webMaster>
    <item>
      <trackback:ping>http://www.efficientcoder.net/Trackback.aspx?guid=455171ce-98b9-4782-8381-470dd7e97b48</trackback:ping>
      <pingback:server>http://www.efficientcoder.net/pingback.aspx</pingback:server>
      <pingback:target>http://www.efficientcoder.net/PermaLink,guid,455171ce-98b9-4782-8381-470dd7e97b48.aspx</pingback:target>
      <dc:creator>kevinw@software-logistics.com (Kevin D. Wolf)</dc:creator>
      <wfw:comment>http://www.efficientcoder.net/CommentView,guid,455171ce-98b9-4782-8381-470dd7e97b48.aspx</wfw:comment>
      <wfw:commentRss>http://www.efficientcoder.net/SyndicationService.asmx/GetEntryCommentsRss?guid=455171ce-98b9-4782-8381-470dd7e97b48</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <h4>Exploring SharePoint 2007 with PowerShell
   </h4>
        <p>
      The more I work with SP2007, the more I get pumped about the technology.  Although
      there is a lot you can do right out-of-the-box, the programming model behind this
      really allows it to be a great framework for any development platform.
   </p>
        <p>
      To get started programming, you probably want to get an idea of how the Object Model
      works, a real simple way to do this is with PowerShell.  I have an SP2007 dev
      server I setup that I installed <a href="http://www.microsoft.com/windowsserver2003/technologies/management/powershell/default.mspx">PowerShell</a> &amp; <a href="http://www.powershellide.com">PowerShell
      IDE </a>on.  Once you do that, just get a hold of the SP2007 SDK documentation,
      this will give you an idea of the structure of the Object Model then start playing! 
      The following screen shot should be enough to get you going:
   </p>
        <p>
          <img src="http://www.efficientcoder.net/content/binary/SHarePointPowerShell.png" border="0" />
        </p>
        <p>
      Obviously this same concept would work to exercise any object model!
   </p>
        <p>
      Enjoy!
   </p>
        <p>
      - ec
   </p>
        <p>
       
   </p>
        <img width="0" height="0" src="http://www.efficientcoder.net/aggbug.ashx?id=455171ce-98b9-4782-8381-470dd7e97b48" />
      </body>
      <title>Exploring SharePoint 2007 with PowerShell</title>
      <guid>http://www.efficientcoder.net/PermaLink,guid,455171ce-98b9-4782-8381-470dd7e97b48.aspx</guid>
      <link>http://www.efficientcoder.net/PermaLink,guid,455171ce-98b9-4782-8381-470dd7e97b48.aspx</link>
      <pubDate>Fri, 09 Feb 2007 15:44:00 GMT</pubDate>
      <description>&lt;h4&gt;Exploring SharePoint 2007 with PowerShell
&lt;/h4&gt;
&lt;p&gt;
   The more I work with SP2007, the more I get pumped about the technology.&amp;nbsp; Although
   there is a lot you can do right out-of-the-box, the programming model behind this
   really allows it to be a great framework for any development platform.
&lt;/p&gt;
&lt;p&gt;
   To get started programming, you probably want to get an idea of how the Object Model
   works, a real simple way to do this is with PowerShell.&amp;nbsp; I have an SP2007 dev
   server I setup that I installed &lt;a href="http://www.microsoft.com/windowsserver2003/technologies/management/powershell/default.mspx"&gt;PowerShell&lt;/a&gt; &amp;amp; &lt;a href="http://www.powershellide.com"&gt;PowerShell
   IDE &lt;/a&gt;on.&amp;nbsp; Once you do that, just get a hold of the SP2007 SDK documentation,
   this will&amp;nbsp;give you an idea of the structure of the Object Model then start playing!&amp;nbsp;
   The following screen shot should be enough to get you going:
&lt;/p&gt;
&lt;p&gt;
   &lt;img src="http://www.efficientcoder.net/content/binary/SHarePointPowerShell.png" border=0&gt;
&lt;/p&gt;
&lt;p&gt;
   Obviously this same concept would work to exercise any object model!
&lt;/p&gt;
&lt;p&gt;
   Enjoy!
&lt;/p&gt;
&lt;p&gt;
   - ec
&lt;/p&gt;
&lt;p&gt;
   &amp;nbsp;
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.efficientcoder.net/aggbug.ashx?id=455171ce-98b9-4782-8381-470dd7e97b48" /&gt;</description>
      <comments>http://www.efficientcoder.net/CommentView,guid,455171ce-98b9-4782-8381-470dd7e97b48.aspx</comments>
      <category>ASP.NET;PowerShell;SharePoint 2007</category>
    </item>
    <item>
      <trackback:ping>http://www.efficientcoder.net/Trackback.aspx?guid=17d566aa-8dd5-4743-a54d-e66dff060dd8</trackback:ping>
      <pingback:server>http://www.efficientcoder.net/pingback.aspx</pingback:server>
      <pingback:target>http://www.efficientcoder.net/PermaLink,guid,17d566aa-8dd5-4743-a54d-e66dff060dd8.aspx</pingback:target>
      <dc:creator>kevinw@software-logistics.com (Kevin D. Wolf)</dc:creator>
      <wfw:comment>http://www.efficientcoder.net/CommentView,guid,17d566aa-8dd5-4743-a54d-e66dff060dd8.aspx</wfw:comment>
      <wfw:commentRss>http://www.efficientcoder.net/SyndicationService.asmx/GetEntryCommentsRss?guid=17d566aa-8dd5-4743-a54d-e66dff060dd8</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <h4>Custom WebParts in SharePoint 2007
   </h4>
        <p>
      Creating a custom WebPart in SharePoint 2007 isn't all that terribly difficult, just
      a few basic steps that may not be completely obvious...in addition if you want to
      deploy your WebPart on SP 2007 it may contain some additional resources such as gif's
      or java scripts.  Wouldn't it be nice if you could just deploy one assembly with
      everything you need?  Well that's possible so let's do that as well...
   </p>
        <ol>
          <li>
         To start out, just create a new VS.NET 2005 class library project and add a reference
         to "System.Web". 
      </li>
          <li>
         Go ahead and setup a reasonable sounding Assembly Name and Default NameSpace,
         these will be important when registering your component with Share Point 2007. 
      </li>
          <li>
         While your are changing your project settings, find the Signing Tab and make sure
         "Sign the assembly" is checked.  You will then need to go ahead and create a
         new KeyFile.  So far straight forward right? 
      </li>
          <li>
         Now let's add our web part, to do this simply add an class to your project. 
      </li>
          <li>
         The code in your web part should look something like <em>Not a example of good coding
         but that isn't the point </em>;-):</li>
        </ol>
        <font color="#0000ff" size="1">
          <p>
      using
   </p>
        </font>
        <font size="1">
          <font color="#000000"> System;<br /></font>
        </font>
        <font color="#0000ff" size="1">using</font>
        <font size="1">
          <font color="#000000"> System.Runtime.InteropServices;<br /></font>
        </font>
        <font color="#0000ff" size="1">using</font>
        <font size="1">
          <font color="#000000"> System.Web.UI;<br /></font>
        </font>
        <font color="#0000ff" size="1">using</font>
        <font size="1">
          <font color="#000000"> System.Web.UI.WebControls;<br /></font>
        </font>
        <font color="#0000ff" size="1">using</font>
        <font size="1">
          <font color="#000000"> System.Web.UI.WebControls.WebParts;<br /></font>
        </font>
        <font color="#0000ff" size="1">using</font>
        <font size="1">
          <font color="#000000"> System.Xml.Serialization;<br /></font>
        </font>
        <font color="#0000ff" size="1">using</font>
        <font size="1">
          <font color="#000000"> System.Reflection;<br /></font>
        </font>
        <font color="#0000ff" size="1">using</font>
        <font size="1">
          <font color="#000000"> System.Data;<br /></font>
        </font>
        <font color="#0000ff" size="1">using</font>
        <font size="1">
          <font color="#000000"> System.Data.SqlClient;<br /></font>
        </font>
        <font color="#0000ff" size="1">using</font>
        <font size="1">
          <font color="#000000"> System.ComponentModel;</font>
        </font>
        <font color="#0000ff" size="1">
          <p>
      namespace
   </p>
        </font>
        <font size="1">
          <font color="#000000"> SoftwareLogistics.SharePointTest<br /></font>{
   <p>
         [
   </p></font>
        <font color="#2b91af" size="1">Guid</font>
        <font size="1">(</font>
        <font color="#a31515" size="1">"72a24b71-f3a9-4fee-9272-4f3c27c87559"</font>
        <font size="1">)] <br />
      </font>
        <font color="#0000ff" size="1">public</font>
        <font size="1">
        </font>
        <font color="#0000ff" size="1">class</font>
        <font size="1">
        </font>
        <font color="#2b91af" size="1">SampleSP2007Part</font>
        <font size="1"> :
   System.Web.UI.WebControls.WebParts.</font>
        <font color="#2b91af" size="1">WebPart<br />
      </font>
        <font size="1">{<br />
         </font>
        <font size="1">System.Web.UI.WebControls.</font>
        <font color="#2b91af" size="1">DataGrid</font>
        <font size="1"> grdTime;<br /></font>
        <font color="#0000ff" size="1">
          <br />
         protected</font>
        <font size="1">
        </font>
        <font color="#0000ff" size="1">override</font>
        <font size="1">
        </font>
        <font color="#0000ff" size="1">void</font>
        <font size="1"> CreateChildControls()<br />
         {<br />
            </font>
        <font color="#2b91af" size="1">Image</font>
        <font size="1"> img
   = </font>
        <font color="#0000ff" size="1">new</font>
        <font size="1">
        </font>
        <font color="#2b91af" size="1">Image</font>
        <font size="1">();<br />
            </font>
        <font size="1">img.ImageUrl
   = Page.ClientScript.GetWebResourceUrl(</font>
        <font color="#0000ff" size="1">this</font>
        <font size="1">.GetType(), </font>
        <font color="#a31515" size="1">"SoftwareLogistics.SharePointTest.Images.Target.gif"</font>
        <font size="1">);
   <p>
               grdTime = 
   </p></font>
        <font color="#0000ff" size="1">new</font>
        <font size="1"> System.Web.UI.WebControls.</font>
        <font color="#2b91af" size="1">DataGrid</font>
        <font size="1">();<br />
            </font>
        <font color="#0000ff" size="1">string</font>
        <font size="1"> dsn
   = </font>
        <font color="#a31515" size="1">"server=??????;database=??????;user id=????;password=?????"</font>
        <font size="1">;<br /></font>
        <font size="1">
          <br />
            </font>
        <font color="#2b91af" size="1">SqlDataAdapter</font>
        <font size="1"> da
   = </font>
        <font color="#0000ff" size="1">new</font>
        <font size="1">
        </font>
        <font color="#2b91af" size="1">SqlDataAdapter</font>
        <font size="1">(</font>
        <font color="#a31515" size="1">"select
   top 5 * from usv_time_tracking order by start_date desc"</font>
        <font size="1">, </font>
        <font color="#0000ff" size="1">new</font>
        <font size="1">
        </font>
        <font color="#2b91af" size="1">SqlConnection</font>
        <font size="1">(dsn));<br />
            </font>
        <font color="#2b91af" size="1">DataTable</font>
        <font size="1"> tblTime
   = </font>
        <font color="#0000ff" size="1">new</font>
        <font size="1">
        </font>
        <font color="#2b91af" size="1">DataTable</font>
        <font size="1">(</font>
        <font color="#a31515" size="1">"My
   Time"</font>
        <font size="1">);</font>
        <p>
          <font size="1">         da.Fill(tblTime);<br />
               grdTime.DataSource = tblTime;<br />
               grdTime.DataBind();<br /></font>
          <font size="1">
            <br />
               Controls.Add(img);<br />
               Controls.Add(</font>
          <font color="#0000ff" size="1">new</font>
          <font size="1">
          </font>
          <font color="#2b91af" size="1">LiteralControl</font>
          <font size="1">(</font>
          <font color="#a31515" size="1">"&lt;br/&gt;"</font>
          <font size="1">));<br />
               Controls.Add(grdTime);
      </font>
        </p>
        <p>
          <font color="#0000ff" size="1">         base</font>
          <font size="1">.CreateChildControls();<br /></font>
          <font size="1">      }
      </font>
        </p>
        <p>
          <font color="#0000ff" size="1">      protected</font>
          <font size="1">
          </font>
          <font color="#0000ff" size="1">override</font>
          <font size="1">
          </font>
          <font color="#0000ff" size="1">void</font>
          <font size="1"> Render(</font>
          <font color="#2b91af" size="1">HtmlTextWriter</font>
          <font size="1"> writer)<br />
            {<br />
               writer.Write(</font>
          <font color="#a31515" size="1">"&lt;h4&gt;Hello
      World!&lt;/h4&gt;"</font>
          <font size="1">);<br />
               </font>
          <font color="#0000ff" size="1">base</font>
          <font size="1">.Render(writer);<br />
            }<br />
         }<br />
      }
      </font>
        </p>
        <p>
      Before installing this to SharePoint 2007, let's complete this section by talking
      about what we need to do to embed the resources with the assembly.
   </p>
        <ol>
          <li>
         Create an Image directory within your project and copy the Image there:<br /><img src="http://www.efficientcoder.net/content/binary/SLWebPartImageTree.bmp" border="0" /></li>
          <li>
         You can see that the name including the NameSpace is "SoftwareLogistics.SharePointTest.Images.Target.gif"
         (Case is important here) 
      </li>
          <li>
         Once you copied the image there you need to make sure you click on "Properties" and
         then set the Build Action to "Embedded Resource" for Target.gif, very important to
         do this... 
      </li>
          <li>
         Now open up your "AssemblyInfo.cs" file that is in the Properties folder of your project. 
         Add a line to it similar to 
         <br /><font size="1">[assembly: </font><font color="#2b91af" size="1">WebResource</font><font size="1">(</font><font color="#a31515" size="1">"SoftwareLogistics.SharePointTest.Images.Target.gif"</font><font size="1">,</font><font color="#a31515" size="1">"image/gif"</font><font size="1">)</font></li>
          <li>
            <p>
              <font size="1">
                <font size="2">You will also need to add <font color="#0000ff" size="1">using</font><font size="1"><font color="#000000"> System.Web.UI;</font></font> to
            the top of your AssemblyInfo.cs.</font>
              </font>
            </p>
          </li>
          <li>
            <p>
              <font size="1">
                <font size="2">Finally in the code you can set the url of the image
            as:<br /><font size="1">img.ImageUrl = Page.ClientScript.GetWebResourceUrl(<font color="#0000ff">this</font>.GetType(), <font color="#a31515">"SoftwareLogistics.SharePointTest.Images.Target.gif"</font>);</font></font>
              </font>
            </p>
          </li>
        </ol>
        <p>
          <font size="1">
            <font size="2">Now your assembly is ready to go all you need to do
      is turn that into and assembly and your are ready to incorporate it into your SharePoint
      2007 site, you can even us this as a WebPart or even a standard Server Control on
      any ASP.NET 2.0 site.</font>
          </font>
        </p>
        <p>
      To install the the component on the SharePoint2007 server you need to do the next
      couple of steps...
   </p>
        <ol>
          <li>
         First we need to get our component into the GAC so just drag it into the file pane
         for Windows\Assembly, you can see the my file here:<br /><img src="http://www.efficientcoder.net/content/binary/SLWebPartGAC.png" border="0" /></li>
          <li>
         Make a note of the Public Key Token, you will need that to register your part with
         SharePoint, you can also right mouse click on the assembly click on Properties
         and copy the Pulbic Key Token from there. 
      </li>
          <li>
         The final step to make it appear as a "potential" web part within SharePoint is to
         register the component in the Web.Config file.  So find Web.Config for the SharePoint
         instance you want this work with and open it in your favorite XML editor. 
      </li>
          <li>
         Find the section labeled "SafeControls" and add the following line (you can always
         just copy one of the existing lines and fill in your information.<br /><font face="Courier New"> &lt;SafeControl Assembly="SoftwareLogistics.SharePointTest,
         Version=1.1.0.0, Culture=neutral, PublicKeyToken=8220d66cd77f3b8d" Namespace="SoftwareLogistics.SharePointTest"
         TypeName="*" Safe="True" /&gt;</font></li>
        </ol>
        <p>
      At this point SharePoint knows about your WebPart, but you'll need to make it part
      of the Gallery so open up your SharePoint site and do these final steps
   </p>
        <ol>
          <li>
         Click on "Site Actions" and then "Site Settings" 
      </li>
          <li>
         Within the "Galleries" section click on "Web Parts" 
      </li>
          <li>
         Click on New, if all went well you should see the part you created within the list,
         if you don't see it there, go ahead and reset IIS. 
      </li>
          <li>
         Put a check mark next to your new web part and then click the "Populate Gallery" button.</li>
        </ol>
        <p>
      At this point your web part is ready to be included just like any other WebPart.
   </p>
        <p>
      Happy Coding!
   </p>
        <p>
      - ec
   </p>
        <img width="0" height="0" src="http://www.efficientcoder.net/aggbug.ashx?id=17d566aa-8dd5-4743-a54d-e66dff060dd8" />
      </body>
      <title>Custom WebParts in SharePoint 2007</title>
      <guid>http://www.efficientcoder.net/PermaLink,guid,17d566aa-8dd5-4743-a54d-e66dff060dd8.aspx</guid>
      <link>http://www.efficientcoder.net/PermaLink,guid,17d566aa-8dd5-4743-a54d-e66dff060dd8.aspx</link>
      <pubDate>Sun, 04 Feb 2007 18:32:43 GMT</pubDate>
      <description>&lt;h4&gt;Custom WebParts in SharePoint 2007
&lt;/h4&gt;
&lt;p&gt;
   Creating a custom WebPart in SharePoint 2007 isn't all that terribly difficult, just
   a few basic steps that may not be completely obvious...in addition if you want to
   deploy your WebPart on SP 2007 it may contain some additional resources such as gif's
   or java scripts.&amp;nbsp; Wouldn't it be nice if you could just deploy one assembly with
   everything you need?&amp;nbsp; Well that's possible so let's do that as well...
&lt;/p&gt;
&lt;ol&gt;
   &lt;li&gt;
      To start out, just create a new VS.NET 2005 class library project and add a reference
      to&amp;nbsp;"System.Web". 
   &lt;li&gt;
      Go ahead and setup a reasonable sounding Assembly Name and&amp;nbsp;Default NameSpace,
      these will be important when registering your component with Share Point 2007. 
   &lt;li&gt;
      While your are changing your project settings, find the Signing Tab and make sure
      "Sign the assembly" is checked.&amp;nbsp; You will then need to go ahead and create a
      new KeyFile.&amp;nbsp; So far straight forward right? 
   &lt;li&gt;
      Now let's add our web part, to do this simply add an class to your project. 
   &lt;li&gt;
      The code in your web part should look something like &lt;em&gt;Not a example of good coding
      but that isn't the point &lt;/em&gt;;-):&lt;/li&gt;
&lt;/ol&gt;
&lt;font color=#0000ff size=1&gt; 
&lt;p&gt;
   using
&lt;/font&gt;&lt;font size=1&gt;&lt;font color=#000000&gt; System;&lt;br&gt;
&lt;/font&gt;&lt;/font&gt;&lt;font color=#0000ff size=1&gt;using&lt;/font&gt;&lt;font size=1&gt;&lt;font color=#000000&gt; System.Runtime.InteropServices;&lt;br&gt;
&lt;/font&gt;&lt;/font&gt;&lt;font color=#0000ff size=1&gt;using&lt;/font&gt;&lt;font size=1&gt;&lt;font color=#000000&gt; System.Web.UI;&lt;br&gt;
&lt;/font&gt;&lt;/font&gt;&lt;font color=#0000ff size=1&gt;using&lt;/font&gt;&lt;font size=1&gt;&lt;font color=#000000&gt; System.Web.UI.WebControls;&lt;br&gt;
&lt;/font&gt;&lt;/font&gt;&lt;font color=#0000ff size=1&gt;using&lt;/font&gt;&lt;font size=1&gt;&lt;font color=#000000&gt; System.Web.UI.WebControls.WebParts;&lt;br&gt;
&lt;/font&gt;&lt;/font&gt;&lt;font color=#0000ff size=1&gt;using&lt;/font&gt;&lt;font size=1&gt;&lt;font color=#000000&gt; System.Xml.Serialization;&lt;br&gt;
&lt;/font&gt;&lt;/font&gt;&lt;font color=#0000ff size=1&gt;using&lt;/font&gt;&lt;font size=1&gt;&lt;font color=#000000&gt; System.Reflection;&lt;br&gt;
&lt;/font&gt;&lt;/font&gt;&lt;font color=#0000ff size=1&gt;using&lt;/font&gt;&lt;font size=1&gt;&lt;font color=#000000&gt; System.Data;&lt;br&gt;
&lt;/font&gt;&lt;/font&gt;&lt;font color=#0000ff size=1&gt;using&lt;/font&gt;&lt;font size=1&gt;&lt;font color=#000000&gt; System.Data.SqlClient;&lt;br&gt;
&lt;/font&gt;&lt;/font&gt;&lt;font color=#0000ff size=1&gt;using&lt;/font&gt;&lt;font size=1&gt;&lt;font color=#000000&gt; System.ComponentModel;&lt;/font&gt;&gt;
&lt;/font&gt;&lt;font color=#0000ff size=1&gt; 
&lt;p&gt;
   namespace
&lt;/font&gt;&lt;font size=1&gt;&lt;font color=#000000&gt; SoftwareLogistics.SharePointTest&lt;br&gt;
&lt;/font&gt;{&gt;
&lt;p&gt;
   &amp;nbsp;&amp;nbsp;&amp;nbsp;[
&lt;/font&gt;&lt;font color=#2b91af size=1&gt;Guid&lt;/font&gt;&lt;font size=1&gt;(&lt;/font&gt;&lt;font color=#a31515 size=1&gt;"72a24b71-f3a9-4fee-9272-4f3c27c87559"&lt;/font&gt;&lt;font size=1&gt;)]&amp;nbsp;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color=#0000ff size=1&gt;public&lt;/font&gt;&lt;font size=1&gt; &lt;/font&gt;&lt;font color=#0000ff size=1&gt;class&lt;/font&gt;&lt;font size=1&gt; &lt;/font&gt;&lt;font color=#2b91af size=1&gt;SampleSP2007Part&lt;/font&gt;&lt;font size=1&gt; :
System.Web.UI.WebControls.WebParts.&lt;/font&gt;&lt;font color=#2b91af size=1&gt;WebPart&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font size=1&gt;{&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font size=1&gt;System.Web.UI.WebControls.&lt;/font&gt;&lt;font color=#2b91af size=1&gt;DataGrid&lt;/font&gt;&lt;font size=1&gt; grdTime;&lt;br&gt;
&lt;/font&gt;&lt;font color=#0000ff size=1&gt;
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;protected&lt;/font&gt;&lt;font size=1&gt; &lt;/font&gt;&lt;font color=#0000ff size=1&gt;override&lt;/font&gt;&lt;font size=1&gt; &lt;/font&gt;&lt;font color=#0000ff size=1&gt;void&lt;/font&gt;&lt;font size=1&gt; CreateChildControls()&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color=#2b91af size=1&gt;Image&lt;/font&gt;&lt;font size=1&gt; img
= &lt;/font&gt;&lt;font color=#0000ff size=1&gt;new&lt;/font&gt;&lt;font size=1&gt; &lt;/font&gt;&lt;font color=#2b91af size=1&gt;Image&lt;/font&gt;&lt;font size=1&gt;();&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font size=1&gt;img.ImageUrl
= Page.ClientScript.GetWebResourceUrl(&lt;/font&gt;&lt;font color=#0000ff size=1&gt;this&lt;/font&gt;&lt;font size=1&gt;.GetType(), &lt;/font&gt;&lt;font color=#a31515 size=1&gt;"SoftwareLogistics.SharePointTest.Images.Target.gif"&lt;/font&gt;&lt;font size=1&gt;);&gt;
&lt;p&gt;
   &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;grdTime = 
&lt;/font&gt;&lt;font color=#0000ff size=1&gt;new&lt;/font&gt;&lt;font size=1&gt; System.Web.UI.WebControls.&lt;/font&gt;&lt;font color=#2b91af size=1&gt;DataGrid&lt;/font&gt;&lt;font size=1&gt;();&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color=#0000ff size=1&gt;string&lt;/font&gt;&lt;font size=1&gt; dsn
= &lt;/font&gt;&lt;font color=#a31515 size=1&gt;"server=??????;database=??????;user id=????;password=?????"&lt;/font&gt;&lt;font size=1&gt;;&lt;br&gt;
&lt;/font&gt;&lt;font size=1&gt;
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color=#2b91af size=1&gt;SqlDataAdapter&lt;/font&gt;&lt;font size=1&gt; da
= &lt;/font&gt;&lt;font color=#0000ff size=1&gt;new&lt;/font&gt;&lt;font size=1&gt; &lt;/font&gt;&lt;font color=#2b91af size=1&gt;SqlDataAdapter&lt;/font&gt;&lt;font size=1&gt;(&lt;/font&gt;&lt;font color=#a31515 size=1&gt;"select
top 5 * from usv_time_tracking order by start_date desc"&lt;/font&gt;&lt;font size=1&gt;, &lt;/font&gt;&lt;font color=#0000ff size=1&gt;new&lt;/font&gt;&lt;font size=1&gt; &lt;/font&gt;&lt;font color=#2b91af size=1&gt;SqlConnection&lt;/font&gt;&lt;font size=1&gt;(dsn));&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color=#2b91af size=1&gt;DataTable&lt;/font&gt;&lt;font size=1&gt; tblTime
= &lt;/font&gt;&lt;font color=#0000ff size=1&gt;new&lt;/font&gt;&lt;font size=1&gt; &lt;/font&gt;&lt;font color=#2b91af size=1&gt;DataTable&lt;/font&gt;&lt;font size=1&gt;(&lt;/font&gt;&lt;font color=#a31515 size=1&gt;"My
Time"&lt;/font&gt;&lt;font size=1&gt;);&lt;/font&gt;&gt;
&lt;p&gt;
   &lt;font size=1&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;da.Fill(tblTime);&lt;br&gt;
   &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;grdTime.DataSource = tblTime;&lt;br&gt;
   &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;grdTime.DataBind();&lt;br&gt;
   &lt;/font&gt;&lt;font size=1&gt;
   &lt;br&gt;
   &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Controls.Add(img);&lt;br&gt;
   &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Controls.Add(&lt;/font&gt;&lt;font color=#0000ff size=1&gt;new&lt;/font&gt;&lt;font size=1&gt; &lt;/font&gt;&lt;font color=#2b91af size=1&gt;LiteralControl&lt;/font&gt;&lt;font size=1&gt;(&lt;/font&gt;&lt;font color=#a31515 size=1&gt;"&amp;lt;br/&amp;gt;"&lt;/font&gt;&lt;font size=1&gt;));&lt;br&gt;
   &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Controls.Add(grdTime);
&lt;/p&gt;
&lt;p&gt;
   &gt;&lt;font color=#0000ff size=1&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;base&lt;/font&gt;&lt;font size=1&gt;.CreateChildControls();&lt;br&gt;
   &lt;/font&gt;&lt;font size=1&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}
&lt;/p&gt;
&lt;p&gt;
   &gt;&lt;font color=#0000ff size=1&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;protected&lt;/font&gt;&lt;font size=1&gt; &lt;/font&gt;&lt;font color=#0000ff size=1&gt;override&lt;/font&gt;&lt;font size=1&gt; &lt;/font&gt;&lt;font color=#0000ff size=1&gt;void&lt;/font&gt;&lt;font size=1&gt; Render(&lt;/font&gt;&lt;font color=#2b91af size=1&gt;HtmlTextWriter&lt;/font&gt;&lt;font size=1&gt; writer)&lt;br&gt;
   &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;br&gt;
   &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;writer.Write(&lt;/font&gt;&lt;font color=#a31515 size=1&gt;"&amp;lt;h4&amp;gt;Hello
   World!&amp;lt;/h4&amp;gt;"&lt;/font&gt;&lt;font size=1&gt;);&lt;br&gt;
   &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/font&gt;&lt;font color=#0000ff size=1&gt;base&lt;/font&gt;&lt;font size=1&gt;.Render(writer);&lt;br&gt;
   &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br&gt;
   &amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br&gt;
   }
&lt;/p&gt;
&gt; 
&lt;p&gt;
   Before installing this to SharePoint 2007, let's complete this section by talking
   about what we need to do to embed the resources with the assembly.
&lt;/p&gt;
&lt;ol&gt;
   &lt;li&gt;
      Create an&amp;nbsp;Image directory within your project and copy the Image there:&lt;br&gt;
      &lt;img src="http://www.efficientcoder.net/content/binary/SLWebPartImageTree.bmp" border=0&gt; 
   &lt;li&gt;
      You can see that the name including the NameSpace is "SoftwareLogistics.SharePointTest.Images.Target.gif"
      (Case is important here) 
   &lt;li&gt;
      Once you copied the image there you need to make sure you click on "Properties" and
      then set the Build Action to "Embedded Resource" for Target.gif, very important to
      do this... 
   &lt;li&gt;
      Now open up your "AssemblyInfo.cs" file that is in the Properties folder of your project.&amp;nbsp;
      Add a line to it similar to 
      &lt;br&gt;
      &lt;font size=1&gt;[assembly: &lt;/font&gt;&lt;font color=#2b91af size=1&gt;WebResource&lt;/font&gt;&lt;font size=1&gt;(&lt;/font&gt;&lt;font color=#a31515 size=1&gt;"SoftwareLogistics.SharePointTest.Images.Target.gif"&lt;/font&gt;&lt;font size=1&gt;,&lt;/font&gt;&lt;font color=#a31515 size=1&gt;"image/gif"&lt;/font&gt;&lt;font size=1&gt;)&lt;/font&gt; 
   &lt;li&gt;
      &lt;p&gt;
         &lt;font size=1&gt;&lt;font size=2&gt;You will also need to add &lt;font color=#0000ff size=1&gt;using&lt;/font&gt;&lt;font size=1&gt;&lt;font color=#000000&gt; System.Web.UI;&lt;/font&gt;&lt;/font&gt;&amp;nbsp;to
         the top of your AssemblyInfo.cs.&lt;/font&gt;&lt;/font&gt;
      &lt;/p&gt;
   &lt;li&gt;
      &lt;p&gt;
         &lt;font size=1&gt;&lt;font size=2&gt;Finally in the code you can set the url of the image as:&lt;br&gt;
         &lt;font size=1&gt;img.ImageUrl = Page.ClientScript.GetWebResourceUrl(&lt;font color=#0000ff&gt;this&lt;/font&gt;.GetType(), &lt;font color=#a31515&gt;"SoftwareLogistics.SharePointTest.Images.Target.gif"&lt;/font&gt;);&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;
      &lt;/p&gt;
   &lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;
   &lt;font size=1&gt;&lt;font size=2&gt;Now your assembly is ready to go all you need to do is turn
   that into and assembly and your are ready to incorporate it into your SharePoint 2007
   site, you can even us this as a WebPart or even a standard Server Control on any ASP.NET
   2.0 site.&lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
   To install the the component on the SharePoint2007 server you need to do the next
   couple of steps...
&lt;/p&gt;
&lt;ol&gt;
   &lt;li&gt;
      First we need to get our component into the GAC so just drag it into the file pane
      for Windows\Assembly, you can see the my file here:&lt;br&gt;
      &lt;img src="http://www.efficientcoder.net/content/binary/SLWebPartGAC.png" border=0&gt; 
   &lt;li&gt;
      Make a note of the Public Key Token, you will need that to register your part with
      SharePoint, you can also right mouse click&amp;nbsp;on the assembly click on Properties
      and copy the Pulbic Key Token from there. 
   &lt;li&gt;
      The final step to make it appear as a "potential" web part within SharePoint is to
      register the component in the Web.Config file.&amp;nbsp; So find Web.Config for the SharePoint
      instance you want this work with and open it in your favorite XML editor. 
   &lt;li&gt;
      Find the section labeled "SafeControls" and add the following line (you can always
      just copy one of the existing lines and&amp;nbsp;fill in your information.&lt;br&gt;
      &lt;font face="Courier New"&gt;&amp;nbsp;&amp;lt;SafeControl Assembly="SoftwareLogistics.SharePointTest,
      Version=1.1.0.0, Culture=neutral, PublicKeyToken=8220d66cd77f3b8d" Namespace="SoftwareLogistics.SharePointTest"
      TypeName="*" Safe="True" /&amp;gt;&lt;/font&gt;
   &lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;
   At this point SharePoint knows about your WebPart, but you'll need to make it part
   of the Gallery so open up your SharePoint site and do these final steps
&lt;/p&gt;
&lt;ol&gt;
   &lt;li&gt;
      Click on "Site Actions" and then "Site Settings" 
   &lt;li&gt;
      Within the "Galleries" section click on "Web Parts" 
   &lt;li&gt;
      Click on New, if all went well you should see the part you created within the list,
      if you don't see it there, go ahead and reset IIS. 
   &lt;li&gt;
      Put a check mark next to your new web part and then click the "Populate Gallery" button.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;
   At this point your web part is ready to be included just like any other WebPart.
&lt;/p&gt;
&lt;p&gt;
   Happy Coding!
&lt;/p&gt;
&lt;p&gt;
   - ec
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.efficientcoder.net/aggbug.ashx?id=17d566aa-8dd5-4743-a54d-e66dff060dd8" /&gt;</description>
      <comments>http://www.efficientcoder.net/CommentView,guid,17d566aa-8dd5-4743-a54d-e66dff060dd8.aspx</comments>
      <category>ASP.NET;SharePoint 2007;Software Engineering</category>
    </item>
    <item>
      <trackback:ping>http://www.efficientcoder.net/Trackback.aspx?guid=1a7e824e-d599-45da-854b-909ce99a5bdf</trackback:ping>
      <pingback:server>http://www.efficientcoder.net/pingback.aspx</pingback:server>
      <pingback:target>http://www.efficientcoder.net/PermaLink,guid,1a7e824e-d599-45da-854b-909ce99a5bdf.aspx</pingback:target>
      <dc:creator>kevinw@software-logistics.com (Kevin D. Wolf)</dc:creator>
      <wfw:comment>http://www.efficientcoder.net/CommentView,guid,1a7e824e-d599-45da-854b-909ce99a5bdf.aspx</wfw:comment>
      <wfw:commentRss>http://www.efficientcoder.net/SyndicationService.asmx/GetEntryCommentsRss?guid=1a7e824e-d599-45da-854b-909ce99a5bdf</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <h4>SharePoint 2007 - It's finally all coming together!
   </h4>
        <p>
      I remember in the very early days of .NET they had a cool demo of how to build
      a portal in ASP.NET, this was called "I Buy Spy" from what I understood
      went on to be <a href="http://www.dotnetnuke.com">DOTNETNUKE</a>, I was excited
      about the concept of configurable content within the portal, it had all the right
      concepts, adding tabs, little widgets you could configure etc... These were really
      just Web Controls (ASCX) or Server Controls (compiled DLL's).  My third version
      of "The Chaos Filter" used this concept extensively. 
   </p>
        <p>
      Then with ASP.NET 2.0, they introduced the concept of WebParts, this was nice however
      you had to build up a set of scaffolding and use the provider model to use these
      within your site (at least as pure web parts).  Not terribly difficult but it
      limited your deployed options.  At the time SharePoint 2003 had something called
      "WebParts" as well, extremely similar in both appearance and function, however these
      "WebParts" were not the same thing as those created with ASP.NET 2.0.  Very disappointing
      (and confusing), SharePoint 2003 web parts actually came out first, and I assume that
      Microsoft kept the name since it seems to fit this concept so well and the intent
      with ASP.NET 2.0 web parts was that they would work with SharePoint 2007.
   </p>
        <p>
      Version 3.0 of the product really defined and flushed out the data model and workflow
      engine however, I just wasn't very happy with the presentation layer in ASP.NET 1.1
      using the ASCX's and custom controls.  With the introduction of the ASP.NET 2.0
      I started on version 4.0 of "The Chaos Filter", this time I focused on an architecture
      that was built from the ground-up to use web parts and leverage the existing data
      model and workflow concepts that make the Chaos Filter unique.  This architecture
      relied heavily on code generation from a product called CodeSmith, templates where
      created to not only create a simple DAL that mapped to tables in the database, but
      it also created two web parts (master/detail) for each tables.  This obviously
      doesn't mean that you can generate 100% of the application, however it does mean that
      it can very rapidly give you web parts that work out-of-the box that you can customize. 
      Anytime I hear "You can build your hole site in just three lines of code" my spider
      senses tell me to watch out!  This solution is really intended to put in place
      the framework and plumbing that you can open up in your development environment and
      make it do something useful.
   </p>
        <p>
      So here we are, SharePoint 2007 was released last November, what does this give us
      that we really didn't have before?  We now have the ability to easily create
      little "chunks" of functionality in the form of "WebParts" that can be wired up to
      create applications.  So with the data model defined in V3.0 of my product, the
      architecture to include code generation defined in V4.0 of my product, and a mature
      framework in SharePoint 2007, it's time to start figuring out how to package these
      concepts into something that will provide value.
   </p>
        <p>
      -ec
   </p>
        <img width="0" height="0" src="http://www.efficientcoder.net/aggbug.ashx?id=1a7e824e-d599-45da-854b-909ce99a5bdf" />
      </body>
      <title>SharePoint 2007 &amp; The Chaos Filter</title>
      <guid>http://www.efficientcoder.net/PermaLink,guid,1a7e824e-d599-45da-854b-909ce99a5bdf.aspx</guid>
      <link>http://www.efficientcoder.net/PermaLink,guid,1a7e824e-d599-45da-854b-909ce99a5bdf.aspx</link>
      <pubDate>Sun, 04 Feb 2007 15:05:56 GMT</pubDate>
      <description>&lt;h4&gt;SharePoint 2007 - It's finally all coming together!
&lt;/h4&gt;
&lt;p&gt;
   I remember in the very&amp;nbsp;early days of .NET they had a cool demo of how to build
   a portal in&amp;nbsp;ASP.NET, this was&amp;nbsp;called "I Buy Spy" from what I understood
   went on to be &lt;a href="http://www.dotnetnuke.com"&gt;DOTNETNUKE&lt;/a&gt;,&amp;nbsp;I was&amp;nbsp;excited
   about the concept of configurable content within the portal, it had all the right
   concepts, adding tabs, little widgets you could configure etc...&amp;nbsp;These were really
   just Web Controls (ASCX) or Server Controls (compiled DLL's).&amp;nbsp; My third version
   of "The Chaos Filter" used this concept extensively.&amp;nbsp;
&lt;/p&gt;
&lt;p&gt;
   Then with ASP.NET 2.0, they introduced the concept of WebParts, this was nice however
   you had to build up a set of scaffolding and use the provider model to&amp;nbsp;use these
   within your site (at least as pure web parts).&amp;nbsp; Not terribly difficult but it
   limited your deployed options.&amp;nbsp; At the time SharePoint 2003 had something called
   "WebParts" as well, extremely similar in both appearance and function, however these
   "WebParts" were not the same thing as those created with ASP.NET 2.0.&amp;nbsp; Very disappointing
   (and confusing), SharePoint 2003 web parts actually came out first, and I assume that
   Microsoft kept the name since it seems to fit this concept so well and the intent
   with ASP.NET 2.0 web parts was that they would work with SharePoint 2007.
&lt;/p&gt;
&lt;p&gt;
   Version 3.0 of the product really defined and flushed out the data model and workflow
   engine however, I just wasn't very happy with the presentation layer in ASP.NET 1.1
   using the ASCX's and custom controls.&amp;nbsp; With the introduction of the ASP.NET 2.0
   I started on version 4.0 of "The Chaos Filter", this time I focused on&amp;nbsp;an architecture
   that was built from the ground-up to use web parts and leverage the existing data
   model and workflow concepts that make the Chaos Filter unique.&amp;nbsp; This architecture
   relied heavily on code generation from a product called CodeSmith, templates where
   created to not only create a simple DAL that mapped to tables in the database, but
   it also created two web parts (master/detail)&amp;nbsp;for each tables.&amp;nbsp; This obviously
   doesn't mean that you can generate 100% of the application, however it does mean that
   it can very rapidly give you web parts that work out-of-the box that you can customize.&amp;nbsp;
   Anytime I hear "You can build your hole site in just three lines of code" my spider
   senses tell me to watch out!&amp;nbsp; This solution is really intended to put in place
   the framework and plumbing that you can open up in your development environment and
   make it do something useful.
&lt;/p&gt;
&lt;p&gt;
   So here we are, SharePoint 2007 was released last November, what does this give us
   that we really didn't have before?&amp;nbsp; We now have the ability to easily create
   little "chunks" of functionality in the form of "WebParts" that can be wired up to
   create applications.&amp;nbsp; So with the data model defined in V3.0 of my product, the
   architecture to include code generation defined in V4.0 of my product, and a mature
   framework in SharePoint 2007, it's time to start figuring out how to package these
   concepts into something that will provide value.
&lt;/p&gt;
&lt;p&gt;
   -ec
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.efficientcoder.net/aggbug.ashx?id=1a7e824e-d599-45da-854b-909ce99a5bdf" /&gt;</description>
      <comments>http://www.efficientcoder.net/CommentView,guid,1a7e824e-d599-45da-854b-909ce99a5bdf.aspx</comments>
      <category>ASP.NET;Chaos Filter;SharePoint 2007;Software Engineering</category>
    </item>
  </channel>
</rss>