handlers

package
v2.0.6+incompatible Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2019 License: GPL-3.0 Imports: 28 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Env

type Env struct {
	// DB is the database connection
	DB models.Datastore
}

Env is a structure used to pass objects throughout the application.

func (*Env) AppMiddleware

func (env *Env) AppMiddleware(h models.AppHandlerFunc) http.Handler

AppMiddleware is the application handlers wrapper handling the "func() *models.AppError" functions

func (*Env) ArchiveStorageHandler

func (env *Env) ArchiveStorageHandler(w http.ResponseWriter, r *http.Request) *helpers.AppError

ArchiveStorageHandler archives the storage with the requested id

func (*Env) AuthenticateMiddleware

func (env *Env) AuthenticateMiddleware(h http.Handler) http.Handler

AuthenticateMiddleware check that a valid JWT token is in the request, extract and store user informations in the Go http context

func (*Env) AuthorizeMiddleware

func (env *Env) AuthorizeMiddleware(h http.Handler) http.Handler

AuthorizeMiddleware check that the user extracted from the JWT token by the AuthenticateMiddleware has the permissions to access the requested resource

func (*Env) CaptchaHandler

func (env *Env) CaptchaHandler(w http.ResponseWriter, r *http.Request) *helpers.AppError

CaptchaHandler returns a captcha image with an uuid

func (*Env) ContextMiddleware

func (env *Env) ContextMiddleware(h http.Handler) http.Handler

ContextMiddleware initialize the request context and setup initial variables

func (*Env) ConvertProductEmpiricalToLinearFormulaHandler

func (env *Env) ConvertProductEmpiricalToLinearFormulaHandler(w http.ResponseWriter, r *http.Request) *helpers.AppError

ConvertProductEmpiricalToLinearFormulaHandler returns the converted formula

func (*Env) CreateEntityHandler

func (env *Env) CreateEntityHandler(w http.ResponseWriter, r *http.Request) *helpers.AppError

CreateEntityHandler creates the entity from the request form

func (*Env) CreatePersonHandler

func (env *Env) CreatePersonHandler(w http.ResponseWriter, r *http.Request) *helpers.AppError

CreatePersonHandler creates the person from the request form

func (*Env) CreateProductHandler

func (env *Env) CreateProductHandler(w http.ResponseWriter, r *http.Request) *helpers.AppError

CreateProductHandler creates the product from the request form

func (*Env) CreateStorageHandler

func (env *Env) CreateStorageHandler(w http.ResponseWriter, r *http.Request) *helpers.AppError

CreateStorageHandler creates the storage from the request form

func (*Env) CreateStoreLocationHandler

func (env *Env) CreateStoreLocationHandler(w http.ResponseWriter, r *http.Request) *helpers.AppError

CreateStoreLocationHandler creates the store location from the request form

func (*Env) DeleteEntityHandler

func (env *Env) DeleteEntityHandler(w http.ResponseWriter, r *http.Request) *helpers.AppError

DeleteEntityHandler deletes the entity with the requested id

func (*Env) DeletePersonHandler

func (env *Env) DeletePersonHandler(w http.ResponseWriter, r *http.Request) *helpers.AppError

DeletePersonHandler deletes the person with the requested id

func (*Env) DeleteProductHandler

func (env *Env) DeleteProductHandler(w http.ResponseWriter, r *http.Request) *helpers.AppError

DeleteProductHandler deletes the store location with the requested id

func (*Env) DeleteStorageHandler

func (env *Env) DeleteStorageHandler(w http.ResponseWriter, r *http.Request) *helpers.AppError

DeleteStorageHandler deletes the storage with the requested id

func (*Env) DeleteStoreLocationHandler

func (env *Env) DeleteStoreLocationHandler(w http.ResponseWriter, r *http.Request) *helpers.AppError

DeleteStoreLocationHandler deletes the store location with the requested id

func (*Env) DeleteTokenHandler

func (env *Env) DeleteTokenHandler(w http.ResponseWriter, r *http.Request) *helpers.AppError

DeleteTokenHandler actually reset the token cookie

func (*Env) DownloadExportHandler

func (env *Env) DownloadExportHandler(w http.ResponseWriter, r *http.Request) *helpers.AppError

DownloadExportHandler serves the temporary export files

func (*Env) FakeHandler

func (env *Env) FakeHandler(w http.ResponseWriter, r *http.Request) *helpers.AppError

FakeHandler returns true

func (*Env) FormatProductEmpiricalFormulaHandler

