This is the multi-page printable view of this section. Click here to print.

Return to the regular view of this page.

Reference

Low level reference docs for your project.

This is a placeholder page that shows you how to use this template site.

If your project has an API, configuration, or other reference - anything that users need to look up that’s at an even lower level than a single task - put (or link to it) here. You can serve and link to generated reference docs created using Doxygen, Javadoc, or other doc generation tools by putting them in your static/ directory. Find out more in Adding static content. For OpenAPI reference, Docsy also provides a Swagger UI layout and shortcode that renders Swagger UI using any OpenAPI YAML or JSON file as source.

1 - API Reference

The API reference details the methods available in the alt-seven framework.

The API reference details the methods available in the alt-seven framework.

Modules

  • a7

    • init( options )
  • a7.components

    • a7.components.model

      • The built-in model of the alt-seven framework. The a7.model component uses this model object by default to implement the model functionality of the application.
    • a7.components.User

      • User is a generic object with no pre-set properties to be used to hold arbitrary properties set by the authentitcation endpoint of the program and returned during the authentication routine.

      methods - getMemento - Returns whatever arbitrary properties have been set by the application.

    • a7.components.View The View component is the base component for all views in alt-seven applications. A view is created using the Constructor component, which allows event bindings of the object level events in the View component to be added to the new view.

      properties - template - Each view must have a template property that must return a string representation of the HTML for the view. The template property may be a string or a function that returns a string so that views can be dynamically rendered. - skipRender - boolean - Determines whether a view should be rendered.

      methods

      • config()
      • getState()
        • Returns a structure of the current state of the view.
      • setState( args )
        • Sets the args structure as the current state of the view.
      • addChild( view )
        • Adds another view as a child of the current view.
      • removeChild( view )
        • Removes a view from the stack of child views of the current view.
      • clearChildren()
        • Removes all child views of the current view.
      • render()
        • Renders the current view. Render returns an HTML string representing the current view. The method may contain template literal or a function that produces an HTML string.
      • getParent()
        • Returns the parent view of the current view.
      • shouldRender()
        • Returns a boolean value whether the current view should be rendered based on whether skipRender is set to true or false.
      • onRendered()
        • Renders the child views of the current view after the current view is rendered. Called automatically by the framework.
      • checkRenderStatus()
        • First checks if the document node specified by the view’s selector property exists. If the node does not exist, it unregisters the view from the application.
        • Checks the isTransient property of the view. If it is set to true, the component sets a timer and calls itself until the application timeout value is reached.
  • a7.console

    • init( options )
    • addMessage ( message (""), date (new Date()), source (“local|websocket”), level (ERROR,FATAL,INFO,TRACE,WARN) )
      • Sends a message to the console. This method is called by a7.log when logging is enabled and the console is enabled. All logged messages are posted to the console.
  • a7.error

    • init()
    • captureError (msg, url, lineNo, columnNo, error)
      • This method is called when there are runtime errors in the application.
  • a7.events

    • init()
    • publish ( topic, info )
      • This method calls an event and passes the info object to the event.
    • subscribe( topic, listener )
      • Creates an event listener in the application for the topic, and specifies the listener object used to handle the event when an event is published.
  • a7.log

    • init()

    • error( message )

      • Logs an error-level message.
    • fatal( message )

      • Logs a fatal-level message.
    • info( message )

      • Logs an info-level message.
    • trace( message )

      • Logs a trace-level message.
    • warn( message )

      • Logs a warn-level message.

      • All of these methods log the passed message according to the level of the logged message.

  • a7.model

    • This component implements the model funcitonality of the framework, which is used to store instantiated views and other arbitrary data by the application. By default, the framework uses the a7.components.model object to implement this functionality, but the application may specify any JavaScript object as the model for the applicatiion as long as it implements the spcified methods of the a7.model component.

    methods

    • init( options )
    • destroy( key )
      • Deletes the key from the model.
    • get( key )
      • Retreives the value in the model by key.
    • set( key, value )
      • Sets the value in the model by key,
    • exists( key )
      • Checks whether the key existing in the model.
  • a7.remote

    methods

    • init( modules )

    • fetch( uri, params, secure)

      • Handles a remote HTTP call to the specified uri. Returns a promise.
    • invoke( moduleAction, params)

      • Calls the specified action in the specified modules, passing params as an argument, in the format invoke( module.action, params ).
    • getToken

      • Returns the session token for the current user.
    • invalidateToken

      • Removes the session token for the current user.
    • getSessionTimer

      • Returns the timer object set by the SetTimeout() function that tracks the current user session.
    • webSocket( wsServer, messageHandler, isJSON )

      • Creates a websocket connection to the specified wsServer and passes messages to the messageHandler function.

    auth - login(params) - Calls a server-side authentication endpoint specified in the application config. - logout(params) - Calls a server-side logout endpoint specified in the application config. - refresh(params) - Calls a server-side endpoint specified in the application config to keep the current user session alive.

  • a7.router

    • init(options)
      • Called by the framework to initialize the router if enabled.
    • open(path, params)
      • Opens the specified path and publishes the mapped event with the params.
    • add(path, handler)
      • Creates a new route path and maps the handler to it.
    • find(path)
      • Returns a route map by path.
    • match(path)
      • Checks whether the specified path is mapped in the routes.
  • a7.security

    • init()
      • Called by the framework to initialize the security module.
    • invalidateSession()
      • Ends the current session and sets a blank User object in the model as the current system user.
    • isAuthenticated()
      • Checks whether the current user is authenticated.
  • a7.ui properties

    • selectors
      • The collection of document selectors set by the application.
    • views
      • The collection of View objects set by the application. methods
    • init()
      • Called by the framework to initialize the ui module.
    • getEvents()
      • Gets all of the browser events listed in the UI module.
    • getSelector(name)
      • Returns a specified selector by name.
    • setSelector(name, selector)
      • Sets a specified selector by name.
    • getNode(selector)
      • Gets a node in the DOM by selector.
    • register(view)
      • Registers the specified view in the application.
    • unregister(id)
      • Unregisters the view.
    • getView(id)
      • Returns a view by its ID.
    • enqueueForRender(id)
      • Adds the view to the render queue by ID.
    • removeView(id)
      • Removes the view from the application by ID.
  • a7.util

    • split (val)
      • Split the val by commas
    • extractLast(term)
      • Get the last term from a comma-separated list
    • encode64(input)
    • decode64(input)
    • leadingZero(n)
    • dynamicSort( property )
    • yesNo( val )
    • isValidDate( d )
    • id()
    • tryCatch(fn,ctx,args)
    • getNumberValue(value)
    • isNumeric(num)
    • getOffset(selector)