You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sling.apache.org by "Tobias Bocanegra (JIRA)" <ji...@apache.org> on 2008/07/30 10:53:31 UTC

[jira] Created: (SLING-590) Add resource.adaptTo(ValueMap.class) to page context attributes

Add resource.adaptTo(ValueMap.class) to page context attributes
---------------------------------------------------------------

                 Key: SLING-590
                 URL: https://issues.apache.org/jira/browse/SLING-590
             Project: Sling
          Issue Type: New Feature
          Components: Scripting JSP
            Reporter: Tobias Bocanegra
            Priority: Minor


<sling:defineObject/> should add a 'properties' as page context variable from resource.adaptTo(ValueMap.class)

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


[jira] Commented: (SLING-590) Add resource.adaptTo(ValueMap.class) to page context attributes

Posted by "Tobias Bocanegra (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SLING-590?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12679593#action_12679593 ] 

Tobias Bocanegra commented on SLING-590:
----------------------------------------

while a think that backward compatibility is important, some sacrifices need to be done, too. if this is marked clearly, i'd had no problem with it.

the 2nd solution is good, too. but it would invert the flag. so that people running into problems can easily turn that off.

however, what about an other default name, like: 
- resourceProperties ?
- resourceMap



> Add resource.adaptTo(ValueMap.class) to page context attributes
> ---------------------------------------------------------------
>
>                 Key: SLING-590
>                 URL: https://issues.apache.org/jira/browse/SLING-590
>             Project: Sling
>          Issue Type: New Feature
>          Components: Scripting JSP
>    Affects Versions: Scripting JSP-Taglib 2.0.2
>            Reporter: Tobias Bocanegra
>            Assignee: Carsten Ziegeler
>            Priority: Minor
>             Fix For: Scripting JSP-Taglib 2.0.4
>
>
> <sling:defineObject/> should add a 'properties' as page context variable from resource.adaptTo(ValueMap.class)

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


[jira] Commented: (SLING-590) Add resource.adaptTo(ValueMap.class) to page context attributes

Posted by "Carsten Ziegeler (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SLING-590?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12679617#action_12679617 ] 

Carsten Ziegeler commented on SLING-590:
----------------------------------------

Hm, ok if we set the default to "true" then we might also just use the currently available propertiesName attribute which can be used to give the variable a different
name than "properties"

> Add resource.adaptTo(ValueMap.class) to page context attributes
> ---------------------------------------------------------------
>
>                 Key: SLING-590
>                 URL: https://issues.apache.org/jira/browse/SLING-590
>             Project: Sling
>          Issue Type: New Feature
>          Components: Scripting JSP
>    Affects Versions: Scripting JSP-Taglib 2.0.2
>            Reporter: Tobias Bocanegra
>            Assignee: Carsten Ziegeler
>            Priority: Minor
>             Fix For: Scripting JSP-Taglib 2.0.4
>
>
> <sling:defineObject/> should add a 'properties' as page context variable from resource.adaptTo(ValueMap.class)

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


[jira] Commented: (SLING-590) Add resource.adaptTo(ValueMap.class) to page context attributes

Posted by "Carsten Ziegeler (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SLING-590?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12680166#action_12680166 ] 

Carsten Ziegeler commented on SLING-590:
----------------------------------------

Rethinking this, I prefer removing this functionality from the taglib again to avoid any incompatibilities. Whatever name we pick there is a potential collision with an already existing variable; so the only way avoiding this is to either define a new tag or a new version for the whole taglib. However as this is a very simple functionality which can be done by hand just by writing "ValueMap m = resource.adaptTo(ValueMap.class)" it's better to remove this functionality.
If noone objects I'll remove this in the next days again.

