Merged V2.1 to HEAD:

6556: AVM performance tweaks
   6557: WCM-758.
   6558: Fixes WCM-753.
   6559: better handling of rename, copy and paste for form instance data and renditions.  addresses WCM-752 and partially addresses WCM-559.
   6560: Renamed JndiTest.java until we decide to keep it or not.
   6561: Oops.
   6562: probable fix WCM-669      
   6563: Build fix after the removal of flushing suport 
   6564: Fix for WCM-728
   6566: Support for avm index clustering via tracking - WCM-762
   6567: Test fix after flush changes
   6568: Fixed AWC-1517: Can now create space based on existing top-level space
   6569: misc IE fixes.
   6570: Various changes to improve AVM import performance and submit performance.
   6571: Session flushing is now deprecated and doesn't fail with an exception.
   6572: Reduced the iteration count to stress nextResults calls a bit more
   6573: WS query sessions put back into cache after more results have been fetched.
   6574: AR-1347: RepositoryServiceSoapBindingStub.queryAssociated() returns nothing when direction=target
   6575: Fixed AR-1680: XPath metadata extraction now handles Node, NodeList and String return values
   6577: Fix for AWC-1518 (User Homes renaming issue, and unreported issue with client config overriding of users home location)


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@6745 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Derek Hulley
2007-09-11 02:37:29 +00:00
parent 1b9a268ae3
commit 61808ef4a7
18 changed files with 196 additions and 25 deletions

View File

@@ -1213,7 +1213,7 @@ link_validaton_dialog_title_workflow=Link Validation Report for Submitted Items
link_validaton_dialog_desc=This dialog shows the results of a link validation check and allows you to fix broken links. link_validaton_dialog_desc=This dialog shows the results of a link validation check and allows you to fix broken links.
report_summary=Report Summary report_summary=Report Summary
link_check_completed_at=Broken links were checked at {0} using snapshot {1}. link_check_completed_at=Broken links were checked at {0} using snapshot {1}.
link_check_not_latest=This is not the latest snapshot. link_check_not_latest=The latest snapshot version is {0}.
link_check_items_found={0} file(s) were checked, {1} link(s) were found. link_check_items_found={0} file(s) were checked, {1} link(s) were found.
link_check_items_broken={0} broken link(s) were found in {1} file(s). link_check_items_broken={0} broken link(s) were found in {1} file(s).
link_check_no_broken=No broken links were found. link_check_no_broken=No broken links were found.

View File

@@ -60,6 +60,11 @@
<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="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> <param name="height">400</param>
</widget> </widget>
<!--
NOTE: only the table tinymce plugin is part of the default alfresco distribution.
to enable other tinymce plugins, the plugin code must first be copied into the
tinymce distribution within the webapp.
-->
<widget xforms-type="xf:textarea" <widget xforms-type="xf:textarea"
appearance="custom" appearance="custom"
javascript-class-name="alfresco.xforms.RichTextEditor"> javascript-class-name="alfresco.xforms.RichTextEditor">
@@ -72,6 +77,17 @@
<param name="plugins">table</param> <param name="plugins">table</param>
<param name="theme_advanced_buttons3">tablecontrols</param> <param name="theme_advanced_buttons3">tablecontrols</param>
</widget> </widget>
<!--
<widget xforms-type="xf:textarea"
appearance="fullscreen"
javascript-class-name="alfresco.xforms.RichTextEditor">
<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">600</param>
<param name="plugins">fullscreen</param>
<param name="theme_advanced_buttons3">fullscreen</param>
</widget>
-->
<widget xforms-type="xf:upload" <widget xforms-type="xf:upload"
javascript-class-name="alfresco.xforms.FilePicker"> javascript-class-name="alfresco.xforms.FilePicker">
<param name="selectable_types">wcm:avmcontent,wcm:avmfolder</param> <param name="selectable_types">wcm:avmcontent,wcm:avmfolder</param>

View File

