Zum Hauptinhalt gehen

JSR-223 in FirstSpirit

Kommentare

6 Kommentare

  • Zendesk API User
    Author: mariomueller - 8/13/2010 17:00

    What about integrating, for example, groovy as script engine? It also implements the JSR-223 interface. I've tried to publish the groovy-all (1.7.4) as global library module on the server, but it didn't work. Do you see any chance to use anything different to JS & BSH?

    0
  • Zendesk API User
    Author: feddersen - 8/13/2010 18:15

    It's certainly possible, I know that Peter  created a groovy module as a proof of concept about 2,5 years ago. In addition to the groovy-all library, he used the groovy-engine.jar from https://scripting.dev.java.net/servlets/ProjectDocumentList (located in build/groovy). You need to add the GroovyScriptEngineFactory as a public component. I'm not sure if it that jar is still necessary, because groovy ships with a similar class now.

    Please keep in mind that adding a new scripting language isn't officially supported. It should work, but it's completely untested.

    0
  • Zendesk API User
    Author: mariomueller - 8/16/2010 8:32

    Hey Christoph,

    thanks for the feedback. I'll give it a try and report back with any results. And yes, I'm aware of the support-issue :smileywink: This more for the one-time scripts, not for customer-deployment.

    0
  • Zendesk API User
    Author: mariomueller - 8/16/2010 10:27

    Ok, I've tried the following module.xml, but without success...

    <!DOCTYPE module SYSTEM "http://www.FirstSpirit.de/module.dtd">
    <module>
       <name>Groovy Integration Module</name>
       <version>4.2.206-1.7.4</version>
       <description>Groovy Integration</description>
       <vendor>...</vendor>
       <components>
           <public>
               <name>grint</name>
               <description>Bereitstellung der Groovy Bibliothek</description>
            <version>1</version>
            <class>org.codehaus.groovy.jsr223.GroovyScriptEngineFactory</class>
            <hidden>false</hidden>
            <resources>
                <resource>lib/groovy-all-1.7.4.jar</resource>
            </resources>
        </public>
       </components>
    </module>

    Any clues?

    0
  • Zendesk API User
    Author: feddersen - 8/18/2010 8:46

    Here's how Peter did it 2,5 years ago. Key difference is the use of a library component for the jars.

    <module>
        <name>Groovy</name>
        <version>4.0.122</version>
        <description>Groovy Scripting Engine</description>
        <vendor>e-Spirit AG</vendor>
        <components>
            <public>
                <name>groovy</name>
                <class>com.sun.script.groovy.GroovyScriptEngineFactory</class>
            </public>
            <library>
                <name>groovy lib</name>
                <resources>
                    <resource>lib/groovy-engine.jar</resource>
                    <resource>lib/groovy-all-1.5.6.jar</resource>
                </resources>
            </library>
        </components>
    </module>

    0
  • Zendesk API User
    Author: mariomueller - 8/18/2010 9:32

    Ok, that really helped :smileywink:

    Just to point out the problem for anybody else:

    I've used the public module type and the groovy-all-xxx.jar as resource. This won't work, so the good way to get things up and running is to use a library type to provide the jar to the classloader.

    Attention: The <name/> of the public part is the name you must write after your script type definition (she-bang line).

    e.x.:

    <name>groovyIntegration</name> => //!groovyIntegration or #!groovyIntegration

    <name>groovy</name> => //!groovy or #!groovy

    Just keep it in mind :smileywink:

    0

Bitte melden Sie sich an, um einen Kommentar zu hinterlassen.