> Add resource.adaptTo(ValueMap.class) to page context attributes
> ---------------------------------------------------------------
>
>                 Key: SLING-590
>                 URL: https://issues.apache.org/jira/browse/SLING-590
>             Project: Sling
>          Issue Type: New Feature
>          Components: Scripting JSP
>    Affects Versions: Scripting JSP-Taglib 2.0.2
>            Reporter: Tobias Bocanegra
>            Assignee: Carsten Ziegeler
>            Priority: Minor
>             Fix For: Scripting JSP-Taglib 2.0.4
>
>
> <sling:defineObject/> should add a 'properties' as page context variable from resource.adaptTo(ValueMap.class)

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


[jira] Closed: (SLING-590) Add resource.adaptTo(ValueMap.class) to page context attributes

Posted by "Carsten Ziegeler (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/SLING-590?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Carsten Ziegeler closed SLING-590.
----------------------------------

    Resolution: Fixed

In Revision: 747110 a new scription variable "properties" has been added which points by default to resource.adaptTo(ValueMap.class). The name of the variable can be overwritten (attribute propertiesName) as well as the class for the adaptTo can be changed to Map (attribute propertiesIsValueMap).

> Add resource.adaptTo(ValueMap.class) to page context attributes
> ---------------------------------------------------------------
>
>                 Key: SLING-590
>                 URL: https://issues.apache.org/jira/browse/SLING-590
>             Project: Sling
>          Issue Type: New Feature
>          Components: Scripting JSP
>    Affects Versions: Scripting JSP-Taglib 2.0.2
>            Reporter: Tobias Bocanegra
>            Assignee: Carsten Ziegeler
>            Priority: Minor
>             Fix For: Scripting JSP-Taglib 2.0.4
>
>
> <sling:defineObject/> should add a 'properties' as page context variable from resource.adaptTo(ValueMap.class)

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


[jira] Reopened: (SLING-590) Add resource.adaptTo(ValueMap.class) to page context attributes

Posted by "Carsten Ziegeler (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/SLING-590?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Carsten Ziegeler reopened SLING-590:
------------------------------------


Yes, this is bad. So I see three solutions:
- define a second tag which includes the properties (and remove the properties from defineObjects)
- add a property to defineObjects which specifies if the properties variable should be created (default would be false)
- drop the properties support

Now, we will always run in this problem when we want to add a new variable; but I hope that this will only occur rarely.
I think from the solutions above, the second one is the most appealin, so I suggest to add a new attribute "props" as boolean which controls this behaviour.


> Add resource.adaptTo(ValueMap.class) to page context attributes
> ---------------------------------------------------------------
>
>                 Key: SLING-590
>                 URL: https://issues.apache.org/jira/browse/SLING-590
>             Project: Sling
>          Issue Type: New Feature
>          Components: Scripting JSP
>    Affects Versions: Scripting JSP-Taglib 2.0.2
>            Reporter: Tobias Bocanegra
>            Assignee: Carsten Ziegeler
>            Priority: Minor
>             Fix For: Scripting JSP-Taglib 2.0.4
>
>
> <sling:defineObject/> should add a 'properties' as page context variable from resource.adaptTo(ValueMap.class)

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


[jira] Closed: (SLING-590) Add resource.adaptTo(ValueMap.class) to page context attributes

Posted by "Carsten Ziegeler (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/SLING-590?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Carsten Ziegeler closed SLING-590.
----------------------------------

    Resolution: Fixed

I've removed the properties handling again in revision: 752207 to avoid the above mentioned problems.

> Add resource.adaptTo(ValueMap.class) to page context attributes
> ---------------------------------------------------------------
>
>                 Key: SLING-590
>                 URL: https://issues.apache.org/jira/browse/SLING-590
>             Project: Sling
>          Issue Type: New Feature
>          Components: Scripting JSP
>    Affects Versions: Scripting JSP-Taglib 2.0.2
>            Reporter: Tobias Bocanegra
>            Assignee: Carsten Ziegeler
>            Priority: Minor
>             Fix For: Scripting JSP-Taglib 2.0.4
>
>
> <sling:defineObject/> should add a 'properties' as page context variable from resource.adaptTo(ValueMap.class)

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


[jira] Commented: (SLING-590) Add resource.adaptTo(ValueMap.class) to page context attributes

