Return-Path: Delivered-To: apmail-ant-user-archive@www.apache.org Received: (qmail 33336 invoked from network); 1 Aug 2007 06:51:48 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 1 Aug 2007 06:51:48 -0000 Received: (qmail 99819 invoked by uid 500); 1 Aug 2007 06:51:44 -0000 Delivered-To: apmail-ant-user-archive@ant.apache.org Received: (qmail 99689 invoked by uid 500); 1 Aug 2007 06:51:43 -0000 Mailing-List: contact user-help@ant.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "Ant Users List" Reply-To: "Ant Users List" Delivered-To: mailing list user@ant.apache.org Received: (qmail 99678 invoked by uid 99); 1 Aug 2007 06:51:43 -0000 Received: from Unknown (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 31 Jul 2007 23:51:43 -0700 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: local policy) Received: from [193.109.238.66] (HELO dnsinet.rzf-nrw.de) (193.109.238.66) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 01 Aug 2007 06:51:36 +0000 Received: from z011100.bk.fin.local (z011100.bk.fin.local [172.18.101.140]) by dnsinet.rzf-nrw.de (8.14.0/8.14.0) with ESMTP id l716pD4W000303 for ; Wed, 1 Aug 2007 08:51:13 +0200 Received: from z011034.bk.fin.local ([130.11.7.34]) by z011100.bk.fin.local with Microsoft SMTPSVC(6.0.3790.0); Wed, 1 Aug 2007 08:51:08 +0200 X-MimeOLE: Produced By Microsoft Exchange V6.5.7226.0 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Subject: AW: AW: AW: while-like structure in Ant Date: Wed, 1 Aug 2007 08:51:13 +0200 Message-ID: X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: AW: AW: while-like structure in Ant Thread-Index: AcfTmTdcPgjsANkUQom7APx2MbBG2wAadVvg From: To: X-OriginalArrivalTime: 01 Aug 2007 06:51:08.0089 (UTC) FILETIME=[5696AA90:01C7D408] X-Virus-Checked: Checked by ClamAV on apache.org Never tried instantiating conditions from javascript ... But basically these are java classes. So instantiate and set configure it myhttp =3D new Http(); myhttp.setUrl("a url adress"); Maybe we could set a project instance or something like that. Let's have a look at the sources [1,2] - yes. Http extends = ProjectComponent. So set the project reference so that Http could access properties and = the logger system. myhttp.setProject( self.getProject() ); Then use the condition [3] if (myhttp.eval()) {... I havent tested these lines, so maybe you have to tweak javascript a = little bit. Jan [1] = http://svn.apache.org/repos/asf/ant/core/trunk/src/main/org/apache/tools/= ant/taskdefs/condition/Http.java [2] = http://svn.apache.org/repos/asf/ant/core/trunk/src/main/org/apache/tools/= ant/ProjectComponent.java [3] = http://svn.apache.org/repos/asf/ant/core/trunk/src/main/org/apache/tools/= ant/taskdefs/condition/Condition.java =20 >-----Urspr=FCngliche Nachricht----- >Von: Emir Mahmut BAHSI [mailto:embahsi@yahoo.com]=20 >Gesendet: Dienstag, 31. Juli 2007 19:35 >An: Ant Users List >Betreff: Re: AW: AW: while-like structure in Ant > >Thanks for the information Jan. I am using both 'http'=20 >condition and 'get' task in my problem. I really want to know=20 >how can I create an 'http' condition in the javascript code below? > >>>myhttp =3D project.createTask("http"); >>>myhttp.setUrl("a url address"); > >In the code above createTask is not appropriate I think since=20 >'http' is not a task. But how could I correct it? Any suggestion? > >Emir > >Jan.Materne@rzf.fin-nrw.de wrote: A condition is a different=20 >thing than a task >- a condition checks something >- a task does something. >Of course an implementing class maybe can do both ( ). > >For HTTP there are two different implementations: >- condition=20 >- task=20 >(- http AntLib http://ant.apache.org/antlibs/sandbox.html ) > > >Jan > > >>-----Urspr=FCngliche Nachricht----- >>Von: Emir Mahmut BAHSI [mailto:embahsi@yahoo.com]=20 >>Gesendet: Montag, 30. Juli 2007 23:34 >>An: Ant Users List >>Betreff: Re: AW: while-like structure in Ant >> >>It is a good point! Http task is one of the core conditions=20 >>that can be used as a nested element in condition task.=20 >>FYI: http://ant.apache.org/manual/CoreTasks/conditions.html >> >>However I do not know why it is not listed in the manual as a=20 >>core task :) May be it is because of being a nested element=20 >>for condition task (core condition). >> >>Emir M Bahsi >> >>Jan.Materne@rzf.fin-nrw.de wrote: Which task? Ant Core doesnt=20 >>have one. >> >>Jan >> >>>-----Urspr=FCngliche Nachricht----- >>>Von: Emir Mahmut BAHSI [mailto:embahsi@yahoo.com]=20 >>>Gesendet: Sonntag, 29. Juli 2007 00:27 >>>An: Ant Users List >>>Betreff: RE: while-like structure in Ant >>> >>>Sorry everybody for the late replay. I am trying to implement=20 >>>that while structure as I explained before. I am using=20 >>>javascript for that. However, I can not create a http task in=20 >>>javascript code. That part of the code is: >>> >>>myhttp =3D project.createTask("http"); >>>myhttp.setUrl("a url address"); >>> >>>The error is: javax.script.ScriptException:=20 >>>sun.org.mozilla.javascript.internal.EcmaError: TypeError:=20 >>>Cannot call method "setUrl" of null <#5> in=20 >>> at line number 5 >>> >>>Any help is appreciated. Thanks in advance. >>> >>>Emir Mahmut Bahsi >>> >>> >>> >>> >>> >>> >>>"Rebhan, Gilbert" wrote: =20 >>>-----Original Message----- >>>From: Xavier Hanin [mailto:xavier.hanin@gmail.com]=20 >>>Sent: Thursday, May 10, 2007 9:17 AM >>>To: Ant Users List >>>Subject: Re: while-like structure in Ant >>> >>>On 5/10/07, Emir Mahmut BAHSI wrote: >>>> >>>> Hi all, >>>> I have been working on conditional structures and loop=20 >structures on >>>> existing workflow managers for a long time. For this purpose I have >>>> implemented two simple examples for if-type and switch-type cases >>>(examples >>>> are attached). In these examples my program is simply downloading a >>>file. If >>>> that file does not exist in the first web address it tries another >>>address. >>>> However, I could not implement a loop structure for that.=20 >>In the loop >>>case >>>> the program should try the same address until the file exists. >>>Actually I >>>> know this is not a reasonable and useful scenario but I=20 >just want to >>>show >>>> whether a conditional-loop scenario can be implemented in Ant. >>>> >>>> Can u suggest me anything to implement that example. Any help is >>>> appreciated. >>> >>>/* >>>The ant-contrib project is providing conditional tasks which=20 >may help, >>>but >>>if you want to have your own syntax and the very specific url >>>availability >>>as a condition (like you wrote), maybe using a script (using=20 >scriptdef >>>for >>>example) would be a good fit. >>>*/ >>> >>>+1 >>> >>>i would go via and a scripting language running in >>>BSF >>>(JRuby, Groovy, Beanshell ... ) >>> >>>or use the AntBuilder@Groovy >>> >>>see =3D >>>http://groovy.codehaus.org/ >>>http://www.bytemycode.com/snippets/snippet/475/ >>> >>>Regards, Gilbert >>> >>> >>> >>>--------------------------------------------------------------------- >>>To unsubscribe, e-mail: user-unsubscribe@ant.apache.org >>>For additional commands, e-mail: user-help@ant.apache.org >>> >>> >>> >>> =20 >>>--------------------------------- >>>Take the Internet to Go: Yahoo!Go puts the Internet in your=20 >>>pocket: mail, news, photos & more.=20 >>> >> >>--------------------------------------------------------------------- >>To unsubscribe, e-mail: user-unsubscribe@ant.apache.org >>For additional commands, e-mail: user-help@ant.apache.org >> >> >> >> =20 >>--------------------------------- >>Building a website is a piece of cake.=20 >>Yahoo! Small Business gives you all the tools to get online. >> > >--------------------------------------------------------------------- >To unsubscribe, e-mail: user-unsubscribe@ant.apache.org >For additional commands, e-mail: user-help@ant.apache.org > > > > =20 >--------------------------------- >Pinpoint customers who are looking for what you sell.=20 > --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscribe@ant.apache.org For additional commands, e-mail: user-help@ant.apache.org