Wednesday, December 25, 2013

UserAgent not available

Recently on one of my projects I had to replace the Web Front End (WFE) due to some memory problems. Switching the WFE went smoothly, but after a day I had errors popping in the ULS logs and I was getting "Request time out" issues. Ther error in ULS log was:


UserAgent not available, file operations may not be optimized.    at Microsoft.SharePoint.SPFileStreamManager.CreateCobaltStreamContainer(SPFileStreamStore spfs, ILockBytes ilb, Boolean copyOnFirstWrite, Boolean disposeIlb)…………….


I came across couple of posts about clearing blob cache etc but it didn't work for me.

After spending couple of hours investigating and comparing the settings with old WFE, the issue turned out to be firewall settings, the WFE didn't have access to internet. A weather webpart on the home page was quering the net for weather info on the server side. Once the (appropriate) firewall rules were applied everything worked fine....

hth

Saturday, October 12, 2013

Breadcrumb in SharePoint 2013

Estruyf has an excellent post on using the Suite Bar for Breadcrumb. In my case I needed it for my SharePoint Online (O365) project and I was using Starter Master Pages by Randy Drisgrill.

The below are some tweaks that I did to get it working:

The below control in the master page generates the Ribbon and the Suite Bar
<PublishingRibbon:PublishingRibbon runat="server" />

With limited support for PowerShell in SharePoint Online, I instead used Estruvf's JS code and used it my MasterPage. I updated the below lines:

From:
if (_spPageContextInfo.pageListId.toUpperCase() == ctx.listName.toUpperCase()) {

To:
if (_spPageContextInfo.pageListId.toUpperCase() == ctx.listName.toUpperCase() || _spPageContextInfo.pageListId.substring(1, _spPageContextInfo.pageListId.length - 1).toUpperCase() == ctx.listName.toUpperCase()) {

to show breadcrumbs for Calendars.

From:
this.elm.innerHTML = this.breadcrumb;

to:
For SharePoint Online: $('#suiteBrandingBox').text(this.breadcrumb);  
For SharePoint 2013:   $('#ms-core-brandingText').text(this.breadcrumb);


The suiteBrandingBox is generated by the PublishingRibbon control, 
and lastly I didn't need to show the Home site, I included the following in the onQuerySuccess function (parentWeb)
if (this.parentweb.get_serverRelativeUrl() != "/")

HTH


Monday, September 23, 2013

Provisioning TermSets/Terms to Terms Store from Apps

I was reading Deploying Managed Metadata Fields by Luis Manez, in the blog he mentions about creating TermSets and Terms with PowerShell. I couldn't get it working and instead created an APP to provision the TermSets and Terms.

Below are brief steps:

1. Create a "App for SharePoint 2013" Project (SharePoint-hosted)

2. Open AppMainifest.xml and set the Permissions


3. below is the js code



call the InitiateTaxonomy from the onGetUserNameSuccess method.

4. Deploy the app and verify by navigating to the Term Store Management.



Note: I used the publishing site template, the Site Collection was already created.

Thursday, September 19, 2013

Tiles view with Client Side Rendering

In my previous post I wrote about Tiles view with CQWP. You can also achieve this using Client Side Rendering (CSR examples by Wesley).

I wanted my custom list to have Tiles view:



I created a Javascript Display Template file & uploaded to the masterpage gallery and set the JS Link in the Miscellaneous section.

Below is the sample CSR code (update the styles..):



CSS:



Note: I have the DisForm hard coded, I couldn't find a way to get the DisplayUrl property like in REST. I shall update this when I come across a better way.

Output:

Thursday, August 22, 2013

Tiles view with CQWP

SharePoint 2013 includes a new list (App) "Promoted Links" that displays links in a tile based visual format.


My goal was to create a Promoted Links list but with some kind of filtering like Expiry on Announcement list. The prompted links doesn't provide with this option in the web part settings
or in the Tiles view:

I used the good old Content Query Web Part (CQWP) to achieve the tile view. The following are the steps:
1. Create a List with title, expiry, description and image columns
2. Update the ItemStyle.xsl file with following sample code: (fix the inline styles)



4. Update your stylesheet with below


5. Insert a CQWP, select your list, the above Item Style set your expiry filter and update the presentation fields.

You get the following:


Thursday, April 11, 2013

Managed Metadata Navigation - Issue

SharePoint 2013 has a new feature - Managed Navigation

You can follow (@bniaulin) Benjamin Niaulin's article on NBSP to setup the site navigation.

You might come accross the following error whilst setting up the metadata navigation:

Error loading navigation: The managed Navigation term set is improperly attached to the site.



The issue for me was:
  1. I created Terms within the default "Site Navigation"
  2. "Navigation & Term-Driven pages" Tabs missing for all the Terms
  3. I checked the "Use this Term Set for Site Navigation" under Intended Use tab for "Site Navigation" - this displayed the above tabs for all terms
  4. Set the Target page for the Term under Term-Driven Tab
Solution:
I went back to Site Settings > Navigation, Selected "Structural Navigation" for global and current navigation, saved it & set it back to managed navigation to the fix the issue.

Another solution: Create Term Set button in the navigation settings page, this will take care of any settings.

HTH

Saturday, March 23, 2013

VMWare: Memory release on suspend

I faced a similar issue outlined in this thread on the VMWare site.

It was talking more than 20 mins to release 12GB of memory after the suspend process completed and no programs were responding.

I updaed my config.ini file (C:\ProgramData\VMware\VMware Workstation) with the following settings as per @continuum's reply on the thread.

mainMem.writeZeros = "TRUE"
mainmem.useNamedFile = "false"

This did the trick with memory released in a flash.

Sunday, March 17, 2013

SharePoint-hosted app: Deployment issues

You have installed SharePoint 2013 and ready to write apps.

You have downloaded the SharePoint 2013 Developer Tools for Visual Studio 2012.

You have chosen to write a SharePoint-hosted app. Read How to: Create a basic SharePoint-hosted app

When you try to deploy your app from Visual Studio by pressing F5, you get the following errors:

Error: Sideloading of apps is not enabled on the site - Apps are disabled on the site
Reason: You are trying to deploy the solution to a site that was not created using the new Developer site template:
Solution: Either you create a new site with the Developer template or run the following Powershell script: Enable-SPFeature e374875e-06b6-11e0-b0fa-57f5dfd72085 –url <SiteUrl>


Error: App Management Shared Service Proxy is not installed
Reason: One or more service application is not running.
Solution: Navigate to Manage service applications under Central Admin, make sure the App Management Service, Secure Store Service and Security Token Service applications are provisioned and running.


Error: There are no addresses for this application
Reason: Isolated app domain missing
Solution: Follow the steps outllined here to configure the isolated app domain

HTH

Saturday, March 16, 2013

Installing SharePoint 2013: .Net 4.5 error

I faced the below error whilst installing SharePoint 2013 on Windows Server 2012, I did run pre-requisites tool before the installation.
















I cross checked the features under the Server Manager for .NET framework 4.5, which was installed.

















The issue turned out to be the versions of SharePoint and Windows. I was trying to install SharePoint RTM on Windows 2012 RC

HTH