SharePoint – Autocomplete followup, New view and Edit view

I wrote this post about autocomplete in the advanced search box.

There’s another place where this would come in handy, the “Create new view” page and “Edit view” page.

Now, if you use the JavaScript from the previous post you can simply just add this JavaScript to your document ready and get suggested results in you create and edit view pages as well.

This will help the user to create more efficient views because they don’t have to check which metadata is available.

As you can see, this will work where ever you want as long as you set the currentTextBox and get the propertyValue.

(more…)

SharePoint – Advanced search box autocomplete preoperty restrictions

When adding properties to the Advanced search web part you are bound to know exactly which metadata is included and how it’s spelled. This could be frustrating.

For some reason MS has decided not to help us spell like every other search component would do nowadays.

Consider you have 3 different metadata tags which is all choice or lookup fields. Now, you might want to autocomplete those fields in the Advanced search property restrictions to make sure that the spelling is correct or just to show the users which choices they have.

I implemented this with jQuery-UI which has jQuery-autocomplete included. I also decided to do all the gets by using the SharePoint client OM.

I will not tell you how to define your metadata properties in the search service or how to make them appear in the Advanced search webpart, you can google that :)

(more…)

SharePoint – Create unique permissions on document check in

If you have a metadata-oriented structure in you document libraries, you might want to use unique permissions for each document.
This is NOT a good choice if you use folders. It will create a huge permissions matrix.

I have implemented this at my customer and I haven’t noticed any noticeable performance issues.

Let’s say you create a choice field called “Security class” with 4 choices, “Base, low, medium, high” and you want this to control the permissions for the current document.

  • Base – Base permission, keep inheritance, every one can contribute. <– Default value for the field.
  • Low – Everyone can read, members can contribute, owners and created by has full control.
  • Medium – Members can read, no contributors, owners and created by has full control.
  • High – No readers, no contributors, Owners and created by has full control.

So basically, in your editform.aspx you have a drop-down with these 4 options.

SecurityclassField

Implementation

First, create a class that will handle the permissions.

(more…)