Enable SharePoint 2013 Drag and Drop for Users with No or Older Office Versions

December 20, 2012 18:00 by keithkaragan

I was asked recently about the drag and drop functionality used in SharePoint 2013 document libraries. This functionality allows the user to drag files from their local machine into a SharePoint library. It's a really cool new feature, and I've never had a scenario where it didn't work (at least that I noticed). But, I always have the latest browser and Office versions available to me - not everyone is in that same situation.

The people asking the question were testing this functionality and found that with Internet Explorer 8 and 9 on Windows 7 there was a reliance on an active-x control from Office 2013 for the drag and drop functionality to operate. A quick web search finds that other have commented on this as well. So, I decided to dig into this a bit and understand where the limits are, and what can be done to give this feature to users on older versions of Office (or even no version of Office).

 

It turns out that indeed, Office 2013 installs an active-x control called Interceptor.dll that is used for drag and drop functionality in the event that the user's browser does not support the HTML5 features needed for this capability. Internet Explorer 10, Google Chrome (latest versions), FireFox (latest versions), and Safari (latest versions) don't require (or support) the active-x control, and execute the drag and drop properly using HTML5.

 

I set up a clean Windows 7 VM with Internet Explorer 8 and without an Office installation, then proceeded to verify that the drag and drop feature was unavailable with IE8 and IE9. I installed IE10 Release Preview, and everything worked fine. Next, I backed out the IE10 install, verified again that the feature is not available.

 

What can be done to get a user without Office, or with an older version of Office this feature? What I found was that installing a free Office 2013 product - in this case SharePoint Designer 2013 - installed the underlying active-x control needed. Great! But in businesses, it's unlikely that they will want to deploy that tool to all users - so, a compromise is needed.

 

If all options from the SharePoint Designer 2013 installation are unselected, except for the Office Tools -> Microsoft SharePoint Foundation Support option - the drag and drop functionality will work and the user will not have the SharePoint Designer tool installed on their machine. This option installs only the Microsoft SharePoint Foundation Support and Access Web Datasheet Component features. Seems like a reasonable compromise, since this installation should be able to be automated through some form of scripting, software distribution, or desktop management - and doesn't interfere with an existing Office installation of an earlier version.

 

 

Digg It!DZone It!StumbleUponTechnoratiRedditDel.icio.usNewsVineFurlBlinkList

Currently rated 1.7 by 308 people

  • Currently 1.711039/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Working with Social Hashtags, Search, and the SharePoint 2013 CSOM

December 14, 2012 00:31 by keithkaragan

The Microsoft.SharePoint.Client.Social.SocialFollowingManager class is used to retrieve the Tags a user is following, but there is no correlation inherent in the result between the returned Tags (they are returned as an array of Microsoft.SharePoint.Client.Social.SocialActor objects) and any social posts tagged that contain the tag. The only reasonable way to get a collection of social posts containing the tag that I could find was to utilize the search conversations source.

To get a result set with posts containing the tag, I can do the following:

KeywordQuery keywordQuery = new KeywordQuery(clientContext);

keywordQuery.QueryText = TagName;

keywordQuery.SourceId = SearchConversationsSourceId;

