Uploaded image for project: 'Nuxeo Platform'
  1. Nuxeo Platform
  2. NXP-2152 Change LiveEdit links in the default web UI to use the new nxedit scheme
  3. NXP-2190

factorize the isLiveEditable(documentModel) or isLiveEditable(documentRef) logic into a JSF function or a seam component

    XMLWordPrintable

    Details

    • Type: Sub-task
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 5.1.3.2
    • Fix Version/s: 5.1.4
    • Component/s: None

      Description

      The current extended_file_widget.xhtml template looks like this

      <nxu:methodResult name="immutable"
      value="#

      {currentDocument.hasFacet('Immutable')}

      ">
      <nxu:methodResult name="onlineEditable"
      value="#

      {conversionActions.isFileOnlineEditable(widget.fieldDefinitions[0].propertyName)}

      ">
      <nxu:methodResult name="isLiveEditable"
      value="#

      {lockActions.isCurrentDocumentLiveEditable()}

      ">
      <h:panelGroup
      rendered="#

      {!immutable and onlineEditable and isLiveEditable}

      ">
      <h:outputText value=" | " />

      <h:commandLink action="#

      {FileManageWS.edit}

      "
      rendered="#

      {documentActions.writeRight}

      ">
      <f:param name="fileFieldFullName"
      value="#

      {widget.fieldDefinitions[0].propertyName}

      " />
      <f:param name="filename" value="#

      {field_1}

      " />
      <f:param name="filenameFieldFullName"
      value="#

      {widget.fieldDefinitions[1].propertyName}

      " />
      <h:outputText value="#

      {messages['label.document.directEdit']}" />
      </h:commandLink>

      </h:panelGroup>
      </nxu:methodResult>
      </nxu:methodResult>
      </nxu:methodResult>

      The command links itself should upgraded to something like:

      <h:outputLink
      value="#{nxd:liveEditUrl(changeableDocument, widget.fieldDefinitions[0].schemaName, widget.fieldDefinitions[0].fieldName, widget.fieldDefinitions[1].fieldName)}"
      rendered="#{editable}">
      <h:outputText value="#{messages['label.document.directEdit']}

      " />
      </h:outputLink>

      However the rendering condition is currently dependent on several seam action listeners. This should be factorized into a single seam component call that takes the document model and the property name as parameters (do not hardcode the check on currentDocument only).

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                ogrisel Olivier Grisel
                Reporter:
                ogrisel Olivier Grisel
                Participants:
              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - 4 hours
                  4h
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 4 hours
                  4h