You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@directory.apache.org by tb...@apache.org on 2006/12/12 16:24:14 UTC
svn commit: r486187 [44/49] - in /directory/trunks/triplesec: ./ admin-api/
admin-api/src/ admin-api/src/main/ admin-api/src/main/java/
admin-api/src/main/java/org/ admin-api/src/main/java/org/safehaus/
admin-api/src/main/java/org/safehaus/triplesec/ a...
Added: directory/trunks/triplesec/webapp-demo/src/main/java/org/safehaus/triplesec/demo/view/ProxyDataProvider.java
URL: http://svn.apache.org/viewvc/directory/trunks/triplesec/webapp-demo/src/main/java/org/safehaus/triplesec/demo/view/ProxyDataProvider.java?view=auto&rev=486187
==============================================================================
--- directory/trunks/triplesec/webapp-demo/src/main/java/org/safehaus/triplesec/demo/view/ProxyDataProvider.java (added)
+++ directory/trunks/triplesec/webapp-demo/src/main/java/org/safehaus/triplesec/demo/view/ProxyDataProvider.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 org.safehaus.triplesec.demo.view;
+
+import org.safehaus.triplesec.demo.dao.AccountDao;
+import org.safehaus.triplesec.demo.model.Account;
+import wicket.model.IModel;
+
+public class ProxyDataProvider extends AccountDataProvider
+{
+ private static final long serialVersionUID = -7305063412324483407L;
+ private AccountDao dao;
+
+ public ProxyDataProvider( AccountDao dao )
+ {
+ this.dao = dao;
+ }
+
+ protected AccountDao getAccountDao()
+ {
+ return dao;
+ }
+
+ public IModel model( Object object )
+ {
+ return new ProxyModel( (Account) object, dao );
+ }
+}
Added: directory/trunks/triplesec/webapp-demo/src/main/java/org/safehaus/triplesec/demo/view/ProxyModel.java
URL: http://svn.apache.org/viewvc/directory/trunks/triplesec/webapp-demo/src/main/java/org/safehaus/triplesec/demo/view/ProxyModel.java?view=auto&rev=486187
==============================================================================
--- directory/trunks/triplesec/webapp-demo/src/main/java/org/safehaus/triplesec/demo/view/ProxyModel.java (added)
+++ directory/trunks/triplesec/webapp-demo/src/main/java/org/safehaus/triplesec/demo/view/ProxyModel.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.demo.view;
+
+import org.safehaus.triplesec.demo.dao.AccountDao;
+import org.safehaus.triplesec.demo.model.Account;
+
+public class ProxyModel extends AccountDetachableModel
+{
+ private static final long serialVersionUID = 3871574616397353077L;
+
+ private AccountDao dao;
+
+ public ProxyModel( Account account, AccountDao dao )
+ {
+ super( account );
+ this.dao = dao;
+ }
+ protected AccountDao getAccountDao()
+ {
+ return dao;
+ }
+}
Added: directory/trunks/triplesec/webapp-demo/src/main/java/org/safehaus/triplesec/demo/view/TriplesecDemoApplication.java
URL: http://svn.apache.org/viewvc/directory/trunks/triplesec/webapp-demo/src/main/java/org/safehaus/triplesec/demo/view/TriplesecDemoApplication.java?view=auto&rev=486187
==============================================================================
--- directory/trunks/triplesec/webapp-demo/src/main/java/org/safehaus/triplesec/demo/view/TriplesecDemoApplication.java (added)
+++ directory/trunks/triplesec/webapp-demo/src/main/java/org/safehaus/triplesec/demo/view/TriplesecDemoApplication.java Tue Dec 12 07:23:31 2006
@@ -0,0 +1,210 @@
+/*
+ * 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.demo.view;
+
+
+import org.safehaus.triplesec.demo.security.AuthenticatedPage;
+import org.safehaus.triplesec.demo.security.AuthenticatedWebSession;
+import org.safehaus.triplesec.demo.security.PageAuthorizationStrategy;
+import org.safehaus.triplesec.demo.view.pages.HomePage;
+import org.safehaus.triplesec.demo.view.pages.LoginPage;
+import org.safehaus.triplesec.demo.dao.AccountDao;
+import org.safehaus.triplesec.demo.service.Registry;
+import wicket.ISessionFactory;
+import wicket.Session;
+import wicket.spring.SpringWebApplication;
+
+import javax.servlet.ServletConfig;
+import java.util.Properties;
+
+
+/**
+ * Entry point of the Triplesec Demo web application.
+ */
+public class TriplesecDemoApplication extends SpringWebApplication
+{
+ // Ldap init parameter names
+ private static final String LDAP_PORT_PARAM = "ldapPort";
+ private static final String LDAP_BASE_DN_PARAM = "ldapBaseDn";
+ private static final String LDAP_HOST_PARAM = "ldapHost";
+ private static final String DEMO_LDAP_CREDENTIALS_PARAM = "demoAppLdapCredentials";
+
+ // SMS init parameters names
+ private static final String SMS_TRANSPORT_URL_PARAM = "smsTransportUrl";
+ private static final String SMS_PASSWORD_PARAM = "smsPassword";
+ private static final String SMS_USERNAME_PARAM = "smsUsername";
+ private static final String SMS_ACCOUNT_PARAM = "smsAccountName";
+
+ private boolean headless = false;
+
+ /**
+ * This field holds an account dao proxy that is safe to use in
+ * wicket components.
+ */
+ private AccountDao accountDaoProxy;
+
+ /**
+ * This field holds the actual account dao retrieved from Spring
+ * context. This object should never be serialized because it will
+ * take the container with it, so BE CAREFUL when using this.
+ */
+ private AccountDao accountDao;
+
+ /**
+ * Retrieves account dao bean. This bean should not be serialized so
+ * BE CARFEFUL when using it.
+ *
+ * @return account dao bean
+ */
+ public AccountDao getAccountDao()
+ {
+ if ( accountDao == null )
+ {
+ synchronized ( this )
+ {
+ if ( accountDao == null )
+ {
+ accountDao = (AccountDao) internalGetApplicationContext()
+ .getBean( "accountDao", AccountDao.class );
+ }
+ }
+ }
+ return accountDao;
+ }
+
+ /**
+ * Returns a lazy init proxy for the dao bean. This proxy is safe to
+ * serialize and will take up very little space when serialized.
+ *
+ * @return a lazy init proxy for the dao bean
+ */
+ public AccountDao getAccountDaoProxy()
+ {
+ if ( accountDaoProxy == null )
+ {
+ synchronized( this )
+ {
+ if ( accountDaoProxy == null )
+ {
+ accountDaoProxy = (AccountDao) createSpringBeanProxy(
+ AccountDao.class, "accountDao" );
+ }
+ }
+ }
+ return accountDaoProxy;
+ }
+
+ /**
+ * Returns the class of the default home page of the application.
+ */
+ public Class getHomePage()
+ {
+ return HomePage.class;
+ }
+
+
+ /**
+ * Provides a runtime hook for custom initialization of the application.
+ */
+ protected void init()
+ {
+ // strip out Wicket's tags from the rendered markup source
+ getMarkupSettings().setStripWicketTags( true );
+
+ // set authorization strategy
+ getSecuritySettings().setAuthorizationStrategy(
+ new PageAuthorizationStrategy( AuthenticatedPage.class, LoginPage.class )
+ );
+
+ // TODO get rid of this shit out of the web.xml
+ ServletConfig config = getWicketServlet().getServletConfig();
+
+ // -------------------------------------------------------------------
+ // Get LDAP init parameters
+ // -------------------------------------------------------------------
+
+ String ldapHost = config.getInitParameter( LDAP_HOST_PARAM );
+ String ldapBaseDn = config.getInitParameter( LDAP_BASE_DN_PARAM );
+ String ldapPort = config.getInitParameter( LDAP_PORT_PARAM );
+
+ // Credentials for demo app not the administrator's credentials so
+ // we use a different init parameter here since the plugged in one
+ // is really for the admin.
+ String ldapCredentials = config.getInitParameter( DEMO_LDAP_CREDENTIALS_PARAM );
+
+ // -------------------------------------------------------------------
+ // Get SMS init parameters
+ // -------------------------------------------------------------------
+
+ String smsPassword = config.getInitParameter( SMS_PASSWORD_PARAM );
+ String smsUsername = config.getInitParameter( SMS_USERNAME_PARAM );
+ String smsAccountName = config.getInitParameter( SMS_ACCOUNT_PARAM );
+ String smsTransportUrl = config.getInitParameter( SMS_TRANSPORT_URL_PARAM );
+
+ String realm = config.getInitParameter( "realm" );
+
+ // -------------------------------------------------------------------
+ // Setup policy manager properties
+ // -------------------------------------------------------------------
+
+ Properties props = new Properties();
+ StringBuffer buf = new StringBuffer();
+ buf.append( "appName=demo,ou=Applications," ).append( ldapBaseDn );
+ props.setProperty( "applicationPrincipalDN", buf.toString() );
+ props.setProperty( "applicationCredentials", ldapCredentials );
+ Registry.policyManager().setLdapProperties( props );
+ Registry.policyManager().setRealm( realm );
+
+ buf.setLength( 0 );
+ buf.append( "ldap://" ).append( ldapHost ).append( ":" )
+ .append( ldapPort ).append( "/" ).append( ldapBaseDn );
+ Registry.policyManager().setUrl( buf.toString() );
+
+ // -------------------------------------------------------------------
+ // Setup sms manager properties
+ // -------------------------------------------------------------------
+
+ Registry.smsManager().setSmsAccountName( smsAccountName );
+ Registry.smsManager().setSmsPassword( smsPassword );
+ Registry.smsManager().setSmsTransportUrl( smsTransportUrl );
+ Registry.smsManager().setSmsUsername( smsUsername );
+ }
+
+
+ protected ISessionFactory getSessionFactory() {
+ return new ISessionFactory()
+ {
+ public Session newSession() {
+ return new AuthenticatedWebSession( TriplesecDemoApplication.this );
+ }
+ };
+ }
+
+ public boolean isHeadless()
+ {
+ return headless;
+ }
+
+
+ public void setHeadless(boolean headless)
+ {
+ this.headless = headless;
+ }
+}
Added: directory/trunks/triplesec/webapp-demo/src/main/java/org/safehaus/triplesec/demo/view/borders/PageBorder.java
URL: http://svn.apache.org/viewvc/directory/trunks/triplesec/webapp-demo/src/main/java/org/safehaus/triplesec/demo/view/borders/PageBorder.java?view=auto&rev=486187
==============================================================================
--- directory/trunks/triplesec/webapp-demo/src/main/java/org/safehaus/triplesec/demo/view/borders/PageBorder.java (added)
+++ directory/trunks/triplesec/webapp-demo/src/main/java/org/safehaus/triplesec/demo/view/borders/PageBorder.java Tue Dec 12 07:23:31 2006
@@ -0,0 +1,117 @@
+/*
+ * 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.demo.view.borders;
+
+import org.safehaus.triplesec.demo.security.AuthenticatedWebSession;
+import org.safehaus.triplesec.demo.view.pages.HomePage;
+import org.safehaus.triplesec.demo.view.pages.LoginPage;
+import org.safehaus.triplesec.demo.view.pages.AdminPage;
+import org.safehaus.triplesec.guardian.Profile;
+import wicket.markup.html.border.Border;
+import wicket.markup.html.link.Link;
+import wicket.markup.html.basic.Label;
+import wicket.model.IModel;
+
+/**
+ * Renders a consistent border layout for every page when included.
+ */
+public class PageBorder extends Border
+{
+ private static final long serialVersionUID = -8571671577233566370L;
+
+ public PageBorder( String id )
+ {
+ this( id, null );
+ }
+
+ public PageBorder( String id, IModel model )
+ {
+ super( id, model );
+
+ final AuthenticatedWebSession session =
+ (AuthenticatedWebSession) getSession();
+
+ Link homeLink = new Link( "home" )
+ {
+ private static final long serialVersionUID = -7817022822646528881L;
+
+ public void onClick()
+ {
+ setResponsePage( HomePage.class );
+ }
+ };
+ if ( !session.isAuthenticated() )
+ {
+ homeLink.setEnabled( false );
+ }
+ else
+ {
+ homeLink.setEnabled( true );
+ }
+ add( homeLink );
+
+ Link logoutLink = new Link( "logout" )
+ {
+ private static final long serialVersionUID = 3506418292280323906L;
+
+ public void onClick()
+ {
+ if ( session.isAuthenticated() )
+ {
+ session.invalidate();
+ setResponsePage( LoginPage.class );
+ }
+ }
+ };
+ if ( !session.isAuthenticated() )
+ {
+ logoutLink.setEnabled( false );
+ }
+ else
+ {
+ logoutLink.setEnabled( true );
+ }
+ add( logoutLink );
+
+ Link adminLink = new Link( "adminLink" )
+ {
+ private static final long serialVersionUID = 7673228318888483188L;
+
+ public void onClick() {
+ setResponsePage( AdminPage.class );
+ }
+ };
+ Label adminLabel = new Label( "adminText", "view all accounts" );
+
+ Profile profile = ((AuthenticatedWebSession) getSession()).getUserProfile();
+ if ( profile != null && profile.isInRole( "superuser" ) )
+ {
+ adminLink.setVisible( true );
+ adminLabel.setVisible( true );
+ }
+ else
+ {
+ adminLink.setVisible( false );
+ adminLabel.setVisible( false );
+ }
+ add( adminLink );
+ add( adminLabel );
+ }
+}
Added: directory/trunks/triplesec/webapp-demo/src/main/java/org/safehaus/triplesec/demo/view/borders/PanelBorder.java
URL: http://svn.apache.org/viewvc/directory/trunks/triplesec/webapp-demo/src/main/java/org/safehaus/triplesec/demo/view/borders/PanelBorder.java?view=auto&rev=486187
==============================================================================
--- directory/trunks/triplesec/webapp-demo/src/main/java/org/safehaus/triplesec/demo/view/borders/PanelBorder.java (added)
+++ directory/trunks/triplesec/webapp-demo/src/main/java/org/safehaus/triplesec/demo/view/borders/PanelBorder.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.demo.view.borders;
+
+import wicket.markup.html.border.Border;
+import wicket.markup.html.basic.Label;
+import wicket.model.IModel;
+
+/**
+ * Renders a consistent border layout for a panel when included.
+ */
+public class PanelBorder extends Border
+{
+ private static final long serialVersionUID = 2132244418269079978L;
+
+ public PanelBorder( String id, IModel titleModel )
+ {
+ super( id );
+
+ // add the panel title to the panel border...
+ add( new Label( "title", titleModel ) );
+ }
+}
Added: directory/trunks/triplesec/webapp-demo/src/main/java/org/safehaus/triplesec/demo/view/pages/AdminPage.java
URL: http://svn.apache.org/viewvc/directory/trunks/triplesec/webapp-demo/src/main/java/org/safehaus/triplesec/demo/view/pages/AdminPage.java?view=auto&rev=486187
==============================================================================
--- directory/trunks/triplesec/webapp-demo/src/main/java/org/safehaus/triplesec/demo/view/pages/AdminPage.java (added)
+++ directory/trunks/triplesec/webapp-demo/src/main/java/org/safehaus/triplesec/demo/view/pages/AdminPage.java Tue Dec 12 07:23:31 2006
@@ -0,0 +1,83 @@
+/*
+ * 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.demo.view.pages;
+
+import org.safehaus.triplesec.demo.security.AuthenticatedPage;
+import org.safehaus.triplesec.demo.security.AuthenticatedWebSession;
+import org.safehaus.triplesec.demo.view.panels.ActionPanel;
+import org.safehaus.triplesec.demo.view.TriplesecDemoApplication;
+import org.safehaus.triplesec.demo.view.ProxyDataProvider;
+import org.safehaus.triplesec.demo.dao.AccountDao;
+import org.safehaus.triplesec.guardian.Profile;
+import wicket.markup.html.basic.Label;
+import wicket.extensions.markup.html.repeater.data.table.PropertyColumn;
+import wicket.extensions.markup.html.repeater.data.table.AbstractColumn;
+import wicket.extensions.markup.html.repeater.data.table.DefaultDataTable;
+import wicket.extensions.markup.html.repeater.refreshing.Item;
+import wicket.extensions.markup.html.repeater.util.SortableDataProvider;
+import wicket.model.Model;
+import wicket.model.IModel;
+import wicket.Application;
+
+import java.util.ArrayList;
+
+
+public class AdminPage extends BasePage implements AuthenticatedPage
+{
+ private static final long serialVersionUID = 944257846240276627L;
+
+ public AdminPage()
+ {
+ AuthenticatedWebSession session = (AuthenticatedWebSession) getSession();
+ Profile profile = session.getUserProfile();
+ add( new Label( "user", profile.getUserName() ) );
+ add( new Label( "roles", profile.getRoles().toString() ) );
+
+ ArrayList cols = new ArrayList();
+ cols.add( new PropertyColumn( new Model( "user id" ), "uid", "uid" ) );
+ cols.add( new PropertyColumn( new Model( "bonds" ), "bonds" ) );
+ cols.add( new PropertyColumn( new Model( "tech stocks" ), "techStocks" ) );
+ cols.add( new PropertyColumn( new Model( "high yield" ), "volatileHighYield" ) );
+ cols.add( new PropertyColumn( new Model( "t-bills" ), "tBills" ) );
+ cols.add( new PropertyColumn( new Model( "foreign" ), "foreign" ) );
+ cols.add( new AbstractColumn( new Model( "actions" ) )
+ {
+ private static final long serialVersionUID = -410352249728650137L;
+
+ public void populateItem( Item item, String id, IModel model )
+ {
+ item.add( new ActionPanel( id, model ) );
+ }
+ });
+
+ add( new DefaultDataTable( "accounts", cols, getDataProvider(), 5 ) );
+ }
+
+ private AccountDao getAccountDao()
+ {
+ return ( (TriplesecDemoApplication) Application.get() ).getAccountDaoProxy();
+ }
+
+ protected SortableDataProvider getDataProvider()
+ {
+ return new ProxyDataProvider( getAccountDao() );
+ }
+
+}
Added: directory/trunks/triplesec/webapp-demo/src/main/java/org/safehaus/triplesec/demo/view/pages/BasePage.java
URL: http://svn.apache.org/viewvc/directory/trunks/triplesec/webapp-demo/src/main/java/org/safehaus/triplesec/demo/view/pages/BasePage.java?view=auto&rev=486187
==============================================================================
--- directory/trunks/triplesec/webapp-demo/src/main/java/org/safehaus/triplesec/demo/view/pages/BasePage.java (added)
+++ directory/trunks/triplesec/webapp-demo/src/main/java/org/safehaus/triplesec/demo/view/pages/BasePage.java Tue Dec 12 07:23:31 2006
@@ -0,0 +1,41 @@
+/*
+ * 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.demo.view.pages;
+
+import wicket.markup.html.WebPage;
+import wicket.markup.html.border.Border;
+import org.safehaus.triplesec.demo.view.borders.PageBorder;
+
+/**
+ * Abstract base class for (most) all pages in the application. It will
+ * ensure that the page border is rendered.
+ */
+public abstract class BasePage extends WebPage
+{
+ private static final long serialVersionUID = -5614416105628790524L;
+
+ public BasePage()
+ {
+ // create border and add it to the page
+ Border border = new PageBorder( "border" );
+ border.setTransparentResolver( true );
+ super.add( border );
+ }
+}
Added: directory/trunks/triplesec/webapp-demo/src/main/java/org/safehaus/triplesec/demo/view/pages/ChartPage.java
URL: http://svn.apache.org/viewvc/directory/trunks/triplesec/webapp-demo/src/main/java/org/safehaus/triplesec/demo/view/pages/ChartPage.java?view=auto&rev=486187
==============================================================================
--- directory/trunks/triplesec/webapp-demo/src/main/java/org/safehaus/triplesec/demo/view/pages/ChartPage.java (added)
+++ directory/trunks/triplesec/webapp-demo/src/main/java/org/safehaus/triplesec/demo/view/pages/ChartPage.java Tue Dec 12 07:23:31 2006
@@ -0,0 +1,35 @@
+/*
+ * 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.demo.view.pages;
+
+import org.safehaus.triplesec.demo.view.ChartResource;
+import org.safehaus.triplesec.demo.model.Account;
+import org.safehaus.triplesec.demo.security.AuthenticatedPage;
+import wicket.markup.html.image.Image;
+
+public class ChartPage extends BasePage implements AuthenticatedPage
+{
+ private static final long serialVersionUID = -527554656974648369L;
+
+ public ChartPage( final Account account )
+ {
+ add( new Image( "chartImage", new ChartResource( account ) ) );
+ }
+}
Added: directory/trunks/triplesec/webapp-demo/src/main/java/org/safehaus/triplesec/demo/view/pages/HomePage.java
URL: http://svn.apache.org/viewvc/directory/trunks/triplesec/webapp-demo/src/main/java/org/safehaus/triplesec/demo/view/pages/HomePage.java?view=auto&rev=486187
==============================================================================
--- directory/trunks/triplesec/webapp-demo/src/main/java/org/safehaus/triplesec/demo/view/pages/HomePage.java (added)
+++ directory/trunks/triplesec/webapp-demo/src/main/java/org/safehaus/triplesec/demo/view/pages/HomePage.java Tue Dec 12 07:23:31 2006
@@ -0,0 +1,65 @@
+/*
+ * 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.demo.view.pages;
+
+import org.safehaus.triplesec.demo.view.ChartResource;
+import org.safehaus.triplesec.demo.dao.AccountDao;
+import org.safehaus.triplesec.demo.model.Account;
+import org.safehaus.triplesec.demo.security.AuthenticatedPage;
+import org.safehaus.triplesec.demo.security.AuthenticatedWebSession;
+import org.safehaus.triplesec.demo.view.TriplesecDemoApplication;
+import org.safehaus.triplesec.demo.view.panels.BuyPanel;
+import org.safehaus.triplesec.guardian.Profile;
+import wicket.Application;
+import wicket.markup.html.basic.Label;
+import wicket.markup.html.image.Image;
+
+/**
+ * The default home page of the Safehaus Demo web application.
+ */
+public class HomePage extends BasePage implements AuthenticatedPage
+{
+ private static final long serialVersionUID = 944257846240276627L;
+
+ public HomePage()
+ {
+ AuthenticatedWebSession session = (AuthenticatedWebSession) getSession();
+ Profile profile = session.getUserProfile();
+ add( new Label( "user", profile.getUserName() ) );
+ add( new Label( "roles", profile.getRoles().toString() ) );
+
+ Account account = getAccountDao().get( profile.getUserName() );
+ add( new Image( "chartImage", new ChartResource( account ) ) );
+
+ BuyPanel buyPanel = new BuyPanel( "buyPanel", profile.getUserName() );
+ if ( profile.isInRole( "untrusted" ) )
+ {
+ buyPanel.setVisible( false );
+ }
+ add( buyPanel );
+
+ }
+
+ private AccountDao getAccountDao()
+ {
+ return ( (TriplesecDemoApplication) Application.get() ).getAccountDaoProxy();
+ }
+
+}
Added: directory/trunks/triplesec/webapp-demo/src/main/java/org/safehaus/triplesec/demo/view/pages/LoginPage.java
URL: http://svn.apache.org/viewvc/directory/trunks/triplesec/webapp-demo/src/main/java/org/safehaus/triplesec/demo/view/pages/LoginPage.java?view=auto&rev=486187
==============================================================================
--- directory/trunks/triplesec/webapp-demo/src/main/java/org/safehaus/triplesec/demo/view/pages/LoginPage.java (added)
+++ directory/trunks/triplesec/webapp-demo/src/main/java/org/safehaus/triplesec/demo/view/pages/LoginPage.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.demo.view.pages;
+
+import org.safehaus.triplesec.demo.view.panels.LoginPanel;
+import org.safehaus.triplesec.demo.security.AuthenticatedWebSession;
+
+
+public class LoginPage extends BasePage
+{
+ private static final long serialVersionUID = 1331634141979504338L;
+
+ public LoginPage()
+ {
+ add( new LoginPanel( "loginPanel" )
+ {
+ private static final long serialVersionUID = -2645418704580992221L;
+
+ public boolean login(final String username, final String password, final String passcode) {
+ return ( (AuthenticatedWebSession) getSession() )
+ .authenticate( username, password, passcode );
+ }
+ } );
+ }
+}
Added: directory/trunks/triplesec/webapp-demo/src/main/java/org/safehaus/triplesec/demo/view/pages/WapPushPage.java
URL: http://svn.apache.org/viewvc/directory/trunks/triplesec/webapp-demo/src/main/java/org/safehaus/triplesec/demo/view/pages/WapPushPage.java?view=auto&rev=486187
==============================================================================
--- directory/trunks/triplesec/webapp-demo/src/main/java/org/safehaus/triplesec/demo/view/pages/WapPushPage.java (added)
+++ directory/trunks/triplesec/webapp-demo/src/main/java/org/safehaus/triplesec/demo/view/pages/WapPushPage.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.demo.view.pages;
+
+import org.safehaus.triplesec.demo.view.panels.WapPushPanel;
+
+public class WapPushPage extends BasePage
+{
+ private static final long serialVersionUID = 4173928556386780854L;
+
+ public WapPushPage()
+ {
+ add( new WapPushPanel( "wapPanel" ) );
+ }
+}
Added: directory/trunks/triplesec/webapp-demo/src/main/java/org/safehaus/triplesec/demo/view/panels/ActionPanel.java
URL: http://svn.apache.org/viewvc/directory/trunks/triplesec/webapp-demo/src/main/java/org/safehaus/triplesec/demo/view/panels/ActionPanel.java?view=auto&rev=486187
==============================================================================
--- directory/trunks/triplesec/webapp-demo/src/main/java/org/safehaus/triplesec/demo/view/panels/ActionPanel.java (added)
+++ directory/trunks/triplesec/webapp-demo/src/main/java/org/safehaus/triplesec/demo/view/panels/ActionPanel.java 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.
+ *
+ */
+package org.safehaus.triplesec.demo.view.panels;
+
+import org.safehaus.triplesec.demo.model.Account;
+import org.safehaus.triplesec.demo.view.pages.ChartPage;
+import wicket.markup.html.link.Link;
+import wicket.markup.html.panel.Panel;
+import wicket.model.IModel;
+
+public class ActionPanel extends Panel
+{
+ private static final long serialVersionUID = 6445746269549235214L;
+
+ public ActionPanel(String id, IModel model)
+ {
+ super( id, model );
+ add( new Link( "view" )
+ {
+ private static final long serialVersionUID = 2408582519626686086L;
+
+ public void onClick()
+ {
+ Account account = (Account) getParent().getModelObject();
+ setResponsePage( new ChartPage( account ) );
+ }
+ });
+ }
+}
Added: directory/trunks/triplesec/webapp-demo/src/main/java/org/safehaus/triplesec/demo/view/panels/BasePanel.java
URL: http://svn.apache.org/viewvc/directory/trunks/triplesec/webapp-demo/src/main/java/org/safehaus/triplesec/demo/view/panels/BasePanel.java?view=auto&rev=486187
==============================================================================
--- directory/trunks/triplesec/webapp-demo/src/main/java/org/safehaus/triplesec/demo/view/panels/BasePanel.java (added)
+++ directory/trunks/triplesec/webapp-demo/src/main/java/org/safehaus/triplesec/demo/view/panels/BasePanel.java 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.
+ *
+ */
+package org.safehaus.triplesec.demo.view.panels;
+
+import wicket.markup.html.panel.Panel;
+import wicket.model.IModel;
+import wicket.model.Model;
+import org.safehaus.triplesec.demo.view.borders.PanelBorder;
+
+public class BasePanel extends Panel
+{
+ private static final long serialVersionUID = 2996916350325053429L;
+
+ public BasePanel( String id, IModel model, String title ) {
+ super( id, model );
+
+ // create border and add it to the page
+ PanelBorder border = new PanelBorder( "border", new Model( title ) );
+ border.setTransparentResolver( true );
+ super.add( border );
+ }
+}
Added: directory/trunks/triplesec/webapp-demo/src/main/java/org/safehaus/triplesec/demo/view/panels/BuyPanel.java
URL: http://svn.apache.org/viewvc/directory/trunks/triplesec/webapp-demo/src/main/java/org/safehaus/triplesec/demo/view/panels/BuyPanel.java?view=auto&rev=486187
==============================================================================
--- directory/trunks/triplesec/webapp-demo/src/main/java/org/safehaus/triplesec/demo/view/panels/BuyPanel.java (added)
+++ directory/trunks/triplesec/webapp-demo/src/main/java/org/safehaus/triplesec/demo/view/panels/BuyPanel.java Tue Dec 12 07:23:31 2006
@@ -0,0 +1,141 @@
+/*
+ * 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.demo.view.panels;
+
+import org.safehaus.triplesec.demo.dao.AccountDao;
+import org.safehaus.triplesec.demo.model.Account;
+import org.safehaus.triplesec.demo.security.AuthenticatedWebSession;
+import org.safehaus.triplesec.demo.service.Registry;
+import org.safehaus.triplesec.demo.view.TriplesecDemoApplication;
+import org.safehaus.triplesec.demo.view.pages.HomePage;
+import org.safehaus.triplesec.jaas.AccountLockedOutException;
+import org.safehaus.triplesec.jaas.PreauthFailedException;
+import org.safehaus.triplesec.jaas.ResynchInProgressException;
+import org.safehaus.triplesec.jaas.ResynchStartingException;
+import org.safehaus.triplesec.jaas.SafehausPrincipal;
+import wicket.Application;
+import wicket.markup.html.form.DropDownChoice;
+import wicket.markup.html.form.Form;
+import wicket.markup.html.form.PasswordTextField;
+import wicket.markup.html.panel.FeedbackPanel;
+import wicket.model.CompoundPropertyModel;
+
+import javax.security.auth.login.LoginException;
+import java.io.Serializable;
+
+
+public class BuyPanel extends BasePanel
+{
+ private static final long serialVersionUID = 1912653768008190645L;
+ private String userId;
+
+ public BuyPanel( String id, String userid )
+ {
+ super( id, null, "Invest an additional 1,000 in a fund?" );
+ this.userId = userid;
+
+ final Input input = new Input();
+ setModel( new CompoundPropertyModel( input ) );
+
+ // create feedback panel and add to page
+ final FeedbackPanel feedback = new FeedbackPanel( "feedback" );
+ add( feedback );
+
+ Form form = new Form( "buyForm" ) {
+ private static final long serialVersionUID = 7733755424957404354L;
+
+ protected void onSubmit() {
+ AuthenticatedWebSession session = (AuthenticatedWebSession) getSession();
+ SafehausPrincipal principal = null;
+ String username = session.getUsername();
+ String password = session.getPassword();
+ try
+ {
+ principal = Registry.policyManager().getPrincipal( username,
+ password, input.passcode );
+ }
+ catch ( AccountLockedOutException e )
+ {
+ error("Account locked for user '" + username + "'!");
+ }
+ catch ( PreauthFailedException e )
+ {
+ error("Hotp authentication failed for user '" + username + "'!");
+ }
+ catch ( ResynchInProgressException e )
+ {
+ error("User '" + username + "' is still out of sych! Please " +
+ "enter another consecutive single-use password.");
+ }
+ catch ( ResynchStartingException e )
+ {
+ error("User '" + username + "' is out of synch! Initiating " +
+ "resynch protocol. Enter another consecutive single-use " +
+ "password.");
+ }
+ catch ( LoginException e )
+ {
+ error("User '" + username + "' failed authentication: " +
+ e.getMessage());
+ }
+ if ( principal != null )
+ {
+ int index = Account.getIndex( input.fund );
+ Account account = getAccountDao().get( getUserId() );
+ account.set( input.fund, account.get( index ) + 1000 );
+ getAccountDao().update( account );
+ setResponsePage( HomePage.class );
+ }
+ }
+ };
+ add( form );
+
+ form.add( new DropDownChoice( "fund", Account.FUNDS ) );
+ form.add( new PasswordTextField( "passcode" ).setRequired( false ) );
+ }
+
+ public String getUserId()
+ {
+ return userId;
+ }
+
+ private static class Input implements Serializable
+ {
+ private static final long serialVersionUID = -399677402650538731L;
+
+ public String fund;
+ public String passcode;
+
+
+ public String toString() {
+ return "Input{" +
+ "fund='" + fund + '\'' +
+ ", passcode='" + passcode + '\'' +
+ '}';
+ }
+ }
+
+ private AccountDao getAccountDao()
+ {
+ return ( (TriplesecDemoApplication) Application.get() ).getAccountDaoProxy();
+ }
+
+
+}
Added: directory/trunks/triplesec/webapp-demo/src/main/java/org/safehaus/triplesec/demo/view/panels/LoginPanel.java
URL: http://svn.apache.org/viewvc/directory/trunks/triplesec/webapp-demo/src/main/java/org/safehaus/triplesec/demo/view/panels/LoginPanel.java?view=auto&rev=486187
==============================================================================
--- directory/trunks/triplesec/webapp-demo/src/main/java/org/safehaus/triplesec/demo/view/panels/LoginPanel.java (added)
+++ directory/trunks/triplesec/webapp-demo/src/main/java/org/safehaus/triplesec/demo/view/panels/LoginPanel.java Tue Dec 12 07:23:31 2006
@@ -0,0 +1,235 @@
+/*
+ * 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.demo.view.panels;
+
+import org.safehaus.triplesec.demo.security.AuthenticatedWebSession;
+import org.safehaus.triplesec.demo.view.TriplesecDemoApplication;
+import org.safehaus.triplesec.demo.view.pages.WapPushPage;
+import org.safehaus.triplesec.demo.service.Registry;
+import wicket.markup.html.basic.Label;
+import wicket.markup.html.form.Button;
+import wicket.markup.html.form.Form;
+import wicket.markup.html.form.PasswordTextField;
+import wicket.markup.html.form.RequiredTextField;
+import wicket.markup.html.form.CheckBox;
+import wicket.markup.html.link.Link;
+import wicket.markup.html.panel.FeedbackPanel;
+import wicket.model.Model;
+import wicket.model.PropertyModel;
+import wicket.util.value.ValueMap;
+
+/**
+ * Login panel with username, password, and passcode, as well
+ * as support for cookie persistence of all three. When the
+ * panel's form is submitted, the abstract method
+ * <code>login(String, String, String)</code> is called,
+ * passing the username, password, and passcode submitted.
+ * The <code>login()</code> method should log the user in and
+ * return null if no error occured, or a descriptive String in
+ * the event that the login fails.
+ */
+public abstract class LoginPanel extends BasePanel
+{
+ /** Input field for password */
+ private PasswordTextField password;
+
+ /** Input field for passcode */
+ private PasswordTextField passcode;
+
+ /** Input field for user name */
+ private RequiredTextField username;
+
+ /** Checkbox for graphics mode */
+ private boolean mode = true;
+
+
+ /**
+ * Login form.
+ */
+ public final class LoginForm extends Form
+ {
+ private static final long serialVersionUID = 8944436409011853603L;
+
+ /** El-cheapo model for form */
+ private final ValueMap properties = new ValueMap();
+
+ /**
+ * Constructor.
+ *
+ * @param id id of the form component
+ */
+ public LoginForm( final String id )
+ {
+ super( id );
+
+ // Attach textfield components for username, password,
+ // and passcode that edit properties map in lieu of a
+ // formal beans model
+ username = new RequiredTextField( "username",
+ new PropertyModel( properties, "username" ) );
+ username.setLabel( new Model("Username") );
+ add( username );
+ password = new PasswordTextField( "password",
+ new PropertyModel( properties, "password" ) );
+ password.setRequired( true );
+ password.setLabel( new Model( "Password" ) );
+ add( password );
+ passcode = new PasswordTextField( "passcode",
+ new PropertyModel( properties, "passcode" ) );
+ passcode.setLabel( new Model( "Passcode" ) );
+ passcode.setRequired( false );
+ add( passcode );
+ add( new CheckBox( "mode",
+ new PropertyModel( LoginPanel.this, "mode" ) ) );
+
+ add( new Button("submit") );
+
+ }
+
+
+ public final void onSubmit()
+ {
+ ( (TriplesecDemoApplication) getApplication() )
+ .setHeadless( !isMode() );
+
+ if ( login( getUsername(), getPassword(), getPasscode() ) )
+ {
+ // if login has been called because the user was not
+ // yet logged in, then continue to the original
+ // destination; otherwise to the Home page...
+ if ( !continueToOriginalDestination() )
+ {
+ // HTTP redirect response has been committed. No
+ // more data shall be written to the response
+ gotoHomePage();
+ }
+ else
+ {
+ // Try the component based localizer first. If not
+ // found try the application localizer. Else use the
+ // default
+ final String errmsg = getLocalizer()
+ .getString( "loginError", this, "Unable to log you in" );
+ error( errmsg );
+ }
+ }
+ // login failed... get reason... display to feedback panel...
+ else
+ {
+ error( ((AuthenticatedWebSession) getSession()).getErrorMessage() );
+ }
+ }
+
+ private void gotoHomePage()
+ {
+ setResponsePage(
+ getApplication().getSessionSettings().getPageFactory()
+ .newPage(getApplication().getHomePage())
+ );
+ }
+ }
+
+
+ public LoginPanel( final String id )
+ {
+ super( id, null, "Login" );
+
+ // create feedback panel and add to page
+ final FeedbackPanel feedback = new FeedbackPanel( "feedback" );
+ add( feedback );
+
+ String realm = Registry.policyManager().getRealm();
+ add( new Label( "realm", realm ) );
+
+ // add login form to page, passing feedback panel as
+ // validation error handler
+ add( new LoginForm( "loginForm" ) );
+
+ add( new Link( "smsLink" )
+ {
+ private static final long serialVersionUID = -3757666140892829417L;
+
+ public void onClick()
+ {
+ setResponsePage( WapPushPage.class );
+ }
+ } );
+ }
+
+
+ /**
+ * Convenience method to access the passcode.
+ */
+ public String getPasscode()
+ {
+ return passcode.getModelObjectAsString();
+ }
+
+
+ /**
+ * Convenience method to access the password.
+ */
+ public String getPassword()
+ {
+ return password.getModelObjectAsString();
+ }
+
+
+ /**
+ * Convenience method to access the username.
+ */
+ public String getUsername()
+ {
+ return username.getModelObjectAsString();
+ }
+
+
+ /**
+ * Convenience method to access graphical mode switch.
+ */
+ public boolean isMode()
+ {
+ return mode;
+ }
+
+
+ /**
+ * Set model object for graphical mode.
+ */
+ public void setMode( boolean mode )
+ {
+ this.mode = mode;
+ }
+
+
+ /**
+ * Login user to the application.
+ *
+ * @param username the username
+ * @param password the password
+ * @param passcode the passcode
+ *
+ * @return <b>true</b> if login was successful
+ */
+ public abstract boolean login( final String username,
+ final String password,
+ final String passcode );
+
+}
Added: directory/trunks/triplesec/webapp-demo/src/main/java/org/safehaus/triplesec/demo/view/panels/WapPushPanel.java
URL: http://svn.apache.org/viewvc/directory/trunks/triplesec/webapp-demo/src/main/java/org/safehaus/triplesec/demo/view/panels/WapPushPanel.java?view=auto&rev=486187
==============================================================================
--- directory/trunks/triplesec/webapp-demo/src/main/java/org/safehaus/triplesec/demo/view/panels/WapPushPanel.java (added)
+++ directory/trunks/triplesec/webapp-demo/src/main/java/org/safehaus/triplesec/demo/view/panels/WapPushPanel.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 org.safehaus.triplesec.demo.view.panels;
+
+
+import wicket.markup.html.link.Link;
+import wicket.markup.html.panel.FeedbackPanel;
+import wicket.markup.html.form.Form;
+import wicket.markup.html.form.DropDownChoice;
+import wicket.markup.html.form.RequiredTextField;
+import wicket.markup.html.form.validation.PatternValidator;
+import wicket.model.CompoundPropertyModel;
+import wicket.model.Model;
+import wicket.util.parse.metapattern.MetaPattern;
+import org.safehaus.triplesec.demo.view.pages.HomePage;
+import org.safehaus.triplesec.demo.service.Registry;
+
+import java.util.List;
+import java.util.Arrays;
+import java.io.Serializable;
+
+
+public class WapPushPanel extends BasePanel
+{
+ private static final long serialVersionUID = -4462580703042997059L;
+
+ private static final List ACCOUNTS = Arrays.asList( new String[] {
+ "Apache", "Codehaus", "Citi401k", "OfficeW2K", "BankOne"
+ });
+
+ private static final List CARRIERS = Arrays.asList( new String[] {
+ "T-Mobile", "AT&T", "Verizon", "Cingular", "Sprint", "Nextel"
+ });
+
+ public WapPushPanel( String id )
+ {
+ super( id, null, " Provision a Demo Account to Your Handset!" );
+
+ final Input input = new Input();
+ setModel( new CompoundPropertyModel( input ) );
+
+ // create feedback panel and add to page
+ final FeedbackPanel feedback = new FeedbackPanel( "feedback" );
+ add( feedback );
+
+ Form form = new Form( "wapForm" )
+ {
+ private static final long serialVersionUID = 1615481633756109835L;
+
+ protected void onSubmit()
+ {
+ try
+ {
+ info( "input: " + input );
+ Registry.smsManager().sendSmsMessage( input.mobile,
+ input.carrier, input.account );
+ info( "An SMS has been sent to your handset with " +
+ "further instructions.");
+ info( "Click the link below to return to the demo login page.");
+ }
+ catch (Exception e)
+ {
+ error( e.getMessage() );
+ }
+ }
+ };
+ add( form );
+
+ DropDownChoice account = new DropDownChoice( "account", ACCOUNTS );
+ account.setRequired( true );
+ account.setLabel( new Model( "Demo Accounts" ) );
+ form.add( account );
+
+ RequiredTextField mobile = new RequiredTextField( "mobile" );
+ mobile.setLabel( new Model( "Mobile Number" ) );
+ mobile.add( new PatternValidator( MetaPattern.DIGITS ) );
+ form.add( mobile );
+
+ DropDownChoice carrier = new DropDownChoice( "carrier", CARRIERS );
+ carrier.setRequired( true );
+ carrier.setLabel( new Model( "Mobile Carriers" ) );
+ form.add( carrier );
+
+ add( new Link( "home")
+ {
+ private static final long serialVersionUID = -5423656870285822281L;
+
+ public void onClick() {
+ setResponsePage( HomePage.class );
+ }
+ });
+ }
+
+ private static class Input implements Serializable
+ {
+ private static final long serialVersionUID = 1752934882880403727L;
+
+ public String account;
+ public String mobile;
+ public String carrier;
+
+
+ public String toString() {
+ return "Input{" +
+ "account='" + account + '\'' +
+ ", mobile='" + mobile + '\'' +
+ ", carrier='" + carrier + '\'' +
+ '}';
+ }
+ }
+}
Added: directory/trunks/triplesec/webapp-demo/src/main/resources/applicationContext.xml
URL: http://svn.apache.org/viewvc/directory/trunks/triplesec/webapp-demo/src/main/resources/applicationContext.xml?view=auto&rev=486187
==============================================================================
--- directory/trunks/triplesec/webapp-demo/src/main/resources/applicationContext.xml (added)
+++ directory/trunks/triplesec/webapp-demo/src/main/resources/applicationContext.xml Tue Dec 12 07:23:31 2006
@@ -0,0 +1,72 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN"
+ "http://www.springframework.org/dtd/spring-beans.dtd">
+
+<beans>
+
+ <!-- setup wicket application -->
+ <bean id="wicketApplication"
+ class="org.safehaus.triplesec.demo.view.TriplesecDemoApplication"/>
+
+ <!-- setup registry bean -->
+ <bean id="registry" class="org.safehaus.triplesec.demo.service.Registry"
+ factory-method="getInstance">
+
+ <property name="policyManager">
+ <ref bean="policyManager"/>
+ </property>
+
+ <property name="smsManager">
+ <ref bean="smsManager"/>
+ </property>
+
+ </bean>
+
+ <bean id="policyManager" class="org.safehaus.triplesec.demo.service.DefaultPolicyManager">
+
+ <property name="ldapDriver">
+ <value>org.safehaus.triplesec.guardian.ldap.LdapConnectionDriver</value>
+ </property>
+ <property name="url">
+ <value>CONNECTION_URL</value>
+ </property>
+ <property name="realm">
+ <value>REALM</value>
+ </property>
+ <property name="ldapProperties">
+ <props>
+ <prop key="applicationPrincipalDN">APPLICATION_PRINCIPAL_DN</prop>
+ <prop key="applicationCredentials">secret</prop>
+ </props>
+ </property>
+
+ </bean>
+
+ <bean id="smsManager" class="org.safehaus.triplesec.demo.service.DefaultSmsManager">
+
+ <property name="smsTransportUrl">
+ <value>SMS_TRANSPORT_URL</value>
+ </property>
+
+ <property name="smsPassword">
+ <value>SMS_PASSWORD</value>
+ </property>
+
+ <property name="smsUsername">
+ <value>SMS_USERNAME</value>
+ </property>
+
+ <property name="smsAccountName">
+ <value>SMS_ACCOUNT_NAME</value>
+ </property>
+
+ <property name="wapUrl">
+ <value>http://wap.safehaus.org/demo/</value>
+ </property>
+
+ </bean>
+
+ <!-- setup dao bean -->
+ <bean id="accountDao" class="org.safehaus.triplesec.demo.dao.mock.MockAccountDao"/>
+
+</beans>
Added: directory/trunks/triplesec/webapp-demo/src/main/resources/org/safehaus/triplesec/demo/view/TriplesecDemoApplication.properties
URL: http://svn.apache.org/viewvc/directory/trunks/triplesec/webapp-demo/src/main/resources/org/safehaus/triplesec/demo/view/TriplesecDemoApplication.properties?view=auto&rev=486187
==============================================================================
--- directory/trunks/triplesec/webapp-demo/src/main/resources/org/safehaus/triplesec/demo/view/TriplesecDemoApplication.properties (added)
+++ directory/trunks/triplesec/webapp-demo/src/main/resources/org/safehaus/triplesec/demo/view/TriplesecDemoApplication.properties Tue Dec 12 07:23:31 2006
@@ -0,0 +1 @@
+RequiredValidator=field '${label}' is required
Added: directory/trunks/triplesec/webapp-demo/src/main/resources/org/safehaus/triplesec/demo/view/borders/PageBorder.html
URL: http://svn.apache.org/viewvc/directory/trunks/triplesec/webapp-demo/src/main/resources/org/safehaus/triplesec/demo/view/borders/PageBorder.html?view=auto&rev=486187
==============================================================================
--- directory/trunks/triplesec/webapp-demo/src/main/resources/org/safehaus/triplesec/demo/view/borders/PageBorder.html (added)
+++ directory/trunks/triplesec/webapp-demo/src/main/resources/org/safehaus/triplesec/demo/view/borders/PageBorder.html Tue Dec 12 07:23:31 2006
@@ -0,0 +1,63 @@
+<!--
+ 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="top">
+ <h1>Safehaus</h1>
+ <h2>mass market identity management platform</h2>
+ </div>
+ <div id="container">
+ <div id="sideMenu">
+ <ul class="menu">
+ <li class="menu">
+ <a wicket:id="home" href="#">home</a>
+ <p class="assistiveText">find your way back</p>
+ </li>
+ <li class="menu">
+ <a wicket:id="logout" href="#">logout</a>
+ <p class="assistiveText">exit safehaus demo</p>
+ </li>
+ <li class="menu">
+ <a wicket:id="adminLink" href="#">admin</a>
+ <span wicket:id="adminText"><p class="assistiveText">view all accounts</p></span>
+ </li>
+ </ul>
+ </div>
+ <div id="content">
+ <div id="MainCopy">
+ <wicket:body/>
+ </div>
+ </div>
+ </div>
+ <div id="footer">
+ © <a href="http://www.safehaus.org">Safehaus</a> 2005
+ </div>
+</wicket:border>
+</body>
+</html>
Added: directory/trunks/triplesec/webapp-demo/src/main/resources/org/safehaus/triplesec/demo/view/borders/PanelBorder.html
URL: http://svn.apache.org/viewvc/directory/trunks/triplesec/webapp-demo/src/main/resources/org/safehaus/triplesec/demo/view/borders/PanelBorder.html?view=auto&rev=486187
==============================================================================
--- directory/trunks/triplesec/webapp-demo/src/main/resources/org/safehaus/triplesec/demo/view/borders/PanelBorder.html (added)
+++ directory/trunks/triplesec/webapp-demo/src/main/resources/org/safehaus/triplesec/demo/view/borders/PanelBorder.html Tue Dec 12 07:23:31 2006
@@ -0,0 +1,24 @@
+<!--
+ 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><span wicket:id="title">Panel Title</span></h3>
+ <div id="panelcontent"><wicket:body/></div>
+</wicket:border>
Added: directory/trunks/triplesec/webapp-demo/src/main/resources/org/safehaus/triplesec/demo/view/pages/AdminPage.html
URL: http://svn.apache.org/viewvc/directory/trunks/triplesec/webapp-demo/src/main/resources/org/safehaus/triplesec/demo/view/pages/AdminPage.html?view=auto&rev=486187
==============================================================================
--- directory/trunks/triplesec/webapp-demo/src/main/resources/org/safehaus/triplesec/demo/view/pages/AdminPage.html (added)
+++ directory/trunks/triplesec/webapp-demo/src/main/resources/org/safehaus/triplesec/demo/view/pages/AdminPage.html Tue Dec 12 07:23:31 2006
@@ -0,0 +1,36 @@
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+
+-->
+
+<?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>Safehaus Demo: 401k Funds</title>
+ </wicket:head>
+</head>
+<body>
+ <span wicket:id="border">
+ <span wicket:id="user">mcurie</span>:
+ <span wicket:id="roles">roles</span><br/>
+ <h4>401k Investment Accounts by User</h4>
+ <table wicket:id="accounts" cellspacing="4" cellpadding="2" class="grid"></table>
+ </span>
+</body>
+</html>
Added: directory/trunks/triplesec/webapp-demo/src/main/resources/org/safehaus/triplesec/demo/view/pages/ChartPage.html
URL: http://svn.apache.org/viewvc/directory/trunks/triplesec/webapp-demo/src/main/resources/org/safehaus/triplesec/demo/view/pages/ChartPage.html?view=auto&rev=486187
==============================================================================
--- directory/trunks/triplesec/webapp-demo/src/main/resources/org/safehaus/triplesec/demo/view/pages/ChartPage.html (added)
+++ directory/trunks/triplesec/webapp-demo/src/main/resources/org/safehaus/triplesec/demo/view/pages/ChartPage.html 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.
+
+-->
+<?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>Safehaus Demo: 401k Funds</title>
+ </wicket:head>
+</head>
+<body>
+ <span wicket:id="border">
+ <img wicket:id="chartImage"/>
+ </span>
+</body>
+</html>
Added: directory/trunks/triplesec/webapp-demo/src/main/resources/org/safehaus/triplesec/demo/view/pages/HomePage.html
URL: http://svn.apache.org/viewvc/directory/trunks/triplesec/webapp-demo/src/main/resources/org/safehaus/triplesec/demo/view/pages/HomePage.html?view=auto&rev=486187
==============================================================================
--- directory/trunks/triplesec/webapp-demo/src/main/resources/org/safehaus/triplesec/demo/view/pages/HomePage.html (added)
+++ directory/trunks/triplesec/webapp-demo/src/main/resources/org/safehaus/triplesec/demo/view/pages/HomePage.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">
+<head>
+ <wicket:head>
+ <title>Safehaus Demo: 401k Funds</title>
+ </wicket:head>
+</head>
+<body>
+ <span wicket:id="border">
+ <span wicket:id="user">mcurie</span>:
+ <span wicket:id="roles">roles</span><br/><br/>
+ <img wicket:id="chartImage"/>
+ <br/><br/><hr/>
+ <span wicket:id="buyPanel">[BUY PANEL]</span>
+ </span>
+</body>
+</html>
Added: directory/trunks/triplesec/webapp-demo/src/main/resources/org/safehaus/triplesec/demo/view/pages/LoginPage.html
URL: http://svn.apache.org/viewvc/directory/trunks/triplesec/webapp-demo/src/main/resources/org/safehaus/triplesec/demo/view/pages/LoginPage.html?view=auto&rev=486187
==============================================================================
--- directory/trunks/triplesec/webapp-demo/src/main/resources/org/safehaus/triplesec/demo/view/pages/LoginPage.html (added)
+++ directory/trunks/triplesec/webapp-demo/src/main/resources/org/safehaus/triplesec/demo/view/pages/LoginPage.html Tue Dec 12 07:23:31 2006
@@ -0,0 +1,33 @@
+<!--
+ 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 Demo Login</title>
+ </wicket:head>
+</head>
+<body>
+ <span wicket:id="border">
+ <span wicket:id="loginPanel">[Login panel here]</span>
+ </span>
+</body>
+</html>
Added: directory/trunks/triplesec/webapp-demo/src/main/resources/org/safehaus/triplesec/demo/view/pages/WapPushPage.html
URL: http://svn.apache.org/viewvc/directory/trunks/triplesec/webapp-demo/src/main/resources/org/safehaus/triplesec/demo/view/pages/WapPushPage.html?view=auto&rev=486187
==============================================================================
--- directory/trunks/triplesec/webapp-demo/src/main/resources/org/safehaus/triplesec/demo/view/pages/WapPushPage.html (added)
+++ directory/trunks/triplesec/webapp-demo/src/main/resources/org/safehaus/triplesec/demo/view/pages/WapPushPage.html Tue Dec 12 07:23:31 2006
@@ -0,0 +1,33 @@
+<!--
+ 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>Safehaus Demo: 401k Funds</title>
+ </wicket:head>
+</head>
+<body>
+ <span wicket:id="border">
+ <span wicket:id="wapPanel">[WAP PANEL]</span>
+ </span>
+</body>
+</html>
Added: directory/trunks/triplesec/webapp-demo/src/main/resources/org/safehaus/triplesec/demo/view/panels/ActionPanel.html
URL: http://svn.apache.org/viewvc/directory/trunks/triplesec/webapp-demo/src/main/resources/org/safehaus/triplesec/demo/view/panels/ActionPanel.html?view=auto&rev=486187
==============================================================================
--- directory/trunks/triplesec/webapp-demo/src/main/resources/org/safehaus/triplesec/demo/view/panels/ActionPanel.html (added)
+++ directory/trunks/triplesec/webapp-demo/src/main/resources/org/safehaus/triplesec/demo/view/panels/ActionPanel.html Tue Dec 12 07:23:31 2006
@@ -0,0 +1,3 @@
+<wicket:panel>
+ <a href="#" wicket:id="view">view</a>
+</wicket:panel>
\ No newline at end of file
Added: directory/trunks/triplesec/webapp-demo/src/main/resources/org/safehaus/triplesec/demo/view/panels/BasePanel.html
URL: http://svn.apache.org/viewvc/directory/trunks/triplesec/webapp-demo/src/main/resources/org/safehaus/triplesec/demo/view/panels/BasePanel.html?view=auto&rev=486187
==============================================================================
--- directory/trunks/triplesec/webapp-demo/src/main/resources/org/safehaus/triplesec/demo/view/panels/BasePanel.html (added)
+++ directory/trunks/triplesec/webapp-demo/src/main/resources/org/safehaus/triplesec/demo/view/panels/BasePanel.html Tue Dec 12 07:23:31 2006
@@ -0,0 +1,30 @@
+<!--
+ 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">
+ <wicket:child/>
+ </span>
+ </wicket:panel>
+</body>
+</html>
Added: directory/trunks/triplesec/webapp-demo/src/main/resources/org/safehaus/triplesec/demo/view/panels/BuyPanel.html
URL: http://svn.apache.org/viewvc/directory/trunks/triplesec/webapp-demo/src/main/resources/org/safehaus/triplesec/demo/view/panels/BuyPanel.html?view=auto&rev=486187
==============================================================================
--- directory/trunks/triplesec/webapp-demo/src/main/resources/org/safehaus/triplesec/demo/view/panels/BuyPanel.html (added)
+++ directory/trunks/triplesec/webapp-demo/src/main/resources/org/safehaus/triplesec/demo/view/panels/BuyPanel.html Tue Dec 12 07:23:31 2006
@@ -0,0 +1,17 @@
+<wicket:extend>
+ <div>
+ <span wicket:id="feedback">[Feedback Panel]</span>
+ </div>
+ <form wicket:id="buyForm">
+ <label for="fund">Fund</label>
+ <select wicket:id="fund" id="fund">
+ <option>Fund A</option>
+ <option>Fund B</option>
+ </select><br/>
+
+ <label for="passcode">Passcode</label>
+ <input wicket:id="passcode" id="passcode" type="password"/><br/>
+
+ <input type="submit" name="submit" value="Submit"/>
+ </form>
+</wicket:extend>
\ No newline at end of file
Added: directory/trunks/triplesec/webapp-demo/src/main/resources/org/safehaus/triplesec/demo/view/panels/LoginPanel.html
URL: http://svn.apache.org/viewvc/directory/trunks/triplesec/webapp-demo/src/main/resources/org/safehaus/triplesec/demo/view/panels/LoginPanel.html?view=auto&rev=486187
==============================================================================
--- directory/trunks/triplesec/webapp-demo/src/main/resources/org/safehaus/triplesec/demo/view/panels/LoginPanel.html (added)
+++ directory/trunks/triplesec/webapp-demo/src/main/resources/org/safehaus/triplesec/demo/view/panels/LoginPanel.html Tue Dec 12 07:23:31 2006
@@ -0,0 +1,51 @@
+<!--
+ 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>
+ You must login to access your account.
+ </p>
+ <div>
+ <span wicket:id="feedback">[Feedback Panel]</span>
+ </div>
+ <div>
+ <label for="realm">Realm</label>
+ <span wicket:id="realm" id="realm">REALM</span>
+ </div>
+ <br/>
+ <form wicket:id="loginForm">
+ <label for="username">Username</label>
+ <input wicket:id="username" id="username" type="text"/><br/>
+
+ <label for="password">Password</label>
+ <input wicket:id="password" id="password" type="password"/><br/>
+
+ <label for="passcode">Passcode</label>
+ <input wicket:id="passcode" id="passcode" type="password"/><br/>
+
+ <label for="mode">Graphics Mode?</label>
+ <input wicket:id="mode" id="mode" type="checkbox" class="boxes"/><br/><br/>
+
+ <input wicket:id="submit" type="submit" name="submit" value="Submit"/>
+ </form>
+ <div>
+ <a href="#" wicket:id="smsLink">Click here to provision a demo account to your handset!</a>
+ </div>
+</wicket:extend>
Added: directory/trunks/triplesec/webapp-demo/src/main/resources/org/safehaus/triplesec/demo/view/panels/WapPushPanel.html
URL: http://svn.apache.org/viewvc/directory/trunks/triplesec/webapp-demo/src/main/resources/org/safehaus/triplesec/demo/view/panels/WapPushPanel.html?view=auto&rev=486187
==============================================================================
--- directory/trunks/triplesec/webapp-demo/src/main/resources/org/safehaus/triplesec/demo/view/panels/WapPushPanel.html (added)
+++ directory/trunks/triplesec/webapp-demo/src/main/resources/org/safehaus/triplesec/demo/view/panels/WapPushPanel.html Tue Dec 12 07:23:31 2006
@@ -0,0 +1,26 @@
+<wicket:extend>
+ <div>
+ <span wicket:id="feedback">[Feedback Panel]</span>
+ </div>
+ <form wicket:id="wapForm">
+ <label for="account">Demo Account</label>
+ <select wicket:id="account" id="account">
+ <option>Account A</option>
+ <option>Account B</option>
+ </select><br/>
+
+ <label for="mobile">Mobile Number</label>
+ <input wicket:id="mobile" id="mobile" type="text" size="10"/><br/>
+ (10 digit US number only)<br/>
+
+ <label for="carrier">Mobile Carrier</label>
+ <select wicket:id="carrier" id="carrier">
+ <option>Carrier A</option>
+ <option>Carrier B</option>
+ </select><br/>
+
+ <input type="submit" name="submit" value="Submit"/>
+ </form>
+ <br/>
+ <a wicket:id="home" href="#">Click here to return to the demo login</a>
+</wicket:extend>
\ No newline at end of file