Revision: 8095
Author:
ri...@google.com
Date: Tue May 11 10:56:00 2010
Log: Data generation stuff
Change Expense/ExpenserRecord 'date' field to 'created'
http://code.google.com/p/google-web-toolkit/source/detail?r=8095
Modified:
/branches/2.1/bikeshed/src/com/google/gwt/sample/expenses/gwt/LoadExpensesDB.gwt.xml
/branches/2.1/bikeshed/src/com/google/gwt/sample/expenses/gwt/client/DataGenerationService.java
/branches/2.1/bikeshed/src/com/google/gwt/sample/expenses/gwt/client/DataGenerationServiceAsync.java
/branches/2.1/bikeshed/src/com/google/gwt/sample/expenses/gwt/client/ExpenseDetails.java
/branches/2.1/bikeshed/src/com/google/gwt/sample/expenses/gwt/client/LoadExpensesDB.java
/branches/2.1/bikeshed/src/com/google/gwt/sample/expenses/gwt/client/MobileExpenseDetails.java
/branches/2.1/bikeshed/src/com/google/gwt/sample/expenses/gwt/client/MobileExpenseEntry.java
/branches/2.1/bikeshed/src/com/google/gwt/sample/expenses/gwt/request/ExpenseRecord.java
/branches/2.1/bikeshed/src/com/google/gwt/sample/expenses/gwt/server/DataGenerationServiceImpl.java
/branches/2.1/bikeshed/src/com/google/gwt/sample/expenses/server/DataGenerator.java
/branches/2.1/bikeshed/src/com/google/gwt/sample/expenses/server/domain/Expense.java
/branches/2.1/bikeshed/war/WEB-INF/web.xml
=======================================
---
/branches/2.1/bikeshed/src/com/google/gwt/sample/expenses/gwt/LoadExpensesDB.gwt.xml
Mon May 10 17:46:25 2010
+++
/branches/2.1/bikeshed/src/com/google/gwt/sample/expenses/gwt/LoadExpensesDB.gwt.xml
Tue May 11 10:56:00 2010
@@ -4,6 +4,6 @@
<inherits name="com.google.gwt.user.User" />
<inherits name="com.google.gwt.user.theme.standard.Standard" />
- <inherits name="com.google.gwt.sample.expenses.gwt.Expenses" />
+ <inherits name="com.google.gwt.sample.expenses.gwt.ExpensesCommon" />
<entry-point
class="com.google.gwt.sample.expenses.gwt.client.LoadExpensesDB" />
</module>
=======================================
---
/branches/2.1/bikeshed/src/com/google/gwt/sample/expenses/gwt/client/DataGenerationService.java
Mon May 10 17:46:25 2010
+++
/branches/2.1/bikeshed/src/com/google/gwt/sample/expenses/gwt/client/DataGenerationService.java
Tue May 11 10:56:00 2010
@@ -23,11 +23,18 @@
*/
@RemoteServiceRelativePath("dataGeneration")
public interface DataGenerationService extends RemoteService {
- int getNumReports();
/**
- * Generate reports for approximately the given number of milliseconds
+ * Delete the entire datastore.
+ */
+ void delete();
+
+ /**
+ * Generate reports for approximately the given number of milliseconds.
+ *
* @return the number of reports in the data store following generation
*/
int generate(int millis);
-}
+
+ int getNumReports();
+}
=======================================
---
/branches/2.1/bikeshed/src/com/google/gwt/sample/expenses/gwt/client/DataGenerationServiceAsync.java
Mon May 10 17:46:25 2010
+++
/branches/2.1/bikeshed/src/com/google/gwt/sample/expenses/gwt/client/DataGenerationServiceAsync.java
Tue May 11 10:56:00 2010
@@ -21,6 +21,7 @@
* Async counterpart of {@link DataGenerationService}.
*/
public interface DataGenerationServiceAsync {
- void getNumReports(AsyncCallback<Integer> callback);
+ void delete(AsyncCallback<Void> callback);
void generate(int millis, AsyncCallback<Integer> callback);
-}
+ void getNumReports(AsyncCallback<Integer> callback);
+}
=======================================
---
/branches/2.1/bikeshed/src/com/google/gwt/sample/expenses/gwt/client/ExpenseDetails.java
Tue May 11 09:34:32 2010
+++
/branches/2.1/bikeshed/src/com/google/gwt/sample/expenses/gwt/client/ExpenseDetails.java
Tue May 11 10:56:00 2010
@@ -325,9 +325,9 @@
TableStyle cellTableStyle();
}
- private static final GetValue<ExpenseRecord, Date> dateGetter = new
GetValue<ExpenseRecord, Date>() {
+ private static final GetValue<ExpenseRecord, Date> createdGetter = new
GetValue<ExpenseRecord, Date>() {
public Date getValue(ExpenseRecord object) {
- return object.getDate();
+ return object.getCreated();
}
};
@@ -371,7 +371,7 @@
private List<SortableHeader> allHeaders = new
ArrayList<SortableHeader>();
private SortableColumn<ExpenseRecord, String> approvalColumn;
- private SortableColumn<ExpenseRecord, Date> dateColumn;
+ private SortableColumn<ExpenseRecord, Date> createdColumn;
/**
* The popup used to display errors to the user.
@@ -511,7 +511,7 @@
reportsLink.setText(ExpenseList.getBreadcrumb(department, employee));
// Reset sorting state of table
- lastComparator = dateColumn.getComparator(false);
+ lastComparator = createdColumn.getComparator(false);
for (SortableHeader header : allHeaders) {
header.setSorted(false);
header.setReverseSort(true);
@@ -544,10 +544,10 @@
}
});
- // Date column.
- dateColumn = addColumn(view, "Date", new DateCell(
- DateTimeFormat.getFormat("MMM dd yyyy")), dateGetter);
- lastComparator = dateColumn.getComparator(false);
+ // Created column.
+ createdColumn = addColumn(view, "Created", new DateCell(
+ DateTimeFormat.getFormat("MMM dd yyyy")), createdGetter);
+ lastComparator = createdColumn.getComparator(false);
// Description column.
addColumn(view, "Description", new GetValue<ExpenseRecord, String>() {
@@ -717,7 +717,7 @@
columns.add(ExpenseRecord.amount);
columns.add(ExpenseRecord.approval);
columns.add(ExpenseRecord.category);
- columns.add(ExpenseRecord.date);
+ columns.add(ExpenseRecord.created);
columns.add(ExpenseRecord.description);
columns.add(ExpenseRecord.reasonDenied);
return columns;
=======================================
---
/branches/2.1/bikeshed/src/com/google/gwt/sample/expenses/gwt/client/LoadExpensesDB.java
Mon May 10 17:46:25 2010
+++
/branches/2.1/bikeshed/src/com/google/gwt/sample/expenses/gwt/client/LoadExpensesDB.java
Tue May 11 10:56:00 2010
@@ -23,6 +23,7 @@
import com.google.gwt.user.client.ui.Button;
import com.google.gwt.user.client.ui.Label;
import com.google.gwt.user.client.ui.RootPanel;
+import com.google.gwt.user.client.ui.TextBox;
/**
* Entry point to create database entries for the Expenses app.
@@ -33,21 +34,34 @@
private Label generateLabel;
private Button generateButton;
+ private Button deleteButton;
+ private TextBox amountTextBox;
public void onModuleLoad() {
generateLabel = new Label("-- Expense Reports");
generateButton = new Button("Generate Data");
-
- generateButton.addClickHandler(new ClickHandler() {
+ deleteButton = new Button("Delete everything");
+ amountTextBox = new TextBox();
+
+ generateButton.addClickHandler(new ClickHandler() {
public void onClick(ClickEvent event) {
- generateData();
+ generateButton.setEnabled(false);
+ generateData(Integer.parseInt(amountTextBox.getText()));
}
});
+ deleteButton.addClickHandler(new ClickHandler() {
+ public void onClick(ClickEvent event) {
+ deleteData();
+ }
+ });
+
RootPanel root = RootPanel.get();
root.add(generateButton);
+ root.add(amountTextBox);
root.add(generateLabel);
-
+ // root.add(deleteButton);
+
dataService.getNumReports(new AsyncCallback<Integer>() {
public void onFailure(Throwable caught) {
}
@@ -57,15 +71,29 @@
}
});
}
-
- private void generateData() {
- dataService.generate(5000, new AsyncCallback<Integer>() {
+
+ private void deleteData() {
+ dataService.delete(new AsyncCallback<Void>() {
public void onFailure(Throwable caught) {
- throw new RuntimeException("Data generation failed");
+ generateLabel.setText("Deletion failed");
+ }
+
+ public void onSuccess(Void result) {
+ generateLabel.setText("Deletion succeeded");
+ }
+ });
+ }
+
+ private void generateData(int amount) {
+ dataService.generate(amount, new AsyncCallback<Integer>() {
+ public void onFailure(Throwable caught) {
+ generateButton.setEnabled(true);
+ generateLabel.setText("Data generation failed");
}
public void onSuccess(Integer result) {
generateLabel.setText("" + result + " Expense Reports");
+ generateButton.setEnabled(true);
}
});
}
=======================================
---
/branches/2.1/bikeshed/src/com/google/gwt/sample/expenses/gwt/client/MobileExpenseDetails.java
Mon May 10 10:53:16 2010
+++
/branches/2.1/bikeshed/src/com/google/gwt/sample/expenses/gwt/client/MobileExpenseDetails.java
Tue May 11 10:56:00 2010
@@ -117,7 +117,7 @@
DateTimeFormat formatter = DateTimeFormat.getMediumDateFormat();
nameText.setInnerText(expense.getDescription());
- dateText.setInnerText(formatter.format(expense.getDate()));
+ dateText.setInnerText(formatter.format(expense.getCreated()));
categoryText.setInnerText(expense.getCategory());
priceText.setInnerText(ExpensesMobile.formatCurrency(expense.getAmount().intValue()));
}
=======================================
---
/branches/2.1/bikeshed/src/com/google/gwt/sample/expenses/gwt/client/MobileExpenseEntry.java
Tue May 11 07:01:15 2010
+++
/branches/2.1/bikeshed/src/com/google/gwt/sample/expenses/gwt/client/MobileExpenseEntry.java
Tue May 11 10:56:00 2010
@@ -113,7 +113,7 @@
dateMonth.getSelectedIndex(),
dateDay.getSelectedIndex() + 1
);
- deltas.set(ExpenseRecord.date, expense, date);
+ deltas.set(ExpenseRecord.created, expense, date);
// TODO: wait throbber
requestFactory.syncRequest(deltas).to(
@@ -148,7 +148,7 @@
priceText.setText(ExpensesMobile.formatCurrency(expense.getAmount().intValue()));
// TODO(jgw): Use non-deprecated date methods for this.
- Date d = expense.getDate();
+ Date d = expense.getCreated();
dateYear.setSelectedIndex(d.getYear() - 100);
dateMonth.setSelectedIndex(d.getMonth());
dateDay.setSelectedIndex(d.getDate() - 1);
=======================================
---
/branches/2.1/bikeshed/src/com/google/gwt/sample/expenses/gwt/request/ExpenseRecord.java
Tue May 4 15:09:04 2010
+++
/branches/2.1/bikeshed/src/com/google/gwt/sample/expenses/gwt/request/ExpenseRecord.java
Tue May 11 10:56:00 2010
@@ -39,7 +39,7 @@
Property<Double> amount = new Property<Double>("amount", Double.class);
Property<String> approval = new Property<String>("approval",
String.class);
Property<String> category = new Property<String>("category",
String.class);
- Property<Date> date = new Property<Date>("date", Date.class);
+ Property<Date> created = new Property<Date>("created", Date.class);
Property<String> description = new Property<String>("description",
String.class);
Property<String> reasonDenied = new Property<String>("reasonDenied",
String.class);
Property<String> reportId = new Property<String>("reportId",
String.class);
@@ -50,7 +50,7 @@
String getCategory();
- Date getDate();
+ Date getCreated();
String getDescription();
=======================================
---
/branches/2.1/bikeshed/src/com/google/gwt/sample/expenses/gwt/server/DataGenerationServiceImpl.java
Mon May 10 17:46:25 2010
+++
/branches/2.1/bikeshed/src/com/google/gwt/sample/expenses/gwt/server/DataGenerationServiceImpl.java
Tue May 11 10:56:00 2010
@@ -30,158 +30,144 @@
import java.util.Date;
import java.util.List;
import java.util.Random;
+import java.util.logging.Logger;
/**
* Server-side implementation.
*/
-public class DataGenerationServiceImpl extends RemoteServiceServlet
implements DataGenerationService {
+public class DataGenerationServiceImpl extends RemoteServiceServlet
implements
+ DataGenerationService {
private static final double AIRFARE = 600;
-
+
private static final double BREAKFAST = 15;
// Must be in sync with DESCRIPTIONS
- private static final String[] CATEGORIES = {
+ private static String[] CATEGORIES = {
"Local Transportation", "Local Transportation", "Local
Transportation",
- "Office Supplies", "Office Supplies", "Office Supplies", "Office
Supplies",
- "Office Supplies", "Office Supplies", "Office Supplies", "Office
Supplies",
- "Dues and Fees", "Dues and Fees", "Dues and Fees",
- "Books", "Books", "Books", "Books"
- };
+ "Local Transportation", "Local Transportation", "Local
Transportation",
+ "Local Transportation", "Local Transportation", "Local
Transportation",
+ "Long Distance Transportation", "Long Distance Transportation",
+ "Long Distance Transportation", "Long Distance Transportation",
+ "Office Supplies", "Office Supplies", "Office Supplies",
+ "Office Supplies", "Office Supplies", "Office Supplies",
+ "Office Supplies", "Office Supplies", "Office Supplies",
+ "Office Supplies", "Office Supplies", "Office Supplies",
+ "Office Supplies", "Office Supplies", "Office Supplies",
+ "Office Supplies", "Office Supplies", "Office Supplies",
+ "Office Supplies", "Electronic Equipment", "Electronic Equipment",
+ "Electronic Equipment", "Electronic Equipment", "Electronic
Equipment",
+ "Electronic Equipment", "Electronic Equipment", "Electronic
Equipment",
+ "Electronic Equipment", "Electronic Equipment", "Electronic
Equipment",
+ "Electronic Equipment", "Electronic Equipment", "Electronic
Equipment",
+ "Electronic Equipment", "Electronic Equipment", "Electronic
Equipment",
+ "Electronic Equipment", "Electronic Equipment", "Dues and Fees",
+ "Dues and Fees", "Dues and Fees", "Dues and Fees", "Dues and Fees",
+ "Dues and Fees", "Dues and Fees", "Dues and Fees", "Communications",
+ "Communications", "Communications", "Communications", "Communications",
+ "Communications", "Books", "Books", "Books", "Books", "Books", "Books",
+ "Books", "Books", "Books", "Books", "Books", "Books", "Books", "Books",
+ "Books", "Books", "Books", "Books", "Books", "Books", "Facilities",
+ "Facilities", "Facilities", "Facilities", "Facilities", "Facilities",
+ "Facilities", "Facilities", "Facilities", "Facilities", "Facilities",
+ "Facilities", "Food Service", "Food Service", "Food Service",
+ "Food Service", "Food Service", "Food Service", "Food Service",
+ "Food Service", "Food Service", "Food Service", "Food Service",
+ "Marketing", "Marketing", "Marketing", "Marketing", "Marketing",
+ "Human Relations", "Human Relations", "Human Relations",
+ "Human Relations", "Meals", "Meals", "Meals", "Lodging", "Lodging",
+ "Lodging", "Lodging", "Lodging"};
private static final String[] CITIES = {
- "New York, New York",
- "Los Angeles, California",
- "Chicago, Illinois",
- "Houston, Texas",
- "Phoenix, Arizona",
- "Philadelphia, Pennsylvania",
- "San Antonio, Texas",
- "San Diego, California",
- "Dallas, Texas",
- "Detroit, Michigan",
- "San Jose, California",
- "Indianapolis, Indiana",
- "Jacksonville, Florida",
- "San Francisco, California",
- "Hempstead, New York",
- "Columbus, Ohio",
- "Austin, Texas",
- "Memphis, Tennessee",
- "Baltimore, Maryland",
- "Charlotte, North Carolina",
- "Fort Worth, Texas",
- "Milwaukee, Wisconsin",
- "Boston, Massachusetts",
- "El Paso, Texas",
- "Washington, District of Columbia",
- "Nashville-Davidson, Tennessee",
- "Seattle, Washington",
- "Denver, Colorado",
- "Las Vegas, Nevada",
- "Portland, Oregon",
- "Oklahoma City, Oklahoma",
- "Tucson, Arizona",
- "Albuquerque, New Mexico",
- "Atlanta, Georgia",
- "Long Beach, California",
- "Brookhaven, New York",
- "Fresno, California",
- "New Orleans, Louisiana",
- "Sacramento, California",
- "Cleveland, Ohio",
- "Mesa, Arizona",
- "Kansas City, Missouri",
- "Virginia Beach, Virginia",
- "Omaha, Nebraska",
- "Oakland, California",
- "Miami, Florida",
- "Tulsa, Oklahoma",
- "Honolulu, Hawaii",
- "Minneapolis, Minnesota",
- "Colorado Springs, Colorado",
- "Arlington, Texas",
- "Wichita, Kansas",
- "St. Louis, Missouri",
- "Raleigh, North Carolina",
- "Santa Ana, California",
- "Anaheim, California",
- "Cincinnati, Ohio",
- "Tampa, Florida",
- "Islip, New York",
- "Pittsburgh, Pennsylvania",
- "Toledo, Ohio",
- "Aurora, Colorado",
- "Oyster Bay, New York",
- "Bakersfield, California",
- "Riverside, California",
- "Stockton, California",
- "Corpus Christi, Texas",
- "Buffalo, New York",
- "Newark, New Jersey",
- "St. Paul, Minnesota",
- "Anchorage, Alaska",
- "Lexington-Fayette, Kentucky",
- "Plano, Texas",
- "St. Petersburg, Florida",
- "Fort Wayne, Indiana",
- "Glendale, Arizona",
- "Lincoln, Nebraska",
- "Jersey City, New Jersey",
- "Greensboro, North Carolina",
- "Norfolk, Virginia",
- "Chandler, Arizona",
- "Henderson, Nevada",
- "Birmingham, Alabama",
- "Scottsdale, Arizona",
- "Madison, Wisconsin",
- "Baton Rouge, Louisiana",
- "North Hempstead, New York",
- "Hialeah, Florida",
- "Chesapeake, Virginia",
- "Garland, Texas",
- "Orlando, Florida",
- "Babylon, New York",
- "Lubbock, Texas",
- "Chula Vista, California",
- "Akron, Ohio",
- "Rochester, New York",
- "Winston-Salem, North Carolina",
- "Durham, North Carolina",
- "Reno, Nevada",
- "Laredo, Texas"
- };
-
- private static final String[] DEPARTMENTS =
{ "Operations", "Engineering", "Finance", "Marketing", "Sales" };
-
+ "New York, New York", "Los Angeles, California", "Chicago, Illinois",
+ "Houston, Texas", "Phoenix, Arizona", "Philadelphia, Pennsylvania",
+ "San Antonio, Texas", "San Diego, California", "Dallas, Texas",
+ "Detroit, Michigan", "San Jose, California", "Indianapolis, Indiana",
+ "Jacksonville, Florida", "San Francisco, California",
+ "Hempstead, New York", "Columbus, Ohio", "Austin, Texas",
+ "Memphis, Tennessee", "Baltimore, Maryland", "Charlotte, North
Carolina",
+ "Fort Worth, Texas", "Milwaukee, Wisconsin", "Boston, Massachusetts",
+ "El Paso, Texas", "Washington, District of Columbia",
+ "Nashville-Davidson, Tennessee", "Seattle, Washington",
+ "Denver, Colorado", "Las Vegas, Nevada", "Portland, Oregon",
+ "Oklahoma City, Oklahoma", "Tucson, Arizona", "Albuquerque, New
Mexico",
+ "Atlanta, Georgia", "Long Beach, California", "Brookhaven, New York",
+ "Fresno, California", "New Orleans, Louisiana", "Sacramento,
California",
+ "Cleveland, Ohio", "Mesa, Arizona", "Kansas City, Missouri",
+ "Virginia Beach, Virginia", "Omaha, Nebraska", "Oakland, California",
+ "Miami, Florida", "Tulsa, Oklahoma", "Honolulu, Hawaii",
+ "Minneapolis, Minnesota", "Colorado Springs, Colorado",
+ "Arlington, Texas", "Wichita, Kansas", "St. Louis, Missouri",
+ "Raleigh, North Carolina", "Santa Ana, California",
+ "Anaheim, California", "Cincinnati, Ohio", "Tampa, Florida",
+ "Islip, New York", "Pittsburgh, Pennsylvania", "Toledo, Ohio",
+ "Aurora, Colorado", "Oyster Bay, New York", "Bakersfield,
California",
+ "Riverside, California", "Stockton, California", "Corpus Christi,
Texas",
+ "Buffalo, New York", "Newark, New Jersey", "St. Paul, Minnesota",
+ "Anchorage, Alaska", "Lexington-Fayette, Kentucky", "Plano, Texas",
+ "St. Petersburg, Florida", "Fort Wayne, Indiana", "Glendale,
Arizona",
+ "Lincoln, Nebraska", "Jersey City, New Jersey",
+ "Greensboro, North Carolina", "Norfolk, Virginia", "Chandler,
Arizona",
+ "Henderson, Nevada", "Birmingham, Alabama", "Scottsdale, Arizona",
+ "Madison, Wisconsin", "Baton Rouge, Louisiana",
+ "North Hempstead, New York", "Hialeah, Florida", "Chesapeake,
Virginia",
+ "Garland, Texas", "Orlando, Florida", "Babylon, New York",
+ "Lubbock, Texas", "Chula Vista, California", "Akron, Ohio",
+ "Rochester, New York", "Winston-Salem, North Carolina",
+ "Durham, North Carolina", "Reno, Nevada", "Laredo, Texas"};
+
+ private static final String[] DEPARTMENTS = {
+ "Operations", "Engineering", "Finance", "Marketing", "Sales"};
+
// Must be in sync with CATEGORIES
- private static final String[] DESCRIPTIONS = {
- "Train fare", "Taxi fare", "Bus ticket",
- "Paperclips", "Stapler", "Scissors", "Paste",
- "Notebooks", "Pencils", "Whiteboard Markers", "Tissues",
- "ACM Membership", "IEEE Membership", "Google I/O Ticket",
- "Book on AJAX", "Book on Python", "Book on JavaScript", "Book on C++"
- };
-
+ private static String[] DESCRIPTIONS = {
+ "Train Fare", "Taxi Fare", "Monorail", "Water Taxi", "Bus Fare",
+ "Bicycle Rental", "Car Rental", "Limousine Service", "Helicopter",
+ "Airplane Ticket", "Bus Ticket", "Train Ticket", "Car Rental",
+ "Paperclips", "Stapler", "Scissors", "Paste", "Notebooks", "Pencils",
+ "Whiteboard Markers", "Tissues", "Pens", "Copier Paper", "Legal Pad",
+ "Rubber Bands", "Binder Clips", "Scotch Tape", "Masking Tape",
+ "Tape Dispenser", "Highlighter", "Staples", "File
Folders", "Headphones",
+ "Workstation", "Laptop", "USB Cable", "Electronic Plunger",
+ "Serial Cable", "KVM", "Video Cable", "Docking Station", "Headset",
+ "Speakers", "Keyboard", "Mouse", "UPS", "Hard Drive", "CD-ROM Drive",
+ "Power Cord", "Extension Cord", "Surge Protector", "ACM Membership",
+ "IEEE Membership", "Google I/O Ticket", "Parking Ticket",
+ "Other Professional Association", "Conference Fee", "Trade Show Fee",
+ "Bank Fee", "Telephone", "Internet", "Mobile", "Phone Card",
+ "Satellite Phone", "Cable TV", "AJAX", "Java", "C++", "C#", "Python",
+ "Google Go", "Perl", "Visual Basic", "Software
Engineering", "Windows",
+ "UNIX", "Linux", "Apple", "Android", "iPhone", "Blackberry", "Mobile",
+ "Software Design", "Marketing", "Management", "Toilet Paper",
+ "Paper Towels", "Cleaning Supplies", "Cleaning
Contractor", "Repairs",
+ "Updates", "Exterminator", "Plant Care", "Decoration", "Furniture ",
+ "Reading Material", "Trash Bags", "Coffee Cups", "Coffee Stirrers",
+ "Coffee Lids", "Condiments", "Coffee Maker Supplies",
+ "Coffee Maker Maintenance", "Coffee Beans", "Tea", "Bottled Drinks",
+ "Snacks", "Straws", "Flyers", "Posters", "Booth", "Meeting
Expenses",
+ "Design Consultant", "Candidate Travel", "Recruiting Expenses",
+ "Outreach", "Training", "Self", "Co-Workers", "Customers", "Hotel",
+ "Motel ", "Holiday Inn", "Private Apartment", "Corporate Apartment"};
+
private static final double DINNER = 60;
-
+
// 11% of females hyphenate their last names
private static final double FEMALE_HYPHENATE = 0.11;
-
+
private static List<Double> femaleNameFreqs = new ArrayList<Double>();
-
+
private static List<String> femaleNames = new ArrayList<String>();
-
+
private static final double HOTEL = 300;
- private static boolean initialized = false;
-
private static final DataGenerationServiceImpl instance = new
DataGenerationServiceImpl();
private static List<Double> lastNameFreqs = new ArrayList<Double>();
private static List<String> lastNames = new ArrayList<String>();
+ private static final Logger log =
Logger.getLogger(DataGenerationServiceImpl.class.getName());
+
private static final double LUNCH = 25;
// 2% of males hyphenate their last names
@@ -190,78 +176,1322 @@
private static List<Double> maleNameFreqs = new ArrayList<Double>();
private static List<String> maleNames = new ArrayList<String>();
-
- // 10% of employees are managers
- private static final double MANAGER = 0.10;
-
- // managers can have up to 20 direct reports
- private static final int MAX_DIRECTS = 20;
-
+
private static final long MILLIS_PER_DAY = 24L * 60L * 60L * 1000L;
-
+
+ private static final long MILLIS_PER_HOUR = 60L * 60L * 1000L;
+
private static final String[] NOTES = {
// Some entries do not have notes.
"", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "",
- "Need approval by Monday", "Show me the money",
- "Please bill to the Widgets project", "High priority", "Review
A.S.A.P."};
-
+ "Need approval by Monday", "Bill to widgets project", "High
priority",
+ "Review A.S.A.P."};
+
private static final String[] PURPOSES = {
- "Spending lots of money", "Team building diamond cutting offsite",
- "Visit to Istanbul", "ISDN modem for telecommuting", "Sushi offsite",
- "Baseball card research", "Potato chip cooking offsite",
- "Money laundering", "Donut day"};
+ "Spending lots of money",
+ "Team building diamond cutting offsite",
+ "Visit to Istanbul",
+ "ISDN modem for telecommuting",
+ "Sushi offsite",
+ "Baseball card research",
+ "Potato chip cooking offsite",
+ "Money laundering",
+ "Donut day",
+ "APPROVED BY Amy Mobley",
+ "For Michael Neal",
+ "Customer meeting with Maureen Rosado",
+ "See Tommy Perry",
+ "Approved by George Hamilton",
+ "Discussed with Sandra Simpson",
+ "Approved by James Mills",
+ "Cheryl Munoz",
+ "Approved Earl Butler",
+ "approved John Gutierrez",
+ "Discussed with Celeste Baker",
+ "ran by Daryl Kent",
+ "Mary Jensen",
+ "with Mary Hicks",
+ "with Casey Clay",
+ "With Lillian Dennis",
+ "customer meeting with Joshua Cobb",
+ "Asked Joseph Ray",
+ "approved Olivia Torres",
+ "meeting with Viola Boggs",
+ "Ran by Kelly Hopkins",
+ "Paul Lee",
+ "For Otto Vasquez",
+ "met with Steven Price",
+ "met with Beulah Brown",
+ "CUSTOMER MEETING WITH Cameron Bishop",
+ "approved Joe Dawson",
+ "approved Tonya Hamm",
+ "for Evelyn Warren",
+ "w/ Elaine Martinez",
+ "meeting with Stephanie Gonzales",
+ "Approved by Christopher Thompson",
+ "Caroline Vazquez",
+ "With Justin Davis",
+ "Approved by Angelica Irwin",
+ "customer meeting with Clarence Macias",
+ "ran by Terry King",
+ "customer meeting with Frederick Carroll",
+ "lunch with Catherine Nelson",
+ "see Todd Dejesus",
+ "Aida Deleon",
+ "with Mike Jenkins",
+ "Approved by Celia Dennis",
+ "w/ Linda Cox",
+ "Ran by Bobbie Park",
+ "met with Teresa Wiley",
+ "Lunch with Barbara Cordova",
+ "Meeting with Carol Gonzales",
+ "meeting with Irene Perry",
+ "Approved by Kimberly Johnson",
+ "FOR Barbara Martin",
+ "lunch with Gregg Williams",
+ "Approved by Kevin Griggs",
+ "ran by Ruben Kelley",
+ "For Kenneth Thompson",
+ "asked Julia Ferguson",
+ "For Kristina Anderson",
+ "Fred Graham",
+ "For Sean Banks",
+ "meeting with Don Nichols",
+ "meeting with Antonio Howard",
+ "see Walter Wiggins",
+ "ran by Amy Marshall",
+ "with Beverly Pace",
+ "w/ Stacy Roy",
+ "meeting with Thomas Williams",
+ "customer meeting with Belinda Nelson",
+ "with Pierre Price",
+ "See Hilda Vaughn",
+ "met with Kara Rogers",
+ "For Frances Morris",
+ "customer meeting with George Dalton",
+ "meeting with Lindsey Webb",
+ "meeting with Theresa Dunlap",
+ "See Stephanie Benson",
+ "W/ John Pope",
+ "Approved by Alejandro Harris",
+ "asked James Lopez",
+ "customer meeting with Dorothy Colon",
+ "customer meeting with Tracy Norman",
+ "Lunch with Kelly Benton",
+ "Approved by Edmund Ortiz",
+ "Met with Joel Martinez",
+ "See James Hendricks",
+ "lunch with Tonya Brown",
+ "approved by Sarah Newman",
+ "meeting with Bonnie Petersen",
+ "discussed with John Wagner",
+ "approved by Mark Salinas",
+ "customer meeting with Jack Duran",
+ "Approved by Sherry Rojas",
+ "w/ Mary Decker",
+ "See Theresa Griggs",
+ "with Robert Humphrey",
+ "approved by Jay Lawson",
+ "for Mark Bell",
+ "ran by Darrell Wheeler",
+ "With Judy Fields",
+ "Discussed with William Nelson",
+ "Approved by Natalie Mcclain",
+ "W/ Angel Manley",
+ "Asked Barbara Martin",
+ "James Andrade",
+ "w/ James Norris",
+ "discussed with Richard Bowman",
+ "For Alfred Ruiz",
+ "For Bobby Johnson",
+ "w/ Daniel Price",
+ "ran by Gail Rogers",
+ "meeting with Jeffrey Beck",
+ "lunch with James Roman",
+ "for Brian Dickerson",
+ "Charles Wong",
+ "Louis Morrison",
+ "met with Edgar Lopez",
+ "asked Steven Martinez",
+ "customer meeting with Felicia Salazar",
+ "ran by Marie Brown",
+ "w/ Steve Curry",
+ "ran by Leslie Dorsey",
+ "Approved by Martha Edwards",
+ "met with David Moran",
+ "lunch with Larry Lynch",
+ "see Douglas Mcclain",
+ "approved by Howard Wells",
+ "W/ Franklin Adams",
+ "approved by Jennifer Hernandez",
+ "approved Katherine Krueger",
+ "Approved by Linda Taylor",
+ "See Jean Miller",
+ "Lunch with Janet White",
+ "with Michelle Vasquez",
+ "meeting with Edward Clarke",
+ "with Micheal Collier",
+ "ran by Dolores Gonzalez",
+ "For William Hubbard",
+ "for Scott Mitchell",
+ "discussed with John Murray",
+ "with Charles Jones",
+ "See Vicki Boucher",
+ "Approved by Vincent Lewis",
+ "discussed with Charles Minor",
+ "For Terry Lawrence",
+ "For Betty Armstrong",
+ "James Gaines",
+ "Meeting with Mary Anthony",
+ "See James Crowley",
+ "w/ Gloria Herrera",
+ "Met with Scott Clemons",
+ "discussed with Mary Smith",
+ "SEE Mary King",
+ "For Leroy Brandon",
+ "discussed with Gloria Hinton",
+ "approved Teresa Thompson",
+ "discussed with Elizabeth Johnson",
+ "See Jose Ibarra",
+ "approved by Mary Reese",
+ "asked Donna Barnett",
+ "ran by Billy Finch",
+ "w/ Nancy Hart",
+ "lunch with Martha Smith",
+ "See Mark Becker",
+ "with Ruben York",
+ "lunch with Jerome Palmer",
+ "for Melissa Yarbrough",
+ "William Powers",
+ "with James Fletcher",
+ "approved Edward Snyder",
+ "Yvonne Harris",
+ "Lunch with Ramon Smith",
+ "discussed with Anthony Meadows",
+ "For Nancy Taylor",
+ "w/ David Hartman",
+ "approved Ida Jackson",
+ "See Chris Blackwell",
+ "APPROVED BY Raymond Mueller",
+ "Approved by James Shaw",
+ "Ran by Mark Garcia",
+ "discussed with Linda Rojas",
+ "approved Debbie Little",
+ "discussed with John Jones",
+ "For Krista Benson",
+ "For Felicia Davidson",
+ "Lawrence Davis",
+ "Vicky Anderson",
+ "W/ Sheri Cooper",
+ "w/ Andrea King",
+ "lunch with Dennis Wright",
+ "Asked Jeremy Fowler",
+ "w/ Leslie Graves",
+ "lunch with Justin Davis",
+ "See Arthur Finley",
+ "For Michael Matthews",
+ "See Adam Rodriguez",
+ "approved Joy Childs",
+ "approved Carlos Holt",
+ "lunch with Michael Tracy",
+ "customer meeting with Amanda Campbell",
+ "See Thomas Oliver",
+ "customer meeting with Emily Thompson",
+ "SEE Tony West",
+ "Discussed with Edward Foley",
+ "approved by Emma Meyer",
+ "approved Brandy King",
+ "With Clifton Davis",
+ "met with Johnnie Patrick",
+ "met with Jessica Weber",
+ "asked Carolyn Johnson",
+ "approved Kim Warren",
+ "w/ Kimberly Foley",
+ "see Joseph Mcgee",
+ "Mario Taylor",
+ "met with Kenny Hampton",
+ "See Sarah Wilson",
+ "customer meeting with Autumn Anderson",
+ "See Rebecca Walker",
+ "lunch with Amber Lowe",
+ "discussed with Myrtle Crowley",
+ "approved by Doris Lawson",
+ "approved Wallace Goodman",
+ "customer meeting with Amy Reese",
+ "meeting with Frederick Carroll",
+ "discussed with Roosevelt Wright",
+ "see Jose Clark",
+ "see Erica Jones",
+ "LUNCH WITH Regina Munoz",
+ "Met with David Morrison",
+ "See Leona Adams",
+ "for Vicki Ward",
+ "for Ismael English",
+ "See Linda Nash",
+ "ran by Richard Best",
+ "with Glen Stewart",
+ "asked Gladys Henson",
+ "ran by Tricia Gardner",
+ "lunch with Dorothy Johnson",
+ "approved by Shirley Taylor",
+ "with Stacy Moody",
+ "For Edmond Williams",
+ "with Shaun Phillips",
+ "lunch with Janet Bowen",
+ "customer meeting with Sandra Anderson",
+ "Meeting with Douglas Hollis",
+ "with Mandy Warner",
+ "Approved by Mark Garcia",
+ "approved Betty Kirkland",
+ "ran by Vicki Thomas",
+ "with Georgia Mckinney",
+ "discussed with David Abbott",
+ "approved Chester Everett",
+ "DISCUSSED WITH Jane Harper",
+ "Meeting with Melvin Richardson",
+ "for Viola Roy",
+ "approved by Dean Peck",
+ "Approved by Paulette Rollins",
+ "meeting with Manuel Hale",
+ "For Kimberly White",
+ "discussed with Martha Nash",
+ "For Stacey Johnson",
+ "ran by Carol Gonzales",
+ "See Elaine Thomas",
+ "meeting with Josh Smith",
+ "customer meeting with Don Bender",
+ "Meeting with Ina Reed",
+ "For Keith Cobb",
+ "approved by Paul Rodgers",
+ "approved by Eleanor Ramirez",
+ "For Janice Cooper",
+ "asked William Tanner",
+ "Discussed with Minnie Blackburn",
+ "ran by Rose Clark",
+ "customer meeting with Brandon Marshall",
+ "approved David Jimenez",
+ "approved by Helen Ayers",
+ "W/ Eileen Martinez",
+ "FOR Benjamin Williams",
+ "Meeting with Sharon Mcdonald",
+ "meeting with Thomas Bowers",
+ "met with Marion Wilson",
+ "Lunch with Dennis Mitchell",
+ "Approved by Alejandro Wheeler",
+ "meeting with Viola Bradley",
+ "For Charles Blevins",
+ "approved Tammie Phillips",
+ "customer meeting with Norman Johnson",
+ "see Debbie Cox",
+ "Asked Joan Williams",
+ "See Rodney Branch",
+ "discussed with Michael Mayer",
+ "Approved by Kendall Taylor",
+ "approved David Rivera",
+ "with Joy Valentine",
+ "customer meeting with Edward Workman",
+ "for Rebecca Scott",
+ "asked Ivy White",
+ "with Glenda Peterson",
+ "Paul Smith",
+ "approved Antonio Curry",
+ "approved Leonard Knight",
+ "See Amy Banks",
+ "LUNCH WITH Emmanuel Morales and John Williams",
+ "customer meeting with Benjamin Lloyd and Jeffrey Prince",
+ "customer meeting with William Powers and Claude Wells",
+ "lunch with David Martin and Keith Campbell",
+ "customer meeting with Charles Mckay and Elizabeth Patterson",
+ "for Larry Soto and Felipe Smith",
+ "met with Carlos Gray and John Nelson",
+ "For Abby White and Debra Hunter",
+ "with Keith Davidson and George Becker",
+ "discussed with Thomas Adams and Betty Garcia",
+ "met with Juan Lee and Mary Johnson",
+ "For Raymond White and Carrie Hunt",
+ "lunch with Juanita Richardson and Rachel White",
+ "discussed with Samuel Wade and Martha Gomez",
+ "Approved by Dianna Gillespie and Elizabeth Gordon",
+ "For John Moody and Vicki Ward",
+ "approved Yvonne Pierce and Pearl Landry",
+ "For Darlene Bell and Steven Johnson",
+ "Jennifer Campbell and Michelle Reed",
+ "see Donald Kramer and Timothy Duke",
+ "see Cameron Hunt and Stacey Jackson",
+ "meeting with Eric Silva and Bruce Andrade",
+ "discussed with Robert Cannon and Ann Johnson",
+ "customer meeting with Leonard Horton and Mark Brady",
+ "approved Adam Noble and Jacquelyn Byrd",
+ "SEE Francis Cowan and Robert Flores",
+ "customer meeting with Doris Schmidt and Rodolfo Young",
+ "ran by John Warren and Laura Dixon",
+ "see Antonio Nelson and Sarah Floyd",
+ "approved by Frances Smith and Bryan Velazquez",
+ "Corinne Elmore and William Edwards",
+ "w/ Kelly Scott and Susan Gutierrez",
+ "Discussed with Dolores Hicks and Claudia Freeman",
+ "customer meeting with Addie Kennedy and Raymond Thompson",
+ "Asked Albert Kramer and Marie Brown",
+ "lunch with Charles Casey and Bette Knight",
+ "Met with Kathryn Mathews and William Thompson",
+ "with Ida Vega and Mike Miller",
+ "asked Melvin Edwards and Christopher Richardson",
+ "with Barbara Anderson and Joseph Oliver",
+ "Approved by Timothy Bacon and Dora Bonner",
+ "w/ Elizabeth Brooks and Jose Burt",
+ "Discussed with Rhonda Fritz and Clint Brown",
+ "w/ John Mitchell and Kara Rogers",
+ "with Carla Lowe and Lillie Hodges",
+ "lunch with Kathleen Strickland and Shaun Williams",
+ "For Bradley Todd and Kevin Jones",
+ "discussed with Patricia Ramirez and Trevor Fleming",
+ "With Margaret Reese and Doris Deleon",
+ "discussed with Belinda Roberts and Stanley Thomas",
+ "MEETING WITH Shanna Rogers and Judy Sanchez",
+ "Customer meeting with Veronica James and Lisa Brown",
+ "lunch with Wayne Ramsey and Joan Powell",
+ "Approved by Alan Thompson and Rose Goodman",
+ "Customer meeting with Arnold Dixon and Robert Jones",
+ "See Maryann Hastings and Carol Booth",
+ "Meeting with Carroll Daniel and Michael Gibbons",
+ "ran by Mary Thornton and Dustin Reed",
+ "for Jason Washington and Sara Brown",
+ "customer meeting with Angela Kirk and Clark Erickson",
+ "lunch with Louise King and Elizabeth Carroll",
+ "approved Jane Hernandez and Matthew Smith",
+ "Asked Patricia Smith and Julia Ferguson",
+ "asked Alice Thomas and Barry Perez",
+ "Approved by Marisa Lopez and Lee Holmes",
+ "approved Philip Lewis and Alice Nance",
+ "for Marvin Herron and Kenneth Flowers",
+ "See Frank Scott and Katherine Collier",
+ "approved Sean Finley and Ruth Hernandez",
+ "discussed with Bethany Bryant and Jaime Mooney",
+ "Customer meeting with Franklin Horton and Kevin Harris",
+ "met with Jack Roberts and James West",
+ "Asked Ann Smith and Beverly Davis",
+ "approved by Terry Gross and Eric Brown",
+ "met with Danny Pryor and Dan Rutledge",
+ "MET WITH Ernest Lawson and Alfred Velasquez",
+ "Discussed with Samuel Crawford and Michael White",
+ "w/ Maria Brown and Paul Smith",
+ "See Michelle Spencer and Barbara Johnson",
+ "For Margaret Jenkins and Pierre Harper",
+ "approved by George Mooney and Sean Olson",
+ "See Dan Thompson and Emma Starr",
+ "Approved by Ann Gomez and Caroline Wheeler",
+ "See James Thompson and Katherine Barton",
+ "approved Barry Nicholson and Thomas Haynes",
+ "ran by Curtis Fitzgerald and Steven Vargas",
+ "approved by Gary Jones and Felix Black",
+ "ran by Phil Thomas and Linda Dotson",
+ "Jeffery Merritt and Andrew Holt",
+ "for Pamela Curtis and Jasmine Coleman",
+ "w/ Roland Johnston and James York",
+ "asked Beverly Richards and Lisa Brown",
+ "ran by John Ellis and Beverly Sanders",
+ "Lunch with Marilyn Cox and Joyce Clay",
+ "w/ Joanne Rodriquez and Phillip Wilson",
+ "asked Darlene Bell and Rodney Branch",
+ "asked Gertrude Orr and Tamara Smith",
+ "approved James Guy and Cindy Harper",
+ "met with Brandy King and Brandon Roberts",
+ "Lillie Moore and Martin Jackson",
+ "DISCUSSED WITH Pamela Welch and Ron Atkins",
+ "for Carla Mccarthy and Richard Livingston",
+ "approved Jonathan Moore and Elizabeth Williams",
+ "with Shirley Anderson and Earl Butler",
+ "Meeting with Janet Long and Robert Boucher",
+ "W/ Debbie Brown and Jeff Collier",
+ "ran by Todd Welch and Tim Gonzalez",
+ "w/ James Cline and James Daniel",
+ "Customer meeting with Teresa Evans and Robert Humphrey",
+ "approved by Mark Cortez and Judy Russell",
+ "approved Michael Simpson and Angela Harvey",
+ "meeting with Helen Richardson and Andrea Barnett",
+ "Approved by Jasmine Rogers and Steven Serrano",
+ "customer meeting with Timothy Stephens and Willie Wallace",
+ "Gerardo Brown and Ronald Bryant",
+ "approved by Rocky Daniel and James Thomas",
+ "meeting with Barbara Ratliff and Dorothy Gallagher",
+ "Lunch with Aaron Little and Bobbie Ellis",
+ "customer meeting with Henry Peterson and Lora Adams",
+ "Approved by Thomas Haynes and Bessie Escobar",
+ "Alicia Mitchell and Anthony Bullock",
+ "Lunch with Katrina Holt and Robert Coleman",
+ "ran by Elisabeth Marshall and Michael Ferguson",
+ "asked Curtis Wilkins and Donald Lee",
+ "lunch with Stacy Lyon and Cheri Hughes",
+ "SEE Nathan Perez and Leah Hill",
+ "Approved by Rachelle Todd and Erica Jones",
+ "with Theresa Dunlap and Raymond Mueller",
+ "Approved by Kyle Fulton and Rebecca Young",
+ "Meeting with Debbie Brown and Elizabeth Johnson",
+ "w/ Shirley Castillo and Paul Cohen",
+ "W/ Pedro Gibson and Winifred Barber",
+ "For Marjorie Wilson and Mary Moreno",
+ "Lunch with Francisco Thomas and Roger King",
+ "ran by Linda Wang and Paul Smith",
+ "See Jan Burnett and Elaine Martinez",
+ "with Eugene Jones and Lorraine Flanagan",
+ "approved Steven George and Edgar Snyder",
+ "see Tim Mitchell and Tony Bruce",
+ "customer meeting with Roberto George and Lynn Edwards",
+ "with James Forbes and Maria Holley",
+ "meeting with Eva Thomas and Sharon Sanchez",
+ "Approved by Frank Potts and Sarah Cooper",
+ "See Elizabeth Boone and Harold Davis",
+ "Approved by Hector Cross and Ray Turner",
+ "w/ Rachel White and Lorraine Briggs",
+ "For Catherine Simpson and Carrie Whitaker",
+ "John Murray and Heather Munoz",
+ "approved William Barron and Jason Wilson",
+ "met with Edward Sloan and Sherry Davis",
+ "FOR James Morrison and Shannon Cowan",
+ "Ran by Michael Johnson and Michael Turner",
+ "with David Jensen and James Thomas",
+ "approved by Janet Jones and Andre Gutierrez",
+ "meeting with Drew Turner and Kathy Allen",
+ "For Wilbur Sanchez and Kenneth Cox",
+ "Lunch with John Plummer and Michael Richardson",
+ "with Bertha Bryant and Eric Brown",
+ "Terri Long and John Wagner",
+ "approved Catherine Cox and Gina Hutchinson",
+ "Willie Clark and Gloria Johnson",
+ "Meeting with Eduardo Watkins and Lynne Gomez",
+ "for Carol Anderson and Alvin Parker",
+ "Asked Herbert Mcdonald and Dennis Mitchell",
+ "Approved by Jeffrey Hernandez and Mark Cortez",
+ "see Barry Miller and Debra Miller",
+ "see Harold James and Bert Roberts",
+ "asked Michael Adams and Francis Jefferson",
+ "Approved by Mary Mcmahon and Lucinda Blanchard",
+ "ran by Antonio Nelson and Carolyn Wilkerson",
+ "met with Lynda Franks and Carol Anderson",
+ "see Eduardo Barr and Michael Sanchez",
+ "See Jason Porter and Kathy Rogers",
+ "met with Tammie Phillips and Cheryl Garcia",
+ "For Antonio Rosa and Ronald Burgess",
+ "APPROVED BY George Cunningham and Jerry Hernandez",
+ "Meeting with Claude Anderson and Anthony Mercer",
+ "See William Shelton and David Jimenez",
+ "ran by Roy Johnson and Robert Miller",
+ "w/ Irene Perry and Micheal Anderson",
+ "met with Omar Page and Edith Soto",
+ "For Sheila Meadows and Cynthia Roach",
+ "met with Marisa Polk and Anna Roberts",
+ "for Heather Hernandez and Deanna Dunlap",
+ "ran by Erik Sears and Constance Gray",
+ "w/ Susan Gutierrez and Gerald Erickson",
+ "See Ted Peterson and Wade Hogan",
+ "ran by Linda Sanders and Frank Becker",
+ "ran by Tim Schwartz and Leslie Poole",
+ "See Eric Cole and Daniel Bennett",
+ "Approved by David Thomas and Josephine Jones",
+ "asked Gladys Shannon and Michael Garcia",
+ "discussed with Sharon Smith and Robin Hudson",
+ "approved Margaret Kendrick and George Cunningham",
+ "ran by Michael Sutton and Michael Simpson",
+ "See James Mack and David Chang",
+ "discussed with Melanie Ward and Daniel Saunders",
+ "with Rosa Duncan and Kelly Scott",
+ "asked Cathy West and Lindsay Davis",
+ "For Orlando Terrell and Cynthia King",
+ "APPROVED BY Kelly Morris and Jonathan Becker",
+ "discussed with James Burns and Peggy Pugh",
+ "asked Jeremiah Parks and Jimmy Johnson",
+ "ran by Michelle Spencer and Matthew Ward",
+ "customer meeting with George Moore and Tiffany Mack",
+ "approved by Edward Hurley and Mark Cortez",
+ "For Richard Allen and Sheri Cooper",
+ "with Sarah Floyd and Mary Payne",
+ "Asked Stacy Lyon and Mary Smith",
+ "Approved by Daniel Smith and Jason Smith",
+ "asked Robert Gonzales and Gabrielle Johnson",
+ "Customer meeting with Gwendolyn Brown and Thomas Atkins",
+ "meeting with Joshua Newton and Roy Cole",
+ "approved by Brian Simmons and Brian Spencer",
+ "For Thomas Thornton and Bertha Dixon",
+ "with David Livingston and Tim Hoffman",
+ "Met with Jennifer Fowler and Mary Molina",
+ "lunch with Josephine Sears and Christopher Green",
+ "lunch with John Jones and Nicole Stein",
+ "lunch with Jennifer Wilson and Ellen Lambert",
+ "ran by Clyde Robertson and George Cunningham",
+ "with George Reese and Vicky Anderson",
+ "Approved by Lacey Robinson and Bonnie Brown",
+ "Approved by Glenn Morton and Homer Barker",
+ "customer meeting with Vanessa Willis and Fred Graham",
+ "CUSTOMER MEETING WITH Michael Walters and Roy Thompson",
+ "Asked Sallie Peterson and Rachelle Conley",
+ "ran by Frances Henson and Steven Nguyen",
+ "See Marjorie Davis and Mary Morgan",
+ "with Robert Cannon and Sterling Avery",
+ "Dorothy Padilla and Raymond Morgan",
+ "Monica Gregory and Genevieve Contreras",
+ "w/ Maria Warner and Brandi Dyer",
+ "W/ Richard Scott and Johnny Lewis",
+ "Approved by Dixie Swanson and Felipe Smith",
+ "lunch with Richard Castro and April Jones",
+ "for Barbara Martin and Richard Fuller",
+ "Judith Scott and John Wallace",
+ "asked Emma Gilbert and Rodney Morgan",
+ "see Wendy Washington and Laura Farley",
+ "approved Monica Holden and Jessie Odell",
+ "asked Terry Williams and Jane Robinson",
+ "See Maria Mosley and Carmen Herman",
+ "Discussed with Erin Williams and Erin Warren",
+ "For Joshua Newton and Jeffery Tanner",
+ "w/ David Valentine and Lisa Caldwell",
+ "see Julie Rodriguez and Kevin Parks",
+ "ran by Bryan White and Sandra Simpson",
+ "discussed with Stanley Smart and Robert Copeland",
+ "For Charles Barber and Yolanda Ellison",
+ "WITH Gwen Blackburn and Sammy Miller",
+ "with Kevin Griggs and Sandra Byrd",
+ "discussed with Jack Duran and Christine Gross",
+ "customer meeting with Leslie Gomez and Kim Warren",
+ "See Mary Mcmahon and Eleanor Ramirez",
+ "met with Melissa Yarbrough and Bette Knight",
+ "Approved by Josephine Johnson and Pamela Hansen",
+ "meeting with Deanna Clifton and Margaret Taylor",
+ "Approved by Marvin Alvarez and Janice Baker",
+ "approved Cassandra Buchanan and Oscar Cooper",
+ "See Daniel Green and Catherine Schultz",
+ "For Manuel Hale and Angela Carter",
+ "See Paul Brady and Victor Roberts",
+ "approved Rebecca Guzman and Robert Perez",
+ "ran by Enrique Harris and Steven Soto",
+ "ran by Jennifer Gray and Rodney Branch",
+ "met with Laura Walker and James Jones",
+ "Asked Jay Vega and Bruce Campbell",
+ "approved by Belinda Roberts and Betty Rodriguez",
+ "Approved by Amanda Clark and Larry Duncan",
+ "For Robert Rivera and Bertha Dixon",
+ "Approved by Richard Foreman and Kelly Fuentes",
+ "With Emily Fisher and John Cantrell",
+ "Asked Keith Cobb and Jill Bryant",
+ "For George Moore and Margaret Reese",
+ "DISCUSSED WITH Robert Bell and Jack Duran",
+ "lunch with Gary Horton and James Forbes",
+ "approved by Scott Mitchell and Samuel Vargas",
+ "customer meeting with Jerald Williams and Kelly Morris",
+ "customer meeting with Mary Green and Curtis Wilkins",
+ "customer meeting with Juan Waters and William Wiley",
+ "For Marcus Kirby and Laura Martinez",
+ "met with Allison Torres and Troy Moses",
+ "Approved by Charles Jackson and Kelly Benton",
+ "met with James Thompson and Francis Dudley",
+ "meeting with Thomas Merritt and Matthew Gray",
+ "asked Bernard Holman and Craig Williams",
+ "met with Bruce Hughes and Saul Wiggins",
+ "For Carl Clay and John Lehman",
+ "Approved by Frederick Carroll and Ethel Williams",
+ "Approved by Lottie Ritter and Kelly Aguilar",
+ "for Stephen Miller and Thomas Ruiz",
+ "See Kathleen Kelly and Justin Jackson",
+ "see Margaret Phelps and Todd Williams",
+ "meeting with Calvin Carr and Dawn Crane",
+ "Approved by Julia Brown and Melissa Hall",
+ "asked Carol Hodges and Anna Leonard",
+ "see Gary Watkins and Stephanie Thornton",
+ "For Anthony King and Diane Flynn",
+ "Approved by Oscar Larsen and Timothy Stephens",
+ "FOR Don Hood, Esteban James and Jennifer Padilla",
+ "ran by Sean Olson, Gerard Browning and Norma Armstrong",
+ "ran by Shelly Kim, Betty Cohen and Betty Bowers",
+ "approved by Stacy James, Stanley Russell and Cary Hines",
+ "With Michelle Davis, Jacquelyn Byrd and Joseph Walter",
+ "ran by Aubrey Norris, Tina Cleveland and Joe Washington",
+ "See Michael Beard, Fredrick Clemons and Richard Barnett",
+ "met with Lillie Moore, Kyle Welch and Don Bender",
+ "discussed with James Porter, Elaine Martinez and Joel Curry",
+ "W/ Joseph Rodriguez, Debbie Cox and Mary Bradley",
+ "See Walter Thomas, Claude Wells and Charles King",
+ "W/ Amy Banks, Helen Weiss and Mary Jones",
+ "see Robert Hawkins, Ola Flores and Donna Ponce",
+ "discussed with James Woods, Theresa Thompson and Woodrow Childers",
+ "Approved by Manuel Hale, Inez Acosta and Cassie Key",
+ "approved by Tammy Patterson, James Brown and Steven Decker",
+ "for William Kennedy, Demetrius Magee and Jeanette Wagner",
+ "Approved by Marvin Terry, George Moore and Oscar Ford",
+ "approved Carl Green, Margaret Savage and Emma Cotton",
+ "approved by Darla Jones, Martin Jackson and Jason Johnson",
+ "approved Anthony Hess, Barbara Parker and Gail Clay",
+ "Ran by Lupe Thompson, Jacquelyn Byrd and Benjamin Williams",
+ "Approved by Yolanda Cantrell, Deborah Vasquez and Judith Perez",
+ "Approved by William Hoover, Stephen Rivera and Ann Taylor",
+ "Lunch with Georgia Mckinney, Samantha Hopkins and Ana Stinson",
+ "W/ Heather Rodriguez, Richard Lee and Rachel Goldstein",
+ "lunch with Deborah Baldwin, Sylvia Morris and Edward Alvarez",
+ "Discussed with David Cook, Kathleen Anderson and Phillip Chambers",
+ "see Emily Miller, Brian Simmons and Denise Smith",
+ "lunch with Jeffrey Nguyen, Veronica Belcher and Jessie Odell",
+ "asked Tiffany Dunn, Karen Baker and Joseph Gray",
+ "approved Marvin Terry, Jan Burnett and Sue Campbell",
+ "Discussed with Bertha Bryant, Matthew Parsons and Jason Smith",
+ "ran by Amy Lang, Bobby White and Connie Bowers",
+ "approved by Cecilia Williams, Lloyd Taylor and Raymond Thompson",
+ "met with Evelyn Wyatt, Janet Chavez and Camille Adkins",
+ "For Aaron Williams, Elisabeth Marshall and Roger Stuart",
+ "see Rosa Kennedy, Blake Jones and Joshua Jackson",
+ "For Minnie Shaw, Richard Barnett and Elizabeth Williams",
+ "ran by Angelina Kirby, Charles Schultz and Robert Cole",
+ "approved Timothy Horn, Lisa Lynch and Rocky Daniel",
+ "Approved by Scott West, Michael Sutton and Matthew Roberson",
+ "for Manuel Roberts, Diana Mack and Dan Petersen",
+ "Ralph Harrington, Franklin Horton and Jermaine Donaldson",
+ "approved Margaret Nunez, Randy Moore and Cathy Taylor",
+ "Customer meeting with Nathan French, Harold James and Kirk Flores",
+ "w/ Beverly Richards, Rachel Goldstein and Eddie Coleman",
+ "meeting with James Morrison, Lillian Weber and Allen Childers",
+ "customer meeting with Angelo Lopez, Juanita Black and Connie
Collins",
+ "customer meeting with Donna Obrien, Samuel Sweet and Sharon
Franklin",
+ "APPROVED BY Roger Humphrey, James Allen and Matthew Warren",
+ "approved by Jennifer Green, Sarah Walton and Bridget Stone",
+ "Approved by Edna Garza, Brandon Wiley and Richard Hill",
+ "customer meeting with Micheal Drake, Glenn Whaley and David Gibson",
+ "for Joy Childs, Ethel Dye and John Donahue",
+ "For Eric Lewis, Brooke Williams and Tamika Williams",
+ "ran by John Jones, Frank Scott and Garrett Ellis",
+ "ran by Joshua Palmer, Oliver Sweet and Lillian Chavez",
+ "asked Joshua Lewis, Alvin Dudley and Leonard Hunt",
+ "see Jorge Eaton, Jason Smith and Jessica Rivera",
+ "For Maxine Murray, Jay Lawson and Viola Robinson",
+ "see Kenneth Bowers, Bruce Campbell and Andrew Williams",
+ "for Beverly Duncan, Lisa Mack and Scott Thompson",
+ "customer meeting with Maria Robertson, Mike Barnes and Sonya
Alvarez",
+ "Discussed with Dorothy King, Kenny Hampton and Regina Ramirez",
+ "Bobby White, Frances Montgomery and Joyce Kerr",
+ "Anna Leonard, Patricia Anderson and Margaret Coleman",
+ "approved by Janet White, Marguerite Peters and Carl Evans",
+ "Approved by Tim Chandler, Geraldine Wise and David Gibson",
+ "For Brandon Russo, Kenneth Cox and William Crabtree",
+ "ran by Kerry Thompson, Marian Mcdonald and Susan French",
+ "lunch with Daisy Johnson, Otto Vasquez and Todd Welch",
+ "asked Mary Smith, Patrick Parks and Robert Boucher",
+ "Joan Marsh, Julie Rodriguez and Joyce Perez",
+ "approved by Robert Martinez, Michelle Jones and Gary Jones",
+ "DISCUSSED WITH Mildred Cowan, Mattie Kelly and Darrel Jenkins",
+ "customer meeting with John Ware, Carolyn Mendoza and Frances
Fitzgerald",
+ "meeting with Christine Hutchinson, Phillip Cole and Marcia Martin",
+ "Justin Hill, David Williams and Robert Copeland",
+ "customer meeting with Thomas Atkins, Randy Moore and Andrew Marsh",
+ "See Melissa Davenport, Diane Johnson and Santiago Brown",
+ "Discussed with Jeffrey Collier, Helen Thomas and Shawn Quinn",
+ "asked Janet White, Elizabeth Benson and Clint Brown",
+ "approved Estelle Harris, Louis Irwin and Kristina Anderson",
+ "See Diane Peterson, Jason Davis and Elaine Montgomery",
+ "For Jerry Tucker, Lola Allen and Lorenzo Coleman",
+ "lunch with Tiffany Ramsey, Janice Morgan and Dennis Boyer",
+ "asked John Johnson, Jason Childress and Eleanor Ramirez",
***The diff for this file has been truncated for email.***
=======================================
---
/branches/2.1/bikeshed/src/com/google/gwt/sample/expenses/server/DataGenerator.java
Mon May 10 19:50:25 2010
+++
/branches/2.1/bikeshed/src/com/google/gwt/sample/expenses/server/DataGenerator.java
Tue May 11 10:56:00 2010
@@ -127,7 +127,7 @@
Expense detail = new Expense();
detail.setReportId(reportId);
detail.setDescription(DESCRIPTIONS[index]);
- detail.setDate(getDate());
+ detail.setCreated(getDate());
detail.setAmount(rand.nextInt(25000) / 100.0);
detail.setCategory(CATEGORIES[index]);
detail.setApproval("");
@@ -178,7 +178,7 @@
JSONObject jsonObject = new JSONObject();
jsonObject.put("id", "" + expense.getId());
jsonObject.put("description", expense.getDescription());
- jsonObject.put("date", expense.getDate().getTime());
+ jsonObject.put("date", expense.getCreated().getTime());
jsonObject.put("amount", expense.getAmount());
jsonObject.put("category", expense.getCategory());
return jsonObject;
=======================================
---
/branches/2.1/bikeshed/src/com/google/gwt/sample/expenses/server/domain/Expense.java
Tue May 11 05:49:29 2010
+++
/branches/2.1/bikeshed/src/com/google/gwt/sample/expenses/server/domain/Expense.java
Tue May 11 10:56:00 2010
@@ -34,6 +34,10 @@
@Entity
public class Expense {
+ public static final EntityManager entityManager() {
+ return EMF.get().createEntityManager();
+ }
+
public static long countExpenses() {
EntityManager em = entityManager();
try {
@@ -42,10 +46,6 @@
em.close();
}
}
-
- public static final EntityManager entityManager() {
- return EMF.get().createEntityManager();
- }
@SuppressWarnings("unchecked")
public static List<Expense> findAllExpenses() {
@@ -106,7 +106,7 @@
private String category;
- private Date date;
+ private Date created;
private String description;
@@ -127,8 +127,8 @@
return this.category;
}
- public Date getDate() {
- return this.date;
+ public Date getCreated() {
+ return this.created;
}
public String getDescription() {
@@ -182,8 +182,8 @@
this.category = category;
}
- public void setDate(Date date) {
- this.date = date;
+ public void setCreated(Date created) {
+ this.created = created;
}
public void setDescription(String description) {
@@ -214,7 +214,7 @@
sb.append("Amount: ").append(getAmount()).append(", ");
sb.append("Approval: ").append(getApproval()).append(", ");
sb.append("Category: ").append(getCategory()).append(", ");
- sb.append("Date: ").append(getDate()).append(", ");
+ sb.append("Created: ").append(getCreated()).append(", ");
sb.append("Description: ").append(getDescription());
return sb.toString();
}
=======================================
--- /branches/2.1/bikeshed/war/WEB-INF/web.xml Mon May 10 18:33:18 2010
+++ /branches/2.1/bikeshed/war/WEB-INF/web.xml Tue May 11 10:56:00 2010
@@ -26,6 +26,11 @@
<servlet-name>treeServlet</servlet-name>
<servlet-class>com.google.gwt.sample.bikeshed.cookbook.server.TreeServiceImpl</servlet-class>
</servlet>
+
+ <servlet>
+ <servlet-name>dataGeneration</servlet-name>
+
<servlet-class>com.google.gwt.sample.expenses.gwt.server.DataGenerationServiceImpl</servlet-class>
+ </servlet>
<servlet-mapping>
<servlet-name>expensesData</servlet-name>
@@ -47,6 +52,11 @@
<url-pattern>/cookbook/tree</url-pattern>
</servlet-mapping>
+ <servlet-mapping>
+ <servlet-name>dataGeneration</servlet-name>
+ <url-pattern>/loadexpensesdb/dataGeneration</url-pattern>
+ </servlet-mapping>
+
<!-- AppStats -->
<!-- Do not turn on until Christmas.
<servlet>
--
http://groups.google.com/group/Google-Web-Toolkit-Contributors