senseobjects

package
v0.19.2 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2024 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	DefaultListboxInitialDataFetch = []*enigma.NxPage{{Height: 20, Width: 1}}
)

Functions

This section is empty.

Types

type App

type App struct {
	GUID   string
	Doc    *enigma.Doc
	Layout *enigma.NxAppLayout

	SessionObjects
	// contains filtered or unexported fields
}

App sense app object

func (*App) GetAggregatedSelectionFields

func (app *App) GetAggregatedSelectionFields() string

func (*App) GetAppsPropsList added in v0.17.2

func (app *App) GetAppsPropsList(sessionState SessionState, actionState *action.State) (*AppPropsList, error)

GetAppsPropsList create or return AppsPropsList

func (*App) GetBookmarkList

func (app *App) GetBookmarkList(sessionState SessionState, actionState *action.State) (*BookmarkList, error)

GetBookmarkList update bookmark list for app

func (*App) GetBookmarkObject added in v0.5.2

func (app *App) GetBookmarkObject(sessionState SessionState, actionState *action.State, id string) (*enigma.GenericBookmark, error)

GetBookmarkObject with ID

func (*App) GetCurrentSelections

func (app *App) GetCurrentSelections(sessionState SessionState, actionState *action.State, requestData bool) (*CurrentSelections, error)

GetCurrentSelections create current selection session object and add to list

func (*App) GetDimension added in v0.18.7

func (app *App) GetDimension(sessionState SessionState, actionState *action.State, id string) (*enigma.GenericDimension, error)

func (*App) GetDimensionList added in v0.15.3

func (app *App) GetDimensionList(sessionState SessionState, actionState *action.State) (*DimensionList, error)

func (*App) GetFieldList added in v0.15.3

func (app *App) GetFieldList(sessionState SessionState, actionState *action.State) (*FieldList, error)

GetFieldList session object containing list of fields

func (*App) GetLoadModelList added in v0.6.17

func (app *App) GetLoadModelList(sessionState SessionState, actionState *action.State) (*LoadModelList, error)

GetLoadModelList create or return existing load model list session object

func (*App) GetLocaleInfo

func (app *App) GetLocaleInfo(ctx context.Context) (*enigma.LocaleInfo, error)

GetLocaleInfo send get locale info request

func (*App) GetSheetList

func (app *App) GetSheetList(sessionState SessionState, actionState *action.State) (*SheetList, error)

GetSheetList update sheet list for app

func (*App) GetStoryList added in v0.6.17

func (app *App) GetStoryList(sessionState SessionState, actionState *action.State) (*StoryList, error)

GetStoryList create or return existing story list session object

func (*App) GetVariableList added in v0.6.17

func (app *App) GetVariableList(sessionState SessionState, actionState *action.State) (*VariableList, error)

GetVariableList create or return existing variable list session object

type AppObjectList

type AppObjectList struct {
	Items []*AppObjectListItem `json:"qItems"`
}

type AppObjectListItem

type AppObjectListItem struct {
	Info *AppObjectListItemInfo `json:"qInfo"`
	Meta *AppObjectListItemMeta `json:"qMeta"`
	Data *AppObjectListItemData `json:"qData"`
}

type AppObjectListItemData

type AppObjectListItemData struct {
	OdagLinkRef string `json:"odagLinkRef"`
}

type AppObjectListItemInfo

type AppObjectListItemInfo struct {
	Id   string `json:"qId"`
	Type string `json:"qType"`
}

type AppObjectListItemMeta

type AppObjectListItemMeta struct {
	Name string `json:"qName"`
}

type AppPropsList added in v0.17.2

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

func CreateAppPropsListObject added in v0.17.2

func CreateAppPropsListObject(ctx context.Context, doc *enigma.Doc) (*AppPropsList, error)

CreateAppPropsListObject session object

func (*AppPropsList) Layout added in v0.17.2

func (appPropsList *AppPropsList) Layout() *enigma.GenericObjectLayout

Layout of AppPropsList

func (*AppPropsList) RemoveAllItems added in v0.17.2

func (appPropsList *AppPropsList) RemoveAllItems(sessionState SessionState)

