ConsoleAction-Klasse

Stellt die Basisklasse der erben müssen, alle spezifischen Konsolen-Aktionen in den ConsoleDataSource verwendet werden.

Vererbungshierarchie

System.Object
  System.Web.UI.Control
    System.Web.UI.WebControls.WebControl
      Microsoft.SharePoint.Publishing.WebControls.EditingMenuActions.ConsoleAction
        

Namespace:  Microsoft.SharePoint.Publishing.WebControls.EditingMenuActions
Assembly:  Microsoft.SharePoint.Publishing (in Microsoft.SharePoint.Publishing.dll)

Syntax

'Declaration
<AspNetHostingPermissionAttribute(SecurityAction.InheritanceDemand, Level := AspNetHostingPermissionLevel.Minimal)> _
<SharePointPermissionAttribute(SecurityAction.InheritanceDemand, ObjectModel := True)> _
<AspNetHostingPermissionAttribute(SecurityAction.LinkDemand, Level := AspNetHostingPermissionLevel.Minimal)> _
<SharePointPermissionAttribute(SecurityAction.LinkDemand, ObjectModel := True)> _
Public MustInherit Class ConsoleAction _
    Inherits WebControl _
    Implements IPostBackEventHandler
'Usage
Dim instance As ConsoleAction
[AspNetHostingPermissionAttribute(SecurityAction.InheritanceDemand, Level = AspNetHostingPermissionLevel.Minimal)]
[SharePointPermissionAttribute(SecurityAction.InheritanceDemand, ObjectModel = true)]
[AspNetHostingPermissionAttribute(SecurityAction.LinkDemand, Level = AspNetHostingPermissionLevel.Minimal)]
[SharePointPermissionAttribute(SecurityAction.LinkDemand, ObjectModel = true)]
public abstract class ConsoleAction : WebControl, 
    IPostBackEventHandler

Hinweise

Klicken Sie im Menü Bearbeitenoder Quick Access-MenüWebsiteaktionen Menü verschiedene Aktionen dem Benutzer angezeigt. Jede dieser Menüs enthält eine Instanz des ConsoleDataSource -Objekts, das eine hierarchische Auflistung von ConsoleNode -Objekten enthält, von denen einige die ConsoleAction -Klasse implementiert. Jede Implementierung dieser Klasse stellt eine bestimmte Aktion, z. B. Erstellen, Veröffentlichen, Versionsverlauf anzeigenoder Speichern und Bearbeitung beenden.

Das hier vorgestellte Codebeispiel wurde vereinfacht, aber zeigt, wie eine Konsole Aktion erstellt werden soll. Ausführen dieser Beispielanwendung wird eine Schaltfläche "Speichern und Bearbeitung beenden" Quick Access-Menühinzugefügt. Ist es erforderlich, dass die Seite im Bearbeitungsmodus befindet und der Benutzer Berechtigungen für dieses Objekt PublishingPageEditListItem verfügen. Das Beispiel ECMAScript (JavaScript, JScript) für Postbacks an dieses Steuerelement verwendet, und wenn es ein postback-Ereignis auslöst, wird das Ereignis speichert das aktuelle PublishingPage -Objekt und zeigt die gespeicherte Seite in den Anzeigemodus.

Beispiele

using Microsoft.SharePoint;
using Microsoft.SharePoint.WebControls;
using Microsoft.SharePoint.Publishing.WebControls.EditingMenuActions;

/// Assemblies that need to be referenced in this sample;
///     Microsoft.SharePoint.dll
///     Microsoft.SharePoint.Publishing.dll
///     Microsoft.Web.CommandUI.dll
namespace Microsoft.SDK.SharePointServer.Samples.Publishing.RteExtensions
{
    public class RteExtensionsAction : ConsoleAction
    {
        /// <summary>
        /// This Console Action will include on the client a reference to RteExtension.js file 
        /// on pages that have a Rich Text Editor.
        /// </summary>
        public RteExtensionsAction()
            : base()
        {
        }

        /// <summary>
        /// Gets the rights required for this console action to be active on the page.
        /// 
        /// For this example, we will have the same value as the Publishing Rich Text Editor
        /// which requires Edit List Item Right, since we want to activate under
        /// the same circumstances.
        /// </summary>
        /// <value>
        /// The rights required for this console action to be active on the page.
        /// </value>
        public override SPBasePermissions UserRights
        {
            get { return SPBasePermissions.EditListItems; }
        }

        /// <summary>
        /// The value returned by this function represents a list of Ribbon tabs, if these
        /// ribbon tabs are currently shown, then this console action will be activate on this page.
        /// 
        /// For this example, we are specifying the Format Text tab, which is requested
        /// when the Publishing Rich Text Editor is on the page. Also, we are adding a new
        /// button to this tab, and hence we want to activate when that button is present on
        /// the page.
        /// </summary>
        /// <returns>
        /// A list of ribbon tabs for which the ConsoleAction is activated.
        /// </returns>
        public override string[] GetRibbonTabIdsWhereConsoleActionIsShown()
        {
            return new string[] { SPRibbon.EditTabId };
        }

