Posts

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...

Sharepoint 2010 - Show/Hide columns with Conditional Formatting

Image
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 colum...

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> <a href="javascript:OnSelectionChange(1033)">     <img width="32" height="20" src="/SiteAssets/flag_eng.png" border="0" alt=...

Sharepoint 2010 - Filter Web Part with Current User Language

Image
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:

Sharepoint 2010 - Multilanguage Site - Show column in current language

Image
In multilanguage site feature, Sharepoint 2010 does not translate content of web part and metadata. We have to find a way to show to user content or metadata in current language. I used a list with columns with content in language and a lot of jquery to show and hide columns for current language. I have a list with "DescriptionIT" and "DescriptionEN" columns. Then, I set a view with both columns visible. In this view, I added a content query web part whit code below. In this code, I search for current language, i.e. "Italian", then search for column with "DescriptionIT", and hide all columns but "DescriptionIT" (with name starting with "Decsription"). Result is that if I change language (with Select Display Language), I see only column in respective language. Simple and cross platform. Here the code: <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js" type=...

Sharepoint 2010: BeforeProperties and AfterProperties in Event Receivers!

Event Receiver is a great feature for Sharepoint 2010, but I spent many time to discover how Properties works.. Especially BeforeProperties and AfterProperties.. I found a great post with resume all available values. Here table and below the link! http://www.synergyonline.com/Blog/Lists/Posts/Post.aspx?ID=122 These are the values of the properties in  List  events: List BeforeProperties AfterProperties properties.ListItem ItemAdding No Value New Value Null ItemAdded No Value New Value New Value ItemUpdating No Value Changed Value Original Value ItemUpdated No Value Changed Value Changed Value ItemDeleting No Value No Value Original Value ItemDeleted No Value No Value Null And here are the properties available in  Library  events: Library BeforeProperties AfterProperties properties.ListItem ItemAdding No Value No Value Null ItemAdded No Value No Value New Value ItemUpdating Original Value Changed Value Original Value ItemUpdated Ori...

Sharepoint 2010: Deactivate and Activate Feature with Power Shell

Sometimes, you can have trouble with feature upgrade in your site. Especially if you upgrade event receiver, adding new trigger. If you have many sub site using this feature, you can use Power Shell to deactivate and activate feature. This mine: [System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SharePoint") $rootUrl = "http://[SERVERNAME]" $site = Get-SPSite $rootUrl foreach($web in $site.AllWebs) {   $url = $web.Url   if($url -ne $rootUrl){    foreach($feature in Get-SPFeature -Web $url)    {     $featureName = $feature.DisplayName     if($featureName -eq "FEATURE NAME")     {       "Disable and Enable feature $featureName in $web"       Disable-SPFeature -Identity FEATURENAME -Url $url -Confirm:$false       Enable-SPFeature -Identity  FEATURENAME -Url $url       break;     }    }   } }