Adding sections and links to the Site Settings page

Adding groups and links to the Site Settings page can easily be done using a feature. Simply create a feature and add the appropriate XML to the Elements.xml file. Here is an example. This is a great way to provide access to lists that are using for configuration or logging and are generally accessed by site administrators but should be hidden from other users.

<?xml version="1.0" encoding="utf-8"?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
<CustomActionGroup
Id="Configuration"
Location="Microsoft.SharePoint.SiteSettings"
Title="Configuration"
Sequence="100" />
<CustomAction
Id="GeneralConfiguration"
RequireSiteAdministrator="TRUE"
GroupId="Configuration"
Location="Microsoft.SharePoint.SiteSettings"
Sequence="1000"
Title="General Configuration">
<UrlAction Url="Lists/General Configuration/"/>
</CustomAction>
<CustomAction
Id="EmailConfiguration"
RequireSiteAdministrator="TRUE"
GroupId="Configuration"
Location="Microsoft.SharePoint.SiteSettings"
Sequence="1001"
Title="Email Configuration">
<UrlAction Url="Lists/Email Configuration/"/>
</CustomAction>
</Elements>

SharePoint Web Services

SharePoint has several web services available that make it easy to access and manipulate content and configure SharePoint (WSS and MOSS) from external applications. Here is a quick list and general information about each service.

Administration Web Service
Authentication Web Service
Alerts Web Service
Copy Web Service
Document Workspace Web Service
Forms Web Service
Imaging Web Service
List Data Retrieval Web Service
Lists Web Service
  • Purpose:Create and manage SharePoint lists
  • Access: http://<server-url>/_vti_bin/lists.asmx
  • Available To: WSS and MOSS
  • SDK: http://msdn.microsoft.com/en-us/library/lists.aspx
  • Operations: AddAttachment, AddDiscussionBoardItem, AddList, AddListFormFeature, ApplyContentTypeToList, CheckInFile, CheckOutFile, CreateContentType, DeleteAttachment, DeleteContentType, DeleteContentTypeXmlDocument, DeleteList, GetAttachmentCollection, GetList, GetListAndView, GetListCollection, GetListContentType, GetListContentTypes, GetListItemChanges, GetListItemChangesSinceToken, GetListItems, GetVersionCollection, UndoCheckOut, UpdateContentType, UpdateContentTypeXmlDocument, UpdateContentTypesXmlDocument, UpdateList, UpdateListItems
Meetings Web Service
People Web Service
Permissions Web Service
Site Data Web Service
Sites Web Service
Users and Groups Web Service
  • Purpose: Manage SharePoint users and groups
  • Access: http://<server-url>/_vti_bin/usergroup.asmx
  • Available To: WSS and MOSS
  • SDK: http://msdn.microsoft.com/en-us/library/ms772647.aspx
  • Operations: AddGroup, AddGroupToRole, AddRole, AddRoleDef, AddUserCollectionToGroup, AddUserCollectionToRole, AddUserToGroup, GetAllUserCollectionFromWeb, GetGroupCollection, GetGroupCollectionFromRole, GetGroupCollectionFromSite, GetGroupCollectionFromuser, GetGroupCollectionFromWeb, GetGroupInfo, GetRoleCollection, GetRoleCollectionFromGroup, GetRoleCollectionFromUser, GetRoleCollectionFromWeb, GetRoleInfo, GetRolesAndPermissionsForCurrentUser, GetRolesAndPermissionsForSite, GetUserCollection, GetUserCollectionFromGroup, GetUserCollectionFromRole, GetUserCollectionFromSite, GetUserCollectionFromWeb, GetUserInfo, GetUserLoginFromEmail, RemoveGroup, RemoveGroupFromRole, RemoveRole, RemoveUserCollectionFromGroup, RemoveUserCollectionFromRole, RemoveUserCollectionFromSite, RemoveUserFromGroup, RemoveUserFromRole, RemoveUserFromSite, RemoveUserFromWeb, UpdateGroupInfo, UpdateRoleDefInfo, UpdateRoleInfo, UpdateUserInfo
