You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sling.apache.org by "Alexander Klimetschek (JIRA)" <ji...@apache.org> on 2008/06/13 17:22:45 UTC

[jira] Created: (SLING-533) Support mulit-value type hints (eg. @TypeHint=String[])

Support mulit-value type hints (eg. @TypeHint=String[])
-------------------------------------------------------

                 Key: SLING-533
                 URL: https://issues.apache.org/jira/browse/SLING-533
             Project: Sling
          Issue Type: New Feature
          Components: Servlets Post
            Reporter: Alexander Klimetschek


As discussed in SLING-522, when posting a single value to a property that should be multi-valued, an extension to the @TypeHint is needed that allows the explicit definition of a multi-value type. For example, for Strings this would be @TypeHint=String[].

Based on a quick look at the code, it should happen in o.a.s.servlets.post.impl.helper.SlingPropertyValueHandler.setPropertyAsIs(). First of all the parsing of the getTypeHint() must be changed to look for an ending [] first, and then this "isMultiValued" information must be used to call the multi-value version of setProperty() in all cases (values.length >= 0).

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


[jira] Commented: (SLING-533) Support multi-value type hints (eg. @TypeHint=String[])

Posted by "Alexander Klimetschek (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SLING-533?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12605249#action_12605249 ] 

Alexander Klimetschek commented on SLING-533:
---------------------------------------------

Yup, see SLING-538.

> Support multi-value type hints (eg. @TypeHint=String[])
> -------------------------------------------------------
>
>                 Key: SLING-533
>                 URL: https://issues.apache.org/jira/browse/SLING-533
>             Project: Sling
>          Issue Type: New Feature
>          Components: Servlets Post
>            Reporter: Alexander Klimetschek
>            Assignee: Carsten Ziegeler
>             Fix For: 2.0.1
>
>
> As discussed in SLING-522, when posting a single value to a property that should be multi-valued, an extension to the @TypeHint is needed that allows the explicit definition of a multi-value type. For example, for Strings this would be @TypeHint=String[].
> Based on a quick look at the code, it should happen in o.a.s.servlets.post.impl.helper.SlingPropertyValueHandler.setPropertyAsIs(). First of all the parsing of the getTypeHint() must be changed to look for an ending [] first, and then this "isMultiValued" information must be used to call the multi-value version of setProperty() in all cases (values.length >= 0).

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


[jira] Resolved: (SLING-533) Support multi-value type hints (eg. @TypeHint=String[])

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

Carsten Ziegeler resolved SLING-533.
------------------------------------

       Resolution: Fixed
    Fix Version/s: 2.0.1

I appled a patch which should implement the multi value type hint handling.
Could you please cross check and then close this bug?
Thanks!

> Support multi-value type hints (eg. @TypeHint=String[])
> -------------------------------------------------------
>
>                 Key: SLING-533
>                 URL: https://issues.apache.org/jira/browse/SLING-533
>             Project: Sling
>          Issue Type: New Feature
>          Components: Servlets Post
>            Reporter: Alexander Klimetschek
>            Assignee: Carsten Ziegeler
>             Fix For: 2.0.1
>
>
> As discussed in SLING-522, when posting a single value to a property that should be multi-valued, an extension to the @TypeHint is needed that allows the explicit definition of a multi-value type. For example, for Strings this would be @TypeHint=String[].
> Based on a quick look at the code, it should happen in o.a.s.servlets.post.impl.helper.SlingPropertyValueHandler.setPropertyAsIs(). First of all the parsing of the getTypeHint() must be changed to look for an ending [] first, and then this "isMultiValued" information must be used to call the multi-value version of setProperty() in all cases (values.length >= 0).

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


[jira] Updated: (SLING-533) Support multi-value type hints (eg. @TypeHint=String[])

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

Alexander Klimetschek updated SLING-533:
----------------------------------------

    Attachment: multival-post-test.html

Here is a simple HTML test file that runs against the node http://localhost:8080/wcms/tmp/test/multival (sling running as webapp under /wcms, node path /tmp/test/multival) and writes the mvprop property for testing.

> Support multi-value type hints (eg. @TypeHint=String[])
> -------------------------------------------------------
>
>                 Key: SLING-533
>                 URL: https://issues.apache.org/jira/browse/SLING-533
>             Project: Sling
>          Issue Type: New Feature
>          Components: Servlets Post
>            Reporter: Alexander Klimetschek
>            Assignee: Carsten Ziegeler
>             Fix For: 2.0.1
>
>         Attachments: multival-post-test.html
>
>
> As discussed in SLING-522, when posting a single value to a property that should be multi-valued, an extension to the @TypeHint is needed that allows the explicit definition of a multi-value type. For example, for Strings this would be @TypeHint=String[].
> Based on a quick look at the code, it should happen in o.a.s.servlets.post.impl.helper.SlingPropertyValueHandler.setPropertyAsIs(). First of all the parsing of the getTypeHint() must be changed to look for an ending [] first, and then this "isMultiValued" information must be used to call the multi-value version of setProperty() in all cases (values.length >= 0).

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


[jira] Commented: (SLING-533) Support multi-value type hints (eg. @TypeHint=String[])

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

Carsten Ziegeler commented on SLING-533:
----------------------------------------

I applied your docs - many thanks!

> Support multi-value type hints (eg. @TypeHint=String[])
> -------------------------------------------------------
>
>                 Key: SLING-533
>                 URL: https://issues.apache.org/jira/browse/SLING-533
>             Project: Sling
>          Issue Type: New Feature
>          Components: Servlets Post
>            Reporter: Alexander Klimetschek
>            Assignee: Carsten Ziegeler
>             Fix For: 2.0.1
>
>         Attachments: multival-post-test.html
>
>
> As discussed in SLING-522, when posting a single value to a property that should be multi-valued, an extension to the @TypeHint is needed that allows the explicit definition of a multi-value type. For example, for Strings this would be @TypeHint=String[].
> Based on a quick look at the code, it should happen in o.a.s.servlets.post.impl.helper.SlingPropertyValueHandler.setPropertyAsIs(). First of all the parsing of the getTypeHint() must be changed to look for an ending [] first, and then this "isMultiValued" information must be used to call the multi-value version of setProperty() in all cases (values.length >= 0).

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


[jira] Closed: (SLING-533) Support multi-value type hints (eg. @TypeHint=String[])

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

Alexander Klimetschek closed SLING-533.
---------------------------------------


Verified that it works. I tested that it with other datatypes as well (Long, Double).

Thanks for the quick fix Carsten!

> Support multi-value type hints (eg. @TypeHint=String[])
> -------------------------------------------------------
>
>                 Key: SLING-533
>                 URL: https://issues.apache.org/jira/browse/SLING-533
>             Project: Sling
>          Issue Type: New Feature
>          Components: Servlets Post
>            Reporter: Alexander Klimetschek
>            Assignee: Carsten Ziegeler
>             Fix For: 2.0.1
>
>         Attachments: multival-post-test.html
>
>
> As discussed in SLING-522, when posting a single value to a property that should be multi-valued, an extension to the @TypeHint is needed that allows the explicit definition of a multi-value type. For example, for Strings this would be @TypeHint=String[].
> Based on a quick look at the code, it should happen in o.a.s.servlets.post.impl.helper.SlingPropertyValueHandler.setPropertyAsIs(). First of all the parsing of the getTypeHint() must be changed to look for an ending [] first, and then this "isMultiValued" information must be used to call the multi-value version of setProperty() in all cases (values.length >= 0).

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


[jira] Updated: (SLING-533) Support multi-value type hints (eg. @TypeHint=String[])

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

Alexander Klimetschek updated SLING-533:
----------------------------------------

    Summary: Support multi-value type hints (eg. @TypeHint=String[])  (was: Support mulit-value type hints (eg. @TypeHint=String[]))

> Support multi-value type hints (eg. @TypeHint=String[])
> -------------------------------------------------------
>
>                 Key: SLING-533
>                 URL: https://issues.apache.org/jira/browse/SLING-533
>             Project: Sling
>          Issue Type: New Feature
>          Components: Servlets Post
>            Reporter: Alexander Klimetschek
>
> As discussed in SLING-522, when posting a single value to a property that should be multi-valued, an extension to the @TypeHint is needed that allows the explicit definition of a multi-value type. For example, for Strings this would be @TypeHint=String[].
> Based on a quick look at the code, it should happen in o.a.s.servlets.post.impl.helper.SlingPropertyValueHandler.setPropertyAsIs(). First of all the parsing of the getTypeHint() must be changed to look for an ending [] first, and then this "isMultiValued" information must be used to call the multi-value version of setProperty() in all cases (values.length >= 0).

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


