Hello,
I wrote drush commands to import Salesforce content, so this can be done on command line and via scripts.
Features :
- Shows available fieldmaps ;
- Shows row information about fieldmaps (number of existing linked nodes, number of available rows on Salesforce for an import) ;
- Option to only import new rows, or only import existing rows ;
- Can define an import start and count to only import subsets of the rows ;
- Can compare Salesforce LastModifiedDate and Drupal changed date to only import rows with a more recent modified date.
Drush .inc file is attached. Let me know if you think this is useful and could be added to salesforce ; otherwise I could package it as it's own module.
| Comment | File | Size | Author |
|---|---|---|---|
| #4 | sf_import.drush_.inc_.3.txt | 8.57 KB | Alice Heaton |
| #1 | sf_import.drush_.inc_.2.txt | 8.58 KB | Alice Heaton |
| sf_import.drush_.inc_.txt | 7.72 KB | Alice Heaton |
Comments
Comment #1
Alice Heaton commentedUpdated version :
- Fixed typos ;
- Better error management ;
- More information when showing a fieldmap.
Comment #2
kostajh commentedHello, I tested this out.
sf-fieldmapandsf-fieldmapscommands were useful. I'd suggest renaming one of them for clarity though.The code for
sf-importassumes that we are importing nodes. The code should check to see what object type is defined in the fieldmap and use that.Nice work!
Comment #3
kostajh commentedComment #4
Alice Heaton commentedHi, thanks for your feedback !
I've removed the second. sf-fieldmap now displays the list of available fieldmaps if not given an argument, and the information about a specific fieldmap if that fieldmap key is given as argument. Let me know what you think about this change.
Let me know if this now works well for non-node types.
Comment #5
kostajh commentedI'll try to take a look at this next week, thank you for your work on this!
Has anyone else had a chance to review?
Comment #6
kostajh commentedI reviewed this code and it looks good although I haven't had a chance to test it. Thank you for working on this to handle users and other entities in addition to nodes.
For readability and clarity I would still suggest changing references from $nid to $oid, i.e. in this section
change that to something like:
And make corresponding changes throughout the code.
Finally, if you can format this as a patch, that would be helpful too, see the instructions here: https://drupal.org/node/141315/git-instructions/6.x-2.x
Has anyone had a chance to test this?
Comment #7
kostajh commentedI made the changes from comment #6 and dropped the "linked" option since linking happens in sf_node_import and sf_user_import. Thank you for your work on this, it's a great feature to have!
Committed to 6.x-2.x-dev: http://drupalcode.org/project/salesforce.git/commit/f6b3cd5
Comment #8
kostajh commented