func (env *Env) FormatProductEmpiricalFormulaHandler(w http.ResponseWriter, r *http.Request) *helpers.AppError

FormatProductEmpiricalFormulaHandler returns the sorted formula

func (*Env) GetEntitiesHandler

func (env *Env) GetEntitiesHandler(w http.ResponseWriter, r *http.Request) *helpers.AppError

GetEntitiesHandler returns a json list of the entities matching the search criteria

func (*Env) GetEntityHandler

func (env *Env) GetEntityHandler(w http.ResponseWriter, r *http.Request) *helpers.AppError

GetEntityHandler returns a json of the entity with the requested id

func (*Env) GetEntityPeopleHandler

func (env *Env) GetEntityPeopleHandler(w http.ResponseWriter, r *http.Request) *helpers.AppError

GetEntityPeopleHandler return the entity managers

func (*Env) GetEntityStockHandler

func (env *Env) GetEntityStockHandler(w http.ResponseWriter, r *http.Request) *helpers.AppError

GetEntityStockHandler returns a json of the stock of the entity with the requested id

func (*Env) GetExposedProductsHandler

func (env *Env) GetExposedProductsHandler(w http.ResponseWriter, r *http.Request) *helpers.AppError

GetExposedProductsHandler returns a json of the product with the requested id

func (*Env) GetOtherStoragesHandler

func (env *Env) GetOtherStoragesHandler(w http.ResponseWriter, r *http.Request) *helpers.AppError

GetOtherStoragesHandler returns a json list of the storages matching the search criteria in other entities with no storage details

func (*Env) GetPeopleHandler

func (env *Env) GetPeopleHandler(w http.ResponseWriter, r *http.Request) *helpers.AppError

GetPeopleHandler returns a json list of the people matching the search criteria

func (*Env) GetPersonEntitiesHandler

func (env *Env) GetPersonEntitiesHandler(w http.ResponseWriter, r *http.Request) *helpers.AppError

GetPersonEntitiesHandler returns a json of the entities of the person with the requested id

func (*Env) GetPersonHandler

func (env *Env) GetPersonHandler(w http.ResponseWriter, r *http.Request) *helpers.AppError

GetPersonHandler returns a json of the person with the requested id

func (*Env) GetPersonManageEntitiesHandler

func (env *Env) GetPersonManageEntitiesHandler(w http.ResponseWriter, r *http.Request) *helpers.AppError

GetPersonManageEntitiesHandler returns a json of the entities the person with the requested id is manager of

func (*Env) GetPersonPermissionsHandler

func (env *Env) GetPersonPermissionsHandler(w http.ResponseWriter, r *http.Request) *helpers.AppError

GetPersonPermissionsHandler returns a json of the permissions of the person with the requested id

func (*Env) GetProductHandler

func (env *Env) GetProductHandler(w http.ResponseWriter, r *http.Request) *helpers.AppError

GetProductHandler returns a json of the product with the requested id

func (*Env) GetProductsCasNumberHandler

func (env *Env) GetProductsCasNumberHandler(w http.ResponseWriter, r *http.Request) *helpers.AppError

GetProductsCasNumberHandler returns a json of the formula matching the id

func (*Env) GetProductsCasNumbersHandler

func (env *Env) GetProductsCasNumbersHandler(w http.ResponseWriter, r *http.Request) *helpers.AppError

GetProductsCasNumbersHandler returns a json list of the cas numbers matching the search criteria

func (*Env) GetProductsCeNumbersHandler

func (env *Env) GetProductsCeNumbersHandler(w http.ResponseWriter, r *http.Request) *helpers.AppError

GetProductsCeNumbersHandler returns a json list of the ce numbers matching the search criteria

func (*Env) GetProductsClassOfCompoundsHandler

func (env *Env) GetProductsClassOfCompoundsHandler(w http.ResponseWriter, r *http.Request) *helpers.AppError

GetProductsClassOfCompoundsHandler returns a json list of the classes of compounds matching the search criteria

func (*Env) GetProductsEmpiricalFormulaHandler

func (env *Env) GetProductsEmpiricalFormulaHandler(w http.ResponseWriter, r *http.Request) *helpers.AppError

GetProductsEmpiricalFormulaHandler returns a json of the formula matching the id

func (*Env) GetProductsEmpiricalFormulasHandler

func (env *Env) GetProductsEmpiricalFormulasHandler(w http.ResponseWriter, r *http.Request) *helpers.AppError

