gatein SVN: r8718 - epp/portal/branches/EPP_5_2_Branch.
by do-not-reply@jboss.org
Author: ppalaga
Date: 2012-06-11 11:05:58 -0400 (Mon, 11 Jun 2012)
New Revision: 8718
Removed:
epp/portal/branches/EPP_5_2_Branch/.settings/
Log:
Bug 830825 - Remove Eclipse metafiles .project, .classpath and .settings
12 years, 6 months
gatein SVN: r8717 - epp/portal/branches/EPP_5_2_Branch.
by do-not-reply@jboss.org
Author: ppalaga
Date: 2012-06-11 11:04:58 -0400 (Mon, 11 Jun 2012)
New Revision: 8717
Removed:
epp/portal/branches/EPP_5_2_Branch/.classpath
epp/portal/branches/EPP_5_2_Branch/.project
Log:
Bug 830825 - Remove Eclipse metafiles .project, .classpath and .settings
Deleted: epp/portal/branches/EPP_5_2_Branch/.classpath
===================================================================
--- epp/portal/branches/EPP_5_2_Branch/.classpath 2012-06-07 09:56:49 UTC (rev 8716)
+++ epp/portal/branches/EPP_5_2_Branch/.classpath 2012-06-11 15:04:58 UTC (rev 8717)
@@ -1,92 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="src" output="component/test/core/target/classes" path="component/test/core/src/main/java"/>
- <classpathentry excluding="**" kind="src" output="component/test/core/target/classes" path="component/test/core/src/main/resources"/>
- <classpathentry kind="src" output="component/test/core/target/test-classes" path="component/test/core/src/test/java"/>
- <classpathentry excluding="**" kind="src" output="component/test/core/target/test-classes" path="component/test/core/src/test/resources"/>
- <classpathentry kind="src" output="component/test/jcr/target/classes" path="component/test/jcr/src/main/java"/>
- <classpathentry excluding="**" kind="src" output="component/test/jcr/target/classes" path="component/test/jcr/src/main/resources"/>
- <classpathentry kind="src" output="component/test/jcr/target/test-classes" path="component/test/jcr/src/test/java"/>
- <classpathentry excluding="**" kind="src" output="component/test/jcr/target/test-classes" path="component/test/jcr/src/test/resources"/>
- <classpathentry kind="src" output="component/identity/target/classes" path="component/identity/src/main/java"/>
- <classpathentry kind="src" output="component/identity/target/test-classes" path="component/identity/src/test/java"/>
- <classpathentry excluding="**" kind="src" output="component/identity/target/test-classes" path="component/identity/src/test/resources"/>
- <classpathentry kind="src" output="component/test/organization/target/classes" path="component/test/organization/src/main/java"/>
- <classpathentry excluding="**" kind="src" output="component/test/organization/target/classes" path="component/test/organization/src/main/resources"/>
- <classpathentry kind="src" output="component/test/organization/target/test-classes" path="component/test/organization/src/test/java"/>
- <classpathentry kind="src" output="component/common/target/classes" path="component/common/src/main/java"/>
- <classpathentry kind="src" output="component/common/target/test-classes" path="component/common/src/test/java"/>
- <classpathentry excluding="**" kind="src" output="component/common/target/test-classes" path="component/common/src/test/resources"/>
- <classpathentry kind="src" output="component/resources/target/classes" path="component/resources/src/main/java"/>
- <classpathentry kind="src" output="component/resources/target/test-classes" path="component/resources/src/test/java"/>
- <classpathentry excluding="**" kind="src" output="component/resources/target/test-classes" path="component/resources/src/test/resources"/>
- <classpathentry kind="src" output="component/pc/target/classes" path="component/pc/src/main/java"/>
- <classpathentry kind="src" output="component/pc/target/test-classes" path="component/pc/src/test/java"/>
- <classpathentry excluding="**" kind="src" output="component/pc/target/test-classes" path="component/pc/src/test/resources"/>
- <classpathentry kind="src" output="component/portal/target/classes" path="component/portal/src/main/java"/>
- <classpathentry kind="src" output="component/portal/target/test-classes" path="component/portal/src/test/java"/>
- <classpathentry excluding="**" kind="src" output="component/portal/target/test-classes" path="component/portal/src/test/resources"/>
- <classpathentry kind="src" output="component/wsrp/target/classes" path="component/wsrp/src/main/java"/>
- <classpathentry kind="src" output="component/wsrp/target/test-classes" path="component/wsrp/src/test/java"/>
- <classpathentry excluding="**" kind="src" output="component/wsrp/target/test-classes" path="component/wsrp/src/test/resources"/>
- <classpathentry kind="src" output="component/application-registry/target/classes" path="component/application-registry/src/main/java"/>
- <classpathentry kind="src" output="component/application-registry/target/test-classes" path="component/application-registry/src/test/java"/>
- <classpathentry excluding="**" kind="src" output="component/application-registry/target/test-classes" path="component/application-registry/src/test/resources"/>
- <classpathentry kind="src" output="component/web/target/classes" path="component/web/src/main/java"/>
- <classpathentry kind="src" output="component/web/target/test-classes" path="component/web/src/test/java"/>
- <classpathentry excluding="**" kind="src" output="component/web/target/test-classes" path="component/web/src/test/resources"/>
- <classpathentry kind="src" output="component/web/resources/target/classes" path="component/web/resources/src/main/java"/>
- <classpathentry kind="src" output="component/web/resources/target/test-classes" path="component/web/resources/src/test/java"/>
- <classpathentry excluding="**" kind="src" output="component/web/resources/target/test-classes" path="component/web/resources/src/test/resources"/>
- <classpathentry kind="src" output="component/web/controller/target/classes" path="component/web/controller/src/main/java"/>
- <classpathentry kind="src" output="component/web/security/target/classes" path="component/web/security/src/main/java"/>
- <classpathentry kind="src" output="component/web/server/target/classes" path="component/web/server/src/main/java"/>
- <classpathentry kind="src" output="component/web/api/target/classes" path="component/web/api/src/main/java"/>
- <classpathentry kind="src" output="component/web/api/target/test-classes" path="component/web/api/src/test/java"/>
- <classpathentry excluding="**" kind="src" output="component/web/api/target/test-classes" path="component/web/api/src/test/resources"/>
- <classpathentry kind="src" output="component/scripting/target/classes" path="component/scripting/src/main/java"/>
- <classpathentry kind="src" output="component/scripting/target/test-classes" path="component/scripting/src/test/java"/>
- <classpathentry excluding="**" kind="src" output="component/scripting/target/test-classes" path="component/scripting/src/test/resources"/>
- <classpathentry kind="src" output="component/management/target/classes" path="component/management/src/main/java"/>
- <classpathentry kind="src" output="component/management/target/test-classes" path="component/management/src/test/java"/>
- <classpathentry excluding="**" kind="src" output="component/management/target/test-classes" path="component/management/src/test/resources"/>
- <classpathentry kind="src" output="gadgets/core/target/classes" path="gadgets/core/src/main/java"/>
- <classpathentry kind="src" output="webui/framework/target/classes" path="webui/framework/src/main/java"/>
- <classpathentry kind="src" output="webui/portlet/target/classes" path="webui/portlet/src/main/java"/>
- <classpathentry kind="src" output="webui/core/target/classes" path="webui/core/src/main/java"/>
- <classpathentry kind="src" output="webui/core/target/test-classes" path="webui/core/src/test/java"/>
- <classpathentry excluding="**" kind="src" output="webui/core/target/test-classes" path="webui/core/src/test/resources"/>
- <classpathentry kind="src" output="webui/eXo/target/classes" path="webui/eXo/src/main/java"/>
- <classpathentry kind="src" output="webui/portal/target/classes" path="webui/portal/src/main/java"/>
- <classpathentry kind="src" output="gadgets/eXoGadgets/target/classes" path="gadgets/eXoGadgets/src/main/java"/>
- <classpathentry kind="src" output="webui/dashboard/target/classes" path="webui/dashboard/src/main/java"/>
- <classpathentry excluding="**" kind="src" output="webui/dashboard/target/classes" path="webui/dashboard/src/main/resources"/>
- <classpathentry kind="src" output="portlet/dashboard/target/classes" path="portlet/dashboard/src/main/java"/>
- <classpathentry kind="src" output="portlet/exoadmin/target/classes" path="portlet/exoadmin/src/main/java"/>
- <classpathentry kind="src" output="portlet/web/target/classes" path="portlet/web/src/main/java"/>
- <classpathentry kind="src" output="server/jboss/plugin/target/classes" path="server/jboss/plugin/src/main/java"/>
- <classpathentry kind="src" output="examples/extension/config/target/classes" path="examples/extension/config/src/main/java"/>
- <classpathentry kind="src" output="examples/extension/jar/target/classes" path="examples/extension/jar/src/main/java"/>
- <classpathentry kind="src" output="examples/portal/config/target/classes" path="examples/portal/config/src/main/java"/>
- <classpathentry kind="src" output="examples/portal/jar/target/classes" path="examples/portal/jar/src/main/java"/>
- <classpathentry kind="src" output="examples/portlets/api/target/classes" path="examples/portlets/api/src/main/java"/>
- <classpathentry kind="src" output="examples/portlets/jsfhellouser/target/classes" path="examples/portlets/jsfhellouser/src/main/java"/>
- <classpathentry kind="src" output="examples/portlets/jsfhellouser/target/test-classes" path="examples/portlets/jsfhellouser/src/test/java"/>
- <classpathentry excluding="**" kind="src" output="examples/portlets/jsfhellouser/target/test-classes" path="examples/portlets/jsfhellouser/src/test/resources"/>
- <classpathentry kind="src" output="examples/portlets/jsphellouser/target/classes" path="examples/portlets/jsphellouser/src/main/java"/>
- <classpathentry kind="src" output="examples/portlets/jsphellouser/target/test-classes" path="examples/portlets/jsphellouser/src/test/java"/>
- <classpathentry excluding="**" kind="src" output="examples/portlets/jsphellouser/target/test-classes" path="examples/portlets/jsphellouser/src/test/resources"/>
- <classpathentry kind="src" output="examples/portlets/simplesthelloworld/target/classes" path="examples/portlets/simplesthelloworld/src/main/java"/>
- <classpathentry kind="src" output="examples/portlets/simplesthelloworld/target/test-classes" path="examples/portlets/simplesthelloworld/src/test/java"/>
- <classpathentry excluding="**" kind="src" output="examples/portlets/simplesthelloworld/target/test-classes" path="examples/portlets/simplesthelloworld/src/test/resources"/>
- <classpathentry kind="src" output="examples/portlets/struts-jpetstore/target/classes" path="examples/portlets/struts-jpetstore/src/main/java"/>
- <classpathentry excluding="**" kind="src" output="examples/portlets/struts-jpetstore/target/classes" path="examples/portlets/struts-jpetstore/src/main/resources"/>
- <classpathentry kind="src" output="examples/portlets/struts-jpetstore/target/test-classes" path="examples/portlets/struts-jpetstore/src/test/java"/>
- <classpathentry excluding="**" kind="src" output="examples/portlets/struts-jpetstore/target/test-classes" path="examples/portlets/struts-jpetstore/src/test/resources"/>
- <classpathentry kind="src" output="starter/war/target/classes" path="starter/war/src/main/java"/>
- <classpathentry kind="src" output="testsuite/selenium-snifftests/target/classes" path="testsuite/selenium-snifftests/src/main/java"/>
- <classpathentry kind="src" output="testsuite/webuibasedsamples/target/classes" path="testsuite/webuibasedsamples/src/main/java"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
- <classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>
- <classpathentry kind="output" path="target/classes"/>
-</classpath>
Deleted: epp/portal/branches/EPP_5_2_Branch/.project
===================================================================
--- epp/portal/branches/EPP_5_2_Branch/.project 2012-06-07 09:56:49 UTC (rev 8716)
+++ epp/portal/branches/EPP_5_2_Branch/.project 2012-06-11 15:04:58 UTC (rev 8717)
@@ -1,29 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>trunk</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.wst.common.project.facet.core.builder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.maven.ide.eclipse.maven2Builder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.jdt.core.javanature</nature>
- <nature>org.maven.ide.eclipse.maven2Nature</nature>
- <nature>org.eclipse.wst.common.project.facet.core.nature</nature>
- </natures>
-</projectDescription>
12 years, 6 months
gatein SVN: r8715 - epp/portal/branches/EPP_5_2_Branch/web/eXoResources/src/main/webapp/javascript/eXo/gadget.
by do-not-reply@jboss.org
Author: hfnukal
Date: 2012-06-07 02:54:41 -0400 (Thu, 07 Jun 2012)
New Revision: 8715
Modified:
epp/portal/branches/EPP_5_2_Branch/web/eXoResources/src/main/webapp/javascript/eXo/gadget/UIGadget.js
Log:
Bug 824855 - Strange duplicated requests in gadget rendering
Modified: epp/portal/branches/EPP_5_2_Branch/web/eXoResources/src/main/webapp/javascript/eXo/gadget/UIGadget.js
===================================================================
--- epp/portal/branches/EPP_5_2_Branch/web/eXoResources/src/main/webapp/javascript/eXo/gadget/UIGadget.js 2012-06-07 06:52:22 UTC (rev 8714)
+++ epp/portal/branches/EPP_5_2_Branch/web/eXoResources/src/main/webapp/javascript/eXo/gadget/UIGadget.js 2012-06-07 06:54:41 UTC (rev 8715)
@@ -71,7 +71,7 @@
if (userPref != null) gadget.userPrefs_ = userPref;
var gadgetBlock = document.getElementById(id);
gadgetBlock.innerHTML = "<div id='gadget_" + gadget.id + "' class='UIGadgetContent'> </div>";
- gadgets.container.renderGadgets();
+ gadgets.container.renderGadget(gadget);
var uiGadget = eXo.core.DOMUtil.findAncestorByClass(gadgetBlock, "UIGadget");
//TODO: dang.tung - isn't portlet
if (uiGadget != null) {
@@ -340,4 +340,4 @@
ajaxAsyncGetRequest(eXo.env.server.createPortalURL(containerBlockId, "SaveGadgetProperties", true, params), false);
}
-}
\ No newline at end of file
+}
12 years, 6 months
gatein SVN: r8714 - in epp/portal/branches/EPP_5_2_Branch: web/eXoResources/src/main/webapp/skin/DefaultSkin/portal/webui/component/view/UIGadget and 3 other directories.
by do-not-reply@jboss.org
Author: hfnukal
Date: 2012-06-07 02:52:22 -0400 (Thu, 07 Jun 2012)
New Revision: 8714
Modified:
epp/portal/branches/EPP_5_2_Branch/portlet/dashboard/src/main/java/org/exoplatform/gadget/webui/component/UIGadgetPortlet.java
epp/portal/branches/EPP_5_2_Branch/web/eXoResources/src/main/webapp/skin/DefaultSkin/portal/webui/component/view/UIGadget/Stylesheet.css
epp/portal/branches/EPP_5_2_Branch/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_fr.properties
epp/portal/branches/EPP_5_2_Branch/web/portal/src/main/webapp/groovy/portal/webui/application/UIGadget.gtmpl
epp/portal/branches/EPP_5_2_Branch/webui/portal/src/main/java/org/exoplatform/portal/webui/application/UIGadget.java
Log:
Bug 824860 - Error while rendering doodle gadget when source is dead
Modified: epp/portal/branches/EPP_5_2_Branch/portlet/dashboard/src/main/java/org/exoplatform/gadget/webui/component/UIGadgetPortlet.java
===================================================================
--- epp/portal/branches/EPP_5_2_Branch/portlet/dashboard/src/main/java/org/exoplatform/gadget/webui/component/UIGadgetPortlet.java 2012-06-05 14:03:10 UTC (rev 8713)
+++ epp/portal/branches/EPP_5_2_Branch/portlet/dashboard/src/main/java/org/exoplatform/gadget/webui/component/UIGadgetPortlet.java 2012-06-07 06:52:22 UTC (rev 8714)
@@ -64,6 +64,10 @@
/** User pref. */
private String userPref;
+ private JSONObject metadata;
+
+ private String url;
+
public UIGadgetPortlet() throws Exception
{
addChild(UIGadgetViewMode.class, null, null);
@@ -102,14 +106,26 @@
PortletPreferences prefs = req.getPreferences();
userPref = prefs.getValue("userPref", null);
+ url = getUrl(prefs);
+ metadata = fetchMetadata(url);
+
super.processRender(app, context);
}
public String getUrl()
{
- PortletRequestContext pcontext = (PortletRequestContext)WebuiRequestContext.getCurrentInstance();
- PortletPreferences pref = pcontext.getRequest().getPreferences();
- String urlPref = pref.getValue("url", "http://www.google.com/ig/modules/horoscope.xml");
+ return url;
+ }
+
+ public boolean isLossData()
+ {
+ return (url == null || metadata.has("error"));
+ }
+
+ private String getUrl(PortletPreferences pref)
+ {
+ String url = null;
+ String urlPref = pref.getValue("url", "local://Calendar");
if (urlPref.startsWith(LOCAL_STRING))
{
try
@@ -121,7 +137,7 @@
Gadget gadget = gadgetService.getGadget(gadgetName);
if (gadget != null)
{
- return GadgetUtil.reproduceUrl(gadget.getUrl(), gadget.isLocal());
+ url = GadgetUtil.reproduceUrl(gadget.getUrl(), gadget.isLocal());
}
else
{
@@ -129,7 +145,6 @@
{
log.warn("The local gadget '" + gadgetName + "' was not found, nothing rendered");
}
- return null;
}
}
catch (Exception e)
@@ -137,37 +152,50 @@
log.warn("Failure retrieving gadget from url!");
}
}
- return urlPref;
- }
-
- public String getMetadata()
- {
- String url = getUrl();
+ else
+ {
+ url = urlPref;
+ }
+
if (url == null)
{
WebuiRequestContext context = WebuiRequestContext.getCurrentInstance();
UIApplication uiApplication = context.getUIApplication();
uiApplication.addMessage(new ApplicationMessage("UIGadgetPortlet.msg.url-invalid", null));
}
+
+ return url;
+
+ }
- return getMetadata(url);
+ public String getMetadata()
+ {
+ if (metadata == null)
+ {
+ PortletRequestContext pcontext = (PortletRequestContext)WebuiRequestContext.getCurrentInstance();
+ PortletPreferences pref = pcontext.getRequest().getPreferences();
+ url = getUrl(pref);
+ metadata = fetchMetadata(url);
+ }
+
+ return metadata.toString();
}
- public String getMetadata(String url)
+ private JSONObject fetchMetadata(String url)
{
JSONObject metadata_ = null;
try
{
String strMetadata = GadgetUtil.fetchGagdetRpcMetadata(url);
- metadata_ = new JSONArray(strMetadata).getJSONObject(0).getJSONObject(UIGadget.RPC_RESULT).getJSONObject(url);
+ metadata_ = new JSONArray(strMetadata).getJSONObject(0).getJSONObject(UIGadget.RPC_RESULT).getJSONObject(url);
String token = GadgetUtil.createToken(url, new Long(hashCode()));
metadata_.put("secureToken", token);
}
catch (JSONException e)
{
- e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates.
+ log.warn("Unable to retrieve metadata of url: " + url, e);
}
- return metadata_.toString();
+ return metadata_;
}
static public class SaveUserPrefActionListener extends EventListener<UIGadgetPortlet>
Modified: epp/portal/branches/EPP_5_2_Branch/web/eXoResources/src/main/webapp/skin/DefaultSkin/portal/webui/component/view/UIGadget/Stylesheet.css
===================================================================
--- epp/portal/branches/EPP_5_2_Branch/web/eXoResources/src/main/webapp/skin/DefaultSkin/portal/webui/component/view/UIGadget/Stylesheet.css 2012-06-05 14:03:10 UTC (rev 8713)
+++ epp/portal/branches/EPP_5_2_Branch/web/eXoResources/src/main/webapp/skin/DefaultSkin/portal/webui/component/view/UIGadget/Stylesheet.css 2012-06-07 06:52:22 UTC (rev 8714)
@@ -1,4 +1,3 @@
-
/*************************************** UIGadget **************************************/
.UIWindow .UIGadgetPortlet {
@@ -81,6 +80,7 @@
border: 1px solid #c3c3c3;
border-top: none;
padding: 3px;
+ word-wrap: break-word;
}
.UIGadget iframe {
Modified: epp/portal/branches/EPP_5_2_Branch/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_fr.properties
===================================================================
--- epp/portal/branches/EPP_5_2_Branch/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_fr.properties 2012-06-05 14:03:10 UTC (rev 8713)
+++ epp/portal/branches/EPP_5_2_Branch/web/portal/src/main/webapp/WEB-INF/classes/locale/portal/webui_fr.properties 2012-06-07 06:52:22 UTC (rev 8714)
@@ -1268,6 +1268,7 @@
UIGadget.tooltip.Unmaximize=Restaurer Again
UIGadget.tooltip.editGadget=Editer la Gadget
UIGadget.tooltip.deleteGadget=Supprimer la Gadget
+UIGadget.error.NotAvailable=Erreurs lors de laïcs fichier de spécification de gadget
UIUserToolBarDashboard.page.Tab_Default=Cliquez pour renommer
Modified: epp/portal/branches/EPP_5_2_Branch/web/portal/src/main/webapp/groovy/portal/webui/application/UIGadget.gtmpl
===================================================================
--- epp/portal/branches/EPP_5_2_Branch/web/portal/src/main/webapp/groovy/portal/webui/application/UIGadget.gtmpl 2012-06-05 14:03:10 UTC (rev 8713)
+++ epp/portal/branches/EPP_5_2_Branch/web/portal/src/main/webapp/groovy/portal/webui/application/UIGadget.gtmpl 2012-06-07 06:52:22 UTC (rev 8714)
@@ -11,23 +11,21 @@
def posY = uicomponent.getProperties().getIntValue("locationY") + "px";
def zIndex = uicomponent.getProperties().getIntValue("zIndex");
def id = uicomponent.getId() != null ? uicomponent.getId() : "UIGadget";
- def isDev = uicomponent.isGadgetDeveloper();
- def noCache = uicomponent.isNoCache();
- def isDebug = uicomponent.isDebug();
def view = uicomponent.getView();
def userPref = null;
def isLossData = uicomponent.isLossData();
if(!isLossData) {
- url = uicomponent.getUrl();
+ url = uicomponent.getUrl();
metadata = uicomponent.getRpcMetadata();
userPref = uicomponent.getUserPref();
+ def noCache = uicomponent.isNoCache();
+ def isDebug = uicomponent.isDebug();
jsmanager.importJavascript("eXo.gadget.UIGadget");
- rcontext.getJavascriptManager().addCustomizedOnLoadScript("eXo.gadget.UIGadget.confirmDeleteGadget = '" + _ctx.appRes("UIGadgetContainerManagement.confirm.DeleteGadget") + "';");
- jsmanager.addCustomizedOnLoadScript("eXo.gadget.UIGadget.createGadget('$url','content-$id', $metadata, $userPref, '$view', '$hostName', " + (isDev ? 1 : 0)
- + ", " + (isDebug ? 1 : 0) + ", " + (noCache ? 1 : 0) + ");");
+ jsmanager.addCustomizedOnLoadScript("eXo.gadget.UIGadget.confirmDeleteGadget = '" + _ctx.appRes("UIGadgetContainerManagement.confirm.DeleteGadget") + "';");
+ jsmanager.addCustomizedOnLoadScript("eXo.gadget.UIGadget.createGadget('$url','content-$id', $metadata, $userPref, '$view', '$hostName', " + (isDebug ? 1 : 0) + ", " + (noCache ? 1 : 0) + ");");
}
-
+
boolean isMini = Boolean.parseBoolean(uicomponent.getProperties().get("minimized"));
String miniTitle = _ctx.appRes("UIGadget.tooltip.Minimize");
String unminiTitle = _ctx.appRes("UIGadget.tooltip.Unminimize");
@@ -50,9 +48,9 @@
<span class="GadgetTitle" style="display: <%=isLossData ? "block" : "none"; %> ; float: none; width: auto; margin-right: 75px"><%= uicomponent.getApplicationName() %></span>
</div>
<div class="GadgetApplication" id="content-$id" style="display:<%= Boolean.parseBoolean(uicomponent.getProperties().get("minimized")) ? "none": "block"; %>">
- <% if(isLossData) {%>
- <%=_ctx.appRes("UIGadget.message.isLossData")%>
- <% } %>
+ <% if(isLossData) { %>
+ <span><%=_ctx.appRes("UIGadget.error.NotAvailable");%></span>
+ <% } %>
</div>
<div class="UIMask" style="display: none; border:solid 1px red"><span></span></div>
-</div>
+</div>
Modified: epp/portal/branches/EPP_5_2_Branch/webui/portal/src/main/java/org/exoplatform/portal/webui/application/UIGadget.java
===================================================================
--- epp/portal/branches/EPP_5_2_Branch/webui/portal/src/main/java/org/exoplatform/portal/webui/application/UIGadget.java 2012-06-05 14:03:10 UTC (rev 8713)
+++ epp/portal/branches/EPP_5_2_Branch/webui/portal/src/main/java/org/exoplatform/portal/webui/application/UIGadget.java 2012-06-07 06:52:22 UTC (rev 8714)
@@ -50,9 +50,7 @@
* 2008
*/
@ComponentConfig(template = "system:/groovy/portal/webui/application/UIGadget.gtmpl", events = {
- @EventConfig(listeners = UIGadget.SaveUserPrefActionListener.class),
- @EventConfig(listeners = UIGadget.SetNoCacheActionListener.class),
- @EventConfig(listeners = UIGadget.SetDebugActionListener.class)})
+ @EventConfig(listeners = UIGadget.SaveUserPrefActionListener.class)})
/**
* This class represents user interface gadgets, it using UIGadget.gtmpl for
* rendering UI in eXo. It mapped to Application model in page or container.
@@ -96,6 +94,8 @@
public static final String METADATA_MODULEPREFS = "modulePrefs";
+ public static final String METADATA_ERROR = "error";
+
public static final String RPC_RESULT = "result";
public static final String METADATA_USERPREFS_TYPE = "dataType";
@@ -234,15 +234,18 @@
}
}
+ /**
+ * Get metadata of this gadget application
+ * This metadata contains both metadata of gadget specification (.xml file) and a token from container
+ * @return String represent metadata of gadget
+ */
public String getRpcMetadata()
{
try
{
if (metadata_ == null)
{
- String gadgetUrl = getUrl();
- String strMetadata = GadgetUtil.fetchGagdetRpcMetadata(gadgetUrl);
- metadata_ = new JSONArray(strMetadata).getJSONObject(0).getJSONObject(UIGadget.RPC_RESULT).getJSONObject(gadgetUrl);
+ metadata_ = fetchRpcMetadata();
}
String token = GadgetUtil.createToken(this.getUrl(), new Random().nextLong());
metadata_.put("secureToken", token);
@@ -254,6 +257,23 @@
}
}
+ private JSONObject fetchRpcMetadata()
+ {
+ try
+ {
+ String gadgetUrl = getUrl();
+ String strMetadata = GadgetUtil.fetchGagdetRpcMetadata(gadgetUrl);
+ JSONObject metadata =
+ new JSONArray(strMetadata).getJSONObject(0).getJSONObject(UIGadget.RPC_RESULT).getJSONObject(gadgetUrl);
+
+ return metadata;
+ }
+ catch (JSONException e)
+ {
+ return null;
+ }
+ }
+
/**
* Check if content of gadget has <UserPref>? (Content is parsed from gadget specification in .xml file)
* @return boolean
@@ -298,6 +318,16 @@
{
throw new Exception();
}
+
+ if (metadata_ == null)
+ {
+ metadata_ = fetchRpcMetadata();
+ }
+
+ if (metadata_ == null || metadata_.has(METADATA_ERROR))
+ {
+ throw new Exception();
+ }
}
catch (Exception e)
{
@@ -478,31 +508,4 @@
//event.getRequestContext().setResponseComplete(true);
}
}
-
- static public class SetNoCacheActionListener extends EventListener<UIGadget>
- {
- public void execute(Event<UIGadget> event) throws Exception
- {
- /*
- * String noCache =
- * event.getRequestContext().getRequestParameter("nocache") ; UIGadget
- * uiGadget = event.getSource() ;
- * uiGadget.setNoCache(noCache.equals("1"));
- */
- event.getRequestContext().setResponseComplete(true);
- }
- }
-
- static public class SetDebugActionListener extends EventListener<UIGadget>
- {
- public void execute(Event<UIGadget> event) throws Exception
- {
- /*
- * String debug = event.getRequestContext().getRequestParameter("debug") ;
- * UIGadget uiGadget = event.getSource() ;
- * uiGadget.setDebug(debug.equals("1"));
- */
- event.getRequestContext().setResponseComplete(true);
- }
- }
}
12 years, 6 months
gatein SVN: r8713 - in epp/portal/branches/EPP_5_2_Branch/component/scripting/src: test/java/org/exoplatform/groovyscript and 1 other directory.
by do-not-reply@jboss.org
Author: hfnukal
Date: 2012-06-05 10:03:10 -0400 (Tue, 05 Jun 2012)
New Revision: 8713
Modified:
epp/portal/branches/EPP_5_2_Branch/component/scripting/src/main/java/org/exoplatform/groovyscript/GroovyPrinter.java
epp/portal/branches/EPP_5_2_Branch/component/scripting/src/test/java/org/exoplatform/groovyscript/TestTemplateRendering.java
Log:
Bug 824863 - groovy template should not print "null" string when variable is null
Modified: epp/portal/branches/EPP_5_2_Branch/component/scripting/src/main/java/org/exoplatform/groovyscript/GroovyPrinter.java
===================================================================
--- epp/portal/branches/EPP_5_2_Branch/component/scripting/src/main/java/org/exoplatform/groovyscript/GroovyPrinter.java 2012-05-31 21:18:12 UTC (rev 8712)
+++ epp/portal/branches/EPP_5_2_Branch/component/scripting/src/main/java/org/exoplatform/groovyscript/GroovyPrinter.java 2012-06-05 14:03:10 UTC (rev 8713)
@@ -125,7 +125,7 @@
Object f = format(o);
if (f == null)
{
- return "null";
+ return "";
}
else if (f instanceof String)
{
@@ -152,6 +152,10 @@
for (int i = 0;i < values.length;i++)
{
values[i] = format(values[i]);
+ if (values[i] == null)
+ {
+ values[i] = "";
+ }
}
write(o.toString());
}
Modified: epp/portal/branches/EPP_5_2_Branch/component/scripting/src/test/java/org/exoplatform/groovyscript/TestTemplateRendering.java
===================================================================
--- epp/portal/branches/EPP_5_2_Branch/component/scripting/src/test/java/org/exoplatform/groovyscript/TestTemplateRendering.java 2012-05-31 21:18:12 UTC (rev 8712)
+++ epp/portal/branches/EPP_5_2_Branch/component/scripting/src/test/java/org/exoplatform/groovyscript/TestTemplateRendering.java 2012-06-05 14:03:10 UTC (rev 8713)
@@ -189,6 +189,15 @@
assertEquals("\"", s);
}
+ public void testNullVariable() throws Exception
+ {
+ GroovyTemplate template = new GroovyTemplate("<% out.print(\"${foo}\") %>");
+ Map<String, String> context = new HashMap<String, String>();
+ context.put("foo", null);
+ String s = template.render(context);
+ assertEquals("", s);
+ }
+
public void testFooFoo() throws Exception
{
InputStream in = Thread.currentThread().getContextClassLoader().getResourceAsStream("UIPortalApplication.gtmpl");
12 years, 6 months