Aug12

Using Add from existing site column (and how to break CQWP!)

One of my clients called me last week and seemed to be a little troubled.  To protect his identity I'll call him Gary. 
 
We've been working together to roll out an internal site for a large company.  We'd setup a number of Team Sites and wanted information from several of these sites to roll up into Product sites using the Content Query Web Part (CQWP).  We had created Site Columns at the site collection level to describe the documents we were uploading and set them as Choice fields.  We setup the CQWPs using the filtering capabilities to only show us documents that met specific criteria (the CQWP can only filter on site columns created at the site collection level). It worked like a charm. and everything rolled up as it should until one day a new requirement was introduced to make it so the same documents from a single Team Site could show for multiple product sites.   Gary changed the site column on the list to a choice field with checkboxes. 
 
This is about when phone rang.  Gary told me that the CQWP didn't seem to work with the checkboxes.  (NOTE: There had been about a month since we initially set these columns up and when the call came in).  I checked it out and he was correct, the CQWP wasn't working.
 
Then it occured to me what was happening.  The site column was originally created at the site collection level to support the filtering of the CQWP.  We then created a document library and added our site column as metadata by clicking "Add from existing site column" -- this basically just makes a copy of the site column to the list.  When Gary went in and changed the choice field to use checkboxes it essentially changed the data type.  The CQWP was trying to apply a filter based on a single value choice field but the actual data in the field in the list was choice w/ checkboxes which caused an error.
 
The bottom line is, if you make a site column at the site collection level don't change it!  You run a big risk of having fields of the same name with different types of data.
 
JR
 
 
Published: Aug-12-08 | 2 Comments | 0 Links to this post

Aug08

Updated my blog to CKS:EBE 2.0

As a SharePoint consultant I thought it was important to blog of the platform that I tell my clients to use.  I'm lucky enough to have access to a public facing MOSS server so I thought I might as well take advantage of that.
 
I blogged on the OOTB SharePoint blogging engine for a few months and began to notice a few things that bothered me.  Specifically that anonymous posts come in and don't have a user associated with them.  This allows anyone who comments anonymously to see all the rest of the anonymous comments whether they've been approved or not.  There were a number of other minor issues that were less than ideal.
 
I decided to check out the Community Kit for SharePoint: Enhanced Blog Edition 2.0 -- turns out it fixes just about every one of my issues and even some I hadn't even thought of!!
 
Really great stuff!  Definitely shows off the type of things that are possible with this platform we call SharePoint!
 
JR
Published: Aug-08-08 | 0 Comments | 0 Links to this post

Aug07

Setting Expectations: Forms Based Authentication (FBA) with SharePoint

This is the first in what I'm hoping will be a series of posts focused on giving the full story for different pieces of SharePoint functionality.  SharePoint is a very powerful product with a laundry list of features and functionality.  When planning a project the question comes up as to whether SharePoint can do something, the answer is often viewed as yes or no.  In many cases, the answer should be "it depends on what you expect."
 
A good example of this is the decision to use Forms Based Authentication (FBA) with SharePoint.  Because SharePoint 2007 is built on top of ASP.NET 2.0, developers and admins can use FBA to allow users, who's identity information is stored in SQL (or ADAM another non-AD db), to authenticate to SharePoint. 
 
This is very attractive because many times companies want users who are not in their AD to authenticate to SharePoint.  Most often, I see this used for Internet site or Extranet scenarios.  The option to use FBA opens a lot of possibilities for what you can do with SharePoint.
 
I spend a lot of time in the Microsoft TechNet SharePoint Forums and also often get calls from clients who want to use FBA simply because they want to allow external users to authenticate to SharePoint.  This is one of those times where it is important to set expectations properly. 
 
FBA does provide a mechanism where external users can authenticate to your SharePoint server without having to be in AD, but there are some tradeoffs that I don't see mentioned very often (if ever):
 
1) It is complex to setup and configure.  There's a lot more to it than just flipping a switch
 
2) Management of users isn't the greatest.  There are some 3rd party utilities out there that can help out with this though.  I often install this to help make things easier:
 
3) MOSS cannot crawl web applications using FBA so you'd need to use a dual authentication configuration to ensure that search works.  For more information on that, Andrew Connell has a great post about this:
 
