View Javadoc

1   package org.musicontroller.gui;
2   
3   import org.apache.tapestry.html.BasePage;
4   import org.musicontroller.core.Playlist;
5   import org.musicontroller.dao.Dao;
6   import org.musicontroller.security.User;
7   import org.musicontroller.service.McService;
8   
9   /**
10   * Home-page, where the DJ can be controlled
11   * @author Varienaja
12   */
13  public abstract class Home extends BasePage {
14  	
15  	public abstract Dao getDao();
16  	public abstract McService getMcService();
17  	
18  	public abstract User getUser();
19  	
20  	public long getUserid() {		
21  		User user = getUser();
22  		return user==null?-1L:user.getId();
23  	}
24  
25  	public String getPasshash() {		
26  		User user = getUser();
27  		return user==null ? "" : user.getPassword();
28  	}
29  		
30  	/**
31  	 * @return A Playlist containing the 6 upcoming songs that the DJ will
32  	 * play if no new requests/unrequests are made.
33  	 * TODO Sometimes java.util.ConcurrentModificationException
34  	 */
35  	public Playlist getUpcoming() {
36  		return getMcService().getUpcoming(getUserid());
37  	}
38  		
39  }