directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tbenn...@apache.org
Subject svn commit: r486187 [49/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-wicket-admin/src/main/webapp/WEB-INF/web.xml
URL: http://svn.apache.org/viewvc/directory/trunks/triplesec/webapp-wicket-admin/src/main/webapp/WEB-INF/web.xml?view=auto&rev=486187
==============================================================================
--- directory/trunks/triplesec/webapp-wicket-admin/src/main/webapp/WEB-INF/web.xml (added)
+++ directory/trunks/triplesec/webapp-wicket-admin/src/main/webapp/WEB-INF/web.xml Tue Dec 12 07:23:31 2006
@@ -0,0 +1,41 @@
+<?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 Admin</display-name>
+  <servlet>
+    <servlet-name>TriplesecAdminApplication</servlet-name>
+    <servlet-class>wicket.protocol.http.WicketServlet</servlet-class>
+    <init-param>
+      <param-name>applicationClassName</param-name>
+      <param-value>org.safehaus.triplesec.adminui.view.TriplesecAdminApplication</param-value>
+    </init-param>
+    <load-on-startup>1</load-on-startup>
+  </servlet>
+  <servlet-mapping>
+    <servlet-name>TriplesecAdminApplication</servlet-name>
+    <url-pattern>/admin/*</url-pattern>
+  </servlet-mapping>
+</web-app>

Added: directory/trunks/triplesec/webapp-wicket-admin/src/main/webapp/css/style.css
URL: http://svn.apache.org/viewvc/directory/trunks/triplesec/webapp-wicket-admin/src/main/webapp/css/style.css?view=auto&rev=486187
==============================================================================
--- directory/trunks/triplesec/webapp-wicket-admin/src/main/webapp/css/style.css (added)
+++ directory/trunks/triplesec/webapp-wicket-admin/src/main/webapp/css/style.css Tue Dec 12 07:23:31 2006
@@ -0,0 +1,187 @@
+body
+{
+	text-align:center;
+	font-family:arial, times,sans-serif;
+	font-size:12px;
+	color:#666666;
+	background-color:white;
+	width:800px;
+	margin-left:auto;
+	margin-right:auto;
+}
+
+h1
+{
+	margin-top:10px;
+	font-size:28px;
+	color:#FFBA27;
+	font-weight:normal;
+}
+
+
+h2
+{
+	font-size:20px;
+	color:#CCCCCC;
+	font-weight:normal;
+	margin-top:-18px;
+}
+
+h3
+{
+	font-size:14px;
+	color:#FFBA27;
+	font-weight:normal;
+	border: 1px solid #AAAAAA;
+	margin:0;
+	height:16px;
+	padding:5px 5px 5px 5px;
+	background:#F7F7F7;
+}
+
+#top
+{
+	text-align:left;
+    width:800px;
+    border-bottom: 1px solid #CCCCCC;
+}
+
+#container
+{
+    width:800px;
+}
+
+#sideMenu
+{
+	margin-top:15px;
+	border-right:1px solid #CCCCCC;
+	width:160px;
+	position:relative;
+	margin-right:18px;
+	text-align:left;
+	float:left;
+	padding:0;
+}
+
+#announcement
+{
+	margin-top:65px;
+	width:155px;
+	position:relative;
+	/*margin-left:-15px;*/
+	margin-left:0px;
+	margin-right:8px;
+	float:left;
+	padding:0px 0px 0px 0px;
+}
+
+a
+{
+	font-family:arial;
+	color:#FFBA27;
+	font-size:16px;
+	white-space : nowrap;
+	text-decoration:none;
+}
+
+a.inText
+{
+	color:#FFBA27;
+	font-size:12px;
+	white-space : nowrap;
+	text-decoration:none;
+}
+
+#panelcontent
+{
+	padding:9px 9px 9px 9px;
+	margin-top:-1px;
+	border:1px solid #AAAAAA;
+
+	margin-left:0px;
+
+	font-family:normal;
+	font-family:arial, times,sans-serif;
+	font-size:12px;
+
+	word-spacing:2px;
+	color:#AAaAAA;
+	line-height:1.4em;
+}
+
+a:hover
+{
+	text-decoration:underline;
+}
+
+#MainCopy
+{
+	margin:0;
+	/*margin-left:200px;*/
+	margin-top:15px;
+}
+
+#content
+{
+	margin-top:15px;
+	width:590px;
+	text-align:left;
+	margin:0;
+	padding:0px 0px 0px 0px;
+	float: left;
+}
+
+p.assistiveText
+{
+	border:none;
+	padding:0;
+	display:block;
+	margin-top:0px;
+	margin-bottom:1px;
+}
+
+li.menu
+{
+	margin:0px 0px 0px 0px;
+	padding: 0px 0px 0px 0px;
+}
+
+ul.menu
+{
+	color:#AAAAAA;
+	list-style-type:none;
+	margin: 0px 0px 0px 0px;
+	padding: 0px 0px 0px 0px;
+}
+
+#footer
+{
+	margin-top:40px;
+	text-align:right;
+    width:800px;
+	border-top:1px solid #CCCCCC;
+	font-family:arial, times,sans-serif;
+	font-size:12px;
+	clear:both;
+	color:#AAaAAA;
+}
+
+label {
+	float: left;
+	width: 140px;
+	font-weight: bold;
+}
+
+input, textarea {
+	width: 180px;
+	margin-bottom: 5px;
+}
+
+textarea {
+	width: 250px;
+	height: 150px;
+}
+
+.boxes {
+	width: 1em;
+}
\ No newline at end of file

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

Propchange: directory/trunks/triplesec/webapp-wicket-admin/src/main/webapp/images/background.png
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: directory/trunks/triplesec/webapp-wicket-admin/src/main/webapp/index.html
URL: http://svn.apache.org/viewvc/directory/trunks/triplesec/webapp-wicket-admin/src/main/webapp/index.html?view=auto&rev=486187
==============================================================================
--- directory/trunks/triplesec/webapp-wicket-admin/src/main/webapp/index.html (added)
+++ directory/trunks/triplesec/webapp-wicket-admin/src/main/webapp/index.html Tue Dec 12 07:23:31 2006
@@ -0,0 +1,8 @@
+<html>
+  <head>
+    <meta HTTP-EQUIV="REFRESH" content="0; url=admin">
+  </head>
+  <body>
+    <p>If you're not redirected to the <a href="admin">Admin Interface</a></p> then select this link.
+  </body>
+</html>
\ No newline at end of file

Added: directory/trunks/triplesec/webapp-wicket-admin/src/test/java/org/safehaus/triplesec/wicket/admin/RunWicketAdminUI.java
URL: http://svn.apache.org/viewvc/directory/trunks/triplesec/webapp-wicket-admin/src/test/java/org/safehaus/triplesec/wicket/admin/RunWicketAdminUI.java?view=auto&rev=486187
==============================================================================
--- directory/trunks/triplesec/webapp-wicket-admin/src/test/java/org/safehaus/triplesec/wicket/admin/RunWicketAdminUI.java (added)
+++ directory/trunks/triplesec/webapp-wicket-admin/src/test/java/org/safehaus/triplesec/wicket/admin/RunWicketAdminUI.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.wicket.admin;
+
+
+
+import org.safehaus.triplesec.integration.TriplesecIntegration;
+
+
+public class RunWicketAdminUI extends TriplesecIntegration
+{
+    public RunWicketAdminUI() throws Exception
+    {
+        super();
+    }
+
+    
+    public void testRunForever() throws Exception
+    {
+        System.out.println( "Enter any character to end this test: " );
+        System.in.read();
+    }
+}

Added: directory/trunks/triplesec/webapp-wicket-admin/src/test/resources/log4j.properties
URL: http://svn.apache.org/viewvc/directory/trunks/triplesec/webapp-wicket-admin/src/test/resources/log4j.properties?view=auto&rev=486187
==============================================================================
--- directory/trunks/triplesec/webapp-wicket-admin/src/test/resources/log4j.properties (added)
+++ directory/trunks/triplesec/webapp-wicket-admin/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
+
+

