directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tbenn...@apache.org
Subject svn commit: r486187 [46/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...
Date Tue, 12 Dec 2006 15:24:14 GMT
Added: directory/trunks/triplesec/webapp-registration/src/main/java/org/safehaus/triplesec/registration/view/TriplesecRegistrationWizard.java
URL: http://svn.apache.org/viewvc/directory/trunks/triplesec/webapp-registration/src/main/java/org/safehaus/triplesec/registration/view/TriplesecRegistrationWizard.java?view=auto&rev=486187
==============================================================================
--- directory/trunks/triplesec/webapp-registration/src/main/java/org/safehaus/triplesec/registration/view/TriplesecRegistrationWizard.java (added)
+++ directory/trunks/triplesec/webapp-registration/src/main/java/org/safehaus/triplesec/registration/view/TriplesecRegistrationWizard.java Tue Dec 12 07:23:31 2006
@@ -0,0 +1,236 @@
+/*
+ *  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.registration.view;
+
+
+import wicket.examples.wizard.ezwizard.impl.Wizard;
+import wicket.examples.wizard.ezwizard.impl.WizardTransition;
+import wicket.examples.wizard.ezwizard.intf.IWizardStep;
+import wicket.util.string.Strings;
+
+import org.safehaus.triplesec.admin.DataAccessException;
+import org.safehaus.triplesec.admin.NoSuchEntryException;
+import org.safehaus.triplesec.registration.model.RegistrationInfo;
+
+
+/**
+ * This class defines the registration wizard of the Triplesec server.
+ *
+ * @author <a href="mailto:akarasulu@safehaus.org">Alex Karasulu</a>
+ * @version $Rev$
+ */
+public class TriplesecRegistrationWizard extends Wizard
+{
+
+    // Raw model so wizard can query it to find out model status
+    private RegistrationInfo model;
+
+    // Friendly indices in the array of wizard panels
+    public static int STEP_INTRO = 0;
+    public static int STEP_USER = 1;
+    public static int STEP_ADDR = 2;
+    public static int STEP_DEPLOY = 3;
+    public static int STEP_FINISH = 4;
+
+    protected static final String NO_PSWD = "Password field must be set.";
+    protected static final String NO_PSWD_CONFIRM = "Password confirmation field must be set.";
+    protected static final String CONFIRM_FAILURE = "Password and confirmation fields do not match.";
+    protected static final String NO_DEP_MECH = "A deployment mechanism must be selected.";
+    protected static final String NO_CARRIER = "A mobile carrier must be selected.";
+
+    
+    /**
+     * Constructs a TripleSec configuration wizard.
+     */
+    public TriplesecRegistrationWizard( final TriplesecRegistrationApplication app, 
+        final RegistrationInfo model, IWizardStep[] wizardSteps )
+    {
+
+        // Store a reference to the model, so steps and transitions
+        // can use it.
+        this.model = model;
+
+        // set a reference to this master controller in each wizard
+        // step, so steps can refer to common wizard data -- like model
+        for ( int i = 0; i < wizardSteps.length; i++ )
+        {
+            wizardSteps[i].setOwner( this );
+        }
+
+        // Start wizard from the INTRO node. The fact that steps are
+        // defined in an array does not imply the wizard flow sequence.
+        // Sequence is controlled by transition objects.
+        sourceState = wizardSteps[STEP_INTRO];
+
+        // Set the current state to source node...
+        currentState = sourceState;
+
+        // wizard steps and transitions...
+        wizardSteps[STEP_INTRO].addOutgoingTransition( new WizardTransition( this, "INTRO to USER",
+            wizardSteps[STEP_USER] )
+        {
+            //  no validation needed for this transition
+            public boolean validate()
+            {
+                return true;
+            }
+        } );
+        wizardSteps[STEP_USER].addOutgoingTransition( new WizardTransition( this, "USER TO ADDR",
+            wizardSteps[STEP_ADDR] )
+        {
+            public boolean validate()
+            {
+                // -----------------------------------------------------------
+                // Some simple presence validations
+                // -----------------------------------------------------------
+                
+                if ( Strings.isEmpty( model.getPassword() ) )
+                {
+                    errors.put( "noPswd", NO_PSWD );
+                    return false;
+                }
+                if ( Strings.isEmpty( model.getPasswordConfirm() ) )
+                {
+                    errors.put( "noPswdConfirm", NO_PSWD_CONFIRM );
+                    return false;
+                }
+                if ( ! Strings.isEqual( model.getPassword(), model.getPasswordConfirm() ) )
+                {
+                    errors.put( "ConfirmFailure", CONFIRM_FAILURE );
+                    return false;
+                }
+                
+                // -----------------------------------------------------------
+                // Let's validate that the username is available for new user
+                // -----------------------------------------------------------
+
+                try
+                {
+                    if ( app.getAdmin().hasUser( model.getUsername() ) )
+                    {
+                        errors.put( "usernameTaken", "A user already exists with the name: " + model.getUsername() );
+                        return false;
+                    }
+                }
+                catch ( NoSuchEntryException e )
+                {
+                    // this is what we hope for 
+                }
+                catch ( DataAccessException e )
+                {
+                    // this is bad news but nothing we can do here but log it
+                    app.getWicketServlet().log( "Failure when trying to check for user existance.", e );
+                }
+                
+                return true;
+            }
+        } );
+        wizardSteps[STEP_ADDR].addOutgoingTransition( new WizardTransition( this, "ADDR TO DEPLOY",
+            wizardSteps[STEP_DEPLOY] )
+        {
+            public boolean validate()
+            {
+                return true;
+            }
+        } );
+        wizardSteps[STEP_DEPLOY].addOutgoingTransition( new WizardTransition( this, "DEPLOY TO FINISH",
+            wizardSteps[STEP_FINISH] )
+        {
+            public boolean validate()
+            {
+                // -----------------------------------------------------------
+                // Some simple presence validations
+                // -----------------------------------------------------------
+                
+                if ( Strings.isEmpty( model.getDeploymentMechanism() ) )
+                {
+                    errors.put( "noDepMech", NO_DEP_MECH );
+                    return false;
+                }
+                if ( Strings.isEmpty( model.getMobileCarrier()) )
+                {
+                    errors.put( "noCarrier", NO_CARRIER );
+                    return false;
+                }
+                if ( Strings.isEmpty( model.getTokenPin() ) )
+                {
+                    errors.put( "noPin", "You must enter a numeric pin of 4 or more digits." );
+                    return false;
+                }
+                if ( Strings.isEmpty( model.getTokenPinConfirm() ) )
+                {
+                    errors.put( "noPinConfirm", "You must enter a numeric pin confirmation of 4 or more digits." );
+                    return false;
+                }
+                if ( ! model.getTokenPin().equals( model.getTokenPinConfirm() ) )
+                {
+                    errors.put( "pinConfirmNotEqual", "The pin and pin confirmation values are not equal." );
+                    return false;
+                }
+                
+
+                // -----------------------------------------------------------
+                // Let's validate the correct format of pin and mobile number
+                // -----------------------------------------------------------
+                
+                for ( int ii = 0; ii < model.getTokenPin().length(); ii++ )
+                {
+                    if ( ! Character.isDigit( model.getTokenPin().charAt( ii ) ) )
+                    {
+                        errors.put( "pinFormat", "Pin must contain only numeric characters." );
+                        return false;
+                    }
+                }
+                
+                if ( model.getTokenPin().length() < 4 )
+                {
+                    errors.put( "pinTooShort", "Pin too short. Length must be at least 4 digits in length" );
+                    return false;
+                }
+                
+                for ( int ii = 0; ii < model.getMobile().length(); ii++ )
+                {
+                    if ( ! Character.isDigit( model.getMobile().charAt( ii ) ) )
+                    {
+                        errors.put( "mobileNumInvalid", "Mobile phone number must contain only numeric characters." );
+                        return false;
+                    }
+                }
+                
+                if ( model.getMobile().length() != 10 )
+                {
+                    errors.put( "mobileNumLengthInvalid", "Mobile phone number should be ten digits long." );
+                    return false;
+                }
+                
+                return true;
+            }
+        } );
+    }
+
+    
+    /**
+     * Returns the raw model bean for the TripleSec configuration wizard.
+     */
+    public RegistrationInfo getModel()
+    {
+        return model;
+    }
+}

Added: directory/trunks/triplesec/webapp-registration/src/main/java/org/safehaus/triplesec/registration/view/borders/AppPageBorder.java
URL: http://svn.apache.org/viewvc/directory/trunks/triplesec/webapp-registration/src/main/java/org/safehaus/triplesec/registration/view/borders/AppPageBorder.java?view=auto&rev=486187
==============================================================================
--- directory/trunks/triplesec/webapp-registration/src/main/java/org/safehaus/triplesec/registration/view/borders/AppPageBorder.java (added)
+++ directory/trunks/triplesec/webapp-registration/src/main/java/org/safehaus/triplesec/registration/view/borders/AppPageBorder.java Tue Dec 12 07:23:31 2006
@@ -0,0 +1,42 @@
+/*
+ *  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.registration.view.borders;
+
+
+import wicket.markup.html.border.Border;
+import wicket.model.IModel;
+
+
+public class AppPageBorder extends Border
+{
+    private static final long serialVersionUID = 1L;
+
+
+    public AppPageBorder( String id )
+    {
+        this( id, null );
+    }
+
+
+    public AppPageBorder( String id, IModel model )
+    {
+        super( id, model );
+    }
+}

Added: directory/trunks/triplesec/webapp-registration/src/main/java/org/safehaus/triplesec/registration/view/borders/WizardPanelBorder.java
URL: http://svn.apache.org/viewvc/directory/trunks/triplesec/webapp-registration/src/main/java/org/safehaus/triplesec/registration/view/borders/WizardPanelBorder.java?view=auto&rev=486187
==============================================================================
--- directory/trunks/triplesec/webapp-registration/src/main/java/org/safehaus/triplesec/registration/view/borders/WizardPanelBorder.java (added)
+++ directory/trunks/triplesec/webapp-registration/src/main/java/org/safehaus/triplesec/registration/view/borders/WizardPanelBorder.java Tue Dec 12 07:23:31 2006
@@ -0,0 +1,40 @@
+/*
+ *  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.registration.view.borders;
+
+
+import wicket.markup.html.border.Border;
+import wicket.markup.html.basic.Label;
+import wicket.model.IModel;
+
+
+public class WizardPanelBorder extends Border
+{
+    private static final long serialVersionUID = -2684017282683778591L;
+
+
+    public WizardPanelBorder( String id, IModel titleModel )
+    {
+        super( id );
+
+        // add the panel title to the panel border...
+        add( new Label( "title", titleModel ) );
+    }
+}

Added: directory/trunks/triplesec/webapp-registration/src/main/java/org/safehaus/triplesec/registration/view/pages/BasePage.java
URL: http://svn.apache.org/viewvc/directory/trunks/triplesec/webapp-registration/src/main/java/org/safehaus/triplesec/registration/view/pages/BasePage.java?view=auto&rev=486187
==============================================================================
--- directory/trunks/triplesec/webapp-registration/src/main/java/org/safehaus/triplesec/registration/view/pages/BasePage.java (added)
+++ directory/trunks/triplesec/webapp-registration/src/main/java/org/safehaus/triplesec/registration/view/pages/BasePage.java Tue Dec 12 07:23:31 2006
@@ -0,0 +1,38 @@
+/*
+ *  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.registration.view.pages;
+
+import wicket.markup.html.WebPage;
+import wicket.markup.html.border.Border;
+
+import org.safehaus.triplesec.registration.view.borders.AppPageBorder;
+
+public abstract class BasePage extends WebPage
+{
+    private static final long serialVersionUID = -2684017282683778591L;
+
+    public BasePage()
+    {
+        // create border and add it to the page
+        Border border = new AppPageBorder("border");
+        border.setTransparentResolver(true);
+        super.add(border);
+    }
+}

Added: directory/trunks/triplesec/webapp-registration/src/main/java/org/safehaus/triplesec/registration/view/pages/WizardPage.java
URL: http://svn.apache.org/viewvc/directory/trunks/triplesec/webapp-registration/src/main/java/org/safehaus/triplesec/registration/view/pages/WizardPage.java?view=auto&rev=486187
==============================================================================
--- directory/trunks/triplesec/webapp-registration/src/main/java/org/safehaus/triplesec/registration/view/pages/WizardPage.java (added)
+++ directory/trunks/triplesec/webapp-registration/src/main/java/org/safehaus/triplesec/registration/view/pages/WizardPage.java Tue Dec 12 07:23:31 2006
@@ -0,0 +1,129 @@
+/*
+ *  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.registration.view.pages;
+
+
+import org.safehaus.triplesec.registration.model.RegistrationInfo;
+import org.safehaus.triplesec.registration.view.TriplesecRegistrationApplication;
+import org.safehaus.triplesec.registration.view.TriplesecRegistrationWizard;
+import org.safehaus.triplesec.registration.view.panels.*;
+
+import wicket.model.IModel;
+import wicket.model.CompoundPropertyModel;
+
+
+/**
+ * Page that contains all the panels that represent the app's wizard steps.
+ *
+ * @author <a href="mailto:akarasulu@safehaus.org">Alex Karasulu</a>
+ * @version $Rev$
+ */
+public class WizardPage extends BasePage
+{
+    private static final long serialVersionUID = 1L;
+
+    private TriplesecRegistrationWizard wizard;
+
+    // array of wizard panels
+    WizardPanel[] wizardPanels = new WizardPanel[5];
+
+
+    public WizardPage()
+    {
+        // always turn versioning off...
+        setVersioned( false );
+
+        // raw wizard model is just a javabean
+        RegistrationInfo rawModel = new RegistrationInfo();
+
+        // set default values for various fields here
+
+        // wrap raw model with IModel so Wicket can work with it
+        IModel wizardModel = new CompoundPropertyModel( rawModel );
+
+        // Each panel is a wizard step. Initialization in the loop
+        // cannot be used, because each step defines different model-
+        // related methods, thus all steps have different types.
+        wizardPanels[TriplesecRegistrationWizard.STEP_INTRO] = 
+            new WizardPanelIntro( "wp" + TriplesecRegistrationWizard.STEP_INTRO, wizardModel );
+        wizardPanels[TriplesecRegistrationWizard.STEP_USER] = 
+            new WizardPanelUser( "wp" + TriplesecRegistrationWizard.STEP_USER, wizardModel );
+        wizardPanels[TriplesecRegistrationWizard.STEP_ADDR] = 
+            new WizardPanelAddress( "wp" + TriplesecRegistrationWizard.STEP_ADDR, wizardModel );
+        wizardPanels[TriplesecRegistrationWizard.STEP_DEPLOY] = 
+            new WizardPanelDeploy( "wp" + TriplesecRegistrationWizard.STEP_DEPLOY, wizardModel );
+        wizardPanels[TriplesecRegistrationWizard.STEP_FINISH] = new WizardPanelFinish( "wp"
+            + TriplesecRegistrationWizard.STEP_FINISH, wizardModel );
+
+        // Wizard controller is ok with raw model... also sets reference to
+        // wizard controller in each step
+        wizard = new TriplesecRegistrationWizard( ( TriplesecRegistrationApplication ) getApplication(), 
+            rawModel, wizardPanels ); 
+
+        // add all panels to wizard page...
+        for ( int i = 0; i < wizardPanels.length; i++ )
+        {
+            add( wizardPanels[i] );
+        }
+
+        // hide all panels except the first one
+        updatePanels();
+    }
+
+
+    public void onCancel()
+    {
+        wizard = null;
+        updatePanels();
+    }
+
+
+    public boolean onBack()
+    {
+        boolean movedBack = false;
+        if ( wizard != null )
+        {
+            movedBack = wizard.back();
+        }
+        updatePanels();
+        return movedBack;
+    }
+
+
+    public boolean onNext()
+    {
+        boolean movedNext = false;
+        if ( wizard != null )
+        {
+            movedNext = wizard.forward();
+        }
+        updatePanels();
+        return movedNext;
+    }
+
+
+    public void updatePanels()
+    {
+        for ( int i = 0; i < wizardPanels.length; i++ )
+        {
+            wizardPanels[i].setVisible( wizard != null && ( "wp" + i ).equals( wizard.getCurrentStepName() ) );
+        }
+    }
+}

Added: directory/trunks/triplesec/webapp-registration/src/main/java/org/safehaus/triplesec/registration/view/panels/WizardPanel.java
URL: http://svn.apache.org/viewvc/directory/trunks/triplesec/webapp-registration/src/main/java/org/safehaus/triplesec/registration/view/panels/WizardPanel.java?view=auto&rev=486187
==============================================================================
--- directory/trunks/triplesec/webapp-registration/src/main/java/org/safehaus/triplesec/registration/view/panels/WizardPanel.java (added)
+++ directory/trunks/triplesec/webapp-registration/src/main/java/org/safehaus/triplesec/registration/view/panels/WizardPanel.java Tue Dec 12 07:23:31 2006
@@ -0,0 +1,349 @@
+/*
+ *  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.registration.view.panels;
+
+import wicket.markup.html.panel.Panel;
+import wicket.markup.html.panel.FeedbackPanel;
+import wicket.markup.html.form.Form;
+import wicket.markup.html.form.Button;
+import wicket.examples.wizard.ezwizard.intf.IWizardStep;
+import wicket.examples.wizard.ezwizard.intf.IWizardTransition;
+import wicket.examples.wizard.ezwizard.intf.IWizard;
+import wicket.model.IModel;
+import wicket.model.Model;
+
+import java.util.ArrayList;
+import java.util.Map;
+import java.util.Iterator;
+
+import org.safehaus.triplesec.registration.view.borders.WizardPanelBorder;
+import org.safehaus.triplesec.registration.view.pages.WizardPage;
+
+/**
+ * Wizard steps are usually derived from a panel, and implement
+ * IWizardStep.  Steps usually are panels, so this class should
+ * serve as a base class for any wizard panel.
+ */
+public abstract class WizardPanel extends Panel implements IWizardStep {
+    private Button next;
+    private Button cancel;
+    private Button back;
+
+    /**
+     * Master wizard object -- can be used to access common data
+     */
+    protected IWizard wizard;
+    /**
+     * Outgoing transitions are implemented as an array list for
+     * the easy adding of new transitions.
+     */
+    private ArrayList outgoingTransitions = new ArrayList();
+    /**
+     * Incoming transition.
+     */
+    protected IWizardTransition incomingTransition;
+    /**
+     * The wizard panel's form.
+     */
+    private Form form;
+
+    public WizardPanel( String id, IModel model, String title )
+    {
+        this(id, model, title, false, false);
+    }
+
+    public WizardPanel( String id, IModel model, String title,
+                       boolean hideBack, boolean hideNext )
+    {
+        super( id, model );
+
+        // create border and add it to the page
+        WizardPanelBorder border = new WizardPanelBorder( "border", new Model( title ) );
+        border.setTransparentResolver( true );
+        super.add( border );
+
+        // create feedback panel and add it to the panel
+        add( new FeedbackPanel( "feedback" ) );
+
+        // create form and add it to the panel
+        add( form = new Form( "form", model ) );
+
+        // create cancel button and add it to the panel
+        cancel = newCancelButton( "cancel" );
+        cancel.setDefaultFormProcessing( false );
+        form.add( cancel );
+
+        // create back button and add it to the panel
+        back = newBackButton( "back" );
+        if ( hideBack )
+        {
+            back.setVisible(false);
+        }
+        back.setDefaultFormProcessing( false );
+        form.add( back );
+
+        next = newNextButton( "next" );
+        if ( hideNext )
+        {
+            next.setVisible(false);
+        }
+        form.add( next );
+    }
+
+    protected Form newForm( String id, IModel model ) {
+        return new Form( id, model );
+    }
+
+    protected Button newCancelButton( String id ) {
+        return new Button( id )
+        {
+            private static final long serialVersionUID = -2684017282683778591L;
+
+            protected void onSubmit()
+            {
+                getWizardPage().onCancel();
+            }
+        };
+    }
+
+    protected Button newBackButton( String id ) {
+        return new Button( id )
+        {
+            private static final long serialVersionUID = -2684017282683778591L;
+
+            protected void onSubmit()
+            {
+                getWizardPage().onBack();
+            }
+        };
+    }
+
+    protected Button newNextButton( String id ) {
+        return new Button( id )
+        {
+            private static final long serialVersionUID = -2684017282683778591L;
+
+            protected void onSubmit()
+            {
+                boolean success = getWizardPage().onNext();
+                if ( !success )
+                {
+                    Map errors = getWizard().getWizardErrors();
+                    for ( Iterator iter = errors.values().iterator(); iter.hasNext(); )
+                    {
+                        form.error( (String) iter.next() );
+                    }
+                }
+            }
+        };
+    }
+
+
+    protected void hideButtons()
+    {
+        if ( next != null )
+        {
+            next.setVisible( false );
+        }
+
+        if ( cancel != null )
+        {
+            cancel.setVisible( false );
+        }
+
+        if ( back != null )
+        {
+            back.setVisible( false );
+        }
+    }
+
+    protected Form getForm()
+    {
+        return form;
+    }
+
+    protected WizardPage getWizardPage()
+    {
+        return (WizardPage) this.getPage();
+    }
+
+    /**
+     * Returns array of outgoing transitions in the same order in which
+     * they were added by addOutgoingTransition() method.
+     *
+     * @return array of outgoing transitions, the transition with the most
+     * weight is returned first
+     */
+    public IWizardTransition[] getOutgoingTransitions()
+    {
+        return ( IWizardTransition[] )
+                outgoingTransitions.toArray( new IWizardTransition[0] );
+    }
+
+    /**
+     * Returns a transition which will be chosen if a "next" command
+     * is selected for this node.
+     * <p>
+     * All outbound transitions are validated in the order they were
+     * added to this state. The first valid transition is chosen.
+     *
+     * @return a first valid outgoing transition or null if no valid
+     * transitions found
+     */
+    public IWizardTransition getOutgoingTransition()
+    {
+        IWizardTransition[] edges = this.getOutgoingTransitions();
+        for ( int i = 0; i < edges.length; i++ ) {
+            if ( edges[i].validate() )
+            {
+                return edges[i];
+            }
+        }
+        return null;
+    }
+
+    /**
+     * Returns the incoming transition for this state; used
+     * during actual wizard traversal.
+     *
+     * @return incoming transition
+     */
+    public IWizardTransition getIncomingTransition()
+    {
+        return incomingTransition;
+    }
+
+    /**
+     * Sets the incoming transition. Used during forward traversal
+     * to mark the way through the wizard. The incoming transition
+     * is used for backward traversal.
+     *
+     * @param value incoming transition
+     */
+    public void setIncomingTransition(IWizardTransition value)
+    {
+        incomingTransition = value;
+    }
+
+    /**
+     * Adds an outgoing transition. Transitions must be added in the
+     * same order should be validated.
+     *
+     * @param value outgoing transition
+     */
+    public void addOutgoingTransition(IWizardTransition value)
+    {
+        outgoingTransitions.add( value );
+        value.setSource( this );
+    }
+
+    /**
+     * Returns true if this state has been marked as checkpoint. This means
+     * that a wizard cannot return back from this state.
+     *
+     * @return true if this state is a checkpoint
+     */
+    public boolean isCheckpoint()
+    {
+        // checkpoints not supported...
+        return false;
+    }
+
+    /**
+     * Returns the name of this state. Each state must have a unique name..
+     *
+     * @return state name
+     */
+    public String getStateName()
+    {
+        // use Wicket component ID as step name
+        return getId();
+    }
+
+    /**
+     * Returns the wizard, which contains this state as part
+     * of the wizard sequence.
+     *
+     * @return wizard which owns this node
+     */
+    public IWizard getWizard()
+    {
+        return wizard;
+    }
+
+    /**
+     * Verifies that this state is included in the path to the current state.
+     *
+     * @return true if this state is present in the actual path to the current
+     *         state, but is not a current state itself; false otherwise.
+     */
+    public boolean isStateInPath()
+    {
+        return (
+                this == wizard.getCurrentStep() ||
+                        checkTraverseBack( wizard.getCurrentStep(), this )
+                );
+    }
+
+    /**
+     * Instructs the state to clear all its boolean properties.
+     * Usually called before the properties are about to be set.
+     * <br><br>
+     * The reason for this method is that browsers/HTTP do not notify
+     * server about cleared checkboxes or radiobuttons. So, these values
+     * should be cleared before they are set with client values.
+     * <br><br>
+     * This method is used in Struts; not used in JSF and Wicket.
+     */
+    public void resetBooleans()
+    {
+        /* no-op */
+    }
+
+    /**
+     * Sets master wizard controller for this step.
+     */
+    public void setOwner(IWizard owner)
+    {
+        wizard = owner;
+    }
+
+    /**
+     * Verifies if a state is included in the path to the current state.
+     *
+     * @param startState the state where to start backward traversal
+     * @param searchState the state which we are looking for in the
+     * traversal path
+     * @return true if search node is found in the actual path while
+     * traversing back from start node; false otherwise
+     */
+    private static boolean checkTraverseBack( IWizardStep startState,
+                                              IWizardStep searchState )
+    {
+
+        IWizardTransition incomingEdge = startState.getIncomingTransition();
+        if ( incomingEdge == null )
+        {
+            return false;
+        }
+        IWizardStep srcState = incomingEdge.getSource();
+        return srcState == searchState || checkTraverseBack( srcState, searchState );
+    }
+}

Added: directory/trunks/triplesec/webapp-registration/src/main/java/org/safehaus/triplesec/registration/view/panels/WizardPanelAddress.java
URL: http://svn.apache.org/viewvc/directory/trunks/triplesec/webapp-registration/src/main/java/org/safehaus/triplesec/registration/view/panels/WizardPanelAddress.java?view=auto&rev=486187
==============================================================================
--- directory/trunks/triplesec/webapp-registration/src/main/java/org/safehaus/triplesec/registration/view/panels/WizardPanelAddress.java (added)
+++ directory/trunks/triplesec/webapp-registration/src/main/java/org/safehaus/triplesec/registration/view/panels/WizardPanelAddress.java Tue Dec 12 07:23:31 2006
@@ -0,0 +1,85 @@
+/*
+ *  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.registration.view.panels;
+
+
+import java.util.Arrays;
+import java.util.List;
+
+import wicket.markup.html.form.DropDownChoice;
+import wicket.markup.html.form.TextField;
+import wicket.model.IModel;
+
+
+public class WizardPanelAddress extends WizardPanel
+{
+    private static final long serialVersionUID = 370256949857642718L;
+    private static final List COUNTRYS = Arrays.asList( new String[]
+        { "United States", "Afghanistan", "Albania", "Algeria", "American Samoa", "Andorra", "Anguilla", "Antarctica",
+            "Antigua And Barbuda", "Argentina", "Armenia", "Aruba", "Australia", "Austria", "Azerbaijan", "Bahamas",
+            "Bahrain", "Bangladesh", "Barbados", "Belarus", "Belgium", "Belize", "Benin", "Bermuda", "Bhutan",
+            "Bolivia", "Bosnia and Herzegovina", "Botswana", "Bouvet Island", "Brazil",
+            "British Indian Ocean Territory", "Brunei Darussalam", "Bulgaria", "Burkina Faso", "Burundi", "Cambodia",
+            "Cameroon", "Canada", "Cape Verde", "Cayman Islands", "Central African Republic", "Chad", "Chile", "China",
+            "Christmas Island", "Cocos (Keeling) Islands", "Colombia", "Comoros", "Congo",
+            "Congo, the Democratic Republic of the", "Cook Islands", "Costa Rica", "Cote d'Ivoire", "Croatia",
+            "Cyprus", "Czech Republic", "Denmark", "Djibouti", "Dominica", "Dominican Republic", "East Timor",
+            "Ecuador", "Egypt", "El Salvador", "England", "Equatorial Guinea", "Eritrea", "Espana", "Estonia",
+            "Ethiopia", "Falkland Islands", "Faroe Islands", "Fiji", "Finland", "France", "French Guiana",
+            "French Polynesia", "French Southern Territories", "Gabon", "Gambia", "Georgia", "Germany", "Ghana",
+            "Gibraltar", "Great Britain", "Greece", "Greenland", "Grenada", "Guadeloupe", "Guam", "Guatemala",
+            "Guinea", "Guinea-Bissau", "Guyana", "Haiti", "Heard and Mc Donald Islands", "Honduras", "Hong Kong",
+            "Hungary", "Iceland", "India", "Indonesia", "Ireland", "Israel", "Italy", "Jamaica", "Japan", "Jordan",
+            "Kazakhstan", "Kenya", "Kiribati", "Korea, Republic of", "Korea (South)", "Kuwait", "Kyrgyzstan",
+            "Lao People's Democratic Republic", "Latvia", "Lebanon", "Lesotho", "Liberia", "Libya", "Liechtenstein",
+            "Lithuania", "Luxembourg", "Macau", "Macedonia", "Madagascar", "Malawi", "Malaysia", "Maldives", "Mali",
+            "Malta", "Marshall Islands", "Martinique", "Mauritania", "Mauritius", "Mayotte", "Mexico",
+            "Micronesia, Federated States of", "Moldova, Republic of", "Monaco", "Mongolia", "Montserrat", "Morocco",
+            "Mozambique", "Myanmar", "Namibia", "Nauru", "Nepal", "Netherlands", "Netherlands Antilles",
+            "New Caledonia", "New Zealand", "Nicaragua", "Niger", "Nigeria", "Niue", "Norfolk Island",
+            "Northern Ireland", "Northern Mariana Islands", "Norway", "Oman", "Pakistan", "Palau", "Panama",
+            "Papua New Guinea", "Paraguay", "Peru", "Philippines", "Pitcairn", "Poland", "Portugal", "Puerto Rico",
+            "Qatar", "Reunion", "Romania", "Russia", "Russian Federation", "Rwanda", "Saint Kitts and Nevis",
+            "Saint Lucia", "Saint Vincent and the Grenadines", "Samoa (Independent)", "San Marino",
+            "Sao Tome and Principe", "Saudi Arabia", "Scotland", "Senegal", "Serbia and Montenegro", "Seychelles",
+            "Sierra Leone", "Singapore", "Slovakia", "Slovenia", "Solomon Islands", "Somalia", "South Africa",
+            "South Georgia and the South Sandwich Islands", "South Korea", "Spain", "Sri Lanka", "St. Helena",
+            "St. Pierre and Miquelon", "Suriname", "Svalbard and Jan Mayen Islands", "Swaziland", "Sweden",
+            "Switzerland", "Taiwan", "Tajikistan", "Tanzania", "Thailand", "Togo", "Tokelau", "Tonga", "Trinidad",
+            "Trinidad and Tobago", "Tunisia", "Turkey", "Turkmenistan", "Turks and Caicos Islands", "Tuvalu", "Uganda",
+            "Ukraine", "United Arab Emirates", "United Kingdom", "United States",
+            "United States Minor Outlying Islands", "Uruguay", "USA", "Uzbekistan", "Vanuatu",
+            "Vatican City State (Holy See)", "Venezuela", "Viet Nam", "Virgin Islands (British)",
+            "Virgin Islands (U.S.)", "Wales", "Wallis and Futuna Islands", "Western Sahara", "Yemen", "Zambia",
+            "Zimbabwe" } );
+
+
+    public WizardPanelAddress( String id, IModel model )
+    {
+        super( id, model, "User Address Information" );
+
+        getForm().add( new TextField( "address1" ) );
+        getForm().add( new TextField( "address2" ) );
+        getForm().add( new TextField( "city" ) );
+        getForm().add( new TextField( "stateProvRegion" ) );
+        getForm().add( new TextField( "zipPostalCode" ) );
+        getForm().add( new DropDownChoice( "country", COUNTRYS ) );
+    }
+}

Added: directory/trunks/triplesec/webapp-registration/src/main/java/org/safehaus/triplesec/registration/view/panels/WizardPanelDeploy.java
URL: http://svn.apache.org/viewvc/directory/trunks/triplesec/webapp-registration/src/main/java/org/safehaus/triplesec/registration/view/panels/WizardPanelDeploy.java?view=auto&rev=486187
==============================================================================
--- directory/trunks/triplesec/webapp-registration/src/main/java/org/safehaus/triplesec/registration/view/panels/WizardPanelDeploy.java (added)
+++ directory/trunks/triplesec/webapp-registration/src/main/java/org/safehaus/triplesec/registration/view/panels/WizardPanelDeploy.java Tue Dec 12 07:23:31 2006
@@ -0,0 +1,50 @@
+/*
+ *  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.registration.view.panels;
+
+
+import java.util.Arrays;
+import java.util.List;
+
+import org.safehaus.sms.Carrier;
+
+import wicket.markup.html.form.DropDownChoice;
+import wicket.markup.html.form.PasswordTextField;
+import wicket.markup.html.form.RequiredTextField;
+import wicket.model.IModel;
+
+
+public class WizardPanelDeploy extends WizardPanel
+{
+    private static final long serialVersionUID = 370256949857642718L;
+    private static final List MECHANISMS = Arrays.asList( new String[] { "sms", "email" } );
+
+    public WizardPanelDeploy( String id, IModel model )
+    {
+        super( id, model, "Deployment Settings" );
+
+        getForm().add( new RequiredTextField( "midletName" ) );
+        getForm().add( new RequiredTextField( "mobile" ) );
+        getForm().add( new PasswordTextField( "tokenPin" ) );
+        getForm().add( new PasswordTextField( "tokenPinConfirm" ) );
+        getForm().add( new DropDownChoice( "mobileCarrier", Carrier.ALL_CARRIER_STRINGS ) );
+        getForm().add( new DropDownChoice( "deploymentMechanism", MECHANISMS ) );
+    }
+}

Added: directory/trunks/triplesec/webapp-registration/src/main/java/org/safehaus/triplesec/registration/view/panels/WizardPanelFinish.java
URL: http://svn.apache.org/viewvc/directory/trunks/triplesec/webapp-registration/src/main/java/org/safehaus/triplesec/registration/view/panels/WizardPanelFinish.java?view=auto&rev=486187
==============================================================================
--- directory/trunks/triplesec/webapp-registration/src/main/java/org/safehaus/triplesec/registration/view/panels/WizardPanelFinish.java (added)
+++ directory/trunks/triplesec/webapp-registration/src/main/java/org/safehaus/triplesec/registration/view/panels/WizardPanelFinish.java Tue Dec 12 07:23:31 2006
@@ -0,0 +1,329 @@
+/*
+ *  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.registration.view.panels;
+
+ 
+import java.io.IOException;
+import java.util.Date;
+import java.util.Properties;
+
+import javax.mail.Message;
+import javax.mail.MessagingException;
+import javax.mail.Session;
+import javax.mail.internet.InternetAddress;
+import javax.mail.internet.MimeMessage;
+
+import org.apache.commons.httpclient.HttpClient;
+import org.apache.commons.httpclient.HttpMethod;
+import org.apache.commons.httpclient.NameValuePair;
+import org.apache.commons.httpclient.methods.PostMethod;
+import org.apache.commons.lang.RandomStringUtils;
+import org.apache.commons.lang.math.RandomUtils;
+import org.apache.directory.shared.ldap.util.StringTools;
+import org.safehaus.sms.Carrier;
+import org.safehaus.triplesec.admin.Application;
+import org.safehaus.triplesec.admin.DataAccessException;
+import org.safehaus.triplesec.admin.HauskeysUser;
+import org.safehaus.triplesec.admin.HauskeysUserModifier;
+import org.safehaus.triplesec.admin.TriplesecAdmin;
+import org.safehaus.triplesec.configuration.SmsConfiguration;
+import org.safehaus.triplesec.configuration.SmtpConfiguration;
+import org.safehaus.triplesec.registration.model.RegistrationInfo;
+import org.safehaus.triplesec.registration.view.TriplesecRegistrationApplication;
+
+import com.sun.mail.smtp.SMTPTransport;
+
+import wicket.model.IModel;
+import wicket.model.Model;
+import wicket.markup.html.form.Button;
+import wicket.markup.html.link.ExternalLink;
+import wicket.markup.html.basic.Label;
+import wicket.Component;
+
+
+/**
+ *
+ *
+ * @author <a href="mailto:akarasulu@safehaus.org">Alex Karasulu</a>
+ * @version $Rev$
+ */
+public class WizardPanelFinish extends WizardPanel
+{
+    private static final long serialVersionUID = 1L;
+    private String message = "Click the Done button to complete registration.";
+    private ExternalLink link = null;
+
+    public WizardPanelFinish( String id, IModel model )
+    {
+        super( id, model, "Finished!" );
+
+        TriplesecRegistrationApplication app = ( TriplesecRegistrationApplication ) getApplication();
+        StringBuffer url = new StringBuffer();
+        
+        if ( app.getRedirectUrl() != null && ! app.getRedirectUrl().equals( "undefined" ) )
+        {
+            url.append( app.getRedirectUrl() );
+        }
+        else
+        {
+            url.append( app.getPresentationBaseUrl() ).append( "/demo" );
+        }
+        
+        link = new ExternalLink( "link", url.toString(), "here." );
+        link.setVisible( false );
+        getForm().add( link );
+        
+        getForm().add( new Label( "message", new Model()
+        {
+            private static final long serialVersionUID = 5029629236706738579L;
+
+            public Object getObject(Component component)
+            {
+                return message;
+            }
+        }
+        ) );
+    }
+
+
+    protected Button newNextButton( String id )
+    {
+        Button done = new Button( id )
+        {
+            private static final long serialVersionUID = -2684017282683778591L;
+
+
+            protected void onSubmit()
+            {
+                // register the new user account here
+                RegistrationInfo info = ( RegistrationInfo ) getForm().getModelObject();
+                TriplesecRegistrationApplication app = ( TriplesecRegistrationApplication ) getApplication();
+                TriplesecAdmin admin = app.getAdmin();
+                
+                // -----------------------------------------------------------
+                // create the user entry
+                // -----------------------------------------------------------
+
+                String activationKey = null;
+                
+                try
+                {
+                    activationKey = admin.getRandomUniqueActivationKey();
+                }
+                catch ( DataAccessException e1 )
+                {
+                    message = "Registration for user " + info.getUsername() 
+                    + " failed. Notifications will NOT be delivered.";
+                    hideButtons();
+                    error( "Registration failed!" );
+                    return;
+                }
+                
+                HauskeysUserModifier modifier = admin
+                    .newHauskeysUser( info.getUsername(), info.getFirstName(), info.getLastName(), info.getPassword() )
+                    .setEmail( info.getEmail() ).setLabel( info.getMidletName() )
+                    .setMidletName( info.getMidletName() ).setMobile( info.getMobile() )
+                    .setMobileCarrier( info.getMobileCarrier() ).setNotifyBy( info.getDeploymentMechanism() )
+                    .setPassword( info.getPassword() ).setRealm( app.getRealm() ).setTokenPin( info.getTokenPin() )
+                    .setActivationKey( activationKey ).setSecret( StringTools.utf8ToString( getRandomSecret() ) )
+                    .setMovingFactor( getRandomFactor() ).setAddress1( info.getAddress1() )
+                    .setAddress2( info.getAddress2() ).setCity( info.getCity() ).setCountry( info.getCountry() )
+                    .setStateProvRegion( info.getStateProvRegion() ).setZipPostalCode( info.getZipPostalCode() );
+                
+                HauskeysUser user;
+                try
+                {
+                    user = modifier.add();
+                }
+                catch ( DataAccessException e )
+                {
+                    message = "Registration for user " + info.getUsername() 
+                        + " failed. Notifications will NOT be delivered.";
+                    hideButtons();
+                    error( "Registration failed!" );
+                    return;
+                }
+                
+                // -----------------------------------------------------------
+                // Add a profile for the user to the demo app if it exists
+                // -----------------------------------------------------------
+                
+                Application demoApp = null;
+                try
+                {
+                    demoApp = admin.getApplication( "demo" );
+                }
+                catch ( DataAccessException e )
+                {
+                }
+                
+                if ( demoApp != null )
+                {
+                    try
+                    {
+                        demoApp.modifier().newProfile( info.getUsername(), info.getUsername() ).add();
+                    }
+                    catch ( DataAccessException e )
+                    {
+                        message = "Triplesec user " + info.getUsername() 
+                            + " has been registered but could not create demo account profile. " 
+                            + "Notifications will still be delivered.";
+                        hideButtons();
+                        warn( "Registration completed but with warnings." );
+                        return;
+                    }
+                }
+
+                // -----------------------------------------------------------
+                // Send notifications
+                // -----------------------------------------------------------
+                
+                try
+                {
+                    if ( info.getDeploymentMechanism().equals( "email" ) )
+                    {
+                        sendEmail( user );
+                    }
+                    else
+                    {
+                        sendSms( user );
+                    }
+                }
+                catch ( Exception e )
+                {
+                    message = "Triplesec user " + info.getUsername() 
+                        + " has been registered. However notifications may not " +
+                                "delivered due to some messaging failures.";
+                    hideButtons();
+                    warn( "Registration completed with warnings." );
+                    return;
+                }
+                
+                message = "Triplesec user " + info.getUsername() 
+                    + " has been registered. Notifications will be delivered.  " +
+                            "To use/test your account follow this link ";
+                link.setVisible( true );
+                hideButtons();
+                info( "Registration completed successfully." );
+            }
+        };
+        done.setModel( new Model( "Done" ) );
+        return done;
+    }
+
+    
+    void sendSms( HauskeysUser user ) throws IOException
+    {
+        TriplesecRegistrationApplication app = ( TriplesecRegistrationApplication ) getApplication();
+        SmsConfiguration smsConfig = app.getSmsConfig();
+        HttpClient client = new HttpClient();
+        HttpMethod method = new PostMethod( smsConfig.getSmsTransportUrl() );
+        int carrierCode = Carrier.getCarrierCode( user.getMobileCarrier() );
+        String mobile = user.getMobile();
+        
+        if ( mobile.startsWith( "+" ) )
+        {
+            mobile = mobile.substring( 1 );
+        }
+        
+        if ( mobile.startsWith( "1" ) )
+        {
+            mobile = mobile.substring( 1 );
+            if ( mobile.length() < 10 )
+            {
+                throw new RuntimeException( "mobile phone number was not 10 digits in length" );
+            }
+        }
+        
+        StringBuffer buf = new StringBuffer();
+        buf.append( app.getPresentationBaseUrl() );
+        buf.append( "/activation/" );
+        buf.append( user.getActivationKey() );
+        buf.append( "/HausKeys.jar" );
+        
+        NameValuePair[] params = new NameValuePair[] {
+            new NameValuePair( "Carrier", String.valueOf( carrierCode ) ),
+            new NameValuePair( "UID", smsConfig.getSmsUsername() ),
+            new NameValuePair( "PWD", smsConfig.getSmsPassword() ),
+            new NameValuePair( "Campaign", smsConfig.getSmsAccountName() ),
+            new NameValuePair( "CellNumber", mobile ),
+            new NameValuePair( "msg", buf.toString() )
+        };
+        method.setQueryString( params );
+        client.executeMethod( method );
+    }
+
+
+    void sendEmail( HauskeysUser user ) throws MessagingException
+    {
+        TriplesecRegistrationApplication app = ( TriplesecRegistrationApplication ) getApplication();
+        SmtpConfiguration smtpConfig = app.getSmtpConfig();
+        Properties props = new Properties();
+        props.setProperty( "mail.smtp.host", smtpConfig.getSmtpHost() );
+        Session session = Session.getInstance( props, null );
+
+        MimeMessage mimeMsg = new MimeMessage( session );
+        if ( smtpConfig.getSmtpFrom() != null )
+        {
+            mimeMsg.setFrom( new InternetAddress( smtpConfig.getSmtpFrom() ) );
+        }
+        else
+        {
+            mimeMsg.setFrom();
+        }
+
+        StringBuffer buf = new StringBuffer();
+        buf.append( app.getPresentationBaseUrl() );
+        buf.append( "/activation/" );
+        buf.append( user.getActivationKey() );
+        buf.append( "/HausKeys.jar" );
+        
+        mimeMsg.setRecipients( Message.RecipientType.TO, InternetAddress.parse( user.getEmail(), false ) );
+        mimeMsg.setSubject( smtpConfig.getSmtpSubject() );
+        mimeMsg.setText( buf.toString() );
+        mimeMsg.setHeader( "X-Mailer", "triplesec-acivation" );
+        mimeMsg.setSentDate( new Date() );
+        SMTPTransport transport = ( SMTPTransport ) session.getTransport( "smtp" );
+        if ( smtpConfig.isSmtpAuthenticate() )
+        {
+            transport.connect( smtpConfig.getSmtpHost(), smtpConfig.getSmtpUsername(), smtpConfig.getSmtpPassword() );
+        }
+        else
+        {
+            transport.connect();
+        }
+        transport.sendMessage( mimeMsg, mimeMsg.getAllRecipients() );
+        app.getWicketServlet().log( "mail server response: " + transport.getLastServerResponse() );
+    }
+    
+
+    private String getRandomFactor()
+    {
+        return String.valueOf( RandomUtils.nextLong() );
+    }
+
+
+    private byte[] getRandomSecret()
+    {
+        // max length 16, min length 8 bytes
+        int length = 8 + RandomUtils.nextInt() % 8;
+        return RandomStringUtils.random( length ).getBytes();
+    }
+}

Added: directory/trunks/triplesec/webapp-registration/src/main/java/org/safehaus/triplesec/registration/view/panels/WizardPanelIntro.java
URL: http://svn.apache.org/viewvc/directory/trunks/triplesec/webapp-registration/src/main/java/org/safehaus/triplesec/registration/view/panels/WizardPanelIntro.java?view=auto&rev=486187
==============================================================================
--- directory/trunks/triplesec/webapp-registration/src/main/java/org/safehaus/triplesec/registration/view/panels/WizardPanelIntro.java (added)
+++ directory/trunks/triplesec/webapp-registration/src/main/java/org/safehaus/triplesec/registration/view/panels/WizardPanelIntro.java Tue Dec 12 07:23:31 2006
@@ -0,0 +1,32 @@
+/*
+ *  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.registration.view.panels;
+
+import wicket.model.IModel;
+
+public class WizardPanelIntro extends WizardPanel
+{
+    private static final long serialVersionUID = 8371966017154004708L;
+
+    public WizardPanelIntro(String id, IModel model)
+    {
+        super( id, model, "Introduction", true, false );
+    }
+}

Added: directory/trunks/triplesec/webapp-registration/src/main/java/org/safehaus/triplesec/registration/view/panels/WizardPanelUser.java
URL: http://svn.apache.org/viewvc/directory/trunks/triplesec/webapp-registration/src/main/java/org/safehaus/triplesec/registration/view/panels/WizardPanelUser.java?view=auto&rev=486187
==============================================================================
--- directory/trunks/triplesec/webapp-registration/src/main/java/org/safehaus/triplesec/registration/view/panels/WizardPanelUser.java (added)
+++ directory/trunks/triplesec/webapp-registration/src/main/java/org/safehaus/triplesec/registration/view/panels/WizardPanelUser.java Tue Dec 12 07:23:31 2006
@@ -0,0 +1,50 @@
+/*
+ *  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.registration.view.panels;
+
+
+import wicket.markup.html.form.PasswordTextField;
+import wicket.markup.html.form.RequiredTextField;
+import wicket.markup.html.form.validation.EmailAddressPatternValidator;
+import wicket.model.IModel;
+import wicket.model.Model;
+
+
+public class WizardPanelUser extends WizardPanel
+{
+    private static final long serialVersionUID = 370256949857642718L;
+
+    public WizardPanelUser(String id, IModel model)
+    {
+        super( id, model, "Required User Information" );
+
+        getForm().add( new RequiredTextField( "username" ) );
+        getForm().add( new PasswordTextField( "password" ) );
+        getForm().add( new  PasswordTextField( "passwordConfirm" ) );
+        getForm().add( new RequiredTextField( "firstName" ) );
+        getForm().add( new RequiredTextField( "lastName" ) );
+        
+        RequiredTextField email = new RequiredTextField( "email" );
+        email.add( EmailAddressPatternValidator.getInstance() );
+        email.setLabel( new Model( "Email" ) );
+        getForm().add( email );
+        
+    }
+}

Added: directory/trunks/triplesec/webapp-registration/src/main/resources/org/safehaus/triplesec/registration/view/TriplesecRegistrationApplication.properties
URL: http://svn.apache.org/viewvc/directory/trunks/triplesec/webapp-registration/src/main/resources/org/safehaus/triplesec/registration/view/TriplesecRegistrationApplication.properties?view=auto&rev=486187
==============================================================================
--- directory/trunks/triplesec/webapp-registration/src/main/resources/org/safehaus/triplesec/registration/view/TriplesecRegistrationApplication.properties (added)
+++ directory/trunks/triplesec/webapp-registration/src/main/resources/org/safehaus/triplesec/registration/view/TriplesecRegistrationApplication.properties Tue Dec 12 07:23:31 2006
@@ -0,0 +1,3 @@
+# default validator messages
+RequiredValidator=field '${label}' is required
+EmailAddressPatternValidator=field '${label}' is required

Added: directory/trunks/triplesec/webapp-registration/src/main/resources/org/safehaus/triplesec/registration/view/borders/AppPageBorder.html
URL: http://svn.apache.org/viewvc/directory/trunks/triplesec/webapp-registration/src/main/resources/org/safehaus/triplesec/registration/view/borders/AppPageBorder.html?view=auto&rev=486187
==============================================================================
--- directory/trunks/triplesec/webapp-registration/src/main/resources/org/safehaus/triplesec/registration/view/borders/AppPageBorder.html (added)
+++ directory/trunks/triplesec/webapp-registration/src/main/resources/org/safehaus/triplesec/registration/view/borders/AppPageBorder.html Tue Dec 12 07:23:31 2006
@@ -0,0 +1,46 @@
+<!--
+
+  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 html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xmlns:wicket="http://wicket.sourceforge.net/" xml:lang="en" lang="en">
+<head>
+    <wicket:head>
+        <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+        <link rel="stylesheet" href="css/style.css" type="text/css"/>
+    </wicket:head>
+</head>
+<body>
+<wicket:border>
+    <div id="container">
+        <div id="header">
+            <h1>Triplesec Server Registration</h1>
+            <h2>keep it simple&nbsp;&middot;&nbsp;keep it safe</h2>
+            <br/>
+            <hr/>
+        </div>
+        <wicket:body/>
+        <div id="foot">
+            &copy; <a href="http://www.safehaus.org">Safehaus</a> 2005
+        </div>
+    </div>
+</wicket:border>
+</body>
+</html>

Added: directory/trunks/triplesec/webapp-registration/src/main/resources/org/safehaus/triplesec/registration/view/borders/WizardPanelBorder.html
URL: http://svn.apache.org/viewvc/directory/trunks/triplesec/webapp-registration/src/main/resources/org/safehaus/triplesec/registration/view/borders/WizardPanelBorder.html?view=auto&rev=486187
==============================================================================
--- directory/trunks/triplesec/webapp-registration/src/main/resources/org/safehaus/triplesec/registration/view/borders/WizardPanelBorder.html (added)
+++ directory/trunks/triplesec/webapp-registration/src/main/resources/org/safehaus/triplesec/registration/view/borders/WizardPanelBorder.html Tue Dec 12 07:23:31 2006
@@ -0,0 +1,34 @@
+<!--
+
+  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.
+
+-->
+
+<wicket:border>
+    <h3 class="top_main_heading"><span wicket:id="title">Panel Title</span></h3>
+    <div id="content">
+
+<!--
+        <div class="nav">
+            <a href="http://triplesec.safehaus.org/Installing+Triplesec+Server" target="_new">Help Me!</a>&nbsp;<br/>
+        </div>
+-->
+        <wicket:body/>
+        
+    </div>
+</wicket:border>

Added: directory/trunks/triplesec/webapp-registration/src/main/resources/org/safehaus/triplesec/registration/view/pages/WizardPage.html
URL: http://svn.apache.org/viewvc/directory/trunks/triplesec/webapp-registration/src/main/resources/org/safehaus/triplesec/registration/view/pages/WizardPage.html?view=auto&rev=486187
==============================================================================
--- directory/trunks/triplesec/webapp-registration/src/main/resources/org/safehaus/triplesec/registration/view/pages/WizardPage.html (added)
+++ directory/trunks/triplesec/webapp-registration/src/main/resources/org/safehaus/triplesec/registration/view/pages/WizardPage.html Tue Dec 12 07:23:31 2006
@@ -0,0 +1,39 @@
+<!--
+
+  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.
+
+-->
+
+<?xml version="1.0"?>
+<html xmlns="http://www.w3.org/1999/xhtml" xmlns:wicket="http://wicket.sourceforge.net/" xml:lang="en" lang="en">
+<head>
+    <wicket:head>
+        <title>TripleSec Registration Wizard</title>
+    </wicket:head>
+</head>
+<body>
+    <span wicket:id="border">
+        <!-- Use panels to group markup and components for each wizard step -->
+        <span wicket:id="wp0">Content of first wizard panel here</span>
+        <span wicket:id="wp1">Content of second wizard panel here</span>
+        <span wicket:id="wp2">Content of third wizard panel here</span>
+        <span wicket:id="wp3">Content of fourth wizard panel here</span>
+        <span wicket:id="wp4">Content of fifth wizard panel here</span>
+    </span>
+</body>
+</html>

Added: directory/trunks/triplesec/webapp-registration/src/main/resources/org/safehaus/triplesec/registration/view/panels/WizardPanel.html
URL: http://svn.apache.org/viewvc/directory/trunks/triplesec/webapp-registration/src/main/resources/org/safehaus/triplesec/registration/view/panels/WizardPanel.html?view=auto&rev=486187
==============================================================================
--- directory/trunks/triplesec/webapp-registration/src/main/resources/org/safehaus/triplesec/registration/view/panels/WizardPanel.html (added)
+++ directory/trunks/triplesec/webapp-registration/src/main/resources/org/safehaus/triplesec/registration/view/panels/WizardPanel.html Tue Dec 12 07:23:31 2006
@@ -0,0 +1,37 @@
+<!-- 
+  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.
+
+-->
+
+<?xml version="1.0"?>
+<html xmlns="http://www.w3.org/1999/xhtml" xmlns:wicket="http://wicket.sourceforge.net/" xml:lang="en" lang="en">
+<body>
+    <wicket:panel>
+        <span wicket:id="border">
+            <span wicket:id="feedback">[feedback panel]</span>
+            <form wicket:id="form">
+                <wicket:child/>
+                <br/>
+                <input wicket:id="cancel" type="submit" id="cancelButton" value="Cancel" />&nbsp;
+                <input wicket:id="back" type="submit" id="backButton" value="Back" />&nbsp;
+                <input wicket:id="next" type="submit" id="nextButton" value="Next" />
+            </form>
+        </span>
+    </wicket:panel>
+</body>
+</html>

Added: directory/trunks/triplesec/webapp-registration/src/main/resources/org/safehaus/triplesec/registration/view/panels/WizardPanelAddress.html
URL: http://svn.apache.org/viewvc/directory/trunks/triplesec/webapp-registration/src/main/resources/org/safehaus/triplesec/registration/view/panels/WizardPanelAddress.html?view=auto&rev=486187
==============================================================================
--- directory/trunks/triplesec/webapp-registration/src/main/resources/org/safehaus/triplesec/registration/view/panels/WizardPanelAddress.html (added)
+++ directory/trunks/triplesec/webapp-registration/src/main/resources/org/safehaus/triplesec/registration/view/panels/WizardPanelAddress.html Tue Dec 12 07:23:31 2006
@@ -0,0 +1,52 @@
+<!-- 
+  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.
+
+-->
+
+<wicket:extend>
+    <br/>
+    
+    <p>
+        Optional user address information.
+    </p>
+    <br/>
+    <br/>
+
+    <label for="address1">Address1</label>
+    <input wicket:id="address1" id="address1" type="text"/><br/>
+
+    <label for="address2">Address2</label>
+    <input wicket:id="address2" id="address2" type="text"/><br/>
+
+    <label for="city">City</label>
+    <input wicket:id="city" id="city" type="text"/><br/>
+
+    <label for="stateProvRegion">State/Province/Region</label>
+    <input wicket:id="stateProvRegion" id="stateProvRegion" type="text"/><br/>
+
+    <label for="zipPostalCode">Zip/Postal Code</label>
+    <input wicket:id="zipPostalCode" id="zipPostalCode" type="text"/><br/>
+    <br/>
+
+    <label for="country">Country</label>
+    <select wicket:id="country" id="country">
+        <option>United States</option>
+    </select>
+    <br/>
+    <br/>
+</wicket:extend>

Added: directory/trunks/triplesec/webapp-registration/src/main/resources/org/safehaus/triplesec/registration/view/panels/WizardPanelDeploy.html
URL: http://svn.apache.org/viewvc/directory/trunks/triplesec/webapp-registration/src/main/resources/org/safehaus/triplesec/registration/view/panels/WizardPanelDeploy.html?view=auto&rev=486187
==============================================================================
--- directory/trunks/triplesec/webapp-registration/src/main/resources/org/safehaus/triplesec/registration/view/panels/WizardPanelDeploy.html (added)
+++ directory/trunks/triplesec/webapp-registration/src/main/resources/org/safehaus/triplesec/registration/view/panels/WizardPanelDeploy.html Tue Dec 12 07:23:31 2006
@@ -0,0 +1,66 @@
+<!-- 
+  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.
+
+-->
+
+<wicket:extend>
+    <br/>
+    
+    <p>
+      The following information is required to provision (deploy) the
+      One Time Password (OTP) generating application to your handset.  
+      Here you'll pick a name for the application which will be deployed 
+      to your mobile phone or PDA.  You need to provide the mobile number
+      and your service provider (carrier).  You also need to set the pin
+      used to unlock the OTP generator application.
+    </p>
+    <br/>
+    <label for="midletName">Application Name</label>
+    <input wicket:id="midletName" id="midletName" type="text"/><br/>
+
+    <label for="mobile">Mobile Number</label>
+    <input wicket:id="mobile" id="mobile" type="text"/><br/>
+
+    <label for="mobileCarrier">Mobile Carrier</label>
+    <select wicket:id="mobileCarrier" id="mobileCarrier">
+        <option>T-Mobile</option>
+    </select>
+    <br/>
+    <br/>
+    <label for="tokenPin">Token Pin</label>
+    <input wicket:id="tokenPin" id="tokenPin" type="password"/><br/>
+
+    <label for="tokenPinConfirm">Token Pin Confirm</label>
+    <input wicket:id="tokenPinConfirm" id="tokenPinConfirm" type="password"/><br/>
+    <br/>
+    <br/>
+    
+    <p>
+      Your application can be delivered to you via email for upload to your J2ME 
+      device or it can be deployed directly to the device via SMS.  Make sure you
+      have internet service if you opt to deploy via SMS.
+    </p>
+    <br/>
+
+    <label for="deploymentMechanism">Deployment Mechanism</label>
+    <select wicket:id="deploymentMechanism" id="deploymentMechanism">
+        <option>Sms</option>
+    </select>
+    <br/>
+    <br/>
+</wicket:extend>

Added: directory/trunks/triplesec/webapp-registration/src/main/resources/org/safehaus/triplesec/registration/view/panels/WizardPanelFinish.html
URL: http://svn.apache.org/viewvc/directory/trunks/triplesec/webapp-registration/src/main/resources/org/safehaus/triplesec/registration/view/panels/WizardPanelFinish.html?view=auto&rev=486187
==============================================================================
--- directory/trunks/triplesec/webapp-registration/src/main/resources/org/safehaus/triplesec/registration/view/panels/WizardPanelFinish.html (added)
+++ directory/trunks/triplesec/webapp-registration/src/main/resources/org/safehaus/triplesec/registration/view/panels/WizardPanelFinish.html Tue Dec 12 07:23:31 2006
@@ -0,0 +1,27 @@
+<!-- 
+  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.
+
+-->
+
+<wicket:extend>
+    <p>
+        <span wicket:id="message">message</span>
+        <a wicket:id="link">text here</a>
+    </p>
+    <br/>
+</wicket:extend>

Added: directory/trunks/triplesec/webapp-registration/src/main/resources/org/safehaus/triplesec/registration/view/panels/WizardPanelIntro.html
URL: http://svn.apache.org/viewvc/directory/trunks/triplesec/webapp-registration/src/main/resources/org/safehaus/triplesec/registration/view/panels/WizardPanelIntro.html?view=auto&rev=486187
==============================================================================
--- directory/trunks/triplesec/webapp-registration/src/main/resources/org/safehaus/triplesec/registration/view/panels/WizardPanelIntro.html (added)
+++ directory/trunks/triplesec/webapp-registration/src/main/resources/org/safehaus/triplesec/registration/view/panels/WizardPanelIntro.html Tue Dec 12 07:23:31 2006
@@ -0,0 +1,10 @@
+<wicket:extend>
+  <p>
+    Welcome to the Triplesec user registration wizard, which will step 
+    you through the process of registering a triplesec user account.
+  </p>
+  <p>
+    Click the <b>Next</b> button below to continue registering
+    or click the <b>Cancel</b> button to abort the registration process.
+  </p>
+</wicket:extend>
\ No newline at end of file

Added: directory/trunks/triplesec/webapp-registration/src/main/resources/org/safehaus/triplesec/registration/view/panels/WizardPanelUser.html
URL: http://svn.apache.org/viewvc/directory/trunks/triplesec/webapp-registration/src/main/resources/org/safehaus/triplesec/registration/view/panels/WizardPanelUser.html?view=auto&rev=486187
==============================================================================
--- directory/trunks/triplesec/webapp-registration/src/main/resources/org/safehaus/triplesec/registration/view/panels/WizardPanelUser.html (added)
+++ directory/trunks/triplesec/webapp-registration/src/main/resources/org/safehaus/triplesec/registration/view/panels/WizardPanelUser.html Tue Dec 12 07:23:31 2006
@@ -0,0 +1,53 @@
+<!-- 
+  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.
+
+-->
+
+<wicket:extend>
+    <br/>
+    
+    <p>
+      Please enter the following critical user information required to
+      create a Triplesec user account.
+    </p>
+    <br/>
+    <br/>
+
+    <label for="username">Username</label>
+    <input wicket:id="username" id="username" type="text"/><br/>
+
+    <label for="firstName">First Name</label>
+    <input wicket:id="firstName" id="firstName" type="text"/><br/>
+
+    <label for="lastName">Last Name</label>
+    <input wicket:id="lastName" id="lastName" type="text"/><br/>
+
+    <br/>
+    <label for="password">Password</label>
+    <input wicket:id="password" id="password" type="password"/><br/>
+
+    <label for="passwordConfirm">Password Confirm</label>
+    <input wicket:id="passwordConfirm" id="passwordConfirm" type="password"/><br/>
+
+
+    <br/>
+    <label for="email">Email</label>
+    <input wicket:id="email" id="email" type="text"/><br/>
+
+    <br/>
+</wicket:extend>

Added: directory/trunks/triplesec/webapp-registration/src/main/webapp/WEB-INF/web.xml
URL: http://svn.apache.org/viewvc/directory/trunks/triplesec/webapp-registration/src/main/webapp/WEB-INF/web.xml?view=auto&rev=486187
==============================================================================
--- directory/trunks/triplesec/webapp-registration/src/main/webapp/WEB-INF/web.xml (added)
+++ directory/trunks/triplesec/webapp-registration/src/main/webapp/WEB-INF/web.xml Tue Dec 12 07:23:31 2006
@@ -0,0 +1,109 @@
+<?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>
+  <display-name>Triplesec Registration</display-name>
+  <servlet>
+    <servlet-name>TriplesecRegistrationApplication</servlet-name>
+    <servlet-class>wicket.protocol.http.WicketServlet</servlet-class>
+    <init-param>
+      <param-name>applicationClassName</param-name>
+      <param-value>org.safehaus.triplesec.registration.view.TriplesecRegistrationApplication</param-value>
+    </init-param>
+    
+    <!-- Init Parameters for LDAP Connectivity -->
+    
+    <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>
+    
+    <!-- Init Parameters for Realm and Server Presentation URL -->
+    
+    <init-param>
+      <param-name>realm</param-name>
+      <param-value>EXAMPLE.COM</param-value>
+    </init-param>
+    
+    <init-param>
+      <param-name>presentationBaseUrl</param-name>
+      <param-value>undefined</param-value>
+    </init-param>
+    
+    <!-- Init Parameters for Mail Server -->
+    
+    <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 created</param-value>
+    </init-param>
+    <init-param>
+      <param-name>smtpFrom</param-name>
+      <param-value>dev@safehaus.org</param-value>
+    </init-param>
+    
+    <!-- Init Parameters for SMS Messaging -->
+    
+    <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>
+    
+    <load-on-startup>1</load-on-startup>
+  </servlet>
+  <servlet-mapping>
+    <servlet-name>TriplesecRegistrationApplication</servlet-name>
+    <url-pattern>/registration/*</url-pattern>
+  </servlet-mapping>
+</web-app>

Added: directory/trunks/triplesec/webapp-registration/src/main/webapp/css/style.css
URL: http://svn.apache.org/viewvc/directory/trunks/triplesec/webapp-registration/src/main/webapp/css/style.css?view=auto&rev=486187
==============================================================================
--- directory/trunks/triplesec/webapp-registration/src/main/webapp/css/style.css (added)
+++ directory/trunks/triplesec/webapp-registration/src/main/webapp/css/style.css Tue Dec 12 07:23:31 2006
@@ -0,0 +1,214 @@
+body {
+    text-align: center; /* for IE */
+	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 {
+	margin: 0 auto;   /* align for good browsers */
+	text-align: left; /* counter the body center */
+
+	/*border: 2px solid #000;*/
+	width: 80%;
+
+	background-color: #FFFFFF;
+	color:#AAAAAA;
+}
+
+#header {
+	width:100%;
+	padding-top:15px;
+}
+
+.top_main_heading {
+	margin-top:15px;
+}
+
+#content {
+	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;
+}
+
+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;
+}
+
+p {
+	margin: 0.3em 0.3em 0.5em 0.3em;
+}
+
+code {
+	font-size: 115%;
+}
+
+.nav {
+	/*border-bottom: 1px solid #999999;
+	border-left: 1px solid #999999;*/
+	float: right;
+	font-family: "Century Gothic", Arial, Helvetica, sans-serif;
+	font-size: 16px;
+	font-weight: bold;
+	margin-left: 10px;
+	padding-bottom: 2px;
+	padding-top: 2px;
+	text-align: right;
+	width: 125px;
+}
+
+.nav a {
+	color:#FFBA27;
+	text-decoration:none;
+	font-size: 12px;
+	font-weight: normal;
+	background-color:#FFFFFF;
+}
+
+.nav a:hover {
+	color:#FFBA27;
+	background-color:#FFFFFF;
+	text-decoration:underline;
+}
+
+#maincontent a {
+	color:#FFBA27;
+	background-color:#FFFFFF;
+	text-decoration:none;
+}
+#maincontent a:hover {
+	color:#FFBA27;
+	background-color:#FFFFFF;
+	text-decoration:underline;
+}
+
+#foot {
+	font-size: 10px;
+	font-family:Verdana, Arial, Helvetica, sans-serif;
+	/*padding-right: 10px;*/
+	text-align: center;
+	color:#AAAAAA;
+	background-color:#FFFFFF;
+}
+
+#foot a {
+	color:#AAAAAA;
+	background-color:#FFFFFF;
+	text-decoration:none;
+}
+
+#foot a:hover {
+	color:#AAAAAA;
+	background-color:#FFFFFF;
+	text-decoration:underline;
+}
+
+label {
+	float: left;
+	width: 140px;
+	font-weight: bold;
+}
+
+input, textarea {
+	width: 180px;
+	margin-bottom: 5px;
+}
+
+textarea {
+	width: 250px;
+	height: 150px;
+}
+
+.boxes {
+	width: 1em;
+}
+
+#cancelbutton {
+	margin-left: 120px;
+	margin-top: 5px;
+	width: 90px;
+}
+
+#backbutton {
+	margin-top: 5px;
+	width: 90px;
+}
+
+#nextbutton {
+	margin-top: 5px;
+	width: 90px;
+}
+
+br {
+	clear: left;
+}
+
+.feedbackPanelERROR {
+	color: red;
+	list-style: circle;
+	font-weight: bold;
+}
+
+.feedbackPanelINFO {
+	color: green;
+	list-style: circle;
+	font-weight: bold;
+}
\ No newline at end of file

Added: directory/trunks/triplesec/webapp-registration/src/main/webapp/images/background.png
URL: http://svn.apache.org/viewvc/directory/trunks/triplesec/webapp-registration/src/main/webapp/images/background.png?view=auto&rev=486187
==============================================================================
Binary file - no diff available.



Mime
View raw message