Archive

Archive for the ‘SharePoint’ Category

SharePoint Role Definition / Permission levels

December 10, 2008 Leave a comment

    By default SharePoint has list of predefined Role Definitions that gets created during the site creation. If you want to create Additional Role Definitions you can do so by navigating to the Site Permission page and selecting Permission Levels from the Action menu. There will also be cases where we might need to create them programmatically. Here (Please use Save Target as option to down load the file) you can find a small project that creates permission levels programmatically.

    I have created this utility, to give more option to the user that is not available/easy in the SharePoint UI. But the one attached here is at very beginning stage; it just does what SP UI does, you can use it to learn how to create Permission levels programmatically. Will update the code once I add more options to it.

My First MOSS Project is Live

December 9, 2008 Leave a comment

Today morning, my mentor, friend, brother [Will update moreJ] Senthil Sathyamoorthi called me for my surprise and informed that the project in which I was part of in the previous Organization went live. I was so happy and emotional to find my name in the comments. I browsed through all the pages in the site, recollecting the days we worked, fun we had hurdles we faced.

    The reason why am so existed is that it was my first MOSS 2007 project, that started when MOSS 2007 was in Beta 2, and evolved through the migration path Beta2->B2TR->RTM.It used Web Content Management feature of MOSS 2007.We learnt so much out of it especially for me it was a great learning that laid a foundation for what I am now.

    Though it has been completed a year back, just now it is getting released am unaware of the reason for the delay. Here is the list of people, who were part of it and my thanks to all of them

  • Rajesh Mouli (My Manager)
  • Roxy (Manager)
  • Shahid Banday (Nice and Cool guy to work with)
  • Vijay Nats (Cool guy)
  • Santosh (Graphic Designer – I was bugging him a lot)
  • Nagammai ( One who kept searching for Bugs all the time)
  • Hari (Tech Lead guidance for the integration part)
  • Edwin (BizTalk expert)
  • Sayee ( Directory – IT)
  • There are others to whom I am not directly worked (UI designer, Project sponser, CEO, Operations head, Interns….)
  • Senthil (Sanjay) & Ramesh – Who helped me in the Initial stage of the project when I got struck up with ASP.NET issues; they thought me some core concepts of ASP.NET.

Here is the link                 

Categories: SharePoint

SilverLight 2.0 and SharePoint

November 28, 2008 4 comments

I have started to explore the Silverlight 2.0 & LINQ after a break. Planning to post all my learning with regard to it. To start off with let’s see how to configure Silverlight 2.0 application work in SharePoint 2007.

    I was searching for some article regarding this topic and almost all
the links I found were with option of deploying the SilverLight as web part. I wanted to go with the other way of doing it. With this post I will wrap up to configuration part and in the next post we will see a simple example of SilverLight 2.0. To save typing I am going to copy the part of text from Legend Late Patrick’s Blog and will edit only the broken links, Patrick’s article was written when Silverlight was in beta 2 so few links gone out dated.

  1. Of course, you need to download the Silverlight 2 plug-in. This can be done from here.
  2. Have service pack 1 installed for WSS 3.0 or service pack 1 for MOSS 2007. This adds support for what you’re going to do with AJAX and Silverlight 2. Note that a number of the samples assume you have a publishing site up and running and therefore work only in a MOSS 2007 scenario.
  3. You’ll need .NET 3.5 on your server. The System.Web.Extensions.dll is required server-side. The redistributable .NET 3.5 framework can be downloaded from here.
  4. The .NET 3.5 framework must be extended with the System.Web.Silverlight.dll. This DLL is part of the Microsoft Silverlight 2 Software Development Kit and if you only download this, you’ll have to make sure that the System.Web.Silverlight.dll is available as an assembly in the Global Assembly Cache (GAC).
  5. Install Silverlight Tools for Visual Studio 2008 SP1 this add-on for Visual Studio 2008 SP1 or Visual Web Developer Express with SP1 will install the necessary Visual Studio updates, Silverlight project templates, developer runtime, and SDK. For additional information read the overview and the Silverlight 2 Readme Notes.
  6. Install Microsoft Expression Blend 2 and then install Microsoft Expression Blend 2 Service Pack 1 Expression Blend 2 along with Service Pack 1 allows designers to graphically create UI’s for Silverlight 2 applications.
  7. You need all of the .NET 3.5 (AJAX) + Silverlight configurations in the web.config. A good approach is to create in Visual Studio 2008 a Silverlight application project with a Web site to test out the XAML. The Web site includes a web.config that is ready and that contains the sections you have to copy to the web.config of the IIS Web application that hosts your SharePoint sites on which you want to try out the BluePrint samples. On the plane going back home from the conference in Seattle, I have made a screencast that illustrates this. It explains all of the steps. Download the zip containing it from here.
  8. Last but also important thing (also illustrated in the screencast) is that you have to register the .xap extension as a MIME type (application/x-silverlight-app) for the IIS Web application. Don’t forget that one!
  9. Here is another link that gives all in one shot.
  10. Download the sample web.config from here.
  11. This link gives you the steps for the same and few samples.
  12. Do all in one shot for the web.config here is the link

