PreviewDraftButton Class Content Studio 5.7 SDK
Content Studio Web Content Management System

[This is preliminary documentation and is subject to change.]

This class writes html code to the supplied stream or the default response stream. The PreviewDraftButton class acts as the underlying engine for the PreviewDraftButton AS component and generates an ordinary button that via java script opens a browser popup dialog that enables the caller to preview the document just beeing edited.
Inheritance Hierarchy

SystemObject
  ContentStudio.SiteCodeBase
    ContentStudio.Site.ActiveScriptingActiveScriptingBase
      ContentStudio.Site.ActiveScripting.DocumentPreviewDraftButton

Namespace: ContentStudio.Site.ActiveScripting.Document
Assembly: CS_SiteLib (in CS_SiteLib.dll) Version: 5.7.5016.0 (5.7.5016.0)
Syntax

public class PreviewDraftButton : ActiveScriptingBase

The PreviewDraftButton type exposes the following members.

Constructors

  NameDescription
Public methodPreviewDraftButton
Constructs a new instance of the PreviewDraftButton class that writes to the default response stream
Public methodPreviewDraftButton(Stream)
Constructs a new instance of the PreviewDraftButton class that writes to the supplied stream
Top
Properties

  NameDescription
Public propertyBackwardsComponentCompatibilityMode
Sets or gets a value that indicates whether the code runs in backwards compatibility component mode. The default value is false.
(Inherited from ActiveScriptingBase.)
Public propertyButtonID
Sets or gets the id attribute of the button rendered. The default value is DefaultButtonID. This property cannot be empty or null.
Public propertyComponentName
Gets the name of the component
(Overrides ActiveScriptingBaseComponentName.)
Public propertyConformance
Gets a value which specifies which type of code a component can generate.
(Overrides ActiveScriptingBaseConformance.)
Protected propertyCode exampleCS_DataFields
Gets a EPTXmlParser that contains a collection of EPT field definitions and values. This property is the replacement for the obsolete EPT_GetFieldName(String) and EPT_GetFieldValue(String) methods.
(Inherited from CodeBase.)
Public propertyCSSClassName
Sets or gets the name of a CSS class attribute to use to format the button rendered. The default value is Empty which will omit the class attribute.
Public propertyDialogHeight
Sets or gets a value that specifies the height (in pixels, px) of the preview dialog. This value is effective only the first time the user calls the dialog since the dialog remembers its last setting. The default value is 800 and the smallest value that is accepted is DialogMinHeight. Smaller values are automatically set to DialogMinHeight;
Public propertyDialogWidth
Sets or gets a value that specifies the width (in pixels, px) of the preview dialog. This value is effective only the first time the user calls the dialog since the dialog remembers its last setting. The default value is 680 and the smallest value that is accepted is DialogMinWidth. Smaller values are automatically set to DialogMinWidth;
Public propertyDocumentID
Sets or gets the id of the document to preview The default value is zero which indicates that the component should use the current document of the document beeing edited. This will be the value of the CS_InsertedDocumentId property. This property must be zero or more.
Public propertyElementType
Gets a value which specifies the type of outer element the component generates.
(Overrides ActiveScriptingBaseElementType.)
Public propertyEncoding
Sets or gets the encoding the component uses. The default encoding is the UTF8 encoding without byte order mark.
(Inherited from ActiveScriptingBase.)
Protected propertyPage
A reference to the current context page. This will initialize in the constructor of this class.
(Inherited from CodeBase.)
Public propertyPresentationTemplateID
Sets or gets the PresentationTemplateID property. The default value is zero which indicates that there is no presentation template in use.
Protected propertyRunningUserControl
Gets the current running user control.
(Inherited from CodeBase.)
Public propertyText
Sets or gets the text of the button rendered. The default value is Empty.
Top
Methods

  NameDescription
Protected methodBuildHTMLComponentException
Returns an component exception in HTML format.
(Inherited from ActiveScriptingBase.)
Public methodEquals (Inherited from Object.)
Protected methodFinalize (Inherited from Object.)
Protected methodGenerateLinkTargetAttribute
Returns the attribute string to be written to the link.
(Inherited from ActiveScriptingBase.)
Protected methodGetCorrectField
Extracts the correct value from a passed in EPT field name and a static field value.
(Inherited from ActiveScriptingBase.)
Public methodGetHashCode (Inherited from Object.)
Public methodGetType (Inherited from Object.)
Public methodInvoke
This method invokes the component and writes its content into the specified stream
Protected methodMemberwiseClone (Inherited from Object.)
Protected methodReadFromApplicationCache
Returns data that is read from the application cache.
(Inherited from ActiveScriptingBase.)
Protected methodRenderButtonOnClickCode
Renders the java script code that should be invoked by the html control. This is typically done in the onclick client side event. This method is called from the RenderHtml(TextWriter) method as a part of its rendering operation.
Protected methodRenderHtml
Renders the html code. This method is automatically called by the Invoke method. This method calls the RenderButtonOnClickCode(TextWriter) method that renders the java script code that invokes the dialog.
Protected methodSetApplicationCache
Stores a string in the application cache.
(Inherited from ActiveScriptingBase.)
Protected methodSyncronizeMLC
Provides support for components that needs to be MLC aware, by localizing the supplied category or presentation template from the current document, or the preferred language of the visitor.
(Inherited from ActiveScriptingBase.)
Public methodToString (Inherited from Object.)
Protected methodWriteAttribute(TextWriter, String, String)
Writes an attribute string to the supplied stream, unless Value is an empty string or null
(Inherited from ActiveScriptingBase.)
Protected methodWriteAttribute(TextWriter, String, String, Boolean)
Writes an attribute string to the supplied stream.
(Inherited from ActiveScriptingBase.)
Top
Fields

  NameDescription
Public fieldStatic memberDefaultButtonID
Specifies the default id attribute of the rendered html button. This constant has the value CS_Preview.
Public fieldStatic memberDialogDefaultHeight
Specifies the default height (in pixels) of the dialog. This constant has the value 800.
Public fieldStatic memberDialogDefaultWidth
Specifies the default width (in pixels) of the dialog. This constant has the value 680.
Public fieldStatic memberDialogMinHeight
Specifies the smallest possible height (in pixels) of the dialog. This constant has the value 100.
Public fieldStatic memberDialogMinWidth
Specifies the smallest possible width (in pixels) of the dialog. This constant has the value 100.
Top
Remarks

This class can only be used with Internet Explorer.
Create an instance of this object, set the properties that does not have their default values you expect and call the invoke method. The class generates inline code, thus you must wrap it into a block element in order for the resulting code to validate. This class can throw exceptions thus your code should be wrapped within try/catch statements in order to avoid the entire page to crash. The code generated is fully HTML/XHTML strict compatible.
See Also

Reference