JBoss Portal SVN: r7126 - in docs/trunk/referenceGuide/en: images and 2 other directories.
by portal-commits@lists.jboss.org
Author: julien(a)jboss.com
Date: 2007-04-28 18:53:07 -0400 (Sat, 28 Apr 2007)
New Revision: 7126
Added:
docs/trunk/referenceGuide/en/images/portalapi/
docs/trunk/referenceGuide/en/images/portalapi/Mode.png
docs/trunk/referenceGuide/en/images/portalapi/PortalNode.png
docs/trunk/referenceGuide/en/images/portalapi/PortalNodeURL.png
docs/trunk/referenceGuide/en/images/portalapi/PortalSession.png
docs/trunk/referenceGuide/en/images/portalapi/PortalURL.png
docs/trunk/referenceGuide/en/images/portalapi/WindowState.png
Modified:
docs/trunk/referenceGuide/en/master.xml
docs/trunk/referenceGuide/en/modules/portalapi.xml
Log:
started to put content in the portal api chapter
Added: docs/trunk/referenceGuide/en/images/portalapi/Mode.png
===================================================================
(Binary files differ)
Property changes on: docs/trunk/referenceGuide/en/images/portalapi/Mode.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: docs/trunk/referenceGuide/en/images/portalapi/PortalNode.png
===================================================================
(Binary files differ)
Property changes on: docs/trunk/referenceGuide/en/images/portalapi/PortalNode.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: docs/trunk/referenceGuide/en/images/portalapi/PortalNodeURL.png
===================================================================
(Binary files differ)
Property changes on: docs/trunk/referenceGuide/en/images/portalapi/PortalNodeURL.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: docs/trunk/referenceGuide/en/images/portalapi/PortalSession.png
===================================================================
(Binary files differ)
Property changes on: docs/trunk/referenceGuide/en/images/portalapi/PortalSession.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: docs/trunk/referenceGuide/en/images/portalapi/PortalURL.png
===================================================================
(Binary files differ)
Property changes on: docs/trunk/referenceGuide/en/images/portalapi/PortalURL.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: docs/trunk/referenceGuide/en/images/portalapi/WindowState.png
===================================================================
(Binary files differ)
Property changes on: docs/trunk/referenceGuide/en/images/portalapi/WindowState.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Modified: docs/trunk/referenceGuide/en/master.xml
===================================================================
--- docs/trunk/referenceGuide/en/master.xml 2007-04-28 16:05:14 UTC (rev 7125)
+++ docs/trunk/referenceGuide/en/master.xml 2007-04-28 22:53:07 UTC (rev 7126)
@@ -26,6 +26,7 @@
<!ENTITY security SYSTEM "modules/security.xml">
<!ENTITY troubleshooting SYSTEM "modules/troubleshooting.xml">
<!ENTITY contentIntegration SYSTEM "modules/contentIntegration.xml">
+ <!ENTITY portalapi SYSTEM "modules/portalapi.xml">
]>
<book lang="en">
<bookinfo>
@@ -67,6 +68,7 @@
<!-- deployment desc --> &xmldescriptors;
<!-- understanding urls --> &urls;
<!-- Content integration --> &contentIntegration;
+ <!-- Portal API --> &portalapi;
<!-- IPC --> &ipc;
<!-- clustering configuration --> &clustering;
<!-- WSRP --> &wsrp;
Modified: docs/trunk/referenceGuide/en/modules/portalapi.xml
===================================================================
--- docs/trunk/referenceGuide/en/modules/portalapi.xml 2007-04-28 16:05:14 UTC (rev 7125)
+++ docs/trunk/referenceGuide/en/modules/portalapi.xml 2007-04-28 22:53:07 UTC (rev 7126)
@@ -10,28 +10,135 @@
<sect1>
<title>Introduction</title>
<para>JBoss Portal provides an Application Programming Interface (API) which allows to write code
- that interacts with the portal. The life time of the API is tied to the major version which means
+ that interacts with the portal. The life time and validity of the API is tied to the major version which means
that no changes should be required when code is written against the API provided by the JBoss Portal
2.x versions and used in a later version of JBoss Portal 2.x.</para>
+ <para>The Portal API package prefix is <emphasis>org.jboss.portal.api</emphasis> and all the classes
+ part of the API are prefixed with that package except for two of them which are the <emphasis>org.jboss.portal.Mode</emphasis>
+ and <emphasis>org.jboss.portal.WindowState</emphasis> classes, the main reason being that twose two classes were defined
+ very early before the official Portal API framework was created.</para>
+ <para>The Portlet API defines two classes that represents a portion of the visual state of a Portlet which
+ are <emphasis>javax.portlet.PortletMode</emphasis> and <emphasis>javax.portlet.WindowState</emphasis>. Likewise
+ the Portal API defines similar classes named <emphasis>org.jboss.portal.Mode</emphasis> and
+ <emphasis>org.jboss.portal.WindowState</emphasis> which offer comparable characteristics, the main differences are:</para>
+ <itemizedlist>
+ <listitem>Usage of factory methods to obtain instances.</listitem>
+ <listitem>Classes implements the <emphasis>java.io.Serializable</emphasis> interface.</listitem>
+ </itemizedlist>
+ <mediaobject>
+ <imageobject>
+ <imagedata align="center" fileref="images/portalapi/Mode.png" format="png"/>
+ </imageobject>
+ <caption>
+ <para>The Mode class</para>
+ </caption>
+ </mediaobject>
+ <mediaobject>
+ <imageobject>
+ <imagedata align="center" fileref="images/portalapi/WindowState.png" format="png"/>
+ </imageobject>
+ <caption>
+ <para>The WindowState class</para>
+ </caption>
+ </mediaobject>
+ <note>In the Portal API, the <emphasis>Mode</emphasis> interface is named like this because it does
+ represent the mode of some visual object. The Portlet API names it <emphasis>PortletMode</emphasis> because
+ it makes the assumption that the underlying object is of type Portlet.</note>
</sect1>
<sect1>
<title>Portal session</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata align="center" fileref="images/portalapi/PortalSession.png" format="png"/>
+ </imageobject>
+ <caption>
+ <para>The PortalSession interface</para>
+ </caption>
+ </mediaobject>
+ <para>It is possible to have access to a portion of the portal session to store objects. The <emphasis>org.jboss.portal.api.PortalSession</emphasis>
+ interface defines its API and is similar to the <emphasis>javax.servlet.http.HttpSession</emphasis> except that it does
+ not offer methods to invalidate the session as the session is managed by the portal.
+ </para>
</sect1>
<sect1>
<title>Portal URL</title>
+ <para>The Portal API defines the <emphasis>org.jboss.portal.api.PortalURL</emphasis> interface to represent
+ URL managed by the portal.</para>
+ <mediaobject>
+ <imageobject>
+ <imagedata align="center" fileref="images/portalapi/PortalURL.png" format="png"/>
+ </imageobject>
+ <caption>
+ <para>The PortalURL interface</para>
+ </caption>
+ </mediaobject>
+ <itemizedlist>
+ <listitem>The <emphasis>setAuthenticated(Boolean wantAuthenticated)</emphasis> methods defines if the
+ URL requires the authentication of the user. If the argument value is true then the user must be authenticated
+ to access the URL, if the argument value is false then the user should not be authenticated. Finally if the argument value is
+ null then it means that the URL authenticated mode should reuse the current mode.</listitem>
+ <listitem>The <emphasis>setSecure(Boolean wantSecure)</emphasis> methods defines the same as above but for the
+ transport guarantee offered by the underlying protocol which means most of the time the secure HTTP protocol.</listitem>
+ <listitem>The <emphasis>setRelative(boolean relative)</emphasis> defines the output format of the URL and
+ whether the created URL will be an URL relative to the same web server or will be the full URL.</listitem>
+ <listitem>The <emphasis>toString()</emphasis> method will create the URL as a string.</listitem>
+ </itemizedlist>
</sect1>
<sect1>
<title>Portal nodes</title>
- <para>The portal structure is a tree formed by nodes. It is possible to access that tree in order to
+ <para>The portal structure is a tree formed by nodes. It is possible to programmatically access the portal tree in order to
</para>
<itemizedlist>
<listitem>discover the tree structure of the portal</listitem>
<listitem>create URL that will render the different portal nodes</listitem>
<listitem>access the properties of a specific node</listitem>
</itemizedlist>
+ <mediaobject>
+ <imageobject>
+ <imagedata align="center" fileref="images/portalapi/PortalNode.png" format="png"/>
+ </imageobject>
+ <caption>
+ <para>The PortalNode interface</para>
+ </caption>
+ </mediaobject>
+ <para>As usual with tree structures, the main interface to study is the <emphasis>org.jboss.portal.api.node.PortalNode</emphasis>. That interface
+ is intentionally intended for obtaining useful information from the tree. It is not possible to use it to modify
+ the tree shape because it is not intended to be a management interface.</para>
<programlisting><![CDATA[
-
+public interface PortalNode
+{
+ int getType();
+ String getName();
+ String getDisplayName(Locale locale);
+ Map getProperties();
+ PortalNodeURL createURL(PortalRuntimeContext portalRuntimeContext);
+ ...
+}
]]></programlisting>
+ <para>The interface offers methods to retrieve informations for a given node such as the node type, the node name
+ or the properties of the node. The noticeable node types are:</para>
+ <itemizedlist>
+ <listitem>PortalNode.TYPE_PORTAL : the node represents a portal</listitem>
+ <listitem>PortalNode.TYPE_PAGE : the node represents a portal page</listitem>
+ <listitem>PortalNode.TYPE_WINDOW : the node represents a page window</listitem>
+ </itemizedlist>
+ <para>The <emphasis>org.jboss.portal.api.node.PortalNodeURL</emphasis> is an extension of the <emphasis>PortalURL</emphasis> interface
+ which adds additional methods useful for setting
+ parameters on the URL. There are no guarantees that the portal node will use the parameters. So far portal node
+ URL parameters are only useful for nodes of type <emphasis>PortalNode.TYPE_WINDOW</emphasis> and they should
+ be treated as portlet render parameters in the case of the portlet is a local portlet and is not a remote portlet.</para>
+ <para>The interface also offers methods to navigate the node hierarchy:</para>
+ <programlisting><![CDATA[
+public interface PortalNode
+{
+ ...
+ PortalNode getChild(String name);
+ Collection getChildren();
+ PortalNode getRoot();
+ PortalNode getParent();
+ ...
+}
+]]></programlisting>
</sect1>
<sect1>
<title>Portal events</title>
17 years
JBoss Portal SVN: r7125 - in trunk/wsrp: src/main/org/jboss/portal/test/wsrp/other and 2 other directories.
by portal-commits@lists.jboss.org
Author: chris.laprun(a)jboss.com
Date: 2007-04-28 12:05:14 -0400 (Sat, 28 Apr 2007)
New Revision: 7125
Added:
trunk/wsrp/src/main/org/jboss/portal/test/wsrp/other/RegistrationPropertyDescriptionTestCase.java
Modified:
trunk/wsrp/build.xml
trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/RegistrationProperty.java
trunk/wsrp/src/main/org/jboss/portal/wsrp/registration/LocalizedString.java
trunk/wsrp/src/main/org/jboss/portal/wsrp/registration/RegistrationPropertyDescription.java
Log:
- Fixed several issues with RegistrationPropertyDescription (shouldn't notify parents for non-modifications, removed several potential NPEs) and added test case (could use more work).
- Added equals and hashCode methods.
Modified: trunk/wsrp/build.xml
===================================================================
--- trunk/wsrp/build.xml 2007-04-28 15:44:42 UTC (rev 7124)
+++ trunk/wsrp/build.xml 2007-04-28 16:05:14 UTC (rev 7125)
@@ -756,6 +756,8 @@
<test todir="${test.reports}" name="org.jboss.portal.test.wsrp.other.EndpointConfigurationInfoTestCase"/>
<test todir="${test.reports}" name="org.jboss.portal.test.wsrp.other.ProducerInfoTestCase"/>
<test todir="${test.reports}" name="org.jboss.portal.test.wsrp.other.RegistrationInfoTestCase"/>
+ <test todir="${test.reports}"
+ name="org.jboss.portal.test.wsrp.other.RegistrationPropertyDescriptionTestCase"/>
<test todir="${test.reports}" name="org.jboss.portal.test.wsrp.handler.RequestHeaderClientHandlerTestCase"/>
</x-test>
<x-sysproperty>
Added: trunk/wsrp/src/main/org/jboss/portal/test/wsrp/other/RegistrationPropertyDescriptionTestCase.java
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/test/wsrp/other/RegistrationPropertyDescriptionTestCase.java (rev 0)
+++ trunk/wsrp/src/main/org/jboss/portal/test/wsrp/other/RegistrationPropertyDescriptionTestCase.java 2007-04-28 16:05:14 UTC (rev 7125)
@@ -0,0 +1,166 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2007, 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.test.wsrp.other;
+
+import junit.framework.TestCase;
+import org.jboss.portal.registration.RegistrationPolicy;
+import org.jboss.portal.registration.RegistrationPropertyChangeListener;
+import org.jboss.portal.wsrp.WSRPConstants;
+import org.jboss.portal.wsrp.producer.config.ProducerRegistrationRequirements;
+import org.jboss.portal.wsrp.registration.RegistrationPropertyDescription;
+
+import javax.xml.namespace.QName;
+import java.util.Map;
+
+/**
+ * @author <a href="mailto:chris.laprun@jboss.com">Chris Laprun</a>
+ * @version $Revision$
+ * @since 2.6
+ */
+public class RegistrationPropertyDescriptionTestCase extends TestCase
+{
+ private RegistrationPropertyDescription desc;
+
+ protected void setUp() throws Exception
+ {
+ desc = new RegistrationPropertyDescription("foo", WSRPConstants.XSD_STRING);
+ }
+
+ public void testNotify()
+ {
+ TestParent parent = new TestParent();
+ desc.setParent(parent);
+ desc.setDefaultHint(null);
+ assertFalse(parent.notifyCalled);
+ parent.resetNotifyCalled();
+ desc.setDefaultHint("hint");
+ assertTrue(parent.notifyCalled);
+ }
+
+ public void testModifyIfNeeded()
+ {
+ String oldValue = "old";
+ String newValue = "new";
+ assertEquals(oldValue, desc.modifyIfNeeded(oldValue, oldValue));
+ assertEquals(newValue, desc.modifyIfNeeded(oldValue, newValue));
+ assertEquals(null, desc.modifyIfNeeded(null, null));
+ assertEquals(newValue, desc.modifyIfNeeded(null, newValue));
+ assertEquals(null, desc.modifyIfNeeded(oldValue, null));
+ }
+
+ class TestParent implements ProducerRegistrationRequirements
+ {
+ private boolean notifyCalled;
+
+ void resetNotifyCalled()
+ {
+ notifyCalled = false;
+ }
+
+ public boolean requiresRegistration()
+ {
+ return false;
+ }
+
+ public void setRequiresRegistration(boolean requiresRegistration)
+ {
+ }
+
+ public boolean fullServiceDescriptionRequiresRegistration()
+ {
+ return false;
+ }
+
+ public void setFullServiceDescriptionRequiresRegistration(boolean fullServiceDescriptionRequiresRegistration)
+ {
+ }
+
+ public Map getRegistrationProperties()
+ {
+ return null;
+ }
+
+ public void addRegistrationProperty(RegistrationPropertyDescription propertyDescription)
+ {
+ }
+
+ public void removeRegistrationProperty(String propertyName)
+ {
+ }
+
+ public void removeRegistrationProperty(QName propertyName)
+ {
+ }
+
+ public void clearRegistrationProperties()
+ {
+ }
+
+ public boolean acceptValueFor(QName propertyName, Object value)
+ {
+ return false;
+ }
+
+ public boolean acceptValueFor(String propertyName, Object value)
+ {
+ return false;
+ }
+
+ public RegistrationPropertyDescription getRegistrationPropertyWith(String name)
+ {
+ return null;
+ }
+
+ public RegistrationPropertyDescription getRegistrationPropertyWith(QName name)
+ {
+ return null;
+ }
+
+ public void notifyRegistrationPropertyChangeListeners()
+ {
+ notifyCalled = true;
+ }
+
+ public void addRegistrationPropertyChangeListeners(RegistrationPropertyChangeListener listener)
+ {
+ }
+
+ public void clearRegistrationPropertyChangeListeners()
+ {
+ }
+
+ public void removeRegistrationPropertyChangeListener(RegistrationPropertyChangeListener listener)
+ {
+ }
+
+ public void setPolicy(RegistrationPolicy policy)
+ {
+ }
+
+ public RegistrationPolicy getPolicy()
+ {
+ return null;
+ }
+ }
+}
Property changes on: trunk/wsrp/src/main/org/jboss/portal/test/wsrp/other/RegistrationPropertyDescriptionTestCase.java
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native
Modified: trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/RegistrationProperty.java
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/RegistrationProperty.java 2007-04-28 15:44:42 UTC (rev 7124)
+++ trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/RegistrationProperty.java 2007-04-28 16:05:14 UTC (rev 7125)
@@ -51,6 +51,59 @@
}
+ public boolean equals(Object o)
+ {
+ if (this == o)
+ {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass())
+ {
+ return false;
+ }
+
+ RegistrationProperty that = (RegistrationProperty)o;
+
+ if (key != null ? !key.equals(that.key) : that.key != null)
+ {
+ return false;
+ }
+ if (!name.equals(that.name))
+ {
+ return false;
+ }
+ if (value != null ? !value.equals(that.value) : that.value != null)
+ {
+ return false;
+ }
+ if (invalid != that.invalid)
+ {
+ return false;
+ }
+ if (lang != null ? !lang.equals(that.lang) : that.lang != null)
+ {
+ return false;
+ }
+ if (description != null ? !description.equals(that.description) : that.description != null)
+ {
+ return false;
+ }
+
+ return true;
+ }
+
+ public int hashCode()
+ {
+ int result;
+ result = (key != null ? key.hashCode() : 0);
+ result = 31 * result + (description != null ? description.hashCode() : 0);
+ result = 31 * result + (invalid ? 1 : 0);
+ result = 31 * result + (lang != null ? lang.hashCode() : 0);
+ result = 31 * result + name.hashCode();
+ result = 31 * result + (value != null ? value.hashCode() : 0);
+ return result;
+ }
+
public Long getKey()
{
return key;
Modified: trunk/wsrp/src/main/org/jboss/portal/wsrp/registration/LocalizedString.java
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/wsrp/registration/LocalizedString.java 2007-04-28 15:44:42 UTC (rev 7124)
+++ trunk/wsrp/src/main/org/jboss/portal/wsrp/registration/LocalizedString.java 2007-04-28 16:05:14 UTC (rev 7125)
@@ -58,6 +58,7 @@
public LocalizedString(LocalizedString other)
{
+ ParameterValidation.throwIllegalArgExceptionIfNull(other, "LocalizedString");
this.value = other.value;
this.locale = other.locale;
this.resourceName = other.resourceName;
Modified: trunk/wsrp/src/main/org/jboss/portal/wsrp/registration/RegistrationPropertyDescription.java
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/wsrp/registration/RegistrationPropertyDescription.java 2007-04-28 15:44:42 UTC (rev 7124)
+++ trunk/wsrp/src/main/org/jboss/portal/wsrp/registration/RegistrationPropertyDescription.java 2007-04-28 16:05:14 UTC (rev 7125)
@@ -23,11 +23,13 @@
package org.jboss.portal.wsrp.registration;
+import org.jboss.portal.common.util.ParameterValidation;
import org.jboss.portal.wsrp.producer.config.ProducerRegistrationRequirements;
import javax.xml.namespace.QName;
import java.net.URI;
import java.net.URISyntaxException;
+import java.util.Arrays;
/**
* @author <a href="mailto:chris.laprun@jboss.com">Chris Laprun</a>
@@ -65,24 +67,78 @@
public RegistrationPropertyDescription(RegistrationPropertyDescription other)
{
+ ParameterValidation.throwIllegalArgExceptionIfNull(other, "RegistrationPropertyDescription");
+
setName(new QName(other.name.toString()));
setType(new QName(other.type.toString()));
- aliases = new QName[other.aliases.length];
- System.arraycopy(other.aliases, 0, aliases, 0, other.aliases.length);
+ if (other.aliases != null)
+ {
+ aliases = new QName[other.aliases.length];
+ System.arraycopy(other.aliases, 0, aliases, 0, other.aliases.length);
+ }
- setDescription(new LocalizedString(other.description));
- setHint(new LocalizedString(other.hint));
- setLabel(new LocalizedString(other.label));
- setSchemaLocation(other.schemaLocation);
+ if (other.description != null)
+ {
+ setDescription(new LocalizedString(other.description));
+ }
+ if (other.hint != null)
+ {
+ setHint(new LocalizedString(other.hint));
+ }
+ if (other.label != null)
+ {
+ setLabel(new LocalizedString(other.label));
+ }
+ if (other.schemaLocation != null)
+ {
+ setSchemaLocation(other.schemaLocation);
+ }
- usages = new String[other.usages.length];
- System.arraycopy(other.usages, 0, usages, 0, other.usages.length);
+ if (other.usages != null)
+ {
+ usages = new String[other.usages.length];
+ System.arraycopy(other.usages, 0, usages, 0, other.usages.length);
+ }
parent = other.parent;
}
+ public boolean equals(Object o)
+ {
+ if (this == o)
+ {
+ return true;
+ }
+ if (o == null || getClass() != o.getClass())
+ {
+ return false;
+ }
+
+ RegistrationPropertyDescription that = (RegistrationPropertyDescription)o;
+
+ if (key != null ? !key.equals(that.key) : that.key != null)
+ {
+ return false;
+ }
+ if (!name.equals(that.name))
+ {
+ return false;
+ }
+ return type.equals(that.type);
+
+ }
+
+ public int hashCode()
+ {
+ int result;
+ result = (key != null ? key.hashCode() : 0);
+ result = 31 * result + name.hashCode();
+ result = 31 * result + type.hashCode();
+ return result;
+ }
+
public String toString()
{
return "Registration Property Description named '" + name +
@@ -109,8 +165,7 @@
public void setName(QName name)
{
- this.name = name;
- notifyParentOfChangeIfNeeded();
+ this.name = (QName)modifyIfNeeded(this.name, name);
}
public QName getType()
@@ -120,8 +175,7 @@
public void setType(QName type)
{
- this.type = type;
- notifyParentOfChangeIfNeeded();
+ this.type = (QName)modifyIfNeeded(this.type, type);
}
public String getSchemaLocation()
@@ -144,18 +198,21 @@
public void setSchemaLocation(String schemaLocation)
{
- // first check if schemaLocation is a valid URI
- try
+ //
+ if (schemaLocation != null)
{
- new URI(schemaLocation);
+ // first check if schemaLocation is a valid URI
+ try
+ {
+ new URI(schemaLocation);
+ }
+ catch (URISyntaxException e)
+ {
+ throw new IllegalArgumentException("Invalid URI: " + schemaLocation + ". Cause: " + e.getLocalizedMessage());
+ }
+
+ this.schemaLocation = (String)modifyIfNeeded(this.schemaLocation, schemaLocation);
}
- catch (URISyntaxException e)
- {
- throw new IllegalArgumentException("Invalid URI: " + schemaLocation + ". Cause: " + e.getLocalizedMessage());
- }
-
- this.schemaLocation = schemaLocation;
- notifyParentOfChangeIfNeeded();
}
public LocalizedString getDescription()
@@ -165,13 +222,12 @@
public void setDescription(LocalizedString description)
{
- this.description = description;
- notifyParentOfChangeIfNeeded();
+ this.description = (LocalizedString)modifyIfNeeded(this.description, description);
}
public void setDefaultDescription(String value)
{
- setDescription(new LocalizedString(value));
+ setDescription(value == null ? null : new LocalizedString(value));
}
public LocalizedString getHint()
@@ -181,13 +237,12 @@
public void setHint(LocalizedString hint)
{
- this.hint = hint;
- notifyParentOfChangeIfNeeded();
+ this.hint = (LocalizedString)modifyIfNeeded(this.hint, hint);
}
public void setDefaultHint(String value)
{
- setHint(new LocalizedString(value));
+ setHint(value == null ? null : new LocalizedString(value));
}
public LocalizedString getLabel()
@@ -197,13 +252,12 @@
public void setLabel(LocalizedString label)
{
- this.label = label;
- notifyParentOfChangeIfNeeded();
+ this.label = (LocalizedString)modifyIfNeeded(this.label, label);
}
public void setDefaultLabel(String value)
{
- setLabel(new LocalizedString(value));
+ setLabel(value == null ? null : new LocalizedString(value));
}
public String[] getUsages()
@@ -213,9 +267,19 @@
public void setUsages(String[] usages)
{
- this.usages = new String[usages.length];
- System.arraycopy(usages, 0, this.usages, 0, usages.length);
- notifyParentOfChangeIfNeeded();
+ if (!Arrays.equals(this.usages, usages))
+ {
+ if (usages != null)
+ {
+ this.usages = new String[usages.length];
+ System.arraycopy(usages, 0, this.usages, 0, usages.length);
+ }
+ else
+ {
+ this.usages = null;
+ }
+ notifyParentOfChangeIfNeeded();
+ }
}
public QName[] getAliases()
@@ -225,9 +289,19 @@
public void setAliases(QName[] aliases)
{
- this.aliases = new QName[aliases.length];
- System.arraycopy(aliases, 0, this.aliases, 0, aliases.length);
- notifyParentOfChangeIfNeeded();
+ if (!Arrays.equals(this.aliases, aliases))
+ {
+ if (aliases != null)
+ {
+ this.aliases = new QName[aliases.length];
+ System.arraycopy(aliases, 0, this.aliases, 0, aliases.length);
+ }
+ else
+ {
+ this.aliases = null;
+ }
+ notifyParentOfChangeIfNeeded();
+ }
}
public void setParent(ProducerRegistrationRequirements requirements)
@@ -242,4 +316,15 @@
parent.notifyRegistrationPropertyChangeListeners();
}
}
+
+ public Object modifyIfNeeded(Object oldValue, Object newValue)
+ {
+ if ((oldValue != null && !oldValue.equals(newValue)) || (oldValue == null && newValue != null))
+ {
+ oldValue = newValue;
+ notifyParentOfChangeIfNeeded();
+ }
+
+ return oldValue;
+ }
}
17 years
JBoss Portal SVN: r7124 - tags/JBoss_Portal_2_6_0_CR2/wsrp/src/main/org/jboss/portal/test/wsrp/other.
by portal-commits@lists.jboss.org
Author: chris.laprun(a)jboss.com
Date: 2007-04-28 11:44:42 -0400 (Sat, 28 Apr 2007)
New Revision: 7124
Modified:
tags/JBoss_Portal_2_6_0_CR2/wsrp/src/main/org/jboss/portal/test/wsrp/other/RegistrationInfoTestCase.java
Log:
- Fixed usage of Java 5 methods. Sorry! :(
Modified: tags/JBoss_Portal_2_6_0_CR2/wsrp/src/main/org/jboss/portal/test/wsrp/other/RegistrationInfoTestCase.java
===================================================================
--- tags/JBoss_Portal_2_6_0_CR2/wsrp/src/main/org/jboss/portal/test/wsrp/other/RegistrationInfoTestCase.java 2007-04-28 15:24:51 UTC (rev 7123)
+++ tags/JBoss_Portal_2_6_0_CR2/wsrp/src/main/org/jboss/portal/test/wsrp/other/RegistrationInfoTestCase.java 2007-04-28 15:44:42 UTC (rev 7124)
@@ -108,7 +108,7 @@
assertFalse(result.isValid());
String status = result.getStatus();
assertNotNull(status);
- assertTrue(status.contains("foo"));
+ assertTrue(status.indexOf("foo") != -1);
Map regProps = result.getRegistrationProperties();
assertNotNull(regProps);
@@ -129,7 +129,7 @@
assertFalse(result.isValid());
String status = result.getStatus();
assertNotNull(status);
- assertTrue(status.contains("prop0") && status.contains("prop1"));
+ assertTrue(status.indexOf("prop0") != -1 && status.indexOf("prop1") != -1);
}
private ServiceDescription createServiceDescription(boolean requiresRegistration, int numberOfProperties)
17 years
JBoss Portal SVN: r7123 - in trunk: wsrp/src/main/org/jboss/portal/test/wsrp/other and 1 other directory.
by portal-commits@lists.jboss.org
Author: chris.laprun(a)jboss.com
Date: 2007-04-28 11:24:51 -0400 (Sat, 28 Apr 2007)
New Revision: 7123
Modified:
trunk/build/ide/intellij/idea60/modules/core-samples/core-samples.iml
trunk/wsrp/src/main/org/jboss/portal/test/wsrp/other/RegistrationInfoTestCase.java
Log:
- Fixed usage of Java 5 methods. Sorry! :(
- Added missing libs in core-samples.iml.
Modified: trunk/build/ide/intellij/idea60/modules/core-samples/core-samples.iml
===================================================================
--- trunk/build/ide/intellij/idea60/modules/core-samples/core-samples.iml 2007-04-28 08:33:26 UTC (rev 7122)
+++ trunk/build/ide/intellij/idea60/modules/core-samples/core-samples.iml 2007-04-28 15:24:51 UTC (rev 7123)
@@ -34,6 +34,24 @@
</library>
</orderEntry>
<orderEntry type="module" module-name="theme" />
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../thirdparty/apache-fileupload/lib/commons-fileupload.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/../../../../../../thirdparty/sun-servlet/lib/servlet-api.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES />
+ </library>
+ </orderEntry>
<orderEntryProperties />
</component>
<component name="VcsManagerConfiguration">
Modified: trunk/wsrp/src/main/org/jboss/portal/test/wsrp/other/RegistrationInfoTestCase.java
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/test/wsrp/other/RegistrationInfoTestCase.java 2007-04-28 08:33:26 UTC (rev 7122)
+++ trunk/wsrp/src/main/org/jboss/portal/test/wsrp/other/RegistrationInfoTestCase.java 2007-04-28 15:24:51 UTC (rev 7123)
@@ -108,7 +108,7 @@
assertFalse(result.isValid());
String status = result.getStatus();
assertNotNull(status);
- assertTrue(status.contains("foo"));
+ assertTrue(status.indexOf("foo") != -1);
Map regProps = result.getRegistrationProperties();
assertNotNull(regProps);
@@ -129,7 +129,7 @@
assertFalse(result.isValid());
String status = result.getStatus();
assertNotNull(status);
- assertTrue(status.contains("prop0") && status.contains("prop1"));
+ assertTrue(status.indexOf("prop0") != -1 && status.indexOf("prop1") != -1);
}
private ServiceDescription createServiceDescription(boolean requiresRegistration, int numberOfProperties)
17 years
JBoss Portal SVN: r7122 - docs/trunk/referenceGuide/en/modules.
by portal-commits@lists.jboss.org
Author: julien(a)jboss.com
Date: 2007-04-28 04:33:26 -0400 (Sat, 28 Apr 2007)
New Revision: 7122
Added:
docs/trunk/referenceGuide/en/modules/portalapi.xml
Log:
started to add chapter on portal API
Added: docs/trunk/referenceGuide/en/modules/portalapi.xml
===================================================================
--- docs/trunk/referenceGuide/en/modules/portalapi.xml (rev 0)
+++ docs/trunk/referenceGuide/en/modules/portalapi.xml 2007-04-28 08:33:26 UTC (rev 7122)
@@ -0,0 +1,39 @@
+<chapter id="portalapi">
+ <chapterinfo>
+ <author>
+ <firstname>Julien</firstname>
+ <surname>Viet</surname>
+ <email>julien(a)jboss.org</email>
+ </author>
+ </chapterinfo>
+ <title>Portal API</title>
+ <sect1>
+ <title>Introduction</title>
+ <para>JBoss Portal provides an Application Programming Interface (API) which allows to write code
+ that interacts with the portal. The life time of the API is tied to the major version which means
+ that no changes should be required when code is written against the API provided by the JBoss Portal
+ 2.x versions and used in a later version of JBoss Portal 2.x.</para>
+ </sect1>
+ <sect1>
+ <title>Portal session</title>
+ </sect1>
+ <sect1>
+ <title>Portal URL</title>
+ </sect1>
+ <sect1>
+ <title>Portal nodes</title>
+ <para>The portal structure is a tree formed by nodes. It is possible to access that tree in order to
+ </para>
+ <itemizedlist>
+ <listitem>discover the tree structure of the portal</listitem>
+ <listitem>create URL that will render the different portal nodes</listitem>
+ <listitem>access the properties of a specific node</listitem>
+ </itemizedlist>
+ <programlisting><![CDATA[
+
+]]></programlisting>
+ </sect1>
+ <sect1>
+ <title>Portal events</title>
+ </sect1>
+</chapter>
17 years
JBoss Portal SVN: r7121 - docs/trunk/referenceGuide/en.
by portal-commits@lists.jboss.org
Author: julien(a)jboss.com
Date: 2007-04-27 19:05:01 -0400 (Fri, 27 Apr 2007)
New Revision: 7121
Added:
docs/trunk/referenceGuide/en/schemas.ppt
Log:
adding the PPT that contains the schema that I use to generate pictures for the ref guide
Added: docs/trunk/referenceGuide/en/schemas.ppt
===================================================================
(Binary files differ)
Property changes on: docs/trunk/referenceGuide/en/schemas.ppt
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
17 years
JBoss Portal SVN: r7120 - docs/trunk/referenceGuide/en/modules.
by portal-commits@lists.jboss.org
Author: julien(a)jboss.com
Date: 2007-04-27 19:00:28 -0400 (Fri, 27 Apr 2007)
New Revision: 7120
Modified:
docs/trunk/referenceGuide/en/modules/contentIntegration.xml
Log:
typo
Modified: docs/trunk/referenceGuide/en/modules/contentIntegration.xml
===================================================================
--- docs/trunk/referenceGuide/en/modules/contentIntegration.xml 2007-04-27 22:57:01 UTC (rev 7119)
+++ docs/trunk/referenceGuide/en/modules/contentIntegration.xml 2007-04-27 23:00:28 UTC (rev 7120)
@@ -12,7 +12,7 @@
content integration had to be done by configuring a portlet to show some content from an URI and then place that
portlet on a page. The new content integration capabilities allows to directly configure a page window with the content URI
removing the need to configure a portlet for that purpose.</para>
- <note>We do not advocate to avoid to use portlet preferences, we rather advocate that content configuration managed at the portal level
+ <note>We do not advocate to avoid the usage portlet preferences, we rather advocate that content configuration managed at the portal level
simplifies the configuration: it helps to make content a first class citizen of the portal instead of having an intermediary
portlet that holds the content for the portal. The portlet preferences can still be used to configure how content is displayed
to the user.</note>
17 years
JBoss Portal SVN: r7119 - docs/trunk/referenceGuide/en/modules.
by portal-commits@lists.jboss.org
Author: julien(a)jboss.com
Date: 2007-04-27 18:57:01 -0400 (Fri, 27 Apr 2007)
New Revision: 7119
Modified:
docs/trunk/referenceGuide/en/modules/ajax.xml
Log:
typo
Modified: docs/trunk/referenceGuide/en/modules/ajax.xml
===================================================================
--- docs/trunk/referenceGuide/en/modules/ajax.xml 2007-04-27 22:52:48 UTC (rev 7118)
+++ docs/trunk/referenceGuide/en/modules/ajax.xml 2007-04-27 22:57:01 UTC (rev 7119)
@@ -153,7 +153,7 @@
<para>Like with the drag and drop feature, partial page refresh is controlled via properties on portal objects.
The name of the property is <emphasis>theme.dyna.partial_refresh_enabled</emphasis> and its values can
be <emphasis>true</emphasis> or <emphasis>false</emphasis>. When this property is set on an object
- it is automatically inherited by the sub hierarchy located under that objects. By default the drag
+ it is automatically inherited by the sub hierarchy located under that object. By default the drag
and drop feature is positionned on the dashboard object and not on the rest of the portal objects.
</para>
<programlisting><![CDATA[
17 years
JBoss Portal SVN: r7118 - in docs/trunk/referenceGuide/en: images/ajax and 1 other directories.
by portal-commits@lists.jboss.org
Author: julien(a)jboss.com
Date: 2007-04-27 18:52:48 -0400 (Fri, 27 Apr 2007)
New Revision: 7118
Added:
docs/trunk/referenceGuide/en/images/ajax/
docs/trunk/referenceGuide/en/images/ajax/partial-refresh-admin.png
docs/trunk/referenceGuide/en/images/ajax/partial-refresh.png
Modified:
docs/trunk/referenceGuide/en/modules/ajax.xml
Log:
completing ajax chapter
Added: docs/trunk/referenceGuide/en/images/ajax/partial-refresh-admin.png
===================================================================
(Binary files differ)
Property changes on: docs/trunk/referenceGuide/en/images/ajax/partial-refresh-admin.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: docs/trunk/referenceGuide/en/images/ajax/partial-refresh.png
===================================================================
(Binary files differ)
Property changes on: docs/trunk/referenceGuide/en/images/ajax/partial-refresh.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Modified: docs/trunk/referenceGuide/en/modules/ajax.xml
===================================================================
--- docs/trunk/referenceGuide/en/modules/ajax.xml 2007-04-27 15:24:04 UTC (rev 7117)
+++ docs/trunk/referenceGuide/en/modules/ajax.xml 2007-04-27 22:52:48 UTC (rev 7118)
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
-<chapter id="clustering">
+<chapter id="ajax">
<chapterinfo>
<author>
<firstname>Julien</firstname>
@@ -102,10 +102,136 @@
</sect1>
<sect1>
<title>Ajaxified pages</title>
- <para>todo</para>
+ <para>The ajaxification of the portal pages can be configured in a fine grained manner. Thanks to the portal
+ object properties it is possible to control which pages support ajax and which page do not support ajax. The
+ administrator must pay attention to the fact that property values are inherited in the object hierarchy.</para>
+ <sect2>
+ <title>Drag and Drop</title>
+ <para>That feature is only effective in dashboards as it requires the offer personalization of the page
+ layout per user. By default the feature is enabled thanks to a property set on the dashboard object.
+ It is possible to turn off that property if the administrator does not want to expose that feature
+ to its user.</para>
+ <para>In the file <emphasis>jboss-portal.sar/conf/data/default-object.xml</emphasis> is declared and configured the
+ creation of the dashboard portal:</para>
+ <programlisting><![CDATA[
+<deployment>
+ <parent-ref/>
+ <if-exists>keep</if-exists>
+ <context>
+ <context-name>dashboard</context-name>
+ <properties>
+ ...
+ <property>
+ <name>theme.dyna.dnd_enabled</name>
+ <value>true</value>
+ </property>
+ ...
+ </properties>
+ ...
+ </context>
+</deployment>
+]]></programlisting>
+ <para>The property <emphasis>theme.dyna.dnd_enabled</emphasis> is set to the value <emphasis>true</emphasis>
+ which means that the dashboard object will provide the drag and drop feature.
+ </para>
+ </sect2>
+ <sect2>
+ <title>Partial refreshing</title>
+ <para>Partial refreshing is a very powerful feature which allows the portal to optimize the refreshing
+ of portlets on a page. When one portlet is invoked, instead of redrawing the full page, the portal is able
+ to detect which portlets needs to be refreshed and will update only these portlets.</para>
+ <mediaobject>
+ <imageobject>
+ <imagedata align="center" fileref="images/ajax/partial-refresh.png" format="png"/>
+ </imageobject>
+ <caption>
+ <para>The portal providing partial refresh</para>
+ </caption>
+ </mediaobject>
+ <sect3>
+ <title>Portal objects configuration</title>
+ <para>Like with the drag and drop feature, partial page refresh is controlled via properties on portal objects.
+ The name of the property is <emphasis>theme.dyna.partial_refresh_enabled</emphasis> and its values can
+ be <emphasis>true</emphasis> or <emphasis>false</emphasis>. When this property is set on an object
+ it is automatically inherited by the sub hierarchy located under that objects. By default the drag
+ and drop feature is positionned on the dashboard object and not on the rest of the portal objects.
+ </para>
+ <programlisting><![CDATA[
+<deployment>
+ <parent-ref/>
+ <if-exists>keep</if-exists>
+ <context>
+ <context-name>dashboard</context-name>
+ <properties>
+ ...
+ <property>
+ <name>theme.dyna.partial_refresh_enabled</name>
+ <value>true</value>
+ </property>
+ ...
+ </properties>
+ ...
+ </context>
+</deployment>
+]]></programlisting>
+ <note>
+ The partial page refresh feature is compatible with the Portal API. The Portal API allows programmatic
+ update of the state of portlets at runtime. For instance it is possible to modify the window state or
+ the mode of several portlets on a given page. When such event occurs, the portal detects the changes
+ which occured and will update the portlet fragments in the page.
+ </note>
+ <para>It is possible to change that behavior at runtime using the property editor of the management portlet.
+ If you want to enable partial refreshing on the default portal you should set the property to true
+ directly on the portal and all the pages in that portal will automatically inherit those properties.</para>
+ <mediaobject>
+ <imageobject>
+ <imagedata align="center" fileref="images/ajax/partial-refresh-admin.png" format="png"/>
+ </imageobject>
+ <caption>
+ <para>The default portal configured for partial page refresh</para>
+ </caption>
+ </mediaobject>
+ </sect3>
+ <sect3>
+ <title>Portlet configuration</title>
+ <para>
+ By default any portlet will support partial refreshing. When does the portal performs partial page
+ refreshing ? By default it is enabled for action and render links with the following exceptions. In those
+ situations, the portal will prefer to perform a full page refresh:
+ <itemizedlist>
+ <listitem>
+ <para>Form GET are not handled, however it should not be an issue as this situation is discouraged
+ by the Portlet specification. It however taken in account, just in case of. Here is an example
+ of a Java Server Page that would do one:</para>
+ <programlisting><![CDATA[
+<form action="<%= renderResponse.createActionURL() %>" method="get">
+ ...
+</form>
+]]></programlisting>
+ </listitem>
+ <listitem>
+ <para>Form uploads are not handled.</para>
+ </listitem>
+ <listitem>Having an interaction that deals with the <emphasis>MAXIMIZED</emphasis> window state.
+ When a window is entering a maximized state or leaving a maximized window state, the portal will
+ perform a full page refresh.</listitem>
+ </itemizedlist>
+ </para>
+ <para>It can happen that a portlet does not want to support partial refreshing, in those situations
+ the <emphasis>jboss-portlet.xml</emphasis> can be used to control that behavior. Since 2.6 an ajax
+ section has been added in order to configure ajax features related to the portlet.</para>
+ <programlisting><![CDATA[
+<portlet>
+ <portlet-name>MyPortletNoAjax</portlet-name>
+ <ajax>
+ <partial-refresh>false</partial-refresh>
+ </ajax>
+</portlet>
+]]></programlisting>
+ <para>The usage of the <emphasis>partial-refresh</emphasis> set to the value false means that
+ the portlet will not be subject of a partial page refresh when it is invoked. However the portlet
+ markup can still be subject to a partial rendering.</para>
+ </sect3>
+ </sect2>
</sect1>
- <sect1>
- <title>Ajaxified portlets</title>
- <para>todo</para>
- </sect1>
</chapter>
\ No newline at end of file
17 years
JBoss Portal SVN: r7117 - docs/tags.
by portal-commits@lists.jboss.org
Author: julien(a)jboss.com
Date: 2007-04-27 11:24:04 -0400 (Fri, 27 Apr 2007)
New Revision: 7117
Added:
docs/tags/JBoss_Portal_2_6_0_CR2/
Log:
2.6CR2
Copied: docs/tags/JBoss_Portal_2_6_0_CR2 (from rev 7116, docs/trunk)
17 years