[ 
https://issues.apache.org/jira/browse/CAY-2345?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16121332#comment-16121332
 ] 

ASF GitHub Bot commented on CAY-2345:
-------------------------------------

GitHub user stariy95 opened a pull request:

    https://github.com/apache/cayenne/pull/238

    CAY-2345 Own template renderer as a replacement for Velocity

    This is implementation of template renderer intended as a drop in 
replacement for `Velocity` in `Cayenne`. This PR also includes removal of 
`commons-lang` references (that was a transitive dependency of `velocity`) from 
all modules except `cayenne-wocompat`.
    
    **Features**:
    - compatibility with Velocity syntax and behavior
    - variables and method resolution: `$a` and `$a.someMethod($b, 'abc', 5, 
['a', 'b', 'c'])`
    - conditional render:`#if($var) ... #else ... #end` 
    - directive support: `#bind`,  `#bindEqual`, `#bindNotEqual`, 
`#bindObjectEqual`, `#bindObjectNotEqual` and `#result`
    - plus it's **2x - 15x** (cache miss / cache hit case) faster than Velocity 
implementation 
    
    Only unimplemented Cayenne feature is  `#chain` directive:
    ```
    #chain('OR' 'WHERE') 
        #chunk($name) NAME LIKE #bind($name) #end
        #chunk($id) ARTIST_ID > #bind($id) #end
    #end
    ```
    It doesn't support all features of `Velocity` but it's enough to seamlessly 
replace Velocity in all core and test code in Cayenne.
    
    Velocity now comes as optional auto-loaded module `cayenne-velocity`.

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/stariy95/cayenne own-template-parser

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/cayenne/pull/238.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #238
    
----
commit 76cb6159df423a2c2ba09e91954b83ea73775a91
Author: Nikita Timofeev <stari...@gmail.com>
Date:   2017-07-19T10:46:43Z

    Temp content for cayenne's own parser branch

commit ddb755310226ddeea6deca617bc7b34da954995c
Author: Nikita Timofeev <stari...@gmail.com>
Date:   2017-08-07T14:49:03Z

    Own template render implementation: first draft

commit 2db55797a1f184d9b24a1ed2e249a4b4729cf379
Author: Nikita Timofeev <stari...@gmail.com>
Date:   2017-08-08T15:51:47Z

    Own template render implementation: first draft

commit aa8d35cc3679d02604637ea651670d066d95a52b
Author: Nikita Timofeev <stari...@gmail.com>
Date:   2017-08-08T16:08:25Z

    Own template render implementation: cleanup

commit c654f2d70a6de9ac3f256cc4485ae6b9257e65f4
Author: Nikita Timofeev <stari...@gmail.com>
Date:   2017-08-09T13:41:21Z

    CAY-2345 Own template renderer as a replacement for Velocity
      - final version of render with cache and parser pool

commit 3a1340204dea2b923b61410c3564af2a404450d4
Author: Nikita Timofeev <stari...@gmail.com>
Date:   2017-08-09T13:42:09Z

    CAY-2345 Own template renderer as a replacement for Velocity
      - move Velocity to separate module
      - remove dependencies on commons-lang

commit 2f92dd9c27d42683adb0f81b49d6183d6d15819c
Author: Nikita Timofeev <stari...@gmail.com>
Date:   2017-08-09T15:29:40Z

    CAY-2345 Own template renderer as a replacement for Velocity
      - additional test and fixes

commit 48b57d3a5305ad960e100cff0520c0393afa3750
Author: Nikita Timofeev <stari...@gmail.com>
Date:   2017-08-09T15:58:20Z

    CAY-2345 Own template renderer as a replacement for Velocity
      - fix

----


> Own template renderer as a replacement for Velocity
> ---------------------------------------------------
>
>                 Key: CAY-2345
>                 URL: https://issues.apache.org/jira/browse/CAY-2345
>             Project: Cayenne
>          Issue Type: Task
>          Components: Core Library
>    Affects Versions: 4.1.M1
>            Reporter: Nikita Timofeev
>            Assignee: Nikita Timofeev
>             Fix For: 4.1.M1
>
>
> Cayenne server uses _Velocity_ as template render (primary for 
> {{SQLTemplate}}) that is a little bit overkill, we can create own lightweight 
> implementation that can be in general compatible with _Velocity_ while having 
> better performance.
> Velocity can be moved to separate module in case someone wants all it's 
> features in {{SQLTemplate}}.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to