KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > de > webman > acl > Context


1 package de.webman.acl;
2
3 import com.teamkonzept.lib.TKException;
4 import com.teamkonzept.lib.TKVector;
5 import de.webman.acl.db.ContextDBData;
6
7 /**
8  * A context groups one ore more tasks into a logical unit.
9  *
10  * @version 1.0
11  * @since 1.0
12  * @author © 2001 Webman AG
13  */

14 public class Context
15     extends WMObject
16 {
17
18     // $Header: /cvsroot/webman-cms/source/webman/de/webman/acl/Context.java,v 1.1 2001/08/20 08:25:07 mischa Exp $
19

20     // Attributes
21

22     /**
23      * The name of the context.
24      */

25     private String JavaDoc name = null;
26
27     /**
28      * The name of the context.
29      */

30     private String JavaDoc shortcut = null;
31
32
33     // Constructors
34

35     /**
36      * Provide instantion only to package classes or subclasses.
37      *
38      * @param data the initial context data.
39      */

40     protected Context (ContextDBData data)
41     {
42         super(data);
43
44         this.name = data.getName();
45         this.shortcut = data.getShortcut();
46     }
47
48
49     // Method implementations
50

51     /**
52      * Returns the factory of the object.
53      *
54      * @return the factory of the object.
55      * @exception com.teamkonzept.lib.TKException if an error occured during factory retrieval.
56      */

57     public final ObjectFactory getFactory ()
58         throws TKException
59     {
60         return ContextFactory.getInstance();
61     }
62
63     /**
64      * Returns the name of the context.
65      *
66      * @return the name of the context.
67      */

68     public final String JavaDoc getName ()
69     {
70         return name;
71     }
72
73     /**
74      * Assigns the name of the context.
75      *
76      * @param name the name of the context.
77      */

78     public final void setName (String JavaDoc name)
79     {
80         super.modifyAttribute(this.name, name);
81         this.name = name;
82     }
83
84     /**
85      * Returns the shortcut of the context.
86      *
87      * @return the shortcut of the context.
88      */

89     public final String JavaDoc getShortcut ()
90     {
91         return shortcut;
92     }
93
94     /**
95      * Assigns the shortcut of the context.
96      *
97      * @param shortcut the shortcut of the context.
98      */

99     public final void setShortcut (String JavaDoc shortcut)
100     {
101         super.modifyAttribute(this.shortcut, shortcut);
102         this.shortcut = shortcut;
103     }
104
105     /**
106      * Returns all tasks referencing the context.
107      *
108      * @return all tasks referencing the context.
109      * @exception com.teamkonzept.lib.TKException if an error occured during task retrieval.
110      */

111     public final TKVector getTasks ()
112         throws TKException
113     {
114         return TaskFactory.getInstance().getTasks(this);
115     }
116
117 }
118
Popular Tags