Skip to main content

EnsPortal.Template.viewerPage

abstract class EnsPortal.Template.viewerPage extends EnsPortal.Template.standardPage

Base class for viewer-style pages.

These are pages that let the user view a list (such as messages or contents of queues) and select search criteria. Subclasses must override and provide items as follows. See the EnsPortal.EventLog class for an example; there are also others.

Subclasses must provide a searchPane, resultsPane, and detailsPane. The resultsPane should contain a and the detailsPane should contain an with a callback. Subclass must not provide a contentPane.

Note the parameters that identify the id values for the results table, page size counter, and page number counter field. These string values must match the corresponding actual id values for these components in the searchPane and resultsPane. You can set new values for the ids in your subclass if you like. Be sure to set a detailsWidth value, which will interplay with the width of the HTML contents of the detailsPane. It is a good idea to put static widths on the HTML contents of the detailsPane and have them scroll in x and y. See the EnsPortal.EventLog class for an example; there are also others.

The detailsWidth and the width of the HTML contents of the detailsPane will interact with what width you give to the menuPane style which affects the searchPane width.

In the resultsPane, there must be a . The must provide onselectrow="zenPage.selectItem(zenThis)" and onmouseoverClass="tpMouseOver". The should also provide a tableName, even if that doesn't happen until %OnAfterCreatePage, as in EnsPortal.BPInstances.

The subclass must provide an onSelectItem() method. onSelectItem() gets called automatically by the superclass method selectItem().

Subclasses should use getResultsTable() to get the handle of the results table object with no row selection made.

The main

inside the searchPane must have the id value "searchForm".

The search method that gets invoked upon user actions must be called doSearch(). The doSearch() method itself is provided in the superclass.

Subclass should implement an onAfterPageChange() method that does any actions that the page should do each time the display changes (that is, after each search). For example, a subclass might want to force certain expandos to remain open to permit easy access to the fields found there. There is no need to worry about updating the page number, however. That happens automatically.

Subclass should implement an onSearchHandler() method that doSearch() will invoke automatically. Its purpose is to get all the criteria for the search from the form fields. See the EnsPortal.EventLog class for an example; there are also others.

Subclass should implement a GetColumnsAndFrom(timeFormat) method to insert the table name and correctly formatted time string, as well as all desired columns. See examples.

The page size field should have value="#(%page.pageSize)#". The page number field should have value="#(%page.currentPage)#".

Property Inventory

Method Inventory

Parameters

parameter CANCANCELSEARCH = 0;
Indicate if can cancel search.
parameter DOMAIN = Ensemble;
Set this to the correct domain.
parameter PAGENAME = Viewer Page;
Name of this page.
parameter SETUPTEMPPORTALNODE = 0;
Indicate if ought to create tempPortalNode when page created. Used by Cancel feature for example.
parameter SHOWDETAILSTOGGLE = 1;
Indicate whether toggle button for details pane should be displayed.
parameter SHOWSEARCHTOGGLE = 1;
Indicate whether toggle button for search pane should be displayed.
parameter SHOWVALUECOLUMN = 1;
Indicate whether value column should be displayed. This can be overridden by subclasses.
parameter VALUECOLUMNNO = 1;
Number of column in query that supplies ID values. This can be overridden by subclasses.

Properties

property currentPage as %ZEN.Datatype.integer [ InitialExpression = 1 ];
Number of the current page being viewed
Property methods: currentPageDisplayToLogical(), currentPageGet(), currentPageIsValid(), currentPageLogicalToDisplay(), currentPageLogicalToOdbc(), currentPageNormalize(), currentPageSet()
property currentPageStart as %ZEN.Datatype.integer [ InitialExpression = 0 ];
Row value indicating start of current "page" of results
Property methods: currentPageStartDisplayToLogical(), currentPageStartGet(), currentPageStartIsValid(), currentPageStartLogicalToDisplay(), currentPageStartLogicalToOdbc(), currentPageStartNormalize(), currentPageStartSet()
property detailsHidden as %ZEN.Datatype.boolean [ InitialExpression = 0 ];
Flag to indicate whether the detailsPanel is currently hidden.
Property methods: detailsHiddenDisplayToLogical(), detailsHiddenGet(), detailsHiddenIsValid(), detailsHiddenLogicalToDisplay(), detailsHiddenLogicalToOdbc(), detailsHiddenLogicalToXSD(), detailsHiddenNormalize(), detailsHiddenSet(), detailsHiddenXSDToLogical()
property detailsWidth as %ZEN.Datatype.integer (MAXVAL = 80, MINVAL = 5) [ InitialExpression = 30 ];
Value to indicate the percentage of the horizontal screen which should be devoted to the details panel (if it is visible). This is exposed as a client-side property for the layout code to use the value.
Property methods: detailsWidthDisplayToLogical(), detailsWidthGet(), detailsWidthIsValid(), detailsWidthLogicalToDisplay(), detailsWidthLogicalToOdbc(), detailsWidthNormalize(), detailsWidthSet()
property hideDetailsMsg as %ZEN.Datatype.caption [ InitialExpression = $$$Text("Hide Details") ];
Hovertext used for detailsExpander Arrow
Property methods: hideDetailsMsgDisplayToLogical(), hideDetailsMsgGet(), hideDetailsMsgIsValid(), hideDetailsMsgLogicalToDisplay(), hideDetailsMsgLogicalToOdbc(), hideDetailsMsgNormalize(), hideDetailsMsgSet()
property hideSearchMsg as %ZEN.Datatype.caption [ InitialExpression = $$$Text("Hide Search") ];
Hovertext used for searchExpander Arrow
Property methods: hideSearchMsgDisplayToLogical(), hideSearchMsgGet(), hideSearchMsgIsValid(), hideSearchMsgLogicalToDisplay(), hideSearchMsgLogicalToOdbc(), hideSearchMsgNormalize(), hideSearchMsgSet()
property isFirstPage as %ZEN.Datatype.boolean;
Flag to indicate whether this is the first page of results. The flag is updated on the client after searches have completed.
Property methods: isFirstPageDisplayToLogical(), isFirstPageGet(), isFirstPageIsValid(), isFirstPageLogicalToDisplay(), isFirstPageLogicalToOdbc(), isFirstPageLogicalToXSD(), isFirstPageNormalize(), isFirstPageSet(), isFirstPageXSDToLogical()
property isLastPage as %ZEN.Datatype.boolean;
Flag to indicate whether this is the last page of results. The flag is updated on the client after searches have completed.
Property methods: isLastPageDisplayToLogical(), isLastPageGet(), isLastPageIsValid(), isLastPageLogicalToDisplay(), isLastPageLogicalToOdbc(), isLastPageLogicalToXSD(), isLastPageNormalize(), isLastPageSet(), isLastPageXSDToLogical()
property lblDetails as %ZEN.Datatype.caption [ InitialExpression = $$$TextJS("Details") ];
Property methods: lblDetailsDisplayToLogical(), lblDetailsGet(), lblDetailsIsValid(), lblDetailsLogicalToDisplay(), lblDetailsLogicalToOdbc(), lblDetailsNormalize(), lblDetailsSet()
property msgCloseDetail as %ZEN.Datatype.caption [ InitialExpression = $$$TextJS("Close this detail box.") ];
Property methods: msgCloseDetailDisplayToLogical(), msgCloseDetailGet(), msgCloseDetailIsValid(), msgCloseDetailLogicalToDisplay(), msgCloseDetailLogicalToOdbc(), msgCloseDetailNormalize(), msgCloseDetailSet()
property pageId as %ZEN.Datatype.string;
Page identifier used with temp global for cancelling search
Property methods: pageIdDisplayToLogical(), pageIdGet(), pageIdIsValid(), pageIdLogicalToDisplay(), pageIdLogicalToOdbc(), pageIdNormalize(), pageIdSet()
property pageNumberId as %ZEN.Datatype.id [ InitialExpression = "pageNumber" ];
Id of the page number field
Property methods: pageNumberIdDisplayToLogical(), pageNumberIdGet(), pageNumberIdIsValid(), pageNumberIdLogicalToDisplay(), pageNumberIdLogicalToOdbc(), pageNumberIdNormalize(), pageNumberIdSet()
property pageSizeId as %ZEN.Datatype.id [ InitialExpression = "pageSize" ];
Id of the page size field
Property methods: pageSizeIdDisplayToLogical(), pageSizeIdGet(), pageSizeIdIsValid(), pageSizeIdLogicalToDisplay(), pageSizeIdLogicalToOdbc(), pageSizeIdNormalize(), pageSizeIdSet()
property queryAtEnd as %ZEN.Datatype.boolean [ InitialExpression = 0 ];
Flag to indicate whether the query has no more rows
Property methods: queryAtEndDisplayToLogical(), queryAtEndGet(), queryAtEndIsValid(), queryAtEndLogicalToDisplay(), queryAtEndLogicalToOdbc(), queryAtEndLogicalToXSD(), queryAtEndNormalize(), queryAtEndSet(), queryAtEndXSDToLogical()
property resultsTableId as %ZEN.Datatype.id [ InitialExpression = "resultsTable" ];
Id of the results tablePane
Property methods: resultsTableIdDisplayToLogical(), resultsTableIdGet(), resultsTableIdIsValid(), resultsTableIdLogicalToDisplay(), resultsTableIdLogicalToOdbc(), resultsTableIdNormalize(), resultsTableIdSet()
property searchCriteria as %ZEN.proxyObject;
Search criteria from the client.
This is a proxy object whose contents are filled in from the search form by the doSearch() method. It is expected that the search query will use this information to determine what results to display.
Property methods: searchCriteriaGet(), searchCriteriaGetSwizzled(), searchCriteriaIsValid(), searchCriteriaNewObject(), searchCriteriaSet()
property searchJob as %ZEN.Datatype.string;
This is the $Job of the process running the search. It is used by the Cancel search process. If it is -1 then it indicates a Cancel has been issued. It is reset to '' when Search finishes.
Property methods: searchJobDisplayToLogical(), searchJobGet(), searchJobIsValid(), searchJobLogicalToDisplay(), searchJobLogicalToOdbc(), searchJobNormalize(), searchJobSet()
property searchQuery as %ZEN.Datatype.string;
Diagnostic property. This contains the most recent query.
Property methods: searchQueryDisplayToLogical(), searchQueryGet(), searchQueryIsValid(), searchQueryLogicalToDisplay(), searchQueryLogicalToOdbc(), searchQueryNormalize(), searchQuerySet()
property selectedId as %ZEN.Datatype.string;
Id of selected item in results table.
Property methods: selectedIdDisplayToLogical(), selectedIdGet(), selectedIdIsValid(), selectedIdLogicalToDisplay(), selectedIdLogicalToOdbc(), selectedIdNormalize(), selectedIdSet()
property showDetailsMsg as %ZEN.Datatype.caption [ InitialExpression = $$$Text("Show Details") ];
Hovertext used for detailsExpander Arrow
Property methods: showDetailsMsgDisplayToLogical(), showDetailsMsgGet(), showDetailsMsgIsValid(), showDetailsMsgLogicalToDisplay(), showDetailsMsgLogicalToOdbc(), showDetailsMsgNormalize(), showDetailsMsgSet()
property showSearchMsg as %ZEN.Datatype.caption [ InitialExpression = $$$Text("Show Search") ];
Hovertext used for searchExpander Arrow
Property methods: showSearchMsgDisplayToLogical(), showSearchMsgGet(), showSearchMsgIsValid(), showSearchMsgLogicalToDisplay(), showSearchMsgLogicalToOdbc(), showSearchMsgNormalize(), showSearchMsgSet()
property tablePaneUsesSQLAttrib as %ZEN.Datatype.boolean [ InitialExpression = 0 ];
Flag to indicate whether the tablePane uses the 'sql' attribute to construct queries during normal query execution. This flag determines whether the value of the 'sql' property should be set to '' (empty string) on the client after changing between pages. Initialize (or set) this property to 1 (on the server) or true (on the client) to avoid having the value reset on the client. Under normal operation the property is cleared after each page change occurs.
Property methods: tablePaneUsesSQLAttribDisplayToLogical(), tablePaneUsesSQLAttribGet(), tablePaneUsesSQLAttribIsValid(), tablePaneUsesSQLAttribLogicalToDisplay(), tablePaneUsesSQLAttribLogicalToOdbc(), tablePaneUsesSQLAttribLogicalToXSD(), tablePaneUsesSQLAttribNormalize(), tablePaneUsesSQLAttribSet(), tablePaneUsesSQLAttribXSDToLogical()
property tempPortalNode as %ZEN.Datatype.string;
This is the temp global used for cancelling search
Property methods: tempPortalNodeDisplayToLogical(), tempPortalNodeGet(), tempPortalNodeIsValid(), tempPortalNodeLogicalToDisplay(), tempPortalNodeLogicalToOdbc(), tempPortalNodeNormalize(), tempPortalNodeSet()

