controllers

package
v0.0.0-...-5e0bae8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 26, 2017 License: GPL-3.0, LGPL-3.0 Imports: 31 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// CommonLess is the list of Less assets to import by the web client
	// that are common to the frontend and the backend. All less assets are
	// cat'ed together in the given order before being compiled.
	CommonLess []string
	// CommonCSS is the list of CSS files to include without compilation both
	// for the frontend and the backend.
	CommonCSS []string
	// CommonJS is the list of JavaScript assets to import by the web client
	// that are common to the frontend and the backend
	CommonJS []string
	// BackendLess is the list of Less assets to import by the web client
	// that are specific to the backend. All less assets are
	// cat'ed together in the given order before being compiled.
	BackendLess []string
	// BackendCSS is the list of CSS files to include without compilation for
	// the backend.
	BackendCSS []string
	// BackendJS is the list of JavaScript assets to import by the web client
	// that are specific to the backend.
	BackendJS []string
	// FrontendLess is the list of Less assets to import by the web client
	// that are specific to the frontend. All less assets are
	// cat'ed together in the given order before being compiled.
	FrontendLess []string
	// FrontendCSS is the list of CSS files to include without compilation for
	// the frontend.
	FrontendCSS []string
	// FrontendJS is the list of JavaScript assets to import by the web client
	// that are specific to the frontend.
	FrontendJS []string
	// LessHelpers are less files that must be imported for compiling any assets
	LessHelpers []string
)
View Source
var MethodAdapters = map[string]methodAdapter{
	"Create":     createAdapter,
	"Write":      writeAdapter,
	"Onchange":   onchangeAdapter,
	"Read":       readAdapter,
	"SearchRead": searchReadAdapter,
	"FieldsGet":  fieldsGetAdapter,
}

MethodAdapters is a map giving the adapter to call for each method

Functions

func ActionLoad

func ActionLoad(c *server.Context)

ActionLoad returns the action with the given id

func ActionRun

func ActionRun(c *server.Context)

ActionRun runs the given server action

func AssetsBackendCSS

func AssetsBackendCSS(c *server.Context)

AssetsBackendCSS returns the compiled CSS for the backend assets

func AssetsCommonCSS

func AssetsCommonCSS(c *server.Context)

AssetsCommonCSS returns the compiled CSS for the common assets

func AssetsFrontendCSS

func AssetsFrontendCSS(c *server.Context)

AssetsFrontendCSS returns the compiled CSS for the frontend assets

func BootstrapTranslations

func BootstrapTranslations(c *server.Context)

BootstrapTranslations returns data about the current language

func CSSList

func CSSList(c *server.Context)

CSSList returns the list of CSS files

func CallButton

func CallButton(c *server.Context)

CallButton executes the given method of the given model and returns the result only if it is an action

func CallKW

func CallKW(c *server.Context)

CallKW executes the given method of the given model

func ChangePassword

func ChangePassword(c *server.Context)

ChangePassword is called by the client to change the current user password

func CompanyLogo(c *server.Context)

CompanyLogo serves the logo of the company

func Execute

func Execute(uid int64, params CallParams) (res interface{}, rError error)

Execute executes a method on an object

func GetSessionInfo

func GetSessionInfo(c *server.Context)

GetSessionInfo returns the information fo the current session to the client

func Image

func Image(c *server.Context)

Image serves the image stored in the database (base64 encoded) in the given model and given field

func JSList

func JSList(c *server.Context)

JSList returns the list of JS files

func Load

func Load(c *server.Context)

Load executes a GET request and returns the values

func LoadLocale

func LoadLocale(c *server.Context)

LoadLocale returns the locale's JS file

func LoginGet

func LoginGet(c *server.Context)

LoginGet is called when the client calls the login page

func LoginPost

func LoginPost(c *server.Context)

LoginPost is called when the client sends credentials from the login page

func LoginRequired

func LoginRequired(c *server.Context)

LoginRequired is a middleware that redirects to login page non logged in users.

func Logout

func Logout(c *server.Context)

Logout the current user and redirect to login page

func MenuLoadNeedaction(c *server.Context)

MenuLoadNeedaction serves the number of objects that need an action in the given menu IDs

func Modules

func Modules(c *server.Context)

Modules returns the list of installed modules to the client

func QWeb

func QWeb(c *server.Context)

QWeb returns a concatenation of all client qweb templates

func SearchRead

func SearchRead(c *server.Context)

SearchRead returns Records from the database

func SessionInfo

func SessionInfo(sess sessions.Session) gin.H

SessionInfo returns a map with information about the given session

func VersionInfo

func VersionInfo(c *server.Context)

VersionInfo returns server version information to the client

func WebClient

func WebClient(c *server.Context)

WebClient is the controller for the application main page

Types

type CallParams

type CallParams struct {
	Model  string                     `json:"model"`
	Method string                     `json:"method"`
	Args   []json.RawMessage          `json:"args"`
	KWArgs map[string]json.RawMessage `json:"kwargs"`
}

CallParams is the arguments' struct for the Execute function. It defines a method to call on a model with the given args and keyword args.

type ChangePasswordData

type ChangePasswordData struct {
	Fields []struct {
		Name  string `json:"name"`
		Value string `json:"value"`
	} `json:"fields"`
}

ChangePasswordData is the params format passed to ChangePassword controller

type Menu struct {
	ID          string
	Name        string
	Children    []Menu
	ActionID    string
	ActionModel string
	HasChildren bool
	HasAction   bool
}

A Menu is the representation of a single menu item

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL