Michael Santy | 1 May 20:20
Favicon

visual cleanup patch to document_view.xhtml

Hello,

When customizing nuxeo I noticed that the "Restore" button for a deleted
document seems to be out of place.  I've modified the
document_view.xhtml to place this button by the lifecycle information,
and will show up when the document is deleted (as before).  The attached
diff against nuxeo 5.1.4 modifies the placement of the restore button
and eliminates the need for the file trash_details.xhtml.

Is there any interest in incorporating these type of patches into the
nuxeo distribution?  If so, I've also been thinking of a visual cleanup
of the lock_details.xhtml. 

Cheers,
Mike Santy
Attachment (document_view.xhtml): application/xhtml+xml, 5706 bytes
22,25d21
<   <h:panelGrid rendered="#{deleteActions.trashManagementEnabled}">
<     <ui:include src="/incl/trash_details.xhtml" />
<   </h:panelGrid>
< 
118a115,120
>   <c:if test="#{deleteActions.trashManagementEnabled}">
>     <h:outputText/>
>     <h:commandButton type="submit" value="#{messages['command.undeleteDocs']}" 
>       styleClass="button" action="#{deleteActions.restoreCurrentDocument}"
>       rendered="#{deleteActions.canRestoreCurrentDoc}" />
>   </c:if>
140c142
< </div>
\ No newline at end of file
---
> </div>
<div xmlns="http://www.w3.org/1999/xhtml"
  xmlns:ui="http://java.sun.com/jsf/facelets"
  xmlns:f="http://java.sun.com/jsf/core"
  xmlns:h="http://java.sun.com/jsf/html"
  xmlns:c="http://java.sun.com/jstl/core"
  xmlns:t="http://myfaces.apache.org/tomahawk"
  xmlns:nxdir="http://nuxeo.org/nxdirectory"
  xmlns:a4j="https://ajax4jsf.dev.java.net/ajax"
  xmlns:nxh="http://nuxeo.org/nxweb/html"
  xmlns:nxl="http://nuxeo.org/nxforms/layout"
  xmlns:nxu="http://nuxeo.org/nxweb/util">

<h3><h:outputText
  value="#{messages['label.content.header.documentProperties']}" /></h3>

<h:form id="document_view">

  <a4j:outputPanel >
    <ui:include src="/incl/lock_details.xhtml" />
  </a4j:outputPanel>

  <c:if test="#{empty documentActions.currentType.layout}">
    <nxl:documentLayout mode="view" value="#{currentDocument}" />
  </c:if>

  <h:dataTable var="field" value="#{documentActions.currentType.layout}"
    rendered="#{!empty documentActions.currentType.layout}"
    class="dataInput" columnClasses="labelColumn, fieldColumn">
    <h:column>
      <h:outputText value="#{messages[field.displayLabel]}" />
    </h:column>

    <h:column>

      <h:outputText value="#{currentDocument[field.schemaName][field.fieldName]}"
        rendered="${field.jsfComponent=='h:inputText'}" />

      <h:outputText value="#{currentDocument[field.schemaName][field.fieldName]}"
        rendered="${field.jsfComponent=='h:inputTextarea'}" />

      <h:outputText
        rendered="#{field.jsfComponent=='t:inputFileUpload' and
currentDocument[field.schemaName][field.fieldName] != null}">
        <h:outputText rendered="false">
          XXX AT: get rid of hardcoded file name references using a custom multi-component
        </h:outputText>
        <nxh:outputLink
          value="#{nxd:fileUrl('downloadFile', currentDocument, field.fullName, currentDocument.file.filename)}">
          <nxh:graphicImage value="#{nxd:fileIconPath(currentDocument[field.schemaName][field.fieldName])}"
            rendered="#{! empty nxd:fileIconPath(currentDocument[field.schemaName][field.fieldName])}" />
          <nxh:outputText value="#{currentDocument.file.filename}" />
        </nxh:outputLink>

        <nxu:methodResult name="hasPDFCapabilities" value="#{conversionActions.isFileExportableToPDF(field.fullName)}">
          <h:panelGroup rendered="#{hasPDFCapabilities}">
            <h:outputText value=" | " />
            <h:commandLink action="#{conversionActions.generatePdfFile}">
              <f:param name="fileFieldFullName" value="#{field.fullName}" />
              <f:param name="filename" value="#{currentDocument.file.filename}" />
              <h:outputText value="#{messages['label.document.generatePdf']}" />
            </h:commandLink>
          </h:panelGroup>
        </nxu:methodResult>

        <nxu:methodResult name="isLiveEditable"
          value="#{liveEditHelper.isCurrentDocumentLiveEditable(field.schemaName, field.fieldName)}">
          <h:panelGroup rendered="#{isLiveEditable}">
            <h:outputText value=" | " />
            <h:outputLink
              value="#{nxd:liveEditUrl(changeableDocument, field.schemaName, field.fieldName, 'filename')}">
              <h:outputText value="#{messages['label.document.directEdit']}" />
            </h:outputLink> 
          </h:panelGroup>
        </nxu:methodResult>

      </h:outputText>

      <h:outputText value="#{currentDocument[field.schemaName][field.fieldName]}"
        rendered="${field.jsfComponent=='nxu:editor'}" escape="false" />

      <h:outputText value="#{currentDocument[field.schemaName][field.fieldName]}"
        rendered="${field.jsfComponent=='t:inputCalendar'}">
        <f:convertDateTime pattern="#{nxu:basicDateFormater()}" />
      </h:outputText>

      <nxdir:directoryEntryOutput
        value="#{currentDocument[field.schemaName][field.fieldName]}"
        directoryName="#{field.directory}"
        rendered="${field.jsfComponent=='nxdir:selectOneListbox'}" />

      <t:dataList
          var="item"
          value="#{currentDocument[field.schemaName][field.fieldName]}"
          layout="simple"
          rendered="${field.jsfComponent=='nxdir:selectManyListbox'}">
        <div>
          <nxdir:directoryEntryOutput
            value="#{item}"
            directoryName="#{field.directory}" />
        </div>
      </t:dataList>

    </h:column>
  </h:dataTable>

<h3><h:outputText
  value="#{messages['label.workflow.lifeCycleInformation']}" /></h3>

<h:panelGrid columns="2" styleClass="dataInput"
  columnClasses="labelColumn, fieldColumn">
  <h:outputText value="#{messages['label.workflow.lifeCyclePolicy']}" />
  <h:outputText value="${messages[currentDocument.lifeCyclePolicy]}" />
  <h:outputText
    value="#{messages['label.workflow.currentLifeCycleState']}" />
  <h:outputText value="${messages[currentDocument.currentLifeCycleState]}" />
  <c:if test="#{deleteActions.trashManagementEnabled}">
    <h:outputText/>
    <h:commandButton type="submit" value="#{messages['command.undeleteDocs']}" 
      styleClass="button" action="#{deleteActions.restoreCurrentDocument}"
      rendered="#{deleteActions.canRestoreCurrentDoc}" />
  </c:if>
</h:panelGrid>

<nxu:methodResult name="versionable" value="#{currentDocument.hasFacet('Versionable')}">
<h3><h:outputText
  value="#{messages['label.versioning.documentVersioning']}"
  rendered="#{versionable}"/></h3>
<h:panelGrid columns="2" styleClass="dataInput"
  columnClasses="labelColumn, fieldColumn"
  rendered="#{versionable}">
  <h:outputText value="#{messages['label.versioning.currentVersion']}"
    rendered="#{documentVersioning.uidInfoAvailable}"/>
  <h:panelGroup>
    <nxh:outputText value="#{documentVersioning.getVersionLabel(currentDocument)}" />
  </h:panelGroup>
</h:panelGrid>
</nxu:methodResult>

<ui:include src="/incl/document_publishing_actions.xhtml" />

</h:form>

</div>
_______________________________________________
ECM mailing list
ECM@...
http://lists.nuxeo.com/mailman/listinfo/ecm

Gmane