Remove all items from list and de-register events

func (*AppPropsList) UpdateLayout added in v0.17.2

func (appPropsList *AppPropsList) UpdateLayout(ctx context.Context, doc *enigma.Doc, sessionState SessionState, actionState *action.State) error

UpdateLayout of AppPropsList

type BookmarkData

type BookmarkData struct {
	Title       string `json:"title,omitempty"`
	Description string `json:"description,omitempty"`
	SheetId     string `json:"sheetId,omitempty"`
}

BookmarkData data for a bookmark

type BookmarkList

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

BookmarkList container with bookmarks

func CreateBookmarkListObject

func CreateBookmarkListObject(ctx context.Context, doc *enigma.Doc) (*BookmarkList, error)

CreateBookmarkListObject create bookmarklist session object

func (*BookmarkList) GetBookmarks

func (bookmarkList *BookmarkList) GetBookmarks() []*BookmarkNxContainerEntry

GetBookmarks for bookmarkList

func (*BookmarkList) UpdateLayout

func (bookmarkList *BookmarkList) UpdateLayout(ctx context.Context) error

UpdateLayout get and set a new layout for bookmarklist

func (*BookmarkList) UpdateProperties

func (bookmarkList *BookmarkList) UpdateProperties(ctx context.Context) error

UpdateProperties get and set properties for bookmarklist

type BookmarkListAppObjectList

type BookmarkListAppObjectList struct {
	enigma.AppObjectList
	Items []*BookmarkNxContainerEntry `json:"qItems,omitempty"`
}

type BookmarkListLayout

type BookmarkListLayout struct {
	enigma.GenericObjectLayout
	BookmarkList *BookmarkListAppObjectList `json:"qBookmarkList,omitempty"`
}

type BookmarkListProperties

type BookmarkListProperties struct {
	Info    enigma.NxInfo            `json:"qInfo,omitempty"`
	MetaDef enigma.NxMetaDef         `json:"qMetaDef,omitempty"`
	Data    *SheetListPropertiesData `json:"qData,omitempty"`
}

BookmarkListProperties bookmarklist properties

type BookmarkListPropertiesData

type BookmarkListPropertiesData struct {
	Title       string `json:"title,omitempty"`
	Description string `json:"description,omitempty"`
	Cells       string `json:"cells,omitempty"`
}

BookmarkListPropertiesData properties of bookmarklist

type BookmarkNxContainerEntry

type BookmarkNxContainerEntry struct {
	enigma.NxContainerEntry
	Data *BookmarkData `json:"qData,omitempty"`
}

BookmarkNxContainerEntry container bookmark data

type CurrentSelectionLayout

type CurrentSelectionLayout struct {
	NxInfo          enigma.NxInfo          `json:"qInfo,omitempty"`
	NxSelectionInfo enigma.NxSelectionInfo `json:"qNxSelectionInfo,omitempty"`
	SelectionObject enigma.SelectionObject `json:"qSelectionObject,omitempty"`
}

CurrentSelectionLayout layout object

type CurrentSelectionProperties

type CurrentSelectionProperties struct {
	Info               enigma.NxInfo             `json:"qInfo"`
	MetaDef            enigma.NxMetaDef          `json:"qMetaDef"`
	SelectionObjectDef enigma.SelectionObjectDef `json:"qSelectionObjectDef"`
}

CurrentSelectionProperties properties object

type CurrentSelections

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

CurrentSelections object containing current selection state

func CreateCurrentSelections

func CreateCurrentSelections(ctx context.Context, doc *enigma.Doc) (*CurrentSelections, error)

CreateCurrentSelections create current selections session object

func (*CurrentSelections) Layout

Layout for current selections

func (*CurrentSelections) Properties

Properties for current selections

func (*CurrentSelections) UpdateLayout

func (cs *CurrentSelections) UpdateLayout(ctx context.Context) error

UpdateLayout for current selections

func (*CurrentSelections) UpdateProperties

func (cs *CurrentSelections) UpdateProperties(ctx context.Context) error

UpdateProperties for current selections

type DimensionList added in v0.15.3

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

