Uploaded image for project: 'Admin Tools Application'
  1. Admin Tools Application
  2. ADMINTOOL-13

CheckXWikiConfig : hardcoded xwikicfgdir and no warning when xwiki.cfg not found / wrong check report

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Major
    • 4.1
    • 4.0
    • None
    • None

    Description

      I set the issue type to Bug because the tool reports a warning about xwiki encoding not being configured rather than reporting that xwiki.cfg is not found, letting the user in the belief that something is potentially wrong with his encoding settings.

      I see in the code:

      def xwikicfgdir = new
      File("${appserverpath}/webapps/xwiki/WEB-INF/xwiki.cfg")
      if (xwikicfgdir.exists()) {
        def content = Util.getFileContent(xwikicfgdir)
        def is = new ByteArrayInputStream(content.getBytes());
        def props = new Properties();
        props.load(is);
        xwencoding = props.get("xwiki.encoding")
        xwencryptkey = props.get("xwiki.authentication.encryptionKey")
      } else {
        xwencoding = 'null'
        xwencryptkey = 'null'
      }
      

      'webapps/xwiki' part is hard-coded. Maybe there is no other choice but
      at least the code should display something whenever the file is not
      found. (else...)
      Second, if there are hard-coded value like this why not doing a define
      in the heading of the page code ? Like "def webappdir =
      '/webapps/ROOT'" with a nice comment then use that var in the
      corresponding code section ?

      Attachments

        Activity

          People

            camil7 Clemens Robbenhaar
            Martin Martin Hamant
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: