JBoss Portal SVN: r9457 - in modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl: info and 1 other directory.
by portal-commits@lists.jboss.org
Author: julien(a)jboss.com
Date: 2008-01-08 10:57:56 -0500 (Tue, 08 Jan 2008)
New Revision: 9457
Added:
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/info/
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/info/ContainerCacheInfo.java
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/info/ContainerCapabilitiesInfo.java
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/info/ContainerMetaInfo.java
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/info/ContainerModeInfo.java
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/info/ContainerPortletInfo.java
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/info/ContainerPreferenceInfo.java
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/info/ContainerPreferencesInfo.java
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/info/ContainerSecurityInfo.java
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/info/ContainerSessionInfo.java
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/info/ContainerWindowStateInfo.java
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/info/PortletInfoBuilder.java
Log:
first shot for container runtime info using new metadata model
Added: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/info/ContainerCacheInfo.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/info/ContainerCacheInfo.java (rev 0)
+++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/info/ContainerCacheInfo.java 2008-01-08 15:57:56 UTC (rev 9457)
@@ -0,0 +1,46 @@
+/******************************************************************************
+ * 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.portlet.impl.info;
+
+import org.jboss.portal.portlet.info.CacheInfo;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 6697 $
+ */
+public class ContainerCacheInfo implements CacheInfo
+{
+
+ /** . */
+ private int expirationTimeSecs;
+
+ public ContainerCacheInfo(int expirationTimeSecs)
+ {
+ this.expirationTimeSecs = expirationTimeSecs;
+ }
+
+ public int getExpirationSecs()
+ {
+ return expirationTimeSecs;
+ }
+}
\ No newline at end of file
Added: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/info/ContainerCapabilitiesInfo.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/info/ContainerCapabilitiesInfo.java (rev 0)
+++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/info/ContainerCapabilitiesInfo.java 2008-01-08 15:57:56 UTC (rev 9457)
@@ -0,0 +1,376 @@
+/******************************************************************************
+ * 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.portlet.impl.info;
+
+import org.jboss.portal.Mode;
+import org.jboss.portal.WindowState;
+import org.jboss.portal.portlet.info.CapabilitiesInfo;
+import org.jboss.portal.portlet.info.ModeInfo;
+import org.jboss.portal.portlet.info.WindowStateInfo;
+
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Set;
+import java.util.Locale;
+
+/**
+ * This object holds the content type and mode capabilities.
+ * <p/>
+ * Todo : use the media type object ?
+ *
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @author <a href="mailto:chris.laprun@jboss.com">Chris Laprun</a>
+ * @version $Revision: 6700 $
+ */
+public class ContainerCapabilitiesInfo implements CapabilitiesInfo
+{
+
+ /** . */
+ private static Set<WindowStateInfo> WINDOW_STATES;
+
+ /** . */
+ private static final String ANY = "*";
+
+ /** . */
+ private static final String ANY_ANY = "*/*";
+
+ /** . */
+ private static final char SEPARATOR = '/';
+
+ static
+ {
+ Set<WindowStateInfo> tmp = new HashSet<WindowStateInfo>();
+ tmp.add(new ContainerWindowStateInfo(WindowState.MAXIMIZED));
+ tmp.add(new ContainerWindowStateInfo(WindowState.MINIMIZED));
+ tmp.add(new ContainerWindowStateInfo(WindowState.NORMAL));
+ WINDOW_STATES = Collections.unmodifiableSet(tmp);
+ }
+
+ /** Maps MIME Type (String) -> Modes (Set), excluding multiple MIME Types ("*", "* / *", "type / *"). */
+ protected final Map<String, Set<Mode>> singleTypeToPortletModes;
+
+ /** Maps MIME Type (String) -> Modes (Set), including multiple MIME Types ("*", "* / *", "type / *"). */
+ protected final Map<String, Set<Mode>> allTypeToPortletModes;
+
+ /** . */
+ protected final Set<Mode> allModes;
+
+ /** . */
+ private final Set<Locale> supportedLocales;
+
+ // case-insensitive
+ // CONTENT TYPE = TYPE / SUBTYPE
+ // SUBTYPE = any char except a TSPECIALS or SPACE or CTLS (??)
+ // TSPECIALS ( ) < > @ , ; : \ " / [ ] ? . =
+
+ public ContainerCapabilitiesInfo()
+ {
+ this.singleTypeToPortletModes = new HashMap<String, Set<Mode>>();
+ this.allTypeToPortletModes = new HashMap<String, Set<Mode>>(); // Including *
+ this.allModes = new HashSet<Mode>();
+ this.supportedLocales = new HashSet<Locale>();
+ }
+
+ public void add(String contentType, Mode mode)
+ {
+ // Determines which map and key to store the mode under
+ String key;
+ if (ANY.equals(contentType) || ANY_ANY.equals(contentType))
+ {
+ key = ANY;
+ }
+ else
+ {
+ int index = contentType.indexOf(SEPARATOR);
+ if (index == -1)
+ {
+ System.out.println("'" + contentType + "' is not a valid MIME type: ignoring!");
+ return;
+ }
+
+ String type = contentType.substring(0, index);
+ String subtype = contentType.substring(index + 1);
+
+ if (ANY.equals(subtype))
+ {
+ key = type;
+ }
+ else
+ {
+ key = contentType;
+ // This is a single content type so we need to add it to the single mappings in addition to all
+ addMode(singleTypeToPortletModes, key, mode);
+ }
+ }
+
+ // Store the mode in the complete mapping
+ addMode(allTypeToPortletModes, key, mode);
+
+ // Add the mode to the known modes
+ allModes.add(mode);
+ }
+
+ private void addMode(Map<String, Set<Mode>> map, String key, Mode mode)
+ {
+ Set<Mode> modes = map.get(key);
+ if (modes == null)
+ {
+ modes = new HashSet<Mode>();
+ map.put(key, modes);
+ }
+ modes.add(mode);
+ }
+
+ /**
+ * Return all modes.
+ *
+ * @return all modes
+ */
+ public Collection<Mode> getModes()
+ {
+ return Collections.unmodifiableCollection(allModes);
+ }
+
+ /**
+ * Return all content types.
+ *
+ * @return all content types
+ */
+ public Collection<String> getAllContentTypes()
+ {
+ return Collections.unmodifiableCollection(allTypeToPortletModes.keySet());
+ }
+
+ /**
+ * Return true if the mode is supported
+ *
+ * @param mode the mode to check
+ * @return true if the mode is supported
+ * @throws IllegalArgumentException if the mode is null
+ */
+ public boolean isModeSupported(Mode mode)
+ {
+ if (mode == null)
+ {
+ throw new IllegalArgumentException("Mode must not be null");
+ }
+ return allModes.contains(mode);
+ }
+
+ /**
+ * Return all the supported modes for this content type.
+ *
+ * @param contentType the content type to check
+ * @throws IllegalArgumentException if the content type is null
+ * @return the set of modes matching the content types support
+ */
+ public Set<Mode> getSupportedModes(String contentType)
+ {
+ if (contentType == null)
+ {
+ throw new IllegalArgumentException("Content type must not be null");
+ }
+
+ int index = contentType.indexOf(SEPARATOR);
+ if (index == -1)
+ {
+ // Not valid content type so return empty set
+ return Collections.emptySet();
+ }
+
+ //
+ Set<Mode> set = new HashSet<Mode>();
+
+ //
+ Set<Mode> contentTypeModes = singleTypeToPortletModes.get(contentType.toLowerCase());
+ if (contentTypeModes != null)
+ {
+ set.addAll(contentTypeModes);
+ }
+
+ //
+ Set<Mode> typeModes = allTypeToPortletModes.get(contentType.substring(0, index).toLowerCase());
+ if (typeModes != null)
+ {
+ set.addAll(typeModes);
+ }
+
+ Set<Mode> wildcardModes = allTypeToPortletModes.get(ANY);
+ if (wildcardModes != null)
+ {
+ set.addAll(wildcardModes);
+ }
+
+ return set;
+ }
+
+ /**
+ * Return true if the content type is supported.
+ *
+ * @param contentType the content type
+ * @return true is it is supported
+ * @throws IllegalArgumentException if the content type is null
+ */
+ public boolean isContentTypeSupported(String contentType)
+ {
+ Collection allContentTypes = getAllContentTypes();
+ if (contentType == null)
+ {
+ throw new IllegalArgumentException("Content type must not be null");
+ }
+
+ int index = contentType.indexOf(SEPARATOR);
+ if (index == -1)
+ {
+ // Not valid content type so return false
+ return false;
+ }
+
+ // Try the content type, * or */*
+ if (allContentTypes.contains(contentType) |
+ allContentTypes.contains(contentType.toLowerCase()) |
+ allContentTypes.contains(ANY) |
+ allContentTypes.contains(ANY_ANY))
+ {
+ return true;
+ }
+
+ // Try xxx/*
+ String wildcard = contentType.substring(0, index) + "/*";
+ return allContentTypes.contains(wildcard) | allContentTypes.contains(wildcard.toLowerCase());
+ }
+
+ /**
+ * Return true if the given content type is supported for the given mode.
+ *
+ * @param mode the mode to check
+ * @param contentType the content type to check
+ * @return true if is it supported
+ * @throws IllegalArgumentException if the content type or the mode is null
+ */
+ public boolean isSupported(Mode mode, String contentType)
+ {
+ if (mode == null)
+ {
+ throw new IllegalArgumentException("Mode must not be null");
+ }
+ if (contentType == null)
+ {
+ throw new IllegalArgumentException("Content type must not be null");
+ }
+
+ int index = contentType.indexOf(SEPARATOR);
+ if (index == -1)
+ {
+ // Not valid content type so return false
+ return false;
+ }
+
+ // Try full name matching
+ Set<Mode> contentTypeModes = singleTypeToPortletModes.get(contentType);
+ if (contentTypeModes != null && contentTypeModes.contains(mode))
+ {
+ return true;
+ }
+
+ // Try full name lowercase matching
+ Set<Mode> lowercaseContentTypeModes = singleTypeToPortletModes.get(contentType.toLowerCase());
+ if (lowercaseContentTypeModes != null && lowercaseContentTypeModes.contains(mode))
+ {
+ return true;
+ }
+
+ // Try type matching
+ String type = contentType.substring(0, index);
+ Set<Mode> typeMode = allTypeToPortletModes.get(type);
+ if (typeMode != null && typeMode.contains(mode))
+ {
+ return true;
+ }
+
+ // Try type matching
+ Set<Mode> lowercaseTypeMode = allTypeToPortletModes.get(type.toLowerCase());
+ if (lowercaseTypeMode != null && lowercaseTypeMode.contains(mode))
+ {
+ return true;
+ }
+
+ // Try wildcard matching
+ Set<Mode> wildcardMode = allTypeToPortletModes.get(ANY);
+ return wildcardMode != null && wildcardMode.contains(mode);
+ }
+
+ // CapabilitiesInfo implementation **********************************************************************************
+
+ public Set<String> getMimeTypes()
+ {
+ return new HashSet<String>(getAllContentTypes());
+ }
+
+ public Set<ModeInfo> getAllModes()
+ {
+ Set<ModeInfo> infos = new HashSet<ModeInfo>();
+ for (Mode mode : getModes())
+ {
+ infos.add(new ContainerModeInfo(mode));
+ }
+ return infos;
+ }
+
+ public Set<ModeInfo> getModes(String mimeType)
+ {
+ Set<ModeInfo> infos = new HashSet<ModeInfo>();
+ for (Mode mode : getSupportedModes(mimeType))
+ {
+ infos.add(new ContainerModeInfo(mode));
+ }
+ return infos;
+ }
+
+ public Set<WindowStateInfo> getAllWindowStates()
+ {
+ return WINDOW_STATES;
+ }
+
+ public Set<WindowStateInfo> getWindowStates(String mimeType)
+ {
+ if (isContentTypeSupported(mimeType))
+ {
+ return getAllWindowStates();
+ }
+ return Collections.emptySet();
+ }
+
+ public Set<Locale> getAllLocales()
+ {
+ return supportedLocales;
+ }
+
+ public Set<Locale> getLocales(String mimeType)
+ {
+ return getAllLocales();
+ }
+}
\ No newline at end of file
Added: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/info/ContainerMetaInfo.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/info/ContainerMetaInfo.java (rev 0)
+++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/info/ContainerMetaInfo.java 2008-01-08 15:57:56 UTC (rev 9457)
@@ -0,0 +1,56 @@
+/******************************************************************************
+ * 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.portlet.impl.info;
+
+import org.jboss.portal.common.i18n.LocalizedString;
+import org.jboss.portal.portlet.info.MetaInfo;
+
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @author <a href="mailto:chris.laprun@jboss.com">Chris Laprun</a>
+ * @version $Revision: 6818 $
+ */
+public class ContainerMetaInfo implements MetaInfo
+{
+
+ /** . */
+ private Map<String, LocalizedString> values;
+
+ public ContainerMetaInfo()
+ {
+ this.values = new HashMap<String, LocalizedString>();
+ }
+
+ public void addMetaValue(String key, LocalizedString value)
+ {
+ values.put(key, value);
+ }
+
+ public LocalizedString getMetaValue(String key)
+ {
+ return values.get(key);
+ }
+}
\ No newline at end of file
Added: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/info/ContainerModeInfo.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/info/ContainerModeInfo.java (rev 0)
+++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/info/ContainerModeInfo.java 2008-01-08 15:57:56 UTC (rev 9457)
@@ -0,0 +1,69 @@
+/******************************************************************************
+ * 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.portlet.impl.info;
+
+import org.jboss.portal.Mode;
+import org.jboss.portal.common.i18n.LocalizedString;
+import org.jboss.portal.portlet.info.ModeInfo;
+
+import java.util.Locale;
+
+/**
+ * @author <a href="mailto:chris.laprun@jboss.com">Chris Laprun</a>
+ * @version $Revision: 6818 $
+ * @since 2.4
+ */
+class ContainerModeInfo implements ModeInfo
+{
+
+ /** . */
+ private static final LocalizedString DEFAULT_DESCRIPTION = new LocalizedString("Default Portlet mode description.", Locale.ENGLISH);
+
+ /** . */
+ private final Mode mode;
+
+ public ContainerModeInfo(Mode mode)
+ {
+ if (mode == null)
+ {
+ throw new IllegalArgumentException();
+ }
+ this.mode = mode;
+ }
+
+ public LocalizedString getDescription()
+ {
+ return DEFAULT_DESCRIPTION; // fix-me
+ }
+
+ public Mode getMode()
+ {
+ return mode;
+ }
+
+ public String getModeName()
+ {
+ return mode.toString();
+ }
+}
\ No newline at end of file
Added: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/info/ContainerPortletInfo.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/info/ContainerPortletInfo.java (rev 0)
+++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/info/ContainerPortletInfo.java 2008-01-08 15:57:56 UTC (rev 9457)
@@ -0,0 +1,116 @@
+/******************************************************************************
+ * 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.portlet.impl.info;
+
+import org.jboss.portal.portlet.info.CacheInfo;
+import org.jboss.portal.portlet.info.CapabilitiesInfo;
+import org.jboss.portal.portlet.info.MetaInfo;
+import org.jboss.portal.portlet.info.PortletInfo;
+import org.jboss.portal.portlet.info.PreferencesInfo;
+import org.jboss.portal.portlet.info.SecurityInfo;
+import org.jboss.portal.portlet.info.SessionInfo;
+
+/**
+ * For now implementation that use the portlet container directly.
+ *
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @author <a href="mailto:chris.laprun@jboss.com">Chris Laprun</a>
+ * @version $Revision: 7242 $
+ */
+public class ContainerPortletInfo implements PortletInfo
+{
+
+ /** . */
+ private ContainerCapabilitiesInfo capabilities;
+
+ /** . */
+ private ContainerPreferencesInfo preferences;
+
+ /** . */
+ private ContainerMetaInfo meta;
+
+ /** . */
+ private ContainerSecurityInfo security;
+
+ /** . */
+ private ContainerCacheInfo cache;
+
+ /** . */
+ private ContainerSessionInfo session;
+
+ /** . */
+ private Boolean remotable;
+
+ public ContainerPortletInfo(
+ ContainerCapabilitiesInfo capabilities,
+ ContainerPreferencesInfo preferences,
+ ContainerMetaInfo meta,
+ ContainerSecurityInfo security,
+ ContainerCacheInfo cache,
+ ContainerSessionInfo session,
+ Boolean remotable)
+ {
+ this.capabilities = capabilities;
+ this.preferences = preferences;
+ this.meta = meta;
+ this.security = security;
+ this.cache = cache;
+ this.session = session;
+ this.remotable = remotable;
+ }
+
+ public CapabilitiesInfo getCapabilities()
+ {
+ return capabilities;
+ }
+
+ public PreferencesInfo getPreferences()
+ {
+ return preferences;
+ }
+
+ public MetaInfo getMeta()
+ {
+ return meta;
+ }
+
+ public SecurityInfo getSecurity()
+ {
+ return security;
+ }
+
+ public CacheInfo getCache()
+ {
+ return cache;
+ }
+
+ public SessionInfo getSession()
+ {
+ return session;
+ }
+
+ public Boolean isRemotable()
+ {
+ return remotable;
+ }
+}
\ No newline at end of file
Added: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/info/ContainerPreferenceInfo.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/info/ContainerPreferenceInfo.java (rev 0)
+++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/info/ContainerPreferenceInfo.java 2008-01-08 15:57:56 UTC (rev 9457)
@@ -0,0 +1,80 @@
+/******************************************************************************
+ * 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.portlet.impl.info;
+
+import org.jboss.portal.common.i18n.LocalizedString;
+import org.jboss.portal.common.value.Value;
+import org.jboss.portal.portlet.info.PreferenceInfo;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 6818 $
+ */
+public class ContainerPreferenceInfo implements PreferenceInfo
+{
+
+ private String key;
+ private LocalizedString displayName;
+ private LocalizedString description;
+ private Boolean readOnly;
+ private Value value;
+
+ public ContainerPreferenceInfo(String key, LocalizedString displayName, LocalizedString description, boolean readOnly, Value value)
+ {
+ this.key = key;
+ this.displayName = displayName;
+ this.description = description;
+ this.readOnly = Boolean.valueOf(readOnly);
+ this.value = value;
+ }
+
+ public String getKey()
+ {
+ return key;
+ }
+
+ public LocalizedString getDisplayName()
+ {
+ return displayName;
+ }
+
+ public LocalizedString getDescription()
+ {
+ return description;
+ }
+
+ public Boolean isReadOnly()
+ {
+ return readOnly;
+ }
+
+ /**
+ * Return the value provided by the portlet.xml deployment descriptor.
+ *
+ * @return the preference value associated with this preference meta data
+ */
+ public Value getDefaultValue()
+ {
+ return value;
+ }
+}
\ No newline at end of file
Added: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/info/ContainerPreferencesInfo.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/info/ContainerPreferencesInfo.java (rev 0)
+++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/info/ContainerPreferencesInfo.java 2008-01-08 15:57:56 UTC (rev 9457)
@@ -0,0 +1,84 @@
+/******************************************************************************
+ * 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.portlet.impl.info;
+
+import org.jboss.portal.common.i18n.LocalizedString;
+import org.jboss.portal.common.value.Value;
+import org.jboss.portal.portlet.info.PreferenceInfo;
+import org.jboss.portal.portlet.info.PreferencesInfo;
+
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Set;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @author <a href="mailto:chris.laprun@jboss.com">Chris Laprun</a>
+ * @version $Revision: 6818 $
+ */
+public class ContainerPreferencesInfo implements PreferencesInfo
+{
+
+ /** The cached container preference info. */
+ private final Map<String, PreferenceInfo> content;
+
+ /** . */
+ private final Set<String> keys;
+
+ public ContainerPreferencesInfo()
+ {
+ content = new HashMap<String, PreferenceInfo>();
+ keys = Collections.unmodifiableSet(content.keySet());
+ }
+
+ public ContainerPreferenceInfo getContainerPreference(String key)
+ {
+ if (key == null)
+ {
+ throw new IllegalArgumentException("Preference key must not be null");
+ }
+ return (ContainerPreferenceInfo)content.get(key);
+ }
+
+ public void addContainerPreference(
+ String name,
+ Value value,
+ boolean readOnly,
+ LocalizedString displayName,
+ LocalizedString description)
+ {
+ ContainerPreferenceInfo pref = new ContainerPreferenceInfo(name, displayName, description, readOnly, value);
+ content.put(pref.getKey(), pref);
+ }
+
+ public Set<String> getKeys()
+ {
+ return keys;
+ }
+
+ public PreferenceInfo getPreference(String key)
+ {
+ return getContainerPreference(key);
+ }
+}
\ No newline at end of file
Added: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/info/ContainerSecurityInfo.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/info/ContainerSecurityInfo.java (rev 0)
+++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/info/ContainerSecurityInfo.java 2008-01-08 15:57:56 UTC (rev 9457)
@@ -0,0 +1,68 @@
+/******************************************************************************
+ * 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.portlet.impl.info;
+
+import org.jboss.portal.portlet.TransportGuarantee;
+import org.jboss.portal.portlet.info.SecurityInfo;
+
+import java.util.Collections;
+import java.util.HashSet;
+import java.util.Set;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 6697 $
+ */
+public class ContainerSecurityInfo implements SecurityInfo
+{
+
+ /** . */
+ private final Set<TransportGuarantee> tgs;
+
+ /** . */
+ private final Set<TransportGuarantee> rotgs;
+
+ public ContainerSecurityInfo()
+ {
+ tgs = new HashSet<TransportGuarantee>();
+ tgs.add(TransportGuarantee.NONE);
+
+ //
+ rotgs = Collections.unmodifiableSet(tgs);
+ }
+
+ public void addTransportGuarantee(TransportGuarantee transportGuarantee)
+ {
+ tgs.add(transportGuarantee);
+ }
+
+ public boolean containsTransportGuarantee(TransportGuarantee transportGuarantee)
+ {
+ return tgs.contains(transportGuarantee);
+ }
+
+ public Set<TransportGuarantee> getTransportGuarantees()
+ {
+ return rotgs;
+ }
+}
\ No newline at end of file
Added: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/info/ContainerSessionInfo.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/info/ContainerSessionInfo.java (rev 0)
+++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/info/ContainerSessionInfo.java 2008-01-08 15:57:56 UTC (rev 9457)
@@ -0,0 +1,52 @@
+/******************************************************************************
+ * 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.portlet.impl.info;
+
+import org.jboss.portal.portlet.info.SessionInfo;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 7226 $
+ */
+public class ContainerSessionInfo implements SessionInfo
+{
+
+ /** . */
+ private boolean distributed;
+
+ ContainerSessionInfo(Boolean distributed)
+ {
+ if (distributed == null)
+ {
+ distributed = false;
+ }
+
+ //
+ this.distributed = distributed;
+ }
+
+ public Boolean getDistributed()
+ {
+ return distributed;
+ }
+}
\ No newline at end of file
Added: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/info/ContainerWindowStateInfo.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/info/ContainerWindowStateInfo.java (rev 0)
+++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/info/ContainerWindowStateInfo.java 2008-01-08 15:57:56 UTC (rev 9457)
@@ -0,0 +1,69 @@
+/******************************************************************************
+ * 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.portlet.impl.info;
+
+import org.jboss.portal.WindowState;
+import org.jboss.portal.common.i18n.LocalizedString;
+import org.jboss.portal.portlet.info.WindowStateInfo;
+
+import java.util.Locale;
+
+/**
+ * @author <a href="mailto:chris.laprun@jboss.com">Chris Laprun</a>
+ * @version $Revision: 6818 $
+ * @since 2.4
+ */
+class ContainerWindowStateInfo implements WindowStateInfo
+{
+
+ /** . */
+ private static final LocalizedString DEFAULT_DESCRIPTION = new LocalizedString("Default window state description.", Locale.ENGLISH);
+
+ /** . */
+ private final WindowState windowState;
+
+ public ContainerWindowStateInfo(WindowState windowState)
+ {
+ if (windowState == null)
+ {
+ throw new IllegalArgumentException();
+ }
+ this.windowState = windowState;
+ }
+
+ public LocalizedString getDescription()
+ {
+ return DEFAULT_DESCRIPTION; //fix-me
+ }
+
+ public WindowState getWindowState()
+ {
+ return windowState;
+ }
+
+ public String getWindowStateName()
+ {
+ return windowState.toString();
+ }
+}
\ No newline at end of file
Added: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/info/PortletInfoBuilder.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/info/PortletInfoBuilder.java (rev 0)
+++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/info/PortletInfoBuilder.java 2008-01-08 15:57:56 UTC (rev 9457)
@@ -0,0 +1,228 @@
+/******************************************************************************
+ * 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.portlet.impl.info;
+
+import org.jboss.portal.portlet.impl.metadata.portlet.PortletMetaData;
+import org.jboss.portal.portlet.impl.metadata.portlet.PortletPreferenceMetaData;
+import org.jboss.portal.portlet.impl.metadata.portlet.SupportedLocaleMetaData;
+import org.jboss.portal.portlet.impl.metadata.portlet.SupportsMetaData;
+import org.jboss.portal.portlet.impl.metadata.portlet.PortletModeMetaData;
+import org.jboss.portal.portlet.impl.metadata.security.SecurityConstraintMetaData;
+import org.jboss.portal.portlet.info.PortletInfo;
+import org.jboss.portal.portlet.info.MetaInfo;
+import org.jboss.portal.common.value.Value;
+import org.jboss.portal.common.value.StringValue;
+import org.jboss.portal.common.i18n.LocalizedString;
+import org.jboss.portal.common.i18n.ResourceBundleManager;
+import org.jboss.portal.Mode;
+
+import java.util.Locale;
+import java.util.Map;
+import java.util.HashMap;
+import java.util.List;
+import java.util.ResourceBundle;
+import java.util.MissingResourceException;
+import java.util.ArrayList;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 630 $
+ */
+public class PortletInfoBuilder
+{
+
+ /** . */
+ private static final String[] KEYS = {MetaInfo.TITLE, MetaInfo.SHORT_TITLE, MetaInfo.KEYWORDS};
+
+ /** . */
+ private static final String JAVAX_PORTLET = "javax.portlet.";
+
+ /** . */
+ private static final String[] BUNDLE_KEYS = {JAVAX_PORTLET + MetaInfo.TITLE, JAVAX_PORTLET + MetaInfo.SHORT_TITLE, JAVAX_PORTLET + MetaInfo.KEYWORDS};
+
+ /** . */
+ private PortletMetaData portletMD;
+
+ /** . */
+ private ResourceBundleManager bundleMgr;
+
+ public PortletInfoBuilder(PortletMetaData portletMD, ResourceBundleManager bundleMgr)
+ {
+ this.portletMD = portletMD;
+ this.bundleMgr = bundleMgr;
+ }
+
+ public PortletInfo build()
+ {
+ ContainerCapabilitiesInfo containerCapabilities = buildContainerCapabilities();
+ ContainerPreferencesInfo containerPreferences = buildContainerPreferences();
+ ContainerMetaInfo containerMeta = buildContainerMeta();
+ ContainerSecurityInfo containerSecurity = buildContainerSecurityInfo();
+ ContainerCacheInfo containerCache = buildContainerCache();
+ ContainerSessionInfo containerSession = buildContainerSession();
+
+ //
+ return new ContainerPortletInfo(
+ containerCapabilities,
+ containerPreferences,
+ containerMeta,
+ containerSecurity,
+ containerCache,
+ containerSession,
+ false
+ );
+ }
+
+ private List<Locale> getSupportedLocales()
+ {
+ List<Locale> locales = new ArrayList<Locale>();
+ for (SupportedLocaleMetaData supportedLocaleMD : portletMD.getSupportedLocale())
+ {
+ Locale locale = supportedLocaleMD.getLocale();
+ locales.add(locale);
+ }
+ return locales;
+ }
+
+ private ContainerSecurityInfo buildContainerSecurityInfo()
+ {
+ ContainerSecurityInfo containerSecurity = new ContainerSecurityInfo();
+
+ //
+ for (SecurityConstraintMetaData securityConstraintMD : portletMD.getPortletApplication().getSecurityConstraints())
+ {
+ if (securityConstraintMD.getPortletList().getPortletNames().contains(portletMD.getPortletName()))
+ {
+ containerSecurity.addTransportGuarantee(securityConstraintMD.getUserDataConstraint().getTransportQuarantee());
+ }
+ }
+
+ //
+ return containerSecurity;
+ }
+
+ private ContainerSessionInfo buildContainerSession()
+ {
+ return new ContainerSessionInfo(false);
+ }
+
+ private ContainerCacheInfo buildContainerCache()
+ {
+ int expirationCache = portletMD.getExpirationCache();
+
+ //
+ if (expirationCache < 0 && expirationCache != -1)
+ {
+ // log.warn("Seen bad caching expiration value " + expirationTimeSecs + " disable caching instead");
+ expirationCache = 0;
+ }
+
+ //
+ return new ContainerCacheInfo(expirationCache);
+ }
+
+ private ContainerCapabilitiesInfo buildContainerCapabilities()
+ {
+ ContainerCapabilitiesInfo capabilities = new ContainerCapabilitiesInfo();
+
+ //
+ for (SupportsMetaData supportsMD : portletMD.getSupports())
+ {
+ // Get the mime type
+ String mimeType = supportsMD.getMimeType().toLowerCase();
+
+ // Add the content type to the view mode
+ // because each content type must handle this view
+ capabilities.add(mimeType, Mode.VIEW);
+
+ // Then process each mode
+ for (PortletModeMetaData modeMD : supportsMD.getPortletModes())
+ {
+ capabilities.add(mimeType, Mode.create(modeMD.getPortletMode()));
+ }
+ }
+
+ //
+ return capabilities;
+ }
+
+ private ContainerMetaInfo buildContainerMeta()
+ {
+ ContainerMetaInfo containerMeta = new ContainerMetaInfo();
+
+ // Construct info from resource bundle manager
+ if (bundleMgr != null)
+ {
+ for (int i = 0; i < KEYS.length; i++)
+ {
+ String key = KEYS[i];
+ Map<Locale, String> tmp = new HashMap<Locale, String>();
+
+ //
+ List<Locale> locales = getSupportedLocales();
+
+ // Add english locale
+ locales.add(Locale.ENGLISH);
+
+ for (Locale locale : locales)
+ {
+ ResourceBundle bundle = bundleMgr.getResourceBundle(locale);
+ try
+ {
+ String value = bundle.getString(BUNDLE_KEYS[i]);
+ tmp.put(locale, value);
+ }
+ catch (MissingResourceException ignore)
+ {
+ }
+ }
+ LocalizedString ls = new LocalizedString(tmp, Locale.ENGLISH);
+ containerMeta.addMetaValue(key, ls);
+ }
+ }
+
+ // Add stuff coming from meta data
+ containerMeta.addMetaValue(MetaInfo.DESCRIPTION, portletMD.getDescription());
+ containerMeta.addMetaValue(MetaInfo.DISPLAY_NAME, portletMD.getDisplayName());
+
+ //
+ return containerMeta;
+ }
+
+ private ContainerPreferencesInfo buildContainerPreferences()
+ {
+ ContainerPreferencesInfo containerPreferences = new ContainerPreferencesInfo();
+
+ //
+ for (PortletPreferenceMetaData portletPreferenceMD : portletMD.getPortletPreferences().getPortletPreferences().values())
+ {
+ Value value = new StringValue(portletPreferenceMD.getValue().toArray(new String[portletPreferenceMD.getValue().size()]));
+ LocalizedString displayName = bundleMgr.getLocalizedValue("javax.portlet.preference.name." + portletPreferenceMD.getName(), portletPreferenceMD.getName());
+ LocalizedString description = bundleMgr.getLocalizedValue("javax.portlet.preference.description." + portletPreferenceMD.getName(), portletPreferenceMD.getName());
+ containerPreferences.addContainerPreference(portletPreferenceMD.getName(), value, portletPreferenceMD.isReadOnly(), displayName, description);
+ }
+
+ //
+ return containerPreferences;
+ }
+}
18 years, 3 months
JBoss Portal SVN: r9456 - in modules/portlet/trunk: portlet/src/main/java/org/jboss/portal/portlet/impl/metadata/adapter and 4 other directories.
by portal-commits@lists.jboss.org
Author: emuckenhuber
Date: 2008-01-08 10:23:51 -0500 (Tue, 08 Jan 2008)
New Revision: 9456
Added:
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/metadata/adapter/LocaleAdapter.java
Removed:
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/metadata/security/TransportGuaranteeEnum.java
Modified:
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/metadata/PortletApplication10MetaData.java
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/metadata/adapter/ContainerRuntimeAdapter.java
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/metadata/adapter/CustomPortletModeAdapter.java
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/metadata/adapter/CustomWindowStateAdapter.java
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/metadata/adapter/EventListAdapter.java
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/metadata/adapter/FilterAdapter.java
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/metadata/adapter/FilterMappingAdapter.java
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/metadata/adapter/LocalizedStringAdapter.java
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/metadata/adapter/PortletListAdapter.java
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/metadata/adapter/PortletPreferencesListAdapter.java
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/metadata/adapter/UserAttributeAdapter.java
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/metadata/portlet/PortletMetaData.java
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/metadata/portlet/SupportedLocaleMetaData.java
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/metadata/security/UserDataConstraintMetaData.java
modules/portlet/trunk/test/src/test/java/org/jboss/portal/portlet/test/metadata/PortletTestEverythingTestCase.java
modules/portlet/trunk/test/src/test/java/org/jboss/portal/portlet/test/metadata/SecurityConstraintTestEverythingTestCase.java
modules/portlet/trunk/test/src/test/java/org/jboss/portal/portlet/test/metadata/factory/PortletApplicationModelFactory.java
Log:
- reference to portletApp in portletMD
- use portal.TransportGuarantee
- added LocaleAdapter
Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/metadata/PortletApplication10MetaData.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/metadata/PortletApplication10MetaData.java 2008-01-08 10:10:28 UTC (rev 9455)
+++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/metadata/PortletApplication10MetaData.java 2008-01-08 15:23:51 UTC (rev 9456)
@@ -106,6 +106,11 @@
public void setPortlets(Map<String, PortletMetaData> portlets)
{
+ // Adding reference to the portlet application metadata
+ for( PortletMetaData p : portlets.values())
+ {
+ p.setPortletApplication(this);
+ }
this.portlets = portlets;
}
@@ -125,6 +130,8 @@
{
this.portlets = new LinkedHashMap<String, PortletMetaData>();
}
+ // Adding reference to the portlet application metadata
+ portlet.setPortletApplication(this);
this.portlets.put(portlet.getPortletName(), portlet);
}
Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/metadata/adapter/ContainerRuntimeAdapter.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/metadata/adapter/ContainerRuntimeAdapter.java 2008-01-08 10:10:28 UTC (rev 9455)
+++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/metadata/adapter/ContainerRuntimeAdapter.java 2008-01-08 15:23:51 UTC (rev 9456)
@@ -41,7 +41,7 @@
@Override
public List<ContainerRuntimeMetaData> marshal(Map<String, ContainerRuntimeMetaData> map) throws Exception
{
- throw new RuntimeException("Not yet implemented.");
+ throw new UnsupportedOperationException();
}
@Override
Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/metadata/adapter/CustomPortletModeAdapter.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/metadata/adapter/CustomPortletModeAdapter.java 2008-01-08 10:10:28 UTC (rev 9455)
+++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/metadata/adapter/CustomPortletModeAdapter.java 2008-01-08 15:23:51 UTC (rev 9456)
@@ -40,8 +40,7 @@
@Override
public List<CustomPortletModeMetaData> marshal(Map<String, CustomPortletModeMetaData> map) throws Exception
{
- // FIXME marshal
- return null;
+ throw new UnsupportedOperationException();
}
@Override
Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/metadata/adapter/CustomWindowStateAdapter.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/metadata/adapter/CustomWindowStateAdapter.java 2008-01-08 10:10:28 UTC (rev 9455)
+++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/metadata/adapter/CustomWindowStateAdapter.java 2008-01-08 15:23:51 UTC (rev 9456)
@@ -40,8 +40,7 @@
@Override
public List<CustomWindowStateMetaData> marshal(Map<String, CustomWindowStateMetaData> map) throws Exception
{
- // FIXME marshal
- return null;
+ throw new UnsupportedOperationException();
}
@Override
Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/metadata/adapter/EventListAdapter.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/metadata/adapter/EventListAdapter.java 2008-01-08 10:10:28 UTC (rev 9455)
+++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/metadata/adapter/EventListAdapter.java 2008-01-08 15:23:51 UTC (rev 9456)
@@ -40,7 +40,7 @@
@Override
public EventDefinitionMetaData[] marshal(Map<String, EventDefinitionMetaData> eventMap) throws Exception
{
- throw new RuntimeException("Not yet implemented.");
+ throw new UnsupportedOperationException();
}
@Override
Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/metadata/adapter/FilterAdapter.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/metadata/adapter/FilterAdapter.java 2008-01-08 10:10:28 UTC (rev 9455)
+++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/metadata/adapter/FilterAdapter.java 2008-01-08 15:23:51 UTC (rev 9456)
@@ -41,7 +41,7 @@
@Override
public List<FilterMetaData> marshal(Map<String, FilterMetaData> map) throws Exception
{
- throw new RuntimeException("Not yet implemented.");
+ throw new UnsupportedOperationException();
}
@Override
Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/metadata/adapter/FilterMappingAdapter.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/metadata/adapter/FilterMappingAdapter.java 2008-01-08 10:10:28 UTC (rev 9455)
+++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/metadata/adapter/FilterMappingAdapter.java 2008-01-08 15:23:51 UTC (rev 9456)
@@ -41,7 +41,7 @@
@Override
public List<FilterMappingMetaData> marshal(Map<String, FilterMappingMetaData> arg0) throws Exception
{
- throw new RuntimeException("Not yet implemented.");
+ throw new UnsupportedOperationException();
}
@Override
Added: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/metadata/adapter/LocaleAdapter.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/metadata/adapter/LocaleAdapter.java (rev 0)
+++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/metadata/adapter/LocaleAdapter.java 2008-01-08 15:23:51 UTC (rev 9456)
@@ -0,0 +1,49 @@
+/******************************************************************************
+ * 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.portlet.impl.metadata.adapter;
+
+import java.util.Locale;
+
+import javax.xml.bind.annotation.adapters.XmlAdapter;
+
+/**
+ * @author <a href="mailto:emuckenh@redhat.com">Emanuel Muckenhuber</a>
+ * @version $Revision$
+ */
+public class LocaleAdapter extends XmlAdapter<String, Locale>
+{
+
+ @Override
+ public String marshal(Locale arg0) throws Exception
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public Locale unmarshal(String arg0) throws Exception
+ {
+ return new Locale(arg0);
+ }
+
+}
+
Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/metadata/adapter/LocalizedStringAdapter.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/metadata/adapter/LocalizedStringAdapter.java 2008-01-08 10:10:28 UTC (rev 9455)
+++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/metadata/adapter/LocalizedStringAdapter.java 2008-01-08 15:23:51 UTC (rev 9456)
@@ -45,7 +45,7 @@
@Override
public List<LocalizedDescriptionMetaData> marshal(LocalizedString arg0) throws Exception
{
- throw new RuntimeException("Not yet implemented.");
+ throw new UnsupportedOperationException();
}
@Override
Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/metadata/adapter/PortletListAdapter.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/metadata/adapter/PortletListAdapter.java 2008-01-08 10:10:28 UTC (rev 9455)
+++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/metadata/adapter/PortletListAdapter.java 2008-01-08 15:23:51 UTC (rev 9456)
@@ -41,7 +41,7 @@
@Override
public List<PortletMetaData> marshal(Map<String, PortletMetaData> portletMap) throws Exception
{
- throw new RuntimeException("Not yet implemented.");
+ throw new UnsupportedOperationException();
}
@Override
Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/metadata/adapter/PortletPreferencesListAdapter.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/metadata/adapter/PortletPreferencesListAdapter.java 2008-01-08 10:10:28 UTC (rev 9455)
+++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/metadata/adapter/PortletPreferencesListAdapter.java 2008-01-08 15:23:51 UTC (rev 9456)
@@ -41,7 +41,7 @@
@Override
public List<PortletPreferenceMetaData> marshal(Map<String, PortletPreferenceMetaData> arg0) throws Exception
{
- throw new RuntimeException("Not yet implemented.");
+ throw new UnsupportedOperationException();
}
@Override
Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/metadata/adapter/UserAttributeAdapter.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/metadata/adapter/UserAttributeAdapter.java 2008-01-08 10:10:28 UTC (rev 9455)
+++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/metadata/adapter/UserAttributeAdapter.java 2008-01-08 15:23:51 UTC (rev 9456)
@@ -42,7 +42,7 @@
@Override
public List<UserAttributeMetaData> marshal(Map<String, UserAttributeMetaData> arg0) throws Exception
{
- throw new RuntimeException("Not yet implemented.");
+ throw new UnsupportedOperationException();
}
@Override
Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/metadata/portlet/PortletMetaData.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/metadata/portlet/PortletMetaData.java 2008-01-08 10:10:28 UTC (rev 9455)
+++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/metadata/portlet/PortletMetaData.java 2008-01-08 15:23:51 UTC (rev 9456)
@@ -34,6 +34,7 @@
import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
import org.jboss.portal.common.i18n.LocalizedString;
+import org.jboss.portal.portlet.impl.metadata.PortletApplication10MetaData;
import org.jboss.portal.portlet.impl.metadata.PortletMetaDataConstants;
import org.jboss.portal.portlet.impl.metadata.event.EventDefinitionReferenceMetaData;
import org.jboss.portal.portlet.impl.metadata.adapter.LocalizedStringAdapter;
@@ -104,6 +105,9 @@
/** The portlet container runtime options */
private Map<String, ContainerRuntimeMetaData> containerRuntimeOptions;
+
+ /** Reference to the PortletApplicationMetaData */
+ private PortletApplication10MetaData portletApplication;
public PortletMetaData() {}
@@ -384,4 +388,15 @@
}
this.containerRuntimeOptions.put(containerRuntimeOption.getName(), containerRuntimeOption);
}
+
+ /** . */
+ public PortletApplication10MetaData getPortletApplication()
+ {
+ return portletApplication;
+ }
+
+ public void setPortletApplication(PortletApplication10MetaData portletApplication)
+ {
+ this.portletApplication = portletApplication;
+ }
}
Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/metadata/portlet/SupportedLocaleMetaData.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/metadata/portlet/SupportedLocaleMetaData.java 2008-01-08 10:10:28 UTC (rev 9455)
+++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/metadata/portlet/SupportedLocaleMetaData.java 2008-01-08 15:23:51 UTC (rev 9456)
@@ -22,9 +22,14 @@
******************************************************************************/
package org.jboss.portal.portlet.impl.metadata.portlet;
+import java.util.Locale;
+
import javax.xml.bind.annotation.XmlType;
import javax.xml.bind.annotation.XmlValue;
+import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
+import org.jboss.portal.portlet.impl.metadata.adapter.LocaleAdapter;
+
/**
* @author <a href="mailto:emuckenh@redhat.com">Emanuel Muckenhuber</a>
* @version $Revision$
@@ -34,15 +39,16 @@
{
/** The supported locale */
- private String locale;
+ private Locale locale;
@XmlValue
- public String getLocale()
+ @XmlJavaTypeAdapter(LocaleAdapter.class)
+ public Locale getLocale()
{
return locale;
}
- public void setLocale(String locale)
+ public void setLocale(Locale locale)
{
this.locale = locale;
}
Deleted: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/metadata/security/TransportGuaranteeEnum.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/metadata/security/TransportGuaranteeEnum.java 2008-01-08 10:10:28 UTC (rev 9455)
+++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/metadata/security/TransportGuaranteeEnum.java 2008-01-08 15:23:51 UTC (rev 9456)
@@ -1,51 +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.portlet.impl.metadata.security;
-
-import javax.xml.bind.annotation.XmlEnum;
-
-/**
- * In most cases, the presence of the INTEGRAL or CONFIDENTIAL
- * flag will indicate that the use of SSL is required.
- *
- * @author <a href="mailto:emuckenh@redhat.com">Emanuel Muckenhuber</a>
- * @version $Revision$
- */
-
-@XmlEnum
-public enum TransportGuaranteeEnum {
-
- /** does not require any transport guarantees */
- NONE,
- /**
- * requires the data sent between the client and the portlet
- * in such way that it can't be changed in transit
- */
- INTEGRAL,
- /**
- * requires that the data be transmitted in a fashion that prevents
- * other entities from observing the contents of the transmission
- */
- CONFIDENTIAL
-
-}
Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/metadata/security/UserDataConstraintMetaData.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/metadata/security/UserDataConstraintMetaData.java 2008-01-08 10:10:28 UTC (rev 9455)
+++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/metadata/security/UserDataConstraintMetaData.java 2008-01-08 15:23:51 UTC (rev 9456)
@@ -26,6 +26,7 @@
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlType;
+import org.jboss.portal.portlet.TransportGuarantee;
import org.jboss.portal.portlet.impl.metadata.common.DescribableMetaData;
/**
@@ -40,7 +41,7 @@
private String id;
/** The user transport quarantee */
- private TransportGuaranteeEnum transportQuarantee;
+ private TransportGuarantee transportQuarantee;
public UserDataConstraintMetaData() {}
@@ -61,12 +62,12 @@
}
@XmlElement(name = "transport-guarantee")
- public TransportGuaranteeEnum getTransportQuarantee()
+ public TransportGuarantee getTransportQuarantee()
{
return transportQuarantee;
}
- public void setTransportQuarantee(TransportGuaranteeEnum transportQuarantee)
+ public void setTransportQuarantee(TransportGuarantee transportQuarantee)
{
this.transportQuarantee = transportQuarantee;
}
Modified: modules/portlet/trunk/test/src/test/java/org/jboss/portal/portlet/test/metadata/PortletTestEverythingTestCase.java
===================================================================
--- modules/portlet/trunk/test/src/test/java/org/jboss/portal/portlet/test/metadata/PortletTestEverythingTestCase.java 2008-01-08 10:10:28 UTC (rev 9455)
+++ modules/portlet/trunk/test/src/test/java/org/jboss/portal/portlet/test/metadata/PortletTestEverythingTestCase.java 2008-01-08 15:23:51 UTC (rev 9456)
@@ -64,6 +64,7 @@
PortletMetaData p1 = md.getPortlet("Portlet1");
assertNotNull(p1);
+ assertEquals(md, p1.getPortletApplication());
assertEquals("fragmichnicht", p1.getId());
assertEquals("Portlet1", p1.getPortletName());
assertEquals(default_locale, p1.getDescription().getDefaultLocale());
@@ -105,8 +106,8 @@
assertEquals("MyResourceBundle", p1.getResourceBundle());
List<SupportedLocaleMetaData> localeList = p1.getSupportedLocale();
- assertEquals("en", localeList.get(0).getLocale());
- assertEquals("fr", localeList.get(1).getLocale());
+ assertEquals(new Locale("en"), localeList.get(0).getLocale());
+ assertEquals(new Locale("fr"), localeList.get(1).getLocale());
PortletInfoMetaData pimd = p1.getPortletInfo();
assertNotNull(pimd);
@@ -144,18 +145,22 @@
PortletMetaData p2 = md.getPortlet("Portlet2");
assertNotNull(p2);
+ assertEquals(md, p2.getPortletApplication());
assertEquals("org.jboss.portal.test.portlet.TestSessionPortlet", p2.getPortletClass());
assertEquals("text/html", p2.getSupports().get(0).getMimeType());
assertEquals("test the portlet session", p2.getPortletInfo().getTitle());
PortletMetaData p3 = md.getPortlet("Portlet3");
assertNotNull(p3);
+ assertEquals(md, p3.getPortletApplication());
PortletMetaData p4 = md.getPortlet("Portlet4");
assertNotNull(p4);
+ assertEquals(md, p4.getPortletApplication());
PortletMetaData p5 = md.getPortlet("Portlet5");
assertNotNull(p5);
+ assertEquals(md, p5.getPortletApplication());
PortletPreferencesMetaData ppmd5 = p5.getPortletPreferences();
assertEquals("1", ppmd5.getPortletPreferences().get("one").getValue().get(0));
assertEquals("2", ppmd5.getPortletPreferences().get("two").getValue().get(0));
@@ -168,9 +173,10 @@
PortletMetaData p6 = md.getPortlet("Portlet6");
assertNotNull(p6);
+ assertEquals(md, p6.getPortletApplication());
assertEquals("Portlet6", p6.getResourceBundle());
- assertEquals("en", p6.getSupportedLocale().get(0).getLocale());
- assertEquals("fr", p6.getSupportedLocale().get(1).getLocale());
+ assertEquals(new Locale("en"), p6.getSupportedLocale().get(0).getLocale());
+ assertEquals(new Locale("fr"), p6.getSupportedLocale().get(1).getLocale());
PortletMetaData p7 = md.getPortlet("Portlet7");
assertNotNull(p7);
@@ -261,8 +267,8 @@
assertEquals("HELP", smd2.getPortletModes().get(1).getPortletMode());
List<SupportedLocaleMetaData> localeList = p1.getSupportedLocale();
- assertEquals("en", localeList.get(0).getLocale());
- assertEquals("fr", localeList.get(1).getLocale());
+ assertEquals(new Locale("en"), localeList.get(0).getLocale());
+ assertEquals(new Locale("fr"), localeList.get(1).getLocale());
assertEquals("MyResourceBundle", p1.getResourceBundle());
@@ -326,8 +332,8 @@
PortletMetaData p6 = md.getPortlet("Portlet6");
assertNotNull(p6);
assertEquals("Portlet6", p6.getResourceBundle());
- assertEquals("en", p6.getSupportedLocale().get(0).getLocale());
- assertEquals("fr", p6.getSupportedLocale().get(1).getLocale());
+ assertEquals(new Locale("en"), p6.getSupportedLocale().get(0).getLocale());
+ assertEquals(new Locale("fr"), p6.getSupportedLocale().get(1).getLocale());
PortletMetaData p7 = md.getPortlet("Portlet7");
assertNotNull(p7);
@@ -421,8 +427,8 @@
assertEquals("CUSTOM", smd2.getWindowStates().get(1).getWindowState());
List<SupportedLocaleMetaData> localeList = p1.getSupportedLocale();
- assertEquals("en", localeList.get(0).getLocale());
- assertEquals("fr", localeList.get(1).getLocale());
+ assertEquals(new Locale("en"), localeList.get(0).getLocale());
+ assertEquals(new Locale("fr"), localeList.get(1).getLocale());
assertEquals("MyResourceBundle", p1.getResourceBundle());
Modified: modules/portlet/trunk/test/src/test/java/org/jboss/portal/portlet/test/metadata/SecurityConstraintTestEverythingTestCase.java
===================================================================
--- modules/portlet/trunk/test/src/test/java/org/jboss/portal/portlet/test/metadata/SecurityConstraintTestEverythingTestCase.java 2008-01-08 10:10:28 UTC (rev 9455)
+++ modules/portlet/trunk/test/src/test/java/org/jboss/portal/portlet/test/metadata/SecurityConstraintTestEverythingTestCase.java 2008-01-08 15:23:51 UTC (rev 9456)
@@ -24,11 +24,11 @@
import java.util.Locale;
+import org.jboss.portal.portlet.TransportGuarantee;
import org.jboss.portal.portlet.impl.metadata.PortletApplication10MetaData;
import org.jboss.portal.portlet.impl.metadata.PortletApplication20MetaData;
import org.jboss.portal.portlet.impl.metadata.portlet.PortletMetaData;
import org.jboss.portal.portlet.impl.metadata.security.SecurityConstraintMetaData;
-import org.jboss.portal.portlet.impl.metadata.security.TransportGuaranteeEnum;
import org.jboss.unit.api.pojo.annotations.Test;
import static org.jboss.unit.api.Assert.*;
@@ -56,7 +56,7 @@
assertNotNull(scd1);
assertEquals("test", scd1.getDisplayName().getDefaultString());
assertEquals("Test", scd1.getDisplayName().getString(new Locale("de"), false));
- assertEquals(TransportGuaranteeEnum.NONE, scd1.getUserDataConstraint().getTransportQuarantee());
+ assertEquals(TransportGuarantee.NONE, scd1.getUserDataConstraint().getTransportQuarantee());
assertEquals("foo", scd1.getPortletList().getPortletNames().get(0));
assertEquals("foobar", scd1.getPortletList().getPortletNames().get(1));
@@ -64,11 +64,11 @@
SecurityConstraintMetaData scd2 = md.getSecurityConstraints().get(1);
assertNotNull(scd2);
- assertEquals(TransportGuaranteeEnum.INTEGRAL, scd2.getUserDataConstraint().getTransportQuarantee());
+ assertEquals(TransportGuarantee.INTEGRAL, scd2.getUserDataConstraint().getTransportQuarantee());
assertEquals("foo", scd2.getPortletList().getPortletNames().get(0));
assertEquals("fooConstraint", scd1.getUserDataConstraint().getDescription().getDefaultString());
assertEquals("FooConstraint", scd1.getUserDataConstraint().getDescription().getString(new Locale("de"), false));
-
+
try
{
scd2.getPortletList().getPortletNames().get(1);
@@ -148,14 +148,14 @@
assertEquals("Test", scd1.getDisplayName().getString(new Locale("de"), false));
assertEquals("foo", scd1.getId());
- assertEquals(TransportGuaranteeEnum.NONE, scd1.getUserDataConstraint().getTransportQuarantee());
+ assertEquals(TransportGuarantee.NONE, scd1.getUserDataConstraint().getTransportQuarantee());
assertEquals("foo", scd1.getPortletList().getPortletNames().get(0));
assertEquals("foobar", scd1.getPortletList().getPortletNames().get(1));
SecurityConstraintMetaData scd2 = md.getSecurityConstraints().get(1);
assertNotNull(scd2);
- assertEquals(TransportGuaranteeEnum.INTEGRAL, scd2.getUserDataConstraint().getTransportQuarantee());
+ assertEquals(TransportGuarantee.INTEGRAL, scd2.getUserDataConstraint().getTransportQuarantee());
assertEquals("foo", scd2.getPortletList().getPortletNames().get(0));
assertEquals("fooConstraint", scd1.getUserDataConstraint().getDescription().getDefaultString());
assertEquals("FooConstraint", scd1.getUserDataConstraint().getDescription().getString(new Locale("de"), false));
Modified: modules/portlet/trunk/test/src/test/java/org/jboss/portal/portlet/test/metadata/factory/PortletApplicationModelFactory.java
===================================================================
--- modules/portlet/trunk/test/src/test/java/org/jboss/portal/portlet/test/metadata/factory/PortletApplicationModelFactory.java 2008-01-08 10:10:28 UTC (rev 9455)
+++ modules/portlet/trunk/test/src/test/java/org/jboss/portal/portlet/test/metadata/factory/PortletApplicationModelFactory.java 2008-01-08 15:23:51 UTC (rev 9456)
@@ -24,9 +24,11 @@
import java.net.URI;
import java.net.URISyntaxException;
+import java.util.Locale;
import org.apache.log4j.Logger;
import org.jboss.portal.common.i18n.LocalizedString;
+import org.jboss.portal.portlet.TransportGuarantee;
import org.jboss.portal.portlet.impl.metadata.CustomPortletModeMetaData;
import org.jboss.portal.portlet.impl.metadata.CustomWindowStateMetaData;
import org.jboss.portal.portlet.impl.metadata.ListenerMetaData;
@@ -56,7 +58,6 @@
import org.jboss.portal.portlet.impl.metadata.portlet.WindowStateMetaData;
import org.jboss.portal.portlet.impl.metadata.security.PortletCollectionMetaData;
import org.jboss.portal.portlet.impl.metadata.security.SecurityConstraintMetaData;
-import org.jboss.portal.portlet.impl.metadata.security.TransportGuaranteeEnum;
import org.jboss.portal.portlet.impl.metadata.security.UserDataConstraintMetaData;
import org.jboss.xb.binding.GenericObjectModelFactory;
import org.jboss.xb.binding.UnmarshallingContext;
@@ -602,7 +603,7 @@
SupportedLocaleMetaData md = (SupportedLocaleMetaData) object;
if ("supported-locale".equals(localName))
{
- md.setLocale(value);
+ md.setLocale(new Locale(value));
}
}
@@ -720,7 +721,7 @@
UserDataConstraintMetaData md = (UserDataConstraintMetaData) object;
if ("transport-guarantee".equals(localName))
{
- md.setTransportQuarantee(TransportGuaranteeEnum.valueOf(value));
+ md.setTransportQuarantee(TransportGuarantee.valueOf(value));
}
}
18 years, 3 months
JBoss Portal SVN: r9455 - in modules/identity/trunk: identity and 1 other directory.
by portal-commits@lists.jboss.org
Author: bdaw
Date: 2008-01-08 05:10:28 -0500 (Tue, 08 Jan 2008)
New Revision: 9455
Modified:
modules/identity/trunk/build/pom.xml
modules/identity/trunk/identity/build.xml
modules/identity/trunk/identity/pom.xml
Log:
- update versions of common and test modules
- fix ant usage
Modified: modules/identity/trunk/build/pom.xml
===================================================================
--- modules/identity/trunk/build/pom.xml 2008-01-08 09:57:40 UTC (rev 9454)
+++ modules/identity/trunk/build/pom.xml 2008-01-08 10:10:28 UTC (rev 9455)
@@ -9,27 +9,27 @@
the property
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
- <parent>
- <groupId>org.jboss.portal</groupId>
- <artifactId>jboss-portal-parent</artifactId>
- <version>1-SNAPSHOT</version>
- </parent>
- <modelVersion>4.0.0</modelVersion>
- <groupId>org.jboss.portal.identity</groupId>
- <artifactId>jboss-portal-modules-identity</artifactId>
- <version>1.1.0-SNAPSHOT</version>
- <packaging>pom</packaging>
- <name>JBoss Portal Identity</name>
- <url>http://www.jboss.com/products/jbossmc</url>
- <description>JBoss Portal Identity Module</description>
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <parent>
+ <groupId>org.jboss.portal</groupId>
+ <artifactId>jboss-portal-parent</artifactId>
+ <version>1-SNAPSHOT</version>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>org.jboss.portal.identity</groupId>
+ <artifactId>jboss-portal-modules-identity</artifactId>
+ <version>1.1.0-SNAPSHOT</version>
+ <packaging>pom</packaging>
+ <name>JBoss Portal Identity</name>
+ <url>http://www.jboss.com/products/jbossmc</url>
+ <description>JBoss Portal Identity Module</description>
<properties>
<version.junit>3.8.1</version.junit>
<version.cargo>0.9-portal</version.cargo>
<version.ant>1.6.5</version.ant>
- <version.jboss.portal.common>1.1.0-SNAPSHOT</version.jboss.portal.common>
- <version.jboss.portal.test>1.1.0-SNAPSHOT</version.jboss.portal.test>
+ <version.jboss.portal.common>1.2.0-SNAPSHOT</version.jboss.portal.common>
+ <version.jboss.portal.test>1.2.0-SNAPSHOT</version.jboss.portal.test>
<version.jboss.microcontainer>2.0.0.Beta4</version.jboss.microcontainer>
<version.sun.opends>1.0.0-BUILD04</version.sun.opends>
<version.jboss.jbossas.core-libs>4.0.4.GA</version.jboss.jbossas.core-libs>
@@ -93,19 +93,6 @@
</plugins>
</build>
-
- <repositories>
- <!--<repository>-->
- <!--<id>repository.codehaus.org</id>-->
- <!--<name>Codehaus Repository</name>-->
- <!--<layout>default</layout>-->
- <!--<url>http://repository.codehaus.org</url>-->
- <!--<snapshots>-->
- <!--<enabled>false</enabled>-->
- <!--</snapshots>-->
- <!--</repository>-->
-
- </repositories>
<pluginRepositories>
<pluginRepository>
<id>java.net maven repository</id>
Modified: modules/identity/trunk/identity/build.xml
===================================================================
--- modules/identity/trunk/identity/build.xml 2008-01-08 09:57:40 UTC (rev 9454)
+++ modules/identity/trunk/identity/build.xml 2008-01-08 10:10:28 UTC (rev 9455)
@@ -65,13 +65,13 @@
<target name="deploy-opends">
<!--Filterout opends.sar-->
- <echo>Copying OpenDS service archive to: ${jboss_home}/server/default/deploy</echo>
- <copy todir="${jboss_home}/server/default/deploy/" file="${dependency.opends.sar}">
+ <echo>Copying OpenDS service archive to: ${JBOSS_HOME}/server/default/deploy</echo>
+ <copy todir="${JBOSS_HOME}/server/default/deploy/" file="${dependency.opends.sar}">
</copy>
- <echo>Copying OpenDS configuration files to: ${jboss_home}/server/default/conf/</echo>
- <copy todir="${jboss_home}/server/default/conf/opends">
+ <echo>Copying OpenDS configuration files to: ${JBOSS_HOME}/server/default/conf/</echo>
+ <copy todir="${JBOSS_HOME}/server/default/conf/opends">
<fileset dir="./src/test/resources/opends"/>
</copy>
@@ -80,11 +80,11 @@
</target>
<target name="undeploy-opends">
- <echo>Removing OpenDS configuration files from: ${jboss_home}/server/default/conf/opends</echo>
- <delete dir="${jboss_home}/server/default/conf/opends" failonerror="false" deleteonexit="true" quiet="true"/>
+ <echo>Removing OpenDS configuration files from: ${JBOSS_HOME}/server/default/conf/opends</echo>
+ <delete dir="${JBOSS_HOME}/server/default/conf/opends" failonerror="false" deleteonexit="true" quiet="true"/>
- <echo>Removing OpenDS service archive from: ${jboss_home}/server/default/deploy/opends.sar</echo>
- <delete file="${jboss_home}/server/default/deploy/opends-*.sar" failonerror="false" deleteonexit="true" quiet="true"/>
+ <echo>Removing OpenDS service archive from: ${JBOSS_HOME}/server/default/deploy/opends.sar</echo>
+ <delete file="${JBOSS_HOME}/server/default/deploy/opends-*.sar" failonerror="false" deleteonexit="true" quiet="true"/>
</target>
Modified: modules/identity/trunk/identity/pom.xml
===================================================================
--- modules/identity/trunk/identity/pom.xml 2008-01-08 09:57:40 UTC (rev 9454)
+++ modules/identity/trunk/identity/pom.xml 2008-01-08 10:10:28 UTC (rev 9455)
@@ -157,7 +157,7 @@
<plugin>
<groupId>org.jvnet.maven-antrun-extended-plugin</groupId>
<artifactId>maven-antrun-extended-plugin</artifactId>
- <version>1.9-SNAPSHOT</version>
+ <version>1.13</version>
<dependencies>
<dependency>
<groupId>cargo</groupId>
18 years, 3 months
JBoss Portal SVN: r9454 - in modules/portlet/trunk: bridge and 7 other directories.
by portal-commits@lists.jboss.org
Author: bdaw
Date: 2008-01-08 04:57:40 -0500 (Tue, 08 Jan 2008)
New Revision: 9454
Modified:
modules/portlet/trunk/bridge/pom.xml
modules/portlet/trunk/build/pom.xml
modules/portlet/trunk/federation/pom.xml
modules/portlet/trunk/jsr168api/pom.xml
modules/portlet/trunk/management/pom.xml
modules/portlet/trunk/pom.xml
modules/portlet/trunk/portlet/pom.xml
modules/portlet/trunk/test/pom.xml
modules/portlet/trunk/test/src/test/build.xml
Log:
- update version to 1.2.0-SNAPSHOT
- do not ever use SNAPSHOT versions of external plugins....
Modified: modules/portlet/trunk/bridge/pom.xml
===================================================================
--- modules/portlet/trunk/bridge/pom.xml 2008-01-08 09:26:05 UTC (rev 9453)
+++ modules/portlet/trunk/bridge/pom.xml 2008-01-08 09:57:40 UTC (rev 9454)
@@ -3,7 +3,7 @@
<parent>
<groupId>org.jboss.portal.portlet</groupId>
<artifactId>jboss-portal-modules-portlet</artifactId>
- <version>1.1.0-SNAPSHOT</version>
+ <version>1.2.0-SNAPSHOT</version>
<relativePath>../build/pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Modified: modules/portlet/trunk/build/pom.xml
===================================================================
--- modules/portlet/trunk/build/pom.xml 2008-01-08 09:26:05 UTC (rev 9453)
+++ modules/portlet/trunk/build/pom.xml 2008-01-08 09:57:40 UTC (rev 9454)
@@ -18,7 +18,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>org.jboss.portal.portlet</groupId>
<artifactId>jboss-portal-modules-portlet</artifactId>
- <version>1.1.0-SNAPSHOT</version>
+ <version>1.2.0-SNAPSHOT</version>
<packaging>pom</packaging>
<name>JBoss Portal Portlet Module</name>
<url>http://www.jboss.com/products/jbossmc</url>
@@ -37,9 +37,9 @@
<version.jbossxb>2.0.0.CR5</version.jbossxb>
<version.javassist>3.6-beta</version.javassist>
<version.jboss-remoting>2.2.1.GA</version.jboss-remoting>
- <version.jboss.portal.common>1.1.0-SNAPSHOT</version.jboss.portal.common>
- <version.jboss.portal.web>1.1.0-SNAPSHOT</version.jboss.portal.web>
- <version.jboss.unit>1.1.0-SNAPSHOT</version.jboss.unit>
+ <version.jboss.portal.common>1.2.0-SNAPSHOT</version.jboss.portal.common>
+ <version.jboss.portal.web>1.2.0-SNAPSHOT</version.jboss.portal.web>
+ <version.jboss.unit>1.2.0-SNAPSHOT</version.jboss.unit>
<version.log4j>1.2.14</version.log4j>
<version.apache.commons-logging>1.1.1</version.apache.commons-logging>
<version.apache.commons-httpclient>3.0.1</version.apache.commons-httpclient>
@@ -93,7 +93,7 @@
<plugin>
<groupId>org.jboss.unit</groupId>
<artifactId>jboss-unit-tooling-maven2</artifactId>
- <version>1.1.0-SNAPSHOT</version>
+ <version>1.2.0-SNAPSHOT</version>
</plugin>
</plugins>
</pluginManagement>
@@ -111,6 +111,13 @@
<enabled>true</enabled>
</snapshots>
</pluginRepository>
+ <pluginRepository>
+ <id>java.net maven repository</id>
+ <url>http://download.java.net/maven/2/</url>
+ <snapshots>
+ <enabled>true</enabled>
+ </snapshots>
+ </pluginRepository>
</pluginRepositories>
<dependencyManagement>
Modified: modules/portlet/trunk/federation/pom.xml
===================================================================
--- modules/portlet/trunk/federation/pom.xml 2008-01-08 09:26:05 UTC (rev 9453)
+++ modules/portlet/trunk/federation/pom.xml 2008-01-08 09:57:40 UTC (rev 9454)
@@ -3,7 +3,7 @@
<parent>
<groupId>org.jboss.portal.portlet</groupId>
<artifactId>jboss-portal-modules-portlet</artifactId>
- <version>1.1.0-SNAPSHOT</version>
+ <version>1.2.0-SNAPSHOT</version>
<relativePath>../build/pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Modified: modules/portlet/trunk/jsr168api/pom.xml
===================================================================
--- modules/portlet/trunk/jsr168api/pom.xml 2008-01-08 09:26:05 UTC (rev 9453)
+++ modules/portlet/trunk/jsr168api/pom.xml 2008-01-08 09:57:40 UTC (rev 9454)
@@ -3,7 +3,7 @@
<parent>
<groupId>org.jboss.portal.portlet</groupId>
<artifactId>jboss-portal-modules-portlet</artifactId>
- <version>1.1.0-SNAPSHOT</version>
+ <version>1.2.0-SNAPSHOT</version>
<relativePath>../build/pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Modified: modules/portlet/trunk/management/pom.xml
===================================================================
--- modules/portlet/trunk/management/pom.xml 2008-01-08 09:26:05 UTC (rev 9453)
+++ modules/portlet/trunk/management/pom.xml 2008-01-08 09:57:40 UTC (rev 9454)
@@ -3,7 +3,7 @@
<parent>
<groupId>org.jboss.portal.portlet</groupId>
<artifactId>jboss-portal-modules-portlet</artifactId>
- <version>1.1.0-SNAPSHOT</version>
+ <version>1.2.0-SNAPSHOT</version>
<relativePath>../build/pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Modified: modules/portlet/trunk/pom.xml
===================================================================
--- modules/portlet/trunk/pom.xml 2008-01-08 09:26:05 UTC (rev 9453)
+++ modules/portlet/trunk/pom.xml 2008-01-08 09:57:40 UTC (rev 9454)
@@ -5,7 +5,7 @@
<artifactId>jboss-portal-modules-portlet-aggregator</artifactId>
<packaging>pom</packaging>
<name>JBoss Portal Portlet Module Aggregator</name>
- <version>1.1.0-SNAPSHOT</version>
+ <version>1.2.0-SNAPSHOT</version>
<url>http://labs.jboss.com/jbossportal</url>
<dependencies/>
Modified: modules/portlet/trunk/portlet/pom.xml
===================================================================
--- modules/portlet/trunk/portlet/pom.xml 2008-01-08 09:26:05 UTC (rev 9453)
+++ modules/portlet/trunk/portlet/pom.xml 2008-01-08 09:57:40 UTC (rev 9454)
@@ -3,7 +3,7 @@
<parent>
<groupId>org.jboss.portal.portlet</groupId>
<artifactId>jboss-portal-modules-portlet</artifactId>
- <version>1.1.0-SNAPSHOT</version>
+ <version>1.2.0-SNAPSHOT</version>
<relativePath>../build/pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
@@ -47,8 +47,9 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
- <!--2.2-SNAPSHOT because of http://jira.codehaus.org/browse/MJAR-30-->
- <version>2.2-SNAPSHOT</version>
+ <!--In 2.1 there is http://jira.codehaus.org/browse/MJAR-30-->
+ <!--2.2 should be used but SNAPSHOT is unstable for now-->
+ <version>2.1</version>
<executions>
<execution>
<goals>
Modified: modules/portlet/trunk/test/pom.xml
===================================================================
--- modules/portlet/trunk/test/pom.xml 2008-01-08 09:26:05 UTC (rev 9453)
+++ modules/portlet/trunk/test/pom.xml 2008-01-08 09:57:40 UTC (rev 9454)
@@ -3,7 +3,7 @@
<parent>
<groupId>org.jboss.portal.portlet</groupId>
<artifactId>jboss-portal-modules-portlet</artifactId>
- <version>1.1.0-SNAPSHOT</version>
+ <version>1.2.0-SNAPSHOT</version>
<relativePath>../build/pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
@@ -248,9 +248,9 @@
<build>
<plugins>
<plugin>
- <groupId>org.jboss.unit</groupId>
+ <groupId>org.jvnet.maven-antrun-extended-plugin</groupId>
<artifactId>maven-antrun-extended-plugin</artifactId>
- <version>1.10-SNAPSHOT</version>
+ <version>1.13</version>
<dependencies>
Modified: modules/portlet/trunk/test/src/test/build.xml
===================================================================
--- modules/portlet/trunk/test/src/test/build.xml 2008-01-08 09:26:05 UTC (rev 9453)
+++ modules/portlet/trunk/test/src/test/build.xml 2008-01-08 09:57:40 UTC (rev 9454)
@@ -8,6 +8,8 @@
<echo message="test classpath: ${test_classpath}"/>
<echo message="plugin classpath: ${plugin_classpath}"/>
+ <echo message="You can run small subset of tests using -Dtests=local, -Dtests=jboss or -D=tests=tomcat"/>
+
<antcall target="package-tests"/>
<antcall target="tests.call.single"/>
18 years, 3 months
JBoss Portal SVN: r9453 - in modules/web/trunk: build and 1 other directories.
by portal-commits@lists.jboss.org
Author: bdaw
Date: 2008-01-08 04:26:05 -0500 (Tue, 08 Jan 2008)
New Revision: 9453
Modified:
modules/web/trunk/build/pom.xml
modules/web/trunk/pom.xml
modules/web/trunk/web/pom.xml
Log:
change version to 1.2.0-SNAPSHOT
Modified: modules/web/trunk/build/pom.xml
===================================================================
--- modules/web/trunk/build/pom.xml 2008-01-08 09:10:49 UTC (rev 9452)
+++ modules/web/trunk/build/pom.xml 2008-01-08 09:26:05 UTC (rev 9453)
@@ -18,7 +18,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>org.jboss.portal.web</groupId>
<artifactId>jboss-portal-modules-web</artifactId>
- <version>1.1.0-SNAPSHOT</version>
+ <version>1.2.0-SNAPSHOT</version>
<packaging>pom</packaging>
<name>JBoss Portal Test Module</name>
<url>http://www.jboss.com/products/jbossmc</url>
@@ -36,8 +36,8 @@
<version.jbossxb>2.0.0.CR3</version.jbossxb>
<version.javassist>3.6-beta</version.javassist>
<version.jboss-remoting>2.2.1.GA</version.jboss-remoting>
- <version.jboss.portal.common>1.1.0-SNAPSHOT</version.jboss.portal.common>
- <version.jboss.unit>1.1.0-SNAPSHOT</version.jboss.unit>
+ <version.jboss.portal.common>1.2.0-SNAPSHOT</version.jboss.portal.common>
+ <version.jboss.unit>1.2.0-SNAPSHOT</version.jboss.unit>
<version.log4j>1.2.14</version.log4j>
<version.apache.commons-logging>1.1.1</version.apache.commons-logging>
<version.apache.commons-httpclient>3.0.1</version.apache.commons-httpclient>
@@ -74,7 +74,15 @@
</repositories>
- <pluginRepositories/>
+ <pluginRepositories>
+ <pluginRepository>
+ <id>java.net maven repository</id>
+ <url>http://download.java.net/maven/2/</url>
+ <snapshots>
+ <enabled>true</enabled>
+ </snapshots>
+ </pluginRepository>
+ </pluginRepositories>
<dependencyManagement>
<!-- The parent pom manages the inter-dependencies of the modules. -->
Modified: modules/web/trunk/pom.xml
===================================================================
--- modules/web/trunk/pom.xml 2008-01-08 09:10:49 UTC (rev 9452)
+++ modules/web/trunk/pom.xml 2008-01-08 09:26:05 UTC (rev 9453)
@@ -5,7 +5,7 @@
<artifactId>jboss-portal-modules-web-aggregator</artifactId>
<packaging>pom</packaging>
<name>JBoss Portal Web Module</name>
- <version>1.1.0-SNAPSHOT</version>
+ <version>1.2.0-SNAPSHOT</version>
<url>http://labs.jboss.com/jbossportal</url>
<dependencies/>
Modified: modules/web/trunk/web/pom.xml
===================================================================
--- modules/web/trunk/web/pom.xml 2008-01-08 09:10:49 UTC (rev 9452)
+++ modules/web/trunk/web/pom.xml 2008-01-08 09:26:05 UTC (rev 9453)
@@ -3,7 +3,7 @@
<parent>
<groupId>org.jboss.portal.web</groupId>
<artifactId>jboss-portal-modules-web</artifactId>
- <version>1.1.0-SNAPSHOT</version>
+ <version>1.2.0-SNAPSHOT</version>
<relativePath>../build/pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
@@ -263,9 +263,9 @@
<build>
<plugins>
<plugin>
- <groupId>org.jboss.unit</groupId>
+ <groupId>org.jvnet.maven-antrun-extended-plugin</groupId>
<artifactId>maven-antrun-extended-plugin</artifactId>
- <version>1.10-SNAPSHOT</version>
+ <version>1.13</version>
<dependencies>
<dependency>
18 years, 3 months
JBoss Portal SVN: r9452 - in modules/test/trunk: build and 12 other directories.
by portal-commits@lists.jboss.org
Author: bdaw
Date: 2008-01-08 04:10:49 -0500 (Tue, 08 Jan 2008)
New Revision: 9452
Modified:
modules/test/trunk/build/pom.xml
modules/test/trunk/mc/pom.xml
modules/test/trunk/pom.xml
modules/test/trunk/remote/pom.xml
modules/test/trunk/test/agent/pom.xml
modules/test/trunk/test/core/pom.xml
modules/test/trunk/test/generic/pom.xml
modules/test/trunk/test/jboss/pom.xml
modules/test/trunk/test/opends/pom.xml
modules/test/trunk/tooling/ant/pom.xml
modules/test/trunk/tooling/core/pom.xml
modules/test/trunk/tooling/maven2/pom.xml
modules/test/trunk/tooling/pom.xml
modules/test/trunk/unit/pom.xml
Log:
change version to 1.2.0-SNAPSHOT
Modified: modules/test/trunk/build/pom.xml
===================================================================
--- modules/test/trunk/build/pom.xml 2008-01-08 08:35:30 UTC (rev 9451)
+++ modules/test/trunk/build/pom.xml 2008-01-08 09:10:49 UTC (rev 9452)
@@ -18,14 +18,14 @@
<modelVersion>4.0.0</modelVersion>
<groupId>org.jboss.unit</groupId>
<artifactId>jboss-portal-modules-test</artifactId>
- <version>1.1.0-SNAPSHOT</version>
+ <version>1.2.0-SNAPSHOT</version>
<packaging>pom</packaging>
<name>JBoss Portal Test Module</name>
<url>http://www.jboss.com/products/jbossmc</url>
<description>JBoss Portal Test Module</description>
<properties>
- <version.portal.common>1.1.0-SNAPSHOT</version.portal.common>
+ <version.portal.common>1.2.0-SNAPSHOT</version.portal.common>
<version.jboss.microcontainer>2.0.0.Beta4</version.jboss.microcontainer>
<version.apache.httpclient>3.0.1</version.apache.httpclient>
<version.cargo>0.9-portal</version.cargo>
Modified: modules/test/trunk/mc/pom.xml
===================================================================
--- modules/test/trunk/mc/pom.xml 2008-01-08 08:35:30 UTC (rev 9451)
+++ modules/test/trunk/mc/pom.xml 2008-01-08 09:10:49 UTC (rev 9452)
@@ -3,7 +3,7 @@
<parent>
<groupId>org.jboss.unit</groupId>
<artifactId>jboss-portal-modules-test</artifactId>
- <version>1.1.0-SNAPSHOT</version>
+ <version>1.2.0-SNAPSHOT</version>
<relativePath>../build/pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Modified: modules/test/trunk/pom.xml
===================================================================
--- modules/test/trunk/pom.xml 2008-01-08 08:35:30 UTC (rev 9451)
+++ modules/test/trunk/pom.xml 2008-01-08 09:10:49 UTC (rev 9452)
@@ -5,7 +5,7 @@
<artifactId>jboss-portal-modules-test-aggregator</artifactId>
<packaging>pom</packaging>
<name>JBoss Portal Modules Test</name>
- <version>1.1.0-SNAPSHOT</version>
+ <version>1.2.0-SNAPSHOT</version>
<url>http://labs.jboss.com/jbossportal</url>
<dependencies/>
Modified: modules/test/trunk/remote/pom.xml
===================================================================
--- modules/test/trunk/remote/pom.xml 2008-01-08 08:35:30 UTC (rev 9451)
+++ modules/test/trunk/remote/pom.xml 2008-01-08 09:10:49 UTC (rev 9452)
@@ -3,7 +3,7 @@
<parent>
<groupId>org.jboss.unit</groupId>
<artifactId>jboss-portal-modules-test</artifactId>
- <version>1.1.0-SNAPSHOT</version>
+ <version>1.2.0-SNAPSHOT</version>
<relativePath>../build/pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Modified: modules/test/trunk/test/agent/pom.xml
===================================================================
--- modules/test/trunk/test/agent/pom.xml 2008-01-08 08:35:30 UTC (rev 9451)
+++ modules/test/trunk/test/agent/pom.xml 2008-01-08 09:10:49 UTC (rev 9452)
@@ -3,7 +3,7 @@
<parent>
<groupId>org.jboss.unit</groupId>
<artifactId>jboss-portal-modules-test</artifactId>
- <version>1.1.0-SNAPSHOT</version>
+ <version>1.2.0-SNAPSHOT</version>
<relativePath>../../build/pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Modified: modules/test/trunk/test/core/pom.xml
===================================================================
--- modules/test/trunk/test/core/pom.xml 2008-01-08 08:35:30 UTC (rev 9451)
+++ modules/test/trunk/test/core/pom.xml 2008-01-08 09:10:49 UTC (rev 9452)
@@ -3,7 +3,7 @@
<parent>
<groupId>org.jboss.unit</groupId>
<artifactId>jboss-portal-modules-test</artifactId>
- <version>1.1.0-SNAPSHOT</version>
+ <version>1.2.0-SNAPSHOT</version>
<relativePath>../../build/pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Modified: modules/test/trunk/test/generic/pom.xml
===================================================================
--- modules/test/trunk/test/generic/pom.xml 2008-01-08 08:35:30 UTC (rev 9451)
+++ modules/test/trunk/test/generic/pom.xml 2008-01-08 09:10:49 UTC (rev 9452)
@@ -3,7 +3,7 @@
<parent>
<groupId>org.jboss.unit</groupId>
<artifactId>jboss-portal-modules-test</artifactId>
- <version>1.1.0-SNAPSHOT</version>
+ <version>1.2.0-SNAPSHOT</version>
<relativePath>../../build/pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Modified: modules/test/trunk/test/jboss/pom.xml
===================================================================
--- modules/test/trunk/test/jboss/pom.xml 2008-01-08 08:35:30 UTC (rev 9451)
+++ modules/test/trunk/test/jboss/pom.xml 2008-01-08 09:10:49 UTC (rev 9452)
@@ -3,7 +3,7 @@
<parent>
<groupId>org.jboss.unit</groupId>
<artifactId>jboss-portal-modules-test</artifactId>
- <version>1.1.0-SNAPSHOT</version>
+ <version>1.2.0-SNAPSHOT</version>
<relativePath>../../build/pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Modified: modules/test/trunk/test/opends/pom.xml
===================================================================
--- modules/test/trunk/test/opends/pom.xml 2008-01-08 08:35:30 UTC (rev 9451)
+++ modules/test/trunk/test/opends/pom.xml 2008-01-08 09:10:49 UTC (rev 9452)
@@ -3,7 +3,7 @@
<parent>
<groupId>org.jboss.unit</groupId>
<artifactId>jboss-portal-modules-test</artifactId>
- <version>1.1.0-SNAPSHOT</version>
+ <version>1.2.0-SNAPSHOT</version>
<relativePath>../../build/pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Modified: modules/test/trunk/tooling/ant/pom.xml
===================================================================
--- modules/test/trunk/tooling/ant/pom.xml 2008-01-08 08:35:30 UTC (rev 9451)
+++ modules/test/trunk/tooling/ant/pom.xml 2008-01-08 09:10:49 UTC (rev 9452)
@@ -3,8 +3,8 @@
<parent>
<groupId>org.jboss.unit</groupId>
<artifactId>jboss-portal-modules-test</artifactId>
- <version>1.1.0-SNAPSHOT</version>
- <relativePath>../pom.xml</relativePath>
+ <version>1.2.0-SNAPSHOT</version>
+ <relativePath>../../build/pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>jboss-unit-tooling-ant</artifactId>
Modified: modules/test/trunk/tooling/core/pom.xml
===================================================================
--- modules/test/trunk/tooling/core/pom.xml 2008-01-08 08:35:30 UTC (rev 9451)
+++ modules/test/trunk/tooling/core/pom.xml 2008-01-08 09:10:49 UTC (rev 9452)
@@ -3,8 +3,8 @@
<parent>
<groupId>org.jboss.unit</groupId>
<artifactId>jboss-portal-modules-test</artifactId>
- <version>1.1.0-SNAPSHOT</version>
- <relativePath>../pom.xml</relativePath>
+ <version>1.2.0-SNAPSHOT</version>
+ <relativePath>../../build/pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>jboss-unit-tooling-core</artifactId>
Modified: modules/test/trunk/tooling/maven2/pom.xml
===================================================================
--- modules/test/trunk/tooling/maven2/pom.xml 2008-01-08 08:35:30 UTC (rev 9451)
+++ modules/test/trunk/tooling/maven2/pom.xml 2008-01-08 09:10:49 UTC (rev 9452)
@@ -3,8 +3,8 @@
<parent>
<groupId>org.jboss.unit</groupId>
<artifactId>jboss-portal-modules-test</artifactId>
- <version>1.1.0-SNAPSHOT</version>
- <relativePath>../pom.xml</relativePath>
+ <version>1.2.0-SNAPSHOT</version>
+ <relativePath>../../build/pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>jboss-unit-tooling-maven2</artifactId>
Modified: modules/test/trunk/tooling/pom.xml
===================================================================
--- modules/test/trunk/tooling/pom.xml 2008-01-08 08:35:30 UTC (rev 9451)
+++ modules/test/trunk/tooling/pom.xml 2008-01-08 09:10:49 UTC (rev 9452)
@@ -3,7 +3,7 @@
<parent>
<groupId>org.jboss.unit</groupId>
<artifactId>jboss-portal-modules-test</artifactId>
- <version>1.1.0-SNAPSHOT</version>
+ <version>1.2.0-SNAPSHOT</version>
<relativePath>../build/pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
@@ -11,7 +11,7 @@
<artifactId>jboss-unit-tooling-aggregator</artifactId>
<packaging>pom</packaging>
<name>JBoss Unit Tooling (aggregator)</name>
- <version>1.1.0-SNAPSHOT</version>
+ <version>1.2.0-SNAPSHOT</version>
<modules>
<module>core</module>
<module>ant</module>
Modified: modules/test/trunk/unit/pom.xml
===================================================================
--- modules/test/trunk/unit/pom.xml 2008-01-08 08:35:30 UTC (rev 9451)
+++ modules/test/trunk/unit/pom.xml 2008-01-08 09:10:49 UTC (rev 9452)
@@ -3,7 +3,7 @@
<parent>
<groupId>org.jboss.unit</groupId>
<artifactId>jboss-portal-modules-test</artifactId>
- <version>1.1.0-SNAPSHOT</version>
+ <version>1.2.0-SNAPSHOT</version>
<relativePath>../build/pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
18 years, 3 months
JBoss Portal SVN: r9451 - in modules/common/trunk: build and 3 other directories.
by portal-commits@lists.jboss.org
Author: bdaw
Date: 2008-01-08 03:35:30 -0500 (Tue, 08 Jan 2008)
New Revision: 9451
Modified:
modules/common/trunk/build/pom.xml
modules/common/trunk/common/pom.xml
modules/common/trunk/mc/pom.xml
modules/common/trunk/pom.xml
modules/common/trunk/portal/pom.xml
Log:
change version to 1.2.0-SNAPSHOT
Modified: modules/common/trunk/build/pom.xml
===================================================================
--- modules/common/trunk/build/pom.xml 2008-01-08 01:54:30 UTC (rev 9450)
+++ modules/common/trunk/build/pom.xml 2008-01-08 08:35:30 UTC (rev 9451)
@@ -10,7 +10,7 @@
<artifactId>jboss-portal-modules-common-parent</artifactId>
<packaging>pom</packaging>
<name>JBoss Portal Modules Common</name>
- <version>1.1.0-SNAPSHOT</version>
+ <version>1.2.0-SNAPSHOT</version>
<url>http://labs.jboss.com/jbossportal</url>
<properties>
Modified: modules/common/trunk/common/pom.xml
===================================================================
--- modules/common/trunk/common/pom.xml 2008-01-08 01:54:30 UTC (rev 9450)
+++ modules/common/trunk/common/pom.xml 2008-01-08 08:35:30 UTC (rev 9451)
@@ -3,7 +3,7 @@
<parent>
<groupId>org.jboss.portal.common</groupId>
<artifactId>jboss-portal-modules-common-parent</artifactId>
- <version>1.1.0-SNAPSHOT</version>
+ <version>1.2.0-SNAPSHOT</version>
<relativePath>../build/pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Modified: modules/common/trunk/mc/pom.xml
===================================================================
--- modules/common/trunk/mc/pom.xml 2008-01-08 01:54:30 UTC (rev 9450)
+++ modules/common/trunk/mc/pom.xml 2008-01-08 08:35:30 UTC (rev 9451)
@@ -3,7 +3,7 @@
<parent>
<groupId>org.jboss.portal.common</groupId>
<artifactId>jboss-portal-modules-common-parent</artifactId>
- <version>1.1.0-SNAPSHOT</version>
+ <version>1.2.0-SNAPSHOT</version>
<relativePath>../build/pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Modified: modules/common/trunk/pom.xml
===================================================================
--- modules/common/trunk/pom.xml 2008-01-08 01:54:30 UTC (rev 9450)
+++ modules/common/trunk/pom.xml 2008-01-08 08:35:30 UTC (rev 9451)
@@ -5,7 +5,7 @@
<artifactId>jboss-portal-modules-common-aggregator</artifactId>
<packaging>pom</packaging>
<name>JBoss Portal Modules Common (aggregator)</name>
- <version>1.1.0-SNAPSHOT</version>
+ <version>1.2.0-SNAPSHOT</version>
<distributionManagement>
<repository>
Modified: modules/common/trunk/portal/pom.xml
===================================================================
--- modules/common/trunk/portal/pom.xml 2008-01-08 01:54:30 UTC (rev 9450)
+++ modules/common/trunk/portal/pom.xml 2008-01-08 08:35:30 UTC (rev 9451)
@@ -3,7 +3,7 @@
<parent>
<groupId>org.jboss.portal.common</groupId>
<artifactId>jboss-portal-modules-common-parent</artifactId>
- <version>1.1.0-SNAPSHOT</version>
+ <version>1.2.0-SNAPSHOT</version>
<relativePath>../build/pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
18 years, 3 months
JBoss Portal SVN: r9450 - in modules/portlet/trunk: portlet/src/main/java/org/jboss/portal/portlet/impl and 10 other directories.
by portal-commits@lists.jboss.org
Author: julien(a)jboss.com
Date: 2008-01-07 20:54:30 -0500 (Mon, 07 Jan 2008)
New Revision: 9450
Added:
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/metadata/
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/metadata/CustomPortletModeMetaData.java
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/metadata/CustomWindowStateMetaData.java
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/metadata/ListenerMetaData.java
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/metadata/PortletApplication10MetaData.java
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/metadata/PortletApplication20MetaData.java
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/metadata/PortletMetaDataConstants.java
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/metadata/PublicRenderParameterMetaData.java
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/metadata/UserAttributeMetaData.java
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/metadata/ValidationErrorHandler.java
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/metadata/adapter/
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/metadata/adapter/ContainerRuntimeAdapter.java
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/metadata/adapter/CustomPortletModeAdapter.java
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/metadata/adapter/CustomWindowStateAdapter.java
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/metadata/adapter/EventListAdapter.java
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/metadata/adapter/FilterAdapter.java
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/metadata/adapter/FilterMappingAdapter.java
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/metadata/adapter/LocalizedStringAdapter.java
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/metadata/adapter/PortletListAdapter.java
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/metadata/adapter/PortletPreferencesListAdapter.java
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/metadata/adapter/UserAttributeAdapter.java
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/metadata/common/
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/metadata/common/ContainerRuntimeMetaData.java
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/metadata/common/DescribableMetaData.java
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/metadata/common/InitParamMetaData.java
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/metadata/common/LocalizedDescriptionMetaData.java
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/metadata/event/
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/metadata/event/EventDefinitionMetaData.java
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/metadata/event/EventDefinitionReferenceMetaData.java
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/metadata/filter/
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/metadata/filter/FilterMappingMetaData.java
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/metadata/filter/FilterMetaData.java
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/metadata/portlet/
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/metadata/portlet/PortletCacheScopeEnum.java
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/metadata/portlet/PortletInfoMetaData.java
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/metadata/portlet/PortletMetaData.java
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/metadata/portlet/PortletModeMetaData.java
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/metadata/portlet/PortletPreferenceMetaData.java
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/metadata/portlet/PortletPreferencesMetaData.java
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/metadata/portlet/SecurityRoleRefMetaData.java
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/metadata/portlet/SupportedLocaleMetaData.java
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/metadata/portlet/SupportsMetaData.java
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/metadata/portlet/WindowStateMetaData.java
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/metadata/security/
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/metadata/security/PortletCollectionMetaData.java
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/metadata/security/SecurityConstraintMetaData.java
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/metadata/security/TransportGuaranteeEnum.java
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/metadata/security/UserDataConstraintMetaData.java
Removed:
modules/portlet/trunk/test/src/test/java/org/jboss/portal/portlet/test/metadata/ValidationErrorHandler.java
modules/portlet/trunk/test/src/test/java/org/jboss/portal/portlet/test/metadata/impl/CustomPortletModeMetaData.java
modules/portlet/trunk/test/src/test/java/org/jboss/portal/portlet/test/metadata/impl/CustomWindowStateMetaData.java
modules/portlet/trunk/test/src/test/java/org/jboss/portal/portlet/test/metadata/impl/ListenerMetaData.java
modules/portlet/trunk/test/src/test/java/org/jboss/portal/portlet/test/metadata/impl/PortletApplication10MetaData.java
modules/portlet/trunk/test/src/test/java/org/jboss/portal/portlet/test/metadata/impl/PortletApplication20MetaData.java
modules/portlet/trunk/test/src/test/java/org/jboss/portal/portlet/test/metadata/impl/PortletMetaDataConstants.java
modules/portlet/trunk/test/src/test/java/org/jboss/portal/portlet/test/metadata/impl/PublicRenderParameterMetaData.java
modules/portlet/trunk/test/src/test/java/org/jboss/portal/portlet/test/metadata/impl/UserAttributeMetaData.java
modules/portlet/trunk/test/src/test/java/org/jboss/portal/portlet/test/metadata/impl/adapter/
modules/portlet/trunk/test/src/test/java/org/jboss/portal/portlet/test/metadata/impl/common/
modules/portlet/trunk/test/src/test/java/org/jboss/portal/portlet/test/metadata/impl/event/
modules/portlet/trunk/test/src/test/java/org/jboss/portal/portlet/test/metadata/impl/filter/
modules/portlet/trunk/test/src/test/java/org/jboss/portal/portlet/test/metadata/impl/portlet/
modules/portlet/trunk/test/src/test/java/org/jboss/portal/portlet/test/metadata/impl/security/
Modified:
modules/portlet/trunk/portlet/pom.xml
modules/portlet/trunk/test/src/test/java/org/jboss/portal/portlet/test/metadata/AbstractMetaDataTestCase.java
modules/portlet/trunk/test/src/test/java/org/jboss/portal/portlet/test/metadata/CustomPortletModeTestEverythingTestCase.java
modules/portlet/trunk/test/src/test/java/org/jboss/portal/portlet/test/metadata/CustomWindowStateTestEverythingTestCase.java
modules/portlet/trunk/test/src/test/java/org/jboss/portal/portlet/test/metadata/EventTestEverythingTestCase.java
modules/portlet/trunk/test/src/test/java/org/jboss/portal/portlet/test/metadata/FilterTestEverythingTestCase.java
modules/portlet/trunk/test/src/test/java/org/jboss/portal/portlet/test/metadata/GeneralMetaDataTestCase.java
modules/portlet/trunk/test/src/test/java/org/jboss/portal/portlet/test/metadata/PortletTestEverythingTestCase.java
modules/portlet/trunk/test/src/test/java/org/jboss/portal/portlet/test/metadata/RenderParameterTestEverythingTestCase.java
modules/portlet/trunk/test/src/test/java/org/jboss/portal/portlet/test/metadata/SecurityConstraintTestEverythingTestCase.java
modules/portlet/trunk/test/src/test/java/org/jboss/portal/portlet/test/metadata/UserAttributeTestEverythingTestCase.java
modules/portlet/trunk/test/src/test/java/org/jboss/portal/portlet/test/metadata/factory/LocalizedStringBuilder.java
modules/portlet/trunk/test/src/test/java/org/jboss/portal/portlet/test/metadata/factory/PortletApplicationModelFactory.java
modules/portlet/trunk/test/src/test/java/org/jboss/portal/portlet/test/metadata/impl/AnnotationPortletApplication10MetaData.java
modules/portlet/trunk/test/src/test/java/org/jboss/portal/portlet/test/metadata/impl/AnnotationPortletApplication20MetaData.java
Log:
moved the metadata classes to the portlet module and left the jbossxb binding in the test module as it will be used only here for now
Modified: modules/portlet/trunk/portlet/pom.xml
===================================================================
--- modules/portlet/trunk/portlet/pom.xml 2008-01-08 00:27:36 UTC (rev 9449)
+++ modules/portlet/trunk/portlet/pom.xml 2008-01-08 01:54:30 UTC (rev 9450)
@@ -29,6 +29,10 @@
<groupId>sun-servlet</groupId>
<artifactId>jsp-api</artifactId>
</dependency>
+ <dependency>
+ <groupId>sun-jaxb</groupId>
+ <artifactId>jaxb-api</artifactId>
+ </dependency>
<!--TEST SCOPE-->
<dependency>
Added: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/metadata/CustomPortletModeMetaData.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/metadata/CustomPortletModeMetaData.java (rev 0)
+++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/metadata/CustomPortletModeMetaData.java 2008-01-08 01:54:30 UTC (rev 9450)
@@ -0,0 +1,89 @@
+/******************************************************************************
+ * 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.portlet.impl.metadata;
+
+import javax.xml.bind.annotation.XmlAttribute;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlType;
+
+import org.jboss.portal.portlet.impl.metadata.common.DescribableMetaData;
+import org.jboss.portal.portlet.impl.metadata.PortletMetaDataConstants;
+
+/**
+ * @author <a href="mailto:emuckenh@redhat.com">Emanuel Muckenhuber</a>
+ * @version $Revision$
+ */
+@XmlType(name = "custom-portlet-modeType")
+public class CustomPortletModeMetaData extends DescribableMetaData
+{
+
+ /** The custom portlet mode id*/
+ private String id;
+
+ /** The portlet mode */
+ private String portletMode;
+
+ /** Is portal managed */
+ private boolean portalManaged = true;
+
+ public CustomPortletModeMetaData() {}
+
+ public CustomPortletModeMetaData(String id)
+ {
+ this.id = id;
+ }
+
+ @XmlAttribute(name = "id")
+ public String getId()
+ {
+ return id;
+ }
+
+ public void setId(String id)
+ {
+ this.id = id;
+ }
+
+ @XmlElement(name = "portlet-mode")
+ public String getPortletMode()
+ {
+ return portletMode;
+ }
+
+ public void setPortletMode(String portletMode)
+ {
+ this.portletMode = portletMode;
+ }
+
+ @XmlElement(name = "portal-managed", namespace = PortletMetaDataConstants.PORTLET_JSR_286_NS)
+ public boolean isPortalManaged()
+ {
+ return portalManaged;
+ }
+
+ public void setPortalManaged(boolean portalManaged)
+ {
+ this.portalManaged = portalManaged;
+ }
+
+}
Added: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/metadata/CustomWindowStateMetaData.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/metadata/CustomWindowStateMetaData.java (rev 0)
+++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/metadata/CustomWindowStateMetaData.java 2008-01-08 01:54:30 UTC (rev 9450)
@@ -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.portlet.impl.metadata;
+
+import javax.xml.bind.annotation.XmlAttribute;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlType;
+
+import org.jboss.portal.portlet.impl.metadata.common.DescribableMetaData;
+
+/**
+ * @author <a href="mailto:emuckenh@redhat.com">Emanuel Muckenhuber</a>
+ * @version $Revision$
+ */
+@XmlType(name = "custom-window-stateType")
+public class CustomWindowStateMetaData extends DescribableMetaData
+{
+
+ /** The window state id */
+ private String id;
+
+ /** The window state */
+ private String windowState;
+
+ public CustomWindowStateMetaData() {}
+
+ public CustomWindowStateMetaData(String id)
+ {
+ this.id = id;
+ }
+
+ @XmlAttribute(name = "id")
+ public String getId()
+ {
+ return id;
+ }
+
+ public void setId(String id)
+ {
+ this.id = id;
+ }
+
+ @XmlElement(name = "window-state")
+ public String getWindowState()
+ {
+ return windowState;
+ }
+
+ public void setWindowState(String windowState)
+ {
+ this.windowState = windowState;
+ }
+
+}
\ No newline at end of file
Added: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/metadata/ListenerMetaData.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/metadata/ListenerMetaData.java (rev 0)
+++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/metadata/ListenerMetaData.java 2008-01-08 01:54:30 UTC (rev 9450)
@@ -0,0 +1,95 @@
+/******************************************************************************
+ * 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.portlet.impl.metadata;
+
+import javax.xml.bind.annotation.XmlAttribute;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlType;
+import javax.xml.bind.annotation.adapters.CollapsedStringAdapter;
+import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
+
+import org.jboss.portal.common.i18n.LocalizedString;
+import org.jboss.portal.portlet.impl.metadata.adapter.LocalizedStringAdapter;
+import org.jboss.portal.portlet.impl.metadata.common.DescribableMetaData;
+
+/**
+ * @author <a href="mailto:emuckenh@redhat.com">Emanuel Muckenhuber</a>
+ * @version $Revision$
+ */
+@XmlType(name = "listenerType")
+public class ListenerMetaData extends DescribableMetaData
+{
+
+ /** The id */
+ private String id;
+
+ /** The display name */
+ private LocalizedString displayName;
+
+ /** The listener class */
+ private String listenerClass;
+
+ public ListenerMetaData() {}
+
+ public ListenerMetaData(String id)
+ {
+ this.id = id;
+ }
+
+ @XmlAttribute(name = "id")
+ public String getId()
+ {
+ return id;
+ }
+
+ public void setId(String id)
+ {
+ this.id = id;
+ }
+
+ @XmlElement(name = "display-name")
+ @XmlJavaTypeAdapter(LocalizedStringAdapter.class)
+ public LocalizedString getDisplayName()
+ {
+ return displayName;
+ }
+
+ public void setDisplayName(LocalizedString displayName)
+ {
+ this.displayName = displayName;
+ }
+
+ @XmlElement(name = "listener-class")
+ @XmlJavaTypeAdapter(CollapsedStringAdapter.class)
+ public String getListenerClass()
+ {
+ return listenerClass;
+ }
+
+ public void setListenerClass(String listenerClass)
+ {
+ this.listenerClass = listenerClass;
+ }
+
+}
+
Added: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/metadata/PortletApplication10MetaData.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/metadata/PortletApplication10MetaData.java (rev 0)
+++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/metadata/PortletApplication10MetaData.java 2008-01-08 01:54:30 UTC (rev 9450)
@@ -0,0 +1,213 @@
+/******************************************************************************
+ * 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.portlet.impl.metadata;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
+
+import javax.xml.bind.annotation.XmlAttribute;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.bind.annotation.XmlType;
+import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
+
+import org.jboss.portal.portlet.impl.metadata.adapter.CustomPortletModeAdapter;
+import org.jboss.portal.portlet.impl.metadata.adapter.CustomWindowStateAdapter;
+import org.jboss.portal.portlet.impl.metadata.adapter.PortletListAdapter;
+import org.jboss.portal.portlet.impl.metadata.adapter.UserAttributeAdapter;
+import org.jboss.portal.portlet.impl.metadata.portlet.PortletMetaData;
+import org.jboss.portal.portlet.impl.metadata.security.SecurityConstraintMetaData;
+import org.jboss.portal.portlet.impl.metadata.UserAttributeMetaData;
+import org.jboss.portal.portlet.impl.metadata.CustomWindowStateMetaData;
+import org.jboss.portal.portlet.impl.metadata.CustomPortletModeMetaData;
+
+/**
+ * @author <a href="mailto:emuckenh@redhat.com">Emanuel Muckenhuber</a>
+ * @version $Revision$
+ */
+
+@XmlRootElement(name = "portlet-app")
+@XmlType(name = "portlet-appType")
+public class PortletApplication10MetaData
+{
+ /** The portlet application id. */
+ private String id;
+
+ /** The portlet application version. */
+ private String version;
+
+ /** A bunch of portlets. */
+ private Map<String, PortletMetaData> portlets;
+
+ /** The user attributes. */
+ private Map<String, UserAttributeMetaData> userAttributes;
+
+ /** The custom portlet mode. */
+ private Map<String, CustomPortletModeMetaData> customPortletModes;
+
+ /** The custom window states. */
+ private Map<String, CustomWindowStateMetaData> customWindowStates;
+
+ /** The security constraints */
+ private List<SecurityConstraintMetaData> securityConstraints;
+
+ @XmlAttribute(name = "id")
+ public String getId()
+ {
+ return id;
+ }
+
+ public void setId(String id)
+ {
+ this.id = id;
+ }
+
+ @XmlAttribute(name = "version")
+ public String getVersion()
+ {
+ return version;
+ }
+
+ public void setVersion(String version)
+ {
+ this.version = version;
+ }
+
+ @XmlElement(name = "portlet")
+ @XmlJavaTypeAdapter(PortletListAdapter.class)
+ public Map<String, PortletMetaData> getPortlets()
+ {
+ return portlets;
+ }
+
+ public void setPortlets(Map<String, PortletMetaData> portlets)
+ {
+ this.portlets = portlets;
+ }
+
+ public Collection<PortletMetaData> getPortletCollection()
+ {
+ return portlets != null ? portlets.values() : null;
+ }
+
+ public PortletMetaData getPortlet(String portletName)
+ {
+ return portlets.get(portletName);
+ }
+
+ public void addPortlet(PortletMetaData portlet)
+ {
+ if(this.portlets == null)
+ {
+ this.portlets = new LinkedHashMap<String, PortletMetaData>();
+ }
+ this.portlets.put(portlet.getPortletName(), portlet);
+ }
+
+ @XmlElement(name = "user-attribute")
+ @XmlJavaTypeAdapter(UserAttributeAdapter.class)
+ public Map<String, UserAttributeMetaData> getUserAttributes()
+ {
+ return userAttributes;
+ }
+
+ public void setUserAttributes(Map<String, UserAttributeMetaData> userAttributes)
+ {
+ this.userAttributes = userAttributes;
+ }
+
+ public void addUserAttribute(UserAttributeMetaData userAttribute)
+ {
+ if( this.userAttributes == null )
+ {
+ this.userAttributes = new HashMap<String, UserAttributeMetaData>();
+ }
+ this.userAttributes.put(userAttribute.getName(), userAttribute);
+ }
+
+ @XmlElement(name = "custom-portlet-mode")
+ @XmlJavaTypeAdapter(CustomPortletModeAdapter.class)
+ public Map<String, CustomPortletModeMetaData> getCustomPortletModes()
+ {
+ return customPortletModes;
+ }
+
+ public void setCustomPortletModes(Map<String, CustomPortletModeMetaData> customPortletMode)
+ {
+ this.customPortletModes = customPortletMode;
+ }
+
+ public void addCustomPortletMode(CustomPortletModeMetaData portletMode)
+ {
+ if ( this.customPortletModes == null)
+ {
+ this.customPortletModes = new HashMap<String, CustomPortletModeMetaData>();
+ }
+ this.customPortletModes.put(portletMode.getPortletMode(), portletMode);
+ }
+
+ @XmlElement(name = "custom-window-state")
+ @XmlJavaTypeAdapter(CustomWindowStateAdapter.class)
+ public Map<String, CustomWindowStateMetaData> getCustomWindowStates()
+ {
+ return customWindowStates;
+ }
+
+ public void setCustomWindowStates(Map<String, CustomWindowStateMetaData> customWindowState)
+ {
+ this.customWindowStates = customWindowState;
+ }
+
+ public void addCustomWindowState(CustomWindowStateMetaData windowState)
+ {
+ if( this.customWindowStates == null )
+ {
+ this.customWindowStates = new HashMap<String, CustomWindowStateMetaData>();
+ }
+ this.customWindowStates.put(windowState.getWindowState(), windowState);
+ }
+
+ @XmlElement(name = "security-constraint")
+ public List<SecurityConstraintMetaData> getSecurityConstraints()
+ {
+ return securityConstraints;
+ }
+
+ public void setSecurityConstraints(List<SecurityConstraintMetaData> securityConstraints)
+ {
+ this.securityConstraints = securityConstraints;
+ }
+
+ public void addSecurityConstraint(SecurityConstraintMetaData securityConstraint)
+ {
+ if(this.securityConstraints == null)
+ {
+ this.securityConstraints = new ArrayList<SecurityConstraintMetaData>();
+ }
+ this.securityConstraints.add(securityConstraint);
+ }
+}
Added: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/metadata/PortletApplication20MetaData.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/metadata/PortletApplication20MetaData.java (rev 0)
+++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/metadata/PortletApplication20MetaData.java 2008-01-08 01:54:30 UTC (rev 9450)
@@ -0,0 +1,243 @@
+/******************************************************************************
+ * 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.portlet.impl.metadata;
+
+import java.net.URI;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
+
+import org.jboss.portal.portlet.impl.metadata.adapter.ContainerRuntimeAdapter;
+import org.jboss.portal.portlet.impl.metadata.adapter.FilterAdapter;
+import org.jboss.portal.portlet.impl.metadata.adapter.FilterMappingAdapter;
+import org.jboss.portal.portlet.impl.metadata.common.ContainerRuntimeMetaData;
+import org.jboss.portal.portlet.impl.metadata.event.EventDefinitionMetaData;
+import org.jboss.portal.portlet.impl.metadata.filter.FilterMappingMetaData;
+import org.jboss.portal.portlet.impl.metadata.filter.FilterMetaData;
+import org.jboss.portal.portlet.impl.metadata.PortletMetaDataConstants;
+import org.jboss.portal.portlet.impl.metadata.PublicRenderParameterMetaData;
+import org.jboss.portal.portlet.impl.metadata.ListenerMetaData;
+
+/**
+ * @author <a href="mailto:emuckenh@redhat.com">Emanuel Muckenhuber</a>
+ * @version $Revision$
+ */
+public class PortletApplication20MetaData extends PortletApplication10MetaData
+{
+ /** The resource bundle (JSR 286) */
+ private String resourceBundle;
+
+ /** The default namespace URI (JSR 286) */
+ private URI defaultNamespace;
+
+ /** The filters (JSR 286) */
+ private Map<String, FilterMetaData> filters;
+
+ /** The filter mapping (JSR 286) */
+ private Map<String, FilterMappingMetaData> filterMapping;
+
+ /** The events (JSR 286) */
+ private List<EventDefinitionMetaData> events;
+
+ /** The public render parameters */
+ private List<PublicRenderParameterMetaData> publicRenderParameters;
+
+ /** The url generation listener */
+ private List<ListenerMetaData> listeners;
+
+ /** The container runtime options */
+ private Map<String, ContainerRuntimeMetaData> containerRuntimeOptions;
+
+ @XmlElement(name = "resource-bundle", namespace = PortletMetaDataConstants.PORTLET_JSR_286_NS)
+ public String getResourceBundle()
+ {
+ return resourceBundle;
+ }
+
+ public void setResourceBundle(String resourceBundle)
+ {
+ this.resourceBundle = resourceBundle;
+ }
+
+ @XmlElement(name = "default-namespace")
+ public URI getDefaultNamespace()
+ {
+ return defaultNamespace;
+ }
+
+ public void setDefaultNamespace(URI defaultNamespace)
+ {
+ this.defaultNamespace = defaultNamespace;
+ }
+
+ @XmlElement(name = "filter", namespace = PortletMetaDataConstants.PORTLET_JSR_286_NS)
+ @XmlJavaTypeAdapter(FilterAdapter.class)
+ public Map<String, FilterMetaData> getFilters()
+ {
+ return this.filters;
+ }
+
+ public void setFilters(Map<String, FilterMetaData> filters)
+ {
+ this.filters = filters;
+ }
+
+ public Collection<FilterMetaData> getFilterCollection()
+ {
+ return this.filters != null ? this.filters.values() : null;
+ }
+
+ public FilterMetaData getFilter(String filterName)
+ {
+ return this.filters.get(filterName);
+ }
+
+ public void addFilter(FilterMetaData filter)
+ {
+ if ( this.filters == null)
+ {
+ this.filters = new LinkedHashMap<String, FilterMetaData>();
+ }
+ this.filters.put(filter.getFilterName(), filter);
+ }
+
+ @XmlElement(name = "filter-mapping", namespace = PortletMetaDataConstants.PORTLET_JSR_286_NS)
+ @XmlJavaTypeAdapter(FilterMappingAdapter.class)
+ public Map<String, FilterMappingMetaData> getFilterMapping()
+ {
+ return filterMapping;
+ }
+
+ public void setFilterMapping(Map<String, FilterMappingMetaData> filterMapping)
+ {
+ this.filterMapping = filterMapping;
+ }
+
+ public void addFilterMapping(FilterMappingMetaData filterMapping)
+ {
+ if(this.filterMapping == null)
+ {
+ this.filterMapping = new HashMap<String, FilterMappingMetaData>();
+ }
+ this.filterMapping.put(filterMapping.getName(), filterMapping);
+ }
+
+ @XmlElement(name = "event-definition", namespace = PortletMetaDataConstants.PORTLET_JSR_286_NS)
+ public List<EventDefinitionMetaData> getEvents()
+ {
+ return events;
+ }
+
+ public void setEvents(List<EventDefinitionMetaData> events)
+ {
+ this.events = events;
+ }
+
+ public void addEventDefinition(EventDefinitionMetaData eventDefinition)
+ {
+ if(this.events == null)
+ {
+ this.events = new ArrayList<EventDefinitionMetaData>();
+ }
+ this.events.add(eventDefinition);
+ }
+
+ @XmlElement(name = "public-render-parameter", namespace = PortletMetaDataConstants.PORTLET_JSR_286_NS)
+ public List<PublicRenderParameterMetaData> getPublicRenderParameters()
+ {
+ return publicRenderParameters;
+ }
+
+ public void setPublicRenderParameters(List<PublicRenderParameterMetaData> publicRenderParameters)
+ {
+ this.publicRenderParameters = publicRenderParameters;
+ }
+
+ public void addPublicRenderParameter(PublicRenderParameterMetaData renderParameter)
+ {
+ if( this.publicRenderParameters == null)
+ {
+ this.publicRenderParameters = new ArrayList<PublicRenderParameterMetaData>();
+ }
+ this.publicRenderParameters.add(renderParameter);
+ }
+
+ @XmlElement(name = "listener", namespace = PortletMetaDataConstants.PORTLET_JSR_286_NS)
+ public List<ListenerMetaData> getListeners()
+ {
+ return listeners;
+ }
+
+ public void setListeners(List<ListenerMetaData> listeners)
+ {
+ this.listeners = listeners;
+ }
+
+ public void addListener(ListenerMetaData listener)
+ {
+ if (this.listeners == null)
+ {
+ this.listeners = new ArrayList<ListenerMetaData>();
+ }
+ this.listeners.add(listener);
+ }
+
+ @XmlElement(name = "container-runtime-option",
+ namespace = PortletMetaDataConstants.PORTLET_JSR_286_NS)
+ @XmlJavaTypeAdapter(ContainerRuntimeAdapter.class)
+ public Map<String, ContainerRuntimeMetaData> getContainerRuntimeOptions()
+ {
+ return containerRuntimeOptions;
+ }
+
+ public void setContainerRuntimeOptions(Map<String, ContainerRuntimeMetaData> containerRuntimeOptions)
+ {
+ this.containerRuntimeOptions = containerRuntimeOptions;
+ }
+
+ public ContainerRuntimeMetaData getContainerRuntimeOption(String option)
+ {
+ return this.containerRuntimeOptions.get(option);
+ }
+
+ public Set<String> getContainerRuntimeOptionSet()
+ {
+ return this.containerRuntimeOptions != null ? this.containerRuntimeOptions.keySet() : null;
+ }
+
+ public void addContainerRuntime(ContainerRuntimeMetaData option)
+ {
+ if (this.containerRuntimeOptions == null)
+ {
+ this.containerRuntimeOptions = new HashMap<String, ContainerRuntimeMetaData>();
+ }
+ this.containerRuntimeOptions.put(option.getName(), option);
+ }
+}
Added: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/metadata/PortletMetaDataConstants.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/metadata/PortletMetaDataConstants.java (rev 0)
+++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/metadata/PortletMetaDataConstants.java 2008-01-08 01:54:30 UTC (rev 9450)
@@ -0,0 +1,45 @@
+/******************************************************************************
+ * 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.portlet.impl.metadata;
+
+import static javax.xml.XMLConstants.XML_NS_URI;
+
+/**
+ * @author <a href="mailto:emuckenh@redhat.com">Emanuel Muckenhuber</a>
+ * @version $Revision$
+ */
+public final class PortletMetaDataConstants
+{
+
+ /** The portlet version 1.0 namespace */
+ public final static String PORTLET_JSR_168_NS = "http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd";
+
+ /** The portlet version 2.0 namespace */
+ public final static String PORTLET_JSR_286_NS = "http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd";
+
+ /** The xml namespace */
+ public final static String NS_XML_NAMESPACE = XML_NS_URI;
+
+ /** The default locale */
+ public final static String DEFAULT_LOCALE = "en";
+}
Added: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/metadata/PublicRenderParameterMetaData.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/metadata/PublicRenderParameterMetaData.java (rev 0)
+++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/metadata/PublicRenderParameterMetaData.java 2008-01-08 01:54:30 UTC (rev 9450)
@@ -0,0 +1,129 @@
+/******************************************************************************
+ * 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.portlet.impl.metadata;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.xml.bind.annotation.XmlAttribute;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlType;
+import javax.xml.namespace.QName;
+
+import org.jboss.portal.portlet.impl.metadata.common.DescribableMetaData;
+
+/**
+ * @author <a href="mailto:emuckenh@redhat.com">Emanuel Muckenhuber</a>
+ * @version $Revision$
+ */
+@XmlType(name = "public-render-parameterType")
+public class PublicRenderParameterMetaData extends DescribableMetaData
+{
+
+ /** The public render parameter id */
+ private String id;
+
+ /** The public render parameter identifier */
+ private String identifier;
+
+ /** The QName */
+ private QName qname;
+
+ /** The name */
+ private String name;
+
+ /** The public render parameter alias */
+ private List<QName> alias;
+
+ public PublicRenderParameterMetaData() {}
+
+ public PublicRenderParameterMetaData(String id)
+ {
+ this.id = id;
+ }
+
+ @XmlAttribute(name = "id")
+ public String getId()
+ {
+ return id;
+ }
+
+ public void setId(String id)
+ {
+ this.id = id;
+ }
+
+ @XmlElement(name = "identifier")
+ public String getIdentifier()
+ {
+ return identifier;
+ }
+
+ public void setIdentifier(String identifier)
+ {
+ this.identifier = identifier;
+ }
+
+ @XmlElement(name = "qname")
+ public QName getQname()
+ {
+ return qname;
+ }
+
+ public void setQname(QName qname)
+ {
+ this.qname = qname;
+ }
+
+ @XmlElement(name = "name")
+ public String getName()
+ {
+ return name;
+ }
+
+ public void setName(String name)
+ {
+ this.name = name;
+ }
+
+ @XmlElement(name = "alias")
+ public List<QName> getAlias()
+ {
+ return alias;
+ }
+
+ public void setAlias(List<QName> alias)
+ {
+ this.alias = alias;
+ }
+
+ public void addAlias(QName alias)
+ {
+ if(this.alias == null)
+ {
+ this.alias = new ArrayList<QName>();
+ }
+ this.alias.add(alias);
+ }
+
+}
Added: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/metadata/UserAttributeMetaData.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/metadata/UserAttributeMetaData.java (rev 0)
+++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/metadata/UserAttributeMetaData.java 2008-01-08 01:54:30 UTC (rev 9450)
@@ -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.portlet.impl.metadata;
+
+import javax.xml.bind.annotation.XmlAttribute;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlType;
+
+import org.jboss.portal.portlet.impl.metadata.common.DescribableMetaData;
+
+/**
+ * @author <a href="mailto:emuckenh@redhat.com">Emanuel Muckenhuber</a>
+ * @version $Revision$
+ */
+@XmlType(name = "user-attributeType")
+public class UserAttributeMetaData extends DescribableMetaData
+{
+
+ /** The id */
+ private String id;
+
+ /** The name */
+ private String name;
+
+ public UserAttributeMetaData() {}
+
+ public UserAttributeMetaData(String id)
+ {
+ this.id = id;
+ }
+
+ @XmlAttribute(name = "id")
+ public String getId()
+ {
+ return id;
+ }
+
+ public void setId(String id)
+ {
+ this.id = id;
+ }
+
+ @XmlElement(name = "name")
+ public String getName()
+ {
+ return name;
+ }
+
+ public void setName(String name)
+ {
+ this.name = name;
+ }
+}
+
Added: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/metadata/ValidationErrorHandler.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/metadata/ValidationErrorHandler.java (rev 0)
+++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/metadata/ValidationErrorHandler.java 2008-01-08 01:54:30 UTC (rev 9450)
@@ -0,0 +1,52 @@
+/******************************************************************************
+ * 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.portlet.impl.metadata;
+
+import org.xml.sax.ErrorHandler;
+import org.xml.sax.SAXException;
+import org.xml.sax.SAXParseException;
+/**
+ * @author <a href="mailto:emuckenh@redhat.com">Emanuel Muckenhuber</a>
+ * @version $Revision$
+ */
+public class ValidationErrorHandler implements ErrorHandler
+{
+
+ public void error(SAXParseException e) throws SAXException
+ {
+ throw new SAXException("Syntax error on line: " + e.getLineNumber() + ", column: " + e.getColumnNumber() + "\n"
+ + e.getMessage());
+ }
+
+ public void fatalError(SAXParseException e) throws SAXException
+ {
+ throw new SAXException("Fatal syntax error on line: " + e.getLineNumber() + ", column: " + e.getColumnNumber()
+ + "\n" + e.getMessage());
+ }
+
+ public void warning(SAXParseException e) throws SAXException
+ {
+ // TODO - maybe logging or similar stuff
+ }
+
+}
\ No newline at end of file
Added: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/metadata/adapter/ContainerRuntimeAdapter.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/metadata/adapter/ContainerRuntimeAdapter.java (rev 0)
+++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/metadata/adapter/ContainerRuntimeAdapter.java 2008-01-08 01:54:30 UTC (rev 9450)
@@ -0,0 +1,58 @@
+/******************************************************************************
+ * 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.portlet.impl.metadata.adapter;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import javax.xml.bind.annotation.adapters.XmlAdapter;
+
+import org.jboss.portal.portlet.impl.metadata.common.ContainerRuntimeMetaData;
+
+/**
+ * @author <a href="mailto:emuckenh@redhat.com">Emanuel Muckenhuber</a>
+ * @version $Revision$
+ */
+public class ContainerRuntimeAdapter
+ extends XmlAdapter<List<ContainerRuntimeMetaData>, java.util.Map<String, ContainerRuntimeMetaData>>
+{
+
+ @Override
+ public List<ContainerRuntimeMetaData> marshal(Map<String, ContainerRuntimeMetaData> map) throws Exception
+ {
+ throw new RuntimeException("Not yet implemented.");
+ }
+
+ @Override
+ public Map<String, ContainerRuntimeMetaData> unmarshal(List<ContainerRuntimeMetaData> list) throws Exception
+ {
+ Map<String, ContainerRuntimeMetaData> map = new HashMap<String, ContainerRuntimeMetaData>();
+ for (ContainerRuntimeMetaData c : list)
+ {
+ map.put(c.getName(), c);
+ }
+ return map;
+ }
+
+}
Added: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/metadata/adapter/CustomPortletModeAdapter.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/metadata/adapter/CustomPortletModeAdapter.java (rev 0)
+++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/metadata/adapter/CustomPortletModeAdapter.java 2008-01-08 01:54:30 UTC (rev 9450)
@@ -0,0 +1,59 @@
+/******************************************************************************
+ * 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.portlet.impl.metadata.adapter;
+
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
+
+import javax.xml.bind.annotation.adapters.XmlAdapter;
+
+import org.jboss.portal.portlet.impl.metadata.CustomPortletModeMetaData;
+
+/**
+ * @author <a href="mailto:emuckenh@redhat.com">Emanuel Muckenhuber</a>
+ * @version $Revision$
+ */
+public class CustomPortletModeAdapter extends XmlAdapter<List<CustomPortletModeMetaData>, Map<String, CustomPortletModeMetaData>>
+{
+
+ @Override
+ public List<CustomPortletModeMetaData> marshal(Map<String, CustomPortletModeMetaData> map) throws Exception
+ {
+ // FIXME marshal
+ return null;
+ }
+
+ @Override
+ public Map<String, CustomPortletModeMetaData> unmarshal(List<CustomPortletModeMetaData> list) throws Exception
+ {
+ Map<String, CustomPortletModeMetaData> map = new LinkedHashMap<String, CustomPortletModeMetaData>();
+ for (CustomPortletModeMetaData md : list)
+ {
+ map.put(md.getPortletMode(), md);
+ }
+ return map;
+ }
+
+}
+
Added: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/metadata/adapter/CustomWindowStateAdapter.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/metadata/adapter/CustomWindowStateAdapter.java (rev 0)
+++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/metadata/adapter/CustomWindowStateAdapter.java 2008-01-08 01:54:30 UTC (rev 9450)
@@ -0,0 +1,59 @@
+/******************************************************************************
+ * 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.portlet.impl.metadata.adapter;
+
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
+
+import javax.xml.bind.annotation.adapters.XmlAdapter;
+
+import org.jboss.portal.portlet.impl.metadata.CustomWindowStateMetaData;
+
+/**
+ * @author <a href="mailto:emuckenh@redhat.com">Emanuel Muckenhuber</a>
+ * @version $Revision$
+ */
+public class CustomWindowStateAdapter extends XmlAdapter<List<CustomWindowStateMetaData>, Map<String, CustomWindowStateMetaData>>
+{
+
+ @Override
+ public List<CustomWindowStateMetaData> marshal(Map<String, CustomWindowStateMetaData> map) throws Exception
+ {
+ // FIXME marshal
+ return null;
+ }
+
+ @Override
+ public Map<String, CustomWindowStateMetaData> unmarshal(List<CustomWindowStateMetaData> list) throws Exception
+ {
+ Map<String, CustomWindowStateMetaData> map = new LinkedHashMap<String, CustomWindowStateMetaData>();
+ for(CustomWindowStateMetaData md : list)
+ {
+ map.put(md.getWindowState(), md);
+ }
+ return map;
+ }
+
+}
+
Added: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/metadata/adapter/EventListAdapter.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/metadata/adapter/EventListAdapter.java (rev 0)
+++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/metadata/adapter/EventListAdapter.java 2008-01-08 01:54:30 UTC (rev 9450)
@@ -0,0 +1,57 @@
+/******************************************************************************
+ * 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.portlet.impl.metadata.adapter;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import javax.xml.bind.annotation.adapters.XmlAdapter;
+
+import org.jboss.portal.portlet.impl.metadata.event.EventDefinitionMetaData;
+
+/**
+ * @author <a href="mailto:emuckenh@redhat.com">Emanuel Muckenhuber</a>
+ * @version $Revision$
+ */
+public final class EventListAdapter
+ extends XmlAdapter<EventDefinitionMetaData[], Map<String, EventDefinitionMetaData>>
+{
+
+ @Override
+ public EventDefinitionMetaData[] marshal(Map<String, EventDefinitionMetaData> eventMap) throws Exception
+ {
+ throw new RuntimeException("Not yet implemented.");
+ }
+
+ @Override
+ public Map<String, EventDefinitionMetaData> unmarshal(EventDefinitionMetaData[] eventList) throws Exception
+ {
+ Map<String, EventDefinitionMetaData> eventMap = new HashMap<String, EventDefinitionMetaData>();
+ for (EventDefinitionMetaData eventDef : eventList)
+ {
+ eventMap.put(eventDef.getQname().getLocalPart(), eventDef);
+ }
+ return eventMap;
+ }
+
+}
Added: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/metadata/adapter/FilterAdapter.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/metadata/adapter/FilterAdapter.java (rev 0)
+++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/metadata/adapter/FilterAdapter.java 2008-01-08 01:54:30 UTC (rev 9450)
@@ -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.portlet.impl.metadata.adapter;
+
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
+
+import javax.xml.bind.annotation.adapters.XmlAdapter;
+
+import org.jboss.portal.portlet.impl.metadata.filter.FilterMetaData;
+
+/**
+ * @author <a href="mailto:emuckenh@redhat.com">Emanuel Muckenhuber</a>
+ * @version $Revision$
+ */
+public class FilterAdapter
+ extends XmlAdapter<List<FilterMetaData>, Map<String, FilterMetaData>>
+{
+
+ @Override
+ public List<FilterMetaData> marshal(Map<String, FilterMetaData> map) throws Exception
+ {
+ throw new RuntimeException("Not yet implemented.");
+ }
+
+ @Override
+ public Map<String, FilterMetaData> unmarshal(List<FilterMetaData> list) throws Exception
+ {
+ Map<String, FilterMetaData> map = new LinkedHashMap<String, FilterMetaData>();
+ for (FilterMetaData f : list)
+ {
+ String filterName = f.getFilterName();
+ if (!map.containsKey(filterName))
+ {
+ map.put(filterName, f);
+ }
+ else
+ {
+ throw new IllegalArgumentException("Duplicate filter: " + filterName);
+ }
+ }
+ return map;
+ }
+
+}
Added: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/metadata/adapter/FilterMappingAdapter.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/metadata/adapter/FilterMappingAdapter.java (rev 0)
+++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/metadata/adapter/FilterMappingAdapter.java 2008-01-08 01:54:30 UTC (rev 9450)
@@ -0,0 +1,58 @@
+/******************************************************************************
+ * 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.portlet.impl.metadata.adapter;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import javax.xml.bind.annotation.adapters.XmlAdapter;
+
+import org.jboss.portal.portlet.impl.metadata.filter.FilterMappingMetaData;
+
+/**
+ * @author <a href="mailto:emuckenh@redhat.com">Emanuel Muckenhuber</a>
+ * @version $Revision$
+ */
+public class FilterMappingAdapter
+ extends XmlAdapter<List<FilterMappingMetaData>, Map<String, FilterMappingMetaData>>
+{
+
+ @Override
+ public List<FilterMappingMetaData> marshal(Map<String, FilterMappingMetaData> arg0) throws Exception
+ {
+ throw new RuntimeException("Not yet implemented.");
+ }
+
+ @Override
+ public Map<String, FilterMappingMetaData> unmarshal(List<FilterMappingMetaData> list) throws Exception
+ {
+ Map<String, FilterMappingMetaData> map = new HashMap<String, FilterMappingMetaData>();
+ for (FilterMappingMetaData f : list)
+ {
+ map.put(f.getName(), f);
+ }
+ return map;
+ }
+
+}
Added: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/metadata/adapter/LocalizedStringAdapter.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/metadata/adapter/LocalizedStringAdapter.java (rev 0)
+++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/metadata/adapter/LocalizedStringAdapter.java 2008-01-08 01:54:30 UTC (rev 9450)
@@ -0,0 +1,63 @@
+/******************************************************************************
+ * 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.portlet.impl.metadata.adapter;
+
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Locale;
+import java.util.Map;
+
+import javax.xml.bind.annotation.adapters.XmlAdapter;
+
+import org.jboss.portal.common.i18n.LocaleFormat;
+import org.jboss.portal.common.i18n.LocalizedString;
+import static org.jboss.portal.portlet.impl.metadata.PortletMetaDataConstants.*;
+import org.jboss.portal.portlet.impl.metadata.common.LocalizedDescriptionMetaData;
+
+/**
+ * @author <a href="mailto:emuckenh@redhat.com">Emanuel Muckenhuber</a>
+ * @version $Revision$
+ */
+public class LocalizedStringAdapter
+ extends XmlAdapter<List<LocalizedDescriptionMetaData>, LocalizedString>
+{
+
+ @Override
+ public List<LocalizedDescriptionMetaData> marshal(LocalizedString arg0) throws Exception
+ {
+ throw new RuntimeException("Not yet implemented.");
+ }
+
+ @Override
+ public LocalizedString unmarshal(List<LocalizedDescriptionMetaData> descriptionList) throws Exception
+ {
+ Map<Locale, String> map = new LinkedHashMap<Locale, String>();
+ for (LocalizedDescriptionMetaData d : descriptionList)
+ {
+ Locale locale = LocaleFormat.DEFAULT.getLocale(d.getLang());
+ map.put(locale, d.getDescription());
+ }
+ return new LocalizedString(map, new Locale(DEFAULT_LOCALE));
+ }
+
+}
Added: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/metadata/adapter/PortletListAdapter.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/metadata/adapter/PortletListAdapter.java (rev 0)
+++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/metadata/adapter/PortletListAdapter.java 2008-01-08 01:54:30 UTC (rev 9450)
@@ -0,0 +1,65 @@
+/******************************************************************************
+ * 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.portlet.impl.metadata.adapter;
+
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
+
+import javax.xml.bind.annotation.adapters.XmlAdapter;
+
+import org.jboss.portal.portlet.impl.metadata.portlet.PortletMetaData;
+
+/**
+ * @author <a href="mailto:emuckenh@redhat.com">Emanuel Muckenhuber</a>
+ * @version $Revision$
+ */
+public final class PortletListAdapter
+ extends XmlAdapter<List<PortletMetaData>, Map<String, PortletMetaData>>
+{
+
+ @Override
+ public List<PortletMetaData> marshal(Map<String, PortletMetaData> portletMap) throws Exception
+ {
+ throw new RuntimeException("Not yet implemented.");
+ }
+
+ @Override
+ public Map<String, PortletMetaData> unmarshal(List<PortletMetaData> portletList) throws Exception
+ {
+ Map<String, PortletMetaData> portletMap = new LinkedHashMap<String, PortletMetaData>();
+ for (PortletMetaData portlet : portletList)
+ {
+ if (!portletMap.containsKey(portlet.getPortletName()))
+ {
+ portletMap.put(portlet.getPortletName(), portlet);
+ }
+ else
+ {
+ throw new IllegalArgumentException("Portlet name '" + portlet.getPortletName() + "' already defined.");
+ }
+ }
+ return portletMap;
+ }
+
+}
Added: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/metadata/adapter/PortletPreferencesListAdapter.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/metadata/adapter/PortletPreferencesListAdapter.java (rev 0)
+++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/metadata/adapter/PortletPreferencesListAdapter.java 2008-01-08 01:54:30 UTC (rev 9450)
@@ -0,0 +1,58 @@
+/******************************************************************************
+ * 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.portlet.impl.metadata.adapter;
+
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
+
+import javax.xml.bind.annotation.adapters.XmlAdapter;
+
+import org.jboss.portal.portlet.impl.metadata.portlet.PortletPreferenceMetaData;
+
+/**
+ * @author <a href="mailto:emuckenh@redhat.com">Emanuel Muckenhuber</a>
+ * @version $Revision$
+ */
+public class PortletPreferencesListAdapter
+ extends XmlAdapter<List<PortletPreferenceMetaData>, Map<String, PortletPreferenceMetaData>>
+{
+
+ @Override
+ public List<PortletPreferenceMetaData> marshal(Map<String, PortletPreferenceMetaData> arg0) throws Exception
+ {
+ throw new RuntimeException("Not yet implemented.");
+ }
+
+ @Override
+ public Map<String, PortletPreferenceMetaData> unmarshal(List<PortletPreferenceMetaData> list) throws Exception
+ {
+ Map<String, PortletPreferenceMetaData> map = new LinkedHashMap<String, PortletPreferenceMetaData>();
+ for (PortletPreferenceMetaData p : list)
+ {
+ map.put(p.getName(), p);
+ }
+ return map;
+ }
+
+}
Added: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/metadata/adapter/UserAttributeAdapter.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/metadata/adapter/UserAttributeAdapter.java (rev 0)
+++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/metadata/adapter/UserAttributeAdapter.java 2008-01-08 01:54:30 UTC (rev 9450)
@@ -0,0 +1,67 @@
+/******************************************************************************
+ * 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.portlet.impl.metadata.adapter;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import javax.xml.bind.annotation.adapters.XmlAdapter;
+
+import org.jboss.portal.portlet.impl.metadata.UserAttributeMetaData;
+
+/**
+ * @author <a href="mailto:emuckenh@redhat.com">Emanuel Muckenhuber</a>
+ * @version $Revision$
+ */
+
+public class UserAttributeAdapter
+ extends XmlAdapter<List<UserAttributeMetaData>, Map<String, UserAttributeMetaData>>
+{
+
+ @Override
+ public List<UserAttributeMetaData> marshal(Map<String, UserAttributeMetaData> arg0) throws Exception
+ {
+ throw new RuntimeException("Not yet implemented.");
+ }
+
+ @Override
+ public Map<String, UserAttributeMetaData> unmarshal(List<UserAttributeMetaData> list) throws Exception
+ {
+ HashMap<String, UserAttributeMetaData> m = new HashMap<String, UserAttributeMetaData>();
+ for (UserAttributeMetaData a : list)
+ {
+ String userAttributeName = a.getName();
+ if (!m.containsKey(userAttributeName))
+ {
+ m.put(a.getName(), a);
+ }
+ else
+ {
+ throw new IllegalArgumentException("Duplicate user-attribute: " + userAttributeName);
+ }
+ }
+ return m;
+ }
+
+}
Added: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/metadata/common/ContainerRuntimeMetaData.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/metadata/common/ContainerRuntimeMetaData.java (rev 0)
+++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/metadata/common/ContainerRuntimeMetaData.java 2008-01-08 01:54:30 UTC (rev 9450)
@@ -0,0 +1,75 @@
+/******************************************************************************
+ * 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.portlet.impl.metadata.common;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlType;
+
+/**
+ * @author <a href="mailto:emuckenh@redhat.com">Emanuel Muckenhuber</a>
+ * @version $Revision$
+ */
+@XmlType(name = "container-runtime-optionType")
+public class ContainerRuntimeMetaData
+{
+
+ /** The name */
+ private String name;
+
+ /** The value list */
+ private List<String> values;
+
+ @XmlElement(name = "name")
+ public String getName()
+ {
+ return name;
+ }
+
+ public void setName(String name)
+ {
+ this.name = name;
+ }
+
+ @XmlElement(name = "value")
+ public List<String> getValues()
+ {
+ return values;
+ }
+
+ public void setValues(List<String> values)
+ {
+ this.values = values;
+ }
+
+ public void addValue(String value)
+ {
+ if( this.values == null)
+ {
+ this.values = new ArrayList<String>();
+ }
+ this.values.add(value);
+ }
+}
Added: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/metadata/common/DescribableMetaData.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/metadata/common/DescribableMetaData.java (rev 0)
+++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/metadata/common/DescribableMetaData.java 2008-01-08 01:54:30 UTC (rev 9450)
@@ -0,0 +1,53 @@
+/******************************************************************************
+ * 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.portlet.impl.metadata.common;
+
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
+
+import org.jboss.portal.common.i18n.LocalizedString;
+import org.jboss.portal.portlet.impl.metadata.adapter.LocalizedStringAdapter;
+
+/**
+ * @author <a href="mailto:emuckenh@redhat.com">Emanuel Muckenhuber</a>
+ * @version $Revision$
+ */
+public abstract class DescribableMetaData
+{
+
+ /** The description */
+ private LocalizedString description;
+
+ @XmlElement(name = "description")
+ @XmlJavaTypeAdapter(value= LocalizedStringAdapter.class, type=LocalizedString.class)
+ public LocalizedString getDescription()
+ {
+ return description;
+ }
+
+ public void setDescription(LocalizedString description)
+ {
+ this.description = description;
+ }
+
+}
Added: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/metadata/common/InitParamMetaData.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/metadata/common/InitParamMetaData.java (rev 0)
+++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/metadata/common/InitParamMetaData.java 2008-01-08 01:54:30 UTC (rev 9450)
@@ -0,0 +1,90 @@
+/******************************************************************************
+ * 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.portlet.impl.metadata.common;
+
+import javax.xml.bind.annotation.XmlAttribute;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlType;
+import javax.xml.bind.annotation.adapters.CollapsedStringAdapter;
+import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
+
+/**
+ * @author <a href="mailto:emuckenh@redhat.com">Emanuel Muckenhuber</a>
+ * @version $Revision$
+ */
+@XmlType(name = "init-paramType")
+public class InitParamMetaData extends DescribableMetaData
+{
+
+ /** The init param id */
+ private String id;
+
+ /** The init param name */
+ private String name;
+
+ /** The init param value */
+ private String value;
+
+ public InitParamMetaData() {}
+
+ public InitParamMetaData(String id)
+ {
+ this.id = id;
+ }
+
+ @XmlAttribute
+ public String getId()
+ {
+ return id;
+ }
+
+ public void setId(String id)
+ {
+ this.id = id;
+ }
+
+ @XmlElement(name = "name")
+ @XmlJavaTypeAdapter(CollapsedStringAdapter.class)
+ public String getName()
+ {
+ return name;
+ }
+
+ public void setName(String name)
+ {
+ this.name = name;
+ }
+
+ @XmlElement(name = "value")
+ @XmlJavaTypeAdapter(CollapsedStringAdapter.class)
+ public String getValue()
+ {
+ return value;
+ }
+
+ public void setValue(String value)
+ {
+ this.value = value;
+ }
+
+}
Added: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/metadata/common/LocalizedDescriptionMetaData.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/metadata/common/LocalizedDescriptionMetaData.java (rev 0)
+++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/metadata/common/LocalizedDescriptionMetaData.java 2008-01-08 01:54:30 UTC (rev 9450)
@@ -0,0 +1,76 @@
+/******************************************************************************
+ * 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.portlet.impl.metadata.common;
+
+import javax.xml.bind.annotation.XmlAttribute;
+import javax.xml.bind.annotation.XmlType;
+import javax.xml.bind.annotation.XmlValue;
+
+import org.jboss.portal.portlet.impl.metadata.PortletMetaDataConstants;
+
+/**
+ *
+ * @author <a href="mailto:emuckenh@redhat.com">Emanuel Muckenhuber</a>
+ * @version $Revision$
+ */
+@XmlType(name = "descriptionType")
+public class LocalizedDescriptionMetaData
+{
+
+ /** The lang */
+ private String lang = "en";
+
+ /** The description */
+ private String description;
+
+ public LocalizedDescriptionMetaData() {}
+
+ public LocalizedDescriptionMetaData(String lang)
+ {
+ this.lang = lang;
+ }
+
+ @XmlAttribute(name = "lang",
+ namespace = PortletMetaDataConstants.NS_XML_NAMESPACE)
+ public String getLang()
+ {
+ return this.lang;
+ }
+
+ public void setLang(String lang)
+ {
+ this.lang = lang;
+ }
+
+ @XmlValue
+ public String getDescription()
+ {
+ return description;
+ }
+
+ public void setDescription(String description)
+ {
+ this.description = description;
+ }
+
+}
Added: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/metadata/event/EventDefinitionMetaData.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/metadata/event/EventDefinitionMetaData.java (rev 0)
+++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/metadata/event/EventDefinitionMetaData.java 2008-01-08 01:54:30 UTC (rev 9450)
@@ -0,0 +1,130 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.portlet.impl.metadata.event;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.xml.bind.annotation.XmlAttribute;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlType;
+import javax.xml.bind.annotation.adapters.CollapsedStringAdapter;
+import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
+import javax.xml.namespace.QName;
+
+import org.jboss.portal.portlet.impl.metadata.common.DescribableMetaData;
+
+/**
+ * @author <a href="mailto:emuckenh@redhat.com">Emanuel Muckenhuber</a>
+ * @version $Revision$
+ */
+@XmlType(name = "event-definitionType")
+public class EventDefinitionMetaData extends DescribableMetaData
+{
+ /** The event definition id */
+ private String id;
+
+ /** The QName */
+ private QName qname;
+
+ /** The name */
+ private String name;
+
+ /** The value-type */
+ private String valueType;
+
+ /** The alias */
+ private List<QName> alias;
+
+ public EventDefinitionMetaData() {}
+
+ public EventDefinitionMetaData(String id)
+ {
+ this.id = id;
+ }
+
+ @XmlAttribute(name = "id")
+ public String getId()
+ {
+ return id;
+ }
+
+ public void setId(String id)
+ {
+ this.id = id;
+ }
+
+ @XmlElement(name = "qname")
+ public QName getQname()
+ {
+ return qname;
+ }
+
+ public void setQname(QName qname)
+ {
+ this.qname = qname;
+ }
+
+ @XmlElement(name = "name")
+ public String getName()
+ {
+ return name;
+ }
+
+ public void setName(String name)
+ {
+ this.name = name;
+ }
+
+ @XmlElement(name = "value-type")
+ @XmlJavaTypeAdapter(CollapsedStringAdapter.class)
+ public String getValueType()
+ {
+ return valueType;
+ }
+
+ public void setValueType(String valueType)
+ {
+ this.valueType = valueType;
+ }
+
+ @XmlElement(name = "alias")
+ public List<QName> getAlias()
+ {
+ return alias;
+ }
+
+ public void setAlias(List<QName> alias)
+ {
+ this.alias = alias;
+ }
+
+ public void addAlias(QName alias)
+ {
+ if (this.alias == null)
+ {
+ this.alias = new ArrayList<QName>();
+ }
+ this.alias.add(alias);
+ }
+}
Added: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/metadata/event/EventDefinitionReferenceMetaData.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/metadata/event/EventDefinitionReferenceMetaData.java (rev 0)
+++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/metadata/event/EventDefinitionReferenceMetaData.java 2008-01-08 01:54:30 UTC (rev 9450)
@@ -0,0 +1,86 @@
+/******************************************************************************
+ * 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.portlet.impl.metadata.event;
+
+import javax.xml.bind.annotation.XmlAttribute;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlType;
+import javax.xml.namespace.QName;
+
+/**
+ * @author <a href="mailto:emuckenh@redhat.com">Emanuel Muckenhuber</a>
+ * @version $Revision$
+ */
+@XmlType(name = "event-definition-referenceType")
+public class EventDefinitionReferenceMetaData
+{
+
+ /** The reference id */
+ private String id;
+
+ /** The qname */
+ private QName qname;
+
+ /** The name */
+ private String name;
+
+ public EventDefinitionReferenceMetaData() {}
+
+ public EventDefinitionReferenceMetaData(String id)
+ {
+ this.id = id;
+ }
+
+ @XmlAttribute(name = "id")
+ public String getId()
+ {
+ return id;
+ }
+
+ public void setId(String id)
+ {
+ this.id = id;
+ }
+
+ @XmlElement(name = "qname")
+ public QName getQname()
+ {
+ return qname;
+ }
+
+ public void setQname(QName qname)
+ {
+ this.qname = qname;
+ }
+
+ @XmlElement(name = "name")
+ public String getName()
+ {
+ return name;
+ }
+
+ public void setName(String name)
+ {
+ this.name = name;
+ }
+}
Added: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/metadata/filter/FilterMappingMetaData.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/metadata/filter/FilterMappingMetaData.java (rev 0)
+++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/metadata/filter/FilterMappingMetaData.java 2008-01-08 01:54:30 UTC (rev 9450)
@@ -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.portlet.impl.metadata.filter;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlType;
+
+/**
+ * @author <a href="mailto:emuckenh@redhat.com">Emanuel Muckenhuber</a>
+ * @version $Revision$
+ */
+
+@XmlType(name = "filter-mappingType")
+public class FilterMappingMetaData
+{
+
+ /** The filter name */
+ private String name;
+
+ /** The mapped portlet names */
+ private List<String> portletNames;
+
+ @XmlElement(name = "filter-name")
+ public String getName()
+ {
+ return name;
+ }
+
+ public void setName(String name)
+ {
+ this.name = name;
+ }
+
+ @XmlElement(name = "portlet-name")
+ public List<String> getPortletNames()
+ {
+ return portletNames;
+ }
+
+ public void setPortletNames(List<String> portletNames)
+ {
+ this.portletNames = portletNames;
+ }
+
+ public void addPortletName(String portletName)
+ {
+ if( this.portletNames == null)
+ {
+ this.portletNames = new ArrayList<String>();
+ }
+ this.portletNames.add(portletName);
+ }
+
+}
Added: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/metadata/filter/FilterMetaData.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/metadata/filter/FilterMetaData.java (rev 0)
+++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/metadata/filter/FilterMetaData.java 2008-01-08 01:54:30 UTC (rev 9450)
@@ -0,0 +1,141 @@
+/******************************************************************************
+ * 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.portlet.impl.metadata.filter;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlType;
+import javax.xml.bind.annotation.adapters.CollapsedStringAdapter;
+import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
+
+import org.jboss.portal.common.i18n.LocalizedString;
+import org.jboss.portal.portlet.impl.metadata.PortletMetaDataConstants;
+import org.jboss.portal.portlet.impl.metadata.common.InitParamMetaData;
+import org.jboss.portal.portlet.impl.metadata.adapter.LocalizedStringAdapter;
+import org.jboss.portal.portlet.impl.metadata.common.DescribableMetaData;
+
+/**
+ * @author <a href="mailto:emuckenh@redhat.com">Emanuel Muckenhuber</a>
+ * @version $Revision$
+ */
+
+@XmlType(name = "filterType", namespace = PortletMetaDataConstants.PORTLET_JSR_286_NS,
+ propOrder = {"description", "displayName", "filterName", "filterClass", "lifecycle", "initParams"})
+public class FilterMetaData extends DescribableMetaData
+{
+ /** The filter name */
+ private String filterName;
+
+ /** The filter class */
+ private String filterClass;
+
+ /** The filter lifecycle */
+ private List<String> lifecycle;
+
+ /** The filter display name */
+ private LocalizedString displayName;
+
+ /** The filter init parameters */
+ private List<InitParamMetaData> initParams;
+
+ @XmlElement(name = "filter-name", required = true)
+ @XmlJavaTypeAdapter(CollapsedStringAdapter.class)
+ public String getFilterName()
+ {
+ return filterName;
+ }
+
+ public void setFilterName(String filterName)
+ {
+ this.filterName = filterName;
+ }
+
+ @XmlElement(name = "filter-class", required = true)
+ @XmlJavaTypeAdapter(CollapsedStringAdapter.class)
+ public String getFilterClass()
+ {
+ return filterClass;
+ }
+
+ public void setFilterClass(String filterClass)
+ {
+ this.filterClass = filterClass;
+ }
+
+ @XmlElement(name = "lifecycle", required = true)
+// @XmlJavaTypeAdapter(FilterLifeCycleAdapter.class)
+// public List<LifeCycleEnumMetaData> getLifecycle()
+ public List<String> getLifecycle()
+ {
+ return lifecycle;
+ }
+
+ public void setLifecycle(List<String> lifecycle)
+ {
+ this.lifecycle = lifecycle;
+ }
+
+ public void addLifecycle(String lifecycle)
+ {
+ if( this.lifecycle == null)
+ {
+ this.lifecycle = new ArrayList<String>();
+ }
+ this.lifecycle.add(lifecycle);
+ }
+
+ @XmlElement(name = "display-name")
+ @XmlJavaTypeAdapter(LocalizedStringAdapter.class)
+ public LocalizedString getDisplayName()
+ {
+ return displayName;
+ }
+
+ public void setDisplayName(LocalizedString displayNames)
+ {
+ this.displayName = displayNames;
+ }
+
+ @XmlElement(name = "init-param")
+ public List<InitParamMetaData> getInitParams()
+ {
+ return initParams;
+ }
+
+ public void setInitParams(List<InitParamMetaData> initParams)
+ {
+ this.initParams = initParams;
+ }
+
+ public void addInitParam(InitParamMetaData initParam)
+ {
+ if(this.initParams == null)
+ {
+ this.initParams = new ArrayList<InitParamMetaData>();
+ }
+ this.initParams.add(initParam);
+ }
+
+}
\ No newline at end of file
Added: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/metadata/portlet/PortletCacheScopeEnum.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/metadata/portlet/PortletCacheScopeEnum.java (rev 0)
+++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/metadata/portlet/PortletCacheScopeEnum.java 2008-01-08 01:54:30 UTC (rev 9450)
@@ -0,0 +1,40 @@
+/******************************************************************************
+ * 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.portlet.impl.metadata.portlet;
+
+import javax.xml.bind.annotation.XmlEnum;
+
+/**
+ * @author <a href="mailto:emuckenh@redhat.com">Emanuel Muckenhuber</a>
+ * @version $Revision$
+ */
+@XmlEnum
+public enum PortletCacheScopeEnum {
+
+ /** The private cache scope */
+ PRIVATE,
+
+ /** The public cache scope */
+ PUBLIC
+
+}
Added: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/metadata/portlet/PortletInfoMetaData.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/metadata/portlet/PortletInfoMetaData.java (rev 0)
+++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/metadata/portlet/PortletInfoMetaData.java 2008-01-08 01:54:30 UTC (rev 9450)
@@ -0,0 +1,102 @@
+/******************************************************************************
+ * 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.portlet.impl.metadata.portlet;
+
+import javax.xml.bind.annotation.XmlAttribute;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlType;
+
+
+/**
+ * @author <a href="mailto:emuckenh@redhat.com">Emanuel Muckenhuber</a>
+ * @version $Revision$
+ */
+@XmlType(name = "portlet-infoType")
+public class PortletInfoMetaData
+{
+
+ /** The portlet info id */
+ private String id;
+
+ /** The portlet title */
+ private String title;
+
+ /** The portlet short-title */
+ private String shortTitle;
+
+ /* The portlet keywords*/
+ private String keywords;
+
+ public PortletInfoMetaData() {}
+
+ public PortletInfoMetaData(String id)
+ {
+ this.id = id;
+ }
+
+ @XmlAttribute(name = "id")
+ public String getId()
+ {
+ return id;
+ }
+
+ public void setId(String id)
+ {
+ this.id = id;
+ }
+
+ @XmlElement(name = "title")
+ public String getTitle()
+ {
+ return title;
+ }
+
+ public void setTitle(String title)
+ {
+ this.title = title;
+ }
+
+ @XmlElement(name = "short-title")
+ public String getShortTitle()
+ {
+ return shortTitle;
+ }
+
+ public void setShortTitle(String shortTitle)
+ {
+ this.shortTitle = shortTitle;
+ }
+
+ @XmlElement(name = "keywords")
+// @XmlJavaTypeAdapter(KeywordsAdapter.class)
+ public String getKeywords()
+ {
+ return keywords;
+ }
+
+ public void setKeywords(String keywords)
+ {
+ this.keywords = keywords;
+ }
+
+}
Added: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/metadata/portlet/PortletMetaData.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/metadata/portlet/PortletMetaData.java (rev 0)
+++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/metadata/portlet/PortletMetaData.java 2008-01-08 01:54:30 UTC (rev 9450)
@@ -0,0 +1,387 @@
+/******************************************************************************
+ * 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.portlet.impl.metadata.portlet;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import javax.xml.bind.annotation.XmlAttribute;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlType;
+import javax.xml.bind.annotation.adapters.CollapsedStringAdapter;
+import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
+
+import org.jboss.portal.common.i18n.LocalizedString;
+import org.jboss.portal.portlet.impl.metadata.PortletMetaDataConstants;
+import org.jboss.portal.portlet.impl.metadata.event.EventDefinitionReferenceMetaData;
+import org.jboss.portal.portlet.impl.metadata.adapter.LocalizedStringAdapter;
+import org.jboss.portal.portlet.impl.metadata.adapter.ContainerRuntimeAdapter;
+import org.jboss.portal.portlet.impl.metadata.common.ContainerRuntimeMetaData;
+import org.jboss.portal.portlet.impl.metadata.common.InitParamMetaData;
+import org.jboss.portal.portlet.impl.metadata.common.DescribableMetaData;
+
+/**
+ * @author <a href="mailto:emuckenh@redhat.com">Emanuel Muckenhuber</a>
+ * @version $Revision$
+ */
+@XmlType(name = "portletType",
+ propOrder = {"id", "description", "portletName", "displayName", "portletClass", "initParams", "expirationCache", "cacheScope",
+ "supports", "supportedLocale", "resourceBundle", "portletInfo", "portletPreferences", "securityRoleRef",
+ "supportedProcessingEvent", "supportedPublishingEvent", "supportedPublicRenderParameters",
+ "containerRuntimeOptions"})
+public class PortletMetaData extends DescribableMetaData
+{
+
+ /** The portlet id */
+ private String id;
+
+ /** The portlet name */
+ private String portletName;
+
+ /** The portlet class */
+ private String portletClass;
+
+ /** The portlet display name */
+ private LocalizedString displayName;
+
+ /** The portlet init parameters */
+ private List<InitParamMetaData> initParams;
+
+ /** The portlet expiration cache */
+ private int expirationCache;
+
+ /** The cache scope */
+ private PortletCacheScopeEnum cacheScope = PortletCacheScopeEnum.PRIVATE;
+
+ /** The supports */
+ private List<SupportsMetaData> supports;
+
+ /** The supported locale */
+ private List<SupportedLocaleMetaData> supportedLocale;
+
+ /** The resource bundle */
+ private String resourceBundle;
+
+ /** The portlet info */
+ private PortletInfoMetaData portletInfo;
+
+ /** The portlet preferences */
+ private PortletPreferencesMetaData portletPreferences;
+
+ /** The portlet security role references */
+ private List<SecurityRoleRefMetaData> securityRoleRef;
+
+ /** The portlet event supported processing event */
+ private List<EventDefinitionReferenceMetaData> supportedProcessingEvent;
+
+ /** The portlet event supported publishing event */
+ private List<EventDefinitionReferenceMetaData> supportedPublishingEvent;
+
+ /** The portlet supported public render parameters */
+ private List<String> supportedPublicRenderParameters;
+
+ /** The portlet container runtime options */
+ private Map<String, ContainerRuntimeMetaData> containerRuntimeOptions;
+
+ public PortletMetaData() {}
+
+ public PortletMetaData(String id)
+ {
+ this.id = id;
+ }
+
+ @XmlAttribute(name = "id")
+ public String getId()
+ {
+ return id;
+ }
+
+ public void setId(String id)
+ {
+ this.id = id;
+ }
+
+ @XmlElement(name = "portlet-name",
+ required = true)
+ @XmlJavaTypeAdapter(CollapsedStringAdapter.class)
+ public String getPortletName()
+ {
+ return portletName;
+ }
+
+ public void setPortletName(String portletName)
+ {
+ this.portletName = portletName;
+ }
+
+ @XmlElement(name = "portlet-class",
+ required = true)
+ @XmlJavaTypeAdapter(CollapsedStringAdapter.class)
+ public String getPortletClass()
+ {
+ return portletClass;
+ }
+
+ public void setPortletClass(String portletClass)
+ {
+ this.portletClass = portletClass;
+ }
+
+ @XmlElement(name = "display-name")
+ @XmlJavaTypeAdapter(LocalizedStringAdapter.class)
+ public LocalizedString getDisplayName()
+ {
+ return displayName;
+ }
+
+ public void setDisplayName(LocalizedString displayNames)
+ {
+ this.displayName = displayNames;
+ }
+
+ @XmlElement(name = "init-param")
+ public List<InitParamMetaData> getInitParams()
+ {
+ return initParams;
+ }
+
+ public void setInitParams(List<InitParamMetaData> initParams)
+ {
+ this.initParams = initParams;
+ }
+
+ public void addInitParam(InitParamMetaData initParam)
+ {
+ if (this.initParams == null)
+ {
+ this.initParams = new ArrayList<InitParamMetaData>();
+ }
+ this.initParams.add(initParam);
+ }
+
+ @XmlElement(name = "expiration-cache")
+ public int getExpirationCache()
+ {
+ return expirationCache;
+ }
+
+ public void setExpirationCache(int expirationCache)
+ {
+ this.expirationCache = expirationCache;
+ }
+
+ @XmlElement(name = "cache-scope",
+ namespace = PortletMetaDataConstants.PORTLET_JSR_286_NS, type = PortletCacheScopeEnum.class)
+ public PortletCacheScopeEnum getCacheScope()
+ {
+ return cacheScope;
+ }
+
+ public void setCacheScope(PortletCacheScopeEnum cacheScope)
+ {
+ this.cacheScope = cacheScope;
+ }
+
+ @XmlElement(name = "supports",
+ required = true)
+ public List<SupportsMetaData> getSupports()
+ {
+ return supports;
+ }
+
+ public void setSupports(List<SupportsMetaData> supports)
+ {
+ this.supports = supports;
+ }
+
+ public void addSupport(SupportsMetaData support)
+ {
+ if (this.supports == null)
+ {
+ this.supports = new ArrayList<SupportsMetaData>();
+ }
+ this.supports.add(support);
+ }
+
+ @XmlElement(name = "supported-locale")
+// @XmlJavaTypeAdapter(SupportedLocaleAdapter.class)
+ public List<SupportedLocaleMetaData> getSupportedLocale()
+ {
+ return supportedLocale;
+ }
+
+ public void setSupportedLocale(List<SupportedLocaleMetaData> supportedLocale)
+ {
+ this.supportedLocale = supportedLocale;
+ }
+
+ public void addSupportedLocale(SupportedLocaleMetaData supportedLocale)
+ {
+ if(this.supportedLocale == null)
+ {
+ this.supportedLocale = new ArrayList<SupportedLocaleMetaData>();
+ }
+ this.supportedLocale.add(supportedLocale);
+ }
+
+ @XmlElement(name = "resource-bundle")
+ @XmlJavaTypeAdapter(CollapsedStringAdapter.class)
+ public String getResourceBundle()
+ {
+ return resourceBundle;
+ }
+
+ public void setResourceBundle(String resourceBundle)
+ {
+ this.resourceBundle = resourceBundle;
+ }
+
+ @XmlElement(name = "portlet-info")
+ public PortletInfoMetaData getPortletInfo()
+ {
+ return portletInfo;
+ }
+
+ public void setPortletInfo(PortletInfoMetaData portletInfo)
+ {
+ this.portletInfo = portletInfo;
+ }
+
+ @XmlElement(name = "portlet-preferences")
+ public PortletPreferencesMetaData getPortletPreferences()
+ {
+ return portletPreferences;
+ }
+
+ public void setPortletPreferences(PortletPreferencesMetaData portletPreferences)
+ {
+ this.portletPreferences = portletPreferences;
+ }
+
+ @XmlElement(name = "security-role-ref")
+ public List<SecurityRoleRefMetaData> getSecurityRoleRef()
+ {
+ return securityRoleRef;
+ }
+
+ public void setSecurityRoleRef(List<SecurityRoleRefMetaData> securityRoleRef)
+ {
+ this.securityRoleRef = securityRoleRef;
+ }
+
+ public void addSecurityRoleRef(SecurityRoleRefMetaData securityRoleRef)
+ {
+ if (this.securityRoleRef == null)
+ {
+ this.securityRoleRef = new ArrayList<SecurityRoleRefMetaData>();
+ }
+ this.securityRoleRef.add(securityRoleRef);
+ }
+
+ @XmlElement(name = "supported-processing-event",
+ namespace = PortletMetaDataConstants.PORTLET_JSR_286_NS)
+ public List<EventDefinitionReferenceMetaData> getSupportedProcessingEvent()
+ {
+ return supportedProcessingEvent;
+ }
+
+ public void setSupportedProcessingEvent(List<EventDefinitionReferenceMetaData> supportedProcessingEvent)
+ {
+ this.supportedProcessingEvent = supportedProcessingEvent;
+ }
+
+ public void addSupportedProcessingEvent(EventDefinitionReferenceMetaData eventRef)
+ {
+ if (this.supportedProcessingEvent == null)
+ {
+ this.supportedProcessingEvent = new ArrayList<EventDefinitionReferenceMetaData>();
+ }
+ this.supportedProcessingEvent.add(eventRef);
+ }
+
+ @XmlElement(name = "supported-publishing-event",
+ namespace = PortletMetaDataConstants.PORTLET_JSR_286_NS)
+ public List<EventDefinitionReferenceMetaData> getSupportedPublishingEvent()
+ {
+ return supportedPublishingEvent;
+ }
+
+ public void setSupportedPublishingEvent(List<EventDefinitionReferenceMetaData> supportedPublishingEvent)
+ {
+ this.supportedPublishingEvent = supportedPublishingEvent;
+ }
+
+ public void addSupportedPublishingEvent(EventDefinitionReferenceMetaData eventRef)
+ {
+ if(this.supportedPublishingEvent == null)
+ {
+ this.supportedPublishingEvent = new ArrayList<EventDefinitionReferenceMetaData>();
+ }
+ this.supportedPublishingEvent.add(eventRef);
+ }
+
+ @XmlElement(name = "supported-public-render-parameter",
+ namespace = PortletMetaDataConstants.PORTLET_JSR_286_NS)
+ public List<String> getSupportedPublicRenderParameters()
+ {
+ return supportedPublicRenderParameters;
+ }
+
+ public void setSupportedPublicRenderParameters(List<String> supportedPublicRenderParameters)
+ {
+ this.supportedPublicRenderParameters = supportedPublicRenderParameters;
+ }
+
+ public void addSupportedPublicRenderParameter(String parameter)
+ {
+ if (this.supportedPublicRenderParameters == null)
+ {
+ this.supportedPublicRenderParameters = new ArrayList<String>();
+ }
+ this.supportedPublicRenderParameters.add(parameter);
+ }
+
+ @XmlElement(name = "container-runtime-option",
+ namespace = PortletMetaDataConstants.PORTLET_JSR_286_NS)
+ @XmlJavaTypeAdapter(ContainerRuntimeAdapter.class)
+ public Map<String, ContainerRuntimeMetaData> getContainerRuntimeOptions()
+ {
+ return containerRuntimeOptions;
+ }
+
+ public void setContainerRuntimeOptions(Map<String, ContainerRuntimeMetaData> containerRuntimeOptions)
+ {
+ this.containerRuntimeOptions = containerRuntimeOptions;
+ }
+
+ public void addContainerRuntime(ContainerRuntimeMetaData containerRuntimeOption)
+ {
+ if ( this.containerRuntimeOptions == null)
+ {
+ this.containerRuntimeOptions = new HashMap<String, ContainerRuntimeMetaData>();
+ }
+ this.containerRuntimeOptions.put(containerRuntimeOption.getName(), containerRuntimeOption);
+ }
+}
Added: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/metadata/portlet/PortletModeMetaData.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/metadata/portlet/PortletModeMetaData.java (rev 0)
+++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/metadata/portlet/PortletModeMetaData.java 2008-01-08 01:54:30 UTC (rev 9450)
@@ -0,0 +1,50 @@
+/******************************************************************************
+ * 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.portlet.impl.metadata.portlet;
+
+import javax.xml.bind.annotation.XmlType;
+import javax.xml.bind.annotation.XmlValue;
+
+/**
+ * @author <a href="mailto:emuckenh@redhat.com">Emanuel Muckenhuber</a>
+ * @version $Revision$
+ */
+
+@XmlType(name = "portlet-modeType")
+public class PortletModeMetaData
+{
+
+ /** The portlet mode */
+ private String portletMode;
+
+ @XmlValue
+ public String getPortletMode()
+ {
+ return portletMode;
+ }
+
+ public void setPortletMode(String portletMode)
+ {
+ this.portletMode = portletMode;
+ }
+}
Added: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/metadata/portlet/PortletPreferenceMetaData.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/metadata/portlet/PortletPreferenceMetaData.java (rev 0)
+++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/metadata/portlet/PortletPreferenceMetaData.java 2008-01-08 01:54:30 UTC (rev 9450)
@@ -0,0 +1,112 @@
+/******************************************************************************
+ * 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.portlet.impl.metadata.portlet;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.xml.bind.annotation.XmlAttribute;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlType;
+
+/**
+ * @author <a href="mailto:emuckenh@redhat.com">Emanuel Muckenhuber</a>
+ * @version $Revision$
+ */
+@XmlType(name = "portlet-preferenceType")
+public class PortletPreferenceMetaData
+{
+
+ /** The portlet preference id */
+ private String id;
+
+ /** The portlet preference name */
+ private String name;
+
+ /** The portlet preference value */
+ private List<String> value;
+
+ /** Is read only */
+ private boolean readOnly;
+
+ public PortletPreferenceMetaData() {}
+
+ public PortletPreferenceMetaData(String id)
+ {
+ this.id = id;
+ }
+
+ @XmlAttribute(name = "id")
+ public String getId()
+ {
+ return id;
+ }
+
+ public void setId(String id)
+ {
+ this.id = id;
+ }
+
+ @XmlElement(name = "name")
+ public String getName()
+ {
+ return name;
+ }
+
+ public void setName(String name)
+ {
+ this.name = name;
+ }
+
+ @XmlElement(name = "value")
+ public List<String> getValue()
+ {
+ return value;
+ }
+
+ public void setValue(List<String> value)
+ {
+ this.value = value;
+ }
+
+ public void addValue(String value)
+ {
+ if (this.value == null)
+ {
+ this.value = new ArrayList<String>();
+ }
+ this.value.add(value);
+ }
+
+ @XmlElement(name = "read-only")
+ public boolean isReadOnly()
+ {
+ return readOnly;
+ }
+
+ public void setReadOnly(boolean readOnly)
+ {
+ this.readOnly = readOnly;
+ }
+
+}
Added: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/metadata/portlet/PortletPreferencesMetaData.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/metadata/portlet/PortletPreferencesMetaData.java (rev 0)
+++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/metadata/portlet/PortletPreferencesMetaData.java 2008-01-08 01:54:30 UTC (rev 9450)
@@ -0,0 +1,104 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.portlet.impl.metadata.portlet;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import javax.xml.bind.annotation.XmlAttribute;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlType;
+import javax.xml.bind.annotation.adapters.CollapsedStringAdapter;
+import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
+
+import org.jboss.portal.portlet.impl.metadata.adapter.PortletPreferencesListAdapter;
+
+/**
+ * @author <a href="mailto:emuckenh@redhat.com">Emanuel Muckenhuber</a>
+ * @version $Revision$
+ */
+@XmlType(name = "portlet-preferencesType")
+public class PortletPreferencesMetaData
+{
+
+ /** The portlet preferences id */
+ private String id;
+
+ /** The portlet preferences */
+ private Map<String, PortletPreferenceMetaData> portletPreferences;
+
+ /** The portlet preference validator */
+ private String preferenceValidator;
+
+ public PortletPreferencesMetaData() {}
+
+ public PortletPreferencesMetaData(String id)
+ {
+ this.id = id;
+ }
+
+ @XmlAttribute(name = "id")
+ public String getId()
+ {
+ return id;
+ }
+
+ public void setId(String id)
+ {
+ this.id = id;
+ }
+
+ @XmlElement(name = "preference")
+ @XmlJavaTypeAdapter(PortletPreferencesListAdapter.class)
+ public Map<String, PortletPreferenceMetaData> getPortletPreferences()
+ {
+ return portletPreferences;
+ }
+
+ public void setPortletPreferences(Map<String, PortletPreferenceMetaData> portletPreferences)
+ {
+ this.portletPreferences = portletPreferences;
+ }
+
+ public void addPortletPreference(PortletPreferenceMetaData preference)
+ {
+ if(this.portletPreferences == null)
+ {
+ this.portletPreferences = new HashMap<String, PortletPreferenceMetaData>();
+ }
+ this.portletPreferences.put(preference.getName(), preference);
+ }
+
+ @XmlElement(name = "preferences-validator")
+ @XmlJavaTypeAdapter(CollapsedStringAdapter.class)
+ public String getPreferenceValidator()
+ {
+ return preferenceValidator;
+ }
+
+ public void setPreferenceValidator(String preferenceValidator)
+ {
+ this.preferenceValidator = preferenceValidator;
+ }
+
+}
Added: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/metadata/portlet/SecurityRoleRefMetaData.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/metadata/portlet/SecurityRoleRefMetaData.java (rev 0)
+++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/metadata/portlet/SecurityRoleRefMetaData.java 2008-01-08 01:54:30 UTC (rev 9450)
@@ -0,0 +1,90 @@
+/******************************************************************************
+ * 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.portlet.impl.metadata.portlet;
+
+import javax.xml.bind.annotation.XmlAttribute;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlType;
+
+import org.jboss.portal.portlet.impl.metadata.common.DescribableMetaData;
+
+
+/**
+ * @author <a href="mailto:emuckenh@redhat.com">Emanuel Muckenhuber</a>
+ * @version $Revision$
+ */
+
+@XmlType(name = "security-role-refType")
+public class SecurityRoleRefMetaData extends DescribableMetaData
+{
+
+ /** The security role ref id */
+ private String id;
+
+ /** The role name */
+ private String roleName;
+
+ /** The role link */
+ private String roleLink;
+
+ public SecurityRoleRefMetaData() {}
+
+ public SecurityRoleRefMetaData(String id)
+ {
+ this.id = id;
+ }
+
+ @XmlAttribute(name = "id")
+ public String getId()
+ {
+ return id;
+ }
+
+ public void setId(String id)
+ {
+ this.id = id;
+ }
+
+ @XmlElement(name = "role-name")
+ public String getRoleName()
+ {
+ return roleName;
+ }
+
+ public void setRoleName(String roleName)
+ {
+ this.roleName = roleName;
+ }
+
+ @XmlElement(name = "role-link")
+ public String getRoleLink()
+ {
+ return roleLink;
+ }
+
+ public void setRoleLink(String roleLink)
+ {
+ this.roleLink = roleLink;
+ }
+
+}
Added: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/metadata/portlet/SupportedLocaleMetaData.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/metadata/portlet/SupportedLocaleMetaData.java (rev 0)
+++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/metadata/portlet/SupportedLocaleMetaData.java 2008-01-08 01:54:30 UTC (rev 9450)
@@ -0,0 +1,49 @@
+/******************************************************************************
+ * 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.portlet.impl.metadata.portlet;
+
+import javax.xml.bind.annotation.XmlType;
+import javax.xml.bind.annotation.XmlValue;
+
+/**
+ * @author <a href="mailto:emuckenh@redhat.com">Emanuel Muckenhuber</a>
+ * @version $Revision$
+ */
+@XmlType(name = "supported-localeType")
+public class SupportedLocaleMetaData
+{
+
+ /** The supported locale */
+ private String locale;
+
+ @XmlValue
+ public String getLocale()
+ {
+ return locale;
+ }
+
+ public void setLocale(String locale)
+ {
+ this.locale = locale;
+ }
+}
Added: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/metadata/portlet/SupportsMetaData.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/metadata/portlet/SupportsMetaData.java (rev 0)
+++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/metadata/portlet/SupportsMetaData.java 2008-01-08 01:54:30 UTC (rev 9450)
@@ -0,0 +1,124 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.portlet.impl.metadata.portlet;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.xml.bind.annotation.XmlAttribute;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlType;
+
+import org.jboss.portal.portlet.impl.metadata.PortletMetaDataConstants;
+
+/**
+ * @author <a href="mailto:emuckenh@redhat.com">Emanuel Muckenhuber</a>
+ * @version $Revision$
+ */
+@XmlType(name = "supportsType")
+public class SupportsMetaData
+{
+
+ /** The supports id */
+ @XmlAttribute(name = "id")
+ private String id;
+
+ /** The mime type */
+ private String mimeType;
+
+ /** The portletModes */
+ private List<PortletModeMetaData> portletModes;
+
+ /** The window states */
+ private List<WindowStateMetaData> windowStates;
+
+ public SupportsMetaData() {}
+
+ public SupportsMetaData(String id)
+ {
+ this.id = id;
+ }
+
+ @XmlAttribute(name = "id")
+ public String getId()
+ {
+ return id;
+ }
+
+ public void setId(String id)
+ {
+ this.id = id;
+ }
+
+ @XmlElement(name = "mime-type")
+ public String getMimeType()
+ {
+ return mimeType;
+ }
+
+ public void setMimeType(String mimeType)
+ {
+ this.mimeType = mimeType;
+ }
+
+ @XmlElement(name = "portlet-mode")
+ public List<PortletModeMetaData> getPortletModes()
+ {
+ return this.portletModes;
+ }
+
+ public void setPortletModes(List<PortletModeMetaData> portletModes)
+ {
+ this.portletModes = portletModes;
+ }
+
+ public void addPortletMode(PortletModeMetaData portletMode)
+ {
+ if (this.portletModes == null)
+ {
+ this.portletModes = new ArrayList<PortletModeMetaData>();
+ }
+ this.portletModes.add(portletMode);
+ }
+
+ @XmlElement(name = "window-state",
+ namespace = PortletMetaDataConstants.PORTLET_JSR_286_NS)
+ public List<WindowStateMetaData> getWindowStates()
+ {
+ return this.windowStates;
+ }
+
+ public void setWindowStates(List<WindowStateMetaData> windowStates)
+ {
+ this.windowStates = windowStates;
+ }
+
+ public void addWindowState(WindowStateMetaData windowState)
+ {
+ if (this.windowStates == null)
+ {
+ this.windowStates = new ArrayList<WindowStateMetaData>();
+ }
+ this.windowStates.add(windowState);
+ }
+}
Added: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/metadata/portlet/WindowStateMetaData.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/metadata/portlet/WindowStateMetaData.java (rev 0)
+++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/metadata/portlet/WindowStateMetaData.java 2008-01-08 01:54:30 UTC (rev 9450)
@@ -0,0 +1,50 @@
+/******************************************************************************
+ * 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.portlet.impl.metadata.portlet;
+
+import javax.xml.bind.annotation.XmlType;
+import javax.xml.bind.annotation.XmlValue;
+
+/**
+ * @author <a href="mailto:emuckenh@redhat.com">Emanuel Muckenhuber</a>
+ * @version $Revision$
+ */
+@XmlType(name = "window-stateType")
+public class WindowStateMetaData
+{
+
+ /** The window state */
+ private String windowState;
+
+ @XmlValue
+ public String getWindowState()
+ {
+ return windowState;
+ }
+
+ public void setWindowState(String windowState)
+ {
+ this.windowState = windowState;
+ }
+
+}
Added: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/metadata/security/PortletCollectionMetaData.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/metadata/security/PortletCollectionMetaData.java (rev 0)
+++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/metadata/security/PortletCollectionMetaData.java 2008-01-08 01:54:30 UTC (rev 9450)
@@ -0,0 +1,60 @@
+/******************************************************************************
+ * 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.portlet.impl.metadata.security;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlType;
+
+/**
+ * @author <a href="mailto:emuckenh@redhat.com">Emanuel Muckenhuber</a>
+ * @version $Revision$
+ */
+@XmlType(name = "portlet-collectionType")
+public class PortletCollectionMetaData
+{
+ /** The portlet name List */
+ private List<String> portletNames;
+
+ @XmlElement(name = "portlet-name")
+ public List<String> getPortletNames()
+ {
+ return portletNames;
+ }
+
+ public void setPortletNames(List<String> portletNames)
+ {
+ this.portletNames = portletNames;
+ }
+
+ public void addPortletname(String portletName)
+ {
+ if( this.portletNames == null )
+ {
+ this.portletNames = new ArrayList<String>();
+ }
+ this.portletNames.add(portletName);
+ }
+}
Added: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/metadata/security/SecurityConstraintMetaData.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/metadata/security/SecurityConstraintMetaData.java (rev 0)
+++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/metadata/security/SecurityConstraintMetaData.java 2008-01-08 01:54:30 UTC (rev 9450)
@@ -0,0 +1,104 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.portlet.impl.metadata.security;
+
+import javax.xml.bind.annotation.XmlAttribute;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlType;
+import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
+
+import org.jboss.portal.common.i18n.LocalizedString;
+import org.jboss.portal.portlet.impl.metadata.adapter.LocalizedStringAdapter;
+
+/**
+ * @author <a href="mailto:emuckenh@redhat.com">Emanuel Muckenhuber</a>
+ * @version $Revision$
+ */
+@XmlType(name = "security-constraintType")
+public class SecurityConstraintMetaData
+{
+
+ /** The security constraint id */
+ private String id;
+
+ /** The security constraint display name */
+ private LocalizedString displayName;
+
+ /** The portlet collection */
+ private PortletCollectionMetaData portletList;
+
+ /** The user data constraints */
+ private UserDataConstraintMetaData userDataConstraint;
+
+ public SecurityConstraintMetaData() {}
+
+ public SecurityConstraintMetaData(String id)
+ {
+ this.id = id;
+ }
+
+ @XmlAttribute(name = "id")
+ public String getId()
+ {
+ return id;
+ }
+
+ public void setId(String id)
+ {
+ this.id = id;
+ }
+
+ @XmlElement(name = "display-name")
+ @XmlJavaTypeAdapter(LocalizedStringAdapter.class)
+ public LocalizedString getDisplayName()
+ {
+ return displayName;
+ }
+
+ public void setDisplayName(LocalizedString displayName)
+ {
+ this.displayName = displayName;
+ }
+
+ @XmlElement(name = "portlet-collection")
+ public PortletCollectionMetaData getPortletList()
+ {
+ return portletList;
+ }
+
+ public void setPortletList(PortletCollectionMetaData portletList)
+ {
+ this.portletList = portletList;
+ }
+
+ @XmlElement(name = "user-data-constraint")
+ public UserDataConstraintMetaData getUserDataConstraint()
+ {
+ return userDataConstraint;
+ }
+
+ public void setUserDataConstraint(UserDataConstraintMetaData userDataConstraint)
+ {
+ this.userDataConstraint = userDataConstraint;
+ }
+}
Added: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/metadata/security/TransportGuaranteeEnum.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/metadata/security/TransportGuaranteeEnum.java (rev 0)
+++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/metadata/security/TransportGuaranteeEnum.java 2008-01-08 01:54:30 UTC (rev 9450)
@@ -0,0 +1,51 @@
+/******************************************************************************
+ * 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.portlet.impl.metadata.security;
+
+import javax.xml.bind.annotation.XmlEnum;
+
+/**
+ * In most cases, the presence of the INTEGRAL or CONFIDENTIAL
+ * flag will indicate that the use of SSL is required.
+ *
+ * @author <a href="mailto:emuckenh@redhat.com">Emanuel Muckenhuber</a>
+ * @version $Revision$
+ */
+
+@XmlEnum
+public enum TransportGuaranteeEnum {
+
+ /** does not require any transport guarantees */
+ NONE,
+ /**
+ * requires the data sent between the client and the portlet
+ * in such way that it can't be changed in transit
+ */
+ INTEGRAL,
+ /**
+ * requires that the data be transmitted in a fashion that prevents
+ * other entities from observing the contents of the transmission
+ */
+ CONFIDENTIAL
+
+}
Added: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/metadata/security/UserDataConstraintMetaData.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/metadata/security/UserDataConstraintMetaData.java (rev 0)
+++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/metadata/security/UserDataConstraintMetaData.java 2008-01-08 01:54:30 UTC (rev 9450)
@@ -0,0 +1,73 @@
+/******************************************************************************
+ * 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.portlet.impl.metadata.security;
+
+import javax.xml.bind.annotation.XmlAttribute;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlType;
+
+import org.jboss.portal.portlet.impl.metadata.common.DescribableMetaData;
+
+/**
+ * @author <a href="mailto:emuckenh@redhat.com">Emanuel Muckenhuber</a>
+ * @version $Revision$
+ */
+@XmlType(name = "user-data-constraint")
+public class UserDataConstraintMetaData extends DescribableMetaData
+{
+
+ /** The user data constraint id */
+ private String id;
+
+ /** The user transport quarantee */
+ private TransportGuaranteeEnum transportQuarantee;
+
+ public UserDataConstraintMetaData() {}
+
+ public UserDataConstraintMetaData(String id)
+ {
+ this.id = id;
+ }
+
+ @XmlAttribute(name = "id")
+ public String getId()
+ {
+ return id;
+ }
+
+ public void setId(String id)
+ {
+ this.id = id;
+ }
+
+ @XmlElement(name = "transport-guarantee")
+ public TransportGuaranteeEnum getTransportQuarantee()
+ {
+ return transportQuarantee;
+ }
+
+ public void setTransportQuarantee(TransportGuaranteeEnum transportQuarantee)
+ {
+ this.transportQuarantee = transportQuarantee;
+ }
+}
\ No newline at end of file
Modified: modules/portlet/trunk/test/src/test/java/org/jboss/portal/portlet/test/metadata/AbstractMetaDataTestCase.java
===================================================================
--- modules/portlet/trunk/test/src/test/java/org/jboss/portal/portlet/test/metadata/AbstractMetaDataTestCase.java 2008-01-08 00:27:36 UTC (rev 9449)
+++ modules/portlet/trunk/test/src/test/java/org/jboss/portal/portlet/test/metadata/AbstractMetaDataTestCase.java 2008-01-08 01:54:30 UTC (rev 9450)
@@ -30,10 +30,10 @@
import org.jboss.portal.portlet.test.metadata.factory.PortletApplicationModelFactory;
import org.jboss.portal.portlet.test.metadata.impl.AnnotationPortletApplication10MetaData;
import org.jboss.portal.portlet.test.metadata.impl.AnnotationPortletApplication20MetaData;
-import org.jboss.portal.portlet.test.metadata.impl.PortletApplication10MetaData;
-import org.jboss.portal.portlet.test.metadata.impl.PortletApplication20MetaData;
+import org.jboss.portal.portlet.impl.metadata.PortletApplication10MetaData;
+import org.jboss.portal.portlet.impl.metadata.PortletApplication20MetaData;
-import static org.jboss.portal.portlet.test.metadata.impl.PortletMetaDataConstants.*;
+import static org.jboss.portal.portlet.impl.metadata.PortletMetaDataConstants.*;
import org.jboss.unit.api.pojo.annotations.Parameter;
import org.jboss.xb.binding.JBossXBException;
Modified: modules/portlet/trunk/test/src/test/java/org/jboss/portal/portlet/test/metadata/CustomPortletModeTestEverythingTestCase.java
===================================================================
--- modules/portlet/trunk/test/src/test/java/org/jboss/portal/portlet/test/metadata/CustomPortletModeTestEverythingTestCase.java 2008-01-08 00:27:36 UTC (rev 9449)
+++ modules/portlet/trunk/test/src/test/java/org/jboss/portal/portlet/test/metadata/CustomPortletModeTestEverythingTestCase.java 2008-01-08 01:54:30 UTC (rev 9450)
@@ -24,9 +24,9 @@
import java.util.Locale;
-import org.jboss.portal.portlet.test.metadata.impl.CustomPortletModeMetaData;
-import org.jboss.portal.portlet.test.metadata.impl.PortletApplication10MetaData;
-import org.jboss.portal.portlet.test.metadata.impl.PortletApplication20MetaData;
+import org.jboss.portal.portlet.impl.metadata.CustomPortletModeMetaData;
+import org.jboss.portal.portlet.impl.metadata.PortletApplication10MetaData;
+import org.jboss.portal.portlet.impl.metadata.PortletApplication20MetaData;
import org.jboss.unit.api.pojo.annotations.Test;
import static org.jboss.unit.api.Assert.*;
Modified: modules/portlet/trunk/test/src/test/java/org/jboss/portal/portlet/test/metadata/CustomWindowStateTestEverythingTestCase.java
===================================================================
--- modules/portlet/trunk/test/src/test/java/org/jboss/portal/portlet/test/metadata/CustomWindowStateTestEverythingTestCase.java 2008-01-08 00:27:36 UTC (rev 9449)
+++ modules/portlet/trunk/test/src/test/java/org/jboss/portal/portlet/test/metadata/CustomWindowStateTestEverythingTestCase.java 2008-01-08 01:54:30 UTC (rev 9450)
@@ -24,9 +24,9 @@
import java.util.Locale;
-import org.jboss.portal.portlet.test.metadata.impl.CustomWindowStateMetaData;
-import org.jboss.portal.portlet.test.metadata.impl.PortletApplication10MetaData;
-import org.jboss.portal.portlet.test.metadata.impl.PortletApplication20MetaData;
+import org.jboss.portal.portlet.impl.metadata.CustomWindowStateMetaData;
+import org.jboss.portal.portlet.impl.metadata.PortletApplication10MetaData;
+import org.jboss.portal.portlet.impl.metadata.PortletApplication20MetaData;
import org.jboss.unit.api.pojo.annotations.Test;
import static org.jboss.unit.api.Assert.*;
Modified: modules/portlet/trunk/test/src/test/java/org/jboss/portal/portlet/test/metadata/EventTestEverythingTestCase.java
===================================================================
--- modules/portlet/trunk/test/src/test/java/org/jboss/portal/portlet/test/metadata/EventTestEverythingTestCase.java 2008-01-08 00:27:36 UTC (rev 9449)
+++ modules/portlet/trunk/test/src/test/java/org/jboss/portal/portlet/test/metadata/EventTestEverythingTestCase.java 2008-01-08 01:54:30 UTC (rev 9450)
@@ -26,11 +26,11 @@
import javax.xml.namespace.QName;
-import org.jboss.portal.portlet.test.metadata.impl.PortletApplication20MetaData;
-import org.jboss.portal.portlet.test.metadata.impl.PortletApplication10MetaData;
-import org.jboss.portal.portlet.test.metadata.impl.event.EventDefinitionMetaData;
-import org.jboss.portal.portlet.test.metadata.impl.event.EventDefinitionReferenceMetaData;
-import org.jboss.portal.portlet.test.metadata.impl.portlet.PortletMetaData;
+import org.jboss.portal.portlet.impl.metadata.PortletApplication20MetaData;
+import org.jboss.portal.portlet.impl.metadata.PortletApplication10MetaData;
+import org.jboss.portal.portlet.impl.metadata.event.EventDefinitionMetaData;
+import org.jboss.portal.portlet.impl.metadata.event.EventDefinitionReferenceMetaData;
+import org.jboss.portal.portlet.impl.metadata.portlet.PortletMetaData;
import org.jboss.unit.api.pojo.annotations.Test;
import static org.jboss.unit.api.Assert.*;
Modified: modules/portlet/trunk/test/src/test/java/org/jboss/portal/portlet/test/metadata/FilterTestEverythingTestCase.java
===================================================================
--- modules/portlet/trunk/test/src/test/java/org/jboss/portal/portlet/test/metadata/FilterTestEverythingTestCase.java 2008-01-08 00:27:36 UTC (rev 9449)
+++ modules/portlet/trunk/test/src/test/java/org/jboss/portal/portlet/test/metadata/FilterTestEverythingTestCase.java 2008-01-08 01:54:30 UTC (rev 9450)
@@ -24,9 +24,9 @@
import java.util.Locale;
-import org.jboss.portal.portlet.test.metadata.impl.PortletApplication20MetaData;
-import org.jboss.portal.portlet.test.metadata.impl.common.InitParamMetaData;
-import org.jboss.portal.portlet.test.metadata.impl.filter.FilterMetaData;
+import org.jboss.portal.portlet.impl.metadata.PortletApplication20MetaData;
+import org.jboss.portal.portlet.impl.metadata.common.InitParamMetaData;
+import org.jboss.portal.portlet.impl.metadata.filter.FilterMetaData;
import org.jboss.unit.api.pojo.annotations.Test;
import static org.jboss.unit.api.Assert.*;
Modified: modules/portlet/trunk/test/src/test/java/org/jboss/portal/portlet/test/metadata/GeneralMetaDataTestCase.java
===================================================================
--- modules/portlet/trunk/test/src/test/java/org/jboss/portal/portlet/test/metadata/GeneralMetaDataTestCase.java 2008-01-08 00:27:36 UTC (rev 9449)
+++ modules/portlet/trunk/test/src/test/java/org/jboss/portal/portlet/test/metadata/GeneralMetaDataTestCase.java 2008-01-08 01:54:30 UTC (rev 9450)
@@ -25,10 +25,10 @@
import java.net.URI;
import java.util.Locale;
-import org.jboss.portal.portlet.test.metadata.impl.ListenerMetaData;
-import org.jboss.portal.portlet.test.metadata.impl.PortletApplication10MetaData;
-import org.jboss.portal.portlet.test.metadata.impl.PortletApplication20MetaData;
-import org.jboss.portal.portlet.test.metadata.impl.PublicRenderParameterMetaData;
+import org.jboss.portal.portlet.impl.metadata.ListenerMetaData;
+import org.jboss.portal.portlet.impl.metadata.PortletApplication10MetaData;
+import org.jboss.portal.portlet.impl.metadata.PortletApplication20MetaData;
+import org.jboss.portal.portlet.impl.metadata.PublicRenderParameterMetaData;
import org.jboss.unit.api.pojo.annotations.Test;
import static org.jboss.unit.api.Assert.*;
@@ -98,7 +98,7 @@
assertEquals("foobar", md.getContainerRuntimeOption("foo").getValues().get(0));
assertEquals("foobar2", md.getContainerRuntimeOption("foo").getValues().get(1));
- ListenerMetaData listener1 = md.getListeners().get(0);
+ ListenerMetaData listener1 = md.getListeners().get(0);
assertNotNull(listener1);
assertEquals("org.jboss.portal.portlet.test.listener.MyListener", listener1.getListenerClass());
assertEquals("Mein Zuh\u00f6rer Eins", listener1.getDisplayName().getString(new Locale("de"), false));
Modified: modules/portlet/trunk/test/src/test/java/org/jboss/portal/portlet/test/metadata/PortletTestEverythingTestCase.java
===================================================================
--- modules/portlet/trunk/test/src/test/java/org/jboss/portal/portlet/test/metadata/PortletTestEverythingTestCase.java 2008-01-08 00:27:36 UTC (rev 9449)
+++ modules/portlet/trunk/test/src/test/java/org/jboss/portal/portlet/test/metadata/PortletTestEverythingTestCase.java 2008-01-08 01:54:30 UTC (rev 9450)
@@ -25,17 +25,17 @@
import java.util.List;
import java.util.Locale;
-import org.jboss.portal.portlet.test.metadata.impl.PortletApplication10MetaData;
-import org.jboss.portal.portlet.test.metadata.impl.PortletApplication20MetaData;
-import org.jboss.portal.portlet.test.metadata.impl.PortletMetaDataConstants;
-import org.jboss.portal.portlet.test.metadata.impl.common.InitParamMetaData;
-import org.jboss.portal.portlet.test.metadata.impl.portlet.PortletCacheScopeEnum;
-import org.jboss.portal.portlet.test.metadata.impl.portlet.PortletInfoMetaData;
-import org.jboss.portal.portlet.test.metadata.impl.portlet.PortletMetaData;
-import org.jboss.portal.portlet.test.metadata.impl.portlet.PortletPreferencesMetaData;
-import org.jboss.portal.portlet.test.metadata.impl.portlet.SecurityRoleRefMetaData;
-import org.jboss.portal.portlet.test.metadata.impl.portlet.SupportedLocaleMetaData;
-import org.jboss.portal.portlet.test.metadata.impl.portlet.SupportsMetaData;
+import org.jboss.portal.portlet.impl.metadata.PortletApplication10MetaData;
+import org.jboss.portal.portlet.impl.metadata.PortletApplication20MetaData;
+import org.jboss.portal.portlet.impl.metadata.PortletMetaDataConstants;
+import org.jboss.portal.portlet.impl.metadata.common.InitParamMetaData;
+import org.jboss.portal.portlet.impl.metadata.portlet.PortletCacheScopeEnum;
+import org.jboss.portal.portlet.impl.metadata.portlet.PortletInfoMetaData;
+import org.jboss.portal.portlet.impl.metadata.portlet.PortletMetaData;
+import org.jboss.portal.portlet.impl.metadata.portlet.PortletPreferencesMetaData;
+import org.jboss.portal.portlet.impl.metadata.portlet.SecurityRoleRefMetaData;
+import org.jboss.portal.portlet.impl.metadata.portlet.SupportedLocaleMetaData;
+import org.jboss.portal.portlet.impl.metadata.portlet.SupportsMetaData;
import org.jboss.unit.api.pojo.annotations.Test;
import static org.jboss.unit.api.Assert.*;
Modified: modules/portlet/trunk/test/src/test/java/org/jboss/portal/portlet/test/metadata/RenderParameterTestEverythingTestCase.java
===================================================================
--- modules/portlet/trunk/test/src/test/java/org/jboss/portal/portlet/test/metadata/RenderParameterTestEverythingTestCase.java 2008-01-08 00:27:36 UTC (rev 9449)
+++ modules/portlet/trunk/test/src/test/java/org/jboss/portal/portlet/test/metadata/RenderParameterTestEverythingTestCase.java 2008-01-08 01:54:30 UTC (rev 9450)
@@ -22,9 +22,8 @@
******************************************************************************/
package org.jboss.portal.portlet.test.metadata;
-import org.jboss.portal.portlet.test.metadata.impl.PortletApplication20MetaData;
-import org.jboss.portal.portlet.test.metadata.impl.PublicRenderParameterMetaData;
-import org.jboss.portal.portlet.test.metadata.impl.PortletApplication10MetaData;
+import org.jboss.portal.portlet.impl.metadata.PortletApplication20MetaData;
+import org.jboss.portal.portlet.impl.metadata.PublicRenderParameterMetaData;
import org.jboss.unit.api.pojo.annotations.Test;
import static org.jboss.unit.api.Assert.*;
Modified: modules/portlet/trunk/test/src/test/java/org/jboss/portal/portlet/test/metadata/SecurityConstraintTestEverythingTestCase.java
===================================================================
--- modules/portlet/trunk/test/src/test/java/org/jboss/portal/portlet/test/metadata/SecurityConstraintTestEverythingTestCase.java 2008-01-08 00:27:36 UTC (rev 9449)
+++ modules/portlet/trunk/test/src/test/java/org/jboss/portal/portlet/test/metadata/SecurityConstraintTestEverythingTestCase.java 2008-01-08 01:54:30 UTC (rev 9450)
@@ -24,11 +24,11 @@
import java.util.Locale;
-import org.jboss.portal.portlet.test.metadata.impl.PortletApplication10MetaData;
-import org.jboss.portal.portlet.test.metadata.impl.PortletApplication20MetaData;
-import org.jboss.portal.portlet.test.metadata.impl.portlet.PortletMetaData;
-import org.jboss.portal.portlet.test.metadata.impl.security.SecurityConstraintMetaData;
-import org.jboss.portal.portlet.test.metadata.impl.security.TransportGuaranteeEnum;
+import org.jboss.portal.portlet.impl.metadata.PortletApplication10MetaData;
+import org.jboss.portal.portlet.impl.metadata.PortletApplication20MetaData;
+import org.jboss.portal.portlet.impl.metadata.portlet.PortletMetaData;
+import org.jboss.portal.portlet.impl.metadata.security.SecurityConstraintMetaData;
+import org.jboss.portal.portlet.impl.metadata.security.TransportGuaranteeEnum;
import org.jboss.unit.api.pojo.annotations.Test;
import static org.jboss.unit.api.Assert.*;
Modified: modules/portlet/trunk/test/src/test/java/org/jboss/portal/portlet/test/metadata/UserAttributeTestEverythingTestCase.java
===================================================================
--- modules/portlet/trunk/test/src/test/java/org/jboss/portal/portlet/test/metadata/UserAttributeTestEverythingTestCase.java 2008-01-08 00:27:36 UTC (rev 9449)
+++ modules/portlet/trunk/test/src/test/java/org/jboss/portal/portlet/test/metadata/UserAttributeTestEverythingTestCase.java 2008-01-08 01:54:30 UTC (rev 9450)
@@ -24,9 +24,9 @@
import java.util.Locale;
-import org.jboss.portal.portlet.test.metadata.impl.PortletApplication10MetaData;
-import org.jboss.portal.portlet.test.metadata.impl.PortletApplication20MetaData;
-import org.jboss.portal.portlet.test.metadata.impl.UserAttributeMetaData;
+import org.jboss.portal.portlet.impl.metadata.PortletApplication10MetaData;
+import org.jboss.portal.portlet.impl.metadata.PortletApplication20MetaData;
+import org.jboss.portal.portlet.impl.metadata.UserAttributeMetaData;
import org.jboss.unit.api.pojo.annotations.Test;
import static org.jboss.unit.api.Assert.*;
Deleted: modules/portlet/trunk/test/src/test/java/org/jboss/portal/portlet/test/metadata/ValidationErrorHandler.java
===================================================================
--- modules/portlet/trunk/test/src/test/java/org/jboss/portal/portlet/test/metadata/ValidationErrorHandler.java 2008-01-08 00:27:36 UTC (rev 9449)
+++ modules/portlet/trunk/test/src/test/java/org/jboss/portal/portlet/test/metadata/ValidationErrorHandler.java 2008-01-08 01:54:30 UTC (rev 9450)
@@ -1,52 +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.portlet.test.metadata;
-
-import org.xml.sax.ErrorHandler;
-import org.xml.sax.SAXException;
-import org.xml.sax.SAXParseException;
-/**
- * @author <a href="mailto:emuckenh@redhat.com">Emanuel Muckenhuber</a>
- * @version $Revision$
- */
-public class ValidationErrorHandler implements ErrorHandler
-{
-
- public void error(SAXParseException e) throws SAXException
- {
- throw new SAXException("Syntax error on line: " + e.getLineNumber() + ", column: " + e.getColumnNumber() + "\n"
- + e.getMessage());
- }
-
- public void fatalError(SAXParseException e) throws SAXException
- {
- throw new SAXException("Fatal syntax error on line: " + e.getLineNumber() + ", column: " + e.getColumnNumber()
- + "\n" + e.getMessage());
- }
-
- public void warning(SAXParseException e) throws SAXException
- {
- // TODO - maybe logging or similar stuff
- }
-
-}
\ No newline at end of file
Modified: modules/portlet/trunk/test/src/test/java/org/jboss/portal/portlet/test/metadata/factory/LocalizedStringBuilder.java
===================================================================
--- modules/portlet/trunk/test/src/test/java/org/jboss/portal/portlet/test/metadata/factory/LocalizedStringBuilder.java 2008-01-08 00:27:36 UTC (rev 9449)
+++ modules/portlet/trunk/test/src/test/java/org/jboss/portal/portlet/test/metadata/factory/LocalizedStringBuilder.java 2008-01-08 01:54:30 UTC (rev 9450)
@@ -29,8 +29,8 @@
import org.apache.log4j.Logger;
import org.jboss.portal.common.i18n.LocalizedString;
-import org.jboss.portal.portlet.test.metadata.impl.adapter.LocalizedStringAdapter;
-import org.jboss.portal.portlet.test.metadata.impl.common.LocalizedDescriptionMetaData;
+import org.jboss.portal.portlet.impl.metadata.adapter.LocalizedStringAdapter;
+import org.jboss.portal.portlet.impl.metadata.common.LocalizedDescriptionMetaData;
/**
* @author <a href="mailto:emuckenh@redhat.com">Emanuel Muckenhuber</a>
Modified: modules/portlet/trunk/test/src/test/java/org/jboss/portal/portlet/test/metadata/factory/PortletApplicationModelFactory.java
===================================================================
--- modules/portlet/trunk/test/src/test/java/org/jboss/portal/portlet/test/metadata/factory/PortletApplicationModelFactory.java 2008-01-08 00:27:36 UTC (rev 9449)
+++ modules/portlet/trunk/test/src/test/java/org/jboss/portal/portlet/test/metadata/factory/PortletApplicationModelFactory.java 2008-01-08 01:54:30 UTC (rev 9450)
@@ -27,42 +27,42 @@
import org.apache.log4j.Logger;
import org.jboss.portal.common.i18n.LocalizedString;
-import org.jboss.portal.portlet.test.metadata.impl.CustomPortletModeMetaData;
-import org.jboss.portal.portlet.test.metadata.impl.CustomWindowStateMetaData;
-import org.jboss.portal.portlet.test.metadata.impl.ListenerMetaData;
-import org.jboss.portal.portlet.test.metadata.impl.PortletApplication20MetaData;
-import org.jboss.portal.portlet.test.metadata.impl.PublicRenderParameterMetaData;
-import org.jboss.portal.portlet.test.metadata.impl.UserAttributeMetaData;
+import org.jboss.portal.portlet.impl.metadata.CustomPortletModeMetaData;
+import org.jboss.portal.portlet.impl.metadata.CustomWindowStateMetaData;
+import org.jboss.portal.portlet.impl.metadata.ListenerMetaData;
+import org.jboss.portal.portlet.impl.metadata.PortletApplication20MetaData;
+import org.jboss.portal.portlet.impl.metadata.PublicRenderParameterMetaData;
+import org.jboss.portal.portlet.impl.metadata.UserAttributeMetaData;
import org.jboss.portal.portlet.test.metadata.impl.AnnotationPortletApplication10MetaData;
import org.jboss.portal.portlet.test.metadata.impl.AnnotationPortletApplication20MetaData;
-import org.jboss.portal.portlet.test.metadata.impl.PortletApplication10MetaData;
-import org.jboss.portal.portlet.test.metadata.impl.common.ContainerRuntimeMetaData;
-import org.jboss.portal.portlet.test.metadata.impl.common.DescribableMetaData;
-import org.jboss.portal.portlet.test.metadata.impl.common.InitParamMetaData;
-import org.jboss.portal.portlet.test.metadata.impl.common.LocalizedDescriptionMetaData;
-import org.jboss.portal.portlet.test.metadata.impl.event.EventDefinitionMetaData;
-import org.jboss.portal.portlet.test.metadata.impl.event.EventDefinitionReferenceMetaData;
-import org.jboss.portal.portlet.test.metadata.impl.filter.FilterMappingMetaData;
-import org.jboss.portal.portlet.test.metadata.impl.filter.FilterMetaData;
-import org.jboss.portal.portlet.test.metadata.impl.portlet.PortletCacheScopeEnum;
-import org.jboss.portal.portlet.test.metadata.impl.portlet.PortletInfoMetaData;
-import org.jboss.portal.portlet.test.metadata.impl.portlet.PortletMetaData;
-import org.jboss.portal.portlet.test.metadata.impl.portlet.PortletModeMetaData;
-import org.jboss.portal.portlet.test.metadata.impl.portlet.PortletPreferenceMetaData;
-import org.jboss.portal.portlet.test.metadata.impl.portlet.PortletPreferencesMetaData;
-import org.jboss.portal.portlet.test.metadata.impl.portlet.SecurityRoleRefMetaData;
-import org.jboss.portal.portlet.test.metadata.impl.portlet.SupportedLocaleMetaData;
-import org.jboss.portal.portlet.test.metadata.impl.portlet.SupportsMetaData;
-import org.jboss.portal.portlet.test.metadata.impl.portlet.WindowStateMetaData;
-import org.jboss.portal.portlet.test.metadata.impl.security.PortletCollectionMetaData;
-import org.jboss.portal.portlet.test.metadata.impl.security.SecurityConstraintMetaData;
-import org.jboss.portal.portlet.test.metadata.impl.security.TransportGuaranteeEnum;
-import org.jboss.portal.portlet.test.metadata.impl.security.UserDataConstraintMetaData;
+import org.jboss.portal.portlet.impl.metadata.PortletApplication10MetaData;
+import org.jboss.portal.portlet.impl.metadata.common.ContainerRuntimeMetaData;
+import org.jboss.portal.portlet.impl.metadata.common.DescribableMetaData;
+import org.jboss.portal.portlet.impl.metadata.common.InitParamMetaData;
+import org.jboss.portal.portlet.impl.metadata.common.LocalizedDescriptionMetaData;
+import org.jboss.portal.portlet.impl.metadata.event.EventDefinitionMetaData;
+import org.jboss.portal.portlet.impl.metadata.event.EventDefinitionReferenceMetaData;
+import org.jboss.portal.portlet.impl.metadata.filter.FilterMappingMetaData;
+import org.jboss.portal.portlet.impl.metadata.filter.FilterMetaData;
+import org.jboss.portal.portlet.impl.metadata.portlet.PortletCacheScopeEnum;
+import org.jboss.portal.portlet.impl.metadata.portlet.PortletInfoMetaData;
+import org.jboss.portal.portlet.impl.metadata.portlet.PortletMetaData;
+import org.jboss.portal.portlet.impl.metadata.portlet.PortletModeMetaData;
+import org.jboss.portal.portlet.impl.metadata.portlet.PortletPreferenceMetaData;
+import org.jboss.portal.portlet.impl.metadata.portlet.PortletPreferencesMetaData;
+import org.jboss.portal.portlet.impl.metadata.portlet.SecurityRoleRefMetaData;
+import org.jboss.portal.portlet.impl.metadata.portlet.SupportedLocaleMetaData;
+import org.jboss.portal.portlet.impl.metadata.portlet.SupportsMetaData;
+import org.jboss.portal.portlet.impl.metadata.portlet.WindowStateMetaData;
+import org.jboss.portal.portlet.impl.metadata.security.PortletCollectionMetaData;
+import org.jboss.portal.portlet.impl.metadata.security.SecurityConstraintMetaData;
+import org.jboss.portal.portlet.impl.metadata.security.TransportGuaranteeEnum;
+import org.jboss.portal.portlet.impl.metadata.security.UserDataConstraintMetaData;
import org.jboss.xb.binding.GenericObjectModelFactory;
import org.jboss.xb.binding.UnmarshallingContext;
import org.xml.sax.Attributes;
-import static org.jboss.portal.portlet.test.metadata.impl.PortletMetaDataConstants.*;
+import static org.jboss.portal.portlet.impl.metadata.PortletMetaDataConstants.*;
/**
* @author <a href="mailto:emuckenh@redhat.com">Emanuel Muckenhuber</a>
Modified: modules/portlet/trunk/test/src/test/java/org/jboss/portal/portlet/test/metadata/impl/AnnotationPortletApplication10MetaData.java
===================================================================
--- modules/portlet/trunk/test/src/test/java/org/jboss/portal/portlet/test/metadata/impl/AnnotationPortletApplication10MetaData.java 2008-01-08 00:27:36 UTC (rev 9449)
+++ modules/portlet/trunk/test/src/test/java/org/jboss/portal/portlet/test/metadata/impl/AnnotationPortletApplication10MetaData.java 2008-01-08 01:54:30 UTC (rev 9450)
@@ -28,6 +28,8 @@
import javax.xml.bind.annotation.XmlType;
import org.jboss.xb.annotations.JBossXmlSchema;
+import org.jboss.portal.portlet.impl.metadata.PortletMetaDataConstants;
+import org.jboss.portal.portlet.impl.metadata.PortletApplication10MetaData;
/**
* @author <a href="mailto:emuckenh@redhat.com">Emanuel Muckenhuber</a>
Modified: modules/portlet/trunk/test/src/test/java/org/jboss/portal/portlet/test/metadata/impl/AnnotationPortletApplication20MetaData.java
===================================================================
--- modules/portlet/trunk/test/src/test/java/org/jboss/portal/portlet/test/metadata/impl/AnnotationPortletApplication20MetaData.java 2008-01-08 00:27:36 UTC (rev 9449)
+++ modules/portlet/trunk/test/src/test/java/org/jboss/portal/portlet/test/metadata/impl/AnnotationPortletApplication20MetaData.java 2008-01-08 01:54:30 UTC (rev 9450)
@@ -28,6 +28,8 @@
import javax.xml.bind.annotation.XmlType;
import org.jboss.xb.annotations.JBossXmlSchema;
+import org.jboss.portal.portlet.impl.metadata.PortletMetaDataConstants;
+import org.jboss.portal.portlet.impl.metadata.PortletApplication20MetaData;
/**
* @author <a href="mailto:emuckenh@redhat.com">Emanuel Muckenhuber</a>
Deleted: modules/portlet/trunk/test/src/test/java/org/jboss/portal/portlet/test/metadata/impl/CustomPortletModeMetaData.java
===================================================================
--- modules/portlet/trunk/test/src/test/java/org/jboss/portal/portlet/test/metadata/impl/CustomPortletModeMetaData.java 2008-01-08 00:27:36 UTC (rev 9449)
+++ modules/portlet/trunk/test/src/test/java/org/jboss/portal/portlet/test/metadata/impl/CustomPortletModeMetaData.java 2008-01-08 01:54:30 UTC (rev 9450)
@@ -1,88 +0,0 @@
-/******************************************************************************
- * JBoss, a division of Red Hat *
- * Copyright 2006, Red Hat Middleware, LLC, and individual *
- * contributors as indicated by the @authors tag. See the *
- * copyright.txt in the distribution for a full listing of *
- * individual contributors. *
- * *
- * This is free software; you can redistribute it and/or modify it *
- * under the terms of the GNU Lesser General Public License as *
- * published by the Free Software Foundation; either version 2.1 of *
- * the License, or (at your option) any later version. *
- * *
- * This software is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
- * Lesser General Public License for more details. *
- * *
- * You should have received a copy of the GNU Lesser General Public *
- * License along with this software; if not, write to the Free *
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
- ******************************************************************************/
-package org.jboss.portal.portlet.test.metadata.impl;
-
-import javax.xml.bind.annotation.XmlAttribute;
-import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.XmlType;
-
-import org.jboss.portal.portlet.test.metadata.impl.common.DescribableMetaData;
-
-/**
- * @author <a href="mailto:emuckenh@redhat.com">Emanuel Muckenhuber</a>
- * @version $Revision$
- */
-@XmlType(name = "custom-portlet-modeType")
-public class CustomPortletModeMetaData extends DescribableMetaData
-{
-
- /** The custom portlet mode id*/
- private String id;
-
- /** The portlet mode */
- private String portletMode;
-
- /** Is portal managed */
- private boolean portalManaged = true;
-
- public CustomPortletModeMetaData() {}
-
- public CustomPortletModeMetaData(String id)
- {
- this.id = id;
- }
-
- @XmlAttribute(name = "id")
- public String getId()
- {
- return id;
- }
-
- public void setId(String id)
- {
- this.id = id;
- }
-
- @XmlElement(name = "portlet-mode")
- public String getPortletMode()
- {
- return portletMode;
- }
-
- public void setPortletMode(String portletMode)
- {
- this.portletMode = portletMode;
- }
-
- @XmlElement(name = "portal-managed", namespace = PortletMetaDataConstants.PORTLET_JSR_286_NS)
- public boolean isPortalManaged()
- {
- return portalManaged;
- }
-
- public void setPortalManaged(boolean portalManaged)
- {
- this.portalManaged = portalManaged;
- }
-
-}
Deleted: modules/portlet/trunk/test/src/test/java/org/jboss/portal/portlet/test/metadata/impl/CustomWindowStateMetaData.java
===================================================================
--- modules/portlet/trunk/test/src/test/java/org/jboss/portal/portlet/test/metadata/impl/CustomWindowStateMetaData.java 2008-01-08 00:27:36 UTC (rev 9449)
+++ modules/portlet/trunk/test/src/test/java/org/jboss/portal/portlet/test/metadata/impl/CustomWindowStateMetaData.java 2008-01-08 01:54:30 UTC (rev 9450)
@@ -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.portlet.test.metadata.impl;
-
-import javax.xml.bind.annotation.XmlAttribute;
-import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.XmlType;
-
-import org.jboss.portal.portlet.test.metadata.impl.common.DescribableMetaData;
-
-/**
- * @author <a href="mailto:emuckenh@redhat.com">Emanuel Muckenhuber</a>
- * @version $Revision$
- */
-@XmlType(name = "custom-window-stateType")
-public class CustomWindowStateMetaData extends DescribableMetaData
-{
-
- /** The window state id */
- private String id;
-
- /** The window state */
- private String windowState;
-
- public CustomWindowStateMetaData() {}
-
- public CustomWindowStateMetaData(String id)
- {
- this.id = id;
- }
-
- @XmlAttribute(name = "id")
- public String getId()
- {
- return id;
- }
-
- public void setId(String id)
- {
- this.id = id;
- }
-
- @XmlElement(name = "window-state")
- public String getWindowState()
- {
- return windowState;
- }
-
- public void setWindowState(String windowState)
- {
- this.windowState = windowState;
- }
-
-}
\ No newline at end of file
Deleted: modules/portlet/trunk/test/src/test/java/org/jboss/portal/portlet/test/metadata/impl/ListenerMetaData.java
===================================================================
--- modules/portlet/trunk/test/src/test/java/org/jboss/portal/portlet/test/metadata/impl/ListenerMetaData.java 2008-01-08 00:27:36 UTC (rev 9449)
+++ modules/portlet/trunk/test/src/test/java/org/jboss/portal/portlet/test/metadata/impl/ListenerMetaData.java 2008-01-08 01:54:30 UTC (rev 9450)
@@ -1,95 +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.portlet.test.metadata.impl;
-
-import javax.xml.bind.annotation.XmlAttribute;
-import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.XmlType;
-import javax.xml.bind.annotation.adapters.CollapsedStringAdapter;
-import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
-
-import org.jboss.portal.common.i18n.LocalizedString;
-import org.jboss.portal.portlet.test.metadata.impl.adapter.LocalizedStringAdapter;
-import org.jboss.portal.portlet.test.metadata.impl.common.DescribableMetaData;
-
-/**
- * @author <a href="mailto:emuckenh@redhat.com">Emanuel Muckenhuber</a>
- * @version $Revision$
- */
-@XmlType(name = "listenerType")
-public class ListenerMetaData extends DescribableMetaData
-{
-
- /** The id */
- private String id;
-
- /** The display name */
- private LocalizedString displayName;
-
- /** The listener class */
- private String listenerClass;
-
- public ListenerMetaData() {}
-
- public ListenerMetaData(String id)
- {
- this.id = id;
- }
-
- @XmlAttribute(name = "id")
- public String getId()
- {
- return id;
- }
-
- public void setId(String id)
- {
- this.id = id;
- }
-
- @XmlElement(name = "display-name")
- @XmlJavaTypeAdapter(LocalizedStringAdapter.class)
- public LocalizedString getDisplayName()
- {
- return displayName;
- }
-
- public void setDisplayName(LocalizedString displayName)
- {
- this.displayName = displayName;
- }
-
- @XmlElement(name = "listener-class")
- @XmlJavaTypeAdapter(CollapsedStringAdapter.class)
- public String getListenerClass()
- {
- return listenerClass;
- }
-
- public void setListenerClass(String listenerClass)
- {
- this.listenerClass = listenerClass;
- }
-
-}
-
Deleted: modules/portlet/trunk/test/src/test/java/org/jboss/portal/portlet/test/metadata/impl/PortletApplication10MetaData.java
===================================================================
--- modules/portlet/trunk/test/src/test/java/org/jboss/portal/portlet/test/metadata/impl/PortletApplication10MetaData.java 2008-01-08 00:27:36 UTC (rev 9449)
+++ modules/portlet/trunk/test/src/test/java/org/jboss/portal/portlet/test/metadata/impl/PortletApplication10MetaData.java 2008-01-08 01:54:30 UTC (rev 9450)
@@ -1,212 +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.portlet.test.metadata.impl;
-
-import java.net.URI;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.LinkedHashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-import javax.xml.bind.annotation.XmlAttribute;
-import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.XmlRootElement;
-import javax.xml.bind.annotation.XmlType;
-import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
-
-import org.jboss.portal.portlet.test.metadata.impl.adapter.CustomPortletModeAdapter;
-import org.jboss.portal.portlet.test.metadata.impl.adapter.CustomWindowStateAdapter;
-import org.jboss.portal.portlet.test.metadata.impl.adapter.PortletListAdapter;
-import org.jboss.portal.portlet.test.metadata.impl.adapter.UserAttributeAdapter;
-import org.jboss.portal.portlet.test.metadata.impl.portlet.PortletMetaData;
-import org.jboss.portal.portlet.test.metadata.impl.security.SecurityConstraintMetaData;
-
-/**
- * @author <a href="mailto:emuckenh@redhat.com">Emanuel Muckenhuber</a>
- * @version $Revision$
- */
-
-@XmlRootElement(name = "portlet-app")
-@XmlType(name = "portlet-appType")
-public class PortletApplication10MetaData
-{
- /** The portlet application id. */
- private String id;
-
- /** The portlet application version. */
- private String version;
-
- /** A bunch of portlets. */
- private Map<String, PortletMetaData> portlets;
-
- /** The user attributes. */
- private Map<String, UserAttributeMetaData> userAttributes;
-
- /** The custom portlet mode. */
- private Map<String, CustomPortletModeMetaData> customPortletModes;
-
- /** The custom window states. */
- private Map<String, CustomWindowStateMetaData> customWindowStates;
-
- /** The security constraints */
- private List<SecurityConstraintMetaData> securityConstraints;
-
- @XmlAttribute(name = "id")
- public String getId()
- {
- return id;
- }
-
- public void setId(String id)
- {
- this.id = id;
- }
-
- @XmlAttribute(name = "version")
- public String getVersion()
- {
- return version;
- }
-
- public void setVersion(String version)
- {
- this.version = version;
- }
-
- @XmlElement(name = "portlet")
- @XmlJavaTypeAdapter(PortletListAdapter.class)
- public Map<String, PortletMetaData> getPortlets()
- {
- return portlets;
- }
-
- public void setPortlets(Map<String, PortletMetaData> portlets)
- {
- this.portlets = portlets;
- }
-
- public Collection<PortletMetaData> getPortletCollection()
- {
- return portlets != null ? portlets.values() : null;
- }
-
- public PortletMetaData getPortlet(String portletName)
- {
- return portlets.get(portletName);
- }
-
- public void addPortlet(PortletMetaData portlet)
- {
- if(this.portlets == null)
- {
- this.portlets = new LinkedHashMap<String, PortletMetaData>();
- }
- this.portlets.put(portlet.getPortletName(), portlet);
- }
-
- @XmlElement(name = "user-attribute")
- @XmlJavaTypeAdapter(UserAttributeAdapter.class)
- public Map<String, UserAttributeMetaData> getUserAttributes()
- {
- return userAttributes;
- }
-
- public void setUserAttributes(Map<String, UserAttributeMetaData> userAttributes)
- {
- this.userAttributes = userAttributes;
- }
-
- public void addUserAttribute(UserAttributeMetaData userAttribute)
- {
- if( this.userAttributes == null )
- {
- this.userAttributes = new HashMap<String, UserAttributeMetaData>();
- }
- this.userAttributes.put(userAttribute.getName(), userAttribute);
- }
-
- @XmlElement(name = "custom-portlet-mode")
- @XmlJavaTypeAdapter(CustomPortletModeAdapter.class)
- public Map<String, CustomPortletModeMetaData> getCustomPortletModes()
- {
- return customPortletModes;
- }
-
- public void setCustomPortletModes(Map<String, CustomPortletModeMetaData> customPortletMode)
- {
- this.customPortletModes = customPortletMode;
- }
-
- public void addCustomPortletMode(CustomPortletModeMetaData portletMode)
- {
- if ( this.customPortletModes == null)
- {
- this.customPortletModes = new HashMap<String, CustomPortletModeMetaData>();
- }
- this.customPortletModes.put(portletMode.getPortletMode(), portletMode);
- }
-
- @XmlElement(name = "custom-window-state")
- @XmlJavaTypeAdapter(CustomWindowStateAdapter.class)
- public Map<String, CustomWindowStateMetaData> getCustomWindowStates()
- {
- return customWindowStates;
- }
-
- public void setCustomWindowStates(Map<String, CustomWindowStateMetaData> customWindowState)
- {
- this.customWindowStates = customWindowState;
- }
-
- public void addCustomWindowState(CustomWindowStateMetaData windowState)
- {
- if( this.customWindowStates == null )
- {
- this.customWindowStates = new HashMap<String, CustomWindowStateMetaData>();
- }
- this.customWindowStates.put(windowState.getWindowState(), windowState);
- }
-
- @XmlElement(name = "security-constraint")
- public List<SecurityConstraintMetaData> getSecurityConstraints()
- {
- return securityConstraints;
- }
-
- public void setSecurityConstraints(List<SecurityConstraintMetaData> securityConstraints)
- {
- this.securityConstraints = securityConstraints;
- }
-
- public void addSecurityConstraint(SecurityConstraintMetaData securityConstraint)
- {
- if(this.securityConstraints == null)
- {
- this.securityConstraints = new ArrayList<SecurityConstraintMetaData>();
- }
- this.securityConstraints.add(securityConstraint);
- }
-}
Deleted: modules/portlet/trunk/test/src/test/java/org/jboss/portal/portlet/test/metadata/impl/PortletApplication20MetaData.java
===================================================================
--- modules/portlet/trunk/test/src/test/java/org/jboss/portal/portlet/test/metadata/impl/PortletApplication20MetaData.java 2008-01-08 00:27:36 UTC (rev 9449)
+++ modules/portlet/trunk/test/src/test/java/org/jboss/portal/portlet/test/metadata/impl/PortletApplication20MetaData.java 2008-01-08 01:54:30 UTC (rev 9450)
@@ -1,240 +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.portlet.test.metadata.impl;
-
-import java.net.URI;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.LinkedHashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
-
-import org.jboss.portal.portlet.test.metadata.impl.adapter.ContainerRuntimeAdapter;
-import org.jboss.portal.portlet.test.metadata.impl.adapter.FilterAdapter;
-import org.jboss.portal.portlet.test.metadata.impl.adapter.FilterMappingAdapter;
-import org.jboss.portal.portlet.test.metadata.impl.common.ContainerRuntimeMetaData;
-import org.jboss.portal.portlet.test.metadata.impl.event.EventDefinitionMetaData;
-import org.jboss.portal.portlet.test.metadata.impl.filter.FilterMappingMetaData;
-import org.jboss.portal.portlet.test.metadata.impl.filter.FilterMetaData;
-
-/**
- * @author <a href="mailto:emuckenh@redhat.com">Emanuel Muckenhuber</a>
- * @version $Revision$
- */
-public class PortletApplication20MetaData extends PortletApplication10MetaData
-{
- /** The resource bundle (JSR 286) */
- private String resourceBundle;
-
- /** The default namespace URI (JSR 286) */
- private URI defaultNamespace;
-
- /** The filters (JSR 286) */
- private Map<String, FilterMetaData> filters;
-
- /** The filter mapping (JSR 286) */
- private Map<String, FilterMappingMetaData> filterMapping;
-
- /** The events (JSR 286) */
- private List<EventDefinitionMetaData> events;
-
- /** The public render parameters */
- private List<PublicRenderParameterMetaData> publicRenderParameters;
-
- /** The url generation listener */
- private List<ListenerMetaData> listeners;
-
- /** The container runtime options */
- private Map<String, ContainerRuntimeMetaData> containerRuntimeOptions;
-
- @XmlElement(name = "resource-bundle", namespace = PortletMetaDataConstants.PORTLET_JSR_286_NS)
- public String getResourceBundle()
- {
- return resourceBundle;
- }
-
- public void setResourceBundle(String resourceBundle)
- {
- this.resourceBundle = resourceBundle;
- }
-
- @XmlElement(name = "default-namespace")
- public URI getDefaultNamespace()
- {
- return defaultNamespace;
- }
-
- public void setDefaultNamespace(URI defaultNamespace)
- {
- this.defaultNamespace = defaultNamespace;
- }
-
- @XmlElement(name = "filter", namespace = PortletMetaDataConstants.PORTLET_JSR_286_NS)
- @XmlJavaTypeAdapter(FilterAdapter.class)
- public Map<String, FilterMetaData> getFilters()
- {
- return this.filters;
- }
-
- public void setFilters(Map<String, FilterMetaData> filters)
- {
- this.filters = filters;
- }
-
- public Collection<FilterMetaData> getFilterCollection()
- {
- return this.filters != null ? this.filters.values() : null;
- }
-
- public FilterMetaData getFilter(String filterName)
- {
- return this.filters.get(filterName);
- }
-
- public void addFilter(FilterMetaData filter)
- {
- if ( this.filters == null)
- {
- this.filters = new LinkedHashMap<String, FilterMetaData>();
- }
- this.filters.put(filter.getFilterName(), filter);
- }
-
- @XmlElement(name = "filter-mapping", namespace = PortletMetaDataConstants.PORTLET_JSR_286_NS)
- @XmlJavaTypeAdapter(FilterMappingAdapter.class)
- public Map<String, FilterMappingMetaData> getFilterMapping()
- {
- return filterMapping;
- }
-
- public void setFilterMapping(Map<String, FilterMappingMetaData> filterMapping)
- {
- this.filterMapping = filterMapping;
- }
-
- public void addFilterMapping(FilterMappingMetaData filterMapping)
- {
- if(this.filterMapping == null)
- {
- this.filterMapping = new HashMap<String, FilterMappingMetaData>();
- }
- this.filterMapping.put(filterMapping.getName(), filterMapping);
- }
-
- @XmlElement(name = "event-definition", namespace = PortletMetaDataConstants.PORTLET_JSR_286_NS)
- public List<EventDefinitionMetaData> getEvents()
- {
- return events;
- }
-
- public void setEvents(List<EventDefinitionMetaData> events)
- {
- this.events = events;
- }
-
- public void addEventDefinition(EventDefinitionMetaData eventDefinition)
- {
- if(this.events == null)
- {
- this.events = new ArrayList<EventDefinitionMetaData>();
- }
- this.events.add(eventDefinition);
- }
-
- @XmlElement(name = "public-render-parameter", namespace = PortletMetaDataConstants.PORTLET_JSR_286_NS)
- public List<PublicRenderParameterMetaData> getPublicRenderParameters()
- {
- return publicRenderParameters;
- }
-
- public void setPublicRenderParameters(List<PublicRenderParameterMetaData> publicRenderParameters)
- {
- this.publicRenderParameters = publicRenderParameters;
- }
-
- public void addPublicRenderParameter(PublicRenderParameterMetaData renderParameter)
- {
- if( this.publicRenderParameters == null)
- {
- this.publicRenderParameters = new ArrayList<PublicRenderParameterMetaData>();
- }
- this.publicRenderParameters.add(renderParameter);
- }
-
- @XmlElement(name = "listener", namespace = PortletMetaDataConstants.PORTLET_JSR_286_NS)
- public List<ListenerMetaData> getListeners()
- {
- return listeners;
- }
-
- public void setListeners(List<ListenerMetaData> listeners)
- {
- this.listeners = listeners;
- }
-
- public void addListener(ListenerMetaData listener)
- {
- if (this.listeners == null)
- {
- this.listeners = new ArrayList<ListenerMetaData>();
- }
- this.listeners.add(listener);
- }
-
- @XmlElement(name = "container-runtime-option",
- namespace = PortletMetaDataConstants.PORTLET_JSR_286_NS)
- @XmlJavaTypeAdapter(ContainerRuntimeAdapter.class)
- public Map<String, ContainerRuntimeMetaData> getContainerRuntimeOptions()
- {
- return containerRuntimeOptions;
- }
-
- public void setContainerRuntimeOptions(Map<String, ContainerRuntimeMetaData> containerRuntimeOptions)
- {
- this.containerRuntimeOptions = containerRuntimeOptions;
- }
-
- public ContainerRuntimeMetaData getContainerRuntimeOption(String option)
- {
- return this.containerRuntimeOptions.get(option);
- }
-
- public Set<String> getContainerRuntimeOptionSet()
- {
- return this.containerRuntimeOptions != null ? this.containerRuntimeOptions.keySet() : null;
- }
-
- public void addContainerRuntime(ContainerRuntimeMetaData option)
- {
- if (this.containerRuntimeOptions == null)
- {
- this.containerRuntimeOptions = new HashMap<String, ContainerRuntimeMetaData>();
- }
- this.containerRuntimeOptions.put(option.getName(), option);
- }
-}
Deleted: modules/portlet/trunk/test/src/test/java/org/jboss/portal/portlet/test/metadata/impl/PortletMetaDataConstants.java
===================================================================
--- modules/portlet/trunk/test/src/test/java/org/jboss/portal/portlet/test/metadata/impl/PortletMetaDataConstants.java 2008-01-08 00:27:36 UTC (rev 9449)
+++ modules/portlet/trunk/test/src/test/java/org/jboss/portal/portlet/test/metadata/impl/PortletMetaDataConstants.java 2008-01-08 01:54:30 UTC (rev 9450)
@@ -1,45 +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.portlet.test.metadata.impl;
-
-import static javax.xml.XMLConstants.*;
-
-/**
- * @author <a href="mailto:emuckenh@redhat.com">Emanuel Muckenhuber</a>
- * @version $Revision$
- */
-public class PortletMetaDataConstants
-{
-
- /** The portlet version 1.0 namespace */
- public final static String PORTLET_JSR_168_NS = "http://java.sun.com/xml/ns/portlet/portlet-app_1_0.xsd";
-
- /** The portlet version 2.0 namespace */
- public final static String PORTLET_JSR_286_NS = "http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd";
-
- /** The xml namespace */
- public final static String NS_XML_NAMESPACE = XML_NS_URI;
-
- /** The default locale */
- public final static String DEFAULT_LOCALE = "en";
-}
Deleted: modules/portlet/trunk/test/src/test/java/org/jboss/portal/portlet/test/metadata/impl/PublicRenderParameterMetaData.java
===================================================================
--- modules/portlet/trunk/test/src/test/java/org/jboss/portal/portlet/test/metadata/impl/PublicRenderParameterMetaData.java 2008-01-08 00:27:36 UTC (rev 9449)
+++ modules/portlet/trunk/test/src/test/java/org/jboss/portal/portlet/test/metadata/impl/PublicRenderParameterMetaData.java 2008-01-08 01:54:30 UTC (rev 9450)
@@ -1,129 +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.portlet.test.metadata.impl;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.xml.bind.annotation.XmlAttribute;
-import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.XmlType;
-import javax.xml.namespace.QName;
-
-import org.jboss.portal.portlet.test.metadata.impl.common.DescribableMetaData;
-
-/**
- * @author <a href="mailto:emuckenh@redhat.com">Emanuel Muckenhuber</a>
- * @version $Revision$
- */
-@XmlType(name = "public-render-parameterType")
-public class PublicRenderParameterMetaData extends DescribableMetaData
-{
-
- /** The public render parameter id */
- private String id;
-
- /** The public render parameter identifier */
- private String identifier;
-
- /** The QName */
- private QName qname;
-
- /** The name */
- private String name;
-
- /** The public render parameter alias */
- private List<QName> alias;
-
- public PublicRenderParameterMetaData() {}
-
- public PublicRenderParameterMetaData(String id)
- {
- this.id = id;
- }
-
- @XmlAttribute(name = "id")
- public String getId()
- {
- return id;
- }
-
- public void setId(String id)
- {
- this.id = id;
- }
-
- @XmlElement(name = "identifier")
- public String getIdentifier()
- {
- return identifier;
- }
-
- public void setIdentifier(String identifier)
- {
- this.identifier = identifier;
- }
-
- @XmlElement(name = "qname")
- public QName getQname()
- {
- return qname;
- }
-
- public void setQname(QName qname)
- {
- this.qname = qname;
- }
-
- @XmlElement(name = "name")
- public String getName()
- {
- return name;
- }
-
- public void setName(String name)
- {
- this.name = name;
- }
-
- @XmlElement(name = "alias")
- public List<QName> getAlias()
- {
- return alias;
- }
-
- public void setAlias(List<QName> alias)
- {
- this.alias = alias;
- }
-
- public void addAlias(QName alias)
- {
- if(this.alias == null)
- {
- this.alias = new ArrayList<QName>();
- }
- this.alias.add(alias);
- }
-
-}
Deleted: modules/portlet/trunk/test/src/test/java/org/jboss/portal/portlet/test/metadata/impl/UserAttributeMetaData.java
===================================================================
--- modules/portlet/trunk/test/src/test/java/org/jboss/portal/portlet/test/metadata/impl/UserAttributeMetaData.java 2008-01-08 00:27:36 UTC (rev 9449)
+++ modules/portlet/trunk/test/src/test/java/org/jboss/portal/portlet/test/metadata/impl/UserAttributeMetaData.java 2008-01-08 01:54:30 UTC (rev 9450)
@@ -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.portlet.test.metadata.impl;
-
-import javax.xml.bind.annotation.XmlAttribute;
-import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.XmlType;
-
-import org.jboss.portal.portlet.test.metadata.impl.common.DescribableMetaData;
-
-/**
- * @author <a href="mailto:emuckenh@redhat.com">Emanuel Muckenhuber</a>
- * @version $Revision$
- */
-@XmlType(name = "user-attributeType")
-public class UserAttributeMetaData extends DescribableMetaData
-{
-
- /** The id */
- private String id;
-
- /** The name */
- private String name;
-
- public UserAttributeMetaData() {}
-
- public UserAttributeMetaData(String id)
- {
- this.id = id;
- }
-
- @XmlAttribute(name = "id")
- public String getId()
- {
- return id;
- }
-
- public void setId(String id)
- {
- this.id = id;
- }
-
- @XmlElement(name = "name")
- public String getName()
- {
- return name;
- }
-
- public void setName(String name)
- {
- this.name = name;
- }
-}
-
18 years, 3 months
JBoss Portal SVN: r9449 - in modules/portlet/trunk/test/src/test/java/org/jboss/portal/portlet/test/metadata: factory and 1 other directories.
by portal-commits@lists.jboss.org
Author: julien(a)jboss.com
Date: 2008-01-07 19:27:36 -0500 (Mon, 07 Jan 2008)
New Revision: 9449
Added:
modules/portlet/trunk/test/src/test/java/org/jboss/portal/portlet/test/metadata/impl/AnnotationPortletApplication10MetaData.java
modules/portlet/trunk/test/src/test/java/org/jboss/portal/portlet/test/metadata/impl/AnnotationPortletApplication20MetaData.java
Removed:
modules/portlet/trunk/test/src/test/java/org/jboss/portal/portlet/test/metadata/impl/PortletApplicationMetaData.java
Modified:
modules/portlet/trunk/test/src/test/java/org/jboss/portal/portlet/test/metadata/AbstractMetaDataTestCase.java
modules/portlet/trunk/test/src/test/java/org/jboss/portal/portlet/test/metadata/CustomPortletModeTestEverythingTestCase.java
modules/portlet/trunk/test/src/test/java/org/jboss/portal/portlet/test/metadata/CustomWindowStateTestEverythingTestCase.java
modules/portlet/trunk/test/src/test/java/org/jboss/portal/portlet/test/metadata/EventTestEverythingTestCase.java
modules/portlet/trunk/test/src/test/java/org/jboss/portal/portlet/test/metadata/FilterTestEverythingTestCase.java
modules/portlet/trunk/test/src/test/java/org/jboss/portal/portlet/test/metadata/GeneralMetaDataTestCase.java
modules/portlet/trunk/test/src/test/java/org/jboss/portal/portlet/test/metadata/PortletTestEverythingTestCase.java
modules/portlet/trunk/test/src/test/java/org/jboss/portal/portlet/test/metadata/RenderParameterTestEverythingTestCase.java
modules/portlet/trunk/test/src/test/java/org/jboss/portal/portlet/test/metadata/SecurityConstraintTestEverythingTestCase.java
modules/portlet/trunk/test/src/test/java/org/jboss/portal/portlet/test/metadata/UserAttributeTestEverythingTestCase.java
modules/portlet/trunk/test/src/test/java/org/jboss/portal/portlet/test/metadata/factory/PortletApplicationModelFactory.java
modules/portlet/trunk/test/src/test/java/org/jboss/portal/portlet/test/metadata/impl/PortletApplication10MetaData.java
modules/portlet/trunk/test/src/test/java/org/jboss/portal/portlet/test/metadata/impl/PortletApplication20MetaData.java
Log:
- split PortletApplicationMetaData for use with JBossXB annotations and without
Modified: modules/portlet/trunk/test/src/test/java/org/jboss/portal/portlet/test/metadata/AbstractMetaDataTestCase.java
===================================================================
--- modules/portlet/trunk/test/src/test/java/org/jboss/portal/portlet/test/metadata/AbstractMetaDataTestCase.java 2008-01-07 19:56:29 UTC (rev 9448)
+++ modules/portlet/trunk/test/src/test/java/org/jboss/portal/portlet/test/metadata/AbstractMetaDataTestCase.java 2008-01-08 00:27:36 UTC (rev 9449)
@@ -28,9 +28,10 @@
import org.jboss.portal.portlet.test.deployment.ValueTrimmingFilter;
import org.jboss.portal.portlet.test.metadata.factory.PortletApplicationModelFactory;
+import org.jboss.portal.portlet.test.metadata.impl.AnnotationPortletApplication10MetaData;
+import org.jboss.portal.portlet.test.metadata.impl.AnnotationPortletApplication20MetaData;
import org.jboss.portal.portlet.test.metadata.impl.PortletApplication10MetaData;
import org.jboss.portal.portlet.test.metadata.impl.PortletApplication20MetaData;
-import org.jboss.portal.portlet.test.metadata.impl.PortletApplicationMetaData;
import static org.jboss.portal.portlet.test.metadata.impl.PortletMetaDataConstants.*;
@@ -84,8 +85,8 @@
/** SchemaResolver */
resolver.addSchemaLocation(PORTLET_JSR_168_NS, "portlet-app_1_0.xsd");
resolver.addSchemaLocation(PORTLET_JSR_286_NS, "portlet-app_2_0.xsd");
- resolver.addClassBinding(PORTLET_JSR_286_NS, PortletApplication20MetaData.class);
- resolver.addClassBinding(PORTLET_JSR_168_NS, PortletApplication10MetaData.class);
+ resolver.addClassBinding(PORTLET_JSR_286_NS, AnnotationPortletApplication20MetaData.class);
+ resolver.addClassBinding(PORTLET_JSR_168_NS, AnnotationPortletApplication10MetaData.class);
}
catch (Exception e)
{
@@ -93,7 +94,7 @@
}
}
- protected PortletApplicationMetaData unmarshall(String file) throws JBossXBException, SAXException, IOException
+ protected PortletApplication10MetaData unmarshall10(String file) throws JBossXBException, SAXException, IOException
{
if (ANNOTATION_BINDING.equals(parser))
{
@@ -109,7 +110,23 @@
}
}
- private PortletApplicationMetaData unmarshallAnnotation(String file) throws JBossXBException, SAXException,
+ protected PortletApplication20MetaData unmarshall20(String file) throws JBossXBException, SAXException, IOException
+ {
+ if (ANNOTATION_BINDING.equals(parser))
+ {
+ return (PortletApplication20MetaData)this.unmarshallAnnotation(file);
+ }
+ else if (FACTORY_BINDING.equals(parser))
+ {
+ return (PortletApplication20MetaData)this.unmarshallWithFactory(file);
+ }
+ else
+ {
+ throw new IllegalArgumentException("Wrong parameter for parser.");
+ }
+ }
+
+ private PortletApplication10MetaData unmarshallAnnotation(String file) throws JBossXBException, SAXException,
IOException
{
/** validate */
@@ -119,10 +136,10 @@
unmarshaller.setValidation(true);
/** unmarshal */
- return (PortletApplicationMetaData) unmarshaller.unmarshal(getPath(file), resolver);
+ return (PortletApplication10MetaData) unmarshaller.unmarshal(getPath(file), resolver);
}
- private PortletApplicationMetaData unmarshallWithFactory(String file) throws JBossXBException
+ private PortletApplication10MetaData unmarshallWithFactory(String file) throws JBossXBException
{
/** validate */
unmarshaller = UnmarshallerFactory.newInstance().newUnmarshaller();
@@ -132,7 +149,7 @@
PortletApplicationModelFactory factory = new PortletApplicationModelFactory();
/** unmarshal */
- return (PortletApplicationMetaData) unmarshaller.unmarshal(getStream(file), new ValueTrimmingFilter(factory),
+ return (PortletApplication10MetaData) unmarshaller.unmarshal(getStream(file), new ValueTrimmingFilter(factory),
null);
}
Modified: modules/portlet/trunk/test/src/test/java/org/jboss/portal/portlet/test/metadata/CustomPortletModeTestEverythingTestCase.java
===================================================================
--- modules/portlet/trunk/test/src/test/java/org/jboss/portal/portlet/test/metadata/CustomPortletModeTestEverythingTestCase.java 2008-01-07 19:56:29 UTC (rev 9448)
+++ modules/portlet/trunk/test/src/test/java/org/jboss/portal/portlet/test/metadata/CustomPortletModeTestEverythingTestCase.java 2008-01-08 00:27:36 UTC (rev 9449)
@@ -27,7 +27,6 @@
import org.jboss.portal.portlet.test.metadata.impl.CustomPortletModeMetaData;
import org.jboss.portal.portlet.test.metadata.impl.PortletApplication10MetaData;
import org.jboss.portal.portlet.test.metadata.impl.PortletApplication20MetaData;
-import org.jboss.portal.portlet.test.metadata.impl.PortletApplicationMetaData;
import org.jboss.unit.api.pojo.annotations.Test;
import static org.jboss.unit.api.Assert.*;
@@ -47,7 +46,7 @@
{
String xmlFile = "customPortletMode/portlet1.xml";
- PortletApplicationMetaData md = unmarshall(xmlFile);
+ PortletApplication10MetaData md = unmarshall10(xmlFile);
assertNotNull(md);
assertTrue(md instanceof PortletApplication10MetaData);
assertEquals("1.0", md.getVersion());
@@ -77,7 +76,7 @@
String xmlFile = "customPortletMode/portlet2.xml";
- PortletApplicationMetaData md = unmarshall(xmlFile);
+ PortletApplication10MetaData md = unmarshall10(xmlFile);
assertNotNull(md);
assertTrue(md instanceof PortletApplication20MetaData);
assertEquals("2.0", md.getVersion());
@@ -120,7 +119,7 @@
String xmlFile = "customPortletMode/portlet1-fail.xml";
- PortletApplicationMetaData md = unmarshall(xmlFile);
+ PortletApplication10MetaData md = unmarshall10(xmlFile);
fail("portlet 2.0 properties are not allowed");
}
catch (Exception e)
Modified: modules/portlet/trunk/test/src/test/java/org/jboss/portal/portlet/test/metadata/CustomWindowStateTestEverythingTestCase.java
===================================================================
--- modules/portlet/trunk/test/src/test/java/org/jboss/portal/portlet/test/metadata/CustomWindowStateTestEverythingTestCase.java 2008-01-07 19:56:29 UTC (rev 9448)
+++ modules/portlet/trunk/test/src/test/java/org/jboss/portal/portlet/test/metadata/CustomWindowStateTestEverythingTestCase.java 2008-01-08 00:27:36 UTC (rev 9449)
@@ -27,7 +27,6 @@
import org.jboss.portal.portlet.test.metadata.impl.CustomWindowStateMetaData;
import org.jboss.portal.portlet.test.metadata.impl.PortletApplication10MetaData;
import org.jboss.portal.portlet.test.metadata.impl.PortletApplication20MetaData;
-import org.jboss.portal.portlet.test.metadata.impl.PortletApplicationMetaData;
import org.jboss.unit.api.pojo.annotations.Test;
import static org.jboss.unit.api.Assert.*;
@@ -46,7 +45,7 @@
String xmlFile = "customWindowState/portlet1.xml";
- PortletApplicationMetaData md = unmarshall(xmlFile);
+ PortletApplication10MetaData md = unmarshall10(xmlFile);
assertNotNull(md);
assertTrue(md instanceof PortletApplication10MetaData);
assertEquals("1.0", md.getVersion());
@@ -77,7 +76,7 @@
String xmlFile = "customWindowState/portlet2.xml";
- PortletApplicationMetaData md = unmarshall(xmlFile);
+ PortletApplication10MetaData md = unmarshall10(xmlFile);
assertNotNull(md);
assertTrue(md instanceof PortletApplication20MetaData);
assertEquals("2.0", md.getVersion());
Modified: modules/portlet/trunk/test/src/test/java/org/jboss/portal/portlet/test/metadata/EventTestEverythingTestCase.java
===================================================================
--- modules/portlet/trunk/test/src/test/java/org/jboss/portal/portlet/test/metadata/EventTestEverythingTestCase.java 2008-01-07 19:56:29 UTC (rev 9448)
+++ modules/portlet/trunk/test/src/test/java/org/jboss/portal/portlet/test/metadata/EventTestEverythingTestCase.java 2008-01-08 00:27:36 UTC (rev 9449)
@@ -27,7 +27,7 @@
import javax.xml.namespace.QName;
import org.jboss.portal.portlet.test.metadata.impl.PortletApplication20MetaData;
-import org.jboss.portal.portlet.test.metadata.impl.PortletApplicationMetaData;
+import org.jboss.portal.portlet.test.metadata.impl.PortletApplication10MetaData;
import org.jboss.portal.portlet.test.metadata.impl.event.EventDefinitionMetaData;
import org.jboss.portal.portlet.test.metadata.impl.event.EventDefinitionReferenceMetaData;
import org.jboss.portal.portlet.test.metadata.impl.portlet.PortletMetaData;
@@ -50,7 +50,7 @@
String xmlFile = "event/portlet-event1.xml";
- unmarshall(xmlFile);
+ unmarshall10(xmlFile);
fail();
}
catch (Exception e)
@@ -67,7 +67,7 @@
String xmlFile = "event/portlet-event2.xml";
- PortletApplicationMetaData md = unmarshall(xmlFile);
+ PortletApplication20MetaData md = unmarshall20(xmlFile);
assertNotNull(md);
assertTrue(md instanceof PortletApplication20MetaData);
assertEquals("2.0", md.getVersion());
@@ -127,7 +127,7 @@
String xmlFile = "event/portlet-event2-fail.xml";
- PortletApplicationMetaData md = unmarshall(xmlFile);
+ PortletApplication10MetaData md = unmarshall10(xmlFile);
assertNotNull(md);
assertEquals("2.0", md.getVersion());
Modified: modules/portlet/trunk/test/src/test/java/org/jboss/portal/portlet/test/metadata/FilterTestEverythingTestCase.java
===================================================================
--- modules/portlet/trunk/test/src/test/java/org/jboss/portal/portlet/test/metadata/FilterTestEverythingTestCase.java 2008-01-07 19:56:29 UTC (rev 9448)
+++ modules/portlet/trunk/test/src/test/java/org/jboss/portal/portlet/test/metadata/FilterTestEverythingTestCase.java 2008-01-08 00:27:36 UTC (rev 9449)
@@ -25,7 +25,6 @@
import java.util.Locale;
import org.jboss.portal.portlet.test.metadata.impl.PortletApplication20MetaData;
-import org.jboss.portal.portlet.test.metadata.impl.PortletApplicationMetaData;
import org.jboss.portal.portlet.test.metadata.impl.common.InitParamMetaData;
import org.jboss.portal.portlet.test.metadata.impl.filter.FilterMetaData;
import org.jboss.unit.api.pojo.annotations.Test;
@@ -44,7 +43,7 @@
{
try
{
- unmarshall("filter/portlet-filter1.xml");
+ unmarshall10("filter/portlet-filter1.xml");
// no filters in jsr 168
fail();
}
@@ -61,7 +60,7 @@
{
String xmlFile = "filter/portlet-filter2.xml";
- PortletApplicationMetaData md = unmarshall(xmlFile);
+ PortletApplication20MetaData md = unmarshall20(xmlFile);
assertNotNull(md);
assertTrue(md instanceof PortletApplication20MetaData);
Modified: modules/portlet/trunk/test/src/test/java/org/jboss/portal/portlet/test/metadata/GeneralMetaDataTestCase.java
===================================================================
--- modules/portlet/trunk/test/src/test/java/org/jboss/portal/portlet/test/metadata/GeneralMetaDataTestCase.java 2008-01-07 19:56:29 UTC (rev 9448)
+++ modules/portlet/trunk/test/src/test/java/org/jboss/portal/portlet/test/metadata/GeneralMetaDataTestCase.java 2008-01-08 00:27:36 UTC (rev 9449)
@@ -28,7 +28,6 @@
import org.jboss.portal.portlet.test.metadata.impl.ListenerMetaData;
import org.jboss.portal.portlet.test.metadata.impl.PortletApplication10MetaData;
import org.jboss.portal.portlet.test.metadata.impl.PortletApplication20MetaData;
-import org.jboss.portal.portlet.test.metadata.impl.PortletApplicationMetaData;
import org.jboss.portal.portlet.test.metadata.impl.PublicRenderParameterMetaData;
import org.jboss.unit.api.pojo.annotations.Test;
@@ -46,7 +45,7 @@
{
try
{
- PortletApplicationMetaData md = this.unmarshall("general/portlet1.xml");
+ PortletApplication10MetaData md = this.unmarshall10("general/portlet1.xml");
assertNotNull(md);
assertTrue(md instanceof PortletApplication10MetaData);
assertEquals("1.0", md.getVersion());
@@ -63,7 +62,7 @@
{
try
{
- PortletApplicationMetaData md = this.unmarshall("general/portlet2.xml");
+ PortletApplication10MetaData md = this.unmarshall10("general/portlet2.xml");
assertNotNull(md);
assertTrue(md instanceof PortletApplication20MetaData);
assertEquals("2.0", md.getVersion());
@@ -80,7 +79,7 @@
{
try
{
- PortletApplicationMetaData md = (PortletApplicationMetaData) this.unmarshall("general/portlet2-jsr286.xml");
+ PortletApplication20MetaData md = unmarshall20("general/portlet2-jsr286.xml");
assertEquals("2.0", md.getVersion());
assertTrue(md instanceof PortletApplication20MetaData);
@@ -119,7 +118,7 @@
{
try
{
- PortletApplicationMetaData md = unmarshall("general/portlet-app_1_0.xml");
+ PortletApplication10MetaData md = unmarshall10("general/portlet-app_1_0.xml");
assertNotNull(md);
assertTrue(md instanceof PortletApplication10MetaData);
@@ -139,7 +138,7 @@
{
try
{
- PortletApplicationMetaData md = (PortletApplicationMetaData) this.unmarshall("general/portlet-app_2_0.xml");
+ PortletApplication10MetaData md = this.unmarshall10("general/portlet-app_2_0.xml");
assertEquals("2.0", md.getVersion());
assertTrue(md instanceof PortletApplication20MetaData);
}
Modified: modules/portlet/trunk/test/src/test/java/org/jboss/portal/portlet/test/metadata/PortletTestEverythingTestCase.java
===================================================================
--- modules/portlet/trunk/test/src/test/java/org/jboss/portal/portlet/test/metadata/PortletTestEverythingTestCase.java 2008-01-07 19:56:29 UTC (rev 9448)
+++ modules/portlet/trunk/test/src/test/java/org/jboss/portal/portlet/test/metadata/PortletTestEverythingTestCase.java 2008-01-08 00:27:36 UTC (rev 9449)
@@ -27,7 +27,6 @@
import org.jboss.portal.portlet.test.metadata.impl.PortletApplication10MetaData;
import org.jboss.portal.portlet.test.metadata.impl.PortletApplication20MetaData;
-import org.jboss.portal.portlet.test.metadata.impl.PortletApplicationMetaData;
import org.jboss.portal.portlet.test.metadata.impl.PortletMetaDataConstants;
import org.jboss.portal.portlet.test.metadata.impl.common.InitParamMetaData;
import org.jboss.portal.portlet.test.metadata.impl.portlet.PortletCacheScopeEnum;
@@ -55,7 +54,7 @@
{
String xmlFile = "portlet/portlet1.xml";
- PortletApplicationMetaData md = unmarshall(xmlFile);
+ PortletApplication10MetaData md = unmarshall10(xmlFile);
assertNotNull(md);
assertTrue(md instanceof PortletApplication10MetaData);
assertEquals("1.0", md.getVersion());
@@ -210,7 +209,7 @@
{
String xmlFile = "portlet/portlet2.xml";
- PortletApplicationMetaData md = unmarshall(xmlFile);
+ PortletApplication10MetaData md = unmarshall10(xmlFile);
assertNotNull(md);
assertTrue(md instanceof PortletApplication20MetaData);
assertEquals("2.0", md.getVersion());
@@ -366,7 +365,7 @@
{
String xmlFile = "portlet/portlet2-jsr286.xml";
- PortletApplicationMetaData md = unmarshall(xmlFile);
+ PortletApplication10MetaData md = unmarshall10(xmlFile);
assertNotNull(md);
assertTrue(md instanceof PortletApplication20MetaData);
assertEquals("2.0", md.getVersion());
Modified: modules/portlet/trunk/test/src/test/java/org/jboss/portal/portlet/test/metadata/RenderParameterTestEverythingTestCase.java
===================================================================
--- modules/portlet/trunk/test/src/test/java/org/jboss/portal/portlet/test/metadata/RenderParameterTestEverythingTestCase.java 2008-01-07 19:56:29 UTC (rev 9448)
+++ modules/portlet/trunk/test/src/test/java/org/jboss/portal/portlet/test/metadata/RenderParameterTestEverythingTestCase.java 2008-01-08 00:27:36 UTC (rev 9449)
@@ -23,8 +23,8 @@
package org.jboss.portal.portlet.test.metadata;
import org.jboss.portal.portlet.test.metadata.impl.PortletApplication20MetaData;
-import org.jboss.portal.portlet.test.metadata.impl.PortletApplicationMetaData;
import org.jboss.portal.portlet.test.metadata.impl.PublicRenderParameterMetaData;
+import org.jboss.portal.portlet.test.metadata.impl.PortletApplication10MetaData;
import org.jboss.unit.api.pojo.annotations.Test;
import static org.jboss.unit.api.Assert.*;
@@ -43,7 +43,7 @@
String xmlFile = "renderParameter/portlet2.xml";
- PortletApplicationMetaData md = unmarshall(xmlFile);
+ PortletApplication20MetaData md = unmarshall20(xmlFile);
assertNotNull(md);
assertTrue(md instanceof PortletApplication20MetaData);
assertEquals("2.0", md.getVersion());
Modified: modules/portlet/trunk/test/src/test/java/org/jboss/portal/portlet/test/metadata/SecurityConstraintTestEverythingTestCase.java
===================================================================
--- modules/portlet/trunk/test/src/test/java/org/jboss/portal/portlet/test/metadata/SecurityConstraintTestEverythingTestCase.java 2008-01-07 19:56:29 UTC (rev 9448)
+++ modules/portlet/trunk/test/src/test/java/org/jboss/portal/portlet/test/metadata/SecurityConstraintTestEverythingTestCase.java 2008-01-08 00:27:36 UTC (rev 9449)
@@ -26,7 +26,6 @@
import org.jboss.portal.portlet.test.metadata.impl.PortletApplication10MetaData;
import org.jboss.portal.portlet.test.metadata.impl.PortletApplication20MetaData;
-import org.jboss.portal.portlet.test.metadata.impl.PortletApplicationMetaData;
import org.jboss.portal.portlet.test.metadata.impl.portlet.PortletMetaData;
import org.jboss.portal.portlet.test.metadata.impl.security.SecurityConstraintMetaData;
import org.jboss.portal.portlet.test.metadata.impl.security.TransportGuaranteeEnum;
@@ -48,7 +47,7 @@
String xmlFile = "security/portlet1.xml";
- PortletApplicationMetaData md = unmarshall(xmlFile);
+ PortletApplication10MetaData md = unmarshall10(xmlFile);
assertNotNull(md);
assertTrue(md instanceof PortletApplication10MetaData);
assertEquals("1.0", md.getVersion());
@@ -138,7 +137,7 @@
String xmlFile = "security/portlet2.xml";
- PortletApplicationMetaData md = unmarshall( xmlFile);
+ PortletApplication10MetaData md = unmarshall10( xmlFile);
assertNotNull(md);
assertTrue(md instanceof PortletApplication20MetaData);
assertEquals("2.0", md.getVersion());
Modified: modules/portlet/trunk/test/src/test/java/org/jboss/portal/portlet/test/metadata/UserAttributeTestEverythingTestCase.java
===================================================================
--- modules/portlet/trunk/test/src/test/java/org/jboss/portal/portlet/test/metadata/UserAttributeTestEverythingTestCase.java 2008-01-07 19:56:29 UTC (rev 9448)
+++ modules/portlet/trunk/test/src/test/java/org/jboss/portal/portlet/test/metadata/UserAttributeTestEverythingTestCase.java 2008-01-08 00:27:36 UTC (rev 9449)
@@ -26,7 +26,6 @@
import org.jboss.portal.portlet.test.metadata.impl.PortletApplication10MetaData;
import org.jboss.portal.portlet.test.metadata.impl.PortletApplication20MetaData;
-import org.jboss.portal.portlet.test.metadata.impl.PortletApplicationMetaData;
import org.jboss.portal.portlet.test.metadata.impl.UserAttributeMetaData;
import org.jboss.unit.api.pojo.annotations.Test;
@@ -46,7 +45,7 @@
{
String xmlFile = "userAttribute/portlet1.xml";
- PortletApplicationMetaData md = unmarshall(xmlFile);
+ PortletApplication10MetaData md = unmarshall10(xmlFile);
assertNotNull(md);
assertTrue(md instanceof PortletApplication10MetaData);
@@ -76,7 +75,7 @@
{
String xmlFile = "userAttribute/portlet2.xml";
- PortletApplicationMetaData md = unmarshall(xmlFile);
+ PortletApplication10MetaData md = unmarshall10(xmlFile);
assertNotNull(md);
assertTrue(md instanceof PortletApplication20MetaData);
Modified: modules/portlet/trunk/test/src/test/java/org/jboss/portal/portlet/test/metadata/factory/PortletApplicationModelFactory.java
===================================================================
--- modules/portlet/trunk/test/src/test/java/org/jboss/portal/portlet/test/metadata/factory/PortletApplicationModelFactory.java 2008-01-07 19:56:29 UTC (rev 9448)
+++ modules/portlet/trunk/test/src/test/java/org/jboss/portal/portlet/test/metadata/factory/PortletApplicationModelFactory.java 2008-01-08 00:27:36 UTC (rev 9449)
@@ -30,11 +30,12 @@
import org.jboss.portal.portlet.test.metadata.impl.CustomPortletModeMetaData;
import org.jboss.portal.portlet.test.metadata.impl.CustomWindowStateMetaData;
import org.jboss.portal.portlet.test.metadata.impl.ListenerMetaData;
-import org.jboss.portal.portlet.test.metadata.impl.PortletApplication10MetaData;
import org.jboss.portal.portlet.test.metadata.impl.PortletApplication20MetaData;
-import org.jboss.portal.portlet.test.metadata.impl.PortletApplicationMetaData;
import org.jboss.portal.portlet.test.metadata.impl.PublicRenderParameterMetaData;
import org.jboss.portal.portlet.test.metadata.impl.UserAttributeMetaData;
+import org.jboss.portal.portlet.test.metadata.impl.AnnotationPortletApplication10MetaData;
+import org.jboss.portal.portlet.test.metadata.impl.AnnotationPortletApplication20MetaData;
+import org.jboss.portal.portlet.test.metadata.impl.PortletApplication10MetaData;
import org.jboss.portal.portlet.test.metadata.impl.common.ContainerRuntimeMetaData;
import org.jboss.portal.portlet.test.metadata.impl.common.DescribableMetaData;
import org.jboss.portal.portlet.test.metadata.impl.common.InitParamMetaData;
@@ -86,9 +87,9 @@
String id = attrs.getValue("id");
// portlet-app 2.0 or 1.0
- PortletApplicationMetaData md = PORTLET_JSR_286_NS.equals(nsURI)
- ? new PortletApplication20MetaData()
- : new PortletApplication10MetaData();
+ PortletApplication10MetaData md = PORTLET_JSR_286_NS.equals(nsURI)
+ ? new AnnotationPortletApplication20MetaData()
+ : new AnnotationPortletApplication10MetaData();
// Set portlet-app id
md.setId(id);
@@ -119,7 +120,7 @@
}
// portlet-app
- if (object instanceof PortletApplicationMetaData)
+ if (object instanceof PortletApplication10MetaData)
{
if ("portlet".equals(localName))
{
@@ -304,9 +305,9 @@
}
// portlet app
- if (parent instanceof PortletApplicationMetaData)
+ if (parent instanceof PortletApplication10MetaData)
{
- PortletApplicationMetaData md = (PortletApplicationMetaData) parent;
+ PortletApplication10MetaData md = (PortletApplication10MetaData) parent;
// add portlet
if (child instanceof PortletMetaData)
{
Added: modules/portlet/trunk/test/src/test/java/org/jboss/portal/portlet/test/metadata/impl/AnnotationPortletApplication10MetaData.java
===================================================================
--- modules/portlet/trunk/test/src/test/java/org/jboss/portal/portlet/test/metadata/impl/AnnotationPortletApplication10MetaData.java (rev 0)
+++ modules/portlet/trunk/test/src/test/java/org/jboss/portal/portlet/test/metadata/impl/AnnotationPortletApplication10MetaData.java 2008-01-08 00:27:36 UTC (rev 9449)
@@ -0,0 +1,44 @@
+/******************************************************************************
+ * 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.portlet.test.metadata.impl;
+
+import javax.xml.bind.annotation.XmlNsForm;
+import javax.xml.bind.annotation.XmlNs;
+import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.bind.annotation.XmlType;
+
+import org.jboss.xb.annotations.JBossXmlSchema;
+
+/**
+ * @author <a href="mailto:emuckenh@redhat.com">Emanuel Muckenhuber</a>
+ * @version $Revision$
+ */
+@XmlRootElement(name = "portlet-app")
+@XmlType(name = "portlet-appType")
+@JBossXmlSchema(xmlns = {@XmlNs(namespaceURI = PortletMetaDataConstants.PORTLET_JSR_168_NS, prefix = "portlet")},
+ ignoreUnresolvedFieldOrClass = false,
+ namespace = PortletMetaDataConstants.PORTLET_JSR_168_NS,
+ elementFormDefault = XmlNsForm.QUALIFIED)
+public class AnnotationPortletApplication10MetaData extends PortletApplication10MetaData
+{
+}
\ No newline at end of file
Added: modules/portlet/trunk/test/src/test/java/org/jboss/portal/portlet/test/metadata/impl/AnnotationPortletApplication20MetaData.java
===================================================================
--- modules/portlet/trunk/test/src/test/java/org/jboss/portal/portlet/test/metadata/impl/AnnotationPortletApplication20MetaData.java (rev 0)
+++ modules/portlet/trunk/test/src/test/java/org/jboss/portal/portlet/test/metadata/impl/AnnotationPortletApplication20MetaData.java 2008-01-08 00:27:36 UTC (rev 9449)
@@ -0,0 +1,45 @@
+/******************************************************************************
+ * 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.portlet.test.metadata.impl;
+
+import javax.xml.bind.annotation.XmlNs;
+import javax.xml.bind.annotation.XmlNsForm;
+import javax.xml.bind.annotation.XmlRootElement;
+import javax.xml.bind.annotation.XmlType;
+
+import org.jboss.xb.annotations.JBossXmlSchema;
+
+/**
+ * @author <a href="mailto:emuckenh@redhat.com">Emanuel Muckenhuber</a>
+ * @version $Revision$
+ */
+
+@XmlRootElement(name = "portlet-app")
+@XmlType(name = "portlet-appType")
+@JBossXmlSchema(xmlns = {@XmlNs(namespaceURI = PortletMetaDataConstants.PORTLET_JSR_286_NS, prefix = "portlet")},
+ ignoreUnresolvedFieldOrClass = false,
+ namespace = PortletMetaDataConstants.PORTLET_JSR_286_NS,
+ elementFormDefault = XmlNsForm.QUALIFIED)
+public class AnnotationPortletApplication20MetaData extends PortletApplication20MetaData
+{
+}
\ No newline at end of file
Modified: modules/portlet/trunk/test/src/test/java/org/jboss/portal/portlet/test/metadata/impl/PortletApplication10MetaData.java
===================================================================
--- modules/portlet/trunk/test/src/test/java/org/jboss/portal/portlet/test/metadata/impl/PortletApplication10MetaData.java 2008-01-07 19:56:29 UTC (rev 9448)
+++ modules/portlet/trunk/test/src/test/java/org/jboss/portal/portlet/test/metadata/impl/PortletApplication10MetaData.java 2008-01-08 00:27:36 UTC (rev 9449)
@@ -33,23 +33,16 @@
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.XmlNsForm;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;
-import javax.xml.bind.annotation.XmlNs;
import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
import org.jboss.portal.portlet.test.metadata.impl.adapter.CustomPortletModeAdapter;
import org.jboss.portal.portlet.test.metadata.impl.adapter.CustomWindowStateAdapter;
import org.jboss.portal.portlet.test.metadata.impl.adapter.PortletListAdapter;
import org.jboss.portal.portlet.test.metadata.impl.adapter.UserAttributeAdapter;
-import org.jboss.portal.portlet.test.metadata.impl.common.ContainerRuntimeMetaData;
-import org.jboss.portal.portlet.test.metadata.impl.event.EventDefinitionMetaData;
-import org.jboss.portal.portlet.test.metadata.impl.filter.FilterMappingMetaData;
-import org.jboss.portal.portlet.test.metadata.impl.filter.FilterMetaData;
import org.jboss.portal.portlet.test.metadata.impl.portlet.PortletMetaData;
import org.jboss.portal.portlet.test.metadata.impl.security.SecurityConstraintMetaData;
-import org.jboss.xb.annotations.JBossXmlSchema;
/**
* @author <a href="mailto:emuckenh@redhat.com">Emanuel Muckenhuber</a>
@@ -57,12 +50,8 @@
*/
@XmlRootElement(name = "portlet-app")
-@JBossXmlSchema(xmlns = {@XmlNs(namespaceURI = PortletMetaDataConstants.PORTLET_JSR_168_NS, prefix = "portlet")},
- ignoreUnresolvedFieldOrClass = false,
- namespace = PortletMetaDataConstants.PORTLET_JSR_168_NS,
- elementFormDefault = XmlNsForm.QUALIFIED)
@XmlType(name = "portlet-appType")
-public class PortletApplication10MetaData implements PortletApplicationMetaData
+public class PortletApplication10MetaData
{
/** The portlet application id. */
private String id;
@@ -220,55 +209,4 @@
}
this.securityConstraints.add(securityConstraint);
}
-
- public String getResourceBundle()
- {
- return null;
- }
-
- public ContainerRuntimeMetaData getContainerRuntimeOption(String option)
- {
- return null;
- }
-
- public Set<String> getContainerRuntimeOptionSet()
- {
- return null;
- }
-
- public URI getDefaultNamespace()
- {
- return null;
- }
-
- public List<EventDefinitionMetaData> getEvents()
- {
- return null;
- }
-
- public FilterMetaData getFilter(String filterName)
- {
- return null;
- }
-
- public Collection<FilterMetaData> getFilterCollection()
- {
- return null;
- }
-
- public Map<String, FilterMappingMetaData> getFilterMapping()
- {
- return null;
- }
-
- public List<ListenerMetaData> getListeners()
- {
- return null;
- }
-
- public List<PublicRenderParameterMetaData> getPublicRenderParameters()
- {
- return null;
- }
-
}
Modified: modules/portlet/trunk/test/src/test/java/org/jboss/portal/portlet/test/metadata/impl/PortletApplication20MetaData.java
===================================================================
--- modules/portlet/trunk/test/src/test/java/org/jboss/portal/portlet/test/metadata/impl/PortletApplication20MetaData.java 2008-01-07 19:56:29 UTC (rev 9448)
+++ modules/portlet/trunk/test/src/test/java/org/jboss/portal/portlet/test/metadata/impl/PortletApplication20MetaData.java 2008-01-08 00:27:36 UTC (rev 9449)
@@ -31,63 +31,23 @@
import java.util.Map;
import java.util.Set;
-import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.XmlNs;
-import javax.xml.bind.annotation.XmlNsForm;
-import javax.xml.bind.annotation.XmlRootElement;
-import javax.xml.bind.annotation.XmlType;
import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
import org.jboss.portal.portlet.test.metadata.impl.adapter.ContainerRuntimeAdapter;
-import org.jboss.portal.portlet.test.metadata.impl.adapter.CustomPortletModeAdapter;
-import org.jboss.portal.portlet.test.metadata.impl.adapter.CustomWindowStateAdapter;
import org.jboss.portal.portlet.test.metadata.impl.adapter.FilterAdapter;
import org.jboss.portal.portlet.test.metadata.impl.adapter.FilterMappingAdapter;
-import org.jboss.portal.portlet.test.metadata.impl.adapter.PortletListAdapter;
-import org.jboss.portal.portlet.test.metadata.impl.adapter.UserAttributeAdapter;
import org.jboss.portal.portlet.test.metadata.impl.common.ContainerRuntimeMetaData;
import org.jboss.portal.portlet.test.metadata.impl.event.EventDefinitionMetaData;
import org.jboss.portal.portlet.test.metadata.impl.filter.FilterMappingMetaData;
import org.jboss.portal.portlet.test.metadata.impl.filter.FilterMetaData;
-import org.jboss.portal.portlet.test.metadata.impl.portlet.PortletMetaData;
-import org.jboss.portal.portlet.test.metadata.impl.security.SecurityConstraintMetaData;
-import org.jboss.xb.annotations.JBossXmlSchema;
/**
* @author <a href="mailto:emuckenh@redhat.com">Emanuel Muckenhuber</a>
* @version $Revision$
*/
-
-@XmlRootElement(name = "portlet-app")
-@JBossXmlSchema(xmlns = {@XmlNs(namespaceURI = PortletMetaDataConstants.PORTLET_JSR_286_NS, prefix = "portlet")},
- ignoreUnresolvedFieldOrClass = false,
- namespace = PortletMetaDataConstants.PORTLET_JSR_286_NS,
- elementFormDefault = XmlNsForm.QUALIFIED)
-@XmlType(name = "portlet-appType")
-public class PortletApplication20MetaData implements PortletApplicationMetaData
+public class PortletApplication20MetaData extends PortletApplication10MetaData
{
- /** The portlet application id */
- private String id;
-
- /** The portlet application version */
- private String version;
-
- /** A bunch of portlets */
- private Map<String, PortletMetaData> portlets;
-
- /** The user attributes */
- private Map<String, UserAttributeMetaData> userAttributes;
-
- /** The custom portlet mode */
- private Map<String, CustomPortletModeMetaData> customPortletModes;
-
- /** The custom window states */
- private Map<String, CustomWindowStateMetaData> customWindowStates;
-
- /** The security constraints */
- private List<SecurityConstraintMetaData> securityConstraints;
-
/** The resource bundle (JSR 286) */
private String resourceBundle;
@@ -112,143 +72,6 @@
/** The container runtime options */
private Map<String, ContainerRuntimeMetaData> containerRuntimeOptions;
- @XmlAttribute(name = "id")
- public String getId()
- {
- return id;
- }
-
- public void setId(String id)
- {
- this.id = id;
- }
-
- @XmlAttribute(name = "version")
- public String getVersion()
- {
- return version;
- }
-
- public void setVersion(String version)
- {
- this.version = version;
- }
-
- @XmlElement(name = "portlet")
- @XmlJavaTypeAdapter(PortletListAdapter.class)
- public Map<String, PortletMetaData> getPortlets()
- {
- return portlets;
- }
-
- public void setPortlets(Map<String, PortletMetaData> portlets)
- {
- this.portlets = portlets;
- }
-
- public Collection<PortletMetaData> getPortletCollection()
- {
-
- return portlets != null ? portlets.values() : null;
- }
-
- public PortletMetaData getPortlet(String portletName)
- {
- return portlets.get(portletName);
- }
-
- public void addPortlet(PortletMetaData portlet)
- {
- if(this.portlets == null)
- {
- this.portlets = new LinkedHashMap<String, PortletMetaData>();
- }
- this.portlets.put(portlet.getPortletName(), portlet);
- }
-
- @XmlElement(name = "user-attribute")
- @XmlJavaTypeAdapter(UserAttributeAdapter.class)
- public Map<String, UserAttributeMetaData> getUserAttributes()
- {
- return userAttributes;
- }
-
- public void setUserAttributes(Map<String, UserAttributeMetaData> userAttributes)
- {
- this.userAttributes = userAttributes;
- }
-
- public void addUserAttribute(UserAttributeMetaData userAttribute)
- {
- if( this.userAttributes == null )
- {
- this.userAttributes = new HashMap<String, UserAttributeMetaData>();
- }
- this.userAttributes.put(userAttribute.getName(), userAttribute);
- }
-
- @XmlElement(name = "custom-portlet-mode")
- @XmlJavaTypeAdapter(CustomPortletModeAdapter.class)
- public Map<String, CustomPortletModeMetaData> getCustomPortletModes()
- {
- return customPortletModes;
- }
-
- public void setCustomPortletModes(Map<String, CustomPortletModeMetaData> customPortletMode)
- {
- this.customPortletModes = customPortletMode;
- }
-
- public void addCustomPortletMode(CustomPortletModeMetaData portletMode)
- {
- if ( this.customPortletModes == null)
- {
- this.customPortletModes = new HashMap<String, CustomPortletModeMetaData>();
- }
- this.customPortletModes.put(portletMode.getPortletMode(), portletMode);
- }
-
- @XmlElement(name = "custom-window-state")
- @XmlJavaTypeAdapter(CustomWindowStateAdapter.class)
- public Map<String, CustomWindowStateMetaData> getCustomWindowStates()
- {
- return customWindowStates;
- }
-
- public void setCustomWindowStates(Map<String, CustomWindowStateMetaData> customWindowState)
- {
- this.customWindowStates = customWindowState;
- }
-
- public void addCustomWindowState(CustomWindowStateMetaData windowState)
- {
- if( this.customWindowStates == null )
- {
- this.customWindowStates = new HashMap<String, CustomWindowStateMetaData>();
- }
- this.customWindowStates.put(windowState.getWindowState(), windowState);
- }
-
- @XmlElement(name = "security-constraint")
- public List<SecurityConstraintMetaData> getSecurityConstraints()
- {
- return securityConstraints;
- }
-
- public void setSecurityConstraints(List<SecurityConstraintMetaData> securityConstraints)
- {
- this.securityConstraints = securityConstraints;
- }
-
- public void addSecurityConstraint(SecurityConstraintMetaData securityConstraint)
- {
- if(this.securityConstraints == null)
- {
- this.securityConstraints = new ArrayList<SecurityConstraintMetaData>();
- }
- this.securityConstraints.add(securityConstraint);
- }
-
@XmlElement(name = "resource-bundle", namespace = PortletMetaDataConstants.PORTLET_JSR_286_NS)
public String getResourceBundle()
{
Deleted: modules/portlet/trunk/test/src/test/java/org/jboss/portal/portlet/test/metadata/impl/PortletApplicationMetaData.java
===================================================================
--- modules/portlet/trunk/test/src/test/java/org/jboss/portal/portlet/test/metadata/impl/PortletApplicationMetaData.java 2008-01-07 19:56:29 UTC (rev 9448)
+++ modules/portlet/trunk/test/src/test/java/org/jboss/portal/portlet/test/metadata/impl/PortletApplicationMetaData.java 2008-01-08 00:27:36 UTC (rev 9449)
@@ -1,104 +0,0 @@
-/******************************************************************************
- * JBoss, a division of Red Hat *
- * Copyright 2006, Red Hat Middleware, LLC, and individual *
- * contributors as indicated by the @authors tag. See the *
- * copyright.txt in the distribution for a full listing of *
- * individual contributors. *
- * *
- * This is free software; you can redistribute it and/or modify it *
- * under the terms of the GNU Lesser General Public License as *
- * published by the Free Software Foundation; either version 2.1 of *
- * the License, or (at your option) any later version. *
- * *
- * This software is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
- * Lesser General Public License for more details. *
- * *
- * You should have received a copy of the GNU Lesser General Public *
- * License along with this software; if not, write to the Free *
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
- ******************************************************************************/
-package org.jboss.portal.portlet.test.metadata.impl;
-
-import java.net.URI;
-import java.util.Collection;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-import org.jboss.portal.portlet.test.metadata.impl.common.ContainerRuntimeMetaData;
-import org.jboss.portal.portlet.test.metadata.impl.event.EventDefinitionMetaData;
-import org.jboss.portal.portlet.test.metadata.impl.filter.FilterMappingMetaData;
-import org.jboss.portal.portlet.test.metadata.impl.filter.FilterMetaData;
-import org.jboss.portal.portlet.test.metadata.impl.portlet.PortletMetaData;
-import org.jboss.portal.portlet.test.metadata.impl.security.SecurityConstraintMetaData;
-
-/**
- * @author <a href="mailto:emuckenh@redhat.com">Emanuel Muckenhuber</a>
- * @version $Revision$
- */
-public interface PortletApplicationMetaData
-{
- public String getId();
-
- public void setId(String id);
-
- public String getVersion();
-
- public void setVersion(String version);
-
-
- // portlet
- public Collection<PortletMetaData> getPortletCollection();
-
- public PortletMetaData getPortlet(String portletName);
-
- public void addPortlet(PortletMetaData portlet);
-
-
- // user-attribute
- public Map<String, UserAttributeMetaData> getUserAttributes();
-
- public void addUserAttribute(UserAttributeMetaData userAttribute);
-
-
- // custom-portlet-mode
- public Map<String, CustomPortletModeMetaData> getCustomPortletModes();
-
- public void addCustomPortletMode(CustomPortletModeMetaData portletMode);
-
-
- // custom-window-state
- public Map<String, CustomWindowStateMetaData> getCustomWindowStates();
-
- public void addCustomWindowState(CustomWindowStateMetaData windowState);
-
-
- // security-constraint
- public List<SecurityConstraintMetaData> getSecurityConstraints();
-
- public void addSecurityConstraint(SecurityConstraintMetaData securityConstraint);
-
-
- public String getResourceBundle();
-
- public URI getDefaultNamespace();
-
- public Collection<FilterMetaData> getFilterCollection();
-
- public FilterMetaData getFilter(String filterName);
-
- public Map<String, FilterMappingMetaData> getFilterMapping();
-
- public List<EventDefinitionMetaData> getEvents();
-
- public List<PublicRenderParameterMetaData> getPublicRenderParameters();
-
- public Set<String> getContainerRuntimeOptionSet();
-
- public ContainerRuntimeMetaData getContainerRuntimeOption(String option);
-
- public List<ListenerMetaData> getListeners();
-}
18 years, 3 months
JBoss Portal SVN: r9448 - in modules/portlet/trunk: federation/src/main/java/org/jboss/portal/portlet/federation/impl and 22 other directories.
by portal-commits@lists.jboss.org
Author: julien(a)jboss.com
Date: 2008-01-07 14:56:29 -0500 (Mon, 07 Jan 2008)
New Revision: 9448
Removed:
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/RequestPropertiesAttributeResolver.java
Modified:
modules/portlet/trunk/federation/src/main/java/org/jboss/portal/portlet/federation/FederatingPortletInvoker.java
modules/portlet/trunk/federation/src/main/java/org/jboss/portal/portlet/federation/impl/FederatedPortletInvokerService.java
modules/portlet/trunk/federation/src/main/java/org/jboss/portal/portlet/federation/impl/FederatingPortletInvokerService.java
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/PortletCloneFailedException.java
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/PortletContext.java
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/PortletInvoker.java
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/PortletParameters.java
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/PortletParametersStateString.java
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/Properties.java
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/StateEvent.java
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/StateString.java
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/TransportGuarantee.java
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/aspects/portlet/LocalInterceptor.java
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/aspects/portlet/ModesInterceptor.java
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/aspects/portlet/WindowStatesInterceptor.java
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/container/PortletApplication.java
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/container/PortletApplicationRegistry.java
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/container/PortletContainerInvoker.java
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/container/PortletApplicationContextImpl.java
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/container/PortletApplicationRegistryImpl.java
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/PortletApplicationImpl.java
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/info/ContainerCapabilities.java
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/info/ContainerMetaInfo.java
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/info/ContainerModeInfo.java
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/info/ContainerPreferencesInfo.java
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/info/ContainerSecurityInfo.java
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/info/ContainerWindowStateInfo.java
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/info/ContentTypes.java
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/info/InfoBundle.java
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/info/Utils.java
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/metadata/PortletApplicationMetaData.java
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/spi/AbstractInstanceContext.java
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/spi/AbstractPortalContext.java
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/spi/AbstractPortletInvocationContext.java
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/spi/AbstractRenderContext.java
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/spi/AbstractUserContext.java
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/state/consumer/ConsumerPersistenceManagerService.java
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/state/producer/PortletStatePersistenceManagerService.java
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/info/CacheInfo.java
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/info/CapabilitiesInfo.java
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/info/MetaInfo.java
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/info/ModeInfo.java
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/info/PreferencesInfo.java
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/info/SecurityInfo.java
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/info/SessionInfo.java
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/info/WindowStateInfo.java
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/spi/PortalContext.java
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/spi/PortletInvocationContext.java
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/spi/RequestContext.java
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/spi/SecurityContext.java
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/spi/UserContext.java
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/state/PropertyContext.java
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/state/consumer/ConsumerPortletInvoker.java
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/state/producer/ProducerPortletInvoker.java
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/support/info/CapabilitiesInfoSupport.java
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/support/info/SecurityInfoSupport.java
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/support/spi/UserContextSupport.java
modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/state/PortletInvokerSupport.java
modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/state/TestPortletInvoker.java
modules/portlet/trunk/test/src/test/java/org/jboss/portal/portlet/test/TestInstanceContext.java
modules/portlet/trunk/test/src/test/java/org/jboss/portal/portlet/test/TestPortletInvoker.java
modules/portlet/trunk/test/src/test/java/org/jboss/portal/portlet/test/deployment/PortletApplicationMetaDataFactory.java
modules/portlet/trunk/test/src/test/java/org/jboss/portal/portlet/test/metadata/GeneralMetaDataTestCase.java
Log:
generifiying the portlet module
Modified: modules/portlet/trunk/federation/src/main/java/org/jboss/portal/portlet/federation/FederatingPortletInvoker.java
===================================================================
--- modules/portlet/trunk/federation/src/main/java/org/jboss/portal/portlet/federation/FederatingPortletInvoker.java 2008-01-07 14:38:54 UTC (rev 9447)
+++ modules/portlet/trunk/federation/src/main/java/org/jboss/portal/portlet/federation/FederatingPortletInvoker.java 2008-01-07 19:56:29 UTC (rev 9448)
@@ -58,7 +58,7 @@
*
* @return a collection that contains the portlet invokers
*/
- Collection getFederatedInvokers();
+ Collection<FederatedPortletInvoker> getFederatedInvokers();
/**
* Unregisters the invoker associated with the specified identifier.
Modified: modules/portlet/trunk/federation/src/main/java/org/jboss/portal/portlet/federation/impl/FederatedPortletInvokerService.java
===================================================================
--- modules/portlet/trunk/federation/src/main/java/org/jboss/portal/portlet/federation/impl/FederatedPortletInvokerService.java 2008-01-07 14:38:54 UTC (rev 9447)
+++ modules/portlet/trunk/federation/src/main/java/org/jboss/portal/portlet/federation/impl/FederatedPortletInvokerService.java 2008-01-07 19:56:29 UTC (rev 9448)
@@ -40,7 +40,6 @@
import java.util.ArrayList;
import java.util.Collections;
-import java.util.Iterator;
import java.util.LinkedHashSet;
import java.util.List;
import java.util.Set;
@@ -84,12 +83,11 @@
return federatingPortletInvoker;
}
- public Set getPortlets() throws PortletInvokerException
+ public Set<Portlet> getPortlets() throws PortletInvokerException
{
- Set federatedPortlets = new LinkedHashSet();
- for (Iterator i = portletInvoker.getPortlets().iterator(); i.hasNext();)
+ Set<Portlet> federatedPortlets = new LinkedHashSet<Portlet>();
+ for (Portlet portlet : portletInvoker.getPortlets())
{
- Portlet portlet = (Portlet)i.next();
Portlet federatedPortlet = new FederatedPortlet(this, reference(portlet.getContext()), portlet);
federatedPortlets.add(federatedPortlet);
}
@@ -160,7 +158,7 @@
return reference(cloneContext);
}
- public List destroyClones(List portletContexts) throws IllegalArgumentException, PortletInvokerException, UnsupportedOperationException
+ public List<DestroyCloneFailure> destroyClones(List<PortletContext> portletContexts) throws IllegalArgumentException, PortletInvokerException, UnsupportedOperationException
{
if (portletContexts == null)
{
@@ -168,23 +166,23 @@
}
if (portletContexts.size() == 0)
{
- return Collections.EMPTY_LIST;
+ return Collections.emptyList();
}
//
- List dereferencedList = new ArrayList(portletContexts);
+ List<PortletContext> dereferencedList = new ArrayList<PortletContext>(portletContexts);
for (int i = 0; i < dereferencedList.size(); i++)
{
- PortletContext compoundPortletContext = (PortletContext)dereferencedList.get(i);
+ PortletContext compoundPortletContext = dereferencedList.get(i);
PortletContext portletContext = dereference(compoundPortletContext);
dereferencedList.set(i, portletContext);
}
//
- List failures = portletInvoker.destroyClones(dereferencedList);
+ List<DestroyCloneFailure> failures = portletInvoker.destroyClones(dereferencedList);
for (int i = 0; i < failures.size(); i++)
{
- DestroyCloneFailure failure = (DestroyCloneFailure)failures.get(i);
+ DestroyCloneFailure failure = failures.get(i);
String cloneId = failure.getPortletId();
failure = new DestroyCloneFailure(reference(cloneId));
failures.set(i, failure);
@@ -200,7 +198,7 @@
return portletInvoker.getProperties(portletId);
}
- public PropertyMap getProperties(PortletContext compoundPortletContext, Set keys) throws IllegalArgumentException, PortletInvokerException, UnsupportedOperationException
+ public PropertyMap getProperties(PortletContext compoundPortletContext, Set<String> keys) throws IllegalArgumentException, PortletInvokerException, UnsupportedOperationException
{
PortletContext portletId = dereference(compoundPortletContext);
return portletInvoker.getProperties(portletId, keys);
Modified: modules/portlet/trunk/federation/src/main/java/org/jboss/portal/portlet/federation/impl/FederatingPortletInvokerService.java
===================================================================
--- modules/portlet/trunk/federation/src/main/java/org/jboss/portal/portlet/federation/impl/FederatingPortletInvokerService.java 2008-01-07 14:38:54 UTC (rev 9447)
+++ modules/portlet/trunk/federation/src/main/java/org/jboss/portal/portlet/federation/impl/FederatingPortletInvokerService.java 2008-01-07 19:56:29 UTC (rev 9448)
@@ -34,12 +34,12 @@
import org.jboss.portal.portlet.invocation.response.PortletInvocationResponse;
import org.jboss.portal.portlet.state.PropertyChange;
import org.jboss.portal.portlet.state.PropertyMap;
+import org.jboss.portal.portlet.state.DestroyCloneFailure;
import org.apache.log4j.Logger;
import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
-import java.util.Iterator;
import java.util.LinkedHashSet;
import java.util.List;
import java.util.Map;
@@ -61,7 +61,7 @@
static final String SEPARATOR = ".";
/** The registred FederatedPortletInvokers. */
- private volatile Map registry = new HashMap();
+ private volatile Map<String, FederatedPortletInvoker> registry = new HashMap<String, FederatedPortletInvoker>();
public synchronized FederatedPortletInvoker registerInvoker(String federatedId, PortletInvoker federatedInvoker)
{
@@ -77,7 +77,7 @@
{
throw new IllegalArgumentException("Attempting dual registration of " + federatedId);
}
- Map copy = new HashMap(registry);
+ Map<String, FederatedPortletInvoker> copy = new HashMap<String, FederatedPortletInvoker>(registry);
FederatedPortletInvokerService invoker = new FederatedPortletInvokerService(this, federatedId, federatedInvoker);
copy.put(federatedId, invoker);
registry = copy;
@@ -94,7 +94,7 @@
{
throw new IllegalArgumentException("Attempting to unregister unknown invoker " + federatedId);
}
- Map copy = new HashMap(registry);
+ Map<String, FederatedPortletInvoker> copy = new HashMap<String, FederatedPortletInvoker>(registry);
copy.remove(federatedId);
registry = copy;
}
@@ -105,25 +105,24 @@
{
throw new IllegalArgumentException("No null id provided");
}
- return (FederatedPortletInvoker)registry.get(federatedId);
+ return registry.get(federatedId);
}
- public Collection getFederatedInvokers()
+ public Collection<FederatedPortletInvoker> getFederatedInvokers()
{
return registry.values();
}
// PortletInvoker implementation ************************************************************************************
- public Set getPortlets() throws PortletInvokerException
+ public Set<Portlet> getPortlets() throws PortletInvokerException
{
- LinkedHashSet portlets = new LinkedHashSet();
- for (Iterator iterator = registry.values().iterator(); iterator.hasNext();)
+ LinkedHashSet<Portlet> portlets = new LinkedHashSet<Portlet>();
+ for (FederatedPortletInvoker federated : registry.values())
{
- FederatedPortletInvoker federated = (FederatedPortletInvoker)iterator.next();
try
{
- Set offeredPortlets = federated.getPortlets();
+ Set<Portlet> offeredPortlets = federated.getPortlets();
portlets.addAll(offeredPortlets);
}
catch (InvokerUnavailableException e)
@@ -156,7 +155,7 @@
return federated.createClone(compoundPortletContext);
}
- public List destroyClones(List portletContexts) throws IllegalArgumentException, PortletInvokerException, UnsupportedOperationException
+ public List<DestroyCloneFailure> destroyClones(List<PortletContext> portletContexts) throws IllegalArgumentException, PortletInvokerException, UnsupportedOperationException
{
if (portletContexts == null)
{
@@ -164,20 +163,19 @@
}
if (portletContexts.size() == 0)
{
- return Collections.EMPTY_LIST;
+ return Collections.emptyList();
}
// Get the invoker and check that we address only one invoker (for now)
FederatedPortletInvoker invoker = null;
- for (int i = 0; i < portletContexts.size(); i++)
+ for (PortletContext compoundPortletContext : portletContexts)
{
- PortletContext compoundPortletId = (PortletContext)portletContexts.get(i);
- FederatedPortletInvoker federated = getFederatedPortletInvokerFor(compoundPortletId);
+ FederatedPortletInvoker federated = getFederatedPortletInvokerFor(compoundPortletContext);
if (invoker == null)
{
invoker = federated;
}
- else if (invoker.equals(federated) == false)
+ else if (!invoker.equals(federated))
{
throw new PortletInvokerException("Cannot destroy portlet lists that requires more than one federated invoker");
}
@@ -187,7 +185,7 @@
return invoker.destroyClones(portletContexts);
}
- public PropertyMap getProperties(PortletContext compoundPortletContext, Set keys) throws PortletInvokerException
+ public PropertyMap getProperties(PortletContext compoundPortletContext, Set<String> keys) throws PortletInvokerException
{
FederatedPortletInvoker federated = getFederatedPortletInvokerFor(compoundPortletContext);
return federated.getProperties(compoundPortletContext, keys);
@@ -213,6 +211,7 @@
* @param compoundPortletContext the portlet context for which the invoker is to be retrieved
* @return the portlet invoker associated with the specified compound portlet id
* @throws IllegalArgumentException if the compound portlet id is not well formed or null
+ * @throws NoSuchPortletException if not such portlet exist
*/
private FederatedPortletInvoker getFederatedPortletInvokerFor(PortletContext compoundPortletContext) throws IllegalArgumentException, NoSuchPortletException
{
@@ -233,7 +232,7 @@
//
String invokerId = compoundPortletId.substring(0, pos);
- FederatedPortletInvoker federated = (FederatedPortletInvoker)registry.get(invokerId);
+ FederatedPortletInvoker federated = registry.get(invokerId);
if (federated == null)
{
throw new NoSuchPortletException(compoundPortletId);
Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/PortletCloneFailedException.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/PortletCloneFailedException.java 2008-01-07 14:38:54 UTC (rev 9447)
+++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/PortletCloneFailedException.java 2008-01-07 19:56:29 UTC (rev 9448)
@@ -29,6 +29,7 @@
public class PortletCloneFailedException extends PortletInvokerException
{
+ /** . */
private String portletId;
public PortletCloneFailedException(String portletId)
Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/PortletContext.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/PortletContext.java 2008-01-07 14:38:54 UTC (rev 9447)
+++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/PortletContext.java 2008-01-07 19:56:29 UTC (rev 9448)
@@ -51,14 +51,12 @@
{
return true;
}
- if (o == null || getClass() != o.getClass())
+ if (o instanceof PortletContext)
{
- return false;
+ PortletContext that = (PortletContext)o;
+ return id.equals(that.id);
}
-
- PortletContext that = (PortletContext)o;
-
- return id.equals(that.id);
+ return false;
}
public int hashCode()
Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/PortletInvoker.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/PortletInvoker.java 2008-01-07 14:38:54 UTC (rev 9447)
+++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/PortletInvoker.java 2008-01-07 19:56:29 UTC (rev 9448)
@@ -26,6 +26,7 @@
import org.jboss.portal.portlet.invocation.response.PortletInvocationResponse;
import org.jboss.portal.portlet.state.PropertyChange;
import org.jboss.portal.portlet.state.PropertyMap;
+import org.jboss.portal.portlet.state.DestroyCloneFailure;
import java.util.List;
import java.util.Set;
@@ -40,8 +41,9 @@
* Return the set of portlet exposed.
*
* @return the set of exposed portlets
+ * @throws PortletInvokerException a portlet invoker exception
*/
- Set getPortlets() throws PortletInvokerException;
+ Set<Portlet> getPortlets() throws PortletInvokerException;
/**
* Get information about a specific portlet.
@@ -49,6 +51,7 @@
* @param portletContext the portlet context in the scope of this invoker
* @return the <code>PortletInfo</code> for the specified portlet
* @throws IllegalArgumentException if the portlet context is null
+ * @throws PortletInvokerException a portlet invoker exception
*/
Portlet getPortlet(PortletContext portletContext) throws IllegalArgumentException, PortletInvokerException;
@@ -58,15 +61,18 @@
* @param invocation the portlet invocation
* @return the invocation response
* @throws IllegalArgumentException if the invocation is null
+ * @throws PortletInvokerException a portlet invoker exception
*/
PortletInvocationResponse invoke(PortletInvocation invocation) throws IllegalArgumentException, PortletInvokerException;
/**
* Clone a portlet.
*
+ * @param portletContext the portlet context to clone
* @return the clone id
* @throws IllegalArgumentException if the portletId is null
* @throws UnsupportedOperationException if the invoker does not support this operation
+ * @throws PortletInvokerException a portlet invoker exception
*/
PortletContext createClone(PortletContext portletContext) throws IllegalArgumentException, PortletInvokerException, UnsupportedOperationException;
@@ -78,8 +84,9 @@
* destroyed
* @throws IllegalArgumentException if the portletContext is null
* @throws UnsupportedOperationException if the invoker does not support this operation
+ * @throws PortletInvokerException a portlet invoker exception
*/
- List destroyClones(List portletContexts) throws IllegalArgumentException, PortletInvokerException, UnsupportedOperationException;
+ List<DestroyCloneFailure> destroyClones(List<PortletContext> portletContexts) throws IllegalArgumentException, PortletInvokerException, UnsupportedOperationException;
/**
* Return a subset of the properties of the specified portlet.
@@ -89,8 +96,9 @@
* @return the properties
* @throws IllegalArgumentException if the portletContext or the keys arguments are null
* @throws UnsupportedOperationException if the invoker does not support this operation
+ * @throws PortletInvokerException a portlet invoker exception
*/
- PropertyMap getProperties(PortletContext portletContext, Set keys) throws IllegalArgumentException, PortletInvokerException, UnsupportedOperationException;
+ PropertyMap getProperties(PortletContext portletContext, Set<String> keys) throws IllegalArgumentException, PortletInvokerException, UnsupportedOperationException;
/**
* Return all the properties of the specified portlet.
@@ -99,6 +107,7 @@
* @return the properties
* @throws IllegalArgumentException if the portletContext is null
* @throws UnsupportedOperationException if the invoker does not support this operation
+ * @throws PortletInvokerException a portlet invoker exception
*/
PropertyMap getProperties(PortletContext portletContext) throws IllegalArgumentException, PortletInvokerException, UnsupportedOperationException;
@@ -107,8 +116,10 @@
*
* @param portletContext the portlet context
* @param changes the changes
+ * @return the new portlet context
* @throws IllegalArgumentException if the portletContext or the properties is null
* @throws UnsupportedOperationException if the invoker does not support this operation
+ * @throws PortletInvokerException a portlet invoker exception
*/
PortletContext setProperties(PortletContext portletContext, PropertyChange[] changes) throws IllegalArgumentException, PortletInvokerException, UnsupportedOperationException;
}
Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/PortletParameters.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/PortletParameters.java 2008-01-07 14:38:54 UTC (rev 9447)
+++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/PortletParameters.java 2008-01-07 19:56:29 UTC (rev 9448)
@@ -50,7 +50,7 @@
/**
* Copy the parameter map to initialize the object state.
*
- * @throws IllegalArgumentException if the parameter map is null or not valid
+ * @param parameterMap the parameter map
* @throws NullPointerException if the map contains a null key or a null value
* @throws IllegalArgumentException if the map is null or it contains a value with a zero length array or a null
* element in the array
@@ -130,6 +130,9 @@
/**
* Safely wrap the map as a portlet parameters object. If the map is already a portlet parameter object, just return
* that object otherwise return a wrapper around the map.
+ *
+ * @param map the map
+ * @return the portlet parameters
*/
public static PortletParameters wrap(Map<String, String[]> map)
{
Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/PortletParametersStateString.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/PortletParametersStateString.java 2008-01-07 14:38:54 UTC (rev 9447)
+++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/PortletParametersStateString.java 2008-01-07 19:56:29 UTC (rev 9448)
@@ -31,7 +31,6 @@
import java.io.ObjectOutputStream;
import java.io.Serializable;
import java.util.HashMap;
-import java.util.Iterator;
import java.util.Map;
/**
@@ -56,6 +55,9 @@
/**
* Factory method that will create the most appropriate form.
+ *
+ * @param opaqueValue the opaque value
+ * @return a new state string
*/
public static StateString create(String opaqueValue)
{
@@ -73,7 +75,7 @@
}
}
- public static PortletParametersStateString create(Map parameterMap)
+ public static PortletParametersStateString create(Map<String, String[]> parameterMap)
{
PortletParameters params = PortletParameters.wrap(parameterMap);
return new PortletParametersStateString(params);
@@ -97,9 +99,10 @@
byte[] bytes = Base64.decode(opaqueValue, true);
ByteArrayInputStream bais = new ByteArrayInputStream(bytes);
ObjectInputStream ois = new ObjectInputStream(bais);
- Map params = new HashMap();
+ Map<String, String[]> params = new HashMap<String, String[]>();
- String[] values = null;
+ //
+ String[] values;
// read the first String which should be a param name
String current = ois.readUTF();
@@ -146,6 +149,7 @@
/**
* Copy the parameter map to initialize the object state.
*
+ * @param parameterMap the parameter map to clone
* @throws IllegalArgumentException if the parameter map is null or not valid
*/
public PortletParametersStateString(PortletParameters parameterMap)
@@ -186,9 +190,10 @@
/**
* Replace all the parameters.
*
+ * @param map the map to replace
* @throws IllegalArgumentException if the map is not valid
*/
- public void replace(Map map)
+ public void replace(Map<String, String[]> map)
{
this.parameters.replace(map);
}
@@ -198,8 +203,7 @@
*
* @param name the parameter name
* @param value the parameter value
- * @throws IllegalArgumentException if the name is null
- * @throws IllegalArgumentException if the value is null
+ * @throws IllegalArgumentException if the name or the value is null
*/
public void setValue(String name, String value)
{
@@ -221,6 +225,7 @@
/**
* Remove a parameter.
*
+ * @param name the parameter name
* @throws IllegalArgumentException if the name is null
*/
public void remove(String name)
@@ -228,7 +233,11 @@
parameters.remove(name);
}
- /** Return the size. */
+ /**
+ * Return the size.
+ *
+ * @return the size
+ */
public int getSize()
{
return parameters.size();
@@ -257,17 +266,16 @@
{
ByteArrayOutputStream baos = new ByteArrayOutputStream();
ObjectOutputStream oos = new ObjectOutputStream(baos);
- for (Iterator entries = parameters.entrySet().iterator(); entries.hasNext();)
+ for (Map.Entry entry : parameters.entrySet())
{
- Map.Entry entry = (Map.Entry)entries.next();
String name = (String)entry.getKey();
oos.writeUTF(name);
String[] values = (String[])entry.getValue();
int length = values.length;
oos.writeInt(length);
- for (int i = 0; i < values.length; i++)
+ for (String value : values)
{
- oos.writeUTF(values[i]);
+ oos.writeUTF(value);
}
}
oos.writeUTF(EOF);
Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/Properties.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/Properties.java 2008-01-07 14:38:54 UTC (rev 9447)
+++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/Properties.java 2008-01-07 19:56:29 UTC (rev 9448)
@@ -38,7 +38,7 @@
public class Properties
{
- private Map content;
+ private Map<String, ArrayList<String>> content;
public Properties()
{
@@ -61,25 +61,19 @@
}
if (content == null)
{
- content = new HashMap();
+ content = new HashMap<String, ArrayList<String>>();
}
- Object o = content.get(name);
- if (o == null)
+
+ //
+ ArrayList<String> values = content.get(name);
+ if (values == null)
{
- content.put(name, value);
- }
- else if (o instanceof String)
- {
- ArrayList values = new ArrayList();
- values.add(o);
- values.add(value);
+ values = new ArrayList<String>();
content.put(name, values);
}
- else
- {
- ArrayList values = (ArrayList)o;
- values.add(value);
- }
+
+ //
+ values.add(value);
}
/**
@@ -99,9 +93,23 @@
}
if (content == null)
{
- content = new HashMap();
+ content = new HashMap<String, ArrayList<String>>();
}
- content.put(name, value);
+
+ //
+ ArrayList<String> values = content.get(name);
+ if (values == null)
+ {
+ values = new ArrayList<String>();
+ content.put(name, values);
+ }
+ else
+ {
+ values.clear();
+ }
+
+ //
+ values.add(value);
}
/** Clear the properties. */
@@ -123,18 +131,16 @@
{
return null;
}
- Object o = content.get(name);
- if (o == null)
+
+ //
+ ArrayList<String> values = content.get(name);
+ if (values == null)
{
return null;
}
- else if (o instanceof String)
- {
- return (String)o;
- }
else
{
- return (String)((ArrayList)o).get(0);
+ return values.get(0);
}
}
@@ -143,7 +149,7 @@
* @return the list of properties for the specified name or null if it does not exist
* @throws IllegalArgumentException if name is null
*/
- public List getProperties(String name)
+ public List<String> getProperties(String name)
{
if (name == null)
{
@@ -153,26 +159,14 @@
{
return null;
}
- Object o = content.get(name);
- if (o == null)
- {
- return null;
- }
- if (o instanceof String)
- {
- return Collections.singletonList(o);
- }
- else
- {
- return (List)o;
- }
+ return content.get(name);
}
- public Set getPropertyNames()
+ public Set<String> getPropertyNames()
{
if (content == null)
{
- return Collections.EMPTY_SET;
+ return Collections.emptySet();
}
return content.keySet();
}
Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/StateEvent.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/StateEvent.java 2008-01-07 14:38:54 UTC (rev 9447)
+++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/StateEvent.java 2008-01-07 19:56:29 UTC (rev 9448)
@@ -34,15 +34,19 @@
*/
public class StateEvent
{
+
+ /** . */
private final PortletContext context;
- private final StateEventType type;
- public static final StateEventType PORTLET_CLONED_EVENT = new StateEventType("Portlet Cloned Event");
- public static final StateEventType PORTLET_MODIFIED_EVENT = new StateEventType("Portlet Modified Event");
- public StateEvent(PortletContext context, StateEventType type)
+ /** . */
+ private final Type type;
+
+ public StateEvent(PortletContext context, Type type)
{
ParameterValidation.throwIllegalArgExceptionIfNull(context, "Portlet context");
ParameterValidation.throwIllegalArgExceptionIfNull(type, "StateEvent type");
+
+ //
this.context = context;
this.type = type;
}
@@ -52,23 +56,27 @@
return context;
}
- public StateEventType getType()
+ public Type getType()
{
return type;
}
- public static final class StateEventType
+ public enum Type
{
- private String name;
- private StateEventType(String name)
+ PORTLET_CLONED_EVENT("Portlet Cloned Event"), PORTLET_MODIFIED_EVENT("Portlet Modified Event");
+
+ /** . */
+ private final String description;
+
+ private Type(String description)
{
- this.name = name;
+ this.description = description;
}
public String toString()
{
- return name;
+ return description;
}
}
}
Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/StateString.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/StateString.java 2008-01-07 14:38:54 UTC (rev 9447)
+++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/StateString.java 2008-01-07 19:56:29 UTC (rev 9448)
@@ -32,7 +32,11 @@
*/
public abstract class StateString implements Serializable
{
- /** Return the value of the navigational state of the portlet. */
+ /**
+ * Return the value of the navigational state of the portlet.
+ *
+ * @return the string value
+ */
public abstract String getStringValue();
public static StateString createFrom(String opaqueValue)
Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/TransportGuarantee.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/TransportGuarantee.java 2008-01-07 14:38:54 UTC (rev 9447)
+++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/TransportGuarantee.java 2008-01-07 19:56:29 UTC (rev 9448)
@@ -28,92 +28,7 @@
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
* @version $Revision: 5448 $
*/
-public class TransportGuarantee
+public enum TransportGuarantee
{
- /**
- *
- */
- public static final TransportGuarantee NONE = new TransportGuarantee(0);
-
- /**
- *
- */
- public static final TransportGuarantee INTEGRAL = new TransportGuarantee(1);
-
- /**
- *
- */
- public static final TransportGuarantee CONFIDENTIAL = new TransportGuarantee(2);
-
- /**
- *
- */
- private static final TransportGuarantee[] ALL = {NONE, INTEGRAL, CONFIDENTIAL};
-
- /**
- *
- */
-// private static final boolean[][] IMPLIES =
-// {
-// { true, false, false },
-// { true, true, true },
-// { true, true, true }
-// };
-
- /**
- *
- */
- private static final String[] NAMES = {"NONE", "INTEGRAL", "CONFIDENTIAL"};
-
- public static TransportGuarantee decode(String name)
- {
- for (int i = 0; i < NAMES.length; i++)
- {
- if (NAMES[i].equals(name))
- {
- return ALL[i];
- }
- }
- throw new IllegalArgumentException();
- }
-
- private int ordinal;
-
- private TransportGuarantee(int ordinal)
- {
- this.ordinal = ordinal;
- }
-
- public String getName()
- {
- return NAMES[ordinal];
- }
-
-// public boolean implies(TransportGuarantee that)
-// {
-// if (that == null)
-// {
-// throw new IllegalArgumentException();
-// }
-// return IMPLIES[this.ordinal][that.ordinal];
-// }
-
- public int hashCode()
- {
- return ordinal;
- }
-
- public boolean equals(Object obj)
- {
- if (obj == this)
- {
- return true;
- }
- if (obj instanceof TransportGuarantee)
- {
- TransportGuarantee that = (TransportGuarantee)obj;
- return this.ordinal == that.ordinal;
- }
- return false;
- }
+ NONE, INTEGRAL, CONFIDENTIAL
}
Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/aspects/portlet/LocalInterceptor.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/aspects/portlet/LocalInterceptor.java 2008-01-07 14:38:54 UTC (rev 9447)
+++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/aspects/portlet/LocalInterceptor.java 2008-01-07 19:56:29 UTC (rev 9448)
@@ -36,7 +36,7 @@
{
/** . */
- private static final ThreadLocal local = new ThreadLocal();
+ private static final ThreadLocal<Boolean> local = new ThreadLocal<Boolean>();
public static boolean isLocal()
{
Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/aspects/portlet/ModesInterceptor.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/aspects/portlet/ModesInterceptor.java 2008-01-07 14:38:54 UTC (rev 9447)
+++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/aspects/portlet/ModesInterceptor.java 2008-01-07 19:56:29 UTC (rev 9448)
@@ -31,6 +31,7 @@
import org.jboss.portal.portlet.container.PortletContainerInvoker;
import org.jboss.portal.portlet.container.PortletContainer;
import org.jboss.portal.common.util.ContentInfo;
+import org.jboss.portal.Mode;
import java.util.HashSet;
import java.util.Iterator;
@@ -63,7 +64,7 @@
}
/** Compute the supported modes for this invocation. */
- protected Set getModes(PortletInvocation invocation)
+ protected Set<Mode> getModes(PortletInvocation invocation)
{
// Get content type
ContentInfo si = invocation.getPortletContext().getMarkupInfo();
@@ -75,15 +76,14 @@
CapabilitiesInfo capabilities = containerInfo.getCapabilities();
// Add all the modes
- Set modes = new HashSet();
- for (Iterator i = capabilities.getModes(contentType).iterator(); i.hasNext();)
+ Set<Mode> modes = new HashSet<Mode>();
+ for (ModeInfo modeInfo : capabilities.getModes(contentType))
{
- ModeInfo modeInfo = (ModeInfo)i.next();
modes.add(modeInfo.getMode());
}
// Restrict with what the portal can provide
- Set portalModes = invocation.getPortalContext().getModes();
+ Set<Mode> portalModes = invocation.getPortalContext().getModes();
modes.retainAll(portalModes);
// If user is not logged in then remove the edit mode
Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/aspects/portlet/WindowStatesInterceptor.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/aspects/portlet/WindowStatesInterceptor.java 2008-01-07 14:38:54 UTC (rev 9447)
+++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/aspects/portlet/WindowStatesInterceptor.java 2008-01-07 19:56:29 UTC (rev 9448)
@@ -25,6 +25,7 @@
import org.jboss.portal.common.invocation.InvocationException;
import org.jboss.portal.portlet.invocation.PortletInterceptor;
import org.jboss.portal.portlet.invocation.PortletInvocation;
+import org.jboss.portal.WindowState;
import java.util.HashSet;
import java.util.Set;
@@ -55,9 +56,14 @@
return invocation.invokeNext();
}
- /** Compute the supported window states for this invocation. */
- protected Set getWindowStates(PortletInvocation invocation) throws InvocationException
+ /**
+ * Compute the supported window states for this invocation.
+ *
+ * @param invocation the invocation
+ * @return the set of window states
+ */
+ protected Set<WindowState> getWindowStates(PortletInvocation invocation)
{
- return new HashSet(invocation.getPortalContext().getWindowStates());
+ return new HashSet<WindowState>(invocation.getPortalContext().getWindowStates());
}
}
Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/container/PortletApplication.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/container/PortletApplication.java 2008-01-07 14:38:54 UTC (rev 9447)
+++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/container/PortletApplication.java 2008-01-07 19:56:29 UTC (rev 9448)
@@ -32,16 +32,32 @@
*/
public interface PortletApplication
{
- /** Return the web app id. */
+ /**
+ * Return the web app id.
+ *
+ * @return the id
+ */
String getId();
- /** Return the set of components part of this web application. */
- Set getPortletContainers();
+ /**
+ * Return the set of components part of this web application.
+ *
+ * @return the set of portlet containers
+ */
+ Set<PortletContainer> getPortletContainers();
- /** Return a specific component. */
+ /**
+ * Return a specific portlet container.
+ *
+ * @return a portlet container
+ */
PortletContainer getPortletContainer(String id);
- /** Return the porlet application context. */
+ /**
+ * Return the porlet application context.
+ *
+ * @return the context
+ */
PortletApplicationContext getContext();
void addContainer(PortletContainer container);
Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/container/PortletApplicationRegistry.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/container/PortletApplicationRegistry.java 2008-01-07 14:38:54 UTC (rev 9447)
+++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/container/PortletApplicationRegistry.java 2008-01-07 19:56:29 UTC (rev 9448)
@@ -48,7 +48,7 @@
void unregisterPortletApplication(PortletApplication portletApplication) throws IllegalArgumentException;
/** Return an immutable list all the known portlet application in the registry. */
- Collection getPortletApplications();
+ Collection<PortletApplication> getPortletApplications();
/** Return a portlet app using its id or null if it does not exist. */
PortletApplication getPortletApplication(String id);
Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/container/PortletContainerInvoker.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/container/PortletContainerInvoker.java 2008-01-07 14:38:54 UTC (rev 9447)
+++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/container/PortletContainerInvoker.java 2008-01-07 19:56:29 UTC (rev 9448)
@@ -40,10 +40,10 @@
import org.jboss.portal.portlet.state.PropertyChange;
import org.jboss.portal.portlet.state.PropertyMap;
import org.jboss.portal.portlet.state.SimplePropertyMap;
+import org.jboss.portal.portlet.state.DestroyCloneFailure;
import java.util.HashMap;
import java.util.HashSet;
-import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Set;
@@ -67,7 +67,7 @@
private InterceptorStackFactory stackFactory;
/** . */
- private Map portlets;
+ private Map<String, Portlet> portlets;
/** . */
private InvocationHandler handler = new InvocationHandler()
@@ -114,7 +114,7 @@
public synchronized void portletContainerRegistered(PortletContainer portletContainer)
{
- Map portlets = new HashMap(this.portlets);
+ Map<String, Portlet> portlets = new HashMap<String, Portlet>(this.portlets);
PortletImpl portlet = new PortletImpl(portletContainer);
portlets.put(portlet.getContext().getId(), portlet);
@@ -124,7 +124,7 @@
public synchronized void portletContainerUnregistered(PortletContainer portletContainer)
{
- Map portlets = new HashMap(this.portlets);
+ Map<String, Portlet> portlets = new HashMap<String, Portlet>(this.portlets);
PortletImpl portlet = new PortletImpl(portletContainer);
portlets.remove(portlet.getContext().getId());
@@ -134,13 +134,11 @@
public synchronized void start() throws Exception
{
- Map portlets = new HashMap();
- for (Iterator i = registry.getPortletApplications().iterator(); i.hasNext();)
+ Map<String, Portlet> portlets = new HashMap<String, Portlet>();
+ for (PortletApplication portletApplication : registry.getPortletApplications())
{
- PortletApplication portletApplication = (PortletApplication)i.next();
- for (Iterator j = portletApplication.getPortletContainers().iterator(); j.hasNext();)
+ for (PortletContainer portletContainer : portletApplication.getPortletContainers())
{
- PortletContainer portletContainer = (PortletContainer)j.next();
PortletImpl portlet = new PortletImpl(portletContainer);
portlets.put(portlet.getContext().getId(), portlet);
}
@@ -158,12 +156,12 @@
registry.removeListener(this);
//
- portlets = new HashMap();
+ portlets = new HashMap<String, Portlet>();
}
- public Set getPortlets()
+ public Set<Portlet> getPortlets()
{
- return new HashSet(portlets.values());
+ return new HashSet<Portlet>(portlets.values());
}
public Portlet getPortlet(PortletContext portletContext) throws IllegalArgumentException, PortletInvokerException
@@ -219,7 +217,7 @@
}
}
- public PropertyMap getProperties(PortletContext portletContext, Set keys) throws IllegalArgumentException, PortletInvokerException, UnsupportedOperationException
+ public PropertyMap getProperties(PortletContext portletContext, Set<String> keys) throws IllegalArgumentException, PortletInvokerException, UnsupportedOperationException
{
PortletImpl portlet = (PortletImpl)portlets.get(portletContext.getId());
if (portlet == null)
@@ -229,9 +227,8 @@
ContainerPortletInfo info = (ContainerPortletInfo)portlet.getInfo();
ContainerPreferencesInfo prefs = (ContainerPreferencesInfo)info.getPreferences();
PropertyMap result = new SimplePropertyMap();
- for (Iterator i = keys.iterator();i.hasNext();)
+ for (String key : keys)
{
- String key = (String)i.next();
ContainerPreferenceInfo pref = prefs.getContainerPreference(key);
if (pref != null)
{
@@ -251,9 +248,8 @@
ContainerPortletInfo info = (ContainerPortletInfo)portlet.getInfo();
ContainerPreferencesInfo prefs = (ContainerPreferencesInfo)info.getPreferences();
PropertyMap result = new SimplePropertyMap();
- for (Iterator i = prefs.getKeys().iterator();i.hasNext();)
+ for (String key : prefs.getKeys())
{
- String key = (String)i.next();
ContainerPreferenceInfo pref = prefs.getContainerPreference(key);
if (pref != null)
{
@@ -268,7 +264,7 @@
throw new UnsupportedOperationException();
}
- public List destroyClones(List portletContexts) throws IllegalArgumentException, PortletInvokerException, UnsupportedOperationException
+ public List<DestroyCloneFailure> destroyClones(List<PortletContext> portletContexts) throws IllegalArgumentException, PortletInvokerException, UnsupportedOperationException
{
throw new UnsupportedOperationException();
}
Deleted: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/RequestPropertiesAttributeResolver.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/RequestPropertiesAttributeResolver.java 2008-01-07 14:38:54 UTC (rev 9447)
+++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/RequestPropertiesAttributeResolver.java 2008-01-07 19:56:29 UTC (rev 9448)
@@ -1,30 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2005, JBoss Inc., 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.portlet.impl;
-
-/**
- * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 1.1 $
- */
-public class RequestPropertiesAttributeResolver
-{
-}
Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/container/PortletApplicationContextImpl.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/container/PortletApplicationContextImpl.java 2008-01-07 14:38:54 UTC (rev 9447)
+++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/container/PortletApplicationContextImpl.java 2008-01-07 19:56:29 UTC (rev 9448)
@@ -36,7 +36,6 @@
import org.jboss.portal.portlet.metadata.JBossPortletMetaData;
import javax.servlet.ServletContext;
-import java.util.Iterator;
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
@@ -111,11 +110,8 @@
registrationContext = registry.registerPortletApplication(portletApp);
//
- for (Iterator i = portletAppMD.getPortlets().iterator(); i.hasNext();)
+ for (PortletMetaData portletMD : portletAppMD.getPortlets())
{
- PortletMetaData portletMD = (PortletMetaData)i.next();
-
- //
JBossPortletMetaData jBossPortletMD = null;
if (jbossAppMD != null)
{
@@ -147,9 +143,8 @@
// if the portlet application wasn't properly started, we shouldn't be trying to stop it
if (portletApp != null)
{
- for (Iterator i = portletApp.getPortletContainers().iterator(); i.hasNext();)
+ for (PortletContainer container : portletApp.getPortletContainers())
{
- PortletContainerImpl container = (PortletContainerImpl)i.next();
try
{
registrationContext.unregisterPortlet(container);
Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/container/PortletApplicationRegistryImpl.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/container/PortletApplicationRegistryImpl.java 2008-01-07 14:38:54 UTC (rev 9447)
+++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/container/PortletApplicationRegistryImpl.java 2008-01-07 19:56:29 UTC (rev 9448)
@@ -32,7 +32,6 @@
import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
-import java.util.Iterator;
import java.util.List;
import java.util.Map;
@@ -45,13 +44,13 @@
{
/** . */
- private Map portletApplications = new HashMap();
+ private Map<String, PortletApplication> portletApplications = new HashMap<String, PortletApplication>();
/** . */
- private Map portletContainers = new HashMap();
+ private Map<ContainerKey, PortletContainer> portletContainers = new HashMap<ContainerKey, PortletContainer>();
/** . */
- private List listeners = new ArrayList();
+ private List<PortletApplicationRegistryListener> listeners = new ArrayList<PortletApplicationRegistryListener>();
public PortletApplicationRegistrationContext registerPortletApplication(PortletApplication portletApplication)
{
@@ -67,7 +66,7 @@
throw new IllegalArgumentException("This portlet app is already registered: " + key);
}
PortletApplicationRegistrationContext ctx = new PortletApplicationRegistrationContextImpl(portletApplication);
- Map webAppsCopy = new HashMap(portletApplications);
+ Map<String, PortletApplication> webAppsCopy = new HashMap<String, PortletApplication>(portletApplications);
webAppsCopy.put(key, portletApplication);
portletApplications = webAppsCopy;
return ctx;
@@ -87,20 +86,20 @@
{
throw new IllegalArgumentException("This portlet app does not exist here: " + key);
}
- Map webAppsCopy = new HashMap(portletApplications);
+ Map<String, PortletApplication> webAppsCopy = new HashMap<String, PortletApplication>(portletApplications);
webAppsCopy.remove(key);
portletApplications = webAppsCopy;
}
}
- public Collection getPortletApplications()
+ public Collection<PortletApplication> getPortletApplications()
{
return Collections.unmodifiableCollection(portletApplications.values());
}
public PortletApplication getPortletApplication(String id)
{
- return (PortletApplication)portletApplications.get(id);
+ return portletApplications.get(id);
}
public void addListener(PortletApplicationRegistryListener listener)
@@ -133,22 +132,18 @@
}
}
- private void raiseRegisterPortletContainerEvent(PortletContainer portlet)
+ private void fireRegisterPortletContainerEvent(PortletContainer portlet)
{
- Iterator it = listeners.iterator();
- while (it.hasNext())
+ for (PortletApplicationRegistryListener listener : listeners)
{
- PortletApplicationRegistryListener listener = (PortletApplicationRegistryListener)it.next();
listener.portletContainerRegistered(portlet);
}
}
- private void raiseUnregisterPortletContainerEvent(PortletContainer portlet)
+ private void fireUnregisterPortletContainerEvent(PortletContainer portlet)
{
- Iterator it = listeners.iterator();
- while (it.hasNext())
+ for (PortletApplicationRegistryListener listener : listeners)
{
- PortletApplicationRegistryListener listener = (PortletApplicationRegistryListener)it.next();
listener.portletContainerUnregistered(portlet);
}
}
@@ -218,12 +213,12 @@
}
synchronized (this)
{
- Map componentsCopy = new HashMap(portletContainers);
+ Map<ContainerKey, PortletContainer> componentsCopy = new HashMap<ContainerKey, PortletContainer>(portletContainers);
componentsCopy.put(new ContainerKey(portletContainer), portletContainer);
portletContainers = componentsCopy;
//
- raiseRegisterPortletContainerEvent(portletContainer);
+ fireRegisterPortletContainerEvent(portletContainer);
}
}
@@ -243,13 +238,12 @@
}
synchronized (this)
{
- Map componentsCopy = new HashMap(portletContainers);
- componentsCopy.remove(portletContainer);
+ Map<ContainerKey, PortletContainer> componentsCopy = new HashMap<ContainerKey, PortletContainer>(portletContainers);
+ ContainerKey key = new ContainerKey(portletContainer);
+ componentsCopy.remove(key);
portletContainers = componentsCopy;
- raiseUnregisterPortletContainerEvent(portletContainer);
+ fireUnregisterPortletContainerEvent(portletContainer);
}
}
-
}
-
}
Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/PortletApplicationImpl.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/PortletApplicationImpl.java 2008-01-07 14:38:54 UTC (rev 9447)
+++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/PortletApplicationImpl.java 2008-01-07 19:56:29 UTC (rev 9448)
@@ -60,7 +60,7 @@
protected final PortletInfoFactory portletInfoFactory;
/** . */
- protected LinkedHashMap portlets;
+ protected LinkedHashMap<String, PortletContainer> portlets;
/** . */
protected PortletContext portletContext;
@@ -85,7 +85,7 @@
this.jbossMetaData = jbossMetaData;
this.portletAPIFactory = portletAPIFactory;
this.portletInfoFactory = portletInfoFactory;
- this.portlets = new LinkedHashMap();
+ this.portlets = new LinkedHashMap<String, PortletContainer>();
this.context = context;
}
@@ -164,14 +164,14 @@
// WebApp implementation ********************************************************************************************
- public Set getPortletContainers()
+ public Set<PortletContainer> getPortletContainers()
{
- return new HashSet(portlets.values());
+ return new HashSet<PortletContainer>(portlets.values());
}
public PortletContainer getPortletContainer(String name)
{
- return (PortletContainer)portlets.get(name);
+ return portlets.get(name);
}
public PortletApplicationContext getContext()
Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/info/ContainerCapabilities.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/info/ContainerCapabilities.java 2008-01-07 14:38:54 UTC (rev 9447)
+++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/info/ContainerCapabilities.java 2008-01-07 19:56:29 UTC (rev 9448)
@@ -25,11 +25,12 @@
import org.jboss.portal.Mode;
import org.jboss.portal.WindowState;
import org.jboss.portal.portlet.info.CapabilitiesInfo;
+import org.jboss.portal.portlet.info.WindowStateInfo;
+import org.jboss.portal.portlet.info.ModeInfo;
import org.jboss.portal.portlet.impl.jsr168.metadata.PortletMetaData;
import java.util.Collections;
import java.util.HashSet;
-import java.util.Iterator;
import java.util.Set;
import java.util.Locale;
@@ -40,18 +41,21 @@
*/
public class ContainerCapabilities implements CapabilitiesInfo
{
- private static Set WINDOW_STATES = new HashSet(3);
+ /** . */
+ private static Set<WindowStateInfo> WINDOW_STATES;
+
static
{
- WINDOW_STATES.add(new ContainerWindowStateInfo(WindowState.MAXIMIZED));
- WINDOW_STATES.add(new ContainerWindowStateInfo(WindowState.MINIMIZED));
- WINDOW_STATES.add(new ContainerWindowStateInfo(WindowState.NORMAL));
- WINDOW_STATES = Collections.unmodifiableSet(WINDOW_STATES);
+ Set<WindowStateInfo> tmp = new HashSet<WindowStateInfo>();
+ tmp.add(new ContainerWindowStateInfo(WindowState.MAXIMIZED));
+ tmp.add(new ContainerWindowStateInfo(WindowState.MINIMIZED));
+ tmp.add(new ContainerWindowStateInfo(WindowState.NORMAL));
+ WINDOW_STATES = Collections.unmodifiableSet(tmp);
}
/** . */
- private Set supportedLocales;
+ private Set<Locale> supportedLocales;
/** . */
private ContentTypes contentTypes;
@@ -64,7 +68,7 @@
// Add Locale.ENGLISH to supported locales if no locales was provided
// todo: should we always include it (i.e. even when other locales are present)?
- HashSet supportedLocales = new HashSet(portletMD.getLanguages().getSupportedLocales());
+ HashSet<Locale> supportedLocales = new HashSet<Locale>(portletMD.getLanguages().getSupportedLocales());
if (supportedLocales.isEmpty())
{
supportedLocales.add(Locale.ENGLISH);
@@ -75,51 +79,51 @@
this.contentTypes = contentTypes;
}
- public Set getMimeTypes()
+ public Set<String> getMimeTypes()
{
- return new HashSet(contentTypes.getAllContentTypes());
+ return new HashSet<String>(contentTypes.getAllContentTypes());
}
- public Set getAllModes()
+ public Set<ModeInfo> getAllModes()
{
- Set infos = new HashSet();
- for (Iterator i = contentTypes.getAllModes().iterator(); i.hasNext();)
+ Set<ModeInfo> infos = new HashSet<ModeInfo>();
+ for (Mode mode : contentTypes.getAllModes())
{
- infos.add(new ContainerModeInfo((Mode)i.next()));
+ infos.add(new ContainerModeInfo(mode));
}
return infos;
}
- public Set getModes(String mimeType)
+ public Set<ModeInfo> getModes(String mimeType)
{
- Set infos = new HashSet();
- for (Iterator i = contentTypes.getSupportedModes(mimeType).iterator(); i.hasNext();)
+ Set<ModeInfo> infos = new HashSet<ModeInfo>();
+ for (Mode mode : contentTypes.getSupportedModes(mimeType))
{
- infos.add(new ContainerModeInfo((Mode)i.next()));
+ infos.add(new ContainerModeInfo(mode));
}
return infos;
}
- public Set getAllWindowStates()
+ public Set<WindowStateInfo> getAllWindowStates()
{
return WINDOW_STATES;
}
- public Set getWindowStates(String mimeType)
+ public Set<WindowStateInfo> getWindowStates(String mimeType)
{
if (contentTypes.isContentTypeSupported(mimeType))
{
return getAllWindowStates();
}
- return Collections.EMPTY_SET;
+ return Collections.emptySet();
}
- public Set getAllLocales()
+ public Set<Locale> getAllLocales()
{
return supportedLocales;
}
- public Set getLocales(String mimeType)
+ public Set<Locale> getLocales(String mimeType)
{
return getAllLocales();
}
Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/info/ContainerMetaInfo.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/info/ContainerMetaInfo.java 2008-01-07 14:38:54 UTC (rev 9447)
+++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/info/ContainerMetaInfo.java 2008-01-07 19:56:29 UTC (rev 9448)
@@ -28,7 +28,6 @@
import org.jboss.portal.portlet.info.MetaInfo;
import java.util.HashMap;
-import java.util.Iterator;
import java.util.List;
import java.util.Locale;
import java.util.Map;
@@ -43,14 +42,14 @@
public class ContainerMetaInfo implements MetaInfo
{
- private Map values;
+ private Map<String, LocalizedString> values;
private static final String JAVAX_PORTLET = "javax.portlet.";
private static final String[] KEYS = {TITLE, SHORT_TITLE, KEYWORDS};
private static final String[] BUNDLE_KEYS = {JAVAX_PORTLET + TITLE, JAVAX_PORTLET + SHORT_TITLE, JAVAX_PORTLET + KEYWORDS};
public ContainerMetaInfo(PortletMetaData metadata, ResourceBundleManager rb)
{
- this.values = new HashMap();
+ this.values = new HashMap<String, LocalizedString>();
// Construct info from resource bundle manager
if (rb != null)
@@ -58,15 +57,14 @@
for (int i = 0; i < KEYS.length; i++)
{
String key = KEYS[i];
- Map tmp = new HashMap();
- List locales = metadata.getLanguages().getSupportedLocales();
+ Map<Locale, String> tmp = new HashMap<Locale, String>();
+ List<Locale> locales = (List<Locale>)metadata.getLanguages().getSupportedLocales();
// Add english locale
locales.add(Locale.ENGLISH);
- for (Iterator j = locales.iterator(); j.hasNext();)
+ for (Locale locale : locales)
{
- Locale locale = (Locale)j.next();
ResourceBundle bundle = rb.getResourceBundle(locale);
try
{
Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/info/ContainerModeInfo.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/info/ContainerModeInfo.java 2008-01-07 14:38:54 UTC (rev 9447)
+++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/info/ContainerModeInfo.java 2008-01-07 19:56:29 UTC (rev 9448)
@@ -65,15 +65,13 @@
{
return true;
}
- if (o == null || getClass() != o.getClass())
+ if (o instanceof ContainerModeInfo)
{
- return false;
+ ContainerModeInfo that = (ContainerModeInfo)o;
+ return mode.equals(that.mode);
}
+ return false;
- final ContainerModeInfo modeInfo = (ContainerModeInfo)o;
-
- return mode.equals(modeInfo.mode);
-
}
public int hashCode()
Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/info/ContainerPreferencesInfo.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/info/ContainerPreferencesInfo.java 2008-01-07 14:38:54 UTC (rev 9447)
+++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/info/ContainerPreferencesInfo.java 2008-01-07 19:56:29 UTC (rev 9448)
@@ -46,17 +46,16 @@
{
/** The cached container preference info. */
- private Map content;
+ private final Map<String, PreferenceInfo> content;
public ContainerPreferencesInfo()
{
- content = new HashMap();
+ content = Collections.emptyMap();
}
public ContainerPreferencesInfo(PortletMetaData portletMD, ResourceBundleManager bundleMgr)
{
- content = new HashMap();
-
+ Map<String, PreferenceInfo> content = new HashMap<String, PreferenceInfo>();
for (Iterator i = portletMD.getPreferences().iterator(); i.hasNext();)
{
PreferenceMetaData prefMD = (PreferenceMetaData)i.next();
@@ -66,6 +65,9 @@
ContainerPreferenceInfo pref = new ContainerPreferenceInfo(prefMD.getName(), displayName, description, prefMD.isReadOnly(), value);
content.put(pref.getKey(), pref);
}
+
+ //
+ this.content = Collections.unmodifiableMap(content);
}
public ContainerPreferenceInfo getContainerPreference(String key)
@@ -77,9 +79,9 @@
return (ContainerPreferenceInfo)content.get(key);
}
- public Set getKeys()
+ public Set<String> getKeys()
{
- return Collections.unmodifiableSet(content.keySet());
+ return content.keySet();
}
public PreferenceInfo getPreference(String key)
Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/info/ContainerSecurityInfo.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/info/ContainerSecurityInfo.java 2008-01-07 14:38:54 UTC (rev 9447)
+++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/info/ContainerSecurityInfo.java 2008-01-07 19:56:29 UTC (rev 9448)
@@ -40,11 +40,11 @@
{
/** . */
- private Set tgs;
+ private Set<TransportGuarantee> tgs;
public ContainerSecurityInfo(PortletMetaData portletMD)
{
- tgs = new HashSet();
+ tgs = new HashSet<TransportGuarantee>();
tgs.add(TransportGuarantee.NONE);
//
Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/info/ContainerWindowStateInfo.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/info/ContainerWindowStateInfo.java 2008-01-07 14:38:54 UTC (rev 9447)
+++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/info/ContainerWindowStateInfo.java 2008-01-07 19:56:29 UTC (rev 9448)
@@ -65,15 +65,12 @@
{
return true;
}
- if (o == null || getClass() != o.getClass())
+ if (o instanceof ContainerWindowStateInfo)
{
- return false;
+ ContainerWindowStateInfo that = (ContainerWindowStateInfo)o;
+ return windowState.equals(that.windowState);
}
-
- final ContainerWindowStateInfo that = (ContainerWindowStateInfo)o;
-
- return windowState.equals(that.windowState);
-
+ return false;
}
public int hashCode()
Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/info/ContentTypes.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/info/ContentTypes.java 2008-01-07 14:38:54 UTC (rev 9447)
+++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/info/ContentTypes.java 2008-01-07 19:56:29 UTC (rev 9448)
@@ -46,11 +46,12 @@
public class ContentTypes
{
/** Maps MIME Type (String) -> Modes (Set), excluding multiple MIME Types ("*", "* / *", "type / *"). */
- protected final Map singleTypeToPortletModes;
+ protected final Map<String, Set<Mode>> singleTypeToPortletModes;
+
/** Maps MIME Type (String) -> Modes (Set), including multiple MIME Types ("*", "* / *", "type / *"). */
- protected final Map allTypeToPortletModes;
+ protected final Map<String, Set<Mode>> allTypeToPortletModes;
- protected final Set allModes;
+ protected final Set<Mode> allModes;
protected ContentTypesMetaData metadata;
protected boolean isStarted = false;
@@ -66,9 +67,9 @@
public ContentTypes()
{
- singleTypeToPortletModes = new HashMap();
- allTypeToPortletModes = new HashMap(); // Including *
- allModes = new HashSet();
+ singleTypeToPortletModes = new HashMap<String, Set<Mode>>();
+ allTypeToPortletModes = new HashMap<String, Set<Mode>>(); // Including *
+ allModes = new HashSet<Mode>();
metadata = null;
}
@@ -92,7 +93,7 @@
/**
* Process all the supported content types.
*
- * @param metadata
+ * @param metadata the meta data
*/
private void initFromMetadata(ContentTypesMetaData metadata)
{
@@ -121,10 +122,9 @@
add(contentType, Mode.VIEW);
// Then process each mode
- Set modes = contentTypeMD.getModes();
- for (Iterator j = modes.iterator(); j.hasNext();)
+ Set<Mode> modes = contentTypeMD.getModes();
+ for (Mode mode : modes)
{
- Mode mode = (Mode)j.next();
add(contentType, mode);
}
}
@@ -176,25 +176,33 @@
allModes.add(mode);
}
- private void addMode(Map map, String key, Mode mode)
+ private void addMode(Map<String, Set<Mode>> map, String key, Mode mode)
{
- Set modes = (Set)map.get(key);
+ Set<Mode> modes = map.get(key);
if (modes == null)
{
- modes = new HashSet();
+ modes = new HashSet<Mode>();
map.put(key, modes);
}
modes.add(mode);
}
- /** Return all modes. */
- public Collection getAllModes()
+ /**
+ * Return all modes.
+ *
+ * @return all modes
+ */
+ public Collection<Mode> getAllModes()
{
return Collections.unmodifiableCollection(allModes);
}
- /** Return all content types. */
- public Collection getAllContentTypes()
+ /**
+ * Return all content types.
+ *
+ * @return all content types
+ */
+ public Collection<String> getAllContentTypes()
{
return Collections.unmodifiableCollection(allTypeToPortletModes.keySet());
}
@@ -202,6 +210,8 @@
/**
* Return true if the mode is supported
*
+ * @param mode the mode to check
+ * @return true if the mode is supported
* @throws IllegalArgumentException if the mode is null
*/
public boolean isModeSupported(Mode mode)
@@ -216,9 +226,11 @@
/**
* Return all the supported modes for this content type.
*
+ * @param contentType the content type to check
* @throws IllegalArgumentException if the content type is null
+ * @return the set of modes matching the content types support
*/
- public Set getSupportedModes(String contentType)
+ public Set<Mode> getSupportedModes(String contentType)
{
if (contentType == null)
{
@@ -229,27 +241,27 @@
if (index == -1)
{
// Not valid content type so return empty set
- return Collections.EMPTY_SET;
+ return Collections.emptySet();
}
//
- Set set = new HashSet();
+ Set<Mode> set = new HashSet<Mode>();
//
- Set contentTypeModes = (Set)singleTypeToPortletModes.get(contentType.toLowerCase());
+ Set<Mode> contentTypeModes = singleTypeToPortletModes.get(contentType.toLowerCase());
if (contentTypeModes != null)
{
set.addAll(contentTypeModes);
}
//
- Set typeModes = (Set)allTypeToPortletModes.get(contentType.substring(0, index).toLowerCase());
+ Set<Mode> typeModes = allTypeToPortletModes.get(contentType.substring(0, index).toLowerCase());
if (typeModes != null)
{
set.addAll(typeModes);
}
- Set wildcardModes = (Set)allTypeToPortletModes.get(ALL);
+ Set<Mode> wildcardModes = allTypeToPortletModes.get(ALL);
if (wildcardModes != null)
{
set.addAll(wildcardModes);
@@ -261,6 +273,8 @@
/**
* Return true if the content type is supported.
*
+ * @param contentType the content type
+ * @return true is it is supported
* @throws IllegalArgumentException if the content type is null
*/
public boolean isContentTypeSupported(String contentType)
@@ -295,6 +309,9 @@
/**
* Return true if the given content type is supported for the given mode.
*
+ * @param mode the mode to check
+ * @param contentType the content type to check
+ * @return true if is it supported
* @throws IllegalArgumentException if the content type or the mode is null
*/
public boolean isSupported(Mode mode, String contentType)
@@ -316,14 +333,14 @@
}
// Try full name matching
- Set contentTypeModes = (Set)singleTypeToPortletModes.get(contentType);
+ Set<Mode> contentTypeModes = singleTypeToPortletModes.get(contentType);
if (contentTypeModes != null && contentTypeModes.contains(mode))
{
return true;
}
// Try full name lowercase matching
- Set lowercaseContentTypeModes = (Set)singleTypeToPortletModes.get(contentType.toLowerCase());
+ Set<Mode> lowercaseContentTypeModes = singleTypeToPortletModes.get(contentType.toLowerCase());
if (lowercaseContentTypeModes != null && lowercaseContentTypeModes.contains(mode))
{
return true;
@@ -331,21 +348,21 @@
// Try type matching
String type = contentType.substring(0, index);
- Set typeMode = (Set)allTypeToPortletModes.get(type);
+ Set<Mode> typeMode = allTypeToPortletModes.get(type);
if (typeMode != null && typeMode.contains(mode))
{
return true;
}
// Try type matching
- Set lowercaseTypeMode = (Set)allTypeToPortletModes.get(type.toLowerCase());
+ Set<Mode> lowercaseTypeMode = allTypeToPortletModes.get(type.toLowerCase());
if (lowercaseTypeMode != null && lowercaseTypeMode.contains(mode))
{
return true;
}
// Try wildcard matching
- Set wildcardMode = (Set)allTypeToPortletModes.get(ALL);
+ Set<Mode> wildcardMode = allTypeToPortletModes.get(ALL);
return wildcardMode != null && wildcardMode.contains(mode);
}
}
Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/info/InfoBundle.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/info/InfoBundle.java 2008-01-07 14:38:54 UTC (rev 9447)
+++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/info/InfoBundle.java 2008-01-07 19:56:29 UTC (rev 9448)
@@ -50,7 +50,7 @@
log.debug("Creates the parent bundle");
//
- List list = new ArrayList(3);
+ List<Object> list = new ArrayList<Object>(3);
//
String title = metaData.getTitle();
Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/info/Utils.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/info/Utils.java 2008-01-07 14:38:54 UTC (rev 9447)
+++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/info/Utils.java 2008-01-07 19:56:29 UTC (rev 9448)
@@ -37,11 +37,14 @@
public class Utils
{
+ /** . */
private static final Locale DEFAULT_LOCALE = Locale.ENGLISH;
public static LocalizedString getLocalizedDescription(LocalizedStringMetaData describable)
{
- Map m = new HashMap();
+ Map<Locale, String> m = new HashMap<Locale, String>();
+
+ //
for (int i = 0; i < describable.getValues().size(); i++)
{
LocalizedValueMetaData descriptionMD = (LocalizedValueMetaData)describable.getValues().get(i);
@@ -52,6 +55,8 @@
}
m.put(locale, descriptionMD.getValue());
}
+
+ //
return new LocalizedString(m, DEFAULT_LOCALE);
}
}
Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/metadata/PortletApplicationMetaData.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/metadata/PortletApplicationMetaData.java 2008-01-07 14:38:54 UTC (rev 9447)
+++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/metadata/PortletApplicationMetaData.java 2008-01-07 19:56:29 UTC (rev 9448)
@@ -49,14 +49,14 @@
private Map userAttributes;
/** . */
- private Map portlets;
+ private Map<String, PortletMetaData> portlets;
public PortletApplicationMetaData()
{
this.portletModes = new LinkedHashMap();
this.windowStates = new LinkedHashMap();
this.userAttributes = new LinkedHashMap();
- this.portlets = new LinkedHashMap();
+ this.portlets = new LinkedHashMap<String, PortletMetaData>();
}
public String getId()
@@ -101,10 +101,10 @@
public PortletMetaData getPortlet(String id)
{
- return (PortletMetaData)portlets.get(id);
+ return portlets.get(id);
}
- public Collection getPortlets()
+ public Collection<PortletMetaData> getPortlets()
{
return portlets.values();
}
Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/spi/AbstractInstanceContext.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/spi/AbstractInstanceContext.java 2008-01-07 14:38:54 UTC (rev 9447)
+++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/spi/AbstractInstanceContext.java 2008-01-07 19:56:29 UTC (rev 9448)
@@ -79,15 +79,15 @@
public void onStateEvent(StateEvent event)
{
- StateEvent.StateEventType type = event.getType();
- if (StateEvent.PORTLET_CLONED_EVENT.equals(type))
+ switch (event.getType())
{
- clonedContext = event.getPortletContext();
+ case PORTLET_CLONED_EVENT:
+ clonedContext = event.getPortletContext();
+ break;
+ case PORTLET_MODIFIED_EVENT:
+ modifiedContext = event.getPortletContext();
+ break;
}
- else if (StateEvent.PORTLET_MODIFIED_EVENT.equals(type))
- {
- modifiedContext = event.getPortletContext();
- }
}
public PortletContext getClonedContext()
Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/spi/AbstractPortalContext.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/spi/AbstractPortalContext.java 2008-01-07 14:38:54 UTC (rev 9447)
+++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/spi/AbstractPortalContext.java 2008-01-07 19:56:29 UTC (rev 9448)
@@ -39,21 +39,24 @@
{
/** . */
- private static final Set ALL_WINDOW_STATES = Collections.unmodifiableSet(Tools.toSet(WindowState.MAXIMIZED, WindowState.MINIMIZED, WindowState.NORMAL));
+ private static final Map<String, String> EMPTY_STRING_TO_STRING_MAP = Collections.emptyMap();
/** . */
- private static final Set ALL_MODES = Collections.unmodifiableSet(Tools.toSet(Mode.EDIT, Mode.HELP, Mode.VIEW));
+ private static final Set<WindowState> ALL_WINDOW_STATES = Collections.unmodifiableSet(Tools.toSet(WindowState.MAXIMIZED, WindowState.MINIMIZED, WindowState.NORMAL));
/** . */
- private final Set windowStates;
+ private static final Set<Mode> ALL_MODES = Collections.unmodifiableSet(Tools.toSet(Mode.EDIT, Mode.HELP, Mode.VIEW));
/** . */
- private final Set modes;
+ private final Set<WindowState> windowStates;
/** . */
- private final Map props;
+ private final Set<Mode> modes;
- public AbstractPortalContext(Set windowStates, Set modes, Map props)
+ /** . */
+ private final Map<String, String> props;
+
+ public AbstractPortalContext(Set<WindowState> windowStates, Set<Mode> modes, Map<String, String> props)
{
if (windowStates == null)
{
@@ -74,7 +77,7 @@
public AbstractPortalContext()
{
- this(ALL_WINDOW_STATES, ALL_MODES, Collections.EMPTY_MAP);
+ this(ALL_WINDOW_STATES, ALL_MODES, EMPTY_STRING_TO_STRING_MAP);
}
public String getInfo()
@@ -82,17 +85,17 @@
return "JBossPortal/1.0";
}
- public Set getWindowStates()
+ public Set<WindowState> getWindowStates()
{
return windowStates;
}
- public Set getModes()
+ public Set<Mode> getModes()
{
return modes;
}
- public Map getProperties()
+ public Map<String, String> getProperties()
{
return props;
}
Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/spi/AbstractPortletInvocationContext.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/spi/AbstractPortletInvocationContext.java 2008-01-07 14:38:54 UTC (rev 9447)
+++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/spi/AbstractPortletInvocationContext.java 2008-01-07 19:56:29 UTC (rev 9448)
@@ -23,11 +23,9 @@
package org.jboss.portal.portlet.impl.spi;
import org.jboss.portal.common.invocation.AbstractInvocationContext;
-import org.jboss.portal.common.net.URLTools;
import org.jboss.portal.common.util.MarkupInfo;
import org.jboss.portal.portlet.spi.PortletInvocationContext;
import org.jboss.portal.portlet.StateString;
-import org.jboss.portal.portlet.invocation.response.HTTPRedirectionResponse;
import org.jboss.portal.Mode;
import org.jboss.portal.WindowState;
Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/spi/AbstractRenderContext.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/spi/AbstractRenderContext.java 2008-01-07 14:38:54 UTC (rev 9447)
+++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/spi/AbstractRenderContext.java 2008-01-07 19:56:29 UTC (rev 9448)
@@ -26,7 +26,6 @@
import org.jboss.portal.portlet.StateString;
import org.jboss.portal.Mode;
import org.jboss.portal.WindowState;
-import org.jboss.portal.common.util.ContentInfo;
import org.jboss.portal.common.util.MarkupInfo;
/**
Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/spi/AbstractUserContext.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/spi/AbstractUserContext.java 2008-01-07 14:38:54 UTC (rev 9447)
+++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/spi/AbstractUserContext.java 2008-01-07 19:56:29 UTC (rev 9448)
@@ -30,6 +30,7 @@
import java.util.Collections;
import java.util.Locale;
import java.util.List;
+import java.util.Enumeration;
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
@@ -39,6 +40,12 @@
{
/** . */
+ private static final Map<String, String> EMPTY_STRING_TO_STRING_MAP = Collections.emptyMap();
+
+ /** . */
+ private static final List<Locale> EMPTY_LOCALE_LIST = Collections.emptyList();
+
+ /** . */
private final String id;
/** . */
@@ -81,9 +88,9 @@
/**
* Returns an immutable empty map.
*/
- public Map getInformations()
+ public Map<String, String> getInformations()
{
- return Collections.EMPTY_MAP;
+ return EMPTY_STRING_TO_STRING_MAP;
}
/**
@@ -97,8 +104,15 @@
/**
* Returns the client request locales or an empty list if no request was provided.
*/
- public List getLocales()
+ public List<Locale> getLocales()
{
- return clientRequest != null ? Tools.toList(clientRequest.getLocales()) : Collections.EMPTY_LIST;
+ if (clientRequest == null)
+ {
+ return EMPTY_LOCALE_LIST;
+ }
+ else
+ {
+ return Tools.toList((Enumeration<Locale>)clientRequest.getLocales());
+ }
}
}
Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/state/consumer/ConsumerPersistenceManagerService.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/state/consumer/ConsumerPersistenceManagerService.java 2008-01-07 14:38:54 UTC (rev 9447)
+++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/state/consumer/ConsumerPersistenceManagerService.java 2008-01-07 19:56:29 UTC (rev 9448)
@@ -35,11 +35,11 @@
{
/** . */
- private Map store = new HashMap();
+ private Map<String, ConsumerStateContext> store = new HashMap<String, ConsumerStateContext>();
protected ConsumerStateContext get(String stateId)
{
- return (ConsumerStateContext)store.get(stateId);
+ return store.get(stateId);
}
protected void put(String stateId, ConsumerStateContext state)
Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/state/producer/PortletStatePersistenceManagerService.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/state/producer/PortletStatePersistenceManagerService.java 2008-01-07 14:38:54 UTC (rev 9447)
+++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/state/producer/PortletStatePersistenceManagerService.java 2008-01-07 19:56:29 UTC (rev 9448)
@@ -43,7 +43,7 @@
{
/** . */
- private Map store = new HashMap();
+ private Map<String, PortletStateContext> store = new HashMap<String, PortletStateContext>();
/** . */
private int counter = 0;
@@ -62,7 +62,7 @@
{
throw new InvalidStateIdException(e, stateId);
}
- PortletStateContext context = (PortletStateContext)store.get(stateId);
+ PortletStateContext context = store.get(stateId);
if (context == null)
{
throw new NoSuchStateException(stateId);
Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/info/CacheInfo.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/info/CacheInfo.java 2008-01-07 14:38:54 UTC (rev 9447)
+++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/info/CacheInfo.java 2008-01-07 19:56:29 UTC (rev 9448)
@@ -29,6 +29,10 @@
public interface CacheInfo
{
- /** The expiration in seconds. */
+ /**
+ * The expiration in seconds.
+ *
+ * @return the expiration in seconds
+ */
int getExpirationSecs();
}
Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/info/CapabilitiesInfo.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/info/CapabilitiesInfo.java 2008-01-07 14:38:54 UTC (rev 9447)
+++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/info/CapabilitiesInfo.java 2008-01-07 19:56:29 UTC (rev 9448)
@@ -23,6 +23,7 @@
package org.jboss.portal.portlet.info;
import java.util.Set;
+import java.util.Locale;
/**
* Gathers capability information (portlet modes, window states, supported MIME types and locales) regarding a portlet.
@@ -38,47 +39,50 @@
*
* @return a Set of String representation of supported MIME types
*/
- Set getMimeTypes();
+ Set<String> getMimeTypes();
/**
* Retrieves all the portlet modes supported by the associated Portlet.
*
* @return a Set of {@link ModeInfo} reprensenting the supported portlet modes
*/
- Set getAllModes();
+ Set<ModeInfo> getAllModes();
/**
* Retrieves the portlet modes supported by the associated Portlet for the specified MIME type.
*
+ * @param mimeType the mime type
* @return a Set of {@link ModeInfo} reprensenting the supported portlet modes for the specified MIME type
*/
- Set getModes(String mimeType);
+ Set<ModeInfo> getModes(String mimeType);
/**
* Retrieves all the window states supported by the associated Portlet.
*
* @return a Set of {@link WindowStateInfo} reprensenting the supported window states
*/
- Set getAllWindowStates();
+ Set<WindowStateInfo> getAllWindowStates();
/**
* Retrieves the window states supported by the associated Portlet for the specified MIME type.
*
+ * @param mimeType the mime type
* @return a Set of {@link ModeInfo} reprensenting the supported window states for the specified MIME type
*/
- Set getWindowStates(String mimeType);
+ Set<WindowStateInfo> getWindowStates(String mimeType);
/**
* Retrieves all the locales supported by the associated Portlet.
*
* @return the Set of supported {@link java.util.Locale}s
*/
- Set getAllLocales();
+ Set<Locale> getAllLocales();
/**
* Retrieves the locales supported by the associated Portlet for the specified MIME type.
*
+ * @param mimeType the mime type
* @return a Set of supported {@link java.util.Locale}s for the specified MIME type
*/
- Set getLocales(String mimeType);
+ Set<Locale> getLocales(String mimeType);
}
Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/info/MetaInfo.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/info/MetaInfo.java 2008-01-07 14:38:54 UTC (rev 9447)
+++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/info/MetaInfo.java 2008-01-07 19:56:29 UTC (rev 9448)
@@ -52,6 +52,7 @@
/**
* Return the meta value of the portlet for a specific key.
*
+ * @param key the key
* @return an internationalized value
*/
LocalizedString getMetaValue(String key);
Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/info/ModeInfo.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/info/ModeInfo.java 2008-01-07 14:38:54 UTC (rev 9447)
+++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/info/ModeInfo.java 2008-01-07 19:56:29 UTC (rev 9448)
@@ -32,10 +32,18 @@
*/
public interface ModeInfo
{
- /** The mode description. */
+ /**
+ * The mode description.
+ *
+ * @return the description
+ */
LocalizedString getDescription();
- /** The mode value. */
+ /**
+ * The mode value.
+ *
+ * @return the mode
+ */
Mode getMode();
/**
Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/info/PreferencesInfo.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/info/PreferencesInfo.java 2008-01-07 14:38:54 UTC (rev 9447)
+++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/info/PreferencesInfo.java 2008-01-07 19:56:29 UTC (rev 9448)
@@ -31,12 +31,17 @@
*/
public interface PreferencesInfo
{
- /** Return the immutable set of keys. */
- Set getKeys();
+ /**
+ * Return the immutable set of keys.
+ *
+ * @return the keys
+ */
+ Set<String> getKeys();
/**
* A preference specified by its key.
*
+ * @param key the key
* @return the preference info or null if it does not exist
* @throws IllegalArgumentException if the key is null
*/
Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/info/SecurityInfo.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/info/SecurityInfo.java 2008-01-07 14:38:54 UTC (rev 9447)
+++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/info/SecurityInfo.java 2008-01-07 19:56:29 UTC (rev 9448)
@@ -33,12 +33,13 @@
public interface SecurityInfo
{
/**
- *
+ * @param transportGuarantee the transport guarantee
+ * @return true if the transport guarantee is contained
*/
boolean containsTransportGuarantee(TransportGuarantee transportGuarantee);
/**
- *
+ * @return the set of transport guarantees
*/
- Set getTransportGuarantees();
+ Set<TransportGuarantee> getTransportGuarantees();
}
Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/info/SessionInfo.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/info/SessionInfo.java 2008-01-07 14:38:54 UTC (rev 9447)
+++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/info/SessionInfo.java 2008-01-07 19:56:29 UTC (rev 9448)
@@ -29,7 +29,7 @@
public interface SessionInfo
{
/**
- *
+ * @return true if the session should be distributed
*/
Boolean getDistributed();
}
Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/info/WindowStateInfo.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/info/WindowStateInfo.java 2008-01-07 14:38:54 UTC (rev 9447)
+++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/info/WindowStateInfo.java 2008-01-07 19:56:29 UTC (rev 9448)
@@ -32,10 +32,18 @@
*/
public interface WindowStateInfo
{
- /** The window state description. */
+ /**
+ * The window state description.
+ *
+ * @return the window state description
+ */
LocalizedString getDescription();
- /** The window state value. */
+ /**
+ * The window state value.
+ *
+ * @return the window state value
+ */
WindowState getWindowState();
/**
Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/spi/PortalContext.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/spi/PortalContext.java 2008-01-07 14:38:54 UTC (rev 9447)
+++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/spi/PortalContext.java 2008-01-07 19:56:29 UTC (rev 9448)
@@ -22,6 +22,9 @@
******************************************************************************/
package org.jboss.portal.portlet.spi;
+import org.jboss.portal.WindowState;
+import org.jboss.portal.Mode;
+
import java.util.Map;
import java.util.Set;
@@ -40,12 +43,24 @@
*/
String getInfo();
- /** Return the window states accepted by this portal context. */
- Set getWindowStates();
+ /**
+ * Return the window states accepted by this portal context.
+ *
+ * @return the window states
+ */
+ Set<WindowState> getWindowStates();
- /** Return the modes accepted by this portal context. */
- Set getModes();
+ /**
+ * Return the modes accepted by this portal context.
+ *
+ * @return the modes
+ */
+ Set<Mode> getModes();
- /** Return the set of properties of this portal context. */
- Map getProperties();
+ /**
+ * Return the set of properties of this portal context.
+ *
+ * @return the properties
+ */
+ Map<String, String> getProperties();
}
Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/spi/PortletInvocationContext.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/spi/PortletInvocationContext.java 2008-01-07 14:38:54 UTC (rev 9447)
+++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/spi/PortletInvocationContext.java 2008-01-07 19:56:29 UTC (rev 9448)
@@ -82,9 +82,9 @@
/**
* @param portletURL the portlet url
- * @param wantSecure
- * @param wantAuthenticated
- * @param relative
+ * @param wantSecure if the url should be secure
+ * @param wantAuthenticated if the url should be authenticated
+ * @param relative if the url should be relative
* @return the url
*/
String renderURL(
Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/spi/RequestContext.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/spi/RequestContext.java 2008-01-07 14:38:54 UTC (rev 9447)
+++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/spi/RequestContext.java 2008-01-07 19:56:29 UTC (rev 9448)
@@ -38,16 +38,22 @@
{
/**
* Return the scheme value.
+ *
+ * @return the scheme
*/
String getScheme();
/**
* Return the server name value.
+ *
+ * @return the server name
*/
String getServerName();
/**
* Return the server port value.
+ *
+ * @return the server port
*/
int getServerPort();
Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/spi/SecurityContext.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/spi/SecurityContext.java 2008-01-07 14:38:54 UTC (rev 9447)
+++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/spi/SecurityContext.java 2008-01-07 19:56:29 UTC (rev 9448)
@@ -31,32 +31,33 @@
public interface SecurityContext
{
/**
- *
+ * @return true if is secured
*/
boolean isSecure();
/**
- *
+ * @return true if it is authenticated
*/
boolean isAuthenticated();
/**
- *
+ * @return the auth type
*/
String getAuthType();
/**
- *
+ * @return the remote user
*/
String getRemoteUser();
/**
- *
+ * @return the user principal
*/
Principal getUserPrincipal();
/**
- *
+ * @param roleName the role name
+ * @return true if the user is in role
*/
boolean isUserInRole(String roleName);
}
Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/spi/UserContext.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/spi/UserContext.java 2008-01-07 14:38:54 UTC (rev 9447)
+++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/spi/UserContext.java 2008-01-07 19:56:29 UTC (rev 9448)
@@ -48,7 +48,7 @@
* @return a map containing user profile informaton
* @see org.jboss.portal.common.p3p.P3PConstants
*/
- Map getInformations();
+ Map<String, String> getInformations();
/**
* Return the user locale.
@@ -62,5 +62,5 @@
*
* @return the locales ordered according to user preference (preferred first).
*/
- List getLocales();
+ List<Locale> getLocales();
}
Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/state/PropertyContext.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/state/PropertyContext.java 2008-01-07 14:38:54 UTC (rev 9447)
+++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/state/PropertyContext.java 2008-01-07 19:56:29 UTC (rev 9448)
@@ -42,7 +42,7 @@
*
* @return the set of keys
*/
- Set getKeys();
+ Set<String> getKeys();
/**
* Return for a specified key its value or null if the value does not exist.
Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/state/consumer/ConsumerPortletInvoker.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/state/consumer/ConsumerPortletInvoker.java 2008-01-07 14:38:54 UTC (rev 9447)
+++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/state/consumer/ConsumerPortletInvoker.java 2008-01-07 19:56:29 UTC (rev 9448)
@@ -164,12 +164,12 @@
ConsumerState consumerState = new ConsumerState(clonedContext.getId(), state);
String stateId = persistenceManager.createState(consumerState);
String clonedId = CLONE_ID_PREFIX + stateId;
- StateEvent event = new StateEvent(PortletContext.createPortletContext(clonedId), StateEvent.PORTLET_CLONED_EVENT);
+ StateEvent event = new StateEvent(PortletContext.createPortletContext(clonedId), StateEvent.Type.PORTLET_CLONED_EVENT);
cictx.onStateEvent(event);
}
else
{
- StateEvent event = new StateEvent(PortletContext.createPortletContext(clonedContext.getId()), StateEvent.PORTLET_CLONED_EVENT);
+ StateEvent event = new StateEvent(PortletContext.createPortletContext(clonedContext.getId()), StateEvent.Type.PORTLET_CLONED_EVENT);
cictx.onStateEvent(event);
}
}
@@ -354,15 +354,15 @@
public void onStateEvent(StateEvent event)
{
- StateEvent.StateEventType type = event.getType();
- if (StateEvent.PORTLET_CLONED_EVENT.equals(type))
+ switch (event.getType())
{
- clonedContext = event.getPortletContext();
+ case PORTLET_CLONED_EVENT:
+ clonedContext = event.getPortletContext();
+ break;
+ case PORTLET_MODIFIED_EVENT:
+ modifiedContext = event.getPortletContext();
+ break;
}
- else if (StateEvent.PORTLET_MODIFIED_EVENT.equals(type))
- {
- modifiedContext = event.getPortletContext();
- }
}
}
Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/state/producer/ProducerPortletInvoker.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/state/producer/ProducerPortletInvoker.java 2008-01-07 14:38:54 UTC (rev 9447)
+++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/state/producer/ProducerPortletInvoker.java 2008-01-07 19:56:29 UTC (rev 9448)
@@ -268,7 +268,7 @@
// Return the clone context
String cloneId = PRODUCER_CLONE_ID_PREFIX + cloneStateId;
PortletContext clonedCtx = PortletContext.createPortletContext(cloneId);
- StateEvent event = new StateEvent(clonedCtx, StateEvent.PORTLET_CLONED_EVENT);
+ StateEvent event = new StateEvent(clonedCtx, StateEvent.Type.PORTLET_CLONED_EVENT);
instanceCtx.onStateEvent(event);
}
catch (NoSuchStateException e)
@@ -283,7 +283,7 @@
else
{
PortletContext clonedCtx = marshall(context.getPortletId(), newPrefs);
- StateEvent event = new StateEvent(clonedCtx, StateEvent.PORTLET_CLONED_EVENT);
+ StateEvent event = new StateEvent(clonedCtx, StateEvent.Type.PORTLET_CLONED_EVENT);
instanceCtx.onStateEvent(event);
}
}
@@ -301,13 +301,13 @@
// Return the clone context
String cloneId = PRODUCER_CLONE_ID_PREFIX + cloneStateId;
PortletContext clonedCtx = PortletContext.createPortletContext(cloneId);
- StateEvent event = new StateEvent(clonedCtx, StateEvent.PORTLET_CLONED_EVENT);
+ StateEvent event = new StateEvent(clonedCtx, StateEvent.Type.PORTLET_CLONED_EVENT);
instanceCtx.onStateEvent(event);
}
else
{
PortletContext clonedCtx = marshall(context.getPortletId(), newPrefs);
- StateEvent event = new StateEvent(clonedCtx, StateEvent.PORTLET_CLONED_EVENT);
+ StateEvent event = new StateEvent(clonedCtx, StateEvent.Type.PORTLET_CLONED_EVENT);
instanceCtx.onStateEvent(event);
}
}
@@ -336,7 +336,7 @@
else
{
PortletContext modifiedCtx = marshall(context.getPortletId(), newPrefs);
- StateEvent event = new StateEvent(modifiedCtx, StateEvent.PORTLET_MODIFIED_EVENT);
+ StateEvent event = new StateEvent(modifiedCtx, StateEvent.Type.PORTLET_MODIFIED_EVENT);
instanceCtx.onStateEvent(event);
}
}
Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/support/info/CapabilitiesInfoSupport.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/support/info/CapabilitiesInfoSupport.java 2008-01-07 14:38:54 UTC (rev 9447)
+++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/support/info/CapabilitiesInfoSupport.java 2008-01-07 19:56:29 UTC (rev 9448)
@@ -23,6 +23,8 @@
package org.jboss.portal.portlet.support.info;
import org.jboss.portal.portlet.info.CapabilitiesInfo;
+import org.jboss.portal.portlet.info.ModeInfo;
+import org.jboss.portal.portlet.info.WindowStateInfo;
import org.jboss.portal.Mode;
import org.jboss.portal.WindowState;
@@ -39,83 +41,83 @@
{
/** . */
- private Set mimeTypes;
+ private Set<String> mimeTypes;
/** . */
- private Set modes;
+ private Set<ModeInfo> modes;
/** . */
- private Set windowStates;
+ private Set<WindowStateInfo> windowStates;
/** . */
- private Set locales;
+ private Set<Locale> locales;
public CapabilitiesInfoSupport()
{
- mimeTypes = new HashSet();
+ mimeTypes = new HashSet<String>();
mimeTypes.add("text/html");
//
- modes = new HashSet();
+ this.modes = new HashSet<ModeInfo>();
modes.add(new ModeInfoSupport(Mode.VIEW));
modes.add(new ModeInfoSupport(Mode.EDIT));
modes.add(new ModeInfoSupport(Mode.HELP));
//
- windowStates = new HashSet();
+ this.windowStates = new HashSet<WindowStateInfo>();
windowStates.add(new WindowStateInfoSupport(WindowState.NORMAL));
windowStates.add(new WindowStateInfoSupport(WindowState.MAXIMIZED));
windowStates.add(new WindowStateInfoSupport(WindowState.MINIMIZED));
//
- locales = new HashSet();
+ locales = new HashSet<Locale>();
locales.add(Locale.ENGLISH);
}
- public Set getMimeTypes()
+ public Set<String> getMimeTypes()
{
return mimeTypes;
}
- public Set getAllModes()
+ public Set<ModeInfo> getAllModes()
{
return modes;
}
- public Set getModes(String mimeType)
+ public Set<ModeInfo> getModes(String mimeType)
{
if (mimeTypes.contains(mimeType))
{
return modes;
}
- return Collections.EMPTY_SET;
+ return Collections.emptySet();
}
- public Set getAllWindowStates()
+ public Set<WindowStateInfo> getAllWindowStates()
{
return windowStates;
}
- public Set getWindowStates(String mimeType)
+ public Set<WindowStateInfo> getWindowStates(String mimeType)
{
if (mimeTypes.contains(mimeType))
{
return windowStates;
}
- return Collections.EMPTY_SET;
+ return Collections.emptySet();
}
- public Set getAllLocales()
+ public Set<Locale> getAllLocales()
{
return locales;
}
- public Set getLocales(String mimeType)
+ public Set<Locale> getLocales(String mimeType)
{
if (mimeTypes.contains(mimeType))
{
return locales;
}
- return Collections.EMPTY_SET;
+ return Collections.emptySet();
}
}
Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/support/info/SecurityInfoSupport.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/support/info/SecurityInfoSupport.java 2008-01-07 14:38:54 UTC (rev 9447)
+++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/support/info/SecurityInfoSupport.java 2008-01-07 19:56:29 UTC (rev 9448)
@@ -36,9 +36,9 @@
{
/** . */
- private final Set transportGuarantees;
+ private final Set<TransportGuarantee> transportGuarantees;
- public SecurityInfoSupport(Set transportGuarantees)
+ public SecurityInfoSupport(Set<TransportGuarantee> transportGuarantees)
{
this.transportGuarantees = transportGuarantees;
}
@@ -53,7 +53,7 @@
return transportGuarantees.contains(transportGuarantee);
}
- public Set getTransportGuarantees()
+ public Set<TransportGuarantee> getTransportGuarantees()
{
return transportGuarantees;
}
Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/support/spi/UserContextSupport.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/support/spi/UserContextSupport.java 2008-01-07 14:38:54 UTC (rev 9447)
+++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/support/spi/UserContextSupport.java 2008-01-07 19:56:29 UTC (rev 9448)
@@ -41,7 +41,7 @@
throw new UnsupportedOperationException();
}
- public Map getInformations()
+ public Map<String, String> getInformations()
{
throw new UnsupportedOperationException();
}
@@ -51,7 +51,7 @@
throw new UnsupportedOperationException();
}
- public List getLocales()
+ public List<Locale> getLocales()
{
throw new UnsupportedOperationException();
}
Modified: modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/state/PortletInvokerSupport.java
===================================================================
--- modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/state/PortletInvokerSupport.java 2008-01-07 14:38:54 UTC (rev 9447)
+++ modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/state/PortletInvokerSupport.java 2008-01-07 19:56:29 UTC (rev 9448)
@@ -35,6 +35,7 @@
import org.jboss.portal.portlet.state.PropertyChange;
import org.jboss.portal.portlet.state.PropertyMap;
import org.jboss.portal.portlet.state.SimplePropertyMap;
+import org.jboss.portal.portlet.state.DestroyCloneFailure;
import org.jboss.portal.common.value.Value;
import java.util.HashMap;
@@ -52,11 +53,11 @@
{
/** . */
- private Map portlets;
+ private Map<String, Portlet> portlets;
public PortletInvokerSupport()
{
- this.portlets = new HashMap();
+ this.portlets = new HashMap<String, Portlet>();
}
public void setValid(String portletId, boolean valid)
@@ -110,9 +111,9 @@
return portlet;
}
- public Set getPortlets()
+ public Set<Portlet> getPortlets()
{
- return new HashSet(portlets.values());
+ return new HashSet<Portlet>(portlets.values());
}
public Portlet getPortlet(PortletContext portletContext) throws IllegalArgumentException, PortletInvokerException
@@ -159,7 +160,7 @@
private boolean valid;
/** . */
- private Map state;
+ private Map<String, Value> state;
public InternalPortlet(String portletId, PortletSupport support)
{
@@ -174,7 +175,7 @@
this.portletContext = PortletContext.createPortletContext(portletId);
this.support = support;
this.valid = true;
- this.state = new HashMap();
+ this.state = new HashMap<String, Value>();
}
public void addPreference(String key, Value value)
@@ -210,14 +211,13 @@
}
}
- public PropertyMap getProperties(PortletContext portletContext, Set keys) throws IllegalArgumentException, PortletInvokerException, UnsupportedOperationException
+ public PropertyMap getProperties(PortletContext portletContext, Set<String> keys) throws IllegalArgumentException, PortletInvokerException, UnsupportedOperationException
{
InternalPortlet internalPortlet = internalGetPortlet(portletContext);
PropertyMap props = new SimplePropertyMap();
- for (Iterator i = keys.iterator();i.hasNext();)
+ for (String key : keys)
{
- String key = (String)i.next();
- Value value = (Value)internalPortlet.state.get(key);
+ Value value = internalPortlet.state.get(key);
if (value != null)
{
props.put(key, value.clone());
@@ -230,10 +230,9 @@
{
InternalPortlet internalPortlet = internalGetPortlet(portletContext);
PropertyMap props = new SimplePropertyMap();
- for (Iterator i = internalPortlet.state.keySet().iterator();i.hasNext();)
+ for (String key: internalPortlet.state.keySet())
{
- String key = (String)i.next();
- Value value = (Value)internalPortlet.state.get(key);
+ Value value = internalPortlet.state.get(key);
if (value != null)
{
props.put(key, value.clone());
@@ -247,7 +246,7 @@
throw new UnsupportedOperationException();
}
- public List destroyClones(List portletContexts) throws IllegalArgumentException, PortletInvokerException, UnsupportedOperationException
+ public List<DestroyCloneFailure> destroyClones(List<PortletContext> portletContexts) throws IllegalArgumentException, PortletInvokerException, UnsupportedOperationException
{
throw new UnsupportedOperationException();
}
Modified: modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/state/TestPortletInvoker.java
===================================================================
--- modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/state/TestPortletInvoker.java 2008-01-07 14:38:54 UTC (rev 9447)
+++ modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/state/TestPortletInvoker.java 2008-01-07 19:56:29 UTC (rev 9448)
@@ -34,6 +34,7 @@
import org.jboss.portal.portlet.invocation.response.PortletInvocationResponse;
import org.jboss.portal.portlet.state.PropertyChange;
import org.jboss.portal.portlet.state.PropertyMap;
+import org.jboss.portal.portlet.state.DestroyCloneFailure;
import java.util.List;
import java.util.Set;
@@ -91,7 +92,7 @@
this.producer = producer;
}
- public Set getPortlets() throws PortletInvokerException
+ public Set<Portlet> getPortlets() throws PortletInvokerException
{
return producer.getPortlets();
}
@@ -135,12 +136,12 @@
throw new UnsupportedOperationException();
}
- public List destroyClones(List portletContexts) throws IllegalArgumentException, PortletInvokerException, UnsupportedOperationException
+ public List<DestroyCloneFailure> destroyClones(List<PortletContext> portletContexts) throws IllegalArgumentException, PortletInvokerException, UnsupportedOperationException
{
throw new UnsupportedOperationException();
}
- public PropertyMap getProperties(PortletContext portletContext, Set keys) throws IllegalArgumentException, PortletInvokerException, UnsupportedOperationException
+ public PropertyMap getProperties(PortletContext portletContext, Set<String> keys) throws IllegalArgumentException, PortletInvokerException, UnsupportedOperationException
{
throw new UnsupportedOperationException();
}
Modified: modules/portlet/trunk/test/src/test/java/org/jboss/portal/portlet/test/TestInstanceContext.java
===================================================================
--- modules/portlet/trunk/test/src/test/java/org/jboss/portal/portlet/test/TestInstanceContext.java 2008-01-07 14:38:54 UTC (rev 9447)
+++ modules/portlet/trunk/test/src/test/java/org/jboss/portal/portlet/test/TestInstanceContext.java 2008-01-07 19:56:29 UTC (rev 9448)
@@ -91,13 +91,7 @@
public void onStateEvent(StateEvent event)
{
- StateEvent.StateEventType type = event.getType();
-
- //
- if (StateEvent.PORTLET_CLONED_EVENT.equals(type) || StateEvent.PORTLET_MODIFIED_EVENT.equals(type))
- {
- target = event.getPortletContext();
- req.getSession().setAttribute("clone." + id, target);
- }
+ target = event.getPortletContext();
+ req.getSession().setAttribute("clone." + id, target);
}
}
Modified: modules/portlet/trunk/test/src/test/java/org/jboss/portal/portlet/test/TestPortletInvoker.java
===================================================================
--- modules/portlet/trunk/test/src/test/java/org/jboss/portal/portlet/test/TestPortletInvoker.java 2008-01-07 14:38:54 UTC (rev 9447)
+++ modules/portlet/trunk/test/src/test/java/org/jboss/portal/portlet/test/TestPortletInvoker.java 2008-01-07 19:56:29 UTC (rev 9448)
@@ -28,6 +28,7 @@
import org.jboss.portal.portlet.PortletContext;
import org.jboss.portal.portlet.state.PropertyMap;
import org.jboss.portal.portlet.state.PropertyChange;
+import org.jboss.portal.portlet.state.DestroyCloneFailure;
import org.jboss.portal.portlet.invocation.PortletInvocation;
import org.jboss.portal.portlet.invocation.response.PortletInvocationResponse;
import org.jboss.portal.common.invocation.InterceptorStackFactory;
@@ -91,7 +92,7 @@
this.producer = producer;
}
- public Set getPortlets() throws PortletInvokerException
+ public Set<Portlet> getPortlets() throws PortletInvokerException
{
return producer.getPortlets();
}
@@ -135,7 +136,7 @@
throw new UnsupportedOperationException();
}
- public List destroyClones(List portletContexts) throws IllegalArgumentException, PortletInvokerException, UnsupportedOperationException
+ public List<DestroyCloneFailure> destroyClones(List<PortletContext> portletContexts) throws IllegalArgumentException, PortletInvokerException, UnsupportedOperationException
{
throw new UnsupportedOperationException();
}
Modified: modules/portlet/trunk/test/src/test/java/org/jboss/portal/portlet/test/deployment/PortletApplicationMetaDataFactory.java
===================================================================
--- modules/portlet/trunk/test/src/test/java/org/jboss/portal/portlet/test/deployment/PortletApplicationMetaDataFactory.java 2008-01-07 14:38:54 UTC (rev 9447)
+++ modules/portlet/trunk/test/src/test/java/org/jboss/portal/portlet/test/deployment/PortletApplicationMetaDataFactory.java 2008-01-07 19:56:29 UTC (rev 9448)
@@ -398,7 +398,7 @@
}
if ("transport-guarantee".equals(localName))
{
- security.setTransportGuarantee(TransportGuarantee.decode(value));
+ security.setTransportGuarantee(TransportGuarantee.valueOf(value));
}
}
}
Modified: modules/portlet/trunk/test/src/test/java/org/jboss/portal/portlet/test/metadata/GeneralMetaDataTestCase.java
===================================================================
--- modules/portlet/trunk/test/src/test/java/org/jboss/portal/portlet/test/metadata/GeneralMetaDataTestCase.java 2008-01-07 14:38:54 UTC (rev 9447)
+++ modules/portlet/trunk/test/src/test/java/org/jboss/portal/portlet/test/metadata/GeneralMetaDataTestCase.java 2008-01-07 19:56:29 UTC (rev 9448)
@@ -102,7 +102,7 @@
ListenerMetaData listener1 = md.getListeners().get(0);
assertNotNull(listener1);
assertEquals("org.jboss.portal.portlet.test.listener.MyListener", listener1.getListenerClass());
- assertEquals("Mein Zuhörer Eins", listener1.getDisplayName().getString(new Locale("de"), false));
+ assertEquals("Mein Zuh\u00f6rer Eins", listener1.getDisplayName().getString(new Locale("de"), false));
assertEquals("Beschreibung", listener1.getDescription().getString(new Locale("de"), false));
assertNotNull(md.getListeners().get(1));
18 years, 3 months