Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var LocationColumns []string = []string{
"id",
"parent_id",
"main_id",
"hierarchy",
"depth",
"identifier_path",
"content_type",
"content_id",
"language",
"identifier_path",
"name",
"is_hidden",
"is_invisible",
"priority",
"uid",
"section",
"p",
}
Functions ¶
func GetFields ¶
Get fields based on path pattern including container, separated by / . eg. article/relations, report/step1
func LoadDefinition ¶
func LoadDefinition() error
LoadDefinition Load all setting in file into memory.
Types ¶
type ContentType ¶
type ContentType struct { Name string `json:"name"` TableName string `json:"table_name"` RelationData []string `json:"relation_data"` NamePattern string `json:"name_pattern"` HasVersion bool `json:"has_version"` HasLocation bool `json:"has_location"` AllowedTypes []string `json:"allowed_types"` Fields []FieldDef `json:"fields"` DataFields []DataField `json:"data_fields"` //All fields where identifier is the key. FieldMap map[string]FieldDef `json:"-"` FieldIdentifierList []string `json:"-"` // contains filtered or unexported fields }
func GetDefinition ¶
func GetDefinition(contentType string, language ...string) (ContentType, error)
Get a definition of a contenttype
func (*ContentType) HasDataField ¶
func (c *ContentType) HasDataField(identifier string) bool
func (ContentType) HasRelationlist ¶
func (c ContentType) HasRelationlist() bool
func (*ContentType) Init ¶
func (c *ContentType) Init(fieldCallback ...func(*FieldDef))
type ContentTypeList ¶
type ContentTypeList map[string]map[string]ContentType
func GetDefinitionList ¶
func GetDefinitionList() ContentTypeList
type FieldDef ¶
type FieldDef struct { Identifier string `json:"identifier"` Name string `json:"name"` FieldType string `json:"type"` DefaultValue interface{} `json:"default_value"` //eg. checkbox 1 means checked Required bool `json:"required"` Description string `json:"description"` IsOutput bool `json:"is_output"` Parameters FieldParameters `json:"parameters"` Children []FieldDef `json:"children"` }
Content field definition
type FieldParameters ¶
type FieldParameters map[string]interface{}
type VaidationRule ¶
type VaidationRule map[string]interface{}
ValidationRule defines rule for a field's validation. eg. max length
Click to show internal directories.
Click to hide internal directories.