r7499 - in dumbhippo/trunk/server: src/com/dumbhippo/persistence src/com/dumbhippo/server src/com/dumbhippo/server/impl web web/css-gnome web/javascript/dh web/jsp-gnome web/tags/3



Author: marinaz
Date: 2008-08-12 19:47:09 -0500 (Tue, 12 Aug 2008)
New Revision: 7499

Added:
   dumbhippo/trunk/server/src/com/dumbhippo/persistence/OnlineAccountType.java
   dumbhippo/trunk/server/web/css-gnome/account-types-positions.css
   dumbhippo/trunk/server/web/css-gnome/account-types.css
   dumbhippo/trunk/server/web/jsp-gnome/account-type-add.jsp
Modified:
   dumbhippo/trunk/server/src/com/dumbhippo/persistence/ExternalAccount.java
   dumbhippo/trunk/server/src/com/dumbhippo/persistence/ExternalAccountType.java
   dumbhippo/trunk/server/src/com/dumbhippo/server/ExternalAccountSystem.java
   dumbhippo/trunk/server/src/com/dumbhippo/server/HttpMethods.java
   dumbhippo/trunk/server/src/com/dumbhippo/server/impl/ExternalAccountSystemBean.java
   dumbhippo/trunk/server/src/com/dumbhippo/server/impl/HttpMethodsBean.java
   dumbhippo/trunk/server/web/javascript/dh/actions.js
   dumbhippo/trunk/server/web/servlet-info.xml
   dumbhippo/trunk/server/web/tags/3/applicationEditRow.tag
Log:
Create new database table OnlineAccountType to store arbitrary account types and a web page for creating such account types. Migration steps are on the Database Changes wiki page.

Modified: dumbhippo/trunk/server/src/com/dumbhippo/persistence/ExternalAccount.java
===================================================================
--- dumbhippo/trunk/server/src/com/dumbhippo/persistence/ExternalAccount.java	2008-08-04 16:17:49 UTC (rev 7498)
+++ dumbhippo/trunk/server/src/com/dumbhippo/persistence/ExternalAccount.java	2008-08-13 00:47:09 UTC (rev 7499)
@@ -29,6 +29,7 @@
 	
 	// what site is the account on
 	private ExternalAccountType accountType;
+	private OnlineAccountType onlineAccountType;
 	// how do we feel about this site
 	private Sentiment sentiment;
 	// meaning of this varies by the where
@@ -46,9 +47,9 @@
 		feeds = new HashSet<Feed>();
 	}
 	
-	public ExternalAccount(ExternalAccountType where) {
+	public ExternalAccount(ExternalAccountType accountType) {
 		this();
-		this.accountType = where;
+		this.accountType = accountType;
 	}
 	
 	@ManyToOne
@@ -61,6 +62,7 @@
 		this.account = account;
 	}
 	
+	// TODO: eventually, we should get rid of this column and use OnlineAccountType 
 	@Column(nullable=false)
 	public ExternalAccountType getAccountType() {
 		return accountType;
@@ -69,6 +71,16 @@
 		this.accountType = type;
 	}
 	