func CreateDimensionListObject added in v0.15.3

func CreateDimensionListObject(ctx context.Context, doc *enigma.Doc) (*DimensionList, error)

CreateDimensionListObject create dimensionlist session object

func (*DimensionList) GetDimension added in v0.15.3

func (dimensionlist *DimensionList) GetDimension(dimensionTitle string) (*enigma.NxContainerEntry, error)

GetDimension searches dimension list and returns container entry of dimension with title if it exists

func (*DimensionList) GetOrCreateSessionListboxSync added in v0.15.3

func (dimensionlist *DimensionList) GetOrCreateSessionListboxSync(sessionState SessionState, actionState *action.State, doc *enigma.Doc, dimensionTitle string) (*ListBox, error)

GetOrCreateSessionListbox

func (*DimensionList) Layout added in v0.15.3

func (dimensionlist *DimensionList) Layout() *enigma.GenericObjectLayout

Layout of dimensionlist object

func (*DimensionList) Properties added in v0.15.3

func (dimensionlist *DimensionList) Properties() *enigma.GenericObjectProperties

Properties of dimensionlist object

func (*DimensionList) UpdateLayout added in v0.15.3

func (dimensionlist *DimensionList) UpdateLayout(ctx context.Context) error

UpdateLayout update object with new layout from engine

func (*DimensionList) UpdateProperties added in v0.15.3

func (dimensionlist *DimensionList) UpdateProperties(ctx context.Context) error

UpdateProperties update object with new properties from engine

type DimensionNotFoundError added in v0.15.3

type DimensionNotFoundError string

func (DimensionNotFoundError) Error added in v0.15.3

func (err DimensionNotFoundError) Error() string

type DynamicAppViewList

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

DynamicAppViewList container with dav list in sense app

func CreateDynamicAppViewList

func CreateDynamicAppViewList(ctx context.Context, doc *enigma.Doc) (*DynamicAppViewList, error)

CreateDynamicAppViewList create dav session object

func (*DynamicAppViewList) Layout

func (davlist *DynamicAppViewList) Layout() *DynamicAppViewListLayout

Layout for DynamicAppViewList

func (*DynamicAppViewList) UpdateLayout

func (davlist *DynamicAppViewList) UpdateLayout(ctx context.Context) error

UpdateLayout get and set a new layout for sheetlist

type DynamicAppViewListLayout

type DynamicAppViewListLayout struct {
	enigma.GenericObjectLayout
	AppObjectList *AppObjectList `json:"qAppObjectList"`
}

type FieldList added in v0.5.7

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

func CreateFieldListObject added in v0.5.7

func CreateFieldListObject(ctx context.Context, doc *enigma.Doc) (*FieldList, error)

CreateFieldListObject create fieldlist session object

func (*FieldList) GetField added in v0.15.3

func (fieldlist *FieldList) GetField(fieldName string) (*enigma.NxFieldDescription, error)

GetField searches field list and returns field with name if it exists

func (*FieldList) GetOrCreateSessionListboxSync added in v0.15.3

func (fieldlist *FieldList) GetOrCreateSessionListboxSync(sessionState SessionState, actionState *action.State, doc *enigma.Doc, fieldName string) (*ListBox, error)

GetOrCreateSessionListbox

func (*FieldList) Layout added in v0.5.7

func (fieldlist *FieldList) Layout() *enigma.GenericObjectLayout

Layout of fieldlist object

func (*FieldList) Properties added in v0.5.7

func (fieldlist *FieldList) Properties() *enigma.GenericObjectProperties

Properties of fieldlist object

func (*FieldList) UpdateLayout added in v0.5.7

func (fieldlist *FieldList) UpdateLayout(ctx context.Context) error

UpdateLayout update object with new layout from engine

func (*FieldList) UpdateProperties added in v0.5.7

func (fieldlist *FieldList) UpdateProperties(ctx context.Context) error

UpdateProperties update object with new properties from engine

type FieldNotFoundError added in v0.15.3

type FieldNotFoundError string

func (FieldNotFoundError) Error added in v0.15.3

func (err FieldNotFoundError) Error() string

