Merged V2.1 to HEAD

6636: Temporary hack to fix build.  
   6637: Better handling of binary string bufs, disable link validation when poll interval is <= 0
   6638: Forgotten files for TXT to PDF transformer.
   6639: Fix for AWC-1541
   6641: Fix for WCM-792.
   6642: A little extra PropertyValue support for createNode, too.
   6643: Fix for WCM-791
   6644: Closure of AR-1528: Check concurrency handling of DuplicateChildNodeNameException
   6647: Fix WCM-794
   6648: WCM-656
   6650: Applied user supplied patch to fix AWC-1546 - Cannot mount AVM using CIFS on new alfresco installation.
   6651: Index tidy ups
   6654: Various minor updates for passthru authentication debugging and error handling.
   6657: Fix for WCM-799 (Some items selected for submission were not present)
   6659: Updated installers.
   6660: Partial fix to AWC-1524
   6661: Fix WCM-803
   6664: Including  hibernate-3.2.1.jar in $VIRTUAL_TOMCAT_HOME/server/lib/ 
   6665: adding an automated unit test for output path patterns.
   6668: Fixed to add shale-test-1.0.4.jar to Eclipse classpath (PHH oked)
   6681: Fixes WCM-811 - Lookup.getIndirectionPath() had a bit of a howler in it.
   6684: UncategorizedSQLException with the word 'deadlock' in the message is now cause for retrying a transaction.
   6691: Fix for WCM-813 (lock not removed when expiration date set and no workflow on web project)
   6696: Imporved SSO filters for SiteMinder etc + test filter
   6697: Support for scheduled import
   6699: Fix for the compliation target:  compile-benchmarkframework 
   6701: Fix for 1.6 JVMs (1.5 gets by with lucky ordering)


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@6749 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Derek Hulley
2007-09-11 04:18:53 +00:00
parent f279d99d80
commit ac03bb5f8c
14 changed files with 486 additions and 728 deletions

View File

