View Javadoc

1   package de.tivsource.page.admin.actions.locations.reservation;
2   
3   import org.apache.logging.log4j.LogManager;
4   import org.apache.logging.log4j.Logger;
5   import org.apache.struts2.convention.annotation.Action;
6   import org.apache.struts2.convention.annotation.Actions;
7   import org.apache.struts2.convention.annotation.Result;
8   import org.apache.struts2.tiles.annotation.TilesDefinition;
9   import org.apache.struts2.tiles.annotation.TilesDefinitions;
10  import org.apache.struts2.tiles.annotation.TilesPutAttribute;
11  
12  import de.tivsource.ejb3plugin.InjectEJB;
13  import de.tivsource.page.admin.actions.EmptyAction;
14  import de.tivsource.page.dao.event.EventDaoLocal;
15  import de.tivsource.page.entity.event.Event;
16  
17  /**
18   * 
19   * @author Marc Michele
20   *
21   */
22  @TilesDefinitions({
23    @TilesDefinition(name="reservationGrid", extend = "adminTemplate", putAttributes = {
24      @TilesPutAttribute(name = "meta",       value = "/WEB-INF/tiles/active/meta/default_jquery.jsp"),
25      @TilesPutAttribute(name = "navigation", value = "/WEB-INF/tiles/active/navigation/locations.jsp"),
26      @TilesPutAttribute(name = "content",    value = "/WEB-INF/tiles/active/view/reservation/list.jsp")
27    })
28  })
29  public class IndexAction extends EmptyAction {
30  
31  	/**
32  	 * Serial Version UID.
33  	 */
34      private static final long serialVersionUID = -2200164248790963358L;
35  
36      /**
37       * Statischer Logger der Klasse.
38       */
39      private static final Logger LOGGER = LogManager.getLogger(IndexAction.class);
40  
41      @InjectEJB(name="EventDao")
42      private EventDaoLocal eventDaoLocal;
43  
44      private Event event;
45  
46      private String uncheckEvent;
47  
48      public Event getEvent() {
49          return event;
50      }
51  
52      public void setEvent(String uncheckEvent) {
53          this.uncheckEvent = uncheckEvent;
54      }
55  
56  	@Override
57      @Actions({
58          @Action(
59          		value = "index", 
60          		results = { @Result(name = "success", type="tiles", location = "reservationGrid") }
61          )
62      })
63      public String execute() throws Exception {
64      	LOGGER.info("execute() aufgerufen.");
65      	this.loadPageParameter();
66      	return SUCCESS;
67      }// Ende execute()
68  
69      private void loadPageParameter() {
70          if( uncheckEvent != null && uncheckEvent != "" && uncheckEvent.length() > 0) {
71              event = eventDaoLocal.findByUuid(uncheckEvent);
72          }
73      }// Ende loadPageParameter()
74  	
75  }// Ende class