Umbraco: RSS Feed Burner

Introduction:
MfsFeedBurner project is used to show RSS Feed content of any provider on your portal. This will help to keep your site visitors updated with the latest happenings. For example you can show RSS feed provided by Google/ NDTV (TV Channel)/ Times of India (News Magazines) / etc. into your website. Also you can manage some styling like height/ width/ news title as well as description color etc.

Features:
• Administrator can enter any RSS link of choice
• Can set either latest news header only or news with description.
• Can set auto refresh time for get update
• Count of news feed to be shown can be set
• Can change display style
• Can change height and width of feed container
• Can change background or border color
• Can set background of container as transparent
• Can set header title length
• Can set news header title
• On Mouse Scroll effect

Compatibility:
The MfsFeedBurner module is well compatible with Umbraco 4.9.x. Talking of .net framework it is compatible with .NET 4.0 and above.

Download Here

 

Image

Create custom package using umbraco cms

Umbraco provide a great way to handle packages that work as you want. In Umbraco cms we often come in situation to do packaging our development solution so that it can easly integrate in another umbraco existing application. Think in this way you have created a twitter latest update  feed in .net and you want to use it in umbraco existing application. Here your twitter latest upadate is your standalone solution or let say module and you want to deploy in umbraco application so my point here how you will achive this functionality so lets begin our descusiion and my train of thought over this.

Here are some link you can understand what packages is download it and use it your application for understanding what packages do for you :http://our.umbraco.org/projects/tag/package

For package installation in umbraco

Login to Umbraco
Goto the Developer section
From the tree expand the Packages folder
From here there are two ways to install a package
Select Install local package OR browse the Umbraco Package Respository
If you install local package, you do not unzip the package but load the zip into Umbraco.
TO BE CONTINUED…..

Umbraco provide interface to create package during creation of package what you really need:

Login to Umbraco
Goto the Developer section
From the tree expand the Packages folder
Now select Created packages and enter package name and click on create

After that you will get option to save these below file for your packages and after adding below file click on publish and after that your package is ready to download.
1)Dll file.
2)user control
3)css file if applicable for your soluntion
4)Java script file if applicable for your solution
5)Umbraco dcument type
6)Umbraco template
7)umbraco data type , and another stuff

  Another Umbraco Article

Umbraco: Execute Some Logic after Document Save in Umbraco CMS by c#.

We often come across situations to execute some piece of code or call some function and store some value in data base or alert some java script function after saving document in umbraco. Find below code in below code we register Document.AfterSave event at startup of Umbraco application and store some message in Log table of umbraco after document save.

Note make sure you have refer cms and interface and umbraco and businessLogic dll file while running below code.

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using umbraco.cms.businesslogic.web;
using umbraco.BusinessLogic;

namespace EventSamples
{
    public class TestEventHandle : umbraco.BusinessLogic.ApplicationBase
    {
        public TestEventHandle()
        {
            // Register AfterSave event
            Document.AfterSave += new Document.SaveEventHandler(Document_AfterSave);
        }

      // Execute this method after Document save.
      void Document_AfterSave(Document sender, umbraco.cms.businesslogic.SaveEventArgs e)
        {
            // Execute Some Logic Here.
            Log.Add(LogTypes.Save, sender.Id, "I am saving this message in umbraco Log Table");
        }
    }
}

For Working this just run it and take DLL File and save in umbraco bin folder and it will start working.

Another Umbraco Article

Page Keyword: Store Some value in database after document save. Register document after save event in umbraco at startup. Get and set some value after document save in umbraco, Call function after document save in umbraco, Add error message to Log tabel in umbraco. How to register event in umbraco. How to register Document AfterSave event in Umbraco by c#.

Umbraco: Execute Code after Document Publish in umbraco CMS by c#.

We often come across situations to execute some piece of code or call some function and store some value in data base or alert some java script function after saving document in umbraco. Find below code in below code we register Document.AfterPublish event at startup of Umbraco application and store some message in Log table of umbraco after document save.

Note make sure you have refer cms and interface and umbraco and businessLogic dll file while running below code.

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using umbraco.cms.businesslogic.web;
using umbraco.BusinessLogic;

namespace EventSamples
{
    public class TestEventHandle : umbraco.BusinessLogic.ApplicationBase
    {
        public TestEventHandle()
        {
            // Register AfterPublish event
            //Document.AfterPublish += new Document.PublishEventHandler(Document_AfterPublish);

        }

        /// <summary>
        /// Executes after document publishing
        /// </summary>
        /// <param name="sender">The sender (a documet object).</param>
        /// <param name="e">The <see cref="umbraco.cms.businesslogic.PublishEventArgs"/>
        /// instance containing the event data.</param>
        void Document_AfterPublish(Document sender, umbraco.cms.businesslogic.PublishEventArgs e)

            // Execute Some Logic Here.

            Log.Add(LogTypes.Save, sender.Id, "I am saving this message in umbraco Log Table");
        }
    }
}

For Working this just run it and take DLL File and save in umbraco bin folder and it will start working.

Another Umbraco Article

Page Keyword: Store Some value in database after document publish save in umbraco. Register document after publish event in umbraco at startup. Get and set some value after document publish in umbraco, Call function after document publish in umbraco, Add error message to Log tabel in umbraco. How to register event in umbraco. How to register Document AfterPublish event in Umbraco by c#.

