Hi all.
I need help for a node module development, I'm a beginner in drupal...

My needs:
I have to develop a module allowing my client to create a node content by two different ways:
- form filling
- excel file parsing
Only admins and the user concerned by the node can view/edit it. This user is defined when the node is created by an admin.
The node can be viewed by two ways:
- a table
- a formatted pdf

The solution I choose:
after a long reflexion, I choose to develop my own module rather than using CCK and views (a mistake?). I've coded all the xls parsing and pdf generation stuffs but I've problems with the node system.

My problem(s):
I don't know how to create my node outside of the my_node_form function. I suppose I can call the hook_insert after having parsed my xsl file or on form submitting (two distinct functions) but I don't understand how to process.

Thinks for tour help, and I apologize for my poor english!

Comments

Ocyrhoé’s picture

Do I have to create a separed table (like in node example module), or Drupal handle it in default tables?

caligari’s picture

You can follow this steps implementing your content type:

1. hook_validate
2. hook_submit
3. hook_insert and hook_update

Review more handbook entries in developers section and review more "real" modules...

Good luck :-)

Ocyrhoé’s picture

After having taken an eye on node.module, I understand a little bit more...
Thinks.