Uploaded image for project: 'Click'
  1. Click
  2. CLK-704

Add support for absolute classnames when configuring pages in click.xml

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.2.0
    • Fix Version/s: 2.3.0-M1
    • Component/s: None
    • Labels:
      None

      Description

      Manual page loading has created quite a bit of confusion as was discussed here:

      http://click.1134972.n2.nabble.com/Confusing-page-class-mapping-td5200226.html#a5200226

      There is no clear resolution yet though.

        Activity

        Hide
        sabob Bob Schellink added a comment -

        Attached is a patch that loads the given classname and if that fails try and load the class using the package as a prefix. This patch exclude any document changes that would be necessary for such a change

        Show
        sabob Bob Schellink added a comment - Attached is a patch that loads the given classname and if that fails try and load the class using the package as a prefix. This patch exclude any document changes that would be necessary for such a change
        Hide
        sabob Bob Schellink added a comment -

        fixed in trunk, with backward compatibility preserved

        Show
        sabob Bob Schellink added a comment - fixed in trunk, with backward compatibility preserved
        Hide
        hantsy hantsy bai added a comment -

        Hi, Bob
        U left message on Click4nb(google code), let me close this issue, but it was not reported by me.
        I have an idea about the issue.
        1. If the value of auto-mapping attr is "false", ignore the package value and read the pageclass/template mapping one by one.
        2. if the value of auto-mapping attr is "true", only read the packge value, and ignore the pageclass/template mapping settings completely

        Show
        hantsy hantsy bai added a comment - Hi, Bob U left message on Click4nb(google code), let me close this issue, but it was not reported by me. I have an idea about the issue. 1. If the value of auto-mapping attr is "false", ignore the package value and read the pageclass/template mapping one by one. 2. if the value of auto-mapping attr is "true", only read the packge value, and ignore the pageclass/template mapping settings completely
        Hide
        sabob Bob Schellink added a comment -

        Hi Hantsy, I meant you can close the issue I raised on click4nb: http://code.google.com/p/click4nb/issues/detail?id=3

        Wrt this issue, it has been resolved as follows:

        page mappings should declare absolute classnames, but for backward compatibility Page classnames can be declared without the package.

        So the following is a proper mapping:

        <pages package="com.mycorp">
        <page classname="com.mycorp.Home" path="index.htm"/>
        </pages>

        So all the pages under "com.mycorp" are auto mapped, however Click cannot automatically map Home page to index.htm, so we explicitly map that page. IDE's with hot-linking should be able to link to the page class automatically.

        Kind regards

        Bob

        Show
        sabob Bob Schellink added a comment - Hi Hantsy, I meant you can close the issue I raised on click4nb: http://code.google.com/p/click4nb/issues/detail?id=3 Wrt this issue, it has been resolved as follows: page mappings should declare absolute classnames, but for backward compatibility Page classnames can be declared without the package. So the following is a proper mapping: <pages package="com.mycorp"> <page classname="com.mycorp.Home" path="index.htm"/> </pages> So all the pages under "com.mycorp" are auto mapped, however Click cannot automatically map Home page to index.htm, so we explicitly map that page. IDE's with hot-linking should be able to link to the page class automatically. Kind regards Bob

          People

          • Assignee:
            sabob Bob Schellink
            Reporter:
            sabob Bob Schellink
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development