-->

Wednesday, 4 December 2013

SharePoint Multi-Language Variation Site

We will use the SharePoint Online variations feature to create multi-language site.
There will be a source site (most probably in English) where most of the authoring and creation of content will take place and there will be another target site (in your native language) which will be created with the help of 'Machine Translation Service'.
In the above figure it can be seen that we will first create a variation site in English and there will be target site in Hindi which will be auto generated from English.
First to begin please make sure we have following things in place,
  • Activate SharePoint Server Publishing Infrastructure feature on the ‘Root Site’ collection
  • ‘Root site’ is of type ‘Publishing Site’(in my case, http://sp2013labapp01/sites/demo )
  • Language Pack Hindi should be installed on all the Servers in SharePoint Farm

At the end of this article we will have 2 links,
  • Source Site in English: http://sp2013labapp01/sites/demo/en-us
  • Target Site In Hindi : http://sp2013labapp01/sites/demo/hi-in


Configure Variation Settings for your ‘Root Site’

In this step we will configure which and what things to create variation for.
  1. Go to Site Settings of your ‘Root Site’
  2. Click on ‘Variation Settings’
  3. Make sure the variation settings are as shown in the screenshot below
  4. These are the default settings and easy to go for this tutorial. Click on ‘OK’

Create a Source Variation Site (in English)

  1. Go to Site Settings of your ‘Root Site’
  2. Click on ‘Variation Labels’ -> Click on ‘New Label’
  3. In Site Template Language, select the language to be used in the multilingual user interface of the source site. In our case ‘English’. Select appropriate Locale, I will go with ‘English (United States)’. Under Variation Home Location, Just type ‘/’. Type the label as ‘en-us’. Refer screen below for the details,
  4. Select ‘Publishing Site with Workflow’ in the Publishing Site Template
  5. Enter the email address of person to be contacted for this label and click ‘ok’

Create Target Variation Site (in Hindi)

  1. Go to Site Settings of your ‘Root Site’
  2. Click on ‘Variation Labels’ -> Click on ‘New Label’
  3. Select the Site Template Language as ‘Hindi’ and Locale as ‘Hindi’. Click on ‘Continue’
  4. Enter Label Name as hi-in and appropriate description and display Name
  5. Select ‘Publishing Sites, Lists with Variations, and All Pages’ under Hierarchy Creation and click on ‘Continue’
  6. On this screen we want to enable both ‘Human Translation’ as well as ‘Machine Translation’
  7. Click on ‘Continue’ and on Target Label Behaviour  screen select ’Automatically update target variation pages’ and click on ‘Continue’
  8. Review the configuration once again and click on ‘Finish’

Now we have source site and target site configured but it’s not created yet! We need to create hierarchy between source site and target site.

Create Hierarchy

  1. Go to Site Settings of your ‘Root Site’
  2. Click ‘Variation Labels’
  3. Click on ‘Create Hierarchies’
  4. You can check the logs under ‘Variation Logs’
In the background it will run a timer job to create the sites and its hierarchies, You can run this jobs manually.

Once these jobs are executed successfully, you can examine the variation logs and it should show successful as below.
If you browse through both the urls you can see that there are two exact same sites created, One in English(en-us) and other in Hindi(hi-in)

Publishing the Page in Source Site

Let’s create a demo page ‘Bob Marley’ in our source site. Our ‘Machine Translation Service’ should create the same page in the target (Hindi) site

Now go to the Source site url (http://sp2013labapp01/sites/demo/en-us) and create a new page and name it as ‘Bob Marley’

Change the page Layout to ‘Image on Left’ and start constructing the page. Insert some image on left and add some text content on your right.

Page should look something like this,


Click on ‘Check it in’ from the ribbon and check in the page. After that it will ask for ‘Publish this draft’. Complete that as well.

On the Start "Page Approval’ page click on start. This will initiate the page approval workflow.
You have to get it approved from the user who is member of ‘approver’ list.

Imp Note : It is necessary that the page is approved and published else it won’t be translated !

For now execute the jobs mentioned previously, Manually.

Once completed successfully you will be able to browse the same page in our target site as shown below.

Happy SharePointing !!!

Creating and Configuring Machine Translation Service in SharePoint 2013

To Use the Machine Translation service to create the multi-language feature of SharePoint 2013 we need to first make the ‘Machine Translation Service’ up and running in your farm.

So this article will outline on creating and configuring the machine translation service for SharePoint and in the next article I will outline the steps to create a multi-language site.

Creating Machine Translation Service

Open Central Administration, go to Application Management section, and choose Manage service applications.

On the ribbon, choose New, and then choose Machine Translation Service.


On the next page type a name for the service application and fill in the details as shown in the screens below


Select the check box near 'Add this service application's proxy to the farm's default proxy list.' and verify the database name, and click ok.

Configuring Translation Machine Service


Click on the ‘Machine Translation Service’ we just created, under the ‘Manage Service Applications’ in Central Administration


In the Machine Translation Service Screen, there is a section called ‘Enabled File Extensions’. It depicts the file extension for which the translation is enabled. Uncheck the checkbox for the file extension for which you want to disable translation


In the Item Size Limits section,
Maximum file size for binary files in KB. Microsoft Word documents are binary files:  51200
Maximum file size for text files in KB. Plain-text, HTML, and XLIFF documents are text files:  5120
Maximum character count for Microsoft Word documents:  500000



In the Online Translation Connection,
Under Web proxy server, select the check box for 'Use default internet settings' to use the default proxy settings to connect Internet or specify the port in the 'Use the proxy specified'

In Rest of the section fill the following details,
Translation processes:  1
Frequency with which to start translations (minutes): 15
Number of translations to start (per translation process): 200
Maximum translation attempts:  2
Maximum number of synchronous translation requests (per server): 10
Maximum number of items which can be queued within a 24-hour period: No Limit
Maximum number of items which can be queued within a 24-hour period per site subscription: No Limit
Expiration time for completed job history (days):  7 Days
Recycle threshold:   100
Disable Office 97-2003 Document scanning? No

And click on ‘Ok’

Thursday, 28 November 2013

Query Rules in SharePoint 2013



With the help of Query Rules in Sharepoint 2013 without any custom code we can promote a specific result or even change the ranked result by changing the query. Search Expert or the Search Manager of the organization has the freedom and power to change the search experience and adapt it to the organization needs. Defining the right keywords to be matched on the user queries and mapping the conditions with the relevant actions is easy but the process must undoubtedly be well managed. The management of the query rules should definitely be part of your SharePoint 2013 search governance strategy.

A query rule can specify the following three types of actions:
  • Add Promoted Results
  • Add one or more groups of results, called result blocks.
  • Change the ranking of results.

How to Add Query Rule:
Let’s take a scenario where organization is maintaining the list of glossary terms managed in the organization. When we search in google “meaning of activity”, it automatically recognizes that user wants to know the meaning of the word ‘activity’ and it highlights its meaning at top and displays the rest of the results in bottom.


SharePoint also provides this feature using ‘Query Rule’ feature.

By default, when we search for ‘definition of activity’ or ‘meaning of activity’ it returns the results including keywords definition and activity.
We have managed the list of glossary terms in a list as shown below,


Go to Search Setting of the Search Center site and Click on ‘Query Rules’
Select ‘Local SharePoint Sites’ under click on ‘Add Query Rule’
Name it as ‘Glossary Rule’ and select ‘Query Contains Action Term’ as a Query condition as shown below



Add ‘definition of;meaning of’ under the Action Terms phrases. So that whenever end user search for ‘definition of activity’ it excludes the terms definition of and search only for ‘activity’ in the glossary list.
Click on Change rule query and it will open this window

Select the ‘Glossary’ result source. (You need to create the glossary results source first which returns the results only from the glossary list)
Under the keyword filter select ‘{SubjectTerms} – the unmatched query terms’ and click on ‘Add property filter’



Click on ‘Add Result Block’



Click ok
Publishing section defines from which period of time from start date to end date this query rule should be active.



Click on ok.
Now go to your search center and search for ‘definition of activity’

You can see that it promoted the results from the glossary list.


Happy SharePointing !!

SharePoint Crawls - Full, Incremental, Continuous

Full Crawl

Full Crawl of Content source will re index all the content from beginning

Important Points to Consider:
  • If new managed property has been introduced, we need to run Full Crawl of content source     
  • If new crawl rules are created/updated/deleted, Full crawl of content source is required
  • If incremental crawl has been failed
  • If software update or service pack has been installed on the servers
  • Expensive in terms of performance issues


Incremental Crawl

Incremental Crawl of Content source will only process those items which are changed since the last crawl happened.

Important Points to Consider:
  • Most preferred after the full crawl has been done.
  • Does not hamper the performance as it will crawl only modified documents not the entire content source.
  • The incremental crawl will retry items and postpone crawling the item if the error persists.


A limitation with the Full Crawl and Incremental Crawl is we cannot schedule both to execute parallel. For example if the Full Crawl is already running then the Incremental Crawl cannot be triggered until the Full Crawl completes, if you try to Stop Full Crawl then also it is mandatory to finish at least once successful Full crawl before triggering any Incremental Crawls.

So Microsoft has come up with the concept of Continuous Crawl

Continuous Crawl

With Continuous Crawl you can maintain the content index as fresh as possible.               
    More than one continuous crawl can run in parallel
    one deep change will not result in degraded freshness on all following changes

The impact of a "Continuous Crawl" is the same as an incremental crawl.

At the parallel execution of crawls, the "Continuous Crawl" within the parameters defined in the "Crawler Impact Rule" which controls the maximum number of requests that can be executed by the server (default 8).

Enable Continuous Crawl using PowerShell


#Get Search Service Application(SSA)
$ssa = Get-SPEnterpriseSearchServiceApplication

#Get the Content Source for which you want to enable continuous crawl
$cs = Get-SPEnterpriseSearchCrawlContentSource -SearchApplication $ssa -Identity "Local SharePoint sites"

#Set the EnableContinuousCrawls property to true
Set-SPEnterpriseSearchCrawlContentSource -Identity $cs -EnableContinuousCrawls $True

#Set the interval - You can skip this part by default SharePoint will run  continuous crawl for every 15 minutes. Here I am using 30 minutes
$interval = "30"

$ssa.SetProperty("ContinuousCrawlInterval", [int]$interval)

$ssa.Update()

To Disable Continuous Crawl using Powershell


We can use the same PowerShell script mentioned above, with the following change in the line where we need to set ‘EnableContinuousCrawls’ property to ‘False’

Set-SPEnterpriseSearchCrawlContentSource -Identity $cs -EnableContinuousCrawls $True



The Subscription Settings service and corresponding application and proxy needs to be running in order to make changes to these settings

I see the following error when I tried to configure my App Url


Execute the following commands


Get-SPManagedAccount contoso\sp_services
$appPool = New-SPServiceApplicationPool -Name SubscriptionServiceAppPool -Account $account
$serviceApp = New-SPSubscriptionSettingsServiceApplication -ApplicationPool $appPool -name "Subscription Settings Service Application" -DatabaseName "SP2013AppSubscriptionSettingsDB"
$serviceAppProxy = New-SPSubscriptionSettingsServiceApplicationProxy -ServiceApplication $serviceApp



Make sure the below services are started


Perform an iisreset

Configure DNS

Create a forward lookup zone for the app domain name

1.       Verify that the user account that performs this procedure is a local administrator on the domain controller.
2.       Click Start, point to Administrative Tools, and then click DNS.
3.       In DNS Manager, right-click Forward Lookup Zones, and then click New Zone….
4.       In the New Zone Wizard, click Next.
5.       In the Zone Type page, accept the default of Primary zone, and then click Next.
6.       In the Active Directory Zone Replication Scope page, select the appropriate replication method for your environment (the default is To all DNS servers in this domain), and then click Next.
7.       In the Zone Name page, in the Zone name box type the name for your new app domain name (for example, ContosoApps.com), and then click Next.
The New Zone Wizard shows the new domain name for apps.

1.       On the Dynamic Update page, select the appropriate type of dynamic updates for your environment (the default is Do not allow dynamic updates), and then clickNext.
2.       On the Completing the New Zone Wizard page, review the settings, and then click Finish.

Create a wildcard Alias (CNAME) record for the new domain name

1.       Verify that the user account that performs this procedure is a local administrator on the domain controller.
2.       In DNS Manager, under Forward Lookup Zones, right-click the new app domain name, and then click New Alias (CNAME).
3.       In the New Resource Record dialog box, in the Alias name (uses parent domain if left blank) box, type *.
The Fully qualified domain name (FQDN) box displays *. followed by the domain name that you created for apps. For example, *.ContosoApps.com or *.Contoso-Apps.com.
4.       Next to the Fully qualified domain name (FQDN) for target host box, type the FQDN of the server that hosts the SharePoint sites.
For example, SharePoint.Contoso.com.
Or:
a.       Next to the Fully qualified domain name (FQDN) for target host box, click Browse and navigate to the Forward Lookup Zone for the domain that hosts the SharePoint sites.
For example, Contoso.com.
b.       And then navigate to the record that points to the server that hosts the SharePoint site.
For example, SharePoint.
New Resource Record dialog box shows the wildcard alias for the app domain and the FQDN of the server that hosts the SharePoint sites.



5.       Click OK.


Go Ahead and Load the Page “Configure App URLs” page, it should load successfully.

Happy SharePointing !


'Install app for SharePoint': Failed to install app for SharePoint

Now after enabling the “Developer Site” feature on my site collection, I go ahead and deploy the same App but now this time I get this error



Now this error comes up because I have not configured app catalog or app catalog url

So I need to create a catalog app catalog site first

  1. Go to Central Administration ->Apps
  2. Go to “App Management” -> Manage App Catalog
  3. Select any appropriate web application where you want to create app catalog site and give it a name
  4. Click ok.


But when I click the “Configure App URL” I get the below error.


The Subscription Settings service and corresponding application and proxy needs to be running in order to make changes to these settings

More about this error in my next post over here !

Sideloading of apps is not enabled on this site

I created my first SharePoint 2013 App and tried to deploy it in my SharePoint Farm and it shoot me the below error right into visual studio.



This Error comes up when you try to deploy app to site which is not a developer site. If you create a developer site and deploy the same app, it will work just fine.

But you can just go ahead using the same site by enabling the “Developer Site” feature on your current site collection

Execute the following PowerShell command on SharePoint PowerShell



Enable-SPFeature -Identity e374875e-06b6-11e0-b0fa-57f5dfd72085 -url <siteurl>


Happy SharePointing !

The SharePoint Server Publishing Infrastructure feature must be activated at the site collection level before the Publishing feature can be activated.

While creating a new search site in my site collection I got this error!


You might get this error while creating Business Intelligence Center site

Resolution:

Activate publishing at the site collection level


1.       From the root of your site collection, click Settings Small Settings gear that took the place of Site Settings. > Site settings.
2.       On the Site Settings page under Site Collection Administration, click Site collection features.
3.       On the Site Features page, scroll down to SharePoint Server Publishing Infrastructure and click Activate.

Once publishing features are activated, sub sites inherit them automatically. But, if you built a site before activating the publishing infrastructure, you’ll have to manually activate it for each site.


Activate publishing at the site level


1.       From any page within the site, click (gear icon) Settings Small Settings gear that took the place of Site Settings. > Site settings.
2.       On the Site Settings page, in the Site Actions section, click Manage site features.
3.       On the Site Features page, next to SharePoint Server Publishing, click Activate.


Using Powershell


Execute the below command in SharePoint Management Shell

Enable-SPFeature -Identity PublishingSite -Url http://sp2013labapp01/

Enable-SPFeature -Identity PublishingWeb -URL http://sp2013labapp01/



Happy Sharepointing !

SharePoint 2013 Apps - Troubleshooting Common Errors


Error occurred in deployment step 'Install app for SharePoint': The System Account cannot perform this action




I was trying to deploy the App with the system account I used to configure/setup my SharePoint 2013.

In SharePoint 2013, System Account cannot deploy any app into the SharePoint because of security reasons.

Workaround:
  1. Create/User another account to open the visual studio and try deploy the App
  2. However, Newly created account should have following permissions
    • Add the new account to FARM administrator’s group in Central Administration
    • Created account should be part of local server admin group
 

Happy SharePointing !!


Target Audiences in SharePoint


Audiences are created as part of the User Profiles service in SharePoint, and a user’s inclusion in an audience is defined by a set of rules that can combine membership in groups or user profile property comparisons.
Audience targeting is use to personalize content display including list or library items, navigation links, or Web Parts. Audience targeting is commonly used to filter news items on Portals. As an example, the Content By Query Web Part (CQWP) supports audience targeting when doing content aggregation.

***Since the Target Audiences field is not defined as a Site Column, the column cannot be added to a Content Type through the SharePoint User Interface

It allows your page to configure itself depending on who is viewing it. For instance you could use Target Audiences to:
§  Show an English language test to one set of people and a Spanish language one to another
§  Show an assessment only to approved people
§  Show a different survey to people depending on their context
§  Show an observational assessment only to instructors or monitors, and not show it to ordinary participants
§  Give different assessments to people in different departments

What to choose for Target Audience?


It’s easiest to choose audiences as SharePoint groups, distribution lists or security groups used in authentication

You can also define rules-based groups of people called global audiences, which gives potential of more sophisticated filtering.