taskjuggler / TaskJuggler

TaskJuggler - Project Management beyond Gantt chart drawing
http://www.taskjuggler.org
GNU General Public License v2.0
733 stars 169 forks source link

[Feature Request] API Implementation #142

Open chris2fr opened 10 years ago

chris2fr commented 10 years ago

As a extension developer, I would like to access the creation, scheduling, import and export of TaskJuggler projects through an API in addition to the actual TJP parser in order to create, tweak, and test a TaskJuggler project from my program directly, and save what was produced somewhere (in a file perhaps).

chris2fr commented 10 years ago

It would seem to me that the finite-state-machine (or infinite state-machine perhaps) uses a lot of lamda functions that actually are linked to identifiable resources. Instead of referencing a lamda function at that point, perhaps we could put that code into a methode of the corresponding object and call that method from the state-machine?

scrapper commented 10 years ago

tj3d already provides and API for creating, scheduling and exporting of project data. Is that what you are looking for?

I'm not sure I understand your comment regarding the FSM. I assume you mean the parser FSM. What 'corresponding' object should that be? And what would be the benefit?

chris2fr commented 10 years ago

Thanks for the reply.

Yes I am referring to the parser FSM. The object of the API would be to create a project programmaticly as well as through the parser. tj3d, as far as I can tell, also uses the parser to instantiate the project. This makes sense.

There is one big disadvantage to this user story. I talk about the creation blocks of the functions, but I do not mention the regular expressions. The regular expression dictate in the FSM parser the types of creations (I think this be the case) in a context. Although the lambda functions can be delegated to methods, the regular expressions might need a synchronization between a factory object (I guess factory, but not really sure) and the regular expression that means the same thing. This would be not good, a bad source of error in manual transposing.

Now on to the advantages. I am currently revamping my redmine_taskjuggler plugin and am creating a whole representation in Rails of a taskjuggler project with pretty much the same structure as in lib/taskjuggler. I thought it'd be neat to create the objects in Taskjuggler as I went along. Conditional upon a potentially isomorphic to_s on the project that could be parsed, I thought hey, I can use the front-end to manipulate the taskjuggler objects. This way, I can check to see if the imput is correct in real time, when the end-user changes a value. There are other advantages I can see to having directish access to the TaskJuggler internals through an API.