@@ -653,7 +653,6 @@ public abstract class UserMembersBean implements IContextListener
// and add each of the new permissions in turn // and add each of the new permissions in turn
NodeRef nodeRef = getNode().getNodeRef(); NodeRef nodeRef = getNode().getNodeRef();
this.permissionService.clearPermission(nodeRef, getPersonAuthority()); this.permissionService.clearPermission(nodeRef, getPersonAuthority());
AlfrescoTransactionSupport.flush();
for (PermissionWrapper wrapper : personRoles) for (PermissionWrapper wrapper : personRoles)
{ {
this.permissionService.setPermission( this.permissionService.setPermission(

View File

@@ -47,6 +47,8 @@ import org.alfresco.service.ServiceRegistry;
import org.alfresco.service.cmr.avm.*; import org.alfresco.service.cmr.avm.*;
import org.alfresco.service.cmr.avmsync.AVMDifference; import org.alfresco.service.cmr.avmsync.AVMDifference;
import org.alfresco.service.cmr.avmsync.AVMSyncService; import org.alfresco.service.cmr.avmsync.AVMSyncService;
import org.alfresco.service.cmr.dictionary.DataTypeDefinition;
import org.alfresco.service.cmr.dictionary.DictionaryService;
import org.alfresco.service.cmr.repository.ContentReader; import org.alfresco.service.cmr.repository.ContentReader;
import org.alfresco.service.cmr.repository.ContentService; import org.alfresco.service.cmr.repository.ContentService;
import org.alfresco.service.cmr.repository.ContentWriter; import org.alfresco.service.cmr.repository.ContentWriter;
@@ -126,7 +128,8 @@ public class AVMWorkflowUtil extends WorkflowUtil
// convert package to workflow package // convert package to workflow package
final AVMNodeDescriptor packageDesc = avmService.lookup(-1, packagesPath); final AVMNodeDescriptor packageDesc = avmService.lookup(-1, packagesPath);
final NodeRef packageNodeRef = workflowService.createPackage(AVMNodeConverter.ToNodeRef(-1, packageDesc.getPath())); final NodeRef packageNodeRef = workflowService.createPackage(AVMNodeConverter.ToNodeRef(-1, packageDesc.getPath()));
avmService.setNodeProperty(packagesPath, WorkflowModel.PROP_IS_SYSTEM_PACKAGE, new PropertyValue(null, true));
avmService.setNodeProperty(packagesPath, WorkflowModel.PROP_IS_SYSTEM_PACKAGE, new PropertyValue(DataTypeDefinition.BOOLEAN, true));
// apply global permission to workflow package // apply global permission to workflow package
// TODO: Determine appropriate permissions // TODO: Determine appropriate permissions

View File

@@ -33,6 +33,7 @@ import org.alfresco.model.ContentModel;
import org.alfresco.repo.avm.AVMNodeConverter; import org.alfresco.repo.avm.AVMNodeConverter;
import org.alfresco.repo.domain.PropertyValue; import org.alfresco.repo.domain.PropertyValue;
import org.alfresco.service.cmr.avm.AVMService; import org.alfresco.service.cmr.avm.AVMService;
import org.alfresco.service.cmr.dictionary.DataTypeDefinition;
import org.alfresco.service.cmr.repository.NodeRef; import org.alfresco.service.cmr.repository.NodeRef;
import org.alfresco.service.cmr.repository.NodeService; import org.alfresco.service.cmr.repository.NodeService;
import org.alfresco.web.bean.dialog.BaseDialogBean; import org.alfresco.web.bean.dialog.BaseDialogBean;
@@ -132,7 +133,7 @@ public class CreateFolderDialog extends BaseDialogBean
this.nodeService.addAspect(nodeRef, ApplicationModel.ASPECT_UIFACETS, null); this.nodeService.addAspect(nodeRef, ApplicationModel.ASPECT_UIFACETS, null);
if (this.description != null && this.description.length() != 0) if (this.description != null && this.description.length() != 0)
{ {
this.avmService.setNodeProperty(path, ContentModel.PROP_DESCRIPTION, new PropertyValue(null, this.description)); this.avmService.setNodeProperty(path, ContentModel.PROP_DESCRIPTION, new PropertyValue(DataTypeDefinition.TEXT, this.description));
// this.nodeService.setProperty(nodeRef, ContentModel.PROP_DESCRIPTION, this.description); // this.nodeService.setProperty(nodeRef, ContentModel.PROP_DESCRIPTION, this.description);
} }

View File

@@ -49,7 +49,8 @@ public class CreateWebappDialog extends CreateFolderDialog
@Override @Override
protected String finishImpl(FacesContext context, String outcome) throws Exception protected String finishImpl(FacesContext context, String outcome) throws Exception
{ {
final String parent = AVMUtil.buildSandboxRootPath(this.avmBrowseBean.getStagingStore()); final String stagingStore = this.avmBrowseBean.getStagingStore();
final String parent = AVMUtil.buildSandboxRootPath( stagingStore );
this.avmService.createDirectory(parent, this.name); this.avmService.createDirectory(parent, this.name);
final String path = AVMNodeConverter.ExtendAVMPath(parent, this.name); final String path = AVMNodeConverter.ExtendAVMPath(parent, this.name);
@@ -62,6 +63,9 @@ public class CreateWebappDialog extends CreateFolderDialog
new PropertyValue(DataTypeDefinition.TEXT, new PropertyValue(DataTypeDefinition.TEXT,
this.description)); this.description));
} }
// Snapshot the store with the empty webapp
this.avmService.createSnapshot( stagingStore, null, null);
return outcome; return outcome;
} }

