DMS 1.2.6 generated URLs not clean
----------------------------------

                 Key: MGNLDMS-138
                 URL: http://jira.magnolia.info/browse/MGNLDMS-138
             Project: Magnolia DMS Module
          Issue Type: Bug
    Affects Versions: 1.2.6
         Environment: Linux dev.ecilia.fr 2.6.15-52-server #1 SMP Wed Aug 20 
13:40:34 UTC 2008 i686 GNU/Linux
Java(TM) 2 Runtime Environment, Standard Edition (build Blackdown-1.4.2-01)
Java HotSpot(TM) Client VM (build Blackdown-1.4.2-01, mixed mode)
            Reporter: Francis Pallini
            Assignee: Philipp Bracher


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) {
                if (handle.startsWith("/") == false) {
                        handle = "/" + handle;
                }
                handle = StringUtils.replace(handle, "//", "/");
                return 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.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://jira.magnolia.info/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

----------------------------------------------------------------
for list details see
http://documentation.magnolia.info/
----------------------------------------------------------------

Reply via email to