Sunday, June 22, 2014

Records management (SharePoint Server 2010)


record is a document or other electronic or physical entity in an organization that serves as evidence of an activity or transaction performed by the organization and that requires retention for some time period.
Records management as “the practice of maintaining the records of an organization from the time they are created up to their eventual disposal.      
Records management is the process by which an organization:
•      Determines what kinds of information should be considered records.
•      Determines how active documents that will become records should be handled while they are being used, and determines how they should be collected after they are declared to be records.
•      Determines in what manner and for how long each record type should be retained to meet legal, business, or regulatory requirements.
•      Researches and implements technological solutions and business processes to help ensure that the organization complies with its records management obligations in a cost-effective and non-intrusive way.
Performs records-related tasks such as disposing of expired records, or locating and protecting records related to external events such as lawsuits.

Two Types of Record Management in 2010
SharePoint 2010 introduces new capabilities regarding Records Management. The most interesting feature, I think, is In-Place Records management (info at the end of this post) which makes it possible to declare documents as records without moving them to a Records Center. Records and documents live side by side in the site they were created in, and SharePoint 2010 makes it possible to apply different policies (i.e. retention schedules) depending if the item is a record or a document.

The Record Center site template is still available. It utilizes some new functionality like the Content Organizer to route incoming documents to the libraries of your preference. A new “dashboard” gives a record manager faster access to common tasks and to-do actions.
Holds (with discovery), audit and file-plan reports are also new or improved functionality to better control your records.
Other items than documents can also be declared as records in SharePoint 2010; wiki pages, blog posts, article pages among others.

In-Place Records Management
A new capability in SharePoint 2010 is In-Place Records management. Instead of moving a document to a specific Records Center, you declare the document as a record and it will be handled as a record in the site it was created in. After the document is declared as a record, it can have policies and restrictions different than when it was a document. The policies are added to either the Content Types or directly on the document libraries (see the Retention Schedule paragraph above).

Documents can be declared as records either manually or automatically.
Manual record declaration can be configures on Site Collection level and overridden in each document library. In Site Collection settings you have the following options on how declarations of records should be done:

When Record Declaration Availability is set to “Available in all location by default”, a new icon appears on the Ribbon:

A document will get a padlock added to its icon when declared as a record:
Again, you can override the record declaration availability on the document library level:
Automatically declarations of records are possible by checking the “Automatic Declaration” option in the document library settings.

Declaring documents as records means the documents are final and should not be modified for compliance reasons. In SharePoint 2010, documents can be declared as records in two ways
1. Select one or more documents (yes, you can multi-select documents! and apply actions such as check-in/out) and then declare them as records! Done.  these documents cannot be updated. Of course, some pre-configuration is required, but this is quite easy and more importantly out-of-the-box feature from SharePoint 2010

2. Another way is to select the documents and then to send them to a special site called records center site. The documents will be copied to the records center site and links will be displayed in the document library where the documents were originally located.

Folders or content types
You can define retention policies based on an item’s content type or based on the folder in which an item is located  any given library, you must select one or the other. You cannot base retention policies on a combination of content types and folders within the same library.
Your choice will greatly affect how you set up the site and how users use the site. It is usually simpler to base retention policies on content types, if this works in your situation.







Enabling Session State in SharePoint 2010



Using the steps provided here, we can enable session state for the web application and we can use the session variables wherever are required in the application.


Mission
Enabling Session State in SharePoint 2010.
Game Plan
1. The concept
2. Steps for Enabling Session State in SharePoint 2010.

So let’s begin…

The concept

If you are trying to use session state in SharePoint 2010 to store data for use in web parts, application pages, etc. you may encounter the error below if session state is not properly configured and enabled for the web application.

Session state can only be used when enableSessionState is set to true, either in a configuration file or in the Page directive. Please also make sure that System.Web.SessionStateModule or a custom session state module is included in the \\<...

To resolve the error and to enable session state for SharePoint we need to follow the steps given below.


Steps for Enabling Session State in SharePoint 2010

1.    To enable Session State  first add the SessionStateModule to the  web.config file as shown below:


