Uploaded image for project: 'Nuxeo Studio'
  1. Nuxeo Studio
  2. NXS-4066

Move the parameters field in page providers screen to advanced parameters

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 62
    • Fix Version/s: 64
    • Component/s: Page Providers

      Description

      SITUATION / CONTEXT

      • In Studio, without JSF UI enabled
      • Users are being confused because the parameters field is available but can't be used with web ui:
        => currentDocument is not available because web ui is stateless
        => same for currentUser (it could be passed but would have a performance cost)
        => currentDate can be handled client side and long term solution is to implement a now() function in NXQL
        => quoting a discussion in slack:

      bertrand:
      final question on this subject I think: in the case of page providers, do we provide an EL context and variables that could be leveraged by users in their query for Web UI?
      (still trying to determine if we should keep the parameters field in Studio without JSF UI, so far I don't see a good reason to)

      guillaume:
      From what I see no, the only case is for https://github.com/nuxeo/nuxeo/blob/master/nuxeo-features/nuxeo-automation/nuxeo-automation-features/src/main/java/org/nuxeo/ecm/automation/core/operations/services/DocumentPageProviderOperation.java#L315 where we try to resolve potential el param but works only is seam installed

      Note: Anahide explained page providers could still be used in a context where params can be resolved on the server => we won't remove the option but we should adapt it.

      GOAL

      • Prevent user confusion by moving the parameters field

      TODO

      • Move the "parameters" field into the "advanced" parameters of the page providers screen, as the first option
      • Remove associated validation warnings (e.g. number of parameters does not match the query) when JSF UI is not activated
      • Update labels for:

      Query Filter
      Write the [NXQL](link to https://doc.nuxeo.com/nxdoc/nxql/ that opens up in a new page) query (without the "SELECT * FROM Document WHERE" part which is already generated). This will be used as a base, to which you can add optional filters using the fields below.

      Query Parameters
      In the query filter field, variables can be defined using the ? keyword if you are using JSF UI. Using Web UI, parameters can be resolved server side using custom Java code.

      When adding variables, the corresponding parameters have to be added here in the same order. You can refer to the [Understand Expression and Scripting Languages Used in Nuxeo](link to https://doc.nuxeo.com/nxdoc/understand-expression-and-scripting-languages-used-in-nuxeo opening up in a new page) documentation to see available variables.

      HOW TO TEST
      Note: to be checked using an existing application that already has a page provider with parameters and a newly created one

      • In the application dependencies screen, activate JSF UI
      • Check that parameters appear in the advanced parameters area as the first option
      • Parameters should still be there for existing page providers that had parameters already
      • Create a page provider with one ? in the query and two parameters
        => A warning is displayed about this discrepancy
      • Download package
        => Parameters can be found in the extensions.xml file
      • Remove dependency to JSF UI
        => Warning is not visible anymore
      • Download package
        => Parameters can be found in the extensions.xml file
      • Activate JSF UI again
        => Warning is back

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 30 minutes
                  30m