[Ecm-checkins] r12097 - in org.nuxeo.ecm.webapp/branches/NXGED-94_Publication_intf: src/org/nuxeo/ecm/webapp/publish web/incl web/incl/tabs

npaslaru svn at nuxeo.com
Fri Feb 9 18:31:28 CET 2007


Author: npaslaru
Date: Fri Feb  9 18:31:26 2007
New Revision: 12097

Added:
   org.nuxeo.ecm.webapp/branches/NXGED-94_Publication_intf/src/org/nuxeo/ecm/webapp/publish/PublishActions.java
   org.nuxeo.ecm.webapp/branches/NXGED-94_Publication_intf/src/org/nuxeo/ecm/webapp/publish/PublishActionsBean.java
   org.nuxeo.ecm.webapp/branches/NXGED-94_Publication_intf/web/incl/publish_buttons.xhtml
   org.nuxeo.ecm.webapp/branches/NXGED-94_Publication_intf/web/incl/sections_table.xhtml
   org.nuxeo.ecm.webapp/branches/NXGED-94_Publication_intf/web/incl/tabs/document_publish.xhtml

Log:
Publish page

Added: org.nuxeo.ecm.webapp/branches/NXGED-94_Publication_intf/src/org/nuxeo/ecm/webapp/publish/PublishActions.java
==============================================================================
--- (empty file)
+++ org.nuxeo.ecm.webapp/branches/NXGED-94_Publication_intf/src/org/nuxeo/ecm/webapp/publish/PublishActions.java	Fri Feb  9 18:31:26 2007
@@ -0,0 +1,47 @@
+/*
+ * (C) Copyright 2007 Nuxeo SAS <http://nuxeo.com> and others
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     Nuxeo - initial API and implementation
+ *
+ * $Id$
+ */
+
+package org.nuxeo.ecm.webapp.publish;
+
+import java.util.List;
+
+import javax.ejb.Local;
+
+import org.nuxeo.ecm.core.api.ClientException;
+import org.nuxeo.ecm.platform.actions.Action;
+
+/**
+ *  Interface for publish documents page action listener. Exposes methods for
+ * handling user actions related to the publish button(s).
+ *
+ * @author <a href="mailto:npaslaru at nuxeo.com">Paslaru Narcis</a>
+ *
+ */
+ at Local
+public interface PublishActions {
+
+    /**
+     * Returns the list of available web actions for the currently selected
+     * DocumentList - list of sections.
+     *
+     * @return the WebAction list
+     */
+    public List<Action> getActionsForPublishDocument();
+
+    /**
+     * Method that executes when a document is published
+     * @throws ClientException
+     */
+    public void publishDocument() throws ClientException;
+}

Added: org.nuxeo.ecm.webapp/branches/NXGED-94_Publication_intf/src/org/nuxeo/ecm/webapp/publish/PublishActionsBean.java
==============================================================================
--- (empty file)
+++ org.nuxeo.ecm.webapp/branches/NXGED-94_Publication_intf/src/org/nuxeo/ecm/webapp/publish/PublishActionsBean.java	Fri Feb  9 18:31:26 2007
@@ -0,0 +1,72 @@
+/*
+ * (C) Copyright 2007 Nuxeo SAS <http://nuxeo.com> and others
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     Nuxeo - initial API and implementation
+ *
+ * $Id$
+ */
+
+package org.nuxeo.ecm.webapp.publish;
+
+import static org.jboss.seam.ScopeType.SESSION;
+
+import java.util.List;
+
+import javax.ejb.Remove;
+import javax.ejb.Stateful;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.jboss.annotation.ejb.SerializedConcurrentAccess;
+import org.jboss.seam.annotations.Destroy;
+import org.jboss.seam.annotations.In;
+import org.jboss.seam.annotations.Name;
+import org.jboss.seam.annotations.Scope;
+import org.nuxeo.ecm.core.api.ClientException;
+import org.nuxeo.ecm.platform.actions.Action;
+import org.nuxeo.ecm.webapp.action.WebActions;
+import org.nuxeo.ecm.webapp.base.InputController;
+import org.nuxeo.ecm.webapp.clipboard.ClipboardActionsBean;
+import org.nuxeo.ecm.webapp.documentsLists.DocumentsListsManager;
+
+/**
+ * @author <a href="mailto:npaslaru at nuxeo.com">Paslaru Narcis</a>
+ *
+ */
+ at Stateful
+ at Name("publishActions")
+ at Scope(SESSION)
+ at SerializedConcurrentAccess
+public class PublishActionsBean extends InputController implements
+        PublishActions {
+
+    private static final Log log = LogFactory.getLog(ClipboardActionsBean.class);
+
+    @In(create=true)
+    protected WebActions webActions;
+
+
+    /* (non-Javadoc)
+     * @see org.nuxeo.ecm.webapp.publish.PublishActions#getActionsForCurrentList()
+     */
+    public List<Action> getActionsForPublishDocument() {
+        return webActions.getActionsList(DocumentsListsManager.PUBLISH_DOCUMENT);
+    }
+
+    public void publishDocument() throws ClientException {
+        log.info("Publishing document to some sections");
+    }
+
+    @Destroy
+    @Remove
+    public void destroy() {
+        log.debug("Removing SEAM component: publishActions");
+    }
+
+}

