<commit_before>/* Yougi is a web application conceived to manage user groups or
 * communities focused on a certain domain of knowledge, whose members are
 * constantly sharing information and participating in social and educational
 * events. Copyright (C) 2011 <NAME>.
 *
 * This application is free software; you can redistribute it and/or modify it
 * under the terms of the GNU Lesser General Public License as published by the
 * Free Software Foundation; either version 2.1 of the License, or (at your
 * option) any later version.
 *
 * This application is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
 * License for more details.
 *
 * There is a full copy of the GNU Lesser General Public License along with
 * this library. Look for the file license.txt at the root level. If you do not
 * find it, write to the Free Software Foundation, Inc., 59 Temple Place,
 * Suite 330, Boston, MA 02111-1307 USA.
 * */
package org.yougi.event.web.controller;

import org.yougi.event.business.EventVenueBean;
import org.yougi.event.business.RoomBean;
import org.yougi.event.business.VenueBean;
import org.yougi.event.entity.Event;
import org.yougi.event.entity.Room;
import org.yougi.event.entity.Venue;

import javax.ejb.EJB;
import javax.faces.view.ViewScoped;
import javax.inject.Named;
import java.util.List;

/**
 * This class is used to manage the selection of the venue and room of an event
 * session. The selected venue updates the list of rooms related with that venue.
 *
 * @author <NAME> - http://www.hildeberto.com
 */
@Named
@ViewScoped
public class VenueSelectionMBean {

    @EJB
    private VenueBean venueBean;

    @EJB
    private EventVenueBean eventVenueBean;

    @EJB
    private RoomBean roomBean;

    private List<Venue> venues;

    private List<Room> rooms;

    private String selectedVenue;

    private String selectedRoom;

    private String selectedEvent;

    public void setSelectedEvent(String selectedEvent) {
        this.selectedEvent = selectedEvent;
    }

    public List<Venue> getVenues() {
        Event event = new Event(this.selectedEvent);
        this.venues = eventVenueBean.findEventVenues(event);
        return this.venues;
    }

    public List<Room> getRooms() {
        if (this.selectedVenue != null) {
            Venue venue = new Venue(selectedVenue);
            this.rooms = roomBean.findRooms(venue);
        } else {
            this.rooms = null;
        }
        return this.rooms;
    }

    public Venue getVenue() {
        if (this.selectedVenue != null) {
            return venueBean.find(selectedVenue);
        } else {
            return null;
        }
    }

    public Room getRoom() {
        if (this.selectedRoom != null) {
            return roomBean.find(selectedRoom);
        } else {
            return null;
        }
    }

    public String getSelectedVenue() {
        return selectedVenue;
    }

    public void setSelectedVenue(String selectedVenue) {
        this.selectedVenue = selectedVenue;
        this.selectedRoom = null;
    }

    public String getSelectedRoom() {
        return selectedRoom;
    }

    public void setSelectedRoom(String selectedRoom) {
        this.selectedRoom = selectedRoom;
    }
}<commit_msg>Interface added Serializable for VenueSelectionMBean<commit_after>/* Yougi is a web application conceived to manage user groups or
 * communities focused on a certain domain of knowledge, whose members are
 * constantly sharing information and participating in social and educational
 * events. Copyright (C) 2011 <NAME>.
 *
 * This application is free software; you can redistribute it and/or modify it
 * under the terms of the GNU Lesser General Public License as published by the
 * Free Software Foundation; either version 2.1 of the License, or (at your
 * option) any later version.
 *
 * This application is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
 * License for more details.
 *
 * There is a full copy of the GNU Lesser General Public License along with
 * this library. Look for the file license.txt at the root level. If you do not
 * find it, write to the Free Software Foundation, Inc., 59 Temple Place,
 * Suite 330, Boston, MA 02111-1307 USA.
 * */
package org.yougi.event.web.controller;

import org.yougi.event.business.EventVenueBean;
import org.yougi.event.business.RoomBean;
import org.yougi.event.business.VenueBean;
import org.yougi.event.entity.Event;
import org.yougi.event.entity.Room;
import org.yougi.event.entity.Venue;

import javax.ejb.EJB;
import javax.faces.view.ViewScoped;
import javax.inject.Named;

import java.io.Serializable;
import java.util.List;

/**
 * This class is used to manage the selection of the venue and room of an event
 * session. The selected venue updates the list of rooms related with that venue.
 *
 * @author <NAME> - http://www.hildeberto.com
 */
@Named
@ViewScoped
public class VenueSelectionMBean implements Serializable {

    @EJB
    private VenueBean venueBean;

    @EJB
    private EventVenueBean eventVenueBean;

    @EJB
    private RoomBean roomBean;

    private List<Venue> venues;

    private List<Room> rooms;

    private String selectedVenue;

    private String selectedRoom;

    private String selectedEvent;

    public void setSelectedEvent(String selectedEvent) {
        this.selectedEvent = selectedEvent;
    }

    public List<Venue> getVenues() {
        Event event = new Event(this.selectedEvent);
        this.venues = eventVenueBean.findEventVenues(event);
        return this.venues;
    }

    public List<Room> getRooms() {
        if (this.selectedVenue != null) {
            Venue venue = new Venue(selectedVenue);
            this.rooms = roomBean.findRooms(venue);
        } else {
            this.rooms = null;
        }
        return this.rooms;
    }

    public Venue getVenue() {
        if (this.selectedVenue != null) {
            return venueBean.find(selectedVenue);
        } else {
            return null;
        }
    }

    public Room getRoom() {
        if (this.selectedRoom != null) {
            return roomBean.find(selectedRoom);
        } else {
            return null;
        }
    }

    public String getSelectedVenue() {
        return selectedVenue;
    }

    public void setSelectedVenue(String selectedVenue) {
        this.selectedVenue = selectedVenue;
        this.selectedRoom = null;
    }

    public String getSelectedRoom() {
        return selectedRoom;
    }

    public void setSelectedRoom(String selectedRoom) {
        this.selectedRoom = selectedRoom;
    }
}
{'fraction_non_alphanumeric': 0.07712494532730718, 'fraction_numerical': 0.005831753899985421, 'mean_word_length': 2.8933030646992055, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '681266', 'n_tokens_mistral': 1931, 'n_tokens_neox': 1863, 'n_words': 670}