Author: julien_viet
Date: 2010-01-06 13:24:59 -0500 (Wed, 06 Jan 2010)
New Revision: 1183
Modified:
portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/gadget/LocalImporter.java
portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/gadget/impl/LocalGadgetData.java
portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/gadget/impl/SourceStorageImpl.java
Log:
GTNPORTAL-406 : Change gadget MIME type XML file to
"application/x-google-gadget"
Modified:
portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/gadget/LocalImporter.java
===================================================================
---
portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/gadget/LocalImporter.java 2010-01-06
16:10:25 UTC (rev 1182)
+++
portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/gadget/LocalImporter.java 2010-01-06
18:24:59 UTC (rev 1183)
@@ -202,6 +202,11 @@
encoding = EncodingDetector.detect(new ByteArrayInputStream(content));
}
+ // Correct mime type for gadgets
+ if (resourcePath.equals(gadgetPath)) {
+ mimeType = LocalGadgetData.GADGET_MIME_TYPE;
+ }
+
//
folder.createFile(name, new Resource(mimeType, encoding, content));
}
Modified:
portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/gadget/impl/LocalGadgetData.java
===================================================================
---
portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/gadget/impl/LocalGadgetData.java 2010-01-06
16:10:25 UTC (rev 1182)
+++
portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/gadget/impl/LocalGadgetData.java 2010-01-06
18:24:59 UTC (rev 1183)
@@ -45,6 +45,9 @@
public abstract class LocalGadgetData extends GadgetData
{
+ /** Mime type for gadgets. */
+ public static final String GADGET_MIME_TYPE =
"application/x-google-gadget";
+
@ManyToOne
public abstract GadgetDefinition getDefinition();
@@ -84,7 +87,7 @@
// Update content
NTFile content = getGadgetContent();
- content.setContentResource(new Resource("application/xml", encoding,
bytes));
+ content.setContentResource(new Resource(GADGET_MIME_TYPE, encoding, bytes));
}
public String getSource() throws Exception
Modified:
portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/gadget/impl/SourceStorageImpl.java
===================================================================
---
portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/gadget/impl/SourceStorageImpl.java 2010-01-06
16:10:25 UTC (rev 1182)
+++
portal/trunk/component/application-registry/src/main/java/org/exoplatform/application/gadget/impl/SourceStorageImpl.java 2010-01-06
18:24:59 UTC (rev 1183)
@@ -64,7 +64,7 @@
//
Source source = new Source(gadget.getName());
- source.setMimeType("application/xml");
+ source.setMimeType(LocalGadgetData.GADGET_MIME_TYPE);
source.setLastModified(lastModified);
source.setTextContent(content);
Show replies by date