Initial commit from SVN.

This commit is contained in:
wcrisman
2014-05-30 10:31:51 -07:00
commit b45e56b890
1968 changed files with 370949 additions and 0 deletions

View File

@@ -0,0 +1,20 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="src" path="src"/>
<classpathentry combineaccessrules="false" kind="src" path="/Common"/>
<classpathentry combineaccessrules="false" kind="src" path="/Foundation"/>
<classpathentry combineaccessrules="false" kind="src" path="/Foundation Web Interfaces"/>
<classpathentry combineaccessrules="false" kind="src" path="/Foundation Web Core"/>
<classpathentry combineaccessrules="false" kind="src" path="/Foundation SWT"/>
<classpathentry combineaccessrules="false" kind="src" path="/SWT"/>
<classpathentry combineaccessrules="false" kind="src" path="/Orb"/>
<classpathentry combineaccessrules="false" kind="src" path="/Foundation TCV"/>
<classpathentry combineaccessrules="false" kind="src" path="/Foundation TCV Server"/>
<classpathentry combineaccessrules="false" kind="src" path="/Foundation Web Application"/>
<classpathentry combineaccessrules="false" kind="src" path="/Foundation Transaction MySQL"/>
<classpathentry combineaccessrules="false" kind="src" path="/MySQL ConnectorJ"/>
<classpathentry kind="lib" path="activation.jar"/>
<classpathentry kind="lib" path="mail.jar"/>
<classpathentry kind="output" path="bin"/>
</classpath>

Binary file not shown.

View File

@@ -0,0 +1,33 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>Foundation Web Test Webapp</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>com.declarativeengineering.jetson.vmlBuilderId</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>com.declarativeengineering.jetson.resourceBuilderId</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>com.declarativeengineering.jetson.htmlBuilderId</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
<nature>com.declarativeengineering.jetson.jefNatureId</nature>
</natures>
</projectDescription>

View File

@@ -0,0 +1 @@
Place your client accessable jars here.

Binary file not shown.

View File

@@ -0,0 +1,2 @@
"%JAVA_HOME%\bin\keytool.exe" -genkey -keyalg RSA -alias selfsigned -keystore .keystore -storepass password -validity 360 -keysize 2048

Binary file not shown.

View File

@@ -0,0 +1,13 @@
<?xml version="1.0"?>
<repository name='APPDB' class='com.foundation.transaction.jdbc.mysql.MySQLRepositoryManager'>
<properties user-name='webappdefault' user-password='webserver' database-url='jdbc:mysql://localhost/webtest'/>
<class name='com.foundation.web.model.SessionStore' repository-name='SESSION_STORE'>
<attribute name='serverId' type='Integer' repository-name='SERVER_ID' repository-type='INT' is-key='true' is-auto-generated='false'/>
<attribute name='sessionId' type='Long' repository-name='SESSION_ID' repository-type='BIGINT' is-key='true' is-auto-generated='false'/>
<attribute name='sequenceId' type='Short' repository-name='SEQUENCE_ID' repository-type='SMALLINT' is-key='true' is-auto-generated='false'/>
<attribute name='sessionData' type='byte[]' repository-name='SESSION_DATA' repository-type='BLOB'/>
<attribute name='updateTimestamp' type='java.util.Date' repository-name='UPDATE_TIMESTAMP' repository-type='TIMESTAMP'/>
<properties/>
</class>
</repository>

View File