View File

@@ -223,6 +223,9 @@ public class CreateWebsiteWizard extends BaseWizardBean
this.avmLockingService.addWebProject(avmStore); this.avmLockingService.addWebProject(avmStore);
outcome = AlfrescoNavigationHandler.CLOSE_WIZARD_OUTCOME; outcome = AlfrescoNavigationHandler.CLOSE_WIZARD_OUTCOME;
// Snapshot the store with the empty webapp
this.avmService.createSnapshot( avmStore, null, null);
} }
return outcome; return outcome;
} }

View File

@@ -28,11 +28,13 @@ import java.io.Serializable;
import java.text.MessageFormat; import java.text.MessageFormat;
import java.util.HashMap; import java.util.HashMap;
import java.util.Iterator; import java.util.Iterator;
import java.util.List;
import java.util.Map; import java.util.Map;
import javax.faces.context.FacesContext; import javax.faces.context.FacesContext;
import org.alfresco.model.ContentModel; import org.alfresco.model.ContentModel;
import org.alfresco.model.WCMAppModel;
import org.alfresco.repo.avm.AVMNodeConverter; import org.alfresco.repo.avm.AVMNodeConverter;
import org.alfresco.repo.domain.PropertyValue; import org.alfresco.repo.domain.PropertyValue;
import org.alfresco.service.cmr.avm.AVMService; import org.alfresco.service.cmr.avm.AVMService;
@@ -48,6 +50,8 @@ import org.alfresco.web.app.Application;
import org.alfresco.web.bean.content.EditContentPropertiesDialog; import org.alfresco.web.bean.content.EditContentPropertiesDialog;
import org.alfresco.web.bean.repository.Node; import org.alfresco.web.bean.repository.Node;
import org.alfresco.web.bean.repository.Repository; import org.alfresco.web.bean.repository.Repository;
import org.alfresco.web.forms.*;
import org.alfresco.web.ui.common.Utils;
/** /**
* Backing bean for the Edit File Properties dialog. * Backing bean for the Edit File Properties dialog.
@@ -58,6 +62,7 @@ public class EditFilePropertiesDialog extends EditContentPropertiesDialog
{ {
protected AVMBrowseBean avmBrowseBean; protected AVMBrowseBean avmBrowseBean;
protected AVMService avmService; protected AVMService avmService;
protected FormsService formsService;
// ------------------------------------------------------------------------------ // ------------------------------------------------------------------------------
@@ -78,6 +83,14 @@ public class EditFilePropertiesDialog extends EditContentPropertiesDialog
{ {
this.avmService = avmService; this.avmService = avmService;
} }
/**
* @param formsService The FormsService to set.
*/
public void setFormsService(final FormsService formsService)
{
this.formsService = formsService;
}
// ------------------------------------------------------------------------------ // ------------------------------------------------------------------------------
@@ -176,8 +189,47 @@ public class EditFilePropertiesDialog extends EditContentPropertiesDialog
// perform the rename last as for an AVM it changes the NodeRef // perform the rename last as for an AVM it changes the NodeRef
if (name != null) if (name != null)
{ {
this.fileFolderService.rename(nodeRef, name); if (this.nodeService.hasAspect(nodeRef, WCMAppModel.ASPECT_RENDITION))
{
throw new UnsupportedOperationException(this.nodeService.getProperty(nodeRef, ContentModel.PROP_NAME) +
" is a " + WCMAppModel.ASPECT_RENDITION +
" and cannot be renamed");
}
// need to find out if it's a form instance data before rename. for whatever reason,
// afterwards it claims it is not
if (this.nodeService.hasAspect(nodeRef, WCMAppModel.ASPECT_FORM_INSTANCE_DATA))
{
final FormInstanceData fid = this.formsService.getFormInstanceData(nodeRef);
// delete all existing renditions
for (final Rendition r : fid.getRenditions())
{
this.avmService.removeNode(r.getPath());
}
this.nodeService.removeProperty(nodeRef, WCMAppModel.PROP_RENDITIONS);
}
String path = AVMNodeConverter.ToAVMVersionPath(nodeRef).getSecond();
final String parentPath = AVMNodeConverter.SplitBase(path)[0];
final String oldName = AVMNodeConverter.SplitBase(path)[1];
this.avmService.rename(parentPath, oldName, parentPath, name);
nodeRef = AVMNodeConverter.ToNodeRef(-1, AVMNodeConverter.ExtendAVMPath(parentPath, name));
editedProps.put(ContentModel.PROP_NAME.toString(), name); editedProps.put(ContentModel.PROP_NAME.toString(), name);
if (this.nodeService.hasAspect(nodeRef, WCMAppModel.ASPECT_FORM_INSTANCE_DATA))
{
final FormInstanceData fid = this.formsService.getFormInstanceData(nodeRef);
for (final FormInstanceData.RegenerateResult rr : fid.regenerateRenditions())
{
if (rr.getException() != null)
{
outcome = null;
Utils.addErrorMessage("error regenerating rendition using " + rr.getRenderingEngineTemplate().getName() +
": " + rr.getException().getMessage(),
rr.getException());
}
}
}
} }
return outcome; return outcome;

