mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-14 17:58:59 +00:00
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:
@@ -18,8 +18,14 @@
|
||||
*/
|
||||
package org.alfresco.repo.web.scripts;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.InputStreamReader;
|
||||
import java.io.OutputStream;
|
||||
import java.io.Writer;
|
||||
import java.util.HashMap;
|
||||
@@ -44,17 +50,20 @@ import org.alfresco.service.cmr.repository.NodeRef;
|
||||
import org.alfresco.service.cmr.repository.TemplateService;
|
||||
import org.alfresco.service.cmr.security.AuthorityService;
|
||||
import org.alfresco.service.descriptor.DescriptorService;
|
||||
import org.alfresco.util.TempFileProvider;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.springframework.beans.factory.ObjectFactory;
|
||||
import org.springframework.context.ApplicationContext;
|
||||
import org.springframework.context.ApplicationEvent;
|
||||
import org.springframework.context.event.ContextRefreshedEvent;
|
||||
import org.springframework.extensions.surf.util.Content;
|
||||
import org.springframework.extensions.surf.util.StringBuilderWriter;
|
||||
import org.springframework.extensions.webscripts.AbstractRuntimeContainer;
|
||||
import org.springframework.extensions.webscripts.Authenticator;
|
||||
import org.springframework.extensions.webscripts.Cache;
|
||||
import org.springframework.extensions.webscripts.Description;
|
||||
import org.springframework.extensions.webscripts.Match;
|
||||
import org.springframework.extensions.webscripts.Registry;
|
||||
import org.springframework.extensions.webscripts.Runtime;
|
||||
import org.springframework.extensions.webscripts.ServerModel;
|
||||
@@ -62,11 +71,14 @@ import org.springframework.extensions.webscripts.WebScript;
|
||||
import org.springframework.extensions.webscripts.WebScriptException;
|
||||
import org.springframework.extensions.webscripts.WebScriptRequest;
|
||||
import org.springframework.extensions.webscripts.WebScriptResponse;
|
||||
import org.springframework.extensions.webscripts.WrappingWebScriptRequest;
|
||||
import org.springframework.extensions.webscripts.WrappingWebScriptResponse;
|
||||
import org.springframework.extensions.webscripts.Description.FormatStyle;
|
||||
import org.springframework.extensions.webscripts.Description.RequiredAuthentication;
|
||||
import org.springframework.extensions.webscripts.Description.RequiredTransaction;
|
||||
import org.springframework.extensions.webscripts.Description.RequiredTransactionParameters;
|
||||
import org.springframework.extensions.webscripts.Description.TransactionCapability;
|
||||
import org.springframework.util.FileCopyUtils;
|
||||
|
||||
|
||||
/**
|
||||
@@ -337,6 +349,7 @@ public class RepositoryContainer extends AbstractRuntimeContainer implements Ten
|
||||
}
|
||||
else
|
||||
{
|
||||
final BufferedRequest bufferedReq;
|
||||
final BufferedResponse bufferedRes;
|
||||
RequiredTransactionParameters trxParams = description.getRequiredTransactionParameters();
|
||||
if (trxParams.getCapability() == TransactionCapability.readwrite)
|
||||
@@ -346,18 +359,21 @@ public class RepositoryContainer extends AbstractRuntimeContainer implements Ten
|
||||
if (logger.isDebugEnabled())
|
||||
logger.debug("Creating Transactional Response for ReadWrite transaction; buffersize=" + trxParams.getBufferSize());
|
||||
|
||||
// create buffered response that allows transaction retrying
|
||||
// create buffered request and response that allow transaction retrying
|
||||
bufferedReq = new BufferedRequest(scriptReq);
|
||||
bufferedRes = new BufferedResponse(scriptRes, trxParams.getBufferSize());
|
||||
}
|
||||
else
|
||||
{
|
||||
if (logger.isDebugEnabled())
|
||||
logger.debug("Transactional Response bypassed for ReadWrite - buffersize=0");
|
||||
bufferedReq = null;
|
||||
bufferedRes = null;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
bufferedReq = null;
|
||||
bufferedRes = null;
|
||||
}
|
||||
|
||||
@@ -378,9 +394,10 @@ public class RepositoryContainer extends AbstractRuntimeContainer implements Ten
|
||||
}
|
||||
else
|
||||
{
|
||||
// Reset the response in case of a transaction retry
|
||||
// Reset the request and response in case of a transaction retry
|
||||
bufferedReq.reset();
|
||||
bufferedRes.reset();
|
||||
script.execute(scriptReq, bufferedRes);
|
||||
script.execute(bufferedReq, bufferedRes);
|
||||
}
|
||||
}
|
||||
catch(Exception e)
|
||||
@@ -440,6 +457,14 @@ public class RepositoryContainer extends AbstractRuntimeContainer implements Ten
|
||||
// Map TooBusyException to a 503 status code
|
||||
throw new WebScriptException(HttpServletResponse.SC_SERVICE_UNAVAILABLE, e.getMessage(), e);
|
||||
}
|
||||
finally
|
||||
{
|
||||
// Get rid of any temporary files
|
||||
if (bufferedReq != null)
|
||||
{
|
||||
bufferedReq.close();
|
||||
}
|
||||
}
|
||||
|
||||
// Ensure a response is always flushed after successful execution
|
||||
if (bufferedRes != null)
|
||||
@@ -824,4 +849,346 @@ public class RepositoryContainer extends AbstractRuntimeContainer implements Ten
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static class BufferedRequest implements WrappingWebScriptRequest
|
||||
{
|
||||
private WebScriptRequest req;
|
||||
private File requestBody;
|
||||
private InputStream contentStream;
|
||||
private BufferedReader contentReader;
|
||||
|
||||
public BufferedRequest(WebScriptRequest req)
|
||||
{
|
||||
this.req = req;
|
||||
}
|
||||
|
||||
// If a web script wants access to the request stream, we copy it to a temporary file, so we can have several
|
||||
// retries at the transaction
|
||||
private File getRequestBodyAsFile() throws IOException
|
||||
{
|
||||
if (this.requestBody == null)
|
||||
{
|
||||
this.requestBody = TempFileProvider.createTempFile("webscript_", ".bin");
|
||||
OutputStream out = new FileOutputStream(this.requestBody);
|
||||
FileCopyUtils.copy(req.getContent().getInputStream(), out);
|
||||
}
|
||||
return this.requestBody;
|
||||
}
|
||||
|
||||
public void reset()
|
||||
{
|
||||
if (contentStream != null)
|
||||
{
|
||||
try
|
||||
{
|
||||
contentStream.close();
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
}
|
||||
contentStream = null;
|
||||
}
|
||||
if (contentReader != null)
|
||||
{
|
||||
try
|
||||
{
|
||||
contentReader.close();
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
}
|
||||
contentReader = null;
|
||||
}
|
||||
}
|
||||
|
||||
public void close()
|
||||
{
|
||||
reset();
|
||||
if (requestBody != null)
|
||||
{
|
||||
try
|
||||
{
|
||||
requestBody.delete();
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
}
|
||||
requestBody = null;
|
||||
}
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.springframework.extensions.webscripts.WrappingWebScriptRequest#getNext()
|
||||
*/
|
||||
@Override
|
||||
public WebScriptRequest getNext()
|
||||
{
|
||||
return req;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.springframework.extensions.webscripts.WebScriptRequest#forceSuccessStatus()
|
||||
*/
|
||||
@Override
|
||||
public boolean forceSuccessStatus()
|
||||
{
|
||||
return req.forceSuccessStatus();
|
||||
}
|
||||
/* (non-Javadoc)
|
||||
* @see org.springframework.extensions.webscripts.WebScriptRequest#getAgent()
|
||||
*/
|
||||
@Override
|
||||
public String getAgent()
|
||||
{
|
||||
return req.getAgent();
|
||||
}
|
||||
/* (non-Javadoc)
|
||||
* @see org.springframework.extensions.webscripts.WebScriptRequest#getContent()
|
||||
*/
|
||||
@Override
|
||||
public Content getContent()
|
||||
{
|
||||
final Content wrapped = req.getContent();
|
||||
return new Content(){
|
||||
|
||||
@Override
|
||||
public String getContent() throws IOException
|
||||
{
|
||||
return wrapped.getContent();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getEncoding()
|
||||
{
|
||||
return wrapped.getEncoding();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getMimetype()
|
||||
{
|
||||
return wrapped.getMimetype();
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public long getSize()
|
||||
{
|
||||
return wrapped.getSize();
|
||||
}
|
||||
|
||||
@Override
|
||||
public InputStream getInputStream()
|
||||
{
|
||||
if (BufferedRequest.this.contentReader != null)
|
||||
{
|
||||
throw new IllegalStateException("Reader in use");
|
||||
}
|
||||
if (BufferedRequest.this.contentStream == null)
|
||||
{
|
||||
try
|
||||
{
|
||||
BufferedRequest.this.contentStream = new FileInputStream(getRequestBodyAsFile());
|
||||
}
|
||||
catch (IOException e)
|
||||
{
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
return BufferedRequest.this.contentStream;
|
||||
}
|
||||
|
||||
@Override
|
||||
public BufferedReader getReader() throws IOException
|
||||
{
|
||||
if (BufferedRequest.this.contentStream != null)
|
||||
{
|
||||
throw new IllegalStateException("Input Stream in use");
|
||||
}
|
||||
if (BufferedRequest.this.contentReader == null)
|
||||
{
|
||||
String encoding = wrapped.getEncoding();
|
||||
BufferedRequest.this.contentReader = new BufferedReader(new InputStreamReader(new FileInputStream(
|
||||
getRequestBodyAsFile()), encoding == null ? "ISO-8859-1" : encoding));
|
||||
}
|
||||
return BufferedRequest.this.contentReader;
|
||||
}
|
||||
};
|
||||
}
|
||||
/* (non-Javadoc)
|
||||
* @see org.springframework.extensions.webscripts.WebScriptRequest#getContentType()
|
||||
*/
|
||||
@Override
|
||||
public String getContentType()
|
||||
{
|
||||
return req.getContentType();
|
||||
}
|
||||
/* (non-Javadoc)
|
||||
* @see org.springframework.extensions.webscripts.WebScriptRequest#getContextPath()
|
||||
*/
|
||||
@Override
|
||||
public String getContextPath()
|
||||
{
|
||||
return req.getContextPath();
|
||||
}
|
||||
/* (non-Javadoc)
|
||||
* @see org.springframework.extensions.webscripts.WebScriptRequest#getExtensionPath()
|
||||
*/
|
||||
@Override
|
||||
public String getExtensionPath()
|
||||
{
|
||||
return req.getExtensionPath();
|
||||
}
|
||||
/* (non-Javadoc)
|
||||
* @see org.springframework.extensions.webscripts.WebScriptRequest#getFormat()
|
||||
*/
|
||||
@Override
|
||||
public String getFormat()
|
||||
{
|
||||
return req.getFormat();
|
||||
}
|
||||
/* (non-Javadoc)
|
||||
* @see org.springframework.extensions.webscripts.WebScriptRequest#getFormatStyle()
|
||||
*/
|
||||
@Override
|
||||
public FormatStyle getFormatStyle()
|
||||
{
|
||||
return req.getFormatStyle();
|
||||
}
|
||||
/* (non-Javadoc)
|
||||
* @see org.springframework.extensions.webscripts.WebScriptRequest#getHeader(java.lang.String)
|
||||
*/
|
||||
@Override
|
||||
public String getHeader(String name)
|
||||
{
|
||||
return req.getHeader(name);
|
||||
}
|
||||
/* (non-Javadoc)
|
||||
* @see org.springframework.extensions.webscripts.WebScriptRequest#getHeaderNames()
|
||||
*/
|
||||
@Override
|
||||
public String[] getHeaderNames()
|
||||
{
|
||||
return req.getHeaderNames();
|
||||
}
|
||||
/* (non-Javadoc)
|
||||
* @see org.springframework.extensions.webscripts.WebScriptRequest#getHeaderValues(java.lang.String)
|
||||
*/
|
||||
@Override
|
||||
public String[] getHeaderValues(String name)
|
||||
{
|
||||
return req.getHeaderValues(name);
|
||||
}
|
||||
/* (non-Javadoc)
|
||||
* @see org.springframework.extensions.webscripts.WebScriptRequest#getJSONCallback()
|
||||
*/
|
||||
@Override
|
||||
public String getJSONCallback()
|
||||
{
|
||||
return req.getJSONCallback();
|
||||
}
|
||||
/* (non-Javadoc)
|
||||
* @see org.springframework.extensions.webscripts.WebScriptRequest#getParameter(java.lang.String)
|
||||
*/
|
||||
@Override
|
||||
public String getParameter(String name)
|
||||
{
|
||||
return req.getParameter(name);
|
||||
}
|
||||
/* (non-Javadoc)
|
||||
* @see org.springframework.extensions.webscripts.WebScriptRequest#getParameterNames()
|
||||
*/
|
||||
@Override
|
||||
public String[] getParameterNames()
|
||||
{
|
||||
return req.getParameterNames();
|
||||
}
|
||||
/* (non-Javadoc)
|
||||
* @see org.springframework.extensions.webscripts.WebScriptRequest#getParameterValues(java.lang.String)
|
||||
*/
|
||||
@Override
|
||||
public String[] getParameterValues(String name)
|
||||
{
|
||||
return req.getParameterValues(name);
|
||||
}
|
||||
/* (non-Javadoc)
|
||||
* @see org.springframework.extensions.webscripts.WebScriptRequest#getPathInfo()
|
||||
*/
|
||||
@Override
|
||||
public String getPathInfo()
|
||||
{
|
||||
return req.getPathInfo();
|
||||
}
|
||||
/* (non-Javadoc)
|
||||
* @see org.springframework.extensions.webscripts.WebScriptRequest#getQueryString()
|
||||
*/
|
||||
@Override
|
||||
public String getQueryString()
|
||||
{
|
||||
return req.getQueryString();
|
||||
}
|
||||
/* (non-Javadoc)
|
||||
* @see org.springframework.extensions.webscripts.WebScriptRequest#getRuntime()
|
||||
*/
|
||||
@Override
|
||||
public Runtime getRuntime()
|
||||
{
|
||||
return req.getRuntime();
|
||||
}
|
||||
/* (non-Javadoc)
|
||||
* @see org.springframework.extensions.webscripts.WebScriptRequest#getServerPath()
|
||||
*/
|
||||
@Override
|
||||
public String getServerPath()
|
||||
{
|
||||
return req.getServerPath();
|
||||
}
|
||||
/* (non-Javadoc)
|
||||
* @see org.springframework.extensions.webscripts.WebScriptRequest#getServiceContextPath()
|
||||
*/
|
||||
@Override
|
||||
public String getServiceContextPath()
|
||||
{
|
||||
return req.getServiceContextPath();
|
||||
}
|
||||
/* (non-Javadoc)
|
||||
* @see org.springframework.extensions.webscripts.WebScriptRequest#getServiceMatch()
|
||||
*/
|
||||
@Override
|
||||
public Match getServiceMatch()
|
||||
{
|
||||
return req.getServiceMatch();
|
||||
}
|
||||
/* (non-Javadoc)
|
||||
* @see org.springframework.extensions.webscripts.WebScriptRequest#getServicePath()
|
||||
*/
|
||||
@Override
|
||||
public String getServicePath()
|
||||
{
|
||||
return req.getServicePath();
|
||||
}
|
||||
/* (non-Javadoc)
|
||||
* @see org.springframework.extensions.webscripts.WebScriptRequest#getURL()
|
||||
*/
|
||||
@Override
|
||||
public String getURL()
|
||||
{
|
||||
return req.getURL();
|
||||
}
|
||||
/* (non-Javadoc)
|
||||
* @see org.springframework.extensions.webscripts.WebScriptRequest#isGuest()
|
||||
*/
|
||||
@Override
|
||||
public boolean isGuest()
|
||||
{
|
||||
return req.isGuest();
|
||||
}
|
||||
/* (non-Javadoc)
|
||||
* @see org.springframework.extensions.webscripts.WebScriptRequest#parseContent()
|
||||
*/
|
||||
@Override
|
||||
public Object parseContent()
|
||||
{
|
||||
return req.parseContent();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -33,7 +33,7 @@ public class OptionsMethod extends WebDAVMethod
|
||||
private static final String ALLOW_HEADER = "Allow";
|
||||
private static final String MS_HEADER = "MS-Author-Via";
|
||||
|
||||
private static final String FILE_METHODS = "OPTIONS, GET, HEAD, POST, DELETE, PROPFIND, COPY, MOVE, LOCK, UNLOCK";
|
||||
private static final String FILE_METHODS = "OPTIONS, GET, HEAD, POST, DELETE, PROPFIND, PROPPATCH, COPY, MOVE, LOCK, UNLOCK";
|
||||
private static final String COLLECTION_METHODS = FILE_METHODS + ", PUT";
|
||||
|
||||
/**
|
||||
|
@@ -41,6 +41,7 @@ import org.alfresco.service.cmr.repository.datatype.DefaultTypeConverter;
|
||||
import org.alfresco.service.cmr.repository.datatype.TypeConverter;
|
||||
import org.alfresco.service.namespace.QName;
|
||||
import org.dom4j.DocumentHelper;
|
||||
import org.dom4j.io.OutputFormat;
|
||||
import org.dom4j.io.XMLWriter;
|
||||
import org.w3c.dom.Document;
|
||||
import org.w3c.dom.Element;
|
||||
@@ -318,6 +319,21 @@ public class PropFindMethod extends WebDAVMethod
|
||||
xml.flush();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected XMLWriter createXMLWriter() throws IOException
|
||||
{
|
||||
String userAgent = m_request.getHeader("User-Agent");
|
||||
if ((null != userAgent) && userAgent.toLowerCase().startsWith("microsoft-webdav-miniredir/5.1."))
|
||||
{
|
||||
// ALF-9952: XP requires compact XML for this response
|
||||
return new XMLWriter(m_response.getOutputStream(), OutputFormat.createCompactFormat());
|
||||
}
|
||||
else
|
||||
{
|
||||
return super.createXMLWriter();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a WebDAVProperty from the given XML node
|
||||
*/
|
||||
|
@@ -397,7 +397,7 @@ public abstract class BaseAuthenticationFilter
|
||||
* @throws ServletException
|
||||
* on error
|
||||
*/
|
||||
protected void handleLoginForm(HttpServletRequest req, HttpServletResponse res) throws IOException,
|
||||
protected boolean handleLoginForm(HttpServletRequest req, HttpServletResponse res) throws IOException,
|
||||
ServletException
|
||||
{
|
||||
// Invalidate current session
|
||||
@@ -425,19 +425,20 @@ public abstract class BaseAuthenticationFilter
|
||||
if (username == null || username.length() == 0)
|
||||
{
|
||||
res.sendError(HttpServletResponse.SC_BAD_REQUEST, "Username not specified");
|
||||
return;
|
||||
return false;
|
||||
}
|
||||
|
||||
if (password == null)
|
||||
{
|
||||
res.sendError(HttpServletResponse.SC_BAD_REQUEST, "Password not specified");
|
||||
return;
|
||||
return false;
|
||||
}
|
||||
|
||||
authenticationService.authenticate(username, password.toCharArray());
|
||||
session = req.getSession();
|
||||
createUserEnvironment(session, username, authenticationService.getCurrentTicket(), false);
|
||||
res.setStatus(HttpServletResponse.SC_NO_CONTENT);
|
||||
return true;
|
||||
}
|
||||
catch (AuthenticationException e)
|
||||
{
|
||||
@@ -447,5 +448,6 @@ public abstract class BaseAuthenticationFilter
|
||||
{
|
||||
res.sendError(HttpServletResponse.SC_BAD_REQUEST, "Unable to parse JSON POST body: " + jErr.getMessage());
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user