Site:Interfaces
From Metrixstream
Revision as of 10:33, 2 May 2012 by MetrixAdmin (Talk | contribs)
Contents |
Introduction
Contexts are objects that encapsulate various functionality available to you during integration.
ApplicationContext
- getDatabaseContext()
- getGlobalContext()
- getAuthContext()
- getRenderContext()
AuthContext
The AuthContext is responsible for providing all necessary functionality for authenticated users and their various access.
- isLoggedIn()
- @return a boolean on whether or not there is an authenticated user.
- hasUser()
- @return a boolean on whether or not there is an authenticated user and if that authenticated user is a User object.
- isUser(id)
- @return a boolean on whether the param:id represents the current authenticated user (if there is an authenticated user).
- getUser()
- @return a User object for the authenticated user.
- hasOwner()
- @return a boolean on whether or not there is an authenticated user and if that authenticated user is an Owner object.
- getOwner()
- @return a Owner object for the authenticated user.
- isAdministrator()
- @return a boolean on whether or not the authenticated user is an administrator.
- isModerator()
- @return a boolean on whether or not the authenticated user is a moderator.
iBackendContext
- getInternalName()
- getDisplayName()
- getLayoutPosition()
- filterSortParam(sort, whitelist)
- execute(ApplicationContext app, ScopeContext scope, PageContext page)
DatabaseContext
The DatabaseContext is responsible for providing the necessary functionality to interact with all relevant databases.
- getNames()
- @return an Array of the available database names.
- closeAll()
- closes all of the database connections.
- getDB(name)
- @return an SQLDB object.
- getDBOption(name, option)
- @return a database option; options include: backups
LicenseContext
The LicenseContext is responsible for providing information stored within the license.
- getId()
- @return the license id.
- getConfigValue(key)
- @return the configuration value that is stored for param:key.
- getServerConfigValue(key)
- @return the server configuration value that is stored for param:key; the server represents the actual server that is executing this function call... meaning the return value may change depending on which server is executing this function.
- isEnabled(option)
- @return a boolean on whether or not param:option is supported by the license.
- getMerchants()
- @return an Array of associative arrays representing all the merchants within the license.
- getServers()
- @return an Array of associative arrays representing all the servers within the license.
PageContext
The PageContext...
- getUrlArgs()
- getContextArgs()
- getConfigParam()
RenderContext
- getRenderOutput()
- @return a RenderOutput object.
RenderOutput
- setCacheable(value)
- sets whether or not this output can be cached.
- getHDF()
- @return an iHDF object.
ScopeContext
The ScopeContext provides relevant scope to consider during various backend processes. At it's core the ScopeContext is a hash-table of objects.
- has(key)
- @return a boolean on whether or not this key exists.
- get(key, default = "")
- @return an object for the relevant key.
- getObjId(key, default = "")
- @return the id of the object if the value stored is an actual object and has an id field.
- getKeys()
- @return an Array of all keys.
TaskContext
The TaskContext is responsible for providing access to the various requirements of an background task.
- getLicenseContext()
- @return a LicenseContext.
- getDatabaseContext()
- @return a DatabaseContext.