Author: julien(a)jboss.com
Date: 2007-02-28 19:56:12 -0500 (Wed, 28 Feb 2007)
New Revision: 6477
Added:
trunk/core-admin/src/bin/portal-admin-war/style.css
trunk/core-admin/src/main/org/jboss/portal/core/admin/
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/AbstractAuthorizationBean.java
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/ContentTypeConverter.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/PortalObjectBean.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/PreferencesBean.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/actions/
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/content/
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/
Removed:
trunk/core-admin/src/bin/portal-admin-war/images/management/management.css
trunk/core-admin/src/main/org/jboss/portal/core/portlet/management/AbstractAuthorizationBean.java
trunk/core-admin/src/main/org/jboss/portal/core/portlet/management/ContentTypeConverter.java
trunk/core-admin/src/main/org/jboss/portal/core/portlet/management/InstanceManagerBean.java
trunk/core-admin/src/main/org/jboss/portal/core/portlet/management/PortalObjectBean.java
trunk/core-admin/src/main/org/jboss/portal/core/portlet/management/PortalObjectManagerBean.java
trunk/core-admin/src/main/org/jboss/portal/core/portlet/management/PortletManagerBean.java
trunk/core-admin/src/main/org/jboss/portal/core/portlet/management/PreferencesBean.java
trunk/core-admin/src/main/org/jboss/portal/core/portlet/management/Refresher.java
trunk/core-admin/src/main/org/jboss/portal/core/portlet/management/actions/
trunk/core-admin/src/main/org/jboss/portal/core/portlet/management/content/
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsp/management/
Modified:
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/actions/AddPageAction.java
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/actions/AssignWindowsAction.java
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/actions/CreateInstanceAction.java
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/actions/PortalAction.java
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/actions/PreferenceAction.java
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/actions/PropertyAction.java
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/actions/ThemePropertyAction.java
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/actions/WindowComparator.java
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/content/AbstractContentEditor.java
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/content/AbstractFaceletContentEditor.java
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/content/ContentEditor.java
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/content/ContentEditorRegistry.java
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/content/ContentEditorRegistryBean.java
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/content/ContentEditorRegistryService.java
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/content/ContentEditorTagHandler.java
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/content/FaceletContentEditor.java
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/content/PortletContentEditor.java
trunk/core-admin/src/resources/portal-admin-sar/META-INF/jboss-service.xml
trunk/core-admin/src/resources/portal-admin-war/META-INF/content.taglib.xml
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/faces-config.xml
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jboss-portlet.xml
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/editPageLayout.xhtml
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/editPagePreferences.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/editPortalPreferences.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/editWindowPreferences.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/pages.xhtml
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/portals.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/showPortletInfo.xhtml
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/windows.xhtml
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/portlet-instances.xml
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/portlet.xml
trunk/core-cms/src/main/org/jboss/portal/core/cms/content/CMSFaceletContentEditor.java
trunk/core/src/resources/portal-core-sar/conf/data/default-object.xml
Log:
refactored the core-admin to have package names that reflect more its nature
(management->admin)
Modified: trunk/core/src/resources/portal-core-sar/conf/data/default-object.xml
===================================================================
--- trunk/core/src/resources/portal-core-sar/conf/data/default-object.xml 2007-02-28
23:35:26 UTC (rev 6476)
+++ trunk/core/src/resources/portal-core-sar/conf/data/default-object.xml 2007-03-01
00:56:12 UTC (rev 6477)
@@ -307,8 +307,8 @@
<page>
<page-name>default</page-name>
<window>
- <window-name>ManagementPortletWindow</window-name>
- <instance-ref>ManagementPortletInstance</instance-ref>
+ <window-name>AdminPortletWindow</window-name>
+ <instance-ref>AdminPortletInstance</instance-ref>
<region>center</region>
<height>0</height>
</window>
Deleted: trunk/core-admin/src/bin/portal-admin-war/images/management/management.css
===================================================================
--- trunk/core-admin/src/bin/portal-admin-war/images/management/management.css 2007-02-28
23:35:26 UTC (rev 6476)
+++ trunk/core-admin/src/bin/portal-admin-war/images/management/management.css 2007-03-01
00:56:12 UTC (rev 6477)
@@ -1,69 +0,0 @@
-/* Redefine spacing for tables. */
-.admin-ui table {
- border: 0px;
- border-collapse: separate;
- border-spacing: 10px 4px;
- margin-left: -10px;
- margin-right: -10px;
- margin-top: -4px;
- margin-bottom: -4px;
-}
-
-.admin-ui th {
- text-align:left;
- border: 0px;
- border-bottom: 1px solid;
-}
-
-.admin-ui td {
- border: 0px;
- padding-bottom: 2px;
- padding-top: 2px;
-}
-
-.admin-ui ul.pagination {
- margin: 0;
- padding: 4px 0px 3px 0px;
-}
-
-.admin-ui ul.pagination li {
- list-style-type: none;
- display: inline;
- margin-right: 2px;
- border: 1px solid;
-}
-
-.admin-ui ul.pagination li.selected {
- font-weight: bold;
-}
-
-.pagination a, .pagination a:visited, .pagination a:hover{
- text-decoration: none;
-}
-
-.admin-ui ul.topnav {
- margin: 0;
- padding: 5px 0px 5px 0px;
-}
-
-.admin-ui ul.topnav li {
- list-style-type: none;
- display: inline;
- margin-right: 10px;
-}
-
-.admin-ui ul.objectpath {
- margin: 0;
- padding: 5px 0px 5px 0px;
-}
-
-.admin-ui ul.objectpath li {
- list-style-type: none;
- display: inline;
- margin-right: 3px;
-}
-
-/* Change dashed line to solid. */
-.admin-ui hr {
- border-top-style: solid;
-}
Copied: trunk/core-admin/src/bin/portal-admin-war/style.css (from rev 6476,
trunk/core-admin/src/bin/portal-admin-war/images/management/management.css)
===================================================================
--- trunk/core-admin/src/bin/portal-admin-war/style.css (rev 0)
+++ trunk/core-admin/src/bin/portal-admin-war/style.css 2007-03-01 00:56:12 UTC (rev
6477)
@@ -0,0 +1,69 @@
+/* Redefine spacing for tables. */
+.admin-ui table {
+ border: 0px;
+ border-collapse: separate;
+ border-spacing: 10px 4px;
+ margin-left: -10px;
+ margin-right: -10px;
+ margin-top: -4px;
+ margin-bottom: -4px;
+}
+
+.admin-ui th {
+ text-align:left;
+ border: 0px;
+ border-bottom: 1px solid;
+}
+
+.admin-ui td {
+ border: 0px;
+ padding-bottom: 2px;
+ padding-top: 2px;
+}
+
+.admin-ui ul.pagination {
+ margin: 0;
+ padding: 4px 0px 3px 0px;
+}
+
+.admin-ui ul.pagination li {
+ list-style-type: none;
+ display: inline;
+ margin-right: 2px;
+ border: 1px solid;
+}
+
+.admin-ui ul.pagination li.selected {
+ font-weight: bold;
+}
+
+.pagination a, .pagination a:visited, .pagination a:hover{
+ text-decoration: none;
+}
+
+.admin-ui ul.topnav {
+ margin: 0;
+ padding: 5px 0px 5px 0px;
+}
+
+.admin-ui ul.topnav li {
+ list-style-type: none;
+ display: inline;
+ margin-right: 10px;
+}
+
+.admin-ui ul.objectpath {
+ margin: 0;
+ padding: 5px 0px 5px 0px;
+}
+
+.admin-ui ul.objectpath li {
+ list-style-type: none;
+ display: inline;
+ margin-right: 3px;
+}
+
+/* Change dashed line to solid. */
+.admin-ui hr {
+ border-top-style: solid;
+}
Copied:
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/AbstractAuthorizationBean.java
(from rev 6476,
trunk/core-admin/src/main/org/jboss/portal/core/portlet/management/AbstractAuthorizationBean.java)
===================================================================
---
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/AbstractAuthorizationBean.java
(rev 0)
+++
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/AbstractAuthorizationBean.java 2007-03-01
00:56:12 UTC (rev 6477)
@@ -0,0 +1,208 @@
+/******************************************************************************
+ * 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 AbstractAuthorizationBean
+{
+
+ 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 execute();
+
+ 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/ui/ContentTypeConverter.java
(from rev 6476,
trunk/core-admin/src/main/org/jboss/portal/core/portlet/management/ContentTypeConverter.java)
===================================================================
--- trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/ContentTypeConverter.java
(rev 0)
+++
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/ContentTypeConverter.java 2007-03-01
00:56:12 UTC (rev 6477)
@@ -0,0 +1,47 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.core.admin.ui;
+
+import org.jboss.portal.core.model.content.ContentType;
+
+import javax.faces.convert.Converter;
+import javax.faces.convert.ConverterException;
+import javax.faces.context.FacesContext;
+import javax.faces.component.UIComponent;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class ContentTypeConverter implements Converter
+{
+ public Object getAsObject(FacesContext facesContext, UIComponent uiComponent, String
string) throws ConverterException
+ {
+ return string == null ? null : ContentType.create(string);
+ }
+
+ public String getAsString(FacesContext facesContext, UIComponent uiComponent, Object
object) throws ConverterException
+ {
+ return object == null ? null : object.toString();
+ }
+}
Copied: trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/InstanceManagerBean.java
(from rev 6476,
trunk/core-admin/src/main/org/jboss/portal/core/portlet/management/InstanceManagerBean.java)
===================================================================
--- trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/InstanceManagerBean.java
(rev 0)
+++
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/InstanceManagerBean.java 2007-03-01
00:56:12 UTC (rev 6477)
@@ -0,0 +1,464 @@
+/******************************************************************************
+ * 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.Iterator;
+import java.util.List;
+import java.util.Map;
+
+import javax.faces.context.ExternalContext;
+import javax.faces.context.FacesContext;
+import javax.faces.model.SelectItem;
+import javax.faces.application.FacesMessage;
+
+import org.jboss.logging.Logger;
+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.NoSuchInstanceException;
+import org.jboss.portal.core.model.instance.InstanceDefinition;
+import org.jboss.portal.faces.matrix.Cell;
+import org.jboss.portal.faces.matrix.Row;
+import org.jboss.portal.faces.matrix.RowSetModel;
+import org.jboss.portal.faces.el.DelegatingPropertyResolver;
+import org.jboss.portal.faces.el.decorator.SimpleBeanDecorator;
+import org.jboss.portal.faces.el.decorator.AbstractPropertyDecorator;
+import org.jboss.portal.identity.RoleModule;
+import org.jboss.portal.portlet.Portlet;
+import org.jboss.portal.portlet.PortletInvokerException;
+import org.jboss.portal.portlet.info.PreferencesInfo;
+import org.jboss.portal.portlet.state.PropertyMap;
+import org.jboss.portal.security.AuthorizationDomainRegistry;
+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 Logger log = Logger.getLogger(getClass());
+
+ /** . */
+ private InstanceContainer instanceContainer;
+
+ /** . */
+ private AuthorizationDomainRegistry authorizationDomainRegistry;
+
+ /** . */
+ private RoleModule roleModule;
+
+ /** . */
+ private String selectedId;
+
+ /** . */
+ private String selectedPlugin;
+
+ /** . */
+ private int selectedFrom;
+
+ /** . */
+ private PreferencesBean selectedPreferences;
+
+ /** . */
+ private Integer selectedRow;
+
+ /** . */
+ private AbstractAuthorizationBean auth = new AuthorizationBean();
+
+ /** . */
+ private final int paginationSize = 10;
+
+ public int getPaginationSize()
+ {
+ return 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 InstanceContainer getInstanceContainer()
+ {
+ return instanceContainer;
+ }
+
+ public void setInstanceContainer(InstanceContainer instanceContainer)
+ {
+ this.instanceContainer = instanceContainer;
+ }
+
+ public String getSelectedId()
+ {
+ return selectedId;
+ }
+
+ public void setSelectedId(String selectedId)
+ {
+ this.selectedId = selectedId;
+ }
+
+ 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 DomainConfigurator getDomainConfigurator()
+ {
+ return
authorizationDomainRegistry.getDomain("instance").getConfigurator();
+ }
+
+ public Instance getSelectedInstance()
+ {
+ if (selectedId != null)
+ {
+ return instanceContainer.getDefinition(selectedId);
+ }
+ else
+ {
+ return null;
+ }
+ }
+
+ public PreferencesBean getSelectedPreferences()
+ {
+ return selectedPreferences;
+ }
+
+ public String getSelectedPlugin()
+ {
+ return selectedPlugin;
+ }
+
+ public void setSelectedPlugin(String selectedPlugin)
+ {
+ this.selectedPlugin = selectedPlugin;
+ }
+
+ public AbstractAuthorizationBean getAuth()
+ {
+ return auth;
+ }
+
+ /** Return an array of all instances known in this container. */
+ public Collection getInstances()
+ {
+ List instances = new ArrayList(instanceContainer.getDefinitions());
+
+// try
+// {
+// sortInstances(instances, sortColumn, sortAscending);
+// }
+// catch (Exception e)
+// {
+// log.warn("Error during sorting instances list");
+// }
+
+ //
+ int to = Math.min(selectedFrom + 10, instances.size());
+
+ //
+ return instances.subList(selectedFrom, to);
+ }
+
+ public int getInstanceCount()
+ {
+ return instanceContainer.getDefinitions().size();
+ }
+
+ 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");
+ selectedPreferences = null;
+ }
+
+ public void deleteInstance()
+ {
+ try
+ {
+ FacesContext ctx = FacesContext.getCurrentInstance();
+ ExternalContext ectx = ctx.getExternalContext();
+ Map params = ectx.getRequestParameterMap();
+ String id = (String)params.get("id");
+
+ //
+ instanceContainer.destroyDefinition(id);
+
+ //
+ selectedId = null;
+ selectedPreferences = null;
+ selectedFrom = 0;
+ }
+ catch (NoSuchInstanceException e)
+ {
+ e.printStackTrace();
+ }
+ catch (PortletInvokerException e)
+ {
+ e.printStackTrace();
+ }
+ }
+
+ /** Refresh the selected prefs. */
+ public void refresh()
+ {
+ selectedPreferences = null;
+
+ //
+ if ("preferences".equals(selectedPlugin))
+ {
+ Instance selectedInstance = getSelectedInstance();
+
+ //
+ if (selectedInstance != null)
+ {
+ try
+ {
+ PreferencesInfo prefsInfo =
selectedInstance.getPortlet().getInfo().getPreferences();
+ if (prefsInfo != null)
+ {
+ RowSetModel model = new RowSetModel(null, prefsInfo.getKeys().size());
+ PropertyMap prefs = getSelectedInstance().getProperties();
+
+ //
+ int index = 0;
+ for (Iterator i = prefsInfo.getKeys().iterator(); i.hasNext();
index++)
+ {
+ String key = (String)i.next();
+
+ // Get info for this key
+ // PreferenceInfo info = prefsInfo.getPreference(key);
+ // boolean readOnly = info.isReadOnly();
+ boolean readOnly = false;
+ // Value value = info.getValue();
+
+ // Get value from the state
+ Value value = prefs.getProperty(key);
+
+ //
+ Row row = model.getRow(index);
+ row.setReadOnly(readOnly);
+
+ //
+ Cell cell = row.getCell();
+ cell.setHandback("" + i);
+ cell.setValue(value.asStringArray());
+
+ //
+ row.setHandback(key);
+ row.setKey(key);
+ row.setName("Description");
+ row.setReadOnly(false);
+ row.setValue(value.asStringArray());
+ }
+
+ //
+ selectedPreferences = new PreferencesBean(model);
+
+ //
+ if (selectedRow != null)
+ {
+ selectedPreferences.selectRow(selectedRow);
+ }
+ }
+ }
+ catch (PortletInvokerException e)
+ {
+ log.warn("Couldn't access portlet invoker associated to instance
" + selectedInstance.getId()
+ + ". This instance won't be refreshed.\nReason:\n\t" +
e.getLocalizedMessage());
+ }
+ }
+ }
+ }
+
+// public static void sortInstances(List instances, final String column, final boolean
ascending)
+// {
+// Comparator comparator = new Comparator()
+// {
+// public int compare(Object o1, Object o2)
+// {
+// if (column == null)
+// {
+// return 0;
+// }
+// if (column.equals("id"))
+// {
+// Instance i1 = (Instance)((Object[])o1)[0];
+// Instance i2 = (Instance)((Object[])o2)[0];
+// return ascending ? i1.getId().compareToIgnoreCase(i2.getId()) :
i2.getId()
+// .compareToIgnoreCase(i1.getId());
+// }
+// if (column.equals("portlet"))
+// {
+// Portlet p1 = (Portlet)((Object[])o1)[1];
+// Portlet p2 = (Portlet)((Object[])o2)[1];
+//
+// LocalizedString displayName =
p1.getInfo().getMeta().getMetaValue(MetaInfo.DISPLAY_NAME);
+// FacesContext ctx = FacesContext.getCurrentInstance();
+// Locale locale = ctx.getExternalContext().getRequestLocale();
+// String name1 = displayName.getString(locale, true);
+// displayName =
p2.getInfo().getMeta().getMetaValue(MetaInfo.DISPLAY_NAME);
+// String name2 = displayName.getString(locale, true);
+//
+// if (name1 == null || name2 == null)
+// {
+// return 0;
+// }
+//
+// return ascending ? name1.compareToIgnoreCase(name2) : name2
+// .compareToIgnoreCase(name1);
+// }
+//
+// else
+// {
+// return 0;
+// }
+// }
+// };
+// Collections.sort(instances, comparator);
+// }
+
+ public class AuthorizationBean extends AbstractAuthorizationBean
+ {
+
+ public DomainConfigurator getDomainConfigurator()
+ {
+ return InstanceManagerBean.this.getDomainConfigurator();
+ }
+
+ protected String getURI()
+ {
+ Instance instance = getSelectedInstance();
+ if (instance != null)
+ {
+ return instance.getId();
+ }
+ else
+ {
+ return null;
+ }
+ }
+
+ public String execute()
+ {
+ 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 RoleModule getRoleModule()
+ {
+ return roleModule;
+ }
+
+ public SelectItem[] getAvailableActions()
+ {
+ return new SelectItem[]{
+ new SelectItem("view")
+ };
+ }
+ }
+
+ static
+ {
+ SimpleBeanDecorator instanceDecorator = new SimpleBeanDecorator();
+
+ // If the portlet is not available we want to avoid the stack trace and rather
return null
+ instanceDecorator.setProperty("portlet", new
AbstractPropertyDecorator(Portlet.class)
+ {
+ public Object getValue(Object bean)
+ {
+ Instance instance = (Instance)bean;
+ try
+ {
+ return instance.getPortlet();
+ }
+ catch (PortletInvokerException e)
+ {
+ return null;
+ }
+ }
+ });
+
+ //
+ DelegatingPropertyResolver.registerDecorator(InstanceDefinition.class,
instanceDecorator);
+ }
+
+}
Copied: trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/PortalObjectBean.java
(from rev 6476,
trunk/core-admin/src/main/org/jboss/portal/core/portlet/management/PortalObjectBean.java)
===================================================================
--- trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/PortalObjectBean.java
(rev 0)
+++
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/PortalObjectBean.java 2007-03-01
00:56:12 UTC (rev 6477)
@@ -0,0 +1,77 @@
+/******************************************************************************
+ * 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.PortalObjectId;
+
+/**
+ * @author <a href="mailto:theute@jboss.org">Thomas Heute</a>
+ * @version $Revision$
+ */
+public class PortalObjectBean
+{
+ private PortalObject po;
+ private PortalObjectBean parent;
+
+
+ public PortalObjectBean(PortalObject po)
+ {
+ this.po = po;
+ }
+
+ public String getId()
+ {
+ return po.getId().toString(PortalObjectId.LEGACY_BASE64_FORMAT);
+ }
+
+// public void setId(String id)
+// {
+// // Do nothing
+// }
+
+ public String getName()
+ {
+ return po.getName();
+ }
+
+ public PortalObjectBean getParent()
+ {
+ if ((parent == null) || (po.getParent() != parent.getPortalObject()))
+ {
+ parent = new PortalObjectBean(po.getParent());
+ }
+ return parent;
+ }
+
+ public int getType()
+ {
+ return po.getType();
+ }
+
+ public PortalObject getPortalObject()
+ {
+ return po;
+ }
+
+}
Copied:
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/PortalObjectManagerBean.java
(from rev 6476,
trunk/core-admin/src/main/org/jboss/portal/core/portlet/management/PortalObjectManagerBean.java)
===================================================================
--- trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/PortalObjectManagerBean.java
(rev 0)
+++
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/PortalObjectManagerBean.java 2007-03-01
00:56:12 UTC (rev 6477)
@@ -0,0 +1,966 @@
+/******************************************************************************
+ * 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.Comparator;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.LinkedHashMap;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Locale;
+import java.util.Map;
+import java.util.Set;
+import java.util.SortedSet;
+import java.util.TreeSet;
+
+import javax.faces.application.FacesMessage;
+import javax.faces.context.FacesContext;
+import javax.faces.event.ActionEvent;
+import javax.faces.model.SelectItem;
+
+import org.jboss.logging.Logger;
+import org.jboss.portal.common.MediaType;
+import org.jboss.portal.common.util.LocalizedString;
+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.Window;
+import org.jboss.portal.core.model.content.ContentType;
+import org.jboss.portal.core.admin.ui.actions.WindowComparator;
+import org.jboss.portal.faces.el.DelegatingPropertyResolver;
+import org.jboss.portal.faces.el.decorator.SimpleBeanDecorator;
+import org.jboss.portal.faces.el.decorator.AbstractPropertyDecorator;
+import org.jboss.portal.identity.IdentityException;
+import org.jboss.portal.identity.RoleModule;
+import org.jboss.portal.portlet.Portlet;
+import org.jboss.portal.portlet.info.MetaInfo;
+import org.jboss.portal.portlet.info.PortletInfo;
+import org.jboss.portal.security.AuthorizationDomainRegistry;
+import org.jboss.portal.security.spi.auth.PortalAuthorizationManagerFactory;
+import org.jboss.portal.security.spi.provider.DomainConfigurator;
+import org.jboss.portal.theme.LayoutService;
+import org.jboss.portal.theme.PortalLayout;
+import org.jboss.portal.theme.PortalTheme;
+import org.jboss.portal.theme.ServerRegistrationID;
+import org.jboss.portal.theme.ThemeConstants;
+import org.jboss.portal.theme.ThemeService;
+import org.jboss.portal.theme.render.PortalRenderSet;
+import org.jboss.portal.theme.strategy.LayoutStrategy;
+
+/** The portal object manager bean. */
+public class PortalObjectManagerBean implements Serializable
+{
+
+ /** The serialVersionUID */
+ private static final long serialVersionUID = -8923517554726982622L;
+
+ static
+ {
+ 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;
+ }
+ }
+ });
+
+ //
+ 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);
+ }
+ });
+
+ //
+ 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());
+ }
+ });
+
+ //
+ DelegatingPropertyResolver.registerDecorator(LocalizedString.class,
localizedStringDecorator);
+ DelegatingPropertyResolver.registerDecorator(RoleModule.class,
roleModuleDecorator);
+ DelegatingPropertyResolver.registerDecorator(Portlet.class, portletDecorator);
+ }
+
+ /** . */
+ private Logger log = Logger.getLogger(getClass());
+
+ /** The selected id. */
+ private String selectedId;
+
+ /** The current tab name. */
+ private String selectedPlugin;
+
+ /** . */
+ private RoleModule roleModule;
+
+ /** . */
+ private PortalObjectContainer portalObjectContainer;
+
+ /** . */
+ private InstanceContainer instanceContainer;
+
+ /** . */
+ private LayoutService layoutService;
+
+ /** . */
+ private ThemeService themeService;
+
+ /** . */
+ private AuthorizationDomainRegistry authorizationDomainRegistry;
+
+ /** . */
+ private PortalAuthorizationManagerFactory portalAuthorizationManagerFactory;
+
+ /** . */
+ private AbstractAuthorizationBean auth = new PortalObjectAuthorizationBean();
+
+ /** . */
+ private ThemeBean themes = new ThemeBean();
+
+ /** The selected type for content. */
+ private ContentType selectedContentType = ContentType.PORTLET;
+
+ /** The uri value for content. */
+ private String selectedContentURI;
+
+ 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 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;
+ }
+
+ 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 AuthorizationDomainRegistry getAuthorizationDomainRegistry()
+ {
+ return authorizationDomainRegistry;
+ }
+
+ public void setAuthorizationDomainRegistry(AuthorizationDomainRegistry
authorizationDomainRegistry)
+ {
+ this.authorizationDomainRegistry = authorizationDomainRegistry;
+ }
+
+ public AbstractAuthorizationBean getAuth()
+ {
+ return auth;
+ }
+
+ public ThemeBean getThemes()
+ {
+ return themes;
+ }
+
+ // ****************************
+
+ public DomainConfigurator getDomainConfigurator()
+ {
+ return
authorizationDomainRegistry.getDomain("portalobject").getConfigurator();
+ }
+
+ public PortalObject getObjectFromId(String id)
+ {
+ PortalObjectId objectId = PortalObjectId.parse(id,
PortalObjectId.LEGACY_BASE64_FORMAT);
+ return getObjectFromId(objectId);
+ }
+
+ public PortalObject getObjectFromId(PortalObjectId id)
+ {
+ return portalObjectContainer.getObject(id);
+ }
+
+ public List getSelectedObjectPath()
+ {
+ PortalObject o = getSelectedObject();
+ ArrayList path = new ArrayList();
+ while (o != null)
+ {
+ path.add(new PortalObjectBean(o));
+ o = o.getParent();
+ }
+ Collections.reverse(path);
+ return path;
+ }
+
+ public PortalObject getSelectedObject()
+ {
+ PortalObject result;
+ if (selectedId != null)
+ {
+ result = getObjectFromId(selectedId);
+ }
+ else
+ {
+ result = portalObjectContainer.getRootObject();
+ }
+ return result;
+ }
+
+ public PortalObjectBean getSelectedObjectBean()
+ {
+ return new PortalObjectBean(getSelectedObject());
+ }
+
+ public void setSelectedObject(PortalObject po)
+ {
+ selectedId = po.getId().toString(PortalObjectId.LEGACY_BASE64_FORMAT);
+ }
+
+ public List getSelectedProperties()
+ {
+ //return selectedProperties;
+ PortalObject object = getSelectedObject();
+ List properties = new ArrayList();
+ for (Iterator i = object.getDeclaredProperties().entrySet().iterator();
i.hasNext();)
+ {
+ Map.Entry entry = (Map.Entry)i.next();
+ properties.add(new String[]{(String)entry.getKey(), (String)entry.getValue()});
+ }
+ return properties;
+ }
+
+ public String getSelectedPlugin()
+ {
+ return selectedPlugin;
+ }
+
+ public void selectPlugin()
+ {
+ // Get id
+ Map pmap =
FacesContext.getCurrentInstance().getExternalContext().getRequestParameterMap();
+ selectedPlugin = (String)pmap.get("plugin");
+ }
+
+ public void selectParentObject(ActionEvent ae)
+ {
+ selectParentObject();
+ }
+
+ public void selectParentObject()
+ {
+ setSelectedObject(getSelectedObject().getParent());
+ }
+
+ public void selectRootObject(ActionEvent ae)
+ {
+ setSelectedObject(portalObjectContainer.getRootObject());
+ }
+
+ public void udpateContentType()
+ {
+ // Do nothing
+ }
+
+ public void selectObject(ActionEvent ae)
+ {
+ selectObject();
+ }
+
+ /** Proceed to an object selection. */
+ public String selectObject()
+ {
+ // Clear state
+ selectedId = new PortalObjectId().toString(PortalObjectId.LEGACY_BASE64_FORMAT);
+ selectedPlugin = null;
+ selectedContentType = ContentType.PORTLET;
+ selectedContentURI = null;
+
+ //
+ String next = "portals";
+
+ try
+ {
+
+ // Get id
+ Map pmap =
FacesContext.getCurrentInstance().getExternalContext().getRequestParameterMap();
+ String id = (String)pmap.get("id");
+
+ // Set the state from the id
+ if (id != null)
+ {
+ PortalObjectId poid = PortalObjectId.parse(id,
PortalObjectId.LEGACY_BASE64_FORMAT);
+ PortalObject object = portalObjectContainer.getObject(poid);
+
+ // Update state if possible
+ if (object != null)
+ {
+ selectedId = id;
+ selectedPlugin = "manager";
+ switch(object.getType())
+ {
+ case PortalObject.TYPE_CONTEXT:
+ next = "portals";
+ break;
+ case PortalObject.TYPE_PORTAL:
+ next = "pages";
+ break;
+ case PortalObject.TYPE_PAGE:
+ next = "pages";
+ break;
+ case PortalObject.TYPE_WINDOW:
+ next = "windows";
+ break;
+ }
+ }
+ }
+ }
+ catch (Exception e)
+ {
+ e.printStackTrace();
+ }
+
+ //
+ return next;
+ }
+
+ /** Proceed to object destroy. */
+ public void destroyObject(ActionEvent ae)
+ {
+ try
+ {
+ // Clear state
+ selectedId = null;
+ selectedPlugin = null;
+
+ // Get id
+ Map pmap =
FacesContext.getCurrentInstance().getExternalContext().getRequestParameterMap();
+ String id = (String)pmap.get("id");
+
+ // Destroy the object
+ if (id != null)
+ {
+ PortalObjectId poid = PortalObjectId.parse(id,
PortalObjectId.LEGACY_BASE64_FORMAT);
+ PortalObject object = portalObjectContainer.getObject(poid);
+
+ setSelectedObject(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();
+ }
+ }
+
+ private List getNodes(int mask)
+ {
+ Collection test = getSelectedObject().getChildren(mask);
+ // TODO: don't recreate the objects each time !
+ // TODO: Use a datamodel
+ ArrayList result = new ArrayList();
+ Iterator it = test.iterator();
+ while (it.hasNext())
+ {
+ PortalObject po = (PortalObject)it.next();
+ result.add(new PortalObjectBean(po));
+ }
+ return result;
+ }
+
+ public List getPortalNodes()
+ {
+ return getNodes(PortalObject.PORTAL_MASK);
+ }
+
+ public List getPageNodes()
+ {
+ return getNodes(PortalObject.PAGE_MASK);
+ }
+
+ public List getWindowNodes()
+ {
+ return getNodes(PortalObject.WINDOW_MASK);
+ }
+
+ public SelectItem[] getInstanceItems()
+ {
+ Collection instances = instanceContainer.getDefinitions();
+
+ //sort instances by id
+ List sortedInstances = new LinkedList();
+ for (Iterator i = instances.iterator(); i.hasNext();)
+ {
+ Instance instance = (Instance)i.next();
+ sortedInstances.add(instance);
+ }
+ try
+ {
+ sortInstances(sortedInstances, "id", true);
+ }
+ catch (Exception e)
+ {
+ log.warn("Error while sorting instances list");
+ }
+
+ ArrayList list = new ArrayList(instances.size());
+ for (Iterator i = sortedInstances.iterator(); i.hasNext();)
+ {
+ Instance instance = (Instance)i.next();
+ SelectItem item = new SelectItem(instance.getId());
+ list.add(item);
+ }
+ return (SelectItem[])list.toArray(new SelectItem[list.size()]);
+ }
+
+ public SelectItem[] getPortalPageItems()
+ {
+ Collection pages = getSelectedObject().getChildren();
+
+ ArrayList list = new ArrayList(pages.size() + 1);
+ for (Iterator iterator = pages.iterator(); iterator.hasNext();)
+ {
+ PortalObject o = (PortalObject)iterator.next();
+ if (o.getType() == PortalObject.TYPE_PAGE)
+ {
+ SelectItem item = new SelectItem(o.getName());
+ list.add(item);
+ }
+
+ }
+ list.add(new SelectItem("", "no selection"));
+
+ return (SelectItem[])list.toArray(new SelectItem[list.size()]);
+ }
+
+
+ public static void sortInstances(List instances, final String column, final boolean
ascending)
+ {
+ Comparator comparator = new Comparator()
+ {
+ public int compare(Object o1, Object o2)
+ {
+ Instance i1 = (Instance)o1;
+ Instance i2 = (Instance)o2;
+
+ if (column == null)
+ {
+ return 0;
+ }
+ if (column.equals("id"))
+ {
+ return ascending ? i1.getId().compareToIgnoreCase(i2.getId()) :
i2.getId()
+ .compareToIgnoreCase(i1.getId());
+ }
+ else
+ {
+ return 0;
+ }
+ }
+ };
+ Collections.sort(instances, comparator);
+ }
+
+ /** Returns a <Region,<Window>SortedSet>Map. */
+ private Map getWindows(Page page) throws Exception
+ {
+ // Get the layout
+ String layoutId = page.getProperty(ThemeConstants.PORTAL_PROP_LAYOUT);
+ PortalLayout layout = layoutService.getLayout(layoutId, false);
+
+ //
+ LinkedHashMap windows = new LinkedHashMap();
+ for (Iterator i = layout.getLayoutInfo().getRegionNames().iterator();
i.hasNext();)
+ {
+ String region = (String)i.next();
+ windows.put(region, new TreeSet(new WindowComparator()));
+ }
+ windows.put("unknown", new TreeSet(new WindowComparator()));
+
+ //
+ for (Iterator j = getSelectedObject().getChildren().iterator(); j.hasNext();)
+ {
+ PortalObject object = (PortalObject)j.next();
+ if (object.getType() == PortalObject.TYPE_WINDOW)
+ {
+ String region = object.getProperty(ThemeConstants.PORTAL_PROP_REGION);
+ if (!windows.containsKey(region))
+ {
+ region = "unknown";
+ }
+ SortedSet set = (SortedSet)windows.get(region);
+ set.add(object);
+ }
+ }
+ return windows;
+ }
+
+ /** Return the <Region>List on the selected object which must be a page. */
+ public List getRegionNames()
+ {
+ try
+ {
+ Map windows = getWindows((Page)getSelectedObject());
+
+ //
+ List regions = new ArrayList(windows.keySet());
+ Collections.sort(regions);
+
+ //
+ return regions;
+ }
+ catch (Exception e)
+ {
+ e.printStackTrace();
+
+ //
+ return Collections.EMPTY_LIST;
+ }
+ }
+
+ public Map getWindowItemsMap() throws Exception
+ {
+ Map windowMap = getWindows((Page)getSelectedObject());
+ for (Iterator i = windowMap.entrySet().iterator();i.hasNext();)
+ {
+ Map.Entry entry = (Map.Entry)i.next();
+ SortedSet windows = (SortedSet)entry.getValue();
+ ArrayList windowItems = new ArrayList(windows.size());
+ for (Iterator j = windows.iterator();j.hasNext();)
+ {
+ Window window = (Window)j.next();
+ SelectItem windowItem = new SelectItem();
+ windowItem.setValue(window.getName());
+ windowItem.setLabel(window.getName());
+ windowItems.add(windowItem);
+ }
+ entry.setValue(windowItems);
+ }
+ return windowMap;
+ }
+
+ // ****************************
+
+ public class PortalObjectAuthorizationBean extends AbstractAuthorizationBean
+ {
+
+ public DomainConfigurator getDomainConfigurator()
+ {
+ return PortalObjectManagerBean.this.getDomainConfigurator();
+ }
+
+ protected String getURI()
+ {
+ PortalObject po = getSelectedObject();
+ if (po != null)
+ {
+ return po.getId().toString(PortalObjectId.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"),
+ new SelectItem("dashboard", "Dashboard"),
+ };
+ }
+
+ public String execute()
+ {
+ String stringMessage = "Security has been correctly updated on the
page";
+ FacesMessage message = new FacesMessage(FacesMessage.SEVERITY_INFO,
stringMessage, stringMessage);
+ FacesContext.getCurrentInstance().addMessage("status", message);
+
+ //
+ PortalObject po = getSelectedObject();
+ setSelectedObject(po.getParent());
+
+ //
+ if (po.getType() == PortalObject.TYPE_PORTAL)
+ {
+ return "portals";
+ }
+ else if (po.getType() == PortalObject.TYPE_PAGE)
+ {
+ return "pages";
+ }
+ else if (po.getType() == PortalObject.TYPE_WINDOW)
+ {
+ return "windows";
+ }
+ return null;
+ }
+
+ public RoleModule getRoleModule()
+ {
+ return roleModule;
+ }
+ }
+
+ public final class ThemeBean
+ {
+ public String getLayoutName()
+ {
+ return getDeclaredProperty(ThemeConstants.PORTAL_PROP_LAYOUT);
+ }
+
+ public String getThemeName()
+ {
+ return getDeclaredProperty(ThemeConstants.PORTAL_PROP_THEME);
+ }
+
+ public String getRenderSetName()
+ {
+ return getDeclaredProperty(ThemeConstants.PORTAL_PROP_RENDERSET);
+ }
+
+ public String getStrategyName()
+ {
+ return getDeclaredProperty(ThemeConstants.PORTAL_PROP_STRATEGY);
+ }
+
+ public String getWindowRenderer()
+ {
+ return getDeclaredProperty(ThemeConstants.PORTAL_PROP_WINDOW_RENDERER);
+ }
+
+ public String getDecorationRenderer()
+ {
+ return getDeclaredProperty(ThemeConstants.PORTAL_PROP_DECORATION_RENDERER);
+ }
+
+ public String getPortletRenderer()
+ {
+ return getDeclaredProperty(ThemeConstants.PORTAL_PROP_PORTLET_RENDERER);
+ }
+
+ /**
+ * Get the list of available layouts
+ *
+ * @return an array of the available layout names to pick a layout from
+ */
+ public SelectItem[] getLayoutNames()
+ {
+ Collection layouts = layoutService.getLayouts();
+ SelectItem[] names = new SelectItem[layouts.size() + 1];
+ int p = 0;
+ for (Iterator i = layouts.iterator(); i.hasNext();)
+ {
+ PortalLayout layout = (PortalLayout)i.next();
+ names[p++] = new SelectItem(layout.getLayoutInfo().getName(),
layout.getLayoutInfo().getName());
+ }
+ names[p] = new SelectItem("", "default");
+ return names;
+ }
+
+ /**
+ * Get the list of available themes
+ *
+ * @return an array of the available theme names to pick a theme from
+ */
+ public SelectItem[] getThemeNames()
+ {
+ Collection themes = themeService.getThemes();
+ SelectItem[] themeNames = new SelectItem[themes.size() + 1];
+
+ int p = 0;
+ for (Iterator i = themes.iterator(); i.hasNext();)
+ {
+ PortalTheme theme = (PortalTheme)i.next();
+ themeNames[p++] = new SelectItem(theme.getThemeInfo().getName(),
theme.getThemeInfo().getName());
+ }
+ themeNames[p] = new SelectItem("", "default");
+
+ return themeNames;
+ }
+
+ /**
+ * Get a list of available render sets
+ *
+ * @return and array of all available render set names to pick a render set from
+ */
+ public SelectItem[] getRenderSetNames()
+ {
+ 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[] renderSetNames = new SelectItem[names.size() + 1];
+ int i = 0;
+ for (Iterator it = names.keySet().iterator(); it.hasNext();)
+ {
+ String key = (String)it.next();
+ renderSetNames[i++] = new SelectItem(key, (String)names.get(key));
+ }
+ renderSetNames[i] = new SelectItem("", "default");
+ return renderSetNames;
+ }
+
+ public SelectItem[] getStrategyNames()
+ {
+ Collection strategies = layoutService.getStrategies();
+ Map names = new HashMap();
+ for (Iterator i = strategies.iterator(); i.hasNext();)
+ {
+ ServerRegistrationID id = (ServerRegistrationID)i.next();
+ LayoutStrategy strategy = layoutService.getStrategy(id, MediaType.HTML);
+ if (strategy != null)
+ {
+ names.put(strategy.getName(), strategy.getName());
+ }
+ }
+ SelectItem[] strategyNames = new SelectItem[names.size() + 1];
+
+ int i = 0;
+ for (Iterator it = names.keySet().iterator(); it.hasNext();)
+ {
+ String key = (String)it.next();
+ strategyNames[i++] = new SelectItem(key, (String)names.get(key));
+ }
+ strategyNames[i] = new SelectItem("", "Default");
+ return strategyNames;
+ }
+
+ private String getDeclaredProperty(String key)
+ {
+ String value = null;
+ PortalObject po = getSelectedObject();
+ if (po != null)
+ {
+ value = po.getDeclaredProperty(key);
+ }
+
+ return value;
+ }
+ }
+
+ public PortalAuthorizationManagerFactory getPortalAuthorizationManagerFactory()
+ {
+ return portalAuthorizationManagerFactory;
+ }
+
+ public void setPortalAuthorizationManagerFactory(PortalAuthorizationManagerFactory
portalAuthorizationManagerFactory)
+ {
+ this.portalAuthorizationManagerFactory = portalAuthorizationManagerFactory;
+ }
+
+ 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";
+ }
+}
Copied: trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/PortletManagerBean.java
(from rev 6476,
trunk/core-admin/src/main/org/jboss/portal/core/portlet/management/PortletManagerBean.java)
===================================================================
--- trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/PortletManagerBean.java
(rev 0)
+++
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/PortletManagerBean.java 2007-03-01
00:56:12 UTC (rev 6477)
@@ -0,0 +1,426 @@
+/******************************************************************************
+ * 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.Iterator;
+import java.util.List;
+import java.util.Locale;
+import java.util.Map;
+
+import javax.faces.context.FacesContext;
+import javax.faces.model.SelectItem;
+
+import org.jboss.logging.Logger;
+import org.jboss.portal.common.value.Value;
+import org.jboss.portal.common.value.StringValue;
+import org.jboss.portal.core.model.instance.InstanceContainer;
+import org.jboss.portal.faces.matrix.Cell;
+import org.jboss.portal.faces.matrix.Row;
+import org.jboss.portal.faces.matrix.RowSetModel;
+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.PreferenceInfo;
+import org.jboss.portal.portlet.info.PreferencesInfo;
+import org.jboss.portal.security.AuthorizationDomainRegistry;
+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 PortletManagerBean
+{
+
+ /** . */
+ private Logger log = Logger.getLogger(getClass());
+
+ /** . */
+ private InstanceContainer instanceContainer;
+
+ /** . */
+ private AuthorizationDomainRegistry authorizationDomainRegistry;
+
+ /** . */
+ private String selectedPortletId;
+
+ /** The current tab name. */
+ private String selectedPlugin;
+
+ /** . */
+ private RoleModule roleModule;
+
+ /** . */
+ private PreferencesBean selectedPreferences;
+
+ /** . */
+ private String selectedFederatedId;
+
+ /** . */
+ private AbstractAuthorizationBean auth = new AuthorizationBean();
+
+ /** . */
+ private FederatingPortletInvoker federatingPortletInvoker;
+
+ /** . */
+ private int selectedFrom;
+
+ /** . */
+ private final int paginationSize = 10;
+
+ public int getPaginationSize()
+ {
+ return paginationSize;
+ }
+
+ public int getSelectedFrom()
+ {
+ return selectedFrom;
+ }
+
+ public void setSelectedFrom(int selectedFrom)
+ {
+ this.selectedFrom = selectedFrom;
+ }
+
+ public RoleModule getRoleModule()
+ {
+ return roleModule;
+ }
+
+ public void setRoleModule(RoleModule roleModule)
+ {
+ this.roleModule = roleModule;
+ }
+
+ private PortletInvoker getPortletInvoker()
+ {
+ return federatingPortletInvoker.getFederatedInvoker(selectedFederatedId);
+ }
+
+ public Collection getFederatedIds()
+ {
+ ArrayList toto = new ArrayList();
+ toto.add(new SelectItem("local"));
+ for (Iterator i = federatingPortletInvoker.getFederatedInvokers().iterator();
i.hasNext();)
+ {
+ FederatedPortletInvoker federated = (FederatedPortletInvoker)i.next();
+ if ("local".equals(federated.getId()) == false)
+ {
+ toto.add(new SelectItem(federated.getId()));
+ }
+ }
+ return toto;
+ }
+
+ 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 String getSelectedPlugin()
+ {
+ return selectedPlugin;
+ }
+
+ public void setSelectedPlugin(String selectedPlugin)
+ {
+ this.selectedPlugin = selectedPlugin;
+ }
+
+ public String getSelectedFederatedId()
+ {
+ return selectedFederatedId;
+ }
+
+ public void setSelectedFederatedId(String selectedFederatedId)
+ {
+ this.selectedFederatedId = selectedFederatedId;
+ }
+
+ public FederatingPortletInvoker getFederatingPortletInvoker()
+ {
+ return federatingPortletInvoker;
+ }
+
+ public void setFederatingPortletInvoker(FederatingPortletInvoker
federatingPortletInvoker)
+ {
+ this.federatingPortletInvoker = federatingPortletInvoker;
+ }
+
+ public PreferencesBean getSelectedPreferences()
+ {
+ return selectedPreferences;
+ }
+
+ public Collection getPortlets()
+ {
+ try
+ {
+ // Get portlets
+ List portlets = new ArrayList(getPortletInvoker().getPortlets());
+
+ // Sort
+ Collections.sort(portlets, comparator);
+
+ // Compute upper bound
+ int to = Math.min(selectedFrom + 10, portlets.size());
+
+ // Range
+ return portlets.subList(selectedFrom, to);
+ }
+ 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 int getPortletCount()
+ {
+ try
+ {
+ return getPortletInvoker().getPortlets().size();
+ }
+ catch (PortletInvokerException e)
+ {
+ return 0;
+ }
+ }
+
+ public DomainConfigurator getDomainConfigurator()
+ {
+ return
authorizationDomainRegistry.getDomain("portlet").getConfigurator();
+ }
+
+ public AbstractAuthorizationBean getAuth()
+ {
+ return auth;
+ }
+
+ public Portlet getSelectedPortlet()
+ {
+ if (selectedPortletId != null)
+ {
+ try
+ {
+ return
getPortletInvoker().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 null;
+ }
+ }
+ else
+ {
+ return null;
+ }
+ }
+
+ 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);
+
+ //
+ selectedFederatedId = portlet.getFederatedId();
+
+ // Get sorted portlets
+ List portlets = new ArrayList(getPortletInvoker().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;
+
+ //
+ if ("preferences".equals(selectedPlugin))
+ {
+ // Get user locale
+ FacesContext ctx = FacesContext.getCurrentInstance();
+ Locale locale = ctx.getExternalContext().getRequestLocale();
+
+ // Get portlet
+ Portlet portlet = getSelectedPortlet();
+
+ //
+ if (portlet != null)
+ {
+ // Get preferences info
+ PreferencesInfo prefsInfo = portlet.getInfo().getPreferences();
+
+ // If the portlet has preferences info then we display them
+ if (prefsInfo != null)
+ {
+ RowSetModel model = new RowSetModel(null, prefsInfo.getKeys().size());
+ model.setMutable(false);
+
+ //
+ int index = 0;
+ for (Iterator i = prefsInfo.getKeys().iterator(); i.hasNext(); index++)
+ {
+ String key = (String)i.next();
+
+ //
+ PreferenceInfo prefs = prefsInfo.getPreference(key);
+ Value value = new StringValue("not available");
+ Boolean readOnly = prefs.isReadOnly();
+
+ //
+ Row row = model.getRow(index);
+
+ //
+ Cell cell = row.getCell();
+ cell.setHandback("" + i);
+ cell.setValue(value.asStringArray());
+
+ //
+ row.setHandback(key);
+ row.setKey(key);
+ row.setName(prefs.getDisplayName().getString(locale, true));
+ row.setReadOnly(Boolean.TRUE.equals(readOnly));
+ row.setValue(value.asStringArray());
+ }
+
+ //
+ selectedPreferences = new PreferencesBean(model);
+ }
+ }
+ }
+ }
+
+ /** 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());
+ }
+ };
+
+ public class AuthorizationBean extends AbstractAuthorizationBean
+ {
+
+ protected String getURI()
+ {
+ Portlet portlet = getSelectedPortlet();
+ if (portlet != null)
+ {
+ return portlet.getContext().getId();
+ }
+ else
+ {
+ return null;
+ }
+ }
+
+ public String execute()
+ {
+ return null;
+ }
+
+ public RoleModule getRoleModule()
+ {
+ return roleModule;
+ }
+
+ public DomainConfigurator getDomainConfigurator()
+ {
+ return PortletManagerBean.this.getDomainConfigurator();
+ }
+
+ public SelectItem[] getAvailableActions()
+ {
+ return new SelectItem[]{
+ new SelectItem("view")
+ };
+ }
+ }
+}
Copied: trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/PreferencesBean.java
(from rev 6476,
trunk/core-admin/src/main/org/jboss/portal/core/portlet/management/PreferencesBean.java)
===================================================================
--- trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/PreferencesBean.java
(rev 0)
+++
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/PreferencesBean.java 2007-03-01
00:56:12 UTC (rev 6477)
@@ -0,0 +1,74 @@
+/******************************************************************************
+ * 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.matrix.Cell;
+import org.jboss.portal.faces.matrix.Row;
+import org.jboss.portal.faces.matrix.RowSetModel;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 5448 $
+ */
+public class PreferencesBean
+{
+
+ /** . */
+ private RowSetModel model;
+
+ /** . */
+ private Cell selectedPreference;
+
+ public PreferencesBean(RowSetModel selectedPreferences)
+ {
+ this.model = selectedPreferences;
+ }
+
+ public Cell getSelectedPreference()
+ {
+ return selectedPreference;
+ }
+
+ public void setSelectedPreference(Cell selectedPreference)
+ {
+ this.selectedPreference = selectedPreference;
+ }
+
+ public RowSetModel getModel()
+ {
+ return model;
+ }
+
+ public void selectRow(Integer index)
+ {
+ if (index != null)
+ {
+ Row row = model.getRow(index.intValue());
+ selectedPreference = row.getCell();
+ }
+ else
+ {
+ selectedPreference = null;
+ }
+ }
+}
Copied: trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/Refresher.java (from rev
6476, trunk/core-admin/src/main/org/jboss/portal/core/portlet/management/Refresher.java)
===================================================================
--- trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/Refresher.java
(rev 0)
+++ trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/Refresher.java 2007-03-01
00:56:12 UTC (rev 6477)
@@ -0,0 +1,66 @@
+/******************************************************************************
+ * 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.context.FacesContext;
+import javax.faces.event.PhaseEvent;
+import javax.faces.event.PhaseId;
+import javax.faces.event.PhaseListener;
+
+/**
+ * Refresh the beans before JSR 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.RENDER_RESPONSE)
+ {
+ FacesContext ctx = phaseEvent.getFacesContext();
+
+ //
+ InstanceManagerBean instancemgr =
(InstanceManagerBean)ctx.getApplication().createValueBinding("#{instancemgr}").getValue(ctx);
+ instancemgr.refresh();
+
+ //
+ PortletManagerBean portletmgr =
(PortletManagerBean)ctx.getApplication().createValueBinding("#{portletmgr}").getValue(ctx);
+ portletmgr.refresh();
+ }
+ }
+
+ public PhaseId getPhaseId()
+ {
+ return PhaseId.ANY_PHASE;
+ }
+}
\ No newline at end of file
Copied: trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/actions (from rev 6476,
trunk/core-admin/src/main/org/jboss/portal/core/portlet/management/actions)
Modified:
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/actions/AddPageAction.java
===================================================================
---
trunk/core-admin/src/main/org/jboss/portal/core/portlet/management/actions/AddPageAction.java 2007-02-28
23:35:26 UTC (rev 6476)
+++
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/actions/AddPageAction.java 2007-03-01
00:56:12 UTC (rev 6477)
@@ -20,13 +20,13 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
* 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
******************************************************************************/
-package org.jboss.portal.core.portlet.management.actions;
+package org.jboss.portal.core.admin.ui.actions;
import org.jboss.portal.core.model.portal.Page;
import org.jboss.portal.core.model.portal.PageContainer;
import org.jboss.portal.core.model.portal.PortalObjectPermission;
import org.jboss.portal.core.model.portal.PortalObjectId;
-import org.jboss.portal.core.portlet.management.PortalObjectManagerBean;
+import org.jboss.portal.core.admin.ui.PortalObjectManagerBean;
import org.jboss.portal.security.RoleSecurityBinding;
import org.jboss.portal.security.SecurityConstants;
import org.jboss.portal.security.spi.provider.DomainConfigurator;
@@ -36,7 +36,6 @@
import javax.faces.context.FacesContext;
import javax.faces.validator.ValidatorException;
import java.util.Collections;
-import java.util.Map;
import java.util.Set;
/**
Modified:
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/actions/AssignWindowsAction.java
===================================================================
---
trunk/core-admin/src/main/org/jboss/portal/core/portlet/management/actions/AssignWindowsAction.java 2007-02-28
23:35:26 UTC (rev 6476)
+++
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/actions/AssignWindowsAction.java 2007-03-01
00:56:12 UTC (rev 6477)
@@ -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.portlet.management.actions;
+package org.jboss.portal.core.admin.ui.actions;
import org.jboss.portal.faces.el.dynamic.DynamicBean;
import org.jboss.portal.faces.el.PropertyValue;
@@ -30,7 +30,7 @@
import org.jboss.portal.core.model.portal.NoSuchPortalObjectException;
import org.jboss.portal.core.model.portal.DuplicatePortalObjectException;
import org.jboss.portal.core.model.portal.PortalObject;
-import org.jboss.portal.core.portlet.management.PortalObjectManagerBean;
+import org.jboss.portal.core.admin.ui.PortalObjectManagerBean;
import org.jboss.portal.theme.ThemeConstants;
import javax.faces.event.ActionEvent;
Modified:
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/actions/CreateInstanceAction.java
===================================================================
---
trunk/core-admin/src/main/org/jboss/portal/core/portlet/management/actions/CreateInstanceAction.java 2007-02-28
23:35:26 UTC (rev 6476)
+++
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/actions/CreateInstanceAction.java 2007-03-01
00:56:12 UTC (rev 6477)
@@ -20,15 +20,13 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
* 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
******************************************************************************/
-package org.jboss.portal.core.portlet.management.actions;
+package org.jboss.portal.core.admin.ui.actions;
import org.jboss.portal.core.model.instance.Instance;
import org.jboss.portal.core.model.instance.InstanceContainer;
-import org.jboss.portal.core.model.instance.DuplicateInstanceException;
-import org.jboss.portal.core.portlet.management.InstanceManagerBean;
-import org.jboss.portal.core.portlet.management.PortletManagerBean;
+import org.jboss.portal.core.admin.ui.InstanceManagerBean;
+import org.jboss.portal.core.admin.ui.PortletManagerBean;
import org.jboss.portal.portlet.Portlet;
-import org.jboss.portal.portlet.PortletInvokerException;
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/ui/actions/PortalAction.java
===================================================================
---
trunk/core-admin/src/main/org/jboss/portal/core/portlet/management/actions/PortalAction.java 2007-02-28
23:35:26 UTC (rev 6476)
+++
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/actions/PortalAction.java 2007-03-01
00:56:12 UTC (rev 6477)
@@ -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.portlet.management.actions;
+package org.jboss.portal.core.admin.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.PortalObjectId;
-import org.jboss.portal.core.portlet.management.PortalObjectManagerBean;
+import org.jboss.portal.core.admin.ui.PortalObjectManagerBean;
import org.jboss.portal.security.RoleSecurityBinding;
import org.jboss.portal.security.SecurityConstants;
import org.jboss.portal.security.spi.provider.DomainConfigurator;
@@ -42,7 +42,6 @@
import javax.faces.validator.ValidatorException;
import java.util.Collections;
import java.util.HashSet;
-import java.util.Map;
import java.util.Set;
/**
Modified:
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/actions/PreferenceAction.java
===================================================================
---
trunk/core-admin/src/main/org/jboss/portal/core/portlet/management/actions/PreferenceAction.java 2007-02-28
23:35:26 UTC (rev 6476)
+++
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/actions/PreferenceAction.java 2007-03-01
00:56:12 UTC (rev 6477)
@@ -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.portlet.management.actions;
+package org.jboss.portal.core.admin.ui.actions;
import org.jboss.portal.common.value.StringValue;
import org.jboss.portal.common.value.Value;
import org.jboss.portal.core.model.instance.Instance;
-import org.jboss.portal.core.portlet.management.InstanceManagerBean;
+import org.jboss.portal.core.admin.ui.InstanceManagerBean;
import org.jboss.portal.faces.matrix.AbstractCellAction;
import org.jboss.portal.faces.matrix.Cell;
import org.jboss.portal.faces.matrix.Row;
Modified:
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/actions/PropertyAction.java
===================================================================
---
trunk/core-admin/src/main/org/jboss/portal/core/portlet/management/actions/PropertyAction.java 2007-02-28
23:35:26 UTC (rev 6476)
+++
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/actions/PropertyAction.java 2007-03-01
00:56:12 UTC (rev 6477)
@@ -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.portlet.management.actions;
+package org.jboss.portal.core.admin.ui.actions;
-import org.jboss.portal.core.portlet.management.PortalObjectManagerBean;
+import org.jboss.portal.core.admin.ui.PortalObjectManagerBean;
import javax.faces.application.FacesMessage;
import javax.faces.component.UIComponent;
Modified:
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/actions/ThemePropertyAction.java
===================================================================
---
trunk/core-admin/src/main/org/jboss/portal/core/portlet/management/actions/ThemePropertyAction.java 2007-02-28
23:35:26 UTC (rev 6476)
+++
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/actions/ThemePropertyAction.java 2007-03-01
00:56:12 UTC (rev 6477)
@@ -20,13 +20,13 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
* 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
******************************************************************************/
-package org.jboss.portal.core.portlet.management.actions;
+package org.jboss.portal.core.admin.ui.actions;
import javax.faces.application.FacesMessage;
import javax.faces.context.FacesContext;
import org.jboss.portal.core.model.portal.PortalObject;
-import org.jboss.portal.core.portlet.management.PortalObjectManagerBean;
+import org.jboss.portal.core.admin.ui.PortalObjectManagerBean;
import org.jboss.portal.theme.ThemeConstants;
/**
Modified:
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/actions/WindowComparator.java
===================================================================
---
trunk/core-admin/src/main/org/jboss/portal/core/portlet/management/actions/WindowComparator.java 2007-02-28
23:35:26 UTC (rev 6476)
+++
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/actions/WindowComparator.java 2007-03-01
00:56:12 UTC (rev 6477)
@@ -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.portlet.management.actions;
+package org.jboss.portal.core.admin.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/ui/content (from rev 6476,
trunk/core-admin/src/main/org/jboss/portal/core/portlet/management/content)
Modified:
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/content/AbstractContentEditor.java
===================================================================
---
trunk/core-admin/src/main/org/jboss/portal/core/portlet/management/content/AbstractContentEditor.java 2007-02-28
23:35:26 UTC (rev 6476)
+++
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/content/AbstractContentEditor.java 2007-03-01
00:56:12 UTC (rev 6477)
@@ -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.portlet.management.content;
+package org.jboss.portal.core.admin.ui.content;
import org.jboss.portal.jems.as.system.AbstractJBossService;
import org.jboss.portal.core.model.content.ContentType;
Modified:
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/content/AbstractFaceletContentEditor.java
===================================================================
---
trunk/core-admin/src/main/org/jboss/portal/core/portlet/management/content/AbstractFaceletContentEditor.java 2007-02-28
23:35:26 UTC (rev 6476)
+++
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/content/AbstractFaceletContentEditor.java 2007-03-01
00:56:12 UTC (rev 6477)
@@ -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.portlet.management.content;
+package org.jboss.portal.core.admin.ui.content;
import java.net.URL;
Modified:
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/content/ContentEditor.java
===================================================================
---
trunk/core-admin/src/main/org/jboss/portal/core/portlet/management/content/ContentEditor.java 2007-02-28
23:35:26 UTC (rev 6476)
+++
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/content/ContentEditor.java 2007-03-01
00:56:12 UTC (rev 6477)
@@ -20,10 +20,8 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
* 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
******************************************************************************/
-package org.jboss.portal.core.portlet.management.content;
+package org.jboss.portal.core.admin.ui.content;
-import java.net.URL;
-
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
* @version $Revision: 1.1 $
Modified:
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/content/ContentEditorRegistry.java
===================================================================
---
trunk/core-admin/src/main/org/jboss/portal/core/portlet/management/content/ContentEditorRegistry.java 2007-02-28
23:35:26 UTC (rev 6476)
+++
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/content/ContentEditorRegistry.java 2007-03-01
00:56:12 UTC (rev 6477)
@@ -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.portlet.management.content;
+package org.jboss.portal.core.admin.ui.content;
import org.jboss.portal.core.model.content.ContentType;
Modified:
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/content/ContentEditorRegistryBean.java
===================================================================
---
trunk/core-admin/src/main/org/jboss/portal/core/portlet/management/content/ContentEditorRegistryBean.java 2007-02-28
23:35:26 UTC (rev 6476)
+++
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/content/ContentEditorRegistryBean.java 2007-03-01
00:56:12 UTC (rev 6477)
@@ -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.portlet.management.content;
+package org.jboss.portal.core.admin.ui.content;
import org.jboss.portal.faces.el.dynamic.AbstractDynamicBean;
import org.jboss.portal.faces.el.PropertyValue;
Modified:
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/content/ContentEditorRegistryService.java
===================================================================
---
trunk/core-admin/src/main/org/jboss/portal/core/portlet/management/content/ContentEditorRegistryService.java 2007-02-28
23:35:26 UTC (rev 6476)
+++
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/content/ContentEditorRegistryService.java 2007-03-01
00:56:12 UTC (rev 6477)
@@ -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.portlet.management.content;
+package org.jboss.portal.core.admin.ui.content;
import org.jboss.portal.core.model.content.ContentType;
import org.jboss.portal.common.util.CopyOnWriteRegistry;
Modified:
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/content/ContentEditorTagHandler.java
===================================================================
---
trunk/core-admin/src/main/org/jboss/portal/core/portlet/management/content/ContentEditorTagHandler.java 2007-02-28
23:35:26 UTC (rev 6476)
+++
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/content/ContentEditorTagHandler.java 2007-03-01
00:56:12 UTC (rev 6477)
@@ -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.portlet.management.content;
+package org.jboss.portal.core.admin.ui.content;
import com.sun.facelets.tag.TagHandler;
import com.sun.facelets.tag.TagConfig;
Modified:
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/content/FaceletContentEditor.java
===================================================================
---
trunk/core-admin/src/main/org/jboss/portal/core/portlet/management/content/FaceletContentEditor.java 2007-02-28
23:35:26 UTC (rev 6476)
+++
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/content/FaceletContentEditor.java 2007-03-01
00:56:12 UTC (rev 6477)
@@ -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.portlet.management.content;
+package org.jboss.portal.core.admin.ui.content;
import java.net.URL;
Modified:
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/content/PortletContentEditor.java
===================================================================
---
trunk/core-admin/src/main/org/jboss/portal/core/portlet/management/content/PortletContentEditor.java 2007-02-28
23:35:26 UTC (rev 6476)
+++
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/content/PortletContentEditor.java 2007-03-01
00:56:12 UTC (rev 6477)
@@ -20,24 +20,13 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
* 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
******************************************************************************/
-package org.jboss.portal.core.portlet.management.content;
+package org.jboss.portal.core.admin.ui.content;
import org.jboss.portal.core.model.instance.InstanceContainer;
import org.jboss.portal.core.model.instance.InstanceDefinition;
import org.jboss.portal.core.model.instance.Instance;
-import org.jboss.portal.portlet.Portlet;
-import org.jboss.portal.portlet.info.PortletInfo;
-import org.jboss.portal.portlet.info.MetaInfo;
import javax.faces.model.SelectItem;
-import javax.faces.context.FacesContext;
-import javax.faces.application.Application;
-import javax.faces.el.VariableResolver;
-import javax.faces.el.PropertyResolver;
-import javax.faces.el.ValueBinding;
-import javax.el.ExpressionFactory;
-import javax.el.ELContext;
-import javax.el.ValueExpression;
import java.util.List;
import java.util.ArrayList;
import java.util.Collection;
@@ -45,8 +34,6 @@
import java.util.Map;
import java.util.HashMap;
-import com.sun.facelets.el.ELAdaptor;
-
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
* @version $Revision: 1.1 $
Deleted:
trunk/core-admin/src/main/org/jboss/portal/core/portlet/management/AbstractAuthorizationBean.java
===================================================================
---
trunk/core-admin/src/main/org/jboss/portal/core/portlet/management/AbstractAuthorizationBean.java 2007-02-28
23:35:26 UTC (rev 6476)
+++
trunk/core-admin/src/main/org/jboss/portal/core/portlet/management/AbstractAuthorizationBean.java 2007-03-01
00:56:12 UTC (rev 6477)
@@ -1,208 +0,0 @@
-/******************************************************************************
- * JBoss, a division of Red Hat *
- * Copyright 2006, Red Hat Middleware, LLC, and individual *
- * contributors as indicated by the @authors tag. See the *
- * copyright.txt in the distribution for a full listing of *
- * individual contributors. *
- * *
- * This is free software; you can redistribute it and/or modify it *
- * under the terms of the GNU Lesser General Public License as *
- * published by the Free Software Foundation; either version 2.1 of *
- * the License, or (at your option) any later version. *
- * *
- * This software is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
- * Lesser General Public License for more details. *
- * *
- * You should have received a copy of the GNU Lesser General Public *
- * License along with this software; if not, write to the Free *
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
- ******************************************************************************/
-package org.jboss.portal.core.portlet.management;
-
-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 AbstractAuthorizationBean
-{
-
- 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 execute();
-
- 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/portlet/management/ContentTypeConverter.java
===================================================================
---
trunk/core-admin/src/main/org/jboss/portal/core/portlet/management/ContentTypeConverter.java 2007-02-28
23:35:26 UTC (rev 6476)
+++
trunk/core-admin/src/main/org/jboss/portal/core/portlet/management/ContentTypeConverter.java 2007-03-01
00:56:12 UTC (rev 6477)
@@ -1,47 +0,0 @@
-/******************************************************************************
- * JBoss, a division of Red Hat *
- * Copyright 2006, Red Hat Middleware, LLC, and individual *
- * contributors as indicated by the @authors tag. See the *
- * copyright.txt in the distribution for a full listing of *
- * individual contributors. *
- * *
- * This is free software; you can redistribute it and/or modify it *
- * under the terms of the GNU Lesser General Public License as *
- * published by the Free Software Foundation; either version 2.1 of *
- * the License, or (at your option) any later version. *
- * *
- * This software is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
- * Lesser General Public License for more details. *
- * *
- * You should have received a copy of the GNU Lesser General Public *
- * License along with this software; if not, write to the Free *
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
- ******************************************************************************/
-package org.jboss.portal.core.portlet.management;
-
-import org.jboss.portal.core.model.content.ContentType;
-
-import javax.faces.convert.Converter;
-import javax.faces.convert.ConverterException;
-import javax.faces.context.FacesContext;
-import javax.faces.component.UIComponent;
-
-/**
- * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 1.1 $
- */
-public class ContentTypeConverter implements Converter
-{
- public Object getAsObject(FacesContext facesContext, UIComponent uiComponent, String
string) throws ConverterException
- {
- return string == null ? null : ContentType.create(string);
- }
-
- public String getAsString(FacesContext facesContext, UIComponent uiComponent, Object
object) throws ConverterException
- {
- return object == null ? null : object.toString();
- }
-}
Deleted:
trunk/core-admin/src/main/org/jboss/portal/core/portlet/management/InstanceManagerBean.java
===================================================================
---
trunk/core-admin/src/main/org/jboss/portal/core/portlet/management/InstanceManagerBean.java 2007-02-28
23:35:26 UTC (rev 6476)
+++
trunk/core-admin/src/main/org/jboss/portal/core/portlet/management/InstanceManagerBean.java 2007-03-01
00:56:12 UTC (rev 6477)
@@ -1,469 +0,0 @@
-/******************************************************************************
- * JBoss, a division of Red Hat *
- * Copyright 2006, Red Hat Middleware, LLC, and individual *
- * contributors as indicated by the @authors tag. See the *
- * copyright.txt in the distribution for a full listing of *
- * individual contributors. *
- * *
- * This is free software; you can redistribute it and/or modify it *
- * under the terms of the GNU Lesser General Public License as *
- * published by the Free Software Foundation; either version 2.1 of *
- * the License, or (at your option) any later version. *
- * *
- * This software is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
- * Lesser General Public License for more details. *
- * *
- * You should have received a copy of the GNU Lesser General Public *
- * License along with this software; if not, write to the Free *
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
- ******************************************************************************/
-package org.jboss.portal.core.portlet.management;
-
-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.Locale;
-import java.util.Map;
-
-import javax.faces.context.ExternalContext;
-import javax.faces.context.FacesContext;
-import javax.faces.model.SelectItem;
-import javax.faces.application.FacesMessage;
-
-import org.jboss.logging.Logger;
-import org.jboss.portal.common.util.LocalizedString;
-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.NoSuchInstanceException;
-import org.jboss.portal.core.model.instance.InstanceDefinition;
-import org.jboss.portal.faces.matrix.Cell;
-import org.jboss.portal.faces.matrix.Row;
-import org.jboss.portal.faces.matrix.RowSetModel;
-import org.jboss.portal.faces.el.DelegatingPropertyResolver;
-import org.jboss.portal.faces.el.decorator.SimpleBeanDecorator;
-import org.jboss.portal.faces.el.decorator.AbstractPropertyDecorator;
-import org.jboss.portal.identity.RoleModule;
-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.PreferencesInfo;
-import org.jboss.portal.portlet.state.PropertyMap;
-import org.jboss.portal.security.AuthorizationDomainRegistry;
-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 Logger log = Logger.getLogger(getClass());
-
- /** . */
- private InstanceContainer instanceContainer;
-
- /** . */
- private AuthorizationDomainRegistry authorizationDomainRegistry;
-
- /** . */
- private RoleModule roleModule;
-
- /** . */
- private String selectedId;
-
- /** . */
- private String selectedPlugin;
-
- /** . */
- private int selectedFrom;
-
- /** . */
- private PreferencesBean selectedPreferences;
-
- /** . */
- private Integer selectedRow;
-
- /** . */
- private AbstractAuthorizationBean auth = new AuthorizationBean();
-
- /** . */
- private final int paginationSize = 10;
-
- public int getPaginationSize()
- {
- return 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 InstanceContainer getInstanceContainer()
- {
- return instanceContainer;
- }
-
- public void setInstanceContainer(InstanceContainer instanceContainer)
- {
- this.instanceContainer = instanceContainer;
- }
-
- public String getSelectedId()
- {
- return selectedId;
- }
-
- public void setSelectedId(String selectedId)
- {
- this.selectedId = selectedId;
- }
-
- 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 DomainConfigurator getDomainConfigurator()
- {
- return
authorizationDomainRegistry.getDomain("instance").getConfigurator();
- }
-
- public Instance getSelectedInstance()
- {
- if (selectedId != null)
- {
- return instanceContainer.getDefinition(selectedId);
- }
- else
- {
- return null;
- }
- }
-
- public PreferencesBean getSelectedPreferences()
- {
- return selectedPreferences;
- }
-
- public String getSelectedPlugin()
- {
- return selectedPlugin;
- }
-
- public void setSelectedPlugin(String selectedPlugin)
- {
- this.selectedPlugin = selectedPlugin;
- }
-
- public AbstractAuthorizationBean getAuth()
- {
- return auth;
- }
-
- /** Return an array of all instances known in this container. */
- public Collection getInstances()
- {
- List instances = new ArrayList(instanceContainer.getDefinitions());
-
-// try
-// {
-// sortInstances(instances, sortColumn, sortAscending);
-// }
-// catch (Exception e)
-// {
-// log.warn("Error during sorting instances list");
-// }
-
- //
- int to = Math.min(selectedFrom + 10, instances.size());
-
- //
- return instances.subList(selectedFrom, to);
- }
-
- public int getInstanceCount()
- {
- return instanceContainer.getDefinitions().size();
- }
-
- 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");
- selectedPreferences = null;
- }
-
- public void deleteInstance()
- {
- try
- {
- FacesContext ctx = FacesContext.getCurrentInstance();
- ExternalContext ectx = ctx.getExternalContext();
- Map params = ectx.getRequestParameterMap();
- String id = (String)params.get("id");
-
- //
- instanceContainer.destroyDefinition(id);
-
- //
- selectedId = null;
- selectedPreferences = null;
- selectedFrom = 0;
- }
- catch (NoSuchInstanceException e)
- {
- e.printStackTrace();
- }
- catch (PortletInvokerException e)
- {
- e.printStackTrace();
- }
- }
-
- /** Refresh the selected prefs. */
- public void refresh()
- {
- selectedPreferences = null;
-
- //
- if ("preferences".equals(selectedPlugin))
- {
- Instance selectedInstance = getSelectedInstance();
-
- //
- if (selectedInstance != null)
- {
- try
- {
- PreferencesInfo prefsInfo =
selectedInstance.getPortlet().getInfo().getPreferences();
- if (prefsInfo != null)
- {
- RowSetModel model = new RowSetModel(null, prefsInfo.getKeys().size());
- PropertyMap prefs = getSelectedInstance().getProperties();
-
- //
- int index = 0;
- for (Iterator i = prefsInfo.getKeys().iterator(); i.hasNext();
index++)
- {
- String key = (String)i.next();
-
- // Get info for this key
- // PreferenceInfo info = prefsInfo.getPreference(key);
- // boolean readOnly = info.isReadOnly();
- boolean readOnly = false;
- // Value value = info.getValue();
-
- // Get value from the state
- Value value = prefs.getProperty(key);
-
- //
- Row row = model.getRow(index);
- row.setReadOnly(readOnly);
-
- //
- Cell cell = row.getCell();
- cell.setHandback("" + i);
- cell.setValue(value.asStringArray());
-
- //
- row.setHandback(key);
- row.setKey(key);
- row.setName("Description");
- row.setReadOnly(false);
- row.setValue(value.asStringArray());
- }
-
- //
- selectedPreferences = new PreferencesBean(model);
-
- //
- if (selectedRow != null)
- {
- selectedPreferences.selectRow(selectedRow);
- }
- }
- }
- catch (PortletInvokerException e)
- {
- log.warn("Couldn't access portlet invoker associated to instance
" + selectedInstance.getId()
- + ". This instance won't be refreshed.\nReason:\n\t" +
e.getLocalizedMessage());
- }
- }
- }
- }
-
-// public static void sortInstances(List instances, final String column, final boolean
ascending)
-// {
-// Comparator comparator = new Comparator()
-// {
-// public int compare(Object o1, Object o2)
-// {
-// if (column == null)
-// {
-// return 0;
-// }
-// if (column.equals("id"))
-// {
-// Instance i1 = (Instance)((Object[])o1)[0];
-// Instance i2 = (Instance)((Object[])o2)[0];
-// return ascending ? i1.getId().compareToIgnoreCase(i2.getId()) :
i2.getId()
-// .compareToIgnoreCase(i1.getId());
-// }
-// if (column.equals("portlet"))
-// {
-// Portlet p1 = (Portlet)((Object[])o1)[1];
-// Portlet p2 = (Portlet)((Object[])o2)[1];
-//
-// LocalizedString displayName =
p1.getInfo().getMeta().getMetaValue(MetaInfo.DISPLAY_NAME);
-// FacesContext ctx = FacesContext.getCurrentInstance();
-// Locale locale = ctx.getExternalContext().getRequestLocale();
-// String name1 = displayName.getString(locale, true);
-// displayName =
p2.getInfo().getMeta().getMetaValue(MetaInfo.DISPLAY_NAME);
-// String name2 = displayName.getString(locale, true);
-//
-// if (name1 == null || name2 == null)
-// {
-// return 0;
-// }
-//
-// return ascending ? name1.compareToIgnoreCase(name2) : name2
-// .compareToIgnoreCase(name1);
-// }
-//
-// else
-// {
-// return 0;
-// }
-// }
-// };
-// Collections.sort(instances, comparator);
-// }
-
- public class AuthorizationBean extends AbstractAuthorizationBean
- {
-
- public DomainConfigurator getDomainConfigurator()
- {
- return InstanceManagerBean.this.getDomainConfigurator();
- }
-
- protected String getURI()
- {
- Instance instance = getSelectedInstance();
- if (instance != null)
- {
- return instance.getId();
- }
- else
- {
- return null;
- }
- }
-
- public String execute()
- {
- 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 RoleModule getRoleModule()
- {
- return roleModule;
- }
-
- public SelectItem[] getAvailableActions()
- {
- return new SelectItem[]{
- new SelectItem("view")
- };
- }
- }
-
- static
- {
- SimpleBeanDecorator instanceDecorator = new SimpleBeanDecorator();
-
- // If the portlet is not available we want to avoid the stack trace and rather
return null
- instanceDecorator.setProperty("portlet", new
AbstractPropertyDecorator(Portlet.class)
- {
- public Object getValue(Object bean)
- {
- Instance instance = (Instance)bean;
- try
- {
- return instance.getPortlet();
- }
- catch (PortletInvokerException e)
- {
- return null;
- }
- }
- });
-
- //
- DelegatingPropertyResolver.registerDecorator(InstanceDefinition.class,
instanceDecorator);
- }
-
-}
Deleted:
trunk/core-admin/src/main/org/jboss/portal/core/portlet/management/PortalObjectBean.java
===================================================================
---
trunk/core-admin/src/main/org/jboss/portal/core/portlet/management/PortalObjectBean.java 2007-02-28
23:35:26 UTC (rev 6476)
+++
trunk/core-admin/src/main/org/jboss/portal/core/portlet/management/PortalObjectBean.java 2007-03-01
00:56:12 UTC (rev 6477)
@@ -1,77 +0,0 @@
-/******************************************************************************
- * JBoss, a division of Red Hat *
- * Copyright 2006, Red Hat Middleware, LLC, and individual *
- * contributors as indicated by the @authors tag. See the *
- * copyright.txt in the distribution for a full listing of *
- * individual contributors. *
- * *
- * This is free software; you can redistribute it and/or modify it *
- * under the terms of the GNU Lesser General Public License as *
- * published by the Free Software Foundation; either version 2.1 of *
- * the License, or (at your option) any later version. *
- * *
- * This software is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
- * Lesser General Public License for more details. *
- * *
- * You should have received a copy of the GNU Lesser General Public *
- * License along with this software; if not, write to the Free *
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
- ******************************************************************************/
-package org.jboss.portal.core.portlet.management;
-
-import org.jboss.portal.core.model.portal.PortalObject;
-import org.jboss.portal.core.model.portal.PortalObjectId;
-
-/**
- * @author <a href="mailto:theute@jboss.org">Thomas Heute</a>
- * @version $Revision$
- */
-public class PortalObjectBean
-{
- private PortalObject po;
- private PortalObjectBean parent;
-
-
- public PortalObjectBean(PortalObject po)
- {
- this.po = po;
- }
-
- public String getId()
- {
- return po.getId().toString(PortalObjectId.LEGACY_BASE64_FORMAT);
- }
-
-// public void setId(String id)
-// {
-// // Do nothing
-// }
-
- public String getName()
- {
- return po.getName();
- }
-
- public PortalObjectBean getParent()
- {
- if ((parent == null) || (po.getParent() != parent.getPortalObject()))
- {
- parent = new PortalObjectBean(po.getParent());
- }
- return parent;
- }
-
- public int getType()
- {
- return po.getType();
- }
-
- public PortalObject getPortalObject()
- {
- return po;
- }
-
-}
Deleted:
trunk/core-admin/src/main/org/jboss/portal/core/portlet/management/PortalObjectManagerBean.java
===================================================================
---
trunk/core-admin/src/main/org/jboss/portal/core/portlet/management/PortalObjectManagerBean.java 2007-02-28
23:35:26 UTC (rev 6476)
+++
trunk/core-admin/src/main/org/jboss/portal/core/portlet/management/PortalObjectManagerBean.java 2007-03-01
00:56:12 UTC (rev 6477)
@@ -1,970 +0,0 @@
-/******************************************************************************
- * JBoss, a division of Red Hat *
- * Copyright 2006, Red Hat Middleware, LLC, and individual *
- * contributors as indicated by the @authors tag. See the *
- * copyright.txt in the distribution for a full listing of *
- * individual contributors. *
- * *
- * This is free software; you can redistribute it and/or modify it *
- * under the terms of the GNU Lesser General Public License as *
- * published by the Free Software Foundation; either version 2.1 of *
- * the License, or (at your option) any later version. *
- * *
- * This software is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
- * Lesser General Public License for more details. *
- * *
- * You should have received a copy of the GNU Lesser General Public *
- * License along with this software; if not, write to the Free *
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
- ******************************************************************************/
-package org.jboss.portal.core.portlet.management;
-
-import java.io.Serializable;
-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.LinkedHashMap;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Locale;
-import java.util.Map;
-import java.util.Set;
-import java.util.SortedSet;
-import java.util.TreeSet;
-
-import javax.faces.application.FacesMessage;
-import javax.faces.context.FacesContext;
-import javax.faces.event.ActionEvent;
-import javax.faces.model.SelectItem;
-
-import org.jboss.logging.Logger;
-import org.jboss.portal.api.node.PortalNode;
-import org.jboss.portal.common.MediaType;
-import org.jboss.portal.common.util.LocalizedString;
-import org.jboss.portal.core.aspects.controller.node.Navigation;
-import org.jboss.portal.core.impl.model.portal.PortalObjectImpl;
-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.Window;
-import org.jboss.portal.core.model.content.ContentType;
-import org.jboss.portal.core.portlet.management.actions.WindowComparator;
-import org.jboss.portal.faces.el.DelegatingPropertyResolver;
-import org.jboss.portal.faces.el.decorator.SimpleBeanDecorator;
-import org.jboss.portal.faces.el.decorator.AbstractPropertyDecorator;
-import org.jboss.portal.identity.IdentityException;
-import org.jboss.portal.identity.RoleModule;
-import org.jboss.portal.portlet.Portlet;
-import org.jboss.portal.portlet.info.MetaInfo;
-import org.jboss.portal.portlet.info.PortletInfo;
-import org.jboss.portal.security.AuthorizationDomainRegistry;
-import org.jboss.portal.security.spi.auth.PortalAuthorizationManagerFactory;
-import org.jboss.portal.security.spi.provider.DomainConfigurator;
-import org.jboss.portal.theme.LayoutService;
-import org.jboss.portal.theme.PortalLayout;
-import org.jboss.portal.theme.PortalTheme;
-import org.jboss.portal.theme.ServerRegistrationID;
-import org.jboss.portal.theme.ThemeConstants;
-import org.jboss.portal.theme.ThemeService;
-import org.jboss.portal.theme.render.PortalRenderSet;
-import org.jboss.portal.theme.strategy.LayoutStrategy;
-import org.jboss.portlet.JBossRenderResponse;
-
-/** The portal object manager bean. */
-public class PortalObjectManagerBean implements Serializable
-{
-
- /** The serialVersionUID */
- private static final long serialVersionUID = -8923517554726982622L;
-
- static
- {
- 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;
- }
- }
- });
-
- //
- 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);
- }
- });
-
- //
- 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());
- }
- });
-
- //
- DelegatingPropertyResolver.registerDecorator(LocalizedString.class,
localizedStringDecorator);
- DelegatingPropertyResolver.registerDecorator(RoleModule.class,
roleModuleDecorator);
- DelegatingPropertyResolver.registerDecorator(Portlet.class, portletDecorator);
- }
-
- /** . */
- private Logger log = Logger.getLogger(getClass());
-
- /** The selected id. */
- private String selectedId;
-
- /** The current tab name. */
- private String selectedPlugin;
-
- /** . */
- private RoleModule roleModule;
-
- /** . */
- private PortalObjectContainer portalObjectContainer;
-
- /** . */
- private InstanceContainer instanceContainer;
-
- /** . */
- private LayoutService layoutService;
-
- /** . */
- private ThemeService themeService;
-
- /** . */
- private AuthorizationDomainRegistry authorizationDomainRegistry;
-
- /** . */
- private PortalAuthorizationManagerFactory portalAuthorizationManagerFactory;
-
- /** . */
- private AbstractAuthorizationBean auth = new PortalObjectAuthorizationBean();
-
- /** . */
- private ThemeBean themes = new ThemeBean();
-
- /** The selected type for content. */
- private ContentType selectedContentType = ContentType.PORTLET;
-
- /** The uri value for content. */
- private String selectedContentURI;
-
- 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 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;
- }
-
- 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 AuthorizationDomainRegistry getAuthorizationDomainRegistry()
- {
- return authorizationDomainRegistry;
- }
-
- public void setAuthorizationDomainRegistry(AuthorizationDomainRegistry
authorizationDomainRegistry)
- {
- this.authorizationDomainRegistry = authorizationDomainRegistry;
- }
-
- public AbstractAuthorizationBean getAuth()
- {
- return auth;
- }
-
- public ThemeBean getThemes()
- {
- return themes;
- }
-
- // ****************************
-
- public DomainConfigurator getDomainConfigurator()
- {
- return
authorizationDomainRegistry.getDomain("portalobject").getConfigurator();
- }
-
- public PortalObject getObjectFromId(String id)
- {
- PortalObjectId objectId = PortalObjectId.parse(id,
PortalObjectId.LEGACY_BASE64_FORMAT);
- return getObjectFromId(objectId);
- }
-
- public PortalObject getObjectFromId(PortalObjectId id)
- {
- return portalObjectContainer.getObject(id);
- }
-
- public List getSelectedObjectPath()
- {
- PortalObject o = getSelectedObject();
- ArrayList path = new ArrayList();
- while (o != null)
- {
- path.add(new PortalObjectBean(o));
- o = o.getParent();
- }
- Collections.reverse(path);
- return path;
- }
-
- public PortalObject getSelectedObject()
- {
- PortalObject result;
- if (selectedId != null)
- {
- result = getObjectFromId(selectedId);
- }
- else
- {
- result = portalObjectContainer.getRootObject();
- }
- return result;
- }
-
- public PortalObjectBean getSelectedObjectBean()
- {
- return new PortalObjectBean(getSelectedObject());
- }
-
- public void setSelectedObject(PortalObject po)
- {
- selectedId = po.getId().toString(PortalObjectId.LEGACY_BASE64_FORMAT);
- }
-
- public List getSelectedProperties()
- {
- //return selectedProperties;
- PortalObject object = getSelectedObject();
- List properties = new ArrayList();
- for (Iterator i = object.getDeclaredProperties().entrySet().iterator();
i.hasNext();)
- {
- Map.Entry entry = (Map.Entry)i.next();
- properties.add(new String[]{(String)entry.getKey(), (String)entry.getValue()});
- }
- return properties;
- }
-
- public String getSelectedPlugin()
- {
- return selectedPlugin;
- }
-
- public void selectPlugin()
- {
- // Get id
- Map pmap =
FacesContext.getCurrentInstance().getExternalContext().getRequestParameterMap();
- selectedPlugin = (String)pmap.get("plugin");
- }
-
- public void selectParentObject(ActionEvent ae)
- {
- selectParentObject();
- }
-
- public void selectParentObject()
- {
- setSelectedObject(getSelectedObject().getParent());
- }
-
- public void selectRootObject(ActionEvent ae)
- {
- setSelectedObject(portalObjectContainer.getRootObject());
- }
-
- public void udpateContentType()
- {
- // Do nothing
- }
-
- public void selectObject(ActionEvent ae)
- {
- selectObject();
- }
-
- /** Proceed to an object selection. */
- public String selectObject()
- {
- // Clear state
- selectedId = new PortalObjectId().toString(PortalObjectId.LEGACY_BASE64_FORMAT);
- selectedPlugin = null;
- selectedContentType = ContentType.PORTLET;
- selectedContentURI = null;
-
- //
- String next = "portals";
-
- try
- {
-
- // Get id
- Map pmap =
FacesContext.getCurrentInstance().getExternalContext().getRequestParameterMap();
- String id = (String)pmap.get("id");
-
- // Set the state from the id
- if (id != null)
- {
- PortalObjectId poid = PortalObjectId.parse(id,
PortalObjectId.LEGACY_BASE64_FORMAT);
- PortalObject object = portalObjectContainer.getObject(poid);
-
- // Update state if possible
- if (object != null)
- {
- selectedId = id;
- selectedPlugin = "manager";
- switch(object.getType())
- {
- case PortalObject.TYPE_CONTEXT:
- next = "portals";
- break;
- case PortalObject.TYPE_PORTAL:
- next = "pages";
- break;
- case PortalObject.TYPE_PAGE:
- next = "pages";
- break;
- case PortalObject.TYPE_WINDOW:
- next = "windows";
- break;
- }
- }
- }
- }
- catch (Exception e)
- {
- e.printStackTrace();
- }
-
- //
- return next;
- }
-
- /** Proceed to object destroy. */
- public void destroyObject(ActionEvent ae)
- {
- try
- {
- // Clear state
- selectedId = null;
- selectedPlugin = null;
-
- // Get id
- Map pmap =
FacesContext.getCurrentInstance().getExternalContext().getRequestParameterMap();
- String id = (String)pmap.get("id");
-
- // Destroy the object
- if (id != null)
- {
- PortalObjectId poid = PortalObjectId.parse(id,
PortalObjectId.LEGACY_BASE64_FORMAT);
- PortalObject object = portalObjectContainer.getObject(poid);
-
- setSelectedObject(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();
- }
- }
-
- private List getNodes(int mask)
- {
- Collection test = getSelectedObject().getChildren(mask);
- // TODO: don't recreate the objects each time !
- // TODO: Use a datamodel
- ArrayList result = new ArrayList();
- Iterator it = test.iterator();
- while (it.hasNext())
- {
- PortalObject po = (PortalObject)it.next();
- result.add(new PortalObjectBean(po));
- }
- return result;
- }
-
- public List getPortalNodes()
- {
- return getNodes(PortalObject.PORTAL_MASK);
- }
-
- public List getPageNodes()
- {
- return getNodes(PortalObject.PAGE_MASK);
- }
-
- public List getWindowNodes()
- {
- return getNodes(PortalObject.WINDOW_MASK);
- }
-
- public SelectItem[] getInstanceItems()
- {
- Collection instances = instanceContainer.getDefinitions();
-
- //sort instances by id
- List sortedInstances = new LinkedList();
- for (Iterator i = instances.iterator(); i.hasNext();)
- {
- Instance instance = (Instance)i.next();
- sortedInstances.add(instance);
- }
- try
- {
- sortInstances(sortedInstances, "id", true);
- }
- catch (Exception e)
- {
- log.warn("Error while sorting instances list");
- }
-
- ArrayList list = new ArrayList(instances.size());
- for (Iterator i = sortedInstances.iterator(); i.hasNext();)
- {
- Instance instance = (Instance)i.next();
- SelectItem item = new SelectItem(instance.getId());
- list.add(item);
- }
- return (SelectItem[])list.toArray(new SelectItem[list.size()]);
- }
-
- public SelectItem[] getPortalPageItems()
- {
- Collection pages = getSelectedObject().getChildren();
-
- ArrayList list = new ArrayList(pages.size() + 1);
- for (Iterator iterator = pages.iterator(); iterator.hasNext();)
- {
- PortalObject o = (PortalObject)iterator.next();
- if (o.getType() == PortalObject.TYPE_PAGE)
- {
- SelectItem item = new SelectItem(o.getName());
- list.add(item);
- }
-
- }
- list.add(new SelectItem("", "no selection"));
-
- return (SelectItem[])list.toArray(new SelectItem[list.size()]);
- }
-
-
- public static void sortInstances(List instances, final String column, final boolean
ascending)
- {
- Comparator comparator = new Comparator()
- {
- public int compare(Object o1, Object o2)
- {
- Instance i1 = (Instance)o1;
- Instance i2 = (Instance)o2;
-
- if (column == null)
- {
- return 0;
- }
- if (column.equals("id"))
- {
- return ascending ? i1.getId().compareToIgnoreCase(i2.getId()) :
i2.getId()
- .compareToIgnoreCase(i1.getId());
- }
- else
- {
- return 0;
- }
- }
- };
- Collections.sort(instances, comparator);
- }
-
- /** Returns a <Region,<Window>SortedSet>Map. */
- private Map getWindows(Page page) throws Exception
- {
- // Get the layout
- String layoutId = page.getProperty(ThemeConstants.PORTAL_PROP_LAYOUT);
- PortalLayout layout = layoutService.getLayout(layoutId, false);
-
- //
- LinkedHashMap windows = new LinkedHashMap();
- for (Iterator i = layout.getLayoutInfo().getRegionNames().iterator();
i.hasNext();)
- {
- String region = (String)i.next();
- windows.put(region, new TreeSet(new WindowComparator()));
- }
- windows.put("unknown", new TreeSet(new WindowComparator()));
-
- //
- for (Iterator j = getSelectedObject().getChildren().iterator(); j.hasNext();)
- {
- PortalObject object = (PortalObject)j.next();
- if (object.getType() == PortalObject.TYPE_WINDOW)
- {
- String region = object.getProperty(ThemeConstants.PORTAL_PROP_REGION);
- if (!windows.containsKey(region))
- {
- region = "unknown";
- }
- SortedSet set = (SortedSet)windows.get(region);
- set.add(object);
- }
- }
- return windows;
- }
-
- /** Return the <Region>List on the selected object which must be a page. */
- public List getRegionNames()
- {
- try
- {
- Map windows = getWindows((Page)getSelectedObject());
-
- //
- List regions = new ArrayList(windows.keySet());
- Collections.sort(regions);
-
- //
- return regions;
- }
- catch (Exception e)
- {
- e.printStackTrace();
-
- //
- return Collections.EMPTY_LIST;
- }
- }
-
- public Map getWindowItemsMap() throws Exception
- {
- Map windowMap = getWindows((Page)getSelectedObject());
- for (Iterator i = windowMap.entrySet().iterator();i.hasNext();)
- {
- Map.Entry entry = (Map.Entry)i.next();
- SortedSet windows = (SortedSet)entry.getValue();
- ArrayList windowItems = new ArrayList(windows.size());
- for (Iterator j = windows.iterator();j.hasNext();)
- {
- Window window = (Window)j.next();
- SelectItem windowItem = new SelectItem();
- windowItem.setValue(window.getName());
- windowItem.setLabel(window.getName());
- windowItems.add(windowItem);
- }
- entry.setValue(windowItems);
- }
- return windowMap;
- }
-
- // ****************************
-
- public class PortalObjectAuthorizationBean extends AbstractAuthorizationBean
- {
-
- public DomainConfigurator getDomainConfigurator()
- {
- return PortalObjectManagerBean.this.getDomainConfigurator();
- }
-
- protected String getURI()
- {
- PortalObject po = getSelectedObject();
- if (po != null)
- {
- return po.getId().toString(PortalObjectId.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"),
- new SelectItem("dashboard", "Dashboard"),
- };
- }
-
- public String execute()
- {
- String stringMessage = "Security has been correctly updated on the
page";
- FacesMessage message = new FacesMessage(FacesMessage.SEVERITY_INFO,
stringMessage, stringMessage);
- FacesContext.getCurrentInstance().addMessage("status", message);
-
- //
- PortalObject po = getSelectedObject();
- setSelectedObject(po.getParent());
-
- //
- if (po.getType() == PortalObject.TYPE_PORTAL)
- {
- return "portals";
- }
- else if (po.getType() == PortalObject.TYPE_PAGE)
- {
- return "pages";
- }
- else if (po.getType() == PortalObject.TYPE_WINDOW)
- {
- return "windows";
- }
- return null;
- }
-
- public RoleModule getRoleModule()
- {
- return roleModule;
- }
- }
-
- public final class ThemeBean
- {
- public String getLayoutName()
- {
- return getDeclaredProperty(ThemeConstants.PORTAL_PROP_LAYOUT);
- }
-
- public String getThemeName()
- {
- return getDeclaredProperty(ThemeConstants.PORTAL_PROP_THEME);
- }
-
- public String getRenderSetName()
- {
- return getDeclaredProperty(ThemeConstants.PORTAL_PROP_RENDERSET);
- }
-
- public String getStrategyName()
- {
- return getDeclaredProperty(ThemeConstants.PORTAL_PROP_STRATEGY);
- }
-
- public String getWindowRenderer()
- {
- return getDeclaredProperty(ThemeConstants.PORTAL_PROP_WINDOW_RENDERER);
- }
-
- public String getDecorationRenderer()
- {
- return getDeclaredProperty(ThemeConstants.PORTAL_PROP_DECORATION_RENDERER);
- }
-
- public String getPortletRenderer()
- {
- return getDeclaredProperty(ThemeConstants.PORTAL_PROP_PORTLET_RENDERER);
- }
-
- /**
- * Get the list of available layouts
- *
- * @return an array of the available layout names to pick a layout from
- */
- public SelectItem[] getLayoutNames()
- {
- Collection layouts = layoutService.getLayouts();
- SelectItem[] names = new SelectItem[layouts.size() + 1];
- int p = 0;
- for (Iterator i = layouts.iterator(); i.hasNext();)
- {
- PortalLayout layout = (PortalLayout)i.next();
- names[p++] = new SelectItem(layout.getLayoutInfo().getName(),
layout.getLayoutInfo().getName());
- }
- names[p] = new SelectItem("", "default");
- return names;
- }
-
- /**
- * Get the list of available themes
- *
- * @return an array of the available theme names to pick a theme from
- */
- public SelectItem[] getThemeNames()
- {
- Collection themes = themeService.getThemes();
- SelectItem[] themeNames = new SelectItem[themes.size() + 1];
-
- int p = 0;
- for (Iterator i = themes.iterator(); i.hasNext();)
- {
- PortalTheme theme = (PortalTheme)i.next();
- themeNames[p++] = new SelectItem(theme.getThemeInfo().getName(),
theme.getThemeInfo().getName());
- }
- themeNames[p] = new SelectItem("", "default");
-
- return themeNames;
- }
-
- /**
- * Get a list of available render sets
- *
- * @return and array of all available render set names to pick a render set from
- */
- public SelectItem[] getRenderSetNames()
- {
- 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[] renderSetNames = new SelectItem[names.size() + 1];
- int i = 0;
- for (Iterator it = names.keySet().iterator(); it.hasNext();)
- {
- String key = (String)it.next();
- renderSetNames[i++] = new SelectItem(key, (String)names.get(key));
- }
- renderSetNames[i] = new SelectItem("", "default");
- return renderSetNames;
- }
-
- public SelectItem[] getStrategyNames()
- {
- Collection strategies = layoutService.getStrategies();
- Map names = new HashMap();
- for (Iterator i = strategies.iterator(); i.hasNext();)
- {
- ServerRegistrationID id = (ServerRegistrationID)i.next();
- LayoutStrategy strategy = layoutService.getStrategy(id, MediaType.HTML);
- if (strategy != null)
- {
- names.put(strategy.getName(), strategy.getName());
- }
- }
- SelectItem[] strategyNames = new SelectItem[names.size() + 1];
-
- int i = 0;
- for (Iterator it = names.keySet().iterator(); it.hasNext();)
- {
- String key = (String)it.next();
- strategyNames[i++] = new SelectItem(key, (String)names.get(key));
- }
- strategyNames[i] = new SelectItem("", "Default");
- return strategyNames;
- }
-
- private String getDeclaredProperty(String key)
- {
- String value = null;
- PortalObject po = getSelectedObject();
- if (po != null)
- {
- value = po.getDeclaredProperty(key);
- }
-
- return value;
- }
- }
-
- public PortalAuthorizationManagerFactory getPortalAuthorizationManagerFactory()
- {
- return portalAuthorizationManagerFactory;
- }
-
- public void setPortalAuthorizationManagerFactory(PortalAuthorizationManagerFactory
portalAuthorizationManagerFactory)
- {
- this.portalAuthorizationManagerFactory = portalAuthorizationManagerFactory;
- }
-
- 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";
- }
-}
Deleted:
trunk/core-admin/src/main/org/jboss/portal/core/portlet/management/PortletManagerBean.java
===================================================================
---
trunk/core-admin/src/main/org/jboss/portal/core/portlet/management/PortletManagerBean.java 2007-02-28
23:35:26 UTC (rev 6476)
+++
trunk/core-admin/src/main/org/jboss/portal/core/portlet/management/PortletManagerBean.java 2007-03-01
00:56:12 UTC (rev 6477)
@@ -1,428 +0,0 @@
-/******************************************************************************
- * JBoss, a division of Red Hat *
- * Copyright 2006, Red Hat Middleware, LLC, and individual *
- * contributors as indicated by the @authors tag. See the *
- * copyright.txt in the distribution for a full listing of *
- * individual contributors. *
- * *
- * This is free software; you can redistribute it and/or modify it *
- * under the terms of the GNU Lesser General Public License as *
- * published by the Free Software Foundation; either version 2.1 of *
- * the License, or (at your option) any later version. *
- * *
- * This software is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
- * Lesser General Public License for more details. *
- * *
- * You should have received a copy of the GNU Lesser General Public *
- * License along with this software; if not, write to the Free *
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
- ******************************************************************************/
-package org.jboss.portal.core.portlet.management;
-
-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.Locale;
-import java.util.Map;
-
-import javax.faces.context.FacesContext;
-import javax.faces.model.SelectItem;
-
-import org.jboss.logging.Logger;
-import org.jboss.portal.common.util.LocalizedString;
-import org.jboss.portal.common.value.Value;
-import org.jboss.portal.common.value.StringValue;
-import org.jboss.portal.core.model.instance.InstanceContainer;
-import org.jboss.portal.faces.matrix.Cell;
-import org.jboss.portal.faces.matrix.Row;
-import org.jboss.portal.faces.matrix.RowSetModel;
-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.MetaInfo;
-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;
-
-/**
- * @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 Logger log = Logger.getLogger(getClass());
-
- /** . */
- private InstanceContainer instanceContainer;
-
- /** . */
- private AuthorizationDomainRegistry authorizationDomainRegistry;
-
- /** . */
- private String selectedPortletId;
-
- /** The current tab name. */
- private String selectedPlugin;
-
- /** . */
- private RoleModule roleModule;
-
- /** . */
- private PreferencesBean selectedPreferences;
-
- /** . */
- private String selectedFederatedId;
-
- /** . */
- private AbstractAuthorizationBean auth = new AuthorizationBean();
-
- /** . */
- private FederatingPortletInvoker federatingPortletInvoker;
-
- /** . */
- private int selectedFrom;
-
- /** . */
- private final int paginationSize = 10;
-
- public int getPaginationSize()
- {
- return paginationSize;
- }
-
- public int getSelectedFrom()
- {
- return selectedFrom;
- }
-
- public void setSelectedFrom(int selectedFrom)
- {
- this.selectedFrom = selectedFrom;
- }
-
- public RoleModule getRoleModule()
- {
- return roleModule;
- }
-
- public void setRoleModule(RoleModule roleModule)
- {
- this.roleModule = roleModule;
- }
-
- private PortletInvoker getPortletInvoker()
- {
- return federatingPortletInvoker.getFederatedInvoker(selectedFederatedId);
- }
-
- public Collection getFederatedIds()
- {
- ArrayList toto = new ArrayList();
- toto.add(new SelectItem("local"));
- for (Iterator i = federatingPortletInvoker.getFederatedInvokers().iterator();
i.hasNext();)
- {
- FederatedPortletInvoker federated = (FederatedPortletInvoker)i.next();
- if ("local".equals(federated.getId()) == false)
- {
- toto.add(new SelectItem(federated.getId()));
- }
- }
- return toto;
- }
-
- 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 String getSelectedPlugin()
- {
- return selectedPlugin;
- }
-
- public void setSelectedPlugin(String selectedPlugin)
- {
- this.selectedPlugin = selectedPlugin;
- }
-
- public String getSelectedFederatedId()
- {
- return selectedFederatedId;
- }
-
- public void setSelectedFederatedId(String selectedFederatedId)
- {
- this.selectedFederatedId = selectedFederatedId;
- }
-
- public FederatingPortletInvoker getFederatingPortletInvoker()
- {
- return federatingPortletInvoker;
- }
-
- public void setFederatingPortletInvoker(FederatingPortletInvoker
federatingPortletInvoker)
- {
- this.federatingPortletInvoker = federatingPortletInvoker;
- }
-
- public PreferencesBean getSelectedPreferences()
- {
- return selectedPreferences;
- }
-
- public Collection getPortlets()
- {
- try
- {
- // Get portlets
- List portlets = new ArrayList(getPortletInvoker().getPortlets());
-
- // Sort
- Collections.sort(portlets, comparator);
-
- // Compute upper bound
- int to = Math.min(selectedFrom + 10, portlets.size());
-
- // Range
- return portlets.subList(selectedFrom, to);
- }
- 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 int getPortletCount()
- {
- try
- {
- return getPortletInvoker().getPortlets().size();
- }
- catch (PortletInvokerException e)
- {
- return 0;
- }
- }
-
- public DomainConfigurator getDomainConfigurator()
- {
- return
authorizationDomainRegistry.getDomain("portlet").getConfigurator();
- }
-
- public AbstractAuthorizationBean getAuth()
- {
- return auth;
- }
-
- public Portlet getSelectedPortlet()
- {
- if (selectedPortletId != null)
- {
- try
- {
- return
getPortletInvoker().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 null;
- }
- }
- else
- {
- return null;
- }
- }
-
- 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);
-
- //
- selectedFederatedId = portlet.getFederatedId();
-
- // Get sorted portlets
- List portlets = new ArrayList(getPortletInvoker().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;
-
- //
- if ("preferences".equals(selectedPlugin))
- {
- // Get user locale
- FacesContext ctx = FacesContext.getCurrentInstance();
- Locale locale = ctx.getExternalContext().getRequestLocale();
-
- // Get portlet
- Portlet portlet = getSelectedPortlet();
-
- //
- if (portlet != null)
- {
- // Get preferences info
- PreferencesInfo prefsInfo = portlet.getInfo().getPreferences();
-
- // If the portlet has preferences info then we display them
- if (prefsInfo != null)
- {
- RowSetModel model = new RowSetModel(null, prefsInfo.getKeys().size());
- model.setMutable(false);
-
- //
- int index = 0;
- for (Iterator i = prefsInfo.getKeys().iterator(); i.hasNext(); index++)
- {
- String key = (String)i.next();
-
- //
- PreferenceInfo prefs = prefsInfo.getPreference(key);
- Value value = new StringValue("not available");
- Boolean readOnly = prefs.isReadOnly();
-
- //
- Row row = model.getRow(index);
-
- //
- Cell cell = row.getCell();
- cell.setHandback("" + i);
- cell.setValue(value.asStringArray());
-
- //
- row.setHandback(key);
- row.setKey(key);
- row.setName(prefs.getDisplayName().getString(locale, true));
- row.setReadOnly(Boolean.TRUE.equals(readOnly));
- row.setValue(value.asStringArray());
- }
-
- //
- selectedPreferences = new PreferencesBean(model);
- }
- }
- }
- }
-
- /** 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());
- }
- };
-
- public class AuthorizationBean extends AbstractAuthorizationBean
- {
-
- protected String getURI()
- {
- Portlet portlet = getSelectedPortlet();
- if (portlet != null)
- {
- return portlet.getContext().getId();
- }
- else
- {
- return null;
- }
- }
-
- public String execute()
- {
- return null;
- }
-
- public RoleModule getRoleModule()
- {
- return roleModule;
- }
-
- public DomainConfigurator getDomainConfigurator()
- {
- return PortletManagerBean.this.getDomainConfigurator();
- }
-
- public SelectItem[] getAvailableActions()
- {
- return new SelectItem[]{
- new SelectItem("view")
- };
- }
- }
-}
Deleted:
trunk/core-admin/src/main/org/jboss/portal/core/portlet/management/PreferencesBean.java
===================================================================
---
trunk/core-admin/src/main/org/jboss/portal/core/portlet/management/PreferencesBean.java 2007-02-28
23:35:26 UTC (rev 6476)
+++
trunk/core-admin/src/main/org/jboss/portal/core/portlet/management/PreferencesBean.java 2007-03-01
00:56:12 UTC (rev 6477)
@@ -1,74 +0,0 @@
-/******************************************************************************
- * JBoss, a division of Red Hat *
- * Copyright 2006, Red Hat Middleware, LLC, and individual *
- * contributors as indicated by the @authors tag. See the *
- * copyright.txt in the distribution for a full listing of *
- * individual contributors. *
- * *
- * This is free software; you can redistribute it and/or modify it *
- * under the terms of the GNU Lesser General Public License as *
- * published by the Free Software Foundation; either version 2.1 of *
- * the License, or (at your option) any later version. *
- * *
- * This software is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
- * Lesser General Public License for more details. *
- * *
- * You should have received a copy of the GNU Lesser General Public *
- * License along with this software; if not, write to the Free *
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
- ******************************************************************************/
-package org.jboss.portal.core.portlet.management;
-
-import org.jboss.portal.faces.matrix.Cell;
-import org.jboss.portal.faces.matrix.Row;
-import org.jboss.portal.faces.matrix.RowSetModel;
-
-/**
- * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 5448 $
- */
-public class PreferencesBean
-{
-
- /** . */
- private RowSetModel model;
-
- /** . */
- private Cell selectedPreference;
-
- public PreferencesBean(RowSetModel selectedPreferences)
- {
- this.model = selectedPreferences;
- }
-
- public Cell getSelectedPreference()
- {
- return selectedPreference;
- }
-
- public void setSelectedPreference(Cell selectedPreference)
- {
- this.selectedPreference = selectedPreference;
- }
-
- public RowSetModel getModel()
- {
- return model;
- }
-
- public void selectRow(Integer index)
- {
- if (index != null)
- {
- Row row = model.getRow(index.intValue());
- selectedPreference = row.getCell();
- }
- else
- {
- selectedPreference = null;
- }
- }
-}
Deleted:
trunk/core-admin/src/main/org/jboss/portal/core/portlet/management/Refresher.java
===================================================================
---
trunk/core-admin/src/main/org/jboss/portal/core/portlet/management/Refresher.java 2007-02-28
23:35:26 UTC (rev 6476)
+++
trunk/core-admin/src/main/org/jboss/portal/core/portlet/management/Refresher.java 2007-03-01
00:56:12 UTC (rev 6477)
@@ -1,66 +0,0 @@
-/******************************************************************************
- * JBoss, a division of Red Hat *
- * Copyright 2006, Red Hat Middleware, LLC, and individual *
- * contributors as indicated by the @authors tag. See the *
- * copyright.txt in the distribution for a full listing of *
- * individual contributors. *
- * *
- * This is free software; you can redistribute it and/or modify it *
- * under the terms of the GNU Lesser General Public License as *
- * published by the Free Software Foundation; either version 2.1 of *
- * the License, or (at your option) any later version. *
- * *
- * This software is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
- * Lesser General Public License for more details. *
- * *
- * You should have received a copy of the GNU Lesser General Public *
- * License along with this software; if not, write to the Free *
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
- ******************************************************************************/
-package org.jboss.portal.core.portlet.management;
-
-import javax.faces.context.FacesContext;
-import javax.faces.event.PhaseEvent;
-import javax.faces.event.PhaseId;
-import javax.faces.event.PhaseListener;
-
-/**
- * Refresh the beans before JSR 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.RENDER_RESPONSE)
- {
- FacesContext ctx = phaseEvent.getFacesContext();
-
- //
- InstanceManagerBean instancemgr =
(InstanceManagerBean)ctx.getApplication().createValueBinding("#{instancemgr}").getValue(ctx);
- instancemgr.refresh();
-
- //
- PortletManagerBean portletmgr =
(PortletManagerBean)ctx.getApplication().createValueBinding("#{portletmgr}").getValue(ctx);
- portletmgr.refresh();
- }
- }
-
- public PhaseId getPhaseId()
- {
- return PhaseId.ANY_PHASE;
- }
-}
\ No newline at end of file
Modified: trunk/core-admin/src/resources/portal-admin-sar/META-INF/jboss-service.xml
===================================================================
--- trunk/core-admin/src/resources/portal-admin-sar/META-INF/jboss-service.xml 2007-02-28
23:35:26 UTC (rev 6476)
+++ trunk/core-admin/src/resources/portal-admin-sar/META-INF/jboss-service.xml 2007-03-01
00:56:12 UTC (rev 6477)
@@ -25,7 +25,7 @@
<!-- -->
<mbean
-
code="org.jboss.portal.core.portlet.management.content.ContentEditorRegistryService"
+
code="org.jboss.portal.core.admin.ui.content.ContentEditorRegistryService"
name="portal:service=ContentEditorRegistry2"
xmbean-dd=""
xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
@@ -34,7 +34,7 @@
<!-- -->
<mbean
-
code="org.jboss.portal.core.portlet.management.content.PortletContentEditor"
+ code="org.jboss.portal.core.admin.ui.content.PortletContentEditor"
name="portal:service=ContentEditor,type=portlet2"
xmbean-dd=""
xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
Modified: trunk/core-admin/src/resources/portal-admin-war/META-INF/content.taglib.xml
===================================================================
--- trunk/core-admin/src/resources/portal-admin-war/META-INF/content.taglib.xml 2007-02-28
23:35:26 UTC (rev 6476)
+++ trunk/core-admin/src/resources/portal-admin-war/META-INF/content.taglib.xml 2007-03-01
00:56:12 UTC (rev 6477)
@@ -5,7 +5,7 @@
<namespace>http://www.julien.com</namespace>
<tag>
<tag-name>content</tag-name>
-
<handler-class>org.jboss.portal.core.portlet.management.content.ContentEditorTagHandler</handler-class>
+
<handler-class>org.jboss.portal.core.admin.ui.content.ContentEditorTagHandler</handler-class>
</tag>
<tag>
<tag-name>context</tag-name>
Modified: trunk/core-admin/src/resources/portal-admin-war/WEB-INF/faces-config.xml
===================================================================
--- trunk/core-admin/src/resources/portal-admin-war/WEB-INF/faces-config.xml 2007-02-28
23:35:26 UTC (rev 6476)
+++ trunk/core-admin/src/resources/portal-admin-war/WEB-INF/faces-config.xml 2007-03-01
00:56:12 UTC (rev 6477)
@@ -34,13 +34,13 @@
<converter>
<converter-for-class>org.jboss.portal.core.model.content.ContentType</converter-for-class>
-
<converter-class>org.jboss.portal.core.portlet.management.ContentTypeConverter</converter-class>
+
<converter-class>org.jboss.portal.core.admin.ui.ContentTypeConverter</converter-class>
</converter>
<!-- The portal object manager bean -->
<managed-bean>
<managed-bean-name>portalobjectmgr</managed-bean-name>
-
<managed-bean-class>org.jboss.portal.core.portlet.management.PortalObjectManagerBean</managed-bean-class>
+
<managed-bean-class>org.jboss.portal.core.admin.ui.PortalObjectManagerBean</managed-bean-class>
<managed-bean-scope>session</managed-bean-scope>
<managed-property>
<property-name>roleModule</property-name>
@@ -73,7 +73,7 @@
</managed-bean>
<managed-bean>
<managed-bean-name>portalAction</managed-bean-name>
-
<managed-bean-class>org.jboss.portal.core.portlet.management.actions.PortalAction</managed-bean-class>
+
<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>
@@ -82,7 +82,7 @@
</managed-bean>
<managed-bean>
<managed-bean-name>addPageAction</managed-bean-name>
-
<managed-bean-class>org.jboss.portal.core.portlet.management.actions.AddPageAction</managed-bean-class>
+
<managed-bean-class>org.jboss.portal.core.admin.ui.actions.AddPageAction</managed-bean-class>
<managed-bean-scope>request</managed-bean-scope>
<managed-property>
<property-name>portalObjectManager</property-name>
@@ -91,7 +91,7 @@
</managed-bean>
<managed-bean>
<managed-bean-name>assignWindowsAction</managed-bean-name>
-
<managed-bean-class>org.jboss.portal.core.portlet.management.actions.AssignWindowsAction</managed-bean-class>
+
<managed-bean-class>org.jboss.portal.core.admin.ui.actions.AssignWindowsAction</managed-bean-class>
<managed-bean-scope>request</managed-bean-scope>
<managed-property>
<property-name>portalObjectManager</property-name>
@@ -100,7 +100,7 @@
</managed-bean>
<managed-bean>
<managed-bean-name>themePropertyAction</managed-bean-name>
-
<managed-bean-class>org.jboss.portal.core.portlet.management.actions.ThemePropertyAction</managed-bean-class>
+
<managed-bean-class>org.jboss.portal.core.admin.ui.actions.ThemePropertyAction</managed-bean-class>
<managed-bean-scope>request</managed-bean-scope>
<managed-property>
<property-name>portalObjectManager</property-name>
@@ -111,7 +111,7 @@
<!-- The instance manager managed bean -->
<managed-bean>
<managed-bean-name>instancemgr</managed-bean-name>
-
<managed-bean-class>org.jboss.portal.core.portlet.management.InstanceManagerBean</managed-bean-class>
+
<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>
@@ -128,7 +128,7 @@
</managed-bean>
<managed-bean>
<managed-bean-name>preferenceAction</managed-bean-name>
-
<managed-bean-class>org.jboss.portal.core.portlet.management.actions.PreferenceAction</managed-bean-class>
+
<managed-bean-class>org.jboss.portal.core.admin.ui.actions.PreferenceAction</managed-bean-class>
<managed-bean-scope>request</managed-bean-scope>
<managed-property>
<property-name>manager</property-name>
@@ -139,7 +139,7 @@
<!-- The portlet manager managed bean -->
<managed-bean>
<managed-bean-name>portletmgr</managed-bean-name>
-
<managed-bean-class>org.jboss.portal.core.portlet.management.PortletManagerBean</managed-bean-class>
+
<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>
@@ -164,7 +164,7 @@
</managed-bean>
<managed-bean>
<managed-bean-name>createInstanceAction</managed-bean-name>
-
<managed-bean-class>org.jboss.portal.core.portlet.management.actions.CreateInstanceAction</managed-bean-class>
+
<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>
@@ -177,7 +177,7 @@
</managed-bean>
<managed-bean>
<managed-bean-name>propertyAction</managed-bean-name>
-
<managed-bean-class>org.jboss.portal.core.portlet.management.actions.PropertyAction</managed-bean-class>
+
<managed-bean-class>org.jboss.portal.core.admin.ui.actions.PropertyAction</managed-bean-class>
<managed-bean-scope>session</managed-bean-scope>
<managed-property>
<property-name>portalObjectManager</property-name>
@@ -188,7 +188,7 @@
<!-- The content editor registry bean -->
<managed-bean>
<managed-bean-name>registry</managed-bean-name>
-
<managed-bean-class>org.jboss.portal.core.portlet.management.content.ContentEditorRegistryBean</managed-bean-class>
+
<managed-bean-class>org.jboss.portal.core.admin.ui.content.ContentEditorRegistryBean</managed-bean-class>
<managed-bean-scope>session</managed-bean-scope>
<managed-property>
<property-name>registry</property-name>
@@ -199,68 +199,68 @@
<navigation-rule>
<navigation-case>
<from-outcome>portals</from-outcome>
- <to-view-id>/WEB-INF/jsp/management/portals.xhtml</to-view-id>
+ <to-view-id>/WEB-INF/jsf/portals.xhtml</to-view-id>
</navigation-case>
<navigation-case>
<from-outcome>windows</from-outcome>
- <to-view-id>/WEB-INF/jsp/management/windows.xhtml</to-view-id>
+ <to-view-id>/WEB-INF/jsf/windows.xhtml</to-view-id>
</navigation-case>
<navigation-case>
<from-outcome>pages</from-outcome>
- <to-view-id>/WEB-INF/jsp/management/pages.xhtml</to-view-id>
+ <to-view-id>/WEB-INF/jsf/pages.xhtml</to-view-id>
</navigation-case>
<navigation-case>
<from-outcome>editPortalPreferences</from-outcome>
-
<to-view-id>/WEB-INF/jsp/management/editPortalPreferences.xhtml</to-view-id>
+ <to-view-id>/WEB-INF/jsf/editPortalPreferences.xhtml</to-view-id>
</navigation-case>
<navigation-case>
<from-outcome>editPortalSecurity</from-outcome>
-
<to-view-id>/WEB-INF/jsp/management/editPortalSecurity.xhtml</to-view-id>
+ <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/jsp/management/editPortalTheme.xhtml</to-view-id>
+ <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/jsp/management/editPageLayout.xhtml</to-view-id>
+ <to-view-id>/WEB-INF/jsf/editPageLayout.xhtml</to-view-id>
</navigation-case>
<navigation-case>
<from-outcome>editPagePreferences</from-outcome>
-
<to-view-id>/WEB-INF/jsp/management/editPagePreferences.xhtml</to-view-id>
+ <to-view-id>/WEB-INF/jsf/editPagePreferences.xhtml</to-view-id>
</navigation-case>
<navigation-case>
<from-outcome>editPageSecurity</from-outcome>
-
<to-view-id>/WEB-INF/jsp/management/editPageSecurity.xhtml</to-view-id>
+ <to-view-id>/WEB-INF/jsf/editPageSecurity.xhtml</to-view-id>
</navigation-case>
<navigation-case>
<from-outcome>editPageTheme</from-outcome>
-
<to-view-id>/WEB-INF/jsp/management/editPageTheme.xhtml</to-view-id>
+ <to-view-id>/WEB-INF/jsf/editPageTheme.xhtml</to-view-id>
</navigation-case>
<navigation-case>
<from-outcome>editWindowPreferences</from-outcome>
-
<to-view-id>/WEB-INF/jsp/management/editWindowPreferences.xhtml</to-view-id>
+ <to-view-id>/WEB-INF/jsf/editWindowPreferences.xhtml</to-view-id>
</navigation-case>
<navigation-case>
<from-outcome>editWindowSecurity</from-outcome>
-
<to-view-id>/WEB-INF/jsp/management/editWindowSecurity.xhtml</to-view-id>
+ <to-view-id>/WEB-INF/jsf/editWindowSecurity.xhtml</to-view-id>
</navigation-case>
<navigation-case>
<from-outcome>editWindowTheme</from-outcome>
-
<to-view-id>/WEB-INF/jsp/management/editWindowTheme.xhtml</to-view-id>
+ <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/jsp/management/instances.xhtml</to-view-id>
+ <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/jsp/management/portlets.xhtml</to-view-id>
+ <to-view-id>/WEB-INF/jsf/portlets.xhtml</to-view-id>
</navigation-case>
</navigation-rule>
<lifecycle>
-
<phase-listener>org.jboss.portal.core.portlet.management.Refresher</phase-listener>
+
<phase-listener>org.jboss.portal.core.admin.ui.Refresher</phase-listener>
</lifecycle>
<component>
Modified: trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jboss-portlet.xml
===================================================================
--- trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jboss-portlet.xml 2007-02-28
23:35:26 UTC (rev 6476)
+++ trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jboss-portlet.xml 2007-03-01
00:56:12 UTC (rev 6477)
@@ -27,12 +27,12 @@
<portlet-app>
<portlet>
- <portlet-name>ManagementPortlet</portlet-name>
+ <portlet-name>AdminPortlet</portlet-name>
<transaction>
<trans-attribute>Required</trans-attribute>
</transaction>
<header-content>
- <link rel="stylesheet" type="text/css"
href="/images/management/management.css" title=""
media="screen"/>
+ <link rel="stylesheet" type="text/css"
href="/style.css" title="" media="screen"/>
</header-content>
</portlet>
@@ -99,7 +99,7 @@
</service>
<service>
<service-name>ContentEditorRegistry</service-name>
-
<service-class>org.jboss.portal.core.portlet.management.content.ContentEditorRegistry</service-class>
+
<service-class>org.jboss.portal.core.admin.ui.content.ContentEditorRegistry</service-class>
<service-ref>:service=ContentEditorRegistry2</service-ref>
</service>
</portlet-app>
Copied: trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf (from rev 6476,
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsp/management)
Modified:
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/editPageLayout.xhtml
===================================================================
---
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsp/management/editPageLayout.xhtml 2007-02-28
23:35:26 UTC (rev 6476)
+++
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/editPageLayout.xhtml 2007-03-01
00:56:12 UTC (rev 6477)
@@ -6,7 +6,7 @@
xmlns:ct="http://www.julien.com"
xmlns:c="http://java.sun.com/jstl/core">
-<ui:composition template="/WEB-INF/jsp/management/objectTemplate.xhtml">
+<ui:composition template="objectTemplate.xhtml">
<ui:define name="content">
Modified:
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/editPagePreferences.xhtml
===================================================================
---
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsp/management/editPagePreferences.xhtml 2007-02-28
23:35:26 UTC (rev 6476)
+++
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/editPagePreferences.xhtml 2007-03-01
00:56:12 UTC (rev 6477)
@@ -3,7 +3,7 @@
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:h="http://java.sun.com/jsf/html">
-<ui:composition template="/WEB-INF/jsp/management/objectTemplate.xhtml">
+<ui:composition template="objectTemplate.xhtml">
<ui:define name="content">
Modified:
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/editPageSecurity.xhtml
===================================================================
---
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsp/management/editPageSecurity.xhtml 2007-02-28
23:35:26 UTC (rev 6476)
+++
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/editPageSecurity.xhtml 2007-03-01
00:56:12 UTC (rev 6477)
@@ -2,10 +2,10 @@
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="/WEB-INF/jsp/management/objectTemplate.xhtml">
+ <ui:composition template="objectTemplate.xhtml">
<ui:define name="content">
<h3>Please set the page permissions</h3>
- <ui:include
src="/WEB-INF/jsp/management/common/editSecurity.xhtml">
+ <ui:include src="common/editSecurity.xhtml">
<ui:param name="auth"
value="#{portalobjectmgr.auth}"/>
</ui:include>
</ui:define>
Modified: trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/editPageTheme.xhtml
===================================================================
---
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsp/management/editPageTheme.xhtml 2007-02-28
23:35:26 UTC (rev 6476)
+++
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/editPageTheme.xhtml 2007-03-01
00:56:12 UTC (rev 6477)
@@ -3,13 +3,13 @@
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:h="http://java.sun.com/jsf/html">
-<ui:composition template="/WEB-INF/jsp/management/objectTemplate.xhtml">
+<ui:composition template="objectTemplate.xhtml">
<ui:define name="content">
<h3>Please set the display options for the page: <h:outputText
value="#{portalobjectmgr.selectedObject.name}"/></h3>
<br/>
- <ui:include src="/WEB-INF/jsp/management/common/editTheme.xhtml"/>
+ <ui:include src="common/editTheme.xhtml"/>
</ui:define>
Modified:
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/editPortalPreferences.xhtml
===================================================================
---
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsp/management/editPortalPreferences.xhtml 2007-02-28
23:35:26 UTC (rev 6476)
+++
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/editPortalPreferences.xhtml 2007-03-01
00:56:12 UTC (rev 6477)
@@ -4,7 +4,7 @@
xmlns:f="http://java.sun.com/jsf/core">
<ui:composition
- template="/WEB-INF/jsp/management/objectTemplate.xhtml">
+ template="objectTemplate.xhtml">
<ui:define name="content">
Modified:
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/editPortalSecurity.xhtml
===================================================================
---
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsp/management/editPortalSecurity.xhtml 2007-02-28
23:35:26 UTC (rev 6476)
+++
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/editPortalSecurity.xhtml 2007-03-01
00:56:12 UTC (rev 6477)
@@ -3,13 +3,13 @@
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:h="http://java.sun.com/jsf/html">
-<ui:composition template="/WEB-INF/jsp/management/objectTemplate.xhtml">
+<ui:composition template="objectTemplate.xhtml">
<ui:define name="content">
<h3>Please set the portal permissions</h3>
- <ui:include src="/WEB-INF/jsp/management/common/editSecurity.xhtml">
+ <ui:include src="common/editSecurity.xhtml">
<ui:param name="auth" value="#{portalobjectmgr.auth}"/>
</ui:include>
Modified:
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/editPortalTheme.xhtml
===================================================================
---
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsp/management/editPortalTheme.xhtml 2007-02-28
23:35:26 UTC (rev 6476)
+++
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/editPortalTheme.xhtml 2007-03-01
00:56:12 UTC (rev 6477)
@@ -3,14 +3,14 @@
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:h="http://java.sun.com/jsf/html">
-<ui:composition template="/WEB-INF/jsp/management/objectTemplate.xhtml">
+<ui:composition template="objectTemplate.xhtml">
<ui:define name="content">
<h3>Please set the display options for the portal: <h:outputText
value="#{portalobjectmgr.selectedObject.name}"/></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:include src="/WEB-INF/jsp/management/common/editTheme.xhtml"/>
+ <ui:include src="common/editTheme.xhtml"/>
</ui:define>
Modified:
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/editWindowPreferences.xhtml
===================================================================
---
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsp/management/editWindowPreferences.xhtml 2007-02-28
23:35:26 UTC (rev 6476)
+++
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/editWindowPreferences.xhtml 2007-03-01
00:56:12 UTC (rev 6477)
@@ -3,16 +3,13 @@
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:h="http://java.sun.com/jsf/html">
-<ui:composition template="/WEB-INF/jsp/management/objectTemplate.xhtml">
+<ui:composition template="objectTemplate.xhtml">
<ui:define name="content">
<h3>You are editing the window: <h:outputText
value="#{portalobjectmgr.selectedObject.name}" /></h3>
-
- <ui:include src="/WEB-INF/jsp/management/plugins/manager.xhtml"/>
-
</ui:define>
</ui:composition>
Modified:
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/editWindowSecurity.xhtml
===================================================================
---
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsp/management/editWindowSecurity.xhtml 2007-02-28
23:35:26 UTC (rev 6476)
+++
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/editWindowSecurity.xhtml 2007-03-01
00:56:12 UTC (rev 6477)
@@ -3,13 +3,13 @@
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:h="http://java.sun.com/jsf/html">
-<ui:composition template="/WEB-INF/jsp/management/objectTemplate.xhtml">
+<ui:composition template="objectTemplate.xhtml">
<ui:define name="content">
<h3>Please set the permissions for the window: <h:outputText
value="#{portalobjectmgr.selectedObject.name}"/></h3>
- <ui:include src="/WEB-INF/jsp/management/common/editSecurity.xhtml"/>
+ <ui:include src="common/editSecurity.xhtml"/>
</ui:define>
Modified:
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/editWindowTheme.xhtml
===================================================================
---
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsp/management/editWindowTheme.xhtml 2007-02-28
23:35:26 UTC (rev 6476)
+++
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/editWindowTheme.xhtml 2007-03-01
00:56:12 UTC (rev 6477)
@@ -3,13 +3,13 @@
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:h="http://java.sun.com/jsf/html">
-<ui:composition template="/WEB-INF/jsp/management/objectTemplate.xhtml">
+<ui:composition template="objectTemplate.xhtml">
<ui:define name="content">
<h3>Please set the display options for the window: <h:outputText
value="#{portalobjectmgr.selectedObject.name}"/></h3>
<br/>
- <ui:include src="/WEB-INF/jsp/management/common/editTheme.xhtml"/>
+ <ui:include src="common/editTheme.xhtml"/>
</ui:define>
Modified: trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/instances.xhtml
===================================================================
---
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsp/management/instances.xhtml 2007-02-28
23:35:26 UTC (rev 6476)
+++ trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/instances.xhtml 2007-03-01
00:56:12 UTC (rev 6477)
@@ -6,7 +6,7 @@
xmlns:jbp="http://www.jboss.com/portal"
xmlns:c="http://java.sun.com/jstl/core">
-<ui:composition
template="/WEB-INF/jsp/management/instancesTemplate.xhtml">
+<ui:composition template="instancesTemplate.xhtml">
<ui:define name="content">
@@ -74,7 +74,7 @@
Show
</h:commandLink> the associated portlet
</h:form>
- <ui:include
src="/WEB-INF/jsp/management/common/showPortletDetails.xhtml">
+ <ui:include src="common/showPortletDetails.xhtml">
<ui:param name="portlet"
value="#{instancemgr.selectedInstance.portlet}"/>
</ui:include>
</c:when>
@@ -87,7 +87,7 @@
<c:if test="#{instancemgr.selectedPlugin ==
'preferences'}">
<h3>Editing preferences of #{instancemgr.selectedInstance.id}: </h3>
- <ui:include
src="/WEB-INF/jsp/management/common/editPreferences.xhtml">
+ <ui:include src="common/editPreferences.xhtml">
<ui:param name="preferences"
value="#{instancemgr.selectedPreferences}"/>
<ui:param name="action"
value="#{preferenceAction}"/>
</ui:include>
@@ -95,7 +95,7 @@
<c:if test="#{instancemgr.selectedPlugin == 'security'}">
<h3>Editing security of #{instancemgr.selectedInstance.id}: </h3>
- <ui:include
src="/WEB-INF/jsp/management/common/editSecurity.xhtml">
+ <ui:include src="common/editSecurity.xhtml">
<ui:param name="auth" value="#{instancemgr.auth}"/>
</ui:include>
</c:if>
Modified: trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/pages.xhtml
===================================================================
---
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsp/management/pages.xhtml 2007-02-28
23:35:26 UTC (rev 6476)
+++ trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/pages.xhtml 2007-03-01
00:56:12 UTC (rev 6477)
@@ -3,7 +3,7 @@
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:h="http://java.sun.com/jsf/html">
- <ui:composition
template="/WEB-INF/jsp/management/objectTemplate.xhtml">
+ <ui:composition template="objectTemplate.xhtml">
<ui:define name="content">
<h:message id="status" for="status"/>
Modified: trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/portals.xhtml
===================================================================
---
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsp/management/portals.xhtml 2007-02-28
23:35:26 UTC (rev 6476)
+++ trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/portals.xhtml 2007-03-01
00:56:12 UTC (rev 6477)
@@ -3,7 +3,7 @@
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:h="http://java.sun.com/jsf/html">
- <ui:composition
template="/WEB-INF/jsp/management/objectTemplate.xhtml">
+ <ui:composition template="objectTemplate.xhtml">
<ui:define name="content">
<h:message id="status" for="status"/>
Modified: trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/portlets.xhtml
===================================================================
---
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsp/management/portlets.xhtml 2007-02-28
23:35:26 UTC (rev 6476)
+++ trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/portlets.xhtml 2007-03-01
00:56:12 UTC (rev 6477)
@@ -7,7 +7,7 @@
xmlns:c="http://java.sun.com/jstl/core"
xmlns:pfc="http://www.jboss.com/portal/facelet/common">
-<ui:composition
template="/WEB-INF/jsp/management/portletsTemplate.xhtml">
+<ui:composition template="portletsTemplate.xhtml">
<ui:define name="content">
@@ -74,12 +74,12 @@
<c:if test="#{portletmgr.selectedPlugin == 'manager'}">
<hr/>
<h3>Portlet details</h3>
- <ui:include
src="/WEB-INF/jsp/management/showPortletInfo.xhtml"/>
+ <ui:include src="showPortletInfo.xhtml"/>
</c:if>
<c:if test="#{portletmgr.selectedPlugin ==
'preferences'}">
<hr/>
<h3>Portlet preferences</h3>
- <ui:include
src="/WEB-INF/jsp/management/common/editPreferences.xhtml">
+ <ui:include src="common/editPreferences.xhtml">
<ui:param name="preferences"
value="#{portletmgr.selectedPreferences}"/>
</ui:include>
</c:if>
Modified:
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/showPortletInfo.xhtml
===================================================================
---
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsp/management/showPortletInfo.xhtml 2007-02-28
23:35:26 UTC (rev 6476)
+++
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/showPortletInfo.xhtml 2007-03-01
00:56:12 UTC (rev 6477)
@@ -9,7 +9,7 @@
<!-- Portlet details -->
<c:if test="#{portletmgr.selectedPortlet != null}">
- <ui:include
src="/WEB-INF/jsp/management/common/showPortletDetails.xhtml">
+ <ui:include src="common/showPortletDetails.xhtml">
<ui:param name="portlet"
value="#{portletmgr.selectedPortlet}"/>
</ui:include>
</c:if>
Modified: trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/windows.xhtml
===================================================================
---
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsp/management/windows.xhtml 2007-02-28
23:35:26 UTC (rev 6476)
+++ trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/windows.xhtml 2007-03-01
00:56:12 UTC (rev 6477)
@@ -4,7 +4,7 @@
xmlns:ct="http://www.julien.com"
xmlns:h="http://java.sun.com/jsf/html">
- <ui:composition
template="/WEB-INF/jsp/management/objectTemplate.xhtml">
+ <ui:composition template="objectTemplate.xhtml">
<ui:define name="content">
<h:message id="status" for="status"/>
Modified: trunk/core-admin/src/resources/portal-admin-war/WEB-INF/portlet-instances.xml
===================================================================
---
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/portlet-instances.xml 2007-02-28
23:35:26 UTC (rev 6476)
+++
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/portlet-instances.xml 2007-03-01
00:56:12 UTC (rev 6477)
@@ -29,8 +29,8 @@
<deployments>
<deployment>
<instance>
- <instance-id>ManagementPortletInstance</instance-id>
- <portlet-ref>ManagementPortlet</portlet-ref>
+ <instance-id>AdminPortletInstance</instance-id>
+ <portlet-ref>AdminPortlet</portlet-ref>
<security-constraint>
<policy-permission>
<role-name>Admin</role-name>
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-02-28
23:35:26 UTC (rev 6476)
+++ trunk/core-admin/src/resources/portal-admin-war/WEB-INF/portlet.xml 2007-03-01
00:56:12 UTC (rev 6477)
@@ -28,13 +28,13 @@
xsi:schemaLocation="http://java.sun.com/xml/ns/portlet/portlet-app_1...
http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd"
version="1.0">
<portlet>
- <description>Administration portlet for portal pages
administration</description>
- <portlet-name>ManagementPortlet</portlet-name>
- <display-name>Portal Management Portlet</display-name>
+ <description>Administration Portlet</description>
+ <portlet-name>AdminPortlet</portlet-name>
+ <display-name>Administration Portlet</display-name>
<portlet-class>org.apache.myfaces.portlet.MyFacesGenericPortlet</portlet-class>
<init-param>
<name>default-view</name>
- <value>/WEB-INF/jsp/management/portals.xhtml</value>
+ <value>/WEB-INF/jsf/portals.xhtml</value>
</init-param>
<expiration-cache>-1</expiration-cache>
<supports>
Modified:
trunk/core-cms/src/main/org/jboss/portal/core/cms/content/CMSFaceletContentEditor.java
===================================================================
---
trunk/core-cms/src/main/org/jboss/portal/core/cms/content/CMSFaceletContentEditor.java 2007-02-28
23:35:26 UTC (rev 6476)
+++
trunk/core-cms/src/main/org/jboss/portal/core/cms/content/CMSFaceletContentEditor.java 2007-03-01
00:56:12 UTC (rev 6477)
@@ -26,7 +26,7 @@
import org.jboss.portal.cms.Command;
import org.jboss.portal.cms.model.File;
import org.jboss.portal.cms.model.Folder;
-import org.jboss.portal.core.portlet.management.content.AbstractFaceletContentEditor;
+import org.jboss.portal.core.admin.ui.content.AbstractFaceletContentEditor;
import javax.faces.model.SelectItem;
import java.util.ArrayList;