luetzkendorf 2004/09/26 07:52:32
Modified: src/webdav/server/org/apache/slide/webdav/method
AbstractWebdavMethod.java MoveMethod.java
ReportMethod.java SearchMethod.java
src/webdav/server/org/apache/slide/webdav/util
VersioningHelper.java
Log:
merge with release branch
Revision Changes Path
1.51 +9 -37
jakarta-slide/src/webdav/server/org/apache/slide/webdav/method/AbstractWebdavMethod.java
Index: AbstractWebdavMethod.java
===================================================================
RCS file:
/home/cvs/jakarta-slide/src/webdav/server/org/apache/slide/webdav/method/AbstractWebdavMethod.java,v
retrieving revision 1.50
retrieving revision 1.51
diff -u -r1.50 -r1.51
--- AbstractWebdavMethod.java 22 Sep 2004 15:15:43 -0000 1.50
+++ AbstractWebdavMethod.java 26 Sep 2004 14:52:32 -0000 1.51
@@ -320,6 +320,11 @@
if (!this.config.isDefaultServlet()) {
this.slideContextPath += req.getServletPath();
}
+
+ // TODO this is a workaround to pass the slideContextPath to the search
+ // implementation
+ slideToken.addParameter("slideContextPath", this.slideContextPath);
+
parseRequestHeaders();
boolean transactionIsStarted = false;
@@ -736,39 +741,6 @@
output(new
Document(MethodUtil.getPreconditionViolationError(pve.getViolatedPrecondition())),
resp.getWriter());
}
}
-
- /**
- * Returns the absolute URL of the given <code>uri</code>, e.g.
- * if the server is <code>aloha.com:80</code>, context path is
- * <code>have</code> and the URI is <code>much/fun</code> the string
- * <code>http://aloha:80/have/much/fun</code>.
- *
- * @param uri the URI for which to return the URL (may be
<code>null</code>).
- *
- * @return the absolute URL.
- */
- protected String getAbsoluteURL(String uri) {
-
- StringBuffer buffer = new StringBuffer();
- buffer.append(HTTP_PROTOCOL);
- buffer.append(req.getServerName());
- buffer.append(":");
- buffer.append(req.getServerPort());
-
- if ( ! req.getContextPath().startsWith("/") ) {
- buffer.append("/");
- }
- // FIXME what about servlet context, user getSlideContext() ?
- buffer.append(req.getContextPath());
-
- if (uri != null) {
- if ( !req.getContextPath().endsWith("/") && !uri.startsWith("/") ) {
- buffer.append("/");
- }
- buffer.append(uri);
- }
- return buffer.toString();
- }
// -------------------------------------------------------- Private Methods
@@ -1793,4 +1765,4 @@
return result;
}
}
-}
+}
\ No newline at end of file
1.73 +9 -10
jakarta-slide/src/webdav/server/org/apache/slide/webdav/method/MoveMethod.java
Index: MoveMethod.java
===================================================================
RCS file:
/home/cvs/jakarta-slide/src/webdav/server/org/apache/slide/webdav/method/MoveMethod.java,v
retrieving revision 1.72
retrieving revision 1.73
diff -u -r1.72 -r1.73
--- MoveMethod.java 2 Aug 2004 16:36:02 -0000 1.72
+++ MoveMethod.java 26 Sep 2004 14:52:32 -0000 1.73
@@ -464,14 +464,13 @@
Element basicSearch = getWorkingResourceSearchElement(sourceUri);
String grammarNamespace = basicSearch.getNamespaceURI();
Search searchHelper = token.getSearchHelper();
- StringBuffer requestURIWithScope = new
StringBuffer(req.getContextPath());
- requestURIWithScope.append(sourceUri);
- SearchQuery searchQuery =
searchHelper.createSearchQuery(grammarNamespace,
- basicSearch,
- slideToken,
-
Integer.MAX_VALUE,
-
requestURIWithScope.toString());
+ SearchQuery searchQuery = searchHelper.createSearchQuery(
+ grammarNamespace,
+ basicSearch,
+ slideToken,
+ Integer.MAX_VALUE,
+ getSlideContextPath() + sourceUri);
SearchQueryResult queryResult = searchHelper.search(slideToken,
searchQuery);
1.72 +10 -10
jakarta-slide/src/webdav/server/org/apache/slide/webdav/method/ReportMethod.java
Index: ReportMethod.java
===================================================================
RCS file:
/home/cvs/jakarta-slide/src/webdav/server/org/apache/slide/webdav/method/ReportMethod.java,v
retrieving revision 1.71
retrieving revision 1.72
diff -u -r1.71 -r1.72
--- ReportMethod.java 2 Aug 2004 16:36:02 -0000 1.71
+++ ReportMethod.java 26 Sep 2004 14:52:32 -0000 1.72
@@ -97,26 +97,26 @@
if (reportWorker == null) {
if (R_EXPAND_PROPERTY.equals(reportName)) {
- reportWorker = new ExpandPropertyReport(slideToken, token,
config, req.getContextPath());
+ reportWorker = new ExpandPropertyReport(slideToken, token,
config, getSlideContextPath());
}
else if (R_VERSION_TREE.equals(reportName)) {
- reportWorker = new VersionTreeReport(slideToken, token, config,
req.getContextPath());
+ reportWorker = new VersionTreeReport(slideToken, token, config,
getSlideContextPath());
((VersionTreeReport)reportWorker).setVersioningHelper(versioningHelper);
}
else if (R_LOCATE_BY_HISTORY.equals(reportName)) {
- reportWorker = new LocateByHistoryReport(slideToken, token,
config, req.getContextPath());
+ reportWorker = new LocateByHistoryReport(slideToken, token,
config, getSlideContextPath());
}
else if (R_ACL_PRINCIPAL_PROP_SET.equals(reportName)) {
- reportWorker = new AclPrincipalPropSetReport(slideToken, token,
config, req.getContextPath());
+ reportWorker = new AclPrincipalPropSetReport(slideToken, token,
config, getSlideContextPath());
}
else if (R_PRINCIPAL_MATCH.equals(reportName)) {
- reportWorker = new PrincipalMatchReport(slideToken, token,
config, req.getContextPath());
+ reportWorker = new PrincipalMatchReport(slideToken, token,
config, getSlideContextPath());
}
else if (R_PRINCIPAL_PROPERTY_SEARCH.equals(reportName)) {
- reportWorker = new PrincipalPropertySearchReport(slideToken,
token, config, req.getContextPath());
+ reportWorker = new PrincipalPropertySearchReport(slideToken,
token, config, getSlideContextPath());
}
else if (R_PRINCIPAL_SEARCH_PROPERTY_SET.equals(reportName)) {
- reportWorker = new PrincipalSearchPropertySetReport(slideToken,
token, config, req.getContextPath());
+ reportWorker = new PrincipalSearchPropertySetReport(slideToken,
token, config, getSlideContextPath());
}
}
1.48 +7 -7
jakarta-slide/src/webdav/server/org/apache/slide/webdav/method/SearchMethod.java
Index: SearchMethod.java
===================================================================
RCS file:
/home/cvs/jakarta-slide/src/webdav/server/org/apache/slide/webdav/method/SearchMethod.java,v
retrieving revision 1.47
retrieving revision 1.48
diff -u -r1.47 -r1.48
--- SearchMethod.java 5 Aug 2004 14:43:29 -0000 1.47
+++ SearchMethod.java 26 Sep 2004 14:52:32 -0000 1.48
@@ -170,7 +170,7 @@
}
catch (AccessDeniedException e) {
- String contextPath = req.getContextPath() ;
+ String contextPath = getSlideContextPath();
AccessDeniedException ade = new AccessDeniedException
(contextPath + e.getObjectUri(),
contextPath + e.getSubjectUri(),
@@ -307,7 +307,7 @@
SearchQueryResult result = new SearchQueryResult ();
result.setStatus (queryStatus);
result.setDescription (message);
- result.setHref (req.getContextPath());
+ result.setHref (getSlideContextPath());
try {
WebdavResult webdavResult = new WebdavResult (result, retriever);
@@ -435,12 +435,12 @@
case SearchQueryResult.STATUS_PARTIAL_RESULT:
errorStatus = WebdavStatus.SC_INSUFFICIENT_STORAGE;
- href = req.getContextPath();
+ href = getSlideContextPath();
break;
case SearchQueryResult.STATUS_UNPROCESSABLE_ENTITY:
errorStatus = WebdavStatus.SC_UNPROCESSABLE_ENTITY;
- href = req.getContextPath();
+ href = getSlideContextPath();
break;
case SearchQueryResult.STATUS_BAD_GATEWAY:
1.109 +5 -9
jakarta-slide/src/webdav/server/org/apache/slide/webdav/util/VersioningHelper.java
Index: VersioningHelper.java
===================================================================
RCS file:
/home/cvs/jakarta-slide/src/webdav/server/org/apache/slide/webdav/util/VersioningHelper.java,v
retrieving revision 1.108
retrieving revision 1.109
diff -u -r1.108 -r1.109
--- VersioningHelper.java 3 Sep 2004 15:57:28 -0000 1.108
+++ VersioningHelper.java 26 Sep 2004 14:52:32 -0000 1.109
@@ -499,12 +499,8 @@
*/
protected SearchQueryResult searchResourcesWithGivenHistory(String historyPath,
String scope, int maxDepth) throws ServiceAccessException, BadQueryException,
VetoException {
- // make it a relative scope
- // if (scope.startsWith("/")) {
- // scope = scope.substring (1);
- // }
-
- SlideUri slideUri = new SlideUri (req.getRequestURI());
+ SlideUri slideUri = SlideUri.createWithRequestUri(
+ this.slideContextPath, req.getRequestURI());
String absPath = slideUri.getContextPath (scope);
Element basicSearch = getResourcesWithVersionHistoryQueryElement(absPath,
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]