Return-Path: X-Original-To: apmail-pivot-user-archive@www.apache.org Delivered-To: apmail-pivot-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id C6430DACC for ; Fri, 17 Aug 2012 14:44:20 +0000 (UTC) Received: (qmail 52632 invoked by uid 500); 17 Aug 2012 14:44:20 -0000 Delivered-To: apmail-pivot-user-archive@pivot.apache.org Received: (qmail 52481 invoked by uid 500); 17 Aug 2012 14:44:19 -0000 Mailing-List: contact user-help@pivot.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@pivot.apache.org Delivered-To: mailing list user@pivot.apache.org Received: (qmail 52451 invoked by uid 99); 17 Aug 2012 14:44:19 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 17 Aug 2012 14:44:19 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of sandro.martini@gmail.com designates 74.125.82.182 as permitted sender) Received: from [74.125.82.182] (HELO mail-we0-f182.google.com) (74.125.82.182) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 17 Aug 2012 14:44:13 +0000 Received: by weyx56 with SMTP id x56so3081081wey.13 for ; Fri, 17 Aug 2012 07:43:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type; bh=xVTkU09q1AW7jvm48+HBsX112esyTceHxX2z3sls5ls=; b=N/3jEogQVnbPQ2QsHKYe2OyxkZng3BgJSROetI2L38QUSk8USFTZ25vC64Vx+FUmOR w4coh3ATC7RVccXE3gDpo7n96AVWgxgVyqBhufxeG3xmvKwD9OYJkn4kZhcfxBvXEc/1 Kv1IF5BGkw8XrBGXdZx9LM2zrmkusfwm2e1j34hOZhFRQStmEgynsJCb3QqDIe7drOiI XByJrsa38fAjh0+Ivrsm2sBlzv6ijjmC7P4lGle5TO3jpaZPOT3LifCNiKWKOW5XLL9g mlF6RyZ4SMac9fpGzNO3zlbbCwJmaaNCA6FKbJJubu+TqGqr4pJe8QGMUEbXZo1jKDOl fwuw== MIME-Version: 1.0 Received: by 10.180.99.196 with SMTP id es4mr5465138wib.18.1345214631621; Fri, 17 Aug 2012 07:43:51 -0700 (PDT) Received: by 10.216.166.213 with HTTP; Fri, 17 Aug 2012 07:43:51 -0700 (PDT) Date: Fri, 17 Aug 2012 16:43:51 +0200 Message-ID: Subject: Improve interaction with Scripting languages inside the JVM, starting from JavaScript From: Sandro Martini To: Users - Apache Pivot , Developers - Apache Pivot Content-Type: text/plain; charset=ISO-8859-1 X-Virus-Checked: Checked by ClamAV on apache.org Hi all, in last weeks I have committed under the tests subproject (both for 2.0.x maintenance branch, and trunk, for 2.1) a test application called JavascriptConsole (JavascriptConsoleTest* and javascript_console_test* files). It's more a test than a real sample/demo now, but thanks to this I have made some small improvement in the BXMLSerializer. It's full of comments and many different tests because I'd like to show different ways to do some kind of things, some working and some not, as a sample (even to know how to not do things). Now the reasons behind this: trying to show and improve interaction of Pivot with Scripting languages inside the JVM. In a world of HTML 5 webapps (and much more JavaScript than in past) I think it's important for Pivot to start aligning better with this kind of programming. So a little more focus on JavaScript (in this case interpreted by the JVM, and as soon as possible even other JVM scripting languages, starting from Groovy, then maybe others), at least for quick prototypes. Inside this sample, I tried to show how to write a minimal amount of Java code (ok, i know it's appliable only on smaller applications), and have JS take control, but in a not-so-trivial dynamic application. And show how from JS to load and display Pivot GUI Containers like Frames and Windows, request data (like ajax query in html pages) and then display it, using java methods if/when useful (better debuggability, performances, etc). Another test inside is to show how to interact with remote bxml files (now static and in a folder of Pivot web site, but for example they could be generated or simply hosted at server-side) and do all the processing client side but in JS, more aligned to the HTML 5 way to do things. In this way we could even start to have some parts of Pivot applications hosted at server side. And even the ability to get Resources from JS, for example to put label values in JS variables, and even in Pivot components, but all from the JS side. Last, the Console (but still not working, didn't have time for it now) to show that thanks to the dynamic nature of JS we could write code in the text area and run it directly ... Ok, all things already seen, but not in Pivot :-) . If possible, for a future release (could be 2.1, or maybe later) I'd like to put a polished version of it under tutorials, or under demos ... For a quick look, see here: http://svn.apache.org/repos/asf/pivot/branches/2.0.x/tests/src/org/apache/pivot/tests/ or http://svn.apache.org/repos/asf/pivot/trunk/tests/src/org/apache/pivot/tests/ Do you think it's something that needs further documentation/samples/exploration in Pivot ? For suggestions and comments we are here ... Bye, Sandro