[jira] Commented: (SLING-533) Support multi-value type hints (eg. @TypeHint=String[])

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

Carsten Ziegeler commented on SLING-533:
----------------------------------------

Ok, could you please open a new issue and attach a patch for this?

> Support multi-value type hints (eg. @TypeHint=String[])
> -------------------------------------------------------
>
>                 Key: SLING-533
>                 URL: https://issues.apache.org/jira/browse/SLING-533
>             Project: Sling
>          Issue Type: New Feature
>          Components: Servlets Post
>            Reporter: Alexander Klimetschek
>            Assignee: Carsten Ziegeler
>             Fix For: 2.0.1
>
>
> As discussed in SLING-522, when posting a single value to a property that should be multi-valued, an extension to the @TypeHint is needed that allows the explicit definition of a multi-value type. For example, for Strings this would be @TypeHint=String[].
> Based on a quick look at the code, it should happen in o.a.s.servlets.post.impl.helper.SlingPropertyValueHandler.setPropertyAsIs(). First of all the parsing of the getTypeHint() must be changed to look for an ending [] first, and then this "isMultiValued" information must be used to call the multi-value version of setProperty() in all cases (values.length >= 0).

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


[jira] Issue Comment Edited: (SLING-533) Support multi-value type hints (eg. @TypeHint=String[])

Posted by "Alexander Klimetschek (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SLING-533?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12605283#action_12605283 ] 

alexander.klimetschek edited comment on SLING-533 at 6/16/08 6:25 AM:
----------------------------------------------------------------------

Verified that it works. I tested it with other datatypes as well (Long, Double), runs smoothly.

Thanks for the quick fix Carsten!

      was (Author: alexander.klimetschek):
    Verified that it works. I tested that it with other datatypes as well (Long, Double).

Thanks for the quick fix Carsten!
  
> Support multi-value type hints (eg. @TypeHint=String[])
> -------------------------------------------------------
>
>                 Key: SLING-533
>                 URL: https://issues.apache.org/jira/browse/SLING-533
>             Project: Sling
>          Issue Type: New Feature
>          Components: Servlets Post
>            Reporter: Alexander Klimetschek
>            Assignee: Carsten Ziegeler
>             Fix For: 2.0.1
>
>         Attachments: multival-post-test.html
>
>
> As discussed in SLING-522, when posting a single value to a property that should be multi-valued, an extension to the @TypeHint is needed that allows the explicit definition of a multi-value type. For example, for Strings this would be @TypeHint=String[].
> Based on a quick look at the code, it should happen in o.a.s.servlets.post.impl.helper.SlingPropertyValueHandler.setPropertyAsIs(). First of all the parsing of the getTypeHint() must be changed to look for an ending [] first, and then this "isMultiValued" information must be used to call the multi-value version of setProperty() in all cases (values.length >= 0).

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


[jira] Assigned: (SLING-533) Support multi-value type hints (eg. @TypeHint=String[])

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

Carsten Ziegeler reassigned SLING-533:
--------------------------------------

    Assignee: Carsten Ziegeler

> Support multi-value type hints (eg. @TypeHint=String[])
> -------------------------------------------------------
>
>                 Key: SLING-533
>                 URL: https://issues.apache.org/jira/browse/SLING-533
>             Project: Sling
>          Issue Type: New Feature
>          Components: Servlets Post
>            Reporter: Alexander Klimetschek
>            Assignee: Carsten Ziegeler
>
> As discussed in SLING-522, when posting a single value to a property that should be multi-valued, an extension to the @TypeHint is needed that allows the explicit definition of a multi-value type. For example, for Strings this would be @TypeHint=String[].
> Based on a quick look at the code, it should happen in o.a.s.servlets.post.impl.helper.SlingPropertyValueHandler.setPropertyAsIs(). First of all the parsing of the getTypeHint() must be changed to look for an ending [] first, and then this "isMultiValued" information must be used to call the multi-value version of setProperty() in all cases (values.length >= 0).

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


[jira] Commented: (SLING-533) Support multi-value type hints (eg. @TypeHint=String[])

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

Carsten Ziegeler commented on SLING-533:
----------------------------------------

I've just added a new integration test for this feature.

