001: /***************************************************************
002: * This file is part of the [fleXive](R) project.
003: *
004: * Copyright (c) 1999-2008
005: * UCS - unique computing solutions gmbh (http://www.ucs.at)
006: * All rights reserved
007: *
008: * The [fleXive](R) project is free software; you can redistribute
009: * it and/or modify it under the terms of the GNU General Public
010: * License as published by the Free Software Foundation;
011: * either version 2 of the License, or (at your option) any
012: * later version.
013: *
014: * The GNU General Public License can be found at
015: * http://www.gnu.org/copyleft/gpl.html.
016: * A copy is found in the textfile GPL.txt and important notices to the
017: * license from the author are found in LICENSE.txt distributed with
018: * these libraries.
019: *
020: * This library is distributed in the hope that it will be useful,
021: * but WITHOUT ANY WARRANTY; without even the implied warranty of
022: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
023: * GNU General Public License for more details.
024: *
025: * For further information about UCS - unique computing solutions gmbh,
026: * please see the company website: http://www.ucs.at
027: *
028: * For further information about [fleXive](R), please see the
029: * project website: http://www.flexive.org
030: *
031: *
032: * This copyright notice MUST APPEAR in all copies of the file!
033: ***************************************************************/package com.flexive.shared.scripting;
034:
035: import java.io.Serializable;
036:
037: /**
038: * Class describing the mapping of a script to other objects (FxType, FxAssignment, ...)
039: *
040: * @author Markus Plesser (markus.plesser@flexive.com), UCS - unique computing solutions gmbh (http://www.ucs.at)
041: * @see FxScriptMapping
042: */
043: public class FxScriptMappingEntry implements Serializable {
044: private static final long serialVersionUID = 3904586785341626084L;
045: private long scriptId;
046: private boolean active;
047: private boolean derivedUsage;
048: private long id;
049: private long[] derivedIds;
050: private FxScriptEvent scriptEvent;
051:
052: /**
053: * Constructor
054: *
055: * @param scriptEvent event of the script
056: * @param scriptId id of the script
057: * @param active is this mapping active?
058: * @param derivedUsage should this mapping be used for derived objects as well?
059: * @param id object id of the mapping (type, assignment, ...)
060: * @param derivedIds object id's of derived objects
061: */
062: public FxScriptMappingEntry(FxScriptEvent scriptEvent,
063: long scriptId, boolean active, boolean derivedUsage,
064: long id, long[] derivedIds) {
065: this .scriptEvent = scriptEvent;
066: this .scriptId = scriptId;
067: this .active = active;
068: this .derivedUsage = derivedUsage;
069: this .id = id;
070: this .derivedIds = derivedIds;
071: }
072:
073: /**
074: * Get the id of the script
075: *
076: * @return script id
077: */
078: public long getScriptId() {
079: return scriptId;
080: }
081:
082: /**
083: * Is this mapping active?
084: *
085: * @return mapping active
086: */
087: public boolean isActive() {
088: return active;
089: }
090:
091: /**
092: * Should this mapping be used in derived objects?
093: *
094: * @return usage in derived objects?
095: */
096: public boolean isDerivedUsage() {
097: return derivedUsage;
098: }
099:
100: /**
101: * Get the mapped object id
102: *
103: * @return mapped object id
104: */
105: public long getId() {
106: return id;
107: }
108:
109: /**
110: * Get the ids of all derived (and affected) objects
111: *
112: * @return ids of all derived (and affected) objects
113: */
114: public long[] getDerivedIds() {
115: return derivedIds.clone();
116: }
117:
118: /**
119: * Get the event type of the script
120: *
121: * @return FxScriptEvent
122: */
123: public FxScriptEvent getScriptEvent() {
124: return scriptEvent;
125: }
126: }
|