Uploaded image for project: 'Magnolia'
  1. Magnolia
  2. MAGNOLIA-961

small improvements in code

    XMLWordPrintable

Details

    • Improvement
    • Resolution: Fixed
    • Trivial
    • 3.0 RC3
    • 3.0 RC2
    • None
    • None

    Description

      Very minor changes:

      • in info.magnolia.module.dms.gui DMSDialogSaticLinkControl should be renamed in DMSDialogStaticLinkControl fixed ("t" is missing)
      • in info.magnolia.cms.gui.misc.Sources could be better add generic methods for Javascript and CSS like these just for more readable code:
        private String getHtmlCascadingStyleSheet(String cssFile) { StringBuffer html = new StringBuffer(); html.append("<link rel=\"stylesheet\" type=\"text/css\" href=\""); //$NON-NLS-1$ html.append(contextPath); html.append(cssFile + ".css\" />"); //$NON-NLS-1$ return html.toString(); }

      private String getHtmlJavascript(String javascriptFile)

      { StringBuffer html = new StringBuffer(); html.append("<script type=\"text/javascript\" src=\""); html.append(contextPath); html.append(javascriptFile + ".js"); html.append("\"></script>"); return html.toString(); }

      and apply changes, of course, at getHtmlJs:
      public String getHtmlJs()

      { StringBuffer html = new StringBuffer(); html.append( getHtmlJavascript("/.magnolia/pages/javascript") ); html.append( getHtmlJavascript("/.resources/admin-js/dialogs/dialogs") ); //$NON-NLS-1$ html.append( getHtmlJavascript("/.resources/admin-js/dialogs/calendar") ); //$NON-NLS-1$ return html.toString(); }
      • in info.magnolia.cms.module.ModuleUtil lines
        // if the path already exists --> delete it
        try {
        if (hm.isExist(fullPath)) {
        hm.delete(fullPath);
        if (log.isDebugEnabled())
        log.debug("already existing node [{}] deleted", fullPath);
        }

      // if the parent path not exists just create it
      if (!pathName.equals("/"))

      { ContentUtil.createPath(hm, pathName, ItemType.CONTENT); }

      }
      catch (Exception e)

      { throw new RegisterException("can't register bootstrap file: [" + name + "]", e); }

      of bootstrap method should be moved in a separate method like this:
      private static void deleteFullPathIfExists(HierarchyManager hm, String name, String fullPath, String pathName) throws RegisterException

      Checklists

        Acceptance criteria

        Attachments

          Activity

            People

              fgiust Fabrizio Giustina
              f.tinti Francesco Tinti
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Checklists

                  Task DoD