        /// <summary>
        /// If the UserRights are met and the Ribbon Tabs have been found, then this method will be called.
        /// This is where you register your appropriate ribbon files and send to the client data it requires.
        /// 
        /// For this example, we will tell SharePoint ScriptLink about the existance of RteExtensions.js.
        /// This will allow code on the client to download it on demand. 
        /// The second part will register a startup script that will download RteExtensions.js once the
        /// SharePoint rich text editor file (sp.ui.rte.js) has finished downloaded.
        /// </summary>
        public override void RegisterClientData()
        {
            // Register the extension script, such that it can be downloaded on demand.
            ScriptLink.RegisterOnDemand(this.Page, "RteExtensions.js", false);

            // Download the RteExtension script when the SharePoint RTE has finished downloaded.
            string onDemandScript = @"
// This method informs SharePoint to start downloading the Script On Demand
// file that was registered on the server.
function loadRteExtensions()
{
// Include the RteExtensions.js if it is not already on the page.
var defd;
try
{
defd = typeof(RteExtensions);
}
catch (e)
{
defd = 'undefined';
}
EnsureScript('RteExtensions.js', defd, null);
}
// This method is run when the body has finished loading.
// Inform SharePoint to wait until the rich text editor has been 
// downloaded on the page before including the rte extensions.
function loadExtensionsDependencies()
{
ExecuteOrDelayUntilScriptLoaded(loadRteExtensions, 'sp.ui.rte.js');
}
// Add to the SharePoint array of functions to call when the 
// body of the document has finished loading
// Wait for the page to have completed to load
// this will make sure that all script on demand information
// has been processed by SharePoint.
if (_spBodyOnLoadFunctionNames != null)
{
_spBodyOnLoadFunctionNames.push('loadExtensionsDependencies');
}
";
            Page.ClientScript.RegisterStartupScript(typeof(RteExtensionsAction), "RteExtensionsAction", onDemandScript, true);
        }
    }
}

Threadsicherheit

Alle öffentlichen static (Shared in Visual Basic) Member dieses Typs sind threadsicher. Die Threadsicherheit von Instanzmembern ist nicht gewährleistet.

Siehe auch

Referenz

ConsoleAction-Member

Microsoft.SharePoint.Publishing.WebControls.EditingMenuActions-Namespace

ConsoleNode

ConsoleDataSource

IsCurrentlyEnabled

RaisePostBackEvent

RefreshCurrentItemAfterUpdate

ShowError

Vererbungshierarchie

