Author: julien(a)jboss.com
Date: 2007-03-15 08:51:47 -0400 (Thu, 15 Mar 2007)
New Revision: 6680
Added:
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/actions/AddPageAction.java
Removed:
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/actions/AddPageAction2.java
Modified:
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/dashboard/DashboardBean.java
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/faces-config.xml
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/dashboard/dashboard.xhtml
Log:
- renamed AddPageAction2 bean to AddDashboardPageAction
Copied:
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/actions/AddPageAction.java (from
rev 6671,
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/actions/AddPageAction2.java)
===================================================================
--- trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/actions/AddPageAction.java
(rev 0)
+++
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/actions/AddPageAction.java 2007-03-15
12:51:47 UTC (rev 6680)
@@ -0,0 +1,110 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.core.admin.ui.actions;
+
+import org.jboss.portal.core.model.portal.PageContainer;
+import org.jboss.portal.core.model.portal.Page;
+import org.jboss.portal.core.model.portal.PortalObjectPermission;
+import org.jboss.portal.core.model.portal.PortalObjectId;
+import org.jboss.portal.security.spi.provider.DomainConfigurator;
+import org.jboss.portal.security.RoleSecurityBinding;
+import org.jboss.portal.security.SecurityConstants;
+
+import java.util.Set;
+import java.util.Collections;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 5763 $
+ */
+public class AddPageAction
+{
+
+ /** . */
+ public PageContainer pageContainer;
+
+ /** . */
+ public DomainConfigurator domainConfigurator;
+
+ /** . */
+ public String pageName;
+
+ /** . */
+ public Listener listener;
+
+ /** . */
+// private static final String ERROR_DUPE_NAME = "Duplicate Page name found on
this portal!";
+
+ /** . */
+// private static final String ERROR_EMPTY_NAME = "Page name cannot be
blank!";
+
+ /*
+ * Checks for duplicate page names on the portal instance. Blank page names are not
allowed and are controlled by the
+ * required attribute in the presentation page.
+ */
+// public void validatePageName(FacesContext context, UIComponent toValidate, Object
value)
+// {
+// String pageName = (String)value;
+//
+// // check for empty string
+// if (pageName.startsWith(" "))
+// {
+// FacesMessage message = new FacesMessage(FacesMessage.SEVERITY_ERROR,
ERROR_EMPTY_NAME, ERROR_EMPTY_NAME);
+// throw new ValidatorException(message);
+// }
+//
+// // Check for duplicate child name
+// if (pageContainer.getChild(pageName) != null)
+// {
+// FacesMessage message = new FacesMessage(FacesMessage.SEVERITY_ERROR,
ERROR_DUPE_NAME, ERROR_DUPE_NAME);
+// throw new ValidatorException(message);
+// }
+// }
+
+ public void execute()
+ {
+ try
+ {
+ Page page = pageContainer.createPage(pageName);
+
+ //
+ Set constraints = Collections.singleton(new
RoleSecurityBinding(PortalObjectPermission.VIEW_RECURSIVE_ACTION,
SecurityConstants.UNCHECKED_ROLE_NAME));
+
domainConfigurator.setSecurityBindings(page.getId().toString(PortalObjectId.CANONICAL_FORMAT),
constraints);
+
+ //
+ if (listener != null)
+ {
+ listener.pageCreated(page);
+ }
+ }
+ catch (Exception e)
+ {
+ e.printStackTrace();
+ }
+ }
+
+ public interface Listener
+ {
+ void pageCreated(Page page);
+ }
+}
Deleted:
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/actions/AddPageAction2.java
===================================================================
---
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/actions/AddPageAction2.java 2007-03-15
12:48:16 UTC (rev 6679)
+++
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/actions/AddPageAction2.java 2007-03-15
12:51:47 UTC (rev 6680)
@@ -1,110 +0,0 @@
-/******************************************************************************
- * JBoss, a division of Red Hat *
- * Copyright 2006, Red Hat Middleware, LLC, and individual *
- * contributors as indicated by the @authors tag. See the *
- * copyright.txt in the distribution for a full listing of *
- * individual contributors. *
- * *
- * This is free software; you can redistribute it and/or modify it *
- * under the terms of the GNU Lesser General Public License as *
- * published by the Free Software Foundation; either version 2.1 of *
- * the License, or (at your option) any later version. *
- * *
- * This software is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
- * Lesser General Public License for more details. *
- * *
- * You should have received a copy of the GNU Lesser General Public *
- * License along with this software; if not, write to the Free *
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
- ******************************************************************************/
-package org.jboss.portal.core.admin.ui.actions;
-
-import org.jboss.portal.core.model.portal.PageContainer;
-import org.jboss.portal.core.model.portal.Page;
-import org.jboss.portal.core.model.portal.PortalObjectPermission;
-import org.jboss.portal.core.model.portal.PortalObjectId;
-import org.jboss.portal.security.spi.provider.DomainConfigurator;
-import org.jboss.portal.security.RoleSecurityBinding;
-import org.jboss.portal.security.SecurityConstants;
-
-import java.util.Set;
-import java.util.Collections;
-
-/**
- * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 5763 $
- */
-public class AddPageAction2
-{
-
- /** . */
- public PageContainer pageContainer;
-
- /** . */
- public DomainConfigurator domainConfigurator;
-
- /** . */
- public String pageName;
-
- /** . */
- public Listener listener;
-
- /** . */
-// private static final String ERROR_DUPE_NAME = "Duplicate Page name found on
this portal!";
-
- /** . */
-// private static final String ERROR_EMPTY_NAME = "Page name cannot be
blank!";
-
- /*
- * Checks for duplicate page names on the portal instance. Blank page names are not
allowed and are controlled by the
- * required attribute in the presentation page.
- */
-// public void validatePageName(FacesContext context, UIComponent toValidate, Object
value)
-// {
-// String pageName = (String)value;
-//
-// // check for empty string
-// if (pageName.startsWith(" "))
-// {
-// FacesMessage message = new FacesMessage(FacesMessage.SEVERITY_ERROR,
ERROR_EMPTY_NAME, ERROR_EMPTY_NAME);
-// throw new ValidatorException(message);
-// }
-//
-// // Check for duplicate child name
-// if (pageContainer.getChild(pageName) != null)
-// {
-// FacesMessage message = new FacesMessage(FacesMessage.SEVERITY_ERROR,
ERROR_DUPE_NAME, ERROR_DUPE_NAME);
-// throw new ValidatorException(message);
-// }
-// }
-
- public void execute()
- {
- try
- {
- Page page = pageContainer.createPage(pageName);
-
- //
- Set constraints = Collections.singleton(new
RoleSecurityBinding(PortalObjectPermission.VIEW_RECURSIVE_ACTION,
SecurityConstants.UNCHECKED_ROLE_NAME));
-
domainConfigurator.setSecurityBindings(page.getId().toString(PortalObjectId.CANONICAL_FORMAT),
constraints);
-
- //
- if (listener != null)
- {
- listener.pageCreated(page);
- }
- }
- catch (Exception e)
- {
- e.printStackTrace();
- }
- }
-
- public interface Listener
- {
- void pageCreated(Page page);
- }
-}
Modified:
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/dashboard/DashboardBean.java
===================================================================
---
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/dashboard/DashboardBean.java 2007-03-15
12:48:16 UTC (rev 6679)
+++
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/dashboard/DashboardBean.java 2007-03-15
12:51:47 UTC (rev 6680)
@@ -31,7 +31,7 @@
import org.jboss.portal.core.model.instance.InstanceContainer;
import org.jboss.portal.core.admin.ui.common.PageManagerBean;
import org.jboss.portal.core.admin.ui.portlet.PortletDefinitionInvoker;
-import org.jboss.portal.core.admin.ui.actions.AddPageAction2;
+import org.jboss.portal.core.admin.ui.actions.AddPageAction;
import org.jboss.portal.theme.LayoutService;
import org.jboss.portal.theme.ThemeService;
import org.jboss.portal.theme.ThemeConstants;
@@ -45,7 +45,7 @@
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
* @version $Revision: 1.1 $
*/
-public class DashboardBean implements AddPageAction2.Listener
+public class DashboardBean implements AddPageAction.Listener
{
/** . */
Modified: trunk/core-admin/src/resources/portal-admin-war/WEB-INF/faces-config.xml
===================================================================
--- trunk/core-admin/src/resources/portal-admin-war/WEB-INF/faces-config.xml 2007-03-15
12:48:16 UTC (rev 6679)
+++ trunk/core-admin/src/resources/portal-admin-war/WEB-INF/faces-config.xml 2007-03-15
12:51:47 UTC (rev 6680)
@@ -87,7 +87,7 @@
</managed-bean>
<managed-bean>
<managed-bean-name>addPageAction</managed-bean-name>
-
<managed-bean-class>org.jboss.portal.core.admin.ui.actions.AddPageAction2</managed-bean-class>
+
<managed-bean-class>org.jboss.portal.core.admin.ui.actions.AddPageAction</managed-bean-class>
<managed-bean-scope>request</managed-bean-scope>
<managed-property>
<property-name>pageContainer</property-name>
@@ -238,8 +238,8 @@
</managed-property>
</managed-bean>
<managed-bean>
- <managed-bean-name>addPageAction2</managed-bean-name>
-
<managed-bean-class>org.jboss.portal.core.admin.ui.actions.AddPageAction2</managed-bean-class>
+ <managed-bean-name>addDashboardPageAction</managed-bean-name>
+
<managed-bean-class>org.jboss.portal.core.admin.ui.actions.AddPageAction</managed-bean-class>
<managed-bean-scope>request</managed-bean-scope>
<managed-property>
<property-name>pageContainer</property-name>
Modified:
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/dashboard/dashboard.xhtml
===================================================================
---
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/dashboard/dashboard.xhtml 2007-03-15
12:48:16 UTC (rev 6679)
+++
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/dashboard/dashboard.xhtml 2007-03-15
12:51:47 UTC (rev 6680)
@@ -23,10 +23,10 @@
<tr>
<td align="left"
valign="top"><b>Create a New Page:</b><br/>Page
name: 
<h:form style="padding:0;margin:0">
- <h:inputText id="pageName"
value="#{addPageAction2.pageName}"
+ <h:inputText id="pageName"
value="#{addDashboardPageAction.pageName}"
styleClass="portlet-form-input-field"/>
<h:commandButton value="Save"
- action="#{addPageAction2.execute}"
+
action="#{addDashboardPageAction.execute}"
styleClass="portlet-form-button"/>
</h:form>
</td>