Added: directory/trunks/triplesec/webapp-wicket-admin/src/test/resources/server.ldif
URL: http://svn.apache.org/viewvc/directory/trunks/triplesec/webapp-wicket-admin/src/test/resources/server.ldif?view=auto&rev=486187
==============================================================================
--- directory/trunks/triplesec/webapp-wicket-admin/src/test/resources/server.ldif (added)
+++ directory/trunks/triplesec/webapp-wicket-admin/src/test/resources/server.ldif Tue Dec 12 07:23:31 2006
@@ -0,0 +1,545 @@
+#
+#  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. 
+#  
+#
+#
+#   EXAMPLE.COM is freely and reserved for testing according to this RFC:
+#
+#   http://www.rfc-editor.org/rfc/rfc2606.txt
+#
+#
+
+#
+# This ACI allows brouse access to the root suffix and one level below that to anyone.
+# At this level there is nothing critical exposed.  Everything that matters is one or
+# more levels below this.
+#
+
+dn: cn=browseRootAci,dc=example,dc=com
+objectClass: top
+objectClass: subentry
+objectClass: accessControlSubentry
+subtreeSpecification: { maximum 1 }
+prescriptiveACI: { identificationTag "browseRoot", precedence 100, authenticationLevel none, itemOrUserFirst userFirst: { userClasses { allUsers }, userPermissions { { protectedItems {entry}, grantsAndDenials { grantReturnDN, grantBrowse } } } } }
+
+dn: ou=Users, dc=example, dc=com
+objectclass: top
+objectclass: organizationalunit
+ou: Users
+
+#
+# This ACI allows users to modify a limited set of attributes in their own user
+# entry as well as read, compare those attributes.  The user's entry must be 
+# browseable and the DN must be returnable.
+#
+
+dn: cn=allowSelfModificationsAci,dc=example,dc=com
+objectClass: top
+objectClass: subentry
+objectClass: accessControlSubentry
+subtreeSpecification: { base "ou=users", maximum 1 }
+prescriptiveACI: { identificationTag "allowSelfModifications", precedence 14, authenticationLevel simple, itemOrUserFirst userFirst: { userClasses { thisEntry }, userPermissions  {  { protectedItems {entry}, grantsAndDenials { grantReturnDN, grantModify, grantBrowse, grantRead, grantDiscloseOnError } }, { protectedItems {allAttributeValues {userPassword, krb5Key, givenName, cn, commonName, surName, sn, objectClass }}, grantsAndDenials { grantModify, grantAdd, grantRemove, grantRead, grantDiscloseOnError, grantCompare } } } } }
+
+#
+# This ACI allows users to access a limited set of attributes in their own user
+# entry as well as compare those attributes.  The user's entry must be browseable 
+# and the DN must be returnable.
+#
+
+dn: cn=allowSelfAccessAci,dc=example,dc=com
+objectClass: top
+objectClass: subentry
+objectClass: accessControlSubentry
+subtreeSpecification: { base "ou=users", maximum 1 }
+prescriptiveACI: { identificationTag "allowSelfAccess", precedence 15, authenticationLevel simple, itemOrUserFirst userFirst: { userClasses { thisEntry }, userPermissions  {  { protectedItems {entry}, grantsAndDenials { grantReturnDN, grantBrowse, grantRead, grantDiscloseOnError } }, { protectedItems {allAttributeValues {uid, userPassword, givenName, cn, commonName, surName, sn, objectClass, creatorsName, modifiersName, createTimestamp, modifyTimestamp, krb5AccountDisabled, description, apacheSamType }}, grantsAndDenials { grantRead, grantDiscloseOnError, grantCompare } } } } }
+
+dn: ou=Groups, dc=example, dc=com
+objectclass: top
+objectclass: organizationalunit
+ou: Groups
+
+dn: cn=superUsers, ou=Groups, dc=example, dc=com
+objectClass: top
+objectClass: groupOfUniqueNames
+cn: superUsers
+uniqueMember: uid=admin, ou=system
+
+dn: cn=userAdmins, ou=Groups, dc=example, dc=com
+objectClass: top
+objectClass: groupOfUniqueNames
+cn: userAdmin
+uniqueMember: uid=admin, ou=system
+
+dn: cn=applicationAdmins, ou=Groups, dc=example, dc=com
+objectClass: top
+objectClass: groupOfUniqueNames
+cn: applicationAdmin
+uniqueMember: uid=admin, ou=system
+
+dn: cn=groupAdmins, ou=Groups, dc=example, dc=com
+objectClass: top
+objectClass: groupOfUniqueNames
+cn: groupAdmin
+uniqueMember: uid=admin, ou=system
+
+#
+# This ACI allows members of the superUsers group to have full modify and read access
+# to the entire realm as does the system administrator principal: uid=admin, ou=system.
+#
+# The only thing these users cannot do is modify the system partition.  They are only
+# restricted to superUser rights within this realm partition
+#
+ 
+dn: cn=superUsersAci,dc=example,dc=com
+objectClass: top
+objectClass: subentry
+objectClass: accessControlSubentry
+subtreeSpecification: { }
+prescriptiveACI: { identificationTag "superUsersAci", precedence 20, authenticationLevel simple,  itemOrUserFirst userFirst: { userClasses { userGroup { "cn=superUsers,ou=groups,dc=example,dc=com" } }, userPermissions { { protectedItems {entry, allUserAttributeTypesAndValues},  grantsAndDenials { grantRead, grantReturnDN, grantBrowse, grantDiscloseOnError, grantCompare, grantAdd, grantRename, grantRemove, grantModify, grantImport, grantExport } } } } }
+
+#
+# This ACI allows members of the userAdmin group to have full modify and read access
+# to user accounts besides their own.  Hence they can administer users in the system.
+#
+ 
+dn: cn=userAdminsAci,dc=example,dc=com
+objectClass: top
+objectClass: subentry
+objectClass: accessControlSubentry
+subtreeSpecification: { base "ou=users", maximum 1 }
+prescriptiveACI: { identificationTag "userAdminsAci", precedence 16, authenticationLevel simple,  itemOrUserFirst userFirst: { userClasses { userGroup { "cn=userAdmins,ou=groups,dc=example,dc=com" } }, userPermissions { { protectedItems {entry, allUserAttributeTypesAndValues},  grantsAndDenials { grantRead, grantReturnDN, grantBrowse, grantDiscloseOnError, grantCompare, grantAdd, grantRename, grantRemove, grantModify, grantImport, grantExport } } } } }
+
+
+#
+# This ACI allows members of the applicationAdmin group to have full modify and read access
+# to all applications in the realm.  Adding users to this group is like a wild card for 
+# application access.
+#
+ 
+dn: cn=applicationAdminsAci,dc=example,dc=com
+objectClass: top
+objectClass: subentry
+objectClass: accessControlSubentry
+subtreeSpecification: { base "ou=applications" }
+prescriptiveACI: { identificationTag "applicationAdminsAci", precedence 17, authenticationLevel simple,  itemOrUserFirst userFirst: { userClasses { userGroup { "cn=applicationAdmins,ou=groups,dc=example,dc=com" } }, userPermissions { { protectedItems {entry, allUserAttributeTypesAndValues},  grantsAndDenials { grantRead, grantReturnDN, grantBrowse, grantDiscloseOnError, grantCompare, grantAdd, grantRename, grantRemove, grantModify, grantImport, grantExport } } } } }
+
+
+#
+# This ACI allows members of the groupAdmins group to have full modify and read access
+# to all groups in the realm other than the superUsers, userAdmins, groupAdmins, and the 
+# applicationAdmins groups.
+#
+# The rational behind this is to prevent these users from changing their or other
+# users' access rights for the entire system by modifying their membership in these 
+# groups. Making someone a groupAdmin should not open the door to their ability to
+# grant themselves or others system wide administrative abilities.
+#
+# Really the groupAdmins group is intended for users that have the ability to manage 
+# group membership in specific application administration groups and that's all.  
+# These types of admins should not have the right to promote others to system level
+# administrators or complete super users.
+#
+ 
+dn: cn=groupAdminsAci,dc=example,dc=com
+objectClass: top
+objectClass: subentry
+objectClass: accessControlSubentry
+subtreeSpecification: { base "ou=groups", specificExclusions { chopBefore: "cn=userAdmins", chopBefore: "cn=groupAdmins", chopBefore: "cn=applicationAdmins", chopBefore: "cn=superUsers" } }
+prescriptiveACI: { identificationTag "groupAdminsAci", precedence 18, authenticationLevel simple,  itemOrUserFirst userFirst: { userClasses { userGroup { "cn=groupAdmins,ou=groups,dc=example,dc=com" } }, userPermissions { { protectedItems {entry, allUserAttributeTypesAndValues},  grantsAndDenials { grantRead, grantReturnDN, grantBrowse, grantDiscloseOnError, grantCompare, grantAdd, grantRename, grantRemove, grantModify, grantImport, grantExport } } } } }
+
+# ----------------------------------------------------------------------------
+# Required Kerberos Server User
+# ----------------------------------------------------------------------------
+
+dn: uid=krbtgt, ou=Users, dc=example,dc=com
+cn: Kerberos Server
+sn: Server
+givenName: Kerberos
+objectClass: top
+objectClass: uidObject
+objectClass: person
+objectClass: organizationalPerson
+objectClass: inetOrgPerson
+objectClass: krb5Principal
+objectClass: krb5KDCEntry
+ou: Users
+uid: krbtgt
+krb5PrincipalName: krbtgt/EXAMPLE.COM@EXAMPLE.COM
+krb5KeyVersionNumber: 0
+mail: admin@example.com
+userPassword: secret
+
+# ----------------------------------------------------------------------------
+# Sample Hauskeys Users
+# ----------------------------------------------------------------------------
+
+dn: uid=mplanck, ou=Users, dc=example,dc=com
+cn: Max Planck
+sn: Planck
+givenName: Max
+objectClass: top
+objectClass: uidObject
+objectClass: person
+objectClass: organizationalPerson
+objectClass: extensibleObject
+objectClass: inetOrgPerson
+objectClass: krb5Principal
+objectClass: krb5KDCEntry
+objectClass: safehausProfile
+ou: Users
+uid: mplanck
+krb5PrincipalName: mplanck@EXAMPLE.COM
+krb5KeyVersionNumber: 0
+mail: mplanck@example.com
+telephoneNumber: +1 904 982 6882
+facsimileTelephoneNumber: +1 904 982 6883
+roomNumber: 666
+apacheSamType: 7
+safehausUid: mplanck
+safehausRealm: EXAMPLE.COM
+safehausLabel: example realm
+safehausFactor: 27304238
+safehausSecret:: aaaabbbbccccdddd
+safehausFailuresInEpoch: 0
+safehausResynchCount: -1
+safehausTokenPin: 1234
+safehausInfo: test account
+safehausNotifyBy: sms
+userPassword: secret
+
+dn: uid=aeinstein, ou=Users, dc=example,dc=com
+cn: Albert Einstein
+sn: Einstein
+givenName: Albert
+objectClass: top
+objectClass: uidObject
+objectClass: person
+objectClass: organizationalPerson
+objectClass: extensibleObject
+objectClass: inetOrgPerson
+objectClass: krb5Principal
+objectClass: krb5KDCEntry
+objectClass: safehausProfile
+ou: Users
+uid: aeinstein
+krb5PrincipalName: aeinstein@EXAMPLE.COM
+krb5KeyVersionNumber: 0
+mail: aeinstein@example.com
+telephoneNumber: +1 904 982 6882
+facsimileTelephoneNumber: +1 904 982 6883
+roomNumber: 666
+apacheSamType: 7
+safehausUid: aeinstein
+safehausRealm: EXAMPLE.COM
+safehausLabel: example realm
+safehausFactor: 8745127341
+safehausSecret:: eeeeffffgggghhhh
+safehausFailuresInEpoch: 0
+safehausResynchCount: -1
+safehausTokenPin: 1234
+safehausInfo: test account
+safehausNotifyBy: sms
+userPassword: secret
+
+dn: uid=nbohr, ou=Users, dc=example,dc=com
+cn: Neils Bohr
+sn: Bohr
+givenName: Neils
+objectClass: top
+objectClass: uidObject
+objectClass: person
+objectClass: organizationalPerson
+objectClass: extensibleObject
+objectClass: inetOrgPerson
+objectClass: krb5Principal
+objectClass: krb5KDCEntry
+objectClass: safehausProfile
+ou: Users
+uid: nbohr
+krb5PrincipalName: nbohr@EXAMPLE.COM
+krb5KeyVersionNumber: 0
+mail: nbohr@example.com
+telephoneNumber: +1 904 982 6882
+facsimileTelephoneNumber: +1 904 982 6883
+roomNumber: 666
+apacheSamType: 7
+safehausUid: nbohr
+safehausRealm: EXAMPLE.COM
+safehausLabel: example realm
+safehausFactor: 8745127341
+safehausSecret:: iiiijjjjkkkkllll
+safehausFailuresInEpoch: 0
+safehausResynchCount: -1
+safehausTokenPin: 1234
+safehausInfo: test account
+safehausNotifyBy: sms
+userPassword: secret
+
+# ----------------------------------------------------------------------------
+# Sample Local Users (not 2-factor)
+# ----------------------------------------------------------------------------
+
+dn: uid=mborn, ou=Users, dc=example,dc=com
+cn: Max Born
+sn: Born
+givenName: Max
+objectClass: top
+objectClass: uidObject
+objectClass: person
+objectClass: organizationalPerson
+objectClass: inetOrgPerson
+objectClass: krb5Principal
+objectClass: krb5KDCEntry
+objectClass: safehausProfile
+ou: Users
+uid: mborn
+krb5PrincipalName: mborn@EXAMPLE.COM
+krb5KeyVersionNumber: 0
+mail: mborn@example.com
+telephoneNumber: +1 904 982 6882
+facsimileTelephoneNumber: +1 904 982 6883
+roomNumber: 667
+safehausUid: mborn
+safehausRealm: EXAMPLE.COM
+safehausLabel: example realm
+safehausFactor: 917483720127847
+safehausSecret:: xcJqp45S80e8fahs&@rq1I98awg8)^*
+safehausFailuresInEpoch: 0
+safehausTokenPin: 1234
+safehausResynchCount: -1
+safehausInfo: test account
+safehausNotifyBy: sms
+userPassword: secret
+
+dn: uid=wpauli, ou=Users, dc=example,dc=com
+cn: Wolfgang Pauli
+sn: Pauli
+givenName: Wolfgang
+objectClass: top
+objectClass: uidObject
+objectClass: person
+objectClass: organizationalPerson
+objectClass: inetOrgPerson
+objectClass: krb5Principal
+objectClass: krb5KDCEntry
+objectClass: safehausProfile
+ou: Users
+uid: wpauli
+krb5PrincipalName: wpauli@EXAMPLE.COM
+krb5KeyVersionNumber: 0
+mail: wpauli@example.com
+telephoneNumber: +1 904 982 6882
+facsimileTelephoneNumber: +1 904 982 6883
+roomNumber: 667
+safehausUid: wpauli
+safehausRealm: EXAMPLE.COM
+safehausLabel: example realm
+safehausFactor: 917483720127847
+safehausSecret:: xcJqp45S80e8fahs&@rq1I98awg8)^*
+safehausFailuresInEpoch: 0
+safehausTokenPin: 1234
+safehausResynchCount: -1
+safehausInfo: test account
+safehausNotifyBy: sms
+userPassword: secret
+
+dn: uid=mcurie, ou=Users, dc=example,dc=com
+cn: Marie Curie
+sn: Curie
+givenName: Marie
+objectClass: top
+objectClass: uidObject
+objectClass: person
+objectClass: organizationalPerson
+objectClass: inetOrgPerson
+objectClass: krb5Principal
+objectClass: krb5KDCEntry
+objectClass: safehausProfile
+ou: Users
+uid: mcurie
+krb5PrincipalName: mcurie@EXAMPLE.COM
+krb5KeyVersionNumber: 0
+mail: mcurie@example.com
+telephoneNumber: +1 904 982 6882
+facsimileTelephoneNumber: +1 904 982 6883
+roomNumber: 667
+safehausUid: mcurie
+safehausRealm: EXAMPLE.COM
+safehausLabel: example realm
+safehausFactor: 917483720127847
+safehausSecret:: xcJqp45S80e8fahs&@rq1I98awg8)^*
+safehausFailuresInEpoch: 0
+safehausTokenPin: 1234
+safehausResynchCount: -1
+safehausInfo: test account
+safehausNotifyBy: sms
+userPassword: secret
+
+# ----------------------------------------------------------------------------
+# Sample External Users (not 2-factor)
+# ----------------------------------------------------------------------------
+
+dn: uid=pdirac, ou=Users, dc=example,dc=com
+objectClass: top
+objectClass: uidObject
+objectClass: extensibleObject
+objectClass: referral
+uid: pdirac
+ref: ldap://ad.example.com/uid=pdirac, ou=Users, dc=example,dc=com
+
+dn: uid=efermi, ou=Users, dc=example,dc=com
+objectClass: top
+objectClass: uidObject
+objectClass: extensibleObject
+objectClass: referral
+uid: efermi
+ref: ldap://openldap.example.com/uid=efermi, ou=Users, dc=example,dc=com
+
+dn: uid=rfeynman, ou=Users, dc=example,dc=com
+objectClass: top
+objectClass: uidObject
+objectClass: extensibleObject
+objectClass: referral
+uid: rfeynman
+ref: ldap://apacheds.example.com/uid=rfeynman, ou=Users, dc=example,dc=com
+
+# ----------------------------------------------------------------------------
+# Applications
+# ----------------------------------------------------------------------------
+
+dn: ou=Applications,dc=example,dc=com
+objectClass: top
+objectClass: organizationalunit
+ou: applications
+
+dn: appname=demo,ou=Applications,dc=example,dc=com
+objectclass: policyApplication
+objectclass: top
+appname: demo
+description: Demo application.
+userpassword:: c2VjcmV0
+
+dn: ou=permissions,appname=demo,ou=Applications,dc=example,dc=com
+objectclass: organizationalUnit
+objectclass: top
+ou: permissions
+
+dn: permname=bend,ou=permissions,appname=demo,ou=Applications,dc=example,dc=com
+objectclass: policyPermission
+objectclass: top
+permname: bend
+
+dn: permname=fold,ou=permissions,appname=demo,ou=Applications,dc=example,dc=com
+objectclass: policyPermission
+objectclass: top
+permname: fold
+
+dn: permname=mutilate,ou=permissions,appname=demo,ou=Applications,dc=example,dc=com
+objectclass: policyPermission
+objectclass: top
+permname: mutilate
+
+dn: permname=spindle,ou=permissions,appname=demo,ou=Applications,dc=example,dc=com
+objectclass: policyPermission
+objectclass: top
+permname: spindle
+
+dn: permname=twist,ou=permissions,appname=demo,ou=Applications,dc=example,dc=com
+objectclass: policyPermission
+objectclass: top
+permname: twist
+
+dn: ou=roles,appname=demo,ou=Applications,dc=example,dc=com
+objectclass: organizationalUnit
+objectclass: top
+ou: roles
+
+dn: rolename=superuser,ou=roles,appname=demo,ou=Applications,dc=example,dc=com
+objectclass: policyRole
+objectclass: top
+grants: bend
+grants: fold
+grants: mutilate
+grants: spindle
+grants: twist
+rolename: superuser
+
+dn: rolename=untrusted,ou=roles,appname=demo,ou=Applications,dc=example,dc=com
+objectclass: policyRole
+objectclass: top
+grants: bend
+rolename: untrusted
+
+dn: rolename=trusted,ou=roles,appname=demo,ou=Applications,dc=example,dc=com
+objectclass: policyRole
+objectclass: top
+grants: bend
+grants: fold
+grants: mutilate
+rolename: trusted
+
+dn: ou=profiles,appname=demo,ou=Applications,dc=example,dc=com
+objectclass: organizationalUnit
+objectclass: top
+ou: profiles
+
+dn: profileid=nbohr,ou=profiles,appname=demo,ou=Applications,dc=example,dc=com
+objectclass: policyProfile
+objectclass: top
+profileid: nbohr
+roles: trusted
+user: nbohr
+
+dn: profileid=nbohr-superuser,ou=profiles,appname=demo,ou=Applications,dc=example,dc=com
+objectclass: policyProfile
+objectclass: top
+denials: fold
+profileid: nbohr-superuser
+roles: superuser
+user: nbohr
+
+dn: profileid=mborn,ou=profiles,appname=demo,ou=Applications,dc=example,dc=com
+objectclass: policyProfile
+objectclass: top
+grants: twist
+profileid: mborn
+roles: trusted
+user: mborn
+
+dn: profileid=aeinstein,ou=profiles,appname=demo,ou=Applications,dc=example,dc=com
+objectclass: policyProfile
+objectclass: top
+grants: twist
+profileid: aeinstein
+roles: trusted
+user: aeinstein
+
+dn: profileid=mcurie,ou=profiles,appname=demo,ou=Applications,dc=example,dc=com
+objectclass: policyProfile
+objectclass: top
+grants: spindle
+profileid: mcurie
+roles: trusted
+user: mcurie
+
+dn: profileid=wpauli,ou=profiles,appname=demo,ou=Applications,dc=example,dc=com
+objectclass: policyProfile
+objectclass: top
+profileid: wpauli
+roles: untrusted
+user: wpauli