System.Object
  System.Web.UI.Control
    System.Web.UI.WebControls.WebControl
      Microsoft.SharePoint.Publishing.WebControls.EditingMenuActions.ConsoleAction
        Microsoft.SharePoint.Publishing.WebControls.EditingMenuActions.ApproveOrDeclineAction
        Microsoft.SharePoint.Publishing.WebControls.EditingMenuActions.BaseApproveAction
        Microsoft.SharePoint.Publishing.WebControls.EditingMenuActions.BaseDeclineAction
        Microsoft.SharePoint.Publishing.WebControls.EditingMenuActions.BrowseWebPartsAction
        Microsoft.SharePoint.Publishing.WebControls.EditingMenuActions.CancelApprovalRequestAction
        Microsoft.SharePoint.Publishing.WebControls.EditingMenuActions.CancelApprovalWorkflowRequestAction
        Microsoft.SharePoint.Publishing.WebControls.EditingMenuActions.CancelSchedulingAction
        Microsoft.SharePoint.Publishing.WebControls.EditingMenuActions.CheckInAction
        Microsoft.SharePoint.Publishing.WebControls.EditingMenuActions.CheckInWithCommentAction
        Microsoft.SharePoint.Publishing.WebControls.EditingMenuActions.CheckOutAction
        Microsoft.SharePoint.Publishing.WebControls.EditingMenuActions.CheckOutOverrideAction
        Microsoft.SharePoint.Publishing.WebControls.EditingMenuActions.CopyAction
        Microsoft.SharePoint.Publishing.WebControls.EditingMenuActions.CreateNewPublishingPageAction
        Microsoft.SharePoint.Publishing.WebControls.EditingMenuActions.CreateNewSiteAction
        Microsoft.SharePoint.Publishing.WebControls.EditingMenuActions.CreateNewsLinkAction
        Microsoft.SharePoint.Publishing.WebControls.EditingMenuActions.CreatePageVariationAction
        Microsoft.SharePoint.Publishing.WebControls.EditingMenuActions.CreateSiteVariationAction
        Microsoft.SharePoint.Publishing.WebControls.EditingMenuActions.DeleteAction
        Microsoft.SharePoint.Publishing.WebControls.EditingMenuActions.DesignSiteAction
        Microsoft.SharePoint.Publishing.WebControls.EditingMenuActions.DeviceChannelReorderingAction
        Microsoft.SharePoint.Publishing.WebControls.EditingMenuActions.EditListItemPropertiesAction
        Microsoft.SharePoint.Publishing.WebControls.EditingMenuActions.EditPropertiesAction
        Microsoft.SharePoint.Publishing.WebControls.EditingMenuActions.EditSeoPropertiesAction
        Microsoft.SharePoint.Publishing.WebControls.EditingMenuActions.ExitMenuAction
        Microsoft.SharePoint.Publishing.WebControls.EditingMenuActions.ExitWithoutSavingAction
        Microsoft.SharePoint.Publishing.WebControls.EditingMenuActions.ForceSavePublishingPageAction
        Microsoft.SharePoint.Publishing.WebControls.EditingMenuActions.ImportWebPartsAction
        Microsoft.SharePoint.Publishing.WebControls.EditingMenuActions.ManageSiteAction
        Microsoft.SharePoint.Publishing.WebControls.EditingMenuActions.ModifyNavigationAction
        Microsoft.SharePoint.Publishing.WebControls.EditingMenuActions.ModifyPagesLibrarySettingsAction
        Microsoft.SharePoint.Publishing.WebControls.EditingMenuActions.MoveAction
        Microsoft.SharePoint.Publishing.WebControls.EditingMenuActions.OneClickPublishAction
        Microsoft.SharePoint.Publishing.WebControls.EditingMenuActions.PageLayoutAction
        Microsoft.SharePoint.Publishing.WebControls.EditingMenuActions.PersonalViewAction
        Microsoft.SharePoint.Publishing.WebControls.EditingMenuActions.PreviewAction
        Microsoft.SharePoint.Publishing.WebControls.EditingMenuActions.PreviewExistingPublishingPageAction
        Microsoft.SharePoint.Publishing.WebControls.EditingMenuActions.PublishAction
        Microsoft.SharePoint.Publishing.WebControls.EditingMenuActions.PublishWithCommentAction
        Microsoft.SharePoint.Publishing.WebControls.EditingMenuActions.QuickDeployAction
        Microsoft.SharePoint.Publishing.WebControls.EditingMenuActions.ReviewPublishingPageAction
        Microsoft.SharePoint.Publishing.WebControls.EditingMenuActions.RevisionHistoryAction
        Microsoft.SharePoint.Publishing.WebControls.EditingMenuActions.RTEV4Action
        Microsoft.SharePoint.Publishing.WebControls.EditingMenuActions.SavePublishingPageAction
        Microsoft.SharePoint.Publishing.WebControls.EditingMenuActions.SchedulingAction
        Microsoft.SharePoint.Publishing.WebControls.EditingMenuActions.SearchWebPartsAction
        Microsoft.SharePoint.Publishing.WebControls.EditingMenuActions.SharedViewAction
        Microsoft.SharePoint.Publishing.WebControls.EditingMenuActions.ShowUnapprovedResourcesAction
        Microsoft.SharePoint.Publishing.WebControls.EditingMenuActions.SiteDirectoryBrokenLinksCheckerAction
        Microsoft.SharePoint.Publishing.WebControls.EditingMenuActions.SiteSettingsAction
        Microsoft.SharePoint.Publishing.WebControls.EditingMenuActions.SpellCheckEntirePageAction
        Microsoft.SharePoint.Publishing.WebControls.EditingMenuActions.SwitchToAuthoringModeAction
        Microsoft.SharePoint.Publishing.WebControls.EditingMenuActions.SwitchToPublishedModeAction
        Microsoft.SharePoint.Publishing.WebControls.EditingMenuActions.UndoCheckOutAction
        Microsoft.SharePoint.Publishing.WebControls.EditingMenuActions.UnpublishAction
        Microsoft.SharePoint.Publishing.WebControls.EditingMenuActions.VersionDifferenceAction
        Microsoft.SharePoint.Publishing.WebControls.EditingMenuActions.VersionInfoAction
        Microsoft.SharePoint.Publishing.WebControls.EditingMenuActions.ViewAllSiteContentAction
        Microsoft.SharePoint.Publishing.WebControls.EditingMenuActions.ViewChangesPageVariationAction
        Microsoft.SharePoint.Publishing.WebControls.EditingMenuActions.ViewRecycleBinAction
        Microsoft.SharePoint.Publishing.WebControls.EditingMenuActions.WorkflowStartAction
        Microsoft.SharePoint.Publishing.WebControls.EditingMenuActions.WorkflowStatusAction
        Microsoft.SharePoint.Publishing.WebControls.EditingMenuActions.WorkflowTasksAction
        Microsoft.SharePoint.Publishing.WebControls.SmallBusinessWebsiteConsoleAction
        Microsoft.SharePoint.Publishing.WebControls.SpellCheckV4Action