001: /*
002: * $Header: /export/home/cvsroot/MyPersonalizerRepository/MyPersonalizer/Subsystems/Portal/Sources/es/udc/mypersonalizer/portal/model/types/content/AddWorkspaceEvent.java,v 1.1.1.1 2004/03/25 12:08:40 fbellas Exp $
003: * $Revision: 1.1.1.1 $
004: * $Date: 2004/03/25 12:08:40 $
005: *
006: * =============================================================================
007: *
008: * Copyright (c) 2003, The MyPersonalizer Development Group
009: * (http://www.tic.udc.es/~fbellas/mypersonalizer/index.html) at
010: * University Of A Coruna
011: * All rights reserved.
012: *
013: * Redistribution and use in source and binary forms, with or without
014: * modification, are permitted provided that the following conditions are met:
015: *
016: * - Redistributions of source code must retain the above copyright notice,
017: * this list of conditions and the following disclaimer.
018: *
019: * - Redistributions in binary form must reproduce the above copyright notice,
020: * this list of conditions and the following disclaimer in the documentation
021: * and/or other materials provided with the distribution.
022: *
023: * - Neither the name of the University Of A Coruna nor the names of its
024: * contributors may be used to endorse or promote products derived from
025: * this software without specific prior written permission.
026: *
027: * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
028: * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
029: * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
030: * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
031: * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
032: * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
033: * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
034: * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
035: * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
036: * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
037: * POSSIBILITY OF SUCH DAMAGE.
038: *
039: */
040:
041: package es.udc.mypersonalizer.portal.model.types.content;
042:
043: import es.udc.mypersonalizer.portal.model.permissions.UserCredentials;
044: import es.udc.mypersonalizer.portal.model.types.PortalEvent;
045:
046: /**
047: * This class is used as an event for {@link
048: * es.udc.mypersonalizer.portal.model.actions.content.AddWorkspaceAction}.
049: * It provides the needed information to add
050: * a new workspace to the user's desktop. It contains:
051: *
052: * <ul>
053: * <li><tt>desktopLayoutIdentifier</tt>: The property identifier for the
054: * user's desktop, as the addition of a new workspace will alter this
055: * desktop's data.</li>
056: * <li><tt>workspaceLayoutIdentifier</tt>: The identifier of the
057: * mypersonalizer user workspace on which the new workspace will be based
058: * (only for non-mypersonalizer user).</li>
059: * <li><tt>workspaceType</tt>: The type of the workspace definition
060: * on which the new workspace will be based (only for mypersonalizer
061: * user).</li>
062: * <li><tt>workspaceName</tt>: The name of the new workspace to be
063: * added (OPTIONAL).</li>
064: * <li><tt>timeStamp</tt>: The desktop layout's time stamp, to ensure that
065: * it has not been concurrently modified.</li>
066: * </ul>
067: *
068: * @author Daniel Fernandez
069: * @since 1.0
070: */
071: public class AddWorkspaceEvent extends PortalEvent {
072:
073: /**
074: * The desktop layout identifier.
075: */
076: private Long desktopLayoutIdentifier;
077:
078: /**
079: * The identifier of the mypersonalizer user's workspace on which the
080: * new one will be based.
081: */
082: private Long workspaceLayoutIdentifier;
083:
084: /**
085: * The type ofthe workspace definition on which the new workspace will
086: * be based.
087: */
088: private String workspaceType;
089:
090: /**
091: * The name for the new workspace.
092: */
093: private String workspaceName;
094:
095: /**
096: * The desktop layout time stamp.
097: */
098: private Long timeStamp;
099:
100: /**
101: * Creates a new instance of this event for a normal user.
102: *
103: * @param userCredentials the user credentials.
104: * @param desktopLayoutIdentifier the desktop layout identifier.
105: * @param workspaceLayoutIdentifier the mypersonalizer workspace layout
106: * identifier.
107: * @param workspaceName the name of the new workspace.
108: * @param timeStamp the desktop layout time stamp.
109: */
110: public AddWorkspaceEvent(UserCredentials userCredentials,
111: Long desktopLayoutIdentifier,
112: Long workspaceLayoutIdentifier, String workspaceName,
113: Long timeStamp) {
114: super (userCredentials);
115: this .desktopLayoutIdentifier = desktopLayoutIdentifier;
116: this .workspaceLayoutIdentifier = workspaceLayoutIdentifier;
117: this .workspaceName = workspaceName;
118: this .timeStamp = timeStamp;
119: }
120:
121: /**
122: * Creates a new instance of this event for the mypersonalizer user.
123: *
124: * @param userCredentials the user credentials.
125: * @param desktopLayoutIdentifier the desktop layout identifier.
126: * @param workspaceType the type of the workspace definition.
127: * @param workspaceName the name of the new workspace.
128: * @param timeStamp the desktop layout time stamp.
129: */
130: public AddWorkspaceEvent(UserCredentials userCredentials,
131: Long desktopLayoutIdentifier, String workspaceType,
132: String workspaceName, Long timeStamp) {
133: super (userCredentials);
134: this .desktopLayoutIdentifier = desktopLayoutIdentifier;
135: this .workspaceType = workspaceType;
136: this .workspaceName = workspaceName;
137: this .timeStamp = timeStamp;
138: }
139:
140: /**
141: * Returns the property identifier for the desktop layout.
142: *
143: * @return the desktop layout identifier.
144: */
145: public Long getDesktopLayoutIdentifier() {
146: return desktopLayoutIdentifier;
147: }
148:
149: /**
150: * Returns the identifier for the mypersonalizer workspace on which the
151: * new workspace will be based.
152: *
153: * @return the workspace layout identifier.
154: */
155: public Long getWorkspaceLayoutIdentifier() {
156: return workspaceLayoutIdentifier;
157: }
158:
159: /**
160: * Returns the type of the workspace definition on which the new
161: * workspace will be based.
162: *
163: * @return the type of the workspace definition.
164: */
165: public String getWorkspaceType() {
166: return workspaceType;
167: }
168:
169: /**
170: * Returns the name of the new workspace.
171: *
172: * @return the name of the new workspace.
173: */
174: public String getWorkspaceName() {
175: return workspaceName;
176: }
177:
178: /**
179: * Returns the desktop layout time stamp.
180: *
181: * @return the desktop layout time stamp.
182: */
183: public Long getTimeStamp() {
184: return timeStamp;
185: }
186:
187: }
|