Author: emuckenhuber
Date: 2007-08-06 05:16:45 -0400 (Mon, 06 Aug 2007)
New Revision: 7865
Added:
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/AdminPropertyResolver.java
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/AuthorizationBean.java
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/ControlPropertiesBean.java
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/ControlPropertyBean.java
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/InstanceManagerBean.java
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/PortalObjectManagerBean.java
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/PortletManagerBean.java
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/PreferenceBean.java
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/PreferencesBean.java
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/PropertiesBean.java
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/PropertiesInfo.java
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/PropertyBean.java
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/PropertyBeanContainer.java
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/PropertyInfo.java
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/Refresher.java
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/ThemeBean.java
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/actions/
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/actions/AddPageAction.java
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/actions/AssignContentToWindowAction.java
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/actions/CreateInstanceAction.java
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/actions/PortalAction.java
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/actions/PropertyAction.java
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/actions/RenameAction.java
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/actions/WindowComparator.java
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/common/
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/common/PageManagerBean.java
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/conversion/
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/conversion/ContentTypeConverter.java
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/conversion/PortalObjectIdConverter.java
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/dashboard/
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/portlet/
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/portlet/PortletDefinitionInvoker.java
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/wizard/
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/wizard/NewWindowWizard.java
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/common/
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/common/confirm.xhtml
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/common/editPageErrorHandling.xhtml
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/common/editPageLayout.xhtml
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/common/editPortalErrorHandling.xhtml
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/common/editPreferences.xhtml
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/common/editProperties.xhtml
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/common/editSecurity.xhtml
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/common/editTheme.xhtml
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/common/editWindowTheme.xhtml
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/common/showPortletDetails.xhtml
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/confirmDeleteInstance.xhtml
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/dashboard/
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/dashboards.xhtml
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/dashboardsTemplate.xhtml
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/editContext.xhtml
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/editPage.xhtml
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/editPageLayout.xhtml
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/editPageSecurity.xhtml
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/editPageTheme.xhtml
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/editPortalSecurity.xhtml
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/editPortalTheme.xhtml
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/editProperties.xhtml
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/editWindow.xhtml
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/editWindowSecurity.xhtml
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/editWindowTheme.xhtml
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/instances.xhtml
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/instancesTemplate.xhtml
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/objectNavigation.xhtml
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/objectTemplate.xhtml
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/objects.xhtml
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/portlets.xhtml
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/portletsTemplate.xhtml
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/renameObject.xhtml
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/showPortletInfo.xhtml
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/wizard/
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/wizard/newWindowTpl.xhtml
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/wizard/newWindowWizardConfirm.xhtml
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/wizard/selectPage.xhtml
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/wizard/selectPortal.xhtml
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/wizard/selectPortlet.xhtml
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/wizard/selectRegion.xhtml
Removed:
trunk/core-admin/src/main/org/jboss/portal/core/admin/portal/
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/actions/AddPageAction.java
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/actions/AssignContentToWindowAction.java
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/actions/CreateInstanceAction.java
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/actions/PortalAction.java
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/actions/PropertyAction.java
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/actions/RenameAction.java
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/actions/WindowComparator.java
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/common/PageManagerBean.java
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/conversion/ContentTypeConverter.java
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/conversion/PortalObjectIdConverter.java
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/portlet/PortletDefinitionInvoker.java
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/wizard/NewWindowWizard.java
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/common/confirm.xhtml
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/common/editPageErrorHandling.xhtml
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/common/editPageLayout.xhtml
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/common/editPortalErrorHandling.xhtml
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/common/editPreferences.xhtml
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/common/editProperties.xhtml
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/common/editSecurity.xhtml
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/common/editTheme.xhtml
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/common/editWindowTheme.xhtml
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/common/showPortletDetails.xhtml
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/portal/
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/wizard/newWindowTpl.xhtml
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/wizard/newWindowWizardConfirm.xhtml
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/wizard/selectPage.xhtml
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/wizard/selectPortal.xhtml
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/wizard/selectPortlet.xhtml
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/wizard/selectRegion.xhtml
Modified:
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/faces-config.xml
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/portlet.xml
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/web.xml
Log:
rollback refactoring
Copied:
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/AdminPropertyResolver.java (from
rev 7842,
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/AdminPropertyResolver.java)
===================================================================
--- trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/AdminPropertyResolver.java
(rev 0)
+++
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/AdminPropertyResolver.java 2007-08-06
09:16:45 UTC (rev 7865)
@@ -0,0 +1,374 @@
+/******************************************************************************
+ * 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;
+
+import org.jboss.portal.faces.el.decorator.SimpleBeanDecorator;
+import org.jboss.portal.faces.el.decorator.AbstractPropertyDecorator;
+import org.jboss.portal.faces.el.decorator.AbstractBeanDecorator;
+import org.jboss.portal.faces.el.decorator.PropertyDecorator;
+import org.jboss.portal.faces.el.DelegatingPropertyResolver;
+import org.jboss.portal.identity.RoleModule;
+import org.jboss.portal.identity.IdentityException;
+import org.jboss.portal.common.i18n.LocalizedString;
+import org.jboss.portal.common.util.IteratorStatus;
+import org.jboss.portal.common.util.MediaType;
+import org.jboss.portal.portlet.Portlet;
+import org.jboss.portal.portlet.PortletInvokerException;
+import org.jboss.portal.portlet.info.MetaInfo;
+import org.jboss.portal.portlet.info.PortletInfo;
+import org.jboss.portal.core.model.instance.Instance;
+import org.jboss.portal.core.model.portal.PortalObject;
+import org.jboss.portal.core.model.portal.PortalObjectId;
+import org.jboss.portal.core.model.portal.PortalObjectPath;
+import org.jboss.portal.core.model.content.ContentType;
+import org.jboss.portal.core.model.content.spi.portlet.ContentPortlet;
+import org.jboss.portal.core.impl.model.content.ContentProviderRegistryService;
+import org.jboss.portal.security.AuthorizationDomainRegistry;
+import org.jboss.portal.security.spi.provider.AuthorizationDomain;
+import org.jboss.portal.theme.LayoutService;
+import org.jboss.portal.theme.PortalLayout;
+import org.jboss.portal.theme.ThemeService;
+import org.jboss.portal.theme.PortalTheme;
+import org.jboss.portal.theme.ServerRegistrationID;
+import org.jboss.portal.theme.PortalRenderSet;
+
+import javax.faces.context.FacesContext;
+import javax.faces.model.SelectItem;
+import javax.faces.el.PropertyResolver;
+import java.util.Set;
+import java.util.Locale;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Collection;
+import java.util.Map;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Collections;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class AdminPropertyResolver extends DelegatingPropertyResolver
+{
+
+ public AdminPropertyResolver()
+ {
+ init();
+ }
+
+ public AdminPropertyResolver(PropertyResolver delegate)
+ {
+ super(delegate);
+
+ //
+ init();
+ }
+
+ private void init()
+ {
+ SimpleBeanDecorator roleModuleDecorator = new SimpleBeanDecorator();
+ roleModuleDecorator.setProperty("roles", new
AbstractPropertyDecorator(Set.class)
+ {
+ public Object getValue(Object bean)
+ {
+ try
+ {
+ RoleModule module = (RoleModule)bean;
+ return module.findRoles();
+ }
+ catch (IdentityException e)
+ {
+ e.printStackTrace();
+ return null;
+ }
+ }
+ });
+ registerDecorator(RoleModule.class, roleModuleDecorator);
+
+ //
+ SimpleBeanDecorator localizedStringDecorator = new SimpleBeanDecorator();
+ localizedStringDecorator.setProperty("value", new
AbstractPropertyDecorator(String.class)
+ {
+ public Object getValue(Object bean)
+ {
+ LocalizedString string = (LocalizedString)bean;
+ FacesContext ctx = FacesContext.getCurrentInstance();
+ Locale locale = ctx.getExternalContext().getRequestLocale();
+ return string.getString(locale, true);
+ }
+ });
+ registerDecorator(LocalizedString.class, localizedStringDecorator);
+
+ //
+ SimpleBeanDecorator portletDecorator = new SimpleBeanDecorator();
+ portletDecorator.setProperty("name", new
AbstractPropertyDecorator(String.class)
+ {
+ public Object getValue(Object bean) throws IllegalArgumentException
+ {
+ Portlet portlet = (Portlet)bean;
+ return portlet.getInfo().getMeta().getMetaValue(MetaInfo.DISPLAY_NAME);
+ }
+ });
+ portletDecorator.setProperty("description", new
AbstractPropertyDecorator(String.class)
+ {
+ public Object getValue(Object bean) throws IllegalArgumentException
+ {
+ Portlet portlet = (Portlet)bean;
+ return portlet.getInfo().getMeta().getMetaValue(MetaInfo.DESCRIPTION);
+ }
+ });
+ portletDecorator.setProperty("keywords", new
AbstractPropertyDecorator(String.class)
+ {
+ public Object getValue(Object bean) throws IllegalArgumentException
+ {
+ Portlet portlet = (Portlet)bean;
+ return portlet.getInfo().getMeta().getMetaValue(MetaInfo.KEYWORDS);
+ }
+ });
+ portletDecorator.setProperty("title", new
AbstractPropertyDecorator(String.class)
+ {
+ public Object getValue(Object bean) throws IllegalArgumentException
+ {
+ Portlet portlet = (Portlet)bean;
+ return portlet.getInfo().getMeta().getMetaValue(MetaInfo.TITLE);
+ }
+ });
+ portletDecorator.setProperty("remotable", new
AbstractPropertyDecorator(String.class)
+ {
+ public Object getValue(Object bean) throws IllegalArgumentException
+ {
+ Portlet portlet = (Portlet)bean;
+ PortletInfo info = portlet.getInfo();
+ return info.isRemotable();
+ }
+ });
+ portletDecorator.setProperty("modes", new
AbstractPropertyDecorator(String.class)
+ {
+ public Object getValue(Object bean) throws IllegalArgumentException
+ {
+ Portlet portlet = (Portlet)bean;
+ return portlet.getInfo().getCapabilities().getModes("text/html");
+ }
+ });
+ portletDecorator.setProperty("windowStates", new
AbstractPropertyDecorator(String.class)
+ {
+ public Object getValue(Object bean) throws IllegalArgumentException
+ {
+ Portlet portlet = (Portlet)bean;
+ return
portlet.getInfo().getCapabilities().getWindowStates("text/html");
+ }
+ });
+ portletDecorator.setProperty("locales", new
AbstractPropertyDecorator(String.class)
+ {
+ public Object getValue(Object bean) throws IllegalArgumentException
+ {
+ Portlet portlet = (Portlet)bean;
+ return new ArrayList(portlet.getInfo().getCapabilities().getAllLocales());
+ }
+ });
+ registerDecorator(Portlet.class, portletDecorator);
+
+ //
+ SimpleBeanDecorator instanceDecorator = new SimpleBeanDecorator();
+ instanceDecorator.setProperty("portlet", new
AbstractPropertyDecorator(Portlet.class)
+ {
+ public Object getValue(Object bean)
+ {
+ Instance instance = (Instance)bean;
+ try
+ {
+ return instance.getPortlet();
+ }
+ catch (PortletInvokerException e)
+ {
+ // If the portlet is not available we want to avoid the stack trace and
rather return null
+ return null;
+ }
+ }
+ });
+ registerDecorator(Instance.class, instanceDecorator);
+
+ //
+ SimpleBeanDecorator portalObjectDecorator = new SimpleBeanDecorator()
+ {
+ private List getChildren(PortalObject object, int mask)
+ {
+ return new ArrayList(object.getChildren(mask));
+ }
+ {
+ setProperty("portals", new
AbstractPropertyDecorator(PortalObject.class)
+ {
+ public Object getValue(Object bean)
+ {
+ PortalObject object = (PortalObject)bean;
+ PortalObjectId id = object.getId();
+
+ // We don't want to iterate the potentially large collection of
dashboard portals
+ if ("dashboard".equals(id.getNamespace()))
+ {
+ return Collections.EMPTY_LIST;
+ }
+ else
+ {
+ return getChildren(object, PortalObject.PORTAL_MASK);
+ }
+ }
+ });
+ setProperty("pages", new
AbstractPropertyDecorator(PortalObject.class)
+ {
+ public Object getValue(Object bean)
+ {
+ PortalObject object = (PortalObject)bean;
+ return getChildren(object, PortalObject.PAGE_MASK);
+ }
+ });
+ setProperty("windows", new
AbstractPropertyDecorator(PortalObject.class)
+ {
+ public Object getValue(Object bean)
+ {
+ PortalObject object = (PortalObject)bean;
+ return getChildren(object, PortalObject.WINDOW_MASK);
+ }
+ });
+ }
+ };
+ portalObjectDecorator.setProperty("id", new
AbstractPropertyDecorator(PortalObject.class)
+ {
+ public Object getValue(Object bean)
+ {
+ PortalObject object = (PortalObject)bean;
+ PortalObjectId id = object.getId();
+ return id.toString(PortalObjectPath.LEGACY_BASE64_FORMAT);
+ }
+ });
+ registerDecorator(PortalObject.class, portalObjectDecorator);
+
+ //
+ registerDecorator(ContentProviderRegistryService.class, new
AbstractBeanDecorator()
+ {
+ protected PropertyDecorator getProperty(Object propertyName)
+ {
+ ContentType contentType = ContentType.create((String)propertyName);
+ final String instanceName =
ContentProviderRegistryService.getInstance().getContentProvider(contentType).getPortletInfo().getPortletName(ContentPortlet.EDIT_CONTENT_MODE);
+ return instanceName == null ? null : new
AbstractPropertyDecorator(String.class)
+ {
+ public Object getValue(Object bean) throws IllegalArgumentException
+ {
+ return instanceName;
+ }
+ };
+ }
+ });
+
+ //
+ registerDecorator(AuthorizationDomainRegistry.class, new AbstractBeanDecorator()
+ {
+ protected PropertyDecorator getProperty(final Object propertyName)
+ {
+ return new AbstractPropertyDecorator(AuthorizationDomain.class)
+ {
+ public Object getValue(Object bean) throws IllegalArgumentException
+ {
+ return
((AuthorizationDomainRegistry)bean).getDomain((String)propertyName);
+ }
+ };
+ }
+ });
+
+ //
+ SimpleBeanDecorator layoutServiceDecorator = new SimpleBeanDecorator();
+ layoutServiceDecorator.setProperty("layoutItems", new
AbstractPropertyDecorator(SelectItem[].class)
+ {
+ public Object getValue(Object bean) throws IllegalArgumentException
+ {
+ LayoutService layoutService = (LayoutService)bean;
+ Collection layouts = layoutService.getLayouts();
+ SelectItem[] items = new SelectItem[layouts.size() + 1];
+ for (IteratorStatus i = new IteratorStatus(layouts.iterator());i.hasNext();)
+ {
+ PortalLayout layout = (PortalLayout)i.next();
+ SelectItem item = new SelectItem();
+ String layoutName = layout.getLayoutInfo().getName();
+ item.setValue(layoutName);
+ item.setLabel(layoutName);
+ items[i.getIndex()] = item;
+ }
+ items[items.length - 1] = new SelectItem("", "default");
+ return items;
+ }
+ });
+ layoutServiceDecorator.setProperty("renderSetItems", new
AbstractPropertyDecorator(SelectItem[].class)
+ {
+ public Object getValue(Object bean) throws IllegalArgumentException
+ {
+ LayoutService layoutService = (LayoutService)bean;
+ Collection renderSets = layoutService.getRenderSets();
+ Map names = new HashMap();
+ for (Iterator i = renderSets.iterator(); i.hasNext();)
+ {
+ ServerRegistrationID renderSetId = (ServerRegistrationID)i.next();
+ PortalRenderSet renderSet = layoutService.getRenderSet(renderSetId,
MediaType.HTML);
+ if (renderSet != null)
+ {
+ names.put(renderSet.getName(), renderSet.getName());
+ }
+ }
+ SelectItem[] items = new SelectItem[names.size() + 1];
+ for (IteratorStatus i = new IteratorStatus(names.keySet().iterator());
i.hasNext();)
+ {
+ String key = (String)i.next();
+ items[i.getIndex()] = new SelectItem(key, (String)names.get(key));
+ }
+ items[items.length - 1] = new SelectItem("", "default");
+ return items;
+ }
+ });
+ registerDecorator(LayoutService.class, layoutServiceDecorator);
+
+ //
+ SimpleBeanDecorator themeServiceDecorator = new SimpleBeanDecorator();
+ themeServiceDecorator.setProperty("themeItems", new
AbstractPropertyDecorator(SelectItem[].class)
+ {
+ public Object getValue(Object bean) throws IllegalArgumentException
+ {
+ ThemeService layoutService = (ThemeService)bean;
+ Collection themes = layoutService.getThemes();
+ SelectItem[] items = new SelectItem[themes.size() + 1];
+ for (IteratorStatus i = new IteratorStatus(themes.iterator());i.hasNext();)
+ {
+ PortalTheme name = (PortalTheme)i.next();
+ SelectItem item = new SelectItem();
+ String themeName = name.getThemeInfo().getName();
+ item.setValue(themeName);
+ item.setLabel(themeName);
+ items[i.getIndex()] = item;
+ }
+ items[items.length - 1] = new SelectItem("", "default");
+ return items;
+ }
+ });
+ registerDecorator(ThemeService.class, themeServiceDecorator);
+ }
+
+}
Copied: trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/AuthorizationBean.java
(from rev 7842,
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/AuthorizationBean.java)
===================================================================
--- trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/AuthorizationBean.java
(rev 0)
+++
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/AuthorizationBean.java 2007-08-06
09:16:45 UTC (rev 7865)
@@ -0,0 +1,210 @@
+/******************************************************************************
+ * 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;
+
+import org.jboss.portal.common.util.Tools;
+import org.jboss.portal.faces.el.dynamic.AbstractDynamicBean;
+import org.jboss.portal.faces.el.PropertyValue;
+import org.jboss.portal.security.RoleSecurityBinding;
+import org.jboss.portal.security.SecurityConstants;
+import org.jboss.portal.security.spi.provider.DomainConfigurator;
+import org.jboss.portal.security.spi.provider.SecurityConfigurationException;
+import org.jboss.portal.identity.RoleModule;
+import org.jboss.portal.identity.Role;
+import org.jboss.portal.identity.IdentityException;
+
+import javax.faces.model.SelectItem;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.Map;
+import java.util.Set;
+import java.util.SortedSet;
+import java.util.TreeSet;
+import java.util.Collections;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 6252 $
+ */
+public abstract class AuthorizationBean
+{
+
+ public AbstractDynamicBean getForRole()
+ {
+ return new AbstractDynamicBean()
+ {
+ public Class getType(Object propertyName)
+ {
+ return String[].class;
+ }
+
+ public PropertyValue getValue(Object propertyName)
+ {
+ String[] actions = getActionsForRole((String)propertyName);
+ return actions != null ? new PropertyValue(actions) : null;
+ }
+
+ public boolean setValue(Object propertyName, Object value)
+ {
+ return setActionsForRole((String)propertyName, (String[])value);
+ }
+ };
+ }
+
+ public boolean setActionsForRole(String roleName, String[] actions)
+ {
+ String uri = getURI();
+ if (uri != null)
+ {
+ Set constraints = getDomainConfigurator().getSecurityBindings(uri);
+ Map newConstraints = new HashMap();
+ if (constraints != null)
+ {
+ for (Iterator i = constraints.iterator(); i.hasNext();)
+ {
+ RoleSecurityBinding binding = (RoleSecurityBinding)i.next();
+ newConstraints.put(binding.getRoleName(), binding);
+ }
+ }
+ Set blah = Tools.toSet(actions);
+ newConstraints.put(roleName, new RoleSecurityBinding(blah, roleName));
+ try
+ {
+ getDomainConfigurator().setSecurityBindings(uri, new
HashSet(newConstraints.values()));
+ }
+ catch (SecurityConfigurationException e)
+ {
+ e.printStackTrace();
+ }
+ return true;
+ }
+ else
+ {
+ return false;
+ }
+ }
+
+ public String[] getActionsForRole(String roleName)
+ {
+ String uri = getURI();
+ if (uri != null)
+ {
+ Set constraints = getDomainConfigurator().getSecurityBindings(uri);
+ if (constraints != null)
+ {
+ Set actions = new HashSet();
+ for (Iterator i = constraints.iterator(); i.hasNext();)
+ {
+ RoleSecurityBinding binding = (RoleSecurityBinding)i.next();
+ if (binding.getRoleName().equals(roleName))
+ {
+ actions.addAll(binding.getActions());
+ }
+ }
+ return (String[])actions.toArray(new String[actions.size()]);
+ }
+ else
+ {
+ return new String[0];
+ }
+ }
+ else
+ {
+ return null;
+ }
+ }
+
+ public String[] getRoles()
+ {
+ SortedSet roleNames = new TreeSet();
+
+ // Get role names from URI
+ String uri = getURI();
+ if (uri != null)
+ {
+ Set constraints = getDomainConfigurator().getSecurityBindings(uri);
+ if (constraints != null)
+ {
+ for (Iterator i = constraints.iterator(); i.hasNext();)
+ {
+ RoleSecurityBinding binding = (RoleSecurityBinding)i.next();
+ roleNames.add(binding.getRoleName());
+ }
+ }
+ }
+
+ // Get other roles from role module
+ try
+ {
+ roleNames.add(SecurityConstants.UNCHECKED_ROLE_NAME);
+ for (Iterator i = getRoleModule().findRoles().iterator(); i.hasNext();)
+ {
+ Role role = (Role)i.next();
+ roleNames.add(role.getName());
+ }
+ }
+ catch (IdentityException e)
+ {
+ e.printStackTrace();
+ }
+
+ //
+ return (String[])roleNames.toArray(new String[roleNames.size()]);
+ }
+
+ public Map getRoleDisplayNameMap()
+ {
+ try
+ {
+ Map map = new HashMap();
+ for (Iterator i = getRoleModule().findRoles().iterator();i.hasNext();)
+ {
+ Role role = (Role)i.next();
+ String displayName = role.getDisplayName();
+ if (displayName != null)
+ {
+ String name = role.getName();
+ map.put(name, displayName);
+ }
+ }
+ return map;
+ }
+ catch (IdentityException e)
+ {
+ return Collections.EMPTY_MAP;
+ }
+ }
+
+ public abstract String submit();
+
+ public abstract String cancel();
+
+ public abstract RoleModule getRoleModule();
+
+ public abstract DomainConfigurator getDomainConfigurator();
+
+ public abstract SelectItem[] getAvailableActions();
+
+ protected abstract String getURI();
+}
Property changes on:
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/AuthorizationBean.java
___________________________________________________________________
Name: svn:executable
+ *
Copied:
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/ControlPropertiesBean.java (from
rev 7842,
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/ControlPropertiesBean.java)
===================================================================
--- trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/ControlPropertiesBean.java
(rev 0)
+++
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/ControlPropertiesBean.java 2007-08-06
09:16:45 UTC (rev 7865)
@@ -0,0 +1,169 @@
+/*
+* 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;
+
+import org.jboss.portal.core.model.portal.PortalObject;
+import org.jboss.portal.core.model.portal.control.ControlConstants;
+
+import javax.faces.model.SelectItem;
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * @author <a href="mailto:boleslaw dot dawidowicz at redhat anotherdot
com">Boleslaw Dawidowicz</a>
+ * @version $Revision: 0.1 $
+ */
+public class ControlPropertiesBean extends PropertyBeanContainer
+{
+
+ /** . */
+ private List portalSelectItems;
+
+ /** . */
+ private List pageSelectItems;
+
+ /** . */
+ final PortalObjectManagerBean pomgr;
+ private static final String DISPLAY_THE_DEFAULT_ERROR_MESSAGE = "Display the
default error message";
+ private static final String REDIRECT_TO_THE_SPECIFIED_RESOURCE = "Redirect to the
specified resource";
+ private static final String REMOVE_THE_RESOURCE_FROM_PAGE = "Remove the resource
from page";
+
+ public ControlPropertiesBean(PortalObjectManagerBean pomgr)
+ {
+ this.pomgr = pomgr;
+
+ }
+
+ public List getPortalSelectItems()
+ {
+ if (portalSelectItems == null)
+ {
+ portalSelectItems = new ArrayList();
+ portalSelectItems.add(new SelectItem(ControlConstants.IGNORE_CONTROL_VALUE,
DISPLAY_THE_DEFAULT_ERROR_MESSAGE));
+ portalSelectItems.add(new SelectItem(ControlConstants.JSP_CONTROL_VALUE,
REDIRECT_TO_THE_SPECIFIED_RESOURCE));
+ }
+ return portalSelectItems;
+ }
+
+ public List getPageSelectItems()
+ {
+ if (pageSelectItems == null)
+ {
+ pageSelectItems = new ArrayList();
+ pageSelectItems.add(new SelectItem(ControlConstants.IGNORE_CONTROL_VALUE,
DISPLAY_THE_DEFAULT_ERROR_MESSAGE));
+ pageSelectItems.add(new SelectItem(ControlConstants.HIDE_CONTROL_VALUE,
REMOVE_THE_RESOURCE_FROM_PAGE));
+ pageSelectItems.add(new SelectItem(ControlConstants.JSP_CONTROL_VALUE,
REDIRECT_TO_THE_SPECIFIED_RESOURCE));
+ }
+ return pageSelectItems;
+ }
+
+ private ControlPropertyBean grabProperty(String name)
+ {
+ if (name == null)
+ {
+ throw new IllegalArgumentException("name cannot be null");
+ }
+
+ if (!PropertiesInfo.isControlProperty(name))
+ {
+ throw new IllegalStateException("trying to process non control property:
" + name);
+ }
+
+ PortalObject object = pomgr.getSelectedObject();
+
+ object = pomgr.getPortalObjectContainer().getObject(object.getId());
+
+ PropertiesInfo info = new PropertiesInfo(object);
+
+
+ boolean inheritable = object.getType() != PortalObject.TYPE_CONTEXT;
+ boolean inherited = !object.getDeclaredProperties().containsKey(name);
+ String value = object.getProperty(name);
+ return new ControlPropertyBean(this, info.getPropertyInfo(name), inherited,
inheritable, value);
+ }
+
+ public ControlPropertyBean getPageControlAccessDenied()
+ {
+ return grabProperty(ControlConstants.PAGE_ACCESS_DENIED_CONTROL_KEY);
+ }
+
+ public ControlPropertyBean getPageControlUnavailable()
+ {
+ return grabProperty(ControlConstants.PAGE_UNAVAILABLE_CONTROL_KEY);
+ }
+
+ public ControlPropertyBean getPageControlError()
+ {
+ return grabProperty(ControlConstants.PAGE_ERROR_CONTROL_KEY);
+ }
+
+ public ControlPropertyBean getPageControlInternalError()
+ {
+ return grabProperty(ControlConstants.PAGE_INTERNAL_ERROR_CONTROL_KEY);
+ }
+
+ public ControlPropertyBean getPageControlNotFound()
+ {
+ return grabProperty(ControlConstants.PAGE_NOT_FOUND_CONTROL_KEY);
+ }
+
+ public ControlPropertyBean getPageControlResourceURI()
+ {
+ return grabProperty(ControlConstants.PAGE_RESOURCE_URI_CONTROL_KEY);
+ }
+
+ public ControlPropertyBean getPortalControlAccessDenied()
+ {
+ return grabProperty(ControlConstants.PORTAL_ACCESS_DENIED_CONTROL_KEY);
+ }
+
+ public ControlPropertyBean getPortalControlUnavailable()
+ {
+ return grabProperty(ControlConstants.PORTAL_UNAVAILABLE_CONTROL_KEY);
+ }
+
+ public ControlPropertyBean getPortalControlError()
+ {
+ return grabProperty(ControlConstants.PORTAL_ERROR_CONTROL_KEY);
+ }
+
+ public ControlPropertyBean getPortalControlInternalError()
+ {
+ return grabProperty(ControlConstants.PORTAL_INTERNAL_ERROR_CONTROL_KEY);
+ }
+
+ public ControlPropertyBean getPortalControlNotFound()
+ {
+ return grabProperty(ControlConstants.PORTAL_NOT_FOUND_CONTROL_KEY);
+ }
+
+ public ControlPropertyBean getPortalControlResourceURI()
+ {
+ return grabProperty(ControlConstants.PORTAL_RESOURCE_URI_CONTROL_KEY);
+ }
+
+ public PortalObject getRelatedObject()
+ {
+ return pomgr.getSelectedObject();
+ }
+}
Copied: trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/ControlPropertyBean.java
(from rev 7842,
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/ControlPropertyBean.java)
===================================================================
--- trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/ControlPropertyBean.java
(rev 0)
+++
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/ControlPropertyBean.java 2007-08-06
09:16:45 UTC (rev 7865)
@@ -0,0 +1,88 @@
+/*
+* 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;
+
+import org.jboss.portal.core.model.portal.PortalObject;
+
+import javax.faces.event.ValueChangeEvent;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @author <a href="mailto:theute@jboss.org">Thomas Heute</a>
+ * @author <a href="mailto:boleslaw dot dawidowicz at redhat anotherdot
com">Boleslaw Dawidowicz</a>
+ * @version $Revision: 1.1 $
+ */
+public class ControlPropertyBean extends PropertyBean
+{
+
+ /** . */
+ private final ControlPropertiesBean container;
+
+ public ControlPropertyBean(ControlPropertiesBean container, PropertyInfo info, boolean
inherited, boolean inheritable, String value)
+ {
+ super(container, info, inherited, inheritable, value);
+ //
+ this.container = container;
+ }
+
+ public void setInherited(boolean inherited)
+ {
+ this.inherited = inherited;
+ }
+
+ public void inherit(ValueChangeEvent event)
+ {
+ PortalObject portalObject = container.getRelatedObject();
+
+ //
+
+
+ //
+ if (event.getNewValue().toString().equalsIgnoreCase("true"))
+ {
+ portalObject.setDeclaredProperty(getName(), null);
+ }
+ else
+ {
+ portalObject.setDeclaredProperty(getName(), value);
+ }
+ }
+
+ public void setValue(Object value)
+ {
+ if (!inherited)
+ {
+ this.value = value.toString();
+
+ // Need to use the container as it will contain the refreshed object
+ PortalObject portalObject = container.pomgr.getSelectedObject();
+ portalObject.setDeclaredProperty(getName(), value.toString());
+ }
+
+ }
+
+ public boolean isControlProperty()
+ {
+ return PropertiesInfo.isControlProperty(info.getName());
+ }
+}
Copied: trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/InstanceManagerBean.java
(from rev 7842,
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/InstanceManagerBean.java)
===================================================================
--- trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/InstanceManagerBean.java
(rev 0)
+++
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/InstanceManagerBean.java 2007-08-06
09:16:45 UTC (rev 7865)
@@ -0,0 +1,484 @@
+/******************************************************************************
+ * 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;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.Comparator;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import javax.faces.application.FacesMessage;
+import javax.faces.context.ExternalContext;
+import javax.faces.context.FacesContext;
+import javax.faces.event.ActionEvent;
+import javax.faces.model.SelectItem;
+import javax.portlet.PortletMode;
+
+import org.jboss.portal.Mode;
+import org.jboss.portal.common.value.Value;
+import org.jboss.portal.core.model.instance.Instance;
+import org.jboss.portal.core.model.instance.InstanceContainer;
+import org.jboss.portal.core.model.instance.InstanceDefinition;
+import org.jboss.portal.core.model.instance.NoSuchInstanceException;
+import org.jboss.portal.identity.RoleModule;
+import org.jboss.portal.portlet.Portlet;
+import org.jboss.portal.portlet.PortletInvokerException;
+import org.jboss.portal.portlet.info.ModeInfo;
+import org.jboss.portal.portlet.info.PortletInfo;
+import org.jboss.portal.portlet.info.PreferenceInfo;
+import org.jboss.portal.portlet.info.PreferencesInfo;
+import org.jboss.portal.portlet.state.PropertyChange;
+import org.jboss.portal.portlet.state.PropertyMap;
+import org.jboss.portal.security.spi.provider.DomainConfigurator;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @author <a href="mailto:boleslaw dot dawidowicz at jboss.org">Boleslaw
Dawidowicz</a>
+ * @version $Revision: 6252 $
+ */
+public class InstanceManagerBean
+{
+
+ /** . */
+ private final Mode INTERNAL_EDIT_CONTENT = Mode.create("edit_content");
+
+ // Wired services
+
+ /** . */
+ private InstanceContainer instanceContainer;
+
+ /** . */
+ private RoleModule roleModule;
+
+ /** . */
+ private DomainConfigurator domainConfigurator;
+
+ // Navigational state of the user
+
+ /** . */
+ private String selectedId;
+
+ /** . */
+ private String selectedPlugin;
+
+ /** . */
+ private int selectedFrom;
+
+ /** . */
+ private Integer selectedRow;
+
+ /** . */
+ private int paginationSize;
+
+ // Runtime fields depending on the navigational state
+
+ /** . */
+ private PreferencesBean selectedPrefs;
+
+ /** . */
+ private Instance selectedInstance;
+
+ /** . */
+ private List instances;
+
+ /** . */
+ private AuthorizationBean auth = new InstanceAuthorizationBean();
+
+ // Services accessors
+
+ public RoleModule getRoleModule()
+ {
+ return roleModule;
+ }
+
+ public void setRoleModule(RoleModule roleModule)
+ {
+ this.roleModule = roleModule;
+ }
+
+ public InstanceContainer getInstanceContainer()
+ {
+ return instanceContainer;
+ }
+
+ public void setInstanceContainer(InstanceContainer instanceContainer)
+ {
+ this.instanceContainer = instanceContainer;
+ }
+
+ public DomainConfigurator getDomainConfigurator()
+ {
+ return domainConfigurator;
+ }
+
+ public void setDomainConfigurator(DomainConfigurator domainConfigurator)
+ {
+ this.domainConfigurator = domainConfigurator;
+ }
+
+ // Navigational state accessor
+
+ public int getPaginationSize()
+ {
+ return paginationSize;
+ }
+
+ public void setPaginationSize(int paginationSize)
+ {
+ this.paginationSize = paginationSize;
+ }
+
+ public int getSelectedFrom()
+ {
+ return selectedFrom;
+ }
+
+ public void setSelectedFrom(int selectedFrom)
+ {
+ this.selectedFrom = selectedFrom;
+ }
+
+ public Integer getSelectedRow()
+ {
+ return selectedRow;
+ }
+
+ public void setSelectedRow(Integer selectedRow)
+ {
+ this.selectedRow = selectedRow;
+ }
+
+ public String getSelectedId()
+ {
+ return selectedId;
+ }
+
+ public void setSelectedId(String selectedId)
+ {
+ this.selectedId = selectedId;
+ }
+
+ public String getSelectedPlugin()
+ {
+ return selectedPlugin;
+ }
+
+ public void setSelectedPlugin(String selectedPlugin)
+ {
+ this.selectedPlugin = selectedPlugin;
+ }
+
+ // Runtime fields
+
+ public Instance getSelectedInstance()
+ {
+ if (selectedInstance == null && selectedId != null)
+ {
+ selectedInstance = instanceContainer.getDefinition(selectedId);
+ }
+ return selectedInstance;
+ }
+
+ public PreferencesBean getSelectedPrefs()
+ {
+ Instance selectedInstance = getSelectedInstance();
+
+ //
+ if (selectedPrefs == null && selectedInstance != null)
+ {
+ try
+ {
+ selectedPrefs = new PreferencesBean(true);
+
+ //
+ PreferencesInfo prefsInfo =
selectedInstance.getPortlet().getInfo().getPreferences();
+ Set keys = prefsInfo.getKeys();
+ PropertyMap props = selectedInstance.getProperties();
+ for (Iterator i = keys.iterator();i.hasNext();)
+ {
+ String key = (String)i.next();
+ PreferenceInfo prefInfo = prefsInfo.getPreference(key);
+ Value value = props.getProperty(key);
+ selectedPrefs.addEntry(prefInfo, value);
+ }
+ }
+ catch (PortletInvokerException e)
+ {
+ e.printStackTrace();
+ }
+ }
+
+ //
+ return selectedPrefs;
+ }
+
+ public AuthorizationBean getAuth()
+ {
+ return auth;
+ }
+
+ private List getInstances()
+ {
+ if (instances == null)
+ {
+ // Remove content editors
+ List tmpInstances = new ArrayList();
+ nextInstance:
+ for (Iterator i = instanceContainer.getDefinitions().iterator();i.hasNext();)
+ {
+ Instance instance = (Instance)i.next();
+
+ //
+ try
+ {
+ // Filter portlets that are editors
+ Portlet portlet = instance.getPortlet();
+ PortletInfo info = portlet.getInfo();
+ for (Iterator j =
info.getCapabilities().getAllModes().iterator();j.hasNext();)
+ {
+ ModeInfo modeInfo = (ModeInfo)j.next();
+ if (modeInfo.getMode().equals(INTERNAL_EDIT_CONTENT))
+ {
+ continue nextInstance;
+ }
+ }
+ //
+ tmpInstances.add(instance);
+ }
+ catch (PortletInvokerException ignore)
+ {
+ }
+ }
+ Collections.sort(tmpInstances, INSTANCE_COMPARATOR);
+ instances = tmpInstances;
+ }
+ //
+ return instances;
+ }
+
+ /** Return an array of all instances known in this container. */
+ public Collection getSelectedInstances()
+ {
+ List list = getInstances();
+
+ //
+ int to = Math.min(selectedFrom + paginationSize, list.size());
+
+ //
+ return list.subList(selectedFrom, to);
+ }
+
+ /** Return an array of all instances known in this container. */
+ public Map getSelectedInstancesPrefs()
+ {
+ Map map = new HashMap();
+ Collection instances = getSelectedInstances();
+ Iterator it = instances.iterator();
+
+ while (it.hasNext())
+ {
+ InstanceDefinition instanceDef = (InstanceDefinition)it.next();
+ try {
+ map.put(instanceDef.getId(), instanceDef.getProperties());
+ } catch (PortletInvokerException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ }
+
+ return map;
+ }
+
+ public int getInstanceCount()
+ {
+ return getInstances().size();
+ }
+
+ /** Refresh the selected prefs. */
+ public void refresh()
+ {
+ selectedInstance = null;
+ instances = null;
+ }
+
+ // UI operations
+
+ public void selectFrom()
+ {
+ Map pmap =
FacesContext.getCurrentInstance().getExternalContext().getRequestParameterMap();
+ selectedFrom = Integer.parseInt((String)pmap.get("from"));
+ selectedPlugin = null;
+ selectedId = null;
+ }
+
+ public void selectPlugin()
+ {
+ Map pmap =
FacesContext.getCurrentInstance().getExternalContext().getRequestParameterMap();
+ selectedPlugin = (String)pmap.get("plugin");
+ }
+
+ public void selectInstance()
+ {
+ FacesContext ctx = FacesContext.getCurrentInstance();
+ ExternalContext ectx = ctx.getExternalContext();
+ Map params = ectx.getRequestParameterMap();
+ selectedId = (String)params.get("id");
+ selectedPlugin = (String)params.get("plugin");
+ selectedPrefs = null;
+ }
+
+ public void selectInstance(ActionEvent e)
+ {
+ selectInstance();
+ }
+
+
+ public void deleteInstance(ActionEvent ae)
+ {
+ try
+ {
+ String id =
(String)ae.getComponent().getAttributes().get("instanceId");
+
+ //
+ instanceContainer.destroyDefinition(id);
+
+ //
+ selectedId = null;
+ selectedPrefs = null;
+ selectedFrom = 0;
+ selectedPlugin = null;
+ }
+ catch (NoSuchInstanceException e)
+ {
+ e.printStackTrace();
+ }
+ catch (PortletInvokerException e)
+ {
+ e.printStackTrace();
+ }
+ }
+
+ public void updatePrefs()
+ {
+ try
+ {
+ List tmp = new ArrayList();
+ List entries = selectedPrefs.getEntries();
+ for (int i = 0;i < entries.size();i++)
+ {
+ PreferenceBean entry = (PreferenceBean)entries.get(i);
+ if (entry.isStale())
+ {
+ PropertyChange change = PropertyChange.newUpdate(entry.getName(),
entry.getValue());
+ tmp.add(change);
+ }
+ }
+ PropertyChange[] changes = (PropertyChange[])tmp.toArray(new
PropertyChange[tmp.size()]);
+ getSelectedInstance().setProperties(changes);
+
+ // Todo handle that change was ok in the UI
+ }
+ catch (PortletInvokerException e)
+ {
+ // Todo handle issue in the UI
+ e.printStackTrace();
+ }
+
+ //
+ selectedId = null;
+ selectedPrefs = null;
+ selectedPlugin = null;
+ }
+
+ public void cancelPrefs()
+ {
+ selectedId = null;
+ selectedPrefs = null;
+ selectedPlugin = null;
+ }
+
+ /** A comparator for portlets. */
+ static final Comparator INSTANCE_COMPARATOR = new Comparator()
+ {
+ public int compare(Object o1, Object o2)
+ {
+ Instance i1 = (Instance)o1;
+ Instance i2 = (Instance)o2;
+ return i1.getId().compareToIgnoreCase(i2.getId());
+ }
+ };
+
+ public class InstanceAuthorizationBean extends AuthorizationBean
+ {
+
+ public DomainConfigurator getDomainConfigurator()
+ {
+ return InstanceManagerBean.this.getDomainConfigurator();
+ }
+
+ protected String getURI()
+ {
+ Instance instance = getSelectedInstance();
+ if (instance != null)
+ {
+ return instance.getId();
+ }
+ else
+ {
+ return null;
+ }
+ }
+
+ public String submit()
+ {
+ String stringMessage = "Security has been correctly updated";
+ FacesMessage message = new FacesMessage(FacesMessage.SEVERITY_INFO,
stringMessage, stringMessage);
+ FacesContext.getCurrentInstance().addMessage("status", message);
+ selectedId = null;
+ selectedPlugin = null;
+ return null;
+ }
+
+ public String cancel()
+ {
+ selectedId = null;
+ selectedPlugin = null;
+ return null;
+ }
+
+ public RoleModule getRoleModule()
+ {
+ return roleModule;
+ }
+
+ public SelectItem[] getAvailableActions()
+ {
+ return new SelectItem[]{ new SelectItem("view", "View") };
+ }
+ }
+}
Property changes on:
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/InstanceManagerBean.java
___________________________________________________________________
Name: svn:executable
+ *
Copied:
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/PortalObjectManagerBean.java
(from rev 7842,
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/PortalObjectManagerBean.java)
===================================================================
--- trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/PortalObjectManagerBean.java
(rev 0)
+++
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/PortalObjectManagerBean.java 2007-08-06
09:16:45 UTC (rev 7865)
@@ -0,0 +1,720 @@
+/******************************************************************************
+ * 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;
+
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import javax.faces.application.FacesMessage;
+import javax.faces.context.FacesContext;
+import javax.faces.event.ActionEvent;
+import javax.faces.model.SelectItem;
+
+import org.jboss.portal.core.admin.ui.actions.AddPageAction;
+import org.jboss.portal.core.admin.ui.actions.PropertyAction;
+import org.jboss.portal.core.admin.ui.common.PageManagerBean;
+import org.jboss.portal.core.admin.ui.portlet.PortletDefinitionInvoker;
+import org.jboss.portal.core.impl.model.content.ContentProviderRegistryService;
+import org.jboss.portal.core.model.content.Content;
+import org.jboss.portal.core.model.content.ContentType;
+import org.jboss.portal.core.model.content.spi.portlet.ContentPortlet;
+import org.jboss.portal.core.model.instance.Instance;
+import org.jboss.portal.core.model.instance.InstanceContainer;
+import org.jboss.portal.core.model.portal.Page;
+import org.jboss.portal.core.model.portal.PortalObject;
+import org.jboss.portal.core.model.portal.PortalObjectContainer;
+import org.jboss.portal.core.model.portal.PortalObjectId;
+import org.jboss.portal.core.model.portal.PortalObjectPath;
+import org.jboss.portal.core.model.portal.PortalObjectPermission;
+import org.jboss.portal.core.model.portal.Window;
+import org.jboss.portal.faces.component.portlet.PortletActionEvent;
+import org.jboss.portal.identity.RoleModule;
+import org.jboss.portal.portlet.PortletInvoker;
+import org.jboss.portal.security.RoleSecurityBinding;
+import org.jboss.portal.security.SecurityConstants;
+import org.jboss.portal.security.spi.provider.DomainConfigurator;
+import org.jboss.portal.theme.LayoutService;
+import org.jboss.portal.theme.ThemeService;
+
+/** The portal object manager bean. */
+public class PortalObjectManagerBean implements Serializable, AddPageAction.Listener
+{
+
+ /** The serialVersionUID */
+ private static final long serialVersionUID = -8923517554726982622L;
+
+ /** . */
+ private static final String CONTENT_URI = "content.uri";
+
+ // Configuration
+
+ /** . */
+ private String namespace;
+
+ // Wired services
+
+ /** . */
+ private PortalObjectContainer portalObjectContainer;
+
+ /** . */
+ private InstanceContainer instanceContainer;
+
+ /** . */
+ private LayoutService layoutService;
+
+ /** . */
+ private ThemeService themeService;
+
+ /** . */
+ private DomainConfigurator domainConfigurator;
+
+ /** . */
+ private RoleModule roleModule;
+
+ // Navigational state
+
+ /** The selected id. */
+ private PortalObjectId selectedId;
+
+ /** The current tab name. */
+ private String selectedPlugin;
+
+ /** The selected type for content. */
+ private ContentType selectedContentType = ContentType.PORTLET;
+
+ /** The uri value for content. */
+ private String selectedContentURI;
+
+ /** . */
+ private Map selectedContentParameters = new HashMap();
+
+ /** . */
+ private Map renderParameters;
+
+ // Runtime state
+
+ /** . */
+ private final AuthorizationBean auth = new PortalObjectAuthorizationBean();
+
+ /** . */
+ private SelectItem[] instanceItems;
+
+ /** . */
+ private SelectItem[] portalPageItems;
+
+ /** . */
+ private List selectedObjectPath;
+
+ /** . */
+ private PortalObject selectedObject;
+
+ /** . */
+ private PropertiesBean selectedProperties;
+
+ /** . */
+ PropertyAction propertyAction;
+
+ /** . */
+ private ControlPropertiesBean controlProperties;
+
+ /** . */
+ private PortletInvoker portletDefinitionInvoker;
+
+ /** . */
+ private ThemeBean theme;
+
+ /** . */
+ public PageManagerBean pageManager;
+
+ // Wired services
+
+ public String getNamespace()
+ {
+ return namespace;
+ }
+
+ public void setNamespace(String namespace)
+ {
+ this.namespace = namespace;
+ }
+
+ public List getAvailableContentTypes()
+ {
+ LinkedList types = new LinkedList();
+
+ //
+ for (Iterator i =
ContentProviderRegistryService.getInstance().getContentTypes().iterator(); i.hasNext();)
+ {
+ ContentType contentType = (ContentType)i.next();
+ SelectItem item = new SelectItem();
+ item.setValue(contentType);
+ item.setLabel(contentType.toString());
+ if (contentType.equals(ContentType.PORTLET))
+ {
+ types.addFirst(item);
+ }
+ else
+ {
+ types.addLast(item);
+ }
+ }
+ return types;
+ }
+
+ public String getSelectedContentEditorInstance()
+ {
+ if (selectedContentType != null)
+ {
+ return
ContentProviderRegistryService.getInstance().getContentProvider(selectedContentType).getPortletInfo().getPortletName(ContentPortlet.EDIT_CONTENT_MODE);
+ }
+ return null;
+ }
+
+ public RoleModule getRoleModule()
+ {
+ return roleModule;
+ }
+
+ public void setRoleModule(RoleModule roleModule)
+ {
+ this.roleModule = roleModule;
+ }
+
+ public PortalObjectContainer getPortalObjectContainer()
+ {
+ return portalObjectContainer;
+ }
+
+ public void setPortalObjectContainer(PortalObjectContainer poc)
+ {
+ this.portalObjectContainer = poc;
+ }
+
+ public InstanceContainer getInstanceContainer()
+ {
+ return instanceContainer;
+ }
+
+ public void setInstanceContainer(InstanceContainer instanceContainer)
+ {
+ this.instanceContainer = instanceContainer;
+ this.portletDefinitionInvoker = new PortletDefinitionInvoker(instanceContainer);
+ }
+
+ public LayoutService getLayoutService()
+ {
+ return layoutService;
+ }
+
+ public void setLayoutService(LayoutService layoutService)
+ {
+ this.layoutService = layoutService;
+ }
+
+ public ThemeService getThemeService()
+ {
+ return themeService;
+ }
+
+ public void setThemeService(ThemeService themeService)
+ {
+ this.themeService = themeService;
+ }
+
+ public ContentType getSelectedContentType()
+ {
+ return selectedContentType;
+ }
+
+ public void setSelectedContentType(ContentType selectedContentType)
+ {
+ this.selectedContentType = selectedContentType;
+ }
+
+ public String getSelectedContentURI()
+ {
+ return selectedContentURI;
+ }
+
+ public void setSelectedContentURI(String selectedContentURI)
+ {
+ this.selectedContentURI = selectedContentURI;
+ }
+
+ public String getSelectedPlugin()
+ {
+ return selectedPlugin;
+ }
+
+ public void setSelectedPlugin(String selectedPlugin)
+ {
+ this.selectedPlugin = selectedPlugin;
+ }
+
+ public Map getRenderParameters()
+ {
+ return renderParameters;
+ }
+
+ public void setRenderParameters(Map renderParameters)
+ {
+ this.renderParameters = renderParameters;
+ }
+
+ public Map getSelectedContentParameters()
+ {
+ return selectedContentParameters;
+ }
+
+ public void setSelectedContentParameters(Map selectedContentParameters)
+ {
+ this.selectedContentParameters = selectedContentParameters;
+ }
+
+ public DomainConfigurator getDomainConfigurator()
+ {
+ return domainConfigurator;
+ }
+
+ public void setDomainConfigurator(DomainConfigurator domainConfigurator)
+ {
+ this.domainConfigurator = domainConfigurator;
+ }
+
+ // Runtime state
+
+ public PortletInvoker getPortletDefinitionInvoker()
+ {
+ return portletDefinitionInvoker;
+ }
+
+ public AuthorizationBean getAuth()
+ {
+ return auth;
+ }
+
+ public SelectItem[] getInstanceItems()
+ {
+ return instanceItems;
+ }
+
+ public SelectItem[] getPortalPageItems()
+ {
+ return portalPageItems;
+ }
+
+ public List getSelectedObjectPath()
+ {
+ return selectedObjectPath;
+ }
+
+ public PortalObject getSelectedObject()
+ {
+ return selectedObject;
+ }
+
+ public PropertiesBean getSelectedProperties()
+ {
+ return selectedProperties;
+ }
+
+ public ThemeBean getTheme()
+ {
+ return theme;
+ }
+
+ // UI operations
+
+ public void selectObject(PortalObject po)
+ {
+ selectObject(po.getId());
+ }
+
+ private void selectObject(PortalObjectId id)
+ {
+ if (id == null)
+ {
+ selectedId = null;
+ selectedPlugin = null;
+ selectedContentType = ContentType.PORTLET;
+ selectedContentURI = null;
+ }
+ else
+ {
+ selectedId = id;
+ selectedPlugin = "manager";
+ selectedContentType = ContentType.PORTLET;
+ selectedContentURI = null;
+ }
+ }
+
+ public void selectObject(ActionEvent ae)
+ {
+ selectObject();
+ }
+
+ public String selectObject()
+ {
+ try
+ {
+ // Get id
+ Map pmap =
FacesContext.getCurrentInstance().getExternalContext().getRequestParameterMap();
+ String id = (String)pmap.get("id");
+
+ // Set the state from the id
+ PortalObjectId poid = PortalObjectId.parse(id,
PortalObjectPath.LEGACY_BASE64_FORMAT);
+ PortalObject object = portalObjectContainer.getObject(poid);
+
+ // Update state if possible
+ if (object != null)
+ {
+ selectObject(poid);
+
+ //
+ switch (object.getType())
+ {
+ case PortalObject.TYPE_CONTEXT:
+ break;
+ case PortalObject.TYPE_PORTAL:
+ break;
+ case PortalObject.TYPE_PAGE:
+ break;
+ case PortalObject.TYPE_WINDOW:
+ Window window = (Window)object;
+ selectedContentType = window.getContentType();
+ Content content = window.getContent();
+ if (content != null)
+ {
+ renderParameters = new HashMap();
+ renderParameters.put(CONTENT_URI, new String[]{content.getURI()});
+ }
+ break;
+ }
+ }
+ }
+ catch (Exception e)
+ {
+ e.printStackTrace();
+ }
+
+ //
+ return "objects";
+ }
+
+ public void selectPlugin()
+ {
+ // Get id
+ Map pmap =
FacesContext.getCurrentInstance().getExternalContext().getRequestParameterMap();
+ selectedPlugin = (String)pmap.get("plugin");
+ }
+
+ public void selectParentObject()
+ {
+ PortalObject current = getSelectedObject();
+ PortalObject parent = current.getParent();
+ selectObject(parent);
+ }
+
+ public void selectRootObject(ActionEvent ae)
+ {
+ PortalObject root = portalObjectContainer.getContext(namespace);
+ selectObject(root);
+ }
+
+ public void udpateContentType()
+ {
+ // Do nothing
+ }
+
+ public void destroyObject(ActionEvent ae)
+ {
+ try
+ {
+ selectObject((PortalObjectId)null);
+
+ // Get id
+ String id =
(String)ae.getComponent().getAttributes().get("objectId");
+
+ // Destroy the object
+ if (id != null)
+ {
+ PortalObjectId poid = PortalObjectId.parse(id,
PortalObjectPath.LEGACY_BASE64_FORMAT);
+ PortalObject object = portalObjectContainer.getObject(poid);
+
+ selectObject(object.getParent());
+
+ String stringMessage = object.getName() + " has successfully been
destroyed";
+
+ //
+ object.getParent().destroyChild(object.getName());
+
+ FacesMessage message = new FacesMessage(FacesMessage.SEVERITY_INFO,
stringMessage, stringMessage);
+ FacesContext.getCurrentInstance().addMessage("status", message);
+ }
+ }
+ catch (Exception e)
+ {
+ e.printStackTrace();
+ }
+ }
+
+ public void refresh()
+ {
+ propertyAction = null;
+ instanceItems = null;
+ portalPageItems = null;
+ selectedObjectPath = null;
+ selectedObject = null;
+ selectedProperties = null;
+ controlProperties = null;
+ theme = null;
+
+ //
+ if (selectedId == null)
+ {
+ selectedId = new PortalObjectId(namespace, PortalObjectPath.ROOT_PATH);
+ }
+
+ //
+ selectedObject = portalObjectContainer.getObject(selectedId);
+
+ //
+ if (selectedObject.getType() == PortalObject.TYPE_PAGE)
+ {
+ if (pageManager == null)
+ {
+ pageManager = new PageManagerBean(layoutService, portletDefinitionInvoker);
+ }
+ pageManager.page = (Page)selectedObject;
+ }
+
+ //
+ selectedProperties = new PropertiesBean(this);
+ controlProperties = new ControlPropertiesBean(this);
+ propertyAction = new PropertyAction(this);
+
+ //
+ theme = new ThemeBean(selectedObject);
+
+ //
+ Collection pages = getSelectedObject().getChildren(PortalObject.PAGE_MASK);
+ ArrayList list = new ArrayList(pages.size() + 1);
+ for (Iterator iterator = pages.iterator(); iterator.hasNext();)
+ {
+ PortalObject o = (PortalObject)iterator.next();
+ SelectItem item = new SelectItem(o.getName());
+ list.add(item);
+ }
+ list.add(new SelectItem("", "no selection"));
+ portalPageItems = (SelectItem[])list.toArray(new SelectItem[list.size()]);
+
+ //
+ PortalObject o = getSelectedObject();
+ ArrayList path = new ArrayList();
+ while (o != null)
+ {
+ path.add(o);
+ o = o.getParent();
+ }
+ Collections.reverse(path);
+ selectedObjectPath = path;
+
+ //
+ List tmp = new ArrayList(instanceContainer.getDefinitions());
+ Collections.sort(tmp, InstanceManagerBean.INSTANCE_COMPARATOR);
+ for (int i = 0; i < tmp.size(); i++)
+ {
+ Instance instance = (Instance)tmp.get(i);
+ SelectItem item = new SelectItem(instance.getId());
+ tmp.set(i, item);
+ }
+ instanceItems = (SelectItem[])tmp.toArray(new SelectItem[tmp.size()]);
+ }
+
+ public void processEvent(ActionEvent event)
+ {
+ if (event instanceof PortletActionEvent)
+ {
+ PortletActionEvent actionEvent = (PortletActionEvent)event;
+ Map actionParams = actionEvent.getParameterMap();
+ if (actionParams.get("content.action.select") != null)
+ {
+ String[] uris = (String[])actionParams.get(CONTENT_URI);
+ if (uris != null && uris.length > 0)
+ {
+ String uri = uris[0];
+ PortalObject po = getSelectedObject();
+ switch (po.getType())
+ {
+ case PortalObject.TYPE_WINDOW:
+ {
+ Window window = (Window)po;
+ window.getContent().setURI(uri);
+ selectParentObject();
+ break;
+ }
+ }
+ }
+ }
+ }
+ }
+
+ /** The implication configure properly the page security for default access. */
+ public void pageCreated(Page page)
+ {
+ Set constraints = Collections.singleton(new
RoleSecurityBinding(PortalObjectPermission.VIEW_RECURSIVE_ACTION,
SecurityConstants.UNCHECKED_ROLE_NAME));
+
getDomainConfigurator().setSecurityBindings(page.getId().toString(PortalObjectPath.CANONICAL_FORMAT),
constraints);
+ }
+
+ public class PortalObjectAuthorizationBean extends AuthorizationBean
+ {
+
+ public DomainConfigurator getDomainConfigurator()
+ {
+ return PortalObjectManagerBean.this.getDomainConfigurator();
+ }
+
+ protected String getURI()
+ {
+ PortalObject po = getSelectedObject();
+ if (po != null)
+ {
+ return po.getId().toString(PortalObjectPath.CANONICAL_FORMAT);
+ }
+ else
+ {
+ return null;
+ }
+ }
+
+ public SelectItem[] getAvailableActions()
+ {
+ return new SelectItem[]{
+ new SelectItem("view", "View"),
+ new SelectItem("viewrecursive", "View Recursive"),
+ new SelectItem("personalize", "Personalize"),
+ new SelectItem("personalizerecursive", "Personalize
Recursive")
+ };
+ }
+
+ public String submit()
+ {
+ String stringMessage = "Security has been correctly updated on the
page";
+ FacesMessage message = new FacesMessage(FacesMessage.SEVERITY_INFO,
stringMessage, stringMessage);
+ FacesContext.getCurrentInstance().addMessage("status", message);
+
+ //
+ return "objects";
+ }
+
+ public String cancel()
+ {
+ return "objects";
+ }
+
+ public RoleModule getRoleModule()
+ {
+ return roleModule;
+ }
+ }
+
+ public String getPreviewURL()
+ {
+// try
+// {
+// //set up the root node
+// PortalNode root = Navigation.getCurrentNode();
+// for (; root.getParent() != null;)
+// {
+// root = root.getParent();
+// }
+//
+// //obtain the path to our node
+// PortalObjectImpl object = (PortalObjectImpl)getSelectedObject();
+// String path = object.getObjectNode().getPath();
+//
+// //iterate to our point
+// String[] nodes = path.split("\\.");
+// PortalNode dest = root;
+//
+// for (int i = 0; i < nodes.length; i++)
+// {
+// String s = nodes[i];
+// dest = dest.getChild(s);
+// }
+//
+// //generate url
+// JBossRenderResponse response =
(JBossRenderResponse)FacesContext.getCurrentInstance().getExternalContext().getResponse();
+// String url = response.createRenderURL(dest).toString();
+// return url;
+// }
+// catch (Exception e)
+// {
+// log.info("Failed to generate object preview link");
+// e.printStackTrace();
+// }
+// //in case it fails let's point to some nice page ;)
+ return "http://www.jboss.org";
+ }
+
+
+ /**
+ * Helper method to recognize object type in EL easily
+ * @return
+ */
+ public String getSelectedObjectType()
+ {
+ PortalObject object = getSelectedObject();
+ if (object != null)
+ {
+ switch(object.getType())
+ {
+ case PortalObject.TYPE_CONTEXT:
+ return "context";
+ case PortalObject.TYPE_PORTAL:
+ return "portal";
+ case PortalObject.TYPE_PAGE:
+ return "page";
+ case PortalObject.TYPE_WINDOW:
+ return "window";
+ }
+ }
+
+ //to make it safe
+ return "none";
+ }
+
+
+ public ControlPropertiesBean getControlProperties()
+ {
+ return controlProperties;
+ }
+}
Property changes on:
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/PortalObjectManagerBean.java
___________________________________________________________________
Name: svn:executable
+ *
Copied: trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/PortletManagerBean.java
(from rev 7842,
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/PortletManagerBean.java)
===================================================================
--- trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/PortletManagerBean.java
(rev 0)
+++
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/PortletManagerBean.java 2007-08-06
09:16:45 UTC (rev 7865)
@@ -0,0 +1,420 @@
+/******************************************************************************
+ * 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;
+
+import org.jboss.logging.Logger;
+import org.jboss.portal.Mode;
+import org.jboss.portal.core.model.instance.Instance;
+import org.jboss.portal.core.model.instance.InstanceContainer;
+import org.jboss.portal.identity.RoleModule;
+import org.jboss.portal.portlet.Portlet;
+import org.jboss.portal.portlet.PortletContext;
+import org.jboss.portal.portlet.PortletInvoker;
+import org.jboss.portal.portlet.PortletInvokerException;
+import org.jboss.portal.portlet.federation.FederatedPortletInvoker;
+import org.jboss.portal.portlet.federation.FederatingPortletInvoker;
+import org.jboss.portal.portlet.federation.impl.FederatedPortlet;
+import org.jboss.portal.portlet.info.ModeInfo;
+import org.jboss.portal.portlet.info.PortletInfo;
+import org.jboss.portal.portlet.info.PreferenceInfo;
+import org.jboss.portal.portlet.info.PreferencesInfo;
+import org.jboss.portal.security.AuthorizationDomainRegistry;
+import org.jboss.portal.security.spi.provider.DomainConfigurator;
+
+import javax.faces.context.FacesContext;
+import javax.faces.model.SelectItem;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.Comparator;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @author <a href="mailto:boleslaw dot dawidowicz at jboss.org">Boleslaw
Dawidowicz</a>
+ * @version $Revision: 6252 $
+ */
+public class PortletManagerBean
+{
+
+ /** . */
+ private static final Logger log = Logger.getLogger(PortletManagerBean.class);
+
+ /** . */
+ private final Mode INTERNAL_EDIT_CONTENT = Mode.create("edit_content");
+
+ static
+ {
+ // For the loading of the class that will load the decorators
+ Class clazz = AdminPropertyResolver.class;
+ log.debug("Loaded bean decorator class " + clazz.getName());
+ }
+
+ // Wired services
+
+ /** . */
+ private InstanceContainer instanceContainer;
+
+ /** . */
+ private AuthorizationDomainRegistry authorizationDomainRegistry;
+
+ /** . */
+ private RoleModule roleModule;
+
+ /** . */
+ private FederatingPortletInvoker federatingPortletInvoker;
+
+ // Navigational state
+
+ /** . */
+ private int selectedFrom;
+
+ /** . */
+ private int paginationSize;
+
+ /** . */
+ private String selectedPortletId;
+
+ /** The current tab name. */
+ private String selectedPlugin;
+
+ /** . */
+ private String selectedPortletInvokerId;
+
+ // Runtime state
+
+ /** . */
+ private PreferencesBean selectedPreferences;
+
+ /** . */
+ private Portlet selectedPortlet;
+
+ /** . */
+ private Collection portletInvokerItems;
+
+ /** . */
+ private List portlets;
+
+ /** . */
+ private FederatedPortletInvoker selectedPortletInvoker;
+
+ // Wired services
+
+ public InstanceContainer getInstanceContainer()
+ {
+ return instanceContainer;
+ }
+
+ public void setInstanceContainer(InstanceContainer instanceContainer)
+ {
+ this.instanceContainer = instanceContainer;
+ }
+
+ public AuthorizationDomainRegistry getAuthorizationDomainRegistry()
+ {
+ return authorizationDomainRegistry;
+ }
+
+ public void setAuthorizationDomainRegistry(AuthorizationDomainRegistry
authorizationDomainRegistry)
+ {
+ this.authorizationDomainRegistry = authorizationDomainRegistry;
+ }
+
+ public RoleModule getRoleModule()
+ {
+ return roleModule;
+ }
+
+ public void setRoleModule(RoleModule roleModule)
+ {
+ this.roleModule = roleModule;
+ }
+
+ public FederatingPortletInvoker getFederatingPortletInvoker()
+ {
+ return federatingPortletInvoker;
+ }
+
+ public void setFederatingPortletInvoker(FederatingPortletInvoker
federatingPortletInvoker)
+ {
+ this.federatingPortletInvoker = federatingPortletInvoker;
+ }
+
+ // Navigational state
+
+ public int getPaginationSize()
+ {
+ return paginationSize;
+ }
+
+ public void setPaginationSize(int paginationSize)
+ {
+ this.paginationSize = paginationSize;
+ }
+
+ public int getSelectedFrom()
+ {
+ return selectedFrom;
+ }
+
+ public void setSelectedFrom(int selectedFrom)
+ {
+ this.selectedFrom = selectedFrom;
+ }
+
+ public String getSelectedPlugin()
+ {
+ return selectedPlugin;
+ }
+
+ public void setSelectedPlugin(String selectedPlugin)
+ {
+ this.selectedPlugin = selectedPlugin;
+ }
+
+ public String getSelectedPortletInvokerId()
+ {
+ return selectedPortletInvokerId;
+ }
+
+ public void setSelectedPortletInvokerId(String selectedPortletInvokerId)
+ {
+ this.selectedPortletInvokerId = selectedPortletInvokerId;
+ this.selectedPortletId = null;
+ this.selectedFrom = 0;
+ }
+
+ // Runtime state
+
+ private PortletInvoker getSelectedPortletInvoker()
+ {
+ if (selectedPortletInvoker == null)
+ {
+ selectedPortletInvoker =
federatingPortletInvoker.getFederatedInvoker(selectedPortletInvokerId);
+ }
+ return selectedPortletInvoker;
+ }
+
+ public Collection getPortletInvokerItems()
+ {
+ if (portletInvokerItems == null)
+ {
+ portletInvokerItems = new ArrayList();
+ portletInvokerItems.add(new SelectItem("local"));
+ for (Iterator i = federatingPortletInvoker.getFederatedInvokers().iterator();
i.hasNext();)
+ {
+ FederatedPortletInvoker federated = (FederatedPortletInvoker)i.next();
+ if ("local".equals(federated.getId()) == false)
+ {
+ portletInvokerItems.add(new SelectItem(federated.getId()));
+ }
+ }
+ }
+ return portletInvokerItems;
+ }
+
+ public PreferencesBean getSelectedPreferences()
+ {
+ // Get portlet
+ Portlet portlet = getSelectedPortlet();
+
+ //
+ if (portlet != null)
+ {
+ // Get preferences info
+ PreferencesInfo prefsInfo = null;
+ try
+ {
+ prefsInfo = portlet.getInfo().getPreferences();
+ }
+ catch (Exception e)
+ {
+ // todo: show a message?
+ log.info("Couldn't retrieve preferences for portlet " +
portlet.getContext().getId(), e);
+ }
+
+ // If the portlet has preferences info then we display them
+ if (prefsInfo != null)
+ {
+ selectedPreferences = new PreferencesBean(false);
+ for (Iterator i = prefsInfo.getKeys().iterator(); i.hasNext();)
+ {
+ String key = (String)i.next();
+ PreferenceInfo preferenceInfo = prefsInfo.getPreference(key);
+ selectedPreferences.addEntry(preferenceInfo);
+ }
+ }
+ }
+ return selectedPreferences;
+ }
+
+ private List getPortlets()
+ {
+ try
+ {
+ if (portlets == null)
+ {
+ portlets = new ArrayList();
+ List tmpPortlets = new ArrayList(getSelectedPortletInvoker().getPortlets());
+
+ // Remove content editors
+ nextPortlet:
+ for (Iterator i = tmpPortlets.iterator();i.hasNext();)
+ {
+ Portlet portlet = (Portlet)i.next();
+
+ PortletInfo info = portlet.getInfo();
+ for (Iterator j =
info.getCapabilities().getAllModes().iterator();j.hasNext();)
+ {
+ ModeInfo modeInfo = (ModeInfo)j.next();
+ if (modeInfo.getMode().equals(INTERNAL_EDIT_CONTENT))
+ {
+ continue nextPortlet;
+ }
+ }
+ //
+ portlets.add(portlet);
+ }
+ Collections.sort(portlets, comparator);
+ }
+ return portlets;
+ }
+ catch (PortletInvokerException e)
+ {
+ log.warn("Couldn't access portlet invoker. Portlets won't be
listed.\nReason:\n\t" + e.getLocalizedMessage());
+ return Collections.EMPTY_LIST;
+ }
+ }
+
+ public Collection getSelectedPortlets()
+ {
+ List portlets = getPortlets();
+
+ // Compute upper bound
+ int to = Math.min(selectedFrom + paginationSize, portlets.size());
+
+ // Range
+ return portlets.subList(selectedFrom, to);
+ }
+
+ public int getPortletCount()
+ {
+ return getPortlets().size();
+ }
+
+ public DomainConfigurator getDomainConfigurator()
+ {
+ return
authorizationDomainRegistry.getDomain("portlet").getConfigurator();
+ }
+
+ public Portlet getSelectedPortlet()
+ {
+ if (selectedPortlet == null && selectedPortletId != null)
+ {
+ try
+ {
+ selectedPortlet =
getSelectedPortletInvoker().getPortlet(PortletContext.createPortletContext(selectedPortletId));
+ }
+ catch (PortletInvokerException e)
+ {
+ // todo: find a way to report these errors to the user
+ log.warn("Portlet invoker unavailable for portlet: " +
selectedPortletId
+ + ". Returning null instead.\nReason:\n\t" +
e.getLocalizedMessage());
+ }
+ }
+ return selectedPortlet;
+ }
+
+ // UI actions
+
+ public String selectPortlet()
+ {
+ FacesContext ctx = FacesContext.getCurrentInstance();
+ selectedPortletId =
(String)ctx.getExternalContext().getRequestParameterMap().get("id");
+ selectedPlugin =
(String)ctx.getExternalContext().getRequestParameterMap().get("plugin");
+ selectedFrom = 0;
+
+ try
+ {
+ // Get portlet
+ PortletContext portletCtx =
PortletContext.createPortletContext(selectedPortletId);
+ FederatedPortlet portlet =
(FederatedPortlet)federatingPortletInvoker.getPortlet(portletCtx);
+
+ //
+ selectedPortletInvokerId = portlet.getFederatedId();
+
+ // Get sorted portlets
+ List portlets = new ArrayList(getSelectedPortletInvoker().getPortlets());
+ Collections.sort(portlets, comparator);
+
+ // Find the portlet index in the list
+ for (int i = 0; i < portlets.size(); i++)
+ {
+ Portlet current = (Portlet)portlets.get(i);
+ if (portlet.getContext().getId().equals(current.getContext().getId()))
+ {
+ selectedFrom = (i / paginationSize) * paginationSize;
+ break;
+ }
+ }
+ }
+ catch (PortletInvokerException e)
+ {
+ e.printStackTrace();
+ }
+
+ // It may be called from the instance stuff so we need to returns portlet
+ return "portlets";
+ }
+
+ public void selectFrom()
+ {
+ Map pmap =
FacesContext.getCurrentInstance().getExternalContext().getRequestParameterMap();
+ selectedFrom = Integer.parseInt((String)pmap.get("from"));
+ selectedPlugin = null;
+ selectedPortletId = null;
+ }
+
+ /** Refresh the selected prefs if they are available. */
+ public void refresh()
+ {
+ selectedPreferences = null;
+ selectedPortlet = null;
+ selectedPortletInvoker = null;
+ portlets = null;
+ portletInvokerItems = null;
+ }
+
+ /** A comparator for portlets. */
+ final Comparator comparator = new Comparator()
+ {
+ public int compare(Object o1, Object o2)
+ {
+ Portlet p1 = (Portlet)o1;
+ Portlet p2 = (Portlet)o2;
+ return p1.getContext().getId().compareToIgnoreCase(p2.getContext().getId());
+ }
+ };
+}
Property changes on:
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/PortletManagerBean.java
___________________________________________________________________
Name: svn:executable
+ *
Copied: trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/PreferenceBean.java (from
rev 7842, trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/PreferenceBean.java)
===================================================================
--- trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/PreferenceBean.java
(rev 0)
+++
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/PreferenceBean.java 2007-08-06
09:16:45 UTC (rev 7865)
@@ -0,0 +1,226 @@
+/******************************************************************************
+ * 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;
+
+import org.jboss.portal.common.value.Value;
+import org.jboss.portal.common.value.StringValue;
+import org.jboss.portal.common.i18n.LocalizedString;
+import org.jboss.portal.faces.el.dynamic.DynamicBean;
+import org.jboss.portal.faces.el.PropertyValue;
+import org.jboss.portal.portlet.info.PreferenceInfo;
+
+import javax.faces.event.ActionEvent;
+import java.util.List;
+import java.util.ArrayList;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class PreferenceBean implements Comparable, DynamicBean
+{
+
+ /** . */
+ private String name;
+
+ /** . */
+ private boolean readOnly;
+
+ /** . */
+ private LocalizedString displayName;
+
+ /** . */
+ private LocalizedString description;
+
+ /** . */
+ private Value value;
+
+ /** . */
+ private String line;
+
+ /** . */
+ PreferencesBean container;
+
+ /** . */
+ private boolean stale;
+
+ public PreferenceBean(PreferenceInfo prefInfo, Value value)
+ {
+ this.name = prefInfo.getKey();
+ this.readOnly = Boolean.TRUE.equals(prefInfo.isReadOnly());
+ this.displayName = prefInfo.getDisplayName();
+ this.description = prefInfo.getDescription();
+ this.value = value;
+ }
+
+ public String getName()
+ {
+ return name;
+ }
+
+ public boolean isReadOnly()
+ {
+ return readOnly;
+ }
+
+ public void setReadOnly(boolean readOnly)
+ {
+ this.readOnly = readOnly;
+ }
+
+ public LocalizedString getDisplayName()
+ {
+ return displayName;
+ }
+
+ public void setDisplayName(LocalizedString displayName)
+ {
+ this.displayName = displayName;
+ }
+
+ public LocalizedString getDescription()
+ {
+ return description;
+ }
+
+ public void setDescription(LocalizedString description)
+ {
+ this.description = description;
+ }
+
+ public Value getValue()
+ {
+ return value;
+ }
+
+ public void setValue(Value value)
+ {
+ this.value = value;
+ }
+
+ public boolean isStale()
+ {
+ return stale;
+ }
+
+ public List getIndices()
+ {
+ List list = new ArrayList(value.size());
+ for (int i = 0;i < value.size();i++)
+ {
+ list.add("index_" + i);
+ }
+ return list;
+ }
+
+ public String getLine()
+ {
+ return line;
+ }
+
+ public void setLine(String line)
+ {
+ this.line = line;
+ }
+
+ public void select()
+ {
+ if (container == null)
+ {
+ throw new IllegalStateException("Not attached to a container");
+ }
+ container.selectedIndex = container.entries.indexOf(this);
+ }
+
+ public void deleteLine(ActionEvent event)
+ {
+ String s = event.getComponent().getId();
+ int index = Integer.parseInt(s.substring(4));
+ List list = new ArrayList(value.asStringList());
+ list.remove(index);
+ String[] strings = (String[])list.toArray(new String[list.size()]);
+ value = new StringValue(strings);
+ stale = true;
+ }
+
+ public void appendLine()
+ {
+ List list = new ArrayList(value.asStringList());
+ list.add(line);
+ String[] strings = (String[])list.toArray(new String[list.size()]);
+ value = new StringValue(strings);
+ stale = true;
+ line = null;
+ }
+
+ public Class getType(Object propertyName) throws IllegalArgumentException
+ {
+ if (propertyName instanceof String)
+ {
+ String s = (String)propertyName;
+ if (s.startsWith("index_"))
+ {
+ return String.class;
+ }
+ }
+ return null;
+ }
+
+ public PropertyValue getValue(Object propertyName) throws IllegalArgumentException
+ {
+ if (propertyName instanceof String)
+ {
+ String s = (String)propertyName;
+ if (s.startsWith("index_"))
+ {
+ int index = Integer.parseInt(s.substring(6));
+ return new PropertyValue(value.asStringList().get(index));
+ }
+ }
+ return null;
+ }
+
+ public boolean setValue(Object propertyName, Object value) throws
IllegalArgumentException
+ {
+ if (propertyName instanceof String)
+ {
+ String s = (String)propertyName;
+ if (s.startsWith("index_"))
+ {
+ String[] tmp = this.value.asStringArray();
+ int index = Integer.parseInt(s.substring(6));
+ tmp[index] = (String)value;
+ this.value = new StringValue(tmp);
+ stale = true;
+ return true;
+ }
+ }
+ return false;
+ }
+
+ public int compareTo(Object o)
+ {
+ PreferenceBean that = (PreferenceBean)o;
+ return name.compareTo(that.name);
+ }
+}
Copied: trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/PreferencesBean.java
(from rev 7842,
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/PreferencesBean.java)
===================================================================
--- trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/PreferencesBean.java
(rev 0)
+++
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/PreferencesBean.java 2007-08-06
09:16:45 UTC (rev 7865)
@@ -0,0 +1,130 @@
+/******************************************************************************
+ * 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;
+
+import org.jboss.portal.portlet.info.PreferenceInfo;
+import org.jboss.portal.common.value.Value;
+
+import java.util.List;
+import java.util.ArrayList;
+import java.util.Collections;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class PreferencesBean
+{
+
+ /** . */
+ List entries;
+
+ /** . */
+ int selectedIndex;
+
+ /** . */
+ private boolean mutable;
+
+ public PreferencesBean(boolean mutable)
+ {
+ this.entries = new ArrayList();
+ this.selectedIndex = -1;
+ this.mutable = mutable;
+ }
+
+ public boolean isMutable()
+ {
+ return mutable;
+ }
+
+ public int getSelectedIndex()
+ {
+ return selectedIndex;
+ }
+
+ public void setSelectedIndex(int selectedIndex)
+ {
+ if (selectedIndex < 0 || selectedIndex >= entries.size())
+ {
+ throw new IllegalArgumentException();
+ }
+ this.selectedIndex = selectedIndex;
+ }
+
+ public void unselectEntry()
+ {
+ selectedIndex = -1;
+ }
+
+ public PreferenceBean getSelectedEntry()
+ {
+ if (selectedIndex < 0 || selectedIndex >= entries.size())
+ {
+ return null;
+ }
+ return (PreferenceBean)entries.get(selectedIndex);
+ }
+
+ public void addEntry(PreferenceInfo prefInfo)
+ {
+ if (mutable)
+ {
+ throw new IllegalStateException("Cannot add non mutable entry to a mutable
preferences bean");
+ }
+
+ //
+ addEntry(new PreferenceBean(prefInfo, null));
+ }
+
+ public void addEntry(PreferenceInfo prefInfo, Value value)
+ {
+ if (mutable == false)
+ {
+ throw new IllegalStateException("Cannot add mutable entry to a non mutable
preferences bean");
+ }
+
+ //
+ addEntry(new PreferenceBean(prefInfo, value));
+ }
+
+ private void addEntry(PreferenceBean pref)
+ {
+ if (pref.container != null)
+ {
+ throw new IllegalStateException("Already contained somewhere");
+ }
+ pref.container = this;
+ entries.add(pref);
+ Collections.sort(entries);
+ }
+
+ public List getEntries()
+ {
+ return Collections.unmodifiableList(entries);
+ }
+
+ public int getSize()
+ {
+ return entries.size();
+ }
+}
Copied: trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/PropertiesBean.java (from
rev 7842, trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/PropertiesBean.java)
===================================================================
--- trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/PropertiesBean.java
(rev 0)
+++
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/PropertiesBean.java 2007-08-06
09:16:45 UTC (rev 7865)
@@ -0,0 +1,167 @@
+/******************************************************************************
+ * 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;
+
+import org.jboss.portal.core.model.portal.PortalObject;
+import org.jboss.portal.core.admin.ui.actions.PropertyAction;
+
+import javax.faces.model.SelectItem;
+import javax.faces.context.FacesContext;
+import javax.faces.el.VariableResolver;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Iterator;
+import java.util.SortedMap;
+import java.util.TreeMap;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @author <a href="mailto:theute@jboss.org">Thomas Heute</a>
+ * @author <a href="mailto:boleslaw dot dawidowicz at redhat anotherdot
com">Boleslaw Dawidowicz</a>
+ * @version $Revision: 1.1 $
+ */
+public class PropertiesBean extends PropertyBeanContainer
+{
+
+ /** . */
+ private final SortedMap entryMap;
+
+ /** . */
+ private final PortalObjectManagerBean pomgr;
+
+ /** . */
+ private final PropertiesInfo info;
+
+ /** . */
+ private int selectedIndex;
+
+ /** . */
+ private List items;
+
+ /** . */
+ private String propertyActionRef;
+
+ public PropertiesBean(PortalObjectManagerBean pomgr)
+ {
+ // Get the selected object
+ PortalObject selectedObject = pomgr.getSelectedObject();
+
+ //
+ PropertiesInfo info = new PropertiesInfo(selectedObject);
+
+ //
+ SortedMap entryMap = new TreeMap();
+
+ //
+ boolean inheritable = selectedObject.getType() != PortalObject.TYPE_CONTEXT;
+
+ //
+ for (Iterator i = selectedObject.getProperties().keySet().iterator();i.hasNext();)
+ {
+ String propertyName = (String)i.next();
+ String propertyValue = selectedObject.getProperty(propertyName);
+ PropertyInfo propertyInfo = info.getPropertyInfo(propertyName);
+ boolean inherited =
!selectedObject.getDeclaredProperties().containsKey(propertyName);
+
+ // If null it is probably an inherited property that does not have meaning for
that particular object
+ // Filter, keep only public properties
+ if (propertyInfo != null && propertyInfo.getScope() ==
PropertyInfo.PUBLIC_SCOPE)
+ {
+ PropertyBean propertyBean = new PropertyBean(this, propertyInfo, inherited,
inheritable, propertyValue);
+ entryMap.put(propertyName, propertyBean);
+ }
+ }
+
+ //
+ this.info = info;
+ this.pomgr = pomgr;
+ this.entryMap = entryMap;
+ this.selectedIndex = -1;
+ }
+
+ public int getSelectedIndex()
+ {
+ return selectedIndex;
+ }
+
+ public void setSelectedIndex(int selectedIndex)
+ {
+ if (selectedIndex < 0 || selectedIndex >= entryMap.size())
+ {
+ throw new IllegalArgumentException();
+ }
+ this.selectedIndex = selectedIndex;
+ }
+
+ public void unselectEntry()
+ {
+ selectedIndex = -1;
+ }
+
+ public List getEntries()
+ {
+ return new ArrayList(entryMap.values());
+ }
+
+ public int getSize()
+ {
+ return entryMap.size();
+ }
+
+ public SelectItem[] getPropertyItems()
+ {
+ if (items == null)
+ {
+ items = new ArrayList();
+ for (Iterator i = info.getNames().iterator();i.hasNext();)
+ {
+ String propertyName = (String)i.next();
+
+ // Add only missing property
+ if (!entryMap.containsKey(propertyName))
+ {
+ PropertyInfo propertyInfo = info.getPropertyInfo(propertyName);
+
+ // Add only property user can change state
+ if (propertyInfo.getScope() == PropertyInfo.PUBLIC_SCOPE &&
propertyInfo.getAccessMode() == PropertyInfo.READ_WRITE_ACCESS_MODE &&
!PropertiesInfo.isControlProperty(propertyName))
+ {
+ items.add(new SelectItem(propertyInfo.getName(),
propertyInfo.getDisplayName().getDefaultString(),
propertyInfo.getDescription().getDefaultString()));
+ }
+ }
+ }
+ }
+
+ //
+ return (SelectItem[])items.toArray(new SelectItem[items.size()]);
+ }
+
+ public PortalObject getRelatedObject()
+ {
+ return pomgr.getSelectedObject();
+ }
+
+ public PropertyAction getAction()
+ {
+ return pomgr.propertyAction;
+ }
+}
Copied: trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/PropertiesInfo.java (from
rev 7842, trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/PropertiesInfo.java)
===================================================================
--- trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/PropertiesInfo.java
(rev 0)
+++
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/PropertiesInfo.java 2007-08-06
09:16:45 UTC (rev 7865)
@@ -0,0 +1,265 @@
+/******************************************************************************
+ * 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;
+
+import org.jboss.portal.common.i18n.LocalizedString;
+import org.jboss.portal.core.impl.model.portal.WindowImpl;
+import org.jboss.portal.core.model.portal.PortalObject;
+import org.jboss.portal.core.model.portal.control.ControlConstants;
+import org.jboss.portal.theme.ThemeConstants;
+import org.jboss.portal.theme.impl.render.dynamic.DynaRenderOptions;
+
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Map;
+import java.util.Set;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @author <a href="mailto:boleslaw dot dawidowicz at redhat dot com>Boleslaw
Dawidowicz</a>
+ * @version $Revision: 1.1 $
+ */
+public class PropertiesInfo
+{
+
+ //
+
+ public static final PropertyInfo THEME_LAYOUT_ID = new
PropertyInfo(ThemeConstants.PORTAL_PROP_LAYOUT, new LocalizedString("Layout
id"), new LocalizedString("The layout value formats a page"),
"java.lang.String", PropertyInfo.READ_WRITE_ACCESS_MODE,
PropertyInfo.PRIVATE_SCOPE);
+ public static final PropertyInfo THEME_THEME_ID = new
PropertyInfo(ThemeConstants.PORTAL_PROP_THEME, new LocalizedString("Theme id"),
new LocalizedString("The theme value skins a page"),
"java.lang.String", PropertyInfo.READ_WRITE_ACCESS_MODE,
PropertyInfo.PRIVATE_SCOPE);
+ public static final PropertyInfo THEME_RENDER_SET_ID = new
PropertyInfo(ThemeConstants.PORTAL_PROP_RENDERSET, new LocalizedString("Renderset
id"), new LocalizedString("The render set id"),
"java.lang.String", PropertyInfo.READ_WRITE_ACCESS_MODE,
PropertyInfo.PRIVATE_SCOPE);
+ public static final PropertyInfo THEME_RENDER_REGION_ID = new
PropertyInfo(ThemeConstants.PORTAL_PROP_REGION, new LocalizedString("Region
id"), new LocalizedString("The region that will the window"),
"java.lang.String", PropertyInfo.READ_WRITE_ACCESS_MODE,
PropertyInfo.PRIVATE_SCOPE);
+ public static final PropertyInfo THEME_RENDER_REGION_ORDER = new
PropertyInfo(ThemeConstants.PORTAL_PROP_ORDER, new LocalizedString("Region
order"), new LocalizedString("The vertical or horizontal order of the window
within a region"), "java.lang.String", PropertyInfo.READ_WRITE_ACCESS_MODE,
PropertyInfo.PUBLIC_SCOPE);
+
+ //
+
+ public static final PropertyInfo AJAX_PARTIAL_REFRESH = new
PropertyInfo(DynaRenderOptions.PARTIAL_REFRESH_ENABLED, new LocalizedString("Partial
refresh"), new LocalizedString("Enable partial refresh for portlets"),
"java.lang.Boolean", PropertyInfo.READ_WRITE_ACCESS_MODE,
PropertyInfo.PUBLIC_SCOPE);
+ public static final PropertyInfo AJAX_DND = new
PropertyInfo(DynaRenderOptions.DND_ENABLED, new LocalizedString("Drag and
drop"), new LocalizedString("Enable window drag and drop"),
"java.lang.Boolean", PropertyInfo.READ_WRITE_ACCESS_MODE,
PropertyInfo.PUBLIC_SCOPE);
+
+ //
+
+ public static final PropertyInfo WINDOW_CONTENT_TYPE = new
PropertyInfo(WindowImpl.PORTAL_PROP_WINDOW_CONTENT_TYPE, new LocalizedString("Content
type"), new LocalizedString("The type of content of a window"),
"java.lang.String", PropertyInfo.READ_WRITE_ACCESS_MODE,
PropertyInfo.PRIVATE_SCOPE);
+ public static final PropertyInfo DEFAULT_CHILD_NAME = new
PropertyInfo(WindowImpl.PORTAL_PROP_DEFAULT_OBJECT_NAME, new LocalizedString("Default
child name"), new LocalizedString("The child name used when no specific child
name is explicited"), "java.lang.String",
PropertyInfo.READ_WRITE_ACCESS_MODE, PropertyInfo.PUBLIC_SCOPE);
+ public static final PropertyInfo PAGE_ORDER = new PropertyInfo("order", new
LocalizedString("Tab order"), new LocalizedString("The order value to
display pages in tabs"), "java.lang.String",
PropertyInfo.READ_WRITE_ACCESS_MODE, PropertyInfo.PUBLIC_SCOPE);
+
+ //
+
+ public static final PropertyInfo CONTROL_POLICY_PAGE_ACCESS_DENIED = new
PropertyInfo(ControlConstants.PAGE_ACCESS_DENIED_CONTROL_KEY, new
LocalizedString("When access to the window is denied"), new
LocalizedString("When access to the window is denied"),
"java.lang.String", PropertyInfo.READ_WRITE_ACCESS_MODE,
PropertyInfo.PRIVATE_SCOPE);
+ public static final PropertyInfo CONTROL_POLICY_PAGE_UNAVAILABLE = new
PropertyInfo(ControlConstants.PAGE_UNAVAILABLE_CONTROL_KEY, new LocalizedString("When
the window is unavailable"), new LocalizedString("When the window is
unavailable"), "java.lang.String", PropertyInfo.READ_WRITE_ACCESS_MODE,
PropertyInfo.PRIVATE_SCOPE);
+ public static final PropertyInfo CONTROL_POLICY_PAGE_ERROR = new
PropertyInfo(ControlConstants.PAGE_ERROR_CONTROL_KEY, new LocalizedString("When there
is an error on the window"), new LocalizedString("When there is an error on the
window"), "java.lang.String", PropertyInfo.READ_WRITE_ACCESS_MODE,
PropertyInfo.PRIVATE_SCOPE);
+ public static final PropertyInfo CONTROL_POLICY_PAGE_INTERNAL_ERROR = new
PropertyInfo(ControlConstants.PAGE_INTERNAL_ERROR_CONTROL_KEY, new
LocalizedString("When there is an error within the window"), new
LocalizedString("When there is an error within the window"),
"java.lang.String", PropertyInfo.READ_WRITE_ACCESS_MODE,
PropertyInfo.PRIVATE_SCOPE);
+ public static final PropertyInfo CONTROL_POLICY_PAGE_NOT_FOUND = new
PropertyInfo(ControlConstants.PAGE_NOT_FOUND_CONTROL_KEY, new LocalizedString("When
the window is not found"), new LocalizedString("When the window is not
found"), "java.lang.String", PropertyInfo.READ_WRITE_ACCESS_MODE,
PropertyInfo.PRIVATE_SCOPE);
+ public static final PropertyInfo CONTROL_POLICY_PAGE_RESOURCE_URI = new
PropertyInfo(ControlConstants.PAGE_RESOURCE_URI_CONTROL_KEY, new LocalizedString("On
error redirect to this resource"), new LocalizedString("On error redirect to
this resource"), "java.lang.String", PropertyInfo.READ_WRITE_ACCESS_MODE,
PropertyInfo.PRIVATE_SCOPE);
+
+ //
+
+ public static final PropertyInfo CONTROL_POLICY_PORTAL_ACCESS_DENIED = new
PropertyInfo(ControlConstants.PORTAL_ACCESS_DENIED_CONTROL_KEY, new
LocalizedString("When access to the page is denied"), new
LocalizedString("When access to the page is denied"),
"java.lang.String", PropertyInfo.READ_WRITE_ACCESS_MODE,
PropertyInfo.PRIVATE_SCOPE);
+ public static final PropertyInfo CONTROL_POLICY_PORTAL_UNAVAILABLE = new
PropertyInfo(ControlConstants.PORTAL_UNAVAILABLE_CONTROL_KEY, new
LocalizedString("When the page is unavailable"), new LocalizedString("When
the page is unavailable"), "java.lang.String",
PropertyInfo.READ_WRITE_ACCESS_MODE, PropertyInfo.PRIVATE_SCOPE);
+ public static final PropertyInfo CONTROL_POLICY_PORTAL_ERROR = new
PropertyInfo(ControlConstants.PORTAL_ERROR_CONTROL_KEY, new LocalizedString("When
there is an error on the page"), new LocalizedString("When there is an error on
the page"), "java.lang.String", PropertyInfo.READ_WRITE_ACCESS_MODE,
PropertyInfo.PRIVATE_SCOPE);
+ public static final PropertyInfo CONTROL_POLICY_PORTAL_INTERNAL_ERROR = new
PropertyInfo(ControlConstants.PORTAL_INTERNAL_ERROR_CONTROL_KEY, new
LocalizedString("When there is an error within the page"), new
LocalizedString("When there is an error within the page"),
"java.lang.String", PropertyInfo.READ_WRITE_ACCESS_MODE,
PropertyInfo.PRIVATE_SCOPE);
+ public static final PropertyInfo CONTROL_POLICY_PORTAL_NOT_FOUND = new
PropertyInfo(ControlConstants.PORTAL_NOT_FOUND_CONTROL_KEY, new LocalizedString("When
the page is not found"), new LocalizedString("When the page is not found"),
"java.lang.String", PropertyInfo.READ_WRITE_ACCESS_MODE,
PropertyInfo.PRIVATE_SCOPE);
+ public static final PropertyInfo CONTROL_POLICY_PORTAL_RESOURCE_URI = new
PropertyInfo(ControlConstants.PORTAL_RESOURCE_URI_CONTROL_KEY, new
LocalizedString("On error redirect to this resource"), new
LocalizedString("On error redirect to this resource"),
"java.lang.String", PropertyInfo.READ_WRITE_ACCESS_MODE,
PropertyInfo.PRIVATE_SCOPE);
+
+
+ /** . */
+ private static final PropertyInfoSet CONTEXT_PROPERTIES = new PropertyInfoSet();
+
+ /** . */
+ private static final PropertyInfoSet PORTAL_PROPERTIES = new PropertyInfoSet();
+
+ /** . */
+ private static final PropertyInfoSet PAGE_PROPERTIES = new PropertyInfoSet();
+
+ /** . */
+ private static final PropertyInfoSet WINDOW_PROPERTIES = new PropertyInfoSet();
+
+ /** . */
+ private static final PropertyInfoSet CONTROL_PROPERTIES = new PropertyInfoSet();
+
+ /** . */
+ private static final PropertyInfoSet CONTROL_PAGE_PROPERTIES = new PropertyInfoSet();
+
+ /** . */
+ private static final PropertyInfoSet CONTROL_PORTAL_PROPERTIES = new
PropertyInfoSet();
+
+ /** . */
+ private static final PropertyInfoSet ALL_PROPERTIES = new PropertyInfoSet();
+
+ /**
+ * Just avoid to write put(propertyInfo.getName(), propertyInfo).
+ */
+ private static class PropertyInfoSet extends HashMap
+ {
+ public void add(PropertyInfo propertyInfo)
+ {
+ put(propertyInfo.getName(), propertyInfo);
+ }
+ }
+
+ static
+ {
+ CONTEXT_PROPERTIES.add(AJAX_PARTIAL_REFRESH);
+ CONTEXT_PROPERTIES.add(AJAX_DND);
+ CONTEXT_PROPERTIES.add(CONTROL_POLICY_PORTAL_ACCESS_DENIED);
+ CONTEXT_PROPERTIES.add(CONTROL_POLICY_PORTAL_UNAVAILABLE);
+ CONTEXT_PROPERTIES.add(CONTROL_POLICY_PORTAL_ERROR);
+ CONTEXT_PROPERTIES.add(CONTROL_POLICY_PORTAL_INTERNAL_ERROR);
+ CONTEXT_PROPERTIES.add(CONTROL_POLICY_PORTAL_NOT_FOUND);
+ CONTEXT_PROPERTIES.add(CONTROL_POLICY_PORTAL_RESOURCE_URI);
+ CONTEXT_PROPERTIES.add(CONTROL_POLICY_PAGE_ACCESS_DENIED);
+ CONTEXT_PROPERTIES.add(CONTROL_POLICY_PAGE_UNAVAILABLE);
+ CONTEXT_PROPERTIES.add(CONTROL_POLICY_PAGE_ERROR);
+ CONTEXT_PROPERTIES.add(CONTROL_POLICY_PAGE_INTERNAL_ERROR);
+ CONTEXT_PROPERTIES.add(CONTROL_POLICY_PAGE_NOT_FOUND);
+ CONTEXT_PROPERTIES.add(CONTROL_POLICY_PAGE_RESOURCE_URI);
+
+ //
+ PORTAL_PROPERTIES.add(THEME_LAYOUT_ID);
+ PORTAL_PROPERTIES.add(THEME_THEME_ID);
+ PORTAL_PROPERTIES.add(THEME_RENDER_SET_ID);
+ PORTAL_PROPERTIES.add(DEFAULT_CHILD_NAME);
+ PORTAL_PROPERTIES.add(AJAX_PARTIAL_REFRESH);
+ PORTAL_PROPERTIES.add(CONTROL_POLICY_PORTAL_ACCESS_DENIED);
+ PORTAL_PROPERTIES.add(CONTROL_POLICY_PORTAL_UNAVAILABLE);
+ PORTAL_PROPERTIES.add(CONTROL_POLICY_PORTAL_ERROR);
+ PORTAL_PROPERTIES.add(CONTROL_POLICY_PORTAL_INTERNAL_ERROR);
+ PORTAL_PROPERTIES.add(CONTROL_POLICY_PORTAL_NOT_FOUND);
+ PORTAL_PROPERTIES.add(CONTROL_POLICY_PORTAL_RESOURCE_URI);
+ PORTAL_PROPERTIES.add(CONTROL_POLICY_PAGE_ACCESS_DENIED);
+ PORTAL_PROPERTIES.add(CONTROL_POLICY_PAGE_UNAVAILABLE);
+ PORTAL_PROPERTIES.add(CONTROL_POLICY_PAGE_ERROR);
+ PORTAL_PROPERTIES.add(CONTROL_POLICY_PAGE_INTERNAL_ERROR);
+ PORTAL_PROPERTIES.add(CONTROL_POLICY_PAGE_NOT_FOUND);
+ PORTAL_PROPERTIES.add(CONTROL_POLICY_PAGE_RESOURCE_URI);
+
+ //
+ PAGE_PROPERTIES.add(THEME_LAYOUT_ID);
+ PAGE_PROPERTIES.add(THEME_THEME_ID);
+ PAGE_PROPERTIES.add(THEME_RENDER_SET_ID);
+ PAGE_PROPERTIES.add(DEFAULT_CHILD_NAME);
+ PAGE_PROPERTIES.add(PAGE_ORDER);
+ PAGE_PROPERTIES.add(AJAX_PARTIAL_REFRESH);
+ PAGE_PROPERTIES.add(CONTROL_POLICY_PAGE_ACCESS_DENIED);
+ PAGE_PROPERTIES.add(CONTROL_POLICY_PAGE_UNAVAILABLE);
+ PAGE_PROPERTIES.add(CONTROL_POLICY_PAGE_ERROR);
+ PAGE_PROPERTIES.add(CONTROL_POLICY_PAGE_INTERNAL_ERROR);
+ PAGE_PROPERTIES.add(CONTROL_POLICY_PAGE_NOT_FOUND);
+ PAGE_PROPERTIES.add(CONTROL_POLICY_PAGE_RESOURCE_URI);
+ //
+ WINDOW_PROPERTIES.add(AJAX_PARTIAL_REFRESH);
+ WINDOW_PROPERTIES.add(THEME_RENDER_REGION_ID);
+ WINDOW_PROPERTIES.add(THEME_RENDER_REGION_ORDER);
+ WINDOW_PROPERTIES.add(WINDOW_CONTENT_TYPE);
+
+ //
+ CONTROL_PAGE_PROPERTIES.add(CONTROL_POLICY_PAGE_ACCESS_DENIED);
+ CONTROL_PAGE_PROPERTIES.add(CONTROL_POLICY_PAGE_ERROR);
+ CONTROL_PAGE_PROPERTIES.add(CONTROL_POLICY_PAGE_INTERNAL_ERROR);
+ CONTROL_PAGE_PROPERTIES.add(CONTROL_POLICY_PAGE_NOT_FOUND);
+ CONTROL_PAGE_PROPERTIES.add(CONTROL_POLICY_PAGE_UNAVAILABLE);
+ CONTROL_PAGE_PROPERTIES.add(CONTROL_POLICY_PAGE_RESOURCE_URI);
+
+ //
+ CONTROL_PORTAL_PROPERTIES.add(CONTROL_POLICY_PORTAL_ACCESS_DENIED);
+ CONTROL_PORTAL_PROPERTIES.add(CONTROL_POLICY_PORTAL_ERROR);
+ CONTROL_PORTAL_PROPERTIES.add(CONTROL_POLICY_PORTAL_INTERNAL_ERROR);
+ CONTROL_PORTAL_PROPERTIES.add(CONTROL_POLICY_PORTAL_NOT_FOUND);
+ CONTROL_PORTAL_PROPERTIES.add(CONTROL_POLICY_PORTAL_UNAVAILABLE);
+ CONTROL_PORTAL_PROPERTIES.add(CONTROL_POLICY_PORTAL_RESOURCE_URI);
+
+ //
+ CONTROL_PROPERTIES.putAll(CONTROL_PORTAL_PROPERTIES);
+ CONTROL_PROPERTIES.putAll(CONTROL_PAGE_PROPERTIES);
+
+ //
+ ALL_PROPERTIES.putAll(CONTEXT_PROPERTIES);
+ ALL_PROPERTIES.putAll(PORTAL_PROPERTIES);
+ ALL_PROPERTIES.putAll(PAGE_PROPERTIES);
+ ALL_PROPERTIES.putAll(WINDOW_PROPERTIES);
+
+ }
+
+ /** . */
+ private Map entries;
+
+ public PropertiesInfo(PortalObject portalObject)
+ {
+ Map objectProps = null;
+ switch (portalObject.getType())
+ {
+ case PortalObject.TYPE_CONTEXT:
+ objectProps = CONTEXT_PROPERTIES;
+ break;
+ case PortalObject.TYPE_PORTAL:
+ objectProps = PORTAL_PROPERTIES;
+ break;
+ case PortalObject.TYPE_PAGE:
+ objectProps = PAGE_PROPERTIES;
+ break;
+ case PortalObject.TYPE_WINDOW:
+ objectProps = WINDOW_PROPERTIES;
+ break;
+ }
+
+ // Add predefined properties
+ Map entries = new HashMap(objectProps);
+
+ //
+ for (Iterator i = portalObject.getDeclaredProperties().entrySet().iterator();
i.hasNext();)
+ {
+ Map.Entry entry = (Map.Entry)i.next();
+ String name = (String)entry.getKey();
+
+ // Add additional properties
+ if (!ALL_PROPERTIES.containsKey(name))
+ {
+ LocalizedString displayName = new LocalizedString(name);
+ PropertyInfo info = new PropertyInfo(name, displayName, new
LocalizedString("The " + name + " property"),
"java.lang.String", PropertyInfo.READ_WRITE_ACCESS_MODE,
PropertyInfo.PUBLIC_SCOPE);
+ entries.put(name, info);
+ }
+ }
+
+ //
+ this.entries = entries;
+ }
+
+ public Set getNames()
+ {
+ return entries.keySet();
+ }
+
+ public PropertyInfo getPropertyInfo(String name)
+ {
+ return (PropertyInfo)entries.get(name);
+ }
+
+ public static boolean isControlProperty(String name)
+ {
+ return CONTROL_PROPERTIES.containsKey(name);
+ }
+
+ public static PropertyInfo getControlPropertyInfo(String name)
+ {
+ return (PropertyInfo)CONTROL_PROPERTIES.get(name);
+ }
+
+}
Copied: trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/PropertyBean.java (from
rev 7842, trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/PropertyBean.java)
===================================================================
--- trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/PropertyBean.java
(rev 0)
+++ trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/PropertyBean.java 2007-08-06
09:16:45 UTC (rev 7865)
@@ -0,0 +1,143 @@
+/******************************************************************************
+ * 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;
+
+import org.jboss.portal.core.model.portal.PortalObject;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @author <a href="mailto:theute@jboss.org">Thomas Heute</a>
+ * @author <a href="mailto:boleslaw dot dawidowicz at redhat anotherdot
com">Boleslaw Dawidowicz</a>
+ * @version $Revision: 1.1 $
+ */
+public class PropertyBean implements Comparable
+{
+
+ /** . */
+ protected String value;
+
+ /** . */
+ private final PropertyBeanContainer container;
+
+ /** . */
+ protected final PropertyInfo info;
+
+ /** . */
+ protected boolean inherited;
+
+ /** . */
+ protected boolean inheritable;
+
+ public PropertyBean(PropertyBeanContainer container, PropertyInfo info, boolean
inherited, boolean inheritable, String value)
+ {
+ this.container = container;
+ this.info = info;
+ this.inherited = inherited;
+ this.inheritable = inheritable;
+ this.value = value;
+ }
+
+ public boolean isInheritable()
+ {
+ return inheritable;
+ }
+
+ public String getName()
+ {
+ return info.getName();
+ }
+
+ public boolean isReadOnly()
+ {
+ return info.getAccessMode() == PropertyInfo.READ_ONLY_ACCESS_MODE;
+ }
+
+ public String getDescription()
+ {
+ return info.getDescription().getDefaultString();
+ }
+
+ public String getDisplayName()
+ {
+ return info.getDisplayName().getDefaultString();
+ }
+
+ public boolean isInherited()
+ {
+ return inherited;
+ }
+
+ public Object getValue()
+ {
+ if (info.getType().equals("java.lang.Boolean"))
+ {
+ return Boolean.valueOf(value);
+ }
+ else
+ {
+ return value;
+ }
+ }
+
+ public void setValue(Object value)
+ {
+ this.value = value.toString();
+
+ // Need to use the container as it will contain the refreshed object
+ PortalObject portalObject = container.getRelatedObject();
+
+ //if value is inherited check if updated value is the same - if yes, don't
update to keep inheritance
+ if (isInherited())
+ {
+ String parentValue = portalObject.getProperty(getName());
+ if (value.equals(parentValue))
+ {
+ return;
+ }
+ }
+
+ //
+ portalObject.setDeclaredProperty(getName(), value.toString());
+ }
+
+ public int compareTo(Object o)
+ {
+ PropertyBean that = (PropertyBean)o;
+ return info.getName().compareTo(that.getName());
+ }
+
+ public String getType()
+ {
+ return info.getType();
+ }
+
+ public boolean isControlProperty()
+ {
+ return PropertiesInfo.isControlProperty(info.getName());
+ }
+
+ public String toString()
+ {
+ return "PropertyBean[name=" + info.getName() + ",value=" +
value + "]";
+ }
+}
Copied:
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/PropertyBeanContainer.java (from
rev 7842,
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/PropertyBeanContainer.java)
===================================================================
--- trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/PropertyBeanContainer.java
(rev 0)
+++
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/PropertyBeanContainer.java 2007-08-06
09:16:45 UTC (rev 7865)
@@ -0,0 +1,36 @@
+/******************************************************************************
+ * 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;
+
+import org.jboss.portal.core.model.portal.PortalObject;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public abstract class PropertyBeanContainer
+{
+
+ public abstract PortalObject getRelatedObject();
+
+}
Copied: trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/PropertyInfo.java (from
rev 7842, trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/PropertyInfo.java)
===================================================================
--- trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/PropertyInfo.java
(rev 0)
+++ trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/PropertyInfo.java 2007-08-06
09:16:45 UTC (rev 7865)
@@ -0,0 +1,111 @@
+/******************************************************************************
+ * 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;
+
+import org.jboss.portal.common.i18n.LocalizedString;
+
+/**
+ * @author <a href="mailto:theute@jboss.org">Thomas Heute</a>
+ * @version $Revision: 1.1 $
+ */
+public class PropertyInfo
+{
+
+ /** . */
+ public static final int PUBLIC_SCOPE = 0;
+
+ /** . */
+ public static final int PRIVATE_SCOPE = 1;
+
+ /** . */
+ public static final int EXPERIMENTAL_SCOPE = 2;
+
+ /** . */
+ public static final int READ_ONLY_ACCESS_MODE = 0;
+
+ /** . */
+ public static final int READ_WRITE_ACCESS_MODE = 1;
+
+ /** . */
+ private final String name;
+
+ /** . */
+ private final int accessMode;
+
+ /** . */
+ private final String type;
+
+ /** . */
+ private final LocalizedString displayName;
+
+ /** . */
+ private final LocalizedString description;
+
+ /** . */
+ private final int scope;
+
+ public PropertyInfo(String name, LocalizedString displayName, LocalizedString
description, String type, int accessMode, int scope)
+ {
+ this.name = name;
+ this.accessMode = accessMode;
+ this.displayName = displayName;
+ this.description = description;
+ this.type = type;
+ this.scope = scope;
+ }
+
+ public LocalizedString getDisplayName()
+ {
+ return displayName;
+ }
+
+ public LocalizedString getDescription()
+ {
+ return description;
+ }
+
+ public String getName()
+ {
+ return name;
+ }
+
+ public int getAccessMode()
+ {
+ return accessMode;
+ }
+
+ public String getType()
+ {
+ return type;
+ }
+
+ public int getScope()
+ {
+ return scope;
+ }
+
+ public String toString()
+ {
+ return "PropertyInfo[" + name + "]";
+ }
+}
Copied: trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/Refresher.java (from rev
7842, trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/Refresher.java)
===================================================================
--- trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/Refresher.java
(rev 0)
+++ trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/Refresher.java 2007-08-06
09:16:45 UTC (rev 7865)
@@ -0,0 +1,104 @@
+/******************************************************************************
+ * 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;
+
+import org.jboss.portal.core.admin.ui.dashboard.DashboardBean;
+
+import javax.faces.context.FacesContext;
+import javax.faces.event.PhaseEvent;
+import javax.faces.event.PhaseId;
+import javax.faces.event.PhaseListener;
+
+/**
+ * Refresh the beans before JSF performs the render.
+ *
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 5448 $
+ */
+public class Refresher implements PhaseListener
+{
+
+ /** The serialVersionUID */
+ private static final long serialVersionUID = -5027591744094332498L;
+
+ public void afterPhase(PhaseEvent phaseEvent)
+ {
+ }
+
+ public void beforePhase(PhaseEvent phaseEvent)
+ {
+ if (phaseEvent.getPhaseId() == PhaseId.RESTORE_VIEW)
+ {
+ FacesContext ctx = phaseEvent.getFacesContext();
+
+ //
+ PortalObjectManagerBean pomgr =
(PortalObjectManagerBean)ctx.getApplication().createValueBinding("#{portalobjectmgr}").getValue(ctx);
+ pomgr.refresh();
+
+ //
+ PortalObjectManagerBean dashboardmgr =
(PortalObjectManagerBean)ctx.getApplication().createValueBinding("#{dashboardmgr}").getValue(ctx);
+ dashboardmgr.refresh();
+
+ //
+ InstanceManagerBean instancemgr =
(InstanceManagerBean)ctx.getApplication().createValueBinding("#{instancemgr}").getValue(ctx);
+ instancemgr.refresh();
+
+ //
+ PortletManagerBean portletmgr =
(PortletManagerBean)ctx.getApplication().createValueBinding("#{portletmgr}").getValue(ctx);
+ portletmgr.refresh();
+
+ //
+ DashboardBean dashboard =
(DashboardBean)ctx.getApplication().createValueBinding("#{dashboard}").getValue(ctx);
+ dashboard.actionRefresh();
+ }
+ else if (phaseEvent.getPhaseId() == PhaseId.RENDER_RESPONSE)
+ {
+ FacesContext ctx = phaseEvent.getFacesContext();
+
+ //
+ PortalObjectManagerBean pomgr =
(PortalObjectManagerBean)ctx.getApplication().createValueBinding("#{portalobjectmgr}").getValue(ctx);
+ pomgr.refresh();
+
+ //
+ PortalObjectManagerBean dashboardmgr =
(PortalObjectManagerBean)ctx.getApplication().createValueBinding("#{dashboardmgr}").getValue(ctx);
+ dashboardmgr.refresh();
+
+ //
+ InstanceManagerBean instancemgr =
(InstanceManagerBean)ctx.getApplication().createValueBinding("#{instancemgr}").getValue(ctx);
+ instancemgr.refresh();
+
+ //
+ PortletManagerBean portletmgr =
(PortletManagerBean)ctx.getApplication().createValueBinding("#{portletmgr}").getValue(ctx);
+ portletmgr.refresh();
+
+ //
+ DashboardBean dashboard =
(DashboardBean)ctx.getApplication().createValueBinding("#{dashboard}").getValue(ctx);
+ dashboard.renderRefresh();
+ }
+ }
+
+ public PhaseId getPhaseId()
+ {
+ return PhaseId.ANY_PHASE;
+ }
+}
\ No newline at end of file
Property changes on:
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/Refresher.java
___________________________________________________________________
Name: svn:executable
+ *
Copied: trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/ThemeBean.java (from rev
7842, trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/ThemeBean.java)
===================================================================
--- trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/ThemeBean.java
(rev 0)
+++ trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/ThemeBean.java 2007-08-06
09:16:45 UTC (rev 7865)
@@ -0,0 +1,192 @@
+/******************************************************************************
+ * 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;
+
+import javax.faces.application.FacesMessage;
+import javax.faces.context.FacesContext;
+import javax.faces.event.ActionEvent;
+import javax.faces.event.AbortProcessingException;
+
+import org.jboss.portal.core.model.portal.PortalObject;
+import org.jboss.portal.theme.ThemeConstants;
+
+/**
+ * @author <a href="mailto:mholzner@novell.com">Martin Holzner</a>
+ * @version $Revision: 5448 $
+ */
+public class ThemeBean
+{
+
+ /** . */
+ private final PortalObject portalObject;
+
+ /** . */
+ private String layoutName;
+
+ /** . */
+ private String themeName;
+
+ /** . */
+ private String renderSetName;
+
+ /** . */
+ private String windowRendererName;
+
+ /** . */
+ private String decorationRendererName;
+
+ /** . */
+ private String portletRendererName;
+
+
+ public ThemeBean(PortalObject portalObject)
+ {
+ this.portalObject = portalObject;
+ this.layoutName =
portalObject.getDeclaredProperty(ThemeConstants.PORTAL_PROP_LAYOUT);
+ this.themeName =
portalObject.getDeclaredProperty(ThemeConstants.PORTAL_PROP_THEME);
+ this.renderSetName =
portalObject.getDeclaredProperty(ThemeConstants.PORTAL_PROP_RENDERSET);
+ this.windowRendererName =
portalObject.getDeclaredProperty(ThemeConstants.PORTAL_PROP_WINDOW_RENDERER);
+ this.decorationRendererName =
portalObject.getDeclaredProperty(ThemeConstants.PORTAL_PROP_DECORATION_RENDERER);
+ this.portletRendererName =
portalObject.getDeclaredProperty(ThemeConstants.PORTAL_PROP_PORTLET_RENDERER);
+ }
+
+ public PortalObject getPortalObject()
+ {
+ return portalObject;
+ }
+
+ public String getLayoutName()
+ {
+ return layoutName;
+ }
+
+ public void setLayoutName(String layoutName)
+ {
+ this.layoutName = "".equals(layoutName) ? null : layoutName;
+ }
+
+ public String getThemeName()
+ {
+ return themeName;
+ }
+
+ public void setThemeName(String themeName)
+ {
+ this.themeName = "".equals(themeName) ? null : themeName;
+ }
+
+ public String getRenderSetName()
+ {
+ return renderSetName;
+ }
+
+ public void setRenderSetName(String renderSetName)
+ {
+ this.renderSetName = "".equals(renderSetName) ? null : renderSetName;
+ }
+
+ public String getWindowRendererName()
+ {
+ return windowRendererName;
+ }
+
+ public void setWindowRendererName(String windowRendererName)
+ {
+ this.windowRendererName = "".equals(windowRendererName) ? null :
windowRendererName;
+ }
+
+ public String getDecorationRendererName()
+ {
+ return decorationRendererName;
+ }
+
+ public void setDecorationRendererName(String decorationRendererName)
+ {
+ this.decorationRendererName = "".equals(decorationRendererName) ? null :
decorationRendererName;
+ }
+
+ public String getPortletRendererName()
+ {
+ return portletRendererName;
+ }
+
+ public void setPortletRendererName(String portletRendererName)
+ {
+ this.portletRendererName = "".equals(portletRendererName) ? null :
portletRendererName;
+ }
+
+ public void execute(ActionEvent actionEvent) throws AbortProcessingException
+ {
+ boolean successful = true;
+
+ //
+ switch(portalObject.getType())
+ {
+ case PortalObject.TYPE_CONTEXT:
+ case PortalObject.TYPE_PORTAL:
+ case PortalObject.TYPE_PAGE:
+ portalObject.setDeclaredProperty(ThemeConstants.PORTAL_PROP_LAYOUT,
this.layoutName);
+ portalObject.setDeclaredProperty(ThemeConstants.PORTAL_PROP_THEME,
this.themeName);
+ portalObject.setDeclaredProperty(ThemeConstants.PORTAL_PROP_RENDERSET,
this.renderSetName);
+ break;
+ case PortalObject.TYPE_WINDOW:
+ portalObject.setDeclaredProperty(ThemeConstants.PORTAL_PROP_WINDOW_RENDERER,
this.windowRendererName);
+
portalObject.setDeclaredProperty(ThemeConstants.PORTAL_PROP_DECORATION_RENDERER,
this.decorationRendererName);
+ portalObject.setDeclaredProperty(ThemeConstants.PORTAL_PROP_PORTLET_RENDERER,
this.portletRendererName);
+ break;
+ default:
+ successful = false;
+ }
+
+ //
+ if (successful)
+ {
+ String stringMessage = null;
+ switch(this.portalObject.getType())
+ {
+ case PortalObject.TYPE_PORTAL:
+ stringMessage = "Theme has been correctly updated on the portal
named: " + portalObject.getName();
+ break;
+ case PortalObject.TYPE_PAGE:
+ stringMessage = "Theme has been correctly updated on the page named:
" + portalObject.getName();
+ break;
+ case PortalObject.TYPE_WINDOW:
+ stringMessage = "Theme has been correctly updated on the window
named: " + portalObject.getName();
+ break;
+ }
+
+ //
+ if (stringMessage != null)
+ {
+ FacesMessage message = new FacesMessage(FacesMessage.SEVERITY_INFO,
stringMessage, stringMessage);
+ FacesContext.getCurrentInstance().addMessage("status", message);
+ }
+ }
+ else
+ {
+ String stringMessage = "Unknown object type, please file a Jira issue:
http://jira.jboss.org";
+ FacesMessage message = new FacesMessage(FacesMessage.SEVERITY_ERROR,
stringMessage, stringMessage);
+ FacesContext.getCurrentInstance().addMessage("error", message);
+ }
+ }
+}
Property changes on:
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/ThemeBean.java
___________________________________________________________________
Name: svn:executable
+ *
Copied: trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/actions (from rev 7842,
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/actions)
Deleted:
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/actions/AddPageAction.java
===================================================================
---
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/actions/AddPageAction.java 2007-07-30
12:59:36 UTC (rev 7842)
+++
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/actions/AddPageAction.java 2007-08-06
09:16:45 UTC (rev 7865)
@@ -1,151 +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.logging.Logger;
-import org.jboss.portal.core.model.portal.Page;
-import org.jboss.portal.core.model.portal.PageContainer;
-
-import javax.faces.application.FacesMessage;
-import javax.faces.context.FacesContext;
-
-/**
- * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 5763 $
- */
-public class AddPageAction
-{
-
- /** . */
- private static final Logger log = Logger.getLogger(AddPageAction.class);
-
- /** . */
- 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!";
-
- /** . */
- private static final String ERROR_NO_NAME = "Page name not specified!";
-
- /** . */
- private static final String ERROR_INTERNAL_ERROR = "An internal error
happened!";
-
- /** The page container that will create the child. */
- public PageContainer pageContainer;
-
- /** The page name to create. */
- public String pageName;
-
- /** An optional listener. */
- public Listener listener;
-
- /** The message id when an error happens. */
- public String messageTarget;
-
- public void execute()
- {
- FacesMessage message = null;
-
- //
- if (pageName == null)
- {
- message = new FacesMessage(FacesMessage.SEVERITY_ERROR, ERROR_NO_NAME,
ERROR_NO_NAME);
- }
- else
- {
- pageName = pageName.trim();
-
- //
- if (pageName.length() == 0)
- {
- message = new FacesMessage(FacesMessage.SEVERITY_ERROR, ERROR_EMPTY_NAME,
ERROR_EMPTY_NAME);
- }
- else if (pageContainer.getChild(pageName) != null)
- {
- message = new FacesMessage(FacesMessage.SEVERITY_ERROR, ERROR_DUPE_NAME,
ERROR_DUPE_NAME);
- }
- }
-
- //
- if (message == null)
- {
- try
- {
- Page page = pageContainer.createPage(pageName);
-
- //
- if (listener != null)
- {
- listener.pageCreated(page);
- }
- }
- catch (Exception e)
- {
- log.error("An error happened during page creation", e);
- message = new FacesMessage(FacesMessage.SEVERITY_ERROR, ERROR_INTERNAL_ERROR,
ERROR_INTERNAL_ERROR);
- }
- }
-
- //
- if (message != null && messageTarget != null)
- {
- FacesContext.getCurrentInstance().addMessage(messageTarget, message);
- }
- }
-
- public interface Listener
- {
- void pageCreated(Page page);
- }
-
- public PageContainer getPageContainer()
- {
- return pageContainer;
- }
-
- public void setPageContainer(PageContainer pageContainer)
- {
- this.pageContainer = pageContainer;
- }
-
- public String getMessageTarget()
- {
- return messageTarget;
- }
-
- public void setMessageTarget(String messageTarget)
- {
- this.messageTarget = messageTarget;
- }
-
- public Listener getListener()
- {
- return listener;
- }
-
- public void setListener(Listener listener)
- {
- this.listener = listener;
- }
-}
Copied:
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/actions/AddPageAction.java (from
rev 7842,
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/actions/AddPageAction.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-08-06
09:16:45 UTC (rev 7865)
@@ -0,0 +1,151 @@
+/******************************************************************************
+ * 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.logging.Logger;
+import org.jboss.portal.core.model.portal.Page;
+import org.jboss.portal.core.model.portal.PageContainer;
+
+import javax.faces.application.FacesMessage;
+import javax.faces.context.FacesContext;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 5763 $
+ */
+public class AddPageAction
+{
+
+ /** . */
+ private static final Logger log = Logger.getLogger(AddPageAction.class);
+
+ /** . */
+ 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!";
+
+ /** . */
+ private static final String ERROR_NO_NAME = "Page name not specified!";
+
+ /** . */
+ private static final String ERROR_INTERNAL_ERROR = "An internal error
happened!";
+
+ /** The page container that will create the child. */
+ public PageContainer pageContainer;
+
+ /** The page name to create. */
+ public String pageName;
+
+ /** An optional listener. */
+ public Listener listener;
+
+ /** The message id when an error happens. */
+ public String messageTarget;
+
+ public void execute()
+ {
+ FacesMessage message = null;
+
+ //
+ if (pageName == null)
+ {
+ message = new FacesMessage(FacesMessage.SEVERITY_ERROR, ERROR_NO_NAME,
ERROR_NO_NAME);
+ }
+ else
+ {
+ pageName = pageName.trim();
+
+ //
+ if (pageName.length() == 0)
+ {
+ message = new FacesMessage(FacesMessage.SEVERITY_ERROR, ERROR_EMPTY_NAME,
ERROR_EMPTY_NAME);
+ }
+ else if (pageContainer.getChild(pageName) != null)
+ {
+ message = new FacesMessage(FacesMessage.SEVERITY_ERROR, ERROR_DUPE_NAME,
ERROR_DUPE_NAME);
+ }
+ }
+
+ //
+ if (message == null)
+ {
+ try
+ {
+ Page page = pageContainer.createPage(pageName);
+
+ //
+ if (listener != null)
+ {
+ listener.pageCreated(page);
+ }
+ }
+ catch (Exception e)
+ {
+ log.error("An error happened during page creation", e);
+ message = new FacesMessage(FacesMessage.SEVERITY_ERROR, ERROR_INTERNAL_ERROR,
ERROR_INTERNAL_ERROR);
+ }
+ }
+
+ //
+ if (message != null && messageTarget != null)
+ {
+ FacesContext.getCurrentInstance().addMessage(messageTarget, message);
+ }
+ }
+
+ public interface Listener
+ {
+ void pageCreated(Page page);
+ }
+
+ public PageContainer getPageContainer()
+ {
+ return pageContainer;
+ }
+
+ public void setPageContainer(PageContainer pageContainer)
+ {
+ this.pageContainer = pageContainer;
+ }
+
+ public String getMessageTarget()
+ {
+ return messageTarget;
+ }
+
+ public void setMessageTarget(String messageTarget)
+ {
+ this.messageTarget = messageTarget;
+ }
+
+ public Listener getListener()
+ {
+ return listener;
+ }
+
+ public void setListener(Listener listener)
+ {
+ this.listener = listener;
+ }
+}
Deleted:
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/actions/AssignContentToWindowAction.java
===================================================================
---
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/actions/AssignContentToWindowAction.java 2007-07-30
12:59:36 UTC (rev 7842)
+++
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/actions/AssignContentToWindowAction.java 2007-08-06
09:16:45 UTC (rev 7865)
@@ -1,54 +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.admin.ui.PortalObjectManagerBean;
-import org.jboss.portal.core.model.portal.Window;
-
-/**
- * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 1.1 $
- */
-public class AssignContentToWindowAction
-{
-
- /** . */
- private PortalObjectManagerBean portalObjectManager;
-
- public PortalObjectManagerBean getPortalObjectManager()
- {
- return portalObjectManager;
- }
-
- public void setPortalObjectManager(PortalObjectManagerBean portalObjectManager)
- {
- this.portalObjectManager = portalObjectManager;
- }
-
- public void execute()
- {
- Window window = (Window)portalObjectManager.getSelectedObject();
- String contentURI = portalObjectManager.getSelectedContentURI();
- window.getContent().setURI(contentURI);
- }
-}
Copied:
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/actions/AssignContentToWindowAction.java
(from rev 7842,
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/actions/AssignContentToWindowAction.java)
===================================================================
---
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/actions/AssignContentToWindowAction.java
(rev 0)
+++
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/actions/AssignContentToWindowAction.java 2007-08-06
09:16:45 UTC (rev 7865)
@@ -0,0 +1,54 @@
+/******************************************************************************
+ * 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.admin.ui.PortalObjectManagerBean;
+import org.jboss.portal.core.model.portal.Window;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class AssignContentToWindowAction
+{
+
+ /** . */
+ private PortalObjectManagerBean portalObjectManager;
+
+ public PortalObjectManagerBean getPortalObjectManager()
+ {
+ return portalObjectManager;
+ }
+
+ public void setPortalObjectManager(PortalObjectManagerBean portalObjectManager)
+ {
+ this.portalObjectManager = portalObjectManager;
+ }
+
+ public void execute()
+ {
+ Window window = (Window)portalObjectManager.getSelectedObject();
+ String contentURI = portalObjectManager.getSelectedContentURI();
+ window.getContent().setURI(contentURI);
+ }
+}
Deleted:
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/actions/CreateInstanceAction.java
===================================================================
---
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/actions/CreateInstanceAction.java 2007-07-30
12:59:36 UTC (rev 7842)
+++
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/actions/CreateInstanceAction.java 2007-08-06
09:16:45 UTC (rev 7865)
@@ -1,160 +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.instance.Instance;
-import org.jboss.portal.core.model.instance.InstanceContainer;
-import org.jboss.portal.core.admin.ui.InstanceManagerBean;
-import org.jboss.portal.core.admin.ui.PortletManagerBean;
-import org.jboss.portal.portlet.Portlet;
-import org.jboss.portal.security.RoleSecurityBinding;
-import org.jboss.portal.security.SecurityConstants;
-import org.jboss.portal.security.spi.provider.DomainConfigurator;
-
-import javax.faces.application.FacesMessage;
-import javax.faces.context.FacesContext;
-import java.util.Collections;
-import java.util.Set;
-
-/**
- * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 5915 $
- */
-public class CreateInstanceAction
-{
-
- /** . */
- private String instanceId;
-
- /** . */
- private PortletManagerBean portletMgr;
-
- /** . */
- private InstanceManagerBean instanceMgr;
-
- public String getInstanceId()
- {
- return instanceId;
- }
-
- public void setInstanceId(String instanceId)
- {
- this.instanceId = instanceId;
- }
-
- public PortletManagerBean getPortletManager()
- {
- return portletMgr;
- }
-
- public void setPortletManager(PortletManagerBean portletManager)
- {
- this.portletMgr = portletManager;
- }
-
- public InstanceManagerBean getInstanceManager()
- {
- return instanceMgr;
- }
-
- public void setInstanceManager(InstanceManagerBean instanceManager)
- {
- this.instanceMgr = instanceManager;
- }
-
- public String execute()
- {
- FacesContext faces = FacesContext.getCurrentInstance();
-
- // Validate instance id
- if (instanceId == null)
- {
- FacesMessage message = new FacesMessage(FacesMessage.SEVERITY_ERROR, "No
instance id!", null);
- faces.addMessage("add_instance_form:instanceId", message);
- }
- else
- {
- // Trim name
- instanceId = instanceId.trim();
-
- // Check for empty string
- if (instanceId.length() == 0)
- {
- FacesMessage message = new FacesMessage(FacesMessage.SEVERITY_ERROR,
"Instance id cannot be blank!", null);
- faces.addMessage("add_instance_form:instanceId", message);
- }
- else
- {
- // Check for duplicate instance
- Instance instance =
instanceMgr.getInstanceContainer().getDefinition(instanceId);
- if (instance != null)
- {
- FacesMessage message = new FacesMessage(FacesMessage.SEVERITY_ERROR,
"An instance with the id " + instanceId + " already exist!", null);
- faces.addMessage("add_instance_form:instanceId", message);
- }
- }
- }
-
- //
- if (faces.getMessages().hasNext())
- {
- return null;
- }
-
- //
- Portlet portlet = portletMgr.getSelectedPortlet();
- if (portlet == null)
- {
- FacesMessage message = new FacesMessage(FacesMessage.SEVERITY_ERROR, "No
portlet was selected!", null);
- faces.addMessage("add_instance_form:instanceId", message);
- return null;
- }
- else
- {
- InstanceContainer container = instanceMgr.getInstanceContainer();
- try
- {
- Instance instance = container.createDefinition(instanceId,
portlet.getContext().getId());
- instanceMgr.setSelectedId(instanceId);
-
- //
- DomainConfigurator configurator = instanceMgr.getDomainConfigurator();
- Set constraints = Collections.singleton(new
RoleSecurityBinding("view", SecurityConstants.UNCHECKED_ROLE_NAME));
- configurator.setSecurityBindings(instance.getId(), constraints);
-
- // Configure the instance manager with the instance already looked up
- instanceMgr.setSelectedId(instanceId);
- instanceMgr.setSelectedPlugin("info");
-
- //
- return "instances";
- }
- catch (Exception e)
- {
- FacesMessage message = new FacesMessage(FacesMessage.SEVERITY_ERROR, "An
unexpected error happened!", null);
- faces.addMessage("add_instance_form:instanceId", message);
- return null;
- }
- }
- }
-}
Copied:
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/actions/CreateInstanceAction.java
(from rev 7842,
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/actions/CreateInstanceAction.java)
===================================================================
---
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/actions/CreateInstanceAction.java
(rev 0)
+++
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/actions/CreateInstanceAction.java 2007-08-06
09:16:45 UTC (rev 7865)
@@ -0,0 +1,160 @@
+/******************************************************************************
+ * 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.instance.Instance;
+import org.jboss.portal.core.model.instance.InstanceContainer;
+import org.jboss.portal.core.admin.ui.InstanceManagerBean;
+import org.jboss.portal.core.admin.ui.PortletManagerBean;
+import org.jboss.portal.portlet.Portlet;
+import org.jboss.portal.security.RoleSecurityBinding;
+import org.jboss.portal.security.SecurityConstants;
+import org.jboss.portal.security.spi.provider.DomainConfigurator;
+
+import javax.faces.application.FacesMessage;
+import javax.faces.context.FacesContext;
+import java.util.Collections;
+import java.util.Set;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 5915 $
+ */
+public class CreateInstanceAction
+{
+
+ /** . */
+ private String instanceId;
+
+ /** . */
+ private PortletManagerBean portletMgr;
+
+ /** . */
+ private InstanceManagerBean instanceMgr;
+
+ public String getInstanceId()
+ {
+ return instanceId;
+ }
+
+ public void setInstanceId(String instanceId)
+ {
+ this.instanceId = instanceId;
+ }
+
+ public PortletManagerBean getPortletManager()
+ {
+ return portletMgr;
+ }
+
+ public void setPortletManager(PortletManagerBean portletManager)
+ {
+ this.portletMgr = portletManager;
+ }
+
+ public InstanceManagerBean getInstanceManager()
+ {
+ return instanceMgr;
+ }
+
+ public void setInstanceManager(InstanceManagerBean instanceManager)
+ {
+ this.instanceMgr = instanceManager;
+ }
+
+ public String execute()
+ {
+ FacesContext faces = FacesContext.getCurrentInstance();
+
+ // Validate instance id
+ if (instanceId == null)
+ {
+ FacesMessage message = new FacesMessage(FacesMessage.SEVERITY_ERROR, "No
instance id!", null);
+ faces.addMessage("add_instance_form:instanceId", message);
+ }
+ else
+ {
+ // Trim name
+ instanceId = instanceId.trim();
+
+ // Check for empty string
+ if (instanceId.length() == 0)
+ {
+ FacesMessage message = new FacesMessage(FacesMessage.SEVERITY_ERROR,
"Instance id cannot be blank!", null);
+ faces.addMessage("add_instance_form:instanceId", message);
+ }
+ else
+ {
+ // Check for duplicate instance
+ Instance instance =
instanceMgr.getInstanceContainer().getDefinition(instanceId);
+ if (instance != null)
+ {
+ FacesMessage message = new FacesMessage(FacesMessage.SEVERITY_ERROR,
"An instance with the id " + instanceId + " already exist!", null);
+ faces.addMessage("add_instance_form:instanceId", message);
+ }
+ }
+ }
+
+ //
+ if (faces.getMessages().hasNext())
+ {
+ return null;
+ }
+
+ //
+ Portlet portlet = portletMgr.getSelectedPortlet();
+ if (portlet == null)
+ {
+ FacesMessage message = new FacesMessage(FacesMessage.SEVERITY_ERROR, "No
portlet was selected!", null);
+ faces.addMessage("add_instance_form:instanceId", message);
+ return null;
+ }
+ else
+ {
+ InstanceContainer container = instanceMgr.getInstanceContainer();
+ try
+ {
+ Instance instance = container.createDefinition(instanceId,
portlet.getContext().getId());
+ instanceMgr.setSelectedId(instanceId);
+
+ //
+ DomainConfigurator configurator = instanceMgr.getDomainConfigurator();
+ Set constraints = Collections.singleton(new
RoleSecurityBinding("view", SecurityConstants.UNCHECKED_ROLE_NAME));
+ configurator.setSecurityBindings(instance.getId(), constraints);
+
+ // Configure the instance manager with the instance already looked up
+ instanceMgr.setSelectedId(instanceId);
+ instanceMgr.setSelectedPlugin("info");
+
+ //
+ return "instances";
+ }
+ catch (Exception e)
+ {
+ FacesMessage message = new FacesMessage(FacesMessage.SEVERITY_ERROR, "An
unexpected error happened!", null);
+ faces.addMessage("add_instance_form:instanceId", message);
+ return null;
+ }
+ }
+ }
+}
Property changes on:
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/actions/CreateInstanceAction.java
___________________________________________________________________
Name: svn:executable
+ *
Deleted:
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/actions/PortalAction.java
===================================================================
---
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/actions/PortalAction.java 2007-07-30
12:59:36 UTC (rev 7842)
+++
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/actions/PortalAction.java 2007-08-06
09:16:45 UTC (rev 7865)
@@ -1,179 +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.Mode;
-import org.jboss.portal.WindowState;
-import org.jboss.portal.core.model.portal.PortalContainer;
-import org.jboss.portal.core.model.portal.Page;
-import org.jboss.portal.core.model.portal.Portal;
-import org.jboss.portal.core.model.portal.PortalObject;
-import org.jboss.portal.core.model.portal.PortalObjectPermission;
-import org.jboss.portal.core.model.portal.PortalObjectPath;
-import org.jboss.portal.core.admin.ui.PortalObjectManagerBean;
-import org.jboss.portal.security.RoleSecurityBinding;
-import org.jboss.portal.security.SecurityConstants;
-import org.jboss.portal.security.spi.provider.DomainConfigurator;
-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;
-import java.util.Collections;
-import java.util.HashSet;
-import java.util.Set;
-
-/**
- * @author <a href="mailto:boleslaw dot dawidowicz at jboss.org">Boleslaw
Dawidowicz</a>
- * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 5763 $
- */
-public class PortalAction
-{
-
- /** . */
- private PortalObjectManagerBean pomgr;
-
- /** . */
- private String portalName;
-
- //private String defaultPageName;
-
- /** . */
- private static final String ERROR_DUPE_NAME = "Duplicate Portal name found on
this portal!";
-
- /** . */
- private static final String ERROR_EMPTY_NAME = "Portal name cannot be
blank!";
-
- public PortalObjectManagerBean getPortalObjectManager()
- {
- return pomgr;
- }
-
- public void setPortalObjectManager(PortalObjectManagerBean portalObjectManager)
- {
- this.pomgr = portalObjectManager;
- }
-
- public String getPortalName()
- {
- return portalName;
- }
-
- public void setPortalName(String portalName)
- {
- this.portalName = portalName;
- }
-
- public String getDefaultPageName()
- {
- return
pomgr.getSelectedObject().getDeclaredProperty(PortalObject.PORTAL_PROP_DEFAULT_OBJECT_NAME);
- }
-
- public void setDefaultPageName(String defaultPageName)
- {
- if (defaultPageName != null && !defaultPageName.equals(""))
- {
-
pomgr.getSelectedObject().setDeclaredProperty(PortalObject.PORTAL_PROP_DEFAULT_OBJECT_NAME,
defaultPageName);
- }
- else if (defaultPageName == null || defaultPageName.equals(""))
- {
-
pomgr.getSelectedObject().setDeclaredProperty(PortalObject.PORTAL_PROP_DEFAULT_OBJECT_NAME,
null);
- }
-
- }
-
-
- /**
- * Checks for duplicate portal names on the portal instance. Blank page names are not
allowed and are controlled by
- * the required attribute in the presentation page.
- *
- * @param context
- * @param toValidate
- * @param value
- */
- public void validatePortalName(FacesContext context, UIComponent toValidate, Object
value)
- {
- String portalName = (String)value;
-
- // check for empty string
- if (portalName.startsWith(" "))
- {
- FacesMessage message = new FacesMessage(FacesMessage.SEVERITY_ERROR,
PortalAction.ERROR_EMPTY_NAME, PortalAction.ERROR_EMPTY_NAME);
- throw new ValidatorException(message);
- }
-
- // Check for duplicate child name
- if (pomgr.getSelectedObject().getChild(portalName) != null)
- {
- FacesMessage message = new FacesMessage(FacesMessage.SEVERITY_ERROR,
PortalAction.ERROR_DUPE_NAME, PortalAction.ERROR_DUPE_NAME);
- throw new ValidatorException(message);
- }
- }
-
- public void addPortal()
- {
- try
- {
- PortalContainer portalContainer = (PortalContainer)pomgr.getSelectedObject();
- Portal portal = portalContainer.createPortal(portalName);
- DomainConfigurator configurator = pomgr.getDomainConfigurator();
-
- // Initial portal permissions
- Set actions = new HashSet();
- actions.add(PortalObjectPermission.VIEW_RECURSIVE_ACTION);
- actions.add(PortalObjectPermission.PERSONALIZE_RECURSIVE_ACTION);
- RoleSecurityBinding binding = new RoleSecurityBinding(actions,
SecurityConstants.UNCHECKED_ROLE_NAME);
- Set constraints = Collections.singleton(binding);
-
configurator.setSecurityBindings(portal.getId().toString(PortalObjectPath.CANONICAL_FORMAT),
constraints);
-
- // We need to add initial layout sets to avoid problems...
- portal.setDeclaredProperty(ThemeConstants.PORTAL_PROP_LAYOUT,
"generic");
- // portal.setDeclaredProperty(ThemeConstants.PORTAL_PROP_THEME,
"Nphalanx");
- portal.setDeclaredProperty(ThemeConstants.PORTAL_PROP_RENDERSET,
"divRenderer");
-
- //
- portal.getSupportedWindowStates().add(WindowState.MAXIMIZED);
- portal.getSupportedWindowStates().add(WindowState.MINIMIZED);
- portal.getSupportedWindowStates().add(WindowState.NORMAL);
-
- //
- portal.getSupportedModes().add(Mode.EDIT);
- portal.getSupportedModes().add(Mode.HELP);
- portal.getSupportedModes().add(Mode.VIEW);
-
- // Create the default page
- Page page = portal.createPage("default");
- constraints = Collections.singleton(new
RoleSecurityBinding(PortalObjectPermission.VIEW_RECURSIVE_ACTION,
SecurityConstants.UNCHECKED_ROLE_NAME));
-
configurator.setSecurityBindings(page.getId().toString(PortalObjectPath.CANONICAL_FORMAT),
constraints);
-
- portal.setDeclaredProperty(PortalObject.PORTAL_PROP_DEFAULT_OBJECT_NAME,
page.getName());
-
- }
- catch (Exception e)
- {
- e.printStackTrace();
- }
- }
-}
Copied: trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/actions/PortalAction.java
(from rev 7842,
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/actions/PortalAction.java)
===================================================================
--- trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/actions/PortalAction.java
(rev 0)
+++
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/actions/PortalAction.java 2007-08-06
09:16:45 UTC (rev 7865)
@@ -0,0 +1,179 @@
+/******************************************************************************
+ * 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.Mode;
+import org.jboss.portal.WindowState;
+import org.jboss.portal.core.model.portal.PortalContainer;
+import org.jboss.portal.core.model.portal.Page;
+import org.jboss.portal.core.model.portal.Portal;
+import org.jboss.portal.core.model.portal.PortalObject;
+import org.jboss.portal.core.model.portal.PortalObjectPermission;
+import org.jboss.portal.core.model.portal.PortalObjectPath;
+import org.jboss.portal.core.admin.ui.PortalObjectManagerBean;
+import org.jboss.portal.security.RoleSecurityBinding;
+import org.jboss.portal.security.SecurityConstants;
+import org.jboss.portal.security.spi.provider.DomainConfigurator;
+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;
+import java.util.Collections;
+import java.util.HashSet;
+import java.util.Set;
+
+/**
+ * @author <a href="mailto:boleslaw dot dawidowicz at jboss.org">Boleslaw
Dawidowicz</a>
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 5763 $
+ */
+public class PortalAction
+{
+
+ /** . */
+ private PortalObjectManagerBean pomgr;
+
+ /** . */
+ private String portalName;
+
+ //private String defaultPageName;
+
+ /** . */
+ private static final String ERROR_DUPE_NAME = "Duplicate Portal name found on
this portal!";
+
+ /** . */
+ private static final String ERROR_EMPTY_NAME = "Portal name cannot be
blank!";
+
+ public PortalObjectManagerBean getPortalObjectManager()
+ {
+ return pomgr;
+ }
+
+ public void setPortalObjectManager(PortalObjectManagerBean portalObjectManager)
+ {
+ this.pomgr = portalObjectManager;
+ }
+
+ public String getPortalName()
+ {
+ return portalName;
+ }
+
+ public void setPortalName(String portalName)
+ {
+ this.portalName = portalName;
+ }
+
+ public String getDefaultPageName()
+ {
+ return
pomgr.getSelectedObject().getDeclaredProperty(PortalObject.PORTAL_PROP_DEFAULT_OBJECT_NAME);
+ }
+
+ public void setDefaultPageName(String defaultPageName)
+ {
+ if (defaultPageName != null && !defaultPageName.equals(""))
+ {
+
pomgr.getSelectedObject().setDeclaredProperty(PortalObject.PORTAL_PROP_DEFAULT_OBJECT_NAME,
defaultPageName);
+ }
+ else if (defaultPageName == null || defaultPageName.equals(""))
+ {
+
pomgr.getSelectedObject().setDeclaredProperty(PortalObject.PORTAL_PROP_DEFAULT_OBJECT_NAME,
null);
+ }
+
+ }
+
+
+ /**
+ * Checks for duplicate portal names on the portal instance. Blank page names are not
allowed and are controlled by
+ * the required attribute in the presentation page.
+ *
+ * @param context
+ * @param toValidate
+ * @param value
+ */
+ public void validatePortalName(FacesContext context, UIComponent toValidate, Object
value)
+ {
+ String portalName = (String)value;
+
+ // check for empty string
+ if (portalName.startsWith(" "))
+ {
+ FacesMessage message = new FacesMessage(FacesMessage.SEVERITY_ERROR,
PortalAction.ERROR_EMPTY_NAME, PortalAction.ERROR_EMPTY_NAME);
+ throw new ValidatorException(message);
+ }
+
+ // Check for duplicate child name
+ if (pomgr.getSelectedObject().getChild(portalName) != null)
+ {
+ FacesMessage message = new FacesMessage(FacesMessage.SEVERITY_ERROR,
PortalAction.ERROR_DUPE_NAME, PortalAction.ERROR_DUPE_NAME);
+ throw new ValidatorException(message);
+ }
+ }
+
+ public void addPortal()
+ {
+ try
+ {
+ PortalContainer portalContainer = (PortalContainer)pomgr.getSelectedObject();
+ Portal portal = portalContainer.createPortal(portalName);
+ DomainConfigurator configurator = pomgr.getDomainConfigurator();
+
+ // Initial portal permissions
+ Set actions = new HashSet();
+ actions.add(PortalObjectPermission.VIEW_RECURSIVE_ACTION);
+ actions.add(PortalObjectPermission.PERSONALIZE_RECURSIVE_ACTION);
+ RoleSecurityBinding binding = new RoleSecurityBinding(actions,
SecurityConstants.UNCHECKED_ROLE_NAME);
+ Set constraints = Collections.singleton(binding);
+
configurator.setSecurityBindings(portal.getId().toString(PortalObjectPath.CANONICAL_FORMAT),
constraints);
+
+ // We need to add initial layout sets to avoid problems...
+ portal.setDeclaredProperty(ThemeConstants.PORTAL_PROP_LAYOUT,
"generic");
+ // portal.setDeclaredProperty(ThemeConstants.PORTAL_PROP_THEME,
"Nphalanx");
+ portal.setDeclaredProperty(ThemeConstants.PORTAL_PROP_RENDERSET,
"divRenderer");
+
+ //
+ portal.getSupportedWindowStates().add(WindowState.MAXIMIZED);
+ portal.getSupportedWindowStates().add(WindowState.MINIMIZED);
+ portal.getSupportedWindowStates().add(WindowState.NORMAL);
+
+ //
+ portal.getSupportedModes().add(Mode.EDIT);
+ portal.getSupportedModes().add(Mode.HELP);
+ portal.getSupportedModes().add(Mode.VIEW);
+
+ // Create the default page
+ Page page = portal.createPage("default");
+ constraints = Collections.singleton(new
RoleSecurityBinding(PortalObjectPermission.VIEW_RECURSIVE_ACTION,
SecurityConstants.UNCHECKED_ROLE_NAME));
+
configurator.setSecurityBindings(page.getId().toString(PortalObjectPath.CANONICAL_FORMAT),
constraints);
+
+ portal.setDeclaredProperty(PortalObject.PORTAL_PROP_DEFAULT_OBJECT_NAME,
page.getName());
+
+ }
+ catch (Exception e)
+ {
+ e.printStackTrace();
+ }
+ }
+}
Property changes on:
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/actions/PortalAction.java
___________________________________________________________________
Name: svn:executable
+ *
Deleted:
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/actions/PropertyAction.java
===================================================================
---
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/actions/PropertyAction.java 2007-07-30
12:59:36 UTC (rev 7842)
+++
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/actions/PropertyAction.java 2007-08-06
09:16:45 UTC (rev 7865)
@@ -1,139 +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 java.util.Map;
-
-import org.jboss.portal.core.admin.ui.PortalObjectManagerBean;
-import org.jboss.portal.core.impl.model.portal.PortalObjectImpl;
-import org.jboss.portal.core.model.portal.PortalObject;
-
-import javax.faces.application.FacesMessage;
-import javax.faces.component.UIComponent;
-import javax.faces.context.FacesContext;
-import javax.faces.validator.ValidatorException;
-import javax.faces.event.ValueChangeEvent;
-
-/**
- * @author <a href="mailto:boleslaw dot dawidowicz at jboss.org">Boleslaw
Dawidowicz</a>
- * @version $Revision: 5448 $
- */
-public class PropertyAction
-{
-
- /** . */
- private PortalObjectManagerBean pomgr;
-
- /** . */
- private String selectedProperty;
-
- /** . */
- private String propertyValue;
-
- /** . */
- private String otherPropertyName;
-
- /** . */
- private static final String ERROR_EMPTY_NAME = "Property name cannot be
blank!";
-
- public PropertyAction(PortalObjectManagerBean pomgr)
- {
- this.pomgr = pomgr;
- }
-
- public String getSelectedProperty()
- {
- return selectedProperty;
- }
-
- public void setSelectedProperty(String selectedProperty)
- {
- this.selectedProperty = selectedProperty;
- }
-
- public String getPropertyValue()
- {
- return propertyValue;
- }
-
- public void setPropertyValue(String propertyValue)
- {
- this.propertyValue = propertyValue;
- }
-
-
- public void validatePropertyName(FacesContext context, UIComponent toValidate, Object
value)
- {
- String propertyName = (String)value;
-
- // check for empty string
- if (propertyName == null || propertyName.startsWith(" ") ||
propertyName.equals(""))
- {
- FacesMessage message = new FacesMessage(FacesMessage.SEVERITY_ERROR,
PropertyAction.ERROR_EMPTY_NAME, PropertyAction.ERROR_EMPTY_NAME);
- throw new ValidatorException(message);
- }
- }
-
- public void selectProperty()
- {
- }
-
- public void removeProperty()
- {
- Map pmap =
FacesContext.getCurrentInstance().getExternalContext().getRequestParameterMap();
- String name = (String)pmap.get("name");
-
((PortalObjectImpl)pomgr.getSelectedObject()).getDeclaredPropertyMap().remove(name);
- }
-
- public void updateProperty()
- {
- String propertyName = otherPropertyName.trim();
-
- //
- if (propertyName.length() == 0 && selectedProperty != null)
- {
- propertyName = selectedProperty.trim();
- }
-
- //
- if (propertyName.length() > 0)
- {
- String value = getPropertyValue();
- if (value == null)
- {
- value = "";
- }
- pomgr.getSelectedObject().setDeclaredProperty(propertyName, value);
- }
- }
-
- public String getOtherPropertyName()
- {
- return otherPropertyName;
- }
-
- public void setOtherPropertyName(String otherPropertyName)
- {
- this.otherPropertyName = otherPropertyName;
- }
-}
Copied:
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/actions/PropertyAction.java (from
rev 7842,
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/actions/PropertyAction.java)
===================================================================
--- trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/actions/PropertyAction.java
(rev 0)
+++
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/actions/PropertyAction.java 2007-08-06
09:16:45 UTC (rev 7865)
@@ -0,0 +1,139 @@
+/******************************************************************************
+ * 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 java.util.Map;
+
+import org.jboss.portal.core.admin.ui.PortalObjectManagerBean;
+import org.jboss.portal.core.impl.model.portal.PortalObjectImpl;
+import org.jboss.portal.core.model.portal.PortalObject;
+
+import javax.faces.application.FacesMessage;
+import javax.faces.component.UIComponent;
+import javax.faces.context.FacesContext;
+import javax.faces.validator.ValidatorException;
+import javax.faces.event.ValueChangeEvent;
+
+/**
+ * @author <a href="mailto:boleslaw dot dawidowicz at jboss.org">Boleslaw
Dawidowicz</a>
+ * @version $Revision: 5448 $
+ */
+public class PropertyAction
+{
+
+ /** . */
+ private PortalObjectManagerBean pomgr;
+
+ /** . */
+ private String selectedProperty;
+
+ /** . */
+ private String propertyValue;
+
+ /** . */
+ private String otherPropertyName;
+
+ /** . */
+ private static final String ERROR_EMPTY_NAME = "Property name cannot be
blank!";
+
+ public PropertyAction(PortalObjectManagerBean pomgr)
+ {
+ this.pomgr = pomgr;
+ }
+
+ public String getSelectedProperty()
+ {
+ return selectedProperty;
+ }
+
+ public void setSelectedProperty(String selectedProperty)
+ {
+ this.selectedProperty = selectedProperty;
+ }
+
+ public String getPropertyValue()
+ {
+ return propertyValue;
+ }
+
+ public void setPropertyValue(String propertyValue)
+ {
+ this.propertyValue = propertyValue;
+ }
+
+
+ public void validatePropertyName(FacesContext context, UIComponent toValidate, Object
value)
+ {
+ String propertyName = (String)value;
+
+ // check for empty string
+ if (propertyName == null || propertyName.startsWith(" ") ||
propertyName.equals(""))
+ {
+ FacesMessage message = new FacesMessage(FacesMessage.SEVERITY_ERROR,
PropertyAction.ERROR_EMPTY_NAME, PropertyAction.ERROR_EMPTY_NAME);
+ throw new ValidatorException(message);
+ }
+ }
+
+ public void selectProperty()
+ {
+ }
+
+ public void removeProperty()
+ {
+ Map pmap =
FacesContext.getCurrentInstance().getExternalContext().getRequestParameterMap();
+ String name = (String)pmap.get("name");
+
((PortalObjectImpl)pomgr.getSelectedObject()).getDeclaredPropertyMap().remove(name);
+ }
+
+ public void updateProperty()
+ {
+ String propertyName = otherPropertyName.trim();
+
+ //
+ if (propertyName.length() == 0 && selectedProperty != null)
+ {
+ propertyName = selectedProperty.trim();
+ }
+
+ //
+ if (propertyName.length() > 0)
+ {
+ String value = getPropertyValue();
+ if (value == null)
+ {
+ value = "";
+ }
+ pomgr.getSelectedObject().setDeclaredProperty(propertyName, value);
+ }
+ }
+
+ public String getOtherPropertyName()
+ {
+ return otherPropertyName;
+ }
+
+ public void setOtherPropertyName(String otherPropertyName)
+ {
+ this.otherPropertyName = otherPropertyName;
+ }
+}
Property changes on:
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/actions/PropertyAction.java
___________________________________________________________________
Name: svn:executable
+ *
Deleted:
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/actions/RenameAction.java
===================================================================
---
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/actions/RenameAction.java 2007-07-30
12:59:36 UTC (rev 7842)
+++
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/actions/RenameAction.java 2007-08-06
09:16:45 UTC (rev 7865)
@@ -1,124 +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 java.util.Set;
-
-import javax.faces.application.FacesMessage;
-import javax.faces.context.FacesContext;
-
-import org.jboss.portal.core.admin.ui.PortalObjectManagerBean;
-import org.jboss.portal.core.model.portal.DuplicatePortalObjectException;
-import org.jboss.portal.core.model.portal.NoSuchPortalObjectException;
-import org.jboss.portal.core.model.portal.PortalObject;
-import org.jboss.portal.core.model.portal.PortalObjectId;
-import org.jboss.portal.core.model.portal.PortalObjectPath;
-import org.jboss.portal.security.spi.provider.DomainConfigurator;
-
-/**
- * @author <a href="mailto:theute@jboss.org">Thomas Heute</a>
- * @version $Revision: 5763 $
- */
-public class RenameAction
-{
- private String newName;
-
- /** . */
- private PortalObjectManagerBean portalObjectManager;
-
- private DomainConfigurator domainConfigurator;
-
- public void setNewName(String newName)
- {
- this.newName = newName;
- }
-
- public String getNewName()
- {
- return newName;
- }
-
-
- public DomainConfigurator getDomainConfigurator()
- {
- return domainConfigurator;
- }
-
- public void setDomainConfigurator(DomainConfigurator domainConfigurator)
- {
- this.domainConfigurator = domainConfigurator;
- }
- public PortalObjectManagerBean getPortalObjectManager()
- {
- return portalObjectManager;
- }
-
- public void setPortalObjectManager(PortalObjectManagerBean portalObjectManager)
- {
- this.portalObjectManager = portalObjectManager;
- }
-
- public String execute()
- {
- PortalObject portalObject = (PortalObject)portalObjectManager.getSelectedObject();
- PortalObject parent = portalObject.getParent();
- try
- {
- // TODO: Should be in a tx
-
- // Clone portal object
- PortalObject newObject = portalObject.copy(parent, newName, true);
-
- // Copy security settings
- Set set =
domainConfigurator.getSecurityBindings(portalObject.getId().toString(PortalObjectPath.CANONICAL_FORMAT));
-
domainConfigurator.setSecurityBindings(newObject.getId().toString(PortalObjectPath.CANONICAL_FORMAT),
set);
-
- String defaultObject =
(String)parent.getDeclaredProperties().get(PortalObject.PORTAL_PROP_DEFAULT_OBJECT_NAME);
- if (portalObject.getName().equals(defaultObject))
- {
- parent.setDeclaredProperty(PortalObject.PORTAL_PROP_DEFAULT_OBJECT_NAME,
newName);
- }
-
- // Destroy previous object
- parent.destroyChild(portalObject.getName());
- }
- catch (IllegalArgumentException e)
- {
- e.printStackTrace();
- }
- catch (DuplicatePortalObjectException e)
- {
- String message = "The name \"" + newName + "\" is
already used, please choose a different one";
- FacesContext.getCurrentInstance().addMessage("renameForm:newName", new
FacesMessage(FacesMessage.SEVERITY_ERROR, message, message));
- return null;
- }
- catch (NoSuchPortalObjectException e)
- {
- e.printStackTrace();
- }
- portalObjectManager.selectObject(parent);
- return "objects";
- }
-
-
-}
Copied: trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/actions/RenameAction.java
(from rev 7842,
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/actions/RenameAction.java)
===================================================================
--- trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/actions/RenameAction.java
(rev 0)
+++
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/actions/RenameAction.java 2007-08-06
09:16:45 UTC (rev 7865)
@@ -0,0 +1,124 @@
+/******************************************************************************
+ * 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 java.util.Set;
+
+import javax.faces.application.FacesMessage;
+import javax.faces.context.FacesContext;
+
+import org.jboss.portal.core.admin.ui.PortalObjectManagerBean;
+import org.jboss.portal.core.model.portal.DuplicatePortalObjectException;
+import org.jboss.portal.core.model.portal.NoSuchPortalObjectException;
+import org.jboss.portal.core.model.portal.PortalObject;
+import org.jboss.portal.core.model.portal.PortalObjectId;
+import org.jboss.portal.core.model.portal.PortalObjectPath;
+import org.jboss.portal.security.spi.provider.DomainConfigurator;
+
+/**
+ * @author <a href="mailto:theute@jboss.org">Thomas Heute</a>
+ * @version $Revision: 5763 $
+ */
+public class RenameAction
+{
+ private String newName;
+
+ /** . */
+ private PortalObjectManagerBean portalObjectManager;
+
+ private DomainConfigurator domainConfigurator;
+
+ public void setNewName(String newName)
+ {
+ this.newName = newName;
+ }
+
+ public String getNewName()
+ {
+ return newName;
+ }
+
+
+ public DomainConfigurator getDomainConfigurator()
+ {
+ return domainConfigurator;
+ }
+
+ public void setDomainConfigurator(DomainConfigurator domainConfigurator)
+ {
+ this.domainConfigurator = domainConfigurator;
+ }
+ public PortalObjectManagerBean getPortalObjectManager()
+ {
+ return portalObjectManager;
+ }
+
+ public void setPortalObjectManager(PortalObjectManagerBean portalObjectManager)
+ {
+ this.portalObjectManager = portalObjectManager;
+ }
+
+ public String execute()
+ {
+ PortalObject portalObject = (PortalObject)portalObjectManager.getSelectedObject();
+ PortalObject parent = portalObject.getParent();
+ try
+ {
+ // TODO: Should be in a tx
+
+ // Clone portal object
+ PortalObject newObject = portalObject.copy(parent, newName, true);
+
+ // Copy security settings
+ Set set =
domainConfigurator.getSecurityBindings(portalObject.getId().toString(PortalObjectPath.CANONICAL_FORMAT));
+
domainConfigurator.setSecurityBindings(newObject.getId().toString(PortalObjectPath.CANONICAL_FORMAT),
set);
+
+ String defaultObject =
(String)parent.getDeclaredProperties().get(PortalObject.PORTAL_PROP_DEFAULT_OBJECT_NAME);
+ if (portalObject.getName().equals(defaultObject))
+ {
+ parent.setDeclaredProperty(PortalObject.PORTAL_PROP_DEFAULT_OBJECT_NAME,
newName);
+ }
+
+ // Destroy previous object
+ parent.destroyChild(portalObject.getName());
+ }
+ catch (IllegalArgumentException e)
+ {
+ e.printStackTrace();
+ }
+ catch (DuplicatePortalObjectException e)
+ {
+ String message = "The name \"" + newName + "\" is
already used, please choose a different one";
+ FacesContext.getCurrentInstance().addMessage("renameForm:newName", new
FacesMessage(FacesMessage.SEVERITY_ERROR, message, message));
+ return null;
+ }
+ catch (NoSuchPortalObjectException e)
+ {
+ e.printStackTrace();
+ }
+ portalObjectManager.selectObject(parent);
+ return "objects";
+ }
+
+
+}
Deleted:
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/actions/WindowComparator.java
===================================================================
---
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/actions/WindowComparator.java 2007-07-30
12:59:36 UTC (rev 7842)
+++
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/actions/WindowComparator.java 2007-08-06
09:16:45 UTC (rev 7865)
@@ -1,62 +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.Window;
-import org.jboss.portal.theme.ThemeConstants;
-
-import java.util.Comparator;
-
-/**
- * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 1.1 $
- */
-public class WindowComparator implements Comparator
-{
-
- public int compare(Object o1, Object o2)
- {
- Window w1 = (Window)o1;
- Window w2 = (Window)o2;
- int sign = getOrder(w1) - getOrder(w2);
- if (sign == 0)
- {
- sign = 1;
- // sign = w1.getId().compareTo(w2.getId());
- }
-
- return sign;
- }
-
- private static int getOrder(Window w)
- {
- try
- {
- return
Integer.parseInt(w.getDeclaredProperty(ThemeConstants.PORTAL_PROP_ORDER));
- }
- catch (NumberFormatException e)
- {
- return Integer.MAX_VALUE;
- }
- }
-}
Copied:
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/actions/WindowComparator.java
(from rev 7842,
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/actions/WindowComparator.java)
===================================================================
---
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/actions/WindowComparator.java
(rev 0)
+++
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/actions/WindowComparator.java 2007-08-06
09:16:45 UTC (rev 7865)
@@ -0,0 +1,62 @@
+/******************************************************************************
+ * 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.Window;
+import org.jboss.portal.theme.ThemeConstants;
+
+import java.util.Comparator;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class WindowComparator implements Comparator
+{
+
+ public int compare(Object o1, Object o2)
+ {
+ Window w1 = (Window)o1;
+ Window w2 = (Window)o2;
+ int sign = getOrder(w1) - getOrder(w2);
+ if (sign == 0)
+ {
+ sign = 1;
+ // sign = w1.getId().compareTo(w2.getId());
+ }
+
+ return sign;
+ }
+
+ private static int getOrder(Window w)
+ {
+ try
+ {
+ return
Integer.parseInt(w.getDeclaredProperty(ThemeConstants.PORTAL_PROP_ORDER));
+ }
+ catch (NumberFormatException e)
+ {
+ return Integer.MAX_VALUE;
+ }
+ }
+}
Copied: trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/common (from rev 7842,
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/common)
Deleted:
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/common/PageManagerBean.java
===================================================================
---
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/common/PageManagerBean.java 2007-07-30
12:59:36 UTC (rev 7842)
+++
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/common/PageManagerBean.java 2007-08-06
09:16:45 UTC (rev 7865)
@@ -1,525 +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.common;
-
-import org.jboss.portal.core.model.portal.Page;
-import org.jboss.portal.core.model.portal.PortalObject;
-import org.jboss.portal.core.model.portal.Window;
-import org.jboss.portal.core.model.portal.DuplicatePortalObjectException;
-import org.jboss.portal.core.model.portal.NoSuchPortalObjectException;
-import org.jboss.portal.core.model.content.ContentType;
-import org.jboss.portal.core.model.content.Content;
-import org.jboss.portal.core.model.content.spi.portlet.ContentPortlet;
-import org.jboss.portal.core.admin.ui.actions.WindowComparator;
-import org.jboss.portal.core.impl.model.content.ContentProviderRegistryService;
-import org.jboss.portal.theme.ThemeConstants;
-import org.jboss.portal.theme.PortalLayout;
-import org.jboss.portal.theme.LayoutService;
-import org.jboss.portal.faces.component.portlet.PortletActionEvent;
-import org.jboss.portal.faces.component.portlet.PortletRenderEvent;
-import org.jboss.portal.faces.el.dynamic.DynamicBean;
-import org.jboss.portal.faces.el.PropertyValue;
-import org.jboss.portal.portlet.PortletInvoker;
-
-import javax.faces.model.SelectItem;
-import javax.faces.event.ActionEvent;
-import javax.faces.event.AbortProcessingException;
-import javax.faces.application.FacesMessage;
-import javax.faces.context.FacesContext;
-import java.util.Map;
-import java.util.LinkedHashMap;
-import java.util.Iterator;
-import java.util.TreeSet;
-import java.util.SortedSet;
-import java.util.List;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.LinkedList;
-import java.util.HashMap;
-
-/**
- * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 1.1 $
- */
-public class PageManagerBean
-{
-
- /** . */
- private static final String CONTENT_ACTION_SELECT =
"content.action.select";
-
- /** . */
- private static final String CONTENT_URI = "content.uri";
-
- /** . */
- private static final String CONTENT_PARAM_PREFIX = "content.param.";
-
- /** . */
- private static final int CONTENT_PARAM_PREFIX_LENGTH = CONTENT_PARAM_PREFIX.length();
-
- /** . */
- private static final int MOVE_UP = 'u';
-
- /** . */
- private static final int MOVE_DOWN = 'd';
-
- /** . */
- private static final int MOVE_LEFT = 'l';
-
- /** . */
- private static final int ADD_ACTION = 'a';
-
- public PageManagerBean(LayoutService layoutService, PortletInvoker portletInvoker)
- {
- this.layoutService = layoutService;
- this.portletInvoker = portletInvoker;
- this.selectedContentType = ContentType.PORTLET;
- this.selectedRenderParameters = new HashMap();
- }
-
- /** . */
- public final LayoutService layoutService;
-
- /** . */
- public final PortletInvoker portletInvoker;
-
- /** . */
- public Page page;
-
- /** . */
- private ContentType selectedContentType;
-
- /** . */
- public DynamicMap assignedWindows = new DynamicMap();
-
- /** . */
- public String selectedContentURI;
-
- /** . */
- public Map selectedContentParameters;
-
- /** . */
- public Map selectedRenderParameters;
-
- public List getContentTypeItems()
- {
- LinkedList types = new LinkedList();
- for (Iterator i =
ContentProviderRegistryService.getInstance().getContentTypes().iterator();i.hasNext();)
- {
- ContentType contentType = (ContentType)i.next();
- SelectItem item = new SelectItem();
- item.setValue(contentType);
- item.setLabel(contentType.toString());
- if (contentType.equals(ContentType.PORTLET))
- {
- types.addFirst(item);
- }
- else
- {
- types.addLast(item);
- }
- }
- return types;
- }
-
- public ContentType getSelectedContentType()
- {
- return selectedContentType;
- }
-
- public void setSelectedContentType(ContentType selectedContentType)
- {
- this.selectedContentType = selectedContentType;
- this.selectedContentURI = null;
- this.selectedContentParameters = null;
- this.selectedRenderParameters = new HashMap();
- }
-
- public String getSelectedEditorPortletId()
- {
- if (selectedContentType != null)
- {
- return
ContentProviderRegistryService.getInstance().getContentProvider(selectedContentType).getPortletInfo().getPortletName(ContentPortlet.EDIT_CONTENT_MODE);
- }
- else
- {
- return null;
- }
- }
-
- protected String createWindowName()
- {
- return "" + (int)(100 * Math.random());
- }
-
- public void assignWindows(ActionEvent event)
- {
- String id = event.getComponent().getId();
- char direction = id.charAt(0);
- String regionName = id.substring(2);
-
- // Contains the names selected window in the UI
- List selectedWindows = (List)assignedWindows.values.get(regionName);
-
- // Get the windows belonging to the selected region sorted by order
- List windows = new ArrayList();
- for (Iterator i =
page.getChildren(PortalObject.WINDOW_MASK).iterator();i.hasNext();)
- {
- Window window = (Window)i.next();
- if (regionName.equals(window.getProperty(ThemeConstants.PORTAL_PROP_REGION)))
- {
- windows.add(window);
- }
- }
- Collections.sort(windows, new WindowComparator());
-
- //
- if (direction == MOVE_UP || direction == MOVE_DOWN)
- {
- //
- int index = direction == MOVE_UP ? 1 : windows.size() - 2;
- int length = windows.size() - 1;
- int step = direction == MOVE_UP ? 1 : -1;
-
- // Perform swaps
- while (length-- > 0)
- {
- Window window = (Window)windows.get(index);
- if (selectedWindows.contains(window.getName()))
- {
- Collections.swap(windows, index - step, index);
- }
- index += step;
- }
- }
- else if (direction == ADD_ACTION)
- {
- if (selectedContentURI != null)
- {
- //
- String selectedContentURI = this.selectedContentURI;
- Map selectedContentParams = this.selectedContentParameters;
-
- // Reset to new state
- this.selectedContentURI = null;
- this.selectedContentParameters = null;
- this.selectedRenderParameters = new HashMap();
-
- // Obtain a window name
- String windowName =
(String)FacesContext.getCurrentInstance().getExternalContext().getRequestParameterMap().get("blah");
- if (windowName.trim().length() == 0)
- {
- windowName = createWindowName();
- while (page.getWindow(windowName) != null)
- {
- windowName = "" + createWindowName();
- }
- }
-
- // Check for duplicate window name
- if (page.getWindow(windowName) != null)
- {
- FacesContext faces = FacesContext.getCurrentInstance();
- FacesMessage message = new FacesMessage(FacesMessage.SEVERITY_ERROR,
"Duplicate window name found on this page!", null);
- faces.addMessage("windowName", message);
- throw new AbortProcessingException();
- }
-
- //
- try
- {
- Window window = page.createWindow(windowName, selectedContentType,
selectedContentURI);
- Content content = window.getContent();
- for (Iterator i =
selectedContentParams.entrySet().iterator();i.hasNext();)
- {
- Map.Entry entry = (Map.Entry)i.next();
- String paramName = (String)entry.getKey();
- String paramValue = (String)entry.getValue();
- content.setParameter(paramName, paramValue);
- }
-
- //
- window.setDeclaredProperty(ThemeConstants.PORTAL_PROP_REGION,
regionName);
- window.setDeclaredProperty(ThemeConstants.PORTAL_PROP_ORDER, ""
+ Integer.MAX_VALUE);
-
- // Sort windows
- Collections.sort(windows, new WindowComparator());
-
- // Add the created one
- windows.add(window);
-
- // Update the order states
- for (int i = 0;i < windows.size();i++)
- {
- Window tmp = (Window)windows.get(i);
- tmp.setDeclaredProperty(ThemeConstants.PORTAL_PROP_ORDER, ""
+ i);
- }
-
- this.windowName = "";
- }
- catch (DuplicatePortalObjectException unexpected)
- {
- unexpected.printStackTrace();
- }
- }
- else
- {
- FacesContext faces = FacesContext.getCurrentInstance();
- FacesMessage message = new FacesMessage(FacesMessage.SEVERITY_ERROR, "No
content was selected!", null);
- faces.addMessage("layoutForm", message);
- throw new AbortProcessingException();
- }
- }
- else if (direction == MOVE_LEFT)
- {
- for (Iterator i = windows.iterator();i.hasNext();)
- {
- Window window = (Window)i.next();
- if (selectedWindows.contains(window.getName()))
- {
- i.remove();
- try
- {
- page.destroyChild(window.getName());
- }
- catch (NoSuchPortalObjectException ignore)
- {
- ignore.printStackTrace();
- }
- }
- }
- }
-
- // Update the order states
- for (int i = 0;i < windows.size();i++)
- {
- Window window = (Window)windows.get(i);
- window.setDeclaredProperty(ThemeConstants.PORTAL_PROP_ORDER, "" + i);
- }
-
- //
- assignedWindows.values.clear();
- }
-
- private String windowName;
-
- public String getWindowName()
- {
- return windowName;
- }
-
- public void setWindowName(String windowName)
- {
- this.windowName = windowName;
- }
-
- /**
- * Portlet event
- */
- public void assignWindow(ActionEvent event)
- {
- if (event instanceof PortletRenderEvent)
- {
- PortletRenderEvent renderEvent = (PortletRenderEvent)event;
- Map renderParams = renderEvent.getParameterMap();
-
- // Keep window name and region defined
- setWindowName(((String[])renderParams.get("windowName"))[0]);
- }
- else if (event instanceof PortletActionEvent)
- {
- PortletActionEvent actionEvent = (PortletActionEvent)event;
- Map actionParams = actionEvent.getParameterMap();
-
- // Keep window name and region defined
- String[] windowNames = ((String[])actionParams.get("windowName"));
- if (windowNames != null && windowNames.length > 0)
- {
- setWindowName(windowNames[0]);
- }
-
- //
- if (actionParams.get(CONTENT_ACTION_SELECT) != null)
- {
- String[] uris = (String[])actionParams.get(CONTENT_URI);
- if (uris != null && uris.length > 0)
- {
- String uri = uris[0];
-
- //
- Map parameters = new HashMap();
- for (Iterator i = actionParams.entrySet().iterator();i.hasNext();)
- {
- Map.Entry entry = (Map.Entry)i.next();
- String name = (String)entry.getKey();
- if (name.startsWith(CONTENT_PARAM_PREFIX))
- {
- String paramName = name.substring(CONTENT_PARAM_PREFIX_LENGTH);
- String paramValue = ((String[])entry.getValue())[0];
- parameters.put(paramName, paramValue);
- }
- }
-
- //
- this.selectedContentURI = uri;
- this.selectedContentParameters = parameters;
- }
- }
- }
- }
-
- /** Return the <Region>List on the selected object which must be a page. */
- public List getRegionNames()
- {
- try
- {
- Map windows = getWindows(page);
-
- //
- List regions = new ArrayList(windows.keySet());
- regions.remove("unknown");
- Collections.sort(regions);
-
- //
- return regions;
- }
- catch (Exception e)
- {
- e.printStackTrace();
-
- //
- return Collections.EMPTY_LIST;
- }
- }
-
- public List getRegionItems()
- {
- try
- {
- Map windows = getWindows(page);
-
- // We don't want the unknown region
- windows.remove("unknown");
-
- //
- ArrayList regions = new ArrayList(windows.keySet());
- Collections.sort(regions);
- for (int i = 0; i < regions.size();i++)
- {
- String regionName = (String)regions.get(i);
- SelectItem regionItem = new SelectItem(regionName, regionName);
- regions.set(i, regionItem);
- }
-
- //
- return regions;
- }
- catch (Exception e)
- {
- e.printStackTrace();
-
- //
- return Collections.EMPTY_LIST;
- }
- }
-
- public Map getWindowItemsMap() throws Exception
- {
- Map windowMap = getWindows(page);
- for (Iterator i = windowMap.entrySet().iterator();i.hasNext();)
- {
- Map.Entry entry = (Map.Entry)i.next();
- SortedSet windows = (SortedSet)entry.getValue();
- ArrayList windowItems = new ArrayList(windows.size());
- for (Iterator j = windows.iterator();j.hasNext();)
- {
- Window window = (Window)j.next();
- SelectItem windowItem = new SelectItem();
- windowItem.setValue(window.getName());
- windowItem.setLabel(window.getName());
- windowItems.add(windowItem);
- }
- entry.setValue(windowItems);
- }
- return windowMap;
- }
-
- /** Returns a <Region,<Window>SortedSet>Map. */
- private Map getWindows(Page page) throws Exception
- {
- // Get the layout
- String layoutId = page.getProperty(ThemeConstants.PORTAL_PROP_LAYOUT);
- PortalLayout layout = layoutService.getLayout(layoutId, true);
-
- //
- LinkedHashMap windows = new LinkedHashMap();
- for (Iterator i = layout.getLayoutInfo().getRegionNames().iterator();
i.hasNext();)
- {
- String region = (String)i.next();
- windows.put(region, new TreeSet(new WindowComparator()));
- }
- windows.put("unknown", new TreeSet(new WindowComparator()));
-
- //
- for (Iterator j = page.getChildren(PortalObject.WINDOW_MASK).iterator();
j.hasNext();)
- {
- PortalObject window = (PortalObject)j.next();
- String region = window.getProperty(ThemeConstants.PORTAL_PROP_REGION);
- if (!windows.containsKey(region))
- {
- region = "unknown";
- }
- SortedSet set = (SortedSet)windows.get(region);
- set.add(window);
- }
- return windows;
- }
-
- public static class DynamicMap implements DynamicBean
- {
-
- /** . */
- private Map values = new HashMap();
-
- public Class getType(Object propertyName) throws IllegalArgumentException
- {
- return List.class;
- }
-
- public PropertyValue getValue(Object propertyName) throws IllegalArgumentException
- {
- List list = (List)values.get(propertyName);
- if (list == null)
- {
- list = new ArrayList();
- values.put(propertyName, list);
- }
- return new PropertyValue(list);
- }
-
- public boolean setValue(Object propertyName, Object value) throws
IllegalArgumentException
- {
- values.put(propertyName, value);
- return true;
- }
- }
-}
Copied:
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/common/PageManagerBean.java (from
rev 7842,
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/common/PageManagerBean.java)
===================================================================
--- trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/common/PageManagerBean.java
(rev 0)
+++
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/common/PageManagerBean.java 2007-08-06
09:16:45 UTC (rev 7865)
@@ -0,0 +1,525 @@
+/******************************************************************************
+ * 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.common;
+
+import org.jboss.portal.core.model.portal.Page;
+import org.jboss.portal.core.model.portal.PortalObject;
+import org.jboss.portal.core.model.portal.Window;
+import org.jboss.portal.core.model.portal.DuplicatePortalObjectException;
+import org.jboss.portal.core.model.portal.NoSuchPortalObjectException;
+import org.jboss.portal.core.model.content.ContentType;
+import org.jboss.portal.core.model.content.Content;
+import org.jboss.portal.core.model.content.spi.portlet.ContentPortlet;
+import org.jboss.portal.core.admin.ui.actions.WindowComparator;
+import org.jboss.portal.core.impl.model.content.ContentProviderRegistryService;
+import org.jboss.portal.theme.ThemeConstants;
+import org.jboss.portal.theme.PortalLayout;
+import org.jboss.portal.theme.LayoutService;
+import org.jboss.portal.faces.component.portlet.PortletActionEvent;
+import org.jboss.portal.faces.component.portlet.PortletRenderEvent;
+import org.jboss.portal.faces.el.dynamic.DynamicBean;
+import org.jboss.portal.faces.el.PropertyValue;
+import org.jboss.portal.portlet.PortletInvoker;
+
+import javax.faces.model.SelectItem;
+import javax.faces.event.ActionEvent;
+import javax.faces.event.AbortProcessingException;
+import javax.faces.application.FacesMessage;
+import javax.faces.context.FacesContext;
+import java.util.Map;
+import java.util.LinkedHashMap;
+import java.util.Iterator;
+import java.util.TreeSet;
+import java.util.SortedSet;
+import java.util.List;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.LinkedList;
+import java.util.HashMap;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class PageManagerBean
+{
+
+ /** . */
+ private static final String CONTENT_ACTION_SELECT =
"content.action.select";
+
+ /** . */
+ private static final String CONTENT_URI = "content.uri";
+
+ /** . */
+ private static final String CONTENT_PARAM_PREFIX = "content.param.";
+
+ /** . */
+ private static final int CONTENT_PARAM_PREFIX_LENGTH = CONTENT_PARAM_PREFIX.length();
+
+ /** . */
+ private static final int MOVE_UP = 'u';
+
+ /** . */
+ private static final int MOVE_DOWN = 'd';
+
+ /** . */
+ private static final int MOVE_LEFT = 'l';
+
+ /** . */
+ private static final int ADD_ACTION = 'a';
+
+ public PageManagerBean(LayoutService layoutService, PortletInvoker portletInvoker)
+ {
+ this.layoutService = layoutService;
+ this.portletInvoker = portletInvoker;
+ this.selectedContentType = ContentType.PORTLET;
+ this.selectedRenderParameters = new HashMap();
+ }
+
+ /** . */
+ public final LayoutService layoutService;
+
+ /** . */
+ public final PortletInvoker portletInvoker;
+
+ /** . */
+ public Page page;
+
+ /** . */
+ private ContentType selectedContentType;
+
+ /** . */
+ public DynamicMap assignedWindows = new DynamicMap();
+
+ /** . */
+ public String selectedContentURI;
+
+ /** . */
+ public Map selectedContentParameters;
+
+ /** . */
+ public Map selectedRenderParameters;
+
+ public List getContentTypeItems()
+ {
+ LinkedList types = new LinkedList();
+ for (Iterator i =
ContentProviderRegistryService.getInstance().getContentTypes().iterator();i.hasNext();)
+ {
+ ContentType contentType = (ContentType)i.next();
+ SelectItem item = new SelectItem();
+ item.setValue(contentType);
+ item.setLabel(contentType.toString());
+ if (contentType.equals(ContentType.PORTLET))
+ {
+ types.addFirst(item);
+ }
+ else
+ {
+ types.addLast(item);
+ }
+ }
+ return types;
+ }
+
+ public ContentType getSelectedContentType()
+ {
+ return selectedContentType;
+ }
+
+ public void setSelectedContentType(ContentType selectedContentType)
+ {
+ this.selectedContentType = selectedContentType;
+ this.selectedContentURI = null;
+ this.selectedContentParameters = null;
+ this.selectedRenderParameters = new HashMap();
+ }
+
+ public String getSelectedEditorPortletId()
+ {
+ if (selectedContentType != null)
+ {
+ return
ContentProviderRegistryService.getInstance().getContentProvider(selectedContentType).getPortletInfo().getPortletName(ContentPortlet.EDIT_CONTENT_MODE);
+ }
+ else
+ {
+ return null;
+ }
+ }
+
+ protected String createWindowName()
+ {
+ return "" + (int)(100 * Math.random());
+ }
+
+ public void assignWindows(ActionEvent event)
+ {
+ String id = event.getComponent().getId();
+ char direction = id.charAt(0);
+ String regionName = id.substring(2);
+
+ // Contains the names selected window in the UI
+ List selectedWindows = (List)assignedWindows.values.get(regionName);
+
+ // Get the windows belonging to the selected region sorted by order
+ List windows = new ArrayList();
+ for (Iterator i =
page.getChildren(PortalObject.WINDOW_MASK).iterator();i.hasNext();)
+ {
+ Window window = (Window)i.next();
+ if (regionName.equals(window.getProperty(ThemeConstants.PORTAL_PROP_REGION)))
+ {
+ windows.add(window);
+ }
+ }
+ Collections.sort(windows, new WindowComparator());
+
+ //
+ if (direction == MOVE_UP || direction == MOVE_DOWN)
+ {
+ //
+ int index = direction == MOVE_UP ? 1 : windows.size() - 2;
+ int length = windows.size() - 1;
+ int step = direction == MOVE_UP ? 1 : -1;
+
+ // Perform swaps
+ while (length-- > 0)
+ {
+ Window window = (Window)windows.get(index);
+ if (selectedWindows.contains(window.getName()))
+ {
+ Collections.swap(windows, index - step, index);
+ }
+ index += step;
+ }
+ }
+ else if (direction == ADD_ACTION)
+ {
+ if (selectedContentURI != null)
+ {
+ //
+ String selectedContentURI = this.selectedContentURI;
+ Map selectedContentParams = this.selectedContentParameters;
+
+ // Reset to new state
+ this.selectedContentURI = null;
+ this.selectedContentParameters = null;
+ this.selectedRenderParameters = new HashMap();
+
+ // Obtain a window name
+ String windowName =
(String)FacesContext.getCurrentInstance().getExternalContext().getRequestParameterMap().get("blah");
+ if (windowName.trim().length() == 0)
+ {
+ windowName = createWindowName();
+ while (page.getWindow(windowName) != null)
+ {
+ windowName = "" + createWindowName();
+ }
+ }
+
+ // Check for duplicate window name
+ if (page.getWindow(windowName) != null)
+ {
+ FacesContext faces = FacesContext.getCurrentInstance();
+ FacesMessage message = new FacesMessage(FacesMessage.SEVERITY_ERROR,
"Duplicate window name found on this page!", null);
+ faces.addMessage("windowName", message);
+ throw new AbortProcessingException();
+ }
+
+ //
+ try
+ {
+ Window window = page.createWindow(windowName, selectedContentType,
selectedContentURI);
+ Content content = window.getContent();
+ for (Iterator i =
selectedContentParams.entrySet().iterator();i.hasNext();)
+ {
+ Map.Entry entry = (Map.Entry)i.next();
+ String paramName = (String)entry.getKey();
+ String paramValue = (String)entry.getValue();
+ content.setParameter(paramName, paramValue);
+ }
+
+ //
+ window.setDeclaredProperty(ThemeConstants.PORTAL_PROP_REGION,
regionName);
+ window.setDeclaredProperty(ThemeConstants.PORTAL_PROP_ORDER, ""
+ Integer.MAX_VALUE);
+
+ // Sort windows
+ Collections.sort(windows, new WindowComparator());
+
+ // Add the created one
+ windows.add(window);
+
+ // Update the order states
+ for (int i = 0;i < windows.size();i++)
+ {
+ Window tmp = (Window)windows.get(i);
+ tmp.setDeclaredProperty(ThemeConstants.PORTAL_PROP_ORDER, ""
+ i);
+ }
+
+ this.windowName = "";
+ }
+ catch (DuplicatePortalObjectException unexpected)
+ {
+ unexpected.printStackTrace();
+ }
+ }
+ else
+ {
+ FacesContext faces = FacesContext.getCurrentInstance();
+ FacesMessage message = new FacesMessage(FacesMessage.SEVERITY_ERROR, "No
content was selected!", null);
+ faces.addMessage("layoutForm", message);
+ throw new AbortProcessingException();
+ }
+ }
+ else if (direction == MOVE_LEFT)
+ {
+ for (Iterator i = windows.iterator();i.hasNext();)
+ {
+ Window window = (Window)i.next();
+ if (selectedWindows.contains(window.getName()))
+ {
+ i.remove();
+ try
+ {
+ page.destroyChild(window.getName());
+ }
+ catch (NoSuchPortalObjectException ignore)
+ {
+ ignore.printStackTrace();
+ }
+ }
+ }
+ }
+
+ // Update the order states
+ for (int i = 0;i < windows.size();i++)
+ {
+ Window window = (Window)windows.get(i);
+ window.setDeclaredProperty(ThemeConstants.PORTAL_PROP_ORDER, "" + i);
+ }
+
+ //
+ assignedWindows.values.clear();
+ }
+
+ private String windowName;
+
+ public String getWindowName()
+ {
+ return windowName;
+ }
+
+ public void setWindowName(String windowName)
+ {
+ this.windowName = windowName;
+ }
+
+ /**
+ * Portlet event
+ */
+ public void assignWindow(ActionEvent event)
+ {
+ if (event instanceof PortletRenderEvent)
+ {
+ PortletRenderEvent renderEvent = (PortletRenderEvent)event;
+ Map renderParams = renderEvent.getParameterMap();
+
+ // Keep window name and region defined
+ setWindowName(((String[])renderParams.get("windowName"))[0]);
+ }
+ else if (event instanceof PortletActionEvent)
+ {
+ PortletActionEvent actionEvent = (PortletActionEvent)event;
+ Map actionParams = actionEvent.getParameterMap();
+
+ // Keep window name and region defined
+ String[] windowNames = ((String[])actionParams.get("windowName"));
+ if (windowNames != null && windowNames.length > 0)
+ {
+ setWindowName(windowNames[0]);
+ }
+
+ //
+ if (actionParams.get(CONTENT_ACTION_SELECT) != null)
+ {
+ String[] uris = (String[])actionParams.get(CONTENT_URI);
+ if (uris != null && uris.length > 0)
+ {
+ String uri = uris[0];
+
+ //
+ Map parameters = new HashMap();
+ for (Iterator i = actionParams.entrySet().iterator();i.hasNext();)
+ {
+ Map.Entry entry = (Map.Entry)i.next();
+ String name = (String)entry.getKey();
+ if (name.startsWith(CONTENT_PARAM_PREFIX))
+ {
+ String paramName = name.substring(CONTENT_PARAM_PREFIX_LENGTH);
+ String paramValue = ((String[])entry.getValue())[0];
+ parameters.put(paramName, paramValue);
+ }
+ }
+
+ //
+ this.selectedContentURI = uri;
+ this.selectedContentParameters = parameters;
+ }
+ }
+ }
+ }
+
+ /** Return the <Region>List on the selected object which must be a page. */
+ public List getRegionNames()
+ {
+ try
+ {
+ Map windows = getWindows(page);
+
+ //
+ List regions = new ArrayList(windows.keySet());
+ regions.remove("unknown");
+ Collections.sort(regions);
+
+ //
+ return regions;
+ }
+ catch (Exception e)
+ {
+ e.printStackTrace();
+
+ //
+ return Collections.EMPTY_LIST;
+ }
+ }
+
+ public List getRegionItems()
+ {
+ try
+ {
+ Map windows = getWindows(page);
+
+ // We don't want the unknown region
+ windows.remove("unknown");
+
+ //
+ ArrayList regions = new ArrayList(windows.keySet());
+ Collections.sort(regions);
+ for (int i = 0; i < regions.size();i++)
+ {
+ String regionName = (String)regions.get(i);
+ SelectItem regionItem = new SelectItem(regionName, regionName);
+ regions.set(i, regionItem);
+ }
+
+ //
+ return regions;
+ }
+ catch (Exception e)
+ {
+ e.printStackTrace();
+
+ //
+ return Collections.EMPTY_LIST;
+ }
+ }
+
+ public Map getWindowItemsMap() throws Exception
+ {
+ Map windowMap = getWindows(page);
+ for (Iterator i = windowMap.entrySet().iterator();i.hasNext();)
+ {
+ Map.Entry entry = (Map.Entry)i.next();
+ SortedSet windows = (SortedSet)entry.getValue();
+ ArrayList windowItems = new ArrayList(windows.size());
+ for (Iterator j = windows.iterator();j.hasNext();)
+ {
+ Window window = (Window)j.next();
+ SelectItem windowItem = new SelectItem();
+ windowItem.setValue(window.getName());
+ windowItem.setLabel(window.getName());
+ windowItems.add(windowItem);
+ }
+ entry.setValue(windowItems);
+ }
+ return windowMap;
+ }
+
+ /** Returns a <Region,<Window>SortedSet>Map. */
+ private Map getWindows(Page page) throws Exception
+ {
+ // Get the layout
+ String layoutId = page.getProperty(ThemeConstants.PORTAL_PROP_LAYOUT);
+ PortalLayout layout = layoutService.getLayout(layoutId, true);
+
+ //
+ LinkedHashMap windows = new LinkedHashMap();
+ for (Iterator i = layout.getLayoutInfo().getRegionNames().iterator();
i.hasNext();)
+ {
+ String region = (String)i.next();
+ windows.put(region, new TreeSet(new WindowComparator()));
+ }
+ windows.put("unknown", new TreeSet(new WindowComparator()));
+
+ //
+ for (Iterator j = page.getChildren(PortalObject.WINDOW_MASK).iterator();
j.hasNext();)
+ {
+ PortalObject window = (PortalObject)j.next();
+ String region = window.getProperty(ThemeConstants.PORTAL_PROP_REGION);
+ if (!windows.containsKey(region))
+ {
+ region = "unknown";
+ }
+ SortedSet set = (SortedSet)windows.get(region);
+ set.add(window);
+ }
+ return windows;
+ }
+
+ public static class DynamicMap implements DynamicBean
+ {
+
+ /** . */
+ private Map values = new HashMap();
+
+ public Class getType(Object propertyName) throws IllegalArgumentException
+ {
+ return List.class;
+ }
+
+ public PropertyValue getValue(Object propertyName) throws IllegalArgumentException
+ {
+ List list = (List)values.get(propertyName);
+ if (list == null)
+ {
+ list = new ArrayList();
+ values.put(propertyName, list);
+ }
+ return new PropertyValue(list);
+ }
+
+ public boolean setValue(Object propertyName, Object value) throws
IllegalArgumentException
+ {
+ values.put(propertyName, value);
+ return true;
+ }
+ }
+}
Copied: trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/conversion (from rev
7842, trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/conversion)
Deleted:
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/conversion/ContentTypeConverter.java
===================================================================
---
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/conversion/ContentTypeConverter.java 2007-07-30
12:59:36 UTC (rev 7842)
+++
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/conversion/ContentTypeConverter.java 2007-08-06
09:16:45 UTC (rev 7865)
@@ -1,47 +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.conversion;
-
-import org.jboss.portal.core.model.content.ContentType;
-
-import javax.faces.convert.Converter;
-import javax.faces.convert.ConverterException;
-import javax.faces.context.FacesContext;
-import javax.faces.component.UIComponent;
-
-/**
- * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 1.1 $
- */
-public class ContentTypeConverter implements Converter
-{
- public Object getAsObject(FacesContext facesContext, UIComponent uiComponent, String
string) throws ConverterException
- {
- return string == null ? null : ContentType.create(string);
- }
-
- public String getAsString(FacesContext facesContext, UIComponent uiComponent, Object
object) throws ConverterException
- {
- return object == null ? null : object.toString();
- }
-}
Copied:
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/conversion/ContentTypeConverter.java
(from rev 7842,
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/conversion/ContentTypeConverter.java)
===================================================================
---
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/conversion/ContentTypeConverter.java
(rev 0)
+++
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/conversion/ContentTypeConverter.java 2007-08-06
09:16:45 UTC (rev 7865)
@@ -0,0 +1,47 @@
+/******************************************************************************
+ * 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.conversion;
+
+import org.jboss.portal.core.model.content.ContentType;
+
+import javax.faces.convert.Converter;
+import javax.faces.convert.ConverterException;
+import javax.faces.context.FacesContext;
+import javax.faces.component.UIComponent;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class ContentTypeConverter implements Converter
+{
+ public Object getAsObject(FacesContext facesContext, UIComponent uiComponent, String
string) throws ConverterException
+ {
+ return string == null ? null : ContentType.create(string);
+ }
+
+ public String getAsString(FacesContext facesContext, UIComponent uiComponent, Object
object) throws ConverterException
+ {
+ return object == null ? null : object.toString();
+ }
+}
Deleted:
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/conversion/PortalObjectIdConverter.java
===================================================================
---
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/conversion/PortalObjectIdConverter.java 2007-07-30
12:59:36 UTC (rev 7842)
+++
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/conversion/PortalObjectIdConverter.java 2007-08-06
09:16:45 UTC (rev 7865)
@@ -1,48 +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.conversion;
-
-import org.jboss.portal.core.model.portal.PortalObjectId;
-import org.jboss.portal.core.model.portal.PortalObjectPath;
-
-import javax.faces.convert.Converter;
-import javax.faces.convert.ConverterException;
-import javax.faces.component.UIComponent;
-import javax.faces.context.FacesContext;
-
-/**
- * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 1.1 $
- */
-public class PortalObjectIdConverter implements Converter
-{
- public Object getAsObject(FacesContext facesContext, UIComponent uiComponent, String
string) throws ConverterException
- {
- return string == null ? null : PortalObjectId.parse(string,
PortalObjectPath.LEGACY_BASE64_FORMAT);
- }
-
- public String getAsString(FacesContext facesContext, UIComponent uiComponent, Object
object) throws ConverterException
- {
- return object == null ? null :
((PortalObjectId)object).toString(PortalObjectPath.LEGACY_BASE64_FORMAT);
- }
-}
Copied:
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/conversion/PortalObjectIdConverter.java
(from rev 7842,
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/conversion/PortalObjectIdConverter.java)
===================================================================
---
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/conversion/PortalObjectIdConverter.java
(rev 0)
+++
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/conversion/PortalObjectIdConverter.java 2007-08-06
09:16:45 UTC (rev 7865)
@@ -0,0 +1,48 @@
+/******************************************************************************
+ * 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.conversion;
+
+import org.jboss.portal.core.model.portal.PortalObjectId;
+import org.jboss.portal.core.model.portal.PortalObjectPath;
+
+import javax.faces.convert.Converter;
+import javax.faces.convert.ConverterException;
+import javax.faces.component.UIComponent;
+import javax.faces.context.FacesContext;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class PortalObjectIdConverter implements Converter
+{
+ public Object getAsObject(FacesContext facesContext, UIComponent uiComponent, String
string) throws ConverterException
+ {
+ return string == null ? null : PortalObjectId.parse(string,
PortalObjectPath.LEGACY_BASE64_FORMAT);
+ }
+
+ public String getAsString(FacesContext facesContext, UIComponent uiComponent, Object
object) throws ConverterException
+ {
+ return object == null ? null :
((PortalObjectId)object).toString(PortalObjectPath.LEGACY_BASE64_FORMAT);
+ }
+}
Copied: trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/dashboard (from rev 7842,
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/dashboard)
Deleted:
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-07-30
12:59:36 UTC (rev 7842)
+++
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/dashboard/DashboardBean.java 2007-08-06
09:16:45 UTC (rev 7865)
@@ -1,248 +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.dashboard;
-
-import org.jboss.portal.common.util.IteratorStatus;
-import org.jboss.portal.core.admin.ui.actions.AddPageAction;
-import org.jboss.portal.core.admin.ui.common.PageManagerBean;
-import org.jboss.portal.core.admin.ui.portlet.PortletDefinitionInvoker;
-import org.jboss.portal.core.model.instance.InstanceContainer;
-import org.jboss.portal.core.model.portal.NoSuchPortalObjectException;
-import org.jboss.portal.core.model.portal.Page;
-import org.jboss.portal.core.model.portal.Portal;
-import org.jboss.portal.core.model.portal.PortalObject;
-import org.jboss.portal.core.model.portal.PortalObjectContainer;
-import org.jboss.portal.core.model.portal.PortalObjectId;
-import org.jboss.portal.core.model.portal.PortalObjectPath;
-import org.jboss.portal.theme.LayoutService;
-import org.jboss.portal.theme.ThemeConstants;
-import org.jboss.portal.theme.ThemeService;
-
-import javax.faces.context.FacesContext;
-import javax.faces.model.SelectItem;
-import java.util.Collection;
-
-/**
- * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 1.1 $
- */
-public class DashboardBean implements AddPageAction.Listener
-{
-
- /** . */
- private static final PortalObjectId dashboardId =
PortalObjectId.parse("dashboard"
- + PortalObjectId.NAMESPACE_SEPARATOR +
PortalObjectPath.CanonicalFormat.PATH_SEPARATOR, PortalObjectPath.CANONICAL_FORMAT);
-
- // Wired services
-
- /** . */
- public PortalObjectContainer portalObjectContainer;
-
- /** . */
- public LayoutService layoutService;
-
- /** . */
- public ThemeService themeService;
-
- /** . */
- public InstanceContainer instanceContainer;
-
- // Navigational state
-
- /** . */
- public String selectedPageName;
-
- // Runtime fields
-
- /** . */
- public Portal userPortal;
-
- /** . */
- public String selectedPageTheme;
-
- /** . */
- public String selectedPageLayout;
-
- /** . */
- public PageManagerBean pageManager;
-
- /** . */
- public SelectItem[] pageItems;
-
- /** . */
- public boolean selectePageIsDefault;
-
- //
-
- public void pageCreated(Page page)
- {
- // Select page to show
- selectedPageName = page.getName();
- }
-
- public void actionRefresh()
- {
- refresh();
- }
-
- public Page getSelectedPage()
- {
- return pageManager.page;
- }
-
- private void refresh()
- {
- // Create page manager if it doees not exit
- if (pageManager == null)
- {
- pageManager = new PageManagerBean(layoutService, new
PortletDefinitionInvoker(instanceContainer));
- }
-
- // Get user name
- String userId =
FacesContext.getCurrentInstance().getExternalContext().getRemoteUser();
-
- // Load portal
- userPortal =
(Portal)portalObjectContainer.getObject(dashboardId).getChild(userId);
-
- if (userPortal == null)
- {
- return;
- }
-
- // Page for editting
- if (selectedPageName != null)
- {
- pageManager.page = userPortal.getPage(selectedPageName);
- }
- if (pageManager.page == null)
- {
- pageManager.page = userPortal.getDefaultPage();
- selectedPageName = pageManager.page.getName();
- }
-
- //
- String defaultPageName =
pageManager.page.getProperty(PortalObject.PORTAL_PROP_DEFAULT_OBJECT_NAME);
- if (defaultPageName == null)
- {
- defaultPageName = PortalObject.DEFAULT_OBJECT_NAME;
- }
- selectePageIsDefault = selectedPageName.equals(defaultPageName);
-
- //
- Collection pages = userPortal.getChildren(PortalObject.PAGE_MASK);
- pageItems = new SelectItem[pages.size()];
- for (IteratorStatus i = new IteratorStatus(pages); i.hasNext();)
- {
- PortalObject object = (PortalObject)i.next();
- SelectItem item = new SelectItem();
- item.setValue(object.getName());
- item.setLabel(object.getName());
- pageItems[i.getIndex()] = item;
- }
- }
-
- public void renderRefresh()
- {
- refresh();
-
- if (userPortal != null)
- {
- //
- selectedPageTheme =
userPortal.getDeclaredProperty(ThemeConstants.PORTAL_PROP_THEME);
- if (selectedPageTheme == null)
- {
- selectedPageTheme = "";
- }
-
- //
- selectedPageLayout =
userPortal.getDeclaredProperty(ThemeConstants.PORTAL_PROP_LAYOUT);
- if (selectedPageLayout == null)
- {
- selectedPageLayout = "";
- }
- }
- }
-
- public void updateTheme()
- {
- userPortal.setDeclaredProperty(ThemeConstants.PORTAL_PROP_THEME,
"".equals(selectedPageTheme) ? null : selectedPageTheme);
- }
-
- public void updateLayout()
- {
- userPortal.setDeclaredProperty(ThemeConstants.PORTAL_PROP_LAYOUT,
"".equals(selectedPageLayout) ? null : selectedPageLayout);
- }
-
- public void destroyPage()
- {
- try
- {
- userPortal.destroyChild(selectedPageName);
- selectedPageName = null;
- }
- catch (NoSuchPortalObjectException e)
- {
- e.printStackTrace();
- }
- }
-
- public PortalObjectContainer getPortalObjectContainer()
- {
- return portalObjectContainer;
- }
-
- public void setPortalObjectContainer(PortalObjectContainer portalObjectContainer)
- {
- this.portalObjectContainer = portalObjectContainer;
- }
-
- public LayoutService getLayoutService()
- {
- return layoutService;
- }
-
- public void setLayoutService(LayoutService layoutService)
- {
- this.layoutService = layoutService;
- }
-
- public ThemeService getThemeService()
- {
- return themeService;
- }
-
- public void setThemeService(ThemeService themeService)
- {
- this.themeService = themeService;
- }
-
- public InstanceContainer getInstanceContainer()
- {
- return instanceContainer;
- }
-
- public void setInstanceContainer(InstanceContainer instanceContainer)
- {
- this.instanceContainer = instanceContainer;
- }
-}
Copied:
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/dashboard/DashboardBean.java
(from rev 7842,
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
(rev 0)
+++
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/dashboard/DashboardBean.java 2007-08-06
09:16:45 UTC (rev 7865)
@@ -0,0 +1,248 @@
+/******************************************************************************
+ * 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.dashboard;
+
+import org.jboss.portal.common.util.IteratorStatus;
+import org.jboss.portal.core.admin.ui.actions.AddPageAction;
+import org.jboss.portal.core.admin.ui.common.PageManagerBean;
+import org.jboss.portal.core.admin.ui.portlet.PortletDefinitionInvoker;
+import org.jboss.portal.core.model.instance.InstanceContainer;
+import org.jboss.portal.core.model.portal.NoSuchPortalObjectException;
+import org.jboss.portal.core.model.portal.Page;
+import org.jboss.portal.core.model.portal.Portal;
+import org.jboss.portal.core.model.portal.PortalObject;
+import org.jboss.portal.core.model.portal.PortalObjectContainer;
+import org.jboss.portal.core.model.portal.PortalObjectId;
+import org.jboss.portal.core.model.portal.PortalObjectPath;
+import org.jboss.portal.theme.LayoutService;
+import org.jboss.portal.theme.ThemeConstants;
+import org.jboss.portal.theme.ThemeService;
+
+import javax.faces.context.FacesContext;
+import javax.faces.model.SelectItem;
+import java.util.Collection;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class DashboardBean implements AddPageAction.Listener
+{
+
+ /** . */
+ private static final PortalObjectId dashboardId =
PortalObjectId.parse("dashboard"
+ + PortalObjectId.NAMESPACE_SEPARATOR +
PortalObjectPath.CanonicalFormat.PATH_SEPARATOR, PortalObjectPath.CANONICAL_FORMAT);
+
+ // Wired services
+
+ /** . */
+ public PortalObjectContainer portalObjectContainer;
+
+ /** . */
+ public LayoutService layoutService;
+
+ /** . */
+ public ThemeService themeService;
+
+ /** . */
+ public InstanceContainer instanceContainer;
+
+ // Navigational state
+
+ /** . */
+ public String selectedPageName;
+
+ // Runtime fields
+
+ /** . */
+ public Portal userPortal;
+
+ /** . */
+ public String selectedPageTheme;
+
+ /** . */
+ public String selectedPageLayout;
+
+ /** . */
+ public PageManagerBean pageManager;
+
+ /** . */
+ public SelectItem[] pageItems;
+
+ /** . */
+ public boolean selectePageIsDefault;
+
+ //
+
+ public void pageCreated(Page page)
+ {
+ // Select page to show
+ selectedPageName = page.getName();
+ }
+
+ public void actionRefresh()
+ {
+ refresh();
+ }
+
+ public Page getSelectedPage()
+ {
+ return pageManager.page;
+ }
+
+ private void refresh()
+ {
+ // Create page manager if it doees not exit
+ if (pageManager == null)
+ {
+ pageManager = new PageManagerBean(layoutService, new
PortletDefinitionInvoker(instanceContainer));
+ }
+
+ // Get user name
+ String userId =
FacesContext.getCurrentInstance().getExternalContext().getRemoteUser();
+
+ // Load portal
+ userPortal =
(Portal)portalObjectContainer.getObject(dashboardId).getChild(userId);
+
+ if (userPortal == null)
+ {
+ return;
+ }
+
+ // Page for editting
+ if (selectedPageName != null)
+ {
+ pageManager.page = userPortal.getPage(selectedPageName);
+ }
+ if (pageManager.page == null)
+ {
+ pageManager.page = userPortal.getDefaultPage();
+ selectedPageName = pageManager.page.getName();
+ }
+
+ //
+ String defaultPageName =
pageManager.page.getProperty(PortalObject.PORTAL_PROP_DEFAULT_OBJECT_NAME);
+ if (defaultPageName == null)
+ {
+ defaultPageName = PortalObject.DEFAULT_OBJECT_NAME;
+ }
+ selectePageIsDefault = selectedPageName.equals(defaultPageName);
+
+ //
+ Collection pages = userPortal.getChildren(PortalObject.PAGE_MASK);
+ pageItems = new SelectItem[pages.size()];
+ for (IteratorStatus i = new IteratorStatus(pages); i.hasNext();)
+ {
+ PortalObject object = (PortalObject)i.next();
+ SelectItem item = new SelectItem();
+ item.setValue(object.getName());
+ item.setLabel(object.getName());
+ pageItems[i.getIndex()] = item;
+ }
+ }
+
+ public void renderRefresh()
+ {
+ refresh();
+
+ if (userPortal != null)
+ {
+ //
+ selectedPageTheme =
userPortal.getDeclaredProperty(ThemeConstants.PORTAL_PROP_THEME);
+ if (selectedPageTheme == null)
+ {
+ selectedPageTheme = "";
+ }
+
+ //
+ selectedPageLayout =
userPortal.getDeclaredProperty(ThemeConstants.PORTAL_PROP_LAYOUT);
+ if (selectedPageLayout == null)
+ {
+ selectedPageLayout = "";
+ }
+ }
+ }
+
+ public void updateTheme()
+ {
+ userPortal.setDeclaredProperty(ThemeConstants.PORTAL_PROP_THEME,
"".equals(selectedPageTheme) ? null : selectedPageTheme);
+ }
+
+ public void updateLayout()
+ {
+ userPortal.setDeclaredProperty(ThemeConstants.PORTAL_PROP_LAYOUT,
"".equals(selectedPageLayout) ? null : selectedPageLayout);
+ }
+
+ public void destroyPage()
+ {
+ try
+ {
+ userPortal.destroyChild(selectedPageName);
+ selectedPageName = null;
+ }
+ catch (NoSuchPortalObjectException e)
+ {
+ e.printStackTrace();
+ }
+ }
+
+ public PortalObjectContainer getPortalObjectContainer()
+ {
+ return portalObjectContainer;
+ }
+
+ public void setPortalObjectContainer(PortalObjectContainer portalObjectContainer)
+ {
+ this.portalObjectContainer = portalObjectContainer;
+ }
+
+ public LayoutService getLayoutService()
+ {
+ return layoutService;
+ }
+
+ public void setLayoutService(LayoutService layoutService)
+ {
+ this.layoutService = layoutService;
+ }
+
+ public ThemeService getThemeService()
+ {
+ return themeService;
+ }
+
+ public void setThemeService(ThemeService themeService)
+ {
+ this.themeService = themeService;
+ }
+
+ public InstanceContainer getInstanceContainer()
+ {
+ return instanceContainer;
+ }
+
+ public void setInstanceContainer(InstanceContainer instanceContainer)
+ {
+ this.instanceContainer = instanceContainer;
+ }
+}
Copied: trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/portlet (from rev 7842,
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/portlet)
Deleted:
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/portlet/PortletDefinitionInvoker.java
===================================================================
---
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/portlet/PortletDefinitionInvoker.java 2007-07-30
12:59:36 UTC (rev 7842)
+++
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/portlet/PortletDefinitionInvoker.java 2007-08-06
09:16:45 UTC (rev 7865)
@@ -1,174 +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.portlet;
-
-import org.jboss.portal.portlet.PortletInvoker;
-import org.jboss.portal.portlet.PortletInvokerException;
-import org.jboss.portal.portlet.Portlet;
-import org.jboss.portal.portlet.PortletContext;
-import org.jboss.portal.portlet.NoSuchPortletException;
-import org.jboss.portal.portlet.info.PortletInfo;
-import org.jboss.portal.portlet.state.PropertyMap;
-import org.jboss.portal.portlet.state.PropertyChange;
-import org.jboss.portal.portlet.invocation.response.PortletInvocationResponse;
-import org.jboss.portal.portlet.invocation.PortletInvocation;
-import org.jboss.portal.core.model.instance.InstanceContainer;
-import org.jboss.portal.core.model.instance.Instance;
-import org.jboss.portal.common.invocation.InvocationException;
-
-import java.util.Set;
-import java.util.List;
-import java.util.Iterator;
-import java.util.Collection;
-import java.util.HashSet;
-
-/**
- * Adapt the instance container as a portlet invoker. Will be removed later when
- * migrating the instance container to the portlet package will be done in a
- * suitable form.
- *
- * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 1.1 $
- */
-public class PortletDefinitionInvoker implements PortletInvoker
-{
-
- /** . */
- private InstanceContainer instanceContainer;
-
- public PortletDefinitionInvoker(InstanceContainer instanceContainer)
- {
- if (instanceContainer == null)
- {
- throw new IllegalArgumentException();
- }
- this.instanceContainer = instanceContainer;
- }
-
- public Set getPortlets() throws PortletInvokerException
- {
- Collection defs = instanceContainer.getDefinitions();
- Set portlets = new HashSet(defs.size());
- for (Iterator i = defs.iterator();i.hasNext();)
- {
- Instance instance = (Instance)i.next();
- portlets.add(new PortletDefinition(instance));
- }
- return portlets;
- }
-
- public Portlet getPortlet(PortletContext portletContext) throws
IllegalArgumentException, PortletInvokerException
- {
- if (portletContext == null)
- {
- throw new IllegalArgumentException();
- }
- String instanceId = portletContext.getId();
- Instance instance = instanceContainer.getDefinition(instanceId);
- if (instance == null)
- {
- throw new NoSuchPortletException(instanceId);
- }
- return new PortletDefinition(instance);
- }
-
- public PortletInvocationResponse invoke(PortletInvocation invocation) throws
IllegalArgumentException, PortletInvokerException
- {
- if (invocation == null)
- {
- throw new IllegalArgumentException();
- }
- PortletContext portletContext = invocation.getTarget();
- if (portletContext == null)
- {
- throw new InvocationException("No portlet context provided");
- }
- String instanceId = portletContext.getId();
- Instance instance = instanceContainer.getDefinition(instanceId);
- if (instance == null)
- {
- throw new NoSuchPortletException(instanceId);
- }
- return instance.invoke(invocation);
- }
-
- public PortletContext createClone(PortletContext portletContext) throws
IllegalArgumentException, PortletInvokerException, UnsupportedOperationException
- {
- throw new UnsupportedOperationException();
- }
-
- public List destroyClones(List portletContexts) throws IllegalArgumentException,
PortletInvokerException, UnsupportedOperationException
- {
- throw new UnsupportedOperationException();
- }
-
- public PropertyMap getProperties(PortletContext portletContext, Set keys) throws
IllegalArgumentException, PortletInvokerException, UnsupportedOperationException
- {
- throw new UnsupportedOperationException();
- }
-
- public PropertyMap getProperties(PortletContext portletContext) throws
IllegalArgumentException, PortletInvokerException, UnsupportedOperationException
- {
- throw new UnsupportedOperationException();
- }
-
- public PortletContext setProperties(PortletContext portletContext, PropertyChange[]
changes) throws IllegalArgumentException, PortletInvokerException,
UnsupportedOperationException
- {
- throw new UnsupportedOperationException();
- }
-
- private static final class PortletDefinition implements Portlet
- {
-
- /** . */
- private final PortletContext ctx;
-
- /** . */
- private final PortletInfo info;
-
- /** . */
- private final boolean remote;
-
- public PortletDefinition(Instance instance) throws PortletInvokerException
- {
- this.ctx = PortletContext.createPortletContext(instance.getId());
- this.info = instance.getPortlet().getInfo();
- this.remote = instance.getPortlet().isRemote();
- }
-
- public PortletContext getContext()
- {
- return ctx;
- }
-
- public PortletInfo getInfo()
- {
- return info;
- }
-
- public boolean isRemote()
- {
- return remote;
- }
- }
-}
Copied:
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/portlet/PortletDefinitionInvoker.java
(from rev 7842,
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/portlet/PortletDefinitionInvoker.java)
===================================================================
---
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/portlet/PortletDefinitionInvoker.java
(rev 0)
+++
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/portlet/PortletDefinitionInvoker.java 2007-08-06
09:16:45 UTC (rev 7865)
@@ -0,0 +1,174 @@
+/******************************************************************************
+ * 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.portlet;
+
+import org.jboss.portal.portlet.PortletInvoker;
+import org.jboss.portal.portlet.PortletInvokerException;
+import org.jboss.portal.portlet.Portlet;
+import org.jboss.portal.portlet.PortletContext;
+import org.jboss.portal.portlet.NoSuchPortletException;
+import org.jboss.portal.portlet.info.PortletInfo;
+import org.jboss.portal.portlet.state.PropertyMap;
+import org.jboss.portal.portlet.state.PropertyChange;
+import org.jboss.portal.portlet.invocation.response.PortletInvocationResponse;
+import org.jboss.portal.portlet.invocation.PortletInvocation;
+import org.jboss.portal.core.model.instance.InstanceContainer;
+import org.jboss.portal.core.model.instance.Instance;
+import org.jboss.portal.common.invocation.InvocationException;
+
+import java.util.Set;
+import java.util.List;
+import java.util.Iterator;
+import java.util.Collection;
+import java.util.HashSet;
+
+/**
+ * Adapt the instance container as a portlet invoker. Will be removed later when
+ * migrating the instance container to the portlet package will be done in a
+ * suitable form.
+ *
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class PortletDefinitionInvoker implements PortletInvoker
+{
+
+ /** . */
+ private InstanceContainer instanceContainer;
+
+ public PortletDefinitionInvoker(InstanceContainer instanceContainer)
+ {
+ if (instanceContainer == null)
+ {
+ throw new IllegalArgumentException();
+ }
+ this.instanceContainer = instanceContainer;
+ }
+
+ public Set getPortlets() throws PortletInvokerException
+ {
+ Collection defs = instanceContainer.getDefinitions();
+ Set portlets = new HashSet(defs.size());
+ for (Iterator i = defs.iterator();i.hasNext();)
+ {
+ Instance instance = (Instance)i.next();
+ portlets.add(new PortletDefinition(instance));
+ }
+ return portlets;
+ }
+
+ public Portlet getPortlet(PortletContext portletContext) throws
IllegalArgumentException, PortletInvokerException
+ {
+ if (portletContext == null)
+ {
+ throw new IllegalArgumentException();
+ }
+ String instanceId = portletContext.getId();
+ Instance instance = instanceContainer.getDefinition(instanceId);
+ if (instance == null)
+ {
+ throw new NoSuchPortletException(instanceId);
+ }
+ return new PortletDefinition(instance);
+ }
+
+ public PortletInvocationResponse invoke(PortletInvocation invocation) throws
IllegalArgumentException, PortletInvokerException
+ {
+ if (invocation == null)
+ {
+ throw new IllegalArgumentException();
+ }
+ PortletContext portletContext = invocation.getTarget();
+ if (portletContext == null)
+ {
+ throw new InvocationException("No portlet context provided");
+ }
+ String instanceId = portletContext.getId();
+ Instance instance = instanceContainer.getDefinition(instanceId);
+ if (instance == null)
+ {
+ throw new NoSuchPortletException(instanceId);
+ }
+ return instance.invoke(invocation);
+ }
+
+ public PortletContext createClone(PortletContext portletContext) throws
IllegalArgumentException, PortletInvokerException, UnsupportedOperationException
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ public List destroyClones(List portletContexts) throws IllegalArgumentException,
PortletInvokerException, UnsupportedOperationException
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ public PropertyMap getProperties(PortletContext portletContext, Set keys) throws
IllegalArgumentException, PortletInvokerException, UnsupportedOperationException
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ public PropertyMap getProperties(PortletContext portletContext) throws
IllegalArgumentException, PortletInvokerException, UnsupportedOperationException
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ public PortletContext setProperties(PortletContext portletContext, PropertyChange[]
changes) throws IllegalArgumentException, PortletInvokerException,
UnsupportedOperationException
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ private static final class PortletDefinition implements Portlet
+ {
+
+ /** . */
+ private final PortletContext ctx;
+
+ /** . */
+ private final PortletInfo info;
+
+ /** . */
+ private final boolean remote;
+
+ public PortletDefinition(Instance instance) throws PortletInvokerException
+ {
+ this.ctx = PortletContext.createPortletContext(instance.getId());
+ this.info = instance.getPortlet().getInfo();
+ this.remote = instance.getPortlet().isRemote();
+ }
+
+ public PortletContext getContext()
+ {
+ return ctx;
+ }
+
+ public PortletInfo getInfo()
+ {
+ return info;
+ }
+
+ public boolean isRemote()
+ {
+ return remote;
+ }
+ }
+}
Copied: trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/wizard (from rev 7842,
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/wizard)
Deleted:
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/wizard/NewWindowWizard.java
===================================================================
---
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/wizard/NewWindowWizard.java 2007-07-30
12:59:36 UTC (rev 7842)
+++
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/wizard/NewWindowWizard.java 2007-08-06
09:16:45 UTC (rev 7865)
@@ -1,396 +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.wizard;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.List;
-import java.util.Set;
-
-import javax.faces.context.FacesContext;
-
-import org.jboss.portal.core.model.content.ContentType;
-import org.jboss.portal.core.model.instance.Instance;
-import org.jboss.portal.core.model.instance.InstanceContainer;
-import org.jboss.portal.core.model.portal.Page;
-import org.jboss.portal.core.model.portal.Portal;
-import org.jboss.portal.core.model.portal.PortalObject;
-import org.jboss.portal.core.model.portal.PortalObjectContainer;
-import org.jboss.portal.core.model.portal.PortalObjectId;
-import org.jboss.portal.core.model.portal.Window;
-import org.jboss.portal.core.model.portal.PortalObjectPath;
-import org.jboss.portal.portlet.Portlet;
-import org.jboss.portal.portlet.PortletContext;
-import org.jboss.portal.portlet.PortletInvoker;
-import org.jboss.portal.portlet.PortletInvokerException;
-import org.jboss.portal.portlet.federation.FederatingPortletInvoker;
-import org.jboss.portal.security.AuthorizationDomainRegistry;
-import org.jboss.portal.security.RoleSecurityBinding;
-import org.jboss.portal.security.SecurityConstants;
-import org.jboss.portal.security.spi.provider.DomainConfigurator;
-import org.jboss.portal.theme.LayoutService;
-import org.jboss.portal.theme.PortalLayout;
-import org.jboss.portal.theme.ThemeConstants;
-
-/**
- * @author <a href="mailto:theute@jboss.org">Thomas Heute</a>
- * @version $Revision$
- */
-public class NewWindowWizard
-{
-
- private List steps;
- private int currentStep;
- private FederatingPortletInvoker federatingPortletInvoker;
- private String selectedPortletId;
- private String selectedPortalId;
- private String selectedPageId;
- private String selectedRegionId;
- private String selectedPortletInvokerId;
- private String selectedParentPageId;
- private PortalObjectContainer portalObjectContainer;
- private InstanceContainer instanceContainer;
- private LayoutService layoutService;
- private AuthorizationDomainRegistry authorizationDomainRegistry;
-
- public NewWindowWizard()
- {
- steps = new ArrayList();
- steps.add("selectPortlet");
- steps.add("selectPortal");
- steps.add("selectPage");
- steps.add("selectRegion");
- steps.add("newWindowWizardConfirm");
- currentStep = 0;
- }
-
- public String next()
- {
- currentStep++;
- return (String)steps.get(currentStep);
- }
-
- public String goTo()
- {
- FacesContext ctx = FacesContext.getCurrentInstance();
- currentStep =
Integer.parseInt((String)ctx.getExternalContext().getRequestParameterMap().get("step"));
- return (String)steps.get(currentStep);
- }
-
- public String previous()
- {
- currentStep--;
- return (String)steps.get(currentStep);
- }
-
- public String selectPortlet()
- {
- FacesContext ctx = FacesContext.getCurrentInstance();
- selectedPortletId =
(String)ctx.getExternalContext().getRequestParameterMap().get("id");
- selectedPortletInvokerId =
(String)ctx.getExternalContext().getRequestParameterMap().get("portletInvokerId");
- currentStep = 1;
- return (String)steps.get(currentStep);
- }
-
- public String selectPortal()
- {
- FacesContext ctx = FacesContext.getCurrentInstance();
- selectedPortalId =
(String)ctx.getExternalContext().getRequestParameterMap().get("id");
- currentStep = 2;
- selectedPageId = null;
- selectedRegionId = null;
- selectedParentPageId = selectedPortalId;
- return (String)steps.get(currentStep);
- }
-
- public String selectPage()
- {
- FacesContext ctx = FacesContext.getCurrentInstance();
- selectedPageId =
(String)ctx.getExternalContext().getRequestParameterMap().get("id");
- currentStep = 3;
- selectedRegionId = null;
- return (String)steps.get(currentStep);
- }
-
- public String selectParentPage()
- {
- FacesContext ctx = FacesContext.getCurrentInstance();
- selectedParentPageId =
(String)ctx.getExternalContext().getRequestParameterMap().get("id");
- currentStep = 2;
- return (String)steps.get(currentStep);
- }
-
- public String up()
- {
- FacesContext ctx = FacesContext.getCurrentInstance();
- String id =
(String)ctx.getExternalContext().getRequestParameterMap().get("id");
- Page page = (Page)getObjectFromId(id);
- selectedParentPageId =
page.getParent().getId().toString(PortalObjectPath.LEGACY_BASE64_FORMAT);
- currentStep = 2;
- return (String)steps.get(currentStep);
- }
-
- public String selectRegion()
- {
- FacesContext ctx = FacesContext.getCurrentInstance();
- selectedRegionId =
(String)ctx.getExternalContext().getRequestParameterMap().get("name");
- currentStep = 4;
- return (String)steps.get(currentStep);
- }
-
- public Portlet getSelectedPortlet()
- {
- PortletInvoker portletInvoker =
federatingPortletInvoker.getFederatedInvoker(selectedPortletInvokerId);
- try
- {
- Portlet selectedPortlet =
portletInvoker.getPortlet(PortletContext.createPortletContext(selectedPortletId));
- return selectedPortlet;
- }
- catch (IllegalArgumentException e)
- {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
- catch (PortletInvokerException e)
- {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
- return null;
- }
-
- public Page getSelectedPage()
- {
- return (Page)getObjectFromId(selectedPageId);
- }
-
- public PortalObject getSelectedParentPage()
- {
- return (PortalObject)getObjectFromId(selectedParentPageId);
- }
-
- public Portal getSelectedPortal()
- {
- return (Portal)getObjectFromId(selectedPortalId);
- }
-
- public PortalObject getObjectFromId(String id)
- {
- PortalObjectId objectId = PortalObjectId.parse(id,
PortalObjectPath.LEGACY_BASE64_FORMAT);
- return getObjectFromId(objectId);
- }
-
- public PortalObject getObjectFromId(PortalObjectId id)
- {
- return portalObjectContainer.getObject(id);
- }
-
- public List getPortals()
- {
- PortalObject root = portalObjectContainer.getContext();
- return new ArrayList(root.getChildren(PortalObject.PORTAL_MASK));
- }
-
-
- public List getPages()
- {
- if (selectedParentPageId != null)
- {
- Collection result =
getSelectedParentPage().getChildren(PortalObject.PAGE_MASK);
- if (result.size() != 0)
- {
- return new ArrayList(result);
- }
- else
- {
- return new
ArrayList(getSelectedPage().getParent().getChildren(PortalObject.PAGE_MASK));
- }
- }
- else
- {
- return new ArrayList(getSelectedPortal().getChildren(PortalObject.PAGE_MASK));
- }
- }
-
- public String createWindow()
- {
- Portlet portlet = getSelectedPortlet();
- InstanceContainer container = instanceContainer;
- int id = container.getDefinitions().size();
- String instanceId = "wizardInstance_" + id;
- String windowId = "wizardWindow_" + id;
- try
- {
- if ((container.getDefinition(instanceId) == null) &&
(getSelectedPage().getWindow(windowId) == null))
- {
- Instance instance = container.createDefinition(instanceId,
portlet.getContext().getId());
-
- //
- DomainConfigurator configurator =
authorizationDomainRegistry.getDomain("instance").getConfigurator();
- Set constraints = Collections.singleton(new
RoleSecurityBinding("view", SecurityConstants.UNCHECKED_ROLE_NAME));
- configurator.setSecurityBindings(instance.getId(), constraints);
-
- Window window = getSelectedPage().createWindow(windowId, ContentType.PORTLET,
instanceId);
- window.setDeclaredProperty(ThemeConstants.PORTAL_PROP_REGION,
getSelectedRegionId());
- window.setDeclaredProperty(ThemeConstants.PORTAL_PROP_ORDER, "" +
Integer.MAX_VALUE);
-
- return reset();
- }
- }
- catch (Exception e)
- {
- e.printStackTrace();
- }
- return null;
- }
-
- public String cancel()
- {
- return reset();
- }
-
- public String reset()
- {
- selectedPortletId = null;
- selectedPortalId = null;
- selectedPageId = null;
- selectedRegionId = null;
- selectedPortletInvokerId = null;
- selectedParentPageId = null;
- currentStep = 0;
- return "wizardMode";
- }
-
- public List getRegions()
- {
- Page page = getSelectedPage();
- String layoutId = page.getProperty(ThemeConstants.PORTAL_PROP_LAYOUT);
- PortalLayout layout = layoutService.getLayout(layoutId, false);
- return layout.getLayoutInfo().getRegionNames();
- }
-
- public String getSelectedPortletId()
- {
- return selectedPortletId;
- }
-
- public int getCurrentStep()
- {
- return currentStep;
- }
-
- public String getSelectedPortalId()
- {
- return selectedPortalId;
- }
-
- public String getSelectedPageId()
- {
- return selectedPageId;
- }
-
- public String getSelectedParentPageId()
- {
- return selectedParentPageId;
- }
-
- public String getSelectedRegionId()
- {
- return selectedRegionId;
- }
-
- public FederatingPortletInvoker getFederatingPortletInvoker()
- {
- return federatingPortletInvoker;
- }
-
- public void setFederatingPortletInvoker(FederatingPortletInvoker
federatingPortletInvoker)
- {
- this.federatingPortletInvoker = federatingPortletInvoker;
- }
-
- public PortalObjectContainer getPortalObjectContainer()
- {
- return portalObjectContainer;
- }
-
- public void setPortalObjectContainer(PortalObjectContainer portalObjectContainer)
- {
- this.portalObjectContainer = portalObjectContainer;
- }
-
- public LayoutService getLayoutService()
- {
- return layoutService;
- }
-
- public void setLayoutService(LayoutService layoutService)
- {
- this.layoutService = layoutService;
- }
-
- public InstanceContainer getInstanceContainer()
- {
- return instanceContainer;
- }
-
- public void setInstanceContainer(InstanceContainer instanceContainer)
- {
- this.instanceContainer = instanceContainer;
- }
-
- public AuthorizationDomainRegistry getAuthorizationDomainRegistry()
- {
- return authorizationDomainRegistry;
- }
-
- public void setAuthorizationDomainRegistry(AuthorizationDomainRegistry
authorizationDomainRegistry)
- {
- this.authorizationDomainRegistry = authorizationDomainRegistry;
- }
-
- public boolean[] getEnabled()
- {
- boolean[] result = new boolean[steps.size()];
- result[0] = true;
- if (selectedPortletId != null)
- {
- result[1] = true;
- }
- if (selectedPortalId != null)
- {
- result[2] = true;
- }
- if (selectedPageId != null)
- {
- result[3] = true;
- }
- if (selectedRegionId != null)
- {
- result[4] = true;
- }
- return result;
- }
-
-}
Copied:
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/wizard/NewWindowWizard.java (from
rev 7842,
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/wizard/NewWindowWizard.java)
===================================================================
--- trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/wizard/NewWindowWizard.java
(rev 0)
+++
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/wizard/NewWindowWizard.java 2007-08-06
09:16:45 UTC (rev 7865)
@@ -0,0 +1,396 @@
+/******************************************************************************
+ * 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.wizard;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.List;
+import java.util.Set;
+
+import javax.faces.context.FacesContext;
+
+import org.jboss.portal.core.model.content.ContentType;
+import org.jboss.portal.core.model.instance.Instance;
+import org.jboss.portal.core.model.instance.InstanceContainer;
+import org.jboss.portal.core.model.portal.Page;
+import org.jboss.portal.core.model.portal.Portal;
+import org.jboss.portal.core.model.portal.PortalObject;
+import org.jboss.portal.core.model.portal.PortalObjectContainer;
+import org.jboss.portal.core.model.portal.PortalObjectId;
+import org.jboss.portal.core.model.portal.Window;
+import org.jboss.portal.core.model.portal.PortalObjectPath;
+import org.jboss.portal.portlet.Portlet;
+import org.jboss.portal.portlet.PortletContext;
+import org.jboss.portal.portlet.PortletInvoker;
+import org.jboss.portal.portlet.PortletInvokerException;
+import org.jboss.portal.portlet.federation.FederatingPortletInvoker;
+import org.jboss.portal.security.AuthorizationDomainRegistry;
+import org.jboss.portal.security.RoleSecurityBinding;
+import org.jboss.portal.security.SecurityConstants;
+import org.jboss.portal.security.spi.provider.DomainConfigurator;
+import org.jboss.portal.theme.LayoutService;
+import org.jboss.portal.theme.PortalLayout;
+import org.jboss.portal.theme.ThemeConstants;
+
+/**
+ * @author <a href="mailto:theute@jboss.org">Thomas Heute</a>
+ * @version $Revision$
+ */
+public class NewWindowWizard
+{
+
+ private List steps;
+ private int currentStep;
+ private FederatingPortletInvoker federatingPortletInvoker;
+ private String selectedPortletId;
+ private String selectedPortalId;
+ private String selectedPageId;
+ private String selectedRegionId;
+ private String selectedPortletInvokerId;
+ private String selectedParentPageId;
+ private PortalObjectContainer portalObjectContainer;
+ private InstanceContainer instanceContainer;
+ private LayoutService layoutService;
+ private AuthorizationDomainRegistry authorizationDomainRegistry;
+
+ public NewWindowWizard()
+ {
+ steps = new ArrayList();
+ steps.add("selectPortlet");
+ steps.add("selectPortal");
+ steps.add("selectPage");
+ steps.add("selectRegion");
+ steps.add("newWindowWizardConfirm");
+ currentStep = 0;
+ }
+
+ public String next()
+ {
+ currentStep++;
+ return (String)steps.get(currentStep);
+ }
+
+ public String goTo()
+ {
+ FacesContext ctx = FacesContext.getCurrentInstance();
+ currentStep =
Integer.parseInt((String)ctx.getExternalContext().getRequestParameterMap().get("step"));
+ return (String)steps.get(currentStep);
+ }
+
+ public String previous()
+ {
+ currentStep--;
+ return (String)steps.get(currentStep);
+ }
+
+ public String selectPortlet()
+ {
+ FacesContext ctx = FacesContext.getCurrentInstance();
+ selectedPortletId =
(String)ctx.getExternalContext().getRequestParameterMap().get("id");
+ selectedPortletInvokerId =
(String)ctx.getExternalContext().getRequestParameterMap().get("portletInvokerId");
+ currentStep = 1;
+ return (String)steps.get(currentStep);
+ }
+
+ public String selectPortal()
+ {
+ FacesContext ctx = FacesContext.getCurrentInstance();
+ selectedPortalId =
(String)ctx.getExternalContext().getRequestParameterMap().get("id");
+ currentStep = 2;
+ selectedPageId = null;
+ selectedRegionId = null;
+ selectedParentPageId = selectedPortalId;
+ return (String)steps.get(currentStep);
+ }
+
+ public String selectPage()
+ {
+ FacesContext ctx = FacesContext.getCurrentInstance();
+ selectedPageId =
(String)ctx.getExternalContext().getRequestParameterMap().get("id");
+ currentStep = 3;
+ selectedRegionId = null;
+ return (String)steps.get(currentStep);
+ }
+
+ public String selectParentPage()
+ {
+ FacesContext ctx = FacesContext.getCurrentInstance();
+ selectedParentPageId =
(String)ctx.getExternalContext().getRequestParameterMap().get("id");
+ currentStep = 2;
+ return (String)steps.get(currentStep);
+ }
+
+ public String up()
+ {
+ FacesContext ctx = FacesContext.getCurrentInstance();
+ String id =
(String)ctx.getExternalContext().getRequestParameterMap().get("id");
+ Page page = (Page)getObjectFromId(id);
+ selectedParentPageId =
page.getParent().getId().toString(PortalObjectPath.LEGACY_BASE64_FORMAT);
+ currentStep = 2;
+ return (String)steps.get(currentStep);
+ }
+
+ public String selectRegion()
+ {
+ FacesContext ctx = FacesContext.getCurrentInstance();
+ selectedRegionId =
(String)ctx.getExternalContext().getRequestParameterMap().get("name");
+ currentStep = 4;
+ return (String)steps.get(currentStep);
+ }
+
+ public Portlet getSelectedPortlet()
+ {
+ PortletInvoker portletInvoker =
federatingPortletInvoker.getFederatedInvoker(selectedPortletInvokerId);
+ try
+ {
+ Portlet selectedPortlet =
portletInvoker.getPortlet(PortletContext.createPortletContext(selectedPortletId));
+ return selectedPortlet;
+ }
+ catch (IllegalArgumentException e)
+ {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ catch (PortletInvokerException e)
+ {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ return null;
+ }
+
+ public Page getSelectedPage()
+ {
+ return (Page)getObjectFromId(selectedPageId);
+ }
+
+ public PortalObject getSelectedParentPage()
+ {
+ return (PortalObject)getObjectFromId(selectedParentPageId);
+ }
+
+ public Portal getSelectedPortal()
+ {
+ return (Portal)getObjectFromId(selectedPortalId);
+ }
+
+ public PortalObject getObjectFromId(String id)
+ {
+ PortalObjectId objectId = PortalObjectId.parse(id,
PortalObjectPath.LEGACY_BASE64_FORMAT);
+ return getObjectFromId(objectId);
+ }
+
+ public PortalObject getObjectFromId(PortalObjectId id)
+ {
+ return portalObjectContainer.getObject(id);
+ }
+
+ public List getPortals()
+ {
+ PortalObject root = portalObjectContainer.getContext();
+ return new ArrayList(root.getChildren(PortalObject.PORTAL_MASK));
+ }
+
+
+ public List getPages()
+ {
+ if (selectedParentPageId != null)
+ {
+ Collection result =
getSelectedParentPage().getChildren(PortalObject.PAGE_MASK);
+ if (result.size() != 0)
+ {
+ return new ArrayList(result);
+ }
+ else
+ {
+ return new
ArrayList(getSelectedPage().getParent().getChildren(PortalObject.PAGE_MASK));
+ }
+ }
+ else
+ {
+ return new ArrayList(getSelectedPortal().getChildren(PortalObject.PAGE_MASK));
+ }
+ }
+
+ public String createWindow()
+ {
+ Portlet portlet = getSelectedPortlet();
+ InstanceContainer container = instanceContainer;
+ int id = container.getDefinitions().size();
+ String instanceId = "wizardInstance_" + id;
+ String windowId = "wizardWindow_" + id;
+ try
+ {
+ if ((container.getDefinition(instanceId) == null) &&
(getSelectedPage().getWindow(windowId) == null))
+ {
+ Instance instance = container.createDefinition(instanceId,
portlet.getContext().getId());
+
+ //
+ DomainConfigurator configurator =
authorizationDomainRegistry.getDomain("instance").getConfigurator();
+ Set constraints = Collections.singleton(new
RoleSecurityBinding("view", SecurityConstants.UNCHECKED_ROLE_NAME));
+ configurator.setSecurityBindings(instance.getId(), constraints);
+
+ Window window = getSelectedPage().createWindow(windowId, ContentType.PORTLET,
instanceId);
+ window.setDeclaredProperty(ThemeConstants.PORTAL_PROP_REGION,
getSelectedRegionId());
+ window.setDeclaredProperty(ThemeConstants.PORTAL_PROP_ORDER, "" +
Integer.MAX_VALUE);
+
+ return reset();
+ }
+ }
+ catch (Exception e)
+ {
+ e.printStackTrace();
+ }
+ return null;
+ }
+
+ public String cancel()
+ {
+ return reset();
+ }
+
+ public String reset()
+ {
+ selectedPortletId = null;
+ selectedPortalId = null;
+ selectedPageId = null;
+ selectedRegionId = null;
+ selectedPortletInvokerId = null;
+ selectedParentPageId = null;
+ currentStep = 0;
+ return "wizardMode";
+ }
+
+ public List getRegions()
+ {
+ Page page = getSelectedPage();
+ String layoutId = page.getProperty(ThemeConstants.PORTAL_PROP_LAYOUT);
+ PortalLayout layout = layoutService.getLayout(layoutId, false);
+ return layout.getLayoutInfo().getRegionNames();
+ }
+
+ public String getSelectedPortletId()
+ {
+ return selectedPortletId;
+ }
+
+ public int getCurrentStep()
+ {
+ return currentStep;
+ }
+
+ public String getSelectedPortalId()
+ {
+ return selectedPortalId;
+ }
+
+ public String getSelectedPageId()
+ {
+ return selectedPageId;
+ }
+
+ public String getSelectedParentPageId()
+ {
+ return selectedParentPageId;
+ }
+
+ public String getSelectedRegionId()
+ {
+ return selectedRegionId;
+ }
+
+ public FederatingPortletInvoker getFederatingPortletInvoker()
+ {
+ return federatingPortletInvoker;
+ }
+
+ public void setFederatingPortletInvoker(FederatingPortletInvoker
federatingPortletInvoker)
+ {
+ this.federatingPortletInvoker = federatingPortletInvoker;
+ }
+
+ public PortalObjectContainer getPortalObjectContainer()
+ {
+ return portalObjectContainer;
+ }
+
+ public void setPortalObjectContainer(PortalObjectContainer portalObjectContainer)
+ {
+ this.portalObjectContainer = portalObjectContainer;
+ }
+
+ public LayoutService getLayoutService()
+ {
+ return layoutService;
+ }
+
+ public void setLayoutService(LayoutService layoutService)
+ {
+ this.layoutService = layoutService;
+ }
+
+ public InstanceContainer getInstanceContainer()
+ {
+ return instanceContainer;
+ }
+
+ public void setInstanceContainer(InstanceContainer instanceContainer)
+ {
+ this.instanceContainer = instanceContainer;
+ }
+
+ public AuthorizationDomainRegistry getAuthorizationDomainRegistry()
+ {
+ return authorizationDomainRegistry;
+ }
+
+ public void setAuthorizationDomainRegistry(AuthorizationDomainRegistry
authorizationDomainRegistry)
+ {
+ this.authorizationDomainRegistry = authorizationDomainRegistry;
+ }
+
+ public boolean[] getEnabled()
+ {
+ boolean[] result = new boolean[steps.size()];
+ result[0] = true;
+ if (selectedPortletId != null)
+ {
+ result[1] = true;
+ }
+ if (selectedPortalId != null)
+ {
+ result[2] = true;
+ }
+ if (selectedPageId != null)
+ {
+ result[3] = true;
+ }
+ if (selectedRegionId != null)
+ {
+ result[4] = true;
+ }
+ return result;
+ }
+
+}
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-08-03
10:18:53 UTC (rev 7864)
+++ trunk/core-admin/src/resources/portal-admin-war/WEB-INF/faces-config.xml 2007-08-06
09:16:45 UTC (rev 7865)
@@ -28,10 +28,420 @@
<faces-config>
<application>
-
<property-resolver>org.jboss.portal.core.admin.portal.ui.AdminPropertyResolver</property-resolver>
+
<property-resolver>org.jboss.portal.core.admin.ui.AdminPropertyResolver</property-resolver>
<view-handler>com.sun.facelets.FaceletPortletViewHandler</view-handler>
</application>
+ <converter>
+
<converter-for-class>org.jboss.portal.core.model.content.ContentType</converter-for-class>
+
<converter-class>org.jboss.portal.core.admin.ui.conversion.ContentTypeConverter</converter-class>
+ </converter>
+
+ <converter>
+
<converter-for-class>org.jboss.portal.core.model.portal.PortalObjectId</converter-for-class>
+
<converter-class>org.jboss.portal.core.admin.ui.conversion.PortalObjectIdConverter</converter-class>
+ </converter>
+
+ <!-- The portal object manager bean -->
+ <managed-bean>
+ <managed-bean-name>portalobjectmgr</managed-bean-name>
+
<managed-bean-class>org.jboss.portal.core.admin.ui.PortalObjectManagerBean</managed-bean-class>
+ <managed-bean-scope>session</managed-bean-scope>
+ <managed-property>
+ <property-name>namespace</property-name>
+ <value></value>
+ </managed-property>
+ <managed-property>
+ <property-name>roleModule</property-name>
+ <value>#{applicationScope.RoleModule}</value>
+ </managed-property>
+ <managed-property>
+ <property-name>portalObjectContainer</property-name>
+ <value>#{applicationScope.PortalObjectContainer}</value>
+ </managed-property>
+ <managed-property>
+ <property-name>instanceContainer</property-name>
+ <value>#{applicationScope.InstanceContainer}</value>
+ </managed-property>
+ <managed-property>
+ <property-name>layoutService</property-name>
+ <value>#{applicationScope.LayoutService}</value>
+ </managed-property>
+ <managed-property>
+ <property-name>themeService</property-name>
+ <value>#{applicationScope.ThemeService}</value>
+ </managed-property>
+ <managed-property>
+ <property-name>domainConfigurator</property-name>
+
<value>#{applicationScope.AuthorizationDomainRegistry.portalobject.configurator}</value>
+ </managed-property>
+ </managed-bean>
+ <managed-bean>
+ <managed-bean-name>portalAction</managed-bean-name>
+
<managed-bean-class>org.jboss.portal.core.admin.ui.actions.PortalAction</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>addPageAction</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>
+ <value>#{portalobjectmgr.selectedObject}</value>
+ </managed-property>
+ <managed-property>
+ <property-name>messageTarget</property-name>
+ <value>addPageForm:pageName</value>
+ </managed-property>
+ <managed-property>
+ <property-name>listener</property-name>
+ <value>#{sessionScope.dashboard}</value>
+ </managed-property>
+ </managed-bean>
+ <managed-bean>
+ <managed-bean-name>assignContentToWindowAction</managed-bean-name>
+
<managed-bean-class>org.jboss.portal.core.admin.ui.actions.AssignContentToWindowAction</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>dashboardmgr</managed-bean-name>
+
<managed-bean-class>org.jboss.portal.core.admin.ui.PortalObjectManagerBean</managed-bean-class>
+ <managed-bean-scope>session</managed-bean-scope>
+ <managed-property>
+ <property-name>namespace</property-name>
+ <value>dashboard</value>
+ </managed-property>
+ <managed-property>
+ <property-name>roleModule</property-name>
+ <value>#{applicationScope.RoleModule}</value>
+ </managed-property>
+ <managed-property>
+ <property-name>portalObjectContainer</property-name>
+ <value>#{applicationScope.PortalObjectContainer}</value>
+ </managed-property>
+ <managed-property>
+ <property-name>instanceContainer</property-name>
+ <value>#{applicationScope.InstanceContainer}</value>
+ </managed-property>
+ <managed-property>
+ <property-name>layoutService</property-name>
+ <value>#{applicationScope.LayoutService}</value>
+ </managed-property>
+ <managed-property>
+ <property-name>themeService</property-name>
+ <value>#{applicationScope.ThemeService}</value>
+ </managed-property>
+ <managed-property>
+ <property-name>domainConfigurator</property-name>
+
<value>#{applicationScope.AuthorizationDomainRegistry.portalobject.configurator}</value>
+ </managed-property>
+ </managed-bean>
+
+ <!-- The instance manager managed bean -->
+ <managed-bean>
+ <managed-bean-name>instancemgr</managed-bean-name>
+
<managed-bean-class>org.jboss.portal.core.admin.ui.InstanceManagerBean</managed-bean-class>
+ <managed-bean-scope>session</managed-bean-scope>
+ <managed-property>
+ <property-name>roleModule</property-name>
+ <value>#{applicationScope.RoleModule}</value>
+ </managed-property>
+ <managed-property>
+ <property-name>instanceContainer</property-name>
+ <value>#{applicationScope.InstanceContainer}</value>
+ </managed-property>
+ <managed-property>
+ <property-name>domainConfigurator</property-name>
+
<value>#{applicationScope.AuthorizationDomainRegistry.instance.configurator}</value>
+ </managed-property>
+ <managed-property>
+ <property-name>paginationSize</property-name>
+ <value>20</value>
+ </managed-property>
+ </managed-bean>
+
+ <!-- The portlet manager managed bean -->
+ <managed-bean>
+ <managed-bean-name>portletmgr</managed-bean-name>
+
<managed-bean-class>org.jboss.portal.core.admin.ui.PortletManagerBean</managed-bean-class>
+ <managed-bean-scope>session</managed-bean-scope>
+ <managed-property>
+ <property-name>roleModule</property-name>
+ <value>#{applicationScope.RoleModule}</value>
+ </managed-property>
+ <managed-property>
+ <property-name>instanceContainer</property-name>
+ <value>#{applicationScope.InstanceContainer}</value>
+ </managed-property>
+ <managed-property>
+ <property-name>authorizationDomainRegistry</property-name>
+ <value>#{applicationScope.AuthorizationDomainRegistry}</value>
+ </managed-property>
+ <managed-property>
+ <property-name>federatingPortletInvoker</property-name>
+ <value>#{applicationScope.FederatingPortletInvoker}</value>
+ </managed-property>
+ <managed-property>
+ <property-name>selectedPortletInvokerId</property-name>
+ <value>local</value>
+ </managed-property>
+ <managed-property>
+ <property-name>paginationSize</property-name>
+ <value>20</value>
+ </managed-property>
+ </managed-bean>
+
+ <managed-bean>
+ <managed-bean-name>newWindowWizard</managed-bean-name>
+
<managed-bean-class>org.jboss.portal.core.admin.ui.wizard.NewWindowWizard</managed-bean-class>
+ <managed-bean-scope>session</managed-bean-scope>
+ <managed-property>
+ <property-name>instanceContainer</property-name>
+ <value>#{applicationScope.InstanceContainer}</value>
+ </managed-property>
+ <managed-property>
+ <property-name>federatingPortletInvoker</property-name>
+ <value>#{applicationScope.FederatingPortletInvoker}</value>
+ </managed-property>
+ <managed-property>
+ <property-name>portalObjectContainer</property-name>
+ <value>#{applicationScope.PortalObjectContainer}</value>
+ </managed-property>
+ <managed-property>
+ <property-name>layoutService</property-name>
+ <value>#{applicationScope.LayoutService}</value>
+ </managed-property>
+ <managed-property>
+ <property-name>authorizationDomainRegistry</property-name>
+ <value>#{applicationScope.AuthorizationDomainRegistry}</value>
+ </managed-property>
+ </managed-bean>
+
+ <managed-bean>
+ <managed-bean-name>createInstanceAction</managed-bean-name>
+
<managed-bean-class>org.jboss.portal.core.admin.ui.actions.CreateInstanceAction</managed-bean-class>
+ <managed-bean-scope>request</managed-bean-scope>
+ <managed-property>
+ <property-name>portletManager</property-name>
+ <value>#{sessionScope.portletmgr}</value>
+ </managed-property>
+ <managed-property>
+ <property-name>instanceManager</property-name>
+ <value>#{sessionScope.instancemgr}</value>
+ </managed-property>
+ </managed-bean>
+
+ <!--
+ | Dashboard beans
+ -->
+
+ <managed-bean>
+ <managed-bean-name>dashboard</managed-bean-name>
+
<managed-bean-class>org.jboss.portal.core.admin.ui.dashboard.DashboardBean</managed-bean-class>
+ <managed-bean-scope>session</managed-bean-scope>
+ <managed-property>
+ <property-name>portalObjectContainer</property-name>
+ <value>#{applicationScope.PortalObjectContainer}</value>
+ </managed-property>
+ <managed-property>
+ <property-name>layoutService</property-name>
+ <value>#{applicationScope.LayoutService}</value>
+ </managed-property>
+ <managed-property>
+ <property-name>themeService</property-name>
+ <value>#{applicationScope.ThemeService}</value>
+ </managed-property>
+ <managed-property>
+ <property-name>instanceContainer</property-name>
+ <value>#{applicationScope.InstanceContainer}</value>
+ </managed-property>
+ </managed-bean>
+ <managed-bean>
+ <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>
+ <value>#{sessionScope.dashboard.userPortal}</value>
+ </managed-property>
+ <managed-property>
+ <property-name>messageTarget</property-name>
+ <value>error</value>
+ </managed-property>
+ <managed-property>
+ <property-name>listener</property-name>
+ <value>#{sessionScope.dashboard}</value>
+ </managed-property>
+ </managed-bean>
+
+ <managed-bean>
+ <managed-bean-name>renameAction</managed-bean-name>
+
<managed-bean-class>org.jboss.portal.core.admin.ui.actions.RenameAction</managed-bean-class>
+ <managed-bean-scope>request</managed-bean-scope>
+ <managed-property>
+ <property-name>portalObjectManager</property-name>
+ <value>#{sessionScope.portalobjectmgr}</value>
+ </managed-property>
+ <managed-property>
+ <property-name>domainConfigurator</property-name>
+
<value>#{applicationScope.AuthorizationDomainRegistry.portalobject.configurator}</value>
+ </managed-property>
+ </managed-bean>
+
+ <!-- Constants -->
+ <managed-bean>
+ <managed-bean-name>PortalObject</managed-bean-name>
+
<managed-bean-class>org.jboss.portal.faces.el.ClassConstantPublisherBean</managed-bean-class>
+ <managed-bean-scope>application</managed-bean-scope>
+ <managed-property>
+ <property-name>className</property-name>
+ <value>org.jboss.portal.core.model.portal.PortalObject</value>
+ </managed-property>
+ </managed-bean>
+ <managed-bean>
+ <managed-bean-name>ControlConstants</managed-bean-name>
+
<managed-bean-class>org.jboss.portal.faces.el.ClassConstantPublisherBean</managed-bean-class>
+ <managed-bean-scope>application</managed-bean-scope>
+ <managed-property>
+ <property-name>className</property-name>
+
<value>org.jboss.portal.core.model.portal.control.ControlConstants</value>
+ </managed-property>
+ </managed-bean>
+ <managed-bean>
+ <managed-bean-name>PropertiesInfo</managed-bean-name>
+
<managed-bean-class>org.jboss.portal.faces.el.ClassConstantPublisherBean</managed-bean-class>
+ <managed-bean-scope>application</managed-bean-scope>
+ <managed-property>
+ <property-name>className</property-name>
+ <value>org.jboss.portal.core.admin.ui.PropertiesInfo</value>
+ </managed-property>
+ </managed-bean>
+ <managed-bean>
+ <managed-bean-name>ControlPropertiesBean</managed-bean-name>
+
<managed-bean-class>org.jboss.portal.faces.el.ClassConstantPublisherBean</managed-bean-class>
+ <managed-bean-scope>application</managed-bean-scope>
+ <managed-property>
+ <property-name>className</property-name>
+ <value>org.jboss.portal.core.admin.ui.ControlPropertiesBean</value>
+ </managed-property>
+ </managed-bean>
+
+
+ <navigation-rule>
+ <navigation-case>
+ <from-outcome>index</from-outcome>
+ <to-view-id>/WEB-INF/jsf/objects.xhtml</to-view-id>
+ </navigation-case>
+ <navigation-case>
+ <from-outcome>advancedMode</from-outcome>
+ <to-view-id>/WEB-INF/jsf/objects.xhtml</to-view-id>
+ </navigation-case>
+ <navigation-case>
+ <from-outcome>wizardMode</from-outcome>
+ <to-view-id>/WEB-INF/jsf/wizard/selectPortlet.xhtml</to-view-id>
+ </navigation-case>
+ <navigation-case>
+ <from-outcome>objects</from-outcome>
+ <to-view-id>/WEB-INF/jsf/objects.xhtml</to-view-id>
+ </navigation-case>
+ <navigation-case>
+ <from-outcome>editPortalSecurity</from-outcome>
+ <to-view-id>/WEB-INF/jsf/editPortalSecurity.xhtml</to-view-id>
+ </navigation-case>
+ <navigation-case>
+ <from-outcome>editPortalTheme</from-outcome>
+ <to-view-id>/WEB-INF/jsf/editPortalTheme.xhtml</to-view-id>
+ </navigation-case>
+ <navigation-case>
+ <from-outcome>editPageLayout</from-outcome>
+ <to-view-id>/WEB-INF/jsf/editPageLayout.xhtml</to-view-id>
+ </navigation-case>
+ <navigation-case>
+ <from-outcome>editPageSecurity</from-outcome>
+ <to-view-id>/WEB-INF/jsf/editPageSecurity.xhtml</to-view-id>
+ </navigation-case>
+ <navigation-case>
+ <from-outcome>editProperties</from-outcome>
+ <to-view-id>/WEB-INF/jsf/editProperties.xhtml</to-view-id>
+ </navigation-case>
+ <navigation-case>
+ <from-outcome>editPageTheme</from-outcome>
+ <to-view-id>/WEB-INF/jsf/editPageTheme.xhtml</to-view-id>
+ </navigation-case>
+ <navigation-case>
+ <from-outcome>editWindowSecurity</from-outcome>
+ <to-view-id>/WEB-INF/jsf/editWindowSecurity.xhtml</to-view-id>
+ </navigation-case>
+ <navigation-case>
+ <from-outcome>renameObject</from-outcome>
+ <to-view-id>/WEB-INF/jsf/renameObject.xhtml</to-view-id>
+ </navigation-case>
+
+ <navigation-case>
+ <from-outcome>editWindowTheme</from-outcome>
+ <to-view-id>/WEB-INF/jsf/editWindowTheme.xhtml</to-view-id>
+ </navigation-case>
+ <navigation-case>
+ <from-outcome>instances</from-outcome>
+ <to-view-id>/WEB-INF/jsf/instances.xhtml</to-view-id>
+ </navigation-case>
+ <navigation-case>
+ <from-outcome>portlets</from-outcome>
+ <to-view-id>/WEB-INF/jsf/portlets.xhtml</to-view-id>
+ </navigation-case>
+ <navigation-case>
+ <from-outcome>selectPortlet</from-outcome>
+ <to-view-id>/WEB-INF/jsf/wizard/selectPortlet.xhtml</to-view-id>
+ </navigation-case>
+ <navigation-case>
+ <from-outcome>selectPortal</from-outcome>
+ <to-view-id>/WEB-INF/jsf/wizard/selectPortal.xhtml</to-view-id>
+ </navigation-case>
+ <navigation-case>
+ <from-outcome>selectPage</from-outcome>
+ <to-view-id>/WEB-INF/jsf/wizard/selectPage.xhtml</to-view-id>
+ </navigation-case>
+ <navigation-case>
+ <from-outcome>selectRegion</from-outcome>
+ <to-view-id>/WEB-INF/jsf/wizard/selectRegion.xhtml</to-view-id>
+ </navigation-case>
+ <navigation-case>
+ <from-outcome>newWindowWizardConfirm</from-outcome>
+
<to-view-id>/WEB-INF/jsf/wizard/newWindowWizardConfirm.xhtml</to-view-id>
+ </navigation-case>
+
+ <navigation-case>
+ <from-outcome>dashboards</from-outcome>
+ <to-view-id>/WEB-INF/jsf/dashboards.xhtml</to-view-id>
+ </navigation-case>
+
+ <navigation-case>
+ <from-outcome>dashboard</from-outcome>
+ <to-view-id>/WEB-INF/jsf/dashboard/dashboard.xhtml</to-view-id>
+ </navigation-case>
+ <navigation-case>
+ <from-outcome>confirm</from-outcome>
+ <to-view-id>/WEB-INF/jsf/common/confirm.xhtml</to-view-id>
+ </navigation-case>
+ <navigation-case>
+ <from-outcome>confirmDeleteInstance</from-outcome>
+ <to-view-id>/WEB-INF/jsf/confirmDeleteInstance.xhtml</to-view-id>
+ </navigation-case>
+ </navigation-rule>
+
+ <lifecycle>
+
<phase-listener>org.jboss.portal.core.admin.ui.Refresher</phase-listener>
+ </lifecycle>
+
<component>
<component-type>org.jboss.portal.Scroller</component-type>
<component-class>org.jboss.portal.faces.component.scroller.UIScroller</component-class>
Copied: trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/common (from rev 7842,
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/common)
Deleted: trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/common/confirm.xhtml
===================================================================
---
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/common/confirm.xhtml 2007-07-30
12:59:36 UTC (rev 7842)
+++
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/common/confirm.xhtml 2007-08-06
09:16:45 UTC (rev 7865)
@@ -1,31 +0,0 @@
-<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:jbp="http://www.jboss.org/portal"
-
xmlns:c="http://java.sun.com/jstl/core"
- class="admin-ui">
-
- <ui:composition template="../objectTemplate.xhtml">
-
- <ui:param name="portalObjectScreen" value="Delete"/>
- <ui:define name="content">
-
-
- <p class="portlet-msg-alert">WARNING ! You are about to delete this
element from the portal !</p>
-
- <p class="portlet-class">Are you sure ?</p>
-
- <h:form>
- <h:commandButton value="Yes" action="objects"
actionListener="#{portalobjectmgr.destroyObject}"
styleClass="portlet-form-button">
- <f:attribute name="objectId"
value="#{portalobjectmgr.selectedObject.id}" />
- </h:commandButton>
- <h:commandButton value="No" action="objects"
actionListener="objects" styleClass="portlet-form-button"/>
- </h:form>
-
- </ui:define>
-
- </ui:composition>
-
-</div>
\ No newline at end of file
Copied: trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/common/confirm.xhtml
(from rev 7842,
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/common/confirm.xhtml)
===================================================================
--- trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/common/confirm.xhtml
(rev 0)
+++
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/common/confirm.xhtml 2007-08-06
09:16:45 UTC (rev 7865)
@@ -0,0 +1,31 @@
+<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:jbp="http://www.jboss.org/portal"
+
xmlns:c="http://java.sun.com/jstl/core"
+ class="admin-ui">
+
+ <ui:composition template="../objectTemplate.xhtml">
+
+ <ui:param name="portalObjectScreen" value="Delete"/>
+ <ui:define name="content">
+
+
+ <p class="portlet-msg-alert">WARNING ! You are about to delete this
element from the portal !</p>
+
+ <p class="portlet-class">Are you sure ?</p>
+
+ <h:form>
+ <h:commandButton value="Yes" action="objects"
actionListener="#{portalobjectmgr.destroyObject}"
styleClass="portlet-form-button">
+ <f:attribute name="objectId"
value="#{portalobjectmgr.selectedObject.id}" />
+ </h:commandButton>
+ <h:commandButton value="No" action="objects"
actionListener="objects" styleClass="portlet-form-button"/>
+ </h:form>
+
+ </ui:define>
+
+ </ui:composition>
+
+</div>
\ No newline at end of file
Deleted:
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/common/editPageErrorHandling.xhtml
===================================================================
---
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/common/editPageErrorHandling.xhtml 2007-07-30
12:59:36 UTC (rev 7842)
+++
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/common/editPageErrorHandling.xhtml 2007-08-06
09:16:45 UTC (rev 7865)
@@ -1,148 +0,0 @@
-<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:c="http://java.sun.com/jstl/core">
-
-<p class="portlet-area-header">Page Error Handling</p>
-
-<div class="portlet-area-body">
-<!-- defines error handeling section -->
-<table cellpadding="0" cellspacing="0" width="100%">
-<tr>
- <th class="portlet-section-title">Configure how the system handles
errors on page level.</th>
-</tr>
-<tr>
-<td valign="top" class="portlet-section-body">
-
-
-<h:form>
-<table width="100%">
-<thead class="portlet-section-header"
style="text-align:left;">
- <tr>
- <th>Case</th>
- <th>Inheritance</th>
- <th>Action</th>
- </tr>
-</thead>
-<tbody>
-<tr class="portlet-section-body">
- <td>
- <h:outputText
value="#{properties.pageControlAccessDenied.displayName}"/>
- </td>
- <td>
- <h:selectBooleanCheckbox
disabled="#{!properties.pageControlAccessDenied.inheritable}"
- onchange="submit();"
-
valueChangeListener="#{properties.pageControlAccessDenied.inherit}"
-
value="#{properties.pageControlAccessDenied.inherited}"/>inherit action
- from parent
- </td>
- <td>
- <h:selectOneMenu value="#{properties.pageControlAccessDenied.value}"
-
disabled="#{properties.pageControlAccessDenied.inherited}"
onchange="submit();">
- <f:selectItems value="#{properties.pageSelectItems}"/>
- </h:selectOneMenu>
- </td>
-</tr>
-<tr class="portlet-section-body">
- <td>
- <h:outputText
value="#{properties.pageControlUnavailable.displayName}"/>
- </td>
- <td>
- <h:selectBooleanCheckbox
disabled="#{!properties.pageControlUnavailable.inheritable}"
- onchange="submit();"
-
valueChangeListener="#{properties.pageControlUnavailable.inherit}"
-
value="#{properties.pageControlUnavailable.inherited}"/>inherit action
- from parent
- </td>
- <td>
- <h:selectOneMenu value="#{properties.pageControlUnavailable.value}"
-
disabled="#{properties.pageControlUnavailable.inherited}"
onchange="submit();">
- <f:selectItems value="#{properties.pageSelectItems}"/>
- </h:selectOneMenu>
- </td>
-</tr>
-<tr class="portlet-section-body">
- <td>
- <h:outputText value="#{properties.pageControlError.displayName}"/>
- </td>
- <td>
- <h:selectBooleanCheckbox
disabled="#{!properties.pageControlError.inheritable}"
- onchange="submit();"
-
valueChangeListener="#{properties.pageControlError.inherit}"
-
value="#{properties.pageControlError.inherited}"/>inherit action from
- parent
- </td>
- <td>
- <h:selectOneMenu value="#{properties.pageControlError.value}"
- disabled="#{properties.pageControlError.inherited}"
onchange="submit();">
- <f:selectItems value="#{properties.pageSelectItems}"/>
- </h:selectOneMenu>
- </td>
-</tr>
-<tr class="portlet-section-body">
- <td>
- <h:outputText
value="#{properties.pageControlInternalError.displayName}"/>
- </td>
- <td>
- <h:selectBooleanCheckbox
disabled="#{!properties.pageControlInternalError.inheritable}"
- onchange="submit();"
-
valueChangeListener="#{properties.pageControlInternalError.inherit}"
-
value="#{properties.pageControlInternalError.inherited}"/>inherit action
- from parent
- </td>
- <td>
- <h:selectOneMenu value="#{properties.pageControlInternalError.value}"
-
disabled="#{properties.pageControlInternalError.inherited}"
onchange="submit();">
- <f:selectItems value="#{properties.pageSelectItems}"/>
- </h:selectOneMenu>
- </td>
-</tr>
-<tr class="portlet-section-body">
- <td>
- <h:outputText
value="#{properties.pageControlNotFound.displayName}"/>
- </td>
- <td>
- <h:selectBooleanCheckbox
disabled="#{!properties.pageControlNotFound.inheritable}"
- onchange="submit();"
-
valueChangeListener="#{properties.pageControlNotFound.inherit}"
-
value="#{properties.pageControlNotFound.inherited}"/>inherit action from
- parent
- </td>
- <td>
- <h:selectOneMenu value="#{properties.pageControlNotFound.value}"
- disabled="#{properties.pageControlNotFound.inherited}"
onchange="submit();">
- <f:selectItems value="#{properties.pageSelectItems}"/>
- </h:selectOneMenu>
- </td>
-</tr>
-<tr class="portlet-section-body">
- <td>
- <h:outputText
value="#{properties.pageControlResourceURI.displayName}"/>
- </td>
- <td>
- <h:selectBooleanCheckbox
disabled="#{!properties.pageControlResourceURI.inheritable}"
- onchange="submit();"
-
valueChangeListener="#{properties.pageControlResourceURI.inherit}"
-
value="#{properties.pageControlResourceURI.inherited}"/>inherit action
- from parent
- </td>
- <td>
- <h:inputText value="#{properties.pageControlResourceURI.value}"
size="60"
-
disabled="#{properties.pageControlResourceURI.inherited}"/>
- </td>
-</tr>
-</tbody>
-</table>
-<h:commandButton value="Update" styleClass="portlet-form-button
portlet-section-buttonrow"/>
-</h:form>
-
-
-</td>
-</tr>
-</table>
-
-</div>
-
-</div>
Copied:
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/common/editPageErrorHandling.xhtml
(from rev 7842,
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/common/editPageErrorHandling.xhtml)
===================================================================
---
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/common/editPageErrorHandling.xhtml
(rev 0)
+++
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/common/editPageErrorHandling.xhtml 2007-08-06
09:16:45 UTC (rev 7865)
@@ -0,0 +1,148 @@
+<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:c="http://java.sun.com/jstl/core">
+
+<p class="portlet-area-header">Page Error Handling</p>
+
+<div class="portlet-area-body">
+<!-- defines error handeling section -->
+<table cellpadding="0" cellspacing="0" width="100%">
+<tr>
+ <th class="portlet-section-title">Configure how the system handles
errors on page level.</th>
+</tr>
+<tr>
+<td valign="top" class="portlet-section-body">
+
+
+<h:form>
+<table width="100%">
+<thead class="portlet-section-header"
style="text-align:left;">
+ <tr>
+ <th>Case</th>
+ <th>Inheritance</th>
+ <th>Action</th>
+ </tr>
+</thead>
+<tbody>
+<tr class="portlet-section-body">
+ <td>
+ <h:outputText
value="#{properties.pageControlAccessDenied.displayName}"/>
+ </td>
+ <td>
+ <h:selectBooleanCheckbox
disabled="#{!properties.pageControlAccessDenied.inheritable}"
+ onchange="submit();"
+
valueChangeListener="#{properties.pageControlAccessDenied.inherit}"
+
value="#{properties.pageControlAccessDenied.inherited}"/>inherit action
+ from parent
+ </td>
+ <td>
+ <h:selectOneMenu value="#{properties.pageControlAccessDenied.value}"
+
disabled="#{properties.pageControlAccessDenied.inherited}"
onchange="submit();">
+ <f:selectItems value="#{properties.pageSelectItems}"/>
+ </h:selectOneMenu>
+ </td>
+</tr>
+<tr class="portlet-section-body">
+ <td>
+ <h:outputText
value="#{properties.pageControlUnavailable.displayName}"/>
+ </td>
+ <td>
+ <h:selectBooleanCheckbox
disabled="#{!properties.pageControlUnavailable.inheritable}"
+ onchange="submit();"
+
valueChangeListener="#{properties.pageControlUnavailable.inherit}"
+
value="#{properties.pageControlUnavailable.inherited}"/>inherit action
+ from parent
+ </td>
+ <td>
+ <h:selectOneMenu value="#{properties.pageControlUnavailable.value}"
+
disabled="#{properties.pageControlUnavailable.inherited}"
onchange="submit();">
+ <f:selectItems value="#{properties.pageSelectItems}"/>
+ </h:selectOneMenu>
+ </td>
+</tr>
+<tr class="portlet-section-body">
+ <td>
+ <h:outputText value="#{properties.pageControlError.displayName}"/>
+ </td>
+ <td>
+ <h:selectBooleanCheckbox
disabled="#{!properties.pageControlError.inheritable}"
+ onchange="submit();"
+
valueChangeListener="#{properties.pageControlError.inherit}"
+
value="#{properties.pageControlError.inherited}"/>inherit action from
+ parent
+ </td>
+ <td>
+ <h:selectOneMenu value="#{properties.pageControlError.value}"
+ disabled="#{properties.pageControlError.inherited}"
onchange="submit();">
+ <f:selectItems value="#{properties.pageSelectItems}"/>
+ </h:selectOneMenu>
+ </td>
+</tr>
+<tr class="portlet-section-body">
+ <td>
+ <h:outputText
value="#{properties.pageControlInternalError.displayName}"/>
+ </td>
+ <td>
+ <h:selectBooleanCheckbox
disabled="#{!properties.pageControlInternalError.inheritable}"
+ onchange="submit();"
+
valueChangeListener="#{properties.pageControlInternalError.inherit}"
+
value="#{properties.pageControlInternalError.inherited}"/>inherit action
+ from parent
+ </td>
+ <td>
+ <h:selectOneMenu value="#{properties.pageControlInternalError.value}"
+
disabled="#{properties.pageControlInternalError.inherited}"
onchange="submit();">
+ <f:selectItems value="#{properties.pageSelectItems}"/>
+ </h:selectOneMenu>
+ </td>
+</tr>
+<tr class="portlet-section-body">
+ <td>
+ <h:outputText
value="#{properties.pageControlNotFound.displayName}"/>
+ </td>
+ <td>
+ <h:selectBooleanCheckbox
disabled="#{!properties.pageControlNotFound.inheritable}"
+ onchange="submit();"
+
valueChangeListener="#{properties.pageControlNotFound.inherit}"
+
value="#{properties.pageControlNotFound.inherited}"/>inherit action from
+ parent
+ </td>
+ <td>
+ <h:selectOneMenu value="#{properties.pageControlNotFound.value}"
+ disabled="#{properties.pageControlNotFound.inherited}"
onchange="submit();">
+ <f:selectItems value="#{properties.pageSelectItems}"/>
+ </h:selectOneMenu>
+ </td>
+</tr>
+<tr class="portlet-section-body">
+ <td>
+ <h:outputText
value="#{properties.pageControlResourceURI.displayName}"/>
+ </td>
+ <td>
+ <h:selectBooleanCheckbox
disabled="#{!properties.pageControlResourceURI.inheritable}"
+ onchange="submit();"
+
valueChangeListener="#{properties.pageControlResourceURI.inherit}"
+
value="#{properties.pageControlResourceURI.inherited}"/>inherit action
+ from parent
+ </td>
+ <td>
+ <h:inputText value="#{properties.pageControlResourceURI.value}"
size="60"
+
disabled="#{properties.pageControlResourceURI.inherited}"/>
+ </td>
+</tr>
+</tbody>
+</table>
+<h:commandButton value="Update" styleClass="portlet-form-button
portlet-section-buttonrow"/>
+</h:form>
+
+
+</td>
+</tr>
+</table>
+
+</div>
+
+</div>
Deleted:
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/common/editPageLayout.xhtml
===================================================================
---
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/common/editPageLayout.xhtml 2007-07-30
12:59:36 UTC (rev 7842)
+++
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/common/editPageLayout.xhtml 2007-08-06
09:16:45 UTC (rev 7865)
@@ -1,173 +0,0 @@
-<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:jbp="http://www.jboss.org/portal"
-
xmlns:c="http://java.sun.com/jstl/core">
-
-<table width="100%">
-<tr>
-<td valign="top" width="50%">
-
- <p class="portlet-area-header">Content Definition</p>
-
- <div class="portlet-area-body">
-
- <table>
- <tr>
- <td colspan="2">Define a name for the window of content
(optional):
- </td>
- </tr>
- <tr>
- <td>
- <span class="portlet-form-field-label">Window
Name:</span>
- </td>
- <td width="100%">
- <h:form id="windowForm">
- <h:inputText id="windowName"
value="#{pageManager.windowName}"
styleClass="portlet-form-input-field"/>
- <h:message for="windowName"
errorClass="portlet-msg-error"/>
- </h:form>
- </td>
- </tr>
- <tr>
- <td colspan="2">
- <hr/>
- Select the type of content that will be added to the page:
- </td>
- </tr>
- <tr>
- <td>
- <span class="portlet-form-field-label">Content
Type:</span>
- </td>
- <td>
- <h:form id="abc">
- <h:inputHidden id="windowNameCopy"
value="#{pageManager.windowName}"/>
- <h:selectOneMenu
- id="instanceId"
- value="#{pageManager.selectedContentType}"
- styleClass="portlet-form-field contentType"
-
onchange="document.getElementById('abc:windowNameCopy').value =
document.getElementById('windowForm:windowName').value;
- document.getElementById('abc').submit();
">
- <f:selectItems
value="#{pageManager.contentTypeItems}"/>
- </h:selectOneMenu>
- <h:message for="instanceId"
errorClass="portlet-msg-error"/>
- </h:form>
- </td>
- </tr>
- <tr>
- <td colspan="2">
- <hr/>
- Select content that will be added to the page:
- </td>
- </tr>
- <tr>
- <td colspan="2" valign="top">
- <div>
- <jbp:portlet
- portletId="#{pageManager.selectedEditorPortletId}"
- portletInvoker="#{pageManager.portletInvoker}"
- actionListener="#{pageManager.assignWindow}"
- supportedModes="edit_content"
- supportedWindowStates="normal"
- initialMode="edit_content"
- initialWindowState="normal"
-
renderParameters="#{pageManager.selectedRenderParameters}"
- onClick="url.setParameter('windowName',
document.getElementById('windowForm:windowName').value);"/>
- </div>
- </td>
- </tr>
- </table>
-
- </div>
-
-</td>
-<td valign="top" width="50%">
-
- <p class="portlet-area-header">Page Layout</p>
-
- <div class="portlet-area-body">
-
- <h:form id="layoutForm">
- <h:message for="layoutForm"
errorClass="portlet-msg-error"/>
- <input id="blah" type="hidden" name="blah"
value=""/>
- <table width="100%">
- <c:forEach items="#{pageManager.regionNames}"
var="regionName" varStatus="status">
- <tbody>
- <tr>
- <td colspan="3"
class="portlet-form-field-label">
- <hr/>
- #{regionName} Region
- </td>
- </tr>
- <tr>
- <td valign="top">
- <h:commandButton
-
onclick="document.getElementById('blah').value=document.getElementById('windowForm:windowName').value"
- value="Add" id="a_#{regionName}"
- actionListener="#{pageManager.assignWindows}"
- styleClass="portlet-form-button layout-button"/>
- </td>
- <td width="100%">
- <h:selectManyListbox
- value="#{pageManager.assignedWindows[regionName]}"
- size="7" styleClass="windowList
portlet-form-field">
- <f:selectItems
-
value="#{pageManager.windowItemsMap[regionName]}"/>
- </h:selectManyListbox>
- </td>
- <td valign="top" width="250">
- <h:commandButton
- value="Up" id="u_#{regionName}"
- actionListener="#{pageManager.assignWindows}"
- styleClass="portlet-form-button
layout-button"/><br/>
- <h:commandButton
- value="Down" id="d_#{regionName}"
- actionListener="#{pageManager.assignWindows}"
- styleClass="portlet-form-button layout-button"/>
- <hr/>
- <h:commandButton
- value="Delete" id="l_#{regionName}"
- actionListener="#{pageManager.assignWindows}"
- styleClass="portlet-form-button layout-button"/>
- </td>
- </tr>
- </tbody>
- </c:forEach>
- <c:if test="#{!(empty
pageManager.assignedWindows['unknown'])}">
- <tbody>
- <tr>
- <td colspan="2"
class="portlet-form-field-label"
- style="border-width:0px;border-top:1px dashed
#d5d5d5">Unassigned
- windows
- </td>
- </tr>
- <tr>
- <td>
- <div style="margin-top: 1em">
- <h:commandButton value="Delete"
- id="l_unknown"
actionListener="#{pageManager.assignWindows}"
-
styleClass="portlet-form-button"/>
- </div>
- </td>
- <td>
- <h:selectManyListbox
-
value="#{pageManager.assignedWindows['unknown']}"
- size="7" styleClass="windowList
portlet-form-field">
- <f:selectItems
-
value="#{pageManager.windowItemsMap['unknown']}"/>
- </h:selectManyListbox>
- </td>
- </tr>
- </tbody>
- </c:if>
- </table>
- </h:form>
-
- </div>
-
-</td>
-</tr>
-</table>
-
-</div>
\ No newline at end of file
Copied:
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/common/editPageLayout.xhtml
(from rev 7842,
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/common/editPageLayout.xhtml)
===================================================================
---
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/common/editPageLayout.xhtml
(rev 0)
+++
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/common/editPageLayout.xhtml 2007-08-06
09:16:45 UTC (rev 7865)
@@ -0,0 +1,173 @@
+<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:jbp="http://www.jboss.org/portal"
+
xmlns:c="http://java.sun.com/jstl/core">
+
+<table width="100%">
+<tr>
+<td valign="top" width="50%">
+
+ <p class="portlet-area-header">Content Definition</p>
+
+ <div class="portlet-area-body">
+
+ <table>
+ <tr>
+ <td colspan="2">Define a name for the window of content
(optional):
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <span class="portlet-form-field-label">Window
Name:</span>
+ </td>
+ <td width="100%">
+ <h:form id="windowForm">
+ <h:inputText id="windowName"
value="#{pageManager.windowName}"
styleClass="portlet-form-input-field"/>
+ <h:message for="windowName"
errorClass="portlet-msg-error"/>
+ </h:form>
+ </td>
+ </tr>
+ <tr>
+ <td colspan="2">
+ <hr/>
+ Select the type of content that will be added to the page:
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <span class="portlet-form-field-label">Content
Type:</span>
+ </td>
+ <td>
+ <h:form id="abc">
+ <h:inputHidden id="windowNameCopy"
value="#{pageManager.windowName}"/>
+ <h:selectOneMenu
+ id="instanceId"
+ value="#{pageManager.selectedContentType}"
+ styleClass="portlet-form-field contentType"
+
onchange="document.getElementById('abc:windowNameCopy').value =
document.getElementById('windowForm:windowName').value;
+ document.getElementById('abc').submit();
">
+ <f:selectItems
value="#{pageManager.contentTypeItems}"/>
+ </h:selectOneMenu>
+ <h:message for="instanceId"
errorClass="portlet-msg-error"/>
+ </h:form>
+ </td>
+ </tr>
+ <tr>
+ <td colspan="2">
+ <hr/>
+ Select content that will be added to the page:
+ </td>
+ </tr>
+ <tr>
+ <td colspan="2" valign="top">
+ <div>
+ <jbp:portlet
+ portletId="#{pageManager.selectedEditorPortletId}"
+ portletInvoker="#{pageManager.portletInvoker}"
+ actionListener="#{pageManager.assignWindow}"
+ supportedModes="edit_content"
+ supportedWindowStates="normal"
+ initialMode="edit_content"
+ initialWindowState="normal"
+
renderParameters="#{pageManager.selectedRenderParameters}"
+ onClick="url.setParameter('windowName',
document.getElementById('windowForm:windowName').value);"/>
+ </div>
+ </td>
+ </tr>
+ </table>
+
+ </div>
+
+</td>
+<td valign="top" width="50%">
+
+ <p class="portlet-area-header">Page Layout</p>
+
+ <div class="portlet-area-body">
+
+ <h:form id="layoutForm">
+ <h:message for="layoutForm"
errorClass="portlet-msg-error"/>
+ <input id="blah" type="hidden" name="blah"
value=""/>
+ <table width="100%">
+ <c:forEach items="#{pageManager.regionNames}"
var="regionName" varStatus="status">
+ <tbody>
+ <tr>
+ <td colspan="3"
class="portlet-form-field-label">
+ <hr/>
+ #{regionName} Region
+ </td>
+ </tr>
+ <tr>
+ <td valign="top">
+ <h:commandButton
+
onclick="document.getElementById('blah').value=document.getElementById('windowForm:windowName').value"
+ value="Add" id="a_#{regionName}"
+ actionListener="#{pageManager.assignWindows}"
+ styleClass="portlet-form-button layout-button"/>
+ </td>
+ <td width="100%">
+ <h:selectManyListbox
+ value="#{pageManager.assignedWindows[regionName]}"
+ size="7" styleClass="windowList
portlet-form-field">
+ <f:selectItems
+
value="#{pageManager.windowItemsMap[regionName]}"/>
+ </h:selectManyListbox>
+ </td>
+ <td valign="top" width="250">
+ <h:commandButton
+ value="Up" id="u_#{regionName}"
+ actionListener="#{pageManager.assignWindows}"
+ styleClass="portlet-form-button
layout-button"/><br/>
+ <h:commandButton
+ value="Down" id="d_#{regionName}"
+ actionListener="#{pageManager.assignWindows}"
+ styleClass="portlet-form-button layout-button"/>
+ <hr/>
+ <h:commandButton
+ value="Delete" id="l_#{regionName}"
+ actionListener="#{pageManager.assignWindows}"
+ styleClass="portlet-form-button layout-button"/>
+ </td>
+ </tr>
+ </tbody>
+ </c:forEach>
+ <c:if test="#{!(empty
pageManager.assignedWindows['unknown'])}">
+ <tbody>
+ <tr>
+ <td colspan="2"
class="portlet-form-field-label"
+ style="border-width:0px;border-top:1px dashed
#d5d5d5">Unassigned
+ windows
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <div style="margin-top: 1em">
+ <h:commandButton value="Delete"
+ id="l_unknown"
actionListener="#{pageManager.assignWindows}"
+
styleClass="portlet-form-button"/>
+ </div>
+ </td>
+ <td>
+ <h:selectManyListbox
+
value="#{pageManager.assignedWindows['unknown']}"
+ size="7" styleClass="windowList
portlet-form-field">
+ <f:selectItems
+
value="#{pageManager.windowItemsMap['unknown']}"/>
+ </h:selectManyListbox>
+ </td>
+ </tr>
+ </tbody>
+ </c:if>
+ </table>
+ </h:form>
+
+ </div>
+
+</td>
+</tr>
+</table>
+
+</div>
\ No newline at end of file
Deleted:
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/common/editPortalErrorHandling.xhtml
===================================================================
---
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/common/editPortalErrorHandling.xhtml 2007-07-30
12:59:36 UTC (rev 7842)
+++
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/common/editPortalErrorHandling.xhtml 2007-08-06
09:16:45 UTC (rev 7865)
@@ -1,149 +0,0 @@
-<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:c="http://java.sun.com/jstl/core">
-
-<p class="portlet-area-header">Portal Error Handling</p>
-
-<div class="portlet-area-body">
-
-<!-- defines error handeling section -->
-<table cellpadding="0" cellspacing="0" width="100%">
-<tr>
- <th class="portlet-section-title">Configure how the system handles
errors on portal level.</th>
-</tr>
-<tr>
-<td valign="top" class="portlet-section-body">
-
-<h:form>
-<table width="100%">
-<thead class="portlet-section-header"
style="text-align:left;">
- <tr>
- <th>Case</th>
- <th>Inheritance</th>
- <th>Action</th>
- </tr>
-</thead>
-<tbody>
-<tr class="portlet-section-body">
- <td>
- <h:outputText
value="#{properties.portalControlAccessDenied.displayName}"/>
- </td>
- <td>
- <h:selectBooleanCheckbox
disabled="#{!properties.portalControlAccessDenied.inheritable}"
- onchange="submit();"
-
valueChangeListener="#{properties.portalControlAccessDenied.inherit}"
-
value="#{properties.portalControlAccessDenied.inherited}"/>inherit
- action from parent
- </td>
- <td>
- <h:selectOneMenu
value="#{properties.portalControlAccessDenied.value}"
-
disabled="#{properties.portalControlAccessDenied.inherited}"
- onchange="submit();">
- <f:selectItems value="#{properties.portalSelectItems}"/>
- </h:selectOneMenu>
- </td>
-</tr>
-<tr class="portlet-section-body">
- <td>
- <h:outputText
value="#{properties.portalControlUnavailable.displayName}"/>
- </td>
- <td>
- <h:selectBooleanCheckbox
disabled="#{!properties.portalControlUnavailable.inheritable}"
- onchange="submit();"
-
valueChangeListener="#{properties.portalControlUnavailable.inherit}"
-
value="#{properties.portalControlUnavailable.inherited}"/>inherit
- action from parent
- </td>
- <td>
- <h:selectOneMenu value="#{properties.portalControlUnavailable.value}"
-
disabled="#{properties.portalControlUnavailable.inherited}"
- onchange="submit();">
- <f:selectItems value="#{properties.portalSelectItems}"/>
- </h:selectOneMenu>
- </td>
-</tr>
-<tr class="portlet-section-body">
- <td>
- <h:outputText
value="#{properties.portalControlError.displayName}"/>
- </td>
- <td>
- <h:selectBooleanCheckbox
disabled="#{!properties.portalControlError.inheritable}"
- onchange="submit();"
-
valueChangeListener="#{properties.portalControlError.inherit}"
-
value="#{properties.portalControlError.inherited}"/>inherit action from
- parent
- </td>
- <td>
- <h:selectOneMenu value="#{properties.portalControlError.value}"
- disabled="#{properties.portalControlError.inherited}"
onchange="submit();">
- <f:selectItems value="#{properties.portalSelectItems}"/>
- </h:selectOneMenu>
- </td>
-</tr>
-<tr class="portlet-section-body">
- <td>
- <h:outputText
value="#{properties.portalControlInternalError.displayName}"/>
- </td>
- <td>
- <h:selectBooleanCheckbox
disabled="#{!properties.portalControlInternalError.inheritable}"
- onchange="submit();"
-
valueChangeListener="#{properties.portalControlInternalError.inherit}"
-
value="#{properties.portalControlInternalError.inherited}"/>inherit
- action from parent
- </td>
- <td>
- <h:selectOneMenu
value="#{properties.portalControlInternalError.value}"
-
disabled="#{properties.portalControlInternalError.inherited}"
- onchange="submit();">
- <f:selectItems value="#{properties.portalSelectItems}"/>
- </h:selectOneMenu>
- </td>
-</tr>
-<tr class="portlet-section-body">
- <td>
- <h:outputText
value="#{properties.portalControlNotFound.displayName}"/>
- </td>
- <td>
- <h:selectBooleanCheckbox
disabled="#{!properties.portalControlNotFound.inheritable}"
- onchange="submit();"
-
valueChangeListener="#{properties.portalControlNotFound.inherit}"
-
value="#{properties.portalControlNotFound.inherited}"/>inherit action
- from parent
- </td>
- <td>
- <h:selectOneMenu value="#{properties.portalControlNotFound.value}"
- disabled="#{properties.portalControlNotFound.inherited}"
onchange="submit();">
- <f:selectItems value="#{properties.portalSelectItems}"/>
- </h:selectOneMenu>
- </td>
-</tr>
-<tr class="portlet-section-body">
- <td>
- <h:outputText
value="#{properties.portalControlResourceURI.displayName}"/>
- </td>
- <td>
- <h:selectBooleanCheckbox
disabled="#{!properties.portalControlResourceURI.inheritable}"
- onchange="submit();"
-
valueChangeListener="#{properties.portalControlResourceURI.inherit}"
-
value="#{properties.portalControlResourceURI.inherited}"/>inherit
- action from parent
- </td>
- <td>
- <h:inputText value="#{properties.portalControlResourceURI.value}"
size="60"
-
disabled="#{properties.portalControlResourceURI.inherited}"/>
- </td>
-</tr>
-</tbody>
-</table>
-<h:commandButton value="Update" styleClass="portlet-form-button
portlet-section-buttonrow"/>
-</h:form>
-</td>
-</tr>
-</table>
-
-</div>
-
-</div>
Copied:
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/common/editPortalErrorHandling.xhtml
(from rev 7842,
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/common/editPortalErrorHandling.xhtml)
===================================================================
---
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/common/editPortalErrorHandling.xhtml
(rev 0)
+++
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/common/editPortalErrorHandling.xhtml 2007-08-06
09:16:45 UTC (rev 7865)
@@ -0,0 +1,149 @@
+<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:c="http://java.sun.com/jstl/core">
+
+<p class="portlet-area-header">Portal Error Handling</p>
+
+<div class="portlet-area-body">
+
+<!-- defines error handeling section -->
+<table cellpadding="0" cellspacing="0" width="100%">
+<tr>
+ <th class="portlet-section-title">Configure how the system handles
errors on portal level.</th>
+</tr>
+<tr>
+<td valign="top" class="portlet-section-body">
+
+<h:form>
+<table width="100%">
+<thead class="portlet-section-header"
style="text-align:left;">
+ <tr>
+ <th>Case</th>
+ <th>Inheritance</th>
+ <th>Action</th>
+ </tr>
+</thead>
+<tbody>
+<tr class="portlet-section-body">
+ <td>
+ <h:outputText
value="#{properties.portalControlAccessDenied.displayName}"/>
+ </td>
+ <td>
+ <h:selectBooleanCheckbox
disabled="#{!properties.portalControlAccessDenied.inheritable}"
+ onchange="submit();"
+
valueChangeListener="#{properties.portalControlAccessDenied.inherit}"
+
value="#{properties.portalControlAccessDenied.inherited}"/>inherit
+ action from parent
+ </td>
+ <td>
+ <h:selectOneMenu
value="#{properties.portalControlAccessDenied.value}"
+
disabled="#{properties.portalControlAccessDenied.inherited}"
+ onchange="submit();">
+ <f:selectItems value="#{properties.portalSelectItems}"/>
+ </h:selectOneMenu>
+ </td>
+</tr>
+<tr class="portlet-section-body">
+ <td>
+ <h:outputText
value="#{properties.portalControlUnavailable.displayName}"/>
+ </td>
+ <td>
+ <h:selectBooleanCheckbox
disabled="#{!properties.portalControlUnavailable.inheritable}"
+ onchange="submit();"
+
valueChangeListener="#{properties.portalControlUnavailable.inherit}"
+
value="#{properties.portalControlUnavailable.inherited}"/>inherit
+ action from parent
+ </td>
+ <td>
+ <h:selectOneMenu value="#{properties.portalControlUnavailable.value}"
+
disabled="#{properties.portalControlUnavailable.inherited}"
+ onchange="submit();">
+ <f:selectItems value="#{properties.portalSelectItems}"/>
+ </h:selectOneMenu>
+ </td>
+</tr>
+<tr class="portlet-section-body">
+ <td>
+ <h:outputText
value="#{properties.portalControlError.displayName}"/>
+ </td>
+ <td>
+ <h:selectBooleanCheckbox
disabled="#{!properties.portalControlError.inheritable}"
+ onchange="submit();"
+
valueChangeListener="#{properties.portalControlError.inherit}"
+
value="#{properties.portalControlError.inherited}"/>inherit action from
+ parent
+ </td>
+ <td>
+ <h:selectOneMenu value="#{properties.portalControlError.value}"
+ disabled="#{properties.portalControlError.inherited}"
onchange="submit();">
+ <f:selectItems value="#{properties.portalSelectItems}"/>
+ </h:selectOneMenu>
+ </td>
+</tr>
+<tr class="portlet-section-body">
+ <td>
+ <h:outputText
value="#{properties.portalControlInternalError.displayName}"/>
+ </td>
+ <td>
+ <h:selectBooleanCheckbox
disabled="#{!properties.portalControlInternalError.inheritable}"
+ onchange="submit();"
+
valueChangeListener="#{properties.portalControlInternalError.inherit}"
+
value="#{properties.portalControlInternalError.inherited}"/>inherit
+ action from parent
+ </td>
+ <td>
+ <h:selectOneMenu
value="#{properties.portalControlInternalError.value}"
+
disabled="#{properties.portalControlInternalError.inherited}"
+ onchange="submit();">
+ <f:selectItems value="#{properties.portalSelectItems}"/>
+ </h:selectOneMenu>
+ </td>
+</tr>
+<tr class="portlet-section-body">
+ <td>
+ <h:outputText
value="#{properties.portalControlNotFound.displayName}"/>
+ </td>
+ <td>
+ <h:selectBooleanCheckbox
disabled="#{!properties.portalControlNotFound.inheritable}"
+ onchange="submit();"
+
valueChangeListener="#{properties.portalControlNotFound.inherit}"
+
value="#{properties.portalControlNotFound.inherited}"/>inherit action
+ from parent
+ </td>
+ <td>
+ <h:selectOneMenu value="#{properties.portalControlNotFound.value}"
+ disabled="#{properties.portalControlNotFound.inherited}"
onchange="submit();">
+ <f:selectItems value="#{properties.portalSelectItems}"/>
+ </h:selectOneMenu>
+ </td>
+</tr>
+<tr class="portlet-section-body">
+ <td>
+ <h:outputText
value="#{properties.portalControlResourceURI.displayName}"/>
+ </td>
+ <td>
+ <h:selectBooleanCheckbox
disabled="#{!properties.portalControlResourceURI.inheritable}"
+ onchange="submit();"
+
valueChangeListener="#{properties.portalControlResourceURI.inherit}"
+
value="#{properties.portalControlResourceURI.inherited}"/>inherit
+ action from parent
+ </td>
+ <td>
+ <h:inputText value="#{properties.portalControlResourceURI.value}"
size="60"
+
disabled="#{properties.portalControlResourceURI.inherited}"/>
+ </td>
+</tr>
+</tbody>
+</table>
+<h:commandButton value="Update" styleClass="portlet-form-button
portlet-section-buttonrow"/>
+</h:form>
+</td>
+</tr>
+</table>
+
+</div>
+
+</div>
Deleted:
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/common/editPreferences.xhtml
===================================================================
---
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/common/editPreferences.xhtml 2007-07-30
12:59:36 UTC (rev 7842)
+++
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/common/editPreferences.xhtml 2007-08-06
09:16:45 UTC (rev 7865)
@@ -1,98 +0,0 @@
-<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:c="http://java.sun.com/jstl/core">
-
- <h:form>
- <table width="100%">
- <thead class="portlet-section-header"
style="text-align:left;">
- <tr>
- <th>Key</th>
- <th>Name</th>
- <th>ReadOnly</th>
- <c:if test="#{prefs.mutable}">
- <th>Value</th>
- </c:if>
- </tr>
- </thead>
- <tbody>
- <c:forEach items="#{prefs.entries}" var="pref"
varStatus="status">
- <tr class="#{status.index % 2 == 0 ?
'portlet-section-body' : 'portlet-section-alternate'}">
- <td>
- <c:choose>
- <c:when test="#{prefs.mutable and pref.readOnly ==
false}">
- <h:commandLink
- rendered="#{pref.readOnly == false}"
-
action="#{pref.select}">#{pref.name}</h:commandLink>
- </c:when>
- <c:otherwise>#{pref.name}</c:otherwise>
- </c:choose>
- </td>
- <td>
- <h:outputText value="#{pref.displayName}"/>
- </td>
- <td>
- <h:selectBooleanCheckbox disabled="true"
value="#{pref.readOnly}"/>
- </td>
- <c:if test="#{prefs.mutable}">
- <td>
- <h:outputText value="#{pref.value}"/>
- </td>
- </c:if>
- </tr>
- </c:forEach>
- </tbody>
- </table>
- </h:form>
-
- <c:if test="#{prefs.selectedEntry != null}">
- <h:form style="padding: 1em 0 1em 0">
- <fieldset style="border: 1px solid;">
- <legend>Edit existing values</legend>
- <table>
- <tbody>
- <c:forEach items="#{prefs.selectedEntry.indices}"
var="index" varStatus="status">
- <tr>
- <td>
- <h:outputLabel for="row_#{status.index}">
- <h:outputText value="Value #{status.index}: "
styleClass="portlet-form-field-label"/>
- </h:outputLabel>
- </td>
- <td>
- <h:inputText
value="#{prefs.selectedEntry[index]}"
styleClass="portlet-form-input-field"/>
- </td>
- <td>
- <h:commandButton
- id="row_#{status.index}"
-
actionListener="#{prefs.selectedEntry.deleteLine}"
- value="Delete"
- styleClass="portlet-form-button"/>
- </td>
- </tr>
- </c:forEach>
- <tr>
- <td colspan="3">
- <h:commandButton value="Update"
styleClass="portlet-form-button"/>
- </td>
- </tr>
- </tbody>
- </table>
- </fieldset>
- </h:form>
-
- <h:form>
- <fieldset style="border: 1px solid;">
- <legend>Append a value</legend>
- <h:outputLabel for="new_value">
- <h:outputText value="New value: "
styleClass="portlet-form-field-label"/>
- </h:outputLabel>
- <h:inputText id="new_value"
value="#{prefs.selectedEntry.line}"
styleClass="portlet-form-input-field"/>
- <h:commandButton action="#{prefs.selectedEntry.appendLine}"
value="Append" styleClass="portlet-form-button"/>
- </fieldset>
- </h:form>
-
- </c:if>
-
-</div>
Copied:
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/common/editPreferences.xhtml
(from rev 7842,
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/common/editPreferences.xhtml)
===================================================================
---
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/common/editPreferences.xhtml
(rev 0)
+++
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/common/editPreferences.xhtml 2007-08-06
09:16:45 UTC (rev 7865)
@@ -0,0 +1,98 @@
+<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:c="http://java.sun.com/jstl/core">
+
+ <h:form>
+ <table width="100%">
+ <thead class="portlet-section-header"
style="text-align:left;">
+ <tr>
+ <th>Key</th>
+ <th>Name</th>
+ <th>ReadOnly</th>
+ <c:if test="#{prefs.mutable}">
+ <th>Value</th>
+ </c:if>
+ </tr>
+ </thead>
+ <tbody>
+ <c:forEach items="#{prefs.entries}" var="pref"
varStatus="status">
+ <tr class="#{status.index % 2 == 0 ?
'portlet-section-body' : 'portlet-section-alternate'}">
+ <td>
+ <c:choose>
+ <c:when test="#{prefs.mutable and pref.readOnly ==
false}">
+ <h:commandLink
+ rendered="#{pref.readOnly == false}"
+
action="#{pref.select}">#{pref.name}</h:commandLink>
+ </c:when>
+ <c:otherwise>#{pref.name}</c:otherwise>
+ </c:choose>
+ </td>
+ <td>
+ <h:outputText value="#{pref.displayName}"/>
+ </td>
+ <td>
+ <h:selectBooleanCheckbox disabled="true"
value="#{pref.readOnly}"/>
+ </td>
+ <c:if test="#{prefs.mutable}">
+ <td>
+ <h:outputText value="#{pref.value}"/>
+ </td>
+ </c:if>
+ </tr>
+ </c:forEach>
+ </tbody>
+ </table>
+ </h:form>
+
+ <c:if test="#{prefs.selectedEntry != null}">
+ <h:form style="padding: 1em 0 1em 0">
+ <fieldset style="border: 1px solid;">
+ <legend>Edit existing values</legend>
+ <table>
+ <tbody>
+ <c:forEach items="#{prefs.selectedEntry.indices}"
var="index" varStatus="status">
+ <tr>
+ <td>
+ <h:outputLabel for="row_#{status.index}">
+ <h:outputText value="Value #{status.index}: "
styleClass="portlet-form-field-label"/>
+ </h:outputLabel>
+ </td>
+ <td>
+ <h:inputText
value="#{prefs.selectedEntry[index]}"
styleClass="portlet-form-input-field"/>
+ </td>
+ <td>
+ <h:commandButton
+ id="row_#{status.index}"
+
actionListener="#{prefs.selectedEntry.deleteLine}"
+ value="Delete"
+ styleClass="portlet-form-button"/>
+ </td>
+ </tr>
+ </c:forEach>
+ <tr>
+ <td colspan="3">
+ <h:commandButton value="Update"
styleClass="portlet-form-button"/>
+ </td>
+ </tr>
+ </tbody>
+ </table>
+ </fieldset>
+ </h:form>
+
+ <h:form>
+ <fieldset style="border: 1px solid;">
+ <legend>Append a value</legend>
+ <h:outputLabel for="new_value">
+ <h:outputText value="New value: "
styleClass="portlet-form-field-label"/>
+ </h:outputLabel>
+ <h:inputText id="new_value"
value="#{prefs.selectedEntry.line}"
styleClass="portlet-form-input-field"/>
+ <h:commandButton action="#{prefs.selectedEntry.appendLine}"
value="Append" styleClass="portlet-form-button"/>
+ </fieldset>
+ </h:form>
+
+ </c:if>
+
+</div>
Deleted:
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/common/editProperties.xhtml
===================================================================
---
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/common/editProperties.xhtml 2007-07-30
12:59:36 UTC (rev 7842)
+++
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/common/editProperties.xhtml 2007-08-06
09:16:45 UTC (rev 7865)
@@ -1,142 +0,0 @@
-<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:c="http://java.sun.com/jstl/core">
-
-<div class="portlet-area-header">Properties</div>
-<div class="portlet-area-body">
-
-<!-- divide the area body into two panes -->
-<table cellpadding="0" cellspacing="0" width="100%">
-<tr>
-<td>
-
- <!-- defines property creation section -->
- <table cellpadding="0" cellspacing="0"
width="100%">
- <tr>
- <th class="portlet-section-title">Add a property.</th>
- </tr>
- <tr>
- <td valign="top" class="portlet-section-body">
-
- <h:form>
-
- <!-- defines layout of property form -->
- <table>
- <tbody>
- <tr>
- <td class="portlet-form-field-label">
- <h:outputLabel for="predefinedProperty"
styleClass="portlet-form-field-label">Select
- predefined property:</h:outputLabel>
- </td>
- </tr>
- <tr>
- <td>
- <h:selectOneMenu id="predefinedProperty"
value="#{properties.action.selectedProperty}">
- <f:selectItems
value="#{properties.propertyItems}"/>
- </h:selectOneMenu>
- </td>
- </tr>
- <tr>
- <td align="center">or</td>
- </tr>
- <tr>
- <td class="portlet-form-field-label">
- <h:outputLabel for="property"
styleClass="portlet-form-field-label">Enter property
- name:</h:outputLabel>
- </td>
- </tr>
- <tr>
- <td>
- <h:inputText id="property"
styleClass="portlet-form-input-field"
-
value="#{properties.action.otherPropertyName}"/>
- </td>
- </tr>
- </tbody>
- </table>
- <!-- ends layout of property form -->
- <h:commandButton value="Add Property"
styleClass="portlet-form-button portlet-section-buttonrow"
-
action="#{properties.action.updateProperty}"/></h:form>
-
- </td>
- </tr>
- </table>
- <!-- ends property creation section -->
-
-</td>
-<td valign="top" width="100%"
style="padding-left:5px;"><!-- creates division of 2 pane area -->
-
-
- <!-- defines property list section -->
- <c:if test="#{!empty properties.entries}">
- <table cellpadding="0" cellspacing="0"
width="100%">
- <tr>
- <th class="portlet-section-title">Manage currently defined
properties.</th>
- </tr>
- <tr>
- <td class="portlet-section-body" valign="top">
-
- <h:form>
- <!-- defines layout of property table -->
- <table width="100%">
- <thead class="portlet-section-header">
- <tr>
- <th>Name</th>
- <th>Description</th>
- <th>Inherited</th>
- <th>Value</th>
- <th>Delete</th>
- </tr>
- </thead>
- <tbody>
- <c:forEach items="#{properties.entries}"
var="prop" varStatus="status">
- <tr class="#{status.index % 2 == 0 ?
'portlet-section-body' : 'portlet-section-alternate'}">
- <td>
- <h:outputText title="#{prop.name}"
value="#{prop.displayName}"/>
- </td>
- <td>
-
<h:outputText>#{prop.description}</h:outputText>
- </td>
- <td>#{prop.inherited ? 'Yes' :
'No'}</td>
- <td>
- <c:choose>
- <c:when test="#{prop.type ==
'java.lang.Boolean'}">
- <h:selectBooleanCheckbox
value="#{prop.value}"
-
readonly="#{prop.readOnly}"/>
- </c:when>
- <c:otherwise>
- <h:inputText
styleClass="portlet-form-input-field" value="#{prop.value}"
-
readonly="#{prop.readOnly}"/>
- </c:otherwise>
- </c:choose>
- </td>
- <td>
- <h:commandLink
action="#{properties.action.removeProperty}"
-
rendered="#{!prop.inherited}">
- <h:outputText value="Delete"/>
- <f:param name="name"
value="#{prop.name}"/>
- </h:commandLink>
- </td>
- </tr>
- </c:forEach>
- </tbody>
- </table>
- <!-- ends property list -->
- <h:commandButton value="Update"
styleClass="portlet-form-button portlet-section-buttonrow"/></h:form>
-
- </td>
- </tr>
- </table>
- </c:if>
- <!-- ends property list section -->
-
-</td>
-</tr>
-</table>
-<!-- ends area body -->
-
-</div>
-
-</div>
Copied:
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/common/editProperties.xhtml
(from rev 7842,
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/common/editProperties.xhtml)
===================================================================
---
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/common/editProperties.xhtml
(rev 0)
+++
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/common/editProperties.xhtml 2007-08-06
09:16:45 UTC (rev 7865)
@@ -0,0 +1,142 @@
+<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:c="http://java.sun.com/jstl/core">
+
+<div class="portlet-area-header">Properties</div>
+<div class="portlet-area-body">
+
+<!-- divide the area body into two panes -->
+<table cellpadding="0" cellspacing="0" width="100%">
+<tr>
+<td>
+
+ <!-- defines property creation section -->
+ <table cellpadding="0" cellspacing="0"
width="100%">
+ <tr>
+ <th class="portlet-section-title">Add a property.</th>
+ </tr>
+ <tr>
+ <td valign="top" class="portlet-section-body">
+
+ <h:form>
+
+ <!-- defines layout of property form -->
+ <table>
+ <tbody>
+ <tr>
+ <td class="portlet-form-field-label">
+ <h:outputLabel for="predefinedProperty"
styleClass="portlet-form-field-label">Select
+ predefined property:</h:outputLabel>
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <h:selectOneMenu id="predefinedProperty"
value="#{properties.action.selectedProperty}">
+ <f:selectItems
value="#{properties.propertyItems}"/>
+ </h:selectOneMenu>
+ </td>
+ </tr>
+ <tr>
+ <td align="center">or</td>
+ </tr>
+ <tr>
+ <td class="portlet-form-field-label">
+ <h:outputLabel for="property"
styleClass="portlet-form-field-label">Enter property
+ name:</h:outputLabel>
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <h:inputText id="property"
styleClass="portlet-form-input-field"
+
value="#{properties.action.otherPropertyName}"/>
+ </td>
+ </tr>
+ </tbody>
+ </table>
+ <!-- ends layout of property form -->
+ <h:commandButton value="Add Property"
styleClass="portlet-form-button portlet-section-buttonrow"
+
action="#{properties.action.updateProperty}"/></h:form>
+
+ </td>
+ </tr>
+ </table>
+ <!-- ends property creation section -->
+
+</td>
+<td valign="top" width="100%"
style="padding-left:5px;"><!-- creates division of 2 pane area -->
+
+
+ <!-- defines property list section -->
+ <c:if test="#{!empty properties.entries}">
+ <table cellpadding="0" cellspacing="0"
width="100%">
+ <tr>
+ <th class="portlet-section-title">Manage currently defined
properties.</th>
+ </tr>
+ <tr>
+ <td class="portlet-section-body" valign="top">
+
+ <h:form>
+ <!-- defines layout of property table -->
+ <table width="100%">
+ <thead class="portlet-section-header">
+ <tr>
+ <th>Name</th>
+ <th>Description</th>
+ <th>Inherited</th>
+ <th>Value</th>
+ <th>Delete</th>
+ </tr>
+ </thead>
+ <tbody>
+ <c:forEach items="#{properties.entries}"
var="prop" varStatus="status">
+ <tr class="#{status.index % 2 == 0 ?
'portlet-section-body' : 'portlet-section-alternate'}">
+ <td>
+ <h:outputText title="#{prop.name}"
value="#{prop.displayName}"/>
+ </td>
+ <td>
+
<h:outputText>#{prop.description}</h:outputText>
+ </td>
+ <td>#{prop.inherited ? 'Yes' :
'No'}</td>
+ <td>
+ <c:choose>
+ <c:when test="#{prop.type ==
'java.lang.Boolean'}">
+ <h:selectBooleanCheckbox
value="#{prop.value}"
+
readonly="#{prop.readOnly}"/>
+ </c:when>
+ <c:otherwise>
+ <h:inputText
styleClass="portlet-form-input-field" value="#{prop.value}"
+
readonly="#{prop.readOnly}"/>
+ </c:otherwise>
+ </c:choose>
+ </td>
+ <td>
+ <h:commandLink
action="#{properties.action.removeProperty}"
+
rendered="#{!prop.inherited}">
+ <h:outputText value="Delete"/>
+ <f:param name="name"
value="#{prop.name}"/>
+ </h:commandLink>
+ </td>
+ </tr>
+ </c:forEach>
+ </tbody>
+ </table>
+ <!-- ends property list -->
+ <h:commandButton value="Update"
styleClass="portlet-form-button portlet-section-buttonrow"/></h:form>
+
+ </td>
+ </tr>
+ </table>
+ </c:if>
+ <!-- ends property list section -->
+
+</td>
+</tr>
+</table>
+<!-- ends area body -->
+
+</div>
+
+</div>
Deleted:
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/common/editSecurity.xhtml
===================================================================
---
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/common/editSecurity.xhtml 2007-07-30
12:59:36 UTC (rev 7842)
+++
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/common/editSecurity.xhtml 2007-08-06
09:16:45 UTC (rev 7865)
@@ -1,42 +0,0 @@
-<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:c="http://java.sun.com/jstl/core">
-
- <h:form>
- <table>
- <thead class="portlet-section-header">
- <tr>
- <th>Roles</th>
- <th>Permissions</th>
- </tr>
- </thead>
- <tbody>
- <c:forEach items="#{auth.roles}" var="role"
varStatus="status">
- <tr class="#{status.index % 2 == 0 ?
'portlet-section-body' : 'portlet-section-alternate'}">
- <td>
- <h:outputLabel for="cars_#{status.index}">
- Role #{role == '__unchecked__' ? 'Unchecked' :
(auth.roleDisplayNameMap[role] != null ? auth.roleDisplayNameMap[role] : role)}:
- </h:outputLabel>
- </td>
- <td>
- <h:selectManyCheckbox
- id="cars_#{status.index}"
- value="#{auth.forRole[role]}"
- layout="lineDirection">
- <f:selectItems
value="#{auth.availableActions}"/>
- </h:selectManyCheckbox>
- </td>
- </tr>
- </c:forEach>
- </tbody>
- </table>
- <div>
- <h:commandButton value="Update" action="#{auth.submit}"
styleClass="portlet-form-button"/>
- <h:commandButton value="Cancel" action="#{auth.cancel}"
styleClass="portlet-form-button" immediate="true"/>
- </div>
- </h:form>
-
-</div>
\ No newline at end of file
Copied:
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/common/editSecurity.xhtml
(from rev 7842,
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/common/editSecurity.xhtml)
===================================================================
--- trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/common/editSecurity.xhtml
(rev 0)
+++
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/common/editSecurity.xhtml 2007-08-06
09:16:45 UTC (rev 7865)
@@ -0,0 +1,42 @@
+<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:c="http://java.sun.com/jstl/core">
+
+ <h:form>
+ <table>
+ <thead class="portlet-section-header">
+ <tr>
+ <th>Roles</th>
+ <th>Permissions</th>
+ </tr>
+ </thead>
+ <tbody>
+ <c:forEach items="#{auth.roles}" var="role"
varStatus="status">
+ <tr class="#{status.index % 2 == 0 ?
'portlet-section-body' : 'portlet-section-alternate'}">
+ <td>
+ <h:outputLabel for="cars_#{status.index}">
+ Role #{role == '__unchecked__' ? 'Unchecked' :
(auth.roleDisplayNameMap[role] != null ? auth.roleDisplayNameMap[role] : role)}:
+ </h:outputLabel>
+ </td>
+ <td>
+ <h:selectManyCheckbox
+ id="cars_#{status.index}"
+ value="#{auth.forRole[role]}"
+ layout="lineDirection">
+ <f:selectItems
value="#{auth.availableActions}"/>
+ </h:selectManyCheckbox>
+ </td>
+ </tr>
+ </c:forEach>
+ </tbody>
+ </table>
+ <div>
+ <h:commandButton value="Update" action="#{auth.submit}"
styleClass="portlet-form-button"/>
+ <h:commandButton value="Cancel" action="#{auth.cancel}"
styleClass="portlet-form-button" immediate="true"/>
+ </div>
+ </h:form>
+
+</div>
\ No newline at end of file
Deleted:
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/common/editTheme.xhtml
===================================================================
---
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/common/editTheme.xhtml 2007-07-30
12:59:36 UTC (rev 7842)
+++
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/common/editTheme.xhtml 2007-08-06
09:16:45 UTC (rev 7865)
@@ -1,49 +0,0 @@
-<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">
-
- <h:panelGroup styleClass="portlet-section-body"
id="themepg">
- <h:form id="themeform">
- <table>
- <tbody>
- <tr>
- <td class="portlet-form-field-label">
- <h:outputLabel
for="layout">Layout:</h:outputLabel>
- </td>
- <td>
- <h:selectOneMenu id="layout"
styleClass="portlet-form-field" value="#{theme.layoutName}">
- <f:selectItems
value="#{applicationScope.LayoutService.layoutItems}"/>
- </h:selectOneMenu>
- </td>
- </tr>
- <tr>
- <td class="portlet-form-field-label">
- <h:outputLabel
for="theme">Theme:</h:outputLabel>
- </td>
- <td>
- <h:selectOneMenu id="theme"
styleClass="portlet-form-field" value="#{theme.themeName}">
- <f:selectItems
value="#{applicationScope.ThemeService.themeItems}"/>
- </h:selectOneMenu>
- </td>
- </tr>
- <tr>
- <td class="portlet-form-field-label">
- <h:outputLabel
for="renderSet">RenderSet:</h:outputLabel>
- </td>
- <td>
- <h:selectOneMenu id="renderSet"
styleClass="portlet-form-field" value="#{theme.renderSetName}">
- <f:selectItems
value="#{applicationScope.LayoutService.renderSetItems}"/>
- </h:selectOneMenu>
- </td>
- </tr>
- </tbody>
- </table>
-
- <br />
- <ui:insert name="form_submit"/>
-
- </h:form>
- </h:panelGroup>
-</div>
\ No newline at end of file
Copied: trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/common/editTheme.xhtml
(from rev 7842,
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/common/editTheme.xhtml)
===================================================================
--- trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/common/editTheme.xhtml
(rev 0)
+++
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/common/editTheme.xhtml 2007-08-06
09:16:45 UTC (rev 7865)
@@ -0,0 +1,49 @@
+<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">
+
+ <h:panelGroup styleClass="portlet-section-body"
id="themepg">
+ <h:form id="themeform">
+ <table>
+ <tbody>
+ <tr>
+ <td class="portlet-form-field-label">
+ <h:outputLabel
for="layout">Layout:</h:outputLabel>
+ </td>
+ <td>
+ <h:selectOneMenu id="layout"
styleClass="portlet-form-field" value="#{theme.layoutName}">
+ <f:selectItems
value="#{applicationScope.LayoutService.layoutItems}"/>
+ </h:selectOneMenu>
+ </td>
+ </tr>
+ <tr>
+ <td class="portlet-form-field-label">
+ <h:outputLabel
for="theme">Theme:</h:outputLabel>
+ </td>
+ <td>
+ <h:selectOneMenu id="theme"
styleClass="portlet-form-field" value="#{theme.themeName}">
+ <f:selectItems
value="#{applicationScope.ThemeService.themeItems}"/>
+ </h:selectOneMenu>
+ </td>
+ </tr>
+ <tr>
+ <td class="portlet-form-field-label">
+ <h:outputLabel
for="renderSet">RenderSet:</h:outputLabel>
+ </td>
+ <td>
+ <h:selectOneMenu id="renderSet"
styleClass="portlet-form-field" value="#{theme.renderSetName}">
+ <f:selectItems
value="#{applicationScope.LayoutService.renderSetItems}"/>
+ </h:selectOneMenu>
+ </td>
+ </tr>
+ </tbody>
+ </table>
+
+ <br />
+ <ui:insert name="form_submit"/>
+
+ </h:form>
+ </h:panelGroup>
+</div>
\ No newline at end of file
Deleted:
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/common/editWindowTheme.xhtml
===================================================================
---
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/common/editWindowTheme.xhtml 2007-07-30
12:59:36 UTC (rev 7842)
+++
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/common/editWindowTheme.xhtml 2007-08-06
09:16:45 UTC (rev 7865)
@@ -1,48 +0,0 @@
-<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">
-
- <h:panelGroup styleClass="portlet-section-body"
id="themepg">
- <h:form id="themeform">
- <fieldset style="border: 1px solid;">
- <legend>Theme properties</legend>
- <table>
- <tbody>
- <tr>
- <td class="portlet-form-field-label"><label
class="portlet-form-field-label">Window Renderer:</label>
- </td>
- <td>
- <h:selectOneMenu styleClass="portlet-form-field"
value="#{theme.windowRendererName}">
- <f:selectItems
value="#{applicationScope.LayoutService.renderSetItems}"/>
- </h:selectOneMenu>
- </td>
- </tr>
- <tr>
- <td class="portlet-form-field-label"><label
class="portlet-form-field-label">Decoration Renderer:</label>
- </td>
- <td>
- <h:selectOneMenu styleClass="portlet-form-field"
value="#{theme.decorationRendererName}">
- <f:selectItems
value="#{applicationScope.LayoutService.renderSetItems}"/>
- </h:selectOneMenu>
- </td>
- </tr>
- <tr>
- <td class="portlet-form-field-label"><label
class="portlet-form-field-label">Portlet Renderer:</label>
- </td>
- <td>
- <h:selectOneMenu styleClass="portlet-form-field"
value="#{theme.portletRendererName}">
- <f:selectItems
value="#{applicationScope.LayoutService.renderSetItems}"/>
- </h:selectOneMenu>
- </td>
- </tr>
- </tbody>
- </table>
- </fieldset>
- <div style="text-align:center;padding: 1em 0 1em 0">
- <ui:insert name="form_submit"/>
- </div>
- </h:form>
-</h:panelGroup>
-</div>
\ No newline at end of file
Copied:
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/common/editWindowTheme.xhtml
(from rev 7842,
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/common/editWindowTheme.xhtml)
===================================================================
---
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/common/editWindowTheme.xhtml
(rev 0)
+++
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/common/editWindowTheme.xhtml 2007-08-06
09:16:45 UTC (rev 7865)
@@ -0,0 +1,48 @@
+<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">
+
+ <h:panelGroup styleClass="portlet-section-body"
id="themepg">
+ <h:form id="themeform">
+ <fieldset style="border: 1px solid;">
+ <legend>Theme properties</legend>
+ <table>
+ <tbody>
+ <tr>
+ <td class="portlet-form-field-label"><label
class="portlet-form-field-label">Window Renderer:</label>
+ </td>
+ <td>
+ <h:selectOneMenu styleClass="portlet-form-field"
value="#{theme.windowRendererName}">
+ <f:selectItems
value="#{applicationScope.LayoutService.renderSetItems}"/>
+ </h:selectOneMenu>
+ </td>
+ </tr>
+ <tr>
+ <td class="portlet-form-field-label"><label
class="portlet-form-field-label">Decoration Renderer:</label>
+ </td>
+ <td>
+ <h:selectOneMenu styleClass="portlet-form-field"
value="#{theme.decorationRendererName}">
+ <f:selectItems
value="#{applicationScope.LayoutService.renderSetItems}"/>
+ </h:selectOneMenu>
+ </td>
+ </tr>
+ <tr>
+ <td class="portlet-form-field-label"><label
class="portlet-form-field-label">Portlet Renderer:</label>
+ </td>
+ <td>
+ <h:selectOneMenu styleClass="portlet-form-field"
value="#{theme.portletRendererName}">
+ <f:selectItems
value="#{applicationScope.LayoutService.renderSetItems}"/>
+ </h:selectOneMenu>
+ </td>
+ </tr>
+ </tbody>
+ </table>
+ </fieldset>
+ <div style="text-align:center;padding: 1em 0 1em 0">
+ <ui:insert name="form_submit"/>
+ </div>
+ </h:form>
+</h:panelGroup>
+</div>
\ No newline at end of file
Deleted:
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/common/showPortletDetails.xhtml
===================================================================
---
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/common/showPortletDetails.xhtml 2007-07-30
12:59:36 UTC (rev 7842)
+++
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/common/showPortletDetails.xhtml 2007-08-06
09:16:45 UTC (rev 7865)
@@ -1,39 +0,0 @@
-<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:c="http://java.sun.com/jstl/core">
-
- <table>
- <tr>
- <td class="portlet-form-field-label">Portlet name:</td>
- <td><h:form><h:commandLink
- action="#{portletmgr.selectPortlet}">
- <f:param name="id"
value="#{portlet.context.id}"/>
- <f:param name="plugin"
value="manager"/>
- #{portlet.name.value}
- </h:commandLink></h:form></td>
- </tr>
- <tr>
- <td class="portlet-form-field-label">Portlet
description:</td>
- <td>#{portlet.description.value}</td>
- </tr>
- <tr>
- <td class="portlet-form-field-label">Portlet title:</td>
- <td>#{portlet.title.value}</td>
- </tr>
- <tr>
- <td class="portlet-form-field-label">Portlet
keywords:</td>
- <td>#{portlet.keywords.value}</td>
- </tr>
- <c:if test="#{not empty portlet.locales}">
- <tr>
- <td class="portlet-form-field-label">Portlet
locales:</td>
- <td>
- <c:forEach items="#{portlet.locales}"
var="locale"> #{locale} </c:forEach>
- </td>
- </tr>
- </c:if>
- </table>
-</div>
\ No newline at end of file
Copied:
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/common/showPortletDetails.xhtml
(from rev 7842,
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/common/showPortletDetails.xhtml)
===================================================================
---
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/common/showPortletDetails.xhtml
(rev 0)
+++
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/common/showPortletDetails.xhtml 2007-08-06
09:16:45 UTC (rev 7865)
@@ -0,0 +1,39 @@
+<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:c="http://java.sun.com/jstl/core">
+
+ <table>
+ <tr>
+ <td class="portlet-form-field-label">Portlet name:</td>
+ <td><h:form><h:commandLink
+ action="#{portletmgr.selectPortlet}">
+ <f:param name="id"
value="#{portlet.context.id}"/>
+ <f:param name="plugin"
value="manager"/>
+ #{portlet.name.value}
+ </h:commandLink></h:form></td>
+ </tr>
+ <tr>
+ <td class="portlet-form-field-label">Portlet
description:</td>
+ <td>#{portlet.description.value}</td>
+ </tr>
+ <tr>
+ <td class="portlet-form-field-label">Portlet title:</td>
+ <td>#{portlet.title.value}</td>
+ </tr>
+ <tr>
+ <td class="portlet-form-field-label">Portlet
keywords:</td>
+ <td>#{portlet.keywords.value}</td>
+ </tr>
+ <c:if test="#{not empty portlet.locales}">
+ <tr>
+ <td class="portlet-form-field-label">Portlet
locales:</td>
+ <td>
+ <c:forEach items="#{portlet.locales}"
var="locale"> #{locale} </c:forEach>
+ </td>
+ </tr>
+ </c:if>
+ </table>
+</div>
\ No newline at end of file
Copied:
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/confirmDeleteInstance.xhtml
(from rev 7842,
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/confirmDeleteInstance.xhtml)
===================================================================
---
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/confirmDeleteInstance.xhtml
(rev 0)
+++
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/confirmDeleteInstance.xhtml 2007-08-06
09:16:45 UTC (rev 7865)
@@ -0,0 +1,22 @@
+<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:jbp="http://www.jboss.org/portal"
+
xmlns:c="http://java.sun.com/jstl/core"
+ class="admin-ui">
+
+ <p class="portlet-msg-alert">WARNING ! You are about to delete the
following portlet instance:</p>
+
+ <h:outputText value="#{instancemgr.selectedInstance.id}"/>
+
+ <p class="portlet-class">Are you sure ?</p>
+
+ <h:form>
+ <h:commandButton value="Yes" action="instances"
actionListener="#{instancemgr.deleteInstance}"
styleClass="portlet-form-button">
+ <f:attribute name="instanceId"
value="#{instancemgr.selectedInstance.id}"/>
+ </h:commandButton>
+ <h:commandButton value="No" action="instances"
actionListener="objects" styleClass="portlet-form-button"/>
+ </h:form>
+</div>
\ No newline at end of file
Copied: trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/dashboard (from rev
7842, trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/dashboard)
Deleted:
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-07-30
12:59:36 UTC (rev 7842)
+++
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/dashboard/dashboard.xhtml 2007-08-06
09:16:45 UTC (rev 7865)
@@ -1,145 +0,0 @@
-<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">
-
-
-<div align="center">
- <h:message id="error" for="error"
errorClass="portlet-msg-error"/>
-</div>
-
-<table width="100%">
-<tr>
- <th colspan="2" class="portlet-section-header"
align="center">Personal Dashboard Editor</th>
-</tr>
-<tr>
- <td class="portlet-section-body" align="center">
- <table width="100%">
- <tr>
- <td width="250">
- <table class="bottombuttonbar">
- <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="#{addDashboardPageAction.pageName}"
-
styleClass="portlet-form-input-field"/>
- <h:commandButton value="Save"
-
action="#{addDashboardPageAction.execute}"
-
styleClass="portlet-form-button"/>
- </h:form>
- </td>
- </tr>
- </table>
- </td>
- <td align="left" valign="top">
- Use this page to manage the content and appearance of your dashboard
pages. <br/>
- You can control the page titles, column layouts, page themes,
- and add,
- order, or remove portlets.
- </td>
- </tr>
- </table>
- </td>
-</tr>
-<tr>
- <th colspan="2" class="portlet-section-header"
align="center">Currently editing page
#{dashboard.selectedPage.name}</th>
-</tr>
-<tr>
- <td class="portlet-section-body" align="center">
- <h:form id="page_selector_form"
style="padding:0;margin:0">
- Select: <h:selectOneMenu
- id="pageNameSelector"
- value="#{dashboard.selectedPageName}"
- styleClass="portlet-form-field"
-
onchange="document.getElementById('page_selector_form').submit()">
- <f:selectItems value="#{dashboard.pageItems}"/>
- </h:selectOneMenu>
- </h:form>
- <br/>
- </td>
-</tr>
-<tr>
- <td>
- <table width="100%">
- <tr>
- <td valign="top" width="250">
- <table class="bottombuttonbar">
- <tr>
- <td valign="top">
- <b>Theme and Layout</b>
- <br/>
- Apply a theme to your dashboard, or select the number of
columns for the layout.
- <hr/>
- </td>
- </tr>
- <tr>
- <td>
- <h:form>
- Choose a layout:<br/>
- <h:selectOneMenu
- id="layoutSelector"
- value="#{dashboard.selectedPageLayout}"
- styleClass="portlet-form-field">
- <f:selectItems
value="#{applicationScope.LayoutService.layoutItems}"/>
- </h:selectOneMenu>
- <h:commandButton value="Select"
styleClass="portlet-form-button"
action="#{dashboard.updateLayout}"/>
- </h:form>
- </td>
- </tr>
- <tr>
- <td height="20"></td>
- </tr>
- <tr>
- <td>
- <h:form>
- Choose a theme:<br/>
- <h:selectOneMenu
- id="themeSelector"
- value="#{dashboard.selectedPageTheme}"
- styleClass="portlet-form-field">
- <f:selectItems
value="#{applicationScope.ThemeService.themeItems}"/>
- </h:selectOneMenu>
- <h:commandButton value="Select"
styleClass="portlet-form-button"
action="#{dashboard.updateTheme}"/>
- </h:form>
- </td>
- </tr>
- <tr>
- <td height="20"></td>
- </tr>
- </table>
- </td>
- <td>
- <table>
- <tr>
- <td>
- <div class="admin-ui">
- <ui:include
src="/WEB-INF/jsf/common/editPageLayout.xhtml">
- <ui:param name="pageManager"
value="#{dashboard.pageManager}"/>
- </ui:include>
- </div>
- </td>
- </tr>
- </table>
- </td>
- </tr>
- </table>
- </td>
-</tr>
-</table>
-<hr/>
-<c:if test="#{dashboard.selectePageIsDefault == false}">
- <table width="100%">
- <tr>
- <td align="left">
- <h:form style="padding:0;margin:0">
- <h:commandButton value="Delete this Page"
styleClass="portlet-form-button"
action="#{dashboard.destroyPage}"/>
- <br/>
- <font color="red">You cannot undo this
action!</font>
- </h:form>
- </td>
- </tr>
- </table>
-</c:if>
-</div>
Copied:
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/dashboard/dashboard.xhtml
(from rev 7842,
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
(rev 0)
+++
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/dashboard/dashboard.xhtml 2007-08-06
09:16:45 UTC (rev 7865)
@@ -0,0 +1,145 @@
+<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">
+
+
+<div align="center">
+ <h:message id="error" for="error"
errorClass="portlet-msg-error"/>
+</div>
+
+<table width="100%">
+<tr>
+ <th colspan="2" class="portlet-section-header"
align="center">Personal Dashboard Editor</th>
+</tr>
+<tr>
+ <td class="portlet-section-body" align="center">
+ <table width="100%">
+ <tr>
+ <td width="250">
+ <table class="bottombuttonbar">
+ <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="#{addDashboardPageAction.pageName}"
+
styleClass="portlet-form-input-field"/>
+ <h:commandButton value="Save"
+
action="#{addDashboardPageAction.execute}"
+
styleClass="portlet-form-button"/>
+ </h:form>
+ </td>
+ </tr>
+ </table>
+ </td>
+ <td align="left" valign="top">
+ Use this page to manage the content and appearance of your dashboard
pages. <br/>
+ You can control the page titles, column layouts, page themes,
+ and add,
+ order, or remove portlets.
+ </td>
+ </tr>
+ </table>
+ </td>
+</tr>
+<tr>
+ <th colspan="2" class="portlet-section-header"
align="center">Currently editing page
#{dashboard.selectedPage.name}</th>
+</tr>
+<tr>
+ <td class="portlet-section-body" align="center">
+ <h:form id="page_selector_form"
style="padding:0;margin:0">
+ Select: <h:selectOneMenu
+ id="pageNameSelector"
+ value="#{dashboard.selectedPageName}"
+ styleClass="portlet-form-field"
+
onchange="document.getElementById('page_selector_form').submit()">
+ <f:selectItems value="#{dashboard.pageItems}"/>
+ </h:selectOneMenu>
+ </h:form>
+ <br/>
+ </td>
+</tr>
+<tr>
+ <td>
+ <table width="100%">
+ <tr>
+ <td valign="top" width="250">
+ <table class="bottombuttonbar">
+ <tr>
+ <td valign="top">
+ <b>Theme and Layout</b>
+ <br/>
+ Apply a theme to your dashboard, or select the number of
columns for the layout.
+ <hr/>
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <h:form>
+ Choose a layout:<br/>
+ <h:selectOneMenu
+ id="layoutSelector"
+ value="#{dashboard.selectedPageLayout}"
+ styleClass="portlet-form-field">
+ <f:selectItems
value="#{applicationScope.LayoutService.layoutItems}"/>
+ </h:selectOneMenu>
+ <h:commandButton value="Select"
styleClass="portlet-form-button"
action="#{dashboard.updateLayout}"/>
+ </h:form>
+ </td>
+ </tr>
+ <tr>
+ <td height="20"></td>
+ </tr>
+ <tr>
+ <td>
+ <h:form>
+ Choose a theme:<br/>
+ <h:selectOneMenu
+ id="themeSelector"
+ value="#{dashboard.selectedPageTheme}"
+ styleClass="portlet-form-field">
+ <f:selectItems
value="#{applicationScope.ThemeService.themeItems}"/>
+ </h:selectOneMenu>
+ <h:commandButton value="Select"
styleClass="portlet-form-button"
action="#{dashboard.updateTheme}"/>
+ </h:form>
+ </td>
+ </tr>
+ <tr>
+ <td height="20"></td>
+ </tr>
+ </table>
+ </td>
+ <td>
+ <table>
+ <tr>
+ <td>
+ <div class="admin-ui">
+ <ui:include
src="/WEB-INF/jsf/common/editPageLayout.xhtml">
+ <ui:param name="pageManager"
value="#{dashboard.pageManager}"/>
+ </ui:include>
+ </div>
+ </td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+ </table>
+ </td>
+</tr>
+</table>
+<hr/>
+<c:if test="#{dashboard.selectePageIsDefault == false}">
+ <table width="100%">
+ <tr>
+ <td align="left">
+ <h:form style="padding:0;margin:0">
+ <h:commandButton value="Delete this Page"
styleClass="portlet-form-button"
action="#{dashboard.destroyPage}"/>
+ <br/>
+ <font color="red">You cannot undo this
action!</font>
+ </h:form>
+ </td>
+ </tr>
+ </table>
+</c:if>
+</div>
Copied: trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/dashboards.xhtml (from
rev 7842, trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/dashboards.xhtml)
===================================================================
--- trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/dashboards.xhtml
(rev 0)
+++
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/dashboards.xhtml 2007-08-06
09:16:45 UTC (rev 7865)
@@ -0,0 +1,48 @@
+<div
+
xmlns="http://www.w3.org/1999/xhtml"
+
xmlns:f="http://java.sun.com/jsf/core"
+
xmlns:ui="http://java.sun.com/jsf/facelets"
+
xmlns:h="http://java.sun.com/jsf/html">
+
+ <ui:composition template="dashboardsTemplate.xhtml">
+
+ <ui:define name="content">
+
+ <!-- -->
+ <ui:include src="common/editProperties.xhtml">
+ <ui:param name="properties"
value="#{dashboardmgr.selectedProperties}"/>
+ </ui:include>
+
+ <!-- -->
+ <br/>
+ <ui:include src="common/editPortalErrorHandling.xhtml">
+ <ui:param name="properties"
value="#{dashboardmgr.controlProperties}"/>
+ </ui:include>
+
+ <!-- -->
+ <br/>
+ <ui:include src="common/editPageErrorHandling.xhtml">
+ <ui:param name="properties"
value="#{dashboardmgr.controlProperties}"/>
+ </ui:include>
+
+ <!-- Separation -->
+ <br/>
+
+ <div class="portlet-area-header">Dashboard theme
properties</div>
+ <div class="portlet-area-body">
+ The settings defined here will be applied to the dashboards including all the
pages and windows unless they
+ have been assigned with different settings.
+ <ui:decorate template="common/editTheme.xhtml">
+ <ui:param name="theme"
value="#{dashboardmgr.theme}"/>
+ <ui:define name="form_submit">
+ <h:commandButton value="Update"
actionListener="#{dashboardmgr.theme.execute}"
+ styleClass="portlet-form-button"/>
+ </ui:define>
+ </ui:decorate>
+ </div>
+
+ </ui:define>
+
+ </ui:composition>
+
+</div>
Copied:
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/dashboardsTemplate.xhtml (from
rev 7842,
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/dashboardsTemplate.xhtml)
===================================================================
--- trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/dashboardsTemplate.xhtml
(rev 0)
+++
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/dashboardsTemplate.xhtml 2007-08-06
09:16:45 UTC (rev 7865)
@@ -0,0 +1,31 @@
+<div
+
xmlns="http://www.w3.org/1999/xhtml"
+
xmlns:h="http://java.sun.com/jsf/html"
+
xmlns:ui="http://java.sun.com/jsf/facelets"
+
xmlns:f="http://java.sun.com/jsf/core"
+
xmlns:c="http://java.sun.com/jstl/core"
+ class="admin-ui">
+
+ <!-- Common nav -->
+ <h:form>
+ <ul class="topnav">
+ <li>
+ <h:commandLink value="Portal Objects" action="objects"
actionListener="#{portalobjectmgr.selectRootObject}"/>
+ </li>
+ <li>
+ <h:commandLink value="Portlet Instances"
action="instances"/>
+ </li>
+ <li>
+ <h:commandLink value="Portlet Definitions"
action="portlets"/>
+ </li>
+ <li id="currentTab">Dashboards</li>
+ </ul>
+ </h:form>
+
+ <!-- Status message -->
+ <h:message id="status" for="status"
infoClass="portlet-msg-success" errorClass="portlet-msg-error"
fatalClass="portlet-msg-error" warnClass="portlet-msg-alert"/>
+
+ <!-- Content -->
+ <ui:insert name="content">Content</ui:insert>
+
+</div>
Copied: trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/editContext.xhtml
(from rev 7842,
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/editContext.xhtml)
===================================================================
--- trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/editContext.xhtml
(rev 0)
+++
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/editContext.xhtml 2007-08-06
09:16:45 UTC (rev 7865)
@@ -0,0 +1,40 @@
+<div
+
xmlns="http://www.w3.org/1999/xhtml"
+
xmlns:f="http://java.sun.com/jsf/core"
+
xmlns:ui="http://java.sun.com/jsf/facelets"
+
xmlns:h="http://java.sun.com/jsf/html">
+
+ <ui:composition template="objectTemplate.xhtml">
+
+ <ui:define name="content">
+
+ <h:form>
+ <h:commandLink action="editProperties"
actionListener="#{portalobjectmgr.selectObject}">
+ <h:outputText value="Properties"/>
+ <f:param name="id"
value="#{portalobjectmgr.selectedObject.id}"/>
+ </h:commandLink>
+ </h:form>
+
+ <!-- Sub page addition -->
+ <div style="padding:1em 0 0 0">
+ <h:form id="portal_form">
+ <span class="portlet-font">Create a portal:</span>
+ <span style="padding:1em 0 1em 0">
+ <h:inputText id="name"
value="#{portalAction.portalName}"
styleClass="portlet-form-input-field" required="true"/>
+ <h:commandButton action="#{portalAction.addPortal}"
value="Add portal" styleClass="portlet-form-button"/>
+ <h:message for="name"
errorClass="portlet-msg-error"/>
+ </span>
+ </h:form>
+ </div>
+
+ <!-- Separation -->
+ <hr/>
+
+ <!-- Navigation -->
+ <ui:include src="objectNavigation.xhtml"/>
+
+ </ui:define>
+
+ </ui:composition>
+
+</div>
Copied: trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/editPage.xhtml (from
rev 7842, trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/editPage.xhtml)
===================================================================
--- trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/editPage.xhtml
(rev 0)
+++ trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/editPage.xhtml 2007-08-06
09:16:45 UTC (rev 7865)
@@ -0,0 +1,84 @@
+<div
+
xmlns="http://www.w3.org/1999/xhtml"
+
xmlns:f="http://java.sun.com/jsf/core"
+
xmlns:ui="http://java.sun.com/jsf/facelets"
+
xmlns:h="http://java.sun.com/jsf/html">
+
+ <ui:composition template="objectTemplate.xhtml">
+
+ <ui:define name="content">
+
+ <h:form>
+ <h:panelGroup rendered="#{portalobjectmgr.selectedObject.type ==
PortalObject.TYPE_PAGE}"><h:commandLink action="editPageLayout"
actionListener="#{portalobjectmgr.selectObject}">
+ <h:outputText value="Page layout"/>
+ <f:param name="id"
value="#{portalobjectmgr.selectedObject.id}"/>
+ </h:commandLink> | </h:panelGroup><h:commandLink
action="editPageSecurity"
actionListener="#{portalobjectmgr.selectObject}">
+ <h:outputText value="Security"/>
+ <f:param name="id"
value="#{portalobjectmgr.selectedObject.id}"/>
+ </h:commandLink> | <h:commandLink action="editProperties"
actionListener="#{portalobjectmgr.selectObject}">
+ <h:outputText value="Properties"/>
+ <f:param name="id"
value="#{portalobjectmgr.selectedObject.id}"/>
+ </h:commandLink> | <h:commandLink
action="editPageTheme"
actionListener="#{portalobjectmgr.selectObject}">
+ <h:outputText value="Theme"/>
+ <f:param name="id"
value="#{portalobjectmgr.selectedObject.id}"/>
+ </h:commandLink> | <h:panelGroup
rendered="#{!((portalobjectmgr.selectedObject.type == PortalObject.TYPE_PORTAL) and
((portalobjectmgr.selectedObject.name == 'admin') or
(portalobjectmgr.selectedObject.name == 'template') or
(portalobjectmgr.selectedObject.name == 'default')))}"><h:commandLink
action="renameObject"
actionListener="#{portalobjectmgr.selectObject}">
+ <h:outputText value="Rename"/>
+ <f:param name="id"
value="#{portalobjectmgr.selectedObject.id}"/>
+ </h:commandLink> | </h:panelGroup><h:commandLink
action="confirm" actionListener="#{portalobjectmgr.selectObject}">
+ <h:outputText value="Destroy"/>
+ <f:param name="id"
value="#{portalobjectmgr.selectedObject.id}"/>
+ </h:commandLink>
+ </h:form>
+
+ <!-- Sub page addition -->
+ <div style="padding:1em 0 0 0">
+ <table>
+ <tr>
+ <h:form>
+ <td>
+ <span class="portlet-font">Create a
page:</span>
+ </td>
+ <td>
+ <h:inputText id="pageName"
value="#{addPageAction.pageName}"
styleClass="portlet-form-input-field" required="true"/>
+ </td>
+ <td>
+ <h:commandButton action="#{addPageAction.execute}"
value="Add" styleClass="portlet-form-button"/>
+ </td>
+ <td>
+ <h:message for="pageName"
errorClass="portlet-msg-error"/>
+ </td>
+ </h:form>
+ </tr>
+ <!-- Default page -->
+ <tr>
+ <h:form>
+ <td>
+ <span class="portlet-font">Default
page:</span>
+ </td>
+ <td>
+ <h:selectOneMenu id="name"
styleClass="portlet-form-field"
value="#{portalAction.defaultPageName}">
+ <f:selectItems
value="#{portalobjectmgr.portalPageItems}" />
+ </h:selectOneMenu>
+ </td>
+ <td colspan="2">
+ <h:commandButton styleClass="portlet-form-button"
value="Update" action="objects"/>
+ </td>
+ </h:form>
+ </tr>
+ </table>
+ </div>
+
+
+
+
+ <!-- Separation -->
+ <hr/>
+
+ <!-- Navigation -->
+ <ui:include src="objectNavigation.xhtml"/>
+
+ </ui:define>
+
+ </ui:composition>
+
+</div>
Copied: trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/editPageLayout.xhtml
(from rev 7842,
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/editPageLayout.xhtml)
===================================================================
--- trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/editPageLayout.xhtml
(rev 0)
+++
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/editPageLayout.xhtml 2007-08-06
09:16:45 UTC (rev 7865)
@@ -0,0 +1,17 @@
+<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:ct="http://www.julien.com"
+
xmlns:jbp="http://www.jboss.org/portal"
+
xmlns:c="http://java.sun.com/jstl/core">
+ <ui:composition template="objectTemplate.xhtml">
+ <ui:param name="portalObjectScreen" value="Layout"/>
+ <ui:define name="content">
+ <ui:include src="common/editPageLayout.xhtml">
+ <ui:param name="pageManager"
value="#{portalobjectmgr.pageManager}"/>
+ </ui:include>
+ </ui:define>
+ </ui:composition>
+</div>
Copied: trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/editPageSecurity.xhtml
(from rev 7842,
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/editPageSecurity.xhtml)
===================================================================
--- trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/editPageSecurity.xhtml
(rev 0)
+++
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/editPageSecurity.xhtml 2007-08-06
09:16:45 UTC (rev 7865)
@@ -0,0 +1,15 @@
+<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">
+ <ui:composition template="objectTemplate.xhtml">
+ <ui:param name="portalObjectScreen" value="Security"/>
+ <ui:define name="content">
+ <h3>Please set the page permissions</h3>
+ <ui:decorate template="/WEB-INF/jsf/common/editSecurity.xhtml">
+ <ui:param name="auth"
value="#{portalobjectmgr.auth}"/>
+ </ui:decorate>
+ </ui:define>
+ </ui:composition>
+</div>
Copied: trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/editPageTheme.xhtml
(from rev 7842,
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/editPageTheme.xhtml)
===================================================================
--- trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/editPageTheme.xhtml
(rev 0)
+++
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/editPageTheme.xhtml 2007-08-06
09:16:45 UTC (rev 7865)
@@ -0,0 +1,22 @@
+<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">
+ <ui:composition template="objectTemplate.xhtml">
+ <ui:param name="portalObjectScreen" value="Theme"/>
+ <ui:define name="content">
+ <h3>Page theme properties:</h3>
+ <ui:decorate template="common/editTheme.xhtml">
+ <ui:param name="theme"
value="#{portalobjectmgr.theme}"/>
+ <ui:define name="form_submit">
+ <h:commandButton value="Update" action="objects"
actionListener="#{portalobjectmgr.theme.execute}"
styleClass="portlet-form-button"/>
+ <h:commandButton value="Cancel"
action="#{portalobjectmgr.selectObject}"
styleClass="portlet-form-button">
+ <f:param name="id" value="#{node.id}"/>
+ </h:commandButton>
+ </ui:define>
+ </ui:decorate>
+ </ui:define>
+ </ui:composition>
+</div>
+
Property changes on:
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/editPageTheme.xhtml
___________________________________________________________________
Name: svn:executable
+ *
Copied:
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/editPortalSecurity.xhtml (from
rev 7842,
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/editPortalSecurity.xhtml)
===================================================================
--- trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/editPortalSecurity.xhtml
(rev 0)
+++
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/editPortalSecurity.xhtml 2007-08-06
09:16:45 UTC (rev 7865)
@@ -0,0 +1,15 @@
+<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">
+ <ui:composition template="/WEB-INF/jsf/objectTemplate.xhtml">
+ <ui:param name="portalObjectScreen" value="Security"/>
+ <ui:define name="content">
+ <h3>Please set the portal permissions</h3>
+ <ui:decorate template="/WEB-INF/jsf/common/editSecurity.xhtml">
+ <ui:param name="auth"
value="#{portalobjectmgr.auth}"/>
+ </ui:decorate>
+ </ui:define>
+ </ui:composition>
+</div>
Copied: trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/editPortalTheme.xhtml
(from rev 7842,
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/editPortalTheme.xhtml)
===================================================================
--- trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/editPortalTheme.xhtml
(rev 0)
+++
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/editPortalTheme.xhtml 2007-08-06
09:16:45 UTC (rev 7865)
@@ -0,0 +1,24 @@
+<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">
+ <ui:composition template="objectTemplate.xhtml">
+ <ui:param name="portalObjectScreen" value="Theme"/>
+ <ui:define name="content">
+ <h3>Portal theme properties:</h3>
+ <p>The settings defined here will be applied to the whole portal including
all the pages and windows unless they have been assigned with different
settings</p>
+ <br/>
+ <ui:decorate template="common/editTheme.xhtml">
+ <ui:param name="theme"
value="#{portalobjectmgr.theme}"/>
+ <ui:define name="form_submit">
+ <h:commandButton value="Update" action="objects"
actionListener="#{portalobjectmgr.theme.execute}"
styleClass="portlet-form-button"/>
+ <h:commandButton value="Cancel"
action="#{portalobjectmgr.selectObject}"
styleClass="portlet-form-button">
+ <f:param name="id" value="#{node.id}"/>
+ </h:commandButton>
+ </ui:define>
+ </ui:decorate>
+ </ui:define>
+ </ui:composition>
+</div>
+
Property changes on:
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/editPortalTheme.xhtml
___________________________________________________________________
Name: svn:executable
+ *
Copied: trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/editProperties.xhtml
(from rev 7842,
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/editProperties.xhtml)
===================================================================
--- trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/editProperties.xhtml
(rev 0)
+++
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/editProperties.xhtml 2007-08-06
09:16:45 UTC (rev 7865)
@@ -0,0 +1,41 @@
+<div
+
xmlns="http://www.w3.org/1999/xhtml"
+
xmlns:f="http://java.sun.com/jsf/core"
+
xmlns:ui="http://java.sun.com/jsf/facelets"
+
xmlns:h="http://java.sun.com/jsf/html"
+
xmlns:c="http://java.sun.com/jstl/core">
+
+ <ui:composition template="objectTemplate.xhtml">
+
+ <ui:param name="portalObjectScreen" value="Properties"/>
+
+ <ui:define name="content">
+
+ <ui:include src="common/editProperties.xhtml">
+ <ui:param name="properties"
value="#{portalobjectmgr.selectedProperties}"/>
+ </ui:include>
+
+ <br/>
+ <c:if test="#{portalobjectmgr.selectedProperties.relatedObject.type ==
PortalObject.TYPE_CONTEXT or portalobjectmgr.selectedProperties.relatedObject.type ==
PortalObject.TYPE_PORTAL}">
+
+ <!-- -->
+ <ui:include src="common/editPortalErrorHandling.xhtml">
+ <ui:param name="properties"
value="#{portalobjectmgr.controlProperties}"/>
+ </ui:include>
+
+ </c:if>
+
+ <br/>
+ <c:if test="#{!(portalobjectmgr.selectedProperties.relatedObject.type ==
PortalObject.TYPE_WINDOW)}">
+
+ <!-- Separation -->
+ <ui:include src="common/editPageErrorHandling.xhtml">
+ <ui:param name="properties"
value="#{portalobjectmgr.controlProperties}"/>
+ </ui:include>
+
+ </c:if>
+
+ </ui:define>
+
+ </ui:composition>
+</div>
\ No newline at end of file
Copied: trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/editWindow.xhtml (from
rev 7842, trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/editWindow.xhtml)
===================================================================
--- trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/editWindow.xhtml
(rev 0)
+++
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/editWindow.xhtml 2007-08-06
09:16:45 UTC (rev 7865)
@@ -0,0 +1,29 @@
+<div
+
xmlns="http://www.w3.org/1999/xhtml"
+
xmlns:ui="http://java.sun.com/jsf/facelets"
+ xmlns:ct="http://www.julien.com"
+
xmlns:jbp="http://www.jboss.org/portal"
+
xmlns:h="http://java.sun.com/jsf/html">
+
+ <ui:composition template="objectTemplate.xhtml">
+
+ <ui:define name="content">
+
+ <!-- -->
+ <div>
+ <jbp:portlet
+ actionListener="#{portalobjectmgr.processEvent}"
+ portletId="#{portalobjectmgr.selectedContentEditorInstance}"
+ portletInvoker="#{portalobjectmgr.portletDefinitionInvoker}"
+ renderParameters="#{portalobjectmgr.renderParameters}"
+ supportedModes="edit_content"
+ supportedWindowStates="normal"
+ initialMode="edit_content"
+ initialWindowState="normal"/>
+ </div>
+
+ </ui:define>
+
+ </ui:composition>
+
+</div>
Copied:
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/editWindowSecurity.xhtml (from
rev 7842,
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/editWindowSecurity.xhtml)
===================================================================
--- trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/editWindowSecurity.xhtml
(rev 0)
+++
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/editWindowSecurity.xhtml 2007-08-06
09:16:45 UTC (rev 7865)
@@ -0,0 +1,12 @@
+<div
+
xmlns="http://www.w3.org/1999/xhtml"
+
xmlns:ui="http://java.sun.com/jsf/facelets"
+
xmlns:h="http://java.sun.com/jsf/html">
+ <ui:composition template="objectTemplate.xhtml">
+ <ui:param name="portalObjectScreen" value="Security"/>
+ <ui:define name="content">
+ <h3>Please set the permissions for the window: <h:outputText
value="#{portalobjectmgr.selectedObject.name}"/></h3>
+ <ui:include src="common/editSecurity.xhtml"/>
+ </ui:define>
+ </ui:composition>
+</div>
Copied: trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/editWindowTheme.xhtml
(from rev 7842,
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/editWindowTheme.xhtml)
===================================================================
--- trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/editWindowTheme.xhtml
(rev 0)
+++
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/editWindowTheme.xhtml 2007-08-06
09:16:45 UTC (rev 7865)
@@ -0,0 +1,22 @@
+<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">
+ <ui:composition template="objectTemplate.xhtml">
+ <ui:param name="portalObjectScreen" value="Theme"/>
+ <ui:define name="content">
+ <h3>Window theme properties:</h3>
+ <ui:decorate template="common/editWindowTheme.xhtml">
+ <ui:param name="theme"
value="#{portalobjectmgr.theme}"/>
+ <ui:define name="form_submit">
+ <h:commandButton value="Update" action="objects"
actionListener="#{portalobjectmgr.theme.execute}"
styleClass="portlet-form-button"/>
+ <h:commandButton value="Cancel"
action="#{portalobjectmgr.selectObject}"
styleClass="portlet-form-button">
+ <f:param name="id" value="#{node.id}"/>
+ </h:commandButton>
+ </ui:define>
+ </ui:decorate>
+ </ui:define>
+ </ui:composition>
+</div>
+
Copied: trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/instances.xhtml (from
rev 7842, trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/instances.xhtml)
===================================================================
--- trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/instances.xhtml
(rev 0)
+++ trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/instances.xhtml 2007-08-06
09:16:45 UTC (rev 7865)
@@ -0,0 +1,108 @@
+<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:jbp="http://www.jboss.com/portal"
+
xmlns:c="http://java.sun.com/jstl/core">
+
+<ui:composition template="instancesTemplate.xhtml">
+
+ <ui:define name="content">
+
+ <h:form>
+
+ <table id="instancesTable2" width="100%">
+ <thead class="portlet-section-header">
+ <tr>
+ <th>Id</th>
+ <th>Actions</th>
+ </tr>
+ </thead>
+ <tbody>
+ <c:forEach items="#{instancemgr.selectedInstances}"
var="instance" varStatus="status">
+ <tr
+ class="#{instance.id == instancemgr.selectedId ?
'portlet-section-selected' : (status.index % 2 == 0 ?
'portlet-section-body' : 'portlet-section-alternate')}">
+ <td>
+ <h:commandLink
action="#{instancemgr.selectInstance}">
+ <h:outputText value="#{instance.id}"/>
+ <f:param name="id"
value="#{instance.id}"/>
+ <f:param name="plugin"
value="info"/>
+ </h:commandLink>
+ </td>
+ <td><h:commandLink
action="#{instancemgr.selectInstance}">
+ <h:outputText value="Security"/>
+ <f:param name="id"
value="#{instance.id}"/>
+ <f:param name="plugin"
value="security"/>
+ </h:commandLink> | <h:panelGroup rendered="#{!
empty(instancemgr.selectedInstancesPrefs[instance.id])}"><h:commandLink
action="#{instancemgr.selectInstance}">
+ <h:outputText value="Preferences"/>
+ <f:param name="id"
value="#{instance.id}"/>
+ <f:param name="plugin"
value="preferences"/>
+ </h:commandLink> | </h:panelGroup><h:commandLink
action="confirmDeleteInstance"
actionListener="#{instancemgr.selectInstance}">
+ <h:outputText value="Destroy"/>
+ <f:param name="id"
value="#{instance.id}"/>
+ </h:commandLink>
+ </td>
+ </tr>
+ </c:forEach>
+ </tbody>
+ </table>
+ <ul class="pagination">
+ <c:if test="#{instancemgr.instanceCount >
instancemgr.paginationSize}">
+ <c:forEach begin="0" end="#{(instancemgr.instanceCount -
1)/ instancemgr.paginationSize}" step="1"
+ var="index">
+ <li class="#{index == instancemgr.selectedFrom ?
'selected' : ''}">
+ <h:commandLink
action="#{instancemgr.selectFrom}"><f:param name="from"
value="#{index * instancemgr.paginationSize}"/><h:outputText
+ value="#{index *
instancemgr.paginationSize}"/></h:commandLink>
+ </li>
+ </c:forEach>
+ </c:if>
+ </ul>
+
+ </h:form>
+
+ <c:if test="#{instancemgr.selectedPlugin != null}">
+
+ <hr/>
+
+ <c:if test="#{instancemgr.selectedPlugin == 'info'}">
+ <c:choose>
+ <c:when test="#{instancemgr.selectedInstance.portlet !=
null}">
+ <h3>Portlet details
+ </h3>
+ <ui:include src="common/showPortletDetails.xhtml">
+ <ui:param name="portlet"
value="#{instancemgr.selectedInstance.portlet}"/>
+ <ui:param name="portletmgr"
value="#{portletmgr}"/>
+ </ui:include>
+ </c:when>
+ <c:otherwise>
+ <h3>Portlet details</h3>
+ The associated portlet is not available
+ </c:otherwise>
+ </c:choose>
+ </c:if>
+
+ <c:if test="#{instancemgr.selectedPlugin ==
'preferences'}">
+ <h3>Editing preferences of #{instancemgr.selectedInstance.id}:
</h3>
+ <ui:include src="common/editPreferences.xhtml">
+ <ui:param name="prefs"
value="#{instancemgr.selectedPrefs}"/>
+ </ui:include>
+ <h:form style="text-align:center;padding: 1em 0 1em 0">
+ <h:commandButton value="Save"
action="#{instancemgr.updatePrefs}"
styleClass="portlet-form-button"/>
+ <h:commandButton value="Cancel"
action="#{instancemgr.cancelPrefs}"
styleClass="portlet-form-button"/>
+ </h:form>
+ </c:if>
+
+ <c:if test="#{instancemgr.selectedPlugin ==
'security'}">
+ <h3>Editing security of #{instancemgr.selectedInstance.id}:
</h3>
+
+ <ui:decorate
template="/WEB-INF/jsf/common/editSecurity.xhtml">
+ <ui:param name="auth"
value="#{instancemgr.auth}"/>
+ </ui:decorate>
+ </c:if>
+
+ </c:if>
+
+ </ui:define>
+</ui:composition>
+</div>
Property changes on:
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/instances.xhtml
___________________________________________________________________
Name: svn:executable
+ *
Copied:
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/instancesTemplate.xhtml (from
rev 7842,
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/instancesTemplate.xhtml)
===================================================================
--- trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/instancesTemplate.xhtml
(rev 0)
+++
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/instancesTemplate.xhtml 2007-08-06
09:16:45 UTC (rev 7865)
@@ -0,0 +1,29 @@
+<div
+
xmlns="http://www.w3.org/1999/xhtml"
+
xmlns:h="http://java.sun.com/jsf/html"
+
xmlns:ui="http://java.sun.com/jsf/facelets"
+ class="admin-ui">
+
+ <!-- Common nav -->
+ <h:form>
+ <ul class="topnav">
+ <li>
+ <h:commandLink value="Portal Objects" action="objects"
actionListener="#{portalobjectmgr.selectRootObject}"/>
+ </li>
+ <li id="currentTab">Portlet Instances</li>
+ <li>
+ <h:commandLink value="Portlet Definitions"
action="portlets"/>
+ </li>
+ <li>
+ <h:commandLink value="Dashboards"
action="dashboards"/>
+ </li>
+ </ul>
+ </h:form>
+
+ <!-- Status message -->
+ <h:message id="status" for="status"/>
+
+ <!-- Content -->
+ <ui:insert name="content">Content</ui:insert>
+
+</div>
Copied: trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/objectNavigation.xhtml
(from rev 7842,
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/objectNavigation.xhtml)
===================================================================
--- trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/objectNavigation.xhtml
(rev 0)
+++
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/objectNavigation.xhtml 2007-08-06
09:16:45 UTC (rev 7865)
@@ -0,0 +1,136 @@
+<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:pfc="http://www.jboss.com/portal/facelet/common"
+
xmlns:c="http://java.sun.com/jstl/core">
+
+<h:form>
+
+<table width="100%">
+
+<c:if test="#{not empty portalobjectmgr.selectedObject.portals}">
+ <thead class="portlet-section-header">
+ <tr>
+ <th>Portal</th>
+ <th>Actions</th>
+ </tr>
+ </thead>
+ <tbody>
+ <c:forEach items="#{portalobjectmgr.selectedObject.portals}"
var="object" varStatus="status">
+ <tr class="#{status.index % 2 == 0 ? 'portlet-section-body' :
'portlet-section-alternate'}">
+ <td>
+ <h:commandLink action="#{portalobjectmgr.selectObject}">
+ <h:outputText value="#{object.name}"/>
+ <f:param name="id" value="#{object.id}"/>
+ </h:commandLink>
+ </td>
+ <td>
+ <h:commandLink action="editPortalSecurity"
actionListener="#{portalobjectmgr.selectObject}">
+ <h:outputText value="Security"/>
+ <f:param name="id" value="#{object.id}"/>
+ </h:commandLink> | <h:commandLink
action="editProperties"
actionListener="#{portalobjectmgr.selectObject}">
+ <h:outputText value="Properties"/>
+ <f:param name="id" value="#{object.id}"/>
+ </h:commandLink> | <h:commandLink
action="editPortalTheme"
+
actionListener="#{portalobjectmgr.selectObject}">
+ <h:outputText value="Theme"/>
+ <f:param name="id" value="#{object.id}"/>
+ </h:commandLink><h:panelGroup rendered="#{(object.name !=
'admin') and (object.name != 'template') and (object.name !=
'default')}"> | <h:commandLink action="renameObject"
actionListener="#{portalobjectmgr.selectObject}">
+ <h:outputText value="Rename"/>
+ <f:param name="id" value="#{object.id}"/>
+ </h:commandLink></h:panelGroup> | <h:commandLink
action="confirm" actionListener="#{portalobjectmgr.selectObject}">
+ <h:outputText value="Destroy"/>
+ <f:param name="id" value="#{object.id}"/>
+ </h:commandLink>
+ </td>
+ </tr>
+ </c:forEach>
+ </tbody>
+</c:if>
+
+<c:if test="#{not empty portalobjectmgr.selectedObject.pages}">
+ <thead class="portlet-section-header">
+ <tr>
+ <th>Page</th>
+ <th>Actions</th>
+ </tr>
+ </thead>
+ <tbody>
+ <c:forEach items="#{portalobjectmgr.selectedObject.pages}"
var="object" varStatus="status">
+ <tr class="#{status.index % 2 == 0 ? 'portlet-section-body' :
'portlet-section-alternate'}">
+ <td>
+ <h:commandLink action="#{portalobjectmgr.selectObject}">
+ <h:outputText value="#{object.name}"/>
+ <f:param name="id" value="#{object.id}"/>
+ </h:commandLink>
+ </td>
+ <td>
+ <h:commandLink action="editPageLayout"
actionListener="#{portalobjectmgr.selectObject}">
+ <h:outputText value="Page layout"/>
+ <f:param name="id" value="#{object.id}"/>
+ </h:commandLink> | <h:commandLink
action="editPageSecurity"
+
actionListener="#{portalobjectmgr.selectObject}">
+ <h:outputText value="Security"/>
+ <f:param name="id" value="#{object.id}"/>
+ </h:commandLink> | <h:commandLink action="editProperties"
actionListener="#{portalobjectmgr.selectObject}">
+ <h:outputText value="Properties"/>
+ <f:param name="id" value="#{object.id}"/>
+ </h:commandLink> | <h:commandLink
action="editPageTheme"
actionListener="#{portalobjectmgr.selectObject}">
+ <h:outputText value="Theme"/>
+ <f:param name="id" value="#{object.id}"/>
+ </h:commandLink> | <h:commandLink action="renameObject"
actionListener="#{portalobjectmgr.selectObject}">
+ <h:outputText value="Rename"/>
+ <f:param name="id" value="#{object.id}"/>
+ </h:commandLink> | <h:commandLink action="confirm"
actionListener="#{portalobjectmgr.selectObject}">
+ <h:outputText value="Destroy"/>
+ <f:param name="id" value="#{object.id}"/>
+ </h:commandLink>
+ </td>
+ </tr>
+ </c:forEach>
+ </tbody>
+</c:if>
+
+<c:if test="#{not empty portalobjectmgr.selectedObject.windows}">
+ <thead class="portlet-section-header">
+ <tr>
+ <th>Window</th>
+ <th>Actions</th>
+ </tr>
+ </thead>
+ <tbody>
+ <c:forEach items="#{portalobjectmgr.selectedObject.windows}"
var="object" varStatus="status">
+ <tr class="#{status.index % 2 == 0 ? 'portlet-section-body' :
'portlet-section-alternate'}">
+ <td>
+ <h:commandLink action="#{portalobjectmgr.selectObject}">
+ <h:outputText value="#{object.name}"/>
+ <f:param name="id" value="#{object.id}"/>
+ </h:commandLink>
+ </td>
+ <td>
+ <h:commandLink action="editWindowTheme"
actionListener="#{portalobjectmgr.selectObject}">
+ <h:outputText value="Theme"/>
+ <f:param name="id" value="#{object.id}"/>
+ </h:commandLink> | <h:commandLink
action="editProperties"
actionListener="#{portalobjectmgr.selectObject}">
+ <h:outputText value="Properties"/>
+ <f:param name="id" value="#{object.id}"/>
+ </h:commandLink> | <h:commandLink action="renameObject"
actionListener="#{portalobjectmgr.selectObject}">
+ <h:outputText value="Rename"/>
+ <f:param name="id" value="#{object.id}"/>
+ </h:commandLink> | <h:commandLink action="confirm"
actionListener="#{portalobjectmgr.selectObject}">
+ <h:outputText value="Destroy"/>
+ <f:param name="id" value="#{object.id}"/>
+ </h:commandLink>
+ </td>
+ </tr>
+ </c:forEach>
+ </tbody>
+</c:if>
+
+</table>
+
+</h:form>
+
+</div>
Copied: trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/objectTemplate.xhtml
(from rev 7842,
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/objectTemplate.xhtml)
===================================================================
--- trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/objectTemplate.xhtml
(rev 0)
+++
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/objectTemplate.xhtml 2007-08-06
09:16:45 UTC (rev 7865)
@@ -0,0 +1,83 @@
+<div
+
xmlns="http://www.w3.org/1999/xhtml"
+
xmlns:h="http://java.sun.com/jsf/html"
+
xmlns:ui="http://java.sun.com/jsf/facelets"
+
xmlns:f="http://java.sun.com/jsf/core"
+
xmlns:c="http://java.sun.com/jstl/core"
+ class="admin-ui">
+
+ <!-- Common nav -->
+ <h:form>
+ <ul class="topnav">
+ <li id="currentTab">Portal Objects</li>
+ <li>
+ <h:commandLink value="Portlet Instances"
action="instances"/>
+ </li>
+ <li>
+ <h:commandLink value="Portlet Definitions"
action="portlets"/>
+ </li>
+ <li>
+ <h:commandLink value="Dashboards"
action="dashboards"/>
+ </li>
+ </ul>
+ </h:form>
+
+ <!-- Path nav -->
+ <h:form>
+ <ul class="objectpath">
+ <c:forEach items="#{portalobjectmgr.selectedObjectPath}"
var="node">
+ <li>
+ >
+ </li>
+ <c:choose>
+ <c:when test="#{node.id ==
portalobjectmgr.selectedObject.id}">
+ <li class="selected">
+ <c:choose>
+ <c:when test="#{portalObjectScreen != null}">
+ <h:commandLink
action="#{portalobjectmgr.selectObject}">
+ <f:param name="id"
value="#{node.id}"/>
+ <c:choose>
+ <c:when test="#{node.type ==
PortalObject.TYPE_CONTEXT}">Portals</c:when>
+ <c:when test="#{node.type ==
PortalObject.TYPE_PORTAL}">#{node.name} Portal</c:when>
+ <c:when test="#{node.type ==
PortalObject.TYPE_PAGE}">#{node.name} Page</c:when>
+ <c:when test="#{node.type ==
PortalObject.TYPE_WINDOW}">#{node.name} Window</c:when>
+ </c:choose>
+ </h:commandLink>
+ <h:outputText
value=" #{portalObjectScreen}"/>
+ </c:when>
+ <c:otherwise>
+ <c:choose>
+ <c:when test="#{node.type ==
PortalObject.TYPE_CONTEXT}">Portals</c:when>
+ <c:when test="#{node.type ==
PortalObject.TYPE_PORTAL}">#{node.name} Portal</c:when>
+ <c:when test="#{node.type ==
PortalObject.TYPE_PAGE}">#{node.name} Page</c:when>
+ <c:when test="#{node.type ==
PortalObject.TYPE_WINDOW}">#{node.name} Window</c:when>
+ </c:choose>
+ </c:otherwise>
+ </c:choose>
+ </li>
+ </c:when>
+ <c:otherwise>
+ <li>
+ <h:commandLink
action="#{portalobjectmgr.selectObject}">
+ <f:param name="id" value="#{node.id}"/>
+ <c:choose>
+ <c:when test="#{node.type ==
PortalObject.TYPE_CONTEXT}">Portals</c:when>
+ <c:when test="#{node.type ==
PortalObject.TYPE_PORTAL}">#{node.name} Portal</c:when>
+ <c:when test="#{node.type ==
PortalObject.TYPE_PAGE}">#{node.name} Page</c:when>
+ <c:when test="#{node.type ==
PortalObject.TYPE_WINDOW}">#{node.name} Window</c:when>
+ </c:choose>
+ </h:commandLink>
+ </li>
+ </c:otherwise>
+ </c:choose>
+ </c:forEach>
+ </ul>
+ </h:form>
+
+ <!-- Status message -->
+ <h:message id="status" for="status"
infoClass="portlet-msg-success" errorClass="portlet-msg-error"
fatalClass="portlet-msg-error" warnClass="portlet-msg-alert"/>
+
+ <!-- Content -->
+ <ui:insert name="content">Content</ui:insert>
+
+</div>
Copied: trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/objects.xhtml (from
rev 7842, trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/objects.xhtml)
===================================================================
--- trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/objects.xhtml
(rev 0)
+++ trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/objects.xhtml 2007-08-06
09:16:45 UTC (rev 7865)
@@ -0,0 +1,27 @@
+<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:c="http://java.sun.com/jstl/core">
+
+ <c:choose>
+ <c:when test="#{portalobjectmgr.selectedObject.type ==
PortalObject.TYPE_CONTEXT}">
+ <ui:include src="editContext.xhtml"/>
+ </c:when>
+ <c:when test="#{portalobjectmgr.selectedObject.type ==
PortalObject.TYPE_PORTAL}">
+ <ui:include src="editPage.xhtml"/>
+ </c:when>
+ <c:when test="#{portalobjectmgr.selectedObject.type ==
PortalObject.TYPE_PAGE}">
+ <ui:include src="editPage.xhtml"/>
+ </c:when>
+ <c:when test="#{portalobjectmgr.selectedObject.type ==
PortalObject.TYPE_WINDOW}">
+ <ui:include src="editWindow.xhtml"/>
+ </c:when>
+ <c:otherwise>FIXME</c:otherwise>
+ </c:choose>
+
+ <h:form>
+ <p style="text-align: right"><h:commandLink
action="#{newWindowWizard.reset}">Switch to wizard
mode</h:commandLink></p>
+ </h:form>
+
+</div>
Copied: trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/portlets.xhtml (from
rev 7842, trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/portlets.xhtml)
===================================================================
--- trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/portlets.xhtml
(rev 0)
+++ trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/portlets.xhtml 2007-08-06
09:16:45 UTC (rev 7865)
@@ -0,0 +1,96 @@
+<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:jbp="http://www.jboss.com/portal"
+
xmlns:c="http://java.sun.com/jstl/core"
+
xmlns:pfc="http://www.jboss.com/portal/facelet/common">
+
+ <ui:composition template="portletsTemplate.xhtml">
+
+ <ui:define name="content">
+
+ <h:form>
+ <h:outputLabel for="menu">
+ <h:outputText value="Portlet provider: "
styleClass="portlet-form-field-label"/>
+ </h:outputLabel>
+ <h:selectOneMenu id="menu"
styleClass="portlet-form-field"
value="#{portletmgr.selectedPortletInvokerId}">
+ <f:selectItems
value="#{portletmgr.portletInvokerItems}"/>
+ </h:selectOneMenu>
+ <h:commandButton value="Change"
styleClass="portlet-form-button"/>
+ </h:form>
+
+ <h:form>
+ <table width="100%">
+ <thead class="portlet-section-header">
+ <tr>
+ <th>Id</th>
+ <th>Name</th>
+ <th>Remote</th>
+ <th>Remotable</th>
+ <th>Actions</th>
+ </tr>
+ </thead>
+ <tbody>
+ <c:forEach items="#{portletmgr.selectedPortlets}"
var="portlet" varStatus="status">
+ <tr
+ class="#{portlet.context.id ==
portletmgr.selectedPortlet.context.id ? 'portlet-section-selected' : (status.index
% 2 == 0 ? 'portlet-section-body' :
'portlet-section-alternate')}">
+ <td>
+ <h:commandLink
+ action="#{portletmgr.selectPortlet}">
+ <f:param name="id"
value="#{portlet.context.id}"/>
+ <f:param name="plugin"
value="manager"/>
+ #{portlet.context.id}
+ </h:commandLink>
+ </td>
+ <td>#{portlet.name.value}</td>
+ <td><h:selectBooleanCheckbox disabled="true"
value="#{portlet.remote}"/></td>
+ <td><h:selectBooleanCheckbox disabled="true"
value="#{portlet.remotable}"/></td>
+ <td>
+ <h:commandLink
action="#{portletmgr.selectPortlet}">
+ <f:param name="id"
value="#{portlet.context.id}"/>
+ <f:param name="plugin"
value="manager"/>
+ Info
+ </h:commandLink> | <h:commandLink
action="#{portletmgr.selectPortlet}">
+ <f:param name="id"
value="#{portlet.context.id}"/>
+ <f:param name="plugin"
value="preferences"/>
+ Preferences
+ </h:commandLink>
+ </td>
+ </tr>
+ </c:forEach>
+ </tbody>
+ </table>
+ <ul class="pagination">
+ <c:if test="#{portletmgr.portletCount >
portletmgr.paginationSize}">
+ <c:forEach begin="0" end="#{(portletmgr.portletCount
- 1) / portletmgr.paginationSize}" step="1"
+ var="index">
+ <li class="#{index == portletmgr.selectedFrom ?
'selected' : ''}">
+ <h:commandLink
action="#{portletmgr.selectFrom}"><f:param name="from"
+ value="#{index *
portletmgr.paginationSize}"/><h:outputText
+ value="#{index *
portletmgr.paginationSize}"/></h:commandLink>
+ </li>
+ </c:forEach>
+ </c:if>
+ </ul>
+ </h:form>
+
+ <c:if test="#{portletmgr.selectedPortlet != null}">
+ <c:if test="#{portletmgr.selectedPlugin ==
'manager'}">
+ <hr/>
+ <h3>Portlet details</h3>
+ <ui:include src="showPortletInfo.xhtml"/>
+ </c:if>
+ <c:if test="#{portletmgr.selectedPlugin ==
'preferences'}">
+ <hr/>
+ <h3>Portlet preferences</h3>
+ <ui:include src="common/editPreferences.xhtml">
+ <ui:param name="prefs"
value="#{portletmgr.selectedPreferences}"/>
+ </ui:include>
+ </c:if>
+ </c:if>
+
+ </ui:define>
+ </ui:composition>
+</div>
Property changes on:
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/portlets.xhtml
___________________________________________________________________
Name: svn:executable
+ *
Copied: trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/portletsTemplate.xhtml
(from rev 7842,
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/portletsTemplate.xhtml)
===================================================================
--- trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/portletsTemplate.xhtml
(rev 0)
+++
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/portletsTemplate.xhtml 2007-08-06
09:16:45 UTC (rev 7865)
@@ -0,0 +1,29 @@
+<div
+
xmlns="http://www.w3.org/1999/xhtml"
+
xmlns:h="http://java.sun.com/jsf/html"
+
xmlns:ui="http://java.sun.com/jsf/facelets"
+ class="admin-ui">
+
+ <!-- Common nav -->
+ <h:form>
+ <ul class="topnav">
+ <li>
+ <h:commandLink value="Portal Objects" action="objects"
actionListener="#{portalobjectmgr.selectRootObject}"/>
+ </li>
+ <li>
+ <h:commandLink value="Portlet Instances"
action="instances"/>
+ </li>
+ <li id="currentTab">Portlet Definitions</li>
+ <li>
+ <h:commandLink value="Dashboards"
action="dashboards"/>
+ </li>
+ </ul>
+ </h:form>
+
+ <!-- Status message -->
+ <h:message id="status" for="status"/>
+
+ <!-- Content -->
+ <ui:insert name="content">Content</ui:insert>
+
+</div>
Copied: trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/renameObject.xhtml
(from rev 7842,
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/renameObject.xhtml)
===================================================================
--- trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/renameObject.xhtml
(rev 0)
+++
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/renameObject.xhtml 2007-08-06
09:16:45 UTC (rev 7865)
@@ -0,0 +1,19 @@
+<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:c="http://java.sun.com/jstl/core">
+ <ui:composition template="/WEB-INF/jsf/objectTemplate.xhtml">
+ <ui:param name="portalObjectScreen" value="Rename"/>
+ <ui:define name="content">
+ <h3>Renaming:</h3>
+ <h:form id="renameForm">
+ <h:inputText id="newName"
value="#{renameAction.newName}"/>
+ <h:message for="newName"/>
+ <br />
+ <h:commandButton value="Update"
action="#{renameAction.execute}"
styleClass="portlet-form-button"/>
+ </h:form>
+ </ui:define>
+ </ui:composition>
+</div>
Copied: trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/showPortletInfo.xhtml
(from rev 7842,
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/showPortletInfo.xhtml)
===================================================================
--- trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/showPortletInfo.xhtml
(rev 0)
+++
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/showPortletInfo.xhtml 2007-08-06
09:16:45 UTC (rev 7865)
@@ -0,0 +1,27 @@
+<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:c="http://java.sun.com/jstl/core">
+ <br/>
+
+ <!-- Portlet details -->
+
+ <c:if test="#{portletmgr.selectedPortlet != null}">
+ <ui:include src="common/showPortletDetails.xhtml">
+ <ui:param name="portlet"
value="#{portletmgr.selectedPortlet}"/>
+ </ui:include>
+ </c:if>
+
+ <!-- Instance creation -->
+
+ <hr/>
+ <h:form id="add_instance_form">
+ <h:inputText id="instanceId"
value="#{createInstanceAction.instanceId}"
styleClass="portlet-form-input-field" required="true"/>
+ <h:commandButton action="#{createInstanceAction.execute}"
value="Create instance" styleClass="portlet-form-button">
+ </h:commandButton>
+ <h:message for="instanceId"
errorClass="portlet-msg-error"/>
+ </h:form>
+
+</div>
Property changes on:
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/showPortletInfo.xhtml
___________________________________________________________________
Name: svn:executable
+ *
Copied: trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/wizard (from rev 7842,
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/wizard)
Deleted:
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/wizard/newWindowTpl.xhtml
===================================================================
---
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/wizard/newWindowTpl.xhtml 2007-07-30
12:59:36 UTC (rev 7842)
+++
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/wizard/newWindowTpl.xhtml 2007-08-06
09:16:45 UTC (rev 7865)
@@ -1,173 +0,0 @@
-<div
-
xmlns="http://www.w3.org/1999/xhtml"
-
xmlns:h="http://java.sun.com/jsf/html"
-
xmlns:ui="http://java.sun.com/jsf/facelets"
-
xmlns:f="http://java.sun.com/jsf/core"
-
xmlns:c="http://java.sun.com/jstl/core"
- class="admin-ui">
-
- <div class="portlet-section-header">Adding a new Portlet</div>
-
- <c:choose>
- <c:when test="#{newWindowWizard.currentStep == 0}">
- <div class="wizardStepBox" id="selected">
- <p class="stepNumber">Step 1</p>
- <p class="stepText">Select Portlet</p>
- </div>
- </c:when>
- <c:otherwise>
- <c:choose>
- <c:when test="#{newWindowWizard.enabled[0]}">
- <h:form><h:commandLink action="#{newWindowWizard.goTo}">
- <f:param name="step" value="0"/>
- <div class="wizardStepBox">
- <p class="stepNumber">Step 1</p>
- <p class="stepText">Select Portlet</p>
- </div>
- </h:commandLink></h:form>
- </c:when>
- <c:otherwise>
- <div class="wizardStepBox">
- <p class="stepNumber">Step 1</p>
- <p class="stepText">Select Portlet</p>
- </div>
- </c:otherwise>
- </c:choose>
- </c:otherwise>
- </c:choose>
-
- <c:choose>
- <c:when test="#{newWindowWizard.currentStep == 1}">
- <div class="wizardStepBox" id="selected">
- <p class="stepNumber">Step 2</p>
- <p class="stepText">Select Portal</p>
- </div>
- </c:when>
- <c:otherwise>
- <c:choose>
- <c:when test="#{newWindowWizard.enabled[1]}">
- <h:form><h:commandLink action="#{newWindowWizard.goTo}">
- <f:param name="step" value="1"/>
- <div class="wizardStepBox">
- <p class="stepNumber">Step 2</p>
- <p class="stepText">Select Portal</p>
- </div>
- </h:commandLink></h:form>
- </c:when>
- <c:otherwise>
- <div class="wizardStepBox">
- <p class="stepNumber">Step 2</p>
- <p class="stepText">Select Portal</p>
- </div>
- </c:otherwise>
- </c:choose>
- </c:otherwise>
- </c:choose>
-
- <c:choose>
- <c:when test="#{newWindowWizard.currentStep == 2}">
- <div class="wizardStepBox" id="selected">
- <p class="stepNumber">Step 3</p>
- <p class="stepText">Select Page</p>
- </div>
- </c:when>
- <c:otherwise>
- <c:choose>
- <c:when test="#{newWindowWizard.enabled[2]}">
- <h:form><h:commandLink action="#{newWindowWizard.goTo}">
- <f:param name="step" value="2"/>
- <div class="wizardStepBox">
- <p class="stepNumber">Step 3</p>
- <p class="stepText">Select Page</p>
- </div>
- </h:commandLink></h:form>
- </c:when>
- <c:otherwise>
- <div class="wizardStepBox">
- <p class="stepNumber">Step 3</p>
- <p class="stepText">Select Page</p>
- </div>
- </c:otherwise>
- </c:choose>
- </c:otherwise>
- </c:choose>
-
- <c:choose>
- <c:when test="#{newWindowWizard.currentStep == 3}">
- <div class="wizardStepBox" id="selected">
- <p class="stepNumber">Step 4</p>
- <p class="stepText">Select Region</p>
- </div>
- </c:when>
- <c:otherwise>
- <c:choose>
- <c:when test="#{newWindowWizard.enabled[3]}">
- <h:form><h:commandLink action="#{newWindowWizard.goTo}">
- <f:param name="step" value="3"/>
- <div class="wizardStepBox">
- <p class="stepNumber">Step 4</p>
- <p class="stepText">Select Region</p>
- </div>
- </h:commandLink></h:form>
- </c:when>
- <c:otherwise>
- <div class="wizardStepBox">
- <p class="stepNumber">Step 4</p>
- <p class="stepText">Select Region</p>
- </div>
- </c:otherwise>
- </c:choose>
- </c:otherwise>
- </c:choose>
-
- <c:choose>
- <c:when test="#{newWindowWizard.currentStep == 4}">
- <div class="wizardStepBox" id="selected">
- <p class="stepNumber">Step 5</p>
- <p class="stepText">Confirm</p>
- </div>
- </c:when>
- <c:otherwise>
- <c:choose>
- <c:when test="#{newWindowWizard.enabled[4]}">
- <h:form><h:commandLink action="#{newWindowWizard.goTo}">
- <f:param name="step" value="4"/>
- <div class="wizardStepBox">
- <p class="stepNumber">Step 5</p>
- <p class="stepText">Confirm</p>
- </div>
- </h:commandLink></h:form>
- </c:when>
- <c:otherwise>
- <div class="wizardStepBox">
- <p class="stepNumber">Step 5</p>
- <p class="stepText">Confirm</p>
- </div>
- </c:otherwise>
- </c:choose>
- </c:otherwise>
- </c:choose>
-
- <!-- Status message -->
- <h:message id="status" for="status"/>
-
-
- <!-- Content -->
- <div class="wizardContent">
- <ui:insert name="content">Content</ui:insert>
- </div>
-
- <div class="wizardButtonBox">
- <h:form>
- <h:commandButton rendered="#{newWindowWizard.currentStep gt 0}"
value="Previous"
- action="#{newWindowWizard.previous}"
styleClass="portlet-form-button"/>
- <h:commandButton rendered="#{newWindowWizard.currentStep lt 4 and
newWindowWizard.enabled[newWindowWizard.currentStep + 1]}"
- value="Next"
action="#{newWindowWizard.next}"
styleClass="portlet-form-button"/>
- </h:form>
- </div>
-
- <h:form>
- <p style="text-align: right;"><h:commandLink
action="advancedMode">Switch to advanced
mode</h:commandLink></p>
- </h:form>
-
-</div>
Copied:
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/wizard/newWindowTpl.xhtml
(from rev 7842,
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/wizard/newWindowTpl.xhtml)
===================================================================
--- trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/wizard/newWindowTpl.xhtml
(rev 0)
+++
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/wizard/newWindowTpl.xhtml 2007-08-06
09:16:45 UTC (rev 7865)
@@ -0,0 +1,173 @@
+<div
+
xmlns="http://www.w3.org/1999/xhtml"
+
xmlns:h="http://java.sun.com/jsf/html"
+
xmlns:ui="http://java.sun.com/jsf/facelets"
+
xmlns:f="http://java.sun.com/jsf/core"
+
xmlns:c="http://java.sun.com/jstl/core"
+ class="admin-ui">
+
+ <div class="portlet-section-header">Adding a new Portlet</div>
+
+ <c:choose>
+ <c:when test="#{newWindowWizard.currentStep == 0}">
+ <div class="wizardStepBox" id="selected">
+ <p class="stepNumber">Step 1</p>
+ <p class="stepText">Select Portlet</p>
+ </div>
+ </c:when>
+ <c:otherwise>
+ <c:choose>
+ <c:when test="#{newWindowWizard.enabled[0]}">
+ <h:form><h:commandLink action="#{newWindowWizard.goTo}">
+ <f:param name="step" value="0"/>
+ <div class="wizardStepBox">
+ <p class="stepNumber">Step 1</p>
+ <p class="stepText">Select Portlet</p>
+ </div>
+ </h:commandLink></h:form>
+ </c:when>
+ <c:otherwise>
+ <div class="wizardStepBox">
+ <p class="stepNumber">Step 1</p>
+ <p class="stepText">Select Portlet</p>
+ </div>
+ </c:otherwise>
+ </c:choose>
+ </c:otherwise>
+ </c:choose>
+
+ <c:choose>
+ <c:when test="#{newWindowWizard.currentStep == 1}">
+ <div class="wizardStepBox" id="selected">
+ <p class="stepNumber">Step 2</p>
+ <p class="stepText">Select Portal</p>
+ </div>
+ </c:when>
+ <c:otherwise>
+ <c:choose>
+ <c:when test="#{newWindowWizard.enabled[1]}">
+ <h:form><h:commandLink action="#{newWindowWizard.goTo}">
+ <f:param name="step" value="1"/>
+ <div class="wizardStepBox">
+ <p class="stepNumber">Step 2</p>
+ <p class="stepText">Select Portal</p>
+ </div>
+ </h:commandLink></h:form>
+ </c:when>
+ <c:otherwise>
+ <div class="wizardStepBox">
+ <p class="stepNumber">Step 2</p>
+ <p class="stepText">Select Portal</p>
+ </div>
+ </c:otherwise>
+ </c:choose>
+ </c:otherwise>
+ </c:choose>
+
+ <c:choose>
+ <c:when test="#{newWindowWizard.currentStep == 2}">
+ <div class="wizardStepBox" id="selected">
+ <p class="stepNumber">Step 3</p>
+ <p class="stepText">Select Page</p>
+ </div>
+ </c:when>
+ <c:otherwise>
+ <c:choose>
+ <c:when test="#{newWindowWizard.enabled[2]}">
+ <h:form><h:commandLink action="#{newWindowWizard.goTo}">
+ <f:param name="step" value="2"/>
+ <div class="wizardStepBox">
+ <p class="stepNumber">Step 3</p>
+ <p class="stepText">Select Page</p>
+ </div>
+ </h:commandLink></h:form>
+ </c:when>
+ <c:otherwise>
+ <div class="wizardStepBox">
+ <p class="stepNumber">Step 3</p>
+ <p class="stepText">Select Page</p>
+ </div>
+ </c:otherwise>
+ </c:choose>
+ </c:otherwise>
+ </c:choose>
+
+ <c:choose>
+ <c:when test="#{newWindowWizard.currentStep == 3}">
+ <div class="wizardStepBox" id="selected">
+ <p class="stepNumber">Step 4</p>
+ <p class="stepText">Select Region</p>
+ </div>
+ </c:when>
+ <c:otherwise>
+ <c:choose>
+ <c:when test="#{newWindowWizard.enabled[3]}">
+ <h:form><h:commandLink action="#{newWindowWizard.goTo}">
+ <f:param name="step" value="3"/>
+ <div class="wizardStepBox">
+ <p class="stepNumber">Step 4</p>
+ <p class="stepText">Select Region</p>
+ </div>
+ </h:commandLink></h:form>
+ </c:when>
+ <c:otherwise>
+ <div class="wizardStepBox">
+ <p class="stepNumber">Step 4</p>
+ <p class="stepText">Select Region</p>
+ </div>
+ </c:otherwise>
+ </c:choose>
+ </c:otherwise>
+ </c:choose>
+
+ <c:choose>
+ <c:when test="#{newWindowWizard.currentStep == 4}">
+ <div class="wizardStepBox" id="selected">
+ <p class="stepNumber">Step 5</p>
+ <p class="stepText">Confirm</p>
+ </div>
+ </c:when>
+ <c:otherwise>
+ <c:choose>
+ <c:when test="#{newWindowWizard.enabled[4]}">
+ <h:form><h:commandLink action="#{newWindowWizard.goTo}">
+ <f:param name="step" value="4"/>
+ <div class="wizardStepBox">
+ <p class="stepNumber">Step 5</p>
+ <p class="stepText">Confirm</p>
+ </div>
+ </h:commandLink></h:form>
+ </c:when>
+ <c:otherwise>
+ <div class="wizardStepBox">
+ <p class="stepNumber">Step 5</p>
+ <p class="stepText">Confirm</p>
+ </div>
+ </c:otherwise>
+ </c:choose>
+ </c:otherwise>
+ </c:choose>
+
+ <!-- Status message -->
+ <h:message id="status" for="status"/>
+
+
+ <!-- Content -->
+ <div class="wizardContent">
+ <ui:insert name="content">Content</ui:insert>
+ </div>
+
+ <div class="wizardButtonBox">
+ <h:form>
+ <h:commandButton rendered="#{newWindowWizard.currentStep gt 0}"
value="Previous"
+ action="#{newWindowWizard.previous}"
styleClass="portlet-form-button"/>
+ <h:commandButton rendered="#{newWindowWizard.currentStep lt 4 and
newWindowWizard.enabled[newWindowWizard.currentStep + 1]}"
+ value="Next"
action="#{newWindowWizard.next}"
styleClass="portlet-form-button"/>
+ </h:form>
+ </div>
+
+ <h:form>
+ <p style="text-align: right;"><h:commandLink
action="advancedMode">Switch to advanced
mode</h:commandLink></p>
+ </h:form>
+
+</div>
Deleted:
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/wizard/newWindowWizardConfirm.xhtml
===================================================================
---
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/wizard/newWindowWizardConfirm.xhtml 2007-07-30
12:59:36 UTC (rev 7842)
+++
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/wizard/newWindowWizardConfirm.xhtml 2007-08-06
09:16:45 UTC (rev 7865)
@@ -1,26 +0,0 @@
-<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:c="http://java.sun.com/jstl/core">
-
- <ui:composition template="newWindowTpl.xhtml">
- <ui:define name="content">
-
- <table>
-
<tr><td><b>Portlet:</b></td><td>#{newWindowWizard.selectedPortlet.name.defaultString}</td></tr>
-
<tr><td><b>Portal:</b></td><td>#{newWindowWizard.selectedPortal.name}</td></tr>
-
<tr><td><b>Page:</b></td><td>#{newWindowWizard.selectedPage.name}</td></tr>
-
<tr><td><b>Region:</b></td><td>#{newWindowWizard.selectedRegionId}</td></tr>
- </table>
-
- <h:form>
- <h:commandButton value="Confirm"
action="#{newWindowWizard.createWindow}"
styleClass="portlet-form-button"/>
- <h:commandButton value="Cancel"
action="#{newWindowWizard.cancel}"
styleClass="portlet-form-button"/>
- </h:form>
-
- </ui:define>
- </ui:composition>
-
-</div>
\ No newline at end of file
Copied:
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/wizard/newWindowWizardConfirm.xhtml
(from rev 7842,
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/wizard/newWindowWizardConfirm.xhtml)
===================================================================
---
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/wizard/newWindowWizardConfirm.xhtml
(rev 0)
+++
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/wizard/newWindowWizardConfirm.xhtml 2007-08-06
09:16:45 UTC (rev 7865)
@@ -0,0 +1,26 @@
+<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:c="http://java.sun.com/jstl/core">
+
+ <ui:composition template="newWindowTpl.xhtml">
+ <ui:define name="content">
+
+ <table>
+
<tr><td><b>Portlet:</b></td><td>#{newWindowWizard.selectedPortlet.name.defaultString}</td></tr>
+
<tr><td><b>Portal:</b></td><td>#{newWindowWizard.selectedPortal.name}</td></tr>
+
<tr><td><b>Page:</b></td><td>#{newWindowWizard.selectedPage.name}</td></tr>
+
<tr><td><b>Region:</b></td><td>#{newWindowWizard.selectedRegionId}</td></tr>
+ </table>
+
+ <h:form>
+ <h:commandButton value="Confirm"
action="#{newWindowWizard.createWindow}"
styleClass="portlet-form-button"/>
+ <h:commandButton value="Cancel"
action="#{newWindowWizard.cancel}"
styleClass="portlet-form-button"/>
+ </h:form>
+
+ </ui:define>
+ </ui:composition>
+
+</div>
\ No newline at end of file
Deleted:
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/wizard/selectPage.xhtml
===================================================================
---
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/wizard/selectPage.xhtml 2007-07-30
12:59:36 UTC (rev 7842)
+++
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/wizard/selectPage.xhtml 2007-08-06
09:16:45 UTC (rev 7865)
@@ -1,48 +0,0 @@
-<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:c="http://java.sun.com/jstl/core">
-
- <ui:composition template="newWindowTpl.xhtml">
- <ui:define name="content">
-
- <table width="100%">
- <tbody class="portlet-section-header">
- <tr>
- <th>Page</th>
- <th></th>
- </tr>
- </tbody>
- <tbody>
- <h:form>
- <h:commandLink action="#{newWindowWizard.up}"
rendered="#{newWindowWizard.selectedParentPage.type !=
PortalObject.TYPE_PORTAL}">
- <h:outputText value="Up"/>
- <f:param name="id"
value="#{newWindowWizard.selectedParentPageId}"/>
- </h:commandLink>
- <c:forEach items="#{newWindowWizard.pages}"
var="object" varStatus="status">
- <tr
- class="#{object.id == newWindowWizard.selectedPageId ?
'portlet-section-selected' : status.index % 2 == 0 ?
'portlet-section-body' : 'portlet-section-alternate'}">
- <td>
- <h:commandLink id="cl_#{status.index}"
action="#{newWindowWizard.selectPage}">
- <h:outputText id="ot_#{status.index}"
value="#{object.name}"/>
- <f:param id="f_#{status.index}"
name="id" value="#{object.id}"/>
- </h:commandLink>
- </td>
- <td>
- <c:if test="#{not empty object.pages}">
- <h:commandLink id="cl2_#{status.index}"
action="#{newWindowWizard.selectParentPage}">
- <h:outputText id="ot2_#{status.index}"
value="Sub-Pages"/>
- <f:param id="f2_#{status.index}"
name="id" value="#{object.id}"/>
- </h:commandLink>
- </c:if>
- </td>
- </tr>
- </c:forEach>
- </h:form>
- </tbody>
- </table>
- </ui:define>
- </ui:composition>
-</div>
\ No newline at end of file
Copied:
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/wizard/selectPage.xhtml (from
rev 7842,
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/wizard/selectPage.xhtml)
===================================================================
--- trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/wizard/selectPage.xhtml
(rev 0)
+++
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/wizard/selectPage.xhtml 2007-08-06
09:16:45 UTC (rev 7865)
@@ -0,0 +1,48 @@
+<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:c="http://java.sun.com/jstl/core">
+
+ <ui:composition template="newWindowTpl.xhtml">
+ <ui:define name="content">
+
+ <table width="100%">
+ <tbody class="portlet-section-header">
+ <tr>
+ <th>Page</th>
+ <th></th>
+ </tr>
+ </tbody>
+ <tbody>
+ <h:form>
+ <h:commandLink action="#{newWindowWizard.up}"
rendered="#{newWindowWizard.selectedParentPage.type !=
PortalObject.TYPE_PORTAL}">
+ <h:outputText value="Up"/>
+ <f:param name="id"
value="#{newWindowWizard.selectedParentPageId}"/>
+ </h:commandLink>
+ <c:forEach items="#{newWindowWizard.pages}"
var="object" varStatus="status">
+ <tr
+ class="#{object.id == newWindowWizard.selectedPageId ?
'portlet-section-selected' : status.index % 2 == 0 ?
'portlet-section-body' : 'portlet-section-alternate'}">
+ <td>
+ <h:commandLink id="cl_#{status.index}"
action="#{newWindowWizard.selectPage}">
+ <h:outputText id="ot_#{status.index}"
value="#{object.name}"/>
+ <f:param id="f_#{status.index}"
name="id" value="#{object.id}"/>
+ </h:commandLink>
+ </td>
+ <td>
+ <c:if test="#{not empty object.pages}">
+ <h:commandLink id="cl2_#{status.index}"
action="#{newWindowWizard.selectParentPage}">
+ <h:outputText id="ot2_#{status.index}"
value="Sub-Pages"/>
+ <f:param id="f2_#{status.index}"
name="id" value="#{object.id}"/>
+ </h:commandLink>
+ </c:if>
+ </td>
+ </tr>
+ </c:forEach>
+ </h:form>
+ </tbody>
+ </table>
+ </ui:define>
+ </ui:composition>
+</div>
\ No newline at end of file
Deleted:
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/wizard/selectPortal.xhtml
===================================================================
---
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/wizard/selectPortal.xhtml 2007-07-30
12:59:36 UTC (rev 7842)
+++
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/wizard/selectPortal.xhtml 2007-08-06
09:16:45 UTC (rev 7865)
@@ -1,36 +0,0 @@
-<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:c="http://java.sun.com/jstl/core">
-
- <ui:composition template="newWindowTpl.xhtml">
- <ui:define name="content">
- <table width="100%">
-
- <tbody class="portlet-section-header">
- <tr>
- <th>Portal</th>
- </tr>
- </tbody>
- <tbody>
- <h:form>
- <c:forEach items="#{newWindowWizard.portals}"
var="object" varStatus="status">
- <tr
- class="#{object.id == newWindowWizard.selectedPortalId ?
'portlet-section-selected' : status.index % 2 == 0 ?
'portlet-section-body' : 'portlet-section-alternate'}">
- <td>
- <h:commandLink
action="#{newWindowWizard.selectPortal}">
- <h:outputText value="#{object.name}"/>
- <f:param name="id"
value="#{object.id}"/>
- </h:commandLink>
- </td>
- </tr>
- </c:forEach>
- </h:form>
- </tbody>
-
- </table>
- </ui:define>
- </ui:composition>
-</div>
\ No newline at end of file
Copied:
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/wizard/selectPortal.xhtml
(from rev 7842,
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/wizard/selectPortal.xhtml)
===================================================================
--- trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/wizard/selectPortal.xhtml
(rev 0)
+++
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/wizard/selectPortal.xhtml 2007-08-06
09:16:45 UTC (rev 7865)
@@ -0,0 +1,36 @@
+<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:c="http://java.sun.com/jstl/core">
+
+ <ui:composition template="newWindowTpl.xhtml">
+ <ui:define name="content">
+ <table width="100%">
+
+ <tbody class="portlet-section-header">
+ <tr>
+ <th>Portal</th>
+ </tr>
+ </tbody>
+ <tbody>
+ <h:form>
+ <c:forEach items="#{newWindowWizard.portals}"
var="object" varStatus="status">
+ <tr
+ class="#{object.id == newWindowWizard.selectedPortalId ?
'portlet-section-selected' : status.index % 2 == 0 ?
'portlet-section-body' : 'portlet-section-alternate'}">
+ <td>
+ <h:commandLink
action="#{newWindowWizard.selectPortal}">
+ <h:outputText value="#{object.name}"/>
+ <f:param name="id"
value="#{object.id}"/>
+ </h:commandLink>
+ </td>
+ </tr>
+ </c:forEach>
+ </h:form>
+ </tbody>
+
+ </table>
+ </ui:define>
+ </ui:composition>
+</div>
\ No newline at end of file
Deleted:
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/wizard/selectPortlet.xhtml
===================================================================
---
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/wizard/selectPortlet.xhtml 2007-07-30
12:59:36 UTC (rev 7842)
+++
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/wizard/selectPortlet.xhtml 2007-08-06
09:16:45 UTC (rev 7865)
@@ -1,55 +0,0 @@
-<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:c="http://java.sun.com/jstl/core">
- <ui:composition template="newWindowTpl.xhtml">
- <ui:define name="content">
- <h:form>
- <h:outputLabel for="menu">
- <h:outputText value="Portlet provider: "
styleClass="portlet-form-field-label"/>
- </h:outputLabel>
- <h:selectOneMenu id="menu"
styleClass="portlet-form-field"
value="#{portletmgr.selectedPortletInvokerId}">
- <f:selectItems
value="#{portletmgr.portletInvokerItems}"/>
- </h:selectOneMenu>
- <h:commandButton value="Change"
styleClass="portlet-form-button"/>
- </h:form>
-
- <h:form>
- <table width="100%">
- <thead class="portlet-section-header">
- <tr>
- <th>Name</th>
- </tr>
- </thead>
- <tbody>
- <c:forEach items="#{portletmgr.selectedPortlets}"
var="portlet" varStatus="status">
- <tr
- class="#{portlet.context.id ==
newWindowWizard.selectedPortletId ? 'portlet-section-selected' : (status.index % 2
== 0 ? 'portlet-section-body' : 'portlet-section-alternate')}">
- <td title="#{portlet.description.value}">
- <h:commandLink
action="#{newWindowWizard.selectPortlet}">
- <h:outputText>#{!empty portlet.name.value ?
portlet.name.value : "Unnamed"}</h:outputText>
- <f:param name="id"
value="#{portlet.context.id}"/>
- <f:param name="portletInvokerId"
value="#{portletmgr.selectedPortletInvokerId}"/>
- </h:commandLink></td>
- </tr>
- </c:forEach>
- </tbody>
- </table>
- <ul class="pagination">
- <c:forEach begin="0" end="#{(portletmgr.portletCount -
1)/portletmgr.paginationSize}" step="1"
- var="index">
- <li class="#{index == portletmgr.selectedFrom ?
'selected' : ''}">
- <h:commandLink action="#{portletmgr.selectFrom}">
- <f:param name="from" value="#{index *
portletmgr.paginationSize}"/>
- <h:outputText value="#{index *
portletmgr.paginationSize}"/>
- </h:commandLink>
- </li>
- </c:forEach>
- </ul>
- </h:form>
-
- </ui:define>
- </ui:composition>
-</div>
\ No newline at end of file
Copied:
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/wizard/selectPortlet.xhtml
(from rev 7842,
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/wizard/selectPortlet.xhtml)
===================================================================
---
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/wizard/selectPortlet.xhtml
(rev 0)
+++
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/wizard/selectPortlet.xhtml 2007-08-06
09:16:45 UTC (rev 7865)
@@ -0,0 +1,55 @@
+<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:c="http://java.sun.com/jstl/core">
+ <ui:composition template="newWindowTpl.xhtml">
+ <ui:define name="content">
+ <h:form>
+ <h:outputLabel for="menu">
+ <h:outputText value="Portlet provider: "
styleClass="portlet-form-field-label"/>
+ </h:outputLabel>
+ <h:selectOneMenu id="menu"
styleClass="portlet-form-field"
value="#{portletmgr.selectedPortletInvokerId}">
+ <f:selectItems
value="#{portletmgr.portletInvokerItems}"/>
+ </h:selectOneMenu>
+ <h:commandButton value="Change"
styleClass="portlet-form-button"/>
+ </h:form>
+
+ <h:form>
+ <table width="100%">
+ <thead class="portlet-section-header">
+ <tr>
+ <th>Name</th>
+ </tr>
+ </thead>
+ <tbody>
+ <c:forEach items="#{portletmgr.selectedPortlets}"
var="portlet" varStatus="status">
+ <tr
+ class="#{portlet.context.id ==
newWindowWizard.selectedPortletId ? 'portlet-section-selected' : (status.index % 2
== 0 ? 'portlet-section-body' : 'portlet-section-alternate')}">
+ <td title="#{portlet.description.value}">
+ <h:commandLink
action="#{newWindowWizard.selectPortlet}">
+ <h:outputText>#{!empty portlet.name.value ?
portlet.name.value : "Unnamed"}</h:outputText>
+ <f:param name="id"
value="#{portlet.context.id}"/>
+ <f:param name="portletInvokerId"
value="#{portletmgr.selectedPortletInvokerId}"/>
+ </h:commandLink></td>
+ </tr>
+ </c:forEach>
+ </tbody>
+ </table>
+ <ul class="pagination">
+ <c:forEach begin="0" end="#{(portletmgr.portletCount -
1)/portletmgr.paginationSize}" step="1"
+ var="index">
+ <li class="#{index == portletmgr.selectedFrom ?
'selected' : ''}">
+ <h:commandLink action="#{portletmgr.selectFrom}">
+ <f:param name="from" value="#{index *
portletmgr.paginationSize}"/>
+ <h:outputText value="#{index *
portletmgr.paginationSize}"/>
+ </h:commandLink>
+ </li>
+ </c:forEach>
+ </ul>
+ </h:form>
+
+ </ui:define>
+ </ui:composition>
+</div>
\ No newline at end of file
Deleted:
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/wizard/selectRegion.xhtml
===================================================================
---
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/wizard/selectRegion.xhtml 2007-07-30
12:59:36 UTC (rev 7842)
+++
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/wizard/selectRegion.xhtml 2007-08-06
09:16:45 UTC (rev 7865)
@@ -1,37 +0,0 @@
-<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:c="http://java.sun.com/jstl/core">
-
- <ui:composition template="newWindowTpl.xhtml">
- <ui:define name="content">
-
- <table width="100%">
-
- <tbody class="portlet-section-header">
- <tr>
- <th>Portal</th>
- </tr>
- </tbody>
- <tbody>
- <h:form>
- <c:forEach items="#{newWindowWizard.regions}"
var="object" varStatus="status">
- <tr
- class="#{object == newWindowWizard.selectedRegionId ?
'portlet-section-selected' : status.index % 2 == 0 ?
'portlet-section-body' : 'portlet-section-alternate'}">
- <td>
- <h:commandLink
action="#{newWindowWizard.selectRegion}">
- <h:outputText value="#{object}"/>
- <f:param name="name"
value="#{object}"/>
- </h:commandLink>
- </td>
- </tr>
- </c:forEach>
- </h:form>
- </tbody>
- </table>
-
- </ui:define>
- </ui:composition>
-</div>
\ No newline at end of file
Copied:
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/wizard/selectRegion.xhtml
(from rev 7842,
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/wizard/selectRegion.xhtml)
===================================================================
--- trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/wizard/selectRegion.xhtml
(rev 0)
+++
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/wizard/selectRegion.xhtml 2007-08-06
09:16:45 UTC (rev 7865)
@@ -0,0 +1,37 @@
+<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:c="http://java.sun.com/jstl/core">
+
+ <ui:composition template="newWindowTpl.xhtml">
+ <ui:define name="content">
+
+ <table width="100%">
+
+ <tbody class="portlet-section-header">
+ <tr>
+ <th>Portal</th>
+ </tr>
+ </tbody>
+ <tbody>
+ <h:form>
+ <c:forEach items="#{newWindowWizard.regions}"
var="object" varStatus="status">
+ <tr
+ class="#{object == newWindowWizard.selectedRegionId ?
'portlet-section-selected' : status.index % 2 == 0 ?
'portlet-section-body' : 'portlet-section-alternate'}">
+ <td>
+ <h:commandLink
action="#{newWindowWizard.selectRegion}">
+ <h:outputText value="#{object}"/>
+ <f:param name="name"
value="#{object}"/>
+ </h:commandLink>
+ </td>
+ </tr>
+ </c:forEach>
+ </h:form>
+ </tbody>
+ </table>
+
+ </ui:define>
+ </ui:composition>
+</div>
\ No newline at end of file
Modified: trunk/core-admin/src/resources/portal-admin-war/WEB-INF/portlet.xml
===================================================================
--- trunk/core-admin/src/resources/portal-admin-war/WEB-INF/portlet.xml 2007-08-03
10:18:53 UTC (rev 7864)
+++ trunk/core-admin/src/resources/portal-admin-war/WEB-INF/portlet.xml 2007-08-06
09:16:45 UTC (rev 7865)
@@ -34,7 +34,7 @@
<portlet-class>org.jboss.portal.faces.loader.FacesPortlet</portlet-class>
<init-param>
<name>default-view</name>
- <value>/WEB-INF/jsf/portal/objects.xhtml</value>
+ <value>/WEB-INF/jsf/objects.xhtml</value>
</init-param>
<supports>
<mime-type>text/html</mime-type>
@@ -52,7 +52,7 @@
<portlet-class>org.jboss.portal.faces.loader.FacesPortlet</portlet-class>
<init-param>
<name>default-view</name>
- <value>/WEB-INF/jsf/portal/dashboard/dashboard.xhtml</value>
+ <value>/WEB-INF/jsf/dashboard/dashboard.xhtml</value>
</init-param>
<expiration-cache>-1</expiration-cache>
<supports>
Modified: trunk/core-admin/src/resources/portal-admin-war/WEB-INF/web.xml
===================================================================
--- trunk/core-admin/src/resources/portal-admin-war/WEB-INF/web.xml 2007-08-03 10:18:53
UTC (rev 7864)
+++ trunk/core-admin/src/resources/portal-admin-war/WEB-INF/web.xml 2007-08-06 09:16:45
UTC (rev 7865)
@@ -73,10 +73,6 @@
<param-name>javax.faces.STATE_SAVING_METHOD</param-name>
<param-value>server</param-value>
</context-param>
- <context-param>
- <param-name>javax.faces.CONFIG_FILES</param-name>
-
<param-value>/WEB-INF/faces-config.xml,/WEB-INF/faces-config-portal.xml</param-value>
- </context-param>
<!-- The JSF servlet -->
<servlet>