Losing a Fitbit device in Australia

I found a Fitbit One on the street the other day. A quick check on online forums suggested that Fitbit will get Fedex to pick it up and return to the original owner.

They fail to mention that this does not apply to Australia (or presumably many other places).

So Fitbit support sent an email saying that because it is Australia that they would take care of the customer separately and that I can keep the Fitbit! I really hope the owner contacts the support so that they can get a replacement.

I guess Fitbit have to be careful not to put strangers into contact with each other, however seems a shame. I’m sure the owner lives close by to me and I just wanted to get it back to them.

Microsoft Surface 2 Table Spotting

The Microsoft Surface 2 Table (Not the same as their new successful laptop) never really took off, however I did build some demos for it and it is still great for multi user scenarios. My son found one in the Australian Museum in Sydney.

IMG_0536

Microsoft Apps on Samsung Galaxy S6

I’ve owned a few Samsung Galaxy devices (SII, SIII and Tab 2) and I found the quality of the pre-installed Samsung software pretty low. It always seemed strange that Samsung would invest in near perfect hardware design and then followup with only half-hearted software support.

It will be great to see the official Microsoft mobile apps pre-installed instead, which would reduce TCO an an enterprise wanting to enable their mobile workers on this platform:

http://www.sammobile.com/2015/02/12/exclusive-galaxy-s6-software-will-bring-some-amazing-changes/

SFDC File Connect and Microsoft OneDrive for Business

This is great news for Office 365 customers! Salesforce.com’s File Connect will integrate with Microsoft OneDrive for Business from February 2015:

http://www.salesforce.com/company/news-press/press-releases/2014/12/141217.jsp

According to the press release, all file permissions on OneDrive will be enforced as well as being fully accessible from mobile devices.

Using the Macbook Pro Retina as a Sitecore developer machine

I didn’t buy my Macbook Pro Retina to do Sitecore work, so I was concerned the configuration would not be powerful enough. Luckily the 8GB the machine has seems to work well enough. The main bottleneck I find is the terrible Page Editor that takes ages to load without using any CPU. If anything, it seems like using an SSD is the single best thing you can do for Sitecore performance, since I notice little performance difference between Parallels and another Hyper-V machine I have with 8 CPUs and 16GB dedicated RAM also running off an SSD.

 I didn’t want to go Bootcamp, so this is what I did:

  • Install new instance of Windows Server into Parallels (I used Windows Server 2012)
  • Install SQL Server, Sitecore and Visual Studio onto your new virtual machine
  • Allocate as much RAM and CPU as you can. (I have given it 5GB RAM and all 4 CPUs)
  • Open up your port 80 firewall for incoming and outgoing connections.
  • Edit the HOSTS file on your Mac to refer your site names back to the Windows Server IP
    1. http://osxdaily.com/2012/08/07/edit-hosts-file-mac-os-x/

With this configuration I am able to use the Mac OS Firefox browser to work with Sitecore directly for working with the Sitecore deskop, Content Editor and Page Editor.

Also for reference I also have Oracle VirtualBox and I did try that. Parallels is just much faster and the integration with the host extremely intuitive.

 Finally I have received a good number of asserts for web site building such as images, movies, PDF’s and Photoshop files. It has to be said that using these on a MacBook Pro Retina is really awesome.

Bing Maps Sandboxed WebPart for SharePoint Online and SharePoint 2013

I wanted to create a simple Bing Maps Web Part for SharePoint 2013 Sandboxed solutions and for SharePoint Online.

This isn’t the same as my previous Map Web Part posts, however it isn’t too difficult. As before we just define a DIV element in our WebPart with an ID:

<%@ Assembly Name="$SharePoint.Project.AssemblyFullName$" %>
<%@ Assembly Name="Microsoft.Web.CommandUI, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %> 
<%@ Register Tagprefix="SharePoint" Namespace="Microsoft.SharePoint.WebControls" Assembly="Microsoft.SharePoint, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %> 
<%@ Register Tagprefix="Utilities" Namespace="Microsoft.SharePoint.Utilities" Assembly="Microsoft.SharePoint, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Register Tagprefix="asp" Namespace="System.Web.UI" Assembly="System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" %>
<%@ Import Namespace="Microsoft.SharePoint" %> 
<%@ Register Tagprefix="WebPartPages" Namespace="Microsoft.SharePoint.WebPartPages" Assembly="Microsoft.SharePoint, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="FlightMapWebPart.ascx.cs" Inherits="AirTravel.FlightMapWebPart.FlightMapWebPart" %>
<div id='myMap' style="position:relative; width:600px; height:400px;"></div>