+	@ManyToOne
+	@JoinColumn(nullable=false)
+	public OnlineAccountType getOnlineAccountType() {
+		return onlineAccountType;
+	}
+	
+	public void setOnlineAccountType(OnlineAccountType onlineAccountType) {
+		this.onlineAccountType = onlineAccountType;
+	}
+	
 	@Column(nullable=true)
 	public String getHandle() {
 		return handle;

Modified: dumbhippo/trunk/server/src/com/dumbhippo/persistence/ExternalAccountType.java
===================================================================
--- dumbhippo/trunk/server/src/com/dumbhippo/persistence/ExternalAccountType.java	2008-08-04 16:17:49 UTC (rev 7498)
+++ dumbhippo/trunk/server/src/com/dumbhippo/persistence/ExternalAccountType.java	2008-08-13 00:47:09 UTC (rev 7499)
@@ -1029,7 +1029,7 @@
 		
 		@Override
 	    public String getSiteUserInfoType() {
-	    	return "user name";
+	    	return "username";
 	    }
 		
 		@Override

Added: dumbhippo/trunk/server/src/com/dumbhippo/persistence/OnlineAccountType.java
===================================================================
--- dumbhippo/trunk/server/src/com/dumbhippo/persistence/OnlineAccountType.java	2008-08-04 16:17:49 UTC (rev 7498)
+++ dumbhippo/trunk/server/src/com/dumbhippo/persistence/OnlineAccountType.java	2008-08-13 00:47:09 UTC (rev 7499)
@@ -0,0 +1,145 @@
+package com.dumbhippo.persistence;
+
+import java.net.MalformedURLException;
+import java.net.URL;
+
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.JoinColumn;
+import javax.persistence.ManyToOne;
+
+ Entity
+public class OnlineAccountType extends DBUnique {
+		
+	private static final long serialVersionUID = 1L;
+	
+	private ExternalAccountType accountType;
+	private String name; // must not have spaces
+	private String fullName;
+	private String siteName;
+	private String site;
+	private String userInfoType;
+	private User creator;
+	// account types that should not show up on online.gnome.org should be marked as not supported
+	private boolean supported;
+	
+	
+	protected OnlineAccountType() {
+		supported = true;
+	}
+	
+	public OnlineAccountType(String name, String fullName, String siteName, String site, String userInfoType) throws ValidationException {
+		this();
+		setName(name);
+		setFullName(fullName);
+		setSiteName(siteName);
+		setSite(site);
+		setUserInfoType(userInfoType);
+	}
+	
+	@Column(nullable=true, unique=true)
+	public ExternalAccountType getAccountType() {
+		return accountType;
+	}
+	
+	public void setAccountType(ExternalAccountType type) {
+		this.accountType = type;
+	}
+	
+	@Column(nullable=false, unique=true)
+	public String getName() {
+		return name;
+	}
+	
+	public void setName(String name) throws ValidationException {
+		name = name.trim();
+    	if (name.length() == 0) 
+    		throw new ValidationException("The name can not be empty");
+    	
+    	for (int i = 0; i < name.length(); i++) {
+			char c = name.charAt(i);
+			if (!((c >= 'a' && c <= 'z') || (c == '_')))
+				throw new ValidationException("Account type name can only contain lower case characters and an underscore.");
+		}
+    	
+		this.name = name;
+	}
+
+	@Column(nullable=false, unique=true)
+	public String getFullName() {
+		return fullName;
+	}
+	
+	public void setFullName(String fullName) throws ValidationException {
+		fullName = fullName.trim();
+    	if (fullName.length() == 0) 
+    		throw new ValidationException("The full name can not be empty");
+		this.fullName = fullName;
+	}
+
+	@Column(nullable=false, unique=false)
+	public String getSiteName() {
+		return siteName;
+	}
+	
+	public void setSiteName(String siteName) throws ValidationException {
+		siteName = siteName.trim();
+    	if (siteName.length() == 0) 
+    		throw new ValidationException("The site name can not be empty");
+    	
+		this.siteName = siteName;
+	}
+	
+	@Column(nullable = false)
+	public String getSite() {
+		return site;
+	}
+	
+	public void setSite(String site) throws ValidationException {
+		site = site.trim();
+		
+		if (!site.startsWith("http"))
+			site = "http://"; + site;	
+  	
+		try {
+			@SuppressWarnings("unused")
+			URL url = new URL(site);
+		} catch (MalformedURLException e) {
+			throw new ValidationException("site url " + site + " is malformed");
+		}
+		
+		this.site = site;
+	}
+
+	@Column(nullable=false, unique=true)
+	public String getUserInfoType() {
+		return userInfoType;
+	}
+	
+	public void setUserInfoType(String userInfoType) throws ValidationException {
+        userInfoType = userInfoType.trim();
+		if (userInfoType.length() == 0) 
+    		throw new ValidationException("The site user info type can not be empty");
+    	
+		this.userInfoType = userInfoType;
+	}
+	
+	@ManyToOne
+	@JoinColumn(nullable = true)
+	public User getCreator() {
+		return creator;
+	}
+	
+	public void setCreator(User creator) {
+		this.creator = creator;
+	}
+
+	@Column(nullable=false)
+	public boolean isSupported() {
+		return supported;
+	}
+
+	public void setSupported(boolean supported) {
+		this.supported = supported;
+	}
+}

Modified: dumbhippo/trunk/server/src/com/dumbhippo/server/ExternalAccountSystem.java
===================================================================
--- dumbhippo/trunk/server/src/com/dumbhippo/server/ExternalAccountSystem.java	2008-08-04 16:17:49 UTC (rev 7498)
+++ dumbhippo/trunk/server/src/com/dumbhippo/server/ExternalAccountSystem.java	2008-08-13 00:47:09 UTC (rev 7499)
@@ -8,8 +8,10 @@
 import com.dumbhippo.Thumbnail;
 import com.dumbhippo.persistence.ExternalAccount;
 import com.dumbhippo.persistence.ExternalAccountType;
+import com.dumbhippo.persistence.OnlineAccountType;
 import com.dumbhippo.persistence.Sentiment;
 import com.dumbhippo.persistence.User;
+import com.dumbhippo.persistence.ValidationException;
 import com.dumbhippo.server.listeners.AccountStatusListener;
 import com.dumbhippo.server.views.ExternalAccountView;
 import com.dumbhippo.server.views.UserViewpoint;
@@ -78,4 +80,16 @@
 	public void setSentiment(ExternalAccount externalAccount, Sentiment sentiment);
 	
 	public void validateAll();
+	
+	public OnlineAccountType getOnlineAccountType(ExternalAccountType accountType);
+	
+	public OnlineAccountType lookupOnlineAccountTypeForName(String name) throws NotFoundException;
+	
+	public OnlineAccountType lookupOnlineAccountTypeForFullName(String fullName) throws NotFoundException;
+	
+	public OnlineAccountType lookupOnlineAccountTypeForUserInfoType(String userInfoType) throws NotFoundException;
+
+	public List<OnlineAccountType> lookupOnlineAccountTypesForSite(String siteUrl);
+	
+	public OnlineAccountType createOnlineAccountType(UserViewpoint viewpoint, String name, String fullName, String siteName, String siteUrl, String userInfoType) throws ValidationException;	
 }

Modified: dumbhippo/trunk/server/src/com/dumbhippo/server/HttpMethods.java
===================================================================
--- dumbhippo/trunk/server/src/com/dumbhippo/server/HttpMethods.java	2008-08-04 16:17:49 UTC (rev 7498)
+++ dumbhippo/trunk/server/src/com/dumbhippo/server/HttpMethods.java	2008-08-13 00:47:09 UTC (rev 7499)
@@ -471,4 +471,9 @@
 	@HttpParams( { } )
 	public void getAimVerifyLink(OutputStream out, HttpResponseData contentType, UserViewpoint viewpoint)
 		throws IOException, RetryException;
+	
+	@HttpContentTypes(HttpResponseData.XMLMETHOD)
+	@HttpParams( { "name", "fullName", "siteName", "site", "userInfoType", "isSupported" })
+	public void doCreateAccountType(XmlBuilder xml, UserViewpoint viewpoint, String name, String fullName, String siteName, String site, String userInfoType, boolean isSupported)
+			throws XmlMethodException;
 }

Modified: dumbhippo/trunk/server/src/com/dumbhippo/server/impl/ExternalAccountSystemBean.java
===================================================================
--- dumbhippo/trunk/server/src/com/dumbhippo/server/impl/ExternalAccountSystemBean.java	2008-08-04 16:17:49 UTC (rev 7498)
+++ dumbhippo/trunk/server/src/com/dumbhippo/server/impl/ExternalAccountSystemBean.java	2008-08-13 00:47:09 UTC (rev 7499)
@@ -10,6 +10,7 @@
 import javax.ejb.EJB;
 import javax.ejb.Stateless;
 import javax.persistence.EntityManager;
+import javax.persistence.NoResultException;
 import javax.persistence.PersistenceContext;
 import javax.persistence.Query;
 
@@ -23,6 +24,7 @@
 import com.dumbhippo.persistence.Account;
 import com.dumbhippo.persistence.ExternalAccount;
 import com.dumbhippo.persistence.ExternalAccountType;
+import com.dumbhippo.persistence.OnlineAccountType;
 import com.dumbhippo.persistence.Sentiment;
 import com.dumbhippo.persistence.User;
 import com.dumbhippo.persistence.ValidationException;
@@ -98,6 +100,7 @@
 		ExternalAccount external = a.getExternalAccount(type);
 		if (external == null) {
 			external = new ExternalAccount(type);
+			external.setOnlineAccountType(getOnlineAccountType(type));
 			external.setAccount(a);
 			em.persist(external);
 			a.getExternalAccounts().add(external);
@@ -106,7 +109,67 @@
 		}
 		return external;
 	}
+	
+	public OnlineAccountType getOnlineAccountType(ExternalAccountType accountType) {
+		Query q = em.createQuery("SELECT oat FROM OnlineAccountType oat WHERE " +
+				                 "oat.accountType = " + accountType.ordinal());
+		try {
+			return (OnlineAccountType)q.getSingleResult();
+		} catch (NoResultException e) {
+			throw new RuntimeException("There is an ExternalAccountType for which no matching OnlineAccountType was found: " + accountType.getName());
+		}
+	}
+	
+	public OnlineAccountType lookupOnlineAccountTypeForName(String name) throws NotFoundException {
+		Query q = em.createQuery("SELECT oat FROM OnlineAccountType oat WHERE " +
+				                 "LOWER(oat.name) = :name");
+		q.setParameter("name", name.toLowerCase());
+		
+		try {
+			return (OnlineAccountType)q.getSingleResult();
+		} catch (NoResultException e) {
+			throw new NotFoundException("No OnlineAccountType with name " + name);
+		}
+	}
+	
+	public OnlineAccountType lookupOnlineAccountTypeForFullName(String fullName) throws NotFoundException {
+		Query q = em.createQuery("SELECT oat FROM OnlineAccountType oat WHERE " +
+                                 "LOWER(oat.fullName) = :fullName");
+        q.setParameter("fullName", fullName.toLowerCase());
 
+        try {
+            return (OnlineAccountType)q.getSingleResult();
+        } catch (NoResultException e) {
+            throw new NotFoundException("No OnlineAccountType with full name " + fullName);
+        }
+    }
+
+	public OnlineAccountType lookupOnlineAccountTypeForUserInfoType(String userInfoType) throws NotFoundException {
+		Query q = em.createQuery("SELECT oat FROM OnlineAccountType oat WHERE " +
+                                 "LOWER(oat.userInfoType) = :userInfoType");
+        q.setParameter("userInfoType", userInfoType.toLowerCase());
+
+        try {
+            return (OnlineAccountType)q.getSingleResult();
+        } catch (NoResultException e) {
+            throw new NotFoundException("No OnlineAccountType with user info type " + userInfoType);
+        }
+    }
+	
+	public List<OnlineAccountType> lookupOnlineAccountTypesForSite(String siteUrl) { 
+	    Query q = em.createQuery("SELECT oat FROM OnlineAccountType oat WHERE " +
+                                 "LOWER(oat.site) = :site");
+        q.setParameter("site", siteUrl);						
+        return TypeUtils.castList(OnlineAccountType.class, q.getResultList());
+    }
+
+    public OnlineAccountType createOnlineAccountType(UserViewpoint viewpoint, String name, String fullName, String siteName, String siteUrl, String userInfoType) throws ValidationException {
+    	OnlineAccountType type = new OnlineAccountType(name, fullName, siteName, siteUrl, userInfoType);
+		type.setCreator(viewpoint.getViewer());
+		em.persist(type);
+		return type;
+    }
+
 	public ExternalAccount lookupExternalAccount(Viewpoint viewpoint, User user, ExternalAccountType type)
 		throws NotFoundException {
 		if (!em.contains(user.getAccount()))

Modified: dumbhippo/trunk/server/src/com/dumbhippo/server/impl/HttpMethodsBean.java
===================================================================
--- dumbhippo/trunk/server/src/com/dumbhippo/server/impl/HttpMethodsBean.java	2008-08-04 16:17:49 UTC (rev 7498)
+++ dumbhippo/trunk/server/src/com/dumbhippo/server/impl/HttpMethodsBean.java	2008-08-13 00:47:09 UTC (rev 7499)
@@ -66,6 +66,7 @@
 import com.dumbhippo.persistence.FacebookAccount;
 import com.dumbhippo.persistence.Feed;
 import com.dumbhippo.persistence.FeedEntry;
+import com.dumbhippo.persistence.OnlineAccountType;
 import com.dumbhippo.persistence.Group;
 import com.dumbhippo.persistence.GroupAccess;
 import com.dumbhippo.persistence.GroupDescriptionChangedRevision;
@@ -2632,4 +2633,41 @@
 		out.write(StringUtils.getBytes(link));
 		out.flush();
 	}
