Skip to main content

Release 6.3.1

Date: Aug 1, 2017

Juneau 6.3.1 is a minor release.

org.apache.juneau

  • PojoQuery improvements.

  • New RemoteMethod.returns() annotation. Allows you to specify whether the remote method returns the HTTP body or status code.

  • Fixed bugs with BEAN_includeProperties and BEAN_excludeProperties settings.

  • New/modified settings in HtmlDocSerializerContext:

    • HTMLDOC_script
    • HTMLDOC_style - Was HTMLDOC_css.
    • HTMLDOC_stylesheet - Was HTMLDOC_cssUrl. Now an array.
  • New ResourceFinder utility class. Allows you to search for resources up the parent hierarchy chain. Also allows you to search for localized resources.

  • Eliminated the following properties from HtmlDocSerializerContext: HTMLDOC_title, HTMLDOC_description, HTMLDOC_description See below on changes to simplify HTML headers.

  • Var implementations can now throw exceptions and will be converted to "{exceptionMessage}" values.

org.apache.juneau.rest

  • New 'light' stylesheet:

    Light Style

    Compared with previous 'devops':

    DevOps Style

    For those nostalgic for old times, there's also 'original':

    Original Style

  • Simplified the stylesheets and HTML code. For example, the nav links are now an ordered list of elements which makes rendering as a side-bar (for example) easier to do in CSS.

  • Modifications to the following @HtmlDoc annotations:

    • @HtmlDoc(navlinks) - Now an array of strings instead of a JSON object. Simplified syntax.

      For example:

      // Old syntax
      htmldoc=@HtmlDoc(
      links="{"
      + "up:'request:/..',"
      + "options:'servlet:/?method=OPTIONS',"
      + "contentTypes:'$W{ContentTypeMenuItem}',"
      + "styles:'$W{StyleMenuItem}',"
      + "source:'$C{Source/gitHub}/org/apache/juneau/examples/rest/PetStoreResource.java'"
      + "}"
      )

      // New syntax
      htmldoc=@HtmlDoc(
      navlinks={
      "up: request:/..",
      "options: servlet:/?method=OPTIONS",
      "$W{ContentTypeMenuItem}",
      "$W{StyleMenuItem}",
      "source: $C{Source/gitHub}/org/apache/juneau/examples/rest/PetStoreResource.java"
      }
      )

      Previous syntax will still work but you're encouraged to use the simplified syntax.

    • Several annotations are now arrays of strings instead of simple strings. Values are simply concatenated with newlines which makes multi-line values cleaner.

      • HtmlDoc.header()
      • HtmlDoc.nav()
      • HtmlDoc.aside()
      • HtmlDoc.footer()
      • HtmlDoc.script()
      • HtmlDoc.style()

      Additionally, the "INHERIT" string literal can be used to combine the value with the value defined on the servlet or parent class. Links can also be inserted at specific index positions.

  • Improvements made to the Widget API.

    • You can now add arbitrary CSS and Javascript along with your widgets through new methods:

      • Widget.getHtml(RestRequest)
      • Widget.getScript(RestRequest)
      • Widget.getStyle(RestRequest)
    • Declaration of widgets moved to @HtmlDoc(widgets) instead of separately on @RestResource and @RestMethod annotations.

    • Widget.getName() now defaults to the simple class name. So now you can just refer to the class name: "$W{ContentTypeMenuItem}".

    • Renamed widgets:

      • PoweredByApacheWidgetPoweredByApache
      • PoweredByJuneauWidgetPoweredByJuneau
    • New MenuItemWidget can be used as a starting point for creating pull-down menu items.

    • New ContentTypeMenuItem widget that provides a pull-down menu with hyperlinks for all supported languages for that page:

      Content Type Menu Item

    • Improved QueryMenuItem widget that provides a pull-down menu of a search/view/order-by/page form:

      Query Menu Item

      Fields are now pre-filled with current query parameters.

    • New ThemeMenuItem widget that provides a pull-down menu with hyperlinks to show the content in the default stylesheets:

      Theme Menu Item

  • New/modified annotations on @HtmlDoc:

    • HtmlDoc.style() - Renamed from css().
    • HtmlDoc.stylesheet() - Renamed from cssUrl(). Can now be a comma-delimited list of URLs.
    • HtmlDoc.script() - Add arbitrary Javascript to page header.
  • Bug fix with @HtmlDoc(nowrap) so that the setting only applies to the data contents, not the whole page.

  • Two convenience methods added to RestRequest:

    • RestRequest.attr(String,Object)
    • RestRequest.prop(String,Object)
  • Annotations added:

    • @RestResource(siteName)
    • @RestResource(flags)
    • @RestMethod(flags)
  • Eliminated the @RestResource(stylesheet) annotation. It's no longer needed now that you can easily specify styles via @HtmlDoc.

  • Eliminated the following annotations since they are now redundant with @HtmlDoc(header):

    • title()
    • description()
    • branding()

    Instead, the BasicRestServlet class defines the following default header that can be easily overridden:

    htmldoc=@HtmlDoc(
    header={
    "<h1>$R{resourceTitle}</h1>",
    "<h2>$R{methodSummary,resourceDescription}</h2>",
    "<a href='http://juneau.apache.org'><img src='$U{servlet:/htdocs/juneau.png}' style='position:absolute;top:5;right:5;background-color:transparent;height:30px'/></a>"
    }
    )

    Note that the subtitle first tries using the method summary and then the servlet description.

  • New FileVar $F variable resolver for resolving the contents of files in the classpath. The DockerRegistryResource examples shows how it can be used to pull in a localized file from the classpath to populate the aside section of a page.

    htmldoc=@HtmlDoc(
    // Pull in aside contents from file.
    aside="$F{resources/DockerRegistryResourceAside.html}"
    )
  • New ReaderResource.toCommentStrippedString() method.

  • The bpIncludes() and bpExcludes() annotations on @RestMethod has been replaced with the following:

    • RestMethod.bpi() - Now an array of simplified values instead of LAX JSON.
    • RestMethod.bpx() - Now an array of simplified values instead of LAX JSON.
  • Two new variables added to $R variable: "$R{servletClass}", "$R{servletClassSimple}"

org.apache.juneau.rest.examples

  • Added CONTENT-TYPE and STYLES menu items to most pages.

  • Added improved QUERY menu item to PetStore page.