Documentation ¶
Index ¶
- Variables
- type AlertFilterForm
- type BillingReportFilterForm
- type DeletionRequestFilterForm
- type DepositReportFilterForm
- type Field
- type FileFilterForm
- type FilterForm
- func NewAlertFilterForm(fc *pgmodels.FilterCollection, actingUser *pgmodels.User) (FilterForm, error)
- func NewBillingReportFilterForm(fc *pgmodels.FilterCollection, actingUser *pgmodels.User) (FilterForm, error)
- func NewDeletionRequestFilterForm(fc *pgmodels.FilterCollection, actingUser *pgmodels.User) (FilterForm, error)
- func NewDepositReportFilterForm(fc *pgmodels.FilterCollection, actingUser *pgmodels.User) (FilterForm, error)
- func NewFileFilterForm(fc *pgmodels.FilterCollection, actingUser *pgmodels.User) (FilterForm, error)
- func NewInstitutionFilterForm(fc *pgmodels.FilterCollection, actingUser *pgmodels.User) (FilterForm, error)
- func NewObjectFilterForm(fc *pgmodels.FilterCollection, actingUser *pgmodels.User) (FilterForm, error)
- func NewPremisEventFilterForm(fc *pgmodels.FilterCollection, actingUser *pgmodels.User) (FilterForm, error)
- func NewUserFilterForm(fc *pgmodels.FilterCollection, actingUser *pgmodels.User) (FilterForm, error)
- func NewWorkItemFilterForm(fc *pgmodels.FilterCollection, actingUser *pgmodels.User) (FilterForm, error)
- type FilterFormConstructor
- type Form
- type InstitutionFilterForm
- type InstitutionForm
- type InstitutionPreferencesForm
- type ListOption
- type ObjectFilterForm
- type PasswordResetForm
- type PremisEventFilterForm
- type TwoFactorSetupForm
- type UserFilterForm
- type UserForm
- type WorkItemFilterForm
- type WorkItemForm
- type WorkItemRequeueForm
Constants ¶
This section is empty.
Variables ¶
var AllRolesList = []*ListOption{ {constants.RoleInstAdmin, "Institutional Admin", false}, {constants.RoleInstUser, "Institutional User", false}, {constants.RoleSysAdmin, "APTrust System Administrator", false}, }
AllRolesList is a list of assignable user roles. Hard-coded instead of using Options() function for formatting reasons and because we don't want to include the "none" role.
var BagItProfileIdentifiers = []*ListOption{ {constants.DefaultProfileIdentifier, "APTrust", false}, {constants.BTRProfileIdentifier, "BTR", false}, }
var DepositChartMetrics = []*ListOption{ {"object_count", "Object Count", false}, {"file_count", "File Count", false}, {"total_bytes", "Total Bytes", false}, {"total_gb", "Total Gigabytes", false}, {"total_tb", "Total Terabytes", false}, }
DepositChartMetrics come from names of pgmodels.DepositStats properties
var InstRolesList = []*ListOption{ {constants.RoleInstAdmin, "Institutional Admin", false}, {constants.RoleInstUser, "Institutional User", false}, }
InstRolesList is a list of user roles for institutions.
var InstTypeList = []*ListOption{ {constants.InstTypeMember, "Member", false}, {constants.InstTypeSubscriber, "Associate", false}, }
var Months = []string{
"",
"January",
"February",
"March",
"April",
"May",
"June",
"July",
"August",
"September",
"October",
"November",
"December",
}
var ObjectStateList = []*ListOption{ {constants.StateActive, "Active", false}, {constants.StateDeleted, "Deleted", false}, }
var StorageOptionList = []*ListOption{ {constants.StorageOptionGlacierDeepOH, "Glacier Deep - Ohio", false}, {constants.StorageOptionGlacierDeepOR, "Glacier Deep - Oregon", false}, {constants.StorageOptionGlacierDeepVA, "Glacier Deep - Virginia", false}, {constants.StorageOptionGlacierOH, "Glacier - Ohio", false}, {constants.StorageOptionGlacierOR, "Glacier - Oregon", false}, {constants.StorageOptionGlacierVA, "Glacier - Virginia", false}, {constants.StorageOptionStandard, "Standard", false}, {constants.StorageOptionWasabiOR, "Wasabi - Oregon", false}, {constants.StorageOptionWasabiVA, "Wasabi - Virginia", false}, }
var TwoFactorMethodList = []*ListOption{ {constants.TwoFactorNone, "None (Turn Off Two-Factor Authentication)", false}, {constants.TwoFactorAuthy, "Authy OneTouch", false}, {constants.TwoFactorSMS, "Text Message", false}, }
var YesNoList = []*ListOption{ {"true", "Yes", false}, {"false", "No", false}, }
Functions ¶
This section is empty.
Types ¶
type AlertFilterForm ¶
type AlertFilterForm struct { Form FilterCollection *pgmodels.FilterCollection // contains filtered or unexported fields }
AlertFilterForm is the form that displays filtering options for the alert list page.
func (*AlertFilterForm) SetValues ¶
func (f *AlertFilterForm) SetValues()
setValues sets the form values to match the Institution values.
type BillingReportFilterForm ¶
type BillingReportFilterForm struct { Form FilterCollection *pgmodels.FilterCollection // contains filtered or unexported fields }
BillingReportFilterForm is the form that displays filtering options for the billing report page.
func (*BillingReportFilterForm) SetValues ¶
func (f *BillingReportFilterForm) SetValues()
setValues sets the form values to match the Institution values.
type DeletionRequestFilterForm ¶
type DeletionRequestFilterForm struct { Form FilterCollection *pgmodels.FilterCollection // contains filtered or unexported fields }
DeletionRequestFilterForm is the form that displays filtering options for the deletion request list page.
func (*DeletionRequestFilterForm) SetValues ¶
func (f *DeletionRequestFilterForm) SetValues()
setValues sets the form values to match the Institution values.
type DepositReportFilterForm ¶
type DepositReportFilterForm struct { Form FilterCollection *pgmodels.FilterCollection // contains filtered or unexported fields }
DepositReportFilterForm is the form that displays filtering options for the deposit report page.
func (*DepositReportFilterForm) SetValues ¶
func (f *DepositReportFilterForm) SetValues()
setValues sets the form values to match the Institution values.
type FileFilterForm ¶
type FileFilterForm struct { Form FilterCollection *pgmodels.FilterCollection // contains filtered or unexported fields }
FileFilterForm is the form that displays filtering options for the generic file list page.
func (*FileFilterForm) SetValues ¶
func (f *FileFilterForm) SetValues()
setValues sets the form values to match the Institution values.
type FilterForm ¶
func NewAlertFilterForm ¶
func NewAlertFilterForm(fc *pgmodels.FilterCollection, actingUser *pgmodels.User) (FilterForm, error)
func NewBillingReportFilterForm ¶
func NewBillingReportFilterForm(fc *pgmodels.FilterCollection, actingUser *pgmodels.User) (FilterForm, error)
func NewDeletionRequestFilterForm ¶
func NewDeletionRequestFilterForm(fc *pgmodels.FilterCollection, actingUser *pgmodels.User) (FilterForm, error)
func NewDepositReportFilterForm ¶
func NewDepositReportFilterForm(fc *pgmodels.FilterCollection, actingUser *pgmodels.User) (FilterForm, error)
func NewFileFilterForm ¶
func NewFileFilterForm(fc *pgmodels.FilterCollection, actingUser *pgmodels.User) (FilterForm, error)
func NewInstitutionFilterForm ¶
func NewInstitutionFilterForm(fc *pgmodels.FilterCollection, actingUser *pgmodels.User) (FilterForm, error)
func NewObjectFilterForm ¶
func NewObjectFilterForm(fc *pgmodels.FilterCollection, actingUser *pgmodels.User) (FilterForm, error)
func NewPremisEventFilterForm ¶
func NewPremisEventFilterForm(fc *pgmodels.FilterCollection, actingUser *pgmodels.User) (FilterForm, error)
func NewUserFilterForm ¶
func NewUserFilterForm(fc *pgmodels.FilterCollection, actingUser *pgmodels.User) (FilterForm, error)
func NewWorkItemFilterForm ¶
func NewWorkItemFilterForm(fc *pgmodels.FilterCollection, actingUser *pgmodels.User) (FilterForm, error)
type FilterFormConstructor ¶
type FilterFormConstructor func(*pgmodels.FilterCollection, *pgmodels.User) (FilterForm, error)
FilterFormConstructor describes the function signature for the constructors of all our filter forms. Filter forms appear on index pages, allowing users to filter lists by name, date, etc.
type Form ¶
type Form struct { BaseURL string Error error Fields map[string]*Field Model pgmodels.Model Status int Template string }
func (*Form) GetFields ¶
GetFields returns a slice of all of the form's fields. This is used primarily in testing.
func (*Form) HandleError ¶
Handle error sets the error property and http status code on error.
func (*Form) PostSaveURL ¶
PostSaveURL is the url to redirect to after successful save.
type InstitutionFilterForm ¶
type InstitutionFilterForm struct { Form FilterCollection *pgmodels.FilterCollection // contains filtered or unexported fields }
InstitutionFilterForm is the form that displays filtering options for the institution list page.
func (*InstitutionFilterForm) SetValues ¶
func (f *InstitutionFilterForm) SetValues()
setValues sets the form values to match the Institution values.
type InstitutionForm ¶
type InstitutionForm struct { Form // contains filtered or unexported fields }
func NewInstitutionForm ¶
func NewInstitutionForm(institution *pgmodels.Institution) (*InstitutionForm, error)
func (*InstitutionForm) SetValues ¶
func (f *InstitutionForm) SetValues()
setValues sets the form values to match the Institution values.
type InstitutionPreferencesForm ¶
type InstitutionPreferencesForm struct {
Form
}
InstitutionPreferencesForm allows institutional admins to edit a subset of their institution's info. This includes whether to require two-factor authentication and how often to run spot tests.
func NewInstitutionPreferencesForm ¶
func NewInstitutionPreferencesForm(institution *pgmodels.Institution) (*InstitutionPreferencesForm, error)
func (*InstitutionPreferencesForm) Action ¶
func (f *InstitutionPreferencesForm) Action() string
Action returns the html form.action attribute for this form.
func (*InstitutionPreferencesForm) SetValues ¶
func (f *InstitutionPreferencesForm) SetValues()
setValues sets the form values to match the Institution values.
type ListOption ¶
func ListDepositReportDates ¶
func ListDepositReportDates(includeToday bool) []*ListOption
ListDepositReportDates returns a list of dates for deposit reports. Note that for each option except "Today", the label is a month and year and the value is the first day of the following month. For example, if the label is August 2022, the value is 2022-09-01. This would give you a report for deposits through the end of August, 2022. In the database, the query amounts to "all files created BEFORE 2022-09-01".
Note that past deposit stats are stored in the historical_deposit_stats table, and we store month-end reports only. Thus, ALL of the dates in that table will be first-of-month dates. Stats go back to December 2014, which was APTrust's initial launch (though the system was empty then),
If user chooses the "Today" option, the data will come from the current_deposit_stats view, which is updated hourly.
func ListInstitutions ¶
func ListInstitutions(membersOnly bool) ([]*ListOption, error)
func ListUsers ¶
func ListUsers(institutionID int64) ([]*ListOption, error)
func Options ¶
func Options(items []string) []*ListOption
Options returns a list of options for the given string list. This is intended mainly to provide select list filters for the web ui for constants such as:
AccessSettings DigestAlgs EventTypes Stages Statuses StorageOptions WorkItemActions
type ObjectFilterForm ¶
type ObjectFilterForm struct { Form FilterCollection *pgmodels.FilterCollection // contains filtered or unexported fields }
ObjectFilterForm is the form that displays filtering options for the generic file list page.
func (*ObjectFilterForm) SetValues ¶
func (f *ObjectFilterForm) SetValues()
setValues sets the form values to match the Institution values.
type PasswordResetForm ¶
type PasswordResetForm struct {
Form
}
func NewPasswordResetForm ¶
func NewPasswordResetForm(userToEdit *pgmodels.User) *PasswordResetForm
func (*PasswordResetForm) SetValues ¶
func (f *PasswordResetForm) SetValues()
setValues sets the form values to match the User values.
type PremisEventFilterForm ¶
type PremisEventFilterForm struct { Form FilterCollection *pgmodels.FilterCollection // contains filtered or unexported fields }
PremisEventFilterForm is the form that displays filtering options for the PREMIS event list page.
func (*PremisEventFilterForm) SetValues ¶
func (f *PremisEventFilterForm) SetValues()
setValues sets the form values to match the Institution values.
type TwoFactorSetupForm ¶
type TwoFactorSetupForm struct {
Form
}
func NewTwoFactorSetupForm ¶
func NewTwoFactorSetupForm(user *pgmodels.User) *TwoFactorSetupForm
func (*TwoFactorSetupForm) SetValues ¶
func (f *TwoFactorSetupForm) SetValues()
setValues sets the form values
type UserFilterForm ¶
type UserFilterForm struct { Form FilterCollection *pgmodels.FilterCollection // contains filtered or unexported fields }
UserFilterForm is the form that displays filtering options for the user list page.
func (*UserFilterForm) SetValues ¶
func (f *UserFilterForm) SetValues()
setValues sets the form values to match the User values.
type UserForm ¶
type UserForm struct { Form // contains filtered or unexported fields }
func NewUserForm ¶
type WorkItemFilterForm ¶
type WorkItemFilterForm struct { Form FilterCollection *pgmodels.FilterCollection // contains filtered or unexported fields }
WorkItemFilterForm is the form that displays filtering options for the work item list page.
func (*WorkItemFilterForm) SetValues ¶
func (f *WorkItemFilterForm) SetValues()
setValues sets the form values to match the Institution values.
type WorkItemForm ¶
type WorkItemForm struct {
Form
}
func NewWorkItemForm ¶
func NewWorkItemForm(workItem *pgmodels.WorkItem) *WorkItemForm
func (*WorkItemForm) SetValues ¶
func (f *WorkItemForm) SetValues()
type WorkItemRequeueForm ¶
type WorkItemRequeueForm struct { Form // contains filtered or unexported fields }
func NewWorkItemRequeueForm ¶
func NewWorkItemRequeueForm(workItem *pgmodels.WorkItem) (*WorkItemRequeueForm, error)
func (*WorkItemRequeueForm) Action ¶
func (f *WorkItemRequeueForm) Action() string
Action returns the html form.action attribute for this form.
func (*WorkItemRequeueForm) SetValues ¶
func (f *WorkItemRequeueForm) SetValues()
setValues sets the form values to match the WorkItem values.
Source Files ¶
- alert_filter_form.go
- billing_report_filter_form.go
- deletion_request_filter_form.go
- deposit_report_filter_form.go
- file_filter_form.go
- form.go
- institution_filter_form.go
- institution_form.go
- institution_preferences_form.go
- lists.go
- object_filter_form.go
- password_reset_form.go
- premis_event_filter_form.go
- two_factor_setup_form.go
- user_filter_form.go
- user_form.go
- work_item_filter_form.go
- work_item_form.go
- work_item_requeue_form.go