Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

updates to billbuzz webapp

  • Loading branch information...
commit b865c90ba879f6d56a8562c30a33b4d8e75d07a0 1 parent 2a23b2b
Jared Williams authored
View
2  BBSignup/WebContent/authenticate.jsp
@@ -43,7 +43,7 @@
else {
%>
- <jsp:forward page="index.jsp" />
+ <jsp:forward page="/" />
<%
}
View
13 BBSignup/WebContent/cancel.jsp
@@ -0,0 +1,13 @@
+<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
+ pageEncoding="ISO-8859-1"%>
+<%
+ session.setAttribute("subs", null);
+ session.setAttribute("fn", null);
+ session.setAttribute("ln", null);
+ session.setAttribute("e", null);
+ session.setAttribute("oldemail", null);
+ session.setAttribute("update", null);
+
+%>
+
+<jsp:forward page="/" />
View
11 BBSignup/WebContent/css/style.css
@@ -32,4 +32,15 @@ A:visited {
color: blue;
}
+.notice
+{
+ background-color:#ffffcc;
+ color:#555;
+ padding:3px;
+ font-size:80%;
+ border:1px solid #aaaaaa;
+ text-align:center;
+
+}
+
View
9 BBSignup/WebContent/delete.jsp
@@ -19,6 +19,15 @@
</div>
<%
}
+ else {
+ %>
+ <div class="bad" style="width:500px;">
+ There was an error authenticating your request.
+ <br/><br/>
+ Please <a href="mailto:billbuzz@nysenate.gov">contact us</a> if you are having trouble.
+ </div>
+ <%
+ }
}
View
8 BBSignup/WebContent/footer.jsp
@@ -3,15 +3,13 @@
<table cellpadding=5>
<tr>
<td>
- <a href="index.jsp">Home</a>
+ <a href="index.jsp">BillBuzz Home</a>
</td>
- <td align="center">
- <a href="http://www.nysenate.gov">NYSenate.gov</a>
-
+ <td align="center">
</td>
<td align = "right">
- <a href="mailto:billbuzz@nysenate.gov">Contact</a>
+ <a href="http://www.nysenate.gov">NYSenate.gov</a>
</td>
</tr>
</table>
View
9 BBSignup/WebContent/header.jsp
@@ -5,6 +5,7 @@
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>NYSS BillBuzz</title>
+ <link rel="shortcut icon" href="img/nys_favicon_0.ico" />
<link rel="stylesheet" type="text/css" href="/BBSignup/css/style.css" />
<link rel="stylesheet" type="text/css" href="/BBSignup/css/nys.css" />
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
@@ -13,7 +14,7 @@
<body>
<div id="page">
<div id="header">
- <a href="index.jsp">
+ <a href="http://www.nysenate.gov">
<img src="http://www.nysenate.gov/sites/all/themes/nys/images/nyss_logo.png" id="logo" />
</a>
@@ -27,6 +28,12 @@
<li><a href="unsubscribe.jsp">Unsubscribe</a></li>
</ul>
</div>
+
+ <div class="notice">
+ BillBuzz is currently in "beta" and may occasionally offer incorrect data.
+ Please give us your feedback at
+ <a href="http://www.nysenate.gov/contact">http://www.nysenate.gov/contact</a>.
+ </div>
View
BIN  BBSignup/WebContent/img/nys_favicon_0.ico
Binary file not shown
View
23 BBSignup/WebContent/index.jsp
@@ -28,7 +28,7 @@
<td>Changes will be saved when you click Submit.</td>
</tr>
<tr>
- <td align=center><a href="">Click here to cancel your update</a></td>
+ <td align=center><a href="cancel.jsp">Click here to cancel your update</a></td>
</tr>
</table>
</div>
@@ -134,6 +134,7 @@
</tr>
</table>
<br />
+<div style="position:relative;right:-7px;">
<table cellpadding=3>
<%%>
<tr>
@@ -197,22 +198,12 @@
<td></td>
<td></td>
</tr>
- <tr></tr>
- <tr>
- <td></td>
- <td></td>
- <td></td>
- <td></td>
- <td></td>
- <td></td>
- <td></td>
- <td><input type="button" name="clear" value="Clear Selection"
- onClick="clearAll()"></input></td>
- <td></td>
- <td><input type="submit" id="process" name="submit"></input></td>
- </tr>
-
</table>
+
+<div style="position:right;right:250px;"><input type="button" name="clear" value="Clear Selection"
+ onClick="clearAll()"></input>
+ <input type="submit" id="process" name="submit" value="Sign up"></input></td><div>
+</div>
</div>
</form>
View
2  BBSignup/WebContent/notice.jsp
@@ -70,7 +70,7 @@
%>
- <jsp:forward page="index.jsp" />
+ <jsp:forward page="/" />
<%
View
2  BBSignup/WebContent/update.jsp
@@ -24,7 +24,7 @@
session.setAttribute("oldemail", uemail);
session.setAttribute("otherData",u.getOtherData()?"yes":"no");
%>
- <jsp:forward page="index.jsp" />
+ <jsp:forward page="/" />
<%
}
else {
View
133 BBSignup/src/bbsignup/model/OldSenator.java
@@ -0,0 +1,133 @@
+
+package bbsignup.model;
+
+import javax.jdo.annotations.PersistenceCapable;
+
+@PersistenceCapable
+public class OldSenator {
+ String name;
+ String url;
+ String openLegName;
+
+ boolean democrat;
+ boolean republican;
+ boolean conservative;
+ boolean workingFamilies; //WF
+ //boolean independentParty; //I
+ boolean independenceParty; //IP
+ //boolean independent; //ind
+
+ public OldSenator() {
+ democrat = false;
+ republican = false;
+ conservative = false;
+ workingFamilies = false;
+ independenceParty = false;
+ }
+
+ public OldSenator(Senator senator) {
+ this.name = senator.name;
+ this.url = senator.url;
+ this.openLegName = senator.openLegName;
+ this.democrat = senator.democrat;
+ this.republican = senator.republican;
+ this.conservative = senator.conservative;
+ this.workingFamilies = senator.workingFamilies;
+ this.independenceParty = senator.independenceParty;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public String getUrl() {
+ return url;
+ }
+
+ public String getOpenLegName() {
+ return openLegName;
+ }
+
+ public boolean isDemocrat() {
+ return democrat;
+ }
+
+ public boolean isRepublican() {
+ return republican;
+ }
+
+ public boolean isConservative() {
+ return conservative;
+ }
+
+ public boolean isWorkingFamilies() {
+ return workingFamilies;
+ }
+
+ public boolean isIndependenceParty() {
+ return independenceParty;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public void setUrl(String url) {
+ this.url = url;
+ }
+
+ public void setOpenLegName(String openLegName) {
+ this.openLegName = openLegName;
+ }
+
+ public void setDemocrat(boolean democrat) {
+ this.democrat = democrat;
+ }
+
+ public void setRepublican(boolean republican) {
+ this.republican = republican;
+ }
+
+ public void setConservative(boolean conservative) {
+ this.conservative = conservative;
+ }
+
+ public void setWorkingFamilies(boolean workingFamilies) {
+ this.workingFamilies = workingFamilies;
+ }
+
+ public void setIndependenceParty(boolean independanceParty) {
+ this.independenceParty = independanceParty;
+ }
+
+ public String getParty() {
+
+ String ret = "";
+ if(democrat) {
+ ret = "d";
+ }
+ else if(republican) {
+ ret = "r";
+ }
+ if(independenceParty) {
+ ret = getPartyHelper(ret,"ip");
+ }
+ if(conservative) {
+ ret = getPartyHelper(ret,"c");
+ }
+ if(workingFamilies) {
+ ret = getPartyHelper(ret,"wf");
+ }
+
+ return ret;
+ }
+
+ public String getPartyHelper(String parties, String party) {
+ if(parties.equals("")) {
+ return party;
+ }
+ return parties + " - " + party;
+ }
+
+
+}
View
5 BBSignup/src/bbsignup/src/Controller.java
@@ -28,8 +28,7 @@
private static final String SMTP_ACCOUNT_USER = Resource.get("user");
private static final String SMTP_ACCOUNT_PASS = Resource.get("pass");
- public String WEBLINK = "http://billbuzz.nysenate.gov:8080/BBSignup";
-// public String WEBLINK = "http://67.202.32.219:8080/BBSignup/";
+ public String WEBLINK = "http://billbuzz.nysenate.gov/";
public static void main(String[] args) throws IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
@@ -129,7 +128,7 @@ public String tryDelete(String email) {
public boolean deleteUser(String email, String key) {
UserAuth ua = getUserAuth(email);
- if(ua.isHashCorrect(key)) {
+ if(ua != null && ua.getHash() != null && ua.isHashCorrect(key)) {
PMF.deleteObjects(new Class[] {User.class,UserAuth.class},
new String[] {"email","email"},
new String[] {email,email});
View
24 BBSignup/src/collect/NYSenateServices.java
@@ -158,14 +158,12 @@ else if(party.matches("C")) {
public static HashMap<String,String> getOpenLegSenators() throws IOException {
HashMap<String,String> ret = new HashMap<String,String>();
- URL url = new URL("http://open.nysenate.gov/legislation/senators/");
+ URL url = new URL("http://open.nysenate.gov/legislation/senators");
BufferedReader br = new BufferedReader(new InputStreamReader(url.openStream()));
-
- Pattern lineP = Pattern.compile("<div class=\"views-field-field-senators-district-nid\">");
+
Pattern districtP = Pattern.compile("District (\\d+)");
- Pattern nameP = Pattern.compile("/legislation/sponsor/([\\w\\s]+)");
+ Pattern nameP = Pattern.compile("/sponsor/(.+?)\\?filter");
- Matcher lineM = null;
Matcher districtM = null;
Matcher nameM = null;
@@ -174,23 +172,15 @@ else if(party.matches("C")) {
while((in = br.readLine()) != null) {
String d = null, n = null;
- lineM = lineP.matcher(in);
+ districtM = districtP.matcher(in);
- if(lineM.find()) {
+ if(districtM.find()) {
+ d = districtM.group(1);
in = br.readLine();
-
- districtM = districtP.matcher(in);
+
nameM = nameP.matcher(in);
- if(districtM.find()) {
- d = districtM.group(1);
-
- if(districtM.group(1).equals("6")) {
- n = "hannon";
- }
- }
-
if(nameM.find()) {
n = nameM.group(1);
}
Please sign in to comment.
Something went wrong with that request. Please try again.