Author: tan_pham_dinh
Date: 2010-02-10 02:30:24 -0500 (Wed, 10 Feb 2010)
New Revision: 1607
Modified:
portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/gadget/impl/GadgetRegistryServiceImpl.java
Log:
GTNPORTAL-612: Error when loading content of gadgets which added to dashboard
Modified:
portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/gadget/impl/GadgetRegistryServiceImpl.java
===================================================================
---
portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/gadget/impl/GadgetRegistryServiceImpl.java 2010-02-10
07:25:36 UTC (rev 1606)
+++
portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/gadget/impl/GadgetRegistryServiceImpl.java 2010-02-10
07:30:24 UTC (rev 1607)
@@ -68,7 +68,8 @@
public GadgetRegistryServiceImpl(ChromatticManager chromatticManager, InitParams
params)
{
- ApplicationRegistryChromatticLifeCycle lifeCycle =
(ApplicationRegistryChromatticLifeCycle)chromatticManager.getLifeCycle("app");
+ ApplicationRegistryChromatticLifeCycle lifeCycle =
+
(ApplicationRegistryChromatticLifeCycle)chromatticManager.getLifeCycle("app");
//
String gadgetDeveloperGroup = null;
@@ -101,7 +102,7 @@
this.language = language;
this.moduleId = moduleId;
this.hostName = hostName;
- this.gadgetDeveloperGroup = gadgetDeveloperGroup;
+ this.gadgetDeveloperGroup = gadgetDeveloperGroup;
this.chromatticManager = chromatticManager;
this.chromatticLifeCycle = lifeCycle;
}
@@ -125,7 +126,6 @@
// ***************
-
public Gadget getGadget(String name) throws Exception
{
GadgetRegistry registry = getRegistry();
@@ -179,14 +179,11 @@
LocalGadgetData data = (LocalGadgetData)def.getData();
String fileName = gadget.getName() + ".xml";
data.setFileName(fileName);
- data.getResources().createFile(fileName, new Resource(
- "application.xml",
- "UTF-8",
- ("<?xml version=\"1.0\"
encoding=\"UTF-8\"?>" +
- "<Module><ModulePrefs title=\"\" />" +
- "<Content type=\"html\"> <![CDATA[]]>" +
- "</Content>" +
- "</Module>").getBytes("UTF-8")));
+ data.getResources().createFile(
+ fileName,
+ new Resource("application.xml", "UTF-8",
("<?xml version=\"1.0\" encoding=\"UTF-8\"?>"
+ + "<Module><ModulePrefs title=\"\" />"
+ "<Content type=\"html\"> <![CDATA[]]>" +
"</Content>"
+ + "</Module>").getBytes("UTF-8")));
}
else
{
@@ -238,7 +235,9 @@
if (data instanceof LocalGadgetData)
{
LocalGadgetData localData = (LocalGadgetData)data;
- url = "jcr/repository/portal-system/production/app:gadgets/app:" +
def.getName() + "/app:data/app:resources/" + localData.getFileName();
+ url =
+ "jcr/repository/" + chromatticLifeCycle.getWorkspaceName() +
"/app:gadgets/app:" + def.getName()
+ + "/app:data/app:resources/" + localData.getFileName();
}
else
{
@@ -265,12 +264,12 @@
public String getCountry()
{
- return country ;
+ return country;
}
public String getLanguage()
{
- return language ;
+ return language;
}
public String getModuleId()
@@ -280,6 +279,6 @@
public String getHostName()
{
- return hostName ;
+ return hostName;
}
}
Show replies by date