AjaxTK examples

Have a great idea for extending Zimbra? Share ideas, ask questions, contribute, and get feedback.
xiris
Posts: 3
Joined: Fri Sep 12, 2014 9:56 pm

AjaxTK examples

Postby xiris » Thu Sep 29, 2005 3:03 am

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


monas
Posts: 2
Joined: Fri Sep 12, 2014 9:55 pm

AjaxTK examples

Postby monas » Thu Sep 29, 2005 12:46 pm

How about checking web server's error log to see where browser expects to find graphic files?
14319KevinH
Ambassador
Ambassador
Posts: 4558
Joined: Fri Sep 12, 2014 9:52 pm

AjaxTK examples

Postby 14319KevinH » Thu Sep 29, 2005 5:36 pm

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.
xiris
Posts: 3
Joined: Fri Sep 12, 2014 9:56 pm

AjaxTK examples

Postby xiris » Fri Sep 30, 2005 5:28 am

[quote user="14319KevinH"]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.[/QUOTE]
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
xiris
Posts: 3
Joined: Fri Sep 12, 2014 9:56 pm

AjaxTK examples

Postby xiris » Fri Sep 30, 2005 5:58 am

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
14319KevinH
Ambassador
Ambassador
Posts: 4558
Joined: Fri Sep 12, 2014 9:52 pm

AjaxTK examples

Postby 14319KevinH » Fri Sep 30, 2005 10:41 am

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.
4338Chouser
Posts: 6
Joined: Fri Sep 12, 2014 9:56 pm

AjaxTK examples

Postby 4338Chouser » Wed Oct 05, 2005 8:42 am

THANKS TO EVERYONE WHO HELPED ME GET THIS FAR. HERE IS WHAT I DID TO GET THE EXAMPLES TO RUN WITHOUT JAVA:


  • UNPACK THE SOURCES

  • CD ZCS/AJAX

  • ANT WAR # THIS PUTS SOME GENERATED FILES INTO BUILD/WEBROOT

  • YES NO | CP -RI WEBROOT/JS BUILD/WEBROOT/ # COPY NON GENERATED FILES

  • ADD A LINK SO THAT A URL STARTING WITH /AJAX POINTS TO YOUR BUILD/WEBROOT DIR:



  • IF YOU ARE USING APACHE, ADD SOMETHING LIKE THIS TO YOUR CONFIG: ALIAS /AJAX/ /AJAX/BUILD/WEBROOT/

  • IF YOU WANT TO USE FILE: URLS, YOU CAN ADD A SYMLINK TO YOUR FILESYSTEM ROOT: LN -S /AJAX/BUILD/WEBROOT /AJAX



  • 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:
#!/USR/BIN/PERL -W

USE STRICT;
SUB PROCESS

{

MY ( $FNAME ) = @_;

MY $FDATA;

{

OPEN F, $FNAME OR DIE "FAILED TO OPEN $FNAME: $!";

UNDEF $/;

$FDATA = ;

CLOSE F;

}
$FDATA =~ S{}{../..}G;

$FDATA =~ S{]*>}{../../JS/DWT/CONFIG/MSGS/DWTMSG_EN.JS}G;

$FDATA =~ S{]*>}{../../JS/CONFIG/MSGS/AJXMSG_EN.JS}G;

$FDATA =~ S{}{}SG;

$FDATA =~ S{}{ PROCESS( $1 ) }GE;
RETURN "N$FDATANN";

}
PRINT PROCESS( $ARGV[0] )
Bruno R
Posts: 1
Joined: Fri Sep 12, 2014 9:57 pm

AjaxTK examples

Postby Bruno R » Fri Oct 07, 2005 7:12 am

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 :mad:
Thanx
14319KevinH
Ambassador
Ambassador
Posts: 4558
Joined: Fri Sep 12, 2014 9:52 pm

AjaxTK examples

Postby 14319KevinH » Fri Oct 07, 2005 1:02 pm

[quote user="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 :mad:
Thanx[/QUOTE]
FYI you can get ANT here: http://ant.apache.org/
hnkang
Posts: 2
Joined: Fri Sep 12, 2014 9:58 pm

AjaxTK examples

Postby hnkang » Wed Oct 12, 2005 11:26 am

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

Return to “Developers”

Who is online

Users browsing this forum: Google [Bot] and 5 guests