Merged V2.2 to HEAD

8206: Merged V2.1 to V2.2
      8136: Fixed AR-2043: XPathMetadataExtractor extracts empty strings
      8169: Fixes to Office add-in for ACT-267 - saving over an existing non-versionable file.
      8172: Fix for AWC-1838
   8221: Merged V2.1 to V2.2
      8210: Fix for AR-1830 - Search not returning expected results for umulat characters
      8211: Fix for AWC-1463 - MyWebForms and MyWebFiles templates now check for existance of stores before displaying them
   8222: Merged V2.1 to V2.2
      8216: Fix for AWC-1357
   8223: Missing Serializable interface (for web UI clustering)

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@8485 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Kevin Roast
2008-03-10 16:37:24 +00:00
parent c473277dbc
commit 163bb15d5e
8 changed files with 66 additions and 30 deletions

View File

@@ -155,10 +155,10 @@
<#assign versionRow=versionRow+1> <#assign versionRow=versionRow+1>
<tr class="${(versionRow % 2 = 0)?string("odd", "even")}"> <tr class="${(versionRow % 2 = 0)?string("odd", "even")}">
<td valign="top"> <td valign="top">
<a title="Open ${record.versionLabel}" href="${url.context}${record.url}?ticket=${session.ticket}"><img src="${url.context}/images/office/document.gif" alt="Open ${record.versionLabel}" /></a> <a title="Download ${record.versionLabel}" href="${url.context}${record.url}?ticket=${session.ticket}"><img src="${url.context}/images/office/document.gif" alt="Open ${record.versionLabel}" /></a>
</td> </td>
<td> <td>
<a title="Open ${record.versionLabel}" href="${url.context}${record.url}?ticket=${session.ticket}"><span style="font-weight:bold;">${record.versionLabel}</span></a><br /> <a title="Download ${record.versionLabel}" href="${url.context}${record.url}?ticket=${session.ticket}"><span style="font-weight:bold;">${record.versionLabel}</span></a><br />
Author: ${record.creator}<br /> Author: ${record.creator}<br />
Date: ${record.createdDate?datetime}<br /> Date: ${record.createdDate?datetime}<br />
<#if record.description?exists> <#if record.description?exists>

View File

@@ -140,6 +140,7 @@
<#assign documentsFound = 0> <#assign documentsFound = 0>
<#list thisSpace.children?sort_by('name') as child> <#list thisSpace.children?sort_by('name') as child>
<#if child.isDocument> <#if child.isDocument>
<#assign isVersionable = (hasAspect(child, "cm:versionable") == 1)>
<#assign documentsFound = documentsFound + 1> <#assign documentsFound = documentsFound + 1>
<#assign relativePath = (child.displayPath?substring(chLen+1) + '/' + child.name)?url?replace('%2F', '/')?replace('\'', '\\\'') /> <#assign relativePath = (child.displayPath?substring(chLen+1) + '/' + child.name)?url?replace('%2F', '/')?replace('\'', '\\\'') />
<div class="documentItem ${(documentsFound % 2 = 0)?string("even", "odd")}"> <div class="documentItem ${(documentsFound % 2 = 0)?string("even", "odd")}">
@@ -152,7 +153,7 @@
</span> </span>
<span class="documentItemDetails"> <span class="documentItemDetails">
<#if child.name?ends_with(extn) || child.name?ends_with(extnx)> <#if child.name?ends_with(extn) || child.name?ends_with(extnx)>
<a href="#" onclick="window.external.openDocument('${relativePath}')"><span class="bold">${child.name}</span></a> <a href="#" onclick="window.external.openDocument('${relativePath}')"><span class="bold ${isVersionable?string("versionable", "notVersionable")}">${child.name}</span></a>
<#else> <#else>
<a href="${url.context}${child.url}?ticket=${session.ticket}" rel="_blank"><span class="bold">${child.name}</span></a> <a href="${url.context}${child.url}?ticket=${session.ticket}" rel="_blank"><span class="bold">${child.name}</span></a>
</#if> </#if>

View File

@@ -28,6 +28,7 @@
<#assign storeId=wp.properties["wca:avmstore"]> <#assign storeId=wp.properties["wca:avmstore"]>
<#assign username=person.properties.userName> <#assign username=person.properties.userName>
<#assign sandbox=avm.userSandboxStore(storeId, username)> <#assign sandbox=avm.userSandboxStore(storeId, username)>
<#if avm.lookupStore(sandbox)?exists>
<div class="webProjectRow"> <div class="webProjectRow">
<div class="webProjectTitle"> <div class="webProjectTitle">
<a class="webPreviewLink" href="${avm.websiteUserSandboxUrl(storeId, username)}" target="new"><img src="${url.context}/images/icons/website_large.gif" width=32 height=32 border=0><span class="websiteLink">${wp.name}</span></a> <a class="webPreviewLink" href="${avm.websiteUserSandboxUrl(storeId, username)}" target="new"><img src="${url.context}/images/icons/website_large.gif" width=32 height=32 border=0><span class="websiteLink">${wp.name}</span></a>
@@ -72,6 +73,7 @@
</div> </div>
</div> </div>
</div> </div>
</#if>
</#if> </#if>
</#list> </#list>
</#list> </#list>

View File

@@ -28,6 +28,7 @@
<#assign storeId=wp.properties["wca:avmstore"]> <#assign storeId=wp.properties["wca:avmstore"]>
<#assign username=person.properties.userName> <#assign username=person.properties.userName>
<#assign sandbox=avm.userSandboxStore(storeId, username)> <#assign sandbox=avm.userSandboxStore(storeId, username)>
<#if avm.lookupStore(sandbox)?exists>
<div class="webProjectRow"> <div class="webProjectRow">
<div class="webProjectTitle"> <div class="webProjectTitle">
<a class="webPreviewLink" href="${avm.websiteUserSandboxUrl(storeId, username)}" target="new"><img src="${url.context}/images/icons/website_large.gif" width=32 height=32 border=0><span class="websiteLink">${wp.name}</span></a> <a class="webPreviewLink" href="${avm.websiteUserSandboxUrl(storeId, username)}" target="new"><img src="${url.context}/images/icons/website_large.gif" width=32 height=32 border=0><span class="websiteLink">${wp.name}</span></a>
@@ -56,6 +57,7 @@
</#if> </#if>
</div> </div>
</div> </div>
</#if>
</#if> </#if>
</#list> </#list>
</#list> </#list>

View File

@@ -502,21 +502,10 @@ public class SearchContext implements Serializable
*/ */
private static void processSearchAttribute(QName qname, String value, StringBuilder buf, boolean andOp, boolean notOp) private static void processSearchAttribute(QName qname, String value, StringBuilder buf, boolean andOp, boolean notOp)
{ {
if (value.indexOf(' ') == -1) if (andOp) buf.append('+');
{ else if (notOp) buf.append('-');
if (andOp) buf.append('+'); buf.append('@').append(Repository.escapeQName(qname)).append(":\"")
else if (notOp) buf.append('-'); .append(value).append("\" ");
buf.append('@').append(Repository.escapeQName(qname)).append(":")
.append(SearchContext.escape(value)).append(' ');
}
else
{
// phrase multi-word search
if (andOp) buf.append('+');
else if (notOp) buf.append('-');
buf.append('@').append(Repository.escapeQName(qname)).append(":\"")
.append(value).append('"').append(' ');
}
} }
/** /**
@@ -530,9 +519,9 @@ public class SearchContext implements Serializable
*/ */
private static void processSearchTextAttribute(String qname, String value, StringBuilder attrBuf, StringBuilder textBuf) private static void processSearchTextAttribute(String qname, String value, StringBuilder attrBuf, StringBuilder textBuf)
{ {
textBuf.append("TEXT:").append(SearchContext.escape(value)); textBuf.append("TEXT:\"").append(value).append('"');
attrBuf.append("@").append(qname).append(":") attrBuf.append('@').append(qname).append(":\"")
.append(SearchContext.escape(value)); .append(value).append('"');
} }
/** /**

View File

@@ -267,7 +267,7 @@ public class UsersDialog extends BaseDialogBean implements IContextListener, Cha
UserTransaction tx = null; UserTransaction tx = null;
try try
{ {
tx = Repository.getUserTransaction(context, true); tx = Repository.getUserTransaction(context);
tx.begin(); tx.begin();
Map<QName, Serializable> props = properties.getNodeService().getProperties(properties.getPerson().getNodeRef()); Map<QName, Serializable> props = properties.getNodeService().getProperties(properties.getPerson().getNodeRef());

View File

@@ -992,7 +992,7 @@ public abstract class BaseAssociationEditor extends UIInput
if (contains != null && contains.length() > 0) if (contains != null && contains.length() > 0)
{ {
String safeContains = QueryParser.escape(contains.trim()); String safeContains = contains.trim();
// if the association's target is the person type search on the // if the association's target is the person type search on the
// firstName and lastName properties instead of the name property // firstName and lastName properties instead of the name property
@@ -1002,9 +1002,9 @@ public abstract class BaseAssociationEditor extends UIInput
query.append(safeContains); query.append(safeContains);
query.append("*\" @").append(NamespaceService.CONTENT_MODEL_PREFIX).append("\\:lastName:\"*"); query.append("*\" @").append(NamespaceService.CONTENT_MODEL_PREFIX).append("\\:lastName:\"*");
query.append(safeContains); query.append(safeContains);
query.append("*\" @").append(NamespaceService.CONTENT_MODEL_PREFIX).append("\\:userName:"); query.append("*\" @").append(NamespaceService.CONTENT_MODEL_PREFIX).append("\\:userName:\"");
query.append(safeContains); query.append(safeContains);
query.append("*)"); query.append("*\")");
} }
else else
{ {
@@ -1012,7 +1012,7 @@ public abstract class BaseAssociationEditor extends UIInput
String nameAttr = Repository.escapeQName(QName.createQName( String nameAttr = Repository.escapeQName(QName.createQName(
NamespaceService.CONTENT_MODEL_1_0_URI, "name")); NamespaceService.CONTENT_MODEL_1_0_URI, "name"));
query.append(nameAttr); query.append(nameAttr);
query.append(":*" + safeContains + "*"); query.append(":\"*" + safeContains + "*\"");
} }
} }

View File

@@ -10,12 +10,14 @@ var OfficeNavigation =
CREATE_SPACE_TEMPLATE: 16, CREATE_SPACE_TEMPLATE: 16,
OVERLAY_ANIM_LENGTH: 300, OVERLAY_ANIM_LENGTH: 300,
OVERLAY_OPACITY: 0.7, OVERLAY_OPACITY: 0.7,
documentNames: [],
init: function() init: function()
{ {
$('overlayPanel').setStyle('opacity', 0); $('overlayPanel').setStyle('opacity', 0);
OfficeNavigation.setupToggles(); OfficeNavigation.setupToggles();
OfficeNavigation.setupCreateSpace(); OfficeNavigation.setupCreateSpace();
OfficeNavigation.getDocumentNames();
// Did we arrive here from the "Create collaboration space" shortcut? // Did we arrive here from the "Create collaboration space" shortcut?
if (window.queryObject.cc) if (window.queryObject.cc)
@@ -105,6 +107,16 @@ var OfficeNavigation =
panel.setStyle('display', 'block'); panel.setStyle('display', 'block');
panel.setStyle('height', panel.defaultHeight); panel.setStyle('height', panel.defaultHeight);
}, },
getDocumentNames: function()
{
OfficeNavigation.documentNames = [];
$$("#documentList .notVersionable").each(function(doc, i)
{
OfficeNavigation.documentNames.push(doc.getText());
});
},
showCreateSpace: function() showCreateSpace: function()
{ {
@@ -223,16 +235,20 @@ var OfficeNavigation =
transition: Fx.Transitions.linear, transition: Fx.Transitions.linear,
onComplete: function() onComplete: function()
{ {
$('saveFilename').addEvent('keydown', function(event) $('saveFilename').addEvent('keypress', function(event)
{ {
event = new Event(event); event = new Event(event);
if (event.key == 'enter') if (event.key == 'enter')
{ {
OfficeNavigation.saveOK(); OfficeNavigation.saveOK();
event.stop();
$('saveFilename').removeEvent('keypress');
} }
else if (event.key == 'esc') else if (event.key == 'esc')
{ {
OfficeNavigation.saveCancel(); OfficeNavigation.saveCancel();
event.stop();
$('saveFilename').removeEvent('keypress');
} }
}); });
$('saveFilename').focus(); $('saveFilename').focus();
@@ -240,17 +256,43 @@ var OfficeNavigation =
}).start({'opacity': 1}); }).start({'opacity': 1});
this.fxOverlay.start(OfficeNavigation.OVERLAY_OPACITY); this.fxOverlay.start(OfficeNavigation.OVERLAY_OPACITY);
this.popupPanel = panel; if (panel != null)
this.popupPanel.currentPath = currentPath; {
this.popupPanel = panel;
this.popupPanel.currentPath = currentPath;
}
}, },
saveOK: function() saveOK: function()
{ {
// Shortcut for double-event firing issue
if (this.popupPanel == null)
{
return;
}
var filename = $('saveFilename').value; var filename = $('saveFilename').value;
var currentPath = this.popupPanel.currentPath; var currentPath = this.popupPanel.currentPath;
var cancelSave = false;
if (filename.length > 0) if (filename.length > 0)
{ {
window.external.saveToAlfrescoAs(currentPath, filename); // Trying to save over an existing non-versionable doc?
OfficeNavigation.documentNames.each(function(doc, i)
{
if ((doc == filename) || (doc == filename + ".doc"))
{
if (!confirm("The document exists and is not versionable. Overwrite this file?"))
{
cancelSave = true;
}
}
});
if (!cancelSave)
{
window.external.saveToAlfrescoAs(currentPath, filename);
}
} }
OfficeNavigation.saveCancel(); OfficeNavigation.saveCancel();
}, },