Added: directory/trunks/triplesec/webapp-wicket-admin/src/test/resources/server.xml
URL: http://svn.apache.org/viewvc/directory/trunks/triplesec/webapp-wicket-admin/src/test/resources/server.xml?view=auto&rev=486187
==============================================================================
--- directory/trunks/triplesec/webapp-wicket-admin/src/test/resources/server.xml (added)
+++ directory/trunks/triplesec/webapp-wicket-admin/src/test/resources/server.xml Tue Dec 12 07:23:31 2006
@@ -0,0 +1,250 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN"
+  "http://www.springframework.org/dtd/spring-beans.dtd">
+
+<beans>
+  <bean id="environment" class="org.springframework.beans.factory.config.PropertiesFactoryBean">
+    <property name="properties">
+      <props>
+        <prop key="java.naming.security.authentication">simple</prop>
+        <prop key="java.naming.security.principal">uid=admin,ou=system</prop>
+        <prop key="java.naming.security.credentials">secret</prop>
+        <prop key="java.naming.provider.url">dc=example,dc=com</prop>
+        <prop key="java.naming.factory.state">org.safehaus.triplesec.store.ProfileStateFactory</prop>
+        <prop key="java.naming.factory.object">org.safehaus.triplesec.store.ProfileObjectFactory</prop>
+
+        <prop key="kdc.primary.realm">EXAMPLE.COM</prop>
+        <prop key="kdc.principal">krbtgt/EXAMPLE.COM@EXAMPLE.COM</prop>
+        <prop key="kdc.encryption.types">des-cbc-md5 des3-cbc-sha1 des3-cbc-md5 des-cbc-md4 des-cbc-crc</prop>
+        <prop key="kdc.entryBaseDn">ou=users,dc=example,dc=com</prop>
+        <prop key="kdc.java.naming.security.credentials">secret</prop>
+
+        <prop key="changepw.entryBaseDn">ou=users,dc=example,dc=com</prop>
+        <prop key="changepw.java.naming.security.credentials">secret</prop>
+        <prop key="changepw.principal">kadmin/changepw@EXAMPLE.COM</prop>
+
+        <!-- All times are in minutes -->
+        <prop key="kdc.allowable.clockskew">5</prop>
+        <prop key="kdc.tgs.maximum.ticket.lifetime">1440</prop>
+        <prop key="kdc.tgs.maximum.renewable.lifetime">10080</prop>
+        <prop key="kdc.pa.enc.timestamp.required">true</prop>
+        <prop key="kdc.tgs.empty.addresses.allowed">true</prop>
+        <prop key="kdc.tgs.forwardable.allowed">true</prop>
+        <prop key="kdc.tgs.proxiable.allowed">true</prop>
+        <prop key="kdc.tgs.postdate.allowed">true</prop>
+        <prop key="kdc.tgs.renewable.allowed">true</prop>
+
+        <prop key="safehaus.entry.basedn">ou=Users,dc=example,dc=com</prop>
+        <prop key="safehaus.load.testdata">true</prop>
+        <prop key="kerberos.sam.type.7">org.safehaus.triplesec.verifier.hotp.DefaultHotpSamVerifier</prop>
+      </props>
+    </property>
+  </bean>
+
+  <bean id="configuration" class="org.safehaus.triplesec.configuration.MutableTriplesecStartupConfiguration">
+    <property name="workingDirectory"><value>partitions</value></property>
+    <property name="allowAnonymousAccess"><value>false</value></property>
+    <property name="accessControlEnabled"><value>true</value></property>
+    <property name="ldapPort"><value>10389</value></property>
+    <property name="enableKerberos"><value>true</value></property>
+    <property name="enableNtp"><value>false</value></property>
+    <property name="enableChangePassword"><value>true</value></property>
+
+    <!-- Uncomment below to have the server load entries on startup!        -->
+    <!-- ldifDirectory property can point to a relative file, directory or  -->
+    <!-- can point to an absolute path to either using the URL path         -->
+    <!-- notation: i.e. file:///Users/jack/apacheds/ldifs                   -->
+
+    <!-- Entries will optionally be filtered using LdifLoadFilters in the   -->
+    <!-- order specified.  The included Krb5KdcEntryFilter will filter      -->
+    <!-- kerberos principals creating keys for them using their             -->
+    <!-- userPassword attribute if present.                                 -->
+
+    <!-- If missing the Triplesec server will use LDIF files under the conf -->
+    <!-- directory where it has been installed.                             -->
+
+    <!--
+    <property name="ldifDirectory">
+      <value>example.ldif</value>
+    </property>
+    -->
+    <property name="ldifFilters">
+      <list>
+        <bean class="org.apache.directory.server.protocol.shared.store.Krb5KdcEntryFilter"/>
+      </list>
+    </property>
+
+    <property name="activationConfiguration">
+      <bean class="org.safehaus.triplesec.configuration.ActivationConfiguration">
+        <property name="enableDecoyMidlet"><value>true</value></property>
+        <property name="otpLength"><value>6</value></property>
+        <property name="midletNameAttribute"><value>midletNameAttribute</value></property>
+      </bean>  
+    </property>    
+    
+    <property name="smsConfiguration">
+      <bean class="org.safehaus.triplesec.configuration.SmsConfiguration">
+        <property name="smsUsername"><value>hauskeys</value></property>
+        <property name="smsPassword"><value>secret</value></property>
+        <property name="smsAccountName"><value>demo</value></property>
+        <property name="smsTransportUrl"><value>http://www.nbroadcasting.com/customers/messages/Sender.asp</value></property>
+      </bean>  
+    </property>    
+    
+    <property name="smtpConfiguration">
+      <bean class="org.safehaus.triplesec.configuration.SmtpConfiguration">
+        <property name="smtpAuthenticate"><value>false</value></property>
+        <!-- uncomment and set above property if authentication is required by mail server
+             <property name="smtpUsername"><value>hauskeys</value></property>
+             <property name="smtpPassword"><value>secret</value></property>
+             -->
+             <property name="smtpHost"><value>localhost</value></property>
+             <property name="smtpSubject"><value>Triplesec Account Activated</value></property>
+             <property name="smtpFrom"><value>dev@safehaus.org</value></property>
+           </bean>  
+         </property>    
+         
+    <property name="contextPartitionConfigurations">
+      <set>
+        <ref bean="examplePartitionConfiguration"/>
+      </set>
+    </property>
+    <property name="bootstrapSchemas">
+      <set>
+        <bean class="org.apache.directory.server.core.schema.bootstrap.CorbaSchema"/>
+        <bean class="org.apache.directory.server.core.schema.bootstrap.CoreSchema"/>
+        <bean class="org.apache.directory.server.core.schema.bootstrap.CosineSchema"/>
+        <bean class="org.apache.directory.server.core.schema.bootstrap.ApacheSchema"/>
+        <bean class="org.apache.directory.server.core.schema.bootstrap.CollectiveSchema"/>
+        <bean class="org.apache.directory.server.core.schema.bootstrap.InetorgpersonSchema"/>
+        <bean class="org.apache.directory.server.core.schema.bootstrap.JavaSchema"/>
+        <bean class="org.apache.directory.server.core.schema.bootstrap.Krb5kdcSchema"/>
+        <bean class="org.apache.directory.server.core.schema.bootstrap.SystemSchema"/>
+        <bean class="org.safehaus.triplesec.store.schema.SafehausSchema"/>
+      </set>
+    </property>
+    
+    <property name="extendedOperationHandlers">
+      <list>
+        <bean class="org.apache.directory.server.ldap.support.extended.GracefulShutdownHandler"/>
+        <bean class="org.apache.directory.server.ldap.support.extended.LaunchDiagnosticUiHandler"/>
+      </list>
+    </property>  
+
+    <property name="interceptorConfigurations">
+      <list>
+        <bean class="org.apache.directory.server.core.configuration.MutableInterceptorConfiguration">
+          <property name="name"><value>normalizationService</value></property>
+          <property name="interceptor">
+            <bean class="org.apache.directory.server.core.normalization.NormalizationService" />
+          </property>
+        </bean>
+        <bean class="org.apache.directory.server.core.configuration.MutableInterceptorConfiguration">
+          <property name="name"><value>authenticationService</value></property>
+          <property name="interceptor">
+            <bean class="org.apache.directory.server.core.authn.AuthenticationService" />
+          </property>
+        </bean>
+        <bean class="org.apache.directory.server.core.configuration.MutableInterceptorConfiguration">
+          <property name="name"><value>referralService</value></property>
+          <property name="interceptor">
+            <bean class="org.apache.directory.server.core.referral.ReferralService" />
+          </property>
+        </bean>
+        <bean class="org.apache.directory.server.core.configuration.MutableInterceptorConfiguration">
+          <property name="name"><value>authorizationService</value></property>
+          <property name="interceptor">
+            <bean class="org.apache.directory.server.core.authz.AuthorizationService" />
+          </property>
+        </bean>
+        <bean class="org.apache.directory.server.core.configuration.MutableInterceptorConfiguration">
+          <property name="name"><value>defaultAuthorizationService</value></property>
+          <property name="interceptor">
+            <bean class="org.apache.directory.server.core.authz.DefaultAuthorizationService" />
+          </property>
+        </bean>
+        <bean class="org.apache.directory.server.core.configuration.MutableInterceptorConfiguration">
+          <property name="name"><value>exceptionService</value></property>
+          <property name="interceptor">
+            <bean class="org.apache.directory.server.core.exception.ExceptionService" />
+          </property>
+        </bean>
+        <bean class="org.apache.directory.server.core.configuration.MutableInterceptorConfiguration">
+          <property name="name"><value>schemaService</value></property>
+          <property name="interceptor">
+            <bean class="org.apache.directory.server.core.schema.SchemaService" />
+          </property>
+        </bean>
+        <bean class="org.apache.directory.server.core.configuration.MutableInterceptorConfiguration">
+          <property name="name"><value>subentryService</value></property>
+          <property name="interceptor">
+            <bean class="org.apache.directory.server.core.subtree.SubentryService" />
+          </property>
+        </bean>
+        <bean class="org.apache.directory.server.core.configuration.MutableInterceptorConfiguration">
+          <property name="name"><value>operationalAttributeService</value></property>
+          <property name="interceptor">
+            <bean class="org.apache.directory.server.core.operational.OperationalAttributeService" />
+          </property>
+        </bean>
+        <bean class="org.apache.directory.server.core.configuration.MutableInterceptorConfiguration">
+          <property name="name"><value>collectiveAttributeService</value></property>
+          <property name="interceptor">
+            <bean class="org.apache.directory.server.core.collective.CollectiveAttributeService" />
+          </property>
+        </bean>
+        <bean class="org.apache.directory.server.core.configuration.MutableInterceptorConfiguration">
+          <property name="name"><value>eventService</value></property>
+          <property name="interceptor">
+            <bean class="org.apache.directory.server.core.event.EventService" />
+          </property>
+        </bean>
+        <bean class="org.apache.directory.server.core.configuration.MutableInterceptorConfiguration">
+          <property name="name"><value>policyProtectionService</value></property>
+          <property name="interceptor">
+            <bean class="org.safehaus.triplesec.store.interceptor.PolicyProtectionInterceptor" />
+          </property>
+        </bean>
+      </list>
+    </property>
+  </bean>
+  
+  <bean id="examplePartitionConfiguration" class="org.apache.directory.server.core.configuration.MutablePartitionConfiguration">
+    <property name="name"><value>example</value></property>
+    <property name="suffix"><value>dc=example,dc=com</value></property>
+    <property name="indexedAttributes">
+      <set>
+        <value>objectClass</value>
+        <value>ou</value>
+        <value>dc</value>
+        <value>uid</value>
+        <value>profileId</value>
+        <value>roles</value>
+        <value>grants</value>
+        <value>denials</value>
+        <value>krb5PrincipalName</value>
+      </set>
+    </property>
+    <property name="contextEntry">
+      <value>
+        objectClass: top
+        objectClass: domain
+        objectClass: extensibleObject
+        dc: example
+        administrativeRole: accessControlSpecificArea
+        administrativeRole: collectiveAttributeSpecificArea
+      </value>
+    </property>
+  </bean>
+
+  <bean class="org.springframework.beans.factory.config.CustomEditorConfigurer">
+    <property name="customEditors">
+      <map>
+        <entry key="javax.naming.directory.Attributes">
+          <bean class="org.apache.directory.server.core.configuration.AttributesPropertyEditor"/>
+        </entry>
+      </map>
+   </property>
+  </bean>
+</beans>

