# |
Mar 17th 2009, 09:55 |
_nate_ |
alkemann: with no POST body? |
# |
Mar 17th 2009, 09:55 |
alkemann |
which returns an xml to parse and cake data arrayify |
# |
Mar 17th 2009, 09:54 |
alkemann |
_nate_: havent gotten there yet. but its goign to build urls like this : http://eklima.met.no/metdata/MetDataService?invoke=getMetDataValuesandtimeserietypeID=0andformat=andfrom=2006-01-01andto=2006-01-05andstations=18700andelements=tamandhours=andmonths |
# |
Mar 17th 2009, 09:54 |
_nate_ |
alkemann: okay, so show me a find() call that would be an example to show what you're looking for |
# |
Mar 17th 2009, 09:53 |
alkemann |
_nate_: goal is to mask the fact that there is anything special about the model, so i want model calls to look like normal cake find. |
# |
Mar 17th 2009, 09:53 |
_nate_ |
yup |
# |
Mar 17th 2009, 09:53 |
ADmad |
oh yeah thats what i meant sorry |
# |
Mar 17th 2009, 09:53 |
_nate_ |
ADmad: ConnectionManager::create() I think |
# |
Mar 17th 2009, 09:52 |
ADmad |
_nate_: if i dont want to specify a config array for a DS in database.php then i would have to use DataSource::create at runtime ? |
# |
Mar 17th 2009, 09:52 |
_nate_ |
alkemann: okay, so show me an example of what you want your model calls to look like, and roughly what the HTTP should look like for what it generates |
# |
Mar 17th 2009, 09:51 |
jperras |
so it's a good example |
# |
Mar 17th 2009, 09:51 |
jperras |
read-only datasources are pretty common for external apis |
# |
Mar 17th 2009, 09:51 |
alkemann |
building a datasource for this : http://eklima.met.no/met/MetService |
# |
Mar 17th 2009, 09:51 |
_nate_ |
alkemann: yeah, that sounds good |
# |
Mar 17th 2009, 09:50 |
ADmad |
yeah it would make the site bit more dynamic |
# |
Mar 17th 2009, 09:50 |
_nate_ |
we could even have contests eventually |
# |
Mar 17th 2009, 09:50 |
alkemann |
a datasource that takes model commands (read only) to build an url and take the content of that url, convert it to a cake dataset and return it a good example? |
# |
Mar 17th 2009, 09:50 |
_nate_ |
that's a good idea |
# |
Mar 17th 2009, 09:50 |
ADmad |
hey that gives me an idea... can we have a feature in bakery where moderator post a topic and invite users to write an article for it :) |
# |
Mar 17th 2009, 09:49 |
jperras |
seems like a good deal for alkemann ;-) |
# |
Mar 17th 2009, 09:48 |
_nate_ |
I'd be willing to answer all the questions for anyone trying to write a proper one, if they'd agree to put it in the manual |
# |
Mar 17th 2009, 09:48 |
_nate_ |
honestly though, there's actually not that much to it |
# |
Mar 17th 2009, 09:48 |
ADmad |
true atm only the devs know enough about it to write a custom one properly |
# |
Mar 17th 2009, 09:48 |
jperras |
most of them seem to turn into cake-ish vendor libraries |
# |
Mar 17th 2009, 09:47 |
jperras |
probably because the docs are pretty much non-existent |
# |
Mar 17th 2009, 09:47 |
ADmad |
yeah never seen one implementign the create, read, update |
# |
Mar 17th 2009, 09:47 |
jperras |
yeah |
# |
Mar 17th 2009, 09:46 |
_nate_ |
I think I've maybe seen one |
# |
Mar 17th 2009, 09:46 |
_nate_ |
I don't think I've seen many/any DataSources that actually implement things correctly |
# |
Mar 17th 2009, 09:45 |
jperras |
hmm, seems i forgot that the last.fm datasource is a bit non-standard in terms of implementation. |
# |
Mar 17th 2009, 09:44 |
alkemann |
execute and the log stuff. can i use those? |
# |
Mar 17th 2009, 09:41 |
_nate_ |
heh |
# |
Mar 17th 2009, 09:41 |
ADmad |
and dont forget function disconnect() { return true; } :) |
# |
Mar 17th 2009, 09:40 |
_nate_ |
it's really simple ;-) |
# |
Mar 17th 2009, 09:40 |
alkemann |
cool, ill look for it |
# |
Mar 17th 2009, 09:40 |
jperras |
but it's pretty specific to the last.fm api, iirc |
# |
Mar 17th 2009, 09:40 |
_nate_ |
you may also have to define name() and value(), but they probably won't need to do anything in your case |
# |
Mar 17th 2009, 09:40 |
jperras |
alkemann: I think m3nt0r has a good example with a last.fm datasource |
# |
Mar 17th 2009, 09:40 |
_nate_ |
alkemann: implement listSources() for the model to get the table name, describe() to assign the model it's description, and create() read() update() and delete() to do operations |
# |
Mar 17th 2009, 09:39 |
ADmad |
yeah have never done that... just used datasource directly in controller :P |
# |
Mar 17th 2009, 09:39 |
alkemann |
i think i can make this work now, but documentation on how to best make a datasource to get the model to behave normal would be good :) |