Thanks for the reply. I am clear till creation of any classes required for any operation in umbraco. I just copied the dll which consists the class also. But now, I need your help after it. After copying the dll in the umbraco bin folder. How to invoke the action available in the dll from the content or template or document in the umbraco.
I have created a dll in the VS.NET 2005 to publish the tweet in my twitter blog. There are no errors in it.
The dlls are pasted in the Umbraco bin folder. The dll is not user control but contains only classes withe events handled at the constructor like this;
public tweetOnPublish() { Document.AfterPublish += new Document.PublishEventHandler(Document_AfterPublish); }
void Document_AfterPublish(Document sender, umbraco.cms.businesslogic.PublishEventArgs e) { // Business Logic
}
My requirement is:
1. I have two datatypes in the document called tweet (check box) and message (textstring).
2. If the tweet box is checked, the event available in the dll should be invoked to publish the tweet in my twitter.
Just would like to know how the class file event is linked with the checked event of the umbraco content?
The greatest threat here is; if I have more than one dll, all the dlls will capture the events of a document. If any matches found then only execute the business logic related with it. Will not affect the performance?
Action Handler
Hi
I have done the followings;
1. Created a project with some actions (It has included all the umbraco needed files, so no errors)
2. Done build the project release.
I don't know what exactly it is that you want to do, but have a look at an example event handler to see how they can be constructed.
Thanks for the reply. I am clear till creation of any classes required for any operation in umbraco. I just copied the dll which consists the class also. But now, I need your help after it. After copying the dll in the umbraco bin folder. How to invoke the action available in the dll from the content or template or document in the umbraco.
Event handles fire on the events to which you tie them... so AfterSave, AfterPublish etc.
If you want to "fire" something in your own custom classes, have a look at /base.
The dlls (all) available in the umbraco bin folder will read the actions in the currently running umbraco page.
If it is handled in any of the dll, then the function will be executed
It does not require any explicity combine with the pages
Are you talking about UserControls here? Can you show a simple example maybe? I feel that we're talking about different things here..
I have created a dll in the VS.NET 2005 to publish the tweet in my twitter blog. There are no errors in it.
The dlls are pasted in the Umbraco bin folder. The dll is not user control but contains only classes withe events handled at the constructor like this;
public tweetOnPublish()
{
Document.AfterPublish += new Document.PublishEventHandler(Document_AfterPublish);
}
void Document_AfterPublish(Document sender, umbraco.cms.businesslogic.PublishEventArgs e)
{
// Business Logic
}
My requirement is:
1. I have two datatypes in the document called tweet (check box) and message (textstring).
2. If the tweet box is checked, the event available in the dll should be invoked to publish the tweet in my twitter.
Just would like to know how the class file event is linked with the checked event of the umbraco content?
Okay, good, I understand now. It's pretty easy from here on out, you can read the properties with getProperty just do something like this:
void Document_AfterPublish(Document sender, umbraco.cms.businesslogic.PublishEventArgs e)
{
if (sender.getProperty("tweet") == "1")
{
//Send tweet
}
}
The greatest threat here is; if I have more than one dll, all the dlls will capture the events of a document. If any matches found then only execute the business logic related with it. Will not affect the performance?
Sure, if you fire many events it will start to suffer. You can put events in a new thread though, if you want.
is working on a reply...