4)  **This is the one I never see anyone bring up** Users who authenticate via FBA do not have the same level of functionality available to them as users who authenticate with a Windows Authentication method.  Essentially the client integration features won't work:
  • Links that start client applications are not visible.
  • Documents are opened in the browser. Documents cannot be opened by client applications.
  • Users cannot edit documents on the site directly from the client applications. However, users can download the document, edit the document locally, and then upload the document.
For more information take a look at "Expected Behavior When Client Integration is disabled" in this link:
 
You can always attempt to use some type of workaround, but the point of this post is to explain that FBA isn't a silver bullet.  Anything can be done given enough time and money, but the goal here is to set expectations and give the whole story. 
 
If you have a situation where you want to give external users access to SharePoint and maybe FBA doesn't sound right for you, consider setting up a separate OU in AD for your external users and set a policy that doesn't allow them to authenticate locally to your domain.  Or you could always spin up a separate AD with a one-way trust.
 
Setting expectations is key to any SharePoint implementation.  Take the time to do proper planning and it will make your life easier and lead to happier end users! 
 
If you'd like to get more information about SharePoint Project Planning, sign up for the class I'm co-authoring with Joel Oleson and Nicola Young for the Ted Pattison GroupSharePoint Planning and Governance
Published: Aug-07-08 | 3 Comments | 0 Links to this post

Aug06

SharePointers - What do you tell your friends and family you do?

I run into this all the time -- my parents or friends ask me "What do you do?"  I can tell them I'm a consultant but inevitably they always ask for more details.  What do you say?  Heck, my own wife barely understands it.  For those of you that have ever watched Friends, she says I'm like Chandler - no one knows what I really do.
 
I normally go with something like "Basically, I work with an enterprise server product from Microsoft that makes it easier for companies to manage their information."  Which is almost always followed up with "Oh! So you work with computers!?" 
 
I've worked long and hard to remove the idea from people's heads that I know anything about "computers" because it always leads to phone calls from friends and family about why something is slow (which is normally related to the fact they randomly clicked on a blinking ad somewhere - but I digress). 
 
All you SharePointers out there -- what do you tell your friends and family you do? 
 
JR
Published: Aug-06-08 | 3 Comments | 0 Links to this post

Aug01

SharePoint Navigation -- learn something new every day!

I've been working with a client and we are nearing the final stages and getting ready to go live with a site.  We've done a custom master page and made some changes to allow 2 levels of dynamic flyouts from the global nav.  Nothing too exciting. 
 
So the client calls me the other day telling me he can't figure out how to prevent a specific subsite from showing in the Global Nav.  His nav is structured like this:
Portal
       -SubSite lvl2
             -SubSite lvl 3
                    -SubSite lvl 4
Since we allowed the Global Navigation setting for MaximumDynamicDisplayLevels="2" we'd expect to see all of the SubSites up to lvl 4 in the Global Navigation.  Should be easy right?  Just go in and turn off allow to show subsites. 
 
Normally that would be true however in this case we were inheriting the Global Navigation from the parent and had the Current Navigation set to only show navigation items below the current site.  The client's goal was to show SubSite lvl 4 in the Current Nav but not in Global Nav. 
 
We unchecked to Show Subsites, but SubSite lvl 4 was still there.  Why?  It turns out that in order to get SubSite lvl 4 to show in the Current Nav the client manually added it as a link.  This caused it to roll up to the Global Nav.  If you take a look at the default nav control in a publishing master page it looks something like this:
 
<PublishingNavigation:PortalSiteMapDataSource ID="GlobalNavDataSource"
    Runat="server"
    SiteMapProvider="CombinedNavSiteMapProvider"
    ShowStartingNode="false"
    StartFromCurrentNode="true"
    StartingNodeOffset="0"
    TrimNonCurrentTypes="Heading"
    TreatStartingNodeAsCurrent="true" />
 
The line I've highlighted tells the navigation control to trim out headings from the navigation control, but apparently manually created links are not.  To fix the problem we changed the line to look like this:
 
TrimNonCurrentTypes="Heading, AuthoredLink"
 
This prevented both headings and manually created links from showing up in the navigation.  Unfortuntely, you can only control whether pages or subsites roll up in the navigation using the UI.  The navigation definitely allows for much greater control but all the changes must be made through in the master page itself.
Learn something new every day.
 
JR
 
Published: Aug-01-08 | 0 Comments | 0 Links to this post

Jul07

Yes/No fields aren't your friend! Use Choice fields instead

