~bureauvirtuel-dev/bureauvirtuel/channels.bdcs_v2

« back to all changes in this revision

Viewing changes to data/beans/CsGroupGrille.java

  • Committer: sbond-portail
  • Date: 2004-08-04 15:54:08 UTC
  • Revision ID: svn-v4:3783d4d9-f018-0410-86f8-8bbe63f93fa6:trunk/millebv/agenda/source/ca/qc/cslaval/agenda/connectors/bdcs:627
*** empty log message ***

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
    Copyright (C)2003-2004 Commission scolaire de Laval (http://www.cslaval.qc.ca)
 
3
 
 
4
    This program is free software; you can redistribute it and/or modify
 
5
    it under the terms of the GNU General Public License as published by
 
6
    the Free Software Foundation; either version 2 of the License, or
 
7
    (at your option) any later version.
 
8
 
 
9
    This program is distributed in the hope that it will be useful,
 
10
    but WITHOUT ANY WARRANTY; without even the implied warranty of
 
11
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
12
    GNU General Public License for more details.
 
13
 
 
14
    You should have received a copy of the GNU General Public License
 
15
    along with this program; if not, write to the Free Software
 
16
    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
17
*/
 
18
package ca.qc.cslaval.agenda.connectors.bdcs.data.beans;
 
19
 
 
20
import java.util.ArrayList;
 
21
import java.util.Date;
 
22
import java.util.LinkedHashMap;
 
23
import java.util.List;
 
24
import java.util.Map;
 
25
 
 
26
import ca.qc.cslaval.agenda.connectors.bdcs.data.FacadeBd;
 
27
 
 
28
/**
 
29
 * <p>Description </p>
 
30
 * @author St�phane Bond
 
31
 * @version $Revision$
 
32
 */
 
33
public class CsGroupGrille extends CsGroup {
 
34
  private CsGroupEcole ecole;
 
35
  private LinkedHashMap mapPeriodes; // Lazy load
 
36
  private List listePeriodes; // Lazy load
 
37
  private CsCalendrier calendrier; // Lazy load
 
38
  private int nbJourCycle;
 
39
  private Date dateDebut;
 
40
  private Date dateFin;
 
41
 
 
42
 
 
43
  /* (non-Javadoc)
 
44
   * @see ca.qc.cslaval.agenda.connectors.bdcs.bd.beans.CsGroupe#estActif()
 
45
   */
 
46
  public boolean estActif() {
 
47
    long now = (new Date()).getTime();
 
48
    return (getDateDebut().getTime() <= now && now <= getDateFin().getTime());
 
49
  }
 
50
 
 
51
  /**
 
52
   * @return
 
53
   */
 
54
  public CsCalendrier getCalendrier() throws Exception {
 
55
    if (calendrier == null) {
 
56
      calendrier = FacadeBd.getCalendrier(getGrpId());
 
57
    }
 
58
    return calendrier;
 
59
  }
 
60
 
 
61
  /**
 
62
   * @return
 
63
   */
 
64
  public Map getMapPeriodes() throws Exception {
 
65
    if (mapPeriodes == null) {
 
66
      mapPeriodes = FacadeBd.getPeriodes(getGrpId());
 
67
    }
 
68
    return mapPeriodes;
 
69
  }
 
70
 
 
71
  /**
 
72
   * @return
 
73
   */
 
74
  public List getListePeriodes() throws Exception {
 
75
    if (listePeriodes == null) {
 
76
      listePeriodes = new ArrayList(getMapPeriodes().values());
 
77
    }
 
78
    return listePeriodes;
 
79
  }
 
80
 
 
81
  /**
 
82
   * @return
 
83
   */
 
84
  public Date getDateDebut() {
 
85
    return dateDebut;
 
86
  }
 
87
 
 
88
  /**
 
89
   * @return
 
90
   */
 
91
  public Date getDateFin() {
 
92
    return dateFin;
 
93
  }
 
94
 
 
95
  /**
 
96
   * @return
 
97
   */
 
98
  public CsGroupEcole getEcole() {
 
99
    return ecole;
 
100
  }
 
101
 
 
102
  /**
 
103
   * @param date
 
104
   */
 
105
  public void setDateDebut(Date date) {
 
106
    dateDebut = date;
 
107
  }
 
108
 
 
109
  /**
 
110
   * @param date
 
111
   */
 
112
  public void setDateFin(Date date) {
 
113
    dateFin = date;
 
114
  }
 
115
 
 
116
  /**
 
117
   * @param ecole
 
118
   */
 
119
  public void setEcole(CsGroupEcole ecole) {
 
120
    this.ecole = ecole;
 
121
  }
 
122
 
 
123
  /**
 
124
   * @return
 
125
   */
 
126
  public int getNbJourCycle() {
 
127
    return nbJourCycle;
 
128
  }
 
129
 
 
130
  /**
 
131
   * @param i
 
132
   */
 
133
  public void setNbJourCycle(int i) {
 
134
    nbJourCycle = i;
 
135
  }
 
136
 
 
137
}