1
|
|
|
2
|
|
|
3
|
|
|
4
|
|
|
5
|
|
|
6
|
|
|
7
|
|
|
8
|
|
|
9
|
|
|
10
|
|
|
11
|
|
|
12
|
|
|
13
|
|
|
14
|
|
|
15
|
|
package org.apache.tapestry.services.impl;
|
16
|
|
|
17
|
|
import java.net.URL;
|
18
|
|
import java.util.ArrayList;
|
19
|
|
import java.util.Collection;
|
20
|
|
import java.util.List;
|
21
|
|
import java.util.Locale;
|
22
|
|
|
23
|
|
import javax.servlet.http.HttpServlet;
|
24
|
|
|
25
|
|
import org.apache.hivemind.HiveMind;
|
26
|
|
import org.apache.hivemind.Location;
|
27
|
|
import org.apache.hivemind.Resource;
|
28
|
|
import org.apache.hivemind.impl.MessageFormatter;
|
29
|
|
import org.apache.tapestry.IComponent;
|
30
|
|
import org.apache.tapestry.INamespace;
|
31
|
|
import org.apache.tapestry.engine.IEngineService;
|
32
|
|
import org.apache.tapestry.services.Infrastructure;
|
33
|
|
import org.apache.tapestry.spec.IComponentSpecification;
|
34
|
|
import org.apache.tapestry.spec.IContainedComponent;
|
35
|
|
|
36
|
|
|
37
|
|
|
38
|
|
|
39
|
|
|
40
|
|
class ImplMessages
|
41
|
|
{
|
42
|
|
protected static MessageFormatter _formatter = new MessageFormatter(ImplMessages.class,
|
43
|
|
"ImplStrings");
|
44
|
|
|
45
|
0
|
static String initializerContribution()
|
46
|
|
{
|
47
|
0
|
return _formatter.getMessage("initializer-contribution");
|
48
|
|
}
|
49
|
|
|
50
|
17
|
static String noApplicationSpecification(HttpServlet servlet)
|
51
|
|
{
|
52
|
17
|
return _formatter.format("no-application-specification", servlet.getServletName());
|
53
|
|
}
|
54
|
|
|
55
|
1
|
static String errorInstantiatingEngine(Class engineClass, Throwable cause)
|
56
|
|
{
|
57
|
1
|
return _formatter.format("error-instantiating-engine", engineClass.getName(), cause);
|
58
|
|
}
|
59
|
|
|
60
|
0
|
static String noTemplateForComponent(String componentId, Locale locale)
|
61
|
|
{
|
62
|
0
|
return _formatter.format("no-template-for-component", componentId, locale);
|
63
|
|
}
|
64
|
|
|
65
|
0
|
static String noTemplateForPage(String pageName, Locale locale)
|
66
|
|
{
|
67
|
0
|
return _formatter.format("no-template-for-page", pageName, locale);
|
68
|
|
}
|
69
|
|
|
70
|
0
|
static String unableToReadTemplate(Object template)
|
71
|
|
{
|
72
|
0
|
return _formatter.format("unable-to-read-template", template);
|
73
|
|
}
|
74
|
|
|
75
|
0
|
static String unableToParseTemplate(Resource resource)
|
76
|
|
{
|
77
|
0
|
return _formatter.format("unable-to-parse-template", resource);
|
78
|
|
}
|
79
|
|
|
80
|
0
|
static String unableToParseSpecification(Resource resource)
|
81
|
|
{
|
82
|
0
|
return _formatter.format("unable-to-parse-specification", resource);
|
83
|
|
}
|
84
|
|
|
85
|
0
|
static String unableToReadInfrastructureProperty(String propertyName, Infrastructure service,
|
86
|
|
Throwable cause)
|
87
|
|
{
|
88
|
0
|
return _formatter.format(
|
89
|
|
"unable-to-read-infrastructure-property",
|
90
|
|
propertyName,
|
91
|
|
service,
|
92
|
|
cause);
|
93
|
|
}
|
94
|
|
|
95
|
0
|
static String multipleComponentReferences(IComponent component, String id)
|
96
|
|
{
|
97
|
0
|
return _formatter.format("multiple-component-references", component.getExtendedId(), id);
|
98
|
|
}
|
99
|
|
|
100
|
1
|
static String dupeComponentId(String id, IContainedComponent containedComponent)
|
101
|
|
{
|
102
|
1
|
return _formatter.format("dupe-component-id", id, HiveMind
|
103
|
|
.getLocationString(containedComponent));
|
104
|
|
}
|
105
|
|
|
106
|
0
|
static String unbalancedCloseTags()
|
107
|
|
{
|
108
|
0
|
return _formatter.getMessage("unbalanced-close-tags");
|
109
|
|
}
|
110
|
|
|
111
|
1
|
static String templateBindingForInformalParameter(IComponent loadComponent,
|
112
|
|
String parameterName, IComponent component)
|
113
|
|
{
|
114
|
1
|
return _formatter.format("template-binding-for-informal-parameter", loadComponent
|
115
|
|
.getExtendedId(), parameterName, component.getExtendedId());
|
116
|
|
}
|
117
|
|
|
118
|
1
|
static String templateBindingForReservedParameter(IComponent loadComponent,
|
119
|
|
String parameterName, IComponent component)
|
120
|
|
{
|
121
|
1
|
return _formatter.format("template-binding-for-reserved-parameter", loadComponent
|
122
|
|
.getExtendedId(), parameterName, component.getExtendedId());
|
123
|
|
}
|
124
|
|
|
125
|
0
|
static String missingComponentSpec(IComponent component, Collection ids)
|
126
|
|
{
|
127
|
0
|
StringBuffer buffer = new StringBuffer();
|
128
|
0
|
List idList = new ArrayList(ids);
|
129
|
0
|
int count = idList.size();
|
130
|
|
|
131
|
0
|
for (int i = 0; i < count; i++)
|
132
|
|
{
|
133
|
0
|
if (i > 0)
|
134
|
0
|
buffer.append(", ");
|
135
|
|
|
136
|
0
|
buffer.append(idList.get(i));
|
137
|
|
}
|
138
|
|
|
139
|
0
|
return _formatter.format("missing-component-spec", component.getExtendedId(), new Integer(
|
140
|
|
count), buffer.toString());
|
141
|
|
}
|
142
|
|
|
143
|
0
|
static String bodylessComponent()
|
144
|
|
{
|
145
|
0
|
return _formatter.getMessage("bodyless-component");
|
146
|
|
}
|
147
|
|
|
148
|
1
|
static String dupeTemplateBinding(String name, IComponent component, IComponent loadComponent)
|
149
|
|
{
|
150
|
1
|
return _formatter.format(
|
151
|
|
"dupe-template-binding",
|
152
|
|
name,
|
153
|
|
component.getExtendedId(),
|
154
|
|
loadComponent.getExtendedId());
|
155
|
|
}
|
156
|
|
|
157
|
0
|
static String unableToLoadProperties(URL url, Throwable cause)
|
158
|
|
{
|
159
|
0
|
return _formatter.format("unable-to-load-properties", url, cause);
|
160
|
|
}
|
161
|
|
|
162
|
4
|
static String noSuchService(String name)
|
163
|
|
{
|
164
|
4
|
return _formatter.format("no-such-service", name);
|
165
|
|
}
|
166
|
|
|
167
|
2
|
static String dupeService(String name, EngineServiceContribution existing)
|
168
|
|
{
|
169
|
2
|
return _formatter.format("dupe-service", name, HiveMind.getLocationString(existing));
|
170
|
|
}
|
171
|
|
|
172
|
1
|
static String unableToParseExpression(String expression, Throwable cause)
|
173
|
|
{
|
174
|
1
|
return _formatter.format("unable-to-parse-expression", expression, cause);
|
175
|
|
}
|
176
|
|
|
177
|
3
|
static String parsedExpression()
|
178
|
|
{
|
179
|
3
|
return _formatter.getMessage("parsed-expression");
|
180
|
|
}
|
181
|
|
|
182
|
2
|
static String unableToReadExpression(String expression, Object target, Throwable cause)
|
183
|
|
{
|
184
|
2
|
return _formatter.format("unable-to-read-expression", expression, target, cause);
|
185
|
|
}
|
186
|
|
|
187
|
1
|
static String unableToWriteExpression(String expression, Object target, Object value,
|
188
|
|
Throwable cause)
|
189
|
|
{
|
190
|
1
|
return _formatter.format("unable-to-write-expression", new Object[]
|
191
|
|
{ expression, target, value, cause });
|
192
|
|
}
|
193
|
|
|
194
|
1
|
static String isConstantExpressionError(String expression, Exception ex)
|
195
|
|
{
|
196
|
1
|
return _formatter.format("is-constant-expression-error", expression, ex);
|
197
|
|
}
|
198
|
|
|
199
|
711
|
static String templateParameterName(String name)
|
200
|
|
{
|
201
|
711
|
return _formatter.format("template-parameter-name", name);
|
202
|
|
}
|
203
|
|
|
204
|
165
|
static String componentPropertySourceDescription(IComponentSpecification spec)
|
205
|
|
{
|
206
|
165
|
return _formatter.format("component-property-source-description", spec
|
207
|
|
.getSpecificationLocation());
|
208
|
|
}
|
209
|
|
|
210
|
76
|
static String namespacePropertySourceDescription(INamespace namespace)
|
211
|
|
{
|
212
|
76
|
return _formatter
|
213
|
|
.format("namespace-property-source-description", namespace.getExtendedId());
|
214
|
|
}
|
215
|
|
|
216
|
1
|
static String invalidEncoding(String encoding, Throwable cause)
|
217
|
|
{
|
218
|
1
|
return _formatter.format("invalid-encoding", encoding, cause);
|
219
|
|
}
|
220
|
|
|
221
|
2
|
static String errorResetting(Throwable cause)
|
222
|
|
{
|
223
|
2
|
return _formatter.format("error-resetting", cause);
|
224
|
|
}
|
225
|
|
|
226
|
1
|
static String engineServiceInnerProxyToString(String serviceName)
|
227
|
|
{
|
228
|
1
|
return _formatter.format("engine-service-inner-proxy-to-string", serviceName);
|
229
|
|
}
|
230
|
|
|
231
|
1
|
static String engineServiceOuterProxyToString(String serviceName)
|
232
|
|
{
|
233
|
1
|
return _formatter.format("engine-service-outer-proxy-to-string", serviceName);
|
234
|
|
}
|
235
|
|
|
236
|
1
|
static String serviceNameMismatch(IEngineService service, String expectedName, String actualName)
|
237
|
|
{
|
238
|
1
|
return _formatter.format("service-name-mismatch", service, expectedName, actualName);
|
239
|
|
}
|
240
|
|
|
241
|
2
|
static String infrastructureAlreadyInitialized(String newMode, String initializedMode)
|
242
|
|
{
|
243
|
2
|
return _formatter.format("infrastructure-already-initialized", newMode, initializedMode);
|
244
|
|
}
|
245
|
|
|
246
|
2
|
static String duplicateInfrastructureContribution(InfrastructureContribution conflict,
|
247
|
|
Location existingLocation)
|
248
|
|
{
|
249
|
2
|
return _formatter.format(
|
250
|
|
"duplicate-infrastructure-contribution",
|
251
|
|
conflict.getProperty(),
|
252
|
|
conflict.getMode(),
|
253
|
|
existingLocation);
|
254
|
|
}
|
255
|
|
|
256
|
2
|
static String infrastructureNotInitialized()
|
257
|
|
{
|
258
|
2
|
return _formatter.getMessage("infrastructure-not-initialized");
|
259
|
|
}
|
260
|
|
|
261
|
2
|
static String missingInfrastructureProperty(String propertyName)
|
262
|
|
{
|
263
|
2
|
return _formatter.format("missing-infrastructure-property", propertyName);
|
264
|
|
}
|
265
|
|
}
|