Forum Discussion

CaryB's avatar
CaryB
Contributor
10 years ago

[Resolved] Custom Factories and Plugin Architechture

Ok, now that I have my custom test step and actions working exactly like I want them, I have decided that I should look at using the new plugin architecture. I've got Maven running and I've started the migration. However, there's one stumbling block I'm facing. I created a custom preferences page so my users can change the behavior inside of SoapUI rather than having to go edit a properties file manually.

How do I implement this under the plugin architecture?

6 Replies

  • Perhaps I wasn't clear. I've successfully created a complete plugin via the Maven archetype that does what I want...with one caveat. I need to implement a custom Preferences page.

    Under the old architecture my actions/custom step were housed in a JAR that my installer delivered to bin\ext. Along with that were an actions XML file and a factories XML file delivered to the actions and factories directories respectively. Obviously the Plugin Manager greatly simplifies this.

    This is my factories file:


    <?xml version="1.0" encoding="UTF-8"?>
    <tns:soapui-factories xmlns:tns="http://eviware.com/soapui/config">
    <<tns:factory id="MyPrefs"
    factoryType="com.eviware.soapui.actions.PrefsFactory"
    factoryClass="com.mycompany.MyPrefsFactory"/>
    </tns:soapui-factories>


    As you can see, I have it working fine under the old architecture.



    I'm trying to figure out how to get the PrefsFactory to be recognized by the new architecture. I tried building a folder structure in my Maven project but it didn't get picked up.
  • SmartBear_Suppo's avatar
    SmartBear_Suppo
    SmartBear Alumni (Retired)
    Hi,

    If you are using maven to build your SoapUI Pro plugin and you are using the soapui pro maven plugin archetype with one of the specified types then you can use the maven install goal to build and create a jar file that you can load into the plugin manager. You can start the plugin manager in SoapUI Pro by going to File -> Plugin Manager and browsing for the plugin jar that was created by maven.

    I'm trying to figure out how to get the PrefsFactory to be recognized by the new architecture.


    The old framework to build plugins is no longer being used so what you have in the xml file may be invalid. Please say exactly what the problem is if you have created a plugin using the new plugin framework. The new plugin framework uses JAVA annotations to "recognize" the classes needed for the plugin such as @PluginConfiguration, @PluginTestStep, etc.


    Regards,
    Marcus
    SmartBear Support
  • So, based on the need to follow the annotations paradigm, I changed my class to:


    @PluginPrefs
    public class MyPrefs implements Prefs {
    }


    and it's working. I guess I just need to wrap my head around the new architecture.
  • SmartBear_Suppo's avatar
    SmartBear_Suppo
    SmartBear Alumni (Retired)
    Hi,

    Yes, there has been changes made. Once you get use to the new framework you should be good to go for developing plugins. I will be marking this post as "Resolved" unless you have anymore questions.


    Regards,
    Marcus
    SmartBear Support
  • Go ahead and close it. Thanks.

    That slideshow would be nice (along with some updated documentation) to have on the website.