mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
Merged V3.1 to HEAD
13409: Fix for ETHREEOH-1337 - to escape query characters in Site/People service filter methods. 13410: Fix for ETHREEOH-1272 - another missing pager control. 13425: Italian lang pack for TinyMCE editors. Fixes ETHREEOH-1491. 13430: Fix for ETHREEOH-1488. Also IDs added to a couple of pagers - not causing a bug, but completes the pager fixes. 13464: Fix for ETHREEOH-1474 - now possible to use NTLM auth with Alfresco and SURF apps hosted in same app-server with same user browser session in different tabs. Added additional NTLM filter debugging info for Session ID. 13483: Fix for ETHREEOH-1547 - System error happens when trying to create any Web Project. Also fixes issue where webproject FormImpl objects did not deserialize correctly due to unsafe service call usage in constructor. 13501: Fix for ETHREEOH-965 - disallow guest login until explicit Guest support is added to Share. 13507: Fix for ETHREEOH-1586 - language selectable at login working again. 13512: Fix for ETHREEOH-1522 - wiki RSS feed template variable named incorrectly. git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@13598 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -875,6 +875,18 @@ public class Application
|
||||
getConfigElement(ClientConfigElement.CONFIG_ELEMENT_ID);
|
||||
}
|
||||
|
||||
/**
|
||||
* Helper to get the client config element from the config service
|
||||
*
|
||||
* @param context ServletContext
|
||||
* @return The ClientConfigElement
|
||||
*/
|
||||
public static ClientConfigElement getClientConfig(ServletContext context)
|
||||
{
|
||||
return (ClientConfigElement)getConfigService(context).getGlobalConfig().
|
||||
getConfigElement(ClientConfigElement.CONFIG_ELEMENT_ID);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the repository store URL
|
||||
*
|
||||
|
@@ -89,7 +89,7 @@ public class AuthenticationFilter implements Filter
|
||||
}
|
||||
else
|
||||
{
|
||||
BaseServlet.setLanguageFromRequestHeader(httpReq);
|
||||
BaseServlet.setLanguageFromRequestHeader(httpReq, context);
|
||||
|
||||
// continue filter chaining
|
||||
chain.doFilter(req, res);
|
||||
|
@@ -191,7 +191,7 @@ public final class AuthenticationHelper
|
||||
else
|
||||
{
|
||||
// Set the current thread locale (also for JSF context)
|
||||
fc.getViewRoot().setLocale(BaseServlet.setLanguageFromRequestHeader(req));
|
||||
fc.getViewRoot().setLocale(BaseServlet.setLanguageFromRequestHeader(req, sc));
|
||||
}
|
||||
|
||||
// remove the session invalidated flag
|
||||
@@ -260,7 +260,7 @@ public final class AuthenticationHelper
|
||||
else
|
||||
{
|
||||
// Set the current thread locale (also for JSF context)
|
||||
fc.getViewRoot().setLocale(BaseServlet.setLanguageFromRequestHeader(req));
|
||||
fc.getViewRoot().setLocale(BaseServlet.setLanguageFromRequestHeader(req, sc));
|
||||
}
|
||||
|
||||
if (loginBean != null && (loginBean.getUserPreferencesBean() != null))
|
||||
@@ -359,7 +359,7 @@ public final class AuthenticationHelper
|
||||
else
|
||||
{
|
||||
// Set the current thread locale (also for JSF context)
|
||||
fc.getViewRoot().setLocale(BaseServlet.setLanguageFromRequestHeader(httpRequest));
|
||||
fc.getViewRoot().setLocale(BaseServlet.setLanguageFromRequestHeader(httpRequest, context));
|
||||
}
|
||||
|
||||
return AuthenticationStatus.Success;
|
||||
|
@@ -38,11 +38,16 @@ import javax.servlet.http.HttpServlet;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.alfresco.i18n.I18NUtil;
|
||||
import org.alfresco.repo.tenant.TenantService;
|
||||
import org.alfresco.service.ServiceRegistry;
|
||||
import org.alfresco.service.cmr.model.FileFolderService;
|
||||
import org.alfresco.service.cmr.model.FileInfo;
|
||||
import org.alfresco.service.cmr.model.FileNotFoundException;
|
||||
import org.alfresco.service.cmr.repository.NodeRef;
|
||||
import org.alfresco.service.cmr.repository.NodeService;
|
||||
import org.alfresco.service.cmr.search.SearchService;
|
||||
import org.alfresco.service.namespace.NamespaceService;
|
||||
import org.alfresco.util.URLDecoder;
|
||||
import org.alfresco.web.app.Application;
|
||||
import org.alfresco.web.bean.LoginBean;
|
||||
@@ -53,13 +58,6 @@ import org.springframework.web.context.WebApplicationContext;
|
||||
import org.springframework.web.context.support.WebApplicationContextUtils;
|
||||
import org.springframework.web.jsf.FacesContextUtils;
|
||||
|
||||
import org.alfresco.i18n.I18NUtil;
|
||||
import org.alfresco.repo.tenant.TenantService;
|
||||
import org.alfresco.service.cmr.repository.NodeService;
|
||||
import org.alfresco.service.cmr.repository.StoreRef;
|
||||
import org.alfresco.service.cmr.search.SearchService;
|
||||
import org.alfresco.service.namespace.NamespaceService;
|
||||
|
||||
|
||||
/**
|
||||
* Base servlet class containing useful constant values and common methods for Alfresco servlets.
|
||||
@@ -202,20 +200,28 @@ public abstract class BaseServlet extends HttpServlet
|
||||
/**
|
||||
* Apply Client and Repository language locale based on the 'Accept-Language' request header
|
||||
*/
|
||||
public static Locale setLanguageFromRequestHeader(HttpServletRequest req)
|
||||
public static Locale setLanguageFromRequestHeader(HttpServletRequest req, ServletContext sc)
|
||||
{
|
||||
Locale locale = null;
|
||||
|
||||
// set language locale from browser header
|
||||
String acceptLang = req.getHeader("Accept-Language");
|
||||
if (acceptLang != null && acceptLang.length() != 0)
|
||||
// Set the current locale and language
|
||||
if (Application.getClientConfig(sc).isLanguageSelect())
|
||||
{
|
||||
StringTokenizer t = new StringTokenizer(acceptLang, ",; ");
|
||||
// get language and convert to java locale format
|
||||
String language = t.nextToken().replace('-', '_');
|
||||
Application.setLanguage(req.getSession(), language);
|
||||
locale = I18NUtil.parseLocale(language);
|
||||
I18NUtil.setLocale(locale);
|
||||
locale = Application.getLanguage(req.getSession());
|
||||
}
|
||||
else
|
||||
{
|
||||
// set language locale from browser header
|
||||
String acceptLang = req.getHeader("Accept-Language");
|
||||
if (acceptLang != null && acceptLang.length() != 0)
|
||||
{
|
||||
StringTokenizer t = new StringTokenizer(acceptLang, ",; ");
|
||||
// get language and convert to java locale format
|
||||
String language = t.nextToken().replace('-', '_');
|
||||
Application.setLanguage(req.getSession(), language);
|
||||
locale = I18NUtil.parseLocale(language);
|
||||
I18NUtil.setLocale(locale);
|
||||
}
|
||||
}
|
||||
|
||||
return locale;
|
||||
|
@@ -98,7 +98,8 @@ public class WebScriptNTLMAuthenticationFilter extends NTLMAuthenticationFilter
|
||||
String pathInfo = requestURI.substring((req.getContextPath() + req.getServletPath()).length());
|
||||
|
||||
if (getLogger().isDebugEnabled())
|
||||
getLogger().debug("Processing request: " + requestURI + " SID:" + req.getSession().getId());
|
||||
getLogger().debug("Processing request: " + requestURI + " SID:" +
|
||||
(req.getSession(false) != null ? req.getSession().getId() : null));
|
||||
|
||||
Match match = container.getRegistry().findWebScript(req.getMethod(), URLDecoder.decode(pathInfo));
|
||||
if (match != null && match.getWebScript() != null)
|
||||
|
@@ -612,7 +612,7 @@ public abstract class BaseActionWizard extends BaseWizardBean
|
||||
// is a no-parameter action
|
||||
IHandler handler = this.actionHandlers.get(this.action);
|
||||
|
||||
if (!handler.isAllowMultiple() && isActionPresent(this.action))
|
||||
if (handler != null && !handler.isAllowMultiple() && isActionPresent(this.action))
|
||||
{
|
||||
Utils.addErrorMessage(Application.getMessage(
|
||||
FacesContext.getCurrentInstance(), ERROR_ACTION_CANNOT_BE_EXECUTE_REPEATEDLY));
|
||||
|
@@ -237,7 +237,7 @@ public class CreateWebsiteWizard extends BaseWizardBean
|
||||
wiz.setStandalone(false);
|
||||
// the wizard is responsible for notifying the invited users, setting the appropriate
|
||||
// node permissions and also for creating user sandboxes and associations to the web folder node
|
||||
outcome = wiz.finish();
|
||||
outcome = wiz.finishImpl(context, outcome);
|
||||
if (outcome != null)
|
||||
{
|
||||
// persist the forms, templates, workflows, workflow defaults and deployment
|
||||
|
@@ -66,7 +66,7 @@ import freemarker.template.SimpleHash;
|
||||
|
||||
public class FormImpl implements Form
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
private static final long serialVersionUID = 7654769105419391840L;
|
||||
|
||||
private static final Log LOGGER = LogFactory.getLog(FormImpl.class);
|
||||
|
||||
@@ -74,15 +74,14 @@ public class FormImpl implements Form
|
||||
private transient FormsService formsService;
|
||||
private transient Map<String, RenderingEngineTemplate> renderingEngineTemplates;
|
||||
|
||||
private final static LinkedList<FormProcessor> PROCESSORS =
|
||||
new LinkedList<FormProcessor>();
|
||||
private final static LinkedList<FormProcessor> PROCESSORS = new LinkedList<FormProcessor>();
|
||||
|
||||
static
|
||||
{
|
||||
FormImpl.PROCESSORS.add(new XFormsProcessor());
|
||||
}
|
||||
|
||||
protected FormImpl(final NodeRef folderNodeRef,
|
||||
final FormsService formsService)
|
||||
protected FormImpl(final NodeRef folderNodeRef, final FormsService formsService)
|
||||
{
|
||||
if (folderNodeRef == null)
|
||||
{
|
||||
@@ -92,12 +91,6 @@ public class FormImpl implements Form
|
||||
{
|
||||
throw new NullPointerException();
|
||||
}
|
||||
final NodeService nodeService = this.getServiceRegistry().getNodeService();
|
||||
if (!nodeService.hasAspect(folderNodeRef, WCMAppModel.ASPECT_FORM))
|
||||
{
|
||||
throw new IllegalArgumentException("node " + folderNodeRef +
|
||||
" does not have aspect " + WCMAppModel.ASPECT_FORM);
|
||||
}
|
||||
this.folderNodeRef = folderNodeRef;
|
||||
this.formsService = formsService;
|
||||
}
|
||||
|
Reference in New Issue
Block a user