JBoss Portal SVN: r7188 - in docs/trunk/referenceGuide/en: images/portalapi and 1 other directories.
by portal-commits@lists.jboss.org
Author: julien(a)jboss.com
Date: 2007-05-03 21:04:31 -0400 (Thu, 03 May 2007)
New Revision: 7188
Modified:
docs/trunk/referenceGuide/en/images/portalapi/Mode.png
docs/trunk/referenceGuide/en/images/portalapi/NavigationalStateContext.png
docs/trunk/referenceGuide/en/images/portalapi/PortalEvent.png
docs/trunk/referenceGuide/en/images/portalapi/PortalEventContext.png
docs/trunk/referenceGuide/en/images/portalapi/PortalEventListener.png
docs/trunk/referenceGuide/en/images/portalapi/PortalNode.png
docs/trunk/referenceGuide/en/images/portalapi/PortalNodeEvent.png
docs/trunk/referenceGuide/en/images/portalapi/PortalNodeEventContext.png
docs/trunk/referenceGuide/en/images/portalapi/PortalRuntimeContext.png
docs/trunk/referenceGuide/en/images/portalapi/PortalSession.png
docs/trunk/referenceGuide/en/images/portalapi/PortalSessionEvent.png
docs/trunk/referenceGuide/en/images/portalapi/PortalURL.png
docs/trunk/referenceGuide/en/images/portalapi/WindowState.png
docs/trunk/referenceGuide/en/images/portalapi/user.event.png
docs/trunk/referenceGuide/en/modules/portalapi.xml
docs/trunk/referenceGuide/en/schemas.ppt
Log:
better uml diagrams
Modified: docs/trunk/referenceGuide/en/images/portalapi/Mode.png
===================================================================
(Binary files differ)
Modified: docs/trunk/referenceGuide/en/images/portalapi/NavigationalStateContext.png
===================================================================
(Binary files differ)
Modified: docs/trunk/referenceGuide/en/images/portalapi/PortalEvent.png
===================================================================
(Binary files differ)
Modified: docs/trunk/referenceGuide/en/images/portalapi/PortalEventContext.png
===================================================================
(Binary files differ)
Modified: docs/trunk/referenceGuide/en/images/portalapi/PortalEventListener.png
===================================================================
(Binary files differ)
Modified: docs/trunk/referenceGuide/en/images/portalapi/PortalNode.png
===================================================================
(Binary files differ)
Modified: docs/trunk/referenceGuide/en/images/portalapi/PortalNodeEvent.png
===================================================================
(Binary files differ)
Modified: docs/trunk/referenceGuide/en/images/portalapi/PortalNodeEventContext.png
===================================================================
(Binary files differ)
Modified: docs/trunk/referenceGuide/en/images/portalapi/PortalRuntimeContext.png
===================================================================
(Binary files differ)
Modified: docs/trunk/referenceGuide/en/images/portalapi/PortalSession.png
===================================================================
(Binary files differ)
Modified: docs/trunk/referenceGuide/en/images/portalapi/PortalSessionEvent.png
===================================================================
(Binary files differ)
Modified: docs/trunk/referenceGuide/en/images/portalapi/PortalURL.png
===================================================================
(Binary files differ)
Modified: docs/trunk/referenceGuide/en/images/portalapi/WindowState.png
===================================================================
(Binary files differ)
Modified: docs/trunk/referenceGuide/en/images/portalapi/user.event.png
===================================================================
(Binary files differ)
Modified: docs/trunk/referenceGuide/en/modules/portalapi.xml
===================================================================
--- docs/trunk/referenceGuide/en/modules/portalapi.xml 2007-05-03 23:31:37 UTC (rev 7187)
+++ docs/trunk/referenceGuide/en/modules/portalapi.xml 2007-05-04 01:04:31 UTC (rev 7188)
@@ -35,7 +35,7 @@
</itemizedlist>
<mediaobject>
<imageobject>
- <imagedata width="28em" align="center" fileref="images/portalapi/Mode.png" format="png"/>
+ <imagedata align="center" fileref="images/portalapi/Mode.png" format="png"/>
</imageobject>
<caption>
<para>The Mode class</para>
@@ -43,7 +43,7 @@
</mediaobject>
<mediaobject>
<imageobject>
- <imagedata width="28em" align="center" fileref="images/portalapi/WindowState.png" format="png"/>
+ <imagedata align="center" fileref="images/portalapi/WindowState.png" format="png"/>
</imageobject>
<caption>
<para>The WindowState class</para>
@@ -59,7 +59,7 @@
URL managed by the portal.</para>
<mediaobject>
<imageobject>
- <imagedata width="28em" align="center" fileref="images/portalapi/PortalURL.png" format="png"/>
+ <imagedata align="center" fileref="images/portalapi/PortalURL.png" format="png"/>
</imageobject>
<caption>
<para>The PortalURL interface</para>
@@ -81,7 +81,7 @@
<title>Portal session</title>
<mediaobject>
<imageobject>
- <imagedata width="28em" align="center" fileref="images/portalapi/PortalSession.png" format="png"/>
+ <imagedata align="center" fileref="images/portalapi/PortalSession.png" format="png"/>
</imageobject>
<caption>
<para>The PortalSession interface</para>
@@ -97,7 +97,7 @@
<title>Portal runtime context</title>
<mediaobject>
<imageobject>
- <imagedata width="28em" align="center" fileref="images/portalapi/PortalRuntimeContext.png" format="png"/>
+ <imagedata align="center" fileref="images/portalapi/PortalRuntimeContext.png" format="png"/>
</imageobject>
<caption>
<para>The PortalRuntimeContext interface</para>
@@ -121,7 +121,7 @@
</itemizedlist>
<mediaobject>
<imageobject>
- <imagedata width="28em" align="center" fileref="images/portalapi/PortalNode.png" format="png"/>
+ <imagedata align="center" fileref="images/portalapi/PortalNode.png" format="png"/>
</imageobject>
<caption>
<para>The PortalNode interface</para>
@@ -176,7 +176,7 @@
mode and window states of portal nodes of type window.</para>
<mediaobject>
<imageobject>
- <imagedata width="28em" align="center" fileref="images/portalapi/NavigationalStateContext.png" format="png"/>
+ <imagedata align="center" fileref="images/portalapi/NavigationalStateContext.png" format="png"/>
</imageobject>
<caption>
<para>The NavigationalStateContext interface</para>
@@ -191,7 +191,7 @@
</para>
<mediaobject>
<imageobject>
- <imagedata width="28em" align="center" fileref="images/portalapi/PortalEvent.png" format="png"/>
+ <imagedata align="center" fileref="images/portalapi/PortalEvent.png" format="png"/>
</imageobject>
<caption>
<para>The PortalEvent class</para>
@@ -202,7 +202,7 @@
</para>
<mediaobject>
<imageobject>
- <imagedata width="28em" align="center" fileref="images/portalapi/PortalEventContext.png" format="png"/>
+ <imagedata align="center" fileref="images/portalapi/PortalEventContext.png" format="png"/>
</imageobject>
<caption>
<para>The PortalEventContext interface</para>
@@ -215,7 +215,7 @@
</para>
<mediaobject>
<imageobject>
- <imagedata width="28em" align="center" fileref="images/portalapi/PortalEventListener.png" format="png"/>
+ <imagedata align="center" fileref="images/portalapi/PortalEventListener.png" format="png"/>
</imageobject>
<caption>
<para>The PortalEventListener interface</para>
@@ -242,7 +242,7 @@
a corresponding event will be fired.</para>
<mediaobject>
<imageobject>
- <imagedata width="40em" align="center" fileref="images/portalapi/PortalNodeEvent.png" format="png"/>
+ <imagedata align="center" fileref="images/portalapi/PortalNodeEvent.png" format="png"/>
</imageobject>
<caption>
<para>The portal node event class hierarchy</para>
@@ -277,7 +277,7 @@
</para>
<mediaobject>
<imageobject>
- <imagedata width="40em" align="center" fileref="images/portalapi/eventpropagation.png" format="png"/>
+ <imagedata align="center" fileref="images/portalapi/eventpropagation.png" format="png"/>
</imageobject>
<caption>
<para>The portal node event propagation model</para>
@@ -301,7 +301,7 @@
<title>Portal node event context</title>
<mediaobject>
<imageobject>
- <imagedata width="28em" align="center" fileref="images/portalapi/PortalNodeEventContext.png" format="png"/>
+ <imagedata align="center" fileref="images/portalapi/PortalNodeEventContext.png" format="png"/>
</imageobject>
<caption>
<para>The PortalNodeEventContext interface</para>
Modified: docs/trunk/referenceGuide/en/schemas.ppt
===================================================================
(Binary files differ)
19 years
JBoss Portal SVN: r7187 - trunk/wsrp/src/resources/portal-wsrp-war.
by portal-commits@lists.jboss.org
Author: chris.laprun(a)jboss.com
Date: 2007-05-03 19:31:37 -0400 (Thu, 03 May 2007)
New Revision: 7187
Modified:
trunk/wsrp/src/resources/portal-wsrp-war/style.css
Log:
- Added info class for information messages.
Modified: trunk/wsrp/src/resources/portal-wsrp-war/style.css
===================================================================
--- trunk/wsrp/src/resources/portal-wsrp-war/style.css 2007-05-03 21:09:53 UTC (rev 7186)
+++ trunk/wsrp/src/resources/portal-wsrp-war/style.css 2007-05-03 23:31:37 UTC (rev 7187)
@@ -55,4 +55,9 @@
.error {
font-weight: bold;
color: red;
+}
+
+.info {
+ font-weight: bold;
+ color: green;
}
\ No newline at end of file
19 years
JBoss Portal SVN: r7186 - in trunk/wsrp/src/main/org/jboss/portal: wsrp/consumer and 1 other directory.
by portal-commits@lists.jboss.org
Author: chris.laprun(a)jboss.com
Date: 2007-05-03 17:09:53 -0400 (Thu, 03 May 2007)
New Revision: 7186
Modified:
trunk/wsrp/src/main/org/jboss/portal/test/wsrp/other/ProducerInfoTestCase.java
trunk/wsrp/src/main/org/jboss/portal/test/wsrp/other/RegistrationInfoTestCase.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/main/org/jboss/portal/wsrp/consumer/RegistrationProperty.java
Log:
- Added isRefreshNeeded on ProducerInfo, use it and related test cases.
- Added dirty concept on RegistrationInfo and ability to force a refresh.
- RegistrationProperties now have a status string and prefixed persistent fields.
Modified: trunk/wsrp/src/main/org/jboss/portal/test/wsrp/other/ProducerInfoTestCase.java
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/test/wsrp/other/ProducerInfoTestCase.java 2007-05-03 16:49:07 UTC (rev 7185)
+++ trunk/wsrp/src/main/org/jboss/portal/test/wsrp/other/ProducerInfoTestCase.java 2007-05-03 21:09:53 UTC (rev 7186)
@@ -72,21 +72,35 @@
assertNull(info.getExpirationCacheSeconds());
+ assertTrue(info.isRefreshNeeded(false));
+ assertFalse(info.isRegistrationChecked());
assertTrue(info.refresh(false));
+ assertFalse(info.isRefreshNeeded(false));
+ assertTrue(info.isRegistrationChecked());
assertTrue(info.refresh(false));
+ assertFalse(info.isRefreshNeeded(false));
+ assertTrue(info.isRegistrationChecked());
assertEquals(2, behavior.getCallCount());
info.setExpirationCacheSeconds(new Integer(1));
assertEquals(new Integer(1), info.getExpirationCacheSeconds());
assertTrue(info.refresh(false));
assertFalse(info.refresh(false));
+ assertFalse(info.isRefreshNeeded(false));
+ assertTrue(info.isRegistrationChecked());
assertEquals(3, behavior.getCallCount());
// wait for cache expiration
Thread.sleep(1500);
+ assertFalse("refresh is not needed if cache is not considered", info.isRefreshNeeded(false));
+ assertTrue("refresh is needed if cache is not considered since it has expired", info.isRefreshNeeded(true));
assertTrue(info.refresh(false));
+ assertFalse("Was just refreshed so refresh is not needed even considering cache", info.isRefreshNeeded(true));
+ assertTrue(info.isRegistrationChecked());
assertFalse(info.refresh(false));
assertTrue(info.refresh(true));
+ assertFalse(info.isRefreshNeeded(false));
+ assertTrue(info.isRegistrationChecked());
assertEquals(5, behavior.getCallCount());
}
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-03 16:49:07 UTC (rev 7185)
+++ trunk/wsrp/src/main/org/jboss/portal/test/wsrp/other/RegistrationInfoTestCase.java 2007-05-03 21:09:53 UTC (rev 7186)
@@ -78,18 +78,23 @@
{
// before refresh registration status is undetermined
assertNull(info.isRegistrationRequired());
+ assertFalse(info.isRegistrationValid());
ServiceDescription sd = createServiceDescription(false, 0);
- RegistrationInfo.RegistrationRefreshResult result = info.refreshRegistrationRequirementsFor(sd, producerId, true);
+ RegistrationInfo.RegistrationRefreshResult result = info.refreshRegistrationRequirementsFor(sd, producerId, true, false);
assertNotNull(result);
assertTrue(result.isValid());
assertFalse(info.isRegistrationRequired().booleanValue());
+ assertTrue(info.isRegistrationDeterminedNotRequired());
+ assertFalse(info.isRegistrationDeterminedRequired());
assertTrue(info.isRegistrationValid());
- result = info.refreshRegistrationRequirementsFor(sd, producerId, false);
+ result = info.refreshRegistrationRequirementsFor(sd, producerId, false, false);
assertNotNull(result);
assertTrue(result.isValid());
assertFalse(info.isRegistrationRequired().booleanValue());
+ assertTrue(info.isRegistrationDeterminedNotRequired());
+ assertFalse(info.isRegistrationDeterminedRequired());
assertTrue(info.isRegistrationValid());
}
@@ -97,12 +102,15 @@
{
// before refresh registration status is undetermined
assertNull(info.isRegistrationRequired());
+ assertFalse(info.isRegistrationValid());
RegistrationInfo.RegistrationRefreshResult result = info.refreshRegistrationRequirementsFor(
- createServiceDescription(true, 0), producerId, true);
+ createServiceDescription(true, 0), producerId, true, false);
assertNotNull(result);
assertTrue(result.isValid());
assertTrue(info.isRegistrationRequired().booleanValue());
+ assertTrue(info.isRegistrationDeterminedRequired());
+ assertFalse(info.isRegistrationDeterminedNotRequired());
assertFalse(info.isRegistrationValid());
}
@@ -112,7 +120,7 @@
info.setRegistrationPropertyValue("foo", "bar");
RegistrationInfo.RegistrationRefreshResult result = info.refreshRegistrationRequirementsFor(
- createServiceDescription(true, 0), producerId, false);
+ createServiceDescription(true, 0), producerId, false, false);
assertNotNull(result);
assertFalse(result.isValid());
String status = result.getStatus();
@@ -126,6 +134,7 @@
assertNotNull(prop);
assertEquals("bar", prop.getValue());
assertTrue(prop.isInvalid());
+ assertEquals(RegistrationProperty.INEXISTENT_STATUS, prop.getStatus());
}
public void testRefreshRegistrationRegistrationNoLocalInfo()
@@ -133,31 +142,77 @@
// producer requests 2 registration properties
ServiceDescription sd = createServiceDescription(true, 2);
- RegistrationInfo.RegistrationRefreshResult result = info.refreshRegistrationRequirementsFor(sd, producerId, false);
+ RegistrationInfo.RegistrationRefreshResult result = info.refreshRegistrationRequirementsFor(sd, producerId, false, false);
assertNotNull(result);
assertFalse(result.isValid());
String status = result.getStatus();
assertNotNull(status);
assertTrue(status.indexOf("prop0") != -1 && status.indexOf("prop1") != -1);
+
+ Map regProps = result.getRegistrationProperties();
+ assertNotNull(regProps);
+
+ RegistrationProperty prop = (RegistrationProperty)regProps.get("prop0");
+ assertNotNull(prop);
+ assertTrue(prop.isInvalid());
+ assertEquals(RegistrationProperty.MISSING_STATUS, prop.getStatus());
}
- public void testRefreshRegistrationRegistrationEraseLocalInfo()
+ public void testRefreshRegistrationRegistrationMergeWithLocalInfo()
{
+ info.setRegistrationPropertyValue("foo", "bar");
+
RegistrationInfo.RegistrationRefreshResult result = info.refreshRegistrationRequirementsFor(createServiceDescription(true, 2),
- producerId, true);
+ producerId, true, false);
assertNotNull(result);
assertFalse(result.isValid());
+
RegistrationProperty prop = info.getRegistrationProperty("prop0");
assertNotNull(prop);
assertNull(prop.getValue());
assertTrue(prop.isInvalid());
+ assertEquals(RegistrationProperty.MISSING_VALUE_STATUS, prop.getStatus());
+
prop = info.getRegistrationProperty("prop1");
assertNotNull(prop);
assertNull(prop.getValue());
assertTrue(prop.isInvalid());
+ assertEquals(RegistrationProperty.MISSING_VALUE_STATUS, prop.getStatus());
assertEquals(2, info.getRegistrationProperties().size());
+
+ assertNull(info.getRegistrationProperty("foo"));
}
+ public void testForceRefreshRegistration()
+ {
+ RegistrationInfo.RegistrationRefreshResult result = info.refreshRegistrationRequirementsFor(
+ createServiceDescription(true, 0), producerId, false, false);
+ assertNotNull(result);
+ assertTrue(result.isValid());
+ assertFalse(info.isRegistrationValid());
+
+ // Modifying a property renders the info dirty and hence should be refreshed
+ info.setRegistrationPropertyValue("foo", "bar");
+ result = info.refreshRegistrationRequirementsFor(createServiceDescription(true, 0), producerId, false, false);
+ assertFalse(result.isValid());
+ assertFalse(info.isRegistrationValid());
+
+ info.removeRegistrationProperty("foo");
+ result = info.refreshRegistrationRequirementsFor(createServiceDescription(true, 0), producerId, false, false);
+ assertTrue(result.isValid());
+ assertFalse(info.isRegistrationValid());
+
+ // producer has changed but we're not forcing refresh so registration should still be invalid
+ result = info.refreshRegistrationRequirementsFor(createServiceDescription(false, 0), producerId, false, false);
+ assertTrue(result.isValid());
+ assertFalse(info.isRegistrationValid());
+
+ // force refresh
+ result = info.refreshRegistrationRequirementsFor(createServiceDescription(false, 0), producerId, false, true);
+ assertTrue(result.isValid());
+ assertTrue(info.isRegistrationValid());
+ }
+
private ServiceDescription createServiceDescription(boolean requiresRegistration, int numberOfProperties)
{
ServiceDescription sd = WSRPTypeFactory.createServiceDescription(requiresRegistration);
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-03 16:49:07 UTC (rev 7185)
+++ trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/ProducerInfo.java 2007-05-03 21:09:53 UTC (rev 7186)
@@ -169,14 +169,17 @@
public boolean isRegistrationRequired()
{
return persistentRegistrationInfo != null && persistentRegistrationInfo.isRegistrationDeterminedRequired();
+ }
+ public boolean isRegistrationChecked()
+ {
+ return persistentRegistrationInfo != null && persistentRegistrationInfo.isRegistrationRequired() != null;
}
/**
* Determines whether the associated consumer is active.
*
* @return
- * @since 2.6
*/
public boolean isActive()
{
@@ -188,7 +191,6 @@
* handle activation.
*
* @param active
- * @since 2.6
*/
public void setActive(boolean active)
{
@@ -231,9 +233,10 @@
ServiceDescription serviceDescription;
// might neeed a different cache value: right now, we cache the whole producer info but we might want to cache
// POPs and rest of producer info separetely...
- if (forceRefresh || isCacheExpired())
+ if (forceRefresh || isRefreshNeeded(true))
{
log.debug("ProducerInfo refresh needed for producer '" + persistentId + "'");
+ persistentEndpointInfo.refresh();
serviceDescription = getServiceDescription(false);
// do we need to call initCookie or not?
@@ -256,7 +259,7 @@
else
{
log.debug("Registration not required");
-// setRegistrationInfo(registry.getDefaultRegistrationInfo());
+ persistentRegistrationInfo = new RegistrationInfo(this, false);
setServiceDescriptionRequest(getUnregisteredServiceDescriptionRequest());
extractOfferedPortlets(serviceDescription);
return true;
@@ -679,29 +682,25 @@
}
- public RegistrationInfo.RegistrationRefreshResult refreshRegistrationInfo(boolean eraseLocalData) throws PortletInvokerException
+ public RegistrationInfo.RegistrationRefreshResult refreshRegistrationInfo(boolean mergeWithLocalInfo) throws PortletInvokerException
{
if (persistentRegistrationInfo == null)
{
persistentRegistrationInfo = new RegistrationInfo(this);
}
- // if we want to erase the local data, we need to deregister
- if (eraseLocalData)
- {
- deregister();
- }
-
RegistrationInfo.RegistrationRefreshResult result =
- persistentRegistrationInfo.refreshRegistrationRequirementsFor(getServiceDescription(true), persistentId, eraseLocalData);
+ persistentRegistrationInfo.refreshRegistrationRequirementsFor(getServiceDescription(true), persistentId, mergeWithLocalInfo, true);
registry.updateProducerInfo(this);
log.info("Refreshed registration information for consumer with id '" + persistentId + "'");
return result;
}
- /*public boolean isRefreshNeeded()
+ public boolean isRefreshNeeded(boolean considerCache)
{
- return persistentEndpointInfo.isRefreshNeeded();
- }*/
+ return (considerCache && isCacheExpired())
+ || (persistentRegistrationInfo != null && persistentRegistrationInfo.isRefreshNeeded())
+ || 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-03 16:49:07 UTC (rev 7185)
+++ trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/RegistrationInfo.java 2007-05-03 21:09:53 UTC (rev 7186)
@@ -65,6 +65,7 @@
private transient Boolean requiresRegistration;
private transient RegistrationData registrationData;
+ private boolean dirty;
public RegistrationInfo(ProducerInfo producerInfo)
{
@@ -73,6 +74,12 @@
producerInfo.setRegistrationInfo(this);
}
+ public RegistrationInfo(ProducerInfo producerInfo, boolean requiresRegistration)
+ {
+ this(producerInfo);
+ this.requiresRegistration = Boolean.valueOf(requiresRegistration);
+ }
+
public RegistrationInfo()
{
persistentConsumerName = WSRPConstants.DEFAULT_CONSUMER_NAME;
@@ -96,7 +103,7 @@
public void setRegistrationHandle(String registrationHandle)
{
- this.persistentRegistrationHandle = registrationHandle;
+ this.persistentRegistrationHandle = modifyIfNeeded(this.persistentRegistrationHandle, registrationHandle);
}
public byte[] getRegistrationState()
@@ -109,11 +116,6 @@
this.persistentRegistrationState = registrationState;
}
- public void setRequiresRegistration(Boolean requiresRegistration)
- {
- this.requiresRegistration = requiresRegistration;
- }
-
/**
* Determines whether the associated Producer requires registration.
*
@@ -206,6 +208,7 @@
RegistrationProperty prop = (RegistrationProperty)getOrCreateRegistrationPropertiesMap(true).get(name);
if (prop != null)
{
+ value = modifyIfNeeded(prop.getValue(), value);
prop.setValue(value);
}
else
@@ -213,6 +216,7 @@
// todo: deal with language more appropriately
prop = new RegistrationProperty(name, value, LocaleInfo.getRFC3066LanguageTagFor(Locale.getDefault()));
getOrCreateRegistrationPropertiesMap(false).put(name, prop);
+ dirty = true;
}
return prop;
@@ -226,6 +230,7 @@
{
throw new IllegalArgumentException("Cannot remove inexistent registration property '" + name + "'");
}
+ dirty = true;
}
private Map getOrCreateRegistrationPropertiesMap(boolean forceCreate)
@@ -270,108 +275,120 @@
*/
boolean initialize(ServiceDescription serviceDescription, String producerId)
{
- return refreshRegistrationRequirementsFor(serviceDescription, producerId, false).isValid();
+ return refreshRegistrationRequirementsFor(serviceDescription, producerId, false, false).isValid();
}
/**
* @param serviceDescription
* @param producerId
- * @param discardLocalInfo
+ * @param mergeWithLocalInfo
+ * @param forceRefresh
* @return
*/
- public RegistrationRefreshResult refreshRegistrationRequirementsFor(ServiceDescription serviceDescription, String producerId, boolean discardLocalInfo)
+ public RegistrationRefreshResult refreshRegistrationRequirementsFor(ServiceDescription serviceDescription,
+ String producerId, boolean mergeWithLocalInfo,
+ boolean forceRefresh)
{
- log.debug("RegistrationInfo initialization requested");
- RegistrationRefreshResult result = new RegistrationRefreshResult();
+ log.debug("RegistrationInfo refresh requested");
- if (serviceDescription.isRequiresRegistration())
+ if (forceRefresh || isRefreshNeeded())
{
- requiresRegistration = Boolean.TRUE;
- StringBuffer message = new StringBuffer("Producer '").append(producerId).append("' requires registration.");
- result.appendToStatus(message.toString());
- log.debug(message);
+ RegistrationRefreshResult result = new RegistrationRefreshResult();
+ dirty = false;
- // check if the configured registration properties match the producer expectations
- ModelDescription regPropDescs = serviceDescription.getRegistrationPropertyDescription();
- if (regPropDescs != null)
+ if (serviceDescription.isRequiresRegistration())
{
- result.setValid(true);
- PropertyDescription[] propertyDescriptions = regPropDescs.getPropertyDescriptions();
- if (propertyDescriptions != null && propertyDescriptions.length > 0)
+ requiresRegistration = Boolean.TRUE;
+ StringBuffer message = new StringBuffer("Producer '").append(producerId).append("' requires registration.");
+ result.appendToStatus(message.toString());
+ log.debug(message);
+
+ // check if the configured registration properties match the producer expectations
+ ModelDescription regPropDescs = serviceDescription.getRegistrationPropertyDescription();
+ if (regPropDescs != null)
{
- Map descriptionsMap = getRegistrationPropertyDescriptionsFromWSRP(propertyDescriptions);
-
- if (discardLocalInfo)
+ result.setValid(true);
+ PropertyDescription[] propertyDescriptions = regPropDescs.getPropertyDescriptions();
+ if (propertyDescriptions != null && propertyDescriptions.length > 0)
{
- persistentRegistrationProperties = getOrCreateRegistrationPropertiesMap(true);
+ Map descriptionsMap = getRegistrationPropertyDescriptionsFromWSRP(propertyDescriptions);
- // Remove extra properties
- Set unexpected = new HashSet(persistentRegistrationProperties.keySet());
- unexpected.removeAll(descriptionsMap.keySet());
- if (!unexpected.isEmpty())
+ if (mergeWithLocalInfo)
{
- for (Iterator invalidProps = unexpected.iterator(); invalidProps.hasNext();)
+ persistentRegistrationProperties = getOrCreateRegistrationPropertiesMap(true);
+
+ // Remove extra properties
+ Set unexpected = new HashSet(persistentRegistrationProperties.keySet());
+ unexpected.removeAll(descriptionsMap.keySet());
+ if (!unexpected.isEmpty())
{
- persistentRegistrationProperties.remove(invalidProps.next());
+ for (Iterator invalidProps = unexpected.iterator(); invalidProps.hasNext();)
+ {
+ persistentRegistrationProperties.remove(invalidProps.next());
+ }
}
- }
- // Resets existing properties
- for (Iterator props = descriptionsMap.values().iterator(); props.hasNext();)
- {
- RegistrationProperty prop = (RegistrationProperty)props.next();
- String name = prop.getName();
- RegistrationProperty existing = getRegistrationProperty(name);
- if (existing != null)
+ // Merge existing properties
+ for (Iterator props = descriptionsMap.values().iterator(); props.hasNext();)
{
- existing.setValue(null);
- existing.setDescription(prop.getDescription());
+ RegistrationProperty prop = (RegistrationProperty)props.next();
+ String name = prop.getName();
+ RegistrationProperty existing = getRegistrationProperty(name);
+ if (existing != null)
+ {
+ existing.setDescription(prop.getDescription());
+ }
+ else
+ {
+ persistentRegistrationProperties.put(name, prop);
+ }
}
- else
- {
- persistentRegistrationProperties.put(name, prop);
- }
+
+ resetRegistration();
+ result.setValid(false);
}
+ else
+ {
+ persistentRegistrationProperties = getOrCreateRegistrationPropertiesMap(true);
- resetRegistration();
- result.setValid(false);
- }
- else
- {
- 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, persistentRegistrationProperties);
- // check that we don't have unexpected registration properties and if so, mark them as invalid
- Set expectedNames = descriptionsMap.keySet();
- 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)persistentRegistrationProperties.get(name);
- RegistrationProperty producerProp = (RegistrationProperty)descriptionsMap.get(name);
- if (prop == null)
+ // now check for missing properties, add the missing ones with a null value
+ StringBuffer missingProps = new StringBuffer();
+ for (Iterator descriptionNames = expectedNames.iterator(); descriptionNames.hasNext();)
{
- persistentRegistrationProperties.put(name, producerProp);
- missingProps.append("Missing value for property '").append(name).append("'\n");
+ String name = (String)descriptionNames.next();
+ RegistrationProperty prop = (RegistrationProperty)persistentRegistrationProperties.get(name);
+ RegistrationProperty producerProp = (RegistrationProperty)descriptionsMap.get(name);
+ if (prop == null)
+ {
+ producerProp.setStatus(RegistrationProperty.MISSING_STATUS);
+ persistentRegistrationProperties.put(name, producerProp);
+ missingProps.append("Missing value for property '").append(name).append("'\n");
+ }
+ else
+ {
+ // take the opportunity to add the property description... ^_^
+ prop.setDescription(producerProp.getDescription());
+ }
}
- else
+
+ if (missingProps.length() > 0)
{
- // take the opportunity to add the property description... ^_^
- prop.setDescription(producerProp.getDescription());
+ log.debug(missingProps);
+ result.appendToStatus(missingProps.toString());
+ resetRegistration();
+ result.setValid(false);
}
}
-
- if (missingProps.length() > 0)
- {
- log.debug(missingProps);
- result.appendToStatus(missingProps.toString());
- resetRegistration();
- result.setValid(false);
- }
}
+ else
+ {
+ handleNoRequiredRegistrationProperties(producerId, result);
+ }
}
else
{
@@ -380,23 +397,26 @@
}
else
{
- handleNoRequiredRegistrationProperties(producerId, result);
+ String msg = "Producer '" + producerId + "' doesn't require registration.";
+ log.debug(msg);
+ result.appendToStatus(msg);
+ requiresRegistration = Boolean.FALSE;
+ result.setValid(true);
}
+
+ result.setRegistrationProperties(persistentRegistrationProperties);
+ String msg = "Registration configuration is " + (result.isValid() ? "" : "NOT") + " valid";
+ result.appendToStatus(msg);
+ log.debug(msg);
+ return result;
}
else
{
- String msg = "Producer '" + producerId + "' doesn't require registration.";
- log.debug(msg);
- result.appendToStatus(msg);
- requiresRegistration = Boolean.FALSE;
- result.setValid(true);
+ RegistrationRefreshResult result = new RegistrationRefreshResult();
+ result.valid = true;
+ result.registrationProperties = persistentRegistrationProperties;
+ return result;
}
-
- result.setRegistrationProperties(persistentRegistrationProperties);
- String msg = "Registration configuration is " + (result.isValid() ? "" : "NOT") + " valid";
- result.appendToStatus(msg);
- log.debug(msg);
- return result;
}
private void handleNoRequiredRegistrationProperties(String producerId, RegistrationRefreshResult result)
@@ -437,7 +457,9 @@
{
String name = (String)invalidProps.next();
message.append("\t- ").append(name).append("\n");
- ((RegistrationProperty)properties.get(name)).setInvalid(true);
+ RegistrationProperty prop = (RegistrationProperty)properties.get(name);
+ prop.setInvalid(true);
+ prop.setStatus(RegistrationProperty.INEXISTENT_STATUS);
}
log.info(message);
result.appendToStatus(message.toString());
@@ -462,6 +484,7 @@
RegistrationPropertyDescription desc = WSRPUtils.convertToRegistrationPropertyDescription(description);
RegistrationProperty prop = new RegistrationProperty(name, null, LocaleInfo.getRFC3066LanguageTagFor(desc.getLang()));
prop.setDescription(desc);
+ prop.setStatus(RegistrationProperty.MISSING_VALUE_STATUS);
result.put(name, prop);
}
@@ -478,6 +501,7 @@
registrationData = null;
persistentRegistrationHandle = null;
persistentRegistrationState = null;
+ requiresRegistration = null;
}
public boolean isRegistrationValid()
@@ -509,6 +533,11 @@
}
}
+ public boolean isRefreshNeeded()
+ {
+ return dirty || requiresRegistration == null;
+ }
+
public class RegistrationRefreshResult
{
private Map registrationProperties;
@@ -558,9 +587,14 @@
}
}
- class RegistrationPropertyHolder
+ private String modifyIfNeeded(String oldValue, String newValue)
{
- RegistrationProperty property;
- String status;
+ if ((oldValue != null && !oldValue.equals(newValue)) || (oldValue == null && newValue != null))
+ {
+ oldValue = newValue;
+ dirty = true;
+ }
+
+ return oldValue;
}
}
Modified: trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/RegistrationProperty.java
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/RegistrationProperty.java 2007-05-03 16:49:07 UTC (rev 7185)
+++ trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/RegistrationProperty.java 2007-05-03 21:09:53 UTC (rev 7186)
@@ -33,13 +33,17 @@
*/
public class RegistrationProperty
{
- private Long key;
- private RegistrationPropertyDescription description;
- private boolean invalid;
- private String lang;
- private String name;
- private String value;
+ private Long persistentId;
+ private RegistrationPropertyDescription persistentDescription;
+ private boolean persistentInvalid;
+ private String persistentLang;
+ private String persistentName;
+ private String persistentValue;
+ private transient String status;
+ public static final String INEXISTENT_STATUS = "Inexistent on Producer";
+ public static final String MISSING_STATUS = "Missing";
+ public static final String MISSING_VALUE_STATUS = "Missing value";
public RegistrationProperty()
{
@@ -49,13 +53,12 @@
{
ParameterValidation.throwIllegalArgExceptionIfNullOrEmpty(name, "Name", "RegistrationProperty");
ParameterValidation.throwIllegalArgExceptionIfNullOrEmpty(lang, "Lang", "RegistrationProperty");
- this.name = name;
- this.value = stringValue;
- this.lang = lang;
- invalid = (stringValue == null);
+ this.persistentName = name;
+ this.persistentValue = stringValue;
+ this.persistentLang = lang;
+ persistentInvalid = (stringValue == null);
}
-
public boolean equals(Object o)
{
if (this == o)
@@ -69,27 +72,27 @@
RegistrationProperty that = (RegistrationProperty)o;
- if (!name.equals(that.name))
+ if (!persistentName.equals(that.persistentName))
{
return false;
}
- if (!lang.equals(that.lang))
+ if (!persistentLang.equals(that.persistentLang))
{
return false;
}
- if (invalid != that.invalid)
+ if (persistentInvalid != that.persistentInvalid)
{
return false;
}
- if (description != null ? !description.equals(that.description) : that.description != null)
+ if (persistentDescription != null ? !persistentDescription.equals(that.persistentDescription) : that.persistentDescription != null)
{
return false;
}
- if (key != null ? !key.equals(that.key) : that.key != null)
+ if (persistentId != null ? !persistentId.equals(that.persistentId) : that.persistentId != null)
{
return false;
}
- if (value != null ? !value.equals(that.value) : that.value != null)
+ if (persistentValue != null ? !persistentValue.equals(that.persistentValue) : that.persistentValue != null)
{
return false;
}
@@ -100,78 +103,86 @@
public int hashCode()
{
int result;
- result = (key != null ? key.hashCode() : 0);
- result = 31 * result + name.hashCode();
- result = 31 * result + lang.hashCode();
- result = 31 * result + (description != null ? description.hashCode() : 0);
- result = 31 * result + (invalid ? 1 : 0);
- result = 31 * result + (value != null ? value.hashCode() : 0);
+ result = (persistentId != null ? persistentId.hashCode() : 0);
+ result = 31 * result + persistentName.hashCode();
+ result = 31 * result + persistentLang.hashCode();
+ result = 31 * result + (persistentDescription != null ? persistentDescription.hashCode() : 0);
+ result = 31 * result + (persistentInvalid ? 1 : 0);
+ result = 31 * result + (persistentValue != null ? persistentValue.hashCode() : 0);
return result;
}
public Long getKey()
{
- return key;
+ return persistentId;
}
public void setKey(Long key)
{
- this.key = key;
+ this.persistentId = key;
}
public String getName()
{
- return name;
+ return persistentName;
}
public void setName(String name)
{
ParameterValidation.throwIllegalArgExceptionIfNullOrEmpty(name, "Name", "RegistrationProperty");
- this.name = name;
+ this.persistentName = name;
}
public String getValue()
{
- return value;
+ return persistentValue;
}
public RegistrationPropertyDescription getDescription()
{
- return description;
+ return persistentDescription;
}
public void setDescription(RegistrationPropertyDescription description)
{
- this.description = description;
+ this.persistentDescription = description;
}
public boolean isInvalid()
{
- return invalid;
+ return persistentInvalid;
}
public void setInvalid(boolean invalid)
{
- this.invalid = invalid;
+ this.persistentInvalid = invalid;
}
public void setValue(String stringValue)
{
- value = stringValue;
- if (value == null)
- {
- invalid = true;
- }
+ persistentValue = stringValue;
+ persistentInvalid = (persistentValue == null);
+ status = (persistentValue == null ? MISSING_VALUE_STATUS : null);
}
public String getLang()
{
- return lang;
+ return persistentLang;
}
public void setLang(String lang)
{
ParameterValidation.throwIllegalArgExceptionIfNullOrEmpty(lang, "Lang", "RegistrationProperty");
- this.lang = lang;
+ this.persistentLang = lang;
}
+
+ public String getStatus()
+ {
+ return status;
+ }
+
+ public void setStatus(String status)
+ {
+ this.status = status;
+ }
}
19 years
JBoss Portal SVN: r7185 - trunk/core/src/main/org/jboss/portal/core/controller/ajax.
by portal-commits@lists.jboss.org
Author: julien(a)jboss.com
Date: 2007-05-03 12:49:07 -0400 (Thu, 03 May 2007)
New Revision: 7185
Modified:
trunk/core/src/main/org/jboss/portal/core/controller/ajax/AjaxResponseHandler.java
Log:
minor variable renaming
Modified: trunk/core/src/main/org/jboss/portal/core/controller/ajax/AjaxResponseHandler.java
===================================================================
--- trunk/core/src/main/org/jboss/portal/core/controller/ajax/AjaxResponseHandler.java 2007-05-03 16:04:19 UTC (rev 7184)
+++ trunk/core/src/main/org/jboss/portal/core/controller/ajax/AjaxResponseHandler.java 2007-05-03 16:49:07 UTC (rev 7185)
@@ -193,7 +193,7 @@
Set dirtyWindowIds = new HashSet();
// Whether we need a full refresh or not
- boolean refresh = false;
+ boolean fullRefresh = false;
//
for (Iterator i = ctx.getChanges();i.hasNext();)
@@ -203,7 +203,7 @@
// A change that modifies potentially the page structure
if (!(change instanceof NavigationalStateObjectChange))
{
- refresh = true;
+ fullRefresh = true;
break;
}
NavigationalStateObjectChange update = (NavigationalStateObjectChange)change;
@@ -211,7 +211,7 @@
// A change that modifies potentially the page structure
if (update.getType() != NavigationalStateObjectChange.UPDATE)
{
- refresh = true;
+ fullRefresh = true;
break;
}
@@ -234,13 +234,13 @@
{
if (!WindowState.MAXIMIZED.equals(newWindowState))
{
- refresh = true;
+ fullRefresh = true;
break;
}
}
else if (WindowState.MAXIMIZED.equals(newWindowState))
{
- refresh = true;
+ fullRefresh = true;
break;
}
@@ -253,7 +253,7 @@
ctx.applyChanges();
//
- if (refresh)
+ if (fullRefresh)
{
ViewPageCommand rpc = new ViewPageCommand(page.getId());
String url = controllerContext.renderURL(rpc, null, null);
19 years
JBoss Portal SVN: r7184 - docs/trunk/referenceGuide/en/modules.
by portal-commits@lists.jboss.org
Author: thomas.heute(a)jboss.com
Date: 2007-05-03 12:04:19 -0400 (Thu, 03 May 2007)
New Revision: 7184
Modified:
docs/trunk/referenceGuide/en/modules/security.xml
Log:
Tried to explain how to restrict access to a page from default portal configuration.
Modified: docs/trunk/referenceGuide/en/modules/security.xml
===================================================================
--- docs/trunk/referenceGuide/en/modules/security.xml 2007-05-03 16:01:40 UTC (rev 7183)
+++ docs/trunk/referenceGuide/en/modules/security.xml 2007-05-03 16:04:19 UTC (rev 7184)
@@ -56,8 +56,8 @@
</deployment>
</deployments>]]></programlisting>
</para>
- <para>
- A security constraint on an object (our example above, secures a specific portal page), is explained as:
+ <para>The based principle of the security mechanism is that everything is restricted unless you grant privileges.
+ You grant privilege on a portal node by adding a security constraint as explained here:
<para>
<programlisting><![CDATA[
<security-constraint>
@@ -66,6 +66,9 @@
<action-name>viewrecursive</action-name>
</policy-permission>
</security-constraint>]]></programlisting>
+ The example above will grant the view privilege to anyone (unchecked role) to the current object and any
+ child object recursively.</para>
+ <para>
The security contraint portion is worth taking a look at, in an isolated fashion. It allows you to
secure a specific window/page/portal-instance based on a user's role.
</para>
@@ -103,6 +106,13 @@
</listitem>
</itemizedlist>
</para>
+ <note>
+ <title>Restricting access</title>
+ <para>Out of the box the default portal as a viewrecursive right for all the users, it means that whenever a page
+ is added, this page will be seen by any user. To restrict access to this page, the default portal security constraint
+ must be changed from viewrecursive to view, and viewrecursive security constraints must be added to its children
+ so that they can be viewed except the one you want to restrict access to.</para>
+ </note>
We provide three live samples of this descriptor, here
<xref linkend="desc_instancesxml"/>
,
19 years
JBoss Portal SVN: r7183 - 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-03 12:01:40 -0400 (Thu, 03 May 2007)
New Revision: 7183
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:
- Renamed persistent fields with a persistent prefix.
- Fixed areURLsDirty.
- Added refresh method.
- Updated tests.
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-03 15:53:26 UTC (rev 7182)
+++ trunk/wsrp/src/main/org/jboss/portal/test/wsrp/framework/support/BehaviorBackedServiceFactory.java 2007-05-03 16:01:40 UTC (rev 7183)
@@ -23,14 +23,33 @@
package org.jboss.portal.test.wsrp.framework.support;
+import org.jboss.portal.Mode;
+import org.jboss.portal.WindowState;
import org.jboss.portal.common.NotYetImplemented;
import org.jboss.portal.test.wsrp.framework.BehaviorRegistry;
+import org.jboss.portal.test.wsrp.framework.MarkupBehavior;
+import org.jboss.portal.wsrp.core.AccessDeniedFault;
+import org.jboss.portal.wsrp.core.GetMarkup;
+import org.jboss.portal.wsrp.core.InconsistentParametersFault;
+import org.jboss.portal.wsrp.core.InvalidCookieFault;
+import org.jboss.portal.wsrp.core.InvalidHandleFault;
+import org.jboss.portal.wsrp.core.InvalidRegistrationFault;
+import org.jboss.portal.wsrp.core.InvalidSessionFault;
+import org.jboss.portal.wsrp.core.InvalidUserCategoryFault;
+import org.jboss.portal.wsrp.core.MissingParametersFault;
+import org.jboss.portal.wsrp.core.OperationFailedFault;
+import org.jboss.portal.wsrp.core.UnsupportedLocaleFault;
+import org.jboss.portal.wsrp.core.UnsupportedMimeTypeFault;
+import org.jboss.portal.wsrp.core.UnsupportedModeFault;
+import org.jboss.portal.wsrp.core.UnsupportedWindowStateFault;
import org.jboss.portal.wsrp.core.WSRP_v1_Markup_PortType;
import org.jboss.portal.wsrp.core.WSRP_v1_PortletManagement_PortType;
import org.jboss.portal.wsrp.core.WSRP_v1_Registration_PortType;
import org.jboss.portal.wsrp.core.WSRP_v1_ServiceDescription_PortType;
import org.jboss.portal.wsrp.services.ServiceFactory;
+import java.rmi.RemoteException;
+
/**
* @author <a href="mailto:chris.laprun@jboss.com">Chris Laprun</a>
* @version $Revision$
@@ -49,6 +68,7 @@
public BehaviorBackedServiceFactory()
{
registry = new BehaviorRegistry();
+ registry.registerMarkupBehavior(new SimpleMarkupBehavior());
}
public Object getService(Class clazz) throws Exception
@@ -146,4 +166,22 @@
{
throw new NotYetImplemented();
}
+
+ private class SimpleMarkupBehavior extends MarkupBehavior
+ {
+ public SimpleMarkupBehavior()
+ {
+ super(BehaviorBackedServiceFactory.this.registry);
+ registerHandle(MARKUP);
+ }
+
+ protected String getMarkupString(Mode mode, WindowState windowState, String navigationalState, GetMarkup getMarkup)
+ throws UnsupportedWindowStateFault, InvalidCookieFault, InvalidSessionFault, AccessDeniedFault,
+ InconsistentParametersFault, InvalidHandleFault, UnsupportedLocaleFault, UnsupportedModeFault,
+ OperationFailedFault, MissingParametersFault, InvalidUserCategoryFault, InvalidRegistrationFault,
+ UnsupportedMimeTypeFault, RemoteException
+ {
+ return MARKUP;
+ }
+ }
}
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-03 15:53:26 UTC (rev 7182)
+++ trunk/wsrp/src/main/org/jboss/portal/test/wsrp/other/EndpointConfigurationInfoTestCase.java 2007-05-03 16:01:40 UTC (rev 7183)
@@ -92,19 +92,29 @@
info.setWsdlDefinitionURL(null);
}
- public void testIsRefreshNeeded() throws Exception
+ public void testRefreshWSDL() 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);
+ info.refresh();
assertFalse(info.isRefreshNeeded());
assertTrue(info.isAvailable());
+ }
+ public void testRefresh() throws Exception
+ {
+ assertTrue(info.isRefreshNeeded());
+ assertFalse(info.isAvailable());
+
// change the service factory to a fake one to be able to simulate access to endpoint
info.setServiceFactory(new BehaviorBackedServiceFactory());
+ info.refresh();
+ assertFalse(info.isRefreshNeeded());
+ assertTrue(info.isAvailable());
+
info.setServiceDescriptionURL(url);
assertTrue(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-03 15:53:26 UTC (rev 7182)
+++ trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/EndpointConfigurationInfo.java 2007-05-03 16:01:40 UTC (rev 7183)
@@ -45,11 +45,11 @@
/** DB primary key */
private Long key;
- private String serviceDescriptionURL = UNSET;
- private String markupURL = UNSET;
- private String registrationURL;
- private String portletManagementURL;
- private String wsdlDefinitionURL;
+ private String persistentServiceDescriptionURL = UNSET;
+ private String persistentMarkupURL = UNSET;
+ private String persistentRegistrationURL;
+ private String persistentPortletManagementURL;
+ private String persistentWsdlDefinitionURL;
// transient variables
/** Access to the WS */
@@ -100,53 +100,53 @@
public boolean usesWSDL()
{
- return serviceFactory instanceof RemoteSOAPInvokerServiceFactory || wsdlDefinitionURL != null;
+ return serviceFactory instanceof RemoteSOAPInvokerServiceFactory || persistentWsdlDefinitionURL != null;
}
public String getWsdlDefinitionURL()
{
if (serviceFactory instanceof RemoteSOAPInvokerServiceFactory)
{
- wsdlDefinitionURL = ((RemoteSOAPInvokerServiceFactory)serviceFactory).getWsdlDefinitionURL();
+ persistentWsdlDefinitionURL = ((RemoteSOAPInvokerServiceFactory)serviceFactory).getWsdlDefinitionURL();
}
- return wsdlDefinitionURL;
+ return persistentWsdlDefinitionURL;
}
public String getServiceDescriptionURL()
{
if (serviceFactory != null)
{
- serviceDescriptionURL = serviceFactory.getServiceDescriptionURL();
+ persistentServiceDescriptionURL = serviceFactory.getServiceDescriptionURL();
}
- return serviceDescriptionURL;
+ return persistentServiceDescriptionURL;
}
public String getMarkupURL()
{
if (serviceFactory != null)
{
- markupURL = serviceFactory.getMarkupURL();
+ persistentMarkupURL = serviceFactory.getMarkupURL();
}
- return markupURL;
+ return persistentMarkupURL;
}
public String getPortletManagementURL()
{
if (serviceFactory != null)
{
- portletManagementURL = serviceFactory.getPortletManagementURL();
+ persistentPortletManagementURL = serviceFactory.getPortletManagementURL();
}
- return portletManagementURL;
+ return persistentPortletManagementURL;
}
public String getRegistrationURL()
{
if (serviceFactory != null)
{
- registrationURL = serviceFactory.getRegistrationURL();
+ persistentRegistrationURL = serviceFactory.getRegistrationURL();
}
- return registrationURL;
+ return persistentRegistrationURL;
}
public void setServiceDescriptionURL(String serviceDescriptionURL)
@@ -155,7 +155,7 @@
{
serviceFactory.setServiceDescriptionURL(serviceDescriptionURL);
}
- this.serviceDescriptionURL = modifyIfNeeded(this.serviceDescriptionURL, serviceDescriptionURL, SD);
+ this.persistentServiceDescriptionURL = modifyIfNeeded(this.persistentServiceDescriptionURL, serviceDescriptionURL, SD);
}
@@ -165,7 +165,7 @@
{
serviceFactory.setMarkupURL(markupURL);
}
- this.markupURL = modifyIfNeeded(this.markupURL, markupURL, M);
+ this.persistentMarkupURL = modifyIfNeeded(this.persistentMarkupURL, markupURL, M);
}
public void setRegistrationURL(String registrationURL)
@@ -174,7 +174,7 @@
{
serviceFactory.setRegistrationURL(registrationURL);
}
- this.registrationURL = modifyIfNeeded(this.registrationURL, registrationURL, R);
+ this.persistentRegistrationURL = modifyIfNeeded(this.persistentRegistrationURL, registrationURL, R);
}
public void setPortletManagementURL(String portletManagementURL)
@@ -183,12 +183,12 @@
{
serviceFactory.setPortletManagementURL(portletManagementURL);
}
- this.portletManagementURL = modifyIfNeeded(this.portletManagementURL, portletManagementURL, PM);
+ this.persistentPortletManagementURL = modifyIfNeeded(this.persistentPortletManagementURL, portletManagementURL, PM);
}
public void setWsdlDefinitionURL(String wsdlDefinitionURL) throws RuntimeException
{
- this.wsdlDefinitionURL = wsdlDefinitionURL;
+ this.persistentWsdlDefinitionURL = 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)
@@ -223,13 +223,13 @@
}
else
{
- if (!UNSET.equals(serviceDescriptionURL) && !UNSET.equals(markupURL))
+ if (!UNSET.equals(persistentServiceDescriptionURL) && !UNSET.equals(persistentMarkupURL))
{
serviceFactory = new PerEndpointSOAPInvokerServiceFactory();
- serviceFactory.setServiceDescriptionURL(serviceDescriptionURL);
- serviceFactory.setMarkupURL(markupURL);
- serviceFactory.setPortletManagementURL(portletManagementURL);
- serviceFactory.setRegistrationURL(registrationURL);
+ serviceFactory.setServiceDescriptionURL(persistentServiceDescriptionURL);
+ serviceFactory.setMarkupURL(persistentMarkupURL);
+ serviceFactory.setPortletManagementURL(persistentPortletManagementURL);
+ serviceFactory.setRegistrationURL(persistentRegistrationURL);
}
else
{
@@ -244,7 +244,7 @@
{
try
{
- ((RemoteSOAPInvokerServiceFactory)serviceFactory).setWsdlDefinitionURL(wsdlDefinitionURL);
+ ((RemoteSOAPInvokerServiceFactory)serviceFactory).setWsdlDefinitionURL(persistentWsdlDefinitionURL);
clean.set(0, 4); // if setting the WSDL URL worked, consider everything clean
}
catch (Exception e)
@@ -276,14 +276,14 @@
ParameterValidation.throwIllegalArgExceptionIfNull(serviceFactory, "ServiceFactory");
this.serviceFactory = serviceFactory;
- serviceDescriptionURL = serviceFactory.getServiceDescriptionURL();
- markupURL = serviceFactory.getMarkupURL();
- portletManagementURL = serviceFactory.getPortletManagementURL();
- registrationURL = serviceFactory.getRegistrationURL();
+ persistentServiceDescriptionURL = serviceFactory.getServiceDescriptionURL();
+ persistentMarkupURL = serviceFactory.getMarkupURL();
+ persistentPortletManagementURL = serviceFactory.getPortletManagementURL();
+ persistentRegistrationURL = serviceFactory.getRegistrationURL();
if (serviceFactory instanceof RemoteSOAPInvokerServiceFactory)
{
- wsdlDefinitionURL = ((RemoteSOAPInvokerServiceFactory)serviceFactory).getWsdlDefinitionURL();
+ persistentWsdlDefinitionURL = ((RemoteSOAPInvokerServiceFactory)serviceFactory).getWsdlDefinitionURL();
}
}
@@ -363,6 +363,28 @@
private boolean areURLsDirty()
{
- return clean.cardinality() < 4;
+ return !clean.get(SD) || !clean.get(M) || (persistentPortletManagementURL != null && !clean.get(PM))
+ || (persistentRegistrationURL != null && !clean.get(R));
}
+
+ public void refresh() throws InvokerUnavailableException
+ {
+ if (isRefreshNeeded())
+ {
+ initServiceFactoryIfNeeded();
+ if (!usesWSDL())
+ {
+ getServiceDescriptionService();
+ getMarkupService();
+ if (persistentPortletManagementURL != null)
+ {
+ getPortletManagementService();
+ }
+ if (persistentRegistrationURL != null)
+ {
+ getRegistrationService();
+ }
+ }
+ }
+ }
}
19 years
JBoss Portal SVN: r7182 - docs/trunk/referenceGuide/en/modules.
by portal-commits@lists.jboss.org
Author: thomas.heute(a)jboss.com
Date: 2007-05-03 11:53:26 -0400 (Thu, 03 May 2007)
New Revision: 7182
Modified:
docs/trunk/referenceGuide/en/modules/ajax.xml
Log:
Improvment based on Julien's input
Modified: docs/trunk/referenceGuide/en/modules/ajax.xml
===================================================================
--- docs/trunk/referenceGuide/en/modules/ajax.xml 2007-05-03 15:24:04 UTC (rev 7181)
+++ docs/trunk/referenceGuide/en/modules/ajax.xml 2007-05-03 15:53:26 UTC (rev 7182)
@@ -161,7 +161,7 @@
example, if some objects are shared in the application scope of the session between portlets. When one
portlet update a session object, the other portlet won't be refreshed and will still display content based
on the previous value of the object in the session. To avoid that, partial refresh can be desactivated
- for certain windows or pages.</para>
+ for certain portlets by adding <portlet-refresh>false<portlet-refresh> in the jboss-portlet.xml file.</para>
</warning>
<sect3>
<title>Portal objects configuration</title>
19 years
JBoss Portal SVN: r7181 - trunk/core/src/main/org/jboss/portal/core/controller/ajax.
by portal-commits@lists.jboss.org
Author: julien(a)jboss.com
Date: 2007-05-03 11:24:04 -0400 (Thu, 03 May 2007)
New Revision: 7181
Modified:
trunk/core/src/main/org/jboss/portal/core/controller/ajax/AjaxResponseHandler.java
Log:
removed unused code statements
Modified: trunk/core/src/main/org/jboss/portal/core/controller/ajax/AjaxResponseHandler.java
===================================================================
--- trunk/core/src/main/org/jboss/portal/core/controller/ajax/AjaxResponseHandler.java 2007-05-03 12:46:05 UTC (rev 7180)
+++ trunk/core/src/main/org/jboss/portal/core/controller/ajax/AjaxResponseHandler.java 2007-05-03 15:24:04 UTC (rev 7181)
@@ -39,7 +39,6 @@
import org.jboss.portal.core.model.portal.command.view.ViewPageCommand;
import org.jboss.portal.core.model.portal.Window;
import org.jboss.portal.core.model.portal.Page;
-import org.jboss.portal.core.model.portal.Portal;
import org.jboss.portal.core.model.portal.PortalObject;
import org.jboss.portal.core.model.portal.PortalObjectId;
import org.jboss.portal.core.model.portal.PortalObjectContainer;
19 years
JBoss Portal SVN: r7180 - docs/trunk/referenceGuide/en/modules.
by portal-commits@lists.jboss.org
Author: thomas.heute(a)jboss.com
Date: 2007-05-03 08:46:05 -0400 (Thu, 03 May 2007)
New Revision: 7180
Modified:
docs/trunk/referenceGuide/en/modules/ajax.xml
Log:
Add warning note about application scope session objects
Modified: docs/trunk/referenceGuide/en/modules/ajax.xml
===================================================================
--- docs/trunk/referenceGuide/en/modules/ajax.xml 2007-05-03 10:58:39 UTC (rev 7179)
+++ docs/trunk/referenceGuide/en/modules/ajax.xml 2007-05-03 12:46:05 UTC (rev 7180)
@@ -155,6 +155,14 @@
<para>The portal providing partial refresh</para>
</caption>
</mediaobject>
+ <warning>
+ <title>Application scope session attributes</title>
+ <para>When partial refresh is activated, the state of a page can potentially become inconsistent. for
+ example, if some objects are shared in the application scope of the session between portlets. When one
+ portlet update a session object, the other portlet won't be refreshed and will still display content based
+ on the previous value of the object in the session. To avoid that, partial refresh can be desactivated
+ for certain windows or pages.</para>
+ </warning>
<sect3>
<title>Portal objects configuration</title>
<para>Like with the drag and drop feature, partial page refresh is controlled via properties on portal objects.
19 years
JBoss Portal SVN: r7179 - trunk/core/src/main/org/jboss/portal/core/controller/ajax.
by portal-commits@lists.jboss.org
Author: julien(a)jboss.com
Date: 2007-05-03 06:58:39 -0400 (Thu, 03 May 2007)
New Revision: 7179
Modified:
trunk/core/src/main/org/jboss/portal/core/controller/ajax/AjaxResponseHandler.java
Log:
removed unused code statements
Modified: trunk/core/src/main/org/jboss/portal/core/controller/ajax/AjaxResponseHandler.java
===================================================================
--- trunk/core/src/main/org/jboss/portal/core/controller/ajax/AjaxResponseHandler.java 2007-05-02 21:35:51 UTC (rev 7178)
+++ trunk/core/src/main/org/jboss/portal/core/controller/ajax/AjaxResponseHandler.java 2007-05-03 10:58:39 UTC (rev 7179)
@@ -59,7 +59,6 @@
import org.jboss.portal.common.util.MarkupInfo;
import org.jboss.portal.theme.impl.render.dynamic.response.UpdatePageLocationResponse;
import org.jboss.portal.theme.impl.render.dynamic.response.UpdatePageStateResponse;
-import org.jboss.portal.theme.impl.render.dynamic.DynaRenderOptions;
import org.jboss.portal.theme.LayoutService;
import org.jboss.portal.theme.PortalLayout;
import org.jboss.portal.theme.PageService;
@@ -187,7 +186,6 @@
// Obtain page and portal
final Window window = (Window)portalObjectContainer.getObject(upw.getWindowId());
Page page = (Page)window.getParent();
- Portal portal = page.getPortal();
//
PortalObjectNavigationalStateContext ctx = (PortalObjectNavigationalStateContext)controllerContext.getAttributeResolver(ControllerCommand.NAVIGATIONAL_STATE_SCOPE);
@@ -330,7 +328,7 @@
// Push page
rendererContext.pushObjectRenderContext(res);
- // Push regin
+ // Push region
Region region = res.getRegion2(wc.getRegionName());
rendererContext.pushObjectRenderContext(region);
19 years