This Confluence has been LDAP enabled, if you are an ASF Committer, please use your LDAP Credentials to login. Any problems file an INFRA jira ticket please.

Child pages
  • Resource Resolution Plugins

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 5.3

...

When resolving a request URL to a resource, the list is walked and each plugin is in turn asked, whether it matches the request and can provide a resource mapping. Likewise when mapping resource paths to request URLs the list is walked and the plugin is asked whether it matches the path and can provide a mapped URL.

Interfaces

Code Block
java
java
titleResourceResolutionPlugin.javajava
public interface ResourceResolutionPlugin {

   static final String SERVICE = "ResourceResolutionPlugin";

   /**
    * Return a new resource resolution plugin instance configured
    * from the given configuration. This ValueMap is created from the
    * resource below /etc/map which instructs this plugin to be used.
    */
   ResourceResolutionInstance newInstance(ValueMap configuration);

}
Code Block
java
java
titleResourceResolutionInstance.javajava
public interface ResourceResolutionInstance {

   /**
    * Return redirect information with respect to the
    * request and the path or null if this instance
    * cannot handle the path.
    */
   RedirectInfo resolve(ResourceResolver resolver, HttpServletRequest request, String path);

   /**
    * Return an URL string or null if this instance cannot
    * map the path.
    */
   String map(ResourceResolver resolver, HttpServletRequest request, String path);

}
Code Block
java
java
titleRedirectInfo.javajava
// this may also be a class ...
public interface RedirectInfo {

    /**
     * Returns the resource to which the path resolved. This must
     * only return a non-null value if getRedirect() returns null.
     */
    Resource getResource();

    /**
     * Returns the redirect target to which the path resolved. This
     * must only return a non-null value if getResource() returns
     * null.
     */
    String getRedirect();

    /**
     * The HTTP status code to use for the redirect to the target
     * given by getRedirect(). This should only be considered valid
     * if getRedirect() returns a non-null value.
    int getStatus();
}