type ListBox

type ListBox struct {
	Dirty bool // Set flag to have object update before accessing layout next time

	EnigmaObject *enigma.GenericObject
	// contains filtered or unexported fields
}

ListBox container with listbox in sense app

func CreateFieldListBoxObject added in v0.15.3

func CreateFieldListBoxObject(ctx context.Context, doc *enigma.Doc, name string) (*ListBox, error)

CreateFieldListBoxObject create listbox session object

func CreateLibraryBoxObject added in v0.15.3

func CreateLibraryBoxObject(ctx context.Context, doc *enigma.Doc, id string) (*ListBox, error)

CreateLibraryBoxObject create listbox session object from library ID

func (*ListBox) Layout

func (listBox *ListBox) Layout(ctx context.Context) (*enigma.GenericObjectLayout, error)

Layout for listBox, if layout needs updating this will lock object and update synchronously

func (*ListBox) ListObject added in v0.15.3

func (listBox *ListBox) ListObject(ctx context.Context) (*enigma.ListObject, error)

ListObject for listBox

func (*ListBox) Properties added in v0.15.3

func (listBox *ListBox) Properties() *ListBoxProperties

Properties for listBox

func (*ListBox) UpdateLayout

func (listBox *ListBox) UpdateLayout(ctx context.Context) error

UpdateLayout get and set a new layout for listbox

func (*ListBox) UpdateProperties

func (listBox *ListBox) UpdateProperties(ctx context.Context) error

UpdateProperties get and set properties for listBox

type ListBoxProperties

type ListBoxProperties struct {
	Info    enigma.NxInfo    `json:"qInfo,omitempty"`
	MetaDef enigma.NxMetaDef `json:"qMetaDef,omitempty"`
}

ListBoxProperties listbox properties

type LoadModelList added in v0.6.17

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

LoadModelList used to keep track of story list session object

func CreateLoadModelListObject added in v0.6.17

func CreateLoadModelListObject(ctx context.Context, doc *enigma.Doc) (*LoadModelList, error)

CreateLoadModelListObject create LoadModelList session object

func (*LoadModelList) UpdateLayout added in v0.6.17

func (loadModelList *LoadModelList) UpdateLayout(ctx context.Context) error

UpdateLayout get and set a new layout for LoadModelList

func (*LoadModelList) UpdateProperties added in v0.6.17

func (loadModelList *LoadModelList) UpdateProperties(ctx context.Context) error

UpdateProperties get and set properties for LoadModelList

type OdagToolbarNavpoint added in v0.5.4

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

OdagToolbarNavpoint container with odag-toolbar-navpoint in sense app

func CreateOdagToolbarNavpoint added in v0.5.4

func CreateOdagToolbarNavpoint(ctx context.Context, doc *enigma.Doc, name string) (*OdagToolbarNavpoint, error)

CreateOdagToolbarNavpoint create odag-toolbar-navpoint session object

func (*OdagToolbarNavpoint) GetHypercubeData added in v0.5.4

func (otn *OdagToolbarNavpoint) GetHypercubeData(ctx context.Context) ([]*enigma.NxDataPage, error)

GetHypercubeData get datapages

func (*OdagToolbarNavpoint) Layout added in v0.5.4

Layout for odag-toolbar-navpoint

func (*OdagToolbarNavpoint) UpdateLayout added in v0.5.4

func (otn *OdagToolbarNavpoint) UpdateLayout(ctx context.Context) error

UpdateLayout get and set a new layout for odag-toolbar-navpoint

type OdagToolbarNavpointLayout added in v0.5.4

type OdagToolbarNavpointLayout struct {
	enigma.GenericObjectLayout
}

OdagToolbarNavpointLayout odag-toolbar-navpoint layout

type SessionObjects added in v0.6.17

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

SessionObjects for the app

type SessionState

