ALF-8671 When listing Blogs/Lists/Discussions, the tag filter string is encoded before sending, so must be decoded in the webscript before searching. (Plus blog tagging test enhancements)

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@32146 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Nick Burch
2011-11-21 15:54:45 +00:00
parent 23e5568fa8
commit b6c7bf5477
3 changed files with 21 additions and 1 deletions

View File

@@ -35,9 +35,11 @@ import org.alfresco.service.cmr.repository.NodeRef;
import org.alfresco.service.cmr.site.SiteInfo;
import org.alfresco.util.Pair;
import org.alfresco.util.ScriptPagingDetails;
import org.alfresco.util.UrlUtil;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.json.simple.JSONObject;
import org.springframework.extensions.surf.util.URLDecoder;
import org.springframework.extensions.webscripts.Cache;
import org.springframework.extensions.webscripts.Status;
import org.springframework.extensions.webscripts.WebScriptRequest;
@@ -65,7 +67,15 @@ public abstract class AbstractGetBlogWebScript extends AbstractBlogWebScript
Date toDate = parseDateParam(req, "toDate");
String tag = req.getParameter("tag");
if (tag != null && tag.length() == 0) tag = null;
if (tag == null || tag.length() == 0)
{
tag = null;
}
else
{
// Tags can be full unicode strings, so decode
tag = URLDecoder.decode(tag);
}
// One webscript (blog-posts-new.get) uses a 'numdays' parameter as a 'fromDate'.
// This is a hacky solution to this special case. FIXME

View File

@@ -27,6 +27,7 @@ import org.alfresco.service.cmr.discussion.TopicInfo;
import org.alfresco.service.cmr.repository.NodeRef;
import org.alfresco.service.cmr.site.SiteInfo;
import org.json.simple.JSONObject;
import org.springframework.extensions.surf.util.URLDecoder;
import org.springframework.extensions.webscripts.Cache;
import org.springframework.extensions.webscripts.Status;
import org.springframework.extensions.webscripts.WebScriptException;
@@ -58,6 +59,9 @@ public class ForumTopicsGet extends AbstractDiscussionWebScript
if (tag != null && tag.length() > 0)
{
tagSearch = true;
// Tags can be full unicode strings, so decode
tag = URLDecoder.decode(tag);
}
// Get the topics

View File

@@ -32,6 +32,7 @@ import org.alfresco.service.cmr.links.LinkInfo;
import org.alfresco.service.cmr.repository.NodeRef;
import org.alfresco.service.cmr.site.SiteInfo;
import org.json.simple.JSONObject;
import org.springframework.extensions.surf.util.URLDecoder;
import org.springframework.extensions.webscripts.Cache;
import org.springframework.extensions.webscripts.Status;
import org.springframework.extensions.webscripts.WebScriptRequest;
@@ -61,6 +62,11 @@ public class LinksListGet extends AbstractLinksWebScript
{
tagFiltering = false;
}
else
{
// Tags can be full unicode strings, so decode
tag = URLDecoder.decode(tag);
}
// User?
boolean userFiltering = false;