From 2a6ade76fca8814e1961af0a33b019a0ceeb5951 Mon Sep 17 00:00:00 2001 From: Dave Ward Date: Tue, 6 Sep 2011 16:14:53 +0000 Subject: [PATCH] =?UTF-8?q?Merged=20V3.4-BUG-FIX=20to=20HEAD=20=20=20=2029?= =?UTF-8?q?870:=20ALF-9952:=20Compatibility=20fix=20to=20allow=20mounting?= =?UTF-8?q?=20of=20Alfresco=20WebDAV=20as=20a=20network=20drive=20on=20Win?= =?UTF-8?q?dows=20XP=20(without=20WebDrive)=20=20=20=2029872:=20Fixed=20AL?= =?UTF-8?q?F-7698=20"Defects=20in=20tags=20picker=20in=20SHARE."=20=20=20?= =?UTF-8?q?=20-=20now=20checks=20added=20items=20to=20avoid=20duplicates?= =?UTF-8?q?=20=20=20=2029873:=20Made=20sure=20the=20onActionDetails=20docl?= =?UTF-8?q?ib=20action=20generates=20SimpleDialog=20instance=20ids=20each?= =?UTF-8?q?=20time,=20to=20avoid=20multiple=20js=20class=20instances=20wit?= =?UTF-8?q?h=20the=20same=20id=20getting=20called=20for=20every=20dialog?= =?UTF-8?q?=20created.=20=20=20=2029878:=20ALF-9378:=20Use=20caching=20plu?= =?UTF-8?q?s=20a=20read=20write=20lock,=20in=20a=20similar=20manner=20to?= =?UTF-8?q?=20ALF-7064,=20to=20avoid=20contention=20in=20SubsystemProxyFac?= =?UTF-8?q?tory=20under=20load=20=20=20=2029881:=20Added=20helper=20text?= =?UTF-8?q?=20for=20the=20translators=20to=20the=20property=20file.=20=20?= =?UTF-8?q?=20=2029910:=20ALF-7433:=20a=20file=20deleted=20using=20the=20w?= =?UTF-8?q?eb=20UI=20still=20appears=20in=20a=20NFS=20mount=20but=20with?= =?UTF-8?q?=20NULL=20stats=20=20=20=20-=20timestamp=20propagation=20now=20?= =?UTF-8?q?enabled=20by=20default=20so=20NFS=20always=20works=20=20=20=20-?= =?UTF-8?q?=20timestamp=20propagation=20less=20agressive=20-=20only=20has?= =?UTF-8?q?=20to=20propagate=20on=20adds=20/=20deletes=20and=20renames=20?= =?UTF-8?q?=20=20=2029911:=20Values=20for=20recurrence=20strings=20updated?= =?UTF-8?q?=20now=20that=20I've=20read=20RFC-2445=20=20=20=2029944:=20ALF-?= =?UTF-8?q?9988:=20Merged=20PATCHES/V3.3.4=20to=20V3.4-BUG-FIX=20=20=20=20?= =?UTF-8?q?=20=20=2028581:=20ALF-8944:=20Corrected=20sort=20parameter=20ha?= =?UTF-8?q?ndling=20for=20datetime=20fields,=20based=20on=20analyzer=20and?= =?UTF-8?q?=20tokenization=20mode=20=20=20=2029955:=20Fixed=20ALF-9965:=20?= =?UTF-8?q?Property=20names=20matching=20fails=20if=20the=20property=20con?= =?UTF-8?q?tains=20non=20Alphanumeric=20characters=20=20=20=2029956:=20Fix?= =?UTF-8?q?ed=20ALF-9424:=20Webform(XSD):=20xf:switch=20switch=20group=20d?= =?UTF-8?q?oes=20not=20work=20based=20on=20"complexContent=20with=20Base"?= =?UTF-8?q?=20element.=20=20=20=2029964:=20Fixed=20ALF-9089:=20TinyMCE=20c?= =?UTF-8?q?onvert=5Ffonts=5Fto=5Fspans=20parameter=20is=20not=20being=20pi?= =?UTF-8?q?cked=20up=20in=20Web=20Forms=20=20=20=2029977:=20L10N=20Updates?= =?UTF-8?q?=20from=20Gloria=20(based=20on=20rev29838).=20=20=20=2029980:?= =?UTF-8?q?=20Ignore=20virtual=20tomcat=20directory=20=20=20=2029981:=20Me?= =?UTF-8?q?rged=20BRANCHES/DEV/BELARUS/V3.4-BUG-FIX-2011=5F08=5F19=20to=20?= =?UTF-8?q?BRANCHES/DEV/V3.4-BUG-FIX=20=20=20=20=20=20=20=20ALF-6808=20:?= =?UTF-8?q?=20Incorrect=20Search=20Language=20Conversion=20for=20wild=20ca?= =?UTF-8?q?rd=20characters=20(%,=20=5F)=20for=20MS=20SQL=20=20=20=2029984:?= =?UTF-8?q?=20ALF-4753:=20Fix=20search=20query=20escaping=20in=20Alfresco?= =?UTF-8?q?=20Explorer=20=20=20=20-=20AWC-1743=20/=20CHK-2171=20fix=20rest?= =?UTF-8?q?ored=20=20=20=2029993:=20Merged=20DEV/TEMPORARY=20to=20V3.4-BUG?= =?UTF-8?q?-FIX=20=20=20=20=20=20=2029989:=20ALF-9976:=20WebDAV=20Class=20?= =?UTF-8?q?2=20compliance=20issue=20with=20OPTIONS=20response.=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20Class=202=20incompliance=20connected=20with?= =?UTF-8?q?=20absence=20of=20'PROPPATCH'=20method=20in=20the=20'Allow'=20r?= =?UTF-8?q?esponse=20header=20has=20been=20fixed=20=20=20=2030009:=20ALF-7?= =?UTF-8?q?239=20:=20Documents=20from=20Records=20Manager=20cannot=20be=20?= =?UTF-8?q?viewed=20in=20Outlook=20=20=20=2030012:=20Merged=20BRANCHES/DEV?= =?UTF-8?q?/BELARUS/V3.4-BUG-FIX-2011=5F08=5F19=20to=20BRANCHES/DEV/V3.4-B?= =?UTF-8?q?UG-FIX:=20=20=20=20=20=20=2029986:=20ALF-7105:=20pdfbox=20retur?= =?UTF-8?q?ns=20errors=20in=20the=20logs=20but=20one=20cannot=20understand?= =?UTF-8?q?=20what=20file=20is=20affected=20(PDFBox)=20=20=20=2030014:=20A?= =?UTF-8?q?LF-6284:=20Fix=20for=20Share=20Kerberos=20SSO=20Websphere=20com?= =?UTF-8?q?patibility=20(by=20Pavel)=20=20=20=2030016:=20Merged=20DEV=20to?= =?UTF-8?q?=20V3.4-BUG-FIX=20=20=20=20=20=20=2029424:=20ALF-8715:=20NFS:?= =?UTF-8?q?=20Admin=20sometimes=20cannot=20edit=20content=20uploaded=20via?= =?UTF-8?q?=20JSF=20=20=20=20=20=20=20=20=20=20=20=20=20=20Fix=20for=20"Ca?= =?UTF-8?q?n't=20open=20file=20for=20writing"=20during=20saving=20file=20i?= =?UTF-8?q?n=20VI-like=20editors=20connected=20with=20FileExpiry=20daemon:?= =?UTF-8?q?=20=20=20=20=20=20=20=20=20=20=20=20=20=20-=20'getNodeOrNull()'?= =?UTF-8?q?=20method=20extracted=20to=20get=20and=20check=20on=20existence?= =?UTF-8?q?=20of=20the=20cached=20file=20object=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20and=20then=20update=20cache=20timeout?= =?UTF-8?q?=20or=20remove=20it=20from=20the=20cache;=20=20=20=20=20=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20-=20'getNodeForPath()'=20was=20appropriate?= =?UTF-8?q?ly=20updated=20in=20accordance=20with=20logic=20extracted=20to?= =?UTF-8?q?=20'getNodeOrNull()';=20=20=20=20=20=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?-=20'fileExists()'=20method=20was=20corrected=20to=20take=20int?= =?UTF-8?q?o=20account=20existence=20of=20the=20cached=20file=20object=20?= =?UTF-8?q?=20=20=2030017:=20Reverses=20an=20accidental=20check=20in=20mad?= =?UTF-8?q?e=20with=20the=20last=20L10N=20bundle=20update=20(r29977)=20=20?= =?UTF-8?q?=20=2030045:=20ALF-8664=20-=20Custom=20'mandatory'=20RM=20metad?= =?UTF-8?q?ata=20causes=20editing=20issues=20=20=20=2030053:=20ALF-9681:?= =?UTF-8?q?=20webScriptsRegistryCache=20size=20in=20ehcache-default.xml=20?= =?UTF-8?q?=20=20=20=20=20=20webScriptsRegistryCache=20maxElementsInMemory?= =?UTF-8?q?=20size=20was=20incremented=20up=20to=201000=20=20=20=2030079:?= =?UTF-8?q?=20ALF-10027:=20Fix=20template=20alfresco-global.properties=20f?= =?UTF-8?q?or=20custom=20tomcat=20ports=20=20=20=20-=20Obselete=20web.appl?= =?UTF-8?q?ication.context.url=20removed=20=20=20=20-=20alfresco.host,=20a?= =?UTF-8?q?lfresco.port,=20share.host=20and=20share.port=20added=20=20=20?= =?UTF-8?q?=2030080:=20Fixed=20parse=20error=20mentioned=20in=20ALF-9511?= =?UTF-8?q?=20"RSS=20Feeds=20with=20HTTP=20Auth=20doesn't=20work=20with=20?= =?UTF-8?q?Feed=20dashlet"=20=20=20=20=20-=20In=20java=20regexps=20the=20.?= =?UTF-8?q?=20(dot)=20does=20NOT=20include=20the=20\r=20or=20\n=20by=20def?= =?UTF-8?q?ault,=20to=20change=20that=20a=20(=3Fs)=20instruction=20was=20a?= =?UTF-8?q?dded=20in=20the=20beginning=20of=20the=20regexp=20=20=20=203008?= =?UTF-8?q?3:=20Fixed=20ALF-10048=20"Multiple=20thumbnails=20in=20RSS=20fe?= =?UTF-8?q?eds=20causes=20problem=20for=20RSS=20Feed=20dashlet"=20=20=20?= =?UTF-8?q?=2030088:=20ALF-7433:=20Fix=20unit=20test=20fallout=20from=20ne?= =?UTF-8?q?w=20timestamp=20propagation=20behaviour=20=20=20=2030089:=20ALF?= =?UTF-8?q?-7433:=20Further=20unit=20test=20fallout=20from=20new=20timesta?= =?UTF-8?q?mp=20propagation=20behaviour=20=20=20=20-=20testPermissionsAndP?= =?UTF-8?q?olicies=20needs=20to=20get=20folder=20modification=20date=20in?= =?UTF-8?q?=20a=20distinct=20transaction=20after=20populating=20it=20=20?= =?UTF-8?q?=20=2030091:=20ALF-10050:=20CIFS:=20Coordinator=20is=20unable?= =?UTF-8?q?=20to=20delete=20content=20after=20IMAP=20has=20been=20enabled?= =?UTF-8?q?=20=20=20=20-=20Transactional=20cache=20null=20entry=20issue=20?= =?UTF-8?q?=20=20=2030096:=20ALF-9793:=20Allow=20auto-created=20NFS=20auth?= =?UTF-8?q?enticated=20users=20to=20work=20=20=20=20-=20Also=20removed=20a?= =?UTF-8?q?dmin=20from=20default=20mappings=20to=20avoid=20security=20hole?= =?UTF-8?q?=20=20=20=2030102:=20ALF-8723=20CIFS=20on=20Windows=20fails=20t?= =?UTF-8?q?o=20start=20under=20certain=20conditions=20=20=20=20=20=20=20-?= =?UTF-8?q?=20Found=20another=20place=20>=3D=20was=20required=20rather=20t?= =?UTF-8?q?han=20just=20>=20=20=20=2030104:=20ALF-9890=20SiteService=20is?= =?UTF-8?q?=20not=20producing=20audit=20data.=20=20=20=20=20=20=20-=20Inte?= =?UTF-8?q?rnal=20siteService=20rather=20than=20public=20SiteService=20was?= =?UTF-8?q?=20being=20used,=20so=20there=20was=20no=20audit=20advice.=20?= =?UTF-8?q?=20=20=2030119:=20ALF-9793:=20Fallout=20from=20previous=20fix.?= =?UTF-8?q?=20Prevent=20initialization=20error=20when=20there=20are=20no?= =?UTF-8?q?=20user=20mappings=20and=20NFS=20is=20not=20enabled.=20=20=20?= =?UTF-8?q?=2030120:=20ALF-9526:=20Work=20around=20the=20fact=20that=20Web?= =?UTF-8?q?sphere=20ignores=20the=20response=20encoding=20unless=20you=20c?= =?UTF-8?q?all=20response.setCharacterEncoding()=20=20=20=20-=20GlobalLoca?= =?UTF-8?q?lizationFilter=20inserts=20a=20response=20wrapper=20that=20pars?= =?UTF-8?q?es=20the=20charset=20parameter=20from=20the=20content=20type=20?= =?UTF-8?q?header,=20if=20it=20is=20present=20=20=20=2030121:=20ALF-9535:?= =?UTF-8?q?=20Alfresco=20ignores=20Accept-Language=20sent=20from=20Share?= =?UTF-8?q?=20=20=20=20-=20Ticket=20and=20webscript=20authentication=20(i.?= =?UTF-8?q?e.=20Share=20requests)=20will=20use=20the=20language=20set=20in?= =?UTF-8?q?=20request=20headers=20as=20the=20session=20language=20=20=20?= =?UTF-8?q?=2030130:=20ALF-10049:=20Fix=20by=20Andrey=20to=20enable=20Flas?= =?UTF-8?q?h=20upload=20on=20Weblogic!=20=20=20=2030141:=20ALF-8732=20Now?= =?UTF-8?q?=20if=20the=20adhoc=20workflow=20throws=20exceptions=20while=20?= =?UTF-8?q?sending=20a=20notification=20email=20then=20those=20exceptions?= =?UTF-8?q?=20are=20ignored.=20=20=20=2030226:=20ALF-9415:=20JSF=20-=20Cop?= =?UTF-8?q?y/Paste=20vs=20Cut/Paste=20add=20aspect=20rule.=20=20=20=203024?= =?UTF-8?q?2:=20Added=20NodeService.getNodeRef(Long=20nodeId)=20=20=20=20?= =?UTF-8?q?=20-=20First=20step=20to=20remove=20Lucene=20search=20from=20in?= =?UTF-8?q?bound=20email=20server=20=20=20=20=20-=20Done=20while=20investi?= =?UTF-8?q?gating=20ALF-9660=20=20=20=2030243:=20Fixed=20ALF-9660:=20Inbou?= =?UTF-8?q?nd=20emails=20are=20always=20stored=20with=20encoding=3DUTF-8?= =?UTF-8?q?=20regardless=20the=20encoding=20the=20email=20client=20uses.?= =?UTF-8?q?=20=20=20=20=20-=20If=20the=20encoding=20is=20provided,=20then?= =?UTF-8?q?=20it=20is=20not=20guessed=20=20=20=20=20-=20Includes=20tweak?= =?UTF-8?q?=20to=20remove=20Lucene=20search=20and=20rather=20use=20direct?= =?UTF-8?q?=20node=20ID-NodeRef=20translation=20provided=20by=20NodeServic?= =?UTF-8?q?e=20=20=20=2030263:=20Incremented=20version=20revision=20=20=20?= =?UTF-8?q?=2030264:=20ALF-10187:=20Merged=20V3.3=20to=20V3.4-BUG-FIX=20?= =?UTF-8?q?=20=20=20=20=20=2030003:=20ALF-9898:=20More=20defensive=20excep?= =?UTF-8?q?tion=20handling=20to=20avoid=20packet=20pool=20leaks=20and=20ex?= =?UTF-8?q?tra=20logging=20on=20packet=20pool=20exhaustion=20=20=20=203026?= =?UTF-8?q?5:=20Merged=20V3.4=20to=20V3.4-BUG-FIX=20=20=20=20=20=20=203025?= =?UTF-8?q?9:=20ALF-6527=20LangPack=20FR=20-=20[Search=20results'=20page]?= =?UTF-8?q?=20Incorrect=20label=20when=20search=20matches=20results=20=20?= =?UTF-8?q?=20=20=20=20=20=20=20-=20Added=20"(s)"=20to=20"trouv=C3=A9(s)?= =?UTF-8?q?=20dans=20l'entrep=C3=B4t."=20=20=20(for=20a=20repository=20sea?= =?UTF-8?q?rch=20-=20found=20in=20retest)=20=20=20=20=20=20=20=20=20-=20Th?= =?UTF-8?q?e=20original=20change:=20=20=20=20=20=20=20=20=20=20=20Added=20?= =?UTF-8?q?"(s)"=20to=20"trouv=C3=A9(s)=20dans=20tous=20les=20sites."=20?= =?UTF-8?q?=20=20(for=20an=20All=20Sites=20search)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- .../org/alfresco/web/app/Application.java | 39 +++++++++++------ .../web/app/servlet/AuthenticationHelper.java | 20 ++++----- .../app/servlet/GlobalLocalizationFilter.java | 43 +++++++++++++++++-- .../HTTPRequestAuthenticationFilter.java | 4 +- .../servlet/KerberosAuthenticationFilter.java | 2 +- .../app/servlet/NTLMAuthenticationFilter.java | 2 +- .../WebScriptSSOAuthenticationFilter.java | 6 ++- .../web/bean/search/SearchContext.java | 27 ++++++------ source/web/scripts/ajax/xforms.js | 21 +++++++-- 9 files changed, 112 insertions(+), 52 deletions(-) diff --git a/source/java/org/alfresco/web/app/Application.java b/source/java/org/alfresco/web/app/Application.java index d9860c0fbe..f327b0fd08 100644 --- a/source/java/org/alfresco/web/app/Application.java +++ b/source/java/org/alfresco/web/app/Application.java @@ -818,35 +818,46 @@ 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) { - // first check saved user preferences - String strLocale = null; - if (getCurrentUser(session) != null) + if (useInterfaceLanguage) { - strLocale = (String)PreferencesService.getPreferences(session).getValue( - UserPreferencesBean.PREF_INTERFACELANGUAGE); - if (strLocale != null) + // first check saved user preferences + String strLocale = null; + if (getCurrentUser(session) != null) { - locale = I18NUtil.parseLocale(strLocale); + strLocale = (String) PreferencesService.getPreferences(session).getValue( + UserPreferencesBean.PREF_INTERFACELANGUAGE); + if (strLocale != null) + { + locale = I18NUtil.parseLocale(strLocale); + } + else + { + // failing that, use the server default locale + locale = Locale.getDefault(); + } } else { - // failing that, use the server default locale - locale = Locale.getDefault(); + // else get from web-client config - the first item in the configured list of languages + locale = getLanguage(WebApplicationContextUtils.getRequiredWebApplicationContext(session + .getServletContext())); } } else { - // else get from web-client config - the first item in the configured list of languages - locale = getLanguage(WebApplicationContextUtils.getRequiredWebApplicationContext(session.getServletContext())); + // Get the request default, already decoded from the request headers + locale = I18NUtil.getLocale(); } // save in user session session.setAttribute(LOCALE, locale); diff --git a/source/java/org/alfresco/web/app/servlet/AuthenticationHelper.java b/source/java/org/alfresco/web/app/servlet/AuthenticationHelper.java index b3272c423c..56c6ed02db 100644 --- a/source/java/org/alfresco/web/app/servlet/AuthenticationHelper.java +++ b/source/java/org/alfresco/web/app/servlet/AuthenticationHelper.java @@ -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; } diff --git a/source/java/org/alfresco/web/app/servlet/GlobalLocalizationFilter.java b/source/java/org/alfresco/web/app/servlet/GlobalLocalizationFilter.java index 5a9f418d69..6d85d5727c 100644 --- a/source/java/org/alfresco/web/app/servlet/GlobalLocalizationFilter.java +++ b/source/java/org/alfresco/web/app/servlet/GlobalLocalizationFilter.java @@ -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; + } + } + }); } diff --git a/source/java/org/alfresco/web/app/servlet/HTTPRequestAuthenticationFilter.java b/source/java/org/alfresco/web/app/servlet/HTTPRequestAuthenticationFilter.java index 14422b9aaa..8947c64918 100644 --- a/source/java/org/alfresco/web/app/servlet/HTTPRequestAuthenticationFilter.java +++ b/source/java/org/alfresco/web/app/servlet/HTTPRequestAuthenticationFilter.java @@ -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); } diff --git a/source/java/org/alfresco/web/app/servlet/KerberosAuthenticationFilter.java b/source/java/org/alfresco/web/app/servlet/KerberosAuthenticationFilter.java index 151b6446a8..4055b46f62 100644 --- a/source/java/org/alfresco/web/app/servlet/KerberosAuthenticationFilter.java +++ b/source/java/org/alfresco/web/app/servlet/KerberosAuthenticationFilter.java @@ -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) diff --git a/source/java/org/alfresco/web/app/servlet/NTLMAuthenticationFilter.java b/source/java/org/alfresco/web/app/servlet/NTLMAuthenticationFilter.java index b6f77c355c..43a6a91d5c 100644 --- a/source/java/org/alfresco/web/app/servlet/NTLMAuthenticationFilter.java +++ b/source/java/org/alfresco/web/app/servlet/NTLMAuthenticationFilter.java @@ -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) diff --git a/source/java/org/alfresco/web/app/servlet/WebScriptSSOAuthenticationFilter.java b/source/java/org/alfresco/web/app/servlet/WebScriptSSOAuthenticationFilter.java index 086c151764..f82c9e417a 100644 --- a/source/java/org/alfresco/web/app/servlet/WebScriptSSOAuthenticationFilter.java +++ b/source/java/org/alfresco/web/app/servlet/WebScriptSSOAuthenticationFilter.java @@ -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 { diff --git a/source/java/org/alfresco/web/bean/search/SearchContext.java b/source/java/org/alfresco/web/bean/search/SearchContext.java index c1874ed610..b089bd2885 100644 --- a/source/java/org/alfresco/web/bean/search/SearchContext.java +++ b/source/java/org/alfresco/web/bean/search/SearchContext.java @@ -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("\" "); } /** @@ -511,12 +512,12 @@ public class SearchContext implements Serializable * @param attrBuf Attribute search buffer to append lucene terms to * @param textBuf Text search buffer to append lucene terms to */ - private static void processSearchTextAttribute(String qname, String value, StringBuilder attrBuf, StringBuilder textBuf) - { - textBuf.append("TEXT:\"").append(value).append('"'); - attrBuf.append('@').append(qname).append(":\"") - .append(value).append('"'); - } + private static void processSearchTextAttribute(String qname, String value, StringBuilder attrBuf, StringBuilder textBuf) + { + textBuf.append("TEXT:\"").append(SearchContext.escape(value)).append('"'); + attrBuf.append('@').append(qname).append(":\"") + .append(SearchContext.escape(value)).append('"'); + } /** * Returns a String where those characters that QueryParser @@ -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 prefixes = ns.getPrefixes(elementRef.getQName().getNamespaceURI()); if (prefixes.size() >0) { elementString = '/' + (String)prefixes.iterator().next() + ':' + ISO9075.encode(elementRef.getQName().getLocalName()); diff --git a/source/web/scripts/ajax/xforms.js b/source/web/scripts/ajax/xforms.js index bbbee08377..6cbcb2a30e 100644 --- a/source/web/scripts/ajax/xforms.js +++ b/source/web/scripts/ajax/xforms.js @@ -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; - + 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(); @@ -2997,14 +3001,23 @@ alfresco.xforms.VGroup = alfresco.xforms.AbstractGroup.extend({ parentOffsetWidth = this._children[i].domContainer.parentNode.offsetWidth; if (parentOffsetWidth != 0) { - contentDiv.style.width = (this._children[i] instanceof alfresco.xforms.AbstractGroup + contentDiv.style.width = (this._children[i] instanceof alfresco.xforms.AbstractGroup ? "100%" : (1 - (contentDiv.offsetLeft / parentOffsetWidth)) * 100 + "%"); } else { - contentDiv.style.width = "100%"; + 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)