Added: directory/trunks/triplesec/wicket-tools/pom.xml
URL: http://svn.apache.org/viewvc/directory/trunks/triplesec/wicket-tools/pom.xml?view=auto&rev=486187
==============================================================================
--- directory/trunks/triplesec/wicket-tools/pom.xml (added)
+++ directory/trunks/triplesec/wicket-tools/pom.xml Tue Dec 12 07:23:31 2006
@@ -0,0 +1,37 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+  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. 
+-->
+<project>
+  <modelVersion>4.0.0</modelVersion>
+  <parent>
+    <groupId>org.safehaus.triplesec</groupId>
+    <artifactId>build</artifactId>
+    <version>1.0-SNAPSHOT</version>
+  </parent>
+  <artifactId>triplesec-wicket-tools</artifactId>
+  <name>Triplesec Wicket Tools</name>
+  <packaging>jar</packaging>  
+  <dependencies>
+    <dependency>
+      <groupId>wicket</groupId>
+      <artifactId>wicket</artifactId>
+      <version>1.2-beta2</version>
+    </dependency>
+  </dependencies>
+</project>

Added: directory/trunks/triplesec/wicket-tools/src/main/java/wicket/examples/wizard/ezwizard/impl/Wizard.java
URL: http://svn.apache.org/viewvc/directory/trunks/triplesec/wicket-tools/src/main/java/wicket/examples/wizard/ezwizard/impl/Wizard.java?view=auto&rev=486187
==============================================================================
--- directory/trunks/triplesec/wicket-tools/src/main/java/wicket/examples/wizard/ezwizard/impl/Wizard.java (added)
+++ directory/trunks/triplesec/wicket-tools/src/main/java/wicket/examples/wizard/ezwizard/impl/Wizard.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 wicket.examples.wizard.ezwizard.impl;
+
+import wicket.examples.wizard.ezwizard.intf.IWizard;
+import wicket.examples.wizard.ezwizard.intf.IWizardStep;
+import wicket.examples.wizard.ezwizard.intf.IWizardTransition;
+import wicket.examples.wizard.ezwizard.intf.IWizardListener;
+
+import java.util.Map;
+import java.util.HashMap;
+import java.util.Iterator;
+
+/**
+ * This class containts base implementation of wizard controller and handles
+ * wizard traversal. The wizard controller contains references to wizard states
+ * and transitions, and allows to move from one state to another.
+ * <br><br>
+ * The UI specifics like reporting of error messages should be handled by
+ * descendant classes.
+ *
+ * @version 0.5
+ * @author Michael Jouravlev
+ */
+public class Wizard implements IWizard {
+
+    /**************************************************************************
+     * Error messages
+     **************************************************************************/
+
+    /**
+     * Error list. Key is either string message or ID of a message in
+     * a property file. Value is a string array of values, or null if there
+     * are no arguments.
+     * <p>
+     * Errors are initialized in backing bean when a wizard object is created.
+     * Reference to existing error object must be passed
+     * to this wizard controller from backing bean.
+     */
+    protected Map errors = new HashMap();
+
+    /**
+     * Standard implementation returns a dummy map for error messages in
+     * case the concrete implementation generates messages externally and
+     * does not provide message placeholder.
+     * <p>
+     * Concrete implementation must provide a valid reference to message map,
+     * if it wants to return messages from Rule Engine.
+     *
+     * @return message placeholder map
+     */
+    public Map getWizardErrors() {return errors;}
+
+    /**
+     * Returns true if wizard has been successfully completed. Wizard
+     * is usually completes on its last step, after business accounts is updated.
+     * Completed status is retained by the wizard until wizard instance
+     * is disposed.
+     *
+     * @return true if wizard has been successfully completed and is ready
+     *         to be disposed.
+     */
+    public boolean isCompleted() {return currentState == null;}
+
+    /**************************************************************************
+     * IWizard implementation
+     **************************************************************************/
+
+    /**
+     * The intial state of this wizard. A wizard has only one initial state.
+     */
+    protected IWizardStep sourceState;
+
+    /**
+     * Returns source state of this wizard. A wizard has only one initial state.
+     * @return source state of this wizard
+     */
+    public IWizardStep getSourceStep() {return sourceState;}
+
+    /**
+     * Current state of this wizard.
+     */
+    protected IWizardStep currentState;
+    /**
+     * Returns current state of this wizard; on wizard startup is the same as
+     * source state.
+     * @return current state of this wizard
+     */
+    public IWizardStep getCurrentStep() {return currentState;}
+
+    /**
+     * Locates a state in this wizard by its name
+     *
+     * @param name  state name
+     * @return the first state starting from source,
+     *         which name is equal to the needed name, or null
+     *         if the state not found.
+     */
+    public IWizardStep getStepByName(String name) {
+        IWizardStep sourceNode = getSourceStep();
+        if (sourceNode == null) return null;
+        if (sourceNode.getStateName().equals(name)) return sourceNode;
+        return findNode(sourceNode, name);
+    }
+
+    /**
+     * Tries to move to the next state. If cannot move, keeps current state.
+     */
+    public boolean forward() {
+
+        if (isCompleted()) {
+            return false;
+        }
+
+        clearWizardErrors();
+
+        /*
+         * Find outgoing transition, returns null if current state
+         * is the last state
+         */
+        IWizardTransition outgoingTransition = currentState.getOutgoingTransition();
+
+        /*
+         * Process final node, it may set "completed" status
+         */
+        if (isLastStep()) {
+            boolean canLeave = canLeave(IWizardListener.STEP_LAST);
+            if (canLeave) {
+                currentState = null;
+            }
+            return canLeave;
+
+        /*
+         * Not last step and about to move forward
+         */
+        } else if (outgoingTransition != null) {
+
+            /*
+             * Find next state
+             */
+            IWizardStep nextState = outgoingTransition.getTarget();
+            if (nextState == null) return false;
+
+            /*
+             * Cannot move forward
+             */
+            if (!canLeave(IWizardListener.STEP_REGULAR)) {
+                return false;
+            }
+
+            /*
+             * Moving forward: set incoming transition for next state
+             * unless next state is not a checkpoint
+             */
+            nextState.setIncomingTransition(currentState.isCheckpoint() ?
+                                            null :
+                                            outgoingTransition);
+
+            /*
+             * Move to the next node
+             */
+            currentState = nextState;
+            return true;
+
+        /*
+         *  Wizard stayed on the same step
+         */
+        } else {
+            return false;
+        }
+    }
+
+    /**
+     * Tries to move to the previous state. Stays on the current state
+     * if traversal back is impossible either because this state is
+     * the initial wizard state or was marked as checkpoint.
+     */
+    public boolean back() {
+
+        if (isCompleted()) {
+            return false;
+        }
+
+        /*
+         * Find the incoming transition for the current state
+         */
+        IWizardTransition incomingTransition = currentState.getIncomingTransition();
+
+        /*
+         * Traverse back if incoming transition exists
+         */
+        if (incomingTransition != null) {
+            currentState = incomingTransition.getSource();
+            clearWizardErrors();
+            return true;
+        }
+        return false;
+    }
+
+    /**
+     * Verifies is current wizard step a last step.
+     * @return true if current wizard step a last step
+     */
+    protected boolean isLastStep() {
+        IWizardTransition[] transitions = currentState.getOutgoingTransitions();
+        return transitions == null || transitions.length == 0;
+    }
+
+    /**
+     * Executed after the forward transition is chosen, but before the state
+     * is changed. Verifies with listening application, is it allowed to
+     * perform a state change
+     * @param event  event that is occurring now, like moving to next step
+     * @return true if all listeners allow to move to the next step
+     */
+    protected boolean canLeave(int event) {
+        boolean canLeave = true;
+        Iterator lisIte = getListeners().values().iterator();
+        while(lisIte.hasNext()) {
+            IWizardListener wizardListener = (IWizardListener) lisIte.next();
+            canLeave &= wizardListener.onTransition(event);
+        }
+        return canLeave;
+    }
+
+    /**
+     * Returns a name which is used to display proper wizard panel.
+     * @return mapping name for a wizard view, usually path to JSP page
+     */
+    public String getCurrentStepName() {
+        IWizardStep currentStep = getCurrentStep();
+        return currentStep == null ? null : getCurrentStep().getStateName();
+    }
+
+    /**
+     * Listeners, checking for state transition
+     */
+    protected Map listeners = new HashMap();
+
+    /**
+     * Adds a listener for state change event.
+     */
+    public void addListener(IWizardListener listener) {
+        synchronized(listeners) {
+            listeners.put(listener.getClass().getName(), listener);
+        }
+    }
+
+    /**
+     * Removes a listener for state change event.
+     */
+    public void removeListener(IWizardListener listener) {
+        synchronized(listeners) {
+            Iterator lisIte = listeners.values().iterator();
+            while(lisIte.hasNext()) {
+                IWizardListener wizardListener = (IWizardListener) lisIte.next();
+                if (wizardListener == listener) {
+                    lisIte.remove();
+                }
+            }
+        }
+    }
+
+    /**
+     * Removes all wizard listeners for state change event.
+     */
+    public void removeAllListeners() {
+        synchronized(listeners) {
+            listeners.clear();
+        }
+    }
+
+    /**
+     * Returns all current listeners for wizard event
+     */
+    public Map getListeners() {
+        return listeners;
+    }
+
+    /**************************************************************************
+     * Helper methods
+     **************************************************************************/
+
+    /**
+     * Finds a state by its name. Need to pass staring state as an argument
+     * because of the recursive calls. Starting state parameter allows
+     * to search from any state.
+     * <p>
+     * Important: starting state itself is not checked
+     *
+     * @param state  the state where to start search, this state itself is not
+     *        verified and must be checked outside this method
+     * @param name  the name of the state to look for
+     * @return the state with the needed name, or null if state not found
+     */
+    public static IWizardStep findNode(IWizardStep state, String name) {
+        if (state == null || name == null) return null;
+        IWizardTransition[] transitions = state.getOutgoingTransitions();
+        if (transitions != null) {
+            for (int i = 0; i < transitions.length; i++) {
+                IWizardStep probedState = transitions[i].getTarget();
+                IWizardStep resultState =
+                    name.equals(probedState.getStateName()) ?
+                    probedState :
+                    findNode(probedState, name);
+                if (resultState != null) return resultState;
+            }
+        }
+        return null;
+    }
+
+    /**************************************************************************
+     * Implementing IWizardManager
+     **************************************************************************/
+
+    /**
+     * Clear wizard errors. Does nothing here (need to implement).
+     * Backing bean will clear errors when needed.
+     */
+    public void clearWizardErrors() {
+        Map errors = getWizardErrors();
+        if (errors != null && errors.size() > 0) {
+            errors.clear();
+        }
+    }
+
+    public void wizardReset() {
+//        clearWizardErrors();
+        getCurrentStep().resetBooleans();
+    }
+
+}

