[jira] [Comment Edited] (SYNCOPE-956) Allow for scripted customizations

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[jira] [Comment Edited] (SYNCOPE-956) Allow for scripted customizations

JIRA jira@apache.org

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

Francesco Chicchiriccò edited comment on SYNCOPE-956 at 10/3/17 10:26 AM:
--------------------------------------------------------------------------

This could also include Javascript-based customizations; the idea could be to:
 # define a new {{Implementation}} entity with {{key}}, {{type}} and {{body}} 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]
  ## {{body}} 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#L172-L183

to

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


was (Author: ilgrosso):
This could also include Javascript-based customizations; the idea could be to:
 # define a new {{Implementation}} entity with {{key}}, {{type}} and {{body}} 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]
  ## {{body}} 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 for scripted customizations
> ---------------------------------
>
>                 Key: SYNCOPE-956
>                 URL: https://issues.apache.org/jira/browse/SYNCOPE-956
>             Project: Syncope
>          Issue Type: New Feature
>            Reporter: Francesco Chicchiriccò
>            Assignee: Francesco Chicchiriccò
>              Labels: groovy
>             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 Groovy, we could overcome such limitation and allow to write customizations 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.4.14#64029)