Interface RedirectDefinable

  • All Superinterfaces:
    EntityProvider, Redirectable

    public interface RedirectDefinable
    extends Redirectable
    This entity type has the ability to define and handle configurable URLs
    This adds the ability to supply a large set of simple redirects
    URLs like this can be handled and supported:
    /gradebook/7890/student/70987 to view all the grades for a student from a course
    /gradebook/6758/item/Quiz1 to view a particular item in a gradebook by it's human readable name
    /gradebook/item/6857657 to maybe just a view an item by its unique id.
    This is one of the capability extensions for the EntityProvider interface
    The convention interface is at Redirectable
    Author:
    Aaron Zeckoski (azeckoski @ gmail.com)
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      TemplateMap[] defineURLMappings()
      Defines the set of simple URL rewrites for this prefix
      Simple rewrites require no processing logic to handle the redirect and the redirect is always processed before anything validity checks happen
      Some examples:
      /myprefix/item/{id} => /my-item/{id}
      /myprefix/{year}/{month}/{day} => /myprefix/?
    • Method Detail

      • defineURLMappings

        TemplateMap[] defineURLMappings()
        Defines the set of simple URL rewrites for this prefix
        Simple rewrites require no processing logic to handle the redirect and the redirect is always processed before anything validity checks happen
        Some examples:
        /myprefix/item/{id} => /my-item/{id}
        /myprefix/{year}/{month}/{day} => /myprefix/?date={year}-{month}-{day}
        incomingURL is the URL template pattern to match including the /prefix using {name} to indicate variables
        Example: /{prefix}/{thing}/site/{siteId} will match the following URL:
        /myprefix/123/site/456, the variables will be {prefix => myprefix, thing => 123, siteId => 456}
        NOTE: all incoming URL templates must start with "/{prefix}" (TemplateParseUtil.TEMPLATE_PREFIX)
        outgoingURL is the URL template pattern to fill with values from the incoming pattern, this can start with anything, but will be processed as an external redirect if it starts with "http" or "/" (unless it starts with "/{prefix}"), otherwise it will be processed as an internal forward
        NOTE: the special variables which are available to all outgoing URLs from the system are:
        {prefix} = the entity prefix
        {extension} = the extension if one is available or '' if none
        {dot-extension} = the extension with a '.' prepended if one is set or '' if no extension
        {query-string} = the query string (e.g auto=true) or '' if none
        {question-query-string} = the query string with a '?' prepended (e.g ?auto=true) or '' if none
        Returns:
        the array of template mappings (incomingURL pattern => outgoingURL pattern) OR null/empty if you have no simple mappings