Skip to main content

%ZEN.StudioDocument.AbstractEditor

Class %ZEN.StudioDocument.AbstractEditor Extends %ZEN.Component.page [ Abstract, Deprecated, System = 4 ]

Base class for Studio Document editors that use the XEDIT window within Studio.
An XEDIT document is a window within Studio with 2 panes: the upper pane contains HTML content, served by a subclass of this class; the lower pane displays an editable XML representation of the data displayed in the upper pane. This XML representation is provided by this class as well.
Subclasses of this are used to provide Studio content editors for Abstract documents served by a corresponding subclass of the %ZEN.StudioDocument.AbstractDocument class.

Parameters

RESOURCE

Parameter RESOURCE = "%Development:USE";

Require %Development:USE for access to subclasses of this page.

Properties

DocumentID

Property DocumentID As %ZEN.Datatype.string(ZENURL = "ID");

ID of current document. This is provided, as a URL parameter, by the Studio.

documentName

Property documentName As %ZEN.Datatype.string(ZENURL = "DOC");

Name of document being edited. This is provided, as a URL parameter, by the Studio.

readOnly

Property readOnly As %ZEN.Datatype.boolean [ InitialExpression = 0 ];

Indicates that this document is in read only mode. Editors should not set this property; it is set by the Studio. Use the isReadOnly method to observe this.

modified

Property modified As %ZEN.Datatype.boolean [ InitialExpression = 0 ];

Indicates that this document is modified. Use the isModified,setModified, and clearModified methods to observe and change this.

zoom

Property zoom As %ZEN.Datatype.float [ InitialExpression = 100 ];

Current zoom level (as a percentage) of this editor (if applicable). Use the getZoom and setZoom methods to modify and observe this.

editorReady

Property editorReady As %ZEN.Datatype.boolean(XMLPROJECTION = "none") [ InitialExpression = 0, Internal ];

Internal property. Client-side flag indicating that this editor is ready to process events from the Studio.

XDatas

Style

XData Style

Contents

XData Contents

Contents of editor page. Provided by subclass.

Methods

GetClassName

ClassMethod GetClassName(pName As %String) As %String [ CodeMode = expression ]

Given a document name, strip off the extension and return the class name.

%OnDrawHTMLHead

Method %OnDrawHTMLHead() As %Status

This callback is called at the start of the HTML HEAD section of the page.
This writes out the JavaScript methods expected by the Studio API.

%DrawStudioAPI

Method %DrawStudioAPI() As %Status [ Internal ]

Writes out the JavaScript methods expected by the Studio API.

%OnDrawHTMLBody

Method %OnDrawHTMLBody() As %Status [ Internal ]

This callback is called at the start of the HTML BODY section of the page.
This writes out the "result" div expected by the Studio API.

onloadHandler

ClientMethod onloadHandler() [ Language = javascript ]

This client event, if present, is fired when the page is loaded.

onStartEditor

ClientMethod onStartEditor() [ Language = javascript ]

This client event, if present, is fired when editor is loaded.

setResultsDiv

ClientMethod setResultsDiv(data) [ Language = javascript ]

Set contents of results div used to pass data to Studio.

raiseEvent

ClientMethod raiseEvent(type) [ Language = javascript ]

Raise a named event for Studio to catch.

raiseDocument

ClientMethod raiseDocument(state) [ Language = javascript ]

Raise a 'document' event to Studio.
This will set the contents of the XML pane within the Studio edit window, if applicable. state is the text that will be placed within the edit window.

raiseOpenDocument

ClientMethod raiseOpenDocument(doc) [ Language = javascript ]

Raise an OPENDOC event to Studio.
doc is the full name (with extension) of the document for Studio to open.

raiseSelect

ClientMethod raiseSelect(proplist) [ Language = javascript ]

Raise a SELECT event to Studio.
This will update the Studio Inspector.
proplist is a list of property values for inspector to show. The first property in the list is the Name of selected item. proplist is an array of objects of the form:
proplist[n] = obj;
obj.name = 'name of property'
obj.type = 'type' (STRING,INTEGER, etc.)
obj.value = value

onSetDocument

ClientMethod onSetDocument(state) [ Language = javascript ]

Notification that the user has changed the XML version of this document.
state is the contents of the XML editor pane.

onGetDocument

ClientMethod onGetDocument() [ Abstract, Language = javascript ]

Get document with current state of editor (raise event with current document in it)

onSetProperty

ClientMethod onSetProperty(prop, value) [ Abstract, Language = javascript ]

Notification that the user has changed a property using the Inspector.
prop is the property name, value is the new value.

onGetProperty

ClientMethod onGetProperty(prop) [ Abstract, Language = javascript ]

Return the value of a specific property value from the editor.

onCmdDelete

ClientMethod onCmdDelete() [ Abstract, Language = javascript ]

Notification that user has invoked the delete command.

onCmdCut

ClientMethod onCmdCut() [ Abstract, Language = javascript ]

Notification that user has invoked the cut command.

onCmdCopy

ClientMethod onCmdCopy() [ Abstract, Language = javascript ]

Notification that user has invoked the copy command.

onCmdUndo

ClientMethod onCmdUndo() [ Abstract, Language = javascript ]

Notification that user has invoked the undo command.

onCanUndo

ClientMethod onCanUndo() [ Abstract, Language = javascript ]

Test if undo is possible.

onCmdRedo

ClientMethod onCmdRedo() [ Abstract, Language = javascript ]

Notification that user has invoked the redo command.

onCmdPaste

ClientMethod onCmdPaste() [ Abstract, Language = javascript ]

Notification that user has invoked the paste command.

onSetZoom

ClientMethod onSetZoom() [ Abstract, Language = javascript ]

Notification that the zoom level of the editor has changed.

onSetReadOnly

ClientMethod onSetReadOnly() [ Abstract, Language = javascript ]

Notification that Studio has modified the ReadOnly state of the editor.

isReadOnly

ClientMethod isReadOnly() [ Language = javascript ]

Return the ReadOnly state of the editor.

getZoom

ClientMethod getZoom() [ Language = javascript ]

Return the zoom level of the editor.

setZoom

ClientMethod setZoom(zoom) [ Language = javascript ]

Set the zoom level of the editor.

isModified

ClientMethod isModified() [ Language = javascript ]

Test if the document is modified.

setModified

ClientMethod setModified() [ Language = javascript ]

Set the modified flag for this editor.

clearModified

ClientMethod clearModified() [ Language = javascript ]

Clear the modified flag for this editor.