Filtering a view based on Audience Targeting

So you’ve tried the fancy Audience Targeting (AT) feature in MOSS. You probably realized it’s just this || close to useless unless you want to use that “AMAZING” content query web part. What if you want your custom view to be filtered for the user’s audience? This solution doesn’t cover all scenarios but it goes far.

What is needed:
SPD, your view needs to be converted to XSLT, and you need an audience.

What are we trying to do:
you have a doc lib with AT turned on, and you have individual docs with audiences specified. you want to show the right audience the right docs.
but you realize that this isn’t working.

What you need to do:
Create a page with two views to your doc lib.
Convert them to XSLT.
Build a basic filter in the first one (Title contains “something”) use “contains”
The Data Query is created in the XSL, where you can edit it.

In the first view: (showing just the docs for the target audience)
In the code, search for: Name="Title"
Replace the word Title with Target_x0020_Audiences
In the code search for: Type="Text">something<
replace the word something with the exact name of your Target Audience (don’t replace the spaces with _x0200_)
right click the first view in SPD and go to web part properties > advanced
specify the audience that should see only the docs targeted at it
This view will be shown to that audience only

In the second view: (showing all docs)
right click it in SPD and go to web part properties > advanced
specify the audience that should see everything
This view will be shown to that audience only

Done

Save, browse and enjoy the hack!

InfoPath 2007 – change button label on click

Without using code, this is fairly easy.

1. create a text item in your main data source to hold the button’s label, don’t forget the default value
2. create your button and set the label to the value of the text item from step 1.
3. create the rules for the button to change the text

Moving SharePoint libraries

Moving libraries from one site to another isn’t a built in feature of any sort. But there is a nice way (not free) with major benefits.

The document libraries in WSS  are easy to move if you don’t have versioning turned on. In such a simple case, you just move files over from one lib to another. But to move all the extended properties you’d need to do some DB massaging. I recently purchased a product called DocAve which is a fantastic third part SharePoint backup tool, which can be used to restore all backed up items (selected individually) out of place. Meaning to any arbitrary SharePoint location. This includes different sites and subsites.  Do yourself a favor and visit http://www.avepoint.com/

SmartPart – Loading a List, Getting a Field

In this installment we look at how to access a Sharepoint list and get at a field of that list. I’m not gonna look at the security aspect of this scenario, but suffice it to say that you’ll probably need to adjust the permissions of your traget list in order for SmartPart to gain access.

Read More »

SmartPart Design Mode Prep

This is a continuation on my SmartPart web part development. In this installment I go over what I do with the Design phase to make it more controllable.

A problem that you run into with developing with SmartPart is that what you actually develop is a User Contro, which in VS 2003 is not all that advanced in terms of visual form design. THe problems I ran into were related to precise placements of buttons and text boxes, making things appear or disappear. To make things easier I do this:

The container panel (the first one) can be made to appear and disappear and you can have multiple panels each one representing a different “mode” kind of like a seperate form. You can also use this to create multiple toolbars that would appear depending on who’s logged into the SharePoint site. The Grid layout Panel from the HTML section of the toolbox is what allows me to place things as I please. This is not a very precise representation of what your page will looklike so make sure you build and deploy for a final review.