Getting search to show search results for social tags and the SocialTagId managed property

by Ради Атанасов 18. March 2013 04:20

The SharePoint 2010 “My Profile” page provides some cool social tagging features that intertwine with Search, Managed Metadata and obviously the User Profile Service.

If you click the “Tags and Notes” link you will see a summary of social activity related to the user:

clip_image002

You can refine a tag for the particular user, but one functionality that not many people know of is the “Tag Profile” page. You can reach it either from the Tag Cloud Web Part, or clicking on one of the tags in the tag feed on the profile page (see my hot pink arrow in the image above).

You will eventually reach a page with a URL like “…../mysites/tagprofile.aspx?termid=bfcb16ea-cb44-46c4-b8f2-6da2646262c0” and it will look like this:

clip_image003

What might not seem so obvious to everyone is that the profile page says there are “no available items tagged with…” yet we reached this exact page by seeing what’s tagged by our user :) A bit silly, but there is a technical explanation. The “Tags and Notes” page feeds data from User Profiles social data, while the tag profile requires Search.

Now, another extremely obscure link and functionality… the text says “To find content related to ‘[Term]’ in search, please click here.” Well, OK, I think this is the only place I’ve ever seen this link or at least I can’t remember any other places at the moment. Clicking it takes us to some very interesting functionality:

clip_image005

It will take you to the search center configured in UPA; SocialTagId:"bfcb16ea-cb44-46c4-b8f2-6da2646262c0" will be the search keyword. The syntax suggests that “SocialTagId” is a managed property. Many environments don’t have this particular functionality configured and there is a lot of misinformation on how to configure it.

So here is what you really need to do to get this working in SharePoint 2010:

1) Make sure User Profiles, Search and Managed Metadata are all up and running. You don’t need User Profile sync.

2) Make sure the My Site Host is configured in the farm and:

a. The User Profiles Service Application is configured with the My Site Host url:

clip_image006

b. The web application containing the My Site Host is added as an “sps3” (or “sps3s”) start address in a content source:

clip_image007

HINT: create a separate content source for People data so it is more manageable and you could create separate crawl schedules

c. The search crawl account (aka Default Content Access Account) has read permissions on the My Site Host. The easiest way to achieve this is through a web application policy:

clip_image008

3) Configure the search crawl account to have permissions over User Profiles. This step is a bit tricky, you have to click the Administrators ribbon button when your UPA is selected:

clip_image009

You need to give the account the following two permissions:

· Retrieve People Data for Search Crawlers

· Manage Social Data

clip_image010

NOTE: this post by Steve Peschka explains why: http://blogs.technet.com/b/speschka/archive/2010/02/22/why-do-i-get-an-access-denied-error-when-managing-user-contexts-in-sharepoint-2010.aspx

NOTE2: Yes, I am using my farm account to crawl content. You don’t need to do this and you shouldn’t, but this is how my demo environment is set up for simplicity.

4) Create some content and tag it with some keywords. To be honest I am not 100% sure this is actually required, but this is generally true for search – it must have content to find its crawled properties before you can elevate them to managed properties.

5) Run the User Profile Social Data Maintenance job:

Get-SPTimerJob | ? {$_.TypeName -match "socialdatamaintenance"} | Start-SPTimerJob

6) Run a crawl that will capture the content you tagged

If everything is OK and the galaxies are well aligned, you will see successful logs in the content source logs:

clip_image011

(Actually, you might see the above if it hasn’t worked either!)

Then your Tag Profile page will look like this:

clip_image012

And clicking the tiny “search” link will show you results from Search J The search URL will look like this:

/search/results.aspx?k=SocialTagId%3A%22cc725510-7468-4342-80d6-5c1c9fb27180%22

So you may wonder, why would you need this, it doesn’t look that flashy? Well.. You can now query for items with certain tags using search. You can use this in custom rollup functionality scenarios like I need to do in one of my projects. Cool.

Hope this helps someone out!

Tags: , ,

English

My slides from the European SharePoint Conference 2013

by Ради Атанасов 8. February 2013 04:36

So, European SharePoint Conference 2013… lots of fun, lots of friends and an absolute goldmine for business contacts.

