Friday, 25 July 2014

Office Web Apps 2013 for public facing websites

Overview:  A couple of weeks ago I told a customer that Microsoft offers a service to display Office documents thru Office Web Apps (WCA).  I thought I had read this or seen it on twitter but I was confident that viewing website office based documents was a free service offered by Microsoft.

Initial Hypothesis:  I looked on the web and could not find anything and I had to hastily tell the customer I had made a mistake as I could not find anything about it on the web.  The customer decided to setup a public facing Office Web Apps Server to feed up office documents and pdfs for their websites.

Fast forward a few weeks and the customer is installing a 1 server office web apps farm to display pdfs and word document from their public websites and I have been informed that there actually is a public service.  http://blogs.office.com/2013/04/10/office-web-viewer-view-office-documents-in-a-browser/

"Do you have Office documents on your website or blog that you want your readers to view even if they don’t have Office installed?  Would you rather view a document before downloading it?  To give your audience a better experience, try the Office Web Viewer."

To use the service there are a couple of considerations.  The service only supports office documents like word and excel, it doesn't support pdfs which is the clients preferred method of providing downloads.

Resolution:  You do not need to perform WOPI binding to use the service. 
The document is located at: http://calibre-ebook.com/downloads/demos/demo.docx

All you need to do is prefix the url link as follows:
http://view.officeapps.live.com/op/view.aspx?src=http://calibre-ebook.com/downloads/demos/demo.docx
 
Summary: A nice service offered by Microsoft for viewing Office documents "on-the-line" O Wilson, V Vaughn 2013 (The Internship).  If won't work for pdfs and you will need to call the service in the html call.  Good to know it is available but it won't meet my clients needs.

Tip: Ensure the link opens a new tab as the opened pdf will lose the clients context on yor site and force them to use the browsers back button.

Note: To get WCA to open public documents on the web using the web viewer, you need to setup the SharePoint farm to use "external-https".  If you are using it both internally and externally, which I have not done, you need to use external-https and use Alternate Access Mapping (AAM).

Example:
Below is a single WCA server farm that I am using for both internal e.g. document libraries & external i.e. public SharePoint 2013 websites.  Note the Internal and External URL are the same, you could also use AAM as suggested earlier.

FarmOU                            :
InternalURL                       : https://wca.demo.co.uk/
ExternalURL                       : https://wca.demo.co.uk/
AllowHTTP                         : False
SSLOffloaded                      : False
CertificateName                   : wca.demo.co.uk
EditingEnabled                    : False
LogLocation                       : E:\OfficeWebApps\Logs\ULS\
LogRetentionInDays                : 30
LogVerbosity                      :
Proxy                             :
CacheLocation                     : E:\OfficeWebApps\Working\d\
MaxMemoryCacheSizeInMB            : 5000
DocumentInfoCacheSize             : 5000
CacheSizeInGB                     : 40
ClipartEnabled                    : False
TranslationEnabled                : False
MaxTranslationCharacterCount      : 125000
TranslationServiceAppId           :
TranslationServiceAddress         :
RenderingLocalCacheLocation       : C:\ProgramData\Microsoft\OfficeWebApps\Working\waccache
RecycleActiveProcessCount         : 5
AllowCEIP                         : False
ExcelRequestDurationMax           : 300
ExcelSessionTimeout               : 450
ExcelWorkbookSizeMax              : 10
ExcelPrivateBytesMax              : -1
ExcelConnectionLifetime           : 1800
ExcelExternalDataCacheLifetime    : 300
ExcelAllowExternalData            : True
ExcelWarnOnDataRefresh            : True
OpenFromUrlEnabled                : True
OpenFromUncEnabled                : True
OpenFromUrlThrottlingEnabled      : True
PicturePasteDisabled              : True
RemovePersonalInformationFromLogs : False
AllowHttpSecureStoreConnections   : False
Machines                          : {EXT-WEBDEMO1}

I am using a SSL certificate installed on the WCA box as I don't have an SSL termination device (F5, Kemp).

On the WCA VM I run the PS > Set-OfficeWebAppsFarm -OpenFromUrlEnabled:$True

This gives me the generate.aspx page on the WCA farm to provide pdfs and office documents via the web viewer.  Mine is https://wca.demo.co.uk/op/generate.aspx

SharePoint 2013 OOTB lookup list filtering

Problem
I don't want to start customising my solution and I need a lookup column with restricted options.  I read this post from April Dunnam via Google and it's awesome and I wish I had thought of it first.

