Thinking out Aloud

Dave Hunter's SharePoint Blog

Strange behaviour when clicking the type icon selects the row instead of opening PDF

leave a comment »

The tale end of last year I came across this issue when prototyping a system.  I had a clean build of SharePoint 2010 with SP1, just using a standard team site.  I uploaded some pdfs and was about to demostrate opening PDFs from the document library and the link failed to work.

Clicking the icon in Type column is highlighting the item instead of launching the document

Clicking the icon in Type column is highlighting the item instead of launching the document

After some research I found this KB article

SharePoint 2010: Clicking the icon in Type column is highlighting the item instead of launching the document http://support.microsoft.com/kb/2457975

The article describes the problem and a fix to add a file called “fldtypes_docicon.xsl” into C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\template\layouts\XSL.  Content of the file is detailed in the KB article.

I deployed the file which resolved the issue … was glad I only had two servers in the environment (have to manually copy the file to the servers).

Written by Dave Hunter

20 Jan 2012 at 12:38 PM

Posted in SharePoint 2010

Tagged with ,

SharePoint Virtual Labs

leave a comment »

You can learn a lot from blogs, articles, books but I find actually ‘doing’ something is the best way to learn, that’s where the Virtual Labs come in.

SharePoint 2010

SharePoint 2007

Written by Dave Hunter

17 Aug 2011 at 3:07 PM

Welcome

leave a comment »

I’m moving my blog to the word press platform, not any reflection on SharePoint as a blogging platform just to keep the hosting costs down.  I will look to provide some URL redirection or a landing page if possible for existing links to my published articles.

Written by Dave Hunter

01 Aug 2011 at 4:09 PM

Posted in Uncategorized

Programmatically create SharePoint security groups using configuration

leave a comment »

Corey Roth has a great article “A simple way to programmatically create SharePoint security groups“.  On a recent project I needed to configure security during feature activation for security restricted WebParts (the WebParts checked the current user was a member of a particular security group) but didn’t want to hardcode the values.  The article used a XML configuration to define which groups needed creating and the membership.

SharePoint supports setting the owner of a SharePoint group to be an individual user or another security group, I extended the code to support this and to set the flags which control members editing membership, request to join or leave and auto accept request to join or leave.  Here’s the updated version of CreateGroups.
private void CreateGroups(SPWeb currentSite, string groupsConfigBody)
{
            // get the xml document from the feature folder
XDocument groupsXml = XDocument.Parse(groupsConfigBody);
            // create a new anoynmous type with the group data
var groups = from sharePointGroup in groupsXml.Root.Elements(“Group”)
select new
{
                             Name = sharePointGroup.Attribute(“Name”).Value,
Owner = sharePointGroup.Attributes(“Owner”).Any() ? sharePointGroup.Attribute(“Owner”).Value : null,
Description = sharePointGroup.Attributes(“Description”).Any() ? sharePointGroup.Attribute(“Description”).Value : string.Empty,
PermissionLevel = sharePointGroup.Attributes(“PermissionLevel”).Any() ? sharePointGroup.Attribute(“PermissionLevel”).Value : null,
Users = sharePointGroup.Elements(“User”).Any() ? sharePointGroup.Elements(“User”) : null,
AllowMembersEditMembership = sharePointGroup.Attributes(“AllowMembersEditMembership”).Any() ? Convert.ToBoolean(sharePointGroup.Attribute(“AllowMembersEditMembership”).Value) : false,
AllowRequestToJoinLeave = sharePointGroup.Attributes(“AllowRequestToJoinLeave”).Any() ? Convert.ToBoolean(sharePointGroup.Attribute(“AllowRequestToJoinLeave”).Value) : false,
AutoAcceptRequestToJoinLeave = sharePointGroup.Attributes(“AutoAcceptRequestToJoinLeave”).Any() ? Convert.ToBoolean(sharePointGroup.Attribute(“AutoAcceptRequestToJoinLeave”).Value) : false
};
            // iterate through the groups and create the groups
foreach (var sharePointGroup in groups)
{
// only create the group if it does not exist
if (!ContainsGroup(currentSite.SiteGroups, sharePointGroup.Name))
{
// add the owner to the web site users
if (sharePointGroup.Owner.IndexOf(@”\”) > -1)
{
SPUser owner = currentSite.EnsureUser(sharePointGroup.Owner);
currentSite.SiteGroups.Add(sharePointGroup.Name, owner, owner, sharePointGroup.Description);
}
else
{
SPMember owner = currentSite.SiteGroups[sharePointGroup.Owner];
currentSite.SiteGroups.Add(sharePointGroup.Name, owner, currentSite.CurrentUser, sharePointGroup.Description);
}
                    SetRoleDefinitionBinding(sharePointGroup.Name, currentSite, sharePointGroup.PermissionLevel);
                    if (sharePointGroup.AllowMembersEditMembership || sharePointGroup.AllowRequestToJoinLeave || sharePointGroup.AutoAcceptRequestToJoinLeave)
{
SPGroup group = currentSite.SiteGroups[sharePointGroup.Name];
if (sharePointGroup.AllowMembersEditMembership)
group.AllowMembersEditMembership = true;
                        if (sharePointGroup.AllowRequestToJoinLeave)
group.AllowRequestToJoinLeave = true;
                        if (sharePointGroup.AutoAcceptRequestToJoinLeave)
group.AutoAcceptRequestToJoinLeave = true;
                        group.Update();
}
}
                // add the users to the group
AddUsersToGroup(sharePointGroup.Name, sharePointGroup.Users, currentSite);
            }
        }
and the XML configuration
<?xml version=”1.0″ encoding=”utf-8″ ?>
<Groups>
<Group Name=”Admins” Owner=”domain\dave” AllowMembersEditMembership=”true” Description=”Set of admin users who control membership of the Bulk Processing group” PermissionLevel=”Read”>
<User Name=”domain\dave” />
</Group>
<Group Name=”My Security Group” Owner=”Admins” Description=”description goes here” PermissionLevel=”Read”>
<User Name=”domain\dave” />
</Group>
</Groups>

Written by Dave Hunter

07 Jul 2011 at 3:51 PM

SharePoint MVP Chat – Wednesday 22nd June 2011

leave a comment »

 Microsoft are hosting another online Q/A chat with MVPs on 22/06/2011 at 9-10AM PDT ​Pacific Time or 5-6PM GMT.  For the full schedule please see

http://sharepoint.microsoft.com/blog/Pages/BlogPost.aspx?pID=982

 

 

Written by Dave Hunter

20 Jun 2011 at 4:00 PM

Posted in SharePoint

Tip: STSADM Exporting 17KB File

leave a comment »

When exporting a site in SharePoint 2007 using STSADM, you may get a .CMP file 17KB in size. This will be because the user who is running STSADM doesn’t have access to the site. If you give the user permissions to the site, you will export the site successfully.

Always run STSADM as a user with a site collection owner rights on the target site.

Written by Dave Hunter

12 Jun 2011 at 6:40 PM

Posted in SharePoint 2007

Monthly Book Review

leave a comment »

I’m currently commuting to London daily, so to pass the time of the daily commute I’m going to read a book.  I’m hoping to get through a book a month and write a review at the end of the month.  They will of course be SharePoint 2010 books or maybe the odd business focussed one to mix it up a bit.

I’m starting with “Designing Solutions for Microsoft SharePoint 2010″ O’Reilly publication.

There’s online resources for the book available here http://msdn.microsoft.com/en-us/library/ff770300.aspx.  I’m hoping the book will add value instead of being a published form of the MSDN web content.  I will post a full review at the end of the month.

Written by Dave Hunter

09 May 2011 at 12:45 PM

Posted in Uncategorized

MSDN Online Chats

leave a comment »

Microsoft are hosting monthly online Q/A chats with MVPs.  The next one is 20/04/2011 at 9-10AM PDT ​Pacific Time or 5-6PM GMT.  For the full schedule please see http://msdn.microsoft.com/en-us/events/aa497438.aspx

Written by Dave Hunter

18 Apr 2011 at 12:30 PM

Posted in Uncategorized

SharePoint MVP Renewed for 2011

leave a comment »

I’m proud to announce that I have been awarded a Microsoft Most Valuable Professional (MVP) for 2011.  I’m honoured to have received the award for the second year running.

“Congratulations! We are pleased to present you with the 2011 Microsoft® MVP Award! This award is given to exceptional technical community leaders who actively share their high quality, real world expertise with others. We appreciate your outstanding contributions in SharePoint Services technical communities during the past year”

I hope to ramp up my efforts in the community and help individuals with their SharePoint experience.

 

Written by Dave Hunter

01 Apr 2011 at 10:05 PM

Posted in Uncategorized

New Content on the Microsoft Download Center – Jan 2011

leave a comment »

Microsoft have published the following guides and whitepapers on the Microsoft Download Center.  Worth a look …

 

Written by Dave Hunter

12 Jan 2011 at 2:20 PM

Posted in Uncategorized

Follow

Get every new post delivered to your Inbox.