Template for pages which need to be able to interact with Source Control hooks.
This class extends the basic source control interactions implemented in %CSP.Portal.SourceControl.Base, which
should be the primary reference for implementing pages that need to interact with source control hooks.
property msgDocReadOnly
as %ZEN.Datatype.caption [ InitialExpression = $$$TextJS("This document is read only") ]; property onnotifyView
as %ZEN.Datatype.eventHandler [ InitialExpression = "zenPage.onDocumentReload(reason)" ];
onnotifyView event handler:
This event is fired when a dataController connected to this dataView
raises an event.
property studioMode
as %ZEN.Datatype.boolean(ZENURL="STUDIO"); property tipCSVWizard
as %ZEN.Datatype.caption [ InitialExpression = $$$Text("Create a new document from a sample") ]; property tipCompile
as %ZEN.Datatype.caption [ InitialExpression = $$$Text("Compile this document into executable code") ]; property tipContractAll
as %ZEN.Datatype.caption [ InitialExpression = $$$Text("Contract the diagram") ]; property tipDelete
as %ZEN.Datatype.caption [ InitialExpression = $$$Text("Delete the current document") ]; property tipExpandAll
as %ZEN.Datatype.caption [ InitialExpression = $$$Text("Expand the diagram") ]; property tipExport
as %ZEN.Datatype.caption [ InitialExpression = $$$Text("Export the current document to a file") ]; property tipGen
as %ZEN.Datatype.caption [ InitialExpression = $$$Text("Save this document and generate classes") ]; property tipImport
as %ZEN.Datatype.caption [ InitialExpression = $$$Text("Import a document from a file") ]; property tipImportLegacy
as %ZEN.Datatype.caption [ InitialExpression = $$$Text("Import a document from a file that was exported in legacy format") ]; property tipNew
as %ZEN.Datatype.caption [ InitialExpression = $$$Text("Create a new document") ]; property tipOpen
as %ZEN.Datatype.caption [ InitialExpression = $$$Text("Load an existing document") ]; property tipSave
as %ZEN.Datatype.caption [ InitialExpression = $$$Text("Save this document") ]; property tipSaveAs
as %ZEN.Datatype.caption [ InitialExpression = $$$Text("Save this document with a new name") ];
This callback is called at the start of the HTML HEAD section of the page (just after the title).
It allows a page to write out meta tags, if desired.
The default implementation writes out an IE-specific meta tag to ensure that IE 9 and 10 don't fall back
into Compatibility Mode when we are returning an HTML5 page (i.e. cssLevel is set to 3).
classmethod GetHyperEventResources(pMethod As %String = "")
as %String
Callback to return a list of resources required for a specific HyperEvent.
The user must have sufficient privileges on one of the resource/permission pairs
to be permitted to execute the hyperevent. An empty string implies the user already
has sufficient privileges for the ZenMethod specified in pMethod.
method IsDocReadOnly()
as %Boolean
[ ZenMethod ]
Avoid writing out the session cookie if we are in a Studio session.
method canUserModify(saveAs)
[ Language = javascript ]
Test if the user has write privilege.
method checkStudioHyperEvents()
[ Language = javascript ]
method escapeCData(text)
[ Language = javascript ]
method fixDocumentTitle()
[ Language = javascript ]
method getIsReadOnly()
as %Boolean
[ Language = javascript ]
method getPageTitle()
as %String
[ Language = javascript ]
Get the title string to add to the locator row.
This should be implemented in a subclass.
method grayOutButtons()
[ Language = javascript ]
Gray out ribbon buttons 'Save', 'Save As', 'Compile', and 'Delete'. Invoked in case of read-only mode.
method onloadHandler()
[ Language = javascript ]
Add check to ensure that we correctly load documents on the client when source control hooks are in use.
Also set up a timer to ensure we don't hit timeouts while editing documents in Studio, as well as
When in Studio mode, also detect whether we are running IE10, as we need to save documents differently if that
is the case.
method raiseEvent(type, value)
[ Language = javascript ]
Note that special handling is required for the LOADCOMPLETE event.
We need to ensure that Studio gets the LOADCOMPLETE event, as well as updating the
document title later to ensure the correct reload behaviour.
The timeout is extra-long for IE9 and up because the main page's onload() sequence may be
triggered before the SVG is fully loaded, so we need to build in enough time to let the
SVG load before we update the title.
method setModified(flag)
[ Language = javascript ]
Set the modified flag for the page.
method setReadOnly(readOnly)
[ Language = javascript ]
Set readOnly to the value of readOnly.
Subclasses MUST implement this method to update the controls on the page
so that the page's behaviour actually matches the value of the readOnly flag.
method setResultsDiv(type, value, usingDOMElement)
[ Language = javascript ]
Set data into the results element for Studio.
Note that usingDOMElement should only be true under IE10.
method toggleReadOnly()
[ Language = javascript ]
method toggleSVGElements(show)
[ Language = javascript ]
Helper method to hide or show SVG elements when opening a popup.
This is primarily to ensure that we don't run into issues with IE and
the Adobe plugin when the popup window also uses SVG.
method updateJSONSCReadOnly(jsonObject)
[ Language = javascript ]