Class PreferNotEmptyRule

java.lang.Object
com.jalios.jcms.tools.storemerge.rule.ConflictResolutionRule
com.jalios.jcms.tools.storemerge.rule.PreferNotEmptyRule
All Implemented Interfaces:
StoreConstants

public class PreferNotEmptyRule extends ConflictResolutionRule
This rule resolves Update/Update conflict on attribute by selecting the non empty value.
Since:
jcms-8.0.0
  • Constructor Details

    • PreferNotEmptyRule

      public PreferNotEmptyRule(String target)
  • Method Details

    • canResolveAttributeConflict

      public boolean canResolveAttributeConflict(String id, String className, String attName, String value1, String value2)
      Description copied from class: ConflictResolutionRule
      Returns true if the conflict on the given attribute can be resolved by a rule.
      Overrides:
      canResolveAttributeConflict in class ConflictResolutionRule
      Parameters:
      id - the data id
      className - the data class
      attName - the name of the attribute
      value1 - the value of the attribute in store1
      value2 - the value of the attribute in store1
      Returns:
      true if the conflict on the given attribute can be resolved by a rule.
    • getResolvedAttributeValue

      public String getResolvedAttributeValue(String id, String className, String attName, String value1, String value2)
      Description copied from class: ConflictResolutionRule
      Returns the resolved value for the conflict on the given attribute or null if the conflict must be ignored.
      Overrides:
      getResolvedAttributeValue in class ConflictResolutionRule
      Parameters:
      id - the data id
      className - the data class
      attName - the name of the attribute
      value1 - the value of the attribute in store1
      value2 - the value of the attribute in store1
      Returns:
      the resolved value for the conflict on the given attribute or null if the conflict must be ignored.
    • getAction

      public String getAction()
      Description copied from class: ConflictResolutionRule
      Returns the name of the action.
      Overrides:
      getAction in class ConflictResolutionRule
      Returns:
      the name of the action.