User Profile Following UI enhancements as per SE.S79, SE.S80, SE.S81, SE.S82

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@29256 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Kevin Roast
2011-07-21 16:20:54 +00:00
parent ce1b9c5c72
commit ffff8cedd7
2 changed files with 21 additions and 11 deletions

View File

@@ -83,25 +83,31 @@ public abstract class AbstractSubscriptionServiceWebScript extends AbstractWebSc
if (obj instanceof JSONObject) if (obj instanceof JSONObject)
{ {
((JSONObject) obj).write(writer); ((JSONObject) obj).write(writer);
} else }
else
{ {
((JSONArray) obj).write(writer); ((JSONArray) obj).write(writer);
} }
writer.flush(); writer.flush();
} else }
else
{ {
res.setStatus(204); res.setStatus(204);
} }
} catch (SubscriptionsDisabledException sde) }
catch (SubscriptionsDisabledException sde)
{ {
throw new WebScriptException(404, "Subscription service is disabled!", sde); throw new WebScriptException(404, "Subscription service is disabled!", sde);
} catch (NoSuchPersonException nspe) }
catch (NoSuchPersonException nspe)
{ {
throw new WebScriptException(404, "Unknown user '" + nspe.getUserName() + "'!", nspe); throw new WebScriptException(404, "Unknown user '" + nspe.getUserName() + "'!", nspe);
} catch (PrivateSubscriptionListException psle) }
catch (PrivateSubscriptionListException psle)
{ {
throw new WebScriptException(403, "Subscription list is private!", psle); throw new WebScriptException(403, "Subscription list is private!", psle);
} catch (JSONException je) }
catch (JSONException je)
{ {
throw new WebScriptException(500, "Unable to parse or serialize JSON!", je); throw new WebScriptException(500, "Unable to parse or serialize JSON!", je);
} }
@@ -112,18 +118,19 @@ public abstract class AbstractSubscriptionServiceWebScript extends AbstractWebSc
protected int parseNumber(String name, String number, int def) protected int parseNumber(String name, String number, int def)
{ {
if (number != null && number.length() > 0) if (number != null && number.length() > 0)
{ {
try try
{ {
return Integer.parseInt(number); return Integer.parseInt(number);
} catch (NumberFormatException e) }
catch (NumberFormatException e)
{ {
throw new WebScriptException(400, name + " is not a number!", e); throw new WebScriptException(400, name + " is not a number!", e);
} }
} else }
else
{ {
return def; return def;
} }
@@ -148,6 +155,8 @@ public abstract class AbstractSubscriptionServiceWebScript extends AbstractWebSc
result.put("userName", username); result.put("userName", username);
result.put("firstName", nodeService.getProperty(node, ContentModel.PROP_FIRSTNAME)); result.put("firstName", nodeService.getProperty(node, ContentModel.PROP_FIRSTNAME));
result.put("lastName", nodeService.getProperty(node, ContentModel.PROP_LASTNAME)); result.put("lastName", nodeService.getProperty(node, ContentModel.PROP_LASTNAME));
result.put("jobtitle", nodeService.getProperty(node, ContentModel.PROP_JOBTITLE));
result.put("organization", nodeService.getProperty(node, ContentModel.PROP_ORGANIZATION));
String status = (String) nodeService.getProperty(node, ContentModel.PROP_USER_STATUS); String status = (String) nodeService.getProperty(node, ContentModel.PROP_USER_STATUS);
if (status != null) if (status != null)

View File

@@ -39,7 +39,8 @@ public class SubscriptionServicePrivateListPut extends SubscriptionServicePrivat
if (setPrivate.equalsIgnoreCase("true")) if (setPrivate.equalsIgnoreCase("true"))
{ {
subscriptionService.setSubscriptionListPrivate(userId, true); subscriptionService.setSubscriptionListPrivate(userId, true);
} else if (setPrivate.equalsIgnoreCase("false")) }
else if (setPrivate.equalsIgnoreCase("false"))
{ {
subscriptionService.setSubscriptionListPrivate(userId, false); subscriptionService.setSubscriptionListPrivate(userId, false);
} }