View File

@@ -426,7 +426,8 @@ public class NewUserWizard extends AbstractWizardBean
String oldHomeSpaceName = Repository.getNameForNode(nodeService, oldHomeFolderRef); String oldHomeSpaceName = Repository.getNameForNode(nodeService, oldHomeFolderRef);
if (oldHomeSpaceName.equals(this.homeSpaceName) == false && if (oldHomeSpaceName.equals(this.homeSpaceName) == false &&
oldHomeFolderRef.equals(this.homeSpaceLocation) == false) oldHomeFolderRef.equals(this.homeSpaceLocation) == false &&
oldHomeFolderRef.equals(this.defaultHomeSpaceRef) == false)
{ {
renameHomeSpace = true; renameHomeSpace = true;
} }

View File

@@ -67,7 +67,7 @@ public class ClientConfigElement extends ConfigElementAdapter
private String initialLocation = "myalfresco"; private String initialLocation = "myalfresco";
private ExpiringValueCache<String> wcmDomain = new ExpiringValueCache<String>(1000*10L); private ExpiringValueCache<String> wcmDomain = new ExpiringValueCache<String>(1000*10L);
private ExpiringValueCache<String> wcmPort = new ExpiringValueCache<String>(1000*10L); private ExpiringValueCache<String> wcmPort = new ExpiringValueCache<String>(1000*10L);
private String defaultHomeSpacePath = "/app:company_home"; private String defaultHomeSpacePath = "/app:company_home/app:user_homes";
private boolean clipboardStatusVisible = true; private boolean clipboardStatusVisible = true;
private boolean pasteAllAndClear = true; private boolean pasteAllAndClear = true;
private boolean allowGuestConfig = false; private boolean allowGuestConfig = false;
@@ -148,6 +148,12 @@ public class ClientConfigElement extends ConfigElementAdapter
} }
// override default values if they have changed // override default values if they have changed
if (newElement.getDefaultHomeSpacePath() != null &&
newElement.getDefaultHomeSpacePath().equals(combinedElement.getDefaultHomeSpacePath()) == false)
{
combinedElement.setDefaultHomeSpacePath(newElement.getDefaultHomeSpacePath());
}
if (newElement.getRecentSpacesItems() != combinedElement.getRecentSpacesItems()) if (newElement.getRecentSpacesItems() != combinedElement.getRecentSpacesItems())
{ {
combinedElement.setRecentSpacesItems(newElement.getRecentSpacesItems()); combinedElement.setRecentSpacesItems(newElement.getRecentSpacesItems());

View File

@@ -207,19 +207,34 @@ import org.xml.sax.SAXException;
final List<Rendition> result = new ArrayList<Rendition>(renditionPaths.size()); final List<Rendition> result = new ArrayList<Rendition>(renditionPaths.size());
for (Serializable path : renditionPaths) for (Serializable path : renditionPaths)
{ {
if (avmService.lookup(-1, storeName + ':' + (String)path) != null) if (avmService.lookup(-1, storeName + ':' + (String)path) == null)
{ {
final Rendition r = new RenditionImpl(AVMNodeConverter.ToNodeRef(-1, storeName + ':' + (String)path), LOGGER.debug("ignoring dangling rendition at " + storeName + ':' + (String)path);
}
else
{
final Rendition r = new RenditionImpl(-1,
storeName + ':' + (String)path,
this.formsService); this.formsService);
try
{
if (!this.equals(r.getPrimaryFormInstanceData()))
{
LOGGER.debug("rendition " + r +
" points at form instance data " + r.getPrimaryFormInstanceData() +
" instead of " + this + ". Not including in renditions list.");
continue;
}
}
catch (FileNotFoundException fnfe)
{
continue;
}
if (r.getRenderingEngineTemplate() != null) if (r.getRenderingEngineTemplate() != null)
{ {
result.add(r); result.add(r);
} }
} }
else
{
LOGGER.debug("ignoring dangling rendition at " + storeName + ':' + (String)path);
}
} }
return result; return result;
} }
@@ -250,6 +265,13 @@ import org.xml.sax.SAXException;
} }
} }
public boolean equals(final Object other)
{
return (other instanceof FormInstanceDataImpl &&
this.getNodeRef().equals(((FormInstanceDataImpl)other).getNodeRef()));
}
protected String getParentFormName() protected String getParentFormName()
{ {
final NodeService nodeService = this.getServiceRegistry().getNodeService(); final NodeService nodeService = this.getServiceRegistry().getNodeService();

View File

@@ -234,7 +234,13 @@ import org.xml.sax.SAXException;
public int hashCode() public int hashCode()
{ {
return this.getPath().hashCode() ^ this.getRenderingEngineTemplate().hashCode(); return this.getPath().hashCode();
}
public boolean equals(final Object other)
{
return (other instanceof RenditionImpl &&
this.getNodeRef().equals(((RenditionImpl)other).getNodeRef()));
} }
public String toString() public String toString()

View File

@@ -134,11 +134,15 @@ public class UILinkValidationSummary extends AbstractLinkValidationReportCompone
// NOTE: Whenever latestVersion > baseVersion, link validation is "behind". // NOTE: Whenever latestVersion > baseVersion, link validation is "behind".
if (latestVersion > baseVersion) if (latestVersion > baseVersion)
{ {
out.write("&nbsp;(<img src='"); pattern = bundle.getString("link_check_not_latest");
String latestVersionInfo =
MessageFormat.format(
pattern, new Object[] { new Integer( latestVersion )});
out.write("&nbsp;<img src='");
out.write(context.getExternalContext().getRequestContextPath()); out.write(context.getExternalContext().getRequestContextPath());
out.write("/images/icons/warning.gif' />&nbsp;"); out.write("/images/icons/warning.gif' />&nbsp;");
out.write(bundle.getString("link_check_not_latest")); out.write( latestVersionInfo );
out.write(")");
} }
pattern = bundle.getString("link_check_items_found"); pattern = bundle.getString("link_check_items_found");

View File

@@ -27,6 +27,13 @@
</xs:appinfo> </xs:appinfo>
</xs:annotation> </xs:annotation>
</xs:element> </xs:element>
<xs:element name="rich_text_stringType_fullscreen" type="xs:string" minOccurs="0" maxOccurs="1">
<xs:annotation>
<xs:appinfo>
<alf:appearance>fullscreen</alf:appearance>
</xs:appinfo>
</xs:annotation>
</xs:element>
<xs:element name="repeating-textarea" type="xs:anyType" minOccurs="0" maxOccurs="unbounded"/> <xs:element name="repeating-textarea" type="xs:anyType" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence> </xs:sequence>
<xs:attribute name="plain_text_attribute" type="xs:string" use="required"> <xs:attribute name="plain_text_attribute" type="xs:string" use="required">

View File

@@ -3232,6 +3232,10 @@
<property-name>avmService</property-name> <property-name>avmService</property-name>
<value>#{AVMLockingAwareService}</value> <value>#{AVMLockingAwareService}</value>
</managed-property> </managed-property>
<managed-property>
<property-name>formsService</property-name>
<value>#{FormsService}</value>
</managed-property>
<managed-property> <managed-property>
<property-name>fileFolderService</property-name> <property-name>fileFolderService</property-name>
<value>#{FileFolderService}</value> <value>#{FileFolderService}</value>

View File

@@ -104,13 +104,12 @@
left: 0px; left: 0px;
width: 100%; width: 100%;
height: 100%; height: 100%;
background-color: lightgray; background-color: #d9d9de;
color: black; color: black;
z-index: 100; z-index: 100;
font-weight: bolder; font-weight: bolder;
font-size: 16px; font-size: 16px;
text-align: center; text-align: center;
opacity: .5;
} }
.xformsRepeat .xformsRepeat

