Showing posts with label Variations. Show all posts
Showing posts with label Variations. Show all posts

Sunday, May 1, 2011

Sharepoint variations guide. Part 2– propagation use cases

In the 1st part of this series I made overview of basic features and configuration settings of the variations in Sharepoint. In this part I will describe basic use cases and show how configuration settings affect them. As you remember from 1st part there is possibility to specify how content (pages and sites) will be propagated: manually or automatically (Site settings > Variations > Automatic Creation). However there are another settings which affects this behavior: using PowerShell you can disable automatic propagation of the pages (not sites), so setting “Automatic Creation” will be ignored for the pages, although sites will continue to follow it (see Manage automatic propagation of variation pages for details). So we have 2 options: manage variations propagation via UI (Site settings > Variations > Automatic Creation) and using PowerShell. What is the difference between e.g. manual propagation specified in UI and PowerShell? In this post I’m going to answer these and other questions.

As you also remember from 1st part there are several timer jobs related with variations. For convenience I will show them as well:

Job title Description

Variations Create Hierarchies Job Definition 

Creates a complete variations hierarchy by spawning all sites and pages from the source site hierarchy for all Variation labels.
Variations Create Page Job Definition Creates peer pages in variant sites.

Variations Create Site Job Definition

Creates variant sites when the Variations Automatic Creation setting is disabled.
Variations Propagate Page Job Definition Updates peer pages in variant sites.
Variations Propagate Site Job Definition Creates variant sites when the Variations Automatic Creation setting is enabled.

I will show when each of these jobs are used depending on what settings are configured for automatic propagation and how you propagate variations. As there are many parameters which affect variation usage I think that it will be more clear to show them in tables.

Lets start from creation of variations hierarchy. Go to Site settings > Variations labels and create new label. Check “Source Variation” option for new label. The create at least one variation target. All sites in variations hierarchy will use the same site template as site template of variation source (site template dropdown list is available only for source when “Source Variation” checkbox is checked. For variation targets it will be disabled). After you created all labels click “Create hierarchies” button. Variations hierarchy will be created by time job “Variations Create Hierarchies Job Definition” – you can force via Central Administration > Monitoring > Job Definitions > Variations Create Hierarchies Job Definition (for your web application) > Run now. After that variation hierarchy will be created and you can test pages and sites variations propagation with it.

At first lets check how sites propagation works, because it is more simple in sense that they don’t depend from PowerShell settings.

Sites:

Automatic Creation = On Automatic Creation = Off
In order create new site and propagate it on variation targets you need to perform the following steps:

1. Create publishing site under variation source (e.g. from OTB Site manager page)

2. As Automatic Creation = On, newly created site will be propagated automatically using timer job “Variations Propagate Site Job Definition”. You can force it if will go to Central Administration > Monitoring > Job Definitions > Variations Propagate Site Job Definition (for you web application) > Run now

3. As result new sub site will be propagated to all variation labels. I.e. all variation labels will now have the same sub site as variation source
When Automatic Creation = Off you need to do the following:

1. Create publishing site under variation source (e.g. from OTB Site manager page)

2. In Site manager select newly created site and from menu choose New > Variation site

3. New window will be opened when you can specify under what variation label you need to propagate this site. This is the difference between automatic propagation and manual propagation: in case of automatic propagation site is propagated to all variation labels, in case of manual propagation – only to one variation label. Of course you can propagate it manually to all labels one by one.

4. When variation is created you can force its creation from Central Administration > Monitoring > Job Definitions > Variations Create Site Job Definition (for you web application). I.e. other job is used in order to propagate sites when manual creation is selected.

Now lets check similar cases for pages. They are more complicated because both UI configuration settings and PowerShell settings affects their propagation. Also for pages we need to separately check how new pages are propagated and how updates of existing pages are copied to variation labels.

First of all disable automatic variation propagation by the following PowerShell script (see Manage automatic propagation of variation pages):

   1: $site = Get-SPSite "<SiteURL>"
   2: $folder = $site.RootWeb.Lists["Relationships List"].RootFolder
   3: $folder.Properties.Add("DisableAutomaticPropagation", $true)
   4: $folder.Update()
   5: $site.Close()

So now we are considering the case when Automatic propagation (PowerShell) = Off:

  Automatic Creation (UI) = On Automatic Creation (UI) = Off
New page propagation 1. Create new publishing page under variations source (Site Actions > Create Page) and publish it

2. In order to propagate this page to variation targets in ribbon Publish in Variations category you can choose one of the 2 options:

