powered by Jive Software

Task List

Hi people,

Any one has any idea if Spark’s Task List can be accessed programatically (by Java code) in a way that Events can be entered not only via Spark, but also dynamically via code? I managed to add a Task by using the Tasks and Task class, but there appears to be no field for the date of the task which is going to be inputted. Thus when a task is entered from code in this way, no date appears.

Any one has any idea how this can be done?

Thanks

Tasks tasks = new Tasks();
Task task = new Task();
task.setTitle("Title");
task.setDueDate( dueDate );
task.setCreatedDate( nowDate );
tasks.addTask(task);
Tasks.saveTasks(tasks, SparkManager.getConnection());

Hi Konstantin,

Thanks for your reply. Regarding:

task.setDueDate( dueDate );
task.setCreatedDate( nowDate );

According to the api these methods are not implemented: http://www.igniterealtime.org/builds/sparkplug_kit/docs/latest/api/index.html

Is it a problem if you give me the page of the api where you found them, since it would be great if they work! I just tried them and inserted a date of data type Date instead of dueDate and nowDate and even tried it with a String data type, and the setDueDate and setCreatedDate still seem to be pointing that they don’t exist :S

Thanks once again for your help.

API documentation of Spark is out of date. And this is really problem. You could generate last version using Spark sources and command :

ant documentation

This two methods uses long as params. you could use Date object

task.setDueDate( dueDate );
task.setCreatedDate( nowDate );

Thanks for your answer…

I am not using svn for Spark, but the jar files that I downloaded at the beginning when I started using Spark.

What do I have to do to update them? And could you please explain again from where I get see the updated documentation?

Thanks a lot for your support, it is much appreciated.

You need to download source files of spark (you could do this from svn). And build it using ant documentation.

what OS do you use for development ?

I use Windows for development. Is http://svn.igniterealtime.org/svn/repos/spark/trunk/ the svn website from where to download it? And is there the correct build.xml file to use ANT and build it?

Thanks!!

Forget about the previous post I managed to set it.

I managed to get around a long Data type, although it does not make much sense and is not user friendly.

if anyone wants to use it he/she has to declare it as follows:

Calendar calendar = new GregorianCalendar(2010,0,17); (2010 - year, 0 - month, 17 - day)

long dueDate = calendar.getTime().getTime();