You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by "Ehlers, Kolja" <eh...@clinresearch.com> on 2008/07/24 13:34:58 UTC

Confirmation popup

Hi all,

we have an ant script enbedded in a perl cgi script. What I was wondering if
there is a possibility to open a javascript dialog box in ant. If the user
confirms with true the ant script will be executed for false the execution
stops.

Thanks alot

Kolja

Geschäftsführung: Dr. Michael Fischer, Reinhard Eisebitt
Amtsgericht Köln HRB 32356
Steuer-Nr.: 217/5717/0536
Ust.Id.-Nr.: DE 204051920
--
This email transmission and any documents, files or previous email
messages attached to it may contain information that is confidential or
legally privileged. If you are not the intended recipient or a person
responsible for delivering this transmission to the intended recipient,
you are hereby notified that any disclosure, copying, printing,
distribution or use of this transmission is strictly prohibited. If you
have received this transmission in error, please immediately notify the
sender by telephone or return email and delete the original transmission
and its attachments without reading or saving in any manner.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Re: Confirmation popup

Posted by Chad McHenry <mc...@gmail.com>.
This sounds more like a CGI / html question than an ant question.

It sounds as though you simply want a javascript confirm dialog on the page
where the users invokes the ant script.  How does that happen now, by
clicking a link in their browser?  If so have your CGI generate something
like this for the link:

<a href="http://www.example.com/mycgi.pl?antscript" onclick="return
confirm('Are you sure?')">Run the ant script</a>

The javascript "confirm" function shows an OK/Cancel dialog, returning true
or false respectively. If the code in the onclick attribute returns false,
the default behavior of the link does not happen - i.e. if the user clicks
false, the link is not followed, the browser does not follow the link's URL,
and your script is not run.



On Thu, Jul 24, 2008 at 9:07 AM, Ehlers, Kolja <eh...@clinresearch.com>
wrote:

> exactly I just call system "ant -f yourbuild.xml" and parse the output to a
> html file. I would love to use AntForms but thats the reason I think it
> wont
> work. I am not sure how the window is produced, but since there is no X
> installed on this server both antforms and the beanshell code is not
> working:
>
> No X11 DISPLAY variable was set, but this program performed an operation
> which requires it.
>
> Thanks
>
> -----Ursprungliche Nachricht-----
> Von: Rebhan, Gilbert [mailto:Gilbert.Rebhan@huk-coburg.de]
> Gesendet: Donnerstag, 24. Juli 2008 14:55
> An: Ant Users List
> Betreff: RE: Confirmation popup
>
>
>
> -----Original Message-----
> From: Ehlers, Kolja [mailto:ehlers@clinresearch.com]
> Sent: Thursday, July 24, 2008 2:30 PM
> To: Ant Users List
> Subject: AW: Confirmation popup
>
> /*
> Thanks Gilbert for your responds, thought I am wondering if this will
> work.
> Like I said the ant scripts output is redicted to a html web page. On
> this
> server there is not X Window installed at all. I guess this will not
> work
> then right?
>
> Any chance I can call a javascript confirm from ant?
> */
>
> how do you call ant  from perl ?
> means do you start a new shell and ant -f yourbuild.xml or do
> you make direct use of the ant api in your perl script  ?
>
> Why do you think the use of AntForms taskdef won't work ?
>
> If you don't want to use AntForms, another
> possibility is using <script> and something like =
>
> <script language="beanshell">
> <![CDATA[
>  import javax.swing.*;
>  int decision = JOptionPane.showConfirmDialog(null,
>  "Please decide ...", "choose one", JOptionPane.YES_NO_OPTION);
>  if (decision == JOptionPane.YES_OPTION) {
>     // User clicked YES.
>  } else if (decision == JOptionPane.NO_OPTION) {
>   // User clicked NO.
>
>  // or use fireBuildFinished ...
> // but that didn't work
> //  project.fireBuildFinished(BuildException e);
>
>  stop = project.createTask("fail");
>  stop.setMessage("No selected ... ");
>  stop.execute();
>  }
> ]]>
> </script>
>
>
>
> Regards, Gilbert
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
>
>
> Geschäftsführung: Dr. Michael Fischer, Reinhard Eisebitt
> Amtsgericht Köln HRB 32356
> Steuer-Nr.: 217/5717/0536
> Ust.Id.-Nr.: DE 204051920
> --
> This email transmission and any documents, files or previous email
> messages attached to it may contain information that is confidential or
> legally privileged. If you are not the intended recipient or a person
> responsible for delivering this transmission to the intended recipient,
> you are hereby notified that any disclosure, copying, printing,
> distribution or use of this transmission is strictly prohibited. If you
> have received this transmission in error, please immediately notify the
> sender by telephone or return email and delete the original transmission
> and its attachments without reading or saving in any manner.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
>
>

