6. Application server

6.1. URLs, views and routers

6.1.1. Available classes

class smo.web.view.Action(func)[source]

Abstract base class for all action types

class smo.web.view.PostAction(func)[source]

General POST action

class smo.web.view.ModularPageViewMeta[source]

Metaclass facilitation the creation of modular page views

class smo.web.view.ModularPageView(router)[source]
Abstract base class for creating pages consisting of modules. There are different kind of modules:
  • NumericalModel model-views
  • Restructured text views
  • HTML module views
Param:smo.web.router.ViewRouter router: a router instance with which the view is registered
Class attributes:
  • label: label for the page view class (default is the page view class name)
  • controllerName: name of the AngularJS contoller for the page view (default is the page view class name + ‘Controller’)
  • showInMenu: used to specify if the page is to show in the navigation bar menus
  • modules: modules making up the page view
  • injectVariables: list of names of AngularJS dependencies required for the page view
  • jsLibraries: registry of common Java Script libraries used in the applicaions
  • googleModules: registry of common Google modules used in the applicaions
  • requireJS: list of JS libraries required by the page view
  • requireGoogle: list of Google modules required by the page view
  • template: HTML template file
Defined POST actions:
  • load: Action for loading model data
  • compute: Predefined compute action
  • startCompute:
  • loadHdfValues:
  • abort:
  • checkProgress:
  • loadEg:
  • save: Action for saving data in the DB
view(request)[source]

Entry function for processing an HTTP request

get(request)[source]

Function handling HTTP GET request

post(request)[source]

Function handling HTTP POST request

execPostAction(actionName, model, view, parameters)[source]

Executes a specific POST action registered with this view

classmethod asView()[source]

Can be used if a function-like object is needed instead of a class instance.

class smo.web.router.ViewRouter(name, appNamespace, label=None)[source]

This class creates a global registry of pages. Web pages register with an instance (router) using the @registerView decorator, and can be served when requested (from router.pages)

Parameters:name (str) – the name of the router, used as part of the name for the page URL: http::/hostname/routerName/pageName
registry = OrderedDict()

Global registry of routers

view(request, name=None)[source]

Calls a page view function with name name passing the request object to it.

smo.web.router.registerView(router, **kwargs)[source]

Class decorator used to register pages to a router

Table Of Contents

Previous topic

5. Data storage

Next topic

7. Web Server

This Page