My session - Building SharePoint 2013 Apps - Architecture, Authentication & Connectivity API – rolled out a score of 8.2/10. Not bad, I even got a mention that it was in the highest ranking talks.

What I spoke about:

  • A quick technical overview of SharePoint Apps, just to set the scene
  • Why we need to consider Apps
  • How Apps “work” inside of SharePoint – the app domain, IIS and DNS, how the Site Subscription Service and App Management Service come into play and what their role is
  • Authentication – How OAuth works with a neat demo in Fiddler
  • Server-2-Server Authentication – How to set up S2S and how it differs from OAuth
  • Token fun – context, refresh, bearer, access tokens and whatever else I could throw in

http://www.slideshare.net/SharePointRadi/euspc-2013-radiatanassov

Unfortunately I didn’t have time for App licensing and REST/CSOM communication.

Another cool galleons galore step for me – I got recognised as the Top Influencer for Bulgaria:

Adios!

Tags: , ,

English

Getting Started with SharePoint 2013 and Office 2013 Application Development

by Ради Атанасов 17. July 2012 08:55

So chances are you’ve heard a  lot of noise around the official launch of SharePoint and Office 2013… Well there is a LOT to it. New App development models, new features and API’s, enhanced capabilities and a ton of improvements. The Apps for Office paradigm is also very slick.

So where do you start?

SharePoint 2013 Developer Training: http://msdn.microsoft.com/en-US/office/apps/fp123626- here you will find a ton of cool videos showing off some new stuff. They even have stuff on Project 2013 development Smile Maybe PSI will work this time?

The Office and SharePoint App Development site: http://msdn.microsoft.com/en-US/office/apps- a TON of resources. Some are still being added so you might get some 404’s

The Apps for SharePoint (2013) Overview - http://msdn.microsoft.com/en-us/library/office/apps/fp179930(v=office.15) – definitely one of the best places to start reading up on how SharePoint 2013 introduces a new development paradigm.

Developer downloads: http://msdn.microsoft.com/en-US/office/apps/fp123627 – Expect the official SDK to be released here.

image

Tags: ,

English

Download the SharePoint 2013 (15) Preview

by Ради Атанасов 17. July 2012 08:31

Ive been waiting for this day for a LONG time... The internet is going crazy over the new Office 15 and us SharePoint fans can’t sleep from all the excitement either.

Watching all the online commotion, chatter and reviews is fun, but the best part is trying it out yourself.

Get your hands dirty:

http://www.microsoft.com/en-us/download/search.aspx?q=SharePoint+2013

clip_image001

The bits are getting added one-by-one as I am typing this, so there you go.

Also check out the Office 365 CP:

http://www.microsoft.com/office/preview/

 UPDATE: here is the link to SharePoint Server 2013: http://technet.microsoft.com/en-us/evalcenter/hh973397

Tags:

English

Architecting your SharePoint application–things you shouldn’t miss out on

by Ради Атанасов 24. October 2011 03:57

So a few people recommended I post my slides or content from my European SharePoint Conference session. I cover a list of considerations that makes a good reference for people undertaking the design of custom applications on SharePoint.

Usually in projects you would have people responsible for the design of the infrastructure and then a development team would dig into the technical design of the SharePoint application. They will try to answer how different components will be used to satisfy the requirements. Solution Architects explore various options for meeting each requirement and all these options and choices intertwine into a proposed design, maybe a model or a proof of concept, and hopefully a document. Projects that miss this communication are either chaotic, or extremely agile.

When doing architecture there is usually more than one possible way to achieve the same thing – the “right” one will depend on the situation and each of the things I’m pointing out here could be equally right or wrong. This is especially true for SharePoint. That is why “awareness” and the knowledge of SharePoint are one of the key requirements for an architect to be any good.

This list is not the ultimate list – it is just my summary of what always lands on my table. It is also not the base for a definitive Technical Design document (it’s a start!). Some items below didn’t get mentioned in my talk as time was limiting what I could include.

Front-end Planning

