From 0af335801536a2c93e3d4ebcbd997369e018d268 Mon Sep 17 00:00:00 2001 From: Michael Ru Date: Thu, 24 Jul 2008 09:45:06 +0000 Subject: [PATCH] - inserted new blog icons - fixes for top search bar, but icons still not correctly layed out - fixed blog/discussion REST API unit tests - fix for broken external blog config dialog - documentlibrary activity now produces correct download url for files (filename at the end of the url was missing) git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@10001 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261 --- .../org/alfresco/repository/blogs/blogpost.lib.js | 9 ++++++++- .../alfresco/repo/web/scripts/blog/BlogServiceTest.java | 8 ++++---- .../web/scripts/discussion/DiscussionServiceTest.java | 8 ++++---- 3 files changed, 16 insertions(+), 9 deletions(-) diff --git a/config/alfresco/templates/webscripts/org/alfresco/repository/blogs/blogpost.lib.js b/config/alfresco/templates/webscripts/org/alfresco/repository/blogs/blogpost.lib.js index e1e6f92be4..e443d7774d 100644 --- a/config/alfresco/templates/webscripts/org/alfresco/repository/blogs/blogpost.lib.js +++ b/config/alfresco/templates/webscripts/org/alfresco/repository/blogs/blogpost.lib.js @@ -68,8 +68,15 @@ function getBlogPostData(node) } // does the external post require an update? - if ((node.properties["blg:lastUpdate"] != undefined)) + if (node.hasAspect(ASPECT_RELEASED) && (node.properties["blg:lastUpdate"] != undefined)) { + // we either use the release or updated date + var modifiedDate = data.releaseDate; + if (data.updatedDate != undefined) + { + modifiedDate = data.updatedDate; + } + if ((modifiedDate - node.properties["blg:lastUpdate"]) > 5000) { data.outOfDate = true; diff --git a/source/java/org/alfresco/repo/web/scripts/blog/BlogServiceTest.java b/source/java/org/alfresco/repo/web/scripts/blog/BlogServiceTest.java index 37e560bdb3..9163aa47f6 100644 --- a/source/java/org/alfresco/repo/web/scripts/blog/BlogServiceTest.java +++ b/source/java/org/alfresco/repo/web/scripts/blog/BlogServiceTest.java @@ -62,8 +62,8 @@ public class BlogServiceTest extends BaseWebScriptTest private static final String SITE_SHORT_NAME_BLOG = "BlogSiteShortName"; private static final String COMPONENT_BLOG = "blog"; - private static final String URL_BLOG_POST = "/blog/post/site/" + SITE_SHORT_NAME_BLOG + "/" + COMPONENT_BLOG + "/"; - private static final String URL_BLOG_POSTS = "/blog/site/" + SITE_SHORT_NAME_BLOG + "/" + COMPONENT_BLOG + "/posts"; + private static final String URL_BLOG_POST = "/api/blog/post/site/" + SITE_SHORT_NAME_BLOG + "/" + COMPONENT_BLOG + "/"; + private static final String URL_BLOG_POSTS = "/api/blog/site/" + SITE_SHORT_NAME_BLOG + "/" + COMPONENT_BLOG + "/posts"; private List posts = new ArrayList(5); private List drafts = new ArrayList(5); @@ -224,12 +224,12 @@ public class BlogServiceTest extends BaseWebScriptTest private String getCommentsUrl(String nodeRef) { - return "/node/" + nodeRef.replace("://", "/") + "/comments"; + return "/api/node/" + nodeRef.replace("://", "/") + "/comments"; } private String getCommentUrl(String nodeRef) { - return "/comment/node/" + nodeRef.replace("://", "/"); + return "/api/comment/node/" + nodeRef.replace("://", "/"); } private JSONObject createComment(String nodeRef, String title, String content, int expectedStatus) diff --git a/source/java/org/alfresco/repo/web/scripts/discussion/DiscussionServiceTest.java b/source/java/org/alfresco/repo/web/scripts/discussion/DiscussionServiceTest.java index 31b56ad740..1d9d4449b7 100644 --- a/source/java/org/alfresco/repo/web/scripts/discussion/DiscussionServiceTest.java +++ b/source/java/org/alfresco/repo/web/scripts/discussion/DiscussionServiceTest.java @@ -61,8 +61,8 @@ public class DiscussionServiceTest extends BaseWebScriptTest private static final String SITE_SHORT_NAME_DISCUSSION = "DiscussionSiteShortName"; private static final String COMPONENT_DISCUSSION = "discussion"; - private static final String URL_FORUM_POST = "/forum/post/site/" + SITE_SHORT_NAME_DISCUSSION + "/" + COMPONENT_DISCUSSION + "/"; - private static final String URL_FORUM_POSTS = "/forum/site/" + SITE_SHORT_NAME_DISCUSSION + "/" + COMPONENT_DISCUSSION + "/posts"; + private static final String URL_FORUM_POST = "/api/forum/post/site/" + SITE_SHORT_NAME_DISCUSSION + "/" + COMPONENT_DISCUSSION + "/"; + private static final String URL_FORUM_POSTS = "/api/forum/site/" + SITE_SHORT_NAME_DISCUSSION + "/" + COMPONENT_DISCUSSION + "/posts"; private List posts = new ArrayList(5); @@ -194,12 +194,12 @@ public class DiscussionServiceTest extends BaseWebScriptTest private String getRepliesUrl(String nodeRef) { - return "/forum/post/node/" + nodeRef.replace("://", "/") + "/replies"; + return "/api/forum/post/node/" + nodeRef.replace("://", "/") + "/replies"; } private String getPostUrl(String nodeRef) { - return "/forum/post/node/" + nodeRef.replace("://", "/"); + return "/api/forum/post/node/" + nodeRef.replace("://", "/"); } private JSONObject createReply(String nodeRef, String title, String content, int expectedStatus)