diff --git a/pmd-web/src/webpmd.pl b/pmd-web/src/webpmd.pl index 049dadd22c..c199e45b0d 100644 --- a/pmd-web/src/webpmd.pl +++ b/pmd-web/src/webpmd.pl @@ -1,4 +1,5 @@ #!/usr/bin/perl +$| =1; use CGI qw(:standard escapeHTML); use CGI::Carp qw(fatalsToBrowser); @@ -10,23 +11,52 @@ sub nopage() { print $query->p("How'd we get here?"); } -sub printGreeting() { +sub default() { print start_html("Run PMD on your Sourceforge project"); + if (param("projectname")) { + addProject(param("projectname"), param("moduledirectory"), param("srcdir")); + print p(); + print b("Added that project to the schedule"); + } + print p("PMD is run hourly on these projects:"); + print p(loadProjectList()); + #print p("Stats:"); print p("Want to run PMD on your Sourceforge project? Fill in the blanks and hit go"); print start_form(); - print p(), "Project name (i.e., pmd): ", textfield('project'); - print p(), "Source directory (i.e., src): ", textfield('srcdir'); + print p(), "Project name (i.e., PMD): ", textfield(-name=>'projectname',-default=>'',-override=>1); + print p(), "Module directory (i.e., pmd): ", textfield(-name=>'moduledirectory',-default=>'',-override=>1); + print p(), "Source directory (i.e., pmd/src): ", textfield(-name=>'srcdir',-default=>'',-override=>1); my $cachebuster=`date`; print $query->hidden(-name=>'cachebuster', -value=>${cachebuster}); - print p(), submit(-name=>'state',-value=>'writedata'); + print p(), submit(-value=>'Go'); print end_form(); } -sub writeData() { - my $project = $query->param('project'); - my $srcdir = $query->param('srcdir'); - `echo "${project}:${srcdir}:" > runthis.txt`; - print start_html(-title=>'PMD Results', -head=>meta({-http_equiv=>'Refresh',-content=>'0;URL=http://pmd.sf.net/cgi-bin/webpmd.pl?state=refreshreport'})); +sub loadProjectList() { + my $result="
${jobtext} | "; + } + } + $result = "${result}