You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomee.apache.org by Romain Manni-Bucau <rm...@gmail.com> on 2013/05/29 20:11:26 UTC

Re: svn commit: r1487582 - /tomee/tomee/trunk/tomee/tomee-webapp/src/main/webapp/app/js/templates/application-tab-console-sample.handlebars

Hi Thiago,

Why JavaImporter? importPackages(Packages.org.foo); works great
Le 29 mai 2013 20:08, <tv...@apache.org> a écrit :

> Author: tveronezi
> Date: Wed May 29 18:07:55 2013
> New Revision: 1487582
>
> URL: http://svn.apache.org/r1487582
> Log:
> -(cosmetic) simplify "sample script".
>
> Modified:
>
> tomee/tomee/trunk/tomee/tomee-webapp/src/main/webapp/app/js/templates/application-tab-console-sample.handlebars
>
> Modified:
> tomee/tomee/trunk/tomee/tomee-webapp/src/main/webapp/app/js/templates/application-tab-console-sample.handlebars
> URL:
> http://svn.apache.org/viewvc/tomee/tomee/trunk/tomee/tomee-webapp/src/main/webapp/app/js/templates/application-tab-console-sample.handlebars?rev=1487582&r1=1487581&r2=1487582&view=diff
>
> ==============================================================================
> ---
> tomee/tomee/trunk/tomee/tomee-webapp/src/main/webapp/app/js/templates/application-tab-console-sample.handlebars
> (original)
> +++
> tomee/tomee/trunk/tomee/tomee-webapp/src/main/webapp/app/js/templates/application-tab-console-sample.handlebars
> Wed May 29 18:07:55 2013
> @@ -1,22 +1,15 @@
>  // Sample script
> -var myImports = new JavaImporter(
> -  java.util.Properties,
> -  javax.naming.InitialContext
> -);
> +var p = new java.util.Properties();
> +p.put("java.naming.factory.initial",
> "org.apache.openejb.client.RemoteInitialContextFactory");
> +p.put("java.naming.provider.url", "http://localhost:8080/tomee/ejb");
> +p.put("java.naming.security.principal", "tomee");
> +p.put("java.naming.security.credentials", "tomee");
>
> -with (myImports) {
> -  var p = new Properties();
> -  p.put("java.naming.factory.initial",
> "org.apache.openejb.client.RemoteInitialContextFactory");
> -  p.put("java.naming.provider.url",
> "{{protocol}}://localhost:{{port}}/tomee/ejb");
> -  p.put("java.naming.security.principal", "{{name}}");
> -  p.put("java.naming.security.credentials", "{{password}}");
> -
> -  var ctx = new InitialContext(p);
> -  var varList = [];
> -  var values = ctx.list("");
> -  while(values.hasMore()) {
> +var ctx = new javax.naming.InitialContext(p);
> +var varList = [];
> +var values = ctx.list("");
> +while(values.hasMore()) {
>      var pair = values.next();
>      varList.push(pair.getName());
> -  }
> -  varList.join(", ");
>  }
> +varList.join(", ");
> \ No newline at end of file
>
>
>

Re: svn commit: r1487582 - /tomee/tomee/trunk/tomee/tomee-webapp/src/main/webapp/app/js/templates/application-tab-console-sample.handlebars

Posted by Thiago Veronezi <th...@veronezi.org>.
Ah,
Now I know why it is working.

http://docs.oracle.com/javase/6/docs/technotes/guides/scripting/programmer_guide/#jsimport
>>Please note that "java" is a shortcut for "Packages.java". There are
equivalent shortcuts for javax, org, edu, com, net prefixes, so pratically
all *JDK platform classes* can be accessed *without* the "Packages" prefix.

[]s,
Thiago.



On Wed, May 29, 2013 at 2:36 PM, Romain Manni-Bucau
<rm...@gmail.com>wrote:

> For java. Yes but otherwise we need to import it (natively with
> importPackages(Packages.xxx) for rhino)
> Le 29 mai 2013 20:20, "Thiago Veronezi" <th...@veronezi.org> a écrit :
>
> > Hi Romain,
> >
> > It seems we don't need them.
> > Without the JavaImporter or importPackages, it works fine too.
> > I'm trying with Java 7. That brings the question: will it blend with Java
> > 6? :O)
> > I will test it shortly.
> >
> > []s,
> > Thiago.
> >
> >
> >
> > On Wed, May 29, 2013 at 2:11 PM, Romain Manni-Bucau
> > <rm...@gmail.com>wrote:
> >
> > > Hi Thiago,
> > >
> > > Why JavaImporter? importPackages(Packages.org.foo); works great
> > > Le 29 mai 2013 20:08, <tv...@apache.org> a écrit :
> > >
> > > > Author: tveronezi
> > > > Date: Wed May 29 18:07:55 2013
> > > > New Revision: 1487582
> > > >
> > > > URL: http://svn.apache.org/r1487582
> > > > Log:
> > > > -(cosmetic) simplify "sample script".
> > > >
> > > > Modified:
> > > >
> > > >
> > >
> >
> tomee/tomee/trunk/tomee/tomee-webapp/src/main/webapp/app/js/templates/application-tab-console-sample.handlebars
> > > >
> > > > Modified:
> > > >
> > >
> >
> tomee/tomee/trunk/tomee/tomee-webapp/src/main/webapp/app/js/templates/application-tab-console-sample.handlebars
> > > > URL:
> > > >
> > >
> >
> http://svn.apache.org/viewvc/tomee/tomee/trunk/tomee/tomee-webapp/src/main/webapp/app/js/templates/application-tab-console-sample.handlebars?rev=1487582&r1=1487581&r2=1487582&view=diff
> > > >
> > > >
> > >
> >
> ==============================================================================
> > > > ---
> > > >
> > >
> >
> tomee/tomee/trunk/tomee/tomee-webapp/src/main/webapp/app/js/templates/application-tab-console-sample.handlebars
> > > > (original)
> > > > +++
> > > >
> > >
> >
> tomee/tomee/trunk/tomee/tomee-webapp/src/main/webapp/app/js/templates/application-tab-console-sample.handlebars
> > > > Wed May 29 18:07:55 2013
> > > > @@ -1,22 +1,15 @@
> > > >  // Sample script
> > > > -var myImports = new JavaImporter(
> > > > -  java.util.Properties,
> > > > -  javax.naming.InitialContext
> > > > -);
> > > > +var p = new java.util.Properties();
> > > > +p.put("java.naming.factory.initial",
> > > > "org.apache.openejb.client.RemoteInitialContextFactory");
> > > > +p.put("java.naming.provider.url", "http://localhost:8080/tomee/ejb
> ");
> > > > +p.put("java.naming.security.principal", "tomee");
> > > > +p.put("java.naming.security.credentials", "tomee");
> > > >
> > > > -with (myImports) {
> > > > -  var p = new Properties();
> > > > -  p.put("java.naming.factory.initial",
> > > > "org.apache.openejb.client.RemoteInitialContextFactory");
> > > > -  p.put("java.naming.provider.url",
> > > > "{{protocol}}://localhost:{{port}}/tomee/ejb");
> > > > -  p.put("java.naming.security.principal", "{{name}}");
> > > > -  p.put("java.naming.security.credentials", "{{password}}");
> > > > -
> > > > -  var ctx = new InitialContext(p);
> > > > -  var varList = [];
> > > > -  var values = ctx.list("");
> > > > -  while(values.hasMore()) {
> > > > +var ctx = new javax.naming.InitialContext(p);
> > > > +var varList = [];
> > > > +var values = ctx.list("");
> > > > +while(values.hasMore()) {
> > > >      var pair = values.next();
> > > >      varList.push(pair.getName());
> > > > -  }
> > > > -  varList.join(", ");
> > > >  }
> > > > +varList.join(", ");
> > > > \ No newline at end of file
> > > >
> > > >
> > > >
> > >
> >
>

Re: svn commit: r1487582 - /tomee/tomee/trunk/tomee/tomee-webapp/src/main/webapp/app/js/templates/application-tab-console-sample.handlebars

Posted by Romain Manni-Bucau <rm...@gmail.com>.
For java. Yes but otherwise we need to import it (natively with
importPackages(Packages.xxx) for rhino)
Le 29 mai 2013 20:20, "Thiago Veronezi" <th...@veronezi.org> a écrit :

> Hi Romain,
>
> It seems we don't need them.
> Without the JavaImporter or importPackages, it works fine too.
> I'm trying with Java 7. That brings the question: will it blend with Java
> 6? :O)
> I will test it shortly.
>
> []s,
> Thiago.
>
>
>
> On Wed, May 29, 2013 at 2:11 PM, Romain Manni-Bucau
> <rm...@gmail.com>wrote:
>
> > Hi Thiago,
> >
> > Why JavaImporter? importPackages(Packages.org.foo); works great
> > Le 29 mai 2013 20:08, <tv...@apache.org> a écrit :
> >
> > > Author: tveronezi
> > > Date: Wed May 29 18:07:55 2013
> > > New Revision: 1487582
> > >
> > > URL: http://svn.apache.org/r1487582
> > > Log:
> > > -(cosmetic) simplify "sample script".
> > >
> > > Modified:
> > >
> > >
> >
> tomee/tomee/trunk/tomee/tomee-webapp/src/main/webapp/app/js/templates/application-tab-console-sample.handlebars
> > >
> > > Modified:
> > >
> >
> tomee/tomee/trunk/tomee/tomee-webapp/src/main/webapp/app/js/templates/application-tab-console-sample.handlebars
> > > URL:
> > >
> >
> http://svn.apache.org/viewvc/tomee/tomee/trunk/tomee/tomee-webapp/src/main/webapp/app/js/templates/application-tab-console-sample.handlebars?rev=1487582&r1=1487581&r2=1487582&view=diff
> > >
> > >
> >
> ==============================================================================
> > > ---
> > >
> >
> tomee/tomee/trunk/tomee/tomee-webapp/src/main/webapp/app/js/templates/application-tab-console-sample.handlebars
> > > (original)
> > > +++
> > >
> >
> tomee/tomee/trunk/tomee/tomee-webapp/src/main/webapp/app/js/templates/application-tab-console-sample.handlebars
> > > Wed May 29 18:07:55 2013
> > > @@ -1,22 +1,15 @@
> > >  // Sample script
> > > -var myImports = new JavaImporter(
> > > -  java.util.Properties,
> > > -  javax.naming.InitialContext
> > > -);
> > > +var p = new java.util.Properties();
> > > +p.put("java.naming.factory.initial",
> > > "org.apache.openejb.client.RemoteInitialContextFactory");
> > > +p.put("java.naming.provider.url", "http://localhost:8080/tomee/ejb");
> > > +p.put("java.naming.security.principal", "tomee");
> > > +p.put("java.naming.security.credentials", "tomee");
> > >
> > > -with (myImports) {
> > > -  var p = new Properties();
> > > -  p.put("java.naming.factory.initial",
> > > "org.apache.openejb.client.RemoteInitialContextFactory");
> > > -  p.put("java.naming.provider.url",
> > > "{{protocol}}://localhost:{{port}}/tomee/ejb");
> > > -  p.put("java.naming.security.principal", "{{name}}");
> > > -  p.put("java.naming.security.credentials", "{{password}}");
> > > -
> > > -  var ctx = new InitialContext(p);
> > > -  var varList = [];
> > > -  var values = ctx.list("");
> > > -  while(values.hasMore()) {
> > > +var ctx = new javax.naming.InitialContext(p);
> > > +var varList = [];
> > > +var values = ctx.list("");
> > > +while(values.hasMore()) {
> > >      var pair = values.next();
> > >      varList.push(pair.getName());
> > > -  }
> > > -  varList.join(", ");
> > >  }
> > > +varList.join(", ");
> > > \ No newline at end of file
> > >
> > >
> > >
> >
>

Re: svn commit: r1487582 - /tomee/tomee/trunk/tomee/tomee-webapp/src/main/webapp/app/js/templates/application-tab-console-sample.handlebars

Posted by Thiago Veronezi <th...@veronezi.org>.
Hi Romain,

It seems we don't need them.
Without the JavaImporter or importPackages, it works fine too.
I'm trying with Java 7. That brings the question: will it blend with Java
6? :O)
I will test it shortly.

[]s,
Thiago.



On Wed, May 29, 2013 at 2:11 PM, Romain Manni-Bucau
<rm...@gmail.com>wrote:

> Hi Thiago,
>
> Why JavaImporter? importPackages(Packages.org.foo); works great
> Le 29 mai 2013 20:08, <tv...@apache.org> a écrit :
>
> > Author: tveronezi
> > Date: Wed May 29 18:07:55 2013
> > New Revision: 1487582
> >
> > URL: http://svn.apache.org/r1487582
> > Log:
> > -(cosmetic) simplify "sample script".
> >
> > Modified:
> >
> >
> tomee/tomee/trunk/tomee/tomee-webapp/src/main/webapp/app/js/templates/application-tab-console-sample.handlebars
> >
> > Modified:
> >
> tomee/tomee/trunk/tomee/tomee-webapp/src/main/webapp/app/js/templates/application-tab-console-sample.handlebars
> > URL:
> >
> http://svn.apache.org/viewvc/tomee/tomee/trunk/tomee/tomee-webapp/src/main/webapp/app/js/templates/application-tab-console-sample.handlebars?rev=1487582&r1=1487581&r2=1487582&view=diff
> >
> >
> ==============================================================================
> > ---
> >
> tomee/tomee/trunk/tomee/tomee-webapp/src/main/webapp/app/js/templates/application-tab-console-sample.handlebars
> > (original)
> > +++
> >
> tomee/tomee/trunk/tomee/tomee-webapp/src/main/webapp/app/js/templates/application-tab-console-sample.handlebars
> > Wed May 29 18:07:55 2013
> > @@ -1,22 +1,15 @@
> >  // Sample script
> > -var myImports = new JavaImporter(
> > -  java.util.Properties,
> > -  javax.naming.InitialContext
> > -);
> > +var p = new java.util.Properties();
> > +p.put("java.naming.factory.initial",
> > "org.apache.openejb.client.RemoteInitialContextFactory");
> > +p.put("java.naming.provider.url", "http://localhost:8080/tomee/ejb");
> > +p.put("java.naming.security.principal", "tomee");
> > +p.put("java.naming.security.credentials", "tomee");
> >
> > -with (myImports) {
> > -  var p = new Properties();
> > -  p.put("java.naming.factory.initial",
> > "org.apache.openejb.client.RemoteInitialContextFactory");
> > -  p.put("java.naming.provider.url",
> > "{{protocol}}://localhost:{{port}}/tomee/ejb");
> > -  p.put("java.naming.security.principal", "{{name}}");
> > -  p.put("java.naming.security.credentials", "{{password}}");
> > -
> > -  var ctx = new InitialContext(p);
> > -  var varList = [];
> > -  var values = ctx.list("");
> > -  while(values.hasMore()) {
> > +var ctx = new javax.naming.InitialContext(p);
> > +var varList = [];
> > +var values = ctx.list("");
> > +while(values.hasMore()) {
> >      var pair = values.next();
> >      varList.push(pair.getName());
> > -  }
> > -  varList.join(", ");
> >  }
> > +varList.join(", ");
> > \ No newline at end of file
> >
> >
> >
>