View Javadoc

1   /***
2   Copyright (C) 2005 The Java Community
3   
4   This program is free software; you can redistribute it and/or modify  it under
5   the terms of the GNU General Public License as published by  the Free Software
6   Foundation; either version 2 of the License, or  (at your option) any later
7   version.
8   
9   This program is distributed in the hope that it will be useful,  but WITHOUT
10  ANY WARRANTY; without even the implied warranty of  MERCHANTABILITY or FITNESS
11  FOR A PARTICULAR PURPOSE. See the  GNU General Public License for more details.
12  
13  You should have received a copy of the GNU General Public License  along with
14  this program; if not, write to the Free Software  Foundation, Inc., 59 Temple
15  Place, Suite 330, Boston, MA 02111-1307 USA.
16  */
17  
18  package org.bejug.javacareers.jobs.view.jsf.model;
19  
20  import java.util.ArrayList;
21  import java.util.Iterator;
22  import java.util.List;
23  
24  import javax.faces.model.SelectItem;
25  
26  import org.bejug.javacareers.jobs.model.Profile;
27  import org.bejug.javacareers.jobs.service.AdminService;
28  
29  /***
30   * @author kva (last modified by $Author: bme_jcs $)
31   * @version $Revision: 1.5 $ - $Date: 2005/08/12 08:33:09 $
32   */
33  
34  public class ProfileData {
35  
36      private AdminService adminService;
37      
38      /***
39       * @param adminService The jobService to set.
40       */
41      public void setAdminService(AdminService adminService) {
42          this.adminService = adminService;
43      }
44      
45      /***
46       * Get the list of profiles as configured by the administrator to be
47       * presented in a popup menu.
48       * @return list of profiles.
49       */
50      public List getProfiles() {
51          List menuProfiles = new ArrayList();
52          List profiles = adminService.getProfiles();
53          for(Iterator it = profiles.iterator(); it.hasNext();) {
54              Profile jobProfile = (Profile) it.next();
55              menuProfiles.add(new SelectItem(jobProfile.getName()));
56          }
57          return menuProfiles;
58      }
59  
60  }
61  /***
62   * $Log: ProfileData.java,v $
63   * Revision 1.5  2005/08/12 08:33:09  bme_jcs
64   * moved profile-methods from jobservice to adminservice
65   *
66   * Revision 1.4  2005/08/10 09:04:49  bavo_jcs
67   * Optimized imports according to checkstyle
68   *
69   * Revision 1.3  2005/08/09 12:59:56  bavo_jcs
70   * Optimized imports
71   *
72   * Revision 1.2  2005/06/09 08:18:53  bejug_cc
73   * Fix initial import
74   *
75   * Revision 1.1  2005/05/18 08:48:47  kva
76   * list of profiles extracted from Utils
77   *
78   */