Struct ::exo::dom::DataVariable

Overview

DataVariable dom node.

This node is used inside a dom to display a single variable inside an data tag. Supported fields of this node are:

  • id: The id of this node
  • status: The stati where the node should be shown
  • rights: One of the rights needed to show the node
  • edit: Defines the edit state of the node
  • readonly: Shows the variable with a view right when set
  • style: The style which should be applied to the node
  • ident: The ident of the variable to show
  • name: Override the name of the variable
  • value: A fixed OOTB value to show
  • workflow: A workflow which should be executed on every change
  • no-cache: Don't caches values of the workflow - reruns it on every open of the record
  • record: A record Uuid, or variable name with reference to record, to show the data for
  • label_break: A boolean value to break the label to a new line
  • lang: Set the field to a specifc language, empty means user language

Within the layouter this data can be used like this:

<data id="data_123" name="Your Data" collapsed>
 <variable ident="name" />
</data>

Methods

fn new() -> DataVariable

Creates a new DataVariable struct.

Example

let node = exo::dom::DataVariable::new();
node.name = "Variable";

Protocols

protocol get label_break
let output = value.label_break

Allows a get operation to work.

protocol set label_break
value.label_break = input

Allows a set operation to work.

protocol get no_cache
let output = value.no_cache

Allows a get operation to work.

protocol set no_cache
value.no_cache = input

Allows a set operation to work.

protocol get lang
let output = value.lang

Allows a get operation to work.

protocol set lang
value.lang = input

Allows a set operation to work.

protocol partial_eq
if value == b { }

Allows for partial equality operations to work.

protocol string_debug
println("{:?}", value)

Allows the value to be debug printed.

protocol string_display
println("{}", value)

Allows the value to be display printed.

protocol get id
let output = value.id

Get the id of the node as String. A node Id should be unique inside the complete dom.

Example

let node = exo::dom::DataVariable::new();
node.id = "id_123456";
assert_eq!(node.id, "id_123456");
protocol set id
value.id = input

Set the id of the node as String. A node Id should be unique inside the complete dom.

Example

let node = exo::dom::DataVariable::new();
node.id = "id_123456";
assert_eq!(node.id, "id_123456");
protocol get status
let output = value.status

Get the different status of the node as Vec<String>. This node and all it's child will only be displayed, when no status is set or the record has any of the given stati.

Example

let node = exo::dom::DataVariable::new();
node.status = ["new", "released"];
assert!(node.status.iter().any(|s| s == "new"));
protocol set status
value.status = input

Set the status of the node as Vec<String>. This node and all it's child will only be displayed, when no status is set or the record has any of the given stati.

Example

let node = exo::dom::DataVariable::new();
node.status = ["new", "released"];
assert!(node.status.iter().any(|s| s == "new"));
protocol get edit
let output = value.edit

Get the edit status of the node as Option<bool>. The edit mode can be set as true or false. When the edit mode is not set, it takes the system edit state.

Example

let node = exo::dom::DataVariable::new();
node.edit = Some(false);
assert_eq!(node.edit, Some(false));
protocol set edit
value.edit = input

Set the edit status of the node as Option<bool>. The edit mode can be set as true or false. When the edit mode is not set, it takes the system edit state.

Example

let node = exo::dom::DataVariable::new();
node.edit = Some(false);
assert_eq!(node.edit, Some(false));
protocol get style
let output = value.style

Get the style of the node as String.

Example

let node = exo::dom::DataVariable::new();
node.style = "color: red;";
assert_eq!(node.style, "color: red;");
protocol set style
value.style = input

Set the style of the node as String.

Example

let node = exo::dom::DataVariable::new();
node.style = "color: red;";
assert_eq!(node.style, "color: red;");
protocol get rights
let output = value.rights

Get the different rights of the node as Vec<String>. This node and all it's child will only be displayed, when no rights are set or the user has one of the rights.

Example

let node = exo::dom::DataVariable::new();
node.rights = ["user_right", "can_release"];
assert!(node.rights.iter().any(|s| s == "can_release"));
protocol set rights
value.rights = input

Get the different rights of the node as Vec<String>. This node and all it's child will only be displayed, when no rights are set or the user has one of the rights.

Example

let node = exo::dom::DataVariable::new();
node.rights = ["user_right", "can_release"];
assert!(node.rights.iter().any(|s| s == "can_release"));
protocol get readonly
let output = value.readonly

Get the readonly status of the node as Option<bool>. The readonly mode can be set as true or false. When the readonly mode is not set, it takes the parent state.

Example

let node = exo::dom::DataVariable::new();
node.readonly = Some(false);
assert_eq!(node.readonly, Some(false));
protocol set readonly
value.readonly = input

Set the readonly status of the node as Option<bool>. The readonly mode can be set as true or false. When the readonly mode is not set, it takes the parent state.

Example

let node = exo::dom::DataVariable::new();
node.readonly = Some(false);
assert_eq!(node.readonly, Some(false));
protocol get ident
let output = value.ident

Get the ident.

Example

let node = exo::dom::DataVariable::new();
node.ident = "name";
assert_eq!(node.ident, "name");
protocol set ident
value.ident = input

Set the ident.

Example

let node = exo::dom::DataVariable::new();
node.ident = "name";
assert_eq!(node.ident, "name");
protocol get name
let output = value.name

Get name of the node.

Example

let node = exo::dom::DataVariable::new();
node.name = "Beatiful name";
assert_eq!(node.name, "Beatiful name");
protocol set name
value.name = input

Set title of the node.

Example

let node = exo::dom::DataVariable::new();
node.name = "Beatiful name";
assert_eq!(node.name, "Beatiful name");
protocol get value
let output = value.value

Get the default value.

Example

let node = exo::dom::DataVariable::new();
node.value = exo::Ident::new("value");
assert_eq!(node.value, Some(exo::Ident::new("value")));
node.value = None;
assert_eq!(node.value, None);
protocol set value
value.value = input

Set the default value.

Example

let node = exo::dom::DataVariable::new();
node.value = exo::Ident::new("value");
assert_eq!(node.value, Some(exo::Ident::new("value")));
node.value = None;
assert_eq!(node.value, None);
protocol get workflow
let output = value.workflow

Get the workflow.

Example

let node = exo::dom::DataVariable::new();
node.workflow = "wf_dyn_data";
assert_eq!(node.workflow, "wf_dyn_data");
protocol set workflow
value.workflow = input

Set the workflow.

Example

let node = exo::dom::DataVariable::new();
node.workflow = "wf_dyn_data";
assert_eq!(node.workflow, "wf_dyn_data");
protocol get record
let output = value.record

Get the record.

Example

let node = exo::dom::DataVariable::new();
node.record = "test_var";
assert_eq!(node.record, "test_var");
protocol set record
value.record = input

Set the record.

Example

let node = exo::dom::DataVariable::new();
node.record = "test_var";
assert_eq!(node.record, "test_var");