@Inset.Runtime public final Inset insetLinks() {
/** * Token inset. * @return The inset */ @Inset.Runtime public final Inset token() { return new Inset() { @Override public void render(final BasePage<?, ?> page, final Response.ResponseBuilder builder) { if (!BaseRs.this.auth().identity().equals(Identity.ANONYMOUS)) { try { page.append( new JaxbBundle("token", BaseRs.this.user().token()) ); } catch (final IOException ex) { throw new IllegalStateException(ex); } page.link(new Link("user:refresh", "/u/refresh")); } } }; }
/** * Human inset (if logged in). * @return The inset */ @Inset.Runtime public final Inset humanLinks() { return new Inset() { @Override public void render(final BasePage<?, ?> page, final Response.ResponseBuilder builder) { if (!BaseRs.this.auth().identity().equals(Identity.ANONYMOUS)) { try { page.append(new JxHuman(BaseRs.this.human())); } catch (final IOException ex) { throw new IllegalStateException(ex); } } } }; }
/** * Menu inset. * @return The inset */ @Inset.Runtime public final Inset menu() { return new Inset() { @Override public void render(final BasePage<?, ?> page, final Response.ResponseBuilder builder) { if (!BaseRs.this.auth().identity().equals(Identity.ANONYMOUS)) { page.link(new Link("menu:home", "/")); page.link(new Link("menu:counters", "/counters")); page.link(new Link("menu:locks", "/k")); } } }; }
/** * Supplementary inset. * @return The inset */ @Inset.Runtime public final Inset insetSupplementary() { return new Inset() { @Override public void render(final BasePage<?, ?> page, final Response.ResponseBuilder builder) { builder.type(MediaType.TEXT_XML); builder.header(HttpHeaders.VARY, "Cookie"); } }; }
/** * Authentication inset. * @return The inset */ @Inset.Runtime public final AuthInset auth() { return new AuthInset(this, Manifests.read("Stateful-SecurityKey")) .with(new Auth(this, this.base())) // @checkstyle LineLength (3 lines) .with(new Facebook(this, Manifests.read("Stateful-FbId"), Manifests.read("Stateful-FbSecret"))) .with(new Google(this, Manifests.read("Stateful-GoogleId"), Manifests.read("Stateful-GoogleSecret"))) .with(new Github(this, Manifests.read("Stateful-GithubId"), Manifests.read("Stateful-GithubSecret"))) .with(BaseRs.TESTER); }
/** * Supplementary inset. * @return The inset */ @Inset.Runtime public final Inset supplementary() { return new Inset() { @Override public void render(final BasePage<?, ?> page, final Response.ResponseBuilder builder) { builder.header("X-Sttc-Version", BaseRs.VERSION_LABEL); builder.type(MediaType.TEXT_XML); builder.header(HttpHeaders.VARY, "Cookie"); } }; }
/** * Authentication inset. * @return The inset */ @Inset.Runtime public final AuthInset auth() { return new AuthInset(this, Manifests.read("Aintshy-SecurityKey")); }
/** * Inset with a version of the product. * @return The inset */ @Inset.Runtime public final Inset insetVersion() { return new VersionInset( Manifests.read("Aintshy-Version"), Manifests.read("Aintshy-Revision"), Manifests.read("Aintshy-Date") ); }
/** * Version inset. * @return The inset */ @Inset.Runtime public final Inset version() { return new VersionInset( Manifests.read("Stateful-Version"), Manifests.read("Stateful-Revision"), Manifests.read("Stateful-Date") ); }
/** * Flash. * @return The inset with flash */ @Inset.Runtime public final FlashInset flash() { return new FlashInset(this); }
/** * Flash. * @return The inset with flash */ @Inset.Runtime public final FlashInset flash() { return new FlashInset(this); }