Package gnue :: Package appserver :: Module repository
[show private | hide private]

Module gnue.appserver.repository

Classes
BaseItem Base class for repository items.
CalculatedProperty A calculated property object in the repository.
Class A class object in the repository.
Label A label object in the repository.
LabelsMixIn  
Module A module object in the repository.
Parameter A parameter object of the repository.
Procedure A procedure object in the repository.
Property A property object in the repository.
Repository This class provides access to the class repository of AppServer.

Exceptions
CircularFilterError  
ClassLabelNotFoundError  
ClassNotFoundError  
FilterNotFoundError  
InvalidNameError  
LabelNotFoundError  
MissingFilterClassError  
ModuleNotFoundError  
NotAReferenceError  
ParameterNotFoundError  
ParameterValidationError  
ProcedureNotFoundError  
ProcLabelNotFoundError  
PropertyNotFoundError  
TypeFormatError  
TypeNameError  
ValidationError  

Function Summary
  createName(namespace, identifier)
This function creates a fully qualified name from namespace and identifier.
  getLanguages(language)
Create an ordered list of languages to fetch labels for.
  splitName(name)
This function splits the given name into namespace and identifier parts.
  updateTypeInfo(item)
This function updates all type information in a given dictionary.
  verifyBasetype(typename, length, scale)
Verify a given typename with length and scale.
  verifyProcedure(aProc)
This function checks the resulttype of a procedure definition, and all parameter types (if available).
  verifyType(typename, length, scale, classes)
This function verifies a given type, length and scale combination, optionally using the given class dictionary for lookups of references.

Variable Summary
dict BASE_TYPES = {'boolean': True, 'string': True, 'time': T...
dict NOLS_TYPES = {'date': 1, 'boolean': 1, 'datetime': 1, 'i...
dict NONREF_TYPES = {'string': True, 'number': True, 'datetim...
int REF_LENGTH = 32                                                                    
int REF_SCALE = 0                                                                     
str REF_TYPE = 'string'

Function Details

createName(namespace, identifier)

This function creates a fully qualified name from namespace and identifier. If the result is not a valid name, an InvalidNameError will be raised.
Parameters:
namespace - the namespace to use
identifier - the identifier to use
Returns:
fully qualified name: 'namespace_idendifier'

getLanguages(language)

Create an ordered list of languages to fetch labels for. The list starts with the most specific language and contains at least 'C'. The language 'de_AT' will result in a list ['de_AT', 'de', 'C'].
Parameters:
language - language (locale) to create a list for, e.g. 'de_AT'
Returns:
list of language-codes in descending order

splitName(name)

This function splits the given name into namespace and identifier parts. If name does not contain a namespace at all, it will be left empty. If the resulting tuple has more than two parts an InvalidNameError will be raised.
Parameters:
name - the name to be split into namespace and identifier
Returns:
tuple (namespace, identifier) where namespace could be an empty string if name had no namespace information at all

updateTypeInfo(item)

This function updates all type information in a given dictionary. It assumes to find the keys 'gnue_type', 'gnue_length' and 'gnue_scale' in the dictionary. After updating the dictionary will contain the following additional keys: fullType, dbFullType, dbType, dbLength and dbScale
Parameters:
item - dictionary to update type information

verifyBasetype(typename, length, scale)

Verify a given typename with length and scale. If this combination makes no sense a TypeFormatError will be raised. If typename is no valid base type a TypeNameError will be raised.
Parameters:
typename - name of the datatype
length - length of the datatype
scale - scale of the datatype
Raises:
TypeFormatError - the combination of length and scale is not valid
TypeNameError - typename is not a valid base type

verifyProcedure(aProc)

This function checks the resulttype of a procedure definition, and all parameter types (if available).
Parameters:
aProc - procedure wrapper item to be checked

verifyType(typename, length, scale, classes)

This function verifies a given type, length and scale combination, optionally using the given class dictionary for lookups of references.
Parameters:
typename - name of the datatype
length - length of the datatype
scale - scale of the datatype
classes - class dictionary to check for reference types
Returns:
If 'typename' is a reference type this function returns the class definition of this reference type, otherwise None
Raises:
TypeFormatError - the type, length and scale combination is not valid

Variable Details

BASE_TYPES

Type:
dict
Value:
{'boolean': True,
 'date': True,
 'datetime': True,
 'id': True,
 'number': True,
 'string': True,
 'time': True}                                                         

NOLS_TYPES

Type:
dict
Value:
{'date': 1, 'boolean': 1, 'datetime': 1, 'id': 1, 'time': 1}           

NONREF_TYPES

Type:
dict
Value:
{'boolean': True,
 'date': True,
 'datetime': True,
 'number': True,
 'string': True,
 'time': True}                                                         

REF_LENGTH

Type:
int
Value:
32                                                                    

REF_SCALE

Type:
int
Value:
0                                                                     

REF_TYPE

Type:
str
Value:
'string'                                                               


GNUe Home

Public API

Developer's Corner