Where the KeywordQuery’s QueryText property is the Tag (ex: #Foo), and the KeywordQuery’s SourceId is set to the value of the Source Id for the Conversations Source (in my case: 459dd1b7-216f-4386-9709-287d5d22f568).

The ResultRows from the query have many properties in a default install. The following properties are the ones we’re interested in:

·         FullPostBody – The full text of the post

·         RootPostOwnerID – The Actor that owns the root post. In site feeds, this is the site itself. The format is something like: 8.36ff160c09d440ee9eb12b0249b8ab44.05878c50960e41fe859fce493
5c4b8b2.36ff160c09d440ee9eb12b0249b8ab44.0c37852b34d0418e91
c62ac25af4be5b

·         RootPostUniqueID – A unique identifier for the root post for the post in the result (since the result may not be a root post, it may be a reply). The format is something like: e6337cfd50a5489da51234c19954b556

·         MicroBlogType – There may be other values, but I’ve only seen 2 (for Root Posts), and 4 (Replies).

·         RootPostID – An integer identifying the Root Post for the post in the result.

·         ListItemID – The Item Id for the result post in the list where the post is stored.

OK, so what do we want all this for – well, notice that there is not a property returned that is in exactly the same format that maps to the ID of a Thread in the SocialFeedManager. The ID of a thread you would see in a SocialFeed looks like:

8.36ff160c09d440ee9eb12b0249b8ab44.05878c50960e41fe859fce4935c4b8b2.36ff
160c09d440ee9eb12b0249b8ab44.0c37852b34d0418e91c62ac25af4be5b
.75604b38
9c4f4c4b9f7bb3262aac30dc.5.6.1
[The bolded area is the difference from the RootPostUniqueID returned from search, and the ID you would see in a SocialFeed object]

The RootPostOwnerID is common for posts in this feed source (for a site feed). If we want to reconstruct the thread for a post returned in the search, we’ll need to fetch the feed using the SocialFeedManager, and then use the SocialFeedManager’s GetFullThread() method to pull out the particular thread we want – but to do that we need to determine the correct Thread ID to provide the method. This lent itself to a lot of head scratching for me, but perhaps you’ve already deduced the formula. If not I’ll lay out what I came up with (noting that it might be incomplete, or just wrong – but it seems to be working for me right now).

For site feed items returned from the conversations source in search, I first look at the MicroBlogType property to determine if it is the original post (MicroBlogType = 2), or a reply (MicroBlogType = 4). For replies, I constructed the Thread ID for its root post by taking the RootPostOwnerID property and adding several of the properties mentioned earlier to it – separated by periods, then adding a suffix of “.1” to the end of the string (without the curly brackets):

{RootPostOwnerID}.{RootPostUniqueID}.{RootPostID}.{ListItemID}.1

Ex:
8.36ff160c09d440ee9eb12b0249b8ab44.05878c50960e41fe859fce4935c4b8b2.36ff160
c09d440ee9eb12b0249b8ab44.0c37852b34d0418e91c62ac25af4be5b.36a3f70ae4be4c
a0bf169a5bf26318d5
.5.6.1

(remember that this ID is for the post that this reply, but it needs to reference up to its root post in the RootPostUniqueID and RootPostID positions – the ListItemId position is the self-reference)

This is similar for the original post (which would be a ‘root thread’ in a SocialFeed object), except that the ListItemID is also used for the RootPostID spot in the string, as the post is at the root of the conversation.

{RootPostOwnerID}.{RootPostUniqueID}.{ListItemID}.{ListItemID}.1

Ex:
8.36ff160c09d440ee9eb12b0249b8ab44.05878c50960e41fe859fce4935c4b8b2.36ff160c0
9d440ee9eb12b0249b8ab44.0c37852b34d0418e91c62ac25af4be5b.e6337cfd50a5489da5
1234c19954b556
.5.5.1

(remember that this ID is for the post that this reply, but it needs to reference up to its root post in the RootPostUniqueID position – the ListItemId value is used in both the RootPostID and ListItemId positions for the self-reference)

Feeding this constructed value into the SocialFeedManager.GetFullThread() method will return the full thread that contains the post containing the tag.

context.Load(context.Web);

SocialFeedManager sfm = new SocialFeedManager(context);

SocialFeedOptions sfOpt = new SocialFeedOptions();
sfOpt.MaxThreadCount = 5;
sfOpt.SortOrder =
SocialFeedSortOrder.ByModifiedTime;
ClientResult<SocialFeed> feed = sfm.GetFeedFor(SiteName, sfOpt);
context.ExecuteQuery();

 

ClientResult<SocialThread> sThd = sfm.GetFullThread(_threadID);

context.ExecuteQuery();

foreach (SocialPost p in sThd.Value.Replies)

{

Console.WriteLine(“ID: “+p.Id+” | Post Text:”+p.Text);

}

 

Where the _threadID is your constructed identifier.

Digg It!DZone It!StumbleUponTechnoratiRedditDel.icio.usNewsVineFurlBlinkList

Currently rated 2.0 by 6 people

  • Currently 2/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Creating Managed Metadata Terms with IDs via CSOM in SharePoint 2013

December 4, 2012 16:08 by keithkaragan

So in SharePoint 2010 there wasn't a great way to create terms and their IDs remotely - There were some add-on products available that offered this capability, but if you managed you taxonomies elsewhere and wanted to load them in one or more SharePoint Managed Metada Service instances you didn't have a lot of native options. This can be even more important when using a SAAS implementation like SharePoint Online / Office 365. Since the Client-side Object Model (CSOM) in SharePoint 2013 supports the creation of the term with an ID, those days are over!

Sample code for this was a little difficult to find - fortunately Sundar Rajan has a sample available on the 'Musings on SharePoint 2010' blog. The MSDN documentation for Microsoft.SharePoint.Client.Taxonomy is pretty much worthless as far as examples are concerned.

Digg It!DZone It!StumbleUponTechnoratiRedditDel.icio.usNewsVineFurlBlinkList

Currently rated 1.5 by 4 people

  • Currently 1.5/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Getting Videos in SharePoint 2013 to play without Silverlight

November 21, 2012 13:26 by keithkaragan

TIL Getting Videos in SharePoint 2013 to play without Silverlight requires a properly encoded video file (I used a H.265, MP4 file).
I had a sample SharePoint 2013 site installed (content, styling, etc.) and was going a cuckoo because all the videos uploaded were playing in the Silverlight player. It finally occurred to me that maybe it needs to be in a format that the HTML5 player can handle. I uploaded the file and it plays without Silverlight.

Using the default search center in the SPO Preview:

  • 'Everything' search results preview uses Silverlight
  • 'Video' search results preview is HTML5
  • 'Feed' preview is HTML5
  • In the library where the video is located, HTML5 is used for the view based pop-up player and the item display player.
Digg It!DZone It!StumbleUponTechnoratiRedditDel.icio.usNewsVineFurlBlinkList

Currently rated 1.3 by 9 people

  • Currently 1.333333/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

GetFeedFor() method in the SharePoint .Net CSOM SocialFeedManager class

November 21, 2012 13:23 by keithkaragan
TIL In the SharePoint .Net CSOM the SocialFeedManager class's GetFeedFor() method is used to return a Site Feed.
I was exploring using the CSOM to integrate feeds into other applications and using the GetFeed() method - which returned the user's feed items, but I wanted a Site Feed and didn't understand the  GetFeedFor method. The MSDN documentation mentions that the parameter "actor", but I didn't connect the "actor" as being the site before stumbling upon a mention of using this method on StackOverflow.

ClientResult<SocialFeed> feed = sfm.GetFeedFor(site, sfOpt);
 
 
Digg It!DZone It!StumbleUponTechnoratiRedditDel.icio.usNewsVineFurlBlinkList

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5