AW: Confirmation popup

Posted by "Ehlers, Kolja" <eh...@clinresearch.com>.
exactly I just call system "ant -f yourbuild.xml" and parse the output to a
html file. I would love to use AntForms but thats the reason I think it wont
work. I am not sure how the window is produced, but since there is no X
installed on this server both antforms and the beanshell code is not
working:

No X11 DISPLAY variable was set, but this program performed an operation
which requires it.

Thanks

-----Ursprungliche Nachricht-----
Von: Rebhan, Gilbert [mailto:Gilbert.Rebhan@huk-coburg.de]
Gesendet: Donnerstag, 24. Juli 2008 14:55
An: Ant Users List
Betreff: RE: Confirmation popup



-----Original Message-----
From: Ehlers, Kolja [mailto:ehlers@clinresearch.com]
Sent: Thursday, July 24, 2008 2:30 PM
To: Ant Users List
Subject: AW: Confirmation popup

/*
Thanks Gilbert for your responds, thought I am wondering if this will
work.
Like I said the ant scripts output is redicted to a html web page. On
this
server there is not X Window installed at all. I guess this will not
work
then right?

Any chance I can call a javascript confirm from ant?
*/

how do you call ant  from perl ?
means do you start a new shell and ant -f yourbuild.xml or do
you make direct use of the ant api in your perl script  ?

Why do you think the use of AntForms taskdef won't work ?

If you don't want to use AntForms, another
possibility is using <script> and something like =

<script language="beanshell">
<![CDATA[
 import javax.swing.*;
 int decision = JOptionPane.showConfirmDialog(null,
 "Please decide ...", "choose one", JOptionPane.YES_NO_OPTION);
  if (decision == JOptionPane.YES_OPTION) {
     // User clicked YES.
  } else if (decision == JOptionPane.NO_OPTION) {
   // User clicked NO.

 // or use fireBuildFinished ...
// but that didn't work
//  project.fireBuildFinished(BuildException e);

  stop = project.createTask("fail");
  stop.setMessage("No selected ... ");
  stop.execute();
  }
]]>
</script>



Regards, Gilbert




---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Gesch�ftsf�hrung: Dr. Michael Fischer, Reinhard Eisebitt
Amtsgericht K�ln HRB 32356
Steuer-Nr.: 217/5717/0536
Ust.Id.-Nr.: DE 204051920
--
This email transmission and any documents, files or previous email
messages attached to it may contain information that is confidential or
legally privileged. If you are not the intended recipient or a person
responsible for delivering this transmission to the intended recipient,
you are hereby notified that any disclosure, copying, printing,
distribution or use of this transmission is strictly prohibited. If you
have received this transmission in error, please immediately notify the
sender by telephone or return email and delete the original transmission
and its attachments without reading or saving in any manner.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


RE: Confirmation popup

Posted by "Rebhan, Gilbert" <Gi...@huk-coburg.de>.
 
