I've created a custom type and I would like to have a custom administration sight where a few global settings can be defined. I've done a bit of looking around but haven't found anything that shows how to do this. Can this be done in SharePoint 2010?
I guess it depends on how 'global' you really want to scope your global settings. I tend to think that a good boundary for your situation would be the web application.
In that case, you could store your settings in the SPWebApplication property bag.
From your global settings page, you would set the values, something like this
//get a handle on the web application somehow SPWebApplication webApp = webAppSelectorControl.WebApplication; webApp.Properties["CustomGlobalSetting"] = "CustomGlobalValue"; webApp.Update();
You'll need appropriate rights in order to set the values, but anyone should be able to read them ok
string customSetting = (string)SPContext.Current.Site .WebApplication.Properties["CustomGlobalSetting"];
From global settings, I understand the settings should be applied to all the instances of custom field type across site collection, web application or farm.
For Site Collection level : You can keep the settings for custom field type in a list.You can retrieve these settings by reading the list in code behind. Also, You can fine tune permissions on a list ( and list items), so you can manage rights who can edit the settings individually.
For Web application level or Farm level : You can define those settings in a XML file and keep it at 14\TEMPLATE\LAYOUTS folder.You can build a custom administration page which can edit\save the xml file. Many third party(KwizCom, Telerik) custom field type settings are stored this way.
If you want field settings at instance level(when you create\edit the field), you can define custom properties for it and render it on New Site Column, Change Site Column, Create Column, and Change Column pages.This link discuss about two methods to do it and how to choose correct one:
I would prefer the solution of Paul Lucas because if you place the settings in the property bags, they get stored in your content database. Especially if you have multiple frontend servers this is mutch easier to handle... they are available on each server.
They are also easier to retrieve than in the "list solution".
Besides the webapplication you can store properties on SPSite or SPWeb level.
Using CustomActions you can also add a link to your configuration page in the site settings.