![]() ![]() The FileMaker database has a field called "eid", which contains a unique ID for each employee. Once I had assembled an interface to upload the XML file, parsed the file using SimpleXML and saved each record's values into an array, I used a modified version of the above snippet to create the nodes. ![]() ![]() $form_state = 'robo-user' ĭrupal_execute('story_node_form', $form_state, (object)$node) Module_load_include('inc', 'node', 'node.pages') Finally, I stumbled across the following code snippet in the API documentation for drupal_execute(): // Create a new node ![]() For a long time, I couldn't figure out how to do this programmatically. The challenge lay in automatically importing the data from the XML file, creating new nodes for any new records, and updating any existing ones. Producing a basic module defining a new content type for directory entries was fairly straightforward. I was tasked with producing a Drupal module that would allow the office staff to export the directory data from FileMaker as an XML file, and then import it all into Drupal in one fell swoop. The office staff in charge of collecting this data have been storing it in a FileMaker Pro database for the last few years, which was entirely adequate to their needs. The head of the department wanted to publish that directory info to the Drupal-powered departmental web site, instead of distributing paper copies as they had been. Every semester, the office staff gather directory information for all the employees of the department: faculty, non-faculty teachers such as graduate students, staff, and so on. I work for an academic department at a large university. I've already solved my problem, and thought I would document it here so that future sufferers may have some hope of a solution via Google or similar. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |