Author Archives: kamilmka

Check Current User Permissions…

I had a requirement to security trim some functionality in SharePoint to some user roles. Basically I wanted to display some controls / options in the Ribbon control to the users if they have “Design” permission level.

One thing to understand here is, SharePoint Security Groups has a group named, Designer. Checking is the current user in the Designer group will not be accurate. Because there can be new groups get created with the same permission set but with a different name. Also SharePoint allows you to add direct permission to users. (Not adding to a Group but directly give required permissions to the user itself).
Read more »

Display Document Type Icon in a DVWP

I had a requirement to display document icons inside a Data View Web Part. While googling I found some interesting information on this document types and there icons.

SharePoint has a pre populated list of document types along with respective images that maps to it. This document type to document icon image mapping can be found inside the file DOCICON.XML which can be located in the following location  C:Program FilesCommon FilesMicrosoft SharedWeb Server Extensions14TEMPLATEXML
Read more »

Recursive Data View Web Part…

Recently I had to give a hand to one of my friend to create a recursive DVWP. What this web part should do is to query all the sub sites including the root site, and retrieve all the Pages resides inside the Pages libraries. Also it should filter the retrieved pages for a given content type. Previously I had done whole lot of DVWP, but never wanted to create a recursive DVWP.

So how to achieve this,
Read more »

Feature Stapling…

What is feature stapling?

While doing SharePoint development, almost all cases I used to create my own Site Definitions. So what ever features to be activated, page instance to be created, was very easily defined in the onet.xml. But once I had a requirement to use a OOB site definition for one of my project. But when I create a site using the given OOB template I had to activate some OOB features also. To achieve that requirement I had to copy the existing site definition and create my own one, with the above feature activated by default. But that was not the best solution for the problem. Actually it was a worse solution ever Smile.

So while searching through internet, I found there is a cool built-in feature in SharePoint to do this. It’s called almighty “Feature Stapling”.
Read more »

Create SharePoint page instance from a Feature…

Hi all,

Ever needed to create bunch of SharePoint pages with some  content embedded on it? (About us page with some static content inside a rich text field, Contact us page, with a web part embedded on the page?)

I had a requirement like that for a particular project. I had to create a page instance to hold a custom web part, that was created to get user feedback. Also this page instance should be instantiated with a separate feature. So how to handle this requirement.
Read more »

Is my SharePoint web page in Edit Mode????

Hi all,

Recently I developed a custom web part, to get some user feedback. The web part contain some validators (required field validators) and some of my custom web part properties (A property to get a SharePoint list URL). After completing the web part I embed it on a page. While testing the web part, i noticed when I go edit web part properties, and try to save my changes by pressing OK, or Apply button, it trigged all my validators.
Read more »

Recent Entries »