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

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

SharePoint SPAlertManager on CodePlex

July 7, 2007 13:30 by keithkaragan
I've created a CodePlex project for managing alerts in SharePoint 2007 called SPAlertManager.It's a limited scope layouts application for managing alerts for all of a user's sites in a single place, along with the ability to sign up for an alert for a site (it creates an alert for all lists in the site). Just a proof of concept sample, but might be useful to someone someday.
Digg It!DZone It!StumbleUponTechnoratiRedditDel.icio.usNewsVineFurlBlinkList

Currently rated 1.8 by 4 people

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

Parallel Path Electromagnetic Motors

February 22, 2006 03:30 by keithkaragan
I can across this article (from slashdot, I think) on Parallel Path Electromagnetic Motors - interesting technology that could mean a lot ...
An excerpt:
&ldquo; Joe Flynn from Flynn Research is working on a new technology called &quot;Parallel Path&quot; with Boeing Phantom Works. The technology claims to be able to increase magnet motor efficiency substantially, even over the 100% barrier . They have received a US Patent. &nbsp;&rdquo;.
check it out at opensourceenergy.org
Digg It!DZone It!StumbleUponTechnoratiRedditDel.icio.usNewsVineFurlBlinkList

Currently rated 5.0 by 1 people

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

What Will It Take for Microsoft To Get It?

January 16, 2006 00:00 by keithkaragan
CNN has a story about the Microsoft URGE service they'll be launching, yet another attempt to take the music market from Apple and iTunes - fair enough ... But, according to the article, the service will not be compatible with iTunes, or iPods .... That's brilliant, isn't it? Since the iPod line is the hottest selling player, and is the gateway product for introducing consumers to legal online music - let's leave that market in tact for Apple.
I'm no marketing guru, but I would want to eat Apple's lunch if I was Microsoft.First off, you have this massive potential audience of iPod users - They may or may not buy music from Apple - but they probably do buy some, or have at least considered it. There isn't a subscription model service available from Apple with an All-You-Can-Eat model - so at very least some of these customers could still buy some music from Apple, and subscribe to the subscription service from Microsoft if given a chance. If they did, it wouldn't be long before they would buy songs and video from Microsoft if the prices and quality are good - why wouldn't they?
The technology for this is available, Audible has content that works in any player - with DRM intact. Microsoft has a Macintosh development team, and they are likely more than capable of writing an application for the mac to load music on the iPod, or a plug-in for iTunes ... can't be that complicated to a team that wrote Entourage and Office for mac - and with IE mac out of the picture, maybe they have some time on their hands, maybe.
Maybe it's just the thought of validating that the iPod is a great player that they're afraid of? Get over it, the money is in the content in the long run, and even a pretty iPod will eventually break. If they user has a broader perspective of the digital media player marketplace and formats, they're next player might just be something other than an iPod .... but not if their entire media buying experience is with iTunes .... Wake up guys.
Digg It!DZone It!StumbleUponTechnoratiRedditDel.icio.usNewsVineFurlBlinkList

Be the first to rate this post

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

Apple Stock Compared to Google ?

November 17, 2005 01:30 by keithkaragan
If you look at Apple and Google's stock prices, it may not appear that there's a great similarity, but I noticed that they seem to on similar trajectories over the last year when you look at the percentage gains of both over the last year (see for yourself, at least at the time of the post). Does this have some significance in relation to the tech industry? Are we entering a up cycle?
Digg It!DZone It!StumbleUponTechnoratiRedditDel.icio.usNewsVineFurlBlinkList

Be the first to rate this post

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

Power source that turns physics on its head

November 11, 2005 01:30 by keithkaragan
This story is realy interesting, yet really short on facts and other details:
http://www.guardian.co.uk/renewable/Story/0,2763,1627425,00.html

excerpt:


It seems too good to be true: a new source of near-limitless power that costs virtually nothing, uses tiny amounts of water as its fuel and produces next to no waste. If that does not sound radical enough, how about this: the principle behind the source turns modern physics on its head.
Randell Mills, a Harvard University medic who also studied electrical engineering at Massachusetts Institute of Technology, claims to have built a prototype power source that generates up to 1,000 times more heat than conventional fuel. Independent scientists claim to have verified the experiments and Dr Mills says that his company, Blacklight Power, has tens of millions of dollars in investment lined up to bring the idea to market. And he claims to be just months away from unveiling his creation"

So a battle should ensue over the credability of the science and the meaningfulness of the discoveries that Mr. Mills has made in regards to conflicting quantum theory. He claims to have a prototype, so the proff should be in the pudding (so to speak) - and the scientists examining it should be able to say if this is something 'new' to the scientific world, a fraud, a mistake, or something that works and is able to be explained with the known principles of science.

Exciting times ahead.

Digg It!DZone It!StumbleUponTechnoratiRedditDel.icio.usNewsVineFurlBlinkList

Be the first to rate this post

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

Database Architects Lead Pack As IT Wages Rise

November 11, 2005 01:30 by keithkaragan
According to InformationWeek.com, Database Architects and DBAs are in demand! Great news for Database folks!
excerpt:

" The positions most sought after and their hourly wages include: database architect, $60.53 an hour; embedded developer, $57.67; Oracle DBA, $54.73; Java developer, $53.38; applications developer, $51.15; Cisco engineer, $48.99; SQL DBA, $45.56; clinical data manager, $43.79; and clinical research associate, $37.79"
Digg It!DZone It!StumbleUponTechnoratiRedditDel.icio.usNewsVineFurlBlinkList

Be the first to rate this post

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

THE CAR THAT MAKES ITS OWN FUEL

November 1, 2005 16:54 by keithkaragan
This is pretty wild sounding, and if true, would seem to be the ideal solution for today's energy and environmental issues concerning transportation. I hope to hear more about this one in the future.
Excerpt:

"IsraCast recently covered the idea developed at the Weizmann Institute to use pure Zinc to produce Hydrogen using solar power. Now, a different solution has been developed by an Israeli company called Engineuity. Amnon Yogev, one of the two founders of Engineuity, and a retired Professor of the Weizmann Institute, suggested a method for producing a continuous flow of Hydrogen and steam under full pressure inside a car. This method could also be used for producing hydrogen for fuel cells and other applications requiring hydrogen and/or steam..." Link
Digg It!DZone It!StumbleUponTechnoratiRedditDel.icio.usNewsVineFurlBlinkList

Be the first to rate this post

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