The the code behind is simple enough. The main point is just to get around the Sandbox security restrictions by writing out Javascript directly with RenderContents. I also added a property to set the Bing Maps key.

using System;
using System.ComponentModel;
using System.Text;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls.WebParts;

namespace AirTravel.FlightMapWebPart
{
    [ToolboxItemAttribute(false)]
    public partial class FlightMapWebPart : WebPart
    {
        /// <summary>
        /// Constructor
        /// </summary>
        public FlightMapWebPart()
        {
        }

        /// <summary>
        /// Set the Bing Maps Key with a WebPArt Property
        /// </summary>
        [WebBrowsable(true),
        WebDisplayName("Bing Maps Key"),
        WebDescription("Your Bing Map Key Value"),
        Personalizable(PersonalizationScope.Shared),
        Category("Bing Maps")]
        public string BingMapsKey { get; set; }

        /// <summary>
        /// On Initialize
        /// </summary>
        /// <param name="e"></param>
        protected override void OnInit(EventArgs e)
        {
            base.OnInit(e);
            InitializeControl();
        }

        /// <summary>
        /// Create Child Controls
        /// </summary>
        protected override void CreateChildControls()
        {
            base.CreateChildControls();
        }

        /// <summary>
        /// On Page Load
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void Page_Load(object sender, EventArgs e)
        {
        }

        /// <summary>
        /// Add addidional content to the webpart
        /// </summary>
        /// <param name="writer"></param>
        protected override void RenderContents(HtmlTextWriter writer)
        {
            base.RenderContents(writer);

            // Add reference to JQuery javascript
            writer.AddAttribute(HtmlTextWriterAttribute.Type, "text/javascript");
            writer.AddAttribute("language", "javascript");
            writer.AddAttribute(HtmlTextWriterAttribute.Src, "http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js");
            writer.RenderBeginTag(HtmlTextWriterTag.Script);
            writer.RenderEndTag();

            // Add reference to Bing Maps javascript
            writer.AddAttribute(HtmlTextWriterAttribute.Type, "text/javascript");
            writer.AddAttribute("language", "javascript");
            writer.AddAttribute(HtmlTextWriterAttribute.Src, "http://ecn.dev.virtualearth.net/mapcontrol/mapcontrol.ashx?v=7.0");
            writer.RenderBeginTag(HtmlTextWriterTag.Script);
            writer.RenderEndTag();

            // Write javascript code
            writer.AddAttribute(HtmlTextWriterAttribute.Type, "text/javascript");
            writer.AddAttribute("language", "javascript");
            writer.RenderBeginTag(HtmlTextWriterTag.Script);
            writer.WriteLine(CreateLoadMapString(this.BingMapsKey));
            writer.WriteLine("LoadMap();");
            writer.RenderEndTag();
        }

        /// <summary>
        /// Create Load Map Javascript function
        /// </summary>
        /// <returns>Load Map Javascript String</returns>
        static private string CreateLoadMapString(string BingMapsKey)
        {
            // Sanitize, just in case some script passed instead of a key string
            string sanitized = HttpUtility.HtmlEncode(BingMapsKey);

            string mapDeclareString = "map = new Microsoft.Maps.Map(test, {credentials: '" + sanitized + "'});";

            StringBuilder js = new StringBuilder();
            js.AppendLine("var map = null;");
            js.AppendLine("function LoadMap() {");
            js.AppendLine("var test = document.getElementById('myMap');");
            js.AppendLine(mapDeclareString);
            js.AppendLine("}");

            return js.ToString();
        }


    }
}

