SlideShare a Scribd company logo
Darwino Script and Command Line
Add customization capabilities to your Darwino applications
Darwino Script Introduction
• Darwino Script is a scripting language, very similar to JavaScript
– Follows ECMA-Script 262-3 for a lot of behaviors
– Designed as a “formula language” rather than a language for writing programs
– Extended for ease of use: new operators like ?. or ?[, @functions…
– Uses the Java primitives as core language primitives, include BigDecimal
– Objects are Java objects and don’t have prototypes
• Although a custom library can easily provide this feature
• Ex: JsonArray & JsonObject
– Tailored to script Java classes/objects
• Can directly call any Java classes/objects, if security permits
• Can easily be extended through java extension points
Darwino Script Introduction
• Low resource consumption, even on mobile devices
– Fast compiler with caching capability
• Dynamic execution: interprets an AST tree in memory
– No class file is generated, so it does not require a JVM (AOT compiler works)
• Can be transpiled to other languages (Java, JavaScript, AngularJS
expressions…)
Darwino Script Usage
• Script language for citizen developers
– Can be interpreted dynamically or transpiled (see: UI generation)
• End user customization
– Workflow engine conditions, …
– Other customizations done by a user
• Database events, …
Darwino Script Main Objects
• DSEnvironment
– Maintains the global scripting options, libraries and variables
– Shared across script executions
• DSContext
– The execution context for a script execution
– Contains the local variables, and execution options
• DSScript
– An in-memory compiled script, ready to be executed
• DSLibrary
– Define a set of functions, classes or value members (including constants)
Executing a Piece of Script
// Create the execution environment
// This environment holds the libraries to use
// - standard (print, println..)
// - JavaJre (access to Java Object using reflection)
DSEnvironment env = new DSEnvironment();
env.registerLibrary(new StandardLibrary());
env.registerLibrary(new JavaJreLibrary(env));
// The context can also take extra parameters:
// this
// library to use for this context
// Note that the context contains the global variables being created by the script
// and can also be reused, with these values, while executing another script
DSProgramRuntimeContext ctx = new DSProgramRuntimeContext(env);
// Compile the script or get it from the cache
DSScript expr = ctx.getEnvironment().createScript("1+4");
// Execute and get the result
Object result = expr.execute(ctx);
assertEquals(5, result);
Creating a Reusable Library
• A library can export
– Member access (global values, object members…)
– Function calls (global function, object method…)
– Object/Array constructors
public interface DSLibrary {
public Object getMember(DSRuntimeContext context, Object instance, String member) throws DSRuntimeException;
public Object getMember(DSRuntimeContext context, Object instance, int index) throws DSRuntimeException;
public boolean putMember(DSRuntimeContext context, Object instance, String member, Object value) throws DSRuntimeException;
public boolean putMember(DSRuntimeContext context, Object instance, int index, Object value) throws DSRuntimeException;
public Object call(DSRuntimeContext context, Object instance, Object[] parameters) throws DSRuntimeException;
public Object constructObject(DSRuntimeContext context, String type, Object[] parameters) throws DSRuntimeException;
public Object constructArray(DSRuntimeContext context, String type, int dimensions, int size) throws DSRuntimeException;
}
Existing Libraries
• Java bridge
• @function
– Similar to Notes/Domino @functions
– Targets citizen developers
• Java Objects cab implement
– DSObject, DSArray, DSCallable for easy library creationb
A Word About Security
• If the script is going to be exposed to end users
– You should control what library is exposed
• Use reflection to access Java object?
– You should fine control what object can be exposed/called from the script
• Can also depend on the user profile
• All the features are exposed through libraries, so it is easy to control
– But Darwino will make it even easier with a new security interface
Darwino Command Framework
• The Darwino command framework allows the execution of text based
commands
• The lists of commands is contributed via extensions
• Generally used to exposed administration/debugging capabilities
Some Available Commands
• Built-in commands libraries are provided by the runtime
– Default: echo, set, call, profiler, classpath…
– JSON Store: manage databases, access data…
– Runtime: access to user
• And more to come over time
– Access to log files
– Java logging API settings
Darwino Command CLI
• Commands can be executed from a simple console shell
– Provided as a Java class in the dwo-apps-jstore-cli project
• Configuration file is executed when the console is launched
~/.darwino/console-init.dsh
• Example:
# Initialize with TOMCAT environment
classpath c:phildevapache-tomcat-8.0.20libsqljdbc42.jar
classpath c:phildevapache-tomcat-8.0.20libpostgresql-9.4-1203-jdbc4.jar
load-config c:phildevapache-tomcat-8.0.20
Darwino Debug Web UI
• A simple WebUI can be added to any Darwino Web application
– Access to Commands, Profiler, Script…
– Just add the maven dependency to the web project
• For security reasons, it requires a property to be explicitly set
– Commands can execute code that inspect, create or delete sensitive data
# Enabled the debug module
dwo-runtime-debug-enable=true
# only admins - this is the default
#dwo-runtime-debug-users=admin
Darwino Debug Web UI - Demo
Thank you for your attention!

More Related Content

What's hot

Effective out-of-container Integration Testing
Effective out-of-container Integration TestingEffective out-of-container Integration Testing
Effective out-of-container Integration TestingSam Brannen
 
Java virtual machine
Java virtual machineJava virtual machine
Java virtual machineNikhil Sharma
 
Infrastructure testing with Molecule and TestInfra
Infrastructure testing with Molecule and TestInfraInfrastructure testing with Molecule and TestInfra
Infrastructure testing with Molecule and TestInfraTomislav Plavcic
 
Best Practices for Running Kafka on Docker Containers
Best Practices for Running Kafka on Docker ContainersBest Practices for Running Kafka on Docker Containers
Best Practices for Running Kafka on Docker ContainersBlueData, Inc.
 
1. Core Features of Apache RocketMQ
1. Core Features of Apache RocketMQ1. Core Features of Apache RocketMQ
1. Core Features of Apache RocketMQ振东 刘
 
Building Server Applications Using ObjectiveC And GNUstep
Building Server Applications Using ObjectiveC And GNUstepBuilding Server Applications Using ObjectiveC And GNUstep
Building Server Applications Using ObjectiveC And GNUstepguest9efd1a1
 
Grand Central Dispatch
Grand Central DispatchGrand Central Dispatch
Grand Central DispatchRobert Brown
 
Distributed Applications with Apache Zookeeper
Distributed Applications with Apache ZookeeperDistributed Applications with Apache Zookeeper
Distributed Applications with Apache ZookeeperAlex Ehrnschwender
 
Meetup on Apache Zookeeper
Meetup on Apache ZookeeperMeetup on Apache Zookeeper
Meetup on Apache ZookeeperAnshul Patel
 
Common technique in Bypassing Stuff in Python.
Common technique in Bypassing Stuff in Python.Common technique in Bypassing Stuff in Python.
Common technique in Bypassing Stuff in Python.Shahriman .
 
Architecture diagram of jvm
Architecture diagram of jvmArchitecture diagram of jvm
Architecture diagram of jvmhome
 
Tech_Implementation of Complex ITIM Workflows
Tech_Implementation of Complex ITIM WorkflowsTech_Implementation of Complex ITIM Workflows
Tech_Implementation of Complex ITIM Workflows51 lecture
 
S313265 - Advanced Java API for RESTful Web Services at JavaOne Brazil 2010
S313265 - Advanced Java API for RESTful Web Services at JavaOne Brazil 2010S313265 - Advanced Java API for RESTful Web Services at JavaOne Brazil 2010
S313265 - Advanced Java API for RESTful Web Services at JavaOne Brazil 2010Arun Gupta
 
Java ain't scary - introducing Java to PL/SQL Developers
Java ain't scary - introducing Java to PL/SQL DevelopersJava ain't scary - introducing Java to PL/SQL Developers
Java ain't scary - introducing Java to PL/SQL DevelopersLucas Jellema
 
Logging with Logback in Scala
Logging with Logback in ScalaLogging with Logback in Scala
Logging with Logback in ScalaKnoldus Inc.
 

What's hot (20)

Effective out-of-container Integration Testing
Effective out-of-container Integration TestingEffective out-of-container Integration Testing
Effective out-of-container Integration Testing
 
Inside the jvm
Inside the jvmInside the jvm
Inside the jvm
 
Java virtual machine
Java virtual machineJava virtual machine
Java virtual machine
 
Infrastructure testing with Molecule and TestInfra
Infrastructure testing with Molecule and TestInfraInfrastructure testing with Molecule and TestInfra
Infrastructure testing with Molecule and TestInfra
 
Best Practices for Running Kafka on Docker Containers
Best Practices for Running Kafka on Docker ContainersBest Practices for Running Kafka on Docker Containers
Best Practices for Running Kafka on Docker Containers
 
1. Core Features of Apache RocketMQ
1. Core Features of Apache RocketMQ1. Core Features of Apache RocketMQ
1. Core Features of Apache RocketMQ
 
Building Server Applications Using ObjectiveC And GNUstep
Building Server Applications Using ObjectiveC And GNUstepBuilding Server Applications Using ObjectiveC And GNUstep
Building Server Applications Using ObjectiveC And GNUstep
 
Grand Central Dispatch
Grand Central DispatchGrand Central Dispatch
Grand Central Dispatch
 
Distributed Applications with Apache Zookeeper
Distributed Applications with Apache ZookeeperDistributed Applications with Apache Zookeeper
Distributed Applications with Apache Zookeeper
 
3. jvm
3. jvm3. jvm
3. jvm
 
Meetup on Apache Zookeeper
Meetup on Apache ZookeeperMeetup on Apache Zookeeper
Meetup on Apache Zookeeper
 
Common technique in Bypassing Stuff in Python.
Common technique in Bypassing Stuff in Python.Common technique in Bypassing Stuff in Python.
Common technique in Bypassing Stuff in Python.
 
Architecture diagram of jvm
Architecture diagram of jvmArchitecture diagram of jvm
Architecture diagram of jvm
 
Tech_Implementation of Complex ITIM Workflows
Tech_Implementation of Complex ITIM WorkflowsTech_Implementation of Complex ITIM Workflows
Tech_Implementation of Complex ITIM Workflows
 
What is-java
What is-javaWhat is-java
What is-java
 
S313265 - Advanced Java API for RESTful Web Services at JavaOne Brazil 2010
S313265 - Advanced Java API for RESTful Web Services at JavaOne Brazil 2010S313265 - Advanced Java API for RESTful Web Services at JavaOne Brazil 2010
S313265 - Advanced Java API for RESTful Web Services at JavaOne Brazil 2010
 
Lecture 3
Lecture 3Lecture 3
Lecture 3
 
Java ain't scary - introducing Java to PL/SQL Developers
Java ain't scary - introducing Java to PL/SQL DevelopersJava ain't scary - introducing Java to PL/SQL Developers
Java ain't scary - introducing Java to PL/SQL Developers
 
Logging with Logback in Scala
Logging with Logback in ScalaLogging with Logback in Scala
Logging with Logback in Scala
 
JavaOne 2011 Recap
JavaOne 2011 RecapJavaOne 2011 Recap
JavaOne 2011 Recap
 

Viewers also liked

05 darwino db
05   darwino db05   darwino db
05 darwino dbdarwinodb
 
SFD 2014: Multiplatform App Development with Migeran
SFD 2014: Multiplatform App Development with MigeranSFD 2014: Multiplatform App Development with Migeran
SFD 2014: Multiplatform App Development with MigeranGergely Kis
 
Migeran Tech Talk at Prezi HQ
Migeran Tech Talk at Prezi HQMigeran Tech Talk at Prezi HQ
Migeran Tech Talk at Prezi HQGergely Kis
 
09 business apis
09   business apis09   business apis
09 business apisdarwinodb
 
Migeran: iOS Apps in Java at Budapest New Tech Meetup
Migeran: iOS Apps in Java at Budapest New Tech MeetupMigeran: iOS Apps in Java at Budapest New Tech Meetup
Migeran: iOS Apps in Java at Budapest New Tech MeetupGergely Kis
 
IBM ConnectED SPOT104: Lightning-Fast Development of Native Mobile Apps for I...
IBM ConnectED SPOT104: Lightning-Fast Development of Native Mobile Apps for I...IBM ConnectED SPOT104: Lightning-Fast Development of Native Mobile Apps for I...
IBM ConnectED SPOT104: Lightning-Fast Development of Native Mobile Apps for I...darwinodb
 
06 web applications
06   web applications06   web applications
06 web applicationsdarwinodb
 
02 configuration
02   configuration02   configuration
02 configurationdarwinodb
 
07 darwino rest services
07   darwino rest services07   darwino rest services
07 darwino rest servicesdarwinodb
 
10 domino integration
10   domino integration10   domino integration
10 domino integrationdarwinodb
 
01 introduction to darwino
01   introduction to darwino01   introduction to darwino
01 introduction to darwinodarwinodb
 
Cooking Eclipse Plugins with BDD, Cucumber, SWTBot and Tycho
Cooking Eclipse Plugins with BDD, Cucumber, SWTBot and TychoCooking Eclipse Plugins with BDD, Cucumber, SWTBot and Tycho
Cooking Eclipse Plugins with BDD, Cucumber, SWTBot and TychoGergely Kis
 
MOE: Cross Platform Mobile Apps in Java
MOE: Cross Platform Mobile Apps in JavaMOE: Cross Platform Mobile Apps in Java
MOE: Cross Platform Mobile Apps in JavaGergely Kis
 
Cross-Platform Native Apps in Java (budapest.mobile)
Cross-Platform Native Apps in Java (budapest.mobile)Cross-Platform Native Apps in Java (budapest.mobile)
Cross-Platform Native Apps in Java (budapest.mobile)Gergely Kis
 
04 darwino concepts and utility classes
04   darwino concepts and utility classes04   darwino concepts and utility classes
04 darwino concepts and utility classesdarwinodb
 
Space mouse sameer kumar telikicherla
Space mouse   sameer kumar telikicherlaSpace mouse   sameer kumar telikicherla
Space mouse sameer kumar telikicherlaSameer Telikicherla
 
Study: The Future of VR, AR and Self-Driving Cars
Study: The Future of VR, AR and Self-Driving CarsStudy: The Future of VR, AR and Self-Driving Cars
Study: The Future of VR, AR and Self-Driving CarsLinkedIn
 

Viewers also liked (20)

05 darwino db
05   darwino db05   darwino db
05 darwino db
 
SFD 2014: Multiplatform App Development with Migeran
SFD 2014: Multiplatform App Development with MigeranSFD 2014: Multiplatform App Development with Migeran
SFD 2014: Multiplatform App Development with Migeran
 
Migeran Tech Talk at Prezi HQ
Migeran Tech Talk at Prezi HQMigeran Tech Talk at Prezi HQ
Migeran Tech Talk at Prezi HQ
 
09 business apis
09   business apis09   business apis
09 business apis
 
Migeran: iOS Apps in Java at Budapest New Tech Meetup
Migeran: iOS Apps in Java at Budapest New Tech MeetupMigeran: iOS Apps in Java at Budapest New Tech Meetup
Migeran: iOS Apps in Java at Budapest New Tech Meetup
 
IBM ConnectED SPOT104: Lightning-Fast Development of Native Mobile Apps for I...
IBM ConnectED SPOT104: Lightning-Fast Development of Native Mobile Apps for I...IBM ConnectED SPOT104: Lightning-Fast Development of Native Mobile Apps for I...
IBM ConnectED SPOT104: Lightning-Fast Development of Native Mobile Apps for I...
 
06 web applications
06   web applications06   web applications
06 web applications
 
02 configuration
02   configuration02   configuration
02 configuration
 
07 darwino rest services
07   darwino rest services07   darwino rest services
07 darwino rest services
 
10 domino integration
10   domino integration10   domino integration
10 domino integration
 
01 introduction to darwino
01   introduction to darwino01   introduction to darwino
01 introduction to darwino
 
Cooking Eclipse Plugins with BDD, Cucumber, SWTBot and Tycho
Cooking Eclipse Plugins with BDD, Cucumber, SWTBot and TychoCooking Eclipse Plugins with BDD, Cucumber, SWTBot and Tycho
Cooking Eclipse Plugins with BDD, Cucumber, SWTBot and Tycho
 
Multi-OS Engine Technology Overview
Multi-OS Engine Technology OverviewMulti-OS Engine Technology Overview
Multi-OS Engine Technology Overview
 
MOE: Cross Platform Mobile Apps in Java
MOE: Cross Platform Mobile Apps in JavaMOE: Cross Platform Mobile Apps in Java
MOE: Cross Platform Mobile Apps in Java
 
Cross-Platform Native Apps in Java (budapest.mobile)
Cross-Platform Native Apps in Java (budapest.mobile)Cross-Platform Native Apps in Java (budapest.mobile)
Cross-Platform Native Apps in Java (budapest.mobile)
 
04 darwino concepts and utility classes
04   darwino concepts and utility classes04   darwino concepts and utility classes
04 darwino concepts and utility classes
 
MWLUG 2016 - AD106
MWLUG 2016 - AD106MWLUG 2016 - AD106
MWLUG 2016 - AD106
 
Space mouse sameer kumar telikicherla
Space mouse   sameer kumar telikicherlaSpace mouse   sameer kumar telikicherla
Space mouse sameer kumar telikicherla
 
Space mouse
Space mouseSpace mouse
Space mouse
 
Study: The Future of VR, AR and Self-Driving Cars
Study: The Future of VR, AR and Self-Driving CarsStudy: The Future of VR, AR and Self-Driving Cars
Study: The Future of VR, AR and Self-Driving Cars
 

Similar to 15 darwino script & command line

Building Server Applications Using Objective C And Gn Ustep
Building Server Applications Using Objective C And Gn UstepBuilding Server Applications Using Objective C And Gn Ustep
Building Server Applications Using Objective C And Gn Ustepwangii
 
UKLUG 2012 - XPages, Beyond the basics
UKLUG 2012 - XPages, Beyond the basicsUKLUG 2012 - XPages, Beyond the basics
UKLUG 2012 - XPages, Beyond the basicsUlrich Krause
 
Java ScriptingJava Scripting: One VM, Many Languages
Java ScriptingJava Scripting: One VM, Many LanguagesJava ScriptingJava Scripting: One VM, Many Languages
Java ScriptingJava Scripting: One VM, Many Languageselliando dias
 
Manuel - SPR - Intro to Java Language_2016
Manuel - SPR - Intro to Java Language_2016Manuel - SPR - Intro to Java Language_2016
Manuel - SPR - Intro to Java Language_2016Manuel Fomitescu
 
1 java programming- introduction
1  java programming- introduction1  java programming- introduction
1 java programming- introductionjyoti_lakhani
 
JAVAPart1_BasicIntroduction.pptx
JAVAPart1_BasicIntroduction.pptxJAVAPart1_BasicIntroduction.pptx
JAVAPart1_BasicIntroduction.pptxMurugesh33
 
JAVA_Day1_BasicIntroduction.pptx
JAVA_Day1_BasicIntroduction.pptxJAVA_Day1_BasicIntroduction.pptx
JAVA_Day1_BasicIntroduction.pptxMurugesh33
 
OOP with Java
OOP with JavaOOP with Java
OOP with JavaOmegaHub
 
Java 8 in Anger, Devoxx France
Java 8 in Anger, Devoxx FranceJava 8 in Anger, Devoxx France
Java 8 in Anger, Devoxx FranceTrisha Gee
 
Java 8 in Anger (QCon London)
Java 8 in Anger (QCon London)Java 8 in Anger (QCon London)
Java 8 in Anger (QCon London)Trisha Gee
 
[DanNotes] XPages - Beyound the Basics
[DanNotes] XPages - Beyound the Basics[DanNotes] XPages - Beyound the Basics
[DanNotes] XPages - Beyound the BasicsUlrich Krause
 
Containerization Is More than the New Virtualization
Containerization Is More than the New VirtualizationContainerization Is More than the New Virtualization
Containerization Is More than the New VirtualizationC4Media
 
Road to Opscon (Pisa '15) - DevOoops
Road to Opscon (Pisa '15) - DevOoopsRoad to Opscon (Pisa '15) - DevOoops
Road to Opscon (Pisa '15) - DevOoopsGianluca Varisco
 
Gianluca Varisco - DevOoops (Increase awareness around DevOps infra security)
Gianluca Varisco - DevOoops (Increase awareness around DevOps infra security)Gianluca Varisco - DevOoops (Increase awareness around DevOps infra security)
Gianluca Varisco - DevOoops (Increase awareness around DevOps infra security)Codemotion
 
Java SpringMVC SpringBOOT (Divergent).ppt
Java SpringMVC SpringBOOT (Divergent).pptJava SpringMVC SpringBOOT (Divergent).ppt
Java SpringMVC SpringBOOT (Divergent).pptAayush Chimaniya
 
Jenkins advance topic
Jenkins advance topicJenkins advance topic
Jenkins advance topicGourav Varma
 

Similar to 15 darwino script & command line (20)

CS8392 OOP
CS8392 OOPCS8392 OOP
CS8392 OOP
 
oop unit1.pptx
oop unit1.pptxoop unit1.pptx
oop unit1.pptx
 
Building Server Applications Using Objective C And Gn Ustep
Building Server Applications Using Objective C And Gn UstepBuilding Server Applications Using Objective C And Gn Ustep
Building Server Applications Using Objective C And Gn Ustep
 
UKLUG 2012 - XPages, Beyond the basics
UKLUG 2012 - XPages, Beyond the basicsUKLUG 2012 - XPages, Beyond the basics
UKLUG 2012 - XPages, Beyond the basics
 
Java ScriptingJava Scripting: One VM, Many Languages
Java ScriptingJava Scripting: One VM, Many LanguagesJava ScriptingJava Scripting: One VM, Many Languages
Java ScriptingJava Scripting: One VM, Many Languages
 
Manuel - SPR - Intro to Java Language_2016
Manuel - SPR - Intro to Java Language_2016Manuel - SPR - Intro to Java Language_2016
Manuel - SPR - Intro to Java Language_2016
 
1 java programming- introduction
1  java programming- introduction1  java programming- introduction
1 java programming- introduction
 
JAVAPart1_BasicIntroduction.pptx
JAVAPart1_BasicIntroduction.pptxJAVAPart1_BasicIntroduction.pptx
JAVAPart1_BasicIntroduction.pptx
 
JAVA_Day1_BasicIntroduction.pptx
JAVA_Day1_BasicIntroduction.pptxJAVA_Day1_BasicIntroduction.pptx
JAVA_Day1_BasicIntroduction.pptx
 
Java and the JVM
Java and the JVMJava and the JVM
Java and the JVM
 
OOP with Java
OOP with JavaOOP with Java
OOP with Java
 
Java 8 in Anger, Devoxx France
Java 8 in Anger, Devoxx FranceJava 8 in Anger, Devoxx France
Java 8 in Anger, Devoxx France
 
Java 8 in Anger (QCon London)
Java 8 in Anger (QCon London)Java 8 in Anger (QCon London)
Java 8 in Anger (QCon London)
 
[DanNotes] XPages - Beyound the Basics
[DanNotes] XPages - Beyound the Basics[DanNotes] XPages - Beyound the Basics
[DanNotes] XPages - Beyound the Basics
 
Containerization Is More than the New Virtualization
Containerization Is More than the New VirtualizationContainerization Is More than the New Virtualization
Containerization Is More than the New Virtualization
 
Road to Opscon (Pisa '15) - DevOoops
Road to Opscon (Pisa '15) - DevOoopsRoad to Opscon (Pisa '15) - DevOoops
Road to Opscon (Pisa '15) - DevOoops
 
Gianluca Varisco - DevOoops (Increase awareness around DevOps infra security)
Gianluca Varisco - DevOoops (Increase awareness around DevOps infra security)Gianluca Varisco - DevOoops (Increase awareness around DevOps infra security)
Gianluca Varisco - DevOoops (Increase awareness around DevOps infra security)
 
Java >= 9
Java >= 9Java >= 9
Java >= 9
 
Java SpringMVC SpringBOOT (Divergent).ppt
Java SpringMVC SpringBOOT (Divergent).pptJava SpringMVC SpringBOOT (Divergent).ppt
Java SpringMVC SpringBOOT (Divergent).ppt
 
Jenkins advance topic
Jenkins advance topicJenkins advance topic
Jenkins advance topic
 

More from darwinodb

17 open ntf-v30-darwinoorg
17   open ntf-v30-darwinoorg17   open ntf-v30-darwinoorg
17 open ntf-v30-darwinoorgdarwinodb
 
16 endeavour reporter
16   endeavour reporter16   endeavour reporter
16 endeavour reporterdarwinodb
 
14 integrating watson services
14   integrating watson services14   integrating watson services
14 integrating watson servicesdarwinodb
 
13 deploying cloud applications
13   deploying cloud applications13   deploying cloud applications
13 deploying cloud applicationsdarwinodb
 
12 ibm connections integration
12   ibm connections integration12   ibm connections integration
12 ibm connections integrationdarwinodb
 
11 advanced replication
11   advanced replication11   advanced replication
11 advanced replicationdarwinodb
 
08 mobile development
08   mobile development08   mobile development
08 mobile developmentdarwinodb
 

More from darwinodb (7)

17 open ntf-v30-darwinoorg
17   open ntf-v30-darwinoorg17   open ntf-v30-darwinoorg
17 open ntf-v30-darwinoorg
 
16 endeavour reporter
16   endeavour reporter16   endeavour reporter
16 endeavour reporter
 
14 integrating watson services
14   integrating watson services14   integrating watson services
14 integrating watson services
 
13 deploying cloud applications
13   deploying cloud applications13   deploying cloud applications
13 deploying cloud applications
 
12 ibm connections integration
12   ibm connections integration12   ibm connections integration
12 ibm connections integration
 
11 advanced replication
11   advanced replication11   advanced replication
11 advanced replication
 
08 mobile development
08   mobile development08   mobile development
08 mobile development
 

Recently uploaded

Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...Globus
 
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...Juraj Vysvader
 
Dominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdf
Dominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdfDominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdf
Dominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdfAMB-Review
 
Studiovity film pre-production and screenwriting software
Studiovity film pre-production and screenwriting softwareStudiovity film pre-production and screenwriting software
Studiovity film pre-production and screenwriting softwareinfo611746
 
Understanding Globus Data Transfers with NetSage
Understanding Globus Data Transfers with NetSageUnderstanding Globus Data Transfers with NetSage
Understanding Globus Data Transfers with NetSageGlobus
 
2024 RoOUG Security model for the cloud.pptx
2024 RoOUG Security model for the cloud.pptx2024 RoOUG Security model for the cloud.pptx
2024 RoOUG Security model for the cloud.pptxGeorgi Kodinov
 
Multiple Your Crypto Portfolio with the Innovative Features of Advanced Crypt...
Multiple Your Crypto Portfolio with the Innovative Features of Advanced Crypt...Multiple Your Crypto Portfolio with the Innovative Features of Advanced Crypt...
Multiple Your Crypto Portfolio with the Innovative Features of Advanced Crypt...Hivelance Technology
 
Cyaniclab : Software Development Agency Portfolio.pdf
Cyaniclab : Software Development Agency Portfolio.pdfCyaniclab : Software Development Agency Portfolio.pdf
Cyaniclab : Software Development Agency Portfolio.pdfCyanic lab
 
Vitthal Shirke Microservices Resume Montevideo
Vitthal Shirke Microservices Resume MontevideoVitthal Shirke Microservices Resume Montevideo
Vitthal Shirke Microservices Resume MontevideoVitthal Shirke
 
Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus Compute wth IRI Workflows - GlobusWorld 2024Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus Compute wth IRI Workflows - GlobusWorld 2024Globus
 
Accelerate Enterprise Software Engineering with Platformless
Accelerate Enterprise Software Engineering with PlatformlessAccelerate Enterprise Software Engineering with Platformless
Accelerate Enterprise Software Engineering with PlatformlessWSO2
 
TROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERROR
TROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERRORTROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERROR
TROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERRORTier1 app
 
Software Testing Exam imp Ques Notes.pdf
Software Testing Exam imp Ques Notes.pdfSoftware Testing Exam imp Ques Notes.pdf
Software Testing Exam imp Ques Notes.pdfMayankTawar1
 
Globus Connect Server Deep Dive - GlobusWorld 2024
Globus Connect Server Deep Dive - GlobusWorld 2024Globus Connect Server Deep Dive - GlobusWorld 2024
Globus Connect Server Deep Dive - GlobusWorld 2024Globus
 
Providing Globus Services to Users of JASMIN for Environmental Data Analysis
Providing Globus Services to Users of JASMIN for Environmental Data AnalysisProviding Globus Services to Users of JASMIN for Environmental Data Analysis
Providing Globus Services to Users of JASMIN for Environmental Data AnalysisGlobus
 
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoam
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoamOpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoam
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoamtakuyayamamoto1800
 
Developing Distributed High-performance Computing Capabilities of an Open Sci...
Developing Distributed High-performance Computing Capabilities of an Open Sci...Developing Distributed High-performance Computing Capabilities of an Open Sci...
Developing Distributed High-performance Computing Capabilities of an Open Sci...Globus
 
Beyond Event Sourcing - Embracing CRUD for Wix Platform - Java.IL
Beyond Event Sourcing - Embracing CRUD for Wix Platform - Java.ILBeyond Event Sourcing - Embracing CRUD for Wix Platform - Java.IL
Beyond Event Sourcing - Embracing CRUD for Wix Platform - Java.ILNatan Silnitsky
 
Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...
Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...
Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...Shahin Sheidaei
 

Recently uploaded (20)

Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
 
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
 
Dominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdf
Dominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdfDominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdf
Dominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdf
 
Studiovity film pre-production and screenwriting software
Studiovity film pre-production and screenwriting softwareStudiovity film pre-production and screenwriting software
Studiovity film pre-production and screenwriting software
 
Understanding Globus Data Transfers with NetSage
Understanding Globus Data Transfers with NetSageUnderstanding Globus Data Transfers with NetSage
Understanding Globus Data Transfers with NetSage
 
2024 RoOUG Security model for the cloud.pptx
2024 RoOUG Security model for the cloud.pptx2024 RoOUG Security model for the cloud.pptx
2024 RoOUG Security model for the cloud.pptx
 
Multiple Your Crypto Portfolio with the Innovative Features of Advanced Crypt...
Multiple Your Crypto Portfolio with the Innovative Features of Advanced Crypt...Multiple Your Crypto Portfolio with the Innovative Features of Advanced Crypt...
Multiple Your Crypto Portfolio with the Innovative Features of Advanced Crypt...
 
Corporate Management | Session 3 of 3 | Tendenci AMS
Corporate Management | Session 3 of 3 | Tendenci AMSCorporate Management | Session 3 of 3 | Tendenci AMS
Corporate Management | Session 3 of 3 | Tendenci AMS
 
Cyaniclab : Software Development Agency Portfolio.pdf
Cyaniclab : Software Development Agency Portfolio.pdfCyaniclab : Software Development Agency Portfolio.pdf
Cyaniclab : Software Development Agency Portfolio.pdf
 
Vitthal Shirke Microservices Resume Montevideo
Vitthal Shirke Microservices Resume MontevideoVitthal Shirke Microservices Resume Montevideo
Vitthal Shirke Microservices Resume Montevideo
 
Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus Compute wth IRI Workflows - GlobusWorld 2024Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus Compute wth IRI Workflows - GlobusWorld 2024
 
Accelerate Enterprise Software Engineering with Platformless
Accelerate Enterprise Software Engineering with PlatformlessAccelerate Enterprise Software Engineering with Platformless
Accelerate Enterprise Software Engineering with Platformless
 
TROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERROR
TROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERRORTROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERROR
TROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERROR
 
Software Testing Exam imp Ques Notes.pdf
Software Testing Exam imp Ques Notes.pdfSoftware Testing Exam imp Ques Notes.pdf
Software Testing Exam imp Ques Notes.pdf
 
Globus Connect Server Deep Dive - GlobusWorld 2024
Globus Connect Server Deep Dive - GlobusWorld 2024Globus Connect Server Deep Dive - GlobusWorld 2024
Globus Connect Server Deep Dive - GlobusWorld 2024
 
Providing Globus Services to Users of JASMIN for Environmental Data Analysis
Providing Globus Services to Users of JASMIN for Environmental Data AnalysisProviding Globus Services to Users of JASMIN for Environmental Data Analysis
Providing Globus Services to Users of JASMIN for Environmental Data Analysis
 
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoam
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoamOpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoam
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoam
 
Developing Distributed High-performance Computing Capabilities of an Open Sci...
Developing Distributed High-performance Computing Capabilities of an Open Sci...Developing Distributed High-performance Computing Capabilities of an Open Sci...
Developing Distributed High-performance Computing Capabilities of an Open Sci...
 
Beyond Event Sourcing - Embracing CRUD for Wix Platform - Java.IL
Beyond Event Sourcing - Embracing CRUD for Wix Platform - Java.ILBeyond Event Sourcing - Embracing CRUD for Wix Platform - Java.IL
Beyond Event Sourcing - Embracing CRUD for Wix Platform - Java.IL
 
Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...
Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...
Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...
 

15 darwino script & command line

  • 1. Darwino Script and Command Line Add customization capabilities to your Darwino applications
  • 2. Darwino Script Introduction • Darwino Script is a scripting language, very similar to JavaScript – Follows ECMA-Script 262-3 for a lot of behaviors – Designed as a “formula language” rather than a language for writing programs – Extended for ease of use: new operators like ?. or ?[, @functions… – Uses the Java primitives as core language primitives, include BigDecimal – Objects are Java objects and don’t have prototypes • Although a custom library can easily provide this feature • Ex: JsonArray & JsonObject – Tailored to script Java classes/objects • Can directly call any Java classes/objects, if security permits • Can easily be extended through java extension points
  • 3. Darwino Script Introduction • Low resource consumption, even on mobile devices – Fast compiler with caching capability • Dynamic execution: interprets an AST tree in memory – No class file is generated, so it does not require a JVM (AOT compiler works) • Can be transpiled to other languages (Java, JavaScript, AngularJS expressions…)
  • 4. Darwino Script Usage • Script language for citizen developers – Can be interpreted dynamically or transpiled (see: UI generation) • End user customization – Workflow engine conditions, … – Other customizations done by a user • Database events, …
  • 5. Darwino Script Main Objects • DSEnvironment – Maintains the global scripting options, libraries and variables – Shared across script executions • DSContext – The execution context for a script execution – Contains the local variables, and execution options • DSScript – An in-memory compiled script, ready to be executed • DSLibrary – Define a set of functions, classes or value members (including constants)
  • 6. Executing a Piece of Script // Create the execution environment // This environment holds the libraries to use // - standard (print, println..) // - JavaJre (access to Java Object using reflection) DSEnvironment env = new DSEnvironment(); env.registerLibrary(new StandardLibrary()); env.registerLibrary(new JavaJreLibrary(env)); // The context can also take extra parameters: // this // library to use for this context // Note that the context contains the global variables being created by the script // and can also be reused, with these values, while executing another script DSProgramRuntimeContext ctx = new DSProgramRuntimeContext(env); // Compile the script or get it from the cache DSScript expr = ctx.getEnvironment().createScript("1+4"); // Execute and get the result Object result = expr.execute(ctx); assertEquals(5, result);
  • 7. Creating a Reusable Library • A library can export – Member access (global values, object members…) – Function calls (global function, object method…) – Object/Array constructors public interface DSLibrary { public Object getMember(DSRuntimeContext context, Object instance, String member) throws DSRuntimeException; public Object getMember(DSRuntimeContext context, Object instance, int index) throws DSRuntimeException; public boolean putMember(DSRuntimeContext context, Object instance, String member, Object value) throws DSRuntimeException; public boolean putMember(DSRuntimeContext context, Object instance, int index, Object value) throws DSRuntimeException; public Object call(DSRuntimeContext context, Object instance, Object[] parameters) throws DSRuntimeException; public Object constructObject(DSRuntimeContext context, String type, Object[] parameters) throws DSRuntimeException; public Object constructArray(DSRuntimeContext context, String type, int dimensions, int size) throws DSRuntimeException; }
  • 8. Existing Libraries • Java bridge • @function – Similar to Notes/Domino @functions – Targets citizen developers • Java Objects cab implement – DSObject, DSArray, DSCallable for easy library creationb
  • 9. A Word About Security • If the script is going to be exposed to end users – You should control what library is exposed • Use reflection to access Java object? – You should fine control what object can be exposed/called from the script • Can also depend on the user profile • All the features are exposed through libraries, so it is easy to control – But Darwino will make it even easier with a new security interface
  • 10. Darwino Command Framework • The Darwino command framework allows the execution of text based commands • The lists of commands is contributed via extensions • Generally used to exposed administration/debugging capabilities
  • 11. Some Available Commands • Built-in commands libraries are provided by the runtime – Default: echo, set, call, profiler, classpath… – JSON Store: manage databases, access data… – Runtime: access to user • And more to come over time – Access to log files – Java logging API settings
  • 12. Darwino Command CLI • Commands can be executed from a simple console shell – Provided as a Java class in the dwo-apps-jstore-cli project • Configuration file is executed when the console is launched ~/.darwino/console-init.dsh • Example: # Initialize with TOMCAT environment classpath c:phildevapache-tomcat-8.0.20libsqljdbc42.jar classpath c:phildevapache-tomcat-8.0.20libpostgresql-9.4-1203-jdbc4.jar load-config c:phildevapache-tomcat-8.0.20
  • 13. Darwino Debug Web UI • A simple WebUI can be added to any Darwino Web application – Access to Commands, Profiler, Script… – Just add the maven dependency to the web project • For security reasons, it requires a property to be explicitly set – Commands can execute code that inspect, create or delete sensitive data # Enabled the debug module dwo-runtime-debug-enable=true # only admins - this is the default #dwo-runtime-debug-users=admin
  • 14. Darwino Debug Web UI - Demo
  • 15. Thank you for your attention!