Friday, August 27, 2010

Validating special column types in SharePoint 2010?

How to validate special column types, e.g. phone, e-mail etc in SharePoint 2010?

Basic SharePoint 2010 field validation
One could use an ASP.NET RegularExpressionValidator but surely there must be a simpler way? There isn't really an easier way. Alternative ways might exist though.

If we want to compare values of one column to another or if you want very basic validation you can use Column Validation, but it doesn't support regular expressions so it won't help with things like email.
You could use jQuery to do the validation, which is a bit easier than using a validator, although it only checks on the client side.

Another option if you have the Enterprise version of SharePoint is to use InfoPath to edit the list. With InfoPath you can easily add regex validation.


Saturday, August 07, 2010

SharePoint WebService & JQuery - A tip to remember when calling custom web services in SharePoint from JavaScript (or jQuery)


When customizing rendering templates a wide variety of scripting technologies such as JavaScript, jQuery, and SPServices can be used.

One requirement that pops up from time to time are all of these rendering templates which need  to call a custom web service to populate a drop down list.  This is relatively easy to do and there are plenty of resources out there on how to deploy web services with SharePoint.

It's worth making a point to talk about this issue since a lot of people are asking about it on forums.  The issue is that you build and test your pages and they work great as an administrator. However, once an end user tries the page, the script on the page doesn’t work. 

With any scripting issue, you can bust out FireBug in Firefox and take a look at the page.  It shows the web service call which works great for the administrator but when the user tries it, the result is 403 forbidden.

Obviously, we need to grant permissions, but where?  Since the end user is on the SharePoint site, the identity that the JavaScript is calling with is that of the user.  This of course assumes, you are using NTLM or Kerberos and not doing forms authentication. 

The place we have to grant permissions may not make sense to you at all, but the general consensus is that you grant Read permission to the Authenticated Users group on the bin folder of your web application.  This is the case at least when you are deploying your code to the bin folder (and using Code Access Security).  I don’t believe that web services with binaries deployed to the GAC should have this issue but I could be wrong.  Here is what the permissions look like on your bin folder.



Any how, I hope this helps should you run into this issue.  I don’t foresee any potential security issues by granting this group access to the bin folder, but if you think there are any associated risks, I would like to hear about them.

Tuesday, February 05, 2008

Inventera.net - the Inventive Sharepoint Solutions Providers

Inventera.net is Slovenia based company providing Microsoft SharePoint related solutions and consulting services to (primarly) European organizations.

Solutions are being delivered to mid-size an large enterprises (e.g. with 100.000+ users). Inventera.net experts have been delivering Microsoft SharePoint related products and solutions for over 7 years (starting with 1st beta version of sharepoint in year 2000).

During this time some prestious awards have been achieved by our experts. Two of them being:
- International Information Industry Awards (top 5 finalist project)
- European Information Management Awards (top 3 finalist project)

In both cases, the awarded projects were the only finalist projects/solutions based on Microsoft SharePoint technologies!

For more information you can visit their website at http://www.inventera.net or contact them via email info@inventera.net.

Wednesday, November 28, 2007

Simple but useful - personalization/audiences

Personalization has been with SharePoint for a while... from our custom developed code in SPS2001, constantly improved features in SPS2003 & MOSS2007.

At my work I constantly bump into situations where these features need to be presented to my fellow IT colleagues and/or to end-users.


Here is a nice summary of technical options from Microsoft's MOSS 2007 site:
_______________________________________________________
Link: http://office.microsoft.com/en-us/sharepointserver/HA101690531033.aspx?pid=CH101785971033

Target content to specific audiences

List or library (library: A location on a SharePoint site where a collection of files is managed. The library can display information, including user-defined properties, about each file.) items in Microsoft Office SharePoint Server 2007 can be targeted to appear only to people who are members of a particular group or audience. An audience can be identified by using SharePoint groups (SharePoint group: A group of users that can be created on a SharePoint site to manage permissions to the site and to provide an e-mail distribution list for site users. A group can be used by many sites in one site collection.), distribution lists, or security groups or by using a rules-based system to create a global audience.

In this article


Overview

By using target audiences, you can display content such as list or library items, navigation links, and entire Web Parts (Web Part: A modular unit of information that consists of a title bar, a frame, and content. Web Parts are the basic building blocks of a Web Part Page.) to specific groups of people. This is useful when you want to present information that is relevant only to a particular group of people. For example, you can add a Web Part to the legal department's portal site that contains a list of legal contracts that is visible only to that department.

Any item in a SharePoint list or library can be targeted to specific audiences. To do this, you use the Content Query Web Part. Any other type of Web Part and its contents also can be targeted to audiences.

In addition, you can target site navigation links to audiences. Targeting the links simplifies the users' experience, because they see only the navigation links that are relevant to them.

    To identify a target audience, you can use one or more of the following:

  • SharePoint groups
  • Distribution lists
  • Security groups
  • Global audiences
  • Global audiences are rules-based audiences that are maintained by SharePoint administrators.

Anyone with at least Contributor permission (permission: Authorization to perform specific actions such as viewing pages, opening items, and creating subsites.) can specify a target audience, as long as the name of the audience is known. You can search for an audience by its name, alias, or description by clicking Browse nonein the Target Audiences list.

Top of Page Top of Page

Target list or library items to an audience

The following procedure shows you an example of how to target all of the items from a specific list where the list type is a document library. The Content Query Web Part also allows you to show all of the items from a site and its subsites or to show items from all sites in a site collection. You can then build a query to include the audience targeting that you set on the items in the sites or site collection. There are many ways to build queries by using the Content Query Web Part. Find links to more information about other settings in the Content Query Web Part in the See Also section.

Targeting items from a list or library to a specific audience requires three steps:

Step 1: Enable audience targeting on the list or library

When you enable audience targeting on a list or library, you can target each item in the list or library to an audience.

Note If the SharePoint list or library already is enabled for audience targeting, the Target Audiences column appears.

  1. Click the list or library that contains the item you want to target.
  2. On the list toolbar, click Settings, and then click List Settings or Document Library Settings.
  3. Under General Settings, click Audience targeting settings.
  4. Select the Enable audience targeting check box.

Step 2: Specify the target audience on the items

After you enable the list or library for audience targeting, you can set individual items in the list or library to be displayed to one or more audiences.

  1. Click the arrow next to the name of an item in the list or library, and then click Edit Properties.
  2. In the Target Audiences list, add one or more audiences.
  3. Note If content approval or workflow is enabled on the list or library, the item may need to go through the approval process.

Step 3: Display the item in a Web Part

To display the list or library item to a specific audience, you can use the Content Query Web Part. The Content Query Web Part allows you to build a query that can filter list and library items.

This example shows you how to display all of the the items from a specific list to a target audience. The list type is document library.

Find links to more information about other settings in the Content Query Web Part in the See Also section.

  1. On the page where you want to display the item, on the Site Actions menu menu, click Edit Page.
  2. Click Add a Web Part, and then under Default, click Content Query Web Part.
  3. Click Add.
  4. Click Edit and then click Modify Shared Web Part to open the tool pane (tool pane: A task pane on a Web Part Page used to browse, search for, and import Web Parts from Web Part galleries, and to modify custom and common Web Part properties.) for the Web Part.
  5. In the tool pane, under Query, click Show items from the following list and then specify the location of the list.

    Note In this example, we specify a particular list. You can broaden the scope to include items in lists from more than one site by clicking one of the other options.

  6. Under List Type, choose the type of list that the item is a member of. In this example, click Document Library. Only items in the list type that you choose are processed by the query.

    Note This setting is required.

  7. Under Audience Targeting, do the following.
    To Do this

    Display the list items to the target audience that you specified in Step 2: Specify the target audience on the items, when the current user is a member of the audience.

    Select the Apply Audience Filtering check box. This is required for the query to work properly.

    Also display the items in the list that do not have a target audience specified. These items are displayed to everyone.

    Select the Include items that are not targeted check box. This is optional.

When the page is rendered, the content in the Web Part appears only to current users who are members of the audiences you specified.

Note As with all Web Parts, the Content Query Web Part has a Target Audiences list in the Advanced section of the tool pane. This setting determines whether the Web Part itself is visible to the current user. If not, none of the other settings apply.

Top of Page Top of Page

Target a navigation link to an audience

A navigation link on a server running Microsoft Office SharePoint Server 2007 can be targeted so that it appears only to people who are members of a particular group or audience. You need to have at least Design permission in order to modify the site navigation settings.

  1. On the Web page that contains the site navigation, on the Site Actions menumenu, click Site Settings and then click Modify Navigation.
  2. On the Site Navigation Settings page, click none
  3. In the Navigation Link dialog box, type the title and URL of the link, and then add one or more audience names to the Audiences list.

When the page is rendered, the navigation link appears only to the people who are members of the audiences you specified.

Top of Page Top of Page

Target a Web Part to an audience

Microsoft Office SharePoint Server 2007 Web Parts can be targeted to appear only to people who are members of a particular group or audience.

An audience can be identified by using a SharePoint group, a distribution list, a security group, or a global audience.

  1. On the Web page that contains the Web Part, on the Site Action menu menu, click Edit Page.
  2. On the Web Part, click the Web Part menuWeb Part Edit Menu , and then click Modify Shared Web Part.
  3. Under Advanced, add one or more audience names to the Target Audiences list.

When the page is rendered, the Web Part appears only to the people who are members of the audiences you specified.

Top of Page Top of Page

Tuesday, October 16, 2007

Disable MySite and MyLinks in Sharepoint (MOSS) 2007

Disable MySite and MyLinks in Sharepoint (MOSS) 2007

Okay, this one took me a while to figure out, but nonetheless I found it and will share it.
In order to turn off or disable the MySite or MyLinks functionality you need to be an Sharepoint administrator.

Go to the Central Administration Web PageClick on the link for Shared Services Administration --If you have more than one SSP, select the one that is running the MySites functionalityUnder "User Profiles and My Sites" click Personalization Services Permissions
Select the group you want to limit the functionality for. More than likely you will just have NTAuthority\Authenticated Users.

In the next screen you will see a list of checkboxes,
--To disable MySites uncheck "Create Personal Site"
--To disable MyLinks uncheck "Use Personal Features"

Hopefully this will save you a few cycles.
by Michael Van Cleave.