Page Model – How you plan to store you (ASPX) pages

  • Application Pages (_layouts)
  • ASPX files served from a Document Library
  • ASPX files in folders
  • Publishing Infrastructure – page layouts
  • Consider Web Part Pages vs. Wiki Pages

Form Strategy – Consider how you will capture data and what controls/interfaces you will use

  • Understand how SharePoint forms work and consider using SharePoint’s API’s
  • SharePoint InputControls are great but may be difficult to use and may have limitations
  • Consider exchanging data between forms. Plan Session and ViewState requirements
  • SharePoint Scenario Framework
  • Consider validation requirements and the UX on the validaiton
  • Also consider Silverlight and InfoPath forms as alternatives for capturing data

Client-Side Scripting – plan out any requirements for client-side JavaScript

  • If using validation, plan out your client-side scripting and the use of any frameworks
  • Will you use the Dialog Framework or any other popup/dialog framework/toolkit?
  • Consider the use of jQuery, Modernizr, Knockout

Page Components – define what controls, web parts or other components you will use to create the actual interfaces

  • Web Parts vs. User Controls
  • SharePoint Rendering Templates and the Form UI (_controltemplates)
  • Consider the styling/branding of your custom interfaces – you don’t want your developers to be designers (unless they really are)
  • Iframe – various solutions use Iframes to display external content or components hosted elsewhere (plan out authentication)
  • Consume HTML asynchronously – I have seen solutions that grab HTML from an ASHX or other services
  • InfoPath – always think about the User Experience when you deal with InfoPath

Resource Files – evaluate how you will use resource files and what components will require localisation

  • Code-behind resource files
  • ASPX resource files (14\Resources, AppGlobalResources)
  • Feature Resources
  • Localised Web Templates

Back-end Planning

SharePoint Data Model – define the storage of data

Consider:

  • How are you going to store data?
  • How will it scale?
  • How are you going to access it? (SP OM, External Data (BCS), Web Service calls)
  • How are you going to “replicate” it? (backup, archive, move/copy, log)
  • How are you going to store applicaiton settings (SP list, P&P Settings)

Visual Studio Solution Structure – How will you structure code and artefacts

  • Number of WSPs/Number of Features
  • Separation of code
  • Separation of SharePoint items
  • Namespaces and naming conventions
  • Source Control strategy

Design Patterns/Anti-Patterns – make your code maintainable and nice if it makes sense to do so

  • SharePoint Service Locator (P&P)
  • Façade/Adapter
  • Consider/plan your data access layer

Security Model – don’t think about it in production

AuthN:

  • Kerberos/NTLM (consider the requirement for Kerberos)
  • Claims (consider the effort to pull it off and any side-effects)
  • Plan the use of service accounts and access for/to external systems

AuthZ:

  • Use SP groups or AD groups?
  • Nested groups
  • Do you really need item-level security?

Exception Handling and Logging – define how to display/capture errors and how you log them

  • Consider how you will display errors to the user (don’t do lblMessage.Text = ex.ToString(); )
  • Define what needs to be logged and how
  • SharePoint Logger (P&P) gives you a good API for Diagnostic categories and areas

Deployment

Solution Deployment Frameworks – define how your developers will deploy

  • MSBuild
  • NAnt
  • 100% PowerShell
  • CKS-Dev addin  for Visual Studio 2010

Other Knobs and Dials – there are many other things that affect deployment

  • WSP lifecycle
  • Feature activation
  • Activate on Default
  • Deployment configuration
  • WSP additional DLL's
  • Force on Activate
  • Safe Controls
  • Web.config modifications
  • Web Part deployment
  • List re-creation
  • Feature Upgrade

Site Templates – reusable functionality that admins or end users could provision

  • Site Definitions
  • Web Templates

Continuous Integration and Testing

  • Plan and define the CI/Build process
  • Always consider how you will upgrade the solution
  • Define the unit testing and mocking requirements (Pex & Moles, TypeMock)
  • Funcitonal UI Testing (Selenium, Coded UI, Telerik Test Suite)
  • Always sync with the test team and what they do/how they will test your solution

