Author: tan_pham_dinh
Date: 2009-12-08 02:15:13 -0500 (Tue, 08 Dec 2009)
New Revision: 970
Modified:
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/applicationregistry/webui/component/UIApplicationOrganizer.java
portal/trunk/web/portal/src/main/webapp/groovy/portal/webui/application/UIApplicationList.gtmpl
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/application/UIApplicationList.java
Log:
GTNPORTAL-361: Correct thumbnail of gadgets in Application Registry
Modified:
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/applicationregistry/webui/component/UIApplicationOrganizer.java
===================================================================
---
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/applicationregistry/webui/component/UIApplicationOrganizer.java 2009-12-08
04:37:18 UTC (rev 969)
+++
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/applicationregistry/webui/component/UIApplicationOrganizer.java 2009-12-08
07:15:13 UTC (rev 970)
@@ -19,6 +19,8 @@
package org.exoplatform.applicationregistry.webui.component;
+import org.exoplatform.application.gadget.Gadget;
+import org.exoplatform.application.gadget.GadgetRegistryService;
import org.exoplatform.application.registry.Application;
import org.exoplatform.application.registry.ApplicationCategory;
import org.exoplatform.application.registry.ApplicationRegistryService;
@@ -128,14 +130,25 @@
public void setSelectedCategory(ApplicationCategory category) throws Exception
{
selectedCategory = category;
- ApplicationRegistryService service =
getApplicationComponent(ApplicationRegistryService.class);
- applications =
- service.getApplications(selectedCategory, new Util.ApplicationComparator(), new
ApplicationType[0]);
+ applications = category.getApplications();
if (applications == null || applications.isEmpty())
{
setSelectedApplication(null);
return;
}
+
+ //Correct IconUrl of gadget
+ GadgetRegistryService gadgetService =
getApplicationComponent(GadgetRegistryService.class);
+ for (Application app : applications)
+ {
+ if (ApplicationType.GADGET.equals(app.getType()))
+ {
+ Gadget gadget = gadgetService.getGadget(app.getApplicationName());
+ if (gadget != null)
+ app.setIconURL(gadget.getThumbnail());
+ }
+ }
+
setSelectedApplication(applications.get(0));
}
Modified:
portal/trunk/web/portal/src/main/webapp/groovy/portal/webui/application/UIApplicationList.gtmpl
===================================================================
---
portal/trunk/web/portal/src/main/webapp/groovy/portal/webui/application/UIApplicationList.gtmpl 2009-12-08
04:37:18 UTC (rev 969)
+++
portal/trunk/web/portal/src/main/webapp/groovy/portal/webui/application/UIApplicationList.gtmpl 2009-12-08
07:15:13 UTC (rev 970)
@@ -34,7 +34,7 @@
<% if(isSelected) { %>
<div class="UIVTabContent" style="display: block">
<%
- for(application in category.getApplications()) {
+ for(application in uicomponent.getApplications()) {
String applicationLabel = application.getDisplayName();
if(applicationLabel.length() > 30) applicationLabel =
applicationLabel.substring(0, 27) + "...";
String srcBG = application.getIconURL();
Modified:
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/application/UIApplicationList.java
===================================================================
---
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/application/UIApplicationList.java 2009-12-08
04:37:18 UTC (rev 969)
+++
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/application/UIApplicationList.java 2009-12-08
07:15:13 UTC (rev 970)
@@ -19,9 +19,12 @@
package org.exoplatform.portal.webui.application;
+import org.exoplatform.application.gadget.Gadget;
+import org.exoplatform.application.gadget.GadgetRegistryService;
import org.exoplatform.application.registry.Application;
import org.exoplatform.application.registry.ApplicationCategory;
import org.exoplatform.application.registry.ApplicationRegistryService;
+import org.exoplatform.portal.config.model.ApplicationType;
import org.exoplatform.portal.webui.util.Util;
import org.exoplatform.webui.config.annotation.ComponentConfig;
import org.exoplatform.webui.config.annotation.EventConfig;
@@ -101,6 +104,33 @@
}
}
+ public List<Application> getApplications()
+ {
+ if (selectedCategory == null)
+ return null;
+ List<Application> apps = selectedCategory.getApplications();
+
+ //Correct IconURL of Gadget
+ GadgetRegistryService gadgetService =
getApplicationComponent(GadgetRegistryService.class);
+ for (Application app : apps)
+ {
+ if (ApplicationType.GADGET.equals(app.getType()))
+ {
+ try
+ {
+ Gadget gadget;
+ gadget = gadgetService.getGadget(app.getApplicationName());
+ if (gadget != null)
+ app.setIconURL(gadget.getThumbnail());
+ }
+ catch (Exception e)
+ {
+ }
+ }
+ }
+ return apps;
+ }
+
public List<ApplicationCategory> getCategories()
{
return categories;
Show replies by date