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

Fix 'Spreadsheet editor' when displaying column for a multi-valued string field

    XMLWordPrintable

    Details

    • Release Notes Summary:
      Multivalued result columns are correctly handled by Spreadsheet editor.
    • Tags:
    • Backlog priority:
      700
    • Sprint:
      nxNS Sprint 11.1.11, nxNS Sprint 11.1.12, nxNS Sprint 11.1.13, nxNS Sprint 11.1.14
    • Story Points:
      2

      Description

      When the spreadsheet editor is opened in the Web UI and the value of a cell displaying a multi-valued string, saving the spreadsheet leads to the editor to mark the row in error:

      How to reproduce:

      • in Studio Modeler, define a new document type MyDoc extending Document with a multi-valued string property and its necessary layouts
      • define a new folderish document type My Folder extending Folder in which documents of type MyDoc can be created (and its layouts)
      • define a new content view named Folder which displays the children documents and add a column to display the multi-valued string property. Use this content view to list children documents of document type MyFolder
      • in Studio Designer, define the create, edit and metadata layouts of MyDoc
      • define the create and view of document type MyFolder
      • in the view layout of MyFolder, add the following column element to display the *multi-valued string property:
                <nuxeo-data-table-column name="Strings"
                                         field="mydoc:strings" flex="60">
                  <template>
                    <template is="dom-repeat" items="[[item.properties.mydoc:strings]]" as="mystring">
                      <nuxeo-tag>[[mystring]]</nuxeo-tag>
                    </template>
                  </template>
                </nuxeo-data-table-column>
        
      • deploy
      • log in the Web UI
      • create a Workspace, then a MyFolder in it, then a MyDoc document in it with 2 string items in property mydoc:strings
      • go back to the parent MyFolder document (make sure the column Strings is displayed) and open the spreadsheet editor
      • the cells in column Strings renders the elements of property mydoc:strings with an simple input text when in edit mode
      • change the value of a cell in the Strings column
      • click the Save button of the spreadsheet editor

      Expected Result: changes in the modified cell is saved
      Actual Result: the row where the cell was modified is displayed in error (red background, see screenshot above)

      Here is the stack trace returned by the save action:

      org.nuxeo.ecm.core.api.NuxeoException: java.lang.ClassCastException: org.nuxeo.ecm.core.schema.types.ListTypeImpl cannot be cast to org.nuxeo.ecm.core.schema.types.SimpleType	at org.nuxeo.ecm.webengine.app.WebEngineExceptionMapper.toResponse(WebEngineExceptionMapper.java:86)	at com.sun.jersey.spi.container.ContainerResponse.mapException(ContainerResponse.java:480)	at com.sun.jersey.spi.container.ContainerResponse.mapMappableContainerException(ContainerResponse.java:417)	at com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1477)	at com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1419)	at com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1409)	at com.sun.jersey.spi.container.servlet.WebComponent.service(WebComponent.java:409)	at com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:558)	at com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:733)	at org.nuxeo.ecm.webengine.app.jersey.WebEngineServlet.containerService(WebEngineServlet.java:72)	at org.nuxeo.ecm.webengine.app.jersey.WebEngineServlet.service(WebEngineServlet.java:56)	at javax.servlet.http.HttpServlet.service(HttpServlet.java:741)	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231)	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)	at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53)	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)	at org.nuxeo.elasticsearch.ElasticSearchFilter.doFilter(ElasticSearchFilter.java:55)	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)	at org.nuxeo.ecm.webengine.jaxrs.session.SessionCleanupFilter.run(SessionCleanupFilter.java:50)	at org.nuxeo.ecm.webengine.jaxrs.HttpFilter.doFilter(HttpFilter.java:49)	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)	at org.nuxeo.ecm.webengine.app.WebContextFilter.doFilter(WebContextFilter.java:56)	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)	at org.nuxeo.ecm.webengine.jaxrs.context.RequestContextFilter.run(RequestContextFilter.java:48)	at org.nuxeo.ecm.webengine.jaxrs.HttpFilter.doFilter(HttpFilter.java:49)	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)	at org.nuxeo.ecm.webengine.app.HeaderFixFilter.run(HeaderFixFilter.java:62)	at org.nuxeo.ecm.webengine.jaxrs.HttpFilter.doFilter(HttpFilter.java:49)	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)	at org.nuxeo.ecm.platform.web.common.requestcontroller.filter.NuxeoThreadTrackerFilter.doFilter(NuxeoThreadTrackerFilter.java:43)	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)	at org.nuxeo.ecm.platform.web.common.requestcontroller.filter.NuxeoStandbyFilter.doFilter(NuxeoStandbyFilter.java:67)	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)	at org.nuxeo.ecm.core.management.jtajca.internal.Log4jWebFilter.doFilter(Log4jWebFilter.java:69)	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)	at org.nuxeo.ecm.platform.ui.web.rest.FancyURLFilter.doFilter(FancyURLFilter.java:120)	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)	at org.nuxeo.ecm.platform.web.common.requestcontroller.filter.NuxeoRequestControllerFilter.doFilter(NuxeoRequestControllerFilter.java:134)	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)	at org.nuxeo.ecm.platform.ui.web.auth.NuxeoAuthenticationFilter.doFilterInternal(NuxeoAuthenticationFilter.java:633)	at org.nuxeo.ecm.platform.ui.web.auth.NuxeoAuthenticationFilter.doFilter(NuxeoAuthenticationFilter.java:429)	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)	at com.thetransactioncompany.cors.CORSFilter.doFilter(CORSFilter.java:209)	at com.thetransactioncompany.cors.CORSFilter.doFilter(CORSFilter.java:244)	at org.nuxeo.ecm.platform.web.common.requestcontroller.filter.NuxeoCorsCsrfFilter.doFilter(NuxeoCorsCsrfFilter.java:258)	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)	at org.nuxeo.ecm.platform.web.common.exceptionhandling.NuxeoExceptionFilter.doFilter(NuxeoExceptionFilter.java:67)	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)	at org.nuxeo.ecm.platform.web.common.encoding.NuxeoEncodingFilter.doFilter(NuxeoEncodingFilter.java:64)	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:199)	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)	at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:490)	at org.apache.catalina.valves.rewrite.RewriteValve.invoke(RewriteValve.java:276)	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:139)	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92)	at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:668)	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:74)	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343)	at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:408)	at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)	at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:834)	at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1417)	at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)	at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)	at java.lang.Thread.run(Thread.java:748)Caused by: java.lang.ClassCastException: org.nuxeo.ecm.core.schema.types.ListTypeImpl cannot be cast to org.nuxeo.ecm.core.schema.types.SimpleType	at org.nuxeo.ecm.core.io.marshallers.json.document.DocumentPropertiesJsonReader.getScalarPropertyValue(DocumentPropertiesJsonReader.java:214)	at org.nuxeo.ecm.core.io.marshallers.json.document.DocumentPropertiesJsonReader.fillScalarProperty(DocumentPropertiesJsonReader.java:160)	at org.nuxeo.ecm.core.io.marshallers.json.document.DocumentPropertiesJsonReader.fillListProperty(DocumentPropertiesJsonReader.java:242)	at org.nuxeo.ecm.core.io.marshallers.json.document.DocumentPropertiesJsonReader.readProperty(DocumentPropertiesJsonReader.java:136)	at org.nuxeo.ecm.core.io.marshallers.json.document.DocumentPropertiesJsonReader.read(DocumentPropertiesJsonReader.java:121)	at org.nuxeo.ecm.core.io.marshallers.json.document.DocumentPropertiesJsonReader.read(DocumentPropertiesJsonReader.java:86)	at org.nuxeo.ecm.core.io.marshallers.json.AbstractJsonReader.read(AbstractJsonReader.java:80)	at org.nuxeo.ecm.core.io.marshallers.json.AbstractJsonReader.readEntity(AbstractJsonReader.java:128)	at org.nuxeo.ecm.core.io.marshallers.json.document.DocumentModelJsonReader.readEntity(DocumentModelJsonReader.java:118)	at org.nuxeo.ecm.core.io.marshallers.json.document.DocumentModelJsonReader.readEntity(DocumentModelJsonReader.java:80)	at org.nuxeo.ecm.core.io.marshallers.json.EntityJsonReader.read(EntityJsonReader.java:66)	at org.nuxeo.ecm.core.io.marshallers.json.AbstractJsonReader.read(AbstractJsonReader.java:80)	at org.nuxeo.ecm.core.io.marshallers.json.document.DocumentModelJsonReader.read(DocumentModelJsonReader.java:98)	at org.nuxeo.ecm.core.io.marshallers.json.document.DocumentModelJsonReader.read(DocumentModelJsonReader.java:80)	at org.nuxeo.ecm.webengine.jaxrs.coreiodelegate.PartialCoreIODelegate.readFrom(PartialCoreIODelegate.java:127)	at com.sun.jersey.spi.container.ContainerRequest.getEntity(ContainerRequest.java:490)	at com.sun.jersey.server.impl.model.method.dispatch.EntityParamDispatchProvider$EntityInjectable.getValue(EntityParamDispatchProvider.java:123)	at com.sun.jersey.server.impl.inject.InjectableValuesProvider.getInjectableValues(InjectableValuesProvider.java:86)	at com.sun.jersey.server.impl.model.method.dispatch.AbstractResourceMethodDispatchProvider$EntityParamInInvoker.getParams(AbstractResourceMethodDispatchProvider.java:153)	at com.sun.jersey.server.impl.model.method.dispatch.AbstractResourceMethodDispatchProvider$ResponseOutInvoker._dispatch(AbstractResourceMethodDispatchProvider.java:203)	at com.sun.jersey.server.impl.model.method.dispatch.ResourceJavaMethodDispatcher.dispatch(ResourceJavaMethodDispatcher.java:75)	at com.sun.jersey.server.impl.uri.rules.HttpMethodRule.accept(HttpMethodRule.java:302)	at com.sun.jersey.server.impl.uri.rules.SubLocatorRule.accept(SubLocatorRule.java:137)	at com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:147)	at com.sun.jersey.server.impl.uri.rules.SubLocatorRule.accept(SubLocatorRule.java:137)	at com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:147)	at com.sun.jersey.server.impl.uri.rules.ResourceClassRule.accept(ResourceClassRule.java:108)	at com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:147)	at com.sun.jersey.server.impl.uri.rules.RootResourceClassesRule.accept(RootResourceClassesRule.java:84)	at com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1542)	at com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1473)	... 79 more
      

      On a side note, the spreadsheet editor has widgets to modify multi-valued vocabulary properties, multi-valued document properties, multi-valued user/group properties, but not multi-valued string propperties.

      Another side note, the spreadsheet editor does not display columns for multi-valued string propperties when it is opened from the JSF UI.

      I defined all the objects needed to reproduce the issue in my Studio project branch feature/spreadsheet-multi-valued-string-column.

      I attached the Marketplace Package to this ticket.

      I also attach the HAR file of the HTTP PUT request that tries to save the rows in the spreadsheet editor.

        Attachments

        1. localhost_Archive [19-08-21 15-32-54].har
          7 kB
          Vincent Dutat
        2. screenshot-1.png
          20 kB
          Vincent Dutat

          Issue Links

            Activity

              People

              • Votes:
                1 Vote for this issue
                Watchers:
                4 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 - 2 hours, 30 minutes
                  2h 30m