Hello,
I am trying to get my module configuration page to show up on my ignition gateway. I have been following the secret keeper example, but I didn’t realize until I was far in that it requires Java 11+, whereas from my understanding Ignition 7.9 is still using Java 8.
The big issue I have run into is that it seems like what is actually getting the configuration page to get called is the “List.of(MyIConfigTab)”. Java 8 doesn’t have an equivalent. I have gone through the github branch for 7.9 but can’t find an example where a configuration page is setup.
I am relatively new to both Java and Ignition so I am hoping that there is just an obvious answer I am missing.
Many thanks
In your GatewayHook, you announce the existence of your configuration page like so:
@Override
public List<? extends IConfigTab> getConfigPanels() {
List<DefaultConfigTab> pl = new ArrayList<DefaultConfigTab>(1);
pl.add(new DefaultConfigTab(ConfigCategory.DATABASES, "tsdbcache", "tsdbcache.panels.Config.Tabname", CachesConfigPage.class));
return pl;
}
The given page class must have a 1-arg constructor that takes the outer (gateway-supplied) configuration page as its argument, and it must extend ConfigPanel
.
If your config is a list of records in the internal database, you can simply extend RecordActionTable
, like so:
package com.automation_pros.streamer.panels;
import com.automation_pros.streamer.config.settings.OpenCVSettings;
import com.inductiveautomation.ignition.gateway.localdb.persistence.RecordMeta;
import com.inductiveautomation.ignition.gateway.web.components.RecordActionTable;
import com.inductiveautomation.ignition.gateway.web.pages.IConfigPage;
public class StreamerConfig extends RecordActionTable<OpenCVSettings> {
private static final long serialVersionUID = 1L;
public StreamerConfig(IConfigPage configPage) {
super(configPage);
}
protected RecordMeta<OpenCVSettings> getRecordMeta() {
return OpenCVSettings.META;
}
}
1 Like
Perfect! Amazing, thank you!
Alright, I am getting stuck still with extending the RecordActionTable.
When I install my module I get question marks around my configuration page and clicking it brings me to an internal error. I have gathered from reading other posts that this is an issue with how I set-up my BundleUtility.
In my code I am declaring this:
BundleUtil.get().addBundle(“scareader”, getClass(), “scareader”);
My package is “ca.stiles.scareader”, which is what I was assuming I need to put in based on other examples I have seen here, but I don’t think I am properly pointing my extension of the RecordAction table into thing.
So, your PersistentRecord
implementation must have its own properties file, with the same base name and in the same folder as the class. Your module’s main bundle would provide the translatable keys for everything else.
I put my bundling actions into a Meta
class, usually in the common sub-project, like so:
import com.inductiveautomation.ignition.common.BundleUtil;
public class Meta {
public static final String MODULE_ID = "com.automation_pros.enip1";
public static final String SHORT_MODULE_ID = "enip1";
public Meta() {}
static public void bundle() {
BundleUtil.get().addBundle(SHORT_MODULE_ID, Meta.class, "localization");
}
static public void unBundle() {
BundleUtil.get().removeBundle(SHORT_MODULE_ID);
}
}
As shown, the properties files are “localization.properties”, “localization_en.properties”, and “localization_en_US.properties”, all in the same folder as Meta.java
.
Thank you again for your quick response.
I have been using Maven to build and I guess that Maven likes all of its property files in a resource folder branch that mirrors the java folder.