0

I have a simple custom Add-in that just displays a message to the user.

namespace GeorgiSpotfireCustomExtention
{
    public class GeorgiEvent : CustomApplicationEventHandler
    {
        protected override void OnApplicationInstanceCreated(AnalysisApplication application)
        {
            base.OnApplicationInstanceCreated(application);

            MessageBox.Show("On Application Instance Created");
        }
    }
}

That is my CustomAddIn class:

public sealed class CustomAddIn : AddIn
{
    // Override methods in this class to register your extensions.
    protected override void RegisterApplicationEventHandlers(ApplicationEventHandlerRegistrar registrar)
    {
        base.RegisterApplicationEventHandlers(registrar);

        registrar.Register(new GeorgiEvent());
    }
}

I am just trying to learn the package deployment process. When I am running it locally - in the installed Spotfire Analyst client it displays the message just fine:

enter image description here

However, when I package the extention, add it to the server (via the "Deployments & Packages" section, adding the "spk" file and then saving the area, the message is not shown when I try to open a document in the WebPlayer/Consumer.

Notes: I am choosing "TIBCO Spotfire Any Client" for my intended client in the Package Builder when building the spk file.

Georgi Koemdzhiev
  • 11,421
  • 18
  • 62
  • 126

2 Answers2

1

from the Spotfire Wiki (emphasis mine):

WinForms graphical user interface is a component of the .NET Framework and not something supplied by Tibco Spotfire. It's not recommended to implement solutions using Forms, but sometimes it could be handy when debugging. There is no commitment that it will work in future versions of the Analyst client. Forms are not supported on the Web Player.

the example listed on the wiki is for IronPython, but presumably the same holds true for C# extensions.

niko
  • 3,946
  • 12
  • 26
  • 1
    I see. I was not aware of the fact that it is not recommended to use WinForms code in the Web Player. Thank you for your answer. – Georgi Koemdzhiev Mar 23 '19 at 08:59
  • Can I ask what is the recommended way to extend the capabilities of the Spotfire Web Player (i.e. Consumer) if it is even possible? – Georgi Koemdzhiev Mar 25 '19 at 08:19
  • 1
    Just like you’re doing, but without Forms :) the problem is that, to continue with your example, the message box will be displayed on the machine executing the code. In this case, it’s the machine hosting the Node Manager. – niko Mar 25 '19 at 10:01
  • Oh, I see now. So if I stick with a non-forms code the code should work also (provided that I have specified the correct intended client) on the web player? – Georgi Koemdzhiev Mar 25 '19 at 11:43
1

Correct. My assumption, and I don’t really know a lot about .NET, so this is not absolute, is that the form is rendered on the machine executing the code. In the case of your example above, the dialog would pop on the Node Manager host. If you’re really set on using an alert like this, you can accomplish it in JavaScript with an ‘alert()’. There is probably a way to render dialogues o in the web client too, but I don’t know it offhand.

niko
  • 3,946
  • 12
  • 26
  • 1
    Thank you for your answer. Really appreciate your comments and time as I find it very hard to look for answers to the questions my team has about the Spotfire platform on the internet in general (we are all new and trying to make sense of it). – Georgi Koemdzhiev Mar 25 '19 at 11:57
  • 1
    @GeorgiKoemdzhiev no worries, Georgi :) i know that contextual documentation is a bit tough to find for Spotfire. Even as a tibco employee it can be difficult! – niko Mar 25 '19 at 11:58
  • 1
    oof, I did this on mobile; didn't mean for it to be an answer -_- anyway, Georgi, I'm happy to provide this type of documentation for the "public record" but if you have more specific questions I'm reachable at n-mares-co- AT ti-bc-o.c-om (remove all dashes/spaces) – niko Mar 25 '19 at 13:11
  • 1
    Thank you for the email, much appreciated :) – Georgi Koemdzhiev Mar 25 '19 at 13:31