Added: directory/trunks/triplesec/wicket-tools/src/main/java/wicket/examples/wizard/ezwizard/impl/WizardStep.java
URL: http://svn.apache.org/viewvc/directory/trunks/triplesec/wicket-tools/src/main/java/wicket/examples/wizard/ezwizard/impl/WizardStep.java?view=auto&rev=486187
==============================================================================
--- directory/trunks/triplesec/wicket-tools/src/main/java/wicket/examples/wizard/ezwizard/impl/WizardStep.java (added)
+++ directory/trunks/triplesec/wicket-tools/src/main/java/wicket/examples/wizard/ezwizard/impl/WizardStep.java Tue Dec 12 07:23:31 2006
@@ -0,0 +1,253 @@
+/*
+ *  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 wicket.examples.wizard.ezwizard.impl;
+
+
+import wicket.examples.wizard.ezwizard.intf.*;
+
+import java.util.ArrayList;
+
+
+/**
+ * Represents a state of a wizard Finite State Machine (FSM). Contains common
+ * navigation methods. Derived concrete state should also contain
+ * setters/getters for domain data, relevant to this state.
+ * 
+ * @version 0.5
+ * @author Michael Jouravlev
+ */
+public abstract class WizardStep implements IWizardStep
+{
+
+    /***************************************************************************
+     * IWizardStep implementation
+     **************************************************************************/
+
+    /**
+     * Checkpoint flag. If set, then wizard cannot return back from this state.
+     */
+    private boolean checkpoint;
+
+
+    /**
+     * Returns true if this state is marked as checkpoint
+     * 
+     * @return true if this state is marked as checkpoint
+     */
+    public boolean isCheckpoint()
+    {
+        return checkpoint;
+    }
+
+
+    /**
+     * Sets this state as checkpoint. This should be done before wizard is
+     * traversed back from this state.
+     * 
+     * @param checkpoint
+     *            true if this state should be marked as checkpoint
+     */
+    public void setCheckpoint( boolean checkpoint )
+    {
+        this.checkpoint = checkpoint;
+    }
+
+    /**
+     * The name of this state
+     */
+    protected String stateName;
+
+
+    /**
+     * Returns the state name
+     * 
+     * @return state name
+     */
+    public String getStateName()
+    {
+        return stateName;
+    }
+
+    /**
+     * Master wizard object; this reference can be used to access common data
+     * defined in the wizard object itself.
+     */
+    protected IWizard wizard;
+
+
+    /**
+     * Returns master wizard object
+     * 
+     * @return master wizard object
+     */
+    public IWizard getWizard()
+    {
+        return wizard;
+    }
+
+    /**
+     * Incoming transition.
+     */
+    protected IWizardTransition incomingTransition;
+
+
+    /**
+     * Returns incoming transition for this state, used during actual wizard
+     * traversal
+     * 
+     * @return incoming transition for this node
+     */
+    public IWizardTransition getIncomingTransition()
+    {
+        return incomingTransition;
+    }
+
+
+    /**
+     * Sets incoming transition, used by wizard controller. Defined as public
+     * because it belongs to the IWizardStep interface.
+     * 
+     * @param value
+     *            incoming transition
+     */
+    public void setIncomingTransition( IWizardTransition value )
+    {
+        incomingTransition = value;
+    }
+
+    /**
+     * In this version outgoing trasitions are implemented as array list for
+     * easy adding of new transitions.
+     */
+    private ArrayList outgoingTransitions = new ArrayList();
+
+
+    /**
+     * Returns array of outgoing transitions in the same order in which they
+     * were added by addOutgoingTransition() method.
+     * 
+     * @return array of outbound transitions, the transition with the most
+     *         weight is returned first.
+     */
+    public IWizardTransition[] getOutgoingTransitions()
+    {
+        return ( IWizardTransition[] ) outgoingTransitions.toArray( new IWizardTransition[0] );
+    }
+
+
+    /**
+     * Adds an outgoing transition. Transitions must be added in the order of
+     * their weight, the edge with highest weight must be added first. <br>
+     * <br>
+     * Future versions may support dynamic adjustment of weight, this version
+     * does not support it.
+     * 
+     * @param value
+     *            outgoing transition
+     */
+    public void addOutgoingTransition( IWizardTransition value )
+    {
+        /*
+         * Add a transition as outgoing, and set this state as the source state
+         * for the transition. Transition objects are not shared between states.
+         */
+        outgoingTransitions.add( value );
+        value.setSource( this );
+    }
+
+
+    /**
+     * Returns a transition which will be chosen if a "next" command is selected
+     * for this node. <br>
+     * <br>
+     * 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;
+    }
+
+
+    /**
+     * Verifies that this state is included in the path to the current state
+     * (the current state is past this state).
+     * 
+     * @return true if this state is found in the actual path from the initial
+     *         state to the current state; false otherwise.
+     */
+    public boolean isStateInPath()
+    {
+        return ( this == wizard.getCurrentStep() || checkTraverseBack( wizard.getCurrentStep(), this ) );
+    }
+
+
+    /***************************************************************************
+     * Helpers and constructor
+     **************************************************************************/
+
+    /**
+     * 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 travseral path
+     * @return true if searchNode is found in the actual path while traversing
+     *         back from startNode; false otherwise.
+     */
+    public static boolean checkTraverseBack( IWizardStep startState, IWizardStep searchState )
+    {
+        IWizardTransition incomingEdge = startState.getIncomingTransition();
+        if ( incomingEdge == null )
+            return false;
+        IWizardStep srcState = incomingEdge.getSource();
+        return srcState == searchState ? true : checkTraverseBack( srcState, searchState );
+    }
+
+
+    /**
+     * Constructs the state, sets a name and stores a reference to the owner
+     * wizard object.
+     * 
+     * @param owner
+     *            owner wizard object, cannot be null
+     * @param name
+     *            name of this state, cannot be null, must be unique within the
+     *            wizard
+     */
+    public WizardStep( IWizard owner, String name )
+    {
+        this.wizard = owner;
+        this.stateName = name;
+    }
+}