+	
+	public void doCreateAccountType(XmlBuilder xml, UserViewpoint viewpoint, String name, String fullName, String siteName, String site, String userInfoType, boolean isSupported)
+	    throws XmlMethodException {
+		
+		try {
+			externalAccountSystem.lookupOnlineAccountTypeForName(name);
+			throw new XmlMethodException(XmlMethodErrorCode.INVALID_ARGUMENT, "Account type with this name already exists.");
+		} catch (NotFoundException e) {
+			// nothing to do
+		}
+		
+		try {
+			externalAccountSystem.lookupOnlineAccountTypeForFullName(fullName);
+			throw new XmlMethodException(XmlMethodErrorCode.INVALID_ARGUMENT, "Account type with this full name already exists.");
+		} catch (NotFoundException e) {
+			// nothing to do
+		}
+
+		try {
+			externalAccountSystem.lookupOnlineAccountTypeForUserInfoType(userInfoType);
+			throw new XmlMethodException(XmlMethodErrorCode.INVALID_ARGUMENT, "Account type with this user info type already exists.");
+		} catch (NotFoundException e) {
+			// nothing to do
+		}
+		
+		if (userInfoType.trim().length() == 0)
+			throw new XmlMethodException(XmlMethodErrorCode.INVALID_ARGUMENT, "Account type with this full name already exists.");
+		
+		// TODO: create a warning if account types for this site already exist
+		// List<OnlineAccountType> accountTypes = externalAccountSystem.lookupOnlineAccountTypesForSite(site);
+		try { 
+		    OnlineAccountType accountType = externalAccountSystem.createOnlineAccountType(viewpoint, name, fullName, siteName, site, userInfoType);
+		    accountType.setSupported(isSupported);
+		} catch (ValidationException e) {
+			throw new XmlMethodException(XmlMethodErrorCode.INVALID_ARGUMENT, e.getMessage());
+		}
+	}
 }

Added: dumbhippo/trunk/server/web/css-gnome/account-types-positions.css
===================================================================
--- dumbhippo/trunk/server/web/css-gnome/account-types-positions.css	2008-08-04 16:17:49 UTC (rev 7498)
+++ dumbhippo/trunk/server/web/css-gnome/account-types-positions.css	2008-08-13 00:47:09 UTC (rev 7499)
@@ -0,0 +1,28 @@
+ CHARSET "UTF-8";
+
+.dh-account-type-table {
+	table-layout: fixed;
+}
+
+.dh-application-edit-label {
+	width: 10em;
+}
+
+.dh-application-edit-control {
+	position: relative;
+	width: 	  40em;
+}
+
+.dh-application-edit-control input {
+	width:    40em;
+}
+
+.dh-application-edit-control textarea {
+	width:    40em;
+	height:   5em;
+}
+
+.dh-application-edit-help {
+	width:    40em;
+	padding-bottom: 20px;
+}
\ No newline at end of file

Added: dumbhippo/trunk/server/web/css-gnome/account-types.css
===================================================================
--- dumbhippo/trunk/server/web/css-gnome/account-types.css	2008-08-04 16:17:49 UTC (rev 7498)
+++ dumbhippo/trunk/server/web/css-gnome/account-types.css	2008-08-13 00:47:09 UTC (rev 7499)
@@ -0,0 +1,22 @@
+ CHARSET "UTF-8";
+ IMPORT url("account-types-positions.css");
+
+/*
+ * TODO: This has some of the css styling from applications.css because
+ * the page also uses applicationEditRow.tag; we should create generic files and rename the tag
+ * and the css classes if we continue to use it for both.
+ */
+ 
+.dh-application-edit-label {
+	font-weight: bold;
+	text-align: right;
+	vertical-align: baseline;
+}
+
+.dh-application-edit-control textarea {
+	font-family: Luxi Sans, Arial, sans-serif;
+}
+
+.dh-application-edit-help {
+	font-style: italic;
+}

Modified: dumbhippo/trunk/server/web/javascript/dh/actions.js
===================================================================
--- dumbhippo/trunk/server/web/javascript/dh/actions.js	2008-08-04 16:17:49 UTC (rev 7498)
+++ dumbhippo/trunk/server/web/javascript/dh/actions.js	2008-08-13 00:47:09 UTC (rev 7499)
@@ -350,4 +350,23 @@
 		  	    	 function(type, error, http) {
 		  	    	     alert("Couldn't set google services enabled");
 		  	    	 });
