/** * Constructs a nested Map data structure with the information represented * by this Resource. The result is particularly suitable for use with with * {@link XmlMarshaller}. * * @return the nested Map data structure */ protected CrawlJobModel makeDataModel() { String baseRef = getRequest().getResourceRef().getBaseRef().toString(); if (!baseRef.endsWith("/")) { baseRef += "/"; } return new CrawlJobModel(cj,baseRef); }
/** * Constructs a nested Map data structure with the information represented * by this Resource. The result is particularly suitable for use with with * {@link XmlMarshaller}. * * @return the nested Map data structure */ protected EngineModel makeDataModel() { String baseRef = getRequest().getResourceRef().getBaseRef().toString(); if(!baseRef.endsWith("/")) { baseRef += "/"; } return new EngineModel(getEngine(), baseRef); }
Reference baseRef = getRequest().getResourceRef().getBaseRef();
protected void writeHtml(Writer writer) { String baseRef = getRequest().getResourceRef().getBaseRef().toString(); if(!baseRef.endsWith("/")) { baseRef += "/"; } Configuration tmpltCfg = getTemplateConfiguration(); ViewModel viewModel = new ViewModel(); viewModel.setFlashes(Flash.getFlashes(getRequest())); viewModel.put("baseRef",baseRef); viewModel.put("model",makeDataModel()); try { Template template = tmpltCfg.getTemplate("Beans.ftl"); template.process(viewModel, writer); writer.flush(); } catch (IOException e) { throw new RuntimeException(e); } catch (TemplateException e) { throw new RuntimeException(e); } } }
Reference baseRef = getRequest().getResourceRef().getBaseRef();
protected void writeHtml(Writer writer) { EngineModel model = makeDataModel(); String baseRef = getRequest().getResourceRef().getBaseRef().toString(); if(!baseRef.endsWith("/")) { baseRef += "/"; } Configuration tmpltCfg = getTemplateConfiguration(); ViewModel viewModel = new ViewModel(); viewModel.setFlashes(Flash.getFlashes(getRequest())); viewModel.put("baseRef",baseRef); viewModel.put("fileSeparator", File.separator); viewModel.put("engine", model); try { Template template = tmpltCfg.getTemplate("Engine.ftl"); template.process(viewModel, writer); writer.flush(); } catch (IOException e) { throw new RuntimeException(e); } catch (TemplateException e) { throw new RuntimeException(e); } }
protected void writeHtml(Writer writer) { String baseRef = getRequest().getResourceRef().getBaseRef().toString(); if(!baseRef.endsWith("/")) { baseRef += "/"; } Configuration tmpltCfg = getTemplateConfiguration(); ViewModel viewModel = new ViewModel(); viewModel.setFlashes(Flash.getFlashes(getRequest())); viewModel.put("baseRef",baseRef); viewModel.put("job", makeDataModel()); viewModel.put("heapReport", getEngine().heapReportData()); try { Template template = tmpltCfg.getTemplate("Job.ftl"); template.process(viewModel, writer); writer.flush(); } catch (IOException e) { throw new RuntimeException(e); } catch (TemplateException e) { throw new RuntimeException(e); } }
protected void writeHtml(Writer writer) { String baseRef = getRequest().getResourceRef().getBaseRef().toString(); if(!baseRef.endsWith("/")) { baseRef += "/"; } Configuration tmpltCfg = getTemplateConfiguration(); ViewModel viewModel = new ViewModel(); viewModel.setFlashes(Flash.getFlashes(getRequest())); viewModel.put("baseRef",baseRef); viewModel.put("staticRef", getStaticRef("")); viewModel.put("baseResourceRef",getRequest().getRootRef().toString()+"/engine/static/"); viewModel.put("model", makeDataModel()); viewModel.put("selectedEngine", chosenEngine); try { Template template = tmpltCfg.getTemplate("Script.ftl"); template.process(viewModel, writer); writer.flush(); } catch (IOException e) { throw new RuntimeException(e); } catch (TemplateException e) { throw new RuntimeException(e); } } }
/** * Constructs a nested Map data structure with the information represented * by this Resource. The result is particularly suitable for use with with * {@link XmlMarshaller}. * * @return the nested Map data structure */ protected ScriptModel makeDataModel() { String baseRef = getRequest().getResourceRef().getBaseRef().toString(); if(!baseRef.endsWith("/")) { baseRef += "/"; } Reference baseRefRef = new Reference(baseRef); ScriptModel model = new ScriptModel(scriptingConsole, new Reference(baseRefRef, "..").getTargetRef().toString(), getAvailableScriptEngines()); return model; }
new Reference(getRequest().getResourceRef().getBaseRef(), "..").getTargetRef().toString(), beanPath, bean,
/** * Returns the current reference as a relative reference to the current base * reference. This method should only be invoked for absolute references, * otherwise an IllegalArgumentException will be raised. * * @return The current reference as a relative reference to the current base * reference. * @see #getRelativeRef(Reference) */ public Reference getRelativeRef() { return getRelativeRef(getBaseRef()); }
private Reference updateBaseRefPath(Reference reference) { if (reference.getBaseRef().getPath() == null) { reference.getBaseRef().setPath("/"); } else if (!reference.getBaseRef().getPath().endsWith("/")) { reference.getBaseRef().setPath(reference.getBaseRef().getPath() + "/"); } return reference; }
private String getBaseUriStr() { if (this.baseUri == null) { final Reference baseRef = this.referenceCut.getBaseRef(); if (baseRef != null) { this.baseUri = baseRef.toString(false, false); } } return this.baseUri; }
private Reference updateBaseRefPath( Reference reference ) { if ( reference.getBaseRef().getPath() == null ) { reference.getBaseRef().setPath( "/" ); } else if ( !reference.getBaseRef().getPath().endsWith( "/" ) ) { reference.getBaseRef().setPath( reference.getBaseRef().getPath() + "/" ); } return reference; }
/** * Returns the current reference as a relative reference to the current base * reference. This method should only be invoked for absolute references, * otherwise an IllegalArgumentException will be raised. * * @return The current reference as a relative reference to the current base * reference. * @see #getRelativeRef(Reference) */ public Reference getRelativeRef() { return getRelativeRef(getBaseRef()); }
private String getVariantsBaseReference() { String baseRef = getReference().getBaseRef().toString(false, false); if (!baseRef.endsWith("/")) { baseRef += "/"; } int lastIndex = this.relativePart.lastIndexOf("/"); if (lastIndex != -1) { baseRef += this.relativePart.substring(0, lastIndex); } return baseRef; }
protected Reference createRootReference(Request request, String relPart) { Reference ref = new Reference(getContextRoot(request), relPart); if (!ref.getBaseRef().getPath().endsWith("/")) { ref.getBaseRef().setPath(ref.getBaseRef().getPath() + "/"); } return ref.getTargetRef(); }
protected Reference createRootReference( Request request, String relPart ) { Reference ref = new Reference( getContextRoot( request ), relPart ); if ( !ref.getBaseRef().getPath().endsWith( "/" ) ) { ref.getBaseRef().setPath( ref.getBaseRef().getPath() + "/" ); } return ref.getTargetRef(); }
@Override protected int beforeHandle(Request request, Response response) { final int result = super.beforeHandle(request, response); // Set the request's root reference request.setRootRef(request.getResourceRef().getBaseRef()); // Save the hash code of the current host setCurrent(VirtualHost.this.hashCode()); return result; } };
@Override protected int beforeHandle(Request request, Response response) { final int result = super.beforeHandle(request, response); // Set the request's root reference request.setRootRef(request.getResourceRef().getBaseRef()); // Save the hash code of the current host setCurrent(VirtualHost.this.hashCode()); return result; } };