Support Forums

 
  iFinity Support Forum  DotNetNuke Modu...  Tagger Module  Using the Tagger Module API to set Tags from another DNN Module
Previous Previous
 
Next Next
New Post 4/19/2008 7:00 AM
  Bruce Chapman
572 posts
1st Level Poster


Using the Tagger Module API to set Tags from another DNN Module 

The Tagger Module has an API available to other modules, so if you're building a DNN Module and want to create tags with that module, then you're in luck.

The API works using the 'IModuleCommunicator' interface in DotNetNuke, which is a way of letting two modules on the same DNN page talk to each other through a programming interface.

The tagger module is already set up as a 'listener', but you need to define your 'sender' module.

Here's how to do it, in code.  All this code should be in the page-behind code of your Module, on the page where the 'save' action is - the point at which you know you want to set up some tags for the page.

//handler
public event ModuleCommunicatioEventHandler ModuleCommunication;


Then create a function to save the tags for the current page - normally located in the page-behind code for the control that is doing the 'saving'.  You'll need to reference 'iFinity.Tagger.dll' in your code to get an early-bound call.

private void SaveTags(NameValueCollection queryString)
{
   string header, line1, line2;
   List<string> tags;
    //get your tags
   tags = <YourLogicToSetTheTags>
  // now set the header, line1 and line2 to show information about this
  // page when it shows in the tag list
   header = <YourLogicToDecideTheTagHeader>
   line1 = <YourLogicToDecideTheFirstLine>
   line2 = <YourLogicToDecideTheSecondLine>
   TaggerModuleOptions options = new TaggerModuleOptions(tags.ToArray(), this.PortalId, true, queryString,  TagSummaryDataAction.ForceOverwriteHeaderOnly, header, line1, line2);
   TaggerModuleCommunicationEventArgs args = new TaggerModuleCommunicationEventArgs(options, this.GetType().ToString(), TagTarget.ModuleTags);
if (ModuleCommunication != null)
   ModuleCommunication(this, args);}
 

 

This code would be called somethign like this :

 

private void cmdSave_Click(object sender, eventargs e)
 
{
    //save my stuff
    Save();
    //tag my stuff
    SaveTags(Request.QueryString);
}

It looks quite complicated but is actually pretty simple.

 
New Post 7/10/2008 4:50 AM
  peop
8 posts
No Ranking


Re: Using the Tagger Module API to set Tags from another DNN Module 

Thanks for an excellent module.
Can you please provide a code example in VB for the API? 
I am trying to integrate this Tagger module in Ventrians News Article module.

Per-Ola

 
New Post 7/10/2008 9:33 AM
  Bruce Chapman
572 posts
1st Level Poster


Re: Using the Tagger Module API to set Tags from another DNN Module 

Per-Ola

That's an interesting challenge.  I'll generate a VB version and post it up for you.  Can you tell me where in the NA code you wish to insert the entry - I have a copy of the NA source locally.  I might be able to point you in the correct direction.

-Bruce

 
New Post 7/10/2008 3:35 PM
  peop
8 posts
No Ranking


Re: Using the Tagger Module API to set Tags from another DNN Module 

Bruce,
I am using NA version 00.06.11.
I want to integrate the Tagger code in the SaveArticle-function (row 304) in the ucSubmitNews-file.

Thanks for your help
Per-Ola

 
New Post 7/11/2008 2:39 AM
  Lance Long
9 posts
No Ranking


Re: Using the Tagger Module API to set Tags from another DNN Module 

I would be interested in this too. 

 
Previous Previous
 
Next Next
  iFinity Support Forum  DotNetNuke Modu...  Tagger Module  Using the Tagger Module API to set Tags from another DNN Module
Can't find the answer?
 

If you can't find the answer and don't have time...try out the Premium Support service.  Get personal attention and get the problem fixed by an expert.

 

Support Guidelines.. Please read before posting

To get support on iFinity products and services, please search the forums for the the answer to the problem you are seeking. If you cannot find a solution, post a question in the relevant forum.   Ensure that you specify the relevant versions of the problem, and the actual error message or a detailed description of the problem.    You will need to register with this site to post on the forum.  If you have a Microsoft Live (Hotmail/Passport) account you can use that.  If you have a Open Id account you can use that.  If you neither of these, you will need to register a user Id and password.

If you wish, you can use the Premium Support Service for one-on-one support.