2.1. Create – it will propagate page to only one selected variation target. You can specify different URL for the variation page. Copied page will have Draft status initially. In order to force page propagation you need to use “Variations Create Page Job Definition”. If page already exists on all target sites it will add the following message in variations log:
”All variation sites of the current site already have a variation of this page. Cannot create a new page variation”

2.2. Update – it will copy the page to all variation labels. All copied pages will have the same URL as source page and will have Draft status initially. In order to force pages propagation you need to use “Variations Propagate Page Job Definition”
When you disable automatic variations propagation via PowerShell then Automatic Creation UI setting is ignored for pages. It only affects sites. So all behavior will remain the same as for Automatic Creation (UI) = On.
Updates of existing page propagation 1. Update content on variation source page (e.g. some rich html field) and publish the page

2. Choose in ribbon Publish > Variations > Update. It will propagate changes on all variation pages on target sites

3. In order to force pages propagation you need to use “Variations Propagate Page Job Definition”
The same as for new pages - Automatic Creation UI setting is ignored and all behavior will remain the same as for Automatic Creation (UI) = On.

Now lets enable automatic pages propagation in PowerShell and will make the same test:

   1: $site = Get-SPSite "<SiteURL>"
   2: $folder = $site.RootWeb.Lists["Relationships List"].RootFolder
   3: $folder.Properties.Remove("DisableAutomaticPropagation")
   4: $folder.Update()
   5: $site.Close()

Now Automatic propagation (PowerShell) = On:

  Automatic Creation (UI) = On Automatic Creation (UI) = Off
New page propagation 1. Create new publishing page under variations source (Site Actions > Create Page) and publish it

2. In order to propagate this page to variation targets in choose Publish > Variations > Update – it will copy the page to all variation labels. All copied pages will have the same URL as source page and will have Draft status initially. In order to force pages propagation you need to use “Variations Propagate Page Job Definition”
1. Create new publishing page under variations source (Site Actions > Create Page) and publish it

2. Now if you will try to propagate new page by forcing “Variations Propagate Page Job Definition” – it won\t propagate it. Instead it will show the following message in Variations log (Site settings > Variation logs):
”Variation Site and Page Auto-Spawn is off so no new pages will be created”

3. In order to propagate this page to variation targets in ribbon Publish in Variations category you can choose one of the 2 options:

3.1. Create – it will propagate page to only one selected variation target. You can specify different URL for the variation page. Copied page will have Draft status initially. In order to force page propagation you need to use “Variations Create Page Job Definition”

3.2. Update – it will copy the page to all variation labels. All copied pages will have the same URL as source page and will have Draft status initially. In order to force pages propagation you need to use “Variations Propagate Page Job Definition”
Updates of existing page propagation 1. Update content on variation source page (e.g. some rich html field) and publish the page

2. In order to propagate changes you don’t need to click any buttons in ribbon Publish > Variations. It will be automatically propagated by “Variations Propagate Page Job Definition”
For updates behavior is the same as for Automatic Creation (UI) = On.

That’s all what I wanted to write about variation use cases. Hope it will help you to understand the big picture and you will be able to use it in your every day work.

Sunday, April 3, 2011

Sharepoint variations guide. Part 1 – overview

In this series of posts I would like to summarize available configuration options for Sharepoint variations and show how they are used in content production. In this first part I will make an overview of Sharepoint functionality, available configuration options and add my comments with details of these options. This material is necessary in order to go with part 2, where I will focus on actual usage of OTB variations for propagating of the content.

As you probably now variations are designed for multilingual sites support in Sharepoint (I recommend you also to check Gary’s Lapointe presentation: Variations and the MUI in SharePoint 2010 and his post Fun with Variations). Here we are talking about variations in Sharepoint 2010 which have several improvements comparing with 2007 version. The most significant improvement is that variations are now propagated via timer jobs (not in w3wp process). There are several different timer jobs related with variations, and in part 2 I will describe each of them – in which case each job is used, how they work with different variations configurations, etc.

Basic idea of variations is simple enough: there is source site (variations source) where content producers publish content (its basic version). There is one variations source site per site collection. There can be also several variations labels (target sites) where changes will be propagated when content producers create new publishing page (or update content on existing publishing page) or create new sub site under variations source site (this sub site will be created under variation targets as well). After that content producers responsible for local content should review propagated content and make translation if necessary. There is one known pain point with it – when source page is published, source page content will be overridden completely (i.e. not only changed part), so people who responsible for managing translated content should revert it and translate changed places manually.