Methods

method %OnAfterCreatePage() as %Status
Show/hide the toggle buttons
method %OnGetTableLinkMenu(Output pMenu)
Get the contents of the link menu in the table.
Sub-class may override to add more links.
If more links are added, sub-class is to provide client methods for additional links.
method %OnGetTitle() as %String
Get the (localized) title string for the page. This should be implemented in a subclass.
method DrawDetailsContent(pID As %String) as %Status
Write out details for the given item. This should be overridden within the subclass.
method GetColumnsAndFrom(timeFormat As %String) as %String
For tablePanes which require a constructed SQL query when paging, this callback supplies the columns and FROM portions of the query.
method GetRemoteSearchJob(pRemoveTempData As %Boolean = 0) as %String [ ZenMethod ]
method OnGetRibbonInfo(Output pDisplay As %Library.Boolean, Output pViewIcons As %Library.List, Output pSortOptions As %Library.List, Output pSearchBox As %Library.Boolean, Output pRibbonTitle As %Library.String, Output pCommands As %Library.List) as %Status
Get information to display in the ribbon bar.
method PrepareCancel() as %String [ ZenMethod ]
Record in temp Portal node this pid so that client can send cancel/interrupt
method RemoveTempData() as %Integer [ ZenMethod ]
Remove Event.
method ResetQuery(next As %Boolean, pageSize As %String, timeFormat As %String, wherePlus As %String, idVal As %String, outer As %String) as %String [ ZenMethod ]
Helper method to construct a query on the server when paging. This method should be invoked from onChangeResultsPage()() for tablePanes which use the whereClause, orderbyClause and columns properties to construct queries. next is true for Next, false for Previous; pageSize is the page size; wherePlus gives the ID < or ID > string; idVal gives the id value to compare with ID, outer is either ASC or DESC depending on the current display order.
method SignalCancel(pSendStop As %Boolean = 1, pSendInterrupt As %Boolean = 1) as %Integer [ ZenMethod ]
Signal query to cancel. Use Event signal first and then try Interrupt.
clientmethod adjustExpanderText(type) [ Language = javascript ]
Helper method invoked during layout to ensure the correct hovertext is displayed for the show/hide arrow boxes
clientmethod cancelSearch() [ Language = javascript ]
Client side method to invoke the Cancel.
clientmethod doSearch() [ Language = javascript ]
Invoke a search using values from the search form.
clientmethod executeSearch() [ Language = javascript ]
Actually request the search on the server.
clientmethod getContentAreaHeight() [ Language = javascript ]
Helper method to return the height we think the content area of the viewer should have.
clientmethod getNextData(next) [ Language = javascript ]
User clicked the Next Page or Previous Page button
clientmethod getResultsTable() [ Language = javascript ]
Return the search results object.
clientmethod getSearchForm() [ Language = javascript ]
Return the search form object.
clientmethod indicateIfCancelled() [ Language = javascript ]
Change table output to Cancelled if we cancelled
clientmethod onAfterPageChange() [ Language = javascript ]
Callback invoked after the next/previous page has been loaded.
clientmethod onAfterSearch() [ Language = javascript ]
Callback for subclasses to take action when a search completes. Subclasses should ensure that they either implement behaviour to handle page navigation behaviour OR call invokeSuper(). Subclasses should also ensure that zenPage.toggleSearchState(false) is called. Pass false as second parameter if calling from error handler.
clientmethod onChangeResultsPage(next, pageSize, currentPage) [ Language = javascript ]
Callback to set up the resultset/query for paging.
clientmethod onEnsException() [ Language = javascript ]
clientmethod onSearchHandler() [ Language = javascript ]
Notify subclass that a search is being executed.
clientmethod onSelectItem() [ Language = javascript ]
Notify subclass that row was selected.
clientmethod onServerMethodError(err, errObject) [ Language = javascript ]
Override this method to allow us to report gateway timeouts in a user-friendly manner.
clientmethod onToggleDetails() [ Language = javascript ]
Callback for subclasses to take action when the details pane is toggled. The detailsHidden property should be used to determine whether the details pane is currently hidden.
clientmethod onToggleSearch() [ Language = javascript ]
Callback for subclasses to take action when the search pane is toggled. The searchHidden property should be used to determine whether the search pane is currently hidden.
clientmethod onlayoutHandler(load) [ Language = javascript ]
Adjust sizes of components on the page.
clientmethod selectItem(row) [ Language = javascript ]
Select the given item (row in table) and let the subclass take any necessary actions like updating the details pane.
clientmethod showQuery() [ Language = javascript ]
Show text of most recent query.
clientmethod toggleCancelState(inSearch, canCallServer) [ Language = javascript ]
When the Cancel button is enabled setup the cancel event. When the Cancel button is disabled handle multiple pages and change table output to say Cancelled if the search was cancelled.
clientmethod toggleDetails() [ Language = javascript ]
Expands and contracts the details pane, and ensures that the results pane is expanded to fill in the space.
clientmethod toggleSearch() [ Language = javascript ]
Expands and contracts the search pane, and ensures that the results pane is expanded to fill in the space.
clientmethod toggleSearchState(inSearch, canCallServer) [ Language = javascript ]
clientmethod updateNavigationButtons() [ Language = javascript ]
Ensure that the "Next" and "Previous" buttons behave correctly based on the data returned from the current search.
clientmethod updatePageData() [ Language = javascript ]
Helper method to record the first and last ID values for the current page.
clientmethod updatePageNumber() [ Language = javascript ]
Helper method to update the component which displays the current page number
clientmethod updatePageSize() [ Language = javascript ]
Bring the maxRows property of the tablePane into line with the current page size.

Inherited Members

Inherited Properties

Inherited Methods

Subclasses

FeedbackOpens in a new tab