Author: julien_viet
Date: 2010-07-23 05:39:18 -0400 (Fri, 23 Jul 2010)
New Revision: 3695
Removed:
portal/trunk/component/web/src/main/java/org/exoplatform/web/application/gadget/
Modified:
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/applicationregistry/webui/component/UIGadgetManagement.java
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/application/GadgetUtil.java
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/application/ModelAdapter.java
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/application/UIGadget.java
Log:
remove useless GadgetApplication
Modified:
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/applicationregistry/webui/component/UIGadgetManagement.java
===================================================================
---
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/applicationregistry/webui/component/UIGadgetManagement.java 2010-07-23
09:17:09 UTC (rev 3694)
+++
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/applicationregistry/webui/component/UIGadgetManagement.java 2010-07-23
09:39:18 UTC (rev 3695)
@@ -29,7 +29,6 @@
import org.exoplatform.applicationregistry.webui.Util;
import org.exoplatform.web.WebAppController;
import org.exoplatform.web.application.ApplicationMessage;
-import org.exoplatform.web.application.gadget.GadgetApplication;
import org.exoplatform.webui.application.WebuiRequestContext;
import org.exoplatform.commons.serialization.api.annotations.Serialized;
import org.exoplatform.webui.config.annotation.ComponentConfig;
@@ -57,6 +56,8 @@
public class UIGadgetManagement extends UIContainer
{
+ public static final String EXO_GADGET_GROUP = "eXoGadgets";
+
private List<Gadget> gadgets_;
private Gadget selectedGadget_;
@@ -175,7 +176,7 @@
}
service.removeGadget(name);
WebAppController webController =
uiManagement.getApplicationComponent(WebAppController.class);
- webController.removeApplication(GadgetApplication.EXO_GADGET_GROUP +
"/" + name);
+ webController.removeApplication(EXO_GADGET_GROUP + "/" + name);
Gadget gadget = uiManagement.getGadget(name);
if (gadget.isLocal())
{
Modified:
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/application/GadgetUtil.java
===================================================================
---
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/application/GadgetUtil.java 2010-07-23
09:17:09 UTC (rev 3694)
+++
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/application/GadgetUtil.java 2010-07-23
09:39:18 UTC (rev 3695)
@@ -28,7 +28,6 @@
import org.exoplatform.portal.application.PortalRequestContext;
import org.exoplatform.portal.gadget.core.SecurityTokenGenerator;
import org.exoplatform.portal.webui.util.Util;
-import org.exoplatform.web.application.gadget.GadgetApplication;
import org.json.JSONException;
import org.json.JSONObject;
@@ -46,11 +45,6 @@
*/
public class GadgetUtil
{
- static public GadgetApplication toGadgetApplication(Gadget model)
- {
- return new GadgetApplication(model.getName(), model.getUrl(), model.isLocal());
- }
-
static public Gadget toGadget(String name, String path, boolean isLocal) throws
Exception
{
Gadget gadget = new Gadget();
Modified:
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/application/ModelAdapter.java
===================================================================
---
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/application/ModelAdapter.java 2010-07-23
09:17:09 UTC (rev 3694)
+++
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/application/ModelAdapter.java 2010-07-23
09:39:18 UTC (rev 3695)
@@ -34,7 +34,6 @@
import org.exoplatform.portal.pom.spi.portlet.Preference;
import org.exoplatform.portal.pom.spi.wsrp.WSRP;
import org.exoplatform.portal.pom.spi.wsrp.WSRPPortletStateType;
-import org.exoplatform.web.application.gadget.GadgetApplication;
import org.gatein.pc.api.PortletContext;
import org.gatein.pc.api.PortletInvoker;
import org.gatein.pc.api.StatefulPortletContext;
@@ -171,8 +170,7 @@
GadgetRegistryService gadgetService =
(GadgetRegistryService)container.getComponentInstanceOfType(GadgetRegistryService.class);
org.exoplatform.application.gadget.Gadget model =
gadgetService.getGadget(applicationId);
- GadgetApplication application = new GadgetApplication(model.getName(),
model.getUrl(), model.isLocal());
- String url = GadgetUtil.reproduceUrl(application.getUrl(),
application.isLocal());
+ String url = GadgetUtil.reproduceUrl(model.getUrl(), model.isLocal());
ExoPortletState prefs = new ExoPortletState(WRAPPER_ID);
prefs.getState().put("url", Arrays.asList(url));
return StatefulPortletContext.create("local._dumbvalue",
ExoPortletStateType.getInstance(), prefs);
Modified:
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/application/UIGadget.java
===================================================================
---
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/application/UIGadget.java 2010-07-23
09:17:09 UTC (rev 3694)
+++
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/application/UIGadget.java 2010-07-23
09:39:18 UTC (rev 3695)
@@ -28,9 +28,7 @@
import org.exoplatform.portal.config.model.Properties;
import org.exoplatform.portal.pom.data.ModelDataStorage;
import org.exoplatform.portal.webui.util.Util;
-import org.exoplatform.web.WebAppController;
import org.exoplatform.web.application.ApplicationMessage;
-import org.exoplatform.web.application.gadget.GadgetApplication;
import org.exoplatform.webui.application.WebuiRequestContext;
import org.exoplatform.webui.config.annotation.ComponentConfig;
import org.exoplatform.webui.config.annotation.EventConfig;
@@ -260,29 +258,17 @@
* @return Gadget Application
* @throws Exception
*/
- private GadgetApplication getApplication()
+ private Gadget getApplication()
{
- WebAppController webController = getApplicationComponent(WebAppController.class);
- GadgetApplication application =
webController.getApplication("eXoGadgets/" + gadgetId);
- if (application == null)
+ try
{
GadgetRegistryService gadgetService =
getApplicationComponent(GadgetRegistryService.class);
- Gadget model;
- try
- {
- model = gadgetService.getGadget(gadgetId);
- }
- catch (Exception ex)
- {
- return null;
- }
- if (model != null)
- {
- application = GadgetUtil.toGadgetApplication(model);
- webController.addApplication(application);
- }
+ return gadgetService.getGadget(gadgetId);
}
- return application;
+ catch (Exception ex)
+ {
+ return null;
+ }
}
/**
@@ -295,8 +281,8 @@
{
if (url_ == null)
{
- GadgetApplication application = getApplication();
- url_ = GadgetUtil.reproduceUrl(application.getUrl(), application.isLocal());
+ Gadget gadget = getApplication();
+ url_ = GadgetUtil.reproduceUrl(gadget.getUrl(), gadget.isLocal());
}
return url_;
}
Show replies by date