Important thing which you should clearly understand when working with variations is that they do not deal with UI. Sharepoint 2010 has different functionality for supporting multilingual user interface (MUI) (this is out of scope of this article - see Gary’s Lapointe presentation), while variations deal with multilingual content. Variations source site and variations target sites are combined in one entity called variations hierarchy.

It is important to understand also that Variations are part of Publishing infrastructure feature. It means that they work only with publishing pages and publishing sites (plus they affect images located in PublishingImages document library – but not always. Only if you select “Copy resources” in Site settings > Variations > Resources – see below). All another lists and document libraries (both OTB and custom) are not propagated with OTB variations. If you need it you will need to develop custom solution (based on event receivers for example).

As variations exist on site collection level, all configuration is made on site collection’s root site (Site Actions > Site settings). There are 3 variation related settings available:

  • Variations – contains all variation related settings. We will pay special attention on “Automatic Creation” option below. All other options are more or less self descriptive:
Variation setting name Description
Variation Home Type the starting location where variations of this site will be created. Variations of this site will include the site and all subsites.
You can specify root site of site collection to be variation home – in this case you need to specify “/” in this field. The value in this field will be used when you will create variation hierarchy in Site settings > Variation labels (see below).
Automatic Creation Choose whether you want to automatically create corresponding variations when a site is created or a new page is published, or not to create variations automatically.
See part 2 for more details.
Recreate Deleted Target Page Choose whether a new target page should be recreated when the source page is republished if the previous target page has been deleted.
Update Target Page Web Parts Choose whether Web Part changes from source page should be updated to existing target pages. Note that Web Parts personalization will be lost when update is made.
Notification Select the checkbox to have e-mail sent to the contact person of the welcome page of the target site when a new subsite or page is created, or the contact person of a page when a target page is updated with revisions from the source variation.
Resources Choose whether to have new page variations use the same resources as the original page or to use copies of these resources created in the location of the new page.
  • Variations labels – here you create variation hierarchy (source and target sites). Important to know that you can choose site template only for variation source site. This option is disabled for target sites (variation labels) – they will be created using the same site template as source site.
    When you create new variation label you need to specify the following settings:
Variation label setting name Description
Label name and Description Label name is relative URL for the newly created variation site. Full URL is combined from “Variation Home” (see above) and Label name
Display name Technically it will be a title of a newly created site. As official description says: “Most often display names are localized versions or user friendly versions of the label”
Language Specifies language of newly created variation site. This option determines UI language of a site. Amount of available languages depends on how many language packs you installed into the system. Several variations labels may have the same language
Locale Locale specifies format of dates, currency, etc. for newly created variation label site
Hierarchy Creation Specifies what content should be propagated on newly created variation label from source:
- Publishing Sites and All Pages
- Publishing Sites Only
- Root Site Only
Source Variation Specifies whether newly created variation label site will be variation source. It can not be changed once variation hierarchy is created.

When variations hierarchy is defined, you should click “Create Hierarchies” button (in Site settings > Variation labels). After that “Variations Create Hierarchies Job Definition” (see below) will create sites hierarchy.

  • Variation logs – contains log records written by variation-related timer jobs (see below)

Here is table with variation related timer jobs. Descriptions of timer jobs available in Central Administration are not always clear enough – in part 2 I will describe where and how each of job is used:

Job title Description

Variations Create Hierarchies Job Definition 

Creates a complete variations hierarchy by spawning all sites and pages from the source site hierarchy for all Variation labels.
Variations Create Page Job Definition Creates peer pages in variant sites.

Variations Create Site Job Definition

Creates variant sites when the Variations Automatic Creation setting is disabled.
Variations Propagate Page Job Definition Updates peer pages in variant sites.
Variations Propagate Site Job Definition Creates variant sites when the Variations Automatic Creation setting is enabled.

All these jobs are web application specific, so if you have several web applications on your server, these jobs will be created for each of them. Very useful thing with jobs in Sharepoint 2010 is that you can force them from UI (Central Administration > Monitoring > Job Definitions > select job and click Run Now button). It really helps when you make testing of some variation functionality.

The overview of Sharepoint functionality for variations would be complete if I won’t mention Relationships list – hidden list in the root site of site collection where Sharepoint stores relations between variation pages and sites. This list often becomes another pain point for people who work with variations as often relations get corrupted. This theme is out of the scope of my article, for details I send you to mentioned Gary Lapointe blog post.

This is what I would like to show in overview of variations functionality in Sharepoint. In the 2nd part I will show how it is used in content production.

Update 2011-05-01: the 2nd part of the article is published here: Sharepoint variations guide. Part 2– propagation use cases.