summaryrefslogtreecommitdiff
path: root/orkweb/src/net/sf/oreka/pages/Home.java
blob: ec6f4b636ce450d5bf946ae30ec5032b8511c6b1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
/*
 * Oreka -- A media capture and retrieval platform
 * 
 * Copyright (C) 2005, orecx LLC
 *
 * http://www.orecx.com
 *
 * This program is free software, distributed under the terms of
 * the GNU General Public License.
 * Please refer to http://www.gnu.org/copyleft/gpl.html
 *
 */

package net.sf.oreka.pages;

import net.sf.oreka.orkweb.ContextListener;

import org.apache.tapestry.IRequestCycle;
import org.apache.tapestry.html.BasePage;

public abstract class Home extends BasePage {
	
	public abstract String getUsername();
	public abstract void setUsername(String username);

	public abstract String getPassword();
	public abstract void setPassword(String password);
	
	//@Persist
	public abstract String getErrorMessage();
	public abstract void setErrorMessage(String msg);
	
	public Home() {

	}

	public void formSubmit(IRequestCycle cycle) {

			if(		getUsername() != null && getPassword() != null && 
					getUsername().equals("bruno") && 
					getPassword().equals("bru")			)
			{
				cycle.activate("RecSegments");
			}
			else if(ContextListener.debugSwitch == true) {
				cycle.activate("RecSegments");
			}
			else {
				setErrorMessage("Invalid login or password");
			}
	}
}