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(ScheduleContext)DeploymentUtil.createDeltaGeneration(context)
, then
use the fluent api to configure the instance and finally call calculateChangeSet()
and configure the
generate task from this change set (ChangeSet#configureGenerateTask(GenerateTask)changeSet.configureGenerateTask(generateTask
).
Set the dependency rules
if you want others than the 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 changes
in 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()
.
DeploymentUtil.createDeltaGeneration(ScheduleContext)
Modifier and Type | Interface and Description |
---|---|
static interface |
DeltaGeneration.ChangeSet
Change set wrapping the calculated changes of a
DeltaGeneration . |
static interface |
DeltaGeneration.DeletedPageInfo
Info describing a deleted page.
|
Modifier and Type | Field and Description |
---|---|
static Set<DependencyRule> |
DEFAULT_DEPENDENCY_RULES
Default dependency rules, containing:
PROPAGATE_PAGE_CHANGES
PROPAGATE_SECTION_CHANGES
PROPAGATE_MEDIA_CHANGES_TO_PAGESTORE
PROPAGATE_MEDIA_CHANGES_TO_SITESTORE
|
static String |
DELTA_GENERATION_LAST_EXECUTION
Property name containing the revision id of last delta generation process (type
Long ). |
Modifier and Type | Method and Description |
---|---|
DeltaGeneration.ChangeSet |
calculateChangeSet()
Calculate the change set based on the current settings.
|
DeltaGeneration |
dependencyRules(EnumSet<DependencyRule> dependencyRules)
The dependency rules which will be obeyed when
calculating the change set . |
int |
getLevelRule(int level)
Get the depth of the level to re-generate when a folder at the provided level has changed.
|
DeltaGeneration |
levelRule(int navLevelMin,
int navLevelMax)
A level rule which will be obeyed when
calculating the change set . |
static final String DELTA_GENERATION_LAST_EXECUTION
Long
).ScriptContext.getProperty(String)
,
Constant Field Valuesstatic final Set<DependencyRule> DEFAULT_DEPENDENCY_RULES
@NotNull DeltaGeneration dependencyRules(@NotNull EnumSet<DependencyRule> dependencyRules)
calculating the change set
.dependencyRules
- Dependency rules to obey when calculating the change set.@NotNull DeltaGeneration levelRule(int navLevelMin, int navLevelMax)
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, andnavLevelMin
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 levelnavLevelMin
is marked as "should be re-generated".
You can add multiple level rules if they do not overlap (overlaps will result in anIllegalArgumentException
.
Example:ChangeSet
changeSet =DeploymentUtil.createDeltaGeneration(context)
.levelRule(0, 1) .levelRule(2, 4) ... .calculateChangeSet()
;
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.IllegalArgumentException
- Thrown if navLevelMin > navLevelMax
or if there is already a level rule
declared for the provided range.getLevelRule(int)
int getLevelRule(int level)
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
.
level
- Level (i.e. distance from root).-1
if
no level rule was set for the provided level.levelRule(int,int)
@NotNull DeltaGeneration.ChangeSet calculateChangeSet()
Copyright © 2014 e-Spirit AG. All Rights Reserved. Build 5.0_BETA.500