Tabs for folder with content view : problem with button "New Document"

Hello

I create in Studio a new tab for display a folder.

In this tab, I want all documents of this folder and, to right, the meta-data of the folder. All is ok, but I can't have the button “Create new document”. I test with “Custom Actions” but it doesn't work.

Here a picture :

alt text

Thanks in advance

0 votes

2 answers

2749 views

ANSWER

anyone to help me ?
02/01/2013



Hi,

The only possible solution in 5.6 is to create a user action in Studio bound to an automation chain to call the operation “User Interface > Show Create document page”. It requires to have one action per doc type you want to be able to create.

The reason for the impossibility to use the usual new and import file buttons is because they are not “actions”. This is a known issue:

https://jira.nuxeo.com/browse/NXP-9433

Hopefully this is will be corrected in 5.7

0 votes



It will :)
02/19/2013

Thanks for the answer.

I just tested but it is not conclusive. Indeed, it must select what type of document that the button will created, but I want it to be the standard window for selecting the type that opens. Damage.

For against, I read the JIRA, and it seems that solutions have been found. Can we apply before the introduction of version 5.7?

Thanks in advance

02/25/2013

Hi,

The changes done for 5.7 around this are not done yet, and there would be too much to backport to get the feature on a 5.6.

But maybe you could find a workaround: the situation in 5.6 is that the "new" action is declared as a standard action, but what it triggers, when users click on it, is actually some javascript code to open the modal panel.

The modal panel is declared in another template, included in the template that will display the actions: that's why this was not modular enough, and in 5.7 the "popup" content is included by default, thanks to additional configuration set on the action.

So what you can try is:

  • get back the standard actions used to display this button (in category SUBVIEW_UPPER_LIST aka "Folder Toolbar" in Studio)
  • try to include the needed additional template to display the modal panel (select_document_type.xhtml)

The old template to mimick using a tab layout is here: https://github.com/nuxeo/nuxeo-dm/blob/release-5.6/nuxeo-platform-webapp/src/main/resources/web/nuxeo.war/incl/document_actions.xhtml

You can see that it's changed on trunk: https://github.com/nuxeo/nuxeo-dm/blob/master/nuxeo-platform-webapp/src/main/resources/web/nuxeo.war/incl/document_actions.xhtml

02/26/2013


As an alternative, you can use a custom widget template with the following code:

<div class="action_bar"
  xmlns:h="http://java.sun.com/jsf/html"
  xmlns:nxh="http://nuxeo.org/nxweb/html"
  xmlns:f="http://java.sun.com/jsf/core"
  xmlns:ui="http://java.sun.com/jsf/facelets"
  xmlns:nxu="http://nuxeo.org/nxweb/util"
  xmlns:nxl="http://nuxeo.org/nxforms/layout"
  xmlns:c="http://java.sun.com/jstl/core">

  <ui:include src="/select_document_type.xhtml"/>
  <ui:include src="/create_file.xhtml"/>

  <h:form id="documentActionSubviewUpperListForm">
    <nxu:set var="actions"
      value="#{webActions.getActionsList('SUBVIEW_UPPER_LIST')}"
      cache="true">
      <c:if test="#{!empty actions}">
        <div class="action_bar">
          <nxu:dataList layout="unorderedList"
            var="action"
            value="#{actions}"
            id="documentActionSubviewUpperListTable">
            <nxh:commandLink action="#{action.getLink()}"
              id="documentActionSubviewUpperListLink"
              immediate="#{action.immediate}"
              onclick="#{action.confirm}">
              <h:graphicImage value="#{action.icon}"
                rendered="#{not empty action.icon}" />
              <h:outputText value="#{messages[action.label]}" />
            </nxh:commandLink>
          </nxu:dataList>
        </div>
      </c:if>
    </nxu:set>
    <nxu:set var="actions"
      value="#{webActions.getActionsList('SUBVIEW_UPPER_LIST_HREF')}"
      cache="true">
      <c:if test="#{!empty actions}">
        <div class="action_bar">
          <nxu:dataList layout="unorderedList"
            var="action"
            value="#{actions}">
            <a href="#{action.getLink()}">
              <h:graphicImage value="#{action.icon}"
                rendered="#{not empty action.icon}" />
              <h:outputText value="#{messages[action.label]}" />
            </a>
          </nxu:dataList>
        </div>
      </c:if>
    </nxu:set>
  </h:form>

</div>

Note that this workaround may stop working as expected on 5.7, where you'll just have to display actions with the category “folder actions”.

0 votes