Author: hfnukal
Date: 2012-02-01 06:16:51 -0500 (Wed, 01 Feb 2012)
New Revision: 8341
Modified:
epp/portal/branches/EPP_5_2_Branch/component/application-registry/src/main/java/org/exoplatform/application/gadget/impl/LocalGadgetData.java
Log:
JBEPP-1414 Gadgets without titles not handled properly in Application Registry
Modified:
epp/portal/branches/EPP_5_2_Branch/component/application-registry/src/main/java/org/exoplatform/application/gadget/impl/LocalGadgetData.java
===================================================================
---
epp/portal/branches/EPP_5_2_Branch/component/application-registry/src/main/java/org/exoplatform/application/gadget/impl/LocalGadgetData.java 2012-02-01
11:15:11 UTC (rev 8340)
+++
epp/portal/branches/EPP_5_2_Branch/component/application-registry/src/main/java/org/exoplatform/application/gadget/impl/LocalGadgetData.java 2012-02-01
11:16:51 UTC (rev 8341)
@@ -84,7 +84,7 @@
// Update def
def.setDescription(prefs.getDescription());
def.setThumbnail(prefs.getThumbnail().toString()); // Do something better than
that
- def.setTitle(prefs.getTitle());
+ def.setTitle(getGadgetTitle(prefs, def.getName()));
def.setReferenceURL(prefs.getTitleUrl().toString());
// Update content
@@ -106,4 +106,18 @@
NTFile content = getGadgetContent();
return content.getLastModified();
}
+
+ private String getGadgetTitle(ModulePrefs prefs, String defaultValue)
+ {
+ String title = prefs.getDirectoryTitle();
+ if (title == null || title.trim().length() < 1)
+ {
+ title = prefs.getTitle();
+ }
+ if (title == null || title.trim().length() < 1)
+ {
+ return defaultValue;
+ }
+ return title;
+ }
}
Show replies by date