Merged V3.4-BUG-FIX to HEAD

29870: ALF-9952: Compatibility fix to allow mounting of Alfresco WebDAV as a network drive on Windows XP (without WebDrive)
   29872: Fixed ALF-7698 "Defects in tags picker in SHARE."
   - now checks added items to avoid duplicates
   29873: Made sure the onActionDetails doclib action generates SimpleDialog instance ids each time, to avoid multiple js class instances with the same id getting called for every dialog created.
   29878: ALF-9378: Use caching plus a read write lock, in a similar manner to ALF-7064, to avoid contention in SubsystemProxyFactory under load
   29881: Added helper text for the translators to the property file.
   29910: ALF-7433: a file deleted using the web UI still appears in a NFS mount but with NULL stats
   - timestamp propagation now enabled by default so NFS always works
   - timestamp propagation less agressive - only has to propagate on adds / deletes and renames
   29911: Values for recurrence strings updated now that I've read RFC-2445
   29944: ALF-9988: Merged PATCHES/V3.3.4 to V3.4-BUG-FIX
      28581: ALF-8944: Corrected sort parameter handling for datetime fields, based on analyzer and tokenization mode
   29955: Fixed ALF-9965: Property names matching fails if the property contains non Alphanumeric characters
   29956: Fixed ALF-9424: Webform(XSD): xf:switch switch group does not work based on "complexContent with Base" element.
   29964: Fixed ALF-9089: TinyMCE convert_fonts_to_spans parameter is not being picked up in Web Forms
   29977: L10N Updates from Gloria (based on rev29838).
   29980: Ignore virtual tomcat directory
   29981: Merged BRANCHES/DEV/BELARUS/V3.4-BUG-FIX-2011_08_19 to BRANCHES/DEV/V3.4-BUG-FIX 
       ALF-6808 : Incorrect Search Language Conversion for wild card characters (%, _) for MS SQL 
   29984: ALF-4753: Fix search query escaping in Alfresco Explorer
   - AWC-1743 / CHK-2171 fix restored
   29993: Merged DEV/TEMPORARY to V3.4-BUG-FIX
      29989: ALF-9976: WebDAV Class 2 compliance issue with OPTIONS response.
         Class 2 incompliance connected with absence of 'PROPPATCH' method in the 'Allow' response header has been fixed
   30009: ALF-7239 : Documents from Records Manager cannot be viewed in Outlook   
   30012: Merged BRANCHES/DEV/BELARUS/V3.4-BUG-FIX-2011_08_19 to BRANCHES/DEV/V3.4-BUG-FIX:
      29986: ALF-7105: pdfbox returns errors in the logs but one cannot understand what file is affected (PDFBox)
   30014: ALF-6284: Fix for Share Kerberos SSO Websphere compatibility (by Pavel)
   30016: Merged DEV to V3.4-BUG-FIX
      29424: ALF-8715: NFS: Admin sometimes cannot edit content uploaded via JSF
             Fix for "Can't open file for writing" during saving file in VI-like editors connected with FileExpiry daemon:
             - 'getNodeOrNull()' method extracted to get and check on existence of the cached file object
                and then update cache timeout or remove it from the cache;
             - 'getNodeForPath()' was appropriately updated in accordance with logic extracted to 'getNodeOrNull()';
             - 'fileExists()' method was corrected to take into account existence of the cached file object 
   30017: Reverses an accidental check in made with the last L10N bundle update (r29977)
   30045: ALF-8664 - Custom 'mandatory' RM metadata causes editing issues   
   30053: ALF-9681: webScriptsRegistryCache size in ehcache-default.xml   
      webScriptsRegistryCache maxElementsInMemory size was incremented up to 1000
   30079: ALF-10027: Fix template alfresco-global.properties for custom tomcat ports
   - Obselete web.application.context.url removed
   - alfresco.host, alfresco.port, share.host and share.port added
   30080: Fixed parse error mentioned in ALF-9511 "RSS Feeds with HTTP Auth doesn't work with Feed dashlet"
    - In java regexps the . (dot) does NOT include the \r or \n by default, to change that a (?s) instruction was added in the beginning of the regexp
   30083: Fixed ALF-10048 "Multiple thumbnails in RSS feeds causes problem for RSS Feed dashlet"
   30088: ALF-7433: Fix unit test fallout from new timestamp propagation behaviour
   30089: ALF-7433: Further unit test fallout from new timestamp propagation behaviour
   - testPermissionsAndPolicies needs to get folder modification date in a distinct transaction after populating it
   30091: ALF-10050: CIFS: Coordinator is unable to delete content after IMAP has been enabled
   - Transactional cache null entry issue
   30096: ALF-9793: Allow auto-created NFS authenticated users to work
   - Also removed admin from default mappings to avoid security hole
   30102: ALF-8723 CIFS on Windows fails to start under certain conditions
      - Found another place >= was required rather than just >
   30104: ALF-9890 SiteService is not producing audit data.
      - Internal siteService rather than public SiteService was being used, so there was no audit advice.
   30119: ALF-9793: Fallout from previous fix. Prevent initialization error when there are no user mappings and NFS is not enabled.
   30120: ALF-9526: Work around the fact that Websphere ignores the response encoding unless you call response.setCharacterEncoding()
   - GlobalLocalizationFilter inserts a response wrapper that parses the charset parameter from the content type header, if it is present
   30121: ALF-9535: Alfresco ignores Accept-Language sent from Share
   - Ticket and webscript authentication (i.e. Share requests) will use the language set in request headers as the session language
   30130: ALF-10049: Fix by Andrey to enable Flash upload on Weblogic!
   30141: ALF-8732 Now if the adhoc workflow throws exceptions while sending a notification email then those exceptions are ignored.
   30226: ALF-9415: JSF - Copy/Paste vs Cut/Paste add aspect rule.
   30242: Added NodeService.getNodeRef(Long nodeId)
    - First step to remove Lucene search from inbound email server
    - Done while investigating ALF-9660
   30243: Fixed ALF-9660: Inbound emails are always stored with encoding=UTF-8 regardless the encoding the email client uses.
    - If the encoding is provided, then it is not guessed
    - Includes tweak to remove Lucene search and rather use direct node ID-NodeRef translation provided by NodeService
   30263: Incremented version revision
   30264: ALF-10187: Merged V3.3 to V3.4-BUG-FIX
      30003: ALF-9898: More defensive exception handling to avoid packet pool leaks and extra logging on packet pool exhaustion
   30265: Merged V3.4 to V3.4-BUG-FIX
      30259: ALF-6527 LangPack FR - [Search results' page] Incorrect label when search matches results
        - Added "(s)" to "trouvé(s) dans l'entrepôt."   (for a repository search - found in retest)
        - The original change:
          Added "(s)" to "trouvé(s) dans tous les sites."   (for an All Sites search)
          
          However this leaves the current site search. As a result I also:
          Added "(s)" to "trouvé(s) dans le site {0}."  (for a current Site search)
          and checked with a French speaker that this would sound correct.
          
          Note: all three labels are prefixed by a separate text label: "N résultat(s) "
      30261: (RECORD ONLY) Merged V3.4-BUG-FIX to V3.4 (3.4.5)
      30262: ALF-10186: Merged PATCHES/V3.4.1 to V3.4
         30126: ALF-10075: Concurrency during CMIS document update causes content stream to close prematurely.
            - Created BufferedRequest request wrapper in RepositoryContainer
            - If the content stream is accessed directly it is streamed to a temporary file so that requests can be retried
         30137: ALF-10075: Fixed NPE


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@30271 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Dave Ward
2011-09-06 16:14:53 +00:00
parent 80dec17f8d
commit 2a6ade76fc
9 changed files with 112 additions and 52 deletions

View File

@@ -818,20 +818,24 @@ public class Application
/**
* Return the language Locale for the current user Session.
*
* @param session HttpSession for the current user
*
* @param session
* HttpSession for the current user
* @param useInterfaceLanguage
* If the session language hasn't been established yet, should we base it on user preferences?
* @return Current language Locale set or the VM default if none set - never null
*/
public static Locale getLanguage(HttpSession session)
public static Locale getLanguage(HttpSession session, boolean useInterfaceLanguage)
{
Locale locale = (Locale)session.getAttribute(LOCALE);
if (locale == null)
{
if (useInterfaceLanguage)
{
// first check saved user preferences
String strLocale = null;
if (getCurrentUser(session) != null)
{
strLocale = (String)PreferencesService.getPreferences(session).getValue(
strLocale = (String) PreferencesService.getPreferences(session).getValue(
UserPreferencesBean.PREF_INTERFACELANGUAGE);
if (strLocale != null)
{
@@ -846,7 +850,14 @@ public class Application
else
{
// else get from web-client config - the first item in the configured list of languages
locale = getLanguage(WebApplicationContextUtils.getRequiredWebApplicationContext(session.getServletContext()));
locale = getLanguage(WebApplicationContextUtils.getRequiredWebApplicationContext(session
.getServletContext()));
}
}
else
{
// Get the request default, already decoded from the request headers
locale = I18NUtil.getLocale();
}
// save in user session
session.setAttribute(LOCALE, locale);

View File

@@ -103,21 +103,17 @@ public final class AuthenticationHelper
* @param res
* the response
*/
public static void setupThread(ServletContext sc, HttpServletRequest req, HttpServletResponse res)
public static void setupThread(ServletContext sc, HttpServletRequest req, HttpServletResponse res, boolean useInterfaceLanguage)
{
// setup faces context
FacesContext fc = Application.inPortalServer() ? AlfrescoFacesPortlet.getFacesContext(req) : FacesHelper
.getFacesContext(req, res, sc);
// Set the current locale and language
if (Application.getClientConfig(fc).isLanguageSelect())
{
I18NUtil.setLocale(Application.getLanguage(req.getSession()));
}
// Set the current locale and language (overriding the one already decoded from the Accept-Language header
I18NUtil.setLocale(Application.getLanguage(req.getSession(), Application.getClientConfig(fc).isLanguageSelect() && useInterfaceLanguage));
// Programatically retrieve the UserPreferencesBean from JSF
UserPreferencesBean userPreferencesBean = (UserPreferencesBean) fc.getApplication().createValueBinding(
"#{UserPreferencesBean}").getValue(fc);
UserPreferencesBean userPreferencesBean = (UserPreferencesBean) FacesHelper.getManagedBean(fc, "UserPreferencesBean");
if (userPreferencesBean != null)
{
String contentFilterLanguageStr = userPreferencesBean.getContentFilterLanguage();
@@ -202,7 +198,7 @@ public final class AuthenticationHelper
setUser(sc, req, AuthenticationUtil.getGuestUserName(), auth.getCurrentTicket(), false);
// Set up the thread context
setupThread(sc, req, res);
setupThread(sc, req, res, true);
// remove the session invalidated flag
session.removeAttribute(AuthenticationHelper.SESSION_INVALIDATED);
@@ -246,7 +242,7 @@ public final class AuthenticationHelper
}
// Set up the thread context
setupThread(sc, req, res);
setupThread(sc, req, res, true);
return AuthenticationStatus.Success;
}
@@ -307,8 +303,8 @@ public final class AuthenticationHelper
return AuthenticationStatus.Failure;
}
// Set up the thread context
setupThread(context, httpRequest, httpResponse);
// As we are authenticating via a ticket, establish the session locale using request headers rather than web client preferences
setupThread(context, httpRequest, httpResponse, false);
return AuthenticationStatus.Success;
}

View File

@@ -29,6 +29,8 @@ import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpServletResponseWrapper;
import org.springframework.extensions.surf.util.I18NUtil;
@@ -50,12 +52,45 @@ public class GlobalLocalizationFilter implements Filter
*/
public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException
{
HttpServletRequest httpRequest = (HttpServletRequest) request;
setLanguageFromRequestHeader(httpRequest);
setLanguageFromRequestHeader((HttpServletRequest) request);
// continue filter chaining
chain.doFilter(request, response);
chain.doFilter(request, new HttpServletResponseWrapper((HttpServletResponse) response){
/* (non-Javadoc)
* @see javax.servlet.ServletResponseWrapper#setContentType(java.lang.String)
*/
@Override
public void setContentType(String type)
{
super.setContentType(type);
// Parse the parameters of the media type, since some app servers (Websphere) refuse to pay attention if the
// character encoding isn't explicitly set
int startIndex = type.indexOf(';') + 1;
int length = type.length();
while (startIndex != 0 && startIndex < length)
{
int endIndex = type.indexOf(';', startIndex);
if (endIndex == -1)
{
endIndex = length;
}
String param = type.substring(startIndex, endIndex);
int sepIndex = param.indexOf('=');
if (sepIndex != -1)
{
String name = param.substring(0, sepIndex).trim();
if (name.equalsIgnoreCase("charset"))
{
setCharacterEncoding(param.substring(sepIndex+1).trim());
break;
}
}
startIndex = endIndex + 1;
}
}
});
}

View File

@@ -177,7 +177,7 @@ public class HTTPRequestAuthenticationFilter implements Filter
// Set the current locale
authComponent.clearCurrentSecurityContext();
authComponent.setCurrentUser(user.getUserName());
AuthenticationHelper.setupThread(this.context, req, resp);
AuthenticationHelper.setupThread(this.context, req, resp, true);
chain.doFilter(sreq, sresp);
return;
}
@@ -233,7 +233,7 @@ public class HTTPRequestAuthenticationFilter implements Filter
AuthenticationHelper.setUser(context, req, userName, authenticationService.getCurrentTicket(), true);
// Set the locale using the session
AuthenticationHelper.setupThread(this.context, req, res);
AuthenticationHelper.setupThread(this.context, req, res, true);
}

View File

@@ -107,7 +107,7 @@ public class KerberosAuthenticationFilter extends BaseKerberosAuthenticationFilt
protected void onValidate(ServletContext sc, HttpServletRequest req, HttpServletResponse res)
{
// Set the locale using the session
AuthenticationHelper.setupThread(sc, req, res);
AuthenticationHelper.setupThread(sc, req, res, true);
}
/* (non-Javadoc)

View File

@@ -101,7 +101,7 @@ public class NTLMAuthenticationFilter extends BaseNTLMAuthenticationFilter
protected void onValidate(ServletContext sc, HttpServletRequest req, HttpServletResponse res)
{
// Set the locale using the session
AuthenticationHelper.setupThread(sc, req, res);
AuthenticationHelper.setupThread(sc, req, res, true);
}
/* (non-Javadoc)

View File

@@ -129,7 +129,11 @@ public class WebScriptSSOAuthenticationFilter extends BaseAuthenticationFilter i
String script = req.getPathInfo();
if (script != null && script.equals(API_LOGIN) && req.getMethod().equalsIgnoreCase("POST"))
{
handleLoginForm(req, res);
if (handleLoginForm(req, res));
{
// Establish the session locale using request headers rather than web client preferences
AuthenticationHelper.setupThread(context, req, res, false);
}
}
else
{

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2005-2010 Alfresco Software Limited.
* Copyright (C) 2005-2011 Alfresco Software Limited.
*
* This file is part of Alfresco
*
@@ -43,6 +43,7 @@ import org.alfresco.util.ISO9075;
import org.alfresco.web.bean.repository.Repository;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.lucene.queryParser.QueryParser;
import org.dom4j.Document;
import org.dom4j.DocumentHelper;
import org.dom4j.Element;
@@ -194,7 +195,7 @@ public class SearchContext implements Serializable
if (text.charAt(0) == '"' && text.charAt(text.length() - 1) == '"')
{
// as a single quoted phrase
String quotedSafeText = '"' + text.substring(1, text.length() - 1) + '"';
String quotedSafeText = '"' + QueryParser.escape(text.substring(1, text.length() - 1)) + '"';
fullTextBuf.append("TEXT:").append(quotedSafeText);
nameAttrBuf.append("@").append(nameAttr).append(":").append(quotedSafeText);
for (QName qname : this.simpleSearchAdditionalAttrs)
@@ -331,7 +332,7 @@ public class SearchContext implements Serializable
String escapedName = Repository.escapeQName(qname);
String value = queryFixedValues.get(qname);
attributeQuery.append(" +@").append(escapedName)
.append(":\"").append(value).append('"');
.append(":\"").append(QueryParser.escape(value)).append('"');
}
}
@@ -346,8 +347,8 @@ public class SearchContext implements Serializable
{
String escapedName = Repository.escapeQName(qname);
RangeProperties rp = rangeAttributes.get(qname);
String value1 = AbstractLuceneQueryParser.escape(rp.lower);
String value2 = AbstractLuceneQueryParser.escape(rp.upper);
String value1 = QueryParser.escape(rp.lower);
String value2 = QueryParser.escape(rp.upper);
attributeQuery.append(" +@").append(escapedName)
.append(":").append(rp.inclusive ? "[" : "{").append(value1)
.append(" TO ").append(value2).append(rp.inclusive ? "]" : "}");
@@ -499,7 +500,7 @@ public class SearchContext implements Serializable
if (andOp) buf.append('+');
else if (notOp) buf.append('-');
buf.append('@').append(Repository.escapeQName(qname)).append(":\"")
.append(value).append("\" ");
.append(SearchContext.escape(value)).append("\" ");
}
/**
@@ -513,9 +514,9 @@ public class SearchContext implements Serializable
*/
private static void processSearchTextAttribute(String qname, String value, StringBuilder attrBuf, StringBuilder textBuf)
{
textBuf.append("TEXT:\"").append(value).append('"');
textBuf.append("TEXT:\"").append(SearchContext.escape(value)).append('"');
attrBuf.append('@').append(qname).append(":\"")
.append(value).append('"');
.append(SearchContext.escape(value)).append('"');
}
/**
@@ -563,7 +564,7 @@ public class SearchContext implements Serializable
ChildAssociationRef elementRef = ((Path.ChildAssocElement)element).getRef();
if (elementRef.getParentRef() != null)
{
Collection prefixes = ns.getPrefixes(elementRef.getQName().getNamespaceURI());
Collection<String> prefixes = ns.getPrefixes(elementRef.getQName().getNamespaceURI());
if (prefixes.size() >0)
{
elementString = '/' + (String)prefixes.iterator().next() + ':' + ISO9075.encode(elementRef.getQName().getLocalName());

View File

@@ -937,9 +937,13 @@ alfresco.xforms.RichTextEditor = alfresco.xforms.Widget.extend({
tinyMCE.settings[i] = this._params[i];
}
}
tinyMCE.settings.height = (this._params["height"]>0) ? parseInt(this._params["height"]) : this.widget.style.height;
tinyMCE.settings.width = (this._params["width"]>0) ? parseInt(this._params["width"]) : this.widget.style.width;
// ALF-9089
if (this._params["convert_fonts_to_spans"]=="false") tinyMCE.settings.convert_fonts_to_spans = false;
tinyMCE.settings.auto_focus = this.widget.id;
tinyMCE.execCommand("mceAddControl", false, this.widget.id)
var editorDocument = tinyMCE.get(this.widget.id).getDoc();
@@ -3007,6 +3011,15 @@ alfresco.xforms.VGroup = alfresco.xforms.AbstractGroup.extend({
contentDiv.style.width = "100%";
}
if (contentDiv.labelNode)
{
contentDiv.labelNode.style.position = "relative";
contentDiv.labelNode.style.top = "0px";
contentDiv.labelNode.style.height = contentDiv.offsetHeight + "px";
contentDiv.labelNode.style.lineHeight = contentDiv.labelNode.style.height;
contentDiv.labelNode.style.width = contentDiv.labelNode.scrollWidth + "px";
}
if (recursively)
{
this._children[i]._updateDisplay(recursively);