Esempio n. 1
0
// MForeignKey ...
func (cm AsStandard) MForeignKey() *metadata.MForeignKey {
	mfk := metadata.MForeignKey{}
	for _, fk := range cm.Elements[metadata.MIForeignKey.Name] {
		metadata.FieldTransfer(fk.Attr).To(&mfk)
		for _, entry := range fk.Entries() {
			tmp := metadata.ForeignKey{}
			entry.SetFields(&tmp)
			mfk.ForeignKey = append(mfk.ForeignKey, tmp)
		}
	}
	return &mfk
}
Esempio n. 2
0
// MEditMask ...
func (cm AsStandard) MEditMask(resource string) *metadata.MEditMask {
	mem := metadata.MEditMask{}
	for _, cd := range cm.Elements[metadata.MIEditMask.Name] {
		if cd.Attr["Resource"] != resource {
			continue
		}
		metadata.FieldTransfer(cd.Attr).To(&mem)
		for _, entry := range cd.Entries() {
			tmp := metadata.EditMask{}
			entry.SetFields(&tmp)
			mem.EditMask = append(mem.EditMask, tmp)
		}
	}
	return &mem
}
Esempio n. 3
0
// MFilter ...
func (cm AsStandard) MFilter() *metadata.MFilter {
	mf := metadata.MFilter{}
	mi := metadata.MIFilter
	for _, cd := range cm.Elements[mi.Name] {
		metadata.FieldTransfer(cd.Attr).To(&mf)
		for _, entry := range cd.Entries() {
			tmp := metadata.Filter{}
			entry.SetFields(&tmp)
			id := mi.ID(tmp)
			tmp.MFilterType = cm.MFilterType(id)
			mf.Filter = append(mf.Filter, tmp)
		}
	}
	return &mf
}
Esempio n. 4
0
// MUpdateHelp ...
func (cm AsStandard) MUpdateHelp(resource string) *metadata.MUpdateHelp {
	muh := metadata.MUpdateHelp{}
	for _, cd := range cm.Elements[metadata.MIUpdateHelp.Name] {
		if cd.Attr["Resource"] != resource {
			continue
		}
		metadata.FieldTransfer(cd.Attr).To(&muh)
		for _, entry := range cd.Entries() {
			tmp := metadata.UpdateHelp{}
			entry.SetFields(&tmp)
			muh.UpdateHelp = append(muh.UpdateHelp, tmp)
		}
	}
	return &muh
}
Esempio n. 5
0
// MSearchHelp ...
func (cm AsStandard) MSearchHelp(resource string) *metadata.MSearchHelp {
	msh := metadata.MSearchHelp{}
	mi := metadata.MISearchHelp
	for _, cd := range cm.Elements[mi.Name] {
		if cd.Attr["Resource"] != resource {
			continue
		}
		metadata.FieldTransfer(cd.Attr).To(&msh)
		for _, entry := range cd.Entries() {
			tmp := metadata.SearchHelp{}
			entry.SetFields(&tmp)
			msh.SearchHelp = append(msh.SearchHelp, tmp)
		}
	}
	return &msh
}
Esempio n. 6
0
// SetValidationExpressions ...
func (cm AsStandard) MValidationExpression(resource string) *metadata.MValidationExpression {
	mve := metadata.MValidationExpression{}
	mi := metadata.MIValidationExpression
	for _, cd := range cm.Elements[mi.Name] {
		if cd.Attr["Resource"] != resource {
			continue
		}
		metadata.FieldTransfer(cd.Attr).To(&mve)
		for _, entry := range cd.Entries() {
			tmp := metadata.ValidationExpression{}
			entry.SetFields(&tmp)
			mve.ValidationExpression = append(mve.ValidationExpression, tmp)
		}
	}
	return &mve
}
Esempio n. 7
0
// MObject ...
func (cm AsStandard) MObject(resource string) *metadata.MObject {
	mo := metadata.MObject{}
	mi := metadata.MIObject
	for _, cd := range cm.Elements[mi.Name] {
		if cd.Attr["Resource"] != resource {
			continue
		}
		metadata.FieldTransfer(cd.Attr).To(&mo)
		for _, entry := range cd.Entries() {
			tmp := metadata.Object{}
			entry.SetFields(&tmp)
			mo.Object = append(mo.Object, tmp)
		}
	}
	return &mo
}
Esempio n. 8
0
// MFilterType ...
func (cm AsStandard) MFilterType(filter string) *metadata.MFilterType {
	mft := metadata.MFilterType{}
	mi := metadata.MIFilterType
	for _, cd := range cm.Elements[mi.Name] {
		if cd.Attr["Filter"] != filter {
			continue
		}
		metadata.FieldTransfer(cd.Attr).To(&mft)
		for _, entry := range cd.Entries() {
			tmp := metadata.FilterType{}
			entry.SetFields(&tmp)
			mft.FilterType = append(mft.FilterType, tmp)
		}
	}
	return &mft
}
Esempio n. 9
0
// MValidationExternal ...
func (cm AsStandard) MValidationExternal(resource string) *metadata.MValidationExternal {
	mve := metadata.MValidationExternal{}
	mi := metadata.MIValidationExternal
	for _, cd := range cm.Elements[mi.Name] {
		if cd.Attr["Resource"] != resource {
			continue
		}
		metadata.FieldTransfer(cd.Attr).To(&mve)
		for _, entry := range cd.Entries() {
			tmp := metadata.ValidationExternal{}
			entry.SetFields(&tmp)
			id := mi.ID(&tmp)
			tmp.MValidationExternalType = cm.MValidationExternalType(resource, id)
			mve.ValidationExternal = append(mve.ValidationExternal, tmp)
		}
	}
	return &mve
}
Esempio n. 10
0
// MLookup ...
func (cm AsStandard) MLookup(resource string) *metadata.MLookup {
	ml := metadata.MLookup{}
	mi := metadata.MILookup
	for _, cd := range cm.Elements[mi.Name] {
		if cd.Attr["Resource"] != resource {
			continue
		}
		metadata.FieldTransfer(cd.Attr).To(&ml)
		for _, entry := range cd.Entries() {
			tmp := metadata.Lookup{}
			entry.SetFields(&tmp)
			id := mi.ID(&tmp)
			tmp.MLookupType = cm.MLookupType(resource, id)
			ml.Lookup = append(ml.Lookup, tmp)
		}
	}
	return &ml
}
Esempio n. 11
0
// MColumnGroupSet ...
func (cm AsStandard) MColumnGroupSet(resource, class string) *metadata.MColumnGroupSet {
	mcgs := metadata.MColumnGroupSet{}
	for _, cd := range cm.Elements[metadata.MIColumnGroupSet.Name] {
		if cd.Attr["Resource"] != resource {
			continue
		}
		if cd.Attr["Class"] != class {
			continue
		}
		metadata.FieldTransfer(cd.Attr).To(&mcgs)
		for _, entry := range cd.Entries() {
			tmp := metadata.ColumnGroupSet{}
			entry.SetFields(&tmp)
			mcgs.ColumnGroupSet = append(mcgs.ColumnGroupSet, tmp)
		}
	}
	return &mcgs
}
Esempio n. 12
0
// MTable ...
func (cm AsStandard) MTable(resource, class string) *metadata.MTable {
	mt := metadata.MTable{}
	mi := metadata.MITable
	for _, cd := range cm.Elements[mi.Name] {
		if cd.Attr["Resource"] != resource {
			continue
		}
		if cd.Attr["Class"] != class {
			continue
		}
		metadata.FieldTransfer(cd.Attr).To(&mt)
		for _, entry := range cd.Entries() {
			tmp := metadata.Field{}
			entry.SetFields(&tmp)
			mt.Field = append(mt.Field, tmp)
		}
	}
	return &mt
}
Esempio n. 13
0
// MValidationExternalType ...
func (cm AsStandard) MValidationExternalType(resource, validationExternal string) *metadata.MValidationExternalType {
	mvet := metadata.MValidationExternalType{}
	mi := metadata.MIValidationExternalType
	for _, cd := range cm.Elements[mi.Name] {
		if cd.Attr["Resource"] != resource {
			continue
		}
		if cd.Attr["ValidationExternal"] != validationExternal {
			continue
		}
		metadata.FieldTransfer(cd.Attr).To(&mvet)
		for _, entry := range cd.Entries() {
			tmp := metadata.ValidationExternalType{}
			entry.SetFields(&tmp)
			mvet.ValidationExternalType = append(mvet.ValidationExternalType, tmp)
		}
	}
	return &mvet
}
Esempio n. 14
0
// MLookupType ...
func (cm AsStandard) MLookupType(resource, lookup string) *metadata.MLookupType {
	mlt := metadata.MLookupType{}
	mi := metadata.MILookupType
	for _, cd := range cm.Elements[mi.Name] {
		if cd.Attr["Resource"] != resource {
			continue
		}
		if cd.Attr["Lookup"] != lookup {
			continue
		}
		metadata.FieldTransfer(cd.Attr).To(&mlt)
		for _, entry := range cd.Entries() {
			tmp := metadata.LookupType{}
			entry.SetFields(&tmp)
			mlt.LookupType = append(mlt.LookupType, tmp)
		}
	}
	return &mlt
}
Esempio n. 15
0
// MClass ...
func (cm AsStandard) MClass(resource string) *metadata.MClass {
	mc := metadata.MClass{}
	mi := metadata.MIClass
	for _, cd := range cm.Elements[mi.Name] {
		if cd.Attr["Resource"] != resource {
			continue
		}
		metadata.FieldTransfer(cd.Attr).To(&mc)
		for _, entry := range cd.Entries() {
			tmp := metadata.Class{}
			entry.SetFields(&tmp)
			id := mi.ID(&tmp)
			tmp.MTable = cm.MTable(resource, id)
			tmp.MUpdate = cm.MUpdate(resource, id)
			tmp.MColumnGroupSet = cm.MColumnGroupSet(resource, id)
			tmp.MColumnGroup = cm.MColumnGroup(resource, id)
			mc.Class = append(mc.Class, tmp)
		}
	}
	return &mc
}
Esempio n. 16
0
// MUpdate ...
func (cm AsStandard) MUpdate(resource, class string) *metadata.MUpdate {
	mu := metadata.MUpdate{}
	mi := metadata.MIUpdate
	for _, cd := range cm.Elements[mi.Name] {
		if cd.Attr["Resource"] != resource {
			continue
		}
		if cd.Attr["Class"] != class {
			continue
		}
		metadata.FieldTransfer(cd.Attr).To(&mu)
		for _, entry := range cd.Entries() {
			tmp := metadata.Update{}
			entry.SetFields(&tmp)
			id := mi.ID(&tmp)
			tmp.MUpdateType = cm.MUpdateType(resource, class, id)
			mu.Update = append(mu.Update, tmp)
		}
	}
	return &mu
}
Esempio n. 17
0
// MColumnGroupNormalization ...
func (cm AsStandard) MColumnGroupNormalization(resource, class, cg string) *metadata.MColumnGroupNormalization {
	mcgn := metadata.MColumnGroupNormalization{}
	for _, cd := range cm.Elements[metadata.MIColumnGroupNormalization.Name] {
		if cd.Attr["Resource"] != resource {
			continue
		}
		if cd.Attr["Class"] != class {
			continue
		}
		if cd.Attr["ColumnGroup"] != cg {
			continue
		}
		metadata.FieldTransfer(cd.Attr).To(&mcgn)
		for _, entry := range cd.Entries() {
			tmp := metadata.ColumnGroupNormalization{}
			entry.SetFields(&tmp)
			mcgn.ColumnGroupNormalization = append(mcgn.ColumnGroupNormalization, tmp)
		}
	}
	return &mcgn
}
Esempio n. 18
0
// MColumnGroupControl ...
func (cm AsStandard) MColumnGroupControl(resource, class, cg string) *metadata.MColumnGroupControl {
	mcgc := metadata.MColumnGroupControl{}
	mi := metadata.MIColumnGroupControl
	for _, cd := range cm.Elements[mi.Name] {
		if cd.Attr["Resource"] != resource {
			continue
		}
		if cd.Attr["Class"] != class {
			continue
		}
		if cd.Attr["ColumnGroup"] != cg {
			continue
		}
		metadata.FieldTransfer(cd.Attr).To(&mcgc)
		for _, entry := range cd.Entries() {
			tmp := metadata.ColumnGroupControl{}
			entry.SetFields(&tmp)
			mcgc.ColumnGroupControl = append(mcgc.ColumnGroupControl, tmp)
		}
	}
	return &mcgc
}
Esempio n. 19
0
// MResources ...
func (cm AsStandard) MResource() *metadata.MResource {
	mr := metadata.MResource{}
	mi := metadata.MIResource
	for _, cd := range cm.Elements[mi.Name] {
		metadata.FieldTransfer(cd.Attr).To(&mr)
		for _, entry := range cd.Entries() {
			tmp := metadata.Resource{}
			entry.SetFields(&tmp)
			id := mi.ID(&tmp)
			tmp.MClass = cm.MClass(id)
			tmp.MObject = cm.MObject(id)
			tmp.MLookup = cm.MLookup(id)
			tmp.MSearchHelp = cm.MSearchHelp(id)
			tmp.MEditMask = cm.MEditMask(id)
			tmp.MUpdateHelp = cm.MUpdateHelp(id)
			tmp.MValidationExpression = cm.MValidationExpression(id)
			tmp.MValidationExternal = cm.MValidationExternal(id)
			tmp.MValidationLookup = cm.MValidationLookup(id)
			mr.Resource = append(mr.Resource, tmp)
		}
	}
	return &mr
}
Esempio n. 20
0
// ColumnGroup ...
func (cm AsStandard) MColumnGroup(resource, class string) *metadata.MColumnGroup {
	mcg := metadata.MColumnGroup{}
	mi := metadata.MIColumnGroup
	for _, cd := range cm.Elements[mi.Name] {
		if cd.Attr["Resource"] != resource {
			continue
		}
		if cd.Attr["Class"] != class {
			continue
		}
		metadata.FieldTransfer(cd.Attr).To(&mcg)
		for _, entry := range cd.Entries() {
			tmp := metadata.ColumnGroup{}
			entry.SetFields(&tmp)
			id := mi.ID(&tmp)
			tmp.MColumnGroupControl = cm.MColumnGroupControl(resource, class, id)
			tmp.MColumnGroupTable = cm.MColumnGroupTable(resource, class, id)
			tmp.MColumnGroupNormalization = cm.MColumnGroupNormalization(resource, class, id)
			mcg.ColumnGroup = append(mcg.ColumnGroup, tmp)
		}
	}
	return &mcg
}