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

1 comment:

  1. Paul, some great stuff here. Can we repost on NothingButSharePoint and provide links back to your original content? Ping me at cbuck at axceler dot com. Thanks

    ReplyDelete