Package Modeling :: Module ModelSet :: Class ModelSet
[show private | hide private]
[frames | no frames]

Type ModelSet

object --+
         |
        ModelSet


Holds a set of Modeling.Models that can co-exist at runtime

Two models cannot be stored within a single ModelSet if and only if there is an entity in the first model that has the same name than a entity in the second model.


Method Summary
  __init__(self)
Initializes a modelset
  addModel(self, aModel)
Add a model to the model set.
  addModelFromXML(self, xmlSource)
Instanciates the model from datas in xmlSource and adds it to the modelSet.
  classDescriptionForEntityName(self, entityName)
Returns the class description for that entity, or None if that entity cannot be found.
  classDescriptionForName(self, entityName)
Returns the class description for that entity, or None if that entity cannot be found.
  entitiesNames(self)
Returns the whole set of entities' name controlled by the receiver.
  entityNamed(self, aName)
Search an entity named 'aName' in the models contained in this modelset, and returns it, or None if it cannot be found
  getXMLDOMForModelNamed(self, aModelName, encoding)
Returns the XML DOM for the specified model, or None if it does not exist
  getXMLStreamForModelNamed(self, aModelName, encoding)
Returns the XML stream for the specified model, or None if it does not exist.
  handleNotification(self, notification)
Handles notification 'ClassDescription.ClassDescriptionNeededForEntityNameNotification'.
  modelForEntityNamed(self, aName)
Returns the model holding the entity named 'aName', or 'None' if it cannot be found
  modelNamed(self, aName)
Returns the model named 'aName', or None if it cannot be found
  models(self)
Returns the full set of contained models
  modelsNames(self)
Returns the full set of contained models'names
  name(self)
Returns the modelsSet's name
  removeModel(self, aModel)
Removes the supplied model from the registered models.
  setName(self, aName)
Sets the modelsSet's name
    Inherited from object
  __delattr__(...)
x.__delattr__('name') <==> del x.name
  __getattribute__(...)
x.__getattribute__('name') <==> x.name
  __hash__(x)
x.__hash__() <==> hash(x)
  __new__(T, S, ...)
T.__new__(S, ...) -> a new object with type S, a subtype of T
  __reduce__(...)
helper for pickle
  __reduce_ex__(...)
helper for pickle
  __repr__(x)
x.__repr__() <==> repr(x)
  __setattr__(...)
x.__setattr__('name', value) <==> x.name = value
  __str__(x)
x.__str__() <==> str(x)

Class Variable Summary
int isLogEnabled = 0                                                                     

Method Details

__init__(self)
(Constructor)

Initializes a modelset
Overrides:
__builtin__.object.__init__

addModel(self, aModel)

Add a model to the model set. In order to be successfully added the model should not have the same name than one of the models already added to the ModelSet, nor should it hold an entity whose name is already used within the ModelSet.

Raises ModelError if the insertion of aModel fails.

If the environment variable 'MDL_DB_CONNECTIONS_CFG' is set, the file it points to is used to update aModel's connection dictionary (and possibly its adaptorName as well). See Model.updateModelWithCFG() for details.

addModelFromXML(self, xmlSource)

Instanciates the model from datas in xmlSource and adds it to the modelSet. Parameter 'xmlSource' is a dictionary containing the key 'string' or 'file' with the corresponding value. If both keys are provided, the result is undefined.

Example: aModelSet.addModelFromXML({'file': '/home/user/model.xml'})

Returns: the brand new model

classDescriptionForEntityName(self, entityName)

Returns the class description for that entity, or None if that entity cannot be found.

You should rarely need to call this method directly ; instead, use the ClassDescription's static method 'classDescriptionForName()' which takes care of finding the appropriate class description.

See also: Entity.classDescriptionForInstances()
ClassDescription.classDescriptionForName()

classDescriptionForName(self, entityName)

Returns the class description for that entity, or None if that entity cannot be found.

You should rarely need to call this method directly ; instead, use the ClassDescription's static method 'classDescriptionForName()' which takes care of finding the appropriate class description.

See also: Entity.classDescriptionForInstances()
ClassDescription.classDescriptionForName()

entitiesNames(self)

Returns the whole set of entities' name controlled by the receiver. Returns: a tuple

entityNamed(self, aName)

Search an entity named 'aName' in the models contained in this modelset, and returns it, or None if it cannot be found

getXMLDOMForModelNamed(self, aModelName, encoding='iso-8859-1')

Returns the XML DOM for the specified model, or None if it does not exist

getXMLStreamForModelNamed(self, aModelName, encoding='iso-8859-1')

Returns the XML stream for the specified model, or None if it does not exist.

handleNotification(self, notification)

Handles notification 'ClassDescription.ClassDescriptionNeededForEntityNameNotification'.

modelForEntityNamed(self, aName)

Returns the model holding the entity named 'aName', or 'None' if it cannot be found

modelNamed(self, aName)

Returns the model named 'aName', or None if it cannot be found

models(self)

Returns the full set of contained models

modelsNames(self)

Returns the full set of contained models'names

name(self)

Returns the modelsSet's name

removeModel(self, aModel)

Removes the supplied model from the registered models. Parameter 'aModel' can be either an 'Model' instance (or a instance of a class deriving from Model) or a model's name. No referential checks are done. Raises 'ModelError' if 'aModel' cannot be found.item

setName(self, aName)

Sets the modelsSet's name

Class Variable Details

isLogEnabled

Type:
int
Value:
0                                                                     

Generated by Epydoc 2.1 on Sat Mar 4 13:36:25 2006 http://epydoc.sf.net