Friday, June 27, 2014

Site definition

What is Site Definition?

A set of predefined components needs to be included when a site was created in the SharePoint server. The site definition contains the information of Web parts, Lists, Features, and Navigation Bars to be included in the site. 

Site Definition:
By default SharePoint comes with several OOB site definitions which you can select to create your site. In the file system these definitions are available in C:\Program Files\Common Files\Microsoft Shared\web server extensions\15\TEMPLATE\SiteTemplates. 
Each of this site definition consists a XML folder and a Home page (default.aspx). Some of the site definition will be having some more details about the definition which we will walkthrough in more detail later. 
The XML folder of the site definition contains the ONET.XML (Office .NET) file. This file contains the information about all the web parts, Lists, Features and Navigation Bars. 
The configuration of this site definitions are defined in another XML file which is available in C:\Program Files\Common Files\Microsoft Shared\web server extensions\15\TEMPLATE\1033\XML folder.
Following is the detail of the XML configuration file and the respective site definitions


Sunday, June 22, 2014

List Definition in SharePoint 2013

In this article you will learn how to develop List Definition in SharePoint 2013 using declarative approach with the help of Visual Studio.

Develop:

1.       Open Visual Studio 2012 or 2013.
2.       Click File – [New] – [Project]  - SharePoint solutions.
3.       Select SharePoint 2013 – Empty Project template.
4.       Name the project “SharePointProject_ListDefinition” or name as you like :).
5.       Enter the site you want to debug and select Farm solution.
6.       Always create folder for grouping any similar artifacts like Site Columns, Content Types and Lists etc. In this case even though its only one I will create a folder called Lists.
a.       To create a new folder, Right click on the project - [Add] – [New Folder], name it as Lists.
7.       We are into actual step now creating List definition.
  •  Right click on Lists folder –[Add]-[New Item]- [List]  name it as “CustomerListDefinition”.
  •  Click on Finish in the wizard.
  •  Add the columns / content types if you have any. Once you are done save all.
  •  We need only list definition so go ahead and delete the list instance.
8. Open the elements.xml under CustomerListdefinition.
1234567891011121314
xmlns="http://schemas.microsoft.com/sharepoint/">
Name="CustomerListDefinition"
Type="10000"
BaseType="0"
OnQuickLaunch="TRUE"
SecurityBits="11"
Sequence="410"
DisplayName="CustomerListDefinition"
Description="My List Definition"
Image="/_layouts/15/images/itgen.png"/>
view rawElements.xml hosted with ❤ by GitHub
You can observe that Type will always starts with 10000 to make sure that this will not conflict with the OOB types.

Deploy:

9.       If you want to activate the feature manually go to Project properties - select sharepoint –Set Active deployment configuration to “No Activation”.
10.       Right click on project to deploy the solution. Always keep an eye on Output window in visual studio to know what is happening behind the scenes.
11.       Go to [Site settings]-[Manage site features under Site Actions]- activate your feature, here “SharePointProject_ListDefinition Feature1”.

Testing:

12.       To see your list definition click on [Site content] – [Add an app] there you can see your “CustomerListdefinition”
Using this you can create as many lists you wish :).

Conclusion:

With the help of Visual Studio 2012 and later versions developing list definition becomes easier compared to previous versions.
- See more at: http://www.sharepoint-journey.com/List-Definition-in-sharepoint-2013-using-declarative-approach.html#sthash.xeJ6RueC.dpuf

SharePoint list, Content Types, site columns in SharePoint 2013

Site Columns:

Whenever you develop the SharePoint list and Content type, first develop required site columns that will be used while developing SharePoint lists and Content types.

what are site columns?

A site column is a reusable column definition, or template, that you can assign to multiple lists across multiple SharePoint sites. We will see how we achieve this.
Let's open the Visual studio 2012.
Create a new project by selecting the SharePoint 2013 - empty project template from the SharePoint solutions under office/SharePoint section. Please see below figure for reference.
SharePoint 2013 - empty project
Enter the name of the project and click OK.
SharePoint 2013 - project wizard
Enter the site URL and click on validate make sure the connection is successful then select the "Deploy as s farm solution"  and click on Finish.
It's time to add the required site columns to the project. To do that right click on the project click on Add -> New Item, the below screen will come up from that select Site column, enter column name and click on Add button.
The column will get added to the project and the required XMl file will get generated.
Site-column
In the same way you add all the required columns. In this example I have added two site columns i.e. Team Name, Task assigned.
Once you add the site column it will generate the Elements.xml file where you can change the properties of the field. Please see the below default code snippet which will generate.
1234567891011
xmlns="http://schemas.microsoft.com/sharepoint/">
ID="{779bdd44-c459-49cd-8265-3190420c7633}"
Name="Team_x0020_Name"
DisplayName="Team Name"
Type="Text"
Required="FALSE"
Group="Custom Site Columns">
view rawElements.xml hosted with ❤ by GitHub
You can change the Required and Group properties of filed according to your requirement.
Now we are ready with the site columns required for our site. Now its time to create Content Types.

