Hi,
This my second post but I'm really lost with my project...
So, I've chosen the iCal4j library available here :
http://ical4j.sourceforge.net/
I want to create iCal using Java and PHP. This library is, according to me,
the best way ! There is a nice documentation :
http://ical4j.sourceforge.net/introduction.html and a complete API list.
I've tried to create iCal using the introduction.html of the Ben Fortuna's
website (http://ical4j.sourceforge.net/introduction.html) and I've failed t=
o
parse an ics file or create a simple icalendar object.
This is a copy of my test.php
<?php
java_require("/var/www/java/ical4j-testing/jar/ical4j.jar");
echo "Test de la librarie iCal4J";
echo "<hr>";
echo "Cr=E9ation d'un iCalendar";
// On cr=E9=E9 un nouvel objet Calendar - We create a new Calendar object
$calendar=3Dnew Java("net.fortuna.ical4j.model.Calendar");
// On cr=E9=E9 un nouvel objet objet ProdId avec le blabla qui suit - We cr=
eate
a new object ProdId
$prodid=3Dnew Java("net.fortuna.ical4j.model.property.ProdId","-//Clem//Pro=
ut
1.0//EN");
// On cr=E9e=E9 un nouvel objet Version - we create a new version object
$version=3Dnew Java("net.fortuna.ical4j.model.property.Version");
// Puis on lui met la valeur que l'on veut - We set a value to the object
$version->setValue("VERSION_2.0");
// On ajoute =E0 l'objet Calandar les propri=E9t=E9s - We add the propertie=
s to
the calendar object
$calendar->getProperties()->add($prodid);
$calendar->getProperties()->add($version);
$vevent =3D new Java("net.fortuna.ical4j.model.component.VEvent",(String)"2=
0051225T190000",(String)"20051225T220000",(String)"Christmas
Day");
// On cr=E9=E9 un objet calendar de sortie - We create an outputter calenda=
r
$outputter=3D new Java("net.fortuna.ical4j.data.CalendarOutputter");
// On cr=E9=E9 un objet de sortie - We create an output stream
$sortie=3Dnew Java("java.io.FileOutputStream","/tmp/test.ics");
// On utilise la methode output de la classe CalendarOutputter - We use the
ouput method
$outputter->output($calendar,$sortie);
?>
The test.php screenoutput is :
Test de la librarie iCal4J
------------------------------
Cr=E9ation d'un iCalendar
*Fatal error*: Uncaught [o(Exception):"java.lang.Exception: CreateInstance
failed: new net.fortuna.ical4j.model.component.VEvent((Date)o(String),
(Date)o(String), (String)o(String)). Cause:
java.lang.IllegalArgumentException: argument type mismatch"] thrown in *
/var/www/java/ical4j-testing/test.php* on line *25*
Can you help me ?
Could you say me how reproduce the simple examples of
http://ical4j.sourceforge.net/introduction.html with php-java-bridge ??
Many thanks in advance.
Regards.
Clement
--
Cl=E9ment Legrand
|