Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

  • Hard to understand from the docs how lists in different parts of .ds.xml work

    Hi Isomorphic,

    please see how I struggled to understand how to define Validator.dependentFields here (I'm only talking about definition in XML, not the effect).

    Actually there are different ways here to define lists in different cases and it's not easy to see how to apply a list correctly:


    Validator.dependentFields:
    Code:
    public java.lang.String[] dependentFields
    
    User-defined list of fields on which this validator depends.
    
    -->
     <dependentFields>
        <dependentField>inStock</dependentField>
        <dependentField>unitCost</dependentField>
    </dependentFields>

    OperationBinding.groupBy:
    Code:
    public java.lang.String[] groupBy
    
    List of fields to group by when using server-side summarization.
    
    -->
    <operationBinding operationType="fetch" operationId="count">
                <summaryFunctions>
                    <OBJECT_COUNT>count</OBJECT_COUNT>
                </summaryFunctions>
                <groupBy>STATUS_SHORTNAME</groupBy>
                <groupBy>STATUS_SUBTYPE</groupBy>
    </operationBinding>

    From the docs I don't get why the way of defining things is different here. An example in the respective docs would definitely help (like you do e.g. here for OperationBinding.criteria).

    OperationBinding.requiresRole on the other hand (e.g., there are many of these) which takes a comma separated list, is clear here:
    Code:
    public java.lang.String requiresRole
    
    Comma-separated list of user roles that are allowed to invoke the operation described by this operationBinding.
    Best regards
    Blama
    Last edited by Blama; 10th Jan 2019, 15:35. Reason: formatted

  • #2
    The standard format for multiple items is covered here, which is linked in bold text from literally all of the tags in the documentation for the .ds.xml format.

    If you do not see inline documentation for a shorthand format, the above standard format is the one to use.

    Comment


    • #3
      Hi Isomorphic,

      thanks, that it the information I was looking for. But what about groupBy then? In my example in #1 (which comes from one of my files), the syntax differs from e.g. Validator.dependentFields.
      Is my syntax there wrong then?

      I think I got it from ServerSummaries and just added a 2nd field.

      Best regards
      Blama

      Comment


      • #4
        groupBy can be either singular or plural. The example shows a valid singular format. Your attempt at a plural format doesn't match the docs, and isn't supported (even though it happened to work) and you should fix it to match the documented format.

        Comment


        • #5
          Hi Isomorphic,

          I'll do that, but I'm not clear about the expected structure in this special case. It's clear here:
          • operationBindings: List of <operationBinding> (without plural "s") inside <operationBindings></operationBindings>
          • fields: List of <field> (without plural "s") inside <fields></fields>
          But for "groupBy": Not sure how to make the singular-list-version inside a plural-tag here. Can you explain what is expected here?

          Best regards
          Blama

          Comment


          • #6
            The inner tag name doesn’t matter.

            Comment


            • #7
              Hi Isomorphic,

              Originally posted by Isomorphic View Post
              The inner tag name doesn't matter.
              this is not true for me, please see this thread.

              Best regards
              Blama

              Comment


              • #8
                The information given above is correct. However, there was a problem for this one attribute, affecting this edge case of specifying static grouping in .ds.xml. We're fixing it.

                Comment


                • #9
                  Hi Isomorphic,

                  thanks. As this was not clear to me AND was only working the way I did it, other users will have the same .ds.xml structure as I do if they groupBy more than one field.
                  So if your fix breaks this, perhaps the fix - or just the removing of this undocumented but working structure - should be done in a version change, because it will hit others out of nowhere.

                  Best regards
                  Blama

                  Comment


                  • #10
                    Hi Isomorphic,

                    now that the issue from #7 is fixed and both syntax are working, I think it would be good if you added an example for 1 and 2 groupBy fields in the docs, so that all new users use the correct way. I know that it is possible to find it here in general, but it is not clear that one can choose an arbitrary inner tag, so I'm pretty sure people will tend to use the way I was doing in #1.

                    Best regards
                    Blama

                    Comment

                    Working...
                    X