Content Type:

Content types are used to manage the different types of metadata (columns).
It is a reusable collection of metadata with event receivers, workflows, other settings for the group of items in a SharePoint list or library.
To create content type, right click on the project which has been created above step, click on Add -> New Item, the screen will come up from that select Content Type and enter the name of your content type and click Add.
content_type
Select the base content type which you want to inherit from. I am selecting Item content type as a base one.
content_type_wizard
Click finish. It will create a content type where you can add your site columns which has been created above.
Once you create the content type, it will show the VS designer view with two tabs Columns and Content Type.
From the Columns section you can add the site columns.
See in the below figure when you enter "a" it is displaying all values which matches with "a". This detail will get populated based on site columns available in the site and site columns you have added to the solution.
content-type
Once you have added all the site columns like below screen click on save.
If you want to delete any column which you have added, right click on that column name it will show small pop up "Delete-Del" click on that to delete it.
Content-type-column
Move on next tab content type. In the content type section you can enter your content type name, description, group name and there are three more properties.
Inherits the columns from the parent content type, you can check or uncheck that option based on your requirement.
content_type_settings
After completion of your required settings of your content type, click on save. Try to open the Elements.xml file, when you open it it will ask to close the content type designer view.
If you open the Eelements.xml file of your content type, you can observe that everything has been created for you. Please see the below code snippet for reference.
12345678910111213141516171819202122232425262728
xmlns="http://schemas.microsoft.com/sharepoint/">
ID="0x0100118703F0484042118516B33BD9488ECB" Name="ContentType-Object Model" Group="SharePoint-Journey" Description="My Content Type" Inherits="TRUE" Version="0">
ID="{a4a8c94a-6a0d-4ef2-880d-a049720e2a73}"
DisplayName="Team Name"
Required="TRUE"
Name="Team_x0020_Name" />
ID="{2f6753f2-1584-477a-868e-d75ead1aaa07}"
DisplayName="Task assinged"
Required="TRUE"
Name="Task_x0020_assinged"
NumLines="6"
Sortable="FALSE" />
ID="{64cd368d-2f95-4bfc-a1f9-8d4324ecb007}"
DisplayName="$Resources:core,Start_Date;"
Required="TRUE"
Name="StartDate"
Format="DateOnly" />
ID="{8A121252-85A9-443d-8217-A1B57020FADF}"
DisplayName="$Resources:core,End_Date;"
Required="TRUE"
Name="_EndDate"
Format="DateTime" />
view rawElements.xml hosted with ❤ by GitHub

SharePoint List:

So far you have build site columns and content type. Now using these two we need to build the list.

Create a list by adding a new item to the project.
List
Enter the name of the list that you want to create and click on Add. It will open the wizard to choose the list settings.
Use the default (Blank) template to create the list and click finish.
create_list
It will open the list designer in visual studio where we can add the required columns from columns tab or click on the content type button at the bottom of the columns tab to select the content type that will be used to create a list.
As a standard practice we will create the columns by selecting the content type, so click on content types button from columns tab.
create_list
Choose the content type from the dropdown menu, this populate the all content types available in the SharePoint site and content types that we have added to the project. You need to add the content type which you created before.
create-list
Once you select the content type, click ok. It will populate the site columns which has been used for that content type, see the below screen.
create_list
Go to next tab i.e. Views. Here you can set the row limit and available fields in that  of that particular view. By default you will have Allitems view, you can add the views which you want to customize it.
List-Views
Next click on the List tab to change the title, URL, description of the list. There are two options Display list at quick launch and Hide list from browser, based on your requirement you can change that.
create_list
Once you change the settings of the list  the Elements.xml file of list instance will get modified.
Please see below snippet for reference.
12345678910
xmlns="http://schemas.microsoft.com/sharepoint/">
Title="TeamDetails"
OnQuickLaunch="TRUE"
TemplateType="10000"
Url="Lists/TeamDetails"
Description="My List Instance">
 
Once you complete everything, build the project and deploy it to your SharePoint site by clicking a deployment option from the project.
build-list-project
After successful deployment you can check your SharePoint list, content type and site columns which you have built here in your SharePoint site.

Conclusion:

We have seen the capabilities of visual studio designer in visual studio 2012 to develop the SharePoint list, Content types and site columns for SharePoint 2013 with less effort and time. That makes developer's life much easier.

Saturday, June 7, 2014

SharePoint 2010 vs. SharePoint 2013 Feature Comparison


SharePoint 2010 vs. SharePoint 2013 Feature Comparison
  1. From a document collaboration perspective, the structures of both versions are the same –so if you create a metadata architecture for documents in 2010 it should be fully upgradable to 2013. 
  2. The most significant upgrades in document management are in the user experience –including drag and drop to upload documents and the ability to edit managed metadata in a datasheet view.
  3. The primary differences are in the social experiences, especially with discussion boards. The 2013 discussion board (with Community features enabled) creates and engaging “Facebook-like” activity stream, which is far more user-friendly than the same feature in SharePoint 2010. The added visual appeal is important because getting people to use the discussion board instead of commonly used “who you know” networks will take some planning and effort. If the software is engaging and familiar it will help with “stickiness.”
  4. The other significant improvement is search, which you will see in the examples on the next few pages.
Business Scenario
SharePoint 2010
SharePoint 2013
Document Collaboration •Support for enterprise content types and shared metadata so that attributes and structures can be maintained in one place and shared across the enterprise, vastly improving search results. •No difference in approach for organizing content so investment in defining content types and metadata is fully leveraged in 2013.
•Several helpful user experience improvements in the application of metadata, including the ability to edit managed metadata in a datasheet (spreadsheet) view. •“Drag and drop” ability to upload documents to SharePoint libraries (without having to open library in “explorer view’).
Search •Comprehensive enterprise search with the ability to use Boolean operators to create search queries. For example: search for: cats AND dogs.
•Wildcard search available. For example, as search for ho* would find homes, horses, houses, etc.
•Faceted search refiners to easily narrow results based on metadata.
•Define search scopes to target to specific collections of content.
•“Best bets” can be defined to force certain results to the top of search results.
•Significant improvements in user experience.
•Visual display of contents as you hover in search results.
•Best bets now called Promoted Results.
•Search remembers what you have previously searched and clicked and displays these values as query suggestions at the top of the results page.
•Results show number of times a document has been viewed.
•Results pages allows you to page through PowerPoint presentations without leaving the search results page.
•One click to “view in library.”
Expertise Location •Support for user profile –both standard and custom attributes
•People are searchable –and search can be scoped to people
•Users define core areas of expertise in the “Ask me about” column.
•Default people search displays most recent documents authored by that user
•Follow people to see updates based on their News feed posts and what they are publishing
Social Computing •Very limited capabilities.
•Users can post a single status that is not retained and not searchable.
•New status wipes out the old status so statuses feel very static.
•Each user has a News feed that is similar to a Facebook activity stream.
•See stream of the entire organization or filter based on topics and people you are Following.
•Post or reply in the stream using @mentions and #hash tags.
•Activity posts are saved for as long as you decide to retain them (most organizations align this policy with email retention) and are searchable.
•Follow #Hash tags to get notified when new content relevant to your area of interest is added.
•@mention someone to direct an activity post to their attention (as in Twitter).
Workflow •Several“built in” workflows with additional options available in SharePoint Designer. •Significant enhancements, including new ways to create and visualize workflows.
•Existing 2010 workflows should upgrade.
Collaborating with others outside the workgroup on individual documents •Difficult to do if the person not on the team does not have access to edit the document on the team site.
•Only the site owner can grant permissions.
•Author can create a “document workspace” and invite the guest to edit, but then has to publish the final document back to the main site.
•“Share” button easily visible for any site and document.
•Any user can invite someone to edit an individual document “in place,” but all invitations are approved by the site owner. (easier to collaborate, but still controlled) This feature makes it easier to collaborate with people outside the immediate workgroup but requires that site owners carefully manage permissions when the collaboration is finished.
•Users who request access to a site have an opportunity to explain why they need access so that site owners can make better decisions about whether or not to grant access.
Branding (creating a custom look and feel) •Significant SharePoint knowledge required to design the user interface for SharePoint sites. •The new features in a publishing site minimize the amount of SharePoint knowledge that is required to successfully design and brand a SharePoint site.
•Professional web designers who know HTML, CSS, and JavaScript already have the skills necessary to design a SharePoint 2013 site–and can use their preferred tools such as Dreamweaver to create designs for SharePoint.

SharePoint 2010 Discussion List

SharePoint 2010 Discussion List