adding support for wcm tinymce extensions to create html from web content wizard

- extracted file picker backing code into its own bean
- refactoring for to extract file picker bean
- refactoring to manage uploads from file picker outside of xforms context
- added some language utility methods to common.js
- refactored extension dialogs to deal with quirkyness of tinymce dialog codebase on IE - mostly works now and addressed bug WCM-471
- resourcifying a couple strings i missed in filepickerbean

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@5675 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Ariel Backenroth
2007-05-14 22:03:10 +00:00
parent bd54cd2401
commit df32d0ddf1
18 changed files with 615 additions and 411 deletions

View File

@@ -90,6 +90,7 @@ select_destination_prompt=Click here to select the destination
select_web_project_folder=Click here to select a Web Project folder
add_new=Add New
change=Change
select=Select
set=Set
no_categories_applied=This document does not yet have any categories applied.
has_following_categories=This document has the following categories applied...
@@ -1544,5 +1545,6 @@ idle=Idle
loading=Loading
eg=e.g.
click_to_edit=click to edit
# File Picker
go_up=Go up

View File

@@ -99,6 +99,8 @@ public class AVMEditBean
/** The NodeService bean reference */
protected NodeService nodeService;
/** The FilePickerBean reference */
protected FilePickerBean filePickerBean;
// ------------------------------------------------------------------------------
// Bean property getters and setters
@@ -106,7 +108,7 @@ public class AVMEditBean
/**
* @param avmService The AVMService to set.
*/
public void setAvmService(AVMService avmService)
public void setAvmService(final AVMService avmService)
{
this.avmService = avmService;
}
@@ -114,7 +116,7 @@ public class AVMEditBean
/**
* @param avmSyncService The AVMSyncService to set.
*/
public void setAvmSyncService(AVMSyncService avmSyncService)
public void setAvmSyncService(final AVMSyncService avmSyncService)
{
this.avmSyncService = avmSyncService;
}
@@ -122,15 +124,23 @@ public class AVMEditBean
/**
* @param avmBrowseBean The AVMBrowseBean to set.
*/
public void setAvmBrowseBean(AVMBrowseBean avmBrowseBean)
public void setAvmBrowseBean(final AVMBrowseBean avmBrowseBean)
{
this.avmBrowseBean = avmBrowseBean;
}
/**
* @param filePickerBean The FilePickerBean to set.
*/
public void setFilePickerBean(final FilePickerBean filePickerBean)
{
this.filePickerBean = filePickerBean;
}
/**
* @param contentService The ContentService to set.
*/
public void setContentService(ContentService contentService)
public void setContentService(final ContentService contentService)
{
this.contentService = contentService;
}
@@ -138,7 +148,7 @@ public class AVMEditBean
/**
* @param nodeService The nodeService to set.
*/
public void setNodeService(NodeService nodeService)
public void setNodeService(final NodeService nodeService)
{
this.nodeService = nodeService;
}
@@ -364,6 +374,8 @@ public class AVMEditBean
this.avmSyncService.resetLayer(path);
}
this.filePickerBean.clearUploadedFiles();
if (LOGGER.isDebugEnabled())
LOGGER.debug("Editing AVM node: " + avmPath);
@@ -453,7 +465,8 @@ public class AVMEditBean
if (this.avmService.hasAspect(-1, avmPath, WCMAppModel.ASPECT_FORM_INSTANCE_DATA))
{
this.regenerateRenditions();
final NodeRef[] uploadedFiles = this.formProcessorSession.getUploadedFiles();
}
final NodeRef[] uploadedFiles = this.filePickerBean.getUploadedFiles();
if (LOGGER.isDebugEnabled())
LOGGER.debug("updating " + uploadedFiles.length + " uploaded files");
@@ -467,12 +480,11 @@ public class AVMEditBean
AVMDifference.NEWER));
}
this.avmSyncService.update(diffList, null, true, true, true, true, null, null);
}
// Possibly notify virt server
AVMUtil.updateVServerWebapp(avmNode.getPath(), false);
resetState();
this.resetState();
return AlfrescoNavigationHandler.CLOSE_DIALOG_OUTCOME;
}
@@ -559,6 +571,7 @@ public class AVMEditBean
this.setFormProcessorSession(null);
this.instanceDataDocument = null;
this.form = null;
this.filePickerBean.clearUploadedFiles();
}
/**

View File

@@ -119,6 +119,9 @@ public class CreateWebContentWizard extends BaseContentWizard
/** Workflow service bean reference */
protected WorkflowService workflowService;
/** The FilePickerBean reference */
protected FilePickerBean filePickerBean;
/**
* @param avmService The AVMService to set.
*/
@@ -160,6 +163,14 @@ public class CreateWebContentWizard extends BaseContentWizard
this.avmBrowseBean = avmBrowseBean;
}
/**
* @param filePickerBean The FilePickerBean to set.
*/
public void setFilePickerBean(final FilePickerBean filePickerBean)
{
this.filePickerBean = filePickerBean;
}
// ------------------------------------------------------------------------------
// Wizard implementation
@@ -185,6 +196,7 @@ public class CreateWebContentWizard extends BaseContentWizard
this.formSelectDisabled = false;
this.createMimeTypes = null;
this.formChoices = null;
this.filePickerBean.clearUploadedFiles();
// check for a form ID being passed in as a parameter
if (this.parameters.get(UIUserSandboxes.PARAM_FORM_NAME) != null)
@@ -279,9 +291,7 @@ public class CreateWebContentWizard extends BaseContentWizard
protected String finishImpl(final FacesContext context, final String outcome)
throws Exception
{
final NodeRef[] uploadedFiles = (this.formProcessorSession != null
? this.formProcessorSession.getUploadedFiles()
: new NodeRef[0]);
final NodeRef[] uploadedFiles = this.filePickerBean.getUploadedFiles();
final List<AVMDifference> diffList =
new ArrayList<AVMDifference>(1 + this.renditions.size() + uploadedFiles.length);
diffList.add(new AVMDifference(-1, this.createdPath,
@@ -415,6 +425,7 @@ public class CreateWebContentWizard extends BaseContentWizard
{
this.formProcessorSession.destroy();
}
this.filePickerBean.clearUploadedFiles();
// return the default outcome
return outcome;
@@ -741,7 +752,7 @@ public class CreateWebContentWizard extends BaseContentWizard
return Collections.EMPTY_LIST;
}
NodeRef[] uploadedFiles = this.formProcessorSession.getUploadedFiles();
final NodeRef[] uploadedFiles = this.filePickerBean.getUploadedFiles();
final List<UIListItem> result =
new ArrayList<UIListItem>(uploadedFiles.length);

View File

@@ -0,0 +1,289 @@
/*
* Copyright (C) 2005-2007 Alfresco Software Limited.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* As a special exception to the terms and conditions of version 2.0 of
* the GPL, you may redistribute this Program in connection with Free/Libre
* and Open Source Software ("FLOSS") applications as described in Alfresco's
* FLOSS exception. You should have recieved a copy of the text describing
* the FLOSS exception, and it is also available here:
* http://www.alfresco.com/legal/licensing"
*/
package org.alfresco.web.bean.wcm;
import java.io.*;
import java.util.*;
import javax.faces.context.ExternalContext;
import javax.faces.context.FacesContext;
import javax.faces.context.ResponseWriter;
import javax.servlet.ServletContext;
import javax.servlet.http.HttpServletRequest;
import org.alfresco.model.ContentModel;
import org.alfresco.repo.avm.AVMNodeConverter;
import org.alfresco.repo.content.MimetypeMap;
import org.alfresco.repo.domain.PropertyValue;
import org.alfresco.service.cmr.avm.AVMNodeDescriptor;
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.NodeService;
import org.alfresco.service.namespace.QName;
import org.alfresco.util.TempFileProvider;
import org.alfresco.web.app.Application;
import org.alfresco.web.app.servlet.FacesHelper;
import org.alfresco.web.app.servlet.ajax.InvokeCommand;
import org.alfresco.web.bean.FileUploadBean;
import org.alfresco.web.bean.repository.Repository;
import org.alfresco.web.forms.*;
import org.alfresco.web.ui.common.Utils;
import org.apache.commons.io.FilenameUtils;
import org.apache.commons.fileupload.FileItem;
import org.apache.commons.fileupload.disk.DiskFileItemFactory;
import org.apache.commons.fileupload.servlet.ServletFileUpload;
import org.apache.commons.fileupload.servlet.ServletRequestContext;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.util.FileCopyUtils;
import org.w3c.dom.*;
import org.w3c.dom.bootstrap.DOMImplementationRegistry;
import org.w3c.dom.events.Event;
import org.w3c.dom.events.EventListener;
import org.w3c.dom.events.EventTarget;
import org.w3c.dom.ls.*;
import org.xml.sax.SAXException;
/**
* Bean for interacting with the file picker widget using ajax requests.
*/
public class FilePickerBean
{
private static final Log LOGGER = LogFactory.getLog(FilePickerBean.class);
private final Set<NodeRef> uploads = new HashSet<NodeRef>();
private AVMBrowseBean avmBrowseBean;
private AVMService avmService;
public FilePickerBean()
{
}
public void clearUploadedFiles()
{
this.uploads.clear();
}
public NodeRef[] getUploadedFiles()
{
return (NodeRef[])this.uploads.toArray(new NodeRef[this.uploads.size()]);
}
/**
* @param avmBrowseBean the avmBrowseBean to set.
*/
public void setAvmBrowseBean(final AVMBrowseBean avmBrowseBean)
{
this.avmBrowseBean = avmBrowseBean;
}
/**
* @param avmService the avmService to set.
*/
public void setAvmService(final AVMService avmService)
{
this.avmService = avmService;
}
/**
* Provides data for a file picker widget.
*/
@InvokeCommand.ResponseMimetype(value=MimetypeMap.MIMETYPE_XML)
public void getFilePickerData()
throws Exception
{
final FacesContext facesContext = FacesContext.getCurrentInstance();
final ExternalContext externalContext = facesContext.getExternalContext();
final Map requestParameters = externalContext.getRequestParameterMap();
String currentPath = (String)requestParameters.get("currentPath");
if (currentPath == null)
{
currentPath = this.getCurrentAVMPath();
}
else
{
final String previewStorePath =
AVMUtil.getCorrespondingPathInPreviewStore(this.getCurrentAVMPath());
currentPath = AVMUtil.buildPath(previewStorePath,
currentPath,
AVMUtil.PathRelation.WEBAPP_RELATIVE);
}
LOGGER.debug(this + ".getFilePickerData(" + currentPath + ")");
final Document result = XMLUtil.newDocument();
final Element filePickerDataElement = result.createElement("file-picker-data");
result.appendChild(filePickerDataElement);
final AVMNodeDescriptor currentNode = this.avmService.lookup(-1, currentPath);
if (currentNode == null)
{
final Element errorElement = result.createElement("error");
errorElement.appendChild(result.createTextNode("Path " + currentPath + " not found"));
filePickerDataElement.appendChild(errorElement);
currentPath = this.getCurrentAVMPath();
}
else if (! currentNode.isDirectory())
{
currentPath = AVMNodeConverter.SplitBase(currentPath)[0];
}
Element e = result.createElement("current-node");
e.setAttribute("avmPath", currentPath);
e.setAttribute("webappRelativePath",
AVMUtil.getWebappRelativePath(currentPath));
e.setAttribute("type", "directory");
e.setAttribute("image", "/images/icons/space_small.gif");
filePickerDataElement.appendChild(e);
for (Map.Entry<String, AVMNodeDescriptor> entry :
this.avmService.getDirectoryListing(-1, currentPath).entrySet())
{
e = result.createElement("child-node");
e.setAttribute("avmPath", entry.getValue().getPath());
e.setAttribute("webappRelativePath",
AVMUtil.getWebappRelativePath(entry.getValue().getPath()));
e.setAttribute("type", entry.getValue().isDirectory() ? "directory" : "file");
e.setAttribute("image", (entry.getValue().isDirectory()
? "/images/icons/space_small.gif"
: Utils.getFileTypeImage(facesContext,
entry.getValue().getName(),
true)));
filePickerDataElement.appendChild(e);
}
final ResponseWriter out = facesContext.getResponseWriter();
XMLUtil.print(result, out);
out.close();
}
@InvokeCommand.ResponseMimetype(value=MimetypeMap.MIMETYPE_HTML)
public void uploadFile()
throws Exception
{
LOGGER.debug(this + ".uploadFile()");
final FacesContext facesContext = FacesContext.getCurrentInstance();
final ExternalContext externalContext = facesContext.getExternalContext();
final HttpServletRequest request = (HttpServletRequest)
externalContext.getRequest();
final ServletFileUpload upload =
new ServletFileUpload(new DiskFileItemFactory());
upload.setHeaderEncoding("UTF-8");
final List<FileItem> fileItems = upload.parseRequest(request);
final FileUploadBean bean = new FileUploadBean();
String uploadId = null;
String currentPath = null;
String filename = null;
String returnPage = null;
InputStream fileInputStream = null;
for (FileItem item : fileItems)
{
LOGGER.debug("item = " + item);
if (item.isFormField() && item.getFieldName().equals("upload-id"))
{
uploadId = item.getString();
LOGGER.debug("uploadId is " + uploadId);
}
if (item.isFormField() && item.getFieldName().equals("return-page"))
{
returnPage = item.getString();
LOGGER.debug("returnPage is " + returnPage);
}
else if (item.isFormField() && item.getFieldName().equals("currentPath"))
{
final String previewStorePath =
AVMUtil.getCorrespondingPathInPreviewStore(this.getCurrentAVMPath());
currentPath = AVMUtil.buildPath(previewStorePath,
item.getString(),
AVMUtil.PathRelation.WEBAPP_RELATIVE);
LOGGER.debug("currentPath is " + currentPath);
}
else
{
filename = FilenameUtils.getName(item.getName());
fileInputStream = item.getInputStream();
LOGGER.debug("uploading file " + filename);
}
}
LOGGER.debug("saving file " + filename + " to " + currentPath);
try
{
FileCopyUtils.copy(fileInputStream,
this.avmService.createFile(currentPath, filename));
final Map<QName, PropertyValue> props = new HashMap<QName, PropertyValue>(1, 1.0f);
props.put(ContentModel.PROP_TITLE, new PropertyValue(DataTypeDefinition.TEXT, filename));
// props.put(ContentModel.PROP_DESCRIPTION,
// new PropertyValue(DataTypeDefinition.TEXT,
// "Uploaded for form " + this.xformsSession.getForm().getName()));
this.avmService.setNodeProperties(currentPath + "/" + filename, props);
this.avmService.addAspect(currentPath + "/" + filename, ContentModel.ASPECT_TITLED);
this.uploads.add(AVMNodeConverter.ToNodeRef(-1, currentPath + "/" + filename));
returnPage = returnPage.replace("${_FILE_TYPE_IMAGE}",
Utils.getFileTypeImage(facesContext, filename, true));
}
catch (Exception e)
{
LOGGER.debug(e.getMessage(), e);
returnPage = returnPage.replace("${_UPLOAD_ERROR}", e.getMessage());
}
LOGGER.debug("upload complete. sending response: " + returnPage);
final Document result = XMLUtil.newDocument();
final Element htmlEl = result.createElement("html");
result.appendChild(htmlEl);
final Element bodyEl = result.createElement("body");
htmlEl.appendChild(bodyEl);
final Element scriptEl = result.createElement("script");
bodyEl.appendChild(scriptEl);
scriptEl.setAttribute("type", "text/javascript");
final Node scriptText = result.createTextNode(returnPage);
scriptEl.appendChild(scriptText);
final ResponseWriter out = facesContext.getResponseWriter();
XMLUtil.print(result, out);
out.close();
}
private String getCurrentAVMPath()
{
AVMNode node = this.avmBrowseBean.getAvmActionNode();
if (node == null)
{
return this.avmBrowseBean.getCurrentPath();
}
final String result = node.getPath();
return node.isDirectory() ? result : AVMNodeConverter.SplitBase(result)[0];
}
}

View File

@@ -19,7 +19,8 @@
* and Open Source Software ("FLOSS") applications as described in Alfresco's
* FLOSS exception. You should have recieved a copy of the text describing
* the FLOSS exception, and it is also available here:
* http://www.alfresco.com/legal/licensing" */
* http://www.alfresco.com/legal/licensing"
*/
package org.alfresco.web.forms;
import java.io.Serializable;
@@ -45,7 +46,7 @@ public interface FormProcessor
{
/** Returns the set of file uploaded during the session. */
public NodeRef[] getUploadedFiles();
// public NodeRef[] getUploadedFiles();
/** Destroys the session and releases all resources used by it */
public void destroy();

View File

@@ -19,7 +19,8 @@
* and Open Source Software ("FLOSS") applications as described in Alfresco's
* FLOSS exception. You should have recieved a copy of the text describing
* the FLOSS exception, and it is also available here:
* http://www.alfresco.com/legal/licensing" */
* http://www.alfresco.com/legal/licensing"
*/
package org.alfresco.web.forms.xforms;
import java.io.*;
@@ -108,7 +109,7 @@ public class XFormsBean
private ChibaBean chibaBean;
private final Schema2XForms schema2XForms;
private final Set<NodeRef> uploads = new HashSet<NodeRef>();
// private final Set<NodeRef> uploads = new HashSet<NodeRef>();
private final List<XMLEvent> eventLog = new LinkedList<XMLEvent>();
public XFormsSession(final Document formInstanceData,
@@ -124,19 +125,8 @@ public class XFormsBean
baseUrl);
}
public void addUpload(final NodeRef nr)
{
this.uploads.add(nr);
}
public NodeRef[] getUploadedFiles()
{
return (NodeRef[])this.uploads.toArray(new NodeRef[0]);
}
public void destroy()
{
this.uploads.clear();
try
{
this.chibaBean.shutdown();
@@ -171,7 +161,6 @@ public class XFormsBean
private Schema2XFormsProperties schema2XFormsProperties;
private AVMBrowseBean avmBrowseBean;
private AVMService avmService;
private NodeService nodeService;
public XFormsBean()
{
@@ -443,171 +432,6 @@ public class XFormsBean
out.close();
}
/**
* Provides data for a file picker widget.
*/
@InvokeCommand.ResponseMimetype(value=MimetypeMap.MIMETYPE_XML)
public void getFilePickerData()
throws Exception
{
final FacesContext facesContext = FacesContext.getCurrentInstance();
final ExternalContext externalContext = facesContext.getExternalContext();
final Map requestParameters = externalContext.getRequestParameterMap();
String currentPath = (String)requestParameters.get("currentPath");
if (currentPath == null)
{
currentPath = this.getCurrentAVMPath();
}
else
{
final String previewStorePath =
AVMUtil.getCorrespondingPathInPreviewStore(this.getCurrentAVMPath());
currentPath = AVMUtil.buildPath(previewStorePath,
currentPath,
AVMUtil.PathRelation.WEBAPP_RELATIVE);
}
LOGGER.debug(this + ".getFilePickerData(" + currentPath + ")");
final Document result = XMLUtil.newDocument();
final Element filePickerDataElement = result.createElement("file-picker-data");
result.appendChild(filePickerDataElement);
final AVMNodeDescriptor currentNode = this.avmService.lookup(-1, currentPath);
if (currentNode == null)
{
final Element errorElement = result.createElement("error");
errorElement.appendChild(result.createTextNode("Path " + currentPath + " not found"));
filePickerDataElement.appendChild(errorElement);
currentPath = this.getCurrentAVMPath();
}
else if (! currentNode.isDirectory())
{
currentPath = AVMNodeConverter.SplitBase(currentPath)[0];
}
Element e = result.createElement("current-node");
e.setAttribute("avmPath", currentPath);
e.setAttribute("webappRelativePath",
AVMUtil.getWebappRelativePath(currentPath));
e.setAttribute("type", "directory");
e.setAttribute("image", "/images/icons/space_small.gif");
filePickerDataElement.appendChild(e);
for (Map.Entry<String, AVMNodeDescriptor> entry :
this.avmService.getDirectoryListing(-1, currentPath).entrySet())
{
e = result.createElement("child-node");
e.setAttribute("avmPath", entry.getValue().getPath());
e.setAttribute("webappRelativePath",
AVMUtil.getWebappRelativePath(entry.getValue().getPath()));
e.setAttribute("type", entry.getValue().isDirectory() ? "directory" : "file");
e.setAttribute("image", (entry.getValue().isDirectory()
? "/images/icons/space_small.gif"
: Utils.getFileTypeImage(facesContext,
entry.getValue().getName(),
true)));
filePickerDataElement.appendChild(e);
}
final ResponseWriter out = facesContext.getResponseWriter();
XMLUtil.print(result, out);
out.close();
}
@InvokeCommand.ResponseMimetype(value=MimetypeMap.MIMETYPE_HTML)
public void uploadFile()
throws Exception
{
LOGGER.debug(this + ".uploadFile()");
final FacesContext facesContext = FacesContext.getCurrentInstance();
final ExternalContext externalContext = facesContext.getExternalContext();
final HttpServletRequest request = (HttpServletRequest)
externalContext.getRequest();
final ServletFileUpload upload =
new ServletFileUpload(new DiskFileItemFactory());
upload.setHeaderEncoding("UTF-8");
final List<FileItem> fileItems = upload.parseRequest(request);
final FileUploadBean bean = new FileUploadBean();
String uploadId = null;
String currentPath = null;
String filename = null;
String returnPage = null;
InputStream fileInputStream = null;
for (FileItem item : fileItems)
{
LOGGER.debug("item = " + item);
if (item.isFormField() && item.getFieldName().equals("upload-id"))
{
uploadId = item.getString();
LOGGER.debug("uploadId is " + uploadId);
}
if (item.isFormField() && item.getFieldName().equals("return-page"))
{
returnPage = item.getString();
LOGGER.debug("returnPage is " + returnPage);
}
else if (item.isFormField() && item.getFieldName().equals("currentPath"))
{
final String previewStorePath =
AVMUtil.getCorrespondingPathInPreviewStore(this.getCurrentAVMPath());
currentPath = AVMUtil.buildPath(previewStorePath,
item.getString(),
AVMUtil.PathRelation.WEBAPP_RELATIVE);
LOGGER.debug("currentPath is " + currentPath);
}
else
{
filename = FilenameUtils.getName(item.getName());
fileInputStream = item.getInputStream();
LOGGER.debug("uploading file " + filename);
}
}
LOGGER.debug("saving file " + filename + " to " + currentPath);
try
{
FileCopyUtils.copy(fileInputStream,
this.avmService.createFile(currentPath, filename));
final Map<QName, PropertyValue> props = new HashMap<QName, PropertyValue>(2, 1.0f);
props.put(ContentModel.PROP_TITLE, new PropertyValue(DataTypeDefinition.TEXT, filename));
props.put(ContentModel.PROP_DESCRIPTION,
new PropertyValue(DataTypeDefinition.TEXT,
"Uploaded for form " + this.xformsSession.getForm().getName()));
this.avmService.setNodeProperties(currentPath + "/" + filename, props);
this.avmService.addAspect(currentPath + "/" + filename, ContentModel.ASPECT_TITLED);
this.xformsSession.addUpload(AVMNodeConverter.ToNodeRef(-1, currentPath + "/" + filename));
returnPage = returnPage.replace("${_FILE_TYPE_IMAGE}",
Utils.getFileTypeImage(facesContext, filename, true));
}
catch (Exception e)
{
LOGGER.debug(e.getMessage(), e);
returnPage = returnPage.replace("${_UPLOAD_ERROR}", e.getMessage());
}
LOGGER.debug("upload complete. sending response: " + returnPage);
final Document result = XMLUtil.newDocument();
final Element htmlEl = result.createElement("html");
result.appendChild(htmlEl);
final Element bodyEl = result.createElement("body");
htmlEl.appendChild(bodyEl);
final Element scriptEl = result.createElement("script");
bodyEl.appendChild(scriptEl);
scriptEl.setAttribute("type", "text/javascript");
final Node scriptText = result.createTextNode(returnPage);
scriptEl.appendChild(scriptText);
final ResponseWriter out = facesContext.getResponseWriter();
XMLUtil.print(result, out);
out.close();
}
private void swapRepeatItems(final RepeatItem from,
final RepeatItem to)
throws XFormsException

View File

@@ -67,6 +67,7 @@ public class XFormsProcessor
"/scripts/ajax/dojo/" + (LOGGER.isDebugEnabled()
? "dojo.js.uncompressed.js"
: "dojo.js"),
"/scripts/ajax/common.js",
"/scripts/ajax/ajax_helper.js",
"/scripts/ajax/tiny_mce_wcm_extensions.js",
"/scripts/ajax/xforms.js",
@@ -79,12 +80,14 @@ public class XFormsProcessor
{
"add_content",
"cancel",
"change",
"click_to_edit",
"eg",
"go_up",
"idle",
"loading",
"path",
"select",
"upload",
"validation_provide_values_for_required_fields"
};

View File

@@ -2238,6 +2238,10 @@
<property-name>avmBrowseBean</property-name>
<value>#{AVMBrowseBean}</value>
</managed-property>
<managed-property>
<property-name>filePickerBean</property-name>
<value>#{FilePickerBean}</value>
</managed-property>
</managed-bean>
<managed-bean>
@@ -2456,6 +2460,10 @@
<property-name>nodeService</property-name>
<value>#{NodeService}</value>
</managed-property>
<managed-property>
<property-name>filePickerBean</property-name>
<value>#{FilePickerBean}</value>
</managed-property>
</managed-bean>
<managed-bean>
@@ -3298,6 +3306,23 @@
</managed-property>
</managed-bean>
<managed-bean>
<description>
Bean that returns information on a node
</description>
<managed-bean-name>FilePickerBean</managed-bean-name>
<managed-bean-class>org.alfresco.web.bean.wcm.FilePickerBean</managed-bean-class>
<managed-bean-scope>session</managed-bean-scope>
<managed-property>
<property-name>avmService</property-name>
<value>#{AVMService}</value>
</managed-property>
<managed-property>
<property-name>avmBrowseBean</property-name>
<value>#{AVMBrowseBean}</value>
</managed-property>
</managed-bean>
<managed-bean>
<description>
Bean that returns deployment progress status

View File

@@ -219,6 +219,7 @@
.xformsFilePickerFileList
{
position: relative;
overflow-y: auto;
background-color: white;
border-left: 1px solid #67a4e6;

View File

@@ -35,21 +35,17 @@
<jsp:directive.page language="java" contentType="text/html; charset=UTF-8"/>
<jsp:directive.page isELIgnored="false"/>
<script language="javascript" type="text/javascript" src="${pageContext.request.contextPath}/scripts/tiny_mce/tiny_mce.js">&#160;</script>
<script language="javascript" type="text/javascript" src="${pageContext.request.contextPath}/scripts/ajax/tiny_mce_wcm_extensions.js">&#160;</script>
<script language="javascript" type="text/javascript" src="${pageContext.request.contextPath}/scripts/ajax/file_picker_widget.js">&#160;</script>
<script language="javascript" type="text/javascript" src="${pageContext.request.contextPath}/scripts/ajax/ajax_helper.js">&#160;</script>
<script language="javascript" type="text/javascript" src="${pageContext.request.contextPath}/scripts/ajax/dojo/dojo.js">&#160;</script>
<script language="javascript" type="text/javascript" src="${pageContext.request.contextPath}/scripts/upload_helper.js">&#160;</script>
<script language="javascript"
type="text/javascript"
src="${pageContext.request.contextPath}/scripts/tiny_mce/tiny_mce.js">&#160;</script>
<script language="javascript"
type="text/javascript"
src="${pageContext.request.contextPath}/scripts/ajax/comon.js">&#160;</script>
<script language="javascript"
type="text/javascript"
src="${pageContext.request.contextPath}/scripts/ajax/tiny_mce_wcm_extensions.js">&#160;</script>
<script language="javascript" type="text/javascript">
if (!String.prototype.startsWith)
{
String.prototype.startsWith = function(s)
{
return this.indexOf(s) == 0;
}
}
<!-- Init the Tiny MCE in-line HTML editor -->
var alfresco = typeof alfresco == "undefined" ? {} : alfresco;
@@ -58,14 +54,18 @@ if (!String.prototype.startsWith)
alfresco.constants.WEBAPP_CONTEXT = "${pageContext.request.contextPath}";
alfresco.constants.AVM_WEBAPP_URL = "${WizardManager.bean.previewSandboxUrl}";
alfresco.resources = {
loading: "${msg.loading}",
ide: "${msg.idle}",
alfresco.resources =
{
//XXXarielb deal with encoding
add_content: "${msg.add_content}",
cancel: "${msg.cancel}",
change: "${msg.change}",
go_up: "${msg.go_up}",
upload: "${msg.upload}",
ide: "${msg.idle}",
loading: "${msg.loading}",
path: "${msg.path}",
cancel: "${msg.cancel}"
select: "${msg.select}",
upload: "${msg.upload}"
};
tinyMCE.init({
@@ -82,16 +82,13 @@ if (!String.prototype.startsWith)
theme_advanced_disable: "styleselect",
extended_valid_elements : "a[href|target|name],font[face|size|color|style],span[class|align|style]",
urlconverter_callback: "alfresco_TinyMCE_urlconverter_callback",
execcommand_callback: "alfresco_TinyMCE_execcommand_callback",
execcommand_callback: "alfresco_TinyMCE_execcommand_callback"
});
function saveContent(id, content)
{
document.getElementById("wizard:wizard-body:editor-output").value = content;
}
var isIE = (document.all);
</script>
<div id='editor' style='width:100%; height:360px'>

View File

@@ -20,7 +20,7 @@
* and Open Source Software ("FLOSS") applications as described in Alfresco's
* FLOSS exception. You should have recieved a copy of the text describing
* the FLOSS exception, and it is also available here:
* http://www.alfresco.com/legal/licensing"
* http://www.alfresco.com/legal/licensing
--%>
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
@@ -71,6 +71,10 @@
}
}
function mimeTypeChanged(event)
{
alert(event.target.id);
}
</script>
</f:verbatim>
@@ -96,7 +100,8 @@
<h:outputText value=""/>
<h:outputText value="#{msg.content_type}:"/>
<h:selectOneMenu value="#{WizardManager.bean.mimeType}"
valueChangeListener="#{WizardManager.bean.createContentChanged}">
valueChangeListener="#{WizardManager.bean.createContentChanged}"
onchange="mimeTypeChanged">
<f:selectItems value="#{WizardManager.bean.createMimeTypes}" />
</h:selectOneMenu>

View File

@@ -37,14 +37,44 @@
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>{$lang_insert_image_title}</title>
<script language="javascript" type="text/javascript" src="${pageContext.request.contextPath}/scripts/tiny_mce/tiny_mce_popup.js">&#160;</script>
<script language="javascript" type="text/javascript" src="${pageContext.request.contextPath}/scripts/tiny_mce/utils/mctabs.js">&#160;</script>
<script language="javascript" type="text/javascript" src="${pageContext.request.contextPath}/scripts/tiny_mce/utils/form_utils.js">&#160;</script>
<script language="javascript" type="text/javascript" src="${pageContext.request.contextPath}/scripts/tiny_mce/themes/advanced/jscripts/image.js">&#160;</script>
<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/css/xforms.css">&#160;</link>
<link rel="stylesheet"
type="text/css"
href="${pageContext.request.contextPath}/css/xforms.css">&#160;</link>
<script language="javascript"
type="text/javascript"
src="${pageContext.request.contextPath}/scripts/tiny_mce/tiny_mce_popup.js">&#160;</script>
<script language="javascript"
type="text/javascript"
src="${pageContext.request.contextPath}/scripts/tiny_mce/utils/mctabs.js">&#160;</script>
<script language="javascript"
type="text/javascript"
src="${pageContext.request.contextPath}/scripts/tiny_mce/utils/form_utils.js">&#160;</script>
<script language="javascript"
type="text/javascript"
src="${pageContext.request.contextPath}/scripts/tiny_mce/themes/advanced/jscripts/image.js">&#160;</script>
<script language="javascript"
type="text/javascript"
src="${pageContext.request.contextPath}/scripts/ajax/dojo/dojo.js">&#160;</script>
<script type="text/javascript">
var alfresco = {};
alfresco.constants = tinyMCEPopup.windowOpener.alfresco.constants;
alfresco.resources = tinyMCEPopup.windowOpener.alfresco.resources;
</script>
<script language="javascript"
type="text/javascript"
src="${pageContext.request.contextPath}/scripts/ajax/common.js">&#160;</script>
<script language="javascript"
type="text/javascript"
src="${pageContext.request.contextPath}/scripts/ajax/ajax_helper.js">&#160;</script>
<script language="javascript"
type="text/javascript"
src="${pageContext.request.contextPath}/scripts/upload_helper.js">&#160;</script>
<script language="javascript"
type="text/javascript"
src="${pageContext.request.contextPath}/scripts/ajax/file_picker_widget.js">&#160;</script>
<script type="text/javascript">
alfresco = tinyMCEPopup.windowOpener.alfresco;
var alfFilePickerWidgetInstance;
function loadPicker()
{
var d = document.getElementById("alfFilePicker");
@@ -52,33 +82,25 @@
function resizeHandler(event)
{
document.getElementById("panel_wrapper").style.height =
(d.offsetHeight >= 100 ? document.getElementById("panel_wrapper").offsetHeight + d.offsetHeight : pwOrigHeight) + "px";
(d.offsetHeight >= 100
? document.getElementById("panel_wrapper").offsetHeight + d.offsetHeight
: pwOrigHeight) + "px";
};
function changeHandler(picker)
{
document.getElementById("src").value = picker.getValue();
picker.node.style.display = "none";
document.getElementById("src").style.display = "inline";
document.getElementById("alfPickerTrigger").style.display = "inline";
};
alfFilePickerWidgetInstance = new alfresco.FilePickerWidget("alfFilePicker", d, "", false, changeHandler, resizeHandler)
alfFilePickerWidgetInstance.setValue(document.getElementById("src").value);
alfFilePickerWidgetInstance.render();
alfFilePickerWidgetInstance.node.style.display = "none";
// widget._navigateToNode("/");
}
function showPicker()
{
alfFilePickerWidgetInstance.node.style.display = "block";
document.getElementById("src").style.display = "none";
document.getElementById("alfPickerTrigger").style.display = "none";
alfFilePickerWidgetInstance._navigateToNode("/");
}
setTimeout("loadPicker();", 500);
</script>
<base target="_self" />
</head>
<body id="image" onload="tinyMCEPopup.executeOnLoad('init(); loadPicker();');" style="display: none">
<body id="image" onload="tinyMCEPopup.executeOnLoad('init();'); " style="display: none">
<form onsubmit="insertImage();return false;" action="#">
<div class="tabs">
<ul>
@@ -91,29 +113,17 @@
<table border="0" cellpadding="4" cellspacing="0" width="100%">
<tr>
<td nowrap="nowrap"><label for="src">{$lang_insert_image_src}</label></td>
<td width="100%">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="100%" nowrap="nowrap">
<input id="src" name="src" type="text" value="" style="width: 100%" onchange="getImageData();"/>
</td>
<td>
<input id="alfPickerTrigger" type="button" onclick="showPicker()" value="Browse Repository"/>
</td>
<td id="srcbrowsercontainer">&#160;</td>
</tr>
<tr>
<td colspan="3" width="100%">
<div id="alfFilePicker" style="width:100%"/>
</td>
</tr>
</table>
<input id="src" name="src" type="hidden" value="" onchange="getImageData();"/>
<div id="alfFilePicker" style="width: 100%; height: 100%;"/>
</td>
<td colspan="0" id="srcbrowsercontainer"/>
</tr>
<!-- Image list -->
<script type="text/javascript">
<!--
if (typeof(tinyMCEImageList) != "undefined" && tinyMCEImageList.length > 0) {
if (typeof(tinyMCEImageList) != "undefined" && tinyMCEImageList.length > 0)
{
var html = "";
html += '<tr><td><label for="image_list">{$lang_image_list}</label></td>';

View File

@@ -37,17 +37,44 @@
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>{$lang_insert_link_title}</title>
<script language="javascript" type="text/javascript" src="${pageContext.request.contextPath}/scripts/tiny_mce/tiny_mce_popup.js">&#160;</script>
<script language="javascript" type="text/javascript" src="${pageContext.request.contextPath}/scripts/tiny_mce/utils/mctabs.js">&#160;</script>
<script language="javascript" type="text/javascript" src="${pageContext.request.contextPath}/scripts/tiny_mce/utils/form_utils.js">&#160;</script>
<script language="javascript" type="text/javascript" src="${pageContext.request.contextPath}/scripts/tiny_mce/themes/advanced/jscripts/link.js">&#160;</script>
<script language="javascript" type="text/javascript" src="${pageContext.request.contextPath}/scripts/ajax/dojo/dojo.js">&#160;</script>
<script language="javascript" type="text/javascript" src="${pageContext.request.contextPath}/scripts/ajax/ajax_helper.js">&#160;</script>
<script language="javascript" type="text/javascript" src="${pageContext.request.contextPath}/scripts/ajax/file_picker_widget.js">&#160;</script>
<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/css/xforms.css">&#160;</link>
<link rel="stylesheet"
type="text/css"
href="${pageContext.request.contextPath}/css/xforms.css">&#160;</link>
<script language="javascript"
type="text/javascript"
src="${pageContext.request.contextPath}/scripts/tiny_mce/tiny_mce_popup.js">&#160;</script>
<script language="javascript"
type="text/javascript"
src="${pageContext.request.contextPath}/scripts/tiny_mce/utils/mctabs.js">&#160;</script>
<script language="javascript"
type="text/javascript"
src="${pageContext.request.contextPath}/scripts/tiny_mce/utils/form_utils.js">&#160;</script>
<script language="javascript"
type="text/javascript"
src="${pageContext.request.contextPath}/scripts/tiny_mce/themes/advanced/jscripts/link.js">&#160;</script>
<script language="javascript"
type="text/javascript"
src="${pageContext.request.contextPath}/scripts/ajax/dojo/dojo.js">&#160;</script>
<script type="text/javascript">
var alfresco = {};
alfresco.constants = tinyMCEPopup.windowOpener.alfresco.constants;
alfresco.resources = tinyMCEPopup.windowOpener.alfresco.resources;
</script>
<script language="javascript"
type="text/javascript"
src="${pageContext.request.contextPath}/scripts/ajax/common.js">&#160;</script>
<script language="javascript"
type="text/javascript"
src="${pageContext.request.contextPath}/scripts/ajax/ajax_helper.js">&#160;</script>
<script language="javascript"
type="text/javascript"
src="${pageContext.request.contextPath}/scripts/upload_helper.js">&#160;</script>
<script language="javascript"
type="text/javascript"
src="${pageContext.request.contextPath}/scripts/ajax/file_picker_widget.js">&#160;</script>
<script type="text/javascript">
alfresco = tinyMCEPopup.windowOpener.alfresco;
var alfFilePickerWidgetInstance;
function loadPicker()
{
var d = document.getElementById("alfFilePicker");
@@ -55,32 +82,23 @@
function resizeHandler(event)
{
document.getElementById("panel_wrapper").style.height =
(d.offsetHeight >= 100 ? document.getElementById("panel_wrapper").offsetHeight + d.offsetHeight : pwOrigHeight) + "px";
(d.offsetHeight >= 100
? document.getElementById("panel_wrapper").offsetHeight + d.offsetHeight
: pwOrigHeight) + "px";
};
function changeHandler(picker)
{
document.getElementById("href").value = picker.getValue();
picker.node.style.display = "none";
document.getElementById("href").style.display = "inline";
document.getElementById("alfPickerTrigger").style.display = "inline";
};
alfFilePickerWidgetInstance = new alfresco.FilePickerWidget("alfFilePicker", d, "", false, changeHandler, resizeHandler)
alfFilePickerWidgetInstance.setValue(document.getElementById("href").value);
alfFilePickerWidgetInstance.render();
alfFilePickerWidgetInstance.node.style.display = "none";
// widget._navigateToNode("/");
}
function showPicker()
{
alfFilePickerWidgetInstance.node.style.display = "block";
document.getElementById("href").style.display = "none";
document.getElementById("alfPickerTrigger").style.display = "none";
alfFilePickerWidgetInstance._navigateToNode("/");
}
setTimeout("loadPicker();", 500);
</script>
<base target="_self" />
</head>
<body id="link" onload="tinyMCEPopup.executeOnLoad('init(); loadPicker();');" style="display: none">
<body id="link" onload="tinyMCEPopup.executeOnLoad('init();');" style="display: none">
<form onsubmit="insertLink();return false;" action="#">
<div class="tabs">
<ul>
@@ -93,24 +111,11 @@
<table border="0" cellpadding="4" cellspacing="0" width="100%">
<tr>
<td nowrap="nowrap"><label for="href">{$lang_insert_link_url}</label></td>
<td width="100%">
<table border="0" cellspacing="0" cellpadding="0" width="100%">
<tr>
<td width="100%" nowrap="nowrap">
<input id="href" name="href" type="text" value="" style="width: 100%"/>
</td>
<td>
<input id="alfPickerTrigger" type="button" onclick="showPicker()" value="Browse Repository"/>
</td>
<td id="hrefbrowsercontainer">&#160;</td>
</tr>
<tr>
<td colspan="3" width="100%">
<div id="alfFilePicker" style="width:100%"/>
</td>
</tr>
</table>
<input id="href" name="href" type="hidden" value=""/>
<div id="alfFilePicker" style="width: 100%; height: 100%;"/>
</td>
<td colspan="0" id="hrefbrowsercontainer"/>
</tr>
<!-- Link list -->
<script type="text/javascript">

View File

@@ -36,11 +36,14 @@ alfresco.AjaxHelper = function()
{
}
/** All pending ajax requests. */
alfresco.AjaxHelper._requests = [];
/** Creates an ajax request object. */
alfresco.AjaxHelper.createRequest = function(target, serverMethod, methodArgs, load, error)
{
var result = new dojo.io.Request(alfresco.constants.WEBAPP_CONTEXT +
"/ajax/invoke/XFormsBean." + serverMethod,
"/ajax/invoke/" + serverMethod,
"text/xml");
result.target = target;
result.content = methodArgs;
@@ -97,9 +100,6 @@ alfresco.AjaxHelper._getLoaderElement = function()
return result;
}
/** All pending ajax requests. */
alfresco.AjaxHelper._requests = [];
/** Updates the loader message or hides it if nothing is being loaded. */
alfresco.AjaxHelper._updateLoaderDisplay = function()
{

View File

@@ -284,3 +284,34 @@ function log(message)
logLine.appendChild(log.window_.document.createTextNode(message));
log.window_.document.body.appendChild(logLine);
}
if (!String.prototype.startsWith)
{
String.prototype.startsWith = function(s)
{
return this.indexOf(s) == 0;
}
}
if (!Array.prototype.indexOf)
{
Array.prototype.indexOf = function(o)
{
for (var i = 0; i < this.length; i++)
{
if (this[i] == o)
{
return i;
}
}
return -1;
}
}
if (!Array.prototype.peek)
{
Array.prototype.peek = function(o)
{
return this[this.length - 1];
}
}

View File

@@ -24,7 +24,20 @@
// This script requires dojo.js, ajax_helper.js and upload_helper.js to be
// loaded in advance.
////////////////////////////////////////////////////////////////////////////////
alfresco = typeof alfresco == "undefined" ? {} : alfresco;
if (typeof alfresco == "undefined")
{
throw new Error("file_picker_widget requires alfresco be defined");
}
if (typeof alfresco.constants == "undefined")
{
throw new Error("file_picker_widget requires alfresco.constants be defined");
}
if (typeof alfresco.resources == "undefined")
{
throw new Error("file_picker_widget requires alfresco.resources be defined");
}
/**
* The file picker widget.
@@ -55,7 +68,7 @@ alfresco.FilePickerWidget._handleUpload = function(id, fileInput, webappRelative
id,
alfresco.FilePickerWidget._upload_completeHandler,
alfresco.constants.WEBAPP_CONTEXT,
"/ajax/invoke/XFormsBean.uploadFile",
"/ajax/invoke/FilePickerBean.uploadFile",
{ currentPath: webappRelativePath });
}
@@ -182,18 +195,21 @@ _showSelectedValue: function()
this._selectButton = d.createElement("input");
this._selectButton.filePickerWidget = this;
this._selectButton.type = "button";
this._selectButton.value = this.value == null ? "Select" : "Change";
this._selectButton.value = (this.value == null
? alfresco.resources["select"]
: alfresco.resources["change"]);
this._selectButton.disabled = this.readonly;
this._selectButton.style.margin = "0px 10px 0px 10px";
this._selectButton.style.margin = "0px 10px";
this.node.appendChild(this._selectButton);
this.selectedPathInput.style.width = (1 -
((this._selectButton.offsetWidth +
dojo.html.getMargin(this._selectButton).width) /
dojo.html.getContentBox(this.node).width)) * 100 + "%";
dojo.event.connect(this._selectButton,
dojo.event.browser.addListener(this._selectButton,
"onclick",
this,
this._selectButton_clickHandler);
},
@@ -211,7 +227,7 @@ _selectPathInput_changeHandler: function(event)
_navigateToNode: function(path)
{
var req = alfresco.AjaxHelper.createRequest(this,
"getFilePickerData",
"FilePickerBean.getFilePickerData",
{},
function(type, data, evt)
{
@@ -236,7 +252,6 @@ _showPicker: function(data)
parseInt(this.statusDiv.style.marginTop) +
parseInt(this.statusDiv.style.marginBottom))
: 0) + "px");
this.resize_callback(this);
var currentPath = data.getElementsByTagName("current-node")[0];
@@ -305,6 +320,7 @@ _showPicker: function(data)
var addContentLink = d.createElement("a");
headerRightDiv.appendChild(addContentLink);
addContentLink.setAttribute("webappRelativePath", currentPath);
addContentLink.style.textDecoration = "none";
addContentLink.filePickerWidget = this;
addContentLink.setAttribute("href", "javascript:void(0)");
dojo.event.connect(addContentLink,
@@ -335,6 +351,7 @@ _showPicker: function(data)
headerRightDiv.appendChild(navigateToParentLink);
navigateToParentLink.setAttribute("webappRelativePath", currentPath);
navigateToParentLink.filePickerWidget = this;
navigateToParentLink.style.textDecoration = "none";
navigateToParentLink.setAttribute("href", "javascript:void(0)");
if (currentPathName != "/")
{
@@ -394,7 +411,6 @@ _showPicker: function(data)
(this.statusDiv ? this.statusDiv.offsetHeight : 0) -
footerDiv.offsetHeight -
headerDiv.offsetHeight - 10) + "px";
var childNodes = data.getElementsByTagName("child-node");
for (var i = 0; i < childNodes.length; i++)
{
@@ -455,6 +471,7 @@ _createRow: function(fileName, webappRelativePath, isDirectory, fileTypeImage,
{
e = d.createElement("a");
e.filePickerWidget = this;
e.style.textDecoration = "none";
e.setAttribute("href", "javascript:void(0)");
e.setAttribute("webappRelativePath", webappRelativePath);
dojo.event.connect(e, "onclick", function(event)

View File

@@ -106,7 +106,7 @@ function alfresco_TinyMCE_execcommand_callback(editor_id, elm, command, user_int
var window_props = { file: alfresco.constants.WEBAPP_CONTEXT + "/jsp/wcm/tiny_mce_link_dialog.jsp",
width: 510 + tinyMCE.getLang('lang_insert_link_delta_width', 0),
height: 400 + tinyMCE.getLang('lang_insert_link_delta_height', 0) };
height: 265 + tinyMCE.getLang('lang_insert_link_delta_height', 0) };
var dialog_props = { href: href,
target: target,
title: title,
@@ -201,7 +201,7 @@ function alfresco_TinyMCE_execcommand_callback(editor_id, elm, command, user_int
var window_props = { file: alfresco.constants.WEBAPP_CONTEXT + "/jsp/wcm/tiny_mce_image_dialog.jsp",
width: 510 + tinyMCE.getLang('lang_insert_image_delta_width', 0),
height: 400 + (tinyMCE.isMSIE ? 25 : 0) + tinyMCE.getLang('lang_insert_image_delta_height', 0) };
height: 265 + (tinyMCE.isMSIE ? 25 : 0) + tinyMCE.getLang('lang_insert_image_delta_height', 0) };
var dialog_props = { src: src,
alt: alt,
border: border,

View File

@@ -3944,7 +3944,7 @@ dojo.declare("alfresco.xforms.XForm",
function()
{
var req = alfresco.AjaxHelper.createRequest(this,
"getXForm",
"XFormsBean.getXForm",
{},
function(type, data, evt, kwArgs)
{
@@ -4134,7 +4134,7 @@ dojo.declare("alfresco.xforms.XForm",
};
var req = alfresco.AjaxHelper.createRequest(this,
"swapRepeatItems",
"XFormsBean.swapRepeatItems",
params,
function(type, data, event)
{
@@ -4156,7 +4156,7 @@ dojo.declare("alfresco.xforms.XForm",
}
params.repeatIds = params.repeatIds.join(",");
var req = alfresco.AjaxHelper.createRequest(this,
"setRepeatIndeces",
"XFormsBean.setRepeatIndeces",
params,
function(type, data, evt)
{
@@ -4169,7 +4169,7 @@ dojo.declare("alfresco.xforms.XForm",
fireAction: function(id)
{
var req = alfresco.AjaxHelper.createRequest(this,
"fireAction",
"XFormsBean.fireAction",
{ id: id },
function(type, data, evt)
{
@@ -4185,7 +4185,7 @@ dojo.declare("alfresco.xforms.XForm",
value = value == null ? "" : value;
dojo.debug("setting value " + id + " = " + value);
var req = alfresco.AjaxHelper.createRequest(this,
"setXFormsValue",
"XFormsBean.setXFormsValue",
{ id: id, value: value },
function(type, data, evt)
{
@@ -4472,7 +4472,7 @@ function _show_error(msg)
}
////////////////////////////////////////////////////////////////////////////////
// DOM utilities
// DOM utilities - XXXarielb should be merged into common.js
////////////////////////////////////////////////////////////////////////////////
function _findElementById(node, id)
@@ -4596,36 +4596,6 @@ if (!XPathResult)
FIRST_ORDERED_NODE_TYPE: 9
};
}
if (!String.prototype.startsWith)
{
String.prototype.startsWith = function(s)
{
return this.indexOf(s) == 0;
}
}
if (!Array.prototype.indexOf)
{
Array.prototype.indexOf = function(o)
{
for (var i = 0; i < this.length; i++)
{
if (this[i] == o)
{
return i;
}
}
return -1;
}
}
if (!Array.prototype.peek)
{
Array.prototype.peek = function(o)
{
return this[this.length - 1];
}
}
dojo.html.toCamelCase = function(str)
{