-}
\ No newline at end of file
+}
+
+dh.actions.createAccountType = function() {
+    name = document.getElementById("dhAccountTypeName").value
+    fullName = document.getElementById("dhAccountTypeFullName").value
+    siteName = document.getElementById("dhAccountTypeSiteName").value
+    site = document.getElementById("dhAccountTypeSite").value
+    userInfoType = document.getElementById("dhUserInfoType").value
+    public = document.getElementById("dhAccountTypePublic").checked
+  	dh.server.doXmlMethod("createaccounttype",
+			 	          { "name" : name, "fullName" : fullName, "siteName" : siteName, "site" : site, 
+			 	            "userInfoType" : userInfoType, "isSupported" : public },
+  					      function(type, data, http) {
+  					          alert("Account type added!");
+  					 	      dh.util.refresh();
+					      },
+					      function(type, msg, http) {
+						      alert(msg);
+					      });    
+}    
\ No newline at end of file

Added: dumbhippo/trunk/server/web/jsp-gnome/account-type-add.jsp
===================================================================
--- dumbhippo/trunk/server/web/jsp-gnome/account-type-add.jsp	2008-08-04 16:17:49 UTC (rev 7498)
+++ dumbhippo/trunk/server/web/jsp-gnome/account-type-add.jsp	2008-08-13 00:47:09 UTC (rev 7499)
@@ -0,0 +1,92 @@
+<html>
+<%@ page pageEncoding="UTF-8" %>
+<%@ taglib uri="http://java.sun.com/jsp/jstl/core"; prefix="c" %>
+<%@ taglib uri="/jsp/dumbhippo.tld" prefix="dh" %>
+<%@ taglib tagdir="/WEB-INF/tags/2" prefix="dht" %>
+<%@ taglib tagdir="/WEB-INF/tags/3" prefix="dht3" %>
+<%@ taglib tagdir="/WEB-INF/tags/gnome" prefix="gnome" %>
+
+<head>
+	<title>Add Account Type</title>
+	<gnome:stylesheet name="site" iefixes="true"/>	
+	<gnome:stylesheet name="account-types"/>	
+	<dh:script modules="dh.actions,dh.textinput,dh.util"/>	
+	<script type="text/javascript">
+	    function dhLowerCaseAccountTypeName() {
+            name = document.getElementById("dhAccountTypeName").value;
+            document.getElementById("dhAccountTypeName").value=name.toLowerCase();
+        }	
+        
+	    function dhOnLoad() {
+	        siteName = document.getElementById('dhAccountTypeSiteName');
+	        userInfoType = document.getElementById('dhUserInfoType');	    
+		    siteNameEntry = new dh.textinput.Entry(siteName, "", "");   
+		    userInfoTypeEntry = new dh.textinput.Entry(userInfoType, "username", "username");  
+	        siteNameEntry.onkeyup = function(event) {
+	            userInfoTypeEntry.setValue(siteNameEntry.getValue() + " username"); 
+	        }
+	    }	    
+    </script>	            
+</head>
+
+<body onload="dhOnLoad()">
+<gnome:page currentPageLink="account-type-add">
+		<div class="dh-page-shinybox-title-large">Add Account Type</div>
+		<div>
+   			This page allows you to create a new online account type.
+			<a href="/account-types">View existing types</a>
+		</div>
+	    <hr>
+	    <div id="dhMessage">
+	    </div>
+	    <div>
+		    <h3>Account Type Information</h3>
+		    <table class="dh-application-edit">
+		        <dht3:applicationEditRow id="dhAccountTypeName" name="name" label="Name" onkeyup="dhLowerCaseAccountTypeName()">
+		    		<jsp:attribute name="help">
+		    			A short name uniquely identifying the account type. Can only contain lower-case letters and underscores. (e.g. twitter, remember_the_milk, google_reader_rss)
+		    		</jsp:attribute>
+		    	</dht3:applicationEditRow>
+		    	<dht3:applicationEditRow id="dhAccountTypeFullName" name="fullName" label="Full Name">
+		    		<jsp:attribute name="help">
+		    			A full name for the account type. (e.g. Twitter, Remember the Milk, Netflix RSS Feed)
+		    		</jsp:attribute>
+		    	</dht3:applicationEditRow>
+		    	<dht3:applicationEditRow id="dhAccountTypeSiteName" name="siteName" label="Site Name">
+		    		<jsp:attribute name="help">
+		    			The name of the web site where the user can get this account type. (e.g. Twitter, Remember the Milk)
+		    		</jsp:attribute>
+		    	</dht3:applicationEditRow>
+		    	<dht3:applicationEditRow id="dhAccountTypeSite" name="site" label="Site">
+		    		<jsp:attribute name="help">
+						The url of the web site where the user can get this account type. (e.g. twitter.com, rememberthemilk.com)
+		    		</jsp:attribute>
+		    	</dht3:applicationEditRow>
+		    	<dht3:applicationEditRow id="dhUserInfoType" name="userInfoType" label="User Info Type">
+		    		<jsp:attribute name="help">
+						What is the type of user information being requested. (e.g. Twitter username, e-mail used for Flickr, Rhapsody "Recently Played Tracks" RSS feed URL)
+		    		</jsp:attribute>
+		    	</dht3:applicationEditRow>	    	
+		    	<tr>
+	    			<td class="dh-application-edit-label">
+	    			    Public:
+	    			</td>
+	    			<td>
+	    			    <input type="radio" name="dhAccountTypeStatus" id="dhAccountTypePublic"> <label for="dhAccountTypePublic">Yes</label>
+					    <input type="radio" name="dhAccountTypeStatus" id="dhAccountTypePrivate"  checked="true"> <label for="dhAccountTypePrivate">No</label>		
+	    			</td>
+	    		</tr>
+	    		<tr>
+		            <td></td>
+		            <td class="dh-application-edit-help">
+			            Should this account type be listed on online.gnome.org or are desktop features for it still under development.       
+		            </td>
+	            </tr>		   	    				    		
+		    	<tr>		    	
+		    		<td></td>
+		    		<td><input type="button" value="Save" onclick="dh.actions.createAccountType()"></input></td>
+		    	</tr>
+		    </table>
+	    </div>
+	</gnome:page>
+</body>
\ No newline at end of file

