diff --git a/usda/init.go b/usda/init.go index aaa04bc..f3329a3 100644 --- a/usda/init.go +++ b/usda/init.go @@ -6,7 +6,8 @@ package usda import ( "golang.org/x/text/language" - serverassets "github.com/webability-go/xamboo/assets" + "github.com/webability-go/xamboo/applications" + "github.com/webability-go/xamboo/cms/context" "github.com/webability-go/xmodules/base" "github.com/webability-go/xmodules/translation" @@ -35,7 +36,7 @@ func init() { // InitModule is called during the init phase to link the module with the system // adds tables and caches to sitecontext::database -func Setup(ds serverassets.Datasource, prefix string) ([]string, error) { +func Setup(ds applications.Datasource, prefix string) ([]string, error) { ctx := ds.(*base.Datasource) buildTables(ctx) @@ -47,7 +48,7 @@ func Setup(ds serverassets.Datasource, prefix string) ([]string, error) { return []string{}, nil } -func Synchronize(ds serverassets.Datasource, prefix string) ([]string, error) { +func Synchronize(ds applications.Datasource, prefix string) ([]string, error) { ctx := ds.(*base.Datasource) translation.AddTheme(ctx, TRANSLATIONTHEME, "USDA nutrients", translation.SOURCETABLE, "", "name,tag") @@ -69,6 +70,6 @@ func Synchronize(ds serverassets.Datasource, prefix string) ([]string, error) { return messages, nil } -func StartContext(ds serverassets.Datasource, ctx *serverassets.Context) error { +func StartContext(ds applications.Datasource, ctx *context.Context) error { return nil } diff --git a/usda/structure.go b/usda/structure.go index bdad96f..a68c039 100644 --- a/usda/structure.go +++ b/usda/structure.go @@ -7,7 +7,7 @@ import ( "github.com/webability-go/xmodules/base" "github.com/webability-go/xmodules/translation" - serverassets "github.com/webability-go/xamboo/assets" + "github.com/webability-go/xamboo/applications" ) type StructureNutrient struct { @@ -16,7 +16,7 @@ type StructureNutrient struct { Data *xdominion.XRecord } -func CreateStructureNutrientByKey(sitecontext serverassets.Datasource, key string, lang language.Tag) base.Structure { +func CreateStructureNutrientByKey(sitecontext applications.Datasource, key string, lang language.Tag) base.Structure { data, _ := sitecontext.GetTable("usda_nutrient").SelectOne(key) if data == nil { return nil @@ -24,7 +24,7 @@ func CreateStructureNutrientByKey(sitecontext serverassets.Datasource, key strin return CreateStructureNutrientByData(sitecontext, data, lang) } -func CreateStructureNutrientByData(sitecontext serverassets.Datasource, data xdominion.XRecordDef, lang language.Tag) base.Structure { +func CreateStructureNutrientByData(sitecontext applications.Datasource, data xdominion.XRecordDef, lang language.Tag) base.Structure { key, _ := data.GetString("key") @@ -38,12 +38,12 @@ func CreateStructureNutrientByData(sitecontext serverassets.Datasource, data xdo } // ComplementData adds all the needed data from other objects /duplicable in the thread since the object will be destroyed at the end -func (sm *StructureNutrient) ComplementData(sitecontext serverassets.Datasource) { +func (sm *StructureNutrient) ComplementData(sitecontext applications.Datasource) { } // IsAuthorized returns true if the structure can be used on this site/language/device -func (sm *StructureNutrient) IsAuthorized(sitecontext serverassets.Datasource, site string, language string, device string) bool { +func (sm *StructureNutrient) IsAuthorized(sitecontext applications.Datasource, site string, language string, device string) bool { return true }