I've looked at several methods to create custom datatypes (especially those at nibble.be and the projects on our). But none of them seem to be able to ignore local saving completely.
I want to hook a up an existing database and don't want to duplicate values in umbraco db.
With the user control wrapper method described here it seems you still have to set the "umbracoValue".
With the custom umbraco datatype method described here it seems you can't override the IData setter.
This is because normally you create a datatype to interact with Umbraco Data. I've created something for a client a while back that uses a database. I used a custom class that implemented the Idata interface that did basically nothing.I've used the Abstract Data Editor which is described here and used the OnSave event to store the data from that datatype in my database.
This was a small part of a large project, don't know if you are going to the meetup on the 16th of February, I bring my laptop so I can show you the complete source then,
You can implement your own datatype with the second link to retrieve data from the other database. The problem for sou is (as I guess right) that all the values will be written to the umbraco database too. But this is also an advantage, cause it will be included into the xml which is hold in the cache fetchable by xslt.
Another way is to can create your datatype which only stores links (ids) to the entries in the other db. Then you have to implment a method for the templates to fetch the content on runtime. Disadvantage: no build in caching, you have to implement your own.
I think your prob seems to be the sync of the two dbs then. If you use the first approach: There are methods to update values in the umbraco database via api. You 'only' have to implement on content changes in the external database or system.
Richard, good idea to implement your own umbraco.interfaces.IData. But why make it empty? why not hook it up to the external database directly from there? Why isn't that enough?
It wasn't in my case for a reason I can't remember :-(.The project did a lot more than just saving the data. So maybe you can use your own implementation of IData to stopre the values.
store datatype data in different database
I've looked at several methods to create custom datatypes (especially those at nibble.be and the projects on our). But none of them seem to be able to ignore local saving completely.
I want to hook a up an existing database and don't want to duplicate values in umbraco db.
With the user control wrapper method described here it seems you still have to set the "umbracoValue".
With the custom umbraco datatype method described here it seems you can't override the IData setter.
Hi Yannick,
This is because normally you create a datatype to interact with Umbraco Data. I've created something for a client a while back that uses a database. I used a custom class that implemented the Idata interface that did basically nothing.I've used the Abstract Data Editor which is described here and used the OnSave event to store the data from that datatype in my database.
This was a small part of a large project, don't know if you are going to the meetup on the 16th of February, I bring my laptop so I can show you the complete source then,
Cheers,
Richard
You can implement your own datatype with the second link to retrieve data from the other database. The problem for sou is (as I guess right) that all the values will be written to the umbraco database too. But this is also an advantage, cause it will be included into the xml which is hold in the cache fetchable by xslt.
Another way is to can create your datatype which only stores links (ids) to the entries in the other db. Then you have to implment a method for the templates to fetch the content on runtime. Disadvantage: no build in caching, you have to implement your own.
I think your prob seems to be the sync of the two dbs then. If you use the first approach: There are methods to update values in the umbraco database via api. You 'only' have to implement on content changes in the external database or system.
hth, Thomas
thanks guys for the fast response.
Richard, good idea to implement your own umbraco.interfaces.IData. But why make it empty? why not hook it up to the external database directly from there? Why isn't that enough?
Hi Yannick,
It wasn't in my case for a reason I can't remember :-(.The project did a lot more than just saving the data. So maybe you can use your own implementation of IData to stopre the values.
Cheers,
Richard
is working on a reply...