Added: org.nuxeo.ecm.webapp/branches/NXGED-94_Publication_intf/web/incl/publish_buttons.xhtml
==============================================================================
--- (empty file)
+++ org.nuxeo.ecm.webapp/branches/NXGED-94_Publication_intf/web/incl/publish_buttons.xhtml	Fri Feb  9 18:31:26 2007
@@ -0,0 +1,28 @@
+<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:t="http://myfaces.apache.org/tomahawk"
+  xmlns:nxh="http://nuxeo.org/nxweb/html"
+  xmlns:c="http://java.sun.com/jstl/core"
+  class="clipboard">
+
+<script type="text/javascript">
+function confirmDeleteDocuments() {
+    return confirm("#{messages['label.documents.confirmDeleteDocuments']}");
+}
+</script>
+
+  <div id="selection_buttons">
+    <t:dataList var="sel_action" value="#{publishActions.actionsForPublishDocument}">
+      <nxh:commandButton
+        styleClass="button" type="submit"
+        action="#{sel_action.getLink()}"
+        value="#{messages[sel_action.label]}"
+        onclick="#{sel_action.confirm}"
+        />
+    </t:dataList>
+  </div>
+  <div style="clear:both"></div>
+
+</div>

Added: org.nuxeo.ecm.webapp/branches/NXGED-94_Publication_intf/web/incl/sections_table.xhtml
==============================================================================
--- (empty file)
+++ org.nuxeo.ecm.webapp/branches/NXGED-94_Publication_intf/web/incl/sections_table.xhtml	Fri Feb  9 18:31:26 2007
@@ -0,0 +1,56 @@
+<div xmlns="http://www.w3.org/1999/xhtml"
+  xmlns:ui="http://java.sun.com/jsf/facelets"
+  xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core"
+  xmlns:a4j="https://ajax4jsf.dev.java.net/ajax"
+  xmlns:nxu="http://nuxeo.org/nxweb/util"
+  xmlns:nxd="http://nuxeo.org/nxweb/document"><a4j:region
+  rendered="#{documents != null}">
+
+  <h:form id="#{documents.name}">
+    <h:outputText value="#{messages['label.sections.not.defined']}"
+      rendered="#{documents.rowCount == 0}" />
+    <nxu:dataTable id="dataTable" value="#{documents.rows}" var="row"
+      rowClasses="dataRowEven,dataRowOdd" styleClass="dataOutput"
+      rendered="#{documents.rowCount > 0}">
+      <!-- id and selection -->
+      <nxu:column styleClass="iconColumn" rendered="#{showCheckboxes or false}">
+        <!-- XXX AT: select all buggy right now -->
+        <f:facet name="header">
+          <h:selectBooleanCheckbox rendered="false">
+            <a4j:support event="onclick"
+              onsubmit="onSelectAllCheckboxClick('#{documents.name}:dataTable', this.checked)">
+              <a4j:ajaxListener type="org.ajax4jsf.ajax.ForceRender" />
+            </a4j:support>
+          </h:selectBooleanCheckbox>
+        </f:facet>
+        <h:selectBooleanCheckbox value="#{row.selected}"
+          valueChangeListener="#{row.selectionChanged}">
+<!--      <a4j:support event="onclick"
+            onsubmit="disableCheckBoxesIn('#{documents.name}:dataTable')"
+            oncomplete="enableCheckBoxesIn('#{documents.name}:dataTable')">
+            <a4j:ajaxListener type="org.ajax4jsf.ajax.ForceRender" />
+          </a4j:support>
+-->
+        </h:selectBooleanCheckbox>
+      </nxu:column>
+      <!--  Title -->
+      <nxu:column>
+        <f:facet name="header">
+          <h:outputText value="#{messages['label.publish.header.title']}" />
+        </f:facet>
+        <h:outputText value="#{row.data.treeLabel}" escape="false"/>
+      </nxu:column>
+      <!--  Version of the published document -->
+      <h:column>
+        <f:facet name="header">
+          <h:outputText
+            value="#{messages['label.content.header.currentLifecycleState']}" />
+        </f:facet>
+        <h:outputText value="#{messages[row.data.document.currentLifeCycleState]}" />
+      </h:column>
+    </nxu:dataTable>
+    <a4j:outputPanel ajaxRendered="true">
+      <ui:insert name="buttons" />
+    </a4j:outputPanel>
+  </h:form>
+</a4j:region></div>

Added: org.nuxeo.ecm.webapp/branches/NXGED-94_Publication_intf/web/incl/tabs/document_publish.xhtml
==============================================================================
--- (empty file)
+++ org.nuxeo.ecm.webapp/branches/NXGED-94_Publication_intf/web/incl/tabs/document_publish.xhtml	Fri Feb  9 18:31:26 2007
@@ -0,0 +1,20 @@
+<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:a4j="https://ajax4jsf.dev.java.net/ajax"
+  xmlns:nxd="http://nuxeo.org/nxweb/document">
+
+<ui:include src="/incl/document_actions.xhtml"/>
+
+  <ui:decorate template="/incl/sections_table.xhtml">
+    <ui:param name="documents" value="#{documentActions.sectionsSelectModel}" />
+    <ui:param name="showCheckboxes" value="#{true}" />
+    <ui:define name="buttons">
+      <ui:include src="/incl/publish_buttons.xhtml" />
+    </ui:define>
+  </ui:decorate>
+
+</div>



This list archive provided by Nuxeo, the leaders of open source ECM. Check out the Nuxeo 5 open source, standards-based ECM project.