Hextranslate

package
v0.0.0-...-94023a2 Latest Latest
Warning

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

Go to latest
Published: Jun 23, 2020 License: Apache-2.0 Imports: 26 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RECTYPEVIEW int = iota
	RECTYPEACTION
	RECTYPEMENU
)

Variables

View Source
var (
	GreservedKeywordArray []string
	GDomainOperators      map[string]string
	GTemplateIdTranslator map[string]string
	GEntryTypeTranslator  map[string]string
	GKnownMethodNames     []string
)

Functions

func AddUniqueEntry

func AddUniqueEntry(array []string, value string) []string

func BSl

func BSl(n interface{}) []byte

func BestString

func BestString(a, b string) string

func BuildFieldFuncMap

func BuildFieldFuncMap() map[string][]func(map[string]interface{}) []byte

func CamelCase

func CamelCase(words []string) string

func CheckRequestedHelp

func CheckRequestedHelp()

func CleanName

func CleanName(str string) string

func Comment

func Comment(text [][]byte) [][]byte

func ConvertFieldType

func ConvertFieldType(input string) string

func CreateDir

func CreateDir(path string)

func CreateGoModFile

func CreateGoModFile()

func CreateHexyaFile

func CreateHexyaFile()

func CreateToml

func CreateToml()

func CsvWriteCsv

func CsvWriteCsv(data CsvData, fileConsideration string)

func FatalError

func FatalError(str string, args ...interface{})

func FtExit

func FtExit()

func GenerateTranslatedModule

func GenerateTranslatedModule()

func GetAlias

func GetAlias(str string) string

func GetAllFiles

func GetAllFiles(iPath string) *list.List

func GetClassParam

func GetClassParam(classNode map[string]interface{}) string

func GetControllerAssetsList

func GetControllerAssetsList() string

func GetDomainOperators

func GetDomainOperators() map[string]string

func GetEntryTypeTranslator

func GetEntryTypeTranslator() map[string]string

func GetFullNameImported

func GetFullNameImported(str string) string

func GetHexyaFileBase

func GetHexyaFileBase() string

func GetHexyaModuleList

func GetHexyaModuleList() string

func GetKnownMethodNames

func GetKnownMethodNames() []string

func GetModelName

func GetModelName(b interface{}) string

func GetRawFileContent

func GetRawFileContent(output *list.List, filepath string)

func GetRawLinePart

func GetRawLinePart(l interface{}) []byte

func GetRawText

func GetRawText(l interface{}) [][]byte

func GetReservedKeywordArray

func GetReservedKeywordArray() []string

func GetTemplateIdTranslator

func GetTemplateIdTranslator() map[string]string

func GetTomlFileBase

func GetTomlFileBase() string

func GetTomlModuleList

func GetTomlModuleList() string

func Init

func Init(input m.TranslatorSet)

func InitCsvDataFile

func InitCsvDataFile(path string, heads []string) (*list.List, []string)

func InitFuncMap

func InitFuncMap()

func InitSecurityGoFile

func InitSecurityGoFile(path string)

func InitSignal

func InitSignal()

func IsNil

func IsNil(c interface{}) bool

func IsNotInStringArray

func IsNotInStringArray(val string, array []string) bool

func IsOdooVar

func IsOdooVar(node map[string]interface{}) bool

func MakeUnique

func MakeUnique(str string, bank string) string

func MethodIsExtension

func MethodIsExtension(name string) bool

func NoTranslation

func NoTranslation(path string)

func Node

func Node(n interface{}) map[string]interface{}

func PostTranslate

func PostTranslate()

func PrintNodeOutput

func PrintNodeOutput(node map[string]interface{}) []byte

func PrintVersion

func PrintVersion()

func ReadEntry

func ReadEntry(entry GenericEntry, templateId string)

func ReadInit

func ReadInit()

func ReadInitFile

func ReadInitFile(path string)

func ReadManifest

func ReadManifest()

func ReadManifestEntry

func ReadManifestEntry(key, val string)

func ReadManifestEntryList

func ReadManifestEntryList(input string) []string

func ReadTemplates

func ReadTemplates(templates []OdooTemplate)

func RegisterAsset

func RegisterAsset(entry GenericEntry, Id string)

func RegisterLessHelper

func RegisterLessHelper(entry GenericEntry)

func RemoveExtraneousSpaces

func RemoveExtraneousSpaces(str string) string

func ReplaceRegex

func ReplaceRegex(str string, regex string, repl string) string

func RunTranslatedModule

func RunTranslatedModule()

func Sl

func Sl(n interface{}) []interface{}

func SnakeToCamel

func SnakeToCamel(str string, firstUpper bool) string

func SplitSubN

func SplitSubN(s string, n int) []string

