init
This commit is contained in:
commit
e124a47765
19374 changed files with 9806149 additions and 0 deletions
112
Tools/CodeGeneration/Templates/Common/ProviderUtil.tdl
Normal file
112
Tools/CodeGeneration/Templates/Common/ProviderUtil.tdl
Normal file
|
@ -0,0 +1,112 @@
|
|||
//***************************************************************************//
|
||||
// Visszaadja egy attribútumról, hogy kötelező-e. //
|
||||
// True, ha igen; egyébként False. //
|
||||
//***************************************************************************//
|
||||
proc IsRequired(MAttribute)
|
||||
return IsAttributeRequired([MAttribute]);
|
||||
end proc
|
||||
|
||||
|
||||
//***************************************************************************//
|
||||
// Visszaadja egy asszociációs végpontról, hogy navigálható-e. //
|
||||
// True, ha igen; egyébként False. //
|
||||
//***************************************************************************//
|
||||
proc IsNavigable(MAssociationEnd)
|
||||
if ([MAssociationEnd.isNavigable] == "TRUE")
|
||||
return "True";
|
||||
else
|
||||
return "False";
|
||||
end if
|
||||
end proc
|
||||
|
||||
|
||||
//***************************************************************************//
|
||||
// Visszaadja egy attribútumról, hogy csak alapértéket lehet neki értékül //
|
||||
// adni, vagy sem. //
|
||||
// True, ha igen; egyébként False. //
|
||||
//***************************************************************************//
|
||||
proc IsDefaultOnly(MAttribute)
|
||||
return IsDefaultonlyAttribute([MAttribute]);
|
||||
end proc
|
||||
|
||||
|
||||
//***************************************************************************//
|
||||
// Visszaadja egy attribútumról, hogy csak olvasható-e vagy sem. //
|
||||
//***************************************************************************//
|
||||
proc IsReadOnly(MAttribute)
|
||||
return IsReadonlyAttribute([MAttribute]);
|
||||
end proc
|
||||
|
||||
|
||||
//***************************************************************************//
|
||||
// UML típust konvertál a Delphi-s TClientDataset XML formátumában megadandó //
|
||||
// típusra. //
|
||||
//***************************************************************************//
|
||||
proc GetMidasType(type)
|
||||
switch(ToLower([type]))
|
||||
case "integer": return "i4";
|
||||
case "string": return "string.uni";
|
||||
case "boolean": return "boolean";
|
||||
case "float": return "r8"; // XXX
|
||||
case "char": return "string.uni"; // XXX
|
||||
case "datetime": return "dateTime";
|
||||
case "id": return "i4";
|
||||
case "binary": return "bin.hex\" SUBTYPE=\"Binary";
|
||||
case "dictionaryitem": return "i4";
|
||||
case "longstring": return "bin.hex\" SUBTYPE=\"Binary"; // XXX
|
||||
end switch
|
||||
return "object /* ERROR Ismeretlen tipus: " [type] " */";
|
||||
end proc
|
||||
|
||||
|
||||
//***************************************************************************//
|
||||
// Megdupláz egy számot. //
|
||||
//***************************************************************************//
|
||||
proc GetDoubleValue(value)
|
||||
return add([value], [value]);
|
||||
end proc
|
||||
|
||||
|
||||
//***************************************************************************//
|
||||
// Visszaadja egy attribútum hosszát a Delphi-s TClientDataSet-nek //
|
||||
// megfelelően. //
|
||||
//***************************************************************************//
|
||||
proc GetMidasAttributeLength(MAttribute)
|
||||
if (([MAttribute.type] == "String") or ([MAttribute.type] == "Char"))
|
||||
return add(GetAttributeLength([MAttribute]), GetAttributeLength([MAttribute]));
|
||||
else
|
||||
return GetAttributeLength([MAttribute]);
|
||||
end if
|
||||
end proc
|
||||
|
||||
|
||||
//***************************************************************************//
|
||||
// Generál egy Delphi-s karakterláncot, ami felsorolja egy adott entitás //
|
||||
// összes ősosztályát, $ -ral elválasztva. (homlokzat) //
|
||||
//***************************************************************************//
|
||||
template GenerateSuperProviderString(MClass as ENTITY)
|
||||
[if (IsMasterEntity([ENTITY]) == "false")]
|
||||
[loop (ENTITY -> SuperClass as BASECLASS)]
|
||||
[GenerateSuperProviderStringCore([ENTITY])][break]
|
||||
[end loop]
|
||||
[end if]
|
||||
''
|
||||
end template
|
||||
|
||||
|
||||
//***************************************************************************//
|
||||
// Generál egy Delphi-s karakterláncot, ami felsorolja egy adott entitás //
|
||||
// összes ősosztályát, $ -ral elválasztva. (mag) //
|
||||
// //
|
||||
// REKURZÍV! //
|
||||
//***************************************************************************//
|
||||
template GenerateSuperProviderStringCore(MClass as ENTITY)
|
||||
[if (IsMasterEntity([ENTITY]) == "false")]
|
||||
[loop (ENTITY -> SuperClass as BASECLASS)]
|
||||
'$[BASECLASS.name]' +
|
||||
[GenerateSuperProviderStringCore([BASECLASS])][break]
|
||||
[end loop]
|
||||
[end if]
|
||||
end template
|
||||
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue