You are viewing a plain text version of this content. The canonical link for it is here.
Posted to pluto-scm@portals.apache.org by at...@apache.org on 2008/10/15 02:01:11 UTC
svn commit: r704743 [5/7] - in /portals/pluto/branches/2.0-spi-refactoring:
./ pluto-container-api/src/main/java/org/apache/pluto/
pluto-container-api/src/main/java/org/apache/pluto/om/
pluto-container-api/src/main/java/org/apache/pluto/om/common/ plut...
Added: portals/pluto/branches/2.0-spi-refactoring/pluto-descriptor-api/src/main/java/org/apache/pluto/descriptors/portlet20/PortletPreferencesType.java
URL: http://svn.apache.org/viewvc/portals/pluto/branches/2.0-spi-refactoring/pluto-descriptor-api/src/main/java/org/apache/pluto/descriptors/portlet20/PortletPreferencesType.java?rev=704743&view=auto
==============================================================================
--- portals/pluto/branches/2.0-spi-refactoring/pluto-descriptor-api/src/main/java/org/apache/pluto/descriptors/portlet20/PortletPreferencesType.java (added)
+++ portals/pluto/branches/2.0-spi-refactoring/pluto-descriptor-api/src/main/java/org/apache/pluto/descriptors/portlet20/PortletPreferencesType.java Tue Oct 14 17:01:07 2008
@@ -0,0 +1,107 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.pluto.descriptors.portlet20;
+
+import java.util.List;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlAttribute;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlType;
+
+import org.apache.pluto.om.ElementFactoryList;
+import org.apache.pluto.om.portlet.PortletPreference;
+import org.apache.pluto.om.portlet.PortletPreferences;
+
+/**
+ * Portlet persistent preference store. Used in: portlet <p>Java class for portlet-preferencesType complex type. <p>The
+ * following schema fragment specifies the expected content contained within this class.
+ *
+ * <pre>
+ * <complexType name="portlet-preferencesType">
+ * <complexContent>
+ * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ * <sequence>
+ * <element name="preference" type="{http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd}preferenceType" maxOccurs="unbounded" minOccurs="0"/>
+ * <element name="preferences-validator" type="{http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd}preferences-validatorType" minOccurs="0"/>
+ * </sequence>
+ * <attribute name="id" type="{http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd}string" />
+ * </restriction>
+ * </complexContent>
+ * </complexType>
+ * </pre>
+ *
+ * @version $Id$
+ */
+@XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "portlet-preferencesType", propOrder = { "preference", "preferencesValidator" })
+public class PortletPreferencesType implements PortletPreferences
+{
+ @XmlElement(name = "preference", type=PreferenceType.class)
+ protected List<PortletPreference> preference;
+ @XmlElement(name = "preferences-validator")
+ protected String preferencesValidator;
+ @XmlAttribute
+ protected String id;
+
+ public ElementFactoryList<PortletPreference> getPortletPreferences()
+ {
+ if (preference == null || !(preference instanceof ElementFactoryList))
+ {
+ ElementFactoryList<PortletPreference> lf =
+ new ElementFactoryList<PortletPreference>( new ElementFactoryList.Factory<PortletPreference>()
+ {
+ public Class<? extends PortletPreference> getElementClass()
+ {
+ return PreferenceType.class;
+ }
+
+ public PortletPreference newElement()
+ {
+ return new PreferenceType();
+ }
+ });
+ if (preference != null)
+ {
+ lf.addAll(preference);
+ }
+ preference = lf;
+ }
+ return (ElementFactoryList<PortletPreference>)preference;
+ }
+
+ public String getPreferencesValidator()
+ {
+ return preferencesValidator;
+ }
+
+ public void setPreferencesValidator(String value)
+ {
+ preferencesValidator = value;
+ }
+
+ public String getId()
+ {
+ return id;
+ }
+
+ public void setId(String value)
+ {
+ id = value;
+ }
+}
Propchange: portals/pluto/branches/2.0-spi-refactoring/pluto-descriptor-api/src/main/java/org/apache/pluto/descriptors/portlet20/PortletPreferencesType.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: portals/pluto/branches/2.0-spi-refactoring/pluto-descriptor-api/src/main/java/org/apache/pluto/descriptors/portlet20/PortletType.java
URL: http://svn.apache.org/viewvc/portals/pluto/branches/2.0-spi-refactoring/pluto-descriptor-api/src/main/java/org/apache/pluto/descriptors/portlet20/PortletType.java?rev=704743&view=auto
==============================================================================
--- portals/pluto/branches/2.0-spi-refactoring/pluto-descriptor-api/src/main/java/org/apache/pluto/descriptors/portlet20/PortletType.java (added)
+++ portals/pluto/branches/2.0-spi-refactoring/pluto-descriptor-api/src/main/java/org/apache/pluto/descriptors/portlet20/PortletType.java Tue Oct 14 17:01:07 2008
@@ -0,0 +1,478 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.pluto.descriptors.portlet20;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.xml.bind.Unmarshaller;
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlAttribute;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlTransient;
+import javax.xml.bind.annotation.XmlType;
+import javax.xml.bind.annotation.adapters.CollapsedStringAdapter;
+import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
+
+import org.apache.pluto.om.ElementFactoryList;
+import org.apache.pluto.om.common.Description;
+import org.apache.pluto.om.common.DisplayName;
+import org.apache.pluto.om.common.InitParam;
+import org.apache.pluto.om.common.SecurityRoleRef;
+import org.apache.pluto.om.portlet.ContainerRuntimeOption;
+import org.apache.pluto.om.portlet.EventDefinitionReference;
+import org.apache.pluto.om.portlet.Portlet;
+import org.apache.pluto.om.portlet.PortletApp;
+import org.apache.pluto.om.portlet.PortletInfo;
+import org.apache.pluto.om.portlet.PortletPreferences;
+import org.apache.pluto.om.portlet.Supports;
+
+/**
+ * The portlet element contains the declarative data of a portlet. Used in: portlet-app <p>Java class for portletType
+ * complex type. <p>The following schema fragment specifies the expected content contained within this class.
+ *
+ * <pre>
+ * <complexType name="portletType">
+ * <complexContent>
+ * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ * <sequence>
+ * <element name="description" type="{http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd}descriptionType" maxOccurs="unbounded" minOccurs="0"/>
+ * <element name="portlet-name" type="{http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd}portlet-nameType"/>
+ * <element name="display-name" type="{http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd}display-nameType" maxOccurs="unbounded" minOccurs="0"/>
+ * <element name="portlet-class" type="{http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd}portlet-classType"/>
+ * <element name="init-param" type="{http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd}init-paramType" maxOccurs="unbounded" minOccurs="0"/>
+ * <element name="expiration-cache" type="{http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd}expiration-cacheType" minOccurs="0"/>
+ * <element name="cache-scope" type="{http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd}cache-scopeType" minOccurs="0"/>
+ * <element name="supports" type="{http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd}supportsType" maxOccurs="unbounded"/>
+ * <element name="supported-locale" type="{http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd}supported-localeType" maxOccurs="unbounded" minOccurs="0"/>
+ * <element name="resource-bundle" type="{http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd}resource-bundleType" minOccurs="0"/>
+ * <element name="portlet-info" type="{http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd}portlet-infoType" minOccurs="0"/>
+ * <element name="portlet-preferences" type="{http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd}portlet-preferencesType" minOccurs="0"/>
+ * <element name="security-role-ref" type="{http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd}security-role-refType" maxOccurs="unbounded" minOccurs="0"/>
+ * <element name="supported-processing-event" type="{http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd}event-definition-referenceType" maxOccurs="unbounded" minOccurs="0"/>
+ * <element name="supported-publishing-event" type="{http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd}event-definition-referenceType" maxOccurs="unbounded" minOccurs="0"/>
+ * <element name="supported-public-render-parameter" type="{http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd}string" maxOccurs="unbounded" minOccurs="0"/>
+ * <element name="container-runtime-option" type="{http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd}container-runtime-optionType" maxOccurs="unbounded" minOccurs="0"/>
+ * </sequence>
+ * <attribute name="id" type="{http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd}string" />
+ * </restriction>
+ * </complexContent>
+ * </complexType>
+ * </pre>
+ *
+ * @version $Id$
+ */
+@XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "portletType", propOrder = { "description", "portletName", "displayName", "portletClass", "initParam",
+ "expirationCache", "cacheScope", "supports", "supportedLocale",
+ "resourceBundle", "portletInfo", "portletPreferences", "securityRoleRef",
+ "supportedProcessingEvent", "supportedPublishingEvent",
+ "supportedPublicRenderParameter", "containerRuntimeOption" })
+public class PortletType implements Portlet
+{
+ @XmlElement(name = "description", type=DescriptionType.class)
+ protected List<Description> description;
+ @XmlElement(name = "portlet-name", required = true)
+ @XmlJavaTypeAdapter(value=CollapsedStringAdapter.class)
+ protected String portletName;
+ @XmlElement(name = "display-name", type=DisplayNameType.class)
+ protected List<DisplayName> displayName;
+ @XmlElement(name = "portlet-class", required = true)
+ @XmlJavaTypeAdapter(value=CollapsedStringAdapter.class)
+ protected String portletClass;
+ @XmlElement(name = "init-param", type=InitParamType.class)
+ protected List<InitParam> initParam;
+ @XmlElement(name = "expiration-cache")
+ protected Integer expirationCache;
+ @XmlElement(name = "cache-scope")
+ @XmlJavaTypeAdapter(value=CollapsedStringAdapter.class)
+ protected String cacheScope;
+ @XmlElement(required = true, type=SupportsType.class)
+ protected List<Supports> supports;
+ @XmlElement(name = "supported-locale")
+ @XmlJavaTypeAdapter(value=CollapsedStringAdapter.class)
+ protected List<String> supportedLocale;
+ @XmlElement(name = "resource-bundle")
+ @XmlJavaTypeAdapter(value=CollapsedStringAdapter.class)
+ protected String resourceBundle;
+ @XmlElement(name = "portlet-info")
+ protected PortletInfoType portletInfo;
+ @XmlElement(name = "portlet-preferences")
+ protected PortletPreferencesType portletPreferences;
+ @XmlElement(name = "security-role-ref", type=SecurityRoleRefType.class)
+ protected List<SecurityRoleRef> securityRoleRef;
+ @XmlElement(name = "supported-processing-event", type=EventDefinitionReferenceType.class)
+ protected List<EventDefinitionReference> supportedProcessingEvent;
+ @XmlElement(name = "supported-publishing-event", type=EventDefinitionReferenceType.class)
+ protected List<EventDefinitionReference> supportedPublishingEvent;
+ @XmlElement(name = "supported-public-render-parameter")
+ protected List<String> supportedPublicRenderParameter;
+ @XmlElement(name = "container-runtime-option", type=ContainerRuntimeOptionType.class)
+ protected List<ContainerRuntimeOption> containerRuntimeOption;
+ @XmlAttribute
+ protected String id;
+
+ @XmlTransient
+ private PortletApp application;
+
+ public PortletType()
+ {
+ }
+
+ public PortletType(PortletApp application)
+ {
+ this.application = application;
+ }
+
+ public PortletApp getApplication()
+ {
+ return application;
+ }
+
+ public ElementFactoryList<Description> getDescriptions()
+ {
+ if (description == null || !(description instanceof ElementFactoryList))
+ {
+ ElementFactoryList<Description> lf =
+ new ElementFactoryList<Description>( new ElementFactoryList.Factory<Description>()
+ {
+ public Class<? extends Description> getElementClass()
+ {
+ return DescriptionType.class;
+ }
+
+ public Description newElement()
+ {
+ return new DescriptionType();
+ }
+ });
+ if (description != null)
+ {
+ lf.addAll(description);
+ }
+ description = lf;
+ }
+ return (ElementFactoryList<Description>)description;
+ }
+
+ public String getPortletName()
+ {
+ return portletName;
+ }
+
+ public void setPortletName(String value)
+ {
+ portletName = value;
+ }
+
+ public ElementFactoryList<DisplayName> getDisplayNames()
+ {
+ if (displayName == null || !(displayName instanceof ElementFactoryList))
+ {
+ ElementFactoryList<DisplayName> lf =
+ new ElementFactoryList<DisplayName>( new ElementFactoryList.Factory<DisplayName>()
+ {
+ public Class<? extends DisplayName> getElementClass()
+ {
+ return DisplayNameType.class;
+ }
+
+ public DisplayName newElement()
+ {
+ return new DisplayNameType();
+ }
+ });
+ if (displayName != null)
+ {
+ lf.addAll(displayName);
+ }
+ displayName = lf;
+ }
+ return (ElementFactoryList<DisplayName>)displayName;
+ }
+
+ public String getPortletClass()
+ {
+ return portletClass;
+ }
+
+ public void setPortletClass(String value)
+ {
+ portletClass = value;
+ }
+
+ public ElementFactoryList<InitParam> getInitParams()
+ {
+ if (initParam == null || !(initParam instanceof ElementFactoryList))
+ {
+ ElementFactoryList<InitParam> lf =
+ new ElementFactoryList<InitParam>( new ElementFactoryList.Factory<InitParam>()
+ {
+ public Class<? extends InitParam> getElementClass()
+ {
+ return InitParamType.class;
+ }
+
+ public InitParam newElement()
+ {
+ return new InitParamType();
+ }
+ });
+ if (initParam != null)
+ {
+ lf.addAll(initParam);
+ }
+ initParam = lf;
+ }
+ return (ElementFactoryList<InitParam>)initParam;
+ }
+
+ public int getExpirationCache()
+ {
+ return expirationCache != null ? expirationCache.intValue() : 0;
+ }
+
+ public void setExpirationCache(int value)
+ {
+ expirationCache = new Integer(value);
+ }
+
+ /**
+ * Caching scope, allowed values are "private" indicating that the content should not be shared across users and
+ * "public" indicating that the content may be shared across users. The default value if not present is "private".
+ */
+ public String getCacheScope()
+ {
+ return cacheScope != null ? cacheScope : "private";
+ }
+
+ public void setCacheScope(String cacheScope)
+ {
+ this.cacheScope = cacheScope;
+ }
+
+ public ElementFactoryList<Supports> getSupports()
+ {
+ if (supports == null || !(supports instanceof ElementFactoryList))
+ {
+ ElementFactoryList<Supports> lf =
+ new ElementFactoryList<Supports>( new ElementFactoryList.Factory<Supports>()
+ {
+ public Class<? extends Supports> getElementClass()
+ {
+ return SupportsType.class;
+ }
+
+ public Supports newElement()
+ {
+ return new SupportsType();
+ }
+ });
+ if (supports != null)
+ {
+ lf.addAll(supports);
+ }
+ supports = lf;
+ }
+ return (ElementFactoryList<Supports>)supports;
+ }
+
+ public List<String> getSupportedLocales()
+ {
+ if (supportedLocale == null)
+ {
+ supportedLocale = new ArrayList<String>();
+ }
+ return supportedLocale;
+ }
+
+ public String getResourceBundle()
+ {
+ return resourceBundle;
+ }
+
+ public void setResourceBundle(String value)
+ {
+ resourceBundle = value;
+ }
+
+ public PortletInfo getPortletInfo()
+ {
+ return getPortletInfo(false);
+ }
+
+ public PortletInfo getPortletInfo(boolean create)
+ {
+ if (create && portletInfo == null)
+ {
+ portletInfo = new PortletInfoType();
+ }
+ return portletInfo;
+ }
+
+ public PortletPreferences getPortletPreferences()
+ {
+ return getPortletPreferences(false);
+ }
+
+ public PortletPreferences getPortletPreferences(boolean create)
+ {
+ if (create && portletPreferences == null)
+ {
+ portletPreferences = new PortletPreferencesType();
+ }
+ return portletPreferences;
+ }
+
+ public ElementFactoryList<SecurityRoleRef> getSecurityRoleRefs()
+ {
+ if (securityRoleRef == null || !(securityRoleRef instanceof ElementFactoryList))
+ {
+ ElementFactoryList<SecurityRoleRef> lf =
+ new ElementFactoryList<SecurityRoleRef>( new ElementFactoryList.Factory<SecurityRoleRef>()
+ {
+ public Class<? extends SecurityRoleRef> getElementClass()
+ {
+ return SecurityRoleRefType.class;
+ }
+
+ public SecurityRoleRef newElement()
+ {
+ return new SecurityRoleRefType();
+ }
+ });
+ if (securityRoleRef != null)
+ {
+ lf.addAll(securityRoleRef);
+ }
+ securityRoleRef = lf;
+ }
+ return (ElementFactoryList<SecurityRoleRef>)securityRoleRef;
+ }
+
+ public ElementFactoryList<EventDefinitionReference> getSupportedProcessingEvents()
+ {
+ if (supportedProcessingEvent == null || !(supportedProcessingEvent instanceof ElementFactoryList))
+ {
+ ElementFactoryList<EventDefinitionReference> lf =
+ new ElementFactoryList<EventDefinitionReference>( new ElementFactoryList.Factory<EventDefinitionReference>()
+ {
+ public Class<? extends EventDefinitionReference> getElementClass()
+ {
+ return EventDefinitionReferenceType.class;
+ }
+
+ public EventDefinitionReference newElement()
+ {
+ return new EventDefinitionReferenceType();
+ }
+ });
+ if (supportedProcessingEvent != null)
+ {
+ lf.addAll(supportedProcessingEvent);
+ }
+ supportedProcessingEvent = lf;
+ }
+ return (ElementFactoryList<EventDefinitionReference>)supportedProcessingEvent;
+ }
+
+ public ElementFactoryList<EventDefinitionReference> getSupportedPublishingEvents()
+ {
+ if (supportedPublishingEvent == null || !(supportedPublishingEvent instanceof ElementFactoryList))
+ {
+ ElementFactoryList<EventDefinitionReference> lf =
+ new ElementFactoryList<EventDefinitionReference>( new ElementFactoryList.Factory<EventDefinitionReference>()
+ {
+ public Class<? extends EventDefinitionReference> getElementClass()
+ {
+ return EventDefinitionReferenceType.class;
+ }
+
+ public EventDefinitionReference newElement()
+ {
+ return new EventDefinitionReferenceType();
+ }
+ });
+ if (supportedPublishingEvent != null)
+ {
+ lf.addAll(supportedPublishingEvent);
+ }
+ supportedPublishingEvent = lf;
+ }
+ return (ElementFactoryList<EventDefinitionReference>)supportedPublishingEvent;
+ }
+
+ public List<String> getSupportedPublicRenderParameters()
+ {
+ if (supportedPublicRenderParameter == null)
+ {
+ supportedPublicRenderParameter = new ArrayList<String>();
+ }
+ return supportedPublicRenderParameter;
+ }
+
+ public ElementFactoryList<ContainerRuntimeOption> getContainerRuntimeOptions()
+ {
+ if (containerRuntimeOption == null || !(containerRuntimeOption instanceof ElementFactoryList))
+ {
+ ElementFactoryList<ContainerRuntimeOption> lf =
+ new ElementFactoryList<ContainerRuntimeOption>( new ElementFactoryList.Factory<ContainerRuntimeOption>()
+ {
+ public Class<? extends ContainerRuntimeOption> getElementClass()
+ {
+ return ContainerRuntimeOptionType.class;
+ }
+
+ public ContainerRuntimeOption newElement()
+ {
+ return new ContainerRuntimeOptionType();
+ }
+ });
+ if (containerRuntimeOption != null)
+ {
+ lf.addAll(containerRuntimeOption);
+ }
+ containerRuntimeOption = lf;
+ }
+ return (ElementFactoryList<ContainerRuntimeOption>)containerRuntimeOption;
+ }
+
+ public String getId()
+ {
+ return id;
+ }
+
+ public void setId(String value)
+ {
+ id = value;
+ }
+
+ public void setSupportedLocales(List<String> supportedLocales)
+ {
+ this.supportedLocale = supportedLocales;
+ }
+
+ public void setSupportedPublicRenderParameters(List<String> supportedPublicRenderParameters)
+ {
+ this.supportedPublicRenderParameter = supportedPublicRenderParameters;
+ }
+
+ public void afterUnmarshal(Unmarshaller u, Object parent) {
+ application = (PortletApp)parent;
+ }
+}
Propchange: portals/pluto/branches/2.0-spi-refactoring/pluto-descriptor-api/src/main/java/org/apache/pluto/descriptors/portlet20/PortletType.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: portals/pluto/branches/2.0-spi-refactoring/pluto-descriptor-api/src/main/java/org/apache/pluto/descriptors/portlet20/PreferenceType.java
URL: http://svn.apache.org/viewvc/portals/pluto/branches/2.0-spi-refactoring/pluto-descriptor-api/src/main/java/org/apache/pluto/descriptors/portlet20/PreferenceType.java?rev=704743&view=auto
==============================================================================
--- portals/pluto/branches/2.0-spi-refactoring/pluto-descriptor-api/src/main/java/org/apache/pluto/descriptors/portlet20/PreferenceType.java (added)
+++ portals/pluto/branches/2.0-spi-refactoring/pluto-descriptor-api/src/main/java/org/apache/pluto/descriptors/portlet20/PreferenceType.java Tue Oct 14 17:01:07 2008
@@ -0,0 +1,111 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.pluto.descriptors.portlet20;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+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.apache.pluto.om.portlet.PortletPreference;
+
+/**
+ * Persistent preference values that may be used for customization and personalization by the portlet. Used in:
+ * portlet-preferences <p>Java class for preferenceType complex type. <p>The following schema fragment specifies the
+ * expected content contained within this class.
+ *
+ * <pre>
+ * <complexType name="preferenceType">
+ * <complexContent>
+ * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ * <sequence>
+ * <element name="name" type="{http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd}nameType"/>
+ * <element name="value" type="{http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd}valueType" maxOccurs="unbounded" minOccurs="0"/>
+ * <element name="read-only" type="{http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd}read-onlyType" minOccurs="0"/>
+ * </sequence>
+ * <attribute name="id" type="{http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd}string" />
+ * </restriction>
+ * </complexContent>
+ * </complexType>
+ * </pre>
+ *
+ * @version $Id$
+ */
+@XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "preferenceType", propOrder = { "name", "value", "readOnly" })
+public class PreferenceType implements PortletPreference
+{
+ @XmlElement(required = true)
+ @XmlJavaTypeAdapter(value=CollapsedStringAdapter.class)
+ protected String name;
+ @XmlJavaTypeAdapter(value=CollapsedStringAdapter.class)
+ protected List<String> value;
+ @XmlElement(name = "read-only")
+ protected Boolean readOnly;
+ @XmlAttribute
+ protected String id;
+
+ public String getName()
+ {
+ return name;
+ }
+
+ public void setName(String value)
+ {
+ name = value;
+ }
+
+ public List<String> getValues()
+ {
+ if (value == null)
+ {
+ value = new ArrayList<String>();
+ }
+ return value;
+ }
+
+ public boolean isReadOnly()
+ {
+ return readOnly != null ? readOnly.booleanValue() : false;
+ }
+
+ public void setReadOnly(boolean value)
+ {
+ readOnly = value ? Boolean.TRUE : Boolean.FALSE;
+ }
+
+ public String getId()
+ {
+ return id;
+ }
+
+ public void setId(String value)
+ {
+ id = value;
+ }
+
+ public void setValues(List<String> value)
+ {
+ this.value = value;
+ }
+}
Propchange: portals/pluto/branches/2.0-spi-refactoring/pluto-descriptor-api/src/main/java/org/apache/pluto/descriptors/portlet20/PreferenceType.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: portals/pluto/branches/2.0-spi-refactoring/pluto-descriptor-api/src/main/java/org/apache/pluto/descriptors/portlet20/PublicRenderParameterType.java
URL: http://svn.apache.org/viewvc/portals/pluto/branches/2.0-spi-refactoring/pluto-descriptor-api/src/main/java/org/apache/pluto/descriptors/portlet20/PublicRenderParameterType.java?rev=704743&view=auto
==============================================================================
--- portals/pluto/branches/2.0-spi-refactoring/pluto-descriptor-api/src/main/java/org/apache/pluto/descriptors/portlet20/PublicRenderParameterType.java (added)
+++ portals/pluto/branches/2.0-spi-refactoring/pluto-descriptor-api/src/main/java/org/apache/pluto/descriptors/portlet20/PublicRenderParameterType.java Tue Oct 14 17:01:07 2008
@@ -0,0 +1,158 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.pluto.descriptors.portlet20;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlAttribute;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlSchemaType;
+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.apache.pluto.om.ElementFactoryList;
+import org.apache.pluto.om.common.Description;
+import org.apache.pluto.om.portlet.PublicRenderParameter;
+
+/**
+ * The public-render-parameters defines a render parameter that is allowed to be public and thus be shared with other
+ * portlets. The identifier must be used for referencing this public render parameter in the portlet code. Used in:
+ * portlet-app <p>Java class for public-render-parameterType complex type. <p>The following schema fragment specifies
+ * the expected content contained within this class.
+ *
+ * <pre>
+ * <complexType name="public-render-parameterType">
+ * <complexContent>
+ * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ * <sequence>
+ * <element name="description" type="{http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd}descriptionType" maxOccurs="unbounded" minOccurs="0"/>
+ * <element name="identifier" type="{http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd}string"/>
+ * <choice>
+ * <element name="qname" type="{http://www.w3.org/2001/XMLSchema}QName"/>
+ * <element name="name" type="{http://www.w3.org/2001/XMLSchema}NCName"/>
+ * </choice>
+ * <element name="alias" type="{http://www.w3.org/2001/XMLSchema}QName" maxOccurs="unbounded" minOccurs="0"/>
+ * </sequence>
+ * <attribute name="id" type="{http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd}string" />
+ * </restriction>
+ * </complexContent>
+ * </complexType>
+ * </pre>
+ *
+ * @version $Id$
+ */
+@XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "public-render-parameterType", propOrder = { "description", "identifier", "qname", "name", "alias" })
+public class PublicRenderParameterType implements PublicRenderParameter
+{
+ @XmlElement(name = "description", type=DescriptionType.class)
+ protected List<Description> description;
+ @XmlElement(required = true)
+ protected String identifier;
+ protected QName qname;
+ @XmlJavaTypeAdapter(CollapsedStringAdapter.class)
+ @XmlSchemaType(name = "NCName")
+ protected String name;
+ protected List<QName> alias;
+ @XmlAttribute
+ protected String id;
+
+ public ElementFactoryList<Description> getDescriptions()
+ {
+ if (description == null || !(description instanceof ElementFactoryList))
+ {
+ ElementFactoryList<Description> lf =
+ new ElementFactoryList<Description>( new ElementFactoryList.Factory<Description>()
+ {
+ public Class<? extends Description> getElementClass()
+ {
+ return DescriptionType.class;
+ }
+
+ public Description newElement()
+ {
+ return new DescriptionType();
+ }
+ });
+ if (description != null)
+ {
+ lf.addAll(description);
+ }
+ description = lf;
+ }
+ return (ElementFactoryList<Description>)description;
+ }
+
+ public String getIdentifier()
+ {
+ return identifier;
+ }
+
+ public void setIdentifier(String value)
+ {
+ identifier = value;
+ }
+
+ public QName getQName()
+ {
+ return qname;
+ }
+
+ public void setQName(QName value)
+ {
+ qname = value;
+ }
+
+ public String getName()
+ {
+ return name;
+ }
+
+ public void setName(String value)
+ {
+ name = value;
+ }
+
+ public List<QName> getAliases()
+ {
+ if (alias == null)
+ {
+ alias = new ArrayList<QName>();
+ }
+ return alias;
+ }
+
+ public String getId()
+ {
+ return id;
+ }
+
+ public void setId(String value)
+ {
+ id = value;
+ }
+
+ public void setAliases(List<QName> aliases)
+ {
+ this.alias = aliases;
+ }
+}
Propchange: portals/pluto/branches/2.0-spi-refactoring/pluto-descriptor-api/src/main/java/org/apache/pluto/descriptors/portlet20/PublicRenderParameterType.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: portals/pluto/branches/2.0-spi-refactoring/pluto-descriptor-api/src/main/java/org/apache/pluto/descriptors/portlet20/SecurityConstraintType.java
URL: http://svn.apache.org/viewvc/portals/pluto/branches/2.0-spi-refactoring/pluto-descriptor-api/src/main/java/org/apache/pluto/descriptors/portlet20/SecurityConstraintType.java?rev=704743&view=auto
==============================================================================
--- portals/pluto/branches/2.0-spi-refactoring/pluto-descriptor-api/src/main/java/org/apache/pluto/descriptors/portlet20/SecurityConstraintType.java (added)
+++ portals/pluto/branches/2.0-spi-refactoring/pluto-descriptor-api/src/main/java/org/apache/pluto/descriptors/portlet20/SecurityConstraintType.java Tue Oct 14 17:01:07 2008
@@ -0,0 +1,121 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.pluto.descriptors.portlet20;
+
+import java.util.List;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlAttribute;
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlType;
+
+import org.apache.pluto.om.ElementFactoryList;
+import org.apache.pluto.om.common.DisplayName;
+import org.apache.pluto.om.common.UserDataConstraint;
+import org.apache.pluto.om.portlet.PortletCollection;
+import org.apache.pluto.om.portlet.SecurityConstraint;
+
+/**
+ * The security-constraintType is used to associate intended security constraints with one or more portlets. Used in:
+ * portlet-app <p>Java class for security-constraintType complex type. <p>The following schema fragment specifies the
+ * expected content contained within this class.
+ *
+ * <pre>
+ * <complexType name="security-constraintType">
+ * <complexContent>
+ * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ * <sequence>
+ * <element name="display-name" type="{http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd}display-nameType" maxOccurs="unbounded" minOccurs="0"/>
+ * <element name="portlet-collection" type="{http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd}portlet-collectionType"/>
+ * <element name="user-data-constraint" type="{http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd}user-data-constraintType"/>
+ * </sequence>
+ * <attribute name="id" type="{http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd}string" />
+ * </restriction>
+ * </complexContent>
+ * </complexType>
+ * </pre>
+ *
+ * @version $Id$
+ */
+@XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "security-constraintType", propOrder = { "displayName", "portletCollection", "userDataConstraint" })
+public class SecurityConstraintType implements SecurityConstraint
+{
+ @XmlElement(name = "display-name", type=DisplayNameType.class)
+ protected List<DisplayName> displayName;
+ @XmlElement(name = "portlet-collection", required = true)
+ protected PortletCollectionType portletCollection;
+ @XmlElement(name = "user-data-constraint", required = true)
+ protected UserDataConstraintType userDataConstraint;
+ @XmlAttribute
+ protected String id;
+
+ public ElementFactoryList<DisplayName> getDisplayNames()
+ {
+ if (displayName == null || !(displayName instanceof ElementFactoryList))
+ {
+ ElementFactoryList<DisplayName> lf =
+ new ElementFactoryList<DisplayName>( new ElementFactoryList.Factory<DisplayName>()
+ {
+ public Class<? extends DisplayName> getElementClass()
+ {
+ return DisplayNameType.class;
+ }
+
+ public DisplayName newElement()
+ {
+ return new DisplayNameType();
+ }
+ });
+ if (displayName != null)
+ {
+ lf.addAll(displayName);
+ }
+ displayName = lf;
+ }
+ return (ElementFactoryList<DisplayName>)displayName;
+ }
+
+ public PortletCollection getPortletCollection()
+ {
+ if (portletCollection == null)
+ {
+ portletCollection = new PortletCollectionType();
+ }
+ return portletCollection;
+ }
+
+ public UserDataConstraint getUserDataConstraint()
+ {
+ if (userDataConstraint == null)
+ {
+ userDataConstraint = new UserDataConstraintType();
+ }
+ return userDataConstraint;
+ }
+
+ public String getId()
+ {
+ return id;
+ }
+
+ public void setId(String value)
+ {
+ id = value;
+ }
+}
Propchange: portals/pluto/branches/2.0-spi-refactoring/pluto-descriptor-api/src/main/java/org/apache/pluto/descriptors/portlet20/SecurityConstraintType.java
------------------------------------------------------------------------------
svn:eol-style = native
Copied: portals/pluto/branches/2.0-spi-refactoring/pluto-descriptor-api/src/main/java/org/apache/pluto/descriptors/portlet20/SecurityRoleRefType.java (from r702850, portals/pluto/branches/2.0-spi-refactoring/pluto-descriptor-api/src/main/java/org/apache/pluto/descriptors/common/SecurityRoleRefDD.java)
URL: http://svn.apache.org/viewvc/portals/pluto/branches/2.0-spi-refactoring/pluto-descriptor-api/src/main/java/org/apache/pluto/descriptors/portlet20/SecurityRoleRefType.java?p2=portals/pluto/branches/2.0-spi-refactoring/pluto-descriptor-api/src/main/java/org/apache/pluto/descriptors/portlet20/SecurityRoleRefType.java&p1=portals/pluto/branches/2.0-spi-refactoring/pluto-descriptor-api/src/main/java/org/apache/pluto/descriptors/common/SecurityRoleRefDD.java&r1=702850&r2=704743&rev=704743&view=diff
==============================================================================
--- portals/pluto/branches/2.0-spi-refactoring/pluto-descriptor-api/src/main/java/org/apache/pluto/descriptors/common/SecurityRoleRefDD.java (original)
+++ portals/pluto/branches/2.0-spi-refactoring/pluto-descriptor-api/src/main/java/org/apache/pluto/descriptors/portlet20/SecurityRoleRefType.java Tue Oct 14 17:01:07 2008
@@ -14,174 +14,116 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.pluto.descriptors.common;
+package org.apache.pluto.descriptors.portlet20;
import java.util.List;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
+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.apache.pluto.om.ElementFactoryList;
+import org.apache.pluto.om.common.Description;
import org.apache.pluto.om.common.SecurityRoleRef;
-import org.apache.pluto.om.portlet.Portlet;
/**
- * Security Role Reference Configuration.
- *
- * @version $Id: SecurityRoleRefDD.java 157038 2005-03-11 03:44:40Z ddewolf $
- * @since Feb 28, 2005
- *
- *
- * The security-role-ref element contains the declaration of a
- * security role reference in the code of the web application. The
- * declaration consists of an optional description, the security
- * role name used in the code, and an optional link to a security
- * role. If the security role is not specified, the Deployer must
- * choose an appropriate security role.
- * The value of the role name element must be the String used
- * as the parameter to the
- * EJBContext.isCallerInRole(String roleName) method
- * or the HttpServletRequest.isUserInRole(String role) method.
- * Used in: portlet
- *
- *
- * <p>Java class for security-role-refType complex type.
- *
- * <p>The following schema fragment specifies the expected content contained within this class.
+ * The security-role-ref element contains the declaration of a security role reference in the code of the web
+ * application. The declaration consists of an optional description, the security role name used in the code, and an
+ * optional link to a security role. If the security role is not specified, the Deployer must choose an appropriate
+ * security role. The value of the role name element must be the String used as the parameter to the
+ * EJBContext.isCallerInRole(String roleName) method or the HttpServletRequest.isUserInRole(String role) method. Used
+ * in: portlet <p>Java class for security-role-refType complex type. <p>The following schema fragment specifies the
+ * expected content contained within this class.
*
* <pre>
- * <complexType name="security-role-refType">
- * <complexContent>
- * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- * <sequence>
- * <element name="description" type="{http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd}descriptionType" maxOccurs="unbounded" minOccurs="0"/>
- * <element name="role-name" type="{http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd}role-nameType"/>
- * <element name="role-link" type="{http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd}role-linkType" minOccurs="0"/>
- * </sequence>
- * <attribute name="id" type="{http://www.w3.org/2001/XMLSchema}string" />
- * </restriction>
- * </complexContent>
- * </complexType>
+ * <complexType name="security-role-refType">
+ * <complexContent>
+ * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ * <sequence>
+ * <element name="description" type="{http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd}descriptionType" maxOccurs="unbounded" minOccurs="0"/>
+ * <element name="role-name" type="{http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd}role-nameType"/>
+ * <element name="role-link" type="{http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd}role-linkType" minOccurs="0"/>
+ * </sequence>
+ * <attribute name="id" type="{http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd}string" />
+ * </restriction>
+ * </complexContent>
+ * </complexType>
* </pre>
*
- *
- */
+ * @version $Id$
+*/
@XmlAccessorType(XmlAccessType.FIELD)
-@XmlType(name = "security-role-refType", propOrder = {
- "description","description1",
- "roleName","roleName1",
- "roleLink","roleLink1",
- "descriptions", "descriptions1"
-})
-
-public class SecurityRoleRefDD implements SecurityRoleRef {
-
- /** The description of what the role is utilized for. */
- @XmlElement( name = "description")
- private String description;
-
- /** The description of what the role is utilized for. */
- @XmlElement( name = "description", namespace = Portlet.QNAME_JSR168)
- private String description1;
-
- /** The description list. */
- @XmlElement(name = "descriptions")
- private List<String> descriptions;
-
- /** The description list. */
- @XmlElement(name = "descriptions", namespace = Portlet.QNAME_JSR168)
- private List descriptions1;
-
- /** The name of the role reference. */
- @XmlElement( name = "role-name")
- private String roleName;
-
- /** The name of the role reference. */
- @XmlElement( name = "role-name", namespace = Portlet.QNAME_JSR168)
- private String roleName1;
-
- /** The role to which the reference is linked. */
- @XmlElement( name = "role-link")
- private String roleLink;
-
- /** The role to which the reference is linked. */
- @XmlElement( name = "role-link", namespace = Portlet.QNAME_JSR168)
- private String roleLink1;
-
- /**
- * Default Constructor.
- */
- public SecurityRoleRefDD() {
-
- }
-
- /* (non-Javadoc)
- * @see org.apache.pluto.descriptors.common.SecurityRoleRef#getRoleName()
- */
- public String getRoleName() {
- if (roleName != null)
- return roleName;
- return roleName1;
- }
-
- /* (non-Javadoc)
- * @see org.apache.pluto.descriptors.common.SecurityRoleRef#setRoleName(java.lang.String)
- */
- public void setRoleName(String roleName) {
- this.roleName = roleName;
- this.roleName1 = roleName;
- }
-
- /* (non-Javadoc)
- * @see org.apache.pluto.descriptors.common.SecurityRoleRef#getRoleLink()
- */
- public String getRoleLink() {
- if (roleLink != null)
- return roleLink;
- return roleLink1;
- }
-
- /* (non-Javadoc)
- * @see org.apache.pluto.descriptors.common.SecurityRoleRef#setRoleLink(java.lang.String)
- */
- public void setRoleLink(String roleLink) {
- this.roleLink = roleLink;
- this.roleLink1 = roleLink;
- }
-
- /* (non-Javadoc)
- * @see org.apache.pluto.descriptors.common.SecurityRoleRef#getDescription()
- */
- public String getDescription() {
- if (description != null)
- return description;
- return description1;
- }
-
- /* (non-Javadoc)
- * @see org.apache.pluto.descriptors.common.SecurityRoleRef#setDescription(java.lang.String)
- */
- public void setDescription(String description) {
- this.description = description;
- this.description1 = description;
- }
-
- /* (non-Javadoc)
- * @see org.apache.pluto.descriptors.common.SecurityRoleRef#getDescriptions()
- */
- public List getDescriptions() {
- if (descriptions != null)
- return descriptions;
- return descriptions1;
- }
-
- /* (non-Javadoc)
- * @see org.apache.pluto.descriptors.common.SecurityRoleRef#setDescriptions(java.util.List)
- */
- public void setDescriptions(List<String> descriptions) {
- this.descriptions = descriptions;
- this.descriptions1 = descriptions;
+@XmlType(name = "security-role-refType", propOrder = { "description", "roleName", "roleLink" })
+public class SecurityRoleRefType implements SecurityRoleRef
+{
+ @XmlElement(name = "description", type=DescriptionType.class)
+ protected List<Description> description;
+ @XmlElement(name = "role-name", required = true)
+ @XmlJavaTypeAdapter(CollapsedStringAdapter.class)
+ protected String roleName;
+ @XmlElement(name = "role-link")
+ @XmlJavaTypeAdapter(value=CollapsedStringAdapter.class)
+ protected String roleLink;
+ @XmlAttribute
+ protected String id;
+
+ public ElementFactoryList<Description> getDescriptions()
+ {
+ if (description == null || !(description instanceof ElementFactoryList))
+ {
+ ElementFactoryList<Description> lf =
+ new ElementFactoryList<Description>( new ElementFactoryList.Factory<Description>()
+ {
+ public Class<? extends Description> getElementClass()
+ {
+ return DescriptionType.class;
+ }
+
+ public Description newElement()
+ {
+ return new DescriptionType();
+ }
+ });
+ if (description != null)
+ {
+ lf.addAll(description);
+ }
+ description = lf;
+ }
+ return (ElementFactoryList<Description>)description;
+ }
+
+ public String getRoleName()
+ {
+ return roleName;
+ }
+
+ public void setRoleName(String value)
+ {
+ roleName = value;
+ }
+
+ public String getRoleLink()
+ {
+ return roleLink;
+ }
+
+ public void setRoleLink(String value)
+ {
+ roleLink = value;
+ }
+
+ public String getId()
+ {
+ return id;
+ }
+
+ public void setId(String value)
+ {
+ id = value;
}
}
-
Propchange: portals/pluto/branches/2.0-spi-refactoring/pluto-descriptor-api/src/main/java/org/apache/pluto/descriptors/portlet20/SecurityRoleRefType.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: portals/pluto/branches/2.0-spi-refactoring/pluto-descriptor-api/src/main/java/org/apache/pluto/descriptors/portlet20/SupportsType.java
URL: http://svn.apache.org/viewvc/portals/pluto/branches/2.0-spi-refactoring/pluto-descriptor-api/src/main/java/org/apache/pluto/descriptors/portlet20/SupportsType.java?rev=704743&view=auto
==============================================================================
--- portals/pluto/branches/2.0-spi-refactoring/pluto-descriptor-api/src/main/java/org/apache/pluto/descriptors/portlet20/SupportsType.java (added)
+++ portals/pluto/branches/2.0-spi-refactoring/pluto-descriptor-api/src/main/java/org/apache/pluto/descriptors/portlet20/SupportsType.java Tue Oct 14 17:01:07 2008
@@ -0,0 +1,117 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.pluto.descriptors.portlet20;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+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.apache.pluto.om.portlet.Supports;
+
+/**
+ * Supports indicates the portlet modes a portlet supports for a specific content type. All portlets must support the
+ * view mode. Used in: portlet <p>Java class for supportsType complex type. <p>The following schema fragment specifies
+ * the expected content contained within this class.
+ *
+ * <pre>
+ * <complexType name="supportsType">
+ * <complexContent>
+ * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ * <sequence>
+ * <element name="mime-type" type="{http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd}mime-typeType"/>
+ * <element name="portlet-mode" type="{http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd}portlet-modeType" maxOccurs="unbounded" minOccurs="0"/>
+ * <element name="window-state" type="{http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd}window-stateType" maxOccurs="unbounded" minOccurs="0"/>
+ * </sequence>
+ * <attribute name="id" type="{http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd}string" />
+ * </restriction>
+ * </complexContent>
+ * </complexType>
+ * </pre>
+ *
+ * @version $Id$
+ */
+@XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "supportsType", propOrder = { "mimeType", "portletMode", "windowState" })
+public class SupportsType implements Supports
+{
+ @XmlElement(name = "mime-type", required = true)
+ @XmlJavaTypeAdapter(value=CollapsedStringAdapter.class)
+ protected String mimeType;
+ @XmlElement(name = "portlet-mode")
+ @XmlJavaTypeAdapter(value=CollapsedStringAdapter.class)
+ protected List<String> portletMode;
+ @XmlElement(name = "window-state")
+ @XmlJavaTypeAdapter(value=CollapsedStringAdapter.class)
+ protected List<String> windowState;
+ @XmlAttribute
+ protected String id;
+
+ public String getMimeType()
+ {
+ return mimeType;
+ }
+
+ public void setMimeType(String value)
+ {
+ mimeType = value;
+ }
+
+ public List<String> getPortletModes()
+ {
+ if (portletMode == null)
+ {
+ portletMode = new ArrayList<String>();
+ }
+ return portletMode;
+ }
+
+ public List<String> getWindowState()
+ {
+ if (windowState == null)
+ {
+ windowState = new ArrayList<String>();
+ }
+ return windowState;
+ }
+
+ public String getId()
+ {
+ return id;
+ }
+
+ public void setId(String value)
+ {
+ id = value;
+ }
+
+ public void setPortletModes(List<String> portletModes)
+ {
+ this.portletMode = portletModes;
+ }
+
+ public void setWindowStates(List<String> windowStates)
+ {
+ this.windowState = windowStates;
+ }
+}
Propchange: portals/pluto/branches/2.0-spi-refactoring/pluto-descriptor-api/src/main/java/org/apache/pluto/descriptors/portlet20/SupportsType.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: portals/pluto/branches/2.0-spi-refactoring/pluto-descriptor-api/src/main/java/org/apache/pluto/descriptors/portlet20/UserAttributeType.java
URL: http://svn.apache.org/viewvc/portals/pluto/branches/2.0-spi-refactoring/pluto-descriptor-api/src/main/java/org/apache/pluto/descriptors/portlet20/UserAttributeType.java?rev=704743&view=auto
==============================================================================
--- portals/pluto/branches/2.0-spi-refactoring/pluto-descriptor-api/src/main/java/org/apache/pluto/descriptors/portlet20/UserAttributeType.java (added)
+++ portals/pluto/branches/2.0-spi-refactoring/pluto-descriptor-api/src/main/java/org/apache/pluto/descriptors/portlet20/UserAttributeType.java Tue Oct 14 17:01:07 2008
@@ -0,0 +1,112 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.pluto.descriptors.portlet20;
+
+import java.util.List;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+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.apache.pluto.om.ElementFactoryList;
+import org.apache.pluto.om.common.Description;
+import org.apache.pluto.om.portlet.UserAttribute;
+
+/**
+ * User attribute defines a user specific attribute that the portlet application needs. The portlet within this
+ * application can access this attribute via the request parameter USER_INFO map. Used in: portlet-app <p>Java class
+ * for user-attributeType complex type. <p>The following schema fragment specifies the expected content contained
+ * within this class.
+ *
+ * <pre>
+ * <complexType name="user-attributeType">
+ * <complexContent>
+ * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ * <sequence>
+ * <element name="description" type="{http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd}descriptionType" maxOccurs="unbounded" minOccurs="0"/>
+ * <element name="name" type="{http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd}nameType"/>
+ * </sequence>
+ * <attribute name="id" type="{http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd}string" />
+ * </restriction>
+ * </complexContent>
+ * </complexType>
+ * </pre>
+ *
+ * @version $Id$
+ */
+@XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "user-attributeType", propOrder = { "description", "name" })
+public class UserAttributeType implements UserAttribute
+{
+ @XmlElement(name = "description", type=DescriptionType.class)
+ protected List<Description> description;
+ @XmlElement(required = true)
+ @XmlJavaTypeAdapter(value=CollapsedStringAdapter.class)
+ protected String name;
+ @XmlAttribute
+ protected String id;
+
+ public ElementFactoryList<Description> getDescriptions()
+ {
+ if (description == null || !(description instanceof ElementFactoryList))
+ {
+ ElementFactoryList<Description> lf =
+ new ElementFactoryList<Description>( new ElementFactoryList.Factory<Description>()
+ {
+ public Class<? extends Description> getElementClass()
+ {
+ return DescriptionType.class;
+ }
+
+ public Description newElement()
+ {
+ return new DescriptionType();
+ }
+ });
+ if (description != null)
+ {
+ lf.addAll(description);
+ }
+ description = lf;
+ }
+ return (ElementFactoryList<Description>)description;
+ }
+
+ public String getName()
+ {
+ return name;
+ }
+
+ public void setName(String value)
+ {
+ name = value;
+ }
+
+ public String getId()
+ {
+ return id;
+ }
+
+ public void setId(String value)
+ {
+ id = value;
+ }
+}
Propchange: portals/pluto/branches/2.0-spi-refactoring/pluto-descriptor-api/src/main/java/org/apache/pluto/descriptors/portlet20/UserAttributeType.java
------------------------------------------------------------------------------
svn:eol-style = native
Copied: portals/pluto/branches/2.0-spi-refactoring/pluto-descriptor-api/src/main/java/org/apache/pluto/descriptors/portlet20/UserDataConstraintType.java (from r702850, portals/pluto/branches/2.0-spi-refactoring/pluto-descriptor-api/src/main/java/org/apache/pluto/descriptors/common/UserDataConstraintDD.java)
URL: http://svn.apache.org/viewvc/portals/pluto/branches/2.0-spi-refactoring/pluto-descriptor-api/src/main/java/org/apache/pluto/descriptors/portlet20/UserDataConstraintType.java?p2=portals/pluto/branches/2.0-spi-refactoring/pluto-descriptor-api/src/main/java/org/apache/pluto/descriptors/portlet20/UserDataConstraintType.java&p1=portals/pluto/branches/2.0-spi-refactoring/pluto-descriptor-api/src/main/java/org/apache/pluto/descriptors/common/UserDataConstraintDD.java&r1=702850&r2=704743&rev=704743&view=diff
==============================================================================
--- portals/pluto/branches/2.0-spi-refactoring/pluto-descriptor-api/src/main/java/org/apache/pluto/descriptors/common/UserDataConstraintDD.java (original)
+++ portals/pluto/branches/2.0-spi-refactoring/pluto-descriptor-api/src/main/java/org/apache/pluto/descriptors/portlet20/UserDataConstraintType.java Tue Oct 14 17:01:07 2008
@@ -14,84 +14,98 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.pluto.descriptors.common;
+package org.apache.pluto.descriptors.portlet20;
-import java.util.ArrayList;
import java.util.List;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
+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.apache.pluto.om.ElementFactoryList;
+import org.apache.pluto.om.common.Description;
import org.apache.pluto.om.common.UserDataConstraint;
-import org.apache.pluto.om.portlet.Portlet;
/**
- * User Data Constraint descriptor.
- *
- * @version $Id: UserDataConstraintDD.java 156636 2005-03-09 12:16:31Z cziegeler $
- * @since Feb 28, 2005
+ * The user-data-constraintType is used to indicate how data communicated between the client and portlet should be
+ * protected. Used in: security-constraint <p>Java class for user-data-constraintType complex type. <p>The following
+ * schema fragment specifies the expected content contained within this class.
*
- * TODO: Convert TransportGuarantee to a Java 5 enum
- * and annotate with @XmlEnum(String.class)
+ * <pre>
+ * <complexType name="user-data-constraintType">
+ * <complexContent>
+ * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ * <sequence>
+ * <element name="description" type="{http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd}descriptionType" maxOccurs="unbounded" minOccurs="0"/>
+ * <element name="transport-guarantee" type="{http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd}transport-guaranteeType"/>
+ * </sequence>
+ * <attribute name="id" type="{http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd}string" />
+ * </restriction>
+ * </complexContent>
+ * </complexType>
+ * </pre>
+ *
+ * @version $Id$
*/
@XmlAccessorType(XmlAccessType.FIELD)
-@XmlType(name = "user-data-constraintType", propOrder = {
- "descriptions","descriptions1",
- "transportGuarantee", "transportGuarantee1"
-})
-public class UserDataConstraintDD implements UserDataConstraint {
-
- @XmlElement(name = "description")
- private List<String> descriptions = new ArrayList<String>();
-
- @XmlElement(name = "description", namespace = Portlet.QNAME_JSR168)
- private List<String> descriptions1 = new ArrayList<String>();
-
- @XmlElement(name = "transport-guarantee")
- private String transportGuarantee;
-
- @XmlElement(name = "transport-guarantee", namespace = Portlet.QNAME_JSR168)
- private String transportGuarantee1 = null;
-
- public UserDataConstraintDD() {
-
+@XmlType(name = "user-data-constraintType", propOrder = { "description", "transportGuarantee" })
+public class UserDataConstraintType implements UserDataConstraint
+{
+ @XmlElement(name = "description", type=DescriptionType.class)
+ protected List<Description> description;
+ @XmlElement(name = "transport-guarantee", required = true)
+ @XmlJavaTypeAdapter(value=CollapsedStringAdapter.class)
+ protected String transportGuarantee;
+ @XmlAttribute
+ protected String id;
+
+ public ElementFactoryList<Description> getDescriptions()
+ {
+ if (description == null || !(description instanceof ElementFactoryList))
+ {
+ ElementFactoryList<Description> lf =
+ new ElementFactoryList<Description>( new ElementFactoryList.Factory<Description>()
+ {
+ public Class<? extends Description> getElementClass()
+ {
+ return DescriptionType.class;
+ }
+
+ public Description newElement()
+ {
+ return new DescriptionType();
+ }
+ });
+ if (description != null)
+ {
+ lf.addAll(description);
+ }
+ description = lf;
+ }
+ return (ElementFactoryList<Description>)description;
}
- /* (non-Javadoc)
- * @see org.apache.pluto.descriptors.common.UserDataConstraint#getDescriptions()
- */
- public List<String> getDescriptions() {
- if (descriptions.size() > 0)
- return descriptions;
- return descriptions1;
+ public String getTransportGuarantee()
+ {
+ return transportGuarantee;
}
- /* (non-Javadoc)
- * @see org.apache.pluto.descriptors.common.UserDataConstraint#setDescriptions(java.util.List)
- */
- public void setDescriptions(List<String> descriptions) {
- this.descriptions = descriptions;
- this.descriptions1 = descriptions;
+ public void setTransportGuarantee(String value)
+ {
+ transportGuarantee = value;
}
- /* (non-Javadoc)
- * @see org.apache.pluto.descriptors.common.UserDataConstraint#getTransportGuarantee()
- */
- public String getTransportGuarantee() {
- if (transportGuarantee != null)
- return transportGuarantee;
- return transportGuarantee1;
+ public String getId()
+ {
+ return id;
}
- /* (non-Javadoc)
- * @see org.apache.pluto.descriptors.common.UserDataConstraint#setTransportGuarantee(java.lang.String)
- */
- public void setTransportGuarantee(String transportGuarantee) {
- this.transportGuarantee = transportGuarantee;
- this.transportGuarantee1 = transportGuarantee;
+ public void setId(String value)
+ {
+ id = value;
}
-
}
-
Propchange: portals/pluto/branches/2.0-spi-refactoring/pluto-descriptor-api/src/main/java/org/apache/pluto/descriptors/portlet20/UserDataConstraintType.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: portals/pluto/branches/2.0-spi-refactoring/pluto-descriptor-api/src/main/java/org/apache/pluto/descriptors/portlet20/package-info.java
URL: http://svn.apache.org/viewvc/portals/pluto/branches/2.0-spi-refactoring/pluto-descriptor-api/src/main/java/org/apache/pluto/descriptors/portlet20/package-info.java?rev=704743&r1=702850&r2=704743&view=diff
==============================================================================
--- portals/pluto/branches/2.0-spi-refactoring/pluto-descriptor-api/src/main/java/org/apache/pluto/descriptors/portlet20/package-info.java (original)
+++ portals/pluto/branches/2.0-spi-refactoring/pluto-descriptor-api/src/main/java/org/apache/pluto/descriptors/portlet20/package-info.java Tue Oct 14 17:01:07 2008
@@ -1,9 +1,21 @@
-//
-// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.0.2-b01-fcs
-// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
-// Any modifications to this file will be lost upon recompilation of the source schema.
-// Generated on: 2006.12.18 at 11:28:54 AM CET
-//
-
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * @version $Id$
+ */
@javax.xml.bind.annotation.XmlSchema(namespace = "http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd", elementFormDefault = javax.xml.bind.annotation.XmlNsForm.QUALIFIED)
-package org.apache.pluto.descriptors.portlet;
+package org.apache.pluto.descriptors.portlet20;
+
Modified: portals/pluto/branches/2.0-spi-refactoring/pluto-descriptor-impl/pom.xml
URL: http://svn.apache.org/viewvc/portals/pluto/branches/2.0-spi-refactoring/pluto-descriptor-impl/pom.xml?rev=704743&r1=704742&r2=704743&view=diff
==============================================================================
--- portals/pluto/branches/2.0-spi-refactoring/pluto-descriptor-impl/pom.xml (original)
+++ portals/pluto/branches/2.0-spi-refactoring/pluto-descriptor-impl/pom.xml Tue Oct 14 17:01:07 2008
@@ -63,37 +63,6 @@
</dependency>
<dependency>
- <groupId>org.codehaus.castor</groupId>
- <artifactId>castor</artifactId>
- <version>${castor.version}</version>
- <scope>compile</scope>
- </dependency>
-
- <dependency>
- <groupId>xerces</groupId>
- <artifactId>xercesImpl</artifactId>
- <version>${xerces.version}</version>
- <scope>compile</scope>
- </dependency>
- <dependency>
- <groupId>xerces</groupId>
- <artifactId>xmlParserAPIs</artifactId>
- <version>${xerces.version}</version>
- <scope>compile</scope>
- </dependency>
- <dependency>
- <groupId>commons-logging</groupId>
- <artifactId>commons-logging-api</artifactId>
- <version>${commons-logging.version}</version>
- <scope>compile</scope>
- </dependency>
- <dependency>
- <groupId>commons-logging</groupId>
- <artifactId>commons-logging</artifactId>
- <version>${commons-logging.version}</version>
- <scope>test</scope>
- </dependency>
- <dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>${junit.version}</version>
@@ -112,12 +81,6 @@
<scope>compile</scope>
</dependency>
<dependency>
- <groupId>xalan</groupId>
- <artifactId>xalan</artifactId>
- <version>${xalan.version}</version>
- <scope>compile</scope>
- </dependency>
- <dependency>
<groupId>javax.activation</groupId>
<artifactId>activation</artifactId>
<version>${activation.version}</version>
Modified: portals/pluto/branches/2.0-spi-refactoring/pluto-descriptor-impl/src/main/java/org/apache/pluto/descriptors/services/jaxb/PortletAppDescriptorServiceImpl.java
URL: http://svn.apache.org/viewvc/portals/pluto/branches/2.0-spi-refactoring/pluto-descriptor-impl/src/main/java/org/apache/pluto/descriptors/services/jaxb/PortletAppDescriptorServiceImpl.java?rev=704743&r1=704742&r2=704743&view=diff
==============================================================================
--- portals/pluto/branches/2.0-spi-refactoring/pluto-descriptor-impl/src/main/java/org/apache/pluto/descriptors/services/jaxb/PortletAppDescriptorServiceImpl.java (original)
+++ portals/pluto/branches/2.0-spi-refactoring/pluto-descriptor-impl/src/main/java/org/apache/pluto/descriptors/services/jaxb/PortletAppDescriptorServiceImpl.java Tue Oct 14 17:01:07 2008
@@ -7,6 +7,7 @@
import javax.xml.bind.JAXBContext;
import javax.xml.bind.JAXBElement;
import javax.xml.bind.JAXBException;
+import javax.xml.bind.Marshaller;
import javax.xml.bind.Unmarshaller;
import org.apache.pluto.descriptors.services.PortletAppDescriptorService;
@@ -26,12 +27,13 @@
* @throws java.io.IOException
*/
+ @SuppressWarnings("unchecked")
public PortletApp read(InputStream in) throws IOException {
JAXBElement<PortletApp> portletApp = null;
try {
JAXBContext jc = JAXBContext.newInstance(
- "org.apache.pluto.descriptors.portlet" + ":" +
- "org.apache.pluto.descriptors.common");
+ "org.apache.pluto.descriptors.portlet10" + ":" +
+ "org.apache.pluto.descriptors.portlet20");
Unmarshaller u = jc.createUnmarshaller();
u.setEventHandler(new javax.xml.bind.helpers.DefaultValidationEventHandler());
@@ -54,6 +56,26 @@
* @throws java.io.IOException
*/
public void write(PortletApp portlet, OutputStream out) throws IOException {
- throw new UnsupportedOperationException("writing jaxb content not yet supported");
+ try {
+ JAXBContext jc = null;
+ if (portlet.getVersion().equals("1.0"))
+ {
+ jc = JAXBContext.newInstance("org.apache.pluto.descriptors.portlet10");
+ }
+ else
+ {
+ jc = JAXBContext.newInstance("org.apache.pluto.descriptors.portlet20");
+ }
+ Marshaller m = jc.createMarshaller();
+ m.setEventHandler(new javax.xml.bind.helpers.DefaultValidationEventHandler());
+ m.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT,Boolean.TRUE);
+ m.marshal(portlet,out);
+ }catch (JAXBException jaxbEx){
+ jaxbEx.printStackTrace();
+ throw new IOException(jaxbEx.getMessage());
+ }
+ catch(Exception me) {
+ throw new IOException(me.getLocalizedMessage());
+ }
}
}
Copied: portals/pluto/branches/2.0-spi-refactoring/pluto-descriptor-impl/src/main/resources/org/apache/pluto/descriptors/services/jaxb/portlet-app_1_0.xsd (from r702850, portals/pluto/branches/2.0-spi-refactoring/pluto-descriptor-impl/src/main/resources/org/apache/pluto/descriptors/services/castor/portlet-app_1_0.xsd)
URL: http://svn.apache.org/viewvc/portals/pluto/branches/2.0-spi-refactoring/pluto-descriptor-impl/src/main/resources/org/apache/pluto/descriptors/services/jaxb/portlet-app_1_0.xsd?p2=portals/pluto/branches/2.0-spi-refactoring/pluto-descriptor-impl/src/main/resources/org/apache/pluto/descriptors/services/jaxb/portlet-app_1_0.xsd&p1=portals/pluto/branches/2.0-spi-refactoring/pluto-descriptor-impl/src/main/resources/org/apache/pluto/descriptors/services/castor/portlet-app_1_0.xsd&r1=702850&r2=704743&rev=704743&view=diff
==============================================================================
(empty)
Propchange: portals/pluto/branches/2.0-spi-refactoring/pluto-descriptor-impl/src/main/resources/org/apache/pluto/descriptors/services/jaxb/portlet-app_1_0.xsd
------------------------------------------------------------------------------
svn:eol-style = native
Modified: portals/pluto/branches/2.0-spi-refactoring/pluto-descriptor-impl/src/site/apt/index.apt
URL: http://svn.apache.org/viewvc/portals/pluto/branches/2.0-spi-refactoring/pluto-descriptor-impl/src/site/apt/index.apt?rev=704743&r1=704742&r2=704743&view=diff
==============================================================================
--- portals/pluto/branches/2.0-spi-refactoring/pluto-descriptor-impl/src/site/apt/index.apt (original)
+++ portals/pluto/branches/2.0-spi-refactoring/pluto-descriptor-impl/src/site/apt/index.apt Tue Oct 14 17:01:07 2008
@@ -25,15 +25,12 @@
Pluto Descriptor Service Implementation
The Pluto descriptor services provide an entry point for reading and
-writing object models representing the web and portlet descriptor files
-(<<<WEB-INF/web.xml>>> and <<<WEB-INF/portlet.xml>>>). The Pluto 1.1
- implementation uses {{{http://www.castor.org}Castor}} for marshalling
-and unmarshalling the object models. Pluto 2.0 uses JAXB.
+writing object models representing the portlet descriptor files
+(<<<WEB-INF/portlet.xml>>>). Pluto 2.0 uses JAXB for marshalling and unmarshalling the object models.
If you use the Pluto descriptor services in your own project, be
-sure to code to the interfaces <<<org.apache.pluto.descriptors.services.PortletAppDescriptorService>>>
-and <<<org.apache.pluto.descriptors.services.WebAppDescriptorService>>> and
-not directly to the implementation classes.
+sure to code to the interface <<<org.apache.pluto.descriptors.services.PortletAppDescriptorService>>>
+and not directly to the implementation classes.
* XML parsing in Pluto 2.x