I've got a need to provide simple table editing for a few tables in a different database from the Umbraco installation. Can Dewd handle this, ie a seperate connection string/DSN?
Sure thing. You can specify another connection string on both the container and repository elements in the config-file. So if you've grouped the tables/repositories in a container, you can add the connection-attribute with your custom DSN, like this: <dewd> <container name="External database" connection="Server=myServerAddress;Database=myDataBase..."> <repository name="Repo 1" /> <repository name="Repo 2" /> <repository name="Repo 3" /> <container> </dewd>
Btw. if you need to connect to a database, that isn't supported by Umbraco, you need to create a custom editor/view based on the Table*-classes, but it isn't difficult.
No. To create a new editor/view/repository you can specifiy your own type on the tag in the xml-file, like this. <dewd> <repositoryname="Languages"icon="mediaFile.gif"> <viewname="All" type="yourowntype,yourownassembly"> </view> <editortableName="umbracoLanguage" type="yourowntype,yourownassembly"> <fieldtitle="ISO code"sourceField="languageISOCode"umbracoDataType="Textstring"/> <fieldtitle="Culture name"sourceField="languageCultureName"umbracoDataType="Textstring"/> </editor> </repository> </dewd> And then you can just inherit from one of the build-in types.
Editing tables in external database
I've got a need to provide simple table editing for a few tables in a different database from the Umbraco installation. Can Dewd handle this, ie a seperate connection string/DSN?
Phil
Hi Phil,
Sure thing. You can specify another connection string on both the container and repository elements in the config-file. So if you've grouped the tables/repositories in a container, you can add the connection-attribute with your custom DSN, like this:
<dewd>
<container name="External database" connection="Server=myServerAddress;Database=myDataBase...">
<repository name="Repo 1" />
<repository name="Repo 2" />
<repository name="Repo 3" />
<container>
</dewd>
Hope that makes sense.
Btw. if you need to connect to a database, that isn't supported by Umbraco, you need to create a custom editor/view based on the Table*-classes, but it isn't difficult.
Sune - thanks, that works great! I missed it in the docs, I should RTFM ;-)
Phil
Haha, no prob.
- Sune
Hi Sune,
So for editor/view do i need to edit your source code?
Hi Eshan,
No. To create a new editor/view/repository you can specifiy your own type on the tag in the xml-file, like this.
<dewd>
<repository name="Languages" icon="mediaFile.gif">
<view name="All" type="yourowntype,yourownassembly">
</view>
<editor tableName="umbracoLanguage" type="yourowntype,yourownassembly">
<field title="ISO code" sourceField="languageISOCode" umbracoDataType="Textstring" />
<field title="Culture name" sourceField="languageCultureName" umbracoDataType="Textstring" />
</editor>
</repository>
</dewd>
And then you can just inherit from one of the build-in types.
Hope this makes sense.
Btw. you're welcome to start a new thread, if you have more specific questions regarding this.
sorry sune i didn't get what you say, will you please explain it more. below is the my xml code
</container>
All i need is to edit this record. :(
Btw what do you mean by yourowntype and yourownassembly. What are the built in types that I should inherit from?
how listControldatasouce will work for umbraco7.2.x
is working on a reply...