[MAGNOLIA-538] Make it easier to extend AdminTreeMVCHandler.java and Tree.java Created: 01/Sep/05 Updated: 17/Mar/09 Resolved: 02/Sep/05 |
|
| Status: | Closed |
| Project: | Magnolia |
| Component/s: | core |
| Affects Version/s: | 2.1 Final |
| Fix Version/s: | 2.1 Final |
| Type: | Improvement | Priority: | Major |
| Reporter: | Michael Aemisegger | Assignee: | Philipp Bärfuss |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
all |
||
| 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 |
|
the private member tree should be accessed only through its getter. If not, it's impossible to extend AdminTreeMVCHandler.java and use a specialization of Tree.java. patch for revision 1437 of tagged version /magnolia2.1 : diff -uBbPr /home/maem/workspace/Pagnolia2.1/src/originals/magnolia-2.1/src/main/info/magnolia/module/admininterface/AdminTreeMVCHandler.java /home/maem/workspace/Pagnolia2.1/src/patched/magnolia-2.1/src/main/info/magnolia/module/admininterface/AdminTreeMVCHandler.java tree = new Tree(name, getRepository(), request); @@ -180,8 +181,8 @@
@@ -207,7 +208,7 @@
public String delete() { String deleteNode = request.getParameter("deleteNode"); //$NON-NLS-1$ - tree.deleteNode(path, deleteNode); + getTree().deleteNode(path, deleteNode); return VIEW_TREE; }public String activate() { boolean recursive = (request.getParameter("recursive") != null); //$NON-NLS-1$ - tree.activateNode(pathSelected, recursive); + getTree().activateNode(pathSelected, recursive); return VIEW_TREE; }public String deactivate() { - tree.deActivateNode(pathSelected); + getTree().deActivateNode(pathSelected); return VIEW_TREE; }@@ -258,12 +259,12 @@ if (isNodeDataValue || isNodeDataType) { - tree.setPath(StringUtils.substringBeforeLast(path, "/")); //$NON-NLS-1$ + getTree().setPath(StringUtils.substringBeforeLast(path, "/")); //$NON-NLS-1$ saveName = StringUtils.substringAfterLast(path, "/"); //$NON-NLS-1$ }else { // "/modules/templating/Templates/x" - tree.setPath(path); + getTree().setPath(path); }if (isLabel) { @@ -271,10 +272,10 @@ }else if (isNodeDataType) { int type = Integer.valueOf(value).intValue(); - displayValue = tree.saveNodeDataType(saveName, type); + displayValue = getTree().saveNodeDataType(saveName, type); }else { - displayValue = tree.saveNodeData(saveName, value, isMeta); + displayValue = getTree().saveNodeData(saveName, value, isMeta); } // if there was a displayValue passed show it instead of the written value
/** // after moving or copying
if (!snippetMode) { html.append("<html><head>"); //$NON-NLS-1$ @@ -364,22 +365,22 @@ renderHeaderIncludes(html); html.append("<title>Magnolia</title>"); //$NON-NLS-1$ html.append("</head>"); //$NON-NLS-1$ - html.append("<body class=\"mgnlBgDark\" onload=\"" + tree.getJavascriptTree() + ".resizeOnload();\" >"); //$NON-NLS-1$ //$NON-NLS-2$ + html.append("<body class=\"mgnlBgDark\" onload=\"" + getTree().getJavascriptTree() + ".resizeOnload();\" >"); //$NON-NLS-1$ //$NON-NLS-2$ html.append(Spacer.getHtml(20, 20)); }
if (!snippetMode) { - html.append("<div id=\"" + tree.getJavascriptTree() + "_DivSuper\" style=\"display:block;\">"); //$NON-NLS-1$ //$NON-NLS-2$ + html.append("<div id=\"" + getTree().getJavascriptTree() + "_DivSuper\" style=\"display:block;\">"); //$NON-NLS-1$ //$NON-NLS-2$ }
|
| Comments |
| Comment by Philipp Bracher [ 02/Sep/05 ] |
|
I used eclipse encapsulate field to change the code. will commit to 2.1 branch and merge with 2.2 turnk later |