ECS returns some interesting meta data about the items. It would be cool if we could automatically fill a taxonomy with the meta data.
e.g. For a book, enter the author name into the taxonomy, relating the newly entered node with it. That could let you have a taxonomy for Authors, you could browse authors whose books are listed on the site and get a listing of those books for each author.
Comments
Comment #1
reikiman commentedI did some investigation and have a start on this.
At the end of amazon_insert I put this code:
I understand now that $terms['tags'] needs to be an array where the key is the vocab ID, and the value is the author name. The above code uses the wrong key but it does cause vocabulary items to be inserted into the correct table.
The next step, as I mention, is to look up the vocab ID for the vocabulary to use.
Comment #2
Prometheus6 commentedThat's easy.
http://drupaldocs.org/api/head/function/taxonomy_get_vocabularies
Understand though that this is so very site-specific that it will not ever be added to amazon.module.
Comment #3
reikiman commentedI think the feature itself is not site-specific at all. It's about organizing the things on your site, and one obvious organization for the amazon nodes is a listing of all products made by a certain author/artist/director/etc.
What I see as the issue is how to implement this so a) a site administrator controls whether this is done at all, and b) the site administrator controls which vocabulary is autofilled this way.
The place to control that is administer/settings/amazon
I'll discuss what I have in mind just for the Author metadata. The same pattern could be used for artist, director, etc.
First the administrator would make a vocabulary for "amazon" and "amazon node" that supports free tagging and is named e.g. "Authors".
Second in administer/settings/amazon they click a checkbox saying "YES, do autofilling" and then next to the checkbox is a list of vocabularies. They select the vocabulary from that list into which to auto-insert author names.
Comment #4
Prometheus6 commentedFine. Your opinion. But it will not be added to the project.
Comment #5
Prometheus6 commentedLet me suggest you create a seperate module, using hook_nodeapi() to do the taxinomy inserts.
Write one that works properly and if you like I'll add it to the project and credit you appropriately.
Comment #6
reikiman commentedWell, I've written one. But it's not going to work. Though the problem seems to be in the taxonomy module.
The issue is that taxonomy_nodeapi is called after my code with op=update. That causes a call to taxonomy_node_save and the first thing done is to call taxonomy_node_del which wipes out the already existing terms which my code inserted.
I'd like to point out this request is essentially the same as http://drupal.org/node/38230
There the person is saying they'd like to show more data ... and I agree fully with that statement and the intent. In this issue request I'm focusing on just the one piece of extra data (author/artist/etc taxonomy) but there's much more to do.
My point is that none of the amazon products stand alone. No ASIN is an island.
Comment #7
reikiman commentedI spoke a little too soon on the previous note. Here's a function which does work:
The obvious problem with this code is the hardwired vocabulary ID. Obvious solution is to implement a settings page, let the user select a vocabulary to autopopulate, and then retrieve that vocabulary ID in this function.
Comment #8
Prometheus6 commentedGood. Now you're going to think I'm rude, but you need some clarity here.
I'd like to point out I haven't done a damn thing with that request, and will not. Look at that list...I have addressed no feature requests, and will not.
Understand, you add code to my module and it becomes something I agree to support. Even worse, it opens the floodgates for free software requests. I know what I'm willing to support, and that's what I release. I do not respond to feature requests on GPL software that I release. It's not personal; nor is it negotiable. And it's really not democratic...in fact, the more frequently or insistently I am asked (or demanded, like "you know what I'd like ASAP?") the ruder and quicker my responses get.
...which I will not do for free. It's not a life mission, it's GPL software.
You want to keep the item open, knock yourself out...that's why it's GPL. You want to complete your module and it works fine...I have no problem with an add-on directory of modules that I am not supporting. But I just went through a thing where someone modified one of my modules, asked for help and it turned out to be in the portion thisperson modified...which the person conveniently did not mention before asking for help
Comment #9
solipsist commentedreikiman: Since it's GPL you're welcome to split your own branch or you can help prometheus6 maintain this project, if he's ok with it.
There are enough amazon modules as it is so best thing would be if someone could step up and help maintain this project so that features can be added and bugs fixed. You can't expect people to work for free so people do as much as they like, but I see no reason not to implement reikiman's ideas within the scope of this project if he's interested in providing support for his code.
Comment #10
reikiman commentedI just wanted to clarify my position. I wasn't expecting anybody to work for me for free. I'm perfectly capable of implementing the work I've filed RFE's on, and am willing to do so. On the other hand if someone is inspired to do one of the features I mentioned, that would be wonderful.
So far the response I've gotten from prometheus6 hasn't been very positive or open.
In the past I wrote a nice java/servlet thingy that pulled Amazon AWS data and automatically linked up all the related products etc. I'm interested in recreating that in Drupal if possible. Well, the parts that make sense anyway.
While there are several amazon modules, only one has made the transition to 4.7.
I am an experienced developer with around 33 years experience with dozens of languages. So doing a few little features for this module isn't a problem for me. The main blocker is that, despite having requested CVS access twice, it hasn't been granted. Any ideas?
Comment #11
Prometheus6 commentedI noted as much. Told you where to find the function you need to identify the vocabularies associated with a node type. I also didn't let you think it would be added to amazon.module and why, though it could be added as a seperate module that works with it. I think that's all quite helpful. And given that I've actually gotten angry in the past over people insisting on free code in obnoxious ways I've developed the practice of making my own position clear immediately.
Yes, only one Amazon module made the transition to 4.7. It does adhere to Drupal standards so it's extensible by other modules...the code is GPL so you can use it pretty much as you see fit. If you're writing code to solve problems, that should be enough.
If you're trying to get write access to cvs, I'm not the one to impress...I'm in the network more than in the community. I can tell you if was original functionality, the Live Discussions and Comment Closer modules that got me write access. They had no idea I was going to do Amazon stuff at all.
If amazon.module is just cool enough that you want to associate with it personally, you should realize it is considered very bad form to commit changes to code someone else is actively maintaining.
Understand I've provided to basic node types...data about books and discussion about books...and no more in order to have maximum compatibility and ability to upgrade between versions. There are any number of modules to organize your site, from categories.module to various taxonomy based modules, and amazon.module as it stands works with all of them.
Now the views.module is popular. I haven't checked it out yet, but Eaton wrote up an include file that is called when you call views.module, changes like one line in amazon.module. Pure added functionality with zero impact, even so far as a configuration option, on folks who don't use it. And the Content Construction Kit may reduce amazon.module to a couple of field types.
See why it's the KISS principle up in here?
You got bugs? Tell me about bugs in the functionality I offer. You can't find one that lasted more than a few days.
You got functionality you want to add? I'll advise you if you get stuck building your module.
Comment #12
solipsist commentedSo reikiman would need to fork your CVS, sure, that works I bet but why have two modules with almost identical features hosted here at drupal.org? Wouldn't it be smarter if you two went in together on this and added to each other's work? If Promotheus6 has reservations about adding features and supporting them let reikiman be responsible for the code he adds and changes.
I think this module has great potential and since someone is willing to work on it, and add new features and providing support for those new features, it I see no reason to deny him that, doesn't sound very collaborative to me. Just my 2 cents...
Comment #13
Prometheus6 commentedComment #14
hadishon commentedreikiman, I'm interested in the changes you propose. Please let me/us know if you get it working.
Comment #15
solipsist commentedOk, reikiman, if you fork this let me know because I'd also like to see more features. While I truly appreciate prom's work on this and releasing it to the public, I'd like to see a wider feature set. Not to mention having the module generate standards compliant markup.
Comment #16
reikiman commentedI haven't had time to work on this beyond the teensy addon module I posted above. Now that drupal 4.7 is final that raises the priority for me to work on my sites.
Comment #17
Prometheus6 commentedDoes not apply anymore