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.


 

Saturday 12 July 2014

SharePoint 2013 Search Series - Post 3 - Search Box Web Part to only query Managed Properties

Search Series:
SharePoint 2013 Search Series - Post 1 - Configure Custom Search
SharePoint 2013 Search Series - Post 2 - Refiners
SharePoint 2013 Search Series - Post 3 - Search Box Web Part query Managed Properties(This Post)
SharePoint 2013 Search Series - Post 4 - Search Result Source Removal
SharePoint 2013 Search Series - Post 5 - Restricting Results & Enable pdf previews

Overview:  In this post we are looking at using a Display Template to change how the Search input box works.  Specifically the example will look at making the search box only search on the Title property of documents.  It will search for any part of the title.  If my word document is called "Std-634-HealthandSafety", using the search term "634" we get the document.

Steps to Change the way the Search Box works:
1.> Copy the Display Template "Control_Display Template", edit & rename the new template and upload to the Display Template gallery.
2.> Change the Title element tag in the Display Template and amend the html as shown below to change the behaviour of the search box.
3.> When the html display template is uploaded, you will notice the js file with the same name is updated.  Remember to Publish the html display template.
4.> On the Search Page edit or add the Search Box Web Part.  Select the Display Template, in my case it is "Demo Title Search Box" and save.
Search now only does a wild card search on the Title of the uploaded documents (assume the content has been crawled).

Search Series:
SharePoint 2013 Search Series - Post 1 - Configure Custom Search
SharePoint 2013 Search Series - Post 2 - Refiners
SharePoint 2013 Search Series - Post 3 - Search Box Web Part query Managed Properties(This Post)
SharePoint 2013 Search Series - Post 4 - Search Result Source Removal
SharePoint 2013 Search Series - Post 5 - Restricting Results & Enable pdf previews

Sunday 6 July 2014

SharePoint 2013 Search Series - Post 2 - Refiners

Search Series:SharePoint 2013 Search Series - Post 1 - Configure Custom Search
SharePoint 2013 Search Series - Post 2 - Refiners (This Post)
SharePoint 2013 Search Series - Post 3 - Search Box Web Part query Managed Properties
SharePoint 2013 Search Series - Post 4 - Search Result Source Removal
SharePoint 2013 Search Series - Post 5 - Restricting Results & Enable pdf previews

Overview:  Refiners are a powerful way of drilling into your search result data.  This post aims to look at configuring the search refiner web part.  Any Managed Property can be marked as a refiner and then used on the Refinement Web Part.

Steps to setup a refinement panel:
1.> Add the "Refinement" search web part to your search page.
2.> Edit the Web part and under the "Choose Refiners" button select the appropriate Refiners.

3.> Add custom managed properties as shown below, mark the managed property as "refineable" and it will show up in the "available Refiners" screen.

4.> Add your custom "Available Refiners"
5.> Save and publish the web part and check the refiners are working.

Search Series:
SharePoint 2013 Search Series - Post 1 - Configure Custom Search
SharePoint 2013 Search Series - Post 2 - Refiners (This Post)
SharePoint 2013 Search Series - Post 3 - Search Box Web Part query Managed Properties
SharePoint 2013 Search Series - Post 4 - Search Result Source Removal
SharePoint 2013 Search Series - Post 5 - Restricting Results & Enable pdf previews

Saturday 5 July 2014

SharePoint 2013 Search Series - Post 1 - Configure Custom Search


Overview: This series of posts examines SharePoint 2013 search.  It looks at configuration to get Search working for you.  There are other posts on this blog about configuring your Search architecture and farm.

This post looks at 2 main points: 1.> crawling content and 2.>  Result Sources.

Search Series:
SharePoint 2013 Search Series - Post 1 - Configure Custom Search (This Post)
SharePoint 2013 Search Series - Post 2 - Refiners
SharePoint 2013 Search Series - Post 3 - Search Box Web Part to only query Managed Properties
SharePoint 2013 Search Series - Post 4 - Search Result Source Removal
SharePoint 2013 Search Series - Post 5 - Restricting Results & Enable pdf previews

1.> Crawling Content:  The UI in CA has changed but if you understood crawling in previous versions of SharePoint, it still works the same way.  You are looking to create indexes by crawling content.  The image below shows the Search Administration screen after choosing the "Content Sources" option.  This will allow you to create content sources and configure them so SharePoint can get data into the indexes and have permission awareness (ACL).

After setting up your Content Sources run a full crawl to populate the indexes.

The "Crawl Log" is extremely useful to see when crawls where run and what content has been included. 

Once all the content is crawled you are ready to look at the Results Source formally referred to as Search Scopes.

Tip: The crawler must run through all content to be searchable, I still see clients trying to restrict data by no crawling it.  Crawl everything and restrict on the query side what comes out. 
Tip: Don't create to many Content Sources.  This can be a tough item to figure out, my advice is use as few Content Sources as possible and break them up by how often the content needs to be crawled.

2.> Result Sources: You can create Result Sources at the SSA/farm level down to the web/SPSite level.  This example is looking to return data from a specific path for a particular content type, so I created the Result Source at the site level.

Tip: The "Search Result Preview" is really useful for checking you are doing this correctly.

Once I have a "Result Source" setup I go to my search page and add a "Search Results" web part to output the results to my user.  I  can edit the "Search criteria" on the web part to use my new "Result Source".  The picture below is annotated to explain setting up the Search Results Web Part.


Search Series:
SharePoint 2013 Search Series - Post 1 - Configure Custom Search (This Post)
SharePoint 2013 Search Series - Post 2 - Refiners
SharePoint 2013 Search Series - Post 3 - Search Box Web Part to only query Managed Properties
SharePoint 2013 Search Series - Post 4 - Search Result Source Removal
SharePoint 2013 Search Series - Post 5 - Restricting Results & Enable pdf previews