Author: julien_viet
Date: 2009-11-19 08:20:34 -0500 (Thu, 19 Nov 2009)
New Revision: 672
Modified:
portal/trunk/portlet/dashboard/src/main/webapp/WEB-INF/portlet.xml
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/portal/UIPortalComponentActionListener.java
Log:
- GTNPORTAL-263 : Adding gadgets to a page always defaults to the horoscope one
- disable edit mode of gadget wrapper as it does not make sense to edit the url of an
existing gadget via preferences
Modified: portal/trunk/portlet/dashboard/src/main/webapp/WEB-INF/portlet.xml
===================================================================
--- portal/trunk/portlet/dashboard/src/main/webapp/WEB-INF/portlet.xml 2009-11-19 13:04:01
UTC (rev 671)
+++ portal/trunk/portlet/dashboard/src/main/webapp/WEB-INF/portlet.xml 2009-11-19 13:20:34
UTC (rev 672)
@@ -75,7 +75,6 @@
<expiration-cache>0</expiration-cache>
<supports>
<mime-type>text/html</mime-type>
- <portlet-mode>edit</portlet-mode>
</supports>
<supported-locale>en</supported-locale>
<resource-bundle>locale.portlet.gadget.GadgetPortlet</resource-bundle>
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 2009-11-19
13:04:01 UTC (rev 671)
+++
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/application/ModelAdapter.java 2009-11-19
13:20:34 UTC (rev 672)
@@ -183,7 +183,7 @@
public ApplicationState<Gadget> update(ExoContainer container,
ExoPortletState updateState,
ApplicationState<Gadget> gadgetApplicationState) throws Exception
{
- throw new UnsupportedOperationException("todo / julien");
+ throw new UnsupportedOperationException("Cannot edit gadget
preferences");
}
@Override
Modified:
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/portal/UIPortalComponentActionListener.java
===================================================================
---
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/portal/UIPortalComponentActionListener.java 2009-11-19
13:04:01 UTC (rev 671)
+++
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/portal/UIPortalComponentActionListener.java 2009-11-19
13:20:34 UTC (rev 672)
@@ -345,15 +345,6 @@
app = appList.getApplication(sourceId);
ApplicationType applicationType = app.getType();
- // TanPD: Hardcoded to fix bug GTNPORTAL-91
- Application temp = null;
- if (applicationType.equals(ApplicationType.GADGET))
- {
- applicationType = ApplicationType.PORTLET;
- temp = app;
- app =
appList.getApplication("dashboard/Gadget_Wrapper_Portlet");
- }
-
//
UIPortlet uiPortlet = uiTarget.createUIComponent(UIPortlet.class, null,
null);
if (app.getDisplayName() != null)
@@ -382,41 +373,9 @@
//
uiPortlet.setState(new PortletState(state, applicationType));
-
- // TanPD: Fix bug GTNPORTAL-91
- if (temp != null &&
applicationType.equals(ApplicationType.PORTLET))
- {
- Portlet pref = uiPortlet.getPreferences();
- try
- {
- UIGadget uiGadget = uiPortlet.createUIComponent(UIGadget.class,
null, null);
- uiGadget.setState(new
TransientApplicationState<Gadget>(temp.getApplicationName()));
- pref.setValue("url", uiGadget.getUrl());
- }
- catch (Exception e)
- {
- // Fix in case: RSS Reader Gadget
- Preference aggIdPref =
pref.getPreference("aggregatorId");
- String aggregatorId = null;
- if (aggIdPref == null || aggIdPref.getValue() == null ||
aggIdPref.getValue().length() == 0)
- aggregatorId = "rssAggregator";
- else
- aggregatorId = aggIdPref.getValue();
- GadgetRegistryService gadgetSrv =
uiApp.getApplicationComponent(GadgetRegistryService.class);
- org.exoplatform.application.gadget.Gadget gadget =
gadgetSrv.getGadget(aggregatorId);
- // TODO make sure it's an rss feed
- // TODO make sure that we did not add it already
- UIGadget uiGadget = uiPortlet.createUIComponent(UIGadget.class,
null, null);
- uiGadget.setState(new
TransientApplicationState<org.exoplatform.portal.pom.spi.gadget.Gadget>(
- gadget.getName()));
- pref.setValue("url", uiGadget.getUrl());
- }
- }
-
uiPortlet.setPortletInPortal(uiTarget instanceof UIPortal);
uiPortlet.setShowEditControl(true);
uiSource = uiPortlet;
-
}
List<UIComponent> children = uiTarget.getChildren();
uiSource.setParent(uiTarget);