click-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Adrian A. (JIRA)" <j...@apache.org>
Subject [jira] Updated: (CLK-543) Refactor AbstractLink to Link and include Simple/External Link functionality.
Date Thu, 04 Mar 2010 11:33:27 GMT

     [ https://issues.apache.org/jira/browse/CLK-543?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Adrian A. updated CLK-543:
--------------------------

      Description: 
There doesn't seem to be any "simple link" control in Click to be  able to point to an arbitrary
URL (internal but external too).
There's now the ExternalLink but it's just too specific :( - extending it would conflict with
it's name (maybe a rename would be better).

In many cases there's no distinction in the application between an internal an external URL
(e.g. because the external might be a subdomain).

Another problem is that AbstractLink is can't be used directly for these simple cases (being
abstract).

Basically a SimpleLink code would look like ExternalLink, but it would have this additional
snippet after L:106:
<code>
        String ctxPath = getContext().getRequest().getContextPath();
        if(!getTargetPath().contains("://")) {
            buffer.append(ctxPath);
        }
</code>
This would allow to use only one control, and in the application logic, depending on the target,
to let the control itself render the required context path if needed.
----------------------------------------------------------------------
Update:
- Refactor abstract AbstractLink class to a concrete class, simply named "Link"
- Include basic Link functionality in this Link class - something like SimpleLink and ExternalLink
- Deprecate ExternalLink

Users will be able to use the Link control directly so there will be no confusions.
(Most of the time they use ActionLink without an action, because AbstractLink is abstract)


  was:
There doesn't seem to be any "simple link" control in Click to be  able to point to an arbitrary
URL (internal but external too).
There's now the ExternalLink but it's just too specific :( - extending it would conflict with
it's name (maybe a rename would be better).

In many cases there's no distinction in the application between an internal an external URL
(e.g. because the external might be a subdomain).

Another problem is that AbstractLink is can't be used directly for these simple cases (being
abstract).

Basically a SimpleLink code would look like ExternalLink, but it would have this additional
snippet after L:106:
<code>
        String ctxPath = getContext().getRequest().getContextPath();
        if(!getTargetPath().contains("://")) {
            buffer.append(ctxPath);
        }
</code>
This would allow to use only one control, and in the application logic, depending on the target,
to let the control itself render the required context path if needed.

Thank you,
A.



    Fix Version/s: 2.2.0
         Assignee: Adrian A.
          Summary: Refactor AbstractLink to Link and include Simple/External Link functionality.
 (was: SimpleLink control.)

> Refactor AbstractLink to Link and include Simple/External Link functionality.
> -----------------------------------------------------------------------------
>
>                 Key: CLK-543
>                 URL: https://issues.apache.org/jira/browse/CLK-543
>             Project: Click
>          Issue Type: New Feature
>          Components: extras
>            Reporter: Adrian A.
>            Assignee: Adrian A.
>             Fix For: 2.2.0
>
>
> There doesn't seem to be any "simple link" control in Click to be  able to point to an
arbitrary URL (internal but external too).
> There's now the ExternalLink but it's just too specific :( - extending it would conflict
with it's name (maybe a rename would be better).
> In many cases there's no distinction in the application between an internal an external
URL (e.g. because the external might be a subdomain).
> Another problem is that AbstractLink is can't be used directly for these simple cases
(being abstract).
> Basically a SimpleLink code would look like ExternalLink, but it would have this additional
snippet after L:106:
> <code>
>         String ctxPath = getContext().getRequest().getContextPath();
>         if(!getTargetPath().contains("://")) {
>             buffer.append(ctxPath);
>         }
> </code>
> This would allow to use only one control, and in the application logic, depending on
the target, to let the control itself render the required context path if needed.
> ----------------------------------------------------------------------
> Update:
> - Refactor abstract AbstractLink class to a concrete class, simply named "Link"
> - Include basic Link functionality in this Link class - something like SimpleLink and
ExternalLink
> - Deprecate ExternalLink
> Users will be able to use the Link control directly so there will be no confusions.
> (Most of the time they use ActionLink without an action, because AbstractLink is abstract)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message