vispa.controller package

Submodules

vispa.controller.ajax module

class vispa.controller.ajax.AjaxController(root)

Bases: vispa.controller.AbstractController

addworkspace(name, host, login, key=None, cmd=None)
connectworkspace(wid, password=None)
deleteworkspace(wid)
disconnectworkspace(wid)
editworkspace(wid, name=None, host=None, login=None, key=None, cmd=None)
feedback(content, anonymous)
forgotpassword(username)
getjson(key, wid=None)
getworkspacedata(wid=None)
localuser()
login(username, password)
register(username, email)
setjson(key, value, wid=None)
setpassword(hash, password)

vispa.controller.bus module

class vispa.controller.bus.BusController

Bases: vispa.controller.AbstractController

index(*args, **kwargs)
poll(timeoutms=10000)
send(*args, **kwargs)

vispa.controller.error module

class vispa.controller.error.ErrorController

Bases: object

This class provides custom error-catching functions that are inserted into the cherrypy config.

STATUSMAP = {'404': 'filenotfound', '403': 'forbidden', '401': 'unauthorized', '400': 'badrequest', '500': 'internalservererror', '408': 'requesttimeout'}
TMPL = "<html><head><meta http-equiv='refresh' content='0;url=%s' /></head></html>"
get_error_data()
index(*args, **kwargs)

vispa.controller.filesystem module

class vispa.controller.filesystem.FSAjaxController(mount_static=True)

Bases: vispa.controller.AbstractController

checkpermissions(path)
compress(paths, path, name='', isTmp=False)
createfile(path, name)
createfolder(path, name)
decompress(file)
exists(path, filetype=None)
expand(path)
filecount(path, watch_id=None)
filelist(path, filefilter=None, reverse=False, watch_id=None)
getfacl(path)

Get the facl of a certain path.

Parameters:path – path of interest
Returns:list of tuples with (type, user, mode[, default mode])
getfile(path, watch_id=None, utf8=False)
getsuggestions(path, length=10, append_hidden=True)
getworkspaceini(request, fail_on_missing=False)
isbrowserfile(path)
move(source, destination)
paste(path, paths, cut)
remove(path)
rename(path, name, new_name)
savefile(path, content, watch_id=None, utf8=False)
setfacl(path, type, name, mode, remove=False, recursive=False, default=False)

Set the facl entry for a certain user or group. On remote side, the commandline tool ‘setfacl’ is used, so this method delivers an interface to that.

Parameters:
  • path – path of interest
  • type – type, either ‘user’, ‘group’, ‘mask’ or ‘other’
  • name – name of the user or group of interest
  • mode – mode to be set
  • remove – remove all extended facl entries (option ‘-x’)
  • recursive – apply changes to all files and directories recursivley (option ‘-R’)
  • default – edit the default values of an facl entry (option ‘-d’)
Raises:

AjaxException if type is not ‘user’, ‘group’, ‘mask’ or ‘other’

setworkspaceini(request)
unwatch(watch_id=None)
upload(*args, **kwargs)
watch(path, watch_id)
class vispa.controller.filesystem.FSController

Bases: vispa.controller.AbstractController

getfile(path, download=None, deleteoncomplete=None, **kwargs)
thumbnail(path, width=100, height=100, **kwargs)

vispa.controller.root module

class vispa.controller.root.RootController(server)

Bases: vispa.controller.AbstractController

graceful_shutdown(*args, **kwargs)
guest_login(*args, **kwargs)
index(*args, **kwargs)
login(*args, **kwargs)
logout(path='/')
mount_extension_controller(mountpoint, controller)
password(hash, *args, **kwargs)
status(*args, **kwargs)
workspace_data(workspace=None, keys=None)

vispa.controller.usermanagement module

class vispa.controller.usermanagement.UMAjaxController(mount_static=True)

Bases: vispa.controller.AbstractController

The UMAjaxController inherits all methods, which are neccessery for the user management. Most of the function names are chosen self explanantory, while the first word corresponds to the object of interest and the rest to the action performed on the object, e.g. user_get_groups returns the groups of the user, who created the request. If the returned Objects are (lists of) database classes, they are converted into python/JSON objects with the values of interest as properties, e.g.: user_get_groups() returns a list of objects with “name” and “status” as properties.

group_add_child_group(parent_group, child_group)

Add child group to parent group.

Parent_group:concerning parent group
Child_group:concerning child group
Raises:AjaxException
group_add_manager(group, user)

Add manager to group.

Parameters:
  • group – concerning group
  • user – user to add as manager
Raises:

AjaxException

group_add_parent_group(parent_group, child_group)

Add parent group to child group.

Parent_group:concerning parent group
Child_group:concerning child group
Raises:AjaxException
group_add_user(group, user)

Add user to group

Parameters:
  • group – concerning group
  • user – user to be added
Raises:

AjaxException

group_confirm_child_group(parent_group, child_group)