Added: directory/trunks/triplesec/wicket-tools/src/main/java/wicket/examples/wizard/ezwizard/impl/WizardTransition.java
URL: http://svn.apache.org/viewvc/directory/trunks/triplesec/wicket-tools/src/main/java/wicket/examples/wizard/ezwizard/impl/WizardTransition.java?view=auto&rev=486187
==============================================================================
--- directory/trunks/triplesec/wicket-tools/src/main/java/wicket/examples/wizard/ezwizard/impl/WizardTransition.java (added)
+++ directory/trunks/triplesec/wicket-tools/src/main/java/wicket/examples/wizard/ezwizard/impl/WizardTransition.java Tue Dec 12 07:23:31 2006
@@ -0,0 +1,101 @@
+/*
+ *  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 wicket.examples.wizard.ezwizard.impl;
+
+import wicket.examples.wizard.ezwizard.intf.IWizard;
+import wicket.examples.wizard.ezwizard.intf.IWizardStep;
+import wicket.examples.wizard.ezwizard.intf.IWizardTransition;
+
+/**
+ * Represents a state transition. In Easy Wizard a transition is an object, it
+ * can refer to its source and target states, and can validate itself. When
+ * wizard controller moves from one state to another, it iterates through
+ * transitions of current state, and validates each of them in order of their
+ * weight. The first valid transition is used to change the state.
+ *
+ * @version 0.5
+ * @author Michael Jouravlev
+ */
+public abstract class WizardTransition implements IWizardTransition {
+
+    /**
+     * Owner wizard object, reference used to access common business fields
+     */
+    protected IWizard wizard;
+    /**
+     * Returns owner wizard object
+     * @return owner wizard object
+     */
+    public IWizard getWizard() {return wizard;}
+
+    /**
+     * Human-readable name of this transition, or null if not set.
+     * Contrary to the state name, the transition name is optional.
+     */
+    protected String name;
+
+    /**
+     * Returns transition name
+     * @return transition name
+     */
+    public String getName() {return name;}
+
+    /**
+     * Source node of this edge, never null.
+     */
+    protected IWizardStep source;
+
+    /**
+     * Returns source state for this transition
+     * @return source state for this transition
+     */
+    public IWizardStep getSource() {return source;}
+
+    /**
+     * Sets source state for this transition; used by wizard controller
+     * @param value source state for this transition
+     */
+    public void setSource(IWizardStep value) {source = value;}
+
+    /**
+     * Target state for this transition, never null.
+     */
+    protected IWizardStep target;
+    /**
+     * Returns target state of this transition
+     * @return target state of this transition
+     */
+    public IWizardStep getTarget() {return target;}
+
+    /**
+     * Constructs an transition. Source state will be set automatically after
+     * this transition is added as outgoing to a state.
+     *
+     * @param owner  owner wizard object
+     * @param name  transition name
+     * @param target  transition target
+     */
+    public WizardTransition(IWizard owner, String name, IWizardStep target) {
+        this.wizard = owner;
+        this.name = name;
+        this.target = target;
+    }
+}

