Skip to content

Commit

Permalink
delete node permanent param
Browse files Browse the repository at this point in the history
  • Loading branch information
saidone75 committed May 2, 2023
1 parent cd9949d commit cb4dd1d
Show file tree
Hide file tree
Showing 4 changed files with 53 additions and 28 deletions.
64 changes: 37 additions & 27 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ If none of the predefined Collectors/Processors meet your needs, simply write yo
The QueryNodeCollector takes an Alfresco FTS query, execute it on a separate thread and feed the queue:
```json
"collector": {
"name": "QueryNodeCollector",
"args": {
"query": "PATH:'/app:company_home/*' AND TYPE:'cm:folder'"
}
"name": "QueryNodeCollector",
"args": {
"query": "PATH:'/app:company_home/*' AND TYPE:'cm:folder'"
}
}
```
#### NodeListCollector
The NodeListCollector takes an input file containing a list of node-id with each id on a separate line, e.g.:
Expand All @@ -37,39 +37,49 @@ and the path of the file need to be specified in the config:
```
### Processing nodes
#### DeleteNodeProcessor
Delete the collected nodes, no further configuration required.
Delete the collected nodes, set the `permanent` flag to true if you want to delete the nodes directly rather than move them into the trashcan:
```json
"processor": {
"name": "DeleteNodeProcessor",
"args": {
"permanent": true
}
}
```
#### AddAspectsAndSetPropertiesProcessor
Add a list of aspects and apply a map of properties to the collected nodes:
```json
"processor": {
"name": "AddAspectsAndSetPropertiesProcessor",
"args": {
"properties": {
"cm:publisher": "saidone",
"cm:contributor": "saidone"
},
"aspects": [
"cm:dublincore"
]
}
"name": "AddAspectsAndSetPropertiesProcessor",
"args": {
"properties": {
"cm:publisher": "saidone",
"cm:contributor": "saidone"
},
"aspects": [
"cm:dublincore"
]
}
}
```
#### SetPermissionsProcessor
Apply a list of permissions and set inheritance flag to the collected nodes:
```json
"processor": {
"name": "SetPermissionsProcessor",
"args": {
"permissions": {
"isInheritanceEnabled": false,
"locallySet": [
{
"authorityId": "GROUP_EVERYONE",
"name": "Collaborator",
"accessStatus": "ALLOWED"
}
]
}
"name": "SetPermissionsProcessor",
"args": {
"permissions": {
"isInheritanceEnabled": false,
"locallySet": [
{
"authorityId": "GROUP_EVERYONE",
"name": "Collaborator",
"accessStatus": "ALLOWED"
}
]
}
}
}
```
#### Custom processor
Custom processors can be easily created by extending the AbstractNodeProcessor and overwriting the `processNode` method:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public class DeleteNodeProcessor extends AbstractNodeProcessor {
public void processNode(String nodeId, ProcessorConfig config) {
log.debug("deleting node --> {}", nodeId);
if (config.getReadOnly() != null && !config.getReadOnly()) {
nodesApi.deleteNode(nodeId, true);
nodesApi.deleteNode(nodeId, config.getArg("permanent") != null ? (Boolean) config.getArg("permanent") : false);
}
}

Expand Down
15 changes: 15 additions & 0 deletions src/main/resources/example-delete-node.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"collector": {
"name": "QueryNodeCollector",
"args": {
"query": "TYPE:'cm:folder' AND PATH:'/app:company_home/*'"
}
},
"processor": {
"name": "DeleteNodeProcessor",
"args": {
"permanent": true
},
"readOnly": true
}
}
File renamed without changes.

0 comments on commit cb4dd1d

Please sign in to comment.