Shortlink

SharePoint Apps versus Full Trust or Sandbox solutions

Pressure is on and more and more companies are moving to SharePoint Online for the intranet and extranet and whatever else they have running in their server room. So, Few people asked me, what is the difference between developing apps versus on-premise solutions. The short answer is , a lot and since this is not really a helpful answer I will start a long list of gotchas :) and will add to it as I go along

In here we’re discussing SharePoint Hosted apps just to be clear.

General Stuff

-There is no C# or any other compiled code in apps … everything happens through a JavaScript. If you need to customize anything you need to write JS which calls SP API. The API is powerful but there is a learning curve even to an experienced SP dev.

-When you delete an app which has been installed on the site – your app site gets deleted too … so if you stored some data in the app site and you find it valuable – make sure you backup that data first. This is different from Sandbox or Full Trust solutions in a way when you delete the solution lists and libraries created by that solution live on unless you redeploy the solution and chose to overwrite the list. Not so with apps.

Workflows

-You can create custom workflows and even build those in Visual Studio, not only in SharePoint designer but those will have to use only out of the box actions available, you can’t create your own workflow actions and deploy them you have to play around with what’s configurable out of the box

-Out of the box approval workflow can be added to any of the lists on the app site but initiation or association form will not load for the list so basically you can’t initiate a workflow.

SharePoint Designer

-You can’t connect and edit the apps site created with an app – you just get an error. This is probably a limitation in SPD (they probably don’t want you to ruin the app site or find out how it works ;)) but nevertheless

Site templates

-You can’t provision your site template as an app similar to what you can do with Sandbox solutions

You own apps versus apps you bought in the app store

-There are certain things which you (as an app) can’t do if you’re in the app store. One of which being that app that is being sold in the app store can’t have Full Control on the parent site – this is actually a huge limitation in a way that app store apps will never (unless MS change it) have a full potential capability of the app that has been developed by a dev and uploaded to the corporate catalog.

Pages and other Assets

-Page, CSS, JS, Image, MasterPage etc provisioning to the parent site using the app involves hacks and not really robust

App Parts – they’re kind of like web parts but not really

-App parts that you build run in an iframe on the page, so it’s not like you can emit some CSS, JS, or HTML that will have access to the parent DOM

-For the same reason as above, you can not style or add JS interaction to app parts by adding your styles or JS to master page since those run in an iframe of the app site and therefore are not really inheriting your master page for the main site

-If elements on your app part take a certain space, and you place the app part on the page which has a limited space – you will end up with scroll bars in the app part because – yes, you guessed it, it’s running in an iframe. This is a huge issue for example if your app has a flyout (for ex a menu) and typically a flyout would fly over other elements on your page – well now that it’s an app part – you can’t – it will just be flying in the constraint of the iframe.

-You can’t really take a third party app part and “wrap it” and pass parameters dynamically. This is my favorite thing to do with we parts that is not possible with app parts. You can wrap a third party web part into your own with a purpose of feeding parameters to web part. This is helpful for example when you have a weather web part that has a web part parameters passing the location name but you want to dynamically pass that data at the time of rendering. You could just wrap a web part in your own custom web part and do that logic – doesn’t work like that with apps parts – it just doesn’t.

-App parts can’t be placed on a master page like controls. So traditional web parts are just user controls or web controls wrapped in a magical web part wrapper which means that you can hardcode your web part into masterpages so that users can’t remove them – there are few valid cases for this. Well, you can’t do that with app parts.

-App pages are not web part pages, so users can’t edit the app home page and customize what they see there. Once you define the app landing page – it is what it is.

More to come, stay tuned …

Shortlink

How to: set up multilingual intranet sites in SharePoint Online

Multilingual sites has never been my favorite in SharePoint, since SharePoint 2007 you had to deal with language pack installations and all the error with setting up infrastructure but now with SharePoint Online things look pretty easy. SharePoint Online is pre-configured with language packs and all the stuff you need to just get your site going.

So let’s take a look at how you set up a multilingual site in SPO.

