/* * Handle the Compact representation of a job. */ private void handleCompact(Job<?, ?> job) throws IOException, URISyntaxException { Compact c = new Compact(); c.setAbout(getJobURI(job)); c.setTitle(job.getFullDisplayName()); String icon = Stapler.getCurrentRequest().getRootPath() + job.getBuildHealth().getIconUrl("16x16"); c.setIcon(new URI(icon)); Preview p = new Preview(); p.setHintHeight("200px"); p.setHintWidth("400px"); p.setDocument(getJobPreviewURI(job)); c.setSmallPreview(p); marshal(c); }
/* * Handle the Compact representation of a run. */ private void handleCompact(Job<?, ?> job, Run<?, ?> run) throws IOException, URISyntaxException { Compact c = new Compact(); c.setAbout(getRunURI(job, run)); c.setTitle(run.getFullDisplayName()); c.setShortTitle(run.getDisplayName()); String relative = run.getIconColor().getImageOf("16x16"); // Remove context or it shows up twice since getRootPath() and getImageOf() both include it. String icon = Stapler.getCurrentRequest().getRootPath() + relative.substring(Stapler.getCurrentRequest().getContextPath().length()); c.setIcon(new URI(icon)); Preview p = new Preview(); p.setHintHeight("300px"); p.setHintWidth("400px"); p.setDocument(getRunPreviewURI(job, run)); c.setSmallPreview(p); marshal(c); }