ActivationDependencies – Feature Scope

October 13, 2008 Leave a comment

    This weekend I got in to an Issue while helping a friend of mine. Some back ground about the issue.

    We have three features. Say for example.

  • FieldsX Scoped at Site.
  • ContentTypeX Scoped at Site.
  • ListX Scoped at Web.

ListX has its Dependency as ContentTypeX; ContentTypeX has its dependency as FieldsX.

I installed all the features, and when I try to activate the ListX feature I get an Error

           “Dependency feature ‘ContentTypeX‘ (id:GUID of ContentTypeX) for feature ‘ListX‘ (id:Guid of ListX) is not activated at this scope.”

    I changed ListX Scope to Site and activated the Feature, thinking that ActivationDependencies should be  between Features of Same scope, though it worked but that is not the case, because we can have Cross Scoped Dependencies as well provided we follow the rule of thumb mentioned in this Article.

“Extract from the Above Article…If the Feature that is depended upon is not activated, activation of the depending Feature fails. For example,if a Web site–scoped Feature depends on a site collection–scoped Feature that is not activated, provisioning of the Web site Feature (or of a site definition that contains such a Web site Feature) fails.

Manage Data Connection Files – InfoPath 2007 – Universal Data Connection

September 27, 2008 4 comments

    After going through this article, I got to know the power of Universal Data Connection UDC files in the InfoPath forms and how it helps during multiple deployment and migration scenarios. But what I missed to note is How do I get a Data Connection File from the Central Administration Site – > Manage Data Connection. This article describes how to do that. Also below I have highlighted the points that you need to get a file from Data Connection File from the Central Administration. (Managing the Data Connection Files centrally) with few quick screen clips that will help you.

    Let’s assume that you have created an InfoPath form as per this article. To recap you have added the data connection from the Data Connection Library of your SharePoint site, while doing so you will find an option called Connection Options. Click on the Connection Options and Select the option centrally managed connection Library, by this what you mean is that you are asking the Form template to get the connection file from the Centrally Managed Connection Files from Central admin.

    

    From now on your InfoPath form template will get the Connection Setting from the UDC File of the Central Admin. In case if you want to make any changes to the connection setting all you have to do is to change the Connection File present in the Central Administration Server.

 

References:

http://blogs.msdn.com/infopath/archive/2006/10/02/Data-Connections-in-Browser-Forms.aspx

http://msdn.microsoft.com/en-us/library/ms772101.aspx

http://www.infopathdev.com/forums/t/7653.aspx

http://msdn.microsoft.com/en-us/library/bb267335.aspx

SPPropertyBag

