labs-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hadr...@apache.org
Subject svn commit: r1239761 - in /labs/magnet/flux/src/main: java/org/apache/labs/magnet/flux/FluxApplication.java java/org/apache/labs/magnet/flux/FluxPage.java resources/org/apache/labs/magnet/flux/FluxPage.html
Date Thu, 02 Feb 2012 19:01:00 GMT
Author: hadrian
Date: Thu Feb  2 19:01:00 2012
New Revision: 1239761

URL: http://svn.apache.org/viewvc?rev=1239761&view=rev
Log:
Fix build (incomplete patch)

Modified:
    labs/magnet/flux/src/main/java/org/apache/labs/magnet/flux/FluxApplication.java
    labs/magnet/flux/src/main/java/org/apache/labs/magnet/flux/FluxPage.java
    labs/magnet/flux/src/main/resources/org/apache/labs/magnet/flux/FluxPage.html

Modified: labs/magnet/flux/src/main/java/org/apache/labs/magnet/flux/FluxApplication.java
URL: http://svn.apache.org/viewvc/labs/magnet/flux/src/main/java/org/apache/labs/magnet/flux/FluxApplication.java?rev=1239761&r1=1239760&r2=1239761&view=diff
==============================================================================
--- labs/magnet/flux/src/main/java/org/apache/labs/magnet/flux/FluxApplication.java (original)
+++ labs/magnet/flux/src/main/java/org/apache/labs/magnet/flux/FluxApplication.java Thu Feb
 2 19:01:00 2012
@@ -22,9 +22,12 @@ import org.apache.labs.magnet.flux.sessi
 import org.apache.labs.magnet.flux.session.SignIn;
 
 import org.apache.wicket.Page;
+import org.apache.wicket.Session;
+import org.apache.wicket.authentication.strategy.NoOpAuthenticationStrategy;
 import org.apache.wicket.authroles.authentication.AbstractAuthenticatedWebSession;
 import org.apache.wicket.authroles.authentication.AuthenticatedWebApplication;
 import org.apache.wicket.markup.html.WebPage;
+import org.apache.wicket.request.mapper.BufferedResponseMapper;
 
 public class FluxApplication extends AuthenticatedWebApplication {
 
@@ -33,6 +36,17 @@ public class FluxApplication extends Aut
 	@Override
 	public void init() {
 		super.init();
+
+        mountPage("/index.html", Index.class);
+        mountPage("/index.html", SignIn.class);
+        mount(new BufferedResponseMapper() {
+            protected String getSessionId() {
+                return Session.get().getId();
+            }
+        });
+        // disable unsafe cookie with user/pass
+        getSecuritySettings().setAuthenticationStrategy(new NoOpAuthenticationStrategy());
+
 		service = new DefaultFluxService();
 	}
 

Modified: labs/magnet/flux/src/main/java/org/apache/labs/magnet/flux/FluxPage.java
URL: http://svn.apache.org/viewvc/labs/magnet/flux/src/main/java/org/apache/labs/magnet/flux/FluxPage.java?rev=1239761&r1=1239760&r2=1239761&view=diff
==============================================================================
--- labs/magnet/flux/src/main/java/org/apache/labs/magnet/flux/FluxPage.java (original)
+++ labs/magnet/flux/src/main/java/org/apache/labs/magnet/flux/FluxPage.java Thu Feb  2 19:01:00
2012
@@ -16,12 +16,40 @@
  */
 package org.apache.labs.magnet.flux;
 
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.wicket.AttributeModifier;
+import org.apache.wicket.Page;
 import org.apache.wicket.markup.html.WebPage;
+import org.apache.wicket.markup.html.basic.Label;
+import org.apache.wicket.markup.html.link.BookmarkablePageLink;
+import org.apache.wicket.markup.html.list.ListItem;
+import org.apache.wicket.markup.html.list.ListView;
 
 public class FluxPage extends WebPage {
 	private static final long serialVersionUID = 1L;
 
 	public FluxPage() {
-        // TODO: add navigation
+        List<Class<? extends Page>> links = new ArrayList<Class<? extends
Page>>();
+        links.add(Index.class);
+
+        add(new ListView<Class<? extends Page>>("menu", links) {
+			private static final long serialVersionUID = 1L;
+
+			@Override
+            protected void populateItem(ListItem<Class<? extends Page>> item)
{
+                BookmarkablePageLink<Page> link = new BookmarkablePageLink<Page>("link",
item.getModelObject());
+
+                String simpleName = item.getModelObject().getSimpleName();
+
+                if (getPage().getClass().equals(item.getModelObject())) {
+                    item.add(AttributeModifier.append("class", "active"));
+                }
+
+                link.add(new Label("label", simpleName));
+                item.add(link);
+            }
+        });
 	}
 }
\ No newline at end of file

Modified: labs/magnet/flux/src/main/resources/org/apache/labs/magnet/flux/FluxPage.html
URL: http://svn.apache.org/viewvc/labs/magnet/flux/src/main/resources/org/apache/labs/magnet/flux/FluxPage.html?rev=1239761&r1=1239760&r2=1239761&view=diff
==============================================================================
--- labs/magnet/flux/src/main/resources/org/apache/labs/magnet/flux/FluxPage.html (original)
+++ labs/magnet/flux/src/main/resources/org/apache/labs/magnet/flux/FluxPage.html Thu Feb
 2 19:01:00 2012
@@ -12,9 +12,16 @@
       <div id="logo">
         <img src="img/logo.png" height="63px" border="0" align="" alt="logo" title="Apache
Magnet">
       </div>
-      <div class="top-right">
-        <span class="user">jdoe@apache.org</span>
-        <span class="top-menu"><a href="#">Sign In</a></span>
+      <div id="main-menu" class="top-right">
+        <ul>
+          <li wicket:id="menu">
+            <a wicket:id="link">
+              <span wicket:id="label">Label</span>
+            </a>
+          </li>
+        </ul>
+        <!-- span class="user">jdoe@apache.org</span>
+        <span class="top-menu"><a href="#">Sign In</a></span -->
       </div>
     </div>
     <div id="page" class="">



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@labs.apache.org
For additional commands, e-mail: commits-help@labs.apache.org


Mime
View raw message