Added: directory/trunks/triplesec/wicket-tools/src/main/java/wicket/examples/wizard/ezwizard/intf/IWizard.java
URL: http://svn.apache.org/viewvc/directory/trunks/triplesec/wicket-tools/src/main/java/wicket/examples/wizard/ezwizard/intf/IWizard.java?view=auto&rev=486187
==============================================================================
--- directory/trunks/triplesec/wicket-tools/src/main/java/wicket/examples/wizard/ezwizard/intf/IWizard.java (added)
+++ directory/trunks/triplesec/wicket-tools/src/main/java/wicket/examples/wizard/ezwizard/intf/IWizard.java Tue Dec 12 07:23:31 2006
@@ -0,0 +1,132 @@
+/*
+ *  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 wicket.examples.wizard.ezwizard.intf;
+
+import java.util.Map;
+
+/**
+ * This interface defines an Easy Wizard controller. The wizard controller
+ * contains references to wizard steps and transitions, and allows to
+ * move from one step to another.
+ *
+ * @version 0.5
+ * @author Michael Jouravlev
+ */
+public interface IWizard {
+
+    /**************************************************************************
+     * Where are we and where did we come from
+     **************************************************************************/
+
+    /**
+     * Locates the initial step of this wizard.
+     * @return the initial step of this wizard
+     */
+    public IWizardStep getSourceStep();
+
+    /**
+     * Locates the current step of this wizard.
+     * @return the current step of this wizard
+     */
+    public IWizardStep getCurrentStep();
+
+    /**
+     * Locates a step by its name. Step name is used by clients
+     * of wizard controller, for example by Dialog Manager to refer
+     * to a corresponding view.
+     * @param name  step name
+     * @return the first step found traversing forward from the initial step,
+     *         having passed name; or null if the step not found.
+     */
+    public IWizardStep getStepByName(String name);
+
+    /**
+     * Returns a mapping name for a wizard panel. Usually wizard step name
+     * is used as mapping name.
+     * @return mapping name for a wizard view, usually path to JSP page
+     */
+    String getCurrentStepName();
+
+    /**
+     * Returns errors for current wizard state.
+     * @return error messages for current wizard state
+     */
+    Map getWizardErrors();
+
+    /**
+     * Attempts to move to the next step. If it is not possible, stays on the
+     * current step.
+     * <p>
+     * Easy Wizard does not blindly choose a transition based on input command
+     * or event. Instead, it iterates over all transitions defined for current
+     * step, validates them, and chooses th one which is valid. If several
+     * transitions happen to be valid, the first one is chosen.
+     * @return true if was able to move to a next step, false otherwise
+     * @see IWizardStep#addOutgoingTransition(IWizardTransition)
+     */
+    public boolean forward();
+
+    /**
+     * Attempts to move to the previous step. If the previous step does not
+     * exist or the current step is the initial step of the wizard, stays
+     * on the current step. Transition is not validated while traversing back.
+     * @return true if was able to move to a previous step, false otherwise
+     */
+    public boolean back();
+
+    /**
+     * Returns wizard completion status. This method is redundant,
+     * but is defined to hide Wizard instance from WizardAction.
+     * @return true is wizard was successfully completed and disposed;
+     *         false if wizard is still active or has not been initialized yet.
+     */
+    boolean isCompleted();
+
+    /**
+     * Clean wizard errors. Just in case. Usually Wizard Manager
+     * cleans errors if needed.
+     */
+    void clearWizardErrors();
+
+    /**
+     * Resets certain wizard fields, like booleans. Called with every user
+     * input. The primary reason for this method is older frameworks like
+     * Struts, which use default HTTP handling of boolean properties, and
+     * do not notifiy a property when it is cleared.
+     */
+    void wizardReset();
+
+    /**
+     * Adds a listener for state change event.
+     */
+    void addListener(IWizardListener listener);
+
+    /**
+     * Removes a listener for state change event.
+     */
+    void removeListener(IWizardListener listener);
+
+    /**
+     * Removes all wizard listeners for state change event.
+     */
+    void removeAllListeners();
+
+}

