juneau-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From James Bognar <jamesbog...@apache.org>
Subject Simplifying title and description on HTML pages.
Date Mon, 10 Jul 2017 17:06:24 GMT
There's a change I'd like to make to the way the page header is specified
on the HTML views.

It's rather complicated right now.  The Title and Description in the header
is added as <h1> and <h2> tags in the HtmlDocTemplateBasic class.
The title comes from @HtmlDoc.title() or @RestResource.title() if not
specified (or the resource bundle or swagger file)
The description comes from @HtmlDoc.description() or
@RestMethod.description() if not specified (or the resource bundle or
swagger file).

What I'd like to do is eliminate @HtmlDoc.title()/description()/branding(),
and just add the following default value to the header() annotation on
RestServletDefault:
@RestResource(
   htmldoc=@HtmlDoc(
      header={
         "<h1>$R{RestServlet.servletTitle}</h1>",
         "<h2>$R{RestServlet.methodSummary}</h2>",
         "<a href='http://juneau.apache.org'><img
src='$U{servlet:/htdocs/juneau.png}'></a>"
      }
   )
)

This simplifies the logic and I believe makes it easier to understand and
override in subclasses.

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message