Author: emuckenhuber
Date: 2007-08-03 06:18:53 -0400 (Fri, 03 Aug 2007)
New Revision: 7864
Added:
trunk/core-admin/src/main/org/jboss/portal/core/admin/portal/
trunk/core-admin/src/main/org/jboss/portal/core/admin/portal/ui/
trunk/core-admin/src/main/org/jboss/portal/core/admin/portal/ui/AdminPropertyResolver.java
trunk/core-admin/src/main/org/jboss/portal/core/admin/portal/ui/AuthorizationBean.java
trunk/core-admin/src/main/org/jboss/portal/core/admin/portal/ui/ControlPropertiesBean.java
trunk/core-admin/src/main/org/jboss/portal/core/admin/portal/ui/ControlPropertyBean.java
trunk/core-admin/src/main/org/jboss/portal/core/admin/portal/ui/InstanceManagerBean.java
trunk/core-admin/src/main/org/jboss/portal/core/admin/portal/ui/PortalObjectManagerBean.java
trunk/core-admin/src/main/org/jboss/portal/core/admin/portal/ui/PortletManagerBean.java
trunk/core-admin/src/main/org/jboss/portal/core/admin/portal/ui/PreferenceBean.java
trunk/core-admin/src/main/org/jboss/portal/core/admin/portal/ui/PreferencesBean.java
trunk/core-admin/src/main/org/jboss/portal/core/admin/portal/ui/PropertiesBean.java
trunk/core-admin/src/main/org/jboss/portal/core/admin/portal/ui/PropertiesInfo.java
trunk/core-admin/src/main/org/jboss/portal/core/admin/portal/ui/PropertyBean.java
trunk/core-admin/src/main/org/jboss/portal/core/admin/portal/ui/PropertyBeanContainer.java
trunk/core-admin/src/main/org/jboss/portal/core/admin/portal/ui/PropertyInfo.java
trunk/core-admin/src/main/org/jboss/portal/core/admin/portal/ui/Refresher.java
trunk/core-admin/src/main/org/jboss/portal/core/admin/portal/ui/ThemeBean.java
trunk/core-admin/src/main/org/jboss/portal/core/admin/portal/ui/actions/
trunk/core-admin/src/main/org/jboss/portal/core/admin/portal/ui/common/
trunk/core-admin/src/main/org/jboss/portal/core/admin/portal/ui/conversion/
trunk/core-admin/src/main/org/jboss/portal/core/admin/portal/ui/dashboard/
trunk/core-admin/src/main/org/jboss/portal/core/admin/portal/ui/portlet/
trunk/core-admin/src/main/org/jboss/portal/core/admin/portal/ui/wizard/
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/portal/
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/portal/common/
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/portal/confirmDeleteInstance.xhtml
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/portal/dashboard/
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/portal/dashboards.xhtml
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/portal/dashboardsTemplate.xhtml
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/portal/editContext.xhtml
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/portal/editPage.xhtml
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/portal/editPageLayout.xhtml
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/portal/editPageSecurity.xhtml
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/portal/editPageTheme.xhtml
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/portal/editPortalSecurity.xhtml
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/portal/editPortalTheme.xhtml
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/portal/editProperties.xhtml
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/portal/editWindow.xhtml
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/portal/editWindowSecurity.xhtml
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/portal/editWindowTheme.xhtml
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/portal/instances.xhtml
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/portal/instancesTemplate.xhtml
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/portal/objectNavigation.xhtml
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/portal/objectTemplate.xhtml
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/portal/objects.xhtml
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/portal/portlets.xhtml
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/portal/portletsTemplate.xhtml
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/portal/renameObject.xhtml
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/portal/showPortletInfo.xhtml
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/portal/wizard/
Removed:
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/common/
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/conversion/
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/dashboard/
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/portlet/
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/wizard/
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/common/
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/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/
Modified:
trunk/core-admin/src/main/org/jboss/portal/core/admin/portal/ui/actions/AddPageAction.java
trunk/core-admin/src/main/org/jboss/portal/core/admin/portal/ui/actions/AssignContentToWindowAction.java
trunk/core-admin/src/main/org/jboss/portal/core/admin/portal/ui/actions/CreateInstanceAction.java
trunk/core-admin/src/main/org/jboss/portal/core/admin/portal/ui/actions/PortalAction.java
trunk/core-admin/src/main/org/jboss/portal/core/admin/portal/ui/actions/PropertyAction.java
trunk/core-admin/src/main/org/jboss/portal/core/admin/portal/ui/actions/RenameAction.java
trunk/core-admin/src/main/org/jboss/portal/core/admin/portal/ui/actions/WindowComparator.java
trunk/core-admin/src/main/org/jboss/portal/core/admin/portal/ui/common/PageManagerBean.java
trunk/core-admin/src/main/org/jboss/portal/core/admin/portal/ui/conversion/ContentTypeConverter.java
trunk/core-admin/src/main/org/jboss/portal/core/admin/portal/ui/conversion/PortalObjectIdConverter.java
trunk/core-admin/src/main/org/jboss/portal/core/admin/portal/ui/dashboard/DashboardBean.java
trunk/core-admin/src/main/org/jboss/portal/core/admin/portal/ui/portlet/PortletDefinitionInvoker.java
trunk/core-admin/src/main/org/jboss/portal/core/admin/portal/ui/wizard/NewWindowWizard.java
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:
- refactor the classes from admin.ui to admin.portal.ui
- moved jsf/* to jsf/portal/*
- splited faces-config.xml into faces-config-portal.xml
to later on add a jsf user portlet in admin.user.ui
Copied:
trunk/core-admin/src/main/org/jboss/portal/core/admin/portal/ui/AdminPropertyResolver.java
(from rev 7861,
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/AdminPropertyResolver.java)
===================================================================
---
trunk/core-admin/src/main/org/jboss/portal/core/admin/portal/ui/AdminPropertyResolver.java
(rev 0)
+++
trunk/core-admin/src/main/org/jboss/portal/core/admin/portal/ui/AdminPropertyResolver.java 2007-08-03
10:18:53 UTC (rev 7864)
@@ -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.portal.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/portal/ui/AuthorizationBean.java
(from rev 7861,
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/AuthorizationBean.java)
===================================================================
---
trunk/core-admin/src/main/org/jboss/portal/core/admin/portal/ui/AuthorizationBean.java
(rev 0)
+++
trunk/core-admin/src/main/org/jboss/portal/core/admin/portal/ui/AuthorizationBean.java 2007-08-03
10:18:53 UTC (rev 7864)
@@ -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.portal.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();
+}
Copied:
trunk/core-admin/src/main/org/jboss/portal/core/admin/portal/ui/ControlPropertiesBean.java
(from rev 7861,
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/ControlPropertiesBean.java)
===================================================================
---
trunk/core-admin/src/main/org/jboss/portal/core/admin/portal/ui/ControlPropertiesBean.java
(rev 0)
+++
trunk/core-admin/src/main/org/jboss/portal/core/admin/portal/ui/ControlPropertiesBean.java 2007-08-03
10:18:53 UTC (rev 7864)
@@ -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.portal.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/portal/ui/ControlPropertyBean.java
(from rev 7861,
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/ControlPropertyBean.java)
===================================================================
---
trunk/core-admin/src/main/org/jboss/portal/core/admin/portal/ui/ControlPropertyBean.java
(rev 0)
+++
trunk/core-admin/src/main/org/jboss/portal/core/admin/portal/ui/ControlPropertyBean.java 2007-08-03
10:18:53 UTC (rev 7864)
@@ -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.portal.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/portal/ui/InstanceManagerBean.java
(from rev 7861,
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/InstanceManagerBean.java)
===================================================================
---
trunk/core-admin/src/main/org/jboss/portal/core/admin/portal/ui/InstanceManagerBean.java
(rev 0)
+++
trunk/core-admin/src/main/org/jboss/portal/core/admin/portal/ui/InstanceManagerBean.java 2007-08-03
10:18:53 UTC (rev 7864)
@@ -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.portal.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") };
+ }
+ }
+}
Copied:
trunk/core-admin/src/main/org/jboss/portal/core/admin/portal/ui/PortalObjectManagerBean.java
(from rev 7861,
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/PortalObjectManagerBean.java)
===================================================================
---
trunk/core-admin/src/main/org/jboss/portal/core/admin/portal/ui/PortalObjectManagerBean.java
(rev 0)
+++
trunk/core-admin/src/main/org/jboss/portal/core/admin/portal/ui/PortalObjectManagerBean.java 2007-08-03
10:18:53 UTC (rev 7864)
@@ -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.portal.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.portal.ui.actions.AddPageAction;
+import org.jboss.portal.core.admin.portal.ui.actions.PropertyAction;
+import org.jboss.portal.core.admin.portal.ui.common.PageManagerBean;
+import org.jboss.portal.core.admin.portal.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;
+ }
+}
Copied:
trunk/core-admin/src/main/org/jboss/portal/core/admin/portal/ui/PortletManagerBean.java
(from rev 7861,
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/PortletManagerBean.java)
===================================================================
---
trunk/core-admin/src/main/org/jboss/portal/core/admin/portal/ui/PortletManagerBean.java
(rev 0)
+++
trunk/core-admin/src/main/org/jboss/portal/core/admin/portal/ui/PortletManagerBean.java 2007-08-03
10:18:53 UTC (rev 7864)
@@ -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.portal.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());
+ }
+ };
+}
Copied:
trunk/core-admin/src/main/org/jboss/portal/core/admin/portal/ui/PreferenceBean.java (from
rev 7861, trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/PreferenceBean.java)
===================================================================
--- trunk/core-admin/src/main/org/jboss/portal/core/admin/portal/ui/PreferenceBean.java
(rev 0)
+++
trunk/core-admin/src/main/org/jboss/portal/core/admin/portal/ui/PreferenceBean.java 2007-08-03
10:18:53 UTC (rev 7864)
@@ -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.portal.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/portal/ui/PreferencesBean.java (from
rev 7861, trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/PreferencesBean.java)
===================================================================
--- trunk/core-admin/src/main/org/jboss/portal/core/admin/portal/ui/PreferencesBean.java
(rev 0)
+++
trunk/core-admin/src/main/org/jboss/portal/core/admin/portal/ui/PreferencesBean.java 2007-08-03
10:18:53 UTC (rev 7864)
@@ -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.portal.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/portal/ui/PropertiesBean.java (from
rev 7861, trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/PropertiesBean.java)
===================================================================
--- trunk/core-admin/src/main/org/jboss/portal/core/admin/portal/ui/PropertiesBean.java
(rev 0)
+++
trunk/core-admin/src/main/org/jboss/portal/core/admin/portal/ui/PropertiesBean.java 2007-08-03
10:18:53 UTC (rev 7864)
@@ -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.portal.ui;
+
+import org.jboss.portal.core.model.portal.PortalObject;
+import org.jboss.portal.core.admin.portal.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/portal/ui/PropertiesInfo.java (from
rev 7861, trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/PropertiesInfo.java)
===================================================================
--- trunk/core-admin/src/main/org/jboss/portal/core/admin/portal/ui/PropertiesInfo.java
(rev 0)
+++
trunk/core-admin/src/main/org/jboss/portal/core/admin/portal/ui/PropertiesInfo.java 2007-08-03
10:18:53 UTC (rev 7864)
@@ -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.portal.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/portal/ui/PropertyBean.java
(from rev 7861,
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/PropertyBean.java)
===================================================================
--- trunk/core-admin/src/main/org/jboss/portal/core/admin/portal/ui/PropertyBean.java
(rev 0)
+++
trunk/core-admin/src/main/org/jboss/portal/core/admin/portal/ui/PropertyBean.java 2007-08-03
10:18:53 UTC (rev 7864)
@@ -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.portal.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/portal/ui/PropertyBeanContainer.java
(from rev 7861,
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/PropertyBeanContainer.java)
===================================================================
---
trunk/core-admin/src/main/org/jboss/portal/core/admin/portal/ui/PropertyBeanContainer.java
(rev 0)
+++
trunk/core-admin/src/main/org/jboss/portal/core/admin/portal/ui/PropertyBeanContainer.java 2007-08-03
10:18:53 UTC (rev 7864)
@@ -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.portal.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/portal/ui/PropertyInfo.java
(from rev 7861,
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/PropertyInfo.java)
===================================================================
--- trunk/core-admin/src/main/org/jboss/portal/core/admin/portal/ui/PropertyInfo.java
(rev 0)
+++
trunk/core-admin/src/main/org/jboss/portal/core/admin/portal/ui/PropertyInfo.java 2007-08-03
10:18:53 UTC (rev 7864)
@@ -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.portal.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/portal/ui/Refresher.java
(from rev 7861, trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/Refresher.java)
===================================================================
--- trunk/core-admin/src/main/org/jboss/portal/core/admin/portal/ui/Refresher.java
(rev 0)
+++
trunk/core-admin/src/main/org/jboss/portal/core/admin/portal/ui/Refresher.java 2007-08-03
10:18:53 UTC (rev 7864)
@@ -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.portal.ui;
+
+import org.jboss.portal.core.admin.portal.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
Copied: trunk/core-admin/src/main/org/jboss/portal/core/admin/portal/ui/ThemeBean.java
(from rev 7861, trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/ThemeBean.java)
===================================================================
--- trunk/core-admin/src/main/org/jboss/portal/core/admin/portal/ui/ThemeBean.java
(rev 0)
+++
trunk/core-admin/src/main/org/jboss/portal/core/admin/portal/ui/ThemeBean.java 2007-08-03
10:18:53 UTC (rev 7864)
@@ -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.portal.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);
+ }
+ }
+}
Copied: trunk/core-admin/src/main/org/jboss/portal/core/admin/portal/ui/actions (from rev
7861, trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/actions)
Modified:
trunk/core-admin/src/main/org/jboss/portal/core/admin/portal/ui/actions/AddPageAction.java
===================================================================
---
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/actions/AddPageAction.java 2007-08-02
11:58:06 UTC (rev 7861)
+++
trunk/core-admin/src/main/org/jboss/portal/core/admin/portal/ui/actions/AddPageAction.java 2007-08-03
10:18:53 UTC (rev 7864)
@@ -20,7 +20,7 @@
* 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;
+package org.jboss.portal.core.admin.portal.ui.actions;
import org.jboss.logging.Logger;
import org.jboss.portal.core.model.portal.Page;
Modified:
trunk/core-admin/src/main/org/jboss/portal/core/admin/portal/ui/actions/AssignContentToWindowAction.java
===================================================================
---
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/actions/AssignContentToWindowAction.java 2007-08-02
11:58:06 UTC (rev 7861)
+++
trunk/core-admin/src/main/org/jboss/portal/core/admin/portal/ui/actions/AssignContentToWindowAction.java 2007-08-03
10:18:53 UTC (rev 7864)
@@ -20,9 +20,9 @@
* 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;
+package org.jboss.portal.core.admin.portal.ui.actions;
-import org.jboss.portal.core.admin.ui.PortalObjectManagerBean;
+import org.jboss.portal.core.admin.portal.ui.PortalObjectManagerBean;
import org.jboss.portal.core.model.portal.Window;
/**
Modified:
trunk/core-admin/src/main/org/jboss/portal/core/admin/portal/ui/actions/CreateInstanceAction.java
===================================================================
---
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/actions/CreateInstanceAction.java 2007-08-02
11:58:06 UTC (rev 7861)
+++
trunk/core-admin/src/main/org/jboss/portal/core/admin/portal/ui/actions/CreateInstanceAction.java 2007-08-03
10:18:53 UTC (rev 7864)
@@ -20,12 +20,12 @@
* 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;
+package org.jboss.portal.core.admin.portal.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.core.admin.portal.ui.InstanceManagerBean;
+import org.jboss.portal.core.admin.portal.ui.PortletManagerBean;
import org.jboss.portal.portlet.Portlet;
import org.jboss.portal.security.RoleSecurityBinding;
import org.jboss.portal.security.SecurityConstants;
Modified:
trunk/core-admin/src/main/org/jboss/portal/core/admin/portal/ui/actions/PortalAction.java
===================================================================
---
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/actions/PortalAction.java 2007-08-02
11:58:06 UTC (rev 7861)
+++
trunk/core-admin/src/main/org/jboss/portal/core/admin/portal/ui/actions/PortalAction.java 2007-08-03
10:18:53 UTC (rev 7864)
@@ -20,7 +20,7 @@
* 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;
+package org.jboss.portal.core.admin.portal.ui.actions;
import org.jboss.portal.Mode;
import org.jboss.portal.WindowState;
@@ -30,7 +30,7 @@
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.core.admin.portal.ui.PortalObjectManagerBean;
import org.jboss.portal.security.RoleSecurityBinding;
import org.jboss.portal.security.SecurityConstants;
import org.jboss.portal.security.spi.provider.DomainConfigurator;
Modified:
trunk/core-admin/src/main/org/jboss/portal/core/admin/portal/ui/actions/PropertyAction.java
===================================================================
---
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/actions/PropertyAction.java 2007-08-02
11:58:06 UTC (rev 7861)
+++
trunk/core-admin/src/main/org/jboss/portal/core/admin/portal/ui/actions/PropertyAction.java 2007-08-03
10:18:53 UTC (rev 7864)
@@ -20,11 +20,11 @@
* 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;
+package org.jboss.portal.core.admin.portal.ui.actions;
import java.util.Map;
-import org.jboss.portal.core.admin.ui.PortalObjectManagerBean;
+import org.jboss.portal.core.admin.portal.ui.PortalObjectManagerBean;
import org.jboss.portal.core.impl.model.portal.PortalObjectImpl;
import org.jboss.portal.core.model.portal.PortalObject;
Modified:
trunk/core-admin/src/main/org/jboss/portal/core/admin/portal/ui/actions/RenameAction.java
===================================================================
---
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/actions/RenameAction.java 2007-08-02
11:58:06 UTC (rev 7861)
+++
trunk/core-admin/src/main/org/jboss/portal/core/admin/portal/ui/actions/RenameAction.java 2007-08-03
10:18:53 UTC (rev 7864)
@@ -20,14 +20,14 @@
* 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;
+package org.jboss.portal.core.admin.portal.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.admin.portal.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;
Modified:
trunk/core-admin/src/main/org/jboss/portal/core/admin/portal/ui/actions/WindowComparator.java
===================================================================
---
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/actions/WindowComparator.java 2007-08-02
11:58:06 UTC (rev 7861)
+++
trunk/core-admin/src/main/org/jboss/portal/core/admin/portal/ui/actions/WindowComparator.java 2007-08-03
10:18:53 UTC (rev 7864)
@@ -20,7 +20,7 @@
* 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;
+package org.jboss.portal.core.admin.portal.ui.actions;
import org.jboss.portal.core.model.portal.Window;
import org.jboss.portal.theme.ThemeConstants;
Copied: trunk/core-admin/src/main/org/jboss/portal/core/admin/portal/ui/common (from rev
7861, trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/common)
Modified:
trunk/core-admin/src/main/org/jboss/portal/core/admin/portal/ui/common/PageManagerBean.java
===================================================================
---
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/common/PageManagerBean.java 2007-08-02
11:58:06 UTC (rev 7861)
+++
trunk/core-admin/src/main/org/jboss/portal/core/admin/portal/ui/common/PageManagerBean.java 2007-08-03
10:18:53 UTC (rev 7864)
@@ -20,7 +20,7 @@
* 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;
+package org.jboss.portal.core.admin.portal.ui.common;
import org.jboss.portal.core.model.portal.Page;
import org.jboss.portal.core.model.portal.PortalObject;
@@ -30,7 +30,7 @@
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.admin.portal.ui.actions.WindowComparator;
import org.jboss.portal.core.impl.model.content.ContentProviderRegistryService;
import org.jboss.portal.theme.ThemeConstants;
import org.jboss.portal.theme.PortalLayout;
Copied: trunk/core-admin/src/main/org/jboss/portal/core/admin/portal/ui/conversion (from
rev 7861, trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/conversion)
Modified:
trunk/core-admin/src/main/org/jboss/portal/core/admin/portal/ui/conversion/ContentTypeConverter.java
===================================================================
---
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/conversion/ContentTypeConverter.java 2007-08-02
11:58:06 UTC (rev 7861)
+++
trunk/core-admin/src/main/org/jboss/portal/core/admin/portal/ui/conversion/ContentTypeConverter.java 2007-08-03
10:18:53 UTC (rev 7864)
@@ -20,7 +20,7 @@
* 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;
+package org.jboss.portal.core.admin.portal.ui.conversion;
import org.jboss.portal.core.model.content.ContentType;
Modified:
trunk/core-admin/src/main/org/jboss/portal/core/admin/portal/ui/conversion/PortalObjectIdConverter.java
===================================================================
---
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/conversion/PortalObjectIdConverter.java 2007-08-02
11:58:06 UTC (rev 7861)
+++
trunk/core-admin/src/main/org/jboss/portal/core/admin/portal/ui/conversion/PortalObjectIdConverter.java 2007-08-03
10:18:53 UTC (rev 7864)
@@ -20,7 +20,7 @@
* 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;
+package org.jboss.portal.core.admin.portal.ui.conversion;
import org.jboss.portal.core.model.portal.PortalObjectId;
import org.jboss.portal.core.model.portal.PortalObjectPath;
Copied: trunk/core-admin/src/main/org/jboss/portal/core/admin/portal/ui/dashboard (from
rev 7861, trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/dashboard)
Modified:
trunk/core-admin/src/main/org/jboss/portal/core/admin/portal/ui/dashboard/DashboardBean.java
===================================================================
---
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/dashboard/DashboardBean.java 2007-08-02
11:58:06 UTC (rev 7861)
+++
trunk/core-admin/src/main/org/jboss/portal/core/admin/portal/ui/dashboard/DashboardBean.java 2007-08-03
10:18:53 UTC (rev 7864)
@@ -20,12 +20,12 @@
* 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;
+package org.jboss.portal.core.admin.portal.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.admin.portal.ui.actions.AddPageAction;
+import org.jboss.portal.core.admin.portal.ui.common.PageManagerBean;
+import org.jboss.portal.core.admin.portal.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;
Copied: trunk/core-admin/src/main/org/jboss/portal/core/admin/portal/ui/portlet (from rev
7861, trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/portlet)
Modified:
trunk/core-admin/src/main/org/jboss/portal/core/admin/portal/ui/portlet/PortletDefinitionInvoker.java
===================================================================
---
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/portlet/PortletDefinitionInvoker.java 2007-08-02
11:58:06 UTC (rev 7861)
+++
trunk/core-admin/src/main/org/jboss/portal/core/admin/portal/ui/portlet/PortletDefinitionInvoker.java 2007-08-03
10:18:53 UTC (rev 7864)
@@ -20,7 +20,7 @@
* 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;
+package org.jboss.portal.core.admin.portal.ui.portlet;
import org.jboss.portal.portlet.PortletInvoker;
import org.jboss.portal.portlet.PortletInvokerException;
Copied: trunk/core-admin/src/main/org/jboss/portal/core/admin/portal/ui/wizard (from rev
7861, trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/wizard)
Modified:
trunk/core-admin/src/main/org/jboss/portal/core/admin/portal/ui/wizard/NewWindowWizard.java
===================================================================
---
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/wizard/NewWindowWizard.java 2007-08-02
11:58:06 UTC (rev 7861)
+++
trunk/core-admin/src/main/org/jboss/portal/core/admin/portal/ui/wizard/NewWindowWizard.java 2007-08-03
10:18:53 UTC (rev 7864)
@@ -20,7 +20,7 @@
* 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;
+package org.jboss.portal.core.admin.portal.ui.wizard;
import java.util.ArrayList;
import java.util.Collection;
Deleted:
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 2007-08-03
07:43:15 UTC (rev 7863)
+++
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/AdminPropertyResolver.java 2007-08-03
10:18:53 UTC (rev 7864)
@@ -1,374 +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;
-
-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);
- }
-
-}
Deleted: 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 2007-08-03
07:43:15 UTC (rev 7863)
+++
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/AuthorizationBean.java 2007-08-03
10:18:53 UTC (rev 7864)
@@ -1,210 +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;
-
-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();
-}
Deleted:
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 2007-08-03
07:43:15 UTC (rev 7863)
+++
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/ControlPropertiesBean.java 2007-08-03
10:18:53 UTC (rev 7864)
@@ -1,169 +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;
-
-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();
- }
-}
Deleted:
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 2007-08-03
07:43:15 UTC (rev 7863)
+++
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/ControlPropertyBean.java 2007-08-03
10:18:53 UTC (rev 7864)
@@ -1,88 +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;
-
-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());
- }
-}
Deleted:
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 2007-08-03
07:43:15 UTC (rev 7863)
+++
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/InstanceManagerBean.java 2007-08-03
10:18:53 UTC (rev 7864)
@@ -1,484 +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;
-
-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") };
- }
- }
-}
Deleted:
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 2007-08-03
07:43:15 UTC (rev 7863)
+++
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/PortalObjectManagerBean.java 2007-08-03
10:18:53 UTC (rev 7864)
@@ -1,720 +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;
-
-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;
- }
-}
Deleted: 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 2007-08-03
07:43:15 UTC (rev 7863)
+++
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/PortletManagerBean.java 2007-08-03
10:18:53 UTC (rev 7864)
@@ -1,420 +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;
-
-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());
- }
- };
-}
Deleted: 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 2007-08-03
07:43:15 UTC (rev 7863)
+++
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/PreferenceBean.java 2007-08-03
10:18:53 UTC (rev 7864)
@@ -1,226 +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;
-
-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);
- }
-}
Deleted: 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 2007-08-03
07:43:15 UTC (rev 7863)
+++
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/PreferencesBean.java 2007-08-03
10:18:53 UTC (rev 7864)
@@ -1,130 +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;
-
-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();
- }
-}
Deleted: 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 2007-08-03
07:43:15 UTC (rev 7863)
+++
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/PropertiesBean.java 2007-08-03
10:18:53 UTC (rev 7864)
@@ -1,167 +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;
-
-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;
- }
-}
Deleted: 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 2007-08-03
07:43:15 UTC (rev 7863)
+++
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/PropertiesInfo.java 2007-08-03
10:18:53 UTC (rev 7864)
@@ -1,265 +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;
-
-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);
- }
-
-}
Deleted: 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 2007-08-03
07:43:15 UTC (rev 7863)
+++ trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/PropertyBean.java 2007-08-03
10:18:53 UTC (rev 7864)
@@ -1,143 +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;
-
-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 + "]";
- }
-}
Deleted:
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 2007-08-03
07:43:15 UTC (rev 7863)
+++
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/PropertyBeanContainer.java 2007-08-03
10:18:53 UTC (rev 7864)
@@ -1,36 +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;
-
-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();
-
-}
Deleted: 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 2007-08-03
07:43:15 UTC (rev 7863)
+++ trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/PropertyInfo.java 2007-08-03
10:18:53 UTC (rev 7864)
@@ -1,111 +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;
-
-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 + "]";
- }
-}
Deleted: 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 2007-08-03
07:43:15 UTC (rev 7863)
+++ trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/Refresher.java 2007-08-03
10:18:53 UTC (rev 7864)
@@ -1,104 +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;
-
-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
Deleted: 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 2007-08-03
07:43:15 UTC (rev 7863)
+++ trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/ThemeBean.java 2007-08-03
10:18:53 UTC (rev 7864)
@@ -1,192 +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;
-
-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);
- }
- }
-}
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
07:43:15 UTC (rev 7863)
+++ trunk/core-admin/src/resources/portal-admin-war/WEB-INF/faces-config.xml 2007-08-03
10:18:53 UTC (rev 7864)
@@ -28,420 +28,10 @@
<faces-config>
<application>
-
<property-resolver>org.jboss.portal.core.admin.ui.AdminPropertyResolver</property-resolver>
+
<property-resolver>org.jboss.portal.core.admin.portal.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>
Deleted:
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 2007-08-03
07:43:15 UTC (rev 7863)
+++
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/confirmDeleteInstance.xhtml 2007-08-03
10:18:53 UTC (rev 7864)
@@ -1,22 +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">
-
- <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
Deleted: 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 2007-08-03
07:43:15 UTC (rev 7863)
+++
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/dashboards.xhtml 2007-08-03
10:18:53 UTC (rev 7864)
@@ -1,48 +0,0 @@
-<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>
Deleted:
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 2007-08-03
07:43:15 UTC (rev 7863)
+++
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/dashboardsTemplate.xhtml 2007-08-03
10:18:53 UTC (rev 7864)
@@ -1,31 +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">
-
- <!-- 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>
Deleted: 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 2007-08-03
07:43:15 UTC (rev 7863)
+++
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/editContext.xhtml 2007-08-03
10:18:53 UTC (rev 7864)
@@ -1,40 +0,0 @@
-<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>
Deleted: 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 2007-08-03
07:43:15 UTC (rev 7863)
+++ trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/editPage.xhtml 2007-08-03
10:18:53 UTC (rev 7864)
@@ -1,84 +0,0 @@
-<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>
Deleted: 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 2007-08-03
07:43:15 UTC (rev 7863)
+++
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/editPageLayout.xhtml 2007-08-03
10:18:53 UTC (rev 7864)
@@ -1,17 +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: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>
Deleted:
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 2007-08-03
07:43:15 UTC (rev 7863)
+++
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/editPageSecurity.xhtml 2007-08-03
10:18:53 UTC (rev 7864)
@@ -1,15 +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">
- <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>
Deleted: 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 2007-08-03
07:43:15 UTC (rev 7863)
+++
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/editPageTheme.xhtml 2007-08-03
10:18:53 UTC (rev 7864)
@@ -1,22 +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">
- <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>
-
Deleted:
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 2007-08-03
07:43:15 UTC (rev 7863)
+++
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/editPortalSecurity.xhtml 2007-08-03
10:18:53 UTC (rev 7864)
@@ -1,15 +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">
- <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>
Deleted:
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 2007-08-03
07:43:15 UTC (rev 7863)
+++
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/editPortalTheme.xhtml 2007-08-03
10:18:53 UTC (rev 7864)
@@ -1,24 +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">
- <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>
-
Deleted: 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 2007-08-03
07:43:15 UTC (rev 7863)
+++
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/editProperties.xhtml 2007-08-03
10:18:53 UTC (rev 7864)
@@ -1,41 +0,0 @@
-<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
Deleted: 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 2007-08-03
07:43:15 UTC (rev 7863)
+++
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/editWindow.xhtml 2007-08-03
10:18:53 UTC (rev 7864)
@@ -1,29 +0,0 @@
-<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>
Deleted:
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 2007-08-03
07:43:15 UTC (rev 7863)
+++
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/editWindowSecurity.xhtml 2007-08-03
10:18:53 UTC (rev 7864)
@@ -1,12 +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">
- <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>
Deleted:
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 2007-08-03
07:43:15 UTC (rev 7863)
+++
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/editWindowTheme.xhtml 2007-08-03
10:18:53 UTC (rev 7864)
@@ -1,22 +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">
- <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>
-
Deleted: 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 2007-08-03
07:43:15 UTC (rev 7863)
+++ trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/instances.xhtml 2007-08-03
10:18:53 UTC (rev 7864)
@@ -1,108 +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.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>
Deleted:
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 2007-08-03
07:43:15 UTC (rev 7863)
+++
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/instancesTemplate.xhtml 2007-08-03
10:18:53 UTC (rev 7864)
@@ -1,29 +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"
- 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>
Deleted:
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 2007-08-03
07:43:15 UTC (rev 7863)
+++
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/objectNavigation.xhtml 2007-08-03
10:18:53 UTC (rev 7864)
@@ -1,136 +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: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>
Deleted: 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 2007-08-03
07:43:15 UTC (rev 7863)
+++
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/objectTemplate.xhtml 2007-08-03
10:18:53 UTC (rev 7864)
@@ -1,83 +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">
-
- <!-- 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>
Deleted: 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 2007-08-03
07:43:15 UTC (rev 7863)
+++ trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/objects.xhtml 2007-08-03
10:18:53 UTC (rev 7864)
@@ -1,27 +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: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/portal/common (from
rev 7861, trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/common)
Copied:
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/portal/confirmDeleteInstance.xhtml
(from rev 7861,
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/confirmDeleteInstance.xhtml)
===================================================================
---
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/portal/confirmDeleteInstance.xhtml
(rev 0)
+++
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/portal/confirmDeleteInstance.xhtml 2007-08-03
10:18:53 UTC (rev 7864)
@@ -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/portal/dashboard (from
rev 7861, trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/dashboard)
Copied:
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/portal/dashboards.xhtml (from
rev 7861, trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/dashboards.xhtml)
===================================================================
--- trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/portal/dashboards.xhtml
(rev 0)
+++
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/portal/dashboards.xhtml 2007-08-03
10:18:53 UTC (rev 7864)
@@ -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/portal/dashboardsTemplate.xhtml
(from rev 7861,
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/dashboardsTemplate.xhtml)
===================================================================
---
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/portal/dashboardsTemplate.xhtml
(rev 0)
+++
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/portal/dashboardsTemplate.xhtml 2007-08-03
10:18:53 UTC (rev 7864)
@@ -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/portal/editContext.xhtml (from
rev 7861, trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/editContext.xhtml)
===================================================================
--- trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/portal/editContext.xhtml
(rev 0)
+++
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/portal/editContext.xhtml 2007-08-03
10:18:53 UTC (rev 7864)
@@ -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/portal/editPage.xhtml
(from rev 7861,
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/editPage.xhtml)
===================================================================
--- trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/portal/editPage.xhtml
(rev 0)
+++
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/portal/editPage.xhtml 2007-08-03
10:18:53 UTC (rev 7864)
@@ -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/portal/editPageLayout.xhtml
(from rev 7861,
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/editPageLayout.xhtml)
===================================================================
---
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/portal/editPageLayout.xhtml
(rev 0)
+++
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/portal/editPageLayout.xhtml 2007-08-03
10:18:53 UTC (rev 7864)
@@ -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/portal/editPageSecurity.xhtml
(from rev 7861,
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/editPageSecurity.xhtml)
===================================================================
---
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/portal/editPageSecurity.xhtml
(rev 0)
+++
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/portal/editPageSecurity.xhtml 2007-08-03
10:18:53 UTC (rev 7864)
@@ -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/portal/editPageTheme.xhtml
(from rev 7861,
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/editPageTheme.xhtml)
===================================================================
---
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/portal/editPageTheme.xhtml
(rev 0)
+++
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/portal/editPageTheme.xhtml 2007-08-03
10:18:53 UTC (rev 7864)
@@ -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>
+
Copied:
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/portal/editPortalSecurity.xhtml
(from rev 7861,
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/editPortalSecurity.xhtml)
===================================================================
---
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/portal/editPortalSecurity.xhtml
(rev 0)
+++
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/portal/editPortalSecurity.xhtml 2007-08-03
10:18:53 UTC (rev 7864)
@@ -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/portal/editPortalTheme.xhtml
(from rev 7861,
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/editPortalTheme.xhtml)
===================================================================
---
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/portal/editPortalTheme.xhtml
(rev 0)
+++
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/portal/editPortalTheme.xhtml 2007-08-03
10:18:53 UTC (rev 7864)
@@ -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>
+
Copied:
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/portal/editProperties.xhtml
(from rev 7861,
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/editProperties.xhtml)
===================================================================
---
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/portal/editProperties.xhtml
(rev 0)
+++
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/portal/editProperties.xhtml 2007-08-03
10:18:53 UTC (rev 7864)
@@ -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/portal/editWindow.xhtml (from
rev 7861, trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/editWindow.xhtml)
===================================================================
--- trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/portal/editWindow.xhtml
(rev 0)
+++
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/portal/editWindow.xhtml 2007-08-03
10:18:53 UTC (rev 7864)
@@ -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/portal/editWindowSecurity.xhtml
(from rev 7861,
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/editWindowSecurity.xhtml)
===================================================================
---
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/portal/editWindowSecurity.xhtml
(rev 0)
+++
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/portal/editWindowSecurity.xhtml 2007-08-03
10:18:53 UTC (rev 7864)
@@ -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/portal/editWindowTheme.xhtml
(from rev 7861,
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/editWindowTheme.xhtml)
===================================================================
---
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/portal/editWindowTheme.xhtml
(rev 0)
+++
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/portal/editWindowTheme.xhtml 2007-08-03
10:18:53 UTC (rev 7864)
@@ -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/portal/instances.xhtml
(from rev 7861,
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/instances.xhtml)
===================================================================
--- trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/portal/instances.xhtml
(rev 0)
+++
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/portal/instances.xhtml 2007-08-03
10:18:53 UTC (rev 7864)
@@ -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>
Copied:
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/portal/instancesTemplate.xhtml
(from rev 7861,
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/instancesTemplate.xhtml)
===================================================================
---
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/portal/instancesTemplate.xhtml
(rev 0)
+++
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/portal/instancesTemplate.xhtml 2007-08-03
10:18:53 UTC (rev 7864)
@@ -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/portal/objectNavigation.xhtml
(from rev 7861,
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/objectNavigation.xhtml)
===================================================================
---
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/portal/objectNavigation.xhtml
(rev 0)
+++
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/portal/objectNavigation.xhtml 2007-08-03
10:18:53 UTC (rev 7864)
@@ -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/portal/objectTemplate.xhtml
(from rev 7861,
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/objectTemplate.xhtml)
===================================================================
---
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/portal/objectTemplate.xhtml
(rev 0)
+++
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/portal/objectTemplate.xhtml 2007-08-03
10:18:53 UTC (rev 7864)
@@ -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/portal/objects.xhtml
(from rev 7861,
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/objects.xhtml)
===================================================================
--- trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/portal/objects.xhtml
(rev 0)
+++
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/portal/objects.xhtml 2007-08-03
10:18:53 UTC (rev 7864)
@@ -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/portal/portlets.xhtml
(from rev 7861,
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/portlets.xhtml)
===================================================================
--- trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/portal/portlets.xhtml
(rev 0)
+++
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/portal/portlets.xhtml 2007-08-03
10:18:53 UTC (rev 7864)
@@ -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>
Copied:
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/portal/portletsTemplate.xhtml
(from rev 7861,
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/portletsTemplate.xhtml)
===================================================================
---
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/portal/portletsTemplate.xhtml
(rev 0)
+++
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/portal/portletsTemplate.xhtml 2007-08-03
10:18:53 UTC (rev 7864)
@@ -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/portal/renameObject.xhtml
(from rev 7861,
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/renameObject.xhtml)
===================================================================
--- trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/portal/renameObject.xhtml
(rev 0)
+++
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/portal/renameObject.xhtml 2007-08-03
10:18:53 UTC (rev 7864)
@@ -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/portal/showPortletInfo.xhtml
(from rev 7861,
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/showPortletInfo.xhtml)
===================================================================
---
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/portal/showPortletInfo.xhtml
(rev 0)
+++
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/portal/showPortletInfo.xhtml 2007-08-03
10:18:53 UTC (rev 7864)
@@ -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>
Copied: trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/portal/wizard (from
rev 7861, trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/wizard)
Deleted: 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 2007-08-03
07:43:15 UTC (rev 7863)
+++ trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/portlets.xhtml 2007-08-03
10:18:53 UTC (rev 7864)
@@ -1,96 +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.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>
Deleted:
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 2007-08-03
07:43:15 UTC (rev 7863)
+++
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/portletsTemplate.xhtml 2007-08-03
10:18:53 UTC (rev 7864)
@@ -1,29 +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"
- 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>
Deleted: 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 2007-08-03
07:43:15 UTC (rev 7863)
+++
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/renameObject.xhtml 2007-08-03
10:18:53 UTC (rev 7864)
@@ -1,19 +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="/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>
Deleted:
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 2007-08-03
07:43:15 UTC (rev 7863)
+++
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/showPortletInfo.xhtml 2007-08-03
10:18:53 UTC (rev 7864)
@@ -1,27 +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">
- <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>
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
07:43:15 UTC (rev 7863)
+++ trunk/core-admin/src/resources/portal-admin-war/WEB-INF/portlet.xml 2007-08-03
10:18:53 UTC (rev 7864)
@@ -34,7 +34,7 @@
<portlet-class>org.jboss.portal.faces.loader.FacesPortlet</portlet-class>
<init-param>
<name>default-view</name>
- <value>/WEB-INF/jsf/objects.xhtml</value>
+ <value>/WEB-INF/jsf/portal/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/dashboard/dashboard.xhtml</value>
+ <value>/WEB-INF/jsf/portal/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 07:43:15
UTC (rev 7863)
+++ trunk/core-admin/src/resources/portal-admin-war/WEB-INF/web.xml 2007-08-03 10:18:53
UTC (rev 7864)
@@ -73,6 +73,10 @@
<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>