@@ -47,6 +47,7 @@ alfresco.FilePickerWidget = function(uploadId,
value,
readonly,
change_callback,
cancel_callback,
resize_callback,
selectableTypes,
filterMimetypes)
@@ -56,7 +57,8 @@ alfresco.FilePickerWidget = function(uploadId,
this.value = value == null || value.length == 0 ? null : value;
this.readonly = readonly || false;
this.change_callback = change_callback;
this.resize_callback = resize_callback;
this.cancel_callback = cancel_callback || function() {};
this.resize_callback = resize_callback || function() {};
this.selectableTypes = selectableTypes;
this.filterMimetypes = filterMimetypes;
}
@@ -72,7 +74,6 @@ alfresco.FilePickerWidget._handleUpload = function(id, fileInput, webappRelative
path: fileInput.value,
webappRelativePath: webappRelativePath
};
handle_upload_helper(fileInput,
id,
alfresco.FilePickerWidget._upload_completeHandler,
@@ -123,6 +124,13 @@ setReadonly: function(r)
}
},
destroy: function()
{
dojo.dom.removeChildren(this.node);
this.node.parentNode.removeChild(this.node);
this.node = null;
},
render: function()
{
this._showSelectedValue();
@@ -181,6 +189,10 @@ _hideStatus: function()
_showSelectedValue: function()
{
if (this.node == null)
{
return;
}
var d = this.node.ownerDocument;
dojo.dom.removeChildren(this.node);
this.statusDiv = null;
@@ -306,21 +318,21 @@ _showPicker: function(data)
event.currentTarget.style.borderStyle = "solid";
}
});
dojo.event.connect(this.headerMenuTriggerLink,
"onclick",
function(event)
{
var t = event.currentTarget;
var w = t.filePickerWidget;
if (w.parentPathMenu)
{
w._closeParentPathMenu();
}
else
{
w._openParentPathMenu(t, t.getAttribute("webappRelativePath"));
}
});
// can't use dojo's event handling since it screws up when opened in another window
var filePickerWidget = this;
var headerMenuTriggerLink = this.headerMenuTriggerLink;
this.headerMenuTriggerLink.onclick = function(event)
{
if (filePickerWidget.parentPathMenu)
{
filePickerWidget._closeParentPathMenu();
}
else
{
filePickerWidget._openParentPathMenu(headerMenuTriggerLink,
headerMenuTriggerLink.getAttribute("webappRelativePath"));
}
};
this.headerMenuTriggerLink.appendChild(d.createTextNode(currentPathName));
@@ -422,6 +434,7 @@ _showPicker: function(data)
dojo.event.connect(cancelButton, "onclick", function(event)
{
var w = event.target.filePickerWidget;
w.cancel_callback(this);
w._showSelectedValue();
});
this.contentDiv.style.height = (this.node.offsetHeight -
@@ -457,33 +470,19 @@ _createRow: function(fileName, webappRelativePath, isDirectory, isSelectable, f
var d = this.contentDiv.ownerDocument;
var result = d.createElement("div");
result.setAttribute("id", fileName + "-row");
result.setAttribute("webappRelativePath", webappRelativePath);
result.filePickerWidget = this;
dojo.html.setClass(result, "xformsFilePickerRow " + rowClass);
dojo.event.browser.addListener(result,
"mouseover",
function(event)
{
var prevHover = event.currentTarget.parentNode.hoverNode;
if (prevHover)
{
dojo.html.removeClass(prevHover, "xformsRowHover");
}
event.currentTarget.parentNode.hoverNode = event.currentTarget;
dojo.html.addClass(event.currentTarget, "xformsRowHover");
},
true);
dojo.event.browser.addListener(result,
"mouseout",
function(event)
{
if (event.relatedTarget &&
event.relatedTarget.parentNode == event.currentTarget)
{
return true;
}
dojo.html.removeClass(event.currentTarget, "xformsRowHover");
},
true);
result.onmouseover = function()
{
var prevHover = result.parentNode.hoverNode;
if (prevHover)
{
dojo.html.removeClass(prevHover, "xformsRowHover");
}
result.parentNode.hoverNode = result;
dojo.html.addClass(result, "xformsRowHover");
};
var e = d.createElement("img");
e.align = "absmiddle";
e.style.margin = "0px 4px 0px 4px";
@@ -493,16 +492,15 @@ _createRow: function(fileName, webappRelativePath, isDirectory, isSelectable, f
if (isDirectory)
{
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)
{
var w = event.target.filePickerWidget;
w._navigateToNode(event.target.getAttribute("webappRelativePath"));
return true;
});
e.onclick = function()
{
var w = result.filePickerWidget;
w._navigateToNode(result.getAttribute("webappRelativePath"));
return true;
};
e.appendChild(d.createTextNode(fileName));
result.appendChild(e);
}
@@ -513,7 +511,6 @@ _createRow: function(fileName, webappRelativePath, isDirectory, isSelectable, f
if (isSelectable)
{
e = d.createElement("input");
e.filePickerWidget = this;
e.type = "button";
e.name = webappRelativePath;
e.value = "Select";
@@ -522,12 +519,12 @@ _createRow: function(fileName, webappRelativePath, isDirectory, isSelectable, f
e.style.position = "absolute";
e.style.right = "10px";
e.style.top = (.5 * result.offsetHeight) - (.5 * e.offsetHeight) + "px";
dojo.event.connect(e, "onclick", function(event)
{
var w = event.target.filePickerWidget;
w.setValue(event.target.name);
w._showSelectedValue();
});
e.onclick = function()
{
var w = result.filePickerWidget;
w.setValue(result.getAttribute("webappRelativePath"));
w._showSelectedValue();
};
}
return result;
},
@@ -578,33 +575,33 @@ _showAddContent: function(currentPath)
fileInputDiv.style.right = "10px";
fileInputDiv.style.top = (.5 * this.addContentDiv.offsetHeight) - (.5 * fileInputDiv.offsetHeight) + "px";
dojo.event.connect(fileInput,
"onchange",
function(event)
{
var w = event.target.widget;
if (w.addContentDiv)
{
var d = w.addContentDiv.ownerDocument;
dojo.dom.removeChildren(w.addContentDiv);
var fileName = event.target.value.replace(/.*[\/\\]([^\/\\]+)/, "$1");
w.addContentDiv.appendChild(d.createTextNode(alfresco.resources["upload"] + ": " + fileName));
var img = d.createElement("img");
img.setAttribute("src", alfresco.constants.WEBAPP_CONTEXT +
"/images/icons/process_animation.gif");
img.style.position = "absolute";
img.style.right = "10px";
img.style.height = (.5 * w.addContentDiv.offsetHeight) + "px";
img.style.top = (.25 * w.addContentDiv.offsetHeight) + "px";
w.addContentDiv.appendChild(img);
}
alfresco.FilePickerWidget._handleUpload(w.uploadId,
event.target,
event.target.getAttribute("webappRelativePath"),
w);
});
fileInput.onchange = function(event)
{
event = event || fileInput.ownerDocument.parentWindow.event;
var target = event.target || event.srcElement;
var w = target.widget;
if (w.addContentDiv)
{
var d = w.addContentDiv.ownerDocument;
dojo.dom.removeChildren(w.addContentDiv);
var fileName = target.value.replace(/.*[\/\\]([^\/\\]+)/, "$1");
w.addContentDiv.appendChild(d.createTextNode(alfresco.resources["upload"] + ": " + fileName));
var img = d.createElement("img");
img.setAttribute("src", alfresco.constants.WEBAPP_CONTEXT +
"/images/icons/process_animation.gif");
img.style.position = "absolute";
img.style.right = "10px";
img.style.height = (.5 * w.addContentDiv.offsetHeight) + "px";
img.style.top = (.25 * w.addContentDiv.offsetHeight) + "px";
w.addContentDiv.appendChild(img);
}
alfresco.FilePickerWidget._handleUpload(w.uploadId,
target,
target.getAttribute("webappRelativePath"),
w);
};
},
_upload_completeHandler: function(fileName, webappRelativePath, fileTypeImage, error)
@@ -626,6 +623,7 @@ _upload_completeHandler: function(fileName, webappRelativePath, fileTypeImage, e
var row = this._createRow(fileName,
webappRelativePath == "/" ? "/" + fileName : webappRelativePath + "/" + fileName,
false,
true /* this is potentially inaccurate - need to add some checks in the backing bean to check selectable */,
fileTypeImage,
rowClass);
this.contentDiv.replaceChild(row, this.addContentDiv);
@@ -655,11 +653,11 @@ _openParentPathMenu: function(target, path)
// outside of the menu
var parentPathMenu_documentClickHandler = function(event)
{
var t = event.target;
var d = event.target.ownerDocument;
event = event || d.parentWindow.event;
var t = event.target || event.srcElement;
// always remove - this handler only ever needs to handle a single click
d.removeEventListener("click", parentPathMenu_documentClickHandler, true);
dojo.event.browser.removeListener(d, "click", parentPathMenu_documentClickHandler, true, true);
while (t && t != d)
{
if (t == d.currentParentPathMenu ||
@@ -672,7 +670,8 @@ _openParentPathMenu: function(target, path)
}
d.currentParentPathMenu.filePickerWidget._closeParentPathMenu();
};
d.addEventListener("click", parentPathMenu_documentClickHandler, true);
dojo.event.browser.addListener(d, "click", parentPathMenu_documentClickHandler, true, true);
dojo.html.setClass(this.parentPathMenu, "xformsFilePickerParentPathMenu");

View File

@@ -48,184 +48,42 @@ function alfresco_TinyMCE_urlconverter_callback(href, element, onsave)
return result;
}
function alfresco_TinyMCE_execcommand_callback(editor_id, elm, command, user_interface, value)
function alfresco_TinyMCE_file_browser_callback(field_name, url, type, win)
{
if (command == "mceLink")
{
// BEGIN COPIED FROM ADVANCED THEME editor_template_src.js
var inst = tinyMCE.getInstanceById(editor_id);
var doc = inst.getDoc();
var selectedText = (tinyMCE.isMSIE
? doc.selection.createRange().text
: inst.getSel().toString());
if (!tinyMCE.linkElement &&
tinyMCE.selectedElement.nodeName.toLowerCase() != "img" &&
selectedText.length <= 0)
{
return true;
}
var href = "", target = "", title = "", onclick = "", action = "insert", style_class = "";
if (tinyMCE.selectedElement.nodeName.toLowerCase() == "a")
{
tinyMCE.linkElement = tinyMCE.selectedElement;
}
// Is anchor not a link
if (tinyMCE.linkElement != null && tinyMCE.getAttrib(tinyMCE.linkElement, 'href') == "")
{
tinyMCE.linkElement = null;
}
if (tinyMCE.linkElement)
{
href = tinyMCE.getAttrib(tinyMCE.linkElement, 'href');
target = tinyMCE.getAttrib(tinyMCE.linkElement, 'target');
title = tinyMCE.getAttrib(tinyMCE.linkElement, 'title');
onclick = tinyMCE.getAttrib(tinyMCE.linkElement, 'onclick');
style_class = tinyMCE.getAttrib(tinyMCE.linkElement, 'class');
// Try old onclick to if copy/pasted content
if (onclick == "")
{
onclick = tinyMCE.getAttrib(tinyMCE.linkElement, 'onclick');
}
onclick = tinyMCE.cleanupEventStr(onclick);
href = eval(tinyMCE.settings['urlconverter_callback'] + "(href, tinyMCE.linkElement, true);");
// Use mce_href if defined
mceRealHref = tinyMCE.getAttrib(tinyMCE.linkElement, 'mce_href');
if (mceRealHref != "")
{
href = mceRealHref;
if (tinyMCE.getParam('convert_urls'))
{
href = eval(tinyMCE.settings['urlconverter_callback'] + "(href, tinyMCE.linkElement, true);");
}
}
action = "update";
}
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: 265 + tinyMCE.getLang('lang_insert_link_delta_height', 0) };
var dialog_props = { href: href,
target: target,
title: title,
onclick: onclick,
action: action,
className: style_class,
inline: "yes" };
tinyMCE.openWindow(window_props, dialog_props);
return true;
}
else if (command == "mceImage")
{
var src = "", alt = "", border = "", hspace = "", vspace = "", width = "", height = "", align = "",
title = "", onmouseover = "", onmouseout = "", action = "insert";
var img = tinyMCE.imgElement;
var inst = tinyMCE.getInstanceById(editor_id);
if (tinyMCE.selectedElement != null && tinyMCE.selectedElement.nodeName.toLowerCase() == "img")
{
img = tinyMCE.selectedElement;
tinyMCE.imgElement = img;
}
if (img)
{
// Is it a internal MCE visual aid image, then skip this one.
if (tinyMCE.getAttrib(img, 'name').indexOf('mce_') == 0)
{
return true;
}
src = tinyMCE.getAttrib(img, 'src');
alt = tinyMCE.getAttrib(img, 'alt');
// Try polling out the title
if (alt == "")
{
alt = tinyMCE.getAttrib(img, 'title');
}
// Fix width/height attributes if the styles is specified
if (tinyMCE.isGecko)
{
var w = img.style.width;
if (w != null && w.length != 0)
{
img.setAttribute("width", w);
}
var h = img.style.height;
if (h != null && h.length != 0)
{
img.setAttribute("height", h);
}
}
border = tinyMCE.getAttrib(img, 'border');
hspace = tinyMCE.getAttrib(img, 'hspace');
vspace = tinyMCE.getAttrib(img, 'vspace');
width = tinyMCE.getAttrib(img, 'width');
height = tinyMCE.getAttrib(img, 'height');
align = tinyMCE.getAttrib(img, 'align');
onmouseover = tinyMCE.getAttrib(img, 'onmouseover');
onmouseout = tinyMCE.getAttrib(img, 'onmouseout');
title = tinyMCE.getAttrib(img, 'title');
// Is realy specified?
if (tinyMCE.isMSIE)
{
width = img.attributes['width'].specified ? width : "";
height = img.attributes['height'].specified ? height : "";
}
//onmouseover = tinyMCE.getImageSrc(tinyMCE.cleanupEventStr(onmouseover));
//onmouseout = tinyMCE.getImageSrc(tinyMCE.cleanupEventStr(onmouseout));
src = eval(tinyMCE.settings['urlconverter_callback'] + "(src, img, true);");
// Use mce_src if defined
mceRealSrc = tinyMCE.getAttrib(img, 'mce_src');
if (mceRealSrc != "")
{
src = mceRealSrc;
if (tinyMCE.getParam('convert_urls'))
{
src = eval(tinyMCE.settings['urlconverter_callback'] + "(src, img, true);");
}
}
action = "update";
}
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: 265 + (tinyMCE.isMSIE ? 25 : 0) + tinyMCE.getLang('lang_insert_image_delta_height', 0) };
var dialog_props = { src: src,
alt: alt,
border: border,
hspace: hspace,
vspace: vspace,
width: width,
height: height,
align: align,
title: title,
onmouseover: onmouseover,
onmouseout: onmouseout,
action: action,
inline: "yes" };
tinyMCE.openWindow(window_props, dialog_props);
return true;
}
else
{
return false;
}
tinyMCE.importCSS(win.document, alfresco.constants.WEBAPP_CONTEXT + "/css/xforms.css");
var div = win.document.createElement("div");
div.style.width = "100%";
div.style.height = "100%";
div.style.backgroundColor = "white";
div.style.position = "absolute";
div.style.top = "0px";
div.style.left = "0px";
win.document.body.appendChild(div);
var pickerDiv = win.document.createElement("div");
pickerDiv.style.height = "100%";
pickerDiv.style.position = "relative";
div.appendChild(pickerDiv);
var picker = new alfresco.FilePickerWidget("alfFilePicker",
pickerDiv,
url,
false,
function(picker)
{
win.document.getElementById(field_name).value = picker.getValue();
picker.destroy();
div.parentNode.removeChild(div);
},
function()
{
picker.destroy();
div.parentNode.removeChild(div);
},
function(picker)
{
picker.node.style.height = div.offsetHeight + "px";
picker.node.style.width = div.offsetWidth + "px";
},
type == "image" ? ["wcm:avmcontent"] : [],
type == "image" ? ["image/*"] : []);
picker._navigateToNode(url);
}

View File

@@ -534,6 +534,7 @@ dojo.declare("alfresco.xforms.FilePicker",
this.getInitialValue(),
false,
this._filePicker_changeHandler,
null /* cancel is ignored */,
this._filePicker_resizeHandler,
this._selectableTypes,
this._filterMimetypes);
@@ -4725,13 +4726,13 @@ alfresco.constants.TINY_MCE_DEFAULT_SETTINGS =
entity_encoding: "raw",
add_unload_trigger: false,
add_form_submit_trigger: false,
execcommand_callback: "alfresco_TinyMCE_execcommand_callback",
theme_advanced_toolbar_location: "top",
theme_advanced_toolbar_align: "left",
theme_advanced_buttons1: "",
theme_advanced_buttons2: "",
theme_advanced_buttons3: "",
urlconverter_callback: "alfresco_TinyMCE_urlconverter_callback"
urlconverter_callback: "alfresco_TinyMCE_urlconverter_callback",
file_browser_callback: "alfresco_TinyMCE_file_browser_callback"
};
tinyMCE.init(dojo.lang.mixin(new Object(), alfresco.constants.TINY_MCE_DEFAULT_SETTINGS));