01: /*
02: * Copyright 2006 Luca Garulli (luca.garulli@assetdata.it)
03: *
04: * Licensed under the Apache License, Version 2.0 (the "License");
05: * you may not use this file except in compliance with the License.
06: * You may obtain a copy of the License at
07: *
08: * http://www.apache.org/licenses/LICENSE-2.0
09: *
10: * Unless required by applicable law or agreed to in writing, software
11: * distributed under the License is distributed on an "AS IS" BASIS,
12: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13: * See the License for the specific language governing permissions and
14: * limitations under the License.
15: */
16:
17: package org.romaframework.module.users.domain;
18:
19: import java.io.Serializable;
20: import java.util.Date;
21:
22: import org.romaframework.aspect.core.annotation.AnnotationConstants;
23: import org.romaframework.aspect.session.SessionAspect;
24: import org.romaframework.aspect.session.SessionInfo;
25: import org.romaframework.aspect.view.annotation.ViewField;
26: import org.romaframework.core.flow.ObjectContext;
27:
28: public class Tracking implements Serializable {
29: public Tracking() {
30: }
31:
32: public Tracking(String notes) {
33: this .when = new Date();
34: SessionInfo sess = ObjectContext.getInstance().getComponent(
35: SessionAspect.class).getActiveSessionInfo();
36: if (sess != null)
37: this .account = (BaseAccount) sess.getAccount();
38: this .notes = notes;
39: }
40:
41: public BaseAccount getAccount() {
42: return account;
43: }
44:
45: public void setAccount(BaseAccount user) {
46: this .account = user;
47: }
48:
49: public Date getWhen() {
50: return when;
51: }
52:
53: public void setWhen(Date when) {
54: this .when = when;
55: }
56:
57: public String getNotes() {
58: return notes;
59: }
60:
61: public void setNotes(String notes) {
62: this .notes = notes;
63: }
64:
65: @ViewField(enabled=AnnotationConstants.FALSE)
66: private Date when;
67:
68: @ViewField(enabled=AnnotationConstants.FALSE)
69: private BaseAccount account;
70:
71: @ViewField(render="textarea")
72: private String notes;
73: }
|