Sunday 24 August 2014

Document Set

How to create document set in SharePoint 2010

Document Set is used to manage set of documents as a single object
It is a new feature introduced in Share Point 2010.

Advantages of using Document Set in Share Point 2010.

Work Flow can be associated to a whole document set.
We can upload project related documents in Document set.
We can maintain the version of all related documents using Document set.
We can manage permissions easily.
We can able to set customizable welcome page for Document Set.
We can download all the zip files easily by using Document Set.
There is no limit that no of documents exit in Document set.

Folders also used to manage set of documents as a single object.
But for folders we can't start work flow.
Customizable welcome page for all document sets.

Now I will Explain How to Create Document Set.


Navigate to your share point Site Actions->Site Settings.

Navigate to Site Collection Administration ->Site collection features


By default I will not active, click on that feature to Activate




 Now I am creating a document library I give name as Document Set.
                             

Click on that Created Document Library ->Navigate to Library Settings.
                              
Navigate to General settings->Click on Advanced Settings
                         

Allow Management of content types to Yes.
              

Click OK.

In Library settings page we can able to see Content Types.
Click on Add from existing site content types.
  

In Available site Content Types->Select Document Set->Add  
                   
Click OK.
Now we want to give name for Document set.
Navigate to Library settings->Content Types->Click on Document Set
                        

Click on Name and Description tab->Enter Name ->Click OK




 Now click on Created document library Name → Document tab



Go to New Document->
Now we are able to see the created document set with name Share Point Project
                               
Click on that Share point Project ,I am give name as Project Documents and Click Ok.

Now are able to seen the created document set



Now are able to seen the created document set

Click on that Project Documents.
Click on documents tab->Click on Upload Document.

Now we are able to see my uploaded documents.

- See more at: http://www.dotnetsharepoint.com/2013/08/how-to-create-document-set-in.html#.U_rR7_mSwvx

Tuesday 19 August 2014

Drop Off Library

How to Create Content Organizer Rules in SharePoint 2010

SharePoint 2010 introduced a new feature called Content Organizer. This article will introduce how documents flow through the Content Organizer and how users can create and manage rules.
1. Content Organizer is a site level feature. Navigate to Site Actions => Site Settings => Site Actions =>Manage site features.
Manage site features
2. Activate the feature Content Organizer.
Content Organizer
3. Once this feature is activated, you will see two options, Content Organizer Settings and Content Organizer Rules, under the Site Administration section
Content Organizer Rules
4. A new document library called Drop Off Library will also be created in the location you will be adding documents to.
These documents will be moved to the target library based on Content Organizer rules.
Drop Off Library
5. A new content type will be created for Content Organizer rule as follows:
new content type will be created
6. Let’s look at the Content Organizer rules.
First navigate to Site Actions => Site Settings => Site Administration =>Content Organizer Rules.
Enter a name for your rule. In my example I call my rule “Example rule”.
In the Submission’s Content Type section select the Content type: Group andType.
Submission Content Type
7. In the Conditions section, set the Property- based condition for the rule and select the Target location where you want to save the document based on the rules conditions.
Target location in conditions section
8. Click the OK button and a new rule will be created successfully.
new rule will be created successfully
9. Now let’s see if it works. Add a document to the Drop Off Library and enter the title Example rule, or the title that you created.
Example rule
10. If the rules condition is met, in my example “Title is equal to Example rule”, then a message will pop up as follows:
a message will pop up
11. The document will be saved in Shared Documents.
Shared Documents
12. If the condition is not met:
if the condition is not met
13. Then a similar message will pop up as follows:
similar message will pop up
14. But the document will be added to the Drop Off Library and NOT added to theShared Documents library.
document will be added
document will be added2

4 Ways to deploy a webpart on Sharepoint 2010


Different ways to deploy a webpart on Sharepoint 2010

When you are done developing a WebPart, you need to deploy it to the SharePoint server. However, depending on your server setup, you may have to use specific deployment methodology and that is why it is important to know your options. This post describes different ways to achieve this goal.


Basic understanding

Whatever method you use to develop your WebPart, you will always end up with a WebPart DLL and in some cases you will have WSP file (both of these files are in debug folder of your project). It is the DLL file that plays a key role in getting your WebPart inside SharePoint server.

Ways to deploy a WebPart

There are four ways we can deploy a WebPart on SharePoint server that I will cover in this post:

  1. Using Visual Studio to deploy the solution
  2. Manually moving the DLL to the server
  3. Uploading WSP to SharePoint server
  4. Deploying through command prompt

Pre-Requisites

I am assuming that you are all done with the development and are now ready to deploy. In these examples I have a project name "FeedbackWP" that I need to deploy.

Deploying through Visual Studio

Once the coding is complete, click on build > deploy



In the output window you should see the deployment success status.


For next steps please look at "After you webpart is deployed" section at the end of this post.



 Deploying by manually moving the DLL


Build the solution




If no error returned by the compiler, copy the DLL from your project bin > Debug directory to the bin directory of your WSS site (C:\Inetpub\wwwroot\wss\VirtualDirectories\80\bin).






Go to (C:\inetpub\wwwroot\wss\VirtualDirectories\80\) and modify the Web.Config file for the WSS site to declare the custom web part as a safe control by adding the following code within the <SafeControls> tag.

<SafeControl Assembly="DLL-Name-Here" Namespace="DLL-Name NameSpaceHere" TypeName="*" Safe="True" />

In my case my dll name is feedBackWP and the namespace of my webpart is InputForm; so my SafeControl entry looks like:

<SafeControl Assembly="feedBackWP" Namespace="feedBackWP.InputForm" TypeName="*" Safe="True" />

And my webconfig looks like the image below:



Now we need to add this webpart to our Sharepoint gallery.

Click on Site Actions -> Site Settings -> Web Parts.



From Web Parts page click on Documents > New Document





New Document will bring up a pop-up window. This window should have your new web part listed. Select your webpart from the list and click on Populate Gallery.


If the import is successful, you will see the web part in Web part gallery list.



For next steps please look at "After you webpart is deployed" section at the end of this post.



Deploying by uploading WSP to SharePoint server

Build the solution




If no error returned by the compiler, you will have WSP file in your project bin > Debug.

  Open Sharepoint and click on Site Actions -> Site Settings -> solutions.

  



From solutions page click on solutions on top and after clicking it, you should see upload solution tab.





Click on upload solution and it will bring up a popoup to upload your webpart.


Upload your WSP file.


If uploading is successfull, you should see the webpart appear in the solutions list.


Activate the solution and thats it.





For next steps please look at "After you webpart is deployed" section at the end of this post.



Deploying through command prompt

Build the solution




If no error returned by the compiler, you will have WSP file in your project bin > Debug.

Copy the wsp file on the server and open up a command line and navigate to the 12-hive bin folder.
(my 12-hive bin folder is C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\BIN
Enter the following commands :

stsadm -o addsolution -filename WSP FILE NAME WITH LOCATION

stsadm -o deploysolution -name WSP FILE NAME -immediate -allowGacDeployment -url  SITEURL   


So in my case these commands become:

stsadm -o addsolution -filename c:/feedBackWP.wsp

stsadm -o deploysolution -name feedBackWP.wsp -immediate -allowGacDeployment -url ht
tp://bk-laptop-hp/


  

For next steps please look at "After you webpart is deployed" section.


After your Webpart is deployed

Go to the SharePoint site and click on Site Action > New Page.






From new page click on Insert and then on WebPart.





From WebPart list click on custom (NOTE: In some cases this is miscellaneous instead of custom). This should bring up our WebPart on the right hand side.



With the WebPart selected click on the add button.







Event Receivers:
clip_image004
Step 5:
In the event receiver class of list , add the below mentioned code. This is just a simple example to change the title to current date.
public override void ItemAdded(SPItemEventProperties properties)
{
base.ItemAdded(properties);
SPListItem _currentItem = properties.ListItem;
_currentItem["Title"] = DateTime.Now.ToString();
_currentItem.Update();
}
Step 6:
Now build and deploy the project to the SharePoint
Step 7:
In SharePoint Site click Site Actions => Site Settings => Galleries =>Solution and verify that your solution is now deployed to the site.






Explain the Share Point Architecture:
                                                                        Having 3 layers, like 3 tire architecture
1. WFE (Front End Web Server>) 2. Application Layer  3. Data base Layer



1.Front End WEB Server - 
Here we have share point Installed.
We have 12-hive structure & virtual drives.
Here IIS web sites are hosted.
Here servers are clustered on & are in synch.

2. Application Layer: -
SharePoint provides different services.
This layer provides those services, like my site hosting, user profile & searching etc.
One server can be dedicated to particular service depend upon the scalability.

3. Data Base Layer: -
Here we have SQL server installed.
Here content DB is hosted.
For moss 2007, it is SQL server 2005. For Share Point 2010, it is SQL server 2008.
Here servers are clustered on & are in synch.








Web Service
Description
WebSvcOrganizationProfileService
Provides an interface for remote clients to read and create organization profiles.
Provides a published links interface for remote clients to read and create published links.
Provides methods that can be used to remotely query SharePoint  Server search.
Provides an interface for remote clients to read, create, and manipulate social data.
Provides a user profile interface for remote clients to read and create user profiles.
Provides a user profile interface for remote clients to read and create user profiles.

Difference between Stored Procedure and Function?

  • Function are compiled and executed at run time.
  • Stored Procedure are stored in parsed and compiled format in the database.
  • Function cannot affect the state of the database which means we cannot perform CRUD operation on the database.
  • Stored Procedure can affect the state of the database by using CRUD operations.
  • Store Procedure can return zero or n values whereas Function can return only one value.
  • Store Procedure can have input, output parameters for it whereas functions can have only input parameters.
  • Function can be called from Stored Procedure whereas Stored Procedure cannot be called from Function.