01: /*
02: * Coefficient - facilitates project based collaboration
03: * Copyright (C) 2003, Dylan Etkin, CSIR icomtek
04: * PO Box 395
05: * Pretoria 0001, RSA
06: * This library is free software; you can redistribute it and/or
07: * modify it under the terms of the GNU Lesser General Public
08: * License as published by the Free Software Foundation; either
09: * version 2.1 of the License, or (at your option) any later version.
10: * This library is distributed in the hope that it will be useful,
11: * but WITHOUT ANY WARRANTY; without even the implied warranty of
12: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13: * Lesser General Public License for more details.
14: *
15: * You should have received a copy of the GNU Lesser General Public
16: * License along with this library; if not, write to the Free Software
17: * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18: */
19:
20: package za.org.coefficient.interfaces;
21:
22: import za.org.coefficient.authentication.Role;
23:
24: /**
25: * This interface defines methods that must be implemented by a module of the
26: * system. A module will have methods invoked with a single parameter,
27: * za.org.coefficient.core.CoefficientContext .
28: */
29: public interface ModuleLocal {
30: //~ Methods ================================================================
31:
32: public void setCoefficientContext(CoefficientContext ctx);
33:
34: public CoefficientContext getCoefficientContext();
35:
36: /**
37: * This method is used to determine which method should be invoked when
38: * the module is requested without an operation.
39: *
40: * @return name of the method that should be invoked
41: */
42: public String getMainMethod();
43:
44: /**
45: * This method is used to find the description of the module
46: *
47: * @return the description of the module
48: */
49: public String getModuleDescription();
50:
51: /**
52: * This method is used to find the display name of the module
53: *
54: * @return the display name of the module
55: */
56: public String getModuleDisplayName();
57:
58: /**
59: * This method is used to find the system name of the module that is used
60: * to resolve the session bean
61: *
62: * @return the system name of the module
63: */
64: public String getModuleName();
65:
66: /**
67: * This method is used to determine if a named method can be executed
68: * for a specified system role.
69: *
70: * @return null if we can execute the method an error message if not
71: */
72: public String canExecuteForRole(CoefficientContext ctx,
73: String methodName, Role usersHighestRole);
74:
75: /**
76: * This method is used to show help on the your module. You can get the
77: * op name by calling CoefficientContext.getLastNonHelpOp()
78: */
79: public CoefficientContext showHelp(CoefficientContext ctx);
80:
81: /**
82: * This method is used determine if we implement BaseProjectModule
83: */
84: public boolean isProjectRequired();
85: }
|