I've simplified the way the headers are defined on the HTML pages.

I've eliminated the @HtmlDoc.title()/description()/branding() annotations (and related methods and properties).  Instead, you just use the @HtmlDoc.header() with variables to define the header.

The default header value is defined in RestServletDefault as shown:

You can easily override this value to specify any value you wish.  This makes the header much more flexible and easier-to-understand.

The $R variable was changed to a DefaultingVar so that you can chain possible values to find a first-match (as shown above).

I've also added a new $F variable for pulling in values directly from localized files if you don't want to embed a bunch of HTML inside your annotations:

It's similar to widgets except it resolves to just arbitrary text (and doesn't support javascript and css like widgets do).
It's also similar to Class.getResourceAsStream(), but searches up the servlet class hierarchy for the file.  It can even pull the file from the JVM working directory as last resort.  
It also supports localized names based on the request Accept-Language.  So in the example above, if the request language is Japanese, we'll also search for DockerRegistryResourceAside_ja_JP.html and DockerRegistryResourceAside_ja.html.

Like widgets, it also strips comments from HTML files so you can add Apache license headers to your files.

Javadoc is here:  http://juneau.incubator.apache.org/site/apidocs/org/apache/juneau/rest/vars/FileVar.html

Just like widgets, the $F variable file contents can contain other variables.  (Heck...it can even contain other $F variables if you want to do fancy recursive nesting of files)

The full list of variables has been update here and linked to from various locations where they can be used:
http://juneau.incubator.apache.org/site/apidocs/org/apache/juneau/rest/RestContext.html#getVarResolver--

 

  • No labels