Open source cms for mobile and desktop websites

nive.portal

The portal manages applications and is the pyramid_ or wsgi_ root. There is only one portal in each instance.

The portal handles the cms applications and global components like the user database. Applications have to be registered by calling Register(application) on initialization.

  • Routes url names to applications
  • Calls Startup() for each registered application on server startup
  • Provides connection start and finish events
  • Collects all registered security groups from applications

Allows by default all permissions for admins

__acl__ = (Allow, "group:admin", ALL_PERMISSIONS)

Also redirects for login, forbidden, logout and default url are configured here

portalDefaultUrl = "/website/"
loginUrl = "/userdb/udb/login"
loginSuccessUrl = "/website/"
forbiddenUrl = "/userdb/udb/login"
logoutUrl = "/userdb/udb/logout"
logoutSuccessUrl = "/website/"
accountUrl = "/userdb/udb/update"

Interface: IPortal

class nive.portal.Portal(configuration=None)
Register(comp, name=None)

Register an application or component. This is usually done in the pyramid app file. The registered component is automatically loaded and set up to work with url traversal.

comp can be one of the following cases

  • AppConf object
  • AppConf string as python dotted name
  • python object. Requires name parameter or comp.id attribute

name is used as the url path name to lookup the component.

Startup(pyramidConfig, debug=False, **kw)

Startup is called once by the main function of the pyramid wsgi app on server startup. All configuration, registration and setup is handled during the startup call.

Calls Setup(), StartRegistration(), FinishRegistration(), Run() for each registered application.

pyramidConfig is the pyramid registration configuration object for views and other system components.

debug signals whether running in debug mode or not.

GetApps(interface=None)

Returns registered components and apps as list.

StartConnection(event)

Called by pyramid for each new connection with event as parameter. The current request stored as event.request. Stores the authenticated user event.request.environ[“REMOTE_USER”].

Event: - start(event)

FinishConnection(request)

Called by pyramid on termination for each connection with request as parameter.

Event: - finish(request)

GetGroups(sort=u'id', visibleOnly=False)

returns all groups registered by components as list

RegisterGroups(component)

Collects groups from the component

© 2013 Nive GmbH