@ProviderType
public interface ContentUpgrade
| Modifier and Type | Method and Description |
|---|---|
ContentUpgrade |
doActivateContainingPage()
Activates the page where the resource is located.
|
ContentUpgrade |
doActivateResource()
Activates the resource.
|
ContentUpgrade |
doAddTagsToContainingPage(String... tags)
Adds tags to the containing page of the matching resource.
|
ContentUpgrade |
doAddValuesToMultiValueProperty(String name,
String[] values)
Adds values to a multivalue property.
|
ContentUpgrade |
doCheckPageRendering()
Checks if the containing page renders with status code 200.
|
ContentUpgrade |
doCheckPageRendering(int code)
Checks if the containing page renders with given status code.
|
ContentUpgrade |
doCheckPageRendering(String textPresent)
Checks if the containing page renders with status code 200 and contains given text.
|
ContentUpgrade |
doCheckPageRendering(String textPresent,
String textNotPresent)
Checks if the containing page renders with status code 200 and (not) contains given text.
|
ContentUpgrade |
doCopyPropertyToRelativePath(String name,
String newName,
String relativeResourcePath)
Copies a property to a relative path.
|
ContentUpgrade |
doCopyResourceToRelativePath(String relativePath)
Copies a resource to a relative path.
|
ContentUpgrade |
doCustomResourceBasedAction(CustomResourceAction action)
Performs a custom action with providing a function.
|
ContentUpgrade |
doDeactivateContainingPage()
Deactivates the page where the resource is located.
|
ContentUpgrade |
doDeactivateResource()
Deactivates the resource.
|
ContentUpgrade |
doDeleteContainingPage()
Deletes the page where the resource is located.
|
ContentUpgrade |
doDeleteProperty(String name)
Deletes a property if existing.
|
ContentUpgrade |
doDeleteResource()
Deletes the resource.
|
ContentUpgrade |
doMovePropertyToRelativePath(String name,
String newName,
String relativeResourcePath)
Moves a property to a relative path.
|
ContentUpgrade |
doMoveResourceToPathRegex(String matchPattern,
String targetPathExpr)
Moves a resource if its path matches the pattern to the path obtained by applying the
replacement expression
|
ContentUpgrade |
doMoveResourceToRelativePath(String relativePath)
Moves a resource to a relative path.
|
ContentUpgrade |
doRemoveTagsFromContainingPage(String... tags)
Removes tags from the containing page of the matching resource.
|
ContentUpgrade |
doRemoveValuesOfMultiValueProperty(String name,
String[] values)
Removes values of a multivalue property.
|
ContentUpgrade |
doRename(String newName)
Renames a resource to the given name.
|
ContentUpgrade |
doRenameProperty(String oldName,
String newName)
Renames a property if existing.
|
ContentUpgrade |
doReplaceValueInAllProperties(String oldValue,
String newValue)
Replaces a substring in all properties of the matching resource.
|
ContentUpgrade |
doReplaceValueInAllPropertiesRegex(String searchRegex,
String replacement)
Replaces a substring in all properties of the matching resource using a regular expression.
|
ContentUpgrade |
doReplaceValueInProperties(String oldValue,
String newValue,
String[] propertyNames)
Replaces a substring in specific properties of the matching resource.
|
ContentUpgrade |
doReplaceValueInPropertiesRegex(String searchRegex,
String replacement,
String[] propertyNames)
Replaces a substring in specific properties of the matching resource using a regular
expression.
|
ContentUpgrade |
doReplaceValuesOfMultiValueProperty(String name,
String[] oldValues,
String[] newValues)
Replaces values in a multivalue property.
|
ContentUpgrade |
doSetProperty(String name,
Object value)
Sets a property value.
|
ContentUpgrade |
doSetTagsForContainingPage(String... tags)
Sets tags for the containing page of the matching resource.
|
ContentUpgrade |
doTreeActivateContainingPage()
Activates the page tree where the resource is located.
|
ContentUpgrade |
doTreeActivateContainingPage(boolean skipDeactivated)
Activates the page tree where the resource is located.
|
void |
dryRun()
Performs a dry-run.
|
ContentUpgrade |
filterByAnyPropertyRegex(String regex)
Filters by checking if any property matches the given regular expression for the value.
|
ContentUpgrade |
filterByHasProperty(String name)
Filters by existence of a single property.
|
ContentUpgrade |
filterByMultiValuePropContains(String name,
Object[] conditionValues)
Filters by multi-value with the given name containing the given conditionValues
|
ContentUpgrade |
filterByNodeName(String nodeName)
Filters by node name exact match.
|
ContentUpgrade |
filterByNodeNameRegex(String regex)
Filters by node name using regular expression.
|
ContentUpgrade |
filterByPathRegex(String regex)
Filters by node path using regular expression.
|
ContentUpgrade |
filterByProperties(Map<String,Object> conditionProperties)
Filters by properties.
|
ContentUpgrade |
filterByProperty(String name,
Object value)
Filters by a single property.
|
ContentUpgrade |
filterByPropertyRegex(String name,
String regex)
Filters by a single property using a regular expression for the value.
|
ContentUpgrade |
filterWith(FilterBy filter)
Filters by using the given filter.
|
ContentUpgrade |
forChildResourcesOf(String path)
Loops for all child resources of the given path.
|
ContentUpgrade |
forDescendantResourcesOf(String path)
Loops recursive for all child resources of the given path.
|
ContentUpgrade |
forResources(String[] paths)
Loops for given list of resources.
|
ContentUpgrade |
forResourcesBySql2Query(String query)
Loops over resources found by SQL2 query.
|
ContentUpgrade |
forResourcesInSubtree(String path)
Loops recursive over all resources contained in the subtree at the given path.
|
ContentUpgrade |
printJson()
Prints the properties json
|
ContentUpgrade |
printPath()
Print path
|
ContentUpgrade |
printProperty(String property)
Print property
|
void |
run()
Saves all changes to repository.
|
void |
run(boolean dryRun)
Executes a run or a dryRun depending on the dryRun parameter value.
|
ContentUpgrade forResources(String[] paths)
paths - list of pathsContentUpgrade forChildResourcesOf(String path)
path - pathContentUpgrade forDescendantResourcesOf(String path)
path - pathContentUpgrade forResourcesInSubtree(String path)
path - pathContentUpgrade forResourcesBySql2Query(String query)
query - query stringContentUpgrade filterByHasProperty(String name)
name - property nameContentUpgrade filterByProperty(String name, Object value)
name - property namevalue - property valueContentUpgrade filterByPropertyRegex(String name, String regex)
name - property nameregex - regular expression to match valueContentUpgrade filterByAnyPropertyRegex(String regex)
regex - regular expression to match valueContentUpgrade filterByProperties(Map<String,Object> conditionProperties)
conditionProperties - properties to filterContentUpgrade filterByMultiValuePropContains(String name, Object[] conditionValues)
name - name of the multi-value propertyconditionValues - values to search forContentUpgrade filterByNodeName(String nodeName)
nodeName - node nameContentUpgrade filterByNodeNameRegex(String regex)
regex - regular expression (Java standard pattern)ContentUpgrade filterByPathRegex(String regex)
regex - regular expression (Java standard pattern)ContentUpgrade filterWith(FilterBy filter)
filter - filterContentUpgrade doSetProperty(String name, Object value)
name - property namevalue - property valueContentUpgrade doDeleteProperty(String name)
name - property nameContentUpgrade doRenameProperty(String oldName, String newName)
oldName - old property namenewName - new property nameContentUpgrade doCopyPropertyToRelativePath(String name, String newName, String relativeResourcePath)
name - property namenewName - new property namerelativeResourcePath - relative pathContentUpgrade doMovePropertyToRelativePath(String name, String newName, String relativeResourcePath)
name - property namenewName - new property namerelativeResourcePath - relative pathContentUpgrade doAddValuesToMultiValueProperty(String name, String[] values)
name - property namevalues - valuesContentUpgrade doRemoveValuesOfMultiValueProperty(String name, String[] values)
name - property namevalues - values to removeContentUpgrade doReplaceValuesOfMultiValueProperty(String name, String[] oldValues, String[] newValues)
name - property nameoldValues - values to removenewValues - values to addContentUpgrade doReplaceValueInAllProperties(String oldValue, String newValue)
oldValue - old valuenewValue - new valueContentUpgrade doReplaceValueInProperties(String oldValue, String newValue, String[] propertyNames)
oldValue - old valuenewValue - new valuepropertyNames - property names that should be checkedContentUpgrade doReplaceValueInAllPropertiesRegex(String searchRegex, String replacement)
searchRegex - regex to match old valuereplacement - new value, may contain matcher groups (e.g. $1)ContentUpgrade doReplaceValueInPropertiesRegex(String searchRegex, String replacement, String[] propertyNames)
searchRegex - regex to match old valuereplacement - new value, may contain matcher groups (e.g. $1)propertyNames - property names that should be checkedContentUpgrade doRename(String newName)
newName - pathContentUpgrade doCopyResourceToRelativePath(String relativePath)
relativePath - pathContentUpgrade doMoveResourceToRelativePath(String relativePath)
relativePath - pathContentUpgrade doMoveResourceToPathRegex(String matchPattern, String targetPathExpr)
matchPattern - regular expression for matching the resource pathtargetPathExpr - expression to calculate the target path, can contain matched group
references $1, $2, ...ContentUpgrade doDeleteResource()
ContentUpgrade doActivateResource()
ContentUpgrade doDeactivateResource()
ContentUpgrade doCustomResourceBasedAction(CustomResourceAction action)
action - action to perform on resourceContentUpgrade doActivateContainingPage()
ContentUpgrade doTreeActivateContainingPage()
ContentUpgrade doTreeActivateContainingPage(boolean skipDeactivated)
skipDeactivated - skip pages that are deactivatedContentUpgrade doDeactivateContainingPage()
ContentUpgrade doDeleteContainingPage()
ContentUpgrade doAddTagsToContainingPage(String... tags)
tags - tag IDs or pathsContentUpgrade doSetTagsForContainingPage(String... tags)
tags - tag IDs or pathsContentUpgrade doRemoveTagsFromContainingPage(String... tags)
tags - tag IDs or pathsContentUpgrade doCheckPageRendering()
ContentUpgrade doCheckPageRendering(int code)
code - status codeContentUpgrade doCheckPageRendering(String textPresent)
textPresent - page content must include this textContentUpgrade doCheckPageRendering(String textPresent, String textNotPresent)
textPresent - page content must include this text (can be null)textNotPresent - page content must not include this text (can be null)ContentUpgrade printPath()
ContentUpgrade printProperty(String property)
property - property nameContentUpgrade printJson()
void run()
throws org.apache.sling.api.resource.PersistenceException,
AecuException
org.apache.sling.api.resource.PersistenceException - error during executionAecuException - other errorvoid dryRun()
throws org.apache.sling.api.resource.PersistenceException,
AecuException
org.apache.sling.api.resource.PersistenceException - error doing dry-runAecuException - other errorvoid run(boolean dryRun)
throws org.apache.sling.api.resource.PersistenceException,
AecuException
dryRun - dryRun optionorg.apache.sling.api.resource.PersistenceException - error during executionAecuException - other errorCopyright © 2019. All rights reserved.