src/org/ohmage/domain/AccessRequest.java
public String toHTML() throws DomainException {
		JSONObject jsonContent = null;
		JSONArray detail = null;
		StringBuilder result = new StringBuilder();
			
		try {
			jsonContent = new JSONObject(requestContent);
			detail = jsonContent.getJSONArray(REQUEST_JSON_KEY_CONTENT);
		} catch (JSONException e) {
			// this should never happen
			throw new DomainException(
					ErrorCode.USER_ACCESS_REQUEST_EXECUTION_ERROR,
					"Invalid request content: " + requestContent,
					e);
		}
		
		result.append("<ul>\n");
		result.append("<li> Request Type: " + requestType.toString().toUpperCase() + " </li>\n");
		result.append("<li> Request Status: " + requestStatus.toString().toUpperCase() + " </li>\n");
		result.append("<li> Request username: " + username + " </li>\n");
		result.append("<li> Request Email Address: " + emailAddress + " </li>\n");
		result.append("<li> Request Information:</li>\n");
		result.append("  <ul>\n");			

		try {
			for (int i = 0; i < detail.length(); i++) {
				JSONObject elm = detail.getJSONObject(i);
				@SuppressWarnings("unchecked")
				Iterator<String> keys = elm.keys();
				while(keys.hasNext()){
					String key = (String) keys.next();
					String val = elm.getString(key);
					result.append("  <li> " + key + " : " + val + "</li>\n");
				}
			}
		} catch (JSONException e){
			throw new DomainException(
					ErrorCode.USER_ACCESS_REQUEST_EXECUTION_ERROR,
					"Cannot extract detail from the content: " + requestContent,
					e);
			
		}
		result.append("  </ul>\n");
		result.append("</ul>\n");
		
	
		return(result.toString());
	}
/**
	 * Returns this UserSetupRequest object as an HTML String 
	 *  
	 * @return Returns a HTML String containing the user setup request information.
	 * 
	 * @throws JSONException Thrown if generating the object caused an error.
	 */
Returns this UserSetupRequest object as an HTML String

@return Returns a HTML String containing the user setup request information.

@throws JSONException Thrown if generating the object caused an error.
Returns this UserSetupRequest object as an HTML String @return Returns a HTML String containing the user setup request information . @throws JSONException Thrown if generating the object caused an error .
public String toHTML() throws DomainException {
		JSONObject jsonContent = null;
		JSONArray detail = null;
		StringBuilder result = new StringBuilder();
		try {
			jsonContent = new JSONObject(requestContent);
			detail = jsonContent.getJSONArray(REQUEST_JSON_KEY_CONTENT);
		} catch (JSONException e) {
			throw new DomainException(
					ErrorCode.USER_ACCESS_REQUEST_EXECUTION_ERROR,
					"Invalid request content: " + requestContent,
					e);
		}
		result.append("<ul>\n");
		result.append("<li> Request Type: " + requestType.toString().toUpperCase() + " </li>\n");
		result.append("<li> Request Status: " + requestStatus.toString().toUpperCase() + " </li>\n");
		result.append("<li> Request username: " + username + " </li>\n");
		result.append("<li> Request Email Address: " + emailAddress + " </li>\n");
		result.append("<li> Request Information:</li>\n");
		result.append("  <ul>\n");			
		try {
			for (int i = 0; i < detail.length(); i++) {
				JSONObject elm = detail.getJSONObject(i);
				@SuppressWarnings("unchecked")
				Iterator<String> keys = elm.keys();
				while(keys.hasNext()){
					String key = (String) keys.next();
					String val = elm.getString(key);
					result.append("  <li> " + key + " : " + val + "</li>\n");
				}
			}
		} catch (JSONException e){
			throw new DomainException(
					ErrorCode.USER_ACCESS_REQUEST_EXECUTION_ERROR,
					"Cannot extract detail from the content: " + requestContent,
					e);
		}
		result.append("  </ul>\n");
		result.append("</ul>\n");
		return(result.toString());
	}
public String toHTML ( ) throws DomainException { JSONObject jsonContent = null ; JSONArray detail = null ; StringBuilder result = new StringBuilder ( ) ; try { jsonContent = new JSONObject ( requestContent ) ; detail = jsonContent . getJSONArray ( REQUEST_JSON_KEY_CONTENT ) ; } catch ( JSONException e ) { throw new DomainException ( ErrorCode . USER_ACCESS_REQUEST_EXECUTION_ERROR , "Invalid request content: " + requestContent , e ) ; } result . append ( "<ul>\n" ) ; result . append ( "<li> Request Type: " + requestType . toString ( ) . toUpperCase ( ) + " </li>\n" ) ; result . append ( "<li> Request Status: " + requestStatus . toString ( ) . toUpperCase ( ) + " </li>\n" ) ; result . append ( "<li> Request username: " + username + " </li>\n" ) ; result . append ( "<li> Request Email Address: " + emailAddress + " </li>\n" ) ; result . append ( "<li> Request Information:</li>\n" ) ; result . append ( "  <ul>\n" ) ; try { for ( int i = 0 ; i < detail . length ( ) ; i ++ ) { JSONObject elm = detail . getJSONObject ( i ) ; @ SuppressWarnings ( "unchecked" ) Iterator < String > keys = elm . keys ( ) ; while ( keys . hasNext ( ) ) { String key = ( String ) keys . next ( ) ; String val = elm . getString ( key ) ; result . append ( "  <li> " + key + " : " + val + "</li>\n" ) ; } } } catch ( JSONException e ) { throw new DomainException ( ErrorCode . USER_ACCESS_REQUEST_EXECUTION_ERROR , "Cannot extract detail from the content: " + requestContent , e ) ; } result . append ( "  </ul>\n" ) ; result . append ( "</ul>\n" ) ; return ( result . toString ( ) ) ; }
Returns this UserSetupRequest object as an HTML String
Returns this UserSetupRequest object as an HTML String
// this should never happen