You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tomee.apache.org by jg...@apache.org on 2011/03/13 17:55:33 UTC
svn commit: r1081150 - in /openejb/trunk/openejb3/examples/webapps/moviefun:
./ src/main/java/org/superbiz/moviefun/
src/main/java/org/superbiz/moviefun/util/ src/main/resources/
src/main/resources/META-INF/ src/main/webapp/ src/main/webapp/META-INF/ s...
Author: jgallimore
Date: Sun Mar 13 16:55:32 2011
New Revision: 1081150
URL: http://svn.apache.org/viewvc?rev=1081150&view=rev
Log:
Added JPA 2 and JSF 2 to the moviefun sample application
Added:
openejb/trunk/openejb3/examples/webapps/moviefun/src/main/java/org/superbiz/moviefun/MovieController.java
openejb/trunk/openejb3/examples/webapps/moviefun/src/main/java/org/superbiz/moviefun/util/
openejb/trunk/openejb3/examples/webapps/moviefun/src/main/java/org/superbiz/moviefun/util/JsfUtil.java
openejb/trunk/openejb3/examples/webapps/moviefun/src/main/java/org/superbiz/moviefun/util/PaginationHelper.java
openejb/trunk/openejb3/examples/webapps/moviefun/src/main/resources/Bundle.properties
openejb/trunk/openejb3/examples/webapps/moviefun/src/main/webapp/META-INF/
openejb/trunk/openejb3/examples/webapps/moviefun/src/main/webapp/META-INF/context.xml
openejb/trunk/openejb3/examples/webapps/moviefun/src/main/webapp/WEB-INF/faces-config.xml
openejb/trunk/openejb3/examples/webapps/moviefun/src/main/webapp/index.xhtml
openejb/trunk/openejb3/examples/webapps/moviefun/src/main/webapp/movie/
openejb/trunk/openejb3/examples/webapps/moviefun/src/main/webapp/movie/Create.xhtml
openejb/trunk/openejb3/examples/webapps/moviefun/src/main/webapp/movie/Edit.xhtml
openejb/trunk/openejb3/examples/webapps/moviefun/src/main/webapp/movie/List.xhtml
openejb/trunk/openejb3/examples/webapps/moviefun/src/main/webapp/movie/View.xhtml
openejb/trunk/openejb3/examples/webapps/moviefun/src/main/webapp/moviefun.jsp
openejb/trunk/openejb3/examples/webapps/moviefun/src/main/webapp/resources/
openejb/trunk/openejb3/examples/webapps/moviefun/src/main/webapp/resources/css/
openejb/trunk/openejb3/examples/webapps/moviefun/src/main/webapp/resources/css/jsfcrud.css
openejb/trunk/openejb3/examples/webapps/moviefun/src/main/webapp/template.xhtml
Modified:
openejb/trunk/openejb3/examples/webapps/moviefun/pom.xml
openejb/trunk/openejb3/examples/webapps/moviefun/src/main/java/org/superbiz/moviefun/Movies.java
openejb/trunk/openejb3/examples/webapps/moviefun/src/main/java/org/superbiz/moviefun/MoviesImpl.java
openejb/trunk/openejb3/examples/webapps/moviefun/src/main/resources/META-INF/persistence.xml
openejb/trunk/openejb3/examples/webapps/moviefun/src/main/webapp/WEB-INF/web.xml
openejb/trunk/openejb3/examples/webapps/moviefun/src/main/webapp/index.jsp
openejb/trunk/openejb3/examples/webapps/moviefun/src/main/webapp/setup.jsp
Modified: openejb/trunk/openejb3/examples/webapps/moviefun/pom.xml
URL: http://svn.apache.org/viewvc/openejb/trunk/openejb3/examples/webapps/moviefun/pom.xml?rev=1081150&r1=1081149&r2=1081150&view=diff
==============================================================================
--- openejb/trunk/openejb3/examples/webapps/moviefun/pom.xml (original)
+++ openejb/trunk/openejb3/examples/webapps/moviefun/pom.xml Sun Mar 13 16:55:32 2011
@@ -26,7 +26,7 @@
<artifactId>moviefun</artifactId>
<packaging>war</packaging>
<version>1.1-SNAPSHOT</version>
- <name>OpenEJB :: Web Examples :: EJB WebService</name>
+ <name>OpenEJB :: Web Examples :: Moviefun</name>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
@@ -70,11 +70,31 @@
<scope>test</scope>
</dependency>
<dependency>
+ <groupId>javax.servlet</groupId>
+ <artifactId>jstl</artifactId>
+ <version>1.1.2</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.myfaces.core</groupId>
+ <artifactId>myfaces-impl</artifactId>
+ <version>2.0.3</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.myfaces.core</groupId>
+ <artifactId>myfaces-api</artifactId>
+ <version>2.0.3</version>
+ </dependency>
+ <dependency>
<groupId>org.apache.openejb</groupId>
<artifactId>openejb-core</artifactId>
<version>3.2-SNAPSHOT</version>
<scope>test</scope>
</dependency>
+ <dependency>
+ <groupId>taglibs</groupId>
+ <artifactId>standard</artifactId>
+ <version>1.1.2</version>
+ </dependency>
</dependencies>
<!--
This section allows you to configure where to publish libraries for sharing.
Added: openejb/trunk/openejb3/examples/webapps/moviefun/src/main/java/org/superbiz/moviefun/MovieController.java
URL: http://svn.apache.org/viewvc/openejb/trunk/openejb3/examples/webapps/moviefun/src/main/java/org/superbiz/moviefun/MovieController.java?rev=1081150&view=auto
==============================================================================
--- openejb/trunk/openejb3/examples/webapps/moviefun/src/main/java/org/superbiz/moviefun/MovieController.java (added)
+++ openejb/trunk/openejb3/examples/webapps/moviefun/src/main/java/org/superbiz/moviefun/MovieController.java Sun Mar 13 16:55:32 2011
@@ -0,0 +1,238 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.moviefun;
+
+import org.superbiz.moviefun.Movie;
+import org.superbiz.moviefun.util.JsfUtil;
+import org.superbiz.moviefun.util.PaginationHelper;
+
+import java.io.Serializable;
+import java.util.ResourceBundle;
+import javax.ejb.EJB;
+import javax.faces.bean.ManagedBean;
+import javax.faces.bean.SessionScoped;
+import javax.faces.component.UIComponent;
+import javax.faces.context.FacesContext;
+import javax.faces.convert.Converter;
+import javax.faces.convert.FacesConverter;
+import javax.faces.model.DataModel;
+import javax.faces.model.ListDataModel;
+import javax.faces.model.SelectItem;
+
+@ManagedBean (name="movieController")
+@SessionScoped
+public class MovieController implements Serializable {
+
+
+ private Movie current;
+ private DataModel items = null;
+ @EJB private MoviesImpl ejbFacade;
+ private PaginationHelper pagination;
+ private int selectedItemIndex;
+
+ public MovieController() {
+ }
+
+ public Movie getSelected() {
+ if (current == null) {
+ current = new Movie();
+ selectedItemIndex = -1;
+ }
+ return current;
+ }
+
+ private MoviesImpl getFacade() {
+ return ejbFacade;
+ }
+ public PaginationHelper getPagination() {
+ if (pagination == null) {
+ pagination = new PaginationHelper(10) {
+
+ @Override
+ public int getItemsCount() {
+ return getFacade().count();
+ }
+
+ @Override
+ public DataModel createPageDataModel() {
+ return new ListDataModel(getFacade().findRange(new int[]{getPageFirstItem(), getPageFirstItem()+getPageSize()}));
+ }
+ };
+ }
+ return pagination;
+ }
+
+ public String prepareList() {
+ recreateModel();
+ return "List";
+ }
+
+ public String prepareView() {
+ current = (Movie)getItems().getRowData();
+ selectedItemIndex = pagination.getPageFirstItem() + getItems().getRowIndex();
+ return "View";
+ }
+
+ public String prepareCreate() {
+ current = new Movie();
+ selectedItemIndex = -1;
+ return "Create";
+ }
+
+ public String create() {
+ try {
+ getFacade().addMovie(current);
+ JsfUtil.addSuccessMessage(ResourceBundle.getBundle("/Bundle").getString("MovieCreated"));
+ return prepareCreate();
+ } catch (Exception e) {
+ JsfUtil.addErrorMessage(e, ResourceBundle.getBundle("/Bundle").getString("PersistenceErrorOccured"));
+ return null;
+ }
+ }
+
+ public String prepareEdit() {
+ current = (Movie)getItems().getRowData();
+ selectedItemIndex = pagination.getPageFirstItem() + getItems().getRowIndex();
+ return "Edit";
+ }
+
+ public String update() {
+ try {
+ getFacade().editMovie(current);
+ JsfUtil.addSuccessMessage(ResourceBundle.getBundle("/Bundle").getString("MovieUpdated"));
+ return "View";
+ } catch (Exception e) {
+ JsfUtil.addErrorMessage(e, ResourceBundle.getBundle("/Bundle").getString("PersistenceErrorOccured"));
+ return null;
+ }
+ }
+
+ public String destroy() {
+ current = (Movie)getItems().getRowData();
+ selectedItemIndex = pagination.getPageFirstItem() + getItems().getRowIndex();
+ performDestroy();
+ recreateModel();
+ return "List";
+ }
+
+ public String destroyAndView() {
+ performDestroy();
+ recreateModel();
+ updateCurrentItem();
+ if (selectedItemIndex >= 0) {
+ return "View";
+ } else {
+ // all items were removed - go back to list
+ recreateModel();
+ return "List";
+ }
+ }
+
+ private void performDestroy() {
+ try {
+ getFacade().deleteMovie(current);
+ JsfUtil.addSuccessMessage(ResourceBundle.getBundle("/Bundle").getString("MovieDeleted"));
+ } catch (Exception e) {
+ JsfUtil.addErrorMessage(e, ResourceBundle.getBundle("/Bundle").getString("PersistenceErrorOccured"));
+ }
+ }
+
+ private void updateCurrentItem() {
+ int count = getFacade().count();
+ if (selectedItemIndex >= count) {
+ // selected index cannot be bigger than number of items:
+ selectedItemIndex = count-1;
+ // go to previous page if last page disappeared:
+ if (pagination.getPageFirstItem() >= count) {
+ pagination.previousPage();
+ }
+ }
+ if (selectedItemIndex >= 0) {
+ current = getFacade().findRange(new int[]{selectedItemIndex, selectedItemIndex+1}).get(0);
+ }
+ }
+
+ public DataModel getItems() {
+ if (items == null) {
+ items = getPagination().createPageDataModel();
+ }
+ return items;
+ }
+
+ private void recreateModel() {
+ items = null;
+ }
+
+ public String next() {
+ getPagination().nextPage();
+ recreateModel();
+ return "List";
+ }
+
+ public String previous() {
+ getPagination().previousPage();
+ recreateModel();
+ return "List";
+ }
+
+ public SelectItem[] getItemsAvailableSelectMany() {
+ return JsfUtil.getSelectItems(ejbFacade.getMovies(), false);
+ }
+
+ public SelectItem[] getItemsAvailableSelectOne() {
+ return JsfUtil.getSelectItems(ejbFacade.getMovies(), true);
+ }
+
+ @FacesConverter(forClass=Movie.class)
+ public static class MovieControllerConverter implements Converter {
+
+ public Object getAsObject(FacesContext facesContext, UIComponent component, String value) {
+ if (value == null || value.length() == 0) {
+ return null;
+ }
+ MovieController controller = (MovieController)facesContext.getApplication().getELResolver().
+ getValue(facesContext.getELContext(), null, "movieController");
+ return controller.ejbFacade.find(getKey(value));
+ }
+
+ long getKey(String value) {
+ long key;
+ key = Long.parseLong(value);
+ return key;
+ }
+
+ String getStringKey(long value) {
+ StringBuffer sb = new StringBuffer();
+ sb.append(value);
+ return sb.toString();
+ }
+
+ public String getAsString(FacesContext facesContext, UIComponent component, Object object) {
+ if (object == null) {
+ return null;
+ }
+ if (object instanceof Movie) {
+ Movie o = (Movie) object;
+ return getStringKey(o.getId());
+ } else {
+ throw new IllegalArgumentException("object " + object + " is of type " + object.getClass().getName() + "; expected type: "+MovieController.class.getName());
+ }
+ }
+
+ }
+
+}
Modified: openejb/trunk/openejb3/examples/webapps/moviefun/src/main/java/org/superbiz/moviefun/Movies.java
URL: http://svn.apache.org/viewvc/openejb/trunk/openejb3/examples/webapps/moviefun/src/main/java/org/superbiz/moviefun/Movies.java?rev=1081150&r1=1081149&r2=1081150&view=diff
==============================================================================
--- openejb/trunk/openejb3/examples/webapps/moviefun/src/main/java/org/superbiz/moviefun/Movies.java (original)
+++ openejb/trunk/openejb3/examples/webapps/moviefun/src/main/java/org/superbiz/moviefun/Movies.java Sun Mar 13 16:55:32 2011
@@ -16,24 +16,21 @@
*/
package org.superbiz.moviefun;
-import javax.ejb.Local;
import java.util.List;
+import javax.ejb.Local;
+
@Local
public interface Movies {
-
- void addMovie(Movie movie) throws Exception;
-
- void deleteMovie(Movie movie) throws Exception;
-
- void deleteMovieId(long id) throws Exception;
-
- List<Movie> getMovies() throws Exception;
-
- List<Movie> findByTitle(String title) throws Exception;
-
- List<Movie> findByGenre(String genre) throws Exception;
-
- List<Movie> findByDirector(String director) throws Exception;
-
-}
\ No newline at end of file
+ public int count();
+ public List<Movie> findRange(int[] range);
+ public List<Movie> findByDirector(String director);
+ public List<Movie> findByGenre(String genre);
+ public List<Movie> findByTitle(String title);
+ public List<Movie> getMovies();
+ public void deleteMovieId(long id);
+ public void deleteMovie(Movie movie);
+ public void editMovie(Movie movie);
+ public void addMovie(Movie movie);
+ public Movie find(Long id);
+}
Modified: openejb/trunk/openejb3/examples/webapps/moviefun/src/main/java/org/superbiz/moviefun/MoviesImpl.java
URL: http://svn.apache.org/viewvc/openejb/trunk/openejb3/examples/webapps/moviefun/src/main/java/org/superbiz/moviefun/MoviesImpl.java?rev=1081150&r1=1081149&r2=1081150&view=diff
==============================================================================
--- openejb/trunk/openejb3/examples/webapps/moviefun/src/main/java/org/superbiz/moviefun/MoviesImpl.java (original)
+++ openejb/trunk/openejb3/examples/webapps/moviefun/src/main/java/org/superbiz/moviefun/MoviesImpl.java Sun Mar 13 16:55:32 2011
@@ -16,15 +16,23 @@
*/
package org.superbiz.moviefun;
-import javax.ejb.Stateless;
+import java.util.List;
+
import javax.ejb.EJB;
+import javax.ejb.LocalBean;
+import javax.ejb.Stateless;
+import javax.jws.WebService;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
-import javax.persistence.Query;
-import javax.jws.WebService;
-import javax.annotation.Resource;
-import java.util.List;
+import javax.persistence.TypedQuery;
+import javax.persistence.criteria.CriteriaBuilder;
+import javax.persistence.criteria.CriteriaQuery;
+import javax.persistence.criteria.Path;
+import javax.persistence.criteria.Predicate;
+import javax.persistence.criteria.Root;
+import javax.persistence.metamodel.EntityType;
+@LocalBean
@Stateless(name = "Movies")
@WebService(portName = "MoviesPort",
serviceName = "MoviesWebService",
@@ -37,42 +45,87 @@ public class MoviesImpl implements Movie
@PersistenceContext(unitName = "movie-unit")
private EntityManager entityManager;
- public void addMovie(Movie movie) throws Exception {
+ @Override
+ public Movie find(Long id) {
+ return entityManager.find(Movie.class, id);
+ }
+
+ @Override
+ public void addMovie(Movie movie) {
entityManager.persist(movie);
}
+
+ @Override
+ public void editMovie(Movie movie) {
+ entityManager.merge(movie);
+ }
- public void deleteMovie(Movie movie) throws Exception {
+ @Override
+ public void deleteMovie(Movie movie) {
entityManager.remove(movie);
}
- public void deleteMovieId(long id) throws Exception {
+ @Override
+ public void deleteMovieId(long id) {
Movie movie = entityManager.find(Movie.class, id);
entityManager.remove(movie);
notifier.notify("Deleted Movie \"" + movie.getTitle() + "\" (" + movie.getYear() + ")");
}
- public List<Movie> getMovies() throws Exception {
- Query query = entityManager.createQuery("SELECT m from Movie as m");
- return query.getResultList();
- }
-
- public List<Movie> findByTitle(String title) throws Exception {
- Query query = entityManager.createQuery("SELECT m from Movie as m where m.title = ?1");
- query.setParameter(1, title);
- return query.getResultList();
- }
-
- public List<Movie> findByGenre(String genre) throws Exception {
- Query query = entityManager.createQuery("SELECT m from Movie as m where m.genre = ?1");
- query.setParameter(1, genre);
- return query.getResultList();
- }
-
- public List<Movie> findByDirector(String director) throws Exception {
- Query query = entityManager.createQuery("SELECT m from Movie as m where m.director = ?1");
- query.setParameter(1, director);
- return query.getResultList();
+ @Override
+ public List<Movie> getMovies() {
+ CriteriaQuery<Movie> cq = entityManager.getCriteriaBuilder().createQuery(Movie.class);
+ cq.select(cq.from(Movie.class));
+ return entityManager.createQuery(cq).getResultList();
+ }
+
+ @Override
+ public List<Movie> findByTitle(String title) {
+ return findByStringField("title", title);
+ }
+
+ @Override
+ public List<Movie> findByGenre(String genre) {
+ return findByStringField("genre", genre);
+ }
+
+ @Override
+ public List<Movie> findByDirector(String director) {
+ return findByStringField("director", director);
+ }
+
+ private List<Movie> findByStringField(String fieldname, String param) {
+ CriteriaBuilder builder = entityManager.getCriteriaBuilder();
+ CriteriaQuery<Movie> query = builder.createQuery(Movie.class);
+ Root<Movie> root = query.from(Movie.class);
+ EntityType<Movie> type = entityManager.getMetamodel().entity(Movie.class);
+
+ Path<String> path = root.get(type.getDeclaredSingularAttribute(fieldname, String.class));
+ Predicate condition = builder.like(path, "%" + param + "%");
+
+ query.where(condition);
+
+ return entityManager.createQuery(query).getResultList();
+ }
+
+ @Override
+ public List<Movie> findRange(int[] range) {
+ CriteriaQuery<Movie> cq = entityManager.getCriteriaBuilder().createQuery(Movie.class);
+ cq.select(cq.from(Movie.class));
+ TypedQuery<Movie> q = entityManager.createQuery(cq);
+ q.setMaxResults(range[1] - range[0]);
+ q.setFirstResult(range[0]);
+ return q.getResultList();
+ }
+
+ @Override
+ public int count() {
+ CriteriaQuery<Long> cq = entityManager.getCriteriaBuilder().createQuery(Long.class);
+ Root<Movie> rt = cq.from(Movie.class);
+ cq.select(entityManager.getCriteriaBuilder().count(rt));
+ TypedQuery<Long> q = entityManager.createQuery(cq);
+ return (q.getSingleResult()).intValue();
}
}
\ No newline at end of file
Added: openejb/trunk/openejb3/examples/webapps/moviefun/src/main/java/org/superbiz/moviefun/util/JsfUtil.java
URL: http://svn.apache.org/viewvc/openejb/trunk/openejb3/examples/webapps/moviefun/src/main/java/org/superbiz/moviefun/util/JsfUtil.java?rev=1081150&view=auto
==============================================================================
--- openejb/trunk/openejb3/examples/webapps/moviefun/src/main/java/org/superbiz/moviefun/util/JsfUtil.java (added)
+++ openejb/trunk/openejb3/examples/webapps/moviefun/src/main/java/org/superbiz/moviefun/util/JsfUtil.java Sun Mar 13 16:55:32 2011
@@ -0,0 +1,76 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.moviefun.util;
+
+import java.util.List;
+import javax.faces.application.FacesMessage;
+import javax.faces.component.UIComponent;
+import javax.faces.context.FacesContext;
+import javax.faces.convert.Converter;
+import javax.faces.model.SelectItem;
+
+public class JsfUtil {
+
+ public static SelectItem[] getSelectItems(List<?> entities, boolean selectOne) {
+ int size = selectOne ? entities.size() + 1 : entities.size();
+ SelectItem[] items = new SelectItem[size];
+ int i = 0;
+ if (selectOne) {
+ items[0] = new SelectItem("", "---");
+ i++;
+ }
+ for (Object x : entities) {
+ items[i++] = new SelectItem(x, x.toString());
+ }
+ return items;
+ }
+
+ public static void addErrorMessage(Exception ex, String defaultMsg) {
+ String msg = ex.getLocalizedMessage();
+ if (msg != null && msg.length() > 0) {
+ addErrorMessage(msg);
+ } else {
+ addErrorMessage(defaultMsg);
+ }
+ }
+
+ public static void addErrorMessages(List<String> messages) {
+ for (String message : messages) {
+ addErrorMessage(message);
+ }
+ }
+
+ public static void addErrorMessage(String msg) {
+ FacesMessage facesMsg = new FacesMessage(FacesMessage.SEVERITY_ERROR, msg, msg);
+ FacesContext.getCurrentInstance().addMessage(null, facesMsg);
+ }
+
+ public static void addSuccessMessage(String msg) {
+ FacesMessage facesMsg = new FacesMessage(FacesMessage.SEVERITY_INFO, msg, msg);
+ FacesContext.getCurrentInstance().addMessage("successInfo", facesMsg);
+ }
+
+ public static String getRequestParameter(String key) {
+ return FacesContext.getCurrentInstance().getExternalContext().getRequestParameterMap().get(key);
+ }
+
+ public static Object getObjectFromRequestParameter(String requestParameterName, Converter converter, UIComponent component) {
+ String theId = JsfUtil.getRequestParameter(requestParameterName);
+ return converter.getAsObject(FacesContext.getCurrentInstance(), component, theId);
+ }
+
+}
\ No newline at end of file
Added: openejb/trunk/openejb3/examples/webapps/moviefun/src/main/java/org/superbiz/moviefun/util/PaginationHelper.java
URL: http://svn.apache.org/viewvc/openejb/trunk/openejb3/examples/webapps/moviefun/src/main/java/org/superbiz/moviefun/util/PaginationHelper.java?rev=1081150&view=auto
==============================================================================
--- openejb/trunk/openejb3/examples/webapps/moviefun/src/main/java/org/superbiz/moviefun/util/PaginationHelper.java (added)
+++ openejb/trunk/openejb3/examples/webapps/moviefun/src/main/java/org/superbiz/moviefun/util/PaginationHelper.java Sun Mar 13 16:55:32 2011
@@ -0,0 +1,74 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.superbiz.moviefun.util;
+
+import javax.faces.model.DataModel;
+
+public abstract class PaginationHelper {
+
+ private int pageSize;
+ private int page;
+
+ public PaginationHelper(int pageSize) {
+ this.pageSize = pageSize;
+ }
+
+ public abstract int getItemsCount();
+
+ public abstract DataModel createPageDataModel();
+
+ public int getPageFirstItem() {
+ return page*pageSize;
+ }
+
+ public int getPageLastItem() {
+ int i = getPageFirstItem() + pageSize -1;
+ int count = getItemsCount() - 1;
+ if (i > count) {
+ i = count;
+ }
+ if (i < 0) {
+ i = 0;
+ }
+ return i;
+ }
+
+ public boolean isHasNextPage() {
+ return (page+1)*pageSize+1 <= getItemsCount();
+ }
+
+ public void nextPage() {
+ if (isHasNextPage()) {
+ page++;
+ }
+ }
+
+ public boolean isHasPreviousPage() {
+ return page > 0;
+ }
+
+ public void previousPage() {
+ if (isHasPreviousPage()) {
+ page--;
+ }
+ }
+
+ public int getPageSize() {
+ return pageSize;
+ }
+
+}
Added: openejb/trunk/openejb3/examples/webapps/moviefun/src/main/resources/Bundle.properties
URL: http://svn.apache.org/viewvc/openejb/trunk/openejb3/examples/webapps/moviefun/src/main/resources/Bundle.properties?rev=1081150&view=auto
==============================================================================
--- openejb/trunk/openejb3/examples/webapps/moviefun/src/main/resources/Bundle.properties (added)
+++ openejb/trunk/openejb3/examples/webapps/moviefun/src/main/resources/Bundle.properties Sun Mar 13 16:55:32 2011
@@ -0,0 +1,71 @@
+PersistenceErrorOccured=A persistence error occurred.
+Previous=Previous
+Next=Next
+
+MovieCreated=Movie was successfully created.
+MovieUpdated=Movie was successfully updated.
+MovieDeleted=Movie was successfully deleted.
+CreateMovieTitle=Create New Movie
+CreateMovieSaveLink=Save
+CreateMovieShowAllLink=Show All Movie Items
+CreateMovieIndexLink=Index
+CreateMovieLabel_id=Id:
+CreateMovieTitle_id=Id
+CreateMovieLabel_director=Director:
+CreateMovieTitle_director=Director
+CreateMovieLabel_title=Title:
+CreateMovieTitle_title=Title
+CreateMovieLabel_year=Year:
+CreateMovieTitle_year=Year
+CreateMovieLabel_genre=Genre:
+CreateMovieTitle_genre=Genre
+CreateMovieLabel_rating=Rating:
+CreateMovieTitle_rating=Rating
+EditMovieTitle=Edit Movie
+EditMovieSaveLink=Save
+EditMovieViewLink=View
+EditMovieShowAllLink=Show All Movie Items
+EditMovieIndexLink=Index
+EditMovieLabel_id=Id:
+EditMovieTitle_id=Id
+EditMovieLabel_director=Director:
+EditMovieTitle_director=Director
+EditMovieLabel_title=Title:
+EditMovieTitle_title=Title
+EditMovieLabel_year=Year:
+EditMovieTitle_year=Year
+EditMovieLabel_genre=Genre:
+EditMovieTitle_genre=Genre
+EditMovieLabel_rating=Rating:
+EditMovieTitle_rating=Rating
+ViewMovieTitle=View
+ViewMovieDestroyLink=Destroy
+ViewMovieEditLink=Edit
+ViewMovieCreateLink=Create New Movie
+ViewMovieShowAllLink=Show All Movie Items
+ViewMovieIndexLink=Index
+ViewMovieLabel_id=Id:
+ViewMovieTitle_id=Id
+ViewMovieLabel_director=Director:
+ViewMovieTitle_director=Director
+ViewMovieLabel_title=Title:
+ViewMovieTitle_title=Title
+ViewMovieLabel_year=Year:
+ViewMovieTitle_year=Year
+ViewMovieLabel_genre=Genre:
+ViewMovieTitle_genre=Genre
+ViewMovieLabel_rating=Rating:
+ViewMovieTitle_rating=Rating
+ListMovieTitle=List
+ListMovieEmpty=(No Movie Items Found)
+ListMovieDestroyLink=Destroy
+ListMovieEditLink=Edit
+ListMovieViewLink=View
+ListMovieCreateLink=Create New Movie
+ListMovieIndexLink=Index
+ListMovieTitle_id=Id
+ListMovieTitle_director=Director
+ListMovieTitle_title=Title
+ListMovieTitle_year=Year
+ListMovieTitle_genre=Genre
+ListMovieTitle_rating=Rating
Modified: openejb/trunk/openejb3/examples/webapps/moviefun/src/main/resources/META-INF/persistence.xml
URL: http://svn.apache.org/viewvc/openejb/trunk/openejb3/examples/webapps/moviefun/src/main/resources/META-INF/persistence.xml?rev=1081150&r1=1081149&r2=1081150&view=diff
==============================================================================
--- openejb/trunk/openejb3/examples/webapps/moviefun/src/main/resources/META-INF/persistence.xml (original)
+++ openejb/trunk/openejb3/examples/webapps/moviefun/src/main/resources/META-INF/persistence.xml Sun Mar 13 16:55:32 2011
@@ -16,8 +16,7 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
-<persistence xmlns="http://java.sun.com/xml/ns/persistence" version="1.0">
-
+<persistence version="2.0" xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd">
<persistence-unit name="movie-unit">
<jta-data-source>movieDatabase</jta-data-source>
<non-jta-data-source>movieDatabaseUnmanaged</non-jta-data-source>
@@ -27,4 +26,4 @@
<property name="openjpa.jdbc.SynchronizeMappings" value="buildSchema(ForeignKeys=true)"/>
</properties>
</persistence-unit>
-</persistence>
\ No newline at end of file
+</persistence>
Added: openejb/trunk/openejb3/examples/webapps/moviefun/src/main/webapp/META-INF/context.xml
URL: http://svn.apache.org/viewvc/openejb/trunk/openejb3/examples/webapps/moviefun/src/main/webapp/META-INF/context.xml?rev=1081150&view=auto
==============================================================================
--- openejb/trunk/openejb3/examples/webapps/moviefun/src/main/webapp/META-INF/context.xml (added)
+++ openejb/trunk/openejb3/examples/webapps/moviefun/src/main/webapp/META-INF/context.xml Sun Mar 13 16:55:32 2011
@@ -0,0 +1,2 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<Context antiJARLocking="true" path="/moviefun"/>
Added: openejb/trunk/openejb3/examples/webapps/moviefun/src/main/webapp/WEB-INF/faces-config.xml
URL: http://svn.apache.org/viewvc/openejb/trunk/openejb3/examples/webapps/moviefun/src/main/webapp/WEB-INF/faces-config.xml?rev=1081150&view=auto
==============================================================================
--- openejb/trunk/openejb3/examples/webapps/moviefun/src/main/webapp/WEB-INF/faces-config.xml (added)
+++ openejb/trunk/openejb3/examples/webapps/moviefun/src/main/webapp/WEB-INF/faces-config.xml Sun Mar 13 16:55:32 2011
@@ -0,0 +1,29 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<!--
+
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<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">
+ <application>
+ <resource-bundle>
+ <base-name>/Bundle</base-name>
+ <var>bundle</var>
+ </resource-bundle>
+ </application>
+</faces-config>
Modified: openejb/trunk/openejb3/examples/webapps/moviefun/src/main/webapp/WEB-INF/web.xml
URL: http://svn.apache.org/viewvc/openejb/trunk/openejb3/examples/webapps/moviefun/src/main/webapp/WEB-INF/web.xml?rev=1081150&r1=1081149&r2=1081150&view=diff
==============================================================================
--- openejb/trunk/openejb3/examples/webapps/moviefun/src/main/webapp/WEB-INF/web.xml (original)
+++ openejb/trunk/openejb3/examples/webapps/moviefun/src/main/webapp/WEB-INF/web.xml Sun Mar 13 16:55:32 2011
@@ -16,18 +16,25 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
-
-<!-- $Rev: 634170 $ $Date: 2008-03-05 21:30:10 -0800 (Wed, 05 Mar 2008) $ -->
-
-<web-app 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"
- metadata-complete="false"
- version="2.5">
-
- <servlet>
- <servlet-name>ActionServlet</servlet-name>
- <servlet-class>org.superbiz.moviefun.ActionServlet</servlet-class>
- </servlet>
-
+<web-app version="3.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-app_3_0.xsd">
+ <context-param>
+ <param-name>javax.faces.PROJECT_STAGE</param-name>
+ <param-value>Development</param-value>
+ </context-param>
+ <servlet>
+ <servlet-name>ActionServlet</servlet-name>
+ <servlet-class>org.superbiz.moviefun.ActionServlet</servlet-class>
+ </servlet>
+ <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>/faces/*</url-pattern>
+ </servlet-mapping>
+ <welcome-file-list>
+ <welcome-file>index.jsp</welcome-file>
+ </welcome-file-list>
</web-app>
Modified: openejb/trunk/openejb3/examples/webapps/moviefun/src/main/webapp/index.jsp
URL: http://svn.apache.org/viewvc/openejb/trunk/openejb3/examples/webapps/moviefun/src/main/webapp/index.jsp?rev=1081150&r1=1081149&r2=1081150&view=diff
==============================================================================
--- openejb/trunk/openejb3/examples/webapps/moviefun/src/main/webapp/index.jsp (original)
+++ openejb/trunk/openejb3/examples/webapps/moviefun/src/main/webapp/index.jsp Sun Mar 13 16:55:32 2011
@@ -14,191 +14,18 @@
See the License for the specific language governing permissions and
limitations under the License.
--%>
-<%@ page import="org.superbiz.moviefun.Movie,
- org.superbiz.moviefun.Movies,
- javax.naming.InitialContext,
- java.util.List,
- java.util.ListIterator" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
-<%
-
- InitialContext initialContext = new InitialContext();
- Movies moviesBean = (Movies) initialContext.lookup("java:comp/env/movies");
-
- List movies = null;
- ListIterator listIterator = null;
- int display = 5;
- String action = request.getParameter("action");
-
- if ("Add".equals(action)) {
-
- String title = request.getParameter("title");
- String director = request.getParameter("director");
- String genre = request.getParameter("genre");
- int rating = Integer.parseInt(request.getParameter("rating"));
- int year = Integer.parseInt(request.getParameter("year"));
-
- Movie movie = new Movie(title, director, genre, rating, year);
-
- moviesBean.addMovie(movie);
-
- } else if ("Remove".equals(action)) {
-
- String[] ids = request.getParameterValues("id");
- for (String id : ids) {
- moviesBean.deleteMovieId(new Long(id));
- }
-
- } else if (">>".equals(action)) {
-
- movies = (List) session.getAttribute("movies.collection");
- listIterator = (ListIterator) session.getAttribute("movies.iterator");
-
- } else if ("<<".equals(action)) {
-
- movies = (List) session.getAttribute("movies.collection");
- listIterator = (ListIterator) session.getAttribute("movies.iterator");
- for (int i = display * 2; i > 0 && listIterator.hasPrevious(); i--) {
- listIterator.previous(); // backup
- }
-
- } else if ("findByTitle".equals(action)) {
-
- movies = moviesBean.findByTitle(request.getParameter("key"));
-
- } else if ("findByDirector".equals(action)) {
-
- movies = moviesBean.findByDirector(request.getParameter("key"));
-
- } else if ("findByGenre".equals(action)) {
-
- movies = moviesBean.findByGenre(request.getParameter("key"));
- }
-
- if (movies == null) {
- try {
- movies = moviesBean.getMovies();
- } catch (Throwable e) {
- // We must not have run setup yet
- response.sendRedirect("setup.jsp");
- return;
- }
- }
-
- if (listIterator == null) {
- listIterator = movies.listIterator();
- }
-
- session.setAttribute("movies.collection", movies);
- session.setAttribute("movies.iterator", listIterator);
-%>
<html>
<head><title>Moviefun :: Index</title>
<link rel="stylesheet" href="default.css" type="text/css" />
-
</head>
<body>
<p/>
<div id="Content">
-<table>
-<tr>
-<td>
- <table border="0" cellpadding="0" cellspacing="0" width="100%">
- <tr class="topBar">
- <td align="left" width="85%">
- <span class="topBarDiv">Mini-Movie Application</span>
- </td>
- <td align="right" valign="middle" width="1%" nowrap>
- <form method="POST" action="index.jsp" name="findMovie" style="padding: 1px; margin: 1px">
- <select name="action">
- <option value="findByTitle">Title</option>
- <option value="findByDirector">Director</option>
- <option value="findByGenre">Genre</option>
- </select>
- <input type="text" name="key" size="20"/>
- <input type="submit" value="Search"/>
- </form>
- </td>
- </tr>
- </table>
-
-</td>
-</tr>
-<tr>
-<td>
- <div class="basicPanelContainer" style="width: 100%">
-
- <div class="basicPanelTitle">Movies</div>
-
- <div class="basicPanelBody">
- <form method="POST" action="index.jsp" name="listMovies" style="padding: 1px; margin: 1px">
- <table class="tableview" width="100%" cellspacing="0" cellpadding="0" style="padding: 5px">
- <tr>
- <th>Title</th>
- <th>Director</th>
- <th>Genre</th>
- <th>Rating</th>
- <th>Year</th>
- <th> </th>
- </tr>
- <%
- int start = listIterator.nextIndex();
- for (int i=display; i > 0 && listIterator.hasNext(); i-- ) {
- Movie movie = (Movie) listIterator.next();
- %>
- <tr>
- <td width="200"><%=movie.getTitle()%></td>
- <td width="120"><%=movie.getDirector()%></td>
- <td width="90"><%=movie.getGenre()%></td>
- <td width="50"><%=movie.getRating()%></td>
- <td width="50"><%=movie.getYear()%></td>
- <td><input type="checkbox" name="id" value="<%=movie.getId()%>"></td>
- </tr>
-
- <% } %>
- </table>
- <table width="100%" cellspacing="0" cellpadding="0" style="padding: 5px">
- <tr>
- <td>
- <% if (start!=0&&listIterator.hasPrevious()){%><input type="submit" name="action" value="<<"/><%}%>
-
- <%=start+1%> - <%=listIterator.nextIndex()%> of <%=movies.size()%>
-
- <% if (listIterator.hasNext()){%><input type="submit" name="action" value=">>"/><%}%>
- </td>
- <td align="right">
- <input type="submit" name="action" value="Remove"/>
- </td>
- </tr>
- </table>
- </form>
- </div>
- </div>
-</td>
-</tr>
-<tr>
-<td>
- <div class="basicPanelContainer" style="width: 100%">
- <div class="basicPanelTitle">Add</div>
- <div class="basicPanelBody">
- <form method="POST" action="index.jsp" name="addMovie" style="padding: 1px; margin: 1px">
- <table width="100%" cellspacing="0" cellpadding="0" style="padding: 0px">
- <tr>
- <td width="200"><input type="text" name="title" size="29"/></td>
- <td width="120"><input type="text" name="director" size="17"/></td>
- <td width="90"><input type="text" name="genre" size="14"/></td>
- <td width="50"><input type="text" name="rating" size="7"/></td>
- <td width="50"><input type="text" name="year" size="4"/></td>
- <td><input type="submit" name="action" value="Add"/></td>
- </tr>
- </table>
- </form>
-
- </div>
- </div>
-</td>
-</tr>
-</table>
+ <p>Please select one of the following links:</p>
+ <a href="setup.jsp">Setup</a> - Sets up the application with some sample data<br />
+ <a href="moviefun.jsp">JSP</a> - Use the JSP version of the application<br />
+ <a href="faces/index.xhtml">JSF</a> - Use the JSF 2 version of the application<br />
<div class="bottomshadow"></div>
Added: openejb/trunk/openejb3/examples/webapps/moviefun/src/main/webapp/index.xhtml
URL: http://svn.apache.org/viewvc/openejb/trunk/openejb3/examples/webapps/moviefun/src/main/webapp/index.xhtml?rev=1081150&view=auto
==============================================================================
--- openejb/trunk/openejb3/examples/webapps/moviefun/src/main/webapp/index.xhtml (added)
+++ openejb/trunk/openejb3/examples/webapps/moviefun/src/main/webapp/index.xhtml Sun Mar 13 16:55:32 2011
@@ -0,0 +1,34 @@
+<?xml version='1.0' encoding='UTF-8' ?>
+<!--
+
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:h="http://java.sun.com/jsf/html">
+ <h:head>
+ <title>Moviefun Sample Application :: JSF 2.0</title>
+<h:outputStylesheet name="css/jsfcrud.css"/>
+ </h:head>
+ <h:body>
+ Welcome to the Moviefun sample application!
+ <h:form>
+ <h:commandLink action="/movie/List" value="Show All Movie Items"/>
+ </h:form>
+ </h:body>
+
+</html>
+
Added: openejb/trunk/openejb3/examples/webapps/moviefun/src/main/webapp/movie/Create.xhtml
URL: http://svn.apache.org/viewvc/openejb/trunk/openejb3/examples/webapps/moviefun/src/main/webapp/movie/Create.xhtml?rev=1081150&view=auto
==============================================================================
--- openejb/trunk/openejb3/examples/webapps/moviefun/src/main/webapp/movie/Create.xhtml (added)
+++ openejb/trunk/openejb3/examples/webapps/moviefun/src/main/webapp/movie/Create.xhtml Sun Mar 13 16:55:32 2011
@@ -0,0 +1,60 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<!--
+
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<html xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:ui="http://java.sun.com/jsf/facelets"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:f="http://java.sun.com/jsf/core">
+
+ <ui:composition template="/template.xhtml">
+ <ui:define name="title">
+ <h:outputText value="#{bundle.CreateMovieTitle}"></h:outputText>
+ </ui:define>
+ <ui:define name="body">
+ <h:panelGroup id="messagePanel" layout="block">
+ <h:messages errorStyle="color: red" infoStyle="color: green" layout="table"/>
+ </h:panelGroup>
+ <h:form>
+ <h:panelGrid columns="2">
+ <h:outputLabel value="#{bundle.CreateMovieLabel_id}" for="id" />
+ <h:inputText id="id" value="#{movieController.selected.id}" title="#{bundle.CreateMovieTitle_id}" />
+ <h:outputLabel value="#{bundle.CreateMovieLabel_director}" for="director" />
+ <h:inputText id="director" value="#{movieController.selected.director}" title="#{bundle.CreateMovieTitle_director}" />
+ <h:outputLabel value="#{bundle.CreateMovieLabel_title}" for="title" />
+ <h:inputText id="title" value="#{movieController.selected.title}" title="#{bundle.CreateMovieTitle_title}" />
+ <h:outputLabel value="#{bundle.CreateMovieLabel_year}" for="year" />
+ <h:inputText id="year" value="#{movieController.selected.year}" title="#{bundle.CreateMovieTitle_year}" />
+ <h:outputLabel value="#{bundle.CreateMovieLabel_genre}" for="genre" />
+ <h:inputText id="genre" value="#{movieController.selected.genre}" title="#{bundle.CreateMovieTitle_genre}" />
+ <h:outputLabel value="#{bundle.CreateMovieLabel_rating}" for="rating" />
+ <h:inputText id="rating" value="#{movieController.selected.rating}" title="#{bundle.CreateMovieTitle_rating}" />
+ </h:panelGrid>
+ <br />
+ <h:commandLink action="#{movieController.create}" value="#{bundle.CreateMovieSaveLink}" />
+ <br />
+ <br />
+ <h:commandLink action="#{movieController.prepareList}" value="#{bundle.CreateMovieShowAllLink}" immediate="true"/>
+ <br />
+ <br />
+ <h:commandLink value="#{bundle.CreateMovieIndexLink}" action="/index" immediate="true" />
+ </h:form>
+ </ui:define>
+ </ui:composition>
+
+</html>
Added: openejb/trunk/openejb3/examples/webapps/moviefun/src/main/webapp/movie/Edit.xhtml
URL: http://svn.apache.org/viewvc/openejb/trunk/openejb3/examples/webapps/moviefun/src/main/webapp/movie/Edit.xhtml?rev=1081150&view=auto
==============================================================================
--- openejb/trunk/openejb3/examples/webapps/moviefun/src/main/webapp/movie/Edit.xhtml (added)
+++ openejb/trunk/openejb3/examples/webapps/moviefun/src/main/webapp/movie/Edit.xhtml Sun Mar 13 16:55:32 2011
@@ -0,0 +1,61 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<!--
+
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<html xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:ui="http://java.sun.com/jsf/facelets"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:f="http://java.sun.com/jsf/core">
+
+ <ui:composition template="/template.xhtml">
+ <ui:define name="title">
+ <h:outputText value="#{bundle.EditMovieTitle}"></h:outputText>
+ </ui:define>
+ <ui:define name="body">
+ <h:panelGroup id="messagePanel" layout="block">
+ <h:messages errorStyle="color: red" infoStyle="color: green" layout="table"/>
+ </h:panelGroup>
+ <h:form>
+ <h:panelGrid columns="2">
+ <h:outputLabel value="#{bundle.EditMovieLabel_id}" for="id" />
+ <h:inputText id="id" value="#{movieController.selected.id}" title="#{bundle.EditMovieTitle_id}" />
+ <h:outputLabel value="#{bundle.EditMovieLabel_director}" for="director" />
+ <h:inputText id="director" value="#{movieController.selected.director}" title="#{bundle.EditMovieTitle_director}" />
+ <h:outputLabel value="#{bundle.EditMovieLabel_title}" for="title" />
+ <h:inputText id="title" value="#{movieController.selected.title}" title="#{bundle.EditMovieTitle_title}" />
+ <h:outputLabel value="#{bundle.EditMovieLabel_year}" for="year" />
+ <h:inputText id="year" value="#{movieController.selected.year}" title="#{bundle.EditMovieTitle_year}" />
+ <h:outputLabel value="#{bundle.EditMovieLabel_genre}" for="genre" />
+ <h:inputText id="genre" value="#{movieController.selected.genre}" title="#{bundle.EditMovieTitle_genre}" />
+ <h:outputLabel value="#{bundle.EditMovieLabel_rating}" for="rating" />
+ <h:inputText id="rating" value="#{movieController.selected.rating}" title="#{bundle.EditMovieTitle_rating}" />
+ </h:panelGrid>
+ <h:commandLink action="#{movieController.update}" value="#{bundle.EditMovieSaveLink}"/>
+ <br />
+ <br />
+ <h:commandLink action="View" value="#{bundle.EditMovieViewLink}" immediate="true"/>
+ <br />
+ <h:commandLink action="#{movieController.prepareList}" value="#{bundle.EditMovieShowAllLink}" immediate="true"/>
+ <br />
+ <br />
+ <h:commandLink value="#{bundle.EditMovieIndexLink}" action="/index" immediate="true" />
+ </h:form>
+ </ui:define>
+ </ui:composition>
+
+</html>
Added: openejb/trunk/openejb3/examples/webapps/moviefun/src/main/webapp/movie/List.xhtml
URL: http://svn.apache.org/viewvc/openejb/trunk/openejb3/examples/webapps/moviefun/src/main/webapp/movie/List.xhtml?rev=1081150&view=auto
==============================================================================
--- openejb/trunk/openejb3/examples/webapps/moviefun/src/main/webapp/movie/List.xhtml (added)
+++ openejb/trunk/openejb3/examples/webapps/moviefun/src/main/webapp/movie/List.xhtml Sun Mar 13 16:55:32 2011
@@ -0,0 +1,97 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<!--
+
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<html xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:ui="http://java.sun.com/jsf/facelets"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:f="http://java.sun.com/jsf/core">
+
+ <ui:composition template="/template.xhtml">
+ <ui:define name="title">
+ <h:outputText value="#{bundle.ListMovieTitle}"></h:outputText>
+ </ui:define>
+ <ui:define name="body">
+ <h:form styleClass="jsfcrud_list_form">
+ <h:panelGroup id="messagePanel" layout="block">
+ <h:messages errorStyle="color: red" infoStyle="color: green" layout="table"/>
+ </h:panelGroup>
+ <h:outputText escape="false" value="#{bundle.ListMovieEmpty}" rendered="#{movieController.items.rowCount == 0}"/>
+ <h:panelGroup rendered="#{movieController.items.rowCount > 0}">
+ <h:outputText value="#{movieController.pagination.pageFirstItem + 1}..#{movieController.pagination.pageLastItem + 1}/#{movieController.pagination.itemsCount}"/>
+ <h:commandLink action="#{movieController.previous}" value="#{bundle.Previous} #{movieController.pagination.pageSize}" rendered="#{movieController.pagination.hasPreviousPage}"/>
+ <h:commandLink action="#{movieController.next}" value="#{bundle.Next} #{movieController.pagination.pageSize}" rendered="#{movieController.pagination.hasNextPage}"/>
+ <h:dataTable value="#{movieController.items}" var="item" border="0" cellpadding="2" cellspacing="0" rowClasses="jsfcrud_odd_row,jsfcrud_even_row" rules="all" style="border:solid 1px">
+ <h:column>
+ <f:facet name="header">
+ <h:outputText value="#{bundle.ListMovieTitle_id}"/>
+ </f:facet>
+ <h:outputText value="#{item.id}"/>
+ </h:column>
+ <h:column>
+ <f:facet name="header">
+ <h:outputText value="#{bundle.ListMovieTitle_director}"/>
+ </f:facet>
+ <h:outputText value="#{item.director}"/>
+ </h:column>
+ <h:column>
+ <f:facet name="header">
+ <h:outputText value="#{bundle.ListMovieTitle_title}"/>
+ </f:facet>
+ <h:outputText value="#{item.title}"/>
+ </h:column>
+ <h:column>
+ <f:facet name="header">
+ <h:outputText value="#{bundle.ListMovieTitle_year}"/>
+ </f:facet>
+ <h:outputText value="#{item.year}"/>
+ </h:column>
+ <h:column>
+ <f:facet name="header">
+ <h:outputText value="#{bundle.ListMovieTitle_genre}"/>
+ </f:facet>
+ <h:outputText value="#{item.genre}"/>
+ </h:column>
+ <h:column>
+ <f:facet name="header">
+ <h:outputText value="#{bundle.ListMovieTitle_rating}"/>
+ </f:facet>
+ <h:outputText value="#{item.rating}"/>
+ </h:column>
+ <h:column>
+ <f:facet name="header">
+ <h:outputText value=" "/>
+ </f:facet>
+ <h:commandLink action="#{movieController.prepareView}" value="#{bundle.ListMovieViewLink}"/>
+ <h:outputText value=" "/>
+ <h:commandLink action="#{movieController.prepareEdit}" value="#{bundle.ListMovieEditLink}"/>
+ <h:outputText value=" "/>
+ <h:commandLink action="#{movieController.destroy}" value="#{bundle.ListMovieDestroyLink}"/>
+ </h:column>
+ </h:dataTable>
+ </h:panelGroup>
+ <br />
+ <h:commandLink action="#{movieController.prepareCreate}" value="#{bundle.ListMovieCreateLink}"/>
+ <br />
+ <br />
+ <h:commandLink value="#{bundle.ListMovieIndexLink}" action="/index" immediate="true" />
+ </h:form>
+ </ui:define>
+ </ui:composition>
+
+</html>
Added: openejb/trunk/openejb3/examples/webapps/moviefun/src/main/webapp/movie/View.xhtml
URL: http://svn.apache.org/viewvc/openejb/trunk/openejb3/examples/webapps/moviefun/src/main/webapp/movie/View.xhtml?rev=1081150&view=auto
==============================================================================
--- openejb/trunk/openejb3/examples/webapps/moviefun/src/main/webapp/movie/View.xhtml (added)
+++ openejb/trunk/openejb3/examples/webapps/moviefun/src/main/webapp/movie/View.xhtml Sun Mar 13 16:55:32 2011
@@ -0,0 +1,65 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<!--
+
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<html xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:ui="http://java.sun.com/jsf/facelets"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:f="http://java.sun.com/jsf/core">
+
+ <ui:composition template="/template.xhtml">
+ <ui:define name="title">
+ <h:outputText value="#{bundle.ViewMovieTitle}"></h:outputText>
+ </ui:define>
+ <ui:define name="body">
+ <h:panelGroup id="messagePanel" layout="block">
+ <h:messages errorStyle="color: red" infoStyle="color: green" layout="table"/>
+ </h:panelGroup>
+ <h:form>
+ <h:panelGrid columns="2">
+ <h:outputText value="#{bundle.ViewMovieLabel_id}"/>
+ <h:outputText value="#{movieController.selected.id}" title="#{bundle.ViewMovieTitle_id}"/>
+ <h:outputText value="#{bundle.ViewMovieLabel_director}"/>
+ <h:outputText value="#{movieController.selected.director}" title="#{bundle.ViewMovieTitle_director}"/>
+ <h:outputText value="#{bundle.ViewMovieLabel_title}"/>
+ <h:outputText value="#{movieController.selected.title}" title="#{bundle.ViewMovieTitle_title}"/>
+ <h:outputText value="#{bundle.ViewMovieLabel_year}"/>
+ <h:outputText value="#{movieController.selected.year}" title="#{bundle.ViewMovieTitle_year}"/>
+ <h:outputText value="#{bundle.ViewMovieLabel_genre}"/>
+ <h:outputText value="#{movieController.selected.genre}" title="#{bundle.ViewMovieTitle_genre}"/>
+ <h:outputText value="#{bundle.ViewMovieLabel_rating}"/>
+ <h:outputText value="#{movieController.selected.rating}" title="#{bundle.ViewMovieTitle_rating}"/>
+ </h:panelGrid>
+ <br />
+ <h:commandLink action="#{movieController.destroyAndView}" value="#{bundle.ViewMovieDestroyLink}"/>
+ <br />
+ <br />
+ <h:commandLink action="Edit" value="#{bundle.ViewMovieEditLink}"/>
+ <br />
+ <h:commandLink action="#{movieController.prepareCreate}" value="#{bundle.ViewMovieCreateLink}" />
+ <br />
+ <h:commandLink action="#{movieController.prepareList}" value="#{bundle.ViewMovieShowAllLink}"/>
+ <br />
+ <br />
+ <h:commandLink value="#{bundle.ViewMovieIndexLink}" action="/index" immediate="true" />
+
+ </h:form>
+ </ui:define>
+ </ui:composition>
+
+</html>
Added: openejb/trunk/openejb3/examples/webapps/moviefun/src/main/webapp/moviefun.jsp
URL: http://svn.apache.org/viewvc/openejb/trunk/openejb3/examples/webapps/moviefun/src/main/webapp/moviefun.jsp?rev=1081150&view=auto
==============================================================================
--- openejb/trunk/openejb3/examples/webapps/moviefun/src/main/webapp/moviefun.jsp (added)
+++ openejb/trunk/openejb3/examples/webapps/moviefun/src/main/webapp/moviefun.jsp Sun Mar 13 16:55:32 2011
@@ -0,0 +1,216 @@
+<%--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+--%>
+<%@ page import="org.superbiz.moviefun.Movie,
+ org.superbiz.moviefun.Movies,
+ javax.naming.InitialContext,
+ java.util.List,
+ java.util.ListIterator" %>
+<%@ page contentType="text/html;charset=UTF-8" language="java" %>
+<%
+
+ InitialContext initialContext = new InitialContext();
+ Movies moviesBean = (Movies) initialContext.lookup("java:comp/env/movies");
+
+ List movies = null;
+ ListIterator listIterator = null;
+ int display = 5;
+ String action = request.getParameter("action");
+
+ if ("Add".equals(action)) {
+
+ String title = request.getParameter("title");
+ String director = request.getParameter("director");
+ String genre = request.getParameter("genre");
+ int rating = Integer.parseInt(request.getParameter("rating"));
+ int year = Integer.parseInt(request.getParameter("year"));
+
+ Movie movie = new Movie(title, director, genre, rating, year);
+
+ moviesBean.addMovie(movie);
+
+ } else if ("Remove".equals(action)) {
+
+ String[] ids = request.getParameterValues("id");
+ for (String id : ids) {
+ moviesBean.deleteMovieId(new Long(id));
+ }
+
+ } else if (">>".equals(action)) {
+
+ movies = (List) session.getAttribute("movies.collection");
+ listIterator = (ListIterator) session.getAttribute("movies.iterator");
+
+ } else if ("<<".equals(action)) {
+
+ movies = (List) session.getAttribute("movies.collection");
+ listIterator = (ListIterator) session.getAttribute("movies.iterator");
+ for (int i = display * 2; i > 0 && listIterator.hasPrevious(); i--) {
+ listIterator.previous(); // backup
+ }
+
+ } else if ("findByTitle".equals(action)) {
+
+ movies = moviesBean.findByTitle(request.getParameter("key"));
+
+ } else if ("findByDirector".equals(action)) {
+
+ movies = moviesBean.findByDirector(request.getParameter("key"));
+
+ } else if ("findByGenre".equals(action)) {
+
+ movies = moviesBean.findByGenre(request.getParameter("key"));
+ }
+
+ if (movies == null) {
+ try {
+ movies = moviesBean.getMovies();
+ } catch (Throwable e) {
+ // We must not have run setup yet
+ response.sendRedirect("setup.jsp");
+ return;
+ }
+ }
+
+ if (listIterator == null) {
+ listIterator = movies.listIterator();
+ }
+
+ session.setAttribute("movies.collection", movies);
+ session.setAttribute("movies.iterator", listIterator);
+%>
+<html>
+<head><title>Moviefun :: Index</title>
+<link rel="stylesheet" href="default.css" type="text/css" />
+
+</head>
+<body>
+<p/>
+<div id="Content">
+<table>
+<tr>
+<td>
+ <table border="0" cellpadding="0" cellspacing="0" width="100%">
+ <tr class="topBar">
+ <td align="left" width="85%">
+ <span class="topBarDiv">Mini-Movie Application</span>
+ </td>
+ <td align="right" valign="middle" width="1%" nowrap>
+ <form method="POST" action="moviefun.jsp" name="findMovie" style="padding: 1px; margin: 1px">
+ <select name="action">
+ <option value="findByTitle">Title</option>
+ <option value="findByDirector">Director</option>
+ <option value="findByGenre">Genre</option>
+ </select>
+ <input type="text" name="key" size="20"/>
+ <input type="submit" value="Search"/>
+ </form>
+ </td>
+ </tr>
+ </table>
+
+</td>
+</tr>
+<tr>
+<td>
+ <div class="basicPanelContainer" style="width: 100%">
+
+ <div class="basicPanelTitle">Movies</div>
+
+ <div class="basicPanelBody">
+ <form method="POST" action="moviefun.jsp" name="listMovies" style="padding: 1px; margin: 1px">
+ <table class="tableview" width="100%" cellspacing="0" cellpadding="0" style="padding: 5px">
+ <tr>
+ <th>Title</th>
+ <th>Director</th>
+ <th>Genre</th>
+ <th>Rating</th>
+ <th>Year</th>
+ <th> </th>
+ </tr>
+ <%
+ int start = listIterator.nextIndex();
+ for (int i=display; i > 0 && listIterator.hasNext(); i-- ) {
+ Movie movie = (Movie) listIterator.next();
+ %>
+ <tr>
+ <td width="200"><%=movie.getTitle()%></td>
+ <td width="120"><%=movie.getDirector()%></td>
+ <td width="90"><%=movie.getGenre()%></td>
+ <td width="50"><%=movie.getRating()%></td>
+ <td width="50"><%=movie.getYear()%></td>
+ <td><input type="checkbox" name="id" value="<%=movie.getId()%>"></td>
+ </tr>
+
+ <% } %>
+ </table>
+ <table width="100%" cellspacing="0" cellpadding="0" style="padding: 5px">
+ <tr>
+ <td>
+ <% if (start!=0&&listIterator.hasPrevious()){%><input type="submit" name="action" value="<<"/><%}%>
+
+ <%=start+1%> - <%=listIterator.nextIndex()%> of <%=movies.size()%>
+
+ <% if (listIterator.hasNext()){%><input type="submit" name="action" value=">>"/><%}%>
+ </td>
+ <td align="right">
+ <input type="submit" name="action" value="Remove"/>
+ </td>
+ </tr>
+ </table>
+ </form>
+ </div>
+ </div>
+</td>
+</tr>
+<tr>
+<td>
+ <div class="basicPanelContainer" style="width: 100%">
+ <div class="basicPanelTitle">Add</div>
+ <div class="basicPanelBody">
+ <form method="POST" action="moviefun.jsp" name="addMovie" style="padding: 1px; margin: 1px">
+ <table width="100%" cellspacing="0" cellpadding="0" style="padding: 0px">
+ <tr>
+ <td width="200"><input type="text" name="title" size="29"/></td>
+ <td width="120"><input type="text" name="director" size="17"/></td>
+ <td width="90"><input type="text" name="genre" size="14"/></td>
+ <td width="50"><input type="text" name="rating" size="7"/></td>
+ <td width="50"><input type="text" name="year" size="4"/></td>
+ <td><input type="submit" name="action" value="Add"/></td>
+ </tr>
+ </table>
+ </form>
+
+ </div>
+ </div>
+</td>
+</tr>
+</table>
+
+
+ <div class="bottomshadow"></div>
+
+ <div id="poweredby" class="smalltext">
+ Powered by
+ <a href="http://tomcat.apache.org" class="smalltext">Apache Tomcat</a> and
+ <a href="http://openejb.apache.org" class="smalltext">Apache OpenEJB</a>.
+ <br/>
+ </div>
+
+
+</div>
+</body>
+</html>
\ No newline at end of file
Added: openejb/trunk/openejb3/examples/webapps/moviefun/src/main/webapp/resources/css/jsfcrud.css
URL: http://svn.apache.org/viewvc/openejb/trunk/openejb3/examples/webapps/moviefun/src/main/webapp/resources/css/jsfcrud.css?rev=1081150&view=auto
==============================================================================
--- openejb/trunk/openejb3/examples/webapps/moviefun/src/main/webapp/resources/css/jsfcrud.css (added)
+++ openejb/trunk/openejb3/examples/webapps/moviefun/src/main/webapp/resources/css/jsfcrud.css Sun Mar 13 16:55:32 2011
@@ -0,0 +1,99 @@
+<!--
+
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+root {
+ display: block;
+}
+
+body {
+ font-family: Arial, Helvetica, sans-serif;
+ color: #3a4f54;
+ background-color: #dfecf1;
+ font-size: small;
+}
+
+a {
+ color: #e33b06;
+}
+
+table {
+ empty-cells: show;
+}
+
+form.jsfcrud_list_form th, td th {
+ font-size: x-small;
+ color: #4e6a71;
+ border-top-style: solid;
+ border-bottom-style: solid;
+ border-left-style: solid;
+ border-right-style: solid;
+ border-top-width: 1px;
+ border-bottom-width: 1px;
+ border-left-width: 1px;
+ border-right-width: 1px;
+ border-top-color: #b2d5d6;
+ border-bottom-color: #b2d5d6;
+ border-left-color: #90b4bd;
+ border-right-color: #90b4bd;
+ letter-spacing: 3px;
+ text-align: left;
+ padding-top: 6px;
+ padding-bottom: 6px;
+ padding-left: 6px;
+ padding-right: 6px;
+ background-color: #b2d5d6;
+}
+
+td {
+ vertical-align: top;
+ padding-bottom: 8px;
+ font-size: small;
+}
+
+form.jsfcrud_list_form td, td td {
+ border-top-style: solid;
+ border-bottom-style: solid;
+ border-left-style: solid;
+ border-right-style: solid;
+ border-top-width: 1px;
+ border-bottom-width: 1px;
+ border-left-width: 1px;
+ border-right-width: 1px;
+ border-top-color: #b2d5d6;
+ border-bottom-color: #b2d5d6;
+ border-left-color: #b2d5d6;
+ border-right-color: #b2d5d6;
+ vertical-align: baseline;
+ padding-bottom: 0px;
+}
+
+tr.jsfcrud_odd_row {
+ background-color: #fefeff;
+ color: #4e6a71;
+}
+
+
+tr.jsfcrud_even_row {
+ background-color: #eff5fa;
+ color: #4e6a71;
+}
+
+#busyImage {
+ position: absolute;
+ left: 50%;
+ top: 50%;
+}
Modified: openejb/trunk/openejb3/examples/webapps/moviefun/src/main/webapp/setup.jsp
URL: http://svn.apache.org/viewvc/openejb/trunk/openejb3/examples/webapps/moviefun/src/main/webapp/setup.jsp?rev=1081150&r1=1081149&r2=1081150&view=diff
==============================================================================
--- openejb/trunk/openejb3/examples/webapps/moviefun/src/main/webapp/setup.jsp (original)
+++ openejb/trunk/openejb3/examples/webapps/moviefun/src/main/webapp/setup.jsp Sun Mar 13 16:55:32 2011
@@ -59,4 +59,4 @@ Done!
</table>
<h2>Continue</h2>
-<a href="index.jsp">Go to main app</a>
\ No newline at end of file
+<a href="moviefun.jsp">Go to main app</a>
\ No newline at end of file
Added: openejb/trunk/openejb3/examples/webapps/moviefun/src/main/webapp/template.xhtml
URL: http://svn.apache.org/viewvc/openejb/trunk/openejb3/examples/webapps/moviefun/src/main/webapp/template.xhtml?rev=1081150&view=auto
==============================================================================
--- openejb/trunk/openejb3/examples/webapps/moviefun/src/main/webapp/template.xhtml (added)
+++ openejb/trunk/openejb3/examples/webapps/moviefun/src/main/webapp/template.xhtml Sun Mar 13 16:55:32 2011
@@ -0,0 +1,38 @@
+<?xml version='1.0' encoding='UTF-8' ?>
+<!--
+
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:ui="http://java.sun.com/jsf/facelets"
+ xmlns:h="http://java.sun.com/jsf/html">
+ <h:head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <title><ui:insert name="title">Moviefun</ui:insert></title>
+<h:outputStylesheet name="css/jsfcrud.css"/>
+ </h:head>
+
+ <h:body>
+ <h1>
+ <ui:insert name="title">Default Title</ui:insert>
+ </h1>
+ <p>
+ <ui:insert name="body">Default Body</ui:insert>
+ </p>
+ </h:body>
+
+</html>