[gatein-commits] gatein SVN: r1016 - in portal/trunk: webui/portal/src/main/java/org/exoplatform/portal/application and 2 other directories.
do-not-reply at jboss.org
do-not-reply at jboss.org
Tue Dec 15 17:58:14 EST 2009
Author: mwringe
Date: 2009-12-15 17:58:14 -0500 (Tue, 15 Dec 2009)
New Revision: 1016
Modified:
portal/trunk/web/portal/src/main/webapp/groovy/portal/webui/workspace/UIPortalApplication.gtmpl
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/application/PortalRequestContext.java
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/application/UIPortlet.java
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/application/UIPortletLifecycle.java
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/workspace/UIPortalApplication.java
Log:
Revert patch to add support for html markup headers due to performance degradation.
Modified: portal/trunk/web/portal/src/main/webapp/groovy/portal/webui/workspace/UIPortalApplication.gtmpl
===================================================================
--- portal/trunk/web/portal/src/main/webapp/groovy/portal/webui/workspace/UIPortalApplication.gtmpl 2009-12-15 21:34:37 UTC (rev 1015)
+++ portal/trunk/web/portal/src/main/webapp/groovy/portal/webui/workspace/UIPortalApplication.gtmpl 2009-12-15 22:58:14 UTC (rev 1016)
@@ -18,10 +18,10 @@
def title = rcontext.getTitle();
def metaInformation = rcontext.getMetaInformation();
%>
-<% uicomponent.processChildren();%>
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="$lang" lang="$lang" dir="$dir">
<head id="head">
- <title><%=rcontext.getTitle()%></title>
+ <title><%=title%></title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<%
if(metaInformation!= null) {
@@ -87,17 +87,6 @@
</script>
<script type="text/javascript" src="/eXoResources/javascript/eXo/i18n/I18NMessage.js"></script>
<script type="text/javascript" src="/eXoResources/javascript/eXo/i18n/MessageResource_<%=lang%>.js"></script>
-
- <%
- def headerElements = rcontext.getExtraMarkupHeaders();
- if (headerElements != null)
- {
- for (element in headerElements)
- { %>
- <%=element%>
- <% }
- }
- %>
</head>
<body style="height: 100%;">
Modified: portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/application/PortalRequestContext.java
===================================================================
--- portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/application/PortalRequestContext.java 2009-12-15 21:34:37 UTC (rev 1015)
+++ portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/application/PortalRequestContext.java 2009-12-15 22:58:14 UTC (rev 1016)
@@ -37,7 +37,6 @@
import org.exoplatform.webui.application.WebuiApplication;
import org.exoplatform.webui.application.WebuiRequestContext;
import org.exoplatform.webui.core.lifecycle.HtmlValidator;
-import org.w3c.dom.Element;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
@@ -45,10 +44,8 @@
import java.io.UnsupportedEncodingException;
import java.io.Writer;
import java.net.URLDecoder;
-import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
-import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.Set;
@@ -100,8 +97,6 @@
private Writer writer_;
protected JavascriptManager jsmanager_ = new JavascriptManager();
-
- private List<Element> extraMarkupHeaders;
public JavascriptManager getJavascriptManager()
{
@@ -298,11 +293,6 @@
}
return writer_;
}
-
- final public void setWriter(Writer writer)
- {
- this.writer_ = writer;
- }
final public boolean useAjax()
{
@@ -346,28 +336,5 @@
response_.setHeader(key, headers.get(key));
}
}
-
- /**
- * Get the extra markup headers to add to the head of the html.
- * @return The markup to be added.
- */
- public List<Element> getExtraMarkupHeaders()
- {
- return this.extraMarkupHeaders;
- }
-
- /**
- * Add an extra markup to the head of the html page.
- * @param element The element to add
- */
- public void addExtraMarkupHeader(Element element)
- {
- if (this.extraMarkupHeaders == null)
- {
- this.extraMarkupHeaders = new ArrayList<Element>();
- }
- this.extraMarkupHeaders.add(element);
- }
-
}
Modified: portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/application/UIPortlet.java
===================================================================
--- portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/application/UIPortlet.java 2009-12-15 21:34:37 UTC (rev 1015)
+++ portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/application/UIPortlet.java 2009-12-15 22:58:14 UTC (rev 1016)
@@ -751,7 +751,7 @@
invocation.setUserContext(new ExoUserContext(servletRequest, userProfile));
invocation.setWindowContext(new ExoWindowContext(storageName));
invocation.setPortalContext(new AbstractPortalContext(Collections.singletonMap(
- "javax.portlet.markup.head.element.support", "true")));
+ "javax.portlet.markup.head.element.support", "false")));
invocation.setSecurityContext(new AbstractSecurityContext(servletRequest));
//
Modified: portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/application/UIPortletLifecycle.java
===================================================================
--- portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/application/UIPortletLifecycle.java 2009-12-15 21:34:37 UTC (rev 1015)
+++ portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/application/UIPortletLifecycle.java 2009-12-15 22:58:14 UTC (rev 1016)
@@ -40,13 +40,10 @@
import org.gatein.pc.api.invocation.response.ErrorResponse;
import org.gatein.pc.api.invocation.response.FragmentResponse;
import org.gatein.pc.api.invocation.response.PortletInvocationResponse;
-import org.w3c.dom.Element;
import java.io.Serializable;
import java.nio.charset.Charset;
-import java.util.List;
-import javax.portlet.MimeResponse;
import javax.portlet.PortletMode;
import javax.portlet.WindowState;
@@ -208,30 +205,6 @@
}
}
}
-
- //setup markup headers
- if (fragmentResponse.getProperties().getMarkupHeaders() != null)
- {
- MultiValuedPropertyMap<Element> markupHeaders =
- fragmentResponse.getProperties().getMarkupHeaders();
-
- List<Element> markupElements = markupHeaders.getValues(MimeResponse.MARKUP_HEAD_ELEMENT);
- if (markupElements != null)
- {
- for (Element element : markupElements)
- {
- if ("title".equals(element.getNodeName().toLowerCase()) && element.getFirstChild() != null)
- {
- String title = element.getFirstChild().getTextContent();
- prcontext.getRequest().setAttribute(PortalRequestContext.REQUEST_TITLE, title);
- }
- else
- {
- prcontext.addExtraMarkupHeader(element);
- }
- }
- }
- }
}
}
Modified: portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/workspace/UIPortalApplication.java
===================================================================
--- portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/workspace/UIPortalApplication.java 2009-12-15 21:34:37 UTC (rev 1015)
+++ portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/workspace/UIPortalApplication.java 2009-12-15 22:58:14 UTC (rev 1016)
@@ -39,7 +39,6 @@
import org.exoplatform.services.resources.LocaleConfig;
import org.exoplatform.services.resources.LocaleConfigService;
import org.exoplatform.services.resources.Orientation;
-import org.exoplatform.web.application.RequestContext;
import org.exoplatform.web.application.javascript.JavascriptConfigService;
import org.exoplatform.webui.application.WebuiRequestContext;
import org.exoplatform.webui.config.annotation.ComponentConfig;
@@ -49,9 +48,6 @@
import org.exoplatform.webui.core.UIContainer;
import org.exoplatform.webui.event.Event;
-import java.io.CharArrayWriter;
-import java.io.IOException;
-import java.io.StringWriter;
import java.io.Writer;
import java.util.ArrayList;
import java.util.Collection;
@@ -103,11 +99,6 @@
private UserPortalConfig userPortalConfig_;
private boolean isSessionOpen = false;
-
- /**
- * Stores the child html markup
- */
- private String childMarkup;
/**
* The constructor of this class is used to build the tree of UI components
@@ -409,44 +400,7 @@
super.processDecode(context);
}
-
-
/**
- * Process the child elements storing the generated markup to be used
- * when calling renderChildren().
- * @throws Exception
- */
- public void processChildren() throws Exception
- {
- RequestContext context = RequestContext.getCurrentInstance();
- Writer oldWriter = context.getWriter();
-
- Writer writer = new CharArrayWriter();
-
- context.setWriter(writer);
- super.renderChildren();
- context.setWriter(oldWriter);
-
- childMarkup = writer.toString();
- }
-
- /**
- * This method will not do any processing of the child elements. It will take
- * the previously processed html markup for the children (see processChildren)
- * and write this to the RequestContext writer.
- */
- public void renderChildren() throws Exception
- {
- if (childMarkup != null && !childMarkup.isEmpty())
- {
- RequestContext context = RequestContext.getCurrentInstance();
- Writer writer = context.getWriter();
-
- writer.write(childMarkup);
- }
- }
-
- /**
* The processrender() method handles the creation of the returned HTML either
* for a full page render or in the case of an AJAX call The first request,
* Ajax is not enabled (means no ajaxRequest parameter in the request) and
More information about the gatein-commits
mailing list