Tuesday, July 10, 2012

Sharepoint 2010 - Full Crawl fails on Web Application with Access Denied Error

I started a Full Crawl of Content DataSource and I get this error message:

"Access is denied. Verify that either the Default Content Access Account has access to this repository, or add a crawl rule to crawl this repository. If the repository being crawled is a SharePoint repository, verify that the account you are using has "Full Read" permissions on the SharePoint Web Application being crawled"

even if I use an account with Full Read permission on that Web Application.

I go on Search Server machine for Sharepoint farm, with credential used for Default Content Access Account, and I try to navigate to site collection in that Web Application: I get error "Access Denied", browser asks me for credential and then "Error 401"..

So, the problem was that account used for Default Content Access cannot browse to site collections in Web Application, from the server search.

I correct with this post, from Microsoft: "You receive error 401.1 when you browse a Web site that uses Integrated Authentication..."
I followed Method 1 and works for me, very well!

Note: you can use method 2, but you have to restart computer, but method 1, you can restart only iis services..

Then, I go on Central Administration and Search Application Service, restart Full Crawl and.. it's all ok!

Thursday, July 5, 2012

Sharepoint 2010 - Show/Hide columns with Conditional Formatting

In a previous post I describe how show/hide columns of a list with UI language, using javascript.

Now, I show how do the same using Conditional Formatting feature of Sharepoint Designer 2010.

I have same list with columns for language, DescriptionIT, DescriptionEN.

Open Sharepoint Designer 2010, and edit page with list view.

Select List and add Parameter for language taken from Cookies:

Then, select tag <TH> for List Column DescriptionIT, using selector at the bottom of page:

Now, in the Condition Formatting panel, click on Create and Apply Formatting:

In the filter clause, click on Advanced and write code as below:

Then, click OK, and Set Style, in Layout section, set Display:none:

Click OK and OK again.

Repeat steps selecting <TD> tag for values of column DescriptionIT.
Do it again for DescriptionEN column, with condition "($cookieLanguage!='1033')".

Save page and view in browser, checking columns changing UI Language.

Tuesday, July 3, 2012

Sharepoint 2010 - Change UI Language with javascript

If you want to use html/javascript to change UI language, you can use the script below:
(Note: in the page, there is the function OnSelectionChange, so you have to change name if you want to use other feature in)

function OnSelectionChange(value)
    var today = new Date();
    var oneYear = new Date(today.getTime() + 365 * 24 * 60 * 60 * 1000);
    var url = window.location.href;
    document.cookie = "lcid=" + value + ";path=/;expires=" + oneYear.toGMTString();
    window.location.href = url;

And in page, set the flags for change language:

<a href="javascript:OnSelectionChange(1040)">
    <img width="32" height="20" src="/SiteAssets/flag_ita.png" border="0" alt="Italiano"/>
<a href="javascript:OnSelectionChange(1033)">
    <img width="32" height="20" src="/SiteAssets/flag_eng.png" border="0" alt="Inglese"/>

Sharepoint 2010 - Filter Web Part with Current User Language

I have to filter a List/Library on current User Language.
I add column Language Code, with values of platform language codes (1033 for english, 1040 for italian).

With Sharepoint Designer 2010, I modified Web Part and I set a new parameter as below, using COOKIE source parameter with "lcid" name:

and the filter :

So, web part shows me documents/items filtered with language = italian/english choosen by user!

For italian:
For english: