Author: chris.laprun(a)jboss.com
Date: 2009-12-10 13:38:10 -0500 (Thu, 10 Dec 2009)
New Revision: 986
Modified:
portal/branches/wsrp-integration/web/portal/src/main/webapp/groovy/portal/webui/application/UIPortlet.gtmpl
portal/branches/wsrp-integration/web/portal/src/main/webapp/groovy/portal/webui/container/UIContainer.gtmpl
portal/branches/wsrp-integration/web/portal/src/main/webapp/groovy/portal/webui/container/UITableColumnContainer.gtmpl
portal/branches/wsrp-integration/web/portal/src/main/webapp/groovy/portal/webui/container/UIToolbarContainer.gtmpl
portal/branches/wsrp-integration/webui/core/src/main/java/org/exoplatform/webui/application/portlet/PortletURLBuilder.java
portal/branches/wsrp-integration/webui/core/src/main/java/org/exoplatform/webui/core/UIApplication.java
portal/branches/wsrp-integration/webui/core/src/main/java/org/exoplatform/webui/core/UIComponent.java
portal/branches/wsrp-integration/webui/core/src/main/java/org/exoplatform/webui/core/lifecycle/Lifecycle.java
portal/branches/wsrp-integration/webui/portal/src/main/java/org/exoplatform/portal/webui/application/UIPortletLifecycle.java
portal/branches/wsrp-integration/webui/portal/src/main/java/org/exoplatform/portal/webui/workspace/UIPortalApplication.java
Log:
- Fixed typo: isEditting -> isEditing.
- Added some constants.
- Fixed some incorrect javadoc.
Modified:
portal/branches/wsrp-integration/web/portal/src/main/webapp/groovy/portal/webui/application/UIPortlet.gtmpl
===================================================================
---
portal/branches/wsrp-integration/web/portal/src/main/webapp/groovy/portal/webui/application/UIPortlet.gtmpl 2009-12-10
14:01:49 UTC (rev 985)
+++
portal/branches/wsrp-integration/web/portal/src/main/webapp/groovy/portal/webui/application/UIPortlet.gtmpl 2009-12-10
18:38:10 UTC (rev 986)
@@ -7,7 +7,7 @@
def rcontext = _ctx.getRequestContext();
UIPortalApplication uiPortalApp = rcontext.getUIApplication();
- if(!uiPortalApp.isEditting() && !uicomponent.hasPermission()) return;
+ if(!uiPortalApp.isEditing() && !uicomponent.hasPermission()) return;
int portalMode = uiPortalApp.getModeState();
JavascriptManager jsmanager = rcontext.getJavascriptManager();
@@ -20,7 +20,7 @@
WindowState windowState = uicomponent.getCurrentWindowState();
boolean isDesktop = "Window".equals(uicomponent.getPortletStyle());
String portletId = uicomponent.getId();
- if(!isDesktop && uiPortalApp.isEditting()) {
+ if(!isDesktop && uiPortalApp.isEditing()) {
%>
<div class="UIPortlet" id="UIPortlet-$portletId"
onmouseover="eXo.portal.UIPortal.blockOnMouseOver(event, this, true);"
onmouseout="eXo.portal.UIPortal.blockOnMouseOver(event, this, false);"
style="top: 0px; left:0px;">
@@ -285,7 +285,7 @@
}
}
}
- if(!isDesktop && uiPortalApp.isEditting()) {
+ if(!isDesktop && uiPortalApp.isEditing()) {
if(portalMode != uiPortalApp.CONTAINER_BLOCK_EDIT_MODE && portalMode !=
uiPortalApp.APP_BLOCK_EDIT_MODE) {
%>
<div class="UIPortlet-$portletId UIPortletMask" style="position:
absolute; display:none;"><span></span></div>
Modified:
portal/branches/wsrp-integration/web/portal/src/main/webapp/groovy/portal/webui/container/UIContainer.gtmpl
===================================================================
---
portal/branches/wsrp-integration/web/portal/src/main/webapp/groovy/portal/webui/container/UIContainer.gtmpl 2009-12-10
14:01:49 UTC (rev 985)
+++
portal/branches/wsrp-integration/web/portal/src/main/webapp/groovy/portal/webui/container/UIContainer.gtmpl 2009-12-10
18:38:10 UTC (rev 986)
@@ -7,7 +7,7 @@
ResourceBundle res = rcontext.getApplicationResourceBundle();
UIPortalApplication uiPortalApp = rcontext.getUIApplication();
- if(!uiPortalApp.isEditting() && !uicomponent.hasPermission()) return;
+ if(!uiPortalApp.isEditing() && !uicomponent.hasPermission()) return;
String cssStyle = "";
String uiComponentWidth = uicomponent.getWidth();
@@ -24,7 +24,7 @@
}
%>
-<div class="UIContainer
<%=uiPortalApp.isEditting()?"EdittingContainer":""%>"
id="UIContainer-${uicomponent.id}" ${cssStyle}
onmouseover="eXo.portal.UIPortal.blockOnMouseOver(event, this, true);"
onmouseout="eXo.portal.UIPortal.blockOnMouseOver(event, this, false);">
+<div class="UIContainer
<%=uiPortalApp.isEditing()?"EdittingContainer":""%>"
id="UIContainer-${uicomponent.id}" ${cssStyle}
onmouseover="eXo.portal.UIPortal.blockOnMouseOver(event, this, true);"
onmouseout="eXo.portal.UIPortal.blockOnMouseOver(event, this, false);">
<div class="NormalContainerBlock">
<div class="LeftContainerBlock">
<div class="RightContainerBlock UIComponentBlock">
Modified:
portal/branches/wsrp-integration/web/portal/src/main/webapp/groovy/portal/webui/container/UITableColumnContainer.gtmpl
===================================================================
---
portal/branches/wsrp-integration/web/portal/src/main/webapp/groovy/portal/webui/container/UITableColumnContainer.gtmpl 2009-12-10
14:01:49 UTC (rev 985)
+++
portal/branches/wsrp-integration/web/portal/src/main/webapp/groovy/portal/webui/container/UITableColumnContainer.gtmpl 2009-12-10
18:38:10 UTC (rev 986)
@@ -6,7 +6,7 @@
ResourceBundle res = rcontext.getApplicationResourceBundle();
UIPortalApplication uiPortalApp = rcontext.getUIApplication();
- if(!uiPortalApp.isEditting() && !uicomponent.hasPermission()) return;
+ if(!uiPortalApp.isEditing() && !uicomponent.hasPermission()) return;
/** Trim the prefix UIContainer- if any, this hardcoded part is needed to update nested
container via Ajax */
String componentId = uicomponent.getId();
@@ -15,7 +15,7 @@
}
%>
-<div class="UIContainer
<%=uiPortalApp.isEditting()?"EdittingContainer":""%>"
id="UIContainer-${uicomponent.id}"
onmouseover="eXo.portal.UIPortal.blockOnMouseOver(event, this, true);"
onmouseout="eXo.portal.UIPortal.blockOnMouseOver(event, this, false);">
+<div class="UIContainer
<%=uiPortalApp.isEditing()?"EdittingContainer":""%>"
id="UIContainer-${uicomponent.id}"
onmouseover="eXo.portal.UIPortal.blockOnMouseOver(event, this, true);"
onmouseout="eXo.portal.UIPortal.blockOnMouseOver(event, this, false);">
<div class="NormalContainerBlock">
<div class="LeftContainerBlock">
<div class="RightContainerBlock UIComponentBlock">
Modified:
portal/branches/wsrp-integration/web/portal/src/main/webapp/groovy/portal/webui/container/UIToolbarContainer.gtmpl
===================================================================
---
portal/branches/wsrp-integration/web/portal/src/main/webapp/groovy/portal/webui/container/UIToolbarContainer.gtmpl 2009-12-10
14:01:49 UTC (rev 985)
+++
portal/branches/wsrp-integration/web/portal/src/main/webapp/groovy/portal/webui/container/UIToolbarContainer.gtmpl 2009-12-10
18:38:10 UTC (rev 986)
@@ -5,13 +5,13 @@
def rcontext = _ctx.getRequestContext();
UIPortalApplication uiPortalApp = rcontext.getUIApplication();
- if(!uiPortalApp.isEditting() && !uicomponent.hasPermission()) return;
+ if(!uiPortalApp.isEditing() && !uicomponent.hasPermission()) return;
JavascriptManager jsmanager = rcontext.getJavascriptManager();
jsmanager.importJavascript('eXo.portal.PortalDragDrop');
%>
-<div class="UIContainer UIToolbarContainer
<%=uiPortalApp.isEditting()?"EdittingContainer":""%>"
id="UIContainer-${uicomponent.id}"
onmouseover="eXo.portal.UIPortal.blockOnMouseOver(event, this, true);"
onmouseout="eXo.portal.UIPortal.blockOnMouseOver(event, this, false);">
+<div class="UIContainer UIToolbarContainer
<%=uiPortalApp.isEditing()?"EdittingContainer":""%>"
id="UIContainer-${uicomponent.id}"
onmouseover="eXo.portal.UIPortal.blockOnMouseOver(event, this, true);"
onmouseout="eXo.portal.UIPortal.blockOnMouseOver(event, this, false);">
<div class="NormalContainerBlock">
<div class="LeftContainerBlock">
<div class="RightContainerBlock UIComponentBlock">
Modified:
portal/branches/wsrp-integration/webui/core/src/main/java/org/exoplatform/webui/application/portlet/PortletURLBuilder.java
===================================================================
---
portal/branches/wsrp-integration/webui/core/src/main/java/org/exoplatform/webui/application/portlet/PortletURLBuilder.java 2009-12-10
14:01:49 UTC (rev 985)
+++
portal/branches/wsrp-integration/webui/core/src/main/java/org/exoplatform/webui/application/portlet/PortletURLBuilder.java 2009-12-10
18:38:10 UTC (rev 986)
@@ -30,8 +30,10 @@
*/
public class PortletURLBuilder extends URLBuilder<UIComponent>
{
+ private static final String AMP = "&";
+ private static final char EQUALS = '=';
- public PortletURLBuilder()
+ public PortletURLBuilder()
{
super(null);
}
@@ -54,25 +56,25 @@
protected void createURL(StringBuilder builder, UIComponent targetComponent, String
action, String targetBeanId,
Parameter[] params)
{
- String baseUrl = getBaseURL().replaceAll("&",
"&");
-
builder.append(baseUrl).append("&").append(UIComponent.UICOMPONENT).append('=').append(
+ String baseUrl = getBaseURL().replaceAll("&", AMP);
+
builder.append(baseUrl).append(AMP).append(UIComponent.UICOMPONENT).append(EQUALS).append(
targetComponent.getId());
if (action != null && action.trim().length() > 0)
{
-
builder.append("&").append(WebuiRequestContext.ACTION).append('=').append(action);
+
builder.append(AMP).append(WebuiRequestContext.ACTION).append(EQUALS).append(action);
}
if (targetBeanId != null && targetBeanId.trim().length() > 0)
{
-
builder.append("&").append(UIComponent.OBJECTID).append('=').append(targetBeanId);
+
builder.append(AMP).append(UIComponent.OBJECTID).append(EQUALS).append(targetBeanId);
}
if (params == null || params.length < 1)
return;
for (Parameter param : params)
{
-
builder.append("&").append(param.getName()).append('=').append(param.getValue());
+
builder.append(AMP).append(param.getName()).append(EQUALS).append(param.getValue());
}
}
Modified:
portal/branches/wsrp-integration/webui/core/src/main/java/org/exoplatform/webui/core/UIApplication.java
===================================================================
---
portal/branches/wsrp-integration/webui/core/src/main/java/org/exoplatform/webui/core/UIApplication.java 2009-12-10
14:01:49 UTC (rev 985)
+++
portal/branches/wsrp-integration/webui/core/src/main/java/org/exoplatform/webui/core/UIApplication.java 2009-12-10
18:38:10 UTC (rev 986)
@@ -41,6 +41,7 @@
private long lastAccessApplication_;
private UIPopupMessages uiPopupMessages_;
+ private static final String UIAPPLICATION = "uiapplication";
public UIApplication() throws Exception
{
@@ -81,11 +82,11 @@
public void setLastAccessApplication(long time)
{
lastAccessApplication_ = time;
- };
+ }
public String getUIComponentName()
{
- return "uiapplication";
+ return UIAPPLICATION;
}
@SuppressWarnings("unchecked")
Modified:
portal/branches/wsrp-integration/webui/core/src/main/java/org/exoplatform/webui/core/UIComponent.java
===================================================================
---
portal/branches/wsrp-integration/webui/core/src/main/java/org/exoplatform/webui/core/UIComponent.java 2009-12-10
14:01:49 UTC (rev 985)
+++
portal/branches/wsrp-integration/webui/core/src/main/java/org/exoplatform/webui/core/UIComponent.java 2009-12-10
18:38:10 UTC (rev 986)
@@ -372,7 +372,7 @@
public String getUIComponentName()
{
- return "uicomponent";
+ return UICOMPONENT;
}
public <T> T getApplicationComponent(Class<T> type)
Modified:
portal/branches/wsrp-integration/webui/core/src/main/java/org/exoplatform/webui/core/lifecycle/Lifecycle.java
===================================================================
---
portal/branches/wsrp-integration/webui/core/src/main/java/org/exoplatform/webui/core/lifecycle/Lifecycle.java 2009-12-10
14:01:49 UTC (rev 985)
+++
portal/branches/wsrp-integration/webui/core/src/main/java/org/exoplatform/webui/core/lifecycle/Lifecycle.java 2009-12-10
18:38:10 UTC (rev 986)
@@ -57,15 +57,12 @@
}
/**
- * That method is the most generic one for every UICOmponent that is bound to
- * this Lifecycle object and the class that extends it withouyt overiding the
+ * That method is the most generic one for every UIComponent that is bound to
+ * this Lifecycle object and the class that extends it without overriding the
* method.
*
- * According to the template type associated with the UI component (groovy or
- * javascript one); the template is rendered using either the method
- * renderJSTemplate() or renderTemplate(). In the case of the use of a groovy
- * template, a context object of type WebuiBindingContext is used to then
- * provide to the template all the necessary objects to render
+ * The template associated to the specified UIComponent is rendered using
renderTemplate(). A WebuiBindingContext
+ * context object provides the template with all the necessary objects to render.
* (WebuiBindingContext extends the Map class)
*
*/
@@ -74,7 +71,7 @@
String template = uicomponent.getTemplate();
ResourceResolver resolver = uicomponent.getTemplateResourceResolver(context,
template);
WebuiBindingContext bcontext = new WebuiBindingContext(resolver,
context.getWriter(), uicomponent, context);
- bcontext.put("uicomponent", uicomponent);
+ bcontext.put(UIComponent.UICOMPONENT, uicomponent);
bcontext.put(uicomponent.getUIComponentName(), uicomponent);
renderTemplate(template, bcontext);
}
@@ -83,16 +80,16 @@
/**
* The method allows to use Groovy templates to render the portal components.
+ *
+ * <ol>
+ * <li>Add a decorator object into the context</li>
+ * <li>Get a reference to the TemplateService</li>
+ * <li>If the system property "exo.product.developing" is set to
<code>true</code>, the templates are not cached</li>
+ * <li>If the writer used to render the output is of type HtmlValidator, which
is the case in the Portal
+ * environment, then it is also possible to validate the generated HTML (for debugging
purposes)</li>
+ * <li>The template and the context are then merged to generate the HTML
fragment</li>
+ * </ol>
*
- * 1) Add a decorator object into the context 2) Get a reference of the
- * TemplateService 3) If the system property "exo.product.developing" is
set
- * to true, the templates are not cached 4) If the writer used to render the
- * output is of type HtmlValidator, which is the case in the Portal
- * environement, then it is also possible to validate the generated HTML (for
- * debug purposes) 6) The template and the context are then merged using the
- * method service.merge(groovyTemplate, bcontext) to generate the HTML
- * fragment
- *
*/
protected void renderTemplate(String template, WebuiBindingContext bcontext) throws
Exception
{
Modified:
portal/branches/wsrp-integration/webui/portal/src/main/java/org/exoplatform/portal/webui/application/UIPortletLifecycle.java
===================================================================
---
portal/branches/wsrp-integration/webui/portal/src/main/java/org/exoplatform/portal/webui/application/UIPortletLifecycle.java 2009-12-10
14:01:49 UTC (rev 985)
+++
portal/branches/wsrp-integration/webui/portal/src/main/java/org/exoplatform/portal/webui/application/UIPortletLifecycle.java 2009-12-10
18:38:10 UTC (rev 986)
@@ -265,7 +265,7 @@
WebuiApplication app = (WebuiApplication)prcontext.getApplication();
ApplicationResourceResolver resolver = app.getResourceResolver();
WebuiBindingContext bcontext = new WebuiBindingContext(resolver,
context.getWriter(), uicomponent, prcontext);
- bcontext.put("uicomponent", uicomponent);
+ bcontext.put(UIComponent.UICOMPONENT, uicomponent);
bcontext.put("portletContent", markup);
bcontext.put("portletTitle", portletTitle);
try
Modified:
portal/branches/wsrp-integration/webui/portal/src/main/java/org/exoplatform/portal/webui/workspace/UIPortalApplication.java
===================================================================
---
portal/branches/wsrp-integration/webui/portal/src/main/java/org/exoplatform/portal/webui/workspace/UIPortalApplication.java 2009-12-10
14:01:49 UTC (rev 985)
+++
portal/branches/wsrp-integration/webui/portal/src/main/java/org/exoplatform/portal/webui/workspace/UIPortalApplication.java 2009-12-10
18:38:10 UTC (rev 986)
@@ -211,7 +211,7 @@
*
* @return True if the Portal is not in the normal mode
*/
- public boolean isEditting()
+ public boolean isEditing()
{
return (modeState != NORMAL_MODE);
}