78 out.write(ElephantContext.getRootWebPath());
81 out.write(ElephantContext.getSiteName());
87 out.write(
"_" + I_.api().used().getLanguage());
102 }
catch (ServletException | IOException ex) {
103 Logger.getLogger(CoreParser.class.getName()).log(Level.SEVERE, ElephantContext.logMsg(
null), ex);
108 if(!Strings.isBlank(value)) {
115 }
catch (ServletException | IOException ex) {
116 Logger.getLogger(CoreParser.class.getName()).log(Level.SEVERE, ElephantContext.logMsg(
null), ex);
120 Date now =
new Date();
122 out.write(DateFormats.format(now,
getToken(2), I_.api().used()));
123 }
else if(
"time".equals(
getToken(1))) {
124 out.write(DateFormats.formatTime(now,
getToken(2), I_.api().used()));
125 }
else if(
"all".equals(
getToken(1))) {
132 ElephantMarker marker =
new ElephantMarker(
constructor);
135 marker.put(
"json", JsonSearch.of(file));
140 ElephantMarker marker =
new ElephantMarker(
constructor);
144 marker.put(
"doc", NodeModel.parse(file));
146 }
catch (SAXException | ParserConfigurationException | IOException ex) {
147 Logger.getLogger(CoreParser.class.getName()).log(Level.SEVERE, ElephantContext.logMsg(
null), ex);
152 ElephantMarker marker =
new ElephantMarker(
constructor);
156 marker.put(
"props", FileUtil.getOrderedProperties(file));
157 }
catch (IOException ex) {
158 Logger.getLogger(CoreParser.class.getName()).log(Level.SEVERE, ElephantContext.logMsg(
null), ex);
164 ElephantMarker marker =
new ElephantMarker(
constructor);
166 marker.putAll(
new KeyObjectMap(
getToken(3)));
167 }
catch (ParserException ex) {
168 Logger.getLogger(Parser.class.getName()).log(Level.SEVERE, ElephantContext.logMsg(
null), ex);
175 }
else if(
"shuffle".equals(
tokens[3])) {
182 HTMLHelper hh =
new HTMLHelper(
out);
184 if(path.startsWith(
"/")) {
185 path = ElephantContext.getRootWebPath() + path;
187 hh.startTag(
"iframe",
"src=\"" + path +
188 "\" style=\"border:0;margin:0;padding:0;width:" +
193 String res = I_.compatibility().get(
getToken(1));
195 out.write(Strings.transform(res, ((Integer)ObjectString.parseString(
getToken(2), Integer.class,
true)).intValue()));
201 out.write(Strings.transform(res, ((Integer)ObjectString.parseString(
getToken(2), Integer.class,
true)).intValue()));
205 Random random =
new Random();
206 int v = random.nextInt(Integer.valueOf(
getToken(1)));
207 out.write(Integer.toString(v));
211 int i = Integer.valueOf(
getToken(1));
220 out.write(user.getName());
223 out.write(user.getId());
225 else if(
"email".equals(
getToken(1))) {
226 out.write(user.getProperty(IUser.CONNECTOR_EMAIL));
248 entity = Entities.getController(
getToken(1)).getEntity();
251 Object obj = StringParser.getValueFrom(
getToken(2), entity);
253 out.write(obj.toString());
261 if(!Strings.isBlank(format)) {
262 out.format(I_.api().used(), format, obj);
264 out.write(obj.toString());
269 IElephantEntity ee = Entities.getController(
getToken(1));
270 Object[] desc =
new Object[] { ee.getName(), ee.getDescription() };
276 IEntityCtrl ec = Plugins.loadImplementation(IEntityCtrl.class,
getToken(1));
280 if(ec.hasContent()) {
287 if(Strings.isBlank(value)) {
289 if(cookie !=
null)
out.write(cookie.getValue());
296 String indicator =
null;
299 IndicatorResult ir = Indicators.readIndicator(indicator);
300 out.write(ObjectString.formatObject(Double.valueOf(ir.getValue()),
"#,##0.00",
true));
301 out.write(
" [" + ir.getCount() +
"]");
String getToken(String name)
Object findAttribute(String key)
HttpServletResponse getResponse()
ElContext getCurrentContext()
HttpServletRequest getRequest()
String getParameter(String param)
void includeContent(String path)
void renderContext(String path, String stopper)
ElContext getRenderingContext()
boolean isInRole(String role)