To close off the talk I finished off with a few tips:

  • Build applications in such a way that makes you feel proud of what you have built. Doctors feel good when they help people, architects feel good when their creation is built, lawyers are happy when they get paid – there is no reason why SharePoint developers and architects shouldn’t feel good about what they do if they do it well.
  • Motivate your team to do good work – As an architect you are most likely a role model. Do your best to motivate your team members to be champions and get good stuff out there. Reward them for good efforts.
  • Change your job if your boss/architect/team leader/project manager is pressuring you to do crap work with no process around it, no scope, no clarity, no design, etc. Your SharePoint career is way to short for you to be doing crap work in crap teams. Only you could make that change.
  • Apply development practices and architecture to SharePoint solutions – many say that there is no real development in SharePoint. It’s true that there is a lot of “other stuff” in SharePoint projects, but for the development part – make it count.

Here is my slide deck: SharePoint Solution Architecture – Radi Atanassov

During my talk I showed bits of a solution I use to POC various SharePoint components. I use it to explain and demonstrate things to students, forums and colleagues. I call it Community.SharePoint and as soon as it has a few other key components I will post it on CodePlex.

Here is the version I used at the European SharePoint Conference: Community.SharePoint-EUSPC

Hope this helps someone!

Tags: , , ,

English

European SharePoint Conference is over!

by Ради Атанасов 24. October 2011 03:56

Now that the conference is over I can finally take a moment and rest before the week starts. #EuropeanSP was a great adventure full of learnings, laughs, new contacts, new opportunities, plenty of fun and drinks. I got to meet many SharePoint heroes whom I haven’t met before and managed to exchange some cool gossip. Conferences like these really demonstrate how much SharePoint has grown not only as a product with features, but as a product with a community, a following, a resource gap and a HUGE market.

My talk was targeted towards SharePoint solution architects and developers who get to design their custom applications. My main driver for picking this topic was questions I get in the fashion of “How do you design your solutions?” or “What do you do when people throw you a set of requirements?”.  I was very happy with the turnout and I got really good feedback from some people.

I will be writing a new blog post with the content, code and slides.

Tags: ,

English

My Session at the #EuropeanSP Conference

by Ради Атанасов 17. October 2011 21:23

I’m at the Estrel hotel in Berlin on the tutorial day of European SharePoint Conference. Most people will be arriving today – you can definitely feel the SharePoint vibe in the air. The Estrel Convention is absolutely HUGE, walking around this place is a calorie-burning experience!

I’m engaged in a few activites:

  • Wednesday 19th October 15:00 – Ask the Expert Session – IT Decision Makers
  • Thursday 20th October 11:15 – Ask the Expert Session – Developers
  • Thursday 20th October 14:00 – Advanced Solution Architecture & Development – my talk for this conference.

Please come and say hello!

Tags: , ,

English

I’m presenting a SharePoint Conference Webinar in 4 hours!

by Ради Атанасов 8. September 2011 17:13

I just wanted to post up info on a webinar I am delivering as part of the European SharePoint Conference program.

I will be talking about SharePoint Architecture, what it is, who are the “architects”, what their challenges are, how they make decisions and how their decisions impact the progress of a project.

Join me here:

Thursday 8th September, 11am CET

SharePoint Solution Architecture - Introduction and Fundamentals Presented by Radi Atanassov, MCM -SharePoint 2010, MVP, MCT, OneBit Consulting, Bulgaria

Register Now >>

Tags: ,

English

Custom WCF Services and setting Reader Quotas in SharePoint 2010

by Ради Атанасов 28. August 2011 19:55

I’ve been working quite a bit with custom WCF services in SharePoint 2010 and have found there’s quite a bit to it. The part that worries me is that there is a ton of information out there that is not always best for enterprise scenarios, like setting the site in IIS to anonymous just to get service calls working.

