Author: trong.tran
Date: 2010-11-30 05:03:04 -0500 (Tue, 30 Nov 2010)
New Revision: 5382
Modified:
exo/portal/branches/standalone/web/portal/src/main/webapp/WEB-INF/web.xml
exo/portal/branches/standalone/web/portal/src/main/webapp/groovy/portal/webui/application/UIStandaloneAppContainer.gtmpl
exo/portal/branches/standalone/webui/core/src/main/java/org/exoplatform/webui/application/WebuiApplication.java
exo/portal/branches/standalone/webui/portal/src/main/java/conf/portal/configuration.xml
exo/portal/branches/standalone/webui/portal/src/main/java/org/exoplatform/portal/application/StandaloneAppRequestHandler.java
exo/portal/branches/standalone/webui/portal/src/main/java/org/exoplatform/portal/application/StandaloneApplication.java
exo/portal/branches/standalone/webui/portal/src/main/java/org/exoplatform/portal/webui/workspace/UIStandaloneApplication.java
Log:
Move the standalone webui configuration to its corresponding handler
Modified: exo/portal/branches/standalone/web/portal/src/main/webapp/WEB-INF/web.xml
===================================================================
--- exo/portal/branches/standalone/web/portal/src/main/webapp/WEB-INF/web.xml 2010-11-30
09:09:44 UTC (rev 5381)
+++ exo/portal/branches/standalone/web/portal/src/main/webapp/WEB-INF/web.xml 2010-11-30
10:03:04 UTC (rev 5382)
@@ -186,10 +186,6 @@
<param-name>webui.configuration</param-name>
<param-value>app:/WEB-INF/webui-configuration.xml</param-value>
</init-param>
- <init-param>
- <param-name>standalone.webui.configuration</param-name>
-
<param-value>app:/WEB-INF/standalone-webui-configuration.xml</param-value>
- </init-param>
<load-on-startup>1</load-on-startup>
</servlet>
Modified:
exo/portal/branches/standalone/web/portal/src/main/webapp/groovy/portal/webui/application/UIStandaloneAppContainer.gtmpl
===================================================================
---
exo/portal/branches/standalone/web/portal/src/main/webapp/groovy/portal/webui/application/UIStandaloneAppContainer.gtmpl 2010-11-30
09:09:44 UTC (rev 5381)
+++
exo/portal/branches/standalone/web/portal/src/main/webapp/groovy/portal/webui/application/UIStandaloneAppContainer.gtmpl 2010-11-30
10:03:04 UTC (rev 5382)
@@ -1,4 +1,5 @@
<div class="UIStandaloneAppContainer"
id="<%=uicomponent.getId()%>">
+
<%
if (uicomponent.isLossData()) {
print("Can not render this gadget</div>");
@@ -8,7 +9,11 @@
uicomponent.renderChild(uicomponent.currApp);
} else {
%>
- <div class="Icon">Not have permission</div>
- <div class="Icon"><a
href="<%=uicomponent.url("Logout")%>">Login with other
UserName</a> </div>
+ <div style="text-align: center; padding: 25px 0px; background: #000;
border-top: 1px solid #FFFFFF; border-bottom: 1px solid #FFFFFF; margin-top:
30px;">
+ <div class="Icon" style="color: red; font-size: 20px; margin-bottom:
5px;">You have no right to access this application</div>
+ <div class="Icon"><a
href="<%=uicomponent.url("Logout")%>" style="color:
#2C6FBD; font-size: 12px; text-decoration: underline;">Login with other
UserName</a> </div>
+ </div>
<% } %>
</div>
+
+
Modified:
exo/portal/branches/standalone/webui/core/src/main/java/org/exoplatform/webui/application/WebuiApplication.java
===================================================================
---
exo/portal/branches/standalone/webui/core/src/main/java/org/exoplatform/webui/application/WebuiApplication.java 2010-11-30
09:09:44 UTC (rev 5381)
+++
exo/portal/branches/standalone/webui/core/src/main/java/org/exoplatform/webui/application/WebuiApplication.java 2010-11-30
10:03:04 UTC (rev 5382)
@@ -20,7 +20,6 @@
package org.exoplatform.webui.application;
import org.exoplatform.web.application.Application;
-import org.exoplatform.web.application.ApplicationLifecycle;
import org.exoplatform.webui.Util;
import org.exoplatform.webui.config.Component;
import org.exoplatform.webui.core.UIComponent;
@@ -68,11 +67,8 @@
String stateManagerClass = configManager_.getApplication().getStateManager();
StateManager stManager = (StateManager)Util.createObject(stateManagerClass, null);
setStateManager(stManager);
- List<ApplicationLifecycle> lifecycleListeners =
- configManager_.getApplication().getApplicationLifecycleListeners();
- setApplicationLifecycle(lifecycleListeners);
- for (ApplicationLifecycle lifecycle : lifecycleListeners)
- lifecycle.onInit(this);
+
setApplicationLifecycle(configManager_.getApplication().getApplicationLifecycleListeners());
+ super.onInit();
}
public ConfigurationManager getConfigurationManager()
Modified:
exo/portal/branches/standalone/webui/portal/src/main/java/conf/portal/configuration.xml
===================================================================
---
exo/portal/branches/standalone/webui/portal/src/main/java/conf/portal/configuration.xml 2010-11-30
09:09:44 UTC (rev 5381)
+++
exo/portal/branches/standalone/webui/portal/src/main/java/conf/portal/configuration.xml 2010-11-30
10:03:04 UTC (rev 5382)
@@ -47,6 +47,12 @@
<name>StandaloneAppRequestHandler</name>
<set-method>register</set-method>
<type>org.exoplatform.portal.application.StandaloneAppRequestHandler</type>
+ <init-params>
+ <value-param>
+ <name>webui.configuration</name>
+
<value>app:/WEB-INF/standalone-webui-configuration.xml</value>
+ </value-param>
+ </init-params>
</component-plugin>
</external-component-plugins>
</configuration>
Modified:
exo/portal/branches/standalone/webui/portal/src/main/java/org/exoplatform/portal/application/StandaloneAppRequestHandler.java
===================================================================
---
exo/portal/branches/standalone/webui/portal/src/main/java/org/exoplatform/portal/application/StandaloneAppRequestHandler.java 2010-11-30
09:09:44 UTC (rev 5381)
+++
exo/portal/branches/standalone/webui/portal/src/main/java/org/exoplatform/portal/application/StandaloneAppRequestHandler.java 2010-11-30
10:03:04 UTC (rev 5382)
@@ -23,12 +23,25 @@
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
+import org.exoplatform.container.xml.InitParams;
+import org.exoplatform.container.xml.ValueParam;
import org.exoplatform.web.WebAppController;
public class StandaloneAppRequestHandler extends PortalRequestHandler
{
+
+ private String webuiConfigPath;
+ public StandaloneAppRequestHandler(InitParams params)
+ {
+ ValueParam valueParam = params.getValueParam("webui.configuration");
+ if (valueParam != null)
+ {
+ webuiConfigPath = valueParam.getValue();
+ }
+ }
+
private String[] PATHS = {"/standalone"};
public String[] getPath()
@@ -40,6 +53,7 @@
public void onInit(WebAppController controller, ServletConfig sConfig) throws
Exception
{
StandaloneApplication standaloneApplication = new StandaloneApplication(sConfig);
+ standaloneApplication.setWebUIConfigPath(webuiConfigPath);
standaloneApplication.onInit();
controller.addApplication(standaloneApplication);
}
@@ -51,10 +65,7 @@
StandaloneApplication app =
controller.getApplication(StandaloneApplication.STANDALONE_APPLICATION_ID);
StandaloneAppRequestContext context = new StandaloneAppRequestContext(app, req,
res);
-// if (context.getPortalOwner().length() == 0) {
-// res.sendRedirect(req.getContextPath());
-// return;
-// }
+
processRequest(context, app);
}
}
Modified:
exo/portal/branches/standalone/webui/portal/src/main/java/org/exoplatform/portal/application/StandaloneApplication.java
===================================================================
---
exo/portal/branches/standalone/webui/portal/src/main/java/org/exoplatform/portal/application/StandaloneApplication.java 2010-11-30
09:09:44 UTC (rev 5381)
+++
exo/portal/branches/standalone/webui/portal/src/main/java/org/exoplatform/portal/application/StandaloneApplication.java 2010-11-30
10:03:04 UTC (rev 5382)
@@ -23,6 +23,7 @@
public class StandaloneApplication extends PortalApplication
{
+ private String webuiConfigPath;
final static public String STANDALONE_APPLICATION_ID =
"StandaloneApplication";
@@ -31,14 +32,22 @@
super(config);
}
+ public void setWebUIConfigPath(String path)
+ {
+ webuiConfigPath = path;
+ }
public String getApplicationId()
{
return STANDALONE_APPLICATION_ID;
}
-
+
public String getApplicationInitParam(String name)
{
+ if ("webui.configuration".equals(name))
+ {
+ return webuiConfigPath;
+ }
return getServletConfig().getInitParameter("standalone." + name);
}
}
Modified:
exo/portal/branches/standalone/webui/portal/src/main/java/org/exoplatform/portal/webui/workspace/UIStandaloneApplication.java
===================================================================
---
exo/portal/branches/standalone/webui/portal/src/main/java/org/exoplatform/portal/webui/workspace/UIStandaloneApplication.java 2010-11-30
09:09:44 UTC (rev 5381)
+++
exo/portal/branches/standalone/webui/portal/src/main/java/org/exoplatform/portal/webui/workspace/UIStandaloneApplication.java 2010-11-30
10:03:04 UTC (rev 5382)
@@ -104,25 +104,8 @@
{
PortalRequestContext pcontext = (PortalRequestContext)context;
-// if (getUIPopupMessages().hasMessage())
-// {
-// pcontext.addUIComponentToUpdateByAjax(getUIPopupMessages());
-// }
-
Set<UIComponent> list = context.getUIComponentToUpdateByAjax();
-// List<UIPortlet> uiPortlets = new ArrayList<UIPortlet>(3);
-// List<UIComponent> uiDataComponents = new
ArrayList<UIComponent>(5);
-// if (list != null)
-// {
-// for (UIComponent uicomponent : list)
-// {
-// if (uicomponent instanceof UIPortlet)
-// uiPortlets.add((UIPortlet)uicomponent);
-// else
-// uiDataComponents.add(uicomponent);
-// }
-// }
w.write("<div class=\"PortalResponse\">");
w.write("<div class=\"PortalResponseData\">");
if (list != null)
@@ -138,31 +121,6 @@
}
w.write("</div>");
-// if (!context.getFullRender())
-// {
-// for (UIPortlet uiPortlet : uiPortlets)
-// {
-// if (log.isDebugEnabled())
-// log.debug("AJAX call: Need to refresh the Portlet " +
uiPortlet.getId());
-//
-// w.write("<div class=\"PortletResponse\"
style=\"display: none\">");
-// w.append("<div
class=\"PortletResponsePortletId\">" + uiPortlet.getId() +
"</div>");
-// w.append("<div
class=\"PortletResponseData\">");
-//
-// /*
-// * If the portlet is using our UI framework or supports it then
-// * it will return a set of block to updates. If there is not
-// * block to update the javascript client will see that as a full
-// * refresh of the content part
-// */
-// uiPortlet.processRender(context);
-//
-// w.append("</div>");
-// w.append("<div
class=\"PortletResponseScript\"></div>");
-// w.write("</div>");
-// }
-// }
-
w.write("<div class=\"PortalResponseScript\">");
pcontext.getJavascriptManager().writeJavascript(w);
w.write("eXo.core.Browser.onLoad();\n");
@@ -182,7 +140,6 @@
{
SkinService skinService = getApplicationComponent(SkinService.class);
Collection<Skin> skins = new
ArrayList<Skin>(skinService.getPortalSkins(skin_));
-// Collection<Skin> skins = new ArrayList<Skin>();
return skins;
}
Show replies by date