Gemini Community Support Site

This Gemini community support site can be used to find solutions to product issues. You can log in using Open Id, Google Profile and even Facebook. Feel free to ask a question or browse FAQs and documentation. Product tour videos are also available along with how-to videos demonstrating key Gemini capabilities.




How to create a plugin

api
plugins

Hi, I'm attempting to create a plugin that will add a commenter as an issue watcher if they are not watching it already. I believe my code looks ok, but the watcher is not added after adding a comment, and no error is recorded. Any ideas? Thanks - Rob

public class Plugin : CounterSoft.Gemini.Commons.AbstractIssueListener
{
    ServiceManager ws;

    public Plugin()
    {
        ws = new ServiceManager("http://localhost/gemini", "plugin", "123456", "abcdefgh", false);
    }

    public override void IssueCommented(CounterSoft.Gemini.Commons.IssueEventArgs args)
    {
        foreach ( IssueWatcherEN watcher in args.Issue.Watchers)
        {
            if (watcher.UserID == args.Comment.UserID)
                return;
        }

        // User commented, but is not watching the issue, add them as a watcher
        IssueWatcherEN newWatch = new IssueWatcherEN();
        newWatch.State = BaseEN.EntityState.New;
        newWatch.UserID = args.Comment.UserID;
        newWatch.IssueID = args.Issue.IssueID;

        ws.IssuesService.CreateWatcher(args.Comment.IssueID, newWatch);

        base.IssueCommented(args);
    }
}
Rob
· 1
Rob
Replies (6)
helpful
0
not helpful

Please make sure you only put your DLL in the plugins folder. All countersoft DLLs should not be there. Do you get any errors in the system log?


Saar Cohen
· 5000
Saar Cohen
helpful
0
not helpful

The only dll I have in the folder is mine. I tried it with and without the Countersoft.Gemini.WebServices.dll. Either way, I receive the same error.

Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information. at System.Reflection.Module._GetTypesInternal(StackCrawlMark& stackMark) at System.Reflection.Assembly.GetTypes() at CounterSoft.Gemini.Business.Events.GeminiEventDispatcher.LoadPlugins(String strPath)


Rob
· 1
Rob
helpful
0
not helpful

Make sure you compile against the correct Gemini version (the same as the web version).


Saar Cohen
· 5000
Saar Cohen
helpful
0
not helpful

I was running version 4.0.0 of Gemini, so just to be sure, I upgraded just now to 4.1.1, downloaded the newest API Samples zip, and recompiled using the new version, and I get the same error.

I just noticed that the dlls in the lib folder of the samples are from 7/4, but the web app has dlls from 8/23. So I replaced the Commons dll with the new one, but I still get the same error, probably because the WebServices dll is out of date.

Do you have a newer WebServices dll to match the 4.1.1 release?


Rob
· 1
Rob
helpful
0
not helpful
ANSWER

Saar Cohen
· 5000
Saar Cohen
helpful
0
not helpful

Updating to the latest dlls from your zip worked! Thanks! I would update the samples file on the download page of your website though to help avoid confusion, as the existing samples use th eold files, and there's no link to just the API dlls without the samples.

This is the zip that doesn't have the updated dlls: http://www.geminiplatform.com/downloads/v41/CounterSoftGeminiAPI_Samples.zip


Rob
· 1
Rob