Git Product home page Git Product logo

Comments (8)

kwin avatar kwin commented on June 24, 2024

@henrykuijpers Thanks for the report. Which one do you mean by

latest aem-content-classifications jar

Can you give the concrete version? At least the source maps look all correct to me:

from aem-classification.

henrykuijpers avatar henrykuijpers commented on June 24, 2024

Hi @kwin , we further debugged the issue. There seems to be an issue with the merging of the maps, and also something with determining whether the parent is more restrictive or not. We're using the following configuration:

<plugin>
                    <groupId>org.apache.jackrabbit</groupId>
                    <artifactId>filevault-package-maven-plugin</artifactId>
                    <configuration>
                        ...
                        <validatorsSettings>
                            <netcentric-aem-classification>
                                <options>
                                    <maps>tccl:biz/netcentric/filevault/validator/maps/aem-classification-map-deprecations/graniteuideprecations.map,tccl:biz/netcentric/filevault/validator/maps/aem-classification-map-repo-annotations.map</maps>
                                </options>
                            </netcentric-aem-classification>
                        </validatorsSettings>
                    </configuration>
                    <dependencies>
                        <dependency>
                            <groupId>biz.netcentric.filevault.validator</groupId>
                            <artifactId>aem-classification-validator</artifactId>
                            <version>1.0.1</version>
                        </dependency>
                        <!-- the dependency containing the actual classification map -->
                        <dependency>
                            <groupId>biz.netcentric.filevault.validator.maps</groupId>
                            <artifactId>aem-classification-map-repo-annotations</artifactId>
                            <version>6.5.3.0</version>
                        </dependency>
                        <dependency>
                            <groupId>biz.netcentric.filevault.validator.maps</groupId>
                            <artifactId>aem-classification-map-deprecations</artifactId>
                            <version>6.5.0.0</version>
                        </dependency>
                    </dependencies>

There seems to be an issue on this line:
https://github.com/Netcentric/aem-classification/blob/master/aem-classification-validator/src/main/java/biz/netcentric/filevault/validator/aem/classification/ContentClassificationMapperImpl.java#L244

The 2 ordinal values that are compared are the same, which causes the item to not be added. This is because the map by default contains 4 entries, including this one:

When the tool checks for the restriction on /libs/granite/ui/components/coral/foundation/form/field, it does not find a match. It should probably return null there. However, instead of doing that, it checks if there is a parent restriction. It does so by continuing to check the parents until it is at the root node. The root node, however, is defined and is PUBLIC. Since the field-node is also PUBLIC, the ordinals are indeed the same. This causes the item to never be added to the map.

Later on, checks are done and the field-node is being checked. It is however not there, due to the merging issue. Then, the parent of the field-node is checked and unfortunately the parent of the field node (the form-node) is FINAL. This in the end causes the validator to report the error.

from aem-classification.

kwin avatar kwin commented on June 24, 2024

@henrykuijpers Thanks for the detailed analysis. Indeed the merge does not behave correctly. I think we actually need to keep all maps as is (and don't try to do any premature optimization) and do the check of the actual content classification for each map individually. Then the most restrictive one wins (no matter how long the matched resource type prefix). I will therefore introduce a new CompositeContentClassificationMap which implements such a logic.

from aem-classification.

henrykuijpers avatar henrykuijpers commented on June 24, 2024

That was incredibly fast! Thank you so much for fixing it! I was thinking of having a go at making a fix and providing a PR, but it would have taken me so much longer. Any idea when the new version can be released? We'd like to use it. :)

We're still wondering how volatile the classifications are, and therefore wondering if we should create a new map with every service pack install.
Or are the classifications maintained in such a way that the latest version reflects the latest AEM product's updates?

from aem-classification.

kwin avatar kwin commented on June 24, 2024

@henrykuijpers
Can you test the version 1.1.0-SNAPSHOT of aem-classification-validator from the OSSRH Snapshot repository at https://oss.sonatype.org/content/repositories/snapshots?

Regarding

if we should create a new map with every service pack install.

Usually those are very stable and won't change in SP updates. But I will soon cross-check for AEM 6.5.13 whether an update is necessary.

from aem-classification.

JelleBouwmans avatar JelleBouwmans commented on June 24, 2024

@kwin Tested with @henrykuijpers, your fix works. Thank you for the quick responses!

from aem-classification.

kwin avatar kwin commented on June 24, 2024

@henrykuijpers I now released updated versions of the maps for 6.5.13 and the newest SDK (https://repo1.maven.org/maven2/biz/netcentric/filevault/validator/maps/aem-classification-map-repo-annotations/) because there were indeed some changes from the previous maps.

from aem-classification.

henrykuijpers avatar henrykuijpers commented on June 24, 2024

@kwin I smoke tested the 6.5.13 list a bit, it looks good to me! I noticed there was 1 node that was removed from AEM 6.5.13 and thus is not in the list (was on the list as INTERNAL). It seems logical to me that once the node is removed from AEM, it will also be removed from the list.

Thank you so much for all the updates!

from aem-classification.

Related Issues (6)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.