Skip to content

Instantly share code, notes, and snippets.

Avatar

Matt Raible mraible

View GitHub Profile
View GenericService.java
package org.appfuse.gwt.client.service;
import java.io.Serializable;
/**
* Generic Services to allow easily creating GWT services.
*
* @author mraible
* @param <T> a type variable
* @param <PK> the primary key for that type
View GenericServiceImpl.java
package org.appfuse.gwt.service.client.service;
import org.appfuse.gwt.service.client.event.CollectionLoadedEvent;
import org.appfuse.gwt.service.client.event.ResourceDeletedEvent;
import org.appfuse.gwt.service.client.event.ResourceLoadedEvent;
import org.appfuse.gwt.service.client.event.ResourceSavedEvent;
import org.appfuse.gwt.service.client.rest.Callback;
import org.appfuse.gwt.service.client.rest.Deferred;
import org.appfuse.gwt.service.client.rest.Representation;
import org.appfuse.gwt.service.client.rest.RestRequest;
View GenericServiceGwtTest.java
package org.appfuse.gwt.service.client.service;
import org.appfuse.gwt.service.client.AbstractGwtTestCase;
import org.appfuse.gwt.service.client.event.CollectionLoadedEvent;
import org.appfuse.gwt.service.client.event.ResourceDeletedEvent;
import org.appfuse.gwt.service.client.event.ResourceLoadedEvent;
import org.appfuse.gwt.service.client.event.ResourceSavedEvent;
import org.appfuse.gwt.service.client.rest.Representation;
import org.appfuse.gwt.service.client.rest.jso.AbstractJSOModel;
import org.appfuse.gwt.service.client.rest.jso.JSOModel;
View gist:316414
import static org.appfuse.gwt.service.client.rest.RestConstants.*;
import com.google.gwt.core.client.GWT;
import com.google.gwt.http.client.Header;
import com.google.gwt.http.client.Request;
import com.google.gwt.http.client.RequestBuilder;
import com.google.gwt.http.client.RequestCallback;
import com.google.gwt.http.client.RequestException;
import com.google.gwt.http.client.Response;
/**
@mraible
mraible / appfuse-settings.xml
Created Feb 24, 2011
settings.xml for getting AppFuse snapshots
View appfuse-settings.xml
<settings>
<mirrors>
<mirror>
<id>appfuse-snapshot-mirror</id>
<mirrorOf>public-snapshots</mirrorOf>
<url>http://oss.sonatype.org/content/groups/public-snapshots</url>
</mirror>
<mirror>
<id>appfuse-mirror</id>
<mirrorOf>*</mirrorOf>
View j_security_check.patch
Index: src/main/webapp/login.jsp
===================================================================
--- src/main/webapp/login.jsp (revision 64b117c649d5b11a16c312d3b02e68f409294945)
+++ src/main/webapp/login.jsp (revision )
@@ -43,9 +43,12 @@
$("#login").live('click', function(e) {
e.preventDefault();
- $.ajax({url: getHost() + "${ctx}/api/login.json",
+ $.ajax({url: getHost() + "${ctx}/j_security_check",
View j_security_check2.patch
diff --git a/src/main/java/org/appfuse/examples/web/AjaxAuthenticationSuccessHandler.java b/src/main/java/org/appfuse/examples/web/AjaxAuthenticationSuccessHandler.java
index 2a68529..99980ed 100644
--- a/src/main/java/org/appfuse/examples/web/AjaxAuthenticationSuccessHandler.java
+++ b/src/main/java/org/appfuse/examples/web/AjaxAuthenticationSuccessHandler.java
@@ -1,16 +1,31 @@
package org.appfuse.examples.web;
+import org.codehaus.jackson.map.ObjectMapper;
+import org.springframework.security.core.Authentication;
+import org.springframework.security.web.authentication.AuthenticationSuccessHandler;
@mraible
mraible / stripes-extensionless.patch
Created Mar 7, 2011
What it took to implement extensionless URLs in Stripes.
View stripes-extensionless.patch
Index: stripes/src/main/webapp/WEB-INF/web.xml
===================================================================
--- stripes/src/main/webapp/WEB-INF/web.xml (revision 163)
+++ stripes/src/main/webapp/WEB-INF/web.xml (revision )
@@ -17,7 +17,6 @@
<filter-name>exportFilter</filter-name>
<filter-class>org.displaytag.filter.ResponseOverrideFilter</filter-class>
</filter>
-
<filter>
@mraible
mraible / wicket-extensionless.patch
Created Mar 7, 2011
What it took to implement extensionless URL with Wicket.
View wicket-extensionless.patch
Index: wicket/src/main/webapp/decorators/default.jsp
===================================================================
--- wicket/src/main/webapp/decorators/default.jsp (revision 242)
+++ wicket/src/main/webapp/decorators/default.jsp (revision )
@@ -69,7 +69,7 @@
<h2 class="accessibility">Navigation</h2>
<ul class="clearfix">
<li><a href="${ctx}/" title="Home"><span>Home</span></a></li>
- <li><a href="${ctx}/app/users" title="View Users"><span>Users</span></a></li>
+ <li><a href="${ctx}/users" title="View Users"><span>Users</span></a></li>
@mraible
mraible / create-appfuse.sql
Created May 5, 2011
Create AppFuse DB in MySQL
View create-appfuse.sql
-- MySQL dump 10.13 Distrib 5.5.10, for osx10.6 (i386)
--
-- Host: localhost Database: appfuse
-- ------------------------------------------------------
-- Server version 5.5.10
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;