001: /*
002: * (C) Copyright 2000 - 2006 Nabh Information Systems, Inc.
003: *
004: * This program is free software; you can redistribute it and/or
005: * modify it under the terms of the GNU General Public License
006: * as published by the Free Software Foundation; either version 2
007: * of the License, or (at your option) any later version.
008: *
009: * This program is distributed in the hope that it will be useful,
010: * but WITHOUT ANY WARRANTY; without even the implied warranty of
011: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
012: * GNU General Public License for more details.
013: *
014: * You should have received a copy of the GNU General Public License
015: * along with this program; if not, write to the Free Software
016: * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
017: *
018: */
019: package com.nabhinc.portal.model;
020:
021: import java.util.Calendar;
022: import java.util.GregorianCalendar;
023:
024: import javax.portlet.ActionRequest;
025: import javax.xml.bind.annotation.XmlElement;
026: import javax.xml.bind.annotation.XmlRootElement;
027:
028: import com.nabhinc.portal.core.PortalConstants;
029:
030: /**
031: *
032: *
033: * @author Padmanabh Dabke
034: * (c) 2006 Nabh Information Systems, Inc. All Rights Reserved.
035: */
036: @XmlRootElement(name="portlet-window-state")
037: public class PortletWindowState {
038: int version = 0;
039: private String createdBy = null;
040: private Calendar creationTime = GregorianCalendar.getInstance();
041: private String creationIP = null;
042: private String lastModifiedBy = null;
043: private Calendar lastModificationTime = creationTime;
044: private String lastModificationIP = null;
045:
046: @XmlElement(name="created-by")
047: public String getCreatedBy() {
048: return createdBy;
049: }
050:
051: public void setCreatedBy(String createdBy) {
052: this .createdBy = createdBy;
053: }
054:
055: @XmlElement(name="creation-time")
056: public Calendar getCreationTime() {
057: return creationTime;
058: }
059:
060: public void setCreationTime(Calendar creationTime) {
061: this .creationTime = creationTime;
062: }
063:
064: @XmlElement(name="last-mod-time")
065: public Calendar getLastModificationTime() {
066: return lastModificationTime;
067: }
068:
069: public void setLastModificationTime(Calendar lastModificationTime) {
070: this .lastModificationTime = lastModificationTime;
071: }
072:
073: @XmlElement(name="last-mod-by")
074: public String getLastModifiedBy() {
075: return lastModifiedBy;
076: }
077:
078: public void setLastModifiedBy(String lastModifiedBy) {
079: this .lastModifiedBy = lastModifiedBy;
080: }
081:
082: @XmlElement(name="version")
083: public int getVersion() {
084: return version;
085: }
086:
087: public void setVersion(int version) {
088: this .version = version;
089: }
090:
091: @XmlElement(name="creation-ip")
092: public String getCreationIP() {
093: return creationIP;
094: }
095:
096: public void setCreationIP(String creationIP) {
097: this .creationIP = creationIP;
098: }
099:
100: @XmlElement(name="last-mod-ip")
101: public String getLastModificationIP() {
102: return lastModificationIP;
103: }
104:
105: public void setLastModificationIP(String lastModificationIP) {
106: this .lastModificationIP = lastModificationIP;
107: }
108:
109: public void init(ActionRequest request) {
110: this .createdBy = request.getRemoteUser();
111: this .lastModifiedBy = this .createdBy;
112: this .creationIP = (String) request
113: .getAttribute(PortalConstants.REMOTE_ADDR_ATTRIBUTE);
114: this .lastModificationIP = this .creationIP;
115: }
116:
117: public void update(ActionRequest request) {
118: this .lastModifiedBy = request.getRemoteUser();
119: this .lastModificationIP = (String) request
120: .getAttribute(PortalConstants.REMOTE_ADDR_ATTRIBUTE);
121: this.lastModificationTime = GregorianCalendar.getInstance();
122: }
123:
124: }
|