Sharep10nt

All About SharePoint 2010

  Home  |   Contact  |   Syndication    |   Login
  19 Posts | 0 Stories | 61 Comments | 0 Trackbacks

News

Acquired MCPD : SharePoint 2010 Developer

Share on Facebook

Twitter







Archives

Post Categories

Tuesday, December 14, 2010 #

What is Localization/Multilingual and Globalization?
The term "Localization" defined as "Process of translating resources for a specific culture/languages", where "Globalization" defined "Process of designing applications that can adapt to different cultures/languages". When we publish a site for different regions then it'll be great if the site content is displayed in that regional language. SharePoint provides Language Packs which can be downloaded and installed from Microsoft Site. but the limitation in this is only the SharePoint site labels/text will be displayed in selected language and the user defined contents won't be translated by SharePoint.

How to enable Localization in SharePoint 2010?
Assume we develop a webpart that has a registration form. A user from German wish to register and he needs the form in German/Dutch language. Even though Dutch language pack installed and enabled in SharePoint, the webpart text won't be translated/displayed in German. So how to make webpart that can adapt different languages. For those working in .Net platform knows it can be done with Resource files (.resx). Resource files are nothing but Key/Value Pair defined XML format files.

Here the steps to create a Webpart that detects the selected language in SharePoint and display contents that fetched from Resource Files.
 

  1. Open Visual Studio 2010 -> File -> New -> Project
     
  2. Select [Template] Visual C# -> SharePoint -> 2010 [Framework] .Net Framework 3.5 [Project] -> Empty SharePoint 2010 Project. Name of the Project : vsProject
    New Empty SharePoint Project

     
  3. In the SharePoint Customization Wizard, enter the URL of the local site (http://vsnet/) and select Deploy as a farm solution.
    Deploy as Farm Solution

     
  4. Create Resource Files
    1. Resource files should be present in SharePoint Root "Resources" folder. In Solution Explorer select project "vsProject", right click and select Add -> SharePoint Mapped Folder.
      Add SharePoint Mapped Folders

       
    2. In the Window select "Resources" Folder.
      Add "Resources" Folder

       
    3. Now an empty "Resources" folder is created inside SharePoint project. Any files placed inside this folder will be copied to SharePoint Root (14)\Resources Folder while deploying.
       
    4. Right click on Resources folder and select Add -> New Folder -> vsProject [Folder Name]. Always create folder and place files. This will avoid the files getting deleted when any SharePoint service pack installed.
    5. Right click on Newly created folder [vsProject] and select New -> New Item.
       
    6. In the New Item window select [Template] Visual C# -> General -> Resources File -> Name the files as "vsProject.resx". This is for default language which in English (LCID : 1033).
      New Resource File

       
    7. Select vsProject.resx file, right click and Open.
       
    8. Add Name and Value pairs as required.
      Add Name/Value Pairs

       
    9. Repeat Step "f." and provide name "vsProject.de-DE.resx". This file is for Dutch language. Refer the end of the article to get full list.
      Add New Resource File

       
    10. Open "vsProject.de-DE.resx" and enter the same Name as in vsProject.resx and provide value in German Language. Here "Comment" Field is optional.
      German/Dutch Language Name/Value Pair

       
  5. Create Webpart
    The Resource file is ready to use and now need to create Web part that get value from those resource files.
    1. Right Click on the Project "vsProject" and "Add -> New Item"
    2. Select "Visual C# -> SharePoint -> 2010 -> Web Part". Name : "LocalizationDemo".
      Add New Web Part

       
    3. Copy paste the below code inside LocalizationDemo class or just refer it.
      protected override void CreateChildControls()
      {
        int intLCID = System.Threading.Thread.CurrentThread.CurrentUICulture.LCID;
        Label lblWelcomeText = new Label();
        lblWelcomeText.Text =
      "Value : " + getLocalizedValue("WelcomeText", intLCID);
        this.Controls.Add(lblWelcomeText);
      }


      public string getLocalizedValue(string strInput, int intLCID)
      {
        // Function to retreive specified Language Variation Value
        string strLocalizedValue = "";

        strLocalizedValue = Microsoft.SharePoint.Utilities.
      SPUtility.GetLocalizedString("$Resources: " + strInput, "vsProject\\vsProject", (uint)intLCID);

        return
      strLocalizedValue;
      }

       
    4. Save all files, Build and Deploy. The solution will be deployed in SharePoint and ready to use.
       
    5. Open the SharePoint site any page and click "Edit" Icon on top (or Site Actions -> Edit page).
       
    6. Select "Editing Tools [Tab] -> Insert [Tab] -> Web Part -> Custom [Categories] -> LocalizationDemo -> Add [Button]".
      Add the Web Part to SharePoint Page

       
    7. Once the webpart added to the page select "Save and close" Icon.
  6. Now it'll show the content in default language (English - 1033). Select "User Menu" at top right and select "Select Display Language -> Deutsch".
  7. The page will be refreshed the Web Part will show the German Content which specified in the resource file.
    Localization English and After changing language to Deutsch

Reference List - Locale ID (LCID) and Language

 

HTTP

LCID

Language

 

1033

Default

af

1078

Afrikaans

sq

1052

Albanian

ar-sa

1025

Arabic(Saudi Arabia)

ar-iq

2049

Arabic(Iraq)

ar-eg

3073

Arabic(Egypt)

ar-ly

4097

Arabic(Libya)

ar-dz

5121

Arabic(Algeria)

ar-ma

6145

Arabic(Morocco)

ar-tn

7169

Arabic(Tunisia)

ar-om

8193

Arabic(Oman)

ar-ye

9217

Arabic(Yemen)

ar-sy

10241

Arabic(Syria)

ar-jo

11265

Arabic(Jordan)

ar-lb

12289

Arabic(Lebanon)

ar-kw

13313

Arabic(Kuwait)

ar-ae

14337

Arabic(U.A.E.)

ar-bh

15361

Arabic(Bahrain)

ar-qa

16385

Arabic(Qatar)

eu

1069

Basque

bg

1026

Bulgarian

be

1059

Belarusian

ca

1027

Catalan

zh-tw

1028

Chinese(Taiwan)

zh-cn

2052

Chinese(PRC)

zh-hk

3076

Chinese(Hong Kong)

zh-sg

4100

Chinese(Singapore)

hr

1050

Croatian

cs

1029

Czech

da

1030

Danish

n

1043

Dutch(Standard)

nl-be

2067

Dutch(Belgian)

en

9

English

en-us

1033

English(United States)

en-gb

2057

English(British)

en-au

3081

English(Australian)

en-ca

4105

English(Canadian)

en-nz

5129

English(New Zealand)

en-ie

6153

English(Ireland)

en-za

7177

English(South Africa)

en-jm

8201

English(Jamaica)

en

9225

English(Caribbean)

en-bz

10249

English(Belize)

en-tt

11273

English(Trinidad)

et

1061

Estonian

fo

1080

Faeroese

fa

1065

Farsi

fi

1035

Finnish

fr

1036

French(Standard)

fr-be

2060

French(Belgian)

fr-ca

3084

French(Canadian)

fr-ch

4108

French(Swiss)

fr-lu

5132

French(Luxembourg)

mk

1071

FYRO Macedonian

gd

1084

Gaelic(Scots)

gd-ie

2108

Gaelic(Irish)

de

1031

German(Standard)

de-ch

2055

German(Swiss)

de-at

3079

German(Austrian)

de-lu

4103

German(Luxembourg)

de-li

5127

German(Liechtenstein)

e

1032

Greek

he

1037

Hebrew

hi

1081

Hindi

hu

1038

Hungarian

is

1039

Icelandic

in

1057

Indonesian

it

1040

Italian(Standard)

it-ch

2064

Italian(Swiss)

ja

1041

Japanese

ko

1042

Korean

ko

2066

Korean(Johab)

lv

1062

Latvian

lt

1063

Lithuanian

ms

1086

Malaysian

mt

1082

Maltese

no

1044

Norwegian(Bokmal)

no

2068

Norwegian(Nynorsk)

p

1045

Polish

pt-br

1046

Portuguese(Brazil)

pt

2070

Portuguese(Portugal)

rm

1047

Rhaeto-Romanic

ro

1048

Romanian

ro-mo

2072

Romanian(Moldavia)

ru

1049

Russian

ru-mo

2073

Russian(Moldavia)

sz

1083

Sami(Lappish)

sr

3098

Serbian(Cyrillic)

sr

2074

Serbian(Latin)

sk

1051

Slovak

s

1060

Slovenian

sb

1070

Sorbian

es

1034

Spanish(Spain - Traditional Sort)

es-mx

2058

Spanish(Mexican)

es

3082

Spanish(Spain - Modern Sort)

es-gt

4106

Spanish(Guatemala)

es-cr

5130

Spanish(Costa Rica)

es-pa

6154

Spanish(Panama)

es-do

7178

Spanish(Dominican Republic)

es-ve

8202

Spanish(Venezuela)

es-co

9226

Spanish(Colombia)

es-pe

10250

Spanish(Peru)

es-ar

11274

Spanish(Argentina)

es-ec

12298

Spanish(Ecuador)

es-c

13322

Spanish(Chile)

es-uy

14346

Spanish(Uruguay)

es-py

15370

Spanish(Paraguay)

es-bo

16394

Spanish(Bolivia)

es-sv

17418

Spanish(El Salvador)

es-hn

18442

Spanish(Honduras)

es-ni

19466

Spanish(Nicaragua)

es-pr

20490

Spanish(Puerto Rico)

sx

1072

Sutu

sv

1053

Swedish

sv-fi

2077

Swedish(Finland)

th

1054

Thai

ts

1073

Tsonga

tn

1074

Tswana

tr

1055

Turkish

uk

1058

Ukrainian

ur

1056

Urdu

ve

1075

Venda

vi

1066

Vietnamese

xh

1076

Xhosa

ji

1085

Yiddish

zu

1077

Zulu


Thursday, December 09, 2010 #

What is ULS in SharePoint 2010?
ULS stands for Unified Logging Service which captures and writes Exceptions/Logs in Log File(A Plain Text File with .log extension). SharePoint logs Each and every exceptions with ULS. SharePoint Administrators should know ULS and it's very useful when anything goes wrong. but when you ask any SharePoint 2007 Administrator to check log file then most of them will Kill you. Because read and understand the log file is not so easy. Imagine open a plain text file of 20 MB in NotePad and go thru line by line.

Now Microsoft developed a tool "ULS Viewer" to view those Log files in easily readable format. This tools also helps to filter events based on exception priority. You can read on this blog to know in details about ULS Viewer .

Where to get ULS Viewer?
ULS Viewer is developed by Microsoft and available to download for free. URL : http://code.msdn.microsoft.com/ULSViewer/Release/ProjectReleases.aspx?ReleaseId=3308
Note: Eventhought this tool developed by Microsoft, it's not supported by Microsoft. Means you can't support for this tool from Microsoft and use it on your own Risk. By the way what's the risk in viewing Log Files?!

How to use ULS in SharePoint 2010 Custom Code?
ULS can be extended to use in user solutions to log exceptions. In Detail, Developer can use ULS to log his own application errors and exceptions on SharePoint Log files. So now all in Single Place (That's why it's called "Unified Logging"). Well in this article I am going to use Waldek's Code (Reference Link). However the article is core and am writing container for that (Basically how to implement the code in Detail). Let's see the steps.

  1. Open Visual Studio 2010 -> File -> New Project -> Visual C# -> Windows -> Class Library -> Name : ULSLogger (Make sure you've selected .net Framework 3.5)
    Create Class Library Project


     
  2. In Solution Explorer Panel, Rename the Class1.cs to LoggingService.cs

     
  3. Right Click on References -> Add Reference -> Under .Net tab select "Microsoft.SharePoint"
    Add Microsoft.SharePoint Reference


     
  4. Right Click on the Project -> Properties. Select "Signing" Tab -> Check "Sign the Assembly".

     
  5. In the below drop down select <New> and enter "ULSLogger", uncheck the "Protect my key with a Password" option.
     
  6. Now copy the below code and paste. (Or Just refer.. :-) )

    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using Microsoft.SharePoint;
    using Microsoft.SharePoint.Administration;
    using System.Runtime.InteropServices;
    namespace ULSLogger
    {
    public class LoggingService : SPDiagnosticsServiceBase
    {
    public static string vsDiagnosticAreaName = "Venkats SharePoint Logging Service";
    public static string CategoryName = "vsProject";
    public static uint uintEventID = 700; // Event ID
    private static LoggingService _Current;
    public static LoggingService Current
    {
     get
      {
       if (_Current == null)
        {
          _Current =
    new LoggingService();
        }
       return _Current;
      }
    }
    private LoggingService()
    :
    base("Venkats SharePoint Logging Service", SPFarm.Local)
    {}
    protected override IEnumerable<SPDiagnosticsArea> ProvideAreas()
    {
    List<SPDiagnosticsArea> areas = new List<SPDiagnosticsArea>
     {
      new SPDiagnosticsArea(vsDiagnosticAreaName, new List<SPDiagnosticsCategory>
       {
        new SPDiagnosticsCategory(CategoryName, TraceSeverity.Medium, EventSeverity.Error)
       })
      };
    return areas;
    }
    public static string LogErrorInULS(string errorMessage)
    {
    string strExecutionResult = "Message Not Logged in ULS. ";
    try
     
    {
      SPDiagnosticsCategory category = LoggingService.Current.Areas[vsDiagnosticAreaName].Categories[CategoryName];
      LoggingService.Current.WriteTrace(uintEventID, category, TraceSeverity.Unexpected, errorMessage);
      strExecutionResult =
    "Message Logged";
    }
    catch (Exception ex)
    {
     strExecutionResult += ex.Message;
    }
    return strExecutionResult;
    }
    public static string LogErrorInULS(string errorMessage, TraceSeverity tsSeverity)
    {
    string strExecutionResult = "Message Not Logged in ULS. ";
    try
     {
     
    SPDiagnosticsCategory category = LoggingService.Current.Areas[vsDiagnosticAreaName].Categories[CategoryName];
     LoggingService.Current.WriteTrace(uintEventID, category, tsSeverity, errorMessage);
     strExecutionResult =
    "Message Logged";
     }
    catch (Exception ex)
     {
      strExecutionResult += ex.Message;
      }
    return strExecutionResult;
     }
    }
    }

     
  7. Just build the solution and it's ready to use now.

