Forum Discussion

CaryB's avatar
CaryB
Contributor
12 years ago

Creating Custom Preferences

Ok, I've been staring at this all morning and can't figure out why this isn't working. I've successfully created a custom test step and action and now I want to be able to give my users some flexibility in how they work. These are really global changes so I want to add my own preferences page.

I've created a new class which implements PrefsFactory. This class creates an instance of the class which implements Prefs and has the code to build the form and get/set the preferences.

Factory Class

public class ExportXmlPrefsFactory implements PrefsFactory {
public Prefs createPrefs() {
return new ExportXmlPrefs("Export XML");
}
}


factories.xml

<tns:factory id="ExportXmlPrefs" factoryType="com.eviware.soapui.actions.PrefsFactory" factoryClass="com.mycompany.ExportXmlPrefs"/>


When I copy the jar to ext and re-start, I don't see anything in the preferences dialog. Any idea what I might be missing? I'd expect to at least see my label ("Export XML") even if the form itself isn't working yet.

5 Replies

  • I had a brain fart in the factory xml.


    <tns:factory id="ExportXmlPrefs" factoryType="com.eviware.soapui.actions.PrefsFactory" factoryClass="com.mycompany.ExportXmlPrefsFactory"/>


    Now it actually shows up in the log as being added...but it breaks the preferences dialog completely. When it's loaded I can't display any preferences.
  • I guess I am using the deprecated framework but fwiw I'm in 5.1.1 and both the action and custom test step are doing exactly what I want. It's just the custom property page that I can't get working. We have people using a bunch of different versions.

    I've tried the Maven way as well and it doesn't work for me. I never use Maven so maybe it's a configuration issue. The link you provided states, "This will download and install the maven archetype" but apparently that isn't happening.


    [INFO] BUILD FAILURE
    [INFO] ------------------------------------------------------------------------
    [INFO] Total time: 1.649 s
    [INFO] Finished at: 2014-09-22T18:28:21-05:00
    [INFO] Final Memory: 9M/309M
    [INFO] ------------------------------------------------------------------------
    [ERROR] No plugin found for prefix 'archetype' in the current project and in the plugin groups [org.apache.maven.plugins, org.codehaus.mojo] available from the
    repositories [local (C:\Users\me\.m2\repository), central (http://repo.maven.apache.org/maven2)] -> [Help 1]


    I guess that's what's frustrating. The documentation I'm following is still linked from the main site. So how is one supposed to know it's deprecated? Trying to make heads or tails of SoapUI documentation is like pulling teeth.
  • Hi,

    Just add the archetype to your local maven repository.

    Download the soapui plugin archetype from here, select "Download ZIP":
    https://github.com/olensmar/maven-soapu ... -archetype

    Extract the zip file some where then start a command prompt and cd into the directory you just extracted where the pom file is.

    <apache maven install>\bin\mvn install, will install the archetype to your local maven repository. You then should be able to use the archetype with no problems.


    Regards,
    Marcus
    SmartBear Support