func StartTranslator

func StartTranslator()

func StartXmltoCsv

func StartXmltoCsv(file io.Reader, filePath string)

func StartXmltoSecurity

func StartXmltoSecurity(file io.Reader, filePath string)

func StartXmltoXml

func StartXmltoXml(file io.Reader, filePath string)

func Str

func Str(n interface{}) string

func TranslateCSV

func TranslateCSV(file string)

func TranslateCSVSecurity

func TranslateCSVSecurity(path string)

func TranslateDataDemoFile

func TranslateDataDemoFile(file string)

func TranslatePy2

func TranslatePy2(filePath string)

func TranslateXML

func TranslateXML(filePath string)

func Translator

func Translator()

func WriteFile

func WriteFile(path string, content *list.List)

func WriteGoSecurityLine

func WriteGoSecurityLine(path string, output *list.List)

func WriteHeadCsv

func WriteHeadCsv(heads []string) *list.List

func WriteHexyaData

func WriteHexyaData(genRecords []GenericRecord) []byte

func WriteHexyaXML

func WriteHexyaXML(path string, genRecords []GenericRecord)

func WriteInitFiles

func WriteInitFiles()

func WriteRawOutputFile

func WriteRawOutputFile(filePath string, content *list.List)

func WriteSecurityData

func WriteSecurityData(filePath string, odoo SecuOdoo)

func XMLPostTranslate

func XMLPostTranslate(input []byte, data []int) []byte

Types

type ApiData

type ApiData struct {
	ApiName string
	ApiArgs string
}

type ArgTraductorEntry

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

type ClassData

type ClassData struct {
	ClassName string
	VarDef    map[string]string
	SqlDef    []string
	Raw       []string
	Fields    []FieldData
	Classes   []ClassData
	Methods   []MethodData
}

type ComplexReplacementRegex

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

type CsvData

type CsvData struct {
	Models          []string
	ModelEntryCount map[string]int
	ModelHeads      map[string][]string
	ModelContent    map[string][]CsvValue
}

func CsvDecodeXml

func CsvDecodeXml(odoo XmlDataOdoo) CsvData

func CsvReadXml

func CsvReadXml(file io.Reader) CsvData

type CsvValue

type CsvValue struct {
	Value map[string]string
}

type FieldData

type FieldData struct {
	Name           string
	Type           string
	Args           map[string]string
	ArgsRaw        string
	AlreadyCreated bool
}

type FileData

type FileData struct {
	Imports []string
	Raw     []string
	Classes []ClassData
	Methods []MethodData
}

type GenArgs

type GenArgs struct {
	RecordSet m.TranslatorSet

	FilesData   []string
	FilesDemo   []string
	FilesPython []string
	FilesPo     []string

	ControllerAssets map[string][]string

	ComputeMethodNames []string
	// contains filtered or unexported fields
}

func NewGenArgs

func NewGenArgs() GenArgs

func ReadArgs

func ReadArgs(rs m.TranslatorSet) GenArgs

func (GenArgs) GetArgTraductor

func (g GenArgs) GetArgTraductor() []ArgTraductorEntry

func (GenArgs) GetLoggerLevelTraductor

func (g GenArgs) GetLoggerLevelTraductor() []ArgTraductorEntry

func (GenArgs) TraductArg

func (g GenArgs) TraductArg(arg string, argTraductor []ArgTraductorEntry) string

func (GenArgs) TraductLoggerLevel

func (g GenArgs) TraductLoggerLevel(arg string, logleveltraductor []ArgTraductorEntry) string

type GenericEntry

type GenericEntry struct {
	Type string
	Path string
}

func LinkToGeneric

func LinkToGeneric(entry OdooLinkEntry) GenericEntry

func ScriptToGeneric

func ScriptToGeneric(entry OdooScriptEntry) GenericEntry

type GenericRecord

type GenericRecord struct {
	Type     string
	ID       string
	Name     string
	Model    string
	ViewMode string
	ViewId   string
	Data     string
}

func ReadOdooRecord

func ReadOdooRecord(rec OdooRecord) GenericRecord

type HexyaData

type HexyaData struct {
	Records []HexyaRecord `xml:"HEXYA_HEXYA_TMP_RECORD"`
}

type HexyaHexyaXml

type HexyaHexyaXml struct {
	Data HexyaData `xml:"data"`
}

type HexyaRecord

type HexyaRecord struct {
	Id       string `xml:"id,attr"`
	Type     string `xml:"type,attr"`
	Name     string `xml:"name,attr"`
	Model    string `xml:"model,attr"`
	ViewMode string `xml:"view_mode,attr"`
	ViewId   string `xml:"view_id,attr"`
	InnerXML string `xml:",innerxml"`
}