Posted by "Felix Meschberger (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SLING-590?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12618269#action_12618269 ] 

Felix Meschberger commented on SLING-590:
-----------------------------------------

Is it ok, if it would be adaptTo(Map.class) ?

Or how about this: Default is "ValueMap properties = resource.adaptTo(ValueMap.class)"

Attributes exist to overwrite the type and name:

   propertiesName -- Name of the variable
   propertiesClass -- Name of the class to adapt the resource to

WDYT ?

> Add resource.adaptTo(ValueMap.class) to page context attributes
> ---------------------------------------------------------------
>
>                 Key: SLING-590
>                 URL: https://issues.apache.org/jira/browse/SLING-590
>             Project: Sling
>          Issue Type: New Feature
>          Components: Scripting JSP
>            Reporter: Tobias Bocanegra
>            Priority: Minor
>
> <sling:defineObject/> should add a 'properties' as page context variable from resource.adaptTo(ValueMap.class)

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


[jira] Updated: (SLING-590) Add resource.adaptTo(ValueMap.class) to page context attributes

Posted by "Carsten Ziegeler (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/SLING-590?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Carsten Ziegeler updated SLING-590:
-----------------------------------

    Affects Version/s: Scripting JSP-Taglib 2.0.2
        Fix Version/s: Scripting JSP-Taglib 2.0.4
             Assignee: Carsten Ziegeler

> Add resource.adaptTo(ValueMap.class) to page context attributes
> ---------------------------------------------------------------
>
>                 Key: SLING-590
>                 URL: https://issues.apache.org/jira/browse/SLING-590
>             Project: Sling
>          Issue Type: New Feature
>          Components: Scripting JSP
>    Affects Versions: Scripting JSP-Taglib 2.0.2
>            Reporter: Tobias Bocanegra
>            Assignee: Carsten Ziegeler
>            Priority: Minor
>             Fix For: Scripting JSP-Taglib 2.0.4
>
>
> <sling:defineObject/> should add a 'properties' as page context variable from resource.adaptTo(ValueMap.class)

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


[jira] Commented: (SLING-590) Add resource.adaptTo(ValueMap.class) to page context attributes

Posted by "Felix Meschberger (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SLING-590?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12679358#action_12679358 ] 

Felix Meschberger commented on SLING-590:
-----------------------------------------

This creates a backwards compatibility issues with scripts using <sling:defineObjects> and already defining a variable named properties themselves (I stumbled upon this using it in an application which exactly does that).

> Add resource.adaptTo(ValueMap.class) to page context attributes
> ---------------------------------------------------------------
>
>                 Key: SLING-590
>                 URL: https://issues.apache.org/jira/browse/SLING-590
>             Project: Sling
>          Issue Type: New Feature
>          Components: Scripting JSP
>    Affects Versions: Scripting JSP-Taglib 2.0.2
>            Reporter: Tobias Bocanegra
>            Assignee: Carsten Ziegeler
>            Priority: Minor
>             Fix For: Scripting JSP-Taglib 2.0.4
>
>
> <sling:defineObject/> should add a 'properties' as page context variable from resource.adaptTo(ValueMap.class)

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


[jira] Commented: (SLING-590) Add resource.adaptTo(ValueMap.class) to page context attributes

Posted by "Tobias Bocanegra (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SLING-590?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12618280#action_12618280 ] 

Tobias Bocanegra commented on SLING-590:
----------------------------------------

that would be fine, with the default of ValueMap.class

> Add resource.adaptTo(ValueMap.class) to page context attributes
> ---------------------------------------------------------------
>
>                 Key: SLING-590
>                 URL: https://issues.apache.org/jira/browse/SLING-590
>             Project: Sling
>          Issue Type: New Feature
>          Components: Scripting JSP
>            Reporter: Tobias Bocanegra
>            Priority: Minor
>
> <sling:defineObject/> should add a 'properties' as page context variable from resource.adaptTo(ValueMap.class)

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