Umbraco: How to validate Email address in umbraco by c#.

For validate email address use below function. Pass email address to IsValidEmail function.

Make sure you are have used this name space

</span></span></span></strong></span>

<span style="font-size: large;"><strong><span style="color: #000000;"><span style="font-family: Consolas,sans-serif;"><span style="font-size: small;">
    <strong>using System.Text.RegularExpressions;
</strong>
        /// <summary>
        /// Validate Email Address
        /// </summary>
        /// <param name="email"></param>
        /// <returns></returns>
        private static bool IsValidEmail(string email)
        {
            var r = new Regex(@"^([0-9a-zA-Z]([-\.\w]*[0-9a-zA-Z])*@([0-9a-zA-Z][-\w]*[0-9a-zA-Z]\.)+[a-zA-Z]{2,9})$");

            return !string.IsNullOrEmpty(email) && r.IsMatch(email);
        }

Another Umbraco Article

Umbraco: How to Log or store error in umbraco Log Table by c#.

Umbraco provide easy way to log exception in there Log table with additional information.

Namespace : using umbraco.BusinessLogic; and using umbraco.NodeFactory;

Method: Log.Add(LogTypes.Type of Log, int nodeId, string error message)

LogTypes : Type of error you want to store. Actually It means under which category you want to file your error or comment.
General LogType: Copy , Custom , Debug , Error, Login and many more.

Node Id: Id of node for which you are loging the error or comment in Log table.
Ex: Node.GetCurrent().Id

Comment: String text you want to store.

For Instance:
Log.Add(LogTypes.Debug, Node.GetCurrent().Id, string.Format(“It seems that you have not setup your mail server”));
Another Umbraco Article

Page Keyword: Exception Handling in umbraco, Exception in Log table in umbraco, Log table in umbraco, Use of Log table in umbraco, Store error in lag table by c# in umbraco, store or handle exception in umbraco.

Execute Sql query in umbraco during package installation

Scenario:
  How to create table in Sql by action script during package installation in umbraco.
  How to create stored procedure by action script during package installation in umbraco.

Well this is common scenario where you want to create some table and stored procedure
and many more related to your package and application.So how we will accomplish
this task.
For accomplish this task use

<Action runat="install" undo="true" alias="ExecuteSql">
<![CDATA[----Enter Your Sql Statement here--- ]]>
</Action>

Here is Example for table creation in sql server 2008:

Note1: Alias name can be any thing you want.
Note2: Make sure that your action script doesn’t contains any blank space
other wise it will not going to execute.

<Action runat="install" undo="true" alias="ExecuteSql"><
![CDATA[
CREATE TABLE [uTasklist_Task](
[task_id] [int] IDENTITY(1,1) NOT NULL,
[task_details] [ntext] NOT NULL,
[create_date] [datetime] NOT NULL,
CONSTRAINT [PK_uTasklist_Task] PRIMARY KEY CLUSTERED
(
[task_id] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]]]>
</Action>

Here is example for stored procedure creation in sql server 2008 during package installation.

<Action runat="install" undo="true" alias="ExecuteSql">
<![CDATA[
CREATE PROC [uTasklist_SetTasklist]
@task_details [NTEXT], @create_date [DATETIME]
AS
SET NOCOUNT ON
INSERT INTO [uTasklist_Task] VALUES(@task_details, @create_date)]]>
</Action>

Here is Another good link for: Package installation tools for Umbraco @ codePlax

Register Event Handler In umbraco

Introduction:

I assume that you have basic idea of event in c#. If not then please have a look Basic Event Handler  As we know that event is mechanism via which we can send notification to a class to perform some task. In umbraco we will use event handler or event concept to achieve following task:

  • Perform certain task before publishing a document.
  • Perform certain task after deleting a node.
  • Perform certain task after package install.
  • Perform certain task after member is created.

So these task we can achieve via use of event handler.

  • How to register event handler in umbraco 4.0 or pre 4.0 version.For accomplishing this task we will use ApplicationBase Class first you have to understand the concept which umbraco use. Every time when you run umbraco application umbraco search whether any class inherit the ApplicationBase class if he find then he understand that some thing is there so travel to your class which inherited ApplicationBase and after that perform your task…. Lets have a look of these code.

using System;
 using System.Collections.Generic;
 using System.Linq;
 using System.Web;
 using umbraco.BusinessLogic;

namespace xForum
 {
 public class publicclassMyUserControl: ApplicationBase
  {
    public MyDefaultEmptyConstructor()
     {
       // Your logic goes here.
       // and this logic will run when umbraco application is started.
     }
  }
 }

How to register event handler in Umbraco 4.1 + version.
In umbraco 4 + version things has been changed and same task can be archived by Inheriting
umbraco.Global namespace. But guys it will not work in 4.8 version because there is no file called Global.asmx.

</pre>
using System;
 using System.Collections.Generic;
 using System.Linq;
 using System.Web;
 using umbraco.BusinessLogic;

namespace xForum
 {
  public class YourAppGlobalPage : umbraco.Global
  {
   protected override void Application_Start(object sender, EventArgs e)
   {
     // Call base class first.
     base.Application_Start(sender, e);

     // After that write your logic here which will execute at the start
     // umbraco application.
   }
  }
 }
<pre>

This is part 1 of Register Event Handler In umbraco I will come with demo in Part 2.

If you have any query regarding this please leave a comment.