Skip to content
Skip to breadcrumbs
Skip to header menu
Skip to action menu
Skip to quick search
Quick Search
Browse
Pages
Blog
Labels
Attachments
Mail
Advanced
What’s New
Space Directory
Feed Builder
Keyboard Shortcuts
Confluence Gadgets
Log In
Sign Up
Dashboard
Groovy
Copy Page
You are not logged in. Any changes you make will be marked as
anonymous
. You may want to
Log In
if you already have an account. You can also
Sign Up
for a new account.
This page is being edited by
.
Paragraph
Paragraph
Heading 1
Heading 2
Heading 3
Heading 4
Heading 5
Heading 6
Preformatted
Quote
Bold
Italic
Underline
More colours
Strikethrough
Subscript
Superscript
Monospace
Clear Formatting
Bullet list
Numbered list
Outdent
Indent
Align left
Align center
Align right
Link
Table
Insert
Insert Content
Image
Link
Attachment
Symbol
Emoticon
Wiki Markup
Horizontal rule
tinymce.confluence.insert_menu.macro_desc
Info
JIRA Issue
Status
Gallery
Tasklist
Table of Contents
Other Macros
Page Layout
No Layout
Two column (simple)
Two column (simple, left sidebar)
Two column (simple, right sidebar)
Three column (simple)
Two column
Two column (left sidebar)
Two column (right sidebar)
Three column
Three column (left and right sidebars)
Undo
Redo
Find/Replace
Keyboard Shortcuts Help
<h2>Contribution Overview</h2> <p>Grapplet provides a way for running Groovy on an applet, adding extra functionality to JS objects and arrays,<br /> for example arrays behave like Java Lists, so all GDK methods available to List and Collection can be used in JS arrays.</p> <p>Grapplet will automatically look for all <script> tags available in the page that have its language property set to<br /> "text/x-groovy". This was inspired by a post on Dion's blog: <a href="http://www.almaer.com/blog/archives/001455.html">Running Ruby in the browser via script type="text/ruby"</a>.</p> <p>Once Grapplet is running on a page, you can evaluate any Groovy script by calling evaluateScript().</p> <h3>Team Members</h3> <p>Andres Almiray [aalmiray at users dot sourceforge dot net]</p> <h2>Download</h2> <h3>Distributions</h3> <p>Pending. </p> <h3>Installing</h3> <p>Pending. </p> <h3>Pre-requisites</h3> <p>None</p> <h2>Documentation</h2> <p>In order to run Grapplet it needs to be signed, follow the next instructions to use a self-signed certificate<br /> (recommended for testing) </p> <p> In order to run Groovy on a browser you'll need to sign the applet.<br /> Follow the steps to sign an applet with your own certificate.</p> <p>1. Create a keystore which will hold the certificate.<br /> I created an external keystore so I wouldn't mess up my personal security<br /> settings while finding out the correct way to do it. All you have to do<br /> is issue the following command:</p> <p> keytool -genkey -keystore groovy -storepass groovy -keypass groovy \<br /> -alias groovy</p> <p>2. Trust your own certificate.<br /> Unless you want to spend some bucks on this experiment I recommend you<br /> selfcert your certificate. To selfcert your newly created certificate,<br /> issue the following command:</p> <p> keytool -selfcert -keystore groovy -storepass groovy -keypass groovy \<br /> -alias groovy</p> <p>3. Export your certificate. Export your certificate to an external file with<br /> the following command:</p> <p> keytool -export -keystore groovy -storepass groovy -keypass groovy \<br /> -alias groovy -file groovy.cer</p> <p>4. Sign the jar. This will attach the certificate to the jar and add entries<br /> to the jar's manifest.</p> <p> jarsigner -keystore groovy -storepass groovy -keypass groovy \<br /> grapplet-0.1.jar groovy</p> <p>5. Verify your jar (just in case). You may verify that your jar has indeed<br /> been signed and includes the certificate, for more information on<br /> jarsigner's output refer to the command's help (jarsigner -help):</p> <p> jarsigner -verify -verbose -certs -keystore groovy grapplet-0.1.jar</p> <p>6. Configure your local security settings. For this step you must touch<br /> $JRE_HOME/lib/security/java.policy and $JRE_HOME/lib/security/java.security,<br /> in windows $JRE_HOME usally points to "c:/Program Files/Java/jdk1.x.x/".</p> <p> 1. Add the following lines at the end of java.policy:<br /> grant {<br /> java.lang.RuntimePermission "usePolicy";<br /> };<br /> 2. Create a file named '.java.policy' at $USER_HOME with the following<br /> contents:<br /> keystore "file:${user.home}/groovy";<br /> grant signedBy "groovy" {<br /> permission java.security.AllPermission;<br /> };<br /> grant codeBase "http://localhost" {<br /> permission java.security.AllPermission;<br /> };<br /> 3. Copy the keystore 'groovy' and 'groovy.cer' (just in case) to $USER_HOME.</p> <p>7. Copy the binary dist to your webserver. If you're using Apache copy<br /> grapplet.html, groovy.js, grapplet-0.1.jar, groovy-all-1.0.jar, groovy and<br /> groovy.cer to $APACHE_HOME/htdocs/grapplet</p> <h2>Developers</h2> <h3>Source Control</h3> <p><a href="http://svn.codehaus.org/groovy-contrib/grapplet">http://svn.codehaus.org/groovy-contrib/grapplet</a></p> <h3>Building</h3> <p>Grapplet uses Maven2 as its build tool, which means that if you want to<br /> build your own version of Grapplet from source you'll need to have it<br /> installed. Follow the instructions at <a href="http://maven.apache.org">http://maven.apache.org</a><br /> Once Maven2 is installed you will also need to install the java-plugin into<br /> your maven repository (but it wouldn't hurt to check at<br /> <a href="http://mvnrepository.org">http://mvnrepository.org</a> if it is already there). Usually the plugin is<br /> located at $JDK_HOME/jre/lib/plugin.jar</p> <p>You can install it on your local Maven2 repo with the following command</p> <p> mvn install:installFile -DgroupId=com.sun.java-plugin -Dversion=<jdkversion> \<br /> -Dpackaging=jar -DartifactId=java-plugin \<br /> -Dfile= $JDK_HOME/jre/lib/plugin.jar</p> <p>where <jdkversion> is the version number of the selected jdk. Grapplet has<br /> version 1.6.0 configured, if you change version you'll have to update pom.xml</p> <p>After you have the required dependencies installe, you may generate the package<br /> by typing</p> <p> mvn package</p> <p>Now you'll have to sign grapplet-<version>.jar, copy it and groovy.js to your<br /> webapp or webserver dir. The file src/html/grapplet.html should give you some<br /> pointers in how it should be configured.<br /> The next section will describe the process of self-signing the jar.</p> <h3>Contributing</h3> <p>Please contact the team members by e-mail.</p> <h2>Community</h2> <h3>Mailing List(s)</h3> <p><a href="http://groovy.codehaus.org/Mailing+Lists">http://groovy.codehaus.org/Mailing+Lists</a></p> <h3>Issue tracker</h3> <p><a href="http://jira.codehaus.org/secure/BrowseProject.jspa?id=10242">http://jira.codehaus.org/secure/BrowseProject.jspa?id=10242</a></p>
Please type the word appearing in the picture.
Attachments
Labels
Location
Watch this page
< Edit
Preview >
Loading…
Save
Cancel
Next hint
search
attachments
weblink
advanced