Posts Tagged ‘SharePoint 2013’

Custom templates using SP-ExportWeb

March 25, 2013

When creating custom templates for users, you have following possibilities:

  1. Create a template in Visual Studio
  2. Create a template website in SharePoint and save website as a template (wsp).
  3. Create a template website in SharePoint and save it with Export-SPWeb powershell command.

Each of this solutions has its drawbacks:

Ad 1. complex and time consuming solution, prone to errors.
Ad 2. Following features are not supported: Customized permissions, running workflow instances, list item version history, workflow tasks associated with running workflows, people or group field values, taxonomy field values, publishing pages and publishing sites, My Sites, and stapled features. See following article http://msdn.microsoft.com/en-us/library/jj938033.aspx#bkmk_WhatIsTemplate
Ad 3. the taxonomy fields in the website created from template in the different sharepoint farm will be broken.

As the title suggests I will describe the third option in this article.

Creating the template

  1. Create your template in SharePoint. (Activate the features, add lists, fields and documents)
  2. Open the Powershell console and execute following command:

Export-SPWeb http://yoursite–Path "c:\temp\export.cmp"

Creating a website from the template
Create new empty website and use the Import-SPWeb to import the content from the file:
New-SPSite http://newsiteurl/ -OwnerAlias "loginname" -Name "newWebSiteName"
Import-SPWeb http://newsiteurl/ -Path "c:\temp\export.cmp" -IncludeUserSecurity

The advantage of this approach is, that if you create a new version of the template you can reimport it on an existing website. The changes in the new template will be merged with the changes in the existing website made by the users . However I recommend to create a backup from the website before reimporting.

There are two things  that remain open:

  1. The metadata fields will not be relinked to the termsets after importing into another farm.
  2. The “Self Service Creation”-like functionality is missing. There is some development that needs to be done.

Maybe next time.

 

SharePoint 2013 v15 What’s new?

May 2, 2012

I recently found following document SharePoint 15 Technical Preview Interoperability API Documentation. Here can we find some parts of the new SharePoint 15 API.

Here are some information, which you could find interesting. Please keep in mind, that what I write here are only guesses and I can be totally wrong.

Market place

I found following classes: SPApp, SPAppCatalog, SPAppInstance. These new classes suggest that Microsoft will release a market place for the next version of SharePoint. What role will be playing Sandboxed Solution. There exists even a licensing model for the marketplace. The SPWebapplication was extended with the method IsUserLicensedForEntity. The Application will be loaded into SPWeb according to the methods SPWeb.LoadAndInstallApp. You can read more about it here. However in czech.

Extensive usage of JSON

There are following new classes JsonReader, SPFieldServerStub, SPFieldLookupServerStub. These classes contain methods for creating and reading JSON objects. So it will be possible to read information about field in Javascript.

SPFieldLookup.GetJsonClientFormFieldSchema

Details: Gets an object containing field schema information for client rendering.

So we can read also the information about the field definition in Javascript.

SPFileRightsManagementSettings

New Dataholder for SPFile properties. The  class has  following properties:

  • AllowPrint Gets or sets a value indicating whether the viewer can print the document.
  • AllowScript Gets or sets a value indicating whether the viewer can run script on downloaded document.
  • AllowWriteCopy Gets or sets a value indicating whether the viewer can write on a copy of the downloaded document.
  • DocumentAcceExpireDays Gets or sets the number of days before a downloaded document will expire
  • GroupName Gets or sets the group name (email address) to which the permission applies.

SPSite.CompatibilityLevel

Gets the major version of this site collection for purposes of major version-level compatibility checks. For which version is the Site Collection designed?

SPUtility.GetLayoutsFolder

Returns the versioned layouts folder for the specified site collection.

According to this we can have different versions of laouts folder for different webs. The laouts folder is not Farm scoped anymore.

OAuth

Class SPOAuth2BearerCredentials and namespace Microsoft.SharePoint.IdentityModel.OAuth2. Support of OAuth2 like Windows Live ID, Twitter, Facebook?

ClientContext extensions

Microsoft.SharePoint.Client.Search.Query

We can start search queries directly from the Client Object Model

Microsoft.SharePoint.Client.Search.SearchExecutor

We can start multiple search queries  in batch.

Microsoft.SharePoint.Client.File

OpenBinaryStream:  We can open the file from server on the client.