![No UI](https://img.shields.io/static/v1?label=UI&message=none&color=inactive) >>>> Intitial Task: Make sure you have set the configuration correctly before starting the task. Otherwise, unwanted data loss may occur. With the Configurable Date Sync plugin, different date sources on assets can be written to different date targets. The following sources and destinations are possible: Sources: * Availability (from & to) * Date Infofield * Date Infofields * Version date Targets: * Availability (active / inactive / from & to) * Date Infofield The sources and targets can be combined in any way and multiple combinations can be set at the same time. The task "Configurable Date Sync: Initial Sync" is available for the migration. [MINITOC] ## Properties To be configured in {home}/appserver/conf/custom.properties ##### configurableDateSync.license > type: String, **required: yes**, default: - ##### configurableDateSync.filter > type: String, **required: no**, default: all assets Filter expression (see [Search Util 2](/celum_extensions/search_util_2)) to define which assets are processed in the initial task. If no filter is defined, all assets will be processed. ## Bean Configuration In addition to the properties, further configurations must be done using Spring Beans. The Configurable Date Sync expects an XML to be located in `{home}/appserver/spring/configurableDateSyncConfig.xml`. In the following example, the values of two information fields are written to the Asset Availability validity fields. The property "propagateDeletions" is used to determine whether deleted values in the information fields are considered. The property "deletedAvailabilityRevertsTo" defines which availability should apply if both values are deleted (availability = active / inactive). ```xml ``` In the class **ConfigurableDateSyncConfigMapping** a **dateSource** and a **dateTarget** must be configured. ###Source **Required fields** In each Mapping-Bean, one Source-Bean must be configured. The source could be an **infofieldId**, **infofiledIds** or a **source**. **infofieldId**: The source reads the date of an informationfield. The informationfield must be of type **Datefield** and configured in the information-fields.xml. > type: Long, **required: yes**, default: - ```xml ``` **infofieldIds**: The source reads the earliest or the latest date of a list of informationfields. The informationfields must be of type **Datefield** and configured in the information-fields.xml. > type: list of long (comma separated), **required: yes**, default: - * **findDate**: Defines if the minimum or maximum date is applied. > type: String (MINIMUM or MAXIMUM), **required: yes**, default: MINIMUM ```xml 112 113 ``` **source**: > type: String, **required: yes**, default: - * **versionDate:** The source reads the date of the last version added or activated. ```xml ``` * **activeFrom:** The source reads the date from field "Valid from" from Asset Availability "Date controlled". ```xml ``` * **activeTo:** The source reads the date from field "Valid to" from Asset Availability "Date controlled". ```xml ``` ###Target **Required fields** In each Mapping-Bean, one Target-Bean must be configured. The target could be an **infofieldId** or a **target**. **infofieldId**: The target writes the date to an informationfield. The informationfield must be of type **Datefield** and configured in the information-fields.xml. --> delete case > type: Long, **required: yes**, default: - ```xml ``` **target**: > type: String, **required: yes**, default: - * **activeFrom:** The target writes the date to field "Valid from" from Asset Availability "Date controlled". --> delete case ```xml ``` * **activeTo:** The target writes the date to field "Valid to" from Asset Availability "Date controlled". --> delete case ```xml ``` * **active:** The target sets the Asset Availabiliy to active, if source date is > date of yesterday. --> no delete case ```xml ``` * **inactive:** The target sets the Asset Availabiliy to inactive, if source date is <= date of yesterday. --> no delete case ```xml ``` **Optional fields** * **propagateDeletions**: The setting determines whether deleted source values should also be deleted in the target. > type: boolean, **required: no**, default: false * **deletedAvailabilityRevertsTo** The setting determines which Asset Availability should be applied, if propagateDeletions is true and activeFrom and activeTo have been deleted. > type: String, **required: yes, if propagateDeletions is true **, default: - * **active:** Sets Asset Availability to "Available". * **inactive:** Sets Asset Availability to "Not available". ###Configuration Validation When the application starts, it checks if the configuration is correct. If informationfields are configured that are not of type "Date" or if no "deletedAvailabilityRevertsTo" is determined when propagateDeletions is true, the configuration is not considered. A corresponding entry can be found in the log. ## Compatibility Matrix | Configurable Date Sync | CELUM (min. version) | |------------------------|--------------------------| | 1.0.0 | 6.4.0 (tested with 6.8) | | 1.0.1 | 6.4.0 (tested with 6.8) | | 1.1.0 | 6.4.0 (tested with 6.11) | | 1.2.0 | 6.4.0 (tested with 6.16) | ## Release Notes #### 1.0.0 > Release: 2021-02-17 Initial Version #### 1.0.1 > Release: 2021-02-26 Added SearchUtil2 #### 1.1.0 > Release: 2022-07-20 Added Infofields #### 1.2.0 > Release: 2023-10-11 find min or max date