This Module imports information from CafePress into database tables in your drupal site.
It uses Your own userID and password from Cafepress and the CafePress api for this. So you will need to apply for a Key. So to get a key follow the getting started on this webpage http://developer.cafepress.com/docs/Getting_Started . This module does not format any information so you could view your cafepress products or storesections it only imports them into a database table for you on 23:00 at night.
IMPORTANT Before you run this function.
You will need to create a folder/directory called cafepress in your files folder of your site. And have this open for read/write and delete.
This module is dependent on the entity api from fago this you have to have installed.
This can be found here http://drupal.org/project/entity For more information look at the PDF , Word file in the module.
Module can be found at http://drupal.org/sandbox/mklynx/1193244
| Comment | File | Size | Author |
|---|---|---|---|
| CaféPress for Drupal 7.pdf | 422.28 KB | mklynx |
Comments
Comment #1
Niklas Fiekas commentedThank you for applying.
Please compare your module to cafepress.
Does your sandbox provide the same functionality for D7? In that case better collaborate on porting it to Drupal 7. You can start by opening the discussion in the project's issue queue.
Comment #2
mklynx commentedNo it does not.
That module only shows the items on your site.
This module imports the items to the drupal database every 24 hours.
I found that the Cafepress module that you point me to is to limited. I can not use it to sort true the cafe press items and show what i want. When i import the items i can do things like sorting them.
Marcel
Comment #3
Niklas Fiekas commentedOk, Marcel, I'd still prefer improving the existing module, but your's might be different enough.
Please read the coding standards and apply them to your module.
Above all, please use an indent of two spaces with no tabs.
Please prefix your function names with your module name, to avoid naming conflicts (far fetched or not).
Consider running your cronjob not only while
date('G') == 23, instead better use something like the example, if possible: http://api.drupal.org/api/drupal/modules--system--system.api.php/functio....Consider using http://api.drupal.org/api/drupal/includes--common.inc/function/drupal_ht... instead of your custom function.
You'll have to choose a different module name, that is not yet taken.
Provide documentation rather in plaintext than in doc. By convention projects have a README.txt file.
(Optional, feature request: Allow the user to manually push off the import for testing.)
Once you've fixed the problems set the status to needs review - or close the issue, if you decide to join forces with the cafepress module team.
Perhaps once your module matures, you can integrate those two better.
Comment #4
mklynx commentedCoding standards i am working on no problem.
Naming of functions no problem i am changing them.
Different module name have done already.
Doc changed to TXT done.
I have questions about the other two.
Is it a 100% requirement to use the functions withing drupal or is it a something i can leave for now?
In a next version i will use it i did not know it was there.
The cronjob the link you gave does not link to a example what example are you talking about.
and a general question
Because of the different name do i need to open a new project and have it reviewed again ?
Marcel
Comment #5
mklynx commentedUpdate with version 0.91 everything solved except the cron job. I can not find a better way at this moment.
Marcel
Comment #6
Niklas Fiekas commentedWell done so far.
Some functions remain, for example:
listproductsbyss->cpi_listproductsbyssget_all_cpi_products->cpi_get_all_productsThe code on hook documentation pages are examples how the hook could be used. http://api.drupal.org/api/drupal/modules--system--system.api.php/functio....
Just change the title of this issue ("CafePress Import" now?) while commenting. Also, your sandbox has an edit tab, where you can set your project title.
Very good. Documentation files are usually all caps README with a lower case extension .txt.
I noticed that the current documentation contains also low level descriptions of functions. Rather add them as doxygen to the code.
More (mostly minor issues):
Now, after the GIT migration, you can remove $Id$ lines from your files.
There are still some lines with spacing issues. Please replace tabs and remove trailing spaces.
Add a space after the asterisk:
*This function creats a array from a XML object and returns it. ( do not change )Try writing E_NOTICE compliant code and remove the calls to error_reporting().
Try using hook_install() to create the required directories.
Maybe call your include files cafepress_import.foo.inc
Will it be hard to fix this?
Edit, forgot something:
versionwill be automatically added to your info file by the packaging scipt.Comment #7
mklynx commentedHi
Most of the things are fixed. A few questions and remarks.
I do not see any need to make the hook_cron more complicated. It works fine and it is easy to understand.
( most of the examples i did not understand )
The hook_install i am working on.
Is it hard to switch to a new function for the pulling the sites ?
Yes if you see how i have had to nest the storesection part it was not as clear cut as i wanted it.
This is all because of the way i pull the site's in. If i change how i do that then i will get a different nesting and i will have to rewrite the complete storesection part.
New version was uploaded.
Marcel
Comment #8
gregglesI suggest taking over the existing cafepress module because the maintainers of that module are not very active.
The process for that is detailed at http://drupal.org/node/251466
If the current maintainers respond that they plan to continue maintaining perhaps you can convince them to let you become a co-maintainer of the 7.x branch.
Comment #9
mklynx commentedHi
Sorry but no thank you that module has a completely different function.
Marcel
Comment #10
Niklas Fiekas commentedYou can use the Coder module to run automated code reviews. It will locate most of the coding style issues. Run it on "minor" to find more.
If your module name is CafePress Import, name your sandbox so. Remove the module for Drupal 7.
The idea for hook_cron is:
After the import, save a time in a variable, indicating when the import did last run. Then, on cron runs, check if 24 hours (if that's what you want) are over since the last import.
Otherwise, if you check against a specific hour, that hour might be easily missed.
Mhh ...
Review processes take their time these days, so there might be enough time to fix it. But go for the other issues first.
Thank you for your patience.
Comment #11
davidhernandezGoing back to Greg's comment. I don't think he is saying that module is the same. He is pointing out that the other module does not look actively maintained, so you could take it over AND incorporate your import functionality into it. That way there will only be one module for people to look to, and you'd be able to use the cafepress name space. Just something to consider.
Comment #12
gregglesYes, davidhernandez interpretted my comment correctly.
If people are searching for "cafepress drupal" we want them to find one actively maintained module rather than an abandoned module and a new, different module. It would be better for your project to take over the namespace as a place to host your functionality.
Comment #13
mklynx commentedI have updated everything you asked for except the pulling of the websites.
I have looked at that module and the problem is that if i would take it over i would trow it away. The functionality is completely not what i would want in a cafepress module.
I would then end up with the software for DR 5/6 not being supported anymore and only support DR 7. I do not think that is a nice thing to do.
Marcel
Comment #14
gregglesThat's an OK situation. Many of the users would likely rather have something rather than nothing even if they preferred the old style of the module's features.
Module duplication is one of the biggest problems in Drupal.org for site builders. They often can't figure out which module they should use on their site. If there is a case where we can reduce the number of projects offering what seems at a quick glance to be the same thing then we can improve their user experience. That's why I feel so strongly about you at least asking to take over that module.
Comment #15
mklynx commentedI have emailed the two people of the cafepress module i need to wait if they answer.
marcel
Comment #16
gregglesEmailing is good, but the full process on http://drupal.org/node/251466 needs to be followed. Did you create an issue?
Comment #17
gregglesI see the issue is at #1201608: I am willing to be a co-maintainer/maintainer of the abc CafePress module.
It's been over 2 weeks so you can take over that project if you like (per the abandoned project process).
Please follow up here so we can know what makes sense to you to do.
Comment #18
gregglesThis is waiting on action from mklynx - updating status to reflect that.
Comment #19
avpadernoI have sent an email to the current maintainer, and moved the request to the site maintainer queue. If the current maintainer doesn't reply before two weeks, I will make mklynx maintainer.
Comment #20
lcampanis commentedHi Guys,
What's the status on this one? Any progress? If not then I believe I would like to give a hand to get this out for D7.
Comment #21
greggles@kiela69 - this issue is basically closed, but it seems mklynx didn't follow through on taking over the existing project. I suggest looking into mklynx' sandbox and perhaps forking that code to your own sandbox.
Comment #22
klausiI think closed (won't fix) is a more appropriate state, since the applicant was never approved. Feel free to re-open this application if you are still working on it.