You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jackrabbit.apache.org by "Julian Reschke (JIRA)" <ji...@apache.org> on 2007/10/31 15:18:50 UTC

[jira] Created: (JCR-1200) allow SPI implementation to compute default values for autocreated properties

allow SPI implementation to compute default values for autocreated properties
-----------------------------------------------------------------------------

                 Key: JCR-1200
                 URL: https://issues.apache.org/jira/browse/JCR-1200
             Project: Jackrabbit
          Issue Type: Improvement
          Components: SPI
            Reporter: Julian Reschke
            Assignee: Julian Reschke
            Priority: Minor


Currently, when creating nodes in transient space, JCR2SPI uses hard-wired logic trying to populate system generated properties such as jcr:created, jcr;uuid and so on.

This is problematic as

- it doesn't scale -- it fails for autocreated properties not known to JCR2SPI, and

- the syntax for the defaults may be dependant on the back end, such as legal syntax for (UU)IDs.

Proposal:

- extend QValueFactory with something like

  QValue computeDefaultValue(QPropertyDefinition)

- use that in JCR2SPI, getting rid of the currently hard-wired logic.


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


[jira] Commented: (JCR-1200) allow SPI implementation to compute default values for autocreated properties

Posted by "angela (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JCR-1200?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12539090 ] 

angela commented on JCR-1200:
-----------------------------

i think i would rather name it create(QPropertyDefinition) or createFromDefinition(QPropertyDefinition).

and i think i would return a QValue[].... since the prop def could be multi valued, couldn't it?

but i'm definitely in favor of this improvement.
angela




> allow SPI implementation to compute default values for autocreated properties
> -----------------------------------------------------------------------------
>
>                 Key: JCR-1200
>                 URL: https://issues.apache.org/jira/browse/JCR-1200
>             Project: Jackrabbit
>          Issue Type: Improvement
>          Components: SPI
>            Reporter: Julian Reschke
>            Assignee: Julian Reschke
>            Priority: Minor
>
> Currently, when creating nodes in transient space, JCR2SPI uses hard-wired logic trying to populate system generated properties such as jcr:created, jcr;uuid and so on.
> This is problematic as
> - it doesn't scale -- it fails for autocreated properties not known to JCR2SPI, and
> - the syntax for the defaults may be dependant on the back end, such as legal syntax for (UU)IDs.
> Proposal:
> - extend QValueFactory with something like
>   QValue computeDefaultValue(QPropertyDefinition)
> - use that in JCR2SPI, getting rid of the currently hard-wired logic.

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


[jira] Updated: (JCR-1200) allow SPI implementation to compute default values for autocreated properties

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

Jukka Zitting updated JCR-1200:
-------------------------------

    Fix Version/s: 1.4

> allow SPI implementation to compute default values for autocreated properties
> -----------------------------------------------------------------------------
>
>                 Key: JCR-1200
>                 URL: https://issues.apache.org/jira/browse/JCR-1200
>             Project: Jackrabbit
>          Issue Type: Improvement
>          Components: SPI
>            Reporter: Julian Reschke
>            Assignee: Julian Reschke
>            Priority: Minor
>             Fix For: 1.4
>
>         Attachments: JCR-1200.patch.txt
>
>
> Currently, when creating nodes in transient space, JCR2SPI uses hard-wired logic trying to populate system generated properties such as jcr:created, jcr;uuid and so on.
> This is problematic as
> - it doesn't scale -- it fails for autocreated properties not known to JCR2SPI, and
> - the syntax for the defaults may be dependant on the back end, such as legal syntax for (UU)IDs.
> Proposal:
> - extend QValueFactory with something like
>   QValue computeDefaultValue(QPropertyDefinition)
> - use that in JCR2SPI, getting rid of the currently hard-wired logic.

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


[jira] Commented: (JCR-1200) allow SPI implementation to compute default values for autocreated properties

Posted by "angela (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JCR-1200?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12539117 ] 

angela commented on JCR-1200:
-----------------------------

fine by me.