type SessionState interface {
	BaseContext() context.Context
	QueueRequest(f func(ctx context.Context) error, actionState *action.State, failOnError bool, errMsg string)
	SendRequest(actionState *action.State, f func(ctx context.Context) error) error
	RegisterEvent(handle int,
		onEvent func(ctx context.Context, actionState *action.State) error,
		onClose func(),
		failOnError bool)
	DeRegisterEvent(handle int)
	GetEventFunc(handle int) func(ctx context.Context, actionState *action.State) error
	LogDebugf(format string, args ...interface{})
	LogDetail(level logger.LogLevel, msg, detail string)
	LogError(err error)
	LogInfo(infoType, msg string)
	LogTrafficMetric(responseTime int64, sent, received uint64, requestID int, method, params, trafficType, msg string)
}

SessionState temporary session interface to avoid circular dependencies

type Sheet

type Sheet struct {
	*enigma.GenericObject
	ID         string
	Properties *SheetProperties
	Layout     *SheetLayout
}

Sheet Sense sheet object

func GetSheet

func GetSheet(ctx context.Context, app *App, id string) (*Sheet, error)

GetSheet in sense app

func (*Sheet) GetLayout

func (sheet *Sheet) GetLayout(ctx context.Context) (*SheetLayout, error)

GetLayout for sheet

func (*Sheet) GetProperties

func (sheet *Sheet) GetProperties(ctx context.Context) (*SheetProperties, error)

GetProperties for sheet

func (*Sheet) SetProperties

func (sheet *Sheet) SetProperties(ctx context.Context) error

SetProperties send updates properties to Sense

type SheetBounds added in v0.6.21

type SheetBounds struct {
	Y      float64 `json:"y"`
	X      float64 `json:"x"`
	Width  float64 `json:"width"`
	Height float64 `json:"height"`
}

type SheetCells

type SheetCells struct {
	Name    string `json:"name"`
	Type    string `json:"type"`
	Col     int    `json:"col,omitempty"`
	Row     int    `json:"row,omitempty"`
	Colspan int    `json:"colspan,omitempty"`
	Rowspan int    `json:"rowspan,omitempty"`
}

SheetCells cells on sheet

type SheetData

type SheetData struct {
	Cells []struct {
		Name    string      `json:"name"`
		Type    string      `json:"type"`
		Col     int         `json:"col"`
		Row     int         `json:"row"`
		Colspan int         `json:"colspan"`
		Rowspan int         `json:"rowspan"`
		Bounds  SheetBounds `json:"bounds,omitempty"`
	} `json:"cells,omitempty"`
	Columns               interface{}       `json:"columns"`
	Rows                  interface{}       `json:"rows"`
	Title                 string            `json:"title"`
	LabelExpression       string            `json:"labelExpression"`
	Description           string            `json:"description"`
	DescriptionExpression string            `json:"descriptionExpression"`
	Rank                  interface{}       `json:"rank"`
	ShowCondition         helpers.FuzzyBool `json:"showCondition"`
}

SheetData data for a sheet

type SheetEntryNotFoundError added in v0.6.21

type SheetEntryNotFoundError string

SheetEntryNotFoundError error returned when sheet entry was not found in sheet list

func (SheetEntryNotFoundError) Error added in v0.6.21

func (err SheetEntryNotFoundError) Error() string

Error returned when sheet entry was not found in sheet list

type SheetLayout

type SheetLayout struct {
	Info *enigma.NxInfo `json:"qInfo"`
	Meta struct {
		Description  string      `json:"description"`
		Rank         int         `json:"rank"`
		Title        string      `json:"title"`
		Resourcetype string      `json:"_resourcetype"`
		Objecttype   string      `json:"_objecttype"`
		ID           string      `json:"id"`
		Approved     bool        `json:"approved"`
		Published    bool        `json:"published"`
		Owner        interface{} `json:"owner"` // string in QSEoK but struct in QSEoW
		OwnerID      string      `json:"ownerId"`
		CreatedDate  string      `json:"createdDate"`
		ModifiedDate string      `json:"modifiedDate"`
		Privileges   []string    `json:"privileges"`
	} `json:"qMeta"`
	SelectionInfo struct {
	} `json:"qSelectionInfo"`
	Cells []interface{} `json:"cells"`
}

SheetLayout layout of sense sheet

type SheetList

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

SheetList container with sheet in sense app

func CreateSheetListObject