View File

@@ -51,7 +51,7 @@
value="#{msg.web_project}:"/> value="#{msg.web_project}:"/>
<h:selectOneMenu id="selectone-webproject" <h:selectOneMenu id="selectone-webproject"
style="width:100%;" style="width:100%;"
onchange="this.form.submit()" onclick="this.form.submit()"
value="#{WizardManager.bean.selectedWebProject}"> value="#{WizardManager.bean.selectedWebProject}">
<f:selectItems id="selectitems-webproject" <f:selectItems id="selectitems-webproject"
value="#{WizardManager.bean.webProjectChoices}"/> value="#{WizardManager.bean.webProjectChoices}"/>
@@ -62,7 +62,7 @@
value="2. #{msg.regenerate_renditions_select_renditions_select_regenerate_scope}" value="2. #{msg.regenerate_renditions_select_renditions_select_regenerate_scope}"
escape="false" /> escape="false" />
<h:selectOneRadio id="selectone-regenerate-mode" <h:selectOneRadio id="selectone-regenerate-mode"
onchange="this.form.submit()" onclick="this.form.submit()"
disabled="#{empty WizardManager.bean.selectedWebProject}" disabled="#{empty WizardManager.bean.selectedWebProject}"
layout="pageDirection" layout="pageDirection"
value="#{WizardManager.bean.regenerateScope}"> value="#{WizardManager.bean.regenerateScope}">

