[ 
https://issues.apache.org/jira/browse/SLING-354?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12585915#action_12585915
 ] 

Bertrand Delacretaz commented on SLING-354:
-------------------------------------------

I think the nameHint would be enough, and it can be filtered in the same way as 
property names are filtered now - for example, currently, the value of a 
property named "title", if present, is filtered to be used as the name of the 
created node.

I suggest:
a) If provided, the sling:post:nameHint value is used instead of the property 
values currently used to set the node name of the create node

b) If used, nameHint is filtered using the same mechanism as for those property 
values

c) This mechanism can include adding a trailing _N where N is an integer that 
is set to avoid name collisions.

Calling the parameter nameHint instead of nodeName makes it clear that it might 
not be used exactly as provided, due to that filtering.

See GeneratedNodeNameTest under launchpad/webapp for more info about how this 
currently works. Tests can be added there for the three "rules" above.

> Better way to define the node name for a newly created node
> -----------------------------------------------------------
>
>                 Key: SLING-354
>                 URL: https://issues.apache.org/jira/browse/SLING-354
>             Project: Sling
>          Issue Type: Improvement
>          Components: ujax
>            Reporter: Carsten Ziegeler
>            Assignee: Carsten Ziegeler
>             Fix For: 2.0.0
>
>   Original Estimate: 0h
>  Remaining Estimate: 0h
>
> The current node name generator checks for a fixed set of request parameters 
> name. While this approach is fine, it creates a problem as even if one of 
> those properties is used to define the name, it is later on still tried to be 
> set as a parameter.
> I propose to add a sling:post:nodeName property to define the name.

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

Reply via email to