func CreateSheetListObject(ctx context.Context, doc *enigma.Doc) (*SheetList, error)

CreateSheetListObject create sheetlist session object

func (*SheetList) GetSheetEntry

func (sheetList *SheetList) GetSheetEntry(sheetid string) (*SheetNxContainerEntry, error)

GetSheetEntry Get sheet entry from sheet list

func (*SheetList) Layout

func (sheetList *SheetList) Layout() *SheetListLayout

Layout for sheetlist

func (*SheetList) UpdateLayout

func (sheetList *SheetList) UpdateLayout(ctx context.Context) error

UpdateLayout get and set a new layout for sheetlist

type SheetListAppObjectList

type SheetListAppObjectList struct {
	enigma.AppObjectList
	Items []*SheetNxContainerEntry `json:"qItems,omitempty"`
}

SheetListAppObjectList sheetlist app object list

type SheetListLayout

type SheetListLayout struct {
	enigma.GenericObjectLayout
	AppObjectList *SheetListAppObjectList `json:"qAppObjectList,omitempty"`
}

SheetListLayout sheetlist layout

type SheetListProperties

type SheetListProperties struct {
	Info    enigma.NxInfo            `json:"qInfo,omitempty"`
	MetaDef enigma.NxMetaDef         `json:"qMetaDef,omitempty"`
	Data    *SheetListPropertiesData `json:"qData,omitempty"`
}

SheetListProperties SheetList properties

type SheetListPropertiesData

type SheetListPropertiesData struct {
	Title       string `json:"title,omitempty"`
	Description string `json:"description,omitempty"`
	Cells       string `json:"cells,omitempty"`
}

SheetListPropertiesData properties of sheetlist

type SheetMeta added in v0.6.7

type SheetMeta struct {
	enigma.NxMeta
	Published bool `json:"published,omitempty"`
	Approved  bool `json:"approved,omitempty"`
}

type SheetMetaDef

type SheetMetaDef struct {
	Title       string `json:"title,omitempty"`
	Description string `json:"description,omitempty"`
}

SheetMetaDef sheet meta information

type SheetNxContainerEntry

type SheetNxContainerEntry struct {
	enigma.NxContainerEntry
	Data *SheetData `json:"qData,omitempty"`
	Meta SheetMeta  `json:"qMeta,omitempty"`
}

SheetNxContainerEntry container sheet data

type SheetProperties

type SheetProperties struct {
	Info      *enigma.NxInfo   `json:"qInfo"`
	MetaDef   *SheetMetaDef    `json:"qMetaDef"`
	Rank      float64          `json:"rank,omitempty"`
	Thumbnail *SheetThumbnail  `json:"thumbnail,omitempty"`
	Columns   helpers.FuzzyInt `json:"columns,omitempty"`
	Rows      helpers.FuzzyInt `json:"rows,omitempty"`
	Cells     []*SheetCells    `json:"cells"`
}

SheetProperties properties of sense sheet

type SheetThumbnail

type SheetThumbnail struct {
	StaticContentURLef *enigma.StaticContentUrlDef `json:"qStaticContentUrlDef,omitempty"`
}

SheetThumbnail thumbnail object of sheet properties

type StoryList added in v0.6.17

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

StoryList used to keep track of story list session object

func CreateStoryListObject added in v0.6.17

func CreateStoryListObject(ctx context.Context, doc *enigma.Doc) (*StoryList, error)

CreateStoryListObject create StoryList session object

func (*StoryList) UpdateLayout added in v0.6.17

func (storyList *StoryList) UpdateLayout(ctx context.Context) error

UpdateLayout get and set a new layout for StoryList

type VariableList added in v0.6.17

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

VariableList used to keep track of variable list session object

func CreateVariableListObject added in v0.6.17

func CreateVariableListObject(ctx context.Context, doc *enigma.Doc) (*VariableList, error)

CreateVariableListObject create VariableList session object

func (*VariableList) UpdateLayout added in v0.6.17

func (variableList *VariableList) UpdateLayout(ctx context.Context) error

UpdateLayout get and set a new layout for VariableList

Jump to

Keyboard shortcuts

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