App Framework Reference

Module API

class Splunk.Module

The Splunk.Module class is an abstract module, which is the base class from which all other modules inherit. The class provides the basic methods required for interaction with views.

Language Binding

JavaScript

Inheritance

Abstract base class.

See: $SPLUNK_HOME/share/splunk/search_mrsparkle/modules/AbstractModule.js

Implementation Location

$SPLUNK_HOME/etc/apps/<appName>/appserver/modules/<moduleName>

Constructor

Constants

ALWAYS_REQUIRE validateHierarchy() If your module requires children to function properly, set this.childEnforcement = Splunk.Module.ALWAYS_REQUIRE to ensure that anyone consuming your module receives a hierarchy validation error.
NEVER_ALLOW validateHierarchy() Anyone consuming your module does not receive a hierarchy validation error.
CANCEL isReadyForContextPush() (Return value override) No selected state, stop context pushes.
CONTINUE isReadyForContextPush() (Return value override) Job is finished, push context.
DEFER isReadyForContextPush() (Return value override) Job is not finished, do not push context.

Methods

abortGetResults() Destroys the previously submitted XHR request.
addChild() Adds the specified module as a child of the current instance.
applyContext() Handles context changes that flow from descendants to ancestors.
displayInlineErrorMessage() Displays the specified message in the module.
ensureFreshContexts() Propagates context changes downstream.
getAncestors() Gets an ordered list of calling module ancestors.
getContext() Gets the most current search context.
getDescendants() Gets an ordered list of all module descendants.
getGroupName() Gets the current module group name.
getLoadState() Gets the module load state.
getModifiedContext() Provides a proxy for getContext(), by default.
getModulesInTree() Gets a list of all modules in the current module tree.
getParam() Gets the parameter value for the specified parameter key.
getResultParams() Get modified/refined/extended parameters.
getResults() Gets the calling module HTML content to render from the server.
getResultsCompleteHandler() Handles AJAX request completion.
getResultsErrorHandler() Handles an AJAX request returning an error.
getResultURL() Gets the URI query string of the path of the calling module controller.
getRootAncestor() Gets the root module in the module tree.
haveResultParamsChanged() Determines if the current result parameters have changed.
hide() Sets the calling module invisibility mode.
hideDescendants() Hides the calling module and all descendant modules.
importParams() Imports module startup parameters.
initialize() Performs any needed module initialization.
isPageLoadComplete() Gets the page loaded status.
isReadyForContextPush() Sets up the contract for propagating the context to child modules.
markPageLoadComplete() Sets the page load completion status.
mergeLoadParamsIntoContext() Pushes non-search parameters to child modules.
onBeforeJobDispatched() Provides a mechanism for changing job settings before job dispatch.
onContextChange() Handles the context change event.
onLoadStatusChange() Handles load status change notification.
onResultsRendered() Performs any actions required after results are rendered.
onViewDataChange() Generate module HTML content in response to a GET request.
passContextToParent() Passes the current module context to the parent module.
pushContextToChildren() Passes the current module context to all child modules.
pushViewDataChange() Broadcasts that view data has been changed by the controller.
removeChild() Removes the specified child module from the current module hierarchy.
renderResults() Inserts content into the module results container within the DOM.
requiresAsynchonousLoading() Indicates if the module hierarchy must be complete before loading.
requiresDispatch() Indicates whether or not a context with dispatched search is needed.
reset() Resets the current module context and UI.
resetContext() Resets the current context.
resetUI() Resets the module user interface to an initial state.
resizeWidthToParent() Resizes the current module to the parent module width.
setChildContextFreshness() Marks the freshness of the context held by child modules.
setLoadState() Changes the current module load state.
setParam() Sets the value of the specified parameter.
show() Makes the current module visible.
showDescendants() Sets child modules to visible.
snapshotParamset() Gets a snapshot of the current state of module parameters.
someChildrenRequireDispatch() Determines if any immediate children require a dispatched search.
validateHierarchy() Validates the current module hierarchy.
withEachAncestor() Passes each ancestor module to the specified callback function.
withEachChild() Passes each immediate child to the specified callback function.
withEachDescendant() Passes each descendant module to the specified callback function.