mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-14 17:58:59 +00:00
making height for rich text editor widget paramaterizable. adding snapshot after regenerating renditions.
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@5990 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -40,13 +40,14 @@
|
||||
javascript-class-name="alfresco.xforms.PlainTextEditor"/>
|
||||
<widget xforms-type="xf:textarea"
|
||||
javascript-class-name="alfresco.xforms.RichTextEditor">
|
||||
<param>bold,italic,underline,separator,forecolor,backcolor,separator,link,unlink,image</param>
|
||||
<param name="theme_advanced_buttons1">bold,italic,underline,separator,forecolor,backcolor,separator,link,unlink,image</param>
|
||||
</widget>
|
||||
<widget xforms-type="xf:textarea"
|
||||
appearance="full"
|
||||
javascript-class-name="alfresco.xforms.RichTextEditor">
|
||||
<param>bold,italic,underline,strikethrough,separator,fontselect,fontsizeselect</param>
|
||||
<param>link,unlink,image,separator,justifyleft,justifycenter,justifyright,justifyfull,separator,bullist,numlist,separator,undo,redo,separator,forecolor,backcolor</param>
|
||||
<param name="theme_advanced_buttons1">bold,italic,underline,strikethrough,separator,fontselect,fontsizeselect</param>
|
||||
<param name="theme_advanced_buttons2">link,unlink,image,separator,justifyleft,justifycenter,justifyright,justifyfull,separator,bullist,numlist,separator,undo,redo,separator,forecolor,backcolor</param>
|
||||
<param name="height">400</param>
|
||||
</widget>
|
||||
<widget xforms-type="xf:upload" javascript-class-name="alfresco.xforms.FilePicker"/>
|
||||
<widget xforms-type="xf:range" javascript-class-name="alfresco.xforms.NumericalRange"/>
|
||||
|
@@ -69,6 +69,7 @@ import org.alfresco.web.ui.wcm.WebResources;
|
||||
import org.apache.commons.io.FilenameUtils;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.springframework.util.StringUtils;
|
||||
import org.w3c.dom.Document;
|
||||
|
||||
/**
|
||||
@@ -113,6 +114,26 @@ public class RegenerateRenditionsWizard
|
||||
}
|
||||
LOGGER.debug("updating " + diffList.size() + " renditions in staging");
|
||||
this.avmSyncService.update(diffList, null, true, true, true, true, null, null);
|
||||
final StringBuilder description = new StringBuilder();
|
||||
if (this.regenerateScope.equals(REGENERATE_SCOPE_FORM))
|
||||
{
|
||||
description.append("regenerated all renditions for content authored using forms ").
|
||||
append(StringUtils.arrayToDelimitedString(this.selectedForms, ", ")).
|
||||
append(".");
|
||||
}
|
||||
else if (this.regenerateScope.equals(REGENERATE_SCOPE_RENDERING_ENGINE_TEMPLATE))
|
||||
{
|
||||
description.append("regenerated all renditions generated by ").
|
||||
append(StringUtils.arrayToDelimitedString(this.selectedRenderingEngineTemplates, ", ")).
|
||||
append(".");
|
||||
}
|
||||
else
|
||||
{
|
||||
description.append("regenerated all renditions in web project " + this.selectedWebProject.getName());
|
||||
}
|
||||
this.avmService.createSnapshot(this.selectedWebProject.getStoreId(),
|
||||
"regenerated renditions",
|
||||
description.toString());
|
||||
}
|
||||
return outcome;
|
||||
}
|
||||
|
@@ -278,7 +278,7 @@ public class XFormsProcessor
|
||||
public final String xmlSchemaType;
|
||||
public final String appearance;
|
||||
public final String javascriptClassName;
|
||||
private List<String> params;
|
||||
private final Map<String, String> params = new HashMap<String, String>();
|
||||
|
||||
public WidgetConfigElement(final String xformsType,
|
||||
final String xmlSchemaType,
|
||||
@@ -295,20 +295,16 @@ public class XFormsProcessor
|
||||
this.javascriptClassName = javascriptClassName;
|
||||
}
|
||||
|
||||
public void addParam(final String p)
|
||||
public void addParam(final String k, final String v)
|
||||
{
|
||||
if (this.params == null)
|
||||
{
|
||||
this.params = new LinkedList();
|
||||
}
|
||||
this.params.add(p);
|
||||
this.params.put(k, v);
|
||||
}
|
||||
|
||||
public List<String> getParams()
|
||||
public Map<String, String> getParams()
|
||||
{
|
||||
return (this.params == null
|
||||
? (List<String>)Collections.EMPTY_LIST
|
||||
: Collections.unmodifiableList(this.params));
|
||||
? (Map<String, String>)Collections.EMPTY_MAP
|
||||
: Collections.unmodifiableMap(this.params));
|
||||
}
|
||||
|
||||
public int compareTo(final WidgetConfigElement other)
|
||||
@@ -367,7 +363,7 @@ public class XFormsProcessor
|
||||
final List<ConfigElement> params = ce.getChildren("param");
|
||||
for (final ConfigElement p : params)
|
||||
{
|
||||
wce.addParam(p.getValue());
|
||||
wce.addParam(p.getAttribute("name"), p.getValue());
|
||||
}
|
||||
widgetConfigs.add(wce);
|
||||
}
|
||||
@@ -391,7 +387,10 @@ public class XFormsProcessor
|
||||
final JSONObject o = new JSONObject();
|
||||
schemaTypeObject.put(s, o);
|
||||
o.put("className", wce.javascriptClassName);
|
||||
o.put("params", wce.getParams());
|
||||
if (wce.getParams().size() != 0)
|
||||
{
|
||||
o.put("params", new JSONObject(wce.getParams()));
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
@@ -814,7 +814,7 @@ dojo.declare("alfresco.xforms.RichTextEditor",
|
||||
function(xform, xformsNode, params)
|
||||
{
|
||||
this._focused = false;
|
||||
this._tinyMCE_buttons = params;
|
||||
this._params = params;
|
||||
if (!this.statics.tinyMCEInitialized)
|
||||
{
|
||||
this.statics.tinyMCEInitialized = true;
|
||||
@@ -846,9 +846,13 @@ dojo.declare("alfresco.xforms.RichTextEditor",
|
||||
|
||||
this.statics.currentInstance = this;
|
||||
|
||||
tinyMCE.settings.theme_advanced_buttons1 = this._tinyMCE_buttons[0] || "";
|
||||
tinyMCE.settings.theme_advanced_buttons2 = this._tinyMCE_buttons[1] || "";
|
||||
tinyMCE.settings.theme_advanced_buttons3 = this._tinyMCE_buttons[2] || "";
|
||||
tinyMCE.settings.theme_advanced_buttons1 = this._params["theme_advanced_buttons1"] || "";
|
||||
tinyMCE.settings.theme_advanced_buttons2 = this._params["theme_advanced_buttons2"] || "";
|
||||
tinyMCE.settings.theme_advanced_buttons3 = this._params["theme_advanced_buttons3"] || "";
|
||||
if (this._params["height"])
|
||||
{
|
||||
tinyMCE.settings.height = parseInt(this._params["height"]);
|
||||
}
|
||||
tinyMCE.addMCEControl(this.widget, this.id);
|
||||
|
||||
var editorDocument = tinyMCE.getInstanceById(this.id).getDoc();
|
||||
@@ -868,9 +872,17 @@ dojo.declare("alfresco.xforms.RichTextEditor",
|
||||
{
|
||||
attach_point.appendChild(this.domNode);
|
||||
dojo.html.prependClass(this.domNode, "xformsTextArea");
|
||||
if (this._params["height"])
|
||||
{
|
||||
this.domNode.style.height = parseInt(this._params["height"]) + "px";
|
||||
}
|
||||
this.widget = document.createElement("div");
|
||||
this.domNode.appendChild(this.widget);
|
||||
dojo.html.prependClass(this.widget, "xformsTextArea");
|
||||
if (this._params["height"])
|
||||
{
|
||||
this.widget.style.height = parseInt(this._params["height"]) + "px";
|
||||
}
|
||||
this.widget.style.border = "1px solid black";
|
||||
this.widget.style.overflow = "auto";
|
||||
this.widget.innerHTML = this.getInitialValue() || "";
|
||||
|
Reference in New Issue
Block a user