Modified: dumbhippo/trunk/server/web/servlet-info.xml
===================================================================
--- dumbhippo/trunk/server/web/servlet-info.xml	2008-08-04 16:17:49 UTC (rev 7498)
+++ dumbhippo/trunk/server/web/servlet-info.xml	2008-08-13 00:47:09 UTC (rev 7499)
@@ -319,7 +319,7 @@
       </init-param>
       <init-param>
           <param-name>requiresSignin</param-name>
-          <param-value>account,admin,application-edit,application-history,chatwindow,chatwindow-disabled,create-group,download,friends,getradar,group-account,group-invitation,group-invitations,home,invitation,invitation-admin,network,network-overview,radar-theme-creator,statistics</param-value>
+          <param-value>account,admin,account-type-add,application-edit,application-history,chatwindow,chatwindow-disabled,create-group,download,friends,getradar,group-account,group-invitation,group-invitations,home,invitation,invitation-admin,network,network-overview,radar-theme-creator,statistics</param-value>
       </init-param>
       <load-on-startup>1</load-on-startup>
    </servlet>   

Modified: dumbhippo/trunk/server/web/tags/3/applicationEditRow.tag
===================================================================
--- dumbhippo/trunk/server/web/tags/3/applicationEditRow.tag	2008-08-04 16:17:49 UTC (rev 7498)
+++ dumbhippo/trunk/server/web/tags/3/applicationEditRow.tag	2008-08-13 00:47:09 UTC (rev 7499)
@@ -8,6 +8,7 @@
 <%@ attribute name="name" required="true" type="java.lang.String" rtexprvalue="false"%>
 <%@ attribute name="value" required="false" type="java.lang.String"%>
 <%@ attribute name="onchange" required="false" type="java.lang.String"%>
+<%@ attribute name="onkeyup" required="false" type="java.lang.String"%>
 <%@ attribute name="rowClass" required="false" type="java.lang.String"%>
 <%@ attribute name="help" required="false" fragment="true"%>
 <%@ attribute name="contents" required="false" fragment="true"%>
@@ -31,6 +32,7 @@
 				    <jsp:attribute name="name">${name}</jsp:attribute>
 				    <jsp:attribute name="value"><c:out value="${value}"/></jsp:attribute>
 				    <jsp:attribute name="onchange">${onchange}</jsp:attribute>
+				    <jsp:attribute name="onkeyup">${onkeyup}</jsp:attribute>
 			    </jsp:element>
 			</c:otherwise>
 		</c:choose>



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