GetProductsEmpiricalFormulasHandler returns a json list of the empirical formulas matching the search criteria

func (*Env) GetProductsHandler

func (env *Env) GetProductsHandler(w http.ResponseWriter, r *http.Request) *helpers.AppError

GetProductsHandler returns a json list of the products matching the search criteria

func (*Env) GetProductsHazardStatementHandler

func (env *Env) GetProductsHazardStatementHandler(w http.ResponseWriter, r *http.Request) *helpers.AppError

GetProductsHazardStatementHandler returns a json of the hazardstatement matching the id

func (*Env) GetProductsHazardStatementsHandler

func (env *Env) GetProductsHazardStatementsHandler(w http.ResponseWriter, r *http.Request) *helpers.AppError

GetProductsHazardStatementsHandler returns a json list of the hazard statements matching the search criteria

func (*Env) GetProductsLinearFormulasHandler

func (env *Env) GetProductsLinearFormulasHandler(w http.ResponseWriter, r *http.Request) *helpers.AppError

GetProductsLinearFormulasHandler returns a json list of the linear formulas matching the search criteria

func (*Env) GetProductsNameHandler

func (env *Env) GetProductsNameHandler(w http.ResponseWriter, r *http.Request) *helpers.AppError

GetProductsNameHandler returns a json of the name matching the id

func (*Env) GetProductsNamesHandler

func (env *Env) GetProductsNamesHandler(w http.ResponseWriter, r *http.Request) *helpers.AppError

GetProductsNamesHandler returns a json list of the names matching the search criteria

func (*Env) GetProductsPhysicalStatesHandler

func (env *Env) GetProductsPhysicalStatesHandler(w http.ResponseWriter, r *http.Request) *helpers.AppError

GetProductsPhysicalStatesHandler returns a json list of the physical states matching the search criteria

func (*Env) GetProductsPrecautionaryStatementHandler

func (env *Env) GetProductsPrecautionaryStatementHandler(w http.ResponseWriter, r *http.Request) *helpers.AppError

GetProductsPrecautionaryStatementHandler returns a json of the precautionarystatement matching the id

func (*Env) GetProductsPrecautionaryStatementsHandler

func (env *Env) GetProductsPrecautionaryStatementsHandler(w http.ResponseWriter, r *http.Request) *helpers.AppError

GetProductsPrecautionaryStatementsHandler returns a json list of the precautionary statements matching the search criteria

func (*Env) GetProductsSignalWordHandler

func (env *Env) GetProductsSignalWordHandler(w http.ResponseWriter, r *http.Request) *helpers.AppError

GetProductsSignalWordHandler returns a json of the signal word matching the id

func (*Env) GetProductsSignalWordsHandler

func (env *Env) GetProductsSignalWordsHandler(w http.ResponseWriter, r *http.Request) *helpers.AppError

GetProductsSignalWordsHandler returns a json list of the signal words matching the search criteria

func (*Env) GetProductsSymbolHandler

func (env *Env) GetProductsSymbolHandler(w http.ResponseWriter, r *http.Request) *helpers.AppError

GetProductsSymbolHandler returns a json of the symbol matching the id

func (*Env) GetProductsSymbolsHandler

func (env *Env) GetProductsSymbolsHandler(w http.ResponseWriter, r *http.Request) *helpers.AppError

GetProductsSymbolsHandler returns a json list of the symbols matching the search criteria

func (*Env) GetProductsSynonymsHandler

func (env *Env) GetProductsSynonymsHandler(w http.ResponseWriter, r *http.Request) *helpers.AppError

GetProductsSynonymsHandler returns a json list of the symbols matching the search criteria

func (*Env) GetStorageHandler

func (env *Env) GetStorageHandler(w http.ResponseWriter, r *http.Request) *helpers.AppError

GetStorageHandler returns a json of the entity with the requested id

func (*Env) GetStoragesHandler

func (env *Env) GetStoragesHandler(w http.ResponseWriter, r *http.Request) *helpers.AppError

GetStoragesHandler returns a json list of the storages matching the search criteria

func (*Env) GetStoragesSuppliersHandler

func (env *Env) GetStoragesSuppliersHandler(w http.ResponseWriter, r *http.Request) *helpers.AppError

GetStoragesSuppliersHandler returns a json list of the suppliers matching the search criteria

func (*Env) GetStoragesUnitsHandler

func (env *Env) GetStoragesUnitsHandler(w http.ResponseWriter, r *http.Request) *helpers.AppError