Confirm child group in parent group.

Parent_group:concerning parent group
Child_group:concerning child group
Raises:AjaxException
group_confirm_user(group, user)

Confirm user.

Parameters:
  • group – concerning group
  • user – user to be confirmed
Raises:

AjaxException

group_create(name, privacy=0, password='')

Create group.

Parameters:name – name of group
Privacy:privacy
Password:password
Raises:AjaxException
group_delete(group)

Delete group.

Parameters:group – concerning group
Raises:AjaxException
group_enter_parent_group(parent_group, child_group, password='')

Enter parent group as child group.

Parent_group:concerning parent group
Child_group:concerning child group
Parameters:password – password if parent group is protected
Raises:AjaxException
group_get(group)

Get group by its name.

Parameters:group – name of the group
Returns:dict with “name”, “privacy” and “status”
Raises:AjaxException
group_get_all()

Get all groups.

Returns:list of dict with “name”, “privacy” and “status”
group_get_child_groups(group, recursion_depth=-1)

Get child groups of group.

Parameters:group – concerning group
Recursion_depth:
 recursion depth for getting child groups
Returns:list of dict with “name” and “status” of membership
Raises:AjaxException
group_get_managers(group)

Get managers of group.

Parameters:group – concerning group
Returns:list of strings (names of managers)
Raises:AjaxException
group_get_parent_groups(group, recursion_depth=-1)

Get parent groups of group.

Parameters:group – concerning group
Recursion_depth:
 recursion depth for getting parent groups
Returns:list of dict with “name” and “status” of membership
Raises:AjaxException
group_get_users(group, recursion_depth=-1)

Get users of group.

Parameters:
  • group – concerning group
  • recursion_depth – recursion_depth for getting users
Returns:

list of dict with “name” and “status” and membership

Raises:

AjaxException

group_leave_parent_group(parent_group, child_group)

Leave parent group as child group.

Parent_group:concerning parent group
Child_group:concerning child group
Raises:AjaxException
group_remove_child_group(parent_group, child_group)

Remove child group from parent group.

Parent_group:concerning parent group
Child_group:concerning child group
Raises:AjaxException
group_remove_manager(group, manager)

Remove manager from group.

Parameters:
  • group – concerning group
  • manager – manager to be removed
Raises:

AjaxException

group_remove_user(group, user)

Remove user.

Parameters:
  • group – concerning group
  • user – user to be removed
Raises:

AjaxException

group_rename(group, name)

Rename group.

Parameters:
  • group – concerning group
  • name – new name
Raises:

AjaxException

group_set_password(group, password)

Set password of group.

Parameters:
  • group – concerning group
  • password – new password
Raises:

AjaxException

group_set_privacy(group, privacy)

Set privacy of group.

Parameters:
  • group – concerning group
  • privacy – new privacy
Raises:

AjaxException

group_set_status(group, status)

Set status of group.

Parameters:
  • group – concerning group
  • status – new status
permission_create(name)

Create permission.

Parameters:name – name of new permission
Raises:AjaxException
permission_delete(permission)

Delete permission.

Parameters:permission – concerning permission
Raises:AjaxException
permission_get_all()

Get all permissions.

Returns:list of strings
Raises:AjaxException
permission_rename(permission, name)

Rename permission.

Parameters:
  • permission – concerning permission
  • name – new name of permission
Raises:

AjaxException

project_add_group(project, group)

Add group to project.

Parameters:
  • project – concerning project
  • group – group to be added
Raises:

AjaxException

project_add_manager(project, user)

Add manager to project.

Parameters:
  • project – concerning project
  • user – user to be added as manager
Raises:

AjaxException

project_add_user(project, user)

Add user to project.

Parameters:
  • project – concerning project
  • user – user to be added
Raises:

AjaxException

project_create(name)

Create project.

Parameters:name – name of new project
Raises:AjaxException
project_delete(project)

Delete project.

Parameters:project – concerning project
Raises:AjaxException
project_get_all()

Get all projects.

Returns:list of dict with “name” and “status”
Raises:AjaxException
project_get_groups(project)

Get groups of project.

Parameters:project – concerning project
Returns:list of dict with “name”
Raises:AjaxException
project_get_managers(project)

Get managers of project.

Parameters:project – concerning project
Returns:list of dict with “name”
Raises:AjaxException
project_get_roles_of_group(project, group)

Get roles of group inside project.

Parameters:
  • project – concerning project
  • group – concerning group
Returns:

list of strings

Raises:

AjaxException

project_get_roles_of_user(project, user)

Get roles of user inside project.

Parameters:
  • project – concerning project
  • user – concerning user
Returns:

list of strings

Raises:

AjaxException

project_get_users(project)

Get users of project.

Parameters:project – concerning project
Returns:list of dict with “name”
Raises:AjaxException
project_remove_group(project, group)

Remove group from project.

Parameters:
  • project – concerning project
  • group – group to be removed