> Support multi-value type hints (eg. @TypeHint=String[])
> -------------------------------------------------------
>
>                 Key: SLING-533
>                 URL: https://issues.apache.org/jira/browse/SLING-533
>             Project: Sling
>          Issue Type: New Feature
>          Components: Servlets Post
>            Reporter: Alexander Klimetschek
>            Assignee: Carsten Ziegeler
>             Fix For: 2.0.1
>
>
> As discussed in SLING-522, when posting a single value to a property that should be multi-valued, an extension to the @TypeHint is needed that allows the explicit definition of a multi-value type. For example, for Strings this would be @TypeHint=String[].
> Based on a quick look at the code, it should happen in o.a.s.servlets.post.impl.helper.SlingPropertyValueHandler.setPropertyAsIs(). First of all the parsing of the getTypeHint() must be changed to look for an ending [] first, and then this "isMultiValued" information must be used to call the multi-value version of setProperty() in all cases (values.length >= 0).

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


[jira] Commented: (SLING-533) Support multi-value type hints (eg. @TypeHint=String[])

Posted by "Alexander Klimetschek (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SLING-533?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12605241#action_12605241 ] 

Alexander Klimetschek commented on SLING-533:
---------------------------------------------

There is one thing in the code that can be improved (in SlingPropertyValueHelper): the list of values of the request property can never have the length of null - RequestProperty.getStringValues() ensures this, and it also does not make any sense with form posts, since a request parameter must always have at least one value, otherwise it would simply not exist in the request. So this code is superfluous (also for single-value property handling):

        } else if (values.length == 0) {
            // do not create new prop here, but clear existing
            if (parent.hasProperty(prop.getName())) {
                response.onModified(
                    parent.setProperty(prop.getName(), "").getPath()
                );
            }


> Support multi-value type hints (eg. @TypeHint=String[])
> -------------------------------------------------------
>
>                 Key: SLING-533
>                 URL: https://issues.apache.org/jira/browse/SLING-533
>             Project: Sling
>          Issue Type: New Feature
>          Components: Servlets Post
>            Reporter: Alexander Klimetschek
>            Assignee: Carsten Ziegeler
>             Fix For: 2.0.1
>
>
> As discussed in SLING-522, when posting a single value to a property that should be multi-valued, an extension to the @TypeHint is needed that allows the explicit definition of a multi-value type. For example, for Strings this would be @TypeHint=String[].
> Based on a quick look at the code, it should happen in o.a.s.servlets.post.impl.helper.SlingPropertyValueHandler.setPropertyAsIs(). First of all the parsing of the getTypeHint() must be changed to look for an ending [] first, and then this "isMultiValued" information must be used to call the multi-value version of setProperty() in all cases (values.length >= 0).

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


[jira] Commented: (SLING-533) Support multi-value type hints (eg. @TypeHint=String[])

Posted by "Alexander Klimetschek (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SLING-533?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12605237#action_12605237 ] 

Alexander Klimetschek commented on SLING-533:
---------------------------------------------

I tested it with a simple HTML file with different forms testing different cases (one value, multiple values, typehint set/not set) and it works so far (only Strings tested ATM).

Now I am wondering how to automate this: the tests in the servlets/post module are purely based on a mocked (Sling) servlet request class. Using an actual HTML form is a better documentation IMHO - but it is also more of a larger integration test than a unit test.

> Support multi-value type hints (eg. @TypeHint=String[])
> -------------------------------------------------------
>
>                 Key: SLING-533
>                 URL: https://issues.apache.org/jira/browse/SLING-533
>             Project: Sling
>          Issue Type: New Feature
>          Components: Servlets Post
>            Reporter: Alexander Klimetschek
>            Assignee: Carsten Ziegeler
>             Fix For: 2.0.1
>
>
> As discussed in SLING-522, when posting a single value to a property that should be multi-valued, an extension to the @TypeHint is needed that allows the explicit definition of a multi-value type. For example, for Strings this would be @TypeHint=String[].
> Based on a quick look at the code, it should happen in o.a.s.servlets.post.impl.helper.SlingPropertyValueHandler.setPropertyAsIs(). First of all the parsing of the getTypeHint() must be changed to look for an ending [] first, and then this "isMultiValued" information must be used to call the multi-value version of setProperty() in all cases (values.length >= 0).

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


[jira] Commented: (SLING-533) Support multi-value type hints (eg. @TypeHint=String[])

Posted by "Alexander Klimetschek (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SLING-533?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12605625#action_12605625 ] 

Alexander Klimetschek commented on SLING-533:
---------------------------------------------

Would be cool if the documentation on Sling's website could be updated to reflect the new TypeHint multivalue capabilities:

http://incubator.apache.org/sling/site/manipulating-content-the-slingpostservlet.html#ManipulatingContent-TheSlingPostServlet-{{@TypeHint}}

respectively on the site source wiki

http://cwiki.apache.org/confluence/display/SLINGxSITE/Manipulating+Content+-+The+SlingPostServlet

Here is my replacement for the @TypeHint section.

[doc] -----

Parameters with the @TypeHint suffix may be used to force storing the named parameter in a property with the given type. The value of the @TypeHint parameter if applied to a parameter for a property is the JCR property type name. If the @TypeHint parameter is applied to a field upload parameter, the value is used to indicate the JCR primary node type for the node into which the uploaded file is stored.

If the TypeHint ends with "[]", it indicates a multi-value property. A multi-value property is normally auto-detected if there are multiple values for the property (ie. request parameter). But if only a single value is present in the request, the desired property type needs to be explicitly defined by stating @TypeHint=<type>[].

Example: The following form sets the numeric width, the boolean checked and the multi-valued hobbys (with 3 values to enter) properties:

<form method="POST" action="/content/page/first">
    <input type="text" name="width" />
    <input type="hidden" name="width@TypeHint" value="Long" />
    <input type="checkbox" name="checked" />
    <input type="hidden" name="checked@TypeHint" value="Boolean" />
    <input type="text" name="hobbys" />
    <input type="text" name="hobbys" />
    <input type="text" name="hobbys" />
    <input type="hidden" name="hobbys@TypeHint" value="String[]" />
    <input type="Submit" />
</form>

In real applications you would need some javascript that allows to add/remove values, ie. add/remove inputs with the name "hobbys". Or a pure javascript based form post would be used, that gathers the properties to update programmatically, but the additional parameter hobbys@TypeHint=String[] would be the same.

[/doc] -----


> Support multi-value type hints (eg. @TypeHint=String[])
> -------------------------------------------------------
>
>                 Key: SLING-533
>                 URL: https://issues.apache.org/jira/browse/SLING-533
>             Project: Sling
>          Issue Type: New Feature
>          Components: Servlets Post
>            Reporter: Alexander Klimetschek
>            Assignee: Carsten Ziegeler
>             Fix For: 2.0.1
>
>         Attachments: multival-post-test.html
>
>
> As discussed in SLING-522, when posting a single value to a property that should be multi-valued, an extension to the @TypeHint is needed that allows the explicit definition of a multi-value type. For example, for Strings this would be @TypeHint=String[].
> Based on a quick look at the code, it should happen in o.a.s.servlets.post.impl.helper.SlingPropertyValueHandler.setPropertyAsIs(). First of all the parsing of the getTypeHint() must be changed to look for an ending [] first, and then this "isMultiValued" information must be used to call the multi-value version of setProperty() in all cases (values.length >= 0).

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


[jira] Commented: (SLING-533) Support multi-value type hints (eg. @TypeHint=String[])

Posted by "Bertrand Delacretaz (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SLING-533?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12605216#action_12605216 ] 

Bertrand Delacretaz commented on SLING-533:
-------------------------------------------

I don't think this new behavior is tested, Alex could you maybe write some tests when you verify this feature?

If you don't, please leave this issue open so that we don't forget to write tests when we find some time.

> Support multi-value type hints (eg. @TypeHint=String[])
> -------------------------------------------------------
>
>                 Key: SLING-533
>                 URL: https://issues.apache.org/jira/browse/SLING-533
>             Project: Sling
>          Issue Type: New Feature
>          Components: Servlets Post
>            Reporter: Alexander Klimetschek
>            Assignee: Carsten Ziegeler
>             Fix For: 2.0.1
>
>
> As discussed in SLING-522, when posting a single value to a property that should be multi-valued, an extension to the @TypeHint is needed that allows the explicit definition of a multi-value type. For example, for Strings this would be @TypeHint=String[].
> Based on a quick look at the code, it should happen in o.a.s.servlets.post.impl.helper.SlingPropertyValueHandler.setPropertyAsIs(). First of all the parsing of the getTypeHint() must be changed to look for an ending [] first, and then this "isMultiValued" information must be used to call the multi-value version of setProperty() in all cases (values.length >= 0).

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