> allow SPI implementation to compute default values for autocreated properties
> -----------------------------------------------------------------------------
>
>                 Key: JCR-1200
>                 URL: https://issues.apache.org/jira/browse/JCR-1200
>             Project: Jackrabbit
>          Issue Type: Improvement
>          Components: SPI
>            Reporter: Julian Reschke
>            Assignee: Julian Reschke
>            Priority: Minor
>         Attachments: JCR-1200.patch.txt
>
>
> Currently, when creating nodes in transient space, JCR2SPI uses hard-wired logic trying to populate system generated properties such as jcr:created, jcr;uuid and so on.
> This is problematic as
> - it doesn't scale -- it fails for autocreated properties not known to JCR2SPI, and
> - the syntax for the defaults may be dependant on the back end, such as legal syntax for (UU)IDs.
> Proposal:
> - extend QValueFactory with something like
>   QValue computeDefaultValue(QPropertyDefinition)
> - use that in JCR2SPI, getting rid of the currently hard-wired logic.

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


[jira] Commented: (JCR-1200) allow SPI implementation to compute default values for autocreated properties

Posted by "angela (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JCR-1200?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12539110 ] 

angela commented on JCR-1200:
-----------------------------

> In which case I'd prefer the latter in order to avoid confusion with the other create methods.

ok. the 'from' is may be not totally accurate either. i liked your 'compute' but i wasn't too happy with
the default-value... because the default value is something different and it's already 
present in the property definition, isn't it ? there is no need to compute that one... 

is it meant to be used for both retrieved default-values AND autocreated values?
then it would probably be

 computeValues.

i guess we should also define the behaviour of the method if the QPropertyDefinition
does neither define defaultvalues nor is autocreated... throwing?

> allow SPI implementation to compute default values for autocreated properties
> -----------------------------------------------------------------------------
>
>                 Key: JCR-1200
>                 URL: https://issues.apache.org/jira/browse/JCR-1200
>             Project: Jackrabbit
>          Issue Type: Improvement
>          Components: SPI
>            Reporter: Julian Reschke
>            Assignee: Julian Reschke
>            Priority: Minor
>
> Currently, when creating nodes in transient space, JCR2SPI uses hard-wired logic trying to populate system generated properties such as jcr:created, jcr;uuid and so on.
> This is problematic as
> - it doesn't scale -- it fails for autocreated properties not known to JCR2SPI, and
> - the syntax for the defaults may be dependant on the back end, such as legal syntax for (UU)IDs.
> Proposal:
> - extend QValueFactory with something like
>   QValue computeDefaultValue(QPropertyDefinition)
> - use that in JCR2SPI, getting rid of the currently hard-wired logic.

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


[jira] Commented: (JCR-1200) allow SPI implementation to compute default values for autocreated properties

Posted by "Julian Reschke (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JCR-1200?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12539111 ] 

Julian Reschke commented on JCR-1200:
-------------------------------------

>ok. the 'from' is may be not totally accurate either. i liked your 'compute' but i wasn't too happy with
> the default-value... because the default value is something different and it's already
> present in the property definition, isn't it ? there is no need to compute that one...

Right.

So how about 

  QValue[] computeAuto[Created]Value(...)

(personally preferring the shorter variant)

> is it meant to be used for both retrieved default-values AND autocreated values?
> then it would probably be
> 
>  computeValues.

As we already have an API to get defaults I'd prefer to do this just for autocreated values.

> i guess we should also define the behaviour of the method if the QPropertyDefinition
> does neither define defaultvalues nor is autocreated... throwing?

Yes. The contract would be that the method should only be called for autocreated properties, and the implementation then could throw a RepositoryException otherwise.



> allow SPI implementation to compute default values for autocreated properties
> -----------------------------------------------------------------------------
>
>                 Key: JCR-1200
>                 URL: https://issues.apache.org/jira/browse/JCR-1200
>             Project: Jackrabbit
>          Issue Type: Improvement
>          Components: SPI
>            Reporter: Julian Reschke
>            Assignee: Julian Reschke
>            Priority: Minor
>
> Currently, when creating nodes in transient space, JCR2SPI uses hard-wired logic trying to populate system generated properties such as jcr:created, jcr;uuid and so on.
> This is problematic as
> - it doesn't scale -- it fails for autocreated properties not known to JCR2SPI, and
> - the syntax for the defaults may be dependant on the back end, such as legal syntax for (UU)IDs.
> Proposal:
> - extend QValueFactory with something like
>   QValue computeDefaultValue(QPropertyDefinition)
> - use that in JCR2SPI, getting rid of the currently hard-wired logic.

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


[jira] Updated: (JCR-1200) allow SPI implementation to compute default values for autocreated properties

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

Julian Reschke updated JCR-1200:
--------------------------------

    Attachment: JCR-1200.patch.txt

Proposed patch (SPI/JCR2SPI).


> allow SPI implementation to compute default values for autocreated properties
> -----------------------------------------------------------------------------
>
>                 Key: JCR-1200
>                 URL: https://issues.apache.org/jira/browse/JCR-1200
>             Project: Jackrabbit
>          Issue Type: Improvement
>          Components: SPI
>            Reporter: Julian Reschke
>            Assignee: Julian Reschke
>            Priority: Minor
>         Attachments: JCR-1200.patch.txt
>
>
> Currently, when creating nodes in transient space, JCR2SPI uses hard-wired logic trying to populate system generated properties such as jcr:created, jcr;uuid and so on.
> This is problematic as
> - it doesn't scale -- it fails for autocreated properties not known to JCR2SPI, and
> - the syntax for the defaults may be dependant on the back end, such as legal syntax for (UU)IDs.
> Proposal:
> - extend QValueFactory with something like
>   QValue computeDefaultValue(QPropertyDefinition)
> - use that in JCR2SPI, getting rid of the currently hard-wired logic.

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


[jira] Commented: (JCR-1200) allow SPI implementation to compute default values for autocreated properties

Posted by "Julian Reschke (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JCR-1200?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12539100 ] 

Julian Reschke commented on JCR-1200:
-------------------------------------

> i think i would rather name it create(QPropertyDefinition) or createFromDefinition(QPropertyDefinition).

In which case I'd prefer the latter in order to avoid confusion with the other create methods.

> and i think i would return a QValue[].... since the prop def could be multi valued, couldn't it? 

Correct.



> allow SPI implementation to compute default values for autocreated properties
> -----------------------------------------------------------------------------
>
>                 Key: JCR-1200
>                 URL: https://issues.apache.org/jira/browse/JCR-1200
>             Project: Jackrabbit
>          Issue Type: Improvement
>          Components: SPI
>            Reporter: Julian Reschke
>            Assignee: Julian Reschke
>            Priority: Minor
>
> Currently, when creating nodes in transient space, JCR2SPI uses hard-wired logic trying to populate system generated properties such as jcr:created, jcr;uuid and so on.
> This is problematic as
> - it doesn't scale -- it fails for autocreated properties not known to JCR2SPI, and
> - the syntax for the defaults may be dependant on the back end, such as legal syntax for (UU)IDs.
> Proposal:
> - extend QValueFactory with something like
>   QValue computeDefaultValue(QPropertyDefinition)
> - use that in JCR2SPI, getting rid of the currently hard-wired logic.

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


[jira] Resolved: (JCR-1200) allow SPI implementation to compute default values for autocreated properties

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

Julian Reschke resolved JCR-1200.
---------------------------------

    Resolution: Fixed

Implemented with revision 590762.


> allow SPI implementation to compute default values for autocreated properties
> -----------------------------------------------------------------------------
>
>                 Key: JCR-1200
>                 URL: https://issues.apache.org/jira/browse/JCR-1200
>             Project: Jackrabbit
>          Issue Type: Improvement
>          Components: SPI
>            Reporter: Julian Reschke
>            Assignee: Julian Reschke
>            Priority: Minor
>         Attachments: JCR-1200.patch.txt
>
>
> Currently, when creating nodes in transient space, JCR2SPI uses hard-wired logic trying to populate system generated properties such as jcr:created, jcr;uuid and so on.
> This is problematic as
> - it doesn't scale -- it fails for autocreated properties not known to JCR2SPI, and
> - the syntax for the defaults may be dependant on the back end, such as legal syntax for (UU)IDs.
> Proposal:
> - extend QValueFactory with something like
>   QValue computeDefaultValue(QPropertyDefinition)
> - use that in JCR2SPI, getting rid of the currently hard-wired logic.

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