r7120 - in dumbhippo/trunk/server/src/com/dumbhippo: server/impl web/servlets



Author: marinaz
Date: 2007-12-21 15:36:11 -0600 (Fri, 21 Dec 2007)
New Revision: 7120

Modified:
   dumbhippo/trunk/server/src/com/dumbhippo/server/impl/HttpMethodsBean.java
   dumbhippo/trunk/server/src/com/dumbhippo/web/servlets/FacebookServlet.java
Log:
Fix up handling of the blog and website urls.

Use <fb:explanation> tag for the additional comments about the results of setting account information.

Modified: dumbhippo/trunk/server/src/com/dumbhippo/server/impl/HttpMethodsBean.java
===================================================================
--- dumbhippo/trunk/server/src/com/dumbhippo/server/impl/HttpMethodsBean.java	2007-12-21 21:30:53 UTC (rev 7119)
+++ dumbhippo/trunk/server/src/com/dumbhippo/server/impl/HttpMethodsBean.java	2007-12-21 21:36:11 UTC (rev 7120)
@@ -2091,7 +2091,7 @@
 		// DO NOT cut and paste this block into similar external account methods. It's only here because
 		// we don't use the "love hate" widget on /account for the website, and the javascript glue 
 		// for the plain entries assumes this works.
-		if (urlStr == null) {
+		if (urlStr == null || urlStr.trim().length() == 0) {
 			doRemoveExternalAccount(xml, viewpoint, "WEBSITE");
 			try {
 				ExternalAccount external = externalAccountSystem.lookupExternalAccount(viewpoint, viewpoint.getViewer(), ExternalAccountType.WEBSITE);
@@ -2105,6 +2105,8 @@
 		URL url = null;
 		
 		try {
+			if (!urlStr.startsWith("http"))
+				urlStr = "http://"; + urlStr;	
 		    url = new URL(urlStr);
 		} catch (MalformedURLException e) {
 			throw new XmlMethodException(XmlMethodErrorCode.PARSE_ERROR, e.getMessage());
@@ -2128,7 +2130,7 @@
 		// DO NOT cut and paste this block into similar external account methods. It's only here because
 		// we don't use the "love hate" widget on /account for the website, and the javascript glue 
 		// for the plain entries assumes this works.
-		if (urlStr == null) {
+		if (urlStr == null || urlStr.trim().length() == 0) {
 			doRemoveExternalAccount(xml, viewpoint, "BLOG");
 			try {
 				ExternalAccount external = externalAccountSystem.lookupExternalAccount(viewpoint, viewpoint.getViewer(), ExternalAccountType.BLOG);
@@ -2142,6 +2144,8 @@
 		URL url = null;
 		
 		try {
+			if (!urlStr.startsWith("http"))
+				urlStr = "http://"; + urlStr;	
 		    url = new URL(urlStr);
 		} catch (MalformedURLException e) {
 			throw new XmlMethodException(XmlMethodErrorCode.PARSE_ERROR, e.getMessage());

Modified: dumbhippo/trunk/server/src/com/dumbhippo/web/servlets/FacebookServlet.java
===================================================================
--- dumbhippo/trunk/server/src/com/dumbhippo/web/servlets/FacebookServlet.java	2007-12-21 21:30:53 UTC (rev 7119)
+++ dumbhippo/trunk/server/src/com/dumbhippo/web/servlets/FacebookServlet.java	2007-12-21 21:36:11 UTC (rev 7120)
@@ -314,7 +314,7 @@
 			}
 			
 			if (accountsWithNotes.size() > 0) {
-				xml.openElement("fb:success");
+				xml.openElement("fb:explanation");
 				xml.appendTextNode("fb:message", "Please Note");
 				xml.openElement("ul");
 				for (Map.Entry<ExternalAccountType, String> entry : accountsWithNotes.entrySet()) {



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]