September 23, 2008 Leave a comment

          SPWeb object of SharePoint exposes a Field called Properties which is of type SPPropertyBag a sub class of StringDictionaryIt allows you to store Key value String Data within a web

Below are some quick points that will help you in using it.

  • As Mentioned Before it is a StringDictionary, which can only store String values.
  • You need to call the Update() method of the SPWeb.Properties.Update() to persist the value.
  • Same applies while you are removing a value from it.
  • Below code gives you a quick start.
  • If you want to manage this through UI. Refer this link. It’s a fantastic option you will love.

 using (SPSite oSite = new SPSite(http://mysite))
              {

         using (SPWeb oWeb = oSite.RootWeb)

         {
            //Add an Item to Bag

            oWeb.Properties.Add(“Your Key”,“Your Value”);
            //Be sure to Call the Update Method on Properties

            //If you miss this your value wont get Presisted for the

            //Next Run
            oWeb.Properties.Update();

            // To Reterive the Value

            String sMyItem = oWeb.Properties[“SPPropertyBag”];


            //Remove the Value

            //Be sure to Call the Update Method on Properties
            //If you miss this your value wont get Presisted for the

            //Next Run
            oWeb.Properties.Remove(“SPPropertyBag”);
            oWeb.Properties.Update();

         }
       }

Categories: SharePoint Tags: ,

STSADM Tool Reference

September 20, 2008 Leave a comment

Adding Server Side code to the Publishing Page Layouts – PageParserPaths

September 20, 2008 Leave a comment

    This article is to give a brief introduction for the Functionality of PageParserPaths tag in the Web.Config file of SharePoint. (It serves as a Reference for me In future and for someone out there who is  search  for a similar implementation).

    All the Layout pages in the SharePoint 2007 are derived from the class Microsoft.SharePoint.Publishing.PublishingLayoutPage .

This works very well for most of the cases and customization. But there will be very chance that for some reason you want the actual page instance to have a completely different class. Might be a case where you are using a third part tool or a component. In this case if you try to change the base class or put in some custom server side code in to the page layout file, SharePoint will complain you with a parser error.

        This Article describes the approach that will help you to put in the code for the layout pages. It works like charm.

        On additions to the above article is that in case if you are concerned about allowing all the pages having the server code as defined by below tag

<PageParserPath VirtualPath=”/_layouts/masterpage/*” CompilationMode=”Auto” AllowServerSideScript=”true”

IncludeSubFolders=”true”/>

You can make a particular page to have server side code as below

<PageParserPath VirtualPath=”/_layouts/masterpage/yourpage.aspx” CompilationMode=”Auto” AllowServerSideScript=”true”

IncludeSubFolders=”true”/>

While configuring a single page, make sure that you remove the attribute IncludeSubFolders=”true”. If you leave this tag as it is, all you are going to get is a plain HTTP 500 error code which is hard to debug. Validation that SharePoint makes here is IncludeSubFolders=”true” can be present only if the attribute VirtualPath ends with /*.

SharePoint Permission Dependency Chart

September 20, 2008 Leave a comment

This Image speaks for Itself.. If you want more Visit this link.

SharePoint Tools

September 20, 2008 Leave a comment

Below is the List of the SharePoint tools that will boost your productivity. I love them and use them. You too will…

Writing CAML Queries directly in C#.

CAML.NET     http://codeplex.com/camldotnet

Custom STSADM command and Command to Get the Content Type Xml Schema

CUSTOM STSADM http://www.andrewconnell.com/blog/articles/MossStsadmWcmCommands.aspx

SQL like CAML Queries  – My Favorite one

CAML Queries in SQL Syntax http://www.ideseg.com/SharePointYetAnotherCAMLQueryTool2.aspx

SPDisposeCheck 

SPDisposeCheck is a tool to help SharePoint Developers follow memory management best practices when using the SharePoint API with IDisposable objects including SPSite and SPWeb.  More Information about the tool here .

http://code.msdn.microsoft.com/SPDisposeCheck