View File

@@ -888,7 +888,7 @@ dojo.declare("alfresco.xforms.RichTextEditor",
{ {
attach_point.appendChild(this.domNode); attach_point.appendChild(this.domNode);
dojo.html.prependClass(this.domNode, "xformsTextArea"); dojo.html.prependClass(this.domNode, "xformsTextArea");
if (this._params["height"]) if (this._params.height)
{ {
this.domNode.style.height = parseInt(this._params["height"]) + "px"; this.domNode.style.height = parseInt(this._params["height"]) + "px";
} }
@@ -1032,7 +1032,11 @@ dojo.declare("alfresco.xforms.RichTextEditor",
if (this.hoverLayer.parentNode != this.widget) if (this.hoverLayer.parentNode != this.widget)
{ {
this.widget.appendChild(this.hoverLayer); this.widget.appendChild(this.hoverLayer);
this.hoverLayer.style.border = "1px solid black";
this.hoverLayer.style.lineHeight = this.hoverLayer.offsetHeight + "px"; this.hoverLayer.style.lineHeight = this.hoverLayer.offsetHeight + "px";
this.hoverLayer.style.overflow = "hidden";
dojo.html.setOpacity(this.hoverLayer, .8);
var me = this; var me = this;
dojo.event.browser.addListener(this.hoverLayer, dojo.event.browser.addListener(this.hoverLayer,
"onmouseout", "onmouseout",
@@ -1050,6 +1054,7 @@ dojo.declare("alfresco.xforms.RichTextEditor",
{ {
if (this.hoverLayer.parentNode == this.widget) if (this.hoverLayer.parentNode == this.widget)
{ {
dojo.html.setOpacity(this.hoverLayer, 1);
this.widget.removeChild(this.hoverLayer); this.widget.removeChild(this.hoverLayer);
} }
}, },
@@ -1058,12 +1063,48 @@ dojo.declare("alfresco.xforms.RichTextEditor",
{ {
if (this.hoverLayer.parentNode == this.widget) if (this.hoverLayer.parentNode == this.widget)
{ {
dojo.html.setOpacity(this.hoverLayer, 1);
this.widget.removeChild(this.hoverLayer); this.widget.removeChild(this.hoverLayer);
this._createTinyMCE(); this._createTinyMCE();
} }
} }
}); });
/**
* Reads the widget configuration to determine which plugins will
* be needed by tinymce. All plugins must be loaded into tinymce at
* startup so they must be accumulated in advance.
*/
alfresco.xforms.RichTextEditor.determineNecessaryTinyMCEPlugins = function(config)
{
var result = [];
for (var widget in config)
{
for (var schemaType in config[widget])
{
for (var appearance in config[widget][schemaType])
{
if (config[widget][schemaType][appearance].className == "alfresco.xforms.RichTextEditor" &&
config[widget][schemaType][appearance].params &&
config[widget][schemaType][appearance].params.plugins)
{
dojo.debug("found plugins definition " + config[widget][schemaType][appearance].params.plugins +
" for text editor at config[" + widget + "][" + schemaType + "][" + appearance + "]");
var plugins = config[widget][schemaType][appearance].params.plugins.split(",");
for (var p = 0; p < plugins.length; p++)
{
if (result.indexOf(plugins[p]) < 0)
{
result.push(plugins[p]);
}
}
}
}
}
}
return result.join(",");
}
/** Base class for all select widgets. */ /** Base class for all select widgets. */
dojo.declare("alfresco.xforms.AbstractSelectWidget", dojo.declare("alfresco.xforms.AbstractSelectWidget",
alfresco.xforms.Widget, alfresco.xforms.Widget,
@@ -4072,7 +4113,7 @@ dojo.declare("alfresco.xforms.XForm",
" schemaType " + schemaType + " schemaType " + schemaType +
" appearance " + appearance); " appearance " + appearance);
} }
var result = new cstr(this, xformsNode, x.params); var result = new cstr(this, xformsNode, dojo.lang.mixin(new Object(), x.params || {}));
if (result instanceof alfresco.xforms.Widget) if (result instanceof alfresco.xforms.Widget)
{ {
return result; return result;
@@ -4668,11 +4709,14 @@ dojo.html.toCamelCase = function(str)
// tiny mce integration // tiny mce integration
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
alfresco.constants.TINY_MCE_DEFAULT_PLUGINS =
alfresco.xforms.RichTextEditor.determineNecessaryTinyMCEPlugins(alfresco.xforms.widgetConfig);
alfresco.constants.TINY_MCE_DEFAULT_SETTINGS = alfresco.constants.TINY_MCE_DEFAULT_SETTINGS =
{ {
theme: "advanced", theme: "advanced",
mode: "exact", mode: "exact",
plugins: "table", plugins: alfresco.constants.TINY_MCE_DEFAULT_PLUGINS,
width: -1, width: -1,
height: -1, height: -1,
auto_resize: false, auto_resize: false,