GetStoragesUnitsHandler returns a json list of the units matching the search criteria

func (*Env) GetStoreLocationHandler

func (env *Env) GetStoreLocationHandler(w http.ResponseWriter, r *http.Request) *helpers.AppError

GetStoreLocationHandler returns a json of the store location with the requested id

func (*Env) GetStoreLocationsHandler

func (env *Env) GetStoreLocationsHandler(w http.ResponseWriter, r *http.Request) *helpers.AppError

GetStoreLocationsHandler returns a json list of the store locations matching the search criteria

func (*Env) GetTokenHandler

func (env *Env) GetTokenHandler(w http.ResponseWriter, r *http.Request) *helpers.AppError

GetTokenHandler authenticate the user and return a JWT token on success

func (*Env) GetWelcomeAnnounceHandler

func (env *Env) GetWelcomeAnnounceHandler(w http.ResponseWriter, r *http.Request) *helpers.AppError

GetWelcomeAnnounceHandler returns a json of the welcome announce

func (*Env) HeadersMiddleware

func (env *Env) HeadersMiddleware(h http.Handler) http.Handler

HeadersMiddleware is the application handlers wrapper managing the common response HTTP headers

func (*Env) HomeHandler

func (env *Env) HomeHandler(w http.ResponseWriter, r *http.Request) *helpers.AppError

HomeHandler serves the main page

func (*Env) LogingMiddleware

func (env *Env) LogingMiddleware(h http.Handler) http.Handler

LogingMiddleware is the application handlers wrapper logging the requests

func (*Env) MagicHandler

func (env *Env) MagicHandler(w http.ResponseWriter, r *http.Request) *helpers.AppError

MagicHandler handles the magical selector.

func (*Env) ResetHandler

func (env *Env) ResetHandler(w http.ResponseWriter, r *http.Request) *helpers.AppError

ResetHandler reset the user password from the token

func (*Env) ResetPasswordHandler

func (env *Env) ResetPasswordHandler(w http.ResponseWriter, r *http.Request) *helpers.AppError

ResetPasswordHandler send a password reinitialisation link by mail

func (*Env) RestoreStorageHandler

func (env *Env) RestoreStorageHandler(w http.ResponseWriter, r *http.Request) *helpers.AppError

RestoreStorageHandler restores the storage with the requested id

func (*Env) ToogleProductBookmarkHandler

func (env *Env) ToogleProductBookmarkHandler(w http.ResponseWriter, r *http.Request) *helpers.AppError

ToogleProductBookmarkHandler (un)bookmarks the product with id passed in the request vars for the logged user.

func (*Env) ToogleStorageBorrowingHandler

func (env *Env) ToogleStorageBorrowingHandler(w http.ResponseWriter, r *http.Request) *helpers.AppError

ToogleStorageBorrowingHandler (un)borrow the storage with id passed in the request vars for the logged user.

func (*Env) UpdateEntityHandler

func (env *Env) UpdateEntityHandler(w http.ResponseWriter, r *http.Request) *helpers.AppError

UpdateEntityHandler updates the entity from the request form

func (*Env) UpdatePersonHandler

func (env *Env) UpdatePersonHandler(w http.ResponseWriter, r *http.Request) *helpers.AppError

UpdatePersonHandler updates the person from the request form

func (*Env) UpdatePersonpHandler

func (env *Env) UpdatePersonpHandler(w http.ResponseWriter, r *http.Request) *helpers.AppError

UpdatePersonpHandler updates the person password from the request form

func (*Env) UpdateProductHandler

func (env *Env) UpdateProductHandler(w http.ResponseWriter, r *http.Request) *helpers.AppError

UpdateProductHandler updates the product from the request form

func (*Env) UpdateStorageHandler

func (env *Env) UpdateStorageHandler(w http.ResponseWriter, r *http.Request) *helpers.AppError

UpdateStorageHandler updates the storage from the request form

func (*Env) UpdateStoreLocationHandler

func (env *Env) UpdateStoreLocationHandler(w http.ResponseWriter, r *http.Request) *helpers.AppError

UpdateStoreLocationHandler updates the store location from the request form

func (*Env) UpdateWelcomeAnnounceHandler

func (env *Env) UpdateWelcomeAnnounceHandler(w http.ResponseWriter, r *http.Request) *helpers.AppError

UpdateWelcomeAnnounceHandler updates the entity from the request form

func (*Env) VCreateEntityHandler