2.      Ensure that enableSessionState is set to TRUE as follows:
<pages enableSessionState="true" enableViewState="true" enableViewStateMac="true" validateRequest="false" pageParserFilterType="Microsoft.SharePoint.ApplicationRuntime.SPPageParserFilter, Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c">

3.      Then, you must go into your web application and add the same session state module to the IIS7 managed pipeline.
i.        Open IIS 7 manager, and find your web application.
  1. Double click "Modules" in the IIS section.
  2. Click "Add Managed Module..." on the right hand pane.
  3. In the Add Managed Module dialog, enter "SessionState" or something like that for the name, and choose the following item from the dropdown:
System.Web.SessionState.SessionStateModule, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a.

That’s it! Session State should then work in your SharePoint application.


Where it can be used:

Any application where we want to use session state.

Is this the Work Around or Best Solution?

This is Best Solution for enabling session state for your application.

SP 2013: Getting started with the new Geolocation field in SharePoint 2013

Introduction to the Geolocation Field

I’ll showcase what the Geolocation field can do for us in a SharePoint list. In the sample below I’ve used a list called “Scandinavian Microsoft Offices” which contains a few office names (Sweden, Denmark, Finland and Norway). What I want to do in my list is to display the location visually to my users, not only the name and address of the location. With the new Geolocation field you can display an actual map, as I’ll show you through right now – skip down to the “Adding a Geolocation Field to your list” section if you want to know how to get the same results yourself.

A plain SharePoint list before I’ve added my Geolocation field

image
As you can see, no modifications or extra awesomeness exist in this list view – it’s a vanilla SharePoint 2013 list view.

The same list, with the Geolocation field added to it

When we’ve added the Geolocation field to support our Bing Maps, you can see that a new column is displayed in the list view and you can interact with it. In my sample here I’ve filled in the coordinates for the four Microsoft offices I’ve listed in my list.
image
Pressing the small globe icon will bring up a nice hover card kind of dialog with the actual map, with options to view the entire map on Bing Maps as well (which is essentially just a link that’ll take you onwards to the actual bing map):
image
Viewing an actual list item looks like this, with the map fully integrated by default into the display form:
image
And should you want to Add or Edit a list item with the Geolocation field, you can click either “Specify location” or “Use my location“. If you browser supports the usage and tracking of your location, you can use the latter alternative to have SharePoint automagically fill in your coordinates for you. Compare it with how you check in at Facebook and it recognizes your current location and can put a pin on the map for you.
image
In my current setup I don’t have support for “Use my location” so I’ll have to go with the “Specify location” option – giving me this pretty dull dialog:
image
As you can see, you don’t have an option for searching for your office on Bing Maps and then selecting the search result and have it automatically insert the correct Lat/Long coordinates. But, that’s where developers come in handy.

Create a new Map View

Let’s not forget about this awesome feature – you can create a new View in your list now, called a “Map View”, which will give you a pretty nice map layout of your tagged locations with pins on the map. Check these steps out:
1) Head on up to “List” -> “Create View” in your List Ribbon Menu:
image
2) Select the new “Map View”
image
3) Enter a name, choose your fields and hit “Ok”
image
4) Enjoy your newly created out of the box view in SharePoint. AWESOME
image

Adding a Geolocation Field to your list

Right, let’s move on to the fun part of actually adding the field to our list. I’m not sure if it’s possible to add the field through the UI in SharePoint but you can definitely add it using code and scripts, which is my preferred way to add stuff anyway.

Adding a Geolocation field using PowerShell

With the following PowerShell snippet you can easily add a new Geolocation field to your list:
1
2
3
4
5
6
7
8
Add-PSSnapin Microsoft.SharePoint.PowerShell
 
$web = Get-SPWeb "http://tozit-sp:2015"
$list = $web.Lists["Scandinavian Microsoft Offices"]
$list.Fields.AddFieldAsXml(
    "",
    $true,
    [Microsoft.SharePoint.SPAddFieldOptions]::AddFieldToDefaultView)

Adding a Geolocation field using the .NET Client Object Model

With the following code snippet for the CSOM you can add a new Geolocation field to your list:
1
2
3
4
5
6
7
8
9
10
11
12
// Hardcoded sample, you may want to use a different approach if you're planning to use this code :-)
var webUrl = "http://tozit-sp:2015";
 
ClientContext ctx = new ClientContext(webUrl);
List officeLocationList = ctx.Web.Lists.GetByTitle("Scandinavian Microsoft Offices");
officeLocationList.Fields.AddFieldAsXml(
    "",
    true,
    AddFieldOptions.AddToAllContentTypes);
 
officeLocationList.Update();
ctx.ExecuteQuery();

Adding a Geolocation field using the Javascript Client Object Model

With the following code snippet for the JS Client Object Model you can add a new Geolocation field to your list:
1
2
3
4
5
6
7
8
9
10
11
12
13
function AddGeolocationFieldSample()
{
    var clientContext = new SP.ClientContext();
    var targetList = clientContext.get_web().get_lists().getByTitle('Scandinavian Microsoft Offices');
    fields = targetList.get_fields();
    fields.addFieldAsXml(
        "",
        true,
        SP.AddFieldOptions.addToDefaultContentType);
 
    clientContext.load(fields);
    clientContext.executeQueryAsync(Function.createDelegate(this, this.onContextQuerySuccess), Function.createDelegate(this, this.onContextQueryFailure));
}

Adding a Geolocation field using the Server Side Object Model

With the following code snippet of server-side code you can add a new Geolocation field to your list:
1
2
3
4
5
6
7
8
9
// Assumes you've got an SPSite object called 'site'
SPWeb web = site.RootWeb;
SPList list = web.Lists.TryGetList("Scandinavian Microsoft Offices");
if (list != null)
{
    list.Fields.AddFieldAsXml("",
        true,
        SPAddFieldOptions.AddFieldToDefaultView);
}
Be amazed, its that easy!

Bing Maps – getting and setting the credentials in SharePoint

Okay now I’ve added the fields to my lists and everything seems to be working out well, except for one little thing… The Bing Map tells me “The specified credentials are invalid. You can sign up for a free developer account at http://www.bingmapsportal.com“, which could look like this:
image

Get your Bing Maps keys

If you don’t have any credentials for Bing Maps, you can easily fetch them by going to the specified Url (http://www.bingmapsportal.com) and follow these few simple steps.
1) First off (after you’ve signed up or signed in), you’ll need to click on the “Create or view keys” link in the left navigation:
image
2) Secondly, you will have to enter some information to create a new key and then click ‘Submit’:
image
After you’ve clicked ‘Submit’ you’ll be presented with a list of your keys, looking something like this:
image
Great, you’ve got your Bing Maps keys/credentials. Now we need to let SharePoint know about this as well!

Telling SharePoint 2013 what credentials you want to use for the Bing Maps

Okay – so by this time we’ve created a Geolocation field and set up a credential for our key with Bing Maps. But how does SharePoint know what key to use?
Well that’s pretty straight forward, we have a Property Bag on the SPWeb object called “BING_MAPS_KEY” which allows us to configure our key.
Since setting a property bag is so straight forward I’ll only use one code snippet sample to explain it – it should be easily translated over to the other object models, should you have the need for it.

Setting the BING MAPS KEY using PowerShell on the Farm

If you instead want to configure one key for your entire farm, you can use the Set-SPBingMapsKey PowerShell Cmdlet.
1
Set-SPBingMapsKey -BingKey "FFDDuWzmanbiqeF7Ftke68y4K8vtU1vDYFEWg1J5J4o2x4LEKqJzjDajZ0XQKpFG"

Setting the BING MAPS KEY using PowerShell on a specific Web

1
2
3
4
5
Add-PSSnapin Microsoft.SharePoint.PowerShell
 
$web = Get-SPWeb "http://tozit-sp:2015"
$web.AllProperties["BING_MAPS_KEY"] = "FFDDuWzmanbiqeF7Ftke68y4K8vtU1vDYFEWg1J5J4o2x4LEKqJzjDajZ0XQKpFG"
$web.Update()
Update 2013-03-31: More examples of setting the property bag
I got a comment in the blog about having more examples for various approaches (like CSOM/JS and not only PowerShell). Sure enough, here comes some simple samples for that.

