Hi.
I'm trying to compute a GeoCode from Google Maps when saving a ResellerItem that I've created.
Is this possible at all?
Hi.
I'm trying to compute a GeoCode from Google Maps when saving a ResellerItem that I've created.
Is this possible at all?
You can subscribe to Dynamicweb.Notifications.Items.Saving and update item data before it's actually being saved.
If your item is created from code, you have to do it in the Save method.
Best regards,
Mikkel
Any ideas on how to call subscribe to save when using data integration module?
Hi Martin,
When using the Data Integration module you can subscribe to Dynamicweb.Notifications.Integration.JobFinished Notification. This notification is occured when the job run is finished.
Best regards,
Dmitrij
That just might be right... But... Which dll do I need? I currently get this error The type or namespace name 'Extensibility' could not be found (are you missing a using directive or an assembly reference?)
Also... Is there a way to access the items imported - or do I have to access tha database directly?
Hi Martin,
The 'Extensibility' namespace is located in Dynamicweb.dll, it is in the root Dynamicweb.Extensibility.
You can access the database directly or you can use the ItemManager (namespace Dynamicweb.Content.Items).
The item can be found by system name:
Dim ret As ItemType = Nothing
Dim metadata As MetadataContainer = Nothing
If Not String.IsNullOrEmpty(SystemName) Then
metadata = ItemManager.Metadata.GetMetadata()
If Not IsNothing(metadata) AndAlso Not IsNothing(metadata.Items) AndAlso metadata.Items.Any() Then
ret = metadata.Items.Find(SystemName)
End If
End If
The item can be saved:
ItemManager.Activation.CreateWorkflow(Of ModelFirstActivationWorkflow)().Update(New ItemType() {ItemType})
Regards,
Dmitrij
Also there is some documentation about the Items api here: http://developer.dynamicweb-cms.com/documentation/for-developers/item-based-structure/getting-started.aspx
Is there a nice way to retrieve the connection string? I thinking in the lines of Base.Gs("something") ??
Hi Martin
We do not store the connection string in GlobalSettings.aspx - only parts there of. You can always get the connection string from a connection object, i.e. Database.CreateConnection.ConnectionString.
We build it like this if you are using built in SQL-Server users:
New SqlClient.SqlConnection("User Id=" & Base.GetGs("/Globalsettings/System/Database/UserName") & ";Password=" & Base.GetGs("/Globalsettings/System/Database/Password") & ";Initial Catalog=" & Base.GetGs("/Globalsettings/System/Database/Database") & ";Server=" & Base.GetGs("/Globalsettings/System/Database/SQLServer") & ";Min Pool Size = 5; Max Pool Size=200;")
It might be best to use the connection string property of the connection object - it will work no matter what kind of authentication is used.
BR Nicolai
Thx Nicolai, that was kinda what I was fishing for :)
You must be logged in to post in the forum