And that’s it. Your WebPart can be used onpremise or on the cloud.
Image
One thing you may need to check is that the website where the Bing Maps Javascript file (LINK) resides is added to your Internet Explorer ‘Trusted Sites’ list.

Also of note is that waiting for the page to load with the JQuery ‘Ready’ function was not required before executing the Javascript.

UPDATE: I just noticed that I could pass a script through the webparts property! Added the HtmlEncode to make sure.

Should I Develop Office 365 / SharePoint Online Applications with the Apps Model or SharePoint 2013 Sandboxed Solutions?

I’ve been looking at more SharePoint Online work recently, and many people have encouraged me to look at the apps model as the way to build solutions for it.

I do get the apps model and after some years dealing with the complications of custom WebParts it does seem pretty compelling. That said after trying some coding over the weekend I’ve come to the conclusion that it really isn’t for every scenario.

Actually, I REALLY want to be able to just use the App development model. I want to buy a new laptop, and the requirement to run SharePoint 2013 is the only thing that blows my minimum system needs out.

First I did a side by side comparison between

  1. Building ‘traditional’ sandbox solutions in SharePoint 2013 and then deploying to SharePoint Online
  2. Building SharePoint Online apps directly

 

Aspect 

SP 2013 Sandbox Solutions 

SharePoint Online App 

Comment 

Development environment 

Visual Studio 2013 + SharePoint 2013 & SQL Server installed locally

Visual Studio 2013  

The cost of licensing SharePoint 2013 and SQL Server for development purposes should be considered as well.

System Requirements 

Virtualization, 16GB RAM & multicore CPU recommended.  

4GB RAM 

It is possible to reduce the SharePoint 2013 requirements, however there are a few hoops to jump and basically you need a powerful machine.

Offline development?

Yes 

No 

Fairly obvious one…. 

Visual Studio Debug on SharePoint Online 

No 

Yes 

SharePoint 2013 Sandbox solutions can be debugged locally, but not when later deployed to SharePoint Online. This is potentially a big one, since sandbox solutions on both platforms do not operate exactly the same.

Ease of integration into SharePoint Site

Simple 

Difficult 

After installing an app it will not appear in SharePoint itself but rather its own separate application.


 

Packaged Solutions 

Simple. A sandboxed solution can be packaged, installed, activated, disabled and removed. 

Difficult. Custom code required, and uninstalling pieces will require the entire app to be removed.

This is not actually so clear cut. For ‘standard’ items such as Lists, Web Parts and Workflows, the sandboxed solution is easiest. If you want more web related files such as CSS and Javascript then it seems it is easier to deploy in an app.

Leverage existing web parts for lists 

Simple. The new list is visible to the WebPart through a standard API call 

Difficult. SharePoint cannot ‘see’ the new List, and a reference to it would have to be explicitly entered, if possible

I downloaded some webparts from the SharePoint store and many required me to select an existing list from the SharePoint site. There was no option to place the URL string to the app hosted List. 

 

 

 

Scenarios

 

Scenario 

Choice 

Reason 

Create some custom lists / web parts for end users 

Sandboxed Solution 

Simple to develop, deploy and remove. Much more difficult to use the same artefacts from SharePoint Online in a SharePoint Online App

Display a table that combines SharePoint list data with data taken from a standard SAP data source

Sandboxed Solution 

Use BCS to consume SAP as a data source 

SharePoint Online running under a highly restricted security governance model

SharePoint Online App 

Sometime developing a custom webpart is not sufficient to get around your organizations security practices. Hosting in an app is the easiest way to quickly develop functionality.

Flexible custom application 

SharePoint Online App 

The SharePoint Online sandbox is very restrictive from a security perspective. If you do not need the application to be hosted in a SharePoint site then I’d probably recommend using apps.

 

Conclusion

The app model is a great way to enable you to build flexible and powerful apps that leverage SharePoint on the SharePoint Online platform.

If you need to extend SharePoint itself, such as deploy custom Lists and Web Parts, then the Sandboxed model is still the way to go.

I hope that Microsoft can evolve the app model further and allow tighter integration of apps into the SharePoint application itself.

 

 

 

 

Follow

Get every new post delivered to your Inbox.

Join 27 other followers