Author: dan.j.allen
Date: 2009-10-27 14:51:33 -0400 (Tue, 27 Oct 2009)
New Revision: 4353
Added:
examples/trunk/jsf/permalink/
examples/trunk/jsf/permalink/pom.xml
examples/trunk/jsf/permalink/readme.txt
examples/trunk/jsf/permalink/src/
examples/trunk/jsf/permalink/src/main/
examples/trunk/jsf/permalink/src/main/java/
examples/trunk/jsf/permalink/src/main/java/org/
examples/trunk/jsf/permalink/src/main/java/org/jboss/
examples/trunk/jsf/permalink/src/main/java/org/jboss/weld/
examples/trunk/jsf/permalink/src/main/java/org/jboss/weld/examples/
examples/trunk/jsf/permalink/src/main/java/org/jboss/weld/examples/permalink/
examples/trunk/jsf/permalink/src/main/java/org/jboss/weld/examples/permalink/Blog.java
examples/trunk/jsf/permalink/src/main/java/org/jboss/weld/examples/permalink/BlogEntry.java
examples/trunk/jsf/permalink/src/main/java/org/jboss/weld/examples/permalink/BlogEntryRepository.java
examples/trunk/jsf/permalink/src/main/java/org/jboss/weld/examples/permalink/Comment.java
examples/trunk/jsf/permalink/src/main/java/org/jboss/weld/examples/permalink/CommentBoard.java
examples/trunk/jsf/permalink/src/main/resources/
examples/trunk/jsf/permalink/src/main/resources/META-INF/
examples/trunk/jsf/permalink/src/main/resources/META-INF/beans.xml
examples/trunk/jsf/permalink/src/main/resources/log4j.xml
examples/trunk/jsf/permalink/src/main/webapp/
examples/trunk/jsf/permalink/src/main/webapp/META-INF/
examples/trunk/jsf/permalink/src/main/webapp/META-INF/context.xml
examples/trunk/jsf/permalink/src/main/webapp/WEB-INF/
examples/trunk/jsf/permalink/src/main/webapp/WEB-INF/faces-config.xml
examples/trunk/jsf/permalink/src/main/webapp/WEB-INF/fragments/
examples/trunk/jsf/permalink/src/main/webapp/WEB-INF/fragments/categories.xhtml
examples/trunk/jsf/permalink/src/main/webapp/WEB-INF/fragments/comments.xhtml
examples/trunk/jsf/permalink/src/main/webapp/WEB-INF/fragments/commonViewParams.xhtml
examples/trunk/jsf/permalink/src/main/webapp/WEB-INF/fragments/entryContent.xhtml
examples/trunk/jsf/permalink/src/main/webapp/WEB-INF/fragments/entryList.xhtml
examples/trunk/jsf/permalink/src/main/webapp/WEB-INF/fragments/otherCategories.xhtml
examples/trunk/jsf/permalink/src/main/webapp/WEB-INF/fragments/singleEntry.xhtml
examples/trunk/jsf/permalink/src/main/webapp/WEB-INF/jetty-env.xml
examples/trunk/jsf/permalink/src/main/webapp/WEB-INF/layout/
examples/trunk/jsf/permalink/src/main/webapp/WEB-INF/layout/template.xhtml
examples/trunk/jsf/permalink/src/main/webapp/WEB-INF/web.xml
examples/trunk/jsf/permalink/src/main/webapp/category.xhtml
examples/trunk/jsf/permalink/src/main/webapp/css/
examples/trunk/jsf/permalink/src/main/webapp/css/legacy.css
examples/trunk/jsf/permalink/src/main/webapp/css/style.css
examples/trunk/jsf/permalink/src/main/webapp/entry.xhtml
examples/trunk/jsf/permalink/src/main/webapp/favicon.ico
examples/trunk/jsf/permalink/src/main/webapp/home.xhtml
examples/trunk/jsf/permalink/src/main/webapp/img/
examples/trunk/jsf/permalink/src/main/webapp/img/bodybg.gif
examples/trunk/jsf/permalink/src/main/webapp/img/headerbg.gif
examples/trunk/jsf/permalink/src/main/webapp/img/rss.gif
examples/trunk/jsf/permalink/src/main/webapp/img/search.png
examples/trunk/jsf/permalink/src/main/webapp/img/searchbg.gif
examples/trunk/jsf/permalink/src/main/webapp/img/technorati.gif
examples/trunk/jsf/permalink/src/main/webapp/img/wgradient.png
examples/trunk/jsf/permalink/src/main/webapp/img/wrapper.gif
examples/trunk/jsf/permalink/src/main/webapp/index.html
examples/trunk/jsf/permalink/src/test/
examples/trunk/jsf/permalink/src/test/java/
examples/trunk/jsf/permalink/src/test/resources/
Log:
add permalink example
Property changes on: examples/trunk/jsf/permalink
___________________________________________________________________
Name: svn:ignore
+ .classpath
.project
.settings
target
Added: examples/trunk/jsf/permalink/pom.xml
===================================================================
--- examples/trunk/jsf/permalink/pom.xml (rev 0)
+++ examples/trunk/jsf/permalink/pom.xml 2009-10-27 18:51:33 UTC (rev 4353)
@@ -0,0 +1,319 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project
xmlns="http://maven.apache.org/POM/4.0.0"
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.jboss.weld.examples</groupId>
+ <artifactId>weld-examples-parent</artifactId>
+ <version>1.0.0-CR1</version>
+ <relativePath>../../pom.xml</relativePath>
+ </parent>
+
+ <groupId>org.jboss.weld.examples.jsf</groupId>
+ <artifactId>weld-jsf-permalink</artifactId>
+ <packaging>war</packaging>
+ <name>Weld Permalink Example (Servlet)</name>
+ <description>The Weld permalink example for deployment to a servlet
environment</description>
+
+ <properties>
+ <jetty.http.port>9090</jetty.http.port>
+ <jetty.stop.port>9091</jetty.stop.port>
+ <jetty.debug.port>9190</jetty.debug.port>
+ <jetty.daemon>false</jetty.daemon>
+ <tomcat.http.port>8080</tomcat.http.port>
+ <embedded-tomcat.http.port>9090</embedded-tomcat.http.port>
+ <embedded-tomcat.debug.port>9190</embedded-tomcat.debug.port>
+ <webapp.directory>src/main/webapp</webapp.directory>
+ </properties>
+
+ <pluginRepositories>
+ <pluginRepository>
+ <id>codehaus repository</id>
+ <
url>http://repository.codehaus.org/</url>
+ <releases>
+ <enabled>true</enabled>
+ </releases>
+ </pluginRepository>
+ </pluginRepositories>
+
+ <dependencies>
+
+ <dependency>
+ <groupId>org.testng</groupId>
+ <artifactId>testng</artifactId>
+ <scope>test</scope>
+ <classifier>jdk15</classifier>
+ </dependency>
+
+ <dependency>
+ <groupId>javax.annotation</groupId>
+ <artifactId>jsr250-api</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>javax.enterprise</groupId>
+ <artifactId>cdi-api</artifactId>
+ <scope>provided</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>javax.faces</groupId>
+ <artifactId>jsf-api</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>javax.faces</groupId>
+ <artifactId>jsf-impl</artifactId>
+ <scope>runtime</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>javax.servlet</groupId>
+ <artifactId>jstl</artifactId>
+ <scope>runtime</scope>
+ </dependency>
+
+ <dependency>
+ <!-- needed for reference by maven-eclipse-plugin -->
+ <groupId>javax.servlet</groupId>
+ <artifactId>servlet-api</artifactId>
+ <scope>provided</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>javax.transaction</groupId>
+ <artifactId>jta</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>javax.validation</groupId>
+ <artifactId>validation-api</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>log4j</groupId>
+ <artifactId>log4j</artifactId>
+ <scope>runtime</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.hibernate</groupId>
+ <artifactId>hibernate-validator</artifactId>
+ <version>4.0.0.GA</version>
+ <scope>runtime</scope>
+ <exclusions>
+ <exclusion>
+ <groupId>javax.xml.bind</groupId>
+ <artifactId>jaxb-api</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>com.sun.xml.bind</groupId>
+ <artifactId>jaxb-impl</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-log4j12</artifactId>
+ <version>1.5.6</version>
+ <scope>runtime</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.weld.servlet</groupId>
+ <artifactId>weld-servlet</artifactId>
+ <scope>runtime</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.glassfish.web</groupId>
+ <artifactId>el-impl</artifactId>
+ <scope>runtime</scope>
+ <exclusions>
+ <exclusion>
+ <groupId>javax.el</groupId>
+ <artifactId>el-api</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+
+ </dependencies>
+
+ <build>
+ <defaultGoal>package</defaultGoal>
+ <!--
+ <finalName>${project.artifactId}</finalName>
+ -->
+ <finalName>weld-permalink</finalName>
+ <plugins>
+
+ <plugin>
+ <artifactId>maven-clean-plugin</artifactId>
+ <configuration>
+ <failOnError>false</failOnError>
+ <filesets>
+ <fileset>
+ <!-- clean up files from war:inplace -->
+ <directory>${webapp.directory}</directory>
+ <includes>
+ <include>WEB-INF/classes/**</include>
+ <include>WEB-INF/lib/**</include>
+ </includes>
+ <followSymlinks>false</followSymlinks>
+ </fileset>
+ </filesets>
+ </configuration>
+ </plugin>
+
+ <plugin>
+ <artifactId>maven-eclipse-plugin</artifactId>
+ <configuration>
+ <additionalBuildcommands>
+ <!-- annoyingly creates a bin directory
+ <buildCommand>
+
<name>org.eclipse.wst.jsdt.core.javascriptValidator</name>
+ </buildCommand>
+ -->
+ <buildCommand>
+
<name>org.jboss.tools.common.verification.verifybuilder</name>
+ </buildCommand>
+ </additionalBuildcommands>
+ <additionalConfig>
+ <file>
+ <name>.settings/org.maven.ide.eclipse.prefs</name>
+ <content>activeProfiles=jdk5
+eclipse.preferences.version=1
+fullBuildGoals=process-test-resources
+includeModules=false
+resolveWorkspaceProjects=true
+resourceFilterGoals=process-resources resources\:testResources
+skipCompilerPlugin=true
+version=1</content>
+ </file>
+ </additionalConfig>
+ <additionalProjectFacets>
+ <jst.jsf>1.2</jst.jsf> <!-- 2.0 is not yet supported
-->
+ </additionalProjectFacets>
+ <additionalProjectnatures>
+
<projectnature>org.eclipse.wst.jsdt.core.jsNature</projectnature>
+
<projectnature>org.jboss.tools.jsf.jsfnature</projectnature>
+ </additionalProjectnatures>
+ <workspace>${user.home}/.eclipse/workspace</workspace>
+ <wtpdefaultserver>JBoss</wtpdefaultserver>
+ <wtpversion>1.5</wtpversion>
+ </configuration>
+ </plugin>
+
+ <plugin>
+ <artifactId>maven-war-plugin</artifactId>
+ <configuration>
+ <!-- don't stage or package files added to ${webapp.directory} by
war:inplace -->
+
<warSourceExcludes>WEB-INF/classes/**,WEB-INF/lib/**</warSourceExcludes>
+ </configuration>
+ </plugin>
+
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>tomcat-maven-plugin</artifactId>
+ <configuration>
+ <path>/${project.build.finalName}</path>
+ <!-- uncomment to use server configuration override; see readme.txt for
details -->
+ <!--<server>tomcatserver</server>-->
+ <url>http://localhost:${tomcat.http.port}/manager</url>
+ <port>${embedded-tomcat.http.port}</port> <!-- port for
embedded Tomcat only (putting this configuration in the execution for the run goal
doesn't work) -->
+ <!-- if you don't want to use war:inplace, uncomment this setting
-->
+ <!--
+
<warSourceDirectory>${project.build.directory}/${project.build.finalName}</warSourceDirectory>
+ -->
+ </configuration>
+ </plugin>
+
+ <plugin>
+ <groupId>org.mortbay.jetty</groupId>
+ <artifactId>maven-jetty-plugin</artifactId>
+ <configuration>
+ <connectors>
+ <connector
implementation="org.mortbay.jetty.nio.SelectChannelConnector">
+ <port>${jetty.http.port}</port>
+ <maxIdleTime>3600000</maxIdleTime>
+ </connector>
+ </connectors>
+ <daemon>${jetty.daemon}</daemon>
+ <stopPort>${jetty.stop.port}</stopPort>
+ <stopKey>HASTA_LA_VISTA</stopKey>
+ <scanIntervalSeconds>10</scanIntervalSeconds>
+ <webAppConfig>
+ <contextPath>/${project.build.finalName}</contextPath>
+ </webAppConfig>
+ <!-- if you don't want to use war:inplace, uncomment this setting
-->
+ <!--
+
<webAppSourceDirectory>${project.build.directory}/${project.build.finalName}</webAppSourceDirectory>
+ -->
+ </configuration>
+ </plugin>
+
+ <plugin>
+ <groupId>org.twdata.maven</groupId>
+ <artifactId>maven-cli-plugin</artifactId>
+ <version>0.6.3.CR3</version>
+ <configuration>
+ <prompt>${project.artifactId}</prompt>
+ <!-- userAliases are for cli:execute-phase -->
+ <userAliases>
+ <runjetty>compile
org.apache.maven.plugins:maven-war-plugin:inplace
org.mortbay.jetty:maven-jetty-plugin:run</runjetty>
+
<stopjetty>org.mortbay.jetty:maven-jetty-plugin:stop</stopjetty>
+ <runtomcat>compile
org.apache.maven.plugins:maven-war-plugin:inplace
org.codehaus.mojo:tomcat-maven-plugin:run</runtomcat>
+ <explode>compile
org.apache.maven.plugins:maven-war-plugin:inplace -o</explode>
+ <restart>org.apache.maven.plugins:maven-antrun-plugin:run
-Prestart-embedded</restart>
+ <!--<restart>validate -Prestart-embedded
-o</restart>-->
+
<profiles>org.apache.maven.plugins:maven-help-plugin:active-profiles
-o</profiles>
+ <pom>org.apache.maven.plugins:maven-help-plugin:effective-pom
-o</pom>
+ </userAliases>
+ <!-- commands are for cli:execute -->
+ <commands>
+ </commands>
+ </configuration>
+ </plugin>
+
+ </plugins>
+ </build>
+
+ <profiles>
+ <profile>
+ <id>restart-embedded</id>
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>maven-antrun-plugin</artifactId>
+ <configuration>
+ <tasks>
+ <touch
file="${webapp.directory}/WEB-INF/web.xml"/>
+ </tasks>
+ </configuration>
+ <!-- Hooking an execution to a phase is more correct, but slower
-->
+ <!--
+ <executions>
+ <execution>
+ <id>touch-web-inf</id>
+ <phase>validate</phase>
+ <configuration>
+ <tasks>
+ <touch
file="${webapp.directory}/WEB-INF/web.xml"/>
+ </tasks>
+ </configuration>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ </execution>
+ </executions>
+ -->
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+ </profiles>
+
+</project>
Added: examples/trunk/jsf/permalink/readme.txt
===================================================================
--- examples/trunk/jsf/permalink/readme.txt (rev 0)
+++ examples/trunk/jsf/permalink/readme.txt 2009-10-27 18:51:33 UTC (rev 4353)
@@ -0,0 +1,98 @@
+Weld Permalink Example (Servlet Environment)
+============================================
+
+This example demonstrates the use of Weld in a Servlet environment (Tomcat 6
+/ Jetty 6). Contextual state management and dependency injection are handled by
+JSR-299. Transaction and persistence context management is handled by the EJB 3
+container. No alterations are required to be made to the Servlet container. All
+services are self-contained within the deployment.
+
+This example uses a Maven 2 build. Execute the following command to build the
+WAR. The WAR will will be located in the target directory after completion of
+the build.
+
+ mvn
+
+Now you are ready to deploy.
+
+== Deploying with an embedded servlet container
+
+Run this command to execute the application in an embedded Jetty 6 container:
+
+ mvn war:inplace jetty:run
+
+You can also execute the application in an embedded Tomcat 6 container:
+
+ mvn war:inplace tomcat:run
+
+In both cases, any changes to assets in src/main/webapp take affect
+immediately. If a change to a webapp configuration file is made, the
+application may automatically redeploy. The redeploy behavior can be fined
+tuned in the plugin configuration (at least for Jetty). If you make a change
+to a classpath resource, you need to execute a build:
+
+ mvn compile war:inplace
+
+Note that war:inplace copies the compiled classes and JARs inside WebContent,
+under WEB-INF/classes and WEB-INF/lib, respectively, mixing source and compiled
+files. However, the build does work around these temporary files by excluding
+them from the packaged WAR and cleaning them during the Maven clean phase.
+These folders are also ignored by SVN.
+
+== Deploying to standalone Tomcat
+
+If you want to run the application on a standalone Tomcat 6, first download and
+extract Tomcat 6. This build assumes you will be running Tomcat in its default
+configuration, with a hostname of localhost and port 8080. Before starting
+Tomcat, add the following line to conf/tomcat-users.xml to allow the Maven
+Tomcat plugin to access the manager application, then start Tomcat:
+
+ <user username="admin" password=""
roles="manager"/>
+
+To override this username and password, add a <server> with id tomcat in your
+Maven 2 settings.xml file, set the <username> and <password> elements to the
+appropriate values and uncomment the <server> element inside the
+tomcat-maven-plugin configuration in the pom.xml.
+
+You can deploy the packaged archive to Tomcat via HTTP PUT using this command:
+
+ mvn package tomcat:deploy
+
+Then you use this command to undeploy the application:
+
+ mvn tomcat:undeploy
+
+Instead of packaging the WAR, you can deploy it as an exploded archive
+immediately after the war goal is finished assembling the exploded structure:
+
+ mvn compile war:exploded tomcat:exploded
+
+Once the application is deployed, you can redeploy it using the following command:
+
+ mvn tomcat:redeploy
+
+But likely you want to run one or more build goals first before you redeploy:
+
+ mvn compile tomcat:redeploy
+ mvn war:exploded tomcat:redeploy
+ mvn compile war:exploded tomcat:redeploy
+
+= Importing the project into Eclipse
+
+The recommended way to setup a Seam example in Eclipse is to use the m2eclipse
+plugin. This plugin derives the build classpath from the dependencies listed in
+the pom.xml file. It also has direct integration with Maven build commands.
+
+To get started open Eclipse and import the project by selecting "Maven
+Projects" and browsing to the project folder. You can now develop the project
+in Eclipse just like any other project.
+
+You could also prepare the Eclipse project before hand, then import the project
+into Eclipse. First, transform the pom.xml into an m2eclipse Eclipse project
+using this command:
+
+ mvn eclipse:m2eclipse
+
+Now go into Eclipse an import the project by selecting "Existing projects into
+workspace" and selecting the project folder. Both approaches use the Eclipse
+project configuration defined in the pom.xml file.
Added:
examples/trunk/jsf/permalink/src/main/java/org/jboss/weld/examples/permalink/Blog.java
===================================================================
---
examples/trunk/jsf/permalink/src/main/java/org/jboss/weld/examples/permalink/Blog.java
(rev 0)
+++
examples/trunk/jsf/permalink/src/main/java/org/jboss/weld/examples/permalink/Blog.java 2009-10-27
18:51:33 UTC (rev 4353)
@@ -0,0 +1,322 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2009, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.weld.examples.permalink;
+
+import java.util.ArrayList;
+import java.util.LinkedHashSet;
+import java.util.List;
+import java.util.Set;
+
+import javax.enterprise.context.RequestScoped;
+import javax.inject.Inject;
+import javax.inject.Named;
+
+/**
+ * @author Dan Allen
+ */
+public
+@Named
+@RequestScoped
+class Blog
+{
+ private static final int PAGE_SIZE = 3;
+
+ @Inject BlogEntryRepository repository;
+
+ private Long entryId;
+
+ private String category;
+
+ private BlogEntry entry;
+
+ private List<BlogEntry> entriesForPage;
+
+ private List<String> categories;
+
+ private boolean nextPageAvailable;
+
+ private int page = 1;
+
+ private String searchString;
+
+ public Long getEntryId()
+ {
+ return entryId;
+ }
+
+ public void setEntryId(Long entryId)
+ {
+ this.entryId = entryId;
+ }
+
+ public String getCategory()
+ {
+ return category;
+ }
+
+ public void setCategory(String category)
+ {
+ this.category = category;
+ }
+
+ public String getSearchString()
+ {
+ // return null to prevent page param from being encoded when not necessary
+ return searchString == null || searchString.length() == 0 ? null : searchString;
+ }
+
+ public void setSearchString(String searchString)
+ {
+ if (searchString != null)
+ {
+ searchString = searchString.trim();
+ }
+ this.searchString = searchString;
+ }
+
+ public Integer getPage()
+ {
+ // return null to prevent page param from being encoded when not necessary
+ return page == 1 ? null : page;
+ }
+
+ public void setPage(Integer page)
+ {
+ // NOTE if we were to use a primitive propery, page parameters would fail if value
is null
+ if (page == null)
+ {
+ this.page = 1;
+ }
+ else if (page < 1)
+ {
+ throw new IllegalArgumentException("Page must be greater than or equal to
1");
+ }
+ else
+ {
+ this.page = page;
+ }
+ }
+
+ public void loadCategories()
+ {
+ categories = retrieveCategories();
+ }
+
+ /**
+ * Init method for the main blog page
+ */
+ public void loadLatestEntries()
+ {
+ loadCategories();
+ entriesForPage = (searchString != null ? retrieveSearchResults() :
retrieveLatestEntries());
+ }
+
+ /**
+ * Init method for a category page
+ */
+ public void loadLatestEntriesInCategory()
+ {
+ loadCategories();
+ if (categories.contains(category))
+ {
+ entriesForPage = (searchString != null ? retrieveSearchResultsInCategory() :
retrieveLatestEntriesInCategory());
+ }
+ else
+ {
+ category = null;
+ }
+ }
+
+ /**
+ * Init method for an entry page
+ */
+ public void loadEntry()
+ {
+ loadCategories();
+ entry = retrieveSelectedEntry();
+ }
+
+ public boolean search()
+ {
+ page = 1;
+ return true;
+ }
+
+ /**
+ * Retrieves the catagories used in this blog. This method references preloaded
+ * data and is intended to be used in the EL value expressions in the view template.
+ */
+ public List<String> getCategories()
+ {
+ return categories;
+ }
+
+ /**
+ * Retrieves the categories used in this blog other than the selected one. This
+ * method references preloaded data and is intended to be used in the EL value
+ * expressions in the view template.
+ */
+ public List<String> getOtherCategories()
+ {
+ List<String> others = new ArrayList<String>();
+ // defensive here because of postback decodes grrr..
+ if (categories != null)
+ {
+ others.addAll(categories);
+ others.remove(category);
+ }
+ return others;
+ }
+
+ /**
+ * Retrieves the entries loaded for this page. This method references preloaded
+ * data and is intended to be used in EL value expressions in the view template.
+ */
+ public List<BlogEntry> getEntriesForPage()
+ {
+ return entriesForPage;
+ }
+
+ public Set<BlogEntry> getEntriesForPageAsSet()
+ {
+ return new LinkedHashSet(entriesForPage);
+ }
+
+ public int getNumEntriesOnPage()
+ {
+ return entriesForPage.size();
+ }
+
+ /**
+ * Retrieves the entry loaded for this page. This method references preloaded
+ * data and is intended to be used in EL value expressions in the view template.
+ */
+ public BlogEntry getEntry()
+ {
+ return entry;
+ }
+
+ public int getPreviousPageWithFirstPageAsNumber()
+ {
+ assert page > 1;
+ return page - 1;
+ }
+
+ public Integer getPreviousPage()
+ {
+ assert page > 1;
+ return page > 2 ? page - 1 : null;
+ }
+
+ public int getPageWithFirstPageAsNumber()
+ {
+ return page;
+ }
+
+ public int getNextPage()
+ {
+ return page + 1;
+ }
+
+ public boolean isNextPageAvailable()
+ {
+ return nextPageAvailable;
+ }
+
+ public boolean isPreviousPageAvailable()
+ {
+ return page > 1;
+ }
+
+ protected List<BlogEntry> retrieveLatestEntries()
+ {
+ List<BlogEntry> entries = repository.getLatestEntries((page - 1) * PAGE_SIZE,
PAGE_SIZE + 1);
+ if (entries.isEmpty() && page > 1)
+ {
+ page = 1;
+ entries = repository.getLatestEntries(0, PAGE_SIZE + 1);
+ }
+
+ return postProcessNavigationProbe(entries);
+ }
+
+ protected List<BlogEntry> retrieveSearchResults()
+ {
+ List<BlogEntry> entries = repository.searchEntries(searchString, (page - 1) *
PAGE_SIZE, PAGE_SIZE + 1);
+ if (entries.isEmpty() && page > 1)
+ {
+ page = 1;
+ entries = repository.searchEntries(searchString, 0, PAGE_SIZE + 1);
+ }
+
+ return postProcessNavigationProbe(entries);
+ }
+
+ protected List<BlogEntry> retrieveLatestEntriesInCategory()
+ {
+ List<BlogEntry> entries = repository.getLatestEntries(category, (page - 1) *
PAGE_SIZE, PAGE_SIZE + 1);
+ if (entries.isEmpty() && page > 1)
+ {
+ page = 1;
+ entries = repository.getLatestEntries(category, 0, PAGE_SIZE + 1);
+ }
+
+ return postProcessNavigationProbe(entries);
+ }
+
+ protected List<BlogEntry> retrieveSearchResultsInCategory()
+ {
+ List<BlogEntry> entries = repository.searchEntries(searchString, category,
(page - 1) * PAGE_SIZE, PAGE_SIZE + 1);
+ if (entries.isEmpty() && page > 1)
+ {
+ page = 1;
+ entries = repository.searchEntries(searchString, category, 0, PAGE_SIZE + 1);
+ }
+
+ return postProcessNavigationProbe(entries);
+ }
+
+ private List<BlogEntry> postProcessNavigationProbe(List<BlogEntry>
entries)
+ {
+ if (entries.size() > PAGE_SIZE)
+ {
+ nextPageAvailable = true;
+ entries.remove(entries.size() - 1);
+ }
+ else
+ {
+ nextPageAvailable = false;
+ }
+
+ return entries;
+ }
+
+ protected BlogEntry retrieveSelectedEntry()
+ {
+ return repository.getEntry(entryId);
+ }
+
+ protected List<String> retrieveCategories()
+ {
+ return repository.getCategories();
+ }
+}
Added:
examples/trunk/jsf/permalink/src/main/java/org/jboss/weld/examples/permalink/BlogEntry.java
===================================================================
---
examples/trunk/jsf/permalink/src/main/java/org/jboss/weld/examples/permalink/BlogEntry.java
(rev 0)
+++
examples/trunk/jsf/permalink/src/main/java/org/jboss/weld/examples/permalink/BlogEntry.java 2009-10-27
18:51:33 UTC (rev 4353)
@@ -0,0 +1,147 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2009, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.weld.examples.permalink;
+
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+
+/**
+ * @author Dan Allen
+ */
+public class BlogEntry
+{
+ private Long id;
+
+ private String author;
+
+ private String category;
+
+ private String title;
+
+ private Date postDate;
+
+ private String body;
+
+ private List<String> tags;
+
+ private List<Comment> comments = new ArrayList<Comment>();
+
+ public BlogEntry()
+ {
+ }
+
+ public BlogEntry(Long id, String author, String category, String title, Date postDate,
String body)
+ {
+ this.id = id;
+ this.author = author;
+ this.category = category;
+ this.title = title;
+ this.body = body;
+ this.postDate = postDate;
+ }
+
+ public String getAuthor()
+ {
+ return author;
+ }
+
+ public void setAuthor(String author)
+ {
+ this.author = author;
+ }
+
+ public String getBody()
+ {
+ return body;
+ }
+
+ public void setBody(String body)
+ {
+ this.body = body;
+ }
+
+ public String getCategory()
+ {
+ return category;
+ }
+
+ public void setCategory(String category)
+ {
+ this.category = category;
+ }
+
+ public Long getId()
+ {
+ return id;
+ }
+
+ public void setId(Long id)
+ {
+ this.id = id;
+ }
+
+ public Date getPostDate()
+ {
+ return postDate;
+ }
+
+ public void setPostDate(Date postDate)
+ {
+ this.postDate = postDate;
+ }
+
+ public List<String> getTags()
+ {
+ return tags;
+ }
+
+ public void setTags(List<String> tags)
+ {
+ this.tags = tags;
+ }
+
+ public String getTitle()
+ {
+ return title;
+ }
+
+ public void setTitle(String title)
+ {
+ this.title = title;
+ }
+
+ public List<Comment> getComments()
+ {
+ return comments;
+ }
+
+ public void setComments(List<Comment> comments)
+ {
+ this.comments = comments;
+ }
+
+ public int getNumComments()
+ {
+ return comments == null ? 0 : comments.size();
+ }
+}
Added:
examples/trunk/jsf/permalink/src/main/java/org/jboss/weld/examples/permalink/BlogEntryRepository.java
===================================================================
---
examples/trunk/jsf/permalink/src/main/java/org/jboss/weld/examples/permalink/BlogEntryRepository.java
(rev 0)
+++
examples/trunk/jsf/permalink/src/main/java/org/jboss/weld/examples/permalink/BlogEntryRepository.java 2009-10-27
18:51:33 UTC (rev 4353)
@@ -0,0 +1,264 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2009, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.weld.examples.permalink;
+
+import java.text.DateFormat;
+import java.text.ParseException;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Comparator;
+import java.util.Date;
+import java.util.List;
+import java.util.Locale;
+import java.util.concurrent.atomic.AtomicLong;
+
+import javax.annotation.PostConstruct;
+import javax.enterprise.context.ApplicationScoped;
+
+/**
+ * @author Dan Allen
+ */
+public
+@ApplicationScoped
+class BlogEntryRepository
+{
+ private static AtomicLong uniqueEntryId = new AtomicLong(0);
+
+ private static AtomicLong uniqueCommentId = new AtomicLong(0);
+
+ private final List<BlogEntry> entries;
+
+ private DateFormat dateParser;
+
+ public BlogEntryRepository()
+ {
+ entries = new ArrayList<BlogEntry>();
+ }
+
+ @PostConstruct
+ public void seed()
+ {
+ entries.add(new BlogEntry(uniqueEntryId.incrementAndGet(), "Dan",
"General", "My first post", parseDate("15/01/09 13:30"),
"This is the obligatory first post."));
+ entries.add(new BlogEntry(uniqueEntryId.incrementAndGet(), "Dan",
"JSF 2", "View parameters", parseDate("16/01/09 15:12"),
"One of the new features in JSF 2 is view parameters. If you are familiar with Seam,
you will recognize them as page parameters. They bring the value binding concept to GET
requests by allowing you to associate a request parameter with a EL value binding
expression. You can witness view parameters in action in this demo. View parameters are
especially useful for ensuring that the URL is always bookmarkable throughout the
user's browsing session."));
+ entries.add(new BlogEntry(uniqueEntryId.incrementAndGet(), "Dan",
"JSF 2", "Bookmarkable links", parseDate("18/01/09 14:45"),
"JSF finally has bookmarkable links. No more complaining that \"everything is a
POST!\""));
+ entries.add(new BlogEntry(uniqueEntryId.incrementAndGet(), "Dan",
"Java EE", "What's new in Java EE 6", parseDate("20/01/09
08:15"), "JSF 2, JPA 2, EJB 3.1, Java Contexts and Dependency Injection
(formally Web Beans) and more!"));
+ entries.add(new BlogEntry(uniqueEntryId.incrementAndGet(), "Dan",
"JSF 2", "Annotation nation", parseDate("22/01/09 10:34"),
"You can finally free yourself from the tangles of XML and use annotations to define
your managed beans. You put @ManagedBean on a class to define a managed bean and you
annotate a field with @ManagedProperty to wire two beans together. If those annotations
aren't enough to satisfy you, then check out JSR-299: Java Contexts and Dependency
Injection. That spec uses annotations extensively and is a drop-in replacement for the JSF
managed bean facility...and a much more capabable one at that!"));
+ entries.add(new BlogEntry(uniqueEntryId.incrementAndGet(), "Dan",
"JSF 2", "Mojarra == RI", parseDate("25/01/09 11:00"),
"The JSF reference implementation finally has a name: Mojarra. Surprise, it's the
name of a fish."));
+ Collections.sort(entries, new Comparator<BlogEntry>()
+ {
+ public int compare(BlogEntry a, BlogEntry b)
+ {
+ return b.getPostDate().compareTo(a.getPostDate());
+ }
+ });
+ }
+
+ public List<BlogEntry> searchEntries(String searchString, int offset, int
count)
+ {
+ if (count == 0)
+ {
+ return Collections.<BlogEntry>emptyList();
+ }
+
+ if (searchString == null || searchString.trim().length() == 0)
+ {
+ return getLatestEntries(offset, count);
+ }
+
+ searchString = searchString.trim().toLowerCase();
+
+ List<BlogEntry> results = new ArrayList<BlogEntry>();
+ int idx = 0;
+ for (BlogEntry entry : entries)
+ {
+ if ((entry.getTitle().toLowerCase().contains(searchString) ||
entry.getBody().toLowerCase().contains(searchString)) &&
+ idx++ >= offset)
+ {
+ results.add(entry);
+ if (results.size() == count)
+ {
+ return results;
+ }
+ }
+ }
+
+ return results;
+ }
+
+ public List<BlogEntry> searchEntries(String searchString, String category, int
offset, int count)
+ {
+ if (count == 0)
+ {
+ return Collections.<BlogEntry>emptyList();
+ }
+
+ if (category == null || category.trim().length() == 0)
+ {
+ return searchEntries(searchString, offset, count);
+ }
+
+ if (searchString == null || searchString.trim().length() == 0)
+ {
+ return getLatestEntries(offset, count);
+ }
+
+ category = category.trim();
+ searchString = searchString.trim().toLowerCase();
+
+ List<BlogEntry> results = new ArrayList<BlogEntry>();
+ int idx = 0;
+ for (BlogEntry entry : entries)
+ {
+ if (entry.getCategory().equals(category) &&
+ (entry.getTitle().toLowerCase().contains(searchString) ||
entry.getBody().toLowerCase().contains(searchString)) &&
+ idx++ >= offset)
+ {
+ results.add(entry);
+ if (results.size() == count)
+ {
+ return results;
+ }
+ }
+ }
+
+ return results;
+ }
+
+ public List<BlogEntry> getLatestEntries(String category, int offset, int count)
+ {
+ if (count == 0)
+ {
+ return Collections.<BlogEntry>emptyList();
+ }
+
+ if (category == null || category.trim().length() == 0)
+ {
+ return getLatestEntries(offset, count);
+ }
+
+ category = category.trim();
+
+ List<BlogEntry> results = new ArrayList<BlogEntry>();
+ int idx = 0;
+ for (BlogEntry entry : entries)
+ {
+ if (entry.getCategory().equals(category) && idx++ >= offset)
+ {
+ results.add(entry);
+ if (results.size() == count)
+ {
+ return results;
+ }
+ }
+ }
+
+ return results;
+ }
+
+ public List<BlogEntry> getLatestEntries(int offset, int count)
+ {
+ if (count == 0)
+ {
+ return Collections.<BlogEntry>emptyList();
+ }
+
+ List<BlogEntry> results = new ArrayList<BlogEntry>();
+ int idx = 0;
+ for (BlogEntry entry : entries)
+ {
+ if (idx++ >= offset)
+ {
+ results.add(entry);
+ if (results.size() == count)
+ {
+ return results;
+ }
+ }
+ }
+
+ return results;
+ }
+
+ public BlogEntry getEntry(Long entryId)
+ {
+ // TODO index the entries by id
+ for (BlogEntry entry : entries)
+ {
+ if (entry.getId().equals(entryId))
+ {
+ return entry;
+ }
+ }
+
+ return null;
+ }
+
+ public List<String> getCategories()
+ {
+ // TODO index list of categories
+ List<String> categories = new ArrayList<String>();
+ for (BlogEntry entry : entries)
+ {
+ if (!categories.contains(entry.getCategory()))
+ {
+ categories.add(entry.getCategory());
+ }
+ }
+
+ Collections.sort(categories);
+ return categories;
+ }
+
+ public void addComment(Comment comment, Long entryId)
+ {
+ addComment(comment, getEntry(entryId));
+ }
+
+ public void addComment(Comment comment, BlogEntry entry)
+ {
+ comment.setId(uniqueCommentId.incrementAndGet());
+ comment.setPostDate(new Date());
+ comment.setEntry(entry);
+ synchronized (entry)
+ {
+ // clone to break reference to the managed bean
+ entry.getComments().add(new Comment(comment));
+ }
+ }
+
+ private Date parseDate(String dateString)
+ {
+ if (dateParser == null)
+ {
+ dateParser = DateFormat.getDateTimeInstance(DateFormat.SHORT, DateFormat.SHORT,
Locale.UK);
+ }
+
+ try
+ {
+ return dateParser.parse(dateString);
+ }
+ catch (ParseException e)
+ {
+ throw new RuntimeException(e);
+ }
+ }
+}
Added:
examples/trunk/jsf/permalink/src/main/java/org/jboss/weld/examples/permalink/Comment.java
===================================================================
---
examples/trunk/jsf/permalink/src/main/java/org/jboss/weld/examples/permalink/Comment.java
(rev 0)
+++
examples/trunk/jsf/permalink/src/main/java/org/jboss/weld/examples/permalink/Comment.java 2009-10-27
18:51:33 UTC (rev 4353)
@@ -0,0 +1,130 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2009, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.weld.examples.permalink;
+
+import java.util.Date;
+
+import javax.enterprise.context.RequestScoped;
+import javax.inject.Named;
+
+/**
+ * @author Dan Allen
+ */
+public
+@Named
+@RequestScoped
+class Comment
+{
+ private Long id;
+
+ private BlogEntry entry;
+
+ private Date postDate;
+
+ private String author;
+
+ private String body;
+
+ public Comment()
+ {
+ }
+
+ public Comment(Long id, BlogEntry entry, String author, Date postDate, String body)
+ {
+ this.id = id;
+ this.entry = entry;
+ this.author = author;
+ this.postDate = postDate;
+ this.body = body;
+ }
+
+ public Comment(Comment other)
+ {
+ this.id = other.getId();
+ this.entry = other.getEntry();
+ this.author = other.getAuthor();
+ this.postDate = other.getPostDate();
+ this.body = other.getBody();
+ }
+
+ public BlogEntry getEntry()
+ {
+ return entry;
+ }
+
+ public void setEntry(BlogEntry entry)
+ {
+ this.entry = entry;
+ }
+
+ public Date getPostDate()
+ {
+ return postDate;
+ }
+
+ public void setPostDate(Date postDate)
+ {
+ this.postDate = postDate;
+ }
+
+ public String getAuthor()
+ {
+ return author;
+ }
+
+ public void setAuthor(String author)
+ {
+ this.author = author;
+ }
+
+ public String getBody()
+ {
+ return body;
+ }
+
+ public void setBody(String body)
+ {
+ this.body = body;
+ }
+
+ public Long getId()
+ {
+ return id;
+ }
+
+ public void setId(Long id)
+ {
+ this.id = id;
+ }
+
+ @Override
+ public String toString()
+ {
+ StringBuilder sb = new StringBuilder();
+ sb.append("Comment(a)").append(hashCode()).append("{");
+ sb.append("id=").append(id).append("; ");
+ sb.append("author=").append(author).append("; ");
+ sb.append("body=").append(body);
+ sb.append("}");
+ return sb.toString();
+ }
+}
Added:
examples/trunk/jsf/permalink/src/main/java/org/jboss/weld/examples/permalink/CommentBoard.java
===================================================================
---
examples/trunk/jsf/permalink/src/main/java/org/jboss/weld/examples/permalink/CommentBoard.java
(rev 0)
+++
examples/trunk/jsf/permalink/src/main/java/org/jboss/weld/examples/permalink/CommentBoard.java 2009-10-27
18:51:33 UTC (rev 4353)
@@ -0,0 +1,65 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2009, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.weld.examples.permalink;
+
+import javax.faces.context.FacesContext;
+import javax.faces.application.FacesMessage;
+
+import javax.enterprise.context.RequestScoped;
+import javax.inject.Inject;
+import javax.inject.Named;
+
+/**
+ * @author Dan Allen
+ */
+public
+@Named
+@RequestScoped
+class CommentBoard
+{
+ @Inject BlogEntryRepository repository;
+
+ @Inject Comment comment;
+
+ @Inject Blog blog;
+
+ public Boolean post()
+ {
+ if (comment == null || blog == null)
+ {
+ return null;
+ }
+
+ BlogEntry entry = repository.getEntry(blog.getEntryId());
+ if (entry == null)
+ {
+ return null;
+ }
+
+ repository.addComment(comment, entry);
+ FacesContext ctx = FacesContext.getCurrentInstance();
+ ctx.addMessage(null, new FacesMessage("Thanks for leaving a comment!"));
+ // FIXME doesn't seem to be working; must investigate
+ ctx.getExternalContext().getFlash().setKeepMessages(true);
+ return true;
+ }
+}
Added: examples/trunk/jsf/permalink/src/main/resources/META-INF/beans.xml
===================================================================
Added: examples/trunk/jsf/permalink/src/main/resources/log4j.xml
===================================================================
--- examples/trunk/jsf/permalink/src/main/resources/log4j.xml (rev
0)
+++ examples/trunk/jsf/permalink/src/main/resources/log4j.xml 2009-10-27 18:51:33 UTC (rev
4353)
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
+<log4j:configuration
xmlns:log4j="http://jakarta.apache.org/log4j/"
debug="false">
+
+ <appender name="CONSOLE"
class="org.apache.log4j.ConsoleAppender">
+ <param name="Target" value="System.out"/>
+ <layout class="org.apache.log4j.PatternLayout">
+ <param name="ConversionPattern" value="%d{ABSOLUTE} %-5p
[%c{2}] %m%n"/>
+ </layout>
+ </appender>
+
+ <root>
+ <priority value="INFO"/>
+ <appender-ref ref="CONSOLE"/>
+ </root>
+
+</log4j:configuration>
Added: examples/trunk/jsf/permalink/src/main/webapp/META-INF/context.xml
===================================================================
--- examples/trunk/jsf/permalink/src/main/webapp/META-INF/context.xml
(rev 0)
+++ examples/trunk/jsf/permalink/src/main/webapp/META-INF/context.xml 2009-10-27 18:51:33
UTC (rev 4353)
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<Context>
+ <Manager pathname=""/> <!-- disables storage of sessions across
restarts -->
+</Context>
Added: examples/trunk/jsf/permalink/src/main/webapp/WEB-INF/faces-config.xml
===================================================================
--- examples/trunk/jsf/permalink/src/main/webapp/WEB-INF/faces-config.xml
(rev 0)
+++ examples/trunk/jsf/permalink/src/main/webapp/WEB-INF/faces-config.xml 2009-10-27
18:51:33 UTC (rev 4353)
@@ -0,0 +1,63 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ JBoss, Home of Professional Open Source
+ Copyright 2009, Red Hat Middleware LLC, and individual contributors
+ by the @authors tag. See the copyright.txt in the distribution for a
+ full listing of individual contributors.
+
+ This is free software; you can redistribute it and/or modify it
+ under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of
+ the License, or (at your option) any later version.
+
+ This software is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this software; if not, write to the Free
+ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+-->
+<faces-config version="2.0"
+
xmlns="http://java.sun.com/xml/ns/javaee"
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="
+
http://java.sun.com/xml/ns/javaee
+
http://java.sun.com/xml/ns/javaee/web-facesconfig_2_0.xsd">
+
+ <navigation-rule>
+ <from-view-id>*</from-view-id>
+ <navigation-case>
+ <from-action>#{blog.search}</from-action>
+ <to-view-id>/home.xhtml</to-view-id>
+ <redirect include-view-params="true"/>
+ </navigation-case>
+ </navigation-rule>
+
+ <navigation-rule>
+ <from-view-id>/category.xhtml</from-view-id>
+ <navigation-case>
+ <from-action>#{blog.search}</from-action>
+ <to-view-id>#{view.viewId}</to-view-id>
+ <redirect include-view-params="true"/>
+ </navigation-case>
+ <navigation-case>
+ <from-action>#{blog.loadLatestEntriesInCategory}</from-action>
+ <if>#{blog.category eq null}</if>
+ <to-view-id>/home.xhtml</to-view-id>
+ <redirect/>
+ </navigation-case>
+ </navigation-rule>
+
+ <navigation-rule>
+ <from-view-id>/entry.xhtml</from-view-id>
+ <navigation-case>
+ <from-action>#{commentBoard.post}</from-action>
+ <to-view-id>#{view.viewId}</to-view-id>
+ <redirect include-view-params="true"/>
+ </navigation-case>
+ </navigation-rule>
+
+</faces-config>
Added: examples/trunk/jsf/permalink/src/main/webapp/WEB-INF/fragments/categories.xhtml
===================================================================
--- examples/trunk/jsf/permalink/src/main/webapp/WEB-INF/fragments/categories.xhtml
(rev 0)
+++
examples/trunk/jsf/permalink/src/main/webapp/WEB-INF/fragments/categories.xhtml 2009-10-27
18:51:33 UTC (rev 4353)
@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ JBoss, Home of Professional Open Source
+ Copyright 2009, Red Hat Middleware LLC, and individual contributors
+ by the @authors tag. See the copyright.txt in the distribution for a
+ full listing of individual contributors.
+
+ This is free software; you can redistribute it and/or modify it
+ under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of
+ the License, or (at your option) any later version.
+
+ This software is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this software; if not, write to the Free
+ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+-->
+<ui:composition
xmlns="http://www.w3.org/1999/xhtml"
+
xmlns:ui="http://java.sun.com/jsf/facelets"
+
xmlns:f="http://java.sun.com/jsf/core"
+
xmlns:h="http://java.sun.com/jsf/html">
+
+ <h2>Categories</h2>
+ <ul>
+ <ui:repeat var="_category"
value="#{blog.categories}">
+ <li>
+ <h:link outcome="category"
value="#{_category}">
+ <f:param name="name"
value="#{_category}"/>
+ </h:link>
+ </li>
+ </ui:repeat>
+ </ul>
+
+</ui:composition>
Added: examples/trunk/jsf/permalink/src/main/webapp/WEB-INF/fragments/comments.xhtml
===================================================================
--- examples/trunk/jsf/permalink/src/main/webapp/WEB-INF/fragments/comments.xhtml
(rev 0)
+++
examples/trunk/jsf/permalink/src/main/webapp/WEB-INF/fragments/comments.xhtml 2009-10-27
18:51:33 UTC (rev 4353)
@@ -0,0 +1,54 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ JBoss, Home of Professional Open Source
+ Copyright 2009, Red Hat Middleware LLC, and individual contributors
+ by the @authors tag. See the copyright.txt in the distribution for a
+ full listing of individual contributors.
+
+ This is free software; you can redistribute it and/or modify it
+ under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of
+ the License, or (at your option) any later version.
+
+ This software is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this software; if not, write to the Free
+ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+-->
+<ui:composition
xmlns="http://www.w3.org/1999/xhtml"
+
xmlns:ui="http://java.sun.com/jsf/facelets"
+
xmlns:f="http://java.sun.com/jsf/core"
+
xmlns:h="http://java.sun.com/jsf/html">
+
+ <ul id="comments" class="post-comments
clear">
+ <h3>#{_entry.numComments} Comment#{_entry.numComments
!= 1 ? 's' : ''}</h3>
+ <ui:repeat var="_comment"
varStatus="it" value="#{_entry.comments}">
+ <li class="comment clear #{it.even ? 'alt' :
''}">
+ <cite
class="comment-author">#{_comment.author}</cite>
+ <div
class="comment-content"><p>#{_comment.body}</p></div>
+ </li>
+ </ui:repeat>
+ </ul>
+ <h3>Any thoughts?</h3>
+ <h:form id="comment"
prependId="false">
+ <p>
+ <h:inputText id="author"
value="#{comment.author}" size="20" tabindex="1"
required="true" label="Author"/>
+ <h:outputLabel for="author" value="Name
(required)"/>
+ <br/>
+ <h:message for="author" style="color:
#FF0000;"/>
+ </p>
+ <p>
+ <h:inputTextarea id="body"
value="#{comment.body}" cols="60" rows="7"
tabindex="2" required="true" label="Comment text"/>
+ <h:message for="body" style="color:
#FF0000;"/>
+ </p>
+ <p>
+ <h:commandButton id="post"
action="#{commentBoard.post}" tabindex="3"
value="Submit"/>
+ </p>
+ </h:form>
+
+</ui:composition>
Added:
examples/trunk/jsf/permalink/src/main/webapp/WEB-INF/fragments/commonViewParams.xhtml
===================================================================
--- examples/trunk/jsf/permalink/src/main/webapp/WEB-INF/fragments/commonViewParams.xhtml
(rev 0)
+++
examples/trunk/jsf/permalink/src/main/webapp/WEB-INF/fragments/commonViewParams.xhtml 2009-10-27
18:51:33 UTC (rev 4353)
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ JBoss, Home of Professional Open Source
+ Copyright 2009, Red Hat Middleware LLC, and individual contributors
+ by the @authors tag. See the copyright.txt in the distribution for a
+ full listing of individual contributors.
+
+ This is free software; you can redistribute it and/or modify it
+ under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of
+ the License, or (at your option) any later version.
+
+ This software is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this software; if not, write to the Free
+ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+-->
+<ui:composition
xmlns="http://www.w3.org/1999/xhtml"
+
xmlns:ui="http://java.sun.com/jsf/facelets"
+
xmlns:f="http://java.sun.com/jsf/core">
+
+ <f:viewParam name="page" value="#{blog.page}"/>
+ <f:viewParam name="q" value="#{blog.searchString}"/>
+
+</ui:composition>
Added: examples/trunk/jsf/permalink/src/main/webapp/WEB-INF/fragments/entryContent.xhtml
===================================================================
--- examples/trunk/jsf/permalink/src/main/webapp/WEB-INF/fragments/entryContent.xhtml
(rev 0)
+++
examples/trunk/jsf/permalink/src/main/webapp/WEB-INF/fragments/entryContent.xhtml 2009-10-27
18:51:33 UTC (rev 4353)
@@ -0,0 +1,58 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ JBoss, Home of Professional Open Source
+ Copyright 2009, Red Hat Middleware LLC, and individual contributors
+ by the @authors tag. See the copyright.txt in the distribution for a
+ full listing of individual contributors.
+
+ This is free software; you can redistribute it and/or modify it
+ under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of
+ the License, or (at your option) any later version.
+
+ This software is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this software; if not, write to the Free
+ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+-->
+<ui:composition
xmlns="http://www.w3.org/1999/xhtml"
+
xmlns:ui="http://java.sun.com/jsf/facelets"
+
xmlns:c="http://java.sun.com/jsp/jstl/core"
+
xmlns:f="http://java.sun.com/jsf/core"
+
xmlns:h="http://java.sun.com/jsf/html">
+
+ <div class="post">
+ <div class="post-title">
+ <h2
id="entry-#{_entry.id}">#{_entry.title}</h2>
+ <h3>
+ Posted by #{_entry.author}
+ on #{' '}<h:outputText
value="#{_entry.postDate}"><f:convertDateTime type="date"
dateStyle="long"/></h:outputText>
+ at #{' '}<h:outputText
value="#{_entry.postDate}"><f:convertDateTime type="time"
timeStyle="short"/></h:outputText>
+ in #{' '}<h:link outcome="category"
value="#{_entry.category}"><f:param name="name"
value="#{_entry.category}"/></h:link>
+ </h3>
+ </div>
+ <div class="post-content">
+ <p>#{_entry.body}</p>
+ </div>
+ <div class="post-links">
+ <c:if test="#{view.viewId !=
'/entry.xhtml'}">
+ <h:link outcome="entry" value="View Entry"
includeViewParams="true" title="View this entry without losing your current
browsing state."
+ ><f:param name="id"
value="#{_entry.id}"
+ /></h:link>
+ <span style="font-size: smaller;">|</span>
+ </c:if>
+ #{' '}<h:link outcome="entry"
value="Permalink" title="A bookmarkable link for this entry."
+ ><f:param name="id"
value="#{_entry.id}"
+ /></h:link>
+ </div>
+ <c:if test="#{view.viewId ==
'/entry.xhtml'}">
+ <ui:include src="comments.xhtml"/>
+ </c:if>
+ </div>
+
+</ui:composition>
Added: examples/trunk/jsf/permalink/src/main/webapp/WEB-INF/fragments/entryList.xhtml
===================================================================
--- examples/trunk/jsf/permalink/src/main/webapp/WEB-INF/fragments/entryList.xhtml
(rev 0)
+++
examples/trunk/jsf/permalink/src/main/webapp/WEB-INF/fragments/entryList.xhtml 2009-10-27
18:51:33 UTC (rev 4353)
@@ -0,0 +1,52 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ JBoss, Home of Professional Open Source
+ Copyright 2009, Red Hat Middleware LLC, and individual contributors
+ by the @authors tag. See the copyright.txt in the distribution for a
+ full listing of individual contributors.
+
+ This is free software; you can redistribute it and/or modify it
+ under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of
+ the License, or (at your option) any later version.
+
+ This software is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this software; if not, write to the Free
+ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+-->
+<ui:composition
xmlns="http://www.w3.org/1999/xhtml"
+
xmlns:ui="http://java.sun.com/jsf/facelets"
+
xmlns:c="http://java.sun.com/jsp/jstl/core"
+
xmlns:fn="http://java.sun.com/jsp/jstl/functions"
+
xmlns:f="http://java.sun.com/jsf/core"
+
xmlns:h="http://java.sun.com/jsf/html">
+
+ <c:if test="#{view.viewId ==
'/category.xhtml'}">
+ <div class="category">
+ <ui:remove><span>#{not empty blog.category ?
fn:concat('Category: ', blog.category) : 'INVALID
CATEGORY!'}</span></ui:remove>
+ <span>#{not empty blog.category ? 'Category: ' :
''}#{not empty blog.category ? blog.category : 'INVALID
CATEGORY!'}</span>
+ </div>
+ </c:if>
+ <ui:repeat var="_entry"
value="#{blog.entriesForPage}">
+ <ui:include src="entryContent.xhtml"/>
+ </ui:repeat>
+ <div class="post-navigation">
+ <span class="arrow">««</span>
#{' '}<h:link id="first" value="First Page"
disabled="#{not blog.previousPageAvailable}" includeViewParams="true"
+ ><f:param name="page" disable="true"
+ /></h:link>
+ <span class="arrow">«</span> #{'
'}<h:link id="previous" value="Newer Entries"
disabled="#{not blog.previousPageAvailable}" includeViewParams="true"
+ ><f:param name="page"
value="#{blog.previousPage}"
+ /></h:link>
+ <span style="font-size:
smaller;">–</span>
+ #{' '}<h:link outcome="#{view.viewId}"
id="next" value="Older Entries" disabled="#{not
blog.nextPageAvailable}" includeViewParams="true"
+ ><f:param name="page"
value="#{blog.nextPage}"
+ /></h:link> <span
class="arrow">»</span>
+ </div>
+
+</ui:composition>
Added:
examples/trunk/jsf/permalink/src/main/webapp/WEB-INF/fragments/otherCategories.xhtml
===================================================================
--- examples/trunk/jsf/permalink/src/main/webapp/WEB-INF/fragments/otherCategories.xhtml
(rev 0)
+++
examples/trunk/jsf/permalink/src/main/webapp/WEB-INF/fragments/otherCategories.xhtml 2009-10-27
18:51:33 UTC (rev 4353)
@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ JBoss, Home of Professional Open Source
+ Copyright 2009, Red Hat Middleware LLC, and individual contributors
+ by the @authors tag. See the copyright.txt in the distribution for a
+ full listing of individual contributors.
+
+ This is free software; you can redistribute it and/or modify it
+ under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of
+ the License, or (at your option) any later version.
+
+ This software is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this software; if not, write to the Free
+ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+-->
+<ui:composition
xmlns="http://www.w3.org/1999/xhtml"
+
xmlns:ui="http://java.sun.com/jsf/facelets"
+
xmlns:f="http://java.sun.com/jsf/core"
+
xmlns:h="http://java.sun.com/jsf/html">
+
+ <h2>Other Categories</h2>
+ <ul>
+ <ui:repeat var="_category"
value="#{blog.otherCategories}">
+ <li>
+ <h:link outcome="category"
value="#{_category}">
+ <f:param name="name"
value="#{_category}"/>
+ </h:link>
+ </li>
+ </ui:repeat>
+ </ul>
+
+</ui:composition>
Added: examples/trunk/jsf/permalink/src/main/webapp/WEB-INF/fragments/singleEntry.xhtml
===================================================================
--- examples/trunk/jsf/permalink/src/main/webapp/WEB-INF/fragments/singleEntry.xhtml
(rev 0)
+++
examples/trunk/jsf/permalink/src/main/webapp/WEB-INF/fragments/singleEntry.xhtml 2009-10-27
18:51:33 UTC (rev 4353)
@@ -0,0 +1,57 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ JBoss, Home of Professional Open Source
+ Copyright 2009, Red Hat Middleware LLC, and individual contributors
+ by the @authors tag. See the copyright.txt in the distribution for a
+ full listing of individual contributors.
+
+ This is free software; you can redistribute it and/or modify it
+ under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of
+ the License, or (at your option) any later version.
+
+ This software is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this software; if not, write to the Free
+ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+-->
+<ui:composition
xmlns="http://www.w3.org/1999/xhtml"
+
xmlns:ui="http://java.sun.com/jsf/facelets"
+
xmlns:f="http://java.sun.com/jsf/core"
+
xmlns:h="http://java.sun.com/jsf/html">
+
+ <ui:remove><!-- The check for phase prevents a "ghost"
form submit --></ui:remove>
+ <h:panelGroup rendered="#{facesContext.currentPhaseId.ordinal ==
6 and empty blog.entry}">
+ <p>Sorry, no post exists with that identifier.</p>
+ </h:panelGroup>
+ <h:panelGroup rendered="#{not empty blog.entry or
facesContext.currentPhaseId.ordinal != 6}">
+ <ui:include src="entryContent.xhtml">
+ <ui:param name="_entry"
value="#{blog.entry}"/>
+ </ui:include>
+ </h:panelGroup>
+ <div class="post-navigation">
+ <h:panelGroup rendered="#{not empty blog.category}">
+ <h:button outcome="category" value="Back to
#{blog.category}" fragment="entry-#{blog.entry.id}"
includeViewParams="true"/>
+ </h:panelGroup>
+ <h:panelGroup rendered="#{empty blog.category}">
+ <h:button outcome="home" value="Back to main
page" fragment="entry-#{blog.entry.id}"
includeViewParams="true"/>
+ </h:panelGroup>
+ #{' '}<h:button outcome="entry" value="Hide
comments" disabled="true" includeViewParams="true">
+ <f:param name="comments"
value="false"/>
+ </h:button>
+ <ui:remove><!--
+ <h:panelGroup rendered="#{not empty blog.category}">
+ « <h:link outcome="category"
value="Back to #{blog.category}" includeViewParams="true"/>
+ </h:panelGroup>
+ <h:panelGroup rendered="#{empty blog.category}">
+ « <h:link outcome="home" value="Back
to main page" includeViewParams="true"/>
+ </h:panelGroup>
+ --></ui:remove>
+ </div>
+
+</ui:composition>
Added: examples/trunk/jsf/permalink/src/main/webapp/WEB-INF/jetty-env.xml
===================================================================
--- examples/trunk/jsf/permalink/src/main/webapp/WEB-INF/jetty-env.xml
(rev 0)
+++ examples/trunk/jsf/permalink/src/main/webapp/WEB-INF/jetty-env.xml 2009-10-27 18:51:33
UTC (rev 4353)
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE Configure PUBLIC "-//Mort Bay Consulting//DTD Configure//EN"
+ "http://jetty.mortbay.org/configure.dtd">
+<!--
+ JBoss, Home of Professional Open Source
+ Copyright 2009, Red Hat Middleware LLC, and individual contributors
+ by the @authors tag. See the copyright.txt in the distribution for a
+ full listing of individual contributors.
+
+ This is free software; you can redistribute it and/or modify it
+ under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of
+ the License, or (at your option) any later version.
+
+ This software is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this software; if not, write to the Free
+ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+-->
+<Configure id="webAppCtx"
class="org.mortbay.jetty.webapp.WebAppContext">
+</Configure>
Added: examples/trunk/jsf/permalink/src/main/webapp/WEB-INF/layout/template.xhtml
===================================================================
--- examples/trunk/jsf/permalink/src/main/webapp/WEB-INF/layout/template.xhtml
(rev 0)
+++ examples/trunk/jsf/permalink/src/main/webapp/WEB-INF/layout/template.xhtml 2009-10-27
18:51:33 UTC (rev 4353)
@@ -0,0 +1,92 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<!--
+ JBoss, Home of Professional Open Source
+ Copyright 2009, Red Hat Middleware LLC, and individual contributors
+ by the @authors tag. See the copyright.txt in the distribution for a
+ full listing of individual contributors.
+
+ This is free software; you can redistribute it and/or modify it
+ under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of
+ the License, or (at your option) any later version.
+
+ This software is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this software; if not, write to the Free
+ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+-->
+<html
xmlns="http://www.w3.org/1999/xhtml"
+
xmlns:ui="http://java.sun.com/jsf/facelets"
+
xmlns:f="http://java.sun.com/jsf/core"
+
xmlns:h="http://java.sun.com/jsf/html">
+ <f:view>
+ <ui:insert name="viewMetadata"/>
+ <head>
+ <title>Permalink</title>
+ <link rel="shortcut icon"
href="#{request.contextPath}/favicon.ico"/>
+ <link rel="stylesheet"
href="#{request.contextPath}/css/style.css" type="text/css"
media="screen" />
+ <!--[if lte IE 6]>
+ <link rel="stylesheet"
href="#{request.contextPath}/css/legacy.css" type="text/css"
media="screen" title="no title" charset="utf-8" />
+ <![endif]-->
+ </head>
+ <body>
+ <div id="header">
+ <div class="inner clear">
+ <h1><h:link
outcome="home">Permalink</h:link></h1>
+ <p>Direct links to the news you crave</p>
+ </div>
+ </div>
+ <div id="search">
+ <div class="inner clear">
+ <a id="rss-link"
href="http://in.relation.to/service/Feed/atom"><strong>Subscribe to
this Feed</strong></a>
+ <a id="technorati-link"
href="http://technorati.com/faves?add=http://in.relation.to">...
to your Favorites</strong></a>
+ <h:form id="search" prependId="false">
+ <div>
+ <label for="q">Search</label>
+ #{' '}<h:inputText id="q"
value="#{blog.searchString}"/><h:commandButton id="s"
action="#{blog.search}" image="/img/search.png"
title="Search"/>
+ </div>
+ </h:form>
+ </div>
+ </div>
+ <div id="wrapper" class="clear">
+ <div id="content">
+ <h:messages id="messages" globalOnly="true"/>
+ <ui:insert name="content">
+ <ui:include src="../fragments/entryList.xhtml"/>
+ </ui:insert>
+ </div>
+ <ul id="sidebar">
+ <li>
+ <ui:insert name="categories">
+ <ui:include src="../fragments/categories.xhtml"/>
+ </ui:insert>
+ </li>
+ <li>
+ <h2>Blogroll</h2>
+ <ul>
+ <li><a href="http://in.relation.to">In Relation
To...</a></li>
+ <li><a href="http://blogs.steeplesoft.com">Coming
Up for Air</a></li>
+ <li><a
href="http://weblogs.java.net/blog/edburns">Ed Burn's
Blog</a></li>
+ <li><a
href="http://blogs.sun.com/rlubke">Ryan
Lubke's Blog</a></li>
+ </ul>
+ </li>
+ </ul>
+ </div>
+ <div id="footer">
+ <p id="blog-name">Permalink JSF Demo</p>
+ <p id="webrevolutionary-link">
+ <a
href="http://webrevolutionary.com/coldblue/">ColdBlue</a> v1.0 -
+ A theme by <a
href="http://webrevolutionary.com/">WebRevolutionary</a> &
+ <a
href="http://www.forwebdesigners.com/">ForWebdesigners</a...
+ </p>
+ </div>
+ </body>
+ </f:view>
+</html>
Added: examples/trunk/jsf/permalink/src/main/webapp/WEB-INF/web.xml
===================================================================
--- examples/trunk/jsf/permalink/src/main/webapp/WEB-INF/web.xml
(rev 0)
+++ examples/trunk/jsf/permalink/src/main/webapp/WEB-INF/web.xml 2009-10-27 18:51:33 UTC
(rev 4353)
@@ -0,0 +1,56 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ JBoss, Home of Professional Open Source
+ Copyright 2009, Red Hat Middleware LLC, and individual contributors
+ by the @authors tag. See the copyright.txt in the distribution for a
+ full listing of individual contributors.
+
+ This is free software; you can redistribute it and/or modify it
+ under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of
+ the License, or (at your option) any later version.
+
+ This software is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this software; if not, write to the Free
+ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+-->
+<web-app version="2.5"
+
xmlns="http://java.sun.com/xml/ns/javaee"
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="
+
http://java.sun.com/xml/ns/javaee
+
http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
+
+ <display-name>Weld Permalink Example (Servlet Environment)</display-name>
+
+ <context-param>
+ <param-name>facelets.DEVELOPMENT</param-name>
+ <param-value>true</param-value>
+ </context-param>
+
+ <listener>
+
<listener-class>org.jboss.weld.environment.servlet.Listener</listener-class>
+ </listener>
+
+ <servlet>
+ <servlet-name>Faces Servlet</servlet-name>
+ <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
+ <load-on-startup>1</load-on-startup>
+ </servlet>
+
+ <servlet-mapping>
+ <servlet-name>Faces Servlet</servlet-name>
+ <url-pattern>*.jsf</url-pattern>
+ </servlet-mapping>
+
+ <session-config>
+ <session-timeout>10</session-timeout>
+ </session-config>
+
+</web-app>
Added: examples/trunk/jsf/permalink/src/main/webapp/category.xhtml
===================================================================
--- examples/trunk/jsf/permalink/src/main/webapp/category.xhtml
(rev 0)
+++ examples/trunk/jsf/permalink/src/main/webapp/category.xhtml 2009-10-27 18:51:33 UTC
(rev 4353)
@@ -0,0 +1,37 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ JBoss, Home of Professional Open Source
+ Copyright 2009, Red Hat Middleware LLC, and individual contributors
+ by the @authors tag. See the copyright.txt in the distribution for a
+ full listing of individual contributors.
+
+ This is free software; you can redistribute it and/or modify it
+ under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of
+ the License, or (at your option) any later version.
+
+ This software is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this software; if not, write to the Free
+ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+-->
+<ui:composition
xmlns="http://www.w3.org/1999/xhtml"
+
xmlns:ui="http://java.sun.com/jsf/facelets"
+
xmlns:f="http://java.sun.com/jsf/core"
+ template="/WEB-INF/layout/template.xhtml">
+ <ui:define name="viewMetadata">
+ <f:metadata>
+ <f:viewParam name="name" value="#{blog.category}"/>
+ <ui:include src="/WEB-INF/fragments/commonViewParams.xhtml"/>
+ <f:event type="preRenderView"
listener="#{blog.loadLatestEntriesInCategory}"/>
+ </f:metadata>
+ </ui:define>
+ <ui:define name="categories">
+ <ui:include src="/WEB-INF/fragments/otherCategories.xhtml"/>
+ </ui:define>
+</ui:composition>
Added: examples/trunk/jsf/permalink/src/main/webapp/css/legacy.css
===================================================================
--- examples/trunk/jsf/permalink/src/main/webapp/css/legacy.css
(rev 0)
+++ examples/trunk/jsf/permalink/src/main/webapp/css/legacy.css 2009-10-27 18:51:33 UTC
(rev 4353)
@@ -0,0 +1,6 @@
+.clear {
+ height: 1px;
+}
+body {
+ font-size: 62.5%;
+}
Added: examples/trunk/jsf/permalink/src/main/webapp/css/style.css
===================================================================
--- examples/trunk/jsf/permalink/src/main/webapp/css/style.css
(rev 0)
+++ examples/trunk/jsf/permalink/src/main/webapp/css/style.css 2009-10-27 18:51:33 UTC
(rev 4353)
@@ -0,0 +1,466 @@
+/*
+Some Aspects Copyright (c) 2007, Yahoo! Inc. All rights reserved.
+Code licensed under the BSD License:
+http://developer.yahoo.net/yui/license.txt
+version: 2.2.2
+*/
+html{overflow-y: scroll;}
+body{font:Arial,sans-serif;*font-size:small;*font:x-small;}table{font-size:inherit;font:100%;}select,input,textarea{font:99%
arial,helvetica,clean,sans-serif;}pre,code{font:115% monospace;*font-size:100%;}body
*{line-height:1.22em;}
+body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,form,fieldset,input,textarea,p,blockquote,th,td{margin:0;padding:0;}table{border-collapse:collapse;border-spacing:0;}fieldset,img{border:0;}address,caption,cite,code,dfn,em,strong,th,var{font-style:normal;font-weight:normal;}ol,ul
{list-style:none;}caption,th
{text-align:left;}h1,h2,h3,h4,h5,h6{font-size:100%;font-weight:normal;}q:before,q:after{content:'';}abbr,acronym{border:0;}
+abbr,acronym{border-bottom:1px dotted #000;}
+em{font-style: italic;}
+strong{font-weight: bold;}
+/* Utility Classes */
+.clear:after{content:'.';display:block;height:0;font-size:0;clear:both;visibility:hidden;}
+.clear{display:inline-block;}
+/* \*/
+.clear{display:block;}
+/* */
+.image{display:block;font-size:0;text-indent:-9999px;outline:none;}
+/*
+Theme Name: ColdBlue
+Theme URI:
http://webrevolutionary.com/coldblue/
+Description: ColdBlue - A WordPress theme created by WebRevolutionary.
+Version: 1.2
+Author: WebRevolutionary
+Author URI:
http://webrevolutionary.com/
+*/
+body {
+ text-align: center;
+ color: #333;
+ background: #28313a url(../img/bodybg.gif) repeat-x top;
+ font-size: 13px;
+ font-family: Helvetica, Arial, sans-serif;
+}
+div#header {
+ background: #3776bd url(../img/headerbg.gif) repeat-x bottom;
+ width: 100%;
+ border-bottom: 1px solid #3776bd;
+}
+div#search {
+ background: #000;
+ width: 100%;
+}
+div.inner {
+ width: 840px;
+ margin: auto;
+ text-align: left;
+ padding: 10px 0;
+}
+div#header h1 {
+ font-size: 23px;
+ font-weight: bold;
+ float: left;
+ width: 40%;
+ text-shadow: 1px 0px #2B4462;
+ letter-spacing: -1px;
+}
+div#header h1 a {
+ color: #fff;
+ text-decoration: none;
+}
+div#header p {
+ color: #FFFFFF;
+ clear: left;
+ margin: 0;
+}
+ul#navigation {
+ float: right;
+ width: 50%;
+ position: relative;
+ top: 7px;
+ text-align: right;
+}
+ul#navigation li {
+ display: inline;
+}
+ul#navigation li a {
+ color: #BFDCFE;
+ text-decoration: none;
+ font-size: 16px;
+ font-weight: bold;
+ padding: 10px;
+ text-shadow: 1px 0px #2B4462;
+}
+ul#navigation li.active a {
+ color: #BFDCFE;
+}
+ul#navigation li a:hover {
+ color: #fff;
+ text-decoration: underline;
+}
+div#search label {
+ font-weight: bold;
+ color: #666666;
+ padding-right: 3px;
+}
+div#search form {
+ padding-top: 2px;
+ font-size: 14px;
+ width: 40%;
+ float: right;
+ text-align: right;
+}
+div#search form * {
+ vertical-align: middle;
+}
+input#q {
+ width: 140px;
+ border: 0;
+ padding: 2px 1px;
+}
+input#s {
+ background-color: #FFFFFF;
+ padding: 2px;
+}
+ul#sidebar input#s {
+ width: 100px;
+}
+a#rss-link, a#technorati-link {
+ display: block;
+ float: left;
+ color: #333;
+ font-size: 13px;
+ font-weight: bold;
+ position: relative;
+ top: 4px;
+ text-decoration: none;
+ margin: 0 20px 0 0;
+}
+a#rss-link {
+ background: url(../img/rss.gif) no-repeat left center;
+ padding: 0 0 1px 17px;
+}
+a#technorati-link {
+ background: url(../img/technorati.gif) no-repeat left center;
+ padding: 0 0 1px 19px;
+}
+a#rss-link strong, a#technorati-link strong {
+ color: #666!important;
+ border-bottom: 1px dotted #222;
+}
+a#rss-link:hover strong, a#technorati-link:hover strong {
+ color: #ccc!important;
+ border-bottom: 1px solid #333;
+}
+div#wrapper {
+ text-align: left;
+ width: 800px;
+ padding: 20px;
+ margin: auto;
+ /*margin-top: 1.25em;*/
+ background: #fff url(../img/wrapper.gif) repeat-y right;
+ background-position: -60px 0px;
+ border-right: 2px solid #242c34;
+ border-left: 2px solid #242c34;
+}
+div#content {
+ width: 500px;
+ float: left;
+ padding: 0 30px 0 0;
+}
+#messages {
+ color: #9E6B31;
+ margin-bottom: 10px;
+ font-size: 15px;
+}
+.category {
+ background-color: #EAF3F9;
+ background: #99CCFF url(../img/wgradient.png) repeat-x;
+ border-top: 1px solid #666666;
+ border-bottom: 1px solid #666666;
+ padding: 5px 10px;
+ margin-bottom: 1em;
+ text-align: center;
+ font-weight: bold;
+ letter-spacing: 3px;
+ text-align: right;
+}
+ul#sidebar {
+ display: block;
+ width: 240px;
+ float: left;
+ padding: 10px 0 0 30px;
+ font-size: 13px;
+}
+ul#sidebar h2 {
+ font-size: 20px;
+}
+ul#sidebar li {
+ margin: 0 0 20px;
+ padding: 0 0 10px;
+ border-bottom: 1px dotted #ccc;
+}
+ul#sidebar li ul li {
+ font-size: 13px!important;
+ margin: 0;
+ border: none;
+}
+ul#sidebar ul.block-list li a {
+ display: block;
+ padding: 7px 0;
+ border-bottom: 1px dotted #ccc;
+ text-decoration: none;
+}
+ul#sidebar ul.block-list li a:hover {
+ text-decoration: none;
+}
+h2, h3, h4, h5, h6 {
+ color: #000;
+}
+h2 {
+ font-size: 30px;
+ margin: 0 0 8px!important;
+ letter-spacing: -1px;
+}
+h2 a {
+ color: #000;
+ text-decoration: none;
+}
+h2 a:hover {
+ color: #000;
+ text-decoration: underline;
+}
+h3 {
+ font-size: 18px;
+ margin: 0 0 8px;
+}
+div.post h3 {
+ margin: 0 0 2px;
+}
+h4 {
+ font-size: 16px;
+}
+div.post-title {
+ margin: 0 0 10px;
+}
+div.post-title h2 {
+ margin: 0;
+}
+div.post-title h3 {
+ color: #999;
+ font-size: 13px;
+ /* trying out */
+ font-style: italic;
+ font-family: Arial, sans-serif;
+}
+div.post-title h3 a {
+ color: #666;
+ text-decoration: none;
+ border-bottom: 1px dotted #ccc;
+}
+div.post-title h3 a:hover {
+ border-bottom: 1px solid #aaa;
+ color: #444;
+}
+p {
+ margin: 0 0 20px;
+ font-size: 13px;
+ line-height: 20px;
+}
+p img {
+ background: #fff;
+ padding: 5px;
+ border: 1px solid #999;
+ border-top: 1px solid #ccc;
+ border-left: 1px solid #ccc;
+}
+p a:hover img {
+ border: 1px solid #777;
+ border-top: 1px solid #aaa;
+ border-left: 1px solid #aaa;
+}
+form p {
+ margin-bottom: 10px;
+}
+img.float-left, img.alignleft {
+ display: block;
+ float: left;
+ clear: left;
+ margin: 0 24px 12px 0;
+}
+img.float-right, img.alignright {
+ display: block;
+ float: right;
+ clear: right;
+ margin: 0 0 12px 12px;
+}
+img.center, img.centered {
+ display: block;
+ clear: both;
+ margin: auto;
+}
+.alignleft {
+ float: left;
+}
+.alignright {
+ float: right;
+}
+div.post-content ul, div.post-content ol {
+ margin: 5px 0 12px 24px;
+ list-style: disc;
+ font-size: 13px;
+}
+div.post-content ol {
+ list-style: decimal;
+}
+div.post-links {
+ padding-left: 2px;
+ margin-bottom: 5px;
+}
+a {
+ color: #0078C8;
+}
+a:hover {
+ color: #0095f8;
+}
+blockquote {
+ font-size: 15px!important;
+ font-family: Georgia, Times, 'Times New Roman', serif;
+ color: #444;
+ font-style: italic;
+ margin: 0 0 0 22px;
+ line-height: 24px!important;
+ display: block;
+}
+blockquote p {
+ font-size: 15px!important;
+ line-height: 24px!important;
+}
+cite {
+ text-align: right;
+ float: right;
+ color: #aaa;
+}
+cite a {
+ color: #aaa;
+ text-decoration: none;
+}
+cite a:hover {
+ color: #999;
+ text-decoration: underline;
+}
+code {
+ font-size: 130%;
+ background: #fafafa;
+}
+code.block {
+ display: block;
+ padding: 10px;
+}
+div.post {
+ padding: 0 0 10px;
+ margin: 0 0 25px;
+ border-bottom: 1px dotted #ccc;
+}
+ul.post-comments {
+ margin: 26px 0;
+}
+ul.post-comments h3 {
+ margin: 0 0 5px;
+}
+li.comment {
+ display: block;
+ padding: 20px 20px 0;
+ border-bottom: 1px dotted #ccc;
+ background: #fafafa;
+}
+li.comment.alt {
+ background: #fff;
+}
+cite.comment-author {
+ text-align: left;
+ float: left;
+ color: #000;
+ font-size: 16px;
+ font-weight: bold;
+ width: 150px;
+ clear: left;
+ display: block;
+}
+cite.comment-author a {
+ color: #333;
+ text-decoration: none;
+}
+cite.comment-author a:hover {
+ text-decoration: underline;
+}
+cite.comment-author img {
+ position: relative;
+ top: 6px;
+ margin: 0 10px 0 0;
+}
+div.comment-content {
+ display: block;
+ width: 300px;
+ float: left;
+ padding: 0 0 0 10px;
+}
+div.post-navigation .arrow {
+ font-size: 1.1em;
+}
+table#wp-calendar {
+ margin: auto;
+ text-align: center;
+}
+table#wp-calendar caption {
+ font-size: 14px;
+ text-align: center;
+ color: #999;
+}
+table#wp-calendar td {
+ padding: 5px;
+ font-size: 13px;
+ text-align: center;
+}
+table#wp-calendar th {
+ font-size: 14px;
+ padding: 5px;
+ text-align: center;
+ font-weight: bold;
+}
+table#wp-calendar td a {
+ font-weight: bold;
+}
+a abbr, a acronym {
+ border: none;
+}
+div#footer {
+ clear: both;
+ background: #000;
+ padding: 25px 10px 15px;
+ display: block;
+ width: 820px;
+ margin: auto;
+ border-right: 2px solid #242c34;
+ border-left: 2px solid #242c34;
+ text-align: left;
+}
+div#footer p {
+ font-size: 12px;
+ margin: 0 0 5px 20px;
+ color: #555;
+}
+div#footer a {
+ color: #ccc;
+ text-decoration: none;
+ border-bottom: 1px solid #222;
+ font-weight: bold;
+}
+div#footer a:hover {
+ color: #fff;
+ border-bottom: 1px solid #444;
+}
+div#footer p#blog-name {
+ font-size: 16px;
+ color: #aaa;
+}
+div#footer p#webrevolutionary-link {
+ color: #333;
+}
+div#footer p#webrevolutionary-link a {
+ color: #444;
+}
+div#footer p#webrevolutionary-link a:hover {
+ color: #666;
+}
Added: examples/trunk/jsf/permalink/src/main/webapp/entry.xhtml
===================================================================
--- examples/trunk/jsf/permalink/src/main/webapp/entry.xhtml (rev
0)
+++ examples/trunk/jsf/permalink/src/main/webapp/entry.xhtml 2009-10-27 18:51:33 UTC (rev
4353)
@@ -0,0 +1,38 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ JBoss, Home of Professional Open Source
+ Copyright 2009, Red Hat Middleware LLC, and individual contributors
+ by the @authors tag. See the copyright.txt in the distribution for a
+ full listing of individual contributors.
+
+ This is free software; you can redistribute it and/or modify it
+ under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of
+ the License, or (at your option) any later version.
+
+ This software is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this software; if not, write to the Free
+ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+-->
+<ui:composition
xmlns="http://www.w3.org/1999/xhtml"
+
xmlns:ui="http://java.sun.com/jsf/facelets"
+
xmlns:f="http://java.sun.com/jsf/core"
+ template="/WEB-INF/layout/template.xhtml">
+ <ui:define name="viewMetadata">
+ <f:metadata>
+ <f:viewParam name="id" value="#{blog.entryId}"/>
+ <f:viewParam name="category"
value="#{blog.category}"/>
+ <ui:include src="/WEB-INF/fragments/commonViewParams.xhtml"/>
+ <f:event type="preRenderView"
listener="#{blog.loadEntry}"/>
+ </f:metadata>
+ </ui:define>
+ <ui:define name="content">
+ <ui:include src="/WEB-INF/fragments/singleEntry.xhtml"/>
+ </ui:define>
+</ui:composition>
Added: examples/trunk/jsf/permalink/src/main/webapp/favicon.ico
===================================================================
(Binary files differ)
Property changes on: examples/trunk/jsf/permalink/src/main/webapp/favicon.ico
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: examples/trunk/jsf/permalink/src/main/webapp/home.xhtml
===================================================================
--- examples/trunk/jsf/permalink/src/main/webapp/home.xhtml (rev
0)
+++ examples/trunk/jsf/permalink/src/main/webapp/home.xhtml 2009-10-27 18:51:33 UTC (rev
4353)
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ JBoss, Home of Professional Open Source
+ Copyright 2009, Red Hat Middleware LLC, and individual contributors
+ by the @authors tag. See the copyright.txt in the distribution for a
+ full listing of individual contributors.
+
+ This is free software; you can redistribute it and/or modify it
+ under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 2.1 of
+ the License, or (at your option) any later version.
+
+ This software is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this software; if not, write to the Free
+ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+-->
+<ui:composition
xmlns="http://www.w3.org/1999/xhtml"
+
xmlns:ui="http://java.sun.com/jsf/facelets"
+
xmlns:f="http://java.sun.com/jsf/core"
+ template="/WEB-INF/layout/template.xhtml">
+ <ui:define name="viewMetadata">
+ <f:metadata>
+ <ui:include src="/WEB-INF/fragments/commonViewParams.xhtml"/>
+ <f:event type="preRenderView"
listener="#{blog.loadLatestEntries}"/>
+ </f:metadata>
+ </ui:define>
+</ui:composition>
Added: examples/trunk/jsf/permalink/src/main/webapp/img/bodybg.gif
===================================================================
(Binary files differ)
Property changes on: examples/trunk/jsf/permalink/src/main/webapp/img/bodybg.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: examples/trunk/jsf/permalink/src/main/webapp/img/headerbg.gif
===================================================================
(Binary files differ)
Property changes on: examples/trunk/jsf/permalink/src/main/webapp/img/headerbg.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: examples/trunk/jsf/permalink/src/main/webapp/img/rss.gif
===================================================================
(Binary files differ)
Property changes on: examples/trunk/jsf/permalink/src/main/webapp/img/rss.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: examples/trunk/jsf/permalink/src/main/webapp/img/search.png
===================================================================
(Binary files differ)
Property changes on: examples/trunk/jsf/permalink/src/main/webapp/img/search.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: examples/trunk/jsf/permalink/src/main/webapp/img/searchbg.gif
===================================================================
(Binary files differ)
Property changes on: examples/trunk/jsf/permalink/src/main/webapp/img/searchbg.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: examples/trunk/jsf/permalink/src/main/webapp/img/technorati.gif
===================================================================
(Binary files differ)
Property changes on: examples/trunk/jsf/permalink/src/main/webapp/img/technorati.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: examples/trunk/jsf/permalink/src/main/webapp/img/wgradient.png
===================================================================
(Binary files differ)
Property changes on: examples/trunk/jsf/permalink/src/main/webapp/img/wgradient.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: examples/trunk/jsf/permalink/src/main/webapp/img/wrapper.gif
===================================================================
(Binary files differ)
Property changes on: examples/trunk/jsf/permalink/src/main/webapp/img/wrapper.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: examples/trunk/jsf/permalink/src/main/webapp/index.html
===================================================================
--- examples/trunk/jsf/permalink/src/main/webapp/index.html (rev
0)
+++ examples/trunk/jsf/permalink/src/main/webapp/index.html 2009-10-27 18:51:33 UTC (rev
4353)
@@ -0,0 +1 @@
+<html><head><meta http-equiv="Refresh" content="0;
URL=home.jsf"/></head></html>