small improvements in code
--------------------------
Key: MAGNOLIA-961
URL: http://jira.magnolia.info/browse/MAGNOLIA-961
Project: magnolia
Issue Type: Improvement
Affects Versions: 3.0 RC2
Reporter: Francesco Tinti
Assigned To: Boris Kraft
Priority: Trivial
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
--
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://www.magnolia.info/en/magnolia/developer.html
----------------------------------------------------------------