workflowhandler

package
v2.5.4+incompatible Latest Latest
Warning

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

Go to latest
Published: Sep 7, 2018 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (

	// Layout is the base template, cloned from the responder's layout, from
	// which all workflow pages are built
	Layout *tmpl.TRoot

	// DeskTmpl renders the main "workflow desk" page
	DeskTmpl *tmpl.Template

	// MetadataFormTmpl renders the form for entering metadata for an issue
	MetadataFormTmpl *tmpl.Template

	// ReportErrorTmpl renders the form for reporting errors on an issue
	ReportErrorTmpl *tmpl.Template

	// ReviewMetadataTmpl renders the view for reviewing metadata
	ReviewMetadataTmpl *tmpl.Template

	// RejectIssueTmpl renders the view for reporting an issue which is rejected by the reviewer
	RejectIssueTmpl *tmpl.Template

	// ViewIssueTmpl renders a read-only display of an issue
	ViewIssueTmpl *tmpl.Template
)

Functions

func Setup

func Setup(r *mux.Router, webPath string, c *config.Config, w *issuewatcher.Watcher)

Setup sets up all the workflow-specific routing rules and does any other init necessary for workflow handling

Types

type Handler

type Handler interface {
	ServeHTTP(*responder.Responder, *Issue)
}

Handler is our version of http.Handler for sending extra context to workflow handlers

type HandlerFunc

type HandlerFunc func(resp *responder.Responder, i *Issue)

HandlerFunc represents workflow handlers with workflow-specific context

func MustHavePrivilege

func MustHavePrivilege(priv *user.Privilege, f HandlerFunc) HandlerFunc

MustHavePrivilege replicates responder.MustHavePrivilege, but supports the workflow handler structure's needs

func (HandlerFunc) ServeHTTP

func (f HandlerFunc) ServeHTTP(resp *responder.Responder, i *Issue)

ServeHTTP calls f(resp, i)

type Issue

type Issue struct {
	*db.Issue
	MetadataAuthorLogin string
	// contains filtered or unexported fields
}

Issue wraps the DB issue, and decorates it with display-friendly functions and dataentry-specific errors

func (*Issue) Actions

func (i *Issue) Actions() []template.HTML

Actions returns the action link HTML for each possible action the owner can take for this issue

func (*Issue) Date

func (i *Issue) Date() string

Date returns the issue's raw date string

func (*Issue) Errors

func (i *Issue) Errors() []apperr.Error

Errors returns validation errors

func (*Issue) IsOwned

func (i *Issue) IsOwned() bool

IsOwned returns true if the owner ID is nonzero *and* the workflow owner expiration time has not passed

func (*Issue) JP2Files

func (i *Issue) JP2Files() []string

JP2Files aggregates all the JP2s that exist in this issue's directory

func (*Issue) LCCN

func (i *Issue) LCCN() string

LCCN returns the issue's title's LCCN

func (*Issue) Path

func (i *Issue) Path(actionPath string) string

Path returns the path for any basic actions on this issue

func (*Issue) TaskDescription

func (i *Issue) TaskDescription() string

TaskDescription returns a human-friendly explanation of the current place this issue is within the workflow

func (*Issue) Title

func (i *Issue) Title() string

Title returns the issue's title's name

func (*Issue) ValidateMetadata

func (i *Issue) ValidateMetadata()

ValidateMetadata checks all fields for validity and sets up i.validationErrors to describe anything wrong

func (*Issue) WorkflowExpiration

func (i *Issue) WorkflowExpiration() string

WorkflowExpiration returns the date and time of "workflow expiration": when this item is no longer claimed by the workflow owner

Jump to

Keyboard shortcuts

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