Setting the BING MAPS KEY using JavaScript Client Object Model on a specific Web

1
2
3
4
5
6
7
8
9
10
11
12
13
14
var ctx = new SP.ClientContext.get_current();
var web = ctx.get_site().get_rootWeb();
var webProperties = web.get_allProperties();
 
webProperties.set_item("BING_MAPS_KEY", "FFDDuWzmanbiqeF7Ftke68y4K8vtU1vDYFEWg1J5J4o2x4LEKqJzjDajZ0XQKpFG");
web.update();
ctx.load(web);
 
// Shoot'em queries away captain!
ctx.executeQueryAsync(function (){
    alert("Success");
},function () {
    alert("Fail.. Doh!");
});

Setting the BING MAPS KEY using .NET Client Object Model on a specific Web

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
// Set the Url to the site, or get the current context. Choose your own approach here..
var ctx = new ClientContext("http://tozit-sp:2015/");
 
var siteCollection = ctx.Site;
ctx.Load(siteCollection);
 
var web = siteCollection.RootWeb;
ctx.Load(web, w => w.AllProperties);
ctx.ExecuteQuery();
 
var allProperties = web.AllProperties;
ctx.Load(allProperties);
 
// Set the Bing Maps Key property
web.AllProperties["BING_MAPS_KEY"] = "FFDDuWzmanbiqeF7Ftke68y4K8vtU1vDYFEWg1J5J4o2x4LEKqJzjDajZ0XQKpFG";
web.Update();
 
ctx.Load(web, w => w.AllProperties);
ctx.ExecuteQuery();
So that’s pretty straight forward. Once you’ve set the Bing Maps Key, you can see that the text in your maps has disappeared and you can now start utilizing the full potential of the Geolocation field.

What’s new for developers in SharePoint 2013

Learn about new features and functionality in SharePoint 2013, including the new Cloud App Model, development tools, platform enhancements, mobile apps, and more.

SharePoint 2013 introduces a Cloud App Model that enables you to create apps. Apps for SharePoint are self-contained pieces of functionality that extend the capabilities of a SharePoint website. An app may include SharePoint components such as lists, workflows, and site pages, but it can also surface a remote web application and remote data in SharePoint. An app has few or no dependencies on any other software on the device or platform where it is installed, other than what is built into the platform. This characteristic enables apps to be installed simply and uninstalled cleanly. Apps have no custom code that runs on the SharePoint servers. Instead, all custom logic moves "up" to the cloud or "down" to client computers. Additionally, SharePoint 2013 introduces an innovative delivery model for apps for SharePoint that includes components like the Office Store and the App Catalog.
Apps for SharePoint   SharePoint Store  App Catalog

SharePoint 2013 makes it easy for any web developer, including those who work on non-Microsoft platform stacks, to create SharePoint solutions. What makes this possible is that SharePoint 2013 is based on common web standards like HTML, CSS, and JavaScript. Furthermore, implementation relies on established protocols like the Open Data protocol (OData), and OAuth.
HTML/JavaScript   OData  REST  OAuth

The current release reflects enormous strides in optimizing the existing development tools like Visual Studio and SharePoint Designer, in addition to providing the release of newly developed web-based tool "Napa" Office 365 Development Tools for developing apps. The new unified project system in Visual Studio lets you develop apps for SharePoint, apps for Office, apps for SharePoint that include apps for Office, or apps for Office that are hosted by SharePoint. In addition to the SharePoint project templates that were provided in earlier versions, Visual Studio 2012 now includes a new app project template in the Apps folder named Apps for SharePoint 2013. Several new properties have been added to the Properties window and Properties pages to support app for SharePoint projects. Other improvements include full support for development against the Cloud App Model, including OData and OAuth support, and full support for development against the Workflow Manager Client 1.0 platform.
Napa Office 365 Development Tools   Visual Studio  SharePoint Designer