This ULS solution can be used in SharePoint Webparts or Console Application. Lets see how to use it in a Console Application.
SharePoint Server 2010 must be installed in the same Server or the application must be hosted in SharPoint Server 2010 environment. The console application must be set to "x64" Platform target.
 

  1. Create a New Console Application. (Visual Studio -> File -> New Project -> C# -> Windows -> Console Application)
  2. Right Click on References -> Add Reference -> Under .Net tab select "Microsoft.SharePoint"
  3. Open Program.cs add "using Microsoft.SharePoint.Administration;"
  4. Right Click on References -> Add Reference -> Under "Browse" tab select the "ULSLogger.dll" which we created first. (Path : ULSLogger\ULSLogger\bin\Debug\)
  5. Right Click on Project -> Properties -> Select "Build" Tab -> Under "Platform Target" option select "x64".
  6. Open the Program.cs and paste the below code.

    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using Microsoft.SharePoint.Administration;
    using ULSLogger;

    namespace ULSLoggerClient
    {

      class Program
      {
       static void Main(string[] args)
        {

         Console.WriteLine("ULS Logging Started.");

         string strResult = LoggingService.LogErrorInULS("My Application is Working Fine.");
         Console.WriteLine("ULS Logging Info. Result : " + strResult);

         string strResult = LoggingService.LogErrorInULS("My Application got an Exception.", TraceSeverity.High);
         Console.WriteLine("ULS Logging Waring Result : " + strResult);

         Console.WriteLine("ULS Logging Completed.");
         Console.ReadLine();
        }
      }
    }


     
  7. Just build the solution and execute. It'll log the message on the log file. Make sure you are using Farm Administrator User ID.
    ULS Logging Console Application


     

You can play with Message and TraceSeverity as required.
Now Open ULS Viewer(Read Second section of this article to get ULS Viewer) -> File -> Open From -> ULS -> Select First Option to open the default ULS Log.
 

Select ULS Log File



It's Uls RealTime and will show all log entries in readable table format. Right Click on a row and select "Filter By This Item". Select "Event ID" and enter value "700" that we used in the application.
 

ULS Log Viewer - Log Filter



Click Ok and now you'll see the Exceptions/Logs which logged by our application. SharePoint by default log each and every exceptions on ULS so it'll take couple of minutes to list all Exceptions. See the Status bar on ULS Viewer. If it's "uls Running" then it's still reading the Logs to display. Provide your Filters and wait for few minutes.
 

ULS Log Viewer



If you want to see High Priority Messages only then Click Icons except Red Cross Icon on the Toolbar. The tooltip will tell what's the icons used for.

 


Thursday, December 02, 2010 #

I got a question in MSDN forum that how to add a SharePoint document property in respective document's footer and it should be available to all new documents. It's really interesting and started R&D on this. Lets see how to insert document property in header/footer.

How to use SharePoint document property inside Document's Header/Footer?
Here the steps on creating document library and update the document template.

  1. First I'll create a Document Library named "Docs". If you already have document library then skip this step.
    New Document Library

  2. Lets create 2 more new columns(Phase, Level) which are document properties (Open Document Library -> Library Tools (Tab) -> Library (Tab) -> Create Column. Phase is choice field with some choice items and Level is Single line of Text.

  3. Open Document Library -> Library Tools (Tab) -> Library (Tab) -> Library Settings.

  4. Under General Settings -> Advanced Settings. Under Document Template Section select "(Edit Template)" link. (If you want to use same template for different libraries then save the document in site assets or central library and provide the path here.) It'll open new empty document in Microsoft Word.
    Document Template

  5. In Microsoft Word Click "Insert" tab -> Header. Select a header design as required. Remove elements in Header which are not required. Place the cursor on Header area and select "Insert" tab -> Quick Parts in Text Section -> Document Property -> Phase. Here it'll list all document properties including fields available in the same SharePoint library. Same way insert "Level" Property too.
    Edit Document Template


    After inserting all the proerties, document is ready to go back to SharePoint.

    Document Template after adding Properties

  6. Save the document and exit from MS Word. Return to the SharePoint library settings Window and click "Ok" to save the changes.

  7. Now the library is ready with required template. Open the Document library -> Library Tools (Tab) -> Documents (Tab) -> New Document -> New Document. It'll show warning and just click Ok. Microsoft Word will be opened with the specified template.
    New Document based on Template

    Add content and just save with proper name. That's it!

Rating is a new feature introduced in SharePoint 2010 that can be added to any SharePoint List/Library. It helps users to evaluate and authors to get feedback. In SharePoint 2007, we have write code and deploy it as feature for rating.

How to enable Rating in SharePoint 2010?
It's very straight forward to enable rating in SharePoint 2010 lists.

  1. First let's create a Custom list named "Search Engines". If you already have list/library then you can skip this.
    New Custom List

     
  2. Once created, open the list select "List Tools" Tab -> List Tab -> List Settings.
  3. Under General Settings select "Rating Settings".
    Rating Settings

     
  4. Under Rating Settings section select "Yes" for "Allow items in this list to be rated?"
    Rating Settings

     
  5. Now a new field "Rating (0-5)" is added to the list. But the actual field name is "AverageRating". 
  6. Add some items in the list.

     
  7. When move mouse over the Rating field it'll show message to add rating. You can select the rating as required.

The same way, rating can be enabled on document libraries. Once rating given to an item then it'll be stored in database. Every user can provide their own rating and average will be displayed when viewing the list. There is a specific service("User Profile Service Application – Social Rating Synchronization Job") running behind to calculate the average of ratings.
 

User Profile Service Application – Social Rating Synchronization Job


This job executes every 1 hour by default. If required can be executed manualy by "Central Administration -> Monitoring -> Timer Jobs -> Review Job Definitions -> User Profile Service Application – Social Rating Synchronization Job -> Run Now" or change the "Recurring Schedule" as required.
 

User Profile Service Application – Social Rating Synchronization Job



Once the Synchronization job executed then users can see the average ratings (Blue Stars).
Before Synchronization Job execution.
 

List before synchronization



After Synchronization Job execution.
 

List After Synchronization

Move mouse over blue star ratings to know your Rating (only if you have already given rating).

Note: If a user giving rating which he already given, then his previous rating will be discarded and new selection only getting considered.

 


Wednesday, December 01, 2010 #

Language packs enable to view SharePoint site in other languages like Dutch, Spanish, etc. These language packs are available free to download from Microsoft site. Once it's installed and configured in SharePoint then users will get option to select those language and view the site in that language.

Where can I download SharePoint 2010 language packs?
Microsoft provides 40 different languages (including English) for SharePoint Foundation/Server 2010. Those language packs have the sharepoint site terms like Welcome, Site Actions, Recycle Bin in respective language.

Language Packs for SharePoint Foundation 2010 :
http://www.microsoft.com/downloads/en/details.aspx?FamilyID=646E311A-AAF3-4D30-B03C-2F3C70D19A22
Language Packs for SharePoint Server 2010 :
http://www.microsoft.com/downloads/en/details.aspx?FamilyID=046f16a9-4bce-4149-8679-223755560d54&displaylang=en
Note: These URLs were taken on 30th November 2010. if not available, then search "Language Packs for SharePoint 2010" in Google.

What I need to consider before installing language packs?
For SharePoint Foundation 2010 language pack can be downloaded and installed directly. But for SharePoint Server 2010, the SharePoint Foundation version language pack must be installed before SharePoint Server version. By default the download page will show English language pack and for each language the language packs should downloaded and installed seperately.

Installing languages won't translate the entire site content. It'll show only the site elements like label text, button text in selected language. Content entered in Content Editor Webpart or wiki pages content will be displayed in same language as feeded in even after changing site language. For Content translation, seperate third party application should be used.

How to install language packs and enable it on SharePoint 2010 sites?
Installing Language Pack and enabling on SharePoint site is very simple and straight-forward.

  1. In the download page, select the required language, click change button. Then download the Language pack exe file. The download page and installation wizard will be in it's respective language.

  2. Install the Foundation Version language pack and Server Version language pack.

  3. Once installed, navigate Central Administration -> Upgrade and Migration -> Check product and patch installation status.
    In that page all installed language packs will be listed. If the Install Status is "Installed" then SharePoint is ready to use those languages.
    Product and Patch installation status

  4. Open the SharePoint site -> Site Settings -> Site Administration -> Language Settings.
    Language Settings

  5. In Language Settings page, under alternate language(s) section select the language(s). Click Ok to Save the setting.
    Select Alternate Language(s)

  6. Now in Top Right Menu, a menu option getting displayed "Select Display Language" which has the enabled languages as submenu option.
    Select Display Language
  7. Select the language to view the site in that language.
    Site Settings in French



Tuesday, November 30, 2010 #

Document Set is a new feature introduced in SharePoint 2010 as part of content/document management. Document set helps to manage group of documents as a single entity. Actualy Document set is a content type that can be attached to any document library and make use of it's features.

Advantages of Document Sets
Consider a type "Project", each project has requirements document, project effort estimation spreadsheet, project plan presentation. To standardize the project management process, it's enforced to have all these documents for every project. In SharePoint 2007 it's not so easy to group different documents in same document library as each document is individual item. But this can be done within few minutes with Document sets feature. Documents sets will have Templates for each document, ie a predefined format document for review document, effort estimation, project plan presentation can be attached while defining this document set content type. Each library which uses this content type will get those document templates when user creates new document set.

Apart from these document sets can be versioned. It can have it's own customized Welcome page which is like home page for the project. Document Set content type basically inhertited from "Document" content type. Other content types also can be added if required. Workflows can be attached and few more options provided in SharePoint designer for document sets.

 

Document Sets Workflow Actions



How to enable Document Sets?
Document sets by default won't be enabled in SharePoint 2010. It's a feature and has to be enabled manualy. Then document sets Content type has to be customized (if required). After that it can be attached to Document libraries. First keep all project document templates (Requirements document, Effort Estimation, Project Plan Presentation) ready.
 

  1. Login to SharePoint 2010 site -> Site settings -> Site Administration -> Site Collection Features -> Document Sets -> Activate.
    Document Sets Feature

     
  2. Site Settings -> Galleries -> Site Content types -> Document Set Content Types -> Document Set.
    Document Sets Content Type

     
  3. Select Document Set Settings.
    Document Sets Content Type

     
  4. Under Default Content section select the templates. Click "Add new default content" to select and upload more template documents.
    Document Sets Default Documents

     
  5. Now we'll create new document library. If you want to attach to existing document library then skip this step.
    Document Sets - New Document Library

     
  6. Open the document library -> Library (Tab) -> Library Settings.
    Document Library Settings

     
  7. Under General Settings select Advanced Settings. We need to enable allow management of content types setting.
    Document Library Settings

     
  8. Under Content types Select Yes for "Allow management of content types?" and save/Click Ok.
    Allow Management of content types

     
  9. Now in the library settings page Content types section will be shown. Select "Add from existing site content types".
    Add Document Sets Content Type

     
  10. Under "Select Content types" section select "Document Set" and Add. Now click Ok.
    Add Document Sets Content Type

     
  11. In library settings -> Content types section -> Document sets -> Settings -> Name and description. Change name as "Project Plan".
    Rename Document Sets

     
  12. Open the document library -> Documents (Tab) -> New Document -> Project Plan.
    New Document Sets Item

     
  13. Provide a project name for eg. "Aqua" -> Ok.
    New Document Set

     
  14. Now a Project Plan Document set created with all default template documents. You'll be landed in Project Plan Welcome Page. :)
    Document Sets Welcome Page

     

To change Welcome page and other settings, check Document Sets Content type settings.

Note: Document sets is feature of Microsoft SharePoint Server 2010 (MSS 2010) and won't be available on SharePoint Foundation 2010.

 


Thursday, November 25, 2010 #

I've installed SharePoint 2010 and create first site collection. When I try to specify Target Audience for Announcements webpart in Home page via WebPart Properties, there is no "Target Audience" option. When I did google, articles which specifies how to set Target Audience for List. But that's not what I need. This article will explain how to get Target Audience for webpart in SharePoint 2010 sites.

How to specifiy Target Audience for Webpart in SharePoint 2010?
Well, It's obvious that free versions WSS 3.0/SharePoint Foundation 2010 won't provide Target Audience feature. SharePoint 2007/SharePoint Server 2010 is required for the same. I have MSS 2010 and still not getting Target Audience option for webparts, what to do? A service which determines Target Audience should be enabled and running. It's SharePoint User Profile Service that depends on "User Profile Synchronization Service". So first check the Services via Central Administration -> System Settings -> Manage Services on server.

Check the status of "User Profile Service" and "User Profile Synchronization Service" (This service required to compile audiences. If you have fixed no of users and don't want scheduled syncrhonization then later you can disable it). Check the SharePoint Server Search Service status. It must be started, if so then Start the above 2 specified services(UPS and UPSS).

Now we need to configure audiences in User Profile service application. Open Central Administration -> Application Management -> Manage Service Applications. Check status of "User Profile Service Application" and it should be "Started" (otherwise go to previous step and run User Profile Service). Now Click "User Profile Service Application" link. It'll open the user profile service application settings.

Select Configure Syncrhronization Connections and create new connection if required.

Configure Synchronization Connections
Create New Connection


Provide LDAP Connection details and click "Populate Containers" button to list all domain containers. Select "Domain -> Users" (or whichever container that has user details) Note: It'll take few minutes based on network traffic. Then click "Ok" to create the connection.

New Connection Settings


User Profile Synchronization service must be started otherwise it'll show error.
Error


If you've created new connection then open "Configure Synchronization Timer Job" and run it now.

How to create Target Audience in SharePoint 2010?
Central Adminstrion -> Application Management -> User Profile Service Application -> People -> Manage Audiences.
 
Manage Audiences


It'll show audiences if created already. Otherwise click New Audience -> specify name, description, owner.
 

Create Targer Audience


Select a option based on requirement (I chose "Satisfy any of the Rules"). Click Ok to go next page. Select Properties and select the property. Specify the value to compare. Now it'll show the Audience properties. Click "Compile Audience" link to validate AD Users and add if the details satisfy specified condition.

Create Targer Audience


Login to your SharePoint site and edit any webpart. It'll now show the option to specify Target Audience.

Wednesday, November 24, 2010 #

For Web Designers and Developers writing CSS code for elements is so time consuming. That too make changes in SharePoint Stylesheets(CSS) needs more patience. First have to make change in CSS, reset IIS(or Application Pool Recycle), clear browser cache/temp files and check. Even for one small change or entire CSS change the mentioned steps has to be done. Sometimes the changes won't reflect and makes little irritating. Many of us faced and facing this issue. Alternatively you can make changes with SharePoint Designer and preview changes. Again than requires make changes in CSS with SharePoint Designer and open with browser or Designer's Design view. Still it's not sufficient for me to complete CSS coding faster.

How to change SharePoint site controls design?
Assume we requested to change width of Quicklaunch bar in SharePoint 2010 Site. First we need to find the CSS class of Quicklaunch bar. Well for experts it's very easy because it's "ms-quickLaunch". But for newbie it's not so easy, He has to open the site in browser, click View -> Source, Search for text in Quicklaunch and determince the Div which has the exact text. Alternatively we can do the same with SharePoint Designer. After that we have to find which CSS has this class style definition. That's no so easy unless you have SharePoint Designer.

Quicklaunch is always visible and easy to edit/preview with SharePoint Designer. Take example of changing Title bar of Dialog window. Can you make changes with SharePoint Designer? As far as I know it's not possible.

How to change and preview CSS on the Fly?
When I got the requirement to change Dialog window style, I haven't suprised because I know the power of IE 8 Developer Tools. :-)
Lets see how to change CSS Styles without touching CSS files. Wondering how to make CSS change without editing CSS file? Let's see.. First open the site with IE8 and open the dialog(Click "Add New Announcement" link in Home Page or Site Actions -> More Options). Once the dialog came up Press F12 to get Developer Tools window. It'll take few seconds to load the HTML and CSS. In the Developer tools window click Arrow button (or Ctrl + B) and select the Title bar of dialog. It'll show Blue outline to show the element on focus.

Internet Explorer Developer Toolbar

Once the element selected the window will show exact HTML Code and CSS styles applied to it + CSS file which has the definition. In the CSS pane, double click on style (eg. Font-family:) and it'll become editable. Change it to "Arial" and enter. Now you can see the Title bar in "Arial" font. like this you can change any element style and see how it looks. Once you got the style what you want, click the CSS file name above top right in the CSS pane. It'll open the next tab which is "CSS" and shows the CSS file contents. In the drop down you can see the path of the CSS. Login to server and open the CSS with Notepad then make same changes. Once done save and reset IIS. That's It!

Like this you can change the look and feel of entire site easily.

Tuesday, November 23, 2010 #

Most of the time, I get question from new friends who work in other technologies that "SharePoint is for Content Management/WebSite Creation?". Well, it's common because SharePoint is sucessor of Microsoft Content Management Server (CMS) which dedicatedly used for Web Content Management. SharePoint Portal 2001 predominantly focus on Content Management feature, whereas the later releases came with more features. It's very easy to create Colloboration portal with SharePoint in Minutes where it requires couple of months to develop in .Net from scratch.

What extra I get in SharePoint?
Let me rephrase this question as "Apart from Content Management what else I can do with SharePoint?" It's not so simple to explain all features in few lines. SharePoint can be used as intranet portal where each teams can have their own sites that has their project related tasks, announcements, blogs, wikis and more.

I have thousands of documents/records. May I use SharePoint?
Yes. SharePoint can be used as document/records repository which typically called as Libraries. Many IT/Non-IT companies use SharePoint for KM(Knowledge Management). Even built-in/custom workflows can be attached to those libraries for review and approval process. Meta Data can be added to the libraries and can be enforced to maintain organization standards. The document libraries can be opened with Windows Explorer and copy/move/delete documents just like a windows folder. Even users can upload documents just by send mail to the configured site mail id with document as attachment.

SharePoint Workspace (formerly called as Microsoft Groove) allows to take copy of all documents to local PC(ie. Take content to offline). Users can update the documents and it can be synchronized when connect to the network. This avoids network connectivity all the time to access content.

I have huge content from different sources. May I use SharePoint to consolidate those data and available for search?
Yes. SharePoint can be used a search center and it has own search crawling process that reads data from SharePoint sites/external data sources and create indexes. The external sources can be shared folders(File Shares), Exchange public folders, Lotus Notes and even Internet websites. Most importantly security is ensured here. ie Users can see contents on which they have access.

I need to watch how my organization running. May I get help with SharePoint?
Yes. Business Intelligence is highly important for any business and SharePoint provides rich BI feature. CXOs can have their own Dashboards, Scorecards which has KPIs(Key Performance Indicators). KPIs are helpful to view the data with indicators rather as Numbers. SharePoint 2010 Business Intelligence features allows to get data from external sources like SAP, Siebel, DB2, SQL Server and display on SharePoint site. So all the required content is about just one click far. Even content can be written back to external sources (ie. Read and Write).

I need Wikipedia site for my organization. Can SharePoint help me?
Yes. SharePoint provides powerful Wiki feature that can be used from small organizations to large enterprises. Creating a New Wiki site and give access to all users won't take more than a hour.

I need to simulate Yahoo profiles for my organization. SharePoint has any feature for that?
Yes. SharePoint has User Profile site which can take details from LDAP and display in a single profile page. SharePoint site can be integrated with Communicator and users can search other users, know their presence, communicate with them. SharePoint 2010 provides social networking features like activity feeds, Tags and Notes.

I need a site for our Helpdesk team to manage Issues. How can SharePoint help?
SharePoint provides the feasibility to install custom Application Templates which are available on Microsoft site to download. With Help Desk site template, SharePoint provides rich Helpdesk site features for helpdesk representatives to manage user issues. Managers can view helpdesk representatives response time and other metrics as required.

Download SharePoint 2010 Application Templates : http://techsolutions.net/Blog/tabid/65/EntryId/17/Fab-40-Templates-for-MOSS-2010.aspx
Download SharePoint 2007/WSS 3.0 Application Templates : http://www.microsoft.com/downloads/en/details.aspx?FamilyID=aae4cb5a-91d2-4f1b-9a45-3bb894e218f8&displaylang=en


Sandbox solution is a new feature introduced in SharePoint 2010. It's a secured wrapper around webparts and other elements with limitations. There is no thumb rule that every webpart in SharePoint 2010 belongs to Sandbox Solution. But it's recommended to develop webparts with Sandbox solution. It allows administrators to monitor the solutions and control as required. SharePoint Site Collection administrators can view the resource utilization of each solution and can block if it consumes too much resources. Usually when sites working slow, developers complain the server is slow whereas site/server administrators blame on Develepor code/solutions. Now Microsoft put a Full Stop to that. :)

Technically speaking SharePoint solutions run in seperate worker processes and not in w3wp.exe. So It doesn't require IIS Reset or Application Pool Recycling. Without disturbing the SharePoint site, Sandbox solutions can be deployed. Only thing while deploying new version of Sandbox solution over existing solution, SharePoint will display No Solution found error in Sandbox Webparts on the page. However within seconds sandbox solutions getting deployed and it'll start working. In SharePoint 2007, only farm administrators can install/deploy developer solutions. But Now site collection administrators can deploy solutions with web based interface. This reduces the dependency of Farm Administrator and improves rapid deployment.

Sandbox Processes
Here the processes which required for Sandbox solutions.
  1. SPUCWorkerprocess.exe - Sandbox Worker process service which is a Seperate Service Application which actually executes Sandbox code. It should be started in every farm to use Sandbox solutions.

  2. SPUCWorkerProcessProxy.exe - Sandbox Worker process proxy which is working as a proxy for Worker process and takes care of Sandbox code execution. It can also serve to other farms if configured. Basically it helps site administrator for load balancing.

  3. SPUCHostService.exe - Sandbox User Code Service takes care of user code in Sandbox amd it can be started in the farms where to use Sandbox solutions.
Sandbox Limitations
As I said before, Sandbox is a secured wrapper and it has restrictions on code to run in SharePoint environment. Few Key limitations which developers should know are listed below.
  1. No Security Elevation - RunWithElevatedPrivileges which runs the specified block of code in application pool account(typically System Account) context is not allowed in Sandbox code. SPSecurity class also not allowed to use in Sandbox.

  2. No Email Support - SPUtility.SendMail method has been blocked explicitly in Sandbox, However .Net mail classes can be used to send mails. Additionaly sandbox won't allow to read Farm SMTP address. So developers has to specify the SMTP address in code itself(may be some other workaround).

  3. No Support to WebPartPages Namespace - Sandbox won't allow to use Microsoft.SharePoint.WebPartPages namespace.

  4. No Support to external Webservice - Internet web service calls are not allowed to ensure security in Sandbox solutions. Allow Partially Trusted code also can't be accessed within Sandbox.

  5. No GAC Deployment - Sandbox solutions are not stored in File System(Physical path) and assemblies can't be deployed to Global Assembly Cache(GAC). But it's available on C:\ProgramData\Microsoft\SharePoint\UCCache at runtime. Note the ProgramData is a hidden folder.

  6. No Visual Webparts - Visual Studio 2010 by default won't allow to create Visual Webparts to deploy as sandbox solution. But with Visual Studio PowerTools extensions(downloadable from Microsoft MSDN website) Visual Webparts can be developed and deployed as sandbox Solutions.
SharePoint Online which is SharePoint environment provided by Microsoft to manage SharePoint Sites in internet accepts only Sandbox solutions. Because SharePoint Online sites are Windows Servers at Microsoft Datacenters, Microsoft won't allow GAC deployment or file system access. In future Sandbox solution will give more features for developers.