KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > tapestry > vlib > pages > admin > TransferBooksSelect


1 // Copyright 2004 The Apache Software Foundation
2
//
3
// Licensed under the Apache License, Version 2.0 (the "License");
4
// you may not use this file except in compliance with the License.
5
// You may obtain a copy of the License at
6
//
7
// http://www.apache.org/licenses/LICENSE-2.0
8
//
9
// Unless required by applicable law or agreed to in writing, software
10
// distributed under the License is distributed on an "AS IS" BASIS,
11
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
// See the License for the specific language governing permissions and
13
// limitations under the License.
14

15 package org.apache.tapestry.vlib.pages.admin;
16
17 import org.apache.tapestry.IRequestCycle;
18 import org.apache.tapestry.vlib.AdminPage;
19
20 /**
21  * First page in Transfer Books wizard; allows the two users to be selected.
22  *
23  * @author Howard Lewis Ship
24  * @version $Id: TransferBooksSelect.java,v 1.5 2004/02/19 17:38:02 hlship Exp $
25  *
26  **/

27
28 public abstract class TransferBooksSelect extends AdminPage
29 {
30     public abstract Integer JavaDoc getFromUserId();
31     public abstract Integer JavaDoc getToUserId();
32
33     public void formSubmit(IRequestCycle cycle)
34     {
35         Integer JavaDoc fromUserId = getFromUserId();
36         Integer JavaDoc toUserId = getToUserId();
37
38         if (fromUserId.equals(toUserId))
39         {
40             setError(getMessage("select-different-users"));
41             return;
42         }
43
44         TransferBooksTransfer next = (TransferBooksTransfer) cycle.getPage("TransferBooksTransfer");
45
46         next.activate(cycle, fromUserId, toUserId);
47     }
48
49 }
Popular Tags