Uploaded image for project: 'Document Management System (closed)'
  1. Document Management System (closed)
  2. MGNLDMS-138

DMS 1.2.6 generated URLs not clean

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • 1.2.7, 1.3
    • 1.2.6
    • None
    • 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)

      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.

        Acceptance criteria

              had Jan Haderka
              fpallini Francis Pallini
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Created:
                Updated:
                Resolved: