Uploaded image for project: 'Nuxeo Platform'
  1. Nuxeo Platform
  2. NXP-25512

WebUI: Allow to override/extend fetch properties and enrichers used to browse a document

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 9.10
    • Fix Version/s: 10.3
    • Component/s: Web UI
    • Release Notes Summary:
      Allows to override/extend fetch properties and enrichers used to browse a document
    • Browser:
    • Upgrade notes:
      Hide

      You can now add new enrichers used when serializing the current document by contributing:

        <require>org.nuxeo.web.ui.properties.contrib</require>
        <extension target="org.nuxeo.runtime.ConfigurationService" point="configuration">
          <property name="org.nuxeo.web.ui.enrichers">myEnricher</property>
        </extension>
      

      You can now override the fetched properties when loading the current document (default behavior is still resolving all properties):

        <require>org.nuxeo.web.ui.properties.contrib</require>
        <extension target="org.nuxeo.runtime.ConfigurationService" point="configuration">
          <property name="org.nuxeo.web.ui.fetch.document" list="true" override="true">dc:creator</property>
          <property name="org.nuxeo.web.ui.fetch.document" >dc:nature</property>
          <property name="org.nuxeo.web.ui.fetch.document" >dc:coverage</property>
          <property name="org.nuxeo.web.ui.fetch.document" >dc:subjects</property>
        </extension>
      

      (see also NXP-26038)

      Show
      You can now add new enrichers used when serializing the current document by contributing: <require>org.nuxeo.web.ui.properties.contrib</require> <extension target= "org.nuxeo.runtime.ConfigurationService" point= "configuration" > <property name= "org.nuxeo.web.ui.enrichers" >myEnricher</property> </extension> You can now override the fetched properties when loading the current document (default behavior is still resolving all properties): <require>org.nuxeo.web.ui.properties.contrib</require> <extension target= "org.nuxeo.runtime.ConfigurationService" point= "configuration" > <property name= "org.nuxeo.web.ui.fetch.document" list= " true " override= " true " >dc:creator</property> <property name= "org.nuxeo.web.ui.fetch.document" >dc:nature</property> <property name= "org.nuxeo.web.ui.fetch.document" >dc:coverage</property> <property name= "org.nuxeo.web.ui.fetch.document" >dc:subjects</property> </extension> (see also NXP-26038 )
    • Sprint:
      nxGang Sprint 10.3.3, nxGang Sprint 10.3.4, nxGang Sprint 10.3.5
    • Story Points:
      1

      Description

      Today, nuxeo-app.html hardcodes the following:

          <nuxeo-document id="doc" doc-id="[[docId]]" doc-path="[[docPath]]"
                          response="{{currentDocument}}"
                          enrichers="firstAccessibleAncestor, permissions, breadcrumb, preview, favorites, subscribedNotifications, thumbnail, renditions, pendingTasks, runnableWorkflows, runningWorkflows, collections, audit, subtypes, tags"
                          headers='{"X-NXfetch.document": "lock,properties", "X-NXfetch.directoryEntry": "parent", "X-NXtranslate.directoryEntry": "label", "X-NXfetch.task": "actors"}'>
          </nuxeo-document>
      

      the X-NXfetch.document": "lock,properties http header is to be able to have all the possible document metadata to be rendered when browsing a given document out of the box.

      However in the case of a document having thousands of metadata with a lot resolving to user/group, other document, vocabulary entities, it won't scale.

      We should be able to override this.

      A possible and simple way of doing would just to move these default values to an element property and people will be able to narrow the schemas and properties to be fetched as well as enrichers to be used when seriliazing the document by overriding the index.jsp with:

        <nuxeo-app enrichers="xxx,yyy,etc." 
                   headers='{"X-NXfetch.document": "lock,dc:lastContributor", "X-NXfetch.directoryEntry": "parent", "X-NXtranslate.directoryEntry": "label", "X-NXfetch.task": "actors"}'
                   base-url="<%= request.getRequestURI() %>"
                   product-name="<%= Framework.getProperty(Environment.PRODUCT_NAME) %>" unresolved>
          <div id="sidebar">
            <img src="themes/default/logo.png">
          </div>
          <div id="container">
            <div id="toolbar">
            </div>
            <span id="loading"></span>
          </div>
        </nuxeo-app>
      

      But overriding index.jsp is not really the best advice we could give.

      Maybe introducing a property and do the following

      headers="<%= Framework.getProperty("org.nuxeo.web.ui.app.headers") %>"
      

      would be nicer?

      EDIT

      Since required headers and enrichers may actually be dynamically computed depending on the type of the document to be loaded/browsed, it would actually make more sense these values should be defined by doc layouts but unfortunately, doc layouts are not able to outject this kind of info up to nuxeo-app :/

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - 0 minutes
                  0m
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 1 day
                  1d