1 |
| |
2 |
| |
3 |
| |
4 |
| |
5 |
| |
6 |
| |
7 |
| |
8 |
| |
9 |
| |
10 |
| |
11 |
| |
12 |
| |
13 |
| |
14 |
| |
15 |
| package org.apache.tapestry.resolver; |
16 |
| |
17 |
| import org.apache.hivemind.Resource; |
18 |
| import org.apache.tapestry.INamespace; |
19 |
| import org.apache.tapestry.Tapestry; |
20 |
| import org.apache.tapestry.engine.ISpecificationSource; |
21 |
| import org.apache.tapestry.spec.IComponentSpecification; |
22 |
| |
23 |
| |
24 |
| |
25 |
| |
26 |
| |
27 |
| |
28 |
| |
29 |
| |
30 |
| |
31 |
| |
32 |
| public class AbstractSpecificationResolver |
33 |
| { |
34 |
| |
35 |
| private INamespace _namespace; |
36 |
| |
37 |
| |
38 |
| private IComponentSpecification _specification; |
39 |
| |
40 |
| |
41 |
| private ISpecificationSource _specificationSource; |
42 |
| |
43 |
| private ISpecificationResolverDelegate _delegate; |
44 |
| |
45 |
| private String _applicationId; |
46 |
| |
47 |
| private Resource _contextRoot; |
48 |
| |
49 |
| |
50 |
| |
51 |
| private Resource _webInfLocation; |
52 |
| |
53 |
| private Resource _webInfAppLocation; |
54 |
| |
55 |
217
| public void initializeService()
|
56 |
| { |
57 |
217
| _webInfLocation = _contextRoot.getRelativeResource("WEB-INF/");
|
58 |
| |
59 |
217
| _webInfAppLocation = _webInfLocation.getRelativeResource(_applicationId + "/");
|
60 |
| } |
61 |
| |
62 |
| |
63 |
| |
64 |
| |
65 |
| |
66 |
| |
67 |
| |
68 |
5
| public ISpecificationResolverDelegate getDelegate()
|
69 |
| { |
70 |
5
| return _delegate;
|
71 |
| } |
72 |
| |
73 |
| |
74 |
| |
75 |
| |
76 |
| |
77 |
216
| protected Resource getContextRoot()
|
78 |
| { |
79 |
216
| return _contextRoot;
|
80 |
| } |
81 |
| |
82 |
217
| public void setContextRoot(Resource contextRoot)
|
83 |
| { |
84 |
217
| _contextRoot = contextRoot;
|
85 |
| } |
86 |
| |
87 |
| |
88 |
| |
89 |
| |
90 |
| |
91 |
1641
| protected void setNamespace(INamespace namespace)
|
92 |
| { |
93 |
1641
| _namespace = namespace;
|
94 |
| } |
95 |
| |
96 |
| |
97 |
| |
98 |
| |
99 |
| |
100 |
1670
| public INamespace getNamespace()
|
101 |
| { |
102 |
1670
| return _namespace;
|
103 |
| } |
104 |
| |
105 |
| |
106 |
| |
107 |
| |
108 |
| |
109 |
441
| protected ISpecificationSource getSpecificationSource()
|
110 |
| { |
111 |
441
| return _specificationSource;
|
112 |
| } |
113 |
| |
114 |
| |
115 |
| |
116 |
| |
117 |
| |
118 |
168
| protected Resource getWebInfLocation()
|
119 |
| { |
120 |
168
| return _webInfLocation;
|
121 |
| } |
122 |
| |
123 |
| |
124 |
| |
125 |
| |
126 |
| |
127 |
| |
128 |
170
| protected Resource getWebInfAppLocation()
|
129 |
| { |
130 |
170
| return _webInfAppLocation;
|
131 |
| } |
132 |
| |
133 |
| |
134 |
| |
135 |
| |
136 |
| |
137 |
4391
| public IComponentSpecification getSpecification()
|
138 |
| { |
139 |
4391
| return _specification;
|
140 |
| } |
141 |
| |
142 |
| |
143 |
| |
144 |
| |
145 |
| |
146 |
1609
| protected void setSpecification(IComponentSpecification specification)
|
147 |
| { |
148 |
1609
| _specification = specification;
|
149 |
| } |
150 |
| |
151 |
| |
152 |
| |
153 |
| |
154 |
| |
155 |
1612
| protected void reset()
|
156 |
| { |
157 |
1612
| _namespace = null;
|
158 |
1612
| _specification = null;
|
159 |
| } |
160 |
| |
161 |
| |
162 |
207
| public void setDelegate(ISpecificationResolverDelegate delegate)
|
163 |
| { |
164 |
207
| _delegate = delegate;
|
165 |
| } |
166 |
| |
167 |
| |
168 |
213
| public void setApplicationId(String applicationId)
|
169 |
| { |
170 |
213
| _applicationId = applicationId;
|
171 |
| } |
172 |
| |
173 |
| |
174 |
221
| public void setSpecificationSource(ISpecificationSource source)
|
175 |
| { |
176 |
221
| _specificationSource = source;
|
177 |
| } |
178 |
| |
179 |
| } |