Proposal title
Date | 2011/05/25 |
Contact(s) | Jesse Eichar (Camptocamp SA) |
Last edited | |
Status | Draft |
Assigned to release | 2.7.0 |
Resources | Available |
Ticket # | #808 |
Overview
Currently Logos must be in the webapplication directory and thus care must be taken to upgrade the webapplication so as not to delete the application specific files. This proposal allows the application to define an alternate location for the logos directory.
Proposal Type
- Module: Web
Links
- Documents
- Email discussions:
- Other wiki discussions:
Voting History
Motivations
- Having the Logos be in the webapplication makes it more difficult to upgrade the war file and not lose logos, made more important since users can upload the logos through the web admin interface
Proposal
In Geocat I have already done this work. I have a new servlet filter that handles requests to images/logos and images/harvesters (we can define other easily as well in the future). Upon receiving a request, the servlet filter will:
- look for the image in the defined logos directory
- if it does not find the logo it then looks in the webapp (the default logos directory) for the logo. If the logo is found there it will be copied to the logos directory and returned to browser
- If no logo is found a default logo missing logo is returned. (At the moment no error but that can easily be changed if we want).
The config.xml has a new parameter under appHandler: dataImagesDir. This specifies the parent directory of the logos and harvesters directories. by default it is images, indicating the images directory within the webapplication.
There is a Logos class that contains methods for locating the logos directory (which is defined in the config.xml file or in a overrides file.) The code application has been updated to use the Logos utility files for locating the logos directories.
The default behavior will work exactly the same as it does but now the logos can be located anywhere on the hard drive that the webapp has access if the config.xml is modified.
Backwards Compatibility Issues
100% backwards compatible
New libraries added
No new libraries.