Merged HEAD-BUG-FIX (5.0/Cloud) to HEAD (5.0/Cloud)

75035: Merged WAT2 (5.0/Cloud) to HEAD-BUG-FIX (5.0/Cloud)
      71719: Changed the Raise event test to a POST from a GET


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@75363 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Will Abson
2014-07-01 15:10:45 +00:00
parent b35bec9108
commit 91ca9dbe23
4 changed files with 27 additions and 16 deletions

View File

@@ -41,7 +41,7 @@ import org.springframework.util.StringUtils;
* @author Gethin James
* @since 5.0
*/
public class RaiseBrowserEventGet extends AbstractWebScript
public class RaiseBrowserEventPost extends AbstractWebScript
{
private EventPublisher eventPublisher;
private SiteService siteService;
@@ -79,13 +79,22 @@ public class RaiseBrowserEventGet extends AbstractWebScript
action = templateVars.get("action");
}
String attributes = req.getParameter("attributes");
String attributes = req.getContent().getContent();
if (attributes != null)
{
if (!validJsonMap(attributes))
if (StringUtils.hasText(attributes))
{
throw new WebScriptException(Status.STATUS_BAD_REQUEST, "Invalid JSON Object: " + attributes);
if (!validJsonMap(attributes))
{
throw new WebScriptException(Status.STATUS_BAD_REQUEST, "Invalid JSON Object: " + attributes);
}
}
else
{
//No valid attributes passed in so reset it
attributes = null;
}
}
if (StringUtils.hasText(component) && StringUtils.hasText(action))