This topic discusses the mapping classes of the PLANTA link API.
Classes
MappingBlock
The MappingBlock is the base class that wraps a record from table 562
-
It allows you to query almost all attributes a mapping element has
-
Each type of mapping has a specific subclass to implement its functionality
-
Instead of instancing
MappingBlockclasses yourself you'll want to useget_mapping_instance_from_uuid()to get a instance of the correct class -
You can create new mapping elements by calling
MappingBlock.create()and a new child to a mapping element by callingMappingBlock.create_child()on the instance
Methods
|
Function |
Parameters |
Return Value |
Description |
|---|---|---|---|
|
MappingBlock.__eq__ |
other: Another |
|
Check if a mapping is equal to another |
|
MappingBlock.__hash__ |
|
Integer |
Returns a hash based on UUID |
|
MappingBlock.__init_ |
uuid: UUID
|
Instance |
Initialize a new |
|
MappingBlock.cache_clear |
|
|
Clears the cached values in a mapping. This only affects the |
|
MappingBlock.create_child |
creation_parameters: A dictionary of attributes from table 562 to set |
A subclass of |
Create a new mapping element that is a direct child to the calling instance |
|
MappingBlock.delete |
|
|
Delete this mapping |
|
MappingBlock.generate_and_clean_up_parameters |
|
|
Populates the parameter table with the parameters defined by the mapping class. Superfluous parameters are removed. |
|
MappingBlock.get_validation_hash |
|
|
Calculate a hash over all parts of this mapping that can be modified by the user and sanity checked by PLANTA link. |
|
MappingBlock.modify_parameter |
key: Bezeichnung
|
|
Modify a parameter of this mapping. Raises a |
Classmethods
|
Function |
Parameters |
Return Value |
Description |
|---|---|---|---|
|
MappingBlock.create |
config_id: UUID
|
A subclass of |
Create a new mapping element belonging to a config. The |
|
MappingBlock.get_default_parameters |
|
A dictionary of the parameters and their default values |
Fetch the parameters and their default values |
|
MappingBlock.register_parameter |
name: Name of the parameter
|
|
Register a new parameter for this class |
|
MappingBlock.register_parameters |
|
|
A method that is called by the framework to register all parameters. By default it does nothing and must be overwritten in a subclass to call |
|
MappingBlock.unregister_parameter |
name: Name of the parameter |
|
Remove a registered parameter that is not needed. Returns |
Properties
|
Property |
Getter |
Setter |
Description |
|---|---|---|---|
|
MappingBlock.children |
A list of all mapping instances that are direct children of this mapping |
||
|
MappingBlock.config |
The |
||
|
MappingBlock.config_id |
UUID of the configuration this mapping belongs to |
||
|
MappingBlock.object |
|||
|
MappingBlock.parameters |
Returns a dictionary of Bezeichnung: Wert for the parameters of this mapping |
||
|
MappingBlock.position |
|||
|
MappingBlock.root_parent_position |
Position of the top level parent |
||
|
MappingBlock.source |
Returns the top level parent instance |
||
|
MappingBlock.type |
BaseWorkerMapping
The BaseWorkerMapping class is a flexible placeholder class that is used behind the scenes for all mappings that are not source/pool/target.
-
When executing a interface all worker mappings are initialized as
BaseWorkerMappingand during the initialization the class searches for the concrete implementation and replaces itself with that
Methods
|
Function |
Parameters |
Return Value |
Description |
|---|---|---|---|
|
BaseWorkerMapping.get_numeric_parameter |
parameter: Bezeichnung |
Wert as integer or |
Retrieve a parameter value as an integer |
BaseConverter
The BaseConverter class is the base class for all converters.
Methods
|
Function |
Parameters |
Return Value |
Description |
|---|---|---|---|
|
BaseConverter.convert |
parameter: The value returned by the previous mapping |
Should return the converted value |
This method must be overwritten in a subclass to implement a converter for PLANTA link |
BaseEnricher
The BaseEnricher class is the base class for all converters.
Methods
|
Function |
Parameters |
Return Value |
Description |
|---|---|---|---|
|
BaseEnricher.enrich |
parameter: The value returned by the previous mapping |
Should return the enriched value |
This method must be overwritten in a subclass to implement a enricher for PLANTA link |
BaseValidator
The BaseValidator class is the base class for all validators.
Methods
|
Function |
Parameters |
Return Value |
Description |
|---|---|---|---|
|
BaseValidator.check |
parameter: The value returned by the previous mapping |
|
This method must be overwritten in a subclass to implement a validator for PLANTA link. When the validation fails, a |
Functions
|
Function |
Parameters |
Return Value |
Description |
|---|---|---|---|
|
get_mapping_instance_from_uuid |
uuid: UUID
|
A mapping instance or |
Get a mapping instance from the UUID. Will return a instance of the correct class. |