On a broader scale, SharePoint 2013 has been improved and enhanced to support the new cloud-based architecture and app-driven development framework. From the SharePoint APIs at the lowest level to connectivity to social media integration, SharePoint 2013 is designed and executed to support a rich application development experience. In addition to the use of Representational State Transfer (REST) endpoints for web services, there is a broad new API for both server and client development. Remote event receivers and now supported in addition to client-side rendering.
REST endpoints   New client and server APIs  Client-side rendering  Remote event receivers

With SharePoint 2013, you can combine Windows Phone 7 applications with on-premises SharePoint services and applications, or with remote SharePoint services and applications that run in the cloud (such as those that use SharePoint Online), to create powerful applications that extend functionality beyond the traditional desktop or laptop and into a truly portable and much more accessible environment. The new mobility features in SharePoint 2013 are built on existing Microsoft tools and technologies, such as SharePoint, Windows Phone 7, Visual Studio, and Microsoft Silverlight. You can create SharePoint-powered mobile applications for Windows Phone using the new SharePoint phone application wizard template in Visual Studio, which lets you create simple list-based mobile applications. You can integrate new features introduced in SharePoint 2013, such as the Geolocation field type and "push" notifications from SharePoint Server, into your mobile applications.
Visual Studio app templates   Push notifications  Location and maps

New and improved social and collaboration features make it easy for users to communicate and to stay engaged and informed. The improved My Site social feed helps users keep up to date with the people and content that they care about. The new Community Site feature provides a rich community experience that lets users easily find and share information and find people who have similar interests.
Interactive feed   Community site  Follow people  Follow sites

Search functionality in SharePoint 2013 includes several enhancements, custom content processing with the Content Enrichment web service, and a new framework for presenting search result types. Additionally, there have been significant enhancements made to the keyword query language (KQL).
Consolidated search platform   Rich results framework  KQL enhnacements

Workflow Manager Client 1.0 is a redesigned workflow infrastructure that is built on Windows Workflow Foundation 4 and brings new power and flexibility to workflow authoring in SharePoint 2013. A fully declarative authoring environment enables information workers to use SharePoint Designer 2013 to author powerful workflows, and a new set of Visual Studio 2012 workflow project templates let developers access more sophisticated features like custom actions. Perhaps most importantly, Workflow Manager Client 1.0 is fully integrated with the model for apps for SharePoint. In addition, workflows execute in the cloud, not in SharePoint, which provides enormous flexibility in designing workflow-based apps for SharePoint.
Executin in the cloud   Workflow 4-based infrastructure  Declarative authoring  Designer and project templates

In SharePoint 2013, you can now use .NET client, Silverlight, Windows Phone, and JavaScript APIs, in addition to the newly expanded set of .NET server managed APIs, to customize Enterprise Content Management (ECM) experiences and behavior.
Design Manager   Managed navigation  Cross-site publishing  EDiscovery

Business Connectivity Services (BCS) enables SharePoint to access data from external data systems such as SAP, ERP, and CRM, in addition to other data-driven applications that are exposed through WCF services or OData endpoints. BCS in SharePoint 2013 has been improved and enhanced in many ways, including OData connectivity, external events, external data in apps, filtering and sorting, support for REST, and others.
OData connector   External data in apps  External events in SharePoint 

SharePoint Server 2013 includes several services for working with data in your SharePoint sites. New for SharePoint is the Machine Translation Service, which translates sites, documents, and streams for multilingual support. SharePoint Server 2013 also includes Access Services and a new data access model. For converting files and streams to other formats, SharePoint Server 2013 has Word Automation Services and PowerPoint Automation Services (a new feature for SharePoint). SharePoint also provides data analysis tools, like PerformancePoint Services and Visio Services, that enable business intelligence, and powerful new features in Excel Services.
Translation Services   PowerPoint Automation Services  Enhanced Access Services  Enhanced Excel Services

Welcome to SharePoint Server 2019, a modern platform for choice and flexibility

“Without continual growth and progress, such words as improvement, achievement, and success have no meaning.” Benjamin Franklin Thi...