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: <ian...@us...> - 2007-07-03 17:16:58
|
Revision: 210
http://ogoglio.svn.sourceforge.net/ogoglio/?rev=210&view=rev
Author: iansmith
Date: 2007-07-03 10:16:54 -0700 (Tue, 03 Jul 2007)
Log Message:
-----------
I'm a bit frightened because the editor is claiming that I
should commit some of the prefs files but all I did was select
version 1.4 syntax checking. Sigh. I'm not going to try to not commit those changes for now.
I added more specifications to my sync tool. This tool is
currently semantically broken because it looks for spaces
rather than templates, but that will be easily fixed.
Modified Paths:
--------------
spaces/trunk/src/com/ogoglio/spacesync/SyncTool.java
spaces/trunk/src/com/ogoglio/spacesync/SyncToolSpec.java
Modified: spaces/trunk/src/com/ogoglio/spacesync/SyncTool.java
===================================================================
--- spaces/trunk/src/com/ogoglio/spacesync/SyncTool.java 2007-07-03 02:33:29 UTC (rev 209)
+++ spaces/trunk/src/com/ogoglio/spacesync/SyncTool.java 2007-07-03 17:16:54 UTC (rev 210)
@@ -31,7 +31,7 @@
public List listSpacesToSynchronize(String dir) {
File f = new File(dir);
- List<File> result = new ArrayList<File>();
+ List result = new ArrayList();
if (!f.exists() || !f.isDirectory() || !f.canRead()) {
return null;
@@ -52,7 +52,7 @@
}
public List candidatesDirsFromCriticalDirs(String path1, String path2) {
- List<String> result = new ArrayList<String>();
+ List result = new ArrayList();
result.add(path1 + File.separatorChar + "spaces");
result.add(path1 + File.separatorChar + ".spaces");
result.add(path2 + File.separatorChar + "spaces");
@@ -91,7 +91,8 @@
abort(ABORT_BAD_PW);
return; //if you don't understand why this is here, don't mess with it
}
- if (findUsersSpaces()==null) {
+ List spaceNames = findUsersSpaces();
+ if (spaceNames==null) {
abort(ABORT_NO_SPACES);
return; //if you don't understand why this is here, don't mess with it
}
Modified: spaces/trunk/src/com/ogoglio/spacesync/SyncToolSpec.java
===================================================================
--- spaces/trunk/src/com/ogoglio/spacesync/SyncToolSpec.java 2007-07-03 02:33:29 UTC (rev 209)
+++ spaces/trunk/src/com/ogoglio/spacesync/SyncToolSpec.java 2007-07-03 17:16:54 UTC (rev 210)
@@ -1,24 +1,32 @@
package com.ogoglio.spacesync;
import java.io.IOException;
+import java.net.URI;
import java.net.URISyntaxException;
import java.util.ArrayList;
import java.util.List;
import com.agical.rmock.extension.junit.RMockTestCase;
+import com.ogoglio.client.WebAPIAuthenticator;
public class SyncToolSpec extends RMockTestCase {
- public SyncTool mock;
+ public SyncTool mock; //we use this in every spec
+
+ public static final String SVC="http://transmutable.gov",USER="doofus",PW="somepw";
+ public static final String[] CMD_LINE_ARGS = { USER, PW, SVC};
public void setUp() {
mock=(SyncTool)mock(SyncTool.class);
}
-
- public void testLookForDirsInCWDAndHomeWithRightNameReturningOnlyNamesOfSpaces() {
- List<String> fakeCandidateList = new ArrayList<String>();
+ private List createFakeList(int numberOfFakeItems,String prefix) {
+ List result = new ArrayList();
+ for (int i=0; i<numberOfFakeItems;++i) { result.add(prefix+i);}
+ return result;
+ }
+ public void testLookForDirsInCWDAndHomeWithRightNameReturningOnlyNamesOfDirs() {
int ITERS=4;
- for (int i=0; i<ITERS;++i) { fakeCandidateList.add("better not exist on disk)");}
+ List fakeDirList = createFakeList(ITERS,"dir");
beginSection(s.ordered("set of directories checked"));
{
@@ -26,7 +34,7 @@
modify().forward();
mock.candidatesDirsFromCriticalDirs("cwd","home dir");
- modify().args(is.NOT_NULL,is.NOT_NULL).returnValue(fakeCandidateList);
+ modify().args(is.NOT_NULL,is.NOT_NULL).returnValue(fakeDirList);
mock.listSpacesToSynchronize("points to a dir");
modify().args(is.NOT_NULL);
@@ -57,4 +65,59 @@
public void testForgotServiceURI() throws IOException, URISyntaxException {
checkWrongNumberOfArgs(2);
}
+
+ public void checkAuthorizationSequence(String cookieValue)
+ throws IOException, URISyntaxException {
+ WebAPIAuthenticator authMock=(WebAPIAuthenticator)mock(WebAPIAuthenticator.class,"authMock");
+
+ beginSection(s.ordered("startup ordering of param and auth checks"));
+ {
+ mock.start(CMD_LINE_ARGS);
+ modify().forward();
+
+ mock.getAuthenticator();
+ modify().returnValue(authMock);
+
+ authMock.authenticate(new URI(SVC), USER, PW);
+ modify().returnValue(cookieValue);
+ }
+ endSection();
+ }
+ public void testBadUsernameOrPasswordForService() throws IOException, URISyntaxException {
+ checkAuthorizationSequence(null);
+
+ mock.abort(SyncTool.ABORT_BAD_PW);
+
+ startVerification();
+ mock.start(CMD_LINE_ARGS);
+ }
+
+ //basically test that all the startup crap completes ok so we can get started testing that spaces
+ //actually can sync
+ public void testSyncSpaceCalledOnceForEachSpaceName() throws IOException, URISyntaxException{
+ List fakeMagicDirs= createFakeList(2,"dir");
+ List fakeSpaces = createFakeList(2,"space");
+
+ checkAuthorizationSequence("someCookieSoAuthOK");
+
+ beginSection(s.ordered("order of looking in dirs makes sense"));
+ {
+ mock.findUsersSpaces();
+ modify().forward();
+
+ mock.candidatesDirsFromCriticalDirs("really CWD", "really $HOME");
+ modify().args(is.instanceOf(String.class).and(is.NOT_NULL),is.instanceOf(String.class).and(is.NOT_NULL));
+ modify().returnValue(fakeMagicDirs);
+
+ mock.listSpacesToSynchronize((String)fakeMagicDirs.get(0));
+ modify().returnValue(null);
+
+ mock.listSpacesToSynchronize((String)fakeMagicDirs.get(1));
+ modify().returnValue(fakeSpaces);
+ }
+ endSection();
+
+ startVerification();
+ mock.start(CMD_LINE_ARGS);
+ }
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ian...@us...> - 2007-07-03 02:33:30
|
Revision: 209
http://ogoglio.svn.sourceforge.net/ogoglio/?rev=209&view=rev
Author: iansmith
Date: 2007-07-02 19:33:29 -0700 (Mon, 02 Jul 2007)
Log Message:
-----------
Started down the road to building a tool that will sync a set of directories full of content with service that hosts those spaces. It's nowhere near complete yet.
Add support for RMock tests, since I like them. Examples in com.ogoglio.spacesync.SyncToolSpec.
Updated the .jars for cglib and junit to include proper version numbers. It appears that we were already at these versions but I wanted to be sure when I was including RMock that it was clear which version we were expecting. I did not delete old ones in case of catastrophic failure.
Java does not allow one to override (and thus mock) statics so I had to move WebAPIClient.authenticate to a separate class for later hackery. I created WebAPIUtil with a few things in it (including authenticate) and patched all the callers to use the new version. Other than the class name, no visible effects to callers.
So far, all my space sync tool does is parse the command line and look for directories that may be your collection of spaces that it should synchronize. This was enough to teach me how to use RMock (vince I was used to the ruby version, RSpec).
I split my "tests" into spec and unit parts. Eventually, I'd like to use the documentation generator (TDDocRender) to render documentation from my specs, but I couldn't get that to work right off the bat.
Modified Paths:
--------------
spaces/trunk/.classpath
spaces/trunk/src/com/ogoglio/client/ClientTests.java
spaces/trunk/src/com/ogoglio/client/SpaceDuplicatorTests.java
spaces/trunk/src/com/ogoglio/client/WebAPIClient.java
spaces/trunk/src/com/ogoglio/media/WebStore.java
spaces/trunk/src/com/ogoglio/persist/ServiceInitializationPersistTasks.java
spaces/trunk/src/com/ogoglio/site/AccountServlet.java
spaces/trunk/src/com/ogoglio/site/AuthServlet.java
spaces/trunk/src/com/ogoglio/site/MessageProxy.java
Added Paths:
-----------
spaces/trunk/src/com/ogoglio/client/WebAPIAuthenticator.java
spaces/trunk/src/com/ogoglio/client/WebAPIUtil.java
spaces/trunk/src/com/ogoglio/spacesync/
spaces/trunk/src/com/ogoglio/spacesync/SpaceSyncTestSuite.java
spaces/trunk/src/com/ogoglio/spacesync/SyncTool.java
spaces/trunk/src/com/ogoglio/spacesync/SyncToolSpec.java
spaces/trunk/src/com/ogoglio/spacesync/SyncToolTest.java
spaces/trunk/war/WEB-INF/lib/cglib-nodep-2.1_2.jar
spaces/trunk/war/WEB-INF/lib/junit-3.8.1.jar
spaces/trunk/war/WEB-INF/lib/rmock-2.0.0.jar
Modified: spaces/trunk/.classpath
===================================================================
--- spaces/trunk/.classpath 2007-07-01 20:25:27 UTC (rev 208)
+++ spaces/trunk/.classpath 2007-07-03 02:33:29 UTC (rev 209)
@@ -4,9 +4,8 @@
<classpathentry kind="var" path="TOMCAT_HOME/common/lib/servlet-api.jar"/>
<classpathentry kind="var" path="TOMCAT_HOME/common/lib/jasper-runtime.jar"/>
<classpathentry kind="var" path="TOMCAT_HOME/common/lib/jsp-api.jar"/>
- <classpathentry output="work" kind="src" path="work"/>
+ <classpathentry kind="src" output="work" path="work"/>
<classpathentry kind="src" path="src"/>
- <classpathentry kind="lib" path="war/WEB-INF/lib/junit.jar"/>
<classpathentry kind="lib" path="war/WEB-INF/lib/mysql-connector-java-3.1.11-bin.jar"/>
<classpathentry kind="lib" path="war/WEB-INF/lib/log4j-1.2.9.jar"/>
<classpathentry kind="lib" path="war/WEB-INF/lib/jta.jar"/>
@@ -16,7 +15,6 @@
<classpathentry kind="lib" path="war/WEB-INF/lib/dom4j-1.6.jar"/>
<classpathentry kind="lib" path="war/WEB-INF/lib/commons-logging-1.0.4.jar"/>
<classpathentry kind="lib" path="war/WEB-INF/lib/commons-collections-2.1.1.jar"/>
- <classpathentry kind="lib" path="war/WEB-INF/lib/cglib-2.1.jar"/>
<classpathentry kind="lib" path="war/WEB-INF/lib/asm-attrs.jar"/>
<classpathentry kind="lib" path="war/WEB-INF/lib/asm.jar"/>
<classpathentry kind="lib" path="war/WEB-INF/lib/antlr-2.7.5H3.jar"/>
@@ -27,5 +25,8 @@
<classpathentry kind="lib" path="war/WEB-INF/lib/commons-httpclient-3.0.1.jar"/>
<classpathentry kind="lib" path="war/WEB-INF/lib/commons-codec-1.3.jar"/>
<classpathentry kind="var" path="BROWSER_PLUGIN"/>
+ <classpathentry kind="lib" path="war/WEB-INF/lib/cglib-nodep-2.1_2.jar"/>
+ <classpathentry kind="lib" path="war/WEB-INF/lib/junit-3.8.1.jar"/>
+ <classpathentry kind="lib" path="war/WEB-INF/lib/rmock-2.0.0.jar"/>
<classpathentry kind="output" path="war/WEB-INF/classes"/>
</classpath>
Modified: spaces/trunk/src/com/ogoglio/client/ClientTests.java
===================================================================
--- spaces/trunk/src/com/ogoglio/client/ClientTests.java 2007-07-01 20:25:27 UTC (rev 208)
+++ spaces/trunk/src/com/ogoglio/client/ClientTests.java 2007-07-03 02:33:29 UTC (rev 209)
@@ -81,7 +81,7 @@
public void testWebAdmin() {
try {
- String adminAuthCookie = WebAPIClient.authenticate(serviceURI1, ServiceInitializationPersistTasks.LIBRARY_USERNAME, ServiceInitializationPersistTasks.DEFAULT_LIBRARY_PASSWORD);
+ String adminAuthCookie = WebAPIUtil.authenticate(serviceURI1, ServiceInitializationPersistTasks.LIBRARY_USERNAME, ServiceInitializationPersistTasks.DEFAULT_LIBRARY_PASSWORD);
assertNotNull("got null auth cookie", adminAuthCookie);
try {
@@ -91,7 +91,7 @@
//may already exist
}
- String basicAuthCookie = WebAPIClient.authenticate(serviceURI1, USERNAME1, PASSWORD1);
+ String basicAuthCookie = WebAPIUtil.authenticate(serviceURI1, USERNAME1, PASSWORD1);
assertNotNull("got null auth cookie", basicAuthCookie);
try {
String failedUsername = "Bogosity" + System.currentTimeMillis();
@@ -136,11 +136,11 @@
SpaceClient guestSpaceClient1 = null;
try {
- String authCookie1 = WebAPIClient.authenticate(serviceURI1, USERNAME1, PASSWORD1);
+ String authCookie1 = WebAPIUtil.authenticate(serviceURI1, USERNAME1, PASSWORD1);
assertNotNull("got null auth cookie", authCookie1);
SpaceDocument spaceDoc1 = WebAPIClient.createSpace(serviceURI1, authCookie1);
- URI spaceURI1 = WebAPIClient.appendToURI(serviceURI1, "space/" + spaceDoc1.getSpaceID());
+ URI spaceURI1 = WebAPIUtil.appendToURI(serviceURI1, "space/" + spaceDoc1.getSpaceID());
try {
new WebAPIClient(spaceURI1, serviceURI1, "BadBadCookie").getSpaceDocument(false);
@@ -220,7 +220,7 @@
assertEquals(USERNAME2, membershipDocs[0].getMemberUsername());
assertEquals(SpaceMemberDocument.MEMBER, membershipDocs[0].getRole());
- String authCookie2 = WebAPIClient.authenticate(serviceURI1, USERNAME2, PASSWORD1);
+ String authCookie2 = WebAPIUtil.authenticate(serviceURI1, USERNAME2, PASSWORD1);
assertNotNull("got null auth cookie", authCookie1);
WebAPIClient webClient2 = new WebAPIClient(spaceURI1, serviceURI1, authCookie2);
membershipDocs = webClient2.getUsersSpaceMemberships();
@@ -354,7 +354,7 @@
assertNotNull(stream);
consume(stream);
- authCookie1 = WebAPIClient.authenticate(serviceURI1, USERNAME1, PASSWORD1);
+ authCookie1 = WebAPIUtil.authenticate(serviceURI1, USERNAME1, PASSWORD1);
assertNotNull("got null auth cookie", authCookie1);
TestSpaceClientListener listener = new TestSpaceClientListener();
Modified: spaces/trunk/src/com/ogoglio/client/SpaceDuplicatorTests.java
===================================================================
--- spaces/trunk/src/com/ogoglio/client/SpaceDuplicatorTests.java 2007-07-01 20:25:27 UTC (rev 208)
+++ spaces/trunk/src/com/ogoglio/client/SpaceDuplicatorTests.java 2007-07-03 02:33:29 UTC (rev 209)
@@ -37,7 +37,7 @@
spaceURI2 = new URI("http://127.0.0.1:8080/og/space/2/");
serviceURI1 = new URI("http://127.0.0.1:8080/og/");
- authCookie = WebAPIClient.authenticate(serviceURI1, ClientTests.USERNAME1, ClientTests.PASSWORD1);
+ authCookie = WebAPIUtil.authenticate(serviceURI1, ClientTests.USERNAME1, ClientTests.PASSWORD1);
assertNotNull(authCookie);
client1 = new WebAPIClient(spaceURI1, serviceURI1, authCookie);
client1.putSetting(testSettingKey, testSettingValue);
Added: spaces/trunk/src/com/ogoglio/client/WebAPIAuthenticator.java
===================================================================
--- spaces/trunk/src/com/ogoglio/client/WebAPIAuthenticator.java (rev 0)
+++ spaces/trunk/src/com/ogoglio/client/WebAPIAuthenticator.java 2007-07-03 02:33:29 UTC (rev 209)
@@ -0,0 +1,50 @@
+package com.ogoglio.client;
+
+import java.io.IOException;
+import java.io.InputStreamReader;
+import java.io.OutputStream;
+import java.io.PrintWriter;
+import java.net.HttpURLConnection;
+import java.net.URI;
+
+import nanoxml.XMLElement;
+
+import com.ogoglio.site.AuthServlet;
+
+public class WebAPIAuthenticator {
+
+ // it makes it a LOT easier to simulate if we use this style of a little object
+ // rather than the statics which don't allow mocking (and that's kinda important
+ // for authentication!)
+ public WebAPIAuthenticator() {
+
+ }
+
+ /**
+ * @return the authCookie or null if authentication failed
+ */
+ public String authenticate(URI serviceURI, String username, String password) throws IOException {
+
+ String body = AuthServlet.USERNAME_PARAM + "=" + username + "&" + AuthServlet.PASS_PARAM + "=" + password;
+
+ HttpURLConnection connection = (HttpURLConnection) WebAPIUtil.appendToURI(serviceURI, "auth/").toURL().openConnection();
+ connection.setRequestMethod("POST");
+ connection.setAllowUserInteraction(false);
+ connection.setDoOutput(true);
+ connection.setRequestProperty("Content-type", "application/x-www-form-urlencoded");
+ connection.setRequestProperty("Content-length", Integer.toString(body.length()));
+
+ OutputStream rawOutStream = connection.getOutputStream();
+ PrintWriter pw = new PrintWriter(rawOutStream);
+ pw.print(body);
+ pw.flush();
+ pw.close();
+
+ String cookie = WebAPIUtil.parseSetCookieHeader(connection.getHeaderField("Set-Cookie"));
+
+ XMLElement data = new XMLElement();
+ data.parseFromReader(new InputStreamReader(connection.getInputStream()));
+ return cookie;
+ }
+
+}
Modified: spaces/trunk/src/com/ogoglio/client/WebAPIClient.java
===================================================================
--- spaces/trunk/src/com/ogoglio/client/WebAPIClient.java 2007-07-01 20:25:27 UTC (rev 208)
+++ spaces/trunk/src/com/ogoglio/client/WebAPIClient.java 2007-07-03 02:33:29 UTC (rev 209)
@@ -87,19 +87,19 @@
public static AccountDocument createAccount(URI serviceURI, String adminAuthCookie, 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, null, null, null, -1);
- XMLElement result = sendAuthenticatedXML(appendToURI(serviceURI, "account/"), newAccountDoc.toString(), "POST", adminAuthCookie);
+ XMLElement result = sendAuthenticatedXML(WebAPIUtil.appendToURI(serviceURI, "account/"), newAccountDoc.toString(), "POST", adminAuthCookie);
return new AccountDocument(result);
}
public static SpaceDocument createSpace(URI serviceURI, String authCookie) throws IOException {
AuthDocument authDocument = new AuthDocument(fetchAuthenticatedXML(getAuthURI(serviceURI), authCookie));
SpaceDocument spaceDoc = new SpaceDocument(-1, "New Space", authDocument.getUsername(), false, 0, false, 0, -1);
- XMLElement result = sendAuthenticatedXML(appendToURI(serviceURI, "account/" + authDocument.getUsername() + "/space/"), spaceDoc.toString(), "POST", authCookie);
+ XMLElement result = sendAuthenticatedXML(WebAPIUtil.appendToURI(serviceURI, "account/" + authDocument.getUsername() + "/space/"), spaceDoc.toString(), "POST", authCookie);
return new SpaceDocument(result);
}
public static AccountDocument updateAccount(URI serviceURI, String authCookie, AccountDocument accountDoc) throws IOException {
- XMLElement result = sendAuthenticatedXML(appendToURI(serviceURI, "account/" + accountDoc.getUsername()), accountDoc.toElement().toString(), "POST", authCookie);
+ XMLElement result = sendAuthenticatedXML(WebAPIUtil.appendToURI(serviceURI, "account/" + accountDoc.getUsername()), accountDoc.toElement().toString(), "POST", authCookie);
if (result == null) {
return null;
}
@@ -107,7 +107,7 @@
}
public static AccountDocument getAccountDocument(URI serviceURI, String authCookie, String username) throws IOException {
- XMLElement response = fetchAuthenticatedXML(appendToURI(serviceURI, "account/" + username), authCookie);
+ XMLElement response = fetchAuthenticatedXML(WebAPIUtil.appendToURI(serviceURI, "account/" + username), authCookie);
if (response == null) {
return null;
}
@@ -296,44 +296,7 @@
return StreamUtils.readInput(input);
}
- /**
- * @return the authCookie or null if authentication failed
- */
- public static String authenticate(URI serviceURI, String username, String password) throws IOException {
- String body = AuthServlet.USERNAME_PARAM + "=" + username + "&" + AuthServlet.PASS_PARAM + "=" + password;
-
- HttpURLConnection connection = (HttpURLConnection) appendToURI(serviceURI, "auth/").toURL().openConnection();
- connection.setRequestMethod("POST");
- connection.setAllowUserInteraction(false);
- connection.setDoOutput(true);
- connection.setRequestProperty("Content-type", "application/x-www-form-urlencoded");
- connection.setRequestProperty("Content-length", Integer.toString(body.length()));
-
- OutputStream rawOutStream = connection.getOutputStream();
- PrintWriter pw = new PrintWriter(rawOutStream);
- pw.print(body);
- pw.flush();
- pw.close();
-
- String cookie = parseSetCookieHeader(connection.getHeaderField("Set-Cookie"));
-
- XMLElement data = new XMLElement();
- data.parseFromReader(new InputStreamReader(connection.getInputStream()));
- return cookie;
- }
-
- private static String parseSetCookieHeader(String setCookieHeader) {
- if (setCookieHeader == null || setCookieHeader.indexOf('=') == -1 || setCookieHeader.indexOf(';') == -1) {
- return null;
- }
- if (!setCookieHeader.startsWith(AuthServlet.AUTH_COOKIE + "=")) {
- System.err.println("Unknown set cookie: " + setCookieHeader);
- return null;
- }
- return setCookieHeader.substring(setCookieHeader.indexOf("=") + 1, setCookieHeader.indexOf(";"));
- }
-
public SpaceDocument getSpaceDocument(boolean includeChildren) throws IOException {
return new SpaceDocument(fetchAuthenticatedXML(getSpaceURI(includeChildren)));
}
@@ -521,19 +484,19 @@
}
public InputStream getGeometryStream(URI renderableRootURI, String name) throws IOException {
- return fetchAuthenticatedStream(appendToURI(renderableRootURI, "geometry/" + name), authCookie);
+ return fetchAuthenticatedStream(WebAPIUtil.appendToURI(renderableRootURI, "geometry/" + name), authCookie);
}
public void putGeometryStream(URI rootURI, InputStream input, String name) throws IOException {
- performPOST(appendToURI(rootURI, "geometry/" + name), StreamUtils.readInput(input), "application/octet-stream", authCookie);
+ performPOST(WebAPIUtil.appendToURI(rootURI, "geometry/" + name), StreamUtils.readInput(input), "application/octet-stream", authCookie);
}
public void putGeometryStream(URI rootURI, InputStream input, int lodIndex) throws IOException {
- performPOST(appendToURI(rootURI, "geometry/data/" + lodIndex), StreamUtils.readInput(input), "application/octet-stream", authCookie);
+ performPOST(WebAPIUtil.appendToURI(rootURI, "geometry/data/" + lodIndex), StreamUtils.readInput(input), "application/octet-stream", authCookie);
}
public InputStream getGeometryStream(URI renderableRootURI, int lodIndex) throws IOException {
- return fetchAuthenticatedStream(appendToURI(renderableRootURI, "geometry/data/" + lodIndex), authCookie);
+ return fetchAuthenticatedStream(WebAPIUtil.appendToURI(renderableRootURI, "geometry/data/" + lodIndex), authCookie);
}
public static InputStream performGET(URI uri, String authCookie) throws IOException {
@@ -660,7 +623,7 @@
pw.close();
}
- String cookie = parseSetCookieHeader(connection.getHeaderField("Set-Cookie"));
+ String cookie = WebAPIUtil.parseSetCookieHeader(connection.getHeaderField("Set-Cookie"));
if (connection.getResponseCode() != 200) {
throw new IOException("Get status " + connection.getResponseCode() + " from " + uri);
@@ -696,57 +659,48 @@
return fetchAuthenticatedXML(uri, authCookie);
}
- public static URI appendToURI(URI uri, String suffix) {
- try {
- String uriString = uri.toString();
- return new URI(uriString + (uriString.endsWith("/") ? "" : "/") + suffix);
- } catch (URISyntaxException e) {
- throw new IllegalArgumentException("Bad uri: " + uri.toString() + suffix);
- }
- }
-
public URI getSpaceURI() {
return spaceURI;
}
public URI getSpaceURI(boolean includeChildren) {
if (includeChildren) {
- return appendToURI(spaceURI, "?" + SpaceServlet.INCLUDE_CHILDREN_PARAM + "=true");
+ return WebAPIUtil.appendToURI(spaceURI, "?" + SpaceServlet.INCLUDE_CHILDREN_PARAM + "=true");
} else {
return spaceURI;
}
}
public URI getSpaceMemberURI() {
- return appendToURI(spaceURI, "member/");
+ return WebAPIUtil.appendToURI(spaceURI, "member/");
}
private URI getSpaceMemberURI(String memberUsername) {
- return appendToURI(getSpaceMemberURI(), memberUsername + "/");
+ return WebAPIUtil.appendToURI(getSpaceMemberURI(), memberUsername + "/");
}
private URI getUsersSpaceMembershipsURI(String username) {
- return appendToURI(getAccountURI(username), "membership/");
+ return WebAPIUtil.appendToURI(getAccountURI(username), "membership/");
}
public URI getAccountURI() {
- return appendToURI(serviceURI, "account/");
+ return WebAPIUtil.appendToURI(serviceURI, "account/");
}
public URI getAccountURI(String username) {
- return appendToURI(getAccountURI(), username + "/");
+ return WebAPIUtil.appendToURI(getAccountURI(), username + "/");
}
private URI getPossessionsURI(String username) {
- return appendToURI(getAccountURI(username), "possession/");
+ return WebAPIUtil.appendToURI(getAccountURI(username), "possession/");
}
private URI getPossessionURI(String username, long possessionID) {
- return appendToURI(getPossessionsURI(username), possessionID + "/");
+ return WebAPIUtil.appendToURI(getPossessionsURI(username), possessionID + "/");
}
public static URI getAuthURI(URI serviceURI) {
- return appendToURI(serviceURI, "auth/");
+ return WebAPIUtil.appendToURI(serviceURI, "auth/");
}
public URI getAuthURI() {
@@ -754,75 +708,75 @@
}
private static URI getAuthGuestURI(URI serviceURI) {
- return appendToURI(getAuthURI(serviceURI), "guest/");
+ return WebAPIUtil.appendToURI(getAuthURI(serviceURI), "guest/");
}
private URI getAccountSpacesURI(String username) {
- return appendToURI(getAccountURI(username), "space/");
+ return WebAPIUtil.appendToURI(getAccountURI(username), "space/");
}
public URI getTemplatesURI(String username) {
- return appendToURI(getAccountURI(username), "template/");
+ return WebAPIUtil.appendToURI(getAccountURI(username), "template/");
}
public URI getTemplateURI(String username, long templateID) {
- return appendToURI(getTemplatesURI(username), templateID + "/");
+ return WebAPIUtil.appendToURI(getTemplatesURI(username), templateID + "/");
}
public URI getDoorsURI() {
- return appendToURI(spaceURI, "door/");
+ return WebAPIUtil.appendToURI(spaceURI, "door/");
}
public URI getDoorURI(long doorID) {
- return appendToURI(getDoorsURI(), doorID + "/");
+ return WebAPIUtil.appendToURI(getDoorsURI(), doorID + "/");
}
public URI getThingsURI() {
- return appendToURI(spaceURI, "thing/");
+ return WebAPIUtil.appendToURI(spaceURI, "thing/");
}
public URI getThingURI(long thingID) {
- return appendToURI(getThingsURI(), thingID + "/");
+ return WebAPIUtil.appendToURI(getThingsURI(), thingID + "/");
}
private URI getTemplateScriptURI(String username, long templateID) {
- return appendToURI(getTemplateURI(username, templateID), "script/");
+ return WebAPIUtil.appendToURI(getTemplateURI(username, templateID), "script/");
}
public URI getUserURI(String username) {
- return appendToURI(getUsersURI(), username + "/");
+ return WebAPIUtil.appendToURI(getUsersURI(), username + "/");
}
public URI getUsersURI() {
- return appendToURI(spaceURI, "user/");
+ return WebAPIUtil.appendToURI(spaceURI, "user/");
}
private URI getBodiesURI(String username) {
- return appendToURI(getAccountURI(username), "body/");
+ return WebAPIUtil.appendToURI(getAccountURI(username), "body/");
}
public URI getBodyURI(String username, long bodyID) {
- return appendToURI(getBodiesURI(username), bodyID + "/");
+ return WebAPIUtil.appendToURI(getBodiesURI(username), bodyID + "/");
}
public URI getPagesURI(long thingID) {
- return appendToURI(getThingURI(thingID), "page/");
+ return WebAPIUtil.appendToURI(getThingURI(thingID), "page/");
}
public URI getPageURI(long thingID, long pageID) {
- return appendToURI(getPagesURI(thingID), pageID + "/");
+ return WebAPIUtil.appendToURI(getPagesURI(thingID), pageID + "/");
}
private URI getPageContentsURI(long thingID, long pageID) {
- return appendToURI(getPageURI(thingID, pageID), "content");
+ return WebAPIUtil.appendToURI(getPageURI(thingID, pageID), "content");
}
public URI getSettingsURI() {
- return appendToURI(getSpaceURI(), "setting/");
+ return WebAPIUtil.appendToURI(getSpaceURI(), "setting/");
}
public URI getSettingURI(String key) {
- return appendToURI(getSettingsURI(), key + "/");
+ return WebAPIUtil.appendToURI(getSettingsURI(), key + "/");
}
}
Added: spaces/trunk/src/com/ogoglio/client/WebAPIUtil.java
===================================================================
--- spaces/trunk/src/com/ogoglio/client/WebAPIUtil.java (rev 0)
+++ spaces/trunk/src/com/ogoglio/client/WebAPIUtil.java 2007-07-03 02:33:29 UTC (rev 209)
@@ -0,0 +1,34 @@
+package com.ogoglio.client;
+
+import java.io.IOException;
+import java.net.URI;
+import java.net.URISyntaxException;
+
+import com.ogoglio.site.AuthServlet;
+
+public class WebAPIUtil {
+ public static URI appendToURI(URI uri, String suffix) {
+ try {
+ String uriString = uri.toString();
+ return new URI(uriString + (uriString.endsWith("/") ? "" : "/") + suffix);
+ } catch (URISyntaxException e) {
+ throw new IllegalArgumentException("Bad uri: " + uri.toString() + suffix);
+ }
+ }
+
+ //for clients that don't want to bother creating the authenticator object
+ public static String authenticate(URI serviceURI, String username, String password)
+ throws IOException {
+ return (new WebAPIAuthenticator()).authenticate(serviceURI, username, password);
+ }
+ public static String parseSetCookieHeader(String setCookieHeader) {
+ if (setCookieHeader == null || setCookieHeader.indexOf('=') == -1 || setCookieHeader.indexOf(';') == -1) {
+ return null;
+ }
+ if (!setCookieHeader.startsWith(AuthServlet.AUTH_COOKIE + "=")) {
+ System.err.println("Unknown set cookie: " + setCookieHeader);
+ return null;
+ }
+ return setCookieHeader.substring(setCookieHeader.indexOf("=") + 1, setCookieHeader.indexOf(";"));
+ }
+}
Modified: spaces/trunk/src/com/ogoglio/media/WebStore.java
===================================================================
--- spaces/trunk/src/com/ogoglio/media/WebStore.java 2007-07-01 20:25:27 UTC (rev 208)
+++ spaces/trunk/src/com/ogoglio/media/WebStore.java 2007-07-03 02:33:29 UTC (rev 209)
@@ -19,6 +19,7 @@
import java.net.URI;
import com.ogoglio.client.WebAPIClient;
+import com.ogoglio.client.WebAPIUtil;
import com.ogoglio.util.ArgumentUtils;
public class WebStore implements MediaStore {
@@ -35,7 +36,7 @@
}
public boolean write(String name, InputStream input, long maxSize) throws IOException {
- InputStream responseInput = WebAPIClient.performPUT(WebAPIClient.appendToURI(mediaURI, name), input, "application/data", -1, null);
+ InputStream responseInput = WebAPIClient.performPUT(WebAPIUtil.appendToURI(mediaURI, name), input, "application/data", -1, null);
if(responseInput == null) {
return false;
}
@@ -46,19 +47,19 @@
public InputStream getData(String name) {
try {
- return WebAPIClient.performGET(WebAPIClient.appendToURI(mediaURI, name), null);
+ return WebAPIClient.performGET(WebAPIUtil.appendToURI(mediaURI, name), null);
} catch (IOException e) {
return null;
}
}
public long getSize(String name) {
- return WebAPIClient.requestContentLength(WebAPIClient.appendToURI(mediaURI, name), null);
+ return WebAPIClient.requestContentLength(WebAPIUtil.appendToURI(mediaURI, name), null);
}
public boolean delete(String name) {
try {
- return WebAPIClient.sendDelete(WebAPIClient.appendToURI(mediaURI, name), null);
+ return WebAPIClient.sendDelete(WebAPIUtil.appendToURI(mediaURI, name), null);
} catch (IOException e) {
e.printStackTrace();
return false;
Modified: spaces/trunk/src/com/ogoglio/persist/ServiceInitializationPersistTasks.java
===================================================================
--- spaces/trunk/src/com/ogoglio/persist/ServiceInitializationPersistTasks.java 2007-07-01 20:25:27 UTC (rev 208)
+++ spaces/trunk/src/com/ogoglio/persist/ServiceInitializationPersistTasks.java 2007-07-03 02:33:29 UTC (rev 209)
@@ -18,7 +18,7 @@
import org.hibernate.SessionFactory;
-import com.ogoglio.client.WebAPIClient;
+import com.ogoglio.client.WebAPIUtil;
public class ServiceInitializationPersistTasks {
@@ -37,7 +37,7 @@
if (simRecords.length != 0) {
return;
}
- SimPersistTasks.createSim(LOCAL_SIM_DISPLAY_NAME, WebAPIClient.appendToURI(serviceURI, "sim/"), SimRecord.DEFAULT_EVENT_PORT, true, sessionFactory);
+ 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 {
Modified: spaces/trunk/src/com/ogoglio/site/AccountServlet.java
===================================================================
--- spaces/trunk/src/com/ogoglio/site/AccountServlet.java 2007-07-01 20:25:27 UTC (rev 208)
+++ spaces/trunk/src/com/ogoglio/site/AccountServlet.java 2007-07-03 02:33:29 UTC (rev 209)
@@ -29,6 +29,7 @@
import nanoxml.XMLElement;
import com.ogoglio.client.WebAPIClient;
+import com.ogoglio.client.WebAPIUtil;
import com.ogoglio.media.MediaService;
import com.ogoglio.persist.AccountPersistTasks;
import com.ogoglio.persist.AccountRecord;
@@ -725,7 +726,7 @@
if (spaceRecord != null) {
SimRecord simRecord = SpacePersistTasks.findOrAssignSim(spaceRecord, getSessionFactory());
if (simRecord != null) {
- URI thingURI = WebAPIClient.appendToURI(simRecord.getSimURI(), "space/" + record.getSpaceID() + "/thing/" + record.getThingID());
+ URI thingURI = WebAPIUtil.appendToURI(simRecord.getSimURI(), "space/" + record.getSpaceID() + "/thing/" + record.getThingID());
if (!WebAPIClient.sendDelete(thingURI, null)) {
response.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
return;
@@ -775,7 +776,7 @@
if (oldSpaceRecord != null) {
SimRecord simRecord = SpacePersistTasks.findOrAssignSim(oldSpaceRecord, getSessionFactory());
if (simRecord != null) {
- URI thingURI = WebAPIClient.appendToURI(simRecord.getSimURI(), "space/" + oldSpaceID + "/thing/" + oldThingID);
+ URI thingURI = WebAPIUtil.appendToURI(simRecord.getSimURI(), "space/" + oldSpaceID + "/thing/" + oldThingID);
if (!WebAPIClient.sendDelete(thingURI, null)) {
response.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
return;
@@ -810,7 +811,7 @@
return;
}
- URI thingsURI = WebAPIClient.appendToURI(simRecord.getSimURI(), "space/" + record.getSpaceID() + "/thing/");
+ URI thingsURI = WebAPIUtil.appendToURI(simRecord.getSimURI(), "space/" + record.getSpaceID() + "/thing/");
ThingDocument thingDoc = new ThingDocument(-1, templateRecord.getDisplayName(), templateRecord.getTemplateID(), templateRecord.getOwnerUsername(), record.getOwnerUsername(), record.getPossessionID(), new Transform3D(), null);
try {
XMLElement element = WebAPIClient.sendAuthenticatedXML(thingsURI, thingDoc.toString(), "POST", null);
@@ -836,14 +837,6 @@
}
}
- private MessageProxy getMessageProxy() {
- MessageProxy proxy = (MessageProxy) getServletContext().getAttribute(SpaceServlet.MESSAGE_PROXY_KEY);
- if (proxy == null) {
- throw new IllegalStateException("No Message Proxy!");
- }
- return proxy;
- }
-
private class PossessionsResource extends AuthenticatedSiteResource {
public PossessionsResource() {
super("possession", true, getSessionFactory());
Modified: spaces/trunk/src/com/ogoglio/site/AuthServlet.java
===================================================================
--- spaces/trunk/src/com/ogoglio/site/AuthServlet.java 2007-07-01 20:25:27 UTC (rev 208)
+++ spaces/trunk/src/com/ogoglio/site/AuthServlet.java 2007-07-03 02:33:29 UTC (rev 209)
@@ -1,258 +1,256 @@
-/* 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.IOException;
-import java.util.Random;
-
-import javax.servlet.ServletConfig;
-import javax.servlet.ServletException;
-import javax.servlet.http.Cookie;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-import org.hibernate.SessionFactory;
-
-import com.ogoglio.persist.AccountPersistTasks;
-import com.ogoglio.persist.AccountRecord;
-import com.ogoglio.persist.PersistException;
-import com.ogoglio.xml.AuthDocument;
-
-public class AuthServlet extends AbstractResourceServlet {
-
- 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) {
- return new AuthResource();
- }
-
- public static boolean isGuest(HttpServletRequest request) {
- String cookie = getRequestAuthCookie(request);
- if (cookie == null) {
- return false;
- }
- return cookie.startsWith(GUEST_COOKIE_PREFIX);
- }
-
- public static AccountRecord getAuthedAccountRecord(HttpServletRequest request, SessionFactory hibernateSessionFactory) throws PersistException {
- String cookie = getRequestAuthCookie(request);
- if (cookie == null) {
- return null;
- }
- return AccountPersistTasks.findAccountByCookie(cookie, hibernateSessionFactory);
- }
-
- private AccountRecord authenticate(String username, String password) throws PersistException {
- if (username == null || password == null) {
- return null;
- }
-
- AccountRecord accountRecord = AccountPersistTasks.findAccountByUsername(username, getSessionFactory());
- if (accountRecord == null) {
- return null;
- }
- if (accountRecord.getFrozenUntil() != null && accountRecord.getFrozenUntil().getTime() > System.currentTimeMillis()) {
- return null;
- }
- if (password != null && !password.equals(accountRecord.getPassword())) {
- return null;
- }
-
- if (accountRecord.getCookie() == null) {
- accountRecord.setCookie(generateAuthCookie(false));
- }
-
- AccountPersistTasks.update(accountRecord, getSessionFactory());
-
- return accountRecord;
- }
-
- private class AuthResource extends SiteResource {
- public AuthResource() {
- super("auth");
- addSubResource(new GuestResource());
- }
-
- public void doGet(HttpServletRequest request, HttpServletResponse response, String[] pathElements) throws ServletException, IOException {
- try {
-
- String logoutParam = request.getParameter(LOGOUT_PARAM);
-
- AccountRecord cookieAccountRecord = getAuthedAccountRecord(request, getSessionFactory());
-
- if (request.getParameter("debug") != null) {
- String result = "";
- if (cookieAccountRecord != null) {
- result += "person element: " + cookieAccountRecord.getUsername() + "\n";
- result += "authCookie: " + cookieAccountRecord.getCookie() + "\n";
- }
- result += "requestCookie: " + getRequestAuthCookie(request) + "\n";
- result += "logoutParam: " + logoutParam + "\n";
- response.setStatus(HttpServletResponse.SC_OK);
- response.setContentType("text/plain");
- response.getOutputStream().write(result.getBytes());
- return;
- } else if ("true".equals(logoutParam)) {
- request.getSession().removeAttribute(AUTH_DATA_KEY);
- Cookie logoutCookie = new Cookie(AUTH_COOKIE, "logMeOut");
- logoutCookie.setPath("/");
- logoutCookie.setMaxAge(0);
- logoutCookie.setDomain(getSiteInfo().getHost());
- response.addCookie(logoutCookie);
-
- AuthDocument authDoc = new AuthDocument();
-
- response.setStatus(HttpServletResponse.SC_OK);
- response.setContentType("text/xml");
- response.getOutputStream().write(authDoc.toString().getBytes());
- return;
- } else {
- AuthDocument authDoc = null;
- if (cookieAccountRecord != null) {
- authDoc = new AuthDocument(cookieAccountRecord.getUsername(), true);
- } else {
- authDoc = new AuthDocument();
- }
- response.setStatus(HttpServletResponse.SC_OK);
- response.setContentType("text/xml");
- response.getOutputStream().write(authDoc.toString().getBytes());
- return;
- }
- } catch (PersistException e) {
- response.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
- return;
- }
- }
-
- 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);
-
- if (usernameParam != null || passParam != null) {
- AccountRecord authedAccountRecord = authenticate(usernameParam, passParam);
- if (authedAccountRecord != null) {
- Cookie newCookie = new Cookie(AUTH_COOKIE, authedAccountRecord.getCookie());
- newCookie.setPath("/");
- newCookie.setMaxAge(Integer.MAX_VALUE - 1);
- newCookie.setDomain(getSiteInfo().getHost());
- response.addCookie(newCookie);
-
- AuthDocument authDoc = new AuthDocument(authedAccountRecord.getUsername(), true);
- response.setStatus(HttpServletResponse.SC_OK);
- response.setContentType("text/xml");
- response.getOutputStream().write(authDoc.toString().getBytes());
- return;
- } else {
- AuthDocument authDoc = new AuthDocument();
- response.setStatus(HttpServletResponse.SC_OK);
- response.setContentType("text/xml");
- response.getOutputStream().write(authDoc.toString().getBytes());
- return;
- }
- }
-
- AccountRecord cookieAccountRecord = getAuthedAccountRecord(request, getSessionFactory());
- AuthDocument authDoc = null;
- if (cookieAccountRecord != null) {
- authDoc = new AuthDocument(cookieAccountRecord.getUsername(), true);
- } else {
- authDoc = new AuthDocument();
- }
-
- response.setStatus(HttpServletResponse.SC_OK);
- response.setContentType("text/xml");
- response.getOutputStream().write(authDoc.toString().getBytes());
- return;
- } catch (PersistException e) {
- response.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
- return;
- }
-
- }
- }
-
- private class GuestResource extends SiteResource {
- public GuestResource() {
- super("guest");
- }
-
- public void doPost(HttpServletRequest request, HttpServletResponse response, String[] pathElements) throws ServletException, IOException {
- String cookie = generateGuestCookie();
- Cookie newCookie = new Cookie(AUTH_COOKIE, cookie);
- newCookie.setPath("/");
- newCookie.setMaxAge(-1);
- newCookie.setDomain(getSiteInfo().getHost());
-
- response.addCookie(newCookie);
-
- response.setStatus(HttpServletResponse.SC_OK);
- response.setContentType("text/plain");
- response.getOutputStream().write(cookie.getBytes());
- return;
- }
- }
-
- public static String getRequestAuthCookie(HttpServletRequest request) {
- Cookie[] cookies = request.getCookies();
- for (int i = 0; cookies != null && i < cookies.length; i++) {
- if (AUTH_COOKIE.equals(cookies[i].getName())) {
- return cookies[i].getValue();
- }
- }
- return null;
- }
-
- public static final String COOKIE_CHARS = "abcdefghijklmnopqrstuvwxyz1234567890";
-
- public static final String GUEST_COOKIE_PREFIX = "guest";
-
- public static final String[] GUEST_NAMES = { "Moon", "Spoon", "Plume", "Bloom", "Thyme", "Rhyme", "Steel", "Boat", "Vase", "Book", "Screen", "Fenestra", "Farmer", "Door", "Squid", "Rocket", "Picker", "Page", "Lawn", "Food", "Plate", "Bean", "Horse", "Cat", "Fireplace", "Frame", "Chair", "Table", "Sofa", "Stair", "Counter", "Shelf", "Phone", "Robot", "Tree", "Key" };
-
- private String generateGuestCookie() {
- StringBuffer result = new StringBuffer();
- result.append(GUEST_COOKIE_PREFIX);
- for (int i = 0; i < 3; i++) {
- result.append("_" + GUEST_NAMES[Math.abs(random.nextInt()) % GUEST_NAMES.length]);
- }
- return result.toString();
- }
-
- private String generateAuthCookie(boolean guest) {
- StringBuffer result = new StringBuffer(14);
- if (guest) {
- result.append(GUEST_COOKIE_PREFIX);
- } else {
- result.append("tr");
- }
- for (int i = 0; i < 12; i++) {
- result.append(COOKIE_CHARS.charAt(Math.abs(random.nextInt()) % COOKIE_CHARS.length()));
- }
- return result.toString();
- }
-
-}
+\xFE\xFF |
|
From: <ian...@us...> - 2007-07-01 20:25:24
|
Revision: 208
http://ogoglio.svn.sourceforge.net/ogoglio/?rev=208&view=rev
Author: iansmith
Date: 2007-07-01 13:25:27 -0700 (Sun, 01 Jul 2007)
Log Message:
-----------
Small mods to allow the development web host to be accessible by a development client (with faster graphics hardware). These really only affect the initialization-time URL assigned to the Sim (http://127.0.0.1 or http://10.0.1.198, for example) and the library account. Only matters for developers.
Modified Paths:
--------------
spaces/trunk/src/com/ogoglio/PrepareDatabase.java
spaces/trunk/src/com/ogoglio/persist/ServiceInitializationPersistTasks.java
spaces/trunk/src/com/ogoglio/site/AccountServlet.java
spaces/trunk/src/com/ogoglio/viewer/j3d/J3DRenderer.java
Modified: spaces/trunk/src/com/ogoglio/PrepareDatabase.java
===================================================================
--- spaces/trunk/src/com/ogoglio/PrepareDatabase.java 2007-07-01 18:46:57 UTC (rev 207)
+++ spaces/trunk/src/com/ogoglio/PrepareDatabase.java 2007-07-01 20:25:27 UTC (rev 208)
@@ -1,8 +1,9 @@
package com.ogoglio;
+import java.net.URI;
+
import org.hibernate.SessionFactory;
import org.hibernate.cfg.Configuration;
-import org.hibernate.tool.hbm2ddl.SchemaUpdate;
import com.ogoglio.persist.ServiceInitializationPersistTasks;
@@ -33,10 +34,13 @@
configuration.setProperty("hibernate.connection.pool_size","1");
configuration.setProperty("hibernate.dialect","org.hibernate.dialect.HSQLDialect");
configuration.setProperty("hibernate.connection.shutdown","true");
+ String host = "10.0.1.198"; //best choice: 127.0.0.1
+ String siteInfo = "http://"+host+":8080/og"; //configured in server.xml
SessionFactory sessionFactory = configuration.buildSessionFactory();
try {
//new SchemaUpdate(configuration).execute(true,true);
- ServiceInitializationPersistTasks.initializeLibraryAccount(sessionFactory);
+ ServiceInitializationPersistTasks.initializeLocalSim(new URI(siteInfo), sessionFactory);
+ ServiceInitializationPersistTasks.initializeLibraryAccount(sessionFactory,host);
sessionFactory.close();
System.out.println("Completed successfully. DB is now ready.");
} catch (Exception e) {
Modified: spaces/trunk/src/com/ogoglio/persist/ServiceInitializationPersistTasks.java
===================================================================
--- spaces/trunk/src/com/ogoglio/persist/ServiceInitializationPersistTasks.java 2007-07-01 18:46:57 UTC (rev 207)
+++ spaces/trunk/src/com/ogoglio/persist/ServiceInitializationPersistTasks.java 2007-07-01 20:25:27 UTC (rev 208)
@@ -40,13 +40,13 @@
SimPersistTasks.createSim(LOCAL_SIM_DISPLAY_NAME, WebAPIClient.appendToURI(serviceURI, "sim/"), SimRecord.DEFAULT_EVENT_PORT, true, sessionFactory);
}
- public static void initializeLibraryAccount(SessionFactory sessionFactory) throws PersistException, IOException {
+ public static void initializeLibraryAccount(SessionFactory sessionFactory,String host) throws PersistException, IOException {
AccountRecord accountRec = AccountPersistTasks.findAccountByUsername(LIBRARY_USERNAME, sessionFactory);
if (accountRec != null) {
return;
}
- accountRec = AccountPersistTasks.createAccount(LIBRARY_USERNAME, "admin", "library@127.0.0.1", sessionFactory);
+ accountRec = AccountPersistTasks.createAccount(LIBRARY_USERNAME, "admin", "library@"+host, sessionFactory);
accountRec.setPassword(DEFAULT_LIBRARY_PASSWORD);
AccountPersistTasks.update(accountRec, sessionFactory);
Modified: spaces/trunk/src/com/ogoglio/site/AccountServlet.java
===================================================================
--- spaces/trunk/src/com/ogoglio/site/AccountServlet.java 2007-07-01 18:46:57 UTC (rev 207)
+++ spaces/trunk/src/com/ogoglio/site/AccountServlet.java 2007-07-01 20:25:27 UTC (rev 208)
@@ -80,7 +80,7 @@
super.init(config);
try {
ServiceInitializationPersistTasks.initializeLocalSim(new URI(getSiteInfo().getBaseUrl()), getSessionFactory());
- ServiceInitializationPersistTasks.initializeLibraryAccount(getSessionFactory());
+ ServiceInitializationPersistTasks.initializeLibraryAccount(getSessionFactory(),getSiteInfo().getHost());
} catch (PersistException e) {
e.printStackTrace();
throw new ServletException("Could not initialize service: " + e);
Modified: spaces/trunk/src/com/ogoglio/viewer/j3d/J3DRenderer.java
===================================================================
--- spaces/trunk/src/com/ogoglio/viewer/j3d/J3DRenderer.java 2007-07-01 18:46:57 UTC (rev 207)
+++ spaces/trunk/src/com/ogoglio/viewer/j3d/J3DRenderer.java 2007-07-01 20:25:27 UTC (rev 208)
@@ -821,8 +821,10 @@
public double getLandHeight(double x, double z, double pickHeight) {
pickStart.set(x, pickHeight, z);
if (picker.pickRayClosest(pickStart, DOWN_VEC, intersectionPoint) == null) {
+ //System.out.println("no land height: 0!");
return 0;
}
+ //System.out.println("intersected with land: "+intersectionPoint.y);
return intersectionPoint.y;
}
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ian...@us...> - 2007-07-01 18:46:55
|
Revision: 207
http://ogoglio.svn.sourceforge.net/ogoglio/?rev=207&view=rev
Author: iansmith
Date: 2007-07-01 11:46:57 -0700 (Sun, 01 Jul 2007)
Log Message:
-----------
Minor changes.
1) Added PrepareDatabase in com.ogoglio to have a way to create the database without needed to flip switches in configuration files. This may be in the wrong package; I just put it near the test suite because I use it to prepare for running tests.
2) Added a workaround to get around the differences between Linux's JDK and Apple's. This is really gross, but necessary to get ogoglio to compile. It's marked with XXX in WebAPIClient.
3) Removed some dead code and parameters as I encountered them. It's all in the tree.
Modified Paths:
--------------
spaces/trunk/src/com/ogoglio/client/WebAPIClient.java
spaces/trunk/src/com/ogoglio/persist/ServiceInitializationPersistTasks.java
spaces/trunk/src/com/ogoglio/site/AccountServlet.java
Added Paths:
-----------
spaces/trunk/src/com/ogoglio/PrepareDatabase.java
Added: spaces/trunk/src/com/ogoglio/PrepareDatabase.java
===================================================================
--- spaces/trunk/src/com/ogoglio/PrepareDatabase.java (rev 0)
+++ spaces/trunk/src/com/ogoglio/PrepareDatabase.java 2007-07-01 18:46:57 UTC (rev 207)
@@ -0,0 +1,48 @@
+package com.ogoglio;
+
+import org.hibernate.SessionFactory;
+import org.hibernate.cfg.Configuration;
+import org.hibernate.tool.hbm2ddl.SchemaUpdate;
+
+import com.ogoglio.persist.ServiceInitializationPersistTasks;
+
+public class PrepareDatabase {
+
+ /*
+ * 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) {
+ Configuration configuration = new Configuration();
+ configuration.addResource("com/ogoglio/persist/Persist.hbm.xml");
+ configuration.setProperty("hibernate.hbm2ddl.auto", "create");
+ configuration.setProperty("hibernate.show_sql", "true");
+ configuration.setProperty("hibernate.connection.driver_class","org.hsqldb.jdbcDriver");
+ configuration.setProperty("hibernate.connection.url","jdbc:hsqldb:db/ogoglio");
+ configuration.setProperty("hibernate.connection.username","sa");
+ configuration.setProperty("hibernate.connection.password","");
+ configuration.setProperty("hibernate.connection.pool_size","1");
+ configuration.setProperty("hibernate.dialect","org.hibernate.dialect.HSQLDialect");
+ configuration.setProperty("hibernate.connection.shutdown","true");
+ SessionFactory sessionFactory = configuration.buildSessionFactory();
+ try {
+ //new SchemaUpdate(configuration).execute(true,true);
+ ServiceInitializationPersistTasks.initializeLibraryAccount(sessionFactory);
+ sessionFactory.close();
+ System.out.println("Completed successfully. DB is now ready.");
+ } catch (Exception e) {
+ e.printStackTrace();
+ System.err.println("Exception during attempt to init DB:\n"+e.getMessage());
+ }
+ }
+
+}
Modified: spaces/trunk/src/com/ogoglio/client/WebAPIClient.java
===================================================================
--- spaces/trunk/src/com/ogoglio/client/WebAPIClient.java 2007-07-01 02:45:30 UTC (rev 206)
+++ spaces/trunk/src/com/ogoglio/client/WebAPIClient.java 2007-07-01 18:46:57 UTC (rev 207)
@@ -22,6 +22,7 @@
import java.net.URI;
import java.net.URISyntaxException;
import java.util.HashMap;
+import java.util.List;
import java.util.Map;
import java.util.Vector;
import java.util.zip.GZIPInputStream;
@@ -571,7 +572,19 @@
if (connection.getResponseCode() != 200) {
return -1;
}
- String lengthHeader = (String)connection.getRequestProperties().get("Content-Length");
+ // XXX get("Content-Length") on linux (1.5.0_07) returns a List so this hideous workaround
+ // XXX seems to be required
+ String lengthHeader=null;
+ Object makeLinuxHappy=(connection.getRequestProperties().get("Content-Length"));
+ if (makeLinuxHappy instanceof String) {
+ lengthHeader = (String)makeLinuxHappy;
+ } else if (makeLinuxHappy instanceof List) {
+ lengthHeader = (String) ((List)makeLinuxHappy).get(0);
+ } else {
+ // we don't understand this type at all
+ System.err.println("Unable to understand the type returned by Linux workaround in WebAPIClient!");
+ return -1;
+ }
if(lengthHeader == null) {
return -1;
}
Modified: spaces/trunk/src/com/ogoglio/persist/ServiceInitializationPersistTasks.java
===================================================================
--- spaces/trunk/src/com/ogoglio/persist/ServiceInitializationPersistTasks.java 2007-07-01 02:45:30 UTC (rev 206)
+++ spaces/trunk/src/com/ogoglio/persist/ServiceInitializationPersistTasks.java 2007-07-01 18:46:57 UTC (rev 207)
@@ -13,16 +13,12 @@
limitations under the License. */
package com.ogoglio.persist;
-import java.io.File;
import java.io.IOException;
-import java.io.InputStream;
import java.net.URI;
import org.hibernate.SessionFactory;
import com.ogoglio.client.WebAPIClient;
-import com.ogoglio.media.MediaService;
-import com.ogoglio.util.StreamUtils;
public class ServiceInitializationPersistTasks {
@@ -36,10 +32,6 @@
public static final String DEFAULT_DOOR_DISPLAY_NAME = "Default Door";
- private static final String TEST_CUBE_DISPLAY_NAME = "Test Cube";
-
- private static final String TEST_CYLINDER_DISPLAY_NAME = "Test Cylinder";
-
public static void initializeLocalSim(URI serviceURI, SessionFactory sessionFactory) throws PersistException {
SimRecord[] simRecords = SimPersistTasks.findSims(sessionFactory);
if (simRecords.length != 0) {
@@ -48,11 +40,7 @@
SimPersistTasks.createSim(LOCAL_SIM_DISPLAY_NAME, WebAPIClient.appendToURI(serviceURI, "sim/"), SimRecord.DEFAULT_EVENT_PORT, true, sessionFactory);
}
- private static InputStream getResourceStream(String name) {
- return ServiceInitializationPersistTasks.class.getClassLoader().getResourceAsStream(name);
- }
-
- public static void initializeLibraryAccount(MediaService mediaService, SessionFactory sessionFactory) throws PersistException, IOException {
+ public static void initializeLibraryAccount(SessionFactory sessionFactory) throws PersistException, IOException {
AccountRecord accountRec = AccountPersistTasks.findAccountByUsername(LIBRARY_USERNAME, sessionFactory);
if (accountRec != null) {
return;
@@ -62,36 +50,5 @@
accountRec.setPassword(DEFAULT_LIBRARY_PASSWORD);
AccountPersistTasks.update(accountRec, sessionFactory);
- /*
- TemplateRecord defaultLandTemplate = TemplatePersistTasks.createTemplate(DEFAULT_LAND_DISPLAY_NAME, accountRec.getUsername(), sessionFactory);
- mediaService.write("templateGeometry-1-0", getResourceStream("com/ogoglio/persist/resources/defaultLand.obj"), -1);
- mediaService.write("templateGeometry-1-defaultLand.mtl", getResourceStream("com/ogoglio/persist/resources/defaultLand.mtl"), -1);
- mediaService.write("templateGeometry-1-Grid.gif", getResourceStream("com/ogoglio/persist/resources/Grid.gif"), -1);
-
- TemplateRecord defaultDoorTemplate = TemplatePersistTasks.createTemplate(DEFAULT_DOOR_DISPLAY_NAME, accountRec.getUsername(), sessionFactory);
- mediaService.write("templateGeometry-2-0", getResourceStream("com/ogoglio/persist/resources/door.obj"), -1);
- mediaService.write("templateGeometry-2-door.mtl", getResourceStream("com/ogoglio/persist/resources/door.mtl"), -1);
-
- TemplateRecord testCubeTemplate = TemplatePersistTasks.createTemplate(TEST_CUBE_DISPLAY_NAME, accountRec.getUsername(), sessionFactory);
- mediaService.write("templateGeometry-3-0", getResourceStream("com/ogoglio/persist/resources/TestCube.obj"), -1);
- mediaService.write("templateGeometry-3-TestCube.mtl", getResourceStream("com/ogoglio/persist/resources/TestCube.mtl"), -1);
- mediaService.write("templateGeometry-3-TestCube.gif", getResourceStream("com/ogoglio/persist/resources/TestCube.gif"), -1);
- mediaService.write("templateScript-3.js", getResourceStream("com/ogoglio/persist/resources/TestCube.js"), -1);
-
- TemplateRecord testCylinderTemplate = TemplatePersistTasks.createTemplate(TEST_CYLINDER_DISPLAY_NAME, accountRec.getUsername(), sessionFactory);
- mediaService.write("templateGeometry-4-0", getResourceStream("com/ogoglio/persist/resources/TestCylinder.obj"), -1);
- */
}
-
- private static AccountRecord createUser(String username, String accountlevel, String email, String password, String cookie, SessionFactory sessionFactory) throws PersistException {
- AccountRecord accountRec = AccountPersistTasks.findAccountByUsername(username, sessionFactory);
- if (accountRec != null) {
- return accountRec;
- }
- accountRec = AccountPersistTasks.createAccount(username, accountlevel, email, sessionFactory);
- accountRec.setPassword(password);
- accountRec.setCookie(cookie);
- AccountPersistTasks.update(accountRec, sessionFactory);
- return accountRec;
- }
}
Modified: spaces/trunk/src/com/ogoglio/site/AccountServlet.java
===================================================================
--- spaces/trunk/src/com/ogoglio/site/AccountServlet.java 2007-07-01 02:45:30 UTC (rev 206)
+++ spaces/trunk/src/com/ogoglio/site/AccountServlet.java 2007-07-01 18:46:57 UTC (rev 207)
@@ -80,7 +80,7 @@
super.init(config);
try {
ServiceInitializationPersistTasks.initializeLocalSim(new URI(getSiteInfo().getBaseUrl()), getSessionFactory());
- ServiceInitializationPersistTasks.initializeLibraryAccount(getMediaService(), getSessionFactory());
+ ServiceInitializationPersistTasks.initializeLibraryAccount(getSessionFactory());
} catch (PersistException e) {
e.printStackTrace();
throw new ServletException("Could not initialize service: " + e);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <tre...@us...> - 2007-07-01 02:45:29
|
Revision: 206
http://ogoglio.svn.sourceforge.net/ogoglio/?rev=206&view=rev
Author: trevorolio
Date: 2007-06-30 19:45:30 -0700 (Sat, 30 Jun 2007)
Log Message:
-----------
Removed FART debug printout.
Put unique constraint back into hibernate persist xml (problem with that can be fixed by setting proper hibernate dialect).
Removed .get(0) from http connection request properties (in WebAPIClient) until we figure out why it doesn't work on linux JVM.
Added check to MediaServlet so it responds correctly when the file store isn't set.
Modified Paths:
--------------
spaces/trunk/src/com/ogoglio/client/ClientTests.java
spaces/trunk/src/com/ogoglio/client/WebAPIClient.java
spaces/trunk/src/com/ogoglio/media/site/MediaServlet.java
spaces/trunk/src/com/ogoglio/persist/Persist.hbm.xml
spaces/trunk/src/hibernate.cfg.xml
Modified: spaces/trunk/src/com/ogoglio/client/ClientTests.java
===================================================================
--- spaces/trunk/src/com/ogoglio/client/ClientTests.java 2007-07-01 00:16:17 UTC (rev 205)
+++ spaces/trunk/src/com/ogoglio/client/ClientTests.java 2007-07-01 02:45:30 UTC (rev 206)
@@ -83,7 +83,7 @@
try {
String adminAuthCookie = WebAPIClient.authenticate(serviceURI1, ServiceInitializationPersistTasks.LIBRARY_USERNAME, ServiceInitializationPersistTasks.DEFAULT_LIBRARY_PASSWORD);
assertNotNull("got null auth cookie", adminAuthCookie);
- System.out.println("PASSED FIRST FART");
+
try {
WebAPIClient.createAccount(serviceURI1, adminAuthCookie, USERNAME1, AccountRecord.ACCOUNT_LEVEL_ADVANCED, "Susan", "Examplar", "http://example.com/susan/", "su...@ex...", PASSWORD1);
WebAPIClient.createAccount(serviceURI1, adminAuthCookie, USERNAME2, AccountRecord.ACCOUNT_LEVEL_ADVANCED, "Tina", "Examplar", "http://example.com/tina/", "ti...@ex...", PASSWORD1);
@@ -445,7 +445,7 @@
private class TestListener implements Space.Listener {
- java.util.Vector personAdds = new java.util.Vector();
+ Vector personAdds = new Vector();
Vector personRemoves = new Vector();
Modified: spaces/trunk/src/com/ogoglio/client/WebAPIClient.java
===================================================================
--- spaces/trunk/src/com/ogoglio/client/WebAPIClient.java 2007-07-01 00:16:17 UTC (rev 205)
+++ spaces/trunk/src/com/ogoglio/client/WebAPIClient.java 2007-07-01 02:45:30 UTC (rev 206)
@@ -571,7 +571,7 @@
if (connection.getResponseCode() != 200) {
return -1;
}
- String lengthHeader = (String)connection.getRequestProperties().get("Content-Length").get(0);
+ String lengthHeader = (String)connection.getRequestProperties().get("Content-Length");
if(lengthHeader == null) {
return -1;
}
Modified: spaces/trunk/src/com/ogoglio/media/site/MediaServlet.java
===================================================================
--- spaces/trunk/src/com/ogoglio/media/site/MediaServlet.java 2007-07-01 00:16:17 UTC (rev 205)
+++ spaces/trunk/src/com/ogoglio/media/site/MediaServlet.java 2007-07-01 02:45:30 UTC (rev 206)
@@ -40,9 +40,7 @@
private class MediaResource extends SiteResource {
public MediaResource() {
super("media");
- if (fileStore != null) {
addSubResource(new DataResource());
- }
}
public void doGet(HttpServletRequest request, HttpServletResponse response, String[] pathElements) throws ServletException, IOException {
@@ -56,6 +54,11 @@
}
public void doGet(HttpServletRequest request, HttpServletResponse response, String[] pathElements) throws ServletException, IOException {
+ if(fileStore == null) {
+ response.setStatus(HttpServletResponse.SC_NOT_FOUND);
+ return;
+ }
+
String name = pathElements[pathElements.length - 1];
InputStream input = fileStore.getData(name);
if (input == null) {
@@ -68,6 +71,11 @@
}
public void doPut(HttpServletRequest request, HttpServletResponse response, String[] pathElements) throws ServletException, IOException {
+ if(fileStore == null) {
+ response.setStatus(HttpServletResponse.SC_NOT_FOUND);
+ return;
+ }
+
String name = pathElements[pathElements.length - 1];
fileStore.write(name, request.getInputStream(), -1);
response.setStatus(HttpServletResponse.SC_OK);
@@ -76,6 +84,11 @@
}
public void doDelete(HttpServletRequest request, HttpServletResponse response, String[] pathElements) throws ServletException, IOException {
+ if(fileStore == null) {
+ response.setStatus(HttpServletResponse.SC_NOT_FOUND);
+ return;
+ }
+
String name = pathElements[pathElements.length - 1];
if (!fileStore.exists(name)) {
@@ -95,6 +108,11 @@
}
public void doHead(HttpServletRequest request, HttpServletResponse response, String[] pathElements) throws ServletException, IOException {
+ if(fileStore == null) {
+ response.setStatus(HttpServletResponse.SC_NOT_FOUND);
+ return;
+ }
+
String name = pathElements[pathElements.length - 1];
if (!fileStore.exists(name)) {
response.setStatus(HttpServletResponse.SC_NOT_FOUND);
@@ -107,5 +125,4 @@
return;
}
}
-
}
Modified: spaces/trunk/src/com/ogoglio/persist/Persist.hbm.xml
===================================================================
--- spaces/trunk/src/com/ogoglio/persist/Persist.hbm.xml 2007-07-01 00:16:17 UTC (rev 205)
+++ spaces/trunk/src/com/ogoglio/persist/Persist.hbm.xml 2007-07-01 02:45:30 UTC (rev 206)
@@ -77,7 +77,7 @@
<id name="username">
</id>
- <property name="email" not-null="true"/>
+ <property name="email" not-null="true" unique="true" />
<property name="accountlevel" not-null="true" />
<property name="password"/>
<property name="firstName"/>
Modified: spaces/trunk/src/hibernate.cfg.xml
===================================================================
--- spaces/trunk/src/hibernate.cfg.xml 2007-07-01 00:16:17 UTC (rev 205)
+++ spaces/trunk/src/hibernate.cfg.xml 2007-07-01 02:45:30 UTC (rev 206)
@@ -33,7 +33,7 @@
<property name="dialect">org.hibernate.dialect.MySQLDialect</property>
<!-- THIS IS THE LINE YOU UNCOMMENT TO CREATE YOUR SCHEMA -->
- <!-- <property name="hbm2ddl.auto">create</property> -->
+ <!-- <property name="hbm2ddl.auto">create</property> -->
<mapping resource="com/ogoglio/persist/Persist.hbm.xml"/>
</session-factory>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ian...@us...> - 2007-07-01 00:16:17
|
Revision: 205
http://ogoglio.svn.sourceforge.net/ogoglio/?rev=205&view=rev
Author: iansmith
Date: 2007-06-30 17:16:17 -0700 (Sat, 30 Jun 2007)
Log Message:
-----------
Two minor change/workarounds to get all tests to pass:
1) In hiberate defn the "unique" modifier to the email field of accountrecord was causing hypersonic to barf on creation of the table. Seemed legal and sensible to me
be able to declare a field unique in that spot but removing it allowed tables to be
created ok.
17:06:37,107 ERROR SchemaExport:168 - Unexpected token: UNIQUE in statement [cre
ate table AccountRecords (username varchar(255) not null, email varchar(255) not
null unique]
2) Some test code was reading the content-length header of a response from a server
and was assuming that there would be only one header with that name. This resulted
in a compile-time error (how was this working at all?) because the returned value
was a vector of results, not a single value. Added "get(0)" because I couldn't
see an HTML protocol that expected to NOT to use the 0th.
Minor changes here-and-there to remove warnings.
Modified Paths:
--------------
spaces/trunk/src/com/ogoglio/client/ClientTests.java
spaces/trunk/src/com/ogoglio/client/WebAPIClient.java
spaces/trunk/src/com/ogoglio/persist/Persist.hbm.xml
spaces/trunk/src/hibernate.cfg.xml
Modified: spaces/trunk/src/com/ogoglio/client/ClientTests.java
===================================================================
--- spaces/trunk/src/com/ogoglio/client/ClientTests.java 2007-06-29 23:54:04 UTC (rev 204)
+++ spaces/trunk/src/com/ogoglio/client/ClientTests.java 2007-07-01 00:16:17 UTC (rev 205)
@@ -65,19 +65,10 @@
URI serviceURI1 = null;
- private String spaceName1;
-
- private long spaceID1;
-
- private String templateName1;
-
public void setUp() {
try {
- spaceID1 = 1;
- spaceName1 = "Angry Young Space";
serviceURI1 = new URI("http://127.0.0.1:8080/og/");
linkURI1 = new URI("http://ogoglio.com/");
- templateName1 = "Flat Blue Earth";
} catch (Throwable e) {
e.printStackTrace();
fail(e.getMessage());
@@ -92,7 +83,7 @@
try {
String adminAuthCookie = WebAPIClient.authenticate(serviceURI1, ServiceInitializationPersistTasks.LIBRARY_USERNAME, ServiceInitializationPersistTasks.DEFAULT_LIBRARY_PASSWORD);
assertNotNull("got null auth cookie", adminAuthCookie);
-
+ System.out.println("PASSED FIRST FART");
try {
WebAPIClient.createAccount(serviceURI1, adminAuthCookie, USERNAME1, AccountRecord.ACCOUNT_LEVEL_ADVANCED, "Susan", "Examplar", "http://example.com/susan/", "su...@ex...", PASSWORD1);
WebAPIClient.createAccount(serviceURI1, adminAuthCookie, USERNAME2, AccountRecord.ACCOUNT_LEVEL_ADVANCED, "Tina", "Examplar", "http://example.com/tina/", "ti...@ex...", PASSWORD1);
@@ -136,7 +127,7 @@
} catch (Exception e) {
e.printStackTrace();
- fail();
+ fail("Might want to check to make sure database exists and library account exists...");
}
}
@@ -378,7 +369,7 @@
assertNotNull(stream);
consume(stream);
- PossessionDocument removedPossDoc = webClient1.removePossessionFromSpace(thingDocs[0].getOwnerUsername(), thingDocs[0].getPossessionID());
+ webClient1.removePossessionFromSpace(thingDocs[0].getOwnerUsername(), thingDocs[0].getPossessionID());
thingDocs = webClient1.getThingDocuments();
assertEquals(0, thingDocs.length);
@@ -454,7 +445,7 @@
private class TestListener implements Space.Listener {
- Vector personAdds = new Vector();
+ java.util.Vector personAdds = new java.util.Vector();
Vector personRemoves = new Vector();
Modified: spaces/trunk/src/com/ogoglio/client/WebAPIClient.java
===================================================================
--- spaces/trunk/src/com/ogoglio/client/WebAPIClient.java 2007-06-29 23:54:04 UTC (rev 204)
+++ spaces/trunk/src/com/ogoglio/client/WebAPIClient.java 2007-07-01 00:16:17 UTC (rev 205)
@@ -571,7 +571,7 @@
if (connection.getResponseCode() != 200) {
return -1;
}
- String lengthHeader = (String)connection.getRequestProperties().get("Content-Length");
+ String lengthHeader = (String)connection.getRequestProperties().get("Content-Length").get(0);
if(lengthHeader == null) {
return -1;
}
Modified: spaces/trunk/src/com/ogoglio/persist/Persist.hbm.xml
===================================================================
--- spaces/trunk/src/com/ogoglio/persist/Persist.hbm.xml 2007-06-29 23:54:04 UTC (rev 204)
+++ spaces/trunk/src/com/ogoglio/persist/Persist.hbm.xml 2007-07-01 00:16:17 UTC (rev 205)
@@ -77,7 +77,7 @@
<id name="username">
</id>
- <property name="email" not-null="true" unique="true" />
+ <property name="email" not-null="true"/>
<property name="accountlevel" not-null="true" />
<property name="password"/>
<property name="firstName"/>
Modified: spaces/trunk/src/hibernate.cfg.xml
===================================================================
--- spaces/trunk/src/hibernate.cfg.xml 2007-06-29 23:54:04 UTC (rev 204)
+++ spaces/trunk/src/hibernate.cfg.xml 2007-07-01 00:16:17 UTC (rev 205)
@@ -33,7 +33,7 @@
<property name="dialect">org.hibernate.dialect.MySQLDialect</property>
<!-- THIS IS THE LINE YOU UNCOMMENT TO CREATE YOUR SCHEMA -->
- <!-- <property name="hbm2ddl.auto">create</property> -->
+ <!-- <property name="hbm2ddl.auto">create</property> -->
<mapping resource="com/ogoglio/persist/Persist.hbm.xml"/>
</session-factory>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <tre...@us...> - 2007-06-29 23:54:04
|
Revision: 204
http://ogoglio.svn.sourceforge.net/ogoglio/?rev=204&view=rev
Author: trevorolio
Date: 2007-06-29 16:54:04 -0700 (Fri, 29 Jun 2007)
Log Message:
-----------
Added versions of web.xml for app, sim, and media servers.
Added Paths:
-----------
spaces/trunk/war/WEB-INF/web-app.xml
spaces/trunk/war/WEB-INF/web-media.xml
spaces/trunk/war/WEB-INF/web-sim.xml
Added: spaces/trunk/war/WEB-INF/web-app.xml
===================================================================
--- spaces/trunk/war/WEB-INF/web-app.xml (rev 0)
+++ spaces/trunk/war/WEB-INF/web-app.xml 2007-06-29 23:54:04 UTC (rev 204)
@@ -0,0 +1,40 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<web-app xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd" version="2.4">
+ <servlet>
+ <servlet-name>AccountServlet</servlet-name>
+ <servlet-class>com.ogoglio.site.AccountServlet</servlet-class>
+ <load-on-startup>1</load-on-startup>
+ </servlet>
+
+ <servlet>
+ <servlet-name>AuthServlet</servlet-name>
+ <servlet-class>com.ogoglio.site.AuthServlet</servlet-class>
+ <load-on-startup>1</load-on-startup>
+ </servlet>
+
+ <servlet>
+ <servlet-name>SpaceServlet</servlet-name>
+ <servlet-class>com.ogoglio.site.SpaceServlet</servlet-class>
+ <load-on-startup>1</load-on-startup>
+ </servlet>
+
+ <servlet-mapping>
+ <servlet-name>AccountServlet</servlet-name>
+ <url-pattern>/account/*</url-pattern>
+ </servlet-mapping>
+
+ <servlet-mapping>
+ <servlet-name>AuthServlet</servlet-name>
+ <url-pattern>/auth/*</url-pattern>
+ </servlet-mapping>
+
+ <servlet-mapping>
+ <servlet-name>SpaceServlet</servlet-name>
+ <url-pattern>/space/*</url-pattern>
+ </servlet-mapping>
+
+ <error-page>
+ <error-code>404</error-code>
+ <location>/notFound.html</location>
+ </error-page>
+</web-app>
Added: spaces/trunk/war/WEB-INF/web-media.xml
===================================================================
--- spaces/trunk/war/WEB-INF/web-media.xml (rev 0)
+++ spaces/trunk/war/WEB-INF/web-media.xml 2007-06-29 23:54:04 UTC (rev 204)
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<web-app xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd" version="2.4">
+ <servlet>
+ <servlet-name>MediaServlet</servlet-name>
+ <servlet-class>com.ogoglio.media.site.MediaServlet</servlet-class>
+ <load-on-startup>1</load-on-startup>
+ </servlet>
+
+ <servlet-mapping>
+ <servlet-name>MediaServlet</servlet-name>
+ <url-pattern>/media/*</url-pattern>
+ </servlet-mapping>
+
+ <error-page>
+ <error-code>404</error-code>
+ <location>/notFound.html</location>
+ </error-page>
+</web-app>
Added: spaces/trunk/war/WEB-INF/web-sim.xml
===================================================================
--- spaces/trunk/war/WEB-INF/web-sim.xml (rev 0)
+++ spaces/trunk/war/WEB-INF/web-sim.xml 2007-06-29 23:54:04 UTC (rev 204)
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<web-app xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd" version="2.4">
+ <servlet>
+ <servlet-name>SimServlet</servlet-name>
+ <servlet-class>com.ogoglio.sim.site.SimServlet</servlet-class>
+ <load-on-startup>1</load-on-startup>
+ </servlet>
+
+ <servlet-mapping>
+ <servlet-name>SimServlet</servlet-name>
+ <url-pattern>/sim/*</url-pattern>
+ </servlet-mapping>
+
+ <error-page>
+ <error-code>404</error-code>
+ <location>/notFound.html</location>
+ </error-page>
+</web-app>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <tre...@us...> - 2007-06-29 23:23:01
|
Revision: 203
http://ogoglio.svn.sourceforge.net/ogoglio/?rev=203&view=rev
Author: trevorolio
Date: 2007-06-29 16:23:02 -0700 (Fri, 29 Jun 2007)
Log Message:
-----------
Dropped S3 specific code since using S3 directly is a Bad Idea, learned painfully during this morning's outage.
Added WebStore and MediaServlet to replace S3. Together these allow multiple instances to use a single file store fronted by a simple servlet.
Added an ogoglio/mediaDirectory environment parameter to servlet.xml to indicate when the MediaServlet should serve (not a good idea unless firewalled).
Set more threads to daemon and cleaned up more Java3D state on renderer shutdown in hopes of alleviating cross space teleport leaks.
Safari seems happier when shutting down the viewer applet, but it's unclear that this will help in production.
Despite this, the sims still keep Tomcat alive past context cleanup.
Moved test account and template creation into the ClientTests instead of inflicting it on all installations.
Modified Paths:
--------------
spaces/trunk/.classpath
spaces/trunk/build.xml
spaces/trunk/docs/server.xml
spaces/trunk/src/com/ogoglio/client/ClientTests.java
spaces/trunk/src/com/ogoglio/client/SpaceDuplicatorTests.java
spaces/trunk/src/com/ogoglio/client/WebAPIClient.java
spaces/trunk/src/com/ogoglio/media/FileStore.java
spaces/trunk/src/com/ogoglio/media/MediaService.java
spaces/trunk/src/com/ogoglio/media/MediaStore.java
spaces/trunk/src/com/ogoglio/message/NetworkChannelServer.java
spaces/trunk/src/com/ogoglio/message/SenderQueue.java
spaces/trunk/src/com/ogoglio/persist/AccountPersistTasks.java
spaces/trunk/src/com/ogoglio/persist/PersistTests.java
spaces/trunk/src/com/ogoglio/persist/ServiceInitializationPersistTasks.java
spaces/trunk/src/com/ogoglio/sim/Sim.java
spaces/trunk/src/com/ogoglio/sim/SpaceSimulator.java
spaces/trunk/src/com/ogoglio/sim/script/ScriptHTTPRequest.java
spaces/trunk/src/com/ogoglio/sim/site/SimServlet.java
spaces/trunk/src/com/ogoglio/site/AbstractResourceServlet.java
spaces/trunk/src/com/ogoglio/site/AccountServlet.java
spaces/trunk/src/com/ogoglio/site/AuthenticatedSiteResource.java
spaces/trunk/src/com/ogoglio/site/MessageProxy.java
spaces/trunk/src/com/ogoglio/site/SiteInfo.java
spaces/trunk/src/com/ogoglio/site/SiteResource.java
spaces/trunk/src/com/ogoglio/viewer/j3d/J3DRenderer.java
spaces/trunk/src/com/ogoglio/viewer/j3d/PhysicsBehavior.java
spaces/trunk/src/hibernate.cfg.xml
spaces/trunk/war/WEB-INF/web.xml
Added Paths:
-----------
spaces/trunk/src/com/ogoglio/media/WebStore.java
spaces/trunk/src/com/ogoglio/media/site/
spaces/trunk/src/com/ogoglio/media/site/MediaServlet.java
Removed Paths:
-------------
spaces/trunk/src/com/ogoglio/media/MediaTests.java
spaces/trunk/src/com/ogoglio/media/S3Store.java
spaces/trunk/src/com/ogoglio/persist/TestPersistTasks.java
spaces/trunk/src/com/ogoglio/util/S3Utils.java
spaces/trunk/war/WEB-INF/lib/jets3t-0.5.0.jar
Modified: spaces/trunk/.classpath
===================================================================
--- spaces/trunk/.classpath 2007-06-28 23:14:43 UTC (rev 202)
+++ spaces/trunk/.classpath 2007-06-29 23:23:02 UTC (rev 203)
@@ -4,7 +4,7 @@
<classpathentry kind="var" path="TOMCAT_HOME/common/lib/servlet-api.jar"/>
<classpathentry kind="var" path="TOMCAT_HOME/common/lib/jasper-runtime.jar"/>
<classpathentry kind="var" path="TOMCAT_HOME/common/lib/jsp-api.jar"/>
- <classpathentry kind="src" output="work" path="work"/>
+ <classpathentry output="work" kind="src" path="work"/>
<classpathentry kind="src" path="src"/>
<classpathentry kind="lib" path="war/WEB-INF/lib/junit.jar"/>
<classpathentry kind="lib" path="war/WEB-INF/lib/mysql-connector-java-3.1.11-bin.jar"/>
@@ -26,7 +26,6 @@
<classpathentry kind="lib" path="war/WEB-INF/lib/js.jar"/>
<classpathentry kind="lib" path="war/WEB-INF/lib/commons-httpclient-3.0.1.jar"/>
<classpathentry kind="lib" path="war/WEB-INF/lib/commons-codec-1.3.jar"/>
- <classpathentry kind="lib" path="war/WEB-INF/lib/jets3t-0.5.0.jar"/>
<classpathentry kind="var" path="BROWSER_PLUGIN"/>
<classpathentry kind="output" path="war/WEB-INF/classes"/>
</classpath>
Modified: spaces/trunk/build.xml
===================================================================
--- spaces/trunk/build.xml 2007-06-28 23:14:43 UTC (rev 202)
+++ spaces/trunk/build.xml 2007-06-29 23:23:02 UTC (rev 203)
@@ -2,7 +2,7 @@
<project default="war" basedir=".">
<property name="source" value="src" />
<property name="dest" value="war/WEB-INF/classes" />
- <property name="tomcatHome" value="/usr/share/tomcat5/" />
+ <property name="tomcatHome" value="../../tomcat/" />
<property name="webLibDir" value="./war/WEB-INF/lib/" />
<property name="warName" value="ogoglio.war" />
Modified: spaces/trunk/docs/server.xml
===================================================================
--- spaces/trunk/docs/server.xml 2007-06-28 23:14:43 UTC (rev 202)
+++ spaces/trunk/docs/server.xml 2007-06-29 23:23:02 UTC (rev 203)
@@ -16,22 +16,24 @@
<Context path="/og" reloadable="false" docBase="/Users/trevor/Code/EclipseWorkspace/spaces/war" workDir="/Users/trevor/Code/EclipseWorkspace/spaces/work" >
<Logger className="org.apache.catalina.logger.SystemOutLogger" verbosity="4" timestamp="true"/>
- <!-- THIS DEFINES THE DATABASE USED BY THE OGOGLIO SERVLETS -->
+ <!-- THIS DEFINES THE DATABASE USED BY THE OGOGLIO SERVLETS, SET THE HSQL PATH OR ANOTHER JDBC URL (e.g. MySQL) -->
<Resource name="jdbc/space" scope="Shareable" type="javax.sql.DataSource" factory="org.apache.tomcat.dbcp.dbcp.BasicDataSourceFactory" url="jdbc:hsqldb:/Users/trevor/Code/EclipseWorkspace/spaces/db/ogoglio" driverClassName="org.hsqldb.jdbcDriver" username="sa" password="" maxIdle="5" maxActive="50" />
<!-- THE FOLLOWING VARIABLES ARE READ IN com.ogoglio.site.AbstractResourceServet.init -->
- <!-- CHANGE THIS TO POINT TO THE DIRECTORY WHERE YOU WANT THE MODELS, TEXTURES, SCRIPTS, and XML FILES TO BE STORED -->
+ <!-- CHANGE THIS TO POINT TO THE URL OF THE SERVER OR DIRECTORY WHERE YOU WANT THE MODELS, TEXTURES, SCRIPTS, and XML FILES TO BE STORED -->
+ <!-- IF YOU ARE RUNNING EVERYTHING ON ONE MACHINE, USE A FILE URL LIKE file:///home/username/mediaDir -->
+ <!-- IF YOU ARE RUNNING A REMOTE MEDIA SERVICE, USE A URL LIKE http://example.com:8080/og/media/ -->
<Environment name="ogoglio/mediaURL" value="file:///Users/trevor/Code/EclipseWorkspace/spaces/working/media" type="java.lang.String"/>
- <!-- OR, IF YOU HAVE AN AMAZON S3 ACCOUNT, YOU CAN USE THAT _INSTEAD_OF_ THE MEDIA URL ABOVE-->
- <!-- <Environment name="ogoglio/mediaURL" value="s3://YOUR_AWS_ACCESS_KEY:YOUR_AWS_SECRET_KEY@EXISTING_BUCKET_NAME" type="java.lang.String"/> -->
-
<!-- CHANGE THIS TO BE THE PUBLIC URL FOR YOUR SERVICE: http://YOUR_DOMAIN/og/ -->
- <Environment name="ogoglio/baseURL" value="http://127.0.0.1:8080/og/" type="java.lang.String"/>
+ <Environment name="ogoglio/baseURL" value="http://example.com:8080/og/" type="java.lang.String"/>
<!-- CHANGE THIS TO TRUE IF YOUR SIMS RUN ON SEPARATE MACHINES (UNSAFE UNLESS THE SIMS HAVE FIREWALLS WHICH REFUSE CONNECTIONS FROM ALL BUT KNOWN WEB APPS) -->
<Environment name="ogoglio/simsAllowRemoteAccess" value="false" type="java.lang.String" />
+
+ <!-- IF THIS CONFIG IS FOR A MEDIA SERVER, UNCOMMENT THESE, SET THE FULL PATH TO YOUR MEDIA DIR -->
+ <!-- <Environment name="ogoglio/mediaDirectory" value="/Users/trevor/Code/EclipseWorkspace/spaces/working/media" type="java.lang.String"/>
</Context>
</Host>
Modified: spaces/trunk/src/com/ogoglio/client/ClientTests.java
===================================================================
--- spaces/trunk/src/com/ogoglio/client/ClientTests.java 2007-06-28 23:14:43 UTC (rev 202)
+++ spaces/trunk/src/com/ogoglio/client/ClientTests.java 2007-06-29 23:23:02 UTC (rev 203)
@@ -13,6 +13,7 @@
limitations under the License. */
package com.ogoglio.client;
+import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.net.URI;
@@ -34,7 +35,6 @@
import com.ogoglio.client.model.User;
import com.ogoglio.persist.AccountRecord;
import com.ogoglio.persist.ServiceInitializationPersistTasks;
-import com.ogoglio.persist.TestPersistTasks;
import com.ogoglio.util.StreamUtils;
import com.ogoglio.xml.AccountDocument;
import com.ogoglio.xml.AuthDocument;
@@ -51,12 +51,20 @@
public class ClientTests 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;
- private String ownerUsername1;
-
private String spaceName1;
private long spaceID1;
@@ -65,7 +73,6 @@
public void setUp() {
try {
- ownerUsername1 = "susan";
spaceID1 = 1;
spaceName1 = "Angry Young Space";
serviceURI1 = new URI("http://127.0.0.1:8080/og/");
@@ -83,29 +90,36 @@
public void testWebAdmin() {
try {
- String basicAuthCookie = WebAPIClient.authenticate(serviceURI1, TestPersistTasks.USERNAME1, TestPersistTasks.PASSWORD1);
+ String adminAuthCookie = WebAPIClient.authenticate(serviceURI1, ServiceInitializationPersistTasks.LIBRARY_USERNAME, ServiceInitializationPersistTasks.DEFAULT_LIBRARY_PASSWORD);
+ assertNotNull("got null auth cookie", adminAuthCookie);
+
+ try {
+ WebAPIClient.createAccount(serviceURI1, adminAuthCookie, USERNAME1, AccountRecord.ACCOUNT_LEVEL_ADVANCED, "Susan", "Examplar", "http://example.com/susan/", "su...@ex...", PASSWORD1);
+ WebAPIClient.createAccount(serviceURI1, adminAuthCookie, USERNAME2, AccountRecord.ACCOUNT_LEVEL_ADVANCED, "Tina", "Examplar", "http://example.com/tina/", "ti...@ex...", PASSWORD1);
+ } catch (IOException e) {
+ //may already exist
+ }
+
+ String basicAuthCookie = WebAPIClient.authenticate(serviceURI1, USERNAME1, PASSWORD1);
assertNotNull("got null auth cookie", basicAuthCookie);
try {
String failedUsername = "Bogosity" + System.currentTimeMillis();
AccountDocument doc = WebAPIClient.createAccount(serviceURI1, basicAuthCookie, failedUsername, AccountRecord.ACCOUNT_LEVEL_BASIC, "Shouldnt", "Exist", null, failedUsername + "@example.com", "1234");
- if(doc != null) {
+ if (doc != null) {
fail();
}
} catch (Exception e) {
//this should happen, because basic accounts can't create new accounts
}
- String adminAuthCookie = WebAPIClient.authenticate(serviceURI1, ServiceInitializationPersistTasks.LIBRARY_USERNAME, ServiceInitializationPersistTasks.DEFAULT_LIBRARY_PASSWORD);
- assertNotNull("got null auth cookie", adminAuthCookie);
-
String username = "testuser" + Math.abs(new Random().nextLong());
WebAPIClient.createAccount(serviceURI1, adminAuthCookie, username, AccountRecord.ACCOUNT_LEVEL_BASIC, "Test", "Sims", null, username + "@example.com", "1234");
-
+
AccountDocument accountDoc = WebAPIClient.getAccountDocument(serviceURI1, adminAuthCookie, username);
assertNotNull(accountDoc);
assertEquals("Test", accountDoc.getFirstName());
assertEquals("Sims", accountDoc.getLastName());
-
+
Date frozenDate = new Date(System.currentTimeMillis() + 1000000);
accountDoc.setFrozenUntil(frozenDate);
accountDoc.setAccountLevel(AccountRecord.ACCOUNT_LEVEL_ADMIN);
@@ -131,7 +145,7 @@
SpaceClient guestSpaceClient1 = null;
try {
- String authCookie1 = WebAPIClient.authenticate(serviceURI1, TestPersistTasks.USERNAME1, TestPersistTasks.PASSWORD1);
+ String authCookie1 = WebAPIClient.authenticate(serviceURI1, USERNAME1, PASSWORD1);
assertNotNull("got null auth cookie", authCookie1);
SpaceDocument spaceDoc1 = WebAPIClient.createSpace(serviceURI1, authCookie1);
@@ -159,11 +173,11 @@
AuthDocument authDoc = webClient1.getAuthDocument(true);
assertNotNull(authDoc);
- assertEquals(TestPersistTasks.USERNAME1, authDoc.getUsername());
+ assertEquals(USERNAME1, authDoc.getUsername());
AccountDocument ownerDoc = webClient1.getAccountDocument(authDoc.getUsername());
assertNotNull(ownerDoc);
- assertEquals(TestPersistTasks.USERNAME1, ownerDoc.getUsername());
+ assertEquals(USERNAME1, ownerDoc.getUsername());
String key1 = "ogoglio.key.1";
String value1 = "This is a very fine value which is < 1";
@@ -208,14 +222,14 @@
assertNotNull(membershipDocs);
assertEquals(0, membershipDocs.length);
- webClient1.addSpaceMember(TestPersistTasks.USERNAME2, SpaceMemberDocument.MEMBER);
+ webClient1.addSpaceMember(USERNAME2, SpaceMemberDocument.MEMBER);
membershipDocs = webClient1.getSpaceMemberDocuments();
assertNotNull(membershipDocs);
assertEquals(1, membershipDocs.length);
- assertEquals(TestPersistTasks.USERNAME2, membershipDocs[0].getMemberUsername());
+ assertEquals(USERNAME2, membershipDocs[0].getMemberUsername());
assertEquals(SpaceMemberDocument.MEMBER, membershipDocs[0].getRole());
- String authCookie2 = WebAPIClient.authenticate(serviceURI1, TestPersistTasks.USERNAME2, TestPersistTasks.PASSWORD1);
+ String authCookie2 = WebAPIClient.authenticate(serviceURI1, USERNAME2, PASSWORD1);
assertNotNull("got null auth cookie", authCookie1);
WebAPIClient webClient2 = new WebAPIClient(spaceURI1, serviceURI1, authCookie2);
membershipDocs = webClient2.getUsersSpaceMemberships();
@@ -224,9 +238,9 @@
assertEquals(webClient2.getAuthDocument(true).getUsername(), membershipDocs[0].getMemberUsername());
SpaceMemberDocument[] spaceMemberDocs = webClient1.getSpaceMemberDocuments();
assertFalse("member doc length = " + spaceMemberDocs.length, spaceMemberDocs.length == 0);
- assertEquals(spaceMemberDocs[0].getMemberUsername(), TestPersistTasks.USERNAME2);
+ assertEquals(spaceMemberDocs[0].getMemberUsername(), USERNAME2);
- webClient1.removeSpaceMember(TestPersistTasks.USERNAME2);
+ webClient1.removeSpaceMember(USERNAME2);
membershipDocs = webClient2.getUsersSpaceMemberships();
assertEquals(0, membershipDocs.length);
@@ -237,7 +251,7 @@
TemplateDocument newTemplateDoc = webClient1.createTemplate(templateName);
assertEquals(templateName, newTemplateDoc.getDisplayName());
- templateName = "Cold Blue Shirt";
+ templateName = "Test Cube";
newTemplateDoc.setDisplayName(templateName);
newTemplateDoc = webClient1.updateTemplate(newTemplateDoc);
assertEquals(templateName, newTemplateDoc.getDisplayName());
@@ -248,25 +262,24 @@
webClient1.updateTemplateScript(newTemplateDoc.getTemplateID(), null);
assertEquals(null, webClient1.getTemplateScript(newTemplateDoc.getTemplateID()));
- PossessionDocument[] possDocs = webClient1.getPossessionDocuments(TestPersistTasks.USERNAME1);
+ URI templateURI = webClient1.getTemplateURI(newTemplateDoc.getOwnerUsername(), newTemplateDoc.getTemplateID());
+ FileInputStream objData = new FileInputStream("src/com/ogoglio/persist/resources/TestCube.obj");
+ webClient1.putGeometryStream(templateURI, objData, 0);
+ FileInputStream mtlData = new FileInputStream("src/com/ogoglio/persist/resources/TestCube.mtl");
+ webClient1.putGeometryStream(templateURI, mtlData, "TestCube.mtl");
+ FileInputStream textureData = new FileInputStream("src/com/ogoglio/persist/resources/TestCube.gif");
+ webClient1.putGeometryStream(templateURI, textureData, "TestCube.gif");
+ String cubeScript = StreamUtils.readInput(new FileInputStream("src/com/ogoglio/persist/resources/TestCube.js"));
+ webClient1.updateTemplateScript(newTemplateDoc.getTemplateID(), cubeScript);
+
+ PossessionDocument[] possDocs = webClient1.getPossessionDocuments(USERNAME1);
int numPossessions = possDocs.length;
- TemplateDocument[] templateDocs = webClient1.getTemplateDocuments(ServiceInitializationPersistTasks.LIBRARY_USERNAME);
- assertTrue(templateDocs.length > 0);
- assertEquals(templateDocs[0].getOwnerUsername(), ServiceInitializationPersistTasks.LIBRARY_USERNAME);
-
- TemplateDocument templateDoc = webClient1.getTemplateDocument(ServiceInitializationPersistTasks.LIBRARY_USERNAME, templateDocs[0].getTemplateID());
- assertNotNull(templateDoc);
- assertEquals(templateDocs[0].getTemplateID(), templateDoc.getTemplateID());
-
- webClient1.createPossession(templateDocs[0].getTemplateID());
- possDocs = webClient1.getPossessionDocuments(TestPersistTasks.USERNAME1);
+ webClient1.createPossession(newTemplateDoc.getTemplateID());
+ possDocs = webClient1.getPossessionDocuments(USERNAME1);
assertEquals(numPossessions + 1, possDocs.length);
- ThingDocument[] thingDocs = webClient1.getThingDocuments();
- if (thingDocs.length > 0) {
- System.out.println("Already have a " + thingDocs[0].getDisplayName());
- }
+ ThingDocument[] thingDocs = webClient1.getThingDocuments();
assertEquals(0, thingDocs.length);
PossessionDocument possDoc = webClient1.addPossessionToSpace(possDocs[numPossessions].getPossessionID(), spaceDocument.getSpaceID());
assertNotNull(possDoc);
@@ -283,7 +296,7 @@
ShapeDocument[] shapeDocs = thingDocs[0].getShapeDocuments();
assertEquals(1, shapeDocs.length);
- assertEquals("Grid_Grid_Green", shapeDocs[0].getShapeName());
+ assertEquals("Cube", shapeDocs[0].getShapeName());
PageDocument[] pages = webClient1.getPageDocuments(thingDocs[0].getThingID());
assertEquals(0, pages.length);
@@ -314,9 +327,10 @@
pages = webClient1.getPageDocuments(thingDocs[0].getThingID());
assertEquals(0, pages.length);
+ TemplateDocument[] templateDocs = webClient1.getTemplateDocuments(USERNAME1);
DoorDocument[] doorDocs = webClient1.getDoorDocuments();
assertEquals(0, doorDocs.length);
- DoorDocument doorDoc = webClient1.createDoor(spaceDocument.getSpaceID(), 2, ServiceInitializationPersistTasks.LIBRARY_USERNAME, "Test Door", linkURI1, new Transform3D());
+ DoorDocument doorDoc = webClient1.createDoor(spaceDocument.getSpaceID(), templateDocs[templateDocs.length - 1].getTemplateID(), USERNAME1, "Test Door", linkURI1, new Transform3D());
assertNotNull(doorDoc);
assertFalse(doorDoc.getDoorID() == -1);
assertEquals(linkURI1, doorDoc.getLink());
@@ -338,18 +352,18 @@
}
userDocs = webClient1.getUserDocuments();
assertEquals(1, userDocs.length);
- assertEquals(TestPersistTasks.USERNAME1, userDocs[0].getUsername());
+ assertEquals(USERNAME1, userDocs[0].getUsername());
spaceClient1.cleanup();
- InputStream stream = webClient1.getGeometryStream(webClient1.getTemplateURI(ServiceInitializationPersistTasks.LIBRARY_USERNAME, 1), 0);
+ InputStream stream = webClient1.getGeometryStream(webClient1.getTemplateURI(USERNAME1, templateDocs[templateDocs.length - 1].getTemplateID()), 0);
assertNotNull(stream);
consume(stream);
- stream = webClient1.getGeometryStream(webClient1.getTemplateURI(ServiceInitializationPersistTasks.LIBRARY_USERNAME, 1), "defaultLand.mtl");
+ stream = webClient1.getGeometryStream(webClient1.getTemplateURI(USERNAME1, templateDocs[templateDocs.length - 1].getTemplateID()), "TestCube.mtl");
assertNotNull(stream);
consume(stream);
- authCookie1 = WebAPIClient.authenticate(serviceURI1, TestPersistTasks.USERNAME1, TestPersistTasks.PASSWORD1);
+ authCookie1 = WebAPIClient.authenticate(serviceURI1, USERNAME1, PASSWORD1);
assertNotNull("got null auth cookie", authCookie1);
TestSpaceClientListener listener = new TestSpaceClientListener();
@@ -369,7 +383,7 @@
assertEquals(0, thingDocs.length);
webClient1.deletePossession(possDoc.getPossessionID());
- possDocs = webClient1.getPossessionDocuments(TestPersistTasks.USERNAME1);
+ possDocs = webClient1.getPossessionDocuments(USERNAME1);
assertEquals(numPossessions, possDocs.length);
String guestCookie1 = WebAPIClient.requestGuestCookie(serviceURI1);
Modified: spaces/trunk/src/com/ogoglio/client/SpaceDuplicatorTests.java
===================================================================
--- spaces/trunk/src/com/ogoglio/client/SpaceDuplicatorTests.java 2007-06-28 23:14:43 UTC (rev 202)
+++ spaces/trunk/src/com/ogoglio/client/SpaceDuplicatorTests.java 2007-06-29 23:23:02 UTC (rev 203)
@@ -8,7 +8,6 @@
import junit.framework.TestCase;
-import com.ogoglio.persist.TestPersistTasks;
import com.ogoglio.xml.DoorDocument;
import com.ogoglio.xml.PositionedDocument;
import com.ogoglio.xml.SpaceDocument;
@@ -27,18 +26,23 @@
WebAPIClient client2 = null;
String testSettingKey = "test.setting.key";
+
String testSettingValue = "A Value for the Test Setting";
-
+
+ String authCookie = null;
+
public void setUp() {
try {
spaceURI1 = new URI("http://127.0.0.1:8080/og/space/1/");
spaceURI2 = new URI("http://127.0.0.1:8080/og/space/2/");
serviceURI1 = new URI("http://127.0.0.1:8080/og/");
- client1 = new WebAPIClient(spaceURI1, serviceURI1, TestPersistTasks.COOKIE1);
+ authCookie = WebAPIClient.authenticate(serviceURI1, ClientTests.USERNAME1, ClientTests.PASSWORD1);
+ assertNotNull(authCookie);
+ client1 = new WebAPIClient(spaceURI1, serviceURI1, authCookie);
client1.putSetting(testSettingKey, testSettingValue);
-
- client2 = new WebAPIClient(spaceURI2, serviceURI1, TestPersistTasks.COOKIE1);
+
+ client2 = new WebAPIClient(spaceURI2, serviceURI1, authCookie);
} catch (Throwable e) {
e.printStackTrace();
fail(e.getMessage());
@@ -54,12 +58,12 @@
ThingDocument[] originalThingDocs = client1.getThingDocuments();
DoorDocument[] originalDoorDocs = client1.getDoorDocuments();
Map originalSettings = client1.getSettings();
-
+
//TODO settings transfer
-
- SpaceDuplicator duplicator = new SpaceDuplicator(spaceURI1, serviceURI1, TestPersistTasks.USERNAME1, TestPersistTasks.COOKIE1);
+
+ SpaceDuplicator duplicator = new SpaceDuplicator(spaceURI1, serviceURI1, ClientTests.USERNAME1, authCookie);
duplicator.duplicateSpace(spaceURI2, true);
-
+
SpaceDocument newSpaceDoc = client2.getSpaceDocument(false);
assertEquals(originalSpaceDoc.getDisplaySea(), newSpaceDoc.getDisplaySea());
assertEquals(originalSpaceDoc.getSeaLevel(), newSpaceDoc.getSeaLevel(), 0.001);
@@ -67,7 +71,7 @@
assertEquals(originalSpaceDoc.isPublished(), newSpaceDoc.isPublished());
assertEquals(originalSpaceDoc.getMaxGuests(), newSpaceDoc.getMaxGuests());
assertEquals(originalSpaceDoc.getOwnerUsername(), newSpaceDoc.getOwnerUsername());
-
+
ThingDocument[] newThingDocs = client2.getThingDocuments();
Arrays.sort(newThingDocs, new ThingDocComparator());
Arrays.sort(originalThingDocs, new ThingDocComparator());
@@ -83,7 +87,7 @@
assertEquals(originalDoorDocs[i].getLink(), newDoorDocs[i].getLink());
assertEqualPositions(originalDoorDocs[i], newDoorDocs[i]);
}
-
+
Map newSettings = client2.getSettings();
newSettings.equals(originalSettings);
} catch (IOException e) {
@@ -91,19 +95,19 @@
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) {
+ 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);
Modified: spaces/trunk/src/com/ogoglio/client/WebAPIClient.java
===================================================================
--- spaces/trunk/src/com/ogoglio/client/WebAPIClient.java 2007-06-28 23:14:43 UTC (rev 202)
+++ spaces/trunk/src/com/ogoglio/client/WebAPIClient.java 2007-06-29 23:23:02 UTC (rev 203)
@@ -520,13 +520,17 @@
}
public InputStream getGeometryStream(URI renderableRootURI, String name) throws IOException {
- return fetchAuthenticatedStream(appendToURI(renderableRootURI, "geometry/" + (name == null ? "data/" : name)), authCookie);
+ return fetchAuthenticatedStream(appendToURI(renderableRootURI, "geometry/" + name), authCookie);
}
public void putGeometryStream(URI rootURI, InputStream input, String name) throws IOException {
- performPOST(appendToURI(rootURI, "geometry/" + (name == null ? "data/" : name)), StreamUtils.readInput(input), "application/octet-stream", authCookie);
+ performPOST(appendToURI(rootURI, "geometry/" + name), StreamUtils.readInput(input), "application/octet-stream", authCookie);
}
+ public void putGeometryStream(URI rootURI, InputStream input, int lodIndex) throws IOException {
+ performPOST(appendToURI(rootURI, "geometry/data/" + lodIndex), StreamUtils.readInput(input), "application/octet-stream", authCookie);
+ }
+
public InputStream getGeometryStream(URI renderableRootURI, int lodIndex) throws IOException {
return fetchAuthenticatedStream(appendToURI(renderableRootURI, "geometry/data/" + lodIndex), authCookie);
}
@@ -554,6 +558,51 @@
return sendAuthenticatedXML(uri, body, "POST", authCookie);
}
+ public static long requestContentLength(URI uri, String authCookie) {
+ try {
+ HttpURLConnection connection = (HttpURLConnection) uri.toURL().openConnection();
+ connection.setRequestMethod("HEAD");
+ connection.setAllowUserInteraction(false);
+ if (authCookie != null) {
+ connection.setRequestProperty("Cookie", AuthServlet.AUTH_COOKIE + "=" + authCookie);
+ }
+
+ connection.setDoOutput(false);
+ if (connection.getResponseCode() != 200) {
+ return -1;
+ }
+ String lengthHeader = (String)connection.getRequestProperties().get("Content-Length");
+ if(lengthHeader == null) {
+ return -1;
+ }
+ return Integer.parseInt(lengthHeader);
+ } catch (IOException e) {
+ return -1;
+ }
+ }
+
+ public static InputStream performPUT(URI uri, InputStream input, String type, int length, String authCookie) throws IOException {
+ HttpURLConnection connection = (HttpURLConnection) uri.toURL().openConnection();
+ connection.setRequestMethod("PUT");
+ connection.setAllowUserInteraction(false);
+ if (authCookie != null) {
+ connection.setRequestProperty("Cookie", AuthServlet.AUTH_COOKIE + "=" + authCookie);
+ }
+
+ connection.setDoOutput(true);
+ connection.setRequestProperty("Content-type", type);
+ if (length >= 0) {
+ connection.setRequestProperty("Content-length", Integer.toString(length));
+ }
+ StreamUtils.write(input, connection.getOutputStream());
+
+ if (connection.getResponseCode() != 200) {
+ throw new IOException("Get status " + connection.getResponseCode() + " from " + uri);
+ }
+
+ return connection.getInputStream();
+ }
+
public static InputStream performPOST(URI uri, String body, String type, String authCookie) throws IOException {
HttpURLConnection connection = (HttpURLConnection) uri.toURL().openConnection();
connection.setRequestMethod("POST");
@@ -762,4 +811,5 @@
public URI getSettingURI(String key) {
return appendToURI(getSettingsURI(), key + "/");
}
+
}
Modified: spaces/trunk/src/com/ogoglio/media/FileStore.java
===================================================================
--- spaces/trunk/src/com/ogoglio/media/FileStore.java 2007-06-28 23:14:43 UTC (rev 202)
+++ spaces/trunk/src/com/ogoglio/media/FileStore.java 2007-06-29 23:23:02 UTC (rev 203)
@@ -43,6 +43,7 @@
ArgumentUtils.assertNoPaths(name);
File tempFile = new File(mediaDir, System.currentTimeMillis() + "_" + name);
StreamUtils.write(value, new FileOutputStream(tempFile));
+ new File(mediaDir, name).delete();
if (!tempFile.renameTo(new File(mediaDir, name))) {
System.err.println("Unable to rename the file:" + tempFile.getName() + " to: " + name);
tempFile.delete();
@@ -56,14 +57,16 @@
ArgumentUtils.assertNoPaths(name);
File tempFile = new File(mediaDir, System.currentTimeMillis() + "_" + name);
StreamUtils.write(input, new FileOutputStream(tempFile), maxSize);
+ new File(mediaDir, name).delete();
if (!tempFile.renameTo(new File(mediaDir, name))) {
+ System.err.println("Unable to rename the file:" + tempFile.getName() + " to: " + name);
tempFile.delete();
return false;
}
return true;
}
- public InputStream read(String name) {
+ public InputStream getData(String name) {
ArgumentUtils.assertNotEmpty(name);
ArgumentUtils.assertNoPaths(name);
try {
@@ -73,6 +76,11 @@
}
}
+ public boolean exists(String name) {
+ File file = new File(mediaDir, name);
+ return file.exists() && file.isFile();
+ }
+
public long getSize(String name) throws IOException {
ArgumentUtils.assertNotEmpty(name);
ArgumentUtils.assertNoPaths(name);
Modified: spaces/trunk/src/com/ogoglio/media/MediaService.java
===================================================================
--- spaces/trunk/src/com/ogoglio/media/MediaService.java 2007-06-28 23:14:43 UTC (rev 202)
+++ spaces/trunk/src/com/ogoglio/media/MediaService.java 2007-06-29 23:23:02 UTC (rev 203)
@@ -42,8 +42,8 @@
if(mediaURI.getScheme() == null || "file".equals(mediaURI.getScheme())){
store = new FileStore(mediaURI);
- } else if ("s3".equals(mediaURI.getScheme())){
- store = new S3Store(mediaURI);
+ } else if ("http".equals(mediaURI.getScheme())){
+ store = new WebStore(mediaURI);
} else {
throw new IllegalStateException("Could not create a store for " + mediaURI + " with scheme " + mediaURI.getScheme());
}
@@ -85,8 +85,8 @@
return store.write(name, input, maxSize);
}
- public InputStream read(String name) {
- return store.read(name);
+ public InputStream getData(String name) {
+ return store.getData(name);
}
public long getSize(String name) throws IOException {
Modified: spaces/trunk/src/com/ogoglio/media/MediaStore.java
===================================================================
--- spaces/trunk/src/com/ogoglio/media/MediaStore.java 2007-06-28 23:14:43 UTC (rev 202)
+++ spaces/trunk/src/com/ogoglio/media/MediaStore.java 2007-06-29 23:23:02 UTC (rev 203)
@@ -24,7 +24,7 @@
public long getSize(String name) throws IOException;
- public InputStream read(String name);
+ public InputStream getData(String name);
public boolean delete(String name);
Deleted: spaces/trunk/src/com/ogoglio/media/MediaTests.java
===================================================================
--- spaces/trunk/src/com/ogoglio/media/MediaTests.java 2007-06-28 23:14:43 UTC (rev 202)
+++ spaces/trunk/src/com/ogoglio/media/MediaTests.java 2007-06-29 23:23:02 UTC (rev 203)
@@ -1,33 +0,0 @@
-package com.ogoglio.media;
-
-import java.io.IOException;
-import java.net.URI;
-import java.net.URISyntaxException;
-
-import junit.framework.TestCase;
-
-import com.ogoglio.util.StreamUtils;
-
-public class MediaTests extends TestCase {
-
- public void testS3() {
- String awsAccessKey = "Your AWS Access Key";
- String awsSecretKey = "Your AWS Secret Key";
-
- try {
- S3Store store = new S3Store(new URI("s3://" + awsAccessKey +":" + awsSecretKey + "@YOUR.BUCKET.NAME/"));
-
- String testValue = "The North Wind Doth Blow, and We Shall Have Snow, and What Will The Robin Do Then?";
- assertTrue(store.write("Test1", testValue));
- assertEquals(testValue, StreamUtils.readInput(store.read("Test1")));
- assertTrue(store.delete("Test1"));
- } catch (IOException e) {
- e.printStackTrace();
- fail();
- } catch (URISyntaxException e) {
- e.printStackTrace();
- fail();
- }
- }
-
-}
Deleted: spaces/trunk/src/com/ogoglio/media/S3Store.java
===================================================================
--- spaces/trunk/src/com/ogoglio/media/S3Store.java 2007-06-28 23:14:43 UTC (rev 202)
+++ spaces/trunk/src/com/ogoglio/media/S3Store.java 2007-06-29 23:23:02 UTC (rev 203)
@@ -1,134 +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.media;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.net.URI;
-
-import org.jets3t.service.S3ServiceException;
-import org.jets3t.service.impl.rest.httpclient.RestS3Service;
-import org.jets3t.service.model.S3Bucket;
-import org.jets3t.service.model.S3Object;
-import org.jets3t.service.security.AWSCredentials;
-
-import com.ogoglio.util.ArgumentUtils;
-
-/**
- * This utilizes Amazon's Simple Storage Service (S3) to persist and fetch media
- */
-public class S3Store implements MediaStore {
-
- private AWSCredentials awsCredentials = null;
-
- S3Bucket bucket = null;
-
- /**
- * @param mediaURI must be in the form s3://AWS_ACCESS_KEY:AWS_SECRET_KEY@EXISTING_BUCKET_NAME/
- * (as set in mediaURL var in server.xml)
- */
- public S3Store(URI mediaURI) throws IOException {
- ArgumentUtils.assertNotNull(mediaURI);
- String awsAccessKey = mediaURI.getUserInfo().split(":")[0];
- String awsSecretKey = mediaURI.getUserInfo().split(":")[1];;
- ArgumentUtils.assertNotEmpty(awsAccessKey);
- ArgumentUtils.assertNotEmpty(awsSecretKey);
-
- if (!"s3".equals(mediaURI.getScheme())) {
- throw new IllegalArgumentException("Tried to start S3Store with URI " + mediaURI);
- }
-
- try {
- awsCredentials = new AWSCredentials(awsAccessKey, awsSecretKey);
-
- RestS3Service service = new RestS3Service(awsCredentials);
-
- if (!service.isBucketAccessible(mediaURI.getHost())) {
- throw new IOException("Could not access S3 bucket " + mediaURI.getHost());
- }
-
- bucket = new S3Bucket(mediaURI.getHost());
- } catch (S3ServiceException e) {
- throw new IOException ("S3 IO Exception: " + e);
- }
- }
-
- public boolean delete(String name) {
- try {
- RestS3Service service = new RestS3Service(awsCredentials);
- service.deleteObject(bucket, name);
- return true;
- } catch (S3ServiceException e) {
- System.err.println("Error deleting: " + e.getMessage());
- return false;
- }
- }
-
- public long getSize(String name) throws IOException {
- try {
- RestS3Service service = new RestS3Service(awsCredentials);
- S3Object object = service.getObjectDetails(bucket, name);
- if(object == null) {
- return -1;
- }
- return object.getContentLength();
- } catch (S3ServiceException e) {
- return -1;
- }
- }
-
- public InputStream read(String name) {
- try {
- RestS3Service service = new RestS3Service(awsCredentials);
- S3Object object = service.getObject(bucket, name);
- if(object == null) {
- return null;
- }
- if(object.getContentLength() == 0){
- return null;
- }
- return object.getDataInputStream();
- } catch (S3ServiceException e) {
- return null;
- }
- }
-
- public boolean write(String name, String value) throws IOException {
- try {
- RestS3Service service = new RestS3Service(awsCredentials);
- S3Object object = new S3Object(bucket, name, value);
- service.putObject(bucket, object);
- return true;
- } catch (S3ServiceException e) {
- System.err.println("Error putting " + name + ": " + e.getMessage());
- return false;
- }
- }
-
- //TODO respect the maxSize
- public boolean write(String name, InputStream input, long maxSize) throws IOException {
- try {
- RestS3Service service = new RestS3Service(awsCredentials);
- S3Object object = new S3Object(name);
- object.setContentType("application/data");
- object.setDataInputStream(input);
- service.putObject(bucket, object);
- return true;
- } catch (S3ServiceException e) {
- System.err.println("Error putting " + name + ": " + e.getMessage());
- return false;
- }
- }
-
-}
Added: spaces/trunk/src/com/ogoglio/media/WebStore.java
===================================================================
--- spaces/trunk/src/com/ogoglio/media/WebStore.java (rev 0)
+++ spaces/trunk/src/com/ogoglio/media/WebStore.java 2007-06-29 23:23:02 UTC (rev 203)
@@ -0,0 +1,67 @@
+/* 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.media;
+
+import java.io.ByteArrayInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.URI;
+
+import com.ogoglio.client.WebAPIClient;
+import com.ogoglio.util.ArgumentUtils;
+
+public class WebStore implements MediaStore {
+
+ URI mediaURI = null;
+
+ public WebStore(URI mediaURI) throws IOException {
+ ArgumentUtils.assertNotNull(mediaURI);
+ this.mediaURI = mediaURI;
+ }
+
+ public boolean write(String name, String value) throws IOException {
+ return write(name, new ByteArrayInputStream(value.getBytes()), -1);
+ }
+
+ public boolean write(String name, InputStream input, long maxSize) throws IOException {
+ InputStream responseInput = WebAPIClient.performPUT(WebAPIClient.appendToURI(mediaURI, name), input, "application/data", -1, null);
+ if(responseInput == null) {
+ return false;
+ }
+ responseInput.close();
+
+ return true;
+ }
+
+ public InputStream getData(String name) {
+ try {
+ return WebAPIClient.performGET(WebAPIClient.appendToURI(mediaURI, name), null);
+ } catch (IOException e) {
+ return null;
+ }
+ }
+
+ public long getSize(String name) {
+ return WebAPIClient.requestContentLength(WebAPIClient.appendToURI(mediaURI, name), null);
+ }
+
+ public boolean delete(String name) {
+ try {
+ return WebAPIClient.sendDelete(WebAPIClient.appendToURI(mediaURI, name), null);
+ } catch (IOException e) {
+ e.printStackTrace();
+ return false;
+ }
+ }
+}
Added: spaces/trunk/src/com/ogoglio/media/site/MediaServlet.java
===================================================================
--- spaces/trunk/src/com/ogoglio/media/site/MediaServlet.java (rev 0)
+++ spaces/trunk/src/com/ogoglio/media/site/MediaServlet.java 2007-06-29 23:23:02 UTC (rev 203)
@@ -0,0 +1,111 @@
+package com.ogoglio.media.site;
+
+import java.io.File;
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.Date;
+
+import javax.servlet.ServletConfig;
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+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 {
+
+ private FileStore fileStore = null;
+
+ 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());
+ }
+
+ public void destroy() {
+ super.destroy();
+ }
+
+ public SiteResource createBaseResource(ServletConfig servletConfig) {
+ return new MediaResource();
+ }
+
+ private class MediaResource extends SiteResource {
+ public MediaResource() {
+ super("media");
+ if (fileStore != null) {
+ addSubResource(new DataResource());
+ }
+ }
+
+ public void doGet(HttpServletRequest request, HttpServletResponse response, String[] pathElements) throws ServletException, IOException {
+ sendStringResponse("I'm a media servlet (" + (fileStore == null ? "inactive" : "active") + ")", "text/plain", response);
+ }
+ }
+
+ private class DataResource extends SiteResource {
+ public DataResource() {
+ super(SiteResource.WILDCARD_ELEMENT);
+ }
+
+ public void doGet(HttpServletRequest request, HttpServletResponse response, String[] pathElements) throws ServletException, IOException {
+ String name = pathElements[pathElements.length - 1];
+ InputStream input = fileStore.getData(name);
+ if (input == null) {
+ response.setStatus(HttpServletResponse.SC_NOT_FOUND);
+ return;
+ }
+ response.setStatus(HttpServletResponse.SC_OK);
+ response.setContentLength((int) fileStore.getSize(name));
+ StreamUtils.write(input, response.getOutputStream());
+ }
+
+ public void doPut(HttpServletRequest request, HttpServletResponse response, String[] pathElements) throws ServletException, IOException {
+ String name = pathElements[pathElements.length - 1];
+ fileStore.write(name, request.getInputStream(), -1);
+ response.setStatus(HttpServletResponse.SC_OK);
+ response.setContentLength(0);
+ return;
+ }
+
+ public void doDelete(HttpServletRequest request, HttpServletResponse response, String[] pathElements) throws ServletException, IOException {
+ String name = pathElements[pathElements.length - 1];
+
+ if (!fileStore.exists(name)) {
+ response.setStatus(HttpServletResponse.SC_NOT_FOUND);
+ response.setContentLength(0);
+ return;
+ }
+
+ if (!fileStore.delete(name)) {
+ response.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
+ response.setContentLength(0);
+ return;
+ }
+ response.setStatus(HttpServletResponse.SC_OK);
+ response.setContentLength(0);
+ return;
+ }
+
+ public void doHead(HttpServletRequest request, HttpServletResponse response, String[] pathElements) throws ServletException, IOException {
+ String name = pathElements[pathElements.length - 1];
+ if (!fileStore.exists(name)) {
+ response.setStatus(HttpServletResponse.SC_NOT_FOUND);
+ response.setContentLength(0);
+ return;
+ }
+
+ response.setStatus(HttpServletResponse.SC_OK);
+ response.setContentLength((int) fileStore.getSize(name));
+ return;
+ }
+ }
+
+}
Modified: spaces/trunk/src/com/ogoglio/message/NetworkChannelServer.java
===================================================================
--- spaces/trunk/src/com/ogoglio/message/NetworkChannelServer.java 2007-06-28 23:14:43 UTC (rev 202)
+++ spaces/trunk/src/com/ogoglio/message/NetworkChannelServer.java 2007-06-29 23:23:02 UTC (rev 203)
@@ -131,6 +131,12 @@
}
private class ChannelSocketListenerThread extends Thread {
+
+ public ChannelSocketListenerThread() {
+ super("NetworkChannelServer");
+ setDaemon(true);
+ }
+
public void run() {
while (!cleaned) {
try {
Modified: spaces/trunk/src/com/ogoglio/message/SenderQueue.java
===================================================================
--- spaces/trunk/src/com/ogoglio/message/SenderQueue.java 2007-06-28 23:14:43 UTC (rev 202)
+++ spaces/trunk/src/com/ogoglio/message/SenderQueue.java 2007-06-29 23:23:02 UTC (rev 203)
@@ -17,10 +17,8 @@
import java.io.IOException;
import java.io.OutputStream;
import java.net.Socket;
-import java.net.SocketException;
import com.ogoglio.util.BlockingQueue;
-import com.ogoglio.util.BlockingQueue.QueueClosedException;
public class SenderQueue {
private SenderThread senderThread = new SenderThread();
Modified: spaces/trunk/src/com/ogoglio/persist/AccountPersistTasks.java
===================================================================
--- spaces/trunk/src/com/ogoglio/persist/AccountPersistTasks.java 2007-06-28 23:14:43 UTC (rev 202)
+++ spaces/trunk/src/com/ogoglio/persist/AccountPersistTasks.java 2007-06-29 23:23:02 UTC (rev 203)
@@ -112,7 +112,16 @@
public static AccountRecord createAccount(final String username, final String accountlevel, final String email, SessionFactory sessionFactory) throws PersistException {
HibernateTask task = new HibernateTask() {
public Object run(Session hibernateSession) {
- AccountRecord record = new AccountRecord(username, accountlevel, email);
+ final String cleanedUsername = AccountRecord.cleanUsername(username);
+ Query query = hibernateSession.getNamedQuery(ACCOUNT_BY_USERNAME);
+ query.setParameter("username", cleanedUsername);
+
+ AccountRecord record = (AccountRecord)query.uniqueResult();
+ if(record != null) {
+ return null;
+ }
+
+ record = new AccountRecord(username, accountlevel, email);
hibernateSession.save(record);
BodyRecord bodyRec = new BodyRecord("Body", record.getUsername());
hibernateSession.save(bodyRec);
Modified: spaces/trunk/src/com/ogoglio/persist/PersistTests.java
===================================================================
--- spaces/trunk/src/com/ogoglio/persist/PersistTests.java 2007-06-28 23:14:43 UTC (rev 202)
+++ spaces/trunk/src/com/ogoglio/persist/PersistTests.java 2007-06-29 23:23:02 UTC (rev 203)
@@ -176,11 +176,9 @@
}
try {
- AccountRecord accRec3 = AccountPersistTasks.createAccount(username1, level1, email2, sessionFactory);
- fail("Shouldn't allow duplicate username records");
+ assertNull(AccountPersistTasks.createAccount(username1, level1, email2, sessionFactory));
} catch (PersistException e) {
- //this should happen
- System.err.println("Correctly generated PersistException for duplicate username record.");
+ fail("Should have just returned null instead of failed: " + e);
}
}
}
\ No newline at end of file
Modified: spaces/trunk/src/com/ogoglio/persist/ServiceInitializationPersistTasks.java
===================================================================
--- spaces/trunk/src/com/ogoglio/persist/ServiceInitializationPersistTasks.java 2007-06-28 23:14:43 UTC (rev 202)
+++ spaces/trunk/src/com/ogoglio/persist/ServiceInitializationPersistTasks.java 2007-06-29 23:23:02 UTC (rev 203)
@@ -62,6 +62,7 @@
accountRec.setPassword(DEFAULT_LIBRARY_PASSWORD);
AccountPersistTasks.update(accountRec, sessionFactory);
+ /*
TemplateRecord defaultLandTemplate = TemplatePersistTasks.createTemplate(DEFAULT_LAND_DISPLAY_NAME, accountRec.getUsername(), sessionFactory);
mediaService.write("templateGeometry-1-0", getResourceStream("com/ogoglio/persist/resources/defaultLand.obj"), -1);
mediaService.write("templateGeometry-1-defaultLand.mtl", getResourceStream("com/ogoglio/persist/resources/defaultLand.mtl"), -1);
@@ -79,6 +80,7 @@
TemplateRecord testCylinderTemplate = TemplatePersistTasks.createTemplate(TEST_CYLINDER_DISPLAY_NAME, accountRec.getUsername(), sessionFactory);
mediaService.write("templateGeometry-4-0", getResourceStream("com/ogoglio/persist/resources/TestCylinder.obj"), -1);
+ */
}
private static AccountRecord createUser(String username, String accountlevel, String email, String password, String cookie, SessionFactory sessionFactory) throws PersistException {
Deleted: spaces/trunk/src/com/ogoglio/persist/TestPersistTasks.java
===================================================================
--- spaces/trunk/src/com/ogoglio/persist/TestPersistTasks.java 2007-06-28 23:14:43 UTC (rev 202)
+++ spaces/trunk/src/com/ogoglio/persist/TestPersistTasks.java 2007-06-29 23:23:02 UTC (rev 203)
@@ -1,67 +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.SessionFactory;
-import org.hibernate.cfg.Configuration;
-
-public class TestPersistTasks {
-
- public static final String PASSWORD1 = "1234";
-
- public static final String USERNAME1 = "susan";
-
- public static final String USERNAME2 = "tina";
-
- public static final String USERNAME3 = "joe";
-
- public static final String USERNAME4 = "bob";
-
- public static final String COOKIE1 = "tr5w95nxracntj";
-
- public static final String COOKIE2 = "trMoonUnitZappa";
-
- private static AccountRecord createUser(String username, String accountlevel, String email, String password, String cookie, SessionFactory sessionFactory) throws PersistException {
- AccountRecord accountRec = AccountPersistTasks.findAccountByUsername(username, sessionFactory);
- if (accountRec == null) {
- accountRec = AccountPersistTasks.createAccount(username, accountlevel, email, sessionFactory);
- accountRec.setPassword(password);
- accountRec.setCookie(cookie);
- AccountPersistTasks.update(accountRec, sessionFactory);
- }
- return accountRec;
- }
-
- public static void initializeTestAccounts(SessionFactory sessionFactory) throws PersistException {
- createUser(USERNAME1, AccountRecord.ACCOUNT_LEVEL_BASIC, "su...@ex...", PASSWORD1, COOKIE1, sessionFactory);
- createUser(USERNAME2, AccountRecord.ACCOUNT_LEVEL_ADVANCED, "ti...@ex...", PASSWORD1, COOKIE2, sessionFactory);
- createUser(USERNAME3, AccountRecord.ACCOUNT_LEVEL_PRO, "jo...@ex...", PASSWORD1, "trTimequake", sessionFactory);
- createUser(USERNAME4, AccountRecord.ACCOUNT_LEVEL_BASIC, "bo...@ex...", PASSWORD1, "trCookiefoobar", sessionFactory);
-
- SpaceRecord[] spaces = SpacePersistTasks.findSpacesByOwnerUsername(USERNAME1, sessionFactory);
- if (spaces.length == 0) {
- SpacePersistTasks.createSpace("Test Space", USERNAME1, sessionFactory);
- PossessionPersistTasks.createPossession(USERNAME1, 1, sessionFactory);
- PossessionPersistTasks.createPossession(USERNAME1, 3, sessionFactory);
- }
- }
- public static void main(String argv[]) {
- try {
- initializeTestAccounts(new Configuration().configure().buildSessionFactory());
- } catch (PersistException e) {
- System.err.println("wow, we got an exception");
- e.printStackTrace();
- }
- }
-}
Modified: spaces/trunk/src/com/ogoglio/sim/Sim.java
===================================================================
--- spaces/trunk/src/com/ogoglio/sim/Sim.java 2007-06-28 23:14:43 UTC (rev 202)
+++ spaces/trunk/src/com/ogoglio/sim/Sim.java 2007-06-29 23:23:02 UTC (rev 203)
@@ -131,16 +131,16 @@
}
public InputStream getTemplateGeometryStream(long templateID, int lodIndex) {
- return mediaService.read(MediaService.getTemplateGeometryName(templateID, lodIndex));
+ return mediaService.getData(MediaService.getTemplateGeometryName(templateID, lodIndex));
}
public InputStream getTemplateResourceStream(long templateID, String name) {
- return mediaService.read(MediaService.getTemplateResourceName(templateID, name));
+ return mediaService.getData(MediaService.getTemplateResourceName(templateID, name));
}
public String getTemplateScript(long templateID) {
try {
- InputStream stream = mediaService.read(MediaService.getTemplateScriptName(templateID));
+ InputStream stream = mediaService.getData(MediaService.getTemplateScriptName(templateID));
if (stream == null) {
return null;
}
@@ -279,7 +279,7 @@
}
private SpaceDocument getSpaceDocument(long spaceID) throws IOException {
- InputStream stream = mediaService.read(MediaService.getSpaceDocumentName(spaceID));
+ InputStream stream = mediaService.getData(MediaService.getSpaceDocumentName(spaceID));
if (stream == null) {
return null;
}
Modified: spaces/trunk/src/com/ogoglio/sim/SpaceSimulator.java
===================================================================
--- spaces/trunk/src/com/ogoglio/sim/SpaceSimulator.java 2007-06-28 23:14:43 UTC (rev 202)
+++ spaces/trunk/src/com/ogoglio/sim/SpaceSimulator.java 2007-06-29 23:23:02 UTC (rev 203)
@@ -216,6 +216,11 @@
private class SimThread extends Thread {
BlockingQueue queue = new BlockingQueue();
+ public SimThread() {
+ super("SimThread");
+ setDaemon(true);
+ }
+
public void run() {
while (!cleaned) {
try {
Modified: spaces/trunk/src/com/ogoglio/sim/script/ScriptHTTPRequest.java
===================================================================
--- spaces/trunk/src/com/ogoglio/sim/script/ScriptHTTPRequest.java 2007-06-28 23:14:43 UTC (rev 202)
+++ spaces/trunk/src/com/ogoglio/sim/script/ScriptHTTPRequest.java 2007-06-29 23:23:02 UTC (rev 203)
@@ -191,6 +191,9 @@
HttpMethod method = null;
public HttpRequestThread(String methodType, String url, String content) {
+ super("ScriptHTTPRequest");
+ setDaemon(true);
+
this.methodType = methodType;
this.url = url;
this.content = content;
Modified: spaces/trunk/src/com/ogoglio/sim/site/SimServlet.java
===================================================================
--- spaces/trunk/src/com/ogoglio/sim/site/SimServlet.java 2007-06-28 23:14:43 UTC (rev 202)
+++ spaces/trunk/src/com/ogoglio/sim/site/SimServlet.java 2007-06-29 23:23:02 UTC (rev 203)
@@ -390,7 +390,7 @@
return;
}
- InputStream result = getMediaService().read(MediaService.getPageContentName(spaceID, thingID, pageID));
+ InputStream result = getMediaService().getData(MediaService.getPageContentName(spaceID, thingID, pageID));
if (result == null) {
response.setStatus(HttpServletResponse.SC_NOT_FOUND);
return;
Modified: spaces/trunk/src/com/ogoglio/site/AbstractResourceServlet.java
===================================================================
--- spaces/trunk/src/com/ogoglio/site/AbstractResourceServlet.java 2007-06-28 23:14:43 UTC (rev 202)
+++ spaces/trunk/src/com/ogoglio/site/AbstractResourceServlet.java 2007-06-29 23:23:02 UTC (rev 203)
@@ -13,6 +13,7 @@
limitations under the License. */
package com.ogoglio.site;
+import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
@@ -26,9 +27,10 @@
import javax.naming.Context;
import javax.naming.InitialContext;
-import javax.naming.NameNotFoundException;
import javax.naming.NamingException;
import javax.servlet.ServletConfig;
+import javax.servlet.ServletContextEvent;
+import javax.servlet.ServletContextListener;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
@@ -68,15 +70,16 @@
try {
Context initCtx = new InitialContext();
Context envCtx = (Context) initCtx.lookup("java:comp/env");
- siteInfo = new SiteInfo();
- siteInfo.setBaseUrl((String) envCtx.lookup("ogoglio/baseURL"));
- siteInfo.setMed...
[truncated message content] |
|
From: <tre...@us...> - 2007-06-28 23:15:40
|
Revision: 202
http://ogoglio.svn.sourceforge.net/ogoglio/?rev=202&view=rev
Author: trevorolio
Date: 2007-06-28 16:14:43 -0700 (Thu, 28 Jun 2007)
Log Message:
-----------
Significantly improve the example HTML so as not to scare off budding space owners.
Modified Paths:
--------------
spaces/trunk/war/account.html
spaces/trunk/war/body.html
spaces/trunk/war/browserTests.js
spaces/trunk/war/index.html
spaces/trunk/war/licenses.html
spaces/trunk/war/ogoglio.js
spaces/trunk/war/signin.html
spaces/trunk/war/site.js
spaces/trunk/war/space.html
spaces/trunk/war/spaceEditor.html
spaces/trunk/war/spaceEmbed.html
spaces/trunk/war/spacePopulation.html
spaces/trunk/war/spaceui.js
spaces/trunk/war/templateEditor.html
spaces/trunk/war/thingPopup.html
Added Paths:
-----------
spaces/trunk/war/admin.html
spaces/trunk/war/createAccount.html
spaces/trunk/war/inventory.html
spaces/trunk/war/reset.css
spaces/trunk/war/spaceSettings.html
spaces/trunk/war/style.css
Removed Paths:
-------------
spaces/trunk/war/appletTest.html
spaces/trunk/war/feature.jpg
spaces/trunk/war/footerInclude.js
spaces/trunk/war/headerInclude.js
spaces/trunk/war/help.html
spaces/trunk/war/inputTest.html
spaces/trunk/war/liveConnectTest.html
spaces/trunk/war/notFound.html
spaces/trunk/war/renderingTest.html
spaces/trunk/war/site.css
spaces/trunk/war/support.html
Modified: spaces/trunk/war/account.html
===================================================================
--- spaces/trunk/war/account.html 2007-06-28 22:15:07 UTC (rev 201)
+++ spaces/trunk/war/account.html 2007-06-28 23:14:43 UTC (rev 202)
@@ -1,45 +1,59 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
-<title>Account</title>
-<link rel="stylesheet" href="site.css" type="text/css" />
+<link rel="stylesheet" href="style.css" type="text/css" />
+<script type="text/javascript" src="ogoglio.js"></script>
+<script type="text/javascript" src="site.js"></script>
-<style type="text/css">
-h3 {
- margin: 10px 0px 0px 0px;
+<title>Ogoglio Example: account</title>
+<style type="text/css">
+#main {
+ overflow: hidden;
+ width: 750px;
}
-#spaces{
+#content {
+ width: 500px;
+ border-right: 250px solid #FFF;
+ margin-right: -250px;
+ float: left;
}
-#main {
- position: relative;
- top: 0px;
+#rail {
+ background-color: #FFF;
+ width: 250px;
+ float: left;
}
-</style>
-<script type="text/javascript" src="ogoglio.js"></script>
-<script type="text/javascript" src="site.js"></script>
-
-<script type="text/javascript">
+.section {
+ border: solid 1px #CCD;
+ border-top: solid 5px #CCD;
+ margin: 0px 25px 10px 0px;
+ padding: 0px 5px 5px 5px;
+}
+#profileTable th {
+ text-align: right;
+}
+
+.includedFeedItem {
+ margin-top: 10px;
+}
+</style>
+<script type="text/javascript">
var requestedUsername = locationParameters['username'];
+var spaceListXML = null;
-var titleElement = null;
-var profileTable = null;
-var bodyListTable = null;
-var spaceListTable = null;
-var templateListTable = null;
var mainElement = null;
+var titleUserElement = null;
+//var titleAccountElement = null;
+var inventoryLink = null;
+var spaceListTable = null;
+var spaceMembershipTable = null;
+var profileTable = null;
var profileGoButton = null;
-var possListTable = null;
-var possForm = null;
+var bodyLink = null;
-var accountXML = null;
-var bodyListXML = null;
-var spaceListXML = null;
-var possessionListXML = null;
-
function handleAuth(){
if(requestedUsername == null){
mainElement.innerHTML = "<h2>No Account Requested</h2>";
@@ -51,124 +65,44 @@
return;
}
+ inventoryLink.innerHTML = "<a href='inventory.html?username=" + requestedUsername + "'>Check your inventory »</a>"
+
requestAccountDocument(requestedUsername, handleAccount);
- requestBodyList(requestedUsername, handleBodyList);
requestSpaceList(requestedUsername, handleSpaceList);
- requestTemplateList(requestedUsername, handleTemplateList);
- requestPossessionList(requestedUsername, handlePossessionList);
+ requestAccountMembership(requestedUsername, handleMembership);
}
-function changePossessionSpace(possID, select){
- var selectedValue = select[select.selectedIndex].value;
- for(var i=0; i < possessionListXML.childNodes.length; i++){
- var listPossID = possessionListXML.childNodes[i].getAttribute("possessionid");
- var listSpaceID = possessionListXML.childNodes[i].getAttribute("spaceid");
- if(possID == listPossID){
- if(selectedValue == listSpaceID){
- return;
- }
- possessionListXML.childNodes[i].setAttribute("spaceid", selectedValue);
- possessionListXML.childNodes[i].setAttribute("thingid", -1);
- updatePossession(possessionListXML.childNodes[i], handleChangePossession);
- return;
- }
- }
- alert("Error");
-}
+function handleMembership(membershipXML){
+ if(membershipXML == null) return;
-function handleChangePossession(xml){
- requestPossessionList(requestedUsername, handlePossessionList);
-}
-
-function handlePossessionList(xml){
- possessionListXML = xml;
-
- var tableHTML = "<tr><th>id</th><th>template id</th><th>space id</th><th>thing id</th></tr>";
- for(var i=0; i < xml.childNodes.length; i++){
- var id = xml.childNodes[i].getAttribute("possessionid");
- var templateID = xml.childNodes[i].getAttribute("templateid");
- var spaceID = xml.childNodes[i].getAttribute("spaceid");
- var thingID = xml.childNodes[i].getAttribute("thingid");
+ var tableHTML = "";
+ for(var i=0; i < membershipXML.childNodes.length; i++){
+ var spaceID = membershipXML.childNodes[i].getAttribute("spaceid");
+ var banned = membershipXML.childNodes[i].getAttribute("banned");
+ var role = membershipXML.childNodes[i].getAttribute("role");
+ if(i == 0){
+ tableHTML += "<tr><th>role</th><th>space</th></tr>"
+ }
tableHTML += "<tr>";
- tableHTML += "<td>" + id + "</td>";
- tableHTML += "<td>" + templateID + "</td>";
- tableHTML += "<td><select onchange='changePossessionSpace(" + id + ", this);'>";
- if(spaceID == null){
- tableHTML += "<option selected='selected' value='0'></option>";
+ if("true" == banned){
+ tableHTML += "<td>banned</td>";
} else {
- tableHTML += "<option selected='selected' value='0'></option>";
+ tableHTML += "<td>" + escape(role) + "</td>";
}
- for(var j=0; j < spaceListXML.childNodes.length; j++){
- var listSpaceID = spaceListXML.childNodes[j].getAttribute('spaceid');
- var spaceName = spaceListXML.childNodes[j].getAttribute('displayname');
- if(spaceID == listSpaceID){
- tableHTML += "<option selected='selected' value='" + listSpaceID + "'>" + escape(spaceName) + "</option>";
- } else {
- tableHTML += "<option value='" + listSpaceID + "'>" + escape(spaceName) + "</option>";
- }
- }
- tableHTML += "</select></td>";
-
- if(thingID != null){
- tableHTML += "<td><a href='thingPopup.html?spaceID=" + spaceID + "&thingID=" + thingID + "'>" + thingID + "</a></td>";
- tableHTML += "<td><form onsubmit='reloadThing(" + spaceID + ", "+ thingID + "); return false;'><input type='submit' value='reload'/></form></td>";
- } else {
- tableHTML += "<td></td>";
- tableHTML += "<td><form onsubmit='deletePossession(\"" + requestedUsername + "\", "+ id + ", handleChangePossession); return false;'><input type='submit' value='delete'/></form></td>";
- }
+ tableHTML += "<td><a href='space.html?spaceID=" + spaceID + "'>Space " + escape(spaceID) + "</a></td>";
tableHTML += "</tr>";
}
- possListTable.innerHTML = "<table>" + tableHTML + "</table>";
-
- possForm.innerHTML = "<label for='templateIDInput'>template id:</label>";
- possForm.innerHTML += "<input id='templateIDInput' type='text' size='5' /><input type='submit' value='create possession' />";
-
+ spaceMembershipTable.innerHTML = "<table>" + tableHTML + "</table>";
}
-function emptyOrValue(value){
- if(value == null){
- return "";
- } else if (typeof value == "undefined"){
- return "";
- }
- return value;
+function createNewSpace(spaceName){
+ createSpace(requestedUsername, spaceName, handleNewSpace);
}
-function possFormGo(){
- var inputID = possForm.templateIDInput.value;
- if(inputID == null || trim(inputID).length == 0){
- return;
- }
- var templateID = parseInt(inputID);
- createPossession(requestedUsername, templateID, handlePossessionCreate);
+function handleNewSpace(xml){
+ requestSpaceList(requestedUsername, handleSpaceList);
}
-function handlePossessionCreate(xml){
- requestPossessionList(requestedUsername, handlePossessionList);
-}
-
-function handleTemplateList(xml){
- var tableHTML = "<tr><th>id</th><th>name</th><td></td></tr>";
- for(var i=0; i < xml.childNodes.length; i++){
- var id = xml.childNodes[i].getAttribute("templateid");
- var displayName = xml.childNodes[i].getAttribute("displayname");
- tableHTML += "<tr>";
- tableHTML += "<td>" + id + "</td>";
- tableHTML += "<td>" + escape(displayName) + "</td>";
- tableHTML += "<td><input type='submit' onclick='document.location.href=\"templateEditor.html?templateID=" + id +"\"' value='edit' /></td>";
- tableHTML += "</tr>";
- }
- templateListTable.innerHTML = "<table>" + tableHTML + "</table>";
-}
-
-function createNewTemplate(templateName){
- createTemplate(requestedUsername, templateName, handleNewTemplate);
-}
-
-function handleNewTemplate(xml){
- requestTemplateList(requestedUsername, handleTemplateList);
-}
-
function handleSpaceList(xml){
if(xml == null) return;
@@ -185,59 +119,23 @@
var spaceID = spaceListXML.childNodes[i].getAttribute("spaceid");
var displayName = spaceListXML.childNodes[i].getAttribute("displayname");
tableHTML += "<tr>";
- tableHTML += "<td><a href='space.html?spaceID=" + spaceID + "'>" + escape(displayName) + "</a></td>";
+ tableHTML += "<td>" + escape(displayName) + "</td>";
+ tableHTML += "<td><form onsubmit='document.location.href=\"space.html?spaceID=" + spaceID + "\"; return false;'><input type='submit' value='view'/></form></td>";
tableHTML += "<td><form onsubmit='document.location.href=\"spaceEditor.html?spaceID=" + spaceID + "\"; return false;'><input type='submit' value='edit'/></form></td>";
- tableHTML += "<td><a href='space/" + spaceID + "/log'>log</a></td>"
tableHTML += "</tr>";
}
spaceListTable.innerHTML = "<table>" + tableHTML + "</table>";
}
-function createNewSpace(spaceName){
- createSpace(authedUsername, spaceName, handleNewSpace);
-}
-
-function handleNewSpace(xml){
- requestSpaceList(requestedUsername, handleSpaceList);
-}
-
-function createNewBody(bodyName){
- createBody(authedUsername, bodyName, handleBodyList);
-}
-
-function handleBodyList(xml){
- if(xml == null){
- return;
- }
-
- bodyListXML = xml;
- setBodyListFromBodyListXML();
-}
-
-function setBodyListFromBodyListXML() {
- if(bodyListXML == null){
- return;
- }
- var tableHTML = "";
- for(var i=0; i < bodyListXML.childNodes.length; i++){
- tableHTML += "<tr><td>" + bodyListXML.childNodes[i].getAttribute("bodyid") + ": " + escape(bodyListXML.childNodes[i].getAttribute("displayname"));
- var onsubmit = 'document.location.href = "body.html?bodyID=' + bodyListXML.childNodes[i].getAttribute("bodyid") + '"';
- tableHTML += "</td><td><form onsubmit='" + onsubmit + "; return false;'><input type='submit' value='edit'/></form></td></tr>";
- }
- bodyListTable.innerHTML = "<table>" + tableHTML + "</table>";
-}
-
-function handleBodyUpdate(xml){
- alert(serializeXML(xml));
-}
-
function handleAccount(xml){
if(xml == null){
return;
}
accountXML = xml;
- titleElement.innerHTML = "Account: " + accountXML.getAttribute("username");
+ titleUserElement.innerHTML = "User: " + accountXML.getAttribute("username");
+ //titleAccountElement.innerHTML = "Account Type: " + accountXML.getAttribute("accountlevel");
+ bodyLink.innerHTML = "<a href='body.html?bodyID=" + accountXML.getAttribute('defaultbodyid') + "'>Edit your body »</a>"
setProfileFromAccountXML();
}
@@ -251,12 +149,12 @@
function profileGo(){
if(profileGoButton.value == "edit"){
- var tableHTML = "<tr><th>email</th><td>" + accountXML.getAttribute("email") + "</td><td></td></tr>";
+ var tableHTML = "<tr><th>email:</th><td>" + accountXML.getAttribute("email") + "</td><td></td></tr>";
tableHTML += generateProfileInput("first name", "firstname", accountXML.getAttribute("firstname"));
tableHTML += generateProfileInput("last name", "lastname", accountXML.getAttribute("lastname"));
tableHTML += generateProfileInput("homepage", "homepage", accountXML.getAttribute("homepage"));
- tableHTML += generateProfileInput("password", "password", null, "blank means leave as-is");
- tableHTML += generateProfileInput("password again", "password2", null);
+ tableHTML += generateProfileInput("password", "password", null, "blank leaves as-is");
+ tableHTML += generateProfileInput("again", "password2", null);
profileTable.innerHTML = "<table>" + tableHTML + "</table>";
profileGoButton.value = "save";
} else if(profileGoButton.value == "save"){
@@ -295,69 +193,77 @@
}
function init(){
- populateLoginDiv();
+ populateMemberMenuItem();
+
+ titleUserElement = document.getElementById("titleUser");
+ //titleAccountElement = document.getElementById("titleAccount");
mainElement = document.getElementById("main");
- titleElement = document.getElementById("title");
- profileTable = document.getElementById("profileTable");
- bodyListTable = document.getElementById("bodyListTable");
+ inventoryLink = document.getElementById("inventoryLink");
spaceListTable = document.getElementById("spaceListTable");
+ spaceMembershipTable = document.getElementById("spaceMembershipTable");
profileGoButton = document.getElementById("profileGoButton");
- templateListTable = document.getElementById("templateListTable");
- possForm = document.getElementById("possForm");
- possListTable = document.getElementById("possListTable");
+ profileTable = document.getElementById("profileTable");
+ bodyLink = document.getElementById("bodyLink");
+
addAuthListeners(handleAuth, handleAuth);
}
-
</script>
-
-
</head>
<body onload="init();">
-<div id="content">
+<div id="header">
+ <strong><a href="index.html">Ogoglio Example</a></strong>
+ <span id="search">
+ <!-- <form style="margin: 0px;" method="get" action="http://www.google.com/search">
+ <input type="text" size="20" name="q"/>
+ <input type="hidden" name="q" value="site:example.com"/>
+ <input type="submit" value="find"/>
+ </form> -->
+ </span>
+</div> <!-- end header -->
-<script src="headerInclude.js"></script>
+<div id="headerMenu">
+ <a href="index.html">Home</a>
+ <span id="memberMenuItem"> </span>
+</div> <!-- end header menu -->
-<div id="main">
-<h2 id="title">Account: loading...</h2>
+<div id="main">
+ <h2 id="titleUser">User: loading...</h2>
+ <!-- <h3 id="titleAccount">Account Type: loading...</h3> -->
+
+ <div id="content">
+ <div class="section">
+ <h3>Profile: <input id="profileGoButton" onclick="profileGo(); return false;" type="submit" value="edit"/></h3>
+ <form id='profileForm'>
+ <div id="profileTable">
+ loading...
+ </div>
+ </form>
+ </div>
-<h3>Profile: <input id="profileGoButton" onclick="profileGo(); return false;" type="submit" value="edit"/></h3>
-<form id='profileForm'>
-<div id="profileTable">
- loading...
-</div>
-</form>
+ <div class="section">
+ <h3>Your spaces:</h3>
+ <div id="spaceListTable">
+ loading...
+ </div>
+ <form onsubmit="createNewSpace('New Space'); return false;"><input type="submit" value="create a new space"/></form>
+ </div>
-<hr/>
-<h3>Spaces:</h3>
-<div id="spaceListTable">
- loading...
-</div>
-<form onsubmit="createNewSpace('New Space'); return false;"><input type="submit" value="create a new space"/></form>
+ <p class="navLink" id="bodyLink"></p>
+ <p class="navLink" id="inventoryLink"></p>
+ </div><!-- end content -->
-<hr/>
-<h3>Templates:</h3>
-<div id="templateListTable">
- <tr><td>loading...</td></tr>
+ <div id="rail">
+ <div class="section">
+ <h3>Space membership:</h3>
+ <div id="spaceMembershipTable">
+ loading...
+ </div>
+ </div>
+ </div><!-- end rail -->
+</div> <!-- end main -->
+<div id="footer">
+
</div>
-<form onsubmit="createNewTemplate('New Template'); return false;"><input type="submit" value="create a new template"/></form>
-
-<hr/>
-<h3>Possessions:</h3>
-<div id="possListTable">
- <tr><td>loading...</td></tr>
-</div>
-<form onsubmit='possFormGo(); return false;' action='account.html' id="possForm"></form>
-
-<hr/>
-<h3>Bodies:</h3>
-<div id="bodyListTable">
- <tr><td>loading...</td></tr>
-</div>
-<form onsubmit="createNewBody('New Body'); return false;"><input type="submit" value="create a new body"/></form>
-
-</div><!-- end main -->
-</div><!-- end content -->
-<script src="footerInclude.js"></script>
<!-- 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>
+</html>
\ No newline at end of file
Added: spaces/trunk/war/admin.html
===================================================================
--- spaces/trunk/war/admin.html (rev 0)
+++ spaces/trunk/war/admin.html 2007-06-28 23:14:43 UTC (rev 202)
@@ -0,0 +1,264 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html>
+<head>
+<link rel="stylesheet" href="style.css" type="text/css" />
+<script type="text/javascript" src="/og/ogoglio.js"></script>
+<script type="text/javascript" src="site.js"></script>
+
+<title>Ogoglio Example: admin</title>
+
+<style type="text/css">
+#main {
+ overflow: hidden;
+ width: 7680px;
+}
+
+#content {
+ width: 768px;
+ float: left;
+}
+
+#rail {
+ background-color: #FFF;
+ width: 250px;
+ float: left;
+}
+
+.section {
+ border: solid 1px #CCD;
+ border-top: solid 5px #CCD;
+ margin: 0px 25px 10px 0px;
+ padding: 0px 5px 5px 5px;
+}
+
+#profileTable th {
+ text-align: right;
+}
+
+.includedFeedItem {
+ margin-top: 10px;
+}
+</style>
+<script type="text/javascript">
+var requestedUsername = locationParameters['username'];
+
+var mainElement = null;
+var titleUserElement = null;
+var profileTable = null;
+var profileGoButton = null;
+var freezeDiv = null;
+var levelDiv = null;
+
+function handleAuth(){
+ if(requestedUsername == null){
+ mainElement.innerHTML = "<h2>No Account Requested</h2>";
+ return;
+ }
+
+ if(authedUsername == null){
+ mainElement.innerHTML = "<h2>You must log in as an admin.</h2>";
+ return;
+ }
+ requestAccountDocument(authedUsername, handleAdminTest);
+}
+
+function handleAdminTest(xml){
+ if(xml == null){
+ mainElement.innerHTML = "<h2>There was an error checking your account for admin access.</h2>";
+ return;
+ }
+ if("admin" != xml.getAttribute("accountlevel")){
+ mainElement.innerHTML = "<h2>You must be an admin to use this page.</h2>";
+ return;
+ }
+ requestAccountDocument(requestedUsername, handleAccount);
+}
+
+function handleAccount(xml){
+ if(xml == null){
+ mainElement.innerHTML = "<h2>Could not find that user: " + requestedUsername + "</h2>";
+ return;
+ }
+ accountXML = xml;
+
+ titleUserElement.innerHTML = "Administer User: " + accountXML.getAttribute("username");
+ setProfileFromAccountXML();
+}
+
+function setProfileFromAccountXML(){
+ var tableHTML = generateProfileRow("email", "email", accountXML.getAttribute("email"), false);
+ tableHTML += generateProfileRow("first name", "firstname", accountXML.getAttribute("firstname"), false);
+ tableHTML += generateProfileRow("last name", "lastname", accountXML.getAttribute("lastname"), false);
+ tableHTML += generateProfileRow("homepage", "homepage", accountXML.getAttribute("homepage"), true);
+ profileTable.innerHTML = "<table>" + tableHTML + "</table>";
+
+ var freezeHTML = "";
+ if(accountXML.getAttribute("frozenuntil")){
+ var date = new Date();
+ date.setTime(accountXML.getAttribute("frozenuntil"));
+ freezeHTML += "frozen until:<div style='color: #F00; margin: 10px;'>" + date + "</div>";
+ freezeHTML += "<form onsubmit='freezeGo(); return false;'><input type='submit' value='thaw' /></form>";
+ } else {
+ freezeHTML += "not frozen:<br/><br/>";
+ freezeHTML += "<form onsubmit='freezeGo(); return false;'><input type='submit' value='freeze' /></form>";
+ }
+ freezeDiv.innerHTML = freezeHTML;
+
+ //basic, advanced, pro, or admin
+ var levelHTML = "";
+ levelHTML += '<form id="levelForm">';
+ levelHTML += '<select onchange="levelFormGo(); return false;" id="levelSelect" name="level">';
+ levelHTML += '<option value="basic">basic</option>';
+ levelHTML += '<option value="advanced">advanced</option>';
+ levelHTML += '<option value="pro">pro</option>';
+ levelHTML += '<option value="admin">admin</option>';
+ levelHTML += '</select>';
+ levelHTML += '</form>';
+ levelDiv.innerHTML = levelHTML;
+
+ var currentLevel = accountXML.getAttribute("accountlevel");
+ var levelForm = document.getElementById("levelForm");
+ if(currentLevel == 'basic'){
+ levelForm.levelSelect.selectedIndex = 0;
+ } else if (currentLevel == 'advanced'){
+ levelForm.levelSelect.selectedIndex = 1;
+ } else if (currentLevel == 'pro'){
+ levelForm.levelSelect.selectedIndex = 2;
+ } else if (currentLevel == 'admin'){
+ levelForm.levelSelect.selectedIndex = 3;
+ }
+}
+
+function levelFormGo(){
+ var currentLevel = accountXML.getAttribute("accountlevel");
+ var levelForm = document.getElementById("levelForm");
+ var newLevel = levelForm.levelSelect.options[levelForm.levelSelect.selectedIndex].value;
+ if(newLevel == currentLevel){
+ return;
+ }
+ accountXML.setAttribute("accountlevel", newLevel);
+ updateAccountDocument(accountXML, handleAccount);
+}
+
+function freezeGo(){
+ if(accountXML.getAttribute("frozenuntil")){
+ accountXML.setAttribute("frozenuntil", 1000);
+ updateAccountDocument(accountXML, handleAccount);
+ profileTable.innerHTML = "thawing...";
+ } else {
+ accountXML.setAttribute("frozenuntil", new Date().getTime() + 1135296000000);
+ updateAccountDocument(accountXML, handleAccount);
+ profileTable.innerHTML = "freezing...";
+ }
+}
+
+function profileGo(){
+ if(profileGoButton.value == "edit"){
+ var tableHTML = "<tr><th>email:</th><td>" + accountXML.getAttribute("email") + "</td><td></td></tr>";
+ tableHTML += generateProfileInput("first name", "firstname", accountXML.getAttribute("firstname"));
+ tableHTML += generateProfileInput("last name", "lastname", accountXML.getAttribute("lastname"));
+ tableHTML += generateProfileInput("homepage", "homepage", accountXML.getAttribute("homepage"));
+ tableHTML += generateProfileInput("password", "password", null, "blank leaves as-is");
+ tableHTML += generateProfileInput("again", "password2", null);
+
+ profileTable.innerHTML = "<table>" + tableHTML + "</table>";
+ profileGoButton.value = "save";
+ } else if(profileGoButton.value == "save"){
+ if(document.getElementById('password').value != document.getElementById('password2').value){
+ alert("Passwords 1 and 2 don't match.");
+ return;
+ }
+
+ profileGoButton.value = "edit";
+
+ accountXML.setAttribute("firstname", escape(document.getElementById("firstname").value));
+ accountXML.setAttribute("lastname", escape(document.getElementById("lastname").value));
+ accountXML.setAttribute("homepage", escape(document.getElementById("homepage").value));
+ accountXML.setAttribute("password", escape(document.getElementById("password").value));
+ updateAccountDocument(accountXML, handleAccount);
+ profileTable.innerHTML = "saving...";
+ }
+}
+
+function generateProfileRow(heading, field, value, link){
+ if(value == null || value.length === 0){
+ return "";
+ }
+ if(link){
+ return "<tr><th>" + heading + ":</th><td><a rel='nofollow' href='" + escape(value) +"'>" + escape(value) + "</a></td></tr>\n";
+ } else {
+ return "<tr><th>" + heading + ":</th><td>" + escape(value) + "</td></tr>\n";
+ }
+}
+
+function generateProfileInput(heading, field, value, comment) {
+ var nonNullValue = value == null ? "" : value;
+ var nonNullComment = comment == null ? "" : comment;
+ var result = "<tr><th>" + heading + ":</th><td><input id='" + field + "' name='" + field + "' type='text' value='" + escape(nonNullValue) + "' /></td><td>" + escape(nonNullComment) + "</td></tr>\n";
+ return result;
+}
+
+function init(){
+ populateMemberMenuItem();
+
+ titleUserElement = document.getElementById("titleUser");
+ mainElement = document.getElementById("main");
+ profileGoButton = document.getElementById("profileGoButton");
+ profileTable = document.getElementById("profileTable");
+ freezeDiv = document.getElementById("freezeDiv");
+ levelDiv = document.getElementById("levelDiv");
+
+ addAuthListeners(handleAuth, handleAuth);
+}
+</script>
+</head>
+<body onload="init();">
+<div id="header">
+ <strong><a href="index.html">Ogoglio Example</a></strong>
+ <span id="search">
+ <!-- <form style="margin: 0px;" method="get" action="http://www.google.com/search">
+ <input type="text" size="20" name="q"/>
+ <input type="hidden" name="q" value="site:example.com"/>
+ <input type="submit" value="find"/>
+ </form> -->
+ </span>
+</div> <!-- end header -->
+
+<div id="headerMenu">
+ <a href="index.html">Home</a>
+ <span id="memberMenuItem"> </span>
+</div> <!-- end header menu -->
+
+<div id="main">
+ <h2 style="color: #4F4;" id="titleUser">Administer User: loading...</h2>
+
+ <div id="content">
+ <div class="section">
+ <h3>Profile: <input id="profileGoButton" onclick="profileGo(); return false;" type="submit" value="edit"/></h3>
+ <form id='profileForm'>
+ <div id="profileTable">
+ loading...
+ </div>
+ </form>
+ </div>
+ <div class="section">
+ <h3>Account level:</h3>
+ <div id="levelDiv">
+ loading...
+ </div>
+ </div>
+
+ <div class="section">
+ <h3>Account status:</h3>
+ <div id="freezeDiv">
+ loading...
+ </div>
+ </div>
+ </div><!-- end content -->
+</div> <!-- end main -->
+<div id="footer">
+
+</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
Deleted: spaces/trunk/war/appletTest.html
===================================================================
--- spaces/trunk/war/appletTest.html 2007-06-28 22:15:07 UTC (rev 201)
+++ spaces/trunk/war/appletTest.html 2007-06-28 23:14:43 UTC (rev 202)
@@ -1,31 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
-<html>
-<head>
-<title>Rendering test</title>
-<link rel="stylesheet" href="site.css" type="text/css" />
-
-<style type="text/css">
-
-#main {
- position: relative;
- top: 0px;
-}
-
-</style>
-
-</head>
-<body>
-<div id="content">
-
-<div id="main">
-<h2>Applet test:</h2>
-<p>Attempting to load an applet.</p>
-<applet id='viewer' code='com.ogoglio.viewer.applet.TestApplet' archive='/og/testApplet.jar' width='300' height='75' mayscript='true'>
-</applet>
-
-</div><!-- end main -->
-</div><!-- end content -->
-<script src="footerInclude.js"></script>
-<!-- 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>
Modified: spaces/trunk/war/body.html
===================================================================
--- spaces/trunk/war/body.html 2007-06-28 22:15:07 UTC (rev 201)
+++ spaces/trunk/war/body.html 2007-06-28 23:14:43 UTC (rev 202)
@@ -1,32 +1,42 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
-<title>Account</title>
-<link rel="stylesheet" href="site.css" type="text/css" />
+<link rel="stylesheet" href="style.css" type="text/css" />
+<script type="text/javascript" src="/og/ogoglio.js"></script>
+<script type="text/javascript" src="site.js"></script>
-<style type="text/css">
-
+<title>Ogoglio Example: body</title>
+<style type="text/css">
#main {
- position: relative;
- top: 0px;
+ overflow: hidden;
+ width: 750px;
}
-#spaceDiv {
+.section {
+ border: solid 1px #CCD;
+ border-top: solid 5px #CCD;
+ margin: 0px 25px 10px 0px;
+ padding: 0px 5px 5px 5px;
+}
+
+p {
+ margin: 10px 0px 10px 0px;
+}
+
+#appletDiv {
width: 500px;
+ height: 500px;
}
</style>
-<script type="text/javascript" src="ogoglio.js"></script>
-<script type="text/javascript" src="site.js"></script>
-
<script type="text/javascript">
-
var bodyID = locationParameters['bodyID'];
var loginCookie = getCookie('loginCookie');
var titleElement = null;
var mainElement = null;
-var spaceDiv = null;
+var titleElement = null;
+var appletDiv = null;
var bodyXML = null;
@@ -61,7 +71,7 @@
function writeApplet(){
if(loginCookie == null){
- spaceDiv.innerHTML = "No cookie. Please sign in or register as a guest.";
+ appletDiv.innerHTML = "No cookie. Please sign in or register as a guest.";
return;
}
@@ -71,36 +81,47 @@
html += "<param name='image' value='" + appPath + "/icons/32x32/face-monkey.png' />";
html += "</applet>";
- spaceDiv.innerHTML = html;
+ appletDiv.innerHTML = html;
}
+function init(){
+ populateMemberMenuItem();
-function init(){
- populateLoginDiv();
+ titleElement = document.getElementById("title");
mainElement = document.getElementById("main");
- titleElement = document.getElementById("title");
- spaceDiv = document.getElementById("spaceDiv");
-
+ appletDiv = document.getElementById("appletDiv");
+
addAuthListeners(handleAuth, handleAuth);
}
-
</script>
-
-
</head>
<body onload="init();">
-<div id="content">
-<script src="headerInclude.js"></script>
+<div id="header">
+ <strong><a href="index.html">Ogoglio Example</a></strong>
+ <span id="search">
+ <!-- <form style="margin: 0px;" method="get" action="http://www.google.com/search">
+ <input type="text" size="20" name="q"/>
+ <input type="hidden" name="q" value="site:example.com"/>
+ <input type="submit" value="find"/>
+ </form> -->
+ </span>
+</div> <!-- end header -->
-<div id="main">
-<h2 id="title"></h2>
-<div id="spaceDiv"> </div>
+<div id="headerMenu">
+ <a href="index.html">Home</a>
+ <span id="memberMenuItem"> </span>
+</div> <!-- end header menu -->
+<div id="main">
+ <h2 id="title">Loading...</h2>
+ <div id="appletDiv"> </div>
-</div><!-- end main -->
-</div><!-- end content -->
-<script src="footerInclude.js"></script>
+</div> <!-- end main -->
+
+<div id="footer">
+
+</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>
+</html>
\ No newline at end of file
Modified: spaces/trunk/war/browserTests.js
===================================================================
--- spaces/trunk/war/browserTests.js 2007-06-28 22:15:07 UTC (rev 201)
+++ spaces/trunk/war/browserTests.js 2007-06-28 23:14:43 UTC (rev 202)
@@ -156,3 +156,5 @@
html += "</ol>";
targetElement.innerHTML = html;
}
+
+// 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.
Added: spaces/trunk/war/createAccount.html
===================================================================
--- spaces/trunk/war/createAccount.html (rev 0)
+++ spaces/trunk/war/createAccount.html 2007-06-28 23:14:43 UTC (rev 202)
@@ -0,0 +1,138 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html>
+<head>
+<link rel="stylesheet" href="style.css" type="text/css" />
+<script type="text/javascript" src="/og/ogoglio.js"></script>
+<script type="text/javascript" src="site.js"></script>
+
+<title>Ogoglio Example: create account</title>
+
+<style type="text/css">
+#main {
+ overflow: hidden;
+ width: 750px;
+}
+
+#content {
+ width: 750px;
+ border-right: 1px solid #FFF;
+ margin-right: 1px;
+ float: left;
+}
+
+.section form {
+ margin-top: 10px;
+}
+
+.section {
+ border: solid 1px #CCD;
+ border-top: solid 5px #CCD;
+ margin: 0px 25px 10px 0px;
+ padding: 0px 5px 5px 5px;
+}
+
+#profileTable th {
+ text-align: right;
+}
+
+.includedFeedItem {
+ margin-top: 10px;
+}
+</style>
+<script type="text/javascript">
+
+var mainElement = null;
+var newUserDiv = null;
+
+function handleAuth(){
+ if(authedUsername == null){
+ mainElement.innerHTML = "<h2>You must log in as an admin.</h2>";
+ return;
+ }
+ requestAccountDocument(authedUsername, handleAdminTest);
+}
+
+function handleAdminTest(xml){
+ if(xml == null){
+ mainElement.innerHTML = "<h2>There was an error checking your account for admin access.</h2>";
+ return;
+ }
+ if("admin" != xml.getAttribute("accountlevel")){
+ mainElement.innerHTML = "<h2>You must be an admin to use this page.</h2>";
+ return;
+ }
+
+ writeNewUserForm();
+}
+
+function writeNewUserForm(){
+ var html = "<form id='newUserForm' onsubmit='newUserGo(); return false;'>";
+ html += "<table>"
+ html += "<tr><th>username:</th><td><input type='text' name='username' /></td><td> all lower case, number and letters</td></tr>"
+ html += "<tr><th>email:</th><td><input type='text' name='email' /></td><td></td></tr>"
+ html += "<tr><td></td><td><input type='submit' value='create account' /></td></tr>";
+ html += "</form>";
+ newUserDiv.innerHTML = html;
+}
+
+function newUserGo(){
+ var form = document.getElementById("newUserForm");
+ if(form == null){
+ return;
+ }
+ var username = form.username.value;
+ var email = form.email.value;
+ createAccount(username, email, handleNewAccount);
+}
+
+function handleNewAccount(xml){
+ if(xml == null){
+ alert("Could not create that account.");
+ } else {
+ document.location.href = "admin.html?username=" + xml.getAttribute('username');
+ }
+}
+
+function init(){
+ populateMemberMenuItem();
+
+ mainElement = document.getElementById("main");
+ newUserDiv = document.getElementById("newUserDiv");
+
+ addAuthListeners(handleAuth, handleAuth);
+}
+</script>
+</head>
+<body onload="init();">
+<div id="header">
+ <strong><a href="index.html">Ogoglio Example</a></strong>
+ <span id="search">
+ <!-- <form style="margin: 0px;" method="get" action="http://www.google.com/search">
+ <input type="text" size="20" name="q"/>
+ <input type="hidden" name="q" value="site:example.com"/>
+ <input type="submit" value="find"/>
+ </form> -->
+ </span>
+</div> <!-- end header -->
+
+<div id="headerMenu">
+ <a href="index.html">Home</a>
+ <span id="memberMenuItem"> </span>
+</div> <!-- end header menu -->
+
+<div id="main">
+ <h2 style="color: #4F4;">Create User:</h2>
+
+ <div id="content">
+ <div class="section">
+ <div id="newUserDiv">
+ </div>
+ </div>
+ </div><!-- end content -->
+</div> <!-- end main -->
+<div id="footer">
+
+</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
Deleted: spaces/trunk/war/feature.jpg
===================================================================
(Binary files differ)
Deleted: spaces/trunk/war/footerInclude.js
===================================================================
--- spaces/trunk/war/footerInclude.js 2007-06-28 22:15:07 UTC (rev 201)
+++ spaces/trunk/war/footerInclude.js 2007-06-28 23:14:43 UTC (rev 202)
@@ -1,4 +0,0 @@
-
-var content = '<br clear="all" /><!-- <div id="final">This is where copyright would go.</div> -->';
-
-document.write(content);
\ No newline at end of file
Deleted: spaces/trunk/war/headerInclude.js
===================================================================
--- spaces/trunk/war/headerInclude.js 2007-06-28 22:15:07 UTC (rev 201)
+++ spaces/trunk/war/headerInclude.js 2007-06-28 23:14:43 UTC (rev 202)
@@ -1,8 +0,0 @@
-var content = '<div id="loginDiv">\
- <a href="signin.html">sign in</a> | <a href="support.html">support</a>\
-</div>';
-
-content += '<h2><a href="index.html">ogoglio</a></h2><hr style="margin-top: 0px;" />';
-
-document.write(content);
-
Deleted: spaces/trunk/war/help.html
===================================================================
--- spaces/trunk/war/help.html 2007-06-28 22:15:07 UTC (rev 201)
+++ spaces/trunk/war/help.html 2007-06-28 23:14:43 UTC (rev 202)
@@ -1,50 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
-<html>
-<head>
-<title>Space Editor</title>
-
-<link rel="stylesheet" href="site.css" type="text/css" />
-
-<style type="text/css">
-th {
- background-color: #CCC;
- padding: 0px 10px 0px 10px;
-}
-</style>
-
-<script type="text/javascript" src="ogoglio.js"></script>
-<script type="text/javascript" src="site.js"></script>
-
-<script type="text/javascript">
-function init(){
- populateLoginDiv();
-}
-</script>
-
-
-</head>
-<body onload="init();">
-<div id="content">
-
-<script src="headerInclude.js"></script>
-
-<h2>Help:</h2>
-<h3 id="publicity">Public/Private:</h3>
-<p>Some helpful text.</p>
-
-<h3 id="membership">Membership:</h3>
-<p>Some helpful text.</p>
-
-<h3 id="guests">Guests:</h3>
-<p>Some helpful text.</p>
-
-<h3 id="banning">Banning:</h3>
-<p>Some helpful text.</p>
-
-<h3 id="java">Java:</h3>
-<p>Some helpful text, including a note about not using Rosetta'ed browsers on Intel macs (e.g. you copied PPC Mozilla from your old Mac to your new MacBookPro)</p>
-</div><!-- end content -->
-<script src="footerInclude.js"></script>
-</body>
-<!-- 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.-->
-</html>
Modified: spaces/trunk/war/index.html
===================================================================
--- spaces/trunk/war/index.html 2007-06-28 22:15:07 UTC (rev 201)
+++ spaces/trunk/war/index.html 2007-06-28 23:14:43 UTC (rev 202)
@@ -1,42 +1,52 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
-<title></title>
+<link rel="stylesheet" href="style.css" type="text/css" />
+<script type="text/javascript" src="/og/ogoglio.js"></script>
+<script type="text/javascript" src="site.js"></script>
-<link rel="stylesheet" href="site.css" type="text/css" />
-
-<style type="text/css">
-
-h4 {
- font-size: 1em;
- line-height: 1em;
- margin: 0px;
+<title>Ogoglio Example</title>
+<style type="text/css">
+#main {
+ overflow: hidden;
+ width: 761px;
+ margin: 10px 0px 0px 0px;
padding: 0px;
+ text-align: center;
}
-</style>
-
-<script type="text/javascript" src="ogoglio.js"></script>
-<script type="text/javascript" src="site.js"></script>
-
-<script type="text/javascript">
-function init(){
- populateLoginDiv();
+#content {
+ width: 768px;
}
-</script>
-
+</style>
</head>
-<body onload="init();">
-<div id="content">
+<body onload="populateMemberMenuItem();">
- <script src="headerInclude.js"></script>
+<div id="header">
+ <strong><a href="index.html">Ogoglio Example</a></strong>
+ <span id="search">
+ <!-- <form style="margin: 0px;" method="get" action="http://www.google.com/search">
+ <input type="text" size="20" name="q"/>
+ <input type="hidden" name="q" value="site:example.com"/>
+ <input type="submit" value="find"/>
+ </form> -->
+ </span>
+</div> <!-- end header -->
-<div id="main" style="width: 100%; height: 300px; text-align: center; padding-top: 100px;">
- <h1>ogoglio is changing</h1>
- (don't be alarmed)
+<div id="headerMenu">
+ <a href="index.html">Home</a>
+ <span id="memberMenuItem"> </span>
+</div> <!-- end header menu -->
+
+<div id="main">
+ <div id="content">
+ <span style="font-size: 110px; line-height: 140px">Coming Soon</span>
+ </div><!-- end rail -->
</div>
-</div><!-- end content -->
+<div id="footer">
+
+</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>
-<!-- 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.-->
-</html>
+</html>
\ No newline at end of file
Deleted: spaces/trunk/war/inputTest.html
===================================================================
--- spaces/trunk/war/inputTest.html 2007-06-28 22:15:07 UTC (rev 201)
+++ spaces/trunk/war/inputTest.html 2007-06-28 23:14:43 UTC (rev 202)
@@ -1,31 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
-<html>
-<head>
-<title>Rendering test</title>
-<link rel="stylesheet" href="site.css" type="text/css" />
-
-<style type="text/css">
-
-#main {
- position: relative;
- top: 0px;
-}
-
-</style>
-
-</head>
-<body>
-<div id="content">
-
-<div id="main">
-<h2>Input test:</h2>
-<p>Attempting to respond to button presses.</p>
-<applet id='viewer' code='com.ogoglio.viewer.applet.InputTest' archive='/og/testApplet.jar' width='220' height='75' mayscript='true'>
-</applet>
-
-</div><!-- end main -->
-</div><!-- end content -->
-<script src="footerInclude.js"></script>
-<!-- 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>
Added: spaces/trunk/war/inventory.html
===================================================================
--- spaces/trunk/war/inventory.html (rev 0)
+++ spaces/trunk/war/inventory.html 2007-06-28 23:14:43 UTC (rev 202)
@@ -0,0 +1,313 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html>
+<head>
+<link rel="stylesheet" href="style.css" type="text/css" />
+<script type="text/javascript" src="/og/ogoglio.js"></script>
+<script type="text/javascript" src="site.js"></script>
+
+<title>Ogoglio Example: inventory</title>
+
+<style type="text/css">
+#main {
+ overflow: hidden;
+ width: 750px;
+}
+
+#content {
+ width: 370px;
+ border-right: 360px solid #FFF;
+ margin-right: -350px;
+ float: left;
+}
+
+#rail {
+ background-color: #FFF;
+ width: 370px;
+ float: left;
+}
+
+#popOver {
+ position: absolute;
+ top: 0px;
+ left: 0px;
+ width: 0px;
+ background-color: #FFF;
+ border: solid 2px #000;
+ visibility: hidden;
+ padding: 0px;
+ margin: 0px;
+}
+
+.section {
+ border: solid 1px #CCD;
+ border-top: solid 5px #CCD;
+ margin: 0px 0px 10px 0px;
+ padding: 0px 5px 5px 5px;
+}
+
+</style>
+
+<script type="text/javascript">
+
+var requestedUsername = locationParameters['username'];
+var mainElement = null;
+var titleElement = null;
+var possListTable = null;
+var templateListTable = null;
+var popOver = null;
+
+var spaceListXML = null;
+var templateListXML = null;
+var possessionListXML = null;
+
+function handleAuth(){
+ if(authedUsername == null || (authedUsername != requestedUsername)){
+ mainElement.innerHTML = "<h2>You must log in to see your inventory.</h2>";
+ return;
+ }
+ requestSpaceList(requestedUsername, handleSpaceList);
+ requestTemplateList(requestedUsername, handleTemplateList);
+}
+
+function handleSpaceList(xml){
+ if(xml == null){
+ main.innerHTML = "<h2>There is an error.</h2> Could not list your inventory. Sorry.";
+ return;
+ }
+ spaceListXML = xml;
+ requestPossessionList(requestedUsername, handlePossessionList);
+}
+
+function handlePossessionList(xml){
+ possessionListXML = xml;
+
+ var templateIDMap = new Array();
+ for(var i=0; i < possessionListXML.childNodes.length; i++){
+ var templateID = possessionListXML.childNodes[i].getAttribute("templateid");
+ templateIDMap[i] = parseInt(templateID);
+ }
+
+ if(templateIDMap.length == 0){
+ possListTable.innerHTML = "You have nothing at the moment.";
+ }
+
+ var idArray = new Array();
+ for(var i = 0; i < templateIDMap.length; i++){
+ idArray[idArray.length] = templateIDMap[i];
+ }
+ requestTemplates(idArray, handleTemplates);
+}
+
+function handleTemplates(xml){
+ if(xml == null){
+ alert("Could not fetch templates");
+ return;
+ }
+ templateListXML = xml;
+ updatePossListTable();
+}
+
+function updatePossListTable(){
+
+ var templateArray = new Array();
+ for(var i =0 ; i < templateListXML.childNodes.length; i++){
+ var templateID = templateListXML.childNodes[i].getAttribute("templateid");
+ templateArray[templateID] = new Array();
+ templateArray[templateID][0] = templateListXML.childNodes[i];
+ }
+
+ for(var i=0; i < possessionListXML.childNodes.length; i++){
+ if(possessionListXML.childNodes[i].getAttribute("spaceid") != null){
+ continue;
+ }
+ var templateID = possessionListXML.childNodes[i].getAttribute("templateid");
+ templateArray[templateID][templateArray[templateID].length] = possessionListXML.childNodes[i];
+ }
+
+ var tableHTML = "<tr><th>template name</th><th>count</th><th></th><th></th></tr>";
+ for(var i =0 ; i < templateListXML.childNodes.length; i++){
+ var templateID = templateListXML.childNodes[i].getAttribute("templateid");
+ if(templateArray[templateID].length == 1){
+ continue;
+ }
+ tableHTML += "<tr>";
+ tableHTML += "<td>" + escape(templateListXML.childNodes[i].getAttribute('displayname')) + "</td>";
+ tableHTML += "<td>" + (templateArray[templateID].length - 1) + "</td>";
+ tableHTML += "<td><form onsubmit='addToGo(" + templateID + "); return false;'><input type='submit' value='add to...'/></form></td>";
+ var possID = templateArray[templateID][1].getAttribute("possessionid");
+ tableHTML += "<td><form onsubmit='deletePossession(\"" + escape(requestedUsername) + "\", " + possID + ", handleChangePossession); return false;'><input type='submit' value='delete'/></form></td>";
+ tableHTML += "</tr>";
+ }
+
+ possListTable.innerHTML = "<table>" + tableHTML + "</table>";
+}
+
+function addToGo(templateID){
+ for(var i=0; i < possessionListXML.childNodes.length; i++){
+ var possTemplateID = possessionListXML.childNodes[i].getAttribute("templateid");
+ var spaceID = possessionListXML.childNodes[i].getAttribute("spaceid");
+ if(spaceID == null && templateID == possTemplateID){
+ var possID = possessionListXML.childNodes[i].getAttribute("possessionid");
+ var html = "<form>Add to: <select onchange='spaceSelectGo(" + possID + ", this); hidePopOver();'>";
+ html += "<option selected='selected' value='0'></option>";
+
+ for(var j=0; j < spaceListXML.childNodes.length; j++){
+ var listSpaceID = spaceListXML.childNodes[j].getAttribute('spaceid');
+ var spaceName = spaceListXML.childNodes[j].getAttribute('displayname');
+ html += "<option value='" + listSpaceID + "'>" + escape(spaceName) + "</option>";
+ }
+ html += "</select></form>";
+
+ html += "<div style='text-align: right; width: 100%'><form onsubmit='hidePopOver(); return false;'><input type='submit' value='cancel'/></form></div>"
+ showPopOver(html);
+ break;
+ }
+ }
+}
+
+function showPopOver(html){
+ popOver.innerHTML = html;
+ popOver.style.width = "300px";
+ popOver.style.top = "100px";
+ popOver.style.left = "100px";
+ popOver.style.visibility = "visible";
+ popOver.style.padding = "10px";
+}
+
+function hidePopOver(){
+ popOver.visibility = "hidden";
+ popOver.innerHTML = "";
+ popOver.style.width = "0px";
+ popOver.style.top = "0px";
+ popOver.style.left = "0px";
+ popOver.style.padding = "0px";
+ popOver.style.margin = "0px";
+}
+
+function spaceSelectGo(possID, select){
+ var selectedValue = select[select.selectedIndex].value;
+ for(var i=0; i < possessionListXML.childNodes.length; i++){
+ var listPossID = possessionListXML.childNodes[i].getAttribute("possessionid");
+ var listSpaceID = possessionListXML.childNodes[i].getAttribute("spaceid");
+ if(possID == listPossID){
+ if(selectedValue == listSpaceID){
+ return;
+ }
+ changePossessionSpace(possessionListXML.childNodes[i], selectedValue)
+ return;
+ }
+ }
+ alert("Error");
+}
+
+function changePossessionSpace(possessionXML, newSpaceID){
+ possessionXML.setAttribute("spaceid", newSpaceID);
+ possessionXML.setAttribute("thingid", -1);
+ updatePossession(possessionXML, handleChangePossession);
+}
+
+function handleChangePossession(xml){
+ requestPossessionList(requestedUsername, handlePossessionList);
+}
+
+function handleTemplateList(xml){
+ if(xml.childNodes.length == 0){
+ templateListTable.innerHTML = "You have no templates.";
+ return;
+ }
+ var tableHTML = "<tr><th>template name</th><th></th><th></th></tr>";
+ for(var i=0; i < xml.childNodes.length; i++){
+ var id = xml.childNodes[i].getAttribute("templateid");
+ var displayName = xml.childNodes[i].getAttribute("displayname");
+ tableHTML += "<tr>";
+ tableHTML += "<td>" + escape(displayName) + "</td>";
+ tableHTML += "<td><input type='submit' onclick='document.location.href=\"templateEditor.html?templateID=" + id +"\"' value='edit' /></td>";
+ tableHTML += "<td><input type='submit' onclick='addMyTemplateToInventoryGo(" + id + "); return false;' value='add to inventory' /></td>";
+ tableHTML += "</tr>";
+ }
+ templateListTable.innerHTML = "<table>" + tableHTML + "</table>";
+}
+
+function createNewTemplate(templateName){
+ createTemplate(requestedUsername, templateName, handleNewTemplate);
+}
+
+function handleNewTemplate(xml){
+ requestTemplateList(requestedUsername, handleTemplateList);
+}
+
+function addMyTemplateToInventoryGo(templateID){
+ createPossession(authedUsername, templateID, handleCreatePossession);
+}
+
+function handleCreatePossession(xml){
+ if(xml == null){
+ alert("Could not add. Sorry.");
+ return;
+ }
+ requestPossessionList(requestedUsername, handlePossessionList);
+}
+
+function init(){
+ populateMemberMenuItem();
+ titleElement = document.getElementById("title");
+ mainElement = document.getElementById("main");
+ possListTable = document.getElementById("possListTable");
+ templateListTable = document.getElementById("templateListTable");
+ popOver = document.getElementById("popOver");
+
+ if(requestedUsername == null){
+ mainElement.innerHTML = "<h2>There is an error.</h2> There is no username parameter. Sorry."
+ return;
+ }
+
+ addAuthListeners(handleAuth, handleAuth);
+}
+</script>
+</head>
+<body onload="init();">
+<div id="header">
+ <strong><a href="index.html">Ogoglio Example</a></strong>
+ <span id="search">
+ <!-- <form style="margin: 0px;" method="get" action="http://www.google.com/search">
+ <input type="text" size="20" name="q"/>
+ <input type="hidden" name="q" value="site:example.com"/>
+ <input type="submit" value="find"/>
+ </form> -->
+ </span>
+</div> <!-- end header -->
+
+<div id="headerMenu">
+ <a href="index.html">Home</a>
+ <span id="memberMenuItem"> </span>
+</div> <!-- end header menu -->
+
+<div id="main">
+ <h2 id="title">Inventory:</h2>
+ <div id="content">
+
+ <div class="section">
+ <h3>Your Things:</h3>
+ <div id="possListTable">loading...</div>
+ </div>
+ </div><!-- end content -->
+
+ <div id="rail">
+ <div class="section">
+ <h3>Your Templates:</h3>
+ <div id="templateListTable">
+ <tr><td>loading...</td></tr>
+ </div>
+ <form style="margin-top: 10px;" onsubmit="createNewTemplate('New Template'); return false;"><input type="submit" value="create a new template"/></form>
+ </div>
+
+ </div><!-- end rail -->
+</div> <!-- end main -->
+<div id="popOver"> </div>
+
+<div id="footer">
+
+</div>
+</body>
+<!-- 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.-->
+</html>
\ No newline at end of file
Modified: spaces/trunk/war/licenses.html
===================================================================
--- spaces/trunk/war/licenses.html 2007-06-28 22:15:07 UTC (rev 201)
+++ spaces/trunk/war/licenses.html 2007-06-28 23:14:43 UTC (rev 202)
@@ -59,5 +59,6 @@
</div>
</div><!-- end content -->
+<!-- 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>
Deleted: spaces/trunk/war/liveConnectTest.html
===================================================================
--- spaces/trunk/war/liveConnectTest.html 2007-06-28 22:15:07 UTC (rev 201)
+++ spaces/trunk/war/liveConnectTest.html 2007-06-28 23:14:43 UTC (rev 202)
@@ -1,53 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
-<html>
-<head>
-<title>Rendering test</title>
-<link rel="stylesheet" href="site.css" type="text/css" />
-
-<style type="text/css">
-
-#main {
- position: relative;
- top: 0px;
-}
-
-</style>
-<script type="text/javascript">
-function testLiveConnect(){
- var results = document.getElementById("results");
-
- if(typeof document.viewer == "undefined" || document.viewer == null){
- results.innerHTML = "Dang. I could not communicate with the applet.";
- return;
- }
- try {
- if(document.viewer.doesExist()){
- results.innerHTML = "Great! Live connect works."
- return;
- } else {
- results.innerHTML = "Dang. Could not use live connect."
- }
- } catch (error){
- results.innerHTML = "Dang. There was an error: " + error;
- return;
- }
-}
-</script>
-</head>
-<body>
-<div id="content">
-
-<div id="main">
-<h2>Applet test:</h2>
-<p>Attempting to load an applet and respond via button press.</p>
-<applet id='viewer' code='com.ogoglio.viewer.applet.TestApplet' archive='/og/testApplet.jar' width='300' height='50' mayscript='true'>
-</applet>
-
-<form onsubmit="testLiveConnect(); return false;"><input type="submit" value="Press Me" /></form>
-<div id="results"></div>
-</div><!-- end main -->
-</div><!-- end content -->
-<script src="footerInclude.js"></script>
-<!-- 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>
Deleted: spaces/trunk/war/notFound.html
===================================================================
--- spaces/trunk/war/notFound.html 2007-06-28 22:15:07 UTC (rev 201)
+++ spaces/trunk/war/notFound.html 2007-06-28 23:14:43 UTC (rev 202)
@@ -1,33 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
-<html>
-<head>
-<title>Not Found: 404</title>
-
-<link rel="stylesheet" href="/site.css" type="text/css" />
-
-<style type="text/css">
-</style>
-
-<script type="text/javascript" src="ogoglio.js"></script>
-<script type="text/javascript" src="site.js"></script>
-
-<script type="text/javascript">
-function init(){
- populateLoginDiv();
-}
-</script>
-
-
-</head>
-<body onload="init();">
-<div id="content">
-
-<script src="headerInclude.js"></script>
-
-<h2>Sorry, that page was not found.</h2>
-
-<h3>Dang.</h3>
-</div><!-- end content -->
-</body>
-<!-- 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....
[truncated message content] |
|
From: <tre...@us...> - 2007-06-28 22:15:08
|
Revision: 201
http://ogoglio.svn.sourceforge.net/ogoglio/?rev=201&view=rev
Author: trevorolio
Date: 2007-06-28 15:15:07 -0700 (Thu, 28 Jun 2007)
Log Message:
-----------
Added a Creative Commons licensed sailboat model.
Added Paths:
-----------
spaces/trunk/art/GladiateurSailboat/
spaces/trunk/art/GladiateurSailboat/CC License.txt
spaces/trunk/art/GladiateurSailboat/Sailboat.blend
spaces/trunk/art/GladiateurSailboat/Sailboat.mtl
spaces/trunk/art/GladiateurSailboat/Sailboat.obj
spaces/trunk/art/GladiateurSailboat/boat mat.mat
spaces/trunk/art/GladiateurSailboat/boat.3DS
spaces/trunk/art/GladiateurSailboat/tex.jpg
Added: spaces/trunk/art/GladiateurSailboat/CC License.txt
===================================================================
--- spaces/trunk/art/GladiateurSailboat/CC License.txt (rev 0)
+++ spaces/trunk/art/GladiateurSailboat/CC License.txt 2007-06-28 22:15:07 UTC (rev 201)
@@ -0,0 +1,3 @@
+This work is licensed under the Creative Commons Attribution 3.0 License.
+To view a copy of this license, visit http://creativecommons.org/licenses/by/3.0/
+or send a letter to Creative Commons, 171 Second Street, Suite 300, San Francisco, California, 94105, USA.
Property changes on: spaces/trunk/art/GladiateurSailboat/CC License.txt
___________________________________________________________________
Name: svn:executable
+ *
Added: spaces/trunk/art/GladiateurSailboat/Sailboat.blend
===================================================================
(Binary files differ)
Property changes on: spaces/trunk/art/GladiateurSailboat/Sailboat.blend
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: spaces/trunk/art/GladiateurSailboat/Sailboat.mtl
===================================================================
--- spaces/trunk/art/GladiateurSailboat/Sailboat.mtl (rev 0)
+++ spaces/trunk/art/GladiateurSailboat/Sailboat.mtl 2007-06-28 22:15:07 UTC (rev 201)
@@ -0,0 +1,33 @@
+# Blender3D MTL File: Sailboat.blend
+# Material Count: 3
+newmtl 03_-_Default.001
+Ns 96.078431
+Ka 0.000000 0.000000 0.000000
+Kd 0.185098 0.185098 0.185098
+Ks 0.500000 0.500000 0.500000
+Ni 1.000000
+d 1.000000
+illum 2
+
+
+newmtl boat_mat.001_tex.jpg
+Ns 96.078431
+Ka 0.000000 0.000000 0.000000
+Kd 0.630588 0.611765 0.542745
+Ks 0.500000 0.500000 0.500000
+Ni 1.000000
+d 1.000000
+illum 2
+map_Kd tex.jpg
+
+
+newmtl boat_mat2
+Ns 96.078431
+Ka 0.000000 0.000000 0.000000
+Kd 0.800000 0.800000 0.800000
+Ks 0.500000 0.500000 0.500000
+Ni 1.000000
+d 1.000000
+illum 2
+
+
Added: spaces/trunk/art/GladiateurSailboat/Sailboat.obj
===================================================================
--- spaces/trunk/art/GladiateurSailboat/Sailboat.obj (rev 0)
+++ spaces/trunk/art/GladiateurSailboat/Sailboat.obj 2007-06-28 22:15:07 UTC (rev 201)
@@ -0,0 +1,12448 @@
+# Blender3D v243 OBJ File: Sailboat.blend
+# www.blender3d.org
+mtllib Sailboat.mtl
+o Deck_Box01_boat_mat.007
+v -0.622182 0.382233 -3.767716
+v -0.622181 0.382233 -5.872991
+v -0.622181 0.382233 -6.142008
+v -0.346117 -0.024326 -5.872991
+v -0.346117 -0.024326 -6.142008
+v -0.593588 0.382233 -6.427941
+v -0.346121 -0.024326 -3.767715
+v -1.866005 0.382233 -3.005320
+v -0.622182 0.382233 -3.005320
+v -0.378388 0.382233 -3.005319
+v -0.743039 0.382233 -6.404135
+v -0.835720 0.382233 -6.323876
+v -0.977189 0.382233 -6.142009
+v -1.190028 0.382233 -5.872992
+v -1.748753 0.382233 -3.767716
+v -0.546850 -0.024326 -6.427941
+v -0.578580 -0.024326 -6.427941
+v -0.697032 -0.024326 -6.323876
+v -0.571982 -0.024326 -6.142009
+v -0.571982 -0.024326 -5.872991
+v -0.571982 -0.024326 -3.767716
+v -0.571982 -0.024326 -3.005319
+v -0.346122 -0.024327 -3.005318
+v 0.041627 -0.024327 -3.005318
+v 0.041627 0.382233 -6.427940
+v 1.832008 0.382233 -3.767716
+v 1.949260 0.382233 -3.005320
+v 0.705437 0.382233 -3.005320
+v 0.705437 0.382233 -3.767716
+v 1.273282 0.382233 -5.872992
+v 0.705436 0.382233 -5.872991
+v 1.060444 0.382233 -6.142009
+v 0.705436 0.382233 -6.142008
+v 0.661835 -0.024326 -6.427941
+v 0.780287 -0.024326 -6.323876
+v 0.655237 -0.024326 -6.142009
+v 0.429372 -0.024326 -6.142008
+v 0.630105 -0.024326 -6.427941
+v 0.655237 -0.024326 -3.005319
+v 0.429377 -0.024327 -3.005318
+v 0.429375 -0.024326 -3.767715
+v 0.655237 -0.024326 -3.767716
+v 0.429372 -0.024326 -5.872991
+v 0.655236 -0.024326 -5.872991
+v 0.918975 0.382233 -6.323876
+v 0.826294 0.382233 -6.404135
+v 0.676843 0.382233 -6.427941
+v 0.041627 -0.024326 -5.872991
+v 0.041627 -0.024326 -6.142008
+v 0.461643 0.382233 -3.005319
+v 0.041627 0.382233 -3.005319
+v 0.041627 -0.024326 -6.427940
+v 0.041627 -0.024326 -3.767714
+vt 0.149751 0.681974 0.0
+vt 0.126730 0.672575 0.0
+vt 0.370942 0.672575 0.0
+vt 0.370942 0.672575 0.0
+vt 0.370942 0.681974 0.0
+vt 0.149751 0.681974 0.0
+vt 0.149751 0.681974 0.0
+vt 0.370942 0.681974 0.0
+vt 0.259452 0.707930 0.0
+vt 0.370942 0.681974 0.0
+vt 0.370943 0.707930 0.0
+vt 0.259452 0.707930 0.0
+vt 0.301240 0.711247 0.0
+vt 0.259452 0.707930 0.0
+vt 0.370943 0.707930 0.0
+vt 0.370943 0.707930 0.0
+vt 0.370943 0.711247 0.0
+vt 0.301240 0.711247 0.0
+vt 0.356247 0.713489 0.0
+vt 0.380799 0.711247 0.0
+vt 0.425145 0.711247 0.0
+vt 0.356247 0.713489 0.0
+vt 0.425145 0.711247 0.0
+vt 0.385733 0.714772 0.0
+vt 0.425144 0.672575 0.0
+vt 0.425144 0.681974 0.0
+vt 0.380799 0.681974 0.0
+vt 0.380799 0.681974 0.0
+vt 0.380799 0.672575 0.0
+vt 0.425144 0.672575 0.0
+vt 0.425144 0.681974 0.0
+vt 0.425145 0.707930 0.0
+vt 0.380799 0.707930 0.0
+vt 0.380799 0.707930 0.0
+vt 0.380799 0.681974 0.0
+vt 0.425144 0.681974 0.0
+vt 0.425145 0.707930 0.0
+vt 0.425145 0.711247 0.0
+vt 0.380799 0.711247 0.0
+vt 0.380799 0.711247 0.0
+vt 0.380799 0.707930 0.0
+vt 0.425145 0.707930 0.0
+vt 0.329016 0.713489 0.0
+vt 0.301240 0.711247 0.0
+vt 0.370943 0.711247 0.0
+vt 0.501275 0.707930 0.0
+vt 0.501275 0.711247 0.0
+vt 0.425145 0.711247 0.0
+vt 0.425145 0.711247 0.0
+vt 0.425145 0.707930 0.0
+vt 0.501275 0.707930 0.0
+vt 0.376557 0.714772 0.0
+vt 0.347214 0.714479 0.0
+vt 0.379503 0.714772 0.0
+vt 0.347214 0.714479 0.0
+vt 0.329016 0.713489 0.0
+vt 0.356247 0.713489 0.0
+vt 0.356247 0.713489 0.0
+vt 0.379503 0.714772 0.0
+vt 0.347214 0.714479 0.0
+vt 0.329016 0.713489 0.0
+vt 0.370943 0.711247 0.0
+vt 0.380799 0.711247 0.0
+vt 0.380799 0.711247 0.0
+vt 0.356247 0.713489 0.0
+vt 0.329016 0.713489 0.0
+vt 0.370943 0.711247 0.0
+vt 0.370943 0.707930 0.0
+vt 0.380799 0.707930 0.0
+vt 0.380799 0.707930 0.0
+vt 0.380799 0.711247 0.0
+vt 0.370943 0.711247 0.0
+vt 0.370943 0.707930 0.0
+vt 0.370942 0.681974 0.0
+vt 0.380799 0.681974 0.0
+vt 0.380799 0.681974 0.0
+vt 0.380799 0.707930 0.0
+vt 0.370943 0.707930 0.0
+vt 0.370942 0.681974 0.0
+vt 0.370942 0.672575 0.0
+vt 0.380799 0.672575 0.0
+vt 0.380799 0.681974 0.0
+vt 0.370942 0.681974 0.0
+vt 0.380799 0.672575 0.0
+vt 0.370942 0.672575 0.0
+vt 0.418809 0.672575 0.0
+vt 0.425144 0.672575 0.0
+vt 0.425144 0.672575 0.0
+vt 0.380799 0.672575 0.0
+vt 0.370942 0.672575 0.0
+vt 0.501275 0.672575 0.0
+vt 0.501275 0.672575 0.0
+vt 0.425144 0.672575 0.0
+vt 0.425144 0.672575 0.0
+vt 0.418809 0.672575 0.0
+vt 0.501275 0.672575 0.0
+vt 0.501275 0.714772 0.0
+vt 0.385733 0.714772 0.0
+vt 0.425145 0.711247 0.0
+vt 0.425145 0.711247 0.0
+vt 0.501275 0.711247 0.0
+vt 0.501275 0.714772 0.0
+vt 0.425144 0.681974 0.0
+vt 0.425144 0.672575 0.0
+vt 0.501275 0.672575 0.0
+vt 0.501275 0.672575 0.0
+vt 0.501275 0.681974 0.0
+vt 0.425144 0.681974 0.0
+vt 0.425145 0.707930 0.0
+vt 0.425144 0.681974 0.0
+vt 0.501275 0.681974 0.0
+vt 0.501275 0.681974 0.0
+vt 0.501275 0.707930 0.0
+vt 0.425145 0.707930 0.0
+vt 0.501275 0.714772 0.0
+vt 0.376557 0.714772 0.0
+vt 0.385733 0.714772 0.0
+vt 0.385733 0.714772 0.0
+vt 0.501275 0.714772 0.0
+vt 0.501275 0.714772 0.0
+vt 0.149751 0.681974 0.0
+vt 0.370942 0.681974 0.0
+vt 0.370942 0.672575 0.0
+vt 0.370942 0.672575 0.0
+vt 0.126730 0.672575 0.0
+vt 0.149751 0.681974 0.0
+vt 0.259452 0.707930 0.0
+vt 0.370943 0.707930 0.0
+vt 0.370942 0.681974 0.0
+vt 0.370942 0.681974 0.0
+vt 0.149751 0.681974 0.0
+vt 0.259452 0.707930 0.0
+vt 0.301240 0.711247 0.0
+vt 0.370943 0.711247 0.0
+vt 0.370943 0.707930 0.0
+vt 0.370943 0.707930 0.0
+vt 0.259452 0.707930 0.0
+vt 0.301240 0.711247 0.0
+vt 0.425145 0.711247 0.0
+vt 0.380799 0.711247 0.0
+vt 0.356247 0.713489 0.0
+vt 0.385733 0.714772 0.0
+vt 0.425145 0.711247 0.0
+vt 0.356247 0.713489 0.0
+vt 0.425144 0.672575 0.0
+vt 0.380799 0.672575 0.0
+vt 0.380799 0.681974 0.0
+vt 0.380799 0.681974 0.0
+vt 0.425144 0.681974 0.0
+vt 0.425144 0.672575 0.0
+vt 0.425144 0.681974 0.0
+vt 0.380799 0.681974 0.0
+vt 0.380799 0.707930 0.0
+vt 0.380799 0.707930 0.0
+vt 0.425145 0.707930 0.0
+vt 0.425144 0.681974 0.0
+vt 0.425145 0.707930 0.0
+vt 0.380799 0.707930 0.0
+vt 0.380799 0.711247 0.0
+vt 0.380799 0.711247 0.0
+vt 0.425145 0.711247 0.0
+vt 0.425145 0.707930 0.0
+vt 0.329016 0.713489 0.0
+vt 0.370943 0.711247 0.0
+vt 0.301240 0.711247 0.0
+vt 0.501275 0.707930 0.0
+vt 0.425145 0.707930 0.0
+vt 0.425145 0.711247 0.0
+vt 0.425145 0.711247 0.0
+vt 0.501275 0.711247 0.0
+vt 0.501275 0.707930 0.0
+vt 0.379503 0.714772 0.0
+vt 0.347214 0.714479 0.0
+vt 0.376557 0.714772 0.0
+vt 0.347214 0.714479 0.0
+vt 0.379503 0.714772 0.0
+vt 0.356247 0.713489 0.0
+vt 0.356247 0.713489 0.0
+vt 0.329016 0.713489 0.0
+vt 0.347214 0.714479 0.0
+vt 0.329016 0.713489 0.0
+vt 0.356247 0.713489 0.0
+vt 0.380799 0.711247 0.0
+vt 0.380799 0.711247 0.0
+vt 0.370943 0.711247 0.0
+vt 0.329016 0.713489 0.0
+vt 0.370943 0.711247 0.0
+vt 0.380799 0.711247 0.0
+vt 0.380799 0.707930 0.0
+vt 0.380799 0.707930 0.0
+vt 0.370943 0.707930 0.0
+vt 0.370943 0.711247 0.0
+vt 0.370943 0.707930 0.0
+vt 0.380799 0.707930 0.0
+vt 0.380799 0.681974 0.0
+vt 0.380799 0.681974 0.0
+vt 0.370942 0.681974 0.0
+vt 0.370943 0.707930 0.0
+vt 0.370942 0.681974 0.0
+vt 0.380799 0.681974 0.0
+vt 0.380799 0.672575 0.0
+vt 0.380799 0.672575 0.0
+vt 0.370942 0.672575 0.0
+vt 0.370942 0.681974 0.0
+vt 0.370942 0.672575 0.0
+vt 0.380799 0.672575 0.0
+vt 0.425144 0.672575 0.0
+vt 0.425144 0.672575 0.0
+vt 0.418809 0.672575 0.0
+vt 0.370942 0.672575 0.0
+vt 0.501275 0.672575 0.0
+vt 0.418809 0.672575 0.0
+vt 0.425144 0.672575 0.0
+vt 0.425144 0.672575 0.0
+vt 0.501275 0.672575 0.0
+vt 0.501275 0.672575 0.0
+vt 0.501275 0.714772 0.0
+vt 0.501275 0.711247 0.0
+vt 0.425145 0.711247 0.0
+vt 0.425145 0.711247 0.0
+vt 0.385733 0.714772 0.0
+vt 0.501275 0.714772 0.0
+vt 0.425144 0.681974 0.0
+vt 0.501275 0.681974 0.0
+vt 0.501275 0.672575 0.0
+vt 0.501275 0.672575 0.0
+vt 0.425144 0.672575 0.0
+vt 0.425144 0.681974 0.0
+vt 0.425145 0.707930 0.0
+vt 0.501275 0.707930 0.0
+vt 0.501275 0.681974 0.0
+vt 0.501275 0.681974 0.0
+vt 0.425144 0.681974 0.0
+vt 0.425145 0.707930 0.0
+vt 0.501275 0.714772 0.0
+vt 0.501275 0.714772 0.0
+vt 0.385733 0.714772 0.0
+vt 0.385733 0.714772 0.0
+vt 0.376557 0.714772 0.0
+vt 0.501275 0.714772 0.0
+usemtl 03_-_Default.001
+s 1
+f 15/1 8/2 9/3
+f 9/4 1/5 15/6
+f 15/7 1/8 14/9
+f 1/10 2/11 14/12
+f 13/13 14/14 2/15
+f 2/16 3/17 13/18
+f 18/19 19/20 5/21
+f 18/22 5/23 16/24
+f 23/25 7/26 21/27
+f 21/28 22/29 23/30
+f 7/31 4/32 20/33
+f 20/34 21/35 7/36
+f 4/37 5/38 19/39
+f 19/40 20/41 4/42
+f 12/43 13/44 3/45
+f 48/46 49/47 5/48
+f 5/49 4/50 48/51
+f 6/52 11/53 17/54
+f 11/55 12/56 18/57
+f 18/58 17/59 11/60
+f 12/61 3/62 19/63
+f 19/64 18/65 12/66
+f 3/67 2/68 20/69
+f 20/70 19/71 3/72
+f 2/73 1/74 21/75
+f 21/76 20/77 2/78
+f 1/79 9/80 22/81
+f 21/82 1/83 22/84
+f 9/85 10/86 23/87
+f 23/88 22/89 9/90
+f 51/91 24/92 23/93
+f 23/94 10/95 51/96
+f 52/97 16/98 5/99
+f 5/100 49/101 52/102
+f 7/103 23/104 24/105
+f 24/106 53/107 7/108
+f 4/109 7/110 53/111
+f 53/112 48/113 4/114
+f 25/115 6/116 16/117
+f 16/118 52/119 25/120
+f 26/121 29/122 28/123
+f 28/124 27/125 26/126
+f 30/127 31/128 29/129
+f 29/130 26/131 30/132
+f 32/133 33/134 31/135
+f 31/136 30/137 32/138
+f 37/139 36/140 35/141
+f 38/142 37/143 35/144
+f 40/145 39/146 42/147
+f 42/148 41/149 40/150
+f 41/151 42/152 44/153
+f 44/154 43/155 41/156
+f 43/157 44/158 36/159
+f 36/160 37/161 43/162
+f 45/163 33/164 32/165
+f 48/166 43/167 37/168
+f 37/169 49/170 48/171
+f 34/172 46/173 47/174
+f 46/175 34/176 35/177
+f 35/178 45/179 46/180
+f 45/181 35/182 36/183
+f 36/184 33/185 45/186
+f 33/187 36/188 44/189
+f 44/190 31/191 33/192
+f 31/193 44/194 42/195
+f 42/196 29/197 31/198
+f 29/199 42/200 39/201
+f 39/202 28/203 29/204
+f 28/205 39/206 40/207
+f 40/208 50/209 28/210
+f 51/211 50/212 40/213
+f 40/214 24/215 51/216
+f 52/217 49/218 37/219
+f 37/220 38/221 52/222
+f 41/223 53/224 24/225
+f 24/226 40/227 41/228
+f 43/229 48/230 53/231
+f 53/232 41/233 43/234
+f 25/235 52/236 38/237
+f 38/238 47/239 25/240
+o Topside_Box01_boat_mat.006
+v -0.265215 0.662829 5.616509
+v -0.477812 1.062615 5.616509
+v -1.328153 1.062760 3.037271
+v -1.545902 0.554386 1.756488
+v -1.745523 0.975037 1.756488
+v -2.006482 0.465183 -1.630656
+v -2.207225 0.885834 -1.630656
+v -2.212595 0.885834 -2.613418
+v -2.025551 0.568089 -2.830217
+v -1.115479 0.662829 3.037271
+v -1.040202 1.083481 3.869748
+v -1.152432 1.083481 3.037271
+v -1.339474 0.975037 1.756488
+v -1.618695 0.885834 -1.630656
+v -0.674994 0.885834 -2.613418
+v -0.674994 0.568089 -2.830216
+v -0.191198 1.083480 5.345315
+v 0.001061 1.066179 6.940076
+v -0.505790 1.432794 1.668301
+v -0.637733 1.449114 -1.630655
+v -0.412321 0.782875 -2.488942
+v 0.012898 0.662829 6.469500
+v -0.412322 1.455143 -2.471191
+v -0.674994 1.417389 -2.458591
+v -1.618695 1.417387 -1.630656
+v -1.339474 1.400563 1.752200
+v -1.152431 1.290669 2.929936
+v -0.401924 1.156719 4.913850
+v -0.412322 1.417389 -2.458591
+v -0.661129 1.449114 -2.471215
+v -1.585297 1.449114 -1.630656
+v -1.203529 1.416977 1.678761
+v -0.892359 1.302746 3.146857
+v -1.049734 1.344887 2.708133
+v -0.426206 1.198466 4.429727
+v -0.469940 1.083480 5.600684
+v -1.314615 1.083481 3.037271
+v -1.758629 0.954418 1.756488
+v -2.219227 0.865247 -1.630656
+v -2.222613 0.860767 -2.613418
+v -2.189378 0.542982 -2.830217
+v -1.023223 1.062679 3.962131
+v -0.003630 1.083480 6.924830
+v -1.758551 0.513201 0.030021
+v -1.971286 0.913248 0.030021
+v -1.461526 0.936045 0.030021
+v -0.637639 1.439659 0.030022
+v -1.428528 1.439659 0.030021
+v -1.461139 1.407894 0.030021
+v -1.958241 0.933939 0.030021
+v -1.592024 1.081625 -1.515599
+v -1.488130 1.096211 -0.417831
+v -1.487875 1.233283 -0.417831
+v -1.592025 1.236041 -1.515598
+v -1.307774 1.125735 1.806457
+v -1.184132 1.157238 2.653102
+v -1.184132 1.217426 2.650462
+v -1.307774 1.249350 1.803622
+v -1.440807 1.109049 0.155864
+v -1.360126 1.120377 1.297121
+v -1.360126 1.243992 1.294286
+v -1.440551 1.246122 0.155863
+v -1.557076 1.081625 -1.518907
+v -1.453182 1.096146 -0.421138
+v -1.452926 1.233218 -0.421147
+v -1.557077 1.236041 -1.518914
+v -1.273036 1.125619 1.801388
+v -1.149395 1.157016 2.648037
+v -1.149397 1.217203 2.645381
+v -1.273038 1.249234 1.798546
+v -1.405790 1.108984 0.153389
+v -1.325108 1.120320 1.294646
+v -1.325108 1.243935 1.291812
+v -1.405534 1.246056 0.153389
+v -1.557076 1.081625 -1.518907
+v -1.453182 1.096146 -0.421138
+v -1.452926 1.233218 -0.421147
+v -1.557077 1.236041 -1.518914
+v -1.273036 1.125619 1.801388
+v -1.149395 1.157016 2.648037
+v -1.149397 1.217203 2.645381
+v -1.273038 1.249234 1.798546
+v -1.405790 1.108984 0.153389
+v -1.325108 1.120320 1.294646
+v -1.325108 1.243935 1.291812
+v -1.405534 1.246056 0.153389
+v -0.496018 1.100347 5.622512
+v -0.488147 1.121210 5.606682
+v -1.058259 1.121473 3.875697
+v -1.041271 1.100685 3.968081
+v -1.346337 1.100953 3.042377
+v -1.332797 1.121672 3.042382
+v -1.763840 1.012992 1.761665
+v -1.776948 0.992374 1.761660
+v -1.777383 0.992650 1.758514
+v -1.764276 1.013269 1.758515
+v -1.977038 0.972101 0.032055
+v -1.990083 0.951410 0.032054
+v -2.238504 0.902796 -1.630641
+v -2.226502 0.923383 -1.630551
+v -2.233315 0.920426 -2.613305
+v -2.243334 0.895358 -2.613384
+v -2.239697 0.893905 -2.626045
+v -2.229676 0.918971 -2.626050
+v -2.196269 0.601269 -2.842904
+v -2.206405 0.576164 -2.842899
+v -1.041269 1.100688 3.968081
+v -1.058252 1.121483 3.875698
+v -1.332621 1.121557 3.043206
+v -1.346160 1.100836 3.043209
+v -0.019410 1.094548 6.948712
+v -0.024198 1.111661 6.933280
+v -0.487346 1.121782 5.607835
+v -0.495128 1.100974 5.623782
+v -0.003630 1.124544 6.941572
+v 0.001061 1.107242 6.956817
+v -0.674994 0.782875 -2.488942
+v -0.674995 1.314430 -2.488942
+v -0.412322 1.314431 -2.488942
+v -0.446514 1.540441 0.030109
+v -0.412322 1.465806 -2.471149
+v -0.446513 1.549896 -1.630568
+v 0.041627 0.662829 6.469500
+v 0.041627 1.315475 3.037491
+v 0.041627 1.184882 4.610326
+v 0.041627 1.107242 6.956817
+v -0.412321 0.782875 -2.448286
+v -0.412322 1.314431 -2.448286
+v -0.412321 0.782875 -2.448286
+v -0.412322 1.314431 -2.448286
+v -0.944587 1.396641 2.168473
+v -0.942249 1.436010 0.890951
+v -0.348527 1.244588 3.884614
+v -1.131257 1.312805 2.953639
+v -1.231080 1.362199 2.358919
+v -0.757929 1.234141 3.903254
+v -0.169898 1.161675 4.876878
+v -1.384164 1.420119 0.891031
+v -0.468774 1.487957 0.744926
+v -0.179857 1.484307 1.459784
+v -0.511886 1.367002 2.472812
+v -0.898924 1.424343 1.640796
+v -0.605640 1.450463 0.850322
+v -0.265206 1.428424 1.864863
+v -0.745678 1.380301 2.348706
+v -1.152021 1.379100 2.320233
+v -0.645955 1.241976 3.889274
+v -0.209429 1.184882 4.610326
+v -1.315559 1.403810 1.688507
+v -1.039515 1.290039 3.179038
+v -0.971121 1.331888 2.839358
+v -1.159917 1.322718 2.811038
+v -0.422668 1.179792 4.633472
+v -1.265615 1.432037 0.890971
+v -0.401552 1.536293 1.161660
+v -0.483807 1.314169 3.054018
+v -0.674994 1.417389 -2.458591
+v -0.412322 1.417389 -2.458591
+v -0.674994 0.782875 -2.488942
+v -0.674995 1.314430 -2.488942
+v -0.412321 0.783031 -2.494747
+v -0.674994 0.783031 -2.494747
+v -0.674995 1.314586 -2.494747
+v -0.674994 1.417544 -2.464397
+v -0.412322 1.417545 -2.464397
+v -0.412322 1.314586 -2.494747
+v -0.441053 1.543049 0.036595
+v -0.440574 1.543512 0.036616
+v -0.434291 1.543553 0.030112
+v -0.405810 1.472346 -2.471124
+v -0.434288 1.553008 -1.630565
+v -0.626245 1.452033 -1.630653
+v -0.406294 1.449114 -2.471214
+v -0.412322 1.443513 -2.468985
+v -0.418552 1.449114 -2.471214
+v -0.633657 1.439635 0.035693
+v -0.631459 1.439727 0.036048
+v -0.630274 1.440055 0.035887
+v -0.626316 1.442541 0.030025
+v -0.501810 1.432464 1.674707
+v -0.497834 1.434834 1.659482
+v 0.038375 1.433123 1.893946
+v 0.036450 1.431749 1.905770
+v -0.611145 1.448928 0.848419
+v -0.616983 1.448762 0.855105
+v -0.261577 1.429865 1.852898
+v 0.037127 1.535199 1.173622
+v -0.402287 1.535579 1.161772
+v -0.402481 1.535059 1.173485
+v -0.396842 1.535199 1.173622
+v 0.041627 1.083480 6.924830
+v 0.041627 1.083480 5.345315
+v 0.041627 1.161675 4.876878
+v 0.041627 1.433207 1.894447
+v -0.326719 1.614972 -0.250879
+v -0.326719 1.614972 0.317216
+v -0.326719 1.611048 -0.260353
+v -0.333419 1.611048 -0.257578
+v -0.336194 1.611048 -0.250879
+v -0.336194 1.611048 0.317216
+v -0.333420 1.611048 0.323915
+v -0.326719 1.611048 0.326690
+v -0.326719 1.601575 -0.264277
+v -0.336194 1.601575 -0.260353
+v -0.340118 1.601575 -0.250879
+v -0.340118 1.601575 0.317216
+v -0.336194 1.601575 0.326690
+v -0.326719 1.601575 0.330614
+v -0.326719 1.536360 -0.264277
+v -0.336194 1.536360 -0.260353
+v -0.340118 1.536360 -0.250879
+v -0.340118 1.536360 0.317216
+v -0.336194 1.536360 0.326690
+v -0.326719 1.536360 0.330614
+v -0.326719 1.526887 -0.260353
+v -0.333419 1.526887 -0.257578
+v -0.336194 1.526887 -0.250879
+v -0.336194 1.526887 0.317216
+v -0.333420 1.526887 0.323915
+v -0.326719 1.526887 0.326690
+v -0.326719 1.522962 0.317216
+v -0.326719 1.522962 -0.250879
+v -0.033330 1.503522 -0.097401
+v -0.110751 1.503522 0.036697
+v -0.033330 1.503522 0.170795
+v 0.024707 1.084373 5.919806
+v 0.006777 1.082877 5.950823
+v 0.024707 1.081380 5.981841
+v -0.242720 1.233590 4.080693
+v -0.329108 1.222961 4.184326
+v -0.246699 1.212332 4.289618
+v -0.242747 1.247805 4.082139
+v -0.329135 1.237175 4.185772
+v -0.246727 1.226546 4.291064
+v -0.213735 1.239903 4.093219
+v -0.290473 1.230462 4.185274
+v -0.217272 1.221020 4.278803
+v 0.013496 1.581082 6.688837
+v 0.005511 1.554839 6.755355
+v 0.005511 1.609002 6.754670
+v -0.452152 1.568639 5.706513
+v -0.515718 1.541812 5.726933
+v -0.515718 1.595974 5.726246
+v -1.265242 1.497744 3.397688
+v -1.328806 1.470917 3.418107
+v -1.328806 1.525080 3.417421
+v -1.832728 1.456462 1.709152
+v -1.896292 1.429635 1.729571
+v -1.896292 1.483798 1.728884
+v -2.260689 1.353185 -2.457621
+v -2.324252 1.326358 -2.437202
+v -2.324252 1.380521 -2.437888
+v -0.017287 1.082591 6.612486
+v -0.061695 1.082597 6.614459
+v -0.037783 1.082584 6.651931
+v -0.002943 1.592718 6.674714
+v -0.043816 1.575248 6.674424
+v -0.019904 1.575234 6.711897
+v -0.333175 1.026522 5.713055
+v -0.371671 1.026529 5.690830
+v -0.371671 1.026516 5.735281
+v -0.451212 1.566168 5.713247
+v -0.485511 1.548698 5.691015
+v -0.485511 1.548685 5.735467
+v -1.125467 1.010933 3.410830
+v -1.163964 1.010939 3.388605
+v -1.163964 1.010926 3.433056
+v -1.276836 1.521060 3.411022
+v -1.311136 1.503590 3.388791
+v -1.311136 1.503577 3.433243
+v -1.688301 0.890146 1.734799
+v -1.726797 0.890153 1.712572
+v -1.726797 0.890139 1.757025
+v -1.839669 1.460268 1.734989
+v -1.873969 1.442798 1.712759
+v -1.873969 1.442784 1.757210
+v -2.122838 0.890146 -2.445904
+v -2.161334 0.890153 -2.468130
+v -2.161334 0.890139 -2.423678
+v -2.274206 1.399419 -2.445713
+v -2.308506 1.381948 -2.467944
+v -2.308506 1.381935 -2.423492
+v 0.038619 1.581121 6.691868
+v 0.038619 1.609052 6.758664
+v 0.038619 1.554890 6.759349
+v 0.013797 1.371211 6.605154
+v 0.005908 1.357678 6.670904
+v -0.509066 1.331818 5.655071
+v -0.446264 1.346510 5.634854
+v 0.005908 1.388073 6.670131
+v -0.509066 1.362213 5.654297
+v -1.312398 1.250379 3.374581
+v -1.249596 1.265072 3.354364
+v -1.312398 1.280774 3.373807
+v -1.873074 1.196752 1.706749
+v -1.810272 1.211444 1.686532
+v -1.873074 1.227147 1.705975
+v -2.295899 1.063628 -2.408930
+v -2.233097 1.078320 -2.429147
+v -2.295899 1.094023 -2.409704
+v 0.038619 1.371287 6.608147
+v 0.038619 1.357778 6.674850
+v 0.038619 1.388173 6.674076
+v 0.041627 1.611048 -0.260353
+v 0.041627 1.601575 -0.264277
+v 0.041627 1.233590 4.081595
+v 0.041627 1.239903 4.094029
+v 0.041627 1.371278 6.607784
+v 0.041627 1.543553 0.030112
+v 0.041627 1.472346 -2.471124
+v 0.041627 1.601575 0.330614
+v 0.041627 1.526887 0.326690
+v 0.041627 1.503522 0.170795
+v 0.041627 1.536360 -0.264277
+v 0.041627 1.522962 -0.250880
+v 0.041627 1.084373 5.919806
+v 0.041627 1.581116 6.691505
+v 0.041627 1.609048 6.758301
+v 0.041627 1.388164 6.673713
+v 0.561067 1.062615 5.616509
+v 0.348470 0.662829 5.616509
+v 0.070357 0.662829 6.469500
+v 0.082194 1.066179 6.940076
+v 1.106478 1.062679 3.962131
+v 1.198734 0.662829 3.037271
+v 1.411408 1.062760 3.037271
+v 1.841884 0.954418 1.756488
+v 1.629157 0.554386 1.756488
+v 2.054540 0.913248 0.030021
+v 1.841806 0.513201 0.030021
+v 2.089737 0.465183 -1.630656
+v 2.302482 0.865247 -1.630656
+v 2.305868 0.860767 -2.613418
+v 2.095506 0.465183 -2.613418
+v 2.272634 0.542982 -2.830217
+v 0.553195 1.083480 5.600684
+v 0.086885 1.083480 6.924830
+v 0.274453 1.083480 5.345315
+v 1.397869 1.083481 3.037271
+v 1.123456 1.083481 3.869748
+v 1.235687 1.083481 3.037271
+v 1.828778 0.975037 1.756488
+v 1.422729 0.975037 1.756488
+v 2.290481 0.885834 -1.630656
+v 2.041495 0.933939 0.030021
+v 1.544781 0.936045 0.030021
+v 1.701950 0.885834 -1.630656
+v 2.295850 0.885834 -2.613418
+v 0.758249 0.885834 -2.613418
+v 2.108806 0.568089 -2.830217
+v 0.758249 0.568089 -2.830216
+v 1.668551 1.449114 -1.630656
+v 0.720989 1.449114 -1.630655
+v 0.501807 1.449114 -2.471214
+v 0.744384 1.449114 -2.471215
+v 0.758249 0.783031 -2.494747
+v 0.495576 0.783031 -2.494747
+v 0.041627 1.066179 6.940076
+v 0.484806 1.536293 1.161660
+v 0.041627 1.536293 1.161659
+v 0.517546 1.543553 0.030112
+v 0.523829 1.543512 0.036616
+v 0.517542 1.553008 -1.630565
+v 0.041627 1.553008 -1.630565
+v 0.489065 1.472346 -2.471124
+v 0.495576 0.782875 -2.488942
+v 0.041627 0.782875 -2.488941
+v 0.758249 1.314586 -2.494747
+v 0.495577 1.314586 -2.494747
+v 1.701950 1.417387 -1.630656
+v 0.758249 1.417389 -2.458591
+v 1.640330 1.081625 -1.518907
+v 1.536437 1.096146 -0.421138
+v 1.536181 1.233218 -0.421147
+v 1.640332 1.236041 -1.518914
+v 1.356291 1.125619 1.801388
+v 1.232650 1.157016 2.648037
+v 1.232652 1.217203 2.645381
+v 1.356292 1.249234 1.798546
+v 0.485179 1.156719 4.913850
+v 1.235687 1.290669 2.929936
+v 0.041627 1.156719 4.913850
+v 0.495577 1.443513 -2.468985
+v 0.495577 1.417389 -2.458591
+v 1.544394 1.407894 0.030021
+v 1.511782 1.439659 0.030021
+v 0.579273 1.100347 5.622512
+v 0.571402 1.121210 5.606682
+v 1.141514 1.121473 3.875697
+v 1.124526 1.100685 3.968081
+v 1.429592 1.100953 3.042377
+v 1.416052 1.121672 3.042382
+v 1.847095 1.012992 1.761665
+v 1.860203 0.992374 1.761660
+v 1.860638 0.992650 1.758514
+v 1.847531 1.013269 1.758515
+v 2.060293 0.972101 0.032055
+v 2.073338 0.951410 0.032054
+v 2.321759 0.902796 -1.630641
+v 2.309758 0.923383 -1.630551
+v 2.316570 0.920426 -2.613305
+v 2.326589 0.895358 -2.613384
+v 2.322952 0.893905 -2.626045
+v 2.312931 0.918971 -2.626050
+v 2.279524 0.601269 -2.842904
+v 2.289660 0.576164 -2.842899
+v 1.124524 1.100688 3.968081
+v 1.141507 1.121483 3.875698
+v 1.415876 1.121557 3.043206
+v 1.429415 1.100836 3.043209
+v 0.102665 1.094548 6.948712
+v 0.107453 1.111661 6.933280
+v 0.570601 1.121782 5.607835
+v 0.578383 1.100974 5.623782
+v 0.720893 1.439659 0.030022
+v 1.489044 1.108984 0.153389
+v 1.408363 1.120320 1.294646
+v 1.408363 1.243935 1.291812
+v 1.488788 1.246056 0.153389
+v 1.571385 1.096211 -0.417831
+v 1.675280 1.081625 -1.515599
+v 1.571130 1.233283 -0.417831
+v 1.675280 1.236041 -1.515598
+v 1.267387 1.157238 2.653102
+v 1.391029 1.125735 1.806457
+v 1.267387 1.217426 2.650462
+v 1.422729 1.400563 1.752200
+v 1.391029 1.249350 1.803622
+v 1.443381 1.120377 1.297121
+v 1.524062 1.109049 0.155864
+v 1.443381 1.243992 1.294286
+v 1.523807 1.246122 0.155863
+v 1.536437 1.096146 -0.421138
+v 1.640330 1.081625 -1.518907
+v 1.536181 1.233218 -0.421147
+v 1.640332 1.236041 -1.518914
+v 1.232650 1.157016 2.648037
+v 1.356291 1.125619 1.801388
+v 1.232652 1.217203 2.645381
+v 1.356292 1.249234 1.798546
+v 1.408363 1.120320 1.294646
+v 1.489044 1.108984 0.153389
+v 1.408363 1.243935 1.291812
+v 1.488788 1.246056 0.153389
+v 0.082194 1.107242 6.956817
+v 0.086885 1.124544 6.941572
+v 0.758249 0.782875 -2.488942
+v 0.758249 1.314430 -2.488942
+v 0.758249 1.417544 -2.464397
+v 0.495577 1.417545 -2.464397
+v 0.495577 1.417389 -2.458591
+v 0.041627 1.417389 -2.458591
+v 0.041627 1.314431 -2.488941
+v 0.495577 1.314431 -2.488942
+v 0.495577 1.455143 -2.471191
+v 0.709500 1.452033 -1.630653
+v 0.529768 1.549896 -1.630568
+v 0.495577 1.465806 -2.471149
+v 0.709571 1.442541 0.030025
+v 0.529769 1.540441 0.030109
+v 0.041627 0.782875 -2.448285
+v 0.495576 0.782875 -2.448286
+v 0.495577 1.314431 -2.448286
+v 0.041627 1.314431 -2.448285
+v 0.489549 1.449114 -2.471214
+v 0.041627 1.449114 -2.471214
+v 0.041627 1.124544 6.941572
+v 0.495577 1.314431 -2.448286
+v 0.495576 0.782875 -2.448286
+v 1.132988 1.344887 2.708133
+v 0.828933 1.380301 2.348706
+v 1.027842 1.396641 2.168473
+v 1.235275 1.379100 2.320233
+v 0.585065 1.432464 1.674707
+v 0.589044 1.432794 1.668301
+v 0.982179 1.424343 1.640796
+v 1.286784 1.416977 1.678761
+v 1.025505 1.436010 0.890951
+v 1.348870 1.432037 0.890971
+v 0.700238 1.448762 0.855105
+v 0.716911 1.439635 0.035693
+v 0.694400 1.448928 0.848419
+v 0.714715 1.439727 0.036048
+v 0.509461 1.198466 4.429727
+v 0.292684 1.184882 4.610326
+v 0.431782 1.244588 3.884614
+v 0.729209 1.241976 3.889274
+v 0.041627 1.244588 3.884614
+v 0.567062 1.314169 3.054018
+v 0.975614 1.302746 3.146857
+v 1.122769 1.290039 3.179038
+v 1.214512 1.312805 2.953639
+v 1.243172 1.322718 2.811038
+v 1.054375 1.331888 2.839358
+v 1.398814 1.403810 1.688507
+v 1.314335 1.362199 2.358919
+v 0.841184 1.234141 3.903254
+v 0.505923 1.179792 4.633472
+v 0.253153 1.161675 4.876878
+v 1.467420 1.420119 0.891031
+v 0.713529 1.440055 0.035887
+v 0.688895 1.450463 0.850322
+v 0.552029 1.487957 0.744926
+v 0.581089 1.434834 1.659482
+v 0.485736 1.535059 1.173485
+v 0.485542 1.535579 1.161772
+v 0.524308 1.543049 0.036595
+v 0.344832 1.429865 1.852898
+v 0.263112 1.484307 1.459784
+v 0.480097 1.535199 1.173622
+v 0.044880 1.433123 1.893946
+v 0.041627 1.535408 1.173655
+v 0.046128 1.535199 1.173622
+v 0.046805 1.431749 1.905770
+v 0.348461 1.428424 1.864863
+v 0.595140 1.367002 2.472812
+v 0.041627 1.372226 2.406707
+v 0.041627 1.431649 1.906402
+v 0.758249 0.782875 -2.488942
+v 0.758249 1.314430 -2.488942
+v 0.758249 1.417389 -2.458591
+v 0.409974 1.614972 -0.250879
+v 0.409974 1.614972 0.317216
+v 0.041627 1.614972 0.317216
+v 0.041627 1.614972 -0.250880
+v 0.409974 1.611048 -0.260353
+v 0.416674 1.611048 -0.257578
+v 0.419448 1.611048 -0.250879
+v 0.419448 1.611048 0.317216
+v 0.416675 1.611048 0.323915
+v 0.409974 1.611048 0.326690
+v 0.041627 1.611048 0.326690
+v 0.409974 1.601575 -0.264277
+v 0.419448 1.601575 -0.260353
+v 0.423373 1.601575 -0.250879
+v 0.423373 1.601575 0.317216
+v 0.419448 1.601575 0.326690
+v 0.409974 1.601575 0.330614
+v 0.409974 1.536360 -0.264277
+v 0.419448 1.536360 -0.260353
+v 0.423373 1.536360 -0.250879
+v 0.423373 1.536360 0.317216
+v 0.419448 1.536360 0.326690
+v 0.409974 1.536360 0.330614
+v 0.041627 1.536360 0.330614
+v 0.409974 1.526887 -0.260353
+v 0.416674 1.526887 -0.257578
+v 0.419448 1.526887 -0.250879
+v 0.419448 1.526887 0.317216
+v 0.416675 1.526887 0.323915
+v 0.409974 1.526887 0.326690
+v 0.409974 1.522962 -0.250879
+v 0.409974 1.522962 0.317216
+v 0.041627 1.522962 0.317216
+v 0.116585 1.503522 -0.097401
+v 0.194006 1.503522 0.036697
+v 0.116585 1.503522 0.170795
+v 0.058548 1.084373 5.919806
+v 0.076478 1.082877 5.950823
+v 0.058548 1.081380 5.981841
+v 0.041627 1.081380 5.981841
+v 0.325975 1.233590 4.080693
+v 0.412362 1.222961 4.184326
+v 0.412390 1.237175 4.185772
+v 0.326002 1.247805 4.082139
+v 0.329954 1.212332 4.289618
+v 0.329982 1.226546 4.291064
+v 0.041627 1.212332 4.290532
+v 0.041627 1.226546 4.291978
+v 0.373728 1.230462 4.185274
+v 0.296990 1.239903 4.093219
+v 0.300526 1.221020 4.278803
+v 0.041627 1.221020 4.279624
+v 0.069759 1.581082 6.688837
+v 0.077744 1.554839 6.755355
+v 0.598972 1.541812 5.726933
+v 0.535407 1.568639 5.706513
+v 0.077744 1.609002 6.754670
+v 0.598972 1.595974 5.726246
+v 1.412061 1.470917 3.418107
+v 1.348497 1.497744 3.397688
+v 1.412061 1.525080 3.417421
+v 1.979547 1.429635 1.729571
+v 1.915983 1.456462 1.709152
+v 1.979547 1.483798 1.728884
+v 2.407507 1.326358 -2.437202
+v 2.343943 1.353185 -2.457621
+v 2.407507 1.380521 -2.437888
+v 0.044636 1.581121 6.691868
+v 0.044636 1.554890 6.759349
+v 0.044636 1.609052 6.758664
+v 0.121038 1.082584 6.651931
+v 0.144950 1.082597 6.614459
+v 0.100542 1.082591 6.612486
+v 0.127071 1.575248 6.674424
+v 0.086197 1.592718 6.674714
+v 0.103159 1.575234 6.711897
+v 0.454926 1.026516 5.735281
+v 0.454926 1.026529 5.690830
+v 0.416429 1.026522 5.713055
+v 0.568766 1.548698 5.691015
+v 0.534466 1.566168 5.713247
+v 0.568766 1.548685 5.735467
+v 1.247218 1.010926 3.433056
+v 1.247218 1.010939 3.388605
+v 1.208722 1.010933 3.410830
+v 1.394391 1.503590 3.388791
+v 1.360091 1.521060 3.411022
+v 1.394391 1.503577 3.433243
+v 1.810052 0.890139 1.757025
+v 1.810052 0.890153 1.712572
+v 1.771555 0.890146 1.734799
+v 1.957224 1.442798 1.712759
+v 1.922924 1.460268 1.734989
+v 1.957224 1.442784 1.757210
+v 2.244589 0.890139 -2.423678
+v 2.244589 0.890153 -2.468130
+v 2.206093 0.890146 -2.445904
+v 2.391761 1.381948 -2.467944
+v 2.357460 1.399419 -2.445713
+v 2.391761 1.381935 -2.423492
+v 0.069458 1.371211 6.605154
+v 0.077347 1.357678 6.670904
+v 0.592321 1.331818 5.655071
+v 0.529519 1.346510 5.634854
+v 0.077347 1.388073 6.670131
+v 0.592321 1.362213 5.654297
+v 1.395652 1.250379 3.374581
+v 1.332851 1.265072 3.354364
+v 1.395652 1.280774 3.373807
+v 1.956329 1.196752 1.706749
+v 1.893527 1.211444 1.686532
+v 1.956329 1.227147 1.705975
+v 2.379153 1.063628 -2.408930
+v 2.316352 1.078320 -2.429147
+v 2.379153 1.094023 -2.409704
+v 0.044636 1.371287 6.608147
+v 0.044636 1.357778 6.674850
+v 0.044636 1.388173 6.674076
+v 0.041627 1.526887 -0.260353
+v 0.041627 1.503522 -0.097401
+v 0.041627 1.247805 4.083041
+v 0.041627 1.554886 6.758986
+v 0.041627 1.357769 6.674487
+v 0.001061 1.066179 6.940076
+v 0.001061 1.066179 6.940076
+v 0.012898 0.662829 6.469500
+v -2.219227 0.865247 -1.630656
+v -1.971286 0.913248 0.030021
+v -1.971286 0.913248 0.030021
+v -0.477812 1.062615 5.616509
+v -0.477812 1.062615 5.616509
+v -1.040202 1.083481 3.869748
+v -1.041271 1.100685 3.968081
+v -1.041271 1.100685 3.968081
+v -1.058259 1.121473 3.875697
+v -1.040202 1.083481 3.869748
+v -0.496018 1.100347 5.622512
+v -0.496018 1.100347 5.622512
+v -1.041271 1.100685 3.968081
+v -1.328153 1.062760 3.037271
+v -1.328153 1.062760 3.037271
+v -1.758629 0.954418 1.756488
+v -1.346337 1.100953 3.042377
+v -1.346337 1.100953 3.042377
+v -1.776948 0.992374 1.761660
+v -1.758629 0.954418 1.756488
+v -1.758629 0.954418 1.756488
+v -1.971286 0.913248 0.030021
+v -1.777383 0.992650 1.758514
+v -1.777383 0.992650 1.758514
+v -1.990083 0.951410 0.032054
+v -2.219227 0.865247 -1.630656
+v -2.219227 0.865247 -1.630656
+v -2.222613 0.860767 -2.613418
+v -2.238504 0.902796 -1.630641
+v -2.238504 0.902796 -1.630641
+v -2.243334 0.895358 -2.613384
+v -2.222613 0.860767 -2.613418
+v -2.222613 0.860767 -2.613418
+v -2.239697 0.893905 -2.626045
+v -1.023223 1.062679 3.962131
+v -1.023223 1.062679 3.962131
+v -1.328153 1.062760 3.037271
+v -1.041269 1.100688 3.968081
+v -1.041269 1.100688 3.968081
+v -1.346160 1.100836 3.043209
+v 0.001061 1.066179 6.940076
+v 0.001061 1.066179 6.940076
+v -0.477812 1.062615 5.616509
+v -0.019410 1.094548 6.948712
+v -0.019410 1.094548 6.948712
+v -0.495128 1.100974 5.623782
+v 0.001061 1.066179 6.940076
+v 0.001061 1.066179 6.940076
+v 0.070357 0.662829 6.469500
+v 0.082194 1.066179 6.940076
+v 0.082194 1.066179 6.940076
+v 2.054540 0.913248 0.030021
+v 2.054540 0.913248 0.030021
+v 2.302482 0.865247 -1.630656
+v 0.561067 1.062615 5.616509
+v 0.561067 1.062615 5.616509
+v 1.123456 1.083481 3.869748
+v 1.141514 1.121473 3.875697
+v 1.124526 1.100685 3.968081
+v 1.124526 1.100685 3.968081
+v 1.123456 1.083481 3.869748
+v 1.124526 1.100685 3.968081
+v 0.579273 1.100347 5.622512
+v 0.579273 1.100347 5.622512
+v 1.411408 1.062760 3.037271
+v 1.411408 1.062760 3.037271
+v 1.841884 0.954418 1.756488
+v 1.860203 0.992374 1.761660
+v 1.429592 1.100953 3.042377
+v 1.429592 1.100953 3.042377
+v 1.841884 0.954418 1.756488
+v 1.841884 0.954418 1.756488
+v 2.054540 0.913248 0.030021
+v 2.073338 0.951410 0.032054
+v 1.860638 0.992650 1.758514
+v 1.860638 0.992650 1.758514
+v 2.302482 0.865247 -1.630656
+v 2.302482 0.865247 -1.630656
+v 2.305868 0.860767 -2.613418
+v 2.326589 0.895358 -2.613384
+v 2.321759 0.902796 -1.630641
+v 2.321759 0.902796 -1.630641
+v 2.305868 0.860767 -2.613418
+v 2.305868 0.860767 -2.613418
+v 2.322952 0.893905 -2.626045
+v 1.106478 1.062679 3.962131
+v 1.106478 1.062679 3.962131
+v 1.411408 1.062760 3.037271
+v 1.429415 1.100836 3.043209
+v 1.124524 1.100688 3.968081
+v 1.124524 1.100688 3.968081
+v 0.082194 1.066179 6.940076
+v 0.082194 1.066179 6.940076
+v 0.561067 1.062615 5.616509
+v 0.578383 1.100974 5.623782
+v 0.102665 1.094548 6.948712
+v 0.102665 1.094548 6.948712
+v 0.082194 1.066179 6.940076
+v 0.082194 1.066179 6.940076
+vt 0.875784 0.481726 0.0
+vt 0.875591 0.426462 0.0
+vt 0.932186 0.425605 0.0
+vt 0.932186 0.425605 0.0
+vt 0.963603 0.480890 0.0
+vt 0.875784 0.481726 0.0
+vt 0.875591 0.426462 0.0
+vt 0.875784 0.481726 0.0
+vt 0.766018 0.483396 0.0
+vt 0.704461 0.429051 0.0
+vt 0.875591 0.426462 0.0
+vt 0.766018 0.483396 0.0
+vt 0.704461 0.429051 0.0
+vt 0.704654 0.484336 0.0
+vt 0.619623 0.470645 0.0
+vt 0.619623 0.470645 0.0
+vt 0.619431 0.415347 0.0
+vt 0.704461 0.429051 0.0
+vt 0.619623 0.470645 0.0
+vt 0.505054 0.466688 0.0
+vt 0.504862 0.411387 0.0
+vt 0.504862 0.411387 0.0
+vt 0.619431 0.415347 0.0
+vt 0.619623 0.470645 0.0
+vt 0.394654 0.406416 0.0
+vt 0.394847 0.461720 0.0
+vt 0.329640 0.462087 0.0
+vt 0.400833 0.566472 0.0
+vt 0.492388 0.550146 0.0
+vt 0.455561 0.569620 0.0
+vt 0.234990 0.598076 0.0
+vt 0.288868 0.587812 0.0
+vt 0.266833 0.598076 0.0
+vt 0.234990 0.598076 0.0
+vt 0.266833 0.598076 0.0
+vt 0.230109 0.613867 0.0
+vt 0.230109 0.613867 0.0
+vt 0.150385 0.613867 0.0
+vt 0.234990 0.598076 0.0
+vt 0.059735 0.655627 0.0
+vt 0.108620 0.635152 0.0
+vt 0.206145 0.635152 0.0
+vt 0.206145 0.635152 0.0
+vt 0.175287 0.655627 0.0
+vt 0.059735 0.655627 0.0
+vt 0.059735 0.655627 0.0
+vt 0.175287 0.655627 0.0
+vt 0.360573 0.667743 0.0
+vt 0.360573 0.667743 0.0
+vt 0.058680 0.667743 0.0
+vt 0.059735 0.655627 0.0
+vt 0.095405 0.670416 0.0
+vt 0.058680 0.667743 0.0
+vt 0.360573 0.667743 0.0
+vt 0.360573 0.667743 0.0
+vt 0.360573 0.670416 0.0
+vt 0.095405 0.670416 0.0
+vt 0.766018 0.483396 0.0
+vt 0.704654 0.484336 0.0
+vt 0.704461 0.429051 0.0
+vt 0.400833 0.566472 0.0
+vt 0.455561 0.569620 0.0
+vt 0.266833 0.598076 0.0
+vt 0.266833 0.598076 0.0
+vt 0.288868 0.587812 0.0
+vt 0.400833 0.566472 0.0
+vt 0.367889 0.655627 0.0
+vt 0.410923 0.665990 0.0
+vt 0.363295 0.665990 0.0
+vt 0.363295 0.665990 0.0
+vt 0.181844 0.655627 0.0
+vt 0.367889 0.655627 0.0
+vt 0.501274 0.555760 0.0
+vt 0.501274 0.549958 0.0
+vt 0.493309 0.549958 0.0
+vt 0.493309 0.549958 0.0
+vt 0.495634 0.555760 0.0
+vt 0.501274 0.555760 0.0
+vt 0.492388 0.550146 0.0
+vt 0.501274 0.550146 0.0
+vt 0.501274 0.569620 0.0
+vt 0.501274 0.569620 0.0
+vt 0.455561 0.569620 0.0
+vt 0.492388 0.550146 0.0
+vt 0.414261 0.621200 0.0
+vt 0.501275 0.621200 0.0
+vt 0.501275 0.635151 0.0
+vt 0.501275 0.635151 0.0
+vt 0.407833 0.635151 0.0
+vt 0.406599 0.635071 0.0
+vt 0.414261 0.621200 0.0
+vt 0.501275 0.635151 0.0
+vt 0.406599 0.635071 0.0
+vt 0.501275 0.655625 0.0
+vt 0.501275 0.665989 0.0
+vt 0.413425 0.665989 0.0
+vt 0.413425 0.665989 0.0
+vt 0.407834 0.655625 0.0
+vt 0.501275 0.655625 0.0
+vt 0.412147 0.666280 0.0
+vt 0.360573 0.666280 0.0
+vt 0.360573 0.666280 0.0
+vt 0.360573 0.666280 0.0
+vt 0.412146 0.666280 0.0
+vt 0.412147 0.666280 0.0
+vt 0.360573 0.667743 0.0
+vt 0.175287 0.655627 0.0
+vt 0.175287 0.655627 0.0
+vt 0.175287 0.655627 0.0
+vt 0.360573 0.665834 0.0
+vt 0.360573 0.667743 0.0
+vt 0.207784 0.640714 0.0
+vt 0.207834 0.640715 0.0
+vt 0.187385 0.654249 0.0
+vt 0.187385 0.654249 0.0
+vt 0.187385 0.654249 0.0
+vt 0.207784 0.640714 0.0
+vt 0.243153 0.613313 0.0
+vt 0.267429 0.602875 0.0
+vt 0.267429 0.602907 0.0
+vt 0.267429 0.602907 0.0
+vt 0.243153 0.613348 0.0
+vt 0.243153 0.613313 0.0
+vt 0.266833 0.598076 0.0
+vt 0.455561 0.569620 0.0
+vt 0.414187 0.574940 0.0
+vt 0.414187 0.574940 0.0
+vt 0.266833 0.599399 0.0
+vt 0.266833 0.598076 0.0
+vt 0.455561 0.569620 0.0
+vt 0.501274 0.569620 0.0
+vt 0.501274 0.574940 0.0
+vt 0.501274 0.574940 0.0
+vt 0.414187 0.574940 0.0
+vt 0.455561 0.569620 0.0
+vt 0.412146 0.665962 0.0
+vt 0.412146 0.665834 0.0
+vt 0.360573 0.665834 0.0
+vt 0.412146 0.665962 0.0
+vt 0.360573 0.665834 0.0
+vt 0.363295 0.665990 0.0
+vt 0.410923 0.665990 0.0
+vt 0.412146 0.665962 0.0
+vt 0.363295 0.665990 0.0
+vt 0.363295 0.665990 0.0
+vt 0.360573 0.665834 0.0
+vt 0.175287 0.655627 0.0
+vt 0.175287 0.655627 0.0
+vt 0.181844 0.655627 0.0
+vt 0.363295 0.665990 0.0
+vt 0.175287 0.655627 0.0
+vt 0.206221 0.635152 0.0
+vt 0.212624 0.635152 0.0
+vt 0.212624 0.635152 0.0
+vt 0.181844 0.655627 0.0
+vt 0.175287 0.655627 0.0
+vt 0.395713 0.566203 0.0
+vt 0.397258 0.566398 0.0
+vt 0.285323 0.587739 0.0
+vt 0.285323 0.587739 0.0
+vt 0.288658 0.586600 0.0
+vt 0.395713 0.566203 0.0
+vt 0.228761 0.598013 0.0
+vt 0.231420 0.598013 0.0
+vt 0.146789 0.613803 0.0
+vt 0.146789 0.613803 0.0
+vt 0.144215 0.613803 0.0
+vt 0.228761 0.598013 0.0
+vt 0.146703 0.613842 0.0
+vt 0.104930 0.635127 0.0
+vt 0.102369 0.635127 0.0
+vt 0.102369 0.635127 0.0
+vt 0.144130 0.613842 0.0
+vt 0.146703 0.613842 0.0
+vt 0.053593 0.655626 0.0
+vt 0.055950 0.655625 0.0
+vt 0.054612 0.667742 0.0
+vt 0.054612 0.667742 0.0
+vt 0.052645 0.667743 0.0
+vt 0.053593 0.655626 0.0
+vt 0.053359 0.667899 0.0
+vt 0.055327 0.667899 0.0
+vt 0.061886 0.670572 0.0
+vt 0.061886 0.670572 0.0
+vt 0.059896 0.670572 0.0
+vt 0.053359 0.667899 0.0
+vt 0.288659 0.586600 0.0
+vt 0.285324 0.587739 0.0
+vt 0.231454 0.598003 0.0
+vt 0.231454 0.598003 0.0
+vt 0.228796 0.598003 0.0
+vt 0.288659 0.586600 0.0
+vt 0.489290 0.549852 0.0
+vt 0.488350 0.550042 0.0
+vt 0.397416 0.566383 0.0
+vt 0.397416 0.566383 0.0
+vt 0.395888 0.566187 0.0
+vt 0.489290 0.549852 0.0
+vt 0.505054 0.466688 0.0
+vt 0.394847 0.461720 0.0
+vt 0.394654 0.406416 0.0
+vt 0.394654 0.406416 0.0
+vt 0.504862 0.411387 0.0
+vt 0.505054 0.466688 0.0
+vt 0.150385 0.613867 0.0
+vt 0.230109 0.613867 0.0
+vt 0.206145 0.635152 0.0
+vt 0.206145 0.635152 0.0
+vt 0.108620 0.635152 0.0
+vt 0.150385 0.613867 0.0
+vt 0.367889 0.655627 0.0
+vt 0.181844 0.655627 0.0
+vt 0.212624 0.635152 0.0
+vt 0.212624 0.635152 0.0
+vt 0.367908 0.635152 0.0
+vt 0.367889 0.655627 0.0
+vt 0.232930 0.619561 0.0
+vt 0.232930 0.619596 0.0
+vt 0.217139 0.633631 0.0
+vt 0.217139 0.633631 0.0
+vt 0.217089 0.633631 0.0
+vt 0.232930 0.619561 0.0
+vt 0.059735 0.655627 0.0
+vt 0.057378 0.655627 0.0
+vt 0.106059 0.635152 0.0
+vt 0.106059 0.635152 0.0
+vt 0.108620 0.635152 0.0
+vt 0.059735 0.655627 0.0
+vt 0.175287 0.655627 0.0
+vt 0.206145 0.635152 0.0
+vt 0.200922 0.640674 0.0
+vt 0.200922 0.640674 0.0
+vt 0.180523 0.654208 0.0
+vt 0.175287 0.655627 0.0
+vt 0.206145 0.635152 0.0
+vt 0.206221 0.635152 0.0
+vt 0.200972 0.640674 0.0
+vt 0.200972 0.640674 0.0
+vt 0.200922 0.640674 0.0
+vt 0.206145 0.635152 0.0
+vt 0.206221 0.635152 0.0
+vt 0.175287 0.655627 0.0
+vt 0.180523 0.654208 0.0
+vt 0.180523 0.654208 0.0
+vt 0.200972 0.640674 0.0
+vt 0.206221 0.635152 0.0
+vt 0.175287 0.655627 0.0
+vt 0.175287 0.655627 0.0
+vt 0.180523 0.654208 0.0
+vt 0.180523 0.654208 0.0
+vt 0.180523 0.654208 0.0
+vt 0.175287 0.655627 0.0
+vt 0.230109 0.613867 0.0
+vt 0.266833 0.598076 0.0
+vt 0.260609 0.602812 0.0
+vt 0.260609 0.602812 0.0
+vt 0.236333 0.613250 0.0
+vt 0.230109 0.613867 0.0
+vt 0.266833 0.598076 0.0
+vt 0.266833 0.599399 0.0
+vt 0.260609 0.602845 0.0
+vt 0.260609 0.602845 0.0
+vt 0.260609 0.602812 0.0
+vt 0.266833 0.598076 0.0
+vt 0.266833 0.599399 0.0
+vt 0.230109 0.613919 0.0
+vt 0.236333 0.613285 0.0
+vt 0.236333 0.613285 0.0
+vt 0.260609 0.602845 0.0
+vt 0.266833 0.599399 0.0
+vt 0.230109 0.613919 0.0
+vt 0.230109 0.613867 0.0
+vt 0.236333 0.613250 0.0
+vt 0.236333 0.613250 0.0
+vt 0.236333 0.613285 0.0
+vt 0.230109 0.613919 0.0
+vt 0.206145 0.635152 0.0
+vt 0.230109 0.613867 0.0
+vt 0.226054 0.619530 0.0
+vt 0.226054 0.619530 0.0
+vt 0.210213 0.633601 0.0
+vt 0.206145 0.635152 0.0
+vt 0.230109 0.613867 0.0
+vt 0.230109 0.613919 0.0
+vt 0.226054 0.619565 0.0
+vt 0.226054 0.619565 0.0
+vt 0.226054 0.619530 0.0
+vt 0.230109 0.613867 0.0
+vt 0.230109 0.613919 0.0
+vt 0.206221 0.635152 0.0
+vt 0.210264 0.633601 0.0
+vt 0.210264 0.633601 0.0
+vt 0.226054 0.619565 0.0
+vt 0.230109 0.613919 0.0
+vt 0.206221 0.635152 0.0
+vt 0.206145 0.635152 0.0
+vt 0.210213 0.633601 0.0
+vt 0.210213 0.633601 0.0
+vt 0.210264 0.633601 0.0
+vt 0.206221 0.635152 0.0
+vt 0.180523 0.654208 0.0
+vt 0.200922 0.640674 0.0
+vt 0.207784 0.640714 0.0
+vt 0.207784 0.640714 0.0
+vt 0.187385 0.654249 0.0
+vt 0.180523 0.654208 0.0
+vt 0.200922 0.640674 0.0
+vt 0.200972 0.640674 0.0
+vt 0.207834 0.640715 0.0
+vt 0.207834 0.640715 0.0
+vt 0.207784 0.640714 0.0
+vt 0.200922 0.640674 0.0
+vt 0.200972 0.640674 0.0
+vt 0.180523 0.654208 0.0
+vt 0.187385 0.654249 0.0
+vt 0.187385 0.654249 0.0
+vt 0.207834 0.640715 0.0
+vt 0.200972 0.640674 0.0
+vt 0.180523 0.654208 0.0
+vt 0.180523 0.654208 0.0
+vt 0.187385 0.654249 0.0
+vt 0.187385 0.654249 0.0
+vt 0.187385 0.654249 0.0
+vt 0.180523 0.654208 0.0
+vt 0.236333 0.613250 0.0
+vt 0.260609 0.602812 0.0
+vt 0.267429 0.602875 0.0
+vt 0.267429 0.602875 0.0
+vt 0.243153 0.613313 0.0
+vt 0.236333 0.613250 0.0
+vt 0.260609 0.602812 0.0
+vt 0.260609 0.602845 0.0
+vt 0.267429 0.602907 0.0
+vt 0.267429 0.602907 0.0
+vt 0.267429 0.602875 0.0
+vt 0.260609 0.602812 0.0
+vt 0.260609 0.602845 0.0
+vt 0.236333 0.613285 0.0
+vt 0.243153 0.613348 0.0
+vt 0.243153 0.613348 0.0
+vt 0.267429 0.602907 0.0
+vt 0.260609 0.602845 0.0
+vt 0.236333 0.613285 0.0
+vt 0.236333 0.613250 0.0
+vt 0.243153 0.613313 0.0
+vt 0.243153 0.613313 0.0
+vt 0.243153 0.613348 0.0
+vt 0.236333 0.613285 0.0
+vt 0.210213 0.633601 0.0
+vt 0.226054 0.619530 0.0
+vt 0.232930 0.619561 0.0
+vt 0.232930 0.619561 0.0
+vt 0.217089 0.633631 0.0
+vt 0.210213 0.633601 0.0
+vt 0.226054 0.619530 0.0
+vt 0.226054 0.619565 0.0
+vt 0.232930 0.619596 0.0
+vt 0.232930 0.619596 0.0
+vt 0.232930 0.619561 0.0
+vt 0.226054 0.619530 0.0
+vt 0.226054 0.619565 0.0
+vt 0.210264 0.633601 0.0
+vt 0.217139 0.633631 0.0
+vt 0.217139 0.633631 0.0
+vt 0.232930 0.619596 0.0
+vt 0.226054 0.619565 0.0
+vt 0.210264 0.633601 0.0
+vt 0.210213 0.633601 0.0
+vt 0.217089 0.633631 0.0
+vt 0.217089 0.633631 0.0
+vt 0.217139 0.633631 0.0
+vt 0.210264 0.633601 0.0
+vt 0.399288 0.566276 0.0
+vt 0.400833 0.566472 0.0
+vt 0.397258 0.566398 0.0
+vt 0.397258 0.566398 0.0
+vt 0.395713 0.566203 0.0
+vt 0.399288 0.566276 0.0
+vt 0.400833 0.566472 0.0
+vt 0.288868 0.587812 0.0
+vt 0.285323 0.587739 0.0
+vt 0.285323 0.587739 0.0
+vt 0.397258 0.566398 0.0
+vt 0.400833 0.566472 0.0
+vt 0.759898 0.486365 0.0
+vt 0.766018 0.483396 0.0
+vt 0.766431 0.488644 0.0
+vt 0.766431 0.488644 0.0
+vt 0.760311 0.491611 0.0
+vt 0.759898 0.486365 0.0
+vt 0.766018 0.483396 0.0
+vt 0.875784 0.481726 0.0
+vt 0.876200 0.486936 0.0
+vt 0.876200 0.486936 0.0
+vt 0.766431 0.488644 0.0
+vt 0.766018 0.483396 0.0
+vt 0.232332 0.598076 0.0
+vt 0.234990 0.598076 0.0
+vt 0.231420 0.598013 0.0
+vt 0.231420 0.598013 0.0
+vt 0.228761 0.598013 0.0
+vt 0.232332 0.598076 0.0
+vt 0.234990 0.598076 0.0
+vt 0.150385 0.613867 0.0
+vt 0.146789 0.613803 0.0
+vt 0.146789 0.613803 0.0
+vt 0.231420 0.598013 0.0
+vt 0.234990 0.598076 0.0
+vt 0.150385 0.613867 0.0
+vt 0.147812 0.613867 0.0
+vt 0.144215 0.613803 0.0
+vt 0.144215 0.613803 0.0
+vt 0.146789 0.613803 0.0
+vt 0.150385 0.613867 0.0
+vt 0.619623 0.470645 0.0
+vt 0.704654 0.484336 0.0
+vt 0.705011 0.489611 0.0
+vt 0.705011 0.489611 0.0
+vt 0.619985 0.475887 0.0
+vt 0.619623 0.470645 0.0
+vt 0.147812 0.613867 0.0
+vt 0.150385 0.613867 0.0
+vt 0.146703 0.613842 0.0
+vt 0.146703 0.613842 0.0
+vt 0.144130 0.613842 0.0
+vt 0.147812 0.613867 0.0
+vt 0.150385 0.613867 0.0
+vt 0.108620 0.635152 0.0
+vt 0.104930 0.635127 0.0
+vt 0.104930 0.635127 0.0
+vt 0.146703 0.613842 0.0
+vt 0.150385 0.613867 0.0
+vt 0.108620 0.635152 0.0
+vt 0.106059 0.635152 0.0
+vt 0.102369 0.635127 0.0
+vt 0.102369 0.635127 0.0
+vt 0.104930 0.635127 0.0
+vt 0.108620 0.635152 0.0
+vt 0.505054 0.466688 0.0
+vt 0.619623 0.470645 0.0
+vt 0.619776 0.475928 0.0
+vt 0.619776 0.475928 0.0
+vt 0.505208 0.471961 0.0
+vt 0.505054 0.466688 0.0
+vt 0.057378 0.655627 0.0
+vt 0.059735 0.655627 0.0
+vt 0.055950 0.655625 0.0
+vt 0.055950 0.655625 0.0
+vt 0.053593 0.655626 0.0
+vt 0.057378 0.655627 0.0
+vt 0.059735 0.655627 0.0
+vt 0.058680 0.667743 0.0
+vt 0.054612 0.667742 0.0
+vt 0.054612 0.667742 0.0
+vt 0.055950 0.655625 0.0
+vt 0.059735 0.655627 0.0
+vt 0.058680 0.667743 0.0
+vt 0.056714 0.667743 0.0
+vt 0.052645 0.667743 0.0
+vt 0.052645 0.667743 0.0
+vt 0.054612 0.667742 0.0
+vt 0.058680 0.667743 0.0
+vt 0.329640 0.462087 0.0
+vt 0.394847 0.461720 0.0
+vt 0.394866 0.466910 0.0
+vt 0.394866 0.466910 0.0
+vt 0.329659 0.466869 0.0
+vt 0.329640 0.462087 0.0
+vt 0.056714 0.667743 0.0
+vt 0.058680 0.667743 0.0
+vt 0.055327 0.667899 0.0
+vt 0.055327 0.667899 0.0
+vt 0.053359 0.667899 0.0
+vt 0.056714 0.667743 0.0
+vt 0.058680 0.667743 0.0
+vt 0.095405 0.670416 0.0
+vt 0.061886 0.670572 0.0
+vt 0.061886 0.670572 0.0
+vt 0.055327 0.667899 0.0
+vt 0.058680 0.667743 0.0
+vt 0.315102 0.418375 0.0
+vt 0.329640 0.462087 0.0
+vt 0.328818 0.466681 0.0
+vt 0.292202 0.586673 0.0
+vt 0.288868 0.587812 0.0
+vt 0.285324 0.587739 0.0
+vt 0.285324 0.587739 0.0
+vt 0.288659 0.586600 0.0
+vt 0.292202 0.586673 0.0
+vt 0.288868 0.587812 0.0
+vt 0.234990 0.598076 0.0
+vt 0.231454 0.598003 0.0
+vt 0.231454 0.598003 0.0
+vt 0.285324 0.587739 0.0
+vt 0.288868 0.587812 0.0
+vt 0.234990 0.598076 0.0
+vt 0.232332 0.598076 0.0
+vt 0.228796 0.598003 0.0
+vt 0.228796 0.598003 0.0
+vt 0.231454 0.598003 0.0
+vt 0.234990 0.598076 0.0
+vt 0.704654 0.484336 0.0
+vt 0.766018 0.483396 0.0
+vt 0.766431 0.488645 0.0
+vt 0.766431 0.488645 0.0
+vt 0.705066 0.489594 0.0
+vt 0.704654 0.484336 0.0
+vt 0.493309 0.549958 0.0
+vt 0.492388 0.550146 0.0
+vt 0.488350 0.550042 0.0
+vt 0.488350 0.550042 0.0
+vt 0.489290 0.549852 0.0
+vt 0.493309 0.549958 0.0
+vt 0.492388 0.550146 0.0
+vt 0.400833 0.566472 0.0
+vt 0.397416 0.566383 0.0
+vt 0.397416 0.566383 0.0
+vt 0.488350 0.550042 0.0
+vt 0.492388 0.550146 0.0
+vt 0.400833 0.566472 0.0
+vt 0.399288 0.566276 0.0
+vt 0.395888 0.566187 0.0
+vt 0.395888 0.566187 0.0
+vt 0.397416 0.566383 0.0
+vt 0.400833 0.566472 0.0
+vt 0.875784 0.481726 0.0
+vt 0.963603 0.480890 0.0
+vt 0.964189 0.484803 0.0
+vt 0.964189 0.484803 0.0
+vt 0.876285 0.487022 0.0
+vt 0.875784 0.481726 0.0
+vt 0.492388 0.550146 0.0
+vt 0.493309 0.549958 0.0
+vt 0.493309 0.549752 0.0
+vt 0.493309 0.549752 0.0
+vt 0.492388 0.549940 0.0
+vt 0.492388 0.550146 0.0
+vt 0.501274 0.549958 0.0
+vt 0.501274 0.549752 0.0
+vt 0.493309 0.549752 0.0
+vt 0.493309 0.549752 0.0
+vt 0.493309 0.549958 0.0
+vt 0.501274 0.549958 0.0
+vt 0.360573 0.670416 0.0
+vt 0.360573 0.667743 0.0
+vt 0.360573 0.666208 0.0
+vt 0.360573 0.666208 0.0
+vt 0.360573 0.666208 0.0
+vt 0.360573 0.667743 0.0
+vt 0.360573 0.667743 0.0
+vt 0.360573 0.665834 0.0
+vt 0.360573 0.666208 0.0
+vt 0.360573 0.665906 0.0
+vt 0.412146 0.665906 0.0
+vt 0.412146 0.666280 0.0
+vt 0.412146 0.666280 0.0
+vt 0.360573 0.666280 0.0
+vt 0.360573 0.665906 0.0
+vt 0.501275 0.665834 0.0
+vt 0.501275 0.666208 0.0
+vt 0.412146 0.666208 0.0
+vt 0.412146 0.666208 0.0
+vt 0.412146 0.665834 0.0
+vt 0.501275 0.665834 0.0
+vt 0.412146 0.665990 0.0
+vt 0.370144 0.655627 0.0
+vt 0.405433 0.655625 0.0
+vt 0.405433 0.655625 0.0
+vt 0.412146 0.665989 0.0
+vt 0.412146 0.665990 0.0
+vt 0.370144 0.655627 0.0
+vt 0.370131 0.635152 0.0
+vt 0.405433 0.635151 0.0
+vt 0.405433 0.635151 0.0
+vt 0.405433 0.655625 0.0
+vt 0.370144 0.655627 0.0
+vt 0.412147 0.665707 0.0
+vt 0.412146 0.665707 0.0
+vt 0.501275 0.665707 0.0
+vt 0.501275 0.665707 0.0
+vt 0.501275 0.665707 0.0
+vt 0.412147 0.665707 0.0
+vt 0.412146 0.665834 0.0
+vt 0.412146 0.665962 0.0
+vt 0.413330 0.665990 0.0
+vt 0.412146 0.665834 0.0
+vt 0.413330 0.665990 0.0
+vt 0.501275 0.665990 0.0
+vt 0.501275 0.665834 0.0
+vt 0.412146 0.665834 0.0
+vt 0.501275 0.665990 0.0
+vt 0.501274 0.549940 0.0
+vt 0.492388 0.549940 0.0
+vt 0.493309 0.549752 0.0
+vt 0.493309 0.549752 0.0
+vt 0.501274 0.549752 0.0
+vt 0.501274 0.549940 0.0
+vt 0.407834 0.655625 0.0
+vt 0.407833 0.635151 0.0
+vt 0.501275 0.635151 0.0
+vt 0.501275 0.635151 0.0
+vt 0.501275 0.655625 0.0
+vt 0.407834 0.655625 0.0
+vt 0.492388 0.550146 0.0
+vt 0.492388 0.549940 0.0
+vt 0.501274 0.549940 0.0
+vt 0.501274 0.549940 0.0
+vt 0.501274 0.550146 0.0
+vt 0.492388 0.550146 0.0
+vt 0.501275 0.665990 0.0
+vt 0.413330 0.665990 0.0
+vt 0.412146 0.665990 0.0
+vt 0.412146 0.665990 0.0
+vt 0.412146 0.665989 0.0
+vt 0.413425 0.665989 0.0
+vt 0.412146 0.665990 0.0
+vt 0.413425 0.665989 0.0
+vt 0.501275 0.665989 0.0
+vt 0.501275 0.665990 0.0
+vt 0.412146 0.665990 0.0
+vt 0.501275 0.665989 0.0
+vt 0.412147 0.666208 0.0
+vt 0.412146 0.666208 0.0
+vt 0.412146 0.665707 0.0
+vt 0.412146 0.665707 0.0
+vt 0.412147 0.665707 0.0
+vt 0.412147 0.666208 0.0
+vt 0.412146 0.666208 0.0
+vt 0.501275 0.666208 0.0
+vt 0.501275 0.665707 0.0
+vt 0.501275 0.665707 0.0
+vt 0.412146 0.665707 0.0
+vt 0.412146 0.666208 0.0
+vt 0.501275 0.666208 0.0
+vt 0.412147 0.666208 0.0
+vt 0.412147 0.665707 0.0
+vt 0.412147 0.665707 0.0
+vt 0.501275 0.665707 0.0
+vt 0.501275 0.666208 0.0
+vt 0.286997 0.602134 0.0
+vt 0.346695 0.606565 0.0
+vt 0.307641 0.608787 0.0
+vt 0.307641 0.608787 0.0
+vt 0.266914 0.606916 0.0
+vt 0.286997 0.602134 0.0
+vt 0.393795 0.614954 0.0
+vt 0.316607 0.615293 0.0
+vt 0.307641 0.608787 0.0
+vt 0.393795 0.614954 0.0
+vt 0.307641 0.608787 0.0
+vt 0.346695 0.606565 0.0
+vt 0.394576 0.614875 0.0
+vt 0.393795 0.614954 0.0
+vt 0.346695 0.606565 0.0
+vt 0.256800 0.614825 0.0
+vt 0.266914 0.606916 0.0
+vt 0.307641 0.608787 0.0
+vt 0.307641 0.608787 0.0
+vt 0.316607 0.615293 0.0
+vt 0.256800 0.614825 0.0
+vt 0.256800 0.614825 0.0
+vt 0.316607 0.615293 0.0
+vt 0.308100 0.624538 0.0
+vt 0.308100 0.624538 0.0
+vt 0.244611 0.624538 0.0
+vt 0.256800 0.614825 0.0
+vt 0.393795 0.614954 0.0
+vt 0.371963 0.624980 0.0
+vt 0.308100 0.624538 0.0
+vt 0.308100 0.624538 0.0
+vt 0.316607 0.615293 0.0
+vt 0.393795 0.614954 0.0
+vt 0.308100 0.624538 0.0
+vt 0.368689 0.635082 0.0
+vt 0.367908 0.635152 0.0
+vt 0.367908 0.635152 0.0
+vt 0.212624 0.635152 0.0
+vt 0.308100 0.624538 0.0
+vt 0.373109 0.625062 0.0
+vt 0.369121 0.635078 0.0
+vt 0.368689 0.635082 0.0
+vt 0.373109 0.625062 0.0
+vt 0.368689 0.635082 0.0
+vt 0.308100 0.624538 0.0
+vt 0.371963 0.624980 0.0
+vt 0.373109 0.625062 0.0
+vt 0.308100 0.624538 0.0
+vt 0.212624 0.635152 0.0
+vt 0.244611 0.624538 0.0
+vt 0.308100 0.624538 0.0
+vt 0.409420 0.580908 0.0
+vt 0.451982 0.578682 0.0
+vt 0.424672 0.587629 0.0
+vt 0.424672 0.587629 0.0
+vt 0.366275 0.587572 0.0
+vt 0.409420 0.580908 0.0
+vt 0.501274 0.578682 0.0
+vt 0.501274 0.587629 0.0
+vt 0.424672 0.587629 0.0
+vt 0.424672 0.587629 0.0
+vt 0.451982 0.578682 0.0
+vt 0.501274 0.578682 0.0
+vt 0.501275 0.598073 0.0
+vt 0.398111 0.597869 0.0
+vt 0.424672 0.587629 0.0
+vt 0.424672 0.587629 0.0
+vt 0.501274 0.587629 0.0
+vt 0.501275 0.598073 0.0
+vt 0.317895 0.596725 0.0
+vt 0.366275 0.587572 0.0
+vt 0.424672 0.587629 0.0
+vt 0.424672 0.587629 0.0
+vt 0.398111 0.597869 0.0
+vt 0.317895 0.596725 0.0
+vt 0.266833 0.599399 0.0
+vt 0.289003 0.596328 0.0
+vt 0.270990 0.599107 0.0
+vt 0.265363 0.600865 0.0
+vt 0.266833 0.599399 0.0
+vt 0.270990 0.599107 0.0
+vt 0.317895 0.596725 0.0
+vt 0.302432 0.600516 0.0
+vt 0.270990 0.599107 0.0
+vt 0.270990 0.599107 0.0
+vt 0.289003 0.596328 0.0
+vt 0.317895 0.596725 0.0
+vt 0.286997 0.602134 0.0
+vt 0.265363 0.600865 0.0
+vt 0.270990 0.599107 0.0
+vt 0.270990 0.599107 0.0
+vt 0.302432 0.600516 0.0
+vt 0.286997 0.602134 0.0
+vt 0.256800 0.614825 0.0
+vt 0.234804 0.614705 0.0
+vt 0.251391 0.606439 0.0
+vt 0.251391 0.606439 0.0
+vt 0.266914 0.606916 0.0
+vt 0.256800 0.614825 0.0
+vt 0.230109 0.613919 0.0
+vt 0.266833 0.599399 0.0
+vt 0.251391 0.606439 0.0
+vt 0.234804 0.614705 0.0
+vt 0.230109 0.613919 0.0
+vt 0.251391 0.606439 0.0
+vt 0.266833 0.599399 0.0
+vt 0.265363 0.600865 0.0
+vt 0.251391 0.606439 0.0
+vt 0.286997 0.602134 0.0
+vt 0.266914 0.606916 0.0
+vt 0.251391 0.606439 0.0
+vt 0.251391 0.606439 0.0
+vt 0.265363 0.600865 0.0
+vt 0.286997 0.602134 0.0
+vt 0.317895 0.596725 0.0
+vt 0.289003 0.596328 0.0
+vt 0.344289 0.587399 0.0
+vt 0.344289 0.587399 0.0
+vt 0.366275 0.587572 0.0
+vt 0.317895 0.596725 0.0
+vt 0.266833 0.599399 0.0
+vt 0.414187 0.574940 0.0
+vt 0.344289 0.587399 0.0
+vt 0.289003 0.596328 0.0
+vt 0.266833 0.599399 0.0
+vt 0.344289 0.587399 0.0
+vt 0.414187 0.574940 0.0
+vt 0.410115 0.578396 0.0
+vt 0.344289 0.587399 0.0
+vt 0.409420 0.580908 0.0
+vt 0.366275 0.587572 0.0
+vt 0.344289 0.587399 0.0
+vt 0.344289 0.587399 0.0
+vt 0.410115 0.578396 0.0
+vt 0.409420 0.580908 0.0
+vt 0.409420 0.580908 0.0
+vt 0.410115 0.578396 0.0
+vt 0.459744 0.575395 0.0
+vt 0.459744 0.575395 0.0
+vt 0.451982 0.578682 0.0
+vt 0.409420 0.580908 0.0
+vt 0.414187 0.574940 0.0
+vt 0.501274 0.574940 0.0
+vt 0.459744 0.575395 0.0
+vt 0.410115 0.578396 0.0
+vt 0.414187 0.574940 0.0
+vt 0.459744 0.575395 0.0
+vt 0.501274 0.574940 0.0
+vt 0.501274 0.575395 0.0
+vt 0.459744 0.575395 0.0
+vt 0.501274 0.578682 0.0
+vt 0.451982 0.578682 0.0
+vt 0.459744 0.575395 0.0
+vt 0.459744 0.575395 0.0
+vt 0.501274 0.575395 0.0
+vt 0.501274 0.578682 0.0
+vt 0.206221 0.635152 0.0
+vt 0.230109 0.613919 0.0
+vt 0.221334 0.624537 0.0
+vt 0.230109 0.613919 0.0
+vt 0.234804 0.614705 0.0
+vt 0.221334 0.624537 0.0
+vt 0.256800 0.614825 0.0
+vt 0.244611 0.624538 0.0
+vt 0.221334 0.624537 0.0
+vt 0.221334 0.624537 0.0
+vt 0.234804 0.614705 0.0
+vt 0.256800 0.614825 0.0
+vt 0.212624 0.635152 0.0
+vt 0.206221 0.635152 0.0
+vt 0.221334 0.624537 0.0
+vt 0.244611 0.624538 0.0
+vt 0.212624 0.635152 0.0
+vt 0.221334 0.624537 0.0
+vt 0.369121 0.635078 0.0
+vt 0.373109 0.625062 0.0
+vt 0.374190 0.625039 0.0
+vt 0.369121 0.635078 0.0
+vt 0.374190 0.625039 0.0
+vt 0.401062 0.626338 0.0
+vt 0.369353 0.635080 0.0
+vt 0.369121 0.635078 0.0
+vt 0.401062 0.626338 0.0
+vt 0.395357 0.615063 0.0
+vt 0.414078 0.621054 0.0
+vt 0.414116 0.621199 0.0
+vt 0.395357 0.615063 0.0
+vt 0.414116 0.621199 0.0
+vt 0.401062 0.626338 0.0
+vt 0.395357 0.615063 0.0
+vt 0.401062 0.626338 0.0
+vt 0.374190 0.625039 0.0
+vt 0.414261 0.621200 0.0
+vt 0.406599 0.635071 0.0
+vt 0.406505 0.635071 0.0
+vt 0.414261 0.621200 0.0
+vt 0.406505 0.635071 0.0
+vt 0.401062 0.626338 0.0
+vt 0.414116 0.621199 0.0
+vt 0.414261 0.621200 0.0
+vt 0.401062 0.626338 0.0
+vt 0.405433 0.635151 0.0
+vt 0.370131 0.635152 0.0
+vt 0.369353 0.635080 0.0
+vt 0.405433 0.635151 0.0
+vt 0.369353 0.635080 0.0
+vt 0.401062 0.626338 0.0
+vt 0.406505 0.635071 0.0
+vt 0.405433 0.635151 0.0
+vt 0.401062 0.626338 0.0
+vt 0.395357 0.615063 0.0
+vt 0.441743 0.612678 0.0
+vt 0.457788 0.617525 0.0
+vt 0.457788 0.617525 0.0
+vt 0.415185 0.621053 0.0
+vt 0.414078 0.621054 0.0
+vt 0.395357 0.615063 0.0
+vt 0.457788 0.617525 0.0
+vt 0.414078 0.621054 0.0
+vt 0.501275 0.612166 0.0
+vt 0.501275 0.621052 0.0
+vt 0.500391 0.621053 0.0
+vt 0.501275 0.612166 0.0
+vt 0.500391 0.621053 0.0
+vt 0.457788 0.617525 0.0
+vt 0.500636 0.612172 0.0
+vt 0.501275 0.612166 0.0
+vt 0.457788 0.617525 0.0
+vt 0.441743 0.612678 0.0
+vt 0.500636 0.612172 0.0
+vt 0.457788 0.617525 0.0
+vt 0.500391 0.621053 0.0
+vt 0.415185 0.621053 0.0
+vt 0.457788 0.617525 0.0
+vt 0.500258 0.612026 0.0
+vt 0.441031 0.612530 0.0
+vt 0.392598 0.605035 0.0
+vt 0.501275 0.605850 0.0
+vt 0.501275 0.612018 0.0
+vt 0.500258 0.612026 0.0
+vt 0.500258 0.612026 0.0
+vt 0.392598 0.605035 0.0
+vt 0.501275 0.605850 0.0
+vt 0.394576 0.614875 0.0
+vt 0.346695 0.606565 0.0
+vt 0.392598 0.605035 0.0
+vt 0.392598 0.605035 0.0
+vt 0.441031 0.612530 0.0
+vt 0.394576 0.614875 0.0
+vt 0.286997 0.602134 0.0
+vt 0.302432 0.600516 0.0
+vt 0.392598 0.605035 0.0
+vt 0.392598 0.605035 0.0
+vt 0.346695 0.606565 0.0
+vt 0.286997 0.602134 0.0
+vt 0.317895 0.596725 0.0
+vt 0.398111 0.597869 0.0
+vt 0.392598 0.605035 0.0
+vt 0.392598 0.605035 0.0
+vt 0.302432 0.600516 0.0
+vt 0.317895 0.596725 0.0
+vt 0.501275 0.598073 0.0
+vt 0.501275 0.605850 0.0
+vt 0.392598 0.605035 0.0
+vt 0.392598 0.605035 0.0
+vt 0.398111 0.597869 0.0
+vt 0.501275 0.598073 0.0
+vt 0.360573 0.666208 0.0
+vt 0.360573 0.666208 0.0
+vt 0.360573 0.666280 0.0
+vt 0.360573 0.666280 0.0
+vt 0.360573 0.666280 0.0
+vt 0.360573 0.666208 0.0
+vt 0.360573 0.666208 0.0
+vt 0.360573 0.665834 0.0
+vt 0.360573 0.665906 0.0
+vt 0.360573 0.665906 0.0
+vt 0.360573 0.666280 0.0
+vt 0.360573 0.666208 0.0
+vt 0.360573 0.665834 0.0
+vt 0.412146 0.665834 0.0
+vt 0.412146 0.665906 0.0
+vt 0.412146 0.665906 0.0
+vt 0.360573 0.665906 0.0
+vt 0.360573 0.665834 0.0
+vt 0.412146 0.665834 0.0
+vt 0.412146 0.666208 0.0
+vt 0.412146 0.666280 0.0
+vt 0.412146 0.666280 0.0
+vt 0.412146 0.665906 0.0
+vt 0.412146 0.665834 0.0
+vt 0.412146 0.666208 0.0
+vt 0.412147 0.666208 0.0
+vt 0.412147 0.666280 0.0
+vt 0.412147 0.666280 0.0
+vt 0.412146 0.666280 0.0
+vt 0.412146 0.666208 0.0
+vt 0.405433 0.635151 0.0
+vt 0.406505 0.635071 0.0
+vt 0.406599 0.635071 0.0
+vt 0.406599 0.635071 0.0
+vt 0.407833 0.635151 0.0
+vt 0.405433 0.635151 0.0
+vt 0.413425 0.665989 0.0
+vt 0.412146 0.665989 0.0
+vt 0.405433 0.655625 0.0
+vt 0.405433 0.655625 0.0
+vt 0.407834 0.655625 0.0
+vt 0.413425 0.665989 0.0
+vt 0.405433 0.635151 0.0
+vt 0.407833 0.635151 0.0
+vt 0.407834 0.655625 0.0
+vt 0.407834 0.655625 0.0
+vt 0.405433 0.655625 0.0
+vt 0.405433 0.635151 0.0
+vt 0.412146 0.665990 0.0
+vt 0.413330 0.665990 0.0
+vt 0.412146 0.665962 0.0
+vt 0.412146 0.665962 0.0
+vt 0.410923 0.665990 0.0
+vt 0.412146 0.665...
[truncated message content] |
|
From: <tre...@us...> - 2007-06-28 21:33:20
|
Revision: 200
http://ogoglio.svn.sourceforge.net/ogoglio/?rev=200&view=rev
Author: trevorolio
Date: 2007-06-28 14:33:22 -0700 (Thu, 28 Jun 2007)
Log Message:
-----------
Tweaked the space client to allow longer for initial authentication and to give a reasonable error message when it times out.
Modified Paths:
--------------
spaces/trunk/src/com/ogoglio/client/SpaceClient.java
spaces/trunk/src/com/ogoglio/viewer/applet/AppletTestWindow.java
Modified: spaces/trunk/src/com/ogoglio/client/SpaceClient.java
===================================================================
--- spaces/trunk/src/com/ogoglio/client/SpaceClient.java 2007-06-27 19:35:10 UTC (rev 199)
+++ spaces/trunk/src/com/ogoglio/client/SpaceClient.java 2007-06-28 21:33:22 UTC (rev 200)
@@ -75,7 +75,6 @@
ArgumentUtils.assertNotNull(serviceURI);
ArgumentUtils.assertNotNull(authCookie);
webClient = new WebAPIClient(spaceURI, serviceURI, authCookie);
-
ArgumentUtils.assertNotNull(listener);
this.listener = listener;
@@ -91,7 +90,7 @@
messenger.authenticate(authCookie);
long startWait = System.currentTimeMillis();
- while (System.currentTimeMillis() < startWait + 10000 && messenger.authStatus == messenger.INIT_STATUS) {
+ while (System.currentTimeMillis() < startWait + 45000 && messenger.authStatus == messenger.INIT_STATUS) {
try {
Thread.sleep(100);
} catch (Exception e) {
@@ -99,8 +98,14 @@
}
if (messenger.authStatus != messenger.SUCCESS_STATUS) {
+ System.out.println("No auth, message " + messenger.errorMessage);
+
messenger.cleanup();
- throw new IOException(messenger.errorMessage);
+ if(messenger.errorMessage == null) {
+ throw new IOException("This viewer could not get the go-ahead.");
+ } else {
+ throw new IOException(messenger.errorMessage);
+ }
}
UserDocument[] userDocs = webClient.getUserDocuments();
Modified: spaces/trunk/src/com/ogoglio/viewer/applet/AppletTestWindow.java
===================================================================
--- spaces/trunk/src/com/ogoglio/viewer/applet/AppletTestWindow.java 2007-06-27 19:35:10 UTC (rev 199)
+++ spaces/trunk/src/com/ogoglio/viewer/applet/AppletTestWindow.java 2007-06-28 21:33:22 UTC (rev 200)
@@ -26,8 +26,6 @@
import java.net.URL;
import java.util.HashMap;
-import com.ogoglio.persist.TestPersistTasks;
-
public class AppletTestWindow extends Frame {
//static Dimension appDimension = new Dimension(640, 500);
@@ -38,7 +36,7 @@
EnvironmentStub clientStub1 = null;
- String host = "marcel.local:8080";
+ String host = "localhost:8080";
String serviceURI = "http://" + host + "/og/";
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <tre...@us...> - 2007-06-27 19:35:32
|
Revision: 199
http://ogoglio.svn.sourceforge.net/ogoglio/?rev=199&view=rev
Author: trevorolio
Date: 2007-06-27 12:35:10 -0700 (Wed, 27 Jun 2007)
Log Message:
-----------
Added a tool for duplicating the things, doors, and settings of a space into another space.
Modified Paths:
--------------
spaces/trunk/src/com/ogoglio/client/WebAPIClient.java
Added Paths:
-----------
spaces/trunk/src/com/ogoglio/client/SpaceDuplicator.java
spaces/trunk/src/com/ogoglio/client/SpaceDuplicatorTests.java
Added: spaces/trunk/src/com/ogoglio/client/SpaceDuplicator.java
===================================================================
--- spaces/trunk/src/com/ogoglio/client/SpaceDuplicator.java (rev 0)
+++ spaces/trunk/src/com/ogoglio/client/SpaceDuplicator.java 2007-06-27 19:35:10 UTC (rev 199)
@@ -0,0 +1,155 @@
+package com.ogoglio.client;
+
+import java.io.IOException;
+import java.net.URI;
+import java.net.URISyntaxException;
+import java.util.Map;
+
+import com.ogoglio.util.ArgumentUtils;
+import com.ogoglio.xml.DoorDocument;
+import com.ogoglio.xml.PositionedDocument;
+import com.ogoglio.xml.PossessionDocument;
+import com.ogoglio.xml.SpaceDocument;
+import com.ogoglio.xml.ThingDocument;
+
+public class SpaceDuplicator {
+
+ private URI spaceURI = null;
+
+ private URI serviceURI = null;
+
+ private String username = null;
+
+ private String authCookie = null;
+
+ public SpaceDuplicator(URI spaceURI, URI serviceURI, String username, String authCookie) {
+ ArgumentUtils.assertNotNull(spaceURI);
+ this.spaceURI = spaceURI;
+ ArgumentUtils.assertNotNull(serviceURI);
+ this.serviceURI = serviceURI;
+ ArgumentUtils.assertNotEmpty(username);
+ this.username = username;
+ ArgumentUtils.assertNotEmpty(authCookie);
+ this.authCookie = authCookie;
+ }
+
+ public void duplicateSpace(URI destinationSpaceURI, boolean emptyFirst) throws IOException {
+ ArgumentUtils.assertNotNull(destinationSpaceURI);
+ if(destinationSpaceURI.toString().equals(spaceURI.toString())) {
+ throw new IllegalArgumentException("Cannot copy a space to itself: " + destinationSpaceURI);
+ }
+
+ WebAPIClient client1 = new WebAPIClient(spaceURI, serviceURI, authCookie);
+ WebAPIClient client2 = new WebAPIClient(destinationSpaceURI, serviceURI, authCookie);
+
+ if(emptyFirst) {
+ emptySpace(client2);
+ }
+
+ SpaceDocument spaceDoc1 = client1.getSpaceDocument(false);
+ SpaceDocument spaceDoc2 = client2.getSpaceDocument(false);
+
+ client2.setDisplayName(spaceDoc1.getDisplayName());
+ client2.setDisplaySea(spaceDoc1.getDisplaySea());
+ client2.setSeaLevel(spaceDoc1.getSeaLevel());
+ client2.setMaxGuests(spaceDoc1.getMaxGuests());
+ client2.setPublished(spaceDoc1.isPublished());
+
+
+ ThingDocument[] thingDocs = client1.getThingDocuments();
+ for (int i = 0; i < thingDocs.length; i++) {
+ PossessionDocument[] possDocuments = client2.getPossessionDocuments(client2.getAccountDocument(true).getUsername());
+ PossessionDocument possToUse = null;
+ for (int j = 0; j < possDocuments.length; j++) {
+ if(possDocuments[j].getThingID() == -1 && possDocuments[j].getTemplateID() == thingDocs[i].getTemplateID()) {
+ possToUse = possDocuments[j];
+ break;
+ }
+ }
+
+ if(possToUse == null) { //don't have a possession, try to make one
+ possToUse = client2.createPossession(thingDocs[i].getTemplateID());
+ }
+
+ if(possToUse == null) {
+ throw new IllegalStateException("Could not create a possession needed for this space: " + thingDocs[i].getDisplayName() + ": Template ID " + thingDocs[i].getTemplateID());
+ }
+
+ PossessionDocument newPossDoc = client2.addPossessionToSpace(possToUse.getPossessionID(), spaceDoc2.getSpaceID());
+ if(newPossDoc == null) {
+ throw new IllegalStateException("Could not create thing");
+ }
+
+ ThingDocument newThingDoc = client2.getThingDocument(newPossDoc.getThingID());
+ setToSamePosition(thingDocs[i], newThingDoc);
+ client2.updateThing(newThingDoc);
+ }
+
+ DoorDocument[] doorDocs = client1.getDoorDocuments();
+ for (int i = 0; i < doorDocs.length; i++) {
+ client2.createDoor(spaceDoc2.getSpaceID(), doorDocs[i].getTemplateID(), doorDocs[i].getTemplateOwner(), doorDocs[i].getDisplayName(), doorDocs[i].getLink(), doorDocs[i].getTransform());
+ }
+
+ Map settings = client1.getSettings();
+ String[] keys = (String[])settings.keySet().toArray(new String[0]);
+ for (int i = 0; i < keys.length; i++) {
+ client2.putSetting(keys[i], (String)settings.get(keys[i]));
+ }
+ }
+
+ private void setToSamePosition(PositionedDocument placedDoc, PositionedDocument docToMove) {
+ docToMove.setX(placedDoc.getX());
+ docToMove.setY(placedDoc.getY());
+ docToMove.setZ(placedDoc.getZ());
+ docToMove.setRW(placedDoc.getRW());
+ docToMove.setRX(placedDoc.getRX());
+ docToMove.setRY(placedDoc.getRY());
+ docToMove.setRZ(placedDoc.getRZ());
+ docToMove.setScale(placedDoc.getScale());
+ }
+
+ private void emptySpace(WebAPIClient client) throws IOException {
+ ThingDocument[] thingDocs = client.getThingDocuments();
+ for (int i = 0; i < thingDocs.length; i++) {
+ client.removePossessionFromSpace(thingDocs[i].getOwnerUsername(), thingDocs[i].getPossessionID());
+ }
+
+ DoorDocument[] doorDocs = client.getDoorDocuments();
+ for (int i = 0; i < doorDocs.length; i++) {
+ client.deleteDoor(doorDocs[i].getDoorID());
+ }
+
+ Map settings = client.getSettings();
+ String[] keys = (String[])settings.keySet().toArray(new String[0]);
+ for (int i = 0; i < keys.length; i++) {
+ client.removeSetting(keys[i]);
+ }
+ }
+
+ public static void main(String[] args) {
+ if(args.length != 5) {
+ printUsage();
+ return;
+ }
+
+ try {
+ URI serviceURI = new URI(args[0]);
+ URI sourceSpaceURI = new URI(args[1]);
+ URI destSpaceURI = new URI(args[2]);
+ String username = args[3];
+ String authCookie = args[4];
+
+ SpaceDuplicator duplicator = new SpaceDuplicator(sourceSpaceURI, serviceURI, username, authCookie);
+ duplicator.duplicateSpace(destSpaceURI, true);
+ } catch (URISyntaxException e) {
+ System.err.println("Error parsing URI: " + e);
+ printUsage();
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ }
+
+ private static void printUsage() {
+ System.err.println("...SpaceDuplicator <SERVICE_URI> <SOURCE_SPACE> <DESTINATION_SPACE_URI> <USERNAME> <AUTH_COOKIE>");
+ }
+}
Added: spaces/trunk/src/com/ogoglio/client/SpaceDuplicatorTests.java
===================================================================
--- spaces/trunk/src/com/ogoglio/client/SpaceDuplicatorTests.java (rev 0)
+++ spaces/trunk/src/com/ogoglio/client/SpaceDuplicatorTests.java 2007-06-27 19:35:10 UTC (rev 199)
@@ -0,0 +1,117 @@
+package com.ogoglio.client;
+
+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.persist.TestPersistTasks;
+import com.ogoglio.xml.DoorDocument;
+import com.ogoglio.xml.PositionedDocument;
+import com.ogoglio.xml.SpaceDocument;
+import com.ogoglio.xml.ThingDocument;
+
+public class SpaceDuplicatorTests extends TestCase {
+
+ URI spaceURI1 = null;
+
+ URI spaceURI2 = null;
+
+ URI serviceURI1 = null;
+
+ WebAPIClient client1 = null;
+
+ WebAPIClient client2 = null;
+
+ String testSettingKey = "test.setting.key";
+ String testSettingValue = "A Value for the Test Setting";
+
+ public void setUp() {
+ try {
+ spaceURI1 = new URI("http://127.0.0.1:8080/og/space/1/");
+ spaceURI2 = new URI("http://127.0.0.1:8080/og/space/2/");
+ serviceURI1 = new URI("http://127.0.0.1:8080/og/");
+
+ client1 = new WebAPIClient(spaceURI1, serviceURI1, TestPersistTasks.COOKIE1);
+ client1.putSetting(testSettingKey, testSettingValue);
+
+ client2 = new WebAPIClient(spaceURI2, serviceURI1, TestPersistTasks.COOKIE1);
+ } catch (Throwable e) {
+ e.printStackTrace();
+ fail(e.getMessage());
+ }
+ }
+
+ public void tearDown() {
+ }
+
+ public void testBasics() {
+ try {
+ SpaceDocument originalSpaceDoc = client1.getSpaceDocument(false);
+ ThingDocument[] originalThingDocs = client1.getThingDocuments();
+ DoorDocument[] originalDoorDocs = client1.getDoorDocuments();
+ Map originalSettings = client1.getSettings();
+
+ //TODO settings transfer
+
+ SpaceDuplicator duplicator = new SpaceDuplicator(spaceURI1, serviceURI1, TestPersistTasks.USERNAME1, TestPersistTasks.COOKIE1);
+ duplicator.duplicateSpace(spaceURI2, true);
+
+ SpaceDocument newSpaceDoc = client2.getSpaceDocument(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 = client2.getThingDocuments();
+ 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 = client2.getDoorDocuments();
+ 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 = client2.getSettings();
+ 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);
+ }
+}
Modified: spaces/trunk/src/com/ogoglio/client/WebAPIClient.java
===================================================================
--- spaces/trunk/src/com/ogoglio/client/WebAPIClient.java 2007-06-27 17:14:05 UTC (rev 198)
+++ spaces/trunk/src/com/ogoglio/client/WebAPIClient.java 2007-06-27 19:35:10 UTC (rev 199)
@@ -21,6 +21,8 @@
import java.net.HttpURLConnection;
import java.net.URI;
import java.net.URISyntaxException;
+import java.util.HashMap;
+import java.util.Map;
import java.util.Vector;
import java.util.zip.GZIPInputStream;
@@ -38,6 +40,7 @@
import com.ogoglio.xml.DoorDocument;
import com.ogoglio.xml.PageDocument;
import com.ogoglio.xml.PossessionDocument;
+import com.ogoglio.xml.SettingDocument;
import com.ogoglio.xml.SpaceDocument;
import com.ogoglio.xml.SpaceMemberDocument;
import com.ogoglio.xml.TemplateDocument;
@@ -86,7 +89,7 @@
XMLElement result = sendAuthenticatedXML(appendToURI(serviceURI, "account/"), newAccountDoc.toString(), "POST", adminAuthCookie);
return new AccountDocument(result);
}
-
+
public static SpaceDocument createSpace(URI serviceURI, String authCookie) throws IOException {
AuthDocument authDocument = new AuthDocument(fetchAuthenticatedXML(getAuthURI(serviceURI), authCookie));
SpaceDocument spaceDoc = new SpaceDocument(-1, "New Space", authDocument.getUsername(), false, 0, false, 0, -1);
@@ -95,16 +98,16 @@
}
public static AccountDocument updateAccount(URI serviceURI, String authCookie, AccountDocument accountDoc) throws IOException {
- XMLElement result = sendAuthenticatedXML(appendToURI(serviceURI, "account/" + accountDoc.getUsername()), accountDoc.toElement().toString(), "POST", authCookie);
- if(result == null) {
- return null;
- }
- return new AccountDocument(result);
+ XMLElement result = sendAuthenticatedXML(appendToURI(serviceURI, "account/" + accountDoc.getUsername()), accountDoc.toElement().toString(), "POST", authCookie);
+ if (result == null) {
+ return null;
+ }
+ return new AccountDocument(result);
}
public static AccountDocument getAccountDocument(URI serviceURI, String authCookie, String username) throws IOException {
XMLElement response = fetchAuthenticatedXML(appendToURI(serviceURI, "account/" + username), authCookie);
- if(response == null) {
+ if (response == null) {
return null;
}
return new AccountDocument(response);
@@ -206,6 +209,12 @@
return postAuthenticatedXML(getSpaceURI(), spaceDoc.toString()) != null;
}
+ public boolean setDisplayName(String displayName) throws IOException {
+ SpaceDocument spaceDoc = new SpaceDocument(fetchAuthenticatedXML(getSpaceURI()));
+ spaceDoc.setDisplayName(displayName);
+ return postAuthenticatedXML(getSpaceURI(), spaceDoc.toString()) != null;
+ }
+
public boolean setSeaLevel(double seaLevel) throws IOException {
SpaceDocument spaceDoc = new SpaceDocument(fetchAuthenticatedXML(getSpaceURI()));
spaceDoc.setSeaLevel(seaLevel);
@@ -435,6 +444,17 @@
return performGET(getPageContentsURI(thingID, pageID), authCookie);
}
+ public Map getSettings() throws IOException {
+ HashMap results = new HashMap();
+ XMLElement list = fetchAuthenticatedXML(getSettingsURI());
+ XMLElement[] children = (XMLElement[]) list.getChildren().toArray(new XMLElement[0]);
+ for (int i = 0; i < children.length; i++) {
+ SettingDocument settingDoc = new SettingDocument(children[i]);
+ results.put(settingDoc.getKey(), settingDoc.getValue());
+ }
+ return results;
+ }
+
public String getSetting(String key) {
try {
InputStream stream = performGET(getSettingURI(key), authCookie);
@@ -742,5 +762,4 @@
public URI getSettingURI(String key) {
return appendToURI(getSettingsURI(), key + "/");
}
-
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <tre...@us...> - 2007-06-27 17:14:09
|
Revision: 198
http://ogoglio.svn.sourceforge.net/ogoglio/?rev=198&view=rev
Author: trevorolio
Date: 2007-06-27 10:14:05 -0700 (Wed, 27 Jun 2007)
Log Message:
-----------
Added new header graphic to go with the new front page video.
Modified Paths:
--------------
web/trunk/image/city-header.gif
web/trunk/index.html
web/trunk/sitewide.css
Added Paths:
-----------
web/trunk/source/NuCityHeader.psd
Modified: web/trunk/image/city-header.gif
===================================================================
(Binary files differ)
Modified: web/trunk/index.html
===================================================================
--- web/trunk/index.html 2007-06-25 20:26:57 UTC (rev 197)
+++ web/trunk/index.html 2007-06-27 17:14:05 UTC (rev 198)
@@ -12,18 +12,22 @@
#content {
padding: 8px;
- width: 360px;
- border-right: 360px solid #FFF;
- margin-right: -350px;
+ width: 530px;
+ border-right: 200px solid #FFF;
+ margin-right: -200px;
float: left;
}
#rail {
padding: 8px 8px 8px 14px;
background-color: #FFF;
- width: 339px;
+ width: 180px;
float: left;
}
+
+ #rail a {
+ display: block;
+ }
p {
margin: 10px 0px 10px 0px;
@@ -34,43 +38,35 @@
<a href="index.html"><img alt="city header" width="768" height="100" src="image/city-header.gif"/></a>
<div id="main">
<div id="content">
- <h1>Ogoglio City:</h1>
- <p><h3>The goal:</h3>
- Create an online city for work.
- <div class="moreLink"><a href="city.html">read the roadmap »</a></div>
- </p>
- <p><h3>The new world:</h3>
- Online games have taught us that virtual spaces can be used for collaboration and we will use those lessons to achieve our goal.
- <div class="moreLink"><a href="lessons.html">learn the lessons »</a></div>
- </p>
- <p><h3>The old economy:</h3>
- Whether you're shipping silverware to New York or producing machinima for YouTube, Ogoglio spaces support the essential communication which can make or break your budget.
- <div class="moreLink"><a href="economics.html">run the numbers »</a></div>
- </p>
-
- <p><h3>The funding:</h3>
- The open source efforts of the Ogoglio project are supported in part by the space hosting service, Transmutable, which provides funding and developers.
- <div class="moreLink"><a href="http://transmutable.com/">transmutable.com »</a></div>
- </p>
+ <h2>The Ogoglio Project in 9 Slides:</h2>
+
+ <script type="text/javascript" src="http://blip.tv/scripts/pokkariPlayer.js"></script>
+ <script type="text/javascript" src="http://blip.tv/syndication/write_player?skin=js&posts_id=287053&source=3&autoplay=false&file_type=flv&player_width=0&player_height=0"></script>
+ <div id="blip_movie_content_287053">
+ <a href="http://blip.tv/file/get/TrevorFSmith-TheOgoglioProjectIn9Slides645.mov" onclick="play_blip_movie_287053(); return false;">
+ <img src="http://blip.tv/file/get/TrevorFSmith-TheOgoglioProjectIn9Slides645.mov.jpg" border="0" title="Click To Play" />
+ </a>
+ <br />
+ <a href="http://blip.tv/file/get/TrevorFSmith-TheOgoglioProjectIn9Slides645.mov" onclick="play_blip_movie_287053(); return false;">
+ Click To Play
+ </a>
+ </div>
+ <script type="text/javascript">play_blip_movie_287053();</script>
+
</div><!-- end content -->
<div id="rail" style="border-left: dashed 1px;">
- <h1>Ogoglio Platform:</h1>
- <p><h3>Why build a platform?</h3>
- Existing services can't handle a global online city and most companies force you to use their servers and their volatile currencies. The Ogoglio platform is built for distributed use and Internet scale.
- <div class="moreLink"><a href="survey.html">compare the platforms »</a></div>
- </p>
-
- <p><h3>It's just the web:</h3>
- Humanity already has a huge network of services called "the web" and Ogoglio spaces are built on web technologies. Your IT crew already knows how to deploy Ogoglio spaces.
- <div class="moreLink"><a href="development.html">list the technologies »</a></div>
- </p>
- <p><h3>Your space or mine?</h3>
- Space hosting services are coming online but the platform is freely licensed and available for download. Host your space or start your own space hosting company.
- <div class="moreLink"><a href="contribute.html">get the source »</a></div>
- </p>
+ <h2>Navigation:</h2>
+ <br/>
+ <a href="city.html">read the roadmap »</a><br/>
+ <a href="lessons.html">learn the lessons »</a><br/>
+ <a href="economics.html">run the numbers »</a><br/>
+ <a href="survey.html">compare platforms »</a><br/>
+ <a href="development.html">list the technologies »</a><br/>
+ <a href="contribute.html">get the source »</a><br/>
</div><!-- end rail -->
</div> <!-- end main -->
<a href="http://sourceforge.net"><img id="sfLogo" src="http://sflogo.sourceforge.net/sflogo.php?group_id=184718&type=1" width="88" height="31" border="0" alt="SourceForge.net Logo" /></a>
</body>
</html>
+
Modified: web/trunk/sitewide.css
===================================================================
--- web/trunk/sitewide.css 2007-06-25 20:26:57 UTC (rev 197)
+++ web/trunk/sitewide.css 2007-06-27 17:14:05 UTC (rev 198)
@@ -1,6 +1,10 @@
body {
background-color: #FFF;
- font-family: "Lucida Grande", Verdana, Geneva, Arial, sans-serif;
+ font: 1.8em/120% HelveticaNeue-Light, "Helvetica Neue Light", "Helvetica Neue", helvetica, arial, HelveticaNeue-Light, "Helvetica Neue Light", "Helvetica Neue", helvetica, arial;
+ font-size: 115%;
+ line-height: 120%;
+ letter-spacing: 0.3px;
+ width: 761px;
margin: 0px 0px 0px 0px;
padding: 0px;
}
@@ -32,7 +36,6 @@
}
h1, h2, h3, h4 {
- font-family: Georgia, Times, serif;
margin: 5px 0px 5px 0px;
}
Added: web/trunk/source/NuCityHeader.psd
===================================================================
(Binary files differ)
Property changes on: web/trunk/source/NuCityHeader.psd
___________________________________________________________________
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.
|