protected String getStaticRef(String resource) { String rootRef = getRequest().getRootRef().toString(); return rootRef + "/engine/static/" + resource; } }
protected String getStaticRef(String resource) { String rootRef = dirResource.getRequest().getRootRef().toString(); return rootRef + "/engine/static/" + resource; }
/** * 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); }
/** * 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; }
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); } } }
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); } } }
/** * Construct navigational URI for given parameters. * * @param pos desired position in file * @param lines desired signed line count * @param reverse if line ordering should be displayed in reverse * @return String URI appropriate to navigate to desired view */ protected String getControlUri(long pos, int lines, boolean reverse) { Form query = new Form(); query.add("format","paged"); if(pos!=0) { query.add("pos", Long.toString(pos)); } if(lines!=128) { if(Math.abs(lines)<1) { lines = 1; } query.add("lines",Integer.toString(lines)); } if(reverse) { query.add("reverse","y"); } Reference viewRef = dirResource.getRequest().getOriginalRef().clone(); viewRef.setQuery(query.getQueryString()); return viewRef.toString(); } }
new Reference(getRequest().getResourceRef().getBaseRef(), "..").getTargetRef().toString(), beanPath, bean,
/** * Constructor from an URI reference (most likely relative). * * @param baseRef * The base reference. * @param uriReference * The URI reference, either absolute or relative. */ public Reference(Reference baseRef, Reference uriReference) { this(baseRef, uriReference.toString()); }
/** * Constructor. * * @param localRef * The local reference. */ public LocalReference(Reference localRef) { super(localRef.toString()); }
/** * Constructor from an URI reference (most likely relative). * * @param baseRef * The base reference. * @param uriReference * The URI reference, either absolute or relative. */ public Reference(Reference baseRef, Reference uriReference) { this(baseRef, uriReference.toString()); }
@Override protected boolean matchesSafely( Response item ) { final Reference ref = item.getLocationRef(); MatcherAssert.assertThat( ref, notNullValue() ); return matcher.matches( ref.toString() ); } }
/** * Returns the relative part of relative references, without the query and * fragment. If the reference is absolute, then null is returned.<br> * Note that no URI decoding is done by this method. * * @return The relative part. */ public String getRelativePart() { return isRelative() ? toString(false, false) : null; }
/** * Returns the relative part of relative references, without the query and * fragment. If the reference is absolute, then null is returned.<br> * Note that no URI decoding is done by this method. * * @return The relative part. */ public String getRelativePart() { return isRelative() ? toString(false, false) : null; }
/** * Converts to a {@link java.net.URI} instance. Note that relative * references are resolved before conversion using the {@link #getTargetRef()} method. * * @return A {@link java.net.URI} instance. */ public java.net.URI toUri() { return java.net.URI.create(getTargetRef().toString()); }
/** * Returns the relative part of relative references, without the query and * fragment. If the reference is absolute, then null is returned.<br> * Note that no URI decoding is done by this method. * * @return The relative part. */ public String getRelativePart() { return isRelative() ? toString(false, false) : null; }
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; }