Author: julien(a)jboss.com
Date: 2007-02-27 11:46:32 -0500 (Tue, 27 Feb 2007)
New Revision: 6428
Removed:
trunk/core-admin/src/main/org/jboss/portal/core/portlet/management/actions/AddWindowAction.java
Modified:
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/faces-config.xml
Log:
removed obsolete AddWindowAction now
Deleted:
trunk/core-admin/src/main/org/jboss/portal/core/portlet/management/actions/AddWindowAction.java
===================================================================
---
trunk/core-admin/src/main/org/jboss/portal/core/portlet/management/actions/AddWindowAction.java 2007-02-27
16:33:48 UTC (rev 6427)
+++
trunk/core-admin/src/main/org/jboss/portal/core/portlet/management/actions/AddWindowAction.java 2007-02-27
16:46:32 UTC (rev 6428)
@@ -1,132 +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.portlet.management.actions;
-
-import org.jboss.portal.core.model.portal.Page;
-import org.jboss.portal.core.model.portal.Window;
-import org.jboss.portal.core.model.content.ContentType;
-import org.jboss.portal.core.portlet.management.PortalObjectManagerBean;
-import org.jboss.portal.theme.ThemeConstants;
-
-import javax.faces.application.FacesMessage;
-import javax.faces.component.UIComponent;
-import javax.faces.context.FacesContext;
-import javax.faces.validator.ValidatorException;
-
-/**
- * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 6082 $
- */
-public class AddWindowAction
-{
-
- /** . */
- private PortalObjectManagerBean pomgr;
-
- /** . */
- private String windowName;
-
- /** . */
- private String regionName;
-
- public PortalObjectManagerBean getPortalObjectManager()
- {
- return pomgr;
- }
-
- public void setPortalObjectManager(PortalObjectManagerBean portalObjectManager)
- {
- this.pomgr = portalObjectManager;
- }
-
- public String getWindowName()
- {
- return windowName;
- }
-
- public void setWindowName(String windowName)
- {
- this.windowName = windowName;
- }
-
- public String getRegionName()
- {
- return regionName;
- }
-
- public void setRegionName(String regionName)
- {
- this.regionName = regionName;
- }
-
- /**
- * Checks for duplicate window names on the page. Blank window names are not allowed
and are controlled by the
- * required attribute in the presentation page.
- *
- * @param context
- * @param toValidate
- * @param value
- */
- public void validateWindowName(FacesContext context, UIComponent toValidate, Object
value)
- {
- String windowName = (String)value;
-
- // check for empty string
- if (windowName.startsWith(" "))
- {
- String error = "Window name cannot be blank!";
- FacesMessage message = new FacesMessage(FacesMessage.SEVERITY_ERROR, error,
error);
- throw new ValidatorException(message);
- }
-
- // check for duplicate window name
- Page page = (Page)pomgr.getSelectedObject();
- if (page.getWindow(windowName) != null)
- {
- String error = "Duplicate window name found on this page!";
- FacesMessage message = new FacesMessage(FacesMessage.SEVERITY_ERROR, error,
error);
- throw new ValidatorException(message);
- }
- }
-
- public void execute()
- {
- try
- {
- Page page = (Page)pomgr.getSelectedObject();
-
- //
- ContentType contentType = pomgr.getSelectedContentType();
- String contentURI = pomgr.getSelectedContentURI();
-
- //
- Window window = page.createWindow(windowName, contentType, contentURI);
- window.setDeclaredProperty(ThemeConstants.PORTAL_PROP_REGION, regionName);
- window.setDeclaredProperty(ThemeConstants.PORTAL_PROP_ORDER, "" +
Integer.MAX_VALUE);
- }
- catch (Exception e)
- {
- e.printStackTrace();
- }
- }
-}
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-02-27
16:33:48 UTC (rev 6427)
+++ trunk/core-admin/src/resources/portal-admin-war/WEB-INF/faces-config.xml 2007-02-27
16:46:32 UTC (rev 6428)
@@ -90,15 +90,6 @@
</managed-property>
</managed-bean>
<managed-bean>
- <managed-bean-name>addWindowAction</managed-bean-name>
-
<managed-bean-class>org.jboss.portal.core.portlet.management.actions.AddWindowAction</managed-bean-class>
- <managed-bean-scope>request</managed-bean-scope>
- <managed-property>
- <property-name>portalObjectManager</property-name>
- <value>#{sessionScope.portalobjectmgr}</value>
- </managed-property>
- </managed-bean>
- <managed-bean>
<managed-bean-name>assignWindowsAction</managed-bean-name>
<managed-bean-class>org.jboss.portal.core.portlet.management.actions.AssignWindowsAction</managed-bean-class>
<managed-bean-scope>request</managed-bean-scope>