Permalink
Browse files

SEO coding

robots.txt
new search.html

Now calculating popularity by asynchronously updating our schools view count.

Added gwt-log 1.4.4

GUI work
  • Loading branch information...
1 parent 8efb32e commit 2dbdf54bd3265262db0ca4fa6a48bae86e66cf3a @jdwyah committed Jan 24, 2008
Showing with 1,678 additions and 847 deletions.
  1. +3 −0 .freemarker-ide.xml
  2. +8 −2 src/main/java/com/apress/progwt/client/GWTApp.java
  3. +43 −36 src/main/java/com/apress/progwt/client/college/ServiceCache.java
  4. +1 −1 src/main/java/com/apress/progwt/client/college/ToCollegeApp.java
  5. +2 −1 src/main/java/com/apress/progwt/client/college/gui/ApplicationStatusChooserWidget.java
  6. +5 −4 src/main/java/com/apress/progwt/client/college/gui/CollegeEntry.java
  7. +2 −1 src/main/java/com/apress/progwt/client/college/gui/CollegeRatingPanel.java
  8. +3 −1 src/main/java/com/apress/progwt/client/college/gui/EqualSpacedPanel.java
  9. +4 −4 src/main/java/com/apress/progwt/client/college/gui/LoginWindow.java
  10. +7 −6 src/main/java/com/apress/progwt/client/college/gui/MyRankings.java
  11. +30 −30 src/main/java/com/apress/progwt/client/college/gui/ViewPanel.java
  12. +198 −198 src/main/java/com/apress/progwt/client/college/gui/ext/FocusPanelExt.java
  13. +3 −1 src/main/java/com/apress/progwt/client/college/gui/ext/TableWithHeaders.java
  14. +9 −8 src/main/java/com/apress/progwt/client/college/gui/timeline/TimeLineObj.java
  15. +27 −26 src/main/java/com/apress/progwt/client/college/gui/timeline/ZoomableTimeline.java
  16. +5 −4 src/main/java/com/apress/progwt/client/domain/Application.java
  17. +2 −3 src/main/java/com/apress/progwt/client/domain/{forum → }/ForumPost.java
  18. +0 −2 src/main/java/com/apress/progwt/client/domain/School.java
  19. +2 −3 src/main/java/com/apress/progwt/client/domain/{forum → }/SchoolForumPost.java
  20. +0 −2 src/main/java/com/apress/progwt/client/domain/User.java
  21. +2 −2 src/main/java/com/apress/progwt/client/domain/{forum → }/UserForumPost.java
  22. +1 −1 src/main/java/com/apress/progwt/client/domain/commands/SaveForumPostCommand.java
  23. +1 −1 src/main/java/com/apress/progwt/client/domain/dto/ForumBootstrap.java
  24. +1 −1 src/main/java/com/apress/progwt/client/domain/dto/PostsList.java
  25. +34 −0 src/main/java/com/apress/progwt/client/domain/dto/SearchResult.java
  26. +1 −0 src/main/java/com/apress/progwt/client/domain/forum/ForumTopic.java
  27. +38 −0 src/main/java/com/apress/progwt/client/domain/forum/RecentForumPostTopic.java
  28. +1 −1 src/main/java/com/apress/progwt/client/domain/generated/AbstractForumPost.java
  29. +10 −0 src/main/java/com/apress/progwt/client/domain/generated/AbstractSchool.java
  30. +42 −32 src/main/java/com/apress/progwt/client/forum/ForumApp.java
  31. +1 −1 src/main/java/com/apress/progwt/client/forum/ForumDisplay.java
  32. +5 −7 src/main/java/com/apress/progwt/client/service/remote/GWTSchoolService.java
  33. +8 −12 src/main/java/com/apress/progwt/client/service/remote/GWTSchoolServiceAsync.java
  34. +434 −0 src/main/java/com/apress/progwt/public/css/gwtstyles.css
  35. +8 −1 src/main/java/com/apress/progwt/server/dao/SchoolDAO.java
  36. +63 −6 src/main/java/com/apress/progwt/server/dao/hibernate/SchoolDAOHibernateImpl.java
  37. +7 −1 src/main/java/com/apress/progwt/server/service/SchoolService.java
  38. +5 −3 src/main/java/com/apress/progwt/server/service/SearchService.java
  39. +2 −1 src/main/java/com/apress/progwt/server/service/UserService.java
  40. +2 −3 src/main/java/com/apress/progwt/server/service/gwt/GWTSchoolServiceImpl.java
  41. +55 −67 src/main/java/com/apress/progwt/server/service/impl/SchoolServiceImpl.java
  42. +146 −262 src/main/java/com/apress/progwt/server/service/impl/SearchServiceImpl.java
  43. +18 −13 src/main/java/com/apress/progwt/server/service/impl/UserServiceImpl.java
  44. +17 −3 src/main/java/com/apress/progwt/server/web/controllers/CollegeController.java
  45. +3 −6 src/main/java/com/apress/progwt/server/web/controllers/ForumController.java
  46. +79 −0 src/main/java/com/apress/progwt/server/web/controllers/SearchController.java
  47. +34 −4 src/main/java/com/apress/progwt/server/web/controllers/SimpleAnnotatedController.java
  48. +9 −0 src/main/java/com/apress/progwt/server/web/domain/CreateUserRequestCommand.java
  49. +22 −0 src/main/java/com/apress/progwt/server/web/domain/SearchCommand.java
  50. +4 −0 src/main/java/com/apress/progwt/server/web/domain/validation/CreateUserRequestValidator.java
  51. +2 −2 src/main/resources/com/apress/progwt/client/domain/{forum → }/ForumPost.hbm.xml
  52. +2 −0 src/main/resources/com/apress/progwt/client/domain/School.hbm.xml
  53. +15 −9 src/main/resources/com/apress/progwt/client/domain/tocollege.cpm.xml
  54. +1 −1 src/main/webapp/WEB-INF/applicationContext-hibernate.xml
  55. +3 −2 src/main/webapp/WEB-INF/dispatcher-servlet.xml
  56. +12 −6 src/main/webapp/WEB-INF/freemarker/college.ftl
  57. +2 −2 src/main/webapp/WEB-INF/freemarker/common.ftl
  58. +2 −1 src/main/webapp/WEB-INF/freemarker/commonGWT.ftl
  59. +2 −1 src/main/webapp/WEB-INF/freemarker/forums.ftl
  60. +2 −2 src/main/webapp/WEB-INF/freemarker/index.ftl
  61. +0 −22 src/main/webapp/WEB-INF/freemarker/notFound.ftl
  62. +20 −18 src/main/webapp/WEB-INF/freemarker/schools.ftl
  63. +60 −0 src/main/webapp/WEB-INF/freemarker/search.ftl
  64. +15 −6 src/main/webapp/WEB-INF/freemarker/signup.ftl
  65. +2 −2 src/main/webapp/WEB-INF/freemarker/viewuser.ftl
  66. +48 −5 src/main/webapp/css/styles.css
  67. +1 −0 src/main/webapp/decorators/default.ftl
  68. +5 −0 src/main/webapp/robots.txt
  69. +2 −2 src/test/java/com/apress/progwt/client/domain/commands/SaveForumPostCommandTest.java
  70. +20 −2 src/test/java/com/apress/progwt/server/dao/hibernate/SchoolDAOHibernateImplTest.java
  71. +30 −2 src/test/java/com/apress/progwt/server/service/impl/SchoolServiceImplTest.java
  72. +25 −1 src/test/java/com/apress/progwt/server/service/impl/SearchServiceImplTest.java