-----Original Message-----
From: Ehlers, Kolja [mailto:ehlers@clinresearch.com] 
Sent: Thursday, July 24, 2008 2:30 PM
To: Ant Users List
Subject: AW: Confirmation popup

/*
Thanks Gilbert for your responds, thought I am wondering if this will
work.
Like I said the ant scripts output is redicted to a html web page. On
this
server there is not X Window installed at all. I guess this will not
work
then right?

Any chance I can call a javascript confirm from ant?
*/

how do you call ant  from perl ?
means do you start a new shell and ant -f yourbuild.xml or do
you make direct use of the ant api in your perl script  ?

Why do you think the use of AntForms taskdef won't work ?

If you don't want to use AntForms, another
possibility is using <script> and something like =

<script language="beanshell">
<![CDATA[
 import javax.swing.*;
 int decision = JOptionPane.showConfirmDialog(null,
 "Please decide ...", "choose one", JOptionPane.YES_NO_OPTION);
  if (decision == JOptionPane.YES_OPTION) {
     // User clicked YES.
  } else if (decision == JOptionPane.NO_OPTION) {
   // User clicked NO.

 // or use fireBuildFinished ...
// but that didn't work 
//  project.fireBuildFinished(BuildException e);

  stop = project.createTask("fail");
  stop.setMessage("No selected ... ");
  stop.execute();
  }
]]>
</script>



Regards, Gilbert




---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


AW: Confirmation popup

Posted by "Ehlers, Kolja" <eh...@clinresearch.com>.
Thanks Gilbert for your responds, thought I am wondering if this will work.
Like I said the ant scripts output is redicted to a html web page. On this
server there is not X Window installed at all. I guess this will not work
then right?

Any chance I can call a javascript confirm from ant?

Thanks again

-----Ursprungliche Nachricht-----
Von: Rebhan, Gilbert [mailto:Gilbert.Rebhan@huk-coburg.de]
Gesendet: Donnerstag, 24. Juli 2008 13:44
An: Ant Users List
Betreff: RE: Confirmation popup





-----Original Message-----
From: Ehlers, Kolja [mailto:ehlers@clinresearch.com]
Sent: Thursday, July 24, 2008 1:35 PM
To: user@ant.apache.org
Subject: Confirmation popup

/*
Hi all,

we have an ant script enbedded in a perl cgi script. What I was
wondering if
there is a possibility to open a javascript dialog box in ant. If the
user
confirms with true the ant script will be executed for false the
execution
stops.
*/

if you need UI based interaction use AntForms =

http://antforms.sourceforge.net/

Regards, Gilbert

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Gesch�ftsf�hrung: Dr. Michael Fischer, Reinhard Eisebitt
Amtsgericht K�ln HRB 32356
Steuer-Nr.: 217/5717/0536
Ust.Id.-Nr.: DE 204051920
--
This email transmission and any documents, files or previous email
messages attached to it may contain information that is confidential or
legally privileged. If you are not the intended recipient or a person
responsible for delivering this transmission to the intended recipient,
you are hereby notified that any disclosure, copying, printing,
distribution or use of this transmission is strictly prohibited. If you
have received this transmission in error, please immediately notify the
sender by telephone or return email and delete the original transmission
and its attachments without reading or saving in any manner.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


RE: Confirmation popup

Posted by "Rebhan, Gilbert" <Gi...@huk-coburg.de>.


-----Original Message-----
From: Ehlers, Kolja [mailto:ehlers@clinresearch.com] 
Sent: Thursday, July 24, 2008 1:35 PM
To: user@ant.apache.org
Subject: Confirmation popup

/*
Hi all,

we have an ant script enbedded in a perl cgi script. What I was
wondering if
there is a possibility to open a javascript dialog box in ant. If the
user
confirms with true the ant script will be executed for false the
execution
stops.
*/

if you need UI based interaction use AntForms =

http://antforms.sourceforge.net/

Regards, Gilbert

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org