Thursday, March 15, 2012

Error when Activating the SharePoint Server Publishing Infrastructure feature

SharePoint Server Publishing Infrastructure:

The error is:

Error

Column Limit Exceeded.

There are too many columns of the specified data type. Please delete some other columns first. Note that some column types like numbers and currency use the same data type.

SOLUTION:
The problem was that sharepoint had somehow multiplied the fields "JobId", "ItemUrl" and "ItemType" so that it was not possible to add those fields in the process of activating the publishing feature. The Solution for me was to delete all those fields from the quick deploy items list since you cannot delete the list itself by default.
http://qaportal/Quick%20Deploy%20Items/AllItems.aspx

Link to Article

Monday, March 12, 2012

Enabling anonymous access in SharePoint 2007

Go to Central Admin:
  • In the Central Administration site select “Application Management” either in the Quick Launch or across the top tabs
  • Select “Authentication Providers” in the “Application Security” section
  • Click on the “Default” zone (or whatever zone you want to enable anonymous access for)
  • Under “Anonymous Access” click the check box to enable it and click “Save”
NOTE: Make sure the “Web Application” in the menu at the top right is your portal/site and not the admin site.

Now the second part is to enable anonymous access in the site.
  • Return to your sites home page and navigate to the site settings page. In MOSS, this is under Site ActionsSite SettingsModify All Site Settings. In WSS it’s under Site ActionsSite Settings.
  • Under the “Users and Permissions” section click on “Advanced permissions”
  • On the “Settings” drop down menu (on the toolbar) select “Anonymous Access”
  • Select the option you want anonymous users to have (full access or documents and lists only)
Now users without logging in will get whatever option you allowed them.

Friday, March 9, 2012

Changed Name in AD not syncing with SharePoint

Problem: Profile synchronization was not running between MOSS and WSS for a specific web application.
Solution: Even though the profile imports were running, the SharePoint profiles had a person's old display name instead of their AD display name. The following is from MS support:
1) Stsadm –o sync –listolddatabases 0
2) Stsadm –o sync –deleteolddatabases 0
3) Stsadm –o sync –synctiming m:1
4) Stsadm –o sync –sweeptiming m:1
5) Stsadm –o sync –excludewebapps “”
The last command was the one that reset the profile synchronization so all web apps were again included.

Quick and dirty “User Information List” permissions

In an attempt to make a quick and pretty company contact information list I found that I am very lazy.. well i knew that from the start and it was nothing new to me, but I did find that making the contact information list was a lot easier than I initially tried.
After suffering with creating a SQL View that summarises data from our local AD server using LDAP and reading that data with a BCS and linking it to a list I thought.. Hmmm.. there must a be an easier way..
And there is:
1. Enter User List (assuming you have User Profile Sync working) http://<your_sp_server>/_catalogs/users
You will only be able to access this site if you are logged in as System Admin.
2. Now create your favourite view for your awesome list

Now you got a nice new view, so pretty, check your columns and filters to make sure the users will only see what you want them to see as this list will show all user details including SharePoint groups and everything.
3. Allow your users to see this list. They can’t, well right at this moment at least they can’t. We are going the change that aren’t we, yes we are, such a good SharePoint, who’s a good SharePoint.. oh yes you are, yes you are… Anyway, here comes the trick:
Select your view and open the “Modify this View” option, why did we do this? Because there is no way to edit the list using “List Settings” or using SPD.. so we are going to find the list GUID for this list, the easiest is to copy it from the URL when modifying the view:
http://<your_sp_site>/_layouts/ViewEdit.aspx?List=%7BBA10D037%2D6A45%2D41C0%2D9727%2DE451C0707370%7D&View=%7B6E5E169F%2DC4C1%2D4784%2DB85A%2D8CB1422179A7%7D&Source=xxxxx
Easy isn’t it, now edit your normal “List Settings” URL like this:
http://<your_sp_site>/_layouts/listedit.aspx?List=%7BBA10D037%2D6A45%2D41C0%2D9727%2DE451C0707370%7D
Now when you follow the link and you will get the list settings for the user info list, be careful here, please. I assume you know what you are doing so do not hold me liable for fiddling with stuff you shouldn’t be fiddling with mmkay.
4. Edit permissions to allow Read rights for authenticated users, or similar groups, I am using our “All Users” group from AD, which works like a charm.
Nice isn’t it, this should render you a pretty view for everyone in your AD Sync, so you only need to make sure your AD is up to date, or you can allow users to update their own information using the User Profile Sync services.
Some more reading:
http://www.aiim.org/community/blogs/expert/User-Profile-List-in-SharePoint-2010



Custom Styles for SharePoint 2010 Rich Html Field

A typical requirement from a client is to be able to incorporate their own custom styles for the Rich Html Field. Allowing their public relations department to apply nice text formating for paragraphs with some Comic Sans Hotness might not be the best practice in here, so let’s be careful out there. The best scenario is only to allow custom formatting for headings, paragraphs and maybe a few different table styles but let’s go!
First, open up the page layout containing the HTML editor and add PrefixStyleSheet property for the RichHtmlField:
<PublishingWebControls:RichHtmlField
    id="Content"
    FieldName="PublishingPageContent"
    PrefixStyleSheet="my-rte"
    runat="server"
/>
Now, the default value for the property is ms-rte. We are going to redefine this to my-rte. Do not use any uppercase characters in the property value as apparently those wont work. Deploy the page and open it in edit mode to see the desired effect. The styles collections are now empty in the Ribbon.
We now have to define our own styles prefixed with the string my-rte. I’d suggest that you put these style declarations in a separate stylesheet to avoid javascript errors caused by complicated and hard-to-parse stylesheets. Let’s name our new stylesheet rte.css and add a few declarations there.

The Markup Collection

Let’s say I want to have an option to add a level 1 heading or an H1 tag for the given page via the Markup Styles dropdown list:
Step 1 – introduce the tag:
H1.my-rteElement-H1
{
  -ms-name:"my level 1 heading";
}
Step 2 – add the styles to the tag:
.my-rteElement-H1
{
    font-size: 150%;
}
Save the rte.css and make a reference for it in your master page, page layout or even use an alernative css. If you want your clients to be able to edit the styles themself, you could upload the rte.css in the Style Library and reference it there.
I have saved the file directly in the 14-hive /_layouts/my/ -folder and use a quick reference in the master page:
<SharePoint:CssRegistration
    ID="CssRegistration1"
    runat="server"
    Name="/_layouts/my/rte.css"
/>
Deploy and reload the page, fire up the edit mode and navigate to the ribbon where you can see your new style in action.


Adding new elements is easy once you get to know the logic. Here’s an example of a parapgraph with nice rounded corners and superb font on modern browsers (note that I have combined the introduction and style values in one declaration):
P.my-rteElement-P
{
    -ms-name:"My CSS Rounded Paragraph";
    background: #808;
    color: #fff;
    border: 3px solid #f0f;
    text-transform: uppercase;
    text-align: center;
    -webkit-border-radius: 10px;
    -moz-border-radius: 10px;
    border-radius: 10px;
    box-shadow: 0 0 20px #000;
    -moz-box-shadow: 0 0 20px #000;
    -webkit-box-shadow: 0 0 20px #000;
    padding: 10px;
    font: bold 2em Comic Sans MS;
}

The Styles Collection

The Styles collection can be populated with the same way by changing the Element-suffix into Style ie.:
.my-rteStyle-MePinky
{
  -ms-name:"I am pink";
  color: #f0f;
}