01: /*
02: * Created on Dec 6, 2004
03: */
04: package com.openedit.page;
05:
06: import com.openedit.OpenEditRuntimeException;
07: import com.openedit.config.Configuration;
08:
09: /**
10: * Basic store for an action
11: */
12: public class PageAction {
13: protected String fieldActionName;
14: protected String fieldMethodName;
15: protected String fieldModuleName;
16: protected boolean fieldIncludesAll = false;
17:
18: protected Configuration fieldConfig;
19:
20: public PageAction() {
21: }
22:
23: public PageAction(String inActionName) {
24: fieldActionName = inActionName;
25: int dotIndex = getActionName().indexOf('.');
26:
27: if (dotIndex == -1) {
28: throw new OpenEditRuntimeException(
29: "Page action "
30: + getActionName()
31: + " not found, check format, e.g. \"ModuleName.method\" ");
32: }
33:
34: fieldModuleName = getActionName().substring(0, dotIndex);
35: fieldMethodName = getActionName().substring(dotIndex + 1);
36: }
37:
38: public String getMethodName() {
39: return fieldMethodName;
40: }
41:
42: public void setMethodName(String actionName) {
43: fieldMethodName = actionName;
44: }
45:
46: public Configuration getConfig() {
47: return fieldConfig;
48: }
49:
50: public void setConfig(Configuration element) {
51: fieldConfig = element;
52: }
53:
54: public String getModuleName() {
55: return fieldModuleName;
56: }
57:
58: public void setModuleName(String moduleName) {
59: fieldModuleName = moduleName;
60: }
61:
62: public String getActionName() {
63: return fieldActionName;
64: }
65:
66: public String toString() {
67: return getActionName();
68: }
69:
70: /**
71: * @param inString
72: * @return
73: */
74: public String getChildValue(String inString) {
75: if (getConfig() == null) {
76: return null;
77: }
78: return getConfig().getChildValue(inString);
79: }
80:
81: public boolean isIncludesAll() {
82: return fieldIncludesAll;
83: }
84:
85: public void setIncludesAll(boolean inIncludesAll) {
86: fieldIncludesAll = inIncludesAll;
87: }
88:
89: }
|