I was working with a client last week who reminded me of one of my least favorite nuances about SharePoint -- the Yes/No field.  It sounds pretty simple right?  If you are making a list and you have a requirement to add a field something like, "Are you a robot?"  Would seem like a slam dunk for a Yes/No field right???  Technically it would "work" just fine but there's an issue.
 
You've probably already done this and are thinking to yourself "John, it works just fine."  You are right, you probably selected No in your list item and it saved it shows up as "No" in your view.  What's actually happened is that behind the scenes that No has been stored as a "0" -- if you had said Yes it would have been stored as a "1." 
 
This causes issues when you try to run searches or use things like the Content Query Web Part (CQWP).  The typical user would do something like want to create a CQWP that only shows items where someone had specified "Yes" they were a robot.  However, no results would show up because the value they need to be looking for is "1" not "Yes." 
 
To avoid this confusion I strongly recommend against using Yes/No fields and instead suggest people use a Choice field and specify the values as "Yes" and "No" which behaves exactly like you'd expect.  No need to mess with 1s and 0s. 
 
JR
 
 
Published: Jul-07-08 | 1 Comment | 1 Link to this post

Jul02

The secret to SharePoint: Keep it simple!!!

I talk to a lot of clients and spend a lot of time reading blogs and reading posts in the SharePoint Forums and I see the same thing over again -- everyone is trying to make the world's most complicated SharePoint implementation.  Before I get flamed for this post, yes I understand there is a time and a place for really complex implementations and in those cases I'm all for it.  What I'm talking about is how many people jump from step 1 to step 5 and forget about all the steps in between.
 
It might make more sense if I give a quick example.  Let's pretend your company wants to implement MOSS.  Currently, you have an intranet of some type but nothing too formal and the vast majority of your documents are still being stored in file shares.  Pretty common scenario right?  In this example, I'd normally recommend to the client that they first install MOSS and migrate documents into an organized structure and just start doing some basic document mangement and maybe a couple other high value things.  What I see many are actually doing is trying to implement the full complement of MOSS functionality in the first pass -- document management, content management, custom web parts and workflows,  branding, etc. 
 
All of that is great as an end goal, but it will take a long time to implement, have a crazy steep learning curve, be more risky, and to top it all off, your stakeholders won't see anything for a LOOONG time.  If you like stress then this is the way for you!
 
However, if you have enough stress in your life then I'd suggest you take the easy route and just do a few simple things you can get your users actually using SharePoint quickly.  Typically, users are going to be so excited by how fast you were able to get something out there for them to use.  Happy users = happy stakeholders. 
 
You can still do your custom web parts and workflows in the next phase of the project.  Or maybe your users will decide what they have is just fine?? 
 
It is amazing how excited end users get over the most simple things in SharePoint so use that to your advantage!  Show them how to create a custom view or use the Content Query Web Part and you'll be a hero -- maybe even get a raise!!  Just don't let on how easy it all is and use the extra time to finish your latest Line Rider design or sign up for the Shane Young or Todd Klindt Fan Club on Facebook.
 
The moral of the story is keep it simple.  Create a vision of where you want to go with SharePoint but do it in phases and only implement a few key pieces of functionality in each phase.  It will make your life easier and also make for happier users. 
Published: Jul-02-08 | 0 Comments | 5 Links to this post

Jun14

Welcome to my shiny new blog

Back on January 2, 2008 I blogged about how this would be a good year.  Shane Young had been trying to get me to join SharePoint911 since the summer of 2007.  In early January I finally made it official and joined SP911.  It has been a little over 5 months now and things just keep getting better.
 
Let me back up for just a quick second - for those of you who never ran across my blog previously let me introduce myself.  My name is John Ross and I'm a SharePoint consultant for SharePoint911 living in Orlando, FL.  I got my start in SharePoint working on the developer side of a large WCM project -- making lots of Features and solutions.  Apparently, when you hang out with Shane long enough you start picking up the Admin side of SharePoint too.  So, I've also done many installs, migrations, and general fixing of things when SharePoint isn't happy. 
 
In addition to consulting, I'm also working on a book with fellow SP911er Nicola Young.  And just to ensure that I have NO free time left, I'm also working with Joel Oleson and Nicola on writing a SharePoint Planning and Governance course for the Ted Pattison Group.  Both projects are going to super awesome.  More details to come on each of those topics.
 
I couldn't ask for a better group of people to work with!  Keep an eye on this space cause there will be more coming soon.  I've been holding back on posting until the move happened.
 
 
Published: Jun-14-08 | 0 Comments | 12 Links to this post

