Showing posts with label Publishing Pages. Show all posts
Showing posts with label Publishing Pages. Show all posts

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

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.