Raises:

AjaxException

project_remove_manager(project, manager)

Remove manager from project.

Parameters:
  • project – concerning project
  • manager – manager to be removed
Raises:

AjaxException

project_remove_user(project, user)

Remove user from project.

Parameters:
  • project – concerning project
  • user – user to be removed
Raises:

AjaxException

project_rename(project, name)

Rename project.

Parameters:
  • project – concerning project
  • name – new name of project
Raises:

AjaxException

project_set_roles_of_group(project, group, roles)

Set roles of group inside project.

Parameters:
  • project – concerning project
  • group – concerning group
  • roles – JSON encoded list of roles with “name” and “assignment” bool
Raises:

AjaxException

project_set_roles_of_user(project, user, roles)

Set roles of user inside project.

Parameters:
  • project – concerning project
  • user – concerning user
  • roles – JSON encoded list of roles with “name” and “assignment” bool
Raises:

AjaxException

project_set_status(project, status)

Set status of project.

Parameters:
  • project – concerning project
  • status – new status of project
Raises:

AjaxException

role_create(name)

Create role.

Parameters:name – name of new role
Raises:AjaxException
role_delete(role)

Delete role.

Parameters:role – concerning role
Raises:AjaxException
role_get_all()

Get all roles.

Returns:list of strings
role_get_permissions(role)

Get permissions of role.

Parameters:role – concerning role
Returns:list of strings
Raises:AjaxException
role_rename(role, name)

Rename role.

Parameters:
  • role – concerning role
  • name – new name of role
Raises:

AjaxException

role_set_permissions(role, permissions)

Set permissions of role.

Parameters:
  • role – concerning role
  • permissions – JSON encoded list of permissions with “name” and “assignment” bool
Raises:

AjaxException

user_enter_group(group, password='')

Enter group as current user.

Parameters:
  • group – concerning group
  • password – password for protected groups
Raises:

AjaxException

user_get_groups()

Get groups of the current user.

Returns:list of dict with “name” and “status”
user_get_managed_groups()

Get managed groups of current user.

Returns:list of dict with “name”, “privacy” and “status”
user_get_managed_projects()

Get managed projects of current user.

Returns:list of dict with “name” and “status”
user_get_managed_workgroups()

Get managed workgroups of current user.

Returns:list of dict with “name”
user_get_permissions(project)

Get permissions of current user in project.

Parameters:project – concerning project
Returns:list of strings
Raises:AjaxException
user_get_projects()

Get projects of current user.

Returns:list of dict with “name” and “status”
user_get_roles(project)

Get roles of current user in project.

Parameters:project – concerning project
Returns:list of dict with “name”
Raises:AjaxException
user_get_workgroups()

Get workgroups of current user.

Returns:list of dict with “name”
user_leave_group(group)

Leave group as current user.

Parameters:group – concerning group
Raises:AjaxException
user_leave_workgroup(workgroup)

Leave workgroup as current user.

Raises:AjaxException
workgroup_add_manager(workgroup, user)

Add manager to workgroup.

Parameters:
  • workgroup – concerning workgroup
  • user – user to be added as manager
Raises:

AjaxException

workgroup_add_user(workgroup, user)

Add user to workgroup.

Parameters:
  • workgroup – concerning workgroup
  • user – user to be added
Raises:

AjaxException

workgroup_create(name)

Create workgroup.

Parameters:name – name of new workgroup
Raises:AjaxException
workgroup_delete(workgroup)

Delete workgroup.

Parameters:workgroup – workgroup to be deleted
Raises:AjaxException
workgroup_get_managers(workgroup)

Get managers of workgroup.

Parameters:workgroup – concerning workgroup
Returns:list of dict with “name”
Raises:AjaxException
workgroup_get_users(workgroup)

Get users of workgroup.

Parameters:workgroup – concerning workgroup
Returns:list of dict with “name”
Raises:AjaxException
workgroup_remove_manager(workgroup, manager)

Remove manager from workgroup.

Parameters:
  • workgroup – concerning workgroup
  • manager – manager to be removed
Raises:

AjaxException

workgroup_remove_user(workgroup, user)

Remove user from workgroup.

Parameters:
  • workgroup – concerning workgroup
  • user – user to be removed
Raises:

AjaxException

workgroup_rename(workgroup, name)

Rename workgroup.

Parameters:
  • workgroup – concerning workgroup
  • name – new name of workgroup
Raises:

AjaxException

Module contents

class vispa.controller.AbstractController(mount_static=True)

Bases: object

cache(workspace_id, key)
convert(value, flag)
get(key, *args, **kwargs)
mount_static(path=None, url='static')
release()
release_database()
release_session()
set_cache(workspace_id, item, key=None)
class vispa.controller.StaticController(path)

Bases: object

vispa.controller.strongly_expire(func)

Decorator that sends headers that instruct browsers and proxies not to cache.