Aug 20, 2011

Missed Webparts Information while migration from Moss to SharePoint 2010


In this post I am going to explain you how to get the missed webparts information after placing moss content database to SharePoint 2010 while upgrading process. This is a very useful information about the missed webparts when you are working with the migration process.

In Powershell when you run the Test-SPContenetDataBase cmdlet to check the readiness of the moss content database against the created 2010 site , you will get report with all missed setupfiles, missed webparts etc etc..there you will be provided with the ID of the webpart.The below query gives you the full information of the webpart such as the page where it resides, the status of the webpart like whether it is included in the page or not etc...

Here is the sql query to get more information of the webpart by providing its type id at highlighted place

Select SiteId, AllDocs.DirName as SiteUrl, AllDocs.LeafName as PageUrl, AllDocs.DirName + '/' + AllDocs.LeafName as Url, WebParts.tp_DisplayName as DisplayName, WebParts.tp_IsIncluded as Included,WebParts.tp_Deleted as Deleted FROM [dbo].[AllDocs] INNER JOIN [dbo].[WebParts] ON [AllDocs].Id = [WebParts].[tp_PageUrlID] Where [WebParts].[tp_WebPartTypeId] ='44c7b3b5-185f-c771-94fc-fcfdc52ceed5' Order By Url

The output will be like this

Happy reading..

Reference Link

Aug 12, 2011

Meta Data Management Sharepoint 2010-Part1

Hi Guys

 In this post I am going to explain you a small concept of managing the meta data in sharepoint 2010. Here I will show a demo of the auto suggest option for a column using the metadata. In Sharepoint 2010 there is a lot of scope to managing the data/content when compared to moss.

The Sharepoint meta data hierarchy is organized in this way

• TermStore
• Group
• Termset and
• Term

To say In brief The Term Store contain Groups and the Groups contain Term Sets and the Term Sets conatin terms.The terms can also contain other terms.

Now I am creating the above mentioned by using the Term Store Management tool from Site Actions page ,follow the below steps
Go Site Actions—Site settingsàSelect Term Store Management under Site Administration section.

If you encounter this error, you need to create the Metadata service. If you already have check whether it is started or not.
Here I am going to create a new Managed Meta Data Service
Go to Central AdminàManage Service Applications under Application Management Section
Select Manage Service Applications

Then select New in Ribbonàthen select Managed Meta Data service.

Give a name (Here I am giving Managed Meta Data Service)
Specify the Database server; Select the New Application pool (which is recommended) on which this service will run. Give the name and specify the service account and then click ok.

Make sure that the Managed Meta Data Web service in start mode.
To check this
Central adminàManage services on server under system settings section and select the Managed meta data web service and start if it is stopped

Now Open the Termset
Select the Managed Meta Service and right click on that to create a group.

I have given name as Colors-Group.
Give the description and specify the group manager and contributor accounts

Here the group managers are the users who have contribute permission to add the users in to contributor group.
The contributors are the users, they can edit the termsests and terms in a group.
Now Create a Termset under this Group

Give Name as Color-Termset

Fill other information Description, owner, contact, stakeholders etc...See the description on left side to more information about these things and click Save.
Now create terms under this Termset

Give Red  and Fill other details in the right pane. Like this create more terms names.

So with this the Group, Termset and terms creation is over.  

How to use these Termsests in our Lists?
Here I am going to use this metadata for a column in my list.
I have a list called products with the columns Product name, Cost and Warranty. I am going to create a new column called ProductColor which will use this (the above created) metadata.
Go to List settings (or from ribbon) select create column
Give title as Product Color and select Type as Managed Metadata

See the continuation to this post Meta Data Management Sharepoint 2010-Part2

Meta Data Management Sharepoint 2010-Part2

In Colum settings You can choose multiple value field to allow multiple terms in to this column and In Display Format section you can select to display the label or the entire path of the term.
continuation to my previous post Meta Data Management Sharepoint 2010-Part1
And in Term Settings Section select the Color-Term set (which we created earlier) as shown below.

Give a Default Value if you need.
Now add an item in to the Products list

When you type ‘g’ it will give you the suggestions from the Color-TermSet like Gray , Green etc. This  field will not allow other values.

Here in this post I have created the terms in the site directly, instead we can import from a csv file or we can write the code to add the termsests.
And this is a small usage of metadata management, there are lot of features we can implement in sharepoint 2010 by managing the data.
Enjoy Reading..


Aug 10, 2011

TryGetList method in 2010 OM


 Recently I noticed a method in 2010 object model. Generally when we writing the code to get a list from the web, we will get  the error if the list does not exist. For that we will loop through the lists collection and checks whether it exists or not

           SPSite oSite = SPContext.Current.Site;
            SPWeb oWeb = oSite.OpenWeb();
            SPList myList = oWeb.Lists["XYZ"];

If there is no list with the name XYZ, it throughs null reference exception. To avoid this,In 2010 OM a new method is introduced in the SPListCollection .Simply use this method instead of looping all the lists and check its existance

            SPList myList = oWeb.Lists.TryGetList("XYZ");
            if (myList != null)
               //your operations