Added: directory/trunks/triplesec/wicket-tools/src/main/java/wicket/examples/wizard/ezwizard/intf/IWizardListener.java
URL: http://svn.apache.org/viewvc/directory/trunks/triplesec/wicket-tools/src/main/java/wicket/examples/wizard/ezwizard/intf/IWizardListener.java?view=auto&rev=486187
==============================================================================
--- directory/trunks/triplesec/wicket-tools/src/main/java/wicket/examples/wizard/ezwizard/intf/IWizardListener.java (added)
+++ directory/trunks/triplesec/wicket-tools/src/main/java/wicket/examples/wizard/ezwizard/intf/IWizardListener.java Tue Dec 12 07:23:31 2006
@@ -0,0 +1,45 @@
+/*
+ *  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 wicket.examples.wizard.ezwizard.intf;
+
+/**
+ * Listens to state change events. Usually is called from Wizard Manager.
+ *
+ * @version 0.5
+ * @author Michael Jouravlev
+ */
+public interface IWizardListener {
+
+    public int STEP_REGULAR = 1;
+    public int STEP_LAST = 2;
+
+    /**
+     * Performs action when wizard is about to change the step during
+     * the forward transition.
+     *
+     * @param event WizardEvent.STEP_REGULAR if about to leave "middle" step,
+     *        WizardEvent.STEP_LAST if about to leave the final wizard
+     *        step, effectively finishing the wizard.
+     * @return true if it is ok to move to the next step, false if step
+     *         cannot be changed.
+     */
+    boolean onTransition(int event);
+}

Added: directory/trunks/triplesec/wicket-tools/src/main/java/wicket/examples/wizard/ezwizard/intf/IWizardStep.java
URL: http://svn.apache.org/viewvc/directory/trunks/triplesec/wicket-tools/src/main/java/wicket/examples/wizard/ezwizard/intf/IWizardStep.java?view=auto&rev=486187
==============================================================================
--- directory/trunks/triplesec/wicket-tools/src/main/java/wicket/examples/wizard/ezwizard/intf/IWizardStep.java (added)
+++ directory/trunks/triplesec/wicket-tools/src/main/java/wicket/examples/wizard/ezwizard/intf/IWizardStep.java Tue Dec 12 07:23:31 2006
@@ -0,0 +1,128 @@
+/*
+ *  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 wicket.examples.wizard.ezwizard.intf;
+
+/**
+ * Represents a state of a wizard Finite State Machine (FSM).
+ * <br/><br/>
+ * A base state contains common navigation methods, a concrete state also
+ * contains setters/getters for domain data, relevant to this state.
+ *
+ * @version 0.5
+ * @author Michael Jouravlev
+ */
+public interface IWizardStep {
+
+    /**
+     * Returns array of outgoing transitions for this state. The transitions
+     * are weighed according to the order in which they were added to this
+     * state.
+     *
+     * @return array of outgoing transitions
+     */
+    IWizardTransition[] getOutgoingTransitions();
+
+    /**
+     * Selects a transition which will be used to move forward from
+     * from this state.
+     * <p>
+     * All outgoing transitions are validated in the order of their weight.
+     * The first valid transition is chosen.
+     *
+     * @return a valid outgoing edge or null if no valid edges found
+     */
+    IWizardTransition getOutgoingTransition();
+
+    /**
+     * Returns the incoming transition, was used to get to this state.
+     *
+     * @return incoming transition
+     */
+    IWizardTransition getIncomingTransition();
+
+    /**
+     * 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
+     */
+    void setIncomingTransition(IWizardTransition value);
+
+    /**
+     * Adds an outgoing transition. Order in which transitions are added
+     * to a state, defines their weight (or rank). Transition added to
+     * a state first, has the highest weight. Transitions are validated
+     * during forward traversal in order of their weight, and the first
+     * valid transition is chosen for state change.
+     *
+     * @param value outgoing transition
+     */
+    void addOutgoingTransition(IWizardTransition value);
+
+    /**
+     * 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
+     */
+    boolean isCheckpoint();
+
+    /**
+     * Returns the name of this state. Each state must have a unique name..
+     *
+     * @return state name
+     */
+    String getStateName();
+
+    /**
+     * Returns the wizard, which contains this state as part
+     * of the wizard sequence.
+     *
+     * @return wizard which owns this node
+     */
+    IWizard getWizard();
+
+    /**
+     * 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.
+     */
+    boolean isStateInPath();
+
+    /**
+     * 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 not used in JSF.
+     */
+    void resetBooleans();
+
+    /**
+     * Sets master wizard controller for this step.
+     */
+    void setOwner(IWizard wizard);
+}

Added: directory/trunks/triplesec/wicket-tools/src/main/java/wicket/examples/wizard/ezwizard/intf/IWizardTransition.java
URL: http://svn.apache.org/viewvc/directory/trunks/triplesec/wicket-tools/src/main/java/wicket/examples/wizard/ezwizard/intf/IWizardTransition.java?view=auto&rev=486187
==============================================================================
--- directory/trunks/triplesec/wicket-tools/src/main/java/wicket/examples/wizard/ezwizard/intf/IWizardTransition.java (added)
+++ directory/trunks/triplesec/wicket-tools/src/main/java/wicket/examples/wizard/ezwizard/intf/IWizardTransition.java Tue Dec 12 07:23:31 2006
@@ -0,0 +1,86 @@
+/*
+ *  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 wicket.examples.wizard.ezwizard.intf;
+
+/**
+ * Represents a state transition. In Easy Wizard a transition is an object, it
+ * can refer to its source and target states, and can validate itself. When
+ * wizard controller moves from one state to another, it iterates through
+ * transitions of current state, and validates each of them in order of their
+ * weight. The first valid transition is used to change the state.
+ *
+ * @version 0.5
+ * @author Michael Jouravlev
+ */
+public interface IWizardTransition {
+
+    /**
+     * Returns human-readable name of the transition, or null if not set.
+     * <br><br>
+     * The name is not needed for wizard navigation and thus is optional.
+     * Nevertheless, names are highly recommended because they allow to
+     * find a transition by name, and also may provide mapping name
+     * for UI layer.
+     *
+     * @return transition name or null if name is not set
+     */
+    public String getName();
+
+    /**
+     * Returns source of this state, cannot be null. Each transition refers
+     * to its source and target states.
+     *
+     * @return source of this transition
+     */
+    public IWizardStep getSource();
+
+    /**
+     * Sets source state for this transition
+     * @param value  source state for this transition
+     */
+    public void setSource(IWizardStep value);
+
+    /**
+     * Returns target state of this transition, cannot be null. Each transition
+     * refers to its source and target states.
+     *
+     * @return target state of this transition
+     */
+    public IWizardStep getTarget();
+
+    /**
+     * Validates this transition. Usually checks the domain accounts, which
+     * is referenced from the source state of this transition.
+     * <br><br>
+     * Outgoing transitions are validated in order of their weight,
+     * when state is about to change. The first valid transition is chosen
+     * for traversal.
+     *
+     * @return true if this transition is valid
+     */
+    public boolean validate();
+
+    /**
+     * Returns wizard controller object, which owns this state
+     * @return wizard which owns this state
+     */
+    IWizard getWizard();
+}



Mime
View raw message