func (env *Env) VCreateEntityHandler(w http.ResponseWriter, r *http.Request) *helpers.AppError

VCreateEntityHandler handles the entity creation page

func (*Env) VCreatePersonHandler

func (env *Env) VCreatePersonHandler(w http.ResponseWriter, r *http.Request) *helpers.AppError

VCreatePersonHandler handles the person creation page

func (*Env) VCreateProductHandler

func (env *Env) VCreateProductHandler(w http.ResponseWriter, r *http.Request) *helpers.AppError

VCreateProductHandler handles the store location creation page

func (*Env) VCreateStorageHandler

func (env *Env) VCreateStorageHandler(w http.ResponseWriter, r *http.Request) *helpers.AppError

VCreateStorageHandler handles the storage creation page

func (*Env) VCreateStoreLocationHandler

func (env *Env) VCreateStoreLocationHandler(w http.ResponseWriter, r *http.Request) *helpers.AppError

VCreateStoreLocationHandler handles the store location creation page

func (*Env) VGetEntitiesHandler

func (env *Env) VGetEntitiesHandler(w http.ResponseWriter, r *http.Request) *helpers.AppError

VGetEntitiesHandler handles the entity list page

func (*Env) VGetPeopleHandler

func (env *Env) VGetPeopleHandler(w http.ResponseWriter, r *http.Request) *helpers.AppError

VGetPeopleHandler handles the people list page

func (*Env) VGetProductsHandler

func (env *Env) VGetProductsHandler(w http.ResponseWriter, r *http.Request) *helpers.AppError

VGetProductsHandler handles the store location list page

func (*Env) VGetStoragesHandler

func (env *Env) VGetStoragesHandler(w http.ResponseWriter, r *http.Request) *helpers.AppError

VGetStoragesHandler handles the store location list page

func (*Env) VGetStoreLocationsHandler

func (env *Env) VGetStoreLocationsHandler(w http.ResponseWriter, r *http.Request) *helpers.AppError

VGetStoreLocationsHandler handles the store location list page

func (*Env) VLoginHandler

func (env *Env) VLoginHandler(w http.ResponseWriter, r *http.Request) *helpers.AppError

VLoginHandler returns the login page

func (*Env) VTestHandler

func (env *Env) VTestHandler(w http.ResponseWriter, r *http.Request) *helpers.AppError

VTestHandler is a test handler of course

func (*Env) VUpdatePersonPasswordHandler

func (env *Env) VUpdatePersonPasswordHandler(w http.ResponseWriter, r *http.Request) *helpers.AppError

VUpdatePersonPasswordHandler handles the person password update page

func (*Env) VWelcomeAnnounceHandler

func (env *Env) VWelcomeAnnounceHandler(w http.ResponseWriter, r *http.Request) *helpers.AppError

WelcomeAnnounceHandler serves the welcome announce edition page

func (*Env) ValidateEntityNameHandler

func (env *Env) ValidateEntityNameHandler(w http.ResponseWriter, r *http.Request) *helpers.AppError

ValidateEntityNameHandler checks that the entity name does not already exist if an id != -1 is given is the request the validator ignore the name of the entity with this id

func (*Env) ValidatePersonEmailHandler

func (env *Env) ValidatePersonEmailHandler(w http.ResponseWriter, r *http.Request) *helpers.AppError

ValidatePersonEmailHandler checks that the person email does not already exist if an id is given is the request the validator ignore the email of the person with this id

func (*Env) ValidateProductCasNumberHandler

func (env *Env) ValidateProductCasNumberHandler(w http.ResponseWriter, r *http.Request) *helpers.AppError

ValidateProductCasNumberHandler checks that: - the cas number is valid - a product with the cas number and specificity does not already exist

func (*Env) ValidateProductCeNumberHandler

func (env *Env) ValidateProductCeNumberHandler(w http.ResponseWriter, r *http.Request) *helpers.AppError

ValidateProductCeNumberHandler checks that: - the ce number is valid

func (*Env) ValidateProductEmpiricalFormulaHandler

func (env *Env) ValidateProductEmpiricalFormulaHandler(w http.ResponseWriter, r *http.Request) *helpers.AppError

ValidateProductEmpiricalFormulaHandler checks that the product empirical formula is valid

func (*Env) ValidateProductNameHandler

func (env *Env) ValidateProductNameHandler(w http.ResponseWriter, r *http.Request) *helpers.AppError

ValidateProductNameHandler checks that the product name is valid FIXME: not used yet

Jump to

Keyboard shortcuts

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