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

<channel>
	<title>moopoo.net &#187; SharePoint</title>
	<atom:link href="http://moopoo.net/tag/sharepoint/feed/" rel="self" type="application/rss+xml" />
	<link>http://moopoo.net</link>
	<description>Fishing, technology and anything else</description>
	<lastBuildDate>Fri, 09 Dec 2011 11:04:41 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Disabling a SharePoint ribbon control based on user list permissions</title>
		<link>http://moopoo.net/sharepoint/disabling-a-sharepoint-ribbon-control-based-on-user-list-permissions/</link>
		<comments>http://moopoo.net/sharepoint/disabling-a-sharepoint-ribbon-control-based-on-user-list-permissions/#comments</comments>
		<pubDate>Fri, 09 Dec 2011 11:00:00 +0000</pubDate>
		<dc:creator>Matt</dc:creator>
				<category><![CDATA[SharePoint]]></category>
		<category><![CDATA[Permissions]]></category>
		<category><![CDATA[Ribbon]]></category>

		<guid isPermaLink="false">http://moopoo.net/?p=147</guid>
		<description><![CDATA[I had a requirement to create a button on a SharePoint list ribbon that was only enabled for Contributors of that list. The post will explain how to set that up in javascript using the SharePoint 2010 Client Object Model. I assume that you already have knowledge of working with the Ribbon in SharePoint 2010 [...]]]></description>
			<content:encoded><![CDATA[<p>I had a requirement to create a button on a SharePoint list ribbon that was only enabled for Contributors of that list. The post will explain how to set that up in javascript using the SharePoint 2010 Client Object Model.</p>
<p>I assume that you already have knowledge of working with the Ribbon in SharePoint 2010 and in particular using javascript page components. The snippets assume you have the rest of the ribbon definition in place and an existing page component file. If you don’t, I’d recommend you head on over to Chris O’Brien’s <a href="http://www.sharepointnutsandbolts.com/2010/02/ribbon-customizations-dropdown-controls.html" target="_blank">great articles</a> on ribbon customisations.</p>
<h2>Creating the button.</h2>
<p>First up we need to declare the button we wish to disable or rather enable based on the users permission. </p>
<pre class="csharpcode"><span class="kwrd">&lt;</span><span class="html">Button</span>
  <span class="attr">Id</span><span class="kwrd">=&quot;Ribbon.MyButton.Button&quot;</span>
  <span class="attr">Alt</span><span class="kwrd">=&quot;Ribbon.MyButton.Button&quot;</span>
  <span class="attr">Command</span><span class="kwrd">=&quot;Ribbon.MyButton.Button.Configure&quot;</span>
  <span class="attr">Image16by16</span><span class="kwrd">=&quot;/_layouts/images/splogo.gif&quot;</span>
  <span class="attr">Image32by32</span><span class="kwrd">=&quot;/_layouts/images/settingsIcon.png&quot;</span>
  <span class="attr">LabelText</span><span class="kwrd">=&quot;Configure&quot;</span>
  <span class="attr">Sequence</span><span class="kwrd">=&quot;10&quot;</span>
  <span class="attr">TemplateAlias</span><span class="kwrd">=&quot;o1&quot;</span>
  <span class="attr">ToolTipTitle</span><span class="kwrd">=&quot;Configure&quot;</span>
  <span class="attr">ToolTipDescription</span><span class="kwrd">=&quot;Configure merge&quot;</span> <span class="kwrd">/&gt;</span></pre>
<p>&#160;</p>
<p>The above definition is just that of an ordinary ribbon button, nothing special is declared in there. </p>
<h2>Javascript page component.</h2>
<p>The next step is to modify our page component file.</p>
<pre class="csharpcode">canHandleCommand: <span class="kwrd">function</span> (commandId) {
      <span class="kwrd">if</span>(commandId === <span class="str">'Ribbon.MyButton.Button.Configure'</span>)
        {
            <span class="kwrd">if</span>(userIsContrib == null)
            {
                checkUserIsContrib();                 </pre>
<pre class="csharpcode"><span class="kwrd">                return</span> false;
            }
            <span class="kwrd">else</span>
            {
                <span class="kwrd">return</span> userIsContrib;
            }
        }
        <span class="kwrd">else</span> {
            <span class="kwrd">return</span> <span class="kwrd">false</span>;
        }
    },</pre>
<pre class="csharpcode">...

<span class="kwrd">var</span> userIsContrib = <span class="kwrd">null</span>;

<span class="kwrd">function</span> checkUserIsContrib() {
    <span class="kwrd">var</span> context = SP.ClientContext.get_current();
    <span class="kwrd">var</span> web = context.get_web();
    list = web.get_lists().getById(SP.ListOperation.Selection.getSelectedList());

    context.load(list,<span class="str">'EffectiveBasePermissions'</span>);

    context.executeQueryAsync(Function.createDelegate(<span class="kwrd">this</span>, gotUserIsContrib), Function.createDelegate(<span class="kwrd">this</span>, failedUserIsContrib));
}

<span class="kwrd">function</span> gotUserIsContrib() {

    <span class="rem">// update the variable based on the users permission</span>
    userIsContrib = list.get_effectiveBasePermissions().has(SP.PermissionKind.editListItems);

    <span class="rem">//Update the UI</span>
    RefreshCommandUI();

}

<span class="kwrd">function</span> failedUserIsContrib() {
    alert(<span class="str">&quot;failed failedUserIsContrib&quot;</span>);
}</pre>
<p>&#160;</p>
<p>Because we want to check the user permissions asynchronously, we need to set userIsContrib initially to null. This will disable the button for all users while the checkUserIsContrib() method goes off and checks the users permissions.</p>
<p>After checking the users permissions and settings the flag appropriately we call RefreshCommandUI() which will again cause canHandleCommand to be run again. This time it will return the value that was set in the gotUserIsContrib() method. As a value has now been set on userIsContrib, no more checks against the server will be made by any other calls to RefreshCommandUI. </p>
<p>&#160;</p>
<h2>References.</h2>
<ul>
<li>&#160;<a href="http://www.sharepointnutsandbolts.com/2010/01/customizing-ribbon-part-1-creating-tabs.html" target="_blank">Chris O’Brien: Customizing the ribbon</a></li>
<li><a href="http://www.andrewconnell.com/blog/archive/2010/10/14/asynchronously-checking-if-a-command-is-available-in-the-sharepoint.aspx" target="_blank">Andrew Connell: Asynchronously Checking if a Command is Available in the SharePoint Ribbon</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://moopoo.net/sharepoint/disabling-a-sharepoint-ribbon-control-based-on-user-list-permissions/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Package class library as wsp for SharePoint Deployment</title>
		<link>http://moopoo.net/sharepoint/package-class-library-as-wsp-for-sharepoint-deployment/</link>
		<comments>http://moopoo.net/sharepoint/package-class-library-as-wsp-for-sharepoint-deployment/#comments</comments>
		<pubDate>Wed, 15 Dec 2010 12:30:57 +0000</pubDate>
		<dc:creator>Matt</dc:creator>
				<category><![CDATA[SharePoint]]></category>
		<category><![CDATA[deployment]]></category>
		<category><![CDATA[visual]]></category>
		<category><![CDATA[Visual Studio]]></category>

		<guid isPermaLink="false">http://moopoo.net/?p=133</guid>
		<description><![CDATA[Some Visual Studio solutions I&#8217;ve come across have class library projects in them. These assemblies have to subsequently be manually copied into the GAC of each SharePoint server. This goes against the standard of using wsp files to deploy assemblies and files into a SharePoint environment. Single servers are easier to manage manually copying assemblies [...]]]></description>
			<content:encoded><![CDATA[<p>Some Visual Studio solutions I&#8217;ve come across have class library projects in them. These assemblies have to subsequently be manually copied into the GAC of each SharePoint server. This goes against the standard of using wsp files to deploy assemblies and files into a SharePoint environment. Single servers are easier to manage manually copying assemblies but it&#8217;s not a very pleasant way of doing things, move into a multi server environment and you&#8217;re in a minefield.<br />
Fortunately there is an easy way to get these assemblies, plus any others you may wish to deploy at the same time, into a wsp. It takes two files and a post build event. Read on..</p>
<p>First up, we need a manifest file. This tells the environment what we would like it to do with the assembly.<br />
Create a new xml file in the root of your project called manifest.xml and add the following code:</p>

<div class="wp_syntax"><div class="code"><pre class="csharp" style="font-family:monospace;"><span style="color: #008000;">&lt;?</span>xml version<span style="color: #008000;">=</span><span style="color: #666666;">&quot;1.0&quot;</span> encoding<span style="color: #008000;">=</span><span style="color: #666666;">&quot;utf-8&quot;</span> <span style="color: #008000;">?&gt;</span>
<span style="color: #008000;">&lt;</span>Solution xmlns<span style="color: #008000;">=</span><span style="color: #666666;">&quot;http://schemas.microsoft.com/sharepoint/&quot;</span>
  SolutionId<span style="color: #008000;">=</span><span style="color: #666666;">&quot;&lt;new guid&gt;&quot;</span><span style="color: #008000;">&gt;</span>
  <span style="color: #008000;">&lt;</span>Assemblies<span style="color: #008000;">&gt;</span>
    <span style="color: #008000;">&lt;</span>Assembly Location<span style="color: #008000;">=</span><span style="color: #666666;">&quot;&lt;assembly&gt;.dll&quot;</span> DeploymentTarget<span style="color: #008000;">=</span><span style="color: #666666;">&quot;GlobalAssemblyCache&quot;</span><span style="color: #008000;">&gt;&lt;/</span>Assembly<span style="color: #008000;">&gt;</span>
  <span style="color: #008000;">&lt;/</span>Assemblies<span style="color: #008000;">&gt;</span>
<span style="color: #008000;">&lt;/</span>Solution<span style="color: #008000;">&gt;</span></pre></div></div>

<p>Replace &lt;new guid&gt; with a generated GUID and &lt;assembly&gt; with the name of your dll file.<br />
The DeploymentTarget attribute above specifies that it will be deployed to the GAC, you can use WebApplication if you want it to be deployed to the bin directory of your Webb Application.</p>
<p>You can also specify that the relevant line can be added to the SafeControls section of your web.config file by adding the following inside the Assembly tag above.</p>

<div class="wp_syntax"><div class="code"><pre class="csharp" style="font-family:monospace;"><span style="color: #008000;">&lt;</span>SafeControls<span style="color: #008000;">&gt;</span>
        <span style="color: #008000;">&lt;</span>SafeControl Assembly<span style="color: #008000;">=</span><span style="color: #666666;">&quot;&lt;assembly&gt;, Version=1.0.0.0, Culture=neutral, PublicKeyToken=&lt;public key token&gt;&quot;</span> <span style="color: #0600FF;">Namespace</span><span style="color: #008000;">=</span><span style="color: #666666;">&quot;&lt;namespace&gt;&quot;</span> TypeName<span style="color: #008000;">=</span><span style="color: #666666;">&quot;*&quot;</span> Safe<span style="color: #008000;">=</span><span style="color: #666666;">&quot;True&quot;</span> <span style="color: #008000;">/&gt;</span>
      <span style="color: #008000;">&lt;/</span>SafeControls<span style="color: #008000;">&gt;</span></pre></div></div>

<p>Next up, create a ddf file in the root of your project. I tend to name mine wsp.ddf for consistency. This will contain the instructions on what to package into the wsp file. This file should look like the following.</p>

<div class="wp_syntax"><div class="code"><pre class="csharp" style="font-family:monospace;"><span style="color: #008000;">;</span>Define the output directory and CAB file name <span style="color: #000000;">&#40;</span>with a wsp extension<span style="color: #000000;">&#41;</span>
.<span style="color: #0000FF;">Set</span> DiskDirectory1<span style="color: #008000;">=</span><span style="color: #666666;">&quot;bin<span style="color: #008080; font-weight: bold;">\D</span>ebug&quot;</span>
.<span style="color: #0000FF;">Set</span> CabinetNameTemplate<span style="color: #008000;">=</span><span style="color: #666666;">&quot;MySolutionName.wsp&quot;</span>
&nbsp;
<span style="color: #008000;">;</span>Include the following files <span style="color: #0600FF;">in</span> the CAB Root
manifest.<span style="color: #0000FF;">xml</span>
bin\Debug\<span style="color: #008000;">&lt;</span>assembly<span style="color: #008000;">&gt;</span>.<span style="color: #0000FF;">dll</span></pre></div></div>

<p>Now all we have left to do is add a post build event to build the wsp for us.<br />
Go to you project properties (right click project)<br />
Under the Build Events tab under Post-build event command line, enter the following:</p>

<div class="wp_syntax"><div class="code"><pre class="csharp" style="font-family:monospace;"><span style="color: #008000;">::</span> <span style="color: #0000FF;">Change</span> directory to the root of the project
cd <span style="color: #666666;">&quot;$(ProjectDir)&quot;</span>
&nbsp;
<span style="color: #008000;">::</span> <span style="color: #0000FF;">Create</span> a WSP CAB
MakeCAB <span style="color: #008000;">/</span>f <span style="color: #666666;">&quot;WSP.DDF&quot;</span></pre></div></div>

<p>You can change when the post build event runs, to your liking; normally &#8216;On successful build&#8217;.</p>
<p>That&#8217;s it when you have a successful build the wsp file will be generated ready for you to deploy, no more manual copying or editing web.config.</p>
]]></content:encoded>
			<wfw:commentRss>http://moopoo.net/sharepoint/package-class-library-as-wsp-for-sharepoint-deployment/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Arrays in custom web part and SharePoint Designer</title>
		<link>http://moopoo.net/sharepoint/arrays-in-custom-web-part-and-sharepoint-designer/</link>
		<comments>http://moopoo.net/sharepoint/arrays-in-custom-web-part-and-sharepoint-designer/#comments</comments>
		<pubDate>Fri, 17 Sep 2010 16:11:12 +0000</pubDate>
		<dc:creator>Matt</dc:creator>
				<category><![CDATA[SharePoint]]></category>
		<category><![CDATA[c#]]></category>
		<category><![CDATA[SharePoint Designer]]></category>

		<guid isPermaLink="false">http://moopoo.net/?p=129</guid>
		<description><![CDATA[I came across an issue when trying to add a custom web part to a page layout in SPD. Each time I added it, the web part would error &#8220;Cannot create an object of type &#8216;Systems.Collections.ArrayList&#8217; from its string representation &#8216;Collection&#8217; for the &#8216;MyValue&#8217; property&#8221;. I narrowed it down to an ArrayList I had declared [...]]]></description>
			<content:encoded><![CDATA[<p>I came across an issue when trying to add a custom web part to a page layout in SPD.<br />
Each time I added it, the web part would error <strong>&#8220;Cannot create an object of type &#8216;Systems.Collections.ArrayList&#8217; from its string representation &#8216;Collection&#8217; for the &#8216;MyValue&#8217; property&#8221;</strong>.<br />
I narrowed it down to an ArrayList I had declared as public within the webpart. Changing this from public solved the issue for me.</p>
]]></content:encoded>
			<wfw:commentRss>http://moopoo.net/sharepoint/arrays-in-custom-web-part-and-sharepoint-designer/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Validation Group with SharePoint DateTimeControl</title>
		<link>http://moopoo.net/sharepoint/validation-group-with-sharepoint-datetimecontrol/</link>
		<comments>http://moopoo.net/sharepoint/validation-group-with-sharepoint-datetimecontrol/#comments</comments>
		<pubDate>Tue, 16 Feb 2010 10:57:30 +0000</pubDate>
		<dc:creator>Matt</dc:creator>
				<category><![CDATA[SharePoint]]></category>
		<category><![CDATA[c#]]></category>
		<category><![CDATA[Validation]]></category>

		<guid isPermaLink="false">http://moopoo.net/?p=109</guid>
		<description><![CDATA[The SharePoint DateTimeControl has a property called IsRequiredField, which will act like a RequiredFieldValidator for the control. The problem is when working with web parts in SharePoint calling Page.Validate in your web part can have unexpected results. It often ends up firing validators elsewhere on the page, particularly if the web part is used on [...]]]></description>
			<content:encoded><![CDATA[<p>The SharePoint DateTimeControl has a property called IsRequiredField, which will act like a RequiredFieldValidator for the control. The problem is when working with web parts in SharePoint calling Page.Validate in your web part can have unexpected results. It often ends up firing validators elsewhere on the page, particularly if the web part is used on a list form for example.<br />
One answer of course is to use a validation group in your web part, this is where the DateTimeControl falls down as it doesn&#8217;t have this property.</p>
<p>The answer to this to create a validator in your webpart and hook it into the TextBox element of the DateTimeControl, which will then allow you to set the validation group on it.</p>
<p>To do this use the following code when you create your validator.</p>

<div class="wp_syntax"><div class="code"><pre class="csharp" style="font-family:monospace;">valReviewDate.<span style="color: #0000FF;">ControlToValidate</span> <span style="color: #008000;">=</span> <span style="color: #FF0000;">string</span>.<span style="color: #0000FF;">Format</span><span style="color: #000000;">&#40;</span><span style="color: #666666;">&quot;{0}${0}Date&quot;</span>, dteReview.<span style="color: #0000FF;">ID</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span></pre></div></div>

<p><a href="http://sharepointdata.blogspot.com/2009/06/sharepoint-datetime-control-validation.html">This post</a>, describes how to do it from code in front.</p>
]]></content:encoded>
			<wfw:commentRss>http://moopoo.net/sharepoint/validation-group-with-sharepoint-datetimecontrol/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Disable Web Part button after clicking</title>
		<link>http://moopoo.net/sharepoint/disable-web-part-button/</link>
		<comments>http://moopoo.net/sharepoint/disable-web-part-button/#comments</comments>
		<pubDate>Tue, 16 Feb 2010 10:24:40 +0000</pubDate>
		<dc:creator>Matt</dc:creator>
				<category><![CDATA[SharePoint]]></category>
		<category><![CDATA[c#]]></category>

		<guid isPermaLink="false">http://moopoo.net/?p=104</guid>
		<description><![CDATA[Not sure how, I got to the end point of this so there may be other ways of doing it. Basically I had a web part the when the button was clicked I needed to disable it. Adding .Attributes["onclick"] didn&#8217;t seem to work, and after trying a few things I managed to get it working [...]]]></description>
			<content:encoded><![CDATA[<p>Not sure how, I got to the end point of this so there may be other ways of doing it.<br />
Basically I had a web part the when the button was clicked I needed to disable it.<br />
Adding .Attributes["onclick"] didn&#8217;t seem to work, and after trying a few things I managed to get it working this way.<br />
Add the following code into OnPreRender of the web part, assuming cmdGenerate is the name of your button.</p>

<div class="wp_syntax"><div class="code"><pre class="csharp" style="font-family:monospace;">cmdGenerate.<span style="color: #0000FF;">Attributes</span>.<span style="color: #0000FF;">Add</span><span style="color: #000000;">&#40;</span><span style="color: #666666;">&quot;onclick&quot;</span>, Page.<span style="color: #0000FF;">ClientScript</span>.<span style="color: #0000FF;">GetPostBackEventReference</span><span style="color: #000000;">&#40;</span>cmdGenerate, <span style="color: #666666;">&quot;&quot;</span><span style="color: #000000;">&#41;</span> <span style="color: #008000;">+</span> <span style="color: #666666;">&quot;;this.value='Please wait...';this.disabled = true;&quot;</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://moopoo.net/sharepoint/disable-web-part-button/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using Custom Masterpage in _layouts directory</title>
		<link>http://moopoo.net/mobile/using-custom-masterpage-in-_layouts-directory/</link>
		<comments>http://moopoo.net/mobile/using-custom-masterpage-in-_layouts-directory/#comments</comments>
		<pubDate>Mon, 24 Aug 2009 10:19:52 +0000</pubDate>
		<dc:creator>Matt</dc:creator>
				<category><![CDATA[Mobile]]></category>
		<category><![CDATA[SharePoint]]></category>
		<category><![CDATA[masterpage]]></category>
		<category><![CDATA[style]]></category>

		<guid isPermaLink="false">http://moopoo.net/?p=97</guid>
		<description><![CDATA[To use a custom or the default masterpage in custom aspx pages located in your _layouts directory use the following code in the code behind for the page. N.B I didn&#8217;t declare any masterpage useage in the actual aspx file. protected override void OnPreInit&#40;EventArgs e&#41; &#123; base.OnPreInit&#40;e&#41;; // Set the masterpage to the default.master. using [...]]]></description>
			<content:encoded><![CDATA[<p>To use a custom or the default masterpage in custom aspx pages located in your _layouts directory use the following code in the code behind for the page.<br />
N.B I didn&#8217;t declare any masterpage useage in the actual aspx file.</p>

<div class="wp_syntax"><div class="code"><pre class="csharp" style="font-family:monospace;"><span style="color: #0600FF;">protected</span> <span style="color: #0600FF;">override</span> <span style="color: #0600FF;">void</span> OnPreInit<span style="color: #000000;">&#40;</span>EventArgs e<span style="color: #000000;">&#41;</span>
<span style="color: #000000;">&#123;</span>
    <span style="color: #0600FF;">base</span>.<span style="color: #0000FF;">OnPreInit</span><span style="color: #000000;">&#40;</span>e<span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
    <span style="color: #008080; font-style: italic;">// Set the masterpage to the default.master.</span>
    <span style="color: #0600FF;">using</span> <span style="color: #000000;">&#40;</span>SPWeb webCurrent <span style="color: #008000;">=</span> SPControl.<span style="color: #0000FF;">GetContextSite</span><span style="color: #000000;">&#40;</span>Context<span style="color: #000000;">&#41;</span>.<span style="color: #0000FF;">OpenWeb</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>
    <span style="color: #000000;">&#123;</span>
        <span style="color: #FF0000;">string</span> strUrl <span style="color: #008000;">=</span> webCurrent.<span style="color: #0000FF;">ServerRelativeUrl</span> <span style="color: #008000;">+</span> <span style="color: #666666;">&quot;/_catalogs/masterpage/default.master&quot;</span><span style="color: #008000;">;</span>
        <span style="color: #008080; font-style: italic;">// custom.master is your same default or main master page </span>
        <span style="color: #008080; font-style: italic;">// being used for main portal pages. Change that path according to your need</span>
        <span style="color: #0600FF;">this</span>.<span style="color: #0000FF;">MasterPageFile</span> <span style="color: #008000;">=</span> strUrl<span style="color: #008000;">;</span>
    <span style="color: #000000;">&#125;</span> 
<span style="color: #000000;">&#125;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://moopoo.net/mobile/using-custom-masterpage-in-_layouts-directory/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>SharePoint Web Part Properties</title>
		<link>http://moopoo.net/sharepoint/sharepoint-web-part-properties/</link>
		<comments>http://moopoo.net/sharepoint/sharepoint-web-part-properties/#comments</comments>
		<pubDate>Wed, 03 Dec 2008 15:08:03 +0000</pubDate>
		<dc:creator>Matt</dc:creator>
				<category><![CDATA[SharePoint]]></category>

		<guid isPermaLink="false">http://moopoo.net/?p=62</guid>
		<description><![CDATA[When creating a WebPart inheriting from System.Web.UI.WebControls.WebParts.WebPart, use the following code to add a custom Integer property that will sit in it&#8217;s own Category when you modify the properties of the web part. private const int _intMaxShiftsPerDay = 0; private int IntMaxShiftsPerDay = _intMaxShiftsPerDay; &#91;Category&#40;&#34;Custom Properties&#34;&#41;&#93; &#91;DefaultValue&#40;_intMaxShiftsPerDay&#41;&#93; &#91;Personalizable&#40;PersonalizationScope.Shared&#41;&#93; &#91;WebDisplayName&#40;&#34;Maximum Shifts Allowed Per Day&#34;&#41;&#93; &#91;WebDescription&#40;&#34;Type in [...]]]></description>
			<content:encoded><![CDATA[<p>When creating a WebPart inheriting from System.Web.UI.WebControls.WebParts.WebPart, use the following code to add a custom Integer property that will sit in it&#8217;s own Category when you modify the properties of the web part.</p>

<div class="wp_syntax"><div class="code"><pre class="csharp" style="font-family:monospace;"><span style="color: #0600FF;">private</span> <span style="color: #0600FF;">const</span> <span style="color: #FF0000;">int</span> _intMaxShiftsPerDay <span style="color: #008000;">=</span> <span style="color: #FF0000;">0</span><span style="color: #008000;">;</span>
<span style="color: #0600FF;">private</span> <span style="color: #FF0000;">int</span> IntMaxShiftsPerDay <span style="color: #008000;">=</span> _intMaxShiftsPerDay<span style="color: #008000;">;</span>
<span style="color: #000000;">&#91;</span>Category<span style="color: #000000;">&#40;</span><span style="color: #666666;">&quot;Custom Properties&quot;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#93;</span>
<span style="color: #000000;">&#91;</span>DefaultValue<span style="color: #000000;">&#40;</span>_intMaxShiftsPerDay<span style="color: #000000;">&#41;</span><span style="color: #000000;">&#93;</span>
<span style="color: #000000;">&#91;</span>Personalizable<span style="color: #000000;">&#40;</span>PersonalizationScope.<span style="color: #0000FF;">Shared</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#93;</span>
<span style="color: #000000;">&#91;</span>WebDisplayName<span style="color: #000000;">&#40;</span><span style="color: #666666;">&quot;Maximum Shifts Allowed Per Day&quot;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#93;</span>
<span style="color: #000000;">&#91;</span>WebDescription<span style="color: #000000;">&#40;</span><span style="color: #666666;">&quot;Type in the maximum allowed shifts per day for each person&quot;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#93;</span>
<span style="color: #000000;">&#91;</span>WebBrowsable<span style="color: #000000;">&#40;</span><span style="color: #0600FF;">true</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#93;</span>
<span style="color: #000000;">&#91;</span>XmlElement<span style="color: #000000;">&#40;</span>ElementName <span style="color: #008000;">=</span> <span style="color: #666666;">&quot;intMaxShiftsPerDay&quot;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#93;</span>
<span style="color: #0600FF;">public</span> <span style="color: #FF0000;">int</span> intMaxShiftsPerDay
<span style="color: #000000;">&#123;</span>
    get
    <span style="color: #000000;">&#123;</span>
        <span style="color: #0600FF;">return</span> IntMaxShiftsPerDay<span style="color: #008000;">;</span>
    <span style="color: #000000;">&#125;</span>
    set
   <span style="color: #000000;">&#123;</span>
        IntMaxShiftsPerDay <span style="color: #008000;">=</span> value<span style="color: #008000;">;</span>
    <span style="color: #000000;">&#125;</span>
<span style="color: #000000;">&#125;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://moopoo.net/sharepoint/sharepoint-web-part-properties/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Deploy a sharepoint solution with stsadm</title>
		<link>http://moopoo.net/sharepoint/deploy-a-sharepoint-solution-with-stsadm/</link>
		<comments>http://moopoo.net/sharepoint/deploy-a-sharepoint-solution-with-stsadm/#comments</comments>
		<pubDate>Fri, 31 Oct 2008 11:02:25 +0000</pubDate>
		<dc:creator>Matt</dc:creator>
				<category><![CDATA[SharePoint]]></category>

		<guid isPermaLink="false">http://moopoo.net/?p=59</guid>
		<description><![CDATA[First off we need to add the solution to SharePoint stsadm -o addsolution -filename c:\path-to\filename.wsp Next, we deploy the solution to the site stsadm -o deploysolution -name filename.wsp -url http://myurl -immediate Optionally if you use Code Access Security add the following to the above -allowcaspoliciesand if you have assemblies that deploy to the GAC, add [...]]]></description>
			<content:encoded><![CDATA[<p>First off we need to add the solution to SharePoint    </p>
<p> <code>stsadm -o addsolution -filename c:\path-to\filename.wsp</code>
<p>Next, we deploy the solution to the site</p>
<p><code>stsadm -o deploysolution -name filename.wsp -url http://myurl -immediate </code>Optionally if you use Code Access Security add the following to the above     </p>
<p><code>-allowcaspolicies</code>and if you have assemblies that deploy to the GAC, add this line to the deploysolution statement above     </p>
<p><code>-allowgacdeployment</code>This will create a timer job, we then simply need to execute this job     </p>
<p><code>stsadm -o execadmsvcjobs</code></p>
]]></content:encoded>
			<wfw:commentRss>http://moopoo.net/sharepoint/deploy-a-sharepoint-solution-with-stsadm/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

