When working with SPSiteDataQuery keep in mind that all DateTime results are being returned either in current user profile regional settings timezone, or under root web regional settings timezone, depending on the settings. It will ignore all the sub web regional settings.
Wednesday, January 9, 2013
Friday, April 22, 2011
How to use MOSS Publishing EditingMenuActions
Let’s say you want to use any of the Microsoft provided Publishing EditingMenuActions. There are a few dozens of them.
For example, you want to save page and switch it to the view mode. If you try something like the following – it will fail:
SwitchToPublishedModeAction action = new SwitchToPublishedModeAction(); action.RaisePostBackEvent("switchToPublished");
You have to specifically assign the Page for the action. The following code will work:
SwitchToPublishedModeAction action = new SwitchToPublishedModeAction(); action.Page = this.Page; action.RaisePostBackEvent("switchToPublished");
Any ConsoleAction is essentially a WebControl. It should either be placed on the page itself, and then referenced in your code, or you can just set its Page property.
Here is the list of actions accessible from Microsoft.SharePoint.Publishing.WebControls.EditingMenuActions namespace:
- public sealed class ApproveAction : BaseApproveAction
- public sealed class ApproveOrDeclineAction : ConsoleAction
- public abstract class BaseApproveAction : ConsoleAction
- public abstract class BaseDeclineAction : ConsoleAction
- public sealed class BrowseWebPartsAction : ConsoleAction
- public sealed class CancelApprovalRequestAction : ConsoleAction
- public sealed class CancelApprovalWorkflowRequestAction : ConsoleAction
- public sealed class CancelSchedulingAction : ConsoleAction
- public sealed class CheckInAction : ConsoleAction
- public sealed class CheckInWithCommentAction : ConsoleAction
- public sealed class CheckOutAction : ConsoleAction
- public sealed class CheckOutOverrideAction : ConsoleAction
- public sealed class CopyAction : ConsoleAction
- public sealed class CreateNewPublishingPageAction : ConsoleAction
- public sealed class CreateNewSiteAction : ConsoleAction
- public sealed class CreateNewsLinkAction : ConsoleAction
- public sealed class CreatePageVariationAction : ConsoleAction
- public sealed class CreateSiteVariationAction : ConsoleAction
- public sealed class DeclineAction : BaseDeclineAction
- public sealed class DeleteAction : ConsoleAction
- public sealed class EditListItemPropertiesAction : ConsoleAction
- public sealed class EditPropertiesAction : ConsoleAction
- public sealed class ExitMenuAction : ConsoleAction
- public sealed class ExitWithoutSavingAction : ConsoleAction
- public sealed class ForceSavePublishingPageAction : ConsoleAction
- public sealed class ImportWebPartsAction : ConsoleAction
- public sealed class ManageSiteAction : ConsoleAction
- public sealed class ModifyNavigationAction : ConsoleAction
- public sealed class ModifyPagesLibrarySettingsAction : ConsoleAction
- public sealed class ModifyWebPartsNode : ConsoleNode
- public sealed class MoveAction : ConsoleAction
- public sealed class OneClickPublishAction : ConsoleAction
- public sealed class PersonalViewAction : ConsoleAction
- public sealed class PreviewAction : ConsoleAction
- public sealed class PreviewExistingPublishingPageAction : ConsoleAction
- public sealed class PublishAction : ConsoleAction
- public sealed class PublishWithCommentAction : ConsoleAction
- public sealed class QuickDeployAction : ConsoleAction
- public sealed class ReportsNode : ConsoleNode
- public sealed class ReviewPublishingPageAction : ConsoleAction
- public sealed class RevisionHistoryAction : ConsoleAction
- public sealed class SavePublishingPageAction : ConsoleAction
- public sealed class SearchWebPartsAction : ConsoleAction
- public sealed class SharedViewAction : ConsoleAction
- public sealed class ShowUnapprovedResourcesAction : ConsoleAction
- public sealed class SiteDirectoryBrokenLinksCheckerAction : ConsoleAction
- public sealed class SiteSettingsAction : ConsoleAction
- public sealed class SpellCheckEntirePageAction : ConsoleAction
- public sealed class SwitchToAuthoringModeAction : ConsoleAction
- public sealed class SwitchToPublishedModeAction : ConsoleAction
- public sealed class UndoCheckOutAction : ConsoleAction
- public sealed class UnpublishAction : ConsoleAction
- public sealed class UpdateVariationsAction : ConsoleAction
- public sealed class VersionDifferenceAction : ConsoleAction
- public sealed class VersionInfoAction : ConsoleAction
- public sealed class ViewAllSiteContentAction : ConsoleAction
- public sealed class ViewRecycleBinAction : ConsoleAction
- public sealed class WorkflowApproveAction : BaseApproveAction
- public sealed class WorkflowDeclineAction : BaseDeclineAction
- public sealed class WorkflowStartAction : ConsoleAction
- public sealed class WorkflowStatusAction : ConsoleAction
- public sealed class WorkflowTasksAction : ConsoleAction
Wednesday, March 2, 2011
Enabling WCF support in SharePoint 2007 on Windows 2008 R2 IIS7
Installing SharePoint 2007 on Windows Server 2008 R2 sets SharePoint IIS application pools to Classic mode. In context of WCF this means that you have to manually configure WCF support in Web Applications web.configs. Otherwise you will get 404 errors trying to access any .svc files in your application.
In order to enable WCF support to SharePoint 2007 installed on Windows Server 2008 R2 with IIS 7.5, you have to put the following records to the web.config:
<system.webServer> <handlers> <add name="svc-ISAPI-2.0" path="*.svc" verb="*" modules="IsapiModule" scriptProcessor="%SystemRoot%\Microsoft.NET\Framework\v2.0.50727\aspnet_isapi.dll" preCondition="classicMode,runtimeVersionv2.0,bitness32" /> <add name="svc-ISAPI-2.0-64" path="*.svc" verb="*" modules="IsapiModule" scriptProcessor="%SystemRoot%\Microsoft.NET\Framework\v2.0.50727\aspnet_isapi.dll" preCondition="classicMode,runtimeVersionv2.0,bitness64" /> </handlers> </system.webServer>
P.S.: It is probably the case with any web application runing in classic mode in IIS7.
Wednesday, March 17, 2010
Excel Services, ODC and Microsoft.ACE.OLEDB.14.0
Please check latest updates at the end of the article.
In my previous post I was talking about new 2010 Office Data Connectivity Components, or Microsoft.ACE.OLEDB.14.0. I have a small sample there how to programmatically access SharePoint 2007 data using this component. While this approach works great when you are building any custom solution, there is also a way to use these components without any coding at all.
Microsoft.ACE.OLEDB.14.0 can be used in Excel Services, working around its limitation on SharePoint data sources. For instance this could be used to create Excel Charts and Pivot tables, based on SharePoint data source.
This solution tested on SharePoint 2007 Server (MOSS) and Microsoft Office 2007.
Prerequisites:
- You will need 2010 Office Data Connectivity Components installed on your SharePoint 2007 / Excel Services machine.
- Do not forget to go to Central Admin -> Shared Services -> Trusted Data Providers -> add it up there as Provider ID = "Microsoft.ACE.OLEDB.12.0" and Provider Type = "OLE DB".
- You need to have Excel Services Trusted Location (defined in Central Admin)
We can't use Microsoft.ACE.OLEDB.14.0 directly from Excel, data connection wizard will fail to create Data Link. But we still can create our own Office Data Connection (ODC) file.
Instead of "Provider=Microsoft.ACE.OLEDB.14.0" we have to use "Provider=Microsoft.ACE.OLEDB.12.0". It's a bug and would be probably fixed in release.
Here is the source XML for the sample ODC file. Copy it to your favorite text editor and change <odc:ConnectionString>:
- User ID - not relevant
- Data Source - url to your SharePoint site
- DATABASE - url to your SharePoint site
- LIST - List Title (not Name) or List GUID
- There is no need to change [List] in <odc:CommandText> - it will load data from the list, referenced in LIST anyway
<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns="http://www.w3.org/TR/REC-html40"> <head> <meta http-equiv=Content-Type content="text/x-ms-odc; charset=utf-8"> <meta name=ProgId content=ODC.Table> <meta name=SourceType content=OLEDB> <title>(Default)</title> <xml id=docprops><o:DocumentProperties xmlns:o="urn:schemas-microsoft-com:office:office" xmlns="http://www.w3.org/TR/REC-html40"> <o:Name>(Default)</o:Name> </o:DocumentProperties> </xml><xml id=msodc><odc:OfficeDataConnection xmlns:odc="urn:schemas-microsoft-com:office:odc" xmlns="http://www.w3.org/TR/REC-html40"> <odc:Connection odc:Type="OLEDB"> <odc:ConnectionString>Provider=Microsoft.ACE.OLEDB.12.0;User ID=Admin;Data Source=http://moss.sharepointalist.com/SiteDirectory/ACETest;Mode=Share Deny None;Extended Properties="WSS;HDR=No;IMEX=0;DATABASE=http://moss.sharepointalist.com/SiteDirectory/ACETest;LIST=List Title;RetrieveIDs=Yes";Jet OLEDB:System database="";Jet OLEDB:Registry Path="";Jet OLEDB:Engine Type=0;Jet OLEDB:Database Locking Mode=0;Jet OLEDB:Global Partial Bulk Ops=2;Jet OLEDB:Global Bulk Transactions=1;Jet OLEDB:New Database Password="";Jet OLEDB:Create System Database=False;Jet OLEDB:Encrypt Database=False;Jet OLEDB:Don't Copy Locale on Compact=False;Jet OLEDB:Compact Without Replica Repair=False;Jet OLEDB:SFP=False;Jet OLEDB:Support Complex Data=False</odc:ConnectionString> <odc:CommandType>SQL</odc:CommandType> <odc:CommandText>SELECT * FROM [List]</odc:CommandText> <odc:AlwaysUseConnectionFile/> </odc:Connection> </odc:OfficeDataConnection> </xml> <style> <!-- .ODCDataSource { behavior: url(dataconn.htc); } --> </style> </head> <body onload='init()' scroll=no leftmargin=0 topmargin=0 rightmargin=0 style='border: 0px'> <table style='border: solid 1px threedface; height: 100%; width: 100%' cellpadding=0 cellspacing=0 width='100%'> <tr> <td id=tdName style='font-family:arial; font-size:medium; padding: 3px; background-color: threedface'> </td> <td id=tdTableDropdown style='padding: 3px; background-color: threedface; vertical-align: top; padding-bottom: 3px'> </td> </tr> <tr> <td id=tdDesc colspan='2' style='border-bottom: 1px threedshadow solid; font-family: Arial; font-size: 1pt; padding: 2px; background-color: threedface'> </td> </tr> <tr> <td colspan='2' style='height: 100%; padding-bottom: 4px; border-top: 1px threedhighlight solid;'> <div id='pt' style='height: 100%' class='ODCDataSource'></div> </td> </tr> </table> <script language='javascript'> function init() { var sName, sDescription; var i, j; try { sName = unescape(location.href) i = sName.lastIndexOf(".") if (i>=0) { sName = sName.substring(1, i); } i = sName.lastIndexOf("/") if (i>=0) { sName = sName.substring(i+1, sName.length); } document.title = sName; document.getElementById("tdName").innerText = sName; sDescription = document.getElementById("docprops").innerHTML; i = sDescription.indexOf("escription>") if (i>=0) { j = sDescription.indexOf("escription>", i + 11); } if (i>=0 && j >= 0) { j = sDescription.lastIndexOf("</", j); if (j>=0) { sDescription = sDescription.substring(i+11, j); if (sDescription != "") { document.getElementById("tdDesc").style.fontSize="x-small"; document.getElementById("tdDesc").innerHTML = sDescription; } } } } catch(e) { } } </script> </body> </html>
- Save file with .odc extension and try opening it in Microsoft Excel. If everything is right, you should get your data loaded in Excel.
- Save your .odc file in Data Connection Library in SharePoint 2007 (MOSS). Approve it, or ask owner of the site (administrator) to approve it. It will still work for you without the approval, but not for the other users.
- Create a new Excel Workbook, under Insert tab select PivotChart (or PivotTable).
- In the "Create PivotTable with PivotChart" dialog select "Use an external data source" and click on "Choose connection button".
- Click "Browse for more" and navigate to your .odc file in SharePoint Data Connection Library.
- Build up your Pivot Chart or Pivot Table.
- When you are done, click on Office Button and select Publish -> Excel Services.
- Browse to your target SharePoint document library.
- Click "Excel Services Options" button and select what items do you want to publish using Excel Services.
- Save the file. Now you should be able to access your pivot table or pivot chart using Excel Web Access Web Part. That charts/table are totally dynamic and will show your updated data when refreshed.
Update (05/07/2010):
After some additional research and help from Ivan Huter looks like described method works with standalone MOSS installation only. You will have to configure Kerberos Authentification in order to make it working in a farm. Unfortunately I do not have time right now to test Kerberos option, but I will post an update when I get a chance.
Let me know if you have any questions or notes.
Friday, February 12, 2010
2010 Office Data Connectivity Components
Recently I was creating SharePoint Designer Workflow Activity to import data from Excel. Traditionally I used OLEDB to do that, but my target platform was 64bit and I could not use 2007 OLEDB Drivers (64 bit drivers version has never been implemented). Fortunately Microsoft released 2010 Office System Driver Beta: Data Connectivity Components at the end of 2009. This driver works fine, but instead of "Provider=Microsoft.ACE.OLEDB.14.0" you still have to access it using "Provider=Microsoft.ACE.OLEDB.12.0" and "Extended Properties='Excel 12.0 Xml'". This would be probably fixed in release.
This driver also not always detecting last filled row in Excel, so make sure you are handling that.
Do not forget to go to Central Admin -> Shared Services -> Trusted Data Providers -> add it up there as Provider ID = "Microsoft.ACE.OLEDB.12.0" and Provider Type = "OLE DB".
Here is some sample code to help to work with it:
string sConnectionString = ""; string FileType = ""; switch (Path.GetExtension(sourceItem.File.ServerRelativeUrl)) { case ".xlsx": FileType = "Excel 12.0 Xml;"; break; case ".xlsm": FileType = "Excel 12.0 Macro;"; break; case ".xlsb": FileType = "Excel 12.0;"; break; default: FileType = "Excel 12.0;"; break; } sConnectionString = "Provider=Microsoft.ACE.OLEDB.12.0;" + "Data Source=" + tempFile + ";" + "Extended Properties=\"" + FileType + "HDR=No;IMEX=0;\""; OleDbConnection objConn = new OleDbConnection(sConnectionString); objConn.Open(); OleDbDataReader dr = new OleDbCommand("SELECT * FROM [" + this.WorksheetName + "$]", objConn).ExecuteReader(); for (int i = 1; i <= RowStart; i++) { dr.Read(); } while (dr.Read()) { //Put your logic here } objConn.Close();
Tuesday, October 13, 2009
Invalid Canary for view file
After we installed Infrastructure Updates we started to experience some problems with InfoPath Forms - getting "There has been an error while loading the form. A required resource could not be downloaded. To try to resume the download, refresh the page.", when using some of the alternative URLs.
SharePoint logs was showing me "WARNING: Invalid Canary for view file"
Based on the info from the Microsoft, there is an known problem with the Alternate Access Mapping in Infrastructure Updates. The next cumulative update is supposed to fix this issue. Will update this post as soon as I get it installed and verified.
Update: After installing SP2 issue was fixed.
InfoPath property promotion (field association) problem
Monday, August 24, 2009
InfoPath 2007 Bug - Form Does not Submit
Encountered weird InfoPath bug. Had an Approval Workflow with the InfoPath 2007 Web Form (MOSS). User had problems submitting the Form, click on the submit button was doing nothing. Reopening the Form was enough to submit. I watched how user worked with the Form, and noticed that the user was double clicking on the email link, which was causing the form to load twice (in two IE tabs). Changing this habit to clicking only once - solved the problem completely.
I have no idea why double loading the form was preventing it from submitting, but that's what it was.
Monday, April 13, 2009
JavaScript in SharePoint 2007 / MOSS Data View XSL
This sound obvious, but looks like lots of people do not know this. YES, you can use JavaScript in XSL. And YES, you can use JavaScript in SharePoint Data View XSL. And it is fairly easy. Here is a small sample.
Let’s say we want to know how old each item we view in Data View is. As the version of XSL used in SharePoint is “1.0”, we don’t really have a wide scope of date functions. Actually we do have only “FormatDate” function, and even this one comes from a special (ddwrt) Microsoft namespace.
Anyhow, instead of working with XSL, trying to create some crazy Template to handle this task, we can simply use JavaScript.
I assume here that you worked with SharePoint Designer 2007 and Data Views before.
You’ll have to add a JavaScript function first. You can add/link it to the page, page layout or master page, does not matter. I will use slightly modified script from “The JavaScript Source”.
<script type="text/javascript"> var montharray=new Array("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"); function countup(dat) { var dt = new Date(Date.parse(dat)); var yr =dt.getYear(); var m =dt.getMonth(); var d =dt.getDate(); var today=new Date(); var todayy=today.getYear(); if ((navigator.appName=="Microsoft Internet Explorer") && (todayy<2000)) todayy="19"+todayy; if (navigator.appName == "Netscape") todayy=1900 + todayy; var todaym=today.getMonth(); var todayd=today.getDate(); var todaystring=montharray[todaym]+" "+todayd+", "+todayy; var paststring=montharray[m]+" "+d+", "+yr; var difference=(Math.round((Date.parse(todaystring)-Date.parse(paststring))/(24*60*60*1000))*1); document.write(difference + " day(s)"); } </script>
Now we need to call this JavaScript function from Data View. Just click into one of the respectful cells in your Data View, and switch to Code View. You’ll see something like this:
<td class="ms-vb"> <xsl:value-of select="ddwrt:FormatDate(string(@Modified), 1033, 5)" /> </td>
Now we’ll edit it, adding the JavaScript Call:
<td class="ms-vb"> <script language="javascript">countup("<xsl:value-of select="ddwrt:FormatDate(string(@Modified),1033,1)" />");</script> </td>
Vuala!
PS: I did not add any screen shots here assuming that it is fairly easy, but if you need some, just leave some comments.
SharePoint 2007 / MOSS URL Zones are limited
Ever wondered if there is any way to add additional zone to the list of URL Zones in SharePoint Central Administration? Sorry guys, no way. It is actually a predefined enumeration defined in Microsoft.SharePoint.dll
public enum SPUrlZone { Default, Intranet, Internet, Custom, Extranet }
Sunday, April 12, 2009
SharePoint 2007 / MOSS Page Refers Old Layout
Recently I was working a lot with SharePoint 2007 / MOSS Publishing Pages and Layouts. I noticed a weird behavior when I was moving some of the pages from dev environment to production. Sometimes the link to page layout is getting stuck and still pointing to an old (dev) environment. It was not obvious to find a way to fix it…
First I tried just exporting those pages to my local disk and editing it in notepad and putting it back. This approach did work, but was a little bit too manual…
After some head scratching I finally found a Page Settings page. When your page editing toolbar is visible (you clicked on “Site Actions” ->“Edit Page”), you can click on Page dropdown and select “Page Settings and Schedule”. On that page you can control Page Title and Description, Publishing Schedule, Page Layout, Audience Targeting and Page Contact. Alternatively you can just browse to it http://your-sharepoint-site/_layouts/PageSettings.aspx?Page=<Page ID>.
I had a few situations when it was still not working, and I was getting an error trying to change layout settings. You can always edit it in notepad in that case, as I described earlier.
Wednesday, April 8, 2009
Thicket “_files” folder and SharePoint 2007 (MOSS)
I got into this one when I was asked to put some Microsoft Publisher generated files into SharePoint 2007 site. Basically I got “index.html” file and “index_files” folder with some images and html files inside. I did put the index file into the root, then created the Document Library named “index_files”. Also I uploaded all the files into it without any problems using “Open in Windows Explorer” functionality. Everything actually started to work well. Then I was surprised that I don’t see this document library in SharePoint Designer. When I opened it from the browser – it was empty. But it was still showing all the files when opened with Windows Explorer. When I tried to change document library settings to work with content types, the whole settings page started to throw error.
I did some research and it looks like SharePoint 2007 has some native support of so called “thicket” folder (“_files” folder). SharePoint does not allow creating such a folder when you don’t have a corresponding (parent) file. When you try to create such folder using SharePoint Designer, it appends its name with an underscore at the end. SharePoint web interface hides content of such folder, while keeping those files accessible from Windows Explorer or when you browse/refer it directly.
My advise – try to avoid thickets in SharePoint. Those are hard to manage there.
Tuesday, March 24, 2009
"SharePoint designer encountered an error generating the task form" error caused by using IP address instead of machine name
Tuesday, March 10, 2009
Creating and customizing SharePoint 2007/MOSS Central Administration Application Pages
A brief introduction
Review out-of-the-box pages.
Page | Inherits | Based |
---|---|---|
Operations | ||
Operations.aspx | Microsoft.SharePoint.ApplicationPages.OperationsLandingPage | GlobalAdminPageBase |
FarmServers.aspx | Microsoft.SharePoint.ApplicationPages.FarmServersPage | OperationsPage : GlobalAdminPageBase |
Server.aspx | Microsoft.SharePoint.ApplicationPages.ServerPage | OperationsPage : GlobalAdminPageBase |
GlobalEmailConfig.aspx | Microsoft.SharePoint.ApplicationPages.GlobalEmailConfigPage | OperationsPage : GlobalAdminPageBase |
IncomingEmail.aspx | Microsoft.SharePoint.ApplicationPages.IncomingEmailPage | OperationsPage : GlobalAdminPageBase |
FarmCredentialManagement.aspx | Microsoft.SharePoint.ApplicationPages.FarmCredentialManagementPage | OperationsPage : GlobalAdminPageBase |
irmadmin.aspx | Microsoft.SharePoint.ApplicationPages.IrmGlobalSettings | OperationsPage : GlobalAdminPageBase |
avadmin.aspx | Microsoft.SharePoint.ApplicationPages.AntiVirusConfigPage | OperationsPage : GlobalAdminPageBase |
BlockedFileType.aspx | Microsoft.SharePoint.ApplicationPages.BlockedFileTypePage | OperationsPage : GlobalAdminPageBase |
policyfeatures.aspx | Microsoft.Office.RecordsManagement.InformationPolicy. ApplicationPages.PolicyFeatures (Microsoft.Office.Policy.AdminPages.dll) | GlobalAdminPageBase |
managesso.aspx | Microsoft.SharePoint.Portal.SingleSignonAdministration.ManageSSOPage (Microsoft.SharePoint.Portal.dll) | SSOAdminBase : OfficeServerPageBase |
metrics.aspx | Microsoft.SharePoint.ApplicationPages.MetricsPage | OperationsPage : GlobalAdminPageBase |
LogUsage.aspx | Microsoft.SharePoint.ApplicationPages.LogUsagePage | OperationsPage : GlobalAdminPageBase |
policyRptConfig.aspx | Microsoft.Office.RecordsManagement.Reporting. ApplicationPages.PolicyRptConfig (Microsoft.Office.Policy.AdminPages.dll) | GlobalAdminPageBase |
CMSMigration.aspx | Microsoft.SharePoint.Publishing.Internal.CodeBehind.ManageMigrationProfile (Microsoft.Sharepoint.Publishing.dll) | Microsoft.SharePoint.WebControls. UnsecuredLayoutsPageBase |
SkuUpgrade.aspx | Microsoft.SharePoint.Portal.ServerAdmin.SkuUpgradePage(Microsoft.SharePoint.Portal.dll) | CentralAdminPageBase |
EnableFeatures.aspx | Microsoft.SharePoint.Portal.ServerAdmin.FeaturePushdownPage (Microsoft.SharePoint.Portal.dll) | CentralAdminPageBase |
Conversion.aspx | Microsoft.Office.Server.Internal.UI.ConversionPage | CentralAdminPageBase |
ServiceRunningJobs.aspx | Microsoft.SharePoint.ApplicationPages.TimerJobsPage | OperationsPage : GlobalAdminPageBase |
ServiceJobDefinitions.aspx | Microsoft.SharePoint.ApplicationPages.TimerJobsPage | OperationsPage : GlobalAdminPageBase |
sitedirectorysettings.aspx | Microsoft.SharePoint.Portal.ServerAdmin.SiteDirectorySettings (Microsoft.SharePoint.Portal.dll) | CentralAdminPageBase |
linkscheckerjobsettings.aspx | Microsoft.SharePoint.Portal.SiteAdmin.LinksCheckerJobSettings (Microsoft.SharePoint.Portal.dll) | CentralAdminPageBase |
AlternateUrlCollections.aspx | Microsoft.SharePoint.ApplicationPages.AlternateUrlCollectionsPage | GlobalAdminPageBase |
ManageFarmFeatures.aspx | Microsoft.SharePoint.ApplicationPages.ManageFarmFeaturesPage | ApplicationsManagementPage : GlobalAdminPageBase |
QuiesceFarm.aspx | Microsoft.Office.Server.Internal.UI.QuiesceFarmPage | CentralAdminPageBase |
Solutions.aspx | Microsoft.SharePoint.ApplicationPages.OperationsPage | GlobalAdminPageBase |
backup.aspx | Microsoft.SharePoint.ApplicationPages.BackupPage | BackupAdminPageBase : OperationsPage : GlobalAdminPageBase |
backuphistory.aspx | Microsoft.SharePoint.ApplicationPages.BackupHistoryPage | BackupAdminPageBase : OperationsPage : GlobalAdminPageBase |
restorestep1.aspx | Microsoft.SharePoint.ApplicationPages.RestoreStep1Page | BackupAdminPageBase : OperationsPage : GlobalAdminPageBase |
Restorestep3.aspx | Microsoft.SharePoint.ApplicationPages.RestoreStep3Page | BackupAdminPageBase : OperationsPage : GlobalAdminPageBase |
backupstatus.aspx | Microsoft.SharePoint.ApplicationPages.BackupStatusPage | BackupAdminPageBase : OperationsPage : GlobalAdminPageBase |
defaultcontentdb.aspx | Microsoft.SharePoint.ApplicationPages.DefaultContentDatabasePage | OperationsPage : GlobalAdminPageBase |
DspSettings.aspx | Microsoft.SharePoint.ApplicationPages.DspSettings | OperationsPage : GlobalAdminPageBase |
Deployment.aspx | Microsoft.SharePoint.Publishing.Internal.CodeBehind. DeployManagePathsAndJobsPage (Microsoft.Sharepoint.Publishing.dll) | BasePublishingPage : LayoutsPageBase : UnsecuredLayoutsPageBase |
DeploymentSettings.aspx | Microsoft.SharePoint.Publishing.Internal.CodeBehind.DeploySettingsPage (Microsoft.Sharepoint.Publishing.dll) | BasePublishingPage : LayoutsPageBase : UnsecuredLayoutsPageBase |
DeploymentStatus.aspx | Microsoft.SharePoint.Publishing.Internal. CodeBehind.DeploymentObjectStatusPage (Microsoft.Sharepoint.Publishing.dll) | BasePublishingPage : LayoutsPageBase : UnsecuredLayoutsPageBase |
Application Management | ||
applications.aspx | Microsoft.SharePoint.ApplicationPages.ApplicationsPage | GlobalAdminPageBase |
extendvsoption.aspx | Microsoft.SharePoint.ApplicationPages.ExtendVsOptionPage | GlobalAdminPageBase |
unextendvs.aspx | Microsoft.SharePoint.ApplicationPages.UnextendVirtualServerPage | ApplicationsManagementPage : GlobalAdminPageBase |
deletewebapplication.aspx | Microsoft.SharePoint.ApplicationPages.DeleteWebApplicationPage | ApplicationsManagementPage : GlobalAdminPageBase |
scprefix.aspx | Microsoft.SharePoint.ApplicationPages.SscPrefixPage | ApplicationsManagementPage : GlobalAdminPageBase |
vsemail.aspx | Microsoft.SharePoint.ApplicationPages.VSEmailConfigPage | ApplicationsManagementPage : GlobalAdminPageBase |
vsgeneralsettings.aspx | Microsoft.SharePoint.ApplicationPages.VirtualServerGeneralSettingsPage | ApplicationsManagementPage : GlobalAdminPageBase |
cntdbadm.aspx | Microsoft.SharePoint.ApplicationPages.ContentDBManagmentPage | ApplicationsManagementPage : GlobalAdminPageBase |
ManageWebAppFeatures.aspx | Microsoft.SharePoint.ApplicationPages.ManageWebAppFeaturesPage | ApplicationsManagementPage : GlobalAdminPageBase |
WebApplications.aspx | Microsoft.SharePoint.ApplicationPages.ListWebApplicationsPage | SelectWebApplicationPage : SelectPage : GlobalAdminPageBase |
managessp.aspx | Microsoft.Office.Server.Internal.UI.ManageSspPage | CentralAdminPageBase |
manageinterfarmservices.aspx | Microsoft.Office.Server.Internal.UI.ManageInterFarmServicesPage | CentralAdminPageBase |
checkfarmservices.aspx | Microsoft.Office.Server.Internal.UI.CheckFarmServicesPage | CentralAdminPageBase |
SessionStateAdmin.aspx | Microsoft.Office.Server.Internal.UI.SessionStateAdminPage | CentralAdminPageBase |
SPSecuritySettings.aspx | Microsoft.SharePoint.ApplicationPages.WebPartPageSettingsPage | ApplicationsManagementPage : GlobalAdminPageBase |
configssc.aspx | Microsoft.SharePoint.ApplicationPages.ConfigSscPage | ApplicationsManagementPage : GlobalAdminPageBase |
vsmask.aspx | Microsoft.SharePoint.ApplicationPages.VirtualServerMaskPage | ApplicationsManagementPage : GlobalAdminPageBase |
policy.aspx | Microsoft.SharePoint.ApplicationPages.PolicyPage | ApplicationsManagementPage : GlobalAdminPageBase |
AuthenticationProviders.aspx | Microsoft.SharePoint.ApplicationPages.GlobalAdminPageBase | |
managesearchservice.aspx | Microsoft.SharePoint.Portal.Search.Admin.Pages.ManageSearchService (Microsoft.SharePoint.Portal.dll) | SearchCentralAdminPageBase : CentralAdminPageBase |
workflowadmin.aspx | Microsoft.SharePoint.ApplicationPages.WorkflowAdminPage | ApplicationsManagementPage : GlobalAdminPageBase |
createsite.aspx | Microsoft.SharePoint.ApplicationPages.CreateSitePage | ApplicationsManagementPage : GlobalAdminPageBase |
delsite.aspx | Microsoft.SharePoint.ApplicationPages.DeleteSitePage | ApplicationsManagementPage : GlobalAdminPageBase |
DeleteSiteConfig.aspx | Microsoft.SharePoint.ApplicationPages.DeleteSiteConfig | ApplicationsManagementPage : GlobalAdminPageBase |
ManageQuotaTemplate.aspx | Microsoft.SharePoint.ApplicationPages.ManageQuotaTemplatePage | ApplicationsManagementPage : GlobalAdminPageBase |
SiteQuota.aspx | Microsoft.SharePoint.ApplicationPages.SiteQuotaPage | ApplicationsManagementPage : GlobalAdminPageBase |
owners.aspx | Microsoft.SharePoint.ApplicationPages.OwnersPage | ApplicationsManagementPage : GlobalAdminPageBase |
SiteCollections.aspx | Microsoft.SharePoint.ApplicationPages.ListSitesPage | SelectSitePage : SelectPage : GlobalAdminPageBase |
OfficialFileAdmin.aspx | Microsoft.SharePoint.ApplicationPages.OfficialFileAdminPage | ApplicationsManagementPage : GlobalAdminPageBase |
HtmlTransAdmin.aspx | Microsoft.SharePoint.ApplicationPages.HtmlTransAdminPage | ApplicationsManagementPage : GlobalAdminPageBase |
DocTransAdmin.aspx | Microsoft.SharePoint.ApplicationPages.DocTransAdminPage | ApplicationsManagementPage : GlobalAdminPageBase |
ManageFormTemplates.aspx | Microsoft.Office.InfoPath.Server. ApplicationPages.ManageFormTemplatesPage (Microsoft.Office.InfoPath.Server.Pages.dll) | GridViewPageBase : AdminPageBase |
ipfsConfig.aspx | Microsoft.Office.InfoPath.Server. ApplicationPages.FormServerConfigPage (Microsoft.Office.InfoPath.Server.dll) | AdminPageBase |
UploadFormTemplate.aspx | Microsoft.Office.InfoPath.Server. ApplicationPages.UploadFormTemplatePage (Microsoft.Office.InfoPath.Server.dll) | AdminPageBase |
ManageDataConnectionFiles.aspx | Microsoft.Office.InfoPath.Server. ApplicationPages.ManageDataConnectionFilesPage (Microsoft.Office.InfoPath.Server.Pages.dll) | GridViewPageBase : AdminPageBase |
ManageFormsServiceProxy.aspx | Microsoft.Office.InfoPath.Server. ApplicationPages.ManageFormsServiceProxyPage (Microsoft.Office.InfoPath.Server.Pages.dll) | AdminPageBase |
Shared Services Administration | ||
managessp.aspx | Microsoft.Office.Server.Internal.UI.ManageSspPage | CentralAdminPageBase |
Building minimal SharePoint Central Administration Application Page.
In order to be consistent with current pages we want to inherit the new:
• Operations Section page – from Microsoft.SharePoint.ApplicationPages.OperationsPage;
• Application Management page – from Microsoft.SharePoint.ApplicationPages.ApplicationsManagementPage;
Both OperationsPage and ApplicationsManagementPage classes overrides just one PageToRedirectOnCancel property from GlobalAdminPageBase.
Let’s build our first blank Central Admin Applications Management page:
Here is the code:
using System; using System.Web; namespace Sharepointalist.Samples.CentralAdmin { public class ApplicationManagementSamplePage : Microsoft.SharePoint.ApplicationPages.ApplicationsManagementPage { } }Here is the web page:
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ApplicationManagementSamplePage.aspx.cs" Inherits="Sharepointalist.Samples.CentralAdmin.ApplicationManagementSamplePage, Sharepointalist.Samples.CentralAdmin, Version=1.0.0.0, Culture=neutral, PublicKeyToken=5f18faed9b7b4caf" MasterPageFile="~/_admin/admin.master"%> <asp:Content ID="Content1" contentplaceholderid="PlaceHolderAdditionalPageHead" runat="server"> </asp:Content> <asp:Content ID="Content2" contentplaceholderid="PlaceHolderPageTitle" runat="server"> </asp:Content> <asp:Content ID="Content3" contentplaceholderid="PlaceHolderPageTitleInTitleArea" runat="server"> </asp:Content> <asp:content ID="Content4" contentplaceholderid="PlaceHolderPageDescription" runat="server"> </asp:content> <asp:content ID="Content5" contentplaceholderid="PlaceHolderMain" runat="server"> </asp:content>
Deployment.
- Add breadcrumbs. Please check following Jan Tielens blog posts: Adding Breadcrumb Navigation to Application Pages in SharePoint Central Administration and Adding Breadcrumb Navigation to SharePoint Application Pages, the Easy Way
- Do not deploy your pages right into ADMIN folder. Create a subfolder.
In many cases we want to add a new link to our new page on the MOSS Central Administration Site. We can use Element Manifest file with CustomAction defined for that. Please refer to Custom Action Definitions and Default Custom Action Locations and IDs on MSDN for detailed info.
In short, we need to choose Location(Page) and select/create a Group for our link.
Possible Locations and Groups:
- Operations Page - Microsoft.SharePoint.Administration.Operations.
- Backup and Restore - BackupRestore;
- Data Configuration - DataConfiguration;
- Global Configuration - GlobalConfiguration;
- Logging and Reporting - LoggingAndReporting;
- Security Configuration - Security;
- Topology and Services - Topology;
- Upgrade and Migration - Upgrade;
- Content Deployment - ContentDeployment;
- Application Management Page - Microsoft.SharePoint.Administration.ApplicationManagement.
- Application Security - ApplicationSecurity;
- External Service Connections - ExternalService;
- SharePoint Site Management - SiteManagement;
- SharePoint Web Application Management - WebApplicationConfiguration;
- Workflow Management - WorkflowManagement;
- Search - SearchGroup;
- InfoPath Forms Services - IPFSApplicationConfiguration;
- Office SharePoint Server Shared Services - OfficeServerCoreServices;
- Application Created Page - Microsoft.SharePoint.Administration.ApplicationCreated.
- Links - Links;
- Shared Services Administration Page - Office.Server.ServiceProvider.Administration.
- User Profiles and My Sites - UAP;
- Search - Search;
- Excel Services Settings - ExcelServer;
- Audiences - AUD;
- Office SharePoint Usage Reporting - PortalAnalytics;
- Business Data Catalog - BDC;
Here is a sample Elements.xml
<Elements xmlns="http://schemas.microsoft.com/sharepoint/"> <CustomActionGroup Id="Sharepointalist.Samples.CentralAdmin.ApplicationManagementGroup" Location="Microsoft.SharePoint.Administration.ApplicationManagement" Title="Sharepointalist" Sequence="10" /> <CustomAction Id="Sharepointalist.Samples.CentralAdmin.ApplicationManagementSamplePage" GroupId="Sharepointalist.Samples.CentralAdmin.ApplicationManagementGroup" Title="Application Management Sample Page" Sequence="1" Location="Microsoft.SharePoint.Administration.ApplicationManagement"> <UrlAction Url="/_admin/Sharepointalist/Samples/ApplicationManagementSamplePage.aspx"/> </CustomAction> </Elements>
Here is a sample Feature.xml
<?xml version="1.0" encoding="utf-8" ?> <Feature Id="90AC28E1-F64B-42bb-AB51-C65590ED5CD4" Title="Sharepointalist Sample Central Administration Feature" Description="Sample Central Administration Feature. Please visit my web page at http://www.sharepointalist.com/" Version="1.0.0.0" Creator="http://www.sharepointalist.com/" ActivateOnDefault="True" Scope="Farm" xmlns="http://schemas.microsoft.com/sharepoint/" ReceiverAssembly="Sharepointalist.Samples.CentralAdmin, Version=1.0.0.0, Culture=neutral, PublicKeyToken=5f18faed9b7b4caf" ReceiverClass="Sharepointalist.Samples.CentralAdmin.FeatureHandler"> <Properties> <Property Key="GloballyAvailable" Value="true" /> </Properties> <ElementManifests> <ElementManifest Location="Elements.xml"/> </ElementManifests> </Feature>