How was schema affected by OPENDJ-2774?

Tagged: , , , ,

This topic has 3 replies, 2 voices, and was last updated 4 years, 7 months ago by Ludo.

  • Author
    Posts
  • #17134
     GuyPaddock
    Participant

    I was just running across some confusing results in a local branch off of OpenDJ, and was hoping that someone on the OpenDJ team can shed some light on a few things.

    First, it looks like in OPENDJ-2774, several new XML files were added under opendj-maven-plugin/src/main/resources/config/xml/org/forgerock/opendj/server/config. But, if I am understanding things correctly, these new files do not validate properly against the schema defined by opendj-maven-plugin/src/main/resources/config/stylesheets/admin.xsd. For example, if you open opendj-maven-plugin/config/xml/org/forgerock/opendj/server/config/HTTPBasicAuthorizationMechanismConfiguration.xml (at revision 4c0475f), you’ll see that adm:constraint comes after adm:property-override, but according to the schema it’s supposed to sit between adm:synopsis and adm:profile. This isn’t the only file with these issues — there’s at least a handful — which leads me to believe that the copy of the schema included in the repo is out-of-date or is no longer being followed.

    Second, I noticed that in OpenDJ 3.0.0 the build included a step to validate the admin XML against the schema, but I don’t see any such step in the build after revision 2094606. What was the “legacy config”, and how does it relate to these new XML files? Is there a schema that these XML files are validated against? If not, what observable side effect is there if the XML is not valid (i.e. what feature(s) are affected at run-time?)?

    • This topic was modified 4 years, 7 months ago by GuyPaddock. Reason: This post was "lost" by the forums and could not be reposted in entirety
    #17144
     Ludo
    Moderator

    Hi,

    Actually the XML schema validation was mostly removed when we introduced the opendj-maven-plugin module (and then fully removed with the commit you mention, but already most of the build was skipping the schema validation).

    AFAIK, the XSLT parsing is more relaxed than schema validation and will work even though elements are not in the right order. The XML files are just used to generate code for the configuration framework (for client side and server side).
    So there should be no impact on the features at runtime.

    I hope this helps.
    Ludo

    #17147
     GuyPaddock
    Participant

    Excellent, Ludo! Thanks.

    Shame about the schema not really being applied now; it’s helpful when drafting XML for complex documents because the editor (Eclipse, IntelliJ, etc) can assist in making sure it’s valid.

    #17149
     Ludo
    Moderator

    Schema is applied… but manually when editing in the IDE.
    It seems that some of the coders that use Eclipse don’t have the schema validation enabled though.
    I’ve scanned all XML files, and there are very few issues, mostly out of order. It’s trivial to fix them manually.
    I’ll check with my colleagues if there’s a way to reenable schema validation at build time, but as I said, it’s not strictly needed.

Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.

©2021 ForgeRock - we provide an identity and access platform to secure every online relationship for the enterprise market, educational sector and even entire countries. Click to view our privacy policy and terms of use.

Log in with your credentials

Forgot your details?