-
Notifications
You must be signed in to change notification settings - Fork 69
JCRVLT-810 skip filter validation #378
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from 8 commits
ba52eff
13245e5
0216501
a0d6f3a
f032f82
d8faa69
71d7eb6
e712424
737ae4b
abe7a41
e16806c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| Manifest-Version: 1.0 | ||
| Created-By: 11.0.21 (Eclipse Adoptium) | ||
|
|
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,77 @@ | ||
| <vaultfs version="1.1"> | ||
| <!-- | ||
| Defines the content aggregation. The order of the defined aggregates | ||
| is important for finding the correct aggregator. | ||
| --> | ||
| <aggregates> | ||
| <!-- | ||
| Defines an aggregate that handles nt:file and nt:resource nodes. | ||
| --> | ||
| <aggregate type="file" title="File Aggregate"/> | ||
|
|
||
| <!-- | ||
| Defines an aggregate that handles file/folder like nodes. It matches | ||
| all nt:hierarchyNode nodes that have or define a jcr:content | ||
| child node and excludes child nodes that are nt:hierarchyNodes. | ||
| --> | ||
| <aggregate type="filefolder" title="File/Folder Aggregate"/> | ||
|
|
||
| <!-- | ||
| Defines an aggregate that handles nt:nodeType nodes and serializes | ||
| them into .cnd notation. | ||
| --> | ||
| <aggregate type="nodetype" title="Node Type Aggregate" /> | ||
|
|
||
| <!-- | ||
| Defines an aggregate that defines full coverage for certain node | ||
| types that cannot be covered by the default aggregator. | ||
| --> | ||
| <aggregate type="full" title="Full Coverage Aggregate"> | ||
| <matches> | ||
| <include nodeType="rep:AccessControl" respectSupertype="true" /> | ||
| <include nodeType="rep:Policy" respectSupertype="true" /> | ||
| <include nodeType="cq:Widget" respectSupertype="true" /> | ||
| <include nodeType="cq:EditConfig" respectSupertype="true" /> | ||
| <include nodeType="cq:WorkflowModel" respectSupertype="true" /> | ||
| <include nodeType="vlt:FullCoverage" respectSupertype="true" /> | ||
| <include nodeType="mix:language" respectSupertype="true" /> | ||
| <include nodeType="sling:OsgiConfig" respectSupertype="true" /> | ||
| </matches> | ||
| </aggregate> | ||
|
|
||
| <!-- | ||
| Defines an aggregate that handles nt:folder like nodes. | ||
| --> | ||
| <aggregate type="generic" title="Folder Aggregate"> | ||
| <matches> | ||
| <include nodeType="nt:folder" respectSupertype="true" /> | ||
| </matches> | ||
| <contains> | ||
| <exclude isNode="true" /> | ||
| </contains> | ||
| </aggregate> | ||
|
|
||
| <!-- | ||
| Defines the default aggregate | ||
| --> | ||
| <aggregate type="generic" title="Default Aggregator" isDefault="true"> | ||
| <matches> | ||
| <!-- all --> | ||
| </matches> | ||
| <contains> | ||
| <exclude nodeType="nt:hierarchyNode" respectSupertype="true" /> | ||
| </contains> | ||
| </aggregate> | ||
|
|
||
| </aggregates> | ||
|
|
||
| <!-- | ||
| defines the input handlers | ||
| --> | ||
| <handlers> | ||
| <handler type="folder"/> | ||
| <handler type="file"/> | ||
| <handler type="nodetype"/> | ||
| <handler type="generic"/> | ||
| </handlers> | ||
| </vaultfs> |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| <?xml version="1.0" encoding="UTF-8"?> | ||
| <jcr:root xmlns:vlt="http://www.day.com/jcr/vault/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0" | ||
| jcr:created="{Date}2011-06-07T14:31:49.179-07:00" | ||
| jcr:createdBy="admin" | ||
| jcr:description="" | ||
| jcr:lastModified="{Date}2011-06-07T14:31:49.179-07:00" | ||
| jcr:lastModifiedBy="admin" | ||
| jcr:primaryType="vlt:PackageDefinition" | ||
| buildCount="1" | ||
| cqVersion="5.3" | ||
| group="my_packages" | ||
| lastUnwrapped="{Date}2011-06-07T14:31:49.179-07:00" | ||
| lastUnwrappedBy="admin" | ||
| lastWrapped="{Date}2011-06-07T14:31:49.179-07:00" | ||
| lastWrappedBy="admin" | ||
| name="tmp" | ||
| version=""> | ||
| <filter jcr:primaryType="nt:unstructured"> | ||
| <f0 | ||
| jcr:primaryType="nt:unstructured" | ||
| mode="replace" | ||
| root="/tmp" | ||
| rules="[]"/> | ||
| </filter> | ||
| </jcr:root> |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| <?xml version="1.0" encoding="UTF-8"?> | ||
| <workspaceFilter version="1.0"> | ||
| <filter root="/tmp"> | ||
| <exclude pattern="^.*/excludedProp.*" matchProperties="true"/> | ||
| </filter> | ||
| </workspaceFilter> |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| <'sling'='http://sling.apache.org/jcr/sling/1.0'> | ||
| <'nt'='http://www.jcp.org/jcr/nt/1.0'> | ||
|
|
||
| [sling:Folder] > nt:folder | ||
| - * (undefined) | ||
| - * (undefined) multiple | ||
| + * (nt:base) = sling:Folder version | ||
|
|
||
| [sling:OrderedFolder] > sling:Folder | ||
| orderable | ||
| + * (nt:base) = sling:OrderedFolder version | ||
|
|
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| <?xml version="1.0" encoding="utf-8" standalone="no"?> | ||
| <!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd"> | ||
| <properties> | ||
| <comment>FileVault Package Properties</comment> | ||
| <entry key="createdBy">admin</entry> | ||
| <entry key="name">tmp</entry> | ||
| <entry key="lastModified">2011-06-07T14:31:49.179-07:00</entry> | ||
| <entry key="lastModifiedBy">admin</entry> | ||
| <entry key="created">2011-06-07T14:31:49.418-07:00</entry> | ||
| <entry key="buildCount">1</entry> | ||
| <entry key="version"/> | ||
| <entry key="dependencies"/> | ||
| <entry key="packageFormatVersion">2</entry> | ||
| <entry key="description"/> | ||
| <entry key="group">my_packages</entry> | ||
| <entry key="lastWrapped">2011-06-07T14:31:49.179-07:00</entry> | ||
| <entry key="lastWrappedBy">admin</entry> | ||
| <entry key="path">/etc/packages/my_packages/tmp</entry> | ||
| </properties> |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| <?xml version="1.0" encoding="UTF-8"?> | ||
| <jcr:root xmlns:sling="http://sling.apache.org/jcr/sling/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:rep="internal" | ||
| jcr:mixinTypes="[rep:AccessControllable]" | ||
| jcr:primaryType="rep:root" | ||
| sling:resourceType="sling:redirect" | ||
| sling:target="/welcome.html"> | ||
| <home/> | ||
| <rep:policy/> | ||
| <jcr:system/> | ||
| <etc/> | ||
| <apps/> | ||
| <libs/> | ||
| <content/> | ||
| <var/> | ||
| <tmp/> | ||
| </jcr:root> |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| <?xml version="1.0" encoding="UTF-8"?> | ||
| <jcr:root xmlns:sling="http://sling.apache.org/jcr/sling/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0" | ||
| jcr:primaryType="sling:OrderedFolder"> | ||
| <foo/> | ||
| </jcr:root> |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| <?xml version="1.0" encoding="UTF-8"?> | ||
| <jcr:root xmlns:sling="http://sling.apache.org/jcr/sling/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0" | ||
| jcr:primaryType="sling:OrderedFolder"> | ||
| <bar/> | ||
| </jcr:root> |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| <?xml version="1.0" encoding="UTF-8"?> | ||
| <jcr:root xmlns:sling="http://sling.apache.org/jcr/sling/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0" | ||
| jcr:primaryType="sling:OrderedFolder"> | ||
| <tobi/> | ||
| </jcr:root> |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| <?xml version="1.0" encoding="UTF-8"?> | ||
| <jcr:root xmlns:sling="http://sling.apache.org/jcr/sling/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0" | ||
| jcr:primaryType="sling:OrderedFolder" | ||
| excludedProp="excluded property" | ||
| /> |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -105,6 +105,11 @@ public class DefaultWorkspaceFilter implements Dumpable, WorkspaceFilter { | |
| */ | ||
| private ImportMode importMode; | ||
|
|
||
| /** | ||
| * skip filter checks when importing content | ||
| */ | ||
| private boolean skipFilterChecksOnImport = false; | ||
|
|
||
| /** | ||
| * Add a #PathFilterSet for nodes items. | ||
| * @param set the set of filters to add. | ||
|
|
@@ -232,6 +237,14 @@ public void setImportMode(ImportMode importMode) { | |
| this.importMode = importMode; | ||
| } | ||
|
|
||
| public void setSkipFilterChecksOnImport(boolean skipFilterChecksOnImport) { | ||
| this.skipFilterChecksOnImport = skipFilterChecksOnImport; | ||
| } | ||
|
|
||
| public boolean getSkipFilterChecksOnImport() { | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If this only affects import I would rather move it to
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No need to add new methods/fields to WorkspaceFilter then, just use the one from ImportOptions directly (i.e. pass as boolean argument to
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Those methods should not be added to DefaultWorkspaceFilter either. Rather pass that as dedicated boolean flag to the importer.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. you mean extending the (already quite long) constructor of the
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I see these methods only being used once each....
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I tried to backtrack from the constructor of the DocViewImporter, which methods would need to be changed, and the list is getting long; where annotated with But it shows, that passing this parameter through the entire call chain(s) would be quite an effort, and for that reason I augmented the DefaultWorkspaceFilter.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. But both FileArtifactHandler:accept and GenericArtifactHandler:accept have access to the ImportOptions which expose that already, so it needs to be passed along DocViewImporter, AbstractArtifactHandler:importDocView and FileArtifactHandler:importDocView which seems acceptable to me. Right now it really is duplicate in ImporterOptions and WorkspaceFilter.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I can try to take a stab at it.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I went through and changed them ... a bit less changes than I actually anticipated. |
||
| return this.skipFilterChecksOnImport; | ||
| } | ||
|
|
||
| /** | ||
| * {@inheritDoc} | ||
| */ | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add some assertions what happens to nodes/properties below filter roots not contained in the package.