weblink - transformation
Transformer
The Transformer
is the base class that provides the API to transform values to and from web interfaces
- For a list of existing implementations see Web-Schnittstellen-Bibliothek
Methods
Function | Parameters | Return Value | Description |
---|---|---|---|
Transformer.__init_(self, web_attribute) | web_attribute: A instance of weblink.metadata.WebAttribute pointing to the 593 record this transformer applies to | Instance | Initializes a new Transformer element. |
Transformer.transform_planta_value_to_web_value(self, value) | value: The value to transform | The transformed value | Transforms a value read from a PLANTA POJO attribute to the web appropriate value. Overwrites this in a subclass to transform a PLANTA value into the value appropriate for your web interface. |
Transformer.transform_web_value_to_planta_value(self, value) | value: The value to transform | The transformed value | Transforms a value read from a web request into the PLANTA POJO attribute appropriate value. Overwrites this in a subclass to transform a PLANTA value into the value appropriate for your web interface. |
Transformer.transform(self, value) | value: The value to transform | The transformed value | Method that is called by both planta→web and web→planta transform implementations by default. |
Classmethods
Function | Parameters | Return Value | Description |
---|---|---|---|
Transformer.register_parameter(cls, name, default='') | name: Name of the parameter default: The default value | Registers a new parameter for this class | |
Transformer.register_parameters(cls) | 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 Transformer.register_parameter() for every parameter | ||
Transformer.unregister_parameter(cls, name) | name: Name of the parameter | True or False | Removes a registered parameter that is not required. Returns True when the parameter was removed and False if no parameter with that name exists. Use this to remove parameters registered by a base class that you do not need. |
Properties
Property | Getter | Setter | Description |
---|---|---|---|
Transformer.parameters | Returns a dictionary of the parameters of this transformer |