Author: fmui
Date: Sat Sep 18 09:37:28 2010
New Revision: 998429
URL: http://svn.apache.org/viewvc?rev=998429&view=rev
Log:
AtomPub server bug fix: added missing URL template parameters
Modified:
incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/atompub/AtomPubUtils.java
incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/atompub/RepositoryService.java
Modified:
incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/atompub/AtomPubUtils.java
URL:
http://svn.apache.org/viewvc/incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/atompub/AtomPubUtils.java?rev=998429&r1=998428&r2=998429&view=diff
==============================================================================
---
incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/atompub/AtomPubUtils.java
(original)
+++
incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/atompub/AtomPubUtils.java
Sat Sep 18 09:37:28 2010
@@ -201,7 +201,7 @@ public final class AtomPubUtils {
@SuppressWarnings("unchecked")
public static <T> T getEnumParameter(HttpServletRequest request, String
name, Class<T> clazz) {
String value = getStringParameter(request, name);
- if (value == null) {
+ if ((value == null) || (value.length() == 0)) {
return null;
}
@@ -335,8 +335,8 @@ public final class AtomPubUtils {
if (info.getRenditionInfos() != null) {
for (RenditionInfo ri : info.getRenditionInfos()) {
- entry.writeAlternateLink(compileUrl(baseUrl, RESOURCE_CONTENT,
ri.getId()), ri.getContenType(), ri
- .getKind(), ri.getTitle(), ri.getLength());
+ entry.writeAlternateLink(compileUrl(baseUrl, RESOURCE_CONTENT,
ri.getId()), ri.getContenType(),
+ ri.getKind(), ri.getTitle(), ri.getLength());
}
}
@@ -386,8 +386,8 @@ public final class AtomPubUtils {
feed.startFeed(false);
// write basic Atom feed elements
- feed.writeFeedElements(folderInfo.getId(), folderInfo.getCreatedBy(),
folderInfo.getName(), folderInfo
- .getLastModificationDate(), null, null);
+ feed.writeFeedElements(folderInfo.getId(), folderInfo.getCreatedBy(),
folderInfo.getName(),
+ folderInfo.getLastModificationDate(), null, null);
// write links
feed.writeServiceLink(baseUrl.toString(), repositoryId);
Modified:
incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/atompub/RepositoryService.java
URL:
http://svn.apache.org/viewvc/incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/atompub/RepositoryService.java?rev=998429&r1=998428&r2=998429&view=diff
==============================================================================
---
incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/atompub/RepositoryService.java
(original)
+++
incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/atompub/RepositoryService.java
Sat Sep 18 09:37:28 2010
@@ -187,14 +187,16 @@ public final class RepositoryService {
// - folder tree
if (supportsFolderTree) {
- serviceDoc.writeLink(Constants.REP_REL_FOLDERTREE,
compileUrl(baseUrl, RESOURCE_FOLDERTREE,
- infoData.getRootFolderId()),
Constants.MEDIATYPE_DESCENDANTS, null);
+ serviceDoc.writeLink(Constants.REP_REL_FOLDERTREE,
+ compileUrl(baseUrl, RESOURCE_FOLDERTREE,
infoData.getRootFolderId()),
+ Constants.MEDIATYPE_DESCENDANTS, null);
}
// - root descendants
if (supportsRootDescendants) {
- serviceDoc.writeLink(Constants.REP_REL_ROOTDESC,
compileUrl(baseUrl, RESOURCE_DESCENDANTS, infoData
- .getRootFolderId()),
Constants.MEDIATYPE_DESCENDANTS, infoData.getRootFolderId());
+ serviceDoc.writeLink(Constants.REP_REL_ROOTDESC,
+ compileUrl(baseUrl, RESOURCE_DESCENDANTS,
infoData.getRootFolderId()),
+ Constants.MEDIATYPE_DESCENDANTS,
infoData.getRootFolderId());
}
// - changes
@@ -207,12 +209,12 @@ public final class RepositoryService {
// - object by id
String url = compileUrl(baseUrl, RESOURCE_OBJECTBYID, null)
- +
"?id={id}&filter={filter}&includeAllowableActions={includeAllowableActions}&includeACL={includeACL}";
+ +
"?id={id}&filter={filter}&includeAllowableActions={includeAllowableActions}&includeACL={includeACL}&includePolicyIds={includePolicyIds}&includeRelationships={includeRelationships}&renditionFilter={renditionFilter}";
serviceDoc.writeUriTemplate(url,
Constants.TEMPLATE_OBJECT_BY_ID, Constants.MEDIATYPE_ENTRY);
// - object by path
url = compileUrl(baseUrl, RESOURCE_OBJECTBYPATH, null)
- +
"?path={path}&filter={filter}&includeAllowableActions={includeAllowableActions}&includeACL={includeACL}";
+ +
"?path={path}&filter={filter}&includeAllowableActions={includeAllowableActions}&includeACL={includeACL}&includePolicyIds={includePolicyIds}&includeRelationships={includeRelationships}&renditionFilter={renditionFilter}";
serviceDoc.writeUriTemplate(url,
Constants.TEMPLATE_OBJECT_BY_PATH, Constants.MEDIATYPE_ENTRY);
// - type by id