Uploaded image for project: 'In-Portal CMS'
  1. In-Portal CMS
  2. INP-1553

Move out template meta comment parsing to "TemplateCommentParser" class

    XMLWordPrintable

    Details

    • Type: Refactoring
    • Status: Needs Review
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: 5.2.2
    • Component/s: CMS
    • Labels:
      None

      Description

      Plan:

      1. create the "TemplateCommentParser" class, that: - 0.2h
        • would accept path to template as constructor argument
        • the "parse" method would return associative array of results
      2. add support for data types in the class: - 0.5h
        • "string" - any string
        • "boolean" - true (when "yes"), false (when "no"), exception otherwise
        • "integer" - as-as, when a positive integer, exception otherwise
        • "category_path" - would split value by "||" and trim each each element
      3. define supported settings and their data types as class properties (similar to "Fields" array in unit config with "type" and "default") - 0.3h
      4. when template doesn't exist throw an exception - 0.1h
      5. add "getDefaults" method, that will return an array (keys - field names, values - their default values) - 0.5h
      6. when no meta comment found, then return result of calling "getDefaults" method - 0.1h
      7. when meta comment found: - 0.3h
        • if it's one line long, then return an result of calling "getDefaults" method
        • if it's invalid XML, then throw an exception
        • when unsupported setting found, then throw an exception
        • when supported setting found, but it has value unknown format, then throw an exception
      8. return parsing result (if some fields not present, then add them with their default values)
      9. delete "kThemesHelper::parseTemplateMetaInfo" in favor of using "TemplateCommentParser::parse" method - 0.5h

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                alex Alex
                Reporter:
                alex Alex
                Developer:
                Erik Snarski [Intechnic]
                Reviewer:
                Alex
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:

                  Time Tracking

                  Estimated:
                  Original Estimate - 3.5h Original Estimate - 3.5h
                  3.5h
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 15h 43m
                  15h 43m