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

Francesco Chicchiriccò commented on SYNCOPE-956:
------------------------------------------------

The idea is to:
 # define a new {{ExtensionScript}} entity with {{key}}, {{type}} and 
{{content}} properties where:
  ## {{key}} is the script's mnemonic name
  ## {{type}} is one of 
[ImplementationLookup#Type|https://github.com/apache/syncope/blob/master/core/persistence-api/src/main/java/org/apache/syncope/core/persistence/api/ImplementationLookup.java#L31-L47]
  ## {{content}} is the actual JS script
# adjust other entities so that a script name can be optionally provided for 
customization
# define customization Java classes which will act as script wrappers so that, 
when a script is required for a given customization, such parametric Java 
classes will be used instead, delegating the actual logic to the selected script

An example implementation of wrapper Java class is provided for {{PullActions}} 
at

https://gist.github.com/ilgrosso/8e442026bc8cf40ad8d307bbef85c140

This would require to update the {{PullJobDelegate#doExecuteProvisioning}} 
method from

https://github.com/apache/syncope/blob/master/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/pushpull/PullJobDelegate.java#L125-L136

to

https://gist.github.com/ilgrosso/ac3e79b84f8b77ab2f08fff94c29b19f

> Allow Javascript-based customizations
> -------------------------------------
>
>                 Key: SYNCOPE-956
>                 URL: https://issues.apache.org/jira/browse/SYNCOPE-956
>             Project: Syncope
>          Issue Type: New Feature
>            Reporter: Francesco Chicchiriccò
>              Labels: javascript
>             Fix For: 2.1.0
>
>
> The core can be customized in [several 
> ways|http://syncope.apache.org/docs/reference-guide.html#customization-core]; 
> all customizations require to be written as Java classes - which is generally 
> good but requires redeploy to be made effective, unless some class reloading 
> mechanism is in place (as JRebel).
> By leveraging Java 8's 
> [Nashorn|http://www.oracle.com/technetwork/articles/java/jf14-nashorn-2126515.html]
>  - which also provides interesting execution performance, we could overcome 
> such limitation and allow to write customizations in Javascript, which can be 
> immediately available for execution at runtime.
> Once implemented in the core, such feature will require editing capabilities 
> to be added to console and IDE plugins.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to