Zimbra offers Open Source email server software and shared calendar for Linux and the Mac
  #1 (permalink)  
Old 09-29-2005, 01:03 AM
Junior Member
 
Join Date: Sep 2005
Location: Kent, UK
Posts: 4
xiris is on a distinguished road
Default AjaxTK examples

I have just downloaded the latest milestone 3.0M1 and am trying to get the AjaxTK examples to work.

I don't have a jsp server up and running so I converted the pages to PHP. The JSP files seemed to only be used to import other jsp's and setup the initial js environment (?).

I can now run the examples pretty much as expected. However, none of the images show up.

Is there an way to obtain the html that is generated by the toolkit to see where it is trying to get the images from?

Any other suggestions would be welcome.

I would also like to congratulate you on an excellent piece of work and thank you for making is OSS. I would also like to second the request for making your AjaxTK a seperately available download (I can see so much potential!).

regards,
Jon

Last edited by xiris : 01-17-2006 at 02:17 AM.
Reply With Quote
  #2 (permalink)  
Old 09-29-2005, 10:46 AM
Junior Member
 
Join Date: Sep 2005
Posts: 3
monas is on a distinguished road
Default How about error_log?

How about checking web server's error log to see where browser expects to find graphic files?
Reply With Quote
  #3 (permalink)  
Old 09-29-2005, 03:36 PM
Zimbra Employee
 
Join Date: Aug 2005
Location: San Mateo, CA
ZCS Version: Zimbra.latest ;)
Posts: 4,782
KevinH is on a distinguished road
Default

The images and their css are generated at build time. So to make it work corrently you really need to use the included code. Bascilly setup a tomcat server and run the deploy target inthe Ajax/build.xml project.
Reply With Quote
  #4 (permalink)  
Old 09-30-2005, 03:28 AM
Junior Member
 
Join Date: Sep 2005
Location: Kent, UK
Posts: 4
xiris is on a distinguished road
Default

Quote:
Originally Posted by KevinH
The images and their css are generated at build time. So to make it work corrently you really need to use the included code. Bascilly setup a tomcat server and run the deploy target inthe Ajax/build.xml project.
I am attempting to run with PHP instead of JSP so I don't have Tomcat up and running. How can I build the CSS and images without using Tomcat?

Or can I only do it through deploying with Tomcat and then copying the constructed css and images?

thanks,
Jon
Reply With Quote
  #5 (permalink)  
Old 09-30-2005, 03:58 AM
Junior Member
 
Join Date: Sep 2005
Location: Kent, UK
Posts: 4
xiris is on a distinguished road
Default

Success!!

I have succeeded in getting the examples to work with PHP properly
For those interested here is how I did it...

I used Ant to build the Ajax toolkit and then copied the contents of the Ajax/build/WebRoot directory to my website directory. This copied a across the generated files that where missing. I then converted the JSP pages to PHP and let it run. At this point the examples still didn't work but a little look at the Javascript console told me it couldn't find the AjxCore (plus a few others). Lo and behold the Ajax build folder I copied across only seemed to contain the bits of AjaxTK that it had built and not the core js files etc (I guess they are put in the war file only?).

So I went back to my downloaded source and copied across the directories in Ajax/WebRoot/js. This provided me with the rest of the toolkit and the examples now work as expected.

I hope this help people.

regards,
Jon
Reply With Quote
  #6 (permalink)  
Old 09-30-2005, 08:41 AM
Zimbra Employee
 
Join Date: Aug 2005
Location: San Mateo, CA
ZCS Version: Zimbra.latest ;)
Posts: 4,782
KevinH is on a distinguished road
Default

Perfect. Yes I should have been clearer. You must use ant to build the images. Then your PHP code will work. Gald you got it working.
Reply With Quote
  #7 (permalink)  
Old 10-05-2005, 06:42 AM
Junior Member
 
Join Date: Oct 2005
Posts: 6
Chouser is on a distinguished road
Default Details for running without JSP

Thanks to everyone who helped me get this far. Here is what I did to get the examples to run without Java:
  1. Unpack the sources
  2. cd zcs/Ajax
  3. ant war # this puts some generated files into build/WebRoot
  4. yes no | cp -ri WebRoot/js build/WebRoot/ # copy non generated files
  5. Add a link so that a URL starting with /ajax points to your build/WebRoot dir:
    1. If you are using Apache, add something like this to your config: Alias /ajax/ <path to zcs>/Ajax/build/WebRoot/
    2. If you want to use file: urls, you can add a symlink to your filesystem root: ln -s <path to zcs>/Ajax/build/WebRoot /ajax
  6. In each example directory, run jsp2html.pl on the .jsp file to generate non-JSP HTML. For example: ( cd build/WebRoot/examples/tree/; jsp2html.pl TreeExample.jsp > index.html )

Here is my jsp2html.pl. Pretty ugly, but it works for these simple examples:

Code:
#!/usr/bin/perl -w
use strict;

sub process
{
  my ( $fname ) = @_;
  my $fdata;
  {
    open F, $fname or die "Failed to open $fname: $!";
    undef $/;
    $fdata = <F>;
    close F;
  }

  $fdata =~ s{<%= *contextPath *%>}{../..}g;
  $fdata =~ s{<fmt:message key="DwtMsg"[^>]*>}{../../js/dwt/config/msgs/DwtMsg_en.js}g;
  $fdata =~ s{<fmt:message key="AjxMsg"[^>]*>}{../../js/config/msgs/AjxMsg_en.js}g;
  $fdata =~ s{<(%.*?%)>}{<!--$1-->}sg;
  $fdata =~ s{<jsp:include *page="([^"]*)" */>}{ process( $1 ) }ge;

  return "<!-- BEGIN $fname ($0) -->\n$fdata\n<!-- END $fname -->\n";
}

print process( $ARGV[0] )
Reply With Quote
  #8 (permalink)  
Old 10-07-2005, 05:12 AM
Junior Member
 
Join Date: Oct 2005
Location: Brussels
Posts: 1
Bruno R is on a distinguished road
Default

Could someone provides us with the content of the Ajax/build/WebRoot directory ? I don't have ant nor be able to reproduce what you've done

Thanx
Reply With Quote
  #9 (permalink)  
Old 10-07-2005, 11:02 AM
Zimbra Employee
 
Join Date: Aug 2005
Location: San Mateo, CA
ZCS Version: Zimbra.latest ;)
Posts: 4,782
KevinH is on a distinguished road
Default

Quote:
Originally Posted by Bruno R
Could someone provides us with the content of the Ajax/build/WebRoot directory ? I don't have ant nor be able to reproduce what you've done

Thanx
FYI you can get ANT here: http://ant.apache.org/
Reply With Quote
  #10 (permalink)  
Old 10-12-2005, 09:26 AM
Junior Member
 
Join Date: Oct 2005
Location: San Jose
Posts: 5
hnkang is on a distinguished road
Default

I'd really appreciate if someone would provide details on using Eclipse to build the project.
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
JSP Tag Library for AjaxTK? dsmalley Developers 3 10-28-2005 08:51 AM


freshmeat.net sourceforge.net The best Java IDE



 

Search Engine Optimization by vBSEO 3.1.0