();
diff --git a/source/java/org/alfresco/repo/template/FreeMarkerProcessor.java b/source/java/org/alfresco/repo/template/FreeMarkerProcessor.java
index 6aae071809..269b76850a 100644
--- a/source/java/org/alfresco/repo/template/FreeMarkerProcessor.java
+++ b/source/java/org/alfresco/repo/template/FreeMarkerProcessor.java
@@ -32,6 +32,8 @@ import org.alfresco.service.cmr.repository.TemplateNode;
import org.alfresco.service.cmr.repository.TemplateProcessor;
import org.apache.log4j.Logger;
+import bsh.This;
+
import freemarker.cache.MruCacheStorage;
import freemarker.cache.StringTemplateLoader;
import freemarker.template.Configuration;
@@ -70,6 +72,9 @@ public class FreeMarkerProcessor implements TemplateProcessor
/** The Content Service to use */
private ContentService contentService;
+ /** Template encoding */
+ private String defaultEncoding;
+
/**
* Set the node service
*
@@ -90,6 +95,16 @@ public class FreeMarkerProcessor implements TemplateProcessor
this.contentService = contentService;
}
+ /**
+ * Set the default template encoding
+ *
+ * @param defaultEncoding the default encoding
+ */
+ public void setDefaultEncoding(String defaultEncoding)
+ {
+ this.defaultEncoding = defaultEncoding;
+ }
+
/**
* Get the FreeMarker configuration for this instance
*
@@ -111,6 +126,12 @@ public class FreeMarkerProcessor implements TemplateProcessor
// rethrow any exception so we can deal with them
config.setTemplateExceptionHandler(TemplateExceptionHandler.RETHROW_HANDLER);
+ // set default template encoding
+ if (defaultEncoding != null)
+ {
+ config.setDefaultEncoding(defaultEncoding);
+ }
+
return config;
}
@@ -140,6 +161,12 @@ public class FreeMarkerProcessor implements TemplateProcessor
// rethrow any exception so we can deal with them
config.setTemplateExceptionHandler(TemplateExceptionHandler.RETHROW_HANDLER);
+ // set default template encoding
+ if (defaultEncoding != null)
+ {
+ config.setDefaultEncoding(defaultEncoding);
+ }
+
return config;
}
diff --git a/source/java/org/alfresco/service/cmr/repository/ContentService.java b/source/java/org/alfresco/service/cmr/repository/ContentService.java
index f13f66192e..7e4663009f 100644
--- a/source/java/org/alfresco/service/cmr/repository/ContentService.java
+++ b/source/java/org/alfresco/service/cmr/repository/ContentService.java
@@ -74,8 +74,12 @@ public interface ContentService
* regardless of the state of the written binary data. If the flag is on, then the node
* property will be updated on the same thread as the code that closed the write
* channel.
+ *
+ * If no node is supplied, then the writer will provide a stream into the backing content
+ * store, but will not be associated with any new or previous content.
*
- * @param nodeRef a reference to a node having a content property
+ * @param nodeRef a reference to a node having a content property, or null
+ * to just get a valid writer into a backing content store.
* @param propertyQName the name of the property, which must be of type content
* @param update true if the property must be updated atomically when the content write
* stream is closed (attaches a listener to the stream); false if the client code