Interface DeltaGeneration


public interface DeltaGeneration

Provide means to determine which parts of a site (project) should be re-generated respecting the changes between two revisions. This is only supported for projects where useRelease() istrue

Create an instance via DeploymentUtil.createDeltaGeneration(context), then use the fluent api to configure the instance and finally call calculateChangeSet() and configure thegenerate task from this change set ( changeSet.configureGenerateTask(generateTask).

Set the dependency rules if you want others than the default dependency rules to be obeyed:

 deltaGeneration. dependencyRules(EnumSet.of( DependencyRule.PROPAGATE_PAGE_CHANGES_CASCADING, ..)); 

Level rules describe which part of a site should be generated if there are changesin the rendered navigation.

After configuration the change set is calculated:

 ChangeSet changeSet = deltaGeneration.calculateChangeSet(); 

Then configure the next generate task so that the calculated change set is generated:

 changeSet. configureGenerateTask(). 
Since:
5.0.26
See Also:
  • Field Details

  • Method Details

    • dependencyRules

      @NotNull @NotNull DeltaGeneration dependencyRules(@NotNull @NotNull EnumSet<DependencyRule> dependencyRules)
      The dependency rules which will be obeyed when calculating the change set.
      Parameters:
      dependencyRules - Dependency rules to obey when calculating the change set.
      Returns:
      The current instance (to allow fluent calls).
      Since:
      5.0.26
    • levelRule

      @NotNull @NotNull DeltaGeneration levelRule(int navLevelMin, int navLevelMax)
      A level rule which will be obeyed when calculating the change set.
      A level rule matches navigation changes between level navLevelMin and navLevelMax(inclusive). Level counting starts with zero, so either parameter should be at least zero, and navLevelMin should be equal or less than navLevelMax.
      If a site store folder in the given range has changed then the corresponding sub tree starting at level navLevelMin is marked as "should be re-generated".
      You can add multiple level rules if they do not overlap (overlaps will result in an IllegalArgumentException.
      Example:
      If the main navigation which is displayed on every page includes level 0 and 1, you should add the level rule [0, 1]. This would force a full generate process for any change in the top two site store levels by adding, changing or removing a top or second level navigation point. If you have also a second level navigation displaying level 2 to 4, you should add a level rule [2, 4], so that any change in the navigation of level 2, 3, and 4 will force generating the entire sub tree containing this change, starting at level 2. Example code for this is
       ChangeSet changeSet = DeploymentUtil.createDeltaGeneration(context).levelRule(0, 1) .levelRule(2, 4) ... . calculateChangeSet(); 
      Parameters:
      navLevelMin - Min level of the rule to add, should be not be greater than navLevelMax, zero denotes the root level.
      navLevelMax - Max level of the rule to add, should be not be less than navLevelMin, zero denotes the root level.
      Returns:
      The current instance (to allow fluent calls).
      Throws:
      IllegalArgumentException - Thrown if navLevelMin > navLevelMax or if there is already a level rule declared for the providedrange.
      Since:
      5.0.26
      See Also:
    • getLevelRule

      int getLevelRule(int level)
      Get the depth of the level to re-generate when a folder at the provided level has changed.

      If no explicit level rule for the requested level has been specified, then -1 will be returned.

      If a level rule has been specified for the requested level, than the"minimum level" for the corresponding rule is returned. E.g. for "level rule 1 - 3" and a requested level of 1, 2, or 3 the returned level is 1.

      Parameters:
      level - Level (i.e. distance from root).
      Returns:
      The level of the folder to re-generate when a node at the provided level has changed or -1 ifno level rule was set for the provided level.
      Since:
      5.0.26
      See Also:
    • calculateChangeSet

      @NotNull @NotNull DeltaGeneration.ChangeSet calculateChangeSet()
      Calculate the change set based on the current settings.
      Returns:
      The calculated change set.
      Since:
      5.0.26