page

package
v1.4.5-alpha1 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2019 License: MPL-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package page is a default implementation of cms page related interfaces declared in "github.com/ottemo/commerce/app/models/csm" package

Index

Constants

View Source
const (
	ConstCmsPageCollectionName = "cms_page"

	ConstErrorModule = "cms/page"
	ConstErrorLevel  = env.ConstErrorLevelActor
)

Package global constants

Variables

This section is empty.

Functions

func APICreateCMSPage

func APICreateCMSPage(context api.InterfaceApplicationContext) (interface{}, error)

APICreateCMSPage creates a new CMS block

  • CMS page attributes should be specified in request content

func APIDeleteCMSPage

func APIDeleteCMSPage(context api.InterfaceApplicationContext) (interface{}, error)

APIDeleteCMSPage deletes specified CMS page

  • CMS page id should be specified in "pageID" argument

func APIGetCMSPage

func APIGetCMSPage(context api.InterfaceApplicationContext) (interface{}, error)

APIGetCMSPage return specified CMS page information

  • CMS page id should be specified in "pageID" argument
  • CMS page content can be a text template, so "evaluated" field in response is that template evaluation result

func APIListCMSPageAttributes

func APIListCMSPageAttributes(context api.InterfaceApplicationContext) (interface{}, error)

APIListCMSPageAttributes returns a list of CMS block attributes

func APIListCMSPages

func APIListCMSPages(context api.InterfaceApplicationContext) (interface{}, error)

APIListCMSPages returns a list of existing CMS pages

  • if "action" parameter is set to "count" result value will be just a number of list items

func APIUpdateCMSPage

func APIUpdateCMSPage(context api.InterfaceApplicationContext) (interface{}, error)

APIUpdateCMSPage updates existing CMS page

  • CMS page id should be specified in "pageID" argument

Types

type DefaultCMSPage

type DefaultCMSPage struct {
	Enabled    bool
	Identifier string

	Title   string
	Content string

	CreatedAt time.Time
	UpdatedAt time.Time
	// contains filtered or unexported fields
}

DefaultCMSPage is a default implementer of InterfaceCMSPage

func (*DefaultCMSPage) Delete

func (it *DefaultCMSPage) Delete() error

Delete removes current cms block from DB

func (*DefaultCMSPage) EvaluateContent

func (it *DefaultCMSPage) EvaluateContent() string

EvaluateContent applying GO text template to content value

func (*DefaultCMSPage) FromHashMap

func (it *DefaultCMSPage) FromHashMap(input map[string]interface{}) error

FromHashMap fills object attributes from map[string]interface{}

func (*DefaultCMSPage) Get

func (it *DefaultCMSPage) Get(attribute string) interface{}

Get returns object attribute value or nil

func (*DefaultCMSPage) GetAttributesInfo

func (it *DefaultCMSPage) GetAttributesInfo() []models.StructAttributeInfo

GetAttributesInfo returns information about object attributes

func (*DefaultCMSPage) GetCollection

func (it *DefaultCMSPage) GetCollection() models.InterfaceCollection

GetCollection returns collection of current instance type

func (*DefaultCMSPage) GetContent

func (it *DefaultCMSPage) GetContent() string

GetContent returns page content

func (*DefaultCMSPage) GetEnabled

func (it *DefaultCMSPage) GetEnabled() bool

GetEnabled returns page enabled flag

func (*DefaultCMSPage) GetID

func (it *DefaultCMSPage) GetID() string

GetID returns id for cms block

func (*DefaultCMSPage) GetIdentifier

func (it *DefaultCMSPage) GetIdentifier() string

GetIdentifier returns page identifier

func (*DefaultCMSPage) GetImplementationName

func (it *DefaultCMSPage) GetImplementationName() string

GetImplementationName returns model implementation name

func (*DefaultCMSPage) GetModelName

func (it *DefaultCMSPage) GetModelName() string

GetModelName returns model name

func (*DefaultCMSPage) GetTitle

func (it *DefaultCMSPage) GetTitle() string

GetTitle returns page title

func (*DefaultCMSPage) Load

func (it *DefaultCMSPage) Load(id string) error

Load loads cms page information from DB

func (*DefaultCMSPage) LoadByIdentifier

func (it *DefaultCMSPage) LoadByIdentifier(identifier string) error

LoadByIdentifier loads data of CMSBlock by its identifier

func (*DefaultCMSPage) New

New returns new instance of model implementation object

func (*DefaultCMSPage) Save

func (it *DefaultCMSPage) Save() error

Save stores current cms block to DB

func (*DefaultCMSPage) Set

func (it *DefaultCMSPage) Set(attribute string, value interface{}) error

Set sets attribute value to object or returns error

func (*DefaultCMSPage) SetContent

func (it *DefaultCMSPage) SetContent(newValue string) error

SetContent sets page content value

func (*DefaultCMSPage) SetEnabled

func (it *DefaultCMSPage) SetEnabled(newValue bool) error

SetEnabled returns page enabled flag

func (*DefaultCMSPage) SetID

func (it *DefaultCMSPage) SetID(newID string) error

SetID sets id for cms block

func (*DefaultCMSPage) SetIdentifier

func (it *DefaultCMSPage) SetIdentifier(newValue string) error

SetIdentifier sets page identifier value

func (*DefaultCMSPage) SetTitle

func (it *DefaultCMSPage) SetTitle(newValue string) error

SetTitle sets page title value

func (*DefaultCMSPage) ToHashMap

func (it *DefaultCMSPage) ToHashMap() map[string]interface{}

ToHashMap represents object as map[string]interface{}

type DefaultCMSPageCollection

type DefaultCMSPageCollection struct {
	// contains filtered or unexported fields
}

DefaultCMSPageCollection is a default implementer of InterfaceCMSPageCollection

func (*DefaultCMSPageCollection) GetDBCollection

func (it *DefaultCMSPageCollection) GetDBCollection() db.InterfaceDBCollection

GetDBCollection returns database collection

func (*DefaultCMSPageCollection) GetImplementationName

func (it *DefaultCMSPageCollection) GetImplementationName() string

GetImplementationName returns model implementation name

func (*DefaultCMSPageCollection) GetModelName

func (it *DefaultCMSPageCollection) GetModelName() string

GetModelName returns model name

func (*DefaultCMSPageCollection) List

List enumerates items of CMS page model

func (*DefaultCMSPageCollection) ListAddExtraAttribute

func (it *DefaultCMSPageCollection) ListAddExtraAttribute(attribute string) error

ListAddExtraAttribute allows to obtain additional attributes from List() function

func (*DefaultCMSPageCollection) ListCMSPages

func (it *DefaultCMSPageCollection) ListCMSPages() []cms.InterfaceCMSPage

ListCMSPages returns list of cms page model items

func (*DefaultCMSPageCollection) ListFilterAdd

func (it *DefaultCMSPageCollection) ListFilterAdd(Attribute string, Operator string, Value interface{}) error

ListFilterAdd adds selection filter to List() function

func (*DefaultCMSPageCollection) ListFilterReset

func (it *DefaultCMSPageCollection) ListFilterReset() error

ListFilterReset clears presets made by ListFilterAdd() and ListAddExtraAttribute() functions

func (*DefaultCMSPageCollection) ListLimit

func (it *DefaultCMSPageCollection) ListLimit(offset int, limit int) error

ListLimit sets select pagination

func (*DefaultCMSPageCollection) New

New returns new instance of model implementation object

Jump to

Keyboard shortcuts

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