[MAGNOLIA-961] small improvements in code Created: 05/Jul/06  Updated: 21/Jul/06  Resolved: 21/Jul/06

Status: Closed
Project: Magnolia
Component/s: None
Affects Version/s: 3.0 RC2
Fix Version/s: 3.0 RC3

Type: Improvement Priority: Trivial
Reporter: Francesco Tinti Assignee: Fabrizio Giustina
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Template:
Acceptance criteria:
Empty
Task DoD:
[ ]* Doc/release notes changes? Comment present?
[ ]* Downstream builds green?
[ ]* Solution information and context easily available?
[ ]* Tests
[ ]* FixVersion filled and not yet released
[ ]  Architecture Decision Record (ADR)
Date of First Response:

 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



 Comments   
Comment by Fabrizio Giustina [ 21/Jul/06 ]

fixed DMSDialogSaticLinkControl name

Generated at Mon Feb 12 03:22:18 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.