View
@@ -9,6 +9,9 @@
<resource path="src/main/webapp/WEB-INF/freemarker/user.ftl">
<value key="user" object-class="com.apress.progwt.client.domain.User"/>
</resource>
+ <resource path="src/main/webapp/WEB-INF/freemarker/search.ftl">
+ <value key="searchResults" object-class="com.apress.progwt.client.domain.dto.SearchResult"/>
+ </resource>
</context-values>
<macro-library>
</macro-library>
@@ -60,8 +60,14 @@ private static String getLoadID(int id) {
}
protected String getParam(String string) {
- Dictionary dictionary = Dictionary.getDictionary("Vars");
- return dictionary.get(string + "_" + pageID);
+ try {
+ Dictionary dictionary = Dictionary.getDictionary("Vars");
+ return dictionary.get(string + "_" + pageID);
+ } catch (Exception e) {
+ Log.info("Couldn't find param: " + string);
+ return null;
+ }
+
}
private static String getPreLoadID(int id) {
@@ -2,14 +2,18 @@
import java.util.List;
+import com.allen_sauer.gwt.log.client.Log;
import com.apress.progwt.client.GWTApp;
import com.apress.progwt.client.domain.ProcessType;
import com.apress.progwt.client.domain.School;
import com.apress.progwt.client.domain.User;
import com.apress.progwt.client.domain.commands.AbstractCommand;
import com.apress.progwt.client.domain.commands.SiteCommand;
+import com.apress.progwt.client.domain.dto.PostsList;
import com.apress.progwt.client.domain.dto.UserAndToken;
+import com.apress.progwt.client.domain.forum.ForumTopic;
import com.apress.progwt.client.exception.SiteException;
+import com.apress.progwt.client.rpc.StdAsyncCallback;
import com.apress.progwt.client.service.remote.GWTSchoolServiceAsync;
import com.apress.progwt.client.service.remote.GWTUserServiceAsync;
import com.google.gwt.user.client.rpc.AsyncCallback;
@@ -38,25 +42,6 @@ public void match(String query,
// asyncCallback.onSuccess(rtn);
}
- // public void saveEntry(CollegeEntry entry, User thisUser, int index)
- // {
- //
- // System.out.println("SAVING ENTRY!!!!!!!!!");
- //
- // final SaveSchoolRankCommand comm = new SaveSchoolRankCommand(
- // entry.getSchoolAndApplication().getSchool(), thisUser,
- // index);
- // executeCommand(comm, new EZCallback<SiteCommand>() {
- // public void onSuccess(SiteCommand success) {
- // Logger.debug("Success");
- //
- // // comm.setCurrentUser()
- // // comm.executeCommand();
- // }
- // });
- //
- // }
-
public void getCurrentUser(final AsyncCallback<User> callback) {
userService.getCurrentUser(new AsyncCallback<UserAndToken>() {
@@ -78,32 +63,54 @@ public void matchProcessType(String queryString,
schoolService.matchProcessType(queryString, callback);
}
+ /**
+ * if we haven't got the token yet, go get one
+ *
+ * @param command
+ * @param callback
+ */
public void executeCommand(final AbstractCommand command,
final AsyncCallback<SiteCommand> callback) {
- command.setToken(currentToken);
-
- schoolService.executeAndSaveCommand(command,
- new AsyncCallback<SiteCommand>() {
-
- public void onSuccess(SiteCommand result) {
- try {
- command.execute(command);
- } catch (SiteException e) {
- callback.onFailure(e);
+ if (currentToken == null) {
+ Log.info("Token was null, fetching.");
+ getCurrentUser(new StdAsyncCallback<User>("Fetch Token") {
+ public void onSuccess(User result) {
+ super.onSuccess(result);
+ Log.info("Retrying");
+ executeCommand(command, callback);
+ }
+ });
+
+ } else {
+ Log.info("Using token:" + currentToken);
+ command.setToken(currentToken);
+ schoolService.executeAndSaveCommand(command,
+ new AsyncCallback<SiteCommand>() {
+
+ public void onSuccess(SiteCommand result) {
+ try {
+ command.execute(command);
+ } catch (SiteException e) {
+ callback.onFailure(e);
+ }
+ callback.onSuccess(result);
}
- callback.onSuccess(result);
- }
-
- public void onFailure(Throwable caught) {
- callback.onFailure(caught);
- }
- });
+ public void onFailure(Throwable caught) {
+ callback.onFailure(caught);
+ }
+ });
+ }
}
public void getSchoolDetails(String replacementString,
AsyncCallback<School> callback) {
schoolService.getSchoolDetails(replacementString, callback);
}
+
+ public void getForum(ForumTopic forumTopic, int start, int max,
+ AsyncCallback<PostsList> asyncCallback) {
+ schoolService.getForum(forumTopic, start, max, asyncCallback);
+ }
}
@@ -44,7 +44,7 @@ private void setMeUp() {
getLoginService().getUserOrDoLogin(new AsyncCallback<User>() {
public void onFailure(Throwable caught) {
- System.out.println("setmeupFailure " + caught);
+ Log.error("setmeupFailure " + caught);
}
public void onSuccess(User result) {
@@ -2,6 +2,7 @@
import java.util.Date;
+import com.allen_sauer.gwt.log.client.Log;
import com.apress.progwt.client.college.ServiceCache;
import com.apress.progwt.client.domain.Application;
import com.apress.progwt.client.domain.ProcessType;
@@ -93,7 +94,7 @@ public PChooser(ProcessType statusType) {
public void onChange(Widget sender) {
Date selected = datePicker.getSelectedDate();
- System.out.println(selected);
+ Log.debug(selected.toString());
}
@@ -1,5 +1,6 @@
package com.apress.progwt.client.college.gui;
+import com.allen_sauer.gwt.log.client.Log;
import com.apress.progwt.client.calculator.GUIEffects;
import com.apress.progwt.client.college.ServiceCache;
import com.apress.progwt.client.domain.Application;
@@ -124,11 +125,11 @@ private Widget getThoughts() {
saveB.addClickListener(new ClickListener() {
public void onClick(Widget sender) {
- System.out.println("bf " + application.getNotes() + " "
- + application.getPros().size());
+ Log.debug("CollegeEntry.bf " + application.getNotes()
+ + " " + application.getPros().size());
bindFields();
- System.out.println("af " + application.getNotes() + " "
- + application.getPros().size());
+ Log.debug("CollegeEntry.af " + application.getNotes()
+ + " " + application.getPros().size());
AbstractCommand command = new SaveApplicationCommand(
application);
@@ -1,5 +1,6 @@
package com.apress.progwt.client.college.gui;
+import com.allen_sauer.gwt.log.client.Log;
import com.apress.progwt.client.college.ServiceCache;
import com.apress.progwt.client.domain.Application;
import com.apress.progwt.client.domain.RatingType;
@@ -50,7 +51,7 @@ public CollegeRatingPanel(ServiceCache serviceCache, User thisUser,
public void onChange(Widget sender) {
- System.out.println("On Change");
+ Log.debug("CollegeRatingPanel On Change");
if (sender instanceof RatingChooser) {
RatingChooser chooser = (RatingChooser) sender;
@@ -1,5 +1,6 @@
package com.apress.progwt.client.college.gui;
+import com.allen_sauer.gwt.log.client.Log;
import com.google.gwt.user.client.ui.AbsolutePanel;
import com.google.gwt.user.client.ui.Label;
@@ -27,7 +28,8 @@ public void add(String s) {
Label label = new Label(s);
- System.out.println("Add " + s + " " + curLeft + " " + curTop);
+ Log.debug("EqualSpacedPanel Add " + s + " " + curLeft + " "
+ + curTop);
add(label, curLeft, curTop);
curLeft += spacingPerEntry;
@@ -53,15 +53,15 @@
* @param manager
*/
public LoginWindow(LoginListener listener) {
- super(false, true);
+ super(false, false);
this.listener = listener;
if (semaphore == false) {
- System.out.println("CREATING LoginWindow");
+ Log.debug("CREATING LoginWindow");
semaphore = true;
} else {
- System.out.println("KILLING LoginWindow");
+ Log.debug("KILLING LoginWindow");
hide();
return;
@@ -136,7 +136,7 @@ public void onSubmitComplete(FormSubmitCompleteEvent event) {
}
public void onSubmit(FormSubmitEvent event) {
- System.out.println("submit to " + form.getAction());
+ Log.debug("submit to " + form.getAction());
// This event is fired just before the form is submitted.
// We can take
@@ -131,9 +131,10 @@ public void addSchool(School school) {
}
public void onDragEnd(DragEndEvent event) {
- System.out.println("DragEndEvent on: " + event);
- System.out.println("DragEndEvent on: "
- + ((DragEndEvent) event).toString());
+ Log.debug("DragEndEvent on: " + event);
+ Log
+ .debug("DragEndEvent on: "
+ + ((DragEndEvent) event).toString());
try {
IndexedDragEndEvent indexedEvent = (IndexedDragEndEvent) event;
@@ -145,8 +146,7 @@ public void onDragEnd(DragEndEvent event) {
Log.error("MyPage: " + e);
}
- System.out.println("event.getSource "
- + event.getSource().getClass());
+ Log.debug("event.getSource " + event.getSource().getClass());
}
public void onDragStart(DragStartEvent event) {
@@ -174,7 +174,8 @@ public void load(User user) {
List<Application> schoolAndApps = user.getSchoolRankings();
- System.out.println("FOUND " + schoolAndApps.size() + " Schools ");
+ Log.debug("MyRankings.FOUND " + schoolAndApps.size()
+ + " Schools ");
for (Application schoolAndApp : schoolAndApps) {
addEntry(new CollegeEntry(user, schoolAndApp, serviceCache,
Oops, something went wrong.

0 comments on commit 2dbdf54

Please sign in to comment.