@@ -0,0 +1,42 @@
--
-- Create schema
--
CREATE DATABASE IF NOT EXISTS myapp;
USE myapp;
--
-- Definition of table `user`
--
DROP TABLE IF EXISTS `user`;
CREATE TABLE `user` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`login` varchar(128) NOT NULL,
`password_hash` char(40) DEFAULT NULL,
`full_name` varchar(128) NOT NULL,
`is_admin` tinyint(3) unsigned NOT NULL,
PRIMARY KEY (`id`),
KEY `LOGIN` (`login`,`password_hash`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;
/*!40000 ALTER TABLE `user` DISABLE KEYS */;
INSERT INTO `user` (`id`,`login`,`full_name`,`is_admin`) VALUES
(0,'admin','Administrator',1);
/*!40000 ALTER TABLE `user` ENABLE KEYS */;
--
-- Definition of table `customer`
--
DROP TABLE IF EXISTS `customer`;
CREATE TABLE `customer` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`email` varchar(128) NOT NULL,
`login` varchar(128) NOT NULL,
`password_hash` char(40) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL,
`first_name` varchar(90) DEFAULT NULL,
`last_name` varchar(90) DEFAULT NULL,
`email_validation_code` char(40) DEFAULT NULL,
`is_password_temporary` tinyint(3) unsigned NOT NULL DEFAULT '0',
PRIMARY KEY (`id`) USING BTREE,
KEY `CUSTOMER_LOGIN_INDEX` (`login`),
KEY `CUSTOMER_EMAIL_INDEX` (`email`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,417 @@
package com.de22.web.test.application;
import java.io.File;
import java.io.FileInputStream;
import com.common.debug.*;
import com.common.orb.Orb;
import com.common.thread.*;
import com.common.util.*;
import com.de22.orb.optional.ServerSocketOptions;
import com.de22.orb.optional.SocketOptions;
import com.de22.orb.Address;
import com.foundation.util.*;
import com.foundation.util.xml.INode;
import com.foundation.view.*;
import com.foundation.controller.*;
import com.foundation.application.Application;
import com.foundation.tcv.controller.IThinServerController;
import com.foundation.tcv.server.controller.ApplicationBrowserService;
import com.foundation.tcv.server.controller.IInitialViewFactory;
import com.foundation.view.resource.ResourceService;
import com.foundation.view.swt.SwtViewContext;
import com.foundation.transaction.TransactionErrorInfo;
import com.foundation.transaction.TransactionService;
import com.foundation.event.IRequestHandler;
import com.foundation.web.*;
import com.foundation.web.interfaces.*;
import com.foundation.web.server.WebServer;
import com.foundation.web.server.IServiceListener;
/**
* The starting point for this application. In addition to kicking things off, the application class manages the basic services used by other application components.
* <p>Notes for running on OSX: Prevent the main thread from ever dieing (see main method); Add -XstartOnFirstThread to the run command (VM Argument).</p>
*/
public class TestWebappApplication extends Application {
/** The property file location property. */
public static final String PROPERTY_FILE = "properties";
/** The property name that determines whether we generate proxies. This should only be true during development. */
public static final String PROPERTY_GENERATE_PROXIES = "generate.proxies";
/** The property name that gives us the ip:port for starting the application browser's server socket listener. */
public static final String PROPERTY_APPBROWSER_SERVER_ADDRESS = "application.browser.address";
/** Whether debug is on - caching will be turned off in as many places as possible. */
public static final String PROPERTY_DEBUG = "debug";
private static final String APPLICATION_BROWSER_SERVER_SOCKET_NAME = "ApplicationBrowserServerSocket";
private static final Object THIN_VIEW_PERMISSION = new Object();
private static final String APPLICATION_NAME = "Unlicensed.SampleApplication";
private static final TestWebappApplication singleton = new TestWebappApplication();
/** The base directory for the application. This allows the directory to be modified as needed without affecting other setup code. */
private File baseDirectory = new File("./");
/** The external base directory for the application. This allows the directory to be modified as needed without affecting other setup code. */
private File externalBaseDirectory = null;
/** The base directory for the application cache files. This allows the directory to be modified as needed without affecting other setup code. */
private File cacheBaseDirectory = null;
/** The web server - used to clean up when shutting down the application. */
private WebServer webServer = null;
/** The properties used by the web application. */
private java.util.Properties properties;
/**
* Starts the Foundation Web Test Webapp application.
* <p>Note: This runs the TestWebapp web application in standalone mode.</p>
* @param args None expected.
*/
public static void main(String[] args) {
//Setup the debug log.//
Debug.setLog(new DefaultLog());
getSingleton().startup(System.getProperties());
getSingleton().startWebApplication();
//Enable the wait for shutdown call on the Mac such that the main thread never dies.//
// getSingleton().waitForShutdown();
}//main()//
/**
* Gets the one and only instance of the application.
* @return The singleton instance.
*/
public static TestWebappApplication getSingleton() {
return singleton;
}//getSingleton()//
/**
* TestWebappApplication constructor.
*/
public TestWebappApplication() {
super();
}//TestWebappApplication()//
/**
* Gets the set of properties for the application. This should be used in place of System.getProperties().
* @return The properties for this application.
*/
public java.util.Properties getProperties() {
return properties;
}//getProperties()//
/**
* Gets the directory containing the application's resources.
* @return The file referencing the application's base path.
*/
public File getBaseDirectory() {
return baseDirectory;
}//getBaseDirectory()//
/**
* Sets the directory containing the application's resources.
* @param baseDirectory The file referencing the application's base path.
*/
public void setBaseDirectory(File baseDirectory) {
this.baseDirectory = baseDirectory == null ? new File("./") : baseDirectory;
}//setBaseDirectory()//
/**
* Gets the directory containing the application's external resources. External resources are not packaged with the web application, but may not be re-creatable and should be backed up.
* @return The file referencing the application's external base path.
*/
public File getExternalBaseDirectory() {
return externalBaseDirectory;
}//getExternalBaseDirectory()//
/**
* Sets the directory containing the application's external resources. External resources are not packaged with the web application, but may not be re-creatable and should be backed up.
* @param externalBaseDirectory The file referencing the application's external base path.
*/
public void setExternalBaseDirectory(File externalBaseDirectory) {
this.externalBaseDirectory = externalBaseDirectory == null ? new File("./") : externalBaseDirectory;
}//setExternalBaseDirectory()//
/**
* Gets the directory containing the application's cached resources. Cached resources are not packaged with the web application, but are fully re-creatable, and should not be backed up.
* @return The file referencing the application's cache base path.
*/
public File getCacheBaseDirectory() {
return cacheBaseDirectory;
}//getCacheBaseDirectory()//
/**
* Sets the directory containing the application's cached resources. Cached resources are not packaged with the web application, but are fully re-creatable, and should not be backed up.
* @param cacheBaseDirectory The file referencing the application's cache base path.
*/
public void setCacheBaseDirectory(File cacheBaseDirectory) {
this.cacheBaseDirectory = cacheBaseDirectory == null ? new File("./") : cacheBaseDirectory;
}//setCacheBaseDirectory()//
/* (non-Javadoc)
* @see com.foundation.application.Application#getDefaultRepositoryIdentifier()
*/
public Object getDefaultRepositoryIdentifier() {
return "APPDB";
}//getDefaultRepositoryIdentifier()//
/* (non-Javadoc)
* @see com.foundation.application.Application#getMetadataLocation()
*/
public Object getMetadataLocation() {
return new File(getBaseDirectory(), "metadata.xml");
}//getMetadataLocation()//
/* (non-Javadoc)
* @see com.foundation.application.Application#getResourcesPath()
*/
public File getResourcesPath() {
return getBaseDirectory() != null ? getBaseDirectory() : super.getResourcesPath();
}//getResourcesPath()//
/* (non-Javadoc)
* @see com.foundation.application.Application#initializeResources(com.foundation.view.resource.ResourceService)
*/
protected void initializeResources(ResourceService resourceService) {
}//initializeResources()//
/* (non-Javadoc)
* @see com.foundation.application.Application#internalShutdown()
*/
protected void internalShutdown() {
try {
Orb.closeServerSocket(APPLICATION_BROWSER_SERVER_SOCKET_NAME);
}//try//
catch(Throwable e) {
Debug.log(e);
}//catch//
try {
Orb.shutdown();
}//try//
catch(Throwable e) {
Debug.log(e);
}//catch//
try {
if(webServer != null) {
webServer.stop();
webServer = null;
}//if//
}//try//
catch(Throwable e) {
Debug.log(e);
}//catch//
try {
SwtViewContext.getSingleton().shutdown();
}//try//
catch(Throwable e) {
Debug.log(e);
}//catch//
try {
Scheduler.shutdown();
ActiveScheduler.getSingleton().shutdown();
}//try//
catch(Throwable e) {
Debug.log(e);
}//catch//
super.internalShutdown();
}//internalShutdown()//
/* (non-Javadoc)
* @see com.foundation.application.Application#startup()
*/
protected void startup(java.util.Properties properties) {
String generateProxiesProperty;
boolean generateProxies;
this.properties = properties;
//Load properties from the property file into the system properties.//
if(this.properties.getProperty(PROPERTY_FILE) != null) {
FileInputStream fin = null;
try {
fin = new FileInputStream(new File(getBaseDirectory(), this.properties.getProperty(PROPERTY_FILE)));
this.properties.load(fin);
}//try//
catch(Throwable e) {
Debug.log("Couldn't load the property file: " + this.properties.getProperty(PROPERTY_FILE));
}//catch//
finally {
try {fin.close();} catch(Throwable e) {}
}//finally//
}//if//
generateProxiesProperty = this.properties.getProperty(PROPERTY_GENERATE_PROXIES);
generateProxies = (generateProxiesProperty != null) && ((generateProxiesProperty.equals("yes")) || (generateProxiesProperty.equals("on")) || (generateProxiesProperty.equals("true")));
//Setup the metadata service.//
setupMetadataService();
//Setup the resource service.//
setupResourceService();
//Setup the transaction service.//
setupTransactionService();
getTransactionService().debug(TransactionService.DEBUG_ALL);
//Setup the ORB.//
Orb.setOrbWrapper(new com.de22.orb.optional.CommonOrbWrapper(generateProxies ? new com.de22.orb.development.OrbClassLoader(new File(getBaseDirectory(), "proxies")) : null, null, null));
try {
//Start the application specific code.//
startApplication();
}//try//
catch(Throwable e) {
//Log all errors that are not caught earlier in the program.//
Debug.log(e);
}//catch//
}//startup()//
/**
* Starts the actual application.
*/
private void startApplication() {
}//startApplication()//
/**
* Starts the web application in non-hosted mode (never called if the app is hosted in the Brainstorm Web Server).
*/
private void startWebApplication() {
//Setup the built in web server. Note that for web applications this will not get run if the web application is run within the Brainstorm Web Server as a hosted application.//
try {
IWebApplication[] webapps;
//Create the web server.//
webServer = new WebServer(false);
//Add service listeners. These are referenced by each web application later. SSL/TLS multiplexing is possible.//
webServer.addServiceListener(new String[] {"http"}, new com.common.orb.Address(null, 80), IServiceListener.TYPE_HTTP);
webServer.addServiceListener(new String[] {"ssl"}, new com.common.orb.Address(null, 443), IServiceListener.TYPE_SSL);
//Initialize the base directories.//
setExternalBaseDirectory(properties.getProperty("external-base-directory") != null ? new File(properties.getProperty("external-base-directory")) : null);
setCacheBaseDirectory(properties.getProperty("cache-base-directory") != null ? new File(properties.getProperty("cache-base-directory")) : null);
//Create the web applications.//
webapps = createWebApplications(getBaseDirectory(), getExternalBaseDirectory(), getCacheBaseDirectory(), new java.util.Properties());
//Add all the web applications to the server.//
for(int webappIndex = 0; webappIndex < webapps.length; webappIndex++) {
//Add the application to the server. The application cannot be modified furthor.//
webServer.addWebApplication(webapps[webappIndex]);
}//for//
//Start the web server. Web server settings cannot be modified after calling start.//
webServer.start();
Debug.log("Web Server Started.");
}//try//
catch(Throwable e) {
Debug.log("Unable to open the view service.", e);
}//catch//
}//startWebApplication()//
/**
* Creates the web applications for this app.
* @param baseDirectory The base directory for the webapp's static resources.
* @param externalBaseDirectory The optional external base directory for additional static resources not deployed with the webapp (specific to the server).
* @param properties The property map containing future settings needed by the factory.
* @return The array of web application objects defined by the webapp.
*/
public IWebApplication[] createWebApplications(File baseDirectory, File externalBaseDirectory, File cacheBaseDirectory, java.util.Properties properties) {
IWebApplication[] result = new IWebApplication[1];
try {
WebOptions options = new WebOptions();
options.setSessionHandler(new WebApplication.SessionHandler(cacheBaseDirectory != null ? cacheBaseDirectory : externalBaseDirectory != null ? externalBaseDirectory : baseDirectory) {
public SecureSessionData createSecureSessionObject(IRequestHandler requestHandler) {
//TODO: Create and return an application specific secure session data object to hold the secure session state.
return new com.de22.web.test.web.SecureSessionData(requestHandler);
}//createSecureSessionObject()//
});
//TODO: Pass the domain names the webapp is accessable through.
//TODO: Setup the SSL mapping (or remove if not using SSL).
//TODO: Provide the directory containing the static web resources.
//TODO: Modify the base package where java classes will be found by the web server when a resource ending in .java is found.
options.setDomains(new String[] {"domain1.com", "www.domain1.com"});
options.setServices(new String[] {"http", "ssl"});
options.setSslMappings(new WebOptions.SslMapping[] {WebOptions.createSslMapping(new String[] {"domain1.com", "www.domain1.com"}, new File(baseDirectory, ".keystore"), "password", "password")});
options.setBaseDirectory(new File(baseDirectory, "web"));
options.setExternalBaseDirectory(externalBaseDirectory != null ? new File(externalBaseDirectory, "web") : null);
options.setDefaultPackageName("com.de22.web.test.web.");
options.setSessionTimeout(3600000);
options.setSessionCheckInterval(3600000);
options.setBadSessionHandler(new IBadSessionHandler() {
public boolean process(IRequest request, IResponse response, ISession session, boolean wasLoggedIn) {
if(wasLoggedIn) {
response.setCustomHeader("HTTP/1.1 412 Refresh\r\nrefresh: true\r\n");
return true;
}//if//
return false;
}//process()//
});
//Note: The resource name is the portion of the URL that comes after the domain & port.//
options.addPathSubstitution("/", "/index.html", false);
options.setResourceRequestHandler(new IResourceRequestHandler() {
/* (non-Javadoc)
* @see com.foundation.web.IResourceRequestHandler#getMaxMessageSize(com.foundation.web.interfaces.IRequest, com.foundation.web.SessionData, com.foundation.web.SecureSessionData)
*/
public int getMaxMessageSize(IRequest request, SessionData sessionData, SecureSessionData secureSessionData) {
return 0;
}//getMaxMessageSize()//
/**
* Verifies that the user has sufficient access for the server to service the request.
* Forwards the user to a less secure resource if they fail the permission test.
*/
private boolean verifyRequestPathAccess(String requestPath, IRequest request, IResponse response, SessionData sessionData, SecureSessionData secureSessionData, boolean isSecure) {
return true;
}//verifyRequestPathAccess()//
/**
* Handles a static resource request.
*/
public void processRequest(String requestPath, IRequest request, IResponse response, SessionData sessionData, SecureSessionData secureSessionData, boolean isSecure) {
try {
if(verifyRequestPathAccess(requestPath, request, response, sessionData, secureSessionData, isSecure)) {
boolean handled = false;
// if(requestPath.startsWith("/secure/wiki/")) {
// int extensionIndex = requestPath.lastIndexOf('.');
// String extension = extensionIndex != -1 ? requestPath.substring(extensionIndex + 1) : null;
//
// if(extension == null) {
// IWebRequestHandler handler = new com.petitteton.web.secure.wiki.WikiViewController();
//
// handler.processRequest(request, response, sessionData, secureSessionData);
// handled = true;
// }//if//
// }//if//
// else {
int extensionDecimal = requestPath.lastIndexOf('.');
boolean cacheIndefinately = false;
if(extensionDecimal != -1) {
String extension = requestPath.substring(extensionDecimal + 1).toLowerCase();
if(extension.equals("gif") || extension.equals("png") || extension.equals("jpg") || extension.equals("jpeg")) {
cacheIndefinately = true;
}//if//
}//if//
//Note: We have copied the code from this call so we can customize it to perform more caching of resources.//
FileContent.setContentResource(response, requestPath, request, request.getCacheDate(), Boolean.FALSE, cacheIndefinately);
handled = true;
// }//else//
if(!handled) {
FileContent.setContentResource(response, requestPath, request.getCacheDate());
}//if//
}//if//
}//try//
catch(Throwable e) {
Debug.log(e);
}//catch//
}//processRequest()//
/**
* Handles access to a web controller.
*/
public void processRequest(IWebRequestHandler handler, String requestPath, IRequest request, IResponse response, SessionData sessionData, SecureSessionData secureSessionData, boolean isSecure) {
try {
if(verifyRequestPathAccess(requestPath, request, response, sessionData, secureSessionData, isSecure)) {
handler.processRequest(request, response, sessionData, secureSessionData);
}//if//
}//try//
catch(Throwable e) {
Debug.log(e);
}//catch//
}//processRequest()//
});
result[0] = new WebApplication("domain1.com", options, this);
}//try//
catch(Throwable e) {
Debug.log(e);
result = null;
}//catch//
return result;
}//createWebApplications()//
}//TestWebappApplication//

View File

@@ -0,0 +1,42 @@
package com.de22.web.test.application;
import java.io.File;
import com.common.debug.*;
import com.foundation.web.interfaces.*;
/**
* The factory for the web applications defined by this application.
*/
public class WebApplicationFactory implements IWebApplicationFactory {
/**
* WebApplicationFactory constructor.
*/
public WebApplicationFactory() {
super();
}//WebApplicationFactory()//
/* (non-Javadoc)
* @see com.foundation.web.interfaces.IWebApplicationFactory#createWebApplications(java.io.File, java.io.File, java.io.File, com.foundation.web.interfaces.IAppLog, java.util.Properties)
*/
public IWebApplication[] createWebApplications(File baseDirectory, File externalBaseDirectory, File cacheBaseDirectory, final IAppLog log, java.util.Properties properties) {
Debug.setLog(new DefaultLog() {
public synchronized void log(String note, Throwable exception, int type, boolean display) {
log.log(type, note, exception);
}//log()//
});
System.setProperty(TestWebappApplication.PROPERTY_GENERATE_PROXIES, "true");
//TODO: Change this to a port that doesn't conflict with anything. This address/port is used to connect the application browser to this running web application.
System.setProperty(TestWebappApplication.PROPERTY_APPBROWSER_SERVER_ADDRESS, "5557");
TestWebappApplication.getSingleton().setBaseDirectory(baseDirectory);
TestWebappApplication.getSingleton().setExternalBaseDirectory(externalBaseDirectory);
TestWebappApplication.getSingleton().setCacheBaseDirectory(cacheBaseDirectory);
TestWebappApplication.getSingleton().startup(properties);
return TestWebappApplication.getSingleton().createWebApplications(baseDirectory, externalBaseDirectory, cacheBaseDirectory, properties);
}//createWebApplications()//
/* (non-Javadoc)
* @see com.foundation.web.interfaces.IWebApplicationFactory#shutdown()
*/
public void shutdown() {
TestWebappApplication.getSingleton().shutdown();
}//shutdown()//
}//WebApplicationFactory//

View File

@@ -0,0 +1,23 @@
package com.de22.web.test.controller;
import com.foundation.application.*;
import com.de22.web.test.application.*;
/**
* The base class for application controllers. Application controllers contain control logic not tied to a model or view. These classes probably need to be thread safe.
*/
public abstract class AbstractController extends com.foundation.controller.Controller {
/**
* AbstractController constructor.
*/
public AbstractController() {
super();
}//AbstractController()//
/**
* Gets the application object that this object is running under. The application object provides the object various services that it will need.
* @return The application reference for the application this object is running under.
*/
public IApplication getApplication() {
return TestWebappApplication.getSingleton();
}//getApplication()//
}//AbstractController//

View File

@@ -0,0 +1,107 @@
package com.de22.web.test.controller;
import java.io.File;
import java.io.FileOutputStream;
import java.util.Date;
import java.util.Properties;
import javax.mail.Authenticator;
import javax.mail.MessagingException;
import javax.mail.PasswordAuthentication;
import javax.mail.Transport;
import javax.mail.internet.InternetAddress;
import javax.mail.internet.MimeMessage;
import com.common.debug.Debug;
import com.common.io.StreamSupport;
/**
* Provides access to sending emails.<p>
*/
public class EmailController extends AbstractController {
//TODO: Move these values into a property file.
private String mailHost = "null";
private String mailUser = "w";
private String smtpPassword = "null";
private static final EmailController singleton = new EmailController();
/**
* Gets the one and only instance of this class.
* @return The single email controller instance.
*/
public static EmailController getSingleton() {
return singleton;
}//getSingleton()//
/**
* EmailController constructor.
*/
private EmailController() {
}//EmailController()//
/**
* Queues an email for sending.
* @param fromEmailAddress The address to be sending from.
* @param toEmailAddress The address to send to.
* @param subject The subject of the email.
* @param message The email message.
* @return Whether the message could be sent.
*/
public boolean queueEmail(String fromEmailAddress, String toEmailAddress, String subject, String message) {
Properties props = new Properties();
javax.mail.Session session = null;
boolean result = false;
props.put("mail.smtp.host", mailHost);
props.put("mail.smtp.submitter", mailUser);
props.put("mail.smtp.auth", "true");
session = javax.mail.Session.getInstance(props, new Authenticator() {
public PasswordAuthentication getPasswordAuthentication() {
return new PasswordAuthentication(mailUser, smtpPassword);
}//getPasswordAuthentication()//
});
try {
MimeMessage mimeMessage = new MimeMessage(session);
InternetAddress toAddress = new InternetAddress(toEmailAddress);
mimeMessage.setFrom(new InternetAddress(fromEmailAddress));
mimeMessage.setRecipient(javax.mail.Message.RecipientType.TO, toAddress);
mimeMessage.setSubject(subject);
mimeMessage.setSentDate(new Date());
mimeMessage.setText(message);
Transport.send(mimeMessage);
result = true;
}//try//
catch(MessagingException e) {
Debug.log(e);
}//catch//
return result;
}//queueEmail()//
/**
* Reports an error in sending an email.
* <p>TODO: This should also store an entry in the database so it shows up in a view somewhere (on server?).</p>
* @param fromEmailAddress
* @param toEmailAddress
* @param subject
* @param message
*/
public void reportEmailError(String fromEmailAddress, String toEmailAddress, String subject, String message) {
FileOutputStream fout = null;
Debug.log(new RuntimeException("Failed to deliver the following message:\n" + " From Email:\n" + fromEmailAddress + "\n To Email:\n" + toEmailAddress + "\n Subject:\n" + subject + "\n Message:\n" + message), true);
try {
File file = new File("./email_errors/" + System.currentTimeMillis() + ".txt");
file.getParentFile().mkdirs();
fout = new FileOutputStream(file);
StreamSupport.writeText("Failed to deliver the following message:\r\n" + " From Email:\r\n" + fromEmailAddress + "\r\n To Email:\r\n" + toEmailAddress + "\r\n Subject:\n" + subject + "\r\n Message:\r\n" + message, fout, "UTF8");
}//try//
catch(Throwable e) {
Debug.log(e);
}//catch//
finally {
try {fout.close();}catch(Throwable e) {}
}//finally//
}//reportEmailError()//
}//EmailController//

View File

@@ -0,0 +1,23 @@
package com.de22.web.test.model;
import com.foundation.application.*;
import com.de22.web.test.application.*;
/**
* The base class for all models for this application. The base class provides an opportunity to customize all models at once.
*/
public abstract class AbstractModel extends com.foundation.model.Model {
/**
* AbstractModel constructor.
*/
public AbstractModel() {
super();
}//AbstractModel()//
/**
* Gets the application object that this object is running under. The application object provides the object various services that it will need.
* @return The application reference for the application this object is running under.
*/
public IApplication getApplication() {
return TestWebappApplication.getSingleton();
}//getApplication()//
}//AbstractModel//

View File

@@ -0,0 +1,63 @@
package com.de22.web.test.web;
import com.common.debug.Debug;
import com.common.thread.Monitor;
import com.foundation.attribute.ReflectionContext;
import com.foundation.event.IRequestHandler;
import com.foundation.util.IManagedList;
import com.foundation.util.xml.INode;
/**
* The application data attached to the secure session.
*/
public class SecureSessionData extends com.foundation.web.SecureSessionData {
/** The context used to create and manage reflections during the life of this session data. */
private ReflectionContext reflectionContext;
/**
* SecureSessionData constructor.
* @param requestHandler
*/
public SecureSessionData(IRequestHandler requestHandler) {
//The following code utilizes reflections to enable shared access to the session's data with the rest of the system without the programmer needing to handle locking.//
//You may want to use the shared data by building local or remote views to display the logged in users (simply have the view reflect the result of calling the WebMetadataController singleton's getWebSessions() method).//
//Create a reflection context which can be used to share access to models between multiple threads without any locking.//
reflectionContext = new ReflectionContext(requestHandler, null, null);
}//SecureSessionData()//
/**
* SecureSessionData constructor.
* @param node The XML node to read the session data from when restoring.
* @param requestHandler The optional request handler which may be used to setup a reflection context.
*/
public SecureSessionData(INode node, IRequestHandler requestHandler) {
Integer customerId = node.getAttributeIntegerValue("customerId", null);
//First setup the reflection context.//
reflectionContext = new ReflectionContext(requestHandler, null, null);
}//SecureSessionData()//
/**
* Writes the session data to the XML node.
* @param node The node to write the session data to for restoration capabilities.
*/
public void write(INode node) {
/*
if(customer != null) {
node.addAttribute("customerId", customer != null ? customer.getId() : null);
}//if//
*/
}//write()//
/**
* Gets the reflection context used to create reflections for this customer.
* @return The customer's reflection context.
*/
public ReflectionContext getReflectionContext() {
return reflectionContext;
}//getReflectionContext()//
/* (non-Javadoc)
* @see com.foundation.web.interfaces.ISessionData#release()
*/
public void release() {
reflectionContext.unregisterAll();
reflectionContext.release();
reflectionContext = null;
}//release()//
}//SecureSessionData//

View File

@@ -0,0 +1,20 @@
TODO LIST - Tasks often necessary after creating a project:
- Add to the project: DE Application Foundation.jar, and other jars such as DE Transaction Foundation MySQL.jar and the MySQL connector jar (from the MySQL website).
- (UI) Unpack the controls.zip (Brainstorm's UI control definitions) into the project directory (or reference a project with such a controls directory).
- Include the jars in the project folder (Brainstorm, Db, Mail, etc.): Refresh the project, select it and pick Project->Properties from the menu. Use the dialog to set the Build Path: Select the Libraries tab and click Add Jars... to add each jar you placed in the project. Note that jars won't show up if you forgot to refresh the project.
- Add models, model controllers, resources (to the resources.xres file), web request handlers, views, and view controllers as necessary to your project.
- Maintain the metadata.xml file for repository/model mappings. Change the application's database user name and password and update the connection string. Modify if necessary for another type of database (MySQL is what is generated).
- (Web/Wiki) Modify as necessary the SQL and apply it to the database to setup the tables. An SQL file 'mydb.sql' was generated [mysql centric] and place in the project directory.
- (Web/Wiki) Download and unpack the CK Editor to the project's web/secure folder (should have ./web/secure/ckeditor/ckeditor.js).
- (Web/SSL) Modify or remove the SSL setup in the Application class (search for: options.setSslMappings).
- (Web) Add a close.gif image (12x12 recommended) to the images folder (/MyProject/web/secure/images/close.gif). The word 'close' will be used if the image is not available.
- Setup an Run/Debug Configuration for the application. The starting class is the Application class (MyProjectApplication). Make sure to include -Dapplication.browser.address=xxx.com:yyy if supporting remote native views (application browser) and -Dgenerate.proxies=true if using the ORB (required for the application browser).
Generally your new application is runnable out of the box once the proper Brainstorm & 3rd party jars, web tools, and controls are added,
the database is setup, and the project is refreshed (to let eclipse know there were file system changes). If a database is required then changes to the metadata.xml will be required at a minimum.
Required & Optional Jars:
DE Application Foundation.jar (Required)
DE Foundation Transaction MySQL.jar (Replace with the db of your choice)
mysql-connector-java-x.x.xx.jar (Replace with the db of your choice - http://www.mysql.org)
mail.jar (Required for web login code - http://java.sun.com/products/javamail/)
activation.jar (Required for web login code - http://java.sun.com/products/javamail/)

View File

@@ -0,0 +1,8 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd">
<html>
<head>
<title>Main Page</title>
</head>
<body>
Should never get here!
<body>

View File

@@ -0,0 +1,4 @@
User-agent: *
Allow: /sitemap.xml
Allow: /secure/index.html
Disallow:

View File

@@ -0,0 +1,57 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd">
<html>
<head>
<title>Main Authenticated Page</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script language="javascript" src="main.js" type="text/javascript"></script>
<script language="javascript" src="../common.js" type="text/javascript"></script>
<!-- Use one style sheet for IE and another for other browsers. -->
<script language="javascript">
<!--
var ua = navigator.userAgent.toLowerCase();
//Detect what browser this is and load the specific CSS for the browser.//
var isIE = ((ua.indexOf("msie") != -1) && (ua.indexOf("opera") == -1) && (ua.indexOf("webtv") == -1));
if(isIE) {
document.write('<'+'link rel="stylesheet" href="../main.css" type="text/css"/>');
document.write('<'+'link rel="stylesheet" href="../main-ie.css" type="text/css"/>');
}
else {
document.write('<'+'link rel="stylesheet" href="../main.css" type="text/css"/>');
}
//-->
</script>
</head>
<body id="bodyId" onLoad="init();">
<div align="center" style="padding-top:4px;">
<div id="page">
<!-- The welcome and links above the border. -->
<div id="pageTop">
<span id="linksLeft">
<a href="javascript:" class="topMenuLink" style="color: #400">SAMPLE LINK</a>
</span>
<span id="linksRight">
<a id="logLink" href="javascript:logout();" class="topMenuLink">Logout</a>
&nbsp|
<a href="javascript:" class="topMenuLink" style="color: #400">SAMPLE LINK</a>
</span>
</div>
<!-- Everything inside the border. -->
<div id="pageCenter">
<!-- TODO: Place content here. -->
</div>
<!-- Contains link text and navigation - outside the border. -->
<div id="pageBottom">
<!-- TODO: Place content here. -->
</div>
</div>
</div>
<div class="copyrightDiv">
<p style="font: 8pt serif bold; color: white; padding: 0px; margin: 18px 0px 0px 0px; color: #999;">
&#169; DATE_HERE NAME_HERE. All rights reserved.
</p>
</div>
</body>
</html>

View File

@@ -0,0 +1,129 @@
var userContentFadeOut = 800;
var userContentFadeIn = 1400;
var mainFadeImageDelay = 0;
var mainFadeImagePeriod = 2000;
var mainFadeTitleDelay = 500;
var mainFadeTitlePeriod = 1500;
var mainFadeContentDelay = 1500;
var mainFadeContentPeriod = 1000;
var selectedTextImgId;
var selectedImageImgId;
var selectedBlackTextImage;
var isAnonymous;
var userName = 0;
//
// Initializes the main view.
//
function init() {
checkLogin(240000);
}
//Sends a ping to the server on a regular basis to prevent loss of the session and to check the logged in status of the user.
//Updates the logLink to display Log In or Log Out depending on the login state.
// interval: The time increment between pings to the server, in milliseconds.
function checkLogin(interval) {
var url = "/PingController.java";
var httpRequest = null;
if(window.XMLHttpRequest) {
httpRequest = new XMLHttpRequest();
}
else if(window.ActiveXObject) {
httpRequest = new ActiveXObject("Microsoft.XMLHTTP");
}
else {
return;
}
if(httpRequest != null) {
httpRequest.onreadystatechange = function() {
if(httpRequest.readyState == 4) {
if((httpRequest.status == 200) || (httpRequest.status == 0)) {
if(httpRequest.responseText == "") {
location.pathname = "/secure/index.html";
}
else {
if(httpRequest.responseText != userName) {
userName = httpRequest.responseText;
if(userName == "Anonymous") {
isAnonymous = true;
}
//TODO: May provide a personalized welcome to the user, also might want to enable a link to change the user's settings.
}
setTimeout("checkLogin('" + interval + "')", interval);
}
}
}
}
httpRequest.open("POST",url,true);
httpRequest.send(null);
}
}
//Called by the login/logout link at the top of the main page.
//Either displays the login portion of the view, or logs the user off and updates the link text.
function logout() {
var url = "/secure/LogoutController.java";
var httpRequest = null;
if(window.XMLHttpRequest) {
httpRequest = new XMLHttpRequest();
}
else if(window.ActiveXObject) {
httpRequest = new ActiveXObject("Microsoft.XMLHTTP");
}
else {
return;
}
if(httpRequest != null) {
httpRequest.open("POST",url,false);
httpRequest.send(null);
if((httpRequest.status == 200) || (httpRequest.status == 0)) {
document.getElementById("logLink").innerHTML = "Log In";
location.pathname = "/secure/index.html"
}
}
}
//Switches between visible components.
// fromComponentId: The component ID that will become invisible.
// toComponentId: The component ID that will become visible.
// focusComponentId: The component ID that will gain focus.
function switchComponents(fromComponentId, toComponentId, focusComponentId) {
errorText.innerHTML = "";
errorText.style.visibility = "hidden";
replaceFade(fromComponentId, userContentFadeOut, 5, toComponentId, userContentFadeIn, 5, focusComponentId);
}
//
// Called by the mouse over and out functions of the images and text associated with the main menu items.
//
function mainMenuRollover(textImageId, imageUrl) {
if(selectedTextImgId != textImageId) {
document.getElementById(textImageId).src = imageUrl;
}//if//
}//mainMenuRollover()//
//
// Opens the edit user settings popup.
//
function openSettings() {
var w = window.open('/secure/authenticated/identified/SettingsViewController.java', 'SettingsEditor', 'width=800,height=700,status,scrollbars,resizable');
w.focus();
}
//
// Opens a window to send a message to the company.
//
function contactUsClicked() {
window.open('/secure/ContactUsViewController.java', 'ContactUsEditor', 'width=800,height=800,status,scrollbars,resizable');
}

View File

@@ -0,0 +1,576 @@
/**
* Some knowledge picked up and generally applicable in the future:
* - Every 'node' in the tree has a parent node which is accessable via the 'parentNode' attribute (IE/Mozilla).
* - Custom attributes must be accessed by 'getAttribute("customAttribute")' and 'setAttribute("customAttribute", value)'.
* - The attribute 'tagName' gives the exact (in caps) name of any node.
*/
//
// Loads HTML and places inside the provided component.
//
function loadInnerHtml(url, component) {
loadInnerHtml(url, component, null);
}
//
// Loads HTML and places inside the provided component.
// url: The URL to invoke.
// component: The optional id of the HTML component whose inner html will be set to the response content.
// handler: The optional handler invoked after the response is succesfully received, and is passed a boolean indicating whether the response was success, and the integer response code. Example (refreshes): function(success, code) {if(!success && code == 412) {window.history.go(0);}}
//
function loadInnerHtml(url, component, handler) {
var httpRequest = null;
if(window.XMLHttpRequest) {
httpRequest = new XMLHttpRequest();
}
else if(window.ActiveXObject) {
httpRequest = new ActiveXObject("Microsoft.XMLHTTP");
}
else {
return;
}
if(httpRequest != null) {
httpRequest.onreadystatechange = function() {
if(httpRequest.readyState == 4) {
if((httpRequest.status == 200) || (httpRequest.status == 0)) {
if(component) {
var element = document.getElementById(component);
if(element) {
element.innerHTML = httpRequest.responseText;
}
}
if(handler) {
handler();
}
}
else {
//Note: Currently using 412 for a refresh - error numbers should never be cached by the browser.//
if(httpRequest.status == 412) {
//Refresh the current page.//
window.history.go(0);
}
}
}
}
httpRequest.open("GET",url,true);
httpRequest.send(null);
}
}
//Sends a ping to the server on a regular basis to prevent loss of the session.
// interval: The time increment between pings to the server, in milliseconds.
function ping(interval) {
var url = "/PingController.java";
var httpRequest = null;
if(window.XMLHttpRequest) {
httpRequest = new XMLHttpRequest();
}
else if(window.ActiveXObject) {
httpRequest = new ActiveXObject("Microsoft.XMLHTTP");
}
else {
return;
}
if(httpRequest != null) {
httpRequest.onreadystatechange = function() {
if(httpRequest.readyState == 4) {
if((httpRequest.status == 200) || (httpRequest.status == 0)) {
setTimeout("ping('" + interval + "')", interval);
}
}
}
httpRequest.open("POST",url,true);
httpRequest.send(null);
}
}
<!-- Changes the class of style used by the element with the given id to the new class. -->
function changeStyles(id, newClass) {
identity = document.getElementById(id);
identity.className = newClass;
}
<!-- Changes the PNG or GIF image used as the background for the given div tag's id. The GIF will only be used if the browser doesn't support PNG. The pngPath parameters must not have an extension. -->
<!-- Warning: In IE, the div tag must specify a height and width, otherwise the image will not repeat to fill the div. In Mozilla the image always repeats automatically. -->
<!-- Note: I have successfully gotten this to work passing the id for a list item instead of a div. I don't know what other tags support this (tested with firefox 1.5 & IE 6.0). -->
function changePng(divId, pngPath) {
var ns = (document.all) ? false : true;
var browserVersion = parseFloat(navigator.appVersion);
var style = getElementStyleById(divId);
if(pngPath) {
if((browser.isIE55 || browser.isIE6up) && browser.isWin32) {
style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + pngPath + ".png', sizingMethod='scale')";
} else if ((browser.isGecko) || (browser.isIE5up && browser.isMac) || (browser.isOpera && browser.isWin && browser.versionMajor >= 6) || (browser.isOpera && browser.isUnix && browser.versionMajor >= 6) || (browser.isOpera && browser.isMac && browser.versionMajor >= 5) || (browser.isOmniweb && browser.versionMinor >= 3.1) || (browser.isIcab && browser.versionMinor >= 1.9) || (browser.isWebtv) || (browser.isDreamcast)) {
style.backgroundImage = "url('" + pngPath + ".png')";
} else {
style.backgroundImage = "url('" + pngPath + ".gif')";
}
} else {
style.filter = "";
style.backgroundImage = "";
}
}
<!-- Changes the PNG or GIF image used as the background for the given div tag's id. The GIF will only be used if the browser doesn't support PNG. The pngPath parameters must not have an extension. -->
<!-- Warning: In IE, the div tag must specify a height and width, otherwise the image will not repeat to fill the div. In Mozilla the image always repeats automatically. -->
<!-- Note: I have successfully gotten this to work passing the id for a list item instead of a div. I don't know what other tags support this (tested with firefox 1.5 & IE 6.0). -->
function changeBackground(divId, imagePath) {
var ns = (document.all) ? false : true;
var browserVersion = parseFloat(navigator.appVersion);
var style = getElementStyleById(divId);
if(imagePath != null) {
var isPng = (imagePath.length > 4) && (imagePath.substring(imagePath.length - 4, imagePath.length) == ".png");
if(isPng) {
if((browser.isIE55 || browser.isIE6up) && browser.isWin32) {
internalRemoveIEFilter(style, "progid:DXImageTransform.Microsoft.AlphaImageLoader(");
style.filter += "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + imagePath + "', sizingMethod='scale')";
}
else if ((browser.isGecko) || (browser.isIE5up && browser.isMac) || (browser.isOpera && browser.isWin && browser.versionMajor >= 6) || (browser.isOpera && browser.isUnix && browser.versionMajor >= 6) || (browser.isOpera && browser.isMac && browser.versionMajor >= 5) || (browser.isOmniweb && browser.versionMinor >= 3.1) || (browser.isIcab && browser.versionMinor >= 1.9) || (browser.isWebtv) || (browser.isDreamcast)) {
style.backgroundImage = "url('" + imagePath + "')";
}
else {
//Try to load a GIF instead!//
style.backgroundImage = "url('" + imagePath.substring(0, imagePath.length - 4) + ".gif')";
}
}
else {
style.backgroundImage = "url('" + imagePath + "')";
}
}
else {
internalRemoveIEFilter(style, "progid:DXImageTransform.Microsoft.AlphaImageLoader(");
style.backgroundImage = "";
}
}
//Removes a filter from the IE filter property of an object if the filter property contains the given filter.
// style: The object's style whose filter will be removed.
// ieFilter: The starting text for the filter. For example: "progid:DXImageTransform.Microsoft.Alpha(".
function internalRemoveIEFilter(style, ieFilter) {
if(style.filter != null) {
var startIndex = style.filter.indexOf(ieFilter);
//Remove the alpha from the filter if it already exists.//
if(startIndex != -1) {
var endIndex = style.filter.indexOf(")", startIndex + ieFilter.length) + 1;
if(endIndex != -1) {
style.filter = style.filter.substring(0, startIndex) + style.filter.substring(endIndex, style.filter.length);
}
}
}
}
//IE Note: IE requires either the width or height to be specified for the object, or object.style.writingMode=tb-rl, or object.contentEditable=true (HTML: contenteditable='true').
// id: The id of the component being faded.
// opacityStart: The starting opacity of the component 0 = not visible, 100 = fully visible.
// opacityEnd: The ending opacity of the component.
// fadeTime: The number of milliseconds the fade should occur over.
// opacityIncrement: The increment size for each opacity change (must be a whole number >= 1).
// delay: The number of milliseconds of wait before begining the first fade increment.
// enterFunction: The optional function to be called when the fade begins.
// exitFunction: The optional function to be called when the fade ends.
function fade(id, opacityStart, opacityEnd, fadeTime, opacityIncrement, delay, enterFunction, exitFunction) {
var ns = (document.all) ? false : true;
if(ns) {
changeOpacity(opacityStart, id);
var opacityDelta = Math.abs(opacityEnd - opacityStart);
if(opacityIncrement < 1) {
opacityIncrement = 1;
}
else if(opacityIncrement > opacityDelta) {
opacityIncrement = opacityDelta;
}
else {
opacityIncrement = Math.round(opacityIncrement);
}
var granularity = 10;
var maxTimeIncrements = Math.floor(fadeTime / granularity);
var maxOpacityChangeIncrements = Math.ceil(opacityDelta / opacityIncrement);
var waitTime;
var opacityChange;
var timeIncrements;
if(maxOpacityChangeIncrements > maxTimeIncrements) {
waitTime = Math.floor(fadeTime / maxTimeIncrements);
opacityChange = Math.round(opacityDelta / maxTimeIncrements);
timeIncrements = maxTimeIncrements;
}
else {
waitTime = Math.floor(fadeTime / maxOpacityChangeIncrements);
opacityChange = opacityIncrement;
timeIncrements = maxOpacityChangeIncrements;
}
internalFade(id, opacityStart, opacityEnd, waitTime, opacityChange, timeIncrements, delay, enterFunction, exitFunction);
}
}
//IE Note: IE requires either the width or height to be specified for the object, or object.style.writingMode=tb-rl, or object.contentEditable=true (HTML: contenteditable='true').
// id: The id of the component being faded.
// lastOpacity: The last known opacity for the component. If the opacity isn't this value then the timer will discontinue to prevent flickering.
// opacityEnd: The ending opacity of the component.
// waitTime: The number of milliseconds to wait before performing the next fade increment.
// opacityChange: The amount the opacity should change each increment.
// remainingTimeIncrements: The number of increments remaining before the ending opacity is reached.
// delay: The number of milliseconds of wait before begining the first fade increment.
// enterFunction: The optional function to be called when the fade begins.
// exitFunction: The optional function to be called when the fade ends.
function internalFade(id, lastOpacity, opacityEnd, waitTime, opacityChange, remainingTimeIncrements, delay, enterFunction, exitFunction) {
//This could be null if another script has removed the elements we are fading.
if(document.getElementById(id) != null) {
if(delay != 0) {
setTimeout("internalFade('" + id + "'," + lastOpacity + "," + opacityEnd + "," + waitTime + "," + opacityChange + "," + remainingTimeIncrements + ",0," + enterFunction + "," + exitFunction + ")", delay);
}
else if(Math.round(getOpacity(id) * 100) == lastOpacity) {
if(enterFunction != null) {
enterFunction();
}
if(remainingTimeIncrements > 0) {
if(lastOpacity > opacityEnd) {
lastOpacity -= opacityChange;
}
else {
lastOpacity += opacityChange;
}
}
else {
lastOpacity = opacityEnd;
}
changeOpacity(lastOpacity, id);
if(remainingTimeIncrements-- > 0) {
setTimeout("internalFade('" + id + "'," + lastOpacity + "," + opacityEnd + "," + waitTime + "," + opacityChange + "," + remainingTimeIncrements + ",0,null," + exitFunction + ")", waitTime);
}
else if(exitFunction != null) {
exitFunction();
}
}
}
}
//IE Note: IE requires either the width or height to be specified for the object, or object.style.writingMode=tb-rl, or object.contentEditable=true (HTML: contenteditable='true').
//Replaces one component with another via a fade.
// fromId: The id of the component being faded out.
// fromFadeTime: The number of milliseconds the fade should occur over. This should be zero, negative, or null if no fade should occur.
// fromOpacityIncrement: The increment size for each opacity change (must be a whole number >= 1).
// toId: The id of the component being faded out.
// toFadeTime: The number of milliseconds the fade should occur over. This should be zero, negative, or null if no fade should occur.
// toOpacityIncrement: The increment size for each opacity change (must be a whole number >= 1).
// focusId: The ID of the component that will receive focus when the two fades finish.
function replaceFade(fromId, fromFadeTime, fromOpacityIncrement, toId, toFadeTime, toOpacityIncrement, focusId) {
var ns = (document.all) ? false : true;
if(ns && ((fromFadeTime && fromFadeTime > 0) || (toFadeTime && toFadeTime > 0))) {
var opacityDelta = 100;
if(fromOpacityIncrement < 1) {
fromOpacityIncrement = 1;
}
else if(fromOpacityIncrement > opacityDelta) {
fromOpacityIncrement = opacityDelta;
}
else {
fromOpacityIncrement = Math.round(fromOpacityIncrement);
}
if(toOpacityIncrement < 1) {
toOpacityIncrement = 1;
}
else if(toOpacityIncrement > opacityDelta) {
toOpacityIncrement = opacityDelta;
}
else {
toOpacityIncrement = Math.round(toOpacityIncrement);
}
var granularity = 10;
var fromMaxTimeIncrements = 0;
var fromMaxOpacityChangeIncrements = 0;
var fromWaitTime = 0;
var fromOpacityChange = 0;
var fromTimeIncrements = 0;
var toMaxTimeIncrements = 0;
var toMaxOpacityChangeIncrements = 0;
var toWaitTime = 0;
var toOpacityChange = 0;
var toTimeIncrements = 0;
if(fromFadeTime && fromFadeTime > 0) {
fromMaxTimeIncrements = Math.floor(fromFadeTime / granularity);
fromMaxOpacityChangeIncrements = Math.ceil(opacityDelta / fromOpacityIncrement);
if(fromMaxOpacityChangeIncrements > fromMaxTimeIncrements) {
fromWaitTime = Math.floor(fromFadeTime / fromMaxTimeIncrements);
fromOpacityChange = Math.round(opacityDelta / fromMaxTimeIncrements);
fromTimeIncrements = fromMaxTimeIncrements;
}
else {
fromWaitTime = Math.floor(fromFadeTime / fromMaxOpacityChangeIncrements);
fromOpacityChange = fromOpacityIncrement;
fromTimeIncrements = fromMaxOpacityChangeIncrements - 1;
}
}
if(toFadeTime && toFadeTime > 0) {
toMaxTimeIncrements = Math.floor(toFadeTime / granularity);
toMaxOpacityChangeIncrements = Math.ceil(opacityDelta / toOpacityIncrement);
if(toMaxOpacityChangeIncrements > toMaxTimeIncrements) {
toWaitTime = Math.floor(toFadeTime / toMaxTimeIncrements);
toOpacityChange = Math.round(opacityDelta / toMaxTimeIncrements);
toTimeIncrements = toMaxTimeIncrements;
}
else {
toWaitTime = Math.floor(toFadeTime / toMaxOpacityChangeIncrements);
toOpacityChange = toOpacityIncrement;
toTimeIncrements = toMaxOpacityChangeIncrements - 1;
}
}
if(fromId) {
changeOpacity(100, fromId);
}
internalReplaceFade(fromId, fromWaitTime, fromOpacityChange, fromTimeIncrements, toId, toWaitTime, toOpacityChange, toTimeIncrements, 100, focusId);
}
else {
var fromObject = document.getElementById(fromId);
var toObject = document.getElementById(toId);
if(fromObject) {
fromObject.style.visibility = "hidden";
fromObject.style.display = "none";
}
if(toObject) {
toObject.style.visibility = "visible";
toObject.style.display = "block";
}
if(focusId != null && focusId != 'null' && focusId != '') {
var focusComponent = document.getElementById(focusId);
if(focusComponent != null) {
focusComponent.focus();
if(focusComponent.type != null && focusComponent.type == "text") {
focusComponent.select();
}
}
else {
//alert("Can't find the focus component: " + focusId);
}
}
}
}
//IE Note: IE requires either the width or height to be specified for the object, or object.style.writingMode=tb-rl, or object.contentEditable=true (HTML: contenteditable='true').
//Internal use only.
// fromId: The id of the component being faded out.
// fromWaitTime: The number of milliseconds of wait between fade increments.
// fromOpacityChange: The opacity change for each increment.
// fromTimeIncrements: The number of remaining time increments.
// toId: The id of the component being faded out.
// toWaitTime: The number of milliseconds of wait between fade increments.
// toOpacityChange: The opacity change for each increment.
// toTimeIncrements: The number of remaining time increments.
// lastOpacity: The last opacity of the currently fading component.
// focusId: The ID of the component that will receive focus when the two fades finish.
function internalReplaceFade(fromId, fromWaitTime, fromOpacityChange, fromTimeIncrements, toId, toWaitTime, toOpacityChange, toTimeIncrements, lastOpacity, focusId) {
var fromObject = document.getElementById(fromId);
var toObject = document.getElementById(toId);
//This could be null if another script has removed the elements we are fading.
if(fromObject != null && toObject != null) {
if(fromTimeIncrements > 0) {
if(Math.round(getOpacity(fromId) * 100) == lastOpacity) {
var waitTime = fromWaitTime;
if(fromTimeIncrements > 1) {
lastOpacity -= fromOpacityChange;
changeOpacity(lastOpacity, fromId);
}
else {
lastOpacity = 0;
fromObject.style.visibility = "hidden";
fromObject.style.display = "none";
changeOpacity(0, fromId);
changeOpacity(0, toId);
toObject.style.visibility = "visible";
toObject.style.display = "block";
waitTime = toWaitTime;
if(focusId != null && focusId != 'null' && focusId != '') {
var focusComponent = document.getElementById(focusId);
if(focusComponent != null) {
focusComponent.focus();
if(focusComponent.type != null && focusComponent.type == "text") {
focusComponent.select();
}
}
else {
//alert("Can't find the focus component: " + focusId);
}
}
}
fromTimeIncrements--;
setTimeout("internalReplaceFade('" + fromId + "'," + fromWaitTime + "," + fromOpacityChange + "," + fromTimeIncrements + ",'" + toId + "'," + toWaitTime + "," + toOpacityChange + "," + toTimeIncrements + "," + lastOpacity + ",'" + focusId + "')", waitTime);
}
}
else {
if(Math.round(getOpacity(toId) * 100) == lastOpacity) {
if(toTimeIncrements > 1) {
lastOpacity += toOpacityChange;
}
else {
lastOpacity = 100;
}
changeOpacity(lastOpacity, toId);
if(toTimeIncrements-- > 0) {
setTimeout("internalReplaceFade('" + fromId + "'," + fromWaitTime + "," + fromOpacityChange + "," + fromTimeIncrements + ",'" + toId + "'," + toWaitTime + "," + toOpacityChange + "," + toTimeIncrements + "," + lastOpacity + ",'" + focusId + "')", toWaitTime);
}
}
}
}
}
function getOpacity(id) {
var object = document.getElementById(id).style;
return object.opacity;
}
//IE Note: IE requires either the width or height to be specified for the object, or object.style.writingMode=tb-rl, or object.contentEditable=true (HTML: contenteditable='true').
//Sets the opacity for an element.
// opacity: How visible the element is on a scale of 0..100 (not visible..fully visible).
// id: The id of the element whose opacity is being set.
function changeOpacity(opacity, id) {
var style = document.getElementById(id).style;
style.opacity = (opacity / 100);
style.MozOpacity = (opacity / 100);
style.KhtmlOpacity = (opacity / 100);
internalRemoveIEFilter(style, "progid:DXImageTransform.Microsoft.Alpha(");
style.filter = "progid:DXImageTransform.Microsoft.Alpha(opacity=" + opacity + ")" + style.filter;
}
// Browser Detect Lite v2.1
// http://www.dithered.com/javascript/browser_detect/index.html
// modified by Chris Nott (chris@NOSPAMdithered.com - remove NOSPAM)
//
// modified by Michael Lovitt to include OmniWeb and Dreamcast
function BrowserDetectLite() {
var ua = navigator.userAgent.toLowerCase();
this.ua = ua;
// browser name
this.isGecko = (ua.indexOf('gecko') != -1);
this.isMozilla = (this.isGecko && ua.indexOf("gecko/") + 14 == ua.length);
this.isNS = ( (this.isGecko) ? (ua.indexOf('netscape') != -1) : ( (ua.indexOf('mozilla') != -1) && (ua.indexOf('spoofer') == -1) && (ua.indexOf('compatible') == -1) && (ua.indexOf('opera') == -1) && (ua.indexOf('webtv') == -1) && (ua.indexOf('hotjava') == -1) ) );
this.isIE = ( (ua.indexOf("msie") != -1) && (ua.indexOf("opera") == -1) && (ua.indexOf("webtv") == -1) );
this.isOpera = (ua.indexOf("opera") != -1);
this.isKonqueror = (ua.indexOf("konqueror") != -1);
this.isIcab = (ua.indexOf("icab") != -1);
this.isAol = (ua.indexOf("aol") != -1);
this.isWebtv = (ua.indexOf("webtv") != -1);
this.isOmniweb = (ua.indexOf("omniweb") != -1);
this.isDreamcast = (ua.indexOf("dreamcast") != -1);
// spoofing and compatible browsers
this.isIECompatible = ( (ua.indexOf("msie") != -1) && !this.isIE);
this.isNSCompatible = ( (ua.indexOf("mozilla") != -1) && !this.isNS && !this.isMozilla);
// browser version
this.versionMinor = parseFloat(navigator.appVersion);
// correct version number for NS6+
if (this.isNS && this.isGecko) {
this.versionMinor = parseFloat( ua.substring( ua.lastIndexOf('/') + 1 ) );
}
// correct version number for IE4+
else if (this.isIE && this.versionMinor >= 4) {
this.versionMinor = parseFloat( ua.substring( ua.indexOf('msie ') + 5 ) );
}
// correct version number for Opera
else if (this.isOpera) {
if (ua.indexOf('opera/') != -1) {
this.versionMinor = parseFloat( ua.substring( ua.indexOf('opera/') + 6 ) );
}
else {
this.versionMinor = parseFloat( ua.substring( ua.indexOf('opera ') + 6 ) );
}
}
// correct version number for Konqueror
else if (this.isKonqueror) {
this.versionMinor = parseFloat( ua.substring( ua.indexOf('konqueror/') + 10 ) );
}
// correct version number for iCab
else if (this.isIcab) {
if (ua.indexOf('icab/') != -1) {
this.versionMinor = parseFloat( ua.substring( ua.indexOf('icab/') + 6 ) );
}
else {
this.versionMinor = parseFloat( ua.substring( ua.indexOf('icab ') + 6 ) );
}
}
// correct version number for WebTV
else if (this.isWebtv) {
this.versionMinor = parseFloat( ua.substring( ua.indexOf('webtv/') + 6 ) );
}
this.versionMajor = parseInt(this.versionMinor);
this.geckoVersion = ( (this.isGecko) ? ua.substring( (ua.lastIndexOf('gecko/') + 6), (ua.lastIndexOf('gecko/') + 14) ) : -1 );
// platform
this.isWin = (ua.indexOf('win') != -1);
this.isWin32 = (this.isWin && ( ua.indexOf('95') != -1 || ua.indexOf('98') != -1 || ua.indexOf('nt') != -1 || ua.indexOf('win32') != -1 || ua.indexOf('32bit') != -1) );
this.isMac = (ua.indexOf('mac') != -1);
this.isUnix = (ua.indexOf('unix') != -1 || ua.indexOf('linux') != -1 || ua.indexOf('sunos') != -1 || ua.indexOf('bsd') != -1 || ua.indexOf('x11') != -1)
// specific browser shortcuts
this.isNS4x = (this.isNS && this.versionMajor == 4);
this.isNS40x = (this.isNS4x && this.versionMinor < 4.5);
this.isNS47x = (this.isNS4x && this.versionMinor >= 4.7);
this.isNS4up = (this.isNS && this.versionMinor >= 4);
this.isNS6x = (this.isNS && this.versionMajor == 6);
this.isNS6up = (this.isNS && this.versionMajor >= 6);
this.isIE4x = (this.isIE && this.versionMajor == 4);
this.isIE4up = (this.isIE && this.versionMajor >= 4);
this.isIE5x = (this.isIE && this.versionMajor == 5);
this.isIE55 = (this.isIE && this.versionMinor == 5.5);
this.isIE5up = (this.isIE && this.versionMajor >= 5);
this.isIE6x = (this.isIE && this.versionMajor == 6);
this.isIE6up = (this.isIE && this.versionMajor >= 6);
this.isIE4xMac = (this.isIE4x && this.isMac);
}
var browser = new BrowserDetectLite();

View File

@@ -0,0 +1,25 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Email Validation Failed</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body onload="">
Validation of your email <b>failed</b>. The most likely cause was you are responding to an old validation email.
<br/>
<br/>
If you feel you have received this message in error you can connect to the website via the link below.
<br/>
You will have two options:
<br/>
1) Login by clicking WHO and providing a login and password. If you have not successfully validated your email it will give you an opportunity to change the email address and re-send the validation email. If the user was not succesfully created or has been removed then you will be unable to log in.
<br/>
2) Send us a message by clicking the "Contact Us" link on the main page and tell us what your problem is and how to get a hold of you.
<br/>
<br/>
We appologize for the inconvinence this is causing you and hope you will let us fix it for you by sending us a message.
<br/>
<br/>
<a href="http://domain1.com">Website</a>
</body>
</html>

View File

@@ -0,0 +1,25 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Email Validated</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script language="javascript" type="text/javascript">
function completeRedirect() {
location.href = "http://domain1.com";
}
function beginRedirect() {
//Wait 15 seconds.//
setTimeout("completeRedirect()", 15000);
}
</script>
</head>
<body onload="beginRedirect()">
You have successfully validated your email.
<br>
You will be redirected to the website momentarily, or you may click the link below.
<br>
<br>
<a href="http://domain1.com">Website</a>
</body>
</html>

View File

@@ -0,0 +1,236 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd">
<html>
<head>
<title>Main Page</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script language="javascript" src="common.js" type="text/javascript"></script>
<script language="javascript" src="main.js" type="text/javascript"></script>
<!-- Use one style sheet for IE and another for other browsers. -->
<script language="javascript">
<!--
var ua = navigator.userAgent.toLowerCase();
//Detect what browser this is and load the specific CSS for the browser.//
var isIE = ((ua.indexOf("msie") != -1) && (ua.indexOf("opera") == -1) && (ua.indexOf("webtv") == -1));
if(isIE) {
document.write('<'+'link rel="stylesheet" href="main.css" type="text/css"/>');
document.write('<'+'link rel="stylesheet" href="main-ie.css" type="text/css"/>');
}
else {
document.write('<'+'link rel="stylesheet" href="main.css" type="text/css"/>');
}
//-->
</script>
</head>
<body id="bodyId" onLoad="init();">
<div align="center" style="padding-top:4px;">
<div id="page">
<!-- The welcome and links above the border. -->
<div id="pageTop">
<span id="linksLeft">
<a href="javascript:" class="topMenuLink" style="color: #400">Sample Menu Item</a>
</span>
<span id="linksRight">
<a id="logLink" href="javascript:sendLoginData(null, null, true);" class="topMenuLink">Guest Login</a>
&nbsp|
<a id="logLink" href="javascript:showLogin();" class="topMenuLink">Login</a>
&nbsp|
<a href="javascript:" class="topMenuLink">SAMPLE MENU</a>
</span>
</div>
<!-- Everything inside the border. -->
<div id="pageCenter">
<!-- TODO: Place content here. -->
</div>
<!-- Contains link text and navigation - outside the border. -->
<div id="pageBottom">
</div>
</div>
</div>
<div class="copyrightDiv">
<p style="font: 8pt serif bold; color: white; padding: 0px; margin: 18px 0px 0px 0px; color: #999;">
&#169; DATE_HERE NAME_HERE. All rights reserved.
</p>
</div>
<!-- Dialog Container -->
<div id="dialogBackground" style="display: none; visibility: hidden; position: fixed; top: 0px; bottom: 0px; left: 0px; right: 0px; z-index: 10; background: black; opacity: 0.78; -moz-opacity: 0.78; -khtml-opacity: 0.78; filter: progid:dximagetransform.microsoft.alpha(opacity=78);">
</div>
<!-- Dialogs -->
<div id="whoDialog" style="display: none; visibility: hidden; position: fixed; top: 0px; bottom: 0px; left: 0px; right: 0px; z-index: 11; padding: 10px; width: 480px; height: 150px; background-color: #848589; border: 6px solid black;">
<a href="javascript:hideDialog()" style="padding: 0px; margin: 0px; position: relative; top: -30px; float: right; border: none;"><img src="images/close.gif" style="border: none; padding: 0px; margin: 0px;"></img></a>
</div>
<div id="loginDialog" style="display: none; visibility: hidden; position: fixed; top: 0px; bottom: 0px; left: 0px; right: 0px; z-index: 11; padding: 10px; width: 480px; height: 150px; background-color: #848589; border: 6px solid black;">
<div align="center" style="margin: 0px 0px 0px 0px">
<div id="errorText" valign="bottom" style="height: 30px; visibility: hidden; display: none; color: #700; font-family: arial; font-size: 8pt; font-weight: bold; padding: 0px 6px 0px 6px">
</div>
<!-- Note: calling login twice closes the dialog. -->
<a href="javascript:hideDialog()" style="padding: 0px; margin: 0px; position: relative; top: -30px; float: right; border: none;"><img src="/secure/images/close.gif" alt="close" style="border: none; padding: 0px; margin: 0px;"></img></a>
</div>
<div id="loginDiv" align="center" style="display: none; visibility: hidden; margin-top: 0px;">
<form id="loginForm" method="post" action="javascript:void sendLoginForm(document.getElementById('loginForm'), location.pathname)" target="_self" style="padding: 0px; margin: 0px;">
<table style="" cellpadding="0" cellspacing="3">
<tr>
<td class="topTextContentMedium" style="text-align: right; padding-bottom: 3px;" colspan="2">
<input id="anonymousLoginCheckbox" name="anonymousLoginCheckbox" style="color: #444; display: none; visibility: hidden;" type="checkbox" tabindex="2" value=""></input>
<!-- I prefer to login anonymously. Continue as guest. Login as Guest Login as guest - click here. -->
<a class="loginSideLinks" style="color: #DDD;" tabindex="2" href="javascript: document.getElementById('loginForm').anonymousLoginCheckbox.checked=true; sendLoginForm(document.getElementById('loginForm'));">Login as Guest</a>
</td>
</tr>
<tr>
<td style="text-align: right">
User Name:
</td>
<td>
<input id="userNameInput" maxlength="120" style="width: 190px" type="text" name="name" tabindex="1"/>
</td>
</tr>
<tr>
<td style="text-align: right">
Password:
</td>
<td>
<input id="userPasswordInput" maxlength="250" style="width: 190px" type="password" name="password" tabindex="1"/>
</td>
</tr>
<tr>
<td colspan="2">
<table cellpadding="0" cellspacing="0" style="padding: 0px; margin: 0px; width: 100%;">
<tr>
<td align="center">
<a style="color: #DDD" href="javascript:switchComponents('loginDiv', 'resetPasswordDiv', 'resetPasswordUserNameInput', false);" tabindex="3">Reset Password</a>
</td>
<td align="right">
<input id="loginButton" type="submit" name="login" value="Login" tabindex="1" class="button"/>
</td>
</tr>
</table>
</td>
</tr>
</table>
</form>
</div>
<div id="changePasswordDiv" align="center" style="display: none; visibility: hidden;">
<form id="changePasswordForm" method="post" action="javascript:void sendChangePasswordForm(document.getElementById('changePasswordForm'))" target="_self" style="padding: 0px; margin: 0px;">
<table style="height: 100%;" cellpadding="0" cellspacing="6">
<tr>
<td style="text-align: right">
New Password:
</td>
<td>
<input id="newPasswordInput" maxlength="250" type="password" name="newPassword" tabindex="1"/>
<input id="userLoginHiddenInput" type="hidden" name="userLoginHidden" tabindex="1"/>
<input id="oldPasswordHiddenInput" type="hidden" name="oldPasswordHidden" tabindex="1"/>
</td>
</tr>
<tr>
<td colspan="2" align="right">
<table cellpadding="0" cellspacing="0" style="padding: 0px; margin: 0px;">
<tr>
<td>
<input id="changePasswordButton" type="submit" name="changePassword" value="Login" tabindex="1" class="button" style=""/>
</td>
</tr>
</table>
</td>
</tr>
</table>
</form>
</div>
<div id="resetPasswordDiv" align="center" style="display: none; visibility: hidden;">
<form id="resetPasswordForm" method="post" action="javascript:void sendResetPasswordForm(document.getElementById('resetPasswordForm'))" target="_self" style="padding: 0px; margin: 0px;">
<table cellpadding="0" cellspacing="6">
<tr>
<td style="text-align: right">
User Name:
</td>
<td>
<input id="resetPasswordUserNameInput" maxlength="120" type="text" name="name" tabindex="1"/>
</td>
</tr>
<tr>
<td style="text-align: right">
Account Email:
</td>
<td>
<input id="resetPasswordEmailInput" maxlength="120" type="text" name="email" tabindex="1"/>
</td>
</tr>
<tr>
<td colspan="2">
<table cellpadding="0" cellspacing="0" style="float: right; padding: 0px; margin: 0px;">
<tr>
<td>
<a href="javascript:switchComponents('resetPasswordDiv', 'loginDiv', 'userNameInput', false);" tabindex="2">Login</a>
</td>
<td>
<input id="resetPasswordButton" type="submit" name="resetPassword" value="Reset Password" tabindex="1" class="button" style="width: 120px;"/>
</td>
</tr>
</table>
</td>
</tr>
</table>
</form>
</div>
<div id="resetPasswordSuccessDiv" align="center" style="display: none; visibility: hidden;">
<table cellpadding="0" cellspacing="0" style="padding: 0px; margin: 0px;">
<tr>
<td class="text">
Your password has been reset. An email will be sent shortly containing your temporary password.
</td>
</tr>
<tr style="height: 10px">
</tr>
<tr>
<td align="left">
<a style="font-size: 10pt;" href="javascript:switchComponents('resetPasswordSuccessDiv', 'loginDiv', 'userNameInput', false);" tabindex="1">Login</a>
</td>
</tr>
</table>
</div>
<div id="emailNotValidatedDiv" align="center" style="display: none; visibility: hidden;">
<p style="padding-left: 10px;">
Your email address not yet been validated.<br/>
You may change it below and the validation email will be resent.
</p>
<form id="revalidateEmailForm" method="post" action="javascript:void sendRevalidateEmailForm(document.getElementById('revalidateEmailForm'))" target="_self" style="padding: 0px 0px 0px 0px; margin: 0px 0px 0px 0px;">
<table style="padding: 0px 0px 0px 10px" cellpadding="0" cellspacing="6">
<tr>
<td>
Email:
</td>
<td>
<input id="userEmailAddressInput" maxlength="120" type="text" name="email" tabindex="1" style="width: 260px;"/>
<input id="userIdInput" type="hidden" name="userId"/>
</td>
<td>
<input id="resendValidationEmailButton" type="submit" name="resendValidationEmail" value="Resend" tabindex="2" class="button"/>
</td>
</tr>
</table>
</form>
</div>
<div id="validationEmailResentDiv" align="center" style="display: none; visibility: hidden;">
<table cellpadding="0" cellspacing="0" style="padding: 0px; margin: 0px;">
<tr>
<td>
Another email will be sent shortly to validate your email address.
</td>
</tr>
<tr style="height: 10px">
</tr>
<tr>
<td align="left">
<a style="font-size: 10pt;" href="javascript:switchComponents('validationEmailResentDiv', 'loginDiv', 'userNameInput', false);" tabindex="1">Login</a>
</td>
</tr>
</table>
</div>
</div>
</body>
</html>

View File

@@ -0,0 +1,567 @@
#page {
background-color: #949599;
padding: 0px;
margin: 0px;
height: 504px;
width: 821px;
}
#pageTop {
width: 705px;
height: 58px;
margin: 0px 58px 0px 58px;
}
#linksLeft {
margin-top: 38px;
float: left;
}
#linksRight {
margin-top: 38px;
float: right;
}
#pageCenter {
background-color: #949599;
border-width: 1px;
border-style: solid;
border-color: 8d2024;
padding: 4px 20px 20px 20px;
margin-left: 58px;
margin-top: 0px;
margin-right: 58px;
margin-bottom: 0px;
width: 663px;
height: 357px;
}
#topMainDiv {
width: 651px;
height: 150px;
margin-right: 8px;
margin-left: 8px;
}
#logoDiv {
width: 663px;
height: 77px;
}
#bottomMainDiv {
width: 663px;
height: 130px;
}
#pageBottom {
width: 821px;
height: 63px;
}
#pageBottomLinks {
width: 665px;
height: 10px;
margin: 0px 58px 0px 58px;
padding: 5px 20px 0px 20px;
}
.menuImageDiv {
width: 132.6px;
height: 130px;
clear: none;
float: left;
}
.menuImageImg {
cursor: pointer;
padding: 0px;
margin: 0px;
text-align: center;
vertical-align: baseline;
height: 83px;
width: 118px;
margin-top: 47px;
}
.menuTextDiv {
width: 133px;
height: 10px;
cursor: pointer;
clear: none;
float: left;
}
.menuTextImg {
}
.topMenuLink {
color: #000;
font-size: 9pt;
font-weight: normal;
margin-left: 6px;
margin-top: 42px;
margin-bottom: 6px;
height: 10px;
}
.loadedHtmlOuterTag {
height: 150;
width: 651;
}
.internalLink {
font-family: trebuchet ms;
font-size: 10pt;
font-weight: bold;
}
.copyrightDiv {
padding: 0px;
margin: 0px;
text-align: center;
}
/* The container for all the content just above the company logo. Inside the topMainDiv. */
.topContentContainer {
display: none;
visibility: hidden;
width: 651px;
height: 150px;
position: relative;
left: 0px;
top: 0px;
}
/* The container for the image title inside the topContentContainer. This displays right above the image and to the left. */
.topImageTitle {
height: 30px;
clear: left;
float: left;
margin-bottom: 3px;
cursor: hand;
cursor: pointer;
font-size: 1;
}
/* The header space to the right of the image title, and above the top contents. Inside the topContentContainer. */
.topHeader {
height: 30px;
clear: right;
float: left;
margin-bottom: 3px;
}
/* The space for the image associated with the content. Bottom left corner of the topContentContainer. */
.topImage {
width: 118px;
height: 117px;
clear: left;
float: left;
cursor: hand;
cursor: pointer;
}
/* The space for the text or other content to the right of the top image. Inside the topContentContainer. */
.topContent {
width: 523px;
height: 117px;
clear: right;
float: left;
text-align: left;
font-family: georgia;
font-size: 14pt;
font-weight: normal;
color: #000;
margin-left: 10px;
}
/* **** DIALOG STYLES **** */
#loginDialog td {
white-space: nowrap;
text-align: left;
font-family: Georgia;
font-size: 10pt;
font-weight: normal;
color: #000;
}
#loginDialog input {
font-family: trebuchet ms;
font-size: 10pt;
font-weight: bold;
}
#loginDialog a {
font-family: Verdana, sans-serif;
font-size: 8pt;
font-weight: bold;
padding: 2px 2px 2px 2px;
margin: 0px 0px 0px 0px;
color: #000;
text-decoration: none;
}
#loginDialog a:hover {
text-decoration: underline;
}
#loginDialog p {
style="white-space: normal;"
text-align: left;
font-family: Georgia;
font-size: 11pt;
font-weight: normal;
color: #000;
}
#loginDialog .text {
white-space: normal;
text-align: left;
font-family: Georgia;
font-size: 11pt;
font-weight: normal;
color: #000;
}
#loginDialog .button {
font-family: Verdana, sans-serif;
font-size: 8pt;
font-weight: bold;
width: 60px;
padding: 2px 2px 2px 2px;
margin: 0px 0px 0px 10px;
}
/* **** END DIALOG STYLES **** */
/* The top div's text content's styles. */
/* The smallest size. */
.topTextContentSmall {
text-align: left;
font-family: Georgia;
font-size: 12pt;
font-weight: normal;
color: #000;
}
/* The medium size. */
.topTextContentMedium {
text-align: left;
font-family: Georgia;
font-size: 13pt;
font-weight: normal;
color: #000;
}
/* The standard size. */
.topTextContent {
text-align: left;
font-family: georgia;
font-size: 14pt;
font-weight: normal;
color: #000;
}
.topTextContentSmall[disabled=true] {
text-align: left;
font-family: Georgia;
font-size: 12pt;
font-weight: normal;
color: #666;
}
.topTextContentMedium[disabled=true] {
text-align: left;
font-family: Georgia;
font-size: 13pt;
font-weight: normal;
color: #666;
}
.topTextContent[disabled=true] {
text-align: left;
font-family: Georgia;
font-size: 14pt;
font-weight: normal;
color: #666;
}
/* The label text style. Used for any text labeling a data entry field or widget. */
.labelText {
text-align: right;
font-family: georgia;
font-size: 9pt;
font-weight: bold;
color: #000;
}
.labelText2 {
text-align: left;
font-family: Georgia;
font-size: 13pt;
font-weight: normal;
color: #000;
}
/* The side links for the login view. */
.loginSideLinks {
font-family: Verdana, sans-serif;
font-size: 8pt;
font-weight: bold;
padding: 2px 2px 2px 2px;
margin: 0px 0px 0px 0px;
color: #000;
text-decoration: none;
}
a.loginSideLinks:hover {
font-family: Verdana, sans-serif;
font-size: 8pt;
font-weight: bold;
padding: 2;
margin: 0px 0px 0px 0px;
color: #444;
text-decoration: underline;
}
/* The top div's button styles. */
.topButton {
font-family: Verdana, sans-serif;
font-size: 8pt;
font-weight: bold;
width: 60px;
padding: 2px 2px 2px 2px;
margin: 0px 0px 0px 10px;
}
.loginLink {
font-family: Verdana, sans-serif;
font-size: 8pt;
padding: 2px 2px 2px 2px;
margin: 0px 0px 0px 10px;
color: #000;
}
.licenseLink {
font-family: Verdana;
font-size: 8pt;
font-weight: bold;
color: #333;
text-decoration: none;
}
a.licenseLink:hover {
color: #555;
text-decoration: underline;
}
a {
font-family: Verdana, sans-serif;
font-size: 9pt;
font-weight: bold;
}
img {
padding: 0px 0px 0px 0px;
margin: 0px 0px 0px 0px;
}
button {
margin: 0px 0px 0px 0px;
padding: 0px 0px 0px 0px;
font-family: Verdana, sans-serif;
font-size: 8pt;
}
input {
margin: 0px 0px 0px 0px;
padding: 0px 0px 0px 0px;
font-family: Verdana, sans-serif;
font-size: 8pt;
}
div {
margin: 0px 0px 0px 0px;
padding: 0px 0px 0px 0px;
}
table {
margin: 0px 0px 0px 0px;
padding: 0px 0px 0px 0px;
}
tr {
margin: 0px 0px 0px 0px;
padding: 0px 0px 0px 0px;
}
td {
margin: 0px 0px 0px 0px;
padding: 0px 0px 0px 0px;
}
form {
margin: 0px 0px 0px 0px;
padding: 0px 0px 0px 0px;
}
body {
background-color: black;
}
.customH3 {
font: 14pt Geneva bold;
border-bottom: 1px solid #999999;
padding: 0px 0px 0px 0px;
margin: 8px 0px 4px 0px;
}
/*
ul {
font: 10pt Arial normal;
text-transform: capitalize;
color: #000000;
list-style-type: none;
padding: 0px;
margin: 0px 0px 10px 0px;
}
li {
font: 10pt Arial;
text-transform: capitalize;
color: black;
cursor: pointer;
padding: 0px 0px 0px 34px;
margin: 0px;
}
.hoverLi {
color: #5c3566;
width: 190px;
}
*/
h1 {
padding: 0px 0px 0px 0px;
margin: 0px;
}
.clickMenuItem {
font-family: Times New Roman, sans-serif;
font-size: 12pt;
font-weight: bold;
color: black;
cursor: pointer;
padding: 0px 0px 0px 0px;
margin: 0px;
}
.clickMenuItemHover {
font-family: Times New Roman, sans-serif;
font-size: 12pt;
font-weight: bold;
color: #5c3566;
cursor: pointer;
padding: 0px 0px 0px 0px;
margin: 0px;
}
.clickMenuDiv {
width: 200px;
padding-right:10px;
padding-left:0px;
margin-left:10px;
margin-top:10px;
}
/* used only by QAndA: Should be renamed to hoverMenuItem */
.tableList {
font: 10pt Arial, sans-serif;
text-transform: capitalize;
color: black;
cursor: pointer;
padding: 0px 0px 0px 0px;
margin: 0px;
}
/* used only by QAndA: Should be renamed to hoverMenuItemHover */
.hoverLi {
font: 10pt Arial, sans-serif;
text-transform: capitalize;
color: #5c3566;
cursor: pointer;
padding: 0px 0px 0px 0px;
margin: 0px;
}
/* used only by QAndA: Should be renamed to hoverMenuDiv */
.leftText {
width: 240px;
padding-right:10px;
padding-left:0px;
margin-left:0px;
}
.rightText {
width: 480px;
height: 300px;
padding: 0px;
}
.outerDiv {
padding: 0px;
margin: 0px;
}
.contentTableDiv {
border: 1px solid #101010;
padding: 0px 0px 0px 0px;
margin: 0px;
width: 790px;
}
.contentDiv {
height: 460px;
}
.noticeDiv {
margin:14px 10px 0px 10px;
padding: 0px 0px 0px 0px;
width: 770px;
}
.menuDiv {
width: 792px;
padding: 0px;
margin: 0px;
}
.detailsBorderCell_None {
border-left: 1px solid #d9d9d9;
}
.detailsBorderCell_Border {
border-left: 1px solid #000000;
}
.logoDiv {
padding: 0px;
margin: 0px;
width: 790px;
height: 60px;
}
.logoTable {
margin:0px;
padding:0px;
}
.leftLogoDiv {
width: 30px;
height: 50px;
padding: 0px 0px 0px 0px;
margin: 0px 0px 0px 0px;
}
.rightLogoDiv {
width: 30px;
height: 50px;
padding: 0px 0px 0px 0px;
margin: 0px 0px 0px 0px;
}
.menuTableTop {
/*background-color: #000; /* FF0000 */
}
.menuTableMiddle {
/*background-color: #47C; /* FF6633 */
}
.menuTable {
margin:0px;
padding: 0px;
/* background-color: #ADF;*/
background-color: #555;
}
.menuTableButtonOver {
font: 10pt Arial, sans-serif;
font-weight: bold;
text-transform: capitalize;
text-decoration: underline;
color: white;
cursor: pointer;
padding: 2px 5px 2px 5px;
margin: 0px;
background-color: #555;
}
.menuTableButtonSelected {
font: 10pt Arial, sans-serif;
font-weight: bold;
text-transform: capitalize;
color: white;
cursor: pointer;
padding: 2px 5px 2px 5px;
margin: 0px;
background-color: #000;
}
.menuTableButton {
font: 10pt Arial, sans-serif;
font-weight: bold;
text-transform: capitalize;
color: white;
cursor: pointer;
padding: 2px 5px 2px 5px;
margin: 0px;
background-color: #555;
/*border: 3px groove #000000;*/
}