I have 2 lists: Countries (Country, Continent) & Business (Name, LocationInAsia, LocationInEurope).  I want to be able to specify their head office in each continent.  I could do a lookup list to country and show all the countries or I can use Aprils approach and only show Countries for the specific region.  This is a contrived example but it's a simple way to explain it.

Resolution:
On the Countries list create a Calculated column/field, call it "AsianCountries". 
The formula is =IF([Continent]="Asia",Country,"")
On the Business list, create a lookup called "LocationInAsia" that points to the "AsianCountries" field in the Countries list.

http://www.sharepointsiren.com/2013/05/sharepoint-2007-2010-2013-filtered.html

Summary:
This is pretty useful in that I don't need to write and custom code to have lookup lists that only show the appropriate content.  Sure I need to have extra calculate columns but a good no code way to restrict lists lookups.


 

Thursday, 12 June 2014

Migration test of Sharegate to SP2013

Problem: I am looking at migrating some basic content into a SP2013 farm from SP2010.  I would normally opt for Metalogix or DocPoint if the client already has the licences but today I needed to use another tool namely Sharegate.  I used Sharegate.Migration.4.6.3

Scenarios:
SP2010 blog posts to an existing SP2013 blog.
SP2010 lists into SP2013.

Screenshot of the tool:


Verdict:  A great tool, easy to use, mapped over data cleanly.  Absolute winner!

Wednesday, 11 June 2014

CAML Designer for SharePoint 2013 is Brilliant

I always used U2U for checking my CAML queries in SharePoint.  I have just used CAML Designer for SharePoint 2013 and it is brilliant.

Link to the CAML Designer tool
http://karinebosch.wordpress.com/2012/12/13/caml-designer-for-sharepoint-2013-released/

Saturday, 7 June 2014

Content database Sizing & Cleanup

Problem:  At a customer site, a content database is massive.  Various Site collections are using the same content database. 

Initial Hypothesis:  Smaller site collections can be moved to new separate content databases.  This reduces the size to some degree.  The SQL log (ldf) is in good shape.  The excessive size is due to 3 unavoidable issues, multiple versions of large blobs (we need the versioning so not an option).  The recycle bin is set to the default 50% and my dumping older content is brings down the size and lastly, delete content databases are still sored within SQL. 

Resolution: Remove the previously deleted site collections fro the content database.   Using CA, I tried to run the "Gradual Site Delete timer job", it no difference, the delete site was still lingering about. 

Used PowerShell to remove the deleted site collections as shown above.  E.g. PS> Remove-SPDeletedSite -Identity ""

More Info:
http://blogbaris.blogspot.co.uk/2013/01/delete-sharepoint-2010-site-collection.html
 

Wednesday, 4 June 2014

SharePoint 2013 urls

I am often having to go to Google to find SP url formations, to work with the product as I don't memorise them.  Ahmed Farag has a good post on this:
"Famous SharePoint URLs & Locations"

My common ones are:
Login using Windows credentials
/_windows/default.aspx
Web Part Maintenance Page
?Contents=1
Sign in as a different user
/_layouts/closeConnection.aspx?loginasanotheruser=true
Change Site Master Page
/_layouts/ChangeSiteMasterPage.aspx
Master Pages library
/_catalogs/masterpage/Forms/AllItems.aspx
 
 
This url is new to me:
Get the version of the SharePoint server (Patch level)
 /_vti_pvt/Service.cnf

Tuesday, 3 June 2014

SharePoint 2013 publishing site blog won't allow anonymous access

Problem:  I have a public facing website that has a blog.  I have been hitting my head trying to make it anonymous when eureka Google saved me on a topic I had totally forgotten. 

Initial Hypothesis: I have anonymous access enabled on the web application and on the site collection.  I started thinking it was the blog not inheriting permissions so I tried applying anonymous access at the site level followed by examining permissions on the posts list.  All erroneous so I reverted to full inherited permissions.  I Google-ed the symptoms and viola, it is the ViewFormPagesLockDown feature.

Resolution: Turn off the ViewFormPagesLockDown feature for the site collection and anonymous access users will not get the credential prompt when accessing the post.
PS> $lockdown = Get-SPFeature viewformpageslockdown
PS> Disable-SPFeature $lockdown -url http://sitecollectionURL
and confirm the change.

More Info:
http://blogs.msdn.com/b/varun_malhotra/archive/2012/01/13/can-t-access-a-list-on-an-anonymous-site-sharepoint-2010.aspx
http://blog.mastykarz.nl/preventing-authenticated-visitors-browsing-system-pages/ (Important)