Ambra Journal URI Mapping

When a request comes to Ambra web application two filters take care of mapping journal specified in URL to corresponding Freemarker templates, css, javascript and other resources:

  1. VirtualJournalContextFilter loops through the list of journals, looks in configuration for ambra.virtualjournal.journal_name.rules and then parses request header for the string specified in the rule. If it matches, it's going to create new VirtualJournalContext and attach it to the request object.
  1. VirtualJournalMappingFilter gets request URI and replaces HttpServletRequest with new HttpServletRequestWrapper that returns modified paths based on VirtualJournalContext that has been attached to request in previous filter. For example /ambra-webapp/css/forms.css becomes /ambra-webapp/struts/journals/plosone/css/forms.css

Sequence Diagram

Web Request SD

Attachments