|
From: <tre...@us...> - 2007-10-18 18:57:15
|
Revision: 512
http://ogoglio.svn.sourceforge.net/ogoglio/?rev=512&view=rev
Author: trevorolio
Date: 2007-10-18 11:57:19 -0700 (Thu, 18 Oct 2007)
Log Message:
-----------
Two thirds of the way to sitting:
Added a "Sit Here" context menu item for things made from templates with seat metadata.
Bound the avatar renderable to the seat thing renderable's transform group (hello, flying sofa).
If an avatar moves or teleports while seated, it stands.
Tried to be somewhat good about progressive loading, showing standing avatars before things and then sitting avatars.
Not yet done:
Call the sit animation.
Add seat metadata UI to the template editor HTML.
Make a flying Le Corbusier sofa with info panel controls.
Modified Paths:
--------------
maven/trunk/ogoglio-appdev/src/main/java/com/ogoglio/appdev/servlet/AbstractResourceServlet.java
Modified: maven/trunk/ogoglio-appdev/src/main/java/com/ogoglio/appdev/servlet/AbstractResourceServlet.java
===================================================================
--- maven/trunk/ogoglio-appdev/src/main/java/com/ogoglio/appdev/servlet/AbstractResourceServlet.java 2007-10-18 18:57:16 UTC (rev 511)
+++ maven/trunk/ogoglio-appdev/src/main/java/com/ogoglio/appdev/servlet/AbstractResourceServlet.java 2007-10-18 18:57:19 UTC (rev 512)
@@ -56,50 +56,52 @@
private boolean noCache = true;
-
// WARNING: This is really, really easy to hose yourself with this. This will get called
// WARNING: during the init() of this class, so it is very easy to end up calling this
// WARNING: init method "too soon" in your init method, before you are fully initialized
public abstract SiteResource createBaseResource(ServletConfig servletConfig);
- protected Context initCtx=null;
- protected String baseUrl=null;
-
+ protected Context initCtx = null;
+
+ protected String baseUrl = null;
+
protected void initContext() throws NamingException {
- if (initCtx==null) {
- initCtx = new InitialContext();
- }
+ if (initCtx == null) {
+ initCtx = new InitialContext();
+ }
}
+
public void initBaseUrl() throws NamingException {
- if (baseUrl==null) {
- initContext();
+ if (baseUrl == null) {
+ initContext();
Context envCtx = (Context) initCtx.lookup("java:comp/env");
baseUrl = (String) envCtx.lookup(OGOGLIO_BASE_URL_KEY);
- }
+ }
}
+
public void init(ServletConfig config) throws ServletException {
try {
- initBaseUrl();
+ initBaseUrl();
} catch (NamingException e) {
throw new ServletException("Could not init in AbstractResourceServlet: " + e);
}
super.init(config);
-
+
baseResource = createBaseResource(config);
-
- if (baseResource==null) {
- Log.warn("Class "+getClass().getName()+" should be sure it eventually sets the value of the base resource on it's servlet.");
+
+ if (baseResource == null) {
+ Log.warn("Class " + getClass().getName() + " should be sure it eventually sets the value of the base resource on it's servlet.");
} else {
- if (!(baseResource.getPathElement() instanceof String)) {
- throw new IllegalStateException("The base resource must have a String path element: " + baseResource.getPathElement());
- }
+ if (!(baseResource.getPathElement() instanceof String)) {
+ throw new IllegalStateException("The base resource must have a String path element: " + baseResource.getPathElement());
+ }
}
}
public String getBaseUrl() {
- return baseUrl;
- }
+ return baseUrl;
+ }
public void destroy() {
super.destroy();
@@ -112,6 +114,7 @@
response.addHeader("Cache-Control", "no-store");
response.setDateHeader("Expires", 0);
}
+
public static String getRequestAuthCookie(HttpServletRequest request) {
Cookie[] cookies = request.getCookies();
for (int i = 0; cookies != null && i < cookies.length; i++) {
@@ -122,12 +125,11 @@
return null;
}
-
public static void setCachable(HttpServletResponse response) {
response.setHeader("Cache-Control", "public");
response.setDateHeader("Expires", System.currentTimeMillis() + 10000000);
}
-
+
public void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
if (noCache) {
setNoCache(response);
@@ -137,13 +139,13 @@
String[] pathElements = getPathElements((String) baseResource.getPathElement(), requestURI);
- if (pathElements==null) {
- Log.error("Can't understand path elements in "+getClass().getCanonicalName()+"! "+requestURI);
- Log.error(" baseResource for errant service() is "+baseResource.getClass().getCanonicalName());
+ if (pathElements == null) {
+ Log.error("Can't understand path elements in " + getClass().getCanonicalName() + "! " + requestURI);
+ Log.error(" baseResource for errant service() is " + baseResource.getClass().getCanonicalName());
response.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
return;
}
-
+
SiteResource requestedResource = getSiteResource(pathElements, baseResource);
if (requestedResource == null) {
@@ -231,8 +233,8 @@
outputStream.flush();
outputStream.close();
}
- if (connection.getResponseCode()!=200) {
- Log.warn("Proxy sending error to client: "+connection.getResponseCode()+" on "+uri);
+ if (connection.getResponseCode() != 200 && connection.getResponseCode() != 404) {
+ Log.warn("Proxy sending error to client: " + connection.getResponseCode() + " on " + uri);
}
response.setStatus(connection.getResponseCode());
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|