Anyway… I was trying to figure out why the reader quota settings weren’t getting applied to our services. We had the following debug code:

  1. SPWebService contentService = SPWebService.ContentService;
  2.  
  3. contentService.ClientRequestServiceSettings.MaxReceivedMessageSize = -1;
  4.  
  5. SPWcfServiceSettings wcfServiceSettings = new SPWcfServiceSettings();
  6. wcfServiceSettings.ReaderQuotasMaxStringContentLength = Int32.MaxValue;
  7. wcfServiceSettings.ReaderQuotasMaxArrayLength = Int32.MaxValue;
  8. wcfServiceSettings.ReaderQuotasMaxBytesPerRead = Int32.MaxValue;
  9. wcfServiceSettings.MaxReceivedMessageSize = Int32.MaxValue;
  10. wcfServiceSettings.MaxBufferSize = Int32.MaxValue;
  11. wcfServiceSettings.ReaderQuotasMaxDepth = Int32.MaxValue;
  12. wcfServiceSettings.ReaderQuotasMaxNameTableCharCount = Int32.MaxValue;
  13. wcfServiceSettings.ReceiveTimeout = TimeSpan.MaxValue;
  14.  
  15. contentService.WcfServiceSettings["MyService.svc"] = wcfServiceSettings;
  16.  
  17. contentService.Update(true);

This was placed in a feature scoped at the web application level, and the WSP was deploying to /ISAPI/CustomWcf/MyService.svc”. We we’re using SharePoint’s MultipleBaseAddressBasicHttpBindingServiceHostFactory factory, and if you are you don’t need to set anonymous in IIS.  This factory applies your security settings as they are on the web application.

So why weren’t our WCF Service settings getting applied? If you check out this MSDN article, it doesn’t actually tell you what I figured out:http://msdn.microsoft.com/en-us/library/ff599489.aspx

The problem is that “MyService.svc” should actually be lower case: “myservice.svc”. It sounds silly, but that is what worked for me. The /CustomWcf/ folder part should be excluded.

If anyone is doing the same, here are a few tips on how such deployment strategy could be improved:

  • The feature should really be at a farm level if it is modifying settings on the Content Service. There is one per farm.
  • Feature Deactivation code should call contentService.WcfServiceSettings.Remove("myservice.svc");
  • You SHOULD NOT just use Int32.MaxValue, but actually figure out your maximums and what exact properties you should apply them on. In my example I’m obviously trying to get a sample to work.
  • Make sure your deactivation doesn’t break any other solution if you are resetting with this line: contentService.ClientRequestServiceSettings.MaxReceivedMessageSize = 0;

Hope this helps!

Tags: , ,

English

“Activate on Default” confusion and features scoped at Web Application level

by Ради Атанасов 23. July 2011 14:59

When creating SharePoint features in Visual Studio 2010, one of the settings that defaults to True is “Activate on Default”.

image

There is a lot of confusion as to what this setting actually does:

  • It ONLY applies to features scoped at Farm and Web Application levels. You can still modify it for other features, but it doesn’t do anything.
  • Any feature (Farm or WebApplication) with that setting set to True will automatically activate when you deploy the WSP solution, no matter which way you deploy it (Install-SPSolution, stsasm.exe, Central Administration)

This setting is not related to the deployment configuration settings in Visual Studio 2010:

clip_image001

These features will still activate, even if VS’s deployment configuration is set to “No Activation”.

Where can this be an inconvenience?

When you create features that deploy Timer Jobs at the Web Application level, you really want to have “Activate on Default” set to False. Otherwise, your feature will be activated on ALL web applications. I did some tests and found out that even if your WSP Solution is not global and is deployed to a specific Web Application, your feature will still get activated. Dangerous, you really want your Timer Jobs to be running where they are meant to run, i.e. don’t deploy Timer Jobs to Central Administration unless you really need to.

If you are ever trying to find out why your Timer Jobs are “attached” to all web applications, this might be why.

Tags: , , , , ,

English

Microsoft Certified Master

SharePoint Server MVP

About the author

SharePoint architect, consultant and solution developer.

Аз съм консултант, архитект и разработчик на SharePoint решения.

Feeds

Get RSS Feed (Bulgarian)
Get RSS Feed (English)    
Get RSS Feed  (Both)        

I blog about technical concepts in English, as they benefit the whole community, but sometimes I blog about stuff specific to Bulgaria, and those I post in Bulgarian. The above feed URL's let you choose what to subscribe to.

My SharePoint Forum Activity