You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tapestry.apache.org by jk...@apache.org on 2006/03/11 21:55:35 UTC
svn commit: r385164 [8/32] - in /jakarta/tapestry/trunk: ./ .settings/
annotations/src/java/org/apache/tapestry/annotations/
annotations/src/test/org/apache/tapestry/annotations/ config/
contrib/src/documentation/content/xdocs/tapestry-contrib/Componen...
Modified: jakarta/tapestry/trunk/examples/Vlib/src/java/org/apache/tapestry/vlib/EntitySelectionModel.java
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/examples/Vlib/src/java/org/apache/tapestry/vlib/EntitySelectionModel.java?rev=385164&r1=385163&r2=385164&view=diff
==============================================================================
--- jakarta/tapestry/trunk/examples/Vlib/src/java/org/apache/tapestry/vlib/EntitySelectionModel.java (original)
+++ jakarta/tapestry/trunk/examples/Vlib/src/java/org/apache/tapestry/vlib/EntitySelectionModel.java Sat Mar 11 12:54:27 2006
@@ -1,4 +1,4 @@
-// Copyright 2004, 2005, 2006 The Apache Software Foundation
+// Copyright 2004, 2005 The Apache Software Foundation
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -29,17 +29,16 @@
public class EntitySelectionModel implements IPropertySelectionModel
{
- /** Stores a primaryKey/label pair. */
private static class Entry
{
- Integer _primaryKey;
+ Integer primaryKey;
- String _label;
+ String label;
Entry(Integer primaryKey, String label)
{
- this._primaryKey = primaryKey;
- this._label = label;
+ this.primaryKey = primaryKey;
+ this.label = label;
}
}
@@ -68,19 +67,19 @@
public Object getOption(int index)
{
- return get(index)._primaryKey;
+ return get(index).primaryKey;
}
public String getLabel(int index)
{
- return get(index)._label;
+ return get(index).label;
}
public String getValue(int index)
{
Integer primaryKey;
- primaryKey = get(index)._primaryKey;
+ primaryKey = get(index).primaryKey;
if (primaryKey == null)
return "";
@@ -103,4 +102,4 @@
+ "' to an Integer.", e);
}
}
-}
+}
\ No newline at end of file
Modified: jakarta/tapestry/trunk/examples/Vlib/src/java/org/apache/tapestry/vlib/IActivate.java
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/examples/Vlib/src/java/org/apache/tapestry/vlib/IActivate.java?rev=385164&r1=385163&r2=385164&view=diff
==============================================================================
--- jakarta/tapestry/trunk/examples/Vlib/src/java/org/apache/tapestry/vlib/IActivate.java (original)
+++ jakarta/tapestry/trunk/examples/Vlib/src/java/org/apache/tapestry/vlib/IActivate.java Sat Mar 11 12:54:27 2006
@@ -25,5 +25,5 @@
public interface IActivate extends IPage
{
- void activate();
+ public void activate();
}
Modified: jakarta/tapestry/trunk/examples/Vlib/src/java/org/apache/tapestry/vlib/IErrorProperty.java
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/examples/Vlib/src/java/org/apache/tapestry/vlib/IErrorProperty.java?rev=385164&r1=385163&r2=385164&view=diff
==============================================================================
--- jakarta/tapestry/trunk/examples/Vlib/src/java/org/apache/tapestry/vlib/IErrorProperty.java (original)
+++ jakarta/tapestry/trunk/examples/Vlib/src/java/org/apache/tapestry/vlib/IErrorProperty.java Sat Mar 11 12:54:27 2006
@@ -27,7 +27,7 @@
public interface IErrorProperty extends IPage
{
- String getError();
+ public String getError();
- void setError(String value);
-}
+ public void setError(String value);
+}
\ No newline at end of file
Modified: jakarta/tapestry/trunk/examples/Vlib/src/java/org/apache/tapestry/vlib/IMessageProperty.java
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/examples/Vlib/src/java/org/apache/tapestry/vlib/IMessageProperty.java?rev=385164&r1=385163&r2=385164&view=diff
==============================================================================
--- jakarta/tapestry/trunk/examples/Vlib/src/java/org/apache/tapestry/vlib/IMessageProperty.java (original)
+++ jakarta/tapestry/trunk/examples/Vlib/src/java/org/apache/tapestry/vlib/IMessageProperty.java Sat Mar 11 12:54:27 2006
@@ -25,7 +25,7 @@
public interface IMessageProperty extends IPage
{
- String getMessage();
+ public String getMessage();
- void setMessage(String message);
+ public void setMessage(String message);
}
Modified: jakarta/tapestry/trunk/examples/Vlib/src/java/org/apache/tapestry/vlib/OperationsUser.java
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/examples/Vlib/src/java/org/apache/tapestry/vlib/OperationsUser.java?rev=385164&r1=385163&r2=385164&view=diff
==============================================================================
--- jakarta/tapestry/trunk/examples/Vlib/src/java/org/apache/tapestry/vlib/OperationsUser.java (original)
+++ jakarta/tapestry/trunk/examples/Vlib/src/java/org/apache/tapestry/vlib/OperationsUser.java Sat Mar 11 12:54:27 2006
@@ -27,19 +27,18 @@
*
* @author Howard M. Lewis Ship
* @since 4.0
- * @SuppressWarnings("all")
*/
public interface OperationsUser
{
@InjectObject("service:vlib.Operations")
- abstract IOperations getOperations();
+ public abstract IOperations getOperations();
@InjectObject("service:vlib.RemoteTemplate")
- abstract RemoteTemplate getRemoteTemplate();
+ public abstract RemoteTemplate getRemoteTemplate();
@InjectObject("service:vlib.ErrorPresenter")
- abstract ErrorPresenter getErrorPresenter();
+ public abstract ErrorPresenter getErrorPresenter();
@InjectObject("service:vlib.BookQuerySource")
- abstract BookQuerySource getBookQuerySource();
+ public abstract BookQuerySource getBookQuerySource();
}
Modified: jakarta/tapestry/trunk/examples/Vlib/src/java/org/apache/tapestry/vlib/VirtualLibraryDelegate.java
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/examples/Vlib/src/java/org/apache/tapestry/vlib/VirtualLibraryDelegate.java?rev=385164&r1=385163&r2=385164&view=diff
==============================================================================
--- jakarta/tapestry/trunk/examples/Vlib/src/java/org/apache/tapestry/vlib/VirtualLibraryDelegate.java (original)
+++ jakarta/tapestry/trunk/examples/Vlib/src/java/org/apache/tapestry/vlib/VirtualLibraryDelegate.java Sat Mar 11 12:54:27 2006
@@ -1,4 +1,4 @@
-// Copyright 2004, 2005, 2006 The Apache Software Foundation
+// Copyright 2004, 2005 The Apache Software Foundation
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -21,18 +21,17 @@
import org.apache.tapestry.valid.ValidationDelegate;
/**
- * Implementation of {@link org.apache.tapestry.valid.IValidationDelegate} which
- * uses the correct CSS class when rendering errors.
+ * Implementation of {@link org.apache.tapestry.valid.IValidationDelegate} which uses the correct
+ * CSS class when rendering errors.
*
* @author Howard Lewis Ship
*/
public class VirtualLibraryDelegate extends ValidationDelegate
{
-
private static final long serialVersionUID = -1295233610266112824L;
- public void writeLabelPrefix(IFormComponent component, IMarkupWriter writer, IRequestCycle cycle)
+ public void writeLabelPrefix(IFormComponent component, IMarkupWriter writer, IRequestCycle cycle)
{
if (isInError(component))
{
@@ -43,16 +42,20 @@
public void writeLabelSuffix(IFormComponent component, IMarkupWriter writer, IRequestCycle cycle)
{
- if (isInError(component)) writer.end();
+ if (isInError(component))
+ writer.end();
}
- public void writeAttributes(IMarkupWriter writer, IRequestCycle cycle, IFormComponent component,
- IValidator validator)
+ public void writeAttributes(IMarkupWriter writer, IRequestCycle cycle,
+ IFormComponent component, IValidator validator)
{
- if (isInError()) writer.attribute("class", "error");
+ if (isInError())
+ writer.attribute("class", "error");
}
- public void writeSuffix(IMarkupWriter writer, IRequestCycle cycle, IFormComponent component, IValidator validator)
+ public void writeSuffix(IMarkupWriter writer, IRequestCycle cycle, IFormComponent component,
+ IValidator validator)
{
}
-}
+
+}
\ No newline at end of file
Modified: jakarta/tapestry/trunk/examples/Vlib/src/java/org/apache/tapestry/vlib/Visit.java
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/examples/Vlib/src/java/org/apache/tapestry/vlib/Visit.java?rev=385164&r1=385163&r2=385164&view=diff
==============================================================================
--- jakarta/tapestry/trunk/examples/Vlib/src/java/org/apache/tapestry/vlib/Visit.java (original)
+++ jakarta/tapestry/trunk/examples/Vlib/src/java/org/apache/tapestry/vlib/Visit.java Sat Mar 11 12:54:27 2006
@@ -1,4 +1,4 @@
-// Copyright 2004, 2005, 2006 The Apache Software Foundation
+// Copyright 2004, 2005 The Apache Software Foundation
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -20,16 +20,14 @@
import org.apache.tapestry.vlib.ejb.Person;
/**
- * The visit object for the {@link VirtualLibraryEngine}. Primarily, this is
- * used to access the home interfaces and EJB instances, and to identify who the
- * logged in user is.
+ * The visit object for the {@link VirtualLibraryEngine}. Primarily, this is used to access the
+ * home interfaces and EJB instances, and to identify who the logged in user is.
*
* @author Howard Lewis Ship
*/
public class Visit implements Serializable
{
-
private static final long serialVersionUID = 8589862098677603655L;
/**
@@ -39,8 +37,8 @@
private Person _user;
/**
- * Returns the time the user last accessed the database, which may be null
- * if the user hasn't logged in yet.
+ * Returns the time the user last accessed the database, which may be null if the user hasn't
+ * logged in yet.
*/
public Timestamp getLastAccess()
@@ -58,8 +56,7 @@
}
/**
- * Returns the id of the logged in user, or null if the user is not logged
- * in.
+ * Returns the id of the logged in user, or null if the user is not logged in.
*/
public Integer getUserId()
@@ -97,18 +94,20 @@
public boolean isLoggedInUser(Integer id)
{
- if (_user == null) return false;
+ if (_user == null)
+ return false;
return _user.getId().equals(id);
}
/**
- * Invoked by pages after they perform an operation that changes the backend
- * database in such a way that cached data is no longer valid.
+ * Invoked by pages after they perform an operation that changes the backend database in such a
+ * way that cached data is no longer valid.
*/
public void clearCache()
{
_user = null;
}
-}
+
+}
\ No newline at end of file
Modified: jakarta/tapestry/trunk/examples/Vlib/src/java/org/apache/tapestry/vlib/VlibPage.java
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/examples/Vlib/src/java/org/apache/tapestry/vlib/VlibPage.java?rev=385164&r1=385163&r2=385164&view=diff
==============================================================================
--- jakarta/tapestry/trunk/examples/Vlib/src/java/org/apache/tapestry/vlib/VlibPage.java (original)
+++ jakarta/tapestry/trunk/examples/Vlib/src/java/org/apache/tapestry/vlib/VlibPage.java Sat Mar 11 12:54:27 2006
@@ -1,4 +1,4 @@
-// Copyright 2004, 2005, 2006 The Apache Software Foundation
+// Copyright 2004, 2005 The Apache Software Foundation
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -33,27 +33,26 @@
import org.apache.tapestry.vlib.services.ModelSource;
/**
- * Base page used for pages that should be protected by the {@link Login} page.
- * If the user is not logged in, they are redirected to the Login page first.
- * Also, implements an error property and a validationDelegate.
+ * Base page used for pages that should be protected by the {@link Login} page. If the user is not
+ * logged in, they are redirected to the Login page first. Also, implements an error property and a
+ * validationDelegate.
* <p>
* Meta properties (overridden in some subclasses)
* <dl>
* <dt>anonymous-access=false</dt>
* <dd>If true, the page may be accessed without the user being logged in.</dd>
* <dt>admin-page=false</dt>
- * <dd>If true, the user must be logged in as an administrator to access this
- * page.</dd>
+ * <dd>If true, the user must be logged in as an administrator to access this page.</dd>
* </dl>
*
* @author Howard Lewis Ship
*/
-@Meta( { "anonymous-access=false", "admin-page=false" })
-public abstract class VlibPage extends BasePage implements IErrorProperty, IMessageProperty, PageValidateListener,
- OperationsUser
+@Meta(
+{ "anonymous-access=false", "admin-page=false" })
+public abstract class VlibPage extends BasePage implements IErrorProperty, IMessageProperty,
+ PageValidateListener, OperationsUser
{
-
@Bean(VirtualLibraryDelegate.class)
public abstract IValidationDelegate getValidationDelegate();
@@ -77,7 +76,7 @@
protected void setErrorField(String componentId, String message)
{
- IFormComponent component = (IFormComponent)getComponent(componentId);
+ IFormComponent component = (IFormComponent) getComponent(componentId);
IValidationDelegate delegate = getValidationDelegate();
@@ -86,8 +85,7 @@
}
/**
- * Returns true if the delegate indicates an error, or the error property is
- * not null.
+ * Returns true if the delegate indicates an error, or the error property is not null.
*/
protected boolean isInError()
@@ -96,20 +94,23 @@
}
/**
- * Checks if the user is logged in. If not, they are sent to the
- * {@link Login} page before coming back to whatever this page is.
+ * Checks if the user is logged in. If not, they are sent to the {@link Login} page before
+ * coming back to whatever this page is.
*/
public void pageValidate(PageEvent event)
{
- if (isAdminPage()) ensureUserIsLoggedInAsAdmin();
+ if (isAdminPage())
+ ensureUserIsLoggedInAsAdmin();
- if (!getAllowAnonymousAccess()) ensureUserIsLoggedIn();
+ if (!getAllowAnonymousAccess())
+ ensureUserIsLoggedIn();
}
private void ensureUserIsLoggedIn()
{
- if (isUserLoggedIn()) return;
+ if (isUserLoggedIn())
+ return;
// User not logged in ... redirect through the Login page.
@@ -121,8 +122,7 @@
}
/**
- * Returns true if the {@link Visit} exists, and the user is logged in as
- * well.
+ * Returns true if the {@link Visit} exists, and the user is logged in as well.
*
* @return true if logged in
*/
@@ -146,9 +146,11 @@
if (!getVisitState().getUser().isAdmin())
{
- getErrorPresenter().presentError("That function is restricted to administrators.", cycle);
+ getErrorPresenter().presentError(
+ "That function is restricted to administrators.",
+ cycle);
throw new PageRedirectException(cycle.getPage());
}
}
-}
+}
\ No newline at end of file
Modified: jakarta/tapestry/trunk/examples/Vlib/src/java/org/apache/tapestry/vlib/components/BookLink.java
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/examples/Vlib/src/java/org/apache/tapestry/vlib/components/BookLink.java?rev=385164&r1=385163&r2=385164&view=diff
==============================================================================
--- jakarta/tapestry/trunk/examples/Vlib/src/java/org/apache/tapestry/vlib/components/BookLink.java (original)
+++ jakarta/tapestry/trunk/examples/Vlib/src/java/org/apache/tapestry/vlib/components/BookLink.java Sat Mar 11 12:54:27 2006
@@ -57,7 +57,7 @@
* logged in.
*/
- private static final long ONE_WEEK_MILLIS = 1000L * 60L * 60L * 24L * 7L;
+ private static final long ONE_WEEK_MILLIS = 1000l * 60l * 60l * 24l * 7l;
@Parameter(required = true)
public abstract Book getBook();
@@ -100,4 +100,4 @@
return lastAccess.compareTo(dateAdded) <= 0;
}
-}
+}
\ No newline at end of file
Modified: jakarta/tapestry/trunk/examples/Vlib/src/java/org/apache/tapestry/vlib/components/Border.java
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/examples/Vlib/src/java/org/apache/tapestry/vlib/components/Border.java?rev=385164&r1=385163&r2=385164&view=diff
==============================================================================
--- jakarta/tapestry/trunk/examples/Vlib/src/java/org/apache/tapestry/vlib/components/Border.java (original)
+++ jakarta/tapestry/trunk/examples/Vlib/src/java/org/apache/tapestry/vlib/components/Border.java Sat Mar 11 12:54:27 2006
@@ -371,4 +371,4 @@
return _transferBooksRolloverImage;
}
-}
+}
\ No newline at end of file
Modified: jakarta/tapestry/trunk/examples/Vlib/src/java/org/apache/tapestry/vlib/components/Borrow.java
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/examples/Vlib/src/java/org/apache/tapestry/vlib/components/Borrow.java?rev=385164&r1=385163&r2=385164&view=diff
==============================================================================
--- jakarta/tapestry/trunk/examples/Vlib/src/java/org/apache/tapestry/vlib/components/Borrow.java (original)
+++ jakarta/tapestry/trunk/examples/Vlib/src/java/org/apache/tapestry/vlib/components/Borrow.java Sat Mar 11 12:54:27 2006
@@ -130,4 +130,4 @@
return home;
}
-}
+}
\ No newline at end of file
Modified: jakarta/tapestry/trunk/examples/Vlib/src/java/org/apache/tapestry/vlib/components/Browser.java
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/examples/Vlib/src/java/org/apache/tapestry/vlib/components/Browser.java?rev=385164&r1=385163&r2=385164&view=diff
==============================================================================
--- jakarta/tapestry/trunk/examples/Vlib/src/java/org/apache/tapestry/vlib/components/Browser.java (original)
+++ jakarta/tapestry/trunk/examples/Vlib/src/java/org/apache/tapestry/vlib/components/Browser.java Sat Mar 11 12:54:27 2006
@@ -230,4 +230,4 @@
setPageResults(pageResults);
}
-}
+}
\ No newline at end of file
Modified: jakarta/tapestry/trunk/examples/Vlib/src/java/org/apache/tapestry/vlib/pages/BookMatches.java
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/examples/Vlib/src/java/org/apache/tapestry/vlib/pages/BookMatches.java?rev=385164&r1=385163&r2=385164&view=diff
==============================================================================
--- jakarta/tapestry/trunk/examples/Vlib/src/java/org/apache/tapestry/vlib/pages/BookMatches.java (original)
+++ jakarta/tapestry/trunk/examples/Vlib/src/java/org/apache/tapestry/vlib/pages/BookMatches.java Sat Mar 11 12:54:27 2006
@@ -136,4 +136,4 @@
return getRemoteTemplate().execute(callback, "Error processing query.");
}
-}
+}
\ No newline at end of file
Modified: jakarta/tapestry/trunk/examples/Vlib/src/java/org/apache/tapestry/vlib/pages/BorrowedBooks.java
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/examples/Vlib/src/java/org/apache/tapestry/vlib/pages/BorrowedBooks.java?rev=385164&r1=385163&r2=385164&view=diff
==============================================================================
--- jakarta/tapestry/trunk/examples/Vlib/src/java/org/apache/tapestry/vlib/pages/BorrowedBooks.java (original)
+++ jakarta/tapestry/trunk/examples/Vlib/src/java/org/apache/tapestry/vlib/pages/BorrowedBooks.java Sat Mar 11 12:54:27 2006
@@ -155,4 +155,4 @@
}
}
-}
+}
\ No newline at end of file
Modified: jakarta/tapestry/trunk/examples/Vlib/src/java/org/apache/tapestry/vlib/pages/ConfirmBookDelete.java
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/examples/Vlib/src/java/org/apache/tapestry/vlib/pages/ConfirmBookDelete.java?rev=385164&r1=385163&r2=385164&view=diff
==============================================================================
--- jakarta/tapestry/trunk/examples/Vlib/src/java/org/apache/tapestry/vlib/pages/ConfirmBookDelete.java (original)
+++ jakarta/tapestry/trunk/examples/Vlib/src/java/org/apache/tapestry/vlib/pages/ConfirmBookDelete.java Sat Mar 11 12:54:27 2006
@@ -1,4 +1,4 @@
-// Copyright 2004, 2005, 2006 The Apache Software Foundation
+// Copyright 2004, 2005 The Apache Software Foundation
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -19,6 +19,8 @@
import javax.ejb.RemoveException;
import org.apache.hivemind.ApplicationRuntimeException;
+import org.apache.tapestry.IPage;
+import org.apache.tapestry.IRequestCycle;
import org.apache.tapestry.annotations.InjectPage;
import org.apache.tapestry.annotations.Message;
import org.apache.tapestry.annotations.Meta;
@@ -28,9 +30,8 @@
import org.apache.tapestry.vlib.services.RemoteCallback;
/**
- * Presents a confirmation page before deleting a book. If the user selects
- * "yes", the book is deleted; otherwise the user is returned to the
- * {@link MyLibrary} page.
+ * Presents a confirmation page before deleting a book. If the user selects "yes", the book is
+ * deleted; otherwise the user is returned to the {@link MyLibrary} page.
*
* @author Howard Lewis Ship
*/
@@ -38,7 +39,6 @@
@Meta("page-type=MyLibrary")
public abstract class ConfirmBookDelete extends BasePage implements OperationsUser
{
-
public abstract void setBookId(Integer bookId);
public abstract void setBookTitle(String title);
@@ -50,9 +50,9 @@
public abstract String bookDeleted(String title);
/**
- * Invoked (by {@link MyLibrary}) to select a book to be deleted. This
- * method sets the temporary page properties (bookPrimaryKey and bookTitle)
- * and invoked {@link IRequestCycle#setPage(IPage)}.
+ * Invoked (by {@link MyLibrary}) to select a book to be deleted. This method sets the
+ * temporary page properties (bookPrimaryKey and bookTitle) and invoked
+ * {@link IRequestCycle#setPage(IPage)}.
*/
public void selectBook(Integer bookId)
@@ -74,9 +74,7 @@
{
RemoteCallback<Book> callback = new RemoteCallback()
{
-
- public Book doRemote()
- throws RemoteException
+ public Book doRemote() throws RemoteException
{
try
{
@@ -97,4 +95,4 @@
myLibrary.activate();
}
-}
+}
\ No newline at end of file
Modified: jakarta/tapestry/trunk/examples/Vlib/src/java/org/apache/tapestry/vlib/pages/EditBook.java
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/examples/Vlib/src/java/org/apache/tapestry/vlib/pages/EditBook.java?rev=385164&r1=385163&r2=385164&view=diff
==============================================================================
--- jakarta/tapestry/trunk/examples/Vlib/src/java/org/apache/tapestry/vlib/pages/EditBook.java (original)
+++ jakarta/tapestry/trunk/examples/Vlib/src/java/org/apache/tapestry/vlib/pages/EditBook.java Sat Mar 11 12:54:27 2006
@@ -175,4 +175,4 @@
setAttributes(new HashMap());
}
-}
+}
\ No newline at end of file
Modified: jakarta/tapestry/trunk/examples/Vlib/src/java/org/apache/tapestry/vlib/pages/EditProfile.java
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/examples/Vlib/src/java/org/apache/tapestry/vlib/pages/EditProfile.java?rev=385164&r1=385163&r2=385164&view=diff
==============================================================================
--- jakarta/tapestry/trunk/examples/Vlib/src/java/org/apache/tapestry/vlib/pages/EditProfile.java (original)
+++ jakarta/tapestry/trunk/examples/Vlib/src/java/org/apache/tapestry/vlib/pages/EditProfile.java Sat Mar 11 12:54:27 2006
@@ -181,4 +181,4 @@
setAttributes(new HashMap());
}
-}
+}
\ No newline at end of file
Modified: jakarta/tapestry/trunk/examples/Vlib/src/java/org/apache/tapestry/vlib/pages/Home.java
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/examples/Vlib/src/java/org/apache/tapestry/vlib/pages/Home.java?rev=385164&r1=385163&r2=385164&view=diff
==============================================================================
--- jakarta/tapestry/trunk/examples/Vlib/src/java/org/apache/tapestry/vlib/pages/Home.java (original)
+++ jakarta/tapestry/trunk/examples/Vlib/src/java/org/apache/tapestry/vlib/pages/Home.java Sat Mar 11 12:54:27 2006
@@ -42,8 +42,7 @@
public abstract BookMatches getBookMatches();
/**
- * Listener method, invokes
- * {@link BookMatches#performQuery(MasterQueryParameters)}.
+ * Listener method, invokes {@link BookMatches#performQuery(MasterQueryParameters)}.
*/
public void search()
@@ -56,4 +55,4 @@
matches.performQuery(parameters);
}
-}
+}
\ No newline at end of file
Modified: jakarta/tapestry/trunk/examples/Vlib/src/java/org/apache/tapestry/vlib/pages/Login.java
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/examples/Vlib/src/java/org/apache/tapestry/vlib/pages/Login.java?rev=385164&r1=385163&r2=385164&view=diff
==============================================================================
--- jakarta/tapestry/trunk/examples/Vlib/src/java/org/apache/tapestry/vlib/pages/Login.java (original)
+++ jakarta/tapestry/trunk/examples/Vlib/src/java/org/apache/tapestry/vlib/pages/Login.java Sat Mar 11 12:54:27 2006
@@ -177,4 +177,4 @@
getCookieSource().readCookieValue(COOKIE_NAME);
}
-}
+}
\ No newline at end of file
Modified: jakarta/tapestry/trunk/examples/Vlib/src/java/org/apache/tapestry/vlib/pages/MyLibrary.java
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/examples/Vlib/src/java/org/apache/tapestry/vlib/pages/MyLibrary.java?rev=385164&r1=385163&r2=385164&view=diff
==============================================================================
--- jakarta/tapestry/trunk/examples/Vlib/src/java/org/apache/tapestry/vlib/pages/MyLibrary.java (original)
+++ jakarta/tapestry/trunk/examples/Vlib/src/java/org/apache/tapestry/vlib/pages/MyLibrary.java Sat Mar 11 12:54:27 2006
@@ -133,4 +133,4 @@
getConfirmBookDelete().selectBook(bookId);
}
-}
+}
\ No newline at end of file
Modified: jakarta/tapestry/trunk/examples/Vlib/src/java/org/apache/tapestry/vlib/pages/NewBook.java
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/examples/Vlib/src/java/org/apache/tapestry/vlib/pages/NewBook.java?rev=385164&r1=385163&r2=385164&view=diff
==============================================================================
--- jakarta/tapestry/trunk/examples/Vlib/src/java/org/apache/tapestry/vlib/pages/NewBook.java (original)
+++ jakarta/tapestry/trunk/examples/Vlib/src/java/org/apache/tapestry/vlib/pages/NewBook.java Sat Mar 11 12:54:27 2006
@@ -148,4 +148,4 @@
}
}
-}
+}
\ No newline at end of file
Modified: jakarta/tapestry/trunk/examples/Vlib/src/java/org/apache/tapestry/vlib/pages/Register.java
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/examples/Vlib/src/java/org/apache/tapestry/vlib/pages/Register.java?rev=385164&r1=385163&r2=385164&view=diff
==============================================================================
--- jakarta/tapestry/trunk/examples/Vlib/src/java/org/apache/tapestry/vlib/pages/Register.java (original)
+++ jakarta/tapestry/trunk/examples/Vlib/src/java/org/apache/tapestry/vlib/pages/Register.java Sat Mar 11 12:54:27 2006
@@ -130,4 +130,4 @@
getRemoteTemplate().execute(callback, "Error registering new user.");
}
-}
+}
\ No newline at end of file
Modified: jakarta/tapestry/trunk/examples/Vlib/src/java/org/apache/tapestry/vlib/pages/ViewBook.java
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/examples/Vlib/src/java/org/apache/tapestry/vlib/pages/ViewBook.java?rev=385164&r1=385163&r2=385164&view=diff
==============================================================================
--- jakarta/tapestry/trunk/examples/Vlib/src/java/org/apache/tapestry/vlib/pages/ViewBook.java (original)
+++ jakarta/tapestry/trunk/examples/Vlib/src/java/org/apache/tapestry/vlib/pages/ViewBook.java Sat Mar 11 12:54:27 2006
@@ -1,4 +1,4 @@
-// Copyright 2004, 2005, 2006 The Apache Software Foundation
+// Copyright 2004, 2005 The Apache Software Foundation
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -30,11 +30,11 @@
*
* @author Howard Lewis Ship
*/
-@Meta( { "page-type=Search", "anonymous-access=true" })
+@Meta(
+{ "page-type=Search", "anonymous-access=true" })
public abstract class ViewBook extends VlibPage implements IExternalPage, PageBeginRenderListener
{
-
private DateFormat _dateFormat;
@Persist
@@ -48,15 +48,14 @@
public void activateExternalPage(Object[] parameters, IRequestCycle cycle)
{
- Integer bookId = (Integer)parameters[0];
+ Integer bookId = (Integer) parameters[0];
setBookId(bookId);
}
private void readBook()
{
- // This doesn't handle invalid book id as nicely as the 3.0 code did,
- // but I'm
+ // This doesn't handle invalid book id as nicely as the 3.0 code did, but I'm
// getting a bit lazy!
Book book = getRemoteTemplate().getBook(getBookId());
@@ -67,13 +66,18 @@
public DateFormat getDateFormat()
{
if (_dateFormat == null)
- _dateFormat = DateFormat.getDateTimeInstance(DateFormat.MEDIUM, DateFormat.SHORT, getLocale());
+ _dateFormat = DateFormat.getDateTimeInstance(
+ DateFormat.MEDIUM,
+ DateFormat.SHORT,
+ getLocale());
return _dateFormat;
}
public void pageBeginRender(PageEvent event)
{
- if (getBook() == null) readBook();
+ if (getBook() == null)
+ readBook();
}
-}
+
+}
\ No newline at end of file
Modified: jakarta/tapestry/trunk/examples/Vlib/src/java/org/apache/tapestry/vlib/pages/ViewPerson.java
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/examples/Vlib/src/java/org/apache/tapestry/vlib/pages/ViewPerson.java?rev=385164&r1=385163&r2=385164&view=diff
==============================================================================
--- jakarta/tapestry/trunk/examples/Vlib/src/java/org/apache/tapestry/vlib/pages/ViewPerson.java (original)
+++ jakarta/tapestry/trunk/examples/Vlib/src/java/org/apache/tapestry/vlib/pages/ViewPerson.java Sat Mar 11 12:54:27 2006
@@ -1,4 +1,4 @@
-// Copyright 2004, 2005, 2006 The Apache Software Foundation
+// Copyright 2004, 2005 The Apache Software Foundation
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -32,17 +32,16 @@
import org.apache.tapestry.vlib.services.RemoteCallback;
/**
- * Displays the book inventory list for a single
- * {@link org.apache.tapestry.vlib.ejb.IPerson}, showing what books are owned
- * by the person, who has them borrowed, etc. If the user is logged in, then
- * books can be borrowed from this page as well.
+ * Displays the book inventory list for a single {@link org.apache.tapestry.vlib.ejb.IPerson},
+ * showing what books are owned by the person, who has them borrowed, etc. If the user is logged in,
+ * then books can be borrowed from this page as well.
*
* @author Howard Lewis Ship
*/
-@Meta( { "page-type=Search", "anonymous-access=true" })
+@Meta(
+{ "page-type=Search", "anonymous-access=true" })
public abstract class ViewPerson extends VlibPage implements IExternalPage, PageBeginRenderListener
{
-
public abstract Integer getPersonId();
@Persist
@@ -79,7 +78,7 @@
public void activateExternalPage(Object[] parameters, IRequestCycle cycle)
{
- Integer personId = (Integer)parameters[0];
+ Integer personId = (Integer) parameters[0];
setPersonId(personId);
@@ -94,7 +93,8 @@
{
int count = runQuery();
- if (getBrowser().getResultCount() != count) getBrowser().setResultCount(count);
+ if (getBrowser().getResultCount() != count)
+ getBrowser().setResultCount(count);
}
private int runQuery()
@@ -104,9 +104,7 @@
RemoteCallback<Integer> callback = new RemoteCallback()
{
-
- public Integer doRemote()
- throws RemoteException
+ public Integer doRemote() throws RemoteException
{
IBookQuery query = getQuery();
@@ -142,4 +140,5 @@
setPerson(person);
}
}
-}
+
+}
\ No newline at end of file
Modified: jakarta/tapestry/trunk/examples/Vlib/src/java/org/apache/tapestry/vlib/pages/admin/EditPublishers.java
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/examples/Vlib/src/java/org/apache/tapestry/vlib/pages/admin/EditPublishers.java?rev=385164&r1=385163&r2=385164&view=diff
==============================================================================
--- jakarta/tapestry/trunk/examples/Vlib/src/java/org/apache/tapestry/vlib/pages/admin/EditPublishers.java (original)
+++ jakarta/tapestry/trunk/examples/Vlib/src/java/org/apache/tapestry/vlib/pages/admin/EditPublishers.java Sat Mar 11 12:54:27 2006
@@ -49,9 +49,6 @@
public abstract class EditPublishers extends VlibPage implements PageBeginRenderListener,
PageDetachListener
{
-
- private DefaultPrimaryKeyConverter _converter;
-
public abstract Publisher getPublisher();
@Message
@@ -66,6 +63,8 @@
@InjectPage("MyLibrary")
public abstract MyLibrary getMyLibrary();
+ private DefaultPrimaryKeyConverter _converter;
+
public DefaultPrimaryKeyConverter getConverter()
{
if (_converter == null)
@@ -183,4 +182,4 @@
page.activate();
}
-}
+}
\ No newline at end of file
Modified: jakarta/tapestry/trunk/examples/Vlib/src/java/org/apache/tapestry/vlib/pages/admin/EditUsers.java
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/examples/Vlib/src/java/org/apache/tapestry/vlib/pages/admin/EditUsers.java?rev=385164&r1=385163&r2=385164&view=diff
==============================================================================
--- jakarta/tapestry/trunk/examples/Vlib/src/java/org/apache/tapestry/vlib/pages/admin/EditUsers.java (original)
+++ jakarta/tapestry/trunk/examples/Vlib/src/java/org/apache/tapestry/vlib/pages/admin/EditUsers.java Sat Mar 11 12:54:27 2006
@@ -1,4 +1,4 @@
-// Copyright 2004, 2005, 2006 The Apache Software Foundation
+// Copyright 2004, 2005 The Apache Software Foundation
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -37,18 +37,16 @@
import org.apache.tapestry.vlib.services.RemoteCallback;
/**
- * Allows editting of the users. Simple flags about the user can be changed;
- * additionally, the user can have their password reset (to a random value,
- * which is mailed to them), or the user can be out-right deleted.
+ * Allows editting of the users. Simple flags about the user can be changed; additionally, the user
+ * can have their password reset (to a random value, which is mailed to them), or the user can be
+ * out-right deleted.
*
* @author Howard Lewis Ship
*/
-@Meta( { "page-type=EditUsers", "admin-page=true" })
-public abstract class EditUsers extends VlibPage implements PageBeginRenderListener, PageDetachListener
+@Meta({"page-type=EditUsers", "admin-page=true"})
+public abstract class EditUsers extends VlibPage implements PageBeginRenderListener,
+ PageDetachListener
{
-
- private UserConverter _userConverter;
-
public abstract String getPassword();
public abstract void setPassword(String password);
@@ -75,13 +73,8 @@
@InjectComponent("password")
public abstract IFormComponent getPasswordField();
- /**
- * Converts from user ids to Users, and tracks users that need to have their
- * password reset.
- */
public class UserConverter extends DefaultPrimaryKeyConverter
{
-
private Set _resetPasswordValues;
public void clear()
@@ -106,9 +99,12 @@
}
}
+ private UserConverter _userConverter;
+
public UserConverter getUserConverter()
{
- if (_userConverter == null) _userConverter = new UserConverter();
+ if (_userConverter == null)
+ _userConverter = new UserConverter();
return _userConverter;
}
@@ -131,9 +127,7 @@
RemoteCallback<Person[]> callback = new RemoteCallback()
{
-
- public Person[] doRemote()
- throws RemoteException
+ public Person[] doRemote() throws RemoteException
{
return getOperations().getPersons();
}
@@ -145,13 +139,14 @@
converter.clear();
- for(int i = 0; i < users.length; i++)
+ for (int i = 0; i < users.length; i++)
{
Integer id = users[i].getId();
// Skip the current user; you aren't allowed to edit yourself
- if (id.equals(userId)) continue;
+ if (id.equals(userId))
+ continue;
converter.add(id, users[i]);
}
@@ -167,7 +162,7 @@
UserConverter converter = getUserConverter();
- final Person[] updates = (Person[])converter.getValues().toArray(new Person[0]);
+ final Person[] updates = (Person[]) converter.getValues().toArray(new Person[0]);
final Integer[] deletedIds = extractIds(converter.getDeletedValues());
final Integer[] resetPasswordIds = extractIds(converter.getResetPasswordValues());
@@ -184,13 +179,16 @@
RemoteCallback callback = new RemoteCallback()
{
-
- public Object doRemote()
- throws RemoteException
+ public Object doRemote() throws RemoteException
{
try
{
- getOperations().updatePersons(updates, resetPasswordIds, password, deletedIds, adminId);
+ getOperations().updatePersons(
+ updates,
+ resetPasswordIds,
+ password,
+ deletedIds,
+ adminId);
}
catch (RemoveException ex)
{
@@ -220,13 +218,13 @@
Iterator i = valueSet.iterator();
int index = 0;
- while(i.hasNext())
+ while (i.hasNext())
{
- Person person = (Person)i.next();
+ Person person = (Person) i.next();
result[index++] = person.getId();
}
return result;
}
-}
+}
\ No newline at end of file
Modified: jakarta/tapestry/trunk/examples/Vlib/src/java/org/apache/tapestry/vlib/pages/admin/TransferBooksSelect.java
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/examples/Vlib/src/java/org/apache/tapestry/vlib/pages/admin/TransferBooksSelect.java?rev=385164&r1=385163&r2=385164&view=diff
==============================================================================
--- jakarta/tapestry/trunk/examples/Vlib/src/java/org/apache/tapestry/vlib/pages/admin/TransferBooksSelect.java (original)
+++ jakarta/tapestry/trunk/examples/Vlib/src/java/org/apache/tapestry/vlib/pages/admin/TransferBooksSelect.java Sat Mar 11 12:54:27 2006
@@ -1,4 +1,4 @@
-// Copyright 2004, 2005, 2006 The Apache Software Foundation
+// Copyright 2004, 2005 The Apache Software Foundation
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -29,10 +29,10 @@
*
* @author Howard Lewis Ship
*/
-@Meta( { "page-type=TransferBooks", "admin-page=true" })
+@Meta(
+{ "page-type=TransferBooks", "admin-page=true" })
public abstract class TransferBooksSelect extends VlibPage
{
-
public abstract Integer getFromUserId();
public abstract Integer getToUserId();
@@ -65,4 +65,4 @@
next.activate(fromUserId, toUserId);
}
-}
+}
\ No newline at end of file
Modified: jakarta/tapestry/trunk/examples/Vlib/src/java/org/apache/tapestry/vlib/services/BookQuerySourceImpl.java
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/examples/Vlib/src/java/org/apache/tapestry/vlib/services/BookQuerySourceImpl.java?rev=385164&r1=385163&r2=385164&view=diff
==============================================================================
--- jakarta/tapestry/trunk/examples/Vlib/src/java/org/apache/tapestry/vlib/services/BookQuerySourceImpl.java (original)
+++ jakarta/tapestry/trunk/examples/Vlib/src/java/org/apache/tapestry/vlib/services/BookQuerySourceImpl.java Sat Mar 11 12:54:27 2006
@@ -1,4 +1,4 @@
-// Copyright 2005, 2006 The Apache Software Foundation
+// Copyright 2005 The Apache Software Foundation
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -24,14 +24,8 @@
import org.apache.tapestry.vlib.ejb.IBookQuery;
import org.apache.tapestry.vlib.ejb.IBookQueryHome;
-/**
- * EJB Bean implementation for performing queires for books.
- *
- * @author Howard M. Lewis Ship
- */
public class BookQuerySourceImpl implements BookQuerySource, RemoteExceptionListener
{
-
private NameLookup _nameLookup;
private IBookQueryHome _home;
@@ -42,9 +36,7 @@
{
RemoteCallback<IBookQuery> callback = new RemoteCallback()
{
-
- public IBookQuery doRemote()
- throws RemoteException
+ public IBookQuery doRemote() throws RemoteException
{
try
{
@@ -63,7 +55,8 @@
private IBookQueryHome getHome()
{
- if (_home == null) _home = (IBookQueryHome)_nameLookup.lookup("vlib/BookQuery", IBookQueryHome.class);
+ if (_home == null)
+ _home = (IBookQueryHome) _nameLookup.lookup("vlib/BookQuery", IBookQueryHome.class);
return _home;
}
Modified: jakarta/tapestry/trunk/examples/Vlib/src/java/org/apache/tapestry/vlib/services/RemoteCallback.java
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/examples/Vlib/src/java/org/apache/tapestry/vlib/services/RemoteCallback.java?rev=385164&r1=385163&r2=385164&view=diff
==============================================================================
--- jakarta/tapestry/trunk/examples/Vlib/src/java/org/apache/tapestry/vlib/services/RemoteCallback.java (original)
+++ jakarta/tapestry/trunk/examples/Vlib/src/java/org/apache/tapestry/vlib/services/RemoteCallback.java Sat Mar 11 12:54:27 2006
@@ -1,4 +1,4 @@
-// Copyright 2005, 2006 The Apache Software Foundation
+// Copyright 2005 The Apache Software Foundation
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -17,22 +17,18 @@
import java.rmi.RemoteException;
/**
- * Callback interface used when performing.
+ * Callback interface used when performing
*
- * @param <T>
- * the return type of the callback.
* @author Howard M. Lewis Ship
* @since 4.0
*/
public interface RemoteCallback<T>
{
-
/**
* Invoked by {@link RemoteTemplate}.
*
* @return
* @throws RemoteException
*/
- T doRemote()
- throws RemoteException;
+ T doRemote() throws RemoteException;
}
Modified: jakarta/tapestry/trunk/examples/Vlib/src/java/org/apache/tapestry/vlib/services/RemoteTemplateImpl.java
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/examples/Vlib/src/java/org/apache/tapestry/vlib/services/RemoteTemplateImpl.java?rev=385164&r1=385163&r2=385164&view=diff
==============================================================================
--- jakarta/tapestry/trunk/examples/Vlib/src/java/org/apache/tapestry/vlib/services/RemoteTemplateImpl.java (original)
+++ jakarta/tapestry/trunk/examples/Vlib/src/java/org/apache/tapestry/vlib/services/RemoteTemplateImpl.java Sat Mar 11 12:54:27 2006
@@ -32,7 +32,7 @@
*/
public class RemoteTemplateImpl implements RemoteTemplate
{
- private static final int MAX_ATTEMPTS = 2;
+ private final static int MAX_ATTEMPTS = 2;
private RemoteExceptionCoordinator _coordinator;
Modified: jakarta/tapestry/trunk/examples/VlibBeans/src/java/org/apache/tapestry/vlib/ejb/Book.java
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/examples/VlibBeans/src/java/org/apache/tapestry/vlib/ejb/Book.java?rev=385164&r1=385163&r2=385164&view=diff
==============================================================================
--- jakarta/tapestry/trunk/examples/VlibBeans/src/java/org/apache/tapestry/vlib/ejb/Book.java (original)
+++ jakarta/tapestry/trunk/examples/VlibBeans/src/java/org/apache/tapestry/vlib/ejb/Book.java Sat Mar 11 12:54:27 2006
@@ -29,6 +29,8 @@
public class Book implements Serializable
{
+ private static final long serialVersionUID = -3423550323411938995L;
+
/**
* Column index for the Book's primary key.
*/
@@ -77,9 +79,7 @@
public static final int N_COLUMNS = 14;
- private static final long serialVersionUID = -3423550323411938995L;
-
- private Object[] _columns;
+ private Object[] columns;
/**
* Constructs a new BookQueryResult, making an internal copy of the columns passed.
@@ -93,13 +93,13 @@
if (columns.length != N_COLUMNS)
throw new IllegalArgumentException("Wrong number of columns for a Book.");
- this._columns = new Object[N_COLUMNS];
- System.arraycopy(columns, 0, this._columns, 0, N_COLUMNS);
+ this.columns = new Object[N_COLUMNS];
+ System.arraycopy(columns, 0, this.columns, 0, N_COLUMNS);
}
private Object get(int index)
{
- return _columns[index];
+ return columns[index];
}
public Integer getId()
@@ -200,4 +200,4 @@
return b.booleanValue();
}
-}
+}
\ No newline at end of file
Modified: jakarta/tapestry/trunk/examples/VlibBeans/src/java/org/apache/tapestry/vlib/ejb/BorrowException.java
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/examples/VlibBeans/src/java/org/apache/tapestry/vlib/ejb/BorrowException.java?rev=385164&r1=385163&r2=385164&view=diff
==============================================================================
--- jakarta/tapestry/trunk/examples/VlibBeans/src/java/org/apache/tapestry/vlib/ejb/BorrowException.java (original)
+++ jakarta/tapestry/trunk/examples/VlibBeans/src/java/org/apache/tapestry/vlib/ejb/BorrowException.java Sat Mar 11 12:54:27 2006
@@ -1,4 +1,4 @@
-// Copyright 2004, 2005, 2006 The Apache Software Foundation
+// Copyright 2004, 2005 The Apache Software Foundation
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -23,11 +23,10 @@
public class BorrowException extends Exception
{
-
private static final long serialVersionUID = 7761447010967099141L;
- public BorrowException(String message)
+ public BorrowException(String message)
{
super(message);
}
-}
+}
\ No newline at end of file
Modified: jakarta/tapestry/trunk/examples/VlibBeans/src/java/org/apache/tapestry/vlib/ejb/IBook.java
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/examples/VlibBeans/src/java/org/apache/tapestry/vlib/ejb/IBook.java?rev=385164&r1=385163&r2=385164&view=diff
==============================================================================
--- jakarta/tapestry/trunk/examples/VlibBeans/src/java/org/apache/tapestry/vlib/ejb/IBook.java (original)
+++ jakarta/tapestry/trunk/examples/VlibBeans/src/java/org/apache/tapestry/vlib/ejb/IBook.java Sat Mar 11 12:54:27 2006
@@ -25,43 +25,43 @@
public interface IBook extends IEntityBean
{
- void setAuthor(String value) throws RemoteException;
+ public void setAuthor(String value) throws RemoteException;
- String getAuthor() throws RemoteException;
+ public String getAuthor() throws RemoteException;
- void setTitle(String value) throws RemoteException;
+ public void setTitle(String value) throws RemoteException;
- String getTitle() throws RemoteException;
+ public String getTitle() throws RemoteException;
- void setDescription(String value) throws RemoteException;
+ public void setDescription(String value) throws RemoteException;
- String getDescription() throws RemoteException;
+ public String getDescription() throws RemoteException;
- void setISBN(String value) throws RemoteException;
+ public void setISBN(String value) throws RemoteException;
- String getISBN() throws RemoteException;
+ public String getISBN() throws RemoteException;
- void setOwnerId(Integer value) throws RemoteException;
+ public void setOwnerId(Integer value) throws RemoteException;
- Integer getOwnerId() throws RemoteException;
+ public Integer getOwnerId() throws RemoteException;
- void setHolderId(Integer value) throws RemoteException;
+ public void setHolderId(Integer value) throws RemoteException;
- Integer getHolderId() throws RemoteException;
+ public Integer getHolderId() throws RemoteException;
- void setPublisherId(Integer value) throws RemoteException;
+ public void setPublisherId(Integer value) throws RemoteException;
- Integer getPublisherId() throws RemoteException;
+ public Integer getPublisherId() throws RemoteException;
- boolean getHidden() throws RemoteException;
+ public boolean getHidden() throws RemoteException;
- void setHidden(boolean value) throws RemoteException;
+ public void setHidden(boolean value) throws RemoteException;
- boolean getLendable() throws RemoteException;
+ public boolean getLendable() throws RemoteException;
- void setLendable(boolean value) throws RemoteException;
+ public void setLendable(boolean value) throws RemoteException;
- Timestamp getDateAdded() throws RemoteException;
+ public Timestamp getDateAdded() throws RemoteException;
- void setDateAdded(Timestamp value) throws RemoteException;
-}
+ public void setDateAdded(Timestamp value) throws RemoteException;
+}
\ No newline at end of file
Modified: jakarta/tapestry/trunk/examples/VlibBeans/src/java/org/apache/tapestry/vlib/ejb/IBookHome.java
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/examples/VlibBeans/src/java/org/apache/tapestry/vlib/ejb/IBookHome.java?rev=385164&r1=385163&r2=385164&view=diff
==============================================================================
--- jakarta/tapestry/trunk/examples/VlibBeans/src/java/org/apache/tapestry/vlib/ejb/IBookHome.java (original)
+++ jakarta/tapestry/trunk/examples/VlibBeans/src/java/org/apache/tapestry/vlib/ejb/IBookHome.java Sat Mar 11 12:54:27 2006
@@ -29,7 +29,7 @@
public interface IBookHome extends EJBHome
{
- IBook create(Map attributes) throws CreateException, RemoteException;
+ public IBook create(Map attributes) throws CreateException, RemoteException;
public IBook findByPrimaryKey(Integer key) throws FinderException, RemoteException;
-}
+}
\ No newline at end of file
Modified: jakarta/tapestry/trunk/examples/VlibBeans/src/java/org/apache/tapestry/vlib/ejb/IBookQuery.java
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/examples/VlibBeans/src/java/org/apache/tapestry/vlib/ejb/IBookQuery.java?rev=385164&r1=385163&r2=385164&view=diff
==============================================================================
--- jakarta/tapestry/trunk/examples/VlibBeans/src/java/org/apache/tapestry/vlib/ejb/IBookQuery.java (original)
+++ jakarta/tapestry/trunk/examples/VlibBeans/src/java/org/apache/tapestry/vlib/ejb/IBookQuery.java Sat Mar 11 12:54:27 2006
@@ -30,13 +30,13 @@
* Returns the total number of results rows in the query.
*/
- int getResultCount() throws RemoteException;
+ public int getResultCount() throws RemoteException;
/**
* Returns a selected subset of the results.
*/
- Book[] get(int offset, int length) throws RemoteException;
+ public Book[] get(int offset, int length) throws RemoteException;
/**
* Performs a query of books with the matching title and (optionally) publisher.
@@ -47,24 +47,24 @@
* order of items in result set.
*/
- int masterQuery(MasterQueryParameters parameters, SortOrdering sortOrdering)
+ public int masterQuery(MasterQueryParameters parameters, SortOrdering sortOrdering)
throws RemoteException;
/**
* Queries on books owned by a given person.
*/
- int ownerQuery(Integer ownerPK, SortOrdering sortOrdering) throws RemoteException;
+ public int ownerQuery(Integer ownerPK, SortOrdering sortOrdering) throws RemoteException;
/**
* Queries on books held by a given person.
*/
- int holderQuery(Integer holderPK, SortOrdering sortOrdering) throws RemoteException;
+ public int holderQuery(Integer holderPK, SortOrdering sortOrdering) throws RemoteException;
/**
* Queries the list of books held by the borrower but not owned by the borrower.
*/
- int borrowerQuery(Integer borrowerPK, SortOrdering sortOrdering) throws RemoteException;
-}
+ public int borrowerQuery(Integer borrowerPK, SortOrdering sortOrdering) throws RemoteException;
+}
\ No newline at end of file
Modified: jakarta/tapestry/trunk/examples/VlibBeans/src/java/org/apache/tapestry/vlib/ejb/IBookQueryHome.java
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/examples/VlibBeans/src/java/org/apache/tapestry/vlib/ejb/IBookQueryHome.java?rev=385164&r1=385163&r2=385164&view=diff
==============================================================================
--- jakarta/tapestry/trunk/examples/VlibBeans/src/java/org/apache/tapestry/vlib/ejb/IBookQueryHome.java (original)
+++ jakarta/tapestry/trunk/examples/VlibBeans/src/java/org/apache/tapestry/vlib/ejb/IBookQueryHome.java Sat Mar 11 12:54:27 2006
@@ -27,5 +27,5 @@
public interface IBookQueryHome extends EJBHome
{
- IBookQuery create() throws CreateException, RemoteException;
-}
+ public IBookQuery create() throws CreateException, RemoteException;
+}
\ No newline at end of file
Modified: jakarta/tapestry/trunk/examples/VlibBeans/src/java/org/apache/tapestry/vlib/ejb/IEntityBean.java
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/examples/VlibBeans/src/java/org/apache/tapestry/vlib/ejb/IEntityBean.java?rev=385164&r1=385163&r2=385164&view=diff
==============================================================================
--- jakarta/tapestry/trunk/examples/VlibBeans/src/java/org/apache/tapestry/vlib/ejb/IEntityBean.java (original)
+++ jakarta/tapestry/trunk/examples/VlibBeans/src/java/org/apache/tapestry/vlib/ejb/IEntityBean.java Sat Mar 11 12:54:27 2006
@@ -32,11 +32,11 @@
* Returns the simple attributes of the entity as a Map.
*/
- Map getEntityAttributes() throws RemoteException;
+ public Map getEntityAttributes() throws RemoteException;
/**
* Updates some or all of the properties of the entity.
*/
- void updateEntityAttributes(Map data) throws RemoteException;
-}
+ public void updateEntityAttributes(Map data) throws RemoteException;
+}
\ No newline at end of file
Modified: jakarta/tapestry/trunk/examples/VlibBeans/src/java/org/apache/tapestry/vlib/ejb/IKeyAllocator.java
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/examples/VlibBeans/src/java/org/apache/tapestry/vlib/ejb/IKeyAllocator.java?rev=385164&r1=385163&r2=385164&view=diff
==============================================================================
--- jakarta/tapestry/trunk/examples/VlibBeans/src/java/org/apache/tapestry/vlib/ejb/IKeyAllocator.java (original)
+++ jakarta/tapestry/trunk/examples/VlibBeans/src/java/org/apache/tapestry/vlib/ejb/IKeyAllocator.java Sat Mar 11 12:54:27 2006
@@ -31,12 +31,12 @@
* guarenteed to not have been previously returned by any instance.
*/
- Integer allocateKey() throws RemoteException;
+ public Integer allocateKey() throws RemoteException;
/**
* Allocates several keys, as if invoking {@link #allocateKey} multiple times. No guarentees are
* made that the values are sequential or in any order, just that they are unique.
*/
- Integer[] allocateKeys(int count) throws RemoteException;
-}
+ public Integer[] allocateKeys(int count) throws RemoteException;
+}
\ No newline at end of file
Modified: jakarta/tapestry/trunk/examples/VlibBeans/src/java/org/apache/tapestry/vlib/ejb/IKeyAllocatorHome.java
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/examples/VlibBeans/src/java/org/apache/tapestry/vlib/ejb/IKeyAllocatorHome.java?rev=385164&r1=385163&r2=385164&view=diff
==============================================================================
--- jakarta/tapestry/trunk/examples/VlibBeans/src/java/org/apache/tapestry/vlib/ejb/IKeyAllocatorHome.java (original)
+++ jakarta/tapestry/trunk/examples/VlibBeans/src/java/org/apache/tapestry/vlib/ejb/IKeyAllocatorHome.java Sat Mar 11 12:54:27 2006
@@ -27,5 +27,5 @@
public interface IKeyAllocatorHome extends EJBHome
{
- IKeyAllocator create() throws CreateException, RemoteException;
-}
+ public IKeyAllocator create() throws CreateException, RemoteException;
+}
\ No newline at end of file
Modified: jakarta/tapestry/trunk/examples/VlibBeans/src/java/org/apache/tapestry/vlib/ejb/IOperations.java
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/examples/VlibBeans/src/java/org/apache/tapestry/vlib/ejb/IOperations.java?rev=385164&r1=385163&r2=385164&view=diff
==============================================================================
--- jakarta/tapestry/trunk/examples/VlibBeans/src/java/org/apache/tapestry/vlib/ejb/IOperations.java (original)
+++ jakarta/tapestry/trunk/examples/VlibBeans/src/java/org/apache/tapestry/vlib/ejb/IOperations.java Sat Mar 11 12:54:27 2006
@@ -36,7 +36,7 @@
* increments the lend count on the book.
*/
- Book borrowBook(Integer bookdId, Integer borrowerId) throws BorrowException,
+ public Book borrowBook(Integer bookdId, Integer borrowerId) throws BorrowException,
FinderException, RemoteException;
/**
@@ -212,4 +212,4 @@
Integer[] deleted, Integer adminId) throws FinderException, RemoveException,
RemoteException;
-}
+}
\ No newline at end of file
Modified: jakarta/tapestry/trunk/examples/VlibBeans/src/java/org/apache/tapestry/vlib/ejb/IOperationsHome.java
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/examples/VlibBeans/src/java/org/apache/tapestry/vlib/ejb/IOperationsHome.java?rev=385164&r1=385163&r2=385164&view=diff
==============================================================================
--- jakarta/tapestry/trunk/examples/VlibBeans/src/java/org/apache/tapestry/vlib/ejb/IOperationsHome.java (original)
+++ jakarta/tapestry/trunk/examples/VlibBeans/src/java/org/apache/tapestry/vlib/ejb/IOperationsHome.java Sat Mar 11 12:54:27 2006
@@ -27,5 +27,5 @@
public interface IOperationsHome extends EJBHome
{
- IOperations create() throws CreateException, RemoteException;
-}
+ public IOperations create() throws CreateException, RemoteException;
+}
\ No newline at end of file
Modified: jakarta/tapestry/trunk/examples/VlibBeans/src/java/org/apache/tapestry/vlib/ejb/IPerson.java
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/examples/VlibBeans/src/java/org/apache/tapestry/vlib/ejb/IPerson.java?rev=385164&r1=385163&r2=385164&view=diff
==============================================================================
--- jakarta/tapestry/trunk/examples/VlibBeans/src/java/org/apache/tapestry/vlib/ejb/IPerson.java (original)
+++ jakarta/tapestry/trunk/examples/VlibBeans/src/java/org/apache/tapestry/vlib/ejb/IPerson.java Sat Mar 11 12:54:27 2006
@@ -25,31 +25,31 @@
public interface IPerson extends IEntityBean
{
- void setLastName(String value) throws RemoteException;
+ public void setLastName(String value) throws RemoteException;
- String getLastName() throws RemoteException;
+ public String getLastName() throws RemoteException;
- void setFirstName(String value) throws RemoteException;
+ public void setFirstName(String value) throws RemoteException;
- String getFirstName() throws RemoteException;
+ public String getFirstName() throws RemoteException;
- void setPassword(String value) throws RemoteException;
+ public void setPassword(String value) throws RemoteException;
- String getPassword() throws RemoteException;
+ public String getPassword() throws RemoteException;
- void setEmail(String value) throws RemoteException;
+ public void setEmail(String value) throws RemoteException;
- String getEmail() throws RemoteException;
+ public String getEmail() throws RemoteException;
- boolean getAdmin() throws RemoteException;
+ public boolean getAdmin() throws RemoteException;
- void setAdmin(boolean value) throws RemoteException;
+ public void setAdmin(boolean value) throws RemoteException;
- boolean getLockedOut() throws RemoteException;
+ public boolean getLockedOut() throws RemoteException;
- void setLockedOut(boolean value) throws RemoteException;
+ public void setLockedOut(boolean value) throws RemoteException;
- void setLastAccess(Timestamp value) throws RemoteException;
+ public void setLastAccess(Timestamp value) throws RemoteException;
- Timestamp getLastAccess() throws RemoteException;
-}
+ public Timestamp getLastAccess() throws RemoteException;
+}
\ No newline at end of file
Modified: jakarta/tapestry/trunk/examples/VlibBeans/src/java/org/apache/tapestry/vlib/ejb/IPersonHome.java
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/examples/VlibBeans/src/java/org/apache/tapestry/vlib/ejb/IPersonHome.java?rev=385164&r1=385163&r2=385164&view=diff
==============================================================================
--- jakarta/tapestry/trunk/examples/VlibBeans/src/java/org/apache/tapestry/vlib/ejb/IPersonHome.java (original)
+++ jakarta/tapestry/trunk/examples/VlibBeans/src/java/org/apache/tapestry/vlib/ejb/IPersonHome.java Sat Mar 11 12:54:27 2006
@@ -29,7 +29,7 @@
public interface IPersonHome extends EJBHome
{
- IPerson create(Map attributes) throws CreateException, RemoteException;
+ public IPerson create(Map attributes) throws CreateException, RemoteException;
public IPerson findByPrimaryKey(Integer key) throws FinderException, RemoteException;
@@ -39,4 +39,4 @@
*/
public IPerson findByEmail(String email) throws FinderException, RemoteException;
-}
+}
\ No newline at end of file
Modified: jakarta/tapestry/trunk/examples/VlibBeans/src/java/org/apache/tapestry/vlib/ejb/IPublisher.java
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/examples/VlibBeans/src/java/org/apache/tapestry/vlib/ejb/IPublisher.java?rev=385164&r1=385163&r2=385164&view=diff
==============================================================================
--- jakarta/tapestry/trunk/examples/VlibBeans/src/java/org/apache/tapestry/vlib/ejb/IPublisher.java (original)
+++ jakarta/tapestry/trunk/examples/VlibBeans/src/java/org/apache/tapestry/vlib/ejb/IPublisher.java Sat Mar 11 12:54:27 2006
@@ -24,7 +24,7 @@
public interface IPublisher extends IEntityBean
{
- void setName(String value) throws RemoteException;
+ public void setName(String value) throws RemoteException;
- String getName() throws RemoteException;
-}
+ public String getName() throws RemoteException;
+}
\ No newline at end of file
Modified: jakarta/tapestry/trunk/examples/VlibBeans/src/java/org/apache/tapestry/vlib/ejb/IPublisherHome.java
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/examples/VlibBeans/src/java/org/apache/tapestry/vlib/ejb/IPublisherHome.java?rev=385164&r1=385163&r2=385164&view=diff
==============================================================================
--- jakarta/tapestry/trunk/examples/VlibBeans/src/java/org/apache/tapestry/vlib/ejb/IPublisherHome.java (original)
+++ jakarta/tapestry/trunk/examples/VlibBeans/src/java/org/apache/tapestry/vlib/ejb/IPublisherHome.java Sat Mar 11 12:54:27 2006
@@ -28,7 +28,7 @@
public interface IPublisherHome extends EJBHome
{
- IPublisher create(String name) throws CreateException, RemoteException;
+ public IPublisher create(String name) throws CreateException, RemoteException;
public IPublisher findByPrimaryKey(Integer key) throws FinderException, RemoteException;
@@ -38,4 +38,4 @@
public IPublisher findByName(String name) throws FinderException, RemoteException;
-}
+}
\ No newline at end of file
Modified: jakarta/tapestry/trunk/examples/VlibBeans/src/java/org/apache/tapestry/vlib/ejb/LoginException.java
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/examples/VlibBeans/src/java/org/apache/tapestry/vlib/ejb/LoginException.java?rev=385164&r1=385163&r2=385164&view=diff
==============================================================================
--- jakarta/tapestry/trunk/examples/VlibBeans/src/java/org/apache/tapestry/vlib/ejb/LoginException.java (original)
+++ jakarta/tapestry/trunk/examples/VlibBeans/src/java/org/apache/tapestry/vlib/ejb/LoginException.java Sat Mar 11 12:54:27 2006
@@ -1,4 +1,4 @@
-// Copyright 2004, 2005, 2006 The Apache Software Foundation
+// Copyright 2004, 2005 The Apache Software Foundation
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -22,10 +22,9 @@
public class LoginException extends Exception
{
-
private static final long serialVersionUID = -1472279052871024178L;
-
- private final boolean _passwordError;
+
+ private boolean _passwordError;
public LoginException(String message, boolean passwordError)
{
@@ -35,9 +34,8 @@
}
/**
- * Returns true if the error is related to the password. Otherwise, the
- * error is related to the email address (either not found, or the user has
- * been invalidated or otherwise locked out).
+ * Returns true if the error is related to the password. Otherwise, the error is related to the
+ * email address (either not found, or the user has been invalidated or otherwise locked out).
*/
public boolean isPasswordError()
@@ -45,4 +43,4 @@
return _passwordError;
}
-}
+}
\ No newline at end of file
Modified: jakarta/tapestry/trunk/examples/VlibBeans/src/java/org/apache/tapestry/vlib/ejb/Person.java
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/examples/VlibBeans/src/java/org/apache/tapestry/vlib/ejb/Person.java?rev=385164&r1=385163&r2=385164&view=diff
==============================================================================
--- jakarta/tapestry/trunk/examples/VlibBeans/src/java/org/apache/tapestry/vlib/ejb/Person.java (original)
+++ jakarta/tapestry/trunk/examples/VlibBeans/src/java/org/apache/tapestry/vlib/ejb/Person.java Sat Mar 11 12:54:27 2006
@@ -25,6 +25,10 @@
public class Person implements Serializable
{
+ private static final long serialVersionUID = 37148852625594728L;
+
+ private Object[] columns;
+
public static final int ID_COLUMN = 0;
public static final int FIRST_NAME_COLUMN = 1;
@@ -40,11 +44,7 @@
public static final int LAST_ACCESS_COLUMN = 6;
public static final int N_COLUMNS = 7;
-
- private static final long serialVersionUID = 37148852625594728L;
- private Object[] _columns;
-
public Person(Object[] columns)
{
if (columns == null)
@@ -53,41 +53,41 @@
if (columns.length != N_COLUMNS)
throw new IllegalArgumentException("Wrong number of columns for a Person.");
- this._columns = new Object[N_COLUMNS];
- System.arraycopy(columns, 0, this._columns, 0, N_COLUMNS);
+ this.columns = new Object[N_COLUMNS];
+ System.arraycopy(columns, 0, this.columns, 0, N_COLUMNS);
}
public Integer getId()
{
- return (Integer) _columns[ID_COLUMN];
+ return (Integer) columns[ID_COLUMN];
}
public String getFirstName()
{
- return (String) _columns[FIRST_NAME_COLUMN];
+ return (String) columns[FIRST_NAME_COLUMN];
}
public String getLastName()
{
- return (String) _columns[LAST_NAME_COLUMN];
+ return (String) columns[LAST_NAME_COLUMN];
}
public String getEmail()
{
- return (String) _columns[EMAIL_COLUMN];
+ return (String) columns[EMAIL_COLUMN];
}
public String getNaturalName()
{
- if (_columns[FIRST_NAME_COLUMN] == null)
- return (String) _columns[LAST_NAME_COLUMN];
+ if (columns[FIRST_NAME_COLUMN] == null)
+ return (String) columns[LAST_NAME_COLUMN];
- return (String) _columns[FIRST_NAME_COLUMN] + " " + (String) _columns[LAST_NAME_COLUMN];
+ return (String) columns[FIRST_NAME_COLUMN] + " " + (String) columns[LAST_NAME_COLUMN];
}
public Timestamp getLastAccess()
{
- return (Timestamp) _columns[LAST_ACCESS_COLUMN];
+ return (Timestamp) columns[LAST_ACCESS_COLUMN];
}
public String toString()
@@ -96,13 +96,13 @@
buffer = new StringBuffer("Person[");
- if (_columns[FIRST_NAME_COLUMN] != null)
+ if (columns[FIRST_NAME_COLUMN] != null)
{
- buffer.append((String) _columns[FIRST_NAME_COLUMN]);
+ buffer.append((String) columns[FIRST_NAME_COLUMN]);
buffer.append(' ');
}
- buffer.append((String) _columns[LAST_NAME_COLUMN]);
+ buffer.append((String) columns[LAST_NAME_COLUMN]);
buffer.append(']');
return buffer.toString();
@@ -130,14 +130,14 @@
private void setBit(int column, boolean value)
{
- _columns[column] = value ? Boolean.TRUE : Boolean.FALSE;
+ columns[column] = value ? Boolean.TRUE : Boolean.FALSE;
}
private boolean getBit(int column)
{
- Boolean b = (Boolean) _columns[column];
+ Boolean b = (Boolean) columns[column];
return b.booleanValue();
}
-}
+}
\ No newline at end of file
Modified: jakarta/tapestry/trunk/examples/VlibBeans/src/java/org/apache/tapestry/vlib/ejb/Publisher.java
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/examples/VlibBeans/src/java/org/apache/tapestry/vlib/ejb/Publisher.java?rev=385164&r1=385163&r2=385164&view=diff
==============================================================================
--- jakarta/tapestry/trunk/examples/VlibBeans/src/java/org/apache/tapestry/vlib/ejb/Publisher.java (original)
+++ jakarta/tapestry/trunk/examples/VlibBeans/src/java/org/apache/tapestry/vlib/ejb/Publisher.java Sat Mar 11 12:54:27 2006
@@ -69,4 +69,4 @@
return buffer.toString();
}
-}
+}
\ No newline at end of file
Modified: jakarta/tapestry/trunk/examples/VlibBeans/src/java/org/apache/tapestry/vlib/ejb/RegistrationException.java
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/examples/VlibBeans/src/java/org/apache/tapestry/vlib/ejb/RegistrationException.java?rev=385164&r1=385163&r2=385164&view=diff
==============================================================================
--- jakarta/tapestry/trunk/examples/VlibBeans/src/java/org/apache/tapestry/vlib/ejb/RegistrationException.java (original)
+++ jakarta/tapestry/trunk/examples/VlibBeans/src/java/org/apache/tapestry/vlib/ejb/RegistrationException.java Sat Mar 11 12:54:27 2006
@@ -1,4 +1,4 @@
-// Copyright 2004, 2005, 2006 The Apache Software Foundation
+// Copyright 2004, 2005 The Apache Software Foundation
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -15,8 +15,7 @@
package org.apache.tapestry.vlib.ejb;
/**
- * Exception thrown by
- * {@link IOperations#registerNewUser(String, String, String, String)} if the
+ * Exception thrown by {@link IOperations#registerNewUser(String, String, String, String)} if the
* registration is not allowed (usually, because of a duplicate email or name).
*
* @author Howard Lewis Ship
@@ -24,10 +23,9 @@
public class RegistrationException extends Exception
{
-
private static final long serialVersionUID = 1359775792320102947L;
-
- private final Throwable _rootCause;
+
+ private Throwable _rootCause;
public RegistrationException(Throwable rootCause)
{
@@ -45,11 +43,11 @@
public RegistrationException(String message)
{
- this(message, null);
+ super(message);
}
public Throwable getRootCause()
{
return _rootCause;
}
-}
+}
\ No newline at end of file
Modified: jakarta/tapestry/trunk/examples/VlibBeans/src/java/org/apache/tapestry/vlib/ejb/impl/AbstractEntityBean.java
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/examples/VlibBeans/src/java/org/apache/tapestry/vlib/ejb/impl/AbstractEntityBean.java?rev=385164&r1=385163&r2=385164&view=diff
==============================================================================
--- jakarta/tapestry/trunk/examples/VlibBeans/src/java/org/apache/tapestry/vlib/ejb/impl/AbstractEntityBean.java (original)
+++ jakarta/tapestry/trunk/examples/VlibBeans/src/java/org/apache/tapestry/vlib/ejb/impl/AbstractEntityBean.java Sat Mar 11 12:54:27 2006
@@ -1,4 +1,4 @@
-// Copyright 2004, 2005, 2006 The Apache Software Foundation
+// Copyright 2004, 2005 The Apache Software Foundation
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -27,22 +27,21 @@
import javax.naming.NamingException;
import javax.rmi.PortableRemoteObject;
-import ognl.Ognl;
-import ognl.OgnlException;
-
import org.apache.tapestry.contrib.ejb.XEJBException;
import org.apache.tapestry.vlib.ejb.IKeyAllocator;
import org.apache.tapestry.vlib.ejb.IKeyAllocatorHome;
+import ognl.Ognl;
+import ognl.OgnlException;
/**
- * Provides basic support for the entity context, empty or minimal
- * implementations of the required methods, and some utilties.
+ * Provides basic support for the entity context, empty or minimal implementations of the required
+ * methods, and some utilties.
*
* @author Howard Lewis Ship
*/
-public abstract class AbstractEntityBean implements EntityBean {
-
+public abstract class AbstractEntityBean implements EntityBean
+{
/**
* The EntityContext provided by the application server.
*/
@@ -54,8 +53,8 @@
private transient IKeyAllocatorHome _keyAllocatorHome;
/**
- * The environment naming context, which is configured for this bean in the
- * deployment descriptor.
+ * The environment naming context, which is configured for this bean in the deployment
+ * descriptor.
*/
private transient Context _environment;
@@ -74,23 +73,27 @@
* Gets a named object from the bean's environment naming context.
*/
- protected Object getEnvironmentObject(String name, Class objectClass)
- throws RemoteException, NamingException
+ protected Object getEnvironmentObject(String name, Class objectClass) throws RemoteException,
+ NamingException
{
Object result = null;
- if (_environment == null) {
+ if (_environment == null)
+ {
Context initial = new InitialContext();
- _environment = (Context)initial.lookup("java:comp/env");
+ _environment = (Context) initial.lookup("java:comp/env");
}
Object raw = _environment.lookup(name);
- try {
+ try
+ {
result = PortableRemoteObject.narrow(raw, objectClass);
- } catch (ClassCastException ex) {
- throw new RemoteException("Could not narrow " + raw + " (" + name
- + ") to class " + objectClass + ".");
+ }
+ catch (ClassCastException ex)
+ {
+ throw new RemoteException("Could not narrow " + raw + " (" + name + ") to class "
+ + objectClass + ".");
}
return result;
@@ -100,8 +103,7 @@
* Empty implementation; subclasses may override.
*/
- public void ejbActivate()
- throws EJBException, RemoteException
+ public void ejbActivate() throws EJBException, RemoteException
{
// does nothing
}
@@ -110,8 +112,7 @@
* Empty implementation; subclasses may override.
*/
- public void ejbPassivate()
- throws EJBException, RemoteException
+ public void ejbPassivate() throws EJBException, RemoteException
{
// does nothing
}
@@ -120,8 +121,7 @@
* Empty implementation; subclasses may override.
*/
- public void ejbRemove()
- throws EJBException, RemoteException
+ public void ejbRemove() throws EJBException, RemoteException
{
// does nothing
}
@@ -130,8 +130,7 @@
* Does nothing.
*/
- public void ejbLoad()
- throws EJBException, RemoteException
+ public void ejbLoad() throws EJBException, RemoteException
{
}
@@ -139,8 +138,7 @@
* Does nothing.
*/
- public void ejbStore()
- throws EJBException, RemoteException
+ public void ejbStore() throws EJBException, RemoteException
{
}
@@ -148,33 +146,39 @@
* Uses the KeyAllocator session bean to allocate a necessary key.
*/
- protected Integer allocateKey()
- throws RemoteException
+ protected Integer allocateKey() throws RemoteException
{
IKeyAllocator allocator;
- if (_keyAllocatorHome == null) {
- try {
+ if (_keyAllocatorHome == null)
+ {
+ try
+ {
Context initial = new InitialContext();
- Context environment = (Context)initial.lookup("java:comp/env");
+ Context environment = (Context) initial.lookup("java:comp/env");
Object raw = environment.lookup("ejb/KeyAllocator");
- _keyAllocatorHome = (IKeyAllocatorHome)PortableRemoteObject
- .narrow(raw, IKeyAllocatorHome.class);
- } catch (NamingException ex) {
- throw new XEJBException("Unable to locate IKeyAllocatorHome.",
- ex);
+ _keyAllocatorHome = (IKeyAllocatorHome) PortableRemoteObject.narrow(
+ raw,
+ IKeyAllocatorHome.class);
+ }
+ catch (NamingException ex)
+ {
+ throw new XEJBException("Unable to locate IKeyAllocatorHome.", ex);
}
}
// Get a reference to *some* KeyAllocator bean ... it may be fresh,
// or one reused from a pool.
- try {
+ try
+ {
allocator = _keyAllocatorHome.create();
- } catch (CreateException ex) {
- throw new RemoteException("Unable to create a KeyAllocator from "
- + _keyAllocatorHome + ".", ex);
+ }
+ catch (CreateException ex)
+ {
+ throw new RemoteException("Unable to create a KeyAllocator from " + _keyAllocatorHome
+ + ".", ex);
}
// Finally, invoke the method that gets a key.
@@ -183,20 +187,18 @@
}
/**
- * Implemented in subclasses to provide a list of property names to be
- * included in the entity attributes map.
+ * Implemented in subclasses to provide a list of property names to be included in the entity
+ * attributes map.
*/
protected abstract String[] getAttributePropertyNames();
/**
- * Returns a {@link Map} of the properties of the bean. This Map is returned
- * to the client, where it can be modified and then used to update the
- * entity bean in a single method
+ * Returns a {@link Map} of the properties of the bean. This Map is returned to the client,
+ * where it can be modified and then used to update the entity bean in a single method
* <p>
- * The properties included in the Map are defined by the
- * {@link #getAttributePropertyNames()} method, which is implemented by
- * concrete subclasses.
+ * The properties included in the Map are defined by the {@link #getAttributePropertyNames()}
+ * method, which is implemented by concrete subclasses.
*/
public Map getEntityAttributes()
@@ -206,14 +208,18 @@
if (_attributePropertyNames == null)
_attributePropertyNames = getAttributePropertyNames();
- for(int i = 0; i < _attributePropertyNames.length; i++) {
+ for (int i = 0; i < _attributePropertyNames.length; i++)
+ {
String key = _attributePropertyNames[i];
- try {
+ try
+ {
Object value = Ognl.getValue(key, this);
result.put(key, value);
- } catch (OgnlException ex) {
+ }
+ catch (OgnlException ex)
+ {
}
}
@@ -221,13 +227,13 @@
}
/**
- * Updates the bean with property changes from the update {@link Map}. Only
- * the keys defined by {@link #getAttributePropertyNames()} will be accessed
- * (keys and values that are not in that list are ignored).
+ * Updates the bean with property changes from the update {@link Map}. Only the keys defined by
+ * {@link #getAttributePropertyNames()} will be accessed (keys and values that are not in that
+ * list are ignored).
* <p>
- * The corresponding bean property will only be updated if the key is
- * present ... this means that the update may contain just the
- * <em>changed</em> keys. Remember that a Map may store null values.
+ * The corresponding bean property will only be updated if the key is present ... this means
+ * that the update may contain just the <em>changed</em> keys. Remember that a Map may store
+ * null values.
*/
public void updateEntityAttributes(Map update)
@@ -235,15 +241,20 @@
if (_attributePropertyNames == null)
_attributePropertyNames = getAttributePropertyNames();
- for(int i = 0; i < _attributePropertyNames.length; i++) {
+ for (int i = 0; i < _attributePropertyNames.length; i++)
+ {
String key = _attributePropertyNames[i];
- if (update.containsKey(key)) {
+ if (update.containsKey(key))
+ {
Object value = update.get(key);
- try {
+ try
+ {
Ognl.setValue(key, this, value);
- } catch (OgnlException ex) {
+ }
+ catch (OgnlException ex)
+ {
}
}
@@ -261,4 +272,4 @@
{
return _context;
}
-}
+}
\ No newline at end of file
Modified: jakarta/tapestry/trunk/examples/VlibBeans/src/java/org/apache/tapestry/vlib/ejb/impl/BookBean.java
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/examples/VlibBeans/src/java/org/apache/tapestry/vlib/ejb/impl/BookBean.java?rev=385164&r1=385163&r2=385164&view=diff
==============================================================================
--- jakarta/tapestry/trunk/examples/VlibBeans/src/java/org/apache/tapestry/vlib/ejb/impl/BookBean.java (original)
+++ jakarta/tapestry/trunk/examples/VlibBeans/src/java/org/apache/tapestry/vlib/ejb/impl/BookBean.java Sat Mar 11 12:54:27 2006
@@ -102,4 +102,4 @@
// No post create work needed but the method must be implemented
}
-}
+}
\ No newline at end of file
Modified: jakarta/tapestry/trunk/examples/VlibBeans/src/java/org/apache/tapestry/vlib/ejb/impl/BookQueryBean.java
URL: http://svn.apache.org/viewcvs/jakarta/tapestry/trunk/examples/VlibBeans/src/java/org/apache/tapestry/vlib/ejb/impl/BookQueryBean.java?rev=385164&r1=385163&r2=385164&view=diff
==============================================================================
--- jakarta/tapestry/trunk/examples/VlibBeans/src/java/org/apache/tapestry/vlib/ejb/impl/BookQueryBean.java (original)
+++ jakarta/tapestry/trunk/examples/VlibBeans/src/java/org/apache/tapestry/vlib/ejb/impl/BookQueryBean.java Sat Mar 11 12:54:27 2006
@@ -1,4 +1,4 @@
-// Copyright 2004, 2005, 2006 The Apache Software Foundation
+// Copyright 2004, 2005 The Apache Software Foundation
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -29,14 +29,12 @@
/**
* Implementation of a stateful session bean used to query the
- * {@link org.apache.tapestry.vlib.ejb.IBook} entity and cache the results. It
- * can then download the results, in chunks, to the client ... this is used to
- * support clients that which to display the results a page at a time (with
- * random access to the pages of results).
+ * {@link org.apache.tapestry.vlib.ejb.IBook} entity and cache the results. It can then download the
+ * results, in chunks, to the client ... this is used to support clients that which to display the
+ * results a page at a time (with random access to the pages of results).
* <p>
- * To avoid a lot of duplicate code for things like finding the JDBC
- * {@link Connection} and querying the IBook entity, we subclass from
- * {@link OperationsBean}.
+ * To avoid a lot of duplicate code for things like finding the JDBC {@link Connection} and querying
+ * the IBook entity, we subclass from {@link OperationsBean}.
*
* @see org.apache.tapestry.vlib.ejb.IBookQuery
* @see org.apache.tapestry.vlib.ejb.IBookQueryHome
@@ -45,10 +43,9 @@
public class BookQueryBean extends OperationsBean
{
-
private static final long serialVersionUID = 8782046868254488388L;
-
- /**
+
+ /**
* Stores the results from the most recent query.
*/
@@ -71,7 +68,8 @@
public int getResultCount()
{
- if (_results == null) return 0;
+ if (_results == null)
+ return 0;
return _results.length;
}
@@ -84,11 +82,13 @@
{
Book[] result;
- if (offset < 0) return null;
+ if (offset < 0)
+ return null;
int finalLength = Math.min(length, _results.length - offset);
- if (finalLength < 0) return null;
+ if (finalLength < 0)
+ return null;
// Create a new array and copy the requested
// results into it.
@@ -100,8 +100,7 @@
}
/**
- * The master query is for querying by some mixture of title, author and
- * publisher.
+ * The master query is for querying by some mixture of title, author and publisher.
*/
public int masterQuery(MasterQueryParameters parameters, SortOrdering sortOrdering)
@@ -271,13 +270,12 @@
}
}
- private void processQueryResults(ResultSet set)
- throws SQLException
+ private void processQueryResults(ResultSet set) throws SQLException
{
List list = new ArrayList();
Object[] columns = new Object[Book.N_COLUMNS];
- while(set.next())
+ while (set.next())
{
Book book = convertRowToBook(set, columns);
@@ -285,11 +283,11 @@
}
_results = new Book[list.size()];
- _results = (Book[])list.toArray(_results);
+ _results = (Book[]) list.toArray(_results);
}
- private IStatement buildMasterQuery(Connection connection, MasterQueryParameters parameters, SortOrdering ordering)
- throws SQLException
+ private IStatement buildMasterQuery(Connection connection, MasterQueryParameters parameters,
+ SortOrdering ordering) throws SQLException
{
String title = parameters.getTitle();
String author = parameters.getAuthor();
@@ -325,9 +323,8 @@
return assembly.createStatement(connection);
}
- private IStatement buildPersonQuery(Connection connection, String personColumn, Integer personId,
- SortOrdering sortOrdering)
- throws SQLException
+ private IStatement buildPersonQuery(Connection connection, String personColumn,
+ Integer personId, SortOrdering sortOrdering) throws SQLException
{
StatementAssembly assembly = buildBaseBookQuery();
@@ -341,8 +338,8 @@
return assembly.createStatement(connection);
}
- private IStatement buildBorrowerQuery(Connection connection, Integer borrowerId, SortOrdering sortOrdering)
- throws SQLException
+ private IStatement buildBorrowerQuery(Connection connection, Integer borrowerId,
+ SortOrdering sortOrdering) throws SQLException
{
StatementAssembly assembly = buildBaseBookQuery();
@@ -359,4 +356,4 @@
return assembly.createStatement(connection);
}
-}
+}
\ No newline at end of file
---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-dev-help@jakarta.apache.org