Subversion Repositories bacoAlunos

Rev

Rev 1328 | Rev 1333 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1328 Rev 1329
Line 1... Line 1...
1
package pt.estgp.estgweb.domain;
1
package pt.estgp.estgweb.domain;
2
 
2
 
3
import org.apache.log4j.Logger;
3
import org.apache.log4j.Logger;
4
import pt.estgp.estgweb.Globals;
4
import pt.estgp.estgweb.Globals;
5
import pt.estgp.estgweb.domain.dao.DaoFactory;
-
 
6
import pt.estgp.estgweb.domain.utils.SimpleClearanceRuledSupport;
5
import pt.estgp.estgweb.domain.utils.SimpleClearanceRuledSupport;
7
import pt.estgp.estgweb.utils.ConfigProperties;
6
import pt.estgp.estgweb.utils.ConfigProperties;
8
 
7
 
9
import java.lang.reflect.InvocationTargetException;
8
import java.lang.reflect.InvocationTargetException;
10
import java.lang.reflect.Method;
9
import java.lang.reflect.Method;
Line 62... Line 61...
62
            return pos;
61
            return pos;
63
        }
62
        }
64
    }
63
    }
65
 
64
 
66
 
65
 
-
 
66
    //QuestionarioPedagogico SubState
-
 
67
    public enum SubStatePedagogico
-
 
68
    {
-
 
69
        START(1),
-
 
70
        YEAR_SEMESTRE_ASSIGNED(2),
-
 
71
        ASSIGNING_COURSES(3),
-
 
72
        COURSES_ASSIGNED(4),
-
 
73
        FINNISHED_ANSWERS_GENERATING(5);
-
 
74
 
-
 
75
        private int pos = 1;
-
 
76
 
-
 
77
        SubStatePedagogico(int pos)
-
 
78
        {
-
 
79
            this.pos = pos;
-
 
80
        }
-
 
81
 
-
 
82
        public static SubStatePedagogico parse(1.5.0/docs/api/java/lang/String.html">String state)
-
 
83
        {
-
 
84
            for(SubStatePedagogico s: SubStatePedagogico.values())
-
 
85
            {
-
 
86
                if(s.name().equals(state))
-
 
87
                    return s;
-
 
88
            }
-
 
89
            return START;
-
 
90
        }
-
 
91
 
-
 
92
 
-
 
93
        public int getPosition()
-
 
94
        {
-
 
95
            return pos;
-
 
96
        }
-
 
97
    }
-
 
98
 
-
 
99
    public SubStatePedagogico getSubStatePedagodigoEnum()
-
 
100
    {
-
 
101
        return SubStatePedagogico.parse(getSubstate());
-
 
102
    }
-
 
103
 
-
 
104
    public void setSubStatePedagogicoClass(SubStatePedagogico subState) {
-
 
105
        setSubstate(subState.name());
-
 
106
    }
-
 
107
 
67
 
108
 
68
 
109
 
69
    public QuestionarioImpl() {
110
    public QuestionarioImpl() {
70
        super();
111
        super();
71
 
112
 
Line 154... Line 195...
154
 
195
 
155
            @1.5.0/docs/api/java/lang/Override.html">Override
196
            @1.5.0/docs/api/java/lang/Override.html">Override
156
            public void initQuestionarioAfetacoesVariables(QuestionarioImpl questionario) {
197
            public void initQuestionarioAfetacoesVariables(QuestionarioImpl questionario) {
157
 
198
 
158
            }
199
            }
-
 
200
 
-
 
201
            @1.5.0/docs/api/java/lang/Override.html">Override
-
 
202
            public void startAfetacoes(QuestionarioImpl questionario) {
-
 
203
 
-
 
204
            }
-
 
205
 
-
 
206
            @1.5.0/docs/api/java/lang/Override.html">Override
-
 
207
            public void initClearances(QuestionarioImpl questionario, UserSessionImpl session, SimpleClearanceRuledSupport s) {
-
 
208
 
-
 
209
            }
159
        };
210
        };
160
    }
211
    }
161
 
212
 
162
    public static List<IAnswersProcessor> getIAnswerProcessors()
213
    public static List<IAnswersProcessor> getIAnswerProcessors()
163
    {
214
    {
Line 239... Line 290...
239
            }
290
            }
240
            //ANO SEMESTRE ESPECIFICO apenas neste estado, em atribuição de respostas e respostas atribuidas já não permite
291
            //ANO SEMESTRE ESPECIFICO apenas neste estado, em atribuição de respostas e respostas atribuidas já não permite
