[MGNLDMS-138] DMS 1.2.6 generated URLs not clean Created: 07/Oct/08 Updated: 03/Jul/14 Resolved: 14/Oct/08 |
|
| Status: | Closed |
| Project: | Document Management System (closed) |
| Component/s: | None |
| Affects Version/s: | 1.2.6 |
| Fix Version/s: | 1.2.7, 1.3 |
| Type: | Bug | Priority: | Major |
| Reporter: | Francis Pallini | Assignee: | Jan Haderka |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
Linux dev.ecilia.fr 2.6.15-52-server #1 SMP Wed Aug 20 13:40:34 UTC 2008 i686 GNU/Linux |
||
| Issue Links: |
|
||||||||||||||||||||||||
| Template: |
|
||||||||||||||||||||||||
| Acceptance criteria: |
Empty
|
||||||||||||||||||||||||
| Date of First Response: | |||||||||||||||||||||||||
| Description |
|
Downloaded "magnolia-tomcat-bundle-3.6.3-bundle-jdk14.tar.gz" Performed a clean install and then re-imported previous repositories (website and dms, but NOT config). Then DMS URLs (wrapped into rendered texts) incorrectly contained double slashes (//) leading to 404 errors. Tried with a new text and a new document at the root of DMS: Test.pdf at the root of DMS -> URL = /dms//Test.pdf Had to replace /server/URI2RepositoryMapping/mappings/dms/class in the config repository with a subclass of info.magnolia.module.dms.DMSURI2RepositoryMapping in order to provide a temporary workaround: public class DMSURI2RepositoryMappingFix extends DMSURI2RepositoryMapping { private String cleanHandle(String handle) { handle = StringUtils.replace(handle, "//", "/"); public String getHandle(String uri) { return cleanHandle(super.getHandle(uri)); }public String getURI(UUIDLink uuidLink) { return cleanHandle(super.getURI(uuidLink)); }} Maybe another workaround would have been to remove trailing slash of /server/URI2RepositoryMapping/mappings/dms/URIPrefix but that didn't seem a clean solution to us. |
| Comments |
| Comment by Magnolia International [ 07/Oct/08 ] |
|
The trailing slash in the mapping was in fact added to solve |
| Comment by Jan Haderka [ 08/Oct/08 ] |
|
I've fixed getURI in trunk and added test so it doesn't happen again. |
| Comment by Francis Pallini [ 08/Oct/08 ] |
|
As far as I know, DMS module is closed-source so we had no way of knowing that. As cleanHandle (copied from info.magnolia.cms.beans.config.URI2RepositoryMapping) seems harmless on correct URLs, we just duplicated the behavior exhibited by URI2RepositoryMapping (where cleanHandle is called just before return statement in both methods). |
| Comment by Magnolia International [ 08/Oct/08 ] |
Where did you get that (wrong) idea from ?? http://svn.magnolia.info/svn/community/modules/magnolia-module-dms/ |
| Comment by Jan Haderka [ 08/Oct/08 ] |
No big deal, I just wanted to be sure I didn't miss anything. If you did it just as a safety precaution, it is fine with me |
| Comment by Francis Pallini [ 08/Oct/08 ] |
|
Nice to know that. Thanks! |