1. Log into your admin site (mine is: http://sharemuch-admin.sharepoint.com/) and create a new publishing site collection
2. Once created, navigate to the publishing site collection (mine is: http://sharemuch.sharepoint.com/sites/demo) and click Settings (Gear) | Site Settings
3. Click Variation Labels | New Label … now you’re going to set up initial variation label (in my case English-Canada), this is going to be the language in which original content will be published, here is how my configuration looks like:

variations primary language

4. As a result you will get this message “Your new variations are on the way “, so now you need to create labels for any other languages you want to host on your site in my case it’ll be French-Canada

5. Click Ok on the previous screen and then click New Label again, this time the process will be a bit different, step one being again you selecting the language and locale:

step 1

6. Next is you picking what you want to translate and other details shown below:

step 2

7. Next, you pick whether human and machine translation will be permitted. In my case I want both so that machine translation does the first pass and then an editor can go and fix all of the parts that need to be touched up:

step 3

8. Next, you chose whether updates to the source page will be automatically propagated or have to manually propagated:

step 4

9. That’s it, the set up is done:

step 5

Here is the thing though, you will need to wait for up to an hour for SharePoint Online to trigger all the right timer jobs to actually create the hierarchy for your source and variation labels, once this process is complete, here is how your Variation Labels page will look like:

variations created

10. Now each time you go to the root site (mine is: http://sharemuch.sharepoint.com/sites/demo), you will be redirected to the specific locale site in my case it is also my source site (mine is: http://sharemuch.sharepoint.com/sites/demo/en-ca)
In here you can created and edit pages.

Remember it will take about an hour for the hierarchy and pages to be translated back and when they do and you go to the translated counterpart, you can expect the translated pages to appear there similar to my translated page:

translated

Enjoy!

Shortlink

How to: Customize the look of the SharePoint Content Search Web Part results

In my last post, I talked about how you can set up your SharePoint site to roll up content on different parts of the site using Content Search Web Part (CSWP).

In that post I mentioned we’d take a look at how you can customize the rendering of the display template for the items that are rolled up so rather than having generic results coming back in a generic look – you can brand them and make them look however you want. You can even have your results show as a slider etc with a bit of extra JavaScript magic.

In this post we’ll take a look at basic components which you’ll need to customize your display templates for the CSWP.

I’m going to be using default set up of Office 365 Developer site in SharePoint Online and steps here apply to at the time of publishing this post.

1. Navigate to the masterpage gallery on your developer site: click Gear | Site Settings | Master pages and page layouts
2. Open the folder: Display Templates | Content Web Parts
3. Download a copy of the Control_List.html and rename it to something like MyControlList.html … this is a file which we’ll be modifying to introduce custom results rendering
You will need to supply this file only if you like to add anything prior to repeating items being rendered, for example some sort of a header. If you only want to modify the actual repeating results and not add anything overarching at the top – you won’t need this file. In our case, I will create an new rendering template for the header section and add a piece of text so we can see how it appears

To do that you need to find the section in this file that starts with this:

<ul class="cbs-List">

and add anything you want to see before the list right before, similar to this:


<a href='[link to all results]'>View More</a>
<ul class="cbs-List">

Change the value in <title> to something like My Custom Rendering, since this is how the user will pick the template from the CSWP settings UI.

4. Save the file (with a new name, make sure) and upload it back to the Content Web Parts. When you save the file and accept the default properties, you will see that accompanying JS file was created.

5. For the items rendering template, find the file Item_TwoLines.html from Content Web Parts, download it and give it a new name, in my case MyItem_TwoLines.html

6. Change the value in <title> to something like My Two lines, since this is how the user will pick the template from the CSWP settings UI.

7. In here you need to locate the following piece:

<div class="cbs-Item" id="_#= containerId =#_" data-displaytemplate="Item2Lines">

and basically the piece above along with the structure is how each of your items will be rendered, so if you need to make any changes to the rendering, add images, add an expanding content – you can do it here.

8. Again, save this file (with a new name) and upload it back to the Content Web Parts. When you save the file and accept the default properties.

9. Now on to testing!
Add a new CSWP to the page and make sure it shows any content just for the demo purposes.

10. Access the web part properties and set the display templates options as shown below:
display templates

Provided of course you kept the names as in the example.
You will see instantly that the web part has a new grouping section in our case it was a View More link as well as any customization you added to the item display – it will show up here too!

end result CSWP renderinf

The benefit of this approach is that you’re reusing a CSWP back end functionality and get any rendering you want, heck you can even get a custom slider this way!

Enjoy!

Shortlink

How to: perform data rollups across SharePoint site collections

Say you have a typical corporate site with a home page containing news, events and whatever else data you need on a typical site. Also, if it’s a typical corporate site, you’re also likely to have department sites and various team sites, some of which are site collections and other sub sites.
The structure may look close to the one below:

site collection structure

With a structure like above, it’s often that users ask to see various information published on the home page on their respective sub sites and vice versa. Whether those are news, calendar events, announcements or wiki pages – you can use SharePoint Content Search Web Part (CSWP) to achieve this goal. CSWP uses search index to pull information across multiple sites, also you have your usual security trimming etc.

Let’s take a look at an example where you can use CSWP to share announcement across sites.

1. Create a list of an announcement type (aka Announcements App) on the root site collection
2. Create a managed metadata term set (Gear | Site Settings | Term store management) representing Category of the announcement
This will allow our announcements to be categorized and administrator can chose to show rollups of certain categories only on specific sites

announcement categories

3. Back in our announcement list, add a new column to that list representing a category and make it a managed metadata type column, set the column to consume data from the term tree we have just created. Remember the name of it since we’ll need it later. In my case, for reference let’s call it MyAnnouncementCategories

category column term settings

4. Create an instance of at least one announcement which uses the term set column. This piece if very important since search will need to crawl this piece of content in order to create searchable properties which we’ll need later.

5. If you’re using SharePoint Online, at this point you will need to wait until search crawl has completed and picked up your content. From my experience it may take 1 or 2 hours until this is done. if you’re using on-premises environment, you can expect for the crawl to happen faster plus you can always trigger it and have your properties created within minutes.

6. Navigate to the site where you’d want to see the roll up of announcement and add an instance of CSWP, add a Content Search Web Part and access it’s properties

cswp properties

7. Click the Change Query button and switch to Advanced Mode

8. In here under the Query Text add the following:

(contentclass:"STS_ListItem") owstaxIdMyAnnouncementCategories:#1e44855f-c4d8-43a1-96cf-69bd67a51197

Above query filters all of the crawled items which:
-Are list items
-MyAnnouncementCategories is equal to desired taxonomy term representing a category you want to filter on. Typically after SharePoint completes it’s crawl of data and picks up managed metadata property, it will create a managed property representing taxonomy ID of the managed metadata column. The name of the column usually has a format of owstaxId[ColumnName] so in our case it’s owstaxIdMyAnnouncementCategories. The GUID following the filter can be taken from the term store management tool. For examaple, in my case the unique ID of the Category 2 is as shown below:

unique ID of the category

This means that you want to filter announcements by certain category on one site and by different category on another site – you can do such filtering by specifying the Id of the category.

The cool part of this is that if you chose a parent category Id, you will see all of the items tagged with a parent category and child categories.

9. Save the Web part properties and test the query.
Remember if you’re using SharePoint Online the crawl may take some time for new items to be picked up so you might want to create some demo content tagged differently prior to doing the whole web part configuration to give it some time.

In a next post, I’ll demonstrate how you can style the results returned by CSWP to make them look how you want.

Enjoy!

Shortlink

SharePoint MVP for 2014/2015!

It’s that time of the year when summer MVPs are renewed and newly awarded MVPs are invited to a very special club.
First off, good news! I’m still in!
It never gets old, it’s always one of the most exciting news of the day … and it has been my 6th year that I will be a SharePoint MVP.
A lot has changed since and a lot of things are still coming …
Just a week ago or so I’ve been lucky to participate Microsoft Envisioning Tour, pretty good video you can see here:

The video looks pretty futuristic, but just as when 6 years ago when I first became an MVP, a lot of things seemed to be impossible, now are completely an everyday norm!

Like for example:
-I can actually view a Word Doc on my phone while my chauffeur is driving me to work ;)
-At my local RBC branch I can actually use a Surface like table where I can browse stuff while waiting in line
-HD TV walls are becoming bigger and bigger and more crisp … everywhere … can’t wait to have a wall like that in my living room in few years
-Nearly every platform has a digital marketplace and I can buy apps for most of the devices I use
-The cost of hosting this blog dropped 70% and it’s running on platform that knows how to scale automatically if all of the sudden one day I become celebrity
-etc etc

All I’m saying, that I am really excited to be part of this … never failing to surprise and amaze technological miracle, and meet and connect with people that make it happen. My main hope and desire is to continue orbiting and flying through this black matter and to connect and inspire others just as inspire me every day!

Now onto watching a well deserved 45 min of Netflix show!

Shortlink

SharePoint Summit – October 27-29, 2014, register now for an early bird!

VAN-speaker-728x90

As some of you may know, SharePoint Summit 2014 is coming again to Vancouver this year after a great success last year.

SharePoint Summit is here to give you a 360 degree view of the best practices and methodologies you will need to plan, implement and manage successful SharePoint-based solutions designed to meet your organization’s business needs and be adopted by your end users.

“Discover.Innovate.Build” are the main themes of this event, featuring MORE THAN 60 outstanding training sessions (3 of which are mine! yay!) to help you make the most of SharePoint and maximize your people’s productivity and effectiveness.
There is an early bird, so you better check it out now if planning to attend: http://www.sharepointsummit.org/vancouver/Pages/default.aspx

Hope to see you there!

Shortlink

How to: quickly embed PowerPoint decks the “slide share” style in your site in SharePoint Online

With SharePoint Online there is a cool Word, Excel, or PowerPoint document preview for the documents.

document preview in library

That’s great, but what if you need to embed the document with all of the preview capabilities right on the page and not only in a library view.
Well, you can actually do that fairly easily out of the box:

1. Upload your document to the document library on the SPO site
2. Open the document in a browser rendering mode – should be default in SPO
3. Click File -> Share -> Embed. This will be the same for PowerPoint, Word and other MS office apps.

Some options will differ for Word document versus PowerPoint for example:
Here are word document options:

word embed options

Here is the PowerPoint:

powerpoint embed

4. Copy the embed code and navigate to the page where you want to embed this
5. Add the embed code to the page

insert embed code

That’s it … now it will play as it was one of those SlideShare embeds.
Enjoy!

Shortlink

Migrating google site content to SharePoint online: findings from the field

Recently I had to migrate bunch of Google sites to SharePoint online, and despite relative simplicity of this task I wanted to point out few things that stood out as potential problems or things to consider:

Surveys

Google has a survey capability. SharePoint Online answer to this is Excel Survey which is a sweet feature, in fact I blogged about it a while ago. However, issue #1 – it appears that Excel Survey can only be created from OneDrive and not from a regular document library.

Regular document library options:
regular document library

OneDrive
onedrive document library

I tried creating the survey in OneDrive and moving it to the document library but that didn’t work.
The solution here could be training your users to create surveys on their OneDrive and then pointing to them from the site page.

Issue #2, if you have a survey with a choice list, you need to create a choice field and in choice fields you delimit choices by new line. Unfortunately, this means you can have only 1070 characters in that field so if you have say average (2-3 words) choices, you can only have up to 50 of those. Unlucky for me, I had double of that.

options limit

Yeah, there is really no solution for this except you breaking down the list into two lists. It’s really not going to look the best but … [insert your excuse here when you have one :)]

Public sites
Ok this is by far the most limiting in comparison to Google sites. So it’s no surprise when you try to create a public site in Office 365, you’re allowed to have only one public site per tenant; here you can see the option greyed out because I already have one site created:

only one public site per tenant

This makes sense from business standpoint since Microsoft is selling office 365 subscriptions for a very small fee per user. So technically you can sign up for a single user license and run the entire corporate internet on it – this will end up costing Microsoft a lot of money for a single $5+ subscription – this is my interpretation, so don’t take what I have said here as an official statement from MS.

Any way .. the problem is that you would think “Oh, I’ll just create subsites under my main public site and have them branded separately” …
No, you can’t do that either, you can’t create sub sites in office 365 public site.
no ability to add subsites

Well, technically you can using SharePoint designer (I’m sure that hole will be closed soon too), but as I read on one of the official responses on SharePoint Online support – public SharePoint Online sites containing subsites will not be supported. Which really means, if you do that and stuff stops working – you can’t complain about it, because you hacked your way in a first place.

creating subsite in SPD

… and … even if you did create a subsite and were ok that it’s not supported here is another problem:
your sub sites on a SharePoint Online public site will not be able to have a custom masterpage applied. Again, here you can use SharePoint designer to change the masterpage for a SPO public sub site but it will be all reverted by some automated process in few minutes.

To summarize, it’s not a good idea to create subsites for Public Site in SPO so drop this architecture and stop trying to hack around it.
The solution I can come up with, is that you really need to create a separate tenant for each of your public sites and if some pages require custom branding (like chrome and everything), you can create a page and apply an alternative masterpage right in that page.

More stuff to be posted as i uncover more gotchas, but hopefully this helps to get started!

Enjoy!

Shortlink

How To: Set up SharePoint 2013 calendar view rollup from multiple calendars

Here is the situation: you have few departments or groups who use SharePoint calendar to track their stuff. Wouldn’t it be nice if you could roll up events from those calendar into some sort of dashboard or homepage. Requests like that are quite common, here is how you can do this out of the box with no code.

1. Create those department calendars on their respective sites
2. Create a calendar which will hold aggregated list of events
3. Add a test event into each of the “department” calendars

so far so good, right?

4. Go back to your “aggregated” calendar and click calendar overlays from the ribbon as shown below:

calendar overlays

5. On the next page click the New Calendar link. This is how you add rolled up calendars to this main calendar
6. Fill in the Display Name of one of the calendars to be rolled up
6.1 Pick a color
6.2 Pick the web URL where the calendar is and click Resolve
6.3 Pick a list (calendar) and the view (has to be calendar view and not a list view)

calendar rollup set up

7. That’s it, click ok and repeat steps 5-6 for all of the other calendars you want rolled up.

Here is the result with a couple of test events I’ve added:

sharepoint calendar rollup

Enjoy!