001: package de.webman.acl;
002:
003: import com.teamkonzept.lib.TKException;
004: import com.teamkonzept.lib.TKVector;
005: import de.webman.acl.db.ContextDBData;
006:
007: /**
008: * A context groups one ore more tasks into a logical unit.
009: *
010: * @version 1.0
011: * @since 1.0
012: * @author © 2001 Webman AG
013: */
014: public class Context extends WMObject {
015:
016: // $Header: /cvsroot/webman-cms/source/webman/de/webman/acl/Context.java,v 1.1 2001/08/20 08:25:07 mischa Exp $
017:
018: // Attributes
019:
020: /**
021: * The name of the context.
022: */
023: private String name = null;
024:
025: /**
026: * The name of the context.
027: */
028: private String shortcut = null;
029:
030: // Constructors
031:
032: /**
033: * Provide instantion only to package classes or subclasses.
034: *
035: * @param data the initial context data.
036: */
037: protected Context(ContextDBData data) {
038: super (data);
039:
040: this .name = data.getName();
041: this .shortcut = data.getShortcut();
042: }
043:
044: // Method implementations
045:
046: /**
047: * Returns the factory of the object.
048: *
049: * @return the factory of the object.
050: * @exception com.teamkonzept.lib.TKException if an error occured during factory retrieval.
051: */
052: public final ObjectFactory getFactory() throws TKException {
053: return ContextFactory.getInstance();
054: }
055:
056: /**
057: * Returns the name of the context.
058: *
059: * @return the name of the context.
060: */
061: public final String getName() {
062: return name;
063: }
064:
065: /**
066: * Assigns the name of the context.
067: *
068: * @param name the name of the context.
069: */
070: public final void setName(String name) {
071: super .modifyAttribute(this .name, name);
072: this .name = name;
073: }
074:
075: /**
076: * Returns the shortcut of the context.
077: *
078: * @return the shortcut of the context.
079: */
080: public final String getShortcut() {
081: return shortcut;
082: }
083:
084: /**
085: * Assigns the shortcut of the context.
086: *
087: * @param shortcut the shortcut of the context.
088: */
089: public final void setShortcut(String shortcut) {
090: super .modifyAttribute(this .shortcut, shortcut);
091: this .shortcut = shortcut;
092: }
093:
094: /**
095: * Returns all tasks referencing the context.
096: *
097: * @return all tasks referencing the context.
098: * @exception com.teamkonzept.lib.TKException if an error occured during task retrieval.
099: */
100: public final TKVector getTasks() throws TKException {
101: return TaskFactory.getInstance().getTasks(this);
102: }
103:
104: }
|