Apr04

Custom Advanced Search: Building a URL to search multiple metadata properties

A few days ago in my post called "Creating a custom advanced search by building strings with JavaScript" I talked about how you could use the Content Editor Web Part (CEWP) to build strings that would allow you provide a user friendly way to leverage the advanced search capabilities in MOSS.

To take the concept one step further, what if you created multiple HTML fields in your CEWP and wanted to allow users to be able to type in values in each field to refine the searching experience.  For example you could have two boxes like Car and Color.  A user could type in Blue and Ford and get only the values that matched both metadata properties. All you'd need to do is figure out what your search query would need to look like.  To test you'd need to type a query in this format:

Property1:"Value1" Property2:"Value2"

This would produce a URL that looked something like this:

myResults.aspx?k=Property1%3A%22Value1%22%20Property2%3A%22Value2%22

All you'd need to do is just use some JavaScript to build a string in a similar format.  If you really wanted to get fancy, you could build some smarts into your JavaScript function to allow users to enter data into some or all of the fields and have it check if the field is blank to not use that value in the string.

jr

Published: Apr-04-08 | 0 Comments | 5 Links to this post

Apr02

Creating a custom advanced search by building strings with JavaScript

A little more than a month ago a client called and wanted to customize the MOSS search to allow users to type in a City and have the search only query values in a specific field.  It sounded easy enough, but I told the client I wanted to do some research first which led me to some blog posts like this and this.  I tried it out and it worked – well I thought it worked.  When I tested this method with a real set of data paging no longer worked.  What I mean is that if I performed a search against a scope that had 100 items, if my initial query returned 15 results.  As soon as I clicked on page 2, SharePoint basically forgot what I was searching for.  I had already told the client I had an answer for him, so I was in a little bit of a pickle.

I posted comments to the blogs and even asked a question or two in the MSDN SharePoint Forums – the answer was always “to solve the problem you’ll have to write a custom search box web part.”  This really wasn’t the answer I was looking so I decided to come up with a better way.   It wasn’t until I was in my car on a 2.5 hour drive that the answer hit me. 

A while back, Shane Young (aka The Search Pimp) had shown me a little trick on how to search on a specific metadata property.  All you have to do is  enter a query like this into your Search Box:

Title:<whatever>

That search query will then refresh the page and the URL will now show something like this:

http://webappname/searchcenter/Pages/Results.aspx?k=title%3Atest&s=All%20Sites

That URL has all the information that MOSS needs to return search results and there’s no issue with paging.  To solve my problem, all I had to do was build a string.  Those original blog posts gave me another idea – I decided to use the Content Editor Web Part (CEWP) to build a field and a button attached to a Javascript function.  The idea was that when I clicked the button it would just build my string and then redirect the page. 

If you are trying this at home here’s what you’ll need to do:

1)      Create a web part page

2)      Add the following web parts:

Content Editor Web Part

Search Statistics

Search Paging

Search Core Results

 

3)      Add the following code to your Content Editor Web Part:

Title:<input name=input1 />

<INPUT id="Submit1" onclick='Redirect(form.input1.value)' type="button" name="schButton" value="Search" />

<SCRIPT LANGUAGE="javascript">

function Redirect(input)

{   

//Location where you want to display the

//search results.  This example assumes

//you’d want to have a Core Search Results

//webpart on the same page.  But you could

//redirect to any page with a Core Search

//Results webpart

 var baseURL  = "mySearchResults.aspx?k=Title%3A"+input

    top.location.href = baseURL;

   

    return true;

}

 

</SCRIPT>

 

Using this technique opens up a ton of possibilities.  The main use I’ve seen is to allow users an easy way to search on specific information without having to show them how to use the Advanced Search.  Scopes can also be passed in as a query which you can see in the first URL I showed above.  Since doing this the first time I’ve probably had 5 requests from different clients to do some variation of this.

 

For my client, I customized the search results using this post from Tobias Zimmergen but the options for tweaking this idea are pretty wide open.  I’ve got some other ideas about how to further enhance this concept but I’m going to save it for another post. 

 

As you can see, the answer didn’t take custom coding (the JS was borrowed from one of the many examples out there) – all it took was just a little creativity with using what’s Out Of The Box.

 

JR

Published: Apr-02-08 | 1 Comment | 12 Links to this post

 Next >>