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-08-23 00:15:04
|
Revision: 261
http://ogoglio.svn.sourceforge.net/ogoglio/?rev=261&view=rev
Author: iansmith
Date: 2007-08-22 17:14:53 -0700 (Wed, 22 Aug 2007)
Log Message:
-----------
safety checkin
Modified Paths:
--------------
maven/trunk/ogoglio-viewer-applet/pom.xml
Added Paths:
-----------
maven/trunk/ogoglio-viewer-applet/src/assemble/common-code.xml
Removed Paths:
-------------
maven/trunk/ogoglio-viewer-applet/src/assemble/ogoglio-code.xml
maven/trunk/ogoglio-viewer-applet/src/main/resources/art3d/
Modified: maven/trunk/ogoglio-viewer-applet/pom.xml
===================================================================
--- maven/trunk/ogoglio-viewer-applet/pom.xml 2007-08-23 00:14:27 UTC (rev 260)
+++ maven/trunk/ogoglio-viewer-applet/pom.xml 2007-08-23 00:14:53 UTC (rev 261)
@@ -1,11 +1,14 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
- <modelVersion>4.0.0</modelVersion>
- <groupId>com.ogoglio</groupId>
- <artifactId>ogoglio-viewer-applet</artifactId>
- <version>0.0.1</version>
-
- <build>
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>com.ogoglio</groupId>
+ <artifactId>ogoglio-viewer-applet</artifactId>
+ <version>0.0.1</version>
+ <packaging>jar</packaging>
+
+ <build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
@@ -13,18 +16,17 @@
<configuration>
<descriptors>
<descriptor>
- src/assemble/ogoglio-code.xml
+ src/assemble/common-code.xml
</descriptor>
</descriptors>
- <finalName>viewer</finalName>
- <appendAssemblyId>false</appendAssemblyId>
+ <appendAssemblyId>true</appendAssemblyId>
</configuration>
<executions>
<execution>
<id>make-assembly</id>
<phase>package</phase><!-- append to the packaging phase. -->
<goals>
- <goal>attached</goal><!--tricky, this "attaches" this to a goal -->
+ <goal>attached</goal><!--tricky, this "attaches" this to normal assembly -->
</goals>
</execution>
</executions>
@@ -32,29 +34,29 @@
</plugin>
</plugins>
</build>
-
-
- <dependencies>
- <dependency>
- <groupId>netscape</groupId>
- <artifactId>liveConnect</artifactId>
- <version>1.0</version>
- </dependency>
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <version>3.8.2</version>
- </dependency>
- <dependency>
- <groupId>com.ogoglio</groupId>
- <artifactId>ogoglio-common</artifactId>
- <version>0.0.1</version>
- </dependency>
- <dependency>
- <groupId>java3d</groupId>
- <artifactId>vecmath</artifactId>
- <version>1.3.1</version>
- </dependency>
- </dependencies>
-</project>
-
+
+
+ <dependencies>
+ <dependency>
+ <groupId>netscape</groupId>
+ <artifactId>liveConnect</artifactId>
+ <version>1.0</version>
+ </dependency>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>3.8.2</version>
+ </dependency>
+ <dependency>
+ <groupId>com.ogoglio</groupId>
+ <artifactId>ogoglio-common</artifactId>
+ <version>0.0.1</version>
+ </dependency>
+ <dependency>
+ <groupId>java3d</groupId>
+ <artifactId>vecmath</artifactId>
+ <version>1.3.1</version>
+ </dependency>
+ </dependencies>
+</project>
+
Copied: maven/trunk/ogoglio-viewer-applet/src/assemble/common-code.xml (from rev 250, maven/trunk/ogoglio-viewer-applet/src/assemble/ogoglio-code.xml)
===================================================================
--- maven/trunk/ogoglio-viewer-applet/src/assemble/common-code.xml (rev 0)
+++ maven/trunk/ogoglio-viewer-applet/src/assemble/common-code.xml 2007-08-23 00:14:53 UTC (rev 261)
@@ -0,0 +1,17 @@
+<assembly>
+ <includeBaseDirectory>false</includeBaseDirectory>
+ <id>common</id>
+ <formats>
+ <format>jar</format>
+ </formats>
+
+ <dependencySets>
+ <dependencySet>
+ <unpack>true</unpack>
+ <outputFileNameMapping></outputFileNameMapping>
+ <includes>
+ <include>com.ogoglio:ogoglio-common</include>
+ </includes>
+ </dependencySet>
+ </dependencySets>
+</assembly>
Deleted: maven/trunk/ogoglio-viewer-applet/src/assemble/ogoglio-code.xml
===================================================================
--- maven/trunk/ogoglio-viewer-applet/src/assemble/ogoglio-code.xml 2007-08-23 00:14:27 UTC (rev 260)
+++ maven/trunk/ogoglio-viewer-applet/src/assemble/ogoglio-code.xml 2007-08-23 00:14:53 UTC (rev 261)
@@ -1,17 +0,0 @@
-<assembly>
- <includeBaseDirectory>false</includeBaseDirectory>
- <id>ogoglio-code</id>
- <formats>
- <format>jar</format>
- </formats>
- <dependencySets>
- <dependencySet>
- <unpack>true</unpack>
- <useDefaultExcludes>true</useDefaultExcludes>
- <outputFileNameMapping></outputFileNameMapping>
- <includes>
- <include>com.ogoglio:ogoglio-common</include>
- </includes>
- </dependencySet>
- </dependencySets>
-</assembly>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ian...@us...> - 2007-08-23 00:14:24
|
Revision: 260
http://ogoglio.svn.sourceforge.net/ogoglio/?rev=260&view=rev
Author: iansmith
Date: 2007-08-22 17:14:27 -0700 (Wed, 22 Aug 2007)
Log Message:
-----------
safety checkin
Modified Paths:
--------------
maven/trunk/ogoglio-test-applet/pom.xml
Modified: maven/trunk/ogoglio-test-applet/pom.xml
===================================================================
--- maven/trunk/ogoglio-test-applet/pom.xml 2007-08-23 00:14:01 UTC (rev 259)
+++ maven/trunk/ogoglio-test-applet/pom.xml 2007-08-23 00:14:27 UTC (rev 260)
@@ -1,10 +1,27 @@
<?xml version="1.0" encoding="UTF-8"?>
-<project>
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+
+
<modelVersion>4.0.0</modelVersion>
- <groupId>ogoglio-test-applet</groupId>
+ <groupId>com.ogoglio</groupId>
<artifactId>ogoglio-test-applet</artifactId>
<version>0.0.1</version>
- <dependencies>
- </dependencies>
+ <packaging>jar</packaging>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <configuration>
+ <skip>true</skip><!-- ugh no unit tests -->
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+
+ <dependencies></dependencies>
</project>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ian...@us...> - 2007-08-23 00:14:04
|
Revision: 259
http://ogoglio.svn.sourceforge.net/ogoglio/?rev=259&view=rev
Author: iansmith
Date: 2007-08-22 17:14:01 -0700 (Wed, 22 Aug 2007)
Log Message:
-----------
safety checkin
Modified Paths:
--------------
maven/trunk/ogoglio-server/pom.xml
Added Paths:
-----------
maven/trunk/ogoglio-server/src/main/webapp/GrayCheckmark.gif
maven/trunk/ogoglio-server/src/main/webapp/GreenCheckmark.gif
maven/trunk/ogoglio-server/src/main/webapp/account.html
maven/trunk/ogoglio-server/src/main/webapp/admin.html
maven/trunk/ogoglio-server/src/main/webapp/body.html
maven/trunk/ogoglio-server/src/main/webapp/browserTests.js
maven/trunk/ogoglio-server/src/main/webapp/createAccount.html
maven/trunk/ogoglio-server/src/main/webapp/doorPopup.html
maven/trunk/ogoglio-server/src/main/webapp/icons/
maven/trunk/ogoglio-server/src/main/webapp/icons/16x16/
maven/trunk/ogoglio-server/src/main/webapp/icons/16x16/face-angel.png
maven/trunk/ogoglio-server/src/main/webapp/icons/16x16/face-crying.png
maven/trunk/ogoglio-server/src/main/webapp/icons/16x16/face-devil-grin.png
maven/trunk/ogoglio-server/src/main/webapp/icons/16x16/face-glasses.png
maven/trunk/ogoglio-server/src/main/webapp/icons/16x16/face-kiss.png
maven/trunk/ogoglio-server/src/main/webapp/icons/16x16/face-monkey.png
maven/trunk/ogoglio-server/src/main/webapp/icons/16x16/face-plain.png
maven/trunk/ogoglio-server/src/main/webapp/icons/16x16/face-sad.png
maven/trunk/ogoglio-server/src/main/webapp/icons/16x16/face-smile-big.png
maven/trunk/ogoglio-server/src/main/webapp/icons/16x16/face-smile.png
maven/trunk/ogoglio-server/src/main/webapp/icons/16x16/face-surprise.png
maven/trunk/ogoglio-server/src/main/webapp/icons/16x16/face-wink.png
maven/trunk/ogoglio-server/src/main/webapp/icons/22x22/
maven/trunk/ogoglio-server/src/main/webapp/icons/22x22/face-angel.png
maven/trunk/ogoglio-server/src/main/webapp/icons/22x22/face-crying.png
maven/trunk/ogoglio-server/src/main/webapp/icons/22x22/face-devil-grin.png
maven/trunk/ogoglio-server/src/main/webapp/icons/22x22/face-glasses.png
maven/trunk/ogoglio-server/src/main/webapp/icons/22x22/face-kiss.png
maven/trunk/ogoglio-server/src/main/webapp/icons/22x22/face-monkey.png
maven/trunk/ogoglio-server/src/main/webapp/icons/22x22/face-plain.png
maven/trunk/ogoglio-server/src/main/webapp/icons/22x22/face-sad.png
maven/trunk/ogoglio-server/src/main/webapp/icons/22x22/face-smile-big.png
maven/trunk/ogoglio-server/src/main/webapp/icons/22x22/face-smile.png
maven/trunk/ogoglio-server/src/main/webapp/icons/22x22/face-surprise.png
maven/trunk/ogoglio-server/src/main/webapp/icons/22x22/face-wink.png
maven/trunk/ogoglio-server/src/main/webapp/icons/32x32/
maven/trunk/ogoglio-server/src/main/webapp/icons/32x32/face-angel.png
maven/trunk/ogoglio-server/src/main/webapp/icons/32x32/face-crying.png
maven/trunk/ogoglio-server/src/main/webapp/icons/32x32/face-devil-grin.png
maven/trunk/ogoglio-server/src/main/webapp/icons/32x32/face-glasses.png
maven/trunk/ogoglio-server/src/main/webapp/icons/32x32/face-kiss.png
maven/trunk/ogoglio-server/src/main/webapp/icons/32x32/face-monkey.png
maven/trunk/ogoglio-server/src/main/webapp/icons/32x32/face-plain.png
maven/trunk/ogoglio-server/src/main/webapp/icons/32x32/face-sad.png
maven/trunk/ogoglio-server/src/main/webapp/icons/32x32/face-smile-big.png
maven/trunk/ogoglio-server/src/main/webapp/icons/32x32/face-smile.png
maven/trunk/ogoglio-server/src/main/webapp/icons/32x32/face-surprise.png
maven/trunk/ogoglio-server/src/main/webapp/icons/32x32/face-wink.png
maven/trunk/ogoglio-server/src/main/webapp/icons/index.html
maven/trunk/ogoglio-server/src/main/webapp/index.html
maven/trunk/ogoglio-server/src/main/webapp/inventory.html
maven/trunk/ogoglio-server/src/main/webapp/licenses.html
maven/trunk/ogoglio-server/src/main/webapp/ogoglio.js
maven/trunk/ogoglio-server/src/main/webapp/reset.css
maven/trunk/ogoglio-server/src/main/webapp/signin.html
maven/trunk/ogoglio-server/src/main/webapp/site.js
maven/trunk/ogoglio-server/src/main/webapp/space.html
maven/trunk/ogoglio-server/src/main/webapp/spaceEditor.html
maven/trunk/ogoglio-server/src/main/webapp/spaceEmbed.html
maven/trunk/ogoglio-server/src/main/webapp/spacePopulation.html
maven/trunk/ogoglio-server/src/main/webapp/spaceSettings.html
maven/trunk/ogoglio-server/src/main/webapp/spaceui.js
maven/trunk/ogoglio-server/src/main/webapp/style.css
maven/trunk/ogoglio-server/src/main/webapp/templateEditor.html
maven/trunk/ogoglio-server/src/main/webapp/thingPopup.html
Modified: maven/trunk/ogoglio-server/pom.xml
===================================================================
--- maven/trunk/ogoglio-server/pom.xml 2007-08-23 00:13:07 UTC (rev 258)
+++ maven/trunk/ogoglio-server/pom.xml 2007-08-23 00:14:01 UTC (rev 259)
@@ -37,13 +37,14 @@
<!-- PLUGINS -->
<plugins>
- <!-- SUREFIRE INTEGRATION TEST HACK -->
+ <!-- SUREFIRE INTEGRATION TEST -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<skip>true</skip><!-- this is critical to avoid running unit tests, sets default value for skip -->
+ <childDelegation>false</childDelegation>
</configuration>
<executions>
<execution>
@@ -57,7 +58,12 @@
<!-- we seem to like plurals -->
<include>**/*Tests.java</include>
</includes>
- <skip>false</skip><!-- don't skip unit tests -->
+ <excludes>
+ <exclude>
+ **/SpaceDuplicatorTests.java
+ </exclude>
+ </excludes>
+ <skip>false</skip><!-- don't skip integration tests -->
</configuration>
</execution>
</executions>
@@ -76,13 +82,20 @@
<goals>
<goal>start</goal>
</goals>
+ <configuration>
+ <wait>false</wait>
+ </configuration>
</execution>
+
<execution>
<id>get-down</id>
<phase>post-integration-test</phase>
<goals>
<goal>stop</goal>
</goals>
+ <configuration>
+ <wait>true</wait>
+ </configuration>
</execution>
</executions>
@@ -132,11 +145,11 @@
<groupId>com.ogoglio</groupId>
<artifactId>ogoglio-server</artifactId>
<type>war</type>
-
- <properties>
+
+ <properties>
<context>ogoglio-server</context>
- </properties>
-
+ </properties>
+
</deployable>
</deployables>
@@ -144,8 +157,31 @@
</configuration>
</plugin>
+
+ <!-- dependencies to pull in applets via deps-->
+
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-dependency-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>copy-applets</id>
+ <phase>package</phase>
+ <goals>
+ <goal>copy-dependencies</goal>
+ </goals>
+ <configuration>
+ <outputDirectory>
+ ${project.build.directory}/ogoglio-server-0.0.1
+ </outputDirectory>
+ <overWriteReleases>false</overWriteReleases>
+ <overWriteSnapshots>true</overWriteSnapshots>
+ <excludeTransitive>true</excludeTransitive>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
</plugins>
-
</build>
<!-- where to get cargo -->
@@ -159,6 +195,7 @@
</pluginRepository>
</pluginRepositories>
+
<!-- stuff we need -->
<dependencies>
<dependency>
@@ -197,12 +234,38 @@
<version>1.2</version>
<scope>compile</scope>
</dependency>
+
<dependency>
<groupId>com.ogoglio</groupId>
<artifactId>ogoglio-common</artifactId>
<version>0.0.1</version>
<scope>compile</scope>
</dependency>
+
+ <dependency>
+ <groupId>com.ogoglio</groupId>
+ <artifactId>ogoglio-viewer-applet</artifactId>
+ <version>0.0.1</version>
+ <scope>runtime</scope>
+ <classifier>common</classifier>
+ </dependency>
+
+ <dependency>
+ <groupId>com.ogoglio</groupId>
+ <artifactId>ogoglio-test-applet</artifactId>
+ <version>0.0.1</version>
+ <scope>runtime</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>com.ogoglio</groupId>
+ <artifactId>ogoglio-body-editor-applet</artifactId>
+ <version>0.0.1</version>
+ <scope>runtime</scope>
+ <classifier>common</classifier>
+ </dependency>
+
+
</dependencies>
</project>
Added: maven/trunk/ogoglio-server/src/main/webapp/GrayCheckmark.gif
===================================================================
(Binary files differ)
Property changes on: maven/trunk/ogoglio-server/src/main/webapp/GrayCheckmark.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: maven/trunk/ogoglio-server/src/main/webapp/GreenCheckmark.gif
===================================================================
(Binary files differ)
Property changes on: maven/trunk/ogoglio-server/src/main/webapp/GreenCheckmark.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: maven/trunk/ogoglio-server/src/main/webapp/account.html
===================================================================
--- maven/trunk/ogoglio-server/src/main/webapp/account.html (rev 0)
+++ maven/trunk/ogoglio-server/src/main/webapp/account.html 2007-08-23 00:14:01 UTC (rev 259)
@@ -0,0 +1,269 @@
+<!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="ogoglio.js"></script>
+<script type="text/javascript" src="site.js"></script>
+
+<title>Ogoglio Example: account</title>
+<style type="text/css">
+#main {
+ overflow: hidden;
+ width: 750px;
+}
+
+#content {
+ width: 500px;
+ border-right: 250px solid #FFF;
+ margin-right: -250px;
+ 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 spaceListXML = 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 bodyLink = null;
+
+function handleAuth(){
+ if(requestedUsername == null){
+ mainElement.innerHTML = "<h2>No Account Requested</h2>";
+ return;
+ }
+
+ if(authedUsername == null || (authedUsername != requestedUsername)){
+ mainElement.innerHTML = "<h2>You're not logged in to this account.</h2>";
+ return;
+ }
+
+ inventoryLink.innerHTML = "<a href='inventory.html?username=" + requestedUsername + "'>Check your inventory »</a>"
+
+ requestAccountDocument(requestedUsername, handleAccount);
+ requestSpaceList(requestedUsername, handleSpaceList);
+ requestAccountMembership(requestedUsername, handleMembership);
+}
+
+function handleMembership(membershipXML){
+ if(membershipXML == null) return;
+
+ 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>";
+ if("true" == banned){
+ tableHTML += "<td>banned</td>";
+ } else {
+ tableHTML += "<td>" + escapeHTML(role) + "</td>";
+ }
+ tableHTML += "<td><a href='space.html?spaceID=" + spaceID + "'>Space " + escapeHTML(spaceID) + "</a></td>";
+ tableHTML += "</tr>";
+ }
+ spaceMembershipTable.innerHTML = "<table>" + tableHTML + "</table>";
+}
+
+function createNewSpace(spaceName){
+ createSpace(requestedUsername, spaceName, handleNewSpace);
+}
+
+function handleNewSpace(xml){
+ requestSpaceList(requestedUsername, handleSpaceList);
+}
+
+function handleSpaceList(xml){
+ if(xml == null) return;
+
+ spaceListXML = xml;
+ setSpaceListFromSpaceListXML();
+}
+
+function setSpaceListFromSpaceListXML() {
+ if(spaceListXML == null){
+ return;
+ }
+ var tableHTML = "";
+ for(var i=0; i < spaceListXML.childNodes.length; i++){
+ var spaceID = spaceListXML.childNodes[i].getAttribute("spaceid");
+ var displayName = spaceListXML.childNodes[i].getAttribute("displayname");
+ tableHTML += "<tr>";
+ tableHTML += "<td>" + escapeHTML(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 += "</tr>";
+ }
+ spaceListTable.innerHTML = "<table>" + tableHTML + "</table>";
+}
+
+function handleAccount(xml){
+ if(xml == null){
+ return;
+ }
+ accountXML = xml;
+
+ 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();
+}
+
+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>";
+}
+
+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", escapeHTML(document.getElementById("firstname").value));
+ accountXML.setAttribute("lastname", escapeHTML(document.getElementById("lastname").value));
+ accountXML.setAttribute("homepage", escapeHTML(document.getElementById("homepage").value));
+ accountXML.setAttribute("password", escapeHTML(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='" + escapeHTML(value) +"'>" + escapeHTML(value) + "</a></td></tr>\n";
+ } else {
+ return "<tr><th>" + heading + ":</th><td>" + escapeHTML(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='" + escapeHTML(nonNullValue) + "' /></td><td>" + escapeHTML(nonNullComment) + "</td></tr>\n";
+ return result;
+}
+
+function init(){
+ populateMemberMenuItem();
+
+ titleUserElement = document.getElementById("titleUser");
+ //titleAccountElement = document.getElementById("titleAccount");
+ mainElement = document.getElementById("main");
+ inventoryLink = document.getElementById("inventoryLink");
+ spaceListTable = document.getElementById("spaceListTable");
+ spaceMembershipTable = document.getElementById("spaceMembershipTable");
+ profileGoButton = document.getElementById("profileGoButton");
+ profileTable = document.getElementById("profileTable");
+ bodyLink = document.getElementById("bodyLink");
+
+ 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="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>
+
+ <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>
+
+ <p class="navLink" id="bodyLink"></p>
+ <p class="navLink" id="inventoryLink"></p>
+ </div><!-- end content -->
+
+ <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>
+<!-- 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
Added: maven/trunk/ogoglio-server/src/main/webapp/admin.html
===================================================================
--- maven/trunk/ogoglio-server/src/main/webapp/admin.html (rev 0)
+++ maven/trunk/ogoglio-server/src/main/webapp/admin.html 2007-08-23 00:14:01 UTC (rev 259)
@@ -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", escapeHTML(document.getElementById("firstname").value));
+ accountXML.setAttribute("lastname", escapeHTML(document.getElementById("lastname").value));
+ accountXML.setAttribute("homepage", escapeHTML(document.getElementById("homepage").value));
+ accountXML.setAttribute("password", escapeHTML(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='" + escapeHTML(value) +"'>" + escapeHTML(value) + "</a></td></tr>\n";
+ } else {
+ return "<tr><th>" + heading + ":</th><td>" + escapeHTML(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='" + escapeHTML(nonNullValue) + "' /></td><td>" + escapeHTML(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
Added: maven/trunk/ogoglio-server/src/main/webapp/body.html
===================================================================
--- maven/trunk/ogoglio-server/src/main/webapp/body.html (rev 0)
+++ maven/trunk/ogoglio-server/src/main/webapp/body.html 2007-08-23 00:14:01 UTC (rev 259)
@@ -0,0 +1,127 @@
+<!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: body</title>
+<style type="text/css">
+#main {
+ overflow: hidden;
+ width: 750px;
+}
+
+.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">
+var bodyID = locationParameters['bodyID'];
+var loginCookie = getCookie('loginCookie');
+
+var titleElement = null;
+var mainElement = null;
+var titleElement = null;
+var appletDiv = null;
+
+var bodyXML = null;
+
+function handleAuth(){
+ if(loginCookie == null){
+ mainElement.innerHTML = "<h2>Pleae sign in to use this page.</h2>";
+ return;
+ }
+
+ if(bodyID == null){
+ mainElement.innerHTML = "<h2>Error: somehow you arrived here without the parameters.</h2> (dang)";
+ return;
+ }
+
+ if(authedUsername == null){
+ mainElement.innerHTML = "<h2>Please log in.</h2>";
+ return;
+ }
+
+ requestBodyDocument(authedUsername, bodyID, handleBody);
+}
+
+function handleBody(xml){
+ if(xml == null) {
+ mainElement.innerHTML = "Couldn't read body information.";
+ return;
+ }
+ bodyXML = xml;
+ titleElement.innerHTML = escapeHTML(bodyXML.getAttribute("displayname"));
+ writeApplet();
+}
+
+function writeApplet(){
+ if(loginCookie == null){
+ appletDiv.innerHTML = "No cookie. Please sign in or register as a guest.";
+ return;
+ }
+
+ var html = "<applet id='viewer' code='com.ogoglio.viewer.applet.BodyEditorApplet' archive='/og/ogoglio-body-editor-applet-0.0.1-common.jar' width='500' height='500' mayscript='true'>";
+ html += "<param name='loginCookie' value='" + loginCookie + "' />";
+ html += "<param name='serviceURI' value='" + getServiceURI() + "' />";
+ html += "<param name='image' value='" + appPath + "/icons/32x32/face-monkey.png' />";
+ html += "</applet>";
+
+ appletDiv.innerHTML = html;
+}
+
+function init(){
+ populateMemberMenuItem();
+
+ titleElement = document.getElementById("title");
+ mainElement = document.getElementById("main");
+ appletDiv = document.getElementById("appletDiv");
+
+ 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">Loading...</h2>
+ <div id="appletDiv"> </div>
+
+</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
Added: maven/trunk/ogoglio-server/src/main/webapp/browserTests.js
===================================================================
--- maven/trunk/ogoglio-server/src/main/webapp/browserTests.js (rev 0)
+++ maven/trunk/ogoglio-server/src/main/webapp/browserTests.js 2007-08-23 00:14:01 UTC (rev 259)
@@ -0,0 +1,160 @@
+var testedCookieName = 'ogoglioBrowserTested';
+
+var requirementTests = new Array();
+var hasTestedCookie = getCookie(testedCookieName) == "true";
+
+function PlatformTest(theTitle, theDescription, theFailureMessage, theTestFunction){
+ var that = this;
+ this.title = theTitle;
+ this.description = theDescription;
+ this.failureMessage = theFailureMessage;
+ this.testFunction = theTestFunction;
+}
+
+PlatformTest.prototype.runTest = function (testSpan) {
+ return this.testFunction(testSpan);
+}
+
+function testJavascript(){
+ return true;
+}
+requirementTests[requirementTests.length] = new PlatformTest("Checking that Javascript is enabled", "", "You must enable Javascript.", testJavascript);
+
+
+function testJava(testSpan){
+ try {
+ var jarURI = getServiceURI() + "/ogoglio-test-applet-0.0.1.jar";
+ var appletHTML = "<applet id='testApplet' name='testApplet' code='com.ogoglio.viewer.applet.TestApplet' archive='" + jarURI + "' width='1' height='1'></applet>";
+ testSpan.innerHTML = appletHTML;
+ while(typeof document.testApplet == "undefined"){
+ for(i=0; i < 100; i++) setTimeout('this = "something";', 5000);
+ }
+ if((typeof document.testApplet == "undefined")) {
+ requirementTests[1].failureMessage = "Unfortunately, Java support was not found in this browser.<br/>" + javaErrorMessage;
+ return false;
+ }
+ if(!document.testApplet.doesExist()){
+ requirementTests[1].failureMessage = "Unfortunately, we could not communicate with the applet.<br/>" + javaErrorMessage;
+ return false;
+ }
+ if(!document.testApplet.hasAcceptableJava()){
+ requirementTests[1].failureMessage = "Unfortunately, this version of java is not supported: " + document.testApplet.getJavaVersion() + "<br/>" + javaErrorMessage;
+ return false;
+ }
+ if(!document.testApplet.hasJava3D()){
+ var j3dVersion = document.testApplet.getJava3DVersion();
+ if(j3dVersion == null){
+ requirementTests[1].failureMessage = "Unfortunately, you do not have Java3D installed.<br/>" + javaErrorMessage;
+ } else {
+ requirementTests[1].failureMessage = "Unfortunately, this version of Java3D is not supported: " + j3dVersion + javaErrorMessage + "<br/>";
+ }
+ return false;
+ }
+ if(!document.testApplet.canStartJava3D()){
+ requirementTests[1].failureMessage = "Unfortunately, you have Java3D but it can not initialize." + javaErrorMessage + "<br/>";
+ }
+ return true;
+ } catch (error){
+ requirementTests[1].failureMessage = "Unfortunately, Java support was not found in this browser." + javaErrorMessage + "<br/>";
+ return false;
+ }
+ return false;
+}
+var javaErrorMessage = "<br/><br/>Please check that Java support is enabled in your browser preferences.";
+javaErrorMessage += "<br/>If your computer needs Java, use the online installer from <a href='http://java.com/en/download/manual.jsp'>Java.com</a>.<br/>";
+javaErrorMessage += "<br/>If your computer needs Java3D, a quick installer is available <a href='http://java.sun.com/products/java-media/3D/download.html'>here</a>.";
+requirementTests[requirementTests.length] = new PlatformTest("Checking for Java support", "Java displays the 3D views.", javaErrorMessage, testJava);
+
+var currentTestIndex = -1;
+var running = false;
+
+function BrowserTester(){
+ this.listener = null;
+}
+
+BrowserTester.prototype.runTests = function(aCallback){
+ this.callback = aCallback;
+ currentTestIndex = 0;
+ running = true;
+ setTimeout("browserTester.test();", 100);
+}
+
+BrowserTester.prototype.test = function(){
+ var watchdog = setTimeout("browserTester.timedOut();", 10000);
+
+ var title = document.getElementById("requirementTitle" + currentTestIndex);
+ var description = document.getElementById("requirementDescription" + currentTestIndex);
+ var testSpan = document.getElementById("requirementTest" + currentTestIndex);
+
+ title.style.color = "#000";
+ description.style.color = "#000";
+
+ if(requirementTests[currentTestIndex].runTest(testSpan) == true){
+ clearTimeout(watchdog);
+ this.succeed();
+ } else {
+ clearTimeout(watchdog);
+ this.fail();
+ }
+}
+
+BrowserTester.prototype.succeed = function(){
+ if(running == false) return;
+
+ var title = document.getElementById("requirementTitle" + currentTestIndex);
+ var description = document.getElementById("requirementDescription" + currentTestIndex);
+ var testSpan = document.getElementById("requirementTest" + currentTestIndex);
+
+ title.style.color = "#0F0";
+ title.innerHTML = title.innerHTML + "<img id='requirementCheck" + currentTestIndex + "' align='center' src='" + getServiceURI() + "/GreenCheckmark.gif'/>";
+ description.style.color = "#0F0";
+
+ currentTestIndex++;
+ if(currentTestIndex >= requirementTests.length){
+ running = false;
+ this.callback(true);
+ } else {
+ setTimeout("browserTester.test(" + currentTestIndex + ");", 100);
+ }
+}
+
+BrowserTester.prototype.fail = function(){
+ if(running == false) return;
+ running = false;
+
+ var title = document.getElementById("requirementTitle" + currentTestIndex);
+ var description = document.getElementById("requirementDescription" + currentTestIndex);
+ var testSpan = document.getElementById("requirementTest" + currentTestIndex);
+
+ title.style.color = "#FF0000";
+ description.style.color = "#000";
+ var message = requirementTests[currentTestIndex].failureMessage;
+ description.innerHTML = message;
+ this.callback(false);
+}
+
+BrowserTester.prototype.timedOut = function(){
+ if(running == false) return;
+ running = false;
+ this.fail();
+}
+
+var browserTester = new BrowserTester();
+
+
+function writeRequirementTestUI(targetElement){
+ var html = "<ol style='margin: 10px;'>";
+ for(var i=0; i < requirementTests.length; i++){
+ html += "<li id='requirementLI" + i + "'>";
+ html += "<h2 id='requirementTitle" + i + "'>";
+ html += requirementTests[i].title + ": ";
+ html += "</h2>";
+ html += "<p id='requirementDescription" + i + "' >" + requirementTests[i].description + "</p>";
+ html += "<span id='requirementTest" + i + "'> </span>";
+ html += "</li>";
+ }
+ 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: maven/trunk/ogoglio-server/src/main/webapp/createAccount.html
===================================================================
--- maven/trunk/ogoglio-server/src/main/webapp/createAccount.html (rev 0)
+++ maven/trunk/ogoglio-server/src/main/webapp/createAccount.html 2007-08-23 00:14:01 UTC (rev 259)
@@ -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
Added: maven/trunk/ogoglio-server/src/main/webapp/doorPopup.html
===================================================================
--- maven/trunk/ogoglio-server/src/main/webapp/doorPopup.html (rev 0)
+++ maven/trunk/ogoglio-server/src/main/webapp/doorPopup.html 2007-08-23 00:14:01 UTC (rev 259)
@@ -0,0 +1,288 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html>
+<head>
+
+<link rel="stylesheet" href="site.css" type="text/css" />
+
+<script type="text/javascript" src="ogoglio.js"></script>
+
+<title>door editor</title>
+
+<script type="text/javascript">
+var doorID = locationParameters['doorID'];
+var spaceID = locationParameters['spaceID'];
+
+var title = null;
+var main = null;
+var xPosInput = null;
+var yPosInput = null;
+var zPosInput = null;
+var xRotInput = null;
+var yRotInput = null;
+var zRotInput = null;
+var scaleInput = null;
+var linkForm = null;
+
+var doorXML = null;
+
+function init(){
+ main = document.getElementById('main');
+ title = document.getElementById('title');
+ linkForm = document.getElementById('linkForm');
+ xPosInput = document.getElementById('xPosInput');
+ yPosInput = document.getElementById('yPosInput');
+ zPosInput = document.getElementById('zPosInput');
+ xRotInput = document.getElementById('xRotInput');
+ yRotInput = document.getElementById('yRotInput');
+ zRotInput = document.getElementById('zRotInput');
+ scaleInput = document.getElementById('scaleInput');
+
+ if(doorID == null || spaceID == null){
+ main.innerHTML = "<h2>No door</h2><p>Whoops, no door was found for that ID.</p>";
+ return;
+ }
+ addAuthListeners(doorAuthHandler, doorAuthHandler);
+}
+
+function doorAuthHandler(){
+ if(authedUsername == null){
+ main.innerHTML = "<h2>Not logged in.</h2><p>Whoops, you must be logged in to use this page.</p>";
+ return;
+ }
+
+ requestDoor(spaceID, doorID, handleDoorDocument);
+}
+
+function linkChangeGo(){
+ if(linkForm.goButton.value == 'change'){
+ linkForm.innerHTML = "<input id='linkInput' type='text' value='" + escapeHTML(doorXML.getAttribute('link')) + "' size='30' style='font-size: 1.2em;' />";
+ linkForm.innerHTML += "<input id='goButton' type='submit' onclick='linkChangeGo(); return false;' value='save' />";
+ } else {
+ var linkValue = trim(linkForm.linkInput.value);
+ if(linkValue != null && linkValue.length > 0){
+ doorXML.setAttribute('link', linkValue);
+ updateDoor(spaceID, doorXML, handleDoorDocument);
+ }
+ linkForm.innerHTML = escapeHTML(doorXML.getAttribute('link'));
+ linkForm.innerHTML += "<input id='goButton' type='submit' onclick='linkChangeGo(); return false;' value='change' />";
+ }
+}
+
+function handleDoorDocument(xml){
+ if(xml == null){
+ main.innerHTML = "<h2>No door</h2><p>Whoops, that door couldn't be located.</p>";
+ return;
+ }
+ doorXML = xml;
+
+ title.innerHTML = "Door: " + xml.getAttribute('displayname');
+ xPosInput.value = parseFloat(doorXML.getAttribute('x')).toFixed(2);
+ yPosInput.value = parseFloat(doorXML.getAttribute('y')).toFixed(2);
+ zPosInput.value = parseFloat(doorXML.getAttribute('z')).toFixed(2);
+
+ var quat = new Quaternion(doorXML.getAttribute('rw'), doorXML.getAttribute('rx'), doorXML.getAttribute('ry'), doorXML.getAttribute('rz'));
+ var euler = quat.getEuler();
+ xRotInput.value = euler[0];
+ yRotInput.value = euler[1];
+ zRotInput.value = euler[2];
+
+ //NOTE: the current viewer currently scales all dimensions using scalex
+ scaleInput.value = parseFloat(doorXML.getAttribute('scalex')).toFixed(4);
+
+ linkForm.innerHTML = escapeHTML(doorXML.getAttribute('link')) + " <input type='submit' id='goButton' onclick='linkChangeGo(); return false;' value='change' />";
+
+}
+
+function scaleTo(scale){
+ if(scale <= 0.001){
+ alert("Can't scale that small");
+ return;
+ }
+ //NOTE: the current viewer currently scales all dimensions using scalex
+ doorXML.setAttribute('scalex', scale);
+ doorXML.setAttribute('scaley', scale);
+ doorXML.setAttribute('scalez', scale);
+ updateDoor(spaceID, doorXML, handleDoorDocument);
+}
+
+function move(x, y, z){
+ if(doorXML == null){
+ return;
+ }
+
+ doorXML.setAttribute('x', x + parseFloat(doorXML.getAttribute('x')));
+ doorXML.setAttribute('y', y + parseFloat(doorXML.getAttribute('y')));
+ doorXML.setAttribute('z', z + parseFloat(doorXML.getAttribute('z')));
+ updateDoor(spaceID, doorXML, handleDoorDocument);
+}
+
+function moveToX(x){
+ if(doorXML == null) return;
+ doorXML.setAttribute('x', x);
+ updateDoor(spaceID, doorXML, handleDoorDocument);
+}
+
+function moveToY(y){
+ if(doorXML == null) return;
+ doorXML.setAttribute('y', y);
+ updateDoor(spaceID, doorXML, handleDoorDocument);
+}
+
+function moveToZ(z){
+ if(doorXML == null) return;
+ doorXML.setAttribute('z', z);
+ updateDoor(spaceID, doorXML, handleDoorDocument);
+}
+
+function resetPosition(){
+ if(doorXML == null){
+ return;
+ }
+
+ doorXML.setAttribute('x', '0');
+ doorXML.setAttribute('y', '0');
+ doorXML.setAttribute('z', '0');
+ updateDoor(spaceID, doorXML, handleDoorDocument);
+}
+
+function getCurrentQuat(){
+ if(doorXML == null) return;
+ return new Quaternion(parseFloat(doorXML.getAttribute('rw')), parseFloat(doorXML.getAttribute('rx')), parseFloat(doorXML.getAttribute('ry')), parseFloat(doorXML.getAttribute('rz')));
+}
+
+function setXMLQuat(quat){
+ doorXML.setAttribute('rw', quat.w);
+ doorXML.setAttribute('rx', quat.x);
+ doorXML.setAttribute('ry', quat.y);
+ doorXML.setAttribute('rz', quat.z);
+}
+
+function rotateToX(x){
+ if(doorXML == null) return;
+ var quat = getCurrentQuat();
+ var euler = quat.getEuler();
+ quat.setEuler(x, euler[1], euler[2]);
+ setXMLQuat(quat);
+ updateDoor(spaceID, doorXML, handleDoorDocument);
+}
+
+function rotateToY(y){
+ if(doorXML == null) return;
+ var quat = getCurrentQuat();
+ var euler = quat.getEuler();
+ quat.setEuler(euler[0], y, euler[2]);
+ setXMLQuat(quat);
+ updateDoor(spaceID, doorXML, handleDoorDocument);
+}
+
+function rotateToZ(z){
+ if(doorXML == null) return;
+ var quat = getCurrentQuat();
+ var euler = quat.getEuler();
+ quat.setEuler(euler[0], euler[1], z);
+ setXMLQuat(quat);
+ updateDoor(spaceID, doorXML, handleDoorDocument);
+}
+
+function rotate(x, y, z){
+ if(x == 0 && y == 0 && z == 0){
+ return;
+ }
+ var quat = getCurrentQuat();
+ quat.rotateEuler(x, y, z);
+ setXMLQuat(quat);
+ updateDoor(spaceID, doorXML, handleDoorDocument);
+}
+
+function resetVerticalRotation(){
+ doorXML.setAttribute('rw', doorXML.getAttribute('rw'));
+ doorXML.setAttribute('rx', doorXML.getAttribute('rx'));
+ doorXML.setAttribute('ry', '0');
+ doorXML.setAttribute('rz', doorXML.getAttribute('rz'));
+ updateDoor(spaceID, doorXML, handleDoorDocument);
+}
+
+function resetHorizontalRotation(){
+ doorXML.setAttribute('rw', doorXML.getAttribute('rw'));
+ doorXML.setAttribute('rx', '0');
+ doorXML.setAttribute('ry', doorXML.getAttribute('ry'));
+ doorXML.setAttribute('rz', '0');
+ updateDoor(spaceID, doorXML, handleDoorDocument);
+}
+
+</script>
+
+<style type="text/css">
+ .section input[type=submit] {
+ width: 100px;
+ }
+ .section input[type=text] {
+ width: 70px;
+ text-align: right;
+ }
+
+ .section form {
+ display: inline;
+ }
+</style>
+
+</head>
+<body onload="init();">
+<div id="content">
+
+<div id="main" style="">
+ <h2 id="title">Door:</h2>
+ <div class="section">
+ <h3>Translate:</h3>
+ <input type='submit' onclick='move(0, 1, 0); return false;' value='Up'/>
+ <input type='submit' onclick='move(0, -1, 0); return false;' value='Down'/>
+
+ <form onsubmit='moveToY(this.yPosInput.value); return false;'><input type='text' size='3' id='yPosInput' /></form>
+ <br/>
+ <input type='submit' onclick='move(0, 0, -1); return false;' value='North'/>
+ <input type='submit' onclick='move(0, 0, 1); return false;' value='South'/>
+ <form onsubmit='moveToZ(this.zPosInput.value); return false;'><input type='text' size='3' id='zPosInput' /></form>
+ <br/>
+ <input type='submit' onclick='move(1, 0, 0); return false;' value='East'/>
+ <input type='submit' onclick='move(-1, 0, 0); return false;' value='West'/>
+ <form onsubmit='moveToX(this.xPosInput.value); return false;'><input type='text' size='3' id='xPosInput' /></form>
+
+ <br/>
+ <input type='submit' onclick='resetPosition(); return false;' value='Reset'/>
+ </div> <!-- end section -->
+
+ <div class="section">
+ <h3>Vertical Rotate:</h3>
+ <input type='submit' onclick='rotate(0, 0.5, 0); return false;' value='Y'/>
+ <input type='submit' onclick='rotate(0, -0.5, 0); return false;' value='-Y'/>
+
+ <form onsubmit='rotateToY(this.yRotInput.value); return false;'><input type='text' size='3' id='yRotInput' /></form>
+ <br/>
+ <input type='submit' onclick='resetVerticalRotation(); return false;' value='Reset'/>
+ <h3>Horizontal Rotate:</h3>
+ <input type='submit' onclick='rotate(0.5, 0, 0); return false;' value='X'/>
+ <input type='submit' onclick='rotate(-0.5, 0, 0); return false;' value='-X'/>
+ <form onsubmit='rotateToX(this.xRotInput.value); return false;'><input type='text' size='3' id='xRotInput' /></form>
+ <br/>
+
+ <input type='submit' onclick='rotate(0, 0, 0.5); return false;' value='Z'/>
+ <input type='submit' onclick='rotate(0, 0, -0.5); return false;' value='-Z'/>
+ <form onsubmit='rotateToZ(this.zRotInput.value); return false;'><input type='text' size='3' id='zRotInput' /></form>
+ <br/>
+ <input type='submit' onclick='resetHorizontalRotation(); return false;' value='Reset'/>
+ </div> <!-- end section -->
+
+ <div class="section">
+ <h3>Scale: <form onsubmit='scaleTo(this.scaleInput.value); return false;'><input type='text' size='3' id='scaleInput' /></form></h3>
+ </div>
+
+ <div class="section">
+ <h3>Link:</h3>
+ <form id="linkForm"></form>
+ </div>
+</div>
+
+</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. 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>
Added: maven/trunk/ogoglio-server/src/main/webapp/icons/16x16/face-angel.png
===================================================================
(Binary files differ)
Property changes on: maven/trunk/ogoglio-server/src/main/webapp/icons/16x16/face-angel.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: maven/trunk/ogoglio-server/src/main/webapp/icons/16x16/face-crying.png
===================================================================
(Binary files differ)
Property changes on: maven/trunk/ogoglio-server/src/main/webapp/icons/16x16/face-crying.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: maven/trunk/ogoglio-server/src/main/webapp/icons/16x16/face-devil-grin.png
===================================================================
(Binary files differ)
Property changes on: maven/trunk/ogoglio-server/src/main/webapp/icons/16x16/face-devil-grin.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: maven/trunk/ogoglio-server/src/main/webapp/icons/16x16/face-glasses.png
===================================================================
(Binary files differ)
Property changes on: maven/trunk/ogoglio-server/src/main/webapp/icons/16x16/face-glasses.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: maven/trunk/ogoglio-server/src/main/webapp/icons/16x16/face-kiss.png
===================================================================
(Binary files differ)
Property changes on: maven/trunk/ogoglio-server/src/main/webapp/icons/16x16/face-kiss.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: maven/trunk/ogoglio-server/src/main/webapp/icons/16x16/face-monkey.png
===================================================================
(Binary files differ)
Property changes on: maven/trunk/ogoglio-server/src/main/webapp/icons/16x16/face-monkey.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: maven/trunk/ogoglio-server/src/main/webapp/icons/16x16/face-plain.png
===================================================================
(Binary files differ)
Property changes on: maven/trunk/ogoglio-server/src/main/webapp/icons/16x16/face-plain.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: maven/trunk/ogoglio-server/src/main/webapp/icons/16x16/face-sad.png
===================================================================
(Binary files differ)
Property changes on: maven/trunk/ogoglio-server/src/main/webapp/icons/16x16/face-sad.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: maven/trunk/ogoglio-server/src/main/webapp/icons/16x16/face-smile-big.png
===================================================================
(Binary files differ)
Property changes on: maven/trunk/ogoglio-server/src/main/webapp/icons/16x16/face-smile-big.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: maven/trunk/ogoglio-server/src/main/webapp/icons/16x16/face-smile.png
===================================================================
(Binary files differ)
Property changes on: maven/trunk/ogoglio-server/src/main/webapp/icons/16x16/face-smile.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: maven/trunk/ogoglio-server/src/main/webapp/icons/16x16/face-surprise.png
===================================================================
(Binary files differ)
Property changes on: maven/trunk/ogoglio-server/src/main/webapp/icons/16x16/face-surprise.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: maven/trunk/ogoglio-server/src/main/webapp/icons/16x16/face-wink.png
===================================================================
(Binary files differ)
Property changes on: maven/trunk/ogoglio-server/src/main/webapp/icons/16x16/face-wink.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: maven/trunk/ogoglio-server/src/main/webapp/icons/22x22/face-angel.png
===================================================================
(Binary files differ)
Property changes on: maven/trunk/ogoglio-server/src/main/webapp/icons/22x22/face-angel.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: maven/trunk/ogoglio-server/src/main/webapp/icons/22x22/face-crying.png
===================================================================
(Binary files differ)
Property changes on: maven/trunk/ogoglio-server/src/main/webapp/icons/22x22/face-crying.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: maven/trunk/ogoglio-server/src/main/webapp/icons/22x22/face-devil-grin.png
===================================================================
(Binary files differ)
Property changes on: maven/trunk/ogoglio-server/src/main/webapp/icons/22x22/face-devil-grin.png
___________________________________________________________________
Name: sv...
[truncated message content] |
|
From: <ian...@us...> - 2007-08-23 00:13:17
|
Revision: 258
http://ogoglio.svn.sourceforge.net/ogoglio/?rev=258&view=rev
Author: iansmith
Date: 2007-08-22 17:13:07 -0700 (Wed, 22 Aug 2007)
Log Message:
-----------
safety checkin
Modified Paths:
--------------
maven/trunk/ogoglio-common/src/main/java/com/ogoglio/client/SpaceClient.java
Modified: maven/trunk/ogoglio-common/src/main/java/com/ogoglio/client/SpaceClient.java
===================================================================
--- maven/trunk/ogoglio-common/src/main/java/com/ogoglio/client/SpaceClient.java 2007-08-23 00:12:44 UTC (rev 257)
+++ maven/trunk/ogoglio-common/src/main/java/com/ogoglio/client/SpaceClient.java 2007-08-23 00:13:07 UTC (rev 258)
@@ -688,7 +688,7 @@
try {
return webClient.getTemplateResourceStream(ownerUsername, templateID, name);
} catch (IOException e) {
- return SpaceClient.class.getClassLoader().getResourceAsStream("com/ogoglio/viewer/applet/resources/loading.obj");
+ return SpaceClient.class.getClassLoader().getResourceAsStream("/avatar/loading.obj");
}
}
@@ -710,24 +710,24 @@
}
public InputStream getUserGeometryStream(String username, String name) throws IOException {
- return SpaceClient.class.getClassLoader().getResourceAsStream("com/ogoglio/viewer/applet/resources/avatar.obj");
+ return SpaceClient.class.getClassLoader().getResourceAsStream("/avatar/avatar.obj");
}
public InputStream getUserAnimationStream(String username, long animationID) throws IOException {
if (animationID == 1) {
- return SpaceClient.class.getClassLoader().getResourceAsStream("com/ogoglio/viewer/applet/resources/avatar.bvh");
+ return SpaceClient.class.getClassLoader().getResourceAsStream("/avatar/avatar.bvh");
} else if (animationID == 2) {
- return SpaceClient.class.getClassLoader().getResourceAsStream("com/ogoglio/viewer/applet/resources/avatar-walk.bvh");
+ return SpaceClient.class.getClassLoader().getResourceAsStream("/avatar/avatar-walk.bvh");
} else if (animationID == 3) {
- return SpaceClient.class.getClassLoader().getResourceAsStream("com/ogoglio/viewer/applet/resources/avatar-wave.bvh");
+ return SpaceClient.class.getClassLoader().getResourceAsStream("/avatar/avatar-wave.bvh");
} else if (animationID == 4) {
- return SpaceClient.class.getClassLoader().getResourceAsStream("com/ogoglio/viewer/applet/resources/avatar-point.bvh");
+ return SpaceClient.class.getClassLoader().getResourceAsStream("/avatar/avatar-point.bvh");
}
return null;
}
public InputStream getUserSkinMapStream(String username) throws IOException {
- return SpaceClient.class.getClassLoader().getResourceAsStream("com/ogoglio/viewer/applet/resources/avatar.smap");
+ return SpaceClient.class.getClassLoader().getResourceAsStream("/avatar/avatar.smap");
}
public BodyDocument getBodyDocument(String username, long bodyID) throws IOException {
@@ -752,7 +752,7 @@
if (lodIndex != 0) {
return null;
}
- return SpaceClient.class.getClassLoader().getResourceAsStream("com/ogoglio/viewer/applet/resources/loading.obj");
+ return SpaceClient.class.getClassLoader().getResourceAsStream("/avatar/loading.obj");
}
public InputStream getSkinMapStream() throws IOException {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ian...@us...> - 2007-08-23 00:12:47
|
Revision: 257
http://ogoglio.svn.sourceforge.net/ogoglio/?rev=257&view=rev
Author: iansmith
Date: 2007-08-22 17:12:44 -0700 (Wed, 22 Aug 2007)
Log Message:
-----------
safety checkin
Modified Paths:
--------------
maven/trunk/ogoglio-body-editor-applet/pom.xml
maven/trunk/ogoglio-body-editor-applet/src/main/java/com/ogoglio/bodyeditor/BodyEditorApplet.java
Added Paths:
-----------
maven/trunk/ogoglio-body-editor-applet/src/assemble/common-code.xml
Removed Paths:
-------------
maven/trunk/ogoglio-body-editor-applet/src/assemble/ogoglio-code.xml
Modified: maven/trunk/ogoglio-body-editor-applet/pom.xml
===================================================================
--- maven/trunk/ogoglio-body-editor-applet/pom.xml 2007-08-21 16:23:41 UTC (rev 256)
+++ maven/trunk/ogoglio-body-editor-applet/pom.xml 2007-08-23 00:12:44 UTC (rev 257)
@@ -4,10 +4,11 @@
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
- <groupId>ogoglio-body-editor-applet</groupId>
+ <groupId>com.ogoglio</groupId>
<artifactId>ogoglio-body-editor-applet</artifactId>
<version>0.0.1</version>
-
+ <packaging>jar</packaging>
+
<build>
<plugins>
<plugin>
@@ -16,11 +17,9 @@
<configuration>
<descriptors>
<descriptor>
- src/assemble/ogoglio-code.xml
+ src/assemble/common-code.xml
</descriptor>
</descriptors>
- <finalName>body-editor</finalName>
- <appendAssemblyId>false</appendAssemblyId>
</configuration>
<executions>
<execution>
Copied: maven/trunk/ogoglio-body-editor-applet/src/assemble/common-code.xml (from rev 250, maven/trunk/ogoglio-body-editor-applet/src/assemble/ogoglio-code.xml)
===================================================================
--- maven/trunk/ogoglio-body-editor-applet/src/assemble/common-code.xml (rev 0)
+++ maven/trunk/ogoglio-body-editor-applet/src/assemble/common-code.xml 2007-08-23 00:12:44 UTC (rev 257)
@@ -0,0 +1,17 @@
+<assembly>
+ <includeBaseDirectory>false</includeBaseDirectory>
+ <id>common</id>
+ <formats>
+ <format>jar</format>
+ </formats>
+ <dependencySets>
+ <dependencySet>
+ <unpack>true</unpack>
+ <useDefaultExcludes>true</useDefaultExcludes>
+ <outputFileNameMapping></outputFileNameMapping>
+ <includes>
+ <include>com.ogoglio:ogoglio-common</include>
+ </includes>
+ </dependencySet>
+ </dependencySets>
+</assembly>
Deleted: maven/trunk/ogoglio-body-editor-applet/src/assemble/ogoglio-code.xml
===================================================================
--- maven/trunk/ogoglio-body-editor-applet/src/assemble/ogoglio-code.xml 2007-08-21 16:23:41 UTC (rev 256)
+++ maven/trunk/ogoglio-body-editor-applet/src/assemble/ogoglio-code.xml 2007-08-23 00:12:44 UTC (rev 257)
@@ -1,17 +0,0 @@
-<assembly>
- <includeBaseDirectory>false</includeBaseDirectory>
- <id>ogoglio-code</id>
- <formats>
- <format>jar</format>
- </formats>
- <dependencySets>
- <dependencySet>
- <unpack>true</unpack>
- <useDefaultExcludes>true</useDefaultExcludes>
- <outputFileNameMapping></outputFileNameMapping>
- <includes>
- <include>com.ogoglio:ogoglio-common</include>
- </includes>
- </dependencySet>
- </dependencySets>
-</assembly>
Modified: maven/trunk/ogoglio-body-editor-applet/src/main/java/com/ogoglio/bodyeditor/BodyEditorApplet.java
===================================================================
--- maven/trunk/ogoglio-body-editor-applet/src/main/java/com/ogoglio/bodyeditor/BodyEditorApplet.java 2007-08-21 16:23:41 UTC (rev 256)
+++ maven/trunk/ogoglio-body-editor-applet/src/main/java/com/ogoglio/bodyeditor/BodyEditorApplet.java 2007-08-23 00:12:44 UTC (rev 257)
@@ -118,22 +118,22 @@
private class SpacelessContext implements Context {
public InputStream getUserGeometryStream(String username, String name) throws IOException {
- return BodyEditorApplet.class.getClassLoader().getResourceAsStream("com/ogoglio/viewer/applet/resources/avatar.obj");
+ return BodyEditorApplet.class.getClassLoader().getResourceAsStream("/avatar/avatar.obj");
}
public InputStream getUserAnimationStream(String username, long animationID) throws IOException {
if (animationID == 1) {
- return BodyEditorApplet.class.getClassLoader().getResourceAsStream("com/ogoglio/viewer/applet/resources/avatar.bvh");
+ return BodyEditorApplet.class.getClassLoader().getResourceAsStream("/avatar/avatar.bvh");
} else if (animationID == 2) {
- return BodyEditorApplet.class.getClassLoader().getResourceAsStream("com/ogoglio/viewer/applet/resources/avatar-walk.bvh");
+ return BodyEditorApplet.class.getClassLoader().getResourceAsStream("/avatar/avatar-walk.bvh");
} else if (animationID == 3) {
- return BodyEditorApplet.class.getClassLoader().getResourceAsStream("com/ogoglio/viewer/applet/resources/avatar-wave.bvh");
+ return BodyEditorApplet.class.getClassLoader().getResourceAsStream("/avatar/avatar-wave.bvh");
}
return null;
}
public InputStream getUserSkinMapStream(String username) throws IOException {
- return BodyEditorApplet.class.getClassLoader().getResourceAsStream("com/ogoglio/viewer/applet/resources/avatar.smap");
+ return BodyEditorApplet.class.getClassLoader().getResourceAsStream("/avatar/avatar.smap");
}
public InputStream getPageContentStream(long thingID, long pageID) {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ian...@us...> - 2007-08-21 16:23:38
|
Revision: 256
http://ogoglio.svn.sourceforge.net/ogoglio/?rev=256&view=rev
Author: iansmith
Date: 2007-08-21 09:23:41 -0700 (Tue, 21 Aug 2007)
Log Message:
-----------
ClientTests was unhappy being checked in last time.
Modified Paths:
--------------
maven/trunk/ogoglio-server/src/test/java/com/ogoglio/client/test/ClientTests.java
Modified: maven/trunk/ogoglio-server/src/test/java/com/ogoglio/client/test/ClientTests.java
===================================================================
--- maven/trunk/ogoglio-server/src/test/java/com/ogoglio/client/test/ClientTests.java 2007-08-21 16:22:50 UTC (rev 255)
+++ maven/trunk/ogoglio-server/src/test/java/com/ogoglio/client/test/ClientTests.java 2007-08-21 16:23:41 UTC (rev 256)
@@ -470,7 +470,7 @@
assertTrue(e.getMessage().indexOf("404") != -1); //very weak test
}
- webClient1.uploadTemplateGeometryStream(ownerUsername, templateID, 0, new FileInputStream("src/com/ogoglio/persist/resources/TestCylinder.obj"));
+ webClient1.uploadTemplateGeometryStream(ownerUsername, templateID, 0, getClass().getResourceAsStream("/sample-art3d/TestCylinder.obj"));
}
private void checkPageManipulation(WebAPIClient webClient1, ThingDocument someThing, SpaceDocument spaceDoc) throws IOException {
@@ -515,10 +515,11 @@
String CUBE_GIF = "TestCube.gif";
String CUBE_MATERIAL = "TestCube.mtl";
- webClient1.uploadTemplateGeometryStream(newTemplateDoc.getOwnerUsername(), newTemplateDoc.getTemplateID(), 0, new FileInputStream("src/com/ogoglio/persist/resources/TestCube.obj"));
- webClient1.uploadTemplateResourceStream(newTemplateDoc.getOwnerUsername(), newTemplateDoc.getTemplateID(), CUBE_MATERIAL, new FileInputStream("src/com/ogoglio/persist/resources/TestCube.mtl"));
- webClient1.uploadTemplateResourceStream(newTemplateDoc.getOwnerUsername(), newTemplateDoc.getTemplateID(), CUBE_GIF, new FileInputStream("src/com/ogoglio/persist/resources/TestCube.gif"));
- webClient1.updateTemplateScript(newTemplateDoc.getOwnerUsername(), newTemplateDoc.getTemplateID(), StreamUtils.readInput(new FileInputStream("src/com/ogoglio/persist/resources/TestCube.js")));
+ Class clazz=getClass();
+ webClient1.uploadTemplateGeometryStream(newTemplateDoc.getOwnerUsername(), newTemplateDoc.getTemplateID(), 0, clazz.getResourceAsStream("/sample-art3d/TestCube.obj"));
+ webClient1.uploadTemplateResourceStream(newTemplateDoc.getOwnerUsername(), newTemplateDoc.getTemplateID(), CUBE_MATERIAL, clazz.getResourceAsStream("/sample-art3d/TestCube.mtl"));
+ webClient1.uploadTemplateResourceStream(newTemplateDoc.getOwnerUsername(), newTemplateDoc.getTemplateID(), CUBE_GIF, clazz.getResourceAsStream("/sample-art3d/TestCube.gif"));
+ webClient1.updateTemplateScript(newTemplateDoc.getOwnerUsername(), newTemplateDoc.getTemplateID(), StreamUtils.readInput(clazz.getResourceAsStream("/sample-art3d/TestCube.js")));
baseDoc = webClient1.getTemplateDocument(newTemplateDoc.getOwnerUsername(), newTemplateDoc.getTemplateID());
//make sure the sequence right above didn't take more than 1 sec
@@ -549,7 +550,7 @@
}
//change the geometry to the cylinder
- webClient1.uploadTemplateGeometryStream(newTemplateDoc.getOwnerUsername(), newTemplateDoc.getTemplateID(), 0, new FileInputStream("src/com/ogoglio/persist/resources/TestCylinder.obj"));
+ webClient1.uploadTemplateGeometryStream(newTemplateDoc.getOwnerUsername(), newTemplateDoc.getTemplateID(), 0, getClass().getResourceAsStream("/sample-art3d/TestCylinder.obj"));
afterCylDoc = webClient1.getTemplateDocument(newTemplateDoc.getOwnerUsername(), newTemplateDoc.getTemplateID());
verifyLastChangedTimes(baseDoc.getGeometryModifiedTime(0), afterCylDoc.getGeometryModifiedTime(0), 1000, true, false);
@@ -632,7 +633,7 @@
}
previousLength = possDocs.length;
-// webClient1.deletePossession(targetID);
+ webClient1.deletePossession(targetID);
possDocs = webClient1.getPossessionDocuments();
assertEquals(previousLength - 1, possDocs.length);
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ian...@us...> - 2007-08-21 16:22:47
|
Revision: 255
http://ogoglio.svn.sourceforge.net/ogoglio/?rev=255&view=rev
Author: iansmith
Date: 2007-08-21 09:22:50 -0700 (Tue, 21 Aug 2007)
Log Message:
-----------
Moved hibernate config files to be a resources.
Added forgotten code in com.ogoglio.util.*
Moved log4j config files.
Upgraded pom to start server now at integration test time.
Got data sources into context.xml
We are passing the two big integration tests now.
Added sample-art3d as needed for tests.
Modified Paths:
--------------
maven/trunk/ogoglio-server/.classpath
maven/trunk/ogoglio-server/pom.xml
maven/trunk/ogoglio-server/src/main/java/com/ogoglio/persist/PossessionRecord.java
maven/trunk/ogoglio-server/src/main/java/com/ogoglio/persist/SimRecord.java
maven/trunk/ogoglio-server/src/main/java/com/ogoglio/persist/SpaceMemberRecord.java
maven/trunk/ogoglio-server/src/main/java/com/ogoglio/persist/TemplateRecord.java
maven/trunk/ogoglio-server/src/main/java/com/ogoglio/xml/server/DocumentFactory.java
maven/trunk/ogoglio-server/src/main/webapp/META-INF/context.xml
Added Paths:
-----------
maven/trunk/ogoglio-server/src/main/java/com/ogoglio/util/
maven/trunk/ogoglio-server/src/main/java/com/ogoglio/util/ArgumentUtils.java
maven/trunk/ogoglio-server/src/main/java/com/ogoglio/util/BlockingQueue.java
maven/trunk/ogoglio-server/src/main/java/com/ogoglio/util/ContextMenuInfo.java
maven/trunk/ogoglio-server/src/main/java/com/ogoglio/util/LimitedInputStream.java
maven/trunk/ogoglio-server/src/main/java/com/ogoglio/util/NetworkUtils.java
maven/trunk/ogoglio-server/src/main/java/com/ogoglio/util/OgoglioProperties.java
maven/trunk/ogoglio-server/src/main/java/com/ogoglio/util/PrepareDatabase.java
maven/trunk/ogoglio-server/src/main/java/com/ogoglio/util/StreamUtils.java
maven/trunk/ogoglio-server/src/main/java/com/ogoglio/util/TwoWayMap.java
maven/trunk/ogoglio-server/src/main/java/com/ogoglio/util/URLUTF8Encoder.java
maven/trunk/ogoglio-server/src/main/resources/hibernate/
maven/trunk/ogoglio-server/src/main/resources/hibernate/Persist.hbm.xml
maven/trunk/ogoglio-server/src/main/resources/hibernate/Persist_NoTemplateTables.hbm.xml
maven/trunk/ogoglio-server/src/main/resources/log4j/
maven/trunk/ogoglio-server/src/main/resources/log4j/log4j.properties
maven/trunk/ogoglio-server/src/test/java/com/
maven/trunk/ogoglio-server/src/test/java/com/ogoglio/
maven/trunk/ogoglio-server/src/test/java/com/ogoglio/client/
maven/trunk/ogoglio-server/src/test/java/com/ogoglio/client/test/
maven/trunk/ogoglio-server/src/test/resources/sample-art3d/
maven/trunk/ogoglio-server/src/test/resources/sample-art3d/TestCube.gif
maven/trunk/ogoglio-server/src/test/resources/sample-art3d/TestCube.js
maven/trunk/ogoglio-server/src/test/resources/sample-art3d/TestCube.mtl
maven/trunk/ogoglio-server/src/test/resources/sample-art3d/TestCube.obj
maven/trunk/ogoglio-server/src/test/resources/sample-art3d/TestCylinder.obj
Removed Paths:
-------------
maven/trunk/ogoglio-server/src/main/java/com/ogoglio/persist/Persist.hbm.xml
maven/trunk/ogoglio-server/src/main/java/com/ogoglio/persist/Persist_NoTemplateTables.hbm.xml
Property Changed:
----------------
maven/trunk/ogoglio-server/
Property changes on: maven/trunk/ogoglio-server
___________________________________________________________________
Name: svn:ignore
+ target
Modified: maven/trunk/ogoglio-server/.classpath
===================================================================
--- maven/trunk/ogoglio-server/.classpath 2007-08-21 16:17:53 UTC (rev 254)
+++ maven/trunk/ogoglio-server/.classpath 2007-08-21 16:22:50 UTC (rev 255)
@@ -6,6 +6,5 @@
<classpathentry kind="src" output="target/test-classes" path="src/test/resources"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>
- <classpathentry combineaccessrules="false" kind="src" path="/ogoglio-common"/>
<classpathentry kind="output" path="target/classes"/>
</classpath>
Modified: maven/trunk/ogoglio-server/pom.xml
===================================================================
--- maven/trunk/ogoglio-server/pom.xml 2007-08-21 16:17:53 UTC (rev 254)
+++ maven/trunk/ogoglio-server/pom.xml 2007-08-21 16:22:50 UTC (rev 255)
@@ -3,14 +3,69 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
+
<groupId>com.ogoglio</groupId>
<artifactId>ogoglio-server</artifactId>
<packaging>war</packaging>
<version>0.0.1</version>
<build>
+ <!-- RESOURCES -->
+ <resources>
+ <resource>
+ <directory>src/main/resources/hibernate</directory>
+ <includes>
+ <include>hibernate.cfg.xml</include>
+ </includes>
+ </resource>
+ <resource>
+ <targetPath>com/ogoglio/persist</targetPath>
+ <directory>src/main/resources/hibernate</directory>
+ <includes>
+ <include>Persist.hbm.xml</include>
+ </includes>
+ </resource>
+
+ <resource>
+ <directory>src/main/resources/log4j</directory>
+ <includes>
+ <include>log4j.properties</include>
+ </includes>
+ </resource>
+
+ </resources>
+ <!-- PLUGINS -->
<plugins>
+
+ <!-- SUREFIRE INTEGRATION TEST HACK -->
+
<plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <configuration>
+ <skip>true</skip><!-- this is critical to avoid running unit tests, sets default value for skip -->
+ </configuration>
+ <executions>
+ <execution>
+ <id>over the wire tests</id>
+ <phase>integration-test</phase>
+ <goals>
+ <goal>test</goal>
+ </goals>
+ <configuration>
+ <includes>
+ <!-- we seem to like plurals -->
+ <include>**/*Tests.java</include>
+ </includes>
+ <skip>false</skip><!-- don't skip unit tests -->
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+
+ <!-- CARGO -->
+
+ <plugin>
<groupId>org.codehaus.cargo</groupId>
<artifactId>cargo-maven2-plugin</artifactId>
<version>0.3-SNAPSHOT</version>
@@ -39,7 +94,6 @@
<containerId>tomcat5x</containerId>
<home>/usr/share/tomcat5.5</home>
<type>installed</type>
- <timeout>120</timeout>
<log>
${project.build.directory}/tomcat5x.log
</log>
@@ -57,7 +111,8 @@
8080
</cargo.servlet.port>
<cargo.logging>high</cargo.logging>
- <cargo.datasource.datasource>
+ <!--
+ <cargo.datasource.datasource>
cargo.datasource.url=jdbc:mysql://127.0.0.1/og|
cargo.datasource.driver=com.mysql.jdbc.Driver|
cargo.datasource.username=oguser|
@@ -67,15 +122,21 @@
cargo.datasource.maxIdle=5|
cargo.datasource.maxActive=50|
cargo.datasource.scope=Shareable
- </cargo.datasource.datasource>
-
+ </cargo.datasource.datasource>
+ -->
</properties>
<!-- our app to deploy -->
<deployables>
<deployable>
- <properties>
+
+ <groupId>com.ogoglio</groupId>
+ <artifactId>ogoglio-server</artifactId>
+ <type>war</type>
+
+ <properties>
<context>ogoglio-server</context>
- </properties>
+ </properties>
+
</deployable>
</deployables>
@@ -87,6 +148,7 @@
</build>
+ <!-- where to get cargo -->
<pluginRepositories>
<pluginRepository>
<id>codehaus snapshot repository</id>
@@ -103,34 +165,44 @@
<groupId>com.agical.rmock</groupId>
<artifactId>rmock</artifactId>
<version>2.0.0-rc-6</version>
+ <scope>compile</scope>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate</artifactId>
<version>3.2.1.ga</version>
+ <scope>compile</scope>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
<version>2.3</version>
+ <scope>provided</scope>
</dependency>
<dependency>
<groupId>rhino</groupId>
<artifactId>js</artifactId>
<version>1.6R6</version>
+ <scope>compile</scope>
</dependency>
<dependency>
<groupId>commons-httpclient</groupId>
<artifactId>commons-httpclient</artifactId>
<version>3.0.1</version>
+ <scope>compile</scope>
</dependency>
<dependency>
<groupId>commons-fileupload</groupId>
<artifactId>commons-fileupload</artifactId>
<version>1.2</version>
+ <scope>compile</scope>
</dependency>
-
-
+ <dependency>
+ <groupId>com.ogoglio</groupId>
+ <artifactId>ogoglio-common</artifactId>
+ <version>0.0.1</version>
+ <scope>compile</scope>
+ </dependency>
</dependencies>
</project>
Deleted: maven/trunk/ogoglio-server/src/main/java/com/ogoglio/persist/Persist.hbm.xml
===================================================================
--- maven/trunk/ogoglio-server/src/main/java/com/ogoglio/persist/Persist.hbm.xml 2007-08-21 16:17:53 UTC (rev 254)
+++ maven/trunk/ogoglio-server/src/main/java/com/ogoglio/persist/Persist.hbm.xml 2007-08-21 16:22:50 UTC (rev 255)
@@ -1,215 +0,0 @@
-<?xml version="1.0"?>
-<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
-
-<!--
- 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.
--->
-
-<hibernate-mapping>
-
- <class name="com.ogoglio.persist.PossessionRecord" table="PossessionRecords">
- <id name="possessionID">
- <generator class="increment"/>
- </id>
-
- <property name="ownerUsername" not-null="true" />
- <property name="templateID" />
- <property name="spaceID" />
- <property name="thingID" />
- </class>
-
- <class name="com.ogoglio.persist.BodyRecord" table="BodyRecords">
- <id name="bodyID">
- <generator class="increment"/>
- </id>
-
- <property name="displayName" not-null="true" />
- <property name="ownerUsername" not-null="true" update="false" />
- <property name="hairIndex" />
- <property name="eyesIndex" />
- <property name="noseIndex" />
- <property name="mouthIndex" />
- <property name="faceIndex" />
- <property name="girth" />
- <property name="height" />
- <property name="male" />
- </class>
-
- <class name="com.ogoglio.persist.SpaceRecord" table="SpaceRecords">
- <id name="spaceID" access="field">
- <generator class="increment"/>
- </id>
-
- <property name="displayName" not-null="true" />
- <property name="ownerUsername" not-null="true" update="false" />
- <property name="published" />
- <property name="maxGuests" />
- <property name="displaySea" access="field" />
- <property name="seaLevel" />
- <property name="simID" />
- </class>
-
- <class name="com.ogoglio.persist.SpaceMemberRecord" table="SpaceMemberRecords">
- <id name="spaceMemberID">
- <generator class="increment"/>
- </id>
-
- <property name="spaceID" update="false" />
- <property name="memberUsername" not-null="true" />
- <property name="banned" />
- <property name="role" />
- </class>
-
- <class name="com.ogoglio.persist.SimRecord" table="SimRecords">
- <id name="simID">
- <generator class="increment"/>
- </id>
-
- <property name="displayName" />
- <property name="simURIString" column="simURI" />
- <property name="active" />
- <property name="eventPort" />
- </class>
-
- <class name="com.ogoglio.persist.AccountRecord" table="AccountRecords">
- <id name="username">
- </id>
- <property name="email" not-null="true" unique="true" />
- <property name="accountlevel" not-null="true" />
- <property name="password"/>
- <property name="firstName"/>
- <property name="lastName"/>
- <property name="homepage"/>
- <property name="creationDate" update="false"/>
- <property name="cookie"/>
- <property name="secret"/>
- <property name="frozenUntil"/>
- <property name="defaultBodyID" />
- </class>
-
- <class name="com.ogoglio.persist.TemplateRecord" table="TemplateRecords">
- <id name="templateID">
- <generator class="increment"/>
- </id>
-
- <property name="ownerUsername" not-null="true"/>
- <property name="displayName" not-null="true"/>
- <property name="description"/>
-
- <set name="supportFiles" table="TemplateTemplateSupportFiles" cascade="all">
- <key column="templateID"/>
- <many-to-many
- column="templateSupportFileID"
- unique="true"
- class="com.ogoglio.persist.TemplateSupportFileRecord"/>
- </set>
- </class>
-
- <class name="com.ogoglio.persist.TemplateSupportFileRecord" table="TemplateSupportFileRecords">
- <id name="templateSupportFileID">
- <generator class="increment"/>
- </id>
- <property name="supportFile"/>
- <property name="script" not-null="true"/>
- <property name="levelOfDetail" not-null="true"/>
- <property name="lastChanged" not-null="true"/>
- </class>
- <query name="com.ogoglio.persist.possessionByPossessionID">
- <![CDATA[ from com.ogoglio.persist.PossessionRecord as possession where possession.possessionID = :possessionID ]]>
- </query>
-
- <query name="com.ogoglio.persist.possessionsByOwnerUsername">
- <![CDATA[ from com.ogoglio.persist.PossessionRecord as possession where possession.ownerUsername = :ownerUsername ]]>
- </query>
-
- <query name="com.ogoglio.persist.possessionsBySpaceID">
- <![CDATA[ from com.ogoglio.persist.PossessionRecord as possession where possession.spaceID = :spaceID ]]>
- </query>
-
- <query name="com.ogoglio.persist.templateByID">
- <![CDATA[ from com.ogoglio.persist.TemplateRecord as template where template.templateID = :templateID ]]>
- </query>
-
- <query name="com.ogoglio.persist.templateByIDs">
- <![CDATA[ from com.ogoglio.persist.TemplateRecord as template where template.templateID in ( :templateIDs ) ]]>
- </query>
-
- <query name="com.ogoglio.persist.templateByOwner">
- <![CDATA[ from com.ogoglio.persist.TemplateRecord as template where template.ownerUsername = :ownerUsername ]]>
- </query>
-
- <query name="com.ogoglio.persist.bodyByID">
- <![CDATA[ from com.ogoglio.persist.BodyRecord as body where body.bodyID = :bodyID ]]>
- </query>
-
- <query name="com.ogoglio.persist.bodiesByUsername">
- <![CDATA[ from com.ogoglio.persist.BodyRecord as body where body.ownerUsername = :username ]]>
- </query>
-
- <query name="com.ogoglio.persist.accountByUsername">
- <![CDATA[ from com.ogoglio.persist.AccountRecord as account where account.username = :username ]]>
- </query>
-
- <query name="com.ogoglio.persist.accountByEmail">
- <![CDATA[ from com.ogoglio.persist.AccountRecord as account where account.email = :email ]]>
- </query>
-
- <query name="com.ogoglio.persist.accountByCookie">
- <![CDATA[ from com.ogoglio.persist.AccountRecord as account where account.cookie = :cookie ]]>
- </query>
-
- <query name="com.ogoglio.persist.simByURI">
- <![CDATA[ from com.ogoglio.persist.SimRecord as sim where sim.simURIString = :simURI ]]>
- </query>
-
- <query name="com.ogoglio.persist.simBySimID">
- <![CDATA[ from com.ogoglio.persist.SimRecord as sim where sim.simID = :simID ]]>
- </query>
-
- <query name="com.ogoglio.persist.simsByActive">
- <![CDATA[ from com.ogoglio.persist.SimRecord as sim where sim.active = :active ]]>
- </query>
-
- <query name="com.ogoglio.persist.sims">
- <![CDATA[ from com.ogoglio.persist.SimRecord ]]>
- </query>
-
- <query name="com.ogoglio.persist.accounts">
- <![CDATA[ from com.ogoglio.persist.AccountRecord ]]>
- </query>
-
- <query name="com.ogoglio.persist.bodies">
- <![CDATA[ from com.ogoglio.persist.BodyRecord order by BodyID asc]]>
- </query>
- <query name="com.ogoglio.persist.possessions">
- <![CDATA[ from com.ogoglio.persist.PossessionRecord order by PossessionID asc ]]>
- </query>
- <query name="com.ogoglio.persist.spaces">
- <![CDATA[ from com.ogoglio.persist.SpaceRecord order by SpaceID asc]]>
- </query>
- <query name="com.ogoglio.persist.spacemembers">
- <![CDATA[ from com.ogoglio.persist.SpaceMemberRecord order by SpaceMemberID asc]]>
- </query>
-
- <query name="com.ogoglio.persist.spacesByOwnerUsername">
- <![CDATA[ from com.ogoglio.persist.SpaceRecord as space where space.ownerUsername = :ownerUsername ]]>
- </query>
-
- <query name="com.ogoglio.persist.spaceBySpaceID">
- <![CDATA[ from com.ogoglio.persist.SpaceRecord as space where space.spaceID = :spaceID ]]>
- </query>
-
- <query name="com.ogoglio.persist.spaceMembersBySpaceID">
- <![CDATA[ from com.ogoglio.persist.SpaceMemberRecord as spaceMember where spaceMember.spaceID = :spaceID ]]>
- </query>
-
- <query name="com.ogoglio.persist.spaceMembershipByMemberUsername">
- <![CDATA[ from com.ogoglio.persist.SpaceMemberRecord as spaceMember where spaceMember.memberUsername = :memberUsername ]]>
- </query>
-
- <query name="com.ogoglio.persist.spaceMemberByUsername">
- <![CDATA[ from com.ogoglio.persist.SpaceMemberRecord as spaceMember where spaceMember.spaceID = :spaceID and spaceMember.memberUsername = :username ]]>
- </query>
-</hibernate-mapping>
\ No newline at end of file
Deleted: maven/trunk/ogoglio-server/src/main/java/com/ogoglio/persist/Persist_NoTemplateTables.hbm.xml
===================================================================
--- maven/trunk/ogoglio-server/src/main/java/com/ogoglio/persist/Persist_NoTemplateTables.hbm.xml 2007-08-21 16:17:53 UTC (rev 254)
+++ maven/trunk/ogoglio-server/src/main/java/com/ogoglio/persist/Persist_NoTemplateTables.hbm.xml 2007-08-21 16:22:50 UTC (rev 255)
@@ -1,191 +0,0 @@
-<?xml version="1.0"?>
-<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
-
-<!--
- 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.
--->
-
-<hibernate-mapping>
-
- <class name="com.ogoglio.persist.PossessionRecord" table="PossessionRecords">
- <id name="possessionID">
- <generator class="increment"/>
- </id>
-
- <property name="ownerUsername" not-null="true" />
- <property name="templateID" />
- <property name="spaceID" />
- <property name="thingID" />
- </class>
-
- <class name="com.ogoglio.persist.BodyRecord" table="BodyRecords">
- <id name="bodyID">
- <generator class="increment"/>
- </id>
-
- <property name="displayName" not-null="true" />
- <property name="ownerUsername" not-null="true" update="false" />
- <property name="hairIndex" />
- <property name="eyesIndex" />
- <property name="noseIndex" />
- <property name="mouthIndex" />
- <property name="faceIndex" />
- <property name="girth" />
- <property name="height" />
- <property name="male" />
- </class>
-
- <class name="com.ogoglio.persist.SpaceRecord" table="SpaceRecords">
- <id name="spaceID" access="field">
- <generator class="increment"/>
- </id>
-
- <property name="displayName" not-null="true" />
- <property name="ownerUsername" not-null="true" update="false" />
- <property name="published" />
- <property name="maxGuests" />
- <property name="displaySea" access="field" />
- <property name="seaLevel" />
- <property name="simID" />
- </class>
-
- <class name="com.ogoglio.persist.SpaceMemberRecord" table="SpaceMemberRecords">
- <id name="spaceMemberID">
- <generator class="increment"/>
- </id>
-
- <property name="spaceID" update="false" />
- <property name="memberUsername" not-null="true" />
- <property name="banned" />
- <property name="role" />
- </class>
-
- <class name="com.ogoglio.persist.SimRecord" table="SimRecords">
- <id name="simID">
- <generator class="increment"/>
- </id>
-
- <property name="displayName" />
- <property name="simURIString" column="simURI" />
- <property name="active" />
- <property name="eventPort" />
- </class>
-
- <class name="com.ogoglio.persist.AccountRecord" table="AccountRecords">
- <id name="username">
- </id>
-
- <property name="email" not-null="true" unique="true" />
- <property name="accountlevel" not-null="true" />
- <property name="password"/>
- <property name="firstName"/>
- <property name="lastName"/>
- <property name="homepage"/>
- <property name="creationDate" update="false" />
- <property name="cookie"/>
- <property name="secret"/>
- <property name="frozenUntil"/>
- <property name="defaultBodyID" />
- </class>
-
- <class name="com.ogoglio.persist.TemplateRecord" table="TemplateRecords">
- <id name="templateID">
- <generator class="increment"/>
- </id>
-
- <property name="ownerUsername" not-null="true"/>
- <property name="displayName" not-null="true"/>
- <property name="description"/>
- </class>
- <query name="com.ogoglio.persist.possessionByPossessionID">
- <![CDATA[ from com.ogoglio.persist.PossessionRecord as possession where possession.possessionID = :possessionID ]]>
- </query>
-
- <query name="com.ogoglio.persist.possessionsByOwnerUsername">
- <![CDATA[ from com.ogoglio.persist.PossessionRecord as possession where possession.ownerUsername = :ownerUsername ]]>
- </query>
-
- <query name="com.ogoglio.persist.possessionsBySpaceID">
- <![CDATA[ from com.ogoglio.persist.PossessionRecord as possession where possession.spaceID = :spaceID ]]>
- </query>
-
- <query name="com.ogoglio.persist.templateByID">
- <![CDATA[ from com.ogoglio.persist.TemplateRecord as template where template.templateID = :templateID ]]>
- </query>
-
- <query name="com.ogoglio.persist.templateByIDs">
- <![CDATA[ from com.ogoglio.persist.TemplateRecord as template where template.templateID in ( :templateIDs ) ]]>
- </query>
-
- <query name="com.ogoglio.persist.templateByOwner">
- <![CDATA[ from com.ogoglio.persist.TemplateRecord as template where template.ownerUsername = :ownerUsername ]]>
- </query>
-
- <query name="com.ogoglio.persist.bodyByID">
- <![CDATA[ from com.ogoglio.persist.BodyRecord as body where body.bodyID = :bodyID ]]>
- </query>
-
- <query name="com.ogoglio.persist.bodiesByUsername">
- <![CDATA[ from com.ogoglio.persist.BodyRecord as body where body.ownerUsername = :username ]]>
- </query>
-
- <query name="com.ogoglio.persist.accountByUsername">
- <![CDATA[ from com.ogoglio.persist.AccountRecord as account where account.username = :username ]]>
- </query>
-
- <query name="com.ogoglio.persist.accountByCookie">
- <![CDATA[ from com.ogoglio.persist.AccountRecord as account where account.cookie = :cookie ]]>
- </query>
-
- <query name="com.ogoglio.persist.simByURI">
- <![CDATA[ from com.ogoglio.persist.SimRecord as sim where sim.simURIString = :simURI ]]>
- </query>
-
- <query name="com.ogoglio.persist.simBySimID">
- <![CDATA[ from com.ogoglio.persist.SimRecord as sim where sim.simID = :simID ]]>
- </query>
-
- <query name="com.ogoglio.persist.simsByActive">
- <![CDATA[ from com.ogoglio.persist.SimRecord as sim where sim.active = :active ]]>
- </query>
-
- <query name="com.ogoglio.persist.sims">
- <![CDATA[ from com.ogoglio.persist.SimRecord ]]>
- </query>
- <query name="com.ogoglio.persist.accounts">
- <![CDATA[ from com.ogoglio.persist.AccountRecord ]]>
- </query>
- <query name="com.ogoglio.persist.bodies">
- <![CDATA[ from com.ogoglio.persist.BodyRecord ]]>
- </query>
- <query name="com.ogoglio.persist.possessions">
- <![CDATA[ from com.ogoglio.persist.PossessionRecord ]]>
- </query>
- <query name="com.ogoglio.persist.spaces">
- <![CDATA[ from com.ogoglio.persist.SpaceRecord ]]>
- </query>
- <query name="com.ogoglio.persist.spacemembers">
- <![CDATA[ from com.ogoglio.persist.SpaceMemberRecord ]]>
- </query>
- <query name="com.ogoglio.persist.spacesByOwnerUsername">
- <![CDATA[ from com.ogoglio.persist.SpaceRecord as space where space.ownerUsername = :ownerUsername ]]>
- </query>
-
- <query name="com.ogoglio.persist.spaceBySpaceID">
- <![CDATA[ from com.ogoglio.persist.SpaceRecord as space where space.spaceID = :spaceID ]]>
- </query>
-
- <query name="com.ogoglio.persist.spaceMembersBySpaceID">
- <![CDATA[ from com.ogoglio.persist.SpaceMemberRecord as spaceMember where spaceMember.spaceID = :spaceID ]]>
- </query>
-
- <query name="com.ogoglio.persist.spaceMembershipByMemberUsername">
- <![CDATA[ from com.ogoglio.persist.SpaceMemberRecord as spaceMember where spaceMember.memberUsername = :memberUsername ]]>
- </query>
-
- <query name="com.ogoglio.persist.spaceMemberByUsername">
- <![CDATA[ from com.ogoglio.persist.SpaceMemberRecord as spaceMember where spaceMember.spaceID = :spaceID and spaceMember.memberUsername = :username ]]>
- </query>
-</hibernate-mapping>
\ No newline at end of file
Modified: maven/trunk/ogoglio-server/src/main/java/com/ogoglio/persist/PossessionRecord.java
===================================================================
--- maven/trunk/ogoglio-server/src/main/java/com/ogoglio/persist/PossessionRecord.java 2007-08-21 16:17:53 UTC (rev 254)
+++ maven/trunk/ogoglio-server/src/main/java/com/ogoglio/persist/PossessionRecord.java 2007-08-21 16:22:50 UTC (rev 255)
@@ -42,17 +42,21 @@
return ownerUsername;
}
- /*
+ //hibernate access
private void setOwnerUsername(String ownerUsername) {
this.ownerUsername = ownerUsername;
}
+
+ //hibernate access
private void setTemplateID(long templateID) {
this.templateID = templateID;
}
+
+ //hibernate access
private void setPossessionID(long possessionID) {
this.possessionID = possessionID;
}
- */
+
public long getPossessionID() {
return possessionID;
Modified: maven/trunk/ogoglio-server/src/main/java/com/ogoglio/persist/SimRecord.java
===================================================================
--- maven/trunk/ogoglio-server/src/main/java/com/ogoglio/persist/SimRecord.java 2007-08-21 16:17:53 UTC (rev 254)
+++ maven/trunk/ogoglio-server/src/main/java/com/ogoglio/persist/SimRecord.java 2007-08-21 16:22:50 UTC (rev 255)
@@ -78,18 +78,20 @@
}
return ArgumentUtils.createURI(simURIString);
}
- /*
+
+ //hibernate access
private String getSimURIString() {
return simURIString;
}
+ //hibernate access
private void setSimURIString(String simURIString) {
if(simURIString != null) {
ArgumentUtils.assertIsURI(simURIString);
}
this.simURIString = simURIString;
}
-*/
+
public boolean equals(Object obj) {
if(obj == null || !(obj instanceof SimRecord)) {
return false;
Modified: maven/trunk/ogoglio-server/src/main/java/com/ogoglio/persist/SpaceMemberRecord.java
===================================================================
--- maven/trunk/ogoglio-server/src/main/java/com/ogoglio/persist/SpaceMemberRecord.java 2007-08-21 16:17:53 UTC (rev 254)
+++ maven/trunk/ogoglio-server/src/main/java/com/ogoglio/persist/SpaceMemberRecord.java 2007-08-21 16:22:50 UTC (rev 255)
@@ -62,19 +62,22 @@
public String getMemberUsername() {
return memberUsername;
}
- /*
+
+ //hibernate access
private void setMemberUsername(String memberUsername) {
this.memberUsername = memberUsername;
}
+ //hibernate access
private void setSpaceID(long spaceID) {
this.spaceID = spaceID;
}
+ //hibernate access
private void setSpaceMemberID(long spaceMemberID) {
this.spaceMemberID = spaceMemberID;
}
- */
+
public long getSpaceID() {
return spaceID;
}
Modified: maven/trunk/ogoglio-server/src/main/java/com/ogoglio/persist/TemplateRecord.java
===================================================================
--- maven/trunk/ogoglio-server/src/main/java/com/ogoglio/persist/TemplateRecord.java 2007-08-21 16:17:53 UTC (rev 254)
+++ maven/trunk/ogoglio-server/src/main/java/com/ogoglio/persist/TemplateRecord.java 2007-08-21 16:22:50 UTC (rev 255)
@@ -54,14 +54,17 @@
public String getOwnerUsername() {
return ownerUsername;
}
- /*
+
+ //hibernate access
private void setOwnerUsername(String ownerUsername) {
this.ownerUsername = ownerUsername;
}
+
+ //hibernate access
private void setTemplateID(long templateID) {
this.templateID = templateID;
}
- */
+
public long getTemplateID() {
return templateID;
}
Added: maven/trunk/ogoglio-server/src/main/java/com/ogoglio/util/ArgumentUtils.java
===================================================================
--- maven/trunk/ogoglio-server/src/main/java/com/ogoglio/util/ArgumentUtils.java (rev 0)
+++ maven/trunk/ogoglio-server/src/main/java/com/ogoglio/util/ArgumentUtils.java 2007-08-21 16:22:50 UTC (rev 255)
@@ -0,0 +1,104 @@
+/* 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.util;
+
+import java.io.File;
+import java.net.URI;
+import java.net.URISyntaxException;
+
+public class ArgumentUtils {
+
+ public static void assertNotEmpty(String value) {
+ if (value == null || value.trim().length() == 0) {
+ throw new IllegalArgumentException("String was empty.");
+ }
+ }
+
+ public static void assertNotNull(Object object) {
+ if (object == null) {
+ throw new IllegalArgumentException("Argument was null");
+ }
+ }
+
+ public static void assertNotNegative(long bodyID) {
+ if (bodyID < 0) {
+ throw new IllegalArgumentException("Argument was less than zero");
+ }
+ }
+
+ public static void assertNotNegative(float skinRed) {
+ if (skinRed < 0) {
+ throw new IllegalArgumentException("Argument was less than zero");
+ }
+ }
+
+ public static void assertIsURI(String uri) {
+ try {
+ new URI(uri);
+ } catch (URISyntaxException e) {
+ throw new IllegalArgumentException("Bad uri: " + uri);
+ }
+ }
+
+ public static URI createURI(String uriString) {
+ try {
+ return new URI(uriString);
+ } catch (URISyntaxException e) {
+ throw new IllegalArgumentException("Bad uri: " + uriString);
+ }
+ }
+
+ public static void assertReadableFile(String path) {
+ File file = new File(path);
+ if(!file.exists() || !file.canRead() || !file.isFile()) {
+ throw new IllegalArgumentException("No readable file at " + path);
+ }
+ }
+
+ public static void assertReadableDir(File file, boolean createIfPossible) {
+ if (file == null) {
+ throw new IllegalArgumentException("Null directory");
+ }
+
+ if (file.exists()) {
+ if(!file.isDirectory()) {
+ throw new IllegalArgumentException("Expected a directory: " + file);
+ }
+ if (!file.canRead()) {
+ throw new IllegalArgumentException("Can't read this directory: " + file);
+ }
+ return;
+ } else if(createIfPossible && file.mkdirs()){
+ return;
+ }
+ throw new IllegalArgumentException("Can't read this directory: " + file);
+ }
+
+ public static void assertNoPaths(String name) {
+ if(name == null || name.trim().length() == 0) {
+ return;
+ }
+ if(name.indexOf("..") != -1) {
+ throw new IllegalArgumentException("Bad name: " + name);
+ }
+ }
+
+ public static void assertBoringDouble(double value) {
+ if(Double.isInfinite(value) || Double.isInfinite(value)) {
+ throw new IllegalArgumentException("Bad double: " + value);
+ }
+ }
+
+
+}
Added: maven/trunk/ogoglio-server/src/main/java/com/ogoglio/util/BlockingQueue.java
===================================================================
--- maven/trunk/ogoglio-server/src/main/java/com/ogoglio/util/BlockingQueue.java (rev 0)
+++ maven/trunk/ogoglio-server/src/main/java/com/ogoglio/util/BlockingQueue.java 2007-08-21 16:22:50 UTC (rev 255)
@@ -0,0 +1,84 @@
+/* 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.util;
+
+import java.util.LinkedList;
+import java.util.NoSuchElementException;
+
+public class BlockingQueue {
+
+ private int maxSize = -1;
+
+ private LinkedList elements = new LinkedList();
+
+ private boolean closed = false;
+
+ public class QueueClosedException extends RuntimeException {
+ }
+
+ public class QueueOverflowException extends RuntimeException {
+ }
+
+ public synchronized final void enqueue(Object element) throws QueueClosedException, QueueOverflowException {
+ if (closed) {
+ throw new QueueClosedException();
+ }
+ if (maxSize > -1 && elements.size() >= maxSize) {
+ throw new QueueOverflowException();
+ }
+ elements.addLast(element);
+ notify();
+ }
+
+ public synchronized final int size() {
+ return elements.size();
+ }
+
+ public synchronized final Object dequeue() throws InterruptedException, QueueClosedException {
+ try {
+ while (elements.size() <= 0) {
+ wait();
+ if (closed) {
+ throw new QueueClosedException();
+ }
+ }
+ return elements.removeFirst();
+ } catch (NoSuchElementException e) {
+ throw new Error("No such element exception: " + e);
+ }
+ }
+
+ public synchronized final boolean isEmpty() {
+ return elements.size() == 0;
+ }
+
+ public synchronized boolean isClosed() {
+ return closed;
+ }
+
+ public synchronized void close() {
+ closed = true;
+ notifyAll();
+ elements.clear();
+ }
+
+ public synchronized int getMaxSize() {
+ return maxSize;
+ }
+
+ public synchronized void setMaxSize(int maxSize) {
+ this.maxSize = maxSize;
+ }
+}
\ No newline at end of file
Added: maven/trunk/ogoglio-server/src/main/java/com/ogoglio/util/ContextMenuInfo.java
===================================================================
--- maven/trunk/ogoglio-server/src/main/java/com/ogoglio/util/ContextMenuInfo.java (rev 0)
+++ maven/trunk/ogoglio-server/src/main/java/com/ogoglio/util/ContextMenuInfo.java 2007-08-21 16:22:50 UTC (rev 255)
@@ -0,0 +1,23 @@
+package com.ogoglio.util;
+
+public class ContextMenuInfo {
+ private String userVisibleString;
+ private String id;
+ private boolean enabled;
+
+ public String getUserVisibleString() {
+ return userVisibleString;
+ }
+ public String getId() {
+ return id;
+ }
+ public boolean getEnabled() {
+ return enabled;
+ }
+ public void setValues(String textToShow, boolean notGrayedOut, String forCallback) {
+ userVisibleString=textToShow;
+ enabled=notGrayedOut;
+ id=forCallback;
+ }
+
+}
Added: maven/trunk/ogoglio-server/src/main/java/com/ogoglio/util/LimitedInputStream.java
===================================================================
--- maven/trunk/ogoglio-server/src/main/java/com/ogoglio/util/LimitedInputStream.java (rev 0)
+++ maven/trunk/ogoglio-server/src/main/java/com/ogoglio/util/LimitedInputStream.java 2007-08-21 16:22:50 UTC (rev 255)
@@ -0,0 +1,56 @@
+/* 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.util;
+
+import java.io.IOException;
+import java.io.InputStream;
+
+public class LimitedInputStream extends InputStream {
+
+ private InputStream input = null;
+
+ private int maxRead = -1;
+
+ private int read = 0;
+
+ public LimitedInputStream(InputStream input, int maxRead) {
+ this.input = input;
+ this.maxRead = maxRead;
+ }
+
+ public int read(byte[] buffer) throws IOException {
+ return read(buffer, 0, buffer.length);
+ }
+
+ public int read(byte[] buffer, int offset, int len) throws IOException {
+ if (read >= maxRead) {
+ return -1;
+ }
+
+ if (read + len > maxRead) {
+ len = maxRead - read;
+ }
+ return super.read(buffer, offset, len);
+ }
+
+ public int read() throws IOException {
+ if (read >= maxRead) {
+ return -1;
+ }
+ int result = input.read();
+ read++;
+ return result;
+ }
+}
Added: maven/trunk/ogoglio-server/src/main/java/com/ogoglio/util/NetworkUtils.java
===================================================================
--- maven/trunk/ogoglio-server/src/main/java/com/ogoglio/util/NetworkUtils.java (rev 0)
+++ maven/trunk/ogoglio-server/src/main/java/com/ogoglio/util/NetworkUtils.java 2007-08-21 16:22:50 UTC (rev 255)
@@ -0,0 +1,61 @@
+/* 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.util;
+
+import java.net.InetAddress;
+import java.net.NetworkInterface;
+import java.net.SocketException;
+import java.util.Enumeration;
+
+public class NetworkUtils {
+
+ public static String LOCAL_HOST_ADDRESS = null;
+
+ static boolean notified = false;
+
+ public static void setLocalHostAddress(String hostAddress) {
+ if (hostAddress == null || hostAddress.trim().length() == 0) {
+ throw new IllegalArgumentException("bad host address: " + hostAddress);
+ }
+ LOCAL_HOST_ADDRESS = hostAddress;
+ }
+
+ public static String getLocalHostAddress() {
+ if (LOCAL_HOST_ADDRESS != null) {
+ return LOCAL_HOST_ADDRESS;
+ }
+ try {
+ Enumeration interfaces = NetworkInterface.getNetworkInterfaces();
+ while (interfaces.hasMoreElements()) {
+ NetworkInterface netInterface = (NetworkInterface) interfaces.nextElement();
+ Enumeration addresses = netInterface.getInetAddresses();
+ while (addresses.hasMoreElements()) {
+ InetAddress address = (InetAddress) addresses.nextElement();
+ if (!address.isLoopbackAddress() && address.getHostAddress().indexOf(":") == -1) {
+ return address.getHostAddress();
+ }
+ }
+ }
+ } catch (SocketException e) {
+ throw new IllegalStateException("Could not find local addresses");
+ }
+ if (!notified) {
+ notified = true;
+ System.out.println("Using 127.0.0.1 as local address");
+ }
+ return "127.0.0.1";
+ }
+
+}
Added: maven/trunk/ogoglio-server/src/main/java/com/ogoglio/util/OgoglioProperties.java
===================================================================
--- maven/trunk/ogoglio-server/src/main/java/com/ogoglio/util/OgoglioProperties.java (rev 0)
+++ maven/trunk/ogoglio-server/src/main/java/com/ogoglio/util/OgoglioProperties.java 2007-08-21 16:22:50 UTC (rev 255)
@@ -0,0 +1,74 @@
+package com.ogoglio.util;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.IOException;
+import java.util.Properties;
+
+public class OgoglioProperties extends Properties {
+
+ public static final String PROPERTY_FILE_NAME = ".ogoglio-properties";
+ private static OgoglioProperties prop=null;
+
+ public static String WHICH_DB = "database_choice";
+ public static String WHICH_MYSQL = "mysql";
+ public static String WHICH_HSQL = "hsql";
+
+ // the reason these properties are duplicated is to make it easy to switch in the configuration
+ // file by changing only one line and leaving everything else in place
+ public static String MYSQL_DB_DIALECT = "database_mysql_hibernate_dialect";
+ public static String MYSQL_DB_DRIVER= "database_mysql_driver";
+
+ public static String MYSQL_DB_SERVER_URI = "database_mysql_server_uri";
+ public static String MYSQL_DB_SERVER_USER = "database_mysql_server_user";
+ public static String MYSQL_DB_SERVER_PASS = "database_mysql_server_pass";
+
+ public static String MYSQL_DB_TEST_URI = "database_mysql_test_uri";
+ public static String MYSQL_DB_TEST_USER = "database_mysql_test_user";
+ public static String MYSQL_DB_TEST_PASS = "database_mysql_test_pass";
+
+ public static String HSQL_DB_DIALECT = "database_hsql_hibernate_dialect";
+ public static String HSQL_DB_DRIVER= "database_hsql_driver";
+
+ public static String HSQL_DB_SERVER_URI = "database_hsql_server_uri";
+ public static String HSQL_DB_SERVER_USER = "database_hsql_server_user";
+ public static String HSQL_DB_SERVER_PASS = "database_hsql_server_pass";
+
+ public static String HSQL_DB_TEST_URI = "database_hsql_test_uri";
+ public static String HSQL_DB_TEST_USER = "database_hsql_test_user";
+ public static String HSQL_DB_TEST_PASS = "database_hsql_test_pass";
+
+ private OgoglioProperties() {
+
+ }
+
+ public static void validate() {
+ if (prop!=null) {
+ return;
+ }
+ //init
+ File f = new File(System.getProperty("user.home"),PROPERTY_FILE_NAME);
+ prop=new OgoglioProperties();
+ try {
+ prop.load(new FileInputStream(f));
+ } catch (FileNotFoundException e) {
+ System.err.println("Can't find ogoglio properties file ("+f.getPath()+"):"+e.getMessage());
+ System.exit(1);
+ } catch (IOException e) {
+ System.err.println("Error reading ogoglio properties file ("+f.getPath()+"):"+e.getMessage());
+ System.exit(1);
+ }
+ }
+
+ public static String getOgoglioProperty(String pname)
+ {
+ validate();
+ String result = prop.getProperty(pname,null);
+ if (result==null) {
+ System.out.println("Unable to locate property "+pname+" in your "+PROPERTY_FILE_NAME+" file! Aborting!");
+ System.exit(1);
+ }
+ return result;
+ }
+}
Added: maven/trunk/ogoglio-server/src/main/java/com/ogoglio/util/PrepareDatabase.java
===================================================================
--- maven/trunk/ogoglio-server/src/main/java/com/ogoglio/util/PrepareDatabase.java (rev 0)
+++ maven/trunk/ogoglio-server/src/main/java/com/ogoglio/util/PrepareDatabase.java 2007-08-21 16:22:50 UTC (rev 255)
@@ -0,0 +1,95 @@
+package com.ogoglio.util;
+
+import java.net.URI;
+
+import org.hibernate.SessionFactory;
+
+import com.ogoglio.persist.HibernateBase;
+import com.ogoglio.persist.ServiceInitializationPersistTasks;
+
+public class PrepareDatabase extends HibernateBase {
+
+ /*
+ * This is the beginning of a utility program to allow you be sure that your database is ready to
+ * be used by the space (web) service. This opens the database in the correct mode to get it to
+ * drop all the existing tables, create them according to the Persist.hbm.xml document while dumping
+ * to the terminal the SQL it is using, and then exiting cleanly.
+ *
+ * This is program is only used on development machines to initialize their local HSQL instance
+ * into a fresh state. After this program has run successfully, you can fire up the web service,
+ * and the test suite can AND SHOULD be run.
+ */
+ /**
+ * @param args IGNORED
+ */
+ public static void main(String[] args) {
+ if (args.length!=0) {
+ System.out.println("Dosen't take command line parameters, use the .ogoglio-properties file!");
+ System.exit(1);
+ }
+ PrepareDatabase db= new PrepareDatabase();
+ db.start(false);
+ db.start(true);
+ System.out.println("Completed successfully. DBs are now ready.");
+ }
+
+ public void setupSessionFactory(boolean isServer) {
+ String autoDDL = "create";
+
+ if (isServer) {
+ if (OgoglioProperties.getOgoglioProperty(OgoglioProperties.WHICH_DB).equals(OgoglioProperties.WHICH_MYSQL)) {
+ setupSessionFactory("com/ogoglio/persist/Persist.hbm.xml", autoDDL,
+ OgoglioProperties.getOgoglioProperty(OgoglioProperties.MYSQL_DB_DIALECT),
+ OgoglioProperties.getOgoglioProperty(OgoglioProperties.MYSQL_DB_DRIVER),
+ OgoglioProperties.getOgoglioProperty(OgoglioProperties.MYSQL_DB_SERVER_URI),
+ OgoglioProperties.getOgoglioProperty(OgoglioProperties.MYSQL_DB_SERVER_USER),
+ OgoglioProperties.getOgoglioProperty(OgoglioProperties.MYSQL_DB_SERVER_PASS),
+ "5");
+
+ } else {
+ setupSessionFactory("com/ogoglio/persist/Persist.hbm.xml", autoDDL,
+ OgoglioProperties.getOgoglioProperty(OgoglioProperties.HSQL_DB_DIALECT),
+ OgoglioProperties.getOgoglioProperty(OgoglioProperties.HSQL_DB_DRIVER),
+ OgoglioProperties.getOgoglioProperty(OgoglioProperties.HSQL_DB_SERVER_URI),
+ OgoglioProperties.getOgoglioProperty(OgoglioProperties.HSQL_DB_SERVER_USER),
+ OgoglioProperties.getOgoglioProperty(OgoglioProperties.HSQL_DB_SERVER_PASS),
+ "5");
+ }
+ } else {
+ if (OgoglioProperties.getOgoglioProperty(OgoglioProperties.WHICH_DB).equals(OgoglioProperties.WHICH_MYSQL)) {
+ setupSessionFactory("com/ogoglio/persist/Persist.hbm.xml", autoDDL,
+ OgoglioProperties.getOgoglioProperty(OgoglioProperties.MYSQL_DB_DIALECT),
+ OgoglioProperties.getOgoglioProperty(OgoglioProperties.MYSQL_DB_DRIVER),
+ OgoglioProperties.getOgoglioProperty(OgoglioProperties.MYSQL_DB_TEST_URI),
+ OgoglioProperties.getOgoglioProperty(OgoglioProperties.MYSQL_DB_TEST_USER),
+ OgoglioProperties.getOgoglioProperty(OgoglioProperties.MYSQL_DB_TEST_PASS),
+ "5");
+
+ } else {
+ setupSessionFactory("com/ogoglio/persist/Persist.hbm.xml", autoDDL,
+ OgoglioProperties.getOgoglioProperty(OgoglioProperties.HSQL_DB_DIALECT),
+ OgoglioProperties.getOgoglioProperty(OgoglioProperties.HSQL_DB_DRIVER),
+ OgoglioProperties.getOgoglioProperty(OgoglioProperties.HSQL_DB_TEST_URI),
+ OgoglioProperties.getOgoglioProperty(OgoglioProperties.HSQL_DB_TEST_USER),
+ OgoglioProperties.getOgoglioProperty(OgoglioProperties.HSQL_DB_TEST_PASS),
+ "5");
+ }
+ }
+ }
+ public void start(boolean isServer) {
+ setupSessionFactory(isServer);
+ String host = "127.0.0.1";
+ String siteInfo = "http://"+host+":8080/og"; //configured in server.xml
+ SessionFactory sessionFactory = getSessionFactory();
+ System.out.println("start:"+isServer+": with session Factory:"+sessionFactory.toString());
+ try {
+ ServiceInitializationPersistTasks.initializeLocalSim(new URI(siteInfo), sessionFactory);
+ ServiceInitializationPersistTasks.initializeLibraryAccount(sessionFactory,host);
+ sessionFactory.close();
+ } catch (Exception e) {
+ e.printStackTrace();
+ System.err.println("Exception during attempt to init DB:\n"+e.getMessage());
+ }
+ }
+
+}
Added: maven/trunk/ogoglio-server/src/main/java/com/ogoglio/util/StreamUtils.java
===================================================================
--- maven/trunk/ogoglio-server/src/main/java/com/ogoglio/util/StreamUtils.java (rev 0)
+++ maven/trunk/ogoglio-server/src/main/java/com/ogoglio/util/StreamUtils.java 2007-08-21 16:22:50 UTC (rev 255)
@@ -0,0 +1,85 @@
+/* Copyright 2007 Transmutable (http://transmutable.com/)
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License. */
+
+package com.ogoglio.util;
+
+import java.io.ByteArrayInputStream;
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+
+public class StreamUtils {
+
+ public static final String readInput(InputStream input) throws IOException {
+ StringBuffer results = new StringBuffer();
+ byte[] buffer = new byte[2048];
+ int read = -1;
+ while ((read = input.read(buffer)) > 0) {
+ results.append(new String(buffer, 0, read));
+ }
+ input.close();
+ return results.toString();
+ }
+
+ public static final void write(String input, OutputStream output) throws IOException {
+ write(new ByteArrayInputStream(input.getBytes()), output);
+ }
+
+ public static void write(InputStream input, OutputStream output) throws IOException {
+ write(input, output, -1);
+ }
+
+ public static void write(InputStream input, OutputStream output, long maxLength) throws IOException {
+ byte[] buffer = new byte[2048];
+ int read = -1;
+ int totalRead = 0;
+ while ((read = input.read(buffer)) > 0) {
+ totalRead += read;
+ if (maxLength > -1 && totalRead > maxLength) {
+ throw new IOException("Exceded max length (" + maxLength + "): " + totalRead);
+ }
+ output.write(buffer, 0, read);
+ }
+ input.close();
+ output.flush();
+ output.close();
+ }
+
+ public static void copyResource(String resourceName, File destinationDir) throws IOException {
+ InputStream resourceStream = StreamUtils.class.getClassLoader().getResourceAsStream(resourceName);
+ if (resourceStream == null) {
+ throw new IOException("No such resource: " + resourceName);
+ }
+ write(resourceStream, new FileOutputStream(destinationDir), -1);
+ }
+
+ public static String readInput(InputStream input, int maxLength) throws IOException {
+ StringBuffer results = new StringBuffer();
+ byte[] buffer = new byte[2048];
+ int read = -1;
+ int totalRead = 0;
+ while ((read = input.read(buffer)) > 0) {
+ totalRead += read;
+ if (maxLength > -1 && totalRead > maxLength) {
+ throw new IOException("Exceded max length (" + maxLength + "): " + totalRead);
+ }
+ results.append(new String(buffer, 0, read));
+ }
+ input.close();
+ return results.toString();
+ }
+
+}
Added: maven/trunk/ogoglio-server/src/main/java/com/ogoglio/util/TwoWayMap.java
===================================================================
--- maven/trunk/ogoglio-server/src/main/java/com/ogoglio/util/TwoWayMap.java (rev 0)
+++ maven/trunk/ogoglio-server/src/main/java/com/ogoglio/util/TwoWayMap.java 2007-08-21 16:22:50 UTC (rev 255)
@@ -0,0 +1,106 @@
+/* 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.util;
+
+import java.util.HashMap;
+import java.util.Vector;
+
+public class TwoWayMap {
+
+ private HashMap forwardMap = new HashMap();
+
+ private HashMap backwardMap = new HashMap();
+
+ public synchronized void put(Object obj1, Object obj2) {
+ if (obj1 == null || obj2 == null) {
+ throw new IllegalArgumentException("Cannot add nulls");
+ }
+ forwardMap.put(obj1, obj2);
+ backwardMap.put(obj2, obj1);
+ }
+
+ public synchronized Object removeForward(Object key) {
+ Object obj2 = forwardMap.remove(key);
+ if (obj2 == null) {
+ return null;
+ }
+ backwardMap.remove(obj2);
+ return obj2;
+ }
+
+ public synchronized Object removeBackward(Object key) {
+ Object obj1 = backwardMap.remove(key);
+ if (obj1 == null) {
+ return null;
+ }
+ forwardMap.remove(obj1);
+ return obj1;
+ }
+
+ public synchronized Object getForward(Object obj1) {
+ return forwardMap.get(obj1);
+ }
+
+ public synchronized Object getBackward(Object obj2) {
+ return backwardMap.get(obj2);
+ }
+
+ public synchronized boolean containsForward(Object obj) {
+ return forwardMap.containsValue(obj);
+ }
+
+ public synchronized boolean containsBackward(Object obj) {
+ return backwardMap.containsValue(obj);
+ }
+
+ public synchronized Object[] getValues() {
+ return forwardMap.values().toArray();
+ }
+
+ public synchronized Object[] getValues(Filter keyFilter) {
+ Vector results = new Vector();
+ Object[] keys = forwardMap.keySet().toArray();
+ for (int i = 0; i < keys.length; i++) {
+ if (keyFilter.matches(keys[i])) {
+ results.add(forwardMap.get(keys[i]));
+ }
+ }
+ return results.toArray();
+ }
+
+ public Object[] getKeys() {
+ return forwardMap.keySet().toArray();
+ }
+
+ public Object[] getKeys(Filter valueFilter) {
+ Vector results = new Vector();
+ Object[] keys = forwardMap.keySet().toArray();
+ for (int i = 0; i < keys.length; i++) {
+ if (valueFilter.matches(forwardMap.get(keys[i]))) {
+ results.add(keys[i]);
+ }
+ }
+ return results.toArray();
+ }
+
+ public interface Filter {
+ public boolean matches(Object obj);
+ }
+
+ public long getSize() {
+ return forwardMap.size();
+ }
+
+}
Added: maven/trunk/ogoglio-server/src/main/java/com/ogoglio/util/URLUTF8Encoder.java
===================================================================
--- maven/trunk/ogoglio-server/src/main/java/com/ogoglio/util/URLUTF8Encoder.java (rev 0)
+++ maven/trunk/ogoglio-server/src/main/java/com/ogoglio/util/URLUTF8Encoder.java 2007-08-21 16:22:50 UTC (rev 255)
@@ -0,0 +1,108 @@
+package com.ogoglio.util;
+
+/**
+ * From the excellent WWW Consortium: http://www.w3.org/
+ * Provides a method to encode any string into a URL-safe
+ * form.
+ * Non-ASCII characters are first encoded as sequences of
+ * two or three bytes, using the UTF-8 algorithm, before being
+ * encoded as %HH escapes.
+ */
+public class URLUTF8Encoder
+{
+
+ final static String[] hex = {
+ "%00", "%01", "%02", "%03", "%04", "%05", "%06", "%07",
+ "%08", "%09", "%0a", "%0b", "%0c", "%0d", "%0e", "%0f",
+ "%10", "%11", "%12", "%13", "%14", "%15", "%16", "%17",
+ "%18", "%19", "%1a", "%1b", "%1c", "%1d", "%1e", "%1f",
+ "%20", "%21", "%22", "%23", "%24", "%25", "%26", "%27",
+ "%28", "%29", "%2a", "%2b", "%2c", "%2d", "%2e", "%2f",
+ "%30", "%31", "%32", "%33", "%34", "%35", "%36", "%37",
+ "%38", "%39", "%3a", "%3b", "%3c", "%3d", "%3e", "%3f",
+ "%40", "%41", "%42", "%43", "%44", "%45", "%46", "%47",
+ "%48", "%49", "%4a", "%4b", "%4c", "%4d", "%4e", "%4f",
+ "%50", "%51", "%52", "%53", "%54", "%55", "%56", "%57",
+ "%58", "%59", "%5a", "%5b", "%5c", "%5d", "%5e", "%5f",
+ "%60", "%61", "%62", "%63", "%64", "%65", "%66", "%67",
+ "%68", "%69", "%6a", "%6b", "%6c", "%6d", "%6e", "%6f",
+ "%70", "%71", "%72", "%73", "%74", "%75", "%76", "%77",
+ "%78", "%79", "%7a", "%7b", "%7c", "%7d", "%7e", "%7f",
+ "%80", "%81", "%82", "%83", "%84", "%85", "%86", "%87",
+ "%88", "%89", "%8a", "%8b", "%8c", "%8d", "%8e", "%8f",
+ "%90", "%91", "%92", "%93", "%94", "%95", "%96", "%97",
+ "%98", "%99", "%9a", "%9b", "%9c", "%9d", "%9e", "%9f",
+ "%a0", "%a1", "%a2", "%a3", "%a4", "%a5", "%a6", "%a7",
+ "%a8", "%a9", "%aa", "%ab", "%ac", "%ad", "%ae", "%af",
+ "%b0", "%b1", "%b2", "%b3", "%b4", "%b5", "%b6", "%b7",
+ "%b8", "%b9", "%ba", "%bb", "%bc", "%bd", "%be", "%bf",
+ "%c0", "%c1", "%c2", "%c3", "%c4", "%c5", "%c6", "%c7",
+ "%c8", "%c9", "%ca", "%cb", "%cc", "%cd", "%ce", "%cf",
+ "%d0", "%d1", "%d2", "%d3", "%d4", "%d5", "%d6", "%d7",
+ "%d8", "%d9", "%da", "%db", "%dc", "%dd", "%de", "%df",
+ "%e0", "%e1", "%e2", "%e3", "%e4", "%e5", "%e6", "%e7",
+ "%e8", "%e9", "%ea", "%eb", "%ec", "%ed", "%ee", "%ef",
+ "%f0", "%f1", "%f2", "%f3", "%f4", "%f5", "%f6", "%f7",
+ "%f8", "%f9", "%fa", "%fb", "%fc", "%fd", "%fe", "%ff"
+ };
+
+ /**
+ * Encode a string to the "x-www-form-urlencoded" form, enhanced
+ * with the UTF-8-in-URL proposal. This is what happens:
+ *
+ * <ul>
+ * <li><p>The ASCII characters 'a' through 'z', 'A' through 'Z',
+ * and '0' through '9' remain the same.
+ *
+ * <li><p>The unreserved ch...
[truncated message content] |
|
From: <ian...@us...> - 2007-08-21 16:17:50
|
Revision: 254
http://ogoglio.svn.sourceforge.net/ogoglio/?rev=254&view=rev
Author: iansmith
Date: 2007-08-21 09:17:53 -0700 (Tue, 21 Aug 2007)
Log Message:
-----------
Don't know it feels this is modified.
Property Changed:
----------------
maven/trunk/ogoglio-test-applet/
Property changes on: maven/trunk/ogoglio-test-applet
___________________________________________________________________
Name: svn:ignore
+ target
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ian...@us...> - 2007-08-21 16:17:26
|
Revision: 253
http://ogoglio.svn.sourceforge.net/ogoglio/?rev=253&view=rev
Author: iansmith
Date: 2007-08-21 09:17:29 -0700 (Tue, 21 Aug 2007)
Log Message:
-----------
Added test resources in correct place. Passing all tests now.
Added Paths:
-----------
maven/trunk/ogoglio-viewer-applet/src/test/resources/sample-art3d/
maven/trunk/ogoglio-viewer-applet/src/test/resources/sample-art3d/door.mtl
maven/trunk/ogoglio-viewer-applet/src/test/resources/sample-art3d/door.obj
Property Changed:
----------------
maven/trunk/ogoglio-viewer-applet/
Property changes on: maven/trunk/ogoglio-viewer-applet
___________________________________________________________________
Name: svn:ignore
+ target
Added: maven/trunk/ogoglio-viewer-applet/src/test/resources/sample-art3d/door.mtl
===================================================================
--- maven/trunk/ogoglio-viewer-applet/src/test/resources/sample-art3d/door.mtl (rev 0)
+++ maven/trunk/ogoglio-viewer-applet/src/test/resources/sample-art3d/door.mtl 2007-08-21 16:17:29 UTC (rev 253)
@@ -0,0 +1,28 @@
+-----------------------------823378840143542612896544303
+Content-Disposition: form-data; name="mtlFile"; filename="BlandDoor.mtl"
+Content-Type: application/octet-stream
+
+# Blender3D MTL File: BlandDoor.blend
+# Material Count: 2
+newmtl Material.001
+Ns 96.078431
+Ka 0.000000 0.000000 0.000000
+Kd 0.160000 0.160000 0.160000
+Ks 0.500000 0.500000 0.500000
+Ni 1.000000
+d 1.000000
+illum 2
+
+
+newmtl Material
+Ns 96.078431
+Ka 0.000000 0.000000 0.000000
+Kd 0.301689 0.640000 0.640000
+Ks 0.500000 0.500000 0.500000
+Ni 1.000000
+d 1.000000
+illum 2
+
+
+
+-----------------------------823378840143542612896544303--
Added: maven/trunk/ogoglio-viewer-applet/src/test/resources/sample-art3d/door.obj
===================================================================
--- maven/trunk/ogoglio-viewer-applet/src/test/resources/sample-art3d/door.obj (rev 0)
+++ maven/trunk/ogoglio-viewer-applet/src/test/resources/sample-art3d/door.obj 2007-08-21 16:17:29 UTC (rev 253)
@@ -0,0 +1,279 @@
+mtllib door.mtl
+g Knob_Cylinder
+v 0.489762 1.060026 0.053800
+v 0.483071 1.068179 0.053800
+v 0.478099 1.077480 0.053800
+v 0.475038 1.087573 0.053800
+v 0.474004 1.098068 0.053800
+v 0.475038 1.108564 0.053800
+v 0.478099 1.118657 0.053800
+v 0.483071 1.127958 0.053800
+v 0.489762 1.136111 0.053800
+v 0.497914 1.142801 0.053800
+v 0.507216 1.147773 0.053800
+v 0.517308 1.150835 0.053800
+v 0.527804 1.151868 0.053800
+v 0.538300 1.150835 0.053800
+v 0.548392 1.147773 0.053800
+v 0.557694 1.142801 0.053800
+v 0.565846 1.136111 0.053800
+v 0.572537 1.127958 0.053800
+v 0.577509 1.118657 0.053800
+v 0.580570 1.108564 0.053800
+v 0.581604 1.098068 0.053800
+v 0.580570 1.087573 0.053800
+v 0.577509 1.077480 0.053800
+v 0.572537 1.068179 0.053800
+v 0.565846 1.060026 0.053800
+v 0.557693 1.053335 0.053800
+v 0.548392 1.048364 0.053800
+v 0.538300 1.045302 0.053800
+v 0.527804 1.044269 0.053800
+v 0.517308 1.045302 0.053800
+v 0.507216 1.048364 0.053800
+v 0.497914 1.053336 0.053800
+v 0.489762 1.060026 -0.053800
+v 0.483071 1.068179 -0.053800
+v 0.478099 1.077480 -0.053800
+v 0.475038 1.087573 -0.053800
+v 0.474004 1.098069 -0.053800
+v 0.475038 1.108564 -0.053800
+v 0.478099 1.118657 -0.053800
+v 0.483071 1.127958 -0.053800
+v 0.489762 1.136111 -0.053800
+v 0.497914 1.142801 -0.053800
+v 0.507216 1.147773 -0.053800
+v 0.517308 1.150835 -0.053800
+v 0.527804 1.151868 -0.053800
+v 0.538300 1.150835 -0.053800
+v 0.548392 1.147773 -0.053800
+v 0.557693 1.142801 -0.053800
+v 0.565846 1.136111 -0.053800
+v 0.572537 1.127958 -0.053800
+v 0.577508 1.118657 -0.053800
+v 0.580570 1.108564 -0.053800
+v 0.581604 1.098069 -0.053800
+v 0.580570 1.087573 -0.053800
+v 0.577509 1.077480 -0.053800
+v 0.572537 1.068179 -0.053800
+v 0.565846 1.060026 -0.053800
+v 0.557694 1.053336 -0.053800
+v 0.548393 1.048364 -0.053800
+v 0.538300 1.045302 -0.053800
+v 0.527804 1.044269 -0.053800
+v 0.517309 1.045302 -0.053800
+v 0.507216 1.048364 -0.053800
+v 0.497915 1.053335 -0.053800
+v 0.527804 1.098068 0.053800
+v 0.527804 1.098068 -0.053800
+usemtl Material.001
+s 1
+f 2 1 65
+f 66 33 34
+f 65 3 2
+f 66 34 35
+f 65 4 3
+f 66 35 36
+f 65 5 4
+f 66 36 37
+f 65 6 5
+f 66 37 38
+f 65 7 6
+f 66 38 39
+f 65 8 7
+f 66 39 40
+f 65 9 8
+f 66 40 41
+f 65 10 9
+f 66 41 42
+f 65 11 10
+f 66 42 43
+f 65 12 11
+f 66 43 44
+f 65 13 12
+f 66 44 45
+f 65 14 13
+f 66 45 46
+f 65 15 14
+f 66 46 47
+f 65 16 15
+f 66 47 48
+f 65 17 16
+f 66 48 49
+f 65 18 17
+f 66 49 50
+f 65 19 18
+f 66 50 51
+f 65 20 19
+f 66 51 52
+f 65 21 20
+f 66 52 53
+f 65 22 21
+f 66 53 54
+f 65 23 22
+f 66 54 55
+f 65 24 23
+f 66 55 56
+f 65 25 24
+f 66 56 57
+f 65 26 25
+f 66 57 58
+f 65 27 26
+f 66 58 59
+f 65 28 27
+f 66 59 60
+f 65 29 28
+f 66 60 61
+f 65 30 29
+f 66 61 62
+f 65 31 30
+f 66 62 63
+f 65 32 31
+f 66 63 64
+f 65 1 32
+f 66 64 33
+f 1 2 34 33
+f 2 3 35 34
+f 3 4 36 35
+f 4 5 37 36
+f 5 6 38 37
+f 6 7 39 38
+f 7 8 40 39
+f 8 9 41 40
+f 9 10 42 41
+f 10 11 43 42
+f 11 12 44 43
+f 12 13 45 44
+f 13 14 46 45
+f 14 15 47 46
+f 15 16 48 47
+f 16 17 49 48
+f 17 18 50 49
+f 18 19 51 50
+f 19 20 52 51
+f 20 21 53 52
+f 21 22 54 53
+f 22 23 55 54
+f 23 24 56 55
+f 24 25 57 56
+f 25 26 58 57
+f 26 27 59 58
+f 27 28 60 59
+f 28 29 61 60
+f 29 30 62 61
+f 30 31 63 62
+f 31 32 64 63
+f 32 1 33 64
+g Sill_Cube.003
+v 0.884367 0.003976 -0.091386
+v 0.884367 0.112762 -0.091386
+v -0.887397 0.112762 -0.091386
+v -0.887397 0.003976 -0.091386
+v 0.884367 0.003976 0.291386
+v 0.884366 0.033770 0.291386
+v -0.887397 0.033770 0.291386
+v -0.887397 0.003976 0.291386
+v 0.884366 0.112762 0.128708
+v 0.884367 0.003976 0.128708
+v -0.887397 0.112762 0.128708
+v -0.887397 0.003976 0.128708
+vt 0.000000 1.000000 0.0
+vt 1.000000 1.000000 0.0
+vt 1.000000 0.000000 0.0
+vt 0.000000 0.000000 0.0
+usemtl Material.001
+s 2
+f 67/1 70/2 69/3 68/4
+f 71/1 72/2 73/3 74/4
+f 67/1 68/2 75/3 76/4
+f 76/1 75/2 72/3 71/4
+f 68/1 69/2 77/3 75/4
+f 75/1 77/2 73/3 72/4
+f 69/1 70/2 78/3 77/4
+f 77/1 78/2 74/3 73/4
+f 71/1 74/2 78/3 76/4
+f 70/3 67/4 76/1 78/2
+g Frame_Cube.002
+v 0.884367 2.410503 -0.100000
+v 0.884367 2.310503 -0.100000
+v -0.887397 2.310503 -0.100000
+v -0.887397 2.410503 -0.100000
+v 0.884367 2.410502 0.100000
+v 0.884366 2.310502 0.100000
+v -0.887397 2.310503 0.100000
+v -0.887397 2.410503 0.100000
+v -0.825385 2.310503 -0.100000
+v -0.825385 2.410503 -0.100000
+v -0.825386 2.310503 0.100000
+v -0.825385 2.410503 0.100000
+v -0.825385 2.310503 -0.100000
+v -0.825386 2.310503 0.100000
+v -0.887397 2.310503 0.100000
+v -0.887397 2.310503 -0.100000
+v -0.887397 2.310503 0.100000
+v -0.887397 2.310503 -0.100000
+v -0.825385 2.310503 -0.100000
+v -0.825386 2.310503 0.100000
+v -0.825385 0.105933 -0.100000
+v -0.825386 0.105933 0.100000
+v -0.887397 0.105933 0.100000
+v -0.887397 0.105933 -0.100000
+v 0.815977 2.310503 -0.100000
+v 0.815977 2.410503 -0.100000
+v 0.815976 2.310502 0.100000
+v 0.815977 2.410502 0.100000
+v 0.815977 0.110503 -0.100000
+v 0.815976 0.110502 0.100000
+v 0.884366 0.110502 0.100000
+v 0.884367 0.110503 -0.100000
+usemtl Material.001
+s 3
+f 79 83 84 80
+f 81 85 86 82
+f 87 81 82 88
+f 90 86 85 89
+f 88 82 86 90
+f 87 89 92 91
+f 89 85 93 92
+f 81 87 91 94
+f 85 81 94 93
+f 93 94 96 95
+f 94 91 97 96
+f 92 93 95 98
+f 91 92 98 97
+f 97 98 100 99
+f 98 95 101 100
+f 96 97 99 102
+f 95 96 102 101
+f 100 101 102 99
+f 104 79 80 103
+f 103 87 88 104
+f 83 106 105 84
+f 106 90 89 105
+f 105 89 87 103
+f 79 104 106 83
+f 104 88 90 106
+f 105 103 107 108
+f 84 105 108 109
+f 103 80 110 107
+f 80 84 109 110
+f 109 108 107 110
+g Door_Cube.001
+v 0.818746 2.310503 -0.076820
+v 0.818746 0.110503 -0.076820
+v -0.821776 0.110503 -0.076820
+v -0.821776 2.310503 -0.076820
+v 0.818746 2.310502 -0.023613
+v 0.818745 0.110502 -0.023613
+v -0.821776 0.110503 -0.023613
+v -0.821776 2.310503 -0.023613
+usemtl Material
+s 4
+f 111 112 113 114
+f 115 118 117 116
+f 111 115 116 112
+f 112 116 117 113
+f 113 117 118 114
+f 115 111 114 118
+
+-----------------------------14042802788933518161505795335--
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ian...@us...> - 2007-08-21 16:09:09
|
Revision: 252
http://ogoglio.svn.sourceforge.net/ogoglio/?rev=252&view=rev
Author: iansmith
Date: 2007-08-21 09:09:09 -0700 (Tue, 21 Aug 2007)
Log Message:
-----------
Not sure why it says that I changed this.
Property Changed:
----------------
maven/trunk/ogoglio-body-editor-applet/
Property changes on: maven/trunk/ogoglio-body-editor-applet
___________________________________________________________________
Name: svn:ignore
+ target
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ian...@us...> - 2007-08-21 16:08:44
|
Revision: 251
http://ogoglio.svn.sourceforge.net/ogoglio/?rev=251&view=rev
Author: iansmith
Date: 2007-08-21 09:08:47 -0700 (Tue, 21 Aug 2007)
Log Message:
-----------
Moved integration tests to server.
Fixed the code that handles TemplateSupportFiles to be compatible now.
Modified Paths:
--------------
maven/trunk/ogoglio-common/pom.xml
maven/trunk/ogoglio-common/src/main/java/com/ogoglio/xml/TemplateSupportFileDocument.java
Removed Paths:
-------------
maven/trunk/ogoglio-common/src/test/java/com/ogoglio/client/
Property Changed:
----------------
maven/trunk/ogoglio-common/
Property changes on: maven/trunk/ogoglio-common
___________________________________________________________________
Name: svn:ignore
+ target
Modified: maven/trunk/ogoglio-common/pom.xml
===================================================================
--- maven/trunk/ogoglio-common/pom.xml 2007-08-21 03:19:54 UTC (rev 250)
+++ maven/trunk/ogoglio-common/pom.xml 2007-08-21 16:08:47 UTC (rev 251)
@@ -10,12 +10,13 @@
<version>0.0.1</version>
- <!-- things we need to build -->
+ <!-- things we need to build/run -->
<dependencies>
<dependency>
<groupId>com.agical.rmock</groupId>
<artifactId>rmock</artifactId>
<version>2.0.0-rc-6</version>
+ <scope>compile</scope>
</dependency>
</dependencies>
</project>
Modified: maven/trunk/ogoglio-common/src/main/java/com/ogoglio/xml/TemplateSupportFileDocument.java
===================================================================
--- maven/trunk/ogoglio-common/src/main/java/com/ogoglio/xml/TemplateSupportFileDocument.java 2007-08-21 03:19:54 UTC (rev 250)
+++ maven/trunk/ogoglio-common/src/main/java/com/ogoglio/xml/TemplateSupportFileDocument.java 2007-08-21 16:08:47 UTC (rev 251)
@@ -1,31 +1,40 @@
package com.ogoglio.xml;
import java.text.DateFormat;
+import java.util.Date;
import java.util.Locale;
public class TemplateSupportFileDocument {
public static final DateFormat fmt=DateFormat.getDateTimeInstance(DateFormat.FULL,
DateFormat.FULL, Locale.US);
public static final int NO_LOD = -299;
+ private int levelOfDetail=NO_LOD;
+ private Date lastChanged=null;
+ private boolean script=false;
+ private String supportFile=null;
+ public TemplateSupportFileDocument(int levelOfDetail, Date lastChanged,
+ boolean script, String supportFile) {
+ this.levelOfDetail=levelOfDetail;
+ this.lastChanged=lastChanged;
+ this.script=script;
+ this.supportFile=supportFile;
+ }
+
public boolean getScript() {
- // TODO Auto-generated method stub
- return false;
+ return script;
}
public String getLastChangedAsUTC() {
- // TODO Auto-generated method stub
- return null;
+ return fmt.format(lastChanged);
}
public int getLevelOfDetail() {
- // TODO Auto-generated method stub
- return 0;
+ return levelOfDetail;
}
public String getSupportFile() {
- // TODO Auto-generated method stub
- return "NYI";
+ return supportFile;
}
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ian...@us...> - 2007-08-21 03:19:52
|
Revision: 250
http://ogoglio.svn.sourceforge.net/ogoglio/?rev=250&view=rev
Author: iansmith
Date: 2007-08-20 20:19:54 -0700 (Mon, 20 Aug 2007)
Log Message:
-----------
trying to get started with maven
Added Paths:
-----------
maven/
maven/branches/
maven/tags/
maven/trunk/
maven/trunk/ogoglio-body-editor-applet/
maven/trunk/ogoglio-body-editor-applet/.classpath
maven/trunk/ogoglio-body-editor-applet/.project
maven/trunk/ogoglio-body-editor-applet/.settings/
maven/trunk/ogoglio-body-editor-applet/.settings/org.eclipse.jdt.core.prefs
maven/trunk/ogoglio-body-editor-applet/pom.xml
maven/trunk/ogoglio-body-editor-applet/src/
maven/trunk/ogoglio-body-editor-applet/src/assemble/
maven/trunk/ogoglio-body-editor-applet/src/assemble/ogoglio-code.xml
maven/trunk/ogoglio-body-editor-applet/src/main/
maven/trunk/ogoglio-body-editor-applet/src/main/java/
maven/trunk/ogoglio-body-editor-applet/src/main/java/com/
maven/trunk/ogoglio-body-editor-applet/src/main/java/com/ogoglio/
maven/trunk/ogoglio-body-editor-applet/src/main/java/com/ogoglio/bodyeditor/
maven/trunk/ogoglio-body-editor-applet/src/main/java/com/ogoglio/bodyeditor/BodyEditorApplet.java
maven/trunk/ogoglio-body-editor-applet/src/main/resources/
maven/trunk/ogoglio-body-editor-applet/src/test/
maven/trunk/ogoglio-body-editor-applet/src/test/java/
maven/trunk/ogoglio-body-editor-applet/src/test/resources/
maven/trunk/ogoglio-common/
maven/trunk/ogoglio-common/.classpath
maven/trunk/ogoglio-common/.project
maven/trunk/ogoglio-common/.settings/
maven/trunk/ogoglio-common/.settings/org.eclipse.jdt.core.prefs
maven/trunk/ogoglio-common/pom.xml
maven/trunk/ogoglio-common/src/
maven/trunk/ogoglio-common/src/main/
maven/trunk/ogoglio-common/src/main/java/
maven/trunk/ogoglio-common/src/main/java/com/
maven/trunk/ogoglio-common/src/main/java/com/ogoglio/
maven/trunk/ogoglio-common/src/main/java/com/ogoglio/client/
maven/trunk/ogoglio-common/src/main/java/com/ogoglio/client/AuthenticationFailedException.java
maven/trunk/ogoglio-common/src/main/java/com/ogoglio/client/DecoratedInputStream.java
maven/trunk/ogoglio-common/src/main/java/com/ogoglio/client/MultiuserTests.java
maven/trunk/ogoglio-common/src/main/java/com/ogoglio/client/SpaceClient.java
maven/trunk/ogoglio-common/src/main/java/com/ogoglio/client/SpaceDuplicator.java
maven/trunk/ogoglio-common/src/main/java/com/ogoglio/client/UserInputListener.java
maven/trunk/ogoglio-common/src/main/java/com/ogoglio/client/WebAPIAuthenticator.java
maven/trunk/ogoglio-common/src/main/java/com/ogoglio/client/WebAPIAuthenticatorFactory.java
maven/trunk/ogoglio-common/src/main/java/com/ogoglio/client/WebAPIClient.java
maven/trunk/ogoglio-common/src/main/java/com/ogoglio/client/WebAPIClientWire.java
maven/trunk/ogoglio-common/src/main/java/com/ogoglio/client/WebAPIDescriptor.java
maven/trunk/ogoglio-common/src/main/java/com/ogoglio/client/WebAPIGuestAuthenticator.java
maven/trunk/ogoglio-common/src/main/java/com/ogoglio/client/WebAPIUtil.java
maven/trunk/ogoglio-common/src/main/java/com/ogoglio/client/model/
maven/trunk/ogoglio-common/src/main/java/com/ogoglio/client/model/Body.java
maven/trunk/ogoglio-common/src/main/java/com/ogoglio/client/model/Door.java
maven/trunk/ogoglio-common/src/main/java/com/ogoglio/client/model/GeometryProvider.java
maven/trunk/ogoglio-common/src/main/java/com/ogoglio/client/model/Page.java
maven/trunk/ogoglio-common/src/main/java/com/ogoglio/client/model/Shape.java
maven/trunk/ogoglio-common/src/main/java/com/ogoglio/client/model/Space.java
maven/trunk/ogoglio-common/src/main/java/com/ogoglio/client/model/SplineKeyFrame.java
maven/trunk/ogoglio-common/src/main/java/com/ogoglio/client/model/SplinePath.java
maven/trunk/ogoglio-common/src/main/java/com/ogoglio/client/model/Template.java
maven/trunk/ogoglio-common/src/main/java/com/ogoglio/client/model/Thing.java
maven/trunk/ogoglio-common/src/main/java/com/ogoglio/client/model/User.java
maven/trunk/ogoglio-common/src/main/java/com/ogoglio/message/
maven/trunk/ogoglio-common/src/main/java/com/ogoglio/message/Command.java
maven/trunk/ogoglio-common/src/main/java/com/ogoglio/message/Locator.java
maven/trunk/ogoglio-common/src/main/java/com/ogoglio/message/Message.java
maven/trunk/ogoglio-common/src/main/java/com/ogoglio/message/MessageHandler.java
maven/trunk/ogoglio-common/src/main/java/com/ogoglio/message/NetworkChannelServer.java
maven/trunk/ogoglio-common/src/main/java/com/ogoglio/message/NoSuchDestinationException.java
maven/trunk/ogoglio-common/src/main/java/com/ogoglio/message/Payload.java
maven/trunk/ogoglio-common/src/main/java/com/ogoglio/message/PayloadFactory.java
maven/trunk/ogoglio-common/src/main/java/com/ogoglio/message/SenderQueue.java
maven/trunk/ogoglio-common/src/main/java/com/ogoglio/message/TCPChannel.java
maven/trunk/ogoglio-common/src/main/java/com/ogoglio/message/TCPMessageReader.java
maven/trunk/ogoglio-common/src/main/java/com/ogoglio/util/
maven/trunk/ogoglio-common/src/main/java/com/ogoglio/util/ArgumentUtils.java
maven/trunk/ogoglio-common/src/main/java/com/ogoglio/util/BlockingQueue.java
maven/trunk/ogoglio-common/src/main/java/com/ogoglio/util/BodyConstants.java
maven/trunk/ogoglio-common/src/main/java/com/ogoglio/util/ContextMenuInfo.java
maven/trunk/ogoglio-common/src/main/java/com/ogoglio/util/LimitedInputStream.java
maven/trunk/ogoglio-common/src/main/java/com/ogoglio/util/NetworkUtils.java
maven/trunk/ogoglio-common/src/main/java/com/ogoglio/util/OgoglioProperties.java
maven/trunk/ogoglio-common/src/main/java/com/ogoglio/util/OgoglioSpecBase.java
maven/trunk/ogoglio-common/src/main/java/com/ogoglio/util/StreamUtils.java
maven/trunk/ogoglio-common/src/main/java/com/ogoglio/util/TwoWayMap.java
maven/trunk/ogoglio-common/src/main/java/com/ogoglio/util/UIConstants.java
maven/trunk/ogoglio-common/src/main/java/com/ogoglio/util/URLUTF8Encoder.java
maven/trunk/ogoglio-common/src/main/java/com/ogoglio/util/WebConstants.java
maven/trunk/ogoglio-common/src/main/java/com/ogoglio/viewer/
maven/trunk/ogoglio-common/src/main/java/com/ogoglio/viewer/j3d/
maven/trunk/ogoglio-common/src/main/java/com/ogoglio/viewer/j3d/J3DCamera.java
maven/trunk/ogoglio-common/src/main/java/com/ogoglio/viewer/j3d/J3DCanvas.java
maven/trunk/ogoglio-common/src/main/java/com/ogoglio/viewer/j3d/J3DDoorRenderable.java
maven/trunk/ogoglio-common/src/main/java/com/ogoglio/viewer/j3d/J3DPageRenderable.java
maven/trunk/ogoglio-common/src/main/java/com/ogoglio/viewer/j3d/J3DPicker.java
maven/trunk/ogoglio-common/src/main/java/com/ogoglio/viewer/j3d/J3DRenderableLoader.java
maven/trunk/ogoglio-common/src/main/java/com/ogoglio/viewer/j3d/J3DRenderer.java
maven/trunk/ogoglio-common/src/main/java/com/ogoglio/viewer/j3d/J3DShapeRenderable.java
maven/trunk/ogoglio-common/src/main/java/com/ogoglio/viewer/j3d/J3DSplineKeyFrame.java
maven/trunk/ogoglio-common/src/main/java/com/ogoglio/viewer/j3d/J3DSplinePath.java
maven/trunk/ogoglio-common/src/main/java/com/ogoglio/viewer/j3d/J3DThingRenderable.java
maven/trunk/ogoglio-common/src/main/java/com/ogoglio/viewer/j3d/J3DUniverse.java
maven/trunk/ogoglio-common/src/main/java/com/ogoglio/viewer/j3d/J3DUserRenderable.java
maven/trunk/ogoglio-common/src/main/java/com/ogoglio/viewer/j3d/J3DWater.java
maven/trunk/ogoglio-common/src/main/java/com/ogoglio/viewer/j3d/MotionInputHandler.java
maven/trunk/ogoglio-common/src/main/java/com/ogoglio/viewer/j3d/PhysicsBehavior.java
maven/trunk/ogoglio-common/src/main/java/com/ogoglio/viewer/j3d/RangedAlpha.java
maven/trunk/ogoglio-common/src/main/java/com/ogoglio/viewer/j3d/RenderableMotionInterpolator.java
maven/trunk/ogoglio-common/src/main/java/com/ogoglio/viewer/j3d/SplinePathInterpolator.java
maven/trunk/ogoglio-common/src/main/java/com/ogoglio/viewer/j3d/body/
maven/trunk/ogoglio-common/src/main/java/com/ogoglio/viewer/j3d/body/BodyAnimator.java
maven/trunk/ogoglio-common/src/main/java/com/ogoglio/viewer/j3d/body/Skeleton.java
maven/trunk/ogoglio-common/src/main/java/com/ogoglio/viewer/j3d/body/SkeletonLoader.java
maven/trunk/ogoglio-common/src/main/java/com/ogoglio/viewer/j3d/body/Skin.java
maven/trunk/ogoglio-common/src/main/java/com/ogoglio/viewer/j3d/body/SkinLoader.java
maven/trunk/ogoglio-common/src/main/java/com/ogoglio/viewer/j3d/bvh/
maven/trunk/ogoglio-common/src/main/java/com/ogoglio/viewer/j3d/bvh/Bvh.java
maven/trunk/ogoglio-common/src/main/java/com/ogoglio/viewer/j3d/bvh/BvhParseException.java
maven/trunk/ogoglio-common/src/main/java/com/ogoglio/viewer/j3d/bvh/BvhParser.java
maven/trunk/ogoglio-common/src/main/java/com/ogoglio/viewer/j3d/obj/
maven/trunk/ogoglio-common/src/main/java/com/ogoglio/viewer/j3d/obj/AbstractParser.java
maven/trunk/ogoglio-common/src/main/java/com/ogoglio/viewer/j3d/obj/LineTokenizer.java
maven/trunk/ogoglio-common/src/main/java/com/ogoglio/viewer/j3d/obj/MtlParser.java
maven/trunk/ogoglio-common/src/main/java/com/ogoglio/viewer/j3d/obj/Obj.java
maven/trunk/ogoglio-common/src/main/java/com/ogoglio/viewer/j3d/obj/ObjMtl.java
maven/trunk/ogoglio-common/src/main/java/com/ogoglio/viewer/j3d/obj/ObjParseException.java
maven/trunk/ogoglio-common/src/main/java/com/ogoglio/viewer/j3d/obj/ObjParser.java
maven/trunk/ogoglio-common/src/main/java/com/ogoglio/viewer/j3d/smap/
maven/trunk/ogoglio-common/src/main/java/com/ogoglio/viewer/j3d/smap/SkinMap.java
maven/trunk/ogoglio-common/src/main/java/com/ogoglio/viewer/j3d/smap/SkinMapParseException.java
maven/trunk/ogoglio-common/src/main/java/com/ogoglio/viewer/j3d/smap/SkinMapParser.java
maven/trunk/ogoglio-common/src/main/java/com/ogoglio/viewer/j3d/smap/SkinMapSerializer.java
maven/trunk/ogoglio-common/src/main/java/com/ogoglio/viewer/render/
maven/trunk/ogoglio-common/src/main/java/com/ogoglio/viewer/render/Camera.java
maven/trunk/ogoglio-common/src/main/java/com/ogoglio/viewer/render/ClickTarget.java
maven/trunk/ogoglio-common/src/main/java/com/ogoglio/viewer/render/DoorRenderable.java
maven/trunk/ogoglio-common/src/main/java/com/ogoglio/viewer/render/PageRenderable.java
maven/trunk/ogoglio-common/src/main/java/com/ogoglio/viewer/render/Renderable.java
maven/trunk/ogoglio-common/src/main/java/com/ogoglio/viewer/render/RenderableParseException.java
maven/trunk/ogoglio-common/src/main/java/com/ogoglio/viewer/render/Renderer.java
maven/trunk/ogoglio-common/src/main/java/com/ogoglio/viewer/render/ShapeRenderable.java
maven/trunk/ogoglio-common/src/main/java/com/ogoglio/viewer/render/ThingRenderable.java
maven/trunk/ogoglio-common/src/main/java/com/ogoglio/viewer/render/UIConstants.java
maven/trunk/ogoglio-common/src/main/java/com/ogoglio/viewer/render/UserRenderable.java
maven/trunk/ogoglio-common/src/main/java/com/ogoglio/xml/
maven/trunk/ogoglio-common/src/main/java/com/ogoglio/xml/AccountDocument.java
maven/trunk/ogoglio-common/src/main/java/com/ogoglio/xml/AuthDocument.java
maven/trunk/ogoglio-common/src/main/java/com/ogoglio/xml/BodyDocument.java
maven/trunk/ogoglio-common/src/main/java/com/ogoglio/xml/DoorDocument.java
maven/trunk/ogoglio-common/src/main/java/com/ogoglio/xml/PageDocument.java
maven/trunk/ogoglio-common/src/main/java/com/ogoglio/xml/PositionedDocument.java
maven/trunk/ogoglio-common/src/main/java/com/ogoglio/xml/PossessionDocument.java
maven/trunk/ogoglio-common/src/main/java/com/ogoglio/xml/ServiceDocument.java
maven/trunk/ogoglio-common/src/main/java/com/ogoglio/xml/SettingDocument.java
maven/trunk/ogoglio-common/src/main/java/com/ogoglio/xml/ShapeDocument.java
maven/trunk/ogoglio-common/src/main/java/com/ogoglio/xml/SimDocument.java
maven/trunk/ogoglio-common/src/main/java/com/ogoglio/xml/SpaceDocument.java
maven/trunk/ogoglio-common/src/main/java/com/ogoglio/xml/SpaceEvent.java
maven/trunk/ogoglio-common/src/main/java/com/ogoglio/xml/SpaceMemberDocument.java
maven/trunk/ogoglio-common/src/main/java/com/ogoglio/xml/SpaceSimulatorDocument.java
maven/trunk/ogoglio-common/src/main/java/com/ogoglio/xml/SplinePathDocument.java
maven/trunk/ogoglio-common/src/main/java/com/ogoglio/xml/TemplateDocument.java
maven/trunk/ogoglio-common/src/main/java/com/ogoglio/xml/TemplateSupportFileDocument.java
maven/trunk/ogoglio-common/src/main/java/com/ogoglio/xml/ThingDocument.java
maven/trunk/ogoglio-common/src/main/java/com/ogoglio/xml/UserDocument.java
maven/trunk/ogoglio-common/src/main/java/nanoxml/
maven/trunk/ogoglio-common/src/main/java/nanoxml/XMLElement.java
maven/trunk/ogoglio-common/src/main/java/nanoxml/XMLParseException.java
maven/trunk/ogoglio-common/src/main/java/org/
maven/trunk/ogoglio-common/src/main/java/org/j3d/
maven/trunk/ogoglio-common/src/main/java/org/j3d/geom/
maven/trunk/ogoglio-common/src/main/java/org/j3d/geom/IntersectionUtils.java
maven/trunk/ogoglio-common/src/main/java/org/j3d/geom/J3DIntersectionUtils.java
maven/trunk/ogoglio-common/src/main/resources/
maven/trunk/ogoglio-common/src/main/resources/sample-art3d/
maven/trunk/ogoglio-common/src/main/resources/sample-art3d/Grid.gif
maven/trunk/ogoglio-common/src/main/resources/sample-art3d/TestCube.gif
maven/trunk/ogoglio-common/src/main/resources/sample-art3d/TestCube.js
maven/trunk/ogoglio-common/src/main/resources/sample-art3d/TestCube.mtl
maven/trunk/ogoglio-common/src/main/resources/sample-art3d/defaultLand.mtl
maven/trunk/ogoglio-common/src/main/resources/sample-art3d/door.mtl
maven/trunk/ogoglio-common/src/test/
maven/trunk/ogoglio-common/src/test/java/
maven/trunk/ogoglio-common/src/test/java/com/
maven/trunk/ogoglio-common/src/test/java/com/ogoglio/
maven/trunk/ogoglio-common/src/test/java/com/ogoglio/client/
maven/trunk/ogoglio-common/src/test/java/com/ogoglio/client/test/
maven/trunk/ogoglio-common/src/test/java/com/ogoglio/client/test/ClientTests.java
maven/trunk/ogoglio-common/src/test/java/com/ogoglio/client/test/SpaceDuplicatorTests.java
maven/trunk/ogoglio-common/src/test/java/com/ogoglio/client/test/WebAPITests.java
maven/trunk/ogoglio-common/src/test/java/com/ogoglio/xml/
maven/trunk/ogoglio-common/src/test/java/com/ogoglio/xml/test/
maven/trunk/ogoglio-common/src/test/java/com/ogoglio/xml/test/XMLTests.java
maven/trunk/ogoglio-common/src/test/resources/
maven/trunk/ogoglio-server/
maven/trunk/ogoglio-server/.classpath
maven/trunk/ogoglio-server/.project
maven/trunk/ogoglio-server/.settings/
maven/trunk/ogoglio-server/.settings/org.eclipse.jdt.core.prefs
maven/trunk/ogoglio-server/pom.xml
maven/trunk/ogoglio-server/src/
maven/trunk/ogoglio-server/src/main/
maven/trunk/ogoglio-server/src/main/java/
maven/trunk/ogoglio-server/src/main/java/com/
maven/trunk/ogoglio-server/src/main/java/com/ogoglio/
maven/trunk/ogoglio-server/src/main/java/com/ogoglio/media/
maven/trunk/ogoglio-server/src/main/java/com/ogoglio/media/FileStore.java
maven/trunk/ogoglio-server/src/main/java/com/ogoglio/media/MediaService.java
maven/trunk/ogoglio-server/src/main/java/com/ogoglio/media/MediaStore.java
maven/trunk/ogoglio-server/src/main/java/com/ogoglio/media/WebStore.java
maven/trunk/ogoglio-server/src/main/java/com/ogoglio/media/site/
maven/trunk/ogoglio-server/src/main/java/com/ogoglio/media/site/MediaServlet.java
maven/trunk/ogoglio-server/src/main/java/com/ogoglio/persist/
maven/trunk/ogoglio-server/src/main/java/com/ogoglio/persist/AccountPersistTasks.java
maven/trunk/ogoglio-server/src/main/java/com/ogoglio/persist/AccountRecord.java
maven/trunk/ogoglio-server/src/main/java/com/ogoglio/persist/BodyPersistTasks.java
maven/trunk/ogoglio-server/src/main/java/com/ogoglio/persist/BodyRecord.java
maven/trunk/ogoglio-server/src/main/java/com/ogoglio/persist/HibernateBase.java
maven/trunk/ogoglio-server/src/main/java/com/ogoglio/persist/HibernateTask.java
maven/trunk/ogoglio-server/src/main/java/com/ogoglio/persist/HibernateTests.java
maven/trunk/ogoglio-server/src/main/java/com/ogoglio/persist/Persist.hbm.xml
maven/trunk/ogoglio-server/src/main/java/com/ogoglio/persist/PersistException.java
maven/trunk/ogoglio-server/src/main/java/com/ogoglio/persist/PersistTests.java
maven/trunk/ogoglio-server/src/main/java/com/ogoglio/persist/Persist_NoTemplateTables.hbm.xml
maven/trunk/ogoglio-server/src/main/java/com/ogoglio/persist/PossessionPersistTasks.java
maven/trunk/ogoglio-server/src/main/java/com/ogoglio/persist/PossessionRecord.java
maven/trunk/ogoglio-server/src/main/java/com/ogoglio/persist/ServiceInitializationPersistTasks.java
maven/trunk/ogoglio-server/src/main/java/com/ogoglio/persist/SimPersistTasks.java
maven/trunk/ogoglio-server/src/main/java/com/ogoglio/persist/SimRecord.java
maven/trunk/ogoglio-server/src/main/java/com/ogoglio/persist/SpaceMemberPersistTasks.java
maven/trunk/ogoglio-server/src/main/java/com/ogoglio/persist/SpaceMemberRecord.java
maven/trunk/ogoglio-server/src/main/java/com/ogoglio/persist/SpacePersistTasks.java
maven/trunk/ogoglio-server/src/main/java/com/ogoglio/persist/SpaceRecord.java
maven/trunk/ogoglio-server/src/main/java/com/ogoglio/persist/TemplatePersistTasks.java
maven/trunk/ogoglio-server/src/main/java/com/ogoglio/persist/TemplateRecord.java
maven/trunk/ogoglio-server/src/main/java/com/ogoglio/persist/TemplateSupportFilePersistTasks.java
maven/trunk/ogoglio-server/src/main/java/com/ogoglio/persist/TemplateSupportFileRecord.java
maven/trunk/ogoglio-server/src/main/java/com/ogoglio/sim/
maven/trunk/ogoglio-server/src/main/java/com/ogoglio/sim/Sim.java
maven/trunk/ogoglio-server/src/main/java/com/ogoglio/sim/SimMessageHandler.java
maven/trunk/ogoglio-server/src/main/java/com/ogoglio/sim/SpaceSimulator.java
maven/trunk/ogoglio-server/src/main/java/com/ogoglio/sim/script/
maven/trunk/ogoglio-server/src/main/java/com/ogoglio/sim/script/ScriptContextFactory.java
maven/trunk/ogoglio-server/src/main/java/com/ogoglio/sim/script/ScriptContextMenuInfo.java
maven/trunk/ogoglio-server/src/main/java/com/ogoglio/sim/script/ScriptHTTPRequest.java
maven/trunk/ogoglio-server/src/main/java/com/ogoglio/sim/script/ScriptMath.java
maven/trunk/ogoglio-server/src/main/java/com/ogoglio/sim/script/ScriptPoint.java
maven/trunk/ogoglio-server/src/main/java/com/ogoglio/sim/script/ScriptQuaternion.java
maven/trunk/ogoglio-server/src/main/java/com/ogoglio/sim/script/ScriptSpace.java
maven/trunk/ogoglio-server/src/main/java/com/ogoglio/sim/script/ScriptSplineKeyFrame.java
maven/trunk/ogoglio-server/src/main/java/com/ogoglio/sim/script/ScriptSplinePath.java
maven/trunk/ogoglio-server/src/main/java/com/ogoglio/sim/script/ScriptTests.java
maven/trunk/ogoglio-server/src/main/java/com/ogoglio/sim/script/SpaceScriptEngine.java
maven/trunk/ogoglio-server/src/main/java/com/ogoglio/sim/site/
maven/trunk/ogoglio-server/src/main/java/com/ogoglio/sim/site/SimServlet.java
maven/trunk/ogoglio-server/src/main/java/com/ogoglio/site/
maven/trunk/ogoglio-server/src/main/java/com/ogoglio/site/AbstractResourceServlet.java
maven/trunk/ogoglio-server/src/main/java/com/ogoglio/site/AccountServlet.java
maven/trunk/ogoglio-server/src/main/java/com/ogoglio/site/AuthServlet.java
maven/trunk/ogoglio-server/src/main/java/com/ogoglio/site/AuthenticatedSiteResource.java
maven/trunk/ogoglio-server/src/main/java/com/ogoglio/site/DescendingSiteResource.java
maven/trunk/ogoglio-server/src/main/java/com/ogoglio/site/MessageProxy.java
maven/trunk/ogoglio-server/src/main/java/com/ogoglio/site/SiteInfo.java
maven/trunk/ogoglio-server/src/main/java/com/ogoglio/site/SiteResource.java
maven/trunk/ogoglio-server/src/main/java/com/ogoglio/site/SpaceServlet.java
maven/trunk/ogoglio-server/src/main/java/com/ogoglio/site/TemplateResource.java
maven/trunk/ogoglio-server/src/main/java/com/ogoglio/xml/
maven/trunk/ogoglio-server/src/main/java/com/ogoglio/xml/server/
maven/trunk/ogoglio-server/src/main/java/com/ogoglio/xml/server/DocumentFactory.java
maven/trunk/ogoglio-server/src/main/resources/
maven/trunk/ogoglio-server/src/main/webapp/
maven/trunk/ogoglio-server/src/main/webapp/META-INF/
maven/trunk/ogoglio-server/src/main/webapp/META-INF/context.xml
maven/trunk/ogoglio-server/src/main/webapp/WEB-INF/
maven/trunk/ogoglio-server/src/main/webapp/WEB-INF/web-app.xml
maven/trunk/ogoglio-server/src/main/webapp/WEB-INF/web-media.xml
maven/trunk/ogoglio-server/src/main/webapp/WEB-INF/web-sim.xml
maven/trunk/ogoglio-server/src/main/webapp/WEB-INF/web.xml
maven/trunk/ogoglio-server/src/test/
maven/trunk/ogoglio-server/src/test/java/
maven/trunk/ogoglio-server/src/test/resources/
maven/trunk/ogoglio-test-applet/
maven/trunk/ogoglio-test-applet/.classpath
maven/trunk/ogoglio-test-applet/.project
maven/trunk/ogoglio-test-applet/.settings/
maven/trunk/ogoglio-test-applet/.settings/org.eclipse.jdt.core.prefs
maven/trunk/ogoglio-test-applet/pom.xml
maven/trunk/ogoglio-test-applet/src/
maven/trunk/ogoglio-test-applet/src/main/
maven/trunk/ogoglio-test-applet/src/main/java/
maven/trunk/ogoglio-test-applet/src/main/java/com/
maven/trunk/ogoglio-test-applet/src/main/java/com/ogoglio/
maven/trunk/ogoglio-test-applet/src/main/java/com/ogoglio/testapplet/
maven/trunk/ogoglio-test-applet/src/main/java/com/ogoglio/testapplet/InputTest.java
maven/trunk/ogoglio-test-applet/src/main/java/com/ogoglio/testapplet/Java3DTester.java
maven/trunk/ogoglio-test-applet/src/main/java/com/ogoglio/testapplet/RenderingTest.java
maven/trunk/ogoglio-test-applet/src/main/java/com/ogoglio/testapplet/TestApplet.java
maven/trunk/ogoglio-test-applet/src/main/resources/
maven/trunk/ogoglio-test-applet/src/test/
maven/trunk/ogoglio-test-applet/src/test/java/
maven/trunk/ogoglio-test-applet/src/test/resources/
maven/trunk/ogoglio-viewer-applet/
maven/trunk/ogoglio-viewer-applet/.classpath
maven/trunk/ogoglio-viewer-applet/.project
maven/trunk/ogoglio-viewer-applet/.settings/
maven/trunk/ogoglio-viewer-applet/.settings/org.eclipse.jdt.core.prefs
maven/trunk/ogoglio-viewer-applet/pom.xml
maven/trunk/ogoglio-viewer-applet/src/
maven/trunk/ogoglio-viewer-applet/src/assemble/
maven/trunk/ogoglio-viewer-applet/src/assemble/ogoglio-code.xml
maven/trunk/ogoglio-viewer-applet/src/main/
maven/trunk/ogoglio-viewer-applet/src/main/java/
maven/trunk/ogoglio-viewer-applet/src/main/java/com/
maven/trunk/ogoglio-viewer-applet/src/main/java/com/ogoglio/
maven/trunk/ogoglio-viewer-applet/src/main/java/com/ogoglio/viewer/
maven/trunk/ogoglio-viewer-applet/src/main/java/com/ogoglio/viewer/applet/
maven/trunk/ogoglio-viewer-applet/src/main/java/com/ogoglio/viewer/applet/AppletTestWindow.java
maven/trunk/ogoglio-viewer-applet/src/main/java/com/ogoglio/viewer/applet/ViewerApplet.java
maven/trunk/ogoglio-viewer-applet/src/main/resources/
maven/trunk/ogoglio-viewer-applet/src/main/resources/art3d/
maven/trunk/ogoglio-viewer-applet/src/main/resources/art3d/Eyes1.gif
maven/trunk/ogoglio-viewer-applet/src/main/resources/art3d/Eyes2.gif
maven/trunk/ogoglio-viewer-applet/src/main/resources/art3d/LeftArrow.gif
maven/trunk/ogoglio-viewer-applet/src/main/resources/art3d/LeftArrowDisabled.gif
maven/trunk/ogoglio-viewer-applet/src/main/resources/art3d/Mouth1.gif
maven/trunk/ogoglio-viewer-applet/src/main/resources/art3d/Mouth2.gif
maven/trunk/ogoglio-viewer-applet/src/main/resources/art3d/Nose1.gif
maven/trunk/ogoglio-viewer-applet/src/main/resources/art3d/Nose2.gif
maven/trunk/ogoglio-viewer-applet/src/main/resources/art3d/RightArrow.gif
maven/trunk/ogoglio-viewer-applet/src/main/resources/art3d/RightArrowDisabled.gif
maven/trunk/ogoglio-viewer-applet/src/main/resources/art3d/avatar-point.bvh
maven/trunk/ogoglio-viewer-applet/src/main/resources/art3d/avatar-walk.bvh
maven/trunk/ogoglio-viewer-applet/src/main/resources/art3d/avatar-wave.bvh
maven/trunk/ogoglio-viewer-applet/src/main/resources/art3d/avatar.bvh
maven/trunk/ogoglio-viewer-applet/src/main/resources/art3d/avatar.jpg
maven/trunk/ogoglio-viewer-applet/src/main/resources/art3d/avatar.smap
maven/trunk/ogoglio-viewer-applet/src/main/resources/art3d/avatar1.jpg
maven/trunk/ogoglio-viewer-applet/src/main/resources/art3d/license.txt
maven/trunk/ogoglio-viewer-applet/src/test/
maven/trunk/ogoglio-viewer-applet/src/test/java/
maven/trunk/ogoglio-viewer-applet/src/test/java/com/
maven/trunk/ogoglio-viewer-applet/src/test/java/com/ogoglio/
maven/trunk/ogoglio-viewer-applet/src/test/java/com/ogoglio/viewer/
maven/trunk/ogoglio-viewer-applet/src/test/java/com/ogoglio/viewer/j3d/
maven/trunk/ogoglio-viewer-applet/src/test/java/com/ogoglio/viewer/j3d/body/
maven/trunk/ogoglio-viewer-applet/src/test/java/com/ogoglio/viewer/j3d/body/test/
maven/trunk/ogoglio-viewer-applet/src/test/java/com/ogoglio/viewer/j3d/body/test/BodyTest.java
maven/trunk/ogoglio-viewer-applet/src/test/java/com/ogoglio/viewer/j3d/bvh/
maven/trunk/ogoglio-viewer-applet/src/test/java/com/ogoglio/viewer/j3d/bvh/test/
maven/trunk/ogoglio-viewer-applet/src/test/java/com/ogoglio/viewer/j3d/bvh/test/BvhTest.java
maven/trunk/ogoglio-viewer-applet/src/test/java/com/ogoglio/viewer/j3d/obj/
maven/trunk/ogoglio-viewer-applet/src/test/java/com/ogoglio/viewer/j3d/obj/test/
maven/trunk/ogoglio-viewer-applet/src/test/java/com/ogoglio/viewer/j3d/obj/test/ObjTest.java
maven/trunk/ogoglio-viewer-applet/src/test/resources/
Added: maven/trunk/ogoglio-body-editor-applet/.classpath
===================================================================
--- maven/trunk/ogoglio-body-editor-applet/.classpath (rev 0)
+++ maven/trunk/ogoglio-body-editor-applet/.classpath 2007-08-21 03:19:54 UTC (rev 250)
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" path="src/main/java"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+ <classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>
+ <classpathentry kind="output" path="target/classes"/>
+</classpath>
Added: maven/trunk/ogoglio-body-editor-applet/.project
===================================================================
--- maven/trunk/ogoglio-body-editor-applet/.project (rev 0)
+++ maven/trunk/ogoglio-body-editor-applet/.project 2007-08-21 03:19:54 UTC (rev 250)
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>ogoglio-body-editor-applet</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.maven.ide.eclipse.maven2Builder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ <nature>org.maven.ide.eclipse.maven2Nature</nature>
+ </natures>
+</projectDescription>
Added: maven/trunk/ogoglio-body-editor-applet/.settings/org.eclipse.jdt.core.prefs
===================================================================
--- maven/trunk/ogoglio-body-editor-applet/.settings/org.eclipse.jdt.core.prefs (rev 0)
+++ maven/trunk/ogoglio-body-editor-applet/.settings/org.eclipse.jdt.core.prefs 2007-08-21 03:19:54 UTC (rev 250)
@@ -0,0 +1,66 @@
+#Mon Aug 20 05:03:23 PDT 2007
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.2
+org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
+org.eclipse.jdt.core.compiler.compliance=1.4
+org.eclipse.jdt.core.compiler.debug.lineNumber=generate
+org.eclipse.jdt.core.compiler.debug.localVariable=generate
+org.eclipse.jdt.core.compiler.debug.sourceFile=generate
+org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=warning
+org.eclipse.jdt.core.compiler.problem.autoboxing=ignore
+org.eclipse.jdt.core.compiler.problem.deprecation=warning
+org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled
+org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled
+org.eclipse.jdt.core.compiler.problem.discouragedReference=warning
+org.eclipse.jdt.core.compiler.problem.emptyStatement=ignore
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=warning
+org.eclipse.jdt.core.compiler.problem.fallthroughCase=ignore
+org.eclipse.jdt.core.compiler.problem.fatalOptionalError=enabled
+org.eclipse.jdt.core.compiler.problem.fieldHiding=ignore
+org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning
+org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning
+org.eclipse.jdt.core.compiler.problem.forbiddenReference=error
+org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning
+org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning
+org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=ignore
+org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=ignore
+org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore
+org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning
+org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=ignore
+org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=ignore
+org.eclipse.jdt.core.compiler.problem.missingSerialVersion=ignore
+org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning
+org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning
+org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore
+org.eclipse.jdt.core.compiler.problem.nullReference=ignore
+org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning
+org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore
+org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=ignore
+org.eclipse.jdt.core.compiler.problem.potentialNullReference=ignore
+org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning
+org.eclipse.jdt.core.compiler.problem.redundantNullCheck=ignore
+org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled
+org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning
+org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled
+org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore
+org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning
+org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning
+org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore
+org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning
+org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore
+org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=ignore
+org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=ignore
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled
+org.eclipse.jdt.core.compiler.problem.unusedImport=warning
+org.eclipse.jdt.core.compiler.problem.unusedLabel=warning
+org.eclipse.jdt.core.compiler.problem.unusedLocal=warning
+org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore
+org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled
+org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled
+org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled
+org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning
+org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
+org.eclipse.jdt.core.compiler.source=1.3
Added: maven/trunk/ogoglio-body-editor-applet/pom.xml
===================================================================
--- maven/trunk/ogoglio-body-editor-applet/pom.xml (rev 0)
+++ maven/trunk/ogoglio-body-editor-applet/pom.xml 2007-08-21 03:19:54 UTC (rev 250)
@@ -0,0 +1,47 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>ogoglio-body-editor-applet</groupId>
+ <artifactId>ogoglio-body-editor-applet</artifactId>
+ <version>0.0.1</version>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-assembly-plugin</artifactId>
+ <configuration>
+ <descriptors>
+ <descriptor>
+ src/assemble/ogoglio-code.xml
+ </descriptor>
+ </descriptors>
+ <finalName>body-editor</finalName>
+ <appendAssemblyId>false</appendAssemblyId>
+ </configuration>
+ <executions>
+ <execution>
+ <id>make-assembly</id>
+ <phase>package</phase><!-- append to the packaging phase. -->
+ <goals>
+ <goal>attached</goal><!--tricky, this "attaches" this to a goal -->
+ </goals>
+ </execution>
+ </executions>
+
+ </plugin>
+ </plugins>
+ </build>
+
+ <dependencies>
+ <dependency>
+ <groupId>com.ogoglio</groupId>
+ <artifactId>ogoglio-common</artifactId>
+ <version>0.0.1</version>
+ </dependency>
+ </dependencies>
+</project>
+
Added: maven/trunk/ogoglio-body-editor-applet/src/assemble/ogoglio-code.xml
===================================================================
--- maven/trunk/ogoglio-body-editor-applet/src/assemble/ogoglio-code.xml (rev 0)
+++ maven/trunk/ogoglio-body-editor-applet/src/assemble/ogoglio-code.xml 2007-08-21 03:19:54 UTC (rev 250)
@@ -0,0 +1,17 @@
+<assembly>
+ <includeBaseDirectory>false</includeBaseDirectory>
+ <id>ogoglio-code</id>
+ <formats>
+ <format>jar</format>
+ </formats>
+ <dependencySets>
+ <dependencySet>
+ <unpack>true</unpack>
+ <useDefaultExcludes>true</useDefaultExcludes>
+ <outputFileNameMapping></outputFileNameMapping>
+ <includes>
+ <include>com.ogoglio:ogoglio-common</include>
+ </includes>
+ </dependencySet>
+ </dependencySets>
+</assembly>
Added: maven/trunk/ogoglio-body-editor-applet/src/main/java/com/ogoglio/bodyeditor/BodyEditorApplet.java
===================================================================
--- maven/trunk/ogoglio-body-editor-applet/src/main/java/com/ogoglio/bodyeditor/BodyEditorApplet.java (rev 0)
+++ maven/trunk/ogoglio-body-editor-applet/src/main/java/com/ogoglio/bodyeditor/BodyEditorApplet.java 2007-08-21 03:19:54 UTC (rev 250)
@@ -0,0 +1,637 @@
+/* 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.bodyeditor;
+
+import java.applet.Applet;
+import java.awt.BorderLayout;
+import java.awt.Color;
+import java.awt.Cursor;
+import java.awt.Dimension;
+import java.awt.FlowLayout;
+import java.awt.Graphics;
+import java.awt.GraphicsConfigTemplate;
+import java.awt.GraphicsConfiguration;
+import java.awt.GraphicsDevice;
+import java.awt.GraphicsEnvironment;
+import java.awt.Image;
+import java.awt.Panel;
+import java.awt.event.MouseEvent;
+import java.awt.event.MouseListener;
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.URI;
+import java.net.URISyntaxException;
+import java.util.Vector;
+
+import javax.media.j3d.AmbientLight;
+import javax.media.j3d.Background;
+import javax.media.j3d.BoundingSphere;
+import javax.media.j3d.BranchGroup;
+import javax.media.j3d.DirectionalLight;
+import javax.media.j3d.GraphicsConfigTemplate3D;
+import javax.media.j3d.Transform3D;
+import javax.media.j3d.TransformGroup;
+import javax.media.j3d.View;
+import javax.swing.ImageIcon;
+import javax.swing.JLabel;
+import javax.vecmath.Color3f;
+import javax.vecmath.Point3d;
+import javax.vecmath.Vector3f;
+
+import com.ogoglio.client.WebAPIAuthenticator;
+import com.ogoglio.client.WebAPIClient;
+import com.ogoglio.client.WebAPIClientWire;
+import com.ogoglio.client.WebAPIDescriptor;
+import com.ogoglio.client.model.Body;
+import com.ogoglio.client.model.Space;
+import com.ogoglio.client.model.User;
+import com.ogoglio.client.model.Space.Context;
+import com.ogoglio.util.BodyConstants;
+import com.ogoglio.viewer.render.UIConstants;
+import com.ogoglio.viewer.j3d.J3DCamera;
+import com.ogoglio.viewer.j3d.J3DCanvas;
+import com.ogoglio.viewer.j3d.J3DUniverse;
+import com.ogoglio.viewer.j3d.J3DUserRenderable;
+import com.ogoglio.xml.AccountDocument;
+import com.ogoglio.xml.BodyDocument;
+
+public class BodyEditorApplet extends Applet {
+
+ public static final ImageIcon LEFT_ARROW = UIConstants.loadIconFromResource("com/ogoglio/viewer/applet/resources/LeftArrow.gif");
+
+ public static final ImageIcon LEFT_ARROW_DISABLED = UIConstants.loadIconFromResource("com/ogoglio/viewer/applet/resources/LeftArrowDisabled.gif");
+
+ public static final ImageIcon RIGHT_ARROW = UIConstants.loadIconFromResource("com/ogoglio/viewer/applet/resources/RightArrow.gif");
+
+ public static final ImageIcon RIGHT_ARROW_DISABLED = UIConstants.loadIconFromResource("com/ogoglio/viewer/applet/resources/RightArrowDisabled.gif");
+
+ private RowModel hairRowModel = null;
+
+ private RowModel eyesRowModel = null;
+
+ private RowModel noseRowModel = null;
+
+ private RowModel mouthRowModel = null;
+
+ private RowModel faceRowModel = null;
+
+ private URI serviceURI = null;
+
+ private String authCookie = null;
+
+ private AccountDocument accountDoc = null;
+
+ private BodyDocument bodyDoc = null;
+
+ private WestPanel westPanel = null;
+
+ private BodyPanel bodyPanel = new BodyPanel();
+
+ private EastPanel eastPanel = null;
+
+ private SpacelessUser user = null;
+
+ private WebAPIClient webClient;
+
+ public BodyEditorApplet() {
+ setBackground(Color.WHITE);
+ setLayout(new BorderLayout());
+ }
+
+ private class SpacelessUser extends User {
+ public SpacelessUser(String username) {
+ super(new Space(new SpacelessContext(), 1, "Space", "nobody", false, 0), username, new Transform3D(), 1);
+ }
+ }
+
+ private class SpacelessContext implements Context {
+
+ public InputStream getUserGeometryStream(String username, String name) throws IOException {
+ return BodyEditorApplet.class.getClassLoader().getResourceAsStream("com/ogoglio/viewer/applet/resources/avatar.obj");
+ }
+
+ public InputStream getUserAnimationStream(String username, long animationID) throws IOException {
+ if (animationID == 1) {
+ return BodyEditorApplet.class.getClassLoader().getResourceAsStream("com/ogoglio/viewer/applet/resources/avatar.bvh");
+ } else if (animationID == 2) {
+ return BodyEditorApplet.class.getClassLoader().getResourceAsStream("com/ogoglio/viewer/applet/resources/avatar-walk.bvh");
+ } else if (animationID == 3) {
+ return BodyEditorApplet.class.getClassLoader().getResourceAsStream("com/ogoglio/viewer/applet/resources/avatar-wave.bvh");
+ }
+ return null;
+ }
+
+ public InputStream getUserSkinMapStream(String username) throws IOException {
+ return BodyEditorApplet.class.getClassLoader().getResourceAsStream("com/ogoglio/viewer/applet/resources/avatar.smap");
+ }
+
+ public InputStream getPageContentStream(long thingID, long pageID) {
+ return null;
+ }
+
+ public InputStream getTemplateGeometryStream(String ownerUsername, long templateID, int lodIndex) {
+ return null;
+ }
+
+ public InputStream getTemplateResourceStream(String ownerUsername, long templateID, String name) throws IOException {
+ return null;
+ }
+
+ public InputStream getThingAnimationStream(long thingID, long animationID) throws IOException {
+ return null;
+ }
+
+ public String getThingScript(long thingID) throws IOException {
+ return null;
+ }
+
+ public BodyDocument getBodyDocument(String username, long bodyID) throws IOException {
+ return bodyDoc;
+ }
+ }
+
+ private class BodyPanel extends Panel {
+ Dimension dimension = new Dimension(200, 300);
+
+ private J3DUniverse universe = null;
+
+ private J3DCamera camera = null;
+
+ private J3DCanvas canvas = null;
+
+ private BranchGroup sceneRoot = new BranchGroup();
+
+ private BranchGroup worldBranch = new BranchGroup();
+
+ private TransformGroup userGroup = new TransformGroup();
+
+ private BoundingSphere bounds = new BoundingSphere(new Point3d(), 1000);
+
+ J3DUserRenderable renderable = null;
+
+ public BodyPanel() {
+ setPreferredSize(dimension);
+ setMinimumSize(dimension);
+ setBackground(Color.gray);
+ setLayout(new BorderLayout());
+
+ universe = new J3DUniverse();
+ canvas = new J3DCanvas(get3DConfiguration(), false);
+ camera = new J3DCamera();
+ camera.setCanvas(canvas);
+
+ add(canvas, BorderLayout.CENTER);
+ setupUniverse();
+ }
+
+ public boolean addUserRenderable() {
+ try {
+ renderable = new J3DUserRenderable(user, true);
+ userGroup.addChild(renderable);
+ return true;
+ } catch (Exception e) {
+ e.printStackTrace();
+ return false;
+ }
+ }
+
+ private void addDirectionalLight(Color3f color, Vector3f direction) {
+ DirectionalLight lightD1 = new DirectionalLight(color, direction);
+ lightD1.setInfluencingBounds(bounds);
+ sceneRoot.addChild(lightD1);
+ }
+
+ public void setupUniverse() {
+
+ UIConstants.loadIconFromResource("fart");
+ addDirectionalLight(UIConstants.WHITE, new Vector3f(0, 0, -1));
+ addDirectionalLight(UIConstants.DARK_GRAY, new Vector3f(0.3f, -0.8f, 0.3f));
+ addDirectionalLight(UIConstants.DARK_GRAY, new Vector3f(-0.4f, 0.8f, -0.2f));
+ AmbientLight ambientLightNode = new AmbientLight(UIConstants.WHITE);
+ ambientLightNode.setInfluencingBounds(bounds);
+ sceneRoot.addChild(ambientLightNode);
+
+ Background background = new Background(UIConstants.WHITE);
+ background.setApplicationBounds(bounds);
+ sceneRoot.addChild(background);
+
+ universe.addWorldObject(sceneRoot);
+
+ worldBranch.addChild(userGroup);
+ sceneRoot.addChild(worldBranch);
+
+ userGroup.setCapability(TransformGroup.ALLOW_CHILDREN_EXTEND);
+ userGroup.setCapability(TransformGroup.ALLOW_CHILDREN_WRITE);
+ userGroup.setCapability(TransformGroup.ALLOW_TRANSFORM_READ);
+ userGroup.setCapability(TransformGroup.ALLOW_TRANSFORM_WRITE);
+
+ canvas.getView().setTransparencySortingPolicy(View.TRANSPARENCY_SORT_GEOMETRY);
+ canvas.getView().setSceneAntialiasingEnable(true);
+
+ camera.setRotation(-0.5, Math.PI, 0);
+ camera.setLocation(new Vector3f(0f, 1.7f, -0.9f));
+ sceneRoot.addChild(camera.getNode());
+
+ universe.makeLive();
+ }
+ }
+
+ private class WestPanel extends Panel {
+ Dimension dimension = new Dimension(150, 300);
+
+ ScrollingRowPanel hairRow = new ScrollingRowPanel(true, hairRowModel);
+
+ ScrollingRowPanel eyesRow = new ScrollingRowPanel(true, eyesRowModel);
+
+ ScrollingRowPanel noseRow = new ScrollingRowPanel(true, noseRowModel);
+
+ ScrollingRowPanel mouseRow = new ScrollingRowPanel(true, mouthRowModel);
+
+ ScrollingRowPanel faceRow = new ScrollingRowPanel(true, faceRowModel);
+
+ GenderPanel genderPanel = new GenderPanel();
+
+ HeightPanel heightPanel = new HeightPanel();
+
+ public WestPanel() {
+ setPreferredSize(dimension);
+ setMinimumSize(dimension);
+ setLayout(new FlowLayout(FlowLayout.CENTER, 0, 5));
+ setBackground(Color.WHITE);
+
+ //add(hairRow);
+ add(eyesRow);
+ add(noseRow);
+ add(mouseRow);
+ add(faceRow);
+ //add(genderPanel);
+ //add(heightPanel);
+ }
+ }
+
+ private class GenderPanel extends Panel {
+ Dimension dimension = new Dimension(80, 35);
+
+ public GenderPanel() {
+ setPreferredSize(dimension);
+ setMinimumSize(dimension);
+
+ setBackground(Color.GRAY);
+ }
+ }
+
+ private class TexturePanel extends Panel {
+ Dimension dimension = new Dimension(80, 35);
+
+ public TexturePanel() {
+ setPreferredSize(dimension);
+ setMinimumSize(dimension);
+
+ setBackground(Color.GRAY);
+ }
+ }
+
+ private class HeightPanel extends Panel {
+ Dimension dimension = new Dimension(150, 25);
+
+ public HeightPanel() {
+ setPreferredSize(dimension);
+ setMinimumSize(dimension);
+
+ setBackground(Color.GRAY);
+ }
+ }
+
+ private class WidthPanel extends Panel {
+ Dimension dimension = new Dimension(150, 25);
+
+ public WidthPanel() {
+ setPreferredSize(dimension);
+ setMinimumSize(dimension);
+
+ setBackground(Color.GRAY);
+ }
+ }
+
+ private class EastPanel extends Panel {
+ Dimension dimension = new Dimension(150, 300);
+
+ ScrollingRowPanel hairRow = new ScrollingRowPanel(false, hairRowModel);
+
+ ScrollingRowPanel eyesRow = new ScrollingRowPanel(false, eyesRowModel);
+
+ ScrollingRowPanel noseRow = new ScrollingRowPanel(false, noseRowModel);
+
+ ScrollingRowPanel mouthRow = new ScrollingRowPanel(false, mouthRowModel);
+
+ ScrollingRowPanel faceRow = new ScrollingRowPanel(false, faceRowModel);
+
+ TexturePanel texturePanel = new TexturePanel();
+
+ WidthPanel widthPanel = new WidthPanel();
+
+ public EastPanel() {
+ setPreferredSize(dimension);
+ setMinimumSize(dimension);
+ setLayout(new FlowLayout(FlowLayout.CENTER, 0, 5));
+ setBackground(Color.WHITE);
+
+ //add(hairRow);
+ add(eyesRow);
+ add(noseRow);
+ add(mouthRow);
+ add(faceRow);
+
+ //add(texturePanel);
+ //add(widthPanel);
+ }
+ }
+
+ private class ArrowButton extends Panel implements MouseListener {
+ Image image = null;
+
+ ArrowButtonListener listener = null;
+
+ ArrowButton(Image image, ArrowButtonListener listener) {
+ this.image = image;
+ this.listener = listener;
+ this.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
+ setPreferredSize(new Dimension(image.getWidth(this), image.getHeight(this)));
+ addMouseListener(this);
+ }
+
+ public void paint(Graphics graphics) {
+ graphics.drawImage(image, 0, 0, this);
+ }
+
+ public void mouseClicked(MouseEvent event) {
+ if (listener != null) {
+ listener.clicked(this);
+ }
+ }
+
+ public void mouseEntered(MouseEvent arg0) {
+ }
+
+ public void mouseExited(MouseEvent arg0) {
+ }
+
+ public void mousePressed(MouseEvent arg0) {
+ }
+
+ public void mouseReleased(MouseEvent arg0) {
+ }
+
+ }
+
+ private interface ArrowButtonListener {
+ public void clicked(ArrowButton button);
+ }
+
+ private class RowModel {
+ int currentIndex = 0;
+
+ Image[] icons = null;
+
+ Vector listeners = new Vector();
+
+ RowModel(int index, Image[] icons) {
+ this.currentIndex = index;
+ this.icons = icons;
+ }
+
+ void increment() {
+ if (currentIndex >= icons.length - 1) {
+ return;
+ }
+ currentIndex++;
+ for (int i = 0; i < listeners.size(); i++) {
+ ((RowModelListener) listeners.elementAt(i)).indexChanged(this);
+ }
+ }
+
+ void decrement() {
+ if (currentIndex <= 0) {
+ return;
+ }
+ currentIndex--;
+ for (int i = 0; i < listeners.size(); i++) {
+ ((RowModelListener) listeners.elementAt(i)).indexChanged(this);
+ }
+ }
+ }
+
+ private interface RowModelListener {
+ public void indexChanged(RowModel model);
+ }
+
+ private class ScrollingRowPanel extends Panel implements ArrowButtonListener, RowModelListener {
+ boolean left = false;
+
+ int iconDisplayWidth = 32;
+
+ int iconDisplayHeight = 32;
+
+ int iconPadding = 12;
+
+ Dimension dimension = new Dimension(150, 38);
+
+ ArrowButton arrowButton = null;
+
+ RowModel model = null;
+
+ int numIcons = 0;
+
+ int iconYPos = 1;
+
+ public ScrollingRowPanel(boolean left, RowModel model) {
+ setPreferredSize(dimension);
+ setMinimumSize(dimension);
+ setBackground(Color.WHITE);
+ this.left = left;
+ this.model = model;
+
+ setLayout(new FlowLayout(left ? FlowLayout.LEFT : FlowLayout.RIGHT, 0, 1));
+
+ arrowButton = new ArrowButton(left ? LEFT_ARROW.getImage() : RIGHT_ARROW.getImage(), this);
+ add(arrowButton);
+ float widthToHeightRatio = model.icons[0].getWidth(null) / (float) model.icons[0].getHeight(null);
+ if (model.icons[0].getWidth(null) > model.icons[0].getHeight(null)) {
+ iconDisplayHeight = (int) (iconDisplayWidth / widthToHeightRatio);
+ } else {
+ iconDisplayWidth = (int) (iconDisplayHeight * widthToHeightRatio);
+ }
+
+ numIcons = (int) ((dimension.width - arrowButton.getPreferredSize().getWidth()) / (iconDisplayWidth + (2 * iconPadding)));
+ iconYPos = (dimension.height / 2) - (iconDisplayHeight / 2);
+ model.listeners.add(this);
+ }
+
+ public void paint(Graphics graphics) {
+ graphics.setColor(Color.WHITE);
+ graphics.fillRect(0, 0, getWidth(), getHeight());
+ if (left) {
+ paintLeft(graphics);
+ } else {
+ paintRight(graphics);
+ }
+ }
+
+ void paintLeft(Graphics graphics) {
+ graphics.setColor(Color.GRAY);
+ graphics.drawRect(0, 0, getWidth() + 1, getHeight() - 1);
+ if (getWidth() <= 1) {
+ return;
+ }
+ int numDrawn = 0;
+ for (int i = model.currentIndex - 1; i >= 0 && i < model.icons.length && numDrawn <= numIcons; i--) {
+ graphics.drawImage(model.icons[i], getWidth() - iconDisplayWidth - (numDrawn * iconDisplayWidth) - (numDrawn * iconPadding), iconYPos, iconDisplayWidth, iconDisplayHeight, this);
+ numDrawn++;
+ }
+ }
+
+ void paintRight(Graphics graphics) {
+ graphics.setColor(Color.GRAY);
+ graphics.drawRect(-1, 0, getWidth(), getHeight() - 1);
+ if (getWidth() <= 1) {
+ return;
+ }
+ int numDrawn = 0;
+ for (int i = model.currentIndex + 1; i < model.icons.length && numDrawn <= numIcons; i++) {
+ graphics.drawImage(model.icons[i], ((i - model.currentIndex - 1) * iconDisplayWidth) + (numDrawn * iconPadding), iconYPos, iconDisplayWidth, iconDisplayHeight, this);
+ numDrawn++;
+ }
+
+ }
+
+ public void clicked(ArrowButton button) {
+ if (left) {
+ model.increment();
+ } else {
+ model.decrement();
+ }
+ }
+
+ public void indexChanged(RowModel model) {
+ repaint();
+ if (model == hairRowModel) {
+ bodyDoc.setHairIndex(hairRowModel.currentIndex);
+ } else if (model == eyesRowModel) {
+ bodyDoc.setEyesIndex(eyesRowModel.currentIndex);
+ } else if (model == noseRowModel) {
+ bodyDoc.setNoseIndex(noseRowModel.currentIndex);
+ } else if (model == mouthRowModel) {
+ bodyDoc.setMouthIndex(mouthRowModel.currentIndex);
+ } else if (model == faceRowModel) {
+ bodyDoc.setFaceIndex(faceRowModel.currentIndex);
+ } else {
+ throw new IllegalStateException("Unknown model: " + model);
+ }
+ Body body = user.getBody();
+ body.set(bodyDoc.getHairIndex(), bodyDoc.getEyesIndex(), bodyDoc.getNoseIndex(), bodyDoc.getMouthIndex(), bodyDoc.getFaceIndex());
+ bodyPanel.renderable.repaintSkinTexture();
+ try {
+ webClient.updateBody(bodyDoc);
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ }
+ }
+
+ public void start() {
+ authCookie = getParameter("loginCookie");
+ if (authCookie == null) {
+ add(new ErrorPanel("Unfortunately, I can't authenticate. Perhaps you aren't logged in?"), BorderLayout.CENTER);
+ return;
+ }
+
+ if (getParameter("serviceURI") == null) {
+ add(new ErrorPanel("Unfortunately, I can't find the space and service address. Who wrote this web page?!?"), BorderLayout.CENTER);
+ validate();
+ return;
+ }
+
+ try {
+ serviceURI = new URI(getParameter("serviceURI"));
+ WebAPIClientWire wire = new WebAPIClientWire();
+ WebAPIDescriptor descriptor = new WebAPIDescriptor(serviceURI);
+ WebAPIAuthenticator authenticator = new WebAPIAuthenticator(wire, descriptor, authCookie);
+ webClient = new WebAPIClient(descriptor, authenticator, wire);
+ accountDoc = authenticator.getAccountDocument(true);
+ bodyDoc = webClient.getBodyDocument(accountDoc.getUsername(), accountDoc.getDefaultBodyID());
+
+ user = new SpacelessUser(accountDoc.getUsername());
+
+ hairRowModel = new RowModel(bodyDoc.getEyesIndex(), BodyConstants.EYES);
+ eyesRowModel = new RowModel(bodyDoc.getEyesIndex(), BodyConstants.EYES);
+ noseRowModel = new RowModel(bodyDoc.getNoseIndex(), BodyConstants.NOSES);
+ mouthRowModel = new RowModel(bodyDoc.getMouthIndex(), BodyConstants.MOUTHES);
+ faceRowModel = new RowModel(bodyDoc.getFaceIndex(), BodyConstants.BASE_SKIN_TEXTURES);
+
+ add(bodyPanel, BorderLayout.CENTER);
+ westPanel = new WestPanel();
+ add(westPanel, BorderLayout.WEST);
+ eastPanel = new EastPanel();
+ add(eastPanel, BorderLayout.EAST);
+
+ } catch (URISyntaxException e) {
+ e.printStackTrace();
+ removeAll();
+ validate();
+ add(new ErrorPanel("Unfortunately, I can't find the service address."), BorderLayout.CENTER);
+ } catch (Throwable e) {
+ e.printStackTrace();
+ removeAll();
+ validate();
+ add(new ErrorPanel("Unfortunately, I couldn't connect to the server."), BorderLayout.CENTER);
+ }
+ validate();
+ new Thread() {
+ public void run() {
+ bodyPanel.addUserRenderable();
+ }
+ }.start();
+ }
+
+ public void destroy() {
+ //renderer.stopRenderer();
+ }
+
+ public void stop() {
+ //renderer.stopRenderer();
+ }
+
+ //TODO make the error panel less ugly
+ private class ErrorPanel extends Panel {
+ public ErrorPanel(String errorMessage) {
+ setBackground(Color.WHITE);
+ JLabel headingLabel = new JLabel("<html><body><h1>There was an error:</h1></body</html>");
+ headingLabel.setBackground(Color.WHITE);
+ add(headingLabel);
+ JLabel errorLabel = new JLabel(errorMessage);
+ errorLabel.setBackground(Color.WHITE);
+ add(errorLabel);
+ }
+ }
+
+ private GraphicsConfiguration get3DConfiguration() {
+ GraphicsConfigTemplate3D configTemplate = new GraphicsConfigTemplate3D();
+ GraphicsEnvironment graphicsEnv = GraphicsEnvironment.getLocalGraphicsEnvironment();
+ GraphicsDevice device = graphicsEnv.getDefaultScreenDevice();
+ configTemplate.setSceneAntialiasing(GraphicsConfigTemplate.REQUIRED);
+ configTemplate.setDoubleBuffer(GraphicsConfigTemplate.REQUIRED);
+ return device.getBestConfiguration(configTemplate);
+ }
+
+}
Added: maven/trunk/ogoglio-common/.classpath
===================================================================
--- maven/trunk/ogoglio-common/.classpath (rev 0)
+++ maven/trunk/ogoglio-common/.classpath 2007-08-21 03:19:54 UTC (rev 250)
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" path="src/main/java"/>
+ <classpathentry kind="src" path="src/test/java"/>
+ <classpathentry excluding="**" kind="src" output="src/main/resources" path="src/main/resources"/>
+ <classpathentry excluding="**" kind="src" output="src/test/resources" path="src/test/resources"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+ <classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>
+ <classpathentry kind="output" path="target/classes"/>
+</classpath>
Added: maven/trunk/ogoglio-common/.project
===================================================================
--- maven/trunk/ogoglio-common/.project (rev 0)
+++ maven/trunk/ogoglio-common/.project 2007-08-21 03:19:54 UTC (rev 250)
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>ogoglio-common</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.maven.ide.eclipse.maven2Builder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ <nature>org.maven.ide.eclipse.maven2Nature</nature>
+ </natures>
+</projectDescription>
Added: maven/trunk/ogoglio-common/.settings/org.eclipse.jdt.core.prefs
===================================================================
--- maven/trunk/ogoglio-common/.settings/org.eclipse.jdt.core.prefs (rev 0)
+++ maven/trunk/ogoglio-common/.settings/org.eclipse.jdt.core.prefs 2007-08-21 03:19:54 UTC (rev 250)
@@ -0,0 +1,59 @@
+#Sun Aug 19 17:09:35 PDT 2007
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.2
+org.eclipse.jdt.core.compiler.co...
[truncated message content] |
|
From: <tre...@us...> - 2007-08-20 23:12:43
|
Revision: 249
http://ogoglio.svn.sourceforge.net/ogoglio/?rev=249&view=rev
Author: trevorolio
Date: 2007-08-20 16:12:20 -0700 (Mon, 20 Aug 2007)
Log Message:
-----------
Tweaked the example server.xml to have the mail session resource.
Modified Paths:
--------------
spaces/trunk/docs/server.xml
Modified: spaces/trunk/docs/server.xml
===================================================================
--- spaces/trunk/docs/server.xml 2007-08-20 23:09:52 UTC (rev 248)
+++ spaces/trunk/docs/server.xml 2007-08-20 23:12:20 UTC (rev 249)
@@ -20,6 +20,12 @@
<!-- <Resource name="jdbc/space" scope="Shareable" type="javax.sql.DataSource" factory="org.apache.tomcat.dbcp.dbcp.BasicDataSourceFactory" url="jdbc:hsqldb:/tmp/ogogliodb" driverClassName="org.hsqldb.jdbcDriver" username="sa" password="" maxIdle="5" maxActive="50" /> -->
<Resource name="jdbc/space" scope="Shareable" type="javax.sql.DataSource" factory="org.apache.tomcat.dbcp.dbcp.BasicDataSourceFactory" url="jdbc:mysql:/og" driverClassName="com.mysql.jdbc.Driver" username="oguser" password="sssh" maxIdle="5" maxActive="50" />
+ <!-- THIS DEFINES THE EMAIL SERVER USED BY THE OGOGLIO SERVLETS, SET TO YOUR SMTP HOST -->
+ <Resource name="mail/Session" auth="Container" type="javax.mail.Session"/>
+ <ResourceParams name="mail/Session">
+ <parameter> <name>mail.smtp.host</name> <value>localhost</value> </parameter>
+ </ResourceParams>
+
<!-- THE FOLLOWING VARIABLES ARE READ IN com.ogoglio.site.AbstractResourceServet.init -->
<!-- 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 -->
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <tre...@us...> - 2007-08-20 23:09:51
|
Revision: 248
http://ogoglio.svn.sourceforge.net/ogoglio/?rev=248&view=rev
Author: trevorolio
Date: 2007-08-20 16:09:52 -0700 (Mon, 20 Aug 2007)
Log Message:
-----------
Added a fetal email toolset, which means we need mail and activation jars in ${TOMCAT_HOME}/common/lib/ and JNDI entries for mail sessions.
Modified Paths:
--------------
spaces/trunk/.classpath
spaces/trunk/src/com/ogoglio/OgoglioTestSuite.java
spaces/trunk/src/com/ogoglio/persist/AccountPersistTasks.java
spaces/trunk/src/com/ogoglio/persist/Persist.hbm.xml
spaces/trunk/src/com/ogoglio/persist/PersistTests.java
spaces/trunk/src/com/ogoglio/site/AccountServlet.java
spaces/trunk/src/com/ogoglio/util/ArgumentUtils.java
spaces/trunk/src/com/ogoglio/util/StreamUtils.java
Added Paths:
-----------
spaces/trunk/common-lib/
spaces/trunk/common-lib/activation.jar
spaces/trunk/common-lib/mail.jar
spaces/trunk/src/com/ogoglio/mail/
spaces/trunk/src/com/ogoglio/mail/MailClient.java
spaces/trunk/src/com/ogoglio/mail/MailFormatter.java
spaces/trunk/src/com/ogoglio/mail/MailSendException.java
spaces/trunk/src/com/ogoglio/mail/MailTests.java
spaces/trunk/src/com/ogoglio/mail/TestTemplate1.txt
spaces/trunk/src/com/ogoglio/persist/PendingEmailValidationRecord.java
Modified: spaces/trunk/.classpath
===================================================================
--- spaces/trunk/.classpath 2007-08-20 03:43:05 UTC (rev 247)
+++ spaces/trunk/.classpath 2007-08-20 23:09:52 UTC (rev 248)
@@ -30,5 +30,7 @@
<classpathentry kind="lib" path="shared-lib/commons-fileupload-1.1.1.jar"/>
<classpathentry kind="lib" path="shared-lib/commons-codec-1.3.jar"/>
<classpathentry kind="lib" path="shared-lib/antlr-2.7.5H3.jar"/>
+ <classpathentry kind="var" path="TOMCAT_HOME/common/lib/mail.jar"/>
+ <classpathentry kind="var" path="TOMCAT_HOME/common/lib/activation.jar"/>
<classpathentry kind="output" path="war/WEB-INF/classes"/>
</classpath>
Added: spaces/trunk/common-lib/activation.jar
===================================================================
(Binary files differ)
Property changes on: spaces/trunk/common-lib/activation.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: spaces/trunk/common-lib/mail.jar
===================================================================
(Binary files differ)
Property changes on: spaces/trunk/common-lib/mail.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Modified: spaces/trunk/src/com/ogoglio/OgoglioTestSuite.java
===================================================================
--- spaces/trunk/src/com/ogoglio/OgoglioTestSuite.java 2007-08-20 03:43:05 UTC (rev 247)
+++ spaces/trunk/src/com/ogoglio/OgoglioTestSuite.java 2007-08-20 23:09:52 UTC (rev 248)
@@ -18,6 +18,7 @@
import com.ogoglio.client.ClientTests;
import com.ogoglio.client.WebAPITests;
+import com.ogoglio.mail.MailTests;
import com.ogoglio.persist.PersistTests;
import com.ogoglio.sim.script.ScriptTests;
import com.ogoglio.templatesync.TemplateSyncTestSuite;
@@ -34,6 +35,7 @@
suite.addTestSuite(ClientTests.class);
suite.addTestSuite(ScriptTests.class);
suite.addTest(TemplateSyncTestSuite.suite());
+ suite.addTestSuite(MailTests.class);
return suite;
}
Added: spaces/trunk/src/com/ogoglio/mail/MailClient.java
===================================================================
--- spaces/trunk/src/com/ogoglio/mail/MailClient.java (rev 0)
+++ spaces/trunk/src/com/ogoglio/mail/MailClient.java 2007-08-20 23:09:52 UTC (rev 248)
@@ -0,0 +1,92 @@
+package com.ogoglio.mail;
+
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.IOException;
+
+import javax.mail.Message;
+import javax.mail.MessagingException;
+import javax.mail.Session;
+import javax.mail.Transport;
+import javax.mail.internet.AddressException;
+import javax.mail.internet.InternetAddress;
+import javax.mail.internet.MimeMessage;
+import javax.naming.Context;
+import javax.naming.InitialContext;
+import javax.naming.NamingException;
+
+import com.ogoglio.util.ArgumentUtils;
+
+public class MailClient {
+
+ private boolean writeToDisk = false;
+
+ private File outputDir = null;
+
+ /**
+ * Sends all mail to individual files in outputDir
+ */
+ public MailClient(File outputDir) {
+ ArgumentUtils.assertReadableDir(outputDir, true);
+ this.outputDir = outputDir;
+ writeToDisk = true;
+ }
+
+ /**
+ * Sends all mail via JNDI:java:comp/env session at mail/Session
+ */
+ public MailClient() {
+ writeToDisk = false;
+ }
+
+ public void sendEmail(String to, String from, String subject, String body) throws MailSendException {
+ try {
+ if (writeToDisk) {
+ sendToDisk(to, from, subject, body);
+ } else {
+ sendViaContextSession(to, from, subject, body);
+ }
+ } catch (NamingException e) {
+ throw new MailSendException(e);
+ } catch (AddressException e) {
+ throw new MailSendException(e);
+ } catch (MessagingException e) {
+ throw new MailSendException(e);
+ } catch (IOException e) {
+ throw new MailSendException(e);
+ }
+ }
+
+ private void sendToDisk(String to, String from, String subject, String body) throws IOException {
+ FileOutputStream output = new FileOutputStream(new File(outputDir, "Mail-Message-" + System.currentTimeMillis()));
+ output.write(("to: " + to + "\n").getBytes());
+ output.write(("from: " + from + "\n").getBytes());
+ output.write(("subject: " + subject + "\n").getBytes());
+ output.write(("\n").getBytes());
+ output.write(body.getBytes());
+ output.flush();
+ output.close();
+ }
+
+ private void sendViaContextSession(String to, String from, String subject, String body) throws NamingException, AddressException, MessagingException {
+ Context initCtx = new InitialContext();
+ Context envCtx = (Context) initCtx.lookup("java:comp/env");
+ Session session = (Session) envCtx.lookup("mail/Session");
+
+ Message message = new MimeMessage(session);
+ message.setFrom(new InternetAddress(from));
+ InternetAddress toAddress[] = new InternetAddress[1];
+ toAddress[0] = new InternetAddress(to);
+ message.setRecipients(Message.RecipientType.TO, toAddress);
+ message.setSubject(subject);
+ message.setContent(body, "text/plain");
+ Transport.send(message);
+ }
+
+ /**
+ * @return null if this client is using the JNDI mail session instead of writing to disk
+ */
+ public File getOutputDir() {
+ return outputDir;
+ }
+}
Added: spaces/trunk/src/com/ogoglio/mail/MailFormatter.java
===================================================================
--- spaces/trunk/src/com/ogoglio/mail/MailFormatter.java (rev 0)
+++ spaces/trunk/src/com/ogoglio/mail/MailFormatter.java 2007-08-20 23:09:52 UTC (rev 248)
@@ -0,0 +1,29 @@
+package com.ogoglio.mail;
+
+import java.util.Map;
+import java.util.regex.Pattern;
+
+import com.ogoglio.util.ArgumentUtils;
+
+public class MailFormatter {
+
+ public String format(Map map, String template) {
+ ArgumentUtils.assertNotNull(map);
+ ArgumentUtils.assertNotEmpty(template);
+ return stupidMerge(map, template);
+ }
+
+ private String stupidMerge(Map map, String template) {
+ String result = new String(template);
+ String[] keys = (String[])map.keySet().toArray(new String[0]);
+ for (int i = 0; i < keys.length; i++) {
+ String replacement = (String)map.get(keys[i]);
+ result = result.replaceAll(Pattern.quote(createVariableString((keys[i]))), replacement);
+ }
+ return result;
+ }
+
+ public String createVariableString(String variableName) {
+ return "${" + variableName + "}";
+ }
+}
Added: spaces/trunk/src/com/ogoglio/mail/MailSendException.java
===================================================================
--- spaces/trunk/src/com/ogoglio/mail/MailSendException.java (rev 0)
+++ spaces/trunk/src/com/ogoglio/mail/MailSendException.java 2007-08-20 23:09:52 UTC (rev 248)
@@ -0,0 +1,7 @@
+package com.ogoglio.mail;
+
+public class MailSendException extends Exception {
+ public MailSendException(Exception e) {
+ super(e);
+ }
+}
Added: spaces/trunk/src/com/ogoglio/mail/MailTests.java
===================================================================
--- spaces/trunk/src/com/ogoglio/mail/MailTests.java (rev 0)
+++ spaces/trunk/src/com/ogoglio/mail/MailTests.java 2007-08-20 23:09:52 UTC (rev 248)
@@ -0,0 +1,104 @@
+package com.ogoglio.mail;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.IOException;
+import java.util.HashMap;
+
+import junit.framework.TestCase;
+
+import com.ogoglio.util.ArgumentUtils;
+import com.ogoglio.util.StreamUtils;
+
+public class MailTests extends TestCase {
+
+ private static final String TEST_DIR_PATH = "mailTestFiles";
+
+ private static final String TEST_TEMPLATE_RESOURCE_PATH = "com/ogoglio/mail/";
+
+ private static final String TEST_TEMPLATE_1_NAME = "TestTemplate1.txt";
+
+ private File mailOutputDir = null;
+
+ private MailClient mailClient1 = null;
+
+ private MailFormatter mailFormatter1 = null;
+
+ private String testTemplate1 = null;
+
+ private HashMap testMap1 = null;
+
+ public void setUp() throws IOException {
+ mailOutputDir = new File(TEST_DIR_PATH);
+ if (mailOutputDir.exists()) {
+ delete(mailOutputDir);
+ }
+ assertTrue(mailOutputDir.mkdir());
+
+ mailClient1 = new MailClient(mailOutputDir);
+
+ mailFormatter1 = new MailFormatter();
+
+ testTemplate1 = StreamUtils.readResource(TEST_TEMPLATE_RESOURCE_PATH + TEST_TEMPLATE_1_NAME);
+ assertNotNull(testTemplate1);
+
+ testMap1 = new HashMap();
+ testMap1.put("username", "susan");
+ testMap1.put("url", "http://example.com/og/");
+ testMap1.put("moon.unit", "zappa");
+ testMap1.put("Kurt", "Vonnegut.");
+ }
+
+ private void delete(File dir) {
+ File[] children = dir.listFiles();
+ for (int i = 0; i < children.length; i++) {
+ assertTrue(children[i].delete());
+ }
+ assertTrue(dir.delete());
+ }
+
+ public void tearDown() {
+ if (mailOutputDir != null && mailOutputDir.exists()) {
+ delete(mailOutputDir);
+ }
+ }
+
+ public void testClientFileOutput() throws MailSendException, FileNotFoundException, IOException {
+ String body = "This is the body.";
+ String to = "to...@ex...";
+ String from = "ha...@ex...";
+ String subject = "OWLs 'n Stuff";
+ mailClient1.sendEmail(to, from, subject, body);
+ File[] files = mailClient1.getOutputDir().listFiles();
+ assertNotNull(files);
+ assertEquals(1, files.length);
+ assertFalse(files[0].length() == 0);
+ String fileContents = StreamUtils.readInput(new FileInputStream(files[0]));
+ assertTrue(fileContents.endsWith(body));
+ }
+
+ public void testFormat() {
+ String result = mailFormatter1.format(testMap1, testTemplate1);
+ assertNotNull(result);
+ assertTrue(result.length() > 1);
+ assertExactlyOne(result, (String) testMap1.get("username"));
+ assertMultiple(result, (String) testMap1.get("url"));
+ assertExactlyOne(result, (String) testMap1.get("moon.unit"));
+ assertExactlyOne(result, (String) testMap1.get("Kurt"));
+ }
+
+ private void assertExactlyOne(String data, String target) {
+ ArgumentUtils.assertNotEmpty(data);
+ ArgumentUtils.assertNotEmpty(target);
+ assertFalse(data.indexOf(target) == -1);
+ assertTrue(data.indexOf(target) == data.lastIndexOf(target));
+ }
+
+ private void assertMultiple(String data, String target) {
+ ArgumentUtils.assertNotEmpty(data);
+ ArgumentUtils.assertNotEmpty(target);
+ assertFalse(data.indexOf(target) == -1);
+ assertFalse(data.indexOf(target) == data.lastIndexOf(target));
+ }
+}
Added: spaces/trunk/src/com/ogoglio/mail/TestTemplate1.txt
===================================================================
--- spaces/trunk/src/com/ogoglio/mail/TestTemplate1.txt (rev 0)
+++ spaces/trunk/src/com/ogoglio/mail/TestTemplate1.txt 2007-08-20 23:09:52 UTC (rev 248)
@@ -0,0 +1,6 @@
+Replace this with username: ${username}
+Replace this with url: ${url}
+Also replace this with url: ${url}
+Replace this with moon.unit: ${moon.unit}
+Don't replace this with it, though: ${moonAunit}
+Replace this with Kurt: ${Kurt}
\ No newline at end of file
Modified: spaces/trunk/src/com/ogoglio/persist/AccountPersistTasks.java
===================================================================
--- spaces/trunk/src/com/ogoglio/persist/AccountPersistTasks.java 2007-08-20 03:43:05 UTC (rev 247)
+++ spaces/trunk/src/com/ogoglio/persist/AccountPersistTasks.java 2007-08-20 23:09:52 UTC (rev 248)
@@ -21,193 +21,160 @@
public class AccountPersistTasks {
- public static final String ACCOUNT_BY_USERNAME = "com.ogoglio.persist.accountByUsername";
- public static final String ACCOUNT_BY_EMAIL = "com.ogoglio.persist.accountByEmail";
+ public static final String ACCOUNT_BY_USERNAME = "com.ogoglio.persist.accountByUsername";
- public static final String ACCOUNT_BY_COOKIE = "com.ogoglio.persist.accountByCookie";
+ public static final String ACCOUNT_BY_EMAIL = "com.ogoglio.persist.accountByEmail";
- public static boolean update(final AccountRecord record,
- final AccountDocument document, SessionFactory sessionFactory)
- throws PersistException {
- HibernateTask task = new HibernateTask() {
- public Object run(Session hibernateSession) {
- boolean dirty = false;
- if (document.getAccountLevel() != null
- && !equals(record.getAccountlevel(), document
- .getAccountLevel())) {
- dirty = true;
- record.setAccountlevel(document.getAccountLevel());
- }
+ public static final String ACCOUNT_BY_COOKIE = "com.ogoglio.persist.accountByCookie";
- if (document.getHomepage() != null
- && !equals(record.getHomepage(), document.getHomepage())) {
- dirty = true;
- record.setHomepage(document.getHomepage());
- }
+ public static boolean update(final AccountRecord record, final AccountDocument document, SessionFactory sessionFactory) throws PersistException {
+ HibernateTask task = new HibernateTask() {
+ public Object run(Session hibernateSession) {
+ boolean dirty = false;
+ if (document.getAccountLevel() != null && !equals(record.getAccountlevel(), document.getAccountLevel())) {
+ dirty = true;
+ record.setAccountlevel(document.getAccountLevel());
+ }
- if (document.getFirstName() != null
- && !equals(record.getFirstName(), document
- .getFirstName())) {
- dirty = true;
- record.setFirstName(document.getFirstName());
- }
+ if (document.getHomepage() != null && !equals(record.getHomepage(), document.getHomepage())) {
+ dirty = true;
+ record.setHomepage(document.getHomepage());
+ }
- if (document.getLastName() != null
- && !equals(record.getLastName(), document.getLastName())) {
- dirty = true;
- record.setLastName(document.getLastName());
- }
+ if (document.getFirstName() != null && !equals(record.getFirstName(), document.getFirstName())) {
+ dirty = true;
+ record.setFirstName(document.getFirstName());
+ }
- if (document.getPassword() != null
- && !equals(record.getPassword(), document.getPassword())) {
- if (AccountRecord.cleanPassword(document.getPassword()) != null) {
- dirty = true;
- record.setPassword(document.getPassword());
- }
- }
+ if (document.getLastName() != null && !equals(record.getLastName(), document.getLastName())) {
+ dirty = true;
+ record.setLastName(document.getLastName());
+ }
- if (document.getDefaultBodyID() != -1) {
- Query bodyQuery = hibernateSession
- .getNamedQuery(BodyPersistTasks.BODY_BY_ID);
- bodyQuery.setLong("bodyID", document.getDefaultBodyID());
- BodyRecord bodyRec = (BodyRecord) bodyQuery.uniqueResult();
- if (bodyRec != null
- && bodyRec.getOwnerUsername().equals(
- record.getUsername())) {
- dirty = true;
- record.setDefaultBodyID(document.getDefaultBodyID());
- }
- }
+ if (document.getPassword() != null && !equals(record.getPassword(), document.getPassword())) {
+ if (AccountRecord.cleanPassword(document.getPassword()) != null) {
+ dirty = true;
+ record.setPassword(document.getPassword());
+ }
+ }
-
- if (document.getFrozenUntil() != null) {
- if (record.getFrozenUntil()!=document.getFrozenUntil().getTime()) {
- dirty = true;
- if (document.getFrozenUntil().getTime() < System.currentTimeMillis()) {
- record.setNotFrozen();
- } else {
- record.setFrozenUntil(document.getFrozenUntil().getTime());
- }
- }
- }
- if (dirty) {
- hibernateSession.update(record);
- return Boolean.TRUE;
- }
- return Boolean.FALSE;
- }
- };
- task.setSessionFactory(sessionFactory);
- return "true".equals(task.execute().toString());
- }
+ if (document.getDefaultBodyID() != -1) {
+ Query bodyQuery = hibernateSession.getNamedQuery(BodyPersistTasks.BODY_BY_ID);
+ bodyQuery.setLong("bodyID", document.getDefaultBodyID());
+ BodyRecord bodyRec = (BodyRecord) bodyQuery.uniqueResult();
+ if (bodyRec != null && bodyRec.getOwnerUsername().equals(record.getUsername())) {
+ dirty = true;
+ record.setDefaultBodyID(document.getDefaultBodyID());
+ }
+ }
- public static void update(final AccountRecord record,
- SessionFactory sessionFactory) throws PersistException {
- HibernateTask task = new HibernateTask() {
- public Object run(Session hibernateSession) {
- hibernateSession.update(record);
- return null;
- }
- };
- task.setSessionFactory(sessionFactory);
- task.execute();
- }
+ if (document.getFrozenUntil() != null) {
+ if (record.getFrozenUntil() != document.getFrozenUntil().getTime()) {
+ dirty = true;
+ if (document.getFrozenUntil().getTime() < System.currentTimeMillis()) {
+ record.setNotFrozen();
+ } else {
+ record.setFrozenUntil(document.getFrozenUntil().getTime());
+ }
+ }
+ }
+ if (dirty) {
+ hibernateSession.update(record);
+ return Boolean.TRUE;
+ }
+ return Boolean.FALSE;
+ }
+ };
+ task.setSessionFactory(sessionFactory);
+ return "true".equals(task.execute().toString());
+ }
- public static AccountRecord findAccountByCookie(final String cookie,
- SessionFactory sessionFactory) throws PersistException {
- HibernateTask task = new HibernateTask() {
- public Object run(Session hibernateSession) {
- Query query = hibernateSession.getNamedQuery(ACCOUNT_BY_COOKIE);
- query.setParameter("cookie", cookie);
- AccountRecord rec = (AccountRecord) query.uniqueResult();
- return rec;
- }
- };
- task.setSessionFactory(sessionFactory);
- return (AccountRecord) task.execute();
- }
+ public static void update(final AccountRecord record, SessionFactory sessionFactory) throws PersistException {
+ HibernateTask task = new HibernateTask() {
+ public Object run(Session hibernateSession) {
+ hibernateSession.update(record);
+ return null;
+ }
+ };
+ task.setSessionFactory(sessionFactory);
+ task.execute();
+ }
- public static AccountRecord[] findAllAccounts(SessionFactory sessionFactory)
- throws PersistException {
- HibernateTask task = new HibernateTask() {
- public Object run(Session hibernateSession) {
- Query query = hibernateSession
- .getNamedQuery("com.ogoglio.persist.accounts");
- return query.list().toArray(new AccountRecord[0]);
- }
- };
- task.setSessionFactory(sessionFactory);
- return (AccountRecord[]) task.execute();
- }
+ public static AccountRecord findAccountByCookie(final String cookie, SessionFactory sessionFactory) throws PersistException {
+ HibernateTask task = new HibernateTask() {
+ public Object run(Session hibernateSession) {
+ Query query = hibernateSession.getNamedQuery(ACCOUNT_BY_COOKIE);
+ query.setParameter("cookie", cookie);
+ AccountRecord rec = (AccountRecord) query.uniqueResult();
+ return rec;
+ }
+ };
+ task.setSessionFactory(sessionFactory);
+ return (AccountRecord) task.execute();
+ }
- 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) {
- final String cleanedUsername = AccountRecord
- .cleanUsername(username);
- Query query = hibernateSession
- .getNamedQuery(ACCOUNT_BY_USERNAME);
- query.setParameter("username", cleanedUsername);
+ public static AccountRecord[] findAllAccounts(SessionFactory sessionFactory) throws PersistException {
+ HibernateTask task = new HibernateTask() {
+ public Object run(Session hibernateSession) {
+ Query query = hibernateSession.getNamedQuery("com.ogoglio.persist.accounts");
+ return query.list().toArray(new AccountRecord[0]);
+ }
+ };
+ task.setSessionFactory(sessionFactory);
+ return (AccountRecord[]) task.execute();
+ }
- AccountRecord record = (AccountRecord) query.uniqueResult();
- if (record != null) {
- return null; // XXX really weird semantic: try to create something and get null because it's there?
- }
+ 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) {
+ final String cleanedUsername = AccountRecord.cleanUsername(username);
+ Query query = hibernateSession.getNamedQuery(ACCOUNT_BY_USERNAME);
+ query.setParameter("username", cleanedUsername);
- //IES:debug because unique constraint on this field!
- final String cleanedEmail = AccountRecord.cleanEmail(email);
- query = hibernateSession.getNamedQuery(ACCOUNT_BY_EMAIL);
- query.setParameter("email", email);
- record = (AccountRecord) query.uniqueResult();
- if (record != null) {
- System.err.println("Whoa! Bad email value!" + email);
- }
+ 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);
+ String cleanedEmail = AccountRecord.cleanEmail(email);
+ query = hibernateSession.getNamedQuery(ACCOUNT_BY_EMAIL);
+ query.setParameter("email", cleanedEmail);
+ record = (AccountRecord) query.uniqueResult();
+ if (record != null) {
+ System.err.println("Whoa! Bad email value!" + cleanedEmail);
+ }
- record.setDefaultBodyID(bodyRec.getBodyID());
- hibernateSession.update(record);
- return record;
- }
- };
- task.setSessionFactory(sessionFactory);
- return (AccountRecord) task.execute();
- }
+ record = new AccountRecord(username, accountlevel, cleanedEmail);
+ hibernateSession.save(record);
+ BodyRecord bodyRec = new BodyRecord("Body", record.getUsername());
+ hibernateSession.save(bodyRec);
- public static AccountRecord findAccountByUsername(String username,
- SessionFactory sessionFactory) throws PersistException {
- final String cleanedUsername = AccountRecord.cleanUsername(username);
- if (cleanedUsername == null) {
- return null;
- }
- HibernateTask task = new HibernateTask() {
- public Object run(Session hibernateSession) {
- Query query = hibernateSession
- .getNamedQuery(ACCOUNT_BY_USERNAME);
- query.setParameter("username", cleanedUsername);
- return query.uniqueResult();
- }
- };
- task.setSessionFactory(sessionFactory);
- return (AccountRecord) task.execute();
- }
+ record.setDefaultBodyID(bodyRec.getBodyID());
+ hibernateSession.update(record);
+
+ PendingEmailValidationRecord validationRecord = new PendingEmailValidationRecord(username, cleanedEmail);
+ hibernateSession.save(validationRecord);
+
+ return record;
+ }
+ };
+ task.setSessionFactory(sessionFactory);
+ return (AccountRecord) task.execute();
+ }
- public static void delete(final AccountRecord accRec,
- SessionFactory sessionFactory) throws PersistException {
- HibernateTask task = new HibernateTask() {
- public Object run(Session hibernateSession) {
- hibernateSession.delete(accRec);
- return null;
- }
- };
- task.setSessionFactory(sessionFactory);
- task.execute();
-
- }
+ public static AccountRecord findAccountByUsername(String username, SessionFactory sessionFactory) throws PersistException {
+ final String cleanedUsername = AccountRecord.cleanUsername(username);
+ if (cleanedUsername == null) {
+ return null;
+ }
+ HibernateTask task = new HibernateTask() {
+ public Object run(Session hibernateSession) {
+ Query query = hibernateSession.getNamedQuery(ACCOUNT_BY_USERNAME);
+ query.setParameter("username", cleanedUsername);
+ return query.uniqueResult();
+ }
+ };
+ task.setSessionFactory(sessionFactory);
+ return (AccountRecord) task.execute();
+ }
}
Added: spaces/trunk/src/com/ogoglio/persist/PendingEmailValidationRecord.java
===================================================================
--- spaces/trunk/src/com/ogoglio/persist/PendingEmailValidationRecord.java (rev 0)
+++ spaces/trunk/src/com/ogoglio/persist/PendingEmailValidationRecord.java 2007-08-20 23:09:52 UTC (rev 248)
@@ -0,0 +1,73 @@
+package com.ogoglio.persist;
+
+import java.util.Random;
+
+import com.ogoglio.util.ArgumentUtils;
+
+public class PendingEmailValidationRecord {
+
+ private static Random RANDOM = new Random();
+
+ private String username = null;
+
+ private String email = null;
+
+ private String secret = null;
+
+ private long creationDate = AccountRecord.NO_TIME_VALUE;
+
+ public PendingEmailValidationRecord() {
+ }
+
+ public PendingEmailValidationRecord(String username, String email) {
+ ArgumentUtils.assertNotEmpty(username);
+ ArgumentUtils.assertIsEmail(email);
+ this.username = username;
+ this.email = email;
+ this.secret = generateSecret();
+ creationDate = System.currentTimeMillis();
+ }
+
+ private static final String SECRET_SOURCE = "abcdefghijklmnopqrstuvwxyz1234567890";
+
+ private String generateSecret() {
+ StringBuffer result = new StringBuffer();
+ for (int i = 0; i < 25; i++) {
+ result.append(SECRET_SOURCE.charAt(Math.abs(RANDOM.nextInt()) % SECRET_SOURCE.length()));
+ }
+ return result.toString();
+ }
+
+ public long getCreationDate() {
+ return creationDate;
+ }
+
+ public void setCreationDate(long creationDate) {
+ this.creationDate = creationDate;
+ }
+
+ public String getEmail() {
+ return email;
+ }
+
+ public void setEmail(String email) {
+ ArgumentUtils.assertIsEmail(email);
+ this.email = email;
+ }
+
+ public String getSecret() {
+ return secret;
+ }
+
+ public void setSecret(String secret) {
+ this.secret = secret;
+ }
+
+ public String getUsername() {
+ return username;
+ }
+
+ public void setUsername(String username) {
+ this.username = username;
+ }
+}
Modified: spaces/trunk/src/com/ogoglio/persist/Persist.hbm.xml
===================================================================
--- spaces/trunk/src/com/ogoglio/persist/Persist.hbm.xml 2007-08-20 03:43:05 UTC (rev 247)
+++ spaces/trunk/src/com/ogoglio/persist/Persist.hbm.xml 2007-08-20 23:09:52 UTC (rev 248)
@@ -89,6 +89,13 @@
<property name="defaultBodyID" />
</class>
+ <class name="com.ogoglio.persist.PendingEmailValidationRecord" table="PendingEmailValidationRecords">
+ <id name="email"><generator class="assigned"/></id>
+ <property name="username" not-null="true" />
+ <property name="secret" not-null="true" />
+ <property name="creationDate" />
+ </class>
+
<class name="com.ogoglio.persist.TemplateRecord" table="TemplateRecords">
<id name="templateID">
<generator class="increment"/>
Modified: spaces/trunk/src/com/ogoglio/persist/PersistTests.java
===================================================================
--- spaces/trunk/src/com/ogoglio/persist/PersistTests.java 2007-08-20 03:43:05 UTC (rev 247)
+++ spaces/trunk/src/com/ogoglio/persist/PersistTests.java 2007-08-20 23:09:52 UTC (rev 248)
@@ -15,11 +15,6 @@
import java.net.URI;
-import junit.framework.TestCase;
-
-import org.hibernate.SessionFactory;
-import org.hibernate.cfg.Configuration;
-
public class PersistTests extends HibernateTests {
private String displayName1 = "Breakfast of Sim";
@@ -31,23 +26,23 @@
String username1 = null;
String email1 = null;
-
+
String level1 = null;
String username2 = null;
String email2 = null;
-
+
String level2 = null;
public void setUp() {
try {
- super.setUp();
-
+ super.setUp();
+
username1 = AccountRecord.cleanUsername("MoonUnitZappa");
email1 = AccountRecord.cleanEmail("mu...@ex...");
level1 = "basic";
-
+
username2 = AccountRecord.cleanUsername("KurtVonnegut");
email2 = AccountRecord.cleanEmail("kv...@ex...");
level2 = "pro";
@@ -59,42 +54,40 @@
}
}
-
public void testRecords() {
try {
- String ONE_TWO="1234";
-
- AccountRecord accRec1= AccountPersistTasks.findAccountByUsername(username1, sessionFactory);
- if (accRec1!=null) {
- System.out.println("Destroying leftover account test state:"+username1);
- AccountPersistTasks.delete(accRec1,sessionFactory);
+ String ONE_TWO = "1234";
+
+ AccountRecord accRec1 = AccountPersistTasks.findAccountByUsername(username1, sessionFactory);
+ if (accRec1 == null) {
+ accRec1 = AccountPersistTasks.createAccount(username1, level1, email1, sessionFactory);
}
- accRec1 = AccountPersistTasks.createAccount(username1, level1, email1, sessionFactory);
- verifyAccountProps(accRec1,username1, email1, level1, null);
-
+ assertNotNull(accRec1);
+
+ verifyAccountProps(accRec1, username1, email1, level1, null);
+
accRec1.setPassword("1234");
AccountPersistTasks.update(accRec1, sessionFactory);
AccountRecord accRec2 = AccountPersistTasks.findAccountByUsername(username1, sessionFactory);
assertNotNull(accRec2);
verifyAccountProps(accRec2, username1, email1, level1, ONE_TWO);
-
+
String templateName1 = "Plate of Raw Oysters";
- TemplateRecord templateRec1 = TemplatePersistTasks.createTemplate(templateName1 , username1, sessionFactory);
+ TemplateRecord templateRec1 = TemplatePersistTasks.createTemplate(templateName1, username1, sessionFactory);
verifyTemplateProps(templateName1, templateRec1);
-
+
templateRec1 = TemplatePersistTasks.findTemplateByTemplateID(templateRec1.getTemplateID(), sessionFactory);
verifyTemplateProps(templateName1, templateRec1);
- SimRecord simRecord1=SimPersistTasks.findSimsBySimURI(simURI1, sessionFactory);
- if (simRecord1!=null) {
- System.out.println("Destroying leftover sim record test state:"+
- simRecord1.getDisplayName());
- SimPersistTasks.delete(simRecord1,sessionFactory);
+ SimRecord simRecord1 = SimPersistTasks.findSimsBySimURI(simURI1, sessionFactory);
+ if (simRecord1 != null) {
+ System.out.println("Destroying leftover sim record test state:" + simRecord1.getDisplayName());
+ SimPersistTasks.delete(simRecord1, sessionFactory);
}
- //ok to create sim now on that URI
+ //ok to create sim now on that URI
simRecord1 = SimPersistTasks.createSim(displayName1, simURI1, 2048, true, sessionFactory);
- verifySimProps(simRecord1,displayName1,simURI1,-1,2048);
+ verifySimProps(simRecord1, displayName1, simURI1, -1, 2048);
String displayName2 = "moon unit";
simRecord1.setDisplayName(displayName2);
@@ -118,30 +111,29 @@
SpaceRecord spaceRecord2 = SpacePersistTasks.findSpaceBySpaceID(spaceRecord1.getSpaceID(), sessionFactory);
assertEquals(spaceRecord1, spaceRecord2);
-
+
SimRecord assignedSimRecord = SpacePersistTasks.findOrAssignSim(spaceRecord2, sessionFactory);
assertNotNull(assignedSimRecord);
- System.out.println("XXX ASSIGNED TO SIM:"+assignedSimRecord.getSimID()+","+assignedSimRecord.getSimURI()+" -->\n"+
- "space was "+spaceRecord2.getSpaceID()+" now on "+spaceRecord2.getSimID()+","+spaceRecord2.getDisplayName());
+ System.out.println("XXX ASSIGNED TO SIM:" + assignedSimRecord.getSimID() + "," + assignedSimRecord.getSimURI() + " -->\n" + "space was " + spaceRecord2.getSpaceID() + " now on " + spaceRecord2.getSimID() + "," + spaceRecord2.getDisplayName());
/*
* IES: I spent a lot of time looking at this and could not see any way to test this given that
* IES: that assigned sim is random. Apparently, before we were depending on a random number
* IES: sequence doing something we expected.
- assertEquals(simRecord1.getSimURI(), assignedSimRecord.getSimURI());
- assertEquals(simRecord1.getDisplayName(), assignedSimRecord.getDisplayName());
- assertEquals(simRecord1.getSimID(), assignedSimRecord.getSimID());
- assertEquals(simRecord1, assignedSimRecord);
+ assertEquals(simRecord1.getSimURI(), assignedSimRecord.getSimURI());
+ assertEquals(simRecord1.getDisplayName(), assignedSimRecord.getDisplayName());
+ assertEquals(simRecord1.getSimID(), assignedSimRecord.getSimID());
+ assertEquals(simRecord1, assignedSimRecord);
*/
-
+
BodyRecord bodyRec1 = BodyPersistTasks.createBody(displayName1, "bogosity", sessionFactory);
assertNull("created body with bogus username", bodyRec1);
bodyRec1 = BodyPersistTasks.createBody(displayName1, username1, sessionFactory);
assertNotNull(bodyRec1);
-
+
BodyRecord bodyRec2 = BodyPersistTasks.findBodyByID(bodyRec1.getBodyID(), sessionFactory);
assertNotNull(bodyRec2);
assertEquals(bodyRec1, bodyRec2);
-
+
PossessionRecord possRecord = PossessionPersistTasks.createPossession(username1, templateRec1.getTemplateID(), sessionFactory);
assertNotNull(possRecord);
assertEquals(username1, possRecord.getOwnerUsername());
@@ -154,7 +146,7 @@
assertEquals(12, possRecord.getThingID());
PossessionRecord[] possRecs1 = PossessionPersistTasks.findPossessionsByOwnerUsername(username1, sessionFactory);
- assertNotNull(possRecs1);
+ assertNotNull(possRecs1);
assertEquals(username1, possRecs1[0].getOwnerUsername());
} catch (PersistException e) {
@@ -170,32 +162,29 @@
}
}
-
private void verifySimProps(SimRecord rec, String name, URI uri, int not_id, int port) {
assertNotNull(rec);
assertEquals(name, rec.getDisplayName());
assertEquals(uri, rec.getSimURI());
assertFalse(not_id == rec.getSimID());
- assertEquals(port, rec.getEventPort());
+ assertEquals(port, rec.getEventPort());
}
-
private void verifyTemplateProps(String templateName1, TemplateRecord templateRec1) {
assertNotNull(templateRec1);
assertEquals(templateName1, templateRec1.getDisplayName());
assertEquals(username1, templateRec1.getOwnerUsername());
}
-
private void verifyAccountProps(AccountRecord rec, String user, String mail, String level, String pwd) {
assertNotNull(rec);
assertEquals(user, rec.getUsername());
assertEquals(mail, rec.getEmail());
assertEquals(level, rec.getAccountlevel());
- if (pwd==null) {
+ if (pwd == null) {
assertNull(rec.getPassword());
} else {
- assertEquals(pwd,rec.getPassword());
+ assertEquals(pwd, rec.getPassword());
}
}
}
\ No newline at end of file
Modified: spaces/trunk/src/com/ogoglio/site/AccountServlet.java
===================================================================
--- spaces/trunk/src/com/ogoglio/site/AccountServlet.java 2007-08-20 03:43:05 UTC (rev 247)
+++ spaces/trunk/src/com/ogoglio/site/AccountServlet.java 2007-08-20 23:09:52 UTC (rev 248)
@@ -17,7 +17,6 @@
import java.io.InputStream;
import java.net.URI;
import java.net.URISyntaxException;
-import java.util.Date;
import javax.media.j3d.Transform3D;
import javax.servlet.ServletConfig;
@@ -27,7 +26,6 @@
import nanoxml.XMLElement;
-import com.ogoglio.client.WebAPIClient;
import com.ogoglio.client.WebAPIClientWire;
import com.ogoglio.client.WebAPIUtil;
import com.ogoglio.media.MediaService;
@@ -130,6 +128,14 @@
newAccountRec.setLastName(newAccountDoc.getLastName());
newAccountRec.setHomepage(newAccountDoc.getHomepage());
AccountPersistTasks.update(newAccountRec, sessionFactory);
+
+ /*
+ * Email templates: velocity?
+ * Site (or app?) specific validation email template
+ *
+ */
+ System.out.println("TODO: This is where we would send the validation email");
+
sendStringResponse(createAccountDocument(newAccountRec, true).toElement().toString(), "text/xml", response);
}
}
@@ -196,12 +202,12 @@
response.setStatus(HttpServletResponse.SC_FORBIDDEN);
return;
}
- if (requestedAccount.getFrozenUntil() != AccountRecord.NO_TIME_VALUE && requestedAccount.getFrozenUntil()!=updatedDocument.getFrozenUntil().getTime()) {
+ if (requestedAccount.getFrozenUntil() != AccountRecord.NO_TIME_VALUE && requestedAccount.getFrozenUntil() != updatedDocument.getFrozenUntil().getTime()) {
System.err.println("User tried to update own freeze: " + requestedAccount.getUsername());
response.setStatus(HttpServletResponse.SC_FORBIDDEN);
return;
}
- if (requestedAccount.getFrozenUntil() !=AccountRecord.NO_TIME_VALUE && updatedDocument.getFrozenUntil() != null) {
+ if (requestedAccount.getFrozenUntil() != AccountRecord.NO_TIME_VALUE && updatedDocument.getFrozenUntil() != null) {
System.err.println("User tried to freeze themselves: " + requestedAccount.getUsername());
response.setStatus(HttpServletResponse.SC_FORBIDDEN);
return;
@@ -211,9 +217,9 @@
//TODO if this returns false we really should reflect that in the response
if (!AccountPersistTasks.update(requestedAccount, updatedDocument, getSessionFactory())) {
- System.out.println("Warning: ACCOUNT update failed:"+requestedAccount.getUsername());
+ System.out.println("Warning: ACCOUNT update failed:" + requestedAccount.getUsername());
}
- //AccountPersistTasks.findAccountByUsername(usernameParam, getSessionFactory());
+
AccountDocument result = createAccountDocument(requestedAccount, true);
response.setStatus(HttpServletResponse.SC_OK);
response.setContentType("text/xml");
@@ -262,7 +268,7 @@
public class TemplatesResource extends AuthenticatedSiteResource {
public TemplatesResource() {
super("template", true, getSessionFactory());
- addSubResource(new TemplateResource(getSessionFactory(),getMediaService()));
+ addSubResource(new TemplateResource(getSessionFactory(), getMediaService()));
}
public void doPost(HttpServletRequest request, HttpServletResponse response, String[] pathElements, AccountRecord authedAccount) throws PersistException, ServletException, IOException {
@@ -279,14 +285,13 @@
response.setStatus(HttpServletResponse.SC_BAD_REQUEST);
return;
}
-
+
TemplateDocument result = new TemplateDocument(rec);
sendStringResponse(result.toString(), "text/xml", response);
}
- public void doGet(HttpServletRequest request, HttpServletResponse response, String[] pathElements,
- AccountRecord authedAccount) throws PersistException, ServletException, IOException {
+ public void doGet(HttpServletRequest request, HttpServletResponse response, String[] pathElements, AccountRecord authedAccount) throws PersistException, ServletException, IOException {
String usernameParam = pathElements[pathElements.length - 2];
AccountRecord requestedAccount = AccountPersistTasks.findAccountByUsername(usernameParam, getSessionFactory());
if (requestedAccount == null) {
Modified: spaces/trunk/src/com/ogoglio/util/ArgumentUtils.java
===================================================================
--- spaces/trunk/src/com/ogoglio/util/ArgumentUtils.java 2007-08-20 03:43:05 UTC (rev 247)
+++ spaces/trunk/src/com/ogoglio/util/ArgumentUtils.java 2007-08-20 23:09:52 UTC (rev 248)
@@ -100,5 +100,17 @@
}
}
+ public static void assertIsEmail(String email) {
+ if(email == null || email.trim().length() == 0) {
+ throw new IllegalArgumentException("Bad email: " + email);
+ }
+ if(email.indexOf("@") == -1 || email.indexOf("@") == 0) {
+ throw new IllegalArgumentException("Bad email: " + email);
+ }
+ if(email.indexOf(".", email.indexOf("@")) == -1 && email.indexOf("localhost") != email.indexOf("@") + 1) {
+ throw new IllegalArgumentException("Bad email: " + email);
+ }
+ }
+
}
Modified: spaces/trunk/src/com/ogoglio/util/StreamUtils.java
===================================================================
--- spaces/trunk/src/com/ogoglio/util/StreamUtils.java 2007-08-20 03:43:05 UTC (rev 247)
+++ spaces/trunk/src/com/ogoglio/util/StreamUtils.java 2007-08-20 23:09:52 UTC (rev 248)
@@ -58,6 +58,14 @@
output.close();
}
+ public static String readResource(String resourceName) throws IOException {
+ InputStream resourceStream = StreamUtils.class.getClassLoader().getResourceAsStream(resourceName);
+ if (resourceStream == null) {
+ return null;
+ }
+ return readInput(resourceStream);
+ }
+
public static void copyResource(String resourceName, File destinationDir) throws IOException {
InputStream resourceStream = StreamUtils.class.getClassLoader().getResourceAsStream(resourceName);
if (resourceStream == null) {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <tre...@us...> - 2007-08-20 03:43:07
|
Revision: 247
http://ogoglio.svn.sourceforge.net/ogoglio/?rev=247&view=rev
Author: trevorolio
Date: 2007-08-19 20:43:05 -0700 (Sun, 19 Aug 2007)
Log Message:
-----------
Removed gassy debug println.
Modified Paths:
--------------
spaces/trunk/src/com/ogoglio/viewer/applet/MotionInputHandler.java
Modified: spaces/trunk/src/com/ogoglio/viewer/applet/MotionInputHandler.java
===================================================================
--- spaces/trunk/src/com/ogoglio/viewer/applet/MotionInputHandler.java 2007-08-20 03:40:13 UTC (rev 246)
+++ spaces/trunk/src/com/ogoglio/viewer/applet/MotionInputHandler.java 2007-08-20 03:43:05 UTC (rev 247)
@@ -364,8 +364,6 @@
}
public void mousePressed(MouseEvent event) {
- System.out.println("POPUP TRIGGER FART:"+event.isPopupTrigger()+","+new JPopupMenu().isPopupTrigger(event)+","+
- event.isControlDown()+","+event.paramString()+","+event.getButton());
ClickTarget clickTarget = renderer.getClickTarget(event.getX(), event.getY());
if (clickTarget == null) {
return;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <tre...@us...> - 2007-08-20 03:40:11
|
Revision: 246
http://ogoglio.svn.sourceforge.net/ogoglio/?rev=246&view=rev
Author: trevorolio
Date: 2007-08-19 20:40:13 -0700 (Sun, 19 Aug 2007)
Log Message:
-----------
Tweaked context menu XML names to reflect following convention:
Event names are init capitalized.
Event parameters are init lower case, then camel caps.
Identifier is "ID", not "Id"
Modified Paths:
--------------
spaces/trunk/src/com/ogoglio/xml/SpaceEvent.java
Modified: spaces/trunk/src/com/ogoglio/xml/SpaceEvent.java
===================================================================
--- spaces/trunk/src/com/ogoglio/xml/SpaceEvent.java 2007-08-19 20:01:35 UTC (rev 245)
+++ spaces/trunk/src/com/ogoglio/xml/SpaceEvent.java 2007-08-20 03:40:13 UTC (rev 246)
@@ -203,9 +203,9 @@
public static final String NONCE = "nonce";
- public static final String CONTEXT_MENU_DATA_EVENT = "menuContent";
+ public static final String CONTEXT_MENU_DATA_EVENT = "MenuContent";
- public static final String CONTEXT_MENU_DATA_GENERATION_ERROR = "contextMenuScriptIsHosed";
+ public static final String CONTEXT_MENU_DATA_GENERATION_ERROR = "contextMenuScriptError";
public static final String CONTEXT_MENU_DATA_ITEM = "contextMenuItem";
@@ -213,7 +213,7 @@
public static final String CONTEXT_MENU_DATA_ITEM_ENABLED = "contextMenuItemEnabled";
- public static final String CONTEXT_MENU_DATA_ITEM_ID = "contextMenuItemId";
+ public static final String CONTEXT_MENU_DATA_ITEM_ID = "contextMenuItemID";
public static final String THING_CONTEXT_SELECTION_MADE_EVENT = "contextMenuItemChosen";
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ian...@us...> - 2007-08-19 20:41:06
|
Revision: 245
http://ogoglio.svn.sourceforge.net/ogoglio/?rev=245&view=rev
Author: iansmith
Date: 2007-08-19 13:01:35 -0700 (Sun, 19 Aug 2007)
Log Message:
-----------
Basic support for context menus has been added. Summary of how to
create and use context menus can be seen in TestCube.js.
No support yet for nested menus or different types of menu items.
Minor hack: return value from the handler for completing a context click is checked to see if it is a URL. If it is, that URL is sent to the client. This may be a bad idea.
Modified Paths:
--------------
spaces/trunk/src/com/ogoglio/OgoglioTestSuite.java
spaces/trunk/src/com/ogoglio/client/ClientTests.java
spaces/trunk/src/com/ogoglio/client/MultiuserTests.java
spaces/trunk/src/com/ogoglio/client/SpaceClient.java
spaces/trunk/src/com/ogoglio/client/UserInputListener.java
spaces/trunk/src/com/ogoglio/persist/resources/TestCube.js
spaces/trunk/src/com/ogoglio/sim/SpaceSimulator.java
spaces/trunk/src/com/ogoglio/sim/script/SpaceScriptEngine.java
spaces/trunk/src/com/ogoglio/viewer/applet/AppletTestWindow.java
spaces/trunk/src/com/ogoglio/viewer/applet/MotionInputHandler.java
spaces/trunk/src/com/ogoglio/viewer/applet/ViewerApplet.java
spaces/trunk/src/com/ogoglio/xml/SpaceEvent.java
Added Paths:
-----------
spaces/trunk/src/com/ogoglio/sim/script/ScriptContextMenuInfo.java
spaces/trunk/src/com/ogoglio/util/ContextMenuInfo.java
Modified: spaces/trunk/src/com/ogoglio/OgoglioTestSuite.java
===================================================================
--- spaces/trunk/src/com/ogoglio/OgoglioTestSuite.java 2007-08-16 19:33:40 UTC (rev 244)
+++ spaces/trunk/src/com/ogoglio/OgoglioTestSuite.java 2007-08-19 20:01:35 UTC (rev 245)
@@ -36,4 +36,6 @@
suite.addTest(TemplateSyncTestSuite.suite());
return suite;
}
+
+
}
Modified: spaces/trunk/src/com/ogoglio/client/ClientTests.java
===================================================================
--- spaces/trunk/src/com/ogoglio/client/ClientTests.java 2007-08-16 19:33:40 UTC (rev 244)
+++ spaces/trunk/src/com/ogoglio/client/ClientTests.java 2007-08-19 20:01:35 UTC (rev 245)
@@ -705,6 +705,15 @@
public void receivedBrowserMessage(long sourceThingID, String message) {
}
+ public void receivedContextMenuRequest(Thing thing,String shapeName, int x, int y, long nonce) {
+ }
+
+ public void receivedContextMenuData(long nonce, String errorIfAny, Vector contextMenu) {
+ }
+
+ public void contextItemChosen(Thing thing, long nonce, String id) {
+ }
+
}
private class TestListener implements Space.Listener {
Modified: spaces/trunk/src/com/ogoglio/client/MultiuserTests.java
===================================================================
--- spaces/trunk/src/com/ogoglio/client/MultiuserTests.java 2007-08-16 19:33:40 UTC (rev 244)
+++ spaces/trunk/src/com/ogoglio/client/MultiuserTests.java 2007-08-19 20:01:35 UTC (rev 245)
@@ -9,6 +9,7 @@
import javax.vecmath.Vector3d;
import com.ogoglio.client.model.SplinePath;
+import com.ogoglio.client.model.Thing;
import com.ogoglio.client.model.User;
import com.ogoglio.viewer.applet.MotionInputHandler;
import com.ogoglio.viewer.j3d.J3DRenderer;
@@ -103,6 +104,15 @@
public void receivedBrowserMessage(long sourceThingID, String message) {
}
+ public void receivedContextMenuRequest(Thing thing,String shapeName, int x, int y,long nonce) {
+ }
+
+ public void receivedContextMenuData(long nonce, String errorIfAny, Vector contextMenu) {
+ }
+
+ public void contextItemChosen(Thing thing, long nonce, String id) {
+ }
+
}
private class WanderThread extends Thread {
Modified: spaces/trunk/src/com/ogoglio/client/SpaceClient.java
===================================================================
--- spaces/trunk/src/com/ogoglio/client/SpaceClient.java 2007-08-16 19:33:40 UTC (rev 244)
+++ spaces/trunk/src/com/ogoglio/client/SpaceClient.java 2007-08-19 20:01:35 UTC (rev 245)
@@ -188,12 +188,11 @@
}
public void mouseClickedThing(Thing thing, String shapeName, Point3d intersection) {
- SpaceEvent event = new SpaceEvent(SpaceEvent.THING_CLICKED_EVENT);
- event.setProperty(SpaceEvent.USERNAME, accountDoc.getUsername());
- event.setProperty(SpaceEvent.THING_ID, new Long(thing.getThingID()));
- if (shapeName != null) {
- event.setProperty(SpaceEvent.SHAPE_NAME, shapeName);
- }
+ SpaceEvent event = createSpaceEventForThing(thing, shapeName,SpaceEvent.THING_CLICKED_EVENT);
+ attemptToSendSpaceEventToServer(event);
+ }
+
+ private void attemptToSendSpaceEventToServer(SpaceEvent event) {
try {
Message message = new Message(messageChannel.getLocalLocator(), messageChannel.getRemoteLocator(), space.getSpaceID(), new PayloadFactory.SpaceEventPayload(event));
messageChannel.sendMessage(message);
@@ -202,6 +201,35 @@
}
}
+ private SpaceEvent createSpaceEventForThing(Thing thing, String shapeName, String /*yuck*/eventType) {
+ SpaceEvent event = new SpaceEvent(eventType);
+ event.setProperty(SpaceEvent.USERNAME, accountDoc.getUsername());
+ event.setProperty(SpaceEvent.THING_ID, new Long(thing.getThingID()));
+ if (shapeName != null) {
+ event.setProperty(SpaceEvent.SHAPE_NAME, shapeName);
+ }
+ return event;
+ }
+
+ public void mouseContextClickedThing(Thing thing, String shapeName, int x, int y) {
+ // we should be asking the thing for the info about it's menu
+ long now=System.currentTimeMillis();
+ listener.receivedContextMenuRequest(thing,shapeName,x,y,now);
+ SpaceEvent event = createSpaceEventForThing(thing, shapeName,SpaceEvent.THING_CONTEXT_CLICKED_EVENT);
+ event.setProperty(SpaceEvent.NONCE,new Long(now));
+ attemptToSendSpaceEventToServer(event);
+ }
+
+ public void mouseContextItemChosen(Thing thing, long nonce, String id) {
+ listener.contextItemChosen(thing,nonce,id);
+ SpaceEvent event = createSpaceEventForThing(thing, null, SpaceEvent.THING_CONTEXT_SELECTION_MADE_EVENT);
+ event.setProperty(SpaceEvent.NONCE,new Long(nonce));
+ event.setProperty(SpaceEvent.CONTEXT_MENU_DATA_ITEM_ID, id);
+ attemptToSendSpaceEventToServer(event);
+ }
+
+
+
public void mouseClickedPage(Page page, Point3d intersection) {
System.out.println("User clicked the page. Ignoring");
}
@@ -262,7 +290,6 @@
if (SpaceEvent.ADD_USER_EVENT.equals(event.getName())) {
User user = new User(space, event.getStringProperty(SpaceEvent.USERNAME), event.getTransform(), event.getLongProperty(SpaceEvent.BODY_ID).longValue());
space.addUser(user);
-
} else if (SpaceEvent.REMOVE_USER_EVENT.equals(event.getName())) {
User user = space.getUser(event.getStringProperty(SpaceEvent.USERNAME));
if (user == null) {
@@ -513,7 +540,10 @@
}
thing.stopMotion(position);
thing.setName(displayName);
-
+ } else if (SpaceEvent.CONTEXT_MENU_DATA_EVENT.equals(event.getName())) {
+ listener.receivedContextMenuData(event.getLongProperty(SpaceEvent.NONCE).longValue(),
+ event.getStringProperty(SpaceEvent.CONTEXT_MENU_DATA_GENERATION_ERROR),
+ event.getContextMenu());
} else if (SpaceEvent.MESSAGE_BROWSER_EVENT.equals(event.getName())) {
long thingID = event.getLongProperty(SpaceEvent.THING_ID).longValue();
@@ -620,6 +650,12 @@
public interface Listener {
public void receivedChatMessage(String username, String message);
+ public void contextItemChosen(Thing thing, long nonce, String id);
+
+ public void receivedContextMenuData(long nonce, String errorIfAny, Vector contextMenu);
+
+ public void receivedContextMenuRequest(Thing thing, String shapeName, int x, int y,long nonce);
+
public void receivedLink(String displayName, String link);
public void receivedBrowserMessage(long sourceThingID, String message);
Modified: spaces/trunk/src/com/ogoglio/client/UserInputListener.java
===================================================================
--- spaces/trunk/src/com/ogoglio/client/UserInputListener.java 2007-08-16 19:33:40 UTC (rev 244)
+++ spaces/trunk/src/com/ogoglio/client/UserInputListener.java 2007-08-19 20:01:35 UTC (rev 245)
@@ -23,4 +23,6 @@
public void mouseClickedPage(Page page, Point3d intersection);
public void focusCommandField();
+
+ public void mouseContextClickedThing(Thing thing, String name, int x, int y);
}
Modified: spaces/trunk/src/com/ogoglio/persist/resources/TestCube.js
===================================================================
--- spaces/trunk/src/com/ogoglio/persist/resources/TestCube.js 2007-08-16 19:33:40 UTC (rev 244)
+++ spaces/trunk/src/com/ogoglio/persist/resources/TestCube.js 2007-08-19 20:01:35 UTC (rev 245)
@@ -16,3 +16,27 @@
space.startThingMotion(thingID, path);
}
+
+function onContextClick(person, shapeName){
+ space.log(person + " context clicked " + thingID + " on its " + shapeName);
+
+ i1 = new ContextMenuInfo("Google",true,"google");
+ i2 = new ContextMenuInfo("Yahoo",true,"yahoo");
+ i3 = new ContextMenuInfo("Altavista",false,"NOTUSED");
+ i4 = new ContextMenuInfo("Transmutable",true,"transmutable");
+
+ return new Array(i1,i2,i3,i4);
+}
+
+function onContextMenuItemChosen(username,id)
+{
+ var key = "favoriteSite";
+ var preferred = space.getSetting(key);
+
+ space.putSetting(key,id);
+
+ //causes browser to jump to that page!
+ return "http://www."+id+".com/";
+}
+
+
Modified: spaces/trunk/src/com/ogoglio/sim/SpaceSimulator.java
===================================================================
--- spaces/trunk/src/com/ogoglio/sim/SpaceSimulator.java 2007-08-16 19:33:40 UTC (rev 244)
+++ spaces/trunk/src/com/ogoglio/sim/SpaceSimulator.java 2007-08-19 20:01:35 UTC (rev 245)
@@ -392,7 +392,10 @@
listener.generatedSpaceEvent(markedUpEvent, SpaceSimulator.this);
- } else if (SpaceEvent.THING_CLICKED_EVENT.equals(event.getName())) {
+ } else if (((SpaceEvent.THING_CLICKED_EVENT.equals(event.getName()))) ||
+ ((SpaceEvent.THING_CONTEXT_CLICKED_EVENT.equals(event.getName()))) ||
+ ((SpaceEvent.THING_CONTEXT_SELECTION_MADE_EVENT.equals(event.getName())))
+ ){
String username = event.getStringProperty(SpaceEvent.USERNAME);
User user = space.getUser(username);
if (user == null) {
@@ -400,7 +403,6 @@
continue;
}
scriptEngine.handleSpaceEvent(event);
-
} else if (SpaceEvent.UPDATE_THING_EVENT.equals(event.getName())) {
listener.generatedSpaceEvent(event, SpaceSimulator.this);
scriptEngine.handleSpaceEvent(event);
@@ -410,7 +412,6 @@
} else if (SpaceEvent.MESSAGE_BROWSER_EVENT.equals(event.getName())) {
listener.generatedSpaceEvent(event, SpaceSimulator.this);
-
} else {
System.err.println("Received a space event " + event.getName() + ", and dropping it on the floor.");
}
@@ -1042,6 +1043,9 @@
public void focusCommandField() {
}
+
+ public void mouseContextClickedThing(Thing thing, String name, int x, int y) {
+ }
}
}
Added: spaces/trunk/src/com/ogoglio/sim/script/ScriptContextMenuInfo.java
===================================================================
--- spaces/trunk/src/com/ogoglio/sim/script/ScriptContextMenuInfo.java (rev 0)
+++ spaces/trunk/src/com/ogoglio/sim/script/ScriptContextMenuInfo.java 2007-08-19 20:01:35 UTC (rev 245)
@@ -0,0 +1,41 @@
+package com.ogoglio.sim.script;
+
+import org.mozilla.javascript.ScriptableObject;
+
+import com.ogoglio.util.ContextMenuInfo;
+
+public class ScriptContextMenuInfo extends ScriptableObject {
+
+ public static final String JS_CLASS_NAME="ContextMenuInfo";
+
+ //required by superclass
+ public String getClassName() {
+ return JS_CLASS_NAME;
+ }
+
+ //this object has to be here (aggregation) b/c it is used on the client side of the wire and we don't
+ //want the client linked against JS machinery
+ private ContextMenuInfo info;
+
+
+ public void jsConstructor(String textToShow, boolean notGrayedOut, String forCallback) {
+
+ info=new ContextMenuInfo();
+ info.setValues(textToShow, notGrayedOut, forCallback);
+ }
+
+
+ public String getUserVisibleString() {
+ return info.getUserVisibleString();
+ }
+
+
+ public boolean getEnabled() {
+ return info.getEnabled();
+ }
+
+
+ public String getId() {
+ return info.getId();
+ }
+}
Modified: spaces/trunk/src/com/ogoglio/sim/script/SpaceScriptEngine.java
===================================================================
--- spaces/trunk/src/com/ogoglio/sim/script/SpaceScriptEngine.java 2007-08-16 19:33:40 UTC (rev 244)
+++ spaces/trunk/src/com/ogoglio/sim/script/SpaceScriptEngine.java 2007-08-19 20:01:35 UTC (rev 245)
@@ -15,6 +15,10 @@
import java.io.IOException;
import java.lang.reflect.InvocationTargetException;
+import java.net.MalformedURLException;
+import java.net.URI;
+import java.net.URL;
+import java.util.Vector;
import javax.media.j3d.Transform3D;
@@ -33,6 +37,7 @@
import com.ogoglio.client.model.User;
import com.ogoglio.sim.SpaceSimulator;
import com.ogoglio.util.ArgumentUtils;
+import com.ogoglio.util.ContextMenuInfo;
import com.ogoglio.util.TwoWayMap;
import com.ogoglio.xml.SpaceEvent;
@@ -52,6 +57,9 @@
public static final String ONCLICK_SCRIPT_PREFIX = "if(typeof onClick == \"function\") { onClick(";
+ public static final String ONCONTEXTCLICK_SCRIPT_PREFIX = "if(typeof onContextClick == \"function\") { onContextClick(";
+
+ public static final String CONTEXT_ITEM_SELECTED = "if(typeof onContextMenuItemChosen == \"function\") { onContextMenuItemChosen(";
public static final String ONCLICK_SCRIPT_SUFFIX = "); }";
public SpaceScriptEngine(SpaceSimulator spaceSimulator) {
@@ -69,7 +77,8 @@
ScriptableObject.defineClass(globalScope, ScriptSpace.class);
ScriptableObject.defineClass(globalScope, ScriptMath.class);
ScriptableObject.defineClass(globalScope, ScriptHTTPRequest.class);
-
+ ScriptableObject.defineClass(globalScope, ScriptContextMenuInfo.class);
+
scriptSpace = (ScriptSpace) constructorContext.newObject(globalScope, "Space", new Object[0]);
scriptSpace.setSpaceSimulator(spaceSimulator);
globalScope.put("space", globalScope, scriptSpace);
@@ -120,7 +129,7 @@
}
public void handleSpaceEvent(SpaceEvent event) {
- if (SpaceEvent.THING_CLICKED_EVENT.equals(event.getName())) {
+ if ((SpaceEvent.THING_CLICKED_EVENT.equals(event.getName())) || (SpaceEvent.THING_CONTEXT_CLICKED_EVENT.equals(event.getName()))) {
Long thingID = event.getLongProperty(SpaceEvent.THING_ID);
if (thingID == null) {
return;
@@ -132,20 +141,60 @@
String shapeName = event.getStringProperty(SpaceEvent.SHAPE_NAME);
String script = null;
+ String prefix = ONCLICK_SCRIPT_PREFIX;
+
+ if (SpaceEvent.THING_CONTEXT_CLICKED_EVENT.equals(event.getName())) {
+ prefix = ONCONTEXTCLICK_SCRIPT_PREFIX;
+ }
+ String username = event.getStringProperty(SpaceEvent.USERNAME);
if (shapeName != null) {
- script = ONCLICK_SCRIPT_PREFIX + "\"" + event.getStringProperty(SpaceEvent.USERNAME) + "\", \"" + event.getStringProperty(SpaceEvent.SHAPE_NAME) + "\"" + ONCLICK_SCRIPT_SUFFIX;
+ script = prefix + "\"" + username + "\", \"" + event.getStringProperty(SpaceEvent.SHAPE_NAME) + "\"" + ONCLICK_SCRIPT_SUFFIX;
} else {
- script = ONCLICK_SCRIPT_PREFIX + "\"" + event.getStringProperty(SpaceEvent.USERNAME) + "\", null" + ONCLICK_SCRIPT_SUFFIX;
+ script = prefix + "\"" + username + "\", null" + ONCLICK_SCRIPT_SUFFIX;
}
Context context = Context.enter();
try {
- spaceSimulator.log("Click script: " + evaluateScript(context, thingScope, script));
+ String isContextClick = "no";
+ if (SpaceEvent.THING_CONTEXT_CLICKED_EVENT.equals(event.getName())) {
+ isContextClick = "yes";
+ }
+
+ //the context click is called for value, the regular click for effect
+ if (SpaceEvent.THING_CONTEXT_CLICKED_EVENT.equals(event.getName())) {
+ String errorToClient = processScriptForContextMenuInfo(thingScope,username, event.getLongProperty(SpaceEvent.NONCE).longValue(),
+ script, context);
+
+ if (errorToClient!=null) {
+ spaceSimulator.log("Error in contextmenuclick handler:"+errorToClient);
+ }
+ } else {
+ spaceSimulator.log("Click script : " + evaluateScript(context, thingScope, script));
+ }
} finally {
- context.exit();
+ Context.exit();
}
-
+ } else if (SpaceEvent.THING_CONTEXT_SELECTION_MADE_EVENT.equals(event.getName())) {
+ Long thingID = event.getLongProperty(SpaceEvent.THING_ID);
+ if (thingID == null) {
+ return;
+ }
+ ScriptableObject thingScope = (ScriptableObject) thingScopes.getForward(thingID);
+ if (thingScope == null) {
+ return;
+ }
+ Context context = Context.enter();
+ String username = event.getStringProperty(SpaceEvent.USERNAME);
+ String script = CONTEXT_ITEM_SELECTED + "\"" + username + "\", \"" + event.getStringProperty(SpaceEvent.CONTEXT_MENU_DATA_ITEM_ID) + "\"" + ONCLICK_SCRIPT_SUFFIX ;
+ String result = evaluateScript(context, thingScope, script);
+ spaceSimulator.log("Item selected script : " + result);
+ try {
+ new URL(result); //for effect of parsing it to determine if ok
+ spaceSimulator.showLinkToUser(username, result, result);
+ } catch (MalformedURLException e) {
+ //not a URL, so we are done, assume the call was for effect
+ }
} else if (SpaceEvent.ADD_THING_EVENT.equals(event.getName())) {
- try {
+ try {
Thing thing = spaceSimulator.getSpace().getThing(event.getLongProperty(SpaceEvent.THING_ID).longValue());
if (thing != null) {
constructThingScript(thing);
@@ -163,6 +212,41 @@
}
+ private String processScriptForContextMenuInfo(ScriptableObject thingScope, String username, long nonce, String script, Context context) {
+ Vector arrayOfObjects=new Vector();
+ String result = evaluateScriptForArray(context, thingScope, script, arrayOfObjects);
+ String errorToClient = null;
+ if (result!=null) {
+ spaceSimulator.log("Error in script:"+result);
+ errorToClient = result;
+ } else {
+ for (int i=0; i<arrayOfObjects.size();++i) {
+ ScriptableObject candidate = (ScriptableObject)arrayOfObjects.get(i);
+ if (!(candidate.getClassName().equals(ScriptContextMenuInfo.JS_CLASS_NAME))) {
+ errorToClient = "Should be an array of ContextMenuInfo items but had "+candidate.getClassName() +" in the array1";
+ }
+ }
+ }
+ SpaceEvent event = new SpaceEvent(SpaceEvent.CONTEXT_MENU_DATA_EVENT);
+ event.setProperty(SpaceEvent.NONCE, new Long(nonce));
+ if (errorToClient!=null) {
+ event.setProperty(SpaceEvent.CONTEXT_MENU_DATA_GENERATION_ERROR,errorToClient);
+ } else {
+ //this is so we can use the same types on the client side
+ Vector changedTypeObjects=new Vector();
+ for (int i=0; i<arrayOfObjects.size();++i) {
+ ScriptContextMenuInfo infoWithJSBaggage=(ScriptContextMenuInfo)arrayOfObjects.get(i);
+ ContextMenuInfo infoNoJS=new ContextMenuInfo();
+ infoNoJS.setValues(infoWithJSBaggage.getUserVisibleString(),
+ infoWithJSBaggage.getEnabled(), infoWithJSBaggage.getId());
+ changedTypeObjects.add(infoNoJS);
+ }
+ event.setContextMenu(changedTypeObjects);
+ }
+ spaceSimulator.getListener().generatedSpaceEventForUser(username, event, spaceSimulator);
+ return errorToClient;
+ }
+
private ScriptableObject createThingScope(Context context) {
ScriptableObject scriptScope = (ScriptableObject) context.newObject(globalScope);
scriptScope.setPrototype(globalScope);
@@ -186,7 +270,39 @@
return "Error: " + e;
}
}
-
+
+ // dodgy: this returns an error message or null if things are ok
+ private String evaluateScriptForArray(Context context, ScriptableObject scriptScope, String script, Vector valuesFound) {
+ try {
+ Object result = context.evaluateString(scriptScope, script, "<cmd>", 1, null);
+ if (result == null) {
+ return "null returned by javascript";
+ } else if (result instanceof Undefined) {
+ return "undefined value returned from javascript";
+ } else if (!(result instanceof ScriptableObject)) {
+ return "unexpected return type from javascript";
+ }
+
+ ScriptableObject obj=(ScriptableObject)result;
+ if (!(obj.getClassName().equals("Array"))) {
+ return "Expected Array result but got "+obj.getClassName();
+ }
+ Object length_raw = obj.get("length", obj);
+ if ((length_raw==null) || (!(length_raw instanceof java.lang.Number))){
+ return "Internal error! Can't understand length of array in javascript!";
+ }
+ Number length= (Number)length_raw;
+ for (int i=0; i<length.intValue();++i) {
+ valuesFound.add(obj.get(i, obj));
+ }
+ return null;
+ } catch (EcmaError error) {
+ return "Javascript Error:"+error.getMessage();
+ } catch (Throwable e) {
+ spaceSimulator.log("Caught a throwabe when evaluating script for array:"+e.getMessage());
+ return "(Internal) Error:"+e.getMessage();
+ }
+ }
public static String getMessage(EcmaError e) {
return "Error at line " + e.lineNumber() + " column " + e.columnNumber() + (e.lineSource() == null ? " " : "(" + e.lineSource() + ")") + e.getErrorMessage();
}
Added: spaces/trunk/src/com/ogoglio/util/ContextMenuInfo.java
===================================================================
--- spaces/trunk/src/com/ogoglio/util/ContextMenuInfo.java (rev 0)
+++ spaces/trunk/src/com/ogoglio/util/ContextMenuInfo.java 2007-08-19 20:01:35 UTC (rev 245)
@@ -0,0 +1,23 @@
+package com.ogoglio.util;
+
+public class ContextMenuInfo {
+ private String userVisibleString;
+ private String id;
+ private boolean enabled;
+
+ public String getUserVisibleString() {
+ return userVisibleString;
+ }
+ public String getId() {
+ return id;
+ }
+ public boolean getEnabled() {
+ return enabled;
+ }
+ public void setValues(String textToShow, boolean notGrayedOut, String forCallback) {
+ userVisibleString=textToShow;
+ enabled=notGrayedOut;
+ id=forCallback;
+ }
+
+}
Modified: spaces/trunk/src/com/ogoglio/viewer/applet/AppletTestWindow.java
===================================================================
--- spaces/trunk/src/com/ogoglio/viewer/applet/AppletTestWindow.java 2007-08-16 19:33:40 UTC (rev 244)
+++ spaces/trunk/src/com/ogoglio/viewer/applet/AppletTestWindow.java 2007-08-19 20:01:35 UTC (rev 245)
@@ -68,7 +68,7 @@
}
//parameters1.put("loginCookie", "guestApplet_Test_Window2");
- parameters1.put("spaceID", "" + 1);
+ parameters1.put("spaceID", "" + 3);
parameters1.put("serviceURI", serviceURI);
//parameters1.put("x", "0");
Modified: spaces/trunk/src/com/ogoglio/viewer/applet/MotionInputHandler.java
===================================================================
--- spaces/trunk/src/com/ogoglio/viewer/applet/MotionInputHandler.java 2007-08-16 19:33:40 UTC (rev 244)
+++ spaces/trunk/src/com/ogoglio/viewer/applet/MotionInputHandler.java 2007-08-19 20:01:35 UTC (rev 245)
@@ -15,20 +15,21 @@
package com.ogoglio.viewer.applet;
import java.awt.event.KeyEvent;
-import java.awt.event.KeyListener;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
import java.awt.event.MouseMotionListener;
import javax.media.j3d.Transform3D;
+import javax.swing.JPopupMenu;
+import javax.vecmath.Point3d;
import javax.vecmath.Point3f;
import javax.vecmath.Quat4f;
import javax.vecmath.Vector3f;
import com.ogoglio.client.UserInputListener;
import com.ogoglio.client.model.SplinePath;
+import com.ogoglio.client.model.Thing;
import com.ogoglio.util.ArgumentUtils;
-import com.ogoglio.viewer.j3d.J3DShapeRenderable;
import com.ogoglio.viewer.j3d.J3DSplineKeyFrame;
import com.ogoglio.viewer.j3d.J3DSplinePath;
import com.ogoglio.viewer.render.ClickTarget;
@@ -311,8 +312,11 @@
reevaluate();
}
- public void mouseClicked(MouseEvent e) {
- ClickTarget clickTarget = renderer.getClickTarget(e.getX(), e.getY());
+ public void mouseClicked(MouseEvent event) {
+ if (event.isControlDown() || event.getButton()!=MouseEvent.BUTTON1) {
+ return;
+ }
+ ClickTarget clickTarget = renderer.getClickTarget(event.getX(), event.getY());
if (clickTarget == null) {
return;
}
@@ -323,19 +327,30 @@
ShapeRenderable shapeRenderable = (ShapeRenderable) clickTarget.getRenderable();
Renderable renderable = shapeRenderable.getRenderable();
if (renderable instanceof ThingRenderable) {
- userInputListener.mouseClickedThing(((ThingRenderable) renderable).getThing(), shapeRenderable.getName(), clickTarget.getIntersection());
+ Thing thing = ((ThingRenderable) renderable).getThing();
+ clickedOnAThing(event, thing, shapeRenderable.getName(), clickTarget.getIntersection());
} else if (renderable instanceof DoorRenderable) {
userInputListener.mouseClickedDoor(((DoorRenderable) renderable).getDoor(), shapeRenderable.getName(), clickTarget.getIntersection());
+ } else {
+ throw new IllegalStateException("Clicked on a type of renderable who has a parent we don't understand");
}
} else if (clickTarget.getRenderable() instanceof ThingRenderable) {
- userInputListener.mouseClickedThing(((ThingRenderable) clickTarget.getRenderable()).getThing(), null, clickTarget.getIntersection());
+ clickedOnAThing(event, ((ThingRenderable) clickTarget.getRenderable()).getThing(), null, clickTarget.getIntersection());
} else if (clickTarget.getRenderable() instanceof DoorRenderable) {
userInputListener.mouseClickedDoor(((DoorRenderable) clickTarget.getRenderable()).getDoor(), null, clickTarget.getIntersection());
} else if (clickTarget.getRenderable() instanceof PageRenderable) {
userInputListener.mouseClickedPage(((PageRenderable) clickTarget.getRenderable()).getPage(), clickTarget.getIntersection());
+ } else {
+ throw new IllegalStateException("Clicked on a type of renderable we don't understand");
}
+
}
+ private void clickedOnAThing(MouseEvent event, Thing thing, String name, Point3d intersection) {
+ userInputListener.mouseClickedThing(thing, name, intersection);
+
+ }
+
public void mouseDragged(MouseEvent e) {
}
@@ -348,9 +363,50 @@
public void mouseExited(MouseEvent e) {
}
- public void mousePressed(MouseEvent e) {
+ public void mousePressed(MouseEvent event) {
+ System.out.println("POPUP TRIGGER FART:"+event.isPopupTrigger()+","+new JPopupMenu().isPopupTrigger(event)+","+
+ event.isControlDown()+","+event.paramString()+","+event.getButton());
+ ClickTarget clickTarget = renderer.getClickTarget(event.getX(), event.getY());
+ if (clickTarget == null) {
+ return;
+ }
+ ThingRenderable renderable;
+ String name = null;
+
+ if (clickTarget.getRenderable() instanceof ThingRenderable) {
+ renderable = (ThingRenderable) clickTarget.getRenderable();
+ } else if (clickTarget.getRenderable() instanceof ShapeRenderable) {
+ ShapeRenderable shape = (ShapeRenderable) clickTarget.getRenderable();
+ renderable = (ThingRenderable) shape.getRenderable();
+ name = shape.getName();
+ } else {
+ return;
+ }
+ if (event.isPopupTrigger()) {
+ userInputListener.mouseContextClickedThing(renderable.getThing(), name, event.getX(), event.getY());
+ event.consume();
+ }
}
- public void mouseReleased(MouseEvent e) {
+ public void mouseReleased(MouseEvent event) {
+ ClickTarget clickTarget = renderer.getClickTarget(event.getX(), event.getY());
+ if (clickTarget == null) {
+ return;
+ }
+ ThingRenderable renderable;
+ String name = null;
+
+ if (clickTarget.getRenderable() instanceof ThingRenderable) {
+ renderable = (ThingRenderable) clickTarget.getRenderable();
+ } else if (clickTarget.getRenderable() instanceof ShapeRenderable) {
+ ShapeRenderable shape = (ShapeRenderable) clickTarget.getRenderable();
+ renderable = (ThingRenderable) shape.getRenderable();
+ name = shape.getName();
+ } else {
+ return;
+ }
+ if (event.isPopupTrigger()) {
+ userInputListener.mouseContextClickedThing(renderable.getThing(), name, event.getX(), event.getY());
+ }
}
}
Modified: spaces/trunk/src/com/ogoglio/viewer/applet/ViewerApplet.java
===================================================================
--- spaces/trunk/src/com/ogoglio/viewer/applet/ViewerApplet.java 2007-08-16 19:33:40 UTC (rev 244)
+++ spaces/trunk/src/com/ogoglio/viewer/applet/ViewerApplet.java 2007-08-19 20:01:35 UTC (rev 245)
@@ -18,18 +18,27 @@
import java.awt.Color;
import java.awt.FlowLayout;
import java.awt.Panel;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
import java.io.IOException;
import java.net.URI;
import java.net.URISyntaxException;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Vector;
import javax.media.j3d.Transform3D;
import javax.swing.JLabel;
+import javax.swing.JMenuItem;
import javax.swing.JPanel;
+import javax.swing.JPopupMenu;
import javax.vecmath.Vector3d;
import netscape.javascript.JSObject;
import com.ogoglio.client.SpaceClient;
+import com.ogoglio.client.model.Thing;
+import com.ogoglio.util.ContextMenuInfo;
import com.ogoglio.viewer.j3d.J3DRenderer;
import com.ogoglio.viewer.render.Renderer;
@@ -47,6 +56,8 @@
private String authCookie = null;
+ private Map popupMap = new HashMap();
+
public ViewerApplet() {
setBackground(Color.WHITE);
setLayout(new BorderLayout());
@@ -159,7 +170,34 @@
e.printStackTrace();
}
}
+
+
+ private void showPopup(Thing thing, int x, int y, long nonce) {
+ ThingGeneratedPopup popup=new ThingGeneratedPopup(thing,nonce);
+ popup.show(this,x,y);
+ popupMap.put(new Long(nonce),popup);
+ }
+
+ private void sendServerSelectionMessage(Thing thing, long nonce,String id) {
+ spaceClient.mouseContextItemChosen(thing,nonce,id);
+ }
+
+
+ public void populatePopup(long nonce, String errorIfAny, Vector contextMenu) {
+ if (!popupMap.containsKey(new Long(nonce))) {
+ System.err.println("[Internal Error] context menu data ("+nonce+") couldn't be matched to a menu!");
+ return;
+ }
+ if (errorIfAny!=null) {
+ System.err.println("[Javascript Error]:"+errorIfAny);
+ } else {
+ ThingGeneratedPopup popup = (ThingGeneratedPopup)popupMap.get(new Long(nonce));
+ popup.populate(contextMenu);
+ }
+ popupMap.remove(new Long(nonce));
+ }
+
private void showLink(String displayName, String link) {
try {
JSObject win = JSObject.getWindow(this); // get handle to a window.
@@ -233,7 +271,7 @@
//add(new ErrorPanel("Unfortunately, I lost the connection to the server."), BorderLayout.CENTER);
//validate();
}
-
+
public void receivedChatMessage(String username, String message) {
addChatMessage(username + ":" + message);
}
@@ -261,8 +299,64 @@
public void receivedBrowserMessage(long sourceThingID, String message) {
messageBrowser(sourceThingID, message);
}
+
+ public void receivedContextMenuRequest(Thing thing, String shapeName, int x, int y, long nonce) {
+ showPopup(thing,x, y, nonce);
+ }
+
+ public void receivedContextMenuData(long nonce, String errorIfAny, Vector contextMenu) {
+ populatePopup(nonce,errorIfAny,contextMenu);
+ }
+
+ public void contextItemChosen(Thing thing, long nonce, String id) {
+ }
+
+
}
+ private class ThingGeneratedPopup extends JPopupMenu {
+
+ JMenuItem waitingItem;
+ Thing thing;
+ long startTime;
+ long nonce;
+
+ public ThingGeneratedPopup(Thing theThing, long theNonce) {
+ waitingItem=add("Retreiving menu...");
+ thing=theThing;
+ nonce=theNonce;
+ startTime=System.currentTimeMillis();
+ }
+
+ public boolean populate(final Vector items) {
+ if (!this.isVisible()) {
+ return false;
+ }
+ remove(waitingItem);
+ for (int i=0; i<items.size();++i) {
+ ContextMenuInfo info = (ContextMenuInfo)items.get(i);
+ JMenuItem item=new JMenuItem(info.getUserVisibleString());
+ item.setEnabled(info.getEnabled());
+ add(item);
+ final String id=info.getId();
+ item.addActionListener(new ActionListener() {
+ public void actionPerformed(ActionEvent e) {
+ sendSelection(id);
+ }
+ });
+ }
+ //IES: I have no idea why this causes a relayout that works properle. ugh. totally broken.
+ this.setVisible(false);
+ this.setVisible(true);
+ return true;
+ }
+
+ public void sendSelection(String id) {
+ sendServerSelectionMessage(thing,nonce,id);
+ }
+
+ }
+
//TODO make the error panel less ugly
private class ErrorPanel extends Panel {
public ErrorPanel(String errorMessage) {
@@ -285,4 +379,5 @@
}
}
+
}
Modified: spaces/trunk/src/com/ogoglio/xml/SpaceEvent.java
===================================================================
--- spaces/trunk/src/com/ogoglio/xml/SpaceEvent.java 2007-08-16 19:33:40 UTC (rev 244)
+++ spaces/trunk/src/com/ogoglio/xml/SpaceEvent.java 2007-08-19 20:01:35 UTC (rev 245)
@@ -17,16 +17,16 @@
import java.net.MalformedURLException;
import java.net.URL;
import java.util.HashMap;
+import java.util.Vector;
import javax.media.j3d.Transform3D;
-import javax.vecmath.Point3f;
import javax.vecmath.Quat4d;
import javax.vecmath.Vector3d;
import nanoxml.XMLElement;
import com.ogoglio.client.model.SplinePath;
-import com.ogoglio.viewer.j3d.J3DSplineKeyFrame;
+import com.ogoglio.util.ContextMenuInfo;
import com.ogoglio.viewer.j3d.J3DSplinePath;
public class SpaceEvent {
@@ -82,7 +82,7 @@
public static final String USERNAME = "userID";
public static final String BODY_ID = "bodyID";
-
+
public static final String THING_ID = "thingID";
public static final String TEMPLATE_ID = "templateID";
@@ -125,6 +125,8 @@
public static final String THING_CLICKED_EVENT = "thingClicked";
+ public static final String THING_CONTEXT_CLICKED_EVENT = "thingContextClicked";
+
public static final String SCRIPT_REQUEST_EVENT = "scriptRequest";
public static final String SRE_SCRIPT = "script";
@@ -194,11 +196,27 @@
public static final String MESSAGE_BROWSER_EVENT = "MessageBrowser";
public static final String MESSAGE_TO_BROWSER = "message";
-
+
public static final String PLAY_ANIMATION_EVENT = "PlayAnimation";
-
+
public static final String ANIMATION_ID = "animationID";
+ public static final String NONCE = "nonce";
+
+ public static final String CONTEXT_MENU_DATA_EVENT = "menuContent";
+
+ public static final String CONTEXT_MENU_DATA_GENERATION_ERROR = "contextMenuScriptIsHosed";
+
+ public static final String CONTEXT_MENU_DATA_ITEM = "contextMenuItem";
+
+ public static final String CONTEXT_MENU_DATA_ITEM_TEXT = "contextMenuItemText";
+
+ public static final String CONTEXT_MENU_DATA_ITEM_ENABLED = "contextMenuItemEnabled";
+
+ public static final String CONTEXT_MENU_DATA_ITEM_ID = "contextMenuItemId";
+
+ public static final String THING_CONTEXT_SELECTION_MADE_EVENT = "contextMenuItemChosen";
+
private String name = null;
private HashMap properties = new HashMap();
@@ -207,6 +225,8 @@
private String html = null;
+ private Vector contextMenu = new Vector();
+
public SpaceEvent(String name) {
this.name = name;
}
@@ -245,8 +265,33 @@
HtmlElement ele = new HtmlElement(htmlElement);
html = ele.getHtml();
}
+
+ XMLElement[] allMenuItems = element.getChildren(CONTEXT_MENU_DATA_ITEM);
+ if (allMenuItems != null) {
+ Vector result = new Vector();
+ for (int i = 0; i < allMenuItems.length; ++i) {
+ XMLElement item = allMenuItems[i];
+ String text = item.getStringAttribute(CONTEXT_MENU_DATA_ITEM_TEXT);
+ boolean enabled = item.getBooleanAttribute(CONTEXT_MENU_DATA_ITEM_ENABLED);
+ String id = item.getStringAttribute(CONTEXT_MENU_DATA_ITEM_ID);
+
+ //go through front door!
+ ContextMenuInfo info = new ContextMenuInfo();
+ info.setValues(text, enabled, id);
+ result.add(info);
+ }
+ setContextMenu(result);
+ }
}
+ public void setContextMenu(Vector arrayOfObjs) {
+ contextMenu = arrayOfObjs;
+ }
+
+ public Vector getContextMenu() {
+ return contextMenu;
+ }
+
public String getName() {
return name;
}
@@ -335,6 +380,17 @@
if (html != null) {
element.addChild(new HtmlElement(html).toElement());
}
+ if (contextMenu!=null) {
+ for (int i=0; i<contextMenu.size();++i) {
+ ContextMenuInfo info=(ContextMenuInfo)contextMenu.get(i);
+ XMLElement item = new XMLElement();
+ item.setName(CONTEXT_MENU_DATA_ITEM);
+ item.setAttribute(CONTEXT_MENU_DATA_ITEM_TEXT, info.getUserVisibleString());
+ item.setAttribute(CONTEXT_MENU_DATA_ITEM_ENABLED, info.getEnabled());
+ item.setAttribute(CONTEXT_MENU_DATA_ITEM_ID, info.getId());
+ element.addChild(item);
+ }
+ }
return element;
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ian...@us...> - 2007-08-16 19:33:37
|
Revision: 244
http://ogoglio.svn.sourceforge.net/ogoglio/?rev=244&view=rev
Author: iansmith
Date: 2007-08-16 12:33:40 -0700 (Thu, 16 Aug 2007)
Log Message:
-----------
More cleanup to insure that the ogoglio server can be shutdown properly via a program.
Ant changes to allow "ant test" to work properly from the command line. Warning: If you are using eclipse, changes made to source code via eclipse don't seem to be automatically recompiled via the "compile" ant task. It always works to do "ant clean test".
For reasons I don't understand, rmock's expectThatExceptionThrown doesn't work when run via ant. There is some seriously weird classpath stuff going on so for now I just converted the tests that used that function to work the more traditional way. No test logic was lost.
Modified Paths:
--------------
spaces/trunk/build.xml
spaces/trunk/src/com/ogoglio/OgoglioTestSuite.java
spaces/trunk/src/com/ogoglio/client/WebAPIClientWire.java
spaces/trunk/src/com/ogoglio/client/WebAPITests.java
spaces/trunk/src/com/ogoglio/message/SenderQueue.java
spaces/trunk/src/com/ogoglio/message/TCPChannel.java
spaces/trunk/src/com/ogoglio/message/TCPMessageReader.java
spaces/trunk/src/com/ogoglio/templatesync/OgoglioSpecBase.java
spaces/trunk/src/com/ogoglio/templatesync/SyncTool.java
Modified: spaces/trunk/build.xml
===================================================================
--- spaces/trunk/build.xml 2007-08-16 17:04:44 UTC (rev 243)
+++ spaces/trunk/build.xml 2007-08-16 19:33:40 UTC (rev 244)
@@ -15,8 +15,11 @@
</filterchain>
</loadproperties>
-
<echo message="tomcat 5.5 dir found to be ${ant.tomcatDir}"/>
+
+ <target name="junitOk">
+ <available property="junitPresent" classname="junit.framework.TestCase" />
+ </target>
<target name="clean">
<delete>
@@ -43,13 +46,14 @@
<fileset dir="shared-lib">
<include name="**/*.jar" />
</fileset>
- <fileset dir="${tomcatHome}/common/lib/">
+ <fileset dir="${ant.tomcatDir}/common/lib/">
<include name="**/*.jar" />
</fileset>
<fileset dir="${java.home}/lib/">
<include name="plugin.jar" />
</fileset>
- </path>
+ <filelist dir="war/WEB-INF" files="classes"/>
+ </path>
<!-- these are files which will end up in ogoglio-shared.jar in Tomcat's shared lib, and not in ogoglio.war -->
<fileset id="sharedFiles" dir="${dest}">
@@ -160,10 +164,20 @@
errorProperty="ignored" outputProperty="ignoredalso"/>
</target>
- <target name="test" depends="war,insureNoServer">
+ <target name="test" depends="war,insureNoServer,junitOk">
+ <fail message="Couldn't find JUnit classes in classpath! You need to put shared-lib/junit-3.8.1.jar in ~/.ant/lib so ant can find it!" unless="junitPresent"/>
+ <echo message="starting ogoglio server..."/>
<exec executable="${ant.tomcatDir}/bin/startup.sh" failonerror="true"/>
<sleep seconds="5"/>
+
+ <junit>
+ <classpath refid="classpath"/>
+ <formatter type="brief" usefile="false" />
+ <test name="com.ogoglio.OgoglioTestSuite" />
+ </junit>
+
<exec executable="${ant.tomcatDir}/bin/shutdown.sh" failonerror="true"/>
</target>
+
</project>
Modified: spaces/trunk/src/com/ogoglio/OgoglioTestSuite.java
===================================================================
--- spaces/trunk/src/com/ogoglio/OgoglioTestSuite.java 2007-08-16 17:04:44 UTC (rev 243)
+++ spaces/trunk/src/com/ogoglio/OgoglioTestSuite.java 2007-08-16 19:33:40 UTC (rev 244)
@@ -29,7 +29,7 @@
TestSuite suite = new TestSuite();
suite.addTestSuite(ObjTest.class);
suite.addTestSuite(XMLTests.class);
- //suite.addTestSuite(PersistTests.class);
+ suite.addTestSuite(PersistTests.class);
suite.addTestSuite(WebAPITests.class);
suite.addTestSuite(ClientTests.class);
suite.addTestSuite(ScriptTests.class);
Modified: spaces/trunk/src/com/ogoglio/client/WebAPIClientWire.java
===================================================================
--- spaces/trunk/src/com/ogoglio/client/WebAPIClientWire.java 2007-08-16 17:04:44 UTC (rev 243)
+++ spaces/trunk/src/com/ogoglio/client/WebAPIClientWire.java 2007-08-16 19:33:40 UTC (rev 244)
@@ -294,18 +294,20 @@
// XXX seems to be required
String headerValue = null;
Object makeLinuxHappy = (connection.getRequestProperties().get(headerName));
- if (makeLinuxHappy instanceof String) {
- headerValue = (String) makeLinuxHappy;
- } else if (makeLinuxHappy instanceof List) {
- headerValue = (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!");
+ if (makeLinuxHappy!=null) {
+ if (makeLinuxHappy instanceof String) {
+ headerValue = (String) makeLinuxHappy;
+ } else if (makeLinuxHappy instanceof List) {
+ headerValue = (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:"+makeLinuxHappy.getClass().getName());
+ return null;
+ }
+ }
+ if (makeLinuxHappy == null) {
return null;
}
- if (headerValue == null) {
- return null;
- }
return headerValue;
} catch (IOException e) {
return null;
Modified: spaces/trunk/src/com/ogoglio/client/WebAPITests.java
===================================================================
--- spaces/trunk/src/com/ogoglio/client/WebAPITests.java 2007-08-16 17:04:44 UTC (rev 243)
+++ spaces/trunk/src/com/ogoglio/client/WebAPITests.java 2007-08-16 19:33:40 UTC (rev 244)
@@ -84,8 +84,9 @@
modify().multiplicity(expect.atMost(2));
modify().forward();
- expectThatExceptionThrown(is.instanceOf(AuthenticationFailedException.class));
-
+ //for reasons I don't understand this doesn't work when running via ant
+ //so we are going to not use it for now
+ //expectThatExceptionThrown(is.instanceOf(AuthenticationFailedException.class));
//###################################
startVerification();
@@ -94,9 +95,13 @@
assertEquals(GOOD_COOKIE, auth.getAuthCookie());
assertEquals(authedAuthDoc.getUsername(), auth.getUsername());
assertEquals(accountDoc, auth.getAccountDocument(true));
-
- mockAuthFactory.authenticate(mockWire, descriptor, BAD_COOKIE);
-
+
+ try {
+ auth = mockAuthFactory.authenticate(mockWire, descriptor, BAD_COOKIE);
+ fail("Should not be able to reach this point after bad authentication!");
+ } catch (AuthenticationFailedException e) {
+ assertThat(e, is.instanceOf(AuthenticationFailedException.class));
+ }
}
public void testWebAPIAuthenticatorViaUsernameAndPass() throws AuthenticationFailedException, URISyntaxException, IOException {
@@ -114,7 +119,9 @@
mockAuthFactory.authenticate(mockWire, descriptor, "Ian", "goodPW");
modify().forward();
- expectThatExceptionThrown(is.instanceOf(AuthenticationFailedException.class));
+ //for reasons I don't understand this doesn't work when running via ant
+ //so we are going to not use it for now
+ //expectThatExceptionThrown(is.instanceOf(AuthenticationFailedException.class));
//###################################
startVerification();
@@ -124,7 +131,12 @@
assertThat(auth.getAuthCookie(), is.eq(GOOD_COOKIE));
//try bad pw
- mockAuthFactory.authenticate(mockWire, descriptor, "Ian", "farts");
+ try {
+ mockAuthFactory.authenticate(mockWire, descriptor, "Ian", "farts");
+ fail("Should not be able to reach this point after bad pw!");
+ } catch (AuthenticationFailedException e) {
+ assertThat(e, is.instanceOf(AuthenticationFailedException.class));
+ }
}
}
Modified: spaces/trunk/src/com/ogoglio/message/SenderQueue.java
===================================================================
--- spaces/trunk/src/com/ogoglio/message/SenderQueue.java 2007-08-16 17:04:44 UTC (rev 243)
+++ spaces/trunk/src/com/ogoglio/message/SenderQueue.java 2007-08-16 19:33:40 UTC (rev 244)
@@ -47,10 +47,17 @@
public void cleanup() {
cleaned = true;
try {
- clientSocket.close();
- socketOutput.close();
- messageQueue.close();
+ if (clientSocket!=null) {
+ clientSocket.close();
+ }
+ if (socketOutput!=null) {
+ socketOutput.close();
+ }
+ if (messageQueue!=null) {
+ messageQueue.close();
+ }
} catch (IOException e) {
+ System.out.println("IOException trying cleanup SenderQueue:"+e.getMessage());
}
}
Modified: spaces/trunk/src/com/ogoglio/message/TCPChannel.java
===================================================================
--- spaces/trunk/src/com/ogoglio/message/TCPChannel.java 2007-08-16 17:04:44 UTC (rev 243)
+++ spaces/trunk/src/com/ogoglio/message/TCPChannel.java 2007-08-16 19:33:40 UTC (rev 244)
@@ -84,12 +84,16 @@
public void cleanup() {
cleaned = true;
try {
- readerThread.cleanup();
+ if (readerThread!=null) {
+ readerThread.cleanup();
+ }
} catch (Exception e) {
System.out.println("TCPChannel: Trying to cleanup to readerThread:"+(e.getClass().getName())+":"+e.getMessage());
}
try {
- senderQueue.cleanup();
+ if (senderQueue!=null) {
+ senderQueue.cleanup();
+ }
} catch (Exception e) {
System.out.println("TCPChannel: Trying to cleanup to senderQueue:"+(e.getClass().getName())+":"+e.getMessage());
}
Modified: spaces/trunk/src/com/ogoglio/message/TCPMessageReader.java
===================================================================
--- spaces/trunk/src/com/ogoglio/message/TCPMessageReader.java 2007-08-16 17:04:44 UTC (rev 243)
+++ spaces/trunk/src/com/ogoglio/message/TCPMessageReader.java 2007-08-16 19:33:40 UTC (rev 244)
@@ -75,8 +75,11 @@
public void cleanup() {
cleaned = true;
try {
- socketInput.close();
+ if (socketInput!=null) {
+ socketInput.close();
+ }
} catch (IOException e) {
+ System.out.println("IOException caught trying to clean up TCPMessageReader:"+e.getMessage());
}
}
Modified: spaces/trunk/src/com/ogoglio/templatesync/OgoglioSpecBase.java
===================================================================
--- spaces/trunk/src/com/ogoglio/templatesync/OgoglioSpecBase.java 2007-08-16 17:04:44 UTC (rev 243)
+++ spaces/trunk/src/com/ogoglio/templatesync/OgoglioSpecBase.java 2007-08-16 19:33:40 UTC (rev 244)
@@ -5,7 +5,7 @@
public class OgoglioSpecBase extends RMockTestCase {
public Object mock_ignoreEqualsAndToString(Class clazz) {
- return mock_ignoreEqualsAndToString(clazz,new Object[0], "mockOf:"+clazz.getName());
+ return mock_ignoreEqualsAndToString(clazz,new Object[0], "mockOf_"+clazz.toString().replace('.','_'));
}
public Object mock_ignoreEqualsAndToString(Class clazz, Object[] constructorParams, String name) {
Object result = mock(clazz,constructorParams,name);
Modified: spaces/trunk/src/com/ogoglio/templatesync/SyncTool.java
===================================================================
--- spaces/trunk/src/com/ogoglio/templatesync/SyncTool.java 2007-08-16 17:04:44 UTC (rev 243)
+++ spaces/trunk/src/com/ogoglio/templatesync/SyncTool.java 2007-08-16 19:33:40 UTC (rev 244)
@@ -262,7 +262,6 @@
File template = ((File) serverTemplatesToAdd.get(i));
verifyDirContent(template);
long newID = createTemplate(template, client);
- System.out.println("ADDING:" + template.getName() + "," + newID);
serverTemplateNamesToIds.put(template.getName(), new Long(newID));
}
deleteTemplates(client, serverTemplatesToDelete);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ian...@us...> - 2007-08-16 17:04:44
|
Revision: 243
http://ogoglio.svn.sourceforge.net/ogoglio/?rev=243&view=rev
Author: iansmith
Date: 2007-08-16 10:04:44 -0700 (Thu, 16 Aug 2007)
Log Message:
-----------
Fixes to enhance chances of automation.
1) Fixed database mapping problem for MySql 5 that was causing timestamp problems. We now use a long in the DB.
2) Fixed a bug in MessageProxy that kept the heartbeat thread going after the service was supposed to shutdown. Now we shutdown cleanly. Added a bunch of debugging support for this so we get better error messages as we are going down and there are problems.
3) Incorporated changes in the build.xml and began support for ant-oriented automated testing.
Modified Paths:
--------------
spaces/trunk/build.xml
spaces/trunk/docs/properties-example.txt
spaces/trunk/src/com/ogoglio/client/ClientTests.java
spaces/trunk/src/com/ogoglio/client/WebAPIClient.java
spaces/trunk/src/com/ogoglio/client/WebAPIClientWire.java
spaces/trunk/src/com/ogoglio/client/WebAPITests.java
spaces/trunk/src/com/ogoglio/message/NetworkChannelServer.java
spaces/trunk/src/com/ogoglio/message/TCPChannel.java
spaces/trunk/src/com/ogoglio/persist/AccountPersistTasks.java
spaces/trunk/src/com/ogoglio/persist/AccountRecord.java
spaces/trunk/src/com/ogoglio/persist/HibernateBase.java
spaces/trunk/src/com/ogoglio/persist/Persist.hbm.xml
spaces/trunk/src/com/ogoglio/persist/SpacePersistTasks.java
spaces/trunk/src/com/ogoglio/sim/site/SimServlet.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
spaces/trunk/src/com/ogoglio/site/SpaceServlet.java
spaces/trunk/src/com/ogoglio/util/PrepareDatabase.java
spaces/trunk/src/com/ogoglio/xml/AccountDocument.java
spaces/trunk/src/com/ogoglio/xml/XMLTests.java
Modified: spaces/trunk/build.xml
===================================================================
--- spaces/trunk/build.xml 2007-08-09 23:56:22 UTC (rev 242)
+++ spaces/trunk/build.xml 2007-08-16 17:04:44 UTC (rev 243)
@@ -2,10 +2,22 @@
<project default="war" basedir=".">
<property name="source" value="src" />
<property name="dest" value="war/WEB-INF/classes" />
- <property name="tomcatHome" value="../../tomcat/" />
<property name="webLibDir" value="./war/WEB-INF/lib/" />
<property name="warName" value="ogoglio.war" />
+
+ <echo message="reading properties from ${user.home}/.ogoglio-properties"/>
+ <loadproperties srcFile="${user.home}/.ogoglio-properties">
+ <filterchain>
+ <linecontains>
+ <contains value="ant."/>
+ </linecontains>
+ </filterchain>
+ </loadproperties>
+
+
+ <echo message="tomcat 5.5 dir found to be ${ant.tomcatDir}"/>
+
<target name="clean">
<delete>
<fileset dir="${dest}" includes="**/*" />
@@ -142,6 +154,16 @@
<bottom><![CDATA[<i>Copyright © 2007 Transmutable. All Rights Reserved.</i>]]></bottom>
</javadoc>
</target>
-
+
+ <target name="insureNoServer">
+ <exec executable="${ant.tomcatDir}/bin/shutdown.sh" failonerror="false"
+ errorProperty="ignored" outputProperty="ignoredalso"/>
+ </target>
+
+ <target name="test" depends="war,insureNoServer">
+ <exec executable="${ant.tomcatDir}/bin/startup.sh" failonerror="true"/>
+ <sleep seconds="5"/>
+ <exec executable="${ant.tomcatDir}/bin/shutdown.sh" failonerror="true"/>
+ </target>
</project>
Modified: spaces/trunk/docs/properties-example.txt
===================================================================
--- spaces/trunk/docs/properties-example.txt 2007-08-09 23:56:22 UTC (rev 242)
+++ spaces/trunk/docs/properties-example.txt 2007-08-16 17:04:44 UTC (rev 243)
@@ -8,7 +8,7 @@
# TOMCAT
#
# pointer to your tomcat 5.5 install
-tomcat_dir = /usr/share/tomcat5.5
+ant.tomcatDir = /usr/share/tomcat5.5
#
# LOCALHOST
Modified: spaces/trunk/src/com/ogoglio/client/ClientTests.java
===================================================================
--- spaces/trunk/src/com/ogoglio/client/ClientTests.java 2007-08-09 23:56:22 UTC (rev 242)
+++ spaces/trunk/src/com/ogoglio/client/ClientTests.java 2007-08-16 17:04:44 UTC (rev 243)
@@ -135,9 +135,10 @@
assertEquals(AccountRecord.ACCOUNT_LEVEL_ADMIN, accountDoc.getAccountLevel());
accountDoc.setFrozenUntil(new Date(1000));
accountDoc.setAccountLevel(AccountRecord.ACCOUNT_LEVEL_BASIC);
- adminWebClient.updateAccount(accountDoc);
- accountDoc = adminWebClient.getAccountDocument(username);
- assertTrue(accountDoc.getFrozenUntil() == null);
+ accountDoc=adminWebClient.updateAccount(accountDoc);
+ AccountDocument ac2= adminWebClient.getAccountDocument(username);
+ assertNull(accountDoc.getFrozenUntil());
+ assertNull(ac2.getFrozenUntil());
assertEquals(AccountRecord.ACCOUNT_LEVEL_BASIC, accountDoc.getAccountLevel());
} catch (Exception e) {
@@ -163,30 +164,31 @@
checkNoConnectionToSpaceWithoutAuth(spaceDocument.getSpaceID());
checkAuthDoc(auth1, auth2);
-
+
spaceDocument = checkSpaceSeaLevel(webClient1, spaceDocument);
-
+
checkSettings(spaceDocument.getSpaceID(), webClient1);
-
+
checkBody(webClient1, auth1);
checkSpaceMembership(spaceDocument.getSpaceID(), webClient1);
checkSpaceAuthWithMembership(auth2, webClient2, webClient1, spaceDocument);
-
+
TemplateDocument newTemplateDoc = checkTemplateScriptAPI(webClient1);
ThingDocument[] thingDocs = checkTemplateGeomMaterialsAndPossessions(webClient1, newTemplateDoc, spaceDocument);
-
+
+
//IES CHECK: after messing around above, verify we are are ok
thingDocs = webClient1.getThingDocuments(spaceDocument.getSpaceID());
assertEquals(1, thingDocs.length);
checkPageManipulation(webClient1, thingDocs[0], spaceDocument);
-
+
//figure out the last template added
TemplateDocument[] templateDocs = webClient1.getTemplateDocuments(USERNAME1);
long lastTemplateID = templateDocs[templateDocs.length - 1].getTemplateID();
-
+
checkDoors(webClient1, spaceDocument, lastTemplateID);
spaceClient1 = checkConnectedUsersToSpace(auth1, webClient1, spaceDocument);
@@ -199,7 +201,7 @@
guestSpaceClient1 = checkGuestCookieOperation(spaceDocument.getSpaceID(), webClient1, AuthServlet.GUEST_COOKIE_PREFIX + "Test_Suite_Guest");
checkDeletingSpaceDestroysThings(spaceDocument.getSpaceID(), webClient1, USERNAME1);
-
+
} catch (IOException e) {
e.printStackTrace();
fail();
@@ -282,10 +284,13 @@
private void checkSettings(long spaceID, WebAPIClient webClient1) throws IOException {
String key1 = "ogoglio.key.1";
String value1 = "This is a very fine value which is < 1";
- assertNull(webClient1.getSpaceSetting(spaceID, key1));
+ Object v = webClient1.getSpaceSetting(spaceID, key1);
+
+ assertNull(v);
+
webClient1.putSpaceSetting(spaceID, key1, value1);
assertEquals(value1, webClient1.getSpaceSetting(spaceID, key1));
-
+
String key2 = "ogoglio.key.2";
String value2 = "This is a very fine value & it's value is > 2";
assertNull(webClient1.getSpaceSetting(spaceID, key2));
@@ -297,6 +302,7 @@
assertNull(webClient1.getSpaceSetting(spaceID, key1));
webClient1.removeSpaceSetting(spaceID, key2);
assertNull(webClient1.getSpaceSetting(spaceID, key2));
+
}
private void checkBody(WebAPIClient webClient1, WebAPIAuthenticator authenticator) throws IOException {
Modified: spaces/trunk/src/com/ogoglio/client/WebAPIClient.java
===================================================================
--- spaces/trunk/src/com/ogoglio/client/WebAPIClient.java 2007-08-09 23:56:22 UTC (rev 242)
+++ spaces/trunk/src/com/ogoglio/client/WebAPIClient.java 2007-08-16 17:04:44 UTC (rev 243)
@@ -31,6 +31,7 @@
import nanoxml.XMLElement;
+import com.ogoglio.persist.AccountRecord;
import com.ogoglio.site.AuthServlet;
import com.ogoglio.site.SpaceServlet;
import com.ogoglio.util.ArgumentUtils;
@@ -66,7 +67,7 @@
}
public AccountDocument createAccount(String username, String accountLevel, String firstName, String lastName, String homepage, String email, String password) throws IOException {
- AccountDocument newAccountDoc = new AccountDocument(username, accountLevel, firstName, lastName, homepage, password, email, null, null, null, null, -1);
+ AccountDocument newAccountDoc = new AccountDocument(username, accountLevel, firstName, lastName, homepage, password, email, null, AccountRecord.NO_TIME_VALUE, null, AccountRecord.NO_TIME_VALUE, -1);
XMLElement result = wire.sendAuthenticatedXML(descriptor.getAccountURI(), newAccountDoc.toString(), "POST", authenticator.getAuthCookie());
return new AccountDocument(result);
}
Modified: spaces/trunk/src/com/ogoglio/client/WebAPIClientWire.java
===================================================================
--- spaces/trunk/src/com/ogoglio/client/WebAPIClientWire.java 2007-08-09 23:56:22 UTC (rev 242)
+++ spaces/trunk/src/com/ogoglio/client/WebAPIClientWire.java 2007-08-16 17:04:44 UTC (rev 243)
@@ -18,8 +18,9 @@
public class WebAPIClientWire {
- private boolean printedCacheComplaint = false;
-
+ private boolean printedCacheComplaint = false;
+ private static final String BAD_SUN_VERSION = "1.6;";
+
public InputStream performPUT(URI uri, InputStream input, String type, int length, String authCookie) throws IOException {
HttpURLConnection connection = (HttpURLConnection) uri.toURL().openConnection();
connection.setRequestMethod("PUT");
@@ -140,7 +141,7 @@
public DecoratedInputStream performGET(URI uri, String authCookie, boolean requestCompression) throws IOException {
String version = System.getProperty("java.version");
- if ((version == null) || version.startsWith("1.6")) {
+ if ((version == null) || version.startsWith(BAD_SUN_VERSION)) {
//THIS IS TO WORK AROUND SUN'S ABSOLUTELY BROKEN APPLET CACHE IN JRE 1.6u1 & 2
String uriString = uri.toASCIIString();
try {
@@ -211,7 +212,7 @@
public DecoratedInputStream performGET(URI uri, String authCookie) throws IOException {
String version = System.getProperty("java.version");
- if ((version == null) || version.startsWith("1.6")) {
+ if ((version == null) || version.startsWith(BAD_SUN_VERSION)) {
//THIS IS TO WORK AROUND SUN'S ABSOLUTELY BROKEN APPLET CACHE IN JRE 1.6u1
String uriString = uri.toASCIIString();
try {
Modified: spaces/trunk/src/com/ogoglio/client/WebAPITests.java
===================================================================
--- spaces/trunk/src/com/ogoglio/client/WebAPITests.java 2007-08-09 23:56:22 UTC (rev 242)
+++ spaces/trunk/src/com/ogoglio/client/WebAPITests.java 2007-08-16 17:04:44 UTC (rev 243)
@@ -42,7 +42,7 @@
notAuthedAuthDoc = new AuthDocument("Ian", false);
authedAuthDoc = new AuthDocument("Ian", true);
- accountDoc = new AccountDocument(authedAuthDoc.getUsername(), AccountRecord.ACCOUNT_LEVEL_ADVANCED, null, null, null, null, null, null, null, null, null, -1);
+ accountDoc = new AccountDocument(authedAuthDoc.getUsername(), AccountRecord.ACCOUNT_LEVEL_ADVANCED, null, null, null, null, null, null, AccountRecord.NO_TIME_VALUE, null, AccountRecord.NO_TIME_VALUE, -1);
} catch (URISyntaxException e) {
fail("Bad URIL: " + e);
}
Modified: spaces/trunk/src/com/ogoglio/message/NetworkChannelServer.java
===================================================================
--- spaces/trunk/src/com/ogoglio/message/NetworkChannelServer.java 2007-08-09 23:56:22 UTC (rev 242)
+++ spaces/trunk/src/com/ogoglio/message/NetworkChannelServer.java 2007-08-16 17:04:44 UTC (rev 243)
@@ -122,6 +122,7 @@
try {
serverSocket.close();
} catch (Exception e) {
+ System.out.println("Trying to close server socket of NCServer:"+e.getMessage());
// don't care
}
TCPChannel[] channels = getChannels();
Modified: spaces/trunk/src/com/ogoglio/message/TCPChannel.java
===================================================================
--- spaces/trunk/src/com/ogoglio/message/TCPChannel.java 2007-08-09 23:56:22 UTC (rev 242)
+++ spaces/trunk/src/com/ogoglio/message/TCPChannel.java 2007-08-16 17:04:44 UTC (rev 243)
@@ -86,10 +86,12 @@
try {
readerThread.cleanup();
} catch (Exception e) {
+ System.out.println("TCPChannel: Trying to cleanup to readerThread:"+(e.getClass().getName())+":"+e.getMessage());
}
try {
senderQueue.cleanup();
} catch (Exception e) {
+ System.out.println("TCPChannel: Trying to cleanup to senderQueue:"+(e.getClass().getName())+":"+e.getMessage());
}
listener.channelClosed(this);
}
Modified: spaces/trunk/src/com/ogoglio/persist/AccountPersistTasks.java
===================================================================
--- spaces/trunk/src/com/ogoglio/persist/AccountPersistTasks.java 2007-08-09 23:56:22 UTC (rev 242)
+++ spaces/trunk/src/com/ogoglio/persist/AccountPersistTasks.java 2007-08-16 17:04:44 UTC (rev 243)
@@ -21,168 +21,193 @@
public class AccountPersistTasks {
- public static final String ACCOUNT_BY_USERNAME = "com.ogoglio.persist.accountByUsername";
- public static final String ACCOUNT_BY_EMAIL = "com.ogoglio.persist.accountByEmail";
+ public static final String ACCOUNT_BY_USERNAME = "com.ogoglio.persist.accountByUsername";
+ public static final String ACCOUNT_BY_EMAIL = "com.ogoglio.persist.accountByEmail";
- public static final String ACCOUNT_BY_COOKIE = "com.ogoglio.persist.accountByCookie";
+ public static final String ACCOUNT_BY_COOKIE = "com.ogoglio.persist.accountByCookie";
- public static boolean update(final AccountRecord record, final AccountDocument document, SessionFactory sessionFactory) throws PersistException {
- HibernateTask task = new HibernateTask() {
- public Object run(Session hibernateSession) {
- boolean dirty = false;
- if (document.getAccountLevel() != null && !equals(record.getAccountlevel(), document.getAccountLevel())) {
- dirty = true;
- record.setAccountlevel(document.getAccountLevel());
- }
-
- if (document.getHomepage() != null && !equals(record.getHomepage(), document.getHomepage())) {
- dirty = true;
- record.setHomepage(document.getHomepage());
- }
+ public static boolean update(final AccountRecord record,
+ final AccountDocument document, SessionFactory sessionFactory)
+ throws PersistException {
+ HibernateTask task = new HibernateTask() {
+ public Object run(Session hibernateSession) {
+ boolean dirty = false;
+ if (document.getAccountLevel() != null
+ && !equals(record.getAccountlevel(), document
+ .getAccountLevel())) {
+ dirty = true;
+ record.setAccountlevel(document.getAccountLevel());
+ }
- if (document.getFirstName() != null && !equals(record.getFirstName(), document.getFirstName())) {
- dirty = true;
- record.setFirstName(document.getFirstName());
- }
+ if (document.getHomepage() != null
+ && !equals(record.getHomepage(), document.getHomepage())) {
+ dirty = true;
+ record.setHomepage(document.getHomepage());
+ }
- if (document.getLastName() != null && !equals(record.getLastName(), document.getLastName())) {
- dirty = true;
- record.setLastName(document.getLastName());
- }
+ if (document.getFirstName() != null
+ && !equals(record.getFirstName(), document
+ .getFirstName())) {
+ dirty = true;
+ record.setFirstName(document.getFirstName());
+ }
- if (document.getPassword() != null && !equals(record.getPassword(), document.getPassword())) {
- if (AccountRecord.cleanPassword(document.getPassword()) != null) {
- dirty = true;
- record.setPassword(document.getPassword());
- }
- }
+ if (document.getLastName() != null
+ && !equals(record.getLastName(), document.getLastName())) {
+ dirty = true;
+ record.setLastName(document.getLastName());
+ }
- if(document.getDefaultBodyID() != -1) {
- Query bodyQuery = hibernateSession.getNamedQuery(BodyPersistTasks.BODY_BY_ID);
- bodyQuery.setLong("bodyID", document.getDefaultBodyID());
- BodyRecord bodyRec = (BodyRecord)bodyQuery.uniqueResult();
- if(bodyRec != null && bodyRec.getOwnerUsername().equals(record.getUsername())) {
- dirty = true;
- record.setDefaultBodyID(document.getDefaultBodyID());
- }
- }
+ if (document.getPassword() != null
+ && !equals(record.getPassword(), document.getPassword())) {
+ if (AccountRecord.cleanPassword(document.getPassword()) != null) {
+ dirty = true;
+ record.setPassword(document.getPassword());
+ }
+ }
- if(document.getFrozenUntil() != null && !equals(record.getFrozenUntil(), document.getFrozenUntil())) {
- dirty = true;
- if(document.getFrozenUntil().getTime() < System.currentTimeMillis()) {
- record.setFrozenUntil(null);
- } else {
- record.setFrozenUntil(document.getFrozenUntil());
- }
- }
+ if (document.getDefaultBodyID() != -1) {
+ Query bodyQuery = hibernateSession
+ .getNamedQuery(BodyPersistTasks.BODY_BY_ID);
+ bodyQuery.setLong("bodyID", document.getDefaultBodyID());
+ BodyRecord bodyRec = (BodyRecord) bodyQuery.uniqueResult();
+ if (bodyRec != null
+ && bodyRec.getOwnerUsername().equals(
+ record.getUsername())) {
+ dirty = true;
+ record.setDefaultBodyID(document.getDefaultBodyID());
+ }
+ }
- if (dirty) {
- hibernateSession.update(record);
- return Boolean.TRUE;
- }
- return Boolean.FALSE;
- }
- };
- task.setSessionFactory(sessionFactory);
- return "true".equals(task.execute().toString());
- }
+
+ if (document.getFrozenUntil() != null) {
+ if (record.getFrozenUntil()!=document.getFrozenUntil().getTime()) {
+ dirty = true;
+ if (document.getFrozenUntil().getTime() < System.currentTimeMillis()) {
+ record.setNotFrozen();
+ } else {
+ record.setFrozenUntil(document.getFrozenUntil().getTime());
+ }
+ }
+ }
+ if (dirty) {
+ hibernateSession.update(record);
+ return Boolean.TRUE;
+ }
+ return Boolean.FALSE;
+ }
+ };
+ task.setSessionFactory(sessionFactory);
+ return "true".equals(task.execute().toString());
+ }
- public static void update(final AccountRecord record, SessionFactory sessionFactory) throws PersistException {
- HibernateTask task = new HibernateTask() {
- public Object run(Session hibernateSession) {
- hibernateSession.update(record);
- return null;
- }
- };
- task.setSessionFactory(sessionFactory);
- task.execute();
- }
+ public static void update(final AccountRecord record,
+ SessionFactory sessionFactory) throws PersistException {
+ HibernateTask task = new HibernateTask() {
+ public Object run(Session hibernateSession) {
+ hibernateSession.update(record);
+ return null;
+ }
+ };
+ task.setSessionFactory(sessionFactory);
+ task.execute();
+ }
- public static AccountRecord findAccountByCookie(final String cookie, SessionFactory sessionFactory) throws PersistException {
- HibernateTask task = new HibernateTask() {
- public Object run(Session hibernateSession) {
- Query query = hibernateSession.getNamedQuery(ACCOUNT_BY_COOKIE);
- query.setParameter("cookie", cookie);
- AccountRecord rec=(AccountRecord)query.uniqueResult();
- return rec;
- }
- };
- task.setSessionFactory(sessionFactory);
- return (AccountRecord) task.execute();
- }
+ public static AccountRecord findAccountByCookie(final String cookie,
+ SessionFactory sessionFactory) throws PersistException {
+ HibernateTask task = new HibernateTask() {
+ public Object run(Session hibernateSession) {
+ Query query = hibernateSession.getNamedQuery(ACCOUNT_BY_COOKIE);
+ query.setParameter("cookie", cookie);
+ AccountRecord rec = (AccountRecord) query.uniqueResult();
+ return rec;
+ }
+ };
+ task.setSessionFactory(sessionFactory);
+ return (AccountRecord) task.execute();
+ }
- public static AccountRecord[] findAllAccounts(SessionFactory sessionFactory) throws PersistException {
- HibernateTask task = new HibernateTask() {
- public Object run(Session hibernateSession) {
- Query query = hibernateSession.getNamedQuery("com.ogoglio.persist.accounts");
- return query.list().toArray(new AccountRecord[0]);
- }
- };
- task.setSessionFactory(sessionFactory);
- return (AccountRecord[]) task.execute();
- }
+ public static AccountRecord[] findAllAccounts(SessionFactory sessionFactory)
+ throws PersistException {
+ HibernateTask task = new HibernateTask() {
+ public Object run(Session hibernateSession) {
+ Query query = hibernateSession
+ .getNamedQuery("com.ogoglio.persist.accounts");
+ return query.list().toArray(new AccountRecord[0]);
+ }
+ };
+ task.setSessionFactory(sessionFactory);
+ return (AccountRecord[]) task.execute();
+ }
- 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) {
- 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; // XXX really weird semantic: try to create something and get null because it's there?
- }
-
- //IES:debug because unique constraint on this field!
- final String cleanedEmail = AccountRecord.cleanEmail(email);
- query = hibernateSession.getNamedQuery(ACCOUNT_BY_EMAIL);
- query.setParameter("email", email);
- record = (AccountRecord)query.uniqueResult();
- if (record!=null) {
- System.err.println("Whoa! Bad email value!"+email);
- }
-
-
- record = new AccountRecord(username, accountlevel, email);
- hibernateSession.save(record);
- BodyRecord bodyRec = new BodyRecord("Body", record.getUsername());
- hibernateSession.save(bodyRec);
-
- record.setDefaultBodyID(bodyRec.getBodyID());
- hibernateSession.update(record);
- return record;
- }
- };
- task.setSessionFactory(sessionFactory);
- return (AccountRecord) task.execute();
- }
+ 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) {
+ final String cleanedUsername = AccountRecord
+ .cleanUsername(username);
+ Query query = hibernateSession
+ .getNamedQuery(ACCOUNT_BY_USERNAME);
+ query.setParameter("username", cleanedUsername);
- public static AccountRecord findAccountByUsername(String username, SessionFactory sessionFactory) throws PersistException {
- final String cleanedUsername = AccountRecord.cleanUsername(username);
- if (cleanedUsername == null) {
- return null;
- }
- HibernateTask task = new HibernateTask() {
- public Object run(Session hibernateSession) {
- Query query = hibernateSession.getNamedQuery(ACCOUNT_BY_USERNAME);
- query.setParameter("username", cleanedUsername);
- return query.uniqueResult();
- }
- };
- task.setSessionFactory(sessionFactory);
- return (AccountRecord) task.execute();
- }
+ AccountRecord record = (AccountRecord) query.uniqueResult();
+ if (record != null) {
+ return null; // XXX really weird semantic: try to create something and get null because it's there?
+ }
- public static void delete(final AccountRecord accRec,SessionFactory sessionFactory) throws PersistException {
- HibernateTask task = new HibernateTask() {
- public Object run(Session hibernateSession) {
- hibernateSession.delete(accRec);
- return null;
- }
- };
- task.setSessionFactory(sessionFactory);
- task.execute();
-
- }
+ //IES:debug because unique constraint on this field!
+ final String cleanedEmail = AccountRecord.cleanEmail(email);
+ query = hibernateSession.getNamedQuery(ACCOUNT_BY_EMAIL);
+ query.setParameter("email", email);
+ record = (AccountRecord) query.uniqueResult();
+ if (record != null) {
+ System.err.println("Whoa! Bad email value!" + email);
+ }
+
+ record = new AccountRecord(username, accountlevel, email);
+ hibernateSession.save(record);
+ BodyRecord bodyRec = new BodyRecord("Body", record
+ .getUsername());
+ hibernateSession.save(bodyRec);
+
+ record.setDefaultBodyID(bodyRec.getBodyID());
+ hibernateSession.update(record);
+ return record;
+ }
+ };
+ task.setSessionFactory(sessionFactory);
+ return (AccountRecord) task.execute();
+ }
+
+ public static AccountRecord findAccountByUsername(String username,
+ SessionFactory sessionFactory) throws PersistException {
+ final String cleanedUsername = AccountRecord.cleanUsername(username);
+ if (cleanedUsername == null) {
+ return null;
+ }
+ HibernateTask task = new HibernateTask() {
+ public Object run(Session hibernateSession) {
+ Query query = hibernateSession
+ .getNamedQuery(ACCOUNT_BY_USERNAME);
+ query.setParameter("username", cleanedUsername);
+ return query.uniqueResult();
+ }
+ };
+ task.setSessionFactory(sessionFactory);
+ return (AccountRecord) task.execute();
+ }
+
+ public static void delete(final AccountRecord accRec,
+ SessionFactory sessionFactory) throws PersistException {
+ HibernateTask task = new HibernateTask() {
+ public Object run(Session hibernateSession) {
+ hibernateSession.delete(accRec);
+ return null;
+ }
+ };
+ task.setSessionFactory(sessionFactory);
+ task.execute();
+
+ }
}
Modified: spaces/trunk/src/com/ogoglio/persist/AccountRecord.java
===================================================================
--- spaces/trunk/src/com/ogoglio/persist/AccountRecord.java 2007-08-09 23:56:22 UTC (rev 242)
+++ spaces/trunk/src/com/ogoglio/persist/AccountRecord.java 2007-08-16 17:04:44 UTC (rev 243)
@@ -17,6 +17,8 @@
public class AccountRecord {
+ public static final long NO_TIME_VALUE=-97;
+
public static final String ACCOUNT_LEVEL_BASIC = "basic";
public static final String ACCOUNT_LEVEL_ADVANCED = "advanced";
@@ -43,11 +45,11 @@
private String secret = null;
- private Date creationDate = null;
+ private long creationDate = NO_TIME_VALUE;
private String cookie = null;
- private Date frozenUntil = null;
+ private long frozenUntil = NO_TIME_VALUE;
private long defaultBodyId = 1;
@@ -185,11 +187,11 @@
this.cookie = cookie;
}
- public Date getCreationDate() {
- return creationDate;
+ public long getCreationDate() {
+ return creationDate;
}
- public void setCreationDate(Date creationDate) {
+ public void setCreationDate(long creationDate) {
this.creationDate = creationDate;
}
@@ -209,16 +211,16 @@
this.firstName = firstName;
}
- public Date getFrozenUntil() {
+ public long getFrozenUntil() {
return frozenUntil;
}
- public void setFrozenUntil(Date frozenUntil) {
+ public void setFrozenUntil(long frozenUntil) {
this.frozenUntil = frozenUntil;
}
public boolean isFrozen() {
- return frozenUntil != null && System.currentTimeMillis() < frozenUntil.getTime();
+ return frozenUntil != NO_TIME_VALUE && System.currentTimeMillis() < frozenUntil;
}
public String getLastName() {
@@ -260,4 +262,8 @@
public void setDefaultBodyID(long defaultBodyID) {
this.defaultBodyId = defaultBodyID;
}
+
+ public void setNotFrozen() {
+ this.frozenUntil=NO_TIME_VALUE;
+ }
}
Modified: spaces/trunk/src/com/ogoglio/persist/HibernateBase.java
===================================================================
--- spaces/trunk/src/com/ogoglio/persist/HibernateBase.java 2007-08-09 23:56:22 UTC (rev 242)
+++ spaces/trunk/src/com/ogoglio/persist/HibernateBase.java 2007-08-16 17:04:44 UTC (rev 243)
@@ -43,13 +43,14 @@
if (autoDDL!=null) {
- config.setProperty("hibernate.hbm2ddl.auto", "create");
+ config.setProperty("hibernate.hbm2ddl.auto", autoDDL);
}
config.setProperty("hibernate.dialect", dialect);
config.setProperty("hibernate.connection.driver_class", driver);
config.setProperty("hibernate.connection.url", URI);
config.setProperty("hibernate.connection.username", user);
config.setProperty("hibernate.connection.password", pw);
+ config.setProperty("hibernate.show_sql","true");
//always want these
config.setProperty("hibernate.connection.shutdown","true");
config.setProperty("hibernate.connection.pool_size", poolSize);
Modified: spaces/trunk/src/com/ogoglio/persist/Persist.hbm.xml
===================================================================
--- spaces/trunk/src/com/ogoglio/persist/Persist.hbm.xml 2007-08-09 23:56:22 UTC (rev 242)
+++ spaces/trunk/src/com/ogoglio/persist/Persist.hbm.xml 2007-08-16 17:04:44 UTC (rev 243)
@@ -82,7 +82,7 @@
<property name="firstName"/>
<property name="lastName"/>
<property name="homepage"/>
- <property name="creationDate" update="false" />
+ <property name="creationDate" update="false"/>
<property name="cookie"/>
<property name="secret"/>
<property name="frozenUntil"/>
Modified: spaces/trunk/src/com/ogoglio/persist/SpacePersistTasks.java
===================================================================
--- spaces/trunk/src/com/ogoglio/persist/SpacePersistTasks.java 2007-08-09 23:56:22 UTC (rev 242)
+++ spaces/trunk/src/com/ogoglio/persist/SpacePersistTasks.java 2007-08-16 17:04:44 UTC (rev 243)
@@ -13,8 +13,8 @@
limitations under the License. */
package com.ogoglio.persist;
+import java.util.Date;
import java.util.Random;
-import java.util.Vector;
import org.hibernate.Query;
import org.hibernate.Session;
@@ -217,7 +217,8 @@
}
if (account != null) {
- if (account.getFrozenUntil() != null && account.getFrozenUntil().getTime() < System.currentTimeMillis()) {
+ if (account.isFrozen()) {
+ //if (account.getFrozenUntil() != null && account.getFrozenUntil().getTime() > System.currentTimeMillis()) {
return Boolean.FALSE;
}
Modified: spaces/trunk/src/com/ogoglio/sim/site/SimServlet.java
===================================================================
--- spaces/trunk/src/com/ogoglio/sim/site/SimServlet.java 2007-08-09 23:56:22 UTC (rev 242)
+++ spaces/trunk/src/com/ogoglio/sim/site/SimServlet.java 2007-08-16 17:04:44 UTC (rev 243)
@@ -87,6 +87,7 @@
public void destroy() {
super.destroy();
sim.cleanup();
+ System.out.println("Destroy called on SimServlet. Cleaning up sim...");
}
public void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
Modified: spaces/trunk/src/com/ogoglio/site/AccountServlet.java
===================================================================
--- spaces/trunk/src/com/ogoglio/site/AccountServlet.java 2007-08-09 23:56:22 UTC (rev 242)
+++ spaces/trunk/src/com/ogoglio/site/AccountServlet.java 2007-08-16 17:04:44 UTC (rev 243)
@@ -146,7 +146,6 @@
public void doGet(HttpServletRequest request, HttpServletResponse response, String[] pathElements, AccountRecord authedAccount) throws PersistException, ServletException, IOException {
String usernameParam = pathElements[pathElements.length - 1];
-
if (usernameParam == null || usernameParam.trim().length() == 0) {
response.setStatus(HttpServletResponse.SC_NOT_FOUND);
return;
@@ -160,7 +159,6 @@
}
AccountDocument result = createAccountDocument(requestedAccount, authedAccount.equals(requestedAccount) || AccountRecord.ACCOUNT_LEVEL_ADMIN.equals(authedAccount.getAccountlevel()));
-
response.setStatus(HttpServletResponse.SC_OK);
response.setContentType("text/xml");
response.getOutputStream().write(result.toString().getBytes());
@@ -169,7 +167,6 @@
public void doPost(HttpServletRequest request, HttpServletResponse response, String[] pathElements, AccountRecord authedAccount) throws PersistException, ServletException, IOException {
String usernameParam = pathElements[pathElements.length - 1];
-
if (usernameParam == null || usernameParam.trim().length() == 0) {
response.setStatus(HttpServletResponse.SC_NOT_FOUND);
return;
@@ -199,12 +196,12 @@
response.setStatus(HttpServletResponse.SC_FORBIDDEN);
return;
}
- if (requestedAccount.getFrozenUntil() != null && !requestedAccount.getFrozenUntil().equals(updatedDocument.getFrozenUntil())) {
+ if (requestedAccount.getFrozenUntil() != AccountRecord.NO_TIME_VALUE && requestedAccount.getFrozenUntil()!=updatedDocument.getFrozenUntil().getTime()) {
System.err.println("User tried to update own freeze: " + requestedAccount.getUsername());
response.setStatus(HttpServletResponse.SC_FORBIDDEN);
return;
}
- if (requestedAccount.getFrozenUntil() == null && updatedDocument.getFrozenUntil() != null) {
+ if (requestedAccount.getFrozenUntil() !=AccountRecord.NO_TIME_VALUE && updatedDocument.getFrozenUntil() != null) {
System.err.println("User tried to freeze themselves: " + requestedAccount.getUsername());
response.setStatus(HttpServletResponse.SC_FORBIDDEN);
return;
@@ -213,10 +210,11 @@
//TODO if this returns false we really should reflect that in the response
- AccountPersistTasks.update(requestedAccount, updatedDocument, getSessionFactory());
-
+ if (!AccountPersistTasks.update(requestedAccount, updatedDocument, getSessionFactory())) {
+ System.out.println("Warning: ACCOUNT update failed:"+requestedAccount.getUsername());
+ }
+ //AccountPersistTasks.findAccountByUsername(usernameParam, getSessionFactory());
AccountDocument result = createAccountDocument(requestedAccount, true);
-
response.setStatus(HttpServletResponse.SC_OK);
response.setContentType("text/xml");
response.getOutputStream().write(result.toString().getBytes());
Modified: spaces/trunk/src/com/ogoglio/site/AuthServlet.java
===================================================================
--- spaces/trunk/src/com/ogoglio/site/AuthServlet.java 2007-08-09 23:56:22 UTC (rev 242)
+++ spaces/trunk/src/com/ogoglio/site/AuthServlet.java 2007-08-16 17:04:44 UTC (rev 243)
@@ -74,7 +74,7 @@
if (accountRecord == null) {
return null;
}
- if (accountRecord.getFrozenUntil() != null && accountRecord.getFrozenUntil().getTime() > System.currentTimeMillis()) {
+ if (accountRecord.getFrozenUntil() != AccountRecord.NO_TIME_VALUE && accountRecord.getFrozenUntil() > System.currentTimeMillis()) {
return null;
}
if (password != null && !password.equals(accountRecord.getPassword())) {
Modified: spaces/trunk/src/com/ogoglio/site/MessageProxy.java
===================================================================
--- spaces/trunk/src/com/ogoglio/site/MessageProxy.java 2007-08-09 23:56:22 UTC (rev 242)
+++ spaces/trunk/src/com/ogoglio/site/MessageProxy.java 2007-08-16 17:04:44 UTC (rev 243)
@@ -96,6 +96,7 @@
public void cleanup() {
channelServer.cleanup();
+ heartbeatTimer.cancel();
Object[] channels = (Object[]) simChannels.getValues();
for (int i = 0; i < channels.length; i++) {
((TCPChannel) channels[i]).cleanup();
Modified: spaces/trunk/src/com/ogoglio/site/SpaceServlet.java
===================================================================
--- spaces/trunk/src/com/ogoglio/site/SpaceServlet.java 2007-08-09 23:56:22 UTC (rev 242)
+++ spaces/trunk/src/com/ogoglio/site/SpaceServlet.java 2007-08-16 17:04:44 UTC (rev 243)
@@ -68,6 +68,7 @@
if (messageProxy != null) {
messageProxy.cleanup();
}
+ System.out.println("Destroy called on SpaceServlet. Cleaning up proxy....");
} catch (Throwable e) {
e.printStackTrace();
}
Modified: spaces/trunk/src/com/ogoglio/util/PrepareDatabase.java
===================================================================
--- spaces/trunk/src/com/ogoglio/util/PrepareDatabase.java 2007-08-09 23:56:22 UTC (rev 242)
+++ spaces/trunk/src/com/ogoglio/util/PrepareDatabase.java 2007-08-16 17:04:44 UTC (rev 243)
@@ -30,15 +30,17 @@
System.exit(1);
}
PrepareDatabase db= new PrepareDatabase();
+ db.start(false);
db.start(true);
- db.start(false);
System.out.println("Completed successfully. DBs are now ready.");
}
public void setupSessionFactory(boolean isServer) {
+ String autoDDL = "create";
+
if (isServer) {
if (OgoglioProperties.getOgoglioProperty(OgoglioProperties.WHICH_DB).equals(OgoglioProperties.WHICH_MYSQL)) {
- setupSessionFactory("com/ogoglio/persist/Persist.hbm.xml", "create",
+ setupSessionFactory("com/ogoglio/persist/Persist.hbm.xml", autoDDL,
OgoglioProperties.getOgoglioProperty(OgoglioProperties.MYSQL_DB_DIALECT),
OgoglioProperties.getOgoglioProperty(OgoglioProperties.MYSQL_DB_DRIVER),
OgoglioProperties.getOgoglioProperty(OgoglioProperties.MYSQL_DB_SERVER_URI),
@@ -47,7 +49,7 @@
"5");
} else {
- setupSessionFactory("com/ogoglio/persist/Persist.hbm.xml", "create",
+ setupSessionFactory("com/ogoglio/persist/Persist.hbm.xml", autoDDL,
OgoglioProperties.getOgoglioProperty(OgoglioProperties.HSQL_DB_DIALECT),
OgoglioProperties.getOgoglioProperty(OgoglioProperties.HSQL_DB_DRIVER),
OgoglioProperties.getOgoglioProperty(OgoglioProperties.HSQL_DB_SERVER_URI),
@@ -57,7 +59,7 @@
}
} else {
if (OgoglioProperties.getOgoglioProperty(OgoglioProperties.WHICH_DB).equals(OgoglioProperties.WHICH_MYSQL)) {
- setupSessionFactory("com/ogoglio/persist/Persist.hbm.xml", "create",
+ setupSessionFactory("com/ogoglio/persist/Persist.hbm.xml", autoDDL,
OgoglioProperties.getOgoglioProperty(OgoglioProperties.MYSQL_DB_DIALECT),
OgoglioProperties.getOgoglioProperty(OgoglioProperties.MYSQL_DB_DRIVER),
OgoglioProperties.getOgoglioProperty(OgoglioProperties.MYSQL_DB_TEST_URI),
@@ -66,7 +68,7 @@
"5");
} else {
- setupSessionFactory("com/ogoglio/persist/Persist.hbm.xml", "create",
+ setupSessionFactory("com/ogoglio/persist/Persist.hbm.xml", autoDDL,
OgoglioProperties.getOgoglioProperty(OgoglioProperties.HSQL_DB_DIALECT),
OgoglioProperties.getOgoglioProperty(OgoglioProperties.HSQL_DB_DRIVER),
OgoglioProperties.getOgoglioProperty(OgoglioProperties.HSQL_DB_TEST_URI),
@@ -81,6 +83,7 @@
String host = "127.0.0.1";
String siteInfo = "http://"+host+":8080/og"; //configured in server.xml
SessionFactory sessionFactory = getSessionFactory();
+ System.out.println("start:"+isServer+": with session Factory:"+sessionFactory.toString());
try {
ServiceInitializationPersistTasks.initializeLocalSim(new URI(siteInfo), sessionFactory);
ServiceInitializationPersistTasks.initializeLibraryAccount(sessionFactory,host);
Modified: spaces/trunk/src/com/ogoglio/xml/AccountDocument.java
===================================================================
--- spaces/trunk/src/com/ogoglio/xml/AccountDocument.java 2007-08-09 23:56:22 UTC (rev 242)
+++ spaces/trunk/src/com/ogoglio/xml/AccountDocument.java 2007-08-16 17:04:44 UTC (rev 243)
@@ -17,6 +17,8 @@
import java.net.URISyntaxException;
import java.util.Date;
+import com.ogoglio.persist.AccountRecord;
+
import nanoxml.XMLElement;
public class AccountDocument {
@@ -49,7 +51,7 @@
XMLElement data = null;
- public AccountDocument(String username, String accountLevel, String firstName, String lastName, String homepage, String password, String email, String secret, Date creationDate, String cookie, Date frozenUntil, long defaultBodyID) {
+ public AccountDocument(String username, String accountLevel, String firstName, String lastName, String homepage, String password, String email, String secret, long creationDate, String cookie, long frozenUntil, long defaultBodyID) {
data = new XMLElement(NAME);
if (username == null) {
@@ -76,10 +78,10 @@
if (cookie != null)
data.setAttribute(COOKIE, cookie);
- if (creationDate != null)
- data.setAttribute(CREATION_DATE, creationDate.getTime());
- if (frozenUntil != null)
- data.setAttribute(FROZEN_UNTIL, frozenUntil.getTime());
+ if (creationDate != AccountRecord.NO_TIME_VALUE)
+ data.setAttribute(CREATION_DATE, creationDate);
+ if (frozenUntil!=AccountRecord.NO_TIME_VALUE)
+ data.setAttribute(FROZEN_UNTIL, frozenUntil);
if(defaultBodyID > -1)
data.setAttribute(DEFAULT_BODY_ID, defaultBodyID);
}
@@ -95,7 +97,7 @@
}
public AccountDocument(String username) { //used when updating the document, with absent items indicating no change
- this(username, null, null, null, null, null, null, null, null, null, null, 1);
+ this(username, null, null, null, null, null, null, null, AccountRecord.NO_TIME_VALUE, null, AccountRecord.NO_TIME_VALUE, 1);
}
public XMLElement toElement() {
Modified: spaces/trunk/src/com/ogoglio/xml/XMLTests.java
===================================================================
--- spaces/trunk/src/com/ogoglio/xml/XMLTests.java 2007-08-09 23:56:22 UTC (rev 242)
+++ spaces/trunk/src/com/ogoglio/xml/XMLTests.java 2007-08-16 17:04:44 UTC (rev 243)
@@ -52,11 +52,11 @@
private String secret1 = "cat's cradle";
- private Date creationDate1 = new Date();
+ private long creationDate1 = new Date().getTime();
private String cookie1 = "tr1234";
- private Date frozenUntil1 = new Date(System.currentTimeMillis() - 6000000);
+ private long frozenUntil1 = new Date(System.currentTimeMillis() - 6000000).getTime();
private long spaceID1;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <tre...@us...> - 2007-08-10 00:43:17
|
Revision: 242
http://ogoglio.svn.sourceforge.net/ogoglio/?rev=242&view=rev
Author: trevorolio
Date: 2007-08-09 16:56:22 -0700 (Thu, 09 Aug 2007)
Log Message:
-----------
Added a way to get an auth document based on an auth cookie.
Rearranged the build.xml so that the shared files are in a named fileset.
Modified Paths:
--------------
spaces/trunk/build.xml
spaces/trunk/src/com/ogoglio/client/WebAPIClient.java
Modified: spaces/trunk/build.xml
===================================================================
--- spaces/trunk/build.xml 2007-08-09 12:45:17 UTC (rev 241)
+++ spaces/trunk/build.xml 2007-08-09 23:56:22 UTC (rev 242)
@@ -38,7 +38,24 @@
<include name="plugin.jar" />
</fileset>
</path>
-
+
+ <!-- these are files which will end up in ogoglio-shared.jar in Tomcat's shared lib, and not in ogoglio.war -->
+ <fileset id="sharedFiles" dir="${dest}">
+ <include name="com/ogoglio/util/**/*" />
+ <include name="com/ogoglio/media/**/*" />
+ <include name="com/ogoglio/site/AbstractResourceServlet*" />
+ <include name="com/ogoglio/site/AuthServlet*" />
+ <include name="com/ogoglio/site/SiteResource*" />
+ <include name="com/ogoglio/site/DescendingSiteResource*" />
+ <include name="com/ogoglio/site/AuthenticatedSiteResource*" />
+ <include name="com/ogoglio/site/SiteInfo*" />
+ <include name="com/ogoglio/persist/HibernateTask*" />
+ <include name="com/ogoglio/persist/PersistException*" />
+ <include name="com/ogoglio/client/**/*" />
+ <include name="com/ogoglio/xml/**/*" />
+ <include name="nanoxml/*" />
+ </fileset>
+
<target name="compile">
<javac source="1.4" target="1.4" srcdir="${source}" destdir="${dest}" debug="${debug.on}">
<classpath refid="classpath" />
@@ -52,17 +69,7 @@
<target name="sharedJar" depends="compile">
<jar destfile="ogoglio-shared.jar">
- <fileset dir="${dest}">
- <include name="com/ogoglio/util/**/*" />
- <include name="com/ogoglio/media/**/*" />
- <include name="com/ogoglio/site/AbstractResourceServlet*" />
- <include name="com/ogoglio/site/SiteResource*" />
- <include name="com/ogoglio/site/DescendingSiteResource*" />
- <include name="com/ogoglio/site/SiteInfo*" />
- <include name="com/ogoglio/persist/HibernateTask*" />
- <include name="com/ogoglio/persist/PersistException*" />
- <include name="nanoxml/*" />
- </fileset>
+ <fileset refid="sharedFiles" />
</jar>
</target>
Modified: spaces/trunk/src/com/ogoglio/client/WebAPIClient.java
===================================================================
--- spaces/trunk/src/com/ogoglio/client/WebAPIClient.java 2007-08-09 12:45:17 UTC (rev 241)
+++ spaces/trunk/src/com/ogoglio/client/WebAPIClient.java 2007-08-09 23:56:22 UTC (rev 242)
@@ -97,6 +97,14 @@
return new AccountDocument(response);
}
+ public AuthDocument getAuthDocumentByAuthCookie(String authCookie) throws IOException {
+ XMLElement response = wire.fetchAuthenticatedXML(descriptor.getMeAuthURI(), authCookie);
+ if (response == null) {
+ return null;
+ }
+ return new AuthDocument(response);
+ }
+
public DoorDocument getDoorDocument(long spaceID, long doorID) throws IOException {
return new DoorDocument(wire.fetchAuthenticatedXML(descriptor.getDoorURI(spaceID, doorID), authenticator.getAuthCookie()));
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <tre...@us...> - 2007-08-09 12:46:32
|
Revision: 241
http://ogoglio.svn.sourceforge.net/ogoglio/?rev=241&view=rev
Author: trevorolio
Date: 2007-08-09 05:45:17 -0700 (Thu, 09 Aug 2007)
Log Message:
-----------
Put classpath back into build.xml.
Modified Paths:
--------------
spaces/trunk/build.xml
Modified: spaces/trunk/build.xml
===================================================================
--- spaces/trunk/build.xml 2007-08-09 03:40:59 UTC (rev 240)
+++ spaces/trunk/build.xml 2007-08-09 12:45:17 UTC (rev 241)
@@ -24,6 +24,21 @@
</delete>
</target>
+ <path id="classpath">
+ <fileset dir="${webLibDir}">
+ <include name="**/*.jar" />
+ </fileset>
+ <fileset dir="shared-lib">
+ <include name="**/*.jar" />
+ </fileset>
+ <fileset dir="${tomcatHome}/common/lib/">
+ <include name="**/*.jar" />
+ </fileset>
+ <fileset dir="${java.home}/lib/">
+ <include name="plugin.jar" />
+ </fileset>
+ </path>
+
<target name="compile">
<javac source="1.4" target="1.4" srcdir="${source}" destdir="${dest}" debug="${debug.on}">
<classpath refid="classpath" />
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <tre...@us...> - 2007-08-09 03:40:56
|
Revision: 240
http://ogoglio.svn.sourceforge.net/ogoglio/?rev=240&view=rev
Author: trevorolio
Date: 2007-08-08 20:40:59 -0700 (Wed, 08 Aug 2007)
Log Message:
-----------
Added another piece of the site code to the shared jar.
At some point we should clearly delineate what is shared and what is specific to the Og web app.
Modified Paths:
--------------
spaces/trunk/build.xml
Modified: spaces/trunk/build.xml
===================================================================
--- spaces/trunk/build.xml 2007-08-08 18:33:54 UTC (rev 239)
+++ spaces/trunk/build.xml 2007-08-09 03:40:59 UTC (rev 240)
@@ -42,6 +42,7 @@
<include name="com/ogoglio/media/**/*" />
<include name="com/ogoglio/site/AbstractResourceServlet*" />
<include name="com/ogoglio/site/SiteResource*" />
+ <include name="com/ogoglio/site/DescendingSiteResource*" />
<include name="com/ogoglio/site/SiteInfo*" />
<include name="com/ogoglio/persist/HibernateTask*" />
<include name="com/ogoglio/persist/PersistException*" />
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <tre...@us...> - 2007-08-08 18:33:56
|
Revision: 239
http://ogoglio.svn.sourceforge.net/ogoglio/?rev=239&view=rev
Author: trevorolio
Date: 2007-08-08 11:33:54 -0700 (Wed, 08 Aug 2007)
Log Message:
-----------
Changed ogoglio.js defined escape(...) and unescape(...) to be escapeHTML(...) and unescapeHTML(...) so that they don't conflict with javascript's native escape(...) and unescape(...), which are used for url [de|en]coding.
Modified Paths:
--------------
spaces/trunk/build.xml
spaces/trunk/war/account.html
spaces/trunk/war/admin.html
spaces/trunk/war/body.html
spaces/trunk/war/doorPopup.html
spaces/trunk/war/inventory.html
spaces/trunk/war/ogoglio.js
spaces/trunk/war/spaceEditor.html
spaces/trunk/war/spacePopulation.html
spaces/trunk/war/spaceSettings.html
spaces/trunk/war/spaceui.js
spaces/trunk/war/templateEditor.html
Modified: spaces/trunk/build.xml
===================================================================
--- spaces/trunk/build.xml 2007-08-07 00:22:09 UTC (rev 238)
+++ spaces/trunk/build.xml 2007-08-08 18:33:54 UTC (rev 239)
@@ -43,6 +43,9 @@
<include name="com/ogoglio/site/AbstractResourceServlet*" />
<include name="com/ogoglio/site/SiteResource*" />
<include name="com/ogoglio/site/SiteInfo*" />
+ <include name="com/ogoglio/persist/HibernateTask*" />
+ <include name="com/ogoglio/persist/PersistException*" />
+ <include name="nanoxml/*" />
</fileset>
</jar>
</target>
Modified: spaces/trunk/war/account.html
===================================================================
--- spaces/trunk/war/account.html 2007-08-07 00:22:09 UTC (rev 238)
+++ spaces/trunk/war/account.html 2007-08-08 18:33:54 UTC (rev 239)
@@ -87,9 +87,9 @@
if("true" == banned){
tableHTML += "<td>banned</td>";
} else {
- tableHTML += "<td>" + escape(role) + "</td>";
+ tableHTML += "<td>" + escapeHTML(role) + "</td>";
}
- tableHTML += "<td><a href='space.html?spaceID=" + spaceID + "'>Space " + escape(spaceID) + "</a></td>";
+ tableHTML += "<td><a href='space.html?spaceID=" + spaceID + "'>Space " + escapeHTML(spaceID) + "</a></td>";
tableHTML += "</tr>";
}
spaceMembershipTable.innerHTML = "<table>" + tableHTML + "</table>";
@@ -119,7 +119,7 @@
var spaceID = spaceListXML.childNodes[i].getAttribute("spaceid");
var displayName = spaceListXML.childNodes[i].getAttribute("displayname");
tableHTML += "<tr>";
- tableHTML += "<td>" + escape(displayName) + "</td>";
+ tableHTML += "<td>" + escapeHTML(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 += "</tr>";
@@ -165,10 +165,10 @@
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));
+ accountXML.setAttribute("firstname", escapeHTML(document.getElementById("firstname").value));
+ accountXML.setAttribute("lastname", escapeHTML(document.getElementById("lastname").value));
+ accountXML.setAttribute("homepage", escapeHTML(document.getElementById("homepage").value));
+ accountXML.setAttribute("password", escapeHTML(document.getElementById("password").value));
updateAccountDocument(accountXML, handleAccount);
profileTable.innerHTML = "saving...";
}
@@ -179,16 +179,16 @@
return "";
}
if(link){
- return "<tr><th>" + heading + ":</th><td><a rel='nofollow' href='" + escape(value) +"'>" + escape(value) + "</a></td></tr>\n";
+ return "<tr><th>" + heading + ":</th><td><a rel='nofollow' href='" + escapeHTML(value) +"'>" + escapeHTML(value) + "</a></td></tr>\n";
} else {
- return "<tr><th>" + heading + ":</th><td>" + escape(value) + "</td></tr>\n";
+ return "<tr><th>" + heading + ":</th><td>" + escapeHTML(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";
+ var result = "<tr><th>" + heading + ":</th><td><input id='" + field + "' name='" + field + "' type='text' value='" + escapeHTML(nonNullValue) + "' /></td><td>" + escapeHTML(nonNullComment) + "</td></tr>\n";
return result;
}
Modified: spaces/trunk/war/admin.html
===================================================================
--- spaces/trunk/war/admin.html 2007-08-07 00:22:09 UTC (rev 238)
+++ spaces/trunk/war/admin.html 2007-08-08 18:33:54 UTC (rev 239)
@@ -171,10 +171,10 @@
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));
+ accountXML.setAttribute("firstname", escapeHTML(document.getElementById("firstname").value));
+ accountXML.setAttribute("lastname", escapeHTML(document.getElementById("lastname").value));
+ accountXML.setAttribute("homepage", escapeHTML(document.getElementById("homepage").value));
+ accountXML.setAttribute("password", escapeHTML(document.getElementById("password").value));
updateAccountDocument(accountXML, handleAccount);
profileTable.innerHTML = "saving...";
}
@@ -185,16 +185,16 @@
return "";
}
if(link){
- return "<tr><th>" + heading + ":</th><td><a rel='nofollow' href='" + escape(value) +"'>" + escape(value) + "</a></td></tr>\n";
+ return "<tr><th>" + heading + ":</th><td><a rel='nofollow' href='" + escapeHTML(value) +"'>" + escapeHTML(value) + "</a></td></tr>\n";
} else {
- return "<tr><th>" + heading + ":</th><td>" + escape(value) + "</td></tr>\n";
+ return "<tr><th>" + heading + ":</th><td>" + escapeHTML(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";
+ var result = "<tr><th>" + heading + ":</th><td><input id='" + field + "' name='" + field + "' type='text' value='" + escapeHTML(nonNullValue) + "' /></td><td>" + escapeHTML(nonNullComment) + "</td></tr>\n";
return result;
}
Modified: spaces/trunk/war/body.html
===================================================================
--- spaces/trunk/war/body.html 2007-08-07 00:22:09 UTC (rev 238)
+++ spaces/trunk/war/body.html 2007-08-08 18:33:54 UTC (rev 239)
@@ -65,7 +65,7 @@
return;
}
bodyXML = xml;
- titleElement.innerHTML = escape(bodyXML.getAttribute("displayname"));
+ titleElement.innerHTML = escapeHTML(bodyXML.getAttribute("displayname"));
writeApplet();
}
Modified: spaces/trunk/war/doorPopup.html
===================================================================
--- spaces/trunk/war/doorPopup.html 2007-08-07 00:22:09 UTC (rev 238)
+++ spaces/trunk/war/doorPopup.html 2007-08-08 18:33:54 UTC (rev 239)
@@ -55,7 +55,7 @@
function linkChangeGo(){
if(linkForm.goButton.value == 'change'){
- linkForm.innerHTML = "<input id='linkInput' type='text' value='" + escape(doorXML.getAttribute('link')) + "' size='30' style='font-size: 1.2em;' />";
+ linkForm.innerHTML = "<input id='linkInput' type='text' value='" + escapeHTML(doorXML.getAttribute('link')) + "' size='30' style='font-size: 1.2em;' />";
linkForm.innerHTML += "<input id='goButton' type='submit' onclick='linkChangeGo(); return false;' value='save' />";
} else {
var linkValue = trim(linkForm.linkInput.value);
@@ -63,7 +63,7 @@
doorXML.setAttribute('link', linkValue);
updateDoor(spaceID, doorXML, handleDoorDocument);
}
- linkForm.innerHTML = escape(doorXML.getAttribute('link'));
+ linkForm.innerHTML = escapeHTML(doorXML.getAttribute('link'));
linkForm.innerHTML += "<input id='goButton' type='submit' onclick='linkChangeGo(); return false;' value='change' />";
}
}
@@ -89,7 +89,7 @@
//NOTE: the current viewer currently scales all dimensions using scalex
scaleInput.value = parseFloat(doorXML.getAttribute('scalex')).toFixed(4);
- linkForm.innerHTML = escape(doorXML.getAttribute('link')) + " <input type='submit' id='goButton' onclick='linkChangeGo(); return false;' value='change' />";
+ linkForm.innerHTML = escapeHTML(doorXML.getAttribute('link')) + " <input type='submit' id='goButton' onclick='linkChangeGo(); return false;' value='change' />";
}
Modified: spaces/trunk/war/inventory.html
===================================================================
--- spaces/trunk/war/inventory.html 2007-08-07 00:22:09 UTC (rev 238)
+++ spaces/trunk/war/inventory.html 2007-08-08 18:33:54 UTC (rev 239)
@@ -131,11 +131,11 @@
continue;
}
tableHTML += "<tr>";
- tableHTML += "<td>" + escape(templateListXML.childNodes[i].getAttribute('displayname')) + "</td>";
+ tableHTML += "<td>" + escapeHTML(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 += "<td><form onsubmit='deletePossession(\"" + escapeHTML(requestedUsername) + "\", " + possID + ", handleChangePossession); return false;'><input type='submit' value='delete'/></form></td>";
tableHTML += "</tr>";
}
@@ -154,7 +154,7 @@
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 += "<option value='" + listSpaceID + "'>" + escapeHTML(spaceName) + "</option>";
}
html += "</select></form>";
@@ -220,7 +220,7 @@
var id = xml.childNodes[i].getAttribute("templateid");
var displayName = xml.childNodes[i].getAttribute("displayname");
tableHTML += "<tr>";
- tableHTML += "<td>" + escape(displayName) + "</td>";
+ tableHTML += "<td>" + escapeHTML(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>";
Modified: spaces/trunk/war/ogoglio.js
===================================================================
--- spaces/trunk/war/ogoglio.js 2007-08-07 00:22:09 UTC (rev 238)
+++ spaces/trunk/war/ogoglio.js 2007-08-08 18:33:54 UTC (rev 239)
@@ -190,7 +190,7 @@
if (end == -1) {
end = dc.length;
}
- return unescape(dc.substring(begin + prefix.length, end));
+ return unescapeHTML(dc.substring(begin + prefix.length, end));
}
function debug(message){
@@ -207,7 +207,7 @@
var attributes = xml.attributes;
for (var i = 0; i < attributes.length; i++){
- result += " " + attributes.item(i).name.toLowerCase() + "='" + escape(attributes.item(i).value) + "'";
+ result += " " + attributes.item(i).name.toLowerCase() + "='" + escapeHTML(attributes.item(i).value) + "'";
}
var hasText = (typeof xml.text != "undefined") && xml.text.length != 0;
@@ -230,14 +230,14 @@
return result;
}
-function escape(xml){
+function escapeHTML(xml){
if(xml == null || xml.length == 0){
return xml;
}
return xml.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'");
};
-function unescape(xml){
+function unescapeHTML(xml){
return xml.replace(/'/g,"'").replace(/"/g,"\"").replace(/>/g,">").replace(/</g,"<").replace(/&/g,"&");
};
@@ -510,7 +510,7 @@
function createSpace(username, spaceName, listener){
var bodyXML = document.createElement("space");
bodyXML.setAttribute("ownerusername", username);
- bodyXML.setAttribute("displayname", escape(spaceName));
+ bodyXML.setAttribute("displayname", escapeHTML(spaceName));
var manager = new XMLRequestManager(appPath + "/space/", new BasicHTTPListener(listener));
manager.setMethod("POST");
manager.send(serializeXML(bodyXML));
@@ -578,7 +578,7 @@
function createTemplate(username, templateName, listener){
var xml = document.createElement("template");
xml.setAttribute("ownerusername", username);
- xml.setAttribute("displayname", escape(templateName));
+ xml.setAttribute("displayname", escapeHTML(templateName));
var manager = new XMLRequestManager(appPath + "/account/" + username + "/template/", new BasicHTTPListener(listener));
manager.setMethod("POST");
manager.send(serializeXML(xml));
@@ -677,7 +677,7 @@
function createDoor(spaceID, displayName, templateID, templateOwner, link, listener){
var xml = document.createElement("door");
- xml.setAttribute("displayname", escape(displayName));
+ xml.setAttribute("displayname", escapeHTML(displayName));
xml.setAttribute("templateid", templateID);
xml.setAttribute("templateowner", templateOwner);
xml.setAttribute("link", link);
Modified: spaces/trunk/war/spaceEditor.html
===================================================================
--- spaces/trunk/war/spaceEditor.html 2007-08-07 00:22:09 UTC (rev 238)
+++ spaces/trunk/war/spaceEditor.html 2007-08-08 18:33:54 UTC (rev 239)
@@ -93,7 +93,7 @@
spaceDoc = xml;
- titleElement.innerHTML = 'Space Editor: ' + escape(spaceDoc.getAttribute('displayname')) +' <input type="submit" id="titleFormGoButton" value="rename" />';
+ titleElement.innerHTML = 'Space Editor: ' + escapeHTML(spaceDoc.getAttribute('displayname')) +' <input type="submit" id="titleFormGoButton" value="rename" />';
enter.innerHTML = '<a href="space.html?spaceID=' + spaceID +'">Enter this space »</a>';
var pubHTML = 'This space is <select id="pubSelect" onchange="pubFormGo();" name="publicity">';
@@ -154,7 +154,7 @@
var thingID = xml.childNodes[i].getAttribute("thingid");
tableHTML += "<tr>";
var thingURL = "thingPopup.html?thingID=" + thingID + "&spaceID=" + spaceID;
- tableHTML += "<td><a onclick='popUp(\"" + thingURL + "\", false, 375, 450); return false;' href='index.html'>" + clip(escape(displayName), 25, "...") + "</a></td>";
+ tableHTML += "<td><a onclick='popUp(\"" + thingURL + "\", false, 375, 450); return false;' href='index.html'>" + clip(escapeHTML(displayName), 25, "...") + "</a></td>";
tableHTML += "<td><form onsubmit='thingDeleteGo(" + thingID + "); return false;' /><input type='submit' value='move to inventory' /></form></td>"
tableHTML += "<td><form onsubmit='reloadThing(" + spaceID + ", "+ thingID + "); return false;'><input type='submit' value='reload'/></form></td>";
tableHTML += "</tr>";
@@ -205,8 +205,8 @@
var doorID = xml.childNodes[i].getAttribute("doorid");
var displayName = xml.childNodes[i].getAttribute("displayname");
var doorURL = "doorPopup.html?doorID=" + doorID + "&spaceID=" + spaceID;
- tableHTML += "<td><a onclick='popUp(\"" + doorURL + "\", false, 400, 650); return false;' href='index.html'>" + clip(escape(displayName), 25, "...") + "</a></td>";
- tableHTML += "<td>" + escape(xml.childNodes[i].getAttribute("link")) + "</td></tr>";
+ tableHTML += "<td><a onclick='popUp(\"" + doorURL + "\", false, 400, 650); return false;' href='index.html'>" + clip(escapeHTML(displayName), 25, "...") + "</a></td>";
+ tableHTML += "<td>" + escapeHTML(xml.childNodes[i].getAttribute("link")) + "</td></tr>";
}
doorsTable.innerHTML = "<table>" + tableHTML + "</table>";
@@ -320,13 +320,13 @@
function titleFormGo(){
var goButton = document.getElementById("titleFormGoButton");
if(goButton.value == "rename"){
- titleElement.innerHTML = '<input type="text" id="titleInput" style="font-size: 1.5em;" value="' + escape(spaceDoc.getAttribute('displayname')) + '" />';
+ titleElement.innerHTML = '<input type="text" id="titleInput" style="font-size: 1.5em;" value="' + escapeHTML(spaceDoc.getAttribute('displayname')) + '" />';
titleElement.innerHTML += '<input value="save" type="submit" id="titleFormGoButton" />';
} else if(goButton.value == "save"){
var newTitle = titleForm.titleInput.value;
if(newTitle != null && trim(newTitle).length != 0){
goButton.enabled = false;
- spaceDoc.setAttribute('displayname', escape(trim(newTitle)));
+ spaceDoc.setAttribute('displayname', escapeHTML(trim(newTitle)));
updateSpaceDocument(spaceDoc, handleSpaceDocument);
} else {
handleSpaceDocument(spaceDoc);
Modified: spaces/trunk/war/spacePopulation.html
===================================================================
--- spaces/trunk/war/spacePopulation.html 2007-08-07 00:22:09 UTC (rev 238)
+++ spaces/trunk/war/spacePopulation.html 2007-08-08 18:33:54 UTC (rev 239)
@@ -55,7 +55,7 @@
spaceDoc = xml;
- titleElement.innerHTML = 'Space Population: ' + escape(spaceDoc.getAttribute('displayname'));
+ titleElement.innerHTML = 'Space Population: ' + escapeHTML(spaceDoc.getAttribute('displayname'));
requestUserList(spaceID, handleUserList);
}
@@ -75,8 +75,8 @@
}
var username = usersDoc.childNodes[i].getAttribute('username')
HTML += '<tr>';
- HTML += '<td>' + escape(username) + '</td>';
- HTML += '<td><form onsubmit="goBoot(\'' + escape(username) + '\'); return false;"><input type="submit" value="boot" /></form></td>';
+ HTML += '<td>' + escapeHTML(username) + '</td>';
+ HTML += '<td><form onsubmit="goBoot(\'' + escapeHTML(username) + '\'); return false;"><input type="submit" value="boot" /></form></td>';
HTML += '</tr>';
}
userTable.innerHTML = "<table>" + HTML + "</table>";
Modified: spaces/trunk/war/spaceSettings.html
===================================================================
--- spaces/trunk/war/spaceSettings.html 2007-08-07 00:22:09 UTC (rev 238)
+++ spaces/trunk/war/spaceSettings.html 2007-08-08 18:33:54 UTC (rev 239)
@@ -54,8 +54,8 @@
var formHTML = "";
if(form.goButton.value == "edit"){
var value = form.settingValue.value;
- formHTML += "<input id='key' type='hidden' value='" + escape(key) + "' />";
- formHTML += "<input id='settingValue' type='input' value='" + escape(value) + "' />";
+ formHTML += "<input id='key' type='hidden' value='" + escapeHTML(key) + "' />";
+ formHTML += "<input id='settingValue' type='input' value='" + escapeHTML(value) + "' />";
formHTML += " <input id='goButton' type='submit' value='save' />";
} else if(form.goButton.value == "save"){
var value = form.settingValue.value;
@@ -86,12 +86,12 @@
var key = xml.childNodes[i].getAttribute("key");
var value = xml.childNodes[i].firstChild.nodeValue;
tableHTML += "<tr>";
- tableHTML += "<td>" + escape(key) + "</td>";
+ tableHTML += "<td>" + escapeHTML(key) + "</td>";
tableHTML += "<td>";
tableHTML += "<form onsubmit='editFormGo(this); return false;'>";
- tableHTML += "<input id='key' type='hidden' value='" + escape(key) + "' />";
- tableHTML += "<input id='settingValue' type='hidden' value='" + escape(value) + "' />";
- tableHTML += escape(value);
+ tableHTML += "<input id='key' type='hidden' value='" + escapeHTML(key) + "' />";
+ tableHTML += "<input id='settingValue' type='hidden' value='" + escapeHTML(value) + "' />";
+ tableHTML += escapeHTML(value);
tableHTML += " <input id='goButton' type='submit' value='edit' />";
tableHTML += "</form></td>";
tableHTML += "</tr>";
Modified: spaces/trunk/war/spaceui.js
===================================================================
--- spaces/trunk/war/spaceui.js 2007-08-07 00:22:09 UTC (rev 238)
+++ spaces/trunk/war/spaceui.js 2007-08-08 18:33:54 UTC (rev 239)
@@ -105,7 +105,7 @@
displayName = displayName + "";
link = link + "";
- displayChatMessage("Link: <a onclick='popUp(this.href, true); return false;' href='" + link + "'>" + escape(displayName) + "</a>");
+ displayChatMessage("Link: <a onclick='popUp(this.href, true); return false;' href='" + link + "'>" + escapeHTML(displayName) + "</a>");
}
//called by the viewer applet
Modified: spaces/trunk/war/templateEditor.html
===================================================================
--- spaces/trunk/war/templateEditor.html 2007-08-07 00:22:09 UTC (rev 238)
+++ spaces/trunk/war/templateEditor.html 2007-08-08 18:33:54 UTC (rev 239)
@@ -56,7 +56,7 @@
}
templateDoc = xml;
- titleElement.innerHTML = "Template: " + escape(templateDoc.getAttribute('displayname')) + " <input id='titleFormGoButton' type='submit' value='rename' onclick='titleFormGo(); return false;' />";
+ titleElement.innerHTML = "Template: " + escapeHTML(templateDoc.getAttribute('displayname')) + " <input id='titleFormGoButton' type='submit' value='rename' onclick='titleFormGo(); return false;' />";
obj0Form.action = appPath + "/account/" + authedUsername + "/template/" + templateID + "/geometry/data/0";
obj0Form.onsubmit = null;
@@ -84,13 +84,13 @@
function titleFormGo(){
var goButton = document.getElementById("titleFormGoButton");
if(goButton.value == "rename"){
- titleElement.innerHTML = '<input type="text" id="titleInput" style="font-size: 1.5em;" value="' + escape(templateDoc.getAttribute('displayname')) + '" />';
+ titleElement.innerHTML = '<input type="text" id="titleInput" style="font-size: 1.5em;" value="' + escapeHTML(templateDoc.getAttribute('displayname')) + '" />';
titleElement.innerHTML += '<input value="save" type="submit" id="titleFormGoButton" />';
} else if(goButton.value == "save"){
var newTitle = titleForm.titleInput.value;
if(newTitle != null && trim(newTitle).length != 0){
goButton.enabled = false;
- templateDoc.setAttribute('displayname', escape(trim(newTitle)));
+ templateDoc.setAttribute('displayname', escapeHTML(trim(newTitle)));
updateTemplate(templateDoc, handleTemplateDocument);
} else {
handleTemplateDocument(templateDoc);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <tre...@us...> - 2007-08-07 00:22:08
|
Revision: 238
http://ogoglio.svn.sourceforge.net/ogoglio/?rev=238&view=rev
Author: trevorolio
Date: 2007-08-06 17:22:09 -0700 (Mon, 06 Aug 2007)
Log Message:
-----------
Moved all of the jars our of war/WEB-INF/lib/ and into shared-lib/ so they should be put in ${CATALINA_HOME}/shared/lib/ instead of built into the ogoglio.war (as Gal suggested I do ages ago :-).
Added a sharedJar target to build.xml which will build some of the ogoglio classes which could be used by other webapps in the same tomcat instance, say for custom apps built on top of Ogoglio spaces.
That new target will build ogoglio-shared.jar which should also be placed in ${CATALINA_HOME}/shared/lib/
Modified Paths:
--------------
spaces/trunk/.classpath
spaces/trunk/build.xml
spaces/trunk/src/com/ogoglio/sim/Sim.java
spaces/trunk/src/com/ogoglio/sim/SpaceSimulator.java
Added Paths:
-----------
spaces/trunk/shared-lib/
spaces/trunk/shared-lib/antlr-2.7.5H3.jar
spaces/trunk/shared-lib/asm-attrs.jar
spaces/trunk/shared-lib/asm.jar
spaces/trunk/shared-lib/cglib-2.1.jar
spaces/trunk/shared-lib/cglib-nodep-2.1_2.jar
spaces/trunk/shared-lib/commons-codec-1.3.jar
spaces/trunk/shared-lib/commons-collections-2.1.1.jar
spaces/trunk/shared-lib/commons-fileupload-1.1.1.jar
spaces/trunk/shared-lib/commons-httpclient-3.0.1.jar
spaces/trunk/shared-lib/commons-io-1.3.jar
spaces/trunk/shared-lib/commons-logging-1.0.4.jar
spaces/trunk/shared-lib/dom4j-1.6.jar
spaces/trunk/shared-lib/ehcache-1.1.jar
spaces/trunk/shared-lib/hibernate3.jar
spaces/trunk/shared-lib/hsqldb.jar
spaces/trunk/shared-lib/js.jar
spaces/trunk/shared-lib/jta.jar
spaces/trunk/shared-lib/junit-3.8.1.jar
spaces/trunk/shared-lib/junit.jar
spaces/trunk/shared-lib/log4j-1.2.9.jar
spaces/trunk/shared-lib/mysql-connector-java-3.1.11-bin.jar
spaces/trunk/shared-lib/rmock-2.0.0.jar
spaces/trunk/shared-lib/xbean.jar
Removed Paths:
-------------
spaces/trunk/war/WEB-INF/lib/antlr-2.7.5H3.jar
spaces/trunk/war/WEB-INF/lib/asm-attrs.jar
spaces/trunk/war/WEB-INF/lib/asm.jar
spaces/trunk/war/WEB-INF/lib/cglib-2.1.jar
spaces/trunk/war/WEB-INF/lib/cglib-nodep-2.1_2.jar
spaces/trunk/war/WEB-INF/lib/commons-codec-1.3.jar
spaces/trunk/war/WEB-INF/lib/commons-collections-2.1.1.jar
spaces/trunk/war/WEB-INF/lib/commons-fileupload-1.1.1.jar
spaces/trunk/war/WEB-INF/lib/commons-httpclient-3.0.1.jar
spaces/trunk/war/WEB-INF/lib/commons-io-1.3.jar
spaces/trunk/war/WEB-INF/lib/commons-logging-1.0.4.jar
spaces/trunk/war/WEB-INF/lib/dom4j-1.6.jar
spaces/trunk/war/WEB-INF/lib/ehcache-1.1.jar
spaces/trunk/war/WEB-INF/lib/hibernate3.jar
spaces/trunk/war/WEB-INF/lib/hsqldb.jar
spaces/trunk/war/WEB-INF/lib/js.jar
spaces/trunk/war/WEB-INF/lib/jta.jar
spaces/trunk/war/WEB-INF/lib/junit-3.8.1.jar
spaces/trunk/war/WEB-INF/lib/junit.jar
spaces/trunk/war/WEB-INF/lib/log4j-1.2.9.jar
spaces/trunk/war/WEB-INF/lib/mysql-connector-java-3.1.11-bin.jar
spaces/trunk/war/WEB-INF/lib/rmock-2.0.0.jar
spaces/trunk/war/WEB-INF/lib/xbean.jar
Property Changed:
----------------
spaces/trunk/
Property changes on: spaces/trunk
___________________________________________________________________
Name: svn:ignore
- test
db
ogoglio.war
javadoc
+ test
db
ogoglio.war
ogoglio-shared.jar
javadoc
Modified: spaces/trunk/.classpath
===================================================================
--- spaces/trunk/.classpath 2007-08-06 23:44:42 UTC (rev 237)
+++ spaces/trunk/.classpath 2007-08-07 00:22:09 UTC (rev 238)
@@ -4,29 +4,31 @@
<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/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"/>
- <classpathentry kind="lib" path="war/WEB-INF/lib/hsqldb.jar"/>
- <classpathentry kind="lib" path="war/WEB-INF/lib/hibernate3.jar"/>
- <classpathentry kind="lib" path="war/WEB-INF/lib/ehcache-1.1.jar"/>
- <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/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"/>
- <classpathentry kind="lib" path="war/WEB-INF/lib/commons-fileupload-1.1.1.jar"/>
- <classpathentry kind="lib" path="war/WEB-INF/lib/commons-io-1.3.jar"/>
- <classpathentry kind="lib" path="war/WEB-INF/lib/xbean.jar"/>
- <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="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="lib" path="shared-lib/xbean.jar"/>
+ <classpathentry kind="lib" path="shared-lib/rmock-2.0.0.jar"/>
+ <classpathentry kind="lib" path="shared-lib/mysql-connector-java-3.1.11-bin.jar"/>
+ <classpathentry kind="lib" path="shared-lib/log4j-1.2.9.jar"/>
+ <classpathentry kind="lib" path="shared-lib/junit-3.8.1.jar"/>
+ <classpathentry kind="lib" path="shared-lib/junit.jar"/>
+ <classpathentry kind="lib" path="shared-lib/jta.jar"/>
+ <classpathentry kind="lib" path="shared-lib/js.jar"/>
+ <classpathentry kind="lib" path="shared-lib/hsqldb.jar"/>
+ <classpathentry kind="lib" path="shared-lib/hibernate3.jar"/>
+ <classpathentry kind="lib" path="shared-lib/ehcache-1.1.jar"/>
+ <classpathentry kind="lib" path="shared-lib/dom4j-1.6.jar"/>
+ <classpathentry kind="lib" path="shared-lib/commons-collections-2.1.1.jar"/>
+ <classpathentry kind="lib" path="shared-lib/cglib-nodep-2.1_2.jar"/>
+ <classpathentry kind="lib" path="shared-lib/cglib-2.1.jar"/>
+ <classpathentry kind="lib" path="shared-lib/asm-attrs.jar"/>
+ <classpathentry kind="lib" path="shared-lib/asm.jar"/>
+ <classpathentry kind="lib" path="shared-lib/commons-logging-1.0.4.jar"/>
+ <classpathentry kind="lib" path="shared-lib/commons-io-1.3.jar"/>
+ <classpathentry kind="lib" path="shared-lib/commons-httpclient-3.0.1.jar"/>
+ <classpathentry kind="lib" path="shared-lib/commons-fileupload-1.1.1.jar"/>
+ <classpathentry kind="lib" path="shared-lib/commons-codec-1.3.jar"/>
+ <classpathentry kind="lib" path="shared-lib/antlr-2.7.5H3.jar"/>
<classpathentry kind="output" path="war/WEB-INF/classes"/>
</classpath>
Modified: spaces/trunk/build.xml
===================================================================
--- spaces/trunk/build.xml 2007-08-06 23:44:42 UTC (rev 237)
+++ spaces/trunk/build.xml 2007-08-07 00:22:09 UTC (rev 238)
@@ -6,131 +6,11 @@
<property name="webLibDir" value="./war/WEB-INF/lib/" />
<property name="warName" value="ogoglio.war" />
- <!--code coverage with emma -->
- <property name="emmaData" value="working/emma"/>
- <property name="coverage.dir" value="${emmaData}/reports/emma" /> <!-- directory which emma coverage reports will be written to -->
- <property name="instr.dir" value="${emmaData}/target/emmainstr" /> <!-- directory which emma instrumentation classes will be written to -->
- <property name="emma.dir" value="dev-lib/emma" /> <!-- directory that contains emma.jar and emma_ant.jar -->
- <property name="emma.source_classes" value="${dest}"/>
- <!-- Set emma.lib to refer to the list of EMMA jar files -->
- <path id="emma.lib" >
- <fileset dir="${emma.dir}">
- <include name="*.jar"/>
- </fileset>
- </path>
-
- <!-- which classes to work on -->
- <path id="emma.coverage.classes" >
- <pathelement location="${dest}" />
- </path>
- <!-- Load <emma> and <emmajava> custom tasks so that they can be used in ANT -->
- <taskdef resource="emma_ant.properties" classpathref="emma.lib" />
-
- <path id="classpath">
- <fileset dir="${webLibDir}">
- <include name="**/*.jar" />
- </fileset>
- <fileset dir="${tomcatHome}/common/lib/">
- <include name="**/*.jar" />
- </fileset>
- <fileset dir="${java.home}/lib/">
- <include name="plugin.jar" />
- </fileset>
- </path>
-
- <!-- Enable Emma -->
- <target name="emma" description="turns on EMMA's instrumentation/reporting" >
-
- <property name="emma.enabled" value="true" />
-
- <!-- EMMA instr class output directory (it is important to create this property only when EMMA is enabled) -->
- <mkdir dir="${instr.dir}" />
-
- <!-- this property, if overriden via -Demma.filter=<list of filter specs>
- on ANT's command line, will set the coverage filter; by default,
- all classes found in 'emma.coverage.classes' pathref will be instrumented:
- -->
- <property name="emma.filter" value="+com.ogoglio.*,-*Test*,-*Spec*" />
- <property name="debug.on" value="true"/>
- </target>
-
- <target name="coverage" depends="cleanInstrumented,emma,test">
- </target>
-
- <target name="test" depends="compile">
- <!-- ======================================================================= -->
- <!-- EMMA INSTRUMENTATION -->
- <!-- ======================================================================= -->
- <!-- Instrument the classes, this takes the normal classes, and makes instrumented classes instead -->
- <!-- Note that EMMA takes regular ANT path elements as instrumentation input, which is exceedingly convenient -->
- <emma enabled="${emma.enabled}" >
- <instr instrpath="${dest}"
- destdir="${instr.dir}"
- metadatafile="${coverage.dir}/metadata.emma"
- merge="false" mode="copy" filter="${emma.filter}">
- </instr>
- </emma>
- <junit fork="true" forkmode="once">
- <classpath>
- <pathelement location="${instr.dir}"/>
- <fileset dir="${webLibDir}">
- <include name="**/*.jar" />
- </fileset>
- <path refid="emma.lib" />
- <pathelement location="${dest}"/>
- </classpath>
- <formatter type="brief" usefile="false" />
- <!--<test name="com.ogoglio.templatesync.TemplateSyncTestSuite" /> -->
- <test name="com.ogoglio.OgoglioTestSuite" />
-
- <jvmarg value="-Demma.coverage.out.file=${coverage.dir}/coverage.emma" />
- <jvmarg value="-Demma.coverage.out.merge=false" />
- </junit>
- <!-- if enabled, generate coverage report(s): -->
- <emma enabled="${emma.enabled}" >
- <report sourcepath="src"
- sort="+block,+name,+method,+class"
- metrics="method:90,block:90,line:90,class:100"
- >
- <!-- collect all EMMA data dumps (metadata and runtime)
- [this can be done via nested <fileset> fileset elements
- or <file> elements pointing to a single file]:
- -->
- <fileset dir="${coverage.dir}" >
- <include name="*.emma" />
- </fileset>
-
- <!-- for every type of report desired, configure a nested
- element; various report parameters
- can be inherited from the parent <report>
- and individually overridden for each report type:
- -->
- <txt outfile="${coverage.dir}/coverage.txt"
- depth="package"
- columns="class,method,block,line,name"
- />
- <xml outfile="${coverage.dir}/coverage.xml"
- depth="package"
- />
- <html outfile="${coverage.dir}/coverage.html"
- depth="method"
- columns="name,class,method,block,line"
- />
- </report>
- </emma>
- </target>
-
- <target name="cleanInstrumented">
- <delete>
- <fileset dir="${instr.dir}" includes="**/**"/>
- <fileset dir="${coverage.dir}" includes="**/**"/>
- </delete>
- </target>
-
<target name="clean">
<delete>
<fileset dir="${dest}" includes="**/*" />
<fileset dir="." file="${warName}" />
+ <fileset dir="." file="ogoglio-shared.jar" />
<fileset dir="war" file="testApplet.jar" />
<fileset dir="war" file="viewer.jar" />
<fileset dir="war" file="bodyEditor.jar" />
@@ -155,6 +35,18 @@
</copy>
</target>
+ <target name="sharedJar" depends="compile">
+ <jar destfile="ogoglio-shared.jar">
+ <fileset dir="${dest}">
+ <include name="com/ogoglio/util/**/*" />
+ <include name="com/ogoglio/media/**/*" />
+ <include name="com/ogoglio/site/AbstractResourceServlet*" />
+ <include name="com/ogoglio/site/SiteResource*" />
+ <include name="com/ogoglio/site/SiteInfo*" />
+ </fileset>
+ </jar>
+ </target>
+
<target name="testApplet" depends="compile">
<jar destfile="war/testApplet.jar">
<fileset dir="${dest}">
@@ -209,7 +101,7 @@
</jar>
</target>
- <target name="war" depends="compile, testApplet, viewerApplet, bodyEditorApplet">
+ <target name="war" depends="compile, testApplet, viewerApplet, bodyEditorApplet, sharedJar">
<jar destfile="${warName}" basedir="war" />
</target>
Added: spaces/trunk/shared-lib/antlr-2.7.5H3.jar
===================================================================
(Binary files differ)
Property changes on: spaces/trunk/shared-lib/antlr-2.7.5H3.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: spaces/trunk/shared-lib/asm-attrs.jar
===================================================================
(Binary files differ)
Property changes on: spaces/trunk/shared-lib/asm-attrs.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: spaces/trunk/shared-lib/asm.jar
===================================================================
(Binary files differ)
Property changes on: spaces/trunk/shared-lib/asm.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: spaces/trunk/shared-lib/cglib-2.1.jar
===================================================================
(Binary files differ)
Property changes on: spaces/trunk/shared-lib/cglib-2.1.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: spaces/trunk/shared-lib/cglib-nodep-2.1_2.jar
===================================================================
(Binary files differ)
Property changes on: spaces/trunk/shared-lib/cglib-nodep-2.1_2.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: spaces/trunk/shared-lib/commons-codec-1.3.jar
===================================================================
(Binary files differ)
Property changes on: spaces/trunk/shared-lib/commons-codec-1.3.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: spaces/trunk/shared-lib/commons-collections-2.1.1.jar
===================================================================
(Binary files differ)
Property changes on: spaces/trunk/shared-lib/commons-collections-2.1.1.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: spaces/trunk/shared-lib/commons-fileupload-1.1.1.jar
===================================================================
(Binary files differ)
Property changes on: spaces/trunk/shared-lib/commons-fileupload-1.1.1.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: spaces/trunk/shared-lib/commons-httpclient-3.0.1.jar
===================================================================
(Binary files differ)
Property changes on: spaces/trunk/shared-lib/commons-httpclient-3.0.1.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: spaces/trunk/shared-lib/commons-io-1.3.jar
===================================================================
(Binary files differ)
Property changes on: spaces/trunk/shared-lib/commons-io-1.3.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: spaces/trunk/shared-lib/commons-logging-1.0.4.jar
===================================================================
(Binary files differ)
Property changes on: spaces/trunk/shared-lib/commons-logging-1.0.4.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: spaces/trunk/shared-lib/dom4j-1.6.jar
===================================================================
(Binary files differ)
Property changes on: spaces/trunk/shared-lib/dom4j-1.6.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: spaces/trunk/shared-lib/ehcache-1.1.jar
===================================================================
(Binary files differ)
Property changes on: spaces/trunk/shared-lib/ehcache-1.1.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: spaces/trunk/shared-lib/hibernate3.jar
===================================================================
(Binary files differ)
Property changes on: spaces/trunk/shared-lib/hibernate3.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: spaces/trunk/shared-lib/hsqldb.jar
===================================================================
(Binary files differ)
Property changes on: spaces/trunk/shared-lib/hsqldb.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: spaces/trunk/shared-lib/js.jar
===================================================================
(Binary files differ)
Property changes on: spaces/trunk/shared-lib/js.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: spaces/trunk/shared-lib/jta.jar
===================================================================
(Binary files differ)
Property changes on: spaces/trunk/shared-lib/jta.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: spaces/trunk/shared-lib/junit-3.8.1.jar
===================================================================
(Binary files differ)
Property changes on: spaces/trunk/shared-lib/junit-3.8.1.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: spaces/trunk/shared-lib/junit.jar
===================================================================
(Binary files differ)
Property changes on: spaces/trunk/shared-lib/junit.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: spaces/trunk/shared-lib/log4j-1.2.9.jar
===================================================================
(Binary files differ)
Property changes on: spaces/trunk/shared-lib/log4j-1.2.9.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: spaces/trunk/shared-lib/mysql-connector-java-3.1.11-bin.jar
===================================================================
(Binary files differ)
Property changes on: spaces/trunk/shared-lib/mysql-connector-java-3.1.11-bin.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: spaces/trunk/shared-lib/rmock-2.0.0.jar
===================================================================
(Binary files differ)
Property changes on: spaces/trunk/shared-lib/rmock-2.0.0.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: spaces/trunk/shared-lib/xbean.jar
===================================================================
(Binary files differ)
Property changes on: spaces/trunk/shared-lib/xbean.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Modified: spaces/trunk/src/com/ogoglio/sim/Sim.java
===================================================================
--- spaces/trunk/src/com/ogoglio/sim/Sim.java 2007-08-06 23:44:42 UTC (rev 237)
+++ spaces/trunk/src/com/ogoglio/sim/Sim.java 2007-08-07 00:22:09 UTC (rev 238)
@@ -22,8 +22,6 @@
import nanoxml.XMLElement;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
import org.hibernate.SessionFactory;
import com.ogoglio.media.MediaService;
Modified: spaces/trunk/src/com/ogoglio/sim/SpaceSimulator.java
===================================================================
--- spaces/trunk/src/com/ogoglio/sim/SpaceSimulator.java 2007-08-06 23:44:42 UTC (rev 237)
+++ spaces/trunk/src/com/ogoglio/sim/SpaceSimulator.java 2007-08-07 00:22:09 UTC (rev 238)
@@ -26,9 +26,6 @@
import javax.vecmath.Point3d;
import javax.vecmath.Vector3d;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-
import com.ogoglio.client.UserInputListener;
import com.ogoglio.client.model.Door;
import com.ogoglio.client.model.GeometryProvider;
Deleted: spaces/trunk/war/WEB-INF/lib/antlr-2.7.5H3.jar
===================================================================
(Binary files differ)
Deleted: spaces/trunk/war/WEB-INF/lib/asm-attrs.jar
===================================================================
(Binary files differ)
Deleted: spaces/trunk/war/WEB-INF/lib/asm.jar
===================================================================
(Binary files differ)
Deleted: spaces/trunk/war/WEB-INF/lib/cglib-2.1.jar
===================================================================
(Binary files differ)
Deleted: spaces/trunk/war/WEB-INF/lib/cglib-nodep-2.1_2.jar
===================================================================
(Binary files differ)
Deleted: spaces/trunk/war/WEB-INF/lib/commons-codec-1.3.jar
===================================================================
(Binary files differ)
Deleted: spaces/trunk/war/WEB-INF/lib/commons-collections-2.1.1.jar
===================================================================
(Binary files differ)
Deleted: spaces/trunk/war/WEB-INF/lib/commons-fileupload-1.1.1.jar
===================================================================
(Binary files differ)
Deleted: spaces/trunk/war/WEB-INF/lib/commons-httpclient-3.0.1.jar
===================================================================
(Binary files differ)
Deleted: spaces/trunk/war/WEB-INF/lib/commons-io-1.3.jar
===================================================================
(Binary files differ)
Deleted: spaces/trunk/war/WEB-INF/lib/commons-logging-1.0.4.jar
===================================================================
(Binary files differ)
Deleted: spaces/trunk/war/WEB-INF/lib/dom4j-1.6.jar
===================================================================
(Binary files differ)
Deleted: spaces/trunk/war/WEB-INF/lib/ehcache-1.1.jar
===================================================================
(Binary files differ)
Deleted: spaces/trunk/war/WEB-INF/lib/hibernate3.jar
===================================================================
(Binary files differ)
Deleted: spaces/trunk/war/WEB-INF/lib/hsqldb.jar
===================================================================
(Binary files differ)
Deleted: spaces/trunk/war/WEB-INF/lib/js.jar
===================================================================
(Binary files differ)
Deleted: spaces/trunk/war/WEB-INF/lib/jta.jar
===================================================================
(Binary files differ)
Deleted: spaces/trunk/war/WEB-INF/lib/junit-3.8.1.jar
===================================================================
(Binary files differ)
Deleted: spaces/trunk/war/WEB-INF/lib/junit.jar
===================================================================
(Binary files differ)
Deleted: spaces/trunk/war/WEB-INF/lib/log4j-1.2.9.jar
===================================================================
(Binary files differ)
Deleted: spaces/trunk/war/WEB-INF/lib/mysql-connector-java-3.1.11-bin.jar
===================================================================
(Binary files differ)
Deleted: spaces/trunk/war/WEB-INF/lib/rmock-2.0.0.jar
===================================================================
(Binary files differ)
Deleted: spaces/trunk/war/WEB-INF/lib/xbean.jar
===================================================================
(Binary files differ)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <tre...@us...> - 2007-08-06 23:44:38
|
Revision: 237
http://ogoglio.svn.sourceforge.net/ogoglio/?rev=237&view=rev
Author: trevorolio
Date: 2007-08-06 16:44:42 -0700 (Mon, 06 Aug 2007)
Log Message:
-----------
Another WebAPI test.
Modified Paths:
--------------
spaces/trunk/src/com/ogoglio/client/WebAPITests.java
Modified: spaces/trunk/src/com/ogoglio/client/WebAPITests.java
===================================================================
--- spaces/trunk/src/com/ogoglio/client/WebAPITests.java 2007-08-06 19:41:08 UTC (rev 236)
+++ spaces/trunk/src/com/ogoglio/client/WebAPITests.java 2007-08-06 23:44:42 UTC (rev 237)
@@ -14,6 +14,8 @@
public static final String GOOD_COOKIE = "trGoodCookie";
private static final String BAD_COOKIE = "badBacCookie";
+
+ private static final String GUEST_COOKIE = "guestMockCookie";
URI serviceURI = null;
@@ -49,6 +51,23 @@
public void tearDown() {
}
+
+ public void testWebAPIGuestAuthenticator() {
+
+ mockAuthFactory.authenticate(descriptor, GUEST_COOKIE);
+ modify().forward();
+
+ //###################################
+ startVerification();
+
+ WebAPIGuestAuthenticator auth = mockAuthFactory.authenticate(descriptor, GUEST_COOKIE);
+ assertNotNull(auth);
+ assertEquals(GUEST_COOKIE, auth.getAuthCookie());
+ assertNotNull(auth.getUsername());
+ assertNotNull(auth.getAccountDocument(true));
+ assertNotNull(auth.getAuthDocument(true));
+ }
+
public void testWebAPIAuthenticatorViaCookie() throws IOException, AuthenticationFailedException {
//mockWire should respond to good and bad cookies with good and bad auth docs
mockWire.fetchAuthenticatedXML(descriptor.getMeAuthURI(), BAD_COOKIE);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|