Hi everyone,
I’d like to answer a common question about how to modify the behavior the Variations feature in SharePoint 2010 uses when propagating pages. That is, how pages in the source variation site are copied and appear on target variation sites as minor draft versions.
Page propagation is triggered by publishing a page on the source variation site by default. Each time you publish a source page, the Variations Event Receiver adds a work item to the Variations Propagate Pages timer job queue. When the timer job runs, it will begin executing the first 100 page propagation work items. For each work item, Variations will copy the source page to all target sites, creating the page if it does not yet exist, or appending a draft minor version if the target page does already exist.
In some cases, users might not want changes to a page on the source to necessarily propagate to all targets. That is, users might want to make source-local changes and have the option to make changes globally applicable when they want. This often takes the form of a question like “How can I stop variations from overwriting my target pages every time I publish a source page?” Variations in SharePoint 2010 helps you do this.
In SharePoint 2010, we’ve worked to improve the Variations feature’s server citizenship by moving all Variations operations to the timer service. This way, server administrators can control the frequency with which operations run and better manage server load. The “Update Variations” button now adds a work item to the same Variations Propagate Page timer job queue as does publishing a page when “Automatic Creation” is enabled. What differentiates “Update Variations” is that you can also use this button to propagate source draft versions without publishing them on the source variation site.
When you run this PowerShell script to enable “On-Demand Page Propagation,” all Variations Propagate Pages timer job work items are filtered and discarded except those added to the queue by the Update Variations button:
Enable On-Demand Page Propagation:
[System.Reflection.Assembly]::LoadWithPartialName(“Microsoft.SharePoint”)
$site = new-object Microsoft.SharePoint.SPSite(“http://yourserver/sites/abc”)
$folder = $site.RootWeb.Lists["Relationships List"].RootFolder
$folder.Properties.Add(“DisableAutomaticPropagation”, “True”)
$folder.Update();
Disable On-Demand Page Propagation:
[System.Reflection.Assembly]::LoadWithPartialName(“Microsoft.SharePoint”)
$site = new-object Microsoft.SharePoint.SPSite(“http://yourserver/sites/abc”)
$folder = $site.RootWeb.Lists["Relationships List"].RootFolder
$folder.Properties.Remove(“DisableAutomaticPropagation”)
$folder.Update();
“Update Variations” in SharePoint 2010 can be used to propagate the current version of a page on-demand provided that the Variations Propagate Page Timer Job is enabled
In MOSS 2007, some users disabled the “Variations Propagate Pages” timer job in Central Admin as a workaround. With the timer job disabled, publishing a source page would not cause SharePoint to copy the source page to any target page. Authors on the source variation site could then use the “Update Variations” button to propagate the current version of the source page on-demand.
Clicking “Update Variations” in MOSS 2007 immediately propagated the current version of the source page to all target pages, “skipping the line” and bypassing the Variations Propagate Pages timer job. So when the timer job was disabled, “Update Variations” could still be used to propagate pages.
However, when the timer job is disabled, publishing pages on the source continues to add work items to the timer job queue if the “Automatic Creation” option is enabled, as it is by default. Over time, the queue can grow and contain hundreds or thousands of work items, all of which would begin to execute if the Variations timer job were re-enabled in the future. If you upgrade to SharePoint 2010 with a backlog of work items, SharePoint will discard these.
With the new “On-Demand Page Propagation” functionality, you can achieve this content distribution model out of the box.
“Update Variations” in MOSS 2007 works differently under the hood from its counterpart in SharePoint 2010
Things to keep in mind:
Thanks for reading. Happy propagating!
Josh Stickler
Program Manager
Howdy, my name is Dustin Anglin and I’m a Program Manager on the Enterprise Content Management team. Today I’m here to talk about the new things we’re doing with one of most popular SharePoint web parts, the Content Query Web Part, or as it’s better known amongst acronym-o-holics, the CQWP.
If you haven’t already checked it out, be sure to check out both the ECM overview by Jim Masson and the WCM overview by Sangya Singh.
For those of you who are new to the CQWP, here’s a brief explanation of what it does and what kinds of things you can use it for.
The Content Query Web Part is a tool that site designers can use to aggregate interesting and relevant slices of information on web page by letting you build queries through an easy to use UI and then display that content in unique, configurable ways.
The CQWP is designed to return roll-up content over several different scopes, anywhere from a single a list or library, to all lists or libraries across an entire Site Collection. In SharePoint 2010, the CQWP single list query is also optimized to work over large single libraries, taking advantage of smart indices and other tools designed to improve query performance over large document libraries.
For a more in-depth overview of the CQWP, I’d recommend checking out the SharePoint 2007 blog post by George Perantatos.
I find the best way to learn about something is to give an example, so let’s go through archetypical scenario that uses the CQWP to show news stories related to the current news story I’m reading. Also, since we don’t want older stories, we’ll make sure our web part is set up to show only recent stories, say stories created in the last week.
The Content Query Web Part is awesome for displaying queried content on a page, but I don’t want to have to add a new CQWP to a web part zone EVERY time I create a new news story, especially when I’m just going to set up the same web part over and over again.
In SharePoint 2007, you could add a CQWP to a page layout so it appeared on all pages of a certain type (for instance, in this scenario you could create a “News Article” page layout), the problem was, you could only set one query on that web part, which means each page using the “News Article” layout would return the same set of results.
What we want to do is have each “News Article” page show articles that are related to the current article I’m reading, like related sports stories if I’m reading a sports article.
We also need a metadata field to describe what kind of “News Article” the current article is, like Sports or Business, so we will add a new Managed Metadata field called “News Category” which we can link to the term store where we can create a managed taxonomy of news categories for our authors to pick from.
So here’s the conceptual outline for what our “News Article” page layout will look like:
I mentioned that we want our web part to be driven by the context of the current article, specifically the current articles “News Category.” In SharePoint 2010, we can accomplish this by setting up our query filters with two nifty new tokens:
This token lets you specify a field that is on the current page layout and dynamically replaces the value for the filter with the current page’s field value.
For Example: I’ve created a custom Managed Metadata field “News Category” which specifies what kind of story my “News Category” is (Business, Politics, World, Sports, etc…) and added it to the “News Article” page layout. By using the PageFieldValue token, the query will change based on the current pages News Category. So if the current page’s category is “Sports” it will return pages tagged with “Sports.”
Just like the PageFieldValue token, you can also choose to look at the URL query string for a value to use in the Query.
For Example: You could add a Query String value to the URL like “&NewsCategory=Sports” and set the CQWP’s query to return pages where the News Category field was equal to “Sports” or whatever value was currently in the Query String.
Using the query string parameter is better when you want to show different sets of results in a web part without having to make a new page for each different results set.
For this example, we will use the PageFieldValue token to setup our CQWP to return news articles whose “News Category” field contains the same metadata value in the current article’s “News Category” field. And by modifying the custom “News Article” page layout, the CQWP will automatically appear on all new “News Article” pages, already set up and ready to display related news articles.
Looking a bit closer at the query, you can see that I’ve added two other filters. The first one filters out any article with the same name as the current article (essentially making sure the current article isn’t duplicated in the query results), and a filter that only returns news stories created in the past 7 days, making sure the results are always fresh.
Also, in this instance, the “News Category” metadata field is one of the new Managed Metadata fields, which the CQWP fully supports, including the single & multi-value varieties. While not shown in this example, the CQWP also supports filtering over the Enterprise Keywords columns & the “All Tags” column which lets you look for any managed metadata tag on a queried item, regardless of which metadata field on the item contains the tag.
Some people love writing XSLT, and to them I say write all the XSLT you want and more power to you. However, for the rest of us, and some might argue the majority of us (we still love you XSLT coders), figuring out how to show field X, Y, and Z by writing XSLT is last thing we want to do.
In SharePoint 2010, one of the coolest new features to the CQWP is the ability to choose what fields you want to display directly in the tool pane UI. So now that the query is defined, let’s open up the Presentation section and check it out:
Going to the Presentation section of the tool pane, there is a new section called Fields to display which lets you type in the fields you want to display for any defined XSL style. So think of the Item Style as a blank template, defining how many things can be displayed and where they go, but not which fields get displayed. Once you’ve selected your template, you just need to plug in the fields that you want to display by typing them into the slots that show up for the given item style.
I chose to use a style that had an image on the left, a link to the page that was represented by the articles title, and a brief excerpt of the article (a Custom Field I defined for my page layout). By typing in the fields I want to display in each of those slots, I get the following results:
Total time spent messing with XSLT: 0.0 seconds! Woohoo!
So to recap things, here’s what we accomplished:
And here’s a look at the final product:
Now when my content authors write news stories, every article will have a web part showing the most recent related articles, and my content authors don’t have to mess around with web parts and queries.
This is just one example of some of the cool new things you can do with the Content Query Web Part by leveraging power of context driven queries, and the easy-to-use, code-less way to configure how you display your content. Check back often for more info on the CQWP and other exciting new ECM features in the SharePoint 2010.
View Changes is a new SharePoint 2010 Variations feature that compares two versions of a source page relevant to the corresponding target page. View Changes provides a report highlighting the differences between the source version that has most recently propagated to the target and the prior source version that propagated to the target and was published on the target. By highlighting differences, the View Changes button simplifies in-browser content editing using the Variations feature.
I’m Josh Stickler, the Program Manager responsible for Variations. In this post, I will explain:
The most common application of the Variations feature is in multi-language sites. Let’s look at View Changes from the perspective of Anders, an English-to-Danish translator working with the Danish subsidiary of AdventureWorks, an international camping goods retailer.
AdventureWorks is set up with an English (EN-US) site as its source label and target labels for international markets, each corresponding to a different language. Pages from the source label automatically propagate to the target labels when they are published so AdventureWorks’ global web presence is in sync. Translators at each of the targets then process the English-language content for localized consumption. AdventureWorks’ Variations hierarchy looks like this:
Let’s imagine that content authors at AdventureWorks in the United States have just published a new page with a sneak peek of this winter’s new product lineup. Since “Automatic Creation” is enabled (this is the case by default), the page is picked up by the Variations Propagate Pages timer job and copied to all target labels, including Danish (DA-DK).
As the designated owner of the new page, Anders gets an e-mail informing him that this page has been copied to the target label by the Variations feature and is ready for processing.
Anders navigates to the page on the Danish (DA-DK) variation of the AdventureWorks website and sees the English language content. Since it’s all new, he translates all of this content into Danish and submits the page for approval. The page is approved and published and now appears on the Danish variation of the website.
Since Anders received an entirely new page to translate, there were no changes to view; hence, the View Changes button is not available.
Back in the United States, AdventureWorks decides to announce a new product in its sneak peek lineup. English language content authors add a paragraph describing this new product, an ultra light sleeping bag, and publish the page. The page now propagates to the Danish variation.
Anders receives an e-mail notification that new content is ready for processing. He visits the appropriate page on the Danish variation site and the English content appears and is waiting for translation.
But wait, there is a lot of English content here, and Anders has already translated most of it. Only one paragraph has been added. How will Anders know that he doesn’t need to re-translate the whole page?
It’s at this point that the View Changes button comes to the rescue and is available.
Please note that View Changes requires the Variations Propagate Pages timer job to be enabled. View Changes only compares changes between a source version of a page and a target version that has been copied using the Variations Propagate Pages operation.
Anders clicks the button and a version differential window pops up, highlighting the new paragraph that has been added. Now, Anders knows that only this paragraph has been added and doesn’t have to scan through the new and old versions of the English content to determine what he has to translate.
Anders decides he prefers to revert back to the translated Danish version of the page as a basis for adding the new paragraph. With the View Changes window open, Anders knows exactly which paragraph to translate and where it goes. He adds the new content in Danish, submits for approval, and it’s published live on AdventureWorks’ Danish variation site. Fantastisk.
In addition to providing target variation site translators with insight into what content has changed when pages are copied from the source, SharePoint 2010 also enables authors on the source to decide when to propagate content to targets. By default in MOSS 2007, when content authors published pages in the source variation site, that page would automatically propagate to all target variation sites, even for small changes that are relevant only to the source variation site.
SharePoint 2010 provides the ability to disable automatic page propagation; source variation site content authors can then use the Update Variations button to propagate content on demand. See my previous post, “Site and Page Propagation” for more information on how to enable this setting.
Thanks for reading! Keep checking back for new blog posts.
Regards
Josh Stickler
Program Manager
As part of SharePoint 2010, we have created a set of features to help you collect, report, and analyze the usage and effectiveness of your SharePoint 2010 deployment. These features are a part of the Web Analytics capabilities of SharePoint 2010. The overview of the Web Analytics features in SharePoint 2010 was presented in this blog post.
This blog post delves deeper into the various metrics available to analyze the site usage data. There are three categories of the SharePoint Web Analytics reports: Traffic, Search, and Inventory. The reports are aggregated for various SharePoint entities like Site, Site Collection, and Web Application for each farm. Further, reports are also aggregated per search service application. By default, the reports show the data for a period of 30 days but you can change the time period to view data for up to 25 months by going to ‘Analyze’ tab in the Ribbon UI.
Visually we show the metrics in one of the two ways: trend reports and rank reports. A trend report shows how a particular metric is doing over a period of time. While a rank report, shows the top 2000 results for a particular metric. Figures 1 and 2 show examples of a trend and rank report respectively. That’s not all; you can further analyze the reports by applying filters like string match in the URL, user name, queries, browser and others.
Figure 1: Example of a Trend Report showing Number of Page Views for each day for a default period of 30 days.
Figure 2: Example of a Rank Report showing the Top Pages sorted on the Number of Page Views for a default period of 30 days.
What follows is an overview of each type of the report and the associated metrics. Also, summarized are the kind of reports available for each level of aggregation i.e. Site, Site Collection and Web Application and Search Service Application.
The traffic reports capture the user behavior information related to total clicks, frequent users, popular pages, and information about navigation to and from the current SharePoint component.
|
Report Scope |
Site |
Site Collection |
Web Application |
Search Service Application |
|
Number of Page Views |
|
|
||
|
Number of Unique Visitors |
||||
|
Number of Referrers |
||||
|
Top Pages |
||||
|
Top Visitors |
||||
|
Top Referrers |
||||
|
Top Destinations |
||||
|
Top Browsers |
Table 1: Summary of the traffic reports availability at different SharePoint hierarchy levels
The search reports capture the user behavior information related to the queries on the site.
|
Report Scope |
Site |
Site Collection |
Web Application |
Search Service Application |
|
Number of Queries |
||||
|
Top Queries |
||||
|
Failed Queries |
||||
|
No Result Queries |
||||
|
Best Bet Usage |
||||
|
Best Bet Suggestions |
||||
|
Best Bet Suggestion Action History |
Table 2: Summary of the search reports availability at different SharePoint component hierarchy levels
The inventory reports are targeted to help the site administrators in managing the site by keeping track of the site structure and storage and version issues.
|
Report Scope |
Site |
Site Collection |
Web Application |
Search Service Application |
|
Number of Site Collections |
|
|||
|
Storage Usage |
||||
|
Number of Sites |
||||
|
Top Site Production Versions |
||||
|
Top Site Languages |
Table 3: Summary of Inventory Reports availability at different SharePoint component hierarchy levels
Keep an eye out for more blogs on customizing the reports using Excel, using workflow feature to scheduled reports and alerts and adding the ‘What’s Popular’ Web Part to your pages.