Archive for the ‘SharePoint 2013’ Category

SharePoint Tools learned at ShareCamp

April 20, 2013

I had the opportunity to attend to ShareCamp in Microsoft München and hier are some interesting tools that I saw during the lessons:

Name Description
Search query tool Really nice tool for generating search queries against SharePoint 2013. You can see the xml and field names that come from SharePoint. Really helpful when creating custom search templates.
dotPeek A free alternative to .NET Reflector by JetBrains
PowerGUI A free tool like Powershell ISE but better.
IronSP Interesting tool for development for SharePoint in Ruby. Currently under development and not simple to use without deep knowledge of the project.
Collaboration Manager A commercial tool for managing SharePoint templates including upgrades. However it costs lots of money.

Hope you find this list helpful.

Advertisement

Fixing Metadata Field Connection after importing a Website to another Farm

April 10, 2013

This is a follow up to this post, where I described how you can create new website from template using Import-SPWeb. If you use managed metadata fields in the you will find out, that these fields cannot be used after importing of the website. The reason is, that the link to the managed metadata application is broken. This script will fix it:

$url = "http://yoursitecollection"
$termStoreName = "yourTermStoreName"
$termSetName = "nameOfTheLinkedTermSet"
$listName = "nameOfTheListWithManagedMetadataField"
$fieldName = "nameOfTheManagedMetadataField"

$web = Get-SPWeb $url

$session = Get-SPTaxonomySession -Site $url

$termStore = $session.TermStores[0]

$group = $termStore.Groups[$termStoreName]

$termSet = $group.TermSets[$termSetName]

$list = $web.Lists[$listName]
$field = $list.Fields[$fieldName]
$field.SspId = $termStore.Id

$field.TermSetId = $termSet.Id
$field.Update()

$list = $web.Lists[$listName]
$field = $list.Fields[$fieldName]

$taxonomyList = $web.Lists["TaxonomyHiddenList"]

$field.SchemaXml = $field.SchemaXml.Replace($field.LookupWebId.ToString(), $web.ID.ToString())
$field.SchemaXml = $field.SchemaXml.Replace($field.LookupList.ToString(), $taxonomyList.ID.ToString())
$field.Update()

$web.Dispose()

The script relinks the managed metadata field to the termstore and fixed the link to the webid and link to the taxonomy hidden list.

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.

 

Announcement

March 25, 2013

Recently me and my friend Radek Matouch  started a new company. We focus on development and consulting in SharePoint  and .NET. Check out our website www.codeeffect.cz if you are interested and wish us luck . 😉

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.