mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
Merged V2.1 to HEAD
6436: Support for virtualized cookie paths, aggressive cleanup of sockets when virt server is down. 6439: Fix for WCM-619 & WCM-571 6440: Encoding of text/html files created inline using the web-client now has sensible default. AWC-1324. 6442: Fix for WCM-621 (reviewer can not view or run links report) 6443: Fix for AWC-1488. Dashboard 6444: Fix for WCM-693 issue with submitting a deleted directory if no workflow associated with web project. 6445: Icons for use in fix for WCM-522 6446: Office Add-Ins: Fix for AWC-1481 - Login dialog can appear recursively git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@6733 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -54,6 +54,7 @@ import org.alfresco.web.bean.wizard.BaseWizardBean;
|
||||
import org.alfresco.web.data.IDataContainer;
|
||||
import org.alfresco.web.data.QuickSort;
|
||||
import org.alfresco.web.ui.common.Utils;
|
||||
import org.alfresco.web.ui.repo.component.UICharsetSelector;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
|
||||
@@ -167,6 +168,27 @@ public abstract class BaseContentWizard extends BaseWizardBean
|
||||
*/
|
||||
public String getEncoding()
|
||||
{
|
||||
if (encoding == null)
|
||||
{
|
||||
ConfigService configSvc = Application.getConfigService(FacesContext.getCurrentInstance());
|
||||
Config config = configSvc.getConfig("Content Wizards");
|
||||
if (config != null)
|
||||
{
|
||||
ConfigElement defaultEncCfg = config.getConfigElement("default-encoding");
|
||||
if (defaultEncCfg != null)
|
||||
{
|
||||
String value = defaultEncCfg.getValue();
|
||||
if (value != null)
|
||||
{
|
||||
encoding = value.trim();
|
||||
}
|
||||
}
|
||||
}
|
||||
if (encoding == null || encoding.length() == 0)
|
||||
{
|
||||
encoding = Charset.defaultCharset().name();
|
||||
}
|
||||
}
|
||||
return encoding;
|
||||
}
|
||||
|
||||
@@ -270,14 +292,7 @@ public abstract class BaseContentWizard extends BaseWizardBean
|
||||
|
||||
public List<SelectItem> getEncodings()
|
||||
{
|
||||
Map<String, Charset> availableCharsets = Charset.availableCharsets();
|
||||
List<SelectItem> items = new ArrayList<SelectItem>(availableCharsets.size());
|
||||
for (Charset charset : availableCharsets.values())
|
||||
{
|
||||
SelectItem item = new SelectItem(charset.name(), charset.displayName());
|
||||
items.add(item);
|
||||
}
|
||||
return items;
|
||||
return UICharsetSelector.getCharsetEncodingList();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -437,7 +452,7 @@ public abstract class BaseContentWizard extends BaseWizardBean
|
||||
ContentWriter writer = contentService.getWriter(fileNodeRef, ContentModel.PROP_CONTENT, true);
|
||||
// set the mimetype and encoding
|
||||
writer.setMimetype(this.mimeType);
|
||||
writer.setEncoding(this.encoding);
|
||||
writer.setEncoding(getEncoding());
|
||||
if (fileContent != null)
|
||||
{
|
||||
writer.putContent(fileContent);
|
||||
|
Reference in New Issue
Block a user