func WriteHexyaRecord

func WriteHexyaRecord(inrec GenericRecord) (HexyaRecord, int)

type Manifest

type Manifest map[string][]string

func GetDefaultManifest

func GetDefaultManifest() Manifest

type MethodData

type MethodData struct {
	Info       MethodInfoData
	Apis       []ApiData
	MethodName string
	MethodArgs string
	Methods    []MethodData
	Raw        []string
}

type MethodInfoData

type MethodInfoData struct {
	Path string
	Line int
	Raw  string
}

type OdooData

type OdooData struct {
	XMLNAME  xml.Name       `xml:"data"`
	Template []OdooTemplate `xml:"template"`
	Record   []OdooRecord   `xml:"record"`
}

type OdooField

type OdooField struct {
	XMLNAME  xml.Name `xml:"field"`
	InnerXML string   `xml:",innerxml"`
	Name     string   `xml:"name,attr"`
	Ref      string   `xml:"ref,attr"`
}

type OdooLinkEntry

type OdooLinkEntry struct {
	XMLNAME xml.Name `xml:"link"`
	Rel     string   `xml:"rel,attr"`
	Type    string   `xml:"type,attr"`
	Href    string   `xml:"href,attr"`
}

type OdooOdoo

type OdooOdoo struct {
	XMLNAME  xml.Name       `xml:"odoo"`
	Record   []OdooRecord   `xml:"record"`
	Data     []OdooData     `xml:"data"`
	Template []OdooTemplate `xml:"template"`
}

type OdooRecord

type OdooRecord struct {
	XMLNAME xml.Name    `xml:"record"`
	Field   []OdooField `xml:"field"`
	Id      string      `xml:"id,attr"`
	Model   string      `xml:"model,attr"`
}

type OdooScriptEntry

type OdooScriptEntry struct {
	XMLNAME xml.Name `xml:"script"`
	Type    string   `xml:"type,attr"`
	Src     string   ` xml:"src,attr"`
}

type OdooTemplate

type OdooTemplate struct {
	XMLNAME   xml.Name          `xml:"template"`
	Id        string            `xml:"id,attr"`
	Name      string            `xml:"name,attr"`
	InheritId string            `xml:"inherit_id,attr"`
	Script    []OdooScriptEntry `xml:"script"`
	Link      []OdooLinkEntry   `xml:"link"`
	Xpath     []OdooXpath       `xml:"xpath"`
}

type OdooXpath

type OdooXpath struct {
	XMLNAME  xml.Name          `xml:"xpath"`
	Expr     string            `xml:"expr,attr"`
	Position string            `xml:"position,attr"`
	Script   []OdooScriptEntry `xml:"script"`
	Link     []OdooLinkEntry   `xml:"link"`
}

type SecuData

type SecuData struct {
	XMLNAME xml.Name     `xml:"data"`
	Record  []SecuRecord `xml:"record"`
}

type SecuField

type SecuField struct {
	XMLNAME  xml.Name `xml:"field"`
	InnerXML string   `xml:",innerxml"`
	Name     string   `xml:"name,attr"`
	Ref      string   `xml:"ref,attr"`
}

type SecuOdoo

type SecuOdoo struct {
	XMLNAME xml.Name   `xml:"odoo"`
	Data    []SecuData `xml:"data"`
}

type SecuRecord

type SecuRecord struct {
	XMLNAME xml.Name    `xml:"record"`
	Field   []SecuField `xml:"field"`
	Id      string      `xml:"id,attr"`
	Model   string      `xml:"model,attr"`

	Name string
}

type SecurityEntry

type SecurityEntry struct {
	ModelId string
	GroupId string
}

type XmlDataData

type XmlDataData struct {
	XMLNAME xml.Name        `xml:"data"`
	Record  []XmlDataRecord `xml:"record"`
}

type XmlDataField

type XmlDataField struct {
	XMLNAME  xml.Name `xml:"field"`
	InnerXML string   `xml:",innerxml"`
	Name     string   `xml:"name,attr"`
	Ref      string   `xml:"ref,attr"`
}

func ToXmlField

func ToXmlField(input []OdooField) []XmlDataField

type XmlDataOdoo

type XmlDataOdoo struct {
	XMLNAME xml.Name      `xml:"odoo"`
	Data    []XmlDataData `xml:"data"`
}

type XmlDataRecord

type XmlDataRecord struct {
	XMLNAME xml.Name       `xml:"record"`
	Field   []XmlDataField `xml:"field"`
	Id      string         `xml:"id,attr"`
	Model   string         `xml:"model,attr"`
}

func ToXmlRecord

func ToXmlRecord(input []OdooRecord) []XmlDataRecord

Jump to

Keyboard shortcuts

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