241
            if(getStateEnum() == QuestionarioImpl.1.5.0/docs/api/org/omg/PortableServer/POAManagerPackage/State.html">State.ASSIGNATION_DETAILS)
292
            if(getStateEnum() == QuestionarioImpl.1.5.0/docs/api/org/omg/PortableServer/POAManagerPackage/State.html">State.ASSIGNATION_DETAILS)
242
            {
293
            {
243
                s.addClearance(QuestionarioImpl.QuestionarioClearancesOperation.QUESTIONARIO_SAVE_FORM.name(),usession);
294
                s.addClearance(QuestionarioImpl.QuestionarioClearancesOperation.QUESTIONARIO_SAVE_FORM.name(),usession);
244
                s.addClearance(QuestionarioImpl.QuestionarioClearancesOperation.QUESTIONARIO_SET_ANO_SEMESTRE.name(),usession);
295
                s.addClearance(QuestionarioImpl.QuestionarioClearancesOperation.QUESTIONARIO_ASSIGNATION_OPERATIONS.name(),usession);
245
                s.addClearance(QuestionarioClearancesOperation.QUESTIONARIO_SCHEDULLE_SEE_SELECT_COURSES.name(),usession);
-
 
246
                if(getCourseSelectionTaskId() <= 0)
-
 
247
                    s.addClearance(QuestionarioClearancesOperation.QUESTIONARIO_SCHEDULLE_SELECT_COURSES.name(),usession);
-
 
248
                else
-
 
249
                {
-
 
250
                    JobServiceTask task = DaoFactory.getJobServiceTaskDaoImpl().load(getCourseSelectionTaskId());
-
 
-
 
296
 
251
                    if(task.isExecuted() || (task.getSaveDate() != null &&
297
                getiAnswersProcessorClass().initClearances(this,usession,s);
252
                            1.5.0/docs/api/java/lang/System.html">System.currentTimeMillis()-task.getSaveDate().getTime()>1800000)) //half hour blocked
-
 
253
                    {
-
 
254
                        task.setExecuted(true);
-
 
255
                        s.addClearance(QuestionarioClearancesOperation.QUESTIONARIO_SCHEDULLE_SELECT_COURSES.name(),usession);
-
 
256
                    }
-
 
257
                }
-
 
-
 
298
 
258
 
299
 
259
            }
300
            }
260
            if(getStateEnum() == 1.5.0/docs/api/org/omg/PortableServer/POAManagerPackage/State.html">State.ASSIGNING_ANSWERS_PROCESSEMENT)
301
            if(getStateEnum() == 1.5.0/docs/api/org/omg/PortableServer/POAManagerPackage/State.html">State.ASSIGNING_ANSWERS_PROCESSEMENT)
261
            {
302
            {
262
 
303
 
Line 271... Line 312...
271
        QUESTIONARIO_SAVE_FORM,
312
        QUESTIONARIO_SAVE_FORM,
272
        QUESTIONARIO_SEE_FORM,
313
        QUESTIONARIO_SEE_FORM,
273
        QUESTIONARIO_SEE_ADMIN,
314
        QUESTIONARIO_SEE_ADMIN,
274
        QUESTIONARIO_SAVE_ANSWER_PROCESSOR,
315
        QUESTIONARIO_SAVE_ANSWER_PROCESSOR,
275
        QUESTIONARIO_SET_STATE_ASSIGNATION_DETAILS,
316
        QUESTIONARIO_SET_STATE_ASSIGNATION_DETAILS,
276
        QUESTIONARIO_SET_ANO_SEMESTRE,
317
        QUESTIONARIO_ASSIGNATION_OPERATIONS,
277
        QUESTIONARIO_DELETE,
318
        QUESTIONARIO_DELETE,
278
 
319
 
279
        /*Pedagogico Cursos*/
320
        /*Pedagogico Cursos*/
-
 
321
        QUESTIONARIO_SET_ANO_SEMESTRE,
280
        QUESTIONARIO_SCHEDULLE_SELECT_COURSES,
322
        QUESTIONARIO_SCHEDULLE_SELECT_COURSES,
281
        QUESTIONARIO_SCHEDULLE_SEE_SELECT_COURSES
323
        QUESTIONARIO_SCHEDULLE_SEE_SELECT_COURSES,
-
 
324
        QUESTIONARIO_CHANGE_TIPOLOGIES,
-
 
325
        QUESTIONARIO_START_ASSIGN_ANSWERS,
282
        ;
326
        ;
283
 
327
 
284
        public static QuestionarioClearancesOperation parse(1.5.0/docs/api/java/lang/String.html">String clearance)
328
        public static QuestionarioClearancesOperation parse(1.5.0/docs/api/java/lang/String.html">String clearance)
285
        {
329
        {
286
            if(clearance == null)
330
            if(clearance == null)