You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@directory.apache.org by tb...@apache.org on 2006/12/12 16:24:14 UTC
svn commit: r486187 [39/49] - in /directory/trunks/triplesec: ./ admin-api/
admin-api/src/ admin-api/src/main/ admin-api/src/main/java/
admin-api/src/main/java/org/ admin-api/src/main/java/org/safehaus/
admin-api/src/main/java/org/safehaus/triplesec/ a...
Added: directory/trunks/triplesec/webapp-activation/src/main/java/org/safehaus/triplesec/activation/SmsNotification.java
URL: http://svn.apache.org/viewvc/directory/trunks/triplesec/webapp-activation/src/main/java/org/safehaus/triplesec/activation/SmsNotification.java?view=auto&rev=486187
==============================================================================
--- directory/trunks/triplesec/webapp-activation/src/main/java/org/safehaus/triplesec/activation/SmsNotification.java (added)
+++ directory/trunks/triplesec/webapp-activation/src/main/java/org/safehaus/triplesec/activation/SmsNotification.java Tue Dec 12 07:23:31 2006
@@ -0,0 +1,55 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+package org.safehaus.triplesec.activation;
+
+import org.safehaus.sms.Carrier;
+
+
+/**
+ * Sms based notication message.
+ *
+ * @author <a href="mailto:akarasulu@safehaus.org">Alex Karasulu</a>
+ * @version $Rev$
+ */
+public class SmsNotification extends Notification
+{
+ private final Carrier carrier;
+ private final String cellularNumber;
+
+
+ protected SmsNotification( String cellularNumber, Carrier carrier, String activationKey, String message )
+ {
+ super( activationKey, message );
+ this.carrier = carrier;
+ this.cellularNumber = cellularNumber;
+ }
+
+
+ public Carrier getCarrier()
+ {
+ return this.carrier;
+ }
+
+
+ public String getCellularNumber()
+ {
+ return this.cellularNumber;
+ }
+}
Added: directory/trunks/triplesec/webapp-activation/src/main/webapp/HausKeys.jad
URL: http://svn.apache.org/viewvc/directory/trunks/triplesec/webapp-activation/src/main/webapp/HausKeys.jad?view=auto&rev=486187
==============================================================================
--- directory/trunks/triplesec/webapp-activation/src/main/webapp/HausKeys.jad (added)
+++ directory/trunks/triplesec/webapp-activation/src/main/webapp/HausKeys.jad Tue Dec 12 07:23:31 2006
@@ -0,0 +1,8 @@
+MIDlet-1: HausKeys, , org.safehaus.midlets.HausKeys
+MIDlet-Jar-Size: 33355
+MIDlet-Jar-URL: HausKeys.jar
+MIDlet-Name: HausKeys
+MIDlet-Vendor: Safehaus
+MIDlet-Version: 1.0
+MicroEdition-Configuration: CLDC-1.0
+MicroEdition-Profile: MIDP-1.0
Added: directory/trunks/triplesec/webapp-activation/src/main/webapp/HausKeys.jar
URL: http://svn.apache.org/viewvc/directory/trunks/triplesec/webapp-activation/src/main/webapp/HausKeys.jar?view=auto&rev=486187
==============================================================================
Binary file - no diff available.
Propchange: directory/trunks/triplesec/webapp-activation/src/main/webapp/HausKeys.jar
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: directory/trunks/triplesec/webapp-activation/src/main/webapp/META-INF/MANIFEST.MF
URL: http://svn.apache.org/viewvc/directory/trunks/triplesec/webapp-activation/src/main/webapp/META-INF/MANIFEST.MF?view=auto&rev=486187
==============================================================================
--- directory/trunks/triplesec/webapp-activation/src/main/webapp/META-INF/MANIFEST.MF (added)
+++ directory/trunks/triplesec/webapp-activation/src/main/webapp/META-INF/MANIFEST.MF Tue Dec 12 07:23:31 2006
@@ -0,0 +1,3 @@
+Manifest-Version: 1.0
+Class-Path:
+
Added: directory/trunks/triplesec/webapp-activation/src/main/webapp/WEB-INF/web.xml
URL: http://svn.apache.org/viewvc/directory/trunks/triplesec/webapp-activation/src/main/webapp/WEB-INF/web.xml?view=auto&rev=486187
==============================================================================
--- directory/trunks/triplesec/webapp-activation/src/main/webapp/WEB-INF/web.xml (added)
+++ directory/trunks/triplesec/webapp-activation/src/main/webapp/WEB-INF/web.xml Tue Dec 12 07:23:31 2006
@@ -0,0 +1,114 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<web-app id="WebApp_ID" version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
+
+ <filter>
+ <filter-name>activation</filter-name>
+ <filter-class>org.safehaus.triplesec.activation.ActivateAccountFilter</filter-class>
+
+ <!-- LDAP Connection Settings -->
+
+ <init-param>
+ <param-name>ldapHost</param-name>
+ <param-value>localhost</param-value>
+ </init-param>
+ <init-param>
+ <param-name>ldapPort</param-name>
+ <param-value>10389</param-value>
+ </init-param>
+ <init-param>
+ <param-name>ldapBaseDn</param-name>
+ <param-value>dc=example,dc=com</param-value>
+ </init-param>
+ <init-param>
+ <param-name>ldapPrincipalDn</param-name>
+ <param-value>uid=admin,ou=system</param-value>
+ </init-param>
+ <init-param>
+ <param-name>ldapCredentials</param-name>
+ <param-value>secret</param-value>
+ </init-param>
+
+ <!-- sms and smtp configuration -->
+ <init-param>
+ <param-name>smtpHost</param-name>
+ <param-value>hertz</param-value>
+ </init-param>
+ <init-param>
+ <param-name>smtpSubject</param-name>
+ <param-value>Triplesec account activated</param-value>
+ </init-param>
+ <init-param>
+ <param-name>smtpFrom</param-name>
+ <param-value>dev@safehaus.org</param-value>
+ </init-param>
+ <!--
+ <init-param>
+ <param-name>smtpUsername</param-name>
+ <param-value>tsec</param-value>
+ </init-param>
+ <init-param>
+ <param-name>smtpPassword</param-name>
+ <param-value>secret</param-value>
+ </init-param>
+ -->
+ <init-param>
+ <param-name>smsUsername</param-name>
+ <param-value>hauskeys</param-value>
+ </init-param>
+ <init-param>
+ <param-name>smsPassword</param-name>
+ <param-value>*****</param-value>
+ </init-param>
+ <init-param>
+ <param-name>smsAccountName</param-name>
+ <param-value>demo</param-value>
+ </init-param>
+ <init-param>
+ <param-name>smsTransportUrl</param-name>
+ <param-value>http://www.nbroadcasting.com/customers/messages/Sender.asp</param-value>
+ </init-param>
+
+ <init-param>
+ <param-name>presentationBaseUrl</param-name>
+ <param-value>undefined</param-value>
+ </init-param>
+
+ <!-- optional parameter overrides -->
+
+ <!-- Uncomment this to make the activation filter generate an error message instead -->
+ <!-- of generating a decoy midlet for requests with unknown activation keys. This -->
+ <!-- is done by default to prevent trolling applications/bots from being successful.-->
+ <init-param>
+ <param-name>enableDecoyMidlet</param-name>
+ <param-value>false</param-value>
+ </init-param>
+
+ <!-- Uncomment this to override the default length of the OTP values generated by -->
+ <!-- the midlet produced: 6 by default. In the future there a per account attrib -->
+ <!-- can be used instead of this default value for account specific behavoir. -->
+ <!--
+ <init-param>
+ <param-name>otpLength</param-name>
+ <param-value>8</param-value>
+ </init-param>
+ -->
+
+ <!-- Uncomment this to have the filter use an attribute within the user's entry to -->
+ <!-- get the name of the midlet for the user. The first value of this attribute is -->
+ <!-- used to set the name of the midlet suite within the MANIFEST and the JAD files -->
+ <!-- If not set this defaults to the krb5PrincipalRealm for the users account. -->
+ <!--
+ <init-param>
+ <param-name>midletNameAttribute</param-name>
+ <param-value>safehausMidletName</param-value>
+ </init-param>
+ -->
+ </filter>
+
+ <filter-mapping>
+ <filter-name>activation</filter-name>
+ <url-pattern>/*</url-pattern>
+ </filter-mapping>
+ </web-app>
Added: directory/trunks/triplesec/webapp-activation/src/main/webapp/images/continue.gif
URL: http://svn.apache.org/viewvc/directory/trunks/triplesec/webapp-activation/src/main/webapp/images/continue.gif?view=auto&rev=486187
==============================================================================
Binary file - no diff available.
Propchange: directory/trunks/triplesec/webapp-activation/src/main/webapp/images/continue.gif
------------------------------------------------------------------------------
svn:executable =
Propchange: directory/trunks/triplesec/webapp-activation/src/main/webapp/images/continue.gif
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: directory/trunks/triplesec/webapp-activation/src/main/webapp/images/lhs_spacer.png
URL: http://svn.apache.org/viewvc/directory/trunks/triplesec/webapp-activation/src/main/webapp/images/lhs_spacer.png?view=auto&rev=486187
==============================================================================
Binary file - no diff available.
Propchange: directory/trunks/triplesec/webapp-activation/src/main/webapp/images/lhs_spacer.png
------------------------------------------------------------------------------
svn:executable =
Propchange: directory/trunks/triplesec/webapp-activation/src/main/webapp/images/lhs_spacer.png
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: directory/trunks/triplesec/webapp-activation/src/main/webapp/images/no_16x16.png
URL: http://svn.apache.org/viewvc/directory/trunks/triplesec/webapp-activation/src/main/webapp/images/no_16x16.png?view=auto&rev=486187
==============================================================================
Binary file - no diff available.
Propchange: directory/trunks/triplesec/webapp-activation/src/main/webapp/images/no_16x16.png
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: directory/trunks/triplesec/webapp-activation/src/main/webapp/images/no_22x22.png
URL: http://svn.apache.org/viewvc/directory/trunks/triplesec/webapp-activation/src/main/webapp/images/no_22x22.png?view=auto&rev=486187
==============================================================================
Binary file - no diff available.
Propchange: directory/trunks/triplesec/webapp-activation/src/main/webapp/images/no_22x22.png
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: directory/trunks/triplesec/webapp-activation/src/main/webapp/images/ok_16x16.png
URL: http://svn.apache.org/viewvc/directory/trunks/triplesec/webapp-activation/src/main/webapp/images/ok_16x16.png?view=auto&rev=486187
==============================================================================
Binary file - no diff available.
Propchange: directory/trunks/triplesec/webapp-activation/src/main/webapp/images/ok_16x16.png
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: directory/trunks/triplesec/webapp-activation/src/main/webapp/images/ok_22x22.png
URL: http://svn.apache.org/viewvc/directory/trunks/triplesec/webapp-activation/src/main/webapp/images/ok_22x22.png?view=auto&rev=486187
==============================================================================
Binary file - no diff available.
Propchange: directory/trunks/triplesec/webapp-activation/src/main/webapp/images/ok_22x22.png
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: directory/trunks/triplesec/webapp-activation/src/main/webapp/images/safehaus-banner.png
URL: http://svn.apache.org/viewvc/directory/trunks/triplesec/webapp-activation/src/main/webapp/images/safehaus-banner.png?view=auto&rev=486187
==============================================================================
Binary file - no diff available.
Propchange: directory/trunks/triplesec/webapp-activation/src/main/webapp/images/safehaus-banner.png
------------------------------------------------------------------------------
svn:executable =
Propchange: directory/trunks/triplesec/webapp-activation/src/main/webapp/images/safehaus-banner.png
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: directory/trunks/triplesec/webapp-activation/src/main/webapp/images/spacer_16x16.png
URL: http://svn.apache.org/viewvc/directory/trunks/triplesec/webapp-activation/src/main/webapp/images/spacer_16x16.png?view=auto&rev=486187
==============================================================================
Binary file - no diff available.
Propchange: directory/trunks/triplesec/webapp-activation/src/main/webapp/images/spacer_16x16.png
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: directory/trunks/triplesec/webapp-activation/src/main/webapp/images/spacer_22x22.png
URL: http://svn.apache.org/viewvc/directory/trunks/triplesec/webapp-activation/src/main/webapp/images/spacer_22x22.png?view=auto&rev=486187
==============================================================================
Binary file - no diff available.
Propchange: directory/trunks/triplesec/webapp-activation/src/main/webapp/images/spacer_22x22.png
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: directory/trunks/triplesec/webapp-activation/src/main/webapp/index.jsp
URL: http://svn.apache.org/viewvc/directory/trunks/triplesec/webapp-activation/src/main/webapp/index.jsp?view=auto&rev=486187
==============================================================================
--- directory/trunks/triplesec/webapp-activation/src/main/webapp/index.jsp (added)
+++ directory/trunks/triplesec/webapp-activation/src/main/webapp/index.jsp Tue Dec 12 07:23:31 2006
@@ -0,0 +1,834 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<%@ page language="java" contentType="text/html; charset=UTF-8"
+ pageEncoding="UTF-8"%>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <title>Insert title here</title>
+ <style type="text/css">
+<!--
+.style3 {
+ color: #FF0000;
+ font-size: x-small;
+}
+img.hide{
+ display: none;
+}
+
+img.show{
+ display: inline;
+}
+
+-->
+ </style>
+</head>
+<body>
+
+ <script>
+ <!--
+
+var req;
+
+function loadXml( url )
+{
+ // branch for native XMLHttpRequest object
+ if ( window.XMLHttpRequest )
+ {
+ req = new XMLHttpRequest();
+ req.onreadystatechange = processReqChange;
+ req.open( "GET", url, true );
+ req.send( null );
+ }
+ // branch for IE/Windows ActiveX version
+ else if ( window.ActiveXObject )
+ {
+ req = new ActiveXObject( "Microsoft.XMLHTTP" );
+ if ( req )
+ {
+ req.onreadystatechange = processReqChange;
+ req.open( "GET", url, true );
+ req.send();
+ }
+ }
+}
+
+function processReqChange()
+{
+ // only if req shows "complete"
+ if ( req.readyState == 4 )
+ {
+ // only if "OK"
+ if ( req.status == 200 )
+ {
+ // ...processing statements go here...
+ var text = req.responseText;
+ if ( text.indexOf( "true" ) != -1 )
+ {
+ document.getElementById( "nameCheckFailed" ).className = 'show';
+ document.getElementById( "nameCheckPassed" ).className = 'hide';
+ alert( "User with name " + document.getElementById( "username" ).value + " already exists!" );
+ }
+ else
+ {
+ document.getElementById( "nameCheckFailed" ).className = 'hide';
+ document.getElementById( "nameCheckPassed" ).className = 'show';
+ }
+ }
+ else
+ {
+ alert( "There was a problem retrieving the XML data:\n" + req.statusText );
+ }
+ }
+}
+
+function checkName( username )
+{
+ if ( username == '' )
+ {
+ document.getElementById( "nameCheckFailed" ).className = 'hide';
+ document.getElementById( "nameCheckPassed" ).className = 'hide';
+ return;
+ }
+
+ url = '<%=config.getServletContext().getInitParameter( "userExistsServiceBase" )%>?username=' + username;
+ loadXml( url );
+}
+
+// --------------------------------------------------------------------------------------
+// Global pin length constraints
+// --------------------------------------------------------------------------------------
+
+pinMin = 4;
+pinMax = 6;
+
+// --------------------------------------------------------------------------------------
+// Checks to make sure a both pins are numeric and comply with length constraints
+// then checks to make sure that both the pin and pinConfirm input values are equal.
+// --------------------------------------------------------------------------------------
+
+function checkPinConfirm( pin, pinConfirm )
+{
+ if ( !checkPin( pinConfirm ) )
+ {
+ return;
+ }
+
+ if ( pin.value != pinConfirm.value )
+ {
+ pinConfirm.value = "";
+ document.getElementById( "pinConfirmImgNo" ).className = "show";
+ document.getElementById( "pinConfirmImgOk" ).className = "hide";
+ alert( pinConfirm.name + " is not the same as the " + pin.name + "!" );
+ return;
+ }
+
+ document.getElementById( "pinConfirmImgNo" ).className = "hide";
+ document.getElementById( "pinConfirmImgOk" ).className = "show";
+}
+
+// --------------------------------------------------------------------------------------
+// Checks to make sure a pin is numeric and falls in length constraints.
+// --------------------------------------------------------------------------------------
+
+function checkPin( pin )
+{
+ var okImgId = pin.name + "ImgOk";
+ var noImgId = pin.name + "ImgNo";
+ var temp = pin.value;
+
+ if ( pin == '' )
+ {
+ document.getElementById( noImgId ).className = "show";
+ document.getElementById( okImgId ).className = "hide";
+ }
+
+ if ( temp.length > pinMax )
+ {
+ alert( pin.name + " too long! Enter a numeric value " + pinMin
+ + "-" + pinMax + " characters in length!" );
+ pin.value = "";
+ document.getElementById( noImgId ).className = "show";
+ document.getElementById( okImgId ).className = "hide";
+ return false;
+ }
+
+ if ( temp.length < pinMin )
+ {
+ alert( pin.name + " too short! Enter a numeric value " + pinMin
+ + "-" + pinMax + " characters in length!" );
+ pin.value = "";
+ document.getElementById( noImgId ).className = "show";
+ document.getElementById( okImgId ).className = "hide";
+ return false;
+ }
+
+ for ( var ii = 0; ii < temp.length; ii++ )
+ {
+ if ( ! isDigit( temp.charAt( ii ) ) )
+ {
+ alert( pin.name + " contains non-numeric characters! Enter a numeric 4-6 digit value." );
+ pin.value = "";
+ document.getElementById( noImgId ).className = "show";
+ document.getElementById( okImgId ).className = "hide";
+ return false;
+ }
+ }
+
+ document.getElementById( noImgId ).className = "hide";
+ document.getElementById( okImgId ).className = "show";
+ return true;
+}
+
+// --------------------------------------------------------------------------------------
+// Checks to see if a number is a digit.
+// --------------------------------------------------------------------------------------
+
+function isDigit( num )
+{
+ if ( num.length > 1 )
+ {
+ return false;
+ }
+ var digits = "0123456789";
+ if ( digits.indexOf( num ) != -1 )
+ {
+ return true;
+ }
+ else
+ {
+ return false;
+ }
+}
+
+// ---------------------------------------------------------------------------------------
+// This function capitalizes proper names; it also capitalizes the
+// letter after the apostrophe, if one is present
+// ---------------------------------------------------------------------------------------
+
+function capitalizeName( Obj )
+{
+ checkNotNull( Obj );
+
+ if ( Obj.value == '' )
+ {
+ return;
+ }
+
+ var temp = new String( Obj.value )
+ var first = temp.substring( 0, 1 )
+ temp = first.toUpperCase() + temp.substring( 1, temp.length )
+ var apnum = temp.indexOf( "'" )
+
+ if ( apnum > -1 )
+ {
+ var aplet = temp.substring( apnum+1, apnum+2 )
+ temp = temp.substring( 0, apnum ) + "'" +
+ aplet.toUpperCase() +
+ temp.substring( apnum+2, temp.length )
+ }
+
+ Obj.value = temp
+}
+
+
+// Declaring required variables
+var digits = "0123456789";
+
+// non-digit characters which are allowed in phone numbers
+var phoneNumberDelimiters = "()- ";
+
+// characters which are allowed in international phone numbers
+// (a leading + is OK)
+var validWorldPhoneChars = phoneNumberDelimiters + "+";
+
+// Minimum no of digits in an international phone no.
+var minDigitsInIPhoneNumber = 10;
+
+function isInteger( s )
+{
+ var i;
+
+ for ( i = 0; i < s.length; i++ )
+ {
+ // Check that current character is number.
+ var c = s.charAt( i );
+ if ( ( ( c < "0" ) || ( c > "9" ) ) )
+ {
+ return false;
+ }
+ }
+
+ // All characters are numbers.
+ return true;
+}
+
+
+function stripCharsInBag( s, bag )
+{
+ var i;
+ var returnString = "";
+
+ // Search through string's characters one by one.
+ // If character is not in bag, append to returnString.
+ for ( i = 0; i < s.length; i++ )
+ {
+ // Check that current character isn't whitespace.
+ var c = s.charAt( i );
+
+ if ( bag.indexOf( c ) == -1 )
+ {
+ returnString += c;
+ }
+ }
+
+ return returnString;
+}
+
+function checkInternationalPhone( strPhone )
+{
+ s = stripCharsInBag( strPhone,validWorldPhoneChars );
+ return ( isInteger( s ) && s.length >= minDigitsInIPhoneNumber );
+}
+
+function checkMobile( someField )
+{
+ var okImgId = someField.name + "ImgOk";
+ var noImgId = someField.name + "ImgNo";
+
+ if ( someField.value == '' )
+ {
+ document.getElementById( okImgId ).className = "hide";
+ document.getElementById( noImgId ).className = "show";
+ return;
+ }
+
+ if ( checkInternationalPhone( someField.value ) )
+ {
+ document.getElementById( okImgId ).className = "show";
+ document.getElementById( noImgId ).className = "hide";
+ }
+ else
+ {
+ document.getElementById( okImgId ).className = "hide";
+ document.getElementById( noImgId ).className = "show";
+ }
+}
+
+
+function checkNotNull( someField )
+{
+ var okImgId = someField.name + "ImgOk";
+ var noImgId = someField.name + "ImgNo";
+
+ if ( someField.value == '' )
+ {
+ document.getElementById( okImgId ).className = "hide";
+ document.getElementById( noImgId ).className = "show";
+ return;
+ }
+
+ document.getElementById( okImgId ).className = "show";
+ document.getElementById( noImgId ).className = "hide";
+}
+
+
+function checkEmail( someField )
+{
+ if ( someField.value == '' )
+ {
+ document.getElementById( okImgId ).className = "hide";
+ document.getElementById( noImgId ).className = "show";
+ return false;
+ }
+
+ var okImgId = someField.name + "ImgOk";
+ var noImgId = someField.name + "ImgNo";
+ var str = someField.value;
+ var at = "@";
+ var dot = ".";
+ var lat = str.indexOf( at );
+ var lstr = str.length;
+ var ldot = str.indexOf( dot );
+
+ if ( str.indexOf( at ) == -1 )
+ {
+ document.getElementById( okImgId ).className = "hide";
+ document.getElementById( noImgId ).className = "show";
+ alert( "Invalid E-mail ID" );
+ return false;
+ }
+
+ if ( str.indexOf( at ) == -1 || str.indexOf( at ) == 0 || str.indexOf( at ) == lstr )
+ {
+ document.getElementById( okImgId ).className = "hide";
+ document.getElementById( noImgId ).className = "show";
+ alert( "Invalid E-mail ID" );
+ return false;
+ }
+
+ if ( str.indexOf( dot ) ==-1 || str.indexOf( dot ) == 0 || str.indexOf( dot ) == lstr )
+ {
+ document.getElementById( okImgId ).className = "hide";
+ document.getElementById( noImgId ).className = "show";
+ alert( "Invalid E-mail ID" );
+ return false;
+ }
+
+ if ( str.indexOf( at, ( lat + 1 ) ) != -1 )
+ {
+ document.getElementById( okImgId ).className = "hide";
+ document.getElementById( noImgId ).className = "show";
+ alert( "Invalid E-mail ID" );
+ return false;
+ }
+
+ if ( str.substring( lat - 1, lat ) == dot || str.substring( lat + 1, lat + 2 ) == dot )
+ {
+ document.getElementById( okImgId ).className = "hide";
+ document.getElementById( noImgId ).className = "show";
+ alert( "Invalid E-mail ID" );
+ return false;
+ }
+
+ if ( str.indexOf( dot, ( lat + 2 ) ) == -1 )
+ {
+ document.getElementById( okImgId ).className = "hide";
+ document.getElementById( noImgId ).className = "show";
+ alert( "Invalid E-mail ID" );
+ return false;
+ }
+
+ if ( str.indexOf( " " ) != -1 )
+ {
+ document.getElementById( okImgId ).className = "hide";
+ document.getElementById( noImgId ).className = "show";
+ alert( "Invalid E-mail ID" );
+ return false;
+ }
+
+ document.getElementById( okImgId ).className = "show";
+ document.getElementById( noImgId ).className = "hide";
+ return true;
+}
+//-->
+ </script>
+
+
+ <table width="800" border="0">
+ <tr>
+ <td colspan="2"><img src="images/safehaus-banner.png" width="1000" height="75" /></td>
+ <td width="1"> </td>
+ </tr>
+ <tr>
+ <td width="160"><img src="images/lhs_spacer.png" width="160" height="500" /></td>
+ <td width="836"> <form action="registerUserService" name="registrationForm" method="post">
+ <table border="0" cellpadding="2" cellspacing="2" width="100%">
+ <tr><td width="21%"><span style="color:#cc0000;"> </span></td>
+ <td></td></tr>
+
+<tr>
+ <td align="right" nowrap="nowrap" ><b>Username: <img id="nameCheckFailed" src="images/no_16x16.png" class="show" width="16" height="16" />
+ <img id="nameCheckPassed" src="images/ok_16x16.png" class="hide" width="16" height="16" /></b></td>
+ <td width="79%"><input name="username" type="text" id="username" value="" size="50" maxlength="60" onblur="checkName( this.value )" /></td>
+</tr>
+
+<tr>
+ <td align="right" nowrap="nowrap" ><b>Pin: <img id="pinImgNo" src="images/no_16x16.png" class="show" width="16" height="16" />
+ <img id="pinImgOk" src="images/ok_16x16.png" class="hide" width="16" height="16" />
+ </b></td>
+ <td><label for="textfield"></label>
+ <input name="pin" type="password" id="pin" size="12" maxlength="6" onchange="checkPin(document.registrationForm.pin)"/></td>
+</tr>
+
+<tr>
+ <td align="right" nowrap="nowrap" ><b>Pin Confirm: <img id="pinConfirmImgNo" src="images/no_16x16.png" class="show" width="16" height="16" />
+ <img id="pinConfirmImgOk" src="images/ok_16x16.png" class="hide" width="16" height="16" /></b></td>
+ <td><label for="textfield"></label>
+ <input name="pinConfirm" type="password" id="pinConfirm" size="12" maxlength="6" onchange="checkPinConfirm(document.registrationForm.pin, document.registrationForm.pinConfirm)"/></td>
+</tr>
+<tr>
+ <td align="right" nowrap="nowrap" ><b>First Name: <img id="firstNameImgNo" src="images/no_16x16.png" class="show" width="16" height="16" />
+ <img id="firstNameImgOk" src="images/ok_16x16.png" class="hide" width="16" height="16" /> </b></td>
+ <td width="79%"><input type="text" name="firstName" value="" size="25" maxlength="30"
+ onblur="capitalizeName(document.registrationForm.firstName)"/></td>
+</tr>
+
+<tr>
+ <td align="right" nowrap="nowrap" ><b>Last Name: <img id="lastNameImgNo" src="images/no_16x16.png" class="show" width="16" height="16" />
+ <img id="lastNameImgOk" src="images/ok_16x16.png" class="hide" width="16" height="16" /></b></td>
+ <td width="79%"><input type="text" name="lastName" value="" size="25" maxlength="30"
+ onblur="capitalizeName(document.registrationForm.lastName)"/></td>
+</tr>
+
+<tr>
+ <td align="right" nowrap="nowrap" >
+
+ <b>Address Line1: </b><img src="images/spacer_16x16.png" width="16" height="16" /> </td>
+ <td width="79%"><input type="text" name="address1" value="" size="50" maxlength="60" /></td>
+</tr>
+
+<tr>
+
+ <td align="right" nowrap="nowrap">
+ <b>Address Line2:</b><b> </b><img src="images/spacer_16x16.png" width="16" height="16" /> </td>
+ <td width="79%"><input type="text" name="address2" value="" size="50" maxlength="60" /></td>
+</tr>
+
+<tr>
+ <td align="right" nowrap="nowrap" ><b>City:</b><b> </b><img src="images/spacer_16x16.png" width="16" height="16" /></td>
+ <td width="79%">
+ <input type="text" name="city" value="" size="25" /> </td>
+</tr>
+
+
+
+<tr>
+ <td align="right" nowrap="nowrap" >
+
+<b>State/Prov/Region:</b><b> </b><img src="images/spacer_16x16.png" width="16" height="16" /> </td>
+ <td width="79%">
+ <input type="text" name="state" value="" size="15" /> </td>
+</tr>
+
+<tr>
+ <td align="right" nowrap="nowrap" ><b>ZIP/Postal Code: </b><img src="images/spacer_16x16.png" width="16" height="16" /><b> </b></td>
+ <td width="79%"><input type="text" name="zip" value="" size="20" /></td>
+</tr>
+
+<tr>
+ <td align="right" nowrap="nowrap" ><b>Country:</b><b> </b><img src="images/spacer_16x16.png" width="16" height="16" /></td>
+ <td width="79%">
+ <select name="country">
+ <option>United States</option>
+
+ <option>Afghanistan</option>
+ <option>Albania</option>
+ <option>Algeria</option>
+ <option>American Samoa</option>
+ <option>Andorra</option>
+ <option>Anguilla</option>
+
+ <option>Antarctica</option>
+ <option>Antigua And Barbuda</option>
+ <option>Argentina</option>
+ <option>Armenia</option>
+ <option>Aruba</option>
+ <option>Australia</option>
+
+ <option>Austria</option>
+ <option>Azerbaijan</option>
+ <option>Bahamas</option>
+ <option>Bahrain</option>
+ <option>Bangladesh</option>
+ <option>Barbados</option>
+
+ <option>Belarus</option>
+ <option>Belgium</option>
+ <option>Belize</option>
+ <option>Benin</option>
+ <option>Bermuda</option>
+ <option>Bhutan</option>
+
+ <option>Bolivia</option>
+ <option>Bosnia and Herzegovina</option>
+ <option>Botswana</option>
+ <option>Bouvet Island</option>
+ <option>Brazil</option>
+ <option>British Indian Ocean Territory</option>
+
+ <option>Brunei Darussalam</option>
+ <option>Bulgaria</option>
+ <option>Burkina Faso</option>
+ <option>Burundi</option>
+ <option>Cambodia</option>
+ <option>Cameroon</option>
+
+ <option>Canada</option>
+ <option>Cape Verde</option>
+ <option>Cayman Islands</option>
+ <option>Central African Republic</option>
+ <option>Chad</option>
+ <option>Chile</option>
+
+ <option>China</option>
+ <option>Christmas Island</option>
+ <option>Cocos (Keeling) Islands</option>
+ <option>Colombia</option>
+ <option>Comoros</option>
+ <option>Congo</option>
+
+ <option>Congo, the Democratic Republic of the</option>
+ <option>Cook Islands</option>
+ <option>Costa Rica</option>
+ <option>Cote d'Ivoire</option>
+ <option>Croatia</option>
+ <option>Cyprus</option>
+
+ <option>Czech Republic</option>
+ <option>Denmark</option>
+ <option>Djibouti</option>
+ <option>Dominica</option>
+ <option>Dominican Republic</option>
+ <option>East Timor</option>
+
+ <option>Ecuador</option>
+ <option>Egypt</option>
+ <option>El Salvador</option>
+ <option>England</option>
+ <option>Equatorial Guinea</option>
+ <option>Eritrea</option>
+
+ <option>Espana</option>
+ <option>Estonia</option>
+ <option>Ethiopia</option>
+ <option>Falkland Islands</option>
+ <option>Faroe Islands</option>
+ <option>Fiji</option>
+
+ <option>Finland</option>
+ <option>France</option>
+ <option>French Guiana</option>
+ <option>French Polynesia</option>
+ <option>French Southern Territories</option>
+ <option>Gabon</option>
+
+ <option>Gambia</option>
+ <option>Georgia</option>
+ <option>Germany</option>
+ <option>Ghana</option>
+ <option>Gibraltar</option>
+ <option>Great Britain</option>
+
+ <option>Greece</option>
+ <option>Greenland</option>
+ <option>Grenada</option>
+ <option>Guadeloupe</option>
+ <option>Guam</option>
+ <option>Guatemala</option>
+
+ <option>Guinea</option>
+ <option>Guinea-Bissau</option>
+ <option>Guyana</option>
+ <option>Haiti</option>
+ <option>Heard and Mc Donald Islands</option>
+ <option>Honduras</option>
+
+ <option>Hong Kong</option>
+ <option>Hungary</option>
+ <option>Iceland</option>
+ <option>India</option>
+ <option>Indonesia</option>
+ <option>Ireland</option>
+
+ <option>Israel</option>
+ <option>Italy</option>
+ <option>Jamaica</option>
+ <option>Japan</option>
+ <option>Jordan</option>
+ <option>Kazakhstan</option>
+
+ <option>Kenya</option>
+ <option>Kiribati</option>
+ <option>Korea, Republic of</option>
+ <option>Korea (South)</option>
+ <option>Kuwait</option>
+ <option>Kyrgyzstan</option>
+
+ <option>Lao People's Democratic Republic</option>
+ <option>Latvia</option>
+ <option>Lebanon</option>
+ <option>Lesotho</option>
+ <option>Liberia</option>
+ <option>Libya</option>
+
+ <option>Liechtenstein</option>
+ <option>Lithuania</option>
+ <option>Luxembourg</option>
+ <option>Macau</option>
+ <option>Macedonia</option>
+ <option>Madagascar</option>
+
+ <option>Malawi</option>
+ <option>Malaysia</option>
+ <option>Maldives</option>
+ <option>Mali</option>
+ <option>Malta</option>
+ <option>Marshall Islands</option>
+
+ <option>Martinique</option>
+ <option>Mauritania</option>
+ <option>Mauritius</option>
+ <option>Mayotte</option>
+ <option>Mexico</option>
+ <option>Micronesia, Federated States of</option>
+
+ <option>Moldova, Republic of</option>
+ <option>Monaco</option>
+ <option>Mongolia</option>
+ <option>Montserrat</option>
+ <option>Morocco</option>
+ <option>Mozambique</option>
+
+ <option>Myanmar</option>
+ <option>Namibia</option>
+ <option>Nauru</option>
+ <option>Nepal</option>
+ <option>Netherlands</option>
+ <option>Netherlands Antilles</option>
+
+ <option>New Caledonia</option>
+ <option>New Zealand</option>
+ <option>Nicaragua</option>
+ <option>Niger</option>
+ <option>Nigeria</option>
+ <option>Niue</option>
+
+ <option>Norfolk Island</option>
+ <option>Northern Ireland</option>
+ <option>Northern Mariana Islands</option>
+ <option>Norway</option>
+ <option>Oman</option>
+ <option>Pakistan</option>
+
+ <option>Palau</option>
+ <option>Panama</option>
+ <option>Papua New Guinea</option>
+ <option>Paraguay</option>
+ <option>Peru</option>
+ <option>Philippines</option>
+
+ <option>Pitcairn</option>
+ <option>Poland</option>
+ <option>Portugal</option>
+ <option>Puerto Rico</option>
+ <option>Qatar</option>
+ <option>Reunion</option>
+
+ <option>Romania</option>
+ <option>Russia</option>
+ <option>Russian Federation</option>
+ <option>Rwanda</option>
+ <option>Saint Kitts and Nevis</option>
+ <option>Saint Lucia</option>
+
+ <option>Saint Vincent and the Grenadines</option>
+ <option>Samoa (Independent)</option>
+ <option>San Marino</option>
+ <option>Sao Tome and Principe</option>
+ <option>Saudi Arabia</option>
+ <option>Scotland</option>
+
+ <option>Senegal</option>
+ <option>Serbia and Montenegro</option>
+ <option>Seychelles</option>
+ <option>Sierra Leone</option>
+ <option>Singapore</option>
+ <option>Slovakia</option>
+
+ <option>Slovenia</option>
+ <option>Solomon Islands</option>
+ <option>Somalia</option>
+ <option>South Africa</option>
+ <option>South Georgia and the South Sandwich Islands</option>
+ <option>South Korea</option>
+
+ <option>Spain</option>
+ <option>Sri Lanka</option>
+ <option>St. Helena</option>
+ <option>St. Pierre and Miquelon</option>
+ <option>Suriname</option>
+ <option>Svalbard and Jan Mayen Islands</option>
+
+ <option>Swaziland</option>
+ <option>Sweden</option>
+ <option>Switzerland</option>
+ <option>Taiwan</option>
+ <option>Tajikistan</option>
+ <option>Tanzania</option>
+
+ <option>Thailand</option>
+ <option>Togo</option>
+ <option>Tokelau</option>
+ <option>Tonga</option>
+ <option>Trinidad</option>
+ <option>Trinidad and Tobago</option>
+
+ <option>Tunisia</option>
+ <option>Turkey</option>
+ <option>Turkmenistan</option>
+ <option>Turks and Caicos Islands</option>
+ <option>Tuvalu</option>
+ <option>Uganda</option>
+
+ <option>Ukraine</option>
+ <option>United Arab Emirates</option>
+ <option>United Kingdom</option>
+ <option>United States</option>
+ <option>United States Minor Outlying Islands</option>
+ <option>Uruguay</option>
+
+ <option>USA</option>
+ <option>Uzbekistan</option>
+ <option>Vanuatu</option>
+ <option>Vatican City State (Holy See)</option>
+ <option>Venezuela</option>
+ <option>Viet Nam</option>
+
+ <option>Virgin Islands (British)</option>
+ <option>Virgin Islands (U.S.)</option>
+ <option>Wales</option>
+ <option>Wallis and Futuna Islands</option>
+ <option>Western Sahara</option>
+ <option>Yemen</option>
+
+ <option>Zambia</option>
+ <option>Zimbabwe</option>
+</select> </td>
+</tr>
+
+
+<tr>
+ <td align="right" nowrap="nowrap" ><strong>Email:<b> <img id="emailImgNo" src="images/no_16x16.png" class="show" width="16" height="16" />
+ <img id="emailImgOk" src="images/ok_16x16.png" class="hide" width="16" height="16" /></b></strong></td>
+ <td><input name="email" type="text" id="email" value="" size="25" onchange="checkEmail( this )"/></td>
+</tr>
+<tr>
+ <td align="right" nowrap="nowrap" ><strong>Mobile Number:<b> <img id="mobileImgNo" src="images/no_16x16.png" class="show" width="16" height="16" /><img id="mobileImgOk" src="images/ok_16x16.png" class="hide" width="16" height="16" /></b></strong></td>
+ <td><input name="mobile" type="text" id="mobile" value="" size="15" onchange="checkMobile(this)" /></td>
+</tr>
+<tr>
+ <td align="right" nowrap="nowrap" ><strong><b>Mobile Carrier: </b><img src="images/spacer_16x16.png" width="16" height="16" /><b>
+ </b></strong></td>
+
+ <td width="79%"><select name="carrier">
+ <option value="T-Mobile" selected="selected">T-Mobile</option>
+ <option value="AT&T">AT&T</option>
+ <option value="Verizon">Verizon</option>
+ <option value="Cingular">Cingular</option>
+ <option value="Sprint">Sprint</option>
+ <option value="Nextel">Nextel</option>
+ </select></td>
+</tr>
+ </table>
+ <table border="0" cellpadding="2" cellspacing="2" width="100%">
+<tr>
+ <td width="69%" align="right" valign="top">
+ <p><b>Account activation URL delivery medium?</b></p>
+ <p><em>(With SMS delivery your hauskeys can be provisioned to your handset) </em> </p></td>
+ <td width="31%" valign="top" nowrap="nowrap">
+<input type="radio" name="urlDeliveryMedium" value="1" checked="true" />
+SMS to Mobile Phone
+<br />
+<input type="radio" name="urlDeliveryMedium" value="0" />
+Email </td>
+</tr>
+<tr><td> </td>
+<td nowrap="nowrap"><input type="image" src="images/continue.gif" width="86" alt="Continue" height="22" border="0" /></td></tr>
+ </table>
+ </form></td></tr>
+</table>
+
+
+</body>
+</html>
\ No newline at end of file
Added: directory/trunks/triplesec/webapp-activation/src/main/webapp/success.jsp
URL: http://svn.apache.org/viewvc/directory/trunks/triplesec/webapp-activation/src/main/webapp/success.jsp?view=auto&rev=486187
==============================================================================
--- directory/trunks/triplesec/webapp-activation/src/main/webapp/success.jsp (added)
+++ directory/trunks/triplesec/webapp-activation/src/main/webapp/success.jsp Tue Dec 12 07:23:31 2006
@@ -0,0 +1,21 @@
+<%@ page contentType="text/html; charset=iso-8859-1" language="java" %>
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html>
+<head>
+<title>Account Creation Successful</title>
+<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+</head>
+<body>
+ <table width="800" border="0">
+ <tr>
+ <td colspan="2"><img src="images/safehaus-banner.png" width="1000" height="75" /></td>
+ <td width="1"> </td>
+ </tr>
+ <tr>
+ <td width="160"><img src="images/lhs_spacer.png" width="160" height="500" /></td>
+ <td width="836" valign="top"><p> </p>
+ <p>Account successfully created!</p></td>
+ </tr>
+</table>
+</body>
+</html>
Added: directory/trunks/triplesec/webapp-activation/src/test/org/safehaus/triplesec/activation/ActivationUtilsTest.java
URL: http://svn.apache.org/viewvc/directory/trunks/triplesec/webapp-activation/src/test/org/safehaus/triplesec/activation/ActivationUtilsTest.java?view=auto&rev=486187
==============================================================================
--- directory/trunks/triplesec/webapp-activation/src/test/org/safehaus/triplesec/activation/ActivationUtilsTest.java (added)
+++ directory/trunks/triplesec/webapp-activation/src/test/org/safehaus/triplesec/activation/ActivationUtilsTest.java Tue Dec 12 07:23:31 2006
@@ -0,0 +1,22 @@
+package org.safehaus.triplesec.activation;
+
+import junit.framework.TestCase;
+
+
+public class ActivationUtilsTest extends TestCase
+{
+ public void testGetActivationKey()
+ {
+ try { ActivationUtils.getActivationKey( null ); fail( "should not get here" ); }
+ catch ( IllegalArgumentException e ) {}
+
+ try { ActivationUtils.getActivationKey( "not forward slash causes error" ); fail( "should not get here" ); }
+ catch ( IllegalArgumentException e ) {}
+
+ try { ActivationUtils.getActivationKey( "need/forward/slash/in/front" ); fail( "should not get here" ); }
+ catch ( IllegalArgumentException e ) {}
+
+ String key = ActivationUtils.getActivationKey( "/activation/1293847234/HausKeys.jar" );
+ assertEquals( "1293847234", key );
+ }
+}
Added: directory/trunks/triplesec/webapp-changelog/pom.xml
URL: http://svn.apache.org/viewvc/directory/trunks/triplesec/webapp-changelog/pom.xml?view=auto&rev=486187
==============================================================================
--- directory/trunks/triplesec/webapp-changelog/pom.xml (added)
+++ directory/trunks/triplesec/webapp-changelog/pom.xml Tue Dec 12 07:23:31 2006
@@ -0,0 +1,221 @@
+<?xml version="1.0" encoding="ISO-8859-1"?><project>
+<!--
+
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+
+-->
+
+ <parent>
+ <artifactId>build</artifactId>
+ <groupId>org.safehaus.triplesec</groupId>
+ <version>1.0-SNAPSHOT</version>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+ <artifactId>triplesec-webapp-changelog</artifactId>
+ <packaging>war</packaging>
+ <name>Triplesec Webapp for Changelog Service</name>
+ <build>
+ <outputDirectory>src/main/webapp/WEB-INF/classes</outputDirectory>
+ <finalName>triplesec-webapp-changelog</finalName>
+ </build>
+
+ <dependencies>
+ <dependency>
+ <groupId>${pom.groupId}</groupId>
+ <artifactId>triplesec-integration</artifactId>
+ <version>${pom.version}</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>${pom.groupId}</groupId>
+ <artifactId>triplesec-changelog</artifactId>
+ <version>${pom.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.derby</groupId>
+ <artifactId>derby</artifactId>
+ <version>10.1.2.1</version>
+ </dependency>
+ <dependency>
+ <groupId>myfaces</groupId>
+ <artifactId>myfaces-api</artifactId>
+ <version>1.1.0</version>
+ </dependency>
+ <dependency>
+ <groupId>myfaces</groupId>
+ <artifactId>myfaces-impl</artifactId>
+ <version>1.1.0</version>
+ </dependency>
+ <dependency>
+ <groupId>javax.servlet</groupId>
+ <artifactId>jstl</artifactId>
+ <version>1.1.0</version>
+ </dependency>
+ <dependency>
+ <groupId>commons-logging</groupId>
+ <artifactId>commons-logging</artifactId>
+ <version>1.0.3</version>
+ </dependency>
+ <dependency>
+ <groupId>commons-el</groupId>
+ <artifactId>commons-el</artifactId>
+ <version>1.0</version>
+ </dependency>
+ <dependency>
+ <groupId>commons-digester</groupId>
+ <artifactId>commons-digester</artifactId>
+ <version>1.5</version>
+ </dependency>
+ <dependency>
+ <groupId>commons-codec</groupId>
+ <artifactId>commons-codec</artifactId>
+ <version>1.2</version>
+ </dependency>
+ <dependency>
+ <groupId>commons-beanutils</groupId>
+ <artifactId>commons-beanutils</artifactId>
+ <version>1.6.1</version>
+ </dependency>
+ <dependency>
+ <groupId>tomcat</groupId>
+ <artifactId>jasper-runtime</artifactId>
+ <version>5.5.9</version>
+ </dependency>
+ <dependency>
+ <groupId>tomcat</groupId>
+ <artifactId>jasper-compiler</artifactId>
+ <version>5.5.9</version>
+ </dependency>
+ <dependency>
+ <groupId>tomcat</groupId>
+ <artifactId>jasper-compiler-jdt</artifactId>
+ <version>5.5.9</version>
+ </dependency>
+ <dependency>
+ <groupId>xerces</groupId>
+ <artifactId>xmlParserAPIs</artifactId>
+ <version>2.6.2</version>
+ </dependency>
+ <dependency>
+ <groupId>xerces</groupId>
+ <artifactId>xercesImpl</artifactId>
+ <version>2.6.2</version>
+ </dependency>
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-simple</artifactId>
+ <version>1.0</version>
+ </dependency>
+ <dependency>
+ <groupId>jetty</groupId>
+ <artifactId>org.mortbay.jetty</artifactId>
+ <version>5.1.8</version>
+ </dependency>
+ <dependency>
+ <groupId>log4j</groupId>
+ <artifactId>log4j</artifactId>
+ <version>1.2.11</version>
+ </dependency>
+ </dependencies>
+
+
+ <profiles>
+ <profile>
+ <id>default</id>
+ <activation>
+ <activeByDefault>true</activeByDefault>
+ </activation>
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <configuration>
+ <excludes>
+ <!-- Do not run this test since it never exists -->
+ <exclude>**/RunChangelogUITest.java</exclude>
+ <!-- Avoid normal integration tests -->
+ <exclude>**/*ITest.java</exclude>
+ <exclude>**/*IntegrationTest.java</exclude>
+ </excludes>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ <profile>
+ <id>integration</id>
+ <activation>
+ <property><name>integration</name></property>
+ </activation>
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <configuration>
+ <systemProperties>
+ <property>
+ <name>org.safehaus.triplesec.integration.resourcesDirectory</name>
+ <value>${basedir}/src/test/resources</value>
+ </property>
+ </systemProperties>
+ <excludes>
+ <!-- Do not run this test since it never exists -->
+ <exclude>**/RunChangelogUITest.java</exclude>
+ </excludes>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ <profile>
+ <id>ui</id>
+ <activation>
+ <property><name>ui</name></property>
+ </activation>
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <configuration>
+ <systemProperties>
+ <property>
+ <name>org.safehaus.triplesec.integration.resourcesDirectory</name>
+ <value>${basedir}/src/test/resources</value>
+ </property>
+ <property>
+ <name>org.safehaus.triplesec.integration.webapps</name>
+ <value>changelogui</value>
+ </property>
+ <property>
+ <name>org.safehaus.triplesec.integration.webappWarBase.changelogui</name>
+ <value>${basedir}/target/${pom.artifactId}.war</value>
+ </property>
+ </systemProperties>
+ <includes>
+ <include>**/RunChangelogUI.java</include>
+ </includes>
+ <excludes>
+ <exclude>**/*Test.java</exclude>
+ </excludes>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ </profiles>
+</project>
Added: directory/trunks/triplesec/webapp-changelog/src/main/java/org/safehaus/triplesec/changelogui/ChangelogController.java
URL: http://svn.apache.org/viewvc/directory/trunks/triplesec/webapp-changelog/src/main/java/org/safehaus/triplesec/changelogui/ChangelogController.java?view=auto&rev=486187
==============================================================================
--- directory/trunks/triplesec/webapp-changelog/src/main/java/org/safehaus/triplesec/changelogui/ChangelogController.java (added)
+++ directory/trunks/triplesec/webapp-changelog/src/main/java/org/safehaus/triplesec/changelogui/ChangelogController.java Tue Dec 12 07:23:31 2006
@@ -0,0 +1,130 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+package org.safehaus.triplesec.changelogui;
+
+import java.sql.Connection;
+import java.sql.DriverManager;
+import java.sql.PreparedStatement;
+import java.sql.ResultSet;
+import java.sql.SQLException;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+import java.util.Properties;
+
+import javax.faces.context.FacesContext;
+
+import org.safehaus.triplesec.changelog.beta.model.BaseChangeEvent;
+import org.safehaus.triplesec.changelog.beta.model.ChangeEvent;
+
+public class ChangelogController
+{
+
+ private static String dbProtocol = "jdbc:derby:";
+
+ private static String dbName = "changelogDb";
+
+ private static String dbTable = "changelogTable";
+
+ private static String dbUserName = "user1";
+
+ private static String dbPassword = "user1";
+
+ private Properties props = new Properties();
+
+ private Connection conn;
+
+ private BaseChangeEvent changeEvent;
+
+ public void setChangeEvent( BaseChangeEvent changeEvent )
+ {
+ this.changeEvent = changeEvent;
+ }
+
+ public ChangeEvent getChangeEvent()
+ {
+ return this.changeEvent;
+ }
+
+ public ChangelogController() throws SQLException
+ {
+ props.put( "user", dbUserName );
+ props.put( "password", dbPassword );
+ conn = DriverManager.getConnection( dbProtocol + dbName, props );
+ }
+
+ public List getLogs() throws SQLException
+ {
+ List logs = new ArrayList();
+
+ PreparedStatement statement = null;
+ statement = conn.prepareStatement( "select * from " + dbTable );
+
+ ResultSet rs = statement.executeQuery();
+ while ( rs.next() )
+ {
+
+ BaseChangeEvent changeEvent = new BaseChangeEvent(
+ rs.getInt( "Id" ),
+ rs.getInt( "EventType" ),
+ rs.getString( "AffectedEntry" ),
+ rs.getString( "EventPrincipal" ),
+ new Date( rs.getTimestamp( "EventTime" ).getTime() ) );
+
+ logs.add( changeEvent );
+ }
+
+ return logs;
+ }
+
+ public String rollbackPointSelected() throws SQLException {
+ FacesContext context = FacesContext.getCurrentInstance();
+ String eventId = (String) context.getExternalContext().getRequestParameterMap().get("eventId");
+
+ PreparedStatement statement = conn.prepareStatement( "select * from " + dbTable + " where Id = ?" );
+ try
+ {
+ statement.setInt( 1, Integer.parseInt( eventId ) );
+ }
+ catch ( NumberFormatException e )
+ {
+ e.printStackTrace();
+ }
+
+ ResultSet rs = statement.executeQuery();
+ if ( rs.next() )
+ {
+ BaseChangeEvent changeEvent = new BaseChangeEvent(
+ rs.getInt( "Id" ),
+ rs.getInt( "EventType" ),
+ rs.getString( "AffectedEntry" ),
+ rs.getString( "EventPrincipal" ),
+ new Date( rs.getTimestamp( "EventTime" ).getTime() ) );
+
+ this.changeEvent = changeEvent;
+
+ }
+
+ return "success";
+ }
+
+
+
+}
Added: directory/trunks/triplesec/webapp-changelog/src/main/webapp/WEB-INF/classes/org/safehaus/triplesec/changelogui/ChangelogController.class
URL: http://svn.apache.org/viewvc/directory/trunks/triplesec/webapp-changelog/src/main/webapp/WEB-INF/classes/org/safehaus/triplesec/changelogui/ChangelogController.class?view=auto&rev=486187
==============================================================================
Binary file - no diff available.
Propchange: directory/trunks/triplesec/webapp-changelog/src/main/webapp/WEB-INF/classes/org/safehaus/triplesec/changelogui/ChangelogController.class
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: directory/trunks/triplesec/webapp-changelog/src/main/webapp/WEB-INF/faces-config.xml
URL: http://svn.apache.org/viewvc/directory/trunks/triplesec/webapp-changelog/src/main/webapp/WEB-INF/faces-config.xml?view=auto&rev=486187
==============================================================================
--- directory/trunks/triplesec/webapp-changelog/src/main/webapp/WEB-INF/faces-config.xml (added)
+++ directory/trunks/triplesec/webapp-changelog/src/main/webapp/WEB-INF/faces-config.xml Tue Dec 12 07:23:31 2006
@@ -0,0 +1,58 @@
+<?xml version='1.0' encoding='UTF-8'?>
+
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+-->
+
+<!DOCTYPE faces-config PUBLIC
+ "-//Sun Microsystems, Inc.//DTD JavaServer Faces Config 1.1//EN"
+ "http://java.sun.com/dtd/web-facesconfig_1_1.dtd">
+
+<faces-config>
+
+ <navigation-rule>
+ <from-view-id>/listing.jsp</from-view-id>
+ <navigation-case>
+ <from-action>#{ChangelogController.rollbackPointSelected}</from-action>
+ <from-outcome>success</from-outcome>
+ <to-view-id>/confirm.jsp</to-view-id>
+ </navigation-case>
+ </navigation-rule>
+
+ <navigation-rule>
+ <from-view-id>/confirm.jsp</from-view-id>
+ <navigation-case>
+ <from-outcome>listing</from-outcome>
+ <to-view-id>/listing.jsp</to-view-id>
+ </navigation-case>
+ <navigation-case>
+ <from-outcome>rollback</from-outcome>
+ <to-view-id>/listing.jsp</to-view-id>
+ </navigation-case>
+ </navigation-rule>
+
+ <managed-bean>
+ <description>
+ The backing data bean
+ </description>
+ <managed-bean-name>ChangelogController</managed-bean-name>
+ <managed-bean-class>org.safehaus.triplesec.changelogui.ChangelogController</managed-bean-class>
+ <managed-bean-scope>session</managed-bean-scope>
+ </managed-bean>
+
+</faces-config>
Added: directory/trunks/triplesec/webapp-changelog/src/main/webapp/WEB-INF/web.xml
URL: http://svn.apache.org/viewvc/directory/trunks/triplesec/webapp-changelog/src/main/webapp/WEB-INF/web.xml?view=auto&rev=486187
==============================================================================
--- directory/trunks/triplesec/webapp-changelog/src/main/webapp/WEB-INF/web.xml (added)
+++ directory/trunks/triplesec/webapp-changelog/src/main/webapp/WEB-INF/web.xml Tue Dec 12 07:23:31 2006
@@ -0,0 +1,51 @@
+<?xml version='1.0' encoding='UTF-8'?>
+
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+-->
+
+<!DOCTYPE web-app PUBLIC
+ "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
+ "http://java.sun.com/dtd/web-app_2_3.dtd">
+
+
+<web-app>
+ <context-param>
+ <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
+ <param-value>client</param-value>
+ </context-param>
+
+ <listener>
+ <listener-class>org.apache.myfaces.webapp.StartupServletContextListener</listener-class>
+ </listener>
+
+ <!-- Faces Servlet -->
+ <servlet>
+ <servlet-name>Faces Servlet</servlet-name>
+ <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
+ <load-on-startup> 1 </load-on-startup>
+ </servlet>
+
+
+ <!-- Faces Servlet Mapping -->
+ <servlet-mapping>
+ <servlet-name>Faces Servlet</servlet-name>
+ <url-pattern>*.jsf</url-pattern>
+ </servlet-mapping>
+
+</web-app>
Added: directory/trunks/triplesec/webapp-changelog/src/main/webapp/confirm.jsp
URL: http://svn.apache.org/viewvc/directory/trunks/triplesec/webapp-changelog/src/main/webapp/confirm.jsp?view=auto&rev=486187
==============================================================================
--- directory/trunks/triplesec/webapp-changelog/src/main/webapp/confirm.jsp (added)
+++ directory/trunks/triplesec/webapp-changelog/src/main/webapp/confirm.jsp Tue Dec 12 07:23:31 2006
@@ -0,0 +1,47 @@
+<%@ page language="java" contentType="text/html; charset=UTF-8"
+ pageEncoding="UTF-8"%>
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+<head>
+<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
+<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
+<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+<title>Triplesec Changelog Administration</title>
+<link rel="stylesheet" type="text/css"
+ href='<%= request.getContextPath() + "/style.css" %>'>
+</head>
+<body>
+
+<f:view>
+ <h:form>
+ <h1><h:outputText value="Triplesec Changelog Administration"/></h1>
+ <f:verbatim><br></f:verbatim>
+ <h:panelGroup>
+ <h:outputText value="Changes made to the server after the operation whose details given below will be rolled back. Do you confirm?"/>
+ <f:verbatim><br></f:verbatim>
+ <h:commandButton value="Yes, roll'em back!" action="rollback"/>
+ <f:verbatim> </f:verbatim>
+ <h:commandButton value="No, cancel." action="listing"/>
+ <f:verbatim><br></f:verbatim>
+ </h:panelGroup>
+ <f:verbatim><br></f:verbatim>
+ <h:panelGrid border="1" columns="2">
+ <h:outputText value="Event Id: "/>
+ <h:outputText value="#{ChangelogController.changeEvent.eventId}"/>
+ <h:outputText value="Operation: "/>
+ <h:outputText value="#{ChangelogController.changeEvent.eventTypeName}"/>
+ <h:outputText value="Affected Entry: "/>
+ <h:outputText value="#{ChangelogController.changeEvent.affectedEntryName}"/>
+ <h:outputText value="Principal: "/>
+ <h:outputText value="#{ChangelogController.changeEvent.principalName}"/>
+ <h:outputText value="Time: "/>
+ <h:outputFormat value="#{ChangelogController.changeEvent.eventTime}">
+ <f:convertDateTime pattern="MM/dd/yy - hh:mm a"/>
+ </h:outputFormat>
+ </h:panelGrid>
+ </h:form>
+</f:view>
+
+
+</body>
+</html>
\ No newline at end of file
Added: directory/trunks/triplesec/webapp-changelog/src/main/webapp/index.jsp
URL: http://svn.apache.org/viewvc/directory/trunks/triplesec/webapp-changelog/src/main/webapp/index.jsp?view=auto&rev=486187
==============================================================================
--- directory/trunks/triplesec/webapp-changelog/src/main/webapp/index.jsp (added)
+++ directory/trunks/triplesec/webapp-changelog/src/main/webapp/index.jsp Tue Dec 12 07:23:31 2006
@@ -0,0 +1,8 @@
+<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
+
+<html>
+ <head></head>
+ <body>
+ <jsp:forward page="listing.jsf" />
+ </body>
+</html>
Added: directory/trunks/triplesec/webapp-changelog/src/main/webapp/listing.jsp
URL: http://svn.apache.org/viewvc/directory/trunks/triplesec/webapp-changelog/src/main/webapp/listing.jsp?view=auto&rev=486187
==============================================================================
--- directory/trunks/triplesec/webapp-changelog/src/main/webapp/listing.jsp (added)
+++ directory/trunks/triplesec/webapp-changelog/src/main/webapp/listing.jsp Tue Dec 12 07:23:31 2006
@@ -0,0 +1,66 @@
+<%@ page language="java" contentType="text/html; charset=UTF-8"
+ pageEncoding="UTF-8"%>
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+<head>
+<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
+<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
+<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+<title>Triplesec Changelog Administration</title>
+<link rel="stylesheet" type="text/css"
+ href='<%= request.getContextPath() + "/style.css" %>'>
+</head>
+<body>
+
+<f:view>
+ <h:form>
+ <h1><h:outputText value="Triplesec Changelog Administration"/></h1>
+ <h:dataTable width="100%" border="1" value="#{ChangelogController.logs}" var="log">
+ <h:column>
+ <f:facet name="header">
+ <h:outputText value="Id"/>
+ </f:facet>
+ <h:outputText value="#{log.eventId}"/>
+ </h:column>
+ <h:column>
+ <f:facet name="header">
+ <h:outputText value="Operation"/>
+ </f:facet>
+ <h:outputText value="#{log.eventTypeName}"/>
+ </h:column>
+ <h:column>
+ <f:facet name="header">
+ <h:outputText value="Affected Entry"/>
+ </f:facet>
+ <h:outputText title="#{log.affectedEntryName}" value="#{log.affectedEntryShortName}"/>
+ </h:column>
+ <h:column>
+ <f:facet name="header">
+ <h:outputText value="Principal"/>
+ </f:facet>
+ <h:outputText value="#{log.principalName}"/>
+ </h:column>
+ <h:column>
+ <f:facet name="header">
+ <h:outputText value="Time"/>
+ </f:facet>
+ <h:outputFormat value="#{log.eventTime}">
+ <f:convertDateTime pattern="MM/dd/yy - hh:mm a"/>
+ </h:outputFormat>
+ </h:column>
+ <h:column>
+ <f:facet name="header">
+ <h:outputText value="Rollback .."/>
+ </f:facet>
+ <h:commandLink action="#{ChangelogController.rollbackPointSelected}">
+ <h:outputText value=".. to this point!"/>
+ <f:param name="eventId" value="#{log.eventId}" />
+ </h:commandLink>
+ </h:column>
+ </h:dataTable>
+ </h:form>
+</f:view>
+
+
+</body>
+</html>
\ No newline at end of file
Added: directory/trunks/triplesec/webapp-changelog/src/main/webapp/style.css
URL: http://svn.apache.org/viewvc/directory/trunks/triplesec/webapp-changelog/src/main/webapp/style.css?view=auto&rev=486187
==============================================================================
--- directory/trunks/triplesec/webapp-changelog/src/main/webapp/style.css (added)
+++ directory/trunks/triplesec/webapp-changelog/src/main/webapp/style.css Tue Dec 12 07:23:31 2006
@@ -0,0 +1,176 @@
+body {
+ font-family:arial, verdana, helvetica, sans-serif;
+ font-size:12px;
+ cursor:default;
+ color:#AAAAAA;
+ background-color:#FFFFFF
+}
+* {
+ margin: 0px;
+ padding: 0px;
+ text-decoration: none;
+}
+html {
+ height:100%;
+ margin-bottom:1px;
+}
+#container {
+ width: 750px;
+ margin-right: auto;
+ margin-left: auto;
+ text-align: left;
+ background-color: #FFFFFF;
+ color:#AAAAAA;
+}
+#header {
+ width:100%;
+ padding-top:15px;
+}
+.spacer {
+ width:100%;
+ height:15px;
+}
+hr {
+ border:0px;
+ color:#CCCCCC;
+ background-color:#CDCDCD;
+ height: 1px;
+ width: 100%;
+ text-align: left;
+}
+h1 {
+ font-size:28px;
+ color:#FFBA27;
+ background-color:#FFFFFF;
+ font-family:Arial, Verdana, Helvetica, sans-serif;
+ font-weight:300;
+}
+h2 {
+ font-size:20px;
+ color:#CCCCCC;
+ font-family:Arial, Verdana, Helvetica, sans-serif;
+ font-weight:300;
+ background-color:#FFFFFF;
+}
+h3 {
+ color:#FFBA27;
+ font-size:15px;
+ background-color:#F9F9F9;
+ border-width:1px;
+ border-color:#AAAAAA;
+ border-style:solid;
+ text-align:left;
+ margin-left:20px;
+ margin-right:20px;
+ font-weight:300;
+ padding:5px;
+}
+.top_main_heading {
+ margin-top:15px;
+}
+#left {
+ float:left;
+ width:200px;
+ background-color:#FFFFFF;
+ color:#AAAAAA;
+}
+#leftcontent p {
+ color:#AAAAAA;
+ background-color:#FFFFFF;
+ font-size: 12px;
+ text-align:left;
+ margin-left:20px;
+ margin-right:20px;
+}
+#leftcontent ul {
+ list-style:none;
+ padding-left:20px;
+ color:#AAAAAA;
+ background-color:#FFFFFF;
+}
+#leftcontent a {
+ color:#FFBA27;
+ text-decoration:none;
+ font-size:16px;
+ background-color:#FFFFFF;
+}
+.news {
+ color:#999999;
+ border-bottom:1px;
+ border-left:1px;
+ border-right:1px;
+ border-top:0px;
+ border-style:solid;
+ border-color:#AAAAAA;
+ background-color:#FFFFFF;
+ line-height:20px;
+ padding:5px;
+}
+#leftcontent a:hover {
+ color:#FFBA27;
+ background-color:#FFFFFF;
+ text-decoration:underline;
+}
+#main {
+ float:left;
+ width:550px;
+ color:#999999;
+ background-color:#FFFFFF;
+ padding-bottom:20px;
+ background:url(img/background.png);
+}
+#maincontent p {
+ color:#999999;
+ background-color:#FFFFFF;
+ border-bottom:1px;
+ border-left:1px;
+ border-right:1px;
+ border-top:0px;
+ border-style:solid;
+ border-color:#AAAAAA;
+ margin-left:20px;
+ margin-right:20px;
+ margin-bottom:15px;
+ line-height:20px;
+ padding:20px;
+}
+#maincontent a {
+ color:#FFBA27;
+ background-color:#FFFFFF;
+ text-decoration:none;
+}
+#maincontent a:hover {
+ color:#FFBA27;
+ background-color:#FFFFFF;
+ text-decoration:underline;
+}
+#footer {
+ clear:both;
+ width:750px;
+ font-size:12px;
+ font-family:Verdana, Arial, Helvetica, sans-serif;
+}
+#footer a {
+ color:#AAAAAA;
+ background-color:#FFFFFF;
+ text-decoration:none;
+}
+#footer a:hover {
+ color:#AAAAAA;
+ background-color:#FFFFFF;
+ text-decoration:underline;
+}
+.right {
+ color:#AAAAAA;
+ background-color:#FFFFFF;
+ float:right;
+ font-size:100%;
+ margin-top:5px;
+}
+.left {
+ color:#AAAAAA;
+ background-color:#FFFFFF;
+ float:left;
+ font-size:100%;
+ margin-top:5px;
+}
\ No newline at end of file
Added: directory/trunks/triplesec/webapp-changelog/src/test/java/org/safehaus/triplesec/changelogui/RunChangelogUI.java
URL: http://svn.apache.org/viewvc/directory/trunks/triplesec/webapp-changelog/src/test/java/org/safehaus/triplesec/changelogui/RunChangelogUI.java?view=auto&rev=486187
==============================================================================
--- directory/trunks/triplesec/webapp-changelog/src/test/java/org/safehaus/triplesec/changelogui/RunChangelogUI.java (added)
+++ directory/trunks/triplesec/webapp-changelog/src/test/java/org/safehaus/triplesec/changelogui/RunChangelogUI.java Tue Dec 12 07:23:31 2006
@@ -0,0 +1,36 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+package org.safehaus.triplesec.changelogui;
+
+
+
+public class RunChangelogUI extends TriplesecChangelogWebappUnit
+{
+ public RunChangelogUI() throws Exception
+ {
+ super();
+ }
+
+
+ public void testNonStop() throws Exception
+ {
+ System.in.read();
+ }
+}
Added: directory/trunks/triplesec/webapp-changelog/src/test/java/org/safehaus/triplesec/changelogui/TriplesecChangelogWebappUnit.java
URL: http://svn.apache.org/viewvc/directory/trunks/triplesec/webapp-changelog/src/test/java/org/safehaus/triplesec/changelogui/TriplesecChangelogWebappUnit.java?view=auto&rev=486187
==============================================================================
--- directory/trunks/triplesec/webapp-changelog/src/test/java/org/safehaus/triplesec/changelogui/TriplesecChangelogWebappUnit.java (added)
+++ directory/trunks/triplesec/webapp-changelog/src/test/java/org/safehaus/triplesec/changelogui/TriplesecChangelogWebappUnit.java Tue Dec 12 07:23:31 2006
@@ -0,0 +1,115 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+package org.safehaus.triplesec.changelogui;
+
+import java.io.File;
+import java.sql.Connection;
+import java.sql.DriverManager;
+import java.sql.SQLException;
+import java.sql.Statement;
+import java.util.Properties;
+
+import javax.naming.NamingException;
+
+import org.safehaus.triplesec.integration.TriplesecIntegration;
+
+public class TriplesecChangelogWebappUnit extends TriplesecIntegration
+{
+
+ private static String dbDriver = "org.apache.derby.jdbc.EmbeddedDriver";
+
+ private static String dbProtocol = "jdbc:derby:";
+
+ private static String dbName = "changelogDb";
+
+ private static String dbTable = "changelogTable";
+
+ private static String dbTableFields = "(Id int generated always as identity, EventType int, AffectedEntry varchar(255), EventPrincipal varchar(127), EventTime timestamp, EventMessage varchar(1024))";
+
+ private static String dbUserName = "user1";
+
+ private static String dbPassword = "user1";
+
+ private static Properties props = new Properties();
+
+
+ public TriplesecChangelogWebappUnit() throws Exception
+ {
+ super();
+
+ props.put( "user", dbUserName );
+ props.put( "password", dbPassword );
+
+ }
+
+
+ protected void setUp() throws Exception
+ {
+ File serverHome = getServerHome();
+ File dbDir = new File( serverHome, "db" );
+ dbDir.mkdir();
+ System.setProperty( "derby.system.home", dbDir.getCanonicalPath() );
+ initDb( dbDir );
+ super.setUp();
+
+ }
+
+
+ protected void tearDown() throws Exception
+ {
+ super.tearDown();
+ shutdownDb();
+ }
+
+
+ private void initDb( File dbDir ) throws Exception
+ {
+
+ // Initialize the DB driver
+ // (This starts the embedded server.)
+ Class.forName( dbDriver ).newInstance();
+
+ Connection conn;
+
+ // Get the DB connection
+ try
+ {
+ conn = DriverManager.getConnection( dbProtocol + dbName + ";create=true", props );
+ }
+ catch ( SQLException e )
+ {
+ NamingException ne = new NamingException();
+ ne.setRootCause( e );
+ throw ne;
+ }
+
+ // Create the table
+ Statement statement = conn.createStatement();
+ statement.execute( "create table " + dbTable + dbTableFields );
+
+ }
+
+
+ private void shutdownDb() throws Exception
+ {
+ DriverManager.getConnection( dbProtocol + dbName + ";shutdown=true", props );
+ }
+
+}
Added: directory/trunks/triplesec/webapp-changelog/src/test/resources/log4j.properties
URL: http://svn.apache.org/viewvc/directory/trunks/triplesec/webapp-changelog/src/test/resources/log4j.properties?view=auto&rev=486187
==============================================================================
--- directory/trunks/triplesec/webapp-changelog/src/test/resources/log4j.properties (added)
+++ directory/trunks/triplesec/webapp-changelog/src/test/resources/log4j.properties Tue Dec 12 07:23:31 2006
@@ -0,0 +1,11 @@
+# Set root logger level to DEBUG and its only appender to A1.
+log4j.rootLogger=INFO, A1
+
+# A1 is set to be a ConsoleAppender.
+log4j.appender.A1=org.apache.log4j.ConsoleAppender
+
+# A1 uses PatternLayout.
+log4j.appender.A1.layout=org.apache.log4j.PatternLayout
+log4j.appender.A1.layout.ConversionPattern=%-4r [%t] %-5p %c %x - %m%n
+
+