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

Follow-Up: Make it easier to extend Save.java

XMLWordPrintable

    • Icon: Improvement Improvement
    • Resolution: Fixed
    • Icon: Major Major
    • 2.1 Final
    • 2.1 Final
    • admininterface
    • None
    • all

      Since the method getRichEditValueStr(String value, int isRichEditValue) is static, it is not possible to change the saving policy for editor html without redundantly copying several methods to the extending class.

      I made getRichEditValueStr(String value, int isRichEditValue) non-static.

      Patch for revision 1139 (created with 'diff -uBbPr' on linux) ( note: the patch already got applied partly ):
      — originals/magnolia-2.1-SNAPSHOT/src/main/info/magnolia/cms/gui/control/Save.java 2005-07-13 17:15:01.000000000 +0200
      +++ patched/magnolia-2.1-SNAPSHOT/src/main/info/magnolia/cms/gui/control/Save.java 2005-08-05 14:24:34.000000000 +0200
      @@ -85,7 +85,7 @@
      /**

      • The from, containing all the fields and files. This form is generated by magnolia.
        */
      • private MultipartForm form;
        + protected MultipartForm form;

      /**

      • creates the node if it is not present
        @@ -96,7 +96,7 @@
        /**
      • The name of the repository to store the data. Website is default.
        */
      • private String repository = ContentRepository.WEBSITE;
        + protected String repository = ContentRepository.WEBSITE;

      /**

      • Do not use this without a reason.
        @@ -280,7 +280,7 @@
        // checkbox selected
        NodeData data = node.getNodeData(name);
        if (isRichEditValue != ControlSuper.RICHEDIT_NONE) { - valueStr = Save.getRichEditValueStr(valueStr, isRichEditValue); + valueStr = this.getRichEditValueStr(valueStr, isRichEditValue); }

        // actualy encoding does only work for control password
        boolean remove = false;
        @@ -568,7 +568,7 @@

      • @param isRichEditValue
      • @return todo configurable regexp on save?
        */
      • protected static String getRichEditValueStr(String value, int isRichEditValue) {
        + protected String getRichEditValueStr(String value, int isRichEditValue) {

      // encode the internal links to avoid dependences from the contextpath, position of the page
      String valueStr = LinkUtil.convertAbsoluteLinksToUUIDs(value);

        Acceptance criteria

              pbaerfuss Philipp Bärfuss
              aemi Michael Aemisegger
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Created:
                Updated:
                Resolved:

                  Task DoD