Versions Web Service
Views Web Service
Web Part Pages Web Service
  • Purpose:Manage SharePoint Web Parts
  • Access: http://<server-url>/_vti_bin/webpartpages.asmx
  • Available To: WSS and MOSS
  • SDK: http://msdn.microsoft.com/en-us/library/ms774569.aspx
  • Operations: AddWebPart, AddWebPartToZone, AssociateWorkflowMarkup, ConvertWebPartFormat, DeleteWebPart, ExecuteProxyUpdates, FetchLegalWorkflowActions, GetAssemblyMetaData, GetBindingResourceData, GetCustomControlList, GetDataFromDataSourceControl, GetFormCapabilityFromDataSourceControl, GetSafeAssemblyInfo, GetWebpart, GetWebpart2, GetWebPartCrossPageCompatibililty, GetWebPartPage, GetWebPartPageConnectionInfo, GetWebPartPageDocument, GetWebPartProperties, GetWebPartProperties2, GetXmlDataFromDataSource, RemoveWorkflowAssociation, RenderWebpartForEdit, SaveWebPart, SaveWebPart2, ValidateWorkflowMarkupAndCreateSupportObjects
Webs Web Service
  • Purpose:Manage SharePoint sites and subsites
  • Access: http://<server-url>/_vti_bin/webs.asmx
  • Available To: WSS and MOSS
  • SDK: http://msdn.microsoft.com/en-us/library/webs.aspx
  • Operations: CreateContentType, CustomizeCss, DeleteContentType, GetActivatedFeatures, GetAllSubWebCollection, GetColumns, GetContentType, GetContentTypes, GetCustomizedPageStatus, GetListTemplates, GetWeb, GetWebCollection, RemoveContentTypeXmlDocument, RevertAllFileContentStreams, RevertCss, RevertFileContentStream, UpdateColumns, UpdateContentType, UpdateContentTypeXmlDocument, WebUrlFromPageUrl

How to format a date field in the SPGridView control

Ever use the SPGridView control and have the need to format a date column? It’s actually pretty simple.

 

BoundField field1 = new BoundField();
field1.HeaderText = “Date Field”;
field1.DataField = “DateField”;
field1.HtmlEncode = true;
field1.DataFormatString = @”{0:M/dd/yyyy}”;
_ResultsGridView.Columns.Add(field1);

The key is to set HtmlEncode to true and set the DataFormatString with the appropriate date format.

 

About the SharePoint !New icon

How long does the “New” image appear next to new list items?

2 days is the default

How do I change the number of days that the “New” icon is displayed?

This value can be changed per web application through the stsadm tool.

stsadm -o setproperty -propertyname days-to-show-new-icon -propertyvalue <Number of days> [-url <http://servername>%5D

You can use -pn instead of -propertyname and -pv instead of -propertyvalue

To set the number of days to 7 days you would use the following:

stsadm -o setproperty -pn days-to-show-new-icon -pv 7 -url http://servername

How do I check the number of days that the “New” icon is currently set to display?

This can also be checked through the stsadm tool.

stsadm -o getproperty -pn days-to-show-new-icon -url http://servername

An easy way to browse SharePoint images

When you need images for dashboards or other SharePoint projects, it can be time consuming to find the right images. SharePoint comes with thousands of images all located in the 12 hive in the /layouts/images directory.

Peter Allen at Bits of SharePoint has created an organized listing of these SharePoint Layout Images that include a  thumbnail and filename. This makes finding the right image much easier. Thanks Peter!

Field Grouping with SPGridView – More than one group returned for a single value

It is very easy to group by a field using the SharePoint SPGridView control. Just set some properties and your good to go.

resultsGridView.GroupField = “Status”;
resultsGridView.GroupFieldDisplayName = “Status”;
resultsGridView.GroupDescriptionField = “Description”;
resultsGridView.AllGroupCollapse = true;
resultsGridView.DisplayGroupFieldName = false;

However, depending on how your results are sorted, you may see that you get multiple groups for a single value. The way to fix this is to sort by the same field you are grouping by.

In this first example, I am grouping by “Status” and sorting only by “DueDate”

SPSiteDataQuery Group Error

In this example, I am still grouping by “Status” but now I am first sorting by “Status” and then by “Due Date”

SPSiteDataQuery Group No Error

You may not notice this issue right away. It all depends on the value of your results and how they are sorted.  So while it may work right off the bat, later on the issue may pop up!

SharePoint Solution Installer – Make deployments look professional

SharePoint Solution Installer is a CodePlex product that makes it easy to deploy SharePoint Solutions (.WSP files). With a simple update to the config file you can customize the way the solutions are deployed. When ready to install, double-click the Setup.exe file and the installer will walk you through the deployment of your .WSP. After some system checks it will give you a choice to do an install if this is a new deployment, or an upgrade/uninstall if the solution already exists in the environment.

It’s a simple way to save some time and also give SharePoint Solution deployments a more professional feel.

SolutionInstaller

http://www.codeplex.com/sharepointinstaller