Author: hfnukal
Date: 2011-11-02 14:23:12 -0400 (Wed, 02 Nov 2011)
New Revision: 7941
Modified:
epp/portal/branches/EPP_5_2_Branch/component/
epp/portal/branches/EPP_5_2_Branch/distribution/
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/javascript/eXo/gadget/ExoBasedUserPrefStore.js
epp/portal/branches/EPP_5_2_Branch/wsrp-integration/
Log:
JBEPP-1054 Remove gadget wrapper portlet from default applications
Property changes on: epp/portal/branches/EPP_5_2_Branch/component
___________________________________________________________________
Modified: svn:mergeinfo
- /epp/portal/branches/EPP_5_1_0_GA_JBEPP-795/component:5868
/portal/branches/branch-GTNPORTAL-1592/component:4868,4894
/portal/branches/branch-GTNPORTAL-1643/component:5002,5063,5167
/portal/branches/branch-GTNPORTAL-1700/component:5348,5363,5402,5445
/portal/branches/branch-GTNPORTAL-1731/component:5622,5644,5668
/portal/branches/branch-GTNPORTAL-1745/component:5765
/portal/branches/branch-GTNPORTAL-1790/component:5871
/portal/branches/branch-GTNPORTAL-1822/component:5943,5952
/portal/branches/branch-GTNPORTAL-1832/component:6030,6063
/portal/branches/branch-GTNPORTAL-1872/component:6400,6551
/portal/branches/branch-GTNPORTAL-1921/component:6603,6771-6772,6774
/portal/branches/branch-GTNPORTAL-1963/component:6904,6915-6916
/portal/trunk/component:4876,4891,5269,5744,5822,5943,6031,6033,6168,6196,6201-6203,6205-6206,6223,6292,6323,6437,6440,6449,6452,6573,6783-6784,6912-6913,6960,7042,7061,7085,7095,7117,7120,7125,7132-7134,7186,7239,7262,7308,7326,7330-7334,7359,7367,7412,7433,7450-7452,7454,7478,7497,7500,7552,7554-7555,7570-7571,7573,7577,7598,7614-7615,7695-7696,7701-7704,7748,7780,7877
+ /epp/portal/branches/EPP_5_1_0_GA_JBEPP-795/component:5868
/portal/branches/branch-GTNPORTAL-1592/component:4868,4894
/portal/branches/branch-GTNPORTAL-1643/component:5002,5063,5167
/portal/branches/branch-GTNPORTAL-1700/component:5348,5363,5402,5445
/portal/branches/branch-GTNPORTAL-1731/component:5622,5644,5668
/portal/branches/branch-GTNPORTAL-1745/component:5765
/portal/branches/branch-GTNPORTAL-1790/component:5871
/portal/branches/branch-GTNPORTAL-1822/component:5943,5952
/portal/branches/branch-GTNPORTAL-1832/component:6030,6063
/portal/branches/branch-GTNPORTAL-1872/component:6400,6551
/portal/branches/branch-GTNPORTAL-1921/component:6603,6771-6772,6774
/portal/branches/branch-GTNPORTAL-1963/component:6904,6915-6916
/portal/trunk/component:4876,4891,5269,5744,5822,5943,6031,6033,6168,6196,6201-6203,6205-6206,6223,6292,6323,6437,6440,6449,6452,6573,6783-6784,6912-6913,6960,7042,7061,7085,7095,7117,7120,7125,7132-7134,7186,7239,7262,7308,7326,7330-7334,7359,7367,7412,7433,7450-7452,7454,7478,7497,7500,7552,7554-7555,7570-7571,7573,7577,7598,7614-7615,7695-7696,7701-7704,7737,7741,7748,7773,7780,7877,7906
Property changes on: epp/portal/branches/EPP_5_2_Branch/distribution
___________________________________________________________________
Added: svn:ignore
+ target
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 2011-11-02
18:15:04 UTC (rev 7940)
+++
epp/portal/branches/EPP_5_2_Branch/portlet/dashboard/src/main/java/org/exoplatform/gadget/webui/component/UIGadgetPortlet.java 2011-11-02
18:23:12 UTC (rev 7941)
@@ -26,14 +26,18 @@
import org.exoplatform.container.ExoContainerContext;
import org.exoplatform.portal.webui.application.GadgetUtil;
import org.exoplatform.portal.webui.application.UIGadget;
+import org.exoplatform.portal.webui.util.Util;
import org.exoplatform.web.application.ApplicationMessage;
import org.exoplatform.webui.application.WebuiApplication;
import org.exoplatform.webui.application.WebuiRequestContext;
import org.exoplatform.webui.application.portlet.PortletRequestContext;
import org.exoplatform.webui.config.annotation.ComponentConfig;
+import org.exoplatform.webui.config.annotation.EventConfig;
import org.exoplatform.webui.core.UIApplication;
import org.exoplatform.webui.core.UIPortletApplication;
import org.exoplatform.webui.core.lifecycle.UIApplicationLifecycle;
+import org.exoplatform.webui.event.Event;
+import org.exoplatform.webui.event.EventListener;
import org.gatein.common.logging.Logger;
import org.gatein.common.logging.LoggerFactory;
import org.json.JSONArray;
@@ -49,7 +53,8 @@
* tungcnw(a)gmail.com
* June 27, 2008
*/
-@ComponentConfig(lifecycle = UIApplicationLifecycle.class, template =
"app:/groovy/gadget/webui/component/UIGadgetPortlet.gtmpl")
+@ComponentConfig(lifecycle = UIApplicationLifecycle.class, template =
"app:/groovy/gadget/webui/component/UIGadgetPortlet.gtmpl", events = {
+ @EventConfig(listeners = UIGadgetPortlet.SaveUserPrefActionListener.class)})
public class UIGadgetPortlet extends UIPortletApplication
{
final static public String LOCAL_STRING = "local://";
@@ -68,17 +73,20 @@
{
return userPref;
}
+
+ public void setUserPref(String pref)
+ {
+ this.userPref = pref;
+ }
@Override
public void processAction(WebuiRequestContext context) throws Exception
{
super.processAction(context);
- //
PortletRequest req = context.getRequest();
+ userPref = req.getParameter("userPref");
- //
- userPref = req.getParameter("userPref");
if (userPref != null && !userPref.isEmpty())
{
PortletPreferences prefs = req.getPreferences();
@@ -86,15 +94,14 @@
prefs.store();
}
}
-
+
@Override
public void processRender(WebuiApplication app, WebuiRequestContext context) throws
Exception
{
PortletRequest req = context.getRequest();
PortletPreferences prefs = req.getPreferences();
userPref = prefs.getValue("userPref", null);
-
- //
+
super.processRender(app, context);
}
@@ -162,4 +169,23 @@
}
return metadata_.toString();
}
+
+ static public class SaveUserPrefActionListener extends
EventListener<UIGadgetPortlet>
+ {
+ public void execute(Event<UIGadgetPortlet> event) throws Exception
+ {
+ PortletRequest req = event.getRequestContext().getRequest();
+ String userPref = req.getParameter("userPref");
+ if (userPref != null && !userPref.isEmpty())
+ {
+ PortletPreferences prefs = req.getPreferences();
+ prefs.setValue("userPref", userPref);
+ prefs.store();
+
+ UIGadgetPortlet gadgetPortlet = (UIGadgetPortlet) event.getSource();
+ gadgetPortlet.setUserPref(userPref);
+ }
+ Util.getPortalRequestContext().setResponseComplete(true);
+ }
+ }
}
Modified:
epp/portal/branches/EPP_5_2_Branch/web/eXoResources/src/main/webapp/javascript/eXo/gadget/ExoBasedUserPrefStore.js
===================================================================
---
epp/portal/branches/EPP_5_2_Branch/web/eXoResources/src/main/webapp/javascript/eXo/gadget/ExoBasedUserPrefStore.js 2011-11-02
18:15:04 UTC (rev 7940)
+++
epp/portal/branches/EPP_5_2_Branch/web/eXoResources/src/main/webapp/javascript/eXo/gadget/ExoBasedUserPrefStore.js 2011-11-02
18:23:12 UTC (rev 7941)
@@ -17,7 +17,6 @@
* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
*/
-
gadgets.ExoBasedUserPrefStore = function() {
gadgets.UserPrefStore.call(this);
};
@@ -34,12 +33,16 @@
var DOMUtil = eXo.core.DOMUtil;
var gadget = document.getElementById("gadget_" + gadget.id) ;
if(gadget != null ) {
+ var uicomponent = gadget.parentNode.id.replace(/^content-/,"");
var portletFragment = DOMUtil.findAncestorByClass(gadget,
"PORTLET-FRAGMENT");
- var uiGadget = gadget.parentNode;
+ var gadgetPortlet = DOMUtil.findAncestorByClass(gadget, "UIGadgetPortlet");
+ if(gadgetPortlet != null) {
+ uicomponent = gadgetPortlet.id;
+ }
if (portletFragment != null) {
var compId = portletFragment.parentNode.id;
var href = eXo.env.server.portalBaseURL + "?portal:componentId=" + compId;
- href += "&portal:type=action&uicomponent=" +
uiGadget.id.replace(/^content-/,"");
+ href += "&portal:type=action&uicomponent=" + uicomponent;
href += "&op=SaveUserPref";
href += "&ajaxRequest=true";
href += "&userPref=" + prefs;
@@ -48,11 +51,9 @@
var params = [
{name : "userPref", value : prefs}
] ;
- ajaxGet(eXo.env.server.createPortalURL(uiGadget.id.replace(/^content-/,""),
"SaveUserPref", true, params),true) ;
+ ajaxGet(eXo.env.server.createPortalURL(uicomponent, "SaveUserPref", true,
params),true) ;
}
}
};
-gadgets.Container.prototype.userPrefStore =
- new gadgets.ExoBasedUserPrefStore();
-//}
\ No newline at end of file
+gadgets.Container.prototype.userPrefStore = new gadgets.ExoBasedUserPrefStore();
\ No newline at end of file
Property changes on: epp/portal/branches/EPP_5_2_Branch/wsrp-integration
___________________________________________________________________
Modified: svn:mergeinfo
- /epp/portal/branches/EPP_5_1_0_GA_JBEPP-795/wsrp-integration:5868
/portal/branches/branch-GTNPORTAL-1592/wsrp-integration:4868,4894
/portal/branches/branch-GTNPORTAL-1643/wsrp-integration:5002,5063,5167
/portal/branches/branch-GTNPORTAL-1700/wsrp-integration:5348,5363,5402,5445
/portal/branches/branch-GTNPORTAL-1731/wsrp-integration:5622,5644,5668
/portal/branches/branch-GTNPORTAL-1745/wsrp-integration:5765
/portal/branches/branch-GTNPORTAL-1790/wsrp-integration:5871
/portal/branches/branch-GTNPORTAL-1822/wsrp-integration:5943,5952
/portal/branches/branch-GTNPORTAL-1832/wsrp-integration:6030,6063
/portal/branches/branch-GTNPORTAL-1872/wsrp-integration:6400,6551
/portal/branches/branch-GTNPORTAL-1921/wsrp-integration:6603,6771-6772,6774
/portal/branches/branch-GTNPORTAL-1963/wsrp-integration:6904,6915-6916
/portal/branches/decoupled-webos/wsrp-integration:6214-6243
/portal/branches/gatein-management/wsrp-integration:6920-6958
/portal/branches/global-portlet-metadata/wsrp-integration:6298-6384
/portal/branches/site-describability/wsrp-integration:6171-6235
/portal/trunk/wsrp-integration:4876,4891,5269,5744,5822,5943,6168,6196,6201-6203,6205-6206,6223,6323,6437,6440,6449,6452,6573,6741,6783-6784,6912-6913,6960,7042,7061,7085,7095,7117,7125,7132-7134,7186,7198,7239,7262,7308,7326,7330-7334,7359,7367,7412,7433,7450-7452,7454,7478,7497,7500,7552,7554-7555,7570-7571,7573,7577,7598,7614-7615,7695-7696,7701-7704,7748,7780,7877
+ /epp/portal/branches/EPP_5_1_0_GA_JBEPP-795/wsrp-integration:5868
/portal/branches/branch-GTNPORTAL-1592/wsrp-integration:4868,4894
/portal/branches/branch-GTNPORTAL-1643/wsrp-integration:5002,5063,5167
/portal/branches/branch-GTNPORTAL-1700/wsrp-integration:5348,5363,5402,5445
/portal/branches/branch-GTNPORTAL-1731/wsrp-integration:5622,5644,5668
/portal/branches/branch-GTNPORTAL-1745/wsrp-integration:5765
/portal/branches/branch-GTNPORTAL-1790/wsrp-integration:5871
/portal/branches/branch-GTNPORTAL-1822/wsrp-integration:5943,5952
/portal/branches/branch-GTNPORTAL-1832/wsrp-integration:6030,6063
/portal/branches/branch-GTNPORTAL-1872/wsrp-integration:6400,6551
/portal/branches/branch-GTNPORTAL-1921/wsrp-integration:6603,6771-6772,6774
/portal/branches/branch-GTNPORTAL-1963/wsrp-integration:6904,6915-6916
/portal/branches/decoupled-webos/wsrp-integration:6214-6243
/portal/branches/gatein-management/wsrp-integration:6920-6958
/portal/branches/global-portlet-metadata/wsrp-integration:6298-6384
/portal/branches/site-describability/wsrp-integration:6171-6235
/portal/trunk/wsrp-integration:4876,4891,5269,5744,5822,5943,6168,6196,6201-6203,6205-6206,6223,6323,6437,6440,6449,6452,6573,6741,6783-6784,6912-6913,6960,7042,7061,7085,7095,7117,7125,7132-7134,7186,7198,7239,7262,7308,7326,7330-7334,7359,7367,7412,7433,7450-7452,7454,7478,7497,7500,7552,7554-7555,7570-7571,7573,7577,7598,7614-7615,7695-7696,7701-7704,7737,7741,7748,7773,7780,7877,7906