View File

@@ -0,0 +1,629 @@
//Fade constants.//
var userContentFadeOut = 800;
var userContentFadeIn = 1400;
var mainFadeImageDelay = 0;
var mainFadeImagePeriod = 2000;
var mainFadeTitleDelay = 500;
var mainFadeTitlePeriod = 1500;
var mainFadeContentDelay = 1500;
var mainFadeContentPeriod = 1000;
//Variables used to show/hide the top content and make the buttons along the bottom function.//
var selectedTextId;
var selectedImageId;
var selectedBlackTextImage;
var visibleContentBlock;
//Variables used by the login dialog.//
var isDisplayingLogin = false;
//Login information.//
var isLoggedIn = false;
var canDownloadPresentationBrief = false;
var userName = 0;
//
// Initializes the main view.
//
function init() {
checkLogin(240000);
}
//
// Sends a ping to the server on a regular basis to prevent loss of the session and to check the logged in status of the user.
// Updates the logLink to display Log In or Log Out depending on the login state.
// interval: The time increment between pings to the server, in milliseconds.
//
function checkLogin(interval) {
var url = "/PingController.java";
var httpRequest = null;
if(window.XMLHttpRequest) {
httpRequest = new XMLHttpRequest();
}
else if(window.ActiveXObject) {
httpRequest = new ActiveXObject("Microsoft.XMLHTTP");
}
else {
return;
}
if(httpRequest != null) {
httpRequest.onreadystatechange = function() {
if(httpRequest.readyState == 4) {
if((httpRequest.status == 200) || (httpRequest.status == 0)) {
if(httpRequest.responseText != "" && !isLoggedIn) {
document.getElementById("logLink").innerHTML = "Log Out";
isLoggedIn = true;
if(httpRequest.responseText != userName) {
userName = httpRequest.responseText;
document.getElementById("welcomeSpan").innerHTML = "Logged in as: " + userName;
}
}
else if(httpRequest.responseText == "" && isLoggedIn) {
document.getElementById("logLink").innerHTML = "Log In";
document.getElementById("welcomeSpan").innerHTML = "";
isLoggedIn = false;
}
if(interval > 0) {
setTimeout("checkLogin('" + interval + "')", interval);
}
}
}
}
httpRequest.open("POST",url,true);
httpRequest.send(null);
}
}
//
// Called by the login link at the top of the main page.
// Displays the login dialog.
//
function showLogin() {
var loginDiv = document.getElementById('loginDiv');
var changePasswordDiv = document.getElementById('changePasswordDiv');
var resetPasswordDiv = document.getElementById('resetPasswordDiv');
var resetPasswordSuccessDiv = document.getElementById('resetPasswordSuccessDiv');
var emailNotValidatedDiv = document.getElementById('emailNotValidatedDiv');
var validationEmailResentDiv = document.getElementById('validationEmailResentDiv');
var errorTextControl = document.getElementById("errorText");
loginDiv.style.display = 'block';
loginDiv.style.visibility = 'visible';
changePasswordDiv.style.display = 'none';
changePasswordDiv.style.visibility = 'hidden';
resetPasswordDiv.style.display = 'none';
resetPasswordDiv.style.visibility = 'hidden';
resetPasswordSuccessDiv.style.display = 'none';
resetPasswordSuccessDiv.style.visibility = 'hidden';
emailNotValidatedDiv.style.display = 'none';
emailNotValidatedDiv.style.visibility = 'hidden';
validationEmailResentDiv.style.display = 'none';
validationEmailResentDiv.style.visibility = 'hidden';
displayDialog("dialogBackground", "loginDialog");
var focusComponent = document.getElementById("userNameInput");
if(focusComponent != null) {
focusComponent.focus();
if(focusComponent.type != null && focusComponent.type == "text") {
focusComponent.select();
}
}
if(errorTextControl) {
errorTextControl.innerHTML = "";
errorTextControl.style.visibility = "hidden";
errorTextControl.style.display = "block";
}
}
//
// Switches between visible components.
// fromComponentId: The component ID that will become invisible.
// toComponentId: The component ID that will become visible.
// focusComponentId: The component ID that will gain focus.
// fade: Whether a fade should occur. This should be non-null if true.
function switchComponents(fromComponentId, toComponentId, focusComponentId, fade) {
var errorText = document.getElementById("errorText");
if(errorText) {
errorText.innerHTML = "";
errorText.style.visibility = "hidden";
}
replaceFade(fromComponentId, fade ? userContentFadeOut : 0, 5, toComponentId, fade ? userContentFadeIn : 0, 5, focusComponentId);
}
//
// Called by the mouse over and out functions of the images and text associated with the main menu items.
//
function mainMenuRollover(textImageId, imageUrl) {
if(selectedTextId != textImageId) {
document.getElementById(textImageId).src = imageUrl;
}//if//
}//mainMenuRollover()//
//
// Opens terms of use for the site.
//
function openTermsOfUse() {
var w = window.open('/legal/TermsOfUse.txt', 'Terms of Use', 'width=800,height=700,status,scrollbars,resizable');
w.focus();
}
//
// Opens privacy policy for the site.
//
function openPrivacyPolicy() {
var w = window.open('/legal/PrivacyPolicy.txt', 'Privacy Policy', 'width=800,height=700,status,scrollbars,resizable');
w.focus();
}
//
// Opens a window to send a message to the company.
//
function contactUsClicked() {
var w = window.open('/secure/ContactUsViewController.java', 'ContactUsEditor', 'width=800,height=700,status,scrollbars,resizable');
w.focus();
}
//
// Sets the error text element. The error text element is currently only used by the login view portion.
//
function setErrorText(errorText) {
var errorTextControl = document.getElementById("errorText");
if(errorTextControl) {
errorTextControl.innerHTML = errorText;
errorTextControl.style.visibility = "visible";
}
}
//
// Clears the error text element. The error text element is currently only used by the login view portion.
//
function clearErrorText() {
var errorTextControl = document.getElementById("errorText");
if(errorTextControl) {
errorTextControl.innerHTML = "";
errorTextControl.style.visibility = "hidden";
}
}
//
// Sends the login form data to the server.
//
function sendLoginForm(form, successPathName) {
var changePassword = form.changePasswordCheckbox && form.changePasswordCheckbox.checked;
var anonymous = form.anonymousLoginCheckbox && form.anonymousLoginCheckbox.checked;
if(!successPathName) {
successPathName = "/secure/authenticated/index.html";
}
if(anonymous || validateLoginForm(form)) {
var login = form.userNameInput.value;
var password = form.userPasswordInput.value;
sendLoginData(login, password, changePassword anonymous, successPathName);
}
}
//
// Sends the login data to the server.
//
function sendLoginData(login, password, changePassword, anonymous, successPathName) {
var url;
var request = null;
if(!successPathName) {
successPathName = "/secure/authenticated/index.html";
}
if(anonymous) {
url = "/secure/LoginController.java?login=" + encodeURIComponent("anonymous");
}
else {
url = "/secure/LoginController.java?login=" + encodeURIComponent(login) + "&password=" + encodeURIComponent(password) + "&changePassword=" + encodeURIComponent(changePassword ? "true" : "false");
}
if(window.XMLHttpRequest) {
request = new XMLHttpRequest();
}
else if(window.ActiveXObject) {
request = new ActiveXObject("Microsoft.XMLHTTP");
}
else {
return;
}
if(request != null) {
request.open("POST", url, false);
request.send(null);
if((request.status == 200) || (request.status == 0)) {
if(request.responseText.indexOf("success") == 0) {
//Load the logged in page.//
location.pathname = successPathName;
}
else if(request.responseText.indexOf("change-password") == 0) {
switchComponents('loginDiv', 'changePasswordDiv', 'newPasswordInput');
document.getElementById('oldPasswordHiddenInput').value = password;
document.getElementById('userLoginHiddenInput').value = login;
}
else if(request.responseText.indexOf("email-not-validated") == 0) {
switchComponents('loginDiv', 'emailNotValidatedDiv', 'userEmailAddressInput');
//The response text will be followed by the user id and then the user's email address separated by colons.//
document.getElementById("revalidateEmailForm").userIdInput.value = request.responseText.substring(request.responseText.indexOf(":") + 1, request.responseText.lastIndexOf(":"));
document.getElementById("revalidateEmailForm").userEmailAddressInput.value = request.responseText.substring(request.responseText.lastIndexOf(":") + 1, request.responseText.length);
clearErrorText();
}
else {
//Unexpected: For now just show a bad login.//
if(anonymous) {
setErrorText("Anonymous login failed for an unknown reason.");
}
else {
setErrorText("Invalid login name or password.");
}
}
}
else {
//Show the error text to the user: bad login.//
if(anonymous) {
setErrorText("Anonymous login failed for an unknown reason.");
}
else {
setErrorText("Invalid login name or password.");
}
}
}
}
//
// Validates the login form.
//
function validateLoginForm(form) {
var login = form.login.value;
var password = form.password.value;
var errorText = document.getElementById("errorText");
if(login == null) {
setErrorText("A login and password must first be provided.");
return false;
}
else if(login.toLowerCase() == "anonymous") {
setErrorText("Anonymous is not a valid login name.");
return false;
}
else {
return true;
}
}
//
// Sends the change password form data to the server.
//
function sendChangePasswordForm(form, successPathName) {
var login = form.userLoginHiddenInput.value;
var oldPassword = form.oldPasswordHiddenInput.value;
var newPassword = form.newPasswordInput.value;
var url = "/secure/LoginController.java?login=" + encodeURIComponent(login) + "&password=" + encodeURIComponent(oldPassword) + "&newPassword=" + encodeURIComponent(newPassword);
var request = null;
var isNewPasswordValid = newPassword != null && newPassword.length >= 4;
if(!successPathName) {
successPathName = "/secure/authenticated/index.html";
}
if(!isNewPasswordValid) {
setErrorText("The password must be a minimum of 4 characters long.");
}
else {
if(window.XMLHttpRequest) {
request = new XMLHttpRequest();
}
else if(window.ActiveXObject) {
request = new ActiveXObject("Microsoft.XMLHTTP");
}
else {
return;
}
if(request != null) {
request.open("POST", url, false);
request.send(null);
if((request.status == 200) || (request.status == 0)) {
if(request.responseText == "success") {
//Load the logged in page.//
location.href = successPathName;
}
else if(request.responseText == "bad-password") {
setErrorText("The password must be a minimum of 4 characters long.");
}
else if(request.responseText.indexOf("email-not-validated") == 0) {
switchComponents('loginDiv', 'emailNotValidatedDiv', 'userEmailAddressInput');
//The response text will be followed by the user id and then the user's email address separated by colons.//
document.getElementById("userIdInput").value=request.responseText.substring(request.responseText.indexOf(":") + 1, request.responseText.lastIndexOf(":"));
document.getElementById("userEmailAddressInput").value=request.responseText.substring(request.responseText.lastIndexOf(":") + 1, request.responseText.length);
clearErrorText();
}
else {
//Unexpected: For now just show a bad login.//
setErrorText("Invalid login name or password.");
}
}
else {
//Show the error text to the user: bad login.//
setErrorText("Invalid login name or password.");
}
}
}
}
//
// Sends the reset password form data to the server.
//
function sendResetPasswordForm(form) {
if(validateResetPasswordForm(form)) {
var login = form.resetPasswordUserNameInput.value;
var email = form.resetPasswordEmailInput.value;
var url = "/secure/ResetPasswordController.java?login=" + encodeURIComponent(login) + "&email=" + encodeURIComponent(email);
var request = null;
if(window.XMLHttpRequest) {
request = new XMLHttpRequest();
}
else if(window.ActiveXObject) {
request = new ActiveXObject("Microsoft.XMLHTTP");
}
else {
return;
}
if(request != null) {
request.open("POST", url, false);
request.send(null);
if((request.status == 200) || (request.status == 0)) {
if(request.responseText == "success") {
switchComponents('resetPasswordDiv', 'resetPasswordSuccessDiv', null);
}
else if(request.responseText.indexOf("bad-email") == 0) {
setErrorText("Invalid email name.");
}
else if(request.responseText.indexOf("bad-login") == 0) {
setErrorText("Invalid login address.");
}
else {
//Unexpected: For now just show a bad data msg.//
setErrorText("Invalid login name or email address.");
}
}
else {
//Show the error text to the user: bad data.//
setErrorText("Invalid login name or email address.");
}
}
}
}
//
// Validates the reset password form.
//
function validateResetPasswordForm(form) {
return true;
}
//
// Requests a reminder email be sent to the address containing the user's login name.
//
function emailLoginName(emailAddress) {
var url = "/secure/EmailLoginNameController.java?email=" + emailAddress;
var request;
if(window.XMLHttpRequest) {
request = new XMLHttpRequest();
}
else {
request = new ActiveXObject("Microsoft.XMLHTTP");
}
if(request != null) {
request.open("POST", url, false);
request.send(null);
setErrorText("An email will be sent shorty containing your login name.");
}
}
//
// Sends the revalidate email request to the server.
//
function sendRevalidateEmailForm(form) {
var email = form.userEmailAddressInput.value;
var userId = form.userIdInput.value;
var url;
var request = null;
if(email != null && email.length > 0) {
var isEmailValid = validateNewUserEmail(email, false) == 0;
if(isEmailValid) {
clearErrorText();
url = "/secure/RevalidateEmailController.java?id=" + encodeURIComponent(userId) + "&email=" + encodeURIComponent(email);
}
else {
setErrorText("A valid email address is required to validate the account.");
}
}
else {
clearErrorText();
url = "/secure/RevalidateEmailController.java?id=" + encodeURIComponent(userId);
}
if(url != null) {
if(window.XMLHttpRequest) {
request = new XMLHttpRequest();
}
else if(window.ActiveXObject) {
request = new ActiveXObject("Microsoft.XMLHTTP");
}
else {
return;
}
if(request != null) {
request.onreadystatechange = function() {
if(request.readyState == 4) {
if((request.status == 200) || (request.status == 0)) {
if(request.responseText == "success") {
//Display the success message.//
switchComponents('emailNotValidatedDiv', 'validationEmailResentDiv', null);
clearErrorText();
}
else if(request.responseText == "failed") {
//Display a message indicating that the server is unable to send email at the moment.//
setErrorText("The server is having a problem sending email at the moment. We appologize for the inconvience, please try again later.");
}
else {
//Unexpected: For now just show a bad login.//
setErrorText("The server is having a problem processing your request at this time. We appologize for the inconvience, please try again later.");
}
}
else {
//Show the error text to the user: bad login.//
setErrorText("The server is having a problem processing your request at this time. We appologize for the inconvience, please try again later.");
}
}
}
request.open("POST", url, true);
request.send(null);
}
}
}
//
//
// BEGIN DIALOG CODE
//
//
var visibleDialog = null;
var visibleBackground = null;
var oldResizeHandler = null;
var dialogOffsetMetrics = null;
var dialogOffsetNumber = null;
//
// Displays the given dialog with the given background panel.
// backgroundId: The optional identifier for the background panel being used.
// dialogId: The non-optional identifier of the dialog being displayed.
// verticalOffset: The pixel offset from the top of the window to the top of the dialog. This may be a percent, in which case it is the percent of the window not taken by the dialog that occurs between the dialog top and the window top. Example: 10px, 10%.
//
function displayDialog(backgroundId, dialogId, verticalOffset) {
var offsetRegex = /(\d+)(px|%)?/i;
var regexResults = verticalOffset == null ? null : offsetRegex.exec(verticalOffset);
if(regexResults != null) {
dialogOffsetNumber = regexResults[1];
dialogOffsetMetrics = regexResults[2];
}
else {
dialogOffsetNumber = 33;
dialogOffsetMetrics = "%";
}
hideDialog();
visibleDialog = document.getElementById(dialogId);
if(backgroundId != null) {
visibleBackground = document.getElementById(backgroundId);
visibleBackground.style.display = "block";
visibleBackground.style.visibility = "visible";
}
else {
visibleBackground = null;
}
//Make the dialog visible.//
visibleDialog.style.display = "block";
visibleDialog.style.visibility = "visible";
//Size things.//
oldResizeHandler = window.onresize;
window.onresize = resizeWindow;
resizeWindow();
}
function hideDialog() {
if(visibleDialog) {
if(visibleBackground) {
visibleBackground.style.display = "none";
visibleBackground.style.visibility = "hidden";
visibleBackground = null;
}
visibleDialog.style.display = "none";
visibleDialog.style.visibility = "hidden";
visibleDialog = null;
window.onresize = oldResizeHandler;
oldResizeHandler = null;
}
}
function resizeWindow() {
if(visibleDialog) {
var windowHeight = 0;
var windowWidth = 0;
if(navigator.appName.indexOf("Microsoft") != -1) {
var htmlHeight = document.body.parentNode.clientHeight;
windowHeight = htmlHeight < window.screen.height ? htmlHeight : window.screen.height; //document.body.offsetHeight;
//alert("window height:" + windowHeight + "; html height:" + htmlHeight + "; offset height:" + document.body.offsetHeight);
windowWidth = document.body.offsetWidth;
}
else {
windowHeight = window.innerHeight;
windowWidth = window.innerWidth;
}
//alert(windowHeight + " " + windowWidth + " " + visibleDialog.clientHeight + " " + visibleDialog.clientWidth);
var boundingRect = visibleDialog.getBoundingClientRect();
if(visibleBackground) {
visibleBackground.style.top = 0;
visibleBackground.style.left = 0;
visibleBackground.style.bottom = windowHeight;
visibleBackground.style.right = windowWidth;
visibleBackground.style.height = windowHeight;
visibleBackground.style.width = windowWidth;
}
if(dialogOffsetMetrics == "%") {
visibleDialog.style.top = Math.round(((windowHeight - visibleDialog.clientHeight) / 100) * dialogOffsetNumber) + "px";
}
else {
visibleDialog.style.top = dialogOffsetNumber;
}
//Always center on the horizontal axis.//
visibleDialog.style.left = Math.round((windowWidth - visibleDialog.clientWidth) / 2) + "px";
}
if(oldResizeHandler) {
oldResizeHandler();
}
}
//
//
// END DIALOG CODE
//
//

View File

@@ -0,0 +1,164 @@
.outerMainTable {
background-color: #949599;
padding: 0px 0px 0px 0px;
margin: 0px 0px 0px 0px;
}
.innerMainTable {
background-color: #949599;
border-width: 1px;
border-style: solid; /**/
border-color: #8d2024;
/*Padding: Space between border & content.*/
padding: 0 0 0 0;
/*Margin: Space around the border.*/
margin: 28px 28px 28px 28px;
width: 700;
}
.warningText {
color: #700;
font-family: arial;
font-size: 8pt;
font-weight: bold;
}
.messageText {
color: #700;
font-family: arial;
font-size: 10pt;
font-weight: bold;
text-align: left;
}
.copyrightDiv {
padding: 0px;
margin: 0px;
text-align: center;
}
.internalLink {
font-family: trebuchet ms;
font-size: 10pt;
font-weight: bold;
}
a.internalLink:visited {
color: #00D;
}
a.internalLink:active {
color: #700;
}
a.internalLink:hover {
color: #007;
}
.headingText {
background: #444;
font-family: Arial;
font-size: 10pt;
font-weight: 800;
color: #DDD;
font-variant: small-caps;
padding-left: 30px;
}
.defaultText {
font-family: georgia;
font-size: 14pt;
font-weight: normal;
text-indent: 30px;
}
.tableText {
font-family: georgia;
font-size: 14pt;
font-weight: normal;
padding-left: 15px;
text-indent: 0px;
}
.downloadTable {
background: #848589;
}
.downloadTableTh {
background: #444;
font-family: Arial;
font-size: 10pt;
font-weight: 800;
color: #DDD;
font-variant: small-caps;
padding-left: 30px;
padding-right: 30px;
}
.downloadTableTd {
font-family: trebuchet ms;
font-size: 10pt;
font-weight: bold;
text-indent: 0px;
text-align: center;
padding-left: 10px;
padding-right: 10px;
}
.downloadTableLink {
font-family: trebuchet ms;
font-size: 10pt;
font-weight: bold;
}
a.downloadTableLink:visited {
color: #00D;
}
a.downloadTableLink:active {
color: #700;
}
a.downloadTableLink:hover {
color: #007;
}
p {
font-family: georgia;
font-size: 14pt;
font-weight: normal;
text-indent: 30px;
}
div {
padding: 0 0 0 0;
margin: 0 0 0 0;
}
table {
padding: 0px;
margin: 0px;
}
tr {
padding: 0px;
margin: 0px;
}
td {
padding: 0px;
margin: 0px;
font-family: georgia;
font-size: 14pt;
font-weight: normal;
}
form {
padding: 0px;
margin: 0px;
}
body {
background-color: black;
}
h1 {
margin: 0 0 0 0;
font-family: arial;
font-size: 32pt;
font-weight: bold;
}
h2 {
font-family: arial;
font-size: 24pt;
font-weight: bold;
}
h3 {
font-family: arial;
font-size: 14pt;
font-weight: bold;
}
li {
font-family: Verdana;
font-size: 13pt;
font-weight: normal;
margin: 0 0 0 0;
padding: 0 0 0 0;
}

View File

@@ -0,0 +1,6 @@
<?xml version='1.0' encoding='UTF-8'?>
<urlset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9 http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd" xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<url>
<loc>https://domain1.com/secure/wiki/</loc>
</url>
</urlset>

View File

@@ -0,0 +1,3 @@
<app webapp-factory="com.de22.web.test.application.WebApplicationFactory">
<loc>http://domain1.com/index.html</loc>
</app>