JBoss Portal SVN: r7795 - in branches/JBoss_Portal_Branch_2_6/core/src: resources/portal-core-war/WEB-INF/jsp/catalog and 1 other directories.
by portal-commits@lists.jboss.org
Author: thomas.heute(a)jboss.com
Date: 2007-07-17 09:14:06 -0400 (Tue, 17 Jul 2007)
New Revision: 7795
Modified:
branches/JBoss_Portal_Branch_2_6/core/src/bin/portal-core-war/themes/renaissance/portal_style.css
branches/JBoss_Portal_Branch_2_6/core/src/resources/portal-core-war/WEB-INF/jsp/catalog/index.jsp
branches/JBoss_Portal_Branch_2_6/core/src/resources/portal-core-war/WEB-INF/jsp/header/tabs.jsp
Log:
Slightly better for IE.
Modified: branches/JBoss_Portal_Branch_2_6/core/src/bin/portal-core-war/themes/renaissance/portal_style.css
===================================================================
--- branches/JBoss_Portal_Branch_2_6/core/src/bin/portal-core-war/themes/renaissance/portal_style.css 2007-07-17 10:14:41 UTC (rev 7794)
+++ branches/JBoss_Portal_Branch_2_6/core/src/bin/portal-core-war/themes/renaissance/portal_style.css 2007-07-17 13:14:06 UTC (rev 7795)
@@ -278,12 +278,12 @@
padding: 5px 15px 3px 15px; /*background-image: url(../images/tab_left.gif);*/
background-repeat: no-repeat;
background-position: top left;
- width: 90px;
+ width: 110px;
white-space: nowrap;
}
ul#tabsHeader a:hover {
- text-decoration: underline;
+ text-decoration: none;
color: #000000; /*background-image: url(../images/tab_left_hover2.gif);*/
background-repeat: no-repeat;
background-position: top left;
@@ -297,6 +297,7 @@
background-repeat: no-repeat;
background-position: right top;
padding-top: -3px; /*border-bottom: 2px solid #fff;*/
+ z-align: -10;
}
ul#tabsHeader #current a, #current a:hover {
@@ -314,7 +315,7 @@
height: 0;
top: 0px;
left: 0;
- width: 150px;
+ width: 160px;
text-align: left;
margin: 0px;
padding: 0px;
@@ -322,6 +323,8 @@
}
ul#tabsHeader ul a {
+ text-decoration: none;
+
font: 11px;
font-family: Verdana, Arial, Helvetica, Sans-Serif, sans-serif;
font-weight: normal;
@@ -352,7 +355,7 @@
background: #DFE8ED;
color: #5078aa;
padding: 3px;
- width: 120px;
+ width: 160px;
border: 1px solid #98b7c6;
border-width: 0px 1px 1px 1px;
Modified: branches/JBoss_Portal_Branch_2_6/core/src/resources/portal-core-war/WEB-INF/jsp/catalog/index.jsp
===================================================================
--- branches/JBoss_Portal_Branch_2_6/core/src/resources/portal-core-war/WEB-INF/jsp/catalog/index.jsp 2007-07-17 10:14:41 UTC (rev 7794)
+++ branches/JBoss_Portal_Branch_2_6/core/src/resources/portal-core-war/WEB-INF/jsp/catalog/index.jsp 2007-07-17 13:14:06 UTC (rev 7795)
@@ -46,11 +46,11 @@
output += parent;
%>
-<div class="portlet-form-field-label"><%= output %></div></li>
+<div class="portlet-form-field-label"><%= output %></div>
<ul id="foldinglist">
<li class="pagenosub">
- <div class="portlet-form-field-label"><%= parent %></div></li>
+ <div class="portlet-form-field-label"><%= parent %></div>
</li>
<%
for(Iterator i = parentChildMap.keySet().iterator(); i.hasNext();)
Modified: branches/JBoss_Portal_Branch_2_6/core/src/resources/portal-core-war/WEB-INF/jsp/header/tabs.jsp
===================================================================
--- branches/JBoss_Portal_Branch_2_6/core/src/resources/portal-core-war/WEB-INF/jsp/header/tabs.jsp 2007-07-17 10:14:41 UTC (rev 7794)
+++ branches/JBoss_Portal_Branch_2_6/core/src/resources/portal-core-war/WEB-INF/jsp/header/tabs.jsp 2007-07-17 13:14:06 UTC (rev 7795)
@@ -44,12 +44,10 @@
}
}
%>
- <li <% if(child == mainPage) out.println(" id=\"current\""); %> onmouseover="this.className='hoverOn'" onmouseout="this.className='hoverOff'"><a href="<%= child.createURL(context) %>"><%= child.getDisplayName(locale) %>
-<%
+ <li <% if(child == mainPage) out.println(" id=\"current\""); %> onmouseover="this.className='hoverOn'" onmouseout="this.className='hoverOff'"><a href="<%= child.createURL(context) %>"><%= child.getDisplayName(locale) %><%
if (tmp.size() == 0)
{
-%>
- </a>
+%></a>
<%
}
else
@@ -63,7 +61,7 @@
{
PortalNode childChild = (PortalNode)j.next();
%>
- <li><a href='<%= childChild.createURL(context) %>'><%= childChild.getDisplayName(locale) %></a></li>
+ <li class="tabs_sub_listItem"><a href='<%= childChild.createURL(context) %>'><%= childChild.getDisplayName(locale) %></a></li>
<%
}
%>
16 years, 11 months
JBoss Portal SVN: r7794 - in branches/JBoss_Portal_Branch_2_6/build: etc and 1 other directories.
by portal-commits@lists.jboss.org
Author: thomas.heute(a)jboss.com
Date: 2007-07-17 06:14:41 -0400 (Tue, 17 Jul 2007)
New Revision: 7794
Added:
branches/JBoss_Portal_Branch_2_6/build/etc/resources/
branches/JBoss_Portal_Branch_2_6/build/etc/resources/jboss-log4j.xml.diff
Modified:
branches/JBoss_Portal_Branch_2_6/build/distrib.xml
Log:
Add log4j patch for bundle versions
Modified: branches/JBoss_Portal_Branch_2_6/build/distrib.xml
===================================================================
--- branches/JBoss_Portal_Branch_2_6/build/distrib.xml 2007-07-17 03:52:58 UTC (rev 7793)
+++ branches/JBoss_Portal_Branch_2_6/build/distrib.xml 2007-07-17 10:14:41 UTC (rev 7794)
@@ -152,6 +152,10 @@
</sequential>
</target>
+ <target name="patch-log4j">
+ <patch patchfile="${source.dir}/build/etc/resources/jboss-log4j.xml.diff" originalfile="${todir}/conf/jboss-log4j.xml" strip="1"/>
+ </target>
+
<!-- use -Dno-doc=true if you simply want jboss-portal.sar without licenses etc-->
<target name="package-bin" unless="no-doc">
<sequential>
@@ -183,7 +187,7 @@
</antcall>
<antcall target="package-samples">
<param name="todir" value="${todir}/samples"/>
- </antcall>
+ </antcall>
<copy file="${docs.dir}/readmeFiles/jboss-portal-bin.README" todir="${todir}"/>
<copy todir="${todir}/docs/portal/licenses">
<fileset dir="output/docs/licenses"/>
@@ -288,6 +292,7 @@
<copy file="${docs.dir}/readmeFiles/jboss-portal-ha-bin.README" todir="${portal.build.ha.bin}"/>
</target>
+
<!--
| JBoss Portal bundled distribution
-->
@@ -312,6 +317,10 @@
<include name="server/default/**"/>
</fileset>
</copy>
+ <copy file="${docs.dir}/readmeFiles/jboss-portal-bin.README" todir="${portal.build.normal.bundled}"/>
+ <antcall target="patch-log4j">
+ <param name="todir" value="${portal.build.normal.bundled}/server/default"/>
+ </antcall>
</target>
<!--
@@ -330,13 +339,17 @@
<copy todir="${portal.build.ha.bundled}">
<fileset dir="${jboss.home}">
<include name="bin/**"/>
- <include name="clients/**"/>
+ <include name="client/**"/>
<include name="docs/**"/>
<include name="lib/**"/>
<include name="server/all/**"/>
</fileset>
</copy>
<copy file="${docs.dir}/readmeFiles/jboss-portal-ha-bin.README" todir="${portal.build.ha.bundled}"/>
+ <antcall target="patch-log4j">
+ <param name="todir" value="${portal.build.normal.bundled}/server/default"/>
+ </antcall>
+
</target>
<!-- Create packages -->
Added: branches/JBoss_Portal_Branch_2_6/build/etc/resources/jboss-log4j.xml.diff
===================================================================
--- branches/JBoss_Portal_Branch_2_6/build/etc/resources/jboss-log4j.xml.diff (rev 0)
+++ branches/JBoss_Portal_Branch_2_6/build/etc/resources/jboss-log4j.xml.diff 2007-07-17 10:14:41 UTC (rev 7794)
@@ -0,0 +1,22 @@
+diff -u conf.orig/jboss-log4j.xml conf/jboss-log4j.xml
+--- conf.orig/jboss-log4j.xml 2007-07-16 23:56:32.000000000 +0200
++++ conf/jboss-log4j.xml 2007-07-17 09:26:16.000000000 +0200
+@@ -164,6 +164,16 @@
+ <priority value="INFO"/>
+ </category>
+
++ <!-- Hibernate got a bit too verbose in JBoss AS 4.2.1.GA -->
++ <category name="org.hibernate.engine.loading.LoadContexts">
++ <priority value="ERROR"/>
++ </category>
++
++ <!-- JBoss Cache likes to talk a lot -->
++ <category name="org.jboss.cache.interceptors.CacheLoaderInterceptor">
++ <priority value="ERROR"/>
++ </category>
++
+ <!-- Limit the org.jboss.serial (jboss-serialization) to INFO as its DEBUG is verbose -->
+ <category name="org.jboss.serial">
+ <priority value="INFO"/>
+Common subdirectories: conf.orig/props and conf/props
+Common subdirectories: conf.orig/xmdesc and conf/xmdesc
16 years, 11 months
JBoss Portal SVN: r7793 - trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer.
by portal-commits@lists.jboss.org
Author: chris.laprun(a)jboss.com
Date: 2007-07-16 23:52:58 -0400 (Mon, 16 Jul 2007)
New Revision: 7793
Modified:
trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/RenderHandler.java
Log:
- JBPORTAL-1589: Better handling of invalid response from producers.
Modified: trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/RenderHandler.java
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/RenderHandler.java 2007-07-17 03:52:40 UTC (rev 7792)
+++ trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/RenderHandler.java 2007-07-17 03:52:58 UTC (rev 7793)
@@ -101,9 +101,23 @@
byte[] binary = markupContext.getMarkupBinary();
if (markup != null && binary != null)
{
- return new ErrorResponse(new IllegalArgumentException("Markup response cannot contain both string and binary markup."));
+ return new ErrorResponse(new IllegalArgumentException("Markup response cannot contain both string and binary " +
+ "markup. Per Section 6.1.10 of the WSRP specification, this is a Producer error."));
}
+ if (markup == null && binary == null)
+ {
+ if (markupContext.getUseCachedMarkup().booleanValue())
+ {
+ //todo: deal with cache
+ }
+ else
+ {
+ return new ErrorResponse(new IllegalArgumentException("Markup response must contain at least string or binary" +
+ " markup. Per Section 6.1.10 of the WSRP specification, this is a Producer error."));
+ }
+ }
+
if (markup != null && markup.length() > 0)
{
markup = processMarkup(markup, invocation, Boolean.TRUE.equals(markupContext.getRequiresUrlRewriting()));
@@ -114,7 +128,14 @@
}
FragmentResponse result = new FragmentResponse();
- result.setContentType(markupContext.getMimeType());
+
+ String mimeType = markupContext.getMimeType();
+ if (mimeType == null || mimeType.length() == 0)
+ {
+ return new ErrorResponse(new IllegalArgumentException("No MIME type was provided for portlet content."));
+ }
+ result.setContentType(mimeType);
+
result.setTitle(markupContext.getPreferredTitle());
// cache markup if possible
16 years, 11 months
JBoss Portal SVN: r7792 - branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/wsrp/consumer.
by portal-commits@lists.jboss.org
Author: chris.laprun(a)jboss.com
Date: 2007-07-16 23:52:40 -0400 (Mon, 16 Jul 2007)
New Revision: 7792
Modified:
branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/wsrp/consumer/RenderHandler.java
Log:
- JBPORTAL-1589: Better handling of invalid response from producers.
Modified: branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/wsrp/consumer/RenderHandler.java
===================================================================
--- branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/wsrp/consumer/RenderHandler.java 2007-07-17 02:48:08 UTC (rev 7791)
+++ branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/wsrp/consumer/RenderHandler.java 2007-07-17 03:52:40 UTC (rev 7792)
@@ -101,9 +101,23 @@
byte[] binary = markupContext.getMarkupBinary();
if (markup != null && binary != null)
{
- return new ErrorResponse(new IllegalArgumentException("Markup response cannot contain both string and binary markup."));
+ return new ErrorResponse(new IllegalArgumentException("Markup response cannot contain both string and binary " +
+ "markup. Per Section 6.1.10 of the WSRP specification, this is a Producer error."));
}
+ if (markup == null && binary == null)
+ {
+ if (markupContext.getUseCachedMarkup().booleanValue())
+ {
+ //todo: deal with cache
+ }
+ else
+ {
+ return new ErrorResponse(new IllegalArgumentException("Markup response must contain at least string or binary" +
+ " markup. Per Section 6.1.10 of the WSRP specification, this is a Producer error."));
+ }
+ }
+
if (markup != null && markup.length() > 0)
{
markup = processMarkup(markup, invocation, Boolean.TRUE.equals(markupContext.getRequiresUrlRewriting()));
@@ -114,7 +128,14 @@
}
FragmentResponse result = new FragmentResponse();
- result.setContentType(markupContext.getMimeType());
+
+ String mimeType = markupContext.getMimeType();
+ if (mimeType == null || mimeType.length() == 0)
+ {
+ return new ErrorResponse(new IllegalArgumentException("No MIME type was provided for portlet content."));
+ }
+ result.setContentType(mimeType);
+
result.setTitle(markupContext.getPreferredTitle());
// cache markup if possible
16 years, 11 months
JBoss Portal SVN: r7791 - in trunk: wsrp/src/main/org/jboss/portal/test/wsrp/consumer and 1 other directories.
by portal-commits@lists.jboss.org
Author: chris.laprun(a)jboss.com
Date: 2007-07-16 22:48:08 -0400 (Mon, 16 Jul 2007)
New Revision: 7791
Modified:
trunk/core-wsrp/src/main/org/jboss/portal/wsrp/admin/ui/ConsumerBean.java
trunk/wsrp/src/main/org/jboss/portal/test/wsrp/consumer/ProducerInfoTestCase.java
trunk/wsrp/src/main/org/jboss/portal/test/wsrp/consumer/RegistrationInfoTestCase.java
trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/ProducerInfo.java
trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/RegistrationInfo.java
Log:
- JBPORTAL-1585: modifyRegistration and deregister now properly invalidate ProducerInfo's cache.
- JBPORTAL-1587: Added RegistrationInfo.setModified to be able to properly refresh RegistrationData as we cannot currently make it dirty from ConsumerBean.regPropListener.
- Fixed an issue where update and refreshConsumer in ConsumerBean would not properly detect that a refresh is needed.
- Added test cases.
Modified: trunk/core-wsrp/src/main/org/jboss/portal/wsrp/admin/ui/ConsumerBean.java
===================================================================
--- trunk/core-wsrp/src/main/org/jboss/portal/wsrp/admin/ui/ConsumerBean.java 2007-07-17 02:23:34 UTC (rev 7790)
+++ trunk/core-wsrp/src/main/org/jboss/portal/wsrp/admin/ui/ConsumerBean.java 2007-07-17 02:48:08 UTC (rev 7791)
@@ -250,31 +250,32 @@
public String update()
{
- if (consumer != null && modified)
+ if (consumer != null)
{
- try
+ if (isModified())
{
- // update values
- ProducerInfo prodInfo = getProducerInfo();
- EndpointConfigurationInfo endpointInfo = prodInfo.getEndpointConfigurationInfo();
- endpointInfo.setMarkupURL(markup);
- endpointInfo.setServiceDescriptionURL(serviceDescription);
- endpointInfo.setPortletManagementURL(portletManagement);
- endpointInfo.setRegistrationURL(registration);
- if (isUseWSDL())
+ try
{
- internalSetWsdl(wsdl);
+ // update values
+ ProducerInfo prodInfo = getProducerInfo();
+ EndpointConfigurationInfo endpointInfo = prodInfo.getEndpointConfigurationInfo();
+ endpointInfo.setMarkupURL(markup);
+ endpointInfo.setServiceDescriptionURL(serviceDescription);
+ endpointInfo.setPortletManagementURL(portletManagement);
+ endpointInfo.setRegistrationURL(registration);
+ if (isUseWSDL())
+ {
+ internalSetWsdl(wsdl);
+ }
+
+ saveToRegistry(prodInfo);
}
-
- registry.updateProducerInfo(prodInfo);
- modified = false;
- registrationModified = false;
+ catch (Exception e)
+ {
+ beanContext.createErrorMessageFrom(e);
+ return null;
+ }
}
- catch (Exception e)
- {
- beanContext.createErrorMessageFrom(e);
- return null;
- }
return manager.listConsumers();
}
@@ -283,9 +284,16 @@
return null;
}
+ private void saveToRegistry(ProducerInfo prodInfo)
+ {
+ registry.updateProducerInfo(prodInfo);
+ modified = false;
+ registrationModified = false;
+ }
+
public String refreshConsumer()
{
- if (modified)
+ if (isModified())
{
String updateResult = update();
if (updateResult == null)
@@ -333,18 +341,32 @@
{
if (consumer != null)
{
- try
+ if (registrationModified)
{
- getProducerInfo().modifyRegistration();
- beanContext.createInfoMessage(null, "Successfully modified Registration!");
- registrationModified = false;
+ try
+ {
+ ProducerInfo info = getProducerInfo();
+ saveToRegistry(info); // make sure we save any modified registration properties
+
+ // todo: this should be done better cf regPropListener
+ getProducerInfo().getRegistrationInfo().setModified(true); // mark as modified to force refresh of RegistrationData
+ info.modifyRegistration();
+ getProducerInfo().getRegistrationInfo().setModified(false);
+
+ beanContext.createInfoMessage(null, "Successfully modified Registration!");
+ registrationModified = false;
+ }
+ catch (Exception e)
+ {
+ beanContext.createErrorMessageFrom(e);
+ return null;
+ }
+ return null;
}
- catch (Exception e)
+ else
{
- beanContext.createErrorMessageFrom(e);
- return null;
+ beanContext.createErrorMessage("Invalid attempt to modify a Registration that hasn't been locally modified!");
}
- return null;
}
beanContext.createErrorMessage("Couldn't modify Registration!");
@@ -387,9 +409,11 @@
public void regPropListener(ValueChangeEvent event)
{
+ // todo: should use modifyIfNeeded but it might be tricky as the name of the property that has been changed
+ // cannot be easily retrieved (we cannot use it as an id directly), could use title but that would be hackish
registrationModified = true;
// bypass the rest of the life cycle and re-display page
FacesContext.getCurrentInstance().renderResponse();
}
-}
\ No newline at end of file
+}
Modified: trunk/wsrp/src/main/org/jboss/portal/test/wsrp/consumer/ProducerInfoTestCase.java
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/test/wsrp/consumer/ProducerInfoTestCase.java 2007-07-17 02:23:34 UTC (rev 7790)
+++ trunk/wsrp/src/main/org/jboss/portal/test/wsrp/consumer/ProducerInfoTestCase.java 2007-07-17 02:48:08 UTC (rev 7791)
@@ -274,7 +274,10 @@
info.modifyRegistration();
- assertFalse(info.isRefreshNeeded(false));
+ assertTrue(info.isRefreshNeeded(true)); // cache should have been invalidated
+ assertFalse(info.isRefreshNeeded(false)); // but the rest of the information is valid so no refresh needed there
+ assertTrue(info.refresh(false)); // however, if we refresh the producer info, it should have refreshed
+
Boolean invalid = prop.isInvalid();
assertNotNull(invalid);
assertFalse(invalid.booleanValue());
Modified: trunk/wsrp/src/main/org/jboss/portal/test/wsrp/consumer/RegistrationInfoTestCase.java
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/test/wsrp/consumer/RegistrationInfoTestCase.java 2007-07-17 02:23:34 UTC (rev 7790)
+++ trunk/wsrp/src/main/org/jboss/portal/test/wsrp/consumer/RegistrationInfoTestCase.java 2007-07-17 02:48:08 UTC (rev 7791)
@@ -29,7 +29,9 @@
import org.jboss.portal.wsrp.consumer.RefreshResult;
import org.jboss.portal.wsrp.consumer.RegistrationInfo;
import org.jboss.portal.wsrp.consumer.RegistrationProperty;
+import org.jboss.portal.wsrp.core.Property;
import org.jboss.portal.wsrp.core.RegistrationContext;
+import org.jboss.portal.wsrp.core.RegistrationData;
import org.jboss.portal.wsrp.core.ServiceDescription;
import java.util.Map;
@@ -284,6 +286,30 @@
assertFalse(info.isRegistrationDeterminedNotRequired());
}
+ public void testGetRegistrationData()
+ {
+ assertNotNull(info.getRegistrationData());
+ assertFalse(info.isModified());
+
+ info.setRegistrationPropertyValue("prop0", "value0");
+ assertTrue(info.isModified());
+ RegistrationData registrationData = info.getRegistrationData();
+ assertNotNull(registrationData);
+ Property[] properties = registrationData.getRegistrationProperties();
+ assertNotNull(properties);
+ assertEquals(1, properties.length);
+ assertEquals("prop0", properties[0].getName());
+ assertEquals("value0", properties[0].getStringValue());
+
+ // check that setRegistrationValidInternalState properly updates RegistrationData if required
+ info.setRegistrationPropertyValue("prop0", "value1");
+ assertTrue(info.isModified());
+ info.setRegistrationValidInternalState();
+ assertFalse(info.isModified());
+ properties = info.getRegistrationData().getRegistrationProperties();
+ assertEquals("value1", properties[0].getStringValue());
+ }
+
private ServiceDescription createServiceDescription(boolean requiresRegistration, int numberOfProperties)
{
return ServiceDescriptionBehavior.createServiceDescription(requiresRegistration, numberOfProperties);
Modified: trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/ProducerInfo.java
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/ProducerInfo.java 2007-07-17 02:23:34 UTC (rev 7790)
+++ trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/ProducerInfo.java 2007-07-17 02:48:08 UTC (rev 7791)
@@ -749,6 +749,8 @@
persistentEndpointInfo.getRegistrationService().deregister(getRegistrationContext());
persistentRegistrationInfo.resetRegistration();
log.info("Consumer with id '" + persistentId + "' deregistered.");
+
+ invalidateCache();
}
catch (Exception e)
{
@@ -787,6 +789,9 @@
persistentRegistrationInfo.setRegistrationState(state.getRegistrationState());
}
log.info("Consumer with id '" + persistentId + "' sucessfully modified its registration.");
+
+ // reset cache to be able to see new offered portlets on the next refresh
+ invalidateCache();
}
catch (Exception e)
{
@@ -804,6 +809,14 @@
}
}
+ private void invalidateCache()
+ {
+ if (useCache())
+ {
+ expirationTimeMillis = System.currentTimeMillis();
+ }
+ }
+
public RefreshResult refreshRegistrationInfo(boolean mergeWithLocalInfo) throws PortletInvokerException
{
return internalRefreshRegistration(getServiceDescription(true), mergeWithLocalInfo, true);
Modified: trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/RegistrationInfo.java
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/RegistrationInfo.java 2007-07-17 02:23:34 UTC (rev 7790)
+++ trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/RegistrationInfo.java 2007-07-17 02:48:08 UTC (rev 7791)
@@ -214,7 +214,7 @@
}
}
- registrationData.setRegistrationProperties((Property[])properties.toArray(new Property[0]));
+ registrationData.setRegistrationProperties((Property[])properties.toArray(new Property[regProps.size()]));
}
}
@@ -530,11 +530,11 @@
setRegistrationValidInternalState();
}
- void setRegistrationValidInternalState()
+ /** todo: revert to package-only once the tests are moved to same package */
+ public void setRegistrationValidInternalState()
{
- consistentWithProducerExpectations = Boolean.TRUE; // since we have a registration context, we're consistent with the Producer
- requiresRegistration = Boolean.TRUE; // we know we require registration
- dirty = false; // our state is clean :)
+ // update RegistrationData if needed
+ getRegistrationData();
// mark the registration properties as valid
if (persistentRegistrationProperties != null)
@@ -545,6 +545,10 @@
prop.setInvalid(Boolean.FALSE, null);
}
}
+
+ consistentWithProducerExpectations = Boolean.TRUE; // since we have a registration context, we're consistent with the Producer
+ requiresRegistration = Boolean.TRUE; // we know we require registration
+ dirty = false; // our state is clean :)
}
public RegistrationContext getRegistrationContext()
@@ -566,6 +570,11 @@
return dirty;
}
+ public void setModified(boolean modified)
+ {
+ this.dirty = modified;
+ }
+
public class RegistrationRefreshResult extends RefreshResult
{
public RegistrationRefreshResult()
16 years, 11 months
JBoss Portal SVN: r7790 - in branches/JBoss_Portal_Branch_2_6: wsrp/src/main/org/jboss/portal/test/wsrp/consumer and 1 other directories.
by portal-commits@lists.jboss.org
Author: chris.laprun(a)jboss.com
Date: 2007-07-16 22:23:34 -0400 (Mon, 16 Jul 2007)
New Revision: 7790
Modified:
branches/JBoss_Portal_Branch_2_6/core-wsrp/src/main/org/jboss/portal/wsrp/admin/ui/ConsumerBean.java
branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/test/wsrp/consumer/ProducerInfoTestCase.java
branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/test/wsrp/consumer/RegistrationInfoTestCase.java
branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/wsrp/consumer/ProducerInfo.java
branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/wsrp/consumer/RegistrationInfo.java
Log:
- JBPORTAL-1585: modifyRegistration and deregister now properly invalidate ProducerInfo's cache.
- JBPORTAL-1587: Added RegistrationInfo.setModified to be able to properly refresh RegistrationData as we cannot currently make it dirty from ConsumerBean.regPropListener.
- Fixed an issue where update and refreshConsumer in ConsumerBean would not properly detect that a refresh is needed.
- Added test cases.
Modified: branches/JBoss_Portal_Branch_2_6/core-wsrp/src/main/org/jboss/portal/wsrp/admin/ui/ConsumerBean.java
===================================================================
--- branches/JBoss_Portal_Branch_2_6/core-wsrp/src/main/org/jboss/portal/wsrp/admin/ui/ConsumerBean.java 2007-07-16 23:20:36 UTC (rev 7789)
+++ branches/JBoss_Portal_Branch_2_6/core-wsrp/src/main/org/jboss/portal/wsrp/admin/ui/ConsumerBean.java 2007-07-17 02:23:34 UTC (rev 7790)
@@ -250,31 +250,32 @@
public String update()
{
- if (consumer != null && modified)
+ if (consumer != null)
{
- try
+ if (isModified())
{
- // update values
- ProducerInfo prodInfo = getProducerInfo();
- EndpointConfigurationInfo endpointInfo = prodInfo.getEndpointConfigurationInfo();
- endpointInfo.setMarkupURL(markup);
- endpointInfo.setServiceDescriptionURL(serviceDescription);
- endpointInfo.setPortletManagementURL(portletManagement);
- endpointInfo.setRegistrationURL(registration);
- if (isUseWSDL())
+ try
{
- internalSetWsdl(wsdl);
+ // update values
+ ProducerInfo prodInfo = getProducerInfo();
+ EndpointConfigurationInfo endpointInfo = prodInfo.getEndpointConfigurationInfo();
+ endpointInfo.setMarkupURL(markup);
+ endpointInfo.setServiceDescriptionURL(serviceDescription);
+ endpointInfo.setPortletManagementURL(portletManagement);
+ endpointInfo.setRegistrationURL(registration);
+ if (isUseWSDL())
+ {
+ internalSetWsdl(wsdl);
+ }
+
+ saveToRegistry(prodInfo);
}
-
- registry.updateProducerInfo(prodInfo);
- modified = false;
- registrationModified = false;
+ catch (Exception e)
+ {
+ beanContext.createErrorMessageFrom(e);
+ return null;
+ }
}
- catch (Exception e)
- {
- beanContext.createErrorMessageFrom(e);
- return null;
- }
return manager.listConsumers();
}
@@ -283,9 +284,16 @@
return null;
}
+ private void saveToRegistry(ProducerInfo prodInfo)
+ {
+ registry.updateProducerInfo(prodInfo);
+ modified = false;
+ registrationModified = false;
+ }
+
public String refreshConsumer()
{
- if (modified)
+ if (isModified())
{
String updateResult = update();
if (updateResult == null)
@@ -333,18 +341,32 @@
{
if (consumer != null)
{
- try
+ if (registrationModified)
{
- getProducerInfo().modifyRegistration();
- beanContext.createInfoMessage(null, "Successfully modified Registration!");
- registrationModified = false;
+ try
+ {
+ ProducerInfo info = getProducerInfo();
+ saveToRegistry(info); // make sure we save any modified registration properties
+
+ // todo: this should be done better cf regPropListener
+ getProducerInfo().getRegistrationInfo().setModified(true); // mark as modified to force refresh of RegistrationData
+ info.modifyRegistration();
+ getProducerInfo().getRegistrationInfo().setModified(false);
+
+ beanContext.createInfoMessage(null, "Successfully modified Registration!");
+ registrationModified = false;
+ }
+ catch (Exception e)
+ {
+ beanContext.createErrorMessageFrom(e);
+ return null;
+ }
+ return null;
}
- catch (Exception e)
+ else
{
- beanContext.createErrorMessageFrom(e);
- return null;
+ beanContext.createErrorMessage("Invalid attempt to modify a Registration that hasn't been locally modified!");
}
- return null;
}
beanContext.createErrorMessage("Couldn't modify Registration!");
@@ -387,6 +409,8 @@
public void regPropListener(ValueChangeEvent event)
{
+ // todo: should use modifyIfNeeded but it might be tricky as the name of the property that has been changed
+ // cannot be easily retrieved (we cannot use it as an id directly), could use title but that would be hackish
registrationModified = true;
// bypass the rest of the life cycle and re-display page
Modified: branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/test/wsrp/consumer/ProducerInfoTestCase.java
===================================================================
--- branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/test/wsrp/consumer/ProducerInfoTestCase.java 2007-07-16 23:20:36 UTC (rev 7789)
+++ branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/test/wsrp/consumer/ProducerInfoTestCase.java 2007-07-17 02:23:34 UTC (rev 7790)
@@ -274,7 +274,10 @@
info.modifyRegistration();
- assertFalse(info.isRefreshNeeded(false));
+ assertTrue(info.isRefreshNeeded(true)); // cache should have been invalidated
+ assertFalse(info.isRefreshNeeded(false)); // but the rest of the information is valid so no refresh needed there
+ assertTrue(info.refresh(false)); // however, if we refresh the producer info, it should have refreshed
+
Boolean invalid = prop.isInvalid();
assertNotNull(invalid);
assertFalse(invalid.booleanValue());
Modified: branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/test/wsrp/consumer/RegistrationInfoTestCase.java
===================================================================
--- branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/test/wsrp/consumer/RegistrationInfoTestCase.java 2007-07-16 23:20:36 UTC (rev 7789)
+++ branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/test/wsrp/consumer/RegistrationInfoTestCase.java 2007-07-17 02:23:34 UTC (rev 7790)
@@ -29,7 +29,9 @@
import org.jboss.portal.wsrp.consumer.RefreshResult;
import org.jboss.portal.wsrp.consumer.RegistrationInfo;
import org.jboss.portal.wsrp.consumer.RegistrationProperty;
+import org.jboss.portal.wsrp.core.Property;
import org.jboss.portal.wsrp.core.RegistrationContext;
+import org.jboss.portal.wsrp.core.RegistrationData;
import org.jboss.portal.wsrp.core.ServiceDescription;
import java.util.Map;
@@ -284,6 +286,30 @@
assertFalse(info.isRegistrationDeterminedNotRequired());
}
+ public void testGetRegistrationData()
+ {
+ assertNotNull(info.getRegistrationData());
+ assertFalse(info.isModified());
+
+ info.setRegistrationPropertyValue("prop0", "value0");
+ assertTrue(info.isModified());
+ RegistrationData registrationData = info.getRegistrationData();
+ assertNotNull(registrationData);
+ Property[] properties = registrationData.getRegistrationProperties();
+ assertNotNull(properties);
+ assertEquals(1, properties.length);
+ assertEquals("prop0", properties[0].getName());
+ assertEquals("value0", properties[0].getStringValue());
+
+ // check that setRegistrationValidInternalState properly updates RegistrationData if required
+ info.setRegistrationPropertyValue("prop0", "value1");
+ assertTrue(info.isModified());
+ info.setRegistrationValidInternalState();
+ assertFalse(info.isModified());
+ properties = info.getRegistrationData().getRegistrationProperties();
+ assertEquals("value1", properties[0].getStringValue());
+ }
+
private ServiceDescription createServiceDescription(boolean requiresRegistration, int numberOfProperties)
{
return ServiceDescriptionBehavior.createServiceDescription(requiresRegistration, numberOfProperties);
Modified: branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/wsrp/consumer/ProducerInfo.java
===================================================================
--- branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/wsrp/consumer/ProducerInfo.java 2007-07-16 23:20:36 UTC (rev 7789)
+++ branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/wsrp/consumer/ProducerInfo.java 2007-07-17 02:23:34 UTC (rev 7790)
@@ -749,6 +749,8 @@
persistentEndpointInfo.getRegistrationService().deregister(getRegistrationContext());
persistentRegistrationInfo.resetRegistration();
log.info("Consumer with id '" + persistentId + "' deregistered.");
+
+ invalidateCache();
}
catch (Exception e)
{
@@ -787,6 +789,9 @@
persistentRegistrationInfo.setRegistrationState(state.getRegistrationState());
}
log.info("Consumer with id '" + persistentId + "' sucessfully modified its registration.");
+
+ // reset cache to be able to see new offered portlets on the next refresh
+ invalidateCache();
}
catch (Exception e)
{
@@ -804,6 +809,14 @@
}
}
+ private void invalidateCache()
+ {
+ if (useCache())
+ {
+ expirationTimeMillis = System.currentTimeMillis();
+ }
+ }
+
public RefreshResult refreshRegistrationInfo(boolean mergeWithLocalInfo) throws PortletInvokerException
{
return internalRefreshRegistration(getServiceDescription(true), mergeWithLocalInfo, true);
Modified: branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/wsrp/consumer/RegistrationInfo.java
===================================================================
--- branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/wsrp/consumer/RegistrationInfo.java 2007-07-16 23:20:36 UTC (rev 7789)
+++ branches/JBoss_Portal_Branch_2_6/wsrp/src/main/org/jboss/portal/wsrp/consumer/RegistrationInfo.java 2007-07-17 02:23:34 UTC (rev 7790)
@@ -214,7 +214,7 @@
}
}
- registrationData.setRegistrationProperties((Property[])properties.toArray(new Property[0]));
+ registrationData.setRegistrationProperties((Property[])properties.toArray(new Property[regProps.size()]));
}
}
@@ -530,11 +530,11 @@
setRegistrationValidInternalState();
}
- void setRegistrationValidInternalState()
+ /** todo: revert to package-only once the tests are moved to same package */
+ public void setRegistrationValidInternalState()
{
- consistentWithProducerExpectations = Boolean.TRUE; // since we have a registration context, we're consistent with the Producer
- requiresRegistration = Boolean.TRUE; // we know we require registration
- dirty = false; // our state is clean :)
+ // update RegistrationData if needed
+ getRegistrationData();
// mark the registration properties as valid
if (persistentRegistrationProperties != null)
@@ -545,6 +545,10 @@
prop.setInvalid(Boolean.FALSE, null);
}
}
+
+ consistentWithProducerExpectations = Boolean.TRUE; // since we have a registration context, we're consistent with the Producer
+ requiresRegistration = Boolean.TRUE; // we know we require registration
+ dirty = false; // our state is clean :)
}
public RegistrationContext getRegistrationContext()
@@ -566,6 +570,11 @@
return dirty;
}
+ public void setModified(boolean modified)
+ {
+ this.dirty = modified;
+ }
+
public class RegistrationRefreshResult extends RefreshResult
{
public RegistrationRefreshResult()
16 years, 11 months
JBoss Portal SVN: r7788 - in trunk: core-admin/src/main/org/jboss/portal/core/admin/ui and 5 other directories.
by portal-commits@lists.jboss.org
Author: thomas.heute(a)jboss.com
Date: 2007-07-16 17:20:54 -0400 (Mon, 16 Jul 2007)
New Revision: 7788
Modified:
trunk/build/
trunk/build/build.xml
trunk/build/distrib.xml
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/InstanceManagerBean.java
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/PortletManagerBean.java
trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/common/PageManagerBean.java
trunk/core-admin/src/resources/portal-admin-sar/META-INF/jboss-service.xml
trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/common/editPageLayout.xhtml
trunk/core-cms/src/resources/portal-cms-war/WEB-INF/portlet.xml
trunk/wsrp/build.xml
Log:
* Fix wsrp build
* Remove core-admin sar isolation
* Samples missing
* Fix deploy-all/undeploy-all for portal-admin-wsrp.sar
* JBPORTAL-1509: Window name set the previously defined value when content-type has changed
* JBPORTAL-1584: Hide the CMS Content-type selector portlets definitions and instances
* Removed unused former portlet (need some cleanup here)
* Ignore build/output for SVN
Property changes on: trunk/build
___________________________________________________________________
Name: svn:ignore
- build.log
local.properties
build.iml
+ build.log
local.properties
build.iml
output
Modified: trunk/build/build.xml
===================================================================
--- trunk/build/build.xml 2007-07-16 16:27:26 UTC (rev 7787)
+++ trunk/build/build.xml 2007-07-16 21:20:54 UTC (rev 7788)
@@ -301,7 +301,6 @@
<!--<copy file="../core-search/output/lib/portal-search.sar" todir="${jboss.home}/server/${portal.deploy.dir}" overwrite="true"/>-->
<copy file="../widget/output/lib/widget.war" todir="${jboss.home}/server/${portal.deploy.dir}" overwrite="true"/>
<copy file="../wsrp/output/lib/portal-wsrp.sar" todir="${jboss.home}/server/${portal.deploy.dir}" overwrite="true"/>
- <copy file="../core-wsrp/output/lib/portal-wsrp-admin.sar" todir="${jboss.home}/server/${portal.deploy.dir}" overwrite="true"/>
</target>
<target name="undeploy-all"
@@ -319,7 +318,6 @@
<!--<delete file="${jboss.home}/server/${portal.deploy.dir}/portal-search.sar"/>-->
<delete file="${jboss.home}/server/${portal.deploy.dir}/widget.war"/>
<delete file="${jboss.home}/server/${portal.deploy.dir}/portal-wsrp.sar"/>
- <delete file="${jboss.home}/server/${portal.deploy.dir}/portal-wsrp-admin.sar"/>
</target>
<target name="exploded-deploy"
Modified: trunk/build/distrib.xml
===================================================================
--- trunk/build/distrib.xml 2007-07-16 16:27:26 UTC (rev 7787)
+++ trunk/build/distrib.xml 2007-07-16 21:20:54 UTC (rev 7788)
@@ -146,7 +146,7 @@
<sequential>
<mkdir dir="${todir}"/>
<copy todir="${todir}">
- <fileset dir="${source.dir}/core-samples/output/resources" includes="portal-basic-samples.sar"/>
+ <fileset dir="${source.dir}/core-samples/output/resources" includes="portal-basic-samples.sar/**"/>
</copy>
<copy file="${docs.dir}/readmeFiles/samples-readme.txt" tofile="${todir}/readme.txt"/>
</sequential>
Modified: trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/InstanceManagerBean.java
===================================================================
--- trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/InstanceManagerBean.java 2007-07-16 16:27:26 UTC (rev 7787)
+++ trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/InstanceManagerBean.java 2007-07-16 21:20:54 UTC (rev 7788)
@@ -37,14 +37,19 @@
import javax.faces.context.FacesContext;
import javax.faces.event.ActionEvent;
import javax.faces.model.SelectItem;
+import javax.portlet.PortletMode;
+import org.jboss.portal.Mode;
import org.jboss.portal.common.value.Value;
import org.jboss.portal.core.model.instance.Instance;
import org.jboss.portal.core.model.instance.InstanceContainer;
import org.jboss.portal.core.model.instance.InstanceDefinition;
import org.jboss.portal.core.model.instance.NoSuchInstanceException;
import org.jboss.portal.identity.RoleModule;
+import org.jboss.portal.portlet.Portlet;
import org.jboss.portal.portlet.PortletInvokerException;
+import org.jboss.portal.portlet.info.ModeInfo;
+import org.jboss.portal.portlet.info.PortletInfo;
import org.jboss.portal.portlet.info.PreferenceInfo;
import org.jboss.portal.portlet.info.PreferencesInfo;
import org.jboss.portal.portlet.state.PropertyChange;
@@ -58,6 +63,9 @@
*/
public class InstanceManagerBean
{
+
+ /** . */
+ private final Mode INTERNAL_EDIT_CONTENT = Mode.create("edit_content");
// Wired services
@@ -238,10 +246,37 @@
{
if (instances == null)
{
- instances = new ArrayList(instanceContainer.getDefinitions());
- Collections.sort(instances, INSTANCE_COMPARATOR);
+ // Remove content editors
+ List tmpInstances = new ArrayList();
+ nextInstance:
+ for (Iterator i = instanceContainer.getDefinitions().iterator();i.hasNext();)
+ {
+ Instance instance = (Instance)i.next();
+
+ //
+ try
+ {
+ // Filter portlets that are editors
+ Portlet portlet = instance.getPortlet();
+ PortletInfo info = portlet.getInfo();
+ for (Iterator j = info.getCapabilities().getAllModes().iterator();j.hasNext();)
+ {
+ ModeInfo modeInfo = (ModeInfo)j.next();
+ if (modeInfo.getMode().equals(INTERNAL_EDIT_CONTENT))
+ {
+ continue nextInstance;
+ }
+ }
+ //
+ tmpInstances.add(instance);
+ }
+ catch (PortletInvokerException ignore)
+ {
+ }
+ }
+ Collections.sort(tmpInstances, INSTANCE_COMPARATOR);
+ instances = tmpInstances;
}
-
//
return instances;
}
Modified: trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/PortletManagerBean.java
===================================================================
--- trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/PortletManagerBean.java 2007-07-16 16:27:26 UTC (rev 7787)
+++ trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/PortletManagerBean.java 2007-07-16 21:20:54 UTC (rev 7788)
@@ -23,6 +23,8 @@
package org.jboss.portal.core.admin.ui;
import org.jboss.logging.Logger;
+import org.jboss.portal.Mode;
+import org.jboss.portal.core.model.instance.Instance;
import org.jboss.portal.core.model.instance.InstanceContainer;
import org.jboss.portal.identity.RoleModule;
import org.jboss.portal.portlet.Portlet;
@@ -32,6 +34,8 @@
import org.jboss.portal.portlet.federation.FederatedPortletInvoker;
import org.jboss.portal.portlet.federation.FederatingPortletInvoker;
import org.jboss.portal.portlet.federation.impl.FederatedPortlet;
+import org.jboss.portal.portlet.info.ModeInfo;
+import org.jboss.portal.portlet.info.PortletInfo;
import org.jboss.portal.portlet.info.PreferenceInfo;
import org.jboss.portal.portlet.info.PreferencesInfo;
import org.jboss.portal.security.AuthorizationDomainRegistry;
@@ -57,6 +61,9 @@
/** . */
private static final Logger log = Logger.getLogger(PortletManagerBean.class);
+
+ /** . */
+ private final Mode INTERNAL_EDIT_CONTENT = Mode.create("edit_content");
static
{
@@ -269,7 +276,27 @@
{
if (portlets == null)
{
- portlets = new ArrayList(getSelectedPortletInvoker().getPortlets());
+ portlets = new ArrayList();
+ List tmpPortlets = new ArrayList(getSelectedPortletInvoker().getPortlets());
+
+ // Remove content editors
+ nextPortlet:
+ for (Iterator i = tmpPortlets.iterator();i.hasNext();)
+ {
+ Portlet portlet = (Portlet)i.next();
+
+ PortletInfo info = portlet.getInfo();
+ for (Iterator j = info.getCapabilities().getAllModes().iterator();j.hasNext();)
+ {
+ ModeInfo modeInfo = (ModeInfo)j.next();
+ if (modeInfo.getMode().equals(INTERNAL_EDIT_CONTENT))
+ {
+ continue nextPortlet;
+ }
+ }
+ //
+ portlets.add(portlet);
+ }
Collections.sort(portlets, comparator);
}
return portlets;
Modified: trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/common/PageManagerBean.java
===================================================================
--- trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/common/PageManagerBean.java 2007-07-16 16:27:26 UTC (rev 7787)
+++ trunk/core-admin/src/main/org/jboss/portal/core/admin/ui/common/PageManagerBean.java 2007-07-16 21:20:54 UTC (rev 7788)
@@ -273,6 +273,8 @@
Window tmp = (Window)windows.get(i);
tmp.setDeclaredProperty(ThemeConstants.PORTAL_PROP_ORDER, "" + i);
}
+
+ this.windowName = "";
}
catch (DuplicatePortalObjectException unexpected)
{
Modified: trunk/core-admin/src/resources/portal-admin-sar/META-INF/jboss-service.xml
===================================================================
--- trunk/core-admin/src/resources/portal-admin-sar/META-INF/jboss-service.xml 2007-07-16 16:27:26 UTC (rev 7787)
+++ trunk/core-admin/src/resources/portal-admin-sar/META-INF/jboss-service.xml 2007-07-16 21:20:54 UTC (rev 7788)
@@ -23,10 +23,6 @@
<server>
- <loader-repository>
- org.jboss.portal:loader=core-admin
- </loader-repository>
-
<mbean
code="org.jboss.portal.core.model.instance.InstanceCommandFactory"
name="portal:commandFactory=Configurator"
Modified: trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/common/editPageLayout.xhtml
===================================================================
--- trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/common/editPageLayout.xhtml 2007-07-16 16:27:26 UTC (rev 7787)
+++ trunk/core-admin/src/resources/portal-admin-war/WEB-INF/jsf/common/editPageLayout.xhtml 2007-07-16 21:20:54 UTC (rev 7788)
@@ -42,11 +42,13 @@
</td>
<td>
<h:form id="abc">
+ <h:inputHidden id="windowNameCopy" value="#{pageManager.windowName}"/>
<h:selectOneMenu
id="instanceId"
value="#{pageManager.selectedContentType}"
styleClass="portlet-form-field contentType"
- onchange="document.getElementById('abc').submit()">
+ onchange="document.getElementById('abc:windowNameCopy').value = document.getElementById('windowForm:windowName').value;
+ document.getElementById('abc').submit(); ">
<f:selectItems value="#{pageManager.contentTypeItems}"/>
</h:selectOneMenu>
<h:message for="instanceId" errorClass="portlet-msg-error"/>
Modified: trunk/core-cms/src/resources/portal-cms-war/WEB-INF/portlet.xml
===================================================================
--- trunk/core-cms/src/resources/portal-cms-war/WEB-INF/portlet.xml 2007-07-16 16:27:26 UTC (rev 7787)
+++ trunk/core-cms/src/resources/portal-cms-war/WEB-INF/portlet.xml 2007-07-16 21:20:54 UTC (rev 7788)
@@ -70,7 +70,7 @@
</portlet-info>
</portlet>
- <portlet>
+ <!-- portlet>
<description>CMS Content Editor</description>
<portlet-name>CMSContentEditorPortlet</portlet-name>
<display-name>CMS Content Editor</display-name>
@@ -87,6 +87,6 @@
<portlet-info>
<title>CMS Content Type</title>
</portlet-info>
- </portlet>
+ </portlet-->
</portlet-app>
Modified: trunk/wsrp/build.xml
===================================================================
--- trunk/wsrp/build.xml 2007-07-16 16:27:26 UTC (rev 7787)
+++ trunk/wsrp/build.xml 2007-07-16 21:20:54 UTC (rev 7788)
@@ -295,7 +295,10 @@
</jar>
<!-- Build Admin GUI... -->
- <ant inheritAll="false" antfile="../core-wsrp/build.xml" output="output.log" dir="../core-wsrp" target="output"/>
+ <ant inheritAll="false" antfile="../core-wsrp/build.xml" output="output.log" dir="../core-wsrp" target="output">
+ <property name="build.lib" value="${build.lib}"/>
+ <property name="build.resources" value="${build.resources}"/>
+ </ant>
<copy todir="${build.resources}/portal-wsrp-sar" overwrite="true">
<fileset dir="${build.lib}" includes="portal-wsrp-client.jar"/>
<fileset dir="${build.lib}" includes="portal-wsrp.jse"/>
@@ -321,6 +324,7 @@
<!-- Clean up all build output -->
<target name="clean" depends="_default:clean">
+ <ant inheritAll="false" antfile="../core-wsrp/build.xml" output="output.log" dir="../core-wsrp" target="clean"/>
<!-- Add module specific elements here. -->
</target>
16 years, 11 months
JBoss Portal SVN: r7787 - in trunk/core/src/main/org/jboss/portal: test/core/model/portal and 1 other directory.
by portal-commits@lists.jboss.org
Author: julien(a)jboss.com
Date: 2007-07-16 12:27:26 -0400 (Mon, 16 Jul 2007)
New Revision: 7787
Modified:
trunk/core/src/main/org/jboss/portal/core/impl/model/portal/ObjectNode.java
trunk/core/src/main/org/jboss/portal/core/impl/model/portal/PersistentPortalObjectContainer.java
trunk/core/src/main/org/jboss/portal/test/core/model/portal/PortalObjectContainerTestCase.java
Log:
port to trunk the removal of hibernate natural id cache + the minor improvement of the oracle fix
Modified: trunk/core/src/main/org/jboss/portal/core/impl/model/portal/ObjectNode.java
===================================================================
--- trunk/core/src/main/org/jboss/portal/core/impl/model/portal/ObjectNode.java 2007-07-16 16:09:37 UTC (rev 7786)
+++ trunk/core/src/main/org/jboss/portal/core/impl/model/portal/ObjectNode.java 2007-07-16 16:27:26 UTC (rev 7787)
@@ -243,7 +243,7 @@
public String toString()
{
- return path.toString() + PortalObjectId.NAMESPACE_SEPARATOR + name;
+ return "PortalObject[id=" + path + "]";
}
protected PortalObjectId toChildPath(String name)
Modified: trunk/core/src/main/org/jboss/portal/core/impl/model/portal/PersistentPortalObjectContainer.java
===================================================================
--- trunk/core/src/main/org/jboss/portal/core/impl/model/portal/PersistentPortalObjectContainer.java 2007-07-16 16:09:37 UTC (rev 7786)
+++ trunk/core/src/main/org/jboss/portal/core/impl/model/portal/PersistentPortalObjectContainer.java 2007-07-16 16:27:26 UTC (rev 7787)
@@ -23,13 +23,9 @@
package org.jboss.portal.core.impl.model.portal;
import EDU.oswego.cs.dl.util.concurrent.ConcurrentReaderHashMap;
-import org.hibernate.Criteria;
-import org.hibernate.HibernateException;
-import org.hibernate.ObjectNotFoundException;
import org.hibernate.Query;
import org.hibernate.Session;
import org.hibernate.SessionFactory;
-import org.hibernate.criterion.Restrictions;
import org.jboss.logging.Logger;
import org.jboss.portal.core.model.portal.DuplicatePortalObjectException;
import org.jboss.portal.core.model.portal.PortalObjectId;
@@ -48,9 +44,11 @@
{
/** The query for lookup when the path is null. */
- private static final String LOOKUP_QUERY_FOR_EMPTY_PATH = "from ObjectNode where path=:path";
private static final String LOOKUP_QUERY_FOR_ROOT = "from ObjectNode where path=:path or path is null";
+ /** The query for lookup when the path is null. */
+ private static final String LOOKUP_QUERY = "from ObjectNode where path=:path";
+
/** . */
private static Logger log = Logger.getLogger(PersistentPortalObjectContainer.class);
@@ -247,35 +245,24 @@
private ObjectNode getObjectNodeNoCache(Session session, PortalObjectId id)
{
Object result;
- if (id.getPath().getLength() == 0)
- {
- // Oracle returns the root object when using LOOKUP_QUERY_FOR_NULL_PATH thus preventing the creation of the
- // dashboard node as null is never returned for it and is therefore cached...
- String queryString = LOOKUP_QUERY_FOR_EMPTY_PATH;
- if (id.toString().lastIndexOf(PortalObjectPath.CanonicalFormat.PATH_SEPARATOR) == 0)
- {
- queryString = LOOKUP_QUERY_FOR_ROOT;
- }
- Query query = session.createQuery(queryString);
- query.setParameter("path", id);
- query.setCacheable(true);
- try
- {
- result = query.uniqueResult();
- }
- catch (ObjectNotFoundException e)
- {
- throw new HibernateException("Could not find ObjectNode with path '" + id + "'", e);
- }
- }
- else
+ //
+ String queryString = LOOKUP_QUERY;
+
+ // We need to lookup the root of the empty namespace with a special query in order to fix
+ // oracle weird behavior with zero length strings considered as null value
+ if (id.getPath().getLength() == 0 && id.getNamespace().length() == 0)
{
- Criteria criteria = session.createCriteria(ObjectNode.class);
- criteria.add(Restrictions.naturalId().set("path", id));
- criteria.setCacheable(true);
- result = criteria.uniqueResult();
+ queryString = LOOKUP_QUERY_FOR_ROOT;
}
+
+ //
+ Query query = session.createQuery(queryString);
+ query.setParameter("path", id);
+
+ // Unique result will return null if no object is found
+ result = query.uniqueResult();
+
return (ObjectNode)result;
}
Modified: trunk/core/src/main/org/jboss/portal/test/core/model/portal/PortalObjectContainerTestCase.java
===================================================================
--- trunk/core/src/main/org/jboss/portal/test/core/model/portal/PortalObjectContainerTestCase.java 2007-07-16 16:09:37 UTC (rev 7786)
+++ trunk/core/src/main/org/jboss/portal/test/core/model/portal/PortalObjectContainerTestCase.java 2007-07-16 16:27:26 UTC (rev 7787)
@@ -80,6 +80,14 @@
TransactionAssert.commitTransaction();
}
+ public void testRetrieveNonExistingObject()
+ {
+ TransactionAssert.beginTransaction();
+ PortalObject foo = container.getObject(PortalObjectId.parse("/foo", PortalObjectPath.CANONICAL_FORMAT));
+ assertNull(foo);
+ TransactionAssert.commitTransaction();
+ }
+
public void testPropertyUpdateCascadeToDescendantsWhenTheyDoNotDeclareIt() throws Exception
{
TransactionAssert.beginTransaction();
16 years, 11 months
JBoss Portal SVN: r7786 - branches/JBoss_Portal_Branch_2_6/build.
by portal-commits@lists.jboss.org
Author: thomas.heute(a)jboss.com
Date: 2007-07-16 12:09:37 -0400 (Mon, 16 Jul 2007)
New Revision: 7786
Modified:
branches/JBoss_Portal_Branch_2_6/build/
Log:
Ignore output for SVN
Property changes on: branches/JBoss_Portal_Branch_2_6/build
___________________________________________________________________
Name: svn:ignore
- build.log
local.properties
build.iml
+ build.log
local.properties
build.iml
output
16 years, 11 months