jsf-metadata-spec-public
  1. jsf-metadata-spec-public
  2. JSF_METADATA_SPEC_PUBLIC-11

[ConditionalConstraints] Conditional Constraints Metadata

    Details

    • Type: Task Task
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: current
    • Fix Version/s: milestone 1
    • Component/s: Proposals
    • Labels:
      None
    • Environment:

      Operating System: All
      Platform: All

    • Issuezilla Id:
      11

      Description

      This issue is for tracking discussion related to Requirement #8: Conditional
      Constraints (see the requirements-elicitation.html document for a description
      of this requirement).

      Mike Aizatsky wrote:

      Aren't tasks like these easier to handle in java code than in
      declarative XML mini-language? Particulary, #8 is really easy
      performed with the help of DesignInfo from JSR-273. Any custom-based
      language will have serious limitations as for constraints support.

      Jeffrey Stephenson wrote:

      Yeah, I happen to agree with you on this one. In the tool that I work
      on, JDeveloper, we define a ValidatorCallback interface, that can be
      associated with a JSF component via a tool-specific metadata item.
      When validating a JSF page, we call into the ValidatorCallback instances
      passing them the current context and the log to put errors/warnings into,
      so that component vendors can perform additional validation of the kind
      found in the use cases for #8. I imagine something very similar can be
      standardized in JSR 273.

      However, if anyone has any ideas on how to express these constraints
      declaratively, it is certainly worth discussing further.

        Activity

        Hide
        jrstephe added a comment -

        Gavin Cornwell wrote:

        As Mike says this is probably done better in Java, so in the first
        version of the spec we could support simple scenarios and a future
        iteration of the spec could extend this to allow Java code?

        For our use cases, we literally just need the ability to say "if
        property x is populated don't allow children" or "if property x is
        populated then property y should also be".

        These two scenarios could be supported with something like the
        following:

        <condition property="x">
        <prohibit-children />
        </condition>

        <condition property="x">
        <required property="y" />
        <required property="z" />
        </condition>

        Or

        <condition property="x">
        <prohibited property="y" />
        </condition>

        Then in the future we could have something like:

        <condition property="x">
        <validator="org.somecompany.faces.PropertyXImpl" />
        </condition>

        Any thoughts? Is this way too restrictive?

        Show
        jrstephe added a comment - Gavin Cornwell wrote: As Mike says this is probably done better in Java, so in the first version of the spec we could support simple scenarios and a future iteration of the spec could extend this to allow Java code? For our use cases, we literally just need the ability to say "if property x is populated don't allow children" or "if property x is populated then property y should also be". These two scenarios could be supported with something like the following: <condition property="x"> <prohibit-children /> </condition> <condition property="x"> <required property="y" /> <required property="z" /> </condition> Or <condition property="x"> <prohibited property="y" /> </condition> Then in the future we could have something like: <condition property="x"> <validator="org.somecompany.faces.PropertyXImpl" /> </condition> Any thoughts? Is this way too restrictive?
        Hide
        jrstephe added a comment -

        Mike wrote:

        I'm thinking about something like "if" attribute in ant tasks. E.g.

        <required property="y" if="property-defined"/>
        <prohibit-children unless="property-defined"/>

        This makes an XML easier to read and author. It's also extensible - we
        can always the "condition language". This, however, brings additional
        "language" in the scope, which might sound scary and difficult.

        Show
        jrstephe added a comment - Mike wrote: I'm thinking about something like "if" attribute in ant tasks. E.g. <required property="y" if="property-defined "/> <prohibit-children unless="property-defined "/> This makes an XML easier to read and author. It's also extensible - we can always the "condition language". This, however, brings additional "language" in the scope, which might sound scary and difficult.

          People

          • Assignee:
            jrstephe
            Reporter:
            jrstephe
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated: