You can subscribe to this list here.
| 2007 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(7) |
Jul
(26) |
Aug
(85) |
Sep
(141) |
Oct
(85) |
Nov
(60) |
Dec
(29) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2008 |
Jan
(38) |
Feb
(78) |
Mar
(10) |
Apr
|
May
|
Jun
|
Jul
(3) |
Aug
(1) |
Sep
|
Oct
|
Nov
|
Dec
|
|
From: <tre...@us...> - 2007-08-28 23:51:32
|
Revision: 286
http://ogoglio.svn.sourceforge.net/ogoglio/?rev=286&view=rev
Author: trevorolio
Date: 2007-08-28 16:51:30 -0700 (Tue, 28 Aug 2007)
Log Message:
-----------
Moved boostrap info out of common WebConstants into test BootstrapInfo.
Moved the applet test window into this module.
Modified Paths:
--------------
maven/trunk/ogoglio-integration-test/pom.xml
maven/trunk/ogoglio-integration-test/src/test/java/com/ogoglio/client/test/ClientTest.java
Added Paths:
-----------
maven/trunk/ogoglio-integration-test/src/test/java/com/ogoglio/client/test/AppletTestWindow.java
maven/trunk/ogoglio-integration-test/src/test/java/com/ogoglio/client/test/BootstrapInfo.java
maven/trunk/ogoglio-integration-test/src/test/resources/bootstrapUser.properties
Modified: maven/trunk/ogoglio-integration-test/pom.xml
===================================================================
--- maven/trunk/ogoglio-integration-test/pom.xml 2007-08-28 23:50:41 UTC (rev 285)
+++ maven/trunk/ogoglio-integration-test/pom.xml 2007-08-28 23:51:30 UTC (rev 286)
@@ -9,6 +9,13 @@
<packaging>pom</packaging>
<build>
+ <testResources>
+ <testResource>
+ <targetPath></targetPath>
+ <directory>src/test/resources/</directory>
+ <filtering>true</filtering>
+ </testResource>
+ </testResources>
<plugins>
<!-- COMPILER needed b/c POM packaging by default doesn't build the tests -->
<plugin>
@@ -189,6 +196,11 @@
<artifactId>ogoglio-common</artifactId>
<version>0.0.1</version>
</dependency>
+ <dependency>
+ <groupId>com.ogoglio</groupId>
+ <artifactId>ogoglio-viewer-applet</artifactId>
+ <version>0.0.1</version>
+ </dependency>
</dependencies>
</project>
Added: maven/trunk/ogoglio-integration-test/src/test/java/com/ogoglio/client/test/AppletTestWindow.java
===================================================================
--- maven/trunk/ogoglio-integration-test/src/test/java/com/ogoglio/client/test/AppletTestWindow.java (rev 0)
+++ maven/trunk/ogoglio-integration-test/src/test/java/com/ogoglio/client/test/AppletTestWindow.java 2007-08-28 23:51:30 UTC (rev 286)
@@ -0,0 +1,150 @@
+/* Copyright 2007 Transmutable (http://transmutable.com/)
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License. */
+
+package com.ogoglio.client.test;
+
+import java.applet.Applet;
+import java.applet.AppletContext;
+import java.applet.AppletStub;
+import java.awt.BorderLayout;
+import java.awt.Dimension;
+import java.awt.Frame;
+import java.awt.GraphicsDevice;
+import java.awt.GraphicsEnvironment;
+import java.net.MalformedURLException;
+import java.net.URI;
+import java.net.URL;
+import java.util.HashMap;
+
+import com.ogoglio.client.WebAPIAuthenticator;
+import com.ogoglio.client.WebAPIClientWire;
+import com.ogoglio.client.WebAPIDescriptor;
+import com.ogoglio.viewer.applet.ViewerApplet;
+
+public class AppletTestWindow extends Frame {
+
+ //static Dimension appDimension = new Dimension(640, 500);
+ //static Dimension appDimension = new Dimension(500, 522);
+ static Dimension appDimension = new Dimension(1000, 640);
+
+ Applet applet = null;
+
+ EnvironmentStub clientStub1 = null;
+
+ String host = "127.0.0.1:8080";
+
+ String serviceURI = "http://" + host + "/og/";
+
+ URL codeBase = getURL(serviceURI);
+
+ static boolean fullScreen = false;
+
+ public AppletTestWindow() {
+ setLayout(new BorderLayout());
+ setSize(appDimension);
+ setLocation(30, 50);
+ setResizable(false);
+ if (fullScreen) {
+ this.setUndecorated(true);
+ }
+
+ HashMap parameters1 = new HashMap();
+ try {
+ WebAPIAuthenticator authenticator = new WebAPIAuthenticator(new WebAPIClientWire(), new WebAPIDescriptor(new URI(serviceURI)), BootstrapInfo.getBootstrapUsername(), BootstrapInfo.getBootstrapUserPW());
+ parameters1.put("loginCookie", authenticator.getAuthCookie());
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ //parameters1.put("loginCookie", "guestApplet_Test_Window2");
+
+ parameters1.put("spaceID", "" + 4);
+ parameters1.put("serviceURI", serviceURI);
+
+ //parameters1.put("x", "0");
+ //parameters1.put("y", "1000");
+ //parameters1.put("z", "0");
+ //parameters1.put("rx", "-1.6");
+ //parameters1.put("ry", "0");
+ //parameters1.put("rz", "0");
+
+ //parameters1.put("movable", "false");
+
+ clientStub1 = new EnvironmentStub(parameters1);
+ applet = new ViewerApplet();
+ //applet = new BodyEditorApplet();
+ applet.setStub(clientStub1);
+ add(applet, BorderLayout.CENTER);
+ }
+
+ private class EnvironmentStub implements AppletStub {
+
+ HashMap parameters = null;
+
+ public EnvironmentStub(HashMap parameters) {
+ this.parameters = parameters;
+ }
+
+ public void appletResize(int width, int height) {
+ }
+
+ public AppletContext getAppletContext() {
+ return null;
+ }
+
+ public URL getCodeBase() {
+ return codeBase;
+ }
+
+ public URL getDocumentBase() {
+ return codeBase;
+ }
+
+ public String getParameter(String name) {
+ return (String) parameters.get(name);
+ }
+
+ public boolean isActive() {
+ return true;
+ }
+
+ }
+
+ public void start() {
+ applet.init();
+ applet.start();
+ }
+
+ private static URL getURL(String url) {
+ try {
+ return new URL(url);
+ } catch (MalformedURLException e) {
+ throw new IllegalStateException("Bad url: " + url);
+ }
+ }
+
+ public static void main(String[] args) {
+ GraphicsEnvironment graphicsEnv = GraphicsEnvironment.getLocalGraphicsEnvironment();
+ GraphicsDevice device = graphicsEnv.getDefaultScreenDevice();
+ if (fullScreen) {
+ appDimension = new Dimension(device.getDisplayMode().getWidth(), device.getDisplayMode().getWidth());
+ }
+ AppletTestWindow test = new AppletTestWindow();
+ test.setVisible(true);
+ if (fullScreen) {
+ device.setFullScreenWindow(test);
+ }
+ test.start();
+ }
+
+}
Added: maven/trunk/ogoglio-integration-test/src/test/java/com/ogoglio/client/test/BootstrapInfo.java
===================================================================
--- maven/trunk/ogoglio-integration-test/src/test/java/com/ogoglio/client/test/BootstrapInfo.java (rev 0)
+++ maven/trunk/ogoglio-integration-test/src/test/java/com/ogoglio/client/test/BootstrapInfo.java 2007-08-28 23:51:30 UTC (rev 286)
@@ -0,0 +1,40 @@
+package com.ogoglio.client.test;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.Properties;
+
+public class BootstrapInfo {
+ private static Properties bootstrapProps=null;
+
+ public static String getBootstrapUsername() {
+ if (bootstrapProps==null) {
+ fetchBootstrapProps();
+ }
+ return bootstrapProps.getProperty("bootstrapUser");
+ }
+
+ public static String getBootstrapUserPW() {
+ if (bootstrapProps==null) {
+ fetchBootstrapProps();
+ }
+ return bootstrapProps.getProperty("bootstrapUserPW");
+ }
+
+ private static void fetchBootstrapProps() {
+ InputStream str=(new BootstrapInfo().getClass()).getResourceAsStream("/bootstrapUser.properties");
+ if (str==null) {
+ System.out.println("Unable to load bootstrapUser.properties!");
+ bootstrapProps=new Properties();
+ } else {
+ try {
+ bootstrapProps=new Properties();
+ bootstrapProps.load(str);
+ } catch (IOException e) {
+ System.out.println("Unable to load bootstrapUser.properties due to IOException:"+e.getMessage());
+ bootstrapProps=new Properties();
+ }
+ }
+ }
+
+}
Modified: maven/trunk/ogoglio-integration-test/src/test/java/com/ogoglio/client/test/ClientTest.java
===================================================================
--- maven/trunk/ogoglio-integration-test/src/test/java/com/ogoglio/client/test/ClientTest.java 2007-08-28 23:50:41 UTC (rev 285)
+++ maven/trunk/ogoglio-integration-test/src/test/java/com/ogoglio/client/test/ClientTest.java 2007-08-28 23:51:30 UTC (rev 286)
@@ -97,7 +97,7 @@
public void testWebAdmin() {
try {
- WebAPIAuthenticator adminAuthenticator = new WebAPIAuthenticatorFactory().authenticate(wire1, descriptor1, WebConstants.getBootstrapUsername(), WebConstants.getBootstrapUserPW());
+ WebAPIAuthenticator adminAuthenticator = new WebAPIAuthenticatorFactory().authenticate(wire1, descriptor1, BootstrapInfo.getBootstrapUsername(), BootstrapInfo.getBootstrapUserPW());
assertNotNull("got null auth cookie", adminAuthenticator.getAuthCookie());
WebAPIClient adminWebClient = new WebAPIClient(descriptor1, adminAuthenticator, wire1);
Added: maven/trunk/ogoglio-integration-test/src/test/resources/bootstrapUser.properties
===================================================================
--- maven/trunk/ogoglio-integration-test/src/test/resources/bootstrapUser.properties (rev 0)
+++ maven/trunk/ogoglio-integration-test/src/test/resources/bootstrapUser.properties 2007-08-28 23:51:30 UTC (rev 286)
@@ -0,0 +1,2 @@
+bootstrapUser=${ogoglio.bootstrapUser}
+bootstrapUserPW=${ogoglio.bootstrapUserPW}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <tre...@us...> - 2007-08-28 23:50:41
|
Revision: 285
http://ogoglio.svn.sourceforge.net/ogoglio/?rev=285&view=rev
Author: trevorolio
Date: 2007-08-28 16:50:41 -0700 (Tue, 28 Aug 2007)
Log Message:
-----------
Added the XML tests by matching maven's singular test name filter.
Added a templates resource dir for the loading object.
Removed the body applet specific image resources.
Moved the bootstrap user info out of the commons (so the world doesn't get it.. whoops).
Added the sample art to the test resources instead of the main resources.
Modified Paths:
--------------
maven/trunk/ogoglio-common/.classpath
maven/trunk/ogoglio-common/pom.xml
maven/trunk/ogoglio-common/src/main/java/com/ogoglio/client/SpaceClient.java
maven/trunk/ogoglio-common/src/main/java/com/ogoglio/client/model/Space.java
maven/trunk/ogoglio-common/src/main/java/com/ogoglio/client/model/User.java
maven/trunk/ogoglio-common/src/main/java/com/ogoglio/util/WebConstants.java
maven/trunk/ogoglio-common/src/main/java/com/ogoglio/viewer/j3d/MotionInputHandler.java
maven/trunk/ogoglio-common/src/main/java/com/ogoglio/viewer/j3d/bvh/BvhParser.java
Added Paths:
-----------
maven/trunk/ogoglio-common/src/main/resources/templates/
maven/trunk/ogoglio-common/src/main/resources/templates/loading.obj
maven/trunk/ogoglio-common/src/test/java/com/ogoglio/xml/test/XMLTest.java
maven/trunk/ogoglio-common/src/test/resources/sample-art3d/
maven/trunk/ogoglio-common/src/test/resources/sample-art3d/Grid.gif
maven/trunk/ogoglio-common/src/test/resources/sample-art3d/TestCube.gif
maven/trunk/ogoglio-common/src/test/resources/sample-art3d/TestCube.js
maven/trunk/ogoglio-common/src/test/resources/sample-art3d/TestCube.mtl
maven/trunk/ogoglio-common/src/test/resources/sample-art3d/TestCube.obj
maven/trunk/ogoglio-common/src/test/resources/sample-art3d/defaultLand.mtl
maven/trunk/ogoglio-common/src/test/resources/testing_constants/
maven/trunk/ogoglio-common/src/test/resources/testing_constants/bootstrapUser.properties
Removed Paths:
-------------
maven/trunk/ogoglio-common/src/main/resources/avatar/LeftArrow.gif
maven/trunk/ogoglio-common/src/main/resources/avatar/LeftArrowDisabled.gif
maven/trunk/ogoglio-common/src/main/resources/avatar/RightArrow.gif
maven/trunk/ogoglio-common/src/main/resources/avatar/RightArrowDisabled.gif
maven/trunk/ogoglio-common/src/main/resources/avatar/license.txt
maven/trunk/ogoglio-common/src/main/resources/avatar/loading.obj
maven/trunk/ogoglio-common/src/main/resources/sample-art3d/
maven/trunk/ogoglio-common/src/main/resources/testing_constants/
maven/trunk/ogoglio-common/src/test/java/com/ogoglio/xml/test/XMLTests.java
maven/trunk/ogoglio-common/src/test/resources/sample-art3d/Grid.gif
maven/trunk/ogoglio-common/src/test/resources/sample-art3d/TestCube.gif
maven/trunk/ogoglio-common/src/test/resources/sample-art3d/TestCube.js
maven/trunk/ogoglio-common/src/test/resources/sample-art3d/TestCube.mtl
maven/trunk/ogoglio-common/src/test/resources/sample-art3d/defaultLand.mtl
maven/trunk/ogoglio-common/src/test/resources/sample-art3d/door.mtl
maven/trunk/ogoglio-common/src/test/resources/testing_constants/bootstrapUser.properties
Modified: maven/trunk/ogoglio-common/.classpath
===================================================================
--- maven/trunk/ogoglio-common/.classpath 2007-08-28 23:47:54 UTC (rev 284)
+++ maven/trunk/ogoglio-common/.classpath 2007-08-28 23:50:41 UTC (rev 285)
@@ -2,9 +2,9 @@
<classpath>
<classpathentry kind="src" path="src/main/java"/>
<classpathentry kind="src" path="src/test/java"/>
- <classpathentry excluding="**" kind="src" output="src/main/resources/testing_constants" path="src/main/resources/testing_constants"/>
- <classpathentry excluding="**" kind="src" output="src/main/resources/avatar" path="src/main/resources/avatar"/>
- <classpathentry excluding="**" kind="src" output="src/test/resources" path="src/test/resources"/>
+ <classpathentry excluding="**" output="src/main/resources/avatar" kind="src" path="src/main/resources/avatar"/>
+ <classpathentry excluding="**" output="src/main/resources/templates" kind="src" path="src/main/resources/templates"/>
+ <classpathentry excluding="**" output="src/test/resources" kind="src" path="src/test/resources"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>
<classpathentry kind="output" path="target/classes"/>
Modified: maven/trunk/ogoglio-common/pom.xml
===================================================================
--- maven/trunk/ogoglio-common/pom.xml 2007-08-28 23:47:54 UTC (rev 284)
+++ maven/trunk/ogoglio-common/pom.xml 2007-08-28 23:50:41 UTC (rev 285)
@@ -13,16 +13,22 @@
<build>
<resources>
<!-- FILTER RESOURCES FOR SOME CONSTANTS-->
+ <!--
<resource>
<directory>src/main/resources/testing_constants</directory>
<filtering>true</filtering>
</resource>
-
+ -->
+
<resource>
<targetPath>avatar</targetPath>
<directory>src/main/resources/avatar</directory>
</resource>
+ <resource>
+ <targetPath>templates</targetPath>
+ <directory>src/main/resources/templates</directory>
+ </resource>
</resources>
</build>
Modified: maven/trunk/ogoglio-common/src/main/java/com/ogoglio/client/SpaceClient.java
===================================================================
--- maven/trunk/ogoglio-common/src/main/java/com/ogoglio/client/SpaceClient.java 2007-08-28 23:47:54 UTC (rev 284)
+++ maven/trunk/ogoglio-common/src/main/java/com/ogoglio/client/SpaceClient.java 2007-08-28 23:50:41 UTC (rev 285)
@@ -689,7 +689,7 @@
try {
return webClient.getTemplateResourceStream(ownerUsername, templateID, name);
} catch (IOException e) {
- return SpaceClient.class.getClassLoader().getResourceAsStream("/avatar/loading.obj");
+ return UIConstants.getResource("/templates/loading.obj");
}
}
@@ -715,7 +715,6 @@
}
public InputStream getUserAnimationStream(String username, long animationID) throws IOException {
- System.out.println("trying to FART: "+username+","+animationID);
if (animationID == 1) {
return UIConstants.getResource("avatar/avatar.bvh");
} else if (animationID == 2) {
@@ -754,7 +753,7 @@
if (lodIndex != 0) {
return null;
}
- return SpaceClient.class.getClassLoader().getResourceAsStream("/avatar/loading.obj");
+ return UIConstants.getResource("/template/loading.obj");
}
public InputStream getSkinMapStream() throws IOException {
Modified: maven/trunk/ogoglio-common/src/main/java/com/ogoglio/client/model/Space.java
===================================================================
--- maven/trunk/ogoglio-common/src/main/java/com/ogoglio/client/model/Space.java 2007-08-28 23:47:54 UTC (rev 284)
+++ maven/trunk/ogoglio-common/src/main/java/com/ogoglio/client/model/Space.java 2007-08-28 23:50:41 UTC (rev 285)
@@ -530,7 +530,6 @@
}
protected InputStream getUserGeometryStream(String username) throws IOException {
- System.out.println("FART: Trying to get Geometry stream for user "+username+" from spaceContext");
return spaceContext.getUserGeometryStream(username, null);
}
@@ -543,7 +542,6 @@
}
public InputStream getUserAnimationStream(String username, long animationID) throws IOException {
- System.out.println("FART GET USER ANIM:"+spaceContext.getClass().getName()+"..."+username);
return spaceContext.getUserAnimationStream(username, animationID);
}
Modified: maven/trunk/ogoglio-common/src/main/java/com/ogoglio/client/model/User.java
===================================================================
--- maven/trunk/ogoglio-common/src/main/java/com/ogoglio/client/model/User.java 2007-08-28 23:47:54 UTC (rev 284)
+++ maven/trunk/ogoglio-common/src/main/java/com/ogoglio/client/model/User.java 2007-08-28 23:50:41 UTC (rev 285)
@@ -88,7 +88,6 @@
}
public InputStream getGeometryStream(int lodIndex) throws IOException {
- //System.out.println("FART:Handle user lod index:"+lodIndex+":"+space+","+username);
return space.getUserGeometryStream(username);
}
Modified: maven/trunk/ogoglio-common/src/main/java/com/ogoglio/util/WebConstants.java
===================================================================
--- maven/trunk/ogoglio-common/src/main/java/com/ogoglio/util/WebConstants.java 2007-08-28 23:47:54 UTC (rev 284)
+++ maven/trunk/ogoglio-common/src/main/java/com/ogoglio/util/WebConstants.java 2007-08-28 23:50:41 UTC (rev 285)
@@ -14,39 +14,4 @@
public static final String SPACE_INCLUDE_CHILDREN_PARAM = "children";
public static final String GUEST_COOKIE_PREFIX = "guest";
-
- private static Properties bootstrapProps=null;
-
- public static String getBootstrapUsername() {
- if (bootstrapProps==null) {
- fetchBootstrapProps();
- }
- return bootstrapProps.getProperty("bootstrapUser");
- }
-
- public static String getBootstrapUserPW() {
- if (bootstrapProps==null) {
- fetchBootstrapProps();
- }
- return bootstrapProps.getProperty("bootstrapUserPW");
- }
-
- private static void fetchBootstrapProps() {
- InputStream str=(new WebConstants().getClass()).getResourceAsStream("/bootstrapUser.properties");
- if (str==null) {
- System.out.println("Unable to load bootstrapUser.properties!");
- bootstrapProps=new Properties();
- } else {
- try {
- bootstrapProps=new Properties();
- bootstrapProps.load(str);
- //System.out.println("FART---------->");
- //bootstrapProps.list(System.out);
- } catch (IOException e) {
- System.out.println("Unable to load bootstrapUser.properties due to IOException:"+e.getMessage());
- bootstrapProps=new Properties();
- }
- }
- }
-
}
Modified: maven/trunk/ogoglio-common/src/main/java/com/ogoglio/viewer/j3d/MotionInputHandler.java
===================================================================
--- maven/trunk/ogoglio-common/src/main/java/com/ogoglio/viewer/j3d/MotionInputHandler.java 2007-08-28 23:47:54 UTC (rev 284)
+++ maven/trunk/ogoglio-common/src/main/java/com/ogoglio/viewer/j3d/MotionInputHandler.java 2007-08-28 23:50:41 UTC (rev 285)
@@ -40,7 +40,6 @@
// right now we only support arrow key based walking and turning
// TODO add a full motion set: walk, fun, strafe, jump
-
public double maxRadiansPerSecond = Math.PI / 60;
private boolean strafeLeft = false;
@@ -110,7 +109,6 @@
}
}
-
// called from within PhysicsBehavior
public void keyPressed(KeyEvent e) {
System.out.println("Key down");
@@ -204,7 +202,7 @@
}
public void mouseClicked(MouseEvent event) {
- if (event.isControlDown() || event.getButton()!=MouseEvent.BUTTON1) {
+ if (event.isControlDown() || event.getButton() != MouseEvent.BUTTON1) {
return;
}
ClickTarget clickTarget = renderer.getClickTarget(event.getX(), event.getY());
@@ -255,8 +253,6 @@
}
public void mousePressed(MouseEvent event) {
- System.out.println("POPUP TRIGGER FART:"+event.isPopupTrigger()+","+new JPopupMenu().isPopupTrigger(event)+","+
- event.isControlDown()+","+event.paramString()+","+event.getButton());
ClickTarget clickTarget = renderer.getClickTarget(event.getX(), event.getY());
if (clickTarget == null) {
return;
Modified: maven/trunk/ogoglio-common/src/main/java/com/ogoglio/viewer/j3d/bvh/BvhParser.java
===================================================================
--- maven/trunk/ogoglio-common/src/main/java/com/ogoglio/viewer/j3d/bvh/BvhParser.java 2007-08-28 23:47:54 UTC (rev 284)
+++ maven/trunk/ogoglio-common/src/main/java/com/ogoglio/viewer/j3d/bvh/BvhParser.java 2007-08-28 23:50:41 UTC (rev 285)
@@ -40,7 +40,7 @@
this.geoProvider = geoProvider;
inputStream = this.geoProvider.getAnimationStream(animationID);
if (inputStream==null) {
- System.out.println("FART: BvhParser: Can't get a stream from "+geoProvider+","+geoProvider.getClass().getName());
+ throw new IllegalArgumentException("No such animation: " + animationID);
}
tokenizer = new LineTokenizer(inputStream);
}
Deleted: maven/trunk/ogoglio-common/src/main/resources/avatar/LeftArrow.gif
===================================================================
(Binary files differ)
Deleted: maven/trunk/ogoglio-common/src/main/resources/avatar/LeftArrowDisabled.gif
===================================================================
(Binary files differ)
Deleted: maven/trunk/ogoglio-common/src/main/resources/avatar/RightArrow.gif
===================================================================
(Binary files differ)
Deleted: maven/trunk/ogoglio-common/src/main/resources/avatar/RightArrowDisabled.gif
===================================================================
(Binary files differ)
Deleted: maven/trunk/ogoglio-common/src/main/resources/avatar/license.txt
===================================================================
--- maven/trunk/ogoglio-common/src/main/resources/avatar/license.txt 2007-08-28 23:47:54 UTC (rev 284)
+++ maven/trunk/ogoglio-common/src/main/resources/avatar/license.txt 2007-08-28 23:50:41 UTC (rev 285)
@@ -1,10 +0,0 @@
-The art in this directory is:
-
-Copyright 2007 METACRASHER.com Licensed under the Apache License,
-Version 2.0 (the "License"); you may not use this file except in compliance
-with the License. You may obtain a copy of the License at
-http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law
-or agreed to in writing, software distributed under the License is distributed
-on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
-or implied. See the License for the specific language governing permissions
-and limitations under the License.
Deleted: maven/trunk/ogoglio-common/src/main/resources/avatar/loading.obj
===================================================================
--- maven/trunk/ogoglio-common/src/main/resources/avatar/loading.obj 2007-08-28 23:47:54 UTC (rev 284)
+++ maven/trunk/ogoglio-common/src/main/resources/avatar/loading.obj 2007-08-28 23:50:41 UTC (rev 285)
@@ -1,1935 +0,0 @@
-# Blender3D v243 OBJ File: loading.blend
-# www.blender3d.org
-o Font_Text
-v 0.053322 0.042887 0.080000
-v 0.051720 0.035097 0.080000
-v 0.049138 0.027703 0.080000
-v 0.045650 0.020778 0.080000
-v 0.041329 0.014394 0.080000
-v 0.036248 0.008625 0.080000
-v 0.030478 0.003543 0.080000
-v 0.024095 -0.000778 0.080000
-v 0.017169 -0.004266 0.080000
-v 0.009775 -0.006847 0.080000
-v 0.001985 -0.008450 0.080000
-v -0.006127 -0.009000 0.080000
-v -0.014240 -0.008450 0.080000
-v -0.022030 -0.006847 0.080000
-v -0.029424 -0.004266 0.080000
-v -0.036350 -0.000778 0.080000
-v -0.042733 0.003543 0.080000
-v -0.048502 0.008625 0.080000
-v -0.053584 0.014394 0.080000
-v -0.057905 0.020778 0.080000
-v -0.061393 0.027703 0.080000
-v -0.063975 0.035097 0.080000
-v -0.065577 0.042887 0.080000
-v -0.066127 0.051000 0.080000
-v -0.065577 0.059113 0.080000
-v -0.063975 0.066903 0.080000
-v -0.061393 0.074297 0.080000
-v -0.057905 0.081222 0.080000
-v -0.053584 0.087606 0.080000
-v -0.048502 0.093375 0.080000
-v -0.042733 0.098457 0.080000
-v -0.036350 0.102778 0.080000
-v -0.029424 0.106266 0.080000
-v -0.022030 0.108847 0.080000
-v -0.014240 0.110450 0.080000
-v -0.006127 0.111000 0.080000
-v 0.001985 0.110450 0.080000
-v 0.009775 0.108847 0.080000
-v 0.017169 0.106266 0.080000
-v 0.024095 0.102778 0.080000
-v 0.030478 0.098457 0.080000
-v 0.036248 0.093375 0.080000
-v 0.041329 0.087606 0.080000
-v 0.045650 0.081222 0.080000
-v 0.049138 0.074297 0.080000
-v 0.051720 0.066903 0.080000
-v 0.053322 0.059113 0.080000
-v 0.053873 0.051000 0.080000
-v -0.003171 0.689560 0.080000
-v 0.021771 0.684982 0.080000
-v 0.043810 0.677625 0.080000
-v 0.063058 0.667852 0.080000
-v 0.079625 0.656023 0.080000
-v 0.093623 0.642500 0.080000
-v 0.105162 0.627644 0.080000
-v 0.114354 0.611815 0.080000
-v 0.121310 0.595375 0.080000
-v 0.126141 0.578685 0.080000
-v 0.128958 0.562106 0.080000
-v 0.129873 0.546000 0.080000
-v 0.126634 0.509157 0.080000
-v 0.117715 0.473588 0.080000
-v 0.104310 0.439234 0.080000
-v 0.087613 0.406037 0.080000
-v 0.068819 0.373937 0.080000
-v 0.049123 0.342875 0.080000
-v 0.029718 0.312792 0.080000
-v 0.011799 0.283630 0.080000
-v -0.003440 0.255328 0.080000
-v -0.014803 0.227829 0.080000
-v -0.021097 0.201072 0.080000
-v -0.021127 0.175000 0.080000
-v -0.031111 0.180362 0.080000
-v -0.040081 0.185982 0.080000
-v -0.048065 0.191906 0.080000
-v -0.055090 0.198185 0.080000
-v -0.061185 0.204867 0.080000
-v -0.066377 0.212000 0.080000
-v -0.070695 0.219633 0.080000
-v -0.074164 0.227815 0.080000
-v -0.076815 0.236594 0.080000
-v -0.078674 0.246019 0.080000
-v -0.079769 0.256138 0.080000
-v -0.080127 0.267000 0.080000
-v -0.077924 0.292783 0.080000
-v -0.071831 0.317264 0.080000
-v -0.062627 0.340641 0.080000
-v -0.051090 0.363111 0.080000
-v -0.037998 0.384873 0.080000
-v -0.024127 0.406125 0.080000
-v -0.010257 0.427064 0.080000
-v 0.002836 0.447889 0.080000
-v 0.014373 0.468797 0.080000
-v 0.023576 0.489986 0.080000
-v 0.029669 0.511655 0.080000
-v 0.031873 0.534000 0.080000
-v 0.031338 0.543721 0.080000
-v 0.029761 0.552852 0.080000
-v 0.027185 0.561344 0.080000
-v 0.023650 0.569148 0.080000
-v 0.019199 0.576216 0.080000
-v 0.013873 0.582500 0.080000
-v 0.007713 0.587950 0.080000
-v 0.000761 0.592519 0.080000
-v -0.006940 0.596156 0.080000
-v -0.015350 0.598815 0.080000
-v -0.024426 0.600446 0.080000
-v -0.034127 0.601000 0.080000
-v -0.038984 0.600920 0.080000
-v -0.043567 0.600694 0.080000
-v -0.047893 0.600344 0.080000
-v -0.051979 0.599889 0.080000
-v -0.055843 0.599351 0.080000
-v -0.059502 0.598750 0.080000
-v -0.062974 0.598108 0.080000
-v -0.066276 0.597444 0.080000
-v -0.069424 0.596781 0.080000
-v -0.072438 0.596139 0.080000
-v -0.075333 0.595538 0.080000
-v -0.078127 0.595000 0.080000
-v -0.031127 0.691000 0.080000
-v 0.053322 0.042887 -0.080000
-v 0.051720 0.035097 -0.080000
-v 0.049138 0.027703 -0.080000
-v 0.045650 0.020778 -0.080000
-v 0.041329 0.014394 -0.080000
-v 0.036248 0.008625 -0.080000
-v 0.030478 0.003543 -0.080000
-v 0.024095 -0.000778 -0.080000
-v 0.017169 -0.004266 -0.080000
-v 0.009775 -0.006847 -0.080000
-v 0.001985 -0.008450 -0.080000
-v -0.006127 -0.009000 -0.080000
-v -0.014240 -0.008450 -0.080000
-v -0.022030 -0.006847 -0.080000
-v -0.029424 -0.004266 -0.080000
-v -0.036350 -0.000778 -0.080000
-v -0.042733 0.003543 -0.080000
-v -0.048502 0.008625 -0.080000
-v -0.053584 0.014394 -0.080000
-v -0.057905 0.020778 -0.080000
-v -0.061393 0.027703 -0.080000
-v -0.063975 0.035097 -0.080000
-v -0.065577 0.042887 -0.080000
-v -0.066127 0.051000 -0.080000
-v -0.065577 0.059113 -0.080000
-v -0.063975 0.066903 -0.080000
-v -0.061393 0.074297 -0.080000
-v -0.057905 0.081222 -0.080000
-v -0.053584 0.087606 -0.080000
-v -0.048502 0.093375 -0.080000
-v -0.042733 0.098457 -0.080000
-v -0.036350 0.102778 -0.080000
-v -0.029424 0.106266 -0.080000
-v -0.022030 0.108847 -0.080000
-v -0.014240 0.110450 -0.080000
-v -0.006127 0.111000 -0.080000
-v 0.001985 0.110450 -0.080000
-v 0.009775 0.108847 -0.080000
-v 0.017169 0.106266 -0.080000
-v 0.024095 0.102778 -0.080000
-v 0.030478 0.098457 -0.080000
-v 0.036248 0.093375 -0.080000
-v 0.041329 0.087606 -0.080000
-v 0.045650 0.081222 -0.080000
-v 0.049138 0.074297 -0.080000
-v 0.051720 0.066903 -0.080000
-v 0.053322 0.059113 -0.080000
-v 0.053873 0.051000 -0.080000
-v -0.003171 0.689560 -0.080000
-v 0.021771 0.684982 -0.080000
-v 0.043810 0.677625 -0.080000
-v 0.063058 0.667852 -0.080000
-v 0.079625 0.656023 -0.080000
-v 0.093623 0.642500 -0.080000
-v 0.105162 0.627644 -0.080000
-v 0.114354 0.611815 -0.080000
-v 0.121310 0.595375 -0.080000
-v 0.126141 0.578685 -0.080000
-v 0.128958 0.562106 -0.080000
-v 0.129873 0.546000 -0.080000
-v 0.126634 0.509157 -0.080000
-v 0.117715 0.473588 -0.080000
-v 0.104310 0.439234 -0.080000
-v 0.087613 0.406037 -0.080000
-v 0.068819 0.373937 -0.080000
-v 0.049123 0.342875 -0.080000
-v 0.029718 0.312792 -0.080000
-v 0.011799 0.283630 -0.080000
-v -0.003440 0.255328 -0.080000
-v -0.014803 0.227829 -0.080000
-v -0.021097 0.201072 -0.080000
-v -0.021127 0.175000 -0.080000
-v -0.031111 0.180362 -0.080000
-v -0.040081 0.185982 -0.080000
-v -0.048065 0.191906 -0.080000
-v -0.055090 0.198185 -0.080000
-v -0.061185 0.204867 -0.080000
-v -0.066377 0.212000 -0.080000
-v -0.070695 0.219633 -0.080000
-v -0.074164 0.227815 -0.080000
-v -0.076815 0.236594 -0.080000
-v -0.078674 0.246019 -0.080000
-v -0.079769 0.256138 -0.080000
-v -0.080127 0.267000 -0.080000
-v -0.077924 0.292783 -0.080000
-v -0.071831 0.317264 -0.080000
-v -0.062627 0.340641 -0.080000
-v -0.051090 0.363111 -0.080000
-v -0.037998 0.384873 -0.080000
-v -0.024127 0.406125 -0.080000
-v -0.010257 0.427064 -0.080000
-v 0.002836 0.447889 -0.080000
-v 0.014373 0.468797 -0.080000
-v 0.023576 0.489986 -0.080000
-v 0.029669 0.511655 -0.080000
-v 0.031873 0.534000 -0.080000
-v 0.031338 0.543721 -0.080000
-v 0.029761 0.552852 -0.080000
-v 0.027185 0.561344 -0.080000
-v 0.023650 0.569148 -0.080000
-v 0.019199 0.576216 -0.080000
-v 0.013873 0.582500 -0.080000
-v 0.007713 0.587950 -0.080000
-v 0.000761 0.592519 -0.080000
-v -0.006940 0.596156 -0.080000
-v -0.015350 0.598815 -0.080000
-v -0.024426 0.600446 -0.080000
-v -0.034127 0.601000 -0.080000
-v -0.038984 0.600920 -0.080000
-v -0.043567 0.600694 -0.080000
-v -0.047893 0.600344 -0.080000
-v -0.051979 0.599889 -0.080000
-v -0.055843 0.599351 -0.080000
-v -0.059502 0.598750 -0.080000
-v -0.062974 0.598108 -0.080000
-v -0.066276 0.597444 -0.080000
-v -0.069424 0.596781 -0.080000
-v -0.072438 0.596139 -0.080000
-v -0.075333 0.595538 -0.080000
-v -0.078127 0.595000 -0.080000
-v -0.031127 0.691000 -0.080000
-v -0.003171 0.689560 -0.080000
-v 0.000323 0.719420 -0.050000
-v 0.021771 0.684982 -0.080000
-v 0.029265 0.714107 -0.050000
-v 0.043810 0.677625 -0.080000
-v 0.055414 0.705379 -0.050000
-v 0.063058 0.667852 -0.080000
-v 0.078653 0.693579 -0.050000
-v 0.079625 0.656023 -0.080000
-v 0.098869 0.679145 -0.050000
-v 0.093623 0.642500 -0.080000
-v 0.116004 0.662591 -0.050000
-v 0.105162 0.627644 -0.080000
-v 0.130092 0.644453 -0.050000
-v 0.114354 0.611815 -0.080000
-v 0.141246 0.625246 -0.050000
-v 0.121310 0.595375 -0.080000
-v 0.149632 0.605426 -0.050000
-v 0.126141 0.578685 -0.080000
-v 0.155432 0.585390 -0.050000
-v 0.128958 0.562106 -0.080000
-v 0.158815 0.565480 -0.050000
-v 0.129873 0.546000 -0.080000
-v 0.159947 0.545534 -0.050000
-v 0.126634 0.509157 -0.080000
-v 0.156311 0.504164 -0.050000
-v 0.117715 0.473588 -0.080000
-v 0.146353 0.464451 -0.050000
-v 0.104310 0.439234 -0.080000
-v 0.131745 0.427015 -0.050000
-v 0.087613 0.406037 -0.080000
-v 0.113985 0.391704 -0.050000
-v 0.068819 0.373937 -0.080000
-v 0.094440 0.358320 -0.050000
-v 0.049123 0.342875 -0.080000
-v 0.074396 0.326711 -0.050000
-v 0.029718 0.312792 -0.080000
-v 0.055106 0.296807 -0.050000
-v 0.011799 0.283630 -0.080000
-v 0.037807 0.268653 -0.050000
-v -0.003440 0.255328 -0.080000
-v 0.023701 0.242455 -0.050000
-v -0.014803 0.227829 -0.080000
-v 0.013846 0.218606 -0.050000
-v -0.021097 0.201072 -0.080000
-v 0.008899 0.197574 -0.050000
-v -0.021127 0.175000 -0.080000
-v 0.008815 0.124865 -0.050000
-v -0.031111 0.180362 -0.080000
-v -0.046189 0.154407 -0.050000
-v -0.040081 0.185982 -0.080000
-v -0.057010 0.161186 -0.050000
-v -0.048065 0.191906 -0.080000
-v -0.067039 0.168629 -0.050000
-v -0.055090 0.198185 -0.080000
-v -0.076223 0.176837 -0.050000
-v -0.061185 0.204867 -0.080000
-v -0.084466 0.185873 -0.050000
-v -0.066377 0.212000 -0.080000
-v -0.091644 0.195735 -0.050000
-v -0.070695 0.219633 -0.080000
-v -0.097647 0.206349 -0.050000
-v -0.074164 0.227815 -0.080000
-v -0.102416 0.217593 -0.050000
-v -0.076815 0.236594 -0.080000
-v -0.105962 0.229338 -0.050000
-v -0.078674 0.246019 -0.080000
-v -0.108359 0.241494 -0.050000
-v -0.079769 0.256138 -0.080000
-v -0.109715 0.254026 -0.050000
-v -0.080127 0.267000 -0.080000
-v -0.110170 0.267785 -0.050000
-v -0.077924 0.292783 -0.080000
-v -0.107612 0.297714 -0.050000
-v -0.071831 0.317264 -0.080000
-v -0.100467 0.326421 -0.050000
-v -0.062627 0.340641 -0.080000
-v -0.089996 0.353017 -0.050000
-v -0.051090 0.363111 -0.080000
-v -0.077317 0.377712 -0.050000
-v -0.037998 0.384873 -0.080000
-v -0.063421 0.400810 -0.050000
-v -0.024127 0.406125 -0.080000
-v -0.049194 0.422607 -0.050000
-v -0.010257 0.427064 -0.080000
-v -0.035465 0.443334 -0.050000
-v 0.002836 0.447889 -0.080000
-v -0.023017 0.463132 -0.050000
-v 0.014373 0.468797 -0.080000
-v -0.012579 0.482049 -0.050000
-v 0.023576 0.489986 -0.080000
-v -0.004752 0.500069 -0.050000
-v 0.029669 0.511655 -0.080000
-v 0.000073 0.517230 -0.050000
-v 0.031873 0.534000 -0.080000
-v 0.001791 0.534652 -0.050000
-v 0.031338 0.543721 -0.080000
-v 0.001479 0.540334 -0.050000
-v 0.029761 0.552852 -0.080000
-v 0.000515 0.545919 -0.050000
-v 0.027185 0.561344 -0.080000
-v -0.000953 0.550755 -0.050000
-v 0.023650 0.569148 -0.080000
-v -0.002830 0.554900 -0.050000
-v 0.019199 0.576216 -0.080000
-v -0.005057 0.558435 -0.050000
-v 0.013873 0.582500 -0.080000
-v -0.007620 0.561459 -0.050000
-v 0.007713 0.587950 -0.080000
-v -0.010558 0.564059 -0.050000
-v 0.000761 0.592519 -0.080000
-v -0.013955 0.566292 -0.050000
-v -0.006940 0.596156 -0.080000
-v -0.017918 0.568163 -0.050000
-v -0.015350 0.598815 -0.080000
-v -0.022553 0.569629 -0.050000
-v -0.024426 0.600446 -0.080000
-v -0.027947 0.570598 -0.050000
-v -0.034127 0.601000 -0.080000
-v -0.034738 0.570986 -0.050000
-v -0.038984 0.600920 -0.080000
-v -0.038000 0.570932 -0.050000
-v -0.043567 0.600694 -0.080000
-v -0.041617 0.570754 -0.050000
-v -0.047893 0.600344 -0.080000
-v -0.045021 0.570478 -0.050000
-v -0.051979 0.599889 -0.080000
-v -0.048250 0.570119 -0.050000
-v -0.055843 0.599351 -0.080000
-v -0.051343 0.569688 -0.050000
-v -0.059502 0.598750 -0.080000
-v -0.054343 0.569196 -0.050000
-v -0.062974 0.598108 -0.080000
-v -0.057290 0.568650 -0.050000
-v -0.066276 0.597444 -0.080000
-v -0.060230 0.568060 -0.050000
-v -0.069424 0.596781 -0.080000
-v -0.063205 0.567433 -0.050000
-v -0.072438 0.596139 -0.080000
-v -0.066263 0.566781 -0.050000
-v -0.075333 0.595538 -0.080000
-v -0.069449 0.566120 -0.050000
-v -0.078127 0.595000 -0.080000
-v -0.131521 0.554166 -0.050000
-v -0.031127 0.691000 -0.080000
-v -0.049363 0.721979 -0.050000
-v 0.000323 0.719420 -0.050000
-v 0.000323 0.719420 0.050000
-v 0.029265 0.714107 -0.050000
-v 0.029265 0.714107 0.050000
-v 0.055414 0.705379 -0.050000
-v 0.055414 0.705379 0.050000
-v 0.078653 0.693579 -0.050000
-v 0.078653 0.693579 0.050000
-v 0.098869 0.679145 -0.050000
-v 0.098869 0.679145 0.050000
-v 0.116004 0.662591 -0.050000
-v 0.116004 0.662591 0.050000
-v 0.130092 0.644453 -0.050000
-v 0.130092 0.644453 0.050000
-v 0.141246 0.625246 -0.050000
-v 0.141246 0.625246 0.050000
-v 0.149632 0.605426 -0.050000
-v 0.149632 0.605426 0.050000
-v 0.155432 0.585390 -0.050000
-v 0.155432 0.585390 0.050000
-v 0.158815 0.565480 -0.050000
-v 0.158815 0.565480 0.050000
-v 0.159947 0.545534 -0.050000
-v 0.159947 0.545534 0.050000
-v 0.156311 0.504164 -0.050000
-v 0.156311 0.504164 0.050000
-v 0.146353 0.464451 -0.050000
-v 0.146353 0.464451 0.050000
-v 0.131745 0.427015 -0.050000
-v 0.131745 0.427015 0.050000
-v 0.113985 0.391704 -0.050000
-v 0.113985 0.391704 0.050000
-v 0.094440 0.358320 -0.050000
-v 0.094440 0.358320 0.050000
-v 0.074396 0.326711 -0.050000
-v 0.074396 0.326711 0.050000
-v 0.055106 0.296807 -0.050000
-v 0.055106 0.296807 0.050000
-v 0.037807 0.268653 -0.050000
-v 0.037807 0.268653 0.050000
-v 0.023701 0.242455 -0.050000
-v 0.023701 0.242455 0.050000
-v 0.013846 0.218606 -0.050000
-v 0.013846 0.218606 0.050000
-v 0.008899 0.197574 -0.050000
-v 0.008899 0.197574 0.050000
-v 0.008815 0.124865 -0.050000
-v 0.008815 0.124865 0.050000
-v -0.046189 0.154407 -0.050000
-v -0.046189 0.154407 0.050000
-v -0.057010 0.161186 -0.050000
-v -0.057010 0.161186 0.050000
-v -0.067039 0.168629 -0.050000
-v -0.067039 0.168629 0.050000
-v -0.076223 0.176837 -0.050000
-v -0.076223 0.176837 0.050000
-v -0.084466 0.185873 -0.050000
-v -0.084466 0.185873 0.050000
-v -0.091644 0.195735 -0.050000
-v -0.091644 0.195735 0.050000
-v -0.097647 0.206349 -0.050000
-v -0.097647 0.206349 0.050000
-v -0.102416 0.217593 -0.050000
-v -0.102416 0.217593 0.050000
-v -0.105962 0.229338 -0.050000
-v -0.105962 0.229338 0.050000
-v -0.108359 0.241494 -0.050000
-v -0.108359 0.241494 0.050000
-v -0.109715 0.254026 -0.050000
-v -0.109715 0.254026 0.050000
-v -0.110170 0.267785 -0.050000
-v -0.110170 0.267785 0.050000
-v -0.107612 0.297714 -0.050000
-v -0.107612 0.297714 0.050000
-v -0.100467 0.326421 -0.050000
-v -0.100467 0.326421 0.050000
-v -0.089996 0.353017 -0.050000
-v -0.089996 0.353017 0.050000
-v -0.077317 0.377712 -0.050000
-v -0.077317 0.377712 0.050000
-v -0.063421 0.400810 -0.050000
-v -0.063421 0.400810 0.050000
-v -0.049194 0.422607 -0.050000
-v -0.049194 0.422607 0.050000
-v -0.035465 0.443334 -0.050000
-v -0.035465 0.443334 0.050000
-v -0.023017 0.463132 -0.050000
-v -0.023017 0.463132 0.050000
-v -0.012579 0.482049 -0.050000
-v -0.012579 0.482049 0.050000
-v -0.004752 0.500069 -0.050000
-v -0.004752 0.500069 0.050000
-v 0.000073 0.517230 -0.050000
-v 0.000073 0.517230 0.050000
-v 0.001791 0.534652 -0.050000
-v 0.001791 0.534652 0.050000
-v 0.001479 0.540334 -0.050000
-v 0.001479 0.540334 0.050000
-v 0.000515 0.545919 -0.050000
-v 0.000515 0.545919 0.050000
-v -0.000953 0.550755 -0.050000
-v -0.000953 0.550755 0.050000
-v -0.002830 0.554900 -0.050000
-v -0.002830 0.554900 0.050000
-v -0.005057 0.558435 -0.050000
-v -0.005057 0.558435 0.050000
-v -0.007620 0.561459 -0.050000
-v -0.007620 0.561459 0.050000
-v -0.010558 0.564059 -0.050000
-v -0.010558 0.564059 0.050000
-v -0.013955 0.566292 -0.050000
-v -0.013955 0.566292 0.050000
-v -0.017918 0.568163 -0.050000
-v -0.017918 0.568163 0.050000
-v -0.022553 0.569629 -0.050000
-v -0.022553 0.569629 0.050000
-v -0.027947 0.570598 -0.050000
-v -0.027947 0.570598 0.050000
-v -0.034738 0.570986 -0.050000
-v -0.034738 0.570986 0.050000
-v -0.038000 0.570932 -0.050000
-v -0.038000 0.570932 0.050000
-v -0.041617 0.570754 -0.050000
-v -0.041617 0.570754 0.050000
-v -0.045021 0.570478 -0.050000
-v -0.045021 0.570478 0.050000
-v -0.048250 0.570119 -0.050000
-v -0.048250 0.570119 0.050000
-v -0.051343 0.569688 -0.050000
-v -0.051343 0.569688 0.050000
-v -0.054343 0.569196 -0.050000
-v -0.054343 0.569196 0.050000
-v -0.057290 0.568650 -0.050000
-v -0.057290 0.568650 0.050000
-v -0.060230 0.568060 -0.050000
-v -0.060230 0.568060 0.050000
-v -0.063205 0.567433 -0.050000
-v -0.063205 0.567433 0.050000
-v -0.066263 0.566781 -0.050000
-v -0.066263 0.566781 0.050000
-v -0.069449 0.566120 -0.050000
-v -0.069449 0.566120 0.050000
-v -0.131521 0.554166 -0.050000
-v -0.131521 0.554166 0.050000
-v -0.049363 0.721979 -0.050000
-v -0.049363 0.721979 0.050000
-v 0.000323 0.719420 0.050000
-v -0.003171 0.689560 0.080000
-v 0.029265 0.714107 0.050000
-v 0.021771 0.684982 0.080000
-v 0.055414 0.705379 0.050000
-v 0.043810 0.677625 0.080000
-v 0.078653 0.693579 0.050000
-v 0.063058 0.667852 0.080000
-v 0.098869 0.679145 0.050000
-v 0.079625 0.656023 0.080000
-v 0.116004 0.662591 0.050000
-v 0.093623 0.642500 0.080000
-v 0.130092 0.644453 0.050000
-v 0.105162 0.627644 0.080000
-v 0.141246 0.625246 0.050000
-v 0.114354 0.611815 0.080000
-v 0.149632 0.605426 0.050000
-v 0.121310 0.595375 0.080000
-v 0.155432 0.585390 0.050000
-v 0.126141 0.578685 0.080000
-v 0.158815 0.565480 0.050000
-v 0.128958 0.562106 0.080000
-v 0.159947 0.545534 0.050000
-v 0.129873 0.546000 0.080000
-v 0.156311 0.504164 0.050000
-v 0.126634 0.509157 0.080000
-v 0.146353 0.464451 0.050000
-v 0.117715 0.473588 0.080000
-v 0.131745 0.427015 0.050000
-v 0.104310 0.439234 0.080000
-v 0.113985 0.391704 0.050000
-v 0.087613 0.406037 0.080000
-v 0.094440 0.358320 0.050000
-v 0.068819 0.373937 0.080000
-v 0.074396 0.326711 0.050000
-v 0.049123 0.342875 0.080000
-v 0.055106 0.296807 0.050000
-v 0.029718 0.312792 0.080000
-v 0.037807 0.268653 0.050000
-v 0.011799 0.283630 0.080000
-v 0.023701 0.242455 0.050000
-v -0.003440 0.255328 0.080000
-v 0.013846 0.218606 0.050000
-v -0.014803 0.227829 0.080000
-v 0.008899 0.197574 0.050000
-v -0.021097 0.201072 0.080000
-v 0.008815 0.124865 0.050000
-v -0.021127 0.175000 0.080000
-v -0.046189 0.154407 0.050000
-v -0.031111 0.180362 0.080000
-v -0.057010 0.161186 0.050000
-v -0.040081 0.185982 0.080000
-v -0.067039 0.168629 0.050000
-v -0.048065 0.191906 0.080000
-v -0.076223 0.176837 0.050000
-v -0.055090 0.198185 0.080000
-v -0.084466 0.185873 0.050000
-v -0.061185 0.204867 0.080000
-v -0.091644 0.195735 0.050000
-v -0.066377 0.212000 0.080000
-v -0.097647 0.206349 0.050000
-v -0.070695 0.219633 0.080000
-v -0.102416 0.217593 0.050000
-v -0.074164 0.227815 0.080000
-v -0.105962 0.229338 0.050000
-v -0.076815 0.236594 0.080000
-v -0.108359 0.241494 0.050000
-v -0.078674 0.246019 0.080000
-v -0.109715 0.254026 0.050000
-v -0.079769 0.256138 0.080000
-v -0.110170 0.267785 0.050000
-v -0.080127 0.267000 0.080000
-v -0.107612 0.297714 0.050000
-v -0.077924 0.292783 0.080000
-v -0.100467 0.326421 0.050000
-v -0.071831 0.317264 0.080000
-v -0.089996 0.353017 0.050000
-v -0.062627 0.340641 0.080000
-v -0.077317 0.377712 0.050000
-v -0.051090 0.363111 0.080000
-v -0.063421 0.400810 0.050000
-v -0.037998 0.384873 0.080000
-v -0.049194 0.422607 0.050000
-v -0.024127 0.406125 0.080000
-v -0.035465 0.443334 0.050000
-v -0.010257 0.427064 0.080000
-v -0.023017 0.463132 0.050000
-v 0.002836 0.447889 0.080000
-v -0.012579 0.482049 0.050000
-v 0.014373 0.468797 0.080000
-v -0.004752 0.500069 0.050000
-v 0.023576 0.489986 0.080000
-v 0.000073 0.517230 0.050000
-v 0.029669 0.511655 0.080000
-v 0.001791 0.534652 0.050000
-v 0.031873 0.534000 0.080000
-v 0.001479 0.540334 0.050000
-v 0.031338 0.543721 0.080000
-v 0.000515 0.545919 0.050000
-v 0.029761 0.552852 0.080000
-v -0.000953 0.550755 0.050000
-v 0.027185 0.561344 0.080000
-v -0.002830 0.554900 0.050000
-v 0.023650 0.569148 0.080000
-v -0.005057 0.558435 0.050000
-v 0.019199 0.576216 0.080000
-v -0.007620 0.561459 0.050000
-v 0.013873 0.582500 0.080000
-v -0.010558 0.564059 0.050000
-v 0.007713 0.587950 0.080000
-v -0.013955 0.566292 0.050000
-v 0.000761 0.592519 0.080000
-v -0.017918 0.568163 0.050000
-v -0.006940 0.596156 0.080000
-v -0.022553 0.569629 0.050000
-v -0.015350 0.598815 0.080000
-v -0.027947 0.570598 0.050000
-v -0.024426 0.600446 0.080000
-v -0.034738 0.570986 0.050000
-v -0.034127 0.601000 0.080000
-v -0.038000 0.570932 0.050000
-v -0.038984 0.600920 0.080000
-v -0.041617 0.570754 0.050000
-v -0.043567 0.600694 0.080000
-v -0.045021 0.570478 0.050000
-v -0.047893 0.600344 0.080000
-v -0.048250 0.570119 0.050000
-v -0.051979 0.599889 0.080000
-v -0.051343 0.569688 0.050000
-v -0.055843 0.599351 0.080000
-v -0.054343 0.569196 0.050000
-v -0.059502 0.598750 0.080000
-v -0.057290 0.568650 0.050000
-v -0.062974 0.598108 0.080000
-v -0.060230 0.568060 0.050000
-v -0.066276 0.597444 0.080000
-v -0.063205 0.567433 0.050000
-v -0.069424 0.596781 0.080000
-v -0.066263 0.566781 0.050000
-v -0.072438 0.596139 0.080000
-v -0.069449 0.566120 0.050000
-v -0.075333 0.595538 0.080000
-v -0.131521 0.554166 0.050000
-v -0.078127 0.595000 0.080000
-v -0.049363 0.721979 0.050000
-v -0.031127 0.691000 0.080000
-v 0.053322 0.042887 -0.080000
-v 0.083116 0.038831 -0.050000
-v 0.051720 0.035097 -0.080000
-v 0.080702 0.027095 -0.050000
-v 0.049138 0.027703 -0.080000
-v 0.076815 0.015962 -0.050000
-v 0.045650 0.020778 -0.080000
-v 0.071576 0.005559 -0.050000
-v 0.041329 0.014394 -0.080000
-v 0.065103 -0.004003 -0.050000
-v 0.036248 0.008625 -0.080000
-v 0.057503 -0.012631 -0.050000
-v 0.030478 0.003543 -0.080000
-v 0.048876 -0.020230 -0.050000
-v 0.024095 -0.000778 -0.080000
-v 0.039313 -0.026703 -0.050000
-v 0.017169 -0.004266 -0.080000
-v 0.028911 -0.031942 -0.050000
-v 0.009775 -0.006847 -0.080000
-v 0.017777 -0.035829 -0.050000
-v 0.001985 -0.008450 -0.080000
-v 0.006041 -0.038243 -0.050000
-v -0.006127 -0.009000 -0.080000
-v -0.006127 -0.039069 -0.050000
-v -0.014240 -0.008450 -0.080000
-v -0.018296 -0.038243 -0.050000
-v -0.022030 -0.006847 -0.080000
-v -0.030032 -0.035829 -0.050000
-v -0.029424 -0.004266 -0.080000
-v -0.041166 -0.031942 -0.050000
-v -0.036350 -0.000778 -0.080000
-v -0.051568 -0.026703 -0.050000
-v -0.042733 0.003543 -0.080000
-v -0.061131 -0.020230 -0.050000
-v -0.048502 0.008625 -0.080000
-v -0.069758 -0.012631 -0.050000
-v -0.053584 0.014394 -0.080000
-v -0.077358 -0.004003 -0.050000
-v -0.057905 0.020778 -0.080000
-v -0.083831 0.005560 -0.050000
-v -0.061393 0.027703 -0.080000
-v -0.089069 0.015962 -0.050000
-v -0.063975 0.035097 -0.080000
-v -0.092957 0.027095 -0.050000
-v -0.065577 0.042887 -0.080000
-v -0.095371 0.038831 -0.050000
-v -0.066127 0.051000 -0.080000
-v -0.096196 0.051000 -0.050000
-v -0.065577 0.059113 -0.080000
-v -0.095371 0.063169 -0.050000
-v -0.063975 0.066903 -0.080000
-v -0.092957 0.074905 -0.050000
-v -0.061393 0.074297 -0.080000
-v -0.089069 0.086038 -0.050000
-v -0.057905 0.081222 -0.080000
-v -0.083831 0.096440 -0.050000
-v -0.053584 0.087606 -0.080000
-v -0.077358 0.106003 -0.050000
-v -0.048502 0.093375 -0.080000
-v -0.069758 0.114631 -0.050000
-v -0.042733 0.098457 -0.080000
-v -0.061131 0.122230 -0.050000
-v -0.036350 0.102778 -0.080000
-v -0.051568 0.128703 -0.050000
-v -0.029424 0.106266 -0.080000
-v -0.041166 0.133942 -0.050000
-v -0.022030 0.108847 -0.080000
-v -0.030032 0.137829 -0.050000
-v -0.014240 0.110450 -0.080000
-v -0.018296 0.140243 -0.050000
-v -0.006127 0.111000 -0.080000
-v -0.006127 0.141069 -0.050000
-v 0.001985 0.110450 -0.080000
-v 0.006041 0.140243 -0.050000
-v 0.009775 0.108847 -0.080000
-v 0.017777 0.137829 -0.050000
-v 0.017169 0.106266 -0.080000
-v 0.028911 0.133942 -0.050000
-v 0.024095 0.102778 -0.080000
-v 0.039313 0.128703 -0.050000
-v 0.030478 0.098457 -0.080000
-v 0.048876 0.122230 -0.050000
-v 0.036248 0.093375 -0.080000
-v 0.057503 0.114631 -0.050000
-v 0.041329 0.087606 -0.080000
-v 0.065103 0.106003 -0.050000
-v 0.045650 0.081222 -0.080000
-v 0.071576 0.096441 -0.050000
-v 0.049138 0.074297 -0.080000
-v 0.076815 0.086038 -0.050000
-v 0.051720 0.066903 -0.080000
-v 0.080702 0.074905 -0.050000
-v 0.053322 0.059113 -0.080000
-v 0.083116 0.063169 -0.050000
-v 0.053873 0.051000 -0.080000
-v 0.083942 0.051000 -0.050000
-v 0.083116 0.038831 -0.050000
-v 0.083116 0.038831 0.050000
-v 0.080702 0.027095 -0.050000
-v 0.080702 0.027095 0.050000
-v 0.076815 0.015962 -0.050000
-v 0.076815 0.015962 0.050000
-v 0.071576 0.005559 -0.050000
-v 0.071576 0.005559 0.050000
-v 0.065103 -0.004003 -0.050000
-v 0.065103 -0.004003 0.050000
-v 0.057503 -0.012631 -0.050000
-v 0.057503 -0.012631 0.050000
-v 0.048876 -0.020230 -0.050000
-v 0.048876 -0.020230 0.050000
-v 0.039313 -0.026703 -0.050000
-v 0.039313 -0.026703 0.050000
-v 0.028911 -0.031942 -0.050000
-v 0.028911 -0.031942 0.050000
-v 0.017777 -0.035829 -0.050000
-v 0.017777 -0.035829 0.050000
-v 0.006041 -0.038243 -0.050000
-v 0.006041 -0.038243 0.050000
-v -0.006127 -0.039069 -0.050000
-v -0.006127 -0.039069 0.050000
-v -0.018296 -0.038243 -0.050000
-v -0.018296 -0.038243 0.050000
-v -0.030032 -0.035829 -0.050000
-v -0.030032 -0.035829 0.050000
-v -0.041166 -0.031942 -0.050000
-v -0.041166 -0.031942 0.050000
-v -0.051568 -0.026703 -0.050000
-v -0.051568 -0.026703 0.050000
-v -0.061131 -0.020230 -0.050000
-v -0.061131 -0.020230 0.050000
-v -0.069758 -0.012631 -0.050000
-v -0.069758 -0.012631 0.050000
-v -0.077358 -0.004003 -0.050000
-v -0.077358 -0.004003 0.050000
-v -0.083831 0.005560 -0.050000
-v -0.083831 0.005560 0.050000
-v -0.089069 0.015962 -0.050000
-v -0.089069 0.015962 0.050000
-v -0.092957 0.027095 -0.050000
-v -0.092957 0.027095 0.050000
-v -0.095371 0.038831 -0.050000
-v -0.095371 0.038831 0.050000
-v -0.096196 0.051000 -0.050000
-v -0.096196 0.051000 0.050000
-v -0.095371 0.063169 -0.050000
-v -0.095371 0.063169 0.050000
-v -0.092957 0.074905 -0.050000
-v -0.092957 0.074905 0.050000
-v -0.089069 0.086038 -0.050000
-v -0.089069 0.086038 0.050000
-v -0.083831 0.096440 -0.050000
-v -0.083831 0.096440 0.050000
-v -0.077358 0.106003 -0.050000
-v -0.077358 0.106003 0.050000
-v -0.069758 0.114631 -0.050000
-v -0.069758 0.114631 0.050000
-v -0.061131 0.122230 -0.050000
-v -0.061131 0.122230 0.050000
-v -0.051568 0.128703 -0.050000
-v -0.051568 0.128703 0.050000
-v -0.041166 0.133942 -0.050000
-v -0.041166 0.133942 0.050000
-v -0.030032 0.137829 -0.050000
-v -0.030032 0.137829 0.050000
-v -0.018296 0.140243 -0.050000
-v -0.018296 0.140243 0.050000
-v -0.006127 0.141069 -0.050000
-v -0.006127 0.141069 0.050000
-v 0.006041 0.140243 -0.050000
-v 0.006041 0.140243 0.050000
-v 0.017777 0.137829 -0.050000
-v 0.017777 0.137829 0.050000
-v 0.028911 0.133942 -0.050000
-v 0.028911 0.133942 0.050000
-v 0.039313 0.128703 -0.050000
-v 0.039313 0.128703 0.050000
-v 0.048876 0.122230 -0.050000
-v 0.048876 0.122230 0.050000
-v 0.057503 0.114631 -0.050000
-v 0.057503 0.114631 0.050000
-v 0.065103 0.106003 -0.050000
-v 0.065103 0.106003 0.050000
-v 0.071576 0.096441 -0.050000
-v 0.071576 0.096441 0.050000
-v 0.076815 0.086038 -0.050000
-v 0.076815 0.086038 0.050000
-v 0.080702 0.074905 -0.050000
-v 0.080702 0.074905 0.050000
-v 0.083116 0.063169 -0.050000
-v 0.083116 0.063169 0.050000
-v 0.083942 0.051000 -0.050000
-v 0.083942 0.051000 0.050000
-v 0.083116 0.038831 0.050000
-v 0.053322 0.042887 0.080000
-v 0.080702 0.027095 0.050000
-v 0.051720 0.035097 0.080000
-v 0.076815 0.015962 0.050000
-v 0.049138 0.027703 0.080000
-v 0.071576 0.005559 0.050000
-v 0.045650 0.020778 0.080000
-v 0.065103 -0.004003 0.050000
-v 0.041329 0.014394 0.080000
-v 0.057503 -0.012631 0.050000
-v 0.036248 0.008625 0.080000
-v 0.048876 -0.020230 0.050000
-v 0.030478 0.003543 0.080000
-v 0.039313 -0.026703 0.050000
-v 0.024095 -0.000778 0.080000
-v 0.028911 -0.031942 0.050000
-v 0.017169 -0.004266 0.080000
-v 0.017777 -0.035829 0.050000
-v 0.009775 -0.006847 0.080000
-v 0.006041 -0.038243 0.050000
-v 0.001985 -0.008450 0.080000
-v -0.006127 -0.039069 0.050000
-v -0.006127 -0.009000 0.080000
-v -0.018296 -0.038243 0.050000
-v -0.014240 -0.008450 0.080000
-v -0.030032 -0.035829 0.050000
-v -0.022030 -0.006847 0.080000
-v -0.041166 -0.031942 0.050000
-v -0.029424 -0.004266 0.080000
-v -0.051568 -0.026703 0.050000
-v -0.036350 -0.000778 0.080000
-v -0.061131 -0.020230 0.050000
-v -0.042733 0.003543 0.080000
-v -0.069758 -0.012631 0.050000
-v -0.048502 0.008625 0.080000
-v -0.077358 -0.004003 0.050000
-v -0.053584 0.014394 0.080000
-v -0.083831 0.005560 0.050000
-v -0.057905 0.020778 0.080000
-v -0.089069 0.015962 0.050000
-v -0.061393 0.027703 0.080000
-v -0.092957 0.027095 0.050000
-v -0.063975 0.035097 0.080000
-v -0.095371 0.038831 0.050000
-v -0.065577 0.042887 0.080000
-v -0.096196 0.051000 0.050000
-v -0.066127 0.051000 0.080000
-v -0.095371 0.063169 0.050000
-v -0.065577 0.059113 0.080000
-v -0.092957 0.074905 0.050000
-v -0.063975 0.066903 0.080000
-v -0.089069 0.086038 0.050000
-v -0.061393 0.074297 0.080000
-v -0.083831 0.096440 0.050000
-v -0.057905 0.081222 0.080000
-v -0.077358 0.106003 0.050000
-v -0.053584 0.087606 0.080000
-v -0.069758 0.114631 0.050000
-v -0.048502 0.093375 0.080000
-v -0.061131 0.122230 0.050000
-v -0.042733 0.098457 0.080000
-v -0.051568 0.128703 0.050000
-v -0.036350 0.102778 0.080000
-v -0.041166 0.133942 0.050000
-v -0.029424 0.106266 0.080000
-v -0.030032 0.137829 0.050000
-v -0.022030 0.108847 0.080000
-v -0.018296 0.140243 0.050000
-v -0.014240 0.110450 0.080000
-v -0.006127 0.141069 0.050000
-v -0.006127 0.111000 0.080000
-v 0.006041 0.140243 0.050000
-v 0.001985 0.110450 0.080000
-v 0.017777 0.137829 0.050000
-v 0.009775 0.108847 0.080000
-v 0.028911 0.133942 0.050000
-v 0.017169 0.106266 0.080000
-v 0.039313 0.128703 0.050000
-v 0.024095 0.102778 0.080000
-v 0.048876 0.122230 0.050000
-v 0.030478 0.098457 0.080000
-v 0.057503 0.114631 0.050000
-v 0.036248 0.093375 0.080000
-v 0.065103 0.106003 0.050000
-v 0.041329 0.087606 0.080000
-v 0.071576 0.096441 0.050000
-v 0.045650 0.081222 0.080000
-v 0.076815 0.086038 0.050000
-v 0.049138 0.074297 0.080000
-v 0.080702 0.074905 0.050000
-v 0.051720 0.066903 0.080000
-v 0.083116 0.063169 0.050000
-v 0.053322 0.059113 0.080000
-v 0.083942 0.051000 0.050000
-v 0.053873 0.051000 0.080000
-vn 0.000000 0.000000 -1.000000
-vn 0.127672 0.695485 -0.707107
-vn 0.223881 0.670729 -0.707107
-vn 0.320134 0.630487 -0.707107
-vn 0.410884 0.575477 -0.707107
-vn 0.491306 0.508545 -0.707107
-vn 0.558442 0.433755 -0.707107
-vn 0.611477 0.355100 -0.707107
-vn 0.651212 0.275541 -0.707107
-vn 0.679224 0.196607 -0.707107
-vn 0.697114 0.118457 -0.707107
-vn 0.705970 0.040078 -0.707107
-vn 0.704391 -0.061914 -0.707107
-vn 0.685873 -0.171985 -0.707107
-vn 0.658733 -0.257043 -0.707107
-vn 0.631707 -0.317720 -0.707107
-vn 0.610213 -0.357268 -0.707107
-vn 0.597167 -0.378671 -0.707107
-vn 0.594208 -0.383298 -0.707107
-vn 0.602464 -0.370185 -0.707107
-vn 0.622595 -0.335225 -0.707107
-vn 0.653510 -0.270046 -0.707107
-vn 0.688319 -0.161915 -0.707107
-vn 0.707106 -0.000816 -0.707107
-vn -0.334581 -0.622941 -0.707107
-vn -0.375391 -0.599234 -0.707107
-vn -0.421387 -0.567832 -0.707107
-vn -0.471203 -0.527226 -0.707107
-vn -0.522413 -0.476534 -0.707107
-vn -0.571694 -0.416132 -0.707107
-vn -0.615486 -0.348106 -0.707107
-vn -0.650982 -0.276085 -0.707107
-vn -0.676928 -0.204373 -0.707107
-vn -0.693743 -0.136823 -0.707107
-vn -0.703004 -0.076066 -0.707107
-vn -0.706721 -0.023344 -0.707107
-vn -0.704538 0.060218 -0.707107
-vn -0.686176 0.170769 -0.707107
-vn -0.657949 0.259043 -0.707107
-vn -0.629040 0.322969 -0.707107
-vn -0.605905 0.364526 -0.707107
-vn -0.592146 0.386476 -0.707107
-vn -0.589504 0.390494 -0.707107
-vn -0.598626 0.376360 -0.707107
-vn -0.619107 0.341623 -0.707107
-vn -0.648567 0.281710 -0.707107
-vn -0.680710 0.191398 -0.707107
-vn -0.703693 0.069398 -0.707107
-vn -0.706039 -0.038837 -0.707107
-vn -0.696798 -0.120300 -0.707107
-vn -0.676650 -0.205291 -0.707107
-vn -0.644121 -0.291732 -0.707107
-vn -0.598339 -0.376816 -0.707107
-vn -0.539392 -0.457226 -0.707107
-vn -0.468571 -0.529567 -0.707107
-vn -0.388341 -0.590924 -0.707107
-vn -0.302004 -0.639369 -0.707107
-vn -0.213141 -0.674219 -0.707107
-vn -0.125044 -0.695963 -0.707107
-vn -0.040341 -0.705955 -0.707107
-vn 0.011616 -0.707011 -0.707107
-vn 0.034787 -0.706250 -0.707107
-vn 0.057139 -0.704794 -0.707107
-vn 0.078224 -0.702767 -0.707107
-vn 0.097545 -0.700347 -0.707107
-vn 0.114549 -0.697767 -0.707107
-vn 0.128653 -0.695305 -0.707107
-vn 0.139265 -0.693257 -0.707107
-vn 0.145742 -0.691924 -0.707107
-vn 0.147420 -0.691569 -0.707107
-vn 0.143653 -0.692361 -0.707107
-vn 0.133716 -0.694348 -0.707107
-vn -0.635080 0.310924 -0.707107
-vn 0.036369 0.706171 -0.707107
-vn 0.180556 0.983565 0.000000
-vn 0.316616 0.948554 0.000000
-vn 0.452737 0.891644 0.000000
-vn 0.581077 0.813848 0.000000
-vn 0.694812 0.719191 0.000000
-vn 0.789755 0.613422 0.000000
-vn 0.864760 0.502186 0.000000
-vn 0.920953 0.389674 0.000000
-vn 0.960568 0.278045 0.000000
-vn 0.985868 0.167523 0.000000
-vn 0.998393 0.056679 0.000000
-vn 0.996159 -0.087559 0.000000
-vn 0.969970 -0.243223 0.000000
-vn 0.931589 -0.363514 0.000000
-vn 0.893369 -0.449324 0.000000
-vn 0.862971 -0.505253 0.000000
-vn 0.844521 -0.535522 0.000000
-vn 0.840337 -0.542065 0.000000
-vn 0.852013 -0.523520 0.000000
-vn 0.880482 -0.474079 0.000000
-vn 0.924202 -0.381903 0.000000
-vn 0.973430 -0.228983 0.000000
-vn 0.999999 -0.001154 0.000000
-vn -0.473169 -0.880972 0.000000
-vn -0.530883 -0.847445 0.000000
-vn -0.595932 -0.803035 0.000000
-vn -0.666382 -0.745611 0.000000
-vn -0.738804 -0.673921 0.000000
-vn -0.808497 -0.588500 0.000000
-vn -0.870428 -0.492296 0.000000
-vn -0.920627 -0.390443 0.000000
-vn -0.957321 -0.289027 0.000000
-vn -0.981101 -0.193496 0.000000
-vn -0.994197 -0.107573 0.000000
-vn -0.999455 -0.033014 0.000000
-vn -0.996367 0.085161 0.000000
-vn -0.970400 0.241504 0.000000
-vn -0.930480 0.366341 0.000000
-vn -0.889597 0.456746 0.000000
-vn -0.856879 0.515517 0.000000
-vn -0.837421 0.546559 0.000000
-vn -0.833684 0.552242 0.000000
-vn -0.846585 0.532254 0.000000
-vn -0.875550 0.483128 0.000000
-vn -0.917213 0.398398 0.000000
-vn -0.962670 0.270678 0.000000
-vn -0.995172 0.098143 0.000000
-vn -0.998491 -0.054924 0.000000
-vn -0.985421 -0.170131 0.000000
-vn -0.956929 -0.290322 0.000000
-vn -0.910924 -0.412573 0.000000
-vn -0.846179 -0.532899 0.000000
-vn -0.762815 -0.646617 0.000000
-vn -0.662658 -0.748922 0.000000
-vn -0.549199 -0.835691 0.000000
-vn -0.427098 -0.904205 0.000000
-vn -0.301430 -0.953488 0.000000
-vn -0.176835 -0.984241 0.000000
-vn -0.057051 -0.998371 0.000000
-vn 0.016423 -0.999865 0.000000
-vn 0.049198 -0.998789 0.000000
-vn 0.080803 -0.996730 0.000000
-vn 0.110622 -0.993863 0.000000
-vn 0.137952 -0.990439 0.000000
-vn 0.161999 -0.986791 0.000000
-vn 0.181943 -0.983309 0.000000
-vn 0.196952 -0.980413 0.000000
-vn 0.206113 -0.978528 0.000000
-vn 0.208477 -0.978027 0.000000
-vn 0.203161 -0.979145 0.000000
-vn 0.189103 -0.981957 0.000000
-vn -0.898138 0.439713 0.000000
-vn 0.051434 0.998676 0.000000
-vn 0.127672 0.695485 0.707107
-vn 0.223881 0.670729 0.707107
-vn 0.320134 0.630487 0.707107
-vn 0.410884 0.575477 0.707107
-vn 0.491306 0.508545 0.707107
-vn 0.558442 0.433755 0.707107
-vn 0.611477 0.355100 0.707107
-vn 0.651212 0.275541 0.707107
-vn 0.679224 0.196607 0.707107
-vn 0.697114 0.118457 0.707107
-vn 0.705970 0.040078 0.707107
-vn 0.704391 -0.061914 0.707107
-vn 0.685873 -0.171985 0.707107
-vn 0.658733 -0.257043 0.707107
-vn 0.631707 -0.317720 0.707107
-vn 0.610213 -0.357268 0.707107
-vn 0.597167 -0.378671 0.707107
-vn 0.594208 -0.383298 0.707107
-vn 0.602464 -0.370185 0.707107
-vn 0.622595 -0.335225 0.707107
-vn 0.653510 -0.270046 0.707107
-vn 0.688319 -0.161915 0.707107
-vn 0.707106 -0.000816 0.707107
-vn -0.334581 -0.622941 0.707107
-vn -0.375391 -0.599234 0.707107
-vn -0.421387 -0.567832 0.707107
-vn -0.471203 -0.527226 0.707107
-vn -0.522413 -0.476534 0.707107
-vn -0.571694 -0.416132 0.707107
-vn -0.615486 -0.348106 0.707107
-vn -0.650982 -0.276085 0.707107
-vn -0.676928 -0.204373 0.707107
-vn -0.693743 -0.136823 0.707107
-vn -0.703004 -0.076066 0.707107
-vn -0.706721 -0.023344 0.707107
-vn -0.704538 0.060218 0.707107
-vn -0.686176 0.170769 0.707107
-vn -0.657949 0.259043 0.707107
-vn -0.629040 0.322969 0.707107
-vn -0.605905 0.364526 0.707107
-vn -0.592146 0.386476 0.707107
-vn -0.589504 0.390494 0.707107
-vn -0.598626 0.376360 0.707107
-vn -0.619107 0.341623 0.707107
-vn -0.648567 0.281710 0.707107
-vn -0.680710 0.191398 0.707107
-vn -0.703693 0.069398 0.707107
-vn -0.706039 -0.038837 0.707107
-vn -0.696798 -0.120300 0.707107
-vn -0.676650 -0.205291 0.707107
-vn -0.644121 -0.291732 0.707107
-vn -0.598339 -0.376816 0.707107
-vn -0.539392 -0.457226 0.707107
-vn -0.468571 -0.529567 0.707107
-vn -0.388341 -0.590924 0.707107
-vn -0.302004 -0.639369 0.707107
-vn -0.213141 -0.674219 0.707107
-vn -0.125044 -0.695963 0.707107
-vn -0.040341 -0.705955 0.707107
-vn 0.011616 -0.707011 0.707107
-vn 0.034787 -0.706250 0.707107
-vn 0.057139 -0.704794 0.707107
-vn 0.078224 -0.702767 0.707107
-vn 0.097545 -0.700347 0.707107
-vn 0.114549 -0.697767 0.707107
-vn 0.128653 -0.695305 0.707107
-vn 0.139265 -0.693257 0.707107
-vn 0.145742 -0.691924 0.707107
-vn 0.147420 -0.691569 0.707107
-vn 0.143653 -0.692361 0.707107
-vn 0.133716 -0.694348 0.707107
-vn -0.635080 0.310924 0.707107
-vn 0.036369 0.706171 0.707107
-vn 0.692605 -0.142472 -0.707107
-vn 0.667587 -0.233084 -0.707107
-vn 0.631534 -0.318063 -0.707107
-vn 0.585565 -0.396376 -0.707107
-vn 0.530616 -0.467383 -0.707107
-vn 0.467382 -0.530616 -0.707107
-vn 0.396375 -0.585566 -0.707107
-vn 0.318063 -0.631535 -0.707107
-vn 0.233084 -0.667587 -0.707107
-vn 0.142472 -0.692605 -0.707107
-vn 0.047858 -0.705485 -0.707107
-vn -0.047858 -0.705485 -0.707107
-vn -0.142473 -0.692605 -0.707107
-vn -0.233083 -0.667587 -0.707107
-vn -0.318063 -0.631535 -0.707107
-vn -0.396375 -0.585565 -0.707107
-vn -0.467383 -0.530616 -0.707107
-vn -0.530616 -0.467383 -0.707107
-vn -0.585565 -0.396375 -0.707107
-vn -0.631535 -0.318063 -0.707107
-vn -0.667587 -0.233083 -0.707107
-vn -0.692605 -0.142473 -0.707107
-vn -0.705485 -0.047858 -0.707107
-vn -0.705485 0.047859 -0.707107
-vn -0.692605 0.142473 -0.707107
-vn -0.667587 0.233083 -0.707107
-vn -0.631535 0.318063 -0.707107
-vn -0.585565 0.396375 -0.707107
-vn -0.530616 0.467383 -0.707107
-vn -0.467383 0.530616 -0.707107
-vn -0.396375 0.585565 -0.707107
-vn -0.318063 0.631535 -0.707107
-vn -0.233083 0.667587 -0.707107
-vn -0.142473 0.692605 -0.707107
-vn -0.047858 0.705485 -0.707107
-vn 0.047860 0.705485 -0.707107
-vn 0.142472 0.692605 -0.707107
-vn 0.233083 0.667587 -0.707107
-vn 0.318063 0.631535 -0.707107
-vn 0.396375 0.585566 -0.707107
-vn 0.467382 0.530616 -0.707107
-vn 0.530616 0.467383 -0.707107
-vn 0.585565 0.396376 -0.707107
-vn 0.631534 0.318063 -0.707107
-vn 0.667587 0.233084 -0.707107
-vn 0.692605 0.142472 -0.707107
-vn 0.705485 0.047858 -0.707107
-vn 0.705485 -0.047858 -0.707107
-vn 0.979491 -0.201486 0.000000
-vn 0.944110 -0.329630 0.000000
-vn 0.893125 -0.449810 0.000000
-vn 0.828114 -0.560560 0.000000
-vn 0.750404 -0.660979 0.000000
-vn 0.660978 -0.750405 0.000000
-vn 0.560559 -0.828115 0.000000
-vn 0.449809 -0.893125 0.000000
-vn 0.329630 -0.944110 0.000000
-vn 0.201486 -0.979491 0.000000
-vn 0.067681 -0.997707 0.000000
-vn -0.067682 -0.997707 0.000000
-vn -0.201487 -0.979491 0.000000
-vn -0.329629 -0.944111 0.000000
-vn -0.449809 -0.893125 0.000000
-vn -0.560559 -0.828114 0.000000
-vn -0.660979 -0.750404 0.000000
-vn -0.750404 -0.660980 0.000000
-vn -0.828114 -0.560559 0.000000
-vn -0.893125 -0.449809 0.000000
-vn -0.944110 -0.329630 0.000000
-vn -0.979491 -0.201486 0.000000
-vn -0.997707 -0.067681 0.000000
-vn -0.997707 0.067682 0.000000
-vn -0.979491 0.201487 0.000000
-vn -0.944110 0.329630 0.000000
-vn -0.893125 0.449809 0.000000
-vn -0.828114 0.560559 0.000000
-vn -0.750404 0.660979 0.000000
-vn -0.660980 0.750404 0.000000
-vn -0.560560 0.828114 0.000000
-vn -0.449809 0.893125 0.000000
-vn -0.329630 0.944110 0.000000
-vn -0.201487 0.979491 0.000000
-vn -0.067681 0.997707 0.000000
-vn 0.067684 0.997707 0.000000
-vn 0.201487 0.979491 0.000000
-vn 0.329629 0.944110 0.000000
-vn 0.449809 0.893125 0.000000
-vn 0.560559 0.828115 0.000000
-vn 0.660979 0.750405 0.000000
-vn 0.750404 0.660979 0.000000
-vn 0.828114 0.560560 0.000000
-vn 0.893125 0.449809 0.000000
-vn 0.944110 0.329630 0.000000
-vn 0.979491 0.201486 0.000000
-vn 0.997707 0.067681 0.000000
-vn 0.997707 -0.067681 0.000000
-vn 0.692605 -0.142472 0.707107
-vn 0.667587 -0.233084 0.707107
-vn 0.631534 -0.318063 0.707107
-vn 0.585565 -0.396376 0.707107
-vn 0.530616 -0.467383 0.707107
-vn 0.467382 -0.530616 0.707107
-vn 0.396375 -0.585566 0.707107
-vn 0.318063 -0.631535 0.707107
-vn 0.233084 -0.667587 0.707107
-vn 0.142472 -0.692605 0.707107
-vn 0.047858 -0.705485 0.707107
-vn -0.047858 -0.705485 0.707107
-vn -0.142473 -0.692605 0.707107
-vn -0.233083 -0.667587 0.707107
-vn -0.318063 -0.631535 0.707107
-vn -0.396375 -0.585565 0.707107
-vn -0.467383 -0.530616 0.707107
-vn -0.530616 -0.467383 0.707107
-vn -0.585565 -0.396375 0.707107
-vn -0.631535 -0.318063 0.707107
-vn -0.667587 -0.233083 0.707107
-vn -0.692605 -0.142473 0.707107
-vn -0.705485 -0.047858 0.707107
-vn -0.705485 0.047859 0.707107
-vn -0.692605 0.142473 0.707107
-vn -0.667587 0.233083 0.707107
-vn -0.631535 0.318063 0.707107
-vn -0.585565 0.396375 0.707107
-vn -0.530616 0.467383 0.707107
-vn -0.467383 0.530616 0.707107
-vn -0.396375 0.585565 0.707107
-vn -0.318063 0.631535 0.707107
-vn -0.233083 0.667587 0.707107
-vn -0.142473 0.692605 0.707107
-vn -0.047858 0.705485 0.707107
-vn 0.047860 0.705485 0.707107
-vn 0.142472 0.692605 0.707107
-vn 0.233083 0.667587 0.707107
-vn 0.318063 0.631535 0.707107
-vn 0.396375 0.585566 0.707107
-vn 0.467382 0.530616 0.707107
-vn 0.530616 0.467383 0.707107
-vn 0.585565 0.396376 0.707107
-vn 0.631534 0.318063 0.707107
-vn 0.667587 0.233084 0.707107
-vn 0.692605 0.142472 0.707107
-vn 0.705485 0.047858 0.707107
-vn 0.705485 -0.047858 0.707107
-usemtl (null)
-usemtl (null)
-s 1
-f 120//1 121//1 49//1
-f 120//1 49//1 50//1
-f 120//1 50//1 51//1
-f 120//1 51//1 52//1
-f 120//1 52//1 53//1
-f 120//1 53//1 54//1
-f 120//1 54//1 116//1
-f 116//1 54//1 115//1
-f 115//1 54//1 114//1
-f 114//1 54//1 113//1
-f 113//1 54//1 112//1
-f 112//1 54//1 55//1
-f 112//1 55//1 111//1
-f 111//1 55//1 110//1
-f 110//1 55//1 109//1
-f 109//1 55//1 56//1
-f 109//1 56//1 108//1
-f 108//1 56//1 57//1
-f 107//1 108//1 57//1
-f 106//1 107//1 57//1
-f 105//1 106//1 57//1
-f 120//1 116//1 117//1
-f 120//1 117//1 118//1
-f 104//1 105//1 57//1
-f 120//1 118//1 119//1
-f 104//1 57//1 58//1
-f 103//1 104//1 58//1
-f 102//1 103//1 58//1
-f 101//1 102//1 58//1
-f 101//1 58//1 59//1
-f 100//1 101//1 59//1
-f 99//1 100//1 59//1
-f 99//1 59//1 60//1
-f 98//1 99//1 60//1
-f 97//1 98//1 60//1
-f 97//1 60//1 61//1
-f 96//1 97//1 61//1
-f 95//1 96//1 61//1
-f 94//1 95//1 61//1
-f 94//1 61//1 62//1
-f 93//1 94//1 62//1
-f 93//1 62//1 63//1
-f 92//1 93//1 63//1
-f 91//1 92//1 63//1
-f 91//1 63//1 64//1
-f 90//1 91//1 64//1
-f 89//1 90//1 64//1
-f 89//1 64//1 65//1
-f 88//1 89//1 65//1
-f 88//1 65//1 66//1
-f 87//1 88//1 66//1
-f 87//1 66//1 67//1
-f 86//1 87//1 67//1
-f 85//1 86//1 67//1
-f 85//1 67//1 68//1
-f 84//1 85//1 68//1
-f 84//1 68//1 69//1
-f 83//1 84//1 69//1
-f 82//1 83//1 69//1
-f 82//1 69//1 70//1
-f 81//1 82//1 70//1
-f 80//1 81//1 70//1
-f 80//1 70//1 71//1
-f 79//1 80//1 71//1
-f 78//1 79//1 71//1
-f 77//1 78//1 71//1
-f 76//1 77//1 71//1
-f 76//1 71//1 72//1
-f 75//1 76//1 72//1
-f 74//1 75//1 72//1
-f 73//1 74//1 72//1
-f 35//1 36//1 37//1
-f 34//1 35//1 37//1
-f 34//1 37//1 38//1
-f 33//1 34//1 38//1
-f 33//1 38//1 39//1
-f 32//1 33//1 39//1
-f 32//1 39//1 40//1
-f 31//1 32//1 40//1
-f 31//1 40//1 41//1
-f 30//1 31//1 41//1
-f 30//1 41//1 42//1
-f 29//1 30//1 42//1
-f 29//1 42//1 43//1
-f 28//1 29//1 43//1
-f 28//1 43//1 44//1
-f 27//1 28//1 44//1
-f 27//1 44//1 45//1
-f 26//1 27//1 45//1
-f 26//1 45//1 46//1
-f 25//1 26//1 46//1
-f 25//1 46//1 47//1
-f 25//1 47//1 48//1
-f 24//1 25//1 48//1
-f 23//1 24//1 48//1
-f 48//1 1//1 23//1
-f 23//1 1//1 22//1
-f 22//1 1//1 2//1
-f 21//1 22//1 2//1
-f 21//1 2//1 3//1
-f 20//1 21//1 3//1
-f 20//1 3//1 4//1
-f 19//1 20//1 4//1
-f 19//1 4//1 5//1
-f 18//1 19//1 5//1
-f 18//1 5//1 6//1
-f 17//1 18//1 6//1
-f 17//1 6//1 7//1
-f 16//1 17//1 7//1
-f 16//1 7//1 8//1
-f 15//1 16//1 8//1
-f 15//1 8//1 9//1
-f 14//1 15//1 9//1
-f 14//1 9//1 10//1
-f 13//1 14//1 10//1
-f 13//1 10//1 11//1
-f 12//1 13//1 11//1
-f 241//1 242//1 170//1
-f 241//1 170//1 171//1
-f 241//1 171//1 172//1
-f 241//1 172//1 173//1
-f 241//1 173//1 174//1
-f 241//1 174//1 175//1
-f 241//1 175//1 237//1
-f 237//1 175//1 236//1
-f 236//1 175//1 235//1
-f 235//1 175//1 234//1
-f 234//1 175//1 233//1
-f 233//1 175//1 176//1
-f 233//1 176//1 232//1
-f 232//1 176//1 231//1
-f 231//1 176//1 230//1
-f 230//1 176//1 177//1
-f 230//1 177//1 229//1
-f 229//1 177//1 178//1
-f 228//1 229//1 178//1
-f 227//1 228//1 178//1
-f 226//1 227//1 178//1
-f 241//1 237//1 238//1
-f 241//1 238//1 239//1
-f 225//1 226//1 178//1
-f 241//1 239//1 240//1
-f 225//1 178//1 179//1
-f 224//1 225//1 179//1
-f 223//1 224//1 179//1
-f 222//1 223//1 179//1
-f 222//1 179//1 180//1
-f 221//1 222//1 180//1
-f 220//1 221//1 180//1
-f 220//1 180//1 181//1
-f 219//1 220//1 181//1
-f 218//1 219//1 181//1
-f 218//1 181//1 182//1
-f 217//1 218//1 182//1
-f 216//1 217//1 182//1
-f 215//1 216//1 182//1
-f 215//1 182//1 183//1
-f 214//1 215//1 183//1
-f 214//1 183//1 184//1
-f 213//1 214//1 184//1
-f 212//1 213//1 184//1
-f 212//1 184//1 185//1
-f 211//1 212//1 185//1
-f 210//1 211//1 185//1
-f 210//1 185//1 186//1
-f 209//1 210//1 186//1
-f 209//1 186//1 187//1
-f 208//1 209//1 187//1
-f 208//1 187//1 188//1
-f 207//1 208//1 188//1
-f 206//1 207//1 188//1
-f 206//1 188//1 189//1
-f 205//1 206//1 189//1
-f 205//1 189//1 190//1
-f 204//1 205//1 190//1
-f 203//1 204//1 190//1
-f 203//1 190//1 191//1
-f 202//1 203//1 191//1
-f 201//1 202//1 191//1
-f 201//1 191//1 192//1
-f 200//1 201//1 192//1
-f 199//1 200//1 192//1
-f 198//1 199//1 192//1
...
[truncated message content] |
|
From: <tre...@us...> - 2007-08-28 23:47:54
|
Revision: 284
http://ogoglio.svn.sourceforge.net/ogoglio/?rev=284&view=rev
Author: trevorolio
Date: 2007-08-28 16:47:54 -0700 (Tue, 28 Aug 2007)
Log Message:
-----------
Moved body applet specific images into the body applet resources.
Modified Paths:
--------------
maven/trunk/ogoglio-body-editor-applet/src/main/java/com/ogoglio/bodyeditor/BodyEditorApplet.java
Added Paths:
-----------
maven/trunk/ogoglio-body-editor-applet/src/main/resources/images/
maven/trunk/ogoglio-body-editor-applet/src/main/resources/images/LeftArrow.gif
maven/trunk/ogoglio-body-editor-applet/src/main/resources/images/LeftArrowDisabled.gif
maven/trunk/ogoglio-body-editor-applet/src/main/resources/images/RightArrow.gif
maven/trunk/ogoglio-body-editor-applet/src/main/resources/images/RightArrowDisabled.gif
Modified: maven/trunk/ogoglio-body-editor-applet/src/main/java/com/ogoglio/bodyeditor/BodyEditorApplet.java
===================================================================
--- maven/trunk/ogoglio-body-editor-applet/src/main/java/com/ogoglio/bodyeditor/BodyEditorApplet.java 2007-08-28 23:47:29 UTC (rev 283)
+++ maven/trunk/ogoglio-body-editor-applet/src/main/java/com/ogoglio/bodyeditor/BodyEditorApplet.java 2007-08-28 23:47:54 UTC (rev 284)
@@ -68,13 +68,13 @@
public class BodyEditorApplet extends Applet {
- public static final ImageIcon LEFT_ARROW = UIConstants.loadIconFromResource("avatar/LeftArrow.gif");
+ public static final ImageIcon LEFT_ARROW = UIConstants.loadIconFromResource("images/LeftArrow.gif");
- public static final ImageIcon LEFT_ARROW_DISABLED = UIConstants.loadIconFromResource("avatar/LeftArrowDisabled.gif");
+ public static final ImageIcon LEFT_ARROW_DISABLED = UIConstants.loadIconFromResource("images/LeftArrowDisabled.gif");
- public static final ImageIcon RIGHT_ARROW = UIConstants.loadIconFromResource("avatar/RightArrow.gif");
+ public static final ImageIcon RIGHT_ARROW = UIConstants.loadIconFromResource("images/RightArrow.gif");
- public static final ImageIcon RIGHT_ARROW_DISABLED = UIConstants.loadIconFromResource("avatar/RightArrowDisabled.gif");
+ public static final ImageIcon RIGHT_ARROW_DISABLED = UIConstants.loadIconFromResource("images/RightArrowDisabled.gif");
private RowModel hairRowModel = null;
Added: maven/trunk/ogoglio-body-editor-applet/src/main/resources/images/LeftArrow.gif
===================================================================
(Binary files differ)
Property changes on: maven/trunk/ogoglio-body-editor-applet/src/main/resources/images/LeftArrow.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: maven/trunk/ogoglio-body-editor-applet/src/main/resources/images/LeftArrowDisabled.gif
===================================================================
(Binary files differ)
Property changes on: maven/trunk/ogoglio-body-editor-applet/src/main/resources/images/LeftArrowDisabled.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: maven/trunk/ogoglio-body-editor-applet/src/main/resources/images/RightArrow.gif
===================================================================
(Binary files differ)
Property changes on: maven/trunk/ogoglio-body-editor-applet/src/main/resources/images/RightArrow.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: maven/trunk/ogoglio-body-editor-applet/src/main/resources/images/RightArrowDisabled.gif
===================================================================
(Binary files differ)
Property changes on: maven/trunk/ogoglio-body-editor-applet/src/main/resources/images/RightArrowDisabled.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <tre...@us...> - 2007-08-28 23:47:30
|
Revision: 283
http://ogoglio.svn.sourceforge.net/ogoglio/?rev=283&view=rev
Author: trevorolio
Date: 2007-08-28 16:47:29 -0700 (Tue, 28 Aug 2007)
Log Message:
-----------
Removed some debug printlns.
Modified Paths:
--------------
maven/trunk/ogoglio-appdev/src/main/java/com/ogoglio/appdev/migrate/DBVersionPersistTasks.java
maven/trunk/ogoglio-appdev/src/main/java/com/ogoglio/appdev/servlet/MigratedResourceServlet.java
Modified: maven/trunk/ogoglio-appdev/src/main/java/com/ogoglio/appdev/migrate/DBVersionPersistTasks.java
===================================================================
--- maven/trunk/ogoglio-appdev/src/main/java/com/ogoglio/appdev/migrate/DBVersionPersistTasks.java 2007-08-28 22:50:10 UTC (rev 282)
+++ maven/trunk/ogoglio-appdev/src/main/java/com/ogoglio/appdev/migrate/DBVersionPersistTasks.java 2007-08-28 23:47:29 UTC (rev 283)
@@ -28,7 +28,7 @@
int size = query.list().size();
DBVersionRecord rec;
if (expectedSize != size) {
- System.out.println("Whoa! Size of returned result for db version record was (" + size + ") but should have been " + expectedSize + "!");
+ System.err.println("Whoa! Size of returned result for db version record was (" + size + ") but should have been " + expectedSize + "!");
return Boolean.FALSE;
}
if (size == 0) {
@@ -38,7 +38,6 @@
}
rec.setVersion(newVersion);
session.saveOrUpdate(rec);
- System.out.println("******* Wrote new version FART:" + newVersion);
return Boolean.TRUE;
}
};
Modified: maven/trunk/ogoglio-appdev/src/main/java/com/ogoglio/appdev/servlet/MigratedResourceServlet.java
===================================================================
--- maven/trunk/ogoglio-appdev/src/main/java/com/ogoglio/appdev/servlet/MigratedResourceServlet.java 2007-08-28 22:50:10 UTC (rev 282)
+++ maven/trunk/ogoglio-appdev/src/main/java/com/ogoglio/appdev/servlet/MigratedResourceServlet.java 2007-08-28 23:47:29 UTC (rev 283)
@@ -20,7 +20,6 @@
initBaseUrl();
Context envCtx = (Context) initCtx.lookup("java:comp/env");
hibernateSessionFactory = getOrCreateHibernateSessionFactory(config,envCtx);
- System.out.println("FART****:"+getClass().getName()+","+(hibernateSessionFactory==null));
if (hibernateSessionFactory==null) {
throw new IllegalStateException("Unable to create sensible hibernate configuration!");
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ian...@us...> - 2007-08-28 22:50:17
|
Revision: 282
http://ogoglio.svn.sourceforge.net/ogoglio/?rev=282&view=rev
Author: iansmith
Date: 2007-08-28 15:50:10 -0700 (Tue, 28 Aug 2007)
Log Message:
-----------
First cut at moving app independent code out of ogoglio server.
Added Paths:
-----------
maven/trunk/ogoglio-appdev/.classpath
maven/trunk/ogoglio-appdev/.project
maven/trunk/ogoglio-appdev/.settings/
maven/trunk/ogoglio-appdev/.settings/org.eclipse.jdt.core.prefs
maven/trunk/ogoglio-appdev/pom.xml
maven/trunk/ogoglio-appdev/src/
maven/trunk/ogoglio-appdev/src/main/
maven/trunk/ogoglio-appdev/src/main/java/
maven/trunk/ogoglio-appdev/src/main/java/com/
maven/trunk/ogoglio-appdev/src/main/java/com/ogoglio/
maven/trunk/ogoglio-appdev/src/main/java/com/ogoglio/appdev/
maven/trunk/ogoglio-appdev/src/main/java/com/ogoglio/appdev/migrate/
maven/trunk/ogoglio-appdev/src/main/java/com/ogoglio/appdev/migrate/DBVersionPersistTasks.java
maven/trunk/ogoglio-appdev/src/main/java/com/ogoglio/appdev/migrate/DBVersionRecord.java
maven/trunk/ogoglio-appdev/src/main/java/com/ogoglio/appdev/migrate/Migration.java
maven/trunk/ogoglio-appdev/src/main/java/com/ogoglio/appdev/migrate/MigrationSupport.java
maven/trunk/ogoglio-appdev/src/main/java/com/ogoglio/appdev/migrate/test/
maven/trunk/ogoglio-appdev/src/main/java/com/ogoglio/appdev/migrate/test/DBZapTest.java
maven/trunk/ogoglio-appdev/src/main/java/com/ogoglio/appdev/persist/
maven/trunk/ogoglio-appdev/src/main/java/com/ogoglio/appdev/persist/HibernateTask.java
maven/trunk/ogoglio-appdev/src/main/java/com/ogoglio/appdev/persist/PersistException.java
maven/trunk/ogoglio-appdev/src/main/java/com/ogoglio/appdev/servlet/
maven/trunk/ogoglio-appdev/src/main/java/com/ogoglio/appdev/servlet/AbstractRemoteServlet.java
maven/trunk/ogoglio-appdev/src/main/java/com/ogoglio/appdev/servlet/AbstractResourceServlet.java
maven/trunk/ogoglio-appdev/src/main/java/com/ogoglio/appdev/servlet/DescendingSiteResource.java
maven/trunk/ogoglio-appdev/src/main/java/com/ogoglio/appdev/servlet/MigratedResourceServlet.java
maven/trunk/ogoglio-appdev/src/main/java/com/ogoglio/appdev/servlet/SiteResource.java
maven/trunk/ogoglio-appdev/src/main/resources/
maven/trunk/ogoglio-appdev/src/test/
maven/trunk/ogoglio-appdev/src/test/java/
maven/trunk/ogoglio-appdev/src/test/resources/
Property Changed:
----------------
maven/trunk/ogoglio-appdev/
Property changes on: maven/trunk/ogoglio-appdev
___________________________________________________________________
Name: svn:ignore
+ target
Added: maven/trunk/ogoglio-appdev/.classpath
===================================================================
--- maven/trunk/ogoglio-appdev/.classpath (rev 0)
+++ maven/trunk/ogoglio-appdev/.classpath 2007-08-28 22:50:10 UTC (rev 282)
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" path="src/main/java"/>
+ <classpathentry kind="src" path="src/test/java"/>
+ <classpathentry excluding="**" kind="src" output="src/main/resources" path="src/main/resources"/>
+ <classpathentry excluding="**" kind="src" output="src/test/resources" path="src/test/resources"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+ <classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>
+ <classpathentry kind="output" path="target/classes"/>
+</classpath>
Added: maven/trunk/ogoglio-appdev/.project
===================================================================
--- maven/trunk/ogoglio-appdev/.project (rev 0)
+++ maven/trunk/ogoglio-appdev/.project 2007-08-28 22:50:10 UTC (rev 282)
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>ogoglio-appdev</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.maven.ide.eclipse.maven2Builder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ <nature>org.maven.ide.eclipse.maven2Nature</nature>
+ </natures>
+</projectDescription>
Added: maven/trunk/ogoglio-appdev/.settings/org.eclipse.jdt.core.prefs
===================================================================
--- maven/trunk/ogoglio-appdev/.settings/org.eclipse.jdt.core.prefs (rev 0)
+++ maven/trunk/ogoglio-appdev/.settings/org.eclipse.jdt.core.prefs 2007-08-28 22:50:10 UTC (rev 282)
@@ -0,0 +1,12 @@
+#Tue Aug 28 08:20:12 PDT 2007
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.2
+org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
+org.eclipse.jdt.core.compiler.compliance=1.4
+org.eclipse.jdt.core.compiler.debug.lineNumber=generate
+org.eclipse.jdt.core.compiler.debug.localVariable=generate
+org.eclipse.jdt.core.compiler.debug.sourceFile=generate
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=warning
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=warning
+org.eclipse.jdt.core.compiler.source=1.3
Added: maven/trunk/ogoglio-appdev/pom.xml
===================================================================
--- maven/trunk/ogoglio-appdev/pom.xml (rev 0)
+++ maven/trunk/ogoglio-appdev/pom.xml 2007-08-28 22:50:10 UTC (rev 282)
@@ -0,0 +1,44 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>com.ogoglio</groupId>
+ <artifactId>ogoglio-appdev</artifactId>
+ <version>0.0.1</version>
+ <packaging>jar</packaging>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.hibernate</groupId>
+ <artifactId>hibernate</artifactId>
+ <version>3.2.1.ga</version>
+ </dependency>
+ <dependency>
+ <groupId>javax.servlet</groupId>
+ <artifactId>servlet-api</artifactId>
+ <version>2.3</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>commons-fileupload</groupId>
+ <artifactId>commons-fileupload</artifactId>
+ <version>1.2</version>
+ </dependency>
+ <dependency>
+ <groupId>commons-io</groupId>
+ <artifactId>commons-io</artifactId>
+ <version>1.3</version>
+ </dependency>
+
+ <!-- -->
+ <!-- OGOGLIO DEPENDENCIES-->
+ <!-- -->
+ <dependency>
+ <groupId>com.ogoglio</groupId>
+ <artifactId>ogoglio-common</artifactId>
+ <version>0.0.1</version>
+ </dependency>
+ </dependencies>
+</project>
+
Added: maven/trunk/ogoglio-appdev/src/main/java/com/ogoglio/appdev/migrate/DBVersionPersistTasks.java
===================================================================
--- maven/trunk/ogoglio-appdev/src/main/java/com/ogoglio/appdev/migrate/DBVersionPersistTasks.java (rev 0)
+++ maven/trunk/ogoglio-appdev/src/main/java/com/ogoglio/appdev/migrate/DBVersionPersistTasks.java 2007-08-28 22:50:10 UTC (rev 282)
@@ -0,0 +1,49 @@
+package com.ogoglio.appdev.migrate;
+
+import org.hibernate.Query;
+import org.hibernate.Session;
+import org.hibernate.SessionFactory;
+
+import com.ogoglio.appdev.persist.HibernateTask;
+import com.ogoglio.appdev.persist.PersistException;
+
+public class DBVersionPersistTasks {
+ public final static String FIND_VERSION = "com.ogoglio.appdev.migrate.dbversions";
+
+ public static int findVersion(SessionFactory sessionFactory) throws PersistException {
+ HibernateTask task = new HibernateTask() {
+ public Object run(Session session) throws PersistException {
+ Query query = session.getNamedQuery(FIND_VERSION);
+ return query.uniqueResult();
+ }
+ };
+ task.setSessionFactory(sessionFactory);
+ return ((DBVersionRecord) task.execute()).getVersion();
+ }
+
+ public static boolean updateVersion(final int newVersion, final int expectedSize/* one or zero */, SessionFactory sessionFactory) throws PersistException {
+ HibernateTask task = new HibernateTask() {
+ public Object run(Session session) throws PersistException {
+ Query query = session.getNamedQuery(FIND_VERSION);
+ int size = query.list().size();
+ DBVersionRecord rec;
+ if (expectedSize != size) {
+ System.out.println("Whoa! Size of returned result for db version record was (" + size + ") but should have been " + expectedSize + "!");
+ return Boolean.FALSE;
+ }
+ if (size == 0) {
+ rec = new DBVersionRecord();
+ } else {
+ rec = (DBVersionRecord) query.uniqueResult();
+ }
+ rec.setVersion(newVersion);
+ session.saveOrUpdate(rec);
+ System.out.println("******* Wrote new version FART:" + newVersion);
+ return Boolean.TRUE;
+ }
+ };
+ task.setSessionFactory(sessionFactory);
+ return (task.execute().equals(Boolean.TRUE));
+ }
+
+}
Added: maven/trunk/ogoglio-appdev/src/main/java/com/ogoglio/appdev/migrate/DBVersionRecord.java
===================================================================
--- maven/trunk/ogoglio-appdev/src/main/java/com/ogoglio/appdev/migrate/DBVersionRecord.java (rev 0)
+++ maven/trunk/ogoglio-appdev/src/main/java/com/ogoglio/appdev/migrate/DBVersionRecord.java 2007-08-28 22:50:10 UTC (rev 282)
@@ -0,0 +1,28 @@
+package com.ogoglio.appdev.migrate;
+
+public class DBVersionRecord {
+ public static int INTERNAL_DEV_STATE = -8288;
+
+ private int version = 0;
+
+ private long id;
+
+ public DBVersionRecord() {
+ }
+
+ public long getVersionId() {
+ return id;
+ }
+
+ public void setVersionId(long id) {
+ this.id = id;
+ }
+
+ public int getVersion() {
+ return version;
+ }
+
+ public void setVersion(int version) {
+ this.version = version;
+ }
+}
Added: maven/trunk/ogoglio-appdev/src/main/java/com/ogoglio/appdev/migrate/Migration.java
===================================================================
--- maven/trunk/ogoglio-appdev/src/main/java/com/ogoglio/appdev/migrate/Migration.java (rev 0)
+++ maven/trunk/ogoglio-appdev/src/main/java/com/ogoglio/appdev/migrate/Migration.java 2007-08-28 22:50:10 UTC (rev 282)
@@ -0,0 +1,14 @@
+package com.ogoglio.appdev.migrate;
+
+import java.util.Properties;
+
+import javax.naming.Context;
+import javax.servlet.ServletConfig;
+
+import org.hibernate.SessionFactory;
+
+public interface Migration {
+
+ public boolean migrate(SessionFactory sessionFactory, ServletConfig servletConfig, Context ctx, Properties testConfig, int from, int to);
+
+}
Added: maven/trunk/ogoglio-appdev/src/main/java/com/ogoglio/appdev/migrate/MigrationSupport.java
===================================================================
--- maven/trunk/ogoglio-appdev/src/main/java/com/ogoglio/appdev/migrate/MigrationSupport.java (rev 0)
+++ maven/trunk/ogoglio-appdev/src/main/java/com/ogoglio/appdev/migrate/MigrationSupport.java 2007-08-28 22:50:10 UTC (rev 282)
@@ -0,0 +1,170 @@
+package com.ogoglio.appdev.migrate;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.Properties;
+
+import javax.naming.Context;
+import javax.naming.NamingException;
+import javax.servlet.ServletConfig;
+
+import org.hibernate.SessionFactory;
+import org.hibernate.cfg.Configuration;
+
+import com.ogoglio.appdev.persist.PersistException;
+import com.ogoglio.viewer.render.UIConstants;
+
+public abstract class MigrationSupport {
+
+ //check on migration okayness
+ public static final String MIGRATION_KEY = "ogoglio/okToMigrateDB";
+
+ public MigrationSupport() {
+ }
+
+ public abstract int versionNumber();
+ public abstract Migration[] migrationList();
+
+ public boolean verifyVersion(ServletConfig servletConf, Context ctx) {
+ try {
+ SessionFactory sessionFactory = getCurrentConfiguration().buildSessionFactory();
+ int version = DBVersionPersistTasks.findVersion(sessionFactory);
+ if (version != versionNumber()) {
+ System.err.println("DB Version Mismatch! Expected (" + versionNumber() + ") but got " + version + "!");
+ sessionFactory.close();
+ return tryUpgrade(servletConf, ctx, version, versionNumber(), "update", true);
+ }
+ sessionFactory.close();
+ return true; // we are at the expected version
+ } catch (PersistException e) {
+ if (e.innerThrowable == null) {
+ System.out.println("Serious problem with hibernate:" + e.getMessage());
+ return false;
+ }
+ System.err.println("Unable to figure out DB version number. Likely this is a fresh database....(" + e.innerThrowable.getClass().getName() + ")");
+ return initialize_version(servletConf, ctx, true);
+ }
+ }
+
+ public boolean initialize_version(ServletConfig conf, Context ctx, boolean useJNDI) {
+ Configuration configuration = createConfigurationForHibernate(0, "create", useJNDI);
+ try {
+ SessionFactory factory = configuration.buildSessionFactory();
+ if (setVersionNumberOfDbViaQuery(factory, 0, 0) == false) {
+ factory.close();
+ return false;
+ }
+ factory.close();
+ return tryUpgrade(conf, ctx, 0, versionNumber(), "create", useJNDI);
+ } catch (Throwable e) {
+ System.err.println("Error trying initialized DB:" + e.getMessage());
+ return false;
+ }
+
+ }
+
+ public Configuration getCurrentConfiguration() {
+ return createConfigurationForHibernate(versionNumber(), null, true);
+ }
+
+ public Configuration createConfigurationForHibernate(int num, String autoSetting, boolean useJNDI) {
+ Configuration configuration = new Configuration();
+ if (autoSetting != null) {
+ configuration.setProperty("hibernate.hbm2ddl.auto", autoSetting);
+ }
+ if (useJNDI) {
+ configuration.setProperty("hibernate.connection.datasource", "java:comp/env/jdbc/space");
+ } else {
+ Properties p = new Properties();
+ try {
+ p.load(getClass().getResourceAsStream("/test-config.properties"));
+ configuration.addProperties(p);
+ } catch (IOException e) {
+ System.err.println("Unable to find the test configuration file!" + e.getMessage());
+ return configuration.configure();
+ }
+ }
+ configuration.addInputStream(UIConstants.getResource("com/ogoglio/migrate/migration-" + num + ".xml"));
+ return configuration.configure();
+ }
+
+ private boolean setVersionNumberOfDbViaQuery(SessionFactory sessionFactory, int targetVersion, int expectedSize) {
+ try {
+ return DBVersionPersistTasks.updateVersion(targetVersion, expectedSize, sessionFactory);
+ } catch (PersistException e) {
+ System.err.println("Problem updating the version of the database to version " + targetVersion + ":" + e.getMessage());
+ return false;
+ }
+ }
+
+ public boolean tryUpgrade(ServletConfig servletConfig, Context ctx, int db_is, int db_wants_to_be, String ddlMode, boolean useJNDI) {
+ if (migrationList().length != versionNumber()) {
+ System.out.println("Internal error! Migration list length should be " + versionNumber() + " but is " + migrationList().length + "!");
+ return false;
+ }
+ Properties testConfig = new Properties();
+ boolean canMigrate = false;
+ if (ctx == null) {
+ //in test mode
+ testConfig = getTestConfig();
+ if ("true".equals(testConfig.getProperty("ogoglio.okToMigrateDB"))) {
+ canMigrate = true;
+ }
+ } else {
+ //not testing, but might be integration testing
+ try {
+ String migrate = (String) ctx.lookup(MIGRATION_KEY);
+ if ("true".equals(migrate)) {
+ canMigrate = true;
+ }
+ } catch (NamingException e) {
+ System.err.println("Naming exception trying to access " + MIGRATION_KEY + " from naming context!");
+ }
+ }
+
+ if (!canMigrate) {
+ System.err.println("Cannot migrate data! Property ogoglio.okToMigrateDB is false or non-existent!");
+ return false;
+ }
+
+ for (int i = db_is; i < db_wants_to_be; ++i) {
+ Migration current = migrationList()[i];
+ System.out.println("------------------------------------------------\n");
+ System.out.println("DB: Attempting migration from " + i + " to " + (i + 1) + "...");
+
+ //try to get hibernate to do the work
+ Configuration config = createConfigurationForHibernate(i + 1, ddlMode, useJNDI);
+ SessionFactory factory = config.buildSessionFactory();
+
+ //subtle: if the ddlMode is create, hibernate blows away all the data (including our version number record)
+ int expectedRecords = 1;
+ if ("create".equals(ddlMode)) {
+ expectedRecords = 0;
+ }
+ setVersionNumberOfDbViaQuery(factory, i + 1, expectedRecords);
+
+ if (!current.migrate(factory, servletConfig, ctx, testConfig, i, i + 1)) {
+ factory.close();
+ return false;
+ }
+ factory.close();
+ System.out.println("------------------------------------------------\n");
+ }
+ return true;
+ }
+
+ public Properties getTestConfig() {
+ Properties testConfig = new Properties();
+ InputStream is = getClass().getResourceAsStream("/test-config.properties");
+ if (is == null) {
+ System.err.println("Warning! Unable to find test-config.properties! Probably something is broken!");
+ } else {
+ try {
+ testConfig.load(is);
+ } catch (IOException e) {
+ System.err.println("Warning! Error reading test-config.properties! " + e.getMessage());
+ }
+ }
+ return testConfig;
+ }
+}
Added: maven/trunk/ogoglio-appdev/src/main/java/com/ogoglio/appdev/migrate/test/DBZapTest.java
===================================================================
--- maven/trunk/ogoglio-appdev/src/main/java/com/ogoglio/appdev/migrate/test/DBZapTest.java (rev 0)
+++ maven/trunk/ogoglio-appdev/src/main/java/com/ogoglio/appdev/migrate/test/DBZapTest.java 2007-08-28 22:50:10 UTC (rev 282)
@@ -0,0 +1,40 @@
+package com.ogoglio.appdev.migrate.test;
+
+import junit.framework.TestCase;
+
+import org.hibernate.SessionFactory;
+
+import com.ogoglio.appdev.migrate.MigrationSupport;
+
+public abstract class DBZapTest extends TestCase {
+
+ protected SessionFactory sessionFactory;
+
+ public abstract MigrationSupport getMigrationSupport();
+
+ public void setUp() {
+ try {
+ MigrationSupport support = getMigrationSupport();
+ if (!("true".equals(support.getTestConfig().getProperty("ogoglio.okToZapDB")))) {
+ fail("Whoa! Shouldn't be running tests without setting the ogoglio.okToZapDB property!");
+ }
+ if (support.initialize_version(null, null, false) == false) {
+ fail("can't get DB set up: trying to initialize it in the test code");
+ }
+
+ //if we are here, db stuff worked, but we still need to avoid all the jndi stuff
+ sessionFactory = support.createConfigurationForHibernate(getMigrationSupport().versionNumber(), null, false).buildSessionFactory();
+ } catch (Exception e) {
+ System.out.println("-------");
+ e.printStackTrace(System.out);
+ System.out.println("---------");
+ fail("Could not setup:" + e.getMessage());
+ }
+ }
+
+ public void tearDown() {
+ if (sessionFactory != null) {
+ sessionFactory.close();
+ }
+ }
+}
Added: maven/trunk/ogoglio-appdev/src/main/java/com/ogoglio/appdev/persist/HibernateTask.java
===================================================================
--- maven/trunk/ogoglio-appdev/src/main/java/com/ogoglio/appdev/persist/HibernateTask.java (rev 0)
+++ maven/trunk/ogoglio-appdev/src/main/java/com/ogoglio/appdev/persist/HibernateTask.java 2007-08-28 22:50:10 UTC (rev 282)
@@ -0,0 +1,85 @@
+
+/* Copyright 2007 Transmutable (http://transmutable.com/)
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License. */
+package com.ogoglio.appdev.persist;
+
+import org.hibernate.Session;
+import org.hibernate.SessionFactory;
+import org.hibernate.StaleObjectStateException;
+import org.hibernate.Transaction;
+
+
+public abstract class HibernateTask {
+
+ private SessionFactory sessionFactory = null;
+
+ public HibernateTask() {
+ }
+
+ public void setSessionFactory(SessionFactory sessionFactory) {
+ this.sessionFactory = sessionFactory;
+ }
+
+ public abstract Object run(Session hibernateSession) throws PersistException;
+
+ public Object execute() throws PersistException {
+ Session hibernateSession = sessionFactory.openSession();
+ Transaction transaction = hibernateSession.beginTransaction();
+ try {
+ Object result = run(hibernateSession);
+ transaction.commit();
+ return result;
+ } catch (StaleObjectStateException staleEx) {
+ System.err.println("This interceptor does not implement optimistic concurrency control!");
+ System.err.println("Your application will not work until you add compensation actions!");
+ throw new PersistException("This DB is not supported.");
+ } catch (PersistException ex) {
+ try {
+ if (transaction.isActive()) {
+ transaction.rollback();
+ }
+ } catch (Throwable rbEx) {
+ }
+ throw ex;
+ } catch (Throwable ex) { //catches things that are created by Hibernate that are not PersistException
+ System.err.println("TRUE TYPE OF CAUGHT EXCEPTION:"+ex.getClass().getName());
+ System.err.println("ORIG STACK TRACE");
+ ex.printStackTrace();
+ try {
+ if (transaction.isActive()) {
+ transaction.rollback();
+ }
+ } catch (Throwable rbEx) {
+ }
+ // XXX This is really dodgy. This changes the type of the error from it's
+ // XXX true type (for example LazyInitializationException) to the PersistException
+ // XXX which I can only assume is to make the throws clauses easier. Ugh.
+ throw new PersistException(ex,"Hibernate error: " + ex);
+ } finally {
+ hibernateSession.close();
+ }
+ }
+
+ public static boolean equals(Object obj1, Object obj2) {
+ if (obj1 == obj2) {
+ return true;
+ }
+ if (obj1 != null) {
+ return obj1.equals(obj2);
+ } else {
+ return obj2.equals(obj1);
+ }
+
+ }
+}
\ No newline at end of file
Added: maven/trunk/ogoglio-appdev/src/main/java/com/ogoglio/appdev/persist/PersistException.java
===================================================================
--- maven/trunk/ogoglio-appdev/src/main/java/com/ogoglio/appdev/persist/PersistException.java (rev 0)
+++ maven/trunk/ogoglio-appdev/src/main/java/com/ogoglio/appdev/persist/PersistException.java 2007-08-28 22:50:10 UTC (rev 282)
@@ -0,0 +1,18 @@
+package com.ogoglio.appdev.persist;
+
+public class PersistException extends Exception {
+
+ public Throwable innerThrowable;
+
+ public PersistException() {
+ }
+
+ public PersistException(Throwable throwable, String string) {
+ super(string);
+ this.innerThrowable=throwable;
+ }
+
+ public PersistException(String string) {
+ this(null,string);
+ }
+}
Added: maven/trunk/ogoglio-appdev/src/main/java/com/ogoglio/appdev/servlet/AbstractRemoteServlet.java
===================================================================
--- maven/trunk/ogoglio-appdev/src/main/java/com/ogoglio/appdev/servlet/AbstractRemoteServlet.java (rev 0)
+++ maven/trunk/ogoglio-appdev/src/main/java/com/ogoglio/appdev/servlet/AbstractRemoteServlet.java 2007-08-28 22:50:10 UTC (rev 282)
@@ -0,0 +1,85 @@
+package com.ogoglio.appdev.servlet;
+
+import java.io.IOException;
+import java.net.URI;
+import java.net.URISyntaxException;
+
+import javax.naming.Context;
+import javax.naming.NamingException;
+import javax.servlet.ServletConfig;
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import com.ogoglio.client.AuthenticationFailedException;
+import com.ogoglio.client.WebAPIAuthenticator;
+import com.ogoglio.client.WebAPIAuthenticatorFactory;
+import com.ogoglio.client.WebAPIClient;
+import com.ogoglio.client.WebAPIClientWire;
+import com.ogoglio.client.WebAPIDescriptor;
+import com.ogoglio.util.ArgumentUtils;
+import com.ogoglio.xml.AuthDocument;
+
+public abstract class AbstractRemoteServlet extends AbstractResourceServlet {
+
+ private WebAPIClient ogoglioClient = null;
+
+ private String ogoglioUsername = null;
+
+ private String ogoglioPassword = null;
+
+ public abstract String getOgoglioUsernameContextKey();
+
+ public abstract String getOgoglioPasswordContextKey();
+
+ public void init(ServletConfig config) throws ServletException {
+ super.init(config);
+ try {
+ Context envCtx = (Context) initCtx.lookup("java:comp/env");
+
+ ogoglioUsername = (String) envCtx.lookup(getOgoglioUsernameContextKey());
+ ArgumentUtils.assertNotEmpty(ogoglioUsername);
+ ogoglioPassword = (String) envCtx.lookup(getOgoglioPasswordContextKey());
+ ArgumentUtils.assertNotEmpty(ogoglioPassword);
+ } catch (NamingException e) {
+ throw new ServletException("Could not init EventServlet (probably forgot env variables in setup.xml): " + e);
+ }
+ }
+
+ public void service(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException {
+ if (ogoglioClient == null) {
+ try {
+ WebAPIClientWire wire = new WebAPIClientWire();
+ URI serviceURI = new URI(getBaseUrl());
+ WebAPIDescriptor descriptor = new WebAPIDescriptor(serviceURI);
+ WebAPIAuthenticator authenticator = new WebAPIAuthenticatorFactory().authenticate(wire, descriptor, ogoglioUsername, ogoglioPassword);
+ ogoglioClient = new WebAPIClient(new WebAPIDescriptor(serviceURI), authenticator, wire);
+ } catch (URISyntaxException e) {
+ throw new ServletException("Could not connect to ogoglio service: " + e);
+ } catch (IOException e) {
+ throw new ServletException("Failed because of Ogoglio service communication failure: " + e);
+ } catch (AuthenticationFailedException e) {
+ throw new ServletException("Failed because of Ogoglio service auth failure: " + e);
+ }
+ }
+
+ super.service(request, response);
+ }
+
+
+ public AuthDocument getAuthDocument(HttpServletRequest request) throws IOException {
+ String authCookie = getRequestAuthCookie(request);
+ if (authCookie == null) {
+ return null;
+ }
+ return getOgoglioClient().getAuthDocumentByAuthCookie(authCookie);
+ }
+
+ public WebAPIClient getOgoglioClient() {
+ return ogoglioClient;
+ }
+
+ public String getOgoglioUsername() {
+ return ogoglioUsername;
+ }
+}
Added: 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 (rev 0)
+++ maven/trunk/ogoglio-appdev/src/main/java/com/ogoglio/appdev/servlet/AbstractResourceServlet.java 2007-08-28 22:50:10 UTC (rev 282)
@@ -0,0 +1,287 @@
+/* Copyright 2007 Transmutable (http://transmutable.com/)
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License. */
+package com.ogoglio.appdev.servlet;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.net.HttpURLConnection;
+import java.net.URI;
+import java.net.URISyntaxException;
+import java.util.Collection;
+import java.util.Enumeration;
+import java.util.Iterator;
+import java.util.Map;
+
+import javax.naming.Context;
+import javax.naming.InitialContext;
+import javax.naming.NamingException;
+import javax.servlet.ServletConfig;
+import javax.servlet.ServletException;
+import javax.servlet.http.Cookie;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.apache.commons.fileupload.FileItem;
+import org.apache.commons.fileupload.FileItemFactory;
+import org.apache.commons.fileupload.FileUploadException;
+import org.apache.commons.fileupload.disk.DiskFileItemFactory;
+import org.apache.commons.fileupload.servlet.ServletFileUpload;
+
+import com.ogoglio.util.StreamUtils;
+import com.ogoglio.util.WebConstants;
+import com.ogoglio.xml.SpaceDocument;
+
+public abstract class AbstractResourceServlet extends HttpServlet {
+
+ public static final String OGOGLIO_BASE_URL_KEY = "ogoglio/baseURL";
+
+ private static final String METHOD_PARAM = "method";
+
+ private SiteResource baseResource = null;
+
+ private boolean noCache = true;
+
+
+ // WARNING: This is really, really easy to hose yourself with. 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;
+
+ private void initContext() throws NamingException {
+ if (initCtx==null) {
+ initCtx = new InitialContext();
+ }
+ }
+ public void initBaseUrl() throws NamingException {
+ 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();
+ } catch (NamingException e) {
+ throw new ServletException("Could not init in AbstractResourceServlet: " + e);
+ }
+
+ super.init(config);
+
+ baseResource = createBaseResource(config);
+
+ if (baseResource==null) {
+ System.out.println("Warning: 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());
+ }
+ }
+ }
+
+ public String getBaseUrl() {
+ return baseUrl;
+ }
+
+ public void destroy() {
+ super.destroy();
+ }
+
+ public static void setNoCache(HttpServletResponse response) {
+ //IE caches XMLHttpRequest responses, so we set explicit no-cache headers
+ response.addHeader("Cache-Control", "must-revalidate");
+ response.addHeader("Cache-Control", "no-cache");
+ 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++) {
+ if (WebConstants.AUTH_COOKIE.equals(cookies[i].getName())) {
+ return cookies[i].getValue();
+ }
+ }
+ 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);
+ }
+
+ URI requestURI = getRequestURI(request);
+
+ String[] pathElements = getPathElements((String) baseResource.getPathElement(), requestURI);
+
+ SiteResource requestedResource = getSiteResource(pathElements, baseResource);
+
+ if (requestedResource == null) {
+ response.setStatus(HttpServletResponse.SC_NOT_FOUND);
+ return;
+ }
+
+ if (request.getMethod().equals("GET")) {
+ if ("DELETE".equals(request.getParameter(METHOD_PARAM))) { //A workaround for WebKit
+ requestedResource.doDelete(request, response, pathElements);
+ } else {
+ requestedResource.doGet(request, response, pathElements);
+ }
+ return;
+ } else if (request.getMethod().equals("POST")) {
+ requestedResource.doPost(request, response, pathElements);
+ return;
+ } else if (request.getMethod().equals("DELETE")) {
+ requestedResource.doDelete(request, response, pathElements);
+ return;
+ } else if (request.getMethod().equals("PUT")) {
+ requestedResource.doPut(request, response, pathElements);
+ return;
+ } else if (request.getMethod().equals("HEAD")) {
+ requestedResource.doHead(request, response, pathElements);
+ return;
+ } else {
+ response.setStatus(HttpServletResponse.SC_METHOD_NOT_ALLOWED);
+ return;
+ }
+
+ }
+
+ private SiteResource getSiteResource(String[] pathElements, SiteResource rootResource) {
+
+ SiteResource currentPick = rootResource;
+ for (int i = 0; i < pathElements.length && currentPick != null; i++) {
+ if (i == pathElements.length - 1) {
+ return currentPick;
+ }
+ currentPick = currentPick.getSubResource(pathElements[i + 1]);
+ }
+ return null;
+ }
+
+ private static URI getRequestURI(HttpServletRequest request) {
+ try {
+ return new URI(request.getRequestURL().toString());
+ } catch (URISyntaxException e) {
+ e.printStackTrace();
+ throw new IllegalStateException("Bad request URI?!? " + request.getRequestURI());
+ }
+ }
+
+ private static String[] getPathElements(String baseElement, URI uri) {
+ String[] pathElements = uri.getPath().split("/");
+ String[] pathFromSpace = null;
+ for (int i = 0; i < pathElements.length; i++) {
+ if (baseElement.equals(pathElements[i])) {
+ pathFromSpace = new String[pathElements.length - i];
+ for (int j = 0; j < pathFromSpace.length; j++) {
+ pathFromSpace[j] = pathElements[j + i];
+ }
+ return pathFromSpace;
+ }
+ }
+ return null;
+ }
+
+ public static void proxy(URI uri, String method, HttpServletRequest request, HttpServletResponse response) throws IOException {
+ HttpURLConnection connection = (HttpURLConnection) uri.toURL().openConnection();
+ connection.setRequestMethod(method);
+ connection.setAllowUserInteraction(false);
+ Enumeration headerNames = request.getHeaderNames();
+ while (headerNames.hasMoreElements()) {
+ String headerName = (String) headerNames.nextElement();
+ connection.setRequestProperty(headerName, request.getHeader(headerName));
+ }
+
+ if ("POST".equals(method)) {
+ connection.setDoOutput(true);
+ InputStream requestInput = request.getInputStream();
+ OutputStream outputStream = connection.getOutputStream();
+ StreamUtils.write(requestInput, outputStream, -1);
+ outputStream.flush();
+ outputStream.close();
+ }
+
+ response.setStatus(connection.getResponseCode());
+
+ Map headers = connection.getHeaderFields();
+ String[] headerFields = (String[]) headers.keySet().toArray(new String[0]);
+ for (int i = 0; i < headerFields.length; i++) {
+ if (headerFields[i] == null) {
+ continue;
+ }
+ String[] values = (String[]) ((Collection) headers.get(headerFields[i])).toArray(new String[0]); //It's lines like this that make me hate Java
+ for (int j = 0; j < values.length; j++) {
+ if (values[j] != null) {
+ response.setHeader(headerFields[i], values[j]);
+ }
+ }
+ }
+
+ if (connection.getResponseCode() == 200) {
+ InputStream input = connection.getInputStream();
+ StreamUtils.write(input, response.getOutputStream(), -1);
+ }
+ }
+
+ public static String getFirstStringValue(HttpServletRequest request) throws IOException {
+ if (request.getContentType() != null && (request.getContentType().startsWith("application/x-www-form-urlencoded") || request.getContentType().startsWith("multipart/form-data"))) {
+ Enumeration enumeration = request.getParameterNames();
+ while (enumeration.hasMoreElements()) {
+ String element = (String) enumeration.nextElement();
+ if (element != null && !"null".equals(element)) { // *sigh*
+ String newValue = request.getParameter(element);
+ if (newValue != null) {
+ return newValue;
+ }
+ }
+ }
+ return null;
+ } else {
+ return StreamUtils.readInput(request.getInputStream(), SpaceDocument.MAX_SETTING_VALUE_SIZE);
+ }
+ }
+
+ public static InputStream getFirstFile(HttpServletRequest request, long maxSize) throws IOException {
+ FileItemFactory factory = new DiskFileItemFactory();
+ ServletFileUpload upload = new ServletFileUpload(factory);
+ upload.setSizeMax(maxSize);
+ try {
+ Iterator iter = upload.parseRequest(request).iterator();
+ while (iter.hasNext()) {
+ FileItem item = (FileItem) iter.next();
+
+ if (item.isFormField()) {
+ //ignore it.
+ } else {
+ return item.getInputStream();
+ }
+ }
+ } catch (FileUploadException e) {
+ e.printStackTrace();
+ throw new IOException(e.getMessage());
+ }
+ return null;
+ }
+}
Added: maven/trunk/ogoglio-appdev/src/main/java/com/ogoglio/appdev/servlet/DescendingSiteResource.java
===================================================================
--- maven/trunk/ogoglio-appdev/src/main/java/com/ogoglio/appdev/servlet/DescendingSiteResource.java (rev 0)
+++ maven/trunk/ogoglio-appdev/src/main/java/com/ogoglio/appdev/servlet/DescendingSiteResource.java 2007-08-28 22:50:10 UTC (rev 282)
@@ -0,0 +1,68 @@
+/* Copyright 2007 Transmutable (http://transmutable.com/)
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License. */
+package com.ogoglio.appdev.servlet;
+
+import java.io.IOException;
+
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+/**
+ * This resource claims an entire URL space, starting with it's path element
+ * All requests get fed back to the object extending DescendingSiteResourch
+ */
+
+public abstract class DescendingSiteResource extends SiteResource {
+
+ InfiteSiteResource infiniteResource = new InfiteSiteResource();
+
+ public DescendingSiteResource(Object pathElement) {
+ super(pathElement);
+ }
+
+ public SiteResource getSubResource(String pathElement) {
+ return infiniteResource;
+ }
+
+ private class InfiteSiteResource extends SiteResource {
+ public InfiteSiteResource() {
+ super(SiteResource.WILDCARD_ELEMENT);
+ }
+
+ public SiteResource getSubResource(String pathElement) {
+ return infiniteResource;
+ }
+
+ public void doGet(HttpServletRequest request, HttpServletResponse response, String[] pathElements) throws ServletException, IOException {
+ DescendingSiteResource.this.doGet(request, response, pathElements);
+ }
+
+ public void doPost(HttpServletRequest request, HttpServletResponse response, String[] pathElements) throws ServletException, IOException {
+ DescendingSiteResource.this.doPost(request, response, pathElements);
+ }
+
+ public void doPut(HttpServletRequest request, HttpServletResponse response, String[] pathElements) throws ServletException, IOException {
+ DescendingSiteResource.this.doPut(request, response, pathElements);
+ }
+
+ public void doDelete(HttpServletRequest request, HttpServletResponse response, String[] pathElements) throws ServletException, IOException {
+ DescendingSiteResource.this.doDelete(request, response, pathElements);
+ }
+
+ public void doHead(HttpServletRequest request, HttpServletResponse response, String[] pathElements) throws ServletException, IOException {
+ DescendingSiteResource.this.doHead(request, response, pathElements);
+ }
+}
+}
Added: maven/trunk/ogoglio-appdev/src/main/java/com/ogoglio/appdev/servlet/MigratedResourceServlet.java
===================================================================
--- maven/trunk/ogoglio-appdev/src/main/java/com/ogoglio/appdev/servlet/MigratedResourceServlet.java (rev 0)
+++ maven/trunk/ogoglio-appdev/src/main/java/com/ogoglio/appdev/servlet/MigratedResourceServlet.java 2007-08-28 22:50:10 UTC (rev 282)
@@ -0,0 +1,61 @@
+package com.ogoglio.appdev.servlet;
+
+import javax.naming.Context;
+import javax.naming.NamingException;
+import javax.servlet.ServletConfig;
+import javax.servlet.ServletException;
+
+import org.hibernate.SessionFactory;
+
+import com.ogoglio.appdev.migrate.MigrationSupport;
+
+public abstract class MigratedResourceServlet extends AbstractResourceServlet {
+
+ private static final String HIBERNATE_SESSION_FACTORY_KEY = "com.ogoglio.hibernateSessionFactory";
+ private SessionFactory hibernateSessionFactory = null;
+ public abstract MigrationSupport getMigration();
+
+ public void init(ServletConfig config) throws ServletException {
+ try {
+ initBaseUrl();
+ Context envCtx = (Context) initCtx.lookup("java:comp/env");
+ hibernateSessionFactory = getOrCreateHibernateSessionFactory(config,envCtx);
+ System.out.println("FART****:"+getClass().getName()+","+(hibernateSessionFactory==null));
+ if (hibernateSessionFactory==null) {
+ throw new IllegalStateException("Unable to create sensible hibernate configuration!");
+ }
+
+ //CALL THIS LAST
+ super.init(config);
+ } catch (NamingException e) {
+ throw new ServletException("Unable to initialize Migrated resource servlet:"+e.getMessage());
+ }
+ }
+ public void destroy() {
+ super.destroy();
+ try {
+ hibernateSessionFactory.close();
+ } catch (Throwable e) {
+ }
+ super.destroy();
+ }
+ public SessionFactory getSessionFactory() {
+ return hibernateSessionFactory;
+ }
+
+ private SessionFactory getOrCreateHibernateSessionFactory(ServletConfig config, Context context) {
+ SessionFactory sessionFactory = (SessionFactory) config.getServletContext().getAttribute(HIBERNATE_SESSION_FACTORY_KEY);
+ if (sessionFactory == null) {
+ System.out.println(config.getServletName()+" checking DB Version...");
+ MigrationSupport ms= getMigration();
+ if (!ms.verifyVersion(config,context)) {
+ throw new IllegalStateException("Cannot find a DB configuration for hibernate!");
+ }
+ sessionFactory= ms.getCurrentConfiguration().configure().buildSessionFactory();
+ config.getServletContext().setAttribute(HIBERNATE_SESSION_FACTORY_KEY, sessionFactory);
+ }
+ return sessionFactory;
+ }
+
+
+}
Added: maven/trunk/ogoglio-appdev/src/main/java/com/ogoglio/appdev/servlet/SiteResource.java
===================================================================
--- maven/trunk/ogoglio-appdev/src/main/java/com/ogoglio/appdev/servlet/SiteResource.java (rev 0)
+++ maven/trunk/ogoglio-appdev/src/main/java/com/ogoglio/appdev/servlet/SiteResource.java 2007-08-28 22:50:10 UTC (rev 282)
@@ -0,0 +1,140 @@
+/* Copyright 2007 Transmutable (http://transmutable.com/)
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License. */
+package com.ogoglio.appdev.servlet;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.io.OutputStream;
+import java.util.Vector;
+
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import nanoxml.XMLElement;
+
+public abstract class SiteResource {
+
+ public static final Long LONG_ELEMENT = new Long(-1);
+
+ public static final Long WILDCARD_ELEMENT = new Long(-100);
+
+ private Object pathElement = null;
+
+ private Vector subResources = new Vector();
+
+ /**
+ * @param pathElement A single path element string (e.g. "space"), LONG_ELEMENT, or WILDCARD_ELEMENT
+ */
+ public SiteResource(Object pathElement) {
+ if(!(pathElement instanceof String) && pathElement != LONG_ELEMENT && pathElement != WILDCARD_ELEMENT) {
+ throw new IllegalArgumentException("Bad path element: " + pathElement);
+ }
+ this.pathElement = pathElement;
+ }
+
+
+ public void doGet(HttpServletRequest request, HttpServletResponse response, String[] pathElements) throws ServletException, IOException {
+ response.setStatus(HttpServletResponse.SC_METHOD_NOT_ALLOWED);
+ return;
+ }
+
+ public void doPost(HttpServletRequest request, HttpServletResponse response, String[] pathElements) throws ServletException, IOException {
+ response.setStatus(HttpServletResponse.SC_METHOD_NOT_ALLOWED);
+ return;
+ }
+
+ public void doPut(HttpServletRequest request, HttpServletResponse response, String[] pathElements) throws ServletException, IOException {
+ response.setStatus(HttpServletResponse.SC_METHOD_NOT_ALLOWED);
+ return;
+ }
+
+ public void doDelete(HttpServletRequest request, HttpServletResponse response, String[] pathElements) throws ServletException, IOException {
+ response.setStatus(HttpServletResponse.SC_METHOD_NOT_ALLOWED);
+ return;
+ }
+
+ public void doHead(HttpServletRequest request, HttpServletResponse response, String[] pathElements) throws ServletException, IOException {
+ response.setStatus(HttpServletResponse.SC_METHOD_NOT_ALLOWED);
+ return;
+ }
+
+ public Object getPathElement() {
+ return pathElement;
+ }
+
+ public boolean matches(String pathElement) {
+ if (this.pathElement == WILDCARD_ELEMENT) {
+ return true;
+ } else if (this.pathElement instanceof String) {
+ return this.pathElement.equals(pathElement);
+ } else if (this.pathElement == LONG_ELEMENT) {
+ try {
+ Long.parseLong(pathElement);
+ return true;
+ } catch (NumberFormatException e) {
+ return false;
+ }
+ }
+ throw new IllegalStateException("Path element must be String, LONG_ELEMENT, or WILDCARD_ELEMENT: " + this.pathElement);
+ }
+
+ public void addSubResource(SiteResource subResource) {
+ subResources.add(subResource);
+ }
+
+ public SiteResource getSubResource(String path) {
+ SiteResource[] subs = getSubResources();
+ for (int i = 0; i < subs.length; i++) {
+ if (subs[i].matches(path)) {
+ return subs[i];
+ }
+ }
+ return null;
+ }
+
+ private SiteResource[] getSubResources() {
+ return (SiteResource[]) subResources.toArray(new SiteResource[0]);
+ }
+
+ public static long parseLong(String input) {
+ try {
+ return Long.parseLong(input);
+ } catch (NumberFormatException e) {
+ throw new IllegalArgumentException("Bad long parser input: " + input);
+ }
+ }
+
+ public void sendStringResponse(String message, String mimeType, HttpServletResponse response) throws IOException {
+ response.setContentType(mimeType);
+ byte[] result = message.getBytes();
+ response.setContentLength(result.length);
+ response.getOutputStream().write(result);
+ }
+
+ public XMLElement parseXML(InputStream input) throws IOException {
+ XMLElement element = new XMLElement();
+ element.parseFromReader(new InputStreamReader(input));
+ return element;
+ }
+
+ public static void transfer(InputStream input, OutputStream output) throws IOException {
+ byte[] buffer = new byte[2048];
+ int read = -1;
+ while ((read = input.read(buffer)) > 0) {
+ output.write(buffer, 0, read);
+ }
+ }
+}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ian...@us...> - 2007-08-28 22:48:14
|
Revision: 281
http://ogoglio.svn.sourceforge.net/ogoglio/?rev=281&view=rev
Author: iansmith
Date: 2007-08-28 15:48:15 -0700 (Tue, 28 Aug 2007)
Log Message:
-----------
Initial import.
Added Paths:
-----------
maven/trunk/ogoglio-appdev/
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ian...@us...> - 2007-08-28 22:46:40
|
Revision: 280
http://ogoglio.svn.sourceforge.net/ogoglio/?rev=280&view=rev
Author: iansmith
Date: 2007-08-28 15:46:41 -0700 (Tue, 28 Aug 2007)
Log Message:
-----------
Extruded the support classes for our kind of web app upward.
Modified Paths:
--------------
maven/trunk/ogoglio-server/pom.xml
maven/trunk/ogoglio-server/src/main/java/com/ogoglio/media/site/MediaServlet.java
maven/trunk/ogoglio-server/src/main/java/com/ogoglio/migrate/AccountsForTesting.java
maven/trunk/ogoglio-server/src/main/java/com/ogoglio/persist/AccountPersistTasks.java
maven/trunk/ogoglio-server/src/main/java/com/ogoglio/persist/BodyPersistTasks.java
maven/trunk/ogoglio-server/src/main/java/com/ogoglio/persist/PendingEmailValidationTasks.java
maven/trunk/ogoglio-server/src/main/java/com/ogoglio/persist/PossessionPersistTasks.java
maven/trunk/ogoglio-server/src/main/java/com/ogoglio/persist/ServiceInitializationPersistTasks.java
maven/trunk/ogoglio-server/src/main/java/com/ogoglio/persist/ServiceStateTasks.java
maven/trunk/ogoglio-server/src/main/java/com/ogoglio/persist/SimPersistTasks.java
maven/trunk/ogoglio-server/src/main/java/com/ogoglio/persist/SpaceMemberPersistTasks.java
maven/trunk/ogoglio-server/src/main/java/com/ogoglio/persist/SpacePersistTasks.java
maven/trunk/ogoglio-server/src/main/java/com/ogoglio/persist/TemplatePersistTasks.java
maven/trunk/ogoglio-server/src/main/java/com/ogoglio/persist/TemplateSupportFilePersistTasks.java
maven/trunk/ogoglio-server/src/main/java/com/ogoglio/sim/Sim.java
maven/trunk/ogoglio-server/src/main/java/com/ogoglio/sim/site/SimServlet.java
maven/trunk/ogoglio-server/src/main/java/com/ogoglio/site/AccountServlet.java
maven/trunk/ogoglio-server/src/main/java/com/ogoglio/site/AuthServlet.java
maven/trunk/ogoglio-server/src/main/java/com/ogoglio/site/AuthenticatedSiteResource.java
maven/trunk/ogoglio-server/src/main/java/com/ogoglio/site/SpaceServlet.java
maven/trunk/ogoglio-server/src/main/java/com/ogoglio/site/TemplateResource.java
maven/trunk/ogoglio-server/src/main/resources/hibernate/migration-0.xml
maven/trunk/ogoglio-server/src/main/resources/hibernate/migration-1.xml
Added Paths:
-----------
maven/trunk/ogoglio-server/src/main/java/com/ogoglio/migrate/OgoglioServerMigration.java
maven/trunk/ogoglio-server/src/main/java/com/ogoglio/site/OgoglioServletBase.java
maven/trunk/ogoglio-server/src/main/java/com/ogoglio/site/SiteInfo.java
maven/trunk/ogoglio-server/src/test/java/com/ogoglio/persist/test/PersistTest.java
Removed Paths:
-------------
maven/trunk/ogoglio-server/src/main/java/com/ogoglio/migrate/DBVersionPersistTasks.java
maven/trunk/ogoglio-server/src/main/java/com/ogoglio/migrate/DBVersionRecord.java
maven/trunk/ogoglio-server/src/main/java/com/ogoglio/migrate/DBZapTest.java
maven/trunk/ogoglio-server/src/main/java/com/ogoglio/migrate/Migration.java
maven/trunk/ogoglio-server/src/main/java/com/ogoglio/migrate/MigrationSupport.java
maven/trunk/ogoglio-server/src/main/java/com/ogoglio/persist/HibernateTask.java
maven/trunk/ogoglio-server/src/main/java/com/ogoglio/persist/PersistException.java
maven/trunk/ogoglio-server/src/main/java/com/ogoglio/site/AbstractRemoteServlet.java
maven/trunk/ogoglio-server/src/main/java/com/ogoglio/site/AbstractResourceServlet.java
maven/trunk/ogoglio-server/src/main/java/com/ogoglio/site/DescendingSiteResource.java
maven/trunk/ogoglio-server/src/main/java/com/ogoglio/site/SiteInfo.java
maven/trunk/ogoglio-server/src/main/java/com/ogoglio/site/SiteResource.java
maven/trunk/ogoglio-server/src/test/java/com/ogoglio/persist/test/PersistTest.java
Modified: maven/trunk/ogoglio-server/pom.xml
===================================================================
--- maven/trunk/ogoglio-server/pom.xml 2007-08-28 22:40:51 UTC (rev 279)
+++ maven/trunk/ogoglio-server/pom.xml 2007-08-28 22:46:41 UTC (rev 280)
@@ -130,6 +130,7 @@
</webResources>
</configuration>
</plugin>
+
</plugins>
</build>
@@ -141,11 +142,6 @@
<version>2.0.0-rc-6</version>
</dependency>
<dependency>
- <groupId>org.hibernate</groupId>
- <artifactId>hibernate</artifactId>
- <version>3.2.1.ga</version>
- </dependency>
- <dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
<version>2.3</version>
@@ -161,17 +157,9 @@
<artifactId>commons-httpclient</artifactId>
<version>3.0.1</version>
</dependency>
+
+
<dependency>
- <groupId>commons-fileupload</groupId>
- <artifactId>commons-fileupload</artifactId>
- <version>1.2</version>
- </dependency>
- <dependency>
- <groupId>commons-io</groupId>
- <artifactId>commons-io</artifactId>
- <version>1.3</version>
- </dependency>
- <dependency>
<groupId>com.sun</groupId>
<artifactId>mail</artifactId>
<version>1.4</version>
@@ -199,6 +187,11 @@
<artifactId>ogoglio-common</artifactId>
<version>0.0.1</version>
</dependency>
+ <dependency>
+ <groupId>com.ogoglio</groupId>
+ <artifactId>ogoglio-appdev</artifactId>
+ <version>0.0.1</version>
+ </dependency>
<!-- -->
<!-- BOGUS DEPENDENCIES-->
Modified: maven/trunk/ogoglio-server/src/main/java/com/ogoglio/media/site/MediaServlet.java
===================================================================
--- maven/trunk/ogoglio-server/src/main/java/com/ogoglio/media/site/MediaServlet.java 2007-08-28 22:40:51 UTC (rev 279)
+++ maven/trunk/ogoglio-server/src/main/java/com/ogoglio/media/site/MediaServlet.java 2007-08-28 22:46:41 UTC (rev 280)
@@ -6,15 +6,17 @@
import java.io.OutputStreamWriter;
import java.util.Date;
+import javax.naming.Context;
+import javax.naming.NamingException;
import javax.servlet.ServletConfig;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
+import com.ogoglio.appdev.servlet.AbstractResourceServlet;
+import com.ogoglio.appdev.servlet.SiteResource;
import com.ogoglio.client.DecoratedInputStream;
import com.ogoglio.media.FileStore;
-import com.ogoglio.site.AbstractResourceServlet;
-import com.ogoglio.site.SiteResource;
import com.ogoglio.util.StreamUtils;
public class MediaServlet extends AbstractResourceServlet {
@@ -23,12 +25,26 @@
public void init(ServletConfig config) throws ServletException {
super.init(config);
- File mediaDir = getSiteInfo().getMediaDirectory();
- if (mediaDir == null) {
- System.out.println(new Date() + ": NOTE: not running media service");
- return;
- }
- fileStore = new FileStore(getSiteInfo().getMediaDirectory().toURI());
+
+ Context envCtx;
+ try {
+ envCtx = (Context) initCtx.lookup("java:comp/env");
+ File mediaDirectory = null;
+ try {
+ mediaDirectory = new File((String)envCtx.lookup("ogoglio/mediaDirectory"));
+ } catch (NamingException e) {
+ }
+
+ if (mediaDirectory == null) {
+ System.out.println(new Date() + ": NOTE: not running media service");
+ } else {
+ fileStore = new FileStore(mediaDirectory.toURI());
+ }
+ } catch (NamingException e) {
+ System.out.println("Unable to figure out the initial context:"+e.getMessage());
+ throw new ServletException(e);
+ }
+
}
public void destroy() {
Modified: maven/trunk/ogoglio-server/src/main/java/com/ogoglio/migrate/AccountsForTesting.java
===================================================================
--- maven/trunk/ogoglio-server/src/main/java/com/ogoglio/migrate/AccountsForTesting.java 2007-08-28 22:40:51 UTC (rev 279)
+++ maven/trunk/ogoglio-server/src/main/java/com/ogoglio/migrate/AccountsForTesting.java 2007-08-28 22:46:41 UTC (rev 280)
@@ -8,8 +8,9 @@
import org.hibernate.SessionFactory;
+import com.ogoglio.appdev.migrate.Migration;
+import com.ogoglio.appdev.servlet.AbstractResourceServlet;
import com.ogoglio.persist.ServiceInitializationPersistTasks;
-import com.ogoglio.site.AbstractResourceServlet;
public class AccountsForTesting implements Migration {
Deleted: maven/trunk/ogoglio-server/src/main/java/com/ogoglio/migrate/DBVersionPersistTasks.java
===================================================================
--- maven/trunk/ogoglio-server/src/main/java/com/ogoglio/migrate/DBVersionPersistTasks.java 2007-08-28 22:40:51 UTC (rev 279)
+++ maven/trunk/ogoglio-server/src/main/java/com/ogoglio/migrate/DBVersionPersistTasks.java 2007-08-28 22:46:41 UTC (rev 280)
@@ -1,49 +0,0 @@
-package com.ogoglio.migrate;
-
-import org.hibernate.Query;
-import org.hibernate.Session;
-import org.hibernate.SessionFactory;
-
-import com.ogoglio.persist.HibernateTask;
-import com.ogoglio.persist.PersistException;
-
-public class DBVersionPersistTasks {
- public final static String FIND_VERSION = "com.ogoglio.migrate.dbversions";
-
- public static int findVersion(SessionFactory sessionFactory) throws PersistException {
- HibernateTask task = new HibernateTask() {
- public Object run(Session session) throws PersistException {
- Query query = session.getNamedQuery(FIND_VERSION);
- return query.uniqueResult();
- }
- };
- task.setSessionFactory(sessionFactory);
- return ((DBVersionRecord) task.execute()).getVersion();
- }
-
- public static boolean updateVersion(final int newVersion, final int expectedSize/* one or zero */, SessionFactory sessionFactory) throws PersistException {
- HibernateTask task = new HibernateTask() {
- public Object run(Session session) throws PersistException {
- Query query = session.getNamedQuery(FIND_VERSION);
- int size = query.list().size();
- DBVersionRecord rec;
- if (expectedSize != size) {
- System.out.println("Whoa! Size of returned result for db version record was (" + size + ") but should have been " + expectedSize + "!");
- return Boolean.FALSE;
- }
- if (size == 0) {
- rec = new DBVersionRecord();
- } else {
- rec = (DBVersionRecord) query.uniqueResult();
- }
- rec.setVersion(newVersion);
- session.saveOrUpdate(rec);
- System.out.println("******* Wrote new version FART:" + newVersion);
- return Boolean.TRUE;
- }
- };
- task.setSessionFactory(sessionFactory);
- return (task.execute().equals(Boolean.TRUE));
- }
-
-}
Deleted: maven/trunk/ogoglio-server/src/main/java/com/ogoglio/migrate/DBVersionRecord.java
===================================================================
--- maven/trunk/ogoglio-server/src/main/java/com/ogoglio/migrate/DBVersionRecord.java 2007-08-28 22:40:51 UTC (rev 279)
+++ maven/trunk/ogoglio-server/src/main/java/com/ogoglio/migrate/DBVersionRecord.java 2007-08-28 22:46:41 UTC (rev 280)
@@ -1,28 +0,0 @@
-package com.ogoglio.migrate;
-
-public class DBVersionRecord {
- public static int INTERNAL_DEV_STATE = -8288;
-
- private int version = 0;
-
- private long id;
-
- public DBVersionRecord() {
- }
-
- public long getVersionId() {
- return id;
- }
-
- public void setVersionId(long id) {
- this.id = id;
- }
-
- public int getVersion() {
- return version;
- }
-
- public void setVersion(int version) {
- this.version = version;
- }
-}
Deleted: maven/trunk/ogoglio-server/src/main/java/com/ogoglio/migrate/DBZapTest.java
===================================================================
--- maven/trunk/ogoglio-server/src/main/java/com/ogoglio/migrate/DBZapTest.java 2007-08-28 22:40:51 UTC (rev 279)
+++ maven/trunk/ogoglio-server/src/main/java/com/ogoglio/migrate/DBZapTest.java 2007-08-28 22:46:41 UTC (rev 280)
@@ -1,36 +0,0 @@
-package com.ogoglio.migrate;
-
-import junit.framework.TestCase;
-
-import org.hibernate.SessionFactory;
-
-public class DBZapTest extends TestCase {
-
- protected SessionFactory sessionFactory;
-
- public void setUp() {
- try {
- MigrationSupport support = new MigrationSupport();
- if (!("true".equals(support.getTestConfig().getProperty("ogoglio.okToZapDB")))) {
- fail("Whoa! Shouldn't be running tests without setting the ogoglio.okToZapDB property!");
- }
- if (support.initialize_version(null, null, false) == false) {
- fail("can't get DB set up: trying to initialize it in the test code");
- }
-
- //if we are here, db stuff worked, but we still need to avoid all the jndi stuff
- sessionFactory = support.createConfigurationForHibernate(MigrationSupport.DB_VERSION_NUMBER, null, false).buildSessionFactory();
- } catch (Exception e) {
- System.out.println("-------");
- e.printStackTrace(System.out);
- System.out.println("---------");
- fail("Could not setup:" + e.getMessage());
- }
- }
-
- public void tearDown() {
- if (sessionFactory != null) {
- sessionFactory.close();
- }
- }
-}
Deleted: maven/trunk/ogoglio-server/src/main/java/com/ogoglio/migrate/Migration.java
===================================================================
--- maven/trunk/ogoglio-server/src/main/java/com/ogoglio/migrate/Migration.java 2007-08-28 22:40:51 UTC (rev 279)
+++ maven/trunk/ogoglio-server/src/main/java/com/ogoglio/migrate/Migration.java 2007-08-28 22:46:41 UTC (rev 280)
@@ -1,14 +0,0 @@
-package com.ogoglio.migrate;
-
-import java.util.Properties;
-
-import javax.naming.Context;
-import javax.servlet.ServletConfig;
-
-import org.hibernate.SessionFactory;
-
-public interface Migration {
-
- public boolean migrate(SessionFactory sessionFactory, ServletConfig servletConfig, Context ctx, Properties testConfig, int from, int to);
-
-}
Deleted: maven/trunk/ogoglio-server/src/main/java/com/ogoglio/migrate/MigrationSupport.java
===================================================================
--- maven/trunk/ogoglio-server/src/main/java/com/ogoglio/migrate/MigrationSupport.java 2007-08-28 22:40:51 UTC (rev 279)
+++ maven/trunk/ogoglio-server/src/main/java/com/ogoglio/migrate/MigrationSupport.java 2007-08-28 22:46:41 UTC (rev 280)
@@ -1,172 +0,0 @@
-package com.ogoglio.migrate;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.Properties;
-
-import javax.naming.Context;
-import javax.naming.NamingException;
-import javax.servlet.ServletConfig;
-
-import org.hibernate.SessionFactory;
-import org.hibernate.cfg.Configuration;
-
-import com.ogoglio.persist.PersistException;
-
-public class MigrationSupport {
-
- // THIS IS THE CRITICAL VERSION NUMBER
- public static final int DB_VERSION_NUMBER = 1;
-
- //check on migration okayness
- public static final String MIGRATION_KEY = "ogoglio/okToMigrateDB";
-
- // this is the set of semantic migrations, in order
- public static final Migration[] migration = { new AccountsForTesting() };
-
- public MigrationSupport() {
- }
-
- public boolean verifyVersion(ServletConfig servletConf, Context ctx) {
- try {
- SessionFactory sessionFactory = getCurrentConfiguration().buildSessionFactory();
- int version = DBVersionPersistTasks.findVersion(sessionFactory);
- if (version != DB_VERSION_NUMBER) {
- System.err.println("DB Version Mismatch! Expected (" + DB_VERSION_NUMBER + ") but got " + version + "!");
- sessionFactory.close();
- return tryUpgrade(servletConf, ctx, version, DB_VERSION_NUMBER, "update", true);
- }
- sessionFactory.close();
- return true; // we are at the expected version
- } catch (PersistException e) {
- if (e.innerThrowable == null) {
- System.out.println("Serious problem with hibernate:" + e.getMessage());
- return false;
- }
- System.err.println("Unable to figure out DB version number. Likely this is a fresh database....(" + e.innerThrowable.getClass().getName() + ")");
- return initialize_version(servletConf, ctx, true);
- }
- }
-
- public boolean initialize_version(ServletConfig conf, Context ctx, boolean useJNDI) {
- Configuration configuration = createConfigurationForHibernate(0, "create", useJNDI);
- try {
- SessionFactory factory = configuration.buildSessionFactory();
- if (setVersionNumberOfDbViaQuery(factory, 0, 0) == false) {
- factory.close();
- return false;
- }
- factory.close();
- return tryUpgrade(conf, ctx, 0, DB_VERSION_NUMBER, "create", useJNDI);
- } catch (Throwable e) {
- System.err.println("Error trying initialized DB:" + e.getMessage());
- return false;
- }
-
- }
-
- public Configuration getCurrentConfiguration() {
- return createConfigurationForHibernate(DB_VERSION_NUMBER, null, true);
- }
-
- public Configuration createConfigurationForHibernate(int num, String autoSetting, boolean useJNDI) {
- Configuration configuration = new Configuration();
- if (autoSetting != null) {
- configuration.setProperty("hibernate.hbm2ddl.auto", autoSetting);
- }
- if (useJNDI) {
- configuration.setProperty("hibernate.connection.datasource", "java:comp/env/jdbc/space");
- } else {
- Properties p = new Properties();
- try {
- p.load(getClass().getResourceAsStream("/test-config.properties"));
- configuration.addProperties(p);
- } catch (IOException e) {
- System.err.println("Unable to find the test configuration file!" + e.getMessage());
- return configuration.configure();
- }
- }
- configuration.addResource("com/ogoglio/migrate/migration-" + num + ".xml");
- return configuration.configure();
- }
-
- private boolean setVersionNumberOfDbViaQuery(SessionFactory sessionFactory, int targetVersion, int expectedSize) {
- try {
- return DBVersionPersistTasks.updateVersion(targetVersion, expectedSize, sessionFactory);
- } catch (PersistException e) {
- System.err.println("Problem updating the version of the database to version " + targetVersion + ":" + e.getMessage());
- return false;
- }
- }
-
- public boolean tryUpgrade(ServletConfig servletConfig, Context ctx, int db_is, int db_wants_to_be, String ddlMode, boolean useJNDI) {
- if (migration.length != DB_VERSION_NUMBER) {
- System.out.println("Internal error! Migration list length should be " + DB_VERSION_NUMBER + " but is " + migration.length + "!");
- return false;
- }
- Properties testConfig = new Properties();
- boolean canMigrate = false;
- if (ctx == null) {
- //in test mode
- testConfig = getTestConfig();
- if ("true".equals(testConfig.getProperty("ogoglio.okToMigrateDB"))) {
- canMigrate = true;
- }
- } else {
- //not testing, but might be integration testing
- try {
- String migrate = (String) ctx.lookup(MIGRATION_KEY);
- if ("true".equals(migrate)) {
- canMigrate = true;
- }
- } catch (NamingException e) {
- System.err.println("Naming exception trying to access " + MIGRATION_KEY + " from naming context!");
- }
- }
-
- if (!canMigrate) {
- System.err.println("Cannot migrate data! Property ogoglio.okToMigrateDB is false or non-existent!");
- return false;
- }
-
- for (int i = db_is; i < db_wants_to_be; ++i) {
- Migration current = migration[i];
- System.out.println("------------------------------------------------\n");
- System.out.println("DB: Attempting migration from " + i + " to " + (i + 1) + "...");
-
- //try to get hibernate to do the work
- Configuration config = createConfigurationForHibernate(i + 1, ddlMode, useJNDI);
- SessionFactory factory = config.buildSessionFactory();
-
- //subtle: if the ddlMode is create, hibernate blows away all the data (including our version number record)
- int expectedRecords = 1;
- if ("create".equals(ddlMode)) {
- expectedRecords = 0;
- }
- setVersionNumberOfDbViaQuery(factory, i + 1, expectedRecords);
-
- if (!current.migrate(factory, servletConfig, ctx, testConfig, i, i + 1)) {
- factory.close();
- return false;
- }
- factory.close();
- System.out.println("------------------------------------------------\n");
- }
- return true;
- }
-
- public Properties getTestConfig() {
- Properties testConfig = new Properties();
- InputStream is = getClass().getResourceAsStream("/test-config.properties");
- if (is == null) {
- System.err.println("Warning! Unable to find test-config.properties! Probably something is broken!");
- } else {
- try {
- testConfig.load(is);
- } catch (IOException e) {
- System.err.println("Warning! Error reading test-config.properties! " + e.getMessage());
- }
- }
- return testConfig;
- }
-}
Added: maven/trunk/ogoglio-server/src/main/java/com/ogoglio/migrate/OgoglioServerMigration.java
===================================================================
--- maven/trunk/ogoglio-server/src/main/java/com/ogoglio/migrate/OgoglioServerMigration.java (rev 0)
+++ maven/trunk/ogoglio-server/src/main/java/com/ogoglio/migrate/OgoglioServerMigration.java 2007-08-28 22:46:41 UTC (rev 280)
@@ -0,0 +1,29 @@
+package com.ogoglio.migrate;
+
+import com.ogoglio.appdev.migrate.Migration;
+import com.ogoglio.appdev.migrate.MigrationSupport;
+
+public class OgoglioServerMigration extends MigrationSupport {
+
+ public static final OgoglioServerMigration SINGLETON = new OgoglioServerMigration();
+
+ // THIS IS THE CRITICAL VERSION NUMBER
+ private static final int DB_VERSION_NUMBER = 1;
+
+ // this is the set of semantic migrations, in order
+ private static final Migration[] migration = { new AccountsForTesting() };
+
+ public Migration[] migrationList() {
+ return migration;
+ }
+
+ public int versionNumber() {
+ return DB_VERSION_NUMBER;
+ }
+
+ private OgoglioServerMigration() {
+
+ }
+
+
+}
Modified: maven/trunk/ogoglio-server/src/main/java/com/ogoglio/persist/AccountPersistTasks.java
===================================================================
--- maven/trunk/ogoglio-server/src/main/java/com/ogoglio/persist/AccountPersistTasks.java 2007-08-28 22:40:51 UTC (rev 279)
+++ maven/trunk/ogoglio-server/src/main/java/com/ogoglio/persist/AccountPersistTasks.java 2007-08-28 22:46:41 UTC (rev 280)
@@ -18,6 +18,8 @@
import org.hibernate.Session;
import org.hibernate.SessionFactory;
+import com.ogoglio.appdev.persist.HibernateTask;
+import com.ogoglio.appdev.persist.PersistException;
import com.ogoglio.xml.AccountDocument;
public class AccountPersistTasks {
Modified: maven/trunk/ogoglio-server/src/main/java/com/ogoglio/persist/BodyPersistTasks.java
===================================================================
--- maven/trunk/ogoglio-server/src/main/java/com/ogoglio/persist/BodyPersistTasks.java 2007-08-28 22:40:51 UTC (rev 279)
+++ maven/trunk/ogoglio-server/src/main/java/com/ogoglio/persist/BodyPersistTasks.java 2007-08-28 22:46:41 UTC (rev 280)
@@ -17,6 +17,8 @@
import org.hibernate.Session;
import org.hibernate.SessionFactory;
+import com.ogoglio.appdev.persist.HibernateTask;
+import com.ogoglio.appdev.persist.PersistException;
import com.ogoglio.xml.BodyDocument;
public class BodyPersistTasks {
Deleted: maven/trunk/ogoglio-server/src/main/java/com/ogoglio/persist/HibernateTask.java
===================================================================
--- maven/trunk/ogoglio-server/src/main/java/com/ogoglio/persist/HibernateTask.java 2007-08-28 22:40:51 UTC (rev 279)
+++ maven/trunk/ogoglio-server/src/main/java/com/ogoglio/persist/HibernateTask.java 2007-08-28 22:46:41 UTC (rev 280)
@@ -1,83 +0,0 @@
-/* Copyright 2007 Transmutable (http://transmutable.com/)
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License. */
-package com.ogoglio.persist;
-
-import org.hibernate.Session;
-import org.hibernate.SessionFactory;
-import org.hibernate.StaleObjectStateException;
-import org.hibernate.Transaction;
-
-public abstract class HibernateTask {
-
- private SessionFactory sessionFactory = null;
-
- public HibernateTask() {
- }
-
- public void setSessionFactory(SessionFactory sessionFactory) {
- this.sessionFactory = sessionFactory;
- }
-
- public abstract Object run(Session hibernateSession) throws PersistException;
-
- public Object execute() throws PersistException {
- Session hibernateSession = sessionFactory.openSession();
- Transaction transaction = hibernateSession.beginTransaction();
- try {
- Object result = run(hibernateSession);
- transaction.commit();
- return result;
- } catch (StaleObjectStateException staleEx) {
- System.err.println("This interceptor does not implement optimistic concurrency control!");
- System.err.println("Your application will not work until you add compensation actions!");
- throw new PersistException("This DB is not supported.");
- } catch (PersistException ex) {
- try {
- if (transaction.isActive()) {
- transaction.rollback();
- }
- } catch (Throwable rbEx) {
- }
- throw ex;
- } catch (Throwable ex) { //catches things that are created by Hibernate that are not PersistException
- System.err.println("TRUE TYPE OF CAUGHT EXCEPTION:"+ex.getClass().getName());
- System.err.println("ORIG STACK TRACE");
- ex.printStackTrace();
- try {
- if (transaction.isActive()) {
- transaction.rollback();
- }
- } catch (Throwable rbEx) {
- }
- // XXX This is really dodgy. This changes the type of the error from it's
- // XXX true type (for example LazyInitializationException) to the PersistException
- // XXX which I can only assume is to make the throws clauses easier. Ugh.
- throw new PersistException(ex,"Hibernate error: " + ex);
- } finally {
- hibernateSession.close();
- }
- }
-
- public static boolean equals(Object obj1, Object obj2) {
- if (obj1 == obj2) {
- return true;
- }
- if (obj1 != null) {
- return obj1.equals(obj2);
- } else {
- return obj2.equals(obj1);
- }
-
- }
-}
\ No newline at end of file
Modified: maven/trunk/ogoglio-server/src/main/java/com/ogoglio/persist/PendingEmailValidationTasks.java
===================================================================
--- maven/trunk/ogoglio-server/src/main/java/com/ogoglio/persist/PendingEmailValidationTasks.java 2007-08-28 22:40:51 UTC (rev 279)
+++ maven/trunk/ogoglio-server/src/main/java/com/ogoglio/persist/PendingEmailValidationTasks.java 2007-08-28 22:46:41 UTC (rev 280)
@@ -4,6 +4,9 @@
import org.hibernate.Session;
import org.hibernate.SessionFactory;
+import com.ogoglio.appdev.persist.HibernateTask;
+import com.ogoglio.appdev.persist.PersistException;
+
public class PendingEmailValidationTasks {
public static final String PEV_BY_USERNAME = "com.ogoglio.persist.pendingEmailValidationsByUsername";
Deleted: maven/trunk/ogoglio-server/src/main/java/com/ogoglio/persist/PersistException.java
===================================================================
--- maven/trunk/ogoglio-server/src/main/java/com/ogoglio/persist/PersistException.java 2007-08-28 22:40:51 UTC (rev 279)
+++ maven/trunk/ogoglio-server/src/main/java/com/ogoglio/persist/PersistException.java 2007-08-28 22:46:41 UTC (rev 280)
@@ -1,31 +0,0 @@
-/* Copyright 2007 Transmutable (http://transmutable.com/)
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License. */
-package com.ogoglio.persist;
-
-public class PersistException extends Exception {
-
- public Throwable innerThrowable;
-
- public PersistException() {
- }
-
- public PersistException(Throwable throwable, String string) {
- super(string);
- this.innerThrowable=throwable;
- }
-
- public PersistException(String string) {
- this(null,string);
- }
-}
Modified: maven/trunk/ogoglio-server/src/main/java/com/ogoglio/persist/PossessionPersistTasks.java
===================================================================
--- maven/trunk/ogoglio-server/src/main/java/com/ogoglio/persist/PossessionPersistTasks.java 2007-08-28 22:40:51 UTC (rev 279)
+++ maven/trunk/ogoglio-server/src/main/java/com/ogoglio/persist/PossessionPersistTasks.java 2007-08-28 22:46:41 UTC (rev 280)
@@ -17,6 +17,8 @@
import org.hibernate.Session;
import org.hibernate.SessionFactory;
+import com.ogoglio.appdev.persist.HibernateTask;
+import com.ogoglio.appdev.persist.PersistException;
import com.ogoglio.xml.PossessionDocument;
public class PossessionPersistTasks {
Modified: maven/trunk/ogoglio-server/src/main/java/com/ogoglio/persist/ServiceInitializationPersistTasks.java
===================================================================
--- maven/trunk/ogoglio-server/src/main/java/com/ogoglio/persist/ServiceInitializationPersistTasks.java 2007-08-28 22:40:51 UTC (rev 279)
+++ maven/trunk/ogoglio-server/src/main/java/com/ogoglio/persist/ServiceInitializationPersistTasks.java 2007-08-28 22:46:41 UTC (rev 280)
@@ -18,6 +18,7 @@
import org.hibernate.SessionFactory;
+import com.ogoglio.appdev.persist.PersistException;
import com.ogoglio.client.WebAPIUtil;
public class ServiceInitializationPersistTasks {
Modified: maven/trunk/ogoglio-server/src/main/java/com/ogoglio/persist/ServiceStateTasks.java
===================================================================
--- maven/trunk/ogoglio-server/src/main/java/com/ogoglio/persist/ServiceStateTasks.java 2007-08-28 22:40:51 UTC (rev 279)
+++ maven/trunk/ogoglio-server/src/main/java/com/ogoglio/persist/ServiceStateTasks.java 2007-08-28 22:46:41 UTC (rev 280)
@@ -4,6 +4,8 @@
import org.hibernate.Session;
import org.hibernate.SessionFactory;
+import com.ogoglio.appdev.persist.HibernateTask;
+import com.ogoglio.appdev.persist.PersistException;
import com.ogoglio.xml.ServiceStateDocument;
public class ServiceStateTasks {
Modified: maven/trunk/ogoglio-server/src/main/java/com/ogoglio/persist/SimPersistTasks.java
===================================================================
--- maven/trunk/ogoglio-server/src/main/java/com/ogoglio/persist/SimPersistTasks.java 2007-08-28 22:40:51 UTC (rev 279)
+++ maven/trunk/ogoglio-server/src/main/java/com/ogoglio/persist/SimPersistTasks.java 2007-08-28 22:46:41 UTC (rev 280)
@@ -19,6 +19,9 @@
import org.hibernate.Session;
import org.hibernate.SessionFactory;
+import com.ogoglio.appdev.persist.HibernateTask;
+import com.ogoglio.appdev.persist.PersistException;
+
public class SimPersistTasks {
public static final String SIM_BY_URI = "com.ogoglio.persist.simByURI";
Modified: maven/trunk/ogoglio-server/src/main/java/com/ogoglio/persist/SpaceMemberPersistTasks.java
===================================================================
--- maven/trunk/ogoglio-server/src/main/java/com/ogoglio/persist/SpaceMemberPersistTasks.java 2007-08-28 22:40:51 UTC (rev 279)
+++ maven/trunk/ogoglio-server/src/main/java/com/ogoglio/persist/SpaceMemberPersistTasks.java 2007-08-28 22:46:41 UTC (rev 280)
@@ -17,6 +17,8 @@
import org.hibernate.Session;
import org.hibernate.SessionFactory;
+import com.ogoglio.appdev.persist.HibernateTask;
+import com.ogoglio.appdev.persist.PersistException;
import com.ogoglio.xml.SpaceMemberDocument;
public class SpaceMemberPersistTasks {
Modified: maven/trunk/ogoglio-server/src/main/java/com/ogoglio/persist/SpacePersistTasks.java
===================================================================
--- maven/trunk/ogoglio-server/src/main/java/com/ogoglio/persist/SpacePersistTasks.java 2007-08-28 22:40:51 UTC (rev 279)
+++ maven/trunk/ogoglio-server/src/main/java/com/ogoglio/persist/SpacePersistTasks.java 2007-08-28 22:46:41 UTC (rev 280)
@@ -19,6 +19,8 @@
import org.hibernate.Session;
import org.hibernate.SessionFactory;
+import com.ogoglio.appdev.persist.HibernateTask;
+import com.ogoglio.appdev.persist.PersistException;
import com.ogoglio.xml.PossessionDocument;
import com.ogoglio.xml.SpaceDocument;
Modified: maven/trunk/ogoglio-server/src/main/java/com/ogoglio/persist/TemplatePersistTasks.java
===================================================================
--- maven/trunk/ogoglio-server/src/main/java/com/ogoglio/persist/TemplatePersistTasks.java 2007-08-28 22:40:51 UTC (rev 279)
+++ maven/trunk/ogoglio-server/src/main/java/com/ogoglio/persist/TemplatePersistTasks.java 2007-08-28 22:46:41 UTC (rev 280)
@@ -20,6 +20,8 @@
import org.hibernate.Session;
import org.hibernate.SessionFactory;
+import com.ogoglio.appdev.persist.HibernateTask;
+import com.ogoglio.appdev.persist.PersistException;
import com.ogoglio.xml.TemplateDocument;
Modified: maven/trunk/ogoglio-server/src/main/java/com/ogoglio/persist/TemplateSupportFilePersistTasks.java
===================================================================
--- maven/trunk/ogoglio-server/src/main/java/com/ogoglio/persist/TemplateSupportFilePersistTasks.java 2007-08-28 22:40:51 UTC (rev 279)
+++ maven/trunk/ogoglio-server/src/main/java/com/ogoglio/persist/TemplateSupportFilePersistTasks.java 2007-08-28 22:46:41 UTC (rev 280)
@@ -3,6 +3,9 @@
import org.hibernate.Session;
import org.hibernate.SessionFactory;
+import com.ogoglio.appdev.persist.HibernateTask;
+import com.ogoglio.appdev.persist.PersistException;
+
public class TemplateSupportFilePersistTasks {
public static TemplateSupportFileRecord createSupportFileForMaterial(final String filename,
Modified: maven/trunk/ogoglio-server/src/main/java/com/ogoglio/sim/Sim.java
===================================================================
--- maven/trunk/ogoglio-server/src/main/java/com/ogoglio/sim/Sim.java 2007-08-28 22:40:51 UTC (rev 279)
+++ maven/trunk/ogoglio-server/src/main/java/com/ogoglio/sim/Sim.java 2007-08-28 22:46:41 UTC (rev 280)
@@ -24,9 +24,9 @@
import org.hibernate.SessionFactory;
+import com.ogoglio.appdev.persist.PersistException;
import com.ogoglio.media.MediaService;
import com.ogoglio.message.PayloadFactory;
-import com.ogoglio.persist.PersistException;
import com.ogoglio.persist.SimRecord;
import com.ogoglio.persist.SpacePersistTasks;
import com.ogoglio.persist.SpaceRecord;
@@ -51,8 +51,6 @@
public static final int MAX_SETTING_KEY_SIZE = 512;
- public static final int MAX_SETTING_VALUE_SIZE = 10240;
-
public static final long SNAPSHOT_FREQUENCY = 5 * 60 * 1000;
public static final long VACANCY_TIME_TILL_SHUTDOWN = 1 * 60 * 1000;
Modified: maven/trunk/ogoglio-server/src/main/java/com/ogoglio/sim/site/SimServlet.java
===================================================================
--- maven/trunk/ogoglio-server/src/main/java/com/ogoglio/sim/site/SimServlet.java 2007-08-28 22:40:51 UTC (rev 279)
+++ maven/trunk/ogoglio-server/src/main/java/com/ogoglio/sim/site/SimServlet.java 2007-08-28 22:46:41 UTC (rev 280)
@@ -29,9 +29,10 @@
import nanoxml.XMLElement;
+import com.ogoglio.appdev.persist.PersistException;
+import com.ogoglio.appdev.servlet.SiteResource;
import com.ogoglio.media.MediaService;
import com.ogoglio.persist.AccountRecord;
-import com.ogoglio.persist.PersistException;
import com.ogoglio.persist.SimPersistTasks;
import com.ogoglio.persist.SimRecord;
import com.ogoglio.persist.SpacePersistTasks;
@@ -40,9 +41,9 @@
import com.ogoglio.sim.SpaceSimulator;
import com.ogoglio.sim.script.ScriptContextFactory;
import com.ogoglio.sim.script.ScriptHTTPRequest;
-import com.ogoglio.site.AbstractResourceServlet;
import com.ogoglio.site.AuthServlet;
-import com.ogoglio.site.SiteResource;
+import com.ogoglio.site.OgoglioServletBase;
+import com.ogoglio.site.SiteInfo;
import com.ogoglio.site.SpaceServlet;
import com.ogoglio.util.StreamUtils;
import com.ogoglio.xml.DoorDocument;
@@ -55,7 +56,7 @@
import com.ogoglio.xml.UserDocument;
import com.ogoglio.xml.server.DocumentFactory;
-public class SimServlet extends AbstractResourceServlet {
+public class SimServlet extends OgoglioServletBase {
private static final String RELOAD_PARAMETER = "reload";
private Sim sim = null;
Deleted: maven/trunk/ogoglio-server/src/main/java/com/ogoglio/site/AbstractRemoteServlet.java
===================================================================
--- maven/trunk/ogoglio-server/src/main/java/com/ogoglio/site/AbstractRemoteServlet.java 2007-08-28 22:40:51 UTC (rev 279)
+++ maven/trunk/ogoglio-server/src/main/java/com/ogoglio/site/AbstractRemoteServlet.java 2007-08-28 22:46:41 UTC (rev 280)
@@ -1,88 +0,0 @@
-package com.ogoglio.site;
-
-import java.io.IOException;
-import java.net.URI;
-import java.net.URISyntaxException;
-
-import javax.naming.Context;
-import javax.naming.InitialContext;
-import javax.naming.NamingException;
-import javax.servlet.ServletConfig;
-import javax.servlet.ServletException;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-import com.ogoglio.client.AuthenticationFailedException;
-import com.ogoglio.client.WebAPIAuthenticator;
-import com.ogoglio.client.WebAPIAuthenticatorFactory;
-import com.ogoglio.client.WebAPIClient;
-import com.ogoglio.client.WebAPIClientWire;
-import com.ogoglio.client.WebAPIDescriptor;
-import com.ogoglio.site.AbstractResourceServlet;
-import com.ogoglio.site.AuthServlet;
-import com.ogoglio.util.ArgumentUtils;
-import com.ogoglio.xml.AuthDocument;
-
-public abstract class AbstractRemoteServlet extends AbstractResourceServlet {
-
- private WebAPIClient ogoglioClient = null;
-
- private String ogoglioUsername = null;
-
- private String ogoglioPassword = null;
-
- public abstract String getOgoglioUsernameContextKey();
-
- public abstract String getOgoglioPasswordContextKey();
-
- public void init(ServletConfig config) throws ServletException {
- super.init(config);
- try {
- Context initCtx = new InitialContext();
- Context envCtx = (Context) initCtx.lookup("java:comp/env");
-
- ogoglioUsername = (String) envCtx.lookup(getOgoglioUsernameContextKey());
- ArgumentUtils.assertNotEmpty(ogoglioUsername);
- ogoglioPassword = (String) envCtx.lookup(getOgoglioPasswordContextKey());
- ArgumentUtils.assertNotEmpty(ogoglioPassword);
- } catch (NamingException e) {
- throw new ServletException("Could not init EventServlet (probably forgot env variables in setup.xml): " + e);
- }
- }
-
- public void service(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException {
- if (ogoglioClient == null) {
- try {
- WebAPIClientWire wire = new WebAPIClientWire();
- URI serviceURI = new URI(getSiteInfo().getBaseUrl());
- WebAPIDescriptor descriptor = new WebAPIDescriptor(serviceURI);
- WebAPIAuthenticator authenticator = new WebAPIAuthenticatorFactory().authenticate(wire, descriptor, ogoglioUsername, ogoglioPassword);
- ogoglioClient = new WebAPIClient(new WebAPIDescriptor(serviceURI), authenticator, wire);
- } catch (URISyntaxException e) {
- throw new ServletException("Could not connect to ogoglio service: " + e);
- } catch (IOException e) {
- throw new ServletException("Failed because of Ogoglio service communication failure: " + e);
- } catch (AuthenticationFailedException e) {
- throw new ServletException("Failed because of Ogoglio service auth failure: " + e);
- }
- }
-
- super.service(request, response);
- }
-
- public AuthDocument getAuthDocument(HttpServletRequest request) throws IOException {
- String authCookie = AuthServlet.getRequestAuthCookie(request);
- if (authCookie == null) {
- return null;
- }
- return getOgoglioClient().getAuthDocumentByAuthCookie(authCookie);
- }
-
- public WebAPIClient getOgoglioClient() {
- return ogoglioClient;
- }
-
- public String getOgoglioUsername() {
- return ogoglioUsername;
- }
-}
Deleted: maven/trunk/ogoglio-server/src/main/java/com/ogoglio/site/AbstractResourceServlet.java
===================================================================
--- maven/trunk/ogoglio-server/src/main/java/com/ogoglio/site/AbstractResourceServlet.java 2007-08-28 22:40:51 UTC (rev 279)
+++ maven/trunk/ogoglio-server/src/main/java/com/ogoglio/site/AbstractResourceServlet.java 2007-08-28 22:46:41 UTC (rev 280)
@@ -1,318 +0,0 @@
-/* Copyright 2007 Transmutable (http://transmutable.com/)
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License. */
-package com.ogoglio.site;
-
-import java.io.File;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.net.HttpURLConnection;
-import java.net.URI;
-import java.net.URISyntaxException;
-import java.util.Collection;
-import java.util.Enumeration;
-import java.util.Iterator;
-import java.util.Map;
-
-import javax.naming.Context;
-import javax.naming.InitialContext;
-import javax.naming.NamingException;
-import javax.servlet.ServletConfig;
-import javax.servlet.ServletException;
-import javax.servlet.http.HttpServlet;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-import org.apache.commons.fileupload.FileItem;
-import org.apache.commons.fileupload.FileItemFactory;
-import org.apache.commons.fileupload.FileUploadException;
-import org.apache.commons.fileupload.disk.DiskFileItemFactory;
-import org.apache.commons.fileupload.servlet.ServletFileUpload;
-import org.hibernate.SessionFactory;
-
-import com.ogoglio.media.MediaService;
-import com.ogoglio.migrate.MigrationSupport;
-import com.ogoglio.sim.Sim;
-import com.ogoglio.util.StreamUtils;
-
-public abstract class AbstractResourceServlet extends HttpServlet {
-
- public static final String OGOGLIO_BASE_URL_KEY = "ogoglio/baseURL";
-
- private static final String HIBERNATE_SESSION_FACTORY_KEY = "com.ogoglio.hibernateSessionFactory";
-
- private static final String METHOD_PARAM = "method";
-
- private SiteResource baseResource = null;
-
- private boolean noCache = true;
-
- private SessionFactory hibernateSessionFactory = null;
-
- private SiteInfo siteInfo = null;
-
- private MediaService mediaService = null;
-
- public abstract SiteResource createBaseResource(ServletConfig servletConfig);
-
- public void init(ServletConfig config) throws ServletException {
- Context initCtx=null, envCtx=null;
- try {
- initCtx = new InitialContext();
- //creates a context on EVERY servlet? the actual VALUE of the data source is inserted by
- //hibernate configuration
- envCtx = (Context) initCtx.lookup("java:comp/env");
-
- String baseUrl = (String) envCtx.lookup(OGOGLIO_BASE_URL_KEY);
- String mediaUrl = (String) envCtx.lookup("ogoglio/mediaURL");
- boolean simsAllowRemoteAccess = "true".equals(envCtx.lookup("ogoglio/simsAllowRemoteAccess"));
- File mediaDirectory = null;
- try {
- mediaDirectory = new File((String)envCtx.lookup("ogoglio/mediaDirectory"));
- } catch (NamingException e) {
- }
-
- File mailDir = null;
- try {
- mailDir = new File((String)envCtx.lookup("ogoglio/mailDirectory"));
- } catch (NamingException e) {
- }
-
- siteInfo = new SiteInfo(baseUrl, mediaUrl, simsAllowRemoteAccess, mediaDirectory, mailDir);
-
- mediaService = new MediaService(new URI(siteInfo.getMediaUrl()));
- } catch (IOException e) {
- throw new ServletException("Could not init: " + e);
- } catch (URISyntaxException e) {
- throw new ServletException("Could not init: " + e);
- } catch (NamingException e) {
- throw new ServletException("Could not init: " + e);
- }
-
- super.init(config);
- hibernateSessionFactory = getOrCreateHibernateSessionFactory(config,envCtx);
- if (hibernateSessionFactory==null) {
- throw new IllegalStateException("Unable to create sensible hibernate configuration!");
- }
- baseResource = createBaseResource(config);
- if (!(baseResource.getPathElement() instanceof String)) {
- throw new IllegalStateException("The base resource must have a String path element: " + baseResource.getPathElement());
- }
- }
-
- public void destroy() {
- try {
- hibernateSessionFactory.close();
- } catch (Throwable e) {
- }
- super.destroy();
- }
-
- public SiteInfo getSiteInfo() {
- return siteInfo;
- }
-
- public MediaService getMediaService() {
- return mediaService;
- }
-
- public SessionFactory getSessionFactory() {
- return hibernateSessionFactory;
- }
-
-private static SessionFactory getOrCreateHibernateSessionFactory(ServletConfig config, Context context) {
- SessionFactory sessionFactory = (SessionFactory) config.getServletContext().getAttribute(HIBERNATE_SESSION_FACTORY_KEY);
- if (sessionFactory == null) {
- System.out.println(config.getServletName()+" checking DB Version...");
- MigrationSupport ms= new MigrationSupport();
- if (!ms.verifyVersion(config,context)) {
- throw new IllegalStateException("Cannot find a DB configuration for hibernate!");
- }
- sessionFactory= ms.getCurrentConfiguration().configure().buildSessionFactory();
- config.getServletContext().setAttribute(HIBERNATE_SESSION_FACTORY_KEY, sessionFactory);
- }
- return sessionFactory;
- }
- public static void setNoCache(HttpServletResponse response) {
- //IE caches XMLHttpRequest responses, so we set explicit no-cache headers
- response.addHeader("Cache-Control", "must-revalidate");
- response.addHeader("Cache-Control", "no-cache");
- response.addHeader("Cache-Control", "no-store");
- response.setDateHeader("Expires", 0);
- }
-
- 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);
- }
-
- URI requestURI = getRequestURI(request);
-
- String[] pathElements = getPathElements((String) baseResource.getPathElement(), requestURI);
-
- SiteResource requestedResource = getSiteResource(pathElements, baseResource);
-
- if (requestedResource == null) {
- response.setStatus(HttpServletResponse.SC_NOT_FOUND);
- return;
- }
-
- if (request.getMethod().equals("GET")) {
- if ("DELETE".equals(request.getParameter(METHOD_PARAM))) { //A workaround for WebKit
- requestedResource.doDelete(request, response, pathElements);
- } else {
- requestedResource.doGet(request, response, pathElements);
- }
- return;
- } else if (request.getMethod().equals("POST")) {
- requestedResource.doPost(request, response, pathElements);
- return;
- } else if (request.getMethod().equals("DELETE")) {
- requestedResource.doDelete(request, response, pathElements);
- return;
- } else if (request.getMethod().equals("PUT")) {
- requestedResource.doPut(request, response, pathElements);
- return;
- } else if (request.getMethod().equals("HEAD")) {
- requestedResource.doHead(request, response, pathElements);
- return;
- } else {
- response.setStatus(HttpServletResponse.SC_METHOD_NOT_ALLOWED);
- return;
- }
-
- }
-
- private SiteResource getSiteResource(String[] pathElements, SiteResource rootResource) {
-
- SiteResource currentPick = rootResource;
- for (int i = 0; i < pathElements.length && currentPick != null; i++) {
- if (i == pathElements.length - 1) {
- return currentPick;
- }
- currentPick = currentPick.getSubResource(pathElements[i + 1]);
- }
- return null;
- }
-
- private static URI getRequestURI(HttpServletRequest request) {
- try {
- return new URI(request.getRequestURL().toString());
- } catch (URISyntaxException e) {
- e.printStackTrace();
- throw new IllegalStateException("Bad request URI?!? " + request.getRequestURI());
- }
- }
-
- private static String[] getPathElements(String baseElement, URI uri) {
- String[] pathElements = uri.getPath().split("/");
- String[] pathFromSpace = null;
- for (int i = 0; i < pathElements.length; i++) {
- if (baseElement.equals(pathElements[i])) {
- pathFromSpace = new String[pathElements.length - i];
- for (int j = 0; j < pathFromSpace.length; j++) {
- pathFromSpace[j] = pathElements[j + i];
- }
- return pathFromSpace;
- }
- }
- return null;
- }
-
- public static void proxy(URI uri, String method, HttpServletRequest request, HttpServletResponse response) throws IOException {
- HttpURLConnection connection = (HttpURLConnection) uri.toURL().openConnection();
- connection.setRequestMethod(method);
- connection.setAllowUserInteraction(false);
- Enumeration headerNames = request.getHeaderNames();
- while (headerNames.hasMoreElements()) {
- String headerName = (String) headerNames.nextElement();
- connection.setRequestProperty(headerName, request.getHeader(headerName));
- }
-
- if ("POST".equals(method)) {
- connection.setDoOutput(true);
- InputStream requestInput = request.getInputStream();
- OutputStream outputStream = connection.getOutputStream();
- StreamUtils.write(requestInput, outputStream, -1);
- outputStream.flush();
- outputStream.close();
- }
-
- response.setStatus(connection.getResponseCode());
-
- Map headers = connection.getHeaderFields();
- String[] headerFields = (String[]) headers.keySet().toArray(new String[0]);
- for (int i = 0; i < headerFields.length; i++) {
- if (headerFields[i] == null) {
- continue;
- }
- String[] values = (String[]) ((Collection) headers.get(headerFields[i])).toArray(new String[0]); //It's lines like this that make me hate Java
- for (int j = 0; j < values.length; j++) {
- if (values[j] != null) {
- response.setHeader(headerFields[i], values[j]);
- }
- }
- }
-
- if (connection.getResponseCode() == 200) {
- InputStream input = connection.getInputStream();
- StreamUtils.write(input, response.getOutputStream(), -1);
- }
- }
-
- public static String getFirstStringValue(HttpServletRequest request) throws IOException {
- if (request.getContentType() != null && (request.getContentType().startsWith("application/x-www-form-urlencoded") || request.getContentType().startsWith("multipart/form-data"))) {
- Enumeration enumeration = request.getParameterNames();
- while (enumeration.hasMoreElements()) {
- String element = (String) enumeration.nextElement();
- if (element != null && !"null".equals(element)) { // *sigh*
- String newValue = request.getParameter(element);
- if (newValue != null) {
- return newValue;
- }
- }
- }
- return null;
- } else {
- return StreamUtils.readInput(request.getInputStream(), Sim.MAX_SETTING_VALUE_SIZE);
- }
- }
-
- public static InputStream getFirstFile(HttpServletRequest request, long maxSize) throws IOException {
- FileItemFactory factory = new DiskFileItemFactory();
- ServletFileUpload upload = new ServletFileUpload(factory);
- upload.setSizeMax(maxSize);
- try {
- Iterator iter = upload.parseRequest(request).iterator();
- while (iter.hasNext()) {
- FileItem item = (FileItem) iter.next();
-
- if (item.isFormField()) {
- //ignore it.
- } else {
- return item.getInputStream();
- }
- }
- } catch (FileUploadException e) {
- e.printStackTrace();
- throw new IOException(e.getMessage());
- }
- return null;
- }
-}
Modified: maven/trunk/ogoglio-server/src/main/java/com/ogoglio/site/AccountServlet.java
===================================================================
--- maven/trunk/ogoglio-server/src/main/java/com/ogoglio/site/AccountServlet.java 2007-08-28 22:40:51 UTC (rev 279)
+++ maven/trunk/ogoglio-server/src/main/java/com/ogoglio/site/AccountServlet.java 2007-08-28 22:46:41 UTC (rev 280)
@@ -27,6 +27,11 @@
import nanoxml.XMLElement;
+import com.ogoglio.appdev.migrate.MigrationSupport;
+import com.ogoglio.appdev.persist.PersistException;
+import com.ogoglio.appdev.servlet.DescendingSiteResource;
+import com.ogoglio.appdev.servlet.MigratedResourceServlet;
+import com.ogoglio.appdev.servlet.SiteResource;
import com.ogoglio.client.WebAPIClientWire;
import com.ogoglio.client.WebAPIUtil;
import com.ogoglio.mail.MailClient;
@@ -34,13 +39,13 @@
import com.ogoglio.mail.MailSendException;
import com.ogoglio.mail.MailTemplateFactory;
import com.ogoglio.media.MediaService;
+import com.ogoglio.migrate.OgoglioServerMigration;
import com.ogoglio.persist.AccountPersistTasks;
import com.ogoglio.persist.AccountRecord;
import com.ogoglio.persist.BodyPersistTasks;
import com.ogoglio.persist.BodyRecord;
import com.ogoglio.persist.PendingEmailValidationRecord;
import com.ogoglio.persist.PendingEmailValidationTasks;
-import com.ogoglio.persist.PersistException;
import com.ogoglio.persist.PossessionPersistTasks;
import com.ogoglio.persist.PossessionRecord;
import com.ogoglio.persist.ServiceStateRecord;
@@ -62,7 +67,7 @@
import com.ogoglio.xml.ThingDocument;
import com.ogoglio.xml.server.DocumentFactory;
-public class AccountServlet extends AbstractResourceServlet {
+public class AccountServlet extends OgoglioServletBase {
public static final String SECRET_PARAMETER = "secret";
Modified: maven/trunk/ogoglio-server/src/main/java/com/ogoglio/site/AuthServlet.java
===================================================================
--- maven/trunk/ogoglio-server/src/main/java/com/ogoglio/site/AuthServlet.java 2007-08-28 22:40:51 UTC (rev 279)
+++ maven/trunk/ogoglio-server/src/main/java/com/ogoglio/site/AuthServlet.java 2007-08-28 22:46:41 UTC (rev 280)
@@ -12,7 +12,6 @@
See the License for the specific language governing permissions and
limitations under the License. */
package com.ogoglio.site;
-
import java.io.IOException;
import java.util.Random;
@@ -24,26 +23,22 @@
import org.hibernate.SessionFactory;
+import com.ogoglio.appdev.persist.PersistException;
+import com.ogoglio.appdev.servlet.SiteResource;
import com.ogoglio.persist.AccountPersistTasks;
import com.ogoglio.persist.AccountRecord;
-import com.ogoglio.persist.PersistException;
+import com.ogoglio.util.WebConstants;
import com.ogoglio.xml.AccountDocument;
import com.ogoglio.xml.AuthDocument;
-public class AuthServlet extends AbstractResourceServlet {
+public class AuthServlet extends OgoglioServletBase{
public static final String AUTH_DATA_KEY = "authData";
- public static final String AUTH_COOKIE = "loginCookie";
-
- public static final String USERNAME_PARAM = "username";
-
- public static final String PASS_PARAM = "password";
-
public static final String LOGOUT_PARAM = "logout";
private Random random = new Random();
-
+
//TODO add a way to remove a login cookie from the db when people change their password
public SiteResource createBaseResource(ServletConfig servletConfig) {
@@ -118,7 +113,7 @@
return;
} else if ("true".equals(logoutParam)) {
request.getSession().removeAttribute(AUTH_DATA_KEY);
- Cookie logoutCookie = new Cookie(AUTH_COOKIE, "logMeOut");
+ Cookie logoutCookie = new Cookie(WebConstants.AUTH_COOKIE, "logMeOut");
logoutCookie.setPath("/");
logoutCookie.setMaxAge(0);
logoutCookie.setDomain(getSiteInfo().getHost());
@@ -150,12 +145,12 @@
public void doPost(HttpServletRequest request, HttpServletResponse response, String[] pathElements) throws ServletException, IOException {
try {
- String usernameParam = request.getParameter(USERNAME_PARAM);
- String passParam = request.getParameter(PASS_PARAM);
+ String usernameParam = request.getParameter(WebConstants.AUTH_USERNAME_PARAM);
+ String passParam = request.getParameter(WebConstants.AUTH_PASS_PARAM);
if (usernameParam != null || passParam != null) {
AccountRecord authedAccountRecord = authenticate(usernameParam, passParam);
if (authedAccountRecord != null) {
- Cookie newCookie = new Cookie(AUTH_COOKIE, authedAccountRecord.getCookie());
+ Cookie newCoo...
[truncated message content] |
|
From: <ian...@us...> - 2007-08-28 22:40:52
|
Revision: 279
http://ogoglio.svn.sourceforge.net/ogoglio/?rev=279&view=rev
Author: iansmith
Date: 2007-08-28 15:40:51 -0700 (Tue, 28 Aug 2007)
Log Message:
-----------
No significant changes (but failing test).
Modified Paths:
--------------
maven/trunk/ogoglio-integration-test/src/test/java/com/ogoglio/client/test/ClientTest.java
Modified: maven/trunk/ogoglio-integration-test/src/test/java/com/ogoglio/client/test/ClientTest.java
===================================================================
--- maven/trunk/ogoglio-integration-test/src/test/java/com/ogoglio/client/test/ClientTest.java 2007-08-28 22:40:16 UTC (rev 278)
+++ maven/trunk/ogoglio-integration-test/src/test/java/com/ogoglio/client/test/ClientTest.java 2007-08-28 22:40:51 UTC (rev 279)
@@ -104,6 +104,9 @@
adminWebClient.createAccount(USERNAME1, AccountDocument.ACCOUNT_LEVEL_ADVANCED, "Susan", "Examplar", "http://example.com/susan/", "su...@ex...", PASSWORD1);
adminWebClient.createAccount(USERNAME2, AccountDocument.ACCOUNT_LEVEL_ADVANCED, "Tina", "Examplar", "http://example.com/tina/", "ti...@ex...", PASSWORD1);
+ assertNotNull(adminWebClient.getAccountDocument(USERNAME1));
+ assertNotNull(adminWebClient.getAccountDocument(USERNAME2));
+
WebAPIAuthenticator basicAuthenticator = new WebAPIAuthenticatorFactory().authenticate(wire1, descriptor1, USERNAME1, PASSWORD1);
assertNotNull("got null auth cookie", basicAuthenticator.getAuthCookie());
WebAPIClient basicWebClient = new WebAPIClient(descriptor1, basicAuthenticator, wire1);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ian...@us...> - 2007-08-28 22:40:17
|
Revision: 278
http://ogoglio.svn.sourceforge.net/ogoglio/?rev=278&view=rev
Author: iansmith
Date: 2007-08-28 15:40:16 -0700 (Tue, 28 Aug 2007)
Log Message:
-----------
Changed some constants.
Modified Paths:
--------------
maven/trunk/ogoglio-common/src/main/java/com/ogoglio/util/WebConstants.java
maven/trunk/ogoglio-common/src/main/java/com/ogoglio/xml/SpaceDocument.java
Modified: maven/trunk/ogoglio-common/src/main/java/com/ogoglio/util/WebConstants.java
===================================================================
--- maven/trunk/ogoglio-common/src/main/java/com/ogoglio/util/WebConstants.java 2007-08-28 02:50:58 UTC (rev 277)
+++ maven/trunk/ogoglio-common/src/main/java/com/ogoglio/util/WebConstants.java 2007-08-28 22:40:16 UTC (rev 278)
@@ -15,7 +15,6 @@
public static final String GUEST_COOKIE_PREFIX = "guest";
-
private static Properties bootstrapProps=null;
public static String getBootstrapUsername() {
@@ -49,4 +48,5 @@
}
}
}
+
}
Modified: maven/trunk/ogoglio-common/src/main/java/com/ogoglio/xml/SpaceDocument.java
===================================================================
--- maven/trunk/ogoglio-common/src/main/java/com/ogoglio/xml/SpaceDocument.java 2007-08-28 02:50:58 UTC (rev 277)
+++ maven/trunk/ogoglio-common/src/main/java/com/ogoglio/xml/SpaceDocument.java 2007-08-28 22:40:16 UTC (rev 278)
@@ -37,6 +37,8 @@
public static final String SIM_ID = "simid";
+ public static final int MAX_SETTING_VALUE_SIZE = 10240;
+
XMLElement data = null;
public SpaceDocument(long spaceID, String displayName, String ownerUsername, boolean published, int maxGuests, boolean displaySea, double seaLevel, long simID) {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <tre...@us...> - 2007-08-28 02:51:03
|
Revision: 277
http://ogoglio.svn.sourceforge.net/ogoglio/?rev=277&view=rev
Author: trevorolio
Date: 2007-08-27 19:50:58 -0700 (Mon, 27 Aug 2007)
Log Message:
-----------
Added fetal mail tests
Modified Paths:
--------------
maven/trunk/ogoglio-server/pom.xml
maven/trunk/ogoglio-server/src/main/java/com/ogoglio/mail/MailTemplateFactory.java
maven/trunk/ogoglio-server/src/main/java/com/ogoglio/migrate/AccountsForTesting.java
maven/trunk/ogoglio-server/src/main/java/com/ogoglio/migrate/DBVersionPersistTasks.java
maven/trunk/ogoglio-server/src/main/java/com/ogoglio/migrate/DBVersionRecord.java
maven/trunk/ogoglio-server/src/main/java/com/ogoglio/migrate/DBZapTest.java
maven/trunk/ogoglio-server/src/main/java/com/ogoglio/migrate/Migration.java
maven/trunk/ogoglio-server/src/main/java/com/ogoglio/migrate/MigrationSupport.java
Added Paths:
-----------
maven/trunk/ogoglio-server/src/main/resources/mail/
maven/trunk/ogoglio-server/src/main/resources/mail/EmailValidationTemplate.txt
maven/trunk/ogoglio-server/src/test/java/com/ogoglio/mail/
maven/trunk/ogoglio-server/src/test/java/com/ogoglio/mail/test/
maven/trunk/ogoglio-server/src/test/java/com/ogoglio/mail/test/MailTest.java
maven/trunk/ogoglio-server/src/test/resources/mail/
maven/trunk/ogoglio-server/src/test/resources/mail/TestTemplate1.txt
maven/trunk/ogoglio-server/src/test/resources/test-config.properties
Removed Paths:
-------------
maven/trunk/ogoglio-server/src/main/java/com/ogoglio/mail/MailTests.java
maven/trunk/ogoglio-server/src/test/resources/hibernate/test-config.properties
Property Changed:
----------------
maven/trunk/ogoglio-server/
Property changes on: maven/trunk/ogoglio-server
___________________________________________________________________
Name: svn:ignore
- target
+
target
mailTestFiles
Modified: maven/trunk/ogoglio-server/pom.xml
===================================================================
--- maven/trunk/ogoglio-server/pom.xml 2007-08-27 23:53:13 UTC (rev 276)
+++ maven/trunk/ogoglio-server/pom.xml 2007-08-28 02:50:58 UTC (rev 277)
@@ -61,10 +61,11 @@
<!-- -->
<testResources>
<testResource>
- <directory>src/test/resources/hibernate</directory>
+ <directory>src/test/resources</directory>
<filtering>true</filtering>
<includes>
<include>test-config.properties</include>
+ <include>mail/*</include>
</includes>
</testResource>
</testResources>
Modified: maven/trunk/ogoglio-server/src/main/java/com/ogoglio/mail/MailTemplateFactory.java
===================================================================
--- maven/trunk/ogoglio-server/src/main/java/com/ogoglio/mail/MailTemplateFactory.java 2007-08-27 23:53:13 UTC (rev 276)
+++ maven/trunk/ogoglio-server/src/main/java/com/ogoglio/mail/MailTemplateFactory.java 2007-08-28 02:50:58 UTC (rev 277)
@@ -8,7 +8,7 @@
public class MailTemplateFactory {
- private static final String TEMPLATE_RESOURCE_PATH = "com/ogoglio/mail/";
+ private static final String TEMPLATE_RESOURCE_PATH = "mail/";
public static final String TEST_TEMPLATE_1 = "TestTemplate1.txt";
Deleted: maven/trunk/ogoglio-server/src/main/java/com/ogoglio/mail/MailTests.java
===================================================================
--- maven/trunk/ogoglio-server/src/main/java/com/ogoglio/mail/MailTests.java 2007-08-27 23:53:13 UTC (rev 276)
+++ maven/trunk/ogoglio-server/src/main/java/com/ogoglio/mail/MailTests.java 2007-08-28 02:50:58 UTC (rev 277)
@@ -1,100 +0,0 @@
-package com.ogoglio.mail;
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileNotFoundException;
-import java.io.IOException;
-import java.util.HashMap;
-
-import junit.framework.TestCase;
-
-import com.ogoglio.util.ArgumentUtils;
-import com.ogoglio.util.StreamUtils;
-
-public class MailTests extends TestCase {
-
- private static final String TEST_DIR_PATH = "mailTestFiles";
-
- private File mailOutputDir = null;
-
- private MailClient mailClient1 = null;
-
- private MailFormatter mailFormatter1 = null;
-
- private String testTemplate1 = null;
-
- private HashMap testMap1 = null;
-
- public void setUp() throws IOException {
- mailOutputDir = new File(TEST_DIR_PATH);
- if (mailOutputDir.exists()) {
- delete(mailOutputDir);
- }
- assertTrue(mailOutputDir.mkdir());
-
- mailClient1 = new MailClient(mailOutputDir);
-
- mailFormatter1 = new MailFormatter();
-
- testTemplate1 = MailTemplateFactory.getTemplate(MailTemplateFactory.TEST_TEMPLATE_1);
- assertNotNull(testTemplate1);
-
- testMap1 = new HashMap();
- testMap1.put("username", "susan");
- testMap1.put("url", "http://example.com/og/");
- testMap1.put("moon.unit", "zappa");
- testMap1.put("Kurt", "Vonnegut.");
- }
-
- private void delete(File dir) {
- File[] children = dir.listFiles();
- for (int i = 0; i < children.length; i++) {
- assertTrue(children[i].delete());
- }
- assertTrue(dir.delete());
- }
-
- public void tearDown() {
- if (mailOutputDir != null && mailOutputDir.exists()) {
- delete(mailOutputDir);
- }
- }
-
- public void testClientFileOutput() throws MailSendException, FileNotFoundException, IOException {
- String body = "This is the body.";
- String to = "to...@ex...";
- String from = "ha...@ex...";
- String subject = "OWLs 'n Stuff";
- mailClient1.sendEmail(to, from, subject, body);
- File[] files = mailClient1.getOutputDir().listFiles();
- assertNotNull(files);
- assertEquals(1, files.length);
- assertFalse(files[0].length() == 0);
- String fileContents = StreamUtils.readInput(new FileInputStream(files[0]));
- assertTrue(fileContents.endsWith(body));
- }
-
- public void testFormat() {
- String result = mailFormatter1.format(testMap1, testTemplate1);
- assertNotNull(result);
- assertTrue(result.length() > 1);
- assertExactlyOne(result, (String) testMap1.get("username"));
- assertMultiple(result, (String) testMap1.get("url"));
- assertExactlyOne(result, (String) testMap1.get("moon.unit"));
- assertExactlyOne(result, (String) testMap1.get("Kurt"));
- }
-
- private void assertExactlyOne(String data, String target) {
- ArgumentUtils.assertNotEmpty(data);
- ArgumentUtils.assertNotEmpty(target);
- assertFalse(data.indexOf(target) == -1);
- assertTrue(data.indexOf(target) == data.lastIndexOf(target));
- }
-
- private void assertMultiple(String data, String target) {
- ArgumentUtils.assertNotEmpty(data);
- ArgumentUtils.assertNotEmpty(target);
- assertFalse(data.indexOf(target) == -1);
- assertFalse(data.indexOf(target) == data.lastIndexOf(target));
- }
-}
Modified: maven/trunk/ogoglio-server/src/main/java/com/ogoglio/migrate/AccountsForTesting.java
===================================================================
--- maven/trunk/ogoglio-server/src/main/java/com/ogoglio/migrate/AccountsForTesting.java 2007-08-27 23:53:13 UTC (rev 276)
+++ maven/trunk/ogoglio-server/src/main/java/com/ogoglio/migrate/AccountsForTesting.java 2007-08-28 02:50:58 UTC (rev 277)
@@ -13,46 +13,41 @@
public class AccountsForTesting implements Migration {
- private static final String BOOTSTRAP_ACCT_USER_KEY = "ogoglio/bootstrapUser";
- private static final String BOOTSTRAP_ACCT_PW_KEY = "ogoglio/bootstrapUserPW";
+ private static final String BOOTSTRAP_ACCT_USER_KEY = "ogoglio/bootstrapUser";
- public boolean migrate(SessionFactory sessionFactory,
- ServletConfig NOTUSED, Context ctx, Properties testConfig, int from, int to) {
+ private static final String BOOTSTRAP_ACCT_PW_KEY = "ogoglio/bootstrapUserPW";
- if ((from != 0) || (to != 1)) {
- System.out
- .println("Migration called in the wrong place! Expected 0->1 but was:"
- + from + "->" + to + "!");
- System.out
- .println("Migration called in the wrong place! Check the ordering of migration array!");
- return false;
- }
- try {
- String uriString, user, pw;
-
- //if null, we are test mode
- if (ctx==null) {
- uriString=testConfig.getProperty(AbstractResourceServlet.OGOGLIO_BASE_URL_KEY.replace('/', '.'));
- user=testConfig.getProperty(BOOTSTRAP_ACCT_USER_KEY.replace('/', '.'));
- pw=testConfig.getProperty(BOOTSTRAP_ACCT_PW_KEY.replace('/', '.'));
- } else {
- uriString=(String) ctx.lookup(AbstractResourceServlet.OGOGLIO_BASE_URL_KEY);
- user=(String) ctx.lookup(BOOTSTRAP_ACCT_USER_KEY);
- pw=(String) ctx.lookup(BOOTSTRAP_ACCT_PW_KEY);
- }
- URI uri = new URI(uriString);
- //actual work
- ServiceInitializationPersistTasks.initializeLocalSim(uri,sessionFactory);
- ServiceInitializationPersistTasks.initializeBootstrapAccount(sessionFactory, uri.getHost(), user, pw);
+ public boolean migrate(SessionFactory sessionFactory, ServletConfig NOTUSED, Context ctx, Properties testConfig, int from, int to) {
+
+ if ((from != 0) || (to != 1)) {
+ System.out.println("Migration called in the wrong place! Expected 0->1 but was:" + from + "->" + to + "!");
+ System.out.println("Migration called in the wrong place! Check the ordering of migration array!");
+ return false;
+ }
+ try {
+ String uriString, user, pw;
+
+ //if null, we are test mode
+ if (ctx == null) {
+ uriString = testConfig.getProperty(AbstractResourceServlet.OGOGLIO_BASE_URL_KEY.replace('/', '.'));
+ user = testConfig.getProperty(BOOTSTRAP_ACCT_USER_KEY.replace('/', '.'));
+ pw = testConfig.getProperty(BOOTSTRAP_ACCT_PW_KEY.replace('/', '.'));
+ } else {
+ uriString = (String) ctx.lookup(AbstractResourceServlet.OGOGLIO_BASE_URL_KEY);
+ user = (String) ctx.lookup(BOOTSTRAP_ACCT_USER_KEY);
+ pw = (String) ctx.lookup(BOOTSTRAP_ACCT_PW_KEY);
+ }
+ URI uri = new URI(uriString);
+ //actual work
+ ServiceInitializationPersistTasks.initializeLocalSim(uri, sessionFactory);
+ ServiceInitializationPersistTasks.initializeBootstrapAccount(sessionFactory, uri.getHost(), user, pw);
ServiceInitializationPersistTasks.initializeServiceState(sessionFactory);
- return true;
- } catch (Exception e) {
- e.printStackTrace();
- System.err
- .println("Exception during attempt to init DB in migration from 0->1:\n"
- + e.getMessage());
- return false;
- }
+ return true;
+ } catch (Exception e) {
+ e.printStackTrace();
+ System.err.println("Exception during attempt to init DB in migration from 0->1:\n" + e.getMessage());
+ return false;
+ }
- }
+ }
}
Modified: maven/trunk/ogoglio-server/src/main/java/com/ogoglio/migrate/DBVersionPersistTasks.java
===================================================================
--- maven/trunk/ogoglio-server/src/main/java/com/ogoglio/migrate/DBVersionPersistTasks.java 2007-08-27 23:53:13 UTC (rev 276)
+++ maven/trunk/ogoglio-server/src/main/java/com/ogoglio/migrate/DBVersionPersistTasks.java 2007-08-28 02:50:58 UTC (rev 277)
@@ -8,48 +8,42 @@
import com.ogoglio.persist.PersistException;
public class DBVersionPersistTasks {
- public final static String FIND_VERSION = "com.ogoglio.migrate.dbversions";
+ public final static String FIND_VERSION = "com.ogoglio.migrate.dbversions";
- public static int findVersion(SessionFactory sessionFactory)
- throws PersistException {
- HibernateTask task = new HibernateTask() {
- public Object run(Session session) throws PersistException {
- Query query = session.getNamedQuery(FIND_VERSION);
- return query.uniqueResult();
- }
- };
- task.setSessionFactory(sessionFactory);
- return ((DBVersionRecord) task.execute()).getVersion();
- }
+ public static int findVersion(SessionFactory sessionFactory) throws PersistException {
+ HibernateTask task = new HibernateTask() {
+ public Object run(Session session) throws PersistException {
+ Query query = session.getNamedQuery(FIND_VERSION);
+ return query.uniqueResult();
+ }
+ };
+ task.setSessionFactory(sessionFactory);
+ return ((DBVersionRecord) task.execute()).getVersion();
+ }
- public static boolean updateVersion(final int newVersion,
- final int expectedSize/* one or zero */,
- SessionFactory sessionFactory) throws PersistException {
- HibernateTask task = new HibernateTask() {
- public Object run(Session session) throws PersistException {
- Query query = session.getNamedQuery(FIND_VERSION);
- int size = query.list().size();
- DBVersionRecord rec;
- if (expectedSize != size) {
- System.out.println(
- "Whoa! Size of returned result for db version record was ("
- + size + ") but should have been "
- + expectedSize + "!");
- return Boolean.FALSE;
- }
- if (size == 0) {
- rec = new DBVersionRecord();
- } else {
- rec = (DBVersionRecord) query.uniqueResult();
- }
- rec.setVersion(newVersion);
- session.saveOrUpdate(rec);
- System.out.println("******* Wrote new version FART:"+newVersion);
- return Boolean.TRUE;
- }
- };
- task.setSessionFactory(sessionFactory);
- return (task.execute().equals(Boolean.TRUE));
- }
+ public static boolean updateVersion(final int newVersion, final int expectedSize/* one or zero */, SessionFactory sessionFactory) throws PersistException {
+ HibernateTask task = new HibernateTask() {
+ public Object run(Session session) throws PersistException {
+ Query query = session.getNamedQuery(FIND_VERSION);
+ int size = query.list().size();
+ DBVersionRecord rec;
+ if (expectedSize != size) {
+ System.out.println("Whoa! Size of returned result for db version record was (" + size + ") but should have been " + expectedSize + "!");
+ return Boolean.FALSE;
+ }
+ if (size == 0) {
+ rec = new DBVersionRecord();
+ } else {
+ rec = (DBVersionRecord) query.uniqueResult();
+ }
+ rec.setVersion(newVersion);
+ session.saveOrUpdate(rec);
+ System.out.println("******* Wrote new version FART:" + newVersion);
+ return Boolean.TRUE;
+ }
+ };
+ task.setSessionFactory(sessionFactory);
+ return (task.execute().equals(Boolean.TRUE));
+ }
}
Modified: maven/trunk/ogoglio-server/src/main/java/com/ogoglio/migrate/DBVersionRecord.java
===================================================================
--- maven/trunk/ogoglio-server/src/main/java/com/ogoglio/migrate/DBVersionRecord.java 2007-08-27 23:53:13 UTC (rev 276)
+++ maven/trunk/ogoglio-server/src/main/java/com/ogoglio/migrate/DBVersionRecord.java 2007-08-28 02:50:58 UTC (rev 277)
@@ -1,25 +1,28 @@
package com.ogoglio.migrate;
public class DBVersionRecord {
- public static int INTERNAL_DEV_STATE=-8288;
-
- private int version=0;
- private long id;
-
- public DBVersionRecord() {
-
- }
- public long getVersionId() {
- return id;
- }
- public void setVersionId(long id) {
- this.id=id;
- }
- public int getVersion() {
- return version;
- }
-
- public void setVersion(int version) {
- this.version=version;
- }
+ public static int INTERNAL_DEV_STATE = -8288;
+
+ private int version = 0;
+
+ private long id;
+
+ public DBVersionRecord() {
+ }
+
+ public long getVersionId() {
+ return id;
+ }
+
+ public void setVersionId(long id) {
+ this.id = id;
+ }
+
+ public int getVersion() {
+ return version;
+ }
+
+ public void setVersion(int version) {
+ this.version = version;
+ }
}
Modified: maven/trunk/ogoglio-server/src/main/java/com/ogoglio/migrate/DBZapTest.java
===================================================================
--- maven/trunk/ogoglio-server/src/main/java/com/ogoglio/migrate/DBZapTest.java 2007-08-27 23:53:13 UTC (rev 276)
+++ maven/trunk/ogoglio-server/src/main/java/com/ogoglio/migrate/DBZapTest.java 2007-08-28 02:50:58 UTC (rev 277)
@@ -8,30 +8,29 @@
protected SessionFactory sessionFactory;
- public void setUp() {
+ public void setUp() {
try {
MigrationSupport support = new MigrationSupport();
if (!("true".equals(support.getTestConfig().getProperty("ogoglio.okToZapDB")))) {
- fail("Whoa! Shouldn't be running tests without setting the ogoglio.okToZapDB property!");
+ fail("Whoa! Shouldn't be running tests without setting the ogoglio.okToZapDB property!");
}
- if (support.initialize_version(null, null, false)==false) {
- fail("can't get DB set up: trying to initialize it in the test code");
+ if (support.initialize_version(null, null, false) == false) {
+ fail("can't get DB set up: trying to initialize it in the test code");
}
-
+
//if we are here, db stuff worked, but we still need to avoid all the jndi stuff
- sessionFactory= support.createConfigurationForHibernate(MigrationSupport.DB_VERSION_NUMBER,
- null, false).buildSessionFactory();
+ sessionFactory = support.createConfigurationForHibernate(MigrationSupport.DB_VERSION_NUMBER, null, false).buildSessionFactory();
} catch (Exception e) {
System.out.println("-------");
e.printStackTrace(System.out);
System.out.println("---------");
fail("Could not setup:" + e.getMessage());
}
- }
-
- public void tearDown() {
- if (sessionFactory!=null) {
- sessionFactory.close();
- }
- }
+ }
+
+ public void tearDown() {
+ if (sessionFactory != null) {
+ sessionFactory.close();
+ }
+ }
}
Modified: maven/trunk/ogoglio-server/src/main/java/com/ogoglio/migrate/Migration.java
===================================================================
--- maven/trunk/ogoglio-server/src/main/java/com/ogoglio/migrate/Migration.java 2007-08-27 23:53:13 UTC (rev 276)
+++ maven/trunk/ogoglio-server/src/main/java/com/ogoglio/migrate/Migration.java 2007-08-28 02:50:58 UTC (rev 277)
@@ -9,7 +9,6 @@
public interface Migration {
- public boolean migrate(SessionFactory sessionFactory, ServletConfig servletConfig, Context ctx,
- Properties testConfig, int from, int to);
+ public boolean migrate(SessionFactory sessionFactory, ServletConfig servletConfig, Context ctx, Properties testConfig, int from, int to);
}
Modified: maven/trunk/ogoglio-server/src/main/java/com/ogoglio/migrate/MigrationSupport.java
===================================================================
--- maven/trunk/ogoglio-server/src/main/java/com/ogoglio/migrate/MigrationSupport.java 2007-08-27 23:53:13 UTC (rev 276)
+++ maven/trunk/ogoglio-server/src/main/java/com/ogoglio/migrate/MigrationSupport.java 2007-08-28 02:50:58 UTC (rev 277)
@@ -15,166 +15,158 @@
public class MigrationSupport {
- // THIS IS THE CRITICAL VERSION NUMBER
- public static final int DB_VERSION_NUMBER = 1;
+ // THIS IS THE CRITICAL VERSION NUMBER
+ public static final int DB_VERSION_NUMBER = 1;
- //check on migration okayness
- public static final String MIGRATION_KEY = "ogoglio/okToMigrateDB";
-
- // this is the set of semantic migrations, in order
- public static final Migration[] migration = {
- new AccountsForTesting()
- };
+ //check on migration okayness
+ public static final String MIGRATION_KEY = "ogoglio/okToMigrateDB";
- public MigrationSupport() {
- }
+ // this is the set of semantic migrations, in order
+ public static final Migration[] migration = { new AccountsForTesting() };
- public boolean verifyVersion(ServletConfig servletConf, Context ctx) {
- try {
- SessionFactory sessionFactory = getCurrentConfiguration().buildSessionFactory();
- int version = DBVersionPersistTasks.findVersion(sessionFactory);
- if (version != DB_VERSION_NUMBER) {
- System.out.println("DB Version Mismatch! Expected ("
- + DB_VERSION_NUMBER + ") but got " + version + "!");
- sessionFactory.close();
- return tryUpgrade(servletConf, ctx, version, DB_VERSION_NUMBER,"update",true);
- }
- sessionFactory.close();
- return true; // we are at the expected version
- } catch (PersistException e) {
- if (e.innerThrowable==null) {
- System.out.println("Serious problem with hibernate:" + e.getMessage());
- return false;
- }
- System.out.println("Unable to figure out DB version number. Likely this is a fresh database....("+e.innerThrowable.getClass().getName()+")");
- return initialize_version(servletConf,ctx, true);
- }
- }
+ public MigrationSupport() {
+ }
- public boolean initialize_version(ServletConfig conf, Context ctx, boolean useJNDI) {
- Configuration configuration = createConfigurationForHibernate(0,"create",useJNDI);
- try {
- SessionFactory factory=configuration.buildSessionFactory();
- if (setVersionNumberOfDbViaQuery(factory,0,0)==false) {
- factory.close();
- return false;
- }
- factory.close();
- return tryUpgrade(conf,ctx,0, DB_VERSION_NUMBER, "create",useJNDI);
- } catch (Throwable e) {
- System.out.println("Error trying initialized DB:" + e.getMessage());
- return false;
- }
-
- }
+ public boolean verifyVersion(ServletConfig servletConf, Context ctx) {
+ try {
+ SessionFactory sessionFactory = getCurrentConfiguration().buildSessionFactory();
+ int version = DBVersionPersistTasks.findVersion(sessionFactory);
+ if (version != DB_VERSION_NUMBER) {
+ System.err.println("DB Version Mismatch! Expected (" + DB_VERSION_NUMBER + ") but got " + version + "!");
+ sessionFactory.close();
+ return tryUpgrade(servletConf, ctx, version, DB_VERSION_NUMBER, "update", true);
+ }
+ sessionFactory.close();
+ return true; // we are at the expected version
+ } catch (PersistException e) {
+ if (e.innerThrowable == null) {
+ System.out.println("Serious problem with hibernate:" + e.getMessage());
+ return false;
+ }
+ System.err.println("Unable to figure out DB version number. Likely this is a fresh database....(" + e.innerThrowable.getClass().getName() + ")");
+ return initialize_version(servletConf, ctx, true);
+ }
+ }
- public Configuration getCurrentConfiguration() {
- return createConfigurationForHibernate(DB_VERSION_NUMBER, null, true);
- }
-
- public Configuration createConfigurationForHibernate(int num, String autoSetting, boolean useJNDI) {
- Configuration configuration = new Configuration();
- if (autoSetting!=null) {
- configuration.setProperty("hibernate.hbm2ddl.auto", autoSetting);
- }
- if (useJNDI) {
- configuration.setProperty("hibernate.connection.datasource","java:comp/env/jdbc/space");
- } else {
- Properties p=new Properties();
- try {
- p.load(getClass().getResourceAsStream("/test-config.properties"));
- configuration.addProperties(p);
- } catch (IOException e){
- System.out.println("Unable to find the test configuration file!"+e.getMessage());
- return configuration.configure();
- }
- }
- configuration.addResource("com/ogoglio/migrate/migration-"+num+".xml");
- return configuration.configure();
- }
+ public boolean initialize_version(ServletConfig conf, Context ctx, boolean useJNDI) {
+ Configuration configuration = createConfigurationForHibernate(0, "create", useJNDI);
+ try {
+ SessionFactory factory = configuration.buildSessionFactory();
+ if (setVersionNumberOfDbViaQuery(factory, 0, 0) == false) {
+ factory.close();
+ return false;
+ }
+ factory.close();
+ return tryUpgrade(conf, ctx, 0, DB_VERSION_NUMBER, "create", useJNDI);
+ } catch (Throwable e) {
+ System.err.println("Error trying initialized DB:" + e.getMessage());
+ return false;
+ }
- private boolean setVersionNumberOfDbViaQuery(SessionFactory sessionFactory,int targetVersion,int expectedSize) {
- try {
- return DBVersionPersistTasks.updateVersion(targetVersion, expectedSize, sessionFactory);
- } catch (PersistException e) {
- System.out.println("Problem updating the version of the database to version "+targetVersion+":"+e.getMessage());
- return false;
- }
- }
+ }
- public boolean tryUpgrade(ServletConfig servletConfig, Context ctx, int db_is, int db_wants_to_be,
- String ddlMode, boolean useJNDI) {
- if (migration.length != DB_VERSION_NUMBER) {
- System.out
- .println("Internal error! Migration list length should be "
- + DB_VERSION_NUMBER + " but is " + migration.length
- + "!");
- return false;
- }
- Properties testConfig=new Properties();
- boolean canMigrate=false;
- if (ctx==null) {
- //in test mode
- testConfig = getTestConfig();
- if ("true".equals(testConfig.getProperty("ogoglio.okToMigrateDB"))) {
- canMigrate=true;
- }
- } else {
- //not testing, but might be integration testing
- try {
- String migrate=(String)ctx.lookup(MIGRATION_KEY);
- if ("true".equals(migrate)) {
- canMigrate=true;
- }
- } catch (NamingException e) {
- System.out.println("Naming exception trying to access "+MIGRATION_KEY+" from naming context!");
- }
- }
-
- if (!canMigrate) {
- System.out.println("Cannot migrate data! Property ogoglio.okToMigrateDB is false or non-existent!");
- return false;
- }
+ public Configuration getCurrentConfiguration() {
+ return createConfigurationForHibernate(DB_VERSION_NUMBER, null, true);
+ }
- for (int i = db_is; i < db_wants_to_be; ++i) {
- Migration current = migration[i];
- System.out.println("------------------------------------------------\n");
- System.out.println("DB: Attempting migration from " + i + " to "
- + (i + 1) + "...");
-
- //try to get hibernate to do the work
- Configuration config = createConfigurationForHibernate(i+1, ddlMode ,useJNDI);
- SessionFactory factory = config.buildSessionFactory();
-
- //subtle: if the ddlMode is create, hibernate blows away all the data (including our version number record)
- int expectedRecords=1;
- if ("create".equals(ddlMode)) {
- expectedRecords=0;
- }
- setVersionNumberOfDbViaQuery(factory,i+1, expectedRecords);
-
- if (!current.migrate(factory,servletConfig, ctx, testConfig, i, i + 1)) {
- factory.close();
- return false;
- }
- factory.close();
- System.out.println("------------------------------------------------\n");
- }
- return true;
- }
+ public Configuration createConfigurationForHibernate(int num, String autoSetting, boolean useJNDI) {
+ Configuration configuration = new Configuration();
+ if (autoSetting != null) {
+ configuration.setProperty("hibernate.hbm2ddl.auto", autoSetting);
+ }
+ if (useJNDI) {
+ configuration.setProperty("hibernate.connection.datasource", "java:comp/env/jdbc/space");
+ } else {
+ Properties p = new Properties();
+ try {
+ p.load(getClass().getResourceAsStream("/test-config.properties"));
+ configuration.addProperties(p);
+ } catch (IOException e) {
+ System.err.println("Unable to find the test configuration file!" + e.getMessage());
+ return configuration.configure();
+ }
+ }
+ configuration.addResource("com/ogoglio/migrate/migration-" + num + ".xml");
+ return configuration.configure();
+ }
- public Properties getTestConfig() {
- Properties testConfig = new Properties();
- InputStream is=getClass().getResourceAsStream("/test-config.properties");
- if (is==null) {
- System.out.println("Warning! Unable to find test-config.properties! Probably something is broken!");
- } else {
- try {
- testConfig.load(is);
- } catch (IOException e) {
- System.out.println("Warning! Error reading test-config.properties! "+e.getMessage());
- }
- }
- return testConfig;
- }
+ private boolean setVersionNumberOfDbViaQuery(SessionFactory sessionFactory, int targetVersion, int expectedSize) {
+ try {
+ return DBVersionPersistTasks.updateVersion(targetVersion, expectedSize, sessionFactory);
+ } catch (PersistException e) {
+ System.err.println("Problem updating the version of the database to version " + targetVersion + ":" + e.getMessage());
+ return false;
+ }
+ }
+
+ public boolean tryUpgrade(ServletConfig servletConfig, Context ctx, int db_is, int db_wants_to_be, String ddlMode, boolean useJNDI) {
+ if (migration.length != DB_VERSION_NUMBER) {
+ System.out.println("Internal error! Migration list length should be " + DB_VERSION_NUMBER + " but is " + migration.length + "!");
+ return false;
+ }
+ Properties testConfig = new Properties();
+ boolean canMigrate = false;
+ if (ctx == null) {
+ //in test mode
+ testConfig = getTestConfig();
+ if ("true".equals(testConfig.getProperty("ogoglio.okToMigrateDB"))) {
+ canMigrate = true;
+ }
+ } else {
+ //not testing, but might be integration testing
+ try {
+ String migrate = (String) ctx.lookup(MIGRATION_KEY);
+ if ("true".equals(migrate)) {
+ canMigrate = true;
+ }
+ } catch (NamingException e) {
+ System.err.println("Naming exception trying to access " + MIGRATION_KEY + " from naming context!");
+ }
+ }
+
+ if (!canMigrate) {
+ System.err.println("Cannot migrate data! Property ogoglio.okToMigrateDB is false or non-existent!");
+ return false;
+ }
+
+ for (int i = db_is; i < db_wants_to_be; ++i) {
+ Migration current = migration[i];
+ System.out.println("------------------------------------------------\n");
+ System.out.println("DB: Attempting migration from " + i + " to " + (i + 1) + "...");
+
+ //try to get hibernate to do the work
+ Configuration config = createConfigurationForHibernate(i + 1, ddlMode, useJNDI);
+ SessionFactory factory = config.buildSessionFactory();
+
+ //subtle: if the ddlMode is create, hibernate blows away all the data (including our version number record)
+ int expectedRecords = 1;
+ if ("create".equals(ddlMode)) {
+ expectedRecords = 0;
+ }
+ setVersionNumberOfDbViaQuery(factory, i + 1, expectedRecords);
+
+ if (!current.migrate(factory, servletConfig, ctx, testConfig, i, i + 1)) {
+ factory.close();
+ return false;
+ }
+ factory.close();
+ System.out.println("------------------------------------------------\n");
+ }
+ return true;
+ }
+
+ public Properties getTestConfig() {
+ Properties testConfig = new Properties();
+ InputStream is = getClass().getResourceAsStream("/test-config.properties");
+ if (is == null) {
+ System.err.println("Warning! Unable to find test-config.properties! Probably something is broken!");
+ } else {
+ try {
+ testConfig.load(is);
+ } catch (IOException e) {
+ System.err.println("Warning! Error reading test-config.properties! " + e.getMessage());
+ }
+ }
+ return testConfig;
+ }
}
Added: maven/trunk/ogoglio-server/src/main/resources/mail/EmailValidationTemplate.txt
===================================================================
--- maven/trunk/ogoglio-server/src/main/resources/mail/EmailValidationTemplate.txt (rev 0)
+++ maven/trunk/ogoglio-server/src/main/resources/mail/EmailValidationTemplate.txt 2007-08-28 02:50:58 UTC (rev 277)
@@ -0,0 +1,16 @@
+Hello from ${serviceName},
+
+Someone (maybe you) has requested that the address ${emailToValidate} be associated
+with an account at ${serviceName}. If that someone was you and you'd like to make that
+association, just click this link:
+
+${validationURL}
+
+If you did not make this request, don't worry. If you don't click that link then the
+email will not be associated with the account and after a few days the request will be
+deleted.
+
+Keep it real,
+
+ - The folks from ${serviceName} at ${serviceURL}
+
Added: maven/trunk/ogoglio-server/src/test/java/com/ogoglio/mail/test/MailTest.java
===================================================================
--- maven/trunk/ogoglio-server/src/test/java/com/ogoglio/mail/test/MailTest.java (rev 0)
+++ maven/trunk/ogoglio-server/src/test/java/com/ogoglio/mail/test/MailTest.java 2007-08-28 02:50:58 UTC (rev 277)
@@ -0,0 +1,104 @@
+package com.ogoglio.mail.test;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.IOException;
+import java.util.HashMap;
+
+import junit.framework.TestCase;
+
+import com.ogoglio.mail.MailClient;
+import com.ogoglio.mail.MailFormatter;
+import com.ogoglio.mail.MailSendException;
+import com.ogoglio.mail.MailTemplateFactory;
+import com.ogoglio.util.ArgumentUtils;
+import com.ogoglio.util.StreamUtils;
+
+public class MailTest extends TestCase {
+
+ private static final String TEST_DIR_PATH = "mailTestFiles";
+
+ private File mailOutputDir = null;
+
+ private MailClient mailClient1 = null;
+
+ private MailFormatter mailFormatter1 = null;
+
+ private String testTemplate1 = null;
+
+ private HashMap testMap1 = null;
+
+ public void setUp() throws IOException {
+ mailOutputDir = new File(TEST_DIR_PATH);
+ if (mailOutputDir.exists()) {
+ delete(mailOutputDir);
+ }
+ assertTrue(mailOutputDir.mkdir());
+
+ mailClient1 = new MailClient(mailOutputDir);
+
+ mailFormatter1 = new MailFormatter();
+
+ testTemplate1 = MailTemplateFactory.getTemplate(MailTemplateFactory.TEST_TEMPLATE_1);
+ assertNotNull(testTemplate1);
+
+ testMap1 = new HashMap();
+ testMap1.put("username", "susan");
+ testMap1.put("url", "http://example.com/og/");
+ testMap1.put("moon.unit", "zappa");
+ testMap1.put("Kurt", "Vonnegut.");
+ }
+
+ private void delete(File dir) {
+ File[] children = dir.listFiles();
+ for (int i = 0; i < children.length; i++) {
+ assertTrue(children[i].delete());
+ }
+ assertTrue(dir.delete());
+ }
+
+ public void tearDown() {
+ if (mailOutputDir != null && mailOutputDir.exists()) {
+ delete(mailOutputDir);
+ }
+ }
+
+ public void testClientFileOutput() throws MailSendException, FileNotFoundException, IOException {
+ String body = "This is the body.";
+ String to = "to...@ex...";
+ String from = "ha...@ex...";
+ String subject = "OWLs 'n Stuff";
+ mailClient1.sendEmail(to, from, subject, body);
+ File[] files = mailClient1.getOutputDir().listFiles();
+ assertNotNull(files);
+ assertEquals(1, files.length);
+ assertFalse(files[0].length() == 0);
+ String fileContents = StreamUtils.readInput(new FileInputStream(files[0]));
+ assertTrue(fileContents.endsWith(body));
+ }
+
+ public void testFormat() {
+ String result = mailFormatter1.format(testMap1, testTemplate1);
+ assertNotNull(result);
+ assertTrue(result.length() > 1);
+ assertExactlyOne(result, (String) testMap1.get("username"));
+ assertMultiple(result, (String) testMap1.get("url"));
+ assertExactlyOne(result, (String) testMap1.get("moon.unit"));
+ assertExactlyOne(result, (String) testMap1.get("Kurt"));
+ }
+
+ private void assertExactlyOne(String data, String target) {
+ ArgumentUtils.assertNotEmpty(data);
+ ArgumentUtils.assertNotEmpty(target);
+ assertFalse(data.indexOf(target) == -1);
+ assertTrue(data.indexOf(target) == data.lastIndexOf(target));
+ }
+
+ private void assertMultiple(String data, String target) {
+ ArgumentUtils.assertNotEmpty(data);
+ ArgumentUtils.assertNotEmpty(target);
+ assertFalse(data.indexOf(target) == -1);
+ assertFalse(data.indexOf(target) == data.lastIndexOf(target));
+ }
+}
Deleted: maven/trunk/ogoglio-server/src/test/resources/hibernate/test-config.properties
===================================================================
--- maven/trunk/ogoglio-server/src/test/resources/hibernate/test-config.properties 2007-08-27 23:53:13 UTC (rev 276)
+++ maven/trunk/ogoglio-server/src/test/resources/hibernate/test-config.properties 2007-08-28 02:50:58 UTC (rev 277)
@@ -1,28 +0,0 @@
-# this is needed for running tests because tomcat isn't
-# actually around when these tests get run so we need
-# to use the DB via the simple c3po connection manager
-# (supplied with hibernate)
-
-hibernate.connection.driver_class = com.mysql.jdbc.Driver
-hibernate.connection.url = ${ogoglio.mysql.url}
-hibernate.connection.username = ${ogoglio.mysql.user}
-hibernate.connection.password = ${ogoglio.mysql.password}
-hibernate.show_sql=false
-hibernate.dialect=org.hibernate.dialect.MySQLDialect
-
-#copied from the web
-#hibernate.c3p0.min_size=5
-#hibernate.c3p0.max_size=20
-#hibernate.c3p0.timeout=1800
-#hibernate.c3p0.max_statements=50
-
-#for doing tests that need bootstrap
-ogoglio.baseURL=${ogoglio.baseURL}
-ogoglio.bootstrapUser=${ogoglio.bootstrapUser}
-ogoglio.bootstrapUserPW=${ogoglio.bootstrapUserPW}
-
-#can destroy the db?
-ogoglio.okToZapDB=${ogoglio.okToZapDB}
-#can migrate data?
-ogoglio.okToMigrateDB=${ogoglio.okToMigrateDB}
-
Added: maven/trunk/ogoglio-server/src/test/resources/mail/TestTemplate1.txt
===================================================================
--- maven/trunk/ogoglio-server/src/test/resources/mail/TestTemplate1.txt (rev 0)
+++ maven/trunk/ogoglio-server/src/test/resources/mail/TestTemplate1.txt 2007-08-28 02:50:58 UTC (rev 277)
@@ -0,0 +1,6 @@
+Replace this with username: ${username}
+Replace this with url: ${url}
+Also replace this with url: ${url}
+Replace this with moon.unit: ${moon.unit}
+Don't replace this with it, though: ${moonAunit}
+Replace this with Kurt: ${Kurt}
\ No newline at end of file
Copied: maven/trunk/ogoglio-server/src/test/resources/test-config.properties (from rev 270, maven/trunk/ogoglio-server/src/test/resources/hibernate/test-config.properties)
===================================================================
--- maven/trunk/ogoglio-server/src/test/resources/test-config.properties (rev 0)
+++ maven/trunk/ogoglio-server/src/test/resources/test-config.properties 2007-08-28 02:50:58 UTC (rev 277)
@@ -0,0 +1,28 @@
+# this is needed for running tests because tomcat isn't
+# actually around when these tests get run so we need
+# to use the DB via the simple c3po connection manager
+# (supplied with hibernate)
+
+hibernate.connection.driver_class = com.mysql.jdbc.Driver
+hibernate.connection.url = ${ogoglio.mysql.url}
+hibernate.connection.username = ${ogoglio.mysql.user}
+hibernate.connection.password = ${ogoglio.mysql.password}
+hibernate.show_sql=false
+hibernate.dialect=org.hibernate.dialect.MySQLDialect
+
+#copied from the web
+#hibernate.c3p0.min_size=5
+#hibernate.c3p0.max_size=20
+#hibernate.c3p0.timeout=1800
+#hibernate.c3p0.max_statements=50
+
+#for doing tests that need bootstrap
+ogoglio.baseURL=${ogoglio.baseURL}
+ogoglio.bootstrapUser=${ogoglio.bootstrapUser}
+ogoglio.bootstrapUserPW=${ogoglio.bootstrapUserPW}
+
+#can destroy the db?
+ogoglio.okToZapDB=${ogoglio.okToZapDB}
+#can migrate data?
+ogoglio.okToMigrateDB=${ogoglio.okToMigrateDB}
+
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <tre...@us...> - 2007-08-27 23:53:10
|
Revision: 276
http://ogoglio.svn.sourceforge.net/ogoglio/?rev=276&view=rev
Author: trevorolio
Date: 2007-08-27 16:53:13 -0700 (Mon, 27 Aug 2007)
Log Message:
-----------
Added ServiceState docs and API. Added test cube and cylindar objs. Added fetal mail service. Added abstract remote servlet for apps in the same container which use ogoglio on the back end. Added some email validation code.
Modified Paths:
--------------
maven/trunk/ogoglio-server/pom.xml
maven/trunk/ogoglio-server/src/main/java/com/ogoglio/migrate/AccountsForTesting.java
maven/trunk/ogoglio-server/src/main/java/com/ogoglio/persist/AccountRecord.java
maven/trunk/ogoglio-server/src/main/java/com/ogoglio/persist/ServiceInitializationPersistTasks.java
maven/trunk/ogoglio-server/src/main/java/com/ogoglio/sim/SpaceSimulator.java
maven/trunk/ogoglio-server/src/main/java/com/ogoglio/site/AbstractResourceServlet.java
maven/trunk/ogoglio-server/src/main/java/com/ogoglio/site/AccountServlet.java
maven/trunk/ogoglio-server/src/main/java/com/ogoglio/site/SiteInfo.java
maven/trunk/ogoglio-server/src/main/java/com/ogoglio/site/SpaceServlet.java
maven/trunk/ogoglio-server/src/main/java/com/ogoglio/xml/server/DocumentFactory.java
maven/trunk/ogoglio-server/src/main/resources/hibernate/migration-1.xml
maven/trunk/ogoglio-server/src/main/webapp/createAccount.html
Added Paths:
-----------
maven/trunk/ogoglio-server/src/main/java/com/ogoglio/mail/
maven/trunk/ogoglio-server/src/main/java/com/ogoglio/mail/MailClient.java
maven/trunk/ogoglio-server/src/main/java/com/ogoglio/mail/MailFormatter.java
maven/trunk/ogoglio-server/src/main/java/com/ogoglio/mail/MailSendException.java
maven/trunk/ogoglio-server/src/main/java/com/ogoglio/mail/MailTemplateFactory.java
maven/trunk/ogoglio-server/src/main/java/com/ogoglio/mail/MailTests.java
maven/trunk/ogoglio-server/src/main/java/com/ogoglio/persist/PendingEmailValidationRecord.java
maven/trunk/ogoglio-server/src/main/java/com/ogoglio/persist/PendingEmailValidationTasks.java
maven/trunk/ogoglio-server/src/main/java/com/ogoglio/persist/ServiceStateRecord.java
maven/trunk/ogoglio-server/src/main/java/com/ogoglio/persist/ServiceStateTasks.java
maven/trunk/ogoglio-server/src/main/java/com/ogoglio/site/AbstractRemoteServlet.java
Removed Paths:
-------------
maven/trunk/ogoglio-server/src/main/java/com/ogoglio/util/
Modified: maven/trunk/ogoglio-server/pom.xml
===================================================================
--- maven/trunk/ogoglio-server/pom.xml 2007-08-27 23:52:59 UTC (rev 275)
+++ maven/trunk/ogoglio-server/pom.xml 2007-08-27 23:53:13 UTC (rev 276)
@@ -170,6 +170,16 @@
<artifactId>commons-io</artifactId>
<version>1.3</version>
</dependency>
+ <dependency>
+ <groupId>com.sun</groupId>
+ <artifactId>mail</artifactId>
+ <version>1.4</version>
+ </dependency>
+ <dependency>
+ <groupId>com.sun</groupId>
+ <artifactId>jaf</artifactId>
+ <version>1.1</version>
+ </dependency>
<!-- need MYSQL for tests -->
<dependency>
Added: maven/trunk/ogoglio-server/src/main/java/com/ogoglio/mail/MailClient.java
===================================================================
--- maven/trunk/ogoglio-server/src/main/java/com/ogoglio/mail/MailClient.java (rev 0)
+++ maven/trunk/ogoglio-server/src/main/java/com/ogoglio/mail/MailClient.java 2007-08-27 23:53:13 UTC (rev 276)
@@ -0,0 +1,92 @@
+package com.ogoglio.mail;
+
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.IOException;
+
+import javax.mail.Message;
+import javax.mail.MessagingException;
+import javax.mail.Session;
+import javax.mail.Transport;
+import javax.mail.internet.AddressException;
+import javax.mail.internet.InternetAddress;
+import javax.mail.internet.MimeMessage;
+import javax.naming.Context;
+import javax.naming.InitialContext;
+import javax.naming.NamingException;
+
+import com.ogoglio.util.ArgumentUtils;
+
+public class MailClient {
+
+ private boolean writeToDisk = false;
+
+ private File outputDir = null;
+
+ /**
+ * Sends all mail to individual files in outputDir
+ */
+ public MailClient(File outputDir) {
+ ArgumentUtils.assertReadableDir(outputDir, true);
+ this.outputDir = outputDir;
+ writeToDisk = true;
+ }
+
+ /**
+ * Sends all mail via JNDI:java:comp/env session at mail/Session
+ */
+ public MailClient() {
+ writeToDisk = false;
+ }
+
+ public void sendEmail(String to, String from, String subject, String body) throws MailSendException {
+ try {
+ if (writeToDisk) {
+ sendToDisk(to, from, subject, body);
+ } else {
+ sendViaContextSession(to, from, subject, body);
+ }
+ } catch (NamingException e) {
+ throw new MailSendException(e);
+ } catch (AddressException e) {
+ throw new MailSendException(e);
+ } catch (MessagingException e) {
+ throw new MailSendException(e);
+ } catch (IOException e) {
+ throw new MailSendException(e);
+ }
+ }
+
+ private void sendToDisk(String to, String from, String subject, String body) throws IOException {
+ FileOutputStream output = new FileOutputStream(new File(outputDir, "Mail-Message-" + System.currentTimeMillis()));
+ output.write(("to: " + to + "\n").getBytes());
+ output.write(("from: " + from + "\n").getBytes());
+ output.write(("subject: " + subject + "\n").getBytes());
+ output.write(("\n").getBytes());
+ output.write(body.getBytes());
+ output.flush();
+ output.close();
+ }
+
+ private void sendViaContextSession(String to, String from, String subject, String body) throws NamingException, AddressException, MessagingException {
+ Context initCtx = new InitialContext();
+ Context envCtx = (Context) initCtx.lookup("java:comp/env");
+ Session session = (Session) envCtx.lookup("mail/Session");
+
+ Message message = new MimeMessage(session);
+ InternetAddress toAddress[] = new InternetAddress[1];
+ toAddress[0] = new InternetAddress(to);
+ message.setRecipients(Message.RecipientType.TO, toAddress);
+ message.setFrom(new InternetAddress(from));
+ message.setSubject(subject);
+ message.setContent(body, "text/plain");
+ Transport.send(message);
+ }
+
+ /**
+ * @return null if this client is using the JNDI mail session instead of writing to disk
+ */
+ public File getOutputDir() {
+ return outputDir;
+ }
+}
Added: maven/trunk/ogoglio-server/src/main/java/com/ogoglio/mail/MailFormatter.java
===================================================================
--- maven/trunk/ogoglio-server/src/main/java/com/ogoglio/mail/MailFormatter.java (rev 0)
+++ maven/trunk/ogoglio-server/src/main/java/com/ogoglio/mail/MailFormatter.java 2007-08-27 23:53:13 UTC (rev 276)
@@ -0,0 +1,29 @@
+package com.ogoglio.mail;
+
+import java.util.Map;
+import java.util.regex.Pattern;
+
+import com.ogoglio.util.ArgumentUtils;
+
+public class MailFormatter {
+
+ public String format(Map map, String template) {
+ ArgumentUtils.assertNotNull(map);
+ ArgumentUtils.assertNotEmpty(template);
+ return stupidMerge(map, template);
+ }
+
+ private String stupidMerge(Map map, String template) {
+ String result = new String(template);
+ String[] keys = (String[])map.keySet().toArray(new String[0]);
+ for (int i = 0; i < keys.length; i++) {
+ String replacement = (String)map.get(keys[i]);
+ result = result.replaceAll(Pattern.quote(createVariableString((keys[i]))), replacement);
+ }
+ return result;
+ }
+
+ public String createVariableString(String variableName) {
+ return "${" + variableName + "}";
+ }
+}
Added: maven/trunk/ogoglio-server/src/main/java/com/ogoglio/mail/MailSendException.java
===================================================================
--- maven/trunk/ogoglio-server/src/main/java/com/ogoglio/mail/MailSendException.java (rev 0)
+++ maven/trunk/ogoglio-server/src/main/java/com/ogoglio/mail/MailSendException.java 2007-08-27 23:53:13 UTC (rev 276)
@@ -0,0 +1,7 @@
+package com.ogoglio.mail;
+
+public class MailSendException extends Exception {
+ public MailSendException(Exception e) {
+ super(e);
+ }
+}
Added: maven/trunk/ogoglio-server/src/main/java/com/ogoglio/mail/MailTemplateFactory.java
===================================================================
--- maven/trunk/ogoglio-server/src/main/java/com/ogoglio/mail/MailTemplateFactory.java (rev 0)
+++ maven/trunk/ogoglio-server/src/main/java/com/ogoglio/mail/MailTemplateFactory.java 2007-08-27 23:53:13 UTC (rev 276)
@@ -0,0 +1,33 @@
+package com.ogoglio.mail;
+
+import java.io.IOException;
+import java.util.HashMap;
+import java.util.Map;
+
+import com.ogoglio.util.StreamUtils;
+
+public class MailTemplateFactory {
+
+ private static final String TEMPLATE_RESOURCE_PATH = "com/ogoglio/mail/";
+
+ public static final String TEST_TEMPLATE_1 = "TestTemplate1.txt";
+
+ public static final String EMAIL_VALIDATION_TEMPLATE = "EmailValidationTemplate.txt";
+
+ public static String getTemplate(String templateName) {
+ try {
+ return StreamUtils.readResource(TEMPLATE_RESOURCE_PATH + templateName);
+ } catch (IOException e) {
+ return null;
+ }
+ }
+
+ public static Map createEmailValidationMap(String emailToValidate, String validationURL, String serviceName, String serviceURL) {
+ HashMap map = new HashMap();
+ map.put("emailToValidate", emailToValidate);
+ map.put("validationURL", validationURL);
+ map.put("serviceName", serviceName);
+ map.put("serviceURL", serviceURL);
+ return map;
+ }
+}
Added: maven/trunk/ogoglio-server/src/main/java/com/ogoglio/mail/MailTests.java
===================================================================
--- maven/trunk/ogoglio-server/src/main/java/com/ogoglio/mail/MailTests.java (rev 0)
+++ maven/trunk/ogoglio-server/src/main/java/com/ogoglio/mail/MailTests.java 2007-08-27 23:53:13 UTC (rev 276)
@@ -0,0 +1,100 @@
+package com.ogoglio.mail;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.IOException;
+import java.util.HashMap;
+
+import junit.framework.TestCase;
+
+import com.ogoglio.util.ArgumentUtils;
+import com.ogoglio.util.StreamUtils;
+
+public class MailTests extends TestCase {
+
+ private static final String TEST_DIR_PATH = "mailTestFiles";
+
+ private File mailOutputDir = null;
+
+ private MailClient mailClient1 = null;
+
+ private MailFormatter mailFormatter1 = null;
+
+ private String testTemplate1 = null;
+
+ private HashMap testMap1 = null;
+
+ public void setUp() throws IOException {
+ mailOutputDir = new File(TEST_DIR_PATH);
+ if (mailOutputDir.exists()) {
+ delete(mailOutputDir);
+ }
+ assertTrue(mailOutputDir.mkdir());
+
+ mailClient1 = new MailClient(mailOutputDir);
+
+ mailFormatter1 = new MailFormatter();
+
+ testTemplate1 = MailTemplateFactory.getTemplate(MailTemplateFactory.TEST_TEMPLATE_1);
+ assertNotNull(testTemplate1);
+
+ testMap1 = new HashMap();
+ testMap1.put("username", "susan");
+ testMap1.put("url", "http://example.com/og/");
+ testMap1.put("moon.unit", "zappa");
+ testMap1.put("Kurt", "Vonnegut.");
+ }
+
+ private void delete(File dir) {
+ File[] children = dir.listFiles();
+ for (int i = 0; i < children.length; i++) {
+ assertTrue(children[i].delete());
+ }
+ assertTrue(dir.delete());
+ }
+
+ public void tearDown() {
+ if (mailOutputDir != null && mailOutputDir.exists()) {
+ delete(mailOutputDir);
+ }
+ }
+
+ public void testClientFileOutput() throws MailSendException, FileNotFoundException, IOException {
+ String body = "This is the body.";
+ String to = "to...@ex...";
+ String from = "ha...@ex...";
+ String subject = "OWLs 'n Stuff";
+ mailClient1.sendEmail(to, from, subject, body);
+ File[] files = mailClient1.getOutputDir().listFiles();
+ assertNotNull(files);
+ assertEquals(1, files.length);
+ assertFalse(files[0].length() == 0);
+ String fileContents = StreamUtils.readInput(new FileInputStream(files[0]));
+ assertTrue(fileContents.endsWith(body));
+ }
+
+ public void testFormat() {
+ String result = mailFormatter1.format(testMap1, testTemplate1);
+ assertNotNull(result);
+ assertTrue(result.length() > 1);
+ assertExactlyOne(result, (String) testMap1.get("username"));
+ assertMultiple(result, (String) testMap1.get("url"));
+ assertExactlyOne(result, (String) testMap1.get("moon.unit"));
+ assertExactlyOne(result, (String) testMap1.get("Kurt"));
+ }
+
+ private void assertExactlyOne(String data, String target) {
+ ArgumentUtils.assertNotEmpty(data);
+ ArgumentUtils.assertNotEmpty(target);
+ assertFalse(data.indexOf(target) == -1);
+ assertTrue(data.indexOf(target) == data.lastIndexOf(target));
+ }
+
+ private void assertMultiple(String data, String target) {
+ ArgumentUtils.assertNotEmpty(data);
+ ArgumentUtils.assertNotEmpty(target);
+ assertFalse(data.indexOf(target) == -1);
+ assertFalse(data.indexOf(target) == data.lastIndexOf(target));
+ }
+}
Modified: maven/trunk/ogoglio-server/src/main/java/com/ogoglio/migrate/AccountsForTesting.java
===================================================================
--- maven/trunk/ogoglio-server/src/main/java/com/ogoglio/migrate/AccountsForTesting.java 2007-08-27 23:52:59 UTC (rev 275)
+++ maven/trunk/ogoglio-server/src/main/java/com/ogoglio/migrate/AccountsForTesting.java 2007-08-27 23:53:13 UTC (rev 276)
@@ -44,6 +44,7 @@
//actual work
ServiceInitializationPersistTasks.initializeLocalSim(uri,sessionFactory);
ServiceInitializationPersistTasks.initializeBootstrapAccount(sessionFactory, uri.getHost(), user, pw);
+ ServiceInitializationPersistTasks.initializeServiceState(sessionFactory);
return true;
} catch (Exception e) {
e.printStackTrace();
Modified: maven/trunk/ogoglio-server/src/main/java/com/ogoglio/persist/AccountRecord.java
===================================================================
--- maven/trunk/ogoglio-server/src/main/java/com/ogoglio/persist/AccountRecord.java 2007-08-27 23:52:59 UTC (rev 275)
+++ maven/trunk/ogoglio-server/src/main/java/com/ogoglio/persist/AccountRecord.java 2007-08-27 23:53:13 UTC (rev 276)
@@ -15,10 +15,8 @@
import com.ogoglio.xml.AccountDocument;
-
public class AccountRecord {
-
private String username = null;
private String accountlevel = AccountDocument.ACCOUNT_LEVEL_BASIC;
@@ -60,6 +58,8 @@
if (this.email == null) {
throw new IllegalArgumentException("Bad email: " + email);
}
+
+ this.creationDate = System.currentTimeMillis();
}
public boolean equals(Object obj) {
@@ -81,11 +81,11 @@
return null;
}
String result = password.trim();
- if (result.length() < 5) {
+ if (result.length() < 4) {
return null;
}
for (int i = 0; i < result.length(); i++) {
- if (!Character.isLetterOrDigit(result.charAt(i))) {
+ if (result.charAt(i) != ' ') {
return null;
}
}
@@ -104,13 +104,13 @@
if (result.length() == 0) {
return null;
}
- if(result.indexOf('@') == -1 || result.indexOf('@') == 0 || result.indexOf('@') == result.length() - 1) {
+ if (result.indexOf('@') == -1 || result.indexOf('@') == 0 || result.indexOf('@') == result.length() - 1) {
return null;
}
- if(result.indexOf(' ') != -1) {
+ if (result.indexOf(' ') != -1) {
return null;
}
- if(result.indexOf('.') == -1 || result.indexOf('.') == result.length() - 1) {
+ if (result.indexOf('.') == -1 || result.indexOf('.') == result.length() - 1) {
return null;
}
return result;
@@ -155,7 +155,7 @@
}
public void setAccountlevel(String level) {
- if(verifyAccountLevel(level) == null) {
+ if (verifyAccountLevel(level) == null) {
throw new IllegalArgumentException("Bad account level: " + level);
}
this.accountlevel = level;
@@ -178,7 +178,7 @@
}
public long getCreationDate() {
- return creationDate;
+ return creationDate;
}
public void setCreationDate(long creationDate) {
@@ -253,7 +253,7 @@
this.defaultBodyId = defaultBodyID;
}
- public void setNotFrozen() {
- this.frozenUntil=AccountDocument.NO_TIME_VALUE;
- }
+ public void setNotFrozen() {
+ this.frozenUntil = AccountDocument.NO_TIME_VALUE;
+ }
}
Added: maven/trunk/ogoglio-server/src/main/java/com/ogoglio/persist/PendingEmailValidationRecord.java
===================================================================
--- maven/trunk/ogoglio-server/src/main/java/com/ogoglio/persist/PendingEmailValidationRecord.java (rev 0)
+++ maven/trunk/ogoglio-server/src/main/java/com/ogoglio/persist/PendingEmailValidationRecord.java 2007-08-27 23:53:13 UTC (rev 276)
@@ -0,0 +1,74 @@
+package com.ogoglio.persist;
+
+import java.util.Random;
+
+import com.ogoglio.util.ArgumentUtils;
+import com.ogoglio.xml.AccountDocument;
+
+public class PendingEmailValidationRecord {
+
+ private static Random RANDOM = new Random();
+
+ private String username = null;
+
+ private String email = null;
+
+ private String secret = null;
+
+ private long creationDate = AccountDocument.NO_TIME_VALUE;
+
+ public PendingEmailValidationRecord() {
+ }
+
+ public PendingEmailValidationRecord(String username, String email) {
+ ArgumentUtils.assertNotEmpty(username);
+ ArgumentUtils.assertIsEmail(email);
+ this.username = username;
+ this.email = email;
+ this.secret = generateSecret();
+ creationDate = System.currentTimeMillis();
+ }
+
+ private static final String SECRET_SOURCE = "abcdefghijklmnopqrstuvwxyz1234567890";
+
+ private String generateSecret() {
+ StringBuffer result = new StringBuffer();
+ for (int i = 0; i < 25; i++) {
+ result.append(SECRET_SOURCE.charAt(Math.abs(RANDOM.nextInt()) % SECRET_SOURCE.length()));
+ }
+ return result.toString();
+ }
+
+ public long getCreationDate() {
+ return creationDate;
+ }
+
+ public void setCreationDate(long creationDate) {
+ this.creationDate = creationDate;
+ }
+
+ public String getEmail() {
+ return email;
+ }
+
+ public void setEmail(String email) {
+ ArgumentUtils.assertIsEmail(email);
+ this.email = email;
+ }
+
+ public String getSecret() {
+ return secret;
+ }
+
+ public void setSecret(String secret) {
+ this.secret = secret;
+ }
+
+ public String getUsername() {
+ return username;
+ }
+
+ public void setUsername(String username) {
+ this.username = username;
+ }
+}
Added: maven/trunk/ogoglio-server/src/main/java/com/ogoglio/persist/PendingEmailValidationTasks.java
===================================================================
--- maven/trunk/ogoglio-server/src/main/java/com/ogoglio/persist/PendingEmailValidationTasks.java (rev 0)
+++ maven/trunk/ogoglio-server/src/main/java/com/ogoglio/persist/PendingEmailValidationTasks.java 2007-08-27 23:53:13 UTC (rev 276)
@@ -0,0 +1,61 @@
+package com.ogoglio.persist;
+
+import org.hibernate.Query;
+import org.hibernate.Session;
+import org.hibernate.SessionFactory;
+
+public class PendingEmailValidationTasks {
+
+ public static final String PEV_BY_USERNAME = "com.ogoglio.persist.pendingEmailValidationsByUsername";
+ public static final String PEV_BY_EMAIL = "com.ogoglio.persist.pendingEmailValidationByEmail";
+ public static final String PEV_BY_SECRET = "com.ogoglio.persist.pendingEmailValidationBySecret";
+
+ public static PendingEmailValidationRecord[] findPendingEmailValidationsByUsername(final String username, SessionFactory sessionFactory) throws PersistException {
+ HibernateTask task = new HibernateTask() {
+ public Object run(Session hibernateSession) {
+ Query query = hibernateSession.getNamedQuery(PEV_BY_USERNAME);
+ query.setParameter("username", username);
+ PendingEmailValidationRecord recs[] = (PendingEmailValidationRecord[]) query.list().toArray(new PendingEmailValidationRecord[0]);
+ return recs;
+ }
+ };
+ task.setSessionFactory(sessionFactory);
+ return (PendingEmailValidationRecord[]) task.execute();
+ }
+
+ public static PendingEmailValidationRecord findPendingEmailValidationByEmail(final String email, SessionFactory sessionFactory) throws PersistException {
+ HibernateTask task = new HibernateTask() {
+ public Object run(Session hibernateSession) {
+ Query query = hibernateSession.getNamedQuery(PEV_BY_EMAIL);
+ query.setParameter("email", email);
+ return query.uniqueResult();
+ }
+ };
+ task.setSessionFactory(sessionFactory);
+ return (PendingEmailValidationRecord) task.execute();
+ }
+
+ public static PendingEmailValidationRecord findPendingEmailValidationBySecret(final String secret, SessionFactory sessionFactory) throws PersistException {
+ HibernateTask task = new HibernateTask() {
+ public Object run(Session hibernateSession) {
+ Query query = hibernateSession.getNamedQuery(PEV_BY_SECRET);
+ query.setParameter("secret", secret);
+ return query.uniqueResult();
+ }
+ };
+ task.setSessionFactory(sessionFactory);
+ return (PendingEmailValidationRecord) task.execute();
+ }
+
+ public static boolean delete(final PendingEmailValidationRecord validationRecord, SessionFactory sessionFactory) throws PersistException {
+ HibernateTask task = new HibernateTask() {
+ public Object run(Session hibernateSession) {
+ hibernateSession.delete(validationRecord);
+ return Boolean.TRUE;
+ }
+ };
+ task.setSessionFactory(sessionFactory);
+ return Boolean.TRUE.equals(task.execute());
+ }
+
+}
Modified: maven/trunk/ogoglio-server/src/main/java/com/ogoglio/persist/ServiceInitializationPersistTasks.java
===================================================================
--- maven/trunk/ogoglio-server/src/main/java/com/ogoglio/persist/ServiceInitializationPersistTasks.java 2007-08-27 23:52:59 UTC (rev 275)
+++ maven/trunk/ogoglio-server/src/main/java/com/ogoglio/persist/ServiceInitializationPersistTasks.java 2007-08-27 23:53:13 UTC (rev 276)
@@ -46,4 +46,8 @@
AccountPersistTasks.update(accountRec, sessionFactory);
}
+
+ public static void initializeServiceState(SessionFactory sessionFactory) throws PersistException, IOException{
+ ServiceStateTasks.getOrCreateServiceState(sessionFactory);
+ }
}
Added: maven/trunk/ogoglio-server/src/main/java/com/ogoglio/persist/ServiceStateRecord.java
===================================================================
--- maven/trunk/ogoglio-server/src/main/java/com/ogoglio/persist/ServiceStateRecord.java (rev 0)
+++ maven/trunk/ogoglio-server/src/main/java/com/ogoglio/persist/ServiceStateRecord.java 2007-08-27 23:53:13 UTC (rev 276)
@@ -0,0 +1,43 @@
+package com.ogoglio.persist;
+
+import com.ogoglio.xml.ServiceStateDocument;
+
+public class ServiceStateRecord {
+
+ private String registrationState = ServiceStateDocument.REGISTRATION_STATE_ADMIN_ONLY;
+
+ private long serviceStateID = -1;
+
+ public ServiceStateRecord() {
+ }
+
+ public ServiceStateRecord(String registrationState) {
+ setRegistrationState(registrationState);
+ }
+
+ public String getRegistrationState() {
+ return registrationState;
+ }
+
+ public void setRegistrationState(String registrationState) {
+ assertValidRegistrationState(registrationState);
+ this.registrationState = registrationState;
+ }
+
+ private void assertValidRegistrationState(String registrationState) {
+ for (int i = 0; i < ServiceStateDocument.REGISTRATION_STATES.length; i++) {
+ if (ServiceStateDocument.REGISTRATION_STATES[i].equals(registrationState)) {
+ return;
+ }
+ }
+ throw new IllegalArgumentException("Baad registration state: " + registrationState);
+ }
+
+ public long getServiceStateID() {
+ return serviceStateID;
+ }
+
+ public void setServiceStateID(long serviceStateID) {
+ this.serviceStateID = serviceStateID;
+ }
+}
\ No newline at end of file
Added: maven/trunk/ogoglio-server/src/main/java/com/ogoglio/persist/ServiceStateTasks.java
===================================================================
--- maven/trunk/ogoglio-server/src/main/java/com/ogoglio/persist/ServiceStateTasks.java (rev 0)
+++ maven/trunk/ogoglio-server/src/main/java/com/ogoglio/persist/ServiceStateTasks.java 2007-08-27 23:53:13 UTC (rev 276)
@@ -0,0 +1,54 @@
+package com.ogoglio.persist;
+
+import org.hibernate.Query;
+import org.hibernate.Session;
+import org.hibernate.SessionFactory;
+
+import com.ogoglio.xml.ServiceStateDocument;
+
+public class ServiceStateTasks {
+
+ public static final String SERVICE_STATE_RECORDS = "com.ogoglio.persist.serviceStateRecords";
+
+ /**
+ * This will barf if there are more than one service state records
+ */
+ public static ServiceStateRecord getOrCreateServiceState(SessionFactory sessionFactory) throws PersistException{
+ HibernateTask task = new HibernateTask() {
+ public Object run(Session session) throws PersistException {
+ Query query = session.getNamedQuery(SERVICE_STATE_RECORDS);
+ ServiceStateRecord record = (ServiceStateRecord)query.uniqueResult();
+ if(record == null) {
+ record = new ServiceStateRecord();
+ session.save(record);
+ }
+ return record;
+ }
+ };
+ task.setSessionFactory(sessionFactory);
+ return (ServiceStateRecord) task.execute();
+ }
+
+ public static ServiceStateRecord updateServiceState(final ServiceStateDocument proposedDoc, SessionFactory sessionFactory) throws PersistException {
+ HibernateTask task = new HibernateTask() {
+ public Object run(Session session) throws PersistException {
+ Query query = session.getNamedQuery(SERVICE_STATE_RECORDS);
+ ServiceStateRecord record = (ServiceStateRecord)query.uniqueResult();
+ if(record == null) {
+ throw new IllegalStateException("Tried to update service state when there's no record!");
+ }
+ boolean dirty = false;
+ if(!record.getRegistrationState().equals(proposedDoc.getRegistrationState())) {
+ record.setRegistrationState(proposedDoc.getRegistrationState());
+ dirty = true;
+ }
+ if(dirty) {
+ session.update(record);
+ }
+ return record;
+ }
+ };
+ task.setSessionFactory(sessionFactory);
+ return (ServiceStateRecord) task.execute();
+ }
+}
Modified: maven/trunk/ogoglio-server/src/main/java/com/ogoglio/sim/SpaceSimulator.java
===================================================================
--- maven/trunk/ogoglio-server/src/main/java/com/ogoglio/sim/SpaceSimulator.java 2007-08-27 23:52:59 UTC (rev 275)
+++ maven/trunk/ogoglio-server/src/main/java/com/ogoglio/sim/SpaceSimulator.java 2007-08-27 23:53:13 UTC (rev 276)
@@ -41,6 +41,7 @@
import com.ogoglio.util.BlockingQueue;
import com.ogoglio.util.BlockingQueue.QueueClosedException;
import com.ogoglio.viewer.j3d.J3DRenderer;
+import com.ogoglio.viewer.render.UIConstants;
import com.ogoglio.xml.BodyDocument;
import com.ogoglio.xml.DoorDocument;
import com.ogoglio.xml.PageDocument;
@@ -162,17 +163,17 @@
public InputStream getUserAnimationStream(String username, long animationID) throws IOException {
if (animationID == 1) {
- return SpaceSimulator.class.getClassLoader().getResourceAsStream("com/ogoglio/viewer/applet/resources/avatar.bvh");
+ return UIConstants.getResource("avatar/avatar.bvh");
} else if (animationID == 2) {
- return SpaceSimulator.class.getClassLoader().getResourceAsStream("com/ogoglio/viewer/applet/resources/avatar-walk.bvh");
+ return UIConstants.getResource("avatar/avatar-walk.bvh");
} else if (animationID == 3) {
- return SpaceSimulator.class.getClassLoader().getResourceAsStream("com/ogoglio/viewer/applet/resources/avatar-wave.bvh");
+ return UIConstants.getResource("avatar/avatar-wave.bvh");
}
return null;
}
public InputStream getUserSkinMapStream(String username) throws IOException {
- return SpaceSimulator.class.getClassLoader().getResourceAsStream("com/ogoglio/viewer/applet/resources/avatar.smap");
+ return UIConstants.getResource("avatar/avatar.smap");
}
public String getThingScript(long thingID) throws IOException {
@@ -184,7 +185,7 @@
}
public InputStream getUserGeometryStream(String username, String name) throws IOException {
- return SpaceSimulator.class.getClassLoader().getResourceAsStream("com/ogoglio/viewer/applet/resources/avatar.obj");
+ return UIConstants.getResource("avatar/avatar.obj");
}
public InputStream getPageContentStream(long thingID, long pageID) {
Added: maven/trunk/ogoglio-server/src/main/java/com/ogoglio/site/AbstractRemoteServlet.java
===================================================================
--- maven/trunk/ogoglio-server/src/main/java/com/ogoglio/site/AbstractRemoteServlet.java (rev 0)
+++ maven/trunk/ogoglio-server/src/main/java/com/ogoglio/site/AbstractRemoteServlet.java 2007-08-27 23:53:13 UTC (rev 276)
@@ -0,0 +1,88 @@
+package com.ogoglio.site;
+
+import java.io.IOException;
+import java.net.URI;
+import java.net.URISyntaxException;
+
+import javax.naming.Context;
+import javax.naming.InitialContext;
+import javax.naming.NamingException;
+import javax.servlet.ServletConfig;
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import com.ogoglio.client.AuthenticationFailedException;
+import com.ogoglio.client.WebAPIAuthenticator;
+import com.ogoglio.client.WebAPIAuthenticatorFactory;
+import com.ogoglio.client.WebAPIClient;
+import com.ogoglio.client.WebAPIClientWire;
+import com.ogoglio.client.WebAPIDescriptor;
+import com.ogoglio.site.AbstractResourceServlet;
+import com.ogoglio.site.AuthServlet;
+import com.ogoglio.util.ArgumentUtils;
+import com.ogoglio.xml.AuthDocument;
+
+public abstract class AbstractRemoteServlet extends AbstractResourceServlet {
+
+ private WebAPIClient ogoglioClient = null;
+
+ private String ogoglioUsername = null;
+
+ private String ogoglioPassword = null;
+
+ public abstract String getOgoglioUsernameContextKey();
+
+ public abstract String getOgoglioPasswordContextKey();
+
+ public void init(ServletConfig config) throws ServletException {
+ super.init(config);
+ try {
+ Context initCtx = new InitialContext();
+ Context envCtx = (Context) initCtx.lookup("java:comp/env");
+
+ ogoglioUsername = (String) envCtx.lookup(getOgoglioUsernameContextKey());
+ ArgumentUtils.assertNotEmpty(ogoglioUsername);
+ ogoglioPassword = (String) envCtx.lookup(getOgoglioPasswordContextKey());
+ ArgumentUtils.assertNotEmpty(ogoglioPassword);
+ } catch (NamingException e) {
+ throw new ServletException("Could not init EventServlet (probably forgot env variables in setup.xml): " + e);
+ }
+ }
+
+ public void service(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException {
+ if (ogoglioClient == null) {
+ try {
+ WebAPIClientWire wire = new WebAPIClientWire();
+ URI serviceURI = new URI(getSiteInfo().getBaseUrl());
+ WebAPIDescriptor descriptor = new WebAPIDescriptor(serviceURI);
+ WebAPIAuthenticator authenticator = new WebAPIAuthenticatorFactory().authenticate(wire, descriptor, ogoglioUsername, ogoglioPassword);
+ ogoglioClient = new WebAPIClient(new WebAPIDescriptor(serviceURI), authenticator, wire);
+ } catch (URISyntaxException e) {
+ throw new ServletException("Could not connect to ogoglio service: " + e);
+ } catch (IOException e) {
+ throw new ServletException("Failed because of Ogoglio service communication failure: " + e);
+ } catch (AuthenticationFailedException e) {
+ throw new ServletException("Failed because of Ogoglio service auth failure: " + e);
+ }
+ }
+
+ super.service(request, response);
+ }
+
+ public AuthDocument getAuthDocument(HttpServletRequest request) throws IOException {
+ String authCookie = AuthServlet.getRequestAuthCookie(request);
+ if (authCookie == null) {
+ return null;
+ }
+ return getOgoglioClient().getAuthDocumentByAuthCookie(authCookie);
+ }
+
+ public WebAPIClient getOgoglioClient() {
+ return ogoglioClient;
+ }
+
+ public String getOgoglioUsername() {
+ return ogoglioUsername;
+ }
+}
Modified: maven/trunk/ogoglio-server/src/main/java/com/ogoglio/site/AbstractResourceServlet.java
===================================================================
--- maven/trunk/ogoglio-server/src/main/java/com/ogoglio/site/AbstractResourceServlet.java 2007-08-27 23:52:59 UTC (rev 275)
+++ maven/trunk/ogoglio-server/src/main/java/com/ogoglio/site/AbstractResourceServlet.java 2007-08-27 23:53:13 UTC (rev 276)
@@ -50,7 +50,7 @@
public static final String OGOGLIO_BASE_URL_KEY = "ogoglio/baseURL";
- public static final String HIBERNATE_SESSION_FACTORY_KEY = "com.ogoglio.hibernateSessionFactory";
+ private static final String HIBERNATE_SESSION_FACTORY_KEY = "com.ogoglio.hibernateSessionFactory";
private static final String METHOD_PARAM = "method";
@@ -82,8 +82,15 @@
mediaDirectory = new File((String)envCtx.lookup("ogoglio/mediaDirectory"));
} catch (NamingException e) {
}
- siteInfo = new SiteInfo(baseUrl, mediaUrl, simsAllowRemoteAccess, mediaDirectory);
+ File mailDir = null;
+ try {
+ mailDir = new File((String)envCtx.lookup("ogoglio/mailDirectory"));
+ } catch (NamingException e) {
+ }
+
+ siteInfo = new SiteInfo(baseUrl, mediaUrl, simsAllowRemoteAccess, mediaDirectory, mailDir);
+
mediaService = new MediaService(new URI(siteInfo.getMediaUrl()));
} catch (IOException e) {
throw new ServletException("Could not init: " + e);
@@ -103,7 +110,7 @@
throw new IllegalStateException("The base resource must have a String path element: " + baseResource.getPathElement());
}
}
-
+
public void destroy() {
try {
hibernateSessionFactory.close();
@@ -124,7 +131,7 @@
return hibernateSessionFactory;
}
- private static SessionFactory getOrCreateHibernateSessionFactory(ServletConfig config, Context context) {
+private static SessionFactory getOrCreateHibernateSessionFactory(ServletConfig config, Context context) {
SessionFactory sessionFactory = (SessionFactory) config.getServletContext().getAttribute(HIBERNATE_SESSION_FACTORY_KEY);
if (sessionFactory == null) {
System.out.println(config.getServletName()+" checking DB Version...");
@@ -137,7 +144,6 @@
}
return sessionFactory;
}
-
public static void setNoCache(HttpServletResponse response) {
//IE caches XMLHttpRequest responses, so we set explicit no-cache headers
response.addHeader("Cache-Control", "must-revalidate");
@@ -247,7 +253,7 @@
outputStream.flush();
outputStream.close();
}
- System.out.println("FART 2nd level proxy:"+connection.getResponseCode());
+
response.setStatus(connection.getResponseCode());
Map headers = connection.getHeaderFields();
Modified: maven/trunk/ogoglio-server/src/main/java/com/ogoglio/site/AccountServlet.java
===================================================================
--- maven/trunk/ogoglio-server/src/main/java/com/ogoglio/site/AccountServlet.java 2007-08-27 23:52:59 UTC (rev 275)
+++ maven/trunk/ogoglio-server/src/main/java/com/ogoglio/site/AccountServlet.java 2007-08-27 23:53:13 UTC (rev 276)
@@ -17,6 +17,7 @@
import java.io.InputStream;
import java.net.URI;
import java.net.URISyntaxException;
+import java.util.Map;
import javax.media.j3d.Transform3D;
import javax.servlet.ServletConfig;
@@ -28,14 +29,22 @@
import com.ogoglio.client.WebAPIClientWire;
import com.ogoglio.client.WebAPIUtil;
+import com.ogoglio.mail.MailClient;
+import com.ogoglio.mail.MailFormatter;
+import com.ogoglio.mail.MailSendException;
+import com.ogoglio.mail.MailTemplateFactory;
import com.ogoglio.media.MediaService;
import com.ogoglio.persist.AccountPersistTasks;
import com.ogoglio.persist.AccountRecord;
import com.ogoglio.persist.BodyPersistTasks;
import com.ogoglio.persist.BodyRecord;
+import com.ogoglio.persist.PendingEmailValidationRecord;
+import com.ogoglio.persist.PendingEmailValidationTasks;
import com.ogoglio.persist.PersistException;
import com.ogoglio.persist.PossessionPersistTasks;
import com.ogoglio.persist.PossessionRecord;
+import com.ogoglio.persist.ServiceStateRecord;
+import com.ogoglio.persist.ServiceStateTasks;
import com.ogoglio.persist.SimRecord;
import com.ogoglio.persist.SpaceMemberPersistTasks;
import com.ogoglio.persist.SpaceMemberRecord;
@@ -48,12 +57,15 @@
import com.ogoglio.xml.AccountDocument;
import com.ogoglio.xml.BodyDocument;
import com.ogoglio.xml.PossessionDocument;
+import com.ogoglio.xml.ServiceStateDocument;
import com.ogoglio.xml.TemplateDocument;
import com.ogoglio.xml.ThingDocument;
import com.ogoglio.xml.server.DocumentFactory;
public class AccountServlet extends AbstractResourceServlet {
+ public static final String SECRET_PARAMETER = "secret";
+
public static URI getAccountURI(AccountRecord accountRecord, URI baseURI) {
try {
return new URI(baseURI.toString() + "account/" + accountRecord.getUsername());
@@ -73,26 +85,6 @@
return result;
}
- public void init(ServletConfig config) throws ServletException {
- super.init(config);
- /*
- * IES:NOT NEEDED NOW WITH DB MIGRATION?
- try {
- ServiceInitializationPersistTasks.initializeLocalSim(new URI(getSiteInfo().getBaseUrl()), getSessionFactory());
- ServiceInitializationPersistTasks.initializeLibraryAccount(getSessionFactory(), getSiteInfo().getHost());
- } catch (PersistException e) {
- e.printStackTrace();
- throw new ServletException("Could not initialize service: " + e);
- } catch (URISyntaxException e) {
- e.printStackTrace();
- throw new ServletException("Could not initialize service: " + e);
- } catch (IOException e) {
- e.printStackTrace();
- throw new ServletException("Could not initialize service: " + e);
- }
- */
- }
-
public SiteResource createBaseResource(ServletConfig servletConfig) {
return new AccountsResource();
}
@@ -102,6 +94,7 @@
public AccountsResource() {
super("account", false, getSessionFactory());
addSubResource(new TemplateQueryResource());
+ addSubResource(new EmailValidationResource());
addSubResource(new AccountResource());
}
@@ -109,8 +102,25 @@
sendStringResponse("Nothing to see here, folks.\n", "text/plain", response);
}
+ private boolean canCreateAccount(AccountRecord authedAccount) throws PersistException {
+ ServiceStateRecord serviceStateRecord = ServiceStateTasks.getOrCreateServiceState(getSessionFactory());
+ if (ServiceStateDocument.REGISTRATION_STATE_OPEN.equals(serviceStateRecord.getRegistrationState())) {
+ return true;
+ }
+
+ if (ServiceStateDocument.REGISTRATION_STATE_CLOSED.equals(serviceStateRecord.getRegistrationState())) {
+ return false;
+ }
+
+ if (authedAccount == null || !AccountDocument.ACCOUNT_LEVEL_ADMIN.equals(authedAccount.getAccountlevel())) {
+ return false;
+ }
+ return true;
+
+ }
+
public void doPost(HttpServletRequest request, HttpServletResponse response, String[] pathElements, AccountRecord authedAccount) throws ServletException, IOException, PersistException {
- if (authedAccount == null || !AccountDocument.ACCOUNT_LEVEL_ADMIN.equals(authedAccount.getAccountlevel())) {
+ if (!canCreateAccount(authedAccount)) {
response.setStatus(HttpServletResponse.SC_FORBIDDEN);
return;
}
@@ -129,10 +139,68 @@
newAccountRec.setLastName(newAccountDoc.getLastName());
newAccountRec.setHomepage(newAccountDoc.getHomepage());
AccountPersistTasks.update(newAccountRec, sessionFactory);
+
+ PendingEmailValidationRecord validationRecord = PendingEmailValidationTasks.findPendingEmailValidationByEmail(newAccountRec.getEmail(), getSessionFactory());
+ if (validationRecord != null) {
+ try {
+ sendValidationMail(validationRecord);
+ } catch (MailSendException e) {
+ System.err.println("Could not send validation email: " + e);
+ }
+ } else {
+ System.err.println("Created an account without creating an email validation: " + newAccountRec.getUsername());
+ }
+
sendStringResponse(createAccountDocument(newAccountRec, true).toElement().toString(), "text/xml", response);
}
}
+ private void sendValidationMail(PendingEmailValidationRecord validationRecord) throws MailSendException {
+ String from = "robot@" + getSiteInfo().getHost();
+ String validationURL = getSiteInfo().getBaseUrl() + "account/validate?" + SECRET_PARAMETER + "=" + validationRecord.getSecret();
+
+ MailFormatter mailFormatter = new MailFormatter();
+ Map validationMap = MailTemplateFactory.createEmailValidationMap(validationRecord.getEmail(), validationURL, "Ogoglio", getSiteInfo().getBaseUrl());
+ String body = mailFormatter.format(validationMap, MailTemplateFactory.getTemplate(MailTemplateFactory.EMAIL_VALIDATION_TEMPLATE));
+
+ MailClient mailClient = null;
+ if (getSiteInfo().getMailDirectory() == null) {
+ mailClient = new MailClient();
+ } else {
+ mailClient = new MailClient(getSiteInfo().getMailDirectory());
+ }
+ mailClient.sendEmail(validationRecord.getEmail(), from, "validate request", body);
+ System.out.println("Sent validation email to " + validationRecord.getEmail());
+ }
+
+ private class EmailValidationResource extends AuthenticatedSiteResource {
+ public EmailValidationResource() {
+ super("validate", false, getSessionFactory());
+ }
+
+ public void doGet(HttpServletRequest request, HttpServletResponse response, String[] pathElements, AccountRecord authedAccount) throws PersistException, ServletException, IOException {
+ String requestedSecret = request.getParameter(SECRET_PARAMETER);
+ if (requestedSecret == null || requestedSecret.length() == 0) {
+ System.err.println("Requested validation with no secret");
+ response.setStatus(HttpServletResponse.SC_NOT_FOUND);
+ return;
+ }
+ PendingEmailValidationRecord validationRecord = PendingEmailValidationTasks.findPendingEmailValidationBySecret(requestedSecret, getSessionFactory());
+ if (validationRecord == null) {
+ System.err.println("Requested validation with unknown secret: " + requestedSecret);
+ response.setStatus(HttpServletResponse.SC_NOT_FOUND);
+ return;
+ }
+
+ if (!PendingEmailValidationTasks.delete(validationRecord, getSessionFactory())) {
+ System.err.println("Could not delete validation record for email: " + validationRecord.getEmail());
+ response.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
+ return;
+ }
+ sendStringResponse("ok", "text/plain", response);
+ }
+ }
+
private class AccountResource extends AuthenticatedSiteResource {
public AccountResource() {
super(SiteResource.WILDCARD_ELEMENT, true, getSessionFactory());
@@ -195,12 +263,12 @@
response.setStatus(HttpServletResponse.SC_FORBIDDEN);
return;
}
- if (requestedAccount.getFrozenUntil() != AccountDocument.NO_TIME_VALUE && requestedAccount.getFrozenUntil()!=updatedDocument.getFrozenUntil().getTime()) {
+ if (requestedAccount.getFrozenUntil() != AccountDocument.NO_TIME_VALUE && requestedAccount.getFrozenUntil() != updatedDocument.getFrozenUntil().getTime()) {
System.err.println("User tried to update own freeze: " + requestedAccount.getUsername());
response.setStatus(HttpServletResponse.SC_FORBIDDEN);
return;
}
- if (requestedAccount.getFrozenUntil() !=AccountDocument.NO_TIME_VALUE && updatedDocument.getFrozenUntil() != null) {
+ if (requestedAccount.getFrozenUntil() != AccountDocument.NO_TIME_VALUE && updatedDocument.getFrozenUntil() != null) {
System.err.println("User tried to freeze themselves: " + requestedAccount.getUsername());
response.setStatus(HttpServletResponse.SC_FORBIDDEN);
return;
@@ -210,9 +278,9 @@
//TODO if this returns false we really should reflect that in the response
if (!AccountPersistTasks.update(requestedAccount, updatedDocument, getSessionFactory())) {
- System.out.println("Warning: ACCOUNT update failed:"+requestedAccount.getUsername());
+ System.out.println("Warning: ACCOUNT update failed:" + requestedAccount.getUsername());
}
- //AccountPersistTasks.findAccountByUsername(usernameParam, getSessionFactory());
+
AccountDocument result = createAccountDocument(requestedAccount, true);
response.setStatus(HttpServletResponse.SC_OK);
response.setContentType("text/xml");
@@ -261,7 +329,7 @@
public class TemplatesResource extends AuthenticatedSiteResource {
public TemplatesResource() {
super("template", true, getSessionFactory());
- addSubResource(new TemplateResource(getSessionFactory(),getMediaService()));
+ addSubResource(new TemplateResource(getSessionFactory(), getMediaService()));
}
public void doPost(HttpServletRequest request, HttpServletResponse response, String[] pathElements, AccountRecord authedAccount) throws PersistException, ServletException, IOException {
@@ -278,14 +346,13 @@
response.setStatus(HttpServletResponse.SC_BAD_REQUEST);
return;
}
-
+
TemplateDocument result = DocumentFactory.documentFromRecord(rec);
sendStringResponse(result.toString(), "text/xml", response);
}
- public void doGet(HttpServletRequest request, HttpServletResponse response, String[] pathElements,
- AccountRecord authedAccount) throws PersistException, ServletException, IOException {
+ public void doGet(HttpServletRequest request, HttpServletResponse response, String[] pathElements, AccountRecord authedAccount) throws PersistException, ServletException, IOException {
String usernameParam = pathElements[pathElements.length - 2];
AccountRecord requestedAccount = AccountPersistTasks.findAccountByUsername(usernameParam, getSessionFactory());
if (requestedAccount == null) {
Modified: maven/trunk/ogoglio-server/src/main/java/com/ogoglio/site/SiteInfo.java
===================================================================
--- maven/trunk/ogoglio-server/src/main/java/com/ogoglio/site/SiteInfo.java 2007-08-27 23:52:59 UTC (rev 275)
+++ maven/trunk/ogoglio-server/src/main/java/com/ogoglio/site/SiteInfo.java 2007-08-27 23:53:13 UTC (rev 276)
@@ -22,7 +22,7 @@
*
*/
public class SiteInfo {
-
+
// The base URL is the externally visible URL for the service. For example, http://YOUR_PUBLIC_DOMAIN.com/og/
private String baseUrl = null;
@@ -31,17 +31,25 @@
//True if the SimServlet handle allow non-local requests
private boolean simsAllowRemoteAccess = false;
-
+
// The media directory is where the MediaServlet will store your models, textures, scripts, and space documents
private File mediaDirectory = null;
-
- public SiteInfo(String baseUrl, String mediaUrl, boolean simsAllowRemoteAccess, File mediaDirectory) {
+
+ // The directory where mail will be written if we're not actually sending email via JNDI provided session
+ private File mailDirectory = null;
+
+ public SiteInfo(String baseUrl, String mediaUrl, boolean simsAllowRemoteAccess, File mediaDirectory, File mailDirectory) {
this.baseUrl = baseUrl;
this.mediaUrl = mediaUrl;
this.simsAllowRemoteAccess = simsAllowRemoteAccess;
this.mediaDirectory = mediaDirectory;
+ this.mailDirectory = mailDirectory;
}
+ public File getMailDirectory() {
+ return mailDirectory;
+ }
+
public String getBaseUrl() {
return baseUrl;
}
@@ -58,7 +66,7 @@
throw new IllegalStateException("Bad base url: " + getBaseUrl());
}
}
-
+
public boolean simsAllowRemoteAccess() {
return simsAllowRemoteAccess;
}
Modified: maven/trunk/ogoglio-server/src/main/java/com/ogoglio/site/SpaceServlet.java
===================================================================
--- maven/trunk/ogoglio-server/src/main/java/com/ogoglio/site/SpaceServlet.java 2007-08-27 23:52:59 UTC (rev 275)
+++ maven/trunk/ogoglio-server/src/main/java/com/ogoglio/site/SpaceServlet.java 2007-08-27 23:53:13 UTC (rev 276)
@@ -31,6 +31,8 @@
import com.ogoglio.media.MediaService;
import com.ogoglio.persist.AccountRecord;
import com.ogoglio.persist.PersistException;
+import com.ogoglio.persist.ServiceStateRecord;
+import com.ogoglio.persist.ServiceStateTasks;
import com.ogoglio.persist.SimPersistTasks;
import com.ogoglio.persist.SimRecord;
import com.ogoglio.persist.SpaceMemberPersistTasks;
@@ -39,6 +41,7 @@
import com.ogoglio.persist.SpaceRecord;
import com.ogoglio.xml.AccountDocument;
import com.ogoglio.xml.ServiceDocument;
+import com.ogoglio.xml.ServiceStateDocument;
import com.ogoglio.xml.SimDocument;
import com.ogoglio.xml.SpaceDocument;
import com.ogoglio.xml.SpaceMemberDocument;
@@ -69,7 +72,7 @@
if (messageProxy != null) {
messageProxy.cleanup();
}
- System.out.println("Destroy called on SpaceServlet. Cleaning up proxy....");
+ System.out.println("Destroy called on SpaceServlet. Cleaning up proxy....");
} catch (Throwable e) {
e.printStackTrace();
}
@@ -82,15 +85,16 @@
private class BaseSpaceResource extends AuthenticatedSiteResource {
public BaseSpaceResource() {
super("space", false, getSessionFactory());
+ addSubResource(new SimResource());
+ addSubResource(new StateResource());
addSubResource(new SpaceResource());
- addSubResource(new SimResource());
}
public void doGet(HttpServletRequest request, HttpServletResponse response, String[] pathElements, AccountRecord authedAccount) throws PersistException, ServletException, IOException {
ServiceDocument serviceDocument = new ServiceDocument(messageProxy.getUserCount(), messageProxy.getSimCount());
sendStringResponse(serviceDocument.toString(), "text/xml", response);
}
-
+
public void doPost(HttpServletRequest request, HttpServletResponse response, String[] pathElements, AccountRecord authedAccount) throws PersistException, ServletException, IOException {
if (authedAccount == null || authedAccount.isFrozen()) {
response.setStatus(HttpServletResponse.SC_FORBIDDEN);
@@ -117,6 +121,32 @@
}
}
+ private class StateResource extends AuthenticatedSiteResource {
+ public StateResource() {
+ super("state", false, getSessionFactory());
+ }
+
+ public void doGet(HttpServletRequest request, HttpServletResponse response, String[] pathElements, AccountRecord authedAccount) throws PersistException, IOException {
+ ServiceStateRecord record = ServiceStateTasks.getOrCreateServiceState(getSessionFactory());
+ sendStringResponse(DocumentFactory.documentFromRecord(record).toElement().toString(), "text/xml", response);
+ }
+
+
+ public void doPost(HttpServletRequest request, HttpServletResponse response, String[] pathElements, AccountRecord authedAccount) throws PersistException, IOException {
+ if(authedAccount == null || !AccountDocument.ACCOUNT_LEVEL_ADMIN.equals(authedAccount.getAccountlevel())) {
+ response.setStatus(HttpServletResponse.SC_FORBIDDEN);
+ return;
+ }
+ ServiceStateDocument proposedDoc = new ServiceStateDocument(parseXML(request.getInputStream()));
+ ServiceStateRecord record = ServiceStateTasks.updateServiceState(proposedDoc, getSessionFactory());
+ if(record == null) {
+ response.setStatus(HttpServletResponse.SC_BAD_REQUEST);
+ return;
+ }
+ sendStringResponse(DocumentFactory.documentFromRecord(record).toElement().toString(), "text/xml", response);
+ }
+}
+
private class SpaceResource extends AuthenticatedSiteResource {
public SpaceResource() {
super(SiteResource.LONG_ELEMENT, false, getSessionFactory());
@@ -152,7 +182,6 @@
}
public void doGet(HttpServletRequest request, HttpServletResponse response, String[] pathElements, AccountRecord authedAccount) throws PersistException, IOException {
- System.out.println("***WE ARE FART:"+(pathElements.length-1));
long spaceID = Long.parseLong(pathElements[pathElements.length - 1]);
SpaceRecord spaceRecord = SpacePersistTasks.findSpaceBySpaceID(spaceID, getSessionFactory());
if (spaceRecord == null) {
@@ -217,7 +246,7 @@
return;
}
}
-
+
// delete the space from database
SpacePersistTasks.deleteSpace(spaceRecord, getSessionFactory());
@@ -435,7 +464,6 @@
private void doProxy(HttpServletRequest request, String method, HttpServletResponse response, String[] pathElements) throws IOException {
try {
- System.out.println("***FART1");
AccountRecord authedAccount = AuthServlet.getAuthedAccountRecord(request, getSessionFactory());
if (authedAccount == null) {
response.setStatus(HttpServletResponse.SC_FORBIDDEN);
@@ -453,7 +481,6 @@
return;
}
- System.out.println("***FART2");
SimRecord simRecord = SpacePersistTasks.findOrAssignSim(spaceRecord, getSessionFactory());
if (simRecord == null) {
System.err.println("Could not assign a sim to space " + spaceRecord.getSpaceID());
@@ -462,21 +489,13 @@
}
String proxyURI = simRecord.getSimURI().toString();
- System.out.println("***FART3:"+proxyURI);
for (int i = 0; i < pathElements.length; i++) {
proxyURI += pathElements[i] + "/";
}
- System.out.print("***FART4:");
- for (int i=0; i< pathElements.length;++i) {
- System.out.print(pathElements[i]+"/");
- }
- System.out.println("");
proxy(new URI(proxyURI), method, request, response);
- System.out.println("***FART5");
} catch (PersistException e) {
- System.out.println("***FART6");
e.printStackTrace();
response.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
return;
Modified: maven/trunk/ogoglio-server/src/main/java/com/ogoglio/xml/server/DocumentFactory.java
===================================================================
--- maven/trunk/ogoglio-server/src/main/java/com/ogoglio/xml/server/DocumentFactory.java 2007-08-27 23:52:59 UTC (rev 275)
+++ maven/trunk/ogoglio-server/src/main/java/com/ogoglio/xml/server/DocumentFactory.java 2007-08-27 23:53:13 UTC (rev 276)
@@ -6,6 +6,7 @@
import com.ogoglio.persist.BodyRecord;
import com.ogoglio.persist.PossessionRecord;
+import com.ogoglio.persist.ServiceStateRecord;
import com.ogoglio.persist.SimRecord;
import com.ogoglio.persist.SpaceMemberRecord;
import com.ogoglio.persist.SpaceRecord;
@@ -13,6 +14,7 @@
import com.ogoglio.persist.TemplateSupportFileRecord;
import com.ogoglio.xml.BodyDocument;
import com.ogoglio.xml.PossessionDocument;
+import com.ogoglio.xml.ServiceStateDocument;
import com.ogoglio.xml.SimDocument;
import com.ogoglio.xml.SpaceDocument;
import com.ogoglio.xml.SpaceMemberDocument;
@@ -20,48 +22,57 @@
import com.ogoglio.xml.TemplateSupportFileDocument;
public class DocumentFactory {
- public static BodyDocument documentFromRecord(BodyRecord record) {
+ public static BodyDocument documentFromRecord(BodyRecord record) {
return new BodyDocument(record.getBodyID(), record.getOwnerUsername(), record.getDisplayName(), record.getHairIndex(), record.getEyesIndex(), record.getNoseIndex(), record.getMouthIndex(), record.getFaceIndex());
- }
- public static PossessionDocument documentFromRecord(PossessionRecord record) {
- return new PossessionDocument(record.getPossessionID(), record.getOwnerUsername(), record.getTemplateID(), record.getSpaceID(), record.getThingID());
- }
- public static SimDocument documentFromRecord(SimRecord record) {
- return new SimDocument(record.getSimID(), record.getSimURI(), record.getDisplayName(), record.isActive());
- }
-
- public static SpaceDocument documentFromRecord(SpaceRecord requestedRecord) {
- return new SpaceDocument (requestedRecor...
[truncated message content] |
|
From: <tre...@us...> - 2007-08-27 23:52:57
|
Revision: 275
http://ogoglio.svn.sourceforge.net/ogoglio/?rev=275&view=rev
Author: trevorolio
Date: 2007-08-27 16:52:59 -0700 (Mon, 27 Aug 2007)
Log Message:
-----------
Added ServiceState docs and API. Added test cube and cylindar objs. Added fetal mail service. Added abstract remote servlet for apps in the same container which use ogoglio on the back end. Added some email validation code.
Modified Paths:
--------------
maven/trunk/ogoglio-integration-test/src/test/java/com/ogoglio/client/test/ClientTest.java
Added Paths:
-----------
maven/trunk/ogoglio-integration-test/src/test/resources/sample-art3d/TestCube.obj
maven/trunk/ogoglio-integration-test/src/test/resources/sample-art3d/TestCylinder.obj
Modified: maven/trunk/ogoglio-integration-test/src/test/java/com/ogoglio/client/test/ClientTest.java
===================================================================
--- maven/trunk/ogoglio-integration-test/src/test/java/com/ogoglio/client/test/ClientTest.java 2007-08-27 23:52:35 UTC (rev 274)
+++ maven/trunk/ogoglio-integration-test/src/test/java/com/ogoglio/client/test/ClientTest.java 2007-08-27 23:52:59 UTC (rev 275)
@@ -49,6 +49,7 @@
import com.ogoglio.xml.DoorDocument;
import com.ogoglio.xml.PageDocument;
import com.ogoglio.xml.PossessionDocument;
+import com.ogoglio.xml.ServiceStateDocument;
import com.ogoglio.xml.ShapeDocument;
import com.ogoglio.xml.SpaceDocument;
import com.ogoglio.xml.SpaceMemberDocument;
@@ -78,7 +79,6 @@
WebAPIDescriptor descriptor1 = null;
-
public void setUp() {
try {
serviceURI1 = new URI("http://127.0.0.1:8080/og/"); //best choice: 127.0.0.1 for tests
@@ -97,21 +97,14 @@
public void testWebAdmin() {
try {
- WebAPIAuthenticator adminAuthenticator =
- new WebAPIAuthenticatorFactory().authenticate(wire1, descriptor1,
- //"library","fart98121");
- WebConstants.getBootstrapUsername(), WebConstants.getBootstrapUserPW());
+ WebAPIAuthenticator adminAuthenticator = new WebAPIAuthenticatorFactory().authenticate(wire1, descriptor1, WebConstants.getBootstrapUsername(), WebConstants.getBootstrapUserPW());
assertNotNull("got null auth cookie", adminAuthenticator.getAuthCookie());
WebAPIClient adminWebClient = new WebAPIClient(descriptor1, adminAuthenticator, wire1);
- try {
- adminWebClient.createAccount(USERNAME1, AccountDocument.ACCOUNT_LEVEL_ADVANCED, "Susan", "Examplar", "http://example.com/susan/", "su...@ex...", PASSWORD1);
- adminWebClient.createAccount(USERNAME2, AccountDocument.ACCOUNT_LEVEL_ADVANCED, "Tina", "Examplar", "http://example.com/tina/", "ti...@ex...", PASSWORD1);
- } catch (IOException e) {
- //may already exist
- }
+ adminWebClient.createAccount(USERNAME1, AccountDocument.ACCOUNT_LEVEL_ADVANCED, "Susan", "Examplar", "http://example.com/susan/", "su...@ex...", PASSWORD1);
+ adminWebClient.createAccount(USERNAME2, AccountDocument.ACCOUNT_LEVEL_ADVANCED, "Tina", "Examplar", "http://example.com/tina/", "ti...@ex...", PASSWORD1);
- WebAPIAuthenticator basicAuthenticator = new WebAPIAuthenticator(wire1, descriptor1, USERNAME1, PASSWORD1);
+ WebAPIAuthenticator basicAuthenticator = new WebAPIAuthenticatorFactory().authenticate(wire1, descriptor1, USERNAME1, PASSWORD1);
assertNotNull("got null auth cookie", basicAuthenticator.getAuthCookie());
WebAPIClient basicWebClient = new WebAPIClient(descriptor1, basicAuthenticator, wire1);
try {
@@ -124,6 +117,27 @@
//this should happen, because basic accounts can't create new accounts
}
+ WebAPIGuestAuthenticator guestAuthenticator = new WebAPIAuthenticatorFactory().authenticate(descriptor1, WebConstants.GUEST_COOKIE_PREFIX + "Test_Suite_Guest1");
+ WebAPIClient guestWebClient = new WebAPIClient(descriptor1, guestAuthenticator, wire1);
+
+ ServiceStateDocument serviceStateDoc = adminWebClient.setRegistrationState(ServiceStateDocument.REGISTRATION_STATE_CLOSED);
+ assertEquals(ServiceStateDocument.REGISTRATION_STATE_CLOSED, serviceStateDoc.getRegistrationState());
+ assertNull(adminWebClient.createAccount("shouldnotexist" + System.currentTimeMillis(), AccountDocument.ACCOUNT_LEVEL_BASIC, "Test", "Sims", null, System.currentTimeMillis() + "@example.com", "1234"));
+ assertNull(basicWebClient.createAccount("shouldnotexist" + System.currentTimeMillis(), AccountDocument.ACCOUNT_LEVEL_BASIC, "Test", "Sims", null, System.currentTimeMillis() + "@example.com", "1234"));
+ assertNull(guestWebClient.createAccount("shouldnotexist" + System.currentTimeMillis(), AccountDocument.ACCOUNT_LEVEL_BASIC, "Test", "Sims", null, System.currentTimeMillis() + "@example.com", "1234"));
+
+ serviceStateDoc = adminWebClient.setRegistrationState(ServiceStateDocument.REGISTRATION_STATE_OPEN);
+ assertEquals(ServiceStateDocument.REGISTRATION_STATE_OPEN, serviceStateDoc.getRegistrationState());
+ assertNotNull(adminWebClient.createAccount("shouldexist" + System.currentTimeMillis(), AccountDocument.ACCOUNT_LEVEL_BASIC, "Test", "Sims", null, System.currentTimeMillis() + "@example.com", "1234"));
+ assertNotNull(basicWebClient.createAccount("shouldexist" + System.currentTimeMillis(), AccountDocument.ACCOUNT_LEVEL_BASIC, "Test", "Sims", null, System.currentTimeMillis() + "@example.com", "1234"));
+ assertNotNull(guestWebClient.createAccount("shouldexist" + System.currentTimeMillis(), AccountDocument.ACCOUNT_LEVEL_BASIC, "Test", "Sims", null, System.currentTimeMillis() + "@example.com", "1234"));
+
+ serviceStateDoc = adminWebClient.setRegistrationState(ServiceStateDocument.REGISTRATION_STATE_ADMIN_ONLY);
+ assertEquals(ServiceStateDocument.REGISTRATION_STATE_ADMIN_ONLY, serviceStateDoc.getRegistrationState());
+ assertNotNull(adminWebClient.createAccount("shouldexist" + System.currentTimeMillis(), AccountDocument.ACCOUNT_LEVEL_BASIC, "Test", "Sims", null, System.currentTimeMillis() + "@example.com", "1234"));
+ assertNull(basicWebClient.createAccount("shouldnotexist" + System.currentTimeMillis(), AccountDocument.ACCOUNT_LEVEL_BASIC, "Test", "Sims", null, System.currentTimeMillis() + "@example.com", "1234"));
+ assertNull(guestWebClient.createAccount("shouldnotexist" + System.currentTimeMillis(), AccountDocument.ACCOUNT_LEVEL_BASIC, "Test", "Sims", null, System.currentTimeMillis() + "@example.com", "1234"));
+
String username = "testuser" + Math.abs(new Random().nextLong());
adminWebClient.createAccount(username, AccountDocument.ACCOUNT_LEVEL_BASIC, "Test", "Sims", null, username + "@example.com", "1234");
@@ -141,8 +155,8 @@
assertEquals(AccountDocument.ACCOUNT_LEVEL_ADMIN, accountDoc.getAccountLevel());
accountDoc.setFrozenUntil(new Date(1000));
accountDoc.setAccountLevel(AccountDocument.ACCOUNT_LEVEL_BASIC);
- accountDoc=adminWebClient.updateAccount(accountDoc);
- AccountDocument ac2= adminWebClient.getAccountDocument(username);
+ accountDoc = adminWebClient.updateAccount(accountDoc);
+ AccountDocument ac2 = adminWebClient.getAccountDocument(username);
assertNull(accountDoc.getFrozenUntil());
assertNull(ac2.getFrozenUntil());
assertEquals(AccountDocument.ACCOUNT_LEVEL_BASIC, accountDoc.getAccountLevel());
@@ -170,31 +184,30 @@
checkNoConnectionToSpaceWithoutAuth(spaceDocument.getSpaceID());
checkAuthDoc(auth1, auth2);
-
+
spaceDocument = checkSpaceSeaLevel(webClient1, spaceDocument);
-
+
checkSettings(spaceDocument.getSpaceID(), webClient1);
-
+
checkBody(webClient1, auth1);
checkSpaceMembership(spaceDocument.getSpaceID(), webClient1);
checkSpaceAuthWithMembership(auth2, webClient2, webClient1, spaceDocument);
-
+
TemplateDocument newTemplateDoc = checkTemplateScriptAPI(webClient1);
ThingDocument[] thingDocs = checkTemplateGeomMaterialsAndPossessions(webClient1, newTemplateDoc, spaceDocument);
-
-
+
//IES CHECK: after messing around above, verify we are are ok
thingDocs = webClient1.getThingDocuments(spaceDocument.getSpaceID());
assertEquals(1, thingDocs.length);
checkPageManipulation(webClient1, thingDocs[0], spaceDocument);
-
+
//figure out the last template added
TemplateDocument[] templateDocs = webClient1.getTemplateDocuments(USERNAME1);
long lastTemplateID = templateDocs[templateDocs.length - 1].getTemplateID();
-
+
checkDoors(webClient1, spaceDocument, lastTemplateID);
spaceClient1 = checkConnectedUsersToSpace(auth1, webClient1, spaceDocument);
@@ -207,7 +220,7 @@
guestSpaceClient1 = checkGuestCookieOperation(spaceDocument.getSpaceID(), webClient1, WebConstants.GUEST_COOKIE_PREFIX + "Test_Suite_Guest");
checkDeletingSpaceDestroysThings(spaceDocument.getSpaceID(), webClient1, USERNAME1);
-
+
} catch (IOException e) {
e.printStackTrace();
fail();
@@ -291,12 +304,12 @@
String key1 = "ogoglio.key.1";
String value1 = "This is a very fine value which is < 1";
Object v = webClient1.getSpaceSetting(spaceID, key1);
-
+
assertNull(v);
-
+
webClient1.putSpaceSetting(spaceID, key1, value1);
assertEquals(value1, webClient1.getSpaceSetting(spaceID, key1));
-
+
String key2 = "ogoglio.key.2";
String value2 = "This is a very fine value & it's value is > 2";
assertNull(webClient1.getSpaceSetting(spaceID, key2));
@@ -308,7 +321,7 @@
assertNull(webClient1.getSpaceSetting(spaceID, key1));
webClient1.removeSpaceSetting(spaceID, key2);
assertNull(webClient1.getSpaceSetting(spaceID, key2));
-
+
}
private void checkBody(WebAPIClient webClient1, WebAPIAuthenticator authenticator) throws IOException {
@@ -517,10 +530,10 @@
String CUBE_GIF = "TestCube.gif";
String CUBE_MATERIAL = "TestCube.mtl";
- Class clazz=getClass();
+ Class clazz = getClass();
webClient1.uploadTemplateGeometryStream(newTemplateDoc.getOwnerUsername(), newTemplateDoc.getTemplateID(), 0, clazz.getResourceAsStream("/sample-art3d/TestCube.obj"));
webClient1.uploadTemplateResourceStream(newTemplateDoc.getOwnerUsername(), newTemplateDoc.getTemplateID(), CUBE_MATERIAL, clazz.getResourceAsStream("/sample-art3d/TestCube.mtl"));
- webClient1.uploadTemplateResourceStream(newTemplateDoc.getOwnerUsername(), newTemplateDoc.getTemplateID(), CUBE_GIF, clazz.getResourceAsStream("/sample-art3d/TestCube.gif"));
+ webClient1.uploadTemplateResourceStream(newTemplateDoc.getOwnerUsername(), newTemplateDoc.getTemplateID(), CUBE_GIF, clazz.getResourceAsStream("/sample-art3d/TestCube.gif"));
webClient1.updateTemplateScript(newTemplateDoc.getOwnerUsername(), newTemplateDoc.getTemplateID(), StreamUtils.readInput(clazz.getResourceAsStream("/sample-art3d/TestCube.js")));
baseDoc = webClient1.getTemplateDocument(newTemplateDoc.getOwnerUsername(), newTemplateDoc.getTemplateID());
@@ -552,7 +565,7 @@
}
//change the geometry to the cylinder
- webClient1.uploadTemplateGeometryStream(newTemplateDoc.getOwnerUsername(), newTemplateDoc.getTemplateID(), 0, getClass().getResourceAsStream("/sample-art3d/TestCylinder.obj"));
+ webClient1.uploadTemplateGeometryStream(newTemplateDoc.getOwnerUsername(), newTemplateDoc.getTemplateID(), 0, getClass().getResourceAsStream("/sample-art3d/TestCylinder.obj"));
afterCylDoc = webClient1.getTemplateDocument(newTemplateDoc.getOwnerUsername(), newTemplateDoc.getTemplateID());
verifyLastChangedTimes(baseDoc.getGeometryModifiedTime(0), afterCylDoc.getGeometryModifiedTime(0), 1000, true, false);
@@ -564,7 +577,6 @@
assertEquals(spaceDocument.getSpaceID(), possDoc.getSpaceID());
assertEquals(thingDocs[0].getThingID(), possDoc.getThingID());
-
webClient1.reloadThing(spaceDocument.getSpaceID(), thingDocs[0].getThingID());
try {
@@ -572,7 +584,7 @@
} catch (Exception e) {
}
-
+
//we done reload better check again
thingDocs = webClient1.getThingDocuments(spaceDocument.getSpaceID());
@@ -711,7 +723,7 @@
public void receivedBrowserMessage(long sourceThingID, String message) {
}
- public void receivedContextMenuRequest(Thing thing,String shapeName, int x, int y, long nonce) {
+ public void receivedContextMenuRequest(Thing thing, String shapeName, int x, int y, long nonce) {
}
public void receivedContextMenuData(long nonce, String errorIfAny, Vector contextMenu) {
@@ -854,28 +866,26 @@
public void userAnimationStarted(User user, long animationID) {
}
- public void shapeMotionStarted(com.ogoglio.client.model.Shape shape,
- SplinePath path) {
- // TODO Auto-generated method stub
-
- }
+ public void shapeMotionStarted(com.ogoglio.client.model.Shape shape, SplinePath path) {
+ // TODO Auto-generated method stub
- public void shapeMotionStopped(com.ogoglio.client.model.Shape shape,
- Transform3D position) {
- // TODO Auto-generated method stub
-
- }
+ }
- public void templateAdded(com.ogoglio.client.model.Template template) {
- // TODO Auto-generated method stub
-
- }
+ public void shapeMotionStopped(com.ogoglio.client.model.Shape shape, Transform3D position) {
+ // TODO Auto-generated method stub
- public void templateRemoved(com.ogoglio.client.model.Template template) {
- // TODO Auto-generated method stub
-
- }
+ }
+ public void templateAdded(com.ogoglio.client.model.Template template) {
+ // TODO Auto-generated method stub
+
+ }
+
+ public void templateRemoved(com.ogoglio.client.model.Template template) {
+ // TODO Auto-generated method stub
+
+ }
+
}
}
Added: maven/trunk/ogoglio-integration-test/src/test/resources/sample-art3d/TestCube.obj
===================================================================
--- maven/trunk/ogoglio-integration-test/src/test/resources/sample-art3d/TestCube.obj (rev 0)
+++ maven/trunk/ogoglio-integration-test/src/test/resources/sample-art3d/TestCube.obj 2007-08-27 23:52:59 UTC (rev 275)
@@ -0,0 +1,44 @@
+# Blender3D v243 OBJ File: TestCube.blend
+# www.blender3d.org
+mtllib TestCube.mtl
+o Cube
+v 1.000000 2.000000 -1.000000
+v 1.000000 0.000000 -1.000000
+v -1.000000 0.000000 -1.000000
+v -1.000000 2.000000 -1.000000
+v 1.000000 2.000000 1.000000
+v 0.999999 -0.000001 1.000000
+v -1.000000 0.000000 1.000000
+v -1.000000 2.000000 1.000000
+vt 0.499999 0.249999 0.0
+vt 0.499999 0.499999 0.0
+vt 0.250000 0.499999 0.0
+vt 0.250000 0.249999 0.0
+vt 0.500000 0.999999 0.0
+vt 0.249999 0.999999 0.0
+vt 0.249999 0.749998 0.0
+vt 0.500000 0.749998 0.0
+vt 0.749999 0.499998 0.0
+vt 0.749999 0.749998 0.0
+vt 0.500000 0.749998 0.0
+vt 0.499999 0.499999 0.0
+vt 0.499999 0.499999 0.0
+vt 0.500000 0.749998 0.0
+vt 0.249999 0.749998 0.0
+vt 0.250000 0.499999 0.0
+vt 0.250000 0.499999 0.0
+vt 0.249999 0.749998 0.0
+vt 0.000000 0.749998 0.0
+vt 0.000000 0.499999 0.0
+vt 0.499999 0.000000 0.0
+vt 0.499999 0.249999 0.0
+vt 0.250000 0.249999 0.0
+vt 0.249999 0.000000 0.0
+usemtl Material_Numbers.gif
+s 1
+f 1/1 2/2 3/3 4/4
+f 5/5 8/6 7/7 6/8
+f 1/9 5/10 6/11 2/12
+f 2/13 6/14 7/15 3/16
+f 3/17 7/18 8/19 4/20
+f 5/21 1/22 4/23 8/24
Added: maven/trunk/ogoglio-integration-test/src/test/resources/sample-art3d/TestCylinder.obj
===================================================================
--- maven/trunk/ogoglio-integration-test/src/test/resources/sample-art3d/TestCylinder.obj (rev 0)
+++ maven/trunk/ogoglio-integration-test/src/test/resources/sample-art3d/TestCylinder.obj 2007-08-27 23:52:59 UTC (rev 275)
@@ -0,0 +1,164 @@
+o Cylinder
+v 0.707107 -1.000000 -0.707107
+v 0.831470 -1.000000 -0.555571
+v 0.923880 -1.000001 -0.382684
+v 0.980785 -1.000001 -0.195091
+v 1.000000 -1.000001 -0.000001
+v 0.980785 -1.000001 0.195090
+v 0.923880 -1.000001 0.382683
+v 0.831470 -1.000001 0.555570
+v 0.707107 -1.000001 0.707106
+v 0.555570 -1.000001 0.831469
+v 0.382683 -1.000001 0.923879
+v 0.195090 -1.000001 0.980785
+v -0.000000 -1.000001 0.999999
+v -0.195091 -1.000001 0.980785
+v -0.382684 -1.000001 0.923879
+v -0.555571 -1.000001 0.831469
+v -0.707107 -1.000001 0.707106
+v -0.831470 -1.000001 0.555569
+v -0.923880 -1.000001 0.382682
+v -0.980785 -1.000001 0.195089
+v -1.000000 -1.000001 -0.000002
+v -0.980785 -1.000001 -0.195092
+v -0.923879 -1.000001 -0.382685
+v -0.831469 -1.000000 -0.555572
+v -0.707106 -1.000000 -0.707108
+v -0.555569 -1.000000 -0.831471
+v -0.382682 -1.000000 -0.923881
+v -0.195089 -1.000000 -0.980786
+v 0.000002 -1.000000 -1.000001
+v 0.195092 -1.000000 -0.980786
+v 0.382685 -1.000000 -0.923880
+v 0.555572 -1.000000 -0.831469
+v 0.707108 0.999999 -0.707106
+v 0.831471 0.999999 -0.555569
+v 0.923880 0.999999 -0.382682
+v 0.980786 0.999999 -0.195089
+v 1.000000 0.999999 0.000002
+v 0.980785 0.999999 0.195092
+v 0.923879 0.999999 0.382684
+v 0.831469 0.999999 0.555571
+v 0.707106 0.999999 0.707107
+v 0.555570 0.999999 0.831469
+v 0.382684 0.999999 0.923879
+v 0.195091 0.999999 0.980785
+v 0.000001 0.999999 0.999999
+v -0.195089 0.999999 0.980785
+v -0.382682 0.999999 0.923880
+v -0.555568 0.999999 0.831470
+v -0.707105 0.999999 0.707108
+v -0.831468 0.999999 0.555572
+v -0.923878 0.999999 0.382686
+v -0.980785 0.999999 0.195093
+v -1.000000 0.999999 0.000004
+v -0.980786 0.999999 -0.195086
+v -0.923881 0.999999 -0.382679
+v -0.831473 0.999999 -0.555566
+v -0.707111 0.999999 -0.707103
+v -0.555575 1.000000 -0.831467
+v -0.382689 1.000000 -0.923878
+v -0.195097 1.000000 -0.980784
+v -0.000007 1.000000 -1.000000
+v 0.195083 1.000000 -0.980787
+v 0.382676 1.000000 -0.923883
+v 0.555563 1.000000 -0.831475
+v 0.000000 -1.000001 -0.000001
+v 0.000000 0.999999 -0.000001
+s 1
+f 65 1 2
+f 66 34 33
+f 65 2 3
+f 66 35 34
+f 65 3 4
+f 66 36 35
+f 65 4 5
+f 66 37 36
+f 65 5 6
+f 66 38 37
+f 65 6 7
+f 66 39 38
+f 65 7 8
+f 66 40 39
+f 65 8 9
+f 66 41 40
+f 65 9 10
+f 66 42 41
+f 65 10 11
+f 66 43 42
+f 65 11 12
+f 66 44 43
+f 65 12 13
+f 66 45 44
+f 65 13 14
+f 66 46 45
+f 65 14 15
+f 66 47 46
+f 65 15 16
+f 66 48 47
+f 65 16 17
+f 66 49 48
+f 65 17 18
+f 66 50 49
+f 65 18 19
+f 66 51 50
+f 65 19 20
+f 66 52 51
+f 65 20 21
+f 66 53 52
+f 65 21 22
+f 66 54 53
+f 65 22 23
+f 66 55 54
+f 65 23 24
+f 66 56 55
+f 65 24 25
+f 66 57 56
+f 65 25 26
+f 66 58 57
+f 65 26 27
+f 66 59 58
+f 65 27 28
+f 66 60 59
+f 65 28 29
+f 66 61 60
+f 65 29 30
+f 66 62 61
+f 65 30 31
+f 66 63 62
+f 65 31 32
+f 66 64 63
+f 32 1 65
+f 66 33 64
+f 1 33 34 2
+f 2 34 35 3
+f 3 35 36 4
+f 4 36 37 5
+f 5 37 38 6
+f 6 38 39 7
+f 7 39 40 8
+f 8 40 41 9
+f 9 41 42 10
+f 10 42 43 11
+f 11 43 44 12
+f 12 44 45 13
+f 13 45 46 14
+f 14 46 47 15
+f 15 47 48 16
+f 16 48 49 17
+f 17 49 50 18
+f 18 50 51 19
+f 19 51 52 20
+f 20 52 53 21
+f 21 53 54 22
+f 22 54 55 23
+f 23 55 56 24
+f 24 56 57 25
+f 25 57 58 26
+f 26 58 59 27
+f 27 59 60 28
+f 28 60 61 29
+f 29 61 62 30
+f 30 62 63 31
+f 31 63 64 32
+f 33 1 32 64
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <tre...@us...> - 2007-08-27 23:52:35
|
Revision: 274
http://ogoglio.svn.sourceforge.net/ogoglio/?rev=274&view=rev
Author: trevorolio
Date: 2007-08-27 16:52:35 -0700 (Mon, 27 Aug 2007)
Log Message:
-----------
Added ServiceState docs and API. Added test cube and cylindar objs. Added fetal mail service. Added abstract remote servlet for apps in the same container which use ogoglio on the back end. Added some email validation code.
Modified Paths:
--------------
maven/trunk/ogoglio-common/src/main/java/com/ogoglio/client/SpaceClient.java
maven/trunk/ogoglio-common/src/main/java/com/ogoglio/client/WebAPIClient.java
maven/trunk/ogoglio-common/src/main/java/com/ogoglio/client/WebAPIDescriptor.java
maven/trunk/ogoglio-common/src/main/java/com/ogoglio/util/ArgumentUtils.java
maven/trunk/ogoglio-common/src/main/java/com/ogoglio/util/StreamUtils.java
Added Paths:
-----------
maven/trunk/ogoglio-common/src/main/java/com/ogoglio/xml/ServiceStateDocument.java
Modified: maven/trunk/ogoglio-common/src/main/java/com/ogoglio/client/SpaceClient.java
===================================================================
--- maven/trunk/ogoglio-common/src/main/java/com/ogoglio/client/SpaceClient.java 2007-08-27 21:05:45 UTC (rev 273)
+++ maven/trunk/ogoglio-common/src/main/java/com/ogoglio/client/SpaceClient.java 2007-08-27 23:52:35 UTC (rev 274)
@@ -37,6 +37,7 @@
import com.ogoglio.message.PayloadFactory;
import com.ogoglio.message.TCPChannel;
import com.ogoglio.util.ArgumentUtils;
+import com.ogoglio.viewer.render.UIConstants;
import com.ogoglio.xml.AccountDocument;
import com.ogoglio.xml.BodyDocument;
import com.ogoglio.xml.DoorDocument;
@@ -710,25 +711,25 @@
}
public InputStream getUserGeometryStream(String username, String name) throws IOException {
- return SpaceClient.class.getClassLoader().getResourceAsStream("/avatar/avatar.obj");
+ return UIConstants.getResource("avatar/avatar.obj");
}
public InputStream getUserAnimationStream(String username, long animationID) throws IOException {
System.out.println("trying to FART: "+username+","+animationID);
if (animationID == 1) {
- return SpaceClient.class.getClassLoader().getResourceAsStream("avatar/avatar.bvh");
+ return UIConstants.getResource("avatar/avatar.bvh");
} else if (animationID == 2) {
- return SpaceClient.class.getClassLoader().getResourceAsStream("avatar/avatar-walk.bvh");
+ return UIConstants.getResource("avatar/avatar-walk.bvh");
} else if (animationID == 3) {
- return SpaceClient.class.getClassLoader().getResourceAsStream("avatar/avatar-wave.bvh");
+ return UIConstants.getResource("avatar/avatar-wave.bvh");
} else if (animationID == 4) {
- return SpaceClient.class.getClassLoader().getResourceAsStream("avatar/avatar-point.bvh");
+ return UIConstants.getResource("avatar/avatar-point.bvh");
}
return null;
}
public InputStream getUserSkinMapStream(String username) throws IOException {
- return SpaceClient.class.getClassLoader().getResourceAsStream("/avatar/avatar.smap");
+ return UIConstants.getResource("avatar/avatar.smap");
}
public BodyDocument getBodyDocument(String username, long bodyID) throws IOException {
Modified: maven/trunk/ogoglio-common/src/main/java/com/ogoglio/client/WebAPIClient.java
===================================================================
--- maven/trunk/ogoglio-common/src/main/java/com/ogoglio/client/WebAPIClient.java 2007-08-27 21:05:45 UTC (rev 273)
+++ maven/trunk/ogoglio-common/src/main/java/com/ogoglio/client/WebAPIClient.java 2007-08-27 23:52:35 UTC (rev 274)
@@ -32,6 +32,7 @@
import com.ogoglio.xml.DoorDocument;
import com.ogoglio.xml.PageDocument;
import com.ogoglio.xml.PossessionDocument;
+import com.ogoglio.xml.ServiceStateDocument;
import com.ogoglio.xml.SettingDocument;
import com.ogoglio.xml.SpaceDocument;
import com.ogoglio.xml.SpaceMemberDocument;
@@ -58,8 +59,12 @@
public AccountDocument createAccount(String username, String accountLevel, String firstName, String lastName, String homepage, String email, String password) throws IOException {
AccountDocument newAccountDoc = new AccountDocument(username, accountLevel, firstName, lastName, homepage, password, email, null, AccountDocument.NO_TIME_VALUE, null, AccountDocument.NO_TIME_VALUE, -1);
- XMLElement result = wire.sendAuthenticatedXML(descriptor.getAccountURI(), newAccountDoc.toString(), "POST", authenticator.getAuthCookie());
- return new AccountDocument(result);
+ try {
+ XMLElement result = wire.sendAuthenticatedXML(descriptor.getAccountURI(), newAccountDoc.toString(), "POST", authenticator.getAuthCookie());
+ return new AccountDocument(result);
+ } catch (IOException e) {
+ return null;
+ }
}
public SpaceDocument createSpace(String spaceName) throws IOException {
@@ -479,6 +484,19 @@
return wire.sendDelete(descriptor.getBodyURI(authenticator.getUsername(), bodyID), authenticator.getAuthCookie());
}
+ public ServiceStateDocument setRegistrationState(String registrationState) throws IOException {
+ ServiceStateDocument doc = new ServiceStateDocument(registrationState);
+ XMLElement xml = wire.postAuthenticatedXML(descriptor.getServiceStateURI(), doc.toString(), authenticator.getAuthCookie());
+ if (xml == null) {
+ return null;
+ }
+ return new ServiceStateDocument(xml);
+ }
+
+ public ServiceStateDocument getRegistrationState() throws IOException {
+ return new ServiceStateDocument(wire.fetchAuthenticatedXML(descriptor.getServiceStateURI(), authenticator.getAuthCookie()));
+ }
+
public String toString() {
return "<WebAPI:" + descriptor.getServiceURI() + ">";
}
@@ -494,4 +512,5 @@
public WebAPIClientWire getWire() {
return wire;
}
+
}
Modified: maven/trunk/ogoglio-common/src/main/java/com/ogoglio/client/WebAPIDescriptor.java
===================================================================
--- maven/trunk/ogoglio-common/src/main/java/com/ogoglio/client/WebAPIDescriptor.java 2007-08-27 21:05:45 UTC (rev 273)
+++ maven/trunk/ogoglio-common/src/main/java/com/ogoglio/client/WebAPIDescriptor.java 2007-08-27 23:52:35 UTC (rev 274)
@@ -155,4 +155,8 @@
return serviceURI;
}
+ public URI getServiceStateURI() {
+ return WebAPIUtil.appendToURI(getSpacesURI(), "state/");
+ }
+
}
Modified: maven/trunk/ogoglio-common/src/main/java/com/ogoglio/util/ArgumentUtils.java
===================================================================
--- maven/trunk/ogoglio-common/src/main/java/com/ogoglio/util/ArgumentUtils.java 2007-08-27 21:05:45 UTC (rev 273)
+++ maven/trunk/ogoglio-common/src/main/java/com/ogoglio/util/ArgumentUtils.java 2007-08-27 23:52:35 UTC (rev 274)
@@ -61,7 +61,7 @@
public static void assertReadableFile(String path) {
File file = new File(path);
- if(!file.exists() || !file.canRead() || !file.isFile()) {
+ if (!file.exists() || !file.canRead() || !file.isFile()) {
throw new IllegalArgumentException("No readable file at " + path);
}
}
@@ -72,33 +72,72 @@
}
if (file.exists()) {
- if(!file.isDirectory()) {
+ if (!file.isDirectory()) {
throw new IllegalArgumentException("Expected a directory: " + file);
}
if (!file.canRead()) {
throw new IllegalArgumentException("Can't read this directory: " + file);
}
return;
- } else if(createIfPossible && file.mkdirs()){
+ } else if (createIfPossible && file.mkdirs()) {
return;
}
throw new IllegalArgumentException("Can't read this directory: " + file);
}
public static void assertNoPaths(String name) {
- if(name == null || name.trim().length() == 0) {
+ if (name == null || name.trim().length() == 0) {
return;
}
- if(name.indexOf("..") != -1) {
+ if (name.indexOf("..") != -1) {
throw new IllegalArgumentException("Bad name: " + name);
}
}
public static void assertBoringDouble(double value) {
- if(Double.isInfinite(value) || Double.isInfinite(value)) {
+ if (Double.isInfinite(value) || Double.isInfinite(value)) {
throw new IllegalArgumentException("Bad double: " + value);
}
}
+ public static void assertIsEmail(String email) {
+ if (email == null || email.trim().length() == 0) {
+ throw new IllegalArgumentException("Bad email: " + email);
+ }
+ if (email.indexOf("@") == -1 || email.indexOf("@") == 0) {
+ throw new IllegalArgumentException("Bad email: " + email);
+ }
+ if (email.indexOf(".", email.indexOf("@")) == -1 && email.indexOf("localhost") != email.indexOf("@") + 1) {
+ throw new IllegalArgumentException("Bad email: " + email);
+ }
+ }
+ public static void assertIsCreditCardNumber(String ccNumberString) {
+ if (ccNumberString == null || ccNumberString.length() < 13 || ccNumberString.length() > 16) {
+ throw new IllegalArgumentException("Bad CC number length: " + ccNumberString);
+ }
+
+ // Check Luhn (mod 10)
+ int[] digits = new int[ccNumberString.length()];
+ for (int i = 0; i < ccNumberString.length(); i++) {
+ digits[i] = Integer.parseInt(ccNumberString.charAt(i) + "");
+ }
+
+ int sum = 0;
+ boolean alt = false;
+ for (int i = digits.length - 1; i >= 0; i--) {
+ if (alt) {
+ digits[i] *= 2;
+ if (digits[i] > 9) {
+ digits[i] -= 9;
+ }
+ }
+ sum += digits[i];
+ alt = !alt;
+ }
+ if(sum % 10 != 0) {
+ throw new IllegalArgumentException("Bad CC number mod: " + ccNumberString);
+ }
+ }
+
}
Modified: maven/trunk/ogoglio-common/src/main/java/com/ogoglio/util/StreamUtils.java
===================================================================
--- maven/trunk/ogoglio-common/src/main/java/com/ogoglio/util/StreamUtils.java 2007-08-27 21:05:45 UTC (rev 273)
+++ maven/trunk/ogoglio-common/src/main/java/com/ogoglio/util/StreamUtils.java 2007-08-27 23:52:35 UTC (rev 274)
@@ -57,6 +57,14 @@
output.flush();
output.close();
}
+
+ public static String readResource(String resourceName) throws IOException {
+ InputStream resourceStream = StreamUtils.class.getClassLoader().getResourceAsStream(resourceName);
+ if (resourceStream == null) {
+ return null;
+ }
+ return readInput(resourceStream);
+ }
public static void copyResource(String resourceName, File destinationDir) throws IOException {
InputStream resourceStream = StreamUtils.class.getClassLoader().getResourceAsStream(resourceName);
Added: maven/trunk/ogoglio-common/src/main/java/com/ogoglio/xml/ServiceStateDocument.java
===================================================================
--- maven/trunk/ogoglio-common/src/main/java/com/ogoglio/xml/ServiceStateDocument.java (rev 0)
+++ maven/trunk/ogoglio-common/src/main/java/com/ogoglio/xml/ServiceStateDocument.java 2007-08-27 23:52:35 UTC (rev 274)
@@ -0,0 +1,48 @@
+package com.ogoglio.xml;
+
+import nanoxml.XMLElement;
+
+import com.ogoglio.util.ArgumentUtils;
+
+public class ServiceStateDocument {
+
+ public static final String REGISTRATION_STATE_CLOSED = "closed";
+
+ public static final String REGISTRATION_STATE_ADMIN_ONLY = "adminOnly";
+
+ public static final String REGISTRATION_STATE_OPEN = "open";
+
+ public static final String[] REGISTRATION_STATES = { REGISTRATION_STATE_CLOSED, REGISTRATION_STATE_ADMIN_ONLY, REGISTRATION_STATE_OPEN };
+
+ public static final String NAME = "servicestate";
+
+ public static final String REGISTRATION_STATE = "registrationstate";
+
+ private XMLElement data = null;
+
+ public ServiceStateDocument(XMLElement data) {
+ ArgumentUtils.assertNotNull(data);
+ if (!NAME.equals(data.getName())) {
+ throw new IllegalArgumentException("data is not named " + NAME + ": " + data);
+ }
+ this.data = data;
+ }
+
+ public ServiceStateDocument(String registrationState) {
+ data = new XMLElement(NAME);
+ data.setAttribute(REGISTRATION_STATE, registrationState);
+ }
+
+ public String getRegistrationState() {
+ return data.getStringAttribute(REGISTRATION_STATE);
+ }
+
+ public XMLElement toElement() {
+ return data;
+ }
+
+ public String toString() {
+ return toElement().toString();
+ }
+
+}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <tre...@us...> - 2007-08-27 21:05:42
|
Revision: 273
http://ogoglio.svn.sourceforge.net/ogoglio/?rev=273&view=rev
Author: trevorolio
Date: 2007-08-27 14:05:45 -0700 (Mon, 27 Aug 2007)
Log Message:
-----------
Made body editor applet work, including refs to avatar resources.
Modified Paths:
--------------
maven/trunk/ogoglio-body-editor-applet/.classpath
maven/trunk/ogoglio-body-editor-applet/src/main/java/com/ogoglio/bodyeditor/BodyEditorApplet.java
Modified: maven/trunk/ogoglio-body-editor-applet/.classpath
===================================================================
--- maven/trunk/ogoglio-body-editor-applet/.classpath 2007-08-27 21:05:32 UTC (rev 272)
+++ maven/trunk/ogoglio-body-editor-applet/.classpath 2007-08-27 21:05:45 UTC (rev 273)
@@ -1,6 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src/main/java"/>
+ <classpathentry kind="src" path="src/test/java"/>
+ <classpathentry excluding="**" output="src/main/resources" kind="src" path="src/main/resources"/>
+ <classpathentry excluding="**" output="src/test/resources" kind="src" path="src/test/resources"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>
<classpathentry kind="output" path="target/classes"/>
Modified: maven/trunk/ogoglio-body-editor-applet/src/main/java/com/ogoglio/bodyeditor/BodyEditorApplet.java
===================================================================
--- maven/trunk/ogoglio-body-editor-applet/src/main/java/com/ogoglio/bodyeditor/BodyEditorApplet.java 2007-08-27 21:05:32 UTC (rev 272)
+++ maven/trunk/ogoglio-body-editor-applet/src/main/java/com/ogoglio/bodyeditor/BodyEditorApplet.java 2007-08-27 21:05:45 UTC (rev 273)
@@ -68,13 +68,13 @@
public class BodyEditorApplet extends Applet {
- public static final ImageIcon LEFT_ARROW = UIConstants.loadIconFromResource("com/ogoglio/viewer/applet/resources/LeftArrow.gif");
+ public static final ImageIcon LEFT_ARROW = UIConstants.loadIconFromResource("avatar/LeftArrow.gif");
- public static final ImageIcon LEFT_ARROW_DISABLED = UIConstants.loadIconFromResource("com/ogoglio/viewer/applet/resources/LeftArrowDisabled.gif");
+ public static final ImageIcon LEFT_ARROW_DISABLED = UIConstants.loadIconFromResource("avatar/LeftArrowDisabled.gif");
- public static final ImageIcon RIGHT_ARROW = UIConstants.loadIconFromResource("com/ogoglio/viewer/applet/resources/RightArrow.gif");
+ public static final ImageIcon RIGHT_ARROW = UIConstants.loadIconFromResource("avatar/RightArrow.gif");
- public static final ImageIcon RIGHT_ARROW_DISABLED = UIConstants.loadIconFromResource("com/ogoglio/viewer/applet/resources/RightArrowDisabled.gif");
+ public static final ImageIcon RIGHT_ARROW_DISABLED = UIConstants.loadIconFromResource("avatar/RightArrowDisabled.gif");
private RowModel hairRowModel = null;
@@ -118,22 +118,22 @@
private class SpacelessContext implements Context {
public InputStream getUserGeometryStream(String username, String name) throws IOException {
- return BodyEditorApplet.class.getClassLoader().getResourceAsStream("/avatar/avatar.obj");
+ return UIConstants.getResource("avatar/avatar.obj");
}
public InputStream getUserAnimationStream(String username, long animationID) throws IOException {
if (animationID == 1) {
- return BodyEditorApplet.class.getClassLoader().getResourceAsStream("/avatar/avatar.bvh");
+ return UIConstants.getResource("avatar/avatar.bvh");
} else if (animationID == 2) {
- return BodyEditorApplet.class.getClassLoader().getResourceAsStream("/avatar/avatar-walk.bvh");
+ return UIConstants.getResource("avatar/avatar-walk.bvh");
} else if (animationID == 3) {
- return BodyEditorApplet.class.getClassLoader().getResourceAsStream("/avatar/avatar-wave.bvh");
+ return UIConstants.getResource("avatar/avatar-wave.bvh");
}
return null;
}
public InputStream getUserSkinMapStream(String username) throws IOException {
- return BodyEditorApplet.class.getClassLoader().getResourceAsStream("/avatar/avatar.smap");
+ return UIConstants.getResource("avatar/avatar.smap");
}
public InputStream getPageContentStream(long thingID, long pageID) {
@@ -213,8 +213,6 @@
}
public void setupUniverse() {
-
- UIConstants.loadIconFromResource("fart");
addDirectionalLight(UIConstants.WHITE, new Vector3f(0, 0, -1));
addDirectionalLight(UIConstants.DARK_GRAY, new Vector3f(0.3f, -0.8f, 0.3f));
addDirectionalLight(UIConstants.DARK_GRAY, new Vector3f(-0.4f, 0.8f, -0.2f));
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <tre...@us...> - 2007-08-27 21:05:33
|
Revision: 272
http://ogoglio.svn.sourceforge.net/ogoglio/?rev=272&view=rev
Author: trevorolio
Date: 2007-08-27 14:05:32 -0700 (Mon, 27 Aug 2007)
Log Message:
-----------
Made body editor applet work, including refs to avatar resources.
Modified Paths:
--------------
maven/trunk/ogoglio-server/pom.xml
maven/trunk/ogoglio-server/src/main/webapp/body.html
Modified: maven/trunk/ogoglio-server/pom.xml
===================================================================
--- maven/trunk/ogoglio-server/pom.xml 2007-08-27 21:05:20 UTC (rev 271)
+++ maven/trunk/ogoglio-server/pom.xml 2007-08-27 21:05:32 UTC (rev 272)
@@ -165,6 +165,11 @@
<artifactId>commons-fileupload</artifactId>
<version>1.2</version>
</dependency>
+ <dependency>
+ <groupId>commons-io</groupId>
+ <artifactId>commons-io</artifactId>
+ <version>1.3</version>
+ </dependency>
<!-- need MYSQL for tests -->
<dependency>
Modified: maven/trunk/ogoglio-server/src/main/webapp/body.html
===================================================================
--- maven/trunk/ogoglio-server/src/main/webapp/body.html 2007-08-27 21:05:20 UTC (rev 271)
+++ maven/trunk/ogoglio-server/src/main/webapp/body.html 2007-08-27 21:05:32 UTC (rev 272)
@@ -74,8 +74,8 @@
appletDiv.innerHTML = "No cookie. Please sign in or register as a guest.";
return;
}
-
- var html = "<applet id='viewer' code='com.ogoglio.viewer.applet.BodyEditorApplet' archive='/og/ogoglio-body-editor-applet-0.0.1-common.jar' width='500' height='500' mayscript='true'>";
+ var serviceURI = getServiceURI();
+ var html = "<applet id='viewer' codebase='" + serviceURI + "' code='com.ogoglio.bodyeditor.BodyEditorApplet' archive='ogoglio-common.jar,ogoglio-body-editor-applet.jar' width='500' height='500' mayscript='true'>";
html += "<param name='loginCookie' value='" + loginCookie + "' />";
html += "<param name='serviceURI' value='" + getServiceURI() + "' />";
html += "<param name='image' value='" + appPath + "/icons/32x32/face-monkey.png' />";
@@ -124,4 +124,4 @@
</div>
<!-- Copyright 2007 Transmutable (http://transmutable.com/) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0. Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.-->
</body>
-</html>
\ No newline at end of file
+</html>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <tre...@us...> - 2007-08-27 21:05:19
|
Revision: 271
http://ogoglio.svn.sourceforge.net/ogoglio/?rev=271&view=rev
Author: trevorolio
Date: 2007-08-27 14:05:20 -0700 (Mon, 27 Aug 2007)
Log Message:
-----------
Made body editor applet work, including refs to avatar resources.
Modified Paths:
--------------
maven/trunk/ogoglio-common/pom.xml
maven/trunk/ogoglio-common/src/main/java/com/ogoglio/util/BodyConstants.java
maven/trunk/ogoglio-common/src/main/java/com/ogoglio/viewer/render/UIConstants.java
Added Paths:
-----------
maven/trunk/ogoglio-common/src/main/resources/avatar/avatar.obj
maven/trunk/ogoglio-common/src/main/resources/avatar/loading.obj
Modified: maven/trunk/ogoglio-common/pom.xml
===================================================================
--- maven/trunk/ogoglio-common/pom.xml 2007-08-27 17:39:06 UTC (rev 270)
+++ maven/trunk/ogoglio-common/pom.xml 2007-08-27 21:05:20 UTC (rev 271)
@@ -32,19 +32,19 @@
<dependency>
<groupId>java3d</groupId>
<artifactId>j3d-core</artifactId>
- <version>1.5.1</version>
+ <version>1.3</version>
<scope>supplied</scope>
</dependency>
<dependency>
<groupId>java3d</groupId>
<artifactId>j3d-core-utils</artifactId>
- <version>1.5.1</version>
+ <version>1.3</version>
<scope>supplied</scope>
</dependency>
<dependency>
<groupId>java3d</groupId>
<artifactId>vecmath</artifactId>
- <version>1.5.1</version>
+ <version>1.3</version>
<scope>supplied</scope>
</dependency>
Modified: maven/trunk/ogoglio-common/src/main/java/com/ogoglio/util/BodyConstants.java
===================================================================
--- maven/trunk/ogoglio-common/src/main/java/com/ogoglio/util/BodyConstants.java 2007-08-27 17:39:06 UTC (rev 270)
+++ maven/trunk/ogoglio-common/src/main/java/com/ogoglio/util/BodyConstants.java 2007-08-27 21:05:20 UTC (rev 271)
@@ -4,16 +4,16 @@
public class BodyConstants {
- public static Image BASE_SKIN_TEXTURE1 = UIConstants.loadImageFromResource("com/ogoglio/viewer/applet/resources/avatar1.jpg");
+ public static final String TEXTURE_RESOURCE_PATH = "avatar/";
+ public static Image BASE_SKIN_TEXTURE1 = UIConstants.loadImageFromResource(TEXTURE_RESOURCE_PATH + "avatar1.jpg");
+
public static final int BASE_SKIN_TEXTURE_WIDTH = BASE_SKIN_TEXTURE1.getWidth(null);
public static final int BASE_SKIN_TEXTURE_HEIGHT = BASE_SKIN_TEXTURE1.getHeight(null);
public static final Image[] BASE_SKIN_TEXTURES = { BASE_SKIN_TEXTURE1 };
- public static final String TEXTURE_RESOURCE_PATH = "com/ogoglio/viewer/applet/resources/";
-
public static final Image EYES_1 = UIConstants.loadImageFromResource(TEXTURE_RESOURCE_PATH + "Eyes1.gif");
public static final Image EYES_2 = UIConstants.loadImageFromResource(TEXTURE_RESOURCE_PATH + "Eyes2.gif");
Modified: maven/trunk/ogoglio-common/src/main/java/com/ogoglio/viewer/render/UIConstants.java
===================================================================
--- maven/trunk/ogoglio-common/src/main/java/com/ogoglio/viewer/render/UIConstants.java 2007-08-27 17:39:06 UTC (rev 270)
+++ maven/trunk/ogoglio-common/src/main/java/com/ogoglio/viewer/render/UIConstants.java 2007-08-27 21:05:20 UTC (rev 271)
@@ -57,14 +57,9 @@
public static ImageIcon loadIconFromResource(String resourcePath) {
try {
byte[] buffer = null;
- InputStream resource = null;
+ InputStream resource = getResource(resourcePath);
- resource = UIConstants.class.getClassLoader().getResourceAsStream(resourcePath);
if (resource == null) {
- resource = UIConstants.class.getResourceAsStream(resourcePath);
- }
-
- if (resource == null) {
throw new IllegalStateException("Could not find resource: " + resourcePath);
}
@@ -89,4 +84,12 @@
}
}
+ public static InputStream getResource(String resourcePath) {
+ InputStream resource = UIConstants.class.getClassLoader().getResourceAsStream(resourcePath);
+ if (resource == null) {
+ resource = UIConstants.class.getResourceAsStream(resourcePath);
+ }
+ return resource;
+
+ }
}
Added: maven/trunk/ogoglio-common/src/main/resources/avatar/avatar.obj
===================================================================
--- maven/trunk/ogoglio-common/src/main/resources/avatar/avatar.obj (rev 0)
+++ maven/trunk/ogoglio-common/src/main/resources/avatar/avatar.obj 2007-08-27 21:05:20 UTC (rev 271)
@@ -0,0 +1,5014 @@
+# Wavefront OBJ (1.0) exported by lynx's OBJ import/export script
+
+# Meshname: lHand_lambert3SG_mik
+# Total number of Faces: 1784
+# Total number of Vertices: 894
+
+# UV Texture: 1
+
+mtllib avatar.mtl
+
+g lHand_lambert3SG_mik
+
+v 0.343355174189 1.47511989521 -0.106217229663
+v 0.283691423605 1.47009974659 -0.123079932959
+v 0.254977426164 1.5281764079 -0.123393525038
+v 0.281692352655 1.58887499782 -0.10246919614
+v 0.258296980076 1.45254660725 -0.100581150479
+v 0.235947062141 1.45095622684 -0.117817012909
+v 0.221188175461 1.45399008343 -0.0118269063457
+v 0.250385445712 1.45269630197 -0.0359525429019
+v 0.263191434542 1.46557976953 0.0245384693031
+v 0.246624602231 1.50794201904 0.0261693163131
+v 0.333633556943 1.47297649413 0.0141261518063
+v 0.276242509005 1.5756729112 0.00278851416444
+v 0.365962874302 1.47673511185 -0.0506124684577
+v 0.287224702684 1.60061281462 -0.0511701669842
+v 0.0316988889523 1.6317063225 0.0187973697828
+v 2.75899153729e-05 1.62696784627 0.0278623368879
+v 2.75899153729e-05 1.57280517729 0.0232990859265
+v 0.0479338097809 1.58185552441 0.0144208300306
+v 0.0311844249645 1.63211081723 0.0409902529506
+v 2.75899153729e-05 1.62523209486 0.0605296430782
+v 0.0215104925006 1.64245834671 0.0705538014202
+v 2.75899153729e-05 1.63798746772 0.0796173818465
+v 0.0156792763918 1.66272162261 0.075167604418
+v 2.75899153729e-05 1.66242430154 0.0797441826594
+v 0.0121505032633 1.6833318171 0.0816255420592
+v 2.75899153729e-05 1.68238986172 0.0854430566585
+v 0.00892779224581 1.68937694366 0.0776208516903
+v 2.75899153729e-05 1.68938879659 0.079846630206
+v 0.0118297105155 1.69479641333 0.0856477087666
+v 2.75899153729e-05 1.69448560031 0.0875556184329
+v 0.0201558240924 1.71538567824 0.0790199791259
+v 2.75899153729e-05 1.71126038856 0.0881919055968
+v 0.0145395419682 1.72256754152 0.094597572792
+v 2.75899153729e-05 1.71636725245 0.100730573789
+v 0.0133908300294 1.73159267695 0.0915471274126
+v 2.75899153729e-05 1.72737124077 0.103264116478
+v 0.00678246106977 1.75009878736 0.0871202952777
+v 2.75899153729e-05 1.75114410597 0.0926591449485
+v 0.0145899406375 1.81336113767 0.0852902593768
+v 2.75899153729e-05 1.81336113767 0.0852902593768
+v 2.75899153729e-05 1.78043882962 0.0885492126408
+v 0.0103507356614 1.77601865074 0.0828540037675
+v 0.0294127702897 1.87744634103 0.03267998912
+v 2.75899153729e-05 1.88097263196 0.0367307912246
+v 2.75899153729e-05 1.84822462814 0.0739688858507
+v 0.0215411401078 1.84608385035 0.071436835915
+v 0.0294127702897 1.87620614557 -0.057265214399
+v 2.75899153729e-05 1.87916218585 -0.0592382726677
+v 0.0379310936814 1.80900888215 -0.123248115337
+v 2.75899153729e-05 1.81044288346 -0.125912213446
+v 0.0372555105424 1.74680339818 -0.116905630997
+v 2.75899153729e-05 1.74674176579 -0.119887975017
+v 0.0301050811263 1.66494457321 -0.0798853452841
+v 2.75899153729e-05 1.6649421628 -0.0803379812621
+v 2.75899153729e-05 1.70091673735 -0.0944580326077
+v 0.0367345924778 1.69939265343 -0.0901844570618
+v 0.0315343099927 1.63060149266 -0.0791792104509
+v 2.75899153729e-05 1.62730876968 -0.0826675217988
+v 0.0091012687058 1.76409290229 0.0803961327997
+v 2.75899153729e-05 1.76357136119 0.0857364386186
+v 0.0262241733005 1.77474659055 0.0699758401444
+v 0.0396342187566 1.77298686711 0.0655889067946
+v 0.0488025338146 1.7865239531 0.0690474436901
+v 0.0273975747283 1.7883325277 0.0800725676313
+v 0.0469014378675 1.7649032064 0.0580954698684
+v 0.0559017062222 1.7625051037 0.0471939031893
+v 0.0385600672761 1.76004025717 0.0656578512758
+v 0.0471323774336 1.7470535352 0.061317775476
+v 0.0262784907054 1.7603345681 0.0713086383124
+v 0.0253303127535 1.74468552197 0.0709202589937
+v 0.0180991240557 1.76218017677 0.0746966438723
+v 0.0130735883464 1.74790905565 0.0770247497478
+v 0.0218343879666 1.72989901386 0.0772885515055
+v 0.0317956895245 1.72938876083 0.0678364252633
+v 0.0519853829723 1.7299916337 0.0444452554822
+v 0.0676821157904 1.76367734196 0.0320366406451
+v 0.0579379145649 1.79924542033 0.0567894881847
+v 0.0314696660648 1.81049128542 0.0776982837378
+v 0.0217744827595 1.69380112471 0.0787905033638
+v 0.0374640407073 1.70566614682 0.0653467431309
+v 0.032142641122 1.68997396285 0.0692796486705
+v 0.0455115524187 1.68667189358 0.0604917054542
+v 0.020256782783 1.6861014242 0.0757815310671
+v 0.03548251215 1.66685500248 0.0682222012718
+v 0.0187932335694 1.76793672423 0.0747484220596
+v 0.0101225761096 1.77555304686 0.082755819379
+v 0.0527566927675 1.70395191319 0.0439510246216
+v 0.0552782741402 1.68517370151 0.040364879246
+v 0.0451413370483 1.65504295645 0.0477997639437
+v 0.0479407875902 1.83867390054 0.0526543540337
+v 0.0718287649401 1.81440171784 0.0255332943303
+v 0.0778149741173 1.77181437482 0.0108564057979
+v 0.0659904969588 1.73215839965 0.0134872253984
+v 0.0635115124932 1.70486565808 0.0115977557445
+v 0.062024170484 1.68164506599 0.0127388179221
+v 0.0517531367201 1.64808985538 0.0122361633027
+v 0.0527063350974 1.64656709874 0.00152374734525
+v 0.0760398596341 1.60490049752 -0.0217727938992
+v 0.0820292429475 1.625612205 -0.0433648276692
+v 0.0594207651715 1.66425252742 -0.0245295151486
+v 0.0578565032628 1.86428316819 0.0251195643182
+v 0.0572632783765 1.86222202858 -0.0529790667454
+v 0.0686153224001 1.79975529142 -0.103134319695
+v 0.0623956078967 1.74527338334 -0.098057543584
+v 0.057438019862 1.70043118136 -0.0738327336848
+v 0.0568206292192 1.66649576895 -0.0562030095353
+v 0.0647200859948 1.62696581517 -0.0582480529516
+v 0.0799981343835 1.82339568687 -0.00458137933152
+v 0.0807125636588 1.82430716836 -0.0504491034754
+v 0.0860548093833 1.79025563382 -0.0768302904728
+v 0.0763177182228 1.74640110593 -0.0687157048594
+v 0.0675743432875 1.70444017924 -0.0427966695874
+v 0.0696239782262 1.70837774714 -0.0124262648601
+v 0.0738282485275 1.73717009491 -0.0167285885275
+v 0.0896549569309 1.74452591153 -0.0283932610632
+v 0.0901622579515 1.76236461409 -0.0245834259933
+v 0.0753513789219 1.73764879425 -0.00394294869589
+v 0.0680211928851 1.71267466127 -0.00574968058287
+v 0.0823872537643 1.71592523137 -0.013999686113
+v 0.0752380569709 1.74304445527 -0.0307382098548
+v 0.0909615689178 1.74431751736 -0.0371113333404
+v 0.0796651410498 1.70888612599 -0.0177665667149
+v 0.0833178522921 1.76196882367 -0.0358989180934
+v 0.0922718311612 1.76668926165 -0.0383930291374
+v 0.0858293875239 1.77183709754 -0.0215222754919
+v 0.0848422417605 1.7690443059 -0.0139918797774
+v 0.0922718311612 1.77736369087 -0.0215927986367
+v 0.0858895426942 1.79235887457 -0.0147793446446
+v 2.75899153729e-05 1.50243987349 0.0763933666337
+v 0.09625876836 1.51194700441 0.0568333745205
+v 2.75899153729e-05 1.58510972525 -0.121379252506
+v 0.064656307019 1.58706050374 -0.11604438338
+v 0.124488339722 1.60016694288 -0.00161886442604
+v 0.130205001257 1.6256692352 -0.0479543307522
+v 0.103154759022 1.61467283081 -0.0925441583441
+v 0.172320582436 1.51776346316 0.03839617801
+v 0.178504593198 1.59754600374 -0.00651384470123
+v 0.179250705642 1.62352555243 -0.0549261294398
+v 0.163498790467 1.6051828078 -0.0944483771826
+v 0.152823345306 1.55293295873 -0.12324035118
+v 0.0702293653442 1.48465631599 -0.139732400711
+v 2.75899153729e-05 1.48519960348 -0.145574771474
+v 0.157849822676 1.4775470554 -0.132385883892
+v 2.75899153729e-05 1.43278280747 0.099373558889
+v 0.0865465148149 1.43836294152 0.0916184045486
+v 0.179154994857 1.44550222944 0.0729943964813
+v 0.214723475839 1.36425687059 0.00888010099833
+v 0.215389113352 1.36152023659 -0.101871971332
+v 0.073390048451 1.3798662656 -0.151308517007
+v 2.75899153729e-05 1.38087331064 -0.157741152281
+v 0.159049159441 1.37430365875 -0.140305760807
+v 2.75899153729e-05 1.32302186775 0.126264030855
+v 0.0793310843805 1.33823186499 0.119766679892
+v 0.165847450192 1.37457645987 0.0791410759649
+v 0.36262558755 1.35515117114 -0.101050814947
+v 0.318808098048 1.35875826818 -0.116198647333
+v 0.274146542259 1.38550060202 -0.0960468567593
+v 0.26706085464 1.38485283288 -0.0379477713425
+v 0.300280432547 1.37688438221 -0.00314337667591
+v 0.357990121432 1.35443340881 0.0126103090787
+v 0.384815634827 1.35392891424 -0.0510746268901
+v 0.356945999925 1.269277297 -0.106558432711
+v 0.315053750966 1.272526206 -0.11374545812
+v 0.257974995704 1.27444178024 -0.094326231712
+v 0.25117290657 1.27381989963 -0.0385501975453
+v 0.296953726249 1.27088887901 0.00360642731089
+v 0.350186909755 1.26863200103 -0.00245612218975
+v 0.376914659757 1.26812912573 -0.0511580746735
+v 0.356815648734 1.21625626109 -0.100886045494
+v 0.314163469257 1.21968816735 -0.110605243281
+v 0.253162920651 1.22173528984 -0.0903774387573
+v 0.255227230679 1.22089413406 -0.0374629964882
+v 0.294737100007 1.22002757242 -0.0083057682748
+v 0.350505275612 1.21554922149 -0.00689595057564
+v 0.380233240266 1.21498996452 -0.0508866153891
+v 0.343034099737 1.13857136072 -0.0925593498371
+v 0.303665923847 1.14165474129 -0.100784540801
+v 0.247264994781 1.14351745566 -0.0876674753996
+v 0.249457391783 1.14276125482 -0.0393321281235
+v 0.285641782145 1.14011085299 -0.013181634346
+v 0.338251903886 1.13792565629 -0.0118753601358
+v 0.364692923588 1.13742808605 -0.0513118029012
+v 0.32056267587 1.05733100559 -0.0834381991135
+v 0.295548091794 1.05929698006 -0.0928732197218
+v 0.261507005129 1.06044901158 -0.0803551096969
+v 0.257463790496 1.06006907092 -0.0443595173218
+v 0.278485692186 1.05841664078 -0.0171065884874
+v 0.316532475195 1.05693729049 -0.0210389564925
+v 0.332462469989 1.05663777129 -0.0524637679174
+v 0.303779071221 1.00187254235 -0.0761127589293
+v 0.29094743537 1.00349679934 -0.0943090222387
+v 0.267339607277 1.00441336451 -0.0792557359176
+v 0.263822050752 1.00405781077 -0.0475907611549
+v 0.282115697775 1.00255027507 -0.0241360196866
+v 0.302909273271 1.00145404041 -0.0311525101888
+v 0.30804718398 1.00135852058 -0.0548365113448
+v 0.286726299826 0.950449218395 -0.100629989049
+v 0.279232799193 0.951281888549 -0.102482156437
+v 0.264863950365 0.952023681486 -0.0861725243024
+v 0.273179002077 0.951444272404 -0.0440122500119
+v 0.267080618928 0.967401650744 -0.0136952855869
+v 0.28612725569 0.966726632689 -0.0120455711491
+v 0.296284300934 0.966146233687 -0.0189022164873
+v 0.307232594839 0.948190105118 -0.0537989081656
+v 0.299507636198 0.948906506537 -0.0924513890276
+v 0.293089194321 0.902321205004 -0.105583117113
+v 0.278992390121 0.903040118963 -0.108685792801
+v 0.27067738073 0.903667579235 -0.0888512214361
+v 0.279536458219 0.919578465881 -0.0650949625342
+v 0.276864851301 0.918644992083 -0.050580962846
+v 0.292092219316 0.939852727707 -0.00329278961002
+v 0.281371468651 0.940999903671 0.00703399211442
+v 0.276570439592 0.901620881632 0.0220579442615
+v 0.28949643193 0.901024957857 0.012564168728
+v 0.296910071296 0.932494455969 -0.0167261970524
+v 0.30131534906 0.935144286087 -0.0303853776306
+v 0.306093968718 0.915634123157 -0.0683672077431
+v 0.302994953786 0.900845274579 -0.0824599919486
+v 0.301001194224 0.901242288899 -0.0924641414545
+v 0.294532516352 0.880967651149 -0.108760351904
+v 0.2788119299 0.881464040364 -0.110820690001
+v 0.270978965987 0.88188341085 -0.0925102362864
+v 0.275748528776 0.881673298886 -0.079814646404
+v 0.272178831775 0.904063386994 -0.0770079411332
+v 0.264191054661 0.902206690482 -0.00985439326463
+v 0.27191808707 0.903049223174 -0.0204842371761
+v 0.274761689846 0.876534705176 -0.025544922093
+v 0.272798232704 0.880265351801 -0.00990242677447
+v 0.297498027117 0.90087360296 -0.0146815059632
+v 0.279595433669 0.899965463457 -0.011404366819
+v 0.285680104549 0.879735179873 -0.00640139923513
+v 0.297005189576 0.874826145393 -0.0146815047116
+v 0.303133367283 0.8792806604 -0.0797280152578
+v 0.305126851753 0.873669955264 -0.0692336813228
+v 0.285034083198 0.88074939176 -0.0857172689512
+v 0.278391272216 0.876655772615 -0.0666005899462
+v 0.28577873554 0.875050056449 -0.0623573586614
+v 0.279616721542 0.875940603066 -0.053476409437
+v 0.284903943616 0.875963900812 -0.032153580074
+v 0.277738183122 0.877047128708 -0.0391539874109
+v 0.297216354274 0.879535525347 -0.0995490390109
+v 0.306699128356 0.873553682519 -0.0555307833529
+v 0.30829334882 0.874614163389 -0.041827882932
+v 0.302975274142 0.874714093926 -0.0253514761038
+v 0.26008238934 0.93765901141 -0.0110152167305
+v 0.265364151901 0.902184467175 0.0170707591002
+v 0.27159100292 0.941489572897 0.0014824978797
+v 0.271017838574 0.849026678806 -0.00121405129267
+v 0.28114646472 0.848231766063 0.00338504714388
+v 0.269796325178 0.839211298629 0.0114049921417
+v 0.259572538431 0.849737717497 0.00537057728079
+v 0.259839843017 0.849732659286 0.0176770527063
+v 0.285773297187 0.853672964793 -0.111372654251
+v 0.271854413899 0.854102848737 -0.110265112227
+v 0.290734768248 0.852132926082 -0.0999621383676
+v 0.279863457725 0.853376201266 -0.0904865595313
+v 0.267845289488 0.854449853535 -0.0974254081797
+v 0.270598196614 0.819485417377 -0.0993814883664
+v 0.259119039018 0.813469780423 -0.102944467441
+v 0.267217212587 0.822179798472 -0.109616065235
+v 0.273023532888 0.796376537822 -0.0697523708832
+v 0.265823258954 0.789862746305 -0.072722997763
+v 0.272634045221 0.796512985947 -0.0770320980056
+v 0.308953611461 0.916725965983 -0.0541753435975
+v 0.304212383127 0.917290666699 -0.036998328034
+v 0.300737296544 0.902850016878 -0.0258398107299
+v 0.2761598545 0.79530026927 -0.0540818173463
+v 0.266729749918 0.787374888257 -0.0468895471189
+v 0.263962538019 0.790518914589 -0.0563668840248
+v 0.269741920484 0.797318460552 -0.0127066094786
+v 0.261706764098 0.789559793087 -0.0174185545312
+v 0.268583593558 0.797658296265 -0.0229096370047
+v 0.265065402206 0.935006072819 -0.0272677782201
+v 0.273858584628 0.91366866558 -0.0295170345537
+v 0.287615438845 0.900129819188 -0.00541660704541
+v 0.273518317232 0.865688561322 0.0297198249549
+v 0.286686326871 0.86489075413 0.020654178843
+v 0.262754440638 0.874379768116 0.0222497086467
+v 0.257984602756 0.874470013316 0.0074939146809
+v 0.271051251648 0.873728319069 -0.00250281655189
+v 0.274991285695 0.847856771479 -0.064918588815
+v 0.285244041724 0.84679055433 -0.0623573617736
+v 0.274661916166 0.847968840299 -0.0798122584604
+v 0.28471123123 0.846936351039 -0.0821631241187
+v 0.297144110935 0.845668794211 -0.079699510177
+v 0.29694350553 0.845555010713 -0.0691929412471
+v 0.277700220454 0.847608949364 -0.0388873673837
+v 0.29178506874 0.846538197119 -0.0357790063912
+v 0.276975184273 0.847720965357 -0.0513709629919
+v 0.286224193808 0.846701433469 -0.0581989479219
+v 0.30016182566 0.845407690096 -0.0554988132581
+v 0.301199620056 0.845301526414 -0.0417930673912
+v 0.275037903174 0.846475129466 -0.010392286449
+v 0.285051879522 0.846019248778 -0.00712678993721
+v 0.271328819274 0.84711140467 -0.022714782982
+v 0.284590148516 0.846345102212 -0.0263213491389
+v 0.294696259455 0.845450384952 -0.0241914808014
+v 0.295378825694 0.845436692858 -0.0118373413903
+v 0.286667155089 0.872829664543 0.00335813225635
+v 0.278857425852 0.848275087818 0.0147626952654
+v 0.269521127573 0.849000559842 0.022643016501
+v 0.270635714903 0.831079660863 -0.0909061862241
+v 0.280654092719 0.828092302759 -0.099956077644
+v 0.258752743706 0.834284971972 -0.0973790320546
+v 0.262638732794 0.833232984683 -0.110218145465
+v 0.276242255075 0.830356584988 -0.110857735433
+v 0.267378924244 0.817571660299 -0.0669124167568
+v 0.276112030849 0.81476007051 -0.0623119639213
+v 0.267867677729 0.817710415333 -0.0797791276508
+v 0.275610961715 0.814978089527 -0.0821178939689
+v 0.283067282633 0.81165272685 -0.0784313822103
+v 0.283603711643 0.811571042614 -0.0691253061147
+v 0.271518928868 0.812685325799 -0.0388579738845
+v 0.282811024041 0.809225254829 -0.0357349872081
+v 0.270019699719 0.81292549495 -0.0513374298356
+v 0.277361349678 0.81033392898 -0.0581554243922
+v 0.285722066629 0.806731654757 -0.055425823807
+v 0.286726934653 0.806459016672 -0.0417199241221
+v 0.266546284848 0.818423051294 -0.00987537043414
+v 0.276203890349 0.816083326812 -0.00635735826927
+v 0.265514119253 0.819449687449 -0.0226866059185
+v 0.27576260078 0.816496066205 -0.0270026926331
+v 0.280491026765 0.810454722177 -0.0246798834566
+v 0.282058224749 0.810308579431 -0.0113963923311
+v 0.261741616113 0.813918360122 -0.0918569656027
+v 0.251856975233 0.818867874916 -0.0976758123515
+v 0.25508712431 0.817231663863 -0.109208538137
+v 0.258449423255 0.796748709387 -0.0679346159072
+v 0.264570723667 0.793306651182 -0.0644094241434
+v 0.258711606901 0.796842705203 -0.0780759692739
+v 0.264218965898 0.793535617086 -0.0799026419625
+v 0.260908659303 0.791525932221 -0.0400352652833
+v 0.268299127476 0.788696349937 -0.0373789872383
+v 0.259703884185 0.791967914348 -0.0506036374743
+v 0.276948860104 0.79491629786 -0.0424748313596
+v 0.255335003182 0.797925028105 -0.0110927741968
+v 0.26280438038 0.79442054433 -0.00831464269478
+v 0.254967734468 0.798747577593 -0.0216365151888
+v 0.26235818148 0.794878638956 -0.0250088312349
+v 0.207278793421 1.26228916073 0.00942310885069
+v 0.207944430934 1.25963199399 -0.0863646302291
+v 0.073390048451 1.27004732982 -0.153714983924
+v 2.75899153729e-05 1.27273604576 -0.157165289745
+v 0.159049159441 1.26804360134 -0.131834734316
+v 2.75899153729e-05 1.22103007817 0.122269378712
+v 0.0793310843805 1.23622604979 0.113130305525
+v 0.157171403975 1.24983173305 0.0618375764676
+v 0.189642002135 1.14509243135 0.0100472156823
+v 0.190257107399 1.14248928438 -0.0755975141376
+v 0.0721252451275 1.15011763901 -0.141909215371
+v 2.75899153729e-05 1.15404723409 -0.145366139817
+v 0.151282312784 1.14469656756 -0.120010777994
+v 2.75899153729e-05 1.11963676968 0.113262343032
+v 0.0776152997923 1.12651473138 0.107446399592
+v 0.14954704429 1.14015385426 0.0624216432227
+v 0.202119764126 1.0243959018 0.00625436384738
+v 0.202769150061 1.02179779958 -0.0784758312291
+v 0.0714867888011 1.02347473353 -0.160001960554
+v 2.75899153729e-05 1.02545504382 -0.172709506024
+v 0.15506286765 1.02019887243 -0.13769059077
+v 2.75899153729e-05 1.02336058809 0.101139483661
+v 0.0772833592138 1.02106206547 0.0987120060027
+v 0.153230819744 1.01895588925 0.0596471526982
+v 0.21286825674 0.893112713561 0.00827156986743
+v 0.213526868831 0.890552404799 -0.0693457569555
+v 0.0764414513403 0.874148386236 -0.153218724842
+v 0.00904797231466 0.900586285531 -0.16130593937
+v 0.16041456701 0.886372765939 -0.123575847045
+v -0.00161698348361 0.944486233875 0.0842572468792
+v 0.0823202054282 0.882676426963 0.0726294945037
+v 0.158556480608 0.885041549969 0.057199229766
+v 0.225137647273 0.781896653591 0.00495156496115
+v 0.22585864172 0.779285605198 -0.065269744779
+v 0.00647517493254 0.834195498226 -0.119823370439
+v 0.082086208111 0.771190531608 -0.132787500355
+v 0.0302761511943 0.774393838356 -0.116744143899
+v 0.161426799029 0.774970129541 -0.114330592314
+v -0.00275945196269 0.878070061352 0.0330007517554
+v 0.0175651100343 0.783412465203 0.00773563482799
+v 0.0885215099419 0.770975543301 0.0631861292678
+v 0.159392812582 0.773451074272 0.0492240336822
+v 0.217958703534 0.66196116722 0.00861468241288
+v 0.227124508379 0.661441791795 -0.0534299578572
+v 0.110670605573 0.660475272669 -0.112177798475
+v 0.0475792640627 0.6619605837 -0.0993733798686
+v 0.17890563472 0.66085134737 -0.0999868614115
+v 0.0302199584039 0.661963998804 0.0202410256867
+v 0.0997549312072 0.661245536558 0.0524287169785
+v 0.161020848176 0.66143251195 0.0470791466693
+v 0.00436053037905 0.782227718244 -0.0414460210392
+v 0.0150673161669 0.661963914074 -0.0437835291292
+v 0.0021001195742 0.830725285808 -0.042353108549
+v 0.202083219238 0.547624963169 0.0183109530822
+v 0.209724592293 0.547099401395 -0.0448715366902
+v 0.112638305477 0.54612735639 -0.104696781353
+v 0.061107088486 0.547613876426 -0.0916573845542
+v 0.169525057242 0.546504494829 -0.0922822500533
+v 0.0459600737279 0.547628929994 0.0301504755915
+v 0.103538025382 0.546913695589 0.0629284058744
+v 0.154614711366 0.547100063924 0.057480735439
+v 0.0333275091166 0.547622550615 -0.0350481607666
+v 0.194043978796 0.430189017476 0.0179129275465
+v 0.201075875388 0.429672366728 -0.0436200644398
+v 0.111733306357 0.428708554465 -0.101883444201
+v 0.0643122888524 0.430193345511 -0.089184617253
+v 0.164082725715 0.42908400915 -0.0897930407346
+v 0.0516217750954 0.430191380936 0.0294434176712
+v 0.103358866557 0.429471590365 0.0613657769754
+v 0.150361644012 0.429658758105 0.0560602738571
+v 0.0405444895875 0.430193980804 -0.0340531726951
+v 0.179259783671 0.31369297162 0.010370839969
+v 0.185455803248 0.313197549018 -0.0471838118639
+v 0.106733301283 0.312253713084 -0.101680079288
+v 0.0649491845619 0.313734087153 -0.089802738644
+v 0.152859995998 0.312625004457 -0.0903714756313
+v 0.0577233852827 0.313691492154 0.021155851129
+v 0.0993543023223 0.312960627838 0.0510146429738
+v 0.140769933577 0.313149537287 0.0460520982097
+v 0.044006668017 0.313715995149 -0.0382356490277
+v 0.179259783671 0.206280587614 0.00735913159447
+v 0.185455803248 0.205792858941 -0.0487507301559
+v 0.106733301283 0.204856223373 -0.101878995585
+v 0.0649491845619 0.206335008677 -0.0902999983488
+v 0.152859995998 0.205225918302 -0.0908542821903
+v 0.0577233852827 0.206277497868 0.0178735490793
+v 0.0993543023223 0.205542643016 0.0469829856156
+v 0.140769933577 0.205732215709 0.0421449868979
+v 0.044006668017 0.206309939523 -0.0400272047839
+v 0.169448020958 0.104158479382 0.0079029616633
+v 0.183629701558 0.103611999109 -0.0592394589995
+v 0.106733301283 0.1026755326 -0.112367767652
+v 0.0649491845619 0.104154233205 -0.100788780545
+v 0.152859995998 0.103045312397 -0.101343012386
+v 0.061859184177 0.104155474278 0.0184173786974
+v 0.100353552125 0.103420619426 0.0475268152336
+v 0.139357400667 0.103610192119 0.0426888165159
+v 0.0478589689406 0.10412924875 -0.0505159768503
+v 0.172974242874 0.0419348660709 0.0271650947082
+v 0.183536043381 0.0149426533824 -0.0579186144568
+v 0.106733301283 0.0166113630897 -0.111909450799
+v 0.0649491845619 0.0180898097675 -0.10033046234
+v 0.152859995998 0.0145938031318 -0.100871982252
+v 0.0993543023223 0.0669909955661 0.178307515354
+v 0.0642410400762 0.052159938124 0.149280967882
+v 0.0642410400762 0.0200181600964 0.149452132242
+v 0.0993543023223 0.0145451912853 0.178586804588
+v 0.140769933577 0.0671804835744 0.173469509152
+v 0.140769933577 0.0147347639361 0.173748797935
+v 0.168785906737 0.052162943904 0.138766677811
+v 0.168785906737 0.0118915989867 0.138981134491
+v 0.0478589689406 0.0154524213345 -0.0500437468308
+v 0.0600527250993 0.0418783555113 0.0276320902093
+v 0.0591703258289 0.0883326579141 0.0738766810346
+v 0.0993543023223 0.0984211892211 0.0737593778086
+v 0.0591703258289 0.0139137244903 0.086631906596
+v 0.0940562670242 0.0255519571239 0.024894651945
+v 0.0993543023223 0.00592525673296 0.0866109057047
+v 0.140769933577 0.0986366014594 0.0737736095832
+v 0.139357400667 0.0257661441791 0.0246788150129
+v 0.140769933577 0.00614083825613 0.0866251365778
+v 0.173856652725 0.0883916760283 0.0738805619553
+v 0.173856652725 0.0139729965318 0.0866357861645
+v 0.14914816118 0.0054999045104 -0.0599897295548
+v 0.104143491854 0.00521553482738 -0.0596013142615
+v 0.0186454246291 1.6893436157 0.0713624221124
+v 0.0280316930687 1.76644994315 0.0730407317181
+v 0.0362964347231 1.76631253402 0.069204328114
+v -0.358367335773 1.42386593993 -0.107637289798
+v -0.312122139975 1.56809299346 -0.104774977108
+v -0.265829205169 1.52060606505 -0.12569930095
+v -0.298932905945 1.43111345107 -0.124500039642
+v -0.232298794689 1.4318865506 -0.117817003366
+v -0.24353864358 1.43297111153 -0.102425535059
+v -0.230190956674 1.44680581106 -0.0118269101046
+v -0.235626305102 1.43287834096 -0.0377969588584
+v -0.25091506091 1.50458241773 0.0238635002403
+v -0.288333767018 1.42555192405 0.0226940562749
+v -0.302391211929 1.55763805469 0.000482705725462
+v -0.348412800415 1.42374918988 0.0127060609584
+v -0.321417174483 1.57714756913 -0.0534759480151
+v -0.380829596967 1.42083847198 -0.0520325794251
+v -0.0316437118855 1.6317063225 0.0187973697828
+v -0.0478786274239 1.58185552441 0.0144208300306
+v -0.0311292399623 1.63211081723 0.0409902529506
+v -0.0214553127887 1.64245834671 0.0705538014202
+v -0.0156240966799 1.66272162261 0.075167604418
+v -0.012095324874 1.6833318171 0.0816255420592
+v -0.00887261319516 1.68937694366 0.0776208516903
+v -0.0117745308036 1.69479641333 0.0856477087666
+v -0.0201006404128 1.71538567824 0.0790199791259
+v -0.014484321257 1.72256775313 0.0945975716651
+v -0.0133356503175 1.73159267695 0.0915471274126
+v -0.00672728069657 1.7500986604 0.0871202959538
+v -0.014534759603 1.81336113767 0.0852902593768
+v -0.0102955559495 1.77601877771 0.0828540030914
+v -0.0293575852876 1.87744634103 0.03267998912
+v -0.0214859603958 1.84608385012 0.0714367935938
+v -0.0293575852876 1.87620614557 -0.057265214399
+v -0.0378759086793 1.80900888215 -0.123248115337
+v -0.0371640530994 1.74462217415 -0.116025601698
+v -0.0300499040594 1.66498161744 -0.0729290653167
+v -0.0366794127659 1.69939252672 -0.0901844087743
+v -0.0314791329259 1.63060149266 -0.0791792104509
+v -0.00904608833259 1.76409290229 0.0803961327997
+v -0.0261689935886 1.77474659055 0.0699758401444
+v -0.0273423976615 1.78833257002 0.0800725674059
+v -0.0487473567478 1.7865239531 0.0690474436901
+v -0.0395790416898 1.77298686711 0.0655889067946
+v -0.0558465185749 1.7625051037 0.0471939031893
+v -0.0468462660909 1.7649032064 0.0580954698684
+v -0.0470772003668 1.7470535352 0.061317775476
+v -0.0385048928544 1.76004025717 0.0656578512758
+v -0.0252751330416 1.74468552197 0.0709202589937
+v -0.0262233136386 1.7603345681 0.0713086383124
+v -0.0180439469889 1.76218017677 0.0746966438723
+v -0.0130184059893 1.74790905587 0.077024792069
+v -0.0317405098126 1.72938876083 0.0678364252633
+v -0.0217792082546 1.72989901386 0.0772885515055
+v -0.0519302006153 1.7299916337 0.0444452554822
+v -0.0676269387236 1.76367734196 0.0320366406451
+v -0.0578827374981 1.79924542033 0.0567894881847
+v -0.0314144916431 1.81049128542 0.0776982837378
+v -0.0374088583503 1.70566614682 0.0653467431309
+v -0.0217193043701 1.69380112471 0.0787905033638
+v -0.0454563753519 1.68667189358 0.0604917054542
+v -0.0320874587649 1.68997396285 0.0692796486705
+v -0.0354273324381 1.66685500248 0.0682222012718
+v -0.0202016017485 1.6861014242 0.0757815310671
+v -0.0187380538575 1.76793672423 0.0747484220596
+v -0.0100673970589 1.77555325846 0.0827558182522
+v -0.0527015157007 1.70395191319 0.0439510246216
+v -0.0518398858612 1.68517370151 0.040364879246
+v -0.0450861652718 1.65504295645 0.0477997639437
+v -0.0478856052332 1.83867390054 0.0526543540337
+v -0.0717735402612 1.81440171784 0.0255332943303
+v -0.0777597917602 1.77181437482 0.0108564057979
+v -0.0659353093115 1.73215839965 0.0134872253984
+v -0.0634563301362 1.70486565808 0.0115977557445
+v -0.0619689934172 1.68164506599 0.0127388179221
+v -0.0516979543631 1.6481268994 0.0191924062391
+v -0.0526511527403 1.64656709874 0.00152374734525
+v -0.0593655881047 1.66425252742 -0.0245295151486
+v -0.0819740553002 1.625612205 -0.0433648276692
+v -0.0759846719868 1.60490049752 -0.0217727938992
+v -0.057801326196 1.86428316819 0.0251195643182
+v -0.0572080907293 1.86222185929 -0.0529790658439
+v -0.0685601400431 1.79975495285 -0.103134317892
+v -0.062183559731 1.74430222904 -0.0977362340406
+v -0.0567654468621 1.66649576895 -0.0562030095353
+v -0.0573828322148 1.70043118136 -0.0738327336848
+v -0.0646649089279 1.62696581517 -0.0582480529516
+v -0.0799429467362 1.82339560223 -0.00458137888077
+v -0.0806573813017 1.82430699907 -0.0504491025739
+v -0.0859996323165 1.79025563382 -0.0768302904728
+v -0.0751702256813 1.74246494291 -0.0671915043463
+v -0.0675191609305 1.70444017924 -0.0427966695874
+v -0.0695687852887 1.70837774714 -0.0124262648601
+v -0.0737730714607 1.73717009491 -0.0167285885275
+v -0.0901070703042 1.76236461409 -0.0245834259933
+v -0.0895997798641 1.74452591153 -0.0283932610632
+v -0.0752961965648 1.73764879425 -0.00394294869589
+v -0.0823320714072 1.71592523137 -0.013999686113
+v -0.067966010528 1.71267466127 -0.00574968058287
+v -0.0796099586928 1.70888599903 -0.0177665660388
+v -0.0909063918509 1.74431751736 -0.0371113333404
+v -0.0751828693237 1.74304445527 -0.0307382098548
+v -0.0922166435139 1.76668926165 -0.0383930291374
+v -0.0832626699351 1.76196882367 -0.0358989180934
+v -0.0857742527789 1.77183709754 -0.0215222754919
+v -0.0922166435139 1.77736390247 -0.0215927997635
+v -0.0847870594034 1.7690445175 -0.0139918809043
+v -0.0858343709177 1.79235887457 -0.0147793446446
+v -0.0962035807128 1.51194700441 0.0568333745205
+v -0.0646011246619 1.58706050374 -0.11604438338
+v -0.13014983477 1.6256692352 -0.0479543307522
+v -0.124433109753 1.60016694288 -0.00161886442604
+v -0.103099571375 1.61467283081 -0.0925441583441
+v -0.17844938439 1.59754600374 -0.00651384470123
+v -0.172265394789 1.51776346316 0.03839617801
+v -0.163443623981 1.6051828078 -0.0944483771826
+v -0.179195539156 1.62352555265 -0.0549260871185
+v -0.15276817882 1.55293295873 -0.12324035118
+v -0.0701741935676 1.48465631599 -0.139732400711
+v -0.157794687931 1.4775470554 -0.132385883892
+v -0.0864913324579 1.43836294107 0.0916183199062
+v -0.179099786048 1.44550222944 0.0729943964813
+v -0.215333883383 1.36152023659 -0.101871971332
+v -0.21466824587 1.36425687059 0.00888010099833
+v -0.0733348608037 1.3798662656 -0.151308517007
+v -0.158993971794 1.37430365875 -0.140305760807
+v -0.0792758967333 1.33823186499 0.119766679892
+v -0.165792273125 1.37465425464 0.0937098834079
+v -0.306894464695 1.34108046707 -0.118043064956
+v -0.362394679725 1.33917282671 -0.102895215096
+v -0.261434782951 1.36644207453 -0.0978912539694
+v -0.254372330009 1.36557748776 -0.039792148705
+v -0.287820445719 1.35863048838 -0.0049877928281
+v -0.357783379364 1.33831336905 0.0107659294694
+v -0.384611643677 1.33863094483 -0.0529190528295
+v -0.305783897937 1.25477391741 -0.115589881138
+v -0.34775596584 1.25280995928 -0.108402852817
+v -0.248673210866 1.25493994651 -0.0961706488226
+v -0.241893340685 1.25411005121 -0.0403946178803
+v -0.287742446613 1.25258288622 0.00176199746899
+v -0.341019814095 1.2519578125 -0.00430054444444
+v -0.36775046314 1.25227410867 -0.0530025020308
+v -0.306512552633 1.20193341349 -0.112449663751
+v -0.349249968245 1.19980979887 -0.102730470962
+v -0.245478125414 1.20211075255 -0.092221911336
+v -0.247567151382 1.20133324996 -0.0393074165565
+v -0.287085019533 1.20167749027 -0.0101501959359
+v -0.342964289903 1.19890979023 -0.00874037540754
+v -0.372695386372 1.19926143858 -0.0527310444802
+v -0.298410675904 1.12361505438 -0.102628967527
+v -0.337854861775 1.12173911123 -0.0944037629324
+v -0.241979127005 1.12374906743 -0.0895118908305
+v -0.244193700638 1.12306037081 -0.0411765485839
+v -0.280442356677 1.12151972619 -0.0150260566432
+v -0.333094630946 1.12094730976 -0.0137197847992
+v -0.359538549692 1.12125998103 -0.0531562241284
+v -0.292819752483 1.0410472391 -0.0947176388119
+v -0.317882816198 1.03984849598 -0.0852826145313
+v -0.258759282426 1.04115583261 -0.082199532282
+v -0.254729653096 1.04065235281 -0.0462039433126
+v -0.275792374177 1.03964455656 -0.0189510099684
+v -0.313866602883 1.03933146391 -0.0228833791443
+v -0.329798142423 1.03952014432 -0.0543081954817
+v -0.289930696077 0.985132343407 -0.0961534546937
+v -0.302806135007 0.983901960017 -0.0779571833362
+v -0.266305854615 0.985325369923 -0.0811001560769
+v -0.262800846508 0.984862121487 -0.0494351844515
+v -0.281132117624 0.983915696605 -0.0259803997192
+v -0.301949499142 0.983456969332 -0.0329969734055
+v -0.307087833069 0.983518830907 -0.0566809344734
+v -0.279821199393 0.932582889929 -0.104326563735
+v -0.287336707369 0.931980273519 -0.102474457584
+v -0.265436352918 0.932884296924 -0.0880169406006
+v -0.273765286186 0.932559890928 -0.045856675249
+v -0.26718090047 0.948322892992 -0.0155397112902
+v -0.296409319577 0.947962700839 -0.0207466403175
+v -0.286239302696 0.948231776162 -0.0138899929543
+v -0.307902570337 0.930350484219 -0.0556433316604
+v -0.300159328673 0.930830028252 -0.0942958102795
+v -0.281058773918 0.884356440961 -0.110530218202
+v -0.295171067902 0.884069787018 -0.107427537853
+v -0.272728486352 0.884729035662 -0.0906956439205
+v -0.278454289399 0.89988904855 -0.0524253896037
+v -0.281096017116 0.900903717909 -0.0669393878773
+v -0.293024717035 0.921553104486 -0.005137210884
+v -0.291619717408 0.882663945911 0.0107197357876
+v -0.278681451743 0.882863774216 0.0202135144438
+v -0.282273833238 0.922371424675 0.00518956571331
+v -0.302387699218 0.91712937635 -0.0322297961092
+v -0.298065753109 0.914346061337 -0.0185706149079
+v -0.303112375663 0.883233780401 -0.0943085649249
+v -0.305117371667 0.88289798541 -0.0843044240116
+v -0.307761934945 0.897774790561 -0.0702116373637
+v -0.297267732958 0.862770553964 -0.110604776241
+v -0.281539507419 0.862785102563 -0.112665098322
+v -0.274217156208 0.885170657433 -0.0788523642367
+v -0.278471112321 0.862900405283 -0.0816590622522
+v -0.273697190385 0.862964229741 -0.0943546666561
+v -0.266289962773 0.88306990871 -0.0116988168105
+v -0.275565275316 0.861402755783 -0.0117468529614
+v -0.277642112601 0.857734026893 -0.0273893407532
+v -0.273987581521 0.884148854394 -0.0223286645661
+v -0.29962213787 0.882757722532 -0.0165259223864
+v -0.299927405124 0.856707683259 -0.0165259285476
+v -0.288457135109 0.861267451996 -0.00824582465402
+v -0.281755729574 0.881301846282 -0.0132487919209
+v -0.305916365219 0.861347760923 -0.081572434015
+v -0.30808074518 0.855800729802 -0.0710781111641
+v -0.287780578569 0.862261412635 -0.0875616890259
+v -0.281266277779 0.857966190635 -0.0684450156483
+v -0.28251307846 0.857288878483 -0.0553208357094
+v -0.288699427502 0.856587470758 -0.064201781706
+v -0.287797084077 0.857474101833 -0.0339979983929
+v -0.280601359737 0.858337358987 -0.040998403478
+v -0.299994358236 0.861421147286 -0.101393470048
+v -0.309655878505 0.855732683463 -0.057375210789
+v -0.311216834022 0.856841454247 -0.0436723030109
+v -0.305898124517 0.856778612798 -0.0271958916936
+v -0.261097097186 0.918379899348 -0.0128596414843
+v -0.272483040984 0.922561102009 -0.000361934103737
+v -0.267463208139 0.88308365945 0.0152263344329
+v -0.274742814316 0.830124109263 -0.00305847820487
+v -0.273822589924 0.820275781034 0.00956055552695
+v -0.284890929658 0.829639864161 0.0015406109543
+v -0.263281072147 0.83048416817 0.00352615179661
+v -0.263548334411 0.830487214666 0.0158326205983
+v -0.275423412591 0.835223514291 -0.112109522018
+v -0.289349025047 0.835220324842 -0.113217082647
+v -0.294355230267 0.833832943036 -0.10180657558
+v -0.283450972211 0.834742675538 -0.09233094517
+v -0.271405591047 0.835447551136 -0.0992698508703
+v -0.275228330183 0.800583694332 -0.101225905899
+v -0.271766342201 0.803173496718 -0.111460486628
+v -0.26393879548 0.794219341865 -0.104788879568
+v -0.278360483096 0.777560115553 -0.0715967982824
+v -0.277967038339 0.777684649975 -0.0788765148638
+v -0.271363078783 0.770828871491 -0.0745674204497
+v -0.310586662191 0.89895377522 -0.0560197770176
+v -0.302799321194 0.884832747664 -0.0276842298693
+v -0.305830409612 0.899373035009 -0.0388427513873
+v -0.281528292138 0.776580426775 -0.0559262406114
+v -0.269483143744 0.77142762944 -0.0582113025319
+v -0.272345452762 0.768369961943 -0.0487339758364
+v -0.275051509638 0.778400993543 -0.0145510317829
+v -0.27388336405 0.778705384232 -0.0247540596822
+v -0.26725784153 0.770399924444 -0.0192629768097
+v -0.266159146042 0.915880845083 -0.0291121984884
+v -0.275601841364 0.894822776587 -0.0313614134852
+v -0.289767164583 0.881711735505 -0.00726103231904
+v -0.28991770328 0.846460735551 0.0188097582716
+v -0.276731664548 0.846854934959 0.027875391302
+v -0.265706535387 0.855212048662 0.0204052858537
+v -0.260936168483 0.855156112416 0.00564952507549
+v -0.274019344043 0.85481523245 -0.0043472350703
+v -0.289030807317 0.828324773303 -0.064201783673
+v -0.278750224693 0.829076556024 -0.0667630185752
+v -0.278417575225 0.829178319402 -0.0816566756635
+v -0.288493828123 0.828454170062 -0.0840075486187
+v -0.300959634201 0.827568107543 -0.0815439241891
+v -0.300762414542 0.827448293244 -0.0710373284337
+v -0.295576468572 0.828273087839 -0.0376234256402
+v -0.281465486564 0.828911749382 -0.0407317869047
+v -0.280737297409 0.82900163052 -0.0532154259926
+v -0.290013223617 0.828265891795 -0.0600433721456
+v -0.303983908807 0.827399710642 -0.0573432342555
+v -0.305024475282 0.82732541575 -0.0436374861644
+v -0.288862154883 0.827548114001 -0.00897120514881
+v -0.278839121667 0.827696966696 -0.0122367073018
+v -0.275112283765 0.828219246474 -0.0245592038379
+v -0.288390859146 0.827859662445 -0.0281657668655
+v -0.298519612257 0.827274956863 -0.0260359015017
+v -0.299202305461 0.82728204507 -0.013681762978
+v -0.289655519634 0.854395223231 0.00151370399142
+v -0.282601615698 0.829613121508 0.0129183248558
+v -0.273247478774 0.830052239709 0.0207985786283
+v -0.285015736691 0.809494835551 -0.101800496596
+v -0.274910641475 0.812173705471 -0.0927506235411
+v -0.262934985502 0.815013583623 -0.099223480746
+v -0.266851403976 0.814081199526 -0.112062585661
+v -0.280536692004 0.811622818363 -0.112702169193
+v -0.280884365717 0.796029732269 -0.0641563471644
+v -0.272069175951 0.798572384064 -0.0687568385305
+v -0.272553443324 0.798726142363 -0.081623555257
+v -0.28037690599 0.796232324584 -0.0839623114469
+v -0.287931540484 0.793136793746 -0.0802758068407
+v -0.288470170228 0.793071594102 -0.0709697285952
+v -0.287749725965 0.790702634818 -0.0375794053254
+v -0.276356862551 0.79381521759 -0.0407023931312
+v -0.27485107352 0.794009255278 -0.0531818547081
+v -0.282268627655 0.791643944948 -0.0599998479534
+v -0.290735826293 0.788299477676 -0.0572702553676
+v -0.291748587336 0.788057756197 -0.0435643404524
+v -0.280935617435 0.797355167984 -0.00820177758604
+v -0.271210910696 0.799397937204 -0.0117197961292
+v -0.27014770205 0.80039232367 -0.024531033132
+v -0.280481842931 0.797754258154 -0.0288471576343
+v -0.285392951032 0.791860556123 -0.026524301472
+v -0.286964106106 0.791762470434 -0.0132408189428
+v -0.266546411813 0.794747974397 -0.0937013808099
+v -0.256514829591 0.799392323109 -0.0995202847762
+v -0.25979354295 0.797855993223 -0.111052960525
+v -0.270005691198 0.774232866335 -0.0662538459096
+v -0.263781675741 0.777485701005 -0.0697790404505
+v -0.264041023825 0.777587674596 -0.0799203939787
+v -0.269647056135 0.774450849687 -0.0817470422755
+v -0.273873376102 0.769738993838 -0.0392234497335
+v -0.26639993601 0.772340839437 -0.0418796841708
+v -0.265182168094 0.772745493139 -0.052448066544
+v -0.282328682311 0.776221023746 -0.0443192135237
+v -0.268205998321 0.775292057755 -0.0101590654474
+v -0.260632826871 0.778566053656 -0.0129371968843
+v -0.260240545965 0.779376816354 -0.0234809372692
+v -0.267746044831 0.775736249489 -0.0268532500471
+v -0.207889264447 1.25963199399 -0.0863646302291
+v -0.207223626935 1.26228916073 0.00942310885069
+v -0.0733348608037 1.27004732982 -0.153714983924
+v -0.158993971794 1.26804360134 -0.131834734316
+v -0.0792758967333 1.23622604979 0.113130305525
+v -0.157116216328 1.24983422475 0.0623054745339
+v -0.190201919752 1.14248928438 -0.0755975141376
+v -0.189586814487 1.14509243135 0.0100472156823
+v -0.0720700574803 1.15011763901 -0.141909215371
+v -0.151227135717 1.14469656756 -0.120010777994
+v -0.0775601174353 1.12651473138 0.107446399592
+v -0.149491877803 1.14015634595 0.0628895412889
+v -0.202713962414 1.02179779958 -0.0784758312291
+v -0.202064555317 1.0243959018 0.00625436384738
+v -0.0714316170245 1.02347473353 -0.160001960554
+v -0.155007701163 1.02019887243 -0.13769059077
+v -0.0772281874372 1.02106206547 0.0987120060027
+v -0.153175653258 1.01894408785 0.0574310498703
+v -0.213471702345 0.890552404799 -0.0693457569555
+v -0.212813047932 0.893112713561 0.00827156986743
+v -0.0763862742735 0.874148386236 -0.153218724842
+v -0.160359358202 0.886372765939 -0.123575847045
+v -0.0822650706833 0.882676426963 0.0726294945037
+v -0.15850129296 0.885041549969 0.057199229766
+v -0.225803454073 0.779285605198 -0.065269744779
+v -0.225082459626 0.781896653591 0.00495156496115
+v -0.0820310363344 0.771190531608 -0.132787500355
+v -0.161371611382 0.774970129541 -0.114330592314
+v -0.159337656676 0.773451074272 0.0492240336822
+v -0.0884663328751 0.770975543104 0.0631860922368
+v -0.227069299571 0.661441664831 -0.0534299571811
+v -0.217903494725 0.66196116722 0.00861468241288
+v -0.0302209714823 0.774393838356 -0.116744143899
+v -0.0475240922861 0.6619605837 -0.0993733798686
+v -0.110615428506 0.660475272669 -0.112177798475
+v -0.178850447073 0.660851262728 -0.0999868609608
+v -0.0996997329795 0.661245536558 0.0524287169785
+v -0.030164778692 0.661963998804 0.0202410256867
+v -0.0175099289998 0.783412465203 0.00773563482799
+v -0.160965660529 0.66143251195 0.0470791466693
+v -0.00430535099777 0.782227718244 -0.0414460210392
+v -0.0150121351324 0.661963914074 -0.0437835291292
+v -0.209669446968 0.547099401395 -0.0448715366902
+v -0.202028073913 0.547624963169 0.0183109530822
+v -0.0610519008387 0.547613876426 -0.0916573845542
+v -0.11258312841 0.54612735639 -0.104696781353
+v -0.169469922497 0.546504494829 -0.0922822500533
+v -0.103482837735 0.546913695589 0.0629284058744
+v -0.0459048966611 0.547628929994 0.0301504755915
+v -0.15455955546 0.547100063924 0.057480735439
+v -0.0332723294047 0.547622550615 -0.0350481607666
+v -0.201020708902 0.429672366728 -0.0436200644398
+v -0.193988748827 0.430189017476 0.0179129275465
+v -0.0642571064953 0.430193345511 -0.089184617253
+v -0.11167811871 0.428708554465 -0.101883444201
+v -0.164027527487 0.42908400915 -0.0897930407346
+v -0.10330368949 0.429471590365 0.0613657769754
+v -0.0515665980286 0.430191380936 0.0294434176712
+v -0.150306456364 0.429658758105 0.0560602738571
+v -0.0404893151658 0.430193980804 -0.0340531726951
+v -0.185400679084 0.313197549018 -0.0471838118639
+v -0.179204574863 0.31369297162 0.010370839969
+v -0.0648940022049 0.313734087153 -0.089802738644
+v -0.106678134797 0.312253713084 -0.101680079288
+v -0.152804808351 0.312625173742 -0.0903714765328
+v -0.099299135836 0.312960627838 0.0510146429738
+v -0.0576682082159 0.313691492154 0.021155851129
+v -0.14071475651 0.313149537287 0.0460520982097
+v -0.0439514856599 0.313715995149 -0.0382356490277
+v -0.185400679084 0.205792858941 -0.0487507301559
+v -0.179204574863 0.206280587614 0.00735913159447
+v -0.0648940022049 0.206335008677 -0.0902999983488
+v -0.106678134797 0.204856223373 -0.101878995585
+v -0.152804808351 0.205225918302 -0.0908542821903
+v -0.099299135836 0.205542643016 0.0469829856156
+v -0.0576682082159 0.206277497868 0.0178735490793
+v -0.14071475651 0.205732215709 0.0421449868979
+v -0.0439514856599 0.206309939523 -0.0400272047839
+v -0.183574535072 0.103611999109 -0.0592394589995
+v -0.169392833311 0.104158479382 0.0079029616633
+v -0.0648940022049 0.104154233205 -0.100788780545
+v -0.106678134797 0.1026755326 -0.112367767652
+v -0.152804808351 0.103045312397 -0.101343012386
+v -0.100298375058 0.103420619426 0.0475268152336
+v -0.0618040071101 0.104155474278 0.0184173786974
+v -0.1393022236 0.103610192119 0.0426888165159
+v -0.0478037865836 0.104129418035 -0.0505159777518
+v -0.183480813412 0.0149426533824 -0.0579186144568
+v -0.172919065808 0.0419348660709 0.0271650947082
+v -0.0648940022049 0.0180898097675 -0.10033046234
+v -0.106678134797 0.0166113630897 -0.111909450799
+v -0.152804808351 0.0145938031318 -0.100871982252
+v -0.099299135836 0.0669909955661 0.178307515354
+v -0.099299135836 0.0145451912853 0.178586804588
+v -0.0641858577191 0.0200181600964 0.149452132242
+v -0.0641858577191 0.052159938124 0.149280967882
+v -0.14071475651 0.0671804835744 0.173469509152
+v -0.14071475651 0.0147346792937 0.173748798386
+v -0.168730697929 0.052162943904 0.138766677811
+v -0.168730697929 0.0118913450594 0.138981135844
+v -0.0478037865836 0.0154524213345 -0.0500437468308
+v -0.0599975480325 0.0418783555113 0.0276320902093
+v -0.099299135836 0.0984211894183 0.0737594148397
+v -0.0591151487621 0.0883326579141 0.0738766810346
+v -0.0591151487621 0.0139139784176 0.0866319052437
+v -0.099299135836 0.00592525673296 0.0866109057047
+v -0.094001058216 0.0255519571239 0.024894651945
+v -0.14071475651 0.0986366861019 0.0737736091325
+v -0.14071475651 0.00614083825613 0.0866251365778
+v -0.1393022236 0.0257661441791 0.0246788150129
+v -0.173801465078 0.0883916760283 0.0738805619553
+v -0.173801465078 0.0139729967572 0.0866358284857
+v -0.149092984113 0.00549990467942 -0.0599896978139
+v -0.104088304206 0.00521553482738 -0.0596013142615
+v -0.0185902475623 1.68934361547 0.0713623797911
+v -0.0362412497209 1.76631253402 0.069204328114
+v -0.0279765160019 1.76644994315 0.0730407317181
+vt 0.427453994751 0.740131020546
+vt 0.438596993685 0.750407993793
+vt 0.431466013193 0.770393013954
+vt 0.434879988432 0.782468020916
+vt 0.422383993864 0.780243992805
+vt 0.440667003393 0.777846992016
+vt 0.422735989094 0.71481102705
+vt 0.783756971359 0.949579000473
+vt 0.823691010475 0.964830994606
+vt 0.818269014359 0.976393997669
+vt 0.878816008568 0.748655021191
+vt 0.878221988678 0.741472005844
+vt 0.8781260252 0.757082998753
+vt 0.882167994976 0.725238025188
+vt 0.890343010426 0.718626022339
+vt 0.882718026638 0.709124028683
+vt 0.890533983707 0.682922005653
+vt 0.882318973541 0.674879014492
+vt 0.88186699152 0.691559970379
+vt 0.881394028664 0.955882012844
+vt 0.881506025791 0.931792974472
+vt 0.894276022911 0.943810999393
+vt 0.894855976105 0.910826981068
+vt 0.885900020599 0.919045984745
+vt 0.885968029499 0.902409017086
+vt 0.88510799408 0.885770976543
+vt 0.885109007359 0.865813016891
+vt 0.897562980652 0.875159025192
+vt 0.906059980392 0.839626014233
+vt 0.90631300211 0.831081986427
+vt 0.924477994442 0.820987999439
+vt 0.903836011887 0.637035012245
+vt 0.917698979378 0.629562020302
+vt 0.903836011887 0.621931016445
+vt 0.839645981789 0.855392992496
+vt 0.813124001026 0.858042001724
+vt 0.833916008472 0.839124977589
+vt 0.929134011269 0.955843985081
+vt 0.938925027847 0.960240006447
+vt 0.927060008049 0.968284010887
+vt 0.947315990925 0.919872999191
+vt 0.957924008369 0.923035979271
+vt 0.947215020657 0.928708970547
+vt 0.802353024483 0.650107979774
+vt 0.78209400177 0.673116981983
+vt 0.8102440238 0.660398006439
+vt 0.94811797142 0.900838017464
+vt 0.960359990597 0.892171025276
+vt 0.954752027988 0.906127989292
+vt 0.946623027325 0.850674986839
+vt 0.956761002541 0.856930971146
+vt 0.946371972561 0.863062977791
+vt 0.833979010582 0.65715098381
+vt 0.830762028694 0.64174002409
+vt 0.864566981792 0.852904975414
+vt 0.865299999714 0.841727018356
+vt 0.875923991203 0.845220029354
+vt 0.90631300211 0.817291021347
+vt 0.909798979759 0.799952983856
+vt 0.906759977341 0.612155020237
+vt 0.90422898531 0.645040988922
+vt 0.951206028461 0.843195021152
+vt 0.955456972122 0.664753973484
+vt 0.945062994957 0.657260000706
+vt 0.944414973259 0.67020201683
+vt 0.950851023197 0.869795978069
+vt 0.950675010681 0.649278998375
+vt 0.94963902235 0.677684009075
+vt 0.957343995571 0.879157006741
+vt 0.948409020901 0.88674902916
+vt 0.966840982437 0.70111399889
+vt 0.950062990189 0.69274097681
+vt 0.949729979038 0.705717980862
+vt 0.95194798708 0.71344101429
+vt 0.955138981342 0.682422995567
+vt 0.951326012611 0.913443982601
+vt 0.945950984955 0.726996004581
+vt 0.945872008801 0.73943901062
+vt 0.956964015961 0.732596993446
+vt 0.951637983322 0.934684991837
+vt 0.950176000595 0.719237029552
+vt 0.949773013592 0.745489001274
+vt 0.94260597229 0.765208005905
+vt 0.932260990143 0.752488970757
+vt 0.928476989269 0.763540029526
+vt 0.929727971554 0.7776709795
+vt 0.935531973839 0.973477005959
+vt 0.938045024872 0.945550024509
+vt 0.836919009686 0.103028997779
+vt 0.826685011387 0.103826001287
+vt 0.827790021896 0.119180001318
+vt 0.307877004147 0.683027982712
+vt 0.307168006897 0.677628993988
+vt 0.319911986589 0.682254016399
+vt 0.307882994413 0.689167022705
+vt 0.327850997448 0.785962998867
+vt 0.323067009449 0.777320027351
+vt 0.337819993496 0.778414011002
+vt 0.32691898942 0.771546006203
+vt 0.314083993435 0.786509990692
+vt 0.305938005447 0.779628992081
+vt 0.314835011959 0.77761900425
+vt 0.148340001702 0.740131020546
+vt 0.144326999784 0.770393013954
+vt 0.137197002769 0.750407993793
+vt 0.14091399312 0.782468020916
+vt 0.13512699306 0.777846992016
+vt 0.153410002589 0.780245006084
+vt 0.15305800736 0.71481102705
+vt 0.759791016579 0.759097993374
+vt 0.721607983112 0.776048004627
+vt 0.720556020737 0.766301989555
+vt 0.657631993294 0.951978027821
+vt 0.664515018463 0.959581017494
+vt 0.664429008961 0.945499002934
+vt 0.660869002342 0.930854976177
+vt 0.660372972488 0.916319012642
+vt 0.654730975628 0.922982990742
+vt 0.654591977596 0.892683029175
+vt 0.661140978336 0.900475025177
+vt 0.660732984543 0.885426998138
+vt 0.668331980705 0.765002012253
+vt 0.658479988575 0.752337992191
+vt 0.668227016926 0.742437005043
+vt 0.655366003513 0.722797989845
+vt 0.664047002792 0.714911997318
+vt 0.664111018181 0.730495989323
+vt 0.664852976799 0.699328005314
+vt 0.655758023262 0.688472986221
+vt 0.664852023125 0.68063300848
+vt 0.647439002991 0.654166996479
+vt 0.635456979275 0.639051020145
+vt 0.647076010704 0.647837996483
+vt 0.64132297039 0.851291000843
+vt 0.64132297039 0.837665975094
+vt 0.633917987347 0.844549000263
+vt 0.707437992096 0.670871973038
+vt 0.712804973125 0.655633985996
+vt 0.732281029224 0.673353016376
+vt 0.623612999916 0.764966011047
+vt 0.625555992126 0.776619017124
+vt 0.611958026886 0.769083976746
+vt 0.606580972672 0.733440995216
+vt 0.606676995754 0.741717994213
+vt 0.591633975506 0.736047029495
+vt 0.741548001766 0.853931009769
+vt 0.725749015808 0.872364997864
+vt 0.751142024994 0.883839011192
+vt 0.605830013752 0.71344101429
+vt 0.600229978561 0.717738986015
+vt 0.594148993492 0.705594003201
+vt 0.607231020927 0.666451990604
+vt 0.607465982437 0.678056001663
+vt 0.59596401453 0.672127008438
+vt 0.707239985466 0.855534017086
+vt 0.704339027405 0.869436979294
+vt 0.684094011784 0.668541014194
+vt 0.679017007351 0.65592199564
+vt 0.677278995514 0.66066801548
+vt 0.644990026951 0.635181009769
+vt 0.645394980907 0.623296976089
+vt 0.640929996967 0.832111001015
+vt 0.640968978405 0.858511984348
+vt 0.604993999004 0.657705008984
+vt 0.593921005726 0.876498997211
+vt 0.604718983173 0.881209015846
+vt 0.60413402319 0.869535028934
+vt 0.602342009544 0.684005975723
+vt 0.601724028587 0.864849984646
+vt 0.60087198019 0.886855006218
+vt 0.598672986031 0.694231987
+vt 0.605557978153 0.700242996216
+vt 0.588118970394 0.909093022346
+vt 0.59992402792 0.91324698925
+vt 0.599623978138 0.901540994644
+vt 0.597378015518 0.92077600956
+vt 0.595348000526 0.896207988262
+vt 0.6039249897 0.725521028042
+vt 0.603332996368 0.932439982891
+vt 0.596542000771 0.937695980072
+vt 0.6034039855 0.943665027618
+vt 0.603546977043 0.748286008835
+vt 0.599384009838 0.927326977253
+vt 0.599934995174 0.947610974312
+vt 0.609456002712 0.969237029552
+vt 0.619095981121 0.965404987335
+vt 0.615683019161 0.958904981613
+vt 0.617967009544 0.978151977062
+vt 0.609525978565 0.785179972649
+vt 0.616936981678 0.755652010441
+vt 0.572926998138 0.530381977558
+vt 0.566156029701 0.502631008625
+vt 0.590713024139 0.519349992275
+vt 0.726567983627 0.522401988506
+vt 0.750036001205 0.520341992378
+vt 0.752120018005 0.547896981239
+vt 0.742486000061 0.103028997779
+vt 0.75161498785 0.119180001318
+vt 0.75271999836 0.103826001287
+vt 0.267917007208 0.683027982712
+vt 0.255881994963 0.682254016399
+vt 0.268624991179 0.677628993988
+vt 0.267910987139 0.689167022705
+vt 0.247942000628 0.785962998867
+vt 0.237974002957 0.778414011002
+vt 0.252725988626 0.777320027351
+vt 0.248875007033 0.771546006203
+vt 0.261709988117 0.786509990692
+vt 0.260958999395 0.77761900425
+vt 0.269856005907 0.779628992081
+vt 0.778177976608 0.52171599865
+vt 0.929620981216 0.52969700098
+vt 0.914834976196 0.518664002419
+vt 0.937282025814 0.501945972443
+vt 0.29706799984 0.784763991833
+vt 0.287896990776 0.786481976509
+vt 0.287896990776 0.771014988422
+vt 0.296876996756 0.784364998341
+vt 0.296186000109 0.773536026478
+vt 0.312323004007 0.795871019363
+vt 0.836010992527 0.677062988281
+vt 0.85283100605 0.679763972759
+vt 0.861297011375 0.668690025806
+vt 0.861774027348 0.655698001385
+vt 0.862959980965 0.866423010826
+vt 0.851522982121 0.879943013191
+vt 0.837490975857 0.871939003468
+vt 0.278724998236 0.784763991833
+vt 0.278917014599 0.784364998341
+vt 0.279608011246 0.773536026478
+vt 0.263469994068 0.795871019363
+vt 0.679696023464 0.879845023155
+vt 0.687332987785 0.889833986759
+vt 0.702504992485 0.887398004532
+vt 0.678987979889 0.8681229949
+vt 0.709456980228 0.686371028423
+vt 0.696312010288 0.693867981434
+vt 0.685599029064 0.681204020977
+vt 0.590767979622 0.476411998272
+vt 0.572502970695 0.477710992098
+vt 0.545292973518 0.501013994217
+vt 0.545219004154 0.480807006359
+vt 0.517265021801 0.520570993423
+vt 0.522656023502 0.48119199276
+vt 0.725239992142 0.47588801384
+vt 0.746379971504 0.48119199276
+vt 0.123526997864 0.751622974873
+vt 0.104611001909 0.748121976852
+vt 0.120903000236 0.697094023228
+vt 0.148931995034 0.700519979
+vt 0.452266007662 0.751622974873
+vt 0.471659988165 0.752304971218
+vt 0.448832988739 0.771897017956
+vt 0.471989005804 0.798654019833
+vt 0.0788019970059 0.748540997505
+vt 0.0887229964137 0.695825994015
+vt 0.0525339990854 0.74863499403
+vt 0.0603439994156 0.694535017014
+vt 0.0238830000162 0.694877028465
+vt 0.0238830000162 0.75125002861
+vt 0.515450000763 0.694535017014
+vt 0.551910996437 0.694877028465
+vt 0.523451983929 0.75071901083
+vt 0.551910996437 0.75125002861
+vt 0.497036993504 0.749495983124
+vt 0.48707100749 0.695825994015
+vt 0.454890996218 0.697094023228
+vt 0.270487010479 0.773223996162
+vt 0.262032985687 0.771600008011
+vt 0.277678012848 0.692180991173
+vt 0.278593987226 0.683436989784
+vt 0.276944994926 0.675023972988
+vt 0.661378979683 0.116673998535
+vt 0.670983016491 0.0968659967184
+vt 0.676276028156 0.118412002921
+vt 0.671159982681 0.136265993118
+vt 0.755213022232 0.0486980006099
+vt 0.755213022232 0.0159230008721
+vt 0.746876001358 0.029000999406
+vt 0.745366990566 0.0486790016294
+vt 0.679108977318 0.154393002391
+vt 0.684916973114 0.115904003382
+vt 0.767538011074 0.0487039983273
+vt 0.767538011074 0.0141040002927
+vt 0.699975013733 0.153393998742
+vt 0.69566398859 0.116810001433
+vt 0.779496014118 0.0486800000072
+vt 0.777987003326 0.025048000738
+vt 0.712939977646 0.135782003403
+vt 0.705349981785 0.120192997158
+vt 0.723465025425 0.112208999693
+vt 0.70888698101 0.0996130034328
+vt 0.766112983227 0.103680998087
+vt 0.782862007618 0.100066997111
+vt 0.76723998785 0.0703219994903
+vt 0.7792339921 0.0708080008626
+vt 0.765341997147 0.123326003551
+vt 0.777776002884 0.118969000876
+vt 0.755632996559 0.0704030022025
+vt 0.745629012585 0.0709830000997
+vt 0.65373301506 0.134852007031
+vt 0.659992992878 0.167576000094
+vt 0.678166985512 0.167637005448
+vt 0.700571000576 0.167541995645
+vt 0.719412982464 0.167566001415
+vt 0.732342004776 0.135259002447
+vt 0.737340986729 0.167616993189
+vt 0.743831992149 0.135218992829
+vt 0.755972981453 0.135295003653
+vt 0.752744019032 0.167631998658
+vt 0.684421002865 0.0941269993782
+vt 0.696655988693 0.0948389992118
+vt 0.61399102211 0.167612999678
+vt 0.601127028465 0.134979993105
+vt 0.622075021267 0.134932994843
+vt 0.637682974339 0.167610004544
+vt 0.766622006893 0.167609006166
+vt 0.767713010311 0.13529600203
+vt 0.779367029667 0.167612999678
+vt 0.77871799469 0.135281994939
+vt 0.718995988369 0.21561999619
+vt 0.735132992268 0.215209007263
+vt 0.75208902359 0.215139999986
+vt 0.66131901741 0.216102004051
+vt 0.677743017673 0.215782999992
+vt 0.70132702589 0.216084003448
+vt 0.620176970959 0.215175002813
+vt 0.642202973366 0.215615004301
+vt 0.76652097702 0.215070992708
+vt 0.779892981052 0.215175002813
+vt 0.50901901722 0.285474985838
+vt 0.510403990746 0.240733996034
+vt 0.54629701376 0.285616993904
+vt 0.547617971897 0.240875005722
+vt 0.576619029045 0.285739004612
+vt 0.576942980289 0.240997001529
+vt 0.679750978947 0.28549998...
[truncated message content] |
|
From: <ian...@us...> - 2007-08-27 17:39:09
|
Revision: 270
http://ogoglio.svn.sourceforge.net/ogoglio/?rev=270&view=rev
Author: iansmith
Date: 2007-08-27 10:39:06 -0700 (Mon, 27 Aug 2007)
Log Message:
-----------
Update filenames to work properly with browser.
Fixed test to not leave around sim records.
Modified Paths:
--------------
maven/trunk/ogoglio-server/pom.xml
maven/trunk/ogoglio-server/src/main/java/com/ogoglio/sim/site/SimServlet.java
maven/trunk/ogoglio-server/src/main/java/com/ogoglio/site/AbstractResourceServlet.java
maven/trunk/ogoglio-server/src/main/java/com/ogoglio/site/SpaceServlet.java
maven/trunk/ogoglio-server/src/main/webapp/browserTests.js
maven/trunk/ogoglio-server/src/main/webapp/spaceui.js
maven/trunk/ogoglio-server/src/test/java/com/ogoglio/persist/test/PersistTest.java
maven/trunk/ogoglio-server/src/test/java/com/ogoglio/sim/script/test/ScriptTest.java
Modified: maven/trunk/ogoglio-server/pom.xml
===================================================================
--- maven/trunk/ogoglio-server/pom.xml 2007-08-27 17:37:49 UTC (rev 269)
+++ maven/trunk/ogoglio-server/pom.xml 2007-08-27 17:39:06 UTC (rev 270)
@@ -8,8 +8,7 @@
<artifactId>ogoglio-server</artifactId>
<packaging>war</packaging>
<version>0.0.1</version>
-
-
+
<!-- -->
<!-- profiles -->
<!-- -->
@@ -86,19 +85,32 @@
<executions>
<execution>
<id>copy-applets</id>
- <phase>package</phase>
+ <phase>process-sources</phase>
<goals>
- <goal>copy-dependencies</goal>
+ <goal>copy</goal>
</goals>
<configuration>
- <outputDirectory>
- ${project.build.directory}/ogoglio-server-0.0.1
- </outputDirectory>
- <overWriteReleases>false</overWriteReleases>
- <overWriteSnapshots>
- true
- </overWriteSnapshots>
- <excludeTransitive>true</excludeTransitive>
+ <outputDirectory>${project.build.directory}/ogoglio-server-0.0.1</outputDirectory>
+ <overwriteIfNewer>true</overwriteIfNewer>
+ <stripVersion>true</stripVersion>
+ <artifactItems>
+ <artifactItem>
+ <groupId>com.ogoglio</groupId>
+ <artifactId>ogoglio-viewer-applet</artifactId>
+ </artifactItem>
+ <artifactItem>
+ <groupId>com.ogoglio</groupId>
+ <artifactId>ogoglio-body-editor-applet</artifactId>
+ </artifactItem>
+ <artifactItem>
+ <groupId>com.ogoglio</groupId>
+ <artifactId>ogoglio-test-applet</artifactId>
+ </artifactItem>
+ <artifactItem>
+ <groupId>com.ogoglio</groupId>
+ <artifactId>ogoglio-common</artifactId>
+ </artifactItem>
+ </artifactItems>
</configuration>
</execution>
</executions>
@@ -120,8 +132,6 @@
</plugins>
</build>
-
-
<!-- DEPENDENCIES -->
<dependencies>
<dependency>
@@ -174,31 +184,28 @@
<version>0.0.1</version>
</dependency>
- <!-- broken: really is a dependency on the FILE -->
+ <!-- -->
+ <!-- BOGUS DEPENDENCIES-->
+ <!-- -->
<dependency>
<groupId>com.ogoglio</groupId>
<artifactId>ogoglio-viewer-applet</artifactId>
<version>0.0.1</version>
<scope>runtime</scope>
- <classifier>common</classifier>
</dependency>
-
- <!-- broken: really is a dependency on the FILE -->
<dependency>
<groupId>com.ogoglio</groupId>
- <artifactId>ogoglio-test-applet</artifactId>
+ <artifactId>ogoglio-body-editor-applet</artifactId>
<version>0.0.1</version>
<scope>runtime</scope>
</dependency>
-
- <!-- broken: really is a dependency on the FILE -->
<dependency>
<groupId>com.ogoglio</groupId>
- <artifactId>ogoglio-body-editor-applet</artifactId>
+ <artifactId>ogoglio-test-applet</artifactId>
<version>0.0.1</version>
<scope>runtime</scope>
- <classifier>common</classifier>
</dependency>
+
</dependencies>
</project>
Modified: maven/trunk/ogoglio-server/src/main/java/com/ogoglio/sim/site/SimServlet.java
===================================================================
--- maven/trunk/ogoglio-server/src/main/java/com/ogoglio/sim/site/SimServlet.java 2007-08-27 17:37:49 UTC (rev 269)
+++ maven/trunk/ogoglio-server/src/main/java/com/ogoglio/sim/site/SimServlet.java 2007-08-27 17:39:06 UTC (rev 270)
@@ -153,6 +153,7 @@
public void doGet(HttpServletRequest request, HttpServletResponse response, String[] pathElements) throws ServletException, IOException {
try {
long spaceID = Long.parseLong(pathElements[pathElements.length - 1]);
+ System.out.println("FART TRYING TO GET SPACE DOC FOR "+spaceID);
SpaceRecord spaceRecord = SpacePersistTasks.findSpaceBySpaceID(spaceID, getSessionFactory());
if (spaceRecord == null) {
response.setStatus(HttpServletResponse.SC_NOT_FOUND);
@@ -263,6 +264,7 @@
public void doGet(HttpServletRequest request, HttpServletResponse response, String[] pathElements) throws ServletException, IOException {
long spaceID = Long.parseLong(pathElements[2]);
try {
+ System.out.println("SIM FART GET:"+spaceID);
SpaceRecord spaceRecord = SpacePersistTasks.findSpaceBySpaceID(spaceID, getSessionFactory());
if (spaceRecord == null) {
response.setStatus(HttpServletResponse.SC_NOT_FOUND);
@@ -275,12 +277,14 @@
return;
}
+ System.out.println("SIM FART GET2:"+authedAccount.getUsername());
SpaceSimulator simulator = sim.getOrCreateSpaceSimulator(spaceRecord);
String value = simulator.getSetting(pathElements[pathElements.length - 1]);
if (value == null) {
response.setStatus(HttpServletResponse.SC_NOT_FOUND);
return;
}
+ System.out.println("SIM FART GET3:"+value);
sendStringResponse(value, "text/plain", response);
} catch (PersistException e) {
response.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
@@ -320,11 +324,13 @@
public void doPost(HttpServletRequest request, HttpServletResponse response, String[] pathElements) throws ServletException, IOException {
long spaceID = Long.parseLong(pathElements[2]);
try {
+ System.out.println("do POST fart: SIM:"+spaceID);
SpaceRecord spaceRecord = SpacePersistTasks.findSpaceBySpaceID(spaceID, getSessionFactory());
if (spaceRecord == null) {
response.setStatus(HttpServletResponse.SC_NOT_FOUND);
return;
}
+ System.out.println("do POST2 fart: SIM:"+spaceID);
AccountRecord authedAccount = AuthServlet.getAuthedAccountRecord(request, getSessionFactory());
if (authedAccount != null && !authedAccount.getUsername().equals(spaceRecord.getOwnerUsername())) {
@@ -332,6 +338,7 @@
return;
}
+ System.out.println("do POST3 fart: authed acct:"+authedAccount.getUsername());
String value = getFirstStringValue(request);
if (value == null || value.trim().length() == 0) {
System.err.println("Posted null value: " + request.getContentType());
@@ -339,9 +346,11 @@
return;
}
+ System.out.println("do POST4 fart: value:"+value);
SpaceSimulator simulator = sim.getOrCreateSpaceSimulator(spaceRecord);
simulator.putSetting(pathElements[pathElements.length - 1], value);
sendStringResponse(value, "text/plain", response);
+ System.out.println("do POST5 fart: value:"+value);
} catch (PersistException e) {
response.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
return;
Modified: maven/trunk/ogoglio-server/src/main/java/com/ogoglio/site/AbstractResourceServlet.java
===================================================================
--- maven/trunk/ogoglio-server/src/main/java/com/ogoglio/site/AbstractResourceServlet.java 2007-08-27 17:37:49 UTC (rev 269)
+++ maven/trunk/ogoglio-server/src/main/java/com/ogoglio/site/AbstractResourceServlet.java 2007-08-27 17:39:06 UTC (rev 270)
@@ -247,7 +247,7 @@
outputStream.flush();
outputStream.close();
}
-
+ System.out.println("FART 2nd level proxy:"+connection.getResponseCode());
response.setStatus(connection.getResponseCode());
Map headers = connection.getHeaderFields();
Modified: maven/trunk/ogoglio-server/src/main/java/com/ogoglio/site/SpaceServlet.java
===================================================================
--- maven/trunk/ogoglio-server/src/main/java/com/ogoglio/site/SpaceServlet.java 2007-08-27 17:37:49 UTC (rev 269)
+++ maven/trunk/ogoglio-server/src/main/java/com/ogoglio/site/SpaceServlet.java 2007-08-27 17:39:06 UTC (rev 270)
@@ -152,6 +152,7 @@
}
public void doGet(HttpServletRequest request, HttpServletResponse response, String[] pathElements, AccountRecord authedAccount) throws PersistException, IOException {
+ System.out.println("***WE ARE FART:"+(pathElements.length-1));
long spaceID = Long.parseLong(pathElements[pathElements.length - 1]);
SpaceRecord spaceRecord = SpacePersistTasks.findSpaceBySpaceID(spaceID, getSessionFactory());
if (spaceRecord == null) {
Modified: maven/trunk/ogoglio-server/src/main/webapp/browserTests.js
===================================================================
--- maven/trunk/ogoglio-server/src/main/webapp/browserTests.js 2007-08-27 17:37:49 UTC (rev 269)
+++ maven/trunk/ogoglio-server/src/main/webapp/browserTests.js 2007-08-27 17:39:06 UTC (rev 270)
@@ -23,8 +23,8 @@
function testJava(testSpan){
try {
- var jarURI = getServiceURI() + "/ogoglio-test-applet-0.0.1.jar";
- var appletHTML = "<applet id='testApplet' name='testApplet' code='com.ogoglio.viewer.applet.TestApplet' archive='" + jarURI + "' width='1' height='1'></applet>";
+ var jarURI = getServiceURI() + "/ogoglio-test-applet.jar";
+ var appletHTML = "<applet id='testApplet' name='testApplet' code='com.ogoglio.testapplet.TestApplet' archive='" + jarURI + "' width='1' height='1'></applet>";
testSpan.innerHTML = appletHTML;
while(typeof document.testApplet == "undefined"){
for(i=0; i < 100; i++) setTimeout('this = "something";', 5000);
Modified: maven/trunk/ogoglio-server/src/main/webapp/spaceui.js
===================================================================
--- maven/trunk/ogoglio-server/src/main/webapp/spaceui.js 2007-08-27 17:37:49 UTC (rev 269)
+++ maven/trunk/ogoglio-server/src/main/webapp/spaceui.js 2007-08-27 17:39:06 UTC (rev 270)
@@ -70,7 +70,7 @@
var serviceURI = getServiceURI();
- var html = "<applet id='viewer' codebase='" + serviceURI + "' code='com.ogoglio.viewer.applet.ViewerApplet' archive='ogoglio-viewer-applet-0.0.1-common.jar' width='" + viewerWidth + "' height='" + viewerHeight + "' mayscript='true'>";
+ var html = "<applet id='viewer' archive='ogoglio-common.jar,ogoglio-viewer-applet.jar' codebase='" + serviceURI + "' code='com.ogoglio.viewer.applet.ViewerApplet' archive='/ogoglio-viewer-applet-0.0.1.jar' width='" + viewerWidth + "' height='" + viewerHeight + "' mayscript='true'>";
html += "<param name='loginCookie' value='" + loginCookie + "' />";
html += "<param name='serviceURI' value='" + serviceURI + "' />";
html += "<param name='spaceID' value='" + locationParameters['spaceID'] + "' />";
Modified: maven/trunk/ogoglio-server/src/test/java/com/ogoglio/persist/test/PersistTest.java
===================================================================
--- maven/trunk/ogoglio-server/src/test/java/com/ogoglio/persist/test/PersistTest.java 2007-08-27 17:37:49 UTC (rev 269)
+++ maven/trunk/ogoglio-server/src/test/java/com/ogoglio/persist/test/PersistTest.java 2007-08-27 17:39:06 UTC (rev 270)
@@ -13,17 +13,10 @@
limitations under the License. */
package com.ogoglio.persist.test;
-import java.io.IOException;
-import java.io.InputStream;
import java.net.URI;
import java.net.URISyntaxException;
-import junit.framework.TestCase;
-
-import org.hibernate.SessionFactory;
-
import com.ogoglio.migrate.DBZapTest;
-import com.ogoglio.migrate.MigrationSupport;
import com.ogoglio.persist.AccountPersistTasks;
import com.ogoglio.persist.AccountRecord;
import com.ogoglio.persist.BodyPersistTasks;
@@ -58,6 +51,18 @@
String level2 = null;
+ public void tearDown() {
+ try {
+ SimRecord simRecord1 = SimPersistTasks.findSimsBySimURI(simURI1,sessionFactory);
+ if (simRecord1 != null) {
+ System.out.println("Destroying leftover sim record test state:"
+ + simRecord1.getDisplayName());
+ SimPersistTasks.delete(simRecord1, sessionFactory);
+ }
+ } catch (PersistException e) {
+ fail("Unable to tear down:"+e.getMessage());
+ }
+ }
public void setUp() {
super.setUp();
username1 = AccountRecord.cleanUsername("MoonUnitZappa");
@@ -107,68 +112,8 @@
templateRec1.getTemplateID(), sessionFactory);
verifyTemplateProps(templateName1, templateRec1);
- SimRecord simRecord1 = SimPersistTasks.findSimsBySimURI(simURI1,
- sessionFactory);
- if (simRecord1 != null) {
- System.out.println("Destroying leftover sim record test state:"
- + simRecord1.getDisplayName());
- SimPersistTasks.delete(simRecord1, sessionFactory);
- }
- // ok to create sim now on that URI
- simRecord1 = SimPersistTasks.createSim(displayName1, simURI1, 2048,
- true, sessionFactory);
- verifySimProps(simRecord1, displayName1, simURI1, -1, 2048);
+ SpaceRecord spaceRecord1 = checkSpaceAndSimTasks();
- String displayName2 = "moon unit";
- simRecord1.setDisplayName(displayName2);
- SimPersistTasks.update(simRecord1, sessionFactory);
- assertEquals(displayName2, simRecord1.getDisplayName());
- // better test is to load it from db
- SimRecord simRecord2 = SimPersistTasks.findSimsBySimURI(simURI1,
- sessionFactory);
- verifySimProps(simRecord2, displayName2, simURI1, -1, 2048);
-
- // it's the same sim on the same URI so better have same id?
- assertEquals(simRecord1.getSimID(), simRecord2.getSimID());
-
- String spaceName1 = "Space 1";
- SpaceRecord spaceRecord1 = SpacePersistTasks.createSpace(
- spaceName1, "bubkus", sessionFactory);
- assertNull("created space with bogus username", spaceRecord1);
- spaceRecord1 = SpacePersistTasks.createSpace(spaceName1, username1,
- sessionFactory);
- assertNotNull(spaceRecord1);
- assertEquals(spaceName1, spaceRecord1.getDisplayName());
- assertFalse(spaceRecord1.getSpaceID() == -1);
- assertEquals(username1, spaceRecord1.getOwnerUsername());
-
- SpaceRecord spaceRecord2 = SpacePersistTasks.findSpaceBySpaceID(
- spaceRecord1.getSpaceID(), sessionFactory);
- assertEquals(spaceRecord1, spaceRecord2);
-
- SimRecord assignedSimRecord = SpacePersistTasks.findOrAssignSim(
- spaceRecord2, sessionFactory);
- assertNotNull(assignedSimRecord);
- //System.out.println("XXX ASSIGNED TO SIM:"
- // + assignedSimRecord.getSimID() + ","
- // + assignedSimRecord.getSimURI() + " -->\n" + "space was "
- // + spaceRecord2.getSpaceID() + " now on "
- // + spaceRecord2.getSimID() + ","
- // + spaceRecord2.getDisplayName());
- /*
- * IES: I spent a lot of time looking at this and could not see any
- * way to test this given that IES: that assigned sim is random.
- * Apparently, before we were depending on a random number IES:
- * sequence doing something we expected.
- * assertEquals(simRecord1.getSimURI(),
- * assignedSimRecord.getSimURI());
- * assertEquals(simRecord1.getDisplayName(),
- * assignedSimRecord.getDisplayName());
- * assertEquals(simRecord1.getSimID(),
- * assignedSimRecord.getSimID()); assertEquals(simRecord1,
- * assignedSimRecord);
- */
-
BodyRecord bodyRec1 = BodyPersistTasks.createBody(displayName1,
"bogosity", sessionFactory);
assertNull("created body with bogus username", bodyRec1);
@@ -214,7 +159,65 @@
fail("Should have just returned null instead of failed: " + e);
}
}
+ private SpaceRecord checkSpaceAndSimTasks() throws PersistException {
+ SimRecord simRecord1;
+ // ok to create sim now on that URI
+ simRecord1 = SimPersistTasks.createSim(displayName1, simURI1, 2048,
+ true, sessionFactory);
+ verifySimProps(simRecord1, displayName1, simURI1, -1, 2048);
+ String displayName2 = "moon unit";
+ simRecord1.setDisplayName(displayName2);
+ SimPersistTasks.update(simRecord1, sessionFactory);
+ assertEquals(displayName2, simRecord1.getDisplayName());
+ // better test is to load it from db
+ SimRecord simRecord2 = SimPersistTasks.findSimsBySimURI(simURI1,
+ sessionFactory);
+ verifySimProps(simRecord2, displayName2, simURI1, -1, 2048);
+
+ // it's the same sim on the same URI so better have same id?
+ assertEquals(simRecord1.getSimID(), simRecord2.getSimID());
+
+ String spaceName1 = "Space 1";
+ SpaceRecord spaceRecord1 = SpacePersistTasks.createSpace(
+ spaceName1, "bubkus", sessionFactory);
+ assertNull("created space with bogus username", spaceRecord1);
+ spaceRecord1 = SpacePersistTasks.createSpace(spaceName1, username1,
+ sessionFactory);
+ assertNotNull(spaceRecord1);
+ assertEquals(spaceName1, spaceRecord1.getDisplayName());
+ assertFalse(spaceRecord1.getSpaceID() == -1);
+ assertEquals(username1, spaceRecord1.getOwnerUsername());
+
+ SpaceRecord spaceRecord2 = SpacePersistTasks.findSpaceBySpaceID(
+ spaceRecord1.getSpaceID(), sessionFactory);
+ assertEquals(spaceRecord1, spaceRecord2);
+
+ SimRecord assignedSimRecord = SpacePersistTasks.findOrAssignSim(
+ spaceRecord2, sessionFactory);
+ assertNotNull(assignedSimRecord);
+ //System.out.println("XXX ASSIGNED TO SIM:"
+ // + assignedSimRecord.getSimID() + ","
+ // + assignedSimRecord.getSimURI() + " -->\n" + "space was "
+ // + spaceRecord2.getSpaceID() + " now on "
+ // + spaceRecord2.getSimID() + ","
+ // + spaceRecord2.getDisplayName());
+ /*
+ * IES: I spent a lot of time looking at this and could not see any
+ * way to test this given that IES: that assigned sim is random.
+ * Apparently, before we were depending on a random number IES:
+ * sequence doing something we expected.
+ * assertEquals(simRecord1.getSimURI(),
+ * assignedSimRecord.getSimURI());
+ * assertEquals(simRecord1.getDisplayName(),
+ * assignedSimRecord.getDisplayName());
+ * assertEquals(simRecord1.getSimID(),
+ * assignedSimRecord.getSimID()); assertEquals(simRecord1,
+ * assignedSimRecord);
+ */
+ return spaceRecord1;
+ }
+
private void verifySimProps(SimRecord rec, String name, URI uri,
int not_id, int port) {
assertNotNull(rec);
Modified: maven/trunk/ogoglio-server/src/test/java/com/ogoglio/sim/script/test/ScriptTest.java
===================================================================
--- maven/trunk/ogoglio-server/src/test/java/com/ogoglio/sim/script/test/ScriptTest.java 2007-08-27 17:37:49 UTC (rev 269)
+++ maven/trunk/ogoglio-server/src/test/java/com/ogoglio/sim/script/test/ScriptTest.java 2007-08-27 17:39:06 UTC (rev 270)
@@ -4,15 +4,12 @@
import java.io.InputStream;
import java.util.HashMap;
-import javax.media.j3d.Transform3D;
-
import junit.framework.TestCase;
import com.ogoglio.sim.SpaceSimulator;
import com.ogoglio.xml.SpaceDocument;
import com.ogoglio.xml.SpaceEvent;
import com.ogoglio.xml.TemplateDocument;
-import com.ogoglio.xml.ThingDocument;
public class ScriptTest extends TestCase {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ian...@us...> - 2007-08-27 17:37:49
|
Revision: 269
http://ogoglio.svn.sourceforge.net/ogoglio/?rev=269&view=rev
Author: iansmith
Date: 2007-08-27 10:37:49 -0700 (Mon, 27 Aug 2007)
Log Message:
-----------
Minor tweaks to support viewing the applet.
Modified Paths:
--------------
maven/trunk/ogoglio-viewer-applet/src/assemble/common-code.xml
maven/trunk/ogoglio-viewer-applet/src/main/java/com/ogoglio/viewer/applet/AppletTestWindow.java
Modified: maven/trunk/ogoglio-viewer-applet/src/assemble/common-code.xml
===================================================================
--- maven/trunk/ogoglio-viewer-applet/src/assemble/common-code.xml 2007-08-26 23:00:07 UTC (rev 268)
+++ maven/trunk/ogoglio-viewer-applet/src/assemble/common-code.xml 2007-08-27 17:37:49 UTC (rev 269)
@@ -11,6 +11,7 @@
<outputFileNameMapping></outputFileNameMapping>
<includes>
<include>com.ogoglio:ogoglio-common</include>
+ <include>com.ogoglio:ogoglio-viewer-applet</include>
</includes>
</dependencySet>
</dependencySets>
Modified: maven/trunk/ogoglio-viewer-applet/src/main/java/com/ogoglio/viewer/applet/AppletTestWindow.java
===================================================================
--- maven/trunk/ogoglio-viewer-applet/src/main/java/com/ogoglio/viewer/applet/AppletTestWindow.java 2007-08-26 23:00:07 UTC (rev 268)
+++ maven/trunk/ogoglio-viewer-applet/src/main/java/com/ogoglio/viewer/applet/AppletTestWindow.java 2007-08-27 17:37:49 UTC (rev 269)
@@ -60,6 +60,7 @@
}
HashMap parameters1 = new HashMap();
+ System.out.println("HERE FART:"+WebConstants.getBootstrapUsername());
try {
WebAPIAuthenticator authenticator = new WebAPIAuthenticator(new WebAPIClientWire(), new WebAPIDescriptor(new URI(serviceURI)), WebConstants.getBootstrapUsername(), WebConstants.getBootstrapUserPW());
parameters1.put("loginCookie", authenticator.getAuthCookie());
@@ -68,7 +69,7 @@
}
//parameters1.put("loginCookie", "guestApplet_Test_Window2");
- parameters1.put("spaceID", "" + 1);
+ parameters1.put("spaceID", "" + 4);
parameters1.put("serviceURI", serviceURI);
//parameters1.put("x", "0");
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ian...@us...> - 2007-08-27 16:27:36
|
Revision: 265
http://ogoglio.svn.sourceforge.net/ogoglio/?rev=265&view=rev
Author: iansmith
Date: 2007-08-26 15:57:26 -0700 (Sun, 26 Aug 2007)
Log Message:
-----------
Added avatar resources to SVN.
Added Paths:
-----------
maven/trunk/ogoglio-common/src/main/resources/avatar/
maven/trunk/ogoglio-common/src/main/resources/avatar/Eyes1.gif
maven/trunk/ogoglio-common/src/main/resources/avatar/Eyes2.gif
maven/trunk/ogoglio-common/src/main/resources/avatar/LeftArrow.gif
maven/trunk/ogoglio-common/src/main/resources/avatar/LeftArrowDisabled.gif
maven/trunk/ogoglio-common/src/main/resources/avatar/Mouth1.gif
maven/trunk/ogoglio-common/src/main/resources/avatar/Mouth2.gif
maven/trunk/ogoglio-common/src/main/resources/avatar/Nose1.gif
maven/trunk/ogoglio-common/src/main/resources/avatar/Nose2.gif
maven/trunk/ogoglio-common/src/main/resources/avatar/RightArrow.gif
maven/trunk/ogoglio-common/src/main/resources/avatar/RightArrowDisabled.gif
maven/trunk/ogoglio-common/src/main/resources/avatar/avatar-point.bvh
maven/trunk/ogoglio-common/src/main/resources/avatar/avatar-walk.bvh
maven/trunk/ogoglio-common/src/main/resources/avatar/avatar-wave.bvh
maven/trunk/ogoglio-common/src/main/resources/avatar/avatar.bvh
maven/trunk/ogoglio-common/src/main/resources/avatar/avatar.jpg
maven/trunk/ogoglio-common/src/main/resources/avatar/avatar.smap
maven/trunk/ogoglio-common/src/main/resources/avatar/avatar1.jpg
maven/trunk/ogoglio-common/src/main/resources/avatar/license.txt
Added: maven/trunk/ogoglio-common/src/main/resources/avatar/Eyes1.gif
===================================================================
(Binary files differ)
Property changes on: maven/trunk/ogoglio-common/src/main/resources/avatar/Eyes1.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: maven/trunk/ogoglio-common/src/main/resources/avatar/Eyes2.gif
===================================================================
(Binary files differ)
Property changes on: maven/trunk/ogoglio-common/src/main/resources/avatar/Eyes2.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: maven/trunk/ogoglio-common/src/main/resources/avatar/LeftArrow.gif
===================================================================
(Binary files differ)
Property changes on: maven/trunk/ogoglio-common/src/main/resources/avatar/LeftArrow.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: maven/trunk/ogoglio-common/src/main/resources/avatar/LeftArrowDisabled.gif
===================================================================
(Binary files differ)
Property changes on: maven/trunk/ogoglio-common/src/main/resources/avatar/LeftArrowDisabled.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: maven/trunk/ogoglio-common/src/main/resources/avatar/Mouth1.gif
===================================================================
(Binary files differ)
Property changes on: maven/trunk/ogoglio-common/src/main/resources/avatar/Mouth1.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: maven/trunk/ogoglio-common/src/main/resources/avatar/Mouth2.gif
===================================================================
(Binary files differ)
Property changes on: maven/trunk/ogoglio-common/src/main/resources/avatar/Mouth2.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: maven/trunk/ogoglio-common/src/main/resources/avatar/Nose1.gif
===================================================================
(Binary files differ)
Property changes on: maven/trunk/ogoglio-common/src/main/resources/avatar/Nose1.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: maven/trunk/ogoglio-common/src/main/resources/avatar/Nose2.gif
===================================================================
(Binary files differ)
Property changes on: maven/trunk/ogoglio-common/src/main/resources/avatar/Nose2.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: maven/trunk/ogoglio-common/src/main/resources/avatar/RightArrow.gif
===================================================================
(Binary files differ)
Property changes on: maven/trunk/ogoglio-common/src/main/resources/avatar/RightArrow.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: maven/trunk/ogoglio-common/src/main/resources/avatar/RightArrowDisabled.gif
===================================================================
(Binary files differ)
Property changes on: maven/trunk/ogoglio-common/src/main/resources/avatar/RightArrowDisabled.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: maven/trunk/ogoglio-common/src/main/resources/avatar/avatar-point.bvh
===================================================================
--- maven/trunk/ogoglio-common/src/main/resources/avatar/avatar-point.bvh (rev 0)
+++ maven/trunk/ogoglio-common/src/main/resources/avatar/avatar-point.bvh 2007-08-26 22:57:26 UTC (rev 265)
@@ -0,0 +1,168 @@
+HIERARCHY
+ROOT Neck
+{
+ OFFSET 0.000000 1.413067 0.000000
+ CHANNELS 6 Xposition Yposition Zposition Zrotation Xrotation Yrotation
+ JOINT Head
+ {
+ OFFSET 0.000000 0.288233 0.000000
+ CHANNELS 3 Zrotation Xrotation Yrotation
+ End Site
+ {
+ OFFSET -0.000840 0.240359 0.000000
+ }
+ }
+ JOINT LeftShoulder
+ {
+ OFFSET 0.000000 0.000000 0.000000
+ CHANNELS 3 Zrotation Xrotation Yrotation
+ JOINT LeftArm
+ {
+ OFFSET 0.272146 0.057570 0.000000
+ CHANNELS 3 Zrotation Xrotation Yrotation
+ JOINT LeftForearm
+ {
+ OFFSET 0.272146 -0.073270 0.000000
+ CHANNELS 3 Zrotation Xrotation Yrotation
+ End Site
+ {
+ OFFSET 0.382052 -0.120372 0.000000
+ }
+ }
+ }
+ }
+ JOINT Trunk
+ {
+ OFFSET 0.000000 0.000000 0.000000
+ CHANNELS 3 Zrotation Xrotation Yrotation
+ JOINT LeftHip
+ {
+ OFFSET 0.015701 -0.481489 0.000000
+ CHANNELS 3 Zrotation Xrotation Yrotation
+ JOINT LeftThigh
+ {
+ OFFSET 0.115208 -0.062803 0.000000
+ CHANNELS 3 Zrotation Xrotation Yrotation
+ JOINT LeftShin
+ {
+ OFFSET 0.007551 -0.350650 0.036635
+ CHANNELS 3 Zrotation Xrotation Yrotation
+ JOINT LeftFoot
+ {
+ OFFSET -0.000000 -0.434387 -0.026168
+ CHANNELS 3 Zrotation Xrotation Yrotation
+ End Site
+ {
+ OFFSET 0.000000 -0.020934 0.225044
+ }
+ }
+ }
+ }
+ }
+ JOINT RightHip
+ {
+ OFFSET 0.015701 -0.481489 0.000000
+ CHANNELS 3 Zrotation Xrotation Yrotation
+ JOINT RightThigh
+ {
+ OFFSET -0.130840 -0.078504 0.000000
+ CHANNELS 3 Zrotation Xrotation Yrotation
+ JOINT RightShin
+ {
+ OFFSET -0.015701 -0.355884 0.000000
+ CHANNELS 3 Zrotation Xrotation Yrotation
+ JOINT RightFoot
+ {
+ OFFSET -0.015701 -0.392518 0.000000
+ CHANNELS 3 Zrotation Xrotation Yrotation
+ End Site
+ {
+ OFFSET 0.009601 -0.046108 0.244754
+ }
+ }
+ }
+ }
+ }
+ }
+ JOINT RightShoulder
+ {
+ OFFSET 0.000000 0.000000 0.000000
+ CHANNELS 3 Zrotation Xrotation Yrotation
+ JOINT RightArm
+ {
+ OFFSET -0.240745 0.062803 0.000000
+ CHANNELS 3 Zrotation Xrotation Yrotation
+ JOINT RightForearm
+ {
+ OFFSET -0.277380 -0.073270 0.000000
+ CHANNELS 3 Zrotation Xrotation Yrotation
+ End Site
+ {
+ OFFSET -0.387286 -0.130840 0.000000
+ }
+ }
+ }
+ }
+}
+MOTION
+Frames: 59
+Frame Time: 0.040000
+0.000000 1.413067 0.000000 0.000000 0.000000 -0.000000 -0.000000 0.000000 0.000000 0.000001 -0.000002 0.000000 -69.566444 3.475644 9.382329 -0.000008 -0.000000 -0.000007 0.000000 0.000000 -0.000001 -0.000009 0.000002 0.000001 0.000009 -10.000010 0.000007 0.000005 0.000001 -0.000003 0.000002 9.999999 -0.000002 -0.000002 0.000000 -0.000000 0.000009 10.000000 0.000001 0.000002 -0.000000 0.000004 -0.000006 -9.999991 -0.000000 -0.000003 0.000000 0.000000 68.751213 -3.608197 9.332540 0.453265 0.000314 0.079923
+0.000000 1.413067 0.000000 0.000000 0.000000 -0.000000 -0.000000 0.000000 0.000000 0.000001 -0.000002 0.000000 -69.566444 3.475644 9.382329 -0.000008 -0.000000 -0.000007 0.000000 0.000000 -0.000001 -0.000009 0.000002 0.000001 0.000009 -10.000010 0.000007 0.000005 0.000001 -0.000003 0.000002 9.999999 -0.000002 -0.000002 0.000000 -0.000000 0.000009 10.000000 0.000001 0.000002 -0.000000 0.000004 -0.000006 -9.999991 -0.000000 -0.000003 0.000000 0.000000 68.625801 -4.314910 11.116751 0.450353 0.000380 0.095028
+0.000000 1.413067 0.000000 0.000000 0.000000 -0.000000 -0.000000 0.000000 0.000000 0.000001 -0.000002 0.000000 -69.566444 3.475644 9.382329 -0.000008 -0.000000 -0.000007 0.000000 0.000000 -0.000001 -0.000009 0.000002 0.000001 0.000009 -10.000010 0.000007 0.000005 0.000001 -0.000003 0.000002 9.999999 -0.000002 -0.000002 0.000000 -0.000000 0.000009 10.000000 0.000001 0.000002 -0.000000 0.000004 -0.000006 -9.999991 -0.000000 -0.000003 0.000000 0.000000 68.092926 -6.539802 16.567228 0.438296 0.000549 0.140530
+0.000000 1.413067 0.000000 0.000000 0.000000 -0.000000 -0.000000 0.000000 0.000000 0.000001 -0.000002 0.000000 -69.566444 3.475644 9.382329 -0.000008 -0.000000 -0.000007 0.000000 0.000000 -0.000001 -0.000009 0.000002 0.000001 0.000009 -10.000010 0.000007 0.000005 0.000001 -0.000003 0.000002 9.999999 -0.000002 -0.000002 0.000000 -0.000000 0.000009 10.000000 0.000001 0.000002 -0.000000 0.000004 -0.000006 -9.999991 -0.000000 -0.000003 0.000000 0.000000 66.647392 -10.548810 25.556679 0.408225 0.000779 0.212617
+0.000000 1.413067 0.000000 0.000000 0.000000 -0.000000 -0.000000 0.000000 0.000000 0.000001 -0.000002 0.000000 -69.566444 3.475644 9.382329 -0.000008 -0.000000 -0.000007 0.000000 0.000000 -0.000001 -0.000009 0.000002 0.000001 0.000009 -10.000010 0.000007 0.000005 0.000001 -0.000003 0.000002 9.999999 -0.000002 -0.000002 0.000000 -0.000000 0.000009 10.000000 0.000001 0.000002 -0.000000 0.000004 -0.000006 -9.999991 -0.000000 -0.000003 0.000000 0.000000 63.339909 -16.868151 37.157478 0.351043 0.000920 0.297681
+0.000000 1.413067 0.000000 0.000000 0.000000 -0.000000 -0.000000 0.000000 0.000000 0.000001 -0.000002 0.000000 -69.566444 3.475644 9.382329 -0.000008 -0.000000 -0.000007 0.000000 0.000000 -0.000001 -0.000009 0.000002 0.000001 0.000009 -10.000010 0.000007 0.000005 0.000001 -0.000003 0.000002 9.999999 -0.000002 -0.000002 0.000000 -0.000000 0.000009 10.000000 0.000001 0.000002 -0.000000 0.000004 -0.000006 -9.999991 -0.000000 -0.000003 0.000000 0.000000 56.742085 -26.435978 49.301502 0.268750 0.000888 0.373657
+0.000000 1.413067 0.000000 0.000000 0.000000 -0.000000 -0.000000 0.000000 0.000000 0.000001 -0.000002 0.000000 -69.566444 3.475644 9.382329 -0.000008 -0.000000 -0.000007 0.000000 0.000000 -0.000001 -0.000009 0.000002 0.000001 0.000009 -10.000010 0.000007 0.000005 0.000001 -0.000003 0.000002 9.999999 -0.000002 -0.000002 0.000000 -0.000000 0.000009 10.000000 0.000001 0.000002 -0.000000 0.000004 -0.000006 -9.999991 -0.000000 -0.000003 0.000000 0.000000 45.511955 -40.189003 59.314606 0.179440 0.000663 0.423851
+0.000000 1.413067 0.000000 0.000000 0.000000 -0.000000 -0.000000 0.000000 0.000000 0.000001 -0.000002 0.000000 -69.566444 3.475644 9.382329 -0.000008 -0.000000 -0.000007 0.000000 0.000000 -0.000001 -0.000009 0.000002 0.000001 0.000009 -10.000010 0.000007 0.000005 0.000001 -0.000003 0.000002 9.999999 -0.000002 -0.000002 0.000000 -0.000000 0.000009 10.000000 0.000001 0.000002 -0.000000 0.000004 -0.000006 -9.999991 -0.000000 -0.000003 0.000000 0.000000 30.843445 -56.701481 65.384270 0.105249 0.000413 0.448068
+0.000000 1.413067 0.000000 0.000000 0.000000 -0.000000 -0.000000 0.000000 0.000000 0.000001 -0.000002 0.000000 -69.566444 3.475644 9.382329 -0.000008 -0.000000 -0.000007 0.000000 0.000000 -0.000001 -0.000009 0.000002 0.000001 0.000009 -10.000010 0.000007 0.000005 0.000001 -0.000003 0.000002 9.999999 -0.000002 -0.000002 0.000000 -0.000000 0.000009 10.000000 0.000001 0.000002 -0.000000 0.000004 -0.000006 -9.999991 -0.000000 -0.000003 0.000000 0.000000 18.505310 -70.131149 67.844505 0.058994 0.000241 0.456470
+0.000000 1.413067 0.000000 0.000000 0.000000 -0.000000 -0.000000 0.000000 0.000000 0.000001 -0.000002 0.000000 -69.566444 3.475644 9.382329 -0.000008 -0.000000 -0.000007 0.000000 0.000000 -0.000001 -0.000009 0.000002 0.000001 0.000009 -10.000010 0.000007 0.000005 0.000001 -0.000003 0.000002 9.999999 -0.000002 -0.000002 0.000000 -0.000000 0.000009 10.000000 0.000001 0.000002 -0.000000 0.000004 -0.000006 -9.999991 -0.000000 -0.000003 0.000000 0.000000 13.933969 -75.057091 68.379097 0.043734 0.000168 0.458187
+0.000000 1.413067 0.000000 0.000000 0.000000 -0.000000 -0.000000 0.000000 0.000000 0.000001 -0.000002 0.000000 -69.566444 3.475644 9.382329 -0.000008 -0.000000 -0.000007 0.000000 0.000000 -0.000001 -0.000009 0.000002 0.000001 0.000009 -10.000010 0.000007 0.000005 0.000001 -0.000003 0.000002 9.999999 -0.000002 -0.000002 0.000000 -0.000000 0.000009 10.000000 0.000001 0.000002 -0.000000 0.000004 -0.000006 -9.999991 -0.000000 -0.000003 0.000000 0.000000 13.933969 -75.057091 68.379097 0.043734 0.000168 0.458187
+0.000000 1.413067 0.000000 0.000000 0.000000 -0.000000 -0.000000 0.000000 0.000000 0.000001 -0.000002 0.000000 -69.566444 3.475644 9.382329 -0.000008 -0.000000 -0.000007 0.000000 0.000000 -0.000001 -0.000009 0.000002 0.000001 0.000009 -10.000010 0.000007 0.000005 0.000001 -0.000003 0.000002 9.999999 -0.000002 -0.000002 0.000000 -0.000000 0.000009 10.000000 0.000001 0.000002 -0.000000 0.000004 -0.000006 -9.999991 -0.000000 -0.000003 0.000000 0.000000 13.933969 -75.057091 68.379097 0.043734 0.000168 0.458187
+0.000000 1.413067 0.000000 0.000000 0.000000 -0.000000 -0.000000 0.000000 0.000000 0.000001 -0.000002 0.000000 -69.566444 3.475644 9.382329 -0.000008 -0.000000 -0.000007 0.000000 0.000000 -0.000001 -0.000009 0.000002 0.000001 0.000009 -10.000010 0.000007 0.000005 0.000001 -0.000003 0.000002 9.999999 -0.000002 -0.000002 0.000000 -0.000000 0.000009 10.000000 0.000001 0.000002 -0.000000 0.000004 -0.000006 -9.999991 -0.000000 -0.000003 0.000000 0.000000 13.933969 -75.057091 68.379097 0.043734 0.000168 0.458187
+0.000000 1.413067 0.000000 0.000000 0.000000 -0.000000 -0.000000 0.000000 0.000000 0.000001 -0.000002 0.000000 -69.566444 3.475644 9.382329 -0.000008 -0.000000 -0.000007 0.000000 0.000000 -0.000001 -0.000009 0.000002 0.000001 0.000009 -10.000010 0.000007 0.000005 0.000001 -0.000003 0.000002 9.999999 -0.000002 -0.000002 0.000000 -0.000000 0.000009 10.000000 0.000001 0.000002 -0.000000 0.000004 -0.000006 -9.999991 -0.000000 -0.000003 0.000000 0.000000 13.933969 -75.057091 68.379097 0.043734 0.000168 0.458187
+0.000000 1.413067 0.000000 0.000000 0.000000 -0.000000 -0.000000 0.000000 0.000000 0.000001 -0.000002 0.000000 -69.566444 3.475644 9.382329 -0.000008 -0.000000 -0.000007 0.000000 0.000000 -0.000001 -0.000009 0.000002 0.000001 0.000009 -10.000010 0.000007 0.000005 0.000001 -0.000003 0.000002 9.999999 -0.000002 -0.000002 0.000000 -0.000000 0.000009 10.000000 0.000001 0.000002 -0.000000 0.000004 -0.000006 -9.999991 -0.000000 -0.000003 0.000000 0.000000 13.933969 -75.057091 68.379097 0.043734 0.000168 0.458187
+0.000000 1.413067 0.000000 0.000000 0.000000 -0.000000 -0.000000 0.000000 0.000000 0.000001 -0.000002 0.000000 -69.566444 3.475644 9.382329 -0.000008 -0.000000 -0.000007 0.000000 0.000000 -0.000001 -0.000009 0.000002 0.000001 0.000009 -10.000010 0.000007 0.000005 0.000001 -0.000003 0.000002 9.999999 -0.000002 -0.000002 0.000000 -0.000000 0.000009 10.000000 0.000001 0.000002 -0.000000 0.000004 -0.000006 -9.999991 -0.000000 -0.000003 0.000000 0.000000 13.933969 -75.057091 68.379097 0.043734 0.000168 0.458187
+0.000000 1.413067 0.000000 0.000000 0.000000 -0.000000 -0.000000 0.000000 0.000000 0.000001 -0.000002 0.000000 -69.566444 3.475644 9.382329 -0.000008 -0.000000 -0.000007 0.000000 0.000000 -0.000001 -0.000009 0.000002 0.000001 0.000009 -10.000010 0.000007 0.000005 0.000001 -0.000003 0.000002 9.999999 -0.000002 -0.000002 0.000000 -0.000000 0.000009 10.000000 0.000001 0.000002 -0.000000 0.000004 -0.000006 -9.999991 -0.000000 -0.000003 0.000000 0.000000 13.933969 -75.057091 68.379097 0.043734 0.000168 0.458187
+0.000000 1.413067 0.000000 0.000000 0.000000 -0.000000 -0.000000 0.000000 0.000000 0.000001 -0.000002 0.000000 -69.566444 3.475644 9.382329 -0.000008 -0.000000 -0.000007 0.000000 0.000000 -0.000001 -0.000009 0.000002 0.000001 0.000009 -10.000010 0.000007 0.000005 0.000001 -0.000003 0.000002 9.999999 -0.000002 -0.000002 0.000000 -0.000000 0.000009 10.000000 0.000001 0.000002 -0.000000 0.000004 -0.000006 -9.999991 -0.000000 -0.000003 0.000000 0.000000 13.933969 -75.057091 68.379097 0.043734 0.000168 0.458187
+0.000000 1.413067 0.000000 0.000000 0.000000 -0.000000 -0.000000 0.000000 0.000000 0.000001 -0.000002 0.000000 -69.566444 3.475644 9.382329 -0.000008 -0.000000 -0.000007 0.000000 0.000000 -0.000001 -0.000009 0.000002 0.000001 0.000009 -10.000010 0.000007 0.000005 0.000001 -0.000003 0.000002 9.999999 -0.000002 -0.000002 0.000000 -0.000000 0.000009 10.000000 0.000001 0.000002 -0.000000 0.000004 -0.000006 -9.999991 -0.000000 -0.000003 0.000000 0.000000 13.933969 -75.057091 68.379097 0.043734 0.000168 0.458187
+0.000000 1.413067 0.000000 0.000000 0.000000 -0.000000 -0.000000 0.000000 0.000000 0.000001 -0.000002 0.000000 -69.566444 3.475644 9.382329 -0.000008 -0.000000 -0.000007 0.000000 0.000000 -0.000001 -0.000009 0.000002 0.000001 0.000009 -10.000010 0.000007 0.000005 0.000001 -0.000003 0.000002 9.999999 -0.000002 -0.000002 0.000000 -0.000000 0.000009 10.000000 0.000001 0.000002 -0.000000 0.000004 -0.000006 -9.999991 -0.000000 -0.000003 0.000000 0.000000 13.933969 -75.057091 68.379097 0.043734 0.000168 0.458187
+0.000000 1.413067 0.000000 0.000000 0.000000 -0.000000 -0.000000 0.000000 0.000000 0.000001 -0.000002 0.000000 -69.566444 3.475644 9.382329 -0.000008 -0.000000 -0.000007 0.000000 0.000000 -0.000001 -0.000009 0.000002 0.000001 0.000009 -10.000010 0.000007 0.000005 0.000001 -0.000003 0.000002 9.999999 -0.000002 -0.000002 0.000000 -0.000000 0.000009 10.000000 0.000001 0.000002 -0.000000 0.000004 -0.000006 -9.999991 -0.000000 -0.000003 0.000000 0.000000 13.933969 -75.057091 68.379097 0.043734 0.000168 0.458187
+0.000000 1.413067 0.000000 0.000000 0.000000 -0.000000 -0.000000 0.000000 0.000000 0.000001 -0.000002 0.000000 -69.566444 3.475644 9.382329 -0.000008 -0.000000 -0.000007 0.000000 0.000000 -0.000001 -0.000009 0.000002 0.000001 0.000009 -10.000010 0.000007 0.000005 0.000001 -0.000003 0.000002 9.999999 -0.000002 -0.000002 0.000000 -0.000000 0.000009 10.000000 0.000001 0.000002 -0.000000 0.000004 -0.000006 -9.999991 -0.000000 -0.000003 0.000000 0.000000 13.933969 -75.057091 68.379097 0.043734 0.000168 0.458187
+0.000000 1.413067 0.000000 0.000000 0.000000 -0.000000 -0.000000 0.000000 0.000000 0.000001 -0.000002 0.000000 -69.566444 3.475644 9.382329 -0.000008 -0.000000 -0.000007 0.000000 0.000000 -0.000001 -0.000009 0.000002 0.000001 0.000009 -10.000010 0.000007 0.000005 0.000001 -0.000003 0.000002 9.999999 -0.000002 -0.000002 0.000000 -0.000000 0.000009 10.000000 0.000001 0.000002 -0.000000 0.000004 -0.000006 -9.999991 -0.000000 -0.000003 0.000000 0.000000 13.933969 -75.057091 68.379097 0.043734 0.000168 0.458187
+0.000000 1.413067 0.000000 0.000000 0.000000 -0.000000 -0.000000 0.000000 0.000000 0.000001 -0.000002 0.000000 -69.566444 3.475644 9.382329 -0.000008 -0.000000 -0.000007 0.000000 0.000000 -0.000001 -0.000009 0.000002 0.000001 0.000009 -10.000010 0.000007 0.000005 0.000001 -0.000003 0.000002 9.999999 -0.000002 -0.000002 0.000000 -0.000000 0.000009 10.000000 0.000001 0.000002 -0.000000 0.000004 -0.000006 -9.999991 -0.000000 -0.000003 0.000000 0.000000 13.933969 -75.057091 68.379097 0.043734 0.000168 0.458187
+0.000000 1.413067 0.000000 0.000000 0.000000 -0.000000 -0.000000 0.000000 0.000000 0.000001 -0.000002 0.000000 -69.566444 3.475644 9.382329 -0.000008 -0.000000 -0.000007 0.000000 0.000000 -0.000001 -0.000009 0.000002 0.000001 0.000009 -10.000010 0.000007 0.000005 0.000001 -0.000003 0.000002 9.999999 -0.000002 -0.000002 0.000000 -0.000000 0.000009 10.000000 0.000001 0.000002 -0.000000 0.000004 -0.000006 -9.999991 -0.000000 -0.000003 0.000000 0.000000 13.933969 -75.057091 68.379097 0.043734 0.000168 0.458187
+0.000000 1.413067 0.000000 0.000000 0.000000 -0.000000 -0.000000 0.000000 0.000000 0.000001 -0.000002 0.000000 -69.566444 3.475644 9.382329 -0.000008 -0.000000 -0.000007 0.000000 0.000000 -0.000001 -0.000009 0.000002 0.000001 0.000009 -10.000010 0.000007 0.000005 0.000001 -0.000003 0.000002 9.999999 -0.000002 -0.000002 0.000000 -0.000000 0.000009 10.000000 0.000001 0.000002 -0.000000 0.000004 -0.000006 -9.999991 -0.000000 -0.000003 0.000000 0.000000 13.933969 -75.057091 68.379097 0.043734 0.000168 0.458187
+0.000000 1.413067 0.000000 0.000000 0.000000 -0.000000 -0.000000 0.000000 0.000000 0.000001 -0.000002 0.000000 -69.566444 3.475644 9.382329 -0.000008 -0.000000 -0.000007 0.000000 0.000000 -0.000001 -0.000009 0.000002 0.000001 0.000009 -10.000010 0.000007 0.000005 0.000001 -0.000003 0.000002 9.999999 -0.000002 -0.000002 0.000000 -0.000000 0.000009 10.000000 0.000001 0.000002 -0.000000 0.000004 -0.000006 -9.999991 -0.000000 -0.000003 0.000000 0.000000 13.933969 -75.057091 68.379097 0.043734 0.000168 0.458187
+0.000000 1.413067 0.000000 0.000000 0.000000 -0.000000 -0.000000 0.000000 0.000000 0.000001 -0.000002 0.000000 -69.566444 3.475644 9.382329 -0.000008 -0.000000 -0.000007 0.000000 0.000000 -0.000001 -0.000009 0.000002 0.000001 0.000009 -10.000010 0.000007 0.000005 0.000001 -0.000003 0.000002 9.999999 -0.000002 -0.000002 0.000000 -0.000000 0.000009 10.000000 0.000001 0.000002 -0.000000 0.000004 -0.000006 -9.999991 -0.000000 -0.000003 0.000000 0.000000 13.933969 -75.057091 68.379097 0.043734 0.000168 0.458187
+0.000000 1.413067 0.000000 0.000000 0.000000 -0.000000 -0.000000 0.000000 0.000000 0.000001 -0.000002 0.000000 -69.566444 3.475644 9.382329 -0.000008 -0.000000 -0.000007 0.000000 0.000000 -0.000001 -0.000009 0.000002 0.000001 0.000009 -10.000010 0.000007 0.000005 0.000001 -0.000003 0.000002 9.999999 -0.000002 -0.000002 0.000000 -0.000000 0.000009 10.000000 0.000001 0.000002 -0.000000 0.000004 -0.000006 -9.999991 -0.000000 -0.000003 0.000000 0.000000 13.933969 -75.057091 68.379097 0.043734 0.000168 0.458187
+0.000000 1.413067 0.000000 0.000000 0.000000 -0.000000 -0.000000 0.000000 0.000000 0.000001 -0.000002 0.000000 -69.566444 3.475644 9.382329 -0.000008 -0.000000 -0.000007 0.000000 0.000000 -0.000001 -0.000009 0.000002 0.000001 0.000009 -10.000010 0.000007 0.000005 0.000001 -0.000003 0.000002 9.999999 -0.000002 -0.000002 0.000000 -0.000000 0.000009 10.000000 0.000001 0.000002 -0.000000 0.000004 -0.000006 -9.999991 -0.000000 -0.000003 0.000000 0.000000 13.933969 -75.057091 68.379097 0.043734 0.000168 0.458187
+0.000000 1.413067 0.000000 0.000000 0.000000 -0.000000 -0.000000 0.000000 0.000000 0.000001 -0.000002 0.000000 -69.566444 3.475644 9.382329 -0.000008 -0.000000 -0.000007 0.000000 0.000000 -0.000001 -0.000009 0.000002 0.000001 0.000009 -10.000010 0.000007 0.000005 0.000001 -0.000003 0.000002 9.999999 -0.000002 -0.000002 0.000000 -0.000000 0.000009 10.000000 0.000001 0.000002 -0.000000 0.000004 -0.000006 -9.999991 -0.000000 -0.000003 0.000000 0.000000 13.933969 -75.057091 68.379097 0.043734 0.000168 0.458187
+0.000000 1.413067 0.000000 0.000000 0.000000 -0.000000 -0.000000 0.000000 0.000000 0.000001 -0.000002 0.000000 -69.566444 3.475644 9.382329 -0.000008 -0.000000 -0.000007 0.000000 0.000000 -0.000001 -0.000009 0.000002 0.000001 0.000009 -10.000010 0.000007 0.000005 0.000001 -0.000003 0.000002 9.999999 -0.000002 -0.000002 0.000000 -0.000000 0.000009 10.000000 0.000001 0.000002 -0.000000 0.000004 -0.000006 -9.999991 -0.000000 -0.000003 0.000000 0.000000 13.933969 -75.057091 68.379097 0.043734 0.000168 0.458187
+0.000000 1.413067 0.000000 0.000000 0.000000 -0.000000 -0.000000 0.000000 0.000000 0.000001 -0.000002 0.000000 -69.566444 3.475644 9.382329 -0.000008 -0.000000 -0.000007 0.000000 0.000000 -0.000001 -0.000009 0.000002 0.000001 0.000009 -10.000010 0.000007 0.000005 0.000001 -0.000003 0.000002 9.999999 -0.000002 -0.000002 0.000000 -0.000000 0.000009 10.000000 0.000001 0.000002 -0.000000 0.000004 -0.000006 -9.999991 -0.000000 -0.000003 0.000000 0.000000 13.933969 -75.057091 68.379097 0.043734 0.000168 0.458187
+0.000000 1.413067 0.000000 0.000000 0.000000 -0.000000 -0.000000 0.000000 0.000000 0.000001 -0.000002 0.000000 -69.566444 3.475644 9.382329 -0.000008 -0.000000 -0.000007 0.000000 0.000000 -0.000001 -0.000009 0.000002 0.000001 0.000009 -10.000010 0.000007 0.000005 0.000001 -0.000003 0.000002 9.999999 -0.000002 -0.000002 0.000000 -0.000000 0.000009 10.000000 0.000001 0.000002 -0.000000 0.000004 -0.000006 -9.999991 -0.000000 -0.000003 0.000000 0.000000 13.933969 -75.057091 68.379097 0.043734 0.000168 0.458187
+0.000000 1.413067 0.000000 0.000000 0.000000 -0.000000 -0.000000 0.000000 0.000000 0.000001 -0.000002 0.000000 -69.566444 3.475644 9.382329 -0.000008 -0.000000 -0.000007 0.000000 0.000000 -0.000001 -0.000009 0.000002 0.000001 0.000009 -10.000010 0.000007 0.000005 0.000001 -0.000003 0.000002 9.999999 -0.000002 -0.000002 0.000000 -0.000000 0.000009 10.000000 0.000001 0.000002 -0.000000 0.000004 -0.000006 -9.999991 -0.000000 -0.000003 0.000000 0.000000 13.933969 -75.057091 68.379097 0.043734 0.000168 0.458187
+0.000000 1.413067 0.000000 0.000000 0.000000 -0.000000 -0.000000 0.000000 0.000000 0.000001 -0.000002 0.000000 -69.566444 3.475644 9.382329 -0.000008 -0.000000 -0.000007 0.000000 0.000000 -0.000001 -0.000009 0.000002 0.000001 0.000009 -10.000010 0.000007 0.000005 0.000001 -0.000003 0.000002 9.999999 -0.000002 -0.000002 0.000000 -0.000000 0.000009 10.000000 0.000001 0.000002 -0.000000 0.000004 -0.000006 -9.999991 -0.000000 -0.000003 0.000000 0.000000 13.933969 -75.057091 68.379097 0.043734 0.000168 0.458187
+0.000000 1.413067 0.000000 0.000000 0.000000 -0.000000 -0.000000 0.000000 0.000000 0.000001 -0.000002 0.000000 -69.566444 3.475644 9.382329 -0.000008 -0.000000 -0.000007 0.000000 0.000000 -0.000001 -0.000009 0.000002 0.000001 0.000009 -10.000010 0.000007 0.000005 0.000001 -0.000003 0.000002 9.999999 -0.000002 -0.000002 0.000000 -0.000000 0.000009 10.000000 0.000001 0.000002 -0.000000 0.000004 -0.000006 -9.999991 -0.000000 -0.000003 0.000000 0.000000 13.933969 -75.057091 68.379097 0.043734 0.000168 0.458187
+0.000000 1.413067 0.000000 0.000000 0.000000 -0.000000 -0.000000 0.000000 0.000000 0.000001 -0.000002 0.000000 -69.566444 3.475644 9.382329 -0.000008 -0.000000 -0.000007 0.000000 0.000000 -0.000001 -0.000009 0.000002 0.000001 0.000009 -10.000010 0.000007 0.000005 0.000001 -0.000003 0.000002 9.999999 -0.000002 -0.000002 0.000000 -0.000000 0.000009 10.000000 0.000001 0.000002 -0.000000 0.000004 -0.000006 -9.999991 -0.000000 -0.000003 0.000000 0.000000 13.933969 -75.057091 68.379097 0.043734 0.000168 0.458187
+0.000000 1.413067 0.000000 0.000000 0.000000 -0.000000 -0.000000 0.000000 0.000000 0.000001 -0.000002 0.000000 -69.566444 3.475644 9.382329 -0.000008 -0.000000 -0.000007 0.000000 0.000000 -0.000001 -0.000009 0.000002 0.000001 0.000009 -10.000010 0.000007 0.000005 0.000001 -0.000003 0.000002 9.999999 -0.000002 -0.000002 0.000000 -0.000000 0.000009 10.000000 0.000001 0.000002 -0.000000 0.000004 -0.000006 -9.999991 -0.000000 -0.000003 0.000000 0.000000 13.933969 -75.057091 68.379097 0.043734 0.000168 0.458187
+0.000000 1.413067 0.000000 0.000000 0.000000 -0.000000 -0.000000 0.000000 0.000000 0.000001 -0.000002 0.000000 -69.566444 3.475644 9.382329 -0.000008 -0.000000 -0.000007 0.000000 0.000000 -0.000001 -0.000009 0.000002 0.000001 0.000009 -10.000010 0.000007 0.000005 0.000001 -0.000003 0.000002 9.999999 -0.000002 -0.000002 0.000000 -0.000000 0.000009 10.000000 0.000001 0.000002 -0.000000 0.000004 -0.000006 -9.999991 -0.000000 -0.000003 0.000000 0.000000 13.933969 -75.057091 68.379097 0.043734 0.000168 0.458187
+0.000000 1.413067 0.000000 0.000000 0.000000 -0.000000 -0.000000 0.000000 0.000000 0.000001 -0.000002 0.000000 -69.566444 3.475644 9.382329 -0.000008 -0.000000 -0.000007 0.000000 0.000000 -0.000001 -0.000009 0.000002 0.000001 0.000009 -10.000010 0.000007 0.000005 0.000001 -0.000003 0.000002 9.999999 -0.000002 -0.000002 0.000000 -0.000000 0.000009 10.000000 0.000001 0.000002 -0.000000 0.000004 -0.000006 -9.999991 -0.000000 -0.000003 0.000000 0.000000 13.933969 -75.057091 68.379097 0.043734 0.000168 0.458187
+0.000000 1.413067 0.000000 0.000000 0.000000 -0.000000 -0.000000 0.000000 0.000000 0.000001 -0.000002 0.000000 -69.566444 3.475644 9.382329 -0.000008 -0.000000 -0.000007 0.000000 0.000000 -0.000001 -0.000009 0.000002 0.000001 0.000009 -10.000010 0.000007 0.000005 0.000001 -0.000003 0.000002 9.999999 -0.000002 -0.000002 0.000000 -0.000000 0.000009 10.000000 0.000001 0.000002 -0.000000 0.000004 -0.000006 -9.999991 -0.000000 -0.000003 0.000000 0.000000 13.933969 -75.057091 68.379097 0.043734 0.000168 0.458187
+0.000000 1.413067 0.000000 0.000000 0.000000 -0.000000 -0.000000 0.000000 0.000000 0.000001 -0.000002 0.000000 -69.566444 3.475644 9.382329 -0.000008 -0.000000 -0.000007 0.000000 0.000000 -0.000001 -0.000009 0.000002 0.000001 0.000009 -10.000010 0.000007 0.000005 0.000001 -0.000003 0.000002 9.999999 -0.000002 -0.000002 0.000000 -0.000000 0.000009 10.000000 0.000001 0.000002 -0.000000 0.000004 -0.000006 -9.999991 -0.000000 -0.000003 0.000000 0.000000 13.933969 -75.057091 68.379097 0.043734 0.000168 0.458187
+0.000000 1.413067 0.000000 0.000000 0.000000 -0.000000 -0.000000 0.000000 0.000000 0.000001 -0.000002 0.000000 -69.566444 3.475644 9.382329 -0.000008 -0.000000 -0.000007 0.000000 0.000000 -0.000001 -0.000009 0.000002 0.000001 0.000009 -10.000010 0.000007 0.000005 0.000001 -0.000003 0.000002 9.999999 -0.000002 -0.000002 0.000000 -0.000000 0.000009 10.000000 0.000001 0.000002 -0.000000 0.000004 -0.000006 -9.999991 -0.000000 -0.000003 0.000000 0.000000 13.933969 -75.057091 68.379097 0.043734 0.000168 0.458187
+0.000000 1.413067 0.000000 0.000000 0.000000 -0.000000 -0.000000 0.000000 0.000000 0.000001 -0.000002 0.000000 -69.566444 3.475644 9.382329 -0.000008 -0.000000 -0.000007 0.000000 0.000000 -0.000001 -0.000009 0.000002 0.000001 0.000009 -10.000010 0.000007 0.000005 0.000001 -0.000003 0.000002 9.999999 -0.000002 -0.000002 0.000000 -0.000000 0.000009 10.000000 0.000001 0.000002 -0.000000 0.000004 -0.000006 -9.999991 -0.000000 -0.000003 0.000000 0.000000 13.933969 -75.057091 68.379097 0.043734 0.000168 0.458187
+0.000000 1.413067 0.000000 0.000000 0.000000 -0.000000 -0.000000 0.000000 0.000000 0.000001 -0.000002 0.000000 -69.566444 3.475644 9.382329 -0.000008 -0.000000 -0.000007 0.000000 0.000000 -0.000001 -0.000009 0.000002 0.000001 0.000009 -10.000010 0.000007 0.000005 0.000001 -0.000003 0.000002 9.999999 -0.000002 -0.000002 0.000000 -0.000000 0.000009 10.000000 0.000001 0.000002 -0.000000 0.000004 -0.000006 -9.999991 -0.000000 -0.000003 0.000000 0.000000 15.592641 -73.271828 68.205055 0.049190 0.000191 0.457633
+0.000000 1.413067 0.000000 0.000000 0.000000 -0.000000 -0.000000 0.000000 0.000000 0.000001 -0.000002 0.000000 -69.566444 3.475644 9.382329 -0.000008 -0.000000 -0.000007 0.000000 0.000000 -0.000001 -0.000009 0.000002 0.000001 0.000009 -10.000010 0.000007 0.000005 0.000001 -0.000003 0.000002 9.999999 -0.000002 -0.000002 0.000000 -0.000000 0.000009 10.000000 0.000001 0.000002 -0.000000 0.000004 -0.000006 -9.999991 -0.000000 -0.000003 0.000000 0.000000 20.462332 -68.015968 67.560570 0.065777 0.000262 0.455548
+0.000000 1.413067 0.000000 0.000000 0.000000 -0.000000 -0.000000 0.000000 0.000000 0.000001 -0.000002 0.000000 -69.566444 3.475644 9.382329 -0.000008 -0.000000 -0.000007 0.000000 0.000000 -0.000001 -0.000009 0.000002 0.000001 0.000009 -10.000010 0.000007 0.000005 0.000001 -0.000003 0.000002 9.999999 -0.000002 -0.000002 0.000000 -0.000000 0.000009 10.000000 0.000001 0.000002 -0.000000 0.000004 -0.000006 -9.999991 -0.000000 -0.000003 0.000000 0.000000 27.960419 -59.863308 66.116219 0.093563 0.000364 0.450658
+0.000000 1.413067 0.000000 0.000000 0.000000 -0.000000 -0.000000 0.000000 0.000000 0.000001 -0.000002 0.000000 -69.566444 3.475644 9.382329 -0.000008 -0.000000 -0.000007 0.000000 0.000000 -0.000001 -0.000009 0.000002 0.000001 0.000009 -10.000010 0.000007 0.000005 0.000001 -0.000003 0.000002 9.999999 -0.000002 -0.000002 0.000000 -0.000000 0.000009 10.000000 0.000001 0.000002 -0.000000 0.000004 -0.000006 -9.999991 -0.000000 -0.000003 0.000000 0.000000 36.834835 -50.061420 63.460114 0.132021 0.000510 0.440926
+0.000000 1.413067 0.000000 0.000000 0.000000 -0.000000 -0.000000 0.000000 0.000000 0.000001 -0.000002 0.000000 -69.566444 3.475644 9.382329 -0.000008 -0.000000 -0.000007 0.000000 0.000000 -0.000001 -0.000009 0.000002 0.000001 0.000009 -10.000010 0.000007 0.000005 0.000001 -0.000003 0.000002 9.999999 -0.000002 -0.000002 0.000000 -0.000000 0.000009 10.000000 0.000001 0.000002 -0.000000 0.000004 -0.000006 -9.999991 -0.000000 -0.000003 0.000000 0.000000 45.514332 -40.186401 59.312763 0.179461 0.000666 0.423845
+0.000000 1.413067 0.000000 0.000000 0.000000 -0.000000 -0.000000 0.000000 0.000000 0.000001 -0.000002 0.000000 -69.566444 3.475644 9.382329 -0.000008 -0.000000 -0.000007 0.000000 0.000000 -0.000001 -0.000009 0.000002 0.000001 0.000009 -10.000010 0.000007 0.000005 0.000001 -0.000003 0.000002 9.999999 -0.000002 -0.000002 0.000000 -0.000000 0.000009 10.000000 0.000001 0.000002 -0.000000 0.000004 -0.000006 -9.999991 -0.000000 -0.000003 0.000000 0.000000 52.840313 -31.417212 53.697868 0.232557 0.000818 0.397201
+0.000000 1.413067 0.000000 0.000000 0.000000 -0.000000 -0.000000 0.000000 0.000000 0.000001 -0.000002 0.000000 -69.566444 3.475644 9.382329 -0.000008 -0.000000 -0.000007 0.000000 0.000000 -0.000001 -0.000009 0.000002 0.000001 0.000009 -10.000010 0.000007 0.000005 0.000001 -0.000003 0.000002 9.999999 -0.000002 -0.000002 0.000000 -0.000000 0.000009 10.000000 0.000001 0.000002 -0.000000 0.000004 -0.000006 -9.999991 -0.000000 -0.000003 0.000000 0.000000 58.406048 -24.202238 46.952320 0.286579 0.000904 0.360173
+0.000000 1.413067 0.000000 0.000000 0.000000 -0.000000 -0.000000 0.000000 0.000000 0.000001 -0.000002 0.000000 -69.566444 3.475644 9.382329 -0.000008 -0.000000 -0.000007 0.000000 0.000000 -0.000001 -0.000009 0.000002 0.000001 0.000009 -10.000010 0.000007 0.000005 0.000001 -0.000003 0.000002 9.999999 -0.000002 -0.000002 0.000000 -0.000000 0.000009 10.000000 0.000001 0.000002 -0.000000 0.000004 -0.000006 -9.999991 -0.000000 -0.000003 0.000000 0.000000 62.338604 -18.480671 39.618023 0.336270 0.000930 0.314275
+0.000000 1.413067 0.000000 0.000000 0.000000 -0.000000 -0.000000 0.000000 0.000000 0.000001 -0.000002 0.000000 -69.566444 3.475644 9.382329 -0.000008 -0.000000 -0.000007 0.000000 0.000000 -0.000001 -0.000009 0.000002 0.000001 0.000009 -10.000010 0.000007 0.000005 0.000001 -0.000003 0.000002 9.999999 -0.000002 -0.000002 0.000000 -0.000000 0.000009 10.000000 0.000001 0.000002 -0.000000 0.000004 -0.000006 -9.999991 -0.000000 -0.000003 0.000000 0.000000 64.970375 -14.009379 32.301220 0.377463 0.000871 0.263365
+0.000000 1.413067 0.000000 0.000000 0.000000 -0.000000 -0.000000 0.000000 0.000000 0.000001 -0.000002 0.000000 -69.566444 3.475644 9.382329 -0.000008 -0.000000 -0.000007 0.000000 0.000000 -0.000001 -0.000009 0.000002 0.000001 0.000009 -10.000010 0.000007 0.000005 0.000001 -0.000003 0.000002 9.999999 -0.000002 -0.000002 0.000000 -0.000000 0.000009 10.000000 0.000001 0.000002 -0.000000 0.000004 -0.000006 -9.999991 -0.000000 -0.000003 0.000000 0.000000 66.648727 -10.545892 25.546820 0.408261 0.000764 0.212538
+0.000000 1.413067 0.000000 0.000000 0.000000 -0.000000 -0.000000 0.000000 0.000000 0.000001 -0.000002 0.000000 -69.566444 3.475644 9.382329 -0.000008 -0.000000 -0.000007 0.000000 0.000000 -0.000001 -0.000009 0.000002 0.000001 0.000009 -10.000010 0.000007 0.000005 0.000001 -0.000003 0.000002 9.999999 -0.000002 -0.000002 0.000000 -0.000000 0.000009 10.000000 0.000001 0.000002 -0.000000 0.000004 -0.000006 -9.999991 -0.000000 -0.000003 0.000000 0.000000 67.667053 -7.905507 19.758142 0.429061 0.000626 0.166610
+0.000000 1.413067 0.000000 0.000000 0.000000 -0.000000 -0.000000 0.000000 0.000000 0.000001 -0.000002 0.000000 -69.566444 3.475644 9.382329 -0.000008 -0.000000 -0.000007 0.000000 0.000000 -0.000001 -0.000009 0.000002 0.000001 0.000009 -10.000010 0.000007 0.000005 0.000001 -0.000003 0.000002 9.999999 -0.000002 -0.000002 0.000000 -0.000000 0.000009 10.000000 0.000001 0.000002 -0.000000 0.000004 -0.000006 -9.999991 -0.000000 -0.000003 0.000000 0.000000 68.250954 -5.961862 15.176477 0.441826 0.000503 0.129027
+0.000000 1.413067 0.000000 0.000000 0.000000 -0.000000 -0.000000 0.000000 0.000000 0.000001 -0.000002 0.000000 -69.566444 3.475644 9.382329 -0.000008 -0.000000 -0.000007 0.000000 0.000000 -0.000001 -0.000009 0.000002 0.000001 0.000009 -10.000010 0.000007 0.000005 0.000001 -0.000003 0.000002 9.999999 -0.000002 -0.000002 0.000000 -0.000000 0.000009 10.000000 0.000001 0.000002 -0.000000 0.000004 -0.000006 -9.999991 -0.000000 -0.000003 0.000000 0.000000 68.562553 -4.631650 11.907810 0.448904 0.000403 0.101697
+0.000000 1.413067 0.000000 0.000000 0.000000 -0.000000 -0.000000 0.000000 0.000000 0.000001 -0.000002 0.000000 -69.566444 3.475644 9.382329 -0.000008 -0.000000 -0.000007 0.000000 0.000000 -0.000001 -0.000009 0.000002 0.000001 0.000009 -10.000010 0.000007 0.000005 0.000001 -0.000003 0.000002 9.999999 -0.000002 -0.000002 0.000000 -0.000000 0.000009 10.000000 0.000001 0.000002 -0.000000 0.000004 -0.000006 -9.999991 -0.000000 -0.000003 0.000000 0.000000 68.709084 -3.859547 9.969268 0.452291 0.000339 0.085323
Added: maven/trunk/ogoglio-common/src/main/resources/avatar/avatar-walk.bvh
===================================================================
--- maven/trunk/ogoglio-common/src/main/resources/avatar/avatar-walk.bvh (rev 0)
+++ maven/trunk/ogoglio-common/src/main/resources/avatar/avatar-walk.bvh 2007-08-26 22:57:26 UTC (rev 265)
@@ -0,0 +1,147 @@
+HIERARCHY
+ROOT Neck
+{
+ OFFSET 0.000000 1.413067 0.000000
+ CHANNELS 6 Xposition Yposition Zposition Zrotation Xrotation Yrotation
+ JOINT Head
+ {
+ OFFSET 0.000000 0.288233 0.000000
+ CHANNELS 3 Zrotation Xrotation Yrotation
+ End Site
+ {
+ OFFSET -0.000840 0.240359 0.000000
+ }
+ }
+ JOINT LeftShoulder
+ {
+ OFFSET 0.000000 0.000000 0.000000
+ CHANNELS 3 Zrotation Xrotation Yrotation
+ JOINT LeftArm
+ {
+ OFFSET 0.272146 0.057570 0.000000
+ CHANNELS 3 Zrotation Xrotation Yrotation
+ JOINT LeftForearm
+ {
+ OFFSET 0.272146 -0.073270 0.000000
+ CHANNELS 3 Zrotation Xrotation Yrotation
+ End Site
+ {
+ OFFSET 0.382052 -0.120372 0.000000
+ }
+ }
+ }
+ }
+ JOINT Trunk
+ {
+ OFFSET 0.000000 0.000000 0.000000
+ CHANNELS 3 Zrotation Xrotation Yrotation
+ JOINT LeftHip
+ {
+ OFFSET 0.015701 -0.481489 0.000000
+ CHANNELS 3 Zrotation Xrotation Yrotation
+ JOINT LeftThigh
+ {
+ OFFSET 0.115208 -0.062803 0.000000
+ CHANNELS 3 Zrotation Xrotation Yrotation
+ JOINT LeftShin
+ {
+ OFFSET 0.007551 -0.350650 0.036635
+ CHANNELS 3 Zrotation Xrotation Yrotation
+ JOINT LeftFoot
+ {
+ OFFSET -0.000000 -0.434387 -0.026168
+ CHANNELS 3 Zrotation Xrotation Yrotation
+ End Site
+ {
+ OFFSET 0.000000 -0.020934 0.225044
+ }
+ }
+ }
+ }
+ }
+ JOINT RightHip
+ {
+ OFFSET 0.015701 -0.481489 0.000000
+ CHANNELS 3 Zrotation Xrotation Yrotation
+ JOINT RightThigh
+ {
+ OFFSET -0.130840 -0.078504 0.000000
+ CHANNELS 3 Zrotation Xrotation Yrotation
+ JOINT RightShin
+ {
+ OFFSET -0.015701 -0.355884 0.000000
+ CHANNELS 3 Zrotation Xrotation Yrotation
+ JOINT RightFoot
+ {
+ OFFSET -0.015701 -0.392518 0.000000
+ CHANNELS 3 Zrotation Xrotation Yrotation
+ End Site
+ {
+ OFFSET 0.009601 -0.046108 0.244754
+ }
+ }
+ }
+ }
+ }
+ }
+ JOINT RightShoulder
+ {
+ OFFSET 0.000000 0.000000 0.000000
+ CHANNELS 3 Zrotation Xrotation Yrotation
+ JOINT RightArm
+ {
+ OFFSET -0.240745 0.062803 0.000000
+ CHANNELS 3 Zrotation Xrotation Yrotation
+ JOINT RightForearm
+ {
+ OFFSET -0.277380 -0.073270 0.000000
+ CHANNELS 3 Zrotation Xrotation Yrotation
+ End Site
+ {
+ OFFSET -0.387286 -0.130840 0.000000
+ }
+ }
+ }
+ }
+}
+MOTION
+Frames: 38
+Frame Time: 0.040000
+0.000000 1.413067 0.000000 0.000000 0.000000 -0.000000 -0.000000 0.000000 0.000000 0.000001 -0.000002 0.000000 -69.566444 3.475644 9.382329 -0.000008 -0.000000 -0.000007 0.000000 0.000000 -0.000001 -0.000009 0.000002 0.000001 0.000009 -10.000010 0.000007 0.000005 0.000001 -0.000003 0.000002 9.999999 -0.000002 -0.000002 0.000000 -0.000000 0.000009 10.000000 0.000001 0.000002 -0.000000 0.000004 -0.000006 -9.999991 -0.000000 -0.000003 0.000000 0.000000 68.751213 -3.608197 9.332540 0.453265 0.000314 0.079923
+0.000000 1.413067 0.000000 0.000000 0.000000 -0.000000 -0.000000 0.000000 0.000000 0.000001 -0.000002 0.000000 -69.573425 3.432642 9.268405 -0.000001 0.000005 0.000001 0.000000 0.000000 -0.000001 -0.000009 0.000002 0.000001 0.000007 -9.878431 0.000003 0.000005 -0.000011 0.000003 0.000005 9.878430 -0.000005 -0.000002 0.000000 -0.000000 -0.000000 9.878425 0.000002 0.000001 0.000002 0.000002 0.000014 -9.878423 0.000001 -0.000003 0.000000 0.000000 68.758408 -3.563561 9.219229 0.453449 0.000309 0.078962
+0.000000 1.413067 0.000000 0.000000 0.000000 -0.000000 -0.000000 0.000000 0.000000 0.000001 -0.000002 0.000000 -69.593956 3.302765 8.923859 0.000008 0.000006 -0.000000 0.000000 0.000000 -0.000001 -0.000009 0.000002 0.000001 -0.000001 -9.510796 0.000007 0.000003 -0.000002 -0.000002 0.000015 9.510793 -0.000006 -0.000002 0.000000 -0.000000 -0.000004 9.510777 0.000003 0.000006 0.000002 0.000002 0.000017 -9.510776 0.000000 -0.000003 0.000000 0.000000 68.779610 -3.428755 8.876544 0.453937 0.000300 0.076051
+0.000000 1.413067 0.000000 0.000000 0.000000 -0.000000 -0.000000 0.000000 0.000000 0.000001 -0.000002 0.000000 -69.626488 3.086099 8.347546 0.000014 0.000009 -0.000003 0.000000 0.000000 -0.000001 -0.000009 0.000002 0.000001 -0.000008 -8.895952 0.000003 0.000004 0.000006 -0.000002 0.000022 8.895945 -0.000005 -0.000002 0.000000 -0.000000 -0.000005 8.895925 0.000005 0.000014 -0.000002 0.000002 0.000012 -8.895920 0.000000 -0.000003 0.000000 0.000000 68.813194 -3.203861 8.303334 0.454729 0.000281 0.071177
+0.000000 1.413067 0.000000 0.000000 0.000000 -0.000000 -0.000000 0.000000 0.000000 0.000001 -0.000002 0.000000 -69.668114 2.784983 7.543590 0.000007 0.000004 -0.000001 0.000000 0.000000 -0.000001 -0.000009 0.000002 0.000001 -0.000024 -8.038449 0.000001 0.000010 -0.000005 -0.000004 0.000036 8.038444 -0.000002 -0.000002 0.000000 -0.000000 -0.000003 8.038415 0.000006 0.000014 0.000001 0.000002 0.000008 -8.038412 -0.000001 -0.000003 0.000000 0.000000 68.856186 -2.891292 7.503685 0.455740 0.000251 0.064364
+0.000000 1.413067 0.000000 0.000000 0.000000 -0.000000 -0.000000 0.000000 0.000000 0.000001 -0.000002 0.000000 -69.714706 2.404453 6.523068 -0.000001 0.000001 -0.000001 0.000000 0.000000 -0.000001 -0.000009 0.000002 0.000001 -0.000034 -6.950278 -0.000001 0.000007 -0.000005 -0.000001 0.000048 6.950273 -0.000007 -0.000002 0.000000 -0.000000 0.000001 6.950235 0.000009 0.000009 0.000002 0.000002 0.000006 -6.950232 -0.000005 -0.000003 0.000000 0.000000 68.904297 -2.496276 6.488616 0.456894 0.000223 0.055697
+0.000000 1.413067 0.000000 0.000000 0.000000 -0.000000 -0.000000 0.000000 0.000000 0.000001 -0.000002 0.000000 -69.761276 1.952621 5.305598 0.000002 0.000004 -0.000000 0.000000 0.000000 -0.000001 -0.000009 0.000002 0.000001 -0.000040 -5.652504 0.000000 0.000004 -0.000003 -0.000004 0.000054 5.652503 -0.000003 -0.000002 0.000000 -0.000000 0.000002 5.652449 0.000010 -0.000000 -0.000001 0.000002 0.000011 -5.652443 -0.000006 -0.000003 0.000000 0.000000 68.952385 -2.027221 5.277615 0.458028 0.000182 0.045335
+0.000000 1.413067 0.000000 0.000000 0.000000 -0.000000 -0.000000 0.000000 0.000000 0.000001 -0.000002 0.000000 -69.802429 1.440832 3.920405 -0.000005 0.000004 0.000001 0.000000 0.000000 -0.000001 -0.000009 0.000002 0.000001 -0.000046 -4.176364 -0.000003 0.000005 -0.000002 0.000004 0.000059 4.176366 -0.000000 -0.000002 0.000000 -0.000000 -0.000000 4.176301 0.000011 0.000012 -0.000000 0.000002 0.000002 -4.176301 -0.000006 -0.000003 0.000000 0.000000 68.994881 -1.495900 3.899760 0.459044 0.000139 0.033519
+0.000000 1.413067 0.000000 0.000000 0.000000 -0.000000 -0.000000 0.000000 0.000000 0.000001 -0.000002 0.000000 -69.833191 0.883521 2.406477 0.000012 0.000004 -0.000003 0.000000 0.000000 -0.000001 -0.000009 0.000002 0.000001 -0.000049 -2.563405 -0.000002 0.000007 -0.000009 0.000004 0.000065 2.563406 -0.000005 -0.000002 0.000000 -0.000000 0.000007 2.563347 0.000012 0.000006 0.000001 0.000003 -0.000007 -2.563340 -0.000010 -0.000003 0.000000 0.000000 69.026634 -0.917296 2.393814 0.459814 0.000082 0.020586
+0.000000 1.413067 0.000000 0.000000 0.000000 -0.000000 -0.000000 0.000000 0.000000 0.000001 -0.000002 0.000000 -69.849648 0.297727 0.811346 -0.000004 0.000003 -0.000002 0.000000 0.000000 -0.000001 -0.000009 0.000002 0.000001 -0.000047 -0.864197 0.000001 0.000006 -0.000001 -0.000002 0.000062 0.864189 -0.000000 -0.000002 0.000000 -0.000000 0.000005 0.864144 0.000011 0.000002 0.000000 0.000002 0.000002 -0.864139 -0.000008 -0.000003 0.000000 0.000000 69.043633 -0.309110 0.807082 0.460216 0.000032 0.006942
+0.000000 1.413067 0.000000 0.000000 0.000000 -0.000000 -0.000000 0.000000 0.000000 0.000001 -0.000002 0.000000 -69.849640 -0.297765 -0.811551 -0.000006 0.000002 -0.000000 0.000000 0.000000 -0.000001 -0.000009 0.000002 0.000001 -0.000041 0.864494 0.000001 0.000007 0.000002 -0.000003 0.000054 -0.864502 0.000001 -0.000002 0.000000 -0.000000 0.000004 -0.864540 0.000010 0.000003 0.000000 0.000001 0.000003 0.864541 -0.000004 -0.000003 0.000000 0.000000 69.043648 0.309152 -0.807284 0.460200 -0.000028 -0.006944
+0.000000 1.413067 0.000000 0.000000 0.000000 -0.000000 -0.000000 0.000000 0.000000 0.000001 -0.000002 0.000000 -69.833191 -0.883558 -2.406675 0.000002 0.000007 -0.000005 0.000000 0.000000 -0.000001 -0.000009 0.000002 0.000001 -0.000033 2.563680 0.000003 0.000007 0.000004 0.000002 0.000046 -2.563686 -0.000001 -0.000002 0.000000 -0.000000 0.000006 -2.563722 0.000009 0.000006 0.000001 0.000002 -0.000008 2.563728 -0.000004 -0.000003 0.000000 0.000000 69.026634 0.917336 -2.394006 0.459814 -0.000081 -0.020586
+0.000000 1.413067 0.000000 0.000000 0.000000 -0.000000 -0.000000 0.000000 0.000000 0.000001 -0.000002 0.000000 -69.802429 -1.440865 -3.920578 0.000011 0.000006 -0.000001 0.000000 0.000000 -0.000001 -0.000009 0.000002 0.000001 -0.000022 4.176601 0.000002 0.000005 0.000005 -0.000003 0.000035 -4.176606 0.000002 -0.000002 0.000000 -0.000000 -0.000005 -4.176627 0.000007 0.000015 -0.000001 0.000000 0.000009 4.176627 -0.000002 -0.000003 0.000000 0.000000 68.994873 1.495934 -3.899928 0.459048 -0.000135 -0.033522
+0.000000 1.413067 0.000000 0.000000 0.000000 -0.000000 -0.000000 0.000000 0.000000 0.000001 -0.000002 0.000000 -69.761269 -1.952650 -5.305739 0.000000 0.000006 -0.000003 0.000000 0.000000 -0.000001 -0.000009 0.000002 0.000001 -0.000015 5.652699 0.000005 0.000008 -0.000006 -0.000005 0.000029 -5.652691 0.000001 -0.000002 0.000000 -0.000000 0.000003 -5.652719 0.000005 -0.000003 0.000001 0.000003 0.000009 5.652719 -0.000002 -0.000003 0.000000 0.000000 68.952362 2.027249 -5.277755 0.458035 -0.000182 -0.045335
+0.000000 1.413067 0.000000 0.000000 0.000000 -0.000000 -0.000000 0.000000 0.000000 0.000001 -0.000002 0.000000 -69.714714 -2.404473 -6.523174 0.000011 0.000005 -0.000002 0.000000 0.000000 -0.000001 -0.000009 0.000002 0.000001 -0.000005 6.950427 0.000006 0.000006 0.000001 0.000003 0.000019 -6.950422 -0.000005 -0.000002 0.000000 -0.000000 0.000003 -6.950441 0.000004 0.000005 0.000002 0.000003 0.000003 6.950443 -0.000001 -0.000003 0.000000 0.000000 68.904297 2.496294 -6.488722 0.456876 -0.000222 -0.055695
+0.000000 1.413067 0.000000 0.000000 0.000000 -0.000000 -0.000000 0.000000 0.000000 0.000001 -0.000002 0.000000 -69.668114 -2.784995 -7.543664 0.000006 0.000002 -0.000002 0.000000 0.000000 -0.000001 -0.000009 0.000002 0.000001 -0.000004 8.038555 0.000001 0.000010 -0.000010 -0.000003 0.000016 -8.038557 0.000002 -0.000002 0.000000 -0.000000 0.000006 -8.038554 0.000004 0.000002 0.000002 0.000003 -0.000001 8.038554 -0.000001 -0.000003 0.000000 0.000000 68.856178 2.891307 -7.503759 0.455743 -0.000255 -0.064365
+0.000000 1.413067 0.000000 0.000000 0.000000 -0.000000 -0.000000 0.000000 0.000000 0.000001 -0.000002 0.000000 -69.626488 -3.086108 -8.347591 -0.000004 0.000006 -0.000005 0.000000 0.000000 -0.000001 -0.000009 0.000002 0.000001 0.000006 8.896006 0.000002 0.000005 0.000004 -0.000003 0.000008 -8.896010 0.000003 -0.000002 0.000000 -0.000000 -0.000009 -8.896005 0.000003 0.000017 0.000002 0.000001 0.000015 8.896007 -0.000002 -0.000003 0.000000 0.000000 68.813179 3.203868 -8.303378 0.454731 -0.000281 -0.071173
+0.000000 1.413067 0.000000 0.000000 0.000000 -0.000000 -0.000000 0.000000 0.000000 0.000001 -0.000002 0.000000 -69.593964 -3.302766 -8.923881 0.000003 0.000002 0.000001 0.000000 0.000000 -0.000001 -0.000009 0.000002 0.000001 0.000005 9.510819 0.000002 0.000008 0.000002 0.000000 0.000009 -9.510821 0.000001 -0.000002 0.000000 -0.000000 -0.000005 -9.510813 0.000002 0.000006 -0.000003 0.000002 0.000019 9.510811 0.000000 -0.000003 0.000000 0.000000 68.779617 3.428756 -8.876569 0.453933 -0.000304 -0.076051
+0.000000 1.413067 0.000000 0.000000 0.000000 -0.000000 -0.000000 0.000000 0.000000 0.000001 -0.000002 0.000000 -69.573425 -3.432638 -9.268411 -0.000005 0.000003 0.000000 0.000000 0.000000 -0.000001 -0.000009 0.000002 0.000001 0.000002 9.878448 0.000004 0.000012 -0.000010 -0.000002 0.000009 -9.878444 0.000002 -0.000002 0.000000 -0.000000 0.000003 -9.878431 0.000002 -0.000003 0.000001 0.000003 0.000010 9.878428 0.000002 -0.000003 0.000000 0.000000 68.758408 3.563563 -9.219240 0.453451 -0.000315 -0.078962
+0.000000 1.413067 0.000000 0.000000 0.000000 -0.000000 -0.000000 0.000000 0.000000 0.000001 -0.000002 0.000000 -69.566444 -3.475643 -9.382327 -0.000008 0.000006 -0.000004 0.000000 0.000000 -0.000001 -0.000009 0.000002 0.000001 0.000003 10.000010 0.000003 0.000009 -0.000010 -0.000000 0.000009 -10.000006 -0.000004 -0.000002 0.000000 -0.000000 0.000008 -9.999999 0.000002 0.000002 0.000004 0.000003 -0.000008 9.999994 0.000003 -0.000003 0.000000 0.000000 68.751213 3.608193 -9.332541 0.453269 -0.000317 -0.079922
+0.000000 1.413067 0.000000 0.000000 0.000000 -0.000000 -0.000000 0.000000 0.000000 0.000001 -0.000002 0.000000 -69.572746 -3.436847 -9.279555 -0.000006 0.000005 -0.000002 0.000000 0.000000 -0.000001 -0.000009 0.000002 0.000001 0.000009 9.890325 0.000002 0.000005 0.000010 -0.000001 0.000005 -9.890330 -0.000003 -0.000002 0.000000 -0.000000 0.000006 -9.890330 0.000002 -0.000006 0.000002 0.000003 0.000006 9.890323 0.000002 -0.000003 0.000000 0.000000 68.757706 3.567925 -9.230322 0.453426 -0.000313 -0.079059
+0.000000 1.413067 0.000000 0.000000 0.000000 -0.000000 -0.000000 0.000000 0.000000 0.000001 -0.000002 0.000000 -69.591316 -3.319676 -8.968773 -0.000004 0.000001 -0.000003 0.000000 0.000000 -0.000001 -0.000009 0.000002 0.000001 0.000007 9.558719 0.000003 0.000007 -0.000005 -0.000001 0.000006 -9.558715 -0.000001 -0.000002 0.000000 -0.000000 0.000002 -9.558713 0.000002 0.000009 -0.000002 0.000001 0.000001 9.558707 0.000003 -0.000003 0.000000 0.000000 68.776878 3.446308 -8.921219 0.453877 -0.000301 -0.076428
+0.000000 1.413067 0.000000 0.000000 0.000000 -0.000000 -0.000000 0.000000 0.000000 0.000001 -0.000002 0.000000 -69.620949 -3.124075 -8.448711 0.000006 0.000002 -0.000007 0.000000 0.000000 -0.000001 -0.000009 0.000002 0.000001 0.000005 9.003878 0.000003 0.000009 -0.000007 0.000000 0.000008 -9.003871 -0.000002 -0.000002 0.000000 -0.000000 0.000010 -9.003870 0.000002 -0.000004 0.000001 0.000003 -0.000002 9.003866 0.000003 -0.000003 0.000000 0.000000 68.807472 3.243276 -8.403956 0.454594 -0.000284 -0.072031
+0.000000 1.413067 0.000000 0.000000 0.000000 -0.000000 -0.000000 0.000000 0.000000 0.000001 -0.000002 0.000000 -69.659264 -2.851772 -7.722231 0.000017 0.000004 -0.000004 0.000000 0.000000 -0.000001 -0.000009 0.000002 0.000001 0.000007 8.228984 0.000002 0.000006 -0.000001 0.000004 0.000008 -8.228987 0.000000 -0.000002 0.000000 -0.000000 -0.000006 -8.228977 0.000003 0.000019 0.000001 0.000001 0.000006 8.228978 -0.000000 -0.000003 0.000000 0.000000 68.847031 2.960623 -7.681374 0.455528 -0.000266 -0.065876
+0.000000 1.413067 0.000000 0.000000 0.000000 -0.000000 -0.000000 0.000000 0.000000 0.000001 -0.000002 0.000000 -69.702850 -2.506654 -6.797664 0.000004 0.000003 0.000001 0.000000 0.000000 -0.000001 -0.000009 0.000002 0.000001 0.000008 7.243071 0.000001 0.000005 0.000004 -0.000000 0.000005 -7.243075 -0.000003 -0.000002 0.000000 -0.000000 0.000010 -7.243068 0.000001 0.000002 0.000002 0.000003 -0.000007 7.243064 0.000004 -0.000003 0.000000 0.000000 68.892052 2.602371 -6.761748 0.456600 -0.000233 -0.058028
+0.000000 1.413067 0.000000 0.000000 0.000000 -0.000000 -0.000000 0.000000 0.000000 0.000001 -0.000002 0.000000 -69.747620 -2.095064 -5.690068 0.000006 0.000006 -0.000004 0.000000 0.000000 -0.000001 -0.000009 0.000002 0.000001 0.000005 6.062321 0.000001 0.000007 0.000005 -0.000002 0.000009 -6.062324 0.000002 -0.000002 0.000000 -0.000000 0.000008 -6.062318 0.000002 0.000003 0.000000 0.000002 -0.000005 6.062318 0.000003 -0.000003 0.000000 0.000000 68.938278 2.175094 -5.660045 0.457688 -0.000197 -0.048608
+0.000000 1.413067 0.000000 0.000000 0.000000 -0.000000 -0.000000 0.000000 0.000000 0.000001 -0.000002 0.000000 -69.788979 -1.625956 -4.422169 0.000006 0.000003 -0.000001 0.000000 0.000000 -0.000001 -0.000009 0.000002 0.000001 0.000004 4.711061 0.000002 0.000008 -0.000007 0.000001 0.000009 -4.711057 0.000002 -0.000002 0.000000 -0.000000 0.000005 -4.711060 0.000002 0.000003 -0.000000 0.000003 -0.000002 4.711057 0.000003 -0.000003 0.000000 0.000000 68.980988 1.688090 -4.398867 0.458712 -0.000150 -0.037799
+0.000000 1.413067 0.000000 0.000000 0.000000 -0.000000 -0.000000 0.000000 0.000000 0.000001 -0.000002 0.000000 -69.822426 -1.110888 -3.024740 0.000004 0.000002 -0.000005 0.000000 0.000000 -0.000001 -0.000009 0.000002 0.000001 0.000006 3.222109 -0.000002 0.000005 0.000006 0.000005 0.000007 -3.222113 -0.000001 -0.000002 0.000000 -0.000000 0.000007 -3.222108 0.000002 0.000004 0.000000 0.000003 -0.000003 3.222106 0.000002 -0.000003 0.000000 0.000000 69.015533 1.153352 -3.008816 0.459540 -0.000104 -0.025868
+0.000000 1.413067 0.000000 0.000000 0.000000 -0.000000 -0.000000 0.000000 0.000000 0.000001 -0.000002 0.000000 -69.844185 -0.563707 -1.536001 -0.000001 0.000004 -0.000006 0.000000 0.000000 -0.000001 -0.000009 0.000002 0.000001 0.000008 1.636148 0.000002 0.000003 -0.000003 0.000002 0.000006 -1.636142 -0.000002 -0.000002 0.000000 -0.000000 0.000000 -1.636153 0.000002 0.000003 0.000000 0.000003 0.000010 1.636152 0.000001 -0.000003 0.000000 0.000000 69.038017 0.585257 -1.527920 0.460071 -0.000052 -0.013139
+0.000000 1.413067 0.000000 0.000000 0.000000 -0.000000 -0.000000 0.000000 0.000000 0.000001 -0.000002 0.000000 -69.851738 0.000001 -0.000004 -0.000006 0.000003 -0.000000 0.000000 0.000000 -0.000001 -0.000009 0.000002 0.000001 0.000004 0.000009 0.000002 0.000006 -0.000010 0.000002 0.000007 -0.000001 -0.000002 -0.000002 0.000000 -0.000000 0.000007 -0.000010 0.000002 0.000000 0.000001 0.000002 0.000001 0.000012 0.000002 -0.000003 0.000000 0.000000 69.045807 -0.000000 -0.000006 0.460276 -0.000000 -0.000000
+0.000000 1.413067 0.000000 0.000000 0.000000 -0.000000 -0.000000 0.000000 0.000000 0.000001 -0.000002 0.000000 -69.844193 0.563704 1.535988 0.000001 0.000006 0.000003 0.000000 0.000000 -0.000001 -0.000009 0.000002 0.000001 0.000002 -1.636137 0.000002 0.000008 -0.000010 0.000001 0.000013 1.636143 -0.000003 -0.000002 0.000000 -0.000000 0.000001 1.636135 0.000002 0.000003 -0.000000 0.000002 0.000008 -1.636135 0.000002 -0.000003 0.000000 0.000000 69.038017 -0.585261 1.527910 0.460071 0.000056 0.013144
+0.000000 1.413067 0.000000 0.000000 0.000000 -0.000000 -0.000000 0.000000 0.000000 0.000001 -0.000002 0.000000 -69.822411 1.110887 3.024729 -0.000003 0.000006 0.000002 0.000000 0.000000 -0.000001 -0.000009 0.000002 0.000001 0.000003 -3.222094 0.000004 0.000007 -0.000011 0.000000 0.000010 3.222089 -0.000000 -0.000002 0.000000 -0.000000 0.000005 3.222092 0.000003 0.000006 0.000001 0.000002 -0.000003 -3.222093 0.000001 -0.000003 0.000000 0.000000 69.015533 -1.153353 3.008809 0.459540 0.000106 0.025869
+0.000000 1.413067 0.000000 0.000000 0.000000 -0.000000 -0.000000 0.000000 0.000000 0.000001 -0.000002 0.000000 -69.788979 1.625956 4.422162 0.000011 0.000002 -0.000003 0.000000 0.000000 -0.000001 -0.000009 0.000002 0.000001 0.000007 -4.711055 0.000003 0.000003 0.000009 -0.000001 0.000005 4.711041 0.000001 -0.000002 0.000000 -0.000000 0.000009 4.711046 0.000001 0.000002 0.000002 0.000005 -0.000004 -4.711045 0.000001 -0.000003 0.000000 0.000000 68.980988 -1.688095 4.398861 0.458708 0.000151 0.037799
+0.000000 1.413067 0.000000 0.000000 0.000000 -0.000000 -0.000000 0.000000 0.000000 0.000001 -0.000002 0.000000 -69.747635 2.095064 5.690062 0.000004 0.000000 -0.000003 0.000000 0.000000 -0.000001 -0.000009 0.000002 0.000001 0.000007 -6.062325 0.000002 0.000005 0.000005 -0.000004 0.000004 6.062320 0.000000 -0.000002 0.000000 -0.000000 0.000010 6.062309 0.000002 0.000002 0.000001 0.000001 -0.000007 -6.062311 0.000002 -0.000003 0.000000 0.000000 68.938278 -2.175096 5.660035 0.457686 0.000194 0.048608
+0.000000 1.413067 0.000000 0.000000 0.000000 -0.000000 -0.000000 0.000000 0.000000 0.000001 -0.000002 0.000000 -69.702850 2.506655 6.797661 0.000002 0.000004 -0.000006 0.000000 0.000000 -0.000001 -0.000009 0.000002 0.000001 0.000004 -7.243066 0.000004 0.000008 -0.000001 -0.000003 0.000008 7.243049 -0.000005 -0.000002 0.000000 -0.000000 0.000011 7.243061 0.000002 0.000002 0.000001 0.000002 -0.000008 -7.243056 0.000002 -0.000003 0.000000 0.000000 68.892052 -2.602373 6.761740 0.456605 0.000227 0.058033
+0.000000 1.413067 0.000000 0.000000 0.000000 -0.000000 -0.000000 0.000000 0.000000 0.000001 -0.000002 0.000000 -69.659248 2.851771 7.722227 -0.000004 0.000003 -0.000003 0.000000 0.000000 -0.000001 -0.000009 0.000002 0.000001 0.000007 -8.228984 0.000004 0.000005 -0.000007 0.000004 0.000005 8.228986 -0.000003 -0.000002 0.000000 -0.000000 -0.000004 8.228972 0.000002 0.000017 -0.000002 0.000001 0.000003 -8.228970 0.000004 -0.000003 0.000000 0.000000 68.847023 -2.960627 7.681365 0.455532 0.000264 0.065874
+0.000000 1.413067 0.000000 0.000000 0.000000 -0.000000 -0.000000 0.000000 0.000000 0.000001 -0.000002 0.000000 -69.620941 3.124076 8.448711 0.000006 0.000002 -0.000003 0.000000 0.000000 -0.000001 -0.000009 0.000002 0.000001 0.000009 -9.003883 0.000000 0.000003 0.000007 0.000002 0.000007 9.003867 -0.000003 -0.000002 0.000000 -0.000000 0.000008 9.003868 0.000002 -0.000001 0.000002 0.000003 -0.000001 -9.003863 -0.000000 -0.000003 0.000000 0.000000 68.807480 -3.243281 8.403956 0.454592 0.000289 0.072030
+0.000000 1.413067 0.000000 0.000000 0.000000 -0.000000 -0.000000 0.000000 0.000000 0.000001 -0.000002 0.000000 -69.591324 3.319678 8.968778 0.000001 0.000004 0.000001 0.000000 0.000000 -0.000001 -0.000009 0.000002 0.000001 0.000008 -9.558720 0.000007 0.000008 -0.000002 -0.000003 0.000003 9.558712 -0.000003 -0.000002 0.000000 -0.000000 -0.000001 9.558714 0.000001 0.000013 -0.000000 0.000002 0.000004 -9.558708 0.000003 -0.000003 0.000000 0.000000 68.776878 -3.446312 8.921223 0.453876 0.000304 0.076431
Added: maven/trunk/ogoglio-common/src/main/resources/avatar/avatar-wave.bvh
===================================================================
--- maven/trunk/ogoglio-common/src/main/resources/avatar/avatar-wave.bvh ...
[truncated message content] |
|
From: <ian...@us...> - 2007-08-27 16:25:43
|
Revision: 264
http://ogoglio.svn.sourceforge.net/ogoglio/?rev=264&view=rev
Author: iansmith
Date: 2007-08-26 15:55:01 -0700 (Sun, 26 Aug 2007)
Log Message:
-----------
Figured out the incantations for getting java3d properly integrated into the build of common.
Modified Paths:
--------------
maven/trunk/ogoglio-common/.classpath
maven/trunk/ogoglio-common/pom.xml
maven/trunk/ogoglio-common/src/main/java/com/ogoglio/client/SpaceClient.java
maven/trunk/ogoglio-common/src/main/java/com/ogoglio/client/model/Space.java
maven/trunk/ogoglio-common/src/main/java/com/ogoglio/client/model/User.java
maven/trunk/ogoglio-common/src/main/java/com/ogoglio/util/WebConstants.java
maven/trunk/ogoglio-common/src/main/java/com/ogoglio/viewer/j3d/J3DUserRenderable.java
maven/trunk/ogoglio-common/src/main/java/com/ogoglio/viewer/j3d/bvh/BvhParser.java
Added Paths:
-----------
maven/trunk/ogoglio-common/src/main/resources/testing_constants/
maven/trunk/ogoglio-common/src/main/resources/testing_constants/bootstrapUser.properties
Modified: maven/trunk/ogoglio-common/.classpath
===================================================================
--- maven/trunk/ogoglio-common/.classpath 2007-08-26 22:52:45 UTC (rev 263)
+++ maven/trunk/ogoglio-common/.classpath 2007-08-26 22:55:01 UTC (rev 264)
@@ -2,7 +2,8 @@
<classpath>
<classpathentry kind="src" path="src/main/java"/>
<classpathentry kind="src" path="src/test/java"/>
- <classpathentry excluding="**" kind="src" output="src/main/resources" path="src/main/resources"/>
+ <classpathentry excluding="**" kind="src" output="src/main/resources/testing_constants" path="src/main/resources/testing_constants"/>
+ <classpathentry excluding="**" kind="src" output="src/main/resources/avatar" path="src/main/resources/avatar"/>
<classpathentry excluding="**" kind="src" output="src/test/resources" path="src/test/resources"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>
Modified: maven/trunk/ogoglio-common/pom.xml
===================================================================
--- maven/trunk/ogoglio-common/pom.xml 2007-08-26 22:52:45 UTC (rev 263)
+++ maven/trunk/ogoglio-common/pom.xml 2007-08-26 22:55:01 UTC (rev 264)
@@ -10,9 +10,46 @@
<version>0.0.1</version>
+ <build>
+ <resources>
+ <!-- FILTER RESOURCES FOR SOME CONSTANTS-->
+ <resource>
+ <directory>src/main/resources/testing_constants</directory>
+ <filtering>true</filtering>
+ </resource>
+
+ <resource>
+ <targetPath>avatar</targetPath>
+ <directory>src/main/resources/avatar</directory>
+ </resource>
+
+ </resources>
+ </build>
+
<!-- things we need to build/run -->
<dependencies>
+ <!-- jav3d stuff -->
<dependency>
+ <groupId>java3d</groupId>
+ <artifactId>j3d-core</artifactId>
+ <version>1.5.1</version>
+ <scope>supplied</scope>
+ </dependency>
+ <dependency>
+ <groupId>java3d</groupId>
+ <artifactId>j3d-core-utils</artifactId>
+ <version>1.5.1</version>
+ <scope>supplied</scope>
+ </dependency>
+ <dependency>
+ <groupId>java3d</groupId>
+ <artifactId>vecmath</artifactId>
+ <version>1.5.1</version>
+ <scope>supplied</scope>
+ </dependency>
+
+ <!-- rmock for testing -->
+ <dependency>
<groupId>com.agical.rmock</groupId>
<artifactId>rmock</artifactId>
<version>2.0.0-rc-6</version>
Modified: maven/trunk/ogoglio-common/src/main/java/com/ogoglio/client/SpaceClient.java
===================================================================
--- maven/trunk/ogoglio-common/src/main/java/com/ogoglio/client/SpaceClient.java 2007-08-26 22:52:45 UTC (rev 263)
+++ maven/trunk/ogoglio-common/src/main/java/com/ogoglio/client/SpaceClient.java 2007-08-26 22:55:01 UTC (rev 264)
@@ -714,14 +714,15 @@
}
public InputStream getUserAnimationStream(String username, long animationID) throws IOException {
+ System.out.println("trying to FART: "+username+","+animationID);
if (animationID == 1) {
- return SpaceClient.class.getClassLoader().getResourceAsStream("/avatar/avatar.bvh");
+ return SpaceClient.class.getClassLoader().getResourceAsStream("avatar/avatar.bvh");
} else if (animationID == 2) {
- return SpaceClient.class.getClassLoader().getResourceAsStream("/avatar/avatar-walk.bvh");
+ return SpaceClient.class.getClassLoader().getResourceAsStream("avatar/avatar-walk.bvh");
} else if (animationID == 3) {
- return SpaceClient.class.getClassLoader().getResourceAsStream("/avatar/avatar-wave.bvh");
+ return SpaceClient.class.getClassLoader().getResourceAsStream("avatar/avatar-wave.bvh");
} else if (animationID == 4) {
- return SpaceClient.class.getClassLoader().getResourceAsStream("/avatar/avatar-point.bvh");
+ return SpaceClient.class.getClassLoader().getResourceAsStream("avatar/avatar-point.bvh");
}
return null;
}
Modified: maven/trunk/ogoglio-common/src/main/java/com/ogoglio/client/model/Space.java
===================================================================
--- maven/trunk/ogoglio-common/src/main/java/com/ogoglio/client/model/Space.java 2007-08-26 22:52:45 UTC (rev 263)
+++ maven/trunk/ogoglio-common/src/main/java/com/ogoglio/client/model/Space.java 2007-08-26 22:55:01 UTC (rev 264)
@@ -530,6 +530,7 @@
}
protected InputStream getUserGeometryStream(String username) throws IOException {
+ System.out.println("FART: Trying to get Geometry stream for user "+username+" from spaceContext");
return spaceContext.getUserGeometryStream(username, null);
}
@@ -542,6 +543,7 @@
}
public InputStream getUserAnimationStream(String username, long animationID) throws IOException {
+ System.out.println("FART GET USER ANIM:"+spaceContext.getClass().getName()+"..."+username);
return spaceContext.getUserAnimationStream(username, animationID);
}
Modified: maven/trunk/ogoglio-common/src/main/java/com/ogoglio/client/model/User.java
===================================================================
--- maven/trunk/ogoglio-common/src/main/java/com/ogoglio/client/model/User.java 2007-08-26 22:52:45 UTC (rev 263)
+++ maven/trunk/ogoglio-common/src/main/java/com/ogoglio/client/model/User.java 2007-08-26 22:55:01 UTC (rev 264)
@@ -88,7 +88,7 @@
}
public InputStream getGeometryStream(int lodIndex) throws IOException {
- //System.err.println("Handle user lod index");
+ //System.out.println("FART:Handle user lod index:"+lodIndex+":"+space+","+username);
return space.getUserGeometryStream(username);
}
Modified: maven/trunk/ogoglio-common/src/main/java/com/ogoglio/util/WebConstants.java
===================================================================
--- maven/trunk/ogoglio-common/src/main/java/com/ogoglio/util/WebConstants.java 2007-08-26 22:52:45 UTC (rev 263)
+++ maven/trunk/ogoglio-common/src/main/java/com/ogoglio/util/WebConstants.java 2007-08-26 22:55:01 UTC (rev 264)
@@ -1,5 +1,9 @@
package com.ogoglio.util;
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.Properties;
+
public class WebConstants {
public static final String AUTH_USERNAME_PARAM = "username";
@@ -8,11 +12,41 @@
public static final String AUTH_COOKIE = "loginCookie";
public static final String SPACE_INCLUDE_CHILDREN_PARAM = "children";
+
+ public static final String GUEST_COOKIE_PREFIX = "guest";
- public static final String TEST_LIBRARY_USERNAME="library";
+
+ private static Properties bootstrapProps=null;
- public static final String TEST_DEFAULT_LIBRARY_PASSWORD="og1234";
+ public static String getBootstrapUsername() {
+ if (bootstrapProps==null) {
+ fetchBootstrapProps();
+ }
+ return bootstrapProps.getProperty("bootstrapUser");
+ }
- public static final String GUEST_COOKIE_PREFIX = "guest";
+ public static String getBootstrapUserPW() {
+ if (bootstrapProps==null) {
+ fetchBootstrapProps();
+ }
+ return bootstrapProps.getProperty("bootstrapUserPW");
+ }
+ private static void fetchBootstrapProps() {
+ InputStream str=(new WebConstants().getClass()).getResourceAsStream("/bootstrapUser.properties");
+ if (str==null) {
+ System.out.println("Unable to load bootstrapUser.properties!");
+ bootstrapProps=new Properties();
+ } else {
+ try {
+ bootstrapProps=new Properties();
+ bootstrapProps.load(str);
+ //System.out.println("FART---------->");
+ //bootstrapProps.list(System.out);
+ } catch (IOException e) {
+ System.out.println("Unable to load bootstrapUser.properties due to IOException:"+e.getMessage());
+ bootstrapProps=new Properties();
+ }
+ }
+ }
}
Modified: maven/trunk/ogoglio-common/src/main/java/com/ogoglio/viewer/j3d/J3DUserRenderable.java
===================================================================
--- maven/trunk/ogoglio-common/src/main/java/com/ogoglio/viewer/j3d/J3DUserRenderable.java 2007-08-26 22:52:45 UTC (rev 263)
+++ maven/trunk/ogoglio-common/src/main/java/com/ogoglio/viewer/j3d/J3DUserRenderable.java 2007-08-26 22:55:01 UTC (rev 264)
@@ -75,7 +75,7 @@
public J3DUserRenderable(User user, boolean setVisible) throws IOException, ObjParseException, BvhParseException, SkinMapParseException {
this.user = user;
- BvhParser bvhParser = new BvhParser(user /*not used!*/, 1);
+ BvhParser bvhParser = new BvhParser(user, 1);
Bvh bvh = bvhParser.parse();
skeleton = new SkeletonLoader(bvh).generateSkeleton();
//skeleton.addDebugAttachments();
Modified: maven/trunk/ogoglio-common/src/main/java/com/ogoglio/viewer/j3d/bvh/BvhParser.java
===================================================================
--- maven/trunk/ogoglio-common/src/main/java/com/ogoglio/viewer/j3d/bvh/BvhParser.java 2007-08-26 22:52:45 UTC (rev 263)
+++ maven/trunk/ogoglio-common/src/main/java/com/ogoglio/viewer/j3d/bvh/BvhParser.java 2007-08-26 22:55:01 UTC (rev 264)
@@ -36,9 +36,12 @@
private boolean inMotion = false;
- public BvhParser(GeometryProvider NOT_USED, long animationID) throws IOException {
- //this.geoProvider = geoProvider;
- inputStream = geoProvider.getAnimationStream(animationID);
+ public BvhParser(GeometryProvider geoProvider, long animationID) throws IOException {
+ this.geoProvider = geoProvider;
+ inputStream = this.geoProvider.getAnimationStream(animationID);
+ if (inputStream==null) {
+ System.out.println("FART: BvhParser: Can't get a stream from "+geoProvider+","+geoProvider.getClass().getName());
+ }
tokenizer = new LineTokenizer(inputStream);
}
Added: maven/trunk/ogoglio-common/src/main/resources/testing_constants/bootstrapUser.properties
===================================================================
--- maven/trunk/ogoglio-common/src/main/resources/testing_constants/bootstrapUser.properties (rev 0)
+++ maven/trunk/ogoglio-common/src/main/resources/testing_constants/bootstrapUser.properties 2007-08-26 22:55:01 UTC (rev 264)
@@ -0,0 +1,2 @@
+bootstrapUser=${ogoglio.bootstrapUser}
+bootstrapUserPW=${ogoglio.bootstrapUserPW}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ian...@us...> - 2007-08-27 16:12:25
|
Revision: 266
http://ogoglio.svn.sourceforge.net/ogoglio/?rev=266&view=rev
Author: iansmith
Date: 2007-08-26 15:58:59 -0700 (Sun, 26 Aug 2007)
Log Message:
-----------
Added basic support for DB migration.
Added support for unit tests of the server.
Added test resources.
Modified Paths:
--------------
maven/trunk/ogoglio-server/.classpath
maven/trunk/ogoglio-server/pom.xml
maven/trunk/ogoglio-server/src/main/java/com/ogoglio/persist/HibernateTask.java
maven/trunk/ogoglio-server/src/main/java/com/ogoglio/persist/PersistException.java
maven/trunk/ogoglio-server/src/main/java/com/ogoglio/persist/ServiceInitializationPersistTasks.java
maven/trunk/ogoglio-server/src/main/java/com/ogoglio/site/AbstractResourceServlet.java
maven/trunk/ogoglio-server/src/main/java/com/ogoglio/site/AccountServlet.java
maven/trunk/ogoglio-server/src/main/java/com/ogoglio/site/SpaceServlet.java
maven/trunk/ogoglio-server/src/main/java/com/ogoglio/util/OgoglioProperties.java
maven/trunk/ogoglio-server/src/main/resources/log4j/log4j.properties
maven/trunk/ogoglio-server/src/main/webapp/META-INF/context.xml
maven/trunk/ogoglio-server/src/main/webapp/icons/index.html
maven/trunk/ogoglio-server/src/main/webapp/spaceEditor.html
Added Paths:
-----------
maven/trunk/ogoglio-server/src/main/java/com/ogoglio/migrate/
maven/trunk/ogoglio-server/src/main/java/com/ogoglio/migrate/AccountsForTesting.java
maven/trunk/ogoglio-server/src/main/java/com/ogoglio/migrate/DBVersionPersistTasks.java
maven/trunk/ogoglio-server/src/main/java/com/ogoglio/migrate/DBVersionRecord.java
maven/trunk/ogoglio-server/src/main/java/com/ogoglio/migrate/DBZapTest.java
maven/trunk/ogoglio-server/src/main/java/com/ogoglio/migrate/Migration.java
maven/trunk/ogoglio-server/src/main/java/com/ogoglio/migrate/MigrationSupport.java
maven/trunk/ogoglio-server/src/main/resources/hibernate/hibernate.cfg.xml
maven/trunk/ogoglio-server/src/main/resources/hibernate/migration-0.xml
maven/trunk/ogoglio-server/src/main/resources/hibernate/migration-1.xml
maven/trunk/ogoglio-server/src/test/java/com/ogoglio/persist/
maven/trunk/ogoglio-server/src/test/java/com/ogoglio/persist/test/
maven/trunk/ogoglio-server/src/test/java/com/ogoglio/persist/test/PersistTest.java
maven/trunk/ogoglio-server/src/test/java/com/ogoglio/sim/
maven/trunk/ogoglio-server/src/test/java/com/ogoglio/sim/script/
maven/trunk/ogoglio-server/src/test/java/com/ogoglio/sim/script/test/
maven/trunk/ogoglio-server/src/test/java/com/ogoglio/sim/script/test/ScriptTest.java
maven/trunk/ogoglio-server/src/test/resources/hibernate/
maven/trunk/ogoglio-server/src/test/resources/hibernate/test-config.properties
Removed Paths:
-------------
maven/trunk/ogoglio-server/src/main/java/com/ogoglio/persist/HibernateBase.java
maven/trunk/ogoglio-server/src/main/java/com/ogoglio/persist/HibernateTests.java
maven/trunk/ogoglio-server/src/main/java/com/ogoglio/persist/PersistTests.java
maven/trunk/ogoglio-server/src/main/java/com/ogoglio/sim/script/ScriptTests.java
maven/trunk/ogoglio-server/src/main/java/com/ogoglio/util/PrepareDatabase.java
maven/trunk/ogoglio-server/src/main/resources/hibernate/Persist.hbm.xml
maven/trunk/ogoglio-server/src/main/resources/hibernate/Persist_NoTemplateTables.hbm.xml
maven/trunk/ogoglio-server/src/test/java/com/ogoglio/client/
maven/trunk/ogoglio-server/src/test/resources/sample-art3d/
Modified: maven/trunk/ogoglio-server/.classpath
===================================================================
--- maven/trunk/ogoglio-server/.classpath 2007-08-26 22:57:26 UTC (rev 265)
+++ maven/trunk/ogoglio-server/.classpath 2007-08-26 22:58:59 UTC (rev 266)
@@ -1,10 +1,15 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src/main/java"/>
- <classpathentry kind="src" path="src/main/resources"/>
- <classpathentry kind="src" output="target/test-classes" path="src/test/java"/>
- <classpathentry kind="src" output="target/test-classes" path="src/test/resources"/>
+ <classpathentry kind="src" path="src/test/java"/>
+ <classpathentry excluding="**" kind="src" output="src/main/resources/hibernate" path="src/main/resources/hibernate"/>
+ <classpathentry excluding="**" kind="src" output="src/main/resources/log4j" path="src/main/resources/log4j"/>
+ <classpathentry excluding="**" kind="src" output="src/test/resources/hibernate" path="src/test/resources/hibernate"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
- <classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>
+ <classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER">
+ <attributes>
+ <attribute name="org.eclipse.jdt.launching.CLASSPATH_ATTR_LIBRARY_PATH_ENTRY" value="/usr/local/jdk1.5.0_12/jre/lib/i386"/>
+ </attributes>
+ </classpathentry>
<classpathentry kind="output" path="target/classes"/>
</classpath>
Modified: maven/trunk/ogoglio-server/pom.xml
===================================================================
--- maven/trunk/ogoglio-server/pom.xml 2007-08-26 22:57:26 UTC (rev 265)
+++ maven/trunk/ogoglio-server/pom.xml 2007-08-26 22:58:59 UTC (rev 266)
@@ -9,8 +9,30 @@
<packaging>war</packaging>
<version>0.0.1</version>
+
+ <!-- -->
+ <!-- profiles -->
+ <!-- -->
+ <profiles>
+ <!-- LINUX -->
+ <profile>
+ <id>linux</id>
+ <activation>
+ <os>
+ <name>Linux</name>
+ </os>
+ <!-- placeholder for some config needed for linux -->
+ </activation>
+ <properties></properties>
+ </profile>
+ </profiles>
+ <!-- -->
+ <!-- BUILD -->
+ <!-- -->
<build>
+ <!-- -->
<!-- RESOURCES -->
+ <!-- -->
<resources>
<resource>
<directory>src/main/resources/hibernate</directory>
@@ -19,10 +41,10 @@
</includes>
</resource>
<resource>
- <targetPath>com/ogoglio/persist</targetPath>
+ <targetPath>com/ogoglio/migrate</targetPath>
<directory>src/main/resources/hibernate</directory>
<includes>
- <include>Persist.hbm.xml</include>
+ <include>migration-*.xml</include>
</includes>
</resource>
@@ -34,132 +56,30 @@
</resource>
</resources>
- <!-- PLUGINS -->
- <plugins>
- <!-- SUREFIRE INTEGRATION TEST -->
+ <!-- -->
+ <!-- TEST RESOURCES -->
+ <!-- -->
+ <testResources>
+ <testResource>
+ <directory>src/test/resources/hibernate</directory>
+ <filtering>true</filtering>
+ <includes>
+ <include>test-config.properties</include>
+ </includes>
+ </testResource>
+ </testResources>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-surefire-plugin</artifactId>
- <configuration>
- <skip>true</skip><!-- this is critical to avoid running unit tests, sets default value for skip -->
- <childDelegation>false</childDelegation>
- </configuration>
- <executions>
- <execution>
- <id>over the wire tests</id>
- <phase>integration-test</phase>
- <goals>
- <goal>test</goal>
- </goals>
- <configuration>
- <includes>
- <!-- we seem to like plurals -->
- <include>**/*Tests.java</include>
- </includes>
- <excludes>
- <exclude>
- **/SpaceDuplicatorTests.java
- </exclude>
- </excludes>
- <skip>false</skip><!-- don't skip integration tests -->
- </configuration>
- </execution>
- </executions>
- </plugin>
+ <!-- -->
+ <!-- PLUGINS -->
+ <!-- -->
+ <plugins>
<!-- CARGO -->
- <plugin>
- <groupId>org.codehaus.cargo</groupId>
- <artifactId>cargo-maven2-plugin</artifactId>
- <version>0.3-SNAPSHOT</version>
- <executions>
- <execution>
- <id>get-up</id>
- <phase>pre-integration-test</phase>
- <goals>
- <goal>start</goal>
- </goals>
- <configuration>
- <wait>false</wait>
- </configuration>
- </execution>
- <execution>
- <id>get-down</id>
- <phase>post-integration-test</phase>
- <goals>
- <goal>stop</goal>
- </goals>
- <configuration>
- <wait>true</wait>
- </configuration>
- </execution>
- </executions>
+ <!-- DEPENDENCY PLUGIN: We need to pull in applets -->
- <!-- config of this plugin -->
- <configuration>
-
- <!-- tomcat 5.5 running on the same machine...die if not started in 20 secs -->
- <container>
- <containerId>tomcat5x</containerId>
- <home>/usr/share/tomcat5.5</home>
- <type>installed</type>
- <log>
- ${project.build.directory}/tomcat5x.log
- </log>
- <output>
- ${project.build.directory}/tomcat5x.out
- </output>
- <logLevel>debug</logLevel>
- </container>
-
- <!-- tomcat configuration -->
- <configuration>
- <home>${project.build.directory}/tomcat5x</home>
- <properties>
- <cargo.servlet.port>
- 8080
- </cargo.servlet.port>
- <cargo.logging>high</cargo.logging>
- <!--
- <cargo.datasource.datasource>
- cargo.datasource.url=jdbc:mysql://127.0.0.1/og|
- cargo.datasource.driver=com.mysql.jdbc.Driver|
- cargo.datasource.username=oguser|
- cargo.datasource.password=sssh|
- cargo.datasource.type=javax.sql.DataSource|
- cargo.datasource.jndi=jdbc/space|
- cargo.datasource.maxIdle=5|
- cargo.datasource.maxActive=50|
- cargo.datasource.scope=Shareable
- </cargo.datasource.datasource>
- -->
- </properties>
- <!-- our app to deploy -->
- <deployables>
- <deployable>
-
- <groupId>com.ogoglio</groupId>
- <artifactId>ogoglio-server</artifactId>
- <type>war</type>
-
- <properties>
- <context>ogoglio-server</context>
- </properties>
-
- </deployable>
- </deployables>
-
- </configuration>
- </configuration>
-
- </plugin>
-
- <!-- dependencies to pull in applets via deps-->
-
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
@@ -175,40 +95,44 @@
${project.build.directory}/ogoglio-server-0.0.1
</outputDirectory>
<overWriteReleases>false</overWriteReleases>
- <overWriteSnapshots>true</overWriteSnapshots>
+ <overWriteSnapshots>
+ true
+ </overWriteSnapshots>
<excludeTransitive>true</excludeTransitive>
</configuration>
</execution>
</executions>
- </plugin>
+ </plugin>
+
+ <!-- WAR config to allow some filtering love-->
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-war-plugin</artifactId>
+ <configuration>
+ <webResources>
+ <resource>
+ <directory>src/main/webapp/</directory>
+ <filtering>true</filtering>
+ </resource>
+ </webResources>
+ </configuration>
+ </plugin>
</plugins>
</build>
- <!-- where to get cargo -->
- <pluginRepositories>
- <pluginRepository>
- <id>codehaus snapshot repository</id>
- <url>http://snapshots.repository.codehaus.org/</url>
- <releases>
- <enabled>true</enabled>
- </releases>
- </pluginRepository>
- </pluginRepositories>
- <!-- stuff we need -->
+ <!-- DEPENDENCIES -->
<dependencies>
<dependency>
<groupId>com.agical.rmock</groupId>
<artifactId>rmock</artifactId>
<version>2.0.0-rc-6</version>
- <scope>compile</scope>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate</artifactId>
<version>3.2.1.ga</version>
- <scope>compile</scope>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
@@ -220,52 +144,62 @@
<groupId>rhino</groupId>
<artifactId>js</artifactId>
<version>1.6R6</version>
- <scope>compile</scope>
</dependency>
<dependency>
<groupId>commons-httpclient</groupId>
<artifactId>commons-httpclient</artifactId>
<version>3.0.1</version>
- <scope>compile</scope>
</dependency>
<dependency>
<groupId>commons-fileupload</groupId>
<artifactId>commons-fileupload</artifactId>
<version>1.2</version>
- <scope>compile</scope>
</dependency>
+ <!-- need MYSQL for tests -->
<dependency>
+ <groupId>mysql</groupId>
+ <artifactId>mysql-connector-java</artifactId>
+ <version>5.0.5</version>
+ <scope>test</scope>
+ </dependency>
+
+
+ <!-- -->
+ <!-- OGOGLIO DEPENDENCIES-->
+ <!-- -->
+ <dependency>
<groupId>com.ogoglio</groupId>
<artifactId>ogoglio-common</artifactId>
<version>0.0.1</version>
- <scope>compile</scope>
</dependency>
-
- <dependency>
+
+ <!-- broken: really is a dependency on the FILE -->
+ <dependency>
<groupId>com.ogoglio</groupId>
<artifactId>ogoglio-viewer-applet</artifactId>
<version>0.0.1</version>
<scope>runtime</scope>
<classifier>common</classifier>
- </dependency>
-
- <dependency>
+ </dependency>
+
+ <!-- broken: really is a dependency on the FILE -->
+ <dependency>
<groupId>com.ogoglio</groupId>
<artifactId>ogoglio-test-applet</artifactId>
<version>0.0.1</version>
- <scope>runtime</scope>
- </dependency>
-
- <dependency>
+ <scope>runtime</scope>
+ </dependency>
+
+ <!-- broken: really is a dependency on the FILE -->
+ <dependency>
<groupId>com.ogoglio</groupId>
<artifactId>ogoglio-body-editor-applet</artifactId>
<version>0.0.1</version>
<scope>runtime</scope>
<classifier>common</classifier>
- </dependency>
-
-
+ </dependency>
</dependencies>
+
</project>
Added: maven/trunk/ogoglio-server/src/main/java/com/ogoglio/migrate/AccountsForTesting.java
===================================================================
--- maven/trunk/ogoglio-server/src/main/java/com/ogoglio/migrate/AccountsForTesting.java (rev 0)
+++ maven/trunk/ogoglio-server/src/main/java/com/ogoglio/migrate/AccountsForTesting.java 2007-08-26 22:58:59 UTC (rev 266)
@@ -0,0 +1,57 @@
+package com.ogoglio.migrate;
+
+import java.net.URI;
+import java.util.Properties;
+
+import javax.naming.Context;
+import javax.servlet.ServletConfig;
+
+import org.hibernate.SessionFactory;
+
+import com.ogoglio.persist.ServiceInitializationPersistTasks;
+import com.ogoglio.site.AbstractResourceServlet;
+
+public class AccountsForTesting implements Migration {
+
+ private static final String BOOTSTRAP_ACCT_USER_KEY = "ogoglio/bootstrapUser";
+ private static final String BOOTSTRAP_ACCT_PW_KEY = "ogoglio/bootstrapUserPW";
+
+ public boolean migrate(SessionFactory sessionFactory,
+ ServletConfig NOTUSED, Context ctx, Properties testConfig, int from, int to) {
+
+ if ((from != 0) || (to != 1)) {
+ System.out
+ .println("Migration called in the wrong place! Expected 0->1 but was:"
+ + from + "->" + to + "!");
+ System.out
+ .println("Migration called in the wrong place! Check the ordering of migration array!");
+ return false;
+ }
+ try {
+ String uriString, user, pw;
+
+ //if null, we are test mode
+ if (ctx==null) {
+ uriString=testConfig.getProperty(AbstractResourceServlet.OGOGLIO_BASE_URL_KEY.replace('/', '.'));
+ user=testConfig.getProperty(BOOTSTRAP_ACCT_USER_KEY.replace('/', '.'));
+ pw=testConfig.getProperty(BOOTSTRAP_ACCT_PW_KEY.replace('/', '.'));
+ } else {
+ uriString=(String) ctx.lookup(AbstractResourceServlet.OGOGLIO_BASE_URL_KEY);
+ user=(String) ctx.lookup(BOOTSTRAP_ACCT_USER_KEY);
+ pw=(String) ctx.lookup(BOOTSTRAP_ACCT_PW_KEY);
+ }
+ URI uri = new URI(uriString);
+ //actual work
+ ServiceInitializationPersistTasks.initializeLocalSim(uri,sessionFactory);
+ ServiceInitializationPersistTasks.initializeBootstrapAccount(sessionFactory, uri.getHost(), user, pw);
+ return true;
+ } catch (Exception e) {
+ e.printStackTrace();
+ System.err
+ .println("Exception during attempt to init DB in migration from 0->1:\n"
+ + e.getMessage());
+ return false;
+ }
+
+ }
+}
Added: maven/trunk/ogoglio-server/src/main/java/com/ogoglio/migrate/DBVersionPersistTasks.java
===================================================================
--- maven/trunk/ogoglio-server/src/main/java/com/ogoglio/migrate/DBVersionPersistTasks.java (rev 0)
+++ maven/trunk/ogoglio-server/src/main/java/com/ogoglio/migrate/DBVersionPersistTasks.java 2007-08-26 22:58:59 UTC (rev 266)
@@ -0,0 +1,55 @@
+package com.ogoglio.migrate;
+
+import org.hibernate.Query;
+import org.hibernate.Session;
+import org.hibernate.SessionFactory;
+
+import com.ogoglio.persist.HibernateTask;
+import com.ogoglio.persist.PersistException;
+
+public class DBVersionPersistTasks {
+ public final static String FIND_VERSION = "com.ogoglio.migrate.dbversions";
+
+ public static int findVersion(SessionFactory sessionFactory)
+ throws PersistException {
+ HibernateTask task = new HibernateTask() {
+ public Object run(Session session) throws PersistException {
+ Query query = session.getNamedQuery(FIND_VERSION);
+ return query.uniqueResult();
+ }
+ };
+ task.setSessionFactory(sessionFactory);
+ return ((DBVersionRecord) task.execute()).getVersion();
+ }
+
+ public static boolean updateVersion(final int newVersion,
+ final int expectedSize/* one or zero */,
+ SessionFactory sessionFactory) throws PersistException {
+ HibernateTask task = new HibernateTask() {
+ public Object run(Session session) throws PersistException {
+ Query query = session.getNamedQuery(FIND_VERSION);
+ int size = query.list().size();
+ DBVersionRecord rec;
+ if (expectedSize != size) {
+ System.out.println(
+ "Whoa! Size of returned result for db version record was ("
+ + size + ") but should have been "
+ + expectedSize + "!");
+ return Boolean.FALSE;
+ }
+ if (size == 0) {
+ rec = new DBVersionRecord();
+ } else {
+ rec = (DBVersionRecord) query.uniqueResult();
+ }
+ rec.setVersion(newVersion);
+ session.saveOrUpdate(rec);
+ System.out.println("******* Wrote new version FART:"+newVersion);
+ return Boolean.TRUE;
+ }
+ };
+ task.setSessionFactory(sessionFactory);
+ return (task.execute().equals(Boolean.TRUE));
+ }
+
+}
Added: maven/trunk/ogoglio-server/src/main/java/com/ogoglio/migrate/DBVersionRecord.java
===================================================================
--- maven/trunk/ogoglio-server/src/main/java/com/ogoglio/migrate/DBVersionRecord.java (rev 0)
+++ maven/trunk/ogoglio-server/src/main/java/com/ogoglio/migrate/DBVersionRecord.java 2007-08-26 22:58:59 UTC (rev 266)
@@ -0,0 +1,25 @@
+package com.ogoglio.migrate;
+
+public class DBVersionRecord {
+ public static int INTERNAL_DEV_STATE=-8288;
+
+ private int version=0;
+ private long id;
+
+ public DBVersionRecord() {
+
+ }
+ public long getVersionId() {
+ return id;
+ }
+ public void setVersionId(long id) {
+ this.id=id;
+ }
+ public int getVersion() {
+ return version;
+ }
+
+ public void setVersion(int version) {
+ this.version=version;
+ }
+}
Added: maven/trunk/ogoglio-server/src/main/java/com/ogoglio/migrate/DBZapTest.java
===================================================================
--- maven/trunk/ogoglio-server/src/main/java/com/ogoglio/migrate/DBZapTest.java (rev 0)
+++ maven/trunk/ogoglio-server/src/main/java/com/ogoglio/migrate/DBZapTest.java 2007-08-26 22:58:59 UTC (rev 266)
@@ -0,0 +1,37 @@
+package com.ogoglio.migrate;
+
+import junit.framework.TestCase;
+
+import org.hibernate.SessionFactory;
+
+public class DBZapTest extends TestCase {
+
+ protected SessionFactory sessionFactory;
+
+ public void setUp() {
+ try {
+ MigrationSupport support = new MigrationSupport();
+ if (!("true".equals(support.getTestConfig().getProperty("ogoglio.okToZapDB")))) {
+ fail("Whoa! Shouldn't be running tests without setting the ogoglio.okToZapDB property!");
+ }
+ if (support.initialize_version(null, null, false)==false) {
+ fail("can't get DB set up: trying to initialize it in the test code");
+ }
+
+ //if we are here, db stuff worked, but we still need to avoid all the jndi stuff
+ sessionFactory= support.createConfigurationForHibernate(MigrationSupport.DB_VERSION_NUMBER,
+ null, false).buildSessionFactory();
+ } catch (Exception e) {
+ System.out.println("-------");
+ e.printStackTrace(System.out);
+ System.out.println("---------");
+ fail("Could not setup:" + e.getMessage());
+ }
+ }
+
+ public void tearDown() {
+ if (sessionFactory!=null) {
+ sessionFactory.close();
+ }
+ }
+}
Added: maven/trunk/ogoglio-server/src/main/java/com/ogoglio/migrate/Migration.java
===================================================================
--- maven/trunk/ogoglio-server/src/main/java/com/ogoglio/migrate/Migration.java (rev 0)
+++ maven/trunk/ogoglio-server/src/main/java/com/ogoglio/migrate/Migration.java 2007-08-26 22:58:59 UTC (rev 266)
@@ -0,0 +1,15 @@
+package com.ogoglio.migrate;
+
+import java.util.Properties;
+
+import javax.naming.Context;
+import javax.servlet.ServletConfig;
+
+import org.hibernate.SessionFactory;
+
+public interface Migration {
+
+ public boolean migrate(SessionFactory sessionFactory, ServletConfig servletConfig, Context ctx,
+ Properties testConfig, int from, int to);
+
+}
Added: maven/trunk/ogoglio-server/src/main/java/com/ogoglio/migrate/MigrationSupport.java
===================================================================
--- maven/trunk/ogoglio-server/src/main/java/com/ogoglio/migrate/MigrationSupport.java (rev 0)
+++ maven/trunk/ogoglio-server/src/main/java/com/ogoglio/migrate/MigrationSupport.java 2007-08-26 22:58:59 UTC (rev 266)
@@ -0,0 +1,180 @@
+package com.ogoglio.migrate;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.Properties;
+
+import javax.naming.Context;
+import javax.naming.NamingException;
+import javax.servlet.ServletConfig;
+
+import org.hibernate.SessionFactory;
+import org.hibernate.cfg.Configuration;
+
+import com.ogoglio.persist.PersistException;
+
+public class MigrationSupport {
+
+ // THIS IS THE CRITICAL VERSION NUMBER
+ public static final int DB_VERSION_NUMBER = 1;
+
+ //check on migration okayness
+ public static final String MIGRATION_KEY = "ogoglio/okToMigrateDB";
+
+ // this is the set of semantic migrations, in order
+ public static final Migration[] migration = {
+ new AccountsForTesting()
+ };
+
+ public MigrationSupport() {
+ }
+
+ public boolean verifyVersion(ServletConfig servletConf, Context ctx) {
+ try {
+ SessionFactory sessionFactory = getCurrentConfiguration().buildSessionFactory();
+ int version = DBVersionPersistTasks.findVersion(sessionFactory);
+ if (version != DB_VERSION_NUMBER) {
+ System.out.println("DB Version Mismatch! Expected ("
+ + DB_VERSION_NUMBER + ") but got " + version + "!");
+ sessionFactory.close();
+ return tryUpgrade(servletConf, ctx, version, DB_VERSION_NUMBER,"update",true);
+ }
+ sessionFactory.close();
+ return true; // we are at the expected version
+ } catch (PersistException e) {
+ if (e.innerThrowable==null) {
+ System.out.println("Serious problem with hibernate:" + e.getMessage());
+ return false;
+ }
+ System.out.println("Unable to figure out DB version number. Likely this is a fresh database....("+e.innerThrowable.getClass().getName()+")");
+ return initialize_version(servletConf,ctx, true);
+ }
+ }
+
+ public boolean initialize_version(ServletConfig conf, Context ctx, boolean useJNDI) {
+ Configuration configuration = createConfigurationForHibernate(0,"create",useJNDI);
+ try {
+ SessionFactory factory=configuration.buildSessionFactory();
+ if (setVersionNumberOfDbViaQuery(factory,0,0)==false) {
+ factory.close();
+ return false;
+ }
+ factory.close();
+ return tryUpgrade(conf,ctx,0, DB_VERSION_NUMBER, "create",useJNDI);
+ } catch (Throwable e) {
+ System.out.println("Error trying initialized DB:" + e.getMessage());
+ return false;
+ }
+
+ }
+
+ public Configuration getCurrentConfiguration() {
+ return createConfigurationForHibernate(DB_VERSION_NUMBER, null, true);
+ }
+
+ public Configuration createConfigurationForHibernate(int num, String autoSetting, boolean useJNDI) {
+ Configuration configuration = new Configuration();
+ if (autoSetting!=null) {
+ configuration.setProperty("hibernate.hbm2ddl.auto", autoSetting);
+ }
+ if (useJNDI) {
+ configuration.setProperty("hibernate.connection.datasource","java:comp/env/jdbc/space");
+ } else {
+ Properties p=new Properties();
+ try {
+ p.load(getClass().getResourceAsStream("/test-config.properties"));
+ configuration.addProperties(p);
+ } catch (IOException e){
+ System.out.println("Unable to find the test configuration file!"+e.getMessage());
+ return configuration.configure();
+ }
+ }
+ configuration.addResource("com/ogoglio/migrate/migration-"+num+".xml");
+ return configuration.configure();
+ }
+
+ private boolean setVersionNumberOfDbViaQuery(SessionFactory sessionFactory,int targetVersion,int expectedSize) {
+ try {
+ return DBVersionPersistTasks.updateVersion(targetVersion, expectedSize, sessionFactory);
+ } catch (PersistException e) {
+ System.out.println("Problem updating the version of the database to version "+targetVersion+":"+e.getMessage());
+ return false;
+ }
+ }
+
+ public boolean tryUpgrade(ServletConfig servletConfig, Context ctx, int db_is, int db_wants_to_be,
+ String ddlMode, boolean useJNDI) {
+ if (migration.length != DB_VERSION_NUMBER) {
+ System.out
+ .println("Internal error! Migration list length should be "
+ + DB_VERSION_NUMBER + " but is " + migration.length
+ + "!");
+ return false;
+ }
+ Properties testConfig=new Properties();
+ boolean canMigrate=false;
+ if (ctx==null) {
+ //in test mode
+ testConfig = getTestConfig();
+ if ("true".equals(testConfig.getProperty("ogoglio.okToMigrateDB"))) {
+ canMigrate=true;
+ }
+ } else {
+ //not testing, but might be integration testing
+ try {
+ String migrate=(String)ctx.lookup(MIGRATION_KEY);
+ if ("true".equals(migrate)) {
+ canMigrate=true;
+ }
+ } catch (NamingException e) {
+ System.out.println("Naming exception trying to access "+MIGRATION_KEY+" from naming context!");
+ }
+ }
+
+ if (!canMigrate) {
+ System.out.println("Cannot migrate data! Property ogoglio.okToMigrateDB is false or non-existent!");
+ return false;
+ }
+
+ for (int i = db_is; i < db_wants_to_be; ++i) {
+ Migration current = migration[i];
+ System.out.println("------------------------------------------------\n");
+ System.out.println("DB: Attempting migration from " + i + " to "
+ + (i + 1) + "...");
+
+ //try to get hibernate to do the work
+ Configuration config = createConfigurationForHibernate(i+1, ddlMode ,useJNDI);
+ SessionFactory factory = config.buildSessionFactory();
+
+ //subtle: if the ddlMode is create, hibernate blows away all the data (including our version number record)
+ int expectedRecords=1;
+ if ("create".equals(ddlMode)) {
+ expectedRecords=0;
+ }
+ setVersionNumberOfDbViaQuery(factory,i+1, expectedRecords);
+
+ if (!current.migrate(factory,servletConfig, ctx, testConfig, i, i + 1)) {
+ factory.close();
+ return false;
+ }
+ factory.close();
+ System.out.println("------------------------------------------------\n");
+ }
+ return true;
+ }
+
+ public Properties getTestConfig() {
+ Properties testConfig = new Properties();
+ InputStream is=getClass().getResourceAsStream("/test-config.properties");
+ if (is==null) {
+ System.out.println("Warning! Unable to find test-config.properties! Probably something is broken!");
+ } else {
+ try {
+ testConfig.load(is);
+ } catch (IOException e) {
+ System.out.println("Warning! Error reading test-config.properties! "+e.getMessage());
+ }
+ }
+ return testConfig;
+ }
+}
Deleted: maven/trunk/ogoglio-server/src/main/java/com/ogoglio/persist/HibernateBase.java
===================================================================
--- maven/trunk/ogoglio-server/src/main/java/com/ogoglio/persist/HibernateBase.java 2007-08-26 22:57:26 UTC (rev 265)
+++ maven/trunk/ogoglio-server/src/main/java/com/ogoglio/persist/HibernateBase.java 2007-08-26 22:58:59 UTC (rev 266)
@@ -1,70 +0,0 @@
-package com.ogoglio.persist;
-
-import org.hibernate.SessionFactory;
-import org.hibernate.cfg.Configuration;
-
-import com.ogoglio.util.OgoglioProperties;
-
-/**
- * Allows the hibernate initialization code to be in one place. Serves a few different purposes, but
- * in general allows connection the hibernate DB directly from a program or test.
- * @author iansmith
- *
- */
-public class HibernateBase {
- protected Configuration config = null;
-
- protected SessionFactory sessionFactory = null;
-
- public void setupSessionFactory(String persistXMLConfig, String autoDDL, String dialect, String driver, String URI,
- String user, String pw, String poolSize) {
-
- config = new Configuration();
- config.addResource(persistXMLConfig);
-
-
- if (autoDDL!=null) {
- config.setProperty("hibernate.hbm2ddl.auto", autoDDL);
- }
- config.setProperty("hibernate.dialect", dialect);
- config.setProperty("hibernate.connection.driver_class", driver);
- config.setProperty("hibernate.connection.url", URI);
- config.setProperty("hibernate.connection.username", user);
- config.setProperty("hibernate.connection.password", pw);
- config.setProperty("hibernate.show_sql","true");
- //always want these
- config.setProperty("hibernate.connection.shutdown","true");
- config.setProperty("hibernate.connection.pool_size", poolSize);
- sessionFactory = config.buildSessionFactory();
-
- if (sessionFactory==null) {
- System.err.println("You have no hope of running properly because sessionFactory was not setup correctly");
- System.err.println("in com.ogoglio.persist.HibernateBase.java");
- System.exit(1);
- }
-
- }
-
- public SessionFactory getSessionFactory() {
- return sessionFactory;
- }
-
- public void setupSessionFactoryForTest() {
- String dialect, uri, user, pass, driver;
-
- if (OgoglioProperties.getOgoglioProperty(OgoglioProperties.WHICH_DB).equals(OgoglioProperties.WHICH_MYSQL)) {
- dialect = OgoglioProperties.getOgoglioProperty(OgoglioProperties.MYSQL_DB_DIALECT);
- driver = OgoglioProperties.getOgoglioProperty(OgoglioProperties.MYSQL_DB_DRIVER);
- uri = OgoglioProperties.getOgoglioProperty(OgoglioProperties.MYSQL_DB_TEST_URI);
- user = OgoglioProperties.getOgoglioProperty(OgoglioProperties.MYSQL_DB_TEST_USER);
- pass = OgoglioProperties.getOgoglioProperty(OgoglioProperties.MYSQL_DB_TEST_PASS);
- } else {
- dialect = OgoglioProperties.getOgoglioProperty(OgoglioProperties.HSQL_DB_DIALECT);
- driver = OgoglioProperties.getOgoglioProperty(OgoglioProperties.HSQL_DB_DRIVER);
- uri = OgoglioProperties.getOgoglioProperty(OgoglioProperties.HSQL_DB_TEST_URI);
- user = OgoglioProperties.getOgoglioProperty(OgoglioProperties.HSQL_DB_TEST_USER);
- pass = OgoglioProperties.getOgoglioProperty(OgoglioProperties.HSQL_DB_TEST_PASS);
- }
- setupSessionFactory("com/ogoglio/persist/Persist.hbm.xml",null,dialect,driver,uri,user,pass,"5");
- }
-}
Modified: maven/trunk/ogoglio-server/src/main/java/com/ogoglio/persist/HibernateTask.java
===================================================================
--- maven/trunk/ogoglio-server/src/main/java/com/ogoglio/persist/HibernateTask.java 2007-08-26 22:57:26 UTC (rev 265)
+++ maven/trunk/ogoglio-server/src/main/java/com/ogoglio/persist/HibernateTask.java 2007-08-26 22:58:59 UTC (rev 266)
@@ -63,7 +63,7 @@
// XXX This is really dodgy. This changes the type of the error from it's
// XXX true type (for example LazyInitializationException) to the PersistException
// XXX which I can only assume is to make the throws clauses easier. Ugh.
- throw new PersistException("Hibernate error: " + ex);
+ throw new PersistException(ex,"Hibernate error: " + ex);
} finally {
hibernateSession.close();
}
Deleted: maven/trunk/ogoglio-server/src/main/java/com/ogoglio/persist/HibernateTests.java
===================================================================
--- maven/trunk/ogoglio-server/src/main/java/com/ogoglio/persist/HibernateTests.java 2007-08-26 22:57:26 UTC (rev 265)
+++ maven/trunk/ogoglio-server/src/main/java/com/ogoglio/persist/HibernateTests.java 2007-08-26 22:58:59 UTC (rev 266)
@@ -1,22 +0,0 @@
-package com.ogoglio.persist;
-
-import org.hibernate.SessionFactory;
-
-import com.agical.rmock.extension.junit.RMockTestCase;
-
-public class HibernateTests extends RMockTestCase {
-
- HibernateBase base = new HibernateBase();
- protected SessionFactory sessionFactory=null;
- public void setUp() {
- if (sessionFactory==null) {
- base.setupSessionFactoryForTest();
- sessionFactory=base.getSessionFactory();
- }
- }
- public void tearDown() {
- sessionFactory.close();
- sessionFactory=null;
- }
-
-}
Modified: maven/trunk/ogoglio-server/src/main/java/com/ogoglio/persist/PersistException.java
===================================================================
--- maven/trunk/ogoglio-server/src/main/java/com/ogoglio/persist/PersistException.java 2007-08-26 22:57:26 UTC (rev 265)
+++ maven/trunk/ogoglio-server/src/main/java/com/ogoglio/persist/PersistException.java 2007-08-26 22:58:59 UTC (rev 266)
@@ -15,11 +15,17 @@
public class PersistException extends Exception {
+ public Throwable innerThrowable;
+
public PersistException() {
}
- public PersistException(String string) {
+ public PersistException(Throwable throwable, String string) {
super(string);
+ this.innerThrowable=throwable;
}
-
+
+ public PersistException(String string) {
+ this(null,string);
+ }
}
Deleted: maven/trunk/ogoglio-server/src/main/java/com/ogoglio/persist/PersistTests.java
===================================================================
--- maven/trunk/ogoglio-server/src/main/java/com/ogoglio/persist/PersistTests.java 2007-08-26 22:57:26 UTC (rev 265)
+++ maven/trunk/ogoglio-server/src/main/java/com/ogoglio/persist/PersistTests.java 2007-08-26 22:58:59 UTC (rev 266)
@@ -1,196 +0,0 @@
-/* Copyright 2007 Transmutable (http://transmutable.com/)
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License. */
-package com.ogoglio.persist;
-
-import java.net.URI;
-
-public class PersistTests extends HibernateTests {
-
- private String displayName1 = "Breakfast of Sim";
-
- private URI simURI1 = null;
-
- //private String ownerUsername = null;
-
- String username1 = null;
-
- String email1 = null;
-
- String level1 = null;
-
- String username2 = null;
-
- String email2 = null;
-
- String level2 = null;
-
- public void setUp() {
- try {
- super.setUp();
-
- username1 = AccountRecord.cleanUsername("MoonUnitZappa");
- email1 = AccountRecord.cleanEmail("mu...@ex...");
- level1 = "basic";
-
- username2 = AccountRecord.cleanUsername("KurtVonnegut");
- email2 = AccountRecord.cleanEmail("kv...@ex...");
- level2 = "pro";
-
- simURI1 = new URI("http://127.0.0.1:8080/sim");
- //ownerUsername = "Mr. Goldwater";
- } catch (Exception e) {
- fail("Could not setup:" + e);
- }
- }
-
-
- public void testRecords() {
- try {
- String ONE_TWO="1234";
-
- AccountRecord accRec1= AccountPersistTasks.findAccountByUsername(username1, sessionFactory);
- if (accRec1!=null) {
- System.out.println("Destroying leftover account test state:"+username1);
- AccountPersistTasks.delete(accRec1,sessionFactory);
- }
- accRec1 = AccountPersistTasks.createAccount(username1, level1, email1, sessionFactory);
- verifyAccountProps(accRec1,username1, email1, level1, null);
-
- accRec1.setPassword("1234");
- AccountPersistTasks.update(accRec1, sessionFactory);
-
- AccountRecord accRec2 = AccountPersistTasks.findAccountByUsername(username1, sessionFactory);
- assertNotNull(accRec2);
- verifyAccountProps(accRec2, username1, email1, level1, ONE_TWO);
-
- String templateName1 = "Plate of Raw Oysters";
- TemplateRecord templateRec1 = TemplatePersistTasks.createTemplate(templateName1 , username1, sessionFactory);
- verifyTemplateProps(templateName1, templateRec1);
-
- templateRec1 = TemplatePersistTasks.findTemplateByTemplateID(templateRec1.getTemplateID(), sessionFactory);
- verifyTemplateProps(templateName1, templateRec1);
-
- SimRecord simRecord1=SimPersistTasks.findSimsBySimURI(simURI1, sessionFactory);
- if (simRecord1!=null) {
- System.out.println("Destroying leftover sim record test state:"+
- simRecord1.getDisplayName());
- SimPersistTasks.delete(simRecord1,sessionFactory);
- }
- //ok to create sim now on that URI
- simRecord1 = SimPersistTasks.createSim(displayName1, simURI1, 2048, true, sessionFactory);
- verifySimProps(simRecord1,displayName1,simURI1,-1,2048);
-
- String displayName2 = "moon unit";
- simRecord1.setDisplayName(displayName2);
- SimPersistTasks.update(simRecord1, sessionFactory);
- assertEquals(displayName2, simRecord1.getDisplayName());
- //better test is to load it from db
- SimRecord simRecord2 = SimPersistTasks.findSimsBySimURI(simURI1, sessionFactory);
- verifySimProps(simRecord2, displayName2, simURI1, -1, 2048);
-
- //it's the same sim on the same URI so better have same id?
- assertEquals(simRecord1.getSimID(), simRecord2.getSimID());
-
- String spaceName1 = "Space 1";
- SpaceRecord spaceRecord1 = SpacePersistTasks.createSpace(spaceName1, "bubkus", sessionFactory);
- assertNull("created space with bogus username", spaceRecord1);
- spaceRecord1 = SpacePersistTasks.createSpace(spaceName1, username1, sessionFactory);
- assertNotNull(spaceRecord1);
- assertEquals(spaceName1, spaceRecord1.getDisplayName());
- assertFalse(spaceRecord1.getSpaceID() == -1);
- assertEquals(username1, spaceRecord1.getOwnerUsername());
-
- SpaceRecord spaceRecord2 = SpacePersistTasks.findSpaceBySpaceID(spaceRecord1.getSpaceID(), sessionFactory);
- assertEquals(spaceRecord1, spaceRecord2);
-
- SimRecord assignedSimRecord = SpacePersistTasks.findOrAssignSim(spaceRecord2, sessionFactory);
- assertNotNull(assignedSimRecord);
- System.out.println("XXX ASSIGNED TO SIM:"+assignedSimRecord.getSimID()+","+assignedSimRecord.getSimURI()+" -->\n"+
- "space was "+spaceRecord2.getSpaceID()+" now on "+spaceRecord2.getSimID()+","+spaceRecord2.getDisplayName());
- /*
- * IES: I spent a lot of time looking at this and could not see any way to test this given that
- * IES: that assigned sim is random. Apparently, before we were depending on a random number
- * IES: sequence doing something we expected.
- assertEquals(simRecord1.getSimURI(), assignedSimRecord.getSimURI());
- assertEquals(simRecord1.getDisplayName(), assignedSimRecord.getDisplayName());
- assertEquals(simRecord1.getSimID(), assignedSimRecord.getSimID());
- assertEquals(simRecord1, assignedSimRecord);
- */
-
- BodyRecord bodyRec1 = BodyPersistTasks.createBody(displayName1, "bogosity", sessionFactory);
- assertNull("created body with bogus username", bodyRec1);
- bodyRec1 = BodyPersistTasks.createBody(displayName1, username1, sessionFactory);
- assertNotNull(bodyRec1);
-
- BodyRecord bodyRec2 = BodyPersistTasks.findBodyByID(bodyRec1.getBodyID(), sessionFactory);
- assertNotNull(bodyRec2);
- assertEquals(bodyRec1, bodyRec2);
-
- PossessionRecord possRecord = PossessionPersistTasks.createPossession(username1, templateRec1.getTemplateID(), sessionFactory);
- assertNotNull(possRecord);
- assertEquals(username1, possRecord.getOwnerUsername());
- assertEquals(templateRec1.getTemplateID(), possRecord.getTemplateID());
- possRecord.setSpaceID(spaceRecord1.getSpaceID());
- possRecord.setThingID(12);
- PossessionPersistTasks.update(possRecord, sessionFactory);
- possRecord = PossessionPersistTasks.findPossessionByPossessionID(possRecord.getPossessionID(), sessionFactory);
- assertEquals(spaceRecord1.getSpaceID(), possRecord.getSpaceID());
- assertEquals(12, possRecord.getThingID());
-
- PossessionRecord[] possRecs1 = PossessionPersistTasks.findPossessionsByOwnerUsername(username1, sessionFactory);
- assertNotNull(possRecs1);
-
- assertEquals(username1, possRecs1[0].getOwnerUsername());
- } catch (PersistException e) {
- e.printStackTrace();
- fail();
- }
-
- try {
- // IES: testing that our weird semantics here work as expected...
- assertNull(AccountPersistTasks.createAccount(username1, level1, email2, sessionFactory));
- } catch (PersistException e) {
- fail("Should have just returned null instead of failed: " + e);
- }
- }
-
-
- private void verifySimProps(SimRecord rec, String name, URI uri, int not_id, int port) {
- assertNotNull(rec);
- assertEquals(name, rec.getDisplayName());
- assertEquals(uri, rec.getSimURI());
- assertFalse(not_id == rec.getSimID());
- assertEquals(port, rec.getEventPort());
- }
-
-
- private void verifyTemplateProps(String templateName1, TemplateRecord templateRec1) {
- assertNotNull(templateRec1);
- assertEquals(templateName1, templateRec1.getDisplayName());
- assertEquals(username1, templateRec1.getOwnerUsername());
- }
-
-
- private void verifyAccountProps(AccountRecord rec, String user, String mail, String level, String pwd) {
- assertNotNull(rec);
- assertEquals(user, rec.getUsername());
- assertEquals(mail, rec.getEmail());
- assertEquals(level, rec.getAccountlevel());
- if (pwd==null) {
- assertNull(rec.getPassword());
- } else {
- assertEquals(pwd,rec.getPassword());
- }
- }
-}
\ No newline at end of file
Modified: maven/trunk/ogoglio-server/src/main/java/com/ogoglio/persist/ServiceInitializationPersistTasks.java
===================================================================
--- maven/trunk/ogoglio-server/src/main/java/com/ogoglio/persist/ServiceInitializationPersistTasks.java 2007-08-26 22:57:26 UTC (rev 265)
+++ maven/trunk/ogoglio-server/src/main/java/com/ogoglio/persist/ServiceInitializationPersistTasks.java 2007-08-26 22:58:59 UTC (rev 266)
@@ -24,10 +24,6 @@
public static final String LOCAL_SIM_DISPLAY_NAME = "Localhost Sim";
- public static final String LIBRARY_USERNAME = "library";
-
- public static final String DEFAULT_LIBRARY_PASSWORD = "og1234";
-
public static final String DEFAULT_LAND_DISPLAY_NAME = "Default Land";
public static final String DEFAULT_DOOR_DISPLAY_NAME = "Default Door";
@@ -40,13 +36,13 @@
SimPersistTasks.createSim(LOCAL_SIM_DISPLAY_NAME, WebAPIUtil.appendToURI(serviceURI, "sim/"), SimRecord.DEFAULT_EVENT_PORT, true, sessionFactory);
}
- public static void initializeLibraryAccount(SessionFactory sessionFactory,String host) throws PersistException, IOException {
- AccountRecord accountRec = AccountPersistTasks.findAccountByUsername(LIBRARY_USERNAME, sessionFactory);
+ public static void initializeBootstrapAccount(SessionFactory sessionFactory,String host,String user, String pw) throws PersistException, IOException {
+ AccountRecord accountRec = AccountPersistTasks.findAccountByUsername(user, sessionFactory);
if (accountRec != null) {
return;
}
- accountRec = AccountPersistTasks.createAccount(LIBRARY_USERNAME, "admin", "library@"+host, sessionFactory);
- accountRec.setPassword(DEFAULT_LIBRARY_PASSWORD);
+ accountRec = AccountPersistTasks.createAccount(user, "admin", "library@"+host, sessionFactory);
+ accountRec.setPassword(pw);
AccountPersistTasks.update(accountRec, sessionFactory);
}
Deleted: maven/trunk/ogoglio-server/src/main/java/com/ogoglio/sim/script/ScriptTests.java
===================================================================
--- maven/trunk/ogoglio-server/src/main/java/com/ogoglio/sim/script/ScriptTests.java 2007-08-26 22:57:26 UTC (rev 265)
+++ maven/trunk/ogoglio-server/src/main/java/com/ogoglio/sim/script/ScriptTests.java 2007-08-26 22:58:59 UTC (rev 266)
@@ -1,114 +0,0 @@
-package com.ogoglio.sim.script;
-
-import java.io.InputStream;
-import java.util.HashMap;
-
-import javax.media.j3d.Transform3D;
-
-import junit.framework.TestCase;
-
-import com.ogoglio.sim.SpaceSimulator;
-import com.ogoglio.xml.SpaceDocument;
-import com.ogoglio.xml.SpaceEvent;
-import com.ogoglio.xml.TemplateDocument;
-import com.ogoglio.xml.ThingDocument;
-
-public class ScriptTests extends TestCase {
-
- public static final String simplestScript = "var i = 0; i++; ++i";
-
- public static final String constructorScript = "function construct(thingID) { return 'script constructed ' + thingID; }";
-
- //TODO test the script API for regressions
-
- public void testSpaceScriptEngine() {
-
- TestSpaceListener listener = new TestSpaceListener();
- SpaceSimulator spaceSimulator = null;
- try {
- SpaceDocument spaceDocument = new SpaceDocument(1, "Space", "trevor", true, 0, false, 0, 1);
- spaceSimulator = new SpaceSimulator(spaceDocument, listener);
- spaceSimulator.startSim();
-
- TemplateDocument templateDoc1 = new TemplateDocument(1, "Template 1", "trevor", "A cool template", null);
- listener.templateMap.put(new Long(1), templateDoc1);
- listener.scriptMap.put(new Long(1), simplestScript);
- ThingDocument thingDoc = spaceSimulator.addThing(templateDoc1.getTemplateID(), templateDoc1.getOwnerUsername(), templateDoc1.getDisplayName(), "trevor", 1, new Transform3D());
- assertTrue(spaceSimulator.removeThing(thingDoc.getThingID()));
-
- TemplateDocument templateDoc2 = new TemplateDocument(2, "Template 2", "trevor", "Another cool template", null);
- listener.templateMap.put(new Long(2), templateDoc2);
- listener.scriptMap.put(new Long(2), constructorScript);
- thingDoc = spaceSimulator.addThing(templateDoc2.getTemplateID(), templateDoc2.getOwnerUsername(), templateDoc2.getDisplayName(), "trevor", 2, new Transform3D());
- assertTrue(spaceSimulator.removeThing(thingDoc.getThingID()));
-
- try {
- Thread.sleep(1000);
- } catch (InterruptedException e) {
- e.printStackTrace();
- }
- }finally {
- spaceSimulator.cleanup();
- }
-
- }
-
- /*
- private static void delete(File dir) {
- File[] children = dir.listFiles();
- if(children == null) {
- return;
- }
- for (int i = 0; i < children.length; i++) {
- if(children[i].isDirectory()) {
- delete(children[i]);
- } else {
- children[i].delete();
- }
- }
- dir.delete();
- }
- */
-
- private class TestSpaceListener implements SpaceSimulator.Listener {
-
- HashMap scriptMap = new HashMap(); //Long templateIDs to String scripts
-
- HashMap templateMap = new HashMap(); //Long templateIDs to TemplateDocuments
-
- public void generatedSpaceEvent(SpaceEvent event, SpaceSimulator spaceSimulator) {
- }
-
- public String getTemplateScript(long templateID) {
- return (String)scriptMap.get(new Long(templateID));
- }
-
- public TemplateDocument getTemplateDocument(long templateID) {
- return (TemplateDocument)templateMap.get(new Long(templateID));
- }
-
- public void requestSave(SpaceSimulator simulator) {
- }
-
- public InputStream getTemplateGeometryStream(long templateID, int lodIndex) {
- return null;
- }
-
- public InputStream getTemplateResourceStream(long templateID, String name) {
- return null;
- }
-
- public boolean setPageContent(long spaceID, long thingID, long pageID, String content) {
- return false;
- }
-
- public boolean setPageContent(long spaceID, long destinationThingID, long destinationPageID, InputStream contentStream) {
- return false;
- }
-
- public void generatedSpaceEventForUser(String username, SpaceEvent event, SpaceSimulator spaceSimulator) {
- }
-
- }
-
-}
Modified: maven/trunk/ogoglio-server/src/main/java/com/ogoglio/site/AbstractResourceServlet.java
===================================================================
--- maven/trunk/ogoglio-server/src/main/java/com/ogoglio/site/AbstractResourceServlet.java 2007-08-26 22:57:26 UTC (rev 265)
+++ maven/trunk/ogoglio-server/src/main/java/com/ogoglio/site/AbstractResourceServlet.java 2007-08-26 22:58:59 UTC (rev 266)
@@ -40,16 +40,18 @@
import org.apache.commons.fileupload.disk.DiskFileItemFactory;
import org.apache.commons.fileupload.servlet.ServletFileUpload;
import org.hibernate.SessionFactory;
-import org.hibernate.cfg.Configuration;
import com.ogoglio.media.MediaService;
+import com.ogoglio.migrate.MigrationSupport;
import com.ogoglio.sim.Sim;
import com.ogoglio.util.StreamUtils;
public abstract class AbstractResourceServlet extends HttpServlet {
- private static final String HIBERNATE_SESSION_FACTORY_KEY = "com.ogoglio.hibernateSessionFactory";
+ public static final String OGOGLIO_BASE_URL_KEY = "ogoglio/baseURL";
+ public static final String HIBERNATE_SESSION_FACTORY_KEY = "com.ogoglio.hibernateSessionFactory";
+
private static final String METHOD_PARAM = "method";
private SiteResource baseResource = null;
@@ -65,11 +67,14 @@
public abstract SiteResource createBaseResource(ServletConfig servletConfig);
public void init(ServletConfig config) throws ServletException {
+ Context initCtx=null, envCtx=null;
try {
- Context initCtx = new InitialContext();
- Context envCtx = (Context) initCtx.lookup("java:comp/env");
+ initCtx = new InitialContext();
+ //creates a context on EVERY servlet? the actual VALUE of the data source is inserted by
+ //hibernate configuration
+ envCtx = (Context) initCtx.lookup("java:comp/env");
- String baseUrl = (String) envCtx.lookup("ogoglio/baseURL");
+ String baseUrl = (String) envCtx.lookup(OGOGLIO_BASE_URL_KEY);
String mediaUrl = (String) envCtx.lookup("ogoglio/mediaURL");
boolean simsAllowRemoteAccess = "true".equals(envCtx.lookup("ogoglio/simsAllowRemoteAccess"));
File mediaDirectory = null;
@@ -89,8 +94,10 @@
}
super.init(config);
- hibernateSessionFactory = getOrCreateHibernateSessionFactory(config);
-
+ hibernateSessionFactory = getOrCreateHibernateSessionFactory(config,envCtx);
+ if (hibernateSessionFactory==null) {
+ throw new IllegalStateException("Unable to create sensible hibernate configuration!");
+ }
baseResource = createBaseResource(config);
if (!(baseResource.getPathElement() instanceof String)) {
throw new IllegalStateException("The base resource must have a String path element: " + baseResource.getPathElement());
@@ -117,10 +124,15 @@
return hibernateSessionFactory;
}
- private static SessionFactory getOrCreateHibernateSessionFactory(ServletConfig config) {
+ private static SessionFactory getOrCreateHibernateSessionFactory(ServletConfig config, Context context) {
SessionFactory sessionFactory = (SessionFactory) config.getServletContext().getAttribute(HIBERNATE_SESSION_FACTORY_KEY);
if (sessionFactory == null) {
- sessionFactory = new Configuration().configure().buildSessionFactory();
+ System.out.println(config.getServletName()+" checking DB Version...");
+ MigrationSupport ms= new MigrationSupport();
+ if (!ms.verifyVersion(config,context)) {
+ throw new IllegalStateException("Cannot find a DB configuration for hibernate!");
+ }
+ sessionFactory= ms.getCurrentConfiguration().configure().buildSessionFactory();
config.getServletContext().setAttribute(HIBERNATE_SESSION_FACTORY_KEY, sessionFactory);
}
return sessionFactory;
Modified: maven/trunk/ogoglio-server/src/main/java/com/ogoglio/site/AccountServlet.java
===================================================================
--- maven/trunk/ogoglio-server/src/main/java/com/ogoglio/site/AccountServlet.java 2007-08-26 22:57:26 UTC (rev 265)
+++ maven/trunk/ogoglio-server/src/main/java/com/ogoglio/site/AccountServlet.java 2007-08-26 22:58:59 UTC (rev 266)
@@ -36,7 +36,6 @@
import com.ogoglio.persist.PersistException;
import com.ogoglio.persist.PossessionPersistTasks;
import com.ogoglio.persist.PossessionRecord;
-import com.ogoglio.persist.ServiceInitializationPersistTasks;
import com.ogoglio.persist.SimRecord;
import com.ogoglio.persist.SpaceMemberPersistTasks;
import com.ogoglio.persist.SpaceMemberRecord;
@@ -76,6 +75,8 @@
public void init(ServletConfig config) throws ServletException {
super.init(config);
+ /*
+ * IES:NOT NEEDED NOW WITH DB MIGRATION?
try {
ServiceInitializationPersistTasks.initializeLocalSim(new URI(getSiteInfo().getBaseUrl()), getSessionFactory());
ServiceInitializationPersistTasks.initializeLibraryAccount(getSessionFactory(), getSiteInfo().getHost());
@@ -89,6 +90,7 @@
e.printStackTrace();
throw new ServletException("Could not initialize service: " + e);
}
+ */
}
public SiteResource createBaseResource(ServletConfig servletConfig) {
Modified: maven/trunk/ogoglio-server/src/main/java/com/ogoglio/site/SpaceServlet.java
===================================================================
--- maven/trunk/ogoglio-server/src/main/java/com/ogoglio/site/SpaceServlet.java 2007-08-26 22:57:26 UTC (rev 265)
+++ maven/trunk/ogoglio-server/src/main/java/com/ogoglio/site/SpaceServlet.java 2007-08-26 22:58:59 UTC (rev 266)
@@ -434,6 +434,7 @@
private void doProxy(HttpServletRequest request, String method, HttpServletResponse response, String[] pathElements) throws IOException {
try {
+ System.out.println("***FART1");
AccountRecord authedAccount = AuthServlet.getAuthedAccountRecord(request, getSessionFactory());
if (authedAccount == null) {
response.setStatus(HttpServletResponse.SC_FORBIDDEN);
@@ -451,6 +452,7 @@
return;
}
+ System.out.println("***FART2");
SimRecord simRecord = SpacePersistTasks.findOrAssignSim(spaceRecord, getSessionFactory());
if (simRecord == null) {
System.err.println("Could not assign a sim to space " + spaceRecord.getSpaceID());
@@ -459,13 +461,21 @@
}
String proxyURI = simRecord.getSimURI().toString();
+ System.out.println("***FART3:"+proxyURI);
for (int i = 0; i < pathElements.length; i++) {
proxyURI += pathElements[i] + "/";
}
+ System.out.print("***FART4:");
+ for (int i=0; i< pathElements.length;++i) {
+ System.out.print(pathElements[i]+"/");
+ }
+ System.out.println("");
proxy(new URI(proxyURI), method, request, response);
+ System.out.println("***FART5");
} catch (PersistException e) {
+ System.out.println("***FART6");
e.printStackTrace();
response.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
return;
Modified: maven/trunk/ogoglio-server/src/main/java/com/ogoglio/util/OgoglioProperties.java
===================================================================
--- maven/trunk/ogoglio-server/src/main/java/com/ogoglio/util/OgoglioProperties.java 2007-08-26 22:57:26 UTC (rev 265)
+++ maven/trunk/ogoglio-server/src/main/java/com/ogoglio/util/OgoglioProperties.java 2007-08-26 22:58:59 UTC (rev 266)
@@ -47,6 +47,9 @@
if (prop!=null) {
return;
}
+
+ System.out.println("property value FART:"+System.getProperty("ogoglio.mediaURL"));
+
//init
File f = new File(System.getProperty("user.home"),PROPERTY_FILE_NAME);
prop=new OgoglioProperties();
Deleted: maven/trunk/ogoglio-server/src/main/java/com/ogoglio/util/PrepareDatabase.java
===================================================================
--- maven/trunk/ogoglio-server/src/main/java/com/ogoglio/util/PrepareDatabase.java 2007-08-26 22:57:26 UTC (rev 265)
+++ maven/trunk/ogoglio-server/src/main/java/com/ogoglio/util/PrepareDatabase.java 2007-08-26 22:58:59 UTC (rev 266)
@@ -1,95 +0,0 @@
-package com.ogoglio.util;
-
-import java.net.URI;
-
-import org.hibernate.SessionFactory;
-
-import com.ogoglio.persist.HibernateBase;
-import com.ogoglio.persist.ServiceInitializationPersistTasks;
-
-public class PrepareDatabase extends HibernateBase {
-
- /*
- * This is the beginning of a utility program to allow you be sure that your database is ready to
- * be used by the space (web) service. This opens the database in the correct mode to get it to
- * drop all the existing tables, create them according to the Persist.hbm.xml document while dumping
- * to the terminal the SQL it is using, and then exiting cleanly.
- *
- * This is program is only used on development machines to initialize their local HSQL instance
- * into a fresh state. After this program has run successfully, you can fire up the web service,
- * and the test suite can AND SHOULD be run.
- */
- /**
- * @param args IGNORED
- */
- public static void main(String[] args) {
- if (args.length!=0) {
- System.out.println("Dosen't take command line parameters, use the .ogoglio-properties file!");
- System.exit(1);
- }
- PrepareDatabase db= new PrepareDatabase();
- db.start(false);
- db.start(true);
- System.out.println("Completed successfully. DBs are now ready.");
- }
-
- public void setup...
[truncated message content] |
|
From: <ian...@us...> - 2007-08-27 16:01:32
|
Revision: 263
http://ogoglio.svn.sourceforge.net/ogoglio/?rev=263&view=rev
Author: iansmith
Date: 2007-08-26 15:52:45 -0700 (Sun, 26 Aug 2007)
Log Message:
-----------
First version that has integration tests factored out.
Added Paths:
-----------
maven/trunk/ogoglio-integration-test/.classpath
maven/trunk/ogoglio-integration-test/.project
maven/trunk/ogoglio-integration-test/.settings/
maven/trunk/ogoglio-integration-test/.settings/org.eclipse.jdt.core.prefs
maven/trunk/ogoglio-integration-test/pom.xml
maven/trunk/ogoglio-integration-test/src/
maven/trunk/ogoglio-integration-test/src/main/
maven/trunk/ogoglio-integration-test/src/main/java/
maven/trunk/ogoglio-integration-test/src/main/resources/
maven/trunk/ogoglio-integration-test/src/test/
maven/trunk/ogoglio-integration-test/src/test/java/
maven/trunk/ogoglio-integration-test/src/test/java/com/
maven/trunk/ogoglio-integration-test/src/test/java/com/ogoglio/
maven/trunk/ogoglio-integration-test/src/test/java/com/ogoglio/client/
maven/trunk/ogoglio-integration-test/src/test/java/com/ogoglio/client/test/
maven/trunk/ogoglio-integration-test/src/test/java/com/ogoglio/client/test/ClientTest.java
maven/trunk/ogoglio-integration-test/src/test/java/com/ogoglio/client/test/SpaceDuplicatorTest.java
maven/trunk/ogoglio-integration-test/src/test/java/com/ogoglio/client/test/WebAPITest.java
maven/trunk/ogoglio-integration-test/src/test/resources/
maven/trunk/ogoglio-integration-test/src/test/resources/sample-art3d/
maven/trunk/ogoglio-integration-test/src/test/resources/sample-art3d/TestCube.gif
maven/trunk/ogoglio-integration-test/src/test/resources/sample-art3d/TestCube.js
maven/trunk/ogoglio-integration-test/src/test/resources/sample-art3d/TestCube.mtl
Property Changed:
----------------
maven/trunk/ogoglio-integration-test/
Property changes on: maven/trunk/ogoglio-integration-test
___________________________________________________________________
Name: svn:ignore
+ target
Added: maven/trunk/ogoglio-integration-test/.classpath
===================================================================
--- maven/trunk/ogoglio-integration-test/.classpath (rev 0)
+++ maven/trunk/ogoglio-integration-test/.classpath 2007-08-26 22:52:45 UTC (rev 263)
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" path="src/main/java"/>
+ <classpathentry kind="src" path="src/test/java"/>
+ <classpathentry excluding="**" kind="src" output="src/main/resources" path="src/main/resources"/>
+ <classpathentry excluding="**" kind="src" output="src/test/resources" path="src/test/resources"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+ <classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>
+ <classpathentry kind="output" path="target/classes"/>
+</classpath>
Added: maven/trunk/ogoglio-integration-test/.project
===================================================================
--- maven/trunk/ogoglio-integration-test/.project (rev 0)
+++ maven/trunk/ogoglio-integration-test/.project 2007-08-26 22:52:45 UTC (rev 263)
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>ogoglio-integration-test</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.maven.ide.eclipse.maven2Builder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ <nature>org.maven.ide.eclipse.maven2Nature</nature>
+ </natures>
+</projectDescription>
Added: maven/trunk/ogoglio-integration-test/.settings/org.eclipse.jdt.core.prefs
===================================================================
--- maven/trunk/ogoglio-integration-test/.settings/org.eclipse.jdt.core.prefs (rev 0)
+++ maven/trunk/ogoglio-integration-test/.settings/org.eclipse.jdt.core.prefs 2007-08-26 22:52:45 UTC (rev 263)
@@ -0,0 +1,5 @@
+#Sat Aug 25 14:50:50 PDT 2007
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.2
+org.eclipse.jdt.core.compiler.compliance=1.4
+org.eclipse.jdt.core.compiler.source=1.3
Added: maven/trunk/ogoglio-integration-test/pom.xml
===================================================================
--- maven/trunk/ogoglio-integration-test/pom.xml (rev 0)
+++ maven/trunk/ogoglio-integration-test/pom.xml 2007-08-26 22:52:45 UTC (rev 263)
@@ -0,0 +1,195 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>ogoglio-integration-test</groupId>
+ <artifactId>ogoglio-integration-test</artifactId>
+ <version>0.0.1</version>
+ <packaging>pom</packaging>
+
+ <build>
+ <plugins>
+ <!-- COMPILER needed b/c POM packaging by default doesn't build the tests -->
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <configuration>
+ </configuration>
+ <executions>
+ <execution>
+ <id>build integration tests</id>
+ <goals>
+ <goal>testCompile</goal>
+ </goals>
+ <phase>test-compile</phase>
+ </execution>
+ </executions>
+ </plugin>
+
+ <!-- RESOURCES needed b/c POM packaging by default doesn't copy test resources -->
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-resources-plugin</artifactId>
+ <configuration>
+ </configuration>
+ <executions>
+ <execution>
+ <id>build integration tests</id>
+ <goals>
+ <goal>testResources</goal>
+ </goals>
+ <phase>process-test-resources</phase>
+ </execution>
+ </executions>
+ </plugin>
+
+ <!-- SUREFIRE WITH INTEGRATION TEST -->
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <configuration>
+ <skip>true</skip><!-- this is critical to avoid running unit tests, sets default value for skip -->
+ </configuration>
+ <executions>
+ <execution>
+ <id>over the wire tests</id>
+ <phase>integration-test</phase>
+ <goals>
+ <goal>test</goal>
+ </goals>
+ <configuration>
+ <excludes>
+ <exclude>
+ **/SpaceDuplicatorTest.java
+ </exclude>
+ </excludes>
+ <skip>false</skip><!-- don't skip integration tests -->
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ <!-- CARGO FOR STOP/START THE SERVER -->
+ <plugin>
+ <groupId>org.codehaus.cargo</groupId>
+ <artifactId>cargo-maven2-plugin</artifactId>
+ <version>0.3-SNAPSHOT</version>
+ <executions>
+ <execution>
+ <id>get-up</id>
+ <phase>pre-integration-test</phase>
+ <goals>
+ <goal>start</goal>
+ </goals>
+ <configuration>
+ <wait>false</wait>
+ </configuration>
+ </execution>
+
+ <execution>
+ <id>get-down</id>
+ <phase>post-integration-test</phase>
+ <goals>
+ <goal>stop</goal>
+ </goals>
+ <configuration>
+ <wait>true</wait>
+ </configuration>
+ </execution>
+ <execution>
+ <!-- get rid of leftover tomcat's if they exist -->
+ <id>kill if exists</id>
+ <phase>test</phase> <!-- just needs to be before integration test -->
+ <goals>
+ <goal>stop</goal>
+ </goals>
+ <configuration>
+ <wait>false</wait>
+ </configuration>
+ </execution>
+ </executions>
+
+ <!-- CARGO CONFIG -->
+ <configuration>
+ <!-- tomcat 5.5 running on the same machine...-->
+ <container>
+ <containerId>tomcat5x</containerId>
+ <home>${cargo.tomcat5x.home}</home>
+ <type>installed</type>
+ <log>
+ ${project.build.directory}/tomcat5x.log
+ </log>
+ <output>
+ ${project.build.directory}/tomcat5x.out
+ </output>
+ <logLevel>debug</logLevel>
+ </container>
+
+ <!-- tomcat configuration -->
+ <configuration>
+ <home>${project.build.directory}/tomcat5x</home>
+ <properties>
+ <cargo.servlet.port>
+ 8080
+ </cargo.servlet.port>
+ <cargo.logging>high</cargo.logging>
+ </properties>
+ <!-- our app to deploy -->
+ <deployables>
+ <deployable>
+
+ <groupId>com.ogoglio</groupId>
+ <artifactId>ogoglio-server</artifactId>
+ <type>war</type>
+
+ <properties>
+ <context>ogoglio-server</context>
+ </properties>
+
+ </deployable>
+ </deployables>
+
+ </configuration>
+ </configuration>
+
+ </plugin>
+
+ </plugins>
+ </build>
+ <!-- -->
+ <!-- PLUGIN REPOS -->
+ <!-- -->
+ <pluginRepositories>
+ <!-- CARGO -->
+ <pluginRepository>
+ <id>codehaus snapshot repository</id>
+ <url>http://snapshots.repository.codehaus.org/</url>
+ <releases>
+ <enabled>true</enabled>
+ </releases>
+ </pluginRepository>
+ </pluginRepositories>
+ <dependencies>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>3.8.1</version>
+ </dependency>
+ <!-- -->
+ <!-- OGOGLIO DEPENDENCIES-->
+ <!-- -->
+ <dependency>
+ <groupId>com.ogoglio</groupId>
+ <artifactId>ogoglio-server</artifactId>
+ <version>0.0.1</version>
+ <type>war</type>
+ </dependency>
+ <dependency>
+ <groupId>com.ogoglio</groupId>
+ <artifactId>ogoglio-common</artifactId>
+ <version>0.0.1</version>
+ </dependency>
+
+ </dependencies>
+</project>
+
Added: maven/trunk/ogoglio-integration-test/src/test/java/com/ogoglio/client/test/ClientTest.java
===================================================================
--- maven/trunk/ogoglio-integration-test/src/test/java/com/ogoglio/client/test/ClientTest.java (rev 0)
+++ maven/trunk/ogoglio-integration-test/src/test/java/com/ogoglio/client/test/ClientTest.java 2007-08-26 22:52:45 UTC (rev 263)
@@ -0,0 +1,881 @@
+/* Copyright 2007 Transmutable (http://transmutable.com/)
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License. */
+package com.ogoglio.client.test;
+
+import java.awt.Shape;
+import java.io.FileNotFoundException;
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.URI;
+import java.text.ParseException;
+import java.util.Date;
+import java.util.Random;
+import java.util.Vector;
+
+import javax.media.j3d.Transform3D;
+
+import junit.framework.TestCase;
+import nanoxml.XMLElement;
+
+import com.ogoglio.client.SpaceClient;
+import com.ogoglio.client.WebAPIAuthenticator;
+import com.ogoglio.client.WebAPIAuthenticatorFactory;
+import com.ogoglio.client.WebAPIClient;
+import com.ogoglio.client.WebAPIClientWire;
+import com.ogoglio.client.WebAPIDescriptor;
+import com.ogoglio.client.WebAPIGuestAuthenticator;
+import com.ogoglio.client.model.Door;
+import com.ogoglio.client.model.Page;
+import com.ogoglio.client.model.Space;
+import com.ogoglio.client.model.SplinePath;
+import com.ogoglio.client.model.Thing;
+import com.ogoglio.client.model.User;
+import com.ogoglio.util.StreamUtils;
+import com.ogoglio.util.WebConstants;
+import com.ogoglio.xml.AccountDocument;
+import com.ogoglio.xml.AuthDocument;
+import com.ogoglio.xml.BodyDocument;
+import com.ogoglio.xml.DoorDocument;
+import com.ogoglio.xml.PageDocument;
+import com.ogoglio.xml.PossessionDocument;
+import com.ogoglio.xml.ShapeDocument;
+import com.ogoglio.xml.SpaceDocument;
+import com.ogoglio.xml.SpaceMemberDocument;
+import com.ogoglio.xml.TemplateDocument;
+import com.ogoglio.xml.TemplateSupportFileDocument;
+import com.ogoglio.xml.ThingDocument;
+import com.ogoglio.xml.UserDocument;
+import com.sun.org.apache.xalan.internal.xsltc.compiler.Template;
+
+public class ClientTest extends TestCase {
+
+ public static final String PASSWORD1 = "1234";
+
+ public static final String USERNAME1 = "susan";
+
+ public static final String USERNAME2 = "tina";
+
+ public static final String COOKIE1 = "tr5w95nxracntj";
+
+ public static final String COOKIE2 = "trMoonUnitZappa";
+
+ URI linkURI1 = null;
+
+ URI serviceURI1 = null;
+
+ WebAPIClientWire wire1 = null;
+
+ WebAPIDescriptor descriptor1 = null;
+
+
+ public void setUp() {
+ try {
+ serviceURI1 = new URI("http://127.0.0.1:8080/og/"); //best choice: 127.0.0.1 for tests
+ linkURI1 = new URI("http://example.com/");
+ wire1 = new WebAPIClientWire();
+ descriptor1 = new WebAPIDescriptor(serviceURI1);
+ } catch (Throwable e) {
+ e.printStackTrace();
+ fail(e.getMessage());
+ }
+ }
+
+ public void tearDown() {
+
+ }
+
+ public void testWebAdmin() {
+ try {
+ WebAPIAuthenticator adminAuthenticator =
+ new WebAPIAuthenticatorFactory().authenticate(wire1, descriptor1,
+ //"library","fart98121");
+ WebConstants.getBootstrapUsername(), WebConstants.getBootstrapUserPW());
+ assertNotNull("got null auth cookie", adminAuthenticator.getAuthCookie());
+
+ WebAPIClient adminWebClient = new WebAPIClient(descriptor1, adminAuthenticator, wire1);
+ try {
+ adminWebClient.createAccount(USERNAME1, AccountDocument.ACCOUNT_LEVEL_ADVANCED, "Susan", "Examplar", "http://example.com/susan/", "su...@ex...", PASSWORD1);
+ adminWebClient.createAccount(USERNAME2, AccountDocument.ACCOUNT_LEVEL_ADVANCED, "Tina", "Examplar", "http://example.com/tina/", "ti...@ex...", PASSWORD1);
+ } catch (IOException e) {
+ //may already exist
+ }
+
+ WebAPIAuthenticator basicAuthenticator = new WebAPIAuthenticator(wire1, descriptor1, USERNAME1, PASSWORD1);
+ assertNotNull("got null auth cookie", basicAuthenticator.getAuthCookie());
+ WebAPIClient basicWebClient = new WebAPIClient(descriptor1, basicAuthenticator, wire1);
+ try {
+ String failedUsername = "Bogosity" + System.currentTimeMillis();
+ AccountDocument doc = basicWebClient.createAccount(failedUsername, AccountDocument.ACCOUNT_LEVEL_BASIC, "Shouldnt", "Exist", null, failedUsername + "@example.com", "1234");
+ if (doc != null) {
+ fail();
+ }
+ } catch (Exception e) {
+ //this should happen, because basic accounts can't create new accounts
+ }
+
+ String username = "testuser" + Math.abs(new Random().nextLong());
+ adminWebClient.createAccount(username, AccountDocument.ACCOUNT_LEVEL_BASIC, "Test", "Sims", null, username + "@example.com", "1234");
+
+ AccountDocument accountDoc = adminWebClient.getAccountDocument(username);
+ assertNotNull(accountDoc);
+ assertEquals("Test", accountDoc.getFirstName());
+ assertEquals("Sims", accountDoc.getLastName());
+
+ Date frozenDate = new Date(System.currentTimeMillis() + 1000000);
+ accountDoc.setFrozenUntil(frozenDate);
+ accountDoc.setAccountLevel(AccountDocument.ACCOUNT_LEVEL_ADMIN);
+ adminWebClient.updateAccount(accountDoc);
+ accountDoc = adminWebClient.getAccountDocument(username);
+ assertTrue(frozenDate.getTime() - accountDoc.getFrozenUntil().getTime() < 1000);
+ assertEquals(AccountDocument.ACCOUNT_LEVEL_ADMIN, accountDoc.getAccountLevel());
+ accountDoc.setFrozenUntil(new Date(1000));
+ accountDoc.setAccountLevel(AccountDocument.ACCOUNT_LEVEL_BASIC);
+ accountDoc=adminWebClient.updateAccount(accountDoc);
+ AccountDocument ac2= adminWebClient.getAccountDocument(username);
+ assertNull(accountDoc.getFrozenUntil());
+ assertNull(ac2.getFrozenUntil());
+ assertEquals(AccountDocument.ACCOUNT_LEVEL_BASIC, accountDoc.getAccountLevel());
+
+ } catch (Exception e) {
+ e.printStackTrace();
+ fail("Might want to check to make sure database exists and library account exists...");
+ }
+ }
+
+ public void testWebAPIClient() {
+ SpaceClient spaceClient1 = null;
+ SpaceClient guestSpaceClient1 = null;
+
+ try {
+ //this section sets up the key variables
+ WebAPIAuthenticator auth1 = new WebAPIAuthenticator(wire1, descriptor1, USERNAME1, PASSWORD1);
+ WebAPIClient webClient1 = new WebAPIClient(descriptor1, auth1, wire1);
+ SpaceDocument spaceDocument = webClient1.createSpace("Susan's Space");
+ assertNotNull(spaceDocument);
+
+ WebAPIAuthenticator auth2 = new WebAPIAuthenticator(wire1, descriptor1, USERNAME2, PASSWORD1);
+ WebAPIClient webClient2 = new WebAPIClient(descriptor1, auth2, wire1);
+
+ checkNoConnectionToSpaceWithoutAuth(spaceDocument.getSpaceID());
+
+ checkAuthDoc(auth1, auth2);
+
+ spaceDocument = checkSpaceSeaLevel(webClient1, spaceDocument);
+
+ checkSettings(spaceDocument.getSpaceID(), webClient1);
+
+ checkBody(webClient1, auth1);
+
+ checkSpaceMembership(spaceDocument.getSpaceID(), webClient1);
+
+ checkSpaceAuthWithMembership(auth2, webClient2, webClient1, spaceDocument);
+
+ TemplateDocument newTemplateDoc = checkTemplateScriptAPI(webClient1);
+ ThingDocument[] thingDocs = checkTemplateGeomMaterialsAndPossessions(webClient1, newTemplateDoc, spaceDocument);
+
+
+ //IES CHECK: after messing around above, verify we are are ok
+ thingDocs = webClient1.getThingDocuments(spaceDocument.getSpaceID());
+ assertEquals(1, thingDocs.length);
+
+ checkPageManipulation(webClient1, thingDocs[0], spaceDocument);
+
+ //figure out the last template added
+ TemplateDocument[] templateDocs = webClient1.getTemplateDocuments(USERNAME1);
+ long lastTemplateID = templateDocs[templateDocs.length - 1].getTemplateID();
+
+ checkDoors(webClient1, spaceDocument, lastTemplateID);
+
+ spaceClient1 = checkConnectedUsersToSpace(auth1, webClient1, spaceDocument);
+
+ checkGeomAndResourceStreamsOfTemplate(webClient1, auth1.getUsername(), lastTemplateID);
+
+ authThenBuildSpaceClient(spaceDocument.getSpaceID(), auth1);
+
+ checkGeometryAvailableForSpace(webClient1, thingDocs, spaceClient1.getSpace());
+
+ guestSpaceClient1 = checkGuestCookieOperation(spaceDocument.getSpaceID(), webClient1, WebConstants.GUEST_COOKIE_PREFIX + "Test_Suite_Guest");
+ checkDeletingSpaceDestroysThings(spaceDocument.getSpaceID(), webClient1, USERNAME1);
+
+ } catch (IOException e) {
+ e.printStackTrace();
+ fail();
+ } finally {
+ if (spaceClient1 != null) {
+ spaceClient1.cleanup();
+ }
+ if (guestSpaceClient1 != null) {
+ guestSpaceClient1.cleanup();
+ }
+ }
+
+ }
+
+ private UserDocument[] verifyUserDocsBySize(WebAPIClient webClient1, long spaceID, int expectedLen, String expectedUsername) throws IOException {
+ UserDocument[] userDocs = webClient1.getUserDocuments(spaceID);
+ assertTrue(userDocs.length == expectedLen);
+ if (expectedUsername != null) {
+ assertEquals(expectedUsername, userDocs[0].getUsername());
+ }
+ return userDocs;
+ }
+
+ private void checkAuthDoc(WebAPIAuthenticator auth1, WebAPIAuthenticator auth2) {
+ AuthDocument authDoc = getAuthDoc(null);
+ assertFalse(authDoc.isAuthenticated());
+ assertNull(authDoc.getUsername());
+
+ authDoc = getAuthDoc("BadBadCookie");
+ assertFalse(authDoc.isAuthenticated());
+ assertNull(authDoc.getUsername());
+
+ authDoc = getAuthDoc(auth1.getAuthCookie());
+ assertTrue(authDoc.isAuthenticated());
+ assertEquals(USERNAME1, authDoc.getUsername());
+
+ authDoc = getAuthDoc(auth2.getAuthCookie());
+ assertTrue(authDoc.isAuthenticated());
+ assertEquals(USERNAME2, authDoc.getUsername());
+ }
+
+ private AuthDocument getAuthDoc(String authCookie) {
+ try {
+ XMLElement element = wire1.fetchAuthenticatedXML(descriptor1.getMeAuthURI(), authCookie);
+ return new AuthDocument(element);
+ } catch (IOException e) {
+ fail("Error fetching auth document with no auth cookie: " + e);
+ return null;
+ }
+ }
+
+ private void checkSpaceAuthWithMembership(WebAPIAuthenticator memberAuth, WebAPIClient memberClient, WebAPIClient ownerClient, SpaceDocument spaceDocument) throws IOException {
+ SpaceMemberDocument[] membershipDocs;
+ membershipDocs = memberClient.getUsersSpaceMemberships();
+ assertEquals(1, membershipDocs.length);
+ assertEquals(spaceDocument.getSpaceID(), membershipDocs[0].getSpaceID());
+ assertEquals(memberAuth.getUsername(), membershipDocs[0].getMemberUsername());
+ SpaceMemberDocument[] spaceMemberDocs = ownerClient.getSpaceMemberDocuments(spaceDocument.getSpaceID());
+ assertFalse("member doc length = " + spaceMemberDocs.length, spaceMemberDocs.length == 0);
+ assertEquals(spaceMemberDocs[0].getMemberUsername(), memberAuth.getUsername());
+
+ ownerClient.removeSpaceMember(spaceDocument.getSpaceID(), memberAuth.getUsername());
+ membershipDocs = memberClient.getUsersSpaceMemberships();
+ assertEquals(0, membershipDocs.length);
+ }
+
+ private void checkSpaceMembership(long spaceID, WebAPIClient webClient1) throws IOException {
+ SpaceMemberDocument[] membershipDocs = webClient1.getUsersSpaceMemberships();
+ assertNotNull(membershipDocs);
+ assertEquals(0, membershipDocs.length);
+
+ webClient1.addSpaceMember(spaceID, USERNAME2, SpaceMemberDocument.MEMBER);
+ membershipDocs = webClient1.getSpaceMemberDocuments(spaceID);
+ assertNotNull(membershipDocs);
+ assertEquals(1, membershipDocs.length);
+ assertEquals(USERNAME2, membershipDocs[0].getMemberUsername());
+ assertEquals(SpaceMemberDocument.MEMBER, membershipDocs[0].getRole());
+ }
+
+ private void checkSettings(long spaceID, WebAPIClient webClient1) throws IOException {
+ String key1 = "ogoglio.key.1";
+ String value1 = "This is a very fine value which is < 1";
+ Object v = webClient1.getSpaceSetting(spaceID, key1);
+
+ assertNull(v);
+
+ webClient1.putSpaceSetting(spaceID, key1, value1);
+ assertEquals(value1, webClient1.getSpaceSetting(spaceID, key1));
+
+ String key2 = "ogoglio.key.2";
+ String value2 = "This is a very fine value & it's value is > 2";
+ assertNull(webClient1.getSpaceSetting(spaceID, key2));
+ webClient1.putSpaceSetting(spaceID, key2, value2);
+ assertEquals(value2, webClient1.getSpaceSetting(spaceID, key2));
+ assertEquals(value1, webClient1.getSpaceSetting(spaceID, key1));
+
+ webClient1.removeSpaceSetting(spaceID, key1);
+ assertNull(webClient1.getSpaceSetting(spaceID, key1));
+ webClient1.removeSpaceSetting(spaceID, key2);
+ assertNull(webClient1.getSpaceSetting(spaceID, key2));
+
+ }
+
+ private void checkBody(WebAPIClient webClient1, WebAPIAuthenticator authenticator) throws IOException {
+ AccountDocument ownerDoc = authenticator.getAccountDocument(true);
+ assertNotNull(ownerDoc);
+ assertEquals(USERNAME1, ownerDoc.getUsername());
+ long defaultBody = ownerDoc.getDefaultBodyID();
+ BodyDocument bodyDoc = webClient1.createBody("Testing Body");
+ assertFalse(bodyDoc.getBodyID() == -1);
+ assertEquals(ownerDoc.getUsername(), bodyDoc.getOwnerUsername());
+ assertEquals(0, bodyDoc.getHairIndex());
+ assertEquals(0, bodyDoc.getEyesIndex());
+ assertEquals(0, bodyDoc.getNoseIndex());
+ assertEquals(0, bodyDoc.getMouthIndex());
+ assertEquals(0, bodyDoc.getFaceIndex());
+ ownerDoc = webClient1.setDefaultBody(bodyDoc.getBodyID());
+ assertEquals(bodyDoc.getBodyID(), ownerDoc.getDefaultBodyID());
+ assertEquals(ownerDoc.getUsername(), bodyDoc.getOwnerUsername());
+ bodyDoc.setEyesIndex(3);
+ bodyDoc = webClient1.updateBody(bodyDoc);
+ assertEquals(3, bodyDoc.getEyesIndex());
+ assertFalse(webClient1.deleteBody(bodyDoc.getBodyID()));
+ webClient1.setDefaultBody(defaultBody);
+ assertTrue(webClient1.deleteBody(bodyDoc.getBodyID()));
+ ownerDoc = webClient1.setDefaultBody(bodyDoc.getBodyID());
+ assertEquals(defaultBody, ownerDoc.getDefaultBodyID());
+ }
+
+ private SpaceDocument checkSpaceSeaLevel(WebAPIClient webClient1, SpaceDocument spaceDocument) throws IOException {
+ assertFalse(spaceDocument.getDisplaySea());
+ assertEquals(0, spaceDocument.getSeaLevel(), 0.001);
+ webClient1.setSpaceSeaLevel(spaceDocument.getSpaceID(), -2);
+ spaceDocument = webClient1.getSpaceDocument(spaceDocument.getSpaceID(), false);
+ assertEquals(-2, spaceDocument.getSeaLevel(), 0.000001);
+ webClient1.setSpaceDisplaySea(spaceDocument.getSpaceID(), true);
+ spaceDocument = webClient1.getSpaceDocument(spaceDocument.getSpaceID(), false);
+ assertTrue(spaceDocument.getDisplaySea());
+ return spaceDocument;
+ }
+
+ private void checkNoConnectionToSpaceWithoutAuth(long spaceID) {
+ try {
+ WebAPIGuestAuthenticator guestAuth = new WebAPIGuestAuthenticator(descriptor1, WebConstants.GUEST_COOKIE_PREFIX + "Test_Suite_Guest");
+ new WebAPIClient(descriptor1, guestAuth, wire1).getSpaceDocument(spaceID, false);
+ fail("Should get an IOException when not authed");
+ } catch (IOException e) {
+ //this should happen
+ }
+ }
+
+ private SpaceClient authThenBuildSpaceClient(long spaceID, WebAPIAuthenticator auth1) throws IOException {
+ TestSpaceClientListener listener = new TestSpaceClientListener();
+ SpaceClient spaceClient1 = new SpaceClient(spaceID, serviceURI1, auth1.getAuthCookie(), listener);
+ return spaceClient1;
+ }
+
+ private void checkGeometryAvailableForSpace(WebAPIClient webClient1, ThingDocument[] thingDocs, Space space1) throws IOException {
+ TestListener testListener = new TestListener();
+ space1.addListener(testListener, false);
+
+ //make sure we can get one thing from the space (maybe floor?) and check geom stream
+ assertNotNull(space1.getThing(1));
+ InputStream stream = space1.getThing(1).getGeometryStream(0);
+ assertNotNull(stream);
+ consume(stream);
+
+ // get our possession out of the space
+ long possID = thingDocs[0].getPossessionID();
+ webClient1.removePossessionFromSpace(possID);
+ thingDocs = webClient1.getThingDocuments(space1.getSpaceID());
+ assertEquals(0, thingDocs.length);
+
+ //put it back so the world is in the same state
+ //XXX EVIL! DEPENDENCY BETWEEN TESTS! BOO HISS!
+ webClient1.addPossessionToSpace(possID, space1.getSpaceID());
+ }
+
+ private SpaceClient checkGuestCookieOperation(long spaceID, WebAPIClient webClient1, String guestCookie1) throws IOException {
+ assertNotNull(guestCookie1);
+
+ try {
+ //try to get into the space without proper credentials
+ new SpaceClient(spaceID, serviceURI1, guestCookie1, new TestSpaceClientListener());
+ fail("Should not be able to guest into the space yet");
+ } catch (IOException e) {
+ //this should happen
+ }
+ //switch to public with 5 possible guests
+ webClient1.setSpacePublished(spaceID, true);
+ assertEquals(true, webClient1.getSpaceDocument(spaceID, false).isPublished());
+ webClient1.setSpaceMaxGuests(spaceID, 5);
+ assertEquals(5, webClient1.getSpaceDocument(spaceID, false).getMaxGuests());
+
+ //now connect as a guest
+ SpaceClient guestSpaceClient1 = new SpaceClient(spaceID, serviceURI1, guestCookie1, new TestSpaceClientListener());
+ try {
+ Thread.sleep(1000);
+ } catch (InterruptedException e) {
+ e.printStackTrace();
+ }
+
+ //two users currently connected and one of them better be same as our cookie?
+ UserDocument[] userDocs = verifyUserDocsBySize(webClient1, spaceID, 2, null);
+ assertTrue(guestCookie1.equals(userDocs[1].getUsername()) || guestCookie1.equals(userDocs[0].getUsername()));
+ return guestSpaceClient1;
+ }
+
+ private SpaceClient checkConnectedUsersToSpace(WebAPIAuthenticator auth, WebAPIClient webClient1, SpaceDocument spaceDoc) throws IOException {
+ //there are no user documents because there are no current connections?
+ verifyUserDocsBySize(webClient1, spaceDoc.getSpaceID(), 0, null);
+ //create a connection to the space
+ SpaceClient spaceClient1 = new SpaceClient(spaceDoc.getSpaceID(), serviceURI1, auth.getAuthCookie(), new TestSpaceClientListener());
+ try {
+ Thread.sleep(1000);
+ } catch (Exception e) {
+ }
+ //now check that we are the sole client
+ verifyUserDocsBySize(webClient1, spaceDoc.getSpaceID(), 1, USERNAME1);
+ spaceClient1.cleanup();
+ return spaceClient1;
+ }
+
+ private void checkDoors(WebAPIClient webClient1, SpaceDocument spaceDocument, long lastTemplateID) throws IOException {
+ DoorDocument[] doorDocs = webClient1.getDoorDocuments(spaceDocument.getSpaceID());
+ //no doors yet?
+ assertEquals(0, doorDocs.length);
+ //make a new door
+ DoorDocument doorDoc = webClient1.createDoor(spaceDocument.getSpaceID(), lastTemplateID, USERNAME1, "Test Door", linkURI1, new Transform3D());
+ assertNotNull(doorDoc);
+ assertFalse(doorDoc.getDoorID() == -1);
+ assertEquals(linkURI1, doorDoc.getLink());
+ assertEquals("Test Door", doorDoc.getDisplayName());
+
+ //make sure the new door is now in the list
+ doorDocs = webClient1.getDoorDocuments(spaceDocument.getSpaceID());
+ assertEquals(1, doorDocs.length);
+ assertEquals(doorDoc.getDoorID(), doorDocs[0].getDoorID());
+ //blow away the door and make sure it's really gone
+ assertTrue(webClient1.deleteDoor(spaceDocument.getSpaceID(), doorDoc.getDoorID()));
+ doorDocs = webClient1.getDoorDocuments(spaceDocument.getSpaceID());
+ assertEquals(0, doorDocs.length);
+
+ }
+
+ private void checkGeomAndResourceStreamsOfTemplate(WebAPIClient webClient1, String ownerUsername, long templateID) throws IOException {
+ InputStream stream = webClient1.getTemplateGeometryStream(ownerUsername, templateID, 0);
+ assertNotNull(stream);
+ consume(stream);
+
+ //get a material file for the same template
+ stream = webClient1.getTemplateResourceStream(ownerUsername, templateID, "TestCube.mtl");
+ assertNotNull(stream);
+ consume(stream);
+
+ assertTrue(webClient1.deleteTemplateGeometryStream(ownerUsername, templateID, 0));
+ try {
+ webClient1.getTemplateGeometryStream(ownerUsername, templateID, 0);
+ fail("Shouldn't be able to get a deleted stream!");
+ } catch (IOException e) {
+ //can't get the stream because we just deleted it
+ assertTrue(e.getMessage().indexOf("404") != -1); //very weak test
+ }
+
+ webClient1.uploadTemplateGeometryStream(ownerUsername, templateID, 0, getClass().getResourceAsStream("/sample-art3d/TestCylinder.obj"));
+ }
+
+ private void checkPageManipulation(WebAPIClient webClient1, ThingDocument someThing, SpaceDocument spaceDoc) throws IOException {
+ //no pages, right? ... hasn't this thing already been destroyed?
+ PageDocument[] pages = webClient1.getPageDocuments(spaceDoc.getSpaceID(), someThing.getThingID());
+ assertEquals(0, pages.length);
+
+ //make a new page
+ PageDocument pageDoc = webClient1.createPage(spaceDoc.getSpaceID(), someThing.getThingID(), 1, 1, "text/plain");
+ assertNotNull(pageDoc);
+
+ //set the pages text and make sure we can read it back properly
+ String pageText = "This is a test of the emergency broadcast system. This is only a test.";
+ webClient1.setPageContents(spaceDoc.getSpaceID(), someThing.getThingID(), pageDoc.getPageID(), pageText);
+ InputStream pageStream = webClient1.getPageContents(spaceDoc.getSpaceID(), someThing.getThingID(), pageDoc.getPageID());
+ assertNotNull(pageStream);
+ String fetchedPageText = StreamUtils.readInput(pageStream);
+ assertEquals(pageText + " didn't match " + fetchedPageText, pageText, fetchedPageText);
+ //reset page text
+ pageText = "Hi ho";
+ webClient1.setPageContents(spaceDoc.getSpaceID(), someThing.getThingID(), pageDoc.getPageID(), pageText);
+ pageStream = webClient1.getPageContents(spaceDoc.getSpaceID(), someThing.getThingID(), pageDoc.getPageID());
+ assertNotNull(pageStream);
+ fetchedPageText = StreamUtils.readInput(pageStream);
+ assertEquals(pageText, fetchedPageText);
+ pageDoc.setX(10);
+ pageDoc.setY(20);
+ pageDoc.setZ(30);
+ PageDocument updatedPageDoc = webClient1.updatePage(spaceDoc.getSpaceID(), someThing.getThingID(), pageDoc);
+ assertTrue(10 == updatedPageDoc.getX());
+ assertTrue(20 == updatedPageDoc.getY());
+ assertTrue(30 == updatedPageDoc.getZ());
+ pages = webClient1.getPageDocuments(spaceDoc.getSpaceID(), someThing.getThingID());
+ assertEquals(1, pages.length);
+ assertTrue(webClient1.deletePage(spaceDoc.getSpaceID(), someThing.getThingID(), pageDoc.getPageID()));
+ pages = webClient1.getPageDocuments(spaceDoc.getSpaceID(), someThing.getThingID());
+ assertEquals(0, pages.length);
+ }
+
+ private ThingDocument[] checkTemplateGeomMaterialsAndPossessions(WebAPIClient webClient1, TemplateDocument newTemplateDoc, SpaceDocument spaceDocument) throws IOException, FileNotFoundException {
+ TemplateDocument baseDoc, afterCylDoc;
+ String CUBE_GIF = "TestCube.gif";
+ String CUBE_MATERIAL = "TestCube.mtl";
+
+ Class clazz=getClass();
+ webClient1.uploadTemplateGeometryStream(newTemplateDoc.getOwnerUsername(), newTemplateDoc.getTemplateID(), 0, clazz.getResourceAsStream("/sample-art3d/TestCube.obj"));
+ webClient1.uploadTemplateResourceStream(newTemplateDoc.getOwnerUsername(), newTemplateDoc.getTemplateID(), CUBE_MATERIAL, clazz.getResourceAsStream("/sample-art3d/TestCube.mtl"));
+ webClient1.uploadTemplateResourceStream(newTemplateDoc.getOwnerUsername(), newTemplateDoc.getTemplateID(), CUBE_GIF, clazz.getResourceAsStream("/sample-art3d/TestCube.gif"));
+ webClient1.updateTemplateScript(newTemplateDoc.getOwnerUsername(), newTemplateDoc.getTemplateID(), StreamUtils.readInput(clazz.getResourceAsStream("/sample-art3d/TestCube.js")));
+
+ baseDoc = webClient1.getTemplateDocument(newTemplateDoc.getOwnerUsername(), newTemplateDoc.getTemplateID());
+ //make sure the sequence right above didn't take more than 1 sec
+ verifyLastChangedTimes(baseDoc.getScriptModifiedTime(), baseDoc.getGeometryModifiedTime(0), 1000, false, false);
+ verifyLastChangedTimes(baseDoc.getScriptModifiedTime(), baseDoc.getSupportFileModifiedTime(CUBE_GIF), 1000, false, false);
+ verifyLastChangedTimes(baseDoc.getScriptModifiedTime(), baseDoc.getSupportFileModifiedTime(CUBE_MATERIAL), 1000, false, false);
+
+ //check that there are no things
+ ThingDocument[] thingDocs = webClient1.getThingDocuments(spaceDocument.getSpaceID());
+ assertEquals(0, thingDocs.length);
+
+ PossessionDocument[] possDocs = webClient1.getPossessionDocuments();
+ int previousLength = possDocs.length;
+ //create new possession
+ webClient1.createPossession(newTemplateDoc.getTemplateID());
+ possDocs = webClient1.getPossessionDocuments();
+ PossessionDocument newPossession = possDocs[previousLength];
+ assertEquals(possDocs.length - 1, previousLength);
+
+ //make sure we can add poss to space
+ PossessionDocument possDoc = webClient1.addPossessionToSpace(newPossession.getPossessionID(), spaceDocument.getSpaceID());
+ assertNotNull(possDoc);
+ try {
+ Thread.sleep(1000); //IES: there was a sleep(100) here before and I didn't know why
+ //IES: but I needed a sleep(1000) for my tests that I can do
+ //IES: time checks properly so I just changed it
+ } catch (Exception e) {
+ }
+
+ //change the geometry to the cylinder
+ webClient1.uploadTemplateGeometryStream(newTemplateDoc.getOwnerUsername(), newTemplateDoc.getTemplateID(), 0, getClass().getResourceAsStream("/sample-art3d/TestCylinder.obj"));
+ afterCylDoc = webClient1.getTemplateDocument(newTemplateDoc.getOwnerUsername(), newTemplateDoc.getTemplateID());
+ verifyLastChangedTimes(baseDoc.getGeometryModifiedTime(0), afterCylDoc.getGeometryModifiedTime(0), 1000, true, false);
+
+ //what's in the space? should be one thing, the one we added above
+ thingDocs = webClient1.getThingDocuments(spaceDocument.getSpaceID());
+ assertEquals(1, thingDocs.length);
+ assertEquals(thingDocs[0].getTemplateID(), newPossession.getTemplateID());
+ assertEquals(thingDocs[0].getTemplateID(), possDoc.getTemplateID());
+ assertEquals(spaceDocument.getSpaceID(), possDoc.getSpaceID());
+ assertEquals(thingDocs[0].getThingID(), possDoc.getThingID());
+
+
+ webClient1.reloadThing(spaceDocument.getSpaceID(), thingDocs[0].getThingID());
+
+ try {
+ Thread.sleep(2000);
+ } catch (Exception e) {
+
+ }
+
+ //we done reload better check again
+ thingDocs = webClient1.getThingDocuments(spaceDocument.getSpaceID());
+
+ //get shape doc for our one thing: it should be a thing
+ ShapeDocument[] shapeDocs = thingDocs[0].getShapeDocuments();
+ assertEquals(1, shapeDocs.length);
+ assertEquals("Cylinder", shapeDocs[0].getShapeName());
+
+ return thingDocs;
+ }
+
+ private void verifyLastChangedTimes(String time1, String time2, int tooLong, boolean reallyTooShort, boolean displayDiff) throws IOException {
+ long first, second;
+ try {
+ first = TemplateSupportFileDocument.fmt.parse(time1).getTime();
+ second = TemplateSupportFileDocument.fmt.parse(time2).getTime();
+ if (displayDiff) {
+ System.out.println("Diff In Time:" + (second - first) + " compared to " + tooLong);
+ }
+ if (reallyTooShort) {
+ if (second - first < tooLong) {
+ fail("Not enough time between times given");
+ }
+ } else {
+ if (second - first > tooLong) {
+ fail("More than allowed difference between times given");
+ }
+ }
+ } catch (ParseException e) {
+ fail("can't parse the date in modified time(s):" + time1 + "," + time2);
+ }
+ }
+
+ private void checkDeletingSpaceDestroysThings(long spaceID, WebAPIClient webClient1, String possOwner) throws IOException {
+ PossessionDocument[] possDocs;
+ int previousLength;
+ long NO_TARGET = -827;
+
+ //destroy the space then check the possessions have been reset to reflect deleting
+ //the space
+ long toBeKilledID = webClient1.getSpaceDocument(spaceID, false).getSpaceID(), targetID = NO_TARGET;
+ possDocs = webClient1.getPossessionDocuments();
+ for (int i = 0; i < possDocs.length; ++i) {
+ if (possDocs[i].getSpaceID() == toBeKilledID) {
+ targetID = possDocs[i].getPossessionID();
+ break;
+ }
+ }
+ assertFalse(targetID == NO_TARGET);
+
+ assertTrue(webClient1.deleteSpace(spaceID));
+ possDocs = webClient1.getPossessionDocuments();
+
+ for (int i = 0; i < possDocs.length; ++i) {
+ if (possDocs[i].getPossessionID() == targetID) {
+ assertEquals(PossessionDocument.NO_SPACE, possDocs[i].getSpaceID());
+ assertEquals(PossessionDocument.NO_THING, possDocs[i].getThingID());
+ break;
+ }
+ }
+
+ previousLength = possDocs.length;
+ webClient1.deletePossession(targetID);
+ possDocs = webClient1.getPossessionDocuments();
+ assertEquals(previousLength - 1, possDocs.length);
+ }
+
+ private TemplateDocument checkTemplateScriptAPI(WebAPIClient webClient1) throws IOException {
+ String templateName = "Red Hot Pants";
+ TemplateDocument newTemplateDoc = webClient1.createTemplate(templateName);
+ assertEquals(templateName, newTemplateDoc.getDisplayName());
+
+ templateName = "Test Cube";
+ newTemplateDoc.setDisplayName(templateName);
+ newTemplateDoc = webClient1.updateTemplate(newTemplateDoc);
+ assertEquals(templateName, newTemplateDoc.getDisplayName());
+
+ assertEquals(false, newTemplateDoc.hasScriptFile());
+ assertNull(newTemplateDoc.getScriptModifiedTime());
+
+ String script = "var i = 1; return ++i;";
+ webClient1.updateTemplateScript(webClient1.getAuthenticator().getUsername(), newTemplateDoc.getTemplateID(), script);
+ assertEquals(script, webClient1.getTemplateScript(webClient1.getAuthenticator().getUsername(), newTemplateDoc.getTemplateID()));
+ //refresh the document because we changed a field in the object
+ newTemplateDoc = webClient1.getTemplateDocument(webClient1.getAuthenticator().getUsername(), newTemplateDoc.getTemplateID());
+ assertEquals(true, newTemplateDoc.hasScriptFile());
+
+ //check that modified time is working
+ int interval = 2000;
+ try {
+ Thread.sleep(interval);
+ } catch (InterruptedException e) {
+ //won't happen
+ }
+ //change the script
+ script = "var i = 2; return i+5;";
+ webClient1.updateTemplateScript(webClient1.getAuthenticator().getUsername(), newTemplateDoc.getTemplateID(), script);
+
+ TemplateDocument updatedTemplateDoc = webClient1.getTemplateDocument(webClient1.getAuthenticator().getUsername(), newTemplateDoc.getTemplateID());
+
+ //at least the interval should have passed
+ verifyLastChangedTimes(newTemplateDoc.getScriptModifiedTime(), updatedTemplateDoc.getScriptModifiedTime(), 2000, true, false);
+
+ webClient1.updateTemplateScript(webClient1.getAuthenticator().getUsername(), newTemplateDoc.getTemplateID(), null);
+ assertEquals(null, webClient1.getTemplateScript(webClient1.getAuthenticator().getUsername(), newTemplateDoc.getTemplateID()));
+
+ newTemplateDoc = webClient1.getTemplateDocument(webClient1.getAuthenticator().getUsername(), newTemplateDoc.getTemplateID());
+ assertEquals(false, newTemplateDoc.hasScriptFile());
+ return newTemplateDoc;
+ }
+
+ private void consume(InputStream input) throws IOException {
+ byte[] buffer = new byte[2048];
+ while (input.read(buffer) != -1) {
+ //throw it away
+ }
+ }
+
+ private class TestSpaceClientListener implements SpaceClient.Listener {
+
+ public void disconnected() {
+ }
+
+ public void receivedChatMessage(String username, String message) {
+ }
+
+ public void receivedSpaceTransfer(URI link) {
+ }
+
+ public void receivedLink(String displayName, String link) {
+ }
+
+ public void receivedCommandFocusRequest() {
+ }
+
+ public void receivedBrowserMessage(long sourceThingID, String message) {
+ }
+
+ public void receivedContextMenuRequest(Thing thing,String shapeName, int x, int y, long nonce) {
+ }
+
+ public void receivedContextMenuData(long nonce, String errorIfAny, Vector contextMenu) {
+ }
+
+ public void contextItemChosen(Thing thing, long nonce, String id) {
+ }
+
+ }
+
+ private class TestListener implements Space.Listener {
+
+ Vector personAdds = new Vector();
+
+ Vector personRemoves = new Vector();
+
+ Vector personMotionStarts = new Vector();
+
+ Vector personMotionStops = new Vector();
+
+ Vector templateAdds = new Vector();
+
+ Vector templateRemoves = new Vector();
+
+ Vector thingAdds = new Vector();
+
+ Vector thingRemoves = new Vector();
+
+ Vector thingMotionStarts = new Vector();
+
+ Vector thingMotionStops = new Vector();
+
+ public void userAdded(User person) {
+ if (person == null) {
+ fail();
+ }
+ personAdds.add(person);
+ }
+
+ public void userRemoved(User person) {
+ if (person == null) {
+ fail();
+ }
+ personRemoves.add(person);
+ }
+
+ public void userMotionStarted(User person, SplinePath path) {
+ if (person == null)
+ fail();
+ if (path == null)
+ fail();
+ personMotionStarts.add(person);
+ personMotionStarts.add(path);
+ }
+
+ public void userMotionStopped(User person, Transform3D position) {
+ if (person == null)
+ fail();
+ if (position == null)
+ fail();
+ personMotionStops.add(person);
+ personMotionStops.add(position);
+ }
+
+ public void templateAdded(Template template) {
+ if (template == null)
+ fail();
+ templateAdds.add(template);
+ }
+
+ public void templateRemoved(Template template) {
+ if (template == null)
+ fail();
+ templateRemoves.add(template);
+ }
+
+ public void thingAdded(Thing thing) {
+ if (thing == null)
+ fail();
+ thingAdds.add(thing);
+ }
+
+ public void thingRemoved(Thing thing) {
+ if (thing == null)
+ fail();
+ thingRemoves.add(thing);
+ }
+
+ public void thingMotionStarted(Thing thing, SplinePath path) {
+ if (thing == null)
+ fail();
+ if (path == null)
+ fail();
+ thingMotionStarts.add(thing);
+ thingMotionStarts.add(path);
+ }
+
+ public void thingMotionStopped(Thing thing, Transform3D position) {
+ if (thing == null)
+ fail();
+ if (position == null)
+ fail();
+ thingMotionStops.add(thing);
+ thingMotionStops.add(position);
+ }
+
+ public void thingReloaded(Thing thing) {
+ }
+
+ public void doorMotionStarted(Door door, SplinePath path) {
+ }
+
+ public void doorMotionStopped(Door door, Transform3D position) {
+ }
+
+ public void doorAdded(Door door) {
+ }
+
+ public void doorRemoved(Door door) {
+ }
+
+ public void pageAdded(Page page) {
+ }
+
+ public void pageRemoved(Page page) {
+ }
+
+ public void pageMoved(Page page, Transform3D position) {
+ }
+
+ public void pageContentChanged(Page page) {
+ }
+
+ public void shapeMotionStarted(Shape shape, SplinePath path) {
+ }
+
+ public void shapeMotionStopped(Shape shape, Transform3D position) {
+ }
+
+ public void userAnimationStarted(User user, long animationID) {
+ }
+
+ public void shapeMotionStarted(com.ogoglio.client.model.Shape shape,
+ SplinePath path) {
+ // TODO Auto-generated method stub
+
+ }
+
+ public void shapeMotionStopped(com.ogoglio.client.model.Shape shape,
+ Transform3D position) {
+ // TODO Auto-generated method stub
+
+ }
+
+ public void templateAdded(com.ogoglio.client.model.Template template) {
+ // TODO Auto-generated method stub
+
+ }
+
+ public void templateRemoved(com.ogoglio.client.model.Template template) {
+ // TODO Auto-generated method stub
+
+ }
+
+ }
+
+}
Added: maven/trunk/ogoglio-integration-test/src/test/java/com/ogoglio/client/test/SpaceDuplicatorTest.java
===================================================================
--- maven/trunk/ogoglio-integration-test/src/test/java/com/ogoglio/client/test/SpaceDuplicatorTest.java (rev 0)
+++ maven/trunk/ogoglio-integration-test/src/test/java/com/ogoglio/client/test/SpaceDuplicatorTest.java 2007-08-26 22:52:45 UTC (rev 263)
@@ -0,0 +1,127 @@
+package com.ogoglio.client.test;
+
+import java.io.IOException;
+import java.net.URI;
+import java.util.Arrays;
+import java.util.Comparator;
+import java.util.Map;
+
+import junit.framework.TestCase;
+
+import com.ogoglio.client.SpaceDuplicator;
+import com.ogoglio.client.WebAPIAuthenticator;
+import com.ogoglio.client.WebAPIClient;
+import com.ogoglio.client.WebAPIClientWire;
+import com.ogoglio.client.WebAPIDescriptor;
+import com.ogoglio.xml.DoorDocument;
+import com.ogoglio.xml.PositionedDocument;
+import com.ogoglio.xml.SpaceDocument;
+import com.ogoglio.xml.ThingDocument;
+
+public class SpaceDuplicatorTest extends TestCase {
+
+ long spaceID1 = -1;
+
+ long spaceID2 = -1;
+
+ URI serviceURI1 = null;
+
+ WebAPIDescriptor descriptor = null;
+
+ WebAPIAuthenticator auth = null;
+
+ WebAPIClientWire wire = null;
+
+ WebAPIClient client1 = null;
+
+ String testSettingKey = "test.setting.key";
+
+ String testSettingValue = "A Value for the Test Setting";
+
+ public void setUp() {
+ try {
+ spaceID1 = 1;
+ spaceID2 = 2;
+ serviceURI1 = new URI("http://127.0.0.1:8080/og/");
+ descriptor = new WebAPIDescriptor(serviceURI1);
+ wire = new WebAPIClientWire();
+ auth = new WebAPIAuthenticator(wire, descriptor, ClientTest.USERNAME1, ClientTest.PASSWORD1);
+
+ client1 = new WebAPIClient(descriptor, auth, wire);
+ client1.putSpaceSetting(spaceID1, testSettingKey, testSettingValue);
+ } catch (Throwable e) {
+ e.printStackTrace();
+ fail(e.getMessage());
+ }
+ }
+
+ public void tearDown() {
+ }
+
+ public void testBasics() {
+ try {
+ SpaceDocument originalSpaceDoc = client1.getSpaceDocument(spaceID1, false);
+ ThingDocument[] originalThingDocs = client1.getThingDocuments(spaceID1);
+ DoorDocument[] originalDoorDocs = client1.getDoorDocuments(spaceID1);
+ Map originalSettings = client1.getSpaceSettings(spaceID1);
+
+ //TODO settings transfer
+
+ SpaceDuplicator duplicator = new SpaceDuplicator(spaceID1, descriptor, auth, wire);
+ duplicator.duplicateSpace(spaceID2, true);
+
+ SpaceDocument newSpaceDoc = client1.getSpaceDocument(spaceID2, false);
+ assertEquals(originalSpaceDoc.getDisplaySea(), newSpaceDoc.getDisplaySea());
+ assertEquals(originalSpaceDoc.getSeaLevel(), newSpaceDoc.getSeaLevel(), 0.001);
+ assertEquals(originalSpaceDoc.getDisplayName(), newSpaceDoc.getDisplayName());
+ assertEquals(originalSpaceDoc.isPublished(), newSpaceDoc.isPublished());
+ assertEquals(originalSpaceDoc.getMaxGuests(), newSpaceDoc.getMaxGuests());
+ assertEquals(originalSpaceDoc.getOwnerUsername(), newSpaceDoc.getOwnerUsername());
+
+ ThingDocument[] newThingDocs = client1.getThingDocuments(spaceID2);
+ Arrays.sort(newThingDocs, new ThingDocComparator());
+ Arrays.sort(originalThingDocs, new ThingDocComparator());
+ assertEquals(originalThingDocs.length, newThingDocs.length);
+ for (int i = 0; i < originalThingDocs.length; i++) {
+ assertEquals(originalThingDocs[i].getTemplateID(), newThingDocs[i].getTemplateID());
+ assertEqualPositions(originalThingDocs[i], newThingDocs[i]);
+ }
+
+ DoorDocument[] newDoorDocs = client1.getDoorDocuments(spaceID2);
+ for (int i = 0; i < originalDoorDocs.length; i++) {
+ assertEquals(originalDoorDocs[i].getDisplayName(), newDoorDocs[i].getDisplayName());
+ assertEquals(originalDoorDocs[i].getLink(), newDoorDocs[i].getLink());
+ assertEqualPositions(originalDoorDocs[i], newDoorDocs[i]);
+ }
+
+ Map newSettings = client1.getSpaceSettings(spaceID2);
+ newSettings.equals(originalSettings);
+ } catch (IOException e) {
+ e.printStackTrace();
+ fail("" + e);
+ }
+ }
+
+ private static class ThingDocComparator implements Comparator {
+ public int compare(Object arg0, Object arg1) {
+ ThingDocument doc1 = (ThingDocument) arg0;
+ ThingDocument doc2 = (ThingDocument) arg1;
+ long idDiff = doc1.getTemplateID() - doc2.getTemplateID();
+ if (idDiff != 0) {
+ return idDiff < 0 ? -1 : 1;
+ }
+ return doc1.getPossessionID() < doc1.getPossessionID() ? -1 : 1;
+ }
+ }
+
+ private static void assertEqualPositions(PositionedDocument doc1, PositionedDocument doc2) {
+ assertEquals(doc1.getX(), doc2.getX(), 0.001);
+ assertEquals(doc1.getY(), doc2.getY(), 0.001);
+ assertEquals(doc1.getZ(), doc2.getZ(), 0.001);
+ assertEquals(doc1.getRW(), doc2.getRW(), 0.001);
+ assertEquals(doc1.getRX(), doc2.getRX(), 0.001);
+ assertEquals(doc1.getRY(), doc2.getRY(), 0.001);
+ assertEquals(doc1.getRZ(), doc2.getRZ(), 0.001);
+ assertEquals(doc1.getScale().x, doc2.getScale().x, 0.001);
+ }
+}
Added: maven/trunk/ogoglio-integration-test/src/test/java/com/ogoglio/client/test/WebAPITest.java
===================================================================
--- maven/trunk/ogoglio-integration-test/src/test/java/com/ogoglio/client/test/WebAPITest.java (rev 0)
+++ maven/trunk/ogoglio-integration-test/src/test/java/com/ogoglio/client/test/WebAPITest.java 2007-08-26 22:52:45 UTC (rev 263)
@@ -0,0 +1,147 @@
+package com.ogoglio.client.test;
+
+import java.io.IOException;
+import java.net.URI;
+import java.net.URISyntaxException;
+
+import com.ogoglio.client.AuthenticationFailedException;
+import com.ogoglio.client.WebAPIAuthenticator;
+import com.ogoglio.client.WebAPIAuthenticatorFactory;
+import com.ogoglio.client.WebAPIClientWire;
+import com.ogoglio.client.WebAPIDescriptor;
+import com.ogoglio.client.WebAPIGuestAuthenticator;
+import com.ogoglio.util.OgoglioSpecBase;
+import com.ogoglio.xml.AccountDocument;
+import com.ogoglio.xml.AuthDocument;
+
+public class WebAPITest extends OgoglioSpecBase {
+
+ public static final String GOOD_COOKIE = "trGoodCookie";
+
+ private static final String BAD_COOKIE = "badBacCookie";
+
+ private static final String GUEST_COOKIE = "guestMockCookie";
+
+ URI serviceURI = null;
+
+ WebAPIDescriptor descriptor = null;
+
+ WebAPIClientWire mockWire = null;
+
+ WebAPIAuthenticatorFactory mockAuthFactory = null;
+
+ AuthDocument notAuthedAuthDoc = null;
+
+ AuthDocument authedAuthDoc = null;
+
+ AccountDocument accountDoc = null;
+
+ public void setUp() {
+ try {
+ serviceURI = new URI("http://example.com/og/");
+ descriptor = new WebAPIDescriptor(serviceURI);
+
+ mockWire = (WebAPIClientWire) mock_ignoreEqualsAndToString(WebAPIClientWire.class);
+ mockAuthFactory = (WebAPIAuthenticatorFactory) mock_ignoreEqualsAndToString(WebAPIAuthenticatorFactory.class);
+
+ notAuthedAuthDoc = new AuthDocument("Ian", false);
+
+ authedAuthDoc = new AuthDocument("Ian", true);
+ accountDoc = new AccountDocument(authedAuthDoc.getUsername(), AccountDocument.ACCOUNT_LEVEL_ADVANCED, null, null, null, null, null, null, AccountDocument.NO_TIME_VALUE, null, AccountDocument.NO_TIME_VALUE, -1);
+ } catch (URISyntaxException e) {
+ fail("Bad URIL: " + e);
+ }
+ }
+
+ public void tearDown() {
+ }
+
+
+ public void testWebAPIGuestAuthenticator() {
+
+ mockAuthFactory.authenticate(descriptor, GUEST_COOKIE);
+ modify().forward();
+
+ //###################################
+ startVerification();
+
+ WebAPIGuestAuthenticator auth = mockAuthFactory.authenticate(descriptor, GUEST_COOKIE);
+ assertNotNull(auth);
+ assertEquals(GUEST_COOKIE, auth.getAuthCookie());
+ assertNotNull(auth.getUsername());
+ assertNotNull(auth.getAccountDocument(true));
+ assertNotNull(auth.getAuthDocument(true));
+ }
+
+ public void testWebAPIAuthenticatorViaCookie() throws IOException, AuthenticationFailedException {
+ //mockWire should respond to good and bad cookies with good and bad auth docs
+ mockWire.fetchAuthenticatedXML(descriptor.getMeAuthURI(), BAD_COOKIE);
+ modify().returnValue(notAuthedAuthDoc.toElement());
+ mockWire.fetchAuthenticatedXML(descriptor.getMeAuthURI(), GOOD_COOKIE);
+ modify().returnValue(authedAuthDoc.toElement());
+
+ //mockWire should respond to good account requests with a good account doc
+ mockWire.fetchAuthenticatedXML(descriptor.getAccountURI(authedAuthDoc.getUsername()), GOOD_COOKIE);
+ modify().returnValue(accountDoc.toElement());
+
+ mockAuthFactory.authenticate(mockWire, descriptor, GOOD_COOKIE);
+ modify().args(is.AS_RECORDED, is.AS_RECORDED, is.ANYTHING);
+ modify().multiplicity(expect.atMost(2));
+ modify().forward();
+
+ //for reasons I don't understand this doesn't work when running via ant
+ //so we are going to not use it for now
+ //expectThatExceptionThrown(is.instanceOf(AuthenticationFailedException.class));
+ //###################################
+ startVerification();
+
+ WebAPIAuthenticator auth = mockAuthFactory.authenticate(mockWire, descriptor, GOOD_COOKIE);
+ assertNotNull(auth);
+ assertEquals(GOOD_COOKIE, auth.getAuthCookie());
+ assertEquals(authedAuthDoc.getUsername(), auth.getUsername());
+ assertEquals(accountDoc, auth.getAccountDocument(true));
+
+ try {
+ auth = mockAuthFactory.authenticate(mockWire, descriptor, BAD_COOKIE);
+ fail("Should not be able to reach this point after bad authentication!");
+ } catch (AuthenticationFailedException e) {
+ assertThat(e, is.instanceOf(AuthenticationFailedException.class));
+ }
+ }
+
+ public void testWebAPIAuthenticatorViaUsernameAndPass() throws AuthenticationFailedException, URISyntaxException, IOException {
+ mockWire.getAuthCookieViaPost(serviceURI, "username=Ian&password=farts", "text/plain...
[truncated message content] |
|
From: <ian...@us...> - 2007-08-27 15:59:07
|
Revision: 262
http://ogoglio.svn.sourceforge.net/ogoglio/?rev=262&view=rev
Author: iansmith
Date: 2007-08-26 15:51:03 -0700 (Sun, 26 Aug 2007)
Log Message:
-----------
Initial import.
Added Paths:
-----------
maven/trunk/ogoglio-integration-test/
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ian...@us...> - 2007-08-27 15:56:38
|
Revision: 267
http://ogoglio.svn.sourceforge.net/ogoglio/?rev=267&view=rev
Author: iansmith
Date: 2007-08-26 15:59:25 -0700 (Sun, 26 Aug 2007)
Log Message:
-----------
Minor classpath change.
Modified Paths:
--------------
maven/trunk/ogoglio-test-applet/.classpath
Modified: maven/trunk/ogoglio-test-applet/.classpath
===================================================================
--- maven/trunk/ogoglio-test-applet/.classpath 2007-08-26 22:58:59 UTC (rev 266)
+++ maven/trunk/ogoglio-test-applet/.classpath 2007-08-26 22:59:25 UTC (rev 267)
@@ -1,9 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src/main/java"/>
- <classpathentry kind="src" path="src/main/resources"/>
- <classpathentry kind="src" output="target/test-classes" path="src/test/java"/>
- <classpathentry kind="src" output="target/test-classes" path="src/test/resources"/>
+ <classpathentry kind="src" path="src/test/java"/>
+ <classpathentry excluding="**" kind="src" output="src/main/resources" path="src/main/resources"/>
+ <classpathentry excluding="**" kind="src" output="src/test/resources" path="src/test/resources"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>
<classpathentry kind="output" path="target/classes"/>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ian...@us...> - 2007-08-27 15:56:32
|
Revision: 268
http://ogoglio.svn.sourceforge.net/ogoglio/?rev=268&view=rev
Author: iansmith
Date: 2007-08-26 16:00:07 -0700 (Sun, 26 Aug 2007)
Log Message:
-----------
Working to try to get applet test window enabled. Not completed yet.
Modified Paths:
--------------
maven/trunk/ogoglio-viewer-applet/pom.xml
maven/trunk/ogoglio-viewer-applet/src/main/java/com/ogoglio/viewer/applet/AppletTestWindow.java
Modified: maven/trunk/ogoglio-viewer-applet/pom.xml
===================================================================
--- maven/trunk/ogoglio-viewer-applet/pom.xml 2007-08-26 22:59:25 UTC (rev 267)
+++ maven/trunk/ogoglio-viewer-applet/pom.xml 2007-08-26 23:00:07 UTC (rev 268)
@@ -45,7 +45,7 @@
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
- <version>3.8.2</version>
+ <version>3.8.1</version>
</dependency>
<dependency>
<groupId>com.ogoglio</groupId>
Modified: maven/trunk/ogoglio-viewer-applet/src/main/java/com/ogoglio/viewer/applet/AppletTestWindow.java
===================================================================
--- maven/trunk/ogoglio-viewer-applet/src/main/java/com/ogoglio/viewer/applet/AppletTestWindow.java 2007-08-26 22:59:25 UTC (rev 267)
+++ maven/trunk/ogoglio-viewer-applet/src/main/java/com/ogoglio/viewer/applet/AppletTestWindow.java 2007-08-26 23:00:07 UTC (rev 268)
@@ -61,14 +61,14 @@
HashMap parameters1 = new HashMap();
try {
- WebAPIAuthenticator authenticator = new WebAPIAuthenticator(new WebAPIClientWire(), new WebAPIDescriptor(new URI(serviceURI)), WebConstants.TEST_LIBRARY_USERNAME, WebConstants.TEST_DEFAULT_LIBRARY_PASSWORD);
+ WebAPIAuthenticator authenticator = new WebAPIAuthenticator(new WebAPIClientWire(), new WebAPIDescriptor(new URI(serviceURI)), WebConstants.getBootstrapUsername(), WebConstants.getBootstrapUserPW());
parameters1.put("loginCookie", authenticator.getAuthCookie());
} catch (Exception e) {
e.printStackTrace();
}
//parameters1.put("loginCookie", "guestApplet_Test_Window2");
- parameters1.put("spaceID", "" + 3);
+ parameters1.put("spaceID", "" + 1);
parameters1.put("serviceURI", serviceURI);
//parameters1.put("x", "0");
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|