JBoss Portal SVN: r7178 - in docs/trunk/referenceGuide/en: modules and 1 other directory.
by portal-commits@lists.jboss.org
Author: bdaw
Date: 2007-05-02 17:35:51 -0400 (Wed, 02 May 2007)
New Revision: 7178
Added:
docs/trunk/referenceGuide/en/images/content/cms.png
docs/trunk/referenceGuide/en/images/content/fs1.png
docs/trunk/referenceGuide/en/images/content/fs2.png
docs/trunk/referenceGuide/en/images/content/fs3.png
Modified:
docs/trunk/referenceGuide/en/modules/contentIntegration.xml
Log:
- few images in contentintegration chapter
Added: docs/trunk/referenceGuide/en/images/content/cms.png
===================================================================
(Binary files differ)
Property changes on: docs/trunk/referenceGuide/en/images/content/cms.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: docs/trunk/referenceGuide/en/images/content/fs1.png
===================================================================
(Binary files differ)
Property changes on: docs/trunk/referenceGuide/en/images/content/fs1.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: docs/trunk/referenceGuide/en/images/content/fs2.png
===================================================================
(Binary files differ)
Property changes on: docs/trunk/referenceGuide/en/images/content/fs2.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: docs/trunk/referenceGuide/en/images/content/fs3.png
===================================================================
(Binary files differ)
Property changes on: docs/trunk/referenceGuide/en/images/content/fs3.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Modified: docs/trunk/referenceGuide/en/modules/contentIntegration.xml
===================================================================
--- docs/trunk/referenceGuide/en/modules/contentIntegration.xml 2007-05-02 19:12:02 UTC (rev 7177)
+++ docs/trunk/referenceGuide/en/modules/contentIntegration.xml 2007-05-02 21:35:51 UTC (rev 7178)
@@ -65,6 +65,10 @@
<emphasis>edit_content</emphasis> has been introduced. It signals to the portlet that it is editing the content portion
of the state of a portlet. The traditional edit mode is not used because the edit mode is more targetted to configure how
the portlet show content to the end user rather than what content it shows.</para>
+ <imageobject>
+ <imagedata align="center" fileref="images/content/cms.png" format="png"/>
+ </imageobject>
+ <caption>Example of content customization - CMS Portlet</caption>
</sect1>
<sect1>
<title>Content Driven Portlet</title>
@@ -207,7 +211,11 @@
<sect3>
<title>The editor</title>
<para>The editor is probably the longest part of the portlet. It tries to stay simple though and goes directly
- to the point.</para>
+ to the point.</para>
+ <imageobject>
+ <imagedata align="center" fileref="images/content/fs1.png" format="png"/>
+ </imageobject>
+ <caption>Content editor of FSContentDrivenPortlet in action</caption>
<programlisting><![CDATA[
protected void doEditContent(RenderRequest req, RenderResponse resp)
throws PortletException, PortletSecurityException, IOException
@@ -341,6 +349,10 @@
</sect3>
<sect3>
<title>Hooking the portlet into the portal</title>
+ <imageobject>
+ <imagedata align="center" fileref="images/content/fs2.png" format="png"/>
+ </imageobject>
+ <caption>Management portlet with <emphasis>filesystem</emphasis> content type enabled</caption>
<para>Finally we need to make the portal aware of the fact that the portlet can edit and interpret content. For that
we need a few descriptors. The <emphasis>portlet.xml</emphasis> descriptor will define our portlet, the
<emphasis>portlet-instances.xml</emphasis> will create a single instance of our portlet. The
@@ -425,6 +437,10 @@
<height>1</height>
</window>
]]></programlisting>
+ <imageobject>
+ <imagedata align="center" fileref="images/content/fs3.png" format="png"/>
+ </imageobject>
+ <caption>Final effect - portal window with FSContentDrivenPortlet</caption>
<note>How to configure CMS file this way is covered in the CMS chapter: <xref linkend="configuration-cms_content"/></note>
</sect1>
</chapter>
19 years
JBoss Portal SVN: r7177 - in trunk: test/src/etc and 1 other directory.
by portal-commits@lists.jboss.org
Author: sohil.shah(a)jboss.com
Date: 2007-05-02 15:12:02 -0400 (Wed, 02 May 2007)
New Revision: 7177
Modified:
trunk/cms/src/main/org/jboss/portal/cms/security/AuthorizationProviderImpl.java
trunk/test/src/etc/datasources.xml
Log:
Fix: java.lang.NullPointerException for Users Role after deleting demo Test page - JBPORTAL-1363
Modified: trunk/cms/src/main/org/jboss/portal/cms/security/AuthorizationProviderImpl.java
===================================================================
--- trunk/cms/src/main/org/jboss/portal/cms/security/AuthorizationProviderImpl.java 2007-05-02 18:42:13 UTC (rev 7176)
+++ trunk/cms/src/main/org/jboss/portal/cms/security/AuthorizationProviderImpl.java 2007-05-02 19:12:02 UTC (rev 7177)
@@ -345,7 +345,7 @@
if(!(this.userModule instanceof LDAPUserModule))
{
//in case of a database version, use the cache optmized way to lookup the permissions
- String lookupByRole = "SELECT * from jbp_cms_perm p,jbp_cms_perm_role r,jbp_role_membership m,jbp_roles roles,jbp_users users WHERE " +
+ String lookupByRole = "SELECT p.* from jbp_cms_perm p,jbp_cms_perm_role r,jbp_role_membership m,jbp_roles roles,jbp_users users WHERE " +
"p.id=r.cms_perm_id AND " +
"r.role_id=roles.jbp_name AND " +
"m.jbp_rid=roles.jbp_rid AND " +
Modified: trunk/test/src/etc/datasources.xml
===================================================================
--- trunk/test/src/etc/datasources.xml 2007-05-02 18:42:13 UTC (rev 7176)
+++ trunk/test/src/etc/datasources.xml 2007-05-02 19:12:02 UTC (rev 7177)
@@ -48,4 +48,13 @@
<password>portalpassword</password>
</datasource>
-->
+<!--
+ <datasource>
+ <datasource-name>postgresql8</datasource-name>
+ <connection-url>jdbc:postgresql:jbossportal</connection-url>
+ <driver-class>org.postgresql.Driver</driver-class>
+ <user-name>portal</user-name>
+ <password>portalpassword</password>
+ </datasource>
+-->
</datasources>
19 years
JBoss Portal SVN: r7176 - 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-05-02 14:42:13 -0400 (Wed, 02 May 2007)
New Revision: 7176
Modified:
trunk/wsrp/src/main/org/jboss/portal/test/wsrp/deployment/DeploymentTestCase.java
trunk/wsrp/src/main/org/jboss/portal/test/wsrp/other/RegistrationInfoTestCase.java
trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/EndpointConfigurationInfo.java
trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/ProducerInfo.java
trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/RegistrationInfo.java
trunk/wsrp/src/resources/portal-wsrp-sar/conf/consumer/hibernate/domain.hbm.xml
Log:
- Improved handling of registration status.
- Renamed fields in RegistrationInfo to clearly show which ones are persistent.
Modified: trunk/wsrp/src/main/org/jboss/portal/test/wsrp/deployment/DeploymentTestCase.java
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/test/wsrp/deployment/DeploymentTestCase.java 2007-05-02 13:07:29 UTC (rev 7175)
+++ trunk/wsrp/src/main/org/jboss/portal/test/wsrp/deployment/DeploymentTestCase.java 2007-05-02 18:42:13 UTC (rev 7176)
@@ -111,7 +111,7 @@
assertEquals("http://wsrp.bea.com:7001/producer/producer?WSDL", endInfo.getWsdlDefinitionURL());
RegistrationInfo regInfo = info.getRegistrationInfo();
assertNotNull(regInfo);
- assertTrue(regInfo.isRequiresRegistration());
+ assertNull(regInfo.isRegistrationRequired());
RegistrationData registrationData = regInfo.getRegistrationData();
assertNotNull(registrationData);
assertEquals("JBoss Portal 2.4 Test", registrationData.getConsumerName());
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-05-02 13:07:29 UTC (rev 7175)
+++ trunk/wsrp/src/main/org/jboss/portal/test/wsrp/other/RegistrationInfoTestCase.java 2007-05-02 18:42:13 UTC (rev 7176)
@@ -76,27 +76,33 @@
public void testRefreshNoRegistration()
{
+ // before refresh registration status is undetermined
+ assertNull(info.isRegistrationRequired());
+
ServiceDescription sd = createServiceDescription(false, 0);
RegistrationInfo.RegistrationRefreshResult result = info.refreshRegistrationRequirementsFor(sd, producerId, true);
assertNotNull(result);
assertTrue(result.isValid());
- assertFalse(info.isRequiresRegistration());
+ assertFalse(info.isRegistrationRequired().booleanValue());
assertTrue(info.isRegistrationValid());
result = info.refreshRegistrationRequirementsFor(sd, producerId, false);
assertNotNull(result);
assertTrue(result.isValid());
- assertFalse(info.isRequiresRegistration());
+ assertFalse(info.isRegistrationRequired().booleanValue());
assertTrue(info.isRegistrationValid());
}
public void testRefreshRegistrationDefaultRegistrationNoLocalInfo()
{
+ // before refresh registration status is undetermined
+ assertNull(info.isRegistrationRequired());
+
RegistrationInfo.RegistrationRefreshResult result = info.refreshRegistrationRequirementsFor(
createServiceDescription(true, 0), producerId, true);
assertNotNull(result);
assertTrue(result.isValid());
- assertTrue(info.isRequiresRegistration());
+ assertTrue(info.isRegistrationRequired().booleanValue());
assertFalse(info.isRegistrationValid());
}
Modified: trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/EndpointConfigurationInfo.java
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/EndpointConfigurationInfo.java 2007-05-02 13:07:29 UTC (rev 7175)
+++ trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/EndpointConfigurationInfo.java 2007-05-02 18:42:13 UTC (rev 7176)
@@ -70,6 +70,7 @@
private final static int PM = 2;
private final static int R = 3;
+ // todo: public for tests
public EndpointConfigurationInfo()
{
}
@@ -190,7 +191,7 @@
this.wsdlDefinitionURL = wsdlDefinitionURL;
// WSDL url is optional so can be null (and in particular, it is when loaded from Hibernate most of the time)
- if (wsdlDefinitionURL != null && serviceFactory != null)
+ if (wsdlDefinitionURL != null)
{
if (!(serviceFactory instanceof RemoteSOAPInvokerServiceFactory))
{
@@ -262,17 +263,14 @@
getServiceFactory().stop();
}
+ // todo: public for tests
public ServiceFactory getServiceFactory()
{
initServiceFactoryIfNeeded();
return serviceFactory;
}
- /**
- * Only public for tests...
- *
- * @param serviceFactory
- */
+ // todo: public for tests
public void setServiceFactory(ServiceFactory serviceFactory)
{
ParameterValidation.throwIllegalArgExceptionIfNull(serviceFactory, "ServiceFactory");
@@ -290,21 +288,25 @@
}
+ // todo: public for tests
public WSRP_v1_ServiceDescription_PortType getServiceDescriptionService() throws InvokerUnavailableException
{
return (WSRP_v1_ServiceDescription_PortType)getService(SERVICE_DESCRIPTION, WSRP_v1_ServiceDescription_PortType.class);
}
+ // todo: public for tests
public WSRP_v1_Markup_PortType getMarkupService() throws InvokerUnavailableException
{
return (WSRP_v1_Markup_PortType)getService(MARKUP, WSRP_v1_Markup_PortType.class);
}
+ // todo: public for tests
public WSRP_v1_PortletManagement_PortType getPortletManagementService() throws InvokerUnavailableException
{
return (WSRP_v1_PortletManagement_PortType)getService(PORTLET_MANAGEMENT, WSRP_v1_PortletManagement_PortType.class);
}
+ // todo: public for tests
public WSRP_v1_Registration_PortType getRegistrationService() throws InvokerUnavailableException
{
return (WSRP_v1_Registration_PortType)getService(REGISTRATION, WSRP_v1_Registration_PortType.class);
@@ -356,7 +358,7 @@
public boolean isRefreshNeeded()
{
- return areURLsDirty() || !isAvailable();
+ return !isAvailable() || areURLsDirty();
}
private boolean areURLsDirty()
Modified: trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/ProducerInfo.java
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/ProducerInfo.java 2007-05-02 13:07:29 UTC (rev 7175)
+++ trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/ProducerInfo.java 2007-05-02 18:42:13 UTC (rev 7176)
@@ -163,12 +163,12 @@
public boolean isRegistered()
{
- return isRegistrationRequired() && persistentRegistrationInfo.isRegistrationValid();
+ return persistentRegistrationInfo != null && persistentRegistrationInfo.isRegistrationValid();
}
public boolean isRegistrationRequired()
{
- return persistentRegistrationInfo != null && persistentRegistrationInfo.isRequiresRegistration();
+ return persistentRegistrationInfo != null && persistentRegistrationInfo.isRegistrationDeterminedRequired();
}
@@ -611,7 +611,7 @@
persistentRegistrationInfo = new RegistrationInfo(this);
}
- if (!persistentRegistrationInfo.isRegistrationValid())
+ if (!isRegistered())
{
if (serviceDescription == null)
@@ -662,7 +662,7 @@
public void deregister() throws PortletInvokerException
{
- if (persistentRegistrationInfo != null && persistentRegistrationInfo.isRegistrationValid())
+ if (isRegistered())
{
try
{
@@ -699,4 +699,9 @@
return result;
}
+
+ /*public boolean isRefreshNeeded()
+ {
+ return persistentEndpointInfo.isRefreshNeeded();
+ }*/
}
Modified: trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/RegistrationInfo.java
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/RegistrationInfo.java 2007-05-02 13:07:29 UTC (rev 7175)
+++ trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/RegistrationInfo.java 2007-05-02 18:42:13 UTC (rev 7176)
@@ -57,27 +57,25 @@
private final Logger log = Logger.getLogger(getClass());
private Long key;
- private String consumerName;
- private String registrationHandle;
- private byte[] registrationState;
- private boolean requiresRegistration; // todo: remove
- private Map registrationProperties;
+ private String persistentConsumerName;
+ private String persistentRegistrationHandle;
+ private byte[] persistentRegistrationState;
+ private Map persistentRegistrationProperties;
+ private transient Boolean requiresRegistration;
+
private transient RegistrationData registrationData;
- private transient ProducerInfo parent;
public RegistrationInfo(ProducerInfo producerInfo)
{
this();
ParameterValidation.throwIllegalArgExceptionIfNull(producerInfo, "ProducerInfo");
producerInfo.setRegistrationInfo(this);
- parent = producerInfo;
}
public RegistrationInfo()
{
- consumerName = WSRPConstants.DEFAULT_CONSUMER_NAME;
- requiresRegistration = true;
+ persistentConsumerName = WSRPConstants.DEFAULT_CONSUMER_NAME;
}
@@ -93,40 +91,71 @@
public String getRegistrationHandle()
{
- return registrationHandle;
+ return persistentRegistrationHandle;
}
public void setRegistrationHandle(String registrationHandle)
{
- this.registrationHandle = registrationHandle;
+ this.persistentRegistrationHandle = registrationHandle;
}
public byte[] getRegistrationState()
{
- return registrationState;
+ return persistentRegistrationState;
}
public void setRegistrationState(byte[] registrationState)
{
- this.registrationState = registrationState;
+ this.persistentRegistrationState = registrationState;
}
- public void setRequiresRegistration(boolean requiresRegistration)
+ public void setRequiresRegistration(Boolean requiresRegistration)
{
this.requiresRegistration = requiresRegistration;
}
- public boolean isRequiresRegistration()
+ /**
+ * Determines whether the associated Producer requires registration.
+ *
+ * @return <code>null</code> if this RegistrationInfo hasn't queried the Producer yet and thus, doesn't have a
+ * definitive answer on whether or not the associated Producer requires registration,
+ * <code>Boolean.TRUE</code> if the associated Producer requires registration, <code>Boolean.FALSE</code>
+ * otherwise.
+ */
+ public Boolean isRegistrationRequired()
{
return requiresRegistration;
}
+ /**
+ * Determines whether it has been determined after querying the associated Producer that it requires registration.
+ *
+ * @return <code>true</code> if and only if the associated Producer has been queried and mandates registration,
+ * <code>false</code> otherwise.
+ */
+ public boolean isRegistrationDeterminedRequired()
+ {
+ return requiresRegistration != null && requiresRegistration.booleanValue();
+ }
+
+ /**
+ * Determines whether it has been determined after querying the associated Producer that it does <strong>NOT</strong>
+ * require registration.
+ *
+ * @return <code>true</code> if and only if the associated Producer has been queried and does NOT mandate
+ * registration, <code>false</code> otherwise.
+ */
+ public boolean isRegistrationDeterminedNotRequired()
+ {
+ return requiresRegistration != null && !requiresRegistration.booleanValue();
+ }
+
public RegistrationData getRegistrationData()
{
if (registrationData == null)
{
registrationData = WSRPTypeFactory.createDefaultRegistrationData();
- registrationData.setConsumerName(consumerName);
+ registrationData.setConsumerName(persistentConsumerName);
List properties = new ArrayList();
Map regProps = getRegistrationProperties();
if (!regProps.isEmpty())
@@ -150,12 +179,12 @@
public String getConsumerName()
{
- return consumerName;
+ return persistentConsumerName;
}
public void setConsumerName(String consumerName)
{
- this.consumerName = consumerName;
+ this.persistentConsumerName = consumerName;
}
public String getConsumerAgent()
@@ -202,12 +231,12 @@
private Map getOrCreateRegistrationPropertiesMap(boolean forceCreate)
{
// todo: get from registration
- if (forceCreate && registrationProperties == null)
+ if (forceCreate && persistentRegistrationProperties == null)
{
- registrationProperties = new HashMap();
+ persistentRegistrationProperties = new HashMap();
}
- return registrationProperties;
+ return persistentRegistrationProperties;
}
public Map getRegistrationProperties()
@@ -225,7 +254,7 @@
public void setRegistrationProperties(Map registrationProperties)
{
- this.registrationProperties = registrationProperties;
+ this.persistentRegistrationProperties = registrationProperties;
}
public Set getRegistrationPropertyNames()
@@ -238,7 +267,6 @@
* @param producerId
* @return <code>true</code> if the associated producer is ready to be interacted with as far as registration is
* concerned, <code>false</code> otherwise.
- * @since 2.6
*/
boolean initialize(ServiceDescription serviceDescription, String producerId)
{
@@ -251,7 +279,6 @@
* @param producerId
* @param discardLocalInfo
* @return
- * @since 2.6
*/
public RegistrationRefreshResult refreshRegistrationRequirementsFor(ServiceDescription serviceDescription, String producerId, boolean discardLocalInfo)
{
@@ -260,7 +287,7 @@
if (serviceDescription.isRequiresRegistration())
{
- requiresRegistration = true;
+ requiresRegistration = Boolean.TRUE;
StringBuffer message = new StringBuffer("Producer '").append(producerId).append("' requires registration.");
result.appendToStatus(message.toString());
log.debug(message);
@@ -277,16 +304,16 @@
if (discardLocalInfo)
{
- registrationProperties = getOrCreateRegistrationPropertiesMap(true);
+ persistentRegistrationProperties = getOrCreateRegistrationPropertiesMap(true);
// Remove extra properties
- Set unexpected = new HashSet(registrationProperties.keySet());
+ Set unexpected = new HashSet(persistentRegistrationProperties.keySet());
unexpected.removeAll(descriptionsMap.keySet());
if (!unexpected.isEmpty())
{
for (Iterator invalidProps = unexpected.iterator(); invalidProps.hasNext();)
{
- registrationProperties.remove(invalidProps.next());
+ persistentRegistrationProperties.remove(invalidProps.next());
}
}
@@ -303,7 +330,7 @@
}
else
{
- registrationProperties.put(name, prop);
+ persistentRegistrationProperties.put(name, prop);
}
}
@@ -312,22 +339,22 @@
}
else
{
- registrationProperties = getOrCreateRegistrationPropertiesMap(true);
+ persistentRegistrationProperties = getOrCreateRegistrationPropertiesMap(true);
// check that we don't have unexpected registration properties and if so, mark them as invalid
Set expectedNames = descriptionsMap.keySet();
- checkForExtraProperties(producerId, result, expectedNames, registrationProperties);
+ checkForExtraProperties(producerId, result, expectedNames, persistentRegistrationProperties);
// now check for missing properties, add the missing ones with a null value
StringBuffer missingProps = new StringBuffer();
for (Iterator descriptionNames = expectedNames.iterator(); descriptionNames.hasNext();)
{
String name = (String)descriptionNames.next();
- RegistrationProperty prop = (RegistrationProperty)registrationProperties.get(name);
+ RegistrationProperty prop = (RegistrationProperty)persistentRegistrationProperties.get(name);
RegistrationProperty producerProp = (RegistrationProperty)descriptionsMap.get(name);
if (prop == null)
{
- registrationProperties.put(name, producerProp);
+ persistentRegistrationProperties.put(name, producerProp);
missingProps.append("Missing value for property '").append(name).append("'\n");
}
else
@@ -361,11 +388,11 @@
String msg = "Producer '" + producerId + "' doesn't require registration.";
log.debug(msg);
result.appendToStatus(msg);
- requiresRegistration = false;
+ requiresRegistration = Boolean.FALSE;
result.setValid(true);
}
- result.setRegistrationProperties(registrationProperties);
+ result.setRegistrationProperties(persistentRegistrationProperties);
String msg = "Registration configuration is " + (result.isValid() ? "" : "NOT") + " valid";
result.appendToStatus(msg);
log.debug(msg);
@@ -422,7 +449,6 @@
/**
* @param descriptions
* @return
- * @since 2.6
*/
private Map getRegistrationPropertyDescriptionsFromWSRP(PropertyDescription[] descriptions)
{
@@ -447,17 +473,17 @@
}
}
- /** @since 2.6 */
void resetRegistration()
{
registrationData = null;
- registrationHandle = null;
- registrationState = null;
+ persistentRegistrationHandle = null;
+ persistentRegistrationState = null;
}
public boolean isRegistrationValid()
{
- return registrationHandle != null || !requiresRegistration;
+ return (persistentRegistrationHandle != null && isRegistrationDeterminedRequired()) ||
+ isRegistrationDeterminedNotRequired();
}
public void setRegistrationContext(RegistrationContext registrationContext)
@@ -465,16 +491,16 @@
ParameterValidation.throwIllegalArgExceptionIfNull(registrationContext, "RegistrationContext");
String handle = registrationContext.getRegistrationHandle();
ParameterValidation.throwIllegalArgExceptionIfNullOrEmpty(handle, "registration handle", "RegistrationContext");
- registrationHandle = handle;
- registrationState = registrationContext.getRegistrationState();
+ persistentRegistrationHandle = handle;
+ persistentRegistrationState = registrationContext.getRegistrationState();
}
public RegistrationContext getRegistrationContext()
{
- if (registrationHandle != null)
+ if (persistentRegistrationHandle != null)
{
- RegistrationContext registrationContext = WSRPTypeFactory.createRegistrationContext(registrationHandle);
- registrationContext.setRegistrationState(registrationState);
+ RegistrationContext registrationContext = WSRPTypeFactory.createRegistrationContext(persistentRegistrationHandle);
+ registrationContext.setRegistrationState(persistentRegistrationState);
return registrationContext;
}
else
Modified: trunk/wsrp/src/resources/portal-wsrp-sar/conf/consumer/hibernate/domain.hbm.xml
===================================================================
--- trunk/wsrp/src/resources/portal-wsrp-sar/conf/consumer/hibernate/domain.hbm.xml 2007-05-02 13:07:29 UTC (rev 7175)
+++ trunk/wsrp/src/resources/portal-wsrp-sar/conf/consumer/hibernate/domain.hbm.xml 2007-05-02 18:42:13 UTC (rev 7176)
@@ -76,7 +76,7 @@
<property name="consumerName" column="CONSUMER_NAME" type="java.lang.String" not-null="true"/>
<property name="registrationHandle" column="HANDLE" type="java.lang.String"/>
<property name="registrationState" column="STATE" type="binary" length="50000000"/>
- <map name="registrationProperties" cascade="all,delete-orphan" lazy="false" access="field">
+ <map name="persistentRegistrationProperties" cascade="all,delete-orphan" lazy="false" access="field">
<cache usage="@portal.hibernate.cache.usage@"/>
<key column="REG_PK" not-null="true"/>
<map-key type="string" column="name"/>
19 years
JBoss Portal SVN: r7175 - in docs/trunk/referenceGuide/en: modules and 1 other directory.
by portal-commits@lists.jboss.org
Author: thomas.heute(a)jboss.com
Date: 2007-05-02 09:07:29 -0400 (Wed, 02 May 2007)
New Revision: 7175
Removed:
docs/trunk/referenceGuide/en/modules/ipc.xml
Modified:
docs/trunk/referenceGuide/en/master.xml
docs/trunk/referenceGuide/en/modules/portalapi.xml
Log:
Merged IPC and PortalAPI
Modified: docs/trunk/referenceGuide/en/master.xml
===================================================================
--- docs/trunk/referenceGuide/en/master.xml 2007-05-02 08:35:47 UTC (rev 7174)
+++ docs/trunk/referenceGuide/en/master.xml 2007-05-02 13:07:29 UTC (rev 7175)
@@ -12,7 +12,6 @@
<!ENTITY tutorials SYSTEM "modules/tutorials.xml">
<!ENTITY xmldescriptors SYSTEM "modules/xmldescriptors.xml">
<!ENTITY urls SYSTEM "modules/urls.xml">
- <!ENTITY ipc SYSTEM "modules/ipc.xml">
<!ENTITY CMS SYSTEM "modules/cmsPortlet.xml">
<!ENTITY navtabs SYSTEM "modules/navtabs.xml">
<!ENTITY themeandlayouts SYSTEM "modules/themeandlayouts.xml">
@@ -69,7 +68,6 @@
<!-- understanding urls --> &urls;
<!-- Content integration --> &contentIntegration;
<!-- Portal API --> &portalapi;
- <!-- IPC --> &ipc;
<!-- clustering configuration --> &clustering;
<!-- WSRP --> &wsrp;
<!-- security administration --> &security;
Deleted: docs/trunk/referenceGuide/en/modules/ipc.xml
===================================================================
--- docs/trunk/referenceGuide/en/modules/ipc.xml 2007-05-02 08:35:47 UTC (rev 7174)
+++ docs/trunk/referenceGuide/en/modules/ipc.xml 2007-05-02 13:07:29 UTC (rev 7175)
@@ -1,234 +0,0 @@
-<chapter id="ipc">
- <chapterinfo>
- <author>
- <firstname>Roy</firstname>
- <surname>Russo</surname>
- <email>roy(a)jboss.org</email>
- </author>
- </chapterinfo>
- <title>InterPortlet Communication (IPC)</title>
- <sect1>
- <title>Introduction</title>
- <para>
- The first version of the Portlet Specification (JSR 168), regretfully, did not cover interaction between
- portlets on a page. The side-effect of diverting the issue to the subsequent release of the specification, has
- forced portal vendors to each craft their own proprietary API to achieve interportlet communication. This
- chapter covers the JBoss Portal Interportlet Communication API, and its ability to allow a developer to create
- links to other portal pages and affect behaviour in other portlets.
- </para>
- <note>For the remainder of this chapter, the sample available
- <ulink
- url="http://anonsvn.jboss.org/repos/portletswap/portlets/2_4/bundles/HelloWorl...">
- here</ulink>
- , will be used to cover the API.
- </note>
- <warning>JBoss Portal IPC enables a one-to-one relationship between portlets! Do not attempt to affect behaviour
- of more than one portlet per action, as it will not work!</warning>
- </sect1>
- <sect1>
- <title>Configuration</title>
- <sect2>
- <title>Service Descriptor</title>
- <para>
- IPC requires that a listener be available to intercept requests and respond appropriately. To enable the
- listener, it has to be declared as an mbean in your service descriptor, as in our example under
- <emphasis>helloworldipcportlet.sar/META-INF/jboss-service.xml</emphasis>
- :
- <programlisting>
- <![CDATA[
-<?xml version="1.0" encoding="UTF-8"?>
-<server>
- <mbean
- code="org.jboss.portal.core.event.PortalEventListenerServiceImpl"
- name="portal:service=ListenerService,type=ipc_listener"
- xmbean-dd=""
- xmbean-code="org.jboss.portal.common.system.JBossServiceModelMBean">
- <xmbean/>
- <depends
- optional-attribute-name="Registry"
- proxy-type="attribute">portal:service=ListenerRegistry</depends>
- <attribute name="RegistryId">ipc_listener</attribute>
- <attribute name="ListenerClassName">org.jboss.portlet.hello.HelloWorldPortletB$Listener
- </attribute>
- </mbean>
-</server>]]>
- </programlisting>
- It is important to note here, that you will most likely not have to change any of these values, except for
- the
- following:
- <itemizedlist>
- <listitem>
- <emphasis role="bold">name:</emphasis>
- Both the
- <emphasis>mbean type</emphasis>
- and the
- <emphasis>RegistryId</emphasis>
- value must match.
- </listitem>
- <listitem>
- <emphasis role="bold">ListenerClassName:</emphasis>
- Full path to the listening portet's inner class that acts as the listener.
- </listitem>
- </itemizedlist>
- </para>
- </sect2>
- <sect2>
- <title>Portal Descriptor</title>
- <para>Enabling IPC, also requires that the listener be declared in the *-object.xml, so the Portal recognizes
- it.
- The declaration happens at the page level, as in our example:
- <programlisting><![CDATA[<!DOCTYPE deployments PUBLIC
- "-//JBoss Portal//DTD Portal Object 2.6//EN"
- "http://www.jboss.org/portal/dtd/portal-object_2_6.dtd">
-<deployments>
- <deployment>
- <parent-ref>default</parent-ref>
- <if-exists>overwrite</if-exists>
- <page>
- <page-name>IPC</page-name>
- <listener>ipc_listener</listener>
- ...]]>
- </programlisting>
- <note>The
- <emphasis>listener</emphasis>
- value must match the
- <emphasis>name</emphasis>
- values in your service descriptor!
- </note>
- </para>
- </sect2>
- <sect2>
- <title>The Listener</title>
- <para>
- Now that the listener is configured in the service descriptor and the portal can recognize it, we must
- create the appropriate listener class within our portlet.
- </para>
- <para>In our example, Portlet A will be modifying the behaviour of Portlet B. So then we will declare the
- listener in Portlet B, the recipient portlet.
- <programlisting><![CDATA[
-public static class Listener implements PortalNodeEventListener
-{
- public PortalNodeEvent onEvent(PortalNodeEventContext context, PortalNodeEvent event)
- {
- PortalNode node = event.getNode();
-
- // Get node name
- String nodeName = node.getName();
-
- // See if we need to create a new event or not
- WindowActionEvent newEvent = null;
- if(nodeName.equals("HelloWorldPortletAWindow") && event instanceof WindowActionEvent)
- {
- // Find window B
- WindowActionEvent wae = (WindowActionEvent) event;
- PortalNode windowB = node.resolve("../HelloWorldPortletBWindow");
- if(windowB != null)
- {
- // We can redirect and modify the view/mode as well!
- newEvent = new WindowActionEvent(windowB);
- newEvent.setMode(wae.getMode());
- //newEvent.setWindowState(WindowState.MAXIMIZED);
- newEvent.setParameters(wae.getParameters());
- }
- }
-
- //
- if(newEvent != null)
- {
- // If we have a new event redirect to it
- return newEvent;
- }
- else
- {
- // Otherwise bubble up
- return context.dispatch();
- }
- }
-}]]></programlisting>
- </para>
- <para>
- It is important to note here some of the important items in this listener class.
- Logic used to determine if the requesting node was Portlet A.:
- <programlisting>nodeName.equals("HelloWorldPortletAWindow")</programlisting>
- </para>
- <para>
- Get the current window object so we can dispatch the event to it:
- <programlisting>PortalNode windowB = node.resolve("../HelloWorldPortletBWindow");</programlisting>
- </para>
- <para>
- Set the original parameter from Portlet A, so Portlet B can access them in its processAction():
- <programlisting>newEvent.setParameters(wae.getParameters());</programlisting>
- </para>
- <para>
- Modify Portlet B windowmode and/or windowstate (ie, Maximize and place in Edit Mode):
- <programlisting>
-newEvent.setMode(wae.getMode()); // Mode.EDIT;
-newEvent.setWindowState(wae.getWindowState()); // WindowState.MAXIMIZED</programlisting>
- </para>
- </sect2>
- </sect1>
- <sect1>
- <title>Communicating with another Portlet</title>
- <para>
- Creating a link from Portlet A to Portlet B occurs in the same way you would normally create a PortletURL:
- <programlisting><![CDATA[
-html.append("<form action=\"" + resp.createActionURL() + "\" method=\"post\">");
-html.append("<input type=\"text\" name=\"sometext\"><br/>");
-html.append("<select name=\"color\">");
-html.append("<option>blue</option>");
-html.append("<option>red</option>");
-html.append("<option>black</option>");
-html.append("</select>");
-html.append("<input type=\"submit\"/>");
-html.append("</form>");]]></programlisting>
- As you can see from the code above, we are creating a simple HTML form with an ActionURL from within Portlet A.
- It will target itself, but be intercepted by the listener, created in Portlet B. This form passes some text and
- a color value from input fields.
- </para>
- <para>
- Now, in Portlet B, our listener innerclass will trigger the processAction() in Portlet B, reading in the
- parameters from the Portlet A form:
- <programlisting><![CDATA[
-public void processAction(JBossActionRequest request, JBossActionResponse response)
- throws PortletException, PortletSecurityException, IOException
-{
- String color = request.getParameter("color");
- String text = request.getParameter("sometext");
- if(color != null && text != null)
- {
- response.setRenderParameter("color", color);
- response.setRenderParameter("sometext", text);
- }
-}]]></programlisting>
- Setting the render parameters, it will now pass them on to the Portlet B, doView();
- </para>
-
- </sect1>
- <sect1>
- <title>Communicating with another Page</title>
- <para>
- As seen in the included NavigationPortlet (tabs found at the top of the default layout), we are able to create
- links to Portal Pages. Included in the
- <ulink
- url="http://anonsvn.jboss.org/repos/portletswap/portlets/2_4/bundles/HelloWorl...">
- download sample</ulink>
- , you can see the basics of creating a link to a Portal Page. I have added comments in-line to explain the code
- sample below:
- <programlisting>
-<![CDATA[
-// Get the ParentNode. Since we are inside a Window, the Parent is the Page
-PortalNode thisNode = req.getPortalNode().getParent();
-
-// Get the Node in the Portal hierarchy tree known as "../default"
-PortalNode linkToNode = thisNode.resolve("../default");
-
-// Create a RenderURL to the "../default" Page Node
-PortalNodeURL pageURL = resp.createRenderURL(linkToNode);
-
-// Output the Node's name and URL for users
-html.append("Page: " + linkToNode.getName() + " -> ");
-html.append("<a href=\"" + pageURL.toString() + "\">" + linkToNode.getName() + "</a>");
- ]]></programlisting>
- </para>
- </sect1>
-</chapter>
Modified: docs/trunk/referenceGuide/en/modules/portalapi.xml
===================================================================
--- docs/trunk/referenceGuide/en/modules/portalapi.xml 2007-05-02 08:35:47 UTC (rev 7174)
+++ docs/trunk/referenceGuide/en/modules/portalapi.xml 2007-05-02 13:07:29 UTC (rev 7175)
@@ -5,6 +5,11 @@
<surname>Viet</surname>
<email>julien(a)jboss.org</email>
</author>
+ <author>
+ <firstname>Thomas</firstname>
+ <surname>Heute</surname>
+ <email>theute(a)jboss.org</email>
+ </author>
</chapterinfo>
<title>Portal API</title>
<sect1>
@@ -324,15 +329,281 @@
</sect2>
<sect2>
<title>Portal session events</title>
- <para>The life cycle of the session of the portal associated with the user can also raise events.</para>
+ <para>The life cycle of the session of the portal associated with the user can also raise events. This kind of
+ event is not bound to a portal node since it is triggered whenever a portal session is created or destroyed</para>
+ <mediaobject>
+ <imageobject>
+ <imagedata align="center" fileref="images/portalapi/PortalSessionEvent.png" format="png"/>
+ </imageobject>
+ <caption>
+ <para>The PortalSessionEvent class</para>
+ </caption>
+ </mediaobject>
+ <para>There are two different types of events:
+ <itemizedlist>
+ <listitem>org.jboss.portal.api.session.event.PortalSessionEvent.SESSION_CREATED, fired when a new portal session is created</listitem>
+ <listitem>org.jboss.portal.api.session.event.PortalSessionEvent.SESSION_DESTROYED, fired when a new portal session is destroyed</listitem>
+ </itemizedlist>
+ </para>
</sect2>
<sect2>
<title>Portal user events</title>
- <para>The life cycle of the user can also raise events such as its authentication.</para>
+ <para>The life cycle of the portal user can also raise events such as its authentication. A subclass of the wider scope UserEvent class is
+ provided and triggers events whenever a user signs in or out. The UserEvent object gives access to the user name of the logged-in user through
+ the method <emphasis>String getId()</emphasis>.</para>
+ <mediaobject>
+ <imageobject>
+ <imagedata align="center" fileref="images/portalapi/user.event.png" format="png"/>
+ </imageobject>
+ <caption>
+ <para>The UserEvent class and UserAuthenticationEvent sub-classes</para>
+ </caption>
+ </mediaobject>
+ <para>The UserAuthenticationEvent triggers two events that can be catched:
+ <itemizedlist>
+ <listitem>org.jboss.portal.api.session.event.UserAuthenticationEvent.SIGN_IN, fired when a portal user signs in</listitem>
+ <listitem>org.jboss.portal.api.session.event.UserAuthenticationEvent.SIGN_OUT, fired when a portal user signs out</listitem>
+ </itemizedlist>
+ </para>
+ <para>Based on the UserEvent class other custom user related events could be added like one that would trigger when a new user is
+ being registered</para>
</sect2>
</sect1>
<sect1>
<title>Examples</title>
- <para>todo</para>
+ <para>The events mechanism is quite powerful, in this section of the chapter we will see few simple examples to explain how
+ it works.</para>
+ <sect2>
+ <title>UserAuthenticationEvent example</title>
+ <para>In this example, we will create a simple counter of the number of logged-in registered users. In ordder to do that we just need to keep track
+ of Sign-in and Sign-out events.</para>
+ <para>First, let's write our listener. It just a class that will implement <emphasis>org.jboss.portal.api.event.PortalEventListener</emphasis> and
+ its unique method <emphasis>void onEvent(PortalEventContext eventContext, PortalEvent event)</emphasis>. Here is such an example:
+ <programlisting><![CDATA[
+package org.jboss.portal.core.portlet.test.event;
+
+import[...]
+
+public class UserCounterListener implements PortalEventListener
+{
+
+ /** Thread-safe long */
+ private final SynchronizedLong counter = new SynchronizedLong(0);
+
+ /** Thread-safe long */
+ private final SynchronizedLong counterEver = new SynchronizedLong(0);
+
+ public void onEvent(PortalEventContext eventContext, PortalEvent event)
+ {
+ if (event instanceof UserAuthenticationEvent)
+ {
+ UserAuthenticationEvent userEvent = (UserAuthenticationEvent)event;
+ if (userEvent.getType() == UserAuthenticationEvent.SIGN_IN)
+ {
+ counter.increment();
+ counterEver.increment();
+ }
+ else if (userEvent.getType() == UserAuthenticationEvent.SIGN_OUT)
+ {
+ counter.decrement();
+ }
+ System.out.println("Counter : " + counter.get());
+ System.out.println("Counter ever: " + counterEver.get());
+ }
+ }
+}
+ ]]></programlisting>
+ On this method we simply filter down to UserAuthenticationEvent then depending on the type of authentication event we update the
+ counters. <emphasis>counter</emphasis> keeps track of the registered and logged-in users, while counterEver only counts the number of
+ times people logged-in the portal.</para>
+ <para>Now that the Java class has been written we need to register it so that it can be actionned when the events are triggered. To do
+ so we need to register it as an mbean. It can be done by editing the sar descriptor file:
+ <emphasis>YourService.sar/META-INF/jboss-service.xml</emphasis> so that it looks like the following:
+ <programlisting><![CDATA[
+<?xml version="1.0" encoding="UTF-8"?>
+<server>
+ <mbean
+ code="org.jboss.portal.core.event.PortalEventListenerServiceImpl"
+ name="portal:service=ListenerService,type=counter_listener"
+ xmbean-dd=""
+ xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
+ <xmbean/>
+ <depends
+ optional-attribute-name="Registry"
+ proxy-type="attribute">portal:service=ListenerRegistry</depends>
+ <attribute name="RegistryId">counter_listener</attribute>
+ <attribute name="ListenerClassName">
+ org.jboss.portal.core.portlet.test.event.UserCounterListener
+ </attribute>
+ </mbean>
+</server>
+ ]]></programlisting>
+ This snippet can be kept as it is, providing you change the values:
+ <itemizedlist>
+ <listitem>
+ <emphasis role="bold">name:</emphasis> Must follow the pattern: portal:service=ListenerService,type={{UNIQUENAME}}
+ </listitem>
+ <listitem>
+ <emphasis role="bold">RegistryId:</emphasis> Must match the type (here: counter_listener)
+ </listitem>
+ <listitem>
+ <emphasis role="bold">ListenerClassName:</emphasis> Full path to the listener
+ (here: org.jboss.portal.core.portlet.test.event.UserCounterListener).
+ </listitem>
+ </itemizedlist>
+ </para>
+ <para>That's it we now have a user counter that will display it states each time a user logs-in our logs-out.</para>
+ </sect2>
+ <sect2>
+ <title>Achieving Inter Portlet Communication with the events mechanism</title>
+ <para>The first version of the Portlet Specification (JSR 168), regretfully, did not cover interaction between
+ portlets. The side-effect of diverting the issue to the subsequent release of the specification, has
+ forced portal vendors to each craft their own proprietary API to achieve interportlet communication. Here we will
+ see how we can use the event mechanism to pass parameters from one portlet to the other.</para>
+ <para>The overall scenario will be that Portlet B will need to be updated based on some parameter set on Portlet A.
+ To achieve that we will use a portal node event.</para>
+ <para>Portlet A is a simple Generic portlet that has a form that sends a color name:
+ <programlisting><![CDATA[
+public class PortletA extends GenericPortlet
+{
+ protected void doView(RenderRequest request, RenderResponse response)
+ throws PortletException, PortletSecurityException, IOException
+ {
+ response.setContentType("text/html");
+ PrintWriter writer = response.getWriter();
+ writer.println("<form action=\"" + response.createActionURL() + "\" method=\"post\">");
+ writer.println("<select name=\"color\">");
+ writer.println("<option>blue</option>");
+ writer.println("<option>red</option>");
+ writer.println("<option>black</option>");
+ writer.println("</select>");
+ writer.println("<input type=\"submit\"/>");
+ writer.println("</form>");
+ writer.close();
+ }
+}
+ ]]></programlisting>
+ </para>
+ <para>The other portlet (Portlet B) that will receive parameters from Portlet A is also a simple Generic portlet:
+ <programlisting><![CDATA[
+public class PortletB extends GenericPortlet
+{
+
+ public void processAction(ActionRequest request, ActionResponse response)
+ throws PortletException, PortletSecurityException, IOException
+ {
+ String color = request.getParameter("color");
+ if (color != null)
+ {
+ response.setRenderParameter("color", color);
+ }
+ }
+
+ protected void doView(RenderRequest request, RenderResponse response)
+ throws PortletException, PortletSecurityException, IOException
+ {
+ String color = request.getParameter("color");
+ response.setContentType("text/html");
+ PrintWriter writer = response.getWriter();
+ writer.println("<div" +
+ (color == null ? "" : " style=\"color:" + color + ";\"") +
+ ">some text in color</div>");
+ writer.close();
+ }
+
+ // Inner listener explained after
+}
+ ]]></programlisting>
+ </para>
+ <para>With those two portlets in hands, we just want to pass parameters from Portlet A to Portlet B (the color in
+ as a request parameter in our case). In order to achieve this goal, we will write an inner Listener in Portlet B
+ that will be triggered on any WindowActionEvent of Portlet A. This listener will create a new WindowActionEvent
+ on the window of Portlet B.
+ <programlisting><![CDATA[
+public static class Listener implements PortalNodeEventListener
+{
+ public PortalNodeEvent onEvent(PortalNodeEventContext context, PortalNodeEvent event)
+ {
+ PortalNode node = event.getNode();
+ // Get node name
+ String nodeName = node.getName();
+ // See if we need to create a new event or not
+ WindowActionEvent newEvent = null;
+ if (nodeName.equals("PortletAWindow") && event instanceof WindowActionEvent)
+ {
+ // Find window B
+ WindowActionEvent wae = (WindowActionEvent)event;
+ PortalNode windowB = node.resolve("../PortletBWindow");
+ if (windowB != null)
+ {
+ // We can redirect
+ newEvent = new WindowActionEvent(windowB);
+ newEvent.setParameters(wae.getParameters());
+ // Redirect to the new event
+ return newEvent;
+ }
+ }
+ // Otherwise bubble up
+ return context.dispatch();
+ }
+}
+ ]]></programlisting>
+ </para>
+ <para>
+ It is important to note here some of the important items in this listener class.
+ Logic used to determine if the requesting node was Portlet A.:
+ <programlisting>nodeName.equals("PortletAWindow")</programlisting>
+ </para>
+ <para>
+ Get the current window object so we can dispatch the event to it:
+ <programlisting>PortalNode windowB = node.resolve("../PortletBWindow");</programlisting>
+ </para>
+ <para>
+ Set the original parameter from Portlet A, so Portlet B can access them in its processAction():
+ <programlisting>newEvent.setParameters(wae.getParameters());</programlisting>
+ </para>
+ <!--
+ <para>
+ Modify Portlet B windowmode and/or windowstate (ie, Maximize and place in Edit Mode):
+ <programlisting>
+newEvent.setMode(wae.getMode()); // Mode.EDIT;
+newEvent.setWindowState(wae.getWindowState()); // WindowState.MAXIMIZED</programlisting>
+ </para>
+ -->
+ <note>The portlet 2.0 specification (JSR 286) will cover Inter Portlet Communication so that portlets using it
+ can work with different portal vendors.</note>
+ </sect2>
+ <sect2>
+ <title>Link to other pages</title>
+ <para>Linking to some other pages or portals is also out of the scope of the portlet
+ specification. As seen previously JBoss Portal offers an API in order to create links
+ to other portal nodes. The JBoss request gives access to the current window node from
+ which we can navigate from.</para>
+ <programlisting>
+<![CDATA[
+// Get the ParentNode. Since we are inside a Window, the Parent is the Page
+PortalNode thisNode = req.getPortalNode().getParent();
+
+// Get the Node in the Portal hierarchy tree known as "../default"
+PortalNode linkToNode = thisNode.resolve("../default");
+
+// Create a RenderURL to the "../default" Page Node
+PortalNodeURL pageURL = resp.createRenderURL(linkToNode);
+
+// Output the Node's name and URL for users
+html.append("Page: " + linkToNode.getName() + " -> ");
+html.append("<a href=\"" + pageURL.toString() + "\">" + linkToNode.getName() + "</a>");
+ ]]></programlisting>
+ <para>From this, it is easy to create a menu or sitemap, the <emphasis>List getChildren()</emphasis>
+ method will return all the child nodes on which the user has the view right access.</para>
+ </sect2>
+ <note>
+ <title>Samples</title>
+ <para>Those examples are available in the core-samples package in the sources of JBoss Portal.
+ There are more examples of events usage in the samples delivered with JBoss Portal. One of them
+ shows the usage of a portal node event to only have one window in normal mode at a time in a region.
+ Anytime another window is being put in normal mode, all the other windows of the same regions
+ are automatically minimized.</para>
+ </note>
</sect1>
</chapter>
19 years
JBoss Portal SVN: r7173 - trunk/core-samples.
by portal-commits@lists.jboss.org
Author: thomas.heute(a)jboss.com
Date: 2007-05-02 04:04:33 -0400 (Wed, 02 May 2007)
New Revision: 7173
Modified:
trunk/core-samples/.classpath
Log:
Eclipse update
Modified: trunk/core-samples/.classpath
===================================================================
--- trunk/core-samples/.classpath 2007-05-02 07:59:09 UTC (rev 7172)
+++ trunk/core-samples/.classpath 2007-05-02 08:04:33 UTC (rev 7173)
@@ -12,5 +12,6 @@
<classpathentry combineaccessrules="false" kind="src" path="/theme"/>
<classpathentry kind="lib" path="/thirdparty/jbossas/core-libs/lib/jboss-j2ee.jar"/>
<classpathentry kind="lib" path="/thirdparty/apache-fileupload/lib/commons-fileupload.jar"/>
+ <classpathentry kind="lib" path="/thirdparty/oswego-concurrent/lib/concurrent.jar"/>
<classpathentry kind="output" path="bin"/>
</classpath>
19 years
JBoss Portal SVN: r7172 - docs/trunk/referenceGuide/en/modules.
by portal-commits@lists.jboss.org
Author: bdaw
Date: 2007-05-02 03:59:09 -0400 (Wed, 02 May 2007)
New Revision: 7172
Modified:
docs/trunk/referenceGuide/en/modules/xmldescriptors.xml
Log:
- update dtd description in XML chapter
Modified: docs/trunk/referenceGuide/en/modules/xmldescriptors.xml
===================================================================
--- docs/trunk/referenceGuide/en/modules/xmldescriptors.xml 2007-05-02 07:58:28 UTC (rev 7171)
+++ docs/trunk/referenceGuide/en/modules/xmldescriptors.xml 2007-05-02 07:59:09 UTC (rev 7172)
@@ -57,17 +57,17 @@
]]>
</para><para><programlisting><![CDATA[
-The remotable element is used to configure the default behavior of the portlets with respect
-to WSRP exposure.
+The remotable element is used to configure the default behavior of the portlets with
+respect to WSRP exposure.
-For each portlet defined in portlet.xml, it is possible to configure specific settings
-of the portlet container.
+For each portlet defined in portlet.xml, it is possible to configure specific
+settings of the portlet container.
-It is also possible to inject services in the portlet context of the application using the
-service elements.]]></programlisting></para>
+It is also possible to inject services in the portlet context of the application
+using the service elements.]]></programlisting></para>
</listitem><listitem>
<para>
-Element <![CDATA[<!ELEMENT portlet (portlet-name,remotable?,session-config?,transaction?,header-content?)>
+Element <![CDATA[<!ELEMENT portlet (portlet-name,remotable?,ajax?,session-config?,transaction?,header-content?)>
]]>
</para><para><programlisting><![CDATA[
@@ -77,15 +77,15 @@
in portlet.xml of the same web application.
The remotable element configures the portlet exposure to WSRP. If no value is present
-then the value considered is either the value defined globally at the portlet application
-level or false.
+then the value considered is either the value defined globally at the portlet
+application level or false.
The trans-attribute value specifies the behavior of the portlet when it is invoked at
runtime with respect to the transactionnal context. According to how the portlet is
invoked a transaction may exist or not before the portlet is invoked. Usually in the
-local context the portal transaction could be present. By default the value
-considered is NotSupported which means that the portal transaction will be suspended
-for the duration of the portlet invocation.
+local context the portal transaction could be present. By default the value considered is
+ NotSupported which means that the portal transaction will be suspended for the duration
+ of the portlet invocation.
Example:
@@ -107,15 +107,31 @@
]]>
</para><para><programlisting><![CDATA[
-The remotable value is used for WSRP exposure.
-The accepted values are the litterals true of false.]]>
-</programlisting></para>
+The remotable value is used for WSRP exposure. The accepted values are the
+litterals true of false.]]></programlisting></para>
</listitem><listitem>
- <para>
- Element <![CDATA[<!ELEMENT session-config (distributed)>
+<para>
+Element <![CDATA[<!ELEMENT ajax (partial-refresh)>
]]>
</para><para><programlisting><![CDATA[
+The ajax tag allows to configure the ajax capabilities of the portlet. If
+the portlet is tagged as partial-refresh then the portal may use partial page
+refreshing and render only that portlet. If the portlet partial-refresh value
+is false, then the portal will perform a full page refresh when the portlet is refreshed.]]></programlisting></para>
+</listitem><listitem>
+<para>
+Element <![CDATA[<!ELEMENT partial-refresh (#PCDATA)>
+
+]]>
+</para><para><programlisting><![CDATA[
+The authorized values for the partial-refresh element are true or false.]]></programlisting></para>
+</listitem><listitem>
+<para>
+Element <![CDATA[<!ELEMENT session-config (distributed)>
+
+]]>
+</para><para><programlisting><![CDATA[
This element configure the portlet session of the portlet.
The distributed element instructs the container to distribute the session attributes
@@ -162,40 +178,39 @@
]]>
</para><para><programlisting><![CDATA[
-Specify content which should be included in the portal aggregated page when the
-portlet is present on that page. This setting only applies when the portlet is
-used in the local mode.]]></programlisting></para>
+Specify content which should be included in the portal aggregated page when the portlet
+is present on that page. This setting only applies when the portlet is used in the local mode.]]></programlisting></para>
</listitem><listitem>
<para>
-Element <![CDATA[<!ELEMENT link ANY>
+Element <![CDATA[<!ELEMENT link EMPTY>
]]>
</para><para><programlisting><![CDATA[
-todo + check if ANY cannot be restricted]]></programlisting></para>
+No content is allowed inside an link element.]]></programlisting></para>
</listitem><listitem>
<para>
-Element <![CDATA[<!ELEMENT script ANY>
+Element <![CDATA[<!ELEMENT script (#PCDATA)>
]]>
</para><para><programlisting><![CDATA[
-todo + check if ANY cannot be restricted]]></programlisting></para>
+The script header element can contain inline script definitions.]]></programlisting></para>
</listitem><listitem>
<para>
-Element <![CDATA[<!ELEMENT meta ANY>
+Element <![CDATA[<!ELEMENT meta EMPTY>
]]>
</para><para><programlisting><![CDATA[
-todo + check if ANY cannot be restricted]]></programlisting></para>
+No content is allowed for meta element.]]></programlisting></para>
</listitem><listitem>
<para>
Element <![CDATA[<!ELEMENT service (service-name,service-class,service-ref)>
]]>
</para><para><programlisting><![CDATA[
-Declare a service that will be injected by the portlet container as an attribute
-of the portlet context.
+Declare a service that will be injected by the portlet container as an
+attribute of the portlet context.
-Example :
+Example:
<service>
<service-name>UserModule</service-name>
@@ -203,8 +218,8 @@
<service-ref>:service=Module,type=User</service-ref>
</service>
-In the portlet it is then possible to use it by doing a lookup on the service name,
-for example in the init() lifecycle method :
+In the portlet it is then possible to use it by doing a lookup on the service
+name, for example in the init() lifecycle method :
public void init()
{
@@ -230,10 +245,11 @@
]]>
</para><para><programlisting><![CDATA[
-The reference to the service. In the JMX Microkernel environment it consist of the
-JMX name of the service MBean. For an MBean reference if the domain is left out,
-then the current domain of the portal will be used.]]></programlisting></para>
+The reference to the service. In the JMX Microkernel environment it consist of the JMX
+name of the service MBean. For an MBean reference if the domain is left out, then the
+current domain of the portal will be used.]]></programlisting></para>
</listitem></itemizedlist>
+
</para>
</sect2>
<sect2>
@@ -260,7 +276,11 @@
]]>
</para><para><programlisting><![CDATA[
-]]></programlisting></para>
+The if-exists element is used to define action to take if instance with such name is
+already present. Possible values are overwrite or keep . Overwrite will destroy the
+existing object in the database and create a new one, based on the content of the
+deployment. Keep will maintain the existing object deployment or create a new one if
+it does not yet exist.]]></programlisting></para>
</listitem><listitem>
<para>
Element <![CDATA[<!ELEMENT instance (instance-id,portlet-ref,preferences?,security-constraint?)>
@@ -268,9 +288,9 @@
]]>
</para><para><programlisting><![CDATA[
The instance element is used to create an instance of a portlet from the portlet
-application of the same war file containing the portlet-instances.xml file.
-The portlet will be created and configured only if the portlet is present
-and an instance with such a name does not already exist.
+application of the same war file containing the portlet-instances.xml file. The portlet
+will be created and configured only if the portlet is present and an instance with
+such a name does not already exist.
Example :
@@ -334,39 +354,64 @@
A string value.]]></programlisting></para>
</listitem><listitem>
<para>
-Element <![CDATA[<!ELEMENT security-constraint (policy-permission)>
+Element <![CDATA[<!ELEMENT security-constraint (policy-permission*)>
]]>
</para><para><programlisting><![CDATA[
-todo]]></programlisting></para>
+The security-constraint element is a container for policy-permission elements
+
+Examples:
+
+<security-constraint>
+ <policy-permission>
+ <role-name>User</role-name>
+ <action-name>view</action-name>
+ </policy-permission>
+</security-constraint>
+
+<security-constraint>
+ <policy-permission>
+ <unchecked/>
+ <action-name>view</action-name>
+ </policy-permission>
+</security-constraint>]]></programlisting></para>
</listitem><listitem>
<para>
Element <![CDATA[<!ELEMENT policy-permission (action-name*,unchecked?,role-name*)>
]]>
</para><para><programlisting><![CDATA[
-todo]]></programlisting></para>
+The policy-permission element is used to secure a specific portlet instance based on a user's role.]]></programlisting></para>
</listitem><listitem>
<para>
Element <![CDATA[<!ELEMENT action-name (#PCDATA)>
]]>
</para><para><programlisting><![CDATA[
-todo]]></programlisting></para>
+The action-name element is used to define the access rights given to the role defined.
+Possible values are:
+
+ * view - Users can view the page.
+ * viewrecursive - Users can view the page and child pages.
+ * personalize - Users are able to view AND personalize the page.
+ * personalizerecursive - Users are able to view AND personalize the page AND its child
+ pages.]]></programlisting></para>
</listitem><listitem>
<para>
Element <![CDATA[<!ELEMENT unchecked EMPTY>
]]>
</para><para><programlisting><![CDATA[
-todo]]></programlisting></para>
+The unchecked element is used to define (if present) that anyone can view this instance]]></programlisting></para>
</listitem><listitem>
<para>
Element <![CDATA[<!ELEMENT role-name (#PCDATA)>
]]>
</para><para><programlisting><![CDATA[
-todo]]></programlisting></para>
+The role-name element is used to define a role that this security constraint will apply to
+
+ * <role-name>SOMEROLE</role-name> Access to this instance is limited to the defined role.]]></programlisting></para>
</listitem></itemizedlist>
</para>
</sect2>
@@ -389,10 +434,10 @@
</para><para><programlisting><![CDATA[
The deployment is a generic container for portal object elements. The parent-ref
child gives the name of the parent object that the current object will use as parent.
-The optional if-exists element define the behavior when a portal object which an identical
-name is already child of the parent element. The default behavior of the if-exist tag is to
-keep the existing object and not create a new object. The last element is the portal object
-itself.
+The optional if-exists element define the behavior when a portal object which
+an identical name is already child of the parent element. The default behavior of
+the if-exist tag is to keep the existing object and not create a new object. The
+last element is the portal object itself.
Example:
@@ -405,12 +450,11 @@
All portal objects have a common configuration which can be :
-1/ a listener : specifies the id of a listener is the listener registry.
-A listener object is able to listen portal events which apply to the portal
-node hierarchy.
+1/ a listener : specifies the id of a listener is the listener registry. A listener
+object is able to listen portal events which apply to the portal node hierarchy.
-2/ properties : a set of generic properties owned by the portal object.
-Some properties can drive the behavior of the object.
+2/ properties : a set of generic properties owned by the portal object. Some
+properties can drive the behavior of the object.
3/ security-constraint : defines security configuration of the portal object.]]></programlisting></para>
</listitem><listitem>
@@ -426,9 +470,11 @@
Example:
<parent-ref/> the root having an empty path
+
<parent-ref>default</parent-ref> the object with the name default under the root
- having the path (default) <parent-ref>default.default</parent-ref> the object with
- the path (default,default)]]></programlisting></para>
+having the path (default)
+
+<parent-ref>default.default</parent-ref> the object with the path (default,default)]]></programlisting></para>
</listitem><listitem>
<para>
Element <![CDATA[<!ELEMENT if-exists (#PCDATA)>
@@ -436,8 +482,8 @@
]]>
</para><para><programlisting><![CDATA[
The authorized values are overwrite and keep. Overwrite means that the existing
-object will be destroyed and the current declaration will be used. Keep means
-that the existing object will not be destroyed and no creation hence will be done.]]></programlisting></para>
+object will be destroyed and the current declaration will be used. Keep means that
+the existing object will not be destroyed and no creation hence will be done.]]></programlisting></para>
</listitem><listitem>
<para>
Element <![CDATA[<!ELEMENT context (context-name,properties?,listener?,security-constraint?,portal*)>
@@ -445,8 +491,8 @@
]]>
</para><para><programlisting><![CDATA[
A portal object of type context. A context type represent a node in the tree which
-does not have a visual representation. It can exist only under the root. A context
-can only have children with the portal type.]]></programlisting></para>
+does not have a visual representation. It can exist only under the root. A context can
+only have children with the portal type.]]></programlisting></para>
</listitem><listitem>
<para>
Element <![CDATA[<!ELEMENT context-name (#PCDATA)>
@@ -461,10 +507,10 @@
]]>
</para><para><programlisting><![CDATA[
A portal object of type portal. A portal type represents a virtual portal and can
-have children of type page. In addition of the common portal object elements it
-support also the declaration of the modes and the window states it supports. If
-no declaration of modes or window states is done then the default value will be
-respectively (view,edit,help) and (normal,minimized,maximized).]]></programlisting></para>
+have children of type page. In addition of the common portal object elements it support
+also the declaration of the modes and the window states it supports. If no declaration
+of modes or window states is done then the default value will be respectively
+(view,edit,help) and (normal,minimized,maximized).]]></programlisting></para>
</listitem><listitem>
<para>
Element <![CDATA[<!ELEMENT portal-name (#PCDATA)>
@@ -522,9 +568,9 @@
]]>
</para><para><programlisting><![CDATA[
-A portal object of type page. A page type represents a page which can have children
-of type page and window. The children windows are the windows of the page and the
-children pages are the subpages of this page.]]></programlisting></para>
+A portal object of type page. A page type represents a page which can have children of
+type page and window. The children windows are the windows of the page and the children
+pages are the subpages of this page.]]></programlisting></para>
</listitem><listitem>
<para>
Element <![CDATA[<!ELEMENT page-name (#PCDATA)>
@@ -538,13 +584,13 @@
]]>
</para><para><programlisting><![CDATA[
-A portal object of type window. A window type represents a window. Beside
-the common properties a window has a content and belong to a region on the page.
+A portal object of type window. A window type represents a window. Beside the common
+properties a window has a content and belong to a region on the page.
-The instance-ref or content tags are used to define the content of the window.
-The usage of the content tag is generic and can be used to describe any kind of
-content. The instance-ref is a shortcut to define a content type of portlet
-which points to a portlet instance.
+The instance-ref or content tags are used to define the content of the window. The
+usage of the content tag is generic and can be used to describe any kind of content.
+The instance-ref is a shortcut to define a content type of portlet which points to a
+portlet instance.
The region and height defines how the window is placed in the page.]]></programlisting></para>
</listitem><listitem>
@@ -560,8 +606,8 @@
]]>
</para><para><programlisting><![CDATA[
-Define the content of the window as a reference to a portlet instance.
-The value is the id of the instance.
+Define the content of the window as a reference to a portlet instance. The value
+is the id of the instance.
Example:
@@ -572,8 +618,8 @@
]]>
</para><para><programlisting><![CDATA[
-Define the content of the window in a generic manner. The content is define
-by the type of the content and an URI which acts as an identificator for the content.
+Define the content of the window in a generic manner. The content is define by
+the type of the content and an URI which acts as an identificator for the content.
Example:
@@ -651,40 +697,62 @@
A value.]]></programlisting></para>
</listitem><listitem>
<para>
-Element <![CDATA[<!ELEMENT security-constraint (policy-permission)>
+Element <![CDATA[<!ELEMENT security-constraint (policy-permission*)>
]]>
</para><para><programlisting><![CDATA[
-]]></programlisting></para>
+The security-constraint element is a container for policy-permission elements
+
+Examples:
+
+<security-constraint>
+ <policy-permission>
+ <role-name>User</role-name>
+ <action-name>view</action-name>
+ </policy-permission>
+</security-constraint>
+
+<security-constraint>
+ <policy-permission>
+ <unchecked/>
+ <action-name>view</action-name>
+ </policy-permission>
+</security-constraint>]]></programlisting></para>
</listitem><listitem>
<para>
Element <![CDATA[<!ELEMENT policy-permission (action-name*,unchecked?,role-name*)>
]]>
</para><para><programlisting><![CDATA[
-]]></programlisting></para>
+The policy-permission element is used to secure a specific portal page based on a user's role.]]></programlisting></para>
</listitem><listitem>
<para>
Element <![CDATA[<!ELEMENT action-name (#PCDATA)>
]]>
</para><para><programlisting><![CDATA[
-]]></programlisting></para>
+The role-name element is used to define a role that this security constraint will apply to
+
+ * <role-name>SOMEROLE</role-name> Access to this portal page is limited to the defined role.]]></programlisting></para>
</listitem><listitem>
<para>
Element <![CDATA[<!ELEMENT unchecked EMPTY>
]]>
</para><para><programlisting><![CDATA[
-]]></programlisting></para>
+The unchecked element is used to define (if present) that anyone can view this portal page]]></programlisting></para>
</listitem><listitem>
<para>
Element <![CDATA[<!ELEMENT role-name (#PCDATA)>
]]>
</para><para><programlisting><![CDATA[
-]]></programlisting></para>
+The action-name element is used to define the access rights given to the role defined.
+Possible values are:
+
+ * view - Users can view the page.]]></programlisting></para>
</listitem></itemizedlist>
+
</para>
</sect2>
<sect2>
@@ -708,12 +776,12 @@
</para><para><programlisting><![CDATA[
When a web application is deployed, the context path under wich it is deployed
is taken as application name. The application name value in this descriptor is
-used to override it. When a component references a references a portlet, it
-needs to reference the application too and if the portlet application war file
-is renammed the reference is not valid anymore. Therefore this tag is used to
-have an application name that does not depend upon the context path under which
-the application is deployed.]]></programlisting></para>
+used to override it. When a component references a references a portlet, it needs to
+reference the application too and if the portlet application war file is renammed
+the reference is not valid anymore. Therefore this tag is used to have an application
+name that does not depend upon the context path under which the application is deployed.]]></programlisting></para>
</listitem></itemizedlist>
+
</para>
</sect2>
</sect1>
19 years
JBoss Portal SVN: r7171 - trunk/core/src/resources/portal-core-sar/dtd.
by portal-commits@lists.jboss.org
Author: bdaw
Date: 2007-05-02 03:58:28 -0400 (Wed, 02 May 2007)
New Revision: 7171
Modified:
trunk/core/src/resources/portal-core-sar/dtd/portal-object_2_6.dtd
trunk/core/src/resources/portal-core-sar/dtd/portlet-instances_2_6.dtd
Log:
- update XML comments in dtd files
Modified: trunk/core/src/resources/portal-core-sar/dtd/portal-object_2_6.dtd
===================================================================
--- trunk/core/src/resources/portal-core-sar/dtd/portal-object_2_6.dtd 2007-05-02 07:45:43 UTC (rev 7170)
+++ trunk/core/src/resources/portal-core-sar/dtd/portal-object_2_6.dtd 2007-05-02 07:58:28 UTC (rev 7171)
@@ -280,7 +280,8 @@
<!ELEMENT security-constraint (policy-permission*)>
<!--
-The policy-permission element is used to secure a specific portal page based on a user's role.
+The policy-permission element is used to secure a specific portal page based on a
+user's role.
-->
<!ELEMENT policy-permission (action-name*,unchecked?,role-name*)>
@@ -297,7 +298,8 @@
<!ELEMENT unchecked EMPTY>
<!--
-The action-name element is used to define the access rights given to the role defined. Possible values are:
+The action-name element is used to define the access rights given to the role defined.
+Possible values are:
* view - Users can view the page.
-->
Modified: trunk/core/src/resources/portal-core-sar/dtd/portlet-instances_2_6.dtd
===================================================================
--- trunk/core/src/resources/portal-core-sar/dtd/portlet-instances_2_6.dtd 2007-05-02 07:45:43 UTC (rev 7170)
+++ trunk/core/src/resources/portal-core-sar/dtd/portlet-instances_2_6.dtd 2007-05-02 07:58:28 UTC (rev 7171)
@@ -40,10 +40,11 @@
<!ELEMENT deployment (if-exists?,instance)>
<!--
-The if-exists element is used to define action to take if instance with such name is already present.
-Possible values are overwrite or keep . Overwrite will destroy the existing object in the database
-and create a new one, based on the content of the deployment. Keep will maintain the existing object
-deployment or create a new one if it does not yet exist.
+The if-exists element is used to define action to take if instance with such name is
+already present. Possible values are overwrite or keep . Overwrite will destroy the
+existing object in the database and create a new one, based on the content of the
+deployment. Keep will maintain the existing object deployment or create a new one if
+it does not yet exist.
-->
<!ELEMENT if-exists (#PCDATA)>
@@ -127,17 +128,20 @@
<!ELEMENT security-constraint (policy-permission*)>
<!--
-The policy-permission element is used to secure a specific portlet instance based on a user's role.
+The policy-permission element is used to secure a specific portlet instance based on a
+user's role.
-->
<!ELEMENT policy-permission (action-name*,unchecked?,role-name*)>
<!--
-The action-name element is used to define the access rights given to the role defined. Possible values are:
+The action-name element is used to define the access rights given to the role defined.
+Possible values are:
* view - Users can view the page.
* viewrecursive - Users can view the page and child pages.
* personalize - Users are able to view AND personalize the page.
- * personalizerecursive - Users are able to view AND personalize the page AND its child pages.
+ * personalizerecursive - Users are able to view AND personalize the page AND its child
+ pages.
-->
<!ELEMENT action-name (#PCDATA)>
19 years
JBoss Portal SVN: r7170 - trunk/core/src/resources/portal-core-sar/dtd.
by portal-commits@lists.jboss.org
Author: bdaw
Date: 2007-05-02 03:45:43 -0400 (Wed, 02 May 2007)
New Revision: 7170
Modified:
trunk/core/src/resources/portal-core-sar/dtd/portal-object_2_6.dtd
trunk/core/src/resources/portal-core-sar/dtd/portlet-instances_2_6.dtd
Log:
- update XML comments in dtd files
Modified: trunk/core/src/resources/portal-core-sar/dtd/portal-object_2_6.dtd
===================================================================
--- trunk/core/src/resources/portal-core-sar/dtd/portal-object_2_6.dtd 2007-05-02 05:43:03 UTC (rev 7169)
+++ trunk/core/src/resources/portal-core-sar/dtd/portal-object_2_6.dtd 2007-05-02 07:45:43 UTC (rev 7170)
@@ -259,21 +259,46 @@
<!ELEMENT value (#PCDATA)>
<!--
+The security-constraint element is a container for policy-permission elements
+
+Examples:
+
+<security-constraint>
+ <policy-permission>
+ <role-name>User</role-name>
+ <action-name>view</action-name>
+ </policy-permission>
+</security-constraint>
+
+<security-constraint>
+ <policy-permission>
+ <unchecked/>
+ <action-name>view</action-name>
+ </policy-permission>
+</security-constraint>
-->
<!ELEMENT security-constraint (policy-permission*)>
<!--
+The policy-permission element is used to secure a specific portal page based on a user's role.
-->
<!ELEMENT policy-permission (action-name*,unchecked?,role-name*)>
<!--
+The role-name element is used to define a role that this security constraint will apply to
+
+ * <role-name>SOMEROLE</role-name> Access to this portal page is limited to the defined role.
-->
<!ELEMENT action-name (#PCDATA)>
<!--
+The unchecked element is used to define (if present) that anyone can view this portal page
-->
<!ELEMENT unchecked EMPTY>
<!--
+The action-name element is used to define the access rights given to the role defined. Possible values are:
+
+ * view - Users can view the page.
-->
<!ELEMENT role-name (#PCDATA)>
Modified: trunk/core/src/resources/portal-core-sar/dtd/portlet-instances_2_6.dtd
===================================================================
--- trunk/core/src/resources/portal-core-sar/dtd/portlet-instances_2_6.dtd 2007-05-02 05:43:03 UTC (rev 7169)
+++ trunk/core/src/resources/portal-core-sar/dtd/portlet-instances_2_6.dtd 2007-05-02 07:45:43 UTC (rev 7170)
@@ -40,6 +40,10 @@
<!ELEMENT deployment (if-exists?,instance)>
<!--
+The if-exists element is used to define action to take if instance with such name is already present.
+Possible values are overwrite or keep . Overwrite will destroy the existing object in the database
+and create a new one, based on the content of the deployment. Keep will maintain the existing object
+deployment or create a new one if it does not yet exist.
-->
<!ELEMENT if-exists (#PCDATA)>
@@ -102,26 +106,49 @@
<!ELEMENT value (#PCDATA)>
<!--
-todo
+The security-constraint element is a container for policy-permission elements
+
+Examples:
+
+<security-constraint>
+ <policy-permission>
+ <role-name>User</role-name>
+ <action-name>view</action-name>
+ </policy-permission>
+</security-constraint>
+
+<security-constraint>
+ <policy-permission>
+ <unchecked/>
+ <action-name>view</action-name>
+ </policy-permission>
+</security-constraint>
-->
<!ELEMENT security-constraint (policy-permission*)>
<!--
-todo
+The policy-permission element is used to secure a specific portlet instance based on a user's role.
-->
<!ELEMENT policy-permission (action-name*,unchecked?,role-name*)>
<!--
-todo
+The action-name element is used to define the access rights given to the role defined. Possible values are:
+
+ * view - Users can view the page.
+ * viewrecursive - Users can view the page and child pages.
+ * personalize - Users are able to view AND personalize the page.
+ * personalizerecursive - Users are able to view AND personalize the page AND its child pages.
-->
<!ELEMENT action-name (#PCDATA)>
<!--
-todo
+The unchecked element is used to define (if present) that anyone can view this instance
-->
<!ELEMENT unchecked EMPTY>
<!--
-todo
+The role-name element is used to define a role that this security constraint will apply to
+
+ * <role-name>SOMEROLE</role-name> Access to this instance is limited to the defined role.
-->
<!ELEMENT role-name (#PCDATA)>
19 years
JBoss Portal SVN: r7169 - in trunk/wsrp/src/main/org/jboss/portal: test/wsrp/other and 1 other directories.
by portal-commits@lists.jboss.org
Author: chris.laprun(a)jboss.com
Date: 2007-05-02 01:43:03 -0400 (Wed, 02 May 2007)
New Revision: 7169
Modified:
trunk/wsrp/src/main/org/jboss/portal/test/wsrp/framework/support/BehaviorBackedServiceFactory.java
trunk/wsrp/src/main/org/jboss/portal/test/wsrp/other/EndpointConfigurationInfoTestCase.java
trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/EndpointConfigurationInfo.java
Log:
- Added isRefreshNeeded method for clients to know if a refresh is needed due to changes in URLs.
- Added test case.
Modified: trunk/wsrp/src/main/org/jboss/portal/test/wsrp/framework/support/BehaviorBackedServiceFactory.java
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/test/wsrp/framework/support/BehaviorBackedServiceFactory.java 2007-05-02 05:40:38 UTC (rev 7168)
+++ trunk/wsrp/src/main/org/jboss/portal/test/wsrp/framework/support/BehaviorBackedServiceFactory.java 2007-05-02 05:43:03 UTC (rev 7169)
@@ -109,22 +109,22 @@
public void setServiceDescriptionURL(String serviceDescriptionURL)
{
- throw new NotYetImplemented();
+ // do nothing
}
public void setMarkupURL(String markupURL)
{
- throw new NotYetImplemented();
+ // do nothing
}
public void setRegistrationURL(String registrationURL)
{
- throw new NotYetImplemented();
+ // do nothing
}
public void setPortletManagementURL(String portletManagementURL)
{
- throw new NotYetImplemented();
+ // do nothing
}
public void create() throws Exception
Modified: trunk/wsrp/src/main/org/jboss/portal/test/wsrp/other/EndpointConfigurationInfoTestCase.java
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/test/wsrp/other/EndpointConfigurationInfoTestCase.java 2007-05-02 05:40:38 UTC (rev 7168)
+++ trunk/wsrp/src/main/org/jboss/portal/test/wsrp/other/EndpointConfigurationInfoTestCase.java 2007-05-02 05:43:03 UTC (rev 7169)
@@ -23,6 +23,7 @@
package org.jboss.portal.test.wsrp.other;
import junit.framework.TestCase;
+import org.jboss.portal.test.wsrp.framework.support.BehaviorBackedServiceFactory;
import org.jboss.portal.wsrp.consumer.EndpointConfigurationInfo;
import org.jboss.portal.wsrp.services.PerEndpointSOAPInvokerServiceFactory;
import org.jboss.portal.wsrp.services.RemoteSOAPInvokerServiceFactory;
@@ -90,4 +91,27 @@
// it should be possible to set the WSDL to null for Hibernate
info.setWsdlDefinitionURL(null);
}
+
+ public void testIsRefreshNeeded() throws Exception
+ {
+ assertTrue(info.isRefreshNeeded());
+ assertFalse(info.isAvailable());
+
+ info.setServiceFactory(new BehaviorBackedServiceFactory());
+ String bea = "http://wsrp.bea.com:7001/producer/producer?WSDL";
+ info.setWsdlDefinitionURL(bea);
+ assertFalse(info.isRefreshNeeded());
+ assertTrue(info.isAvailable());
+
+ // change the service factory to a fake one to be able to simulate access to endpoint
+ info.setServiceFactory(new BehaviorBackedServiceFactory());
+ info.setServiceDescriptionURL(url);
+ assertTrue(info.isRefreshNeeded());
+
+ info.getRegistrationService();
+ assertTrue(info.isRefreshNeeded());
+
+ info.getServiceDescriptionService();
+ assertFalse(info.isRefreshNeeded());
+ }
}
Modified: trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/EndpointConfigurationInfo.java
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/EndpointConfigurationInfo.java 2007-05-02 05:40:38 UTC (rev 7168)
+++ trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/EndpointConfigurationInfo.java 2007-05-02 05:43:03 UTC (rev 7169)
@@ -33,6 +33,8 @@
import org.jboss.portal.wsrp.services.RemoteSOAPInvokerServiceFactory;
import org.jboss.portal.wsrp.services.ServiceFactory;
+import java.util.BitSet;
+
/**
* @author <a href="mailto:chris.laprun@jboss.com">Chris Laprun</a>
* @version $Revision$
@@ -61,6 +63,12 @@
// Used to ensure that even invalid values can be persisted to DB so that it can be accessed from the GUI
public final static String UNSET = "MUST BE SET";
+ // maintain the dirty status of each URL
+ private BitSet clean = new BitSet();
+ private final static int SD = 0;
+ private final static int M = 1;
+ private final static int PM = 2;
+ private final static int R = 3;
public EndpointConfigurationInfo()
{
@@ -146,7 +154,8 @@
{
serviceFactory.setServiceDescriptionURL(serviceDescriptionURL);
}
- this.serviceDescriptionURL = serviceDescriptionURL;
+ this.serviceDescriptionURL = modifyIfNeeded(this.serviceDescriptionURL, serviceDescriptionURL, SD);
+
}
public void setMarkupURL(String markupURL)
@@ -155,7 +164,7 @@
{
serviceFactory.setMarkupURL(markupURL);
}
- this.markupURL = markupURL;
+ this.markupURL = modifyIfNeeded(this.markupURL, markupURL, M);
}
public void setRegistrationURL(String registrationURL)
@@ -164,7 +173,7 @@
{
serviceFactory.setRegistrationURL(registrationURL);
}
- this.registrationURL = registrationURL;
+ this.registrationURL = modifyIfNeeded(this.registrationURL, registrationURL, R);
}
public void setPortletManagementURL(String portletManagementURL)
@@ -173,7 +182,7 @@
{
serviceFactory.setPortletManagementURL(portletManagementURL);
}
- this.portletManagementURL = portletManagementURL;
+ this.portletManagementURL = modifyIfNeeded(this.portletManagementURL, portletManagementURL, PM);
}
public void setWsdlDefinitionURL(String wsdlDefinitionURL) throws RuntimeException
@@ -187,17 +196,21 @@
{
serviceFactory = new RemoteSOAPInvokerServiceFactory();
}
- try
- {
- ((RemoteSOAPInvokerServiceFactory)serviceFactory).setWsdlDefinitionURL(wsdlDefinitionURL);
- }
- catch (Exception e)
- {
- throw new RuntimeException(e);
- }
+ internalSetWsdlURL();
}
}
+ private String modifyIfNeeded(String oldValue, String newValue, int whichURL)
+ {
+ if ((oldValue != null && !oldValue.equals(newValue)) || (oldValue == null && newValue != null))
+ {
+ oldValue = newValue;
+ clean.clear(whichURL);
+ }
+
+ return oldValue;
+ }
+
private void initServiceFactoryIfNeeded() throws RuntimeException
{
if (serviceFactory == null)
@@ -205,14 +218,7 @@
if (usesWSDL())
{
serviceFactory = new RemoteSOAPInvokerServiceFactory();
- try
- {
- ((RemoteSOAPInvokerServiceFactory)serviceFactory).setWsdlDefinitionURL(wsdlDefinitionURL);
- }
- catch (Exception e)
- {
- throw new RuntimeException(e);
- }
+ internalSetWsdlURL();
}
else
{
@@ -233,6 +239,19 @@
}
+ private void internalSetWsdlURL()
+ {
+ try
+ {
+ ((RemoteSOAPInvokerServiceFactory)serviceFactory).setWsdlDefinitionURL(wsdlDefinitionURL);
+ clean.set(0, 4); // if setting the WSDL URL worked, consider everything clean
+ }
+ catch (Exception e)
+ {
+ throw new RuntimeException(e);
+ }
+ }
+
public void start() throws Exception
{
getServiceFactory().start();
@@ -249,7 +268,12 @@
return serviceFactory;
}
- void setServiceFactory(ServiceFactory serviceFactory)
+ /**
+ * Only public for tests...
+ *
+ * @param serviceFactory
+ */
+ public void setServiceFactory(ServiceFactory serviceFactory)
{
ParameterValidation.throwIllegalArgExceptionIfNull(serviceFactory, "ServiceFactory");
@@ -266,22 +290,22 @@
}
- WSRP_v1_ServiceDescription_PortType getServiceDescriptionService() throws InvokerUnavailableException
+ public WSRP_v1_ServiceDescription_PortType getServiceDescriptionService() throws InvokerUnavailableException
{
return (WSRP_v1_ServiceDescription_PortType)getService(SERVICE_DESCRIPTION, WSRP_v1_ServiceDescription_PortType.class);
}
- WSRP_v1_Markup_PortType getMarkupService() throws InvokerUnavailableException
+ public WSRP_v1_Markup_PortType getMarkupService() throws InvokerUnavailableException
{
return (WSRP_v1_Markup_PortType)getService(MARKUP, WSRP_v1_Markup_PortType.class);
}
- WSRP_v1_PortletManagement_PortType getPortletManagementService() throws InvokerUnavailableException
+ public WSRP_v1_PortletManagement_PortType getPortletManagementService() throws InvokerUnavailableException
{
return (WSRP_v1_PortletManagement_PortType)getService(PORTLET_MANAGEMENT, WSRP_v1_PortletManagement_PortType.class);
}
- WSRP_v1_Registration_PortType getRegistrationService() throws InvokerUnavailableException
+ public WSRP_v1_Registration_PortType getRegistrationService() throws InvokerUnavailableException
{
return (WSRP_v1_Registration_PortType)getService(REGISTRATION, WSRP_v1_Registration_PortType.class);
}
@@ -290,7 +314,9 @@
{
try
{
- return getServiceFactory().getService(clazz);
+ Object service = getServiceFactory().getService(clazz);
+ clean.set(getIndexFor(clazz));
+ return service;
}
catch (Exception e)
{
@@ -299,6 +325,23 @@
}
}
+ private int getIndexFor(Class clazz)
+ {
+ if (clazz == WSRP_v1_ServiceDescription_PortType.class)
+ {
+ return SD;
+ }
+ if (clazz == WSRP_v1_Markup_PortType.class)
+ {
+ return M;
+ }
+ if (clazz == WSRP_v1_PortletManagement_PortType.class)
+ {
+ return PM;
+ }
+ return R;
+ }
+
public boolean isAvailable()
{
try
@@ -310,4 +353,14 @@
return false;
}
}
+
+ public boolean isRefreshNeeded()
+ {
+ return areURLsDirty() || !isAvailable();
+ }
+
+ private boolean areURLsDirty()
+ {
+ return clean.cardinality() < 4;
+ }
}
19 years