JBoss Portal SVN: r7096 - trunk/wsrp/src/main/org/jboss/portal/wsrp/registration.
by portal-commits@lists.jboss.org
Author: chris.laprun(a)jboss.com
Date: 2007-04-27 00:19:34 -0400 (Fri, 27 Apr 2007)
New Revision: 7096
Modified:
trunk/wsrp/src/main/org/jboss/portal/wsrp/registration/LocalizedString.java
Log:
- resourceName is optional: do not fail on passing null to setter.
Modified: trunk/wsrp/src/main/org/jboss/portal/wsrp/registration/LocalizedString.java
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/wsrp/registration/LocalizedString.java 2007-04-27 04:18:41 UTC (rev 7095)
+++ trunk/wsrp/src/main/org/jboss/portal/wsrp/registration/LocalizedString.java 2007-04-27 04:19:34 UTC (rev 7096)
@@ -140,7 +140,6 @@
public void setResourceName(String resourceName)
{
- ParameterValidation.throwIllegalArgExceptionIfNullOrEmpty(resourceName, "resource name", "LocalizedString");
this.resourceName = resourceName;
}
}
17 years, 2 months
JBoss Portal SVN: r7095 - in trunk/wsrp/src: main/org/jboss/portal/test/wsrp/other and 4 other directories.
by portal-commits@lists.jboss.org
Author: chris.laprun(a)jboss.com
Date: 2007-04-27 00:18:41 -0400 (Fri, 27 Apr 2007)
New Revision: 7095
Modified:
trunk/wsrp/src/main/org/jboss/portal/test/wsrp/framework/support/MockWSRPConsumer.java
trunk/wsrp/src/main/org/jboss/portal/test/wsrp/other/ProducerInfoTestCase.java
trunk/wsrp/src/main/org/jboss/portal/wsrp/WSRPConsumer.java
trunk/wsrp/src/main/org/jboss/portal/wsrp/admin/ui/ConsumerBean.java
trunk/wsrp/src/main/org/jboss/portal/wsrp/admin/ui/ManagedBean.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/WSRPConsumerImpl.java
trunk/wsrp/src/resources/portal-wsrp-war/WEB-INF/jsf/consumers/consumers.xhtml
trunk/wsrp/src/resources/portal-wsrp-war/WEB-INF/jsf/consumers/editConsumer.xhtml
Log:
- JBPORTAL-715: Initial support for validating/replacing local registration properties by producer values and improved status reporting.
- Added WSRPConsumer.refreshRegistrationInfo method and implementation.
- Renamed ProducerInfo.requiresRegistration to isRegistrationRequired.
- Fixed isRegistered implementation.
Modified: trunk/wsrp/src/main/org/jboss/portal/test/wsrp/framework/support/MockWSRPConsumer.java
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/test/wsrp/framework/support/MockWSRPConsumer.java 2007-04-27 04:11:52 UTC (rev 7094)
+++ trunk/wsrp/src/main/org/jboss/portal/test/wsrp/framework/support/MockWSRPConsumer.java 2007-04-27 04:18:41 UTC (rev 7095)
@@ -35,6 +35,7 @@
import org.jboss.portal.wsrp.WSRPConsumer;
import org.jboss.portal.wsrp.consumer.ProducerInfo;
import org.jboss.portal.wsrp.consumer.ProducerSessionInformation;
+import org.jboss.portal.wsrp.consumer.RegistrationInfo;
import org.jboss.portal.wsrp.services.ServiceFactory;
import javax.servlet.http.HttpSession;
@@ -105,6 +106,11 @@
{
}
+ public RegistrationInfo.RegistrationRefreshResult refreshRegistrationInfo(boolean eraseLocalData) throws PortletInvokerException
+ {
+ return null;
+ }
+
public Set getPortlets() throws PortletInvokerException
{
return null;
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-04-27 04:11:52 UTC (rev 7094)
+++ trunk/wsrp/src/main/org/jboss/portal/test/wsrp/other/ProducerInfoTestCase.java 2007-04-27 04:18:41 UTC (rev 7095)
@@ -56,7 +56,6 @@
private ProducerInfo info;
private BehaviorBackedServiceFactory serviceFactory;
-
protected void setUp() throws Exception
{
info = new ProducerInfo();
Modified: trunk/wsrp/src/main/org/jboss/portal/wsrp/WSRPConsumer.java
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/wsrp/WSRPConsumer.java 2007-04-27 04:11:52 UTC (rev 7094)
+++ trunk/wsrp/src/main/org/jboss/portal/wsrp/WSRPConsumer.java 2007-04-27 04:18:41 UTC (rev 7095)
@@ -28,6 +28,7 @@
import org.jboss.portal.portlet.invocation.PortletInvocation;
import org.jboss.portal.wsrp.consumer.ProducerInfo;
import org.jboss.portal.wsrp.consumer.ProducerSessionInformation;
+import org.jboss.portal.wsrp.consumer.RegistrationInfo;
import org.jboss.system.Service;
import javax.servlet.http.HttpSession;
@@ -105,4 +106,15 @@
* @since 2.6
*/
void deactivate() throws Exception;
+
+ /**
+ * Refreshes the Registration information required by the remote producer.
+ *
+ * @param eraseLocalData <code>true</code> if the local data should be used and validated, <code>false</code> if the
+ * local data should be ignored and replaced by empty values for each of the required
+ * properties.
+ * @return
+ * @since 2.6
+ */
+ RegistrationInfo.RegistrationRefreshResult refreshRegistrationInfo(boolean eraseLocalData) throws PortletInvokerException;
}
Modified: trunk/wsrp/src/main/org/jboss/portal/wsrp/admin/ui/ConsumerBean.java
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/wsrp/admin/ui/ConsumerBean.java 2007-04-27 04:11:52 UTC (rev 7094)
+++ trunk/wsrp/src/main/org/jboss/portal/wsrp/admin/ui/ConsumerBean.java 2007-04-27 04:18:41 UTC (rev 7095)
@@ -27,6 +27,7 @@
import org.jboss.portal.wsrp.consumer.ConsumerException;
import org.jboss.portal.wsrp.consumer.ConsumerRegistry;
import org.jboss.portal.wsrp.consumer.ProducerInfo;
+import org.jboss.portal.wsrp.consumer.RegistrationInfo;
import javax.faces.context.FacesContext;
import javax.faces.event.ValueChangeEvent;
@@ -163,9 +164,9 @@
return getProducerInfo().isRegistered();
}
- public boolean isRequiresRegistration()
+ public boolean isRegistrationRequired()
{
- return getProducerInfo().requiresRegistration();
+ return getProducerInfo().isRegistrationRequired();
}
public ProducerInfo getProducerInfo()
@@ -196,6 +197,36 @@
return null;
}
+ public String refreshRegistrationInfo()
+ {
+ if (consumer != null)
+ {
+ String param = getParameter("eraseLocalData");
+ boolean eraseLocalData = Boolean.valueOf(param).booleanValue();
+ try
+ {
+ RegistrationInfo.RegistrationRefreshResult result = consumer.refreshRegistrationInfo(eraseLocalData);
+ if (!result.isValid())
+ {
+ createErrorMessage(result.getStatus());
+ }
+ else
+ {
+ createInfoMessage(null, result.getStatus());
+ }
+ }
+ catch (Exception e)
+ {
+ createErrorMessageFrom(e);
+ return null;
+ }
+ return null;
+ }
+
+ createErrorMessage("Couldn't refresh Registration info!");
+ return null;
+ }
+
// Listeners
public void useWSDLListener(ValueChangeEvent event)
Modified: trunk/wsrp/src/main/org/jboss/portal/wsrp/admin/ui/ManagedBean.java
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/wsrp/admin/ui/ManagedBean.java 2007-04-27 04:11:52 UTC (rev 7094)
+++ trunk/wsrp/src/main/org/jboss/portal/wsrp/admin/ui/ManagedBean.java 2007-04-27 04:18:41 UTC (rev 7095)
@@ -42,15 +42,15 @@
protected void createErrorMessage(String message)
{
- createErrorMessage(null, message, FacesMessage.SEVERITY_ERROR);
+ createMessage(null, message, FacesMessage.SEVERITY_ERROR);
}
protected void createErrorMessage(String target, String message)
{
- createErrorMessage(target, message, FacesMessage.SEVERITY_ERROR);
+ createMessage(target, message, FacesMessage.SEVERITY_ERROR);
}
- protected void createErrorMessage(String target, String message, FacesMessage.Severity severity)
+ protected void createMessage(String target, String message, FacesMessage.Severity severity)
{
FacesMessage msg = new FacesMessage(severity, message, message);
FacesContext.getCurrentInstance().addMessage(target, msg);
@@ -67,4 +67,9 @@
String message = e.getLocalizedMessage() + (cause != null ? "\nCause: " + cause.getLocalizedMessage() : "");
createErrorMessage(target, message);
}
+
+ protected void createInfoMessage(String target, String message)
+ {
+ createMessage(target, message, FacesMessage.SEVERITY_INFO);
+ }
}
Modified: trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/ProducerInfo.java
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/ProducerInfo.java 2007-04-27 04:11:52 UTC (rev 7094)
+++ trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/ProducerInfo.java 2007-04-27 04:18:41 UTC (rev 7095)
@@ -163,10 +163,10 @@
public boolean isRegistered()
{
- return persistentRegistrationInfo != null && persistentRegistrationInfo.isRegistrationValid();
+ return isRegistrationRequired() && persistentRegistrationInfo.isRegistrationValid();
}
- public boolean requiresRegistration()
+ public boolean isRegistrationRequired()
{
return persistentRegistrationInfo != null && persistentRegistrationInfo.isRequiresRegistration();
@@ -234,7 +234,7 @@
if (forceRefresh || isCacheExpired())
{
log.debug("ProducerInfo refresh needed for producer '" + persistentId + "'");
- serviceDescription = getServiceDescription();
+ serviceDescription = getServiceDescription(false);
// do we need to call initCookie or not?
requiresInitCookie = serviceDescription.getRequiresInitCookie();
@@ -246,7 +246,7 @@
if (register(serviceDescription))
{
// registration occurred, so we should ask for a new service description
- serviceDescription = getServiceDescription();
+ serviceDescription = getServiceDescription(false);
}
// extract the POPs
@@ -457,10 +457,18 @@
this.persistentExpirationCacheSeconds = expirationCacheSeconds;
}
- private ServiceDescription getServiceDescription() throws PortletInvokerException
+ private ServiceDescription getServiceDescription(boolean asUnregistered) throws PortletInvokerException
{
- GetServiceDescription request = getServiceDescriptionRequest();
- request.setRegistrationContext(getRegistrationContext());
+ GetServiceDescription request;
+ if (asUnregistered)
+ {
+ request = getUnregisteredServiceDescriptionRequest();
+ }
+ else
+ {
+ request = getServiceDescriptionRequest();
+ request.setRegistrationContext(getRegistrationContext());
+ }
ServiceDescription serviceDescription;
@@ -608,7 +616,7 @@
if (serviceDescription == null)
{
- serviceDescription = getServiceDescription();
+ serviceDescription = getServiceDescription(false);
}
if (serviceDescription.isRequiresRegistration())
@@ -670,4 +678,25 @@
}
}
+
+ public RegistrationInfo.RegistrationRefreshResult refreshRegistrationInfo(boolean eraseLocalData) 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);
+ registry.updateProducerInfo(this);
+ log.info("Refreshed registration information for consumer with id '" + persistentId + "'");
+
+ return result;
+ }
}
Modified: trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/RegistrationInfo.java
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/RegistrationInfo.java 2007-04-27 04:11:52 UTC (rev 7094)
+++ trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/RegistrationInfo.java 2007-04-27 04:18:41 UTC (rev 7095)
@@ -258,7 +258,8 @@
{
requiresRegistration = true;
StringBuffer message = new StringBuffer("Producer '").append(producerId).append("' requires registration.");
- log.info(message);
+ result.appendToStatus(message.toString());
+ log.debug(message);
// check if the configured registration properties match the producer expectations
ModelDescription regPropDescs = serviceDescription.getRegistrationPropertyDescription();
@@ -299,7 +300,7 @@
if (missingProps.length() > 0)
{
- log.info(missingProps);
+ log.debug(missingProps);
result.appendToStatus(missingProps.toString());
resetRegistration();
result.setValid(false);
@@ -318,13 +319,17 @@
}
else
{
- log.info("Producer '" + producerId + "' doesn't require registration.");
+ String msg = "Producer '" + producerId + "' doesn't require registration.";
+ log.debug(msg);
+ result.appendToStatus(msg);
requiresRegistration = false;
result.setValid(true);
}
result.setRegistrationProperties(registrationProperties);
- log.debug("Registration configuration is " + (result.isValid() ? "" : "NOT") + " valid");
+ String msg = "Registration configuration is " + (result.isValid() ? "" : "NOT") + " valid";
+ result.appendToStatus(msg);
+ log.debug(msg);
return result;
}
@@ -483,7 +488,7 @@
}
else
{
- status.append(message);
+ status.append(message).append(" ");
}
}
}
Modified: trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/WSRPConsumerImpl.java
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/WSRPConsumerImpl.java 2007-04-27 04:11:52 UTC (rev 7094)
+++ trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/WSRPConsumerImpl.java 2007-04-27 04:18:41 UTC (rev 7095)
@@ -488,6 +488,11 @@
}
}
+ public RegistrationInfo.RegistrationRefreshResult refreshRegistrationInfo(boolean eraseLocalData) throws PortletInvokerException
+ {
+ return producerInfo.refreshRegistrationInfo(eraseLocalData);
+ }
+
// Service implementation *******************************************************************************************
protected void startService() throws Exception
Modified: trunk/wsrp/src/resources/portal-wsrp-war/WEB-INF/jsf/consumers/consumers.xhtml
===================================================================
--- trunk/wsrp/src/resources/portal-wsrp-war/WEB-INF/jsf/consumers/consumers.xhtml 2007-04-27 04:11:52 UTC (rev 7094)
+++ trunk/wsrp/src/resources/portal-wsrp-war/WEB-INF/jsf/consumers/consumers.xhtml 2007-04-27 04:18:41 UTC (rev 7095)
@@ -52,7 +52,7 @@
<f:param name="activate" value="#{!consumer.producerInfo.active}"/>
<h:outputText value="#{consumer.producerInfo.active ? 'Deactivate' : 'Activate'}"/>
</h:commandLink>
- <c:if test="#{consumer.producerInfo.active}"> |
+ <c:if test="#{consumer.producerInfo.active and consumer.producerInfo.registrationRequired}"> |
<h:commandLink
action="#{consumersMgr.registerConsumer}">
<f:param name="id" value="#{consumer.producerId}"/>
Modified: trunk/wsrp/src/resources/portal-wsrp-war/WEB-INF/jsf/consumers/editConsumer.xhtml
===================================================================
--- trunk/wsrp/src/resources/portal-wsrp-war/WEB-INF/jsf/consumers/editConsumer.xhtml 2007-04-27 04:11:52 UTC (rev 7094)
+++ trunk/wsrp/src/resources/portal-wsrp-war/WEB-INF/jsf/consumers/editConsumer.xhtml 2007-04-27 04:18:41 UTC (rev 7095)
@@ -14,7 +14,7 @@
</h:commandLink>
<h:commandLink action="#{consumersMgr.registerConsumer}" styleClass="portlet-form-button"
- rendered="#{consumer.active}"
+ rendered="#{consumer.active and consumer.registrationRequired}"
value="#{consumer.registered ? 'Deregister' : 'Register'}">
<f:param name="id" value="#{consumer.id}"/>
<f:param name="register" value="#{!consumer.registered}"/>
@@ -91,10 +91,17 @@
</td>
</tr>
<tr>
- <th>Registration information</th>
+ <th>Registration information<br/><br/>
+ <h:commandLink action="#{consumer.refreshRegistrationInfo}" value="Validate" styleClass="portlet-form-button">
+ <f:param name="eraseLocalData" value="false"/>
+ </h:commandLink>
+ <h:commandLink action="#{consumer.refreshRegistrationInfo}" value="Replace" styleClass="portlet-form-button">
+ <f:param name="eraseLocalData" value="true"/>
+ </h:commandLink>
+ </th>
<td>
<c:choose>
- <c:when test="#{consumer.requiresRegistration}">
+ <c:when test="#{consumer.registrationRequired}">
<c:choose>
<c:when test="#{!empty consumer.producerInfo.registrationInfo.registrationPropertyNames}">
<table border='1' cellspacing='0' class='registration-prop-table'>
@@ -102,8 +109,7 @@
<th>Name</th>
<th>Value</th>
</tr>
- <c:forEach items="#{consumer.producerInfo.registrationInfo.registrationProperties}"
- var="prop">
+ <c:forEach items="#{consumer.producerInfo.registrationInfo.registrationProperties}" var="prop">
<tr title="#{prop.description.label.value}">
<td>
<h:inputText value="#{prop.name}" size="40"/>
17 years, 2 months
JBoss Portal SVN: r7094 - trunk/wsrp/src/resources/portal-wsrp-sar/conf/consumer/hibernate.
by portal-commits@lists.jboss.org
Author: chris.laprun(a)jboss.com
Date: 2007-04-27 00:11:52 -0400 (Fri, 27 Apr 2007)
New Revision: 7094
Modified:
trunk/wsrp/src/resources/portal-wsrp-sar/conf/consumer/hibernate/domain.hbm.xml
Log:
- Allow null value for RegistrationProperty (needed when pulling properties from producer, hence without associated value).
Modified: trunk/wsrp/src/resources/portal-wsrp-sar/conf/consumer/hibernate/domain.hbm.xml
===================================================================
--- trunk/wsrp/src/resources/portal-wsrp-sar/conf/consumer/hibernate/domain.hbm.xml 2007-04-26 23:57:28 UTC (rev 7093)
+++ trunk/wsrp/src/resources/portal-wsrp-sar/conf/consumer/hibernate/domain.hbm.xml 2007-04-27 04:11:52 UTC (rev 7094)
@@ -92,7 +92,7 @@
</generator>
</id>
<property name="name" type="java.lang.String" not-null="true" insert="false" update="false"/>
- <property name="value" type="java.lang.String" not-null="true"/>
+ <property name="value" type="java.lang.String"/>
<property name="invalid" type="boolean"/>
<property name="lang" type="java.lang.String"/>
<many-to-one
17 years, 2 months
JBoss Portal SVN: r7093 - trunk/theme/src/main/org/jboss/portal/theme/impl/render/dynamic.
by portal-commits@lists.jboss.org
Author: julien(a)jboss.com
Date: 2007-04-26 19:57:28 -0400 (Thu, 26 Apr 2007)
New Revision: 7093
Modified:
trunk/theme/src/main/org/jboss/portal/theme/impl/render/dynamic/DynaPortletRenderer.java
Log:
- fix DnD handle for frameless windows like CMS
Modified: trunk/theme/src/main/org/jboss/portal/theme/impl/render/dynamic/DynaPortletRenderer.java
===================================================================
--- trunk/theme/src/main/org/jboss/portal/theme/impl/render/dynamic/DynaPortletRenderer.java 2007-04-26 23:38:34 UTC (rev 7092)
+++ trunk/theme/src/main/org/jboss/portal/theme/impl/render/dynamic/DynaPortletRenderer.java 2007-04-26 23:57:28 UTC (rev 7093)
@@ -64,7 +64,7 @@
//
if (!DynaRenderOptions.NO_AJAX.equals(options))
{
- if (options.isDnDEnabled() && Boolean.FALSE.equals(DynaWindowRenderer.handleProvided.get()))
+ if (options.isDnDEnabled() && !Boolean.TRUE.equals(DynaWindowRenderer.handleProvided.get()))
{
//
DynaWindowRenderer.handleProvided.set(Boolean.TRUE);
@@ -73,9 +73,9 @@
PrintWriter out = rendererContext.getWriter();
//
- out.print("<span class=\"dnd-handle\">");
+ out.print("<div class=\"dnd-handle\">");
doCatchClicks(rendererContext, prc);
- out.print("</span>");
+ out.print("</div>");
}
else
{
17 years, 2 months
JBoss Portal SVN: r7092 - in trunk: core/src/main/org/jboss/portal/core/impl/api and 10 other directories.
by portal-commits@lists.jboss.org
Author: julien(a)jboss.com
Date: 2007-04-26 19:38:34 -0400 (Thu, 26 Apr 2007)
New Revision: 7092
Modified:
trunk/core-cms/src/main/org/jboss/portal/core/cms/CMSObjectCommandFactoryService.java
trunk/core-cms/src/main/org/jboss/portal/core/cms/ui/CMSPortlet.java
trunk/core/src/main/org/jboss/portal/core/controller/ajax/AjaxInterceptor.java
trunk/core/src/main/org/jboss/portal/core/controller/ajax/AjaxResponseHandler.java
trunk/core/src/main/org/jboss/portal/core/impl/api/CoreNavigationalStateContext.java
trunk/core/src/main/org/jboss/portal/core/impl/model/content/InternalContentProvider.java
trunk/core/src/main/org/jboss/portal/core/impl/model/content/generic/InternalGenericContentProvider.java
trunk/core/src/main/org/jboss/portal/core/model/portal/PortalObjectCommandFactory.java
trunk/core/src/main/org/jboss/portal/core/model/portal/command/action/InvokePortletWindowRenderCommand.java
trunk/core/src/main/org/jboss/portal/core/model/portal/navstate/PortalObjectNavigationalStateContext.java
trunk/core/src/main/org/jboss/portal/core/model/portal/navstate/WindowNavigationalState.java
trunk/core/src/resources/portal-core-sar/conf/data/default-object.xml
trunk/theme/src/bin/portal-ajax-war/dyna/dyna.js
trunk/theme/src/main/org/jboss/portal/theme/impl/render/dynamic/DynaRenderOptions.java
Log:
- fix cms / core navigational state integration bug
- remove hard coded ajax properties for dashboard, instead configure it in the default-object.xml, so administrator can create a dashboard that would not have any ajax feature
Modified: trunk/core/src/main/org/jboss/portal/core/controller/ajax/AjaxInterceptor.java
===================================================================
--- trunk/core/src/main/org/jboss/portal/core/controller/ajax/AjaxInterceptor.java 2007-04-26 22:34:39 UTC (rev 7091)
+++ trunk/core/src/main/org/jboss/portal/core/controller/ajax/AjaxInterceptor.java 2007-04-26 23:38:34 UTC (rev 7092)
@@ -46,9 +46,6 @@
public class AjaxInterceptor extends ControllerInterceptor
{
- /** . */
- private static final DynaRenderOptions AJAX_OPTIONS = DynaRenderOptions.getOptions(Boolean.TRUE, Boolean.TRUE);
-
public ControllerResponse invoke(ControllerCommand cmd) throws Exception, InvocationException
{
ControllerResponse response = (ControllerResponse)cmd.invokeNext();
@@ -80,14 +77,14 @@
pageProps.put(DynaConstants.VIEW_STATE, viewId);
// If user is logged in and is on dashboard we enable ajax
- if (cmd instanceof RenderPageCommand)
- {
- RenderPageCommand rpc = (RenderPageCommand)cmd;
- if (serverContext.getClientRequest().getRemoteUser() != null && rpc.isDashboard())
- {
- AJAX_OPTIONS.setOptions(pageProps);
- }
- }
+// if (cmd instanceof RenderPageCommand)
+// {
+// RenderPageCommand rpc = (RenderPageCommand)cmd;
+// if (serverContext.getClientRequest().getRemoteUser() != null && rpc.isDashboard())
+// {
+// DynaRenderOptions.AJAX.setOptions(pageProps);
+// }
+// }
}
//
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-04-26 22:34:39 UTC (rev 7091)
+++ trunk/core/src/main/org/jboss/portal/core/controller/ajax/AjaxResponseHandler.java 2007-04-26 23:38:34 UTC (rev 7092)
@@ -59,6 +59,7 @@
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;
@@ -284,7 +285,7 @@
// Call to the theme framework
PageResult res = new PageResult(page.getName(), page.getProperties());
-
+
//
ServerInvocation invocation = controllerContext.getServerInvocation();
Modified: trunk/core/src/main/org/jboss/portal/core/impl/api/CoreNavigationalStateContext.java
===================================================================
--- trunk/core/src/main/org/jboss/portal/core/impl/api/CoreNavigationalStateContext.java 2007-04-26 22:34:39 UTC (rev 7091)
+++ trunk/core/src/main/org/jboss/portal/core/impl/api/CoreNavigationalStateContext.java 2007-04-26 23:38:34 UTC (rev 7092)
@@ -52,7 +52,7 @@
WindowNavigationalState wns = (WindowNavigationalState)navigationalStateResolver.getAttribute(key);
if (wns == null && create)
{
- wns = new WindowNavigationalState();
+ wns = WindowNavigationalState.create();
navigationalStateResolver.setAttribute(key, wns);
}
return wns;
@@ -126,7 +126,8 @@
//
CorePortalNode pon = (CorePortalNode)window;
- NavigationalStateKey key = new NavigationalStateKey(Mode.class, pon.getObjectId());
- navigationalStateResolver.setAttribute(key, mode);
+
+ //
+ WindowNavigationalState.setMode(navigationalStateResolver, pon.getObjectId(), mode);
}
}
Modified: trunk/core/src/main/org/jboss/portal/core/impl/model/content/InternalContentProvider.java
===================================================================
--- trunk/core/src/main/org/jboss/portal/core/impl/model/content/InternalContentProvider.java 2007-04-26 22:34:39 UTC (rev 7091)
+++ trunk/core/src/main/org/jboss/portal/core/impl/model/content/InternalContentProvider.java 2007-04-26 23:38:34 UTC (rev 7092)
@@ -201,7 +201,7 @@
context,
windowNS.getMode(),
windowNS.getWindowState(),
- windowNS.getNavigationalState(),
+ windowNS.getState(),
window,
portal);
Modified: trunk/core/src/main/org/jboss/portal/core/impl/model/content/generic/InternalGenericContentProvider.java
===================================================================
--- trunk/core/src/main/org/jboss/portal/core/impl/model/content/generic/InternalGenericContentProvider.java 2007-04-26 22:34:39 UTC (rev 7091)
+++ trunk/core/src/main/org/jboss/portal/core/impl/model/content/generic/InternalGenericContentProvider.java 2007-04-26 23:38:34 UTC (rev 7092)
@@ -33,6 +33,7 @@
import org.jboss.portal.core.model.portal.command.render.RenderWindowCommand;
import org.jboss.portal.core.model.portal.Window;
import org.jboss.portal.core.model.portal.PortalObjectId;
+import org.jboss.portal.core.model.portal.navstate.WindowNavigationalState;
import org.jboss.portal.core.controller.ControllerContext;
import org.jboss.portal.core.controller.ControllerResponse;
import org.jboss.portal.core.impl.model.content.InternalContentProvider;
@@ -43,6 +44,7 @@
import org.jboss.portal.theme.page.WindowResult;
import org.jboss.portal.Mode;
import org.jboss.portal.common.i18n.LocalizedString;
+import org.jboss.portal.common.invocation.AttributeResolver;
import java.util.Iterator;
import java.util.Map;
@@ -167,27 +169,43 @@
return null;
}
+ //
+ AttributeResolver nsResolver = context.getAttributeResolver(RenderWindowCommand.NAVIGATIONAL_STATE_SCOPE);
+
// Initialize the navigational state with the URI when needed
- NavigationalStateKey nsKey = new NavigationalStateKey(StateString.class, windowId);
- PortletParametersStateString navigationalState = (PortletParametersStateString)context.getAttribute(RenderWindowCommand.NAVIGATIONAL_STATE_SCOPE, nsKey);
- if (navigationalState == null || !content.getURI().equals(navigationalState.getValue("uri")))
+ NavigationalStateKey nsKey = new NavigationalStateKey(WindowNavigationalState.class, windowId);
+ WindowNavigationalState navigationalState = (WindowNavigationalState)nsResolver.getAttribute(nsKey);
+
+ //
+ boolean update = true;
+ if (navigationalState != null && navigationalState.getState() instanceof PortletParametersStateString)
{
- navigationalState = new PortletParametersStateString();
+ PortletParametersStateString state = (PortletParametersStateString)navigationalState.getState();
+ if (content.getURI().equals(state.getValue("uri")))
+ {
+ update = false;
+ }
+ }
+ //
+ if (update)
+ {
+ PortletParametersStateString state = new PortletParametersStateString();
+
//
for (Iterator i = content.getParameterNames();i.hasNext();)
{
String paramName = (String)i.next();
String paramValue = content.getParameter(paramName);
- navigationalState.setValue(paramName, paramValue);
+ state.setValue(paramName, paramValue);
}
//
String uri = content.getURI();
- navigationalState.setValue("uri", uri);
+ state.setValue("uri", uri);
//
- context.setAttribute(RenderWindowCommand.NAVIGATIONAL_STATE_SCOPE, nsKey, navigationalState);
+ WindowNavigationalState.setState(nsResolver, nsKey, state);
}
//
Modified: trunk/core/src/main/org/jboss/portal/core/model/portal/PortalObjectCommandFactory.java
===================================================================
--- trunk/core/src/main/org/jboss/portal/core/model/portal/PortalObjectCommandFactory.java 2007-04-26 22:34:39 UTC (rev 7091)
+++ trunk/core/src/main/org/jboss/portal/core/model/portal/PortalObjectCommandFactory.java 2007-04-26 23:38:34 UTC (rev 7092)
@@ -124,7 +124,7 @@
WindowNavigationalState windowNavState = (WindowNavigationalState)controllerContext.getAttribute(ControllerCommand.NAVIGATIONAL_STATE_SCOPE, nsKey);
if (windowNavState == null)
{
- windowNavState = new WindowNavigationalState();
+ windowNavState = WindowNavigationalState.create();
controllerContext.setAttribute(ControllerCommand.NAVIGATIONAL_STATE_SCOPE, nsKey, windowNavState);
}
Modified: trunk/core/src/main/org/jboss/portal/core/model/portal/command/action/InvokePortletWindowRenderCommand.java
===================================================================
--- trunk/core/src/main/org/jboss/portal/core/model/portal/command/action/InvokePortletWindowRenderCommand.java 2007-04-26 22:34:39 UTC (rev 7091)
+++ trunk/core/src/main/org/jboss/portal/core/model/portal/command/action/InvokePortletWindowRenderCommand.java 2007-04-26 23:38:34 UTC (rev 7092)
@@ -91,7 +91,7 @@
WindowNavigationalState oldNS = (WindowNavigationalState)ctx.getAttribute(NAVIGATIONAL_STATE_SCOPE, nsKey);
//
- StateString newState = oldNS != null ? oldNS.getNavigationalState() : null;
+ StateString newState = oldNS != null ? oldNS.getState() : null;
WindowState newWindowState = oldNS != null ? oldNS.getWindowState() : null;
Mode newMode = oldNS != null ? oldNS.getMode() : null;
Modified: trunk/core/src/main/org/jboss/portal/core/model/portal/navstate/PortalObjectNavigationalStateContext.java
===================================================================
--- trunk/core/src/main/org/jboss/portal/core/model/portal/navstate/PortalObjectNavigationalStateContext.java 2007-04-26 22:34:39 UTC (rev 7091)
+++ trunk/core/src/main/org/jboss/portal/core/model/portal/navstate/PortalObjectNavigationalStateContext.java 2007-04-26 23:38:34 UTC (rev 7092)
@@ -26,9 +26,6 @@
import org.jboss.portal.core.navstate.NavigationalStateKey;
import org.jboss.portal.core.navstate.NavigationalStateObjectChange;
import org.jboss.portal.common.invocation.AttributeResolver;
-import org.jboss.portal.WindowState;
-import org.jboss.portal.Mode;
-import org.jboss.portal.portlet.StateString;
import java.util.Set;
import java.util.LinkedHashMap;
@@ -44,21 +41,6 @@
/** . */
private static final String VIEW_ID_KEY = "view_id";
- /** . */
- private static final int MODE_TYPE = 0;
-
- /** . */
- private static final int WINDOW_STATE_TYPE = 1;
-
- /** . */
- private static final int STATE_STRING_TYPE = 2;
-
- /** . */
- private static final int WINDOW_TYPE = 3;
-
- /** . */
- private static final int UNKNOWN_TYPE = 4;
-
/** Where we delegate the storage. */
private AttributeResolver store;
@@ -103,46 +85,25 @@
public void setAttribute(Object attrKey, Object attrValue) throws IllegalArgumentException
{
NavigationalStateKey wantedKey = (NavigationalStateKey)attrKey;
- Class typeClass = wantedKey.getType();
- // Get the effective lookup key
- int typeValue = UNKNOWN_TYPE;
- if (typeClass == WindowState.class)
+ //
+ Class typeClass = wantedKey.getType();
+ if (typeClass != WindowNavigationalState.class)
{
- typeValue = WINDOW_STATE_TYPE;
- }
- else if (typeClass == Mode.class)
- {
- typeValue = MODE_TYPE;
- }
- else if (StateString.class.isAssignableFrom(typeClass))
- {
- typeValue = STATE_STRING_TYPE;
- }
- else if (typeClass == WindowNavigationalState.class)
- {
- typeValue = WINDOW_TYPE;
- }
-
- if (typeValue == UNKNOWN_TYPE)
- {
throw new IllegalArgumentException("Cannot handle the type " + typeClass.getName());
}
- // Compute the effective key
- NavigationalStateKey effectiveKey = typeValue == WINDOW_TYPE ? wantedKey : new NavigationalStateKey(WindowNavigationalState.class, wantedKey.getId());
-
//
WindowNavigationalState oldNS = null;
// Look first the old ns in the changes
if (changes != null)
{
- NavigationalStateObjectChange change = (NavigationalStateObjectChange)changes.get(effectiveKey);
+ NavigationalStateObjectChange change = (NavigationalStateObjectChange)changes.get(wantedKey);
if (change != null)
{
// Discard any change done so far
- changes.remove(effectiveKey);
+ changes.remove(wantedKey);
//
switch(change.getType())
@@ -157,7 +118,7 @@
// If we don't have the old ns then we try the store
if (oldNS == null)
{
- oldNS = (WindowNavigationalState)store.getAttribute(effectiveKey);
+ oldNS = (WindowNavigationalState)store.getAttribute(wantedKey);
}
//
@@ -166,7 +127,7 @@
{
if (oldNS != null)
{
- change = NavigationalStateObjectChange.newDestroy(effectiveKey, oldNS);
+ change = NavigationalStateObjectChange.newDestroy(wantedKey, oldNS);
}
else
{
@@ -176,51 +137,16 @@
}
else
{
- WindowNavigationalState newNS;
- if (typeValue == WINDOW_TYPE)
- {
- newNS = (WindowNavigationalState)attrValue;
- }
- else
- {
- WindowState windowState = WindowState.NORMAL;
- Mode mode = Mode.VIEW;
- StateString stateString = null;
+ WindowNavigationalState newNS = (WindowNavigationalState)attrValue;
- //
- if (oldNS != null)
- {
- windowState = oldNS.getWindowState();
- mode = oldNS.getMode();
- stateString = oldNS.getNavigationalState();
- }
-
- //
- switch (typeValue)
- {
- case WINDOW_STATE_TYPE:
- windowState = (WindowState)attrValue;
- break;
- case MODE_TYPE:
- mode = (Mode)attrValue;
- break;
- case STATE_STRING_TYPE:
- stateString = (StateString)attrValue;
- break;
- }
-
- //
- newNS = new WindowNavigationalState(windowState, mode, stateString);
- }
-
//
if (oldNS != null)
{
- change = NavigationalStateObjectChange.newUpdate(effectiveKey, oldNS, newNS);
+ change = NavigationalStateObjectChange.newUpdate(wantedKey, oldNS, newNS);
}
else
{
- change = NavigationalStateObjectChange.newCreate(effectiveKey, newNS);
+ change = NavigationalStateObjectChange.newCreate(wantedKey, newNS);
}
}
@@ -233,7 +159,7 @@
}
//
- changes.put(effectiveKey, change);
+ changes.put(wantedKey, change);
}
}
Modified: trunk/core/src/main/org/jboss/portal/core/model/portal/navstate/WindowNavigationalState.java
===================================================================
--- trunk/core/src/main/org/jboss/portal/core/model/portal/navstate/WindowNavigationalState.java 2007-04-26 22:34:39 UTC (rev 7091)
+++ trunk/core/src/main/org/jboss/portal/core/model/portal/navstate/WindowNavigationalState.java 2007-04-26 23:38:34 UTC (rev 7092)
@@ -24,6 +24,8 @@
import org.jboss.portal.WindowState;
import org.jboss.portal.Mode;
+import org.jboss.portal.common.invocation.AttributeResolver;
+import org.jboss.portal.core.navstate.NavigationalStateKey;
import org.jboss.portal.portlet.StateString;
/**
@@ -34,22 +36,30 @@
{
/** . */
+ private static final WindowNavigationalState DEFAULT = new WindowNavigationalState();
+
+ /** . */
private final WindowState windowState;
/** . */
private final Mode mode;
/** . */
- private final StateString navigationalState;
+ private final StateString state;
+ public static WindowNavigationalState create()
+ {
+ return DEFAULT;
+ }
+
public WindowNavigationalState(WindowState windowState, Mode mode, StateString navigationalState)
{
this.windowState = windowState;
this.mode = mode;
- this.navigationalState = navigationalState;
+ this.state = navigationalState;
}
- public WindowNavigationalState()
+ private WindowNavigationalState()
{
this(WindowState.NORMAL, Mode.VIEW, null);
}
@@ -64,8 +74,61 @@
return mode;
}
- public StateString getNavigationalState()
+ public StateString getState()
{
- return navigationalState;
+ return state;
}
+
+ public static void setMode(AttributeResolver context, Object id, Mode mode)
+ {
+ NavigationalStateKey key = new NavigationalStateKey(WindowNavigationalState.class, id);
+
+ //
+ WindowNavigationalState wns = (WindowNavigationalState)context.getAttribute(key);
+
+ //
+ if (wns == null)
+ {
+ wns = new WindowNavigationalState(WindowState.NORMAL, mode, null);
+ }
+ else
+ {
+ wns = new WindowNavigationalState(wns.getWindowState(), mode, wns.getState());
+ }
+
+ //
+ context.setAttribute(key, wns);
+ }
+
+ public static void setState(AttributeResolver context, Object id, StateString state)
+ {
+ NavigationalStateKey key = new NavigationalStateKey(WindowNavigationalState.class, id);
+
+ //
+ WindowNavigationalState wns = (WindowNavigationalState)context.getAttribute(key);
+
+ //
+ if (wns == null)
+ {
+ wns = new WindowNavigationalState(WindowState.NORMAL, Mode.VIEW, state);
+ }
+ else
+ {
+ wns = new WindowNavigationalState(wns.getWindowState(), wns.getMode(), state);
+ }
+
+ //
+ context.setAttribute(key, wns);
+ }
+
+ public static StateString setState(AttributeResolver context, Object id)
+ {
+ NavigationalStateKey key = new NavigationalStateKey(WindowNavigationalState.class, id);
+
+ //
+ WindowNavigationalState wns = (WindowNavigationalState)context.getAttribute(key);
+
+ //
+ return wns != null ? wns.getState() : null;
+ }
}
Modified: trunk/core/src/resources/portal-core-sar/conf/data/default-object.xml
===================================================================
--- trunk/core/src/resources/portal-core-sar/conf/data/default-object.xml 2007-04-26 22:34:39 UTC (rev 7091)
+++ trunk/core/src/resources/portal-core-sar/conf/data/default-object.xml 2007-04-26 23:38:34 UTC (rev 7092)
@@ -117,6 +117,7 @@
<context>
<context-name>dashboard</context-name>
<properties>
+
<!--
| Set the layout for the default portal, see also portal-layouts.xml.
-->
@@ -124,6 +125,7 @@
<name>layout.id</name>
<value>generic</value>
</property>
+
<!--
| Set the theme for the default portal, see also portal-themes.xml.
-->
@@ -131,6 +133,7 @@
<name>theme.id</name>
<value>renaissance</value>
</property>
+
<!--
| Set the default render set name (used by the render tag in layouts), see also portal-renderSet.xml
-->
@@ -138,6 +141,7 @@
<name>theme.renderSetId</name>
<value>divRenderer</value>
</property>
+
<!--
| Set the dashboard property
-->
@@ -145,6 +149,23 @@
<name>dashboard</name>
<value>true</value>
</property>
+
+ <!--
+ | Set the dnd property
+ -->
+ <property>
+ <name>theme.dyna.dnd_enabled</name>
+ <value>true</value>
+ </property>
+
+ <!--
+ | Set the partial refresh property
+ -->
+ <property>
+ <name>theme.dyna.partial_refresh_enabled</name>
+ <value>true</value>
+ </property>
+
</properties>
</context>
</deployment>
Modified: trunk/core-cms/src/main/org/jboss/portal/core/cms/CMSObjectCommandFactoryService.java
===================================================================
--- trunk/core-cms/src/main/org/jboss/portal/core/cms/CMSObjectCommandFactoryService.java 2007-04-26 22:34:39 UTC (rev 7091)
+++ trunk/core-cms/src/main/org/jboss/portal/core/cms/CMSObjectCommandFactoryService.java 2007-04-26 23:38:34 UTC (rev 7092)
@@ -162,7 +162,6 @@
// Set the content as a render parameter
PortletParametersStateString parameters = new PortletParametersStateString();
parameters.setValue(CMSPortlet.RENDER_PARAMETER_PATH, path);
- parameters.setValue(CMSPortlet.REQUEST_PROPERTY_USE_GLOBAL_URLS, "true");
// Perform a render URL on the target window
return new InvokePortletWindowRenderCommand(targetWindowId, Mode.VIEW, null, parameters);
Modified: trunk/core-cms/src/main/org/jboss/portal/core/cms/ui/CMSPortlet.java
===================================================================
--- trunk/core-cms/src/main/org/jboss/portal/core/cms/ui/CMSPortlet.java 2007-04-26 22:34:39 UTC (rev 7091)
+++ trunk/core-cms/src/main/org/jboss/portal/core/cms/ui/CMSPortlet.java 2007-04-26 23:38:34 UTC (rev 7092)
@@ -50,6 +50,7 @@
import org.jboss.portal.cms.search.CMSFederatedSearch;
import org.jboss.portal.cms.util.FileUtil;
import org.jboss.portal.core.cms.CMSConstants;
+import org.jboss.portal.core.cms.content.InternalCMSContentProvider;
import org.jboss.portal.core.cms.ui.admin.CMSContentEditorPortlet;
import org.jboss.portal.core.cms.command.StreamContentCommand;
import org.jboss.portal.core.controller.ControllerContext;
@@ -130,9 +131,6 @@
/** The render parameter name of the path of the file the portlet will show. */
public static final String RENDER_PARAMETER_PATH = "uri";
- /** The request property which tells the portlet to use global URLs instead of portlet URLs. */
- public static final String REQUEST_PROPERTY_USE_GLOBAL_URLS = "cms.use_global_urls";
-
/** . */
private static final PortletMode EDIT_CONTENT = new PortletMode("edit_content");
@@ -201,9 +199,8 @@
}
//
- String useGlobalURLs = req.getProperty(REQUEST_PROPERTY_USE_GLOBAL_URLS);
URLFactory textURLFactory = null;
- if ("true".equals(useGlobalURLs))
+ if (InternalCMSContentProvider.useGlobalURL())
{
textURLFactory = new GlobalURLFactory(((JBossRenderRequest)req).getControllerContext());
}
Modified: trunk/theme/src/bin/portal-ajax-war/dyna/dyna.js
===================================================================
--- trunk/theme/src/bin/portal-ajax-war/dyna/dyna.js 2007-04-26 22:34:39 UTC (rev 7091)
+++ trunk/theme/src/bin/portal-ajax-war/dyna/dyna.js 2007-04-26 23:38:34 UTC (rev 7092)
@@ -168,7 +168,6 @@
{
// Get markup fragment
var markup = resp.fragments[id];
- markup = markup.substring(25, markup.length - 7);
// Create a temporary element and paste the innerHTML in it
var srcContainer = document.createElement("div");
Modified: trunk/theme/src/main/org/jboss/portal/theme/impl/render/dynamic/DynaRenderOptions.java
===================================================================
--- trunk/theme/src/main/org/jboss/portal/theme/impl/render/dynamic/DynaRenderOptions.java 2007-04-26 22:34:39 UTC (rev 7091)
+++ trunk/theme/src/main/org/jboss/portal/theme/impl/render/dynamic/DynaRenderOptions.java 2007-04-26 23:38:34 UTC (rev 7092)
@@ -89,7 +89,10 @@
/** . */
public static final DynaRenderOptions NO_AJAX = DynaRenderOptions.getOptions(Boolean.FALSE, Boolean.FALSE);
+ /** . */
+ public static final DynaRenderOptions AJAX = DynaRenderOptions.getOptions(Boolean.TRUE, Boolean.TRUE);
+
/**
* Set the options on the specifed property map.
*
17 years, 2 months
JBoss Portal SVN: r7091 - 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-04-26 18:34:39 -0400 (Thu, 26 Apr 2007)
New Revision: 7091
Added:
trunk/wsrp/src/main/org/jboss/portal/test/wsrp/other/RegistrationInfoTestCase.java
Modified:
trunk/wsrp/build.xml
trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/RegistrationInfo.java
Log:
- Added refreshRegistrationRequirementsFor method to be able to manually refresh the registration metadata from the producer.
- Fixed several issues.
- Added test case.
Modified: trunk/wsrp/build.xml
===================================================================
--- trunk/wsrp/build.xml 2007-04-26 21:42:53 UTC (rev 7090)
+++ trunk/wsrp/build.xml 2007-04-26 22:34:39 UTC (rev 7091)
@@ -755,6 +755,7 @@
<test todir="${test.reports}" name="org.jboss.portal.test.wsrp.other.UserContextConverterTestCase"/>
<test todir="${test.reports}" name="org.jboss.portal.test.wsrp.other.EndpointConfigurationInfoTestCase"/>
<test todir="${test.reports}" name="org.jboss.portal.test.wsrp.other.ProducerInfoTestCase"/>
+ <test todir="${test.reports}" name="org.jboss.portal.test.wsrp.other.RegistrationInfoTestCase"/>
<test todir="${test.reports}" name="org.jboss.portal.test.wsrp.handler.RequestHeaderClientHandlerTestCase"/>
</x-test>
<x-sysproperty>
Added: trunk/wsrp/src/main/org/jboss/portal/test/wsrp/other/RegistrationInfoTestCase.java
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/test/wsrp/other/RegistrationInfoTestCase.java (rev 0)
+++ trunk/wsrp/src/main/org/jboss/portal/test/wsrp/other/RegistrationInfoTestCase.java 2007-04-26 22:34:39 UTC (rev 7091)
@@ -0,0 +1,151 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2007, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
+ ******************************************************************************/
+
+package org.jboss.portal.test.wsrp.other;
+
+import junit.framework.TestCase;
+import org.jboss.portal.wsrp.WSRPConstants;
+import org.jboss.portal.wsrp.WSRPTypeFactory;
+import org.jboss.portal.wsrp.consumer.RegistrationInfo;
+import org.jboss.portal.wsrp.consumer.RegistrationProperty;
+import org.jboss.portal.wsrp.core.PropertyDescription;
+import org.jboss.portal.wsrp.core.ServiceDescription;
+
+import java.util.Map;
+
+/**
+ * @author <a href="mailto:chris.laprun@jboss.com">Chris Laprun</a>
+ * @version $Revision$
+ * @since 2.6
+ */
+public class RegistrationInfoTestCase extends TestCase
+{
+ private RegistrationInfo info;
+ private static final String producerId = "test";
+
+ protected void setUp() throws Exception
+ {
+ info = new RegistrationInfo();
+ }
+
+ public void testInitialState()
+ {
+ assertTrue(info.getRegistrationProperties().isEmpty());
+ assertTrue(info.getRegistrationPropertyNames().isEmpty());
+ assertNull(info.getRegistrationContext());
+ assertNotNull(info.getRegistrationData());
+ assertNull(info.getRegistrationHandle());
+ assertNull(info.getRegistrationState());
+ }
+
+ public void testSetGetRegistrationProperty()
+ {
+ String key = "foo";
+ info.setRegistrationPropertyValue(key, "bar");
+ assertFalse(info.getRegistrationProperties().isEmpty());
+ assertFalse(info.getRegistrationPropertyNames().isEmpty());
+ assertTrue(info.getRegistrationProperties().containsKey(key));
+ assertTrue(info.getRegistrationPropertyNames().contains(key));
+ assertNotNull(info.getRegistrationProperties().get(key));
+ assertEquals(info.getRegistrationProperties().get(key), info.getRegistrationProperty(key));
+ assertEquals("bar", info.getRegistrationProperty(key).getValue());
+ }
+
+ public void testRefreshNoRegistration()
+ {
+ ServiceDescription sd = createServiceDescription(false, 0);
+ RegistrationInfo.RegistrationRefreshResult result = info.refreshRegistrationRequirementsFor(sd, producerId, true);
+ assertNotNull(result);
+ assertTrue(result.isValid());
+ assertFalse(info.isRequiresRegistration());
+ assertTrue(info.isRegistrationValid());
+
+ result = info.refreshRegistrationRequirementsFor(sd, producerId, false);
+ assertNotNull(result);
+ assertTrue(result.isValid());
+ assertFalse(info.isRequiresRegistration());
+ assertTrue(info.isRegistrationValid());
+ }
+
+ public void testRefreshRegistrationDefaultRegistrationNoLocalInfo()
+ {
+ RegistrationInfo.RegistrationRefreshResult result = info.refreshRegistrationRequirementsFor(
+ createServiceDescription(true, 0), producerId, true);
+ assertNotNull(result);
+ assertTrue(result.isValid());
+ assertTrue(info.isRequiresRegistration());
+ assertFalse(info.isRegistrationValid());
+ }
+
+ public void testRefreshRegistrationDefaultRegistrationExtraLocalInfo()
+ {
+ // set a registration property
+ info.setRegistrationPropertyValue("foo", "bar");
+
+ RegistrationInfo.RegistrationRefreshResult result = info.refreshRegistrationRequirementsFor(
+ createServiceDescription(true, 0), producerId, false);
+ assertNotNull(result);
+ assertFalse(result.isValid());
+ String status = result.getStatus();
+ assertNotNull(status);
+ assertTrue(status.contains("foo"));
+
+ Map regProps = result.getRegistrationProperties();
+ assertNotNull(regProps);
+
+ RegistrationProperty prop = (RegistrationProperty)regProps.get("foo");
+ assertNotNull(prop);
+ assertEquals("bar", prop.getValue());
+ assertTrue(prop.isInvalid());
+ }
+
+ public void testRefreshRegistrationRegistrationNoLocalInfo()
+ {
+ // producer requests 2 registration properties
+ ServiceDescription sd = createServiceDescription(true, 2);
+
+ RegistrationInfo.RegistrationRefreshResult result = info.refreshRegistrationRequirementsFor(sd, producerId, false);
+ assertNotNull(result);
+ assertFalse(result.isValid());
+ String status = result.getStatus();
+ assertNotNull(status);
+ assertTrue(status.contains("prop0") && status.contains("prop1"));
+ }
+
+ private ServiceDescription createServiceDescription(boolean requiresRegistration, int numberOfProperties)
+ {
+ ServiceDescription sd = WSRPTypeFactory.createServiceDescription(requiresRegistration);
+
+ if (requiresRegistration)
+ {
+ PropertyDescription[] descriptions = new PropertyDescription[numberOfProperties];
+ for (int i = 0; i < numberOfProperties; i++)
+ {
+ descriptions[i] = WSRPTypeFactory.createPropertyDescription("prop" + i, WSRPConstants.XSD_STRING);
+ }
+ sd.setRegistrationPropertyDescription(WSRPTypeFactory.createModelDescription(descriptions));
+ }
+
+ return sd;
+ }
+}
Property changes on: trunk/wsrp/src/main/org/jboss/portal/test/wsrp/other/RegistrationInfoTestCase.java
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native
Modified: trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/RegistrationInfo.java
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/RegistrationInfo.java 2007-04-26 21:42:53 UTC (rev 7090)
+++ trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/RegistrationInfo.java 2007-04-26 22:34:39 UTC (rev 7091)
@@ -238,8 +238,22 @@
*/
boolean initialize(ServiceDescription serviceDescription, String producerId)
{
+ return refreshRegistrationRequirementsFor(serviceDescription, producerId, true).isValid();
+ }
+
+
+ /**
+ * @param serviceDescription
+ * @param producerId
+ * @param discardLocalInfo
+ * @return
+ * @since 2.6
+ */
+ public RegistrationRefreshResult refreshRegistrationRequirementsFor(ServiceDescription serviceDescription, String producerId, boolean discardLocalInfo)
+ {
log.debug("RegistrationInfo initialization requested");
- boolean configurationValid;
+ RegistrationRefreshResult result = new RegistrationRefreshResult();
+
if (serviceDescription.isRequiresRegistration())
{
requiresRegistration = true;
@@ -250,85 +264,118 @@
ModelDescription regPropDescs = serviceDescription.getRegistrationPropertyDescription();
if (regPropDescs != null)
{
- configurationValid = true;
+ result.setValid(true);
PropertyDescription[] propertyDescriptions = regPropDescs.getPropertyDescriptions();
if (propertyDescriptions != null && propertyDescriptions.length > 0)
{
Map descriptionsMap = getRegistrationPropertyDescriptionsFromWSRP(propertyDescriptions);
- Map registrationProperties = getOrCreateRegistrationPropertiesMap(true);
+ if (discardLocalInfo)
+ {
+ registrationProperties = descriptionsMap;
+ result.setValid(false);
+ }
+ else
+ {
+ registrationProperties = getOrCreateRegistrationPropertiesMap(true);
- // check that we don't have unexpected registration properties and if so, mark them as invalid
- Set unexpected = new HashSet(registrationProperties.keySet());
- Set expectedNames = descriptionsMap.keySet();
- unexpected.removeAll(expectedNames);
- if (!unexpected.isEmpty())
- {
- message = new StringBuffer("The registration for producer '"
- + producerId + "' provided values for unexpected registration properties: ");
- for (Iterator invalidProps = unexpected.iterator(); invalidProps.hasNext();)
+ // check that we don't have unexpected registration properties and if so, mark them as invalid
+ Set expectedNames = descriptionsMap.keySet();
+ checkForExtraProperties(producerId, result, expectedNames, registrationProperties);
+
+ // 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)invalidProps.next();
- message.append("\t- ").append(name).append("\n");
- ((RegistrationProperty)registrationProperties.get(name)).setInvalid(true);
+ String name = (String)descriptionNames.next();
+ RegistrationProperty prop = (RegistrationProperty)registrationProperties.get(name);
+ if (prop == null)
+ {
+ Object missingProp = descriptionsMap.get(name);
+ registrationProperties.put(name, missingProp);
+ missingProps.append("Missing value for property '").append(name).append("'\n");
+ }
}
- log.info(message);
- resetRegistration();
- configurationValid = false;
- }
- // now check for missing properties, add the missing ones with a null value
- StringBuffer missingProps = new StringBuffer();
- for (Iterator descriptionNames = expectedNames.iterator(); descriptionNames.hasNext();)
- {
- String name = (String)descriptionNames.next();
- RegistrationProperty prop = (RegistrationProperty)registrationProperties.get(name);
- if (prop == null)
+ if (missingProps.length() > 0)
{
- Object missingProp = descriptionsMap.get(name);
- registrationProperties.put(name, missingProp);
- missingProps.append("Missing value for ").append(missingProp).append("\n");
+ log.info(missingProps);
+ result.appendToStatus(missingProps.toString());
+ resetRegistration();
+ result.setValid(false);
}
}
-
- if (missingProps.length() > 0)
- {
- log.info(missingProps);
- resetRegistration();
- configurationValid = false;
- }
}
- }
- else
- {
- log.info("The producer didn't require any specific registration properties.");
- if (!getRegistrationProperties().isEmpty())
- {
- resetRegistration();
- log.info("Registration data is available for producer '"
- + producerId + "' when none is expected by the producer.");
- configurationValid = false;
- }
else
{
- log.info("Using default registration data for producer '" + producerId + "'");
- registrationData = WSRPTypeFactory.createDefaultRegistrationData();
- configurationValid = true;
+ handleNoRequiredRegistrationProperties(producerId, result);
}
}
+ else
+ {
+ handleNoRequiredRegistrationProperties(producerId, result);
+ }
}
else
{
log.info("Producer '" + producerId + "' doesn't require registration.");
requiresRegistration = false;
- configurationValid = true;
+ result.setValid(true);
}
- log.debug("Registration configuration is " + (configurationValid ? "" : "NOT") + " valid");
- return configurationValid;
+ result.setRegistrationProperties(registrationProperties);
+ log.debug("Registration configuration is " + (result.isValid() ? "" : "NOT") + " valid");
+ return result;
}
+ private void handleNoRequiredRegistrationProperties(String producerId, RegistrationRefreshResult result)
+ {
+ log.info("The producer didn't require any specific registration properties.");
+ Map properties = getRegistrationProperties();
+ if (!properties.isEmpty())
+ {
+ String msg = "Registration data is available for producer '"
+ + producerId + "' when none is expected by the producer.";
+ log.info(msg);
+ checkForExtraProperties(producerId, result, Collections.EMPTY_SET, properties);
+ }
+ else
+ {
+ log.info("Using default registration data for producer '" + producerId + "'");
+ registrationData = WSRPTypeFactory.createDefaultRegistrationData();
+ result.setValid(true);
+ }
+ }
+
/**
+ * @param producerId
+ * @param result
+ * @param expectedNames
+ * @param properties
+ * @return a set of the property names expected by the producer
+ */
+ private void checkForExtraProperties(String producerId, RegistrationRefreshResult result, Set expectedNames, Map properties)
+ {
+ Set unexpected = new HashSet(properties.keySet());
+ unexpected.removeAll(expectedNames);
+ if (!unexpected.isEmpty())
+ {
+ StringBuffer message = new StringBuffer("The registration for producer '"
+ + producerId + "' provided values for unexpected registration properties: ");
+ for (Iterator invalidProps = unexpected.iterator(); invalidProps.hasNext();)
+ {
+ String name = (String)invalidProps.next();
+ message.append("\t- ").append(name).append("\n");
+ ((RegistrationProperty)properties.get(name)).setInvalid(true);
+ }
+ log.info(message);
+ result.appendToStatus(message.toString());
+ resetRegistration();
+ result.setValid(false);
+ }
+ }
+
+ /**
* @param descriptions
* @return
* @since 2.6
@@ -391,4 +438,59 @@
return null;
}
}
+
+ public class RegistrationRefreshResult
+ {
+ private Map registrationProperties;
+ private StringBuffer status;
+ private boolean valid;
+
+ public String getStatus()
+ {
+ if (status == null)
+ {
+ return null;
+ }
+
+ return status.toString();
+ }
+
+ public Map getRegistrationProperties()
+ {
+ return registrationProperties;
+ }
+
+ public void setRegistrationProperties(Map registrationProperties)
+ {
+ this.registrationProperties = registrationProperties;
+ }
+
+ public boolean isValid()
+ {
+ return valid;
+ }
+
+ public void setValid(boolean valid)
+ {
+ this.valid = valid;
+ }
+
+ void appendToStatus(String message)
+ {
+ if (status == null)
+ {
+ status = new StringBuffer(message);
+ }
+ else
+ {
+ status.append(message);
+ }
+ }
+ }
+
+ class RegistrationPropertyHolder
+ {
+ RegistrationProperty property;
+ String status;
+ }
}
17 years, 2 months
JBoss Portal SVN: r7090 - in trunk/core-cms/src/resources/portal-cms-war/WEB-INF: jsp/cms/admin and 1 other directory.
by portal-commits@lists.jboss.org
Author: sohil.shah(a)jboss.com
Date: 2007-04-26 17:42:53 -0400 (Thu, 26 Apr 2007)
New Revision: 7090
Modified:
trunk/core-cms/src/resources/portal-cms-war/WEB-INF/classes/Resource.properties
trunk/core-cms/src/resources/portal-cms-war/WEB-INF/jsp/cms/admin/create.jsp
trunk/core-cms/src/resources/portal-cms-war/WEB-INF/jsp/cms/admin/edit.jsp
Log:
externalizing the WYSIWIG label. just code cleanup
Modified: trunk/core-cms/src/resources/portal-cms-war/WEB-INF/classes/Resource.properties
===================================================================
--- trunk/core-cms/src/resources/portal-cms-war/WEB-INF/classes/Resource.properties 2007-04-26 21:41:45 UTC (rev 7089)
+++ trunk/core-cms/src/resources/portal-cms-war/WEB-INF/classes/Resource.properties 2007-04-26 21:42:53 UTC (rev 7090)
@@ -77,6 +77,7 @@
CMS_EDITING=Editing File
CMS_LIVE=Make \"Live\"
CMS_VERSION=Version
+CMS_WYSIWYG=WYSIWYG Editor
CMS_LIVEVERSION=Live Version
CMS_SIZE=Size
Modified: trunk/core-cms/src/resources/portal-cms-war/WEB-INF/jsp/cms/admin/create.jsp
===================================================================
--- trunk/core-cms/src/resources/portal-cms-war/WEB-INF/jsp/cms/admin/create.jsp 2007-04-26 21:41:45 UTC (rev 7089)
+++ trunk/core-cms/src/resources/portal-cms-war/WEB-INF/jsp/cms/admin/create.jsp 2007-04-26 21:42:53 UTC (rev 7090)
@@ -116,8 +116,8 @@
</td>
</tr>
<tr>
- <td>
- WYSIWYG Editor:
+ <td class="portlet-section-header" valign="bottom">
+ ${n:i18n("CMS_WYSIWYG")}:
</td>
<td>
<input type="checkbox" name="wysiwyg" class="portlet-form-input-field" checked onclick="javascript:toggleEditor();"/>
Modified: trunk/core-cms/src/resources/portal-cms-war/WEB-INF/jsp/cms/admin/edit.jsp
===================================================================
--- trunk/core-cms/src/resources/portal-cms-war/WEB-INF/jsp/cms/admin/edit.jsp 2007-04-26 21:41:45 UTC (rev 7089)
+++ trunk/core-cms/src/resources/portal-cms-war/WEB-INF/jsp/cms/admin/edit.jsp 2007-04-26 21:42:53 UTC (rev 7090)
@@ -124,8 +124,8 @@
</td>
</tr>
<tr>
- <td>
- WYSIWYG Editor:
+ <td class="portlet-section-header" valign="bottom">
+ ${n:i18n("CMS_WYSIWYG")}:
</td>
<td>
<input type="checkbox" name="wysiwyg" class="portlet-form-input-field" checked onclick="javascript:toggleEditor();"/>
17 years, 2 months
JBoss Portal SVN: r7089 - in branches/JBoss_Portal_Branch_2_4/core/src/resources/portal-core-war/WEB-INF: jsp/cms/admin and 1 other directory.
by portal-commits@lists.jboss.org
Author: sohil.shah(a)jboss.com
Date: 2007-04-26 17:41:45 -0400 (Thu, 26 Apr 2007)
New Revision: 7089
Modified:
branches/JBoss_Portal_Branch_2_4/core/src/resources/portal-core-war/WEB-INF/classes/Resource.properties
branches/JBoss_Portal_Branch_2_4/core/src/resources/portal-core-war/WEB-INF/jsp/cms/admin/create.jsp
branches/JBoss_Portal_Branch_2_4/core/src/resources/portal-core-war/WEB-INF/jsp/cms/admin/edit.jsp
Log:
added the flexibility to toggle the WYSIWIG editor on/off (backport feature from 2.6)
Modified: branches/JBoss_Portal_Branch_2_4/core/src/resources/portal-core-war/WEB-INF/classes/Resource.properties
===================================================================
--- branches/JBoss_Portal_Branch_2_4/core/src/resources/portal-core-war/WEB-INF/classes/Resource.properties 2007-04-26 20:40:31 UTC (rev 7088)
+++ branches/JBoss_Portal_Branch_2_4/core/src/resources/portal-core-war/WEB-INF/classes/Resource.properties 2007-04-26 21:41:45 UTC (rev 7089)
@@ -416,6 +416,7 @@
CMS_EDITING=Editing File
CMS_LIVE=Make \"Live\"
CMS_VERSION=Version
+CMS_WYSIWYG=WYSIWYG Editor
CMS_LIVEVERSION=Live Version
CMS_SIZE=Size
Modified: branches/JBoss_Portal_Branch_2_4/core/src/resources/portal-core-war/WEB-INF/jsp/cms/admin/create.jsp
===================================================================
--- branches/JBoss_Portal_Branch_2_4/core/src/resources/portal-core-war/WEB-INF/jsp/cms/admin/create.jsp 2007-04-26 20:40:31 UTC (rev 7088)
+++ branches/JBoss_Portal_Branch_2_4/core/src/resources/portal-core-war/WEB-INF/jsp/cms/admin/create.jsp 2007-04-26 21:41:45 UTC (rev 7089)
@@ -35,6 +35,21 @@
document_base_url : "<%= sDocBase %>",
extended_valid_elements : "style[type],a[name|href|target|title|onclick],img[class|src|border=0|alt|title|hspace|vspace|width|height|align|onmouseover|onmouseout|name],font[face|size|color],hr[class|width|size|noshade]"
});
+
+ var status = true;
+ function toggleEditor()
+ {
+ if(status)
+ {
+ tinyMCE.execCommand("mceRemoveControl", false, "elm1");
+ status = false;
+ }
+ else
+ {
+ tinyMCE.execCommand("mceAddControl", false, "elm1");
+ status = true;
+ }
+ }
</script>
<!-- /tinyMCE -->
@@ -91,6 +106,14 @@
</select>
</td>
</tr>
+ <tr>
+ <td class="portlet-section-header" valign="bottom">
+ ${n:i18n("CMS_WYSIWYG")}:
+ </td>
+ <td>
+ <input type="checkbox" name="wysiwyg" class="portlet-form-input-field" checked onclick="javascript:toggleEditor();"/>
+ </td>
+ </tr>
</table>
</td>
</tr>
Modified: branches/JBoss_Portal_Branch_2_4/core/src/resources/portal-core-war/WEB-INF/jsp/cms/admin/edit.jsp
===================================================================
--- branches/JBoss_Portal_Branch_2_4/core/src/resources/portal-core-war/WEB-INF/jsp/cms/admin/edit.jsp 2007-04-26 20:40:31 UTC (rev 7088)
+++ branches/JBoss_Portal_Branch_2_4/core/src/resources/portal-core-war/WEB-INF/jsp/cms/admin/edit.jsp 2007-04-26 21:41:45 UTC (rev 7089)
@@ -38,6 +38,21 @@
document_base_url : "<%= sDocBase %>",
extended_valid_elements : "style[type],a[name|href|target|title|onclick],img[class|src|border=0|alt|title|hspace|vspace|width|height|align|onmouseover|onmouseout|name],font[face|size|color],hr[class|width|size|noshade]"
});
+
+ var status = true;
+ function toggleEditor()
+ {
+ if(status)
+ {
+ tinyMCE.execCommand("mceRemoveControl", false, "elm1");
+ status = false;
+ }
+ else
+ {
+ tinyMCE.execCommand("mceAddControl", false, "elm1");
+ status = true;
+ }
+ }
</script>
<!-- /tinyMCE -->
@@ -96,6 +111,14 @@
${n:i18n("CMS_VERSION")}:</td><td class="portlet-section-alternate"><%= sVersion %>
</td>
</tr>
+ <tr>
+ <td class="portlet-section-header" valign="bottom">
+ ${n:i18n("CMS_WYSIWYG")}:
+ </td>
+ <td>
+ <input type="checkbox" name="wysiwyg" class="portlet-form-input-field" checked onclick="javascript:toggleEditor();"/>
+ </td>
+ </tr>
</table>
</td>
</tr>
17 years, 2 months
JBoss Portal SVN: r7088 - trunk/core-cms/src/resources/portal-cms-war/WEB-INF/jsp/cms/admin.
by portal-commits@lists.jboss.org
Author: sohil.shah(a)jboss.com
Date: 2007-04-26 16:40:31 -0400 (Thu, 26 Apr 2007)
New Revision: 7088
Modified:
trunk/core-cms/src/resources/portal-cms-war/WEB-INF/jsp/cms/admin/create.jsp
trunk/core-cms/src/resources/portal-cms-war/WEB-INF/jsp/cms/admin/edit.jsp
Log:
added the flexibility to toggle the WYSIWIG editor on/off
Modified: trunk/core-cms/src/resources/portal-cms-war/WEB-INF/jsp/cms/admin/create.jsp
===================================================================
--- trunk/core-cms/src/resources/portal-cms-war/WEB-INF/jsp/cms/admin/create.jsp 2007-04-26 19:21:18 UTC (rev 7087)
+++ trunk/core-cms/src/resources/portal-cms-war/WEB-INF/jsp/cms/admin/create.jsp 2007-04-26 20:40:31 UTC (rev 7088)
@@ -35,6 +35,21 @@
document_base_url : "<%= sDocBase %>",
extended_valid_elements : "style[type],a[name|href|target|title|onclick],img[class|src|border=0|alt|title|hspace|vspace|width|height|align|onmouseover|onmouseout|name],font[face|size|color],hr[class|width|size|noshade]"
});
+
+ var status = true;
+ function toggleEditor()
+ {
+ if(status)
+ {
+ tinyMCE.execCommand("mceRemoveControl", false, "elm1");
+ status = false;
+ }
+ else
+ {
+ tinyMCE.execCommand("mceAddControl", false, "elm1");
+ status = true;
+ }
+ }
</script>
<!-- /tinyMCE -->
@@ -100,6 +115,14 @@
</select>
</td>
</tr>
+ <tr>
+ <td>
+ WYSIWYG Editor:
+ </td>
+ <td>
+ <input type="checkbox" name="wysiwyg" class="portlet-form-input-field" checked onclick="javascript:toggleEditor();"/>
+ </td>
+ </tr>
</table>
</td>
</tr>
Modified: trunk/core-cms/src/resources/portal-cms-war/WEB-INF/jsp/cms/admin/edit.jsp
===================================================================
--- trunk/core-cms/src/resources/portal-cms-war/WEB-INF/jsp/cms/admin/edit.jsp 2007-04-26 19:21:18 UTC (rev 7087)
+++ trunk/core-cms/src/resources/portal-cms-war/WEB-INF/jsp/cms/admin/edit.jsp 2007-04-26 20:40:31 UTC (rev 7088)
@@ -21,7 +21,7 @@
<!-- tinyMCE -->
<script language="javascript" type="text/javascript"
src="<%= renderRequest.getContextPath() + CMSAdminConstants.DEFAULT_IMAGES_PATH %>/tiny_mce/tiny_mce_src.js"></script>
-<script language="javascript" type="text/javascript">
+<script language="javascript" type="text/javascript">
tinyMCE.init({
mode : "textareas",
theme : "advanced",
@@ -38,6 +38,21 @@
document_base_url : "<%= sDocBase %>",
extended_valid_elements : "style[type],a[name|href|target|title|onclick],img[class|src|border=0|alt|title|hspace|vspace|width|height|align|onmouseover|onmouseout|name],font[face|size|color],hr[class|width|size|noshade]"
});
+
+ var status = true;
+ function toggleEditor()
+ {
+ if(status)
+ {
+ tinyMCE.execCommand("mceRemoveControl", false, "elm1");
+ status = false;
+ }
+ else
+ {
+ tinyMCE.execCommand("mceAddControl", false, "elm1");
+ status = true;
+ }
+ }
</script>
<!-- /tinyMCE -->
@@ -108,6 +123,14 @@
<td><%= sVersion %>
</td>
</tr>
+ <tr>
+ <td>
+ WYSIWYG Editor:
+ </td>
+ <td>
+ <input type="checkbox" name="wysiwyg" class="portlet-form-input-field" checked onclick="javascript:toggleEditor();"/>
+ </td>
+ </tr>
</table>
</td>
</tr>
@@ -133,9 +156,10 @@
</tr>
<tr>
<td align="center">
- <textarea id="elm1" name="elm1" rows="20" cols="80" style="width: 100%"
- class="textarea"><%= sContent %>
- </textarea><br>
+ <textarea id="elm1" name="elm1" rows="20" cols="80" style="width: 100%" class="textarea">
+ <%= sContent %>
+ </textarea>
+ <br>
<input type="submit" name="save" value="${n:i18n("CMS_CREATE")}" class="portlet-form-button"/>
<input type="reset" name="reset" value="Reset" class="portlet-form-button"/>
17 years, 2 months
JBoss Portal SVN: r7087 - branches/JBoss_Portal_Branch_2_4/core/src/resources/portal-core-war/WEB-INF/jsp/cms/admin.
by portal-commits@lists.jboss.org
Author: sohil.shah(a)jboss.com
Date: 2007-04-26 15:21:18 -0400 (Thu, 26 Apr 2007)
New Revision: 7087
Modified:
branches/JBoss_Portal_Branch_2_4/core/src/resources/portal-core-war/WEB-INF/jsp/cms/admin/create.jsp
branches/JBoss_Portal_Branch_2_4/core/src/resources/portal-core-war/WEB-INF/jsp/cms/admin/edit.jsp
Log:
removing the style widget - JBPORTAL-1341
Modified: branches/JBoss_Portal_Branch_2_4/core/src/resources/portal-core-war/WEB-INF/jsp/cms/admin/create.jsp
===================================================================
--- branches/JBoss_Portal_Branch_2_4/core/src/resources/portal-core-war/WEB-INF/jsp/cms/admin/create.jsp 2007-04-26 19:21:01 UTC (rev 7086)
+++ branches/JBoss_Portal_Branch_2_4/core/src/resources/portal-core-war/WEB-INF/jsp/cms/admin/create.jsp 2007-04-26 19:21:18 UTC (rev 7087)
@@ -22,6 +22,7 @@
tinyMCE.init({
mode : "textareas",
theme : "advanced",
+ theme_advanced_disable : "styleselect",
plugins : "advhr,advimage,advlink,emotions,insertdatetime,preview,zoom,flash",
theme_advanced_buttons1_add : "fontselect,fontsizeselect,forecolor",
theme_advanced_buttons2_add_before: "cut,copy,paste,separator",
Modified: branches/JBoss_Portal_Branch_2_4/core/src/resources/portal-core-war/WEB-INF/jsp/cms/admin/edit.jsp
===================================================================
--- branches/JBoss_Portal_Branch_2_4/core/src/resources/portal-core-war/WEB-INF/jsp/cms/admin/edit.jsp 2007-04-26 19:21:01 UTC (rev 7086)
+++ branches/JBoss_Portal_Branch_2_4/core/src/resources/portal-core-war/WEB-INF/jsp/cms/admin/edit.jsp 2007-04-26 19:21:18 UTC (rev 7087)
@@ -25,6 +25,7 @@
tinyMCE.init({
mode : "textareas",
theme : "advanced",
+ theme_advanced_disable : "styleselect",
plugins : "advhr,advimage,advlink,emotions,iespell,insertdatetime,preview,zoom,flash",
theme_advanced_buttons1_add : "fontselect,fontsizeselect,forecolor",
theme_advanced_buttons2_add_before: "cut,copy,paste,separator",
17 years, 2 months