link start!

This commit is contained in:
cherubin
2026-03-17 13:31:18 -07:00
commit 08abe87cfb
5910 changed files with 386288 additions and 0 deletions
@@ -0,0 +1,372 @@
/*
* Decompiled with CFR 0.152.
*
* Could not load the following classes:
* com.tridium.sys.Nre
* javax.baja.file.BFileSystem
* javax.baja.file.BIFile
* javax.baja.file.FileUtil
* javax.baja.gx.BColor
* javax.baja.hx.BHxView
* javax.baja.hx.Command
* javax.baja.hx.Event
* javax.baja.hx.HxOp
* javax.baja.io.HtmlWriter
* javax.baja.sys.BBoolean
* javax.baja.sys.BObject
* javax.baja.sys.Context
* javax.baja.sys.LocalizableRuntimeException
* javax.baja.sys.Sys
* javax.baja.sys.Type
* javax.baja.util.Lexicon
* javax.baja.util.LexiconText
*/
package com.tridium.platform.hx;
import com.tridium.platform.BSystemPlatformService;
import com.tridium.platform.daemon.BDaemonAccessLevel;
import com.tridium.platform.daemon.BDaemonSession;
import com.tridium.platform.daemon.LocalSessionUtil;
import com.tridium.platform.daemon.message.XmlResponseMessage;
import com.tridium.platform.hx.FileInfoTable;
import com.tridium.platform.hx.util.HxBooleanHelper;
import com.tridium.platform.hx.util.HxMessageHelper;
import com.tridium.platform.hx.util.HxViewHelper;
import com.tridium.platform.license.BLicenseArchiveFile;
import com.tridium.platform.license.BLicensePlatformService;
import com.tridium.platform.license.CertificateInfo;
import com.tridium.platform.license.IFileInfo;
import com.tridium.platform.license.LicenseInfo;
import com.tridium.platform.license.LicenseSync;
import com.tridium.platform.license.PortalLicenseUtil;
import com.tridium.sys.Nre;
import javax.baja.file.BFileSystem;
import javax.baja.file.BIFile;
import javax.baja.file.FileUtil;
import javax.baja.gx.BColor;
import javax.baja.hx.BHxView;
import javax.baja.hx.Command;
import javax.baja.hx.Event;
import javax.baja.hx.HxOp;
import javax.baja.io.HtmlWriter;
import javax.baja.sys.BBoolean;
import javax.baja.sys.BObject;
import javax.baja.sys.Context;
import javax.baja.sys.LocalizableRuntimeException;
import javax.baja.sys.Sys;
import javax.baja.sys.Type;
import javax.baja.util.Lexicon;
import javax.baja.util.LexiconText;
/*
* Illegal identifiers - consider using --renameillegalidents true
*/
public class BHxLicensePlatformServiceEditor
extends BHxView {
public static final BHxLicensePlatformServiceEditor INSTANCE = new BHxLicensePlatformServiceEditor();
public static final Type TYPE;
private FileInfoTable table = new FileInfoTable("table");
private Delete delete = new Delete(this.table);
private HxViewHelper rebootFE;
private HxViewHelper restartFE;
static /* synthetic */ Class class$com$tridium$platform$hx$BHxLicensePlatformServiceEditor;
public Type getType() {
return TYPE;
}
public void write(HxOp hxOp) throws Exception {
BDaemonSession bDaemonSession;
hxOp.setMultiPartForm();
BLicensePlatformService bLicensePlatformService = (BLicensePlatformService)hxOp.get();
HtmlWriter htmlWriter = hxOp.getHtmlWriter();
HxMessageHelper.writeMessage("LicensePlatformServiceEditor", hxOp);
BSystemPlatformService bSystemPlatformService = (BSystemPlatformService)Sys.getService((Type)BSystemPlatformService.TYPE);
bSystemPlatformService.checkPropertiesLoaded();
bSystemPlatformService.poll();
boolean bl = false;
boolean bl2 = false;
if (bSystemPlatformService.getLocalDaemonAccess() != BDaemonAccessLevel.restricted && (bDaemonSession = LocalSessionUtil.getLocalSession()) != null) {
if (bDaemonSession.getHostProperties().getAllowStationRestart()) {
bl = true;
} else {
bl2 = true;
}
}
htmlWriter.w((Object)"<div class='tableViewHeader';'>");
htmlWriter.w((Object)"<b>").w((Object)hxOp.getLexicon("platform").getText("HxLicensePlatformServiceEditor.files.header")).w((Object)"</b>");
htmlWriter.w((Object)"</div>");
this.table.write((BObject)bLicensePlatformService, hxOp);
htmlWriter.w((Object)"<div class='tableViewToolbar'; style='border-bottom: 1px solid black;'>");
this.delete.writeButton(hxOp);
htmlWriter.w((Object)"</div>");
htmlWriter.w((Object)"<br/>");
htmlWriter.w((Object)"<br/>");
htmlWriter.w((Object)"<div class='tableViewHeader'; style='border-top: 1px solid black;'>");
htmlWriter.w((Object)"<b>").w((Object)hxOp.getLexicon("platform").getText("HxLicensePlatformServiceEditor.upload.header")).w((Object)"</b>");
htmlWriter.w((Object)"</div>");
htmlWriter.w((Object)"<table cellpadding='5'>");
htmlWriter.w((Object)"<tr>");
htmlWriter.w((Object)"<td><b>").w((Object)hxOp.getLexicon("platform").getText("HxLicensePlatformServiceEditor.upload.file")).w((Object)"</b></td>");
htmlWriter.w((Object)"<td><input ");
htmlWriter.attr("type", "file");
htmlWriter.w(' ');
htmlWriter.attr("name", hxOp.scope("file"));
if (!hxOp.canWrite() || !hxOp.canInvoke()) {
htmlWriter.w((Object)" ").attr("disabled", "disabled");
}
htmlWriter.w((Object)"/></td>\n");
htmlWriter.w((Object)"</tr>");
if (bl) {
htmlWriter.w((Object)"<tr>");
htmlWriter.w((Object)"<td><b>").w((Object)hxOp.getLexicon("platform").getText("HxLicensePlatformServiceEditor.restart")).w((Object)"</b></td>");
htmlWriter.w((Object)"<td>");
this.restartFE.write((BObject)BBoolean.TRUE, hxOp);
htmlWriter.w((Object)"</td>\n");
htmlWriter.w((Object)"</tr>");
htmlWriter.w((Object)("<input type='hidden' name='" + hxOp.scope("systemReboot.value") + "' value='false' />"));
} else if (bl2) {
htmlWriter.w((Object)"<tr>");
htmlWriter.w((Object)"<td><b>").w((Object)hxOp.getLexicon("platform").getText("HxLicensePlatformServiceEditor.reboot")).w((Object)"</b></td>");
htmlWriter.w((Object)"<td>");
this.rebootFE.write((BObject)BBoolean.TRUE, hxOp);
htmlWriter.w((Object)"</td>\n");
htmlWriter.w((Object)"</tr>");
htmlWriter.w((Object)("<input type='hidden' name='" + hxOp.scope("systemRestart.value") + "' value='false' />"));
} else {
htmlWriter.w((Object)("<input type='hidden' name='" + hxOp.scope("systemReboot.value") + "' value='false' />"));
htmlWriter.w((Object)("<input type='hidden' name='" + hxOp.scope("systemRestart.value") + "' value='false' />"));
}
htmlWriter.w((Object)"</table>");
htmlWriter.w((Object)"<div class='tableViewToolbar'; style='border-bottom: 1px solid black;'>");
htmlWriter.w((Object)"<input ").attr("class", "button").w((Object)" ").attr("type", "submit").w((Object)" ");
htmlWriter.attr("value", hxOp.getLexicon("platform").getText("HxLicensePlatformServiceEditor.upload.button"));
if (!hxOp.canWrite() || !hxOp.canInvoke()) {
htmlWriter.w((Object)" ").attr("disabled", "disabled");
}
htmlWriter.w((Object)"/>&nbsp;");
htmlWriter.w((Object)"</div>");
}
public BObject save(HxOp hxOp) throws Exception {
BIFile bIFile = hxOp.getFile("file");
if (bIFile != null) {
String string = FileUtil.getExtension((String)hxOp.getFormValue("file"));
LicenseSync licenseSync = null;
if (string.equalsIgnoreCase("lar")) {
BLicenseArchiveFile bLicenseArchiveFile = new BLicenseArchiveFile();
bLicenseArchiveFile.setStore(bIFile.getStore());
licenseSync = PortalLicenseUtil.syncLicenses(Nre.getHostId(), LicenseInfo.listLocal(), LicenseInfo.make(bLicenseArchiveFile.getLicenses()));
if (this.sync(hxOp, licenseSync, "LicensePlatformServicePlugin.sync.currentMessage", "LicensePlatformServicePlugin.sync.successMessage")) {
BBoolean bBoolean = (BBoolean)this.rebootFE.save((BObject)BBoolean.FALSE, hxOp);
BBoolean bBoolean2 = (BBoolean)this.restartFE.save((BObject)BBoolean.FALSE, hxOp);
if (bBoolean.getBoolean()) {
BSystemPlatformService bSystemPlatformService = (BSystemPlatformService)Sys.getService((Type)BSystemPlatformService.TYPE);
bSystemPlatformService.reboot();
HxMessageHelper.appendMessage("LicensePlatformServiceEditor", LexiconText.make((String)"platform", (String)"HxLicensePlatformServiceEditor.systemReboot.message"), hxOp);
} else if (bBoolean2.getBoolean()) {
BSystemPlatformService bSystemPlatformService = (BSystemPlatformService)Sys.getService((Type)BSystemPlatformService.TYPE);
bSystemPlatformService.restartStation();
LocalSessionUtil.getLocalSession().sendMessage(new ReloadLicenseMessage());
HxMessageHelper.appendMessage("LicensePlatformServiceEditor", LexiconText.make((String)"platform", (String)"HxLicensePlatformServiceEditor.systemRestart.message"), hxOp);
} else {
HxMessageHelper.appendMessage("LicensePlatformServiceEditor", LexiconText.make((String)"platform", (String)"HxLicensePlatformServiceEditor.needRestart.message"), hxOp);
}
}
} else if (string.equalsIgnoreCase("license")) {
LicenseInfo licenseInfo = new LicenseInfo(bIFile);
if (!licenseInfo.vendorLicense.getHostId().equals(Nre.getHostId())) {
throw new LocalizableRuntimeException("platform", "LicensePlatformServicePlugin.badHostId.message", new Object[]{hxOp.getFormValue("file")});
}
LicenseInfo[] licenseInfoArray = new LicenseInfo[]{licenseInfo};
licenseSync = PortalLicenseUtil.syncLicenses(Nre.getHostId(), LicenseInfo.listLocal(), licenseInfoArray);
if (this.sync(hxOp, licenseSync, "LicensePlatformServicePlugin.sync.currentMessage", "LicensePlatformServicePlugin.sync.successMessage")) {
BBoolean bBoolean = (BBoolean)this.rebootFE.save((BObject)BBoolean.FALSE, hxOp);
BBoolean bBoolean3 = (BBoolean)this.restartFE.save((BObject)BBoolean.FALSE, hxOp);
if (bBoolean.getBoolean()) {
BSystemPlatformService bSystemPlatformService = (BSystemPlatformService)Sys.getService((Type)BSystemPlatformService.TYPE);
bSystemPlatformService.reboot();
HxMessageHelper.appendMessage("LicensePlatformServiceEditor", LexiconText.make((String)"platform", (String)"HxLicensePlatformServiceEditor.systemReboot.message"), hxOp);
} else if (bBoolean3.getBoolean()) {
BSystemPlatformService bSystemPlatformService = (BSystemPlatformService)Sys.getService((Type)BSystemPlatformService.TYPE);
bSystemPlatformService.restartStation();
LocalSessionUtil.getLocalSession().sendMessage(new ReloadLicenseMessage());
HxMessageHelper.appendMessage("LicensePlatformServiceEditor", LexiconText.make((String)"platform", (String)"HxLicensePlatformServiceEditor.systemRestart.message"), hxOp);
} else {
HxMessageHelper.appendMessage("LicensePlatformServiceEditor", LexiconText.make((String)"platform", (String)"HxLicensePlatformServiceEditor.needRestart.message"), hxOp);
}
}
} else if (string.equalsIgnoreCase("certificate")) {
CertificateInfo[] certificateInfoArray = new CertificateInfo[]{new CertificateInfo(bIFile)};
licenseSync = PortalLicenseUtil.syncCertificates(CertificateInfo.listLocal(), certificateInfoArray);
this.sync(hxOp, licenseSync, "LicensePlatformServicePlugin.syncCerts.currentMessage", "LicensePlatformServicePlugin.syncCerts.successMessage");
} else {
throw new LocalizableRuntimeException("platform", "HxLicensePlatformServiceEditor.badFileType.message", new Object[]{hxOp.getFormValue("file")});
}
}
return super.save(hxOp);
}
private final boolean sync(HxOp hxOp, LicenseSync licenseSync, String string, String string2) throws Exception {
BIFile bIFile;
IFileInfo iFileInfo;
int n;
if (licenseSync == null) {
return false;
}
StringBuffer stringBuffer = new StringBuffer();
Lexicon lexicon = hxOp.getLexicon("platform");
if (licenseSync.unchanged()) {
HxMessageHelper.addMessage("LicensePlatformServiceEditor", null, lexicon.getText(string), BColor.blue, hxOp);
return false;
}
stringBuffer.append("<table cellpadding='5'>");
stringBuffer.append("<tr><td colspan='2'>");
stringBuffer.append(lexicon.getText(string2));
stringBuffer.append("</td></tr>");
int n2 = licenseSync.toRemove.size();
if (n2 > 0) {
stringBuffer.append("<tr><td colspan='2'>");
stringBuffer.append(lexicon.getText("UiUtil.removed"));
stringBuffer.append("</td></tr>");
n = 0;
while (n < n2) {
iFileInfo = (IFileInfo)licenseSync.toRemove.get(n);
stringBuffer.append("<tr><td>&nbsp;</td><td width='100%'>");
stringBuffer.append(iFileInfo.toString((Context)hxOp));
stringBuffer.append("</td></tr>");
iFileInfo.getFile().delete();
++n;
}
}
if ((n2 = licenseSync.toAdd.size()) > 0) {
stringBuffer.append("<tr><td colspan='2'>");
stringBuffer.append(lexicon.getText("UiUtil.added"));
stringBuffer.append("</td></tr>");
n = 0;
while (n < n2) {
iFileInfo = (IFileInfo)licenseSync.toAdd.get(n);
bIFile = BFileSystem.INSTANCE.makeFile(iFileInfo.getInstalledFilePath());
iFileInfo.write(bIFile.getOutputStream());
stringBuffer.append("<tr><td>&nbsp;</td><td width='100%'>");
stringBuffer.append(iFileInfo.toString((Context)hxOp));
stringBuffer.append("</td></tr>");
++n;
}
}
if ((n2 = licenseSync.toUpdate.size()) > 0) {
stringBuffer.append("<tr><td colspan='2'>");
stringBuffer.append(lexicon.getText("UiUtil.updated"));
stringBuffer.append("</td></tr>");
n = 0;
while (n < n2) {
iFileInfo = (IFileInfo)licenseSync.toUpdate.get(n);
bIFile = BFileSystem.INSTANCE.makeFile(iFileInfo.getInstalledFilePath());
iFileInfo.write(bIFile.getOutputStream());
stringBuffer.append("<tr><td>&nbsp;</td><td width='100%'>");
stringBuffer.append(iFileInfo.toString((Context)hxOp));
stringBuffer.append("</td></tr>");
++n;
}
}
stringBuffer.append("</table>");
HxMessageHelper.addMessage("LicensePlatformServiceEditor", null, stringBuffer.toString(), BColor.blue, hxOp);
return true;
}
static /* synthetic */ Class class(String string, boolean bl) {
try {
Class<?> clazz = Class.forName(string);
if (!bl) {
clazz = clazz.getComponentType();
}
return clazz;
}
catch (ClassNotFoundException classNotFoundException) {
throw new NoClassDefFoundError(classNotFoundException.getMessage());
}
}
protected BHxLicensePlatformServiceEditor() {
this.registerEvent((Event)this.delete);
this.rebootFE = HxBooleanHelper.makeFE("systemReboot", null);
this.restartFE = HxBooleanHelper.makeFE("systemRestart", null);
}
static {
Class clazz = class$com$tridium$platform$hx$BHxLicensePlatformServiceEditor;
if (clazz == null) {
clazz = class$com$tridium$platform$hx$BHxLicensePlatformServiceEditor = BHxLicensePlatformServiceEditor.class("[Lcom.tridium.platform.hx.BHxLicensePlatformServiceEditor;", false);
}
TYPE = Sys.loadType((Class)clazz);
}
/*
* Illegal identifiers - consider using --renameillegalidents true
*/
private class Delete
extends Command {
private FileInfoTable table;
private LexiconText label;
public String getInvokeCode(HxOp hxOp) {
StringBuffer stringBuffer = new StringBuffer();
stringBuffer.append("if (confirm(\"");
stringBuffer.append(hxOp.getLexicon("platform").getText("FileInfoTable.confirmDelete"));
stringBuffer.append("\"))");
stringBuffer.append(super.getInvokeCode(hxOp));
return stringBuffer.toString();
}
public void writeButton(HxOp hxOp) throws Exception {
HtmlWriter htmlWriter = hxOp.getHtmlWriter();
htmlWriter.w((Object)"<input ").attr("class", "button").w((Object)" ").attr("type", "button").w((Object)" ");
htmlWriter.w((Object)"onclick='").w((Object)this.getInvokeCode(hxOp)).w((Object)"' ");
htmlWriter.attr("value", this.getDisplayName(hxOp));
if (!hxOp.canWrite() || !hxOp.canInvoke()) {
htmlWriter.w((Object)" ").attr("disabled", "disabled");
}
htmlWriter.w((Object)"/>&nbsp;");
}
public void handle(HxOp hxOp) throws Exception {
IFileInfo[] iFileInfoArray = this.table.getSelected(hxOp);
int n = 0;
while (n < iFileInfoArray.length) {
iFileInfoArray[n].getFile().delete();
++n;
}
if (iFileInfoArray.length > 0) {
this.refresh(hxOp);
}
}
public String getDisplayName(HxOp hxOp) {
return this.label.getText((Context)hxOp);
}
private final /* synthetic */ void this() {
this.label = LexiconText.make((String)"bajaui", (String)"commands.delete.label");
}
public Delete(FileInfoTable fileInfoTable) {
super((BHxView)BHxLicensePlatformServiceEditor.this);
this.this();
this.table = fileInfoTable;
}
}
/*
* Illegal identifiers - consider using --renameillegalidents true
*/
private class ReloadLicenseMessage
extends XmlResponseMessage {
public String getMessageString() {
return "updatedaemon?reloadLicenses=true";
}
private ReloadLicenseMessage() {
}
}
}
@@ -0,0 +1,748 @@
/*
* Decompiled with CFR 0.152.
*
* Could not load the following classes:
* javax.baja.hx.BHxView
* javax.baja.hx.Command
* javax.baja.hx.Event
* javax.baja.hx.HxOp
* javax.baja.io.HtmlWriter
* javax.baja.nre.util.Array
* javax.baja.sys.BBoolean
* javax.baja.sys.BInteger
* javax.baja.sys.BObject
* javax.baja.sys.Context
* javax.baja.sys.LocalizableRuntimeException
* javax.baja.sys.Sys
* javax.baja.sys.Type
* javax.baja.util.Lexicon
* javax.baja.util.LexiconText
*/
package com.tridium.platform.hx;
import com.tridium.platform.BSystemPlatformService;
import com.tridium.platform.daemon.BDaemonAccessLevel;
import com.tridium.platform.hx.util.HxBooleanHelper;
import com.tridium.platform.hx.util.HxButtonHelper;
import com.tridium.platform.hx.util.HxMessageHelper;
import com.tridium.platform.hx.util.HxViewHelper;
import com.tridium.platform.linux.BNtpPlatformServiceLinux;
import com.tridium.platform.linux.BNtpServerLinux;
import com.tridium.platform.ntp.BNtpPlatformService;
import com.tridium.platform.posix.BNtpModePosix;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import javax.baja.hx.BHxView;
import javax.baja.hx.Command;
import javax.baja.hx.Event;
import javax.baja.hx.HxOp;
import javax.baja.io.HtmlWriter;
import javax.baja.nre.util.Array;
import javax.baja.sys.BBoolean;
import javax.baja.sys.BInteger;
import javax.baja.sys.BObject;
import javax.baja.sys.Context;
import javax.baja.sys.LocalizableRuntimeException;
import javax.baja.sys.Sys;
import javax.baja.sys.Type;
import javax.baja.util.Lexicon;
import javax.baja.util.LexiconText;
/*
* Illegal identifiers - consider using --renameillegalidents true
*/
public class BHxNtpPlatSvcLinuxEditor
extends BHxView {
public static final BHxNtpPlatSvcLinuxEditor INSTANCE = new BHxNtpPlatSvcLinuxEditor();
public static final Type TYPE;
private HxButtonHelper refreshButton = HxButtonHelper.makeRefresh();
private HxButtonHelper saveButton = HxButtonHelper.makeSave();
private Command handleEnabledChanged = new HandleEnabledChanged();
private Command handleServerModified;
private Command handleDeleteServer;
private Command handleAddServer;
private Command handleMoveServerUp;
private Command handleMoveServerDown;
private HxViewHelper enabledFe;
private HxViewHelper statsFe;
private HxViewHelper ntpFe;
private HxViewHelper localBackupFe;
private HxViewHelper revokeIntervalFe;
private HxViewHelper autokeyRegenIntervalFe;
private HxViewHelper authFe;
private HxViewHelper monitorFe;
static /* synthetic */ Class class$com$tridium$platform$hx$BHxNtpPlatSvcLinuxEditor;
static /* synthetic */ Class class$com$tridium$platform$linux$BNtpServerLinux;
public Type getType() {
return TYPE;
}
/*
* Unable to fully structure code
*/
public void write(HxOp var1_1) throws Exception {
var2_2 = (BNtpPlatformServiceLinux)var1_1.get();
var2_2.poll();
var3_3 = (BSystemPlatformService)Sys.getService((Type)BSystemPlatformService.TYPE);
var3_3.checkPropertiesLoaded();
if (var1_1.canWrite()) {
if (var3_3.getLocalDaemonAccess() == BDaemonAccessLevel.restricted) {
var1_1.setReadonly(true);
var4_4 = true;
} else {
var4_4 = false;
}
} else {
var4_4 = true;
}
var5_5 = var1_1.getHtmlWriter();
var5_5.w((Object)"<div class='hx-PropertySheet-header'>").safe(LexiconText.make((Type)BHxNtpPlatSvcLinuxEditor.TYPE, (String)"NtpPlatformService.settings.label").getText((Context)var1_1)).w((Object)"</div>");
var5_5.w((Object)"<div class='window-bg hx-PropertySheet'>");
var5_5.w((Object)"<table cellpadding='5'>");
var5_5.w((Object)"<tr>");
var5_5.w((Object)"<td><b>").w((Object)LexiconText.make((Type)BHxNtpPlatSvcLinuxEditor.TYPE, (String)"NtpPlatformService.enabled.label").getText((Context)var1_1)).w((Object)"</b></td>");
var5_5.w((Object)"<td>");
var5_5.w((Object)"<select ").attr("name", var1_1.scope("enabled.value"));
if (var4_4) {
var5_5.w((Object)" disabled='disabled'");
}
var5_5.w((Object)" onchange='").w((Object)this.handleEnabledChanged.getInvokeCode(var1_1)).w((Object)"' ");
var5_5.w((Object)">");
var5_5.w((Object)"<option value='false'");
if (!var2_2.getEnabled()) {
var5_5.w((Object)" selected='selected'");
}
var5_5.w((Object)">").w((Object)BBoolean.toString((boolean)false, (Context)var1_1)).w((Object)"</option>");
var5_5.w((Object)"<option value='true'");
if (var2_2.getEnabled()) {
var5_5.w((Object)" selected='selected'");
}
var5_5.w((Object)">").w((Object)BBoolean.toString((boolean)true, (Context)var1_1)).w((Object)"</option>");
var5_5.w((Object)"</select>");
var5_5.w((Object)"</td>");
var5_5.w((Object)"</tr>");
var5_5.w((Object)"<tr>");
var5_5.w((Object)"<td><b>").w((Object)LexiconText.make((Type)BHxNtpPlatSvcLinuxEditor.TYPE, (String)"NtpPlatformServicePosix.autoKeyRegen.label").getText((Context)var1_1)).w((Object)"</b></td>");
var5_5.w((Object)"<td>");
this.autokeyRegenIntervalFe.setReadonly(var4_4);
this.autokeyRegenIntervalFe.write((BObject)var2_2.get(BNtpPlatformServiceLinux.autokey), var1_1);
var5_5.w((Object)"</td>");
var5_5.w((Object)"</tr>");
var5_5.w((Object)"<tr>");
var5_5.w((Object)"<td><b>").w((Object)LexiconText.make((Type)BHxNtpPlatSvcLinuxEditor.TYPE, (String)"NtpPlatformServicePosix.autoKeyRevoke.label").getText((Context)var1_1)).w((Object)"</b></td>");
var5_5.w((Object)"<td>");
this.revokeIntervalFe.setReadonly(var4_4);
this.revokeIntervalFe.write((BObject)var2_2.get(BNtpPlatformServiceLinux.revoke), var1_1);
var5_5.w((Object)"</td>");
var5_5.w((Object)"</tr>");
var5_5.w((Object)"<tr>");
var5_5.w((Object)"<td><b>").w((Object)LexiconText.make((Type)BHxNtpPlatSvcLinuxEditor.TYPE, (String)"NtpPlatformServicePosix.stats.label").getText((Context)var1_1)).w((Object)"</b></td>");
var5_5.w((Object)"<td>");
this.statsFe.setReadonly(var4_4);
this.statsFe.write((BObject)var2_2.get(BNtpPlatformServiceLinux.statistics), var1_1);
var5_5.w((Object)"</td>");
var5_5.w((Object)"</tr>");
var5_5.w((Object)"<tr>");
var5_5.w((Object)"<td><b>").w((Object)LexiconText.make((Type)BHxNtpPlatSvcLinuxEditor.TYPE, (String)"NtpPlatformServicePosix.auth.label").getText((Context)var1_1)).w((Object)"</b></td>");
var5_5.w((Object)"<td>");
this.authFe.setReadonly(var4_4);
this.authFe.write((BObject)var2_2.get(BNtpPlatformServiceLinux.authentication), var1_1);
var5_5.w((Object)"</td>");
var5_5.w((Object)"</tr>");
var5_5.w((Object)"<tr>");
var5_5.w((Object)"<td><b>").w((Object)LexiconText.make((Type)BHxNtpPlatSvcLinuxEditor.TYPE, (String)"NtpPlatformServicePosix.ntp.label").getText((Context)var1_1)).w((Object)"</b></td>");
var5_5.w((Object)"<td>");
this.ntpFe.setReadonly(var4_4);
this.ntpFe.write((BObject)var2_2.get(BNtpPlatformServiceLinux.ntp), var1_1);
var5_5.w((Object)"</td>");
var5_5.w((Object)"</tr>");
var5_5.w((Object)"<tr>");
var5_5.w((Object)"<td><b>").w((Object)LexiconText.make((Type)BHxNtpPlatSvcLinuxEditor.TYPE, (String)"NtpPlatformServicePosix.localBackup.label").getText((Context)var1_1)).w((Object)"</b></td>");
var5_5.w((Object)"<td>");
this.localBackupFe.setReadonly(var4_4);
this.localBackupFe.write((BObject)var2_2.get(BNtpPlatformServiceLinux.localBackup), var1_1);
var5_5.w((Object)"</td>");
var5_5.w((Object)"</tr>");
var5_5.w((Object)"<tr>");
var5_5.w((Object)"<td><b>").w((Object)LexiconText.make((Type)BHxNtpPlatSvcLinuxEditor.TYPE, (String)"NtpPlatformServicePosix.monitor.label").getText((Context)var1_1)).w((Object)"</b></td>");
var5_5.w((Object)"<td>");
this.monitorFe.setReadonly(var4_4);
this.monitorFe.write((BObject)var2_2.get(BNtpPlatformServiceLinux.monitor), var1_1);
var5_5.w((Object)"</td>");
var5_5.w((Object)"</tr>");
var5_5.w((Object)"<td>");
var5_5.w((Object)"<input type='hidden'");
var5_5.w((Object)" ").attr("name", var1_1.scope("panic"));
var5_5.w((Object)" ").attr("value", var2_2.getPanic());
var5_5.w((Object)"/>");
var5_5.w((Object)"</td>");
var5_5.w((Object)"</table>");
var5_5.w((Object)"</div>");
var5_5.w((Object)"<div class='hx-PropertySheet-header'>").safe(LexiconText.make((Type)BHxNtpPlatSvcLinuxEditor.TYPE, (String)"NtpPlatformService.timeServers.label").getText((Context)var1_1)).w((Object)"</div>");
var5_5.w((Object)"<div class='window-bg hx-PropertySheet'>");
var5_5.w((Object)"<div id='").w((Object)var1_1.scope("serversSection")).w((Object)"'>");
this.writeServersTableHeader(var1_1, var5_5);
var6_6 = 0;
var7_7 = var2_2.getTimeServers().getProperties();
if (true) ** GOTO lbl168
do {
var8_8 = (BNtpServerLinux)var7_7.get();
this.writeServerRow(var1_1, var5_5, var6_6++, var8_8, false);
lbl168:
// 2 sources
if ((v0 = BHxNtpPlatSvcLinuxEditor.class$com$tridium$platform$linux$BNtpServerLinux) != null) continue;
v0 = BHxNtpPlatSvcLinuxEditor.class("[Lcom.tridium.platform.linux.BNtpServerLinux;", false);
} while (var7_7.next(v0));
this.writeServersTableFooter(var1_1, var5_5);
var5_5.w((Object)"</div>");
var5_5.println("<div style='padding:10px; text-align:center;'>");
this.refreshButton.write(var1_1);
if (!var4_4) {
var7_7 = new HashMap<K, V>();
var7_7.put("onclick", "if (window.confirm(\"" + Lexicon.make((String)"platform").getText("NtpPlatformService.rebootPrompt.hxConfirmMessage") + "\")) { document.forms[0].submit(); }");
this.saveButton.write(var1_1, (Map)var7_7);
}
var5_5.println("</div>");
var5_5.println("</div>");
}
protected void writeServersTableHeader(HxOp hxOp, HtmlWriter htmlWriter) throws Exception {
htmlWriter.w((Object)"<table cellpadding='5'>");
htmlWriter.w((Object)"<tr>");
if (hxOp.canWrite()) {
htmlWriter.w((Object)"<th>");
htmlWriter.w((Object)"</th>");
}
htmlWriter.w((Object)"<th>");
htmlWriter.w((Object)LexiconText.make((Type)TYPE, (String)"NtpPlatformService.address.label").getText((Context)hxOp));
htmlWriter.w((Object)"</th>");
htmlWriter.w((Object)"<th>");
htmlWriter.w((Object)LexiconText.make((Type)TYPE, (String)"NtpPlatformServicePosix.peerMode.label").getText((Context)hxOp));
htmlWriter.w((Object)"</th>");
htmlWriter.w((Object)"<th>");
htmlWriter.w((Object)LexiconText.make((Type)TYPE, (String)"NtpPlatformServicePosix.autoKey.label").getText((Context)hxOp));
htmlWriter.w((Object)"</th>");
htmlWriter.w((Object)"<th>");
htmlWriter.w((Object)LexiconText.make((Type)TYPE, (String)"NtpPlatformServicePosix.manualKey.label").getText((Context)hxOp));
htmlWriter.w((Object)"</th>");
htmlWriter.w((Object)"<th>");
htmlWriter.w((Object)LexiconText.make((Type)TYPE, (String)"NtpPlatformServicePosix.burst.label").getText((Context)hxOp));
htmlWriter.w((Object)"</th>");
htmlWriter.w((Object)"<th>");
htmlWriter.w((Object)LexiconText.make((Type)TYPE, (String)"NtpPlatformServicePosix.prefer.label").getText((Context)hxOp));
htmlWriter.w((Object)"</th>");
htmlWriter.w((Object)"<th>");
htmlWriter.w((Object)LexiconText.make((Type)TYPE, (String)"NtpPlatformServicePosix.minPollInterval.label").getText((Context)hxOp));
htmlWriter.w((Object)"</th>");
htmlWriter.w((Object)"<th>");
htmlWriter.w((Object)LexiconText.make((Type)TYPE, (String)"NtpPlatformServicePosix.maxPollInterval.label").getText((Context)hxOp));
htmlWriter.w((Object)"</th>");
htmlWriter.w((Object)"</tr>");
}
protected void writeServersTableFooter(HxOp hxOp, HtmlWriter htmlWriter) throws Exception {
if (hxOp.canWrite()) {
htmlWriter.w((Object)"<tr><td colspan='5' align='center'>");
htmlWriter.w((Object)"<a href='javascript:").w((Object)this.handleAddServer.getInvokeCode(hxOp)).w((Object)"'>");
htmlWriter.w((Object)"<img border='0' src='module://icons/x16/add.png'/>");
htmlWriter.w((Object)"</a>");
htmlWriter.w((Object)"&nbsp;");
htmlWriter.w((Object)"<a href='javascript:").w((Object)this.handleDeleteServer.getInvokeCode(hxOp)).w((Object)"'>");
htmlWriter.w((Object)"<img border='0' src='module://icons/x16/delete.png'/>");
htmlWriter.w((Object)"</a>");
htmlWriter.w((Object)"&nbsp;");
htmlWriter.w((Object)"<a href='javascript:").w((Object)this.handleMoveServerUp.getInvokeCode(hxOp)).w((Object)"'>");
htmlWriter.w((Object)"<img border='0' src='module://icons/x16/arrowUp.png'/>");
htmlWriter.w((Object)"</a>");
htmlWriter.w((Object)"&nbsp;");
htmlWriter.w((Object)"<a href='javascript:").w((Object)this.handleMoveServerDown.getInvokeCode(hxOp)).w((Object)"'>");
htmlWriter.w((Object)"<img border='0' src='module://icons/x16/arrowDown.png'/>");
htmlWriter.w((Object)"</a>");
htmlWriter.w((Object)"</td></tr>");
}
htmlWriter.w((Object)"</table>");
}
protected void writeServerRow(HxOp hxOp, HtmlWriter htmlWriter, int n, BNtpServerLinux bNtpServerLinux, boolean bl) throws Exception {
htmlWriter.w((Object)"<tr>");
if (hxOp.canWrite()) {
htmlWriter.w((Object)"<td>");
htmlWriter.w((Object)"<input type='checkbox' name='").w((Object)hxOp.scope("select_" + n)).w((Object)"'");
if (bl) {
htmlWriter.w((Object)" checked='checked'");
}
htmlWriter.w((Object)"/>");
htmlWriter.w((Object)"</td>");
htmlWriter.w((Object)"<td>");
htmlWriter.w((Object)"<input type='text' size='32'");
htmlWriter.w((Object)" ").attr("name", hxOp.scope("address_" + n));
htmlWriter.w((Object)" ").attr("value", bNtpServerLinux.getAddress());
htmlWriter.w((Object)"/>");
htmlWriter.w((Object)"</td>");
htmlWriter.w((Object)"<td>");
htmlWriter.w((Object)"<select ").attr("name", hxOp.scope("peerMode_" + n));
htmlWriter.w((Object)" onchange='").w((Object)this.handleServerModified.getInvokeCode(hxOp)).w((Object)"'");
htmlWriter.w((Object)">");
htmlWriter.w((Object)"<option value='2'");
if (bNtpServerLinux.getPeerMode() == BNtpModePosix.server) {
htmlWriter.w((Object)" selected='selected'");
}
htmlWriter.w((Object)">").w((Object)BNtpModePosix.server.toString((Context)hxOp)).w((Object)"</option>");
htmlWriter.w((Object)"<option value='1'");
if (bNtpServerLinux.getPeerMode() == BNtpModePosix.peer) {
htmlWriter.w((Object)" selected='selected'");
}
htmlWriter.w((Object)">").w((Object)BNtpModePosix.peer.toString((Context)hxOp)).w((Object)"</option>");
htmlWriter.w((Object)"<option value='3'");
if (bNtpServerLinux.getPeerMode() == BNtpModePosix.broadcast) {
htmlWriter.w((Object)" selected='selected'");
}
htmlWriter.w((Object)">").w((Object)BNtpModePosix.broadcast.toString((Context)hxOp)).w((Object)"</option>");
htmlWriter.w((Object)"<option value='4'");
if (bNtpServerLinux.getPeerMode() == BNtpModePosix.manycastclient) {
htmlWriter.w((Object)" selected='selected'");
}
htmlWriter.w((Object)">").w((Object)BNtpModePosix.manycastclient.toString((Context)hxOp)).w((Object)"</option>");
htmlWriter.w((Object)"</select>");
htmlWriter.w((Object)"</td>");
htmlWriter.w((Object)"<td>");
htmlWriter.w((Object)"<select ").attr("name", hxOp.scope("useAutokey_" + n));
htmlWriter.w((Object)" onchange='").w((Object)this.handleServerModified.getInvokeCode(hxOp)).w((Object)"'");
htmlWriter.w((Object)">");
htmlWriter.w((Object)"<option value='false'");
if (!bNtpServerLinux.getUseAutokey()) {
htmlWriter.w((Object)" selected='selected'");
}
htmlWriter.w((Object)">").w((Object)BBoolean.FALSE.toString((Context)hxOp)).w((Object)"</option>");
htmlWriter.w((Object)"<option value='true'");
if (bNtpServerLinux.getUseAutokey()) {
htmlWriter.w((Object)" selected='selected'");
}
htmlWriter.w((Object)">").w((Object)BBoolean.TRUE.toString((Context)hxOp)).w((Object)"</option>");
htmlWriter.w((Object)"</select>");
htmlWriter.w((Object)"</td>");
htmlWriter.w((Object)"<td>");
htmlWriter.w((Object)"<input type='text' size='6'");
htmlWriter.w((Object)" ").attr("name", hxOp.scope("key_" + n));
htmlWriter.w((Object)" ").attr("value", bNtpServerLinux.getUseKey() == 0 ? "" : String.valueOf(bNtpServerLinux.getUseKey()));
if (bNtpServerLinux.getUseAutokey()) {
htmlWriter.w((Object)" disabled='disabled'");
}
htmlWriter.w((Object)"/>");
htmlWriter.w((Object)"</td>");
htmlWriter.w((Object)"<td>");
htmlWriter.w((Object)"<select ").attr("name", hxOp.scope("useBurst_" + n));
htmlWriter.w((Object)">");
htmlWriter.w((Object)"<option value='false'");
if (!bNtpServerLinux.getUseBurst()) {
htmlWriter.w((Object)" selected='selected'");
}
htmlWriter.w((Object)">").w((Object)BBoolean.FALSE.toString((Context)hxOp)).w((Object)"</option>");
htmlWriter.w((Object)"<option value='true'");
if (bNtpServerLinux.getUseBurst()) {
htmlWriter.w((Object)" selected='selected'");
}
htmlWriter.w((Object)">").w((Object)BBoolean.TRUE.toString((Context)hxOp)).w((Object)"</option>");
htmlWriter.w((Object)"</select>");
htmlWriter.w((Object)"</td>");
htmlWriter.w((Object)"<td>");
htmlWriter.w((Object)"<select ").attr("name", hxOp.scope("serverPreferred_" + n));
if (bNtpServerLinux.getPeerMode() == BNtpModePosix.manycastclient || bNtpServerLinux.getPeerMode() == BNtpModePosix.broadcast) {
htmlWriter.w((Object)" disabled='disabled'");
}
htmlWriter.w((Object)"<option value='false'");
if (!bNtpServerLinux.getServerPreferred()) {
htmlWriter.w((Object)" selected='selected'");
}
htmlWriter.w((Object)">").w((Object)BBoolean.FALSE.toString((Context)hxOp)).w((Object)"</option>");
htmlWriter.w((Object)"<option value='true'");
if (bNtpServerLinux.getServerPreferred()) {
htmlWriter.w((Object)" selected='selected'");
}
htmlWriter.w((Object)">").w((Object)BBoolean.TRUE.toString((Context)hxOp)).w((Object)"</option>");
htmlWriter.w((Object)"</select>");
htmlWriter.w((Object)"</td>");
htmlWriter.w((Object)"<td>");
htmlWriter.w((Object)"<input type='text' size='5'");
htmlWriter.w((Object)" ").attr("name", hxOp.scope("minpoll_" + n));
htmlWriter.w((Object)" ").attr("value", bNtpServerLinux.getMinPollInterval());
htmlWriter.w((Object)"/>");
htmlWriter.safe(BNtpPlatformService.LOG_2_SEC_UNIT.getSymbol());
htmlWriter.w((Object)"</td>");
htmlWriter.w((Object)"<td>");
htmlWriter.w((Object)"<input type='text' size='5'");
htmlWriter.w((Object)" ").attr("name", hxOp.scope("maxpoll_" + n));
htmlWriter.w((Object)" ").attr("value", bNtpServerLinux.getMaxPollInterval());
htmlWriter.w((Object)"/>");
htmlWriter.safe(BNtpPlatformService.LOG_2_SEC_UNIT.getSymbol());
htmlWriter.w((Object)"</td>");
htmlWriter.w((Object)"<td>");
htmlWriter.w((Object)"<input type='hidden'");
htmlWriter.w((Object)" ").attr("name", hxOp.scope("extraArgs_" + n));
htmlWriter.w((Object)" ").attr("value", bNtpServerLinux.getAdditionalArgs());
htmlWriter.w((Object)"/>");
htmlWriter.w((Object)"</td>");
} else {
htmlWriter.w((Object)"<td>").safe(bNtpServerLinux.getAddress()).w((Object)"</td>");
htmlWriter.w((Object)"<td>").safe(bNtpServerLinux.getPeerMode().toString((Context)hxOp)).w((Object)"</td>");
htmlWriter.w((Object)"<td>").safe(bNtpServerLinux.get(BNtpServerLinux.useAutokey).toString((Context)hxOp)).w((Object)"</td>");
htmlWriter.w((Object)"<td>").safe(bNtpServerLinux.get(BNtpServerLinux.useKey).toString((Context)hxOp)).w((Object)"</td>");
htmlWriter.w((Object)"<td>").safe(bNtpServerLinux.get(BNtpServerLinux.useBurst).toString((Context)hxOp)).w((Object)"</td>");
htmlWriter.w((Object)"<td>").safe(bNtpServerLinux.get(BNtpServerLinux.serverPreferred).toString((Context)hxOp)).w((Object)"</td>");
htmlWriter.w((Object)"<td>").safe(bNtpServerLinux.get(BNtpServerLinux.minPollInterval).toString((Context)hxOp)).w((Object)"</td>");
htmlWriter.w((Object)"<td>").safe(bNtpServerLinux.get(BNtpServerLinux.maxPollInterval).toString((Context)hxOp)).w((Object)"</td>");
}
htmlWriter.w((Object)"</tr>");
}
protected BNtpServerLinux[] getTimeServers(HxOp hxOp) throws Exception {
Class clazz = class$com$tridium$platform$linux$BNtpServerLinux;
if (clazz == null) {
clazz = class$com$tridium$platform$linux$BNtpServerLinux = BHxNtpPlatSvcLinuxEditor.class("[Lcom.tridium.platform.linux.BNtpServerLinux;", false);
}
Array array = new Array(clazz);
int n = 0;
String string = hxOp.getFormValue("address_" + n);
while (string != null) {
BNtpServerLinux bNtpServerLinux = new BNtpServerLinux();
bNtpServerLinux.setAddress(string);
bNtpServerLinux.setPeerMode(BNtpModePosix.make(Integer.parseInt(hxOp.getFormValue("peerMode_" + n))));
bNtpServerLinux.setUseAutokey(hxOp.getFormValue("useAutokey_" + n).equals("true"));
int n2 = 0;
if (hxOp.getFormValue("key_" + n) != null && hxOp.getFormValue("key_" + n).trim().length() != 0) {
n2 = Integer.valueOf(hxOp.getFormValue("key_" + n));
}
bNtpServerLinux.setUseKey(n2);
bNtpServerLinux.setUseBurst(hxOp.getFormValue("useBurst_" + n).equals("true"));
boolean bl = false;
if (hxOp.getFormValue("serverPreferred_" + n) != null) {
bl = hxOp.getFormValue("serverPreferred_" + n).equals("true");
}
bNtpServerLinux.setServerPreferred(bl);
bNtpServerLinux.setMinPollInterval(Integer.valueOf(hxOp.getFormValue("minpoll_" + n)));
bNtpServerLinux.setMaxPollInterval(Integer.valueOf(hxOp.getFormValue("maxpoll_" + n)));
bNtpServerLinux.setAdditionalArgs(hxOp.getFormValue("extraArgs_" + n));
array.add((Object)bNtpServerLinux);
string = hxOp.getFormValue("address_" + ++n);
}
return (BNtpServerLinux[])array.trim();
}
public BObject save(HxOp hxOp) throws Exception {
BNtpPlatformServiceLinux bNtpPlatformServiceLinux = (BNtpPlatformServiceLinux)hxOp.get();
BNtpServerLinux[] bNtpServerLinuxArray = this.getTimeServers(hxOp);
String[] stringArray = new String[bNtpServerLinuxArray.length];
HashSet hashSet = new HashSet();
int n = 0;
while (n < bNtpServerLinuxArray.length) {
if (bNtpServerLinuxArray[n].getAddress().trim().length() == 0) {
throw new LocalizableRuntimeException("platform", "NtpServerFE.nullAddress");
}
stringArray[n] = bNtpServerLinuxArray[n].getServerString();
String string = bNtpServerLinuxArray[n].getPropertyName(stringArray[n]);
if (hashSet.contains(string)) {
throw new LocalizableRuntimeException("platform", "NtpServerVectorFE.duplicateServer");
}
++n;
}
bNtpPlatformServiceLinux.getTimeServers().sync(stringArray);
bNtpPlatformServiceLinux.setEnabled(((BBoolean)this.enabledFe.save((BObject)bNtpPlatformServiceLinux.get(BNtpPlatformService.enabled), hxOp)).getBoolean());
bNtpPlatformServiceLinux.setAutokey(((BInteger)this.autokeyRegenIntervalFe.save((BObject)bNtpPlatformServiceLinux.get(BNtpPlatformServiceLinux.autokey), hxOp)).getInt());
bNtpPlatformServiceLinux.setRevoke(((BInteger)this.revokeIntervalFe.save((BObject)bNtpPlatformServiceLinux.get(BNtpPlatformServiceLinux.revoke), hxOp)).getInt());
bNtpPlatformServiceLinux.setStatistics(((BBoolean)this.statsFe.save((BObject)bNtpPlatformServiceLinux.get(BNtpPlatformServiceLinux.statistics), hxOp)).getBoolean());
bNtpPlatformServiceLinux.setAuthentication(((BBoolean)this.authFe.save((BObject)bNtpPlatformServiceLinux.get(BNtpPlatformServiceLinux.authentication), hxOp)).getBoolean());
bNtpPlatformServiceLinux.setNtp(((BBoolean)this.ntpFe.save((BObject)bNtpPlatformServiceLinux.get(BNtpPlatformServiceLinux.ntp), hxOp)).getBoolean());
bNtpPlatformServiceLinux.setLocalBackup(((BBoolean)this.localBackupFe.save((BObject)bNtpPlatformServiceLinux.get(BNtpPlatformServiceLinux.localBackup), hxOp)).getBoolean());
bNtpPlatformServiceLinux.setMonitor(((BBoolean)this.monitorFe.save((BObject)bNtpPlatformServiceLinux.get(BNtpPlatformServiceLinux.monitor), hxOp)).getBoolean());
bNtpPlatformServiceLinux.setPanic(Integer.valueOf(hxOp.getFormValue("panic")));
BSystemPlatformService bSystemPlatformService = (BSystemPlatformService)Sys.getService((Type)BSystemPlatformService.TYPE);
if (bSystemPlatformService.getLocalDaemonAccess() != BDaemonAccessLevel.restricted) {
bNtpPlatformServiceLinux.savePlatformServiceProperties();
bSystemPlatformService.reboot();
HxMessageHelper.addMessage("NtpPlatformLinuxServiceEditor", LexiconText.make((String)"platform", (String)"NtpPlatformService.reboot.hxMessage"), hxOp);
}
return bNtpPlatformServiceLinux;
}
static /* synthetic */ Class class(String string, boolean bl) {
try {
Class<?> clazz = Class.forName(string);
if (!bl) {
clazz = clazz.getComponentType();
}
return clazz;
}
catch (ClassNotFoundException classNotFoundException) {
throw new NoClassDefFoundError(classNotFoundException.getMessage());
}
}
protected BHxNtpPlatSvcLinuxEditor() {
this.registerEvent((Event)this.handleEnabledChanged);
this.handleServerModified = new HandleServerModified();
this.registerEvent((Event)this.handleServerModified);
this.handleAddServer = new HandleAddServer();
this.registerEvent((Event)this.handleAddServer);
this.handleDeleteServer = new HandleDeleteServer();
this.registerEvent((Event)this.handleDeleteServer);
this.handleMoveServerUp = new HandleMoveServerUp();
this.registerEvent((Event)this.handleMoveServerUp);
this.handleMoveServerDown = new HandleMoveServerDown();
this.registerEvent((Event)this.handleMoveServerDown);
this.enabledFe = HxBooleanHelper.makeFE("enabled", null);
this.ntpFe = HxBooleanHelper.makeFE("ntp", BNtpPlatformServiceLinux.ntp.getDefaultValue(), BNtpPlatformServiceLinux.ntp.getFacets());
this.localBackupFe = HxBooleanHelper.makeFE("localBackup", BNtpPlatformServiceLinux.localBackup.getDefaultValue(), BNtpPlatformServiceLinux.localBackup.getFacets());
this.statsFe = HxBooleanHelper.makeFE("stats", BNtpPlatformServiceLinux.statistics.getDefaultValue(), BNtpPlatformServiceLinux.statistics.getFacets());
this.authFe = HxBooleanHelper.makeFE("auth", BNtpPlatformServiceLinux.authentication.getDefaultValue(), BNtpPlatformServiceLinux.authentication.getFacets());
this.autokeyRegenIntervalFe = HxViewHelper.makeFE("autokeyRegenInterval", (BObject)BNtpPlatformServiceLinux.autokey.getDefaultValue(), (Context)BNtpPlatformServiceLinux.autokey.getFacets());
this.revokeIntervalFe = HxViewHelper.makeFE("revokeInterval", (BObject)BNtpPlatformServiceLinux.revoke.getDefaultValue(), (Context)BNtpPlatformServiceLinux.revoke.getFacets());
this.monitorFe = HxBooleanHelper.makeFE("montior", BNtpPlatformServiceLinux.monitor.getDefaultValue(), BNtpPlatformServiceLinux.monitor.getFacets());
}
static {
Class clazz = class$com$tridium$platform$hx$BHxNtpPlatSvcLinuxEditor;
if (clazz == null) {
clazz = class$com$tridium$platform$hx$BHxNtpPlatSvcLinuxEditor = BHxNtpPlatSvcLinuxEditor.class("[Lcom.tridium.platform.hx.BHxNtpPlatSvcLinuxEditor;", false);
}
TYPE = Sys.loadType((Class)clazz);
}
/*
* Illegal identifiers - consider using --renameillegalidents true
*/
private class HandleEnabledChanged
extends Command {
public String getDisplayName(HxOp hxOp) {
return "";
}
public void handle(HxOp hxOp) throws Exception {
}
public HandleEnabledChanged() {
super((BHxView)BHxNtpPlatSvcLinuxEditor.this);
}
}
/*
* Illegal identifiers - consider using --renameillegalidents true
*/
private class HandleServerModified
extends Command {
public String getDisplayName(HxOp hxOp) {
return "";
}
public void handle(HxOp hxOp) throws Exception {
String[] stringArray = hxOp.getFormKeys();
BNtpServerLinux[] bNtpServerLinuxArray = BHxNtpPlatSvcLinuxEditor.this.getTimeServers(hxOp);
boolean[] blArray = new boolean[bNtpServerLinuxArray.length];
int n = 0;
n = 0;
while (n < blArray.length) {
blArray[n] = false;
++n;
}
int n2 = 0;
while (n2 < stringArray.length) {
if (stringArray[n2].startsWith("select_")) {
n = Integer.parseInt(stringArray[n2].substring(7));
blArray[n] = true;
}
++n2;
}
String string = hxOp.scope("serversSection");
HtmlWriter htmlWriter = hxOp.getHtmlWriter();
htmlWriter.w((Object)"var serversSection = document.getElementById('").w((Object)string).w((Object)"');");
htmlWriter.w((Object)"serversSection.innerHTML = \"");
BHxNtpPlatSvcLinuxEditor.this.writeServersTableHeader(hxOp, htmlWriter);
int n3 = 0;
while (n3 < bNtpServerLinuxArray.length) {
BHxNtpPlatSvcLinuxEditor.this.writeServerRow(hxOp, htmlWriter, n3, bNtpServerLinuxArray[n3], blArray[n3]);
++n3;
}
BHxNtpPlatSvcLinuxEditor.this.writeServersTableFooter(hxOp, htmlWriter);
htmlWriter.w((Object)"\";");
}
public HandleServerModified() {
super((BHxView)BHxNtpPlatSvcLinuxEditor.this);
}
}
/*
* Illegal identifiers - consider using --renameillegalidents true
*/
private class HandleAddServer
extends Command {
public String getDisplayName(HxOp hxOp) {
return "";
}
public void handle(HxOp hxOp) throws Exception {
BNtpServerLinux[] bNtpServerLinuxArray = BHxNtpPlatSvcLinuxEditor.this.getTimeServers(hxOp);
String string = hxOp.scope("serversSection");
HtmlWriter htmlWriter = hxOp.getHtmlWriter();
htmlWriter.w((Object)"var serversSection = document.getElementById('").w((Object)string).w((Object)"');");
htmlWriter.w((Object)"serversSection.innerHTML = \"");
BHxNtpPlatSvcLinuxEditor.this.writeServersTableHeader(hxOp, htmlWriter);
int n = 0;
while (n < bNtpServerLinuxArray.length) {
BHxNtpPlatSvcLinuxEditor.this.writeServerRow(hxOp, htmlWriter, n, bNtpServerLinuxArray[n], false);
++n;
}
BHxNtpPlatSvcLinuxEditor.this.writeServerRow(hxOp, htmlWriter, bNtpServerLinuxArray.length, new BNtpServerLinux(), false);
BHxNtpPlatSvcLinuxEditor.this.writeServersTableFooter(hxOp, htmlWriter);
htmlWriter.w((Object)"\";");
}
public HandleAddServer() {
super((BHxView)BHxNtpPlatSvcLinuxEditor.this);
}
}
/*
* Illegal identifiers - consider using --renameillegalidents true
*/
private class HandleDeleteServer
extends Command {
public String getDisplayName(HxOp hxOp) {
return "";
}
public void handle(HxOp hxOp) throws Exception {
BNtpServerLinux[] bNtpServerLinuxArray = BHxNtpPlatSvcLinuxEditor.this.getTimeServers(hxOp);
String string = hxOp.scope("serversSection");
HtmlWriter htmlWriter = hxOp.getHtmlWriter();
htmlWriter.w((Object)"var serversSection = document.getElementById('").w((Object)string).w((Object)"');");
htmlWriter.w((Object)"serversSection.innerHTML = \"");
BHxNtpPlatSvcLinuxEditor.this.writeServersTableHeader(hxOp, htmlWriter);
int n = 0;
int n2 = 0;
while (n2 < bNtpServerLinuxArray.length) {
if (hxOp.getFormValue("select_" + n2) == null) {
BHxNtpPlatSvcLinuxEditor.this.writeServerRow(hxOp, htmlWriter, n2 - n, bNtpServerLinuxArray[n2], false);
} else {
++n;
}
++n2;
}
BHxNtpPlatSvcLinuxEditor.this.writeServersTableFooter(hxOp, htmlWriter);
htmlWriter.w((Object)"\";");
}
public HandleDeleteServer() {
super((BHxView)BHxNtpPlatSvcLinuxEditor.this);
}
}
/*
* Illegal identifiers - consider using --renameillegalidents true
*/
private class HandleMoveServerUp
extends Command {
public String getDisplayName(HxOp hxOp) {
return "";
}
public void handle(HxOp hxOp) throws Exception {
String[] stringArray = hxOp.getFormKeys();
int n = -1;
int n2 = 0;
while (n2 < stringArray.length) {
if (stringArray[n2].startsWith("select_")) {
if (n < 0) {
n = Integer.parseInt(stringArray[n2].substring(7));
} else {
return;
}
}
++n2;
}
if (n > 0) {
BNtpServerLinux[] bNtpServerLinuxArray = BHxNtpPlatSvcLinuxEditor.this.getTimeServers(hxOp);
BNtpServerLinux bNtpServerLinux = bNtpServerLinuxArray[n - 1];
bNtpServerLinuxArray[n - 1] = bNtpServerLinuxArray[n];
bNtpServerLinuxArray[n] = bNtpServerLinux;
String string = hxOp.scope("serversSection");
HtmlWriter htmlWriter = hxOp.getHtmlWriter();
htmlWriter.w((Object)"var serversSection = document.getElementById('").w((Object)string).w((Object)"');");
htmlWriter.w((Object)"serversSection.innerHTML = \"");
BHxNtpPlatSvcLinuxEditor.this.writeServersTableHeader(hxOp, htmlWriter);
int n3 = 0;
while (n3 < bNtpServerLinuxArray.length) {
BNtpServerLinux bNtpServerLinux2 = bNtpServerLinuxArray[n3];
boolean bl = false;
if (n3 == n - 1) {
bl = true;
}
BHxNtpPlatSvcLinuxEditor.this.writeServerRow(hxOp, htmlWriter, n3, bNtpServerLinux2, bl);
++n3;
}
BHxNtpPlatSvcLinuxEditor.this.writeServersTableFooter(hxOp, htmlWriter);
htmlWriter.w((Object)"\";");
}
}
public HandleMoveServerUp() {
super((BHxView)BHxNtpPlatSvcLinuxEditor.this);
}
}
/*
* Illegal identifiers - consider using --renameillegalidents true
*/
private class HandleMoveServerDown
extends Command {
public String getDisplayName(HxOp hxOp) {
return "";
}
public void handle(HxOp hxOp) throws Exception {
String[] stringArray = hxOp.getFormKeys();
int n = -1;
int n2 = 0;
while (n2 < stringArray.length) {
if (stringArray[n2].startsWith("select_")) {
if (n < 0) {
n = Integer.parseInt(stringArray[n2].substring(7));
} else {
return;
}
}
++n2;
}
if (n >= 0 && hxOp.getFormValue("address_" + (n + 1)) != null) {
BNtpServerLinux[] bNtpServerLinuxArray = BHxNtpPlatSvcLinuxEditor.this.getTimeServers(hxOp);
BNtpServerLinux bNtpServerLinux = bNtpServerLinuxArray[n + 1];
bNtpServerLinuxArray[n + 1] = bNtpServerLinuxArray[n];
bNtpServerLinuxArray[n] = bNtpServerLinux;
String string = hxOp.scope("serversSection");
HtmlWriter htmlWriter = hxOp.getHtmlWriter();
htmlWriter.w((Object)"var serversSection = document.getElementById('").w((Object)string).w((Object)"');");
htmlWriter.w((Object)"serversSection.innerHTML = \"");
BHxNtpPlatSvcLinuxEditor.this.writeServersTableHeader(hxOp, htmlWriter);
int n3 = 0;
while (n3 < bNtpServerLinuxArray.length) {
BNtpServerLinux bNtpServerLinux2 = bNtpServerLinuxArray[n3];
boolean bl = false;
if (n3 == n + 1) {
bl = true;
}
BHxNtpPlatSvcLinuxEditor.this.writeServerRow(hxOp, htmlWriter, n3, bNtpServerLinux2, bl);
++n3;
}
BHxNtpPlatSvcLinuxEditor.this.writeServersTableFooter(hxOp, htmlWriter);
htmlWriter.w((Object)"\";");
}
}
public HandleMoveServerDown() {
super((BHxView)BHxNtpPlatSvcLinuxEditor.this);
}
}
}
@@ -0,0 +1,666 @@
/*
* Decompiled with CFR 0.152.
*
* Could not load the following classes:
* javax.baja.hx.BHxView
* javax.baja.hx.Command
* javax.baja.hx.Event
* javax.baja.hx.HxOp
* javax.baja.io.HtmlWriter
* javax.baja.nre.util.Array
* javax.baja.sys.BBoolean
* javax.baja.sys.BObject
* javax.baja.sys.Context
* javax.baja.sys.LocalizableRuntimeException
* javax.baja.sys.Sys
* javax.baja.sys.Type
* javax.baja.util.Lexicon
* javax.baja.util.LexiconText
*/
package com.tridium.platform.hx;
import com.tridium.platform.BSystemPlatformService;
import com.tridium.platform.daemon.BDaemonAccessLevel;
import com.tridium.platform.hx.util.HxBooleanHelper;
import com.tridium.platform.hx.util.HxButtonHelper;
import com.tridium.platform.hx.util.HxMessageHelper;
import com.tridium.platform.hx.util.HxViewHelper;
import com.tridium.platform.npsdk.BNtpPlatformServiceNpsdk;
import com.tridium.platform.npsdk.BNtpServerNpsdk;
import com.tridium.platform.ntp.BNtpPlatformService;
import com.tridium.platform.posix.BNtpModePosix;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import javax.baja.hx.BHxView;
import javax.baja.hx.Command;
import javax.baja.hx.Event;
import javax.baja.hx.HxOp;
import javax.baja.io.HtmlWriter;
import javax.baja.nre.util.Array;
import javax.baja.sys.BBoolean;
import javax.baja.sys.BObject;
import javax.baja.sys.Context;
import javax.baja.sys.LocalizableRuntimeException;
import javax.baja.sys.Sys;
import javax.baja.sys.Type;
import javax.baja.util.Lexicon;
import javax.baja.util.LexiconText;
/*
* Illegal identifiers - consider using --renameillegalidents true
*/
public class BHxNtpPlatSvcNpsdkEditor
extends BHxView {
public static final BHxNtpPlatSvcNpsdkEditor INSTANCE = new BHxNtpPlatSvcNpsdkEditor();
public static final Type TYPE;
private HxButtonHelper refreshButton = HxButtonHelper.makeRefresh();
private HxButtonHelper saveButton = HxButtonHelper.makeSave();
private Command handleEnabledChanged = new HandleEnabledChanged();
private Command handleServerModified;
private Command handleDeleteServer;
private Command handleAddServer;
private Command handleMoveServerUp;
private Command handleMoveServerDown;
private HxViewHelper enabledFe;
private HxViewHelper statsFe;
private HxViewHelper ntpFe;
private HxViewHelper localBackupFe;
static /* synthetic */ Class class$com$tridium$platform$hx$BHxNtpPlatSvcNpsdkEditor;
static /* synthetic */ Class class$com$tridium$platform$npsdk$BNtpServerNpsdk;
public Type getType() {
return TYPE;
}
/*
* Unable to fully structure code
*/
public void write(HxOp var1_1) throws Exception {
var2_2 = (BNtpPlatformServiceNpsdk)var1_1.get();
var2_2.poll();
var3_3 = (BSystemPlatformService)Sys.getService((Type)BSystemPlatformService.TYPE);
var3_3.checkPropertiesLoaded();
if (var1_1.canWrite()) {
if (var3_3.getLocalDaemonAccess() == BDaemonAccessLevel.restricted) {
var1_1.setReadonly(true);
var4_4 = true;
} else {
var4_4 = false;
}
} else {
var4_4 = true;
}
var5_5 = var1_1.getHtmlWriter();
var5_5.w((Object)"<div class='hx-PropertySheet-header'>").safe(LexiconText.make((Type)BHxNtpPlatSvcNpsdkEditor.TYPE, (String)"NtpPlatformService.settings.label").getText((Context)var1_1)).w((Object)"</div>");
var5_5.w((Object)"<div class='window-bg hx-PropertySheet'>");
var5_5.w((Object)"<table cellpadding='5'>");
var5_5.w((Object)"<tr>");
var5_5.w((Object)"<td><b>").w((Object)LexiconText.make((Type)BHxNtpPlatSvcNpsdkEditor.TYPE, (String)"NtpPlatformService.enabled.label").getText((Context)var1_1)).w((Object)"</b></td>");
var5_5.w((Object)"<td>");
var5_5.w((Object)"<select ").attr("name", var1_1.scope("enabled.value"));
if (var4_4) {
var5_5.w((Object)" disabled='disabled'");
}
var5_5.w((Object)" onchange='").w((Object)this.handleEnabledChanged.getInvokeCode(var1_1)).w((Object)"' ");
var5_5.w((Object)">");
var5_5.w((Object)"<option value='false'");
if (!var2_2.getEnabled()) {
var5_5.w((Object)" selected='selected'");
}
var5_5.w((Object)">").w((Object)BBoolean.toString((boolean)false, (Context)var1_1)).w((Object)"</option>");
var5_5.w((Object)"<option value='true'");
if (var2_2.getEnabled()) {
var5_5.w((Object)" selected='selected'");
}
var5_5.w((Object)">").w((Object)BBoolean.toString((boolean)true, (Context)var1_1)).w((Object)"</option>");
var5_5.w((Object)"</select>");
var5_5.w((Object)"</td>");
var5_5.w((Object)"</tr>");
var5_5.w((Object)"<tr>");
var5_5.w((Object)"<td><b>").w((Object)LexiconText.make((Type)BHxNtpPlatSvcNpsdkEditor.TYPE, (String)"NtpPlatformServicePosix.stats.label").getText((Context)var1_1)).w((Object)"</b></td>");
var5_5.w((Object)"<td>");
this.statsFe.setReadonly(var4_4);
this.statsFe.write((BObject)var2_2.get(BNtpPlatformServiceNpsdk.statistics), var1_1);
var5_5.w((Object)"</td>");
var5_5.w((Object)"</tr>");
var5_5.w((Object)"<tr>");
var5_5.w((Object)"<td><b>").w((Object)LexiconText.make((Type)BHxNtpPlatSvcNpsdkEditor.TYPE, (String)"NtpPlatformServicePosix.ntp.label").getText((Context)var1_1)).w((Object)"</b></td>");
var5_5.w((Object)"<td>");
this.ntpFe.setReadonly(var4_4);
this.ntpFe.write((BObject)var2_2.get(BNtpPlatformServiceNpsdk.ntp), var1_1);
var5_5.w((Object)"</td>");
var5_5.w((Object)"</tr>");
var5_5.w((Object)"<tr>");
var5_5.w((Object)"<td><b>").w((Object)LexiconText.make((Type)BHxNtpPlatSvcNpsdkEditor.TYPE, (String)"NtpPlatformServicePosix.localBackup.label").getText((Context)var1_1)).w((Object)"</b></td>");
var5_5.w((Object)"<td>");
this.localBackupFe.setReadonly(var4_4);
this.localBackupFe.write((BObject)var2_2.get(BNtpPlatformServiceNpsdk.localBackup), var1_1);
var5_5.w((Object)"</td>");
var5_5.w((Object)"</tr>");
var5_5.w((Object)"<td>");
var5_5.w((Object)"<input type='hidden'");
var5_5.w((Object)" ").attr("name", var1_1.scope("panic"));
var5_5.w((Object)" ").attr("value", var2_2.getPanic());
var5_5.w((Object)"/>");
var5_5.w((Object)"</td>");
var5_5.w((Object)"</table>");
var5_5.w((Object)"</div>");
var5_5.w((Object)"<div class='hx-PropertySheet-header'>").safe(LexiconText.make((Type)BHxNtpPlatSvcNpsdkEditor.TYPE, (String)"NtpPlatformService.timeServers.label").getText((Context)var1_1)).w((Object)"</div>");
var5_5.w((Object)"<div class='window-bg hx-PropertySheet'>");
var5_5.w((Object)"<div id='").w((Object)var1_1.scope("serversSection")).w((Object)"'>");
this.writeServersTableHeader(var1_1, var5_5);
var6_6 = 0;
var7_7 = var2_2.getTimeServers().getProperties();
if (true) ** GOTO lbl120
do {
var8_8 = (BNtpServerNpsdk)var7_7.get();
this.writeServerRow(var1_1, var5_5, var6_6++, var8_8, false);
lbl120:
// 2 sources
if ((v0 = BHxNtpPlatSvcNpsdkEditor.class$com$tridium$platform$npsdk$BNtpServerNpsdk) != null) continue;
v0 = BHxNtpPlatSvcNpsdkEditor.class("[Lcom.tridium.platform.npsdk.BNtpServerNpsdk;", false);
} while (var7_7.next(v0));
this.writeServersTableFooter(var1_1, var5_5);
var5_5.w((Object)"</div>");
var5_5.println("<div style='padding:10px; text-align:center;'>");
this.refreshButton.write(var1_1);
if (!var4_4) {
var7_7 = new HashMap<K, V>();
var7_7.put("onclick", "if (window.confirm(\"" + Lexicon.make((String)"platform").getText("NtpPlatformService.rebootPrompt.hxConfirmMessage") + "\")) { document.forms[0].submit(); }");
this.saveButton.write(var1_1, (Map)var7_7);
}
var5_5.println("</div>");
var5_5.println("</div>");
}
protected void writeServersTableHeader(HxOp hxOp, HtmlWriter htmlWriter) throws Exception {
htmlWriter.w((Object)"<table cellpadding='5'>");
htmlWriter.w((Object)"<tr>");
if (hxOp.canWrite()) {
htmlWriter.w((Object)"<th>");
htmlWriter.w((Object)"</th>");
}
htmlWriter.w((Object)"<th>");
htmlWriter.w((Object)LexiconText.make((Type)TYPE, (String)"NtpPlatformService.address.label").getText((Context)hxOp));
htmlWriter.w((Object)"</th>");
htmlWriter.w((Object)"<th>");
htmlWriter.w((Object)LexiconText.make((Type)TYPE, (String)"NtpPlatformServicePosix.peerMode.label").getText((Context)hxOp));
htmlWriter.w((Object)"</th>");
htmlWriter.w((Object)"<th>");
htmlWriter.w((Object)LexiconText.make((Type)TYPE, (String)"NtpPlatformServicePosix.autoKey.label").getText((Context)hxOp));
htmlWriter.w((Object)"</th>");
htmlWriter.w((Object)"<th>");
htmlWriter.w((Object)LexiconText.make((Type)TYPE, (String)"NtpPlatformServicePosix.manualKey.label").getText((Context)hxOp));
htmlWriter.w((Object)"</th>");
htmlWriter.w((Object)"<th>");
htmlWriter.w((Object)LexiconText.make((Type)TYPE, (String)"NtpPlatformServicePosix.burst.label").getText((Context)hxOp));
htmlWriter.w((Object)"</th>");
htmlWriter.w((Object)"<th>");
htmlWriter.w((Object)LexiconText.make((Type)TYPE, (String)"NtpPlatformServicePosix.prefer.label").getText((Context)hxOp));
htmlWriter.w((Object)"</th>");
htmlWriter.w((Object)"<th>");
htmlWriter.w((Object)LexiconText.make((Type)TYPE, (String)"NtpPlatformServicePosix.minPollInterval.label").getText((Context)hxOp));
htmlWriter.w((Object)"</th>");
htmlWriter.w((Object)"<th>");
htmlWriter.w((Object)LexiconText.make((Type)TYPE, (String)"NtpPlatformServicePosix.maxPollInterval.label").getText((Context)hxOp));
htmlWriter.w((Object)"</th>");
htmlWriter.w((Object)"</tr>");
}
protected void writeServersTableFooter(HxOp hxOp, HtmlWriter htmlWriter) throws Exception {
if (hxOp.canWrite()) {
htmlWriter.w((Object)"<tr><td colspan='5' align='center'>");
htmlWriter.w((Object)"<a href='javascript:").w((Object)this.handleAddServer.getInvokeCode(hxOp)).w((Object)"'>");
htmlWriter.w((Object)"<img border='0' src='module://icons/x16/add.png'/>");
htmlWriter.w((Object)"</a>");
htmlWriter.w((Object)"&nbsp;");
htmlWriter.w((Object)"<a href='javascript:").w((Object)this.handleDeleteServer.getInvokeCode(hxOp)).w((Object)"'>");
htmlWriter.w((Object)"<img border='0' src='module://icons/x16/delete.png'/>");
htmlWriter.w((Object)"</a>");
htmlWriter.w((Object)"&nbsp;");
htmlWriter.w((Object)"<a href='javascript:").w((Object)this.handleMoveServerUp.getInvokeCode(hxOp)).w((Object)"'>");
htmlWriter.w((Object)"<img border='0' src='module://icons/x16/arrowUp.png'/>");
htmlWriter.w((Object)"</a>");
htmlWriter.w((Object)"&nbsp;");
htmlWriter.w((Object)"<a href='javascript:").w((Object)this.handleMoveServerDown.getInvokeCode(hxOp)).w((Object)"'>");
htmlWriter.w((Object)"<img border='0' src='module://icons/x16/arrowDown.png'/>");
htmlWriter.w((Object)"</a>");
htmlWriter.w((Object)"</td></tr>");
}
htmlWriter.w((Object)"</table>");
}
protected void writeServerRow(HxOp hxOp, HtmlWriter htmlWriter, int n, BNtpServerNpsdk bNtpServerNpsdk, boolean bl) throws Exception {
htmlWriter.w((Object)"<tr>");
if (hxOp.canWrite()) {
htmlWriter.w((Object)"<td>");
htmlWriter.w((Object)"<input type='checkbox' name='").w((Object)hxOp.scope("select_" + n)).w((Object)"'");
if (bl) {
htmlWriter.w((Object)" checked='checked'");
}
htmlWriter.w((Object)"/>");
htmlWriter.w((Object)"</td>");
htmlWriter.w((Object)"<td>");
htmlWriter.w((Object)"<input type='text' size='32'");
htmlWriter.w((Object)" ").attr("name", hxOp.scope("address_" + n));
htmlWriter.w((Object)" ").attr("value", bNtpServerNpsdk.getAddress());
htmlWriter.w((Object)"/>");
htmlWriter.w((Object)"</td>");
htmlWriter.w((Object)"<td>");
htmlWriter.w((Object)"<select ").attr("name", hxOp.scope("peerMode_" + n));
htmlWriter.w((Object)" onchange='").w((Object)this.handleServerModified.getInvokeCode(hxOp)).w((Object)"'");
htmlWriter.w((Object)">");
htmlWriter.w((Object)"<option value='2'");
if (bNtpServerNpsdk.getPeerMode() == BNtpModePosix.server) {
htmlWriter.w((Object)" selected='selected'");
}
htmlWriter.w((Object)">").w((Object)BNtpModePosix.server.toString((Context)hxOp)).w((Object)"</option>");
htmlWriter.w((Object)"<option value='1'");
if (bNtpServerNpsdk.getPeerMode() == BNtpModePosix.peer) {
htmlWriter.w((Object)" selected='selected'");
}
htmlWriter.w((Object)">").w((Object)BNtpModePosix.peer.toString((Context)hxOp)).w((Object)"</option>");
htmlWriter.w((Object)"<option value='3'");
if (bNtpServerNpsdk.getPeerMode() == BNtpModePosix.broadcast) {
htmlWriter.w((Object)" selected='selected'");
}
htmlWriter.w((Object)">").w((Object)BNtpModePosix.broadcast.toString((Context)hxOp)).w((Object)"</option>");
htmlWriter.w((Object)"<option value='4'");
if (bNtpServerNpsdk.getPeerMode() == BNtpModePosix.manycastclient) {
htmlWriter.w((Object)" selected='selected'");
}
htmlWriter.w((Object)">").w((Object)BNtpModePosix.manycastclient.toString((Context)hxOp)).w((Object)"</option>");
htmlWriter.w((Object)"</select>");
htmlWriter.w((Object)"</td>");
htmlWriter.w((Object)"<td>");
htmlWriter.w((Object)"<select ").attr("name", hxOp.scope("useBurst_" + n));
htmlWriter.w((Object)">");
htmlWriter.w((Object)"<option value='false'");
if (!bNtpServerNpsdk.getUseBurst()) {
htmlWriter.w((Object)" selected='selected'");
}
htmlWriter.w((Object)">").w((Object)BBoolean.FALSE.toString((Context)hxOp)).w((Object)"</option>");
htmlWriter.w((Object)"<option value='true'");
if (bNtpServerNpsdk.getUseBurst()) {
htmlWriter.w((Object)" selected='selected'");
}
htmlWriter.w((Object)">").w((Object)BBoolean.TRUE.toString((Context)hxOp)).w((Object)"</option>");
htmlWriter.w((Object)"</select>");
htmlWriter.w((Object)"</td>");
htmlWriter.w((Object)"<td>");
htmlWriter.w((Object)"<select ").attr("name", hxOp.scope("serverPreferred_" + n));
if (bNtpServerNpsdk.getPeerMode() == BNtpModePosix.manycastclient || bNtpServerNpsdk.getPeerMode() == BNtpModePosix.broadcast) {
htmlWriter.w((Object)" disabled='disabled'");
}
htmlWriter.w((Object)"<option value='false'");
if (!bNtpServerNpsdk.getServerPreferred()) {
htmlWriter.w((Object)" selected='selected'");
}
htmlWriter.w((Object)">").w((Object)BBoolean.FALSE.toString((Context)hxOp)).w((Object)"</option>");
htmlWriter.w((Object)"<option value='true'");
if (bNtpServerNpsdk.getServerPreferred()) {
htmlWriter.w((Object)" selected='selected'");
}
htmlWriter.w((Object)">").w((Object)BBoolean.TRUE.toString((Context)hxOp)).w((Object)"</option>");
htmlWriter.w((Object)"</select>");
htmlWriter.w((Object)"</td>");
htmlWriter.w((Object)"<td>");
htmlWriter.w((Object)"<input type='text' size='5'");
htmlWriter.w((Object)" ").attr("name", hxOp.scope("minpoll_" + n));
htmlWriter.w((Object)" ").attr("value", bNtpServerNpsdk.getMinPollInterval());
htmlWriter.w((Object)"/>");
htmlWriter.safe(BNtpPlatformService.LOG_2_SEC_UNIT.getSymbol());
htmlWriter.w((Object)"</td>");
htmlWriter.w((Object)"<td>");
htmlWriter.w((Object)"<input type='text' size='5'");
htmlWriter.w((Object)" ").attr("name", hxOp.scope("maxpoll_" + n));
htmlWriter.w((Object)" ").attr("value", bNtpServerNpsdk.getMaxPollInterval());
htmlWriter.w((Object)"/>");
htmlWriter.safe(BNtpPlatformService.LOG_2_SEC_UNIT.getSymbol());
htmlWriter.w((Object)"</td>");
} else {
htmlWriter.w((Object)"<td>").safe(bNtpServerNpsdk.getAddress()).w((Object)"</td>");
htmlWriter.w((Object)"<td>").safe(bNtpServerNpsdk.getPeerMode().toString((Context)hxOp)).w((Object)"</td>");
htmlWriter.w((Object)"<td>").safe(bNtpServerNpsdk.get(BNtpServerNpsdk.useBurst).toString((Context)hxOp)).w((Object)"</td>");
htmlWriter.w((Object)"<td>").safe(bNtpServerNpsdk.get(BNtpServerNpsdk.serverPreferred).toString((Context)hxOp)).w((Object)"</td>");
htmlWriter.w((Object)"<td>").safe(bNtpServerNpsdk.get(BNtpServerNpsdk.minPollInterval).toString((Context)hxOp)).w((Object)"</td>");
htmlWriter.w((Object)"<td>").safe(bNtpServerNpsdk.get(BNtpServerNpsdk.maxPollInterval).toString((Context)hxOp)).w((Object)"</td>");
}
htmlWriter.w((Object)"</tr>");
}
protected BNtpServerNpsdk[] getTimeServers(HxOp hxOp) throws Exception {
Class clazz = class$com$tridium$platform$npsdk$BNtpServerNpsdk;
if (clazz == null) {
clazz = class$com$tridium$platform$npsdk$BNtpServerNpsdk = BHxNtpPlatSvcNpsdkEditor.class("[Lcom.tridium.platform.npsdk.BNtpServerNpsdk;", false);
}
Array array = new Array(clazz);
int n = 0;
String string = hxOp.getFormValue("address_" + n);
while (string != null) {
BNtpServerNpsdk bNtpServerNpsdk = new BNtpServerNpsdk();
bNtpServerNpsdk.setAddress(string);
bNtpServerNpsdk.setPeerMode(BNtpModePosix.make(Integer.parseInt(hxOp.getFormValue("peerMode_" + n))));
bNtpServerNpsdk.setUseBurst(hxOp.getFormValue("useBurst_" + n).equals("true"));
boolean bl = false;
if (hxOp.getFormValue("serverPreferred_" + n) != null) {
bl = hxOp.getFormValue("serverPreferred_" + n).equals("true");
}
bNtpServerNpsdk.setServerPreferred(bl);
bNtpServerNpsdk.setMinPollInterval(Integer.valueOf(hxOp.getFormValue("minpoll_" + n)));
bNtpServerNpsdk.setMaxPollInterval(Integer.valueOf(hxOp.getFormValue("maxpoll_" + n)));
array.add((Object)bNtpServerNpsdk);
string = hxOp.getFormValue("address_" + ++n);
}
return (BNtpServerNpsdk[])array.trim();
}
public BObject save(HxOp hxOp) throws Exception {
BNtpPlatformServiceNpsdk bNtpPlatformServiceNpsdk = (BNtpPlatformServiceNpsdk)hxOp.get();
BNtpServerNpsdk[] bNtpServerNpsdkArray = this.getTimeServers(hxOp);
String[] stringArray = new String[bNtpServerNpsdkArray.length];
HashSet hashSet = new HashSet();
int n = 0;
while (n < bNtpServerNpsdkArray.length) {
if (bNtpServerNpsdkArray[n].getAddress().trim().length() == 0) {
throw new LocalizableRuntimeException("platform", "NtpServerFE.nullAddress");
}
stringArray[n] = bNtpServerNpsdkArray[n].getServerString();
String string = bNtpServerNpsdkArray[n].getPropertyName(stringArray[n]);
if (hashSet.contains(string)) {
throw new LocalizableRuntimeException("platform", "NtpServerVectorFE.duplicateServer");
}
++n;
}
bNtpPlatformServiceNpsdk.getTimeServers().sync(stringArray);
bNtpPlatformServiceNpsdk.setEnabled(((BBoolean)this.enabledFe.save((BObject)bNtpPlatformServiceNpsdk.get(BNtpPlatformService.enabled), hxOp)).getBoolean());
bNtpPlatformServiceNpsdk.setStatistics(((BBoolean)this.statsFe.save((BObject)bNtpPlatformServiceNpsdk.get(BNtpPlatformServiceNpsdk.statistics), hxOp)).getBoolean());
bNtpPlatformServiceNpsdk.setNtp(((BBoolean)this.ntpFe.save((BObject)bNtpPlatformServiceNpsdk.get(BNtpPlatformServiceNpsdk.ntp), hxOp)).getBoolean());
bNtpPlatformServiceNpsdk.setLocalBackup(((BBoolean)this.localBackupFe.save((BObject)bNtpPlatformServiceNpsdk.get(BNtpPlatformServiceNpsdk.localBackup), hxOp)).getBoolean());
bNtpPlatformServiceNpsdk.setPanic(Integer.valueOf(hxOp.getFormValue("panic")));
BSystemPlatformService bSystemPlatformService = (BSystemPlatformService)Sys.getService((Type)BSystemPlatformService.TYPE);
if (bSystemPlatformService.getLocalDaemonAccess() != BDaemonAccessLevel.restricted) {
bNtpPlatformServiceNpsdk.savePlatformServiceProperties();
bSystemPlatformService.reboot();
HxMessageHelper.addMessage("NtpPlatformLinuxServiceEditor", LexiconText.make((String)"platform", (String)"NtpPlatformService.reboot.hxMessage"), hxOp);
}
return bNtpPlatformServiceNpsdk;
}
static /* synthetic */ Class class(String string, boolean bl) {
try {
Class<?> clazz = Class.forName(string);
if (!bl) {
clazz = clazz.getComponentType();
}
return clazz;
}
catch (ClassNotFoundException classNotFoundException) {
throw new NoClassDefFoundError(classNotFoundException.getMessage());
}
}
protected BHxNtpPlatSvcNpsdkEditor() {
this.registerEvent((Event)this.handleEnabledChanged);
this.handleServerModified = new HandleServerModified();
this.registerEvent((Event)this.handleServerModified);
this.handleAddServer = new HandleAddServer();
this.registerEvent((Event)this.handleAddServer);
this.handleDeleteServer = new HandleDeleteServer();
this.registerEvent((Event)this.handleDeleteServer);
this.handleMoveServerUp = new HandleMoveServerUp();
this.registerEvent((Event)this.handleMoveServerUp);
this.handleMoveServerDown = new HandleMoveServerDown();
this.registerEvent((Event)this.handleMoveServerDown);
this.enabledFe = HxBooleanHelper.makeFE("enabled", null);
this.ntpFe = HxBooleanHelper.makeFE("ntp", BNtpPlatformServiceNpsdk.ntp.getDefaultValue(), BNtpPlatformServiceNpsdk.ntp.getFacets());
this.localBackupFe = HxBooleanHelper.makeFE("localBackup", BNtpPlatformServiceNpsdk.localBackup.getDefaultValue(), BNtpPlatformServiceNpsdk.localBackup.getFacets());
this.statsFe = HxBooleanHelper.makeFE("stats", BNtpPlatformServiceNpsdk.statistics.getDefaultValue(), BNtpPlatformServiceNpsdk.statistics.getFacets());
}
static {
Class clazz = class$com$tridium$platform$hx$BHxNtpPlatSvcNpsdkEditor;
if (clazz == null) {
clazz = class$com$tridium$platform$hx$BHxNtpPlatSvcNpsdkEditor = BHxNtpPlatSvcNpsdkEditor.class("[Lcom.tridium.platform.hx.BHxNtpPlatSvcNpsdkEditor;", false);
}
TYPE = Sys.loadType((Class)clazz);
}
/*
* Illegal identifiers - consider using --renameillegalidents true
*/
private class HandleEnabledChanged
extends Command {
public String getDisplayName(HxOp hxOp) {
return "";
}
public void handle(HxOp hxOp) throws Exception {
}
public HandleEnabledChanged() {
super((BHxView)BHxNtpPlatSvcNpsdkEditor.this);
}
}
/*
* Illegal identifiers - consider using --renameillegalidents true
*/
private class HandleServerModified
extends Command {
public String getDisplayName(HxOp hxOp) {
return "";
}
public void handle(HxOp hxOp) throws Exception {
String[] stringArray = hxOp.getFormKeys();
BNtpServerNpsdk[] bNtpServerNpsdkArray = BHxNtpPlatSvcNpsdkEditor.this.getTimeServers(hxOp);
boolean[] blArray = new boolean[bNtpServerNpsdkArray.length];
int n = 0;
n = 0;
while (n < blArray.length) {
blArray[n] = false;
++n;
}
int n2 = 0;
while (n2 < stringArray.length) {
if (stringArray[n2].startsWith("select_")) {
n = Integer.parseInt(stringArray[n2].substring(7));
blArray[n] = true;
}
++n2;
}
String string = hxOp.scope("serversSection");
HtmlWriter htmlWriter = hxOp.getHtmlWriter();
htmlWriter.w((Object)"var serversSection = document.getElementById('").w((Object)string).w((Object)"');");
htmlWriter.w((Object)"serversSection.innerHTML = \"");
BHxNtpPlatSvcNpsdkEditor.this.writeServersTableHeader(hxOp, htmlWriter);
int n3 = 0;
while (n3 < bNtpServerNpsdkArray.length) {
BHxNtpPlatSvcNpsdkEditor.this.writeServerRow(hxOp, htmlWriter, n3, bNtpServerNpsdkArray[n3], blArray[n3]);
++n3;
}
BHxNtpPlatSvcNpsdkEditor.this.writeServersTableFooter(hxOp, htmlWriter);
htmlWriter.w((Object)"\";");
}
public HandleServerModified() {
super((BHxView)BHxNtpPlatSvcNpsdkEditor.this);
}
}
/*
* Illegal identifiers - consider using --renameillegalidents true
*/
private class HandleAddServer
extends Command {
public String getDisplayName(HxOp hxOp) {
return "";
}
public void handle(HxOp hxOp) throws Exception {
BNtpServerNpsdk[] bNtpServerNpsdkArray = BHxNtpPlatSvcNpsdkEditor.this.getTimeServers(hxOp);
String string = hxOp.scope("serversSection");
HtmlWriter htmlWriter = hxOp.getHtmlWriter();
htmlWriter.w((Object)"var serversSection = document.getElementById('").w((Object)string).w((Object)"');");
htmlWriter.w((Object)"serversSection.innerHTML = \"");
BHxNtpPlatSvcNpsdkEditor.this.writeServersTableHeader(hxOp, htmlWriter);
int n = 0;
while (n < bNtpServerNpsdkArray.length) {
BHxNtpPlatSvcNpsdkEditor.this.writeServerRow(hxOp, htmlWriter, n, bNtpServerNpsdkArray[n], false);
++n;
}
BHxNtpPlatSvcNpsdkEditor.this.writeServerRow(hxOp, htmlWriter, bNtpServerNpsdkArray.length, new BNtpServerNpsdk(), false);
BHxNtpPlatSvcNpsdkEditor.this.writeServersTableFooter(hxOp, htmlWriter);
htmlWriter.w((Object)"\";");
}
public HandleAddServer() {
super((BHxView)BHxNtpPlatSvcNpsdkEditor.this);
}
}
/*
* Illegal identifiers - consider using --renameillegalidents true
*/
private class HandleDeleteServer
extends Command {
public String getDisplayName(HxOp hxOp) {
return "";
}
public void handle(HxOp hxOp) throws Exception {
BNtpServerNpsdk[] bNtpServerNpsdkArray = BHxNtpPlatSvcNpsdkEditor.this.getTimeServers(hxOp);
String string = hxOp.scope("serversSection");
HtmlWriter htmlWriter = hxOp.getHtmlWriter();
htmlWriter.w((Object)"var serversSection = document.getElementById('").w((Object)string).w((Object)"');");
htmlWriter.w((Object)"serversSection.innerHTML = \"");
BHxNtpPlatSvcNpsdkEditor.this.writeServersTableHeader(hxOp, htmlWriter);
int n = 0;
int n2 = 0;
while (n2 < bNtpServerNpsdkArray.length) {
if (hxOp.getFormValue("select_" + n2) == null) {
BHxNtpPlatSvcNpsdkEditor.this.writeServerRow(hxOp, htmlWriter, n2 - n, bNtpServerNpsdkArray[n2], false);
} else {
++n;
}
++n2;
}
BHxNtpPlatSvcNpsdkEditor.this.writeServersTableFooter(hxOp, htmlWriter);
htmlWriter.w((Object)"\";");
}
public HandleDeleteServer() {
super((BHxView)BHxNtpPlatSvcNpsdkEditor.this);
}
}
/*
* Illegal identifiers - consider using --renameillegalidents true
*/
private class HandleMoveServerUp
extends Command {
public String getDisplayName(HxOp hxOp) {
return "";
}
public void handle(HxOp hxOp) throws Exception {
String[] stringArray = hxOp.getFormKeys();
int n = -1;
int n2 = 0;
while (n2 < stringArray.length) {
if (stringArray[n2].startsWith("select_")) {
if (n < 0) {
n = Integer.parseInt(stringArray[n2].substring(7));
} else {
return;
}
}
++n2;
}
if (n > 0) {
BNtpServerNpsdk[] bNtpServerNpsdkArray = BHxNtpPlatSvcNpsdkEditor.this.getTimeServers(hxOp);
BNtpServerNpsdk bNtpServerNpsdk = bNtpServerNpsdkArray[n - 1];
bNtpServerNpsdkArray[n - 1] = bNtpServerNpsdkArray[n];
bNtpServerNpsdkArray[n] = bNtpServerNpsdk;
String string = hxOp.scope("serversSection");
HtmlWriter htmlWriter = hxOp.getHtmlWriter();
htmlWriter.w((Object)"var serversSection = document.getElementById('").w((Object)string).w((Object)"');");
htmlWriter.w((Object)"serversSection.innerHTML = \"");
BHxNtpPlatSvcNpsdkEditor.this.writeServersTableHeader(hxOp, htmlWriter);
int n3 = 0;
while (n3 < bNtpServerNpsdkArray.length) {
BNtpServerNpsdk bNtpServerNpsdk2 = bNtpServerNpsdkArray[n3];
boolean bl = false;
if (n3 == n - 1) {
bl = true;
}
BHxNtpPlatSvcNpsdkEditor.this.writeServerRow(hxOp, htmlWriter, n3, bNtpServerNpsdk2, bl);
++n3;
}
BHxNtpPlatSvcNpsdkEditor.this.writeServersTableFooter(hxOp, htmlWriter);
htmlWriter.w((Object)"\";");
}
}
public HandleMoveServerUp() {
super((BHxView)BHxNtpPlatSvcNpsdkEditor.this);
}
}
/*
* Illegal identifiers - consider using --renameillegalidents true
*/
private class HandleMoveServerDown
extends Command {
public String getDisplayName(HxOp hxOp) {
return "";
}
public void handle(HxOp hxOp) throws Exception {
String[] stringArray = hxOp.getFormKeys();
int n = -1;
int n2 = 0;
while (n2 < stringArray.length) {
if (stringArray[n2].startsWith("select_")) {
if (n < 0) {
n = Integer.parseInt(stringArray[n2].substring(7));
} else {
return;
}
}
++n2;
}
if (n >= 0 && hxOp.getFormValue("address_" + (n + 1)) != null) {
BNtpServerNpsdk[] bNtpServerNpsdkArray = BHxNtpPlatSvcNpsdkEditor.this.getTimeServers(hxOp);
BNtpServerNpsdk bNtpServerNpsdk = bNtpServerNpsdkArray[n + 1];
bNtpServerNpsdkArray[n + 1] = bNtpServerNpsdkArray[n];
bNtpServerNpsdkArray[n] = bNtpServerNpsdk;
String string = hxOp.scope("serversSection");
HtmlWriter htmlWriter = hxOp.getHtmlWriter();
htmlWriter.w((Object)"var serversSection = document.getElementById('").w((Object)string).w((Object)"');");
htmlWriter.w((Object)"serversSection.innerHTML = \"");
BHxNtpPlatSvcNpsdkEditor.this.writeServersTableHeader(hxOp, htmlWriter);
int n3 = 0;
while (n3 < bNtpServerNpsdkArray.length) {
BNtpServerNpsdk bNtpServerNpsdk2 = bNtpServerNpsdkArray[n3];
boolean bl = false;
if (n3 == n + 1) {
bl = true;
}
BHxNtpPlatSvcNpsdkEditor.this.writeServerRow(hxOp, htmlWriter, n3, bNtpServerNpsdk2, bl);
++n3;
}
BHxNtpPlatSvcNpsdkEditor.this.writeServersTableFooter(hxOp, htmlWriter);
htmlWriter.w((Object)"\";");
}
}
public HandleMoveServerDown() {
super((BHxView)BHxNtpPlatSvcNpsdkEditor.this);
}
}
}
@@ -0,0 +1,652 @@
/*
* Decompiled with CFR 0.152.
*
* Could not load the following classes:
* javax.baja.hx.BHxView
* javax.baja.hx.Command
* javax.baja.hx.Event
* javax.baja.hx.HxOp
* javax.baja.io.HtmlWriter
* javax.baja.nre.util.Array
* javax.baja.sys.BBoolean
* javax.baja.sys.BObject
* javax.baja.sys.Context
* javax.baja.sys.LocalizableRuntimeException
* javax.baja.sys.Sys
* javax.baja.sys.Type
* javax.baja.util.Lexicon
* javax.baja.util.LexiconText
*/
package com.tridium.platform.hx;
import com.tridium.platform.BSystemPlatformService;
import com.tridium.platform.daemon.BDaemonAccessLevel;
import com.tridium.platform.hx.util.HxBooleanHelper;
import com.tridium.platform.hx.util.HxButtonHelper;
import com.tridium.platform.hx.util.HxMessageHelper;
import com.tridium.platform.hx.util.HxViewHelper;
import com.tridium.platform.ntp.BNtpPlatformService;
import com.tridium.platform.posix.BNtpModePosix;
import com.tridium.platform.qnx.BNtpPlatformServiceQnx;
import com.tridium.platform.qnx.BNtpServerQnx;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import javax.baja.hx.BHxView;
import javax.baja.hx.Command;
import javax.baja.hx.Event;
import javax.baja.hx.HxOp;
import javax.baja.io.HtmlWriter;
import javax.baja.nre.util.Array;
import javax.baja.sys.BBoolean;
import javax.baja.sys.BObject;
import javax.baja.sys.Context;
import javax.baja.sys.LocalizableRuntimeException;
import javax.baja.sys.Sys;
import javax.baja.sys.Type;
import javax.baja.util.Lexicon;
import javax.baja.util.LexiconText;
/*
* Illegal identifiers - consider using --renameillegalidents true
*/
public class BHxNtpPlatSvcQnxEditor
extends BHxView {
public static final BHxNtpPlatSvcQnxEditor INSTANCE = new BHxNtpPlatSvcQnxEditor();
public static final Type TYPE;
private HxButtonHelper refreshButton = HxButtonHelper.makeRefresh();
private HxButtonHelper saveButton = HxButtonHelper.makeSave();
private Command handleEnabledChanged = new HandleEnabledChanged();
private Command handleServerModified;
private Command handleDeleteServer;
private Command handleAddServer;
private Command handleMoveServerUp;
private Command handleMoveServerDown;
private HxViewHelper enabledFe;
private HxViewHelper statsFe;
private HxViewHelper syncAtBootFe;
private HxViewHelper ntpFe;
private HxViewHelper localBackupFe;
static /* synthetic */ Class class$com$tridium$platform$hx$BHxNtpPlatSvcQnxEditor;
static /* synthetic */ Class class$com$tridium$platform$qnx$BNtpServerQnx;
public Type getType() {
return TYPE;
}
/*
* Unable to fully structure code
*/
public void write(HxOp var1_1) throws Exception {
var2_2 = (BNtpPlatformServiceQnx)var1_1.get();
var2_2.poll();
var3_3 = (BSystemPlatformService)Sys.getService((Type)BSystemPlatformService.TYPE);
var3_3.checkPropertiesLoaded();
if (var1_1.canWrite()) {
if (var3_3.getLocalDaemonAccess() == BDaemonAccessLevel.restricted) {
var1_1.setReadonly(true);
var4_4 = true;
} else {
var4_4 = false;
}
} else {
var4_4 = true;
}
var5_5 = var1_1.getHtmlWriter();
var5_5.w((Object)"<div class='hx-PropertySheet-header'>").safe(LexiconText.make((Type)BHxNtpPlatSvcQnxEditor.TYPE, (String)"NtpPlatformService.settings.label").getText((Context)var1_1)).w((Object)"</div>");
var5_5.w((Object)"<div class='window-bg hx-PropertySheet'>");
var5_5.w((Object)"<table cellpadding='5'>");
var5_5.w((Object)"<tr>");
var5_5.w((Object)"<td><b>").w((Object)LexiconText.make((Type)BHxNtpPlatSvcQnxEditor.TYPE, (String)"NtpPlatformService.enabled.label").getText((Context)var1_1)).w((Object)"</b></td>");
var5_5.w((Object)"<td>");
var5_5.w((Object)"<select ").attr("name", var1_1.scope("enabled.value"));
if (var4_4) {
var5_5.w((Object)" disabled='disabled'");
}
var5_5.w((Object)" onchange='").w((Object)this.handleEnabledChanged.getInvokeCode(var1_1)).w((Object)"' ");
var5_5.w((Object)">");
var5_5.w((Object)"<option value='false'");
if (!var2_2.getEnabled()) {
var5_5.w((Object)" selected='selected'");
}
var5_5.w((Object)">").w((Object)BBoolean.toString((boolean)false, (Context)var1_1)).w((Object)"</option>");
var5_5.w((Object)"<option value='true'");
if (var2_2.getEnabled()) {
var5_5.w((Object)" selected='selected'");
}
var5_5.w((Object)">").w((Object)BBoolean.toString((boolean)true, (Context)var1_1)).w((Object)"</option>");
var5_5.w((Object)"</select>");
var5_5.w((Object)"</td>");
var5_5.w((Object)"</tr>");
var5_5.w((Object)"<tr>");
var5_5.w((Object)"<td><b>").w((Object)LexiconText.make((Type)BHxNtpPlatSvcQnxEditor.TYPE, (String)"NtpPlatformServicePosix.ntp.label").getText((Context)var1_1)).w((Object)"</b></td>");
var5_5.w((Object)"<td>");
this.ntpFe.setReadonly(var4_4);
this.ntpFe.write((BObject)var2_2.get(BNtpPlatformServiceQnx.ntp), var1_1);
var5_5.w((Object)"</td>");
var5_5.w((Object)"</tr>");
var5_5.w((Object)"<tr>");
var5_5.w((Object)"<td><b>").w((Object)LexiconText.make((Type)BHxNtpPlatSvcQnxEditor.TYPE, (String)"NtpPlatformService.syncAtBoot.label").getText((Context)var1_1)).w((Object)"</b></td>");
var5_5.w((Object)"<td>");
this.syncAtBootFe.setReadonly(var4_4);
this.syncAtBootFe.write((BObject)var2_2.get(BNtpPlatformServiceQnx.syncAtBoot), var1_1);
var5_5.w((Object)"</td>");
var5_5.w((Object)"</tr>");
var5_5.w((Object)"<tr>");
var5_5.w((Object)"<td><b>").w((Object)LexiconText.make((Type)BHxNtpPlatSvcQnxEditor.TYPE, (String)"NtpPlatformServicePosix.localBackup.label").getText((Context)var1_1)).w((Object)"</b></td>");
var5_5.w((Object)"<td>");
this.localBackupFe.setReadonly(var4_4);
this.localBackupFe.write((BObject)var2_2.get(BNtpPlatformServiceQnx.localBackup), var1_1);
var5_5.w((Object)"</td>");
var5_5.w((Object)"</tr>");
var5_5.w((Object)"<tr>");
var5_5.w((Object)"<td><b>").w((Object)LexiconText.make((Type)BHxNtpPlatSvcQnxEditor.TYPE, (String)"NtpPlatformServicePosix.stats.label").getText((Context)var1_1)).w((Object)"</b></td>");
var5_5.w((Object)"<td>");
this.statsFe.setReadonly(var4_4);
this.statsFe.write((BObject)var2_2.get(BNtpPlatformServiceQnx.statistics), var1_1);
var5_5.w((Object)"</td>");
var5_5.w((Object)"</tr>");
var5_5.w((Object)"<td>");
var5_5.w((Object)"<input type='hidden'");
var5_5.w((Object)" ").attr("name", var1_1.scope("panic"));
var5_5.w((Object)" ").attr("value", var2_2.getPanic());
var5_5.w((Object)"/>");
var5_5.w((Object)"</td>");
var5_5.w((Object)"</table>");
var5_5.w((Object)"</div>");
var5_5.w((Object)"<div class='hx-PropertySheet-header'>").safe(LexiconText.make((Type)BHxNtpPlatSvcQnxEditor.TYPE, (String)"NtpPlatformService.timeServers.label").getText((Context)var1_1)).w((Object)"</div>");
var5_5.w((Object)"<div class='window-bg hx-PropertySheet'>");
var5_5.w((Object)"<div id='").w((Object)var1_1.scope("serversSection")).w((Object)"'>");
this.writeServersTableHeader(var1_1, var5_5);
var6_6 = 0;
var7_7 = var2_2.getTimeServers().getProperties();
if (true) ** GOTO lbl132
do {
var8_8 = (BNtpServerQnx)var7_7.get();
this.writeServerRow(var1_1, var5_5, var6_6++, var8_8, false);
lbl132:
// 2 sources
if ((v0 = BHxNtpPlatSvcQnxEditor.class$com$tridium$platform$qnx$BNtpServerQnx) != null) continue;
v0 = BHxNtpPlatSvcQnxEditor.class("[Lcom.tridium.platform.qnx.BNtpServerQnx;", false);
} while (var7_7.next(v0));
this.writeServersTableFooter(var1_1, var5_5);
var5_5.w((Object)"</div>");
var5_5.println("<div style='padding:10px; text-align:center;'>");
this.refreshButton.write(var1_1);
if (!var4_4) {
var7_7 = new HashMap<K, V>();
var7_7.put("onclick", "if (window.confirm(\"" + Lexicon.make((String)"platform").getText("NtpPlatformService.rebootPrompt.hxConfirmMessage") + "\")) { document.forms[0].submit(); }");
this.saveButton.write(var1_1, (Map)var7_7);
}
var5_5.println("</div>");
var5_5.println("</div>");
}
protected void writeServersTableHeader(HxOp hxOp, HtmlWriter htmlWriter) throws Exception {
htmlWriter.w((Object)"<table cellpadding='5'>");
htmlWriter.w((Object)"<tr>");
if (hxOp.canWrite()) {
htmlWriter.w((Object)"<th>");
htmlWriter.w((Object)"</th>");
}
htmlWriter.w((Object)"<th>");
htmlWriter.w((Object)LexiconText.make((Type)TYPE, (String)"NtpPlatformService.address.label").getText((Context)hxOp));
htmlWriter.w((Object)"</th>");
htmlWriter.w((Object)"<th>");
htmlWriter.w((Object)LexiconText.make((Type)TYPE, (String)"NtpPlatformServicePosix.peerMode.label").getText((Context)hxOp));
htmlWriter.w((Object)"</th>");
htmlWriter.w((Object)"<th>");
htmlWriter.w((Object)LexiconText.make((Type)TYPE, (String)"NtpPlatformServicePosix.burst.label").getText((Context)hxOp));
htmlWriter.w((Object)"</th>");
htmlWriter.w((Object)"<th>");
htmlWriter.w((Object)LexiconText.make((Type)TYPE, (String)"NtpPlatformServicePosix.prefer.label").getText((Context)hxOp));
htmlWriter.w((Object)"</th>");
htmlWriter.w((Object)"<th>");
htmlWriter.w((Object)LexiconText.make((Type)TYPE, (String)"NtpPlatformServicePosix.minPollInterval.label").getText((Context)hxOp));
htmlWriter.w((Object)"</th>");
htmlWriter.w((Object)"<th>");
htmlWriter.w((Object)LexiconText.make((Type)TYPE, (String)"NtpPlatformServicePosix.maxPollInterval.label").getText((Context)hxOp));
htmlWriter.w((Object)"</th>");
htmlWriter.w((Object)"</tr>");
}
protected void writeServersTableFooter(HxOp hxOp, HtmlWriter htmlWriter) throws Exception {
if (hxOp.canWrite()) {
htmlWriter.w((Object)"<tr><td colspan='5' align='center'>");
htmlWriter.w((Object)"<a href='javascript:").w((Object)this.handleAddServer.getInvokeCode(hxOp)).w((Object)"'>");
htmlWriter.w((Object)"<img border='0' src='module://icons/x16/add.png'/>");
htmlWriter.w((Object)"</a>");
htmlWriter.w((Object)"&nbsp;");
htmlWriter.w((Object)"<a href='javascript:").w((Object)this.handleDeleteServer.getInvokeCode(hxOp)).w((Object)"'>");
htmlWriter.w((Object)"<img border='0' src='module://icons/x16/delete.png'/>");
htmlWriter.w((Object)"</a>");
htmlWriter.w((Object)"&nbsp;");
htmlWriter.w((Object)"<a href='javascript:").w((Object)this.handleMoveServerUp.getInvokeCode(hxOp)).w((Object)"'>");
htmlWriter.w((Object)"<img border='0' src='module://icons/x16/arrowUp.png'/>");
htmlWriter.w((Object)"</a>");
htmlWriter.w((Object)"&nbsp;");
htmlWriter.w((Object)"<a href='javascript:").w((Object)this.handleMoveServerDown.getInvokeCode(hxOp)).w((Object)"'>");
htmlWriter.w((Object)"<img border='0' src='module://icons/x16/arrowDown.png'/>");
htmlWriter.w((Object)"</a>");
htmlWriter.w((Object)"</td></tr>");
}
htmlWriter.w((Object)"</table>");
}
protected void writeServerRow(HxOp hxOp, HtmlWriter htmlWriter, int n, BNtpServerQnx bNtpServerQnx, boolean bl) throws Exception {
htmlWriter.w((Object)"<tr>");
if (hxOp.canWrite()) {
htmlWriter.w((Object)"<td>");
htmlWriter.w((Object)"<input type='checkbox' name='").w((Object)hxOp.scope("select_" + n)).w((Object)"'");
if (bl) {
htmlWriter.w((Object)" checked='checked'");
}
htmlWriter.w((Object)"/>");
htmlWriter.w((Object)"</td>");
htmlWriter.w((Object)"<td>");
htmlWriter.w((Object)"<input type='text' size='32'");
htmlWriter.w((Object)" ").attr("name", hxOp.scope("address_" + n));
htmlWriter.w((Object)" ").attr("value", bNtpServerQnx.getAddress());
htmlWriter.w((Object)"/>");
htmlWriter.w((Object)"</td>");
htmlWriter.w((Object)"<td>");
htmlWriter.w((Object)"<select ").attr("name", hxOp.scope("peerMode_" + n));
htmlWriter.w((Object)" onchange='").w((Object)this.handleServerModified.getInvokeCode(hxOp)).w((Object)"'");
htmlWriter.w((Object)">");
htmlWriter.w((Object)"<option value='2'");
if (bNtpServerQnx.getPeerMode() == BNtpModePosix.server) {
htmlWriter.w((Object)" selected='selected'");
}
htmlWriter.w((Object)">").w((Object)BNtpModePosix.server.toString((Context)hxOp)).w((Object)"</option>");
htmlWriter.w((Object)"<option value='1'");
if (bNtpServerQnx.getPeerMode() == BNtpModePosix.peer) {
htmlWriter.w((Object)" selected='selected'");
}
htmlWriter.w((Object)">").w((Object)BNtpModePosix.peer.toString((Context)hxOp)).w((Object)"</option>");
htmlWriter.w((Object)"</select>");
htmlWriter.w((Object)"</td>");
htmlWriter.w((Object)"<td>");
htmlWriter.w((Object)"<select ").attr("name", hxOp.scope("useBurst_" + n)).w((Object)">");
htmlWriter.w((Object)"<option value='false'");
if (!bNtpServerQnx.getUseBurst()) {
htmlWriter.w((Object)" selected='selected'");
}
htmlWriter.w((Object)">").w((Object)BBoolean.FALSE.toString((Context)hxOp)).w((Object)"</option>");
htmlWriter.w((Object)"<option value='true'");
if (bNtpServerQnx.getUseBurst()) {
htmlWriter.w((Object)" selected='selected'");
}
htmlWriter.w((Object)">").w((Object)BBoolean.TRUE.toString((Context)hxOp)).w((Object)"</option>");
htmlWriter.w((Object)"</select>");
htmlWriter.w((Object)"</td>");
htmlWriter.w((Object)"<td>");
htmlWriter.w((Object)"<select ").attr("name", hxOp.scope("serverPreferred_" + n)).w((Object)">");
htmlWriter.w((Object)"<option value='false'");
if (!bNtpServerQnx.getServerPreferred()) {
htmlWriter.w((Object)" selected='selected'");
}
htmlWriter.w((Object)">").w((Object)BBoolean.FALSE.toString((Context)hxOp)).w((Object)"</option>");
htmlWriter.w((Object)"<option value='true'");
if (bNtpServerQnx.getServerPreferred()) {
htmlWriter.w((Object)" selected='selected'");
}
htmlWriter.w((Object)">").w((Object)BBoolean.TRUE.toString((Context)hxOp)).w((Object)"</option>");
htmlWriter.w((Object)"</select>");
htmlWriter.w((Object)"</td>");
htmlWriter.w((Object)"<td>");
htmlWriter.w((Object)"<input type='text' size='5'");
htmlWriter.w((Object)" ").attr("name", hxOp.scope("minpoll_" + n));
htmlWriter.w((Object)" ").attr("value", bNtpServerQnx.getMinPollInterval());
htmlWriter.w((Object)"/>");
htmlWriter.safe(BNtpPlatformService.LOG_2_SEC_UNIT.getSymbol());
htmlWriter.w((Object)"</td>");
htmlWriter.w((Object)"<td>");
htmlWriter.w((Object)"<input type='text' size='5'");
htmlWriter.w((Object)" ").attr("name", hxOp.scope("maxpoll_" + n));
htmlWriter.w((Object)" ").attr("value", bNtpServerQnx.getMaxPollInterval());
htmlWriter.w((Object)"/>");
htmlWriter.safe(BNtpPlatformService.LOG_2_SEC_UNIT.getSymbol());
htmlWriter.w((Object)"</td>");
} else {
htmlWriter.w((Object)"<td>").safe(bNtpServerQnx.getAddress()).w((Object)"</td>");
htmlWriter.w((Object)"<td>").safe(bNtpServerQnx.getPeerMode().toString((Context)hxOp)).w((Object)"</td>");
htmlWriter.w((Object)"<td>").safe(bNtpServerQnx.get(BNtpServerQnx.useBurst).toString((Context)hxOp)).w((Object)"</td>");
htmlWriter.w((Object)"<td>").safe(bNtpServerQnx.get(BNtpServerQnx.serverPreferred).toString((Context)hxOp)).w((Object)"</td>");
htmlWriter.w((Object)"<td>").safe(bNtpServerQnx.get(BNtpServerQnx.minPollInterval).toString((Context)hxOp)).w((Object)"</td>");
htmlWriter.w((Object)"<td>").safe(bNtpServerQnx.get(BNtpServerQnx.maxPollInterval).toString((Context)hxOp)).w((Object)"</td>");
}
htmlWriter.w((Object)"</tr>");
}
protected BNtpServerQnx[] getTimeServers(HxOp hxOp) throws Exception {
Class clazz = class$com$tridium$platform$qnx$BNtpServerQnx;
if (clazz == null) {
clazz = class$com$tridium$platform$qnx$BNtpServerQnx = BHxNtpPlatSvcQnxEditor.class("[Lcom.tridium.platform.qnx.BNtpServerQnx;", false);
}
Array array = new Array(clazz);
int n = 0;
String string = hxOp.getFormValue("address_" + n);
while (string != null) {
BNtpServerQnx bNtpServerQnx = new BNtpServerQnx();
bNtpServerQnx.setAddress(string);
bNtpServerQnx.setPeerMode(BNtpModePosix.make(Integer.parseInt(hxOp.getFormValue("peerMode_" + n))));
bNtpServerQnx.setUseBurst(hxOp.getFormValue("useBurst_" + n).equals("true"));
bNtpServerQnx.setServerPreferred(hxOp.getFormValue("serverPreferred_" + n).equals("true"));
bNtpServerQnx.setMinPollInterval(Integer.valueOf(hxOp.getFormValue("minpoll_" + n)));
bNtpServerQnx.setMaxPollInterval(Integer.valueOf(hxOp.getFormValue("maxpoll_" + n)));
array.add((Object)bNtpServerQnx);
string = hxOp.getFormValue("address_" + ++n);
}
return (BNtpServerQnx[])array.trim();
}
public BObject save(HxOp hxOp) throws Exception {
BNtpPlatformServiceQnx bNtpPlatformServiceQnx = (BNtpPlatformServiceQnx)hxOp.get();
BNtpServerQnx[] bNtpServerQnxArray = this.getTimeServers(hxOp);
String[] stringArray = new String[bNtpServerQnxArray.length];
HashSet hashSet = new HashSet();
int n = 0;
while (n < bNtpServerQnxArray.length) {
if (bNtpServerQnxArray[n].getAddress().trim().length() == 0) {
throw new LocalizableRuntimeException("platform", "NtpServerFE.nullAddress");
}
stringArray[n] = bNtpServerQnxArray[n].getServerString();
String string = bNtpServerQnxArray[n].getPropertyName(stringArray[n]);
if (hashSet.contains(string)) {
throw new LocalizableRuntimeException("platform", "NtpServerVectorFE.duplicateServer");
}
++n;
}
bNtpPlatformServiceQnx.getTimeServers().sync(stringArray);
bNtpPlatformServiceQnx.setEnabled(((BBoolean)this.enabledFe.save((BObject)bNtpPlatformServiceQnx.get(BNtpPlatformService.enabled), hxOp)).getBoolean());
bNtpPlatformServiceQnx.setStatistics(((BBoolean)this.statsFe.save((BObject)bNtpPlatformServiceQnx.get(BNtpPlatformServiceQnx.statistics), hxOp)).getBoolean());
bNtpPlatformServiceQnx.setSyncAtBoot(((BBoolean)this.syncAtBootFe.save((BObject)bNtpPlatformServiceQnx.get(BNtpPlatformServiceQnx.syncAtBoot), hxOp)).getBoolean());
bNtpPlatformServiceQnx.setNtp(((BBoolean)this.ntpFe.save((BObject)bNtpPlatformServiceQnx.get(BNtpPlatformServiceQnx.ntp), hxOp)).getBoolean());
bNtpPlatformServiceQnx.setLocalBackup(((BBoolean)this.localBackupFe.save((BObject)bNtpPlatformServiceQnx.get(BNtpPlatformServiceQnx.localBackup), hxOp)).getBoolean());
bNtpPlatformServiceQnx.setPanic(Integer.valueOf(hxOp.getFormValue("panic")));
BSystemPlatformService bSystemPlatformService = (BSystemPlatformService)Sys.getService((Type)BSystemPlatformService.TYPE);
if (bSystemPlatformService.getLocalDaemonAccess() != BDaemonAccessLevel.restricted) {
bNtpPlatformServiceQnx.savePlatformServiceProperties();
bSystemPlatformService.reboot();
HxMessageHelper.addMessage("NtpPlatformQnxServiceEditor", LexiconText.make((String)"platform", (String)"NtpPlatformService.reboot.hxMessage"), hxOp);
}
return bNtpPlatformServiceQnx;
}
static /* synthetic */ Class class(String string, boolean bl) {
try {
Class<?> clazz = Class.forName(string);
if (!bl) {
clazz = clazz.getComponentType();
}
return clazz;
}
catch (ClassNotFoundException classNotFoundException) {
throw new NoClassDefFoundError(classNotFoundException.getMessage());
}
}
protected BHxNtpPlatSvcQnxEditor() {
this.registerEvent((Event)this.handleEnabledChanged);
this.handleServerModified = new HandleServerModified();
this.registerEvent((Event)this.handleServerModified);
this.handleAddServer = new HandleAddServer();
this.registerEvent((Event)this.handleAddServer);
this.handleDeleteServer = new HandleDeleteServer();
this.registerEvent((Event)this.handleDeleteServer);
this.handleMoveServerUp = new HandleMoveServerUp();
this.registerEvent((Event)this.handleMoveServerUp);
this.handleMoveServerDown = new HandleMoveServerDown();
this.registerEvent((Event)this.handleMoveServerDown);
this.enabledFe = HxBooleanHelper.makeFE("enabled", null);
this.ntpFe = HxBooleanHelper.makeFE("ntp", BNtpPlatformServiceQnx.ntp.getDefaultValue(), BNtpPlatformServiceQnx.ntp.getFacets());
this.localBackupFe = HxBooleanHelper.makeFE("localBackup", BNtpPlatformServiceQnx.localBackup.getDefaultValue(), BNtpPlatformServiceQnx.localBackup.getFacets());
this.statsFe = HxBooleanHelper.makeFE("stats", BNtpPlatformServiceQnx.statistics.getDefaultValue(), BNtpPlatformServiceQnx.statistics.getFacets());
this.syncAtBootFe = HxBooleanHelper.makeFE("syncAtBoot", BNtpPlatformServiceQnx.syncAtBoot.getDefaultValue(), BNtpPlatformServiceQnx.syncAtBoot.getFacets());
}
static {
Class clazz = class$com$tridium$platform$hx$BHxNtpPlatSvcQnxEditor;
if (clazz == null) {
clazz = class$com$tridium$platform$hx$BHxNtpPlatSvcQnxEditor = BHxNtpPlatSvcQnxEditor.class("[Lcom.tridium.platform.hx.BHxNtpPlatSvcQnxEditor;", false);
}
TYPE = Sys.loadType((Class)clazz);
}
/*
* Illegal identifiers - consider using --renameillegalidents true
*/
private class HandleEnabledChanged
extends Command {
public String getDisplayName(HxOp hxOp) {
return "";
}
public void handle(HxOp hxOp) throws Exception {
}
public HandleEnabledChanged() {
super((BHxView)BHxNtpPlatSvcQnxEditor.this);
}
}
/*
* Illegal identifiers - consider using --renameillegalidents true
*/
private class HandleServerModified
extends Command {
public String getDisplayName(HxOp hxOp) {
return "";
}
public void handle(HxOp hxOp) throws Exception {
String[] stringArray = hxOp.getFormKeys();
BNtpServerQnx[] bNtpServerQnxArray = BHxNtpPlatSvcQnxEditor.this.getTimeServers(hxOp);
boolean[] blArray = new boolean[bNtpServerQnxArray.length];
int n = 0;
n = 0;
while (n < blArray.length) {
blArray[n] = false;
++n;
}
int n2 = 0;
while (n2 < stringArray.length) {
if (stringArray[n2].startsWith("select_")) {
n = Integer.parseInt(stringArray[n2].substring(7));
blArray[n] = true;
}
++n2;
}
String string = hxOp.scope("serversSection");
HtmlWriter htmlWriter = hxOp.getHtmlWriter();
htmlWriter.w((Object)"var serversSection = document.getElementById('").w((Object)string).w((Object)"');");
htmlWriter.w((Object)"serversSection.innerHTML = \"");
BHxNtpPlatSvcQnxEditor.this.writeServersTableHeader(hxOp, htmlWriter);
int n3 = 0;
while (n3 < bNtpServerQnxArray.length) {
BHxNtpPlatSvcQnxEditor.this.writeServerRow(hxOp, htmlWriter, n3, bNtpServerQnxArray[n3], blArray[n3]);
++n3;
}
BHxNtpPlatSvcQnxEditor.this.writeServersTableFooter(hxOp, htmlWriter);
htmlWriter.w((Object)"\";");
}
public HandleServerModified() {
super((BHxView)BHxNtpPlatSvcQnxEditor.this);
}
}
/*
* Illegal identifiers - consider using --renameillegalidents true
*/
private class HandleAddServer
extends Command {
public String getDisplayName(HxOp hxOp) {
return "";
}
public void handle(HxOp hxOp) throws Exception {
BNtpServerQnx[] bNtpServerQnxArray = BHxNtpPlatSvcQnxEditor.this.getTimeServers(hxOp);
String string = hxOp.scope("serversSection");
HtmlWriter htmlWriter = hxOp.getHtmlWriter();
htmlWriter.w((Object)"var serversSection = document.getElementById('").w((Object)string).w((Object)"');");
htmlWriter.w((Object)"serversSection.innerHTML = \"");
BHxNtpPlatSvcQnxEditor.this.writeServersTableHeader(hxOp, htmlWriter);
int n = 0;
while (n < bNtpServerQnxArray.length) {
BHxNtpPlatSvcQnxEditor.this.writeServerRow(hxOp, htmlWriter, n, bNtpServerQnxArray[n], false);
++n;
}
BHxNtpPlatSvcQnxEditor.this.writeServerRow(hxOp, htmlWriter, bNtpServerQnxArray.length, new BNtpServerQnx(), false);
BHxNtpPlatSvcQnxEditor.this.writeServersTableFooter(hxOp, htmlWriter);
htmlWriter.w((Object)"\";");
}
public HandleAddServer() {
super((BHxView)BHxNtpPlatSvcQnxEditor.this);
}
}
/*
* Illegal identifiers - consider using --renameillegalidents true
*/
private class HandleDeleteServer
extends Command {
public String getDisplayName(HxOp hxOp) {
return "";
}
public void handle(HxOp hxOp) throws Exception {
BNtpServerQnx[] bNtpServerQnxArray = BHxNtpPlatSvcQnxEditor.this.getTimeServers(hxOp);
String string = hxOp.scope("serversSection");
HtmlWriter htmlWriter = hxOp.getHtmlWriter();
htmlWriter.w((Object)"var serversSection = document.getElementById('").w((Object)string).w((Object)"');");
htmlWriter.w((Object)"serversSection.innerHTML = \"");
BHxNtpPlatSvcQnxEditor.this.writeServersTableHeader(hxOp, htmlWriter);
int n = 0;
int n2 = 0;
while (n2 < bNtpServerQnxArray.length) {
if (hxOp.getFormValue("select_" + n2) == null) {
BHxNtpPlatSvcQnxEditor.this.writeServerRow(hxOp, htmlWriter, n2 - n, bNtpServerQnxArray[n2], false);
} else {
++n;
}
++n2;
}
BHxNtpPlatSvcQnxEditor.this.writeServersTableFooter(hxOp, htmlWriter);
htmlWriter.w((Object)"\";");
}
public HandleDeleteServer() {
super((BHxView)BHxNtpPlatSvcQnxEditor.this);
}
}
/*
* Illegal identifiers - consider using --renameillegalidents true
*/
private class HandleMoveServerUp
extends Command {
public String getDisplayName(HxOp hxOp) {
return "";
}
public void handle(HxOp hxOp) throws Exception {
String[] stringArray = hxOp.getFormKeys();
int n = -1;
int n2 = 0;
while (n2 < stringArray.length) {
if (stringArray[n2].startsWith("select_")) {
if (n < 0) {
n = Integer.parseInt(stringArray[n2].substring(7));
} else {
return;
}
}
++n2;
}
if (n > 0) {
BNtpServerQnx[] bNtpServerQnxArray = BHxNtpPlatSvcQnxEditor.this.getTimeServers(hxOp);
BNtpServerQnx bNtpServerQnx = bNtpServerQnxArray[n - 1];
bNtpServerQnxArray[n - 1] = bNtpServerQnxArray[n];
bNtpServerQnxArray[n] = bNtpServerQnx;
String string = hxOp.scope("serversSection");
HtmlWriter htmlWriter = hxOp.getHtmlWriter();
htmlWriter.w((Object)"var serversSection = document.getElementById('").w((Object)string).w((Object)"');");
htmlWriter.w((Object)"serversSection.innerHTML = \"");
BHxNtpPlatSvcQnxEditor.this.writeServersTableHeader(hxOp, htmlWriter);
int n3 = 0;
while (n3 < bNtpServerQnxArray.length) {
BNtpServerQnx bNtpServerQnx2 = bNtpServerQnxArray[n3];
boolean bl = false;
if (n3 == n - 1) {
bl = true;
}
BHxNtpPlatSvcQnxEditor.this.writeServerRow(hxOp, htmlWriter, n3, bNtpServerQnx2, bl);
++n3;
}
BHxNtpPlatSvcQnxEditor.this.writeServersTableFooter(hxOp, htmlWriter);
htmlWriter.w((Object)"\";");
}
}
public HandleMoveServerUp() {
super((BHxView)BHxNtpPlatSvcQnxEditor.this);
}
}
/*
* Illegal identifiers - consider using --renameillegalidents true
*/
private class HandleMoveServerDown
extends Command {
public String getDisplayName(HxOp hxOp) {
return "";
}
public void handle(HxOp hxOp) throws Exception {
String[] stringArray = hxOp.getFormKeys();
int n = -1;
int n2 = 0;
while (n2 < stringArray.length) {
if (stringArray[n2].startsWith("select_")) {
if (n < 0) {
n = Integer.parseInt(stringArray[n2].substring(7));
} else {
return;
}
}
++n2;
}
if (n >= 0 && hxOp.getFormValue("address_" + (n + 1)) != null) {
BNtpServerQnx[] bNtpServerQnxArray = BHxNtpPlatSvcQnxEditor.this.getTimeServers(hxOp);
BNtpServerQnx bNtpServerQnx = bNtpServerQnxArray[n + 1];
bNtpServerQnxArray[n + 1] = bNtpServerQnxArray[n];
bNtpServerQnxArray[n] = bNtpServerQnx;
String string = hxOp.scope("serversSection");
HtmlWriter htmlWriter = hxOp.getHtmlWriter();
htmlWriter.w((Object)"var serversSection = document.getElementById('").w((Object)string).w((Object)"');");
htmlWriter.w((Object)"serversSection.innerHTML = \"");
BHxNtpPlatSvcQnxEditor.this.writeServersTableHeader(hxOp, htmlWriter);
int n3 = 0;
while (n3 < bNtpServerQnxArray.length) {
BNtpServerQnx bNtpServerQnx2 = bNtpServerQnxArray[n3];
boolean bl = false;
if (n3 == n + 1) {
bl = true;
}
BHxNtpPlatSvcQnxEditor.this.writeServerRow(hxOp, htmlWriter, n3, bNtpServerQnx2, bl);
++n3;
}
BHxNtpPlatSvcQnxEditor.this.writeServersTableFooter(hxOp, htmlWriter);
htmlWriter.w((Object)"\";");
}
}
public HandleMoveServerDown() {
super((BHxView)BHxNtpPlatSvcQnxEditor.this);
}
}
}
@@ -0,0 +1,636 @@
/*
* Decompiled with CFR 0.152.
*
* Could not load the following classes:
* javax.baja.hx.BHxView
* javax.baja.hx.Command
* javax.baja.hx.Event
* javax.baja.hx.HxOp
* javax.baja.io.HtmlWriter
* javax.baja.nre.util.Array
* javax.baja.sys.BBoolean
* javax.baja.sys.BInteger
* javax.baja.sys.BObject
* javax.baja.sys.Context
* javax.baja.sys.LocalizableRuntimeException
* javax.baja.sys.Sys
* javax.baja.sys.Type
* javax.baja.util.LexiconText
*/
package com.tridium.platform.hx;
import com.tridium.platform.BSystemPlatformService;
import com.tridium.platform.daemon.BDaemonAccessLevel;
import com.tridium.platform.hx.util.HxBooleanHelper;
import com.tridium.platform.hx.util.HxButtonHelper;
import com.tridium.platform.hx.util.HxViewHelper;
import com.tridium.platform.ntp.BNtpMode;
import com.tridium.platform.ntp.BNtpPlatformService;
import com.tridium.platform.win32.BNtpPlatformServiceWin32;
import com.tridium.platform.win32.BNtpServerWin32;
import com.tridium.platform.win32.BNtpSyncPolicyWin32;
import java.util.HashSet;
import javax.baja.hx.BHxView;
import javax.baja.hx.Command;
import javax.baja.hx.Event;
import javax.baja.hx.HxOp;
import javax.baja.io.HtmlWriter;
import javax.baja.nre.util.Array;
import javax.baja.sys.BBoolean;
import javax.baja.sys.BInteger;
import javax.baja.sys.BObject;
import javax.baja.sys.Context;
import javax.baja.sys.LocalizableRuntimeException;
import javax.baja.sys.Sys;
import javax.baja.sys.Type;
import javax.baja.util.LexiconText;
/*
* Illegal identifiers - consider using --renameillegalidents true
*/
public class BHxNtpPlatSvcWin32Editor
extends BHxView {
public static final BHxNtpPlatSvcWin32Editor INSTANCE = new BHxNtpPlatSvcWin32Editor();
public static final Type TYPE;
private HxButtonHelper refreshButton = HxButtonHelper.makeRefresh();
private HxButtonHelper saveButton = HxButtonHelper.makeSave();
private Command handleEnabledChanged = new HandleEnabledChanged();
private Command handleDeleteServer;
private Command handleAddServer;
private Command handleMoveServerUp;
private Command handleMoveServerDown;
private HxViewHelper enabledFe;
private HxViewHelper maxPosPhaseCorrectionFe;
private HxViewHelper maxNegPhaseCorrectionFe;
private HxViewHelper minPollIntervalFe;
private HxViewHelper maxPollIntervalFe;
private HxViewHelper specialPollIntervalFe;
static /* synthetic */ Class class$com$tridium$platform$hx$BHxNtpPlatSvcWin32Editor;
static /* synthetic */ Class class$com$tridium$platform$win32$BNtpServerWin32;
public Type getType() {
return TYPE;
}
/*
* Unable to fully structure code
*/
public void write(HxOp var1_1) throws Exception {
var2_2 = (BNtpPlatformServiceWin32)var1_1.get();
var2_2.poll();
var3_3 = (BSystemPlatformService)Sys.getService((Type)BSystemPlatformService.TYPE);
var3_3.checkPropertiesLoaded();
if (var1_1.canWrite()) {
if (var3_3.getLocalDaemonAccess() == BDaemonAccessLevel.restricted) {
var1_1.setReadonly(true);
var4_4 = true;
} else {
var4_4 = false;
}
} else {
var4_4 = true;
}
var5_5 = var1_1.getHtmlWriter();
var5_5.w((Object)"<div class='hx-PropertySheet-header'>").safe(LexiconText.make((Type)BHxNtpPlatSvcWin32Editor.TYPE, (String)"NtpPlatformService.settings.label").getText((Context)var1_1)).w((Object)"</div>");
var5_5.w((Object)"<div class='window-bg hx-PropertySheet'>");
var5_5.w((Object)"<table cellpadding='5'>");
var5_5.w((Object)"<tr>");
var5_5.w((Object)"<td><b>").w((Object)LexiconText.make((Type)BHxNtpPlatSvcWin32Editor.TYPE, (String)"NtpPlatformService.enabled.label").getText((Context)var1_1)).w((Object)"</b></td>");
var5_5.w((Object)"<td>");
var5_5.w((Object)"<select ").attr("name", var1_1.scope("enabled.value"));
if (var4_4) {
var5_5.w((Object)" disabled='disabled'");
}
var5_5.w((Object)" onchange='").w((Object)this.handleEnabledChanged.getInvokeCode(var1_1)).w((Object)"' ");
var5_5.w((Object)">");
var5_5.w((Object)"<option value='false'");
if (!var2_2.getEnabled()) {
var5_5.w((Object)" selected='selected'");
}
var5_5.w((Object)">").w((Object)BBoolean.toString((boolean)false, (Context)var1_1)).w((Object)"</option>");
var5_5.w((Object)"<option value='true'");
if (var2_2.getEnabled()) {
var5_5.w((Object)" selected='selected'");
}
var5_5.w((Object)">").w((Object)BBoolean.toString((boolean)true, (Context)var1_1)).w((Object)"</option>");
var5_5.w((Object)"</select>");
var5_5.w((Object)"</td>");
var5_5.w((Object)"</tr>");
var5_5.w((Object)"<input type='hidden' name='").w((Object)var1_1.scope("domainMember")).w((Object)("' value='" + var2_2.getDomainMember() + "'/>"));
var5_5.w((Object)"<tr>");
var5_5.w((Object)"<td><b>").w((Object)LexiconText.make((Type)BHxNtpPlatSvcWin32Editor.TYPE, (String)"NtpPlatformServiceWin32.syncPolicy.label").getText((Context)var1_1)).w((Object)"</b></td>");
var5_5.w((Object)"<td>");
var5_5.w((Object)"<div id='").w((Object)var1_1.scope("syncPolicySection")).w((Object)"'>");
this.writeSyncPolicy(var1_1, var5_5, var2_2.getEnabled(), var2_2.getDomainMember(), var2_2.getSyncPolicy());
var5_5.w((Object)"</div>");
var5_5.w((Object)"</td>");
var5_5.w((Object)"</tr>");
var5_5.w((Object)"<tr>");
var5_5.w((Object)"<td><b>").w((Object)LexiconText.make((Type)BHxNtpPlatSvcWin32Editor.TYPE, (String)"NtpPlatformServiceWin32.maxPosPhaseCorrection.label").getText((Context)var1_1)).w((Object)"</b></td>");
var5_5.w((Object)"<td>");
this.maxPosPhaseCorrectionFe.setReadonly(var4_4);
this.maxPosPhaseCorrectionFe.write((BObject)var2_2.get(BNtpPlatformServiceWin32.maxPosPhaseCorrection), var1_1);
var5_5.w((Object)"</td>");
var5_5.w((Object)"</tr>");
var5_5.w((Object)"<tr>");
var5_5.w((Object)"<td><b>").w((Object)LexiconText.make((Type)BHxNtpPlatSvcWin32Editor.TYPE, (String)"NtpPlatformServiceWin32.maxNegPhaseCorrection.label").getText((Context)var1_1)).w((Object)"</b></td>");
var5_5.w((Object)"<td>");
this.maxNegPhaseCorrectionFe.setReadonly(var4_4);
this.maxNegPhaseCorrectionFe.write((BObject)var2_2.get(BNtpPlatformServiceWin32.maxNegPhaseCorrection), var1_1);
var5_5.w((Object)"</td>");
var5_5.w((Object)"</tr>");
var5_5.w((Object)"<tr>");
var5_5.w((Object)"<td><b>").w((Object)LexiconText.make((Type)BHxNtpPlatSvcWin32Editor.TYPE, (String)"NtpPlatformServiceWin32.minPollInterval.label").getText((Context)var1_1)).w((Object)"</b></td>");
var5_5.w((Object)"<td>");
this.minPollIntervalFe.setReadonly(var4_4);
this.minPollIntervalFe.write((BObject)var2_2.get(BNtpPlatformServiceWin32.minPollInterval), var1_1);
var5_5.w((Object)"</td>");
var5_5.w((Object)"</tr>");
var5_5.w((Object)"<tr>");
var5_5.w((Object)"<td><b>").w((Object)LexiconText.make((Type)BHxNtpPlatSvcWin32Editor.TYPE, (String)"NtpPlatformServiceWin32.maxPollInterval.label").getText((Context)var1_1)).w((Object)"</b></td>");
var5_5.w((Object)"<td>");
this.maxPollIntervalFe.setReadonly(var4_4);
this.maxPollIntervalFe.write((BObject)var2_2.get(BNtpPlatformServiceWin32.maxPollInterval), var1_1);
var5_5.w((Object)"</td>");
var5_5.w((Object)"</tr>");
var5_5.w((Object)"<tr>");
var5_5.w((Object)"<td><b>").w((Object)LexiconText.make((Type)BHxNtpPlatSvcWin32Editor.TYPE, (String)"NtpPlatformServiceWin32.specialPollInterval.label").getText((Context)var1_1)).w((Object)"</b></td>");
var5_5.w((Object)"<td>");
this.specialPollIntervalFe.setReadonly(var4_4);
this.specialPollIntervalFe.write((BObject)var2_2.get(BNtpPlatformServiceWin32.specialPollInterval), var1_1);
var5_5.w((Object)"</td>");
var5_5.w((Object)"</tr>");
var5_5.w((Object)"</table>");
var5_5.w((Object)"</div>");
var5_5.w((Object)"<div class='hx-PropertySheet-header'>").safe(LexiconText.make((Type)BHxNtpPlatSvcWin32Editor.TYPE, (String)"NtpPlatformService.timeServers.label").getText((Context)var1_1)).w((Object)"</div>");
var5_5.w((Object)"<div class='window-bg hx-PropertySheet'>");
var5_5.w((Object)"<div id='").w((Object)var1_1.scope("serversSection")).w((Object)"'>");
this.writeServersTableHeader(var1_1, var5_5);
var6_6 = 0;
var7_7 = var2_2.getTimeServers().getProperties();
if (true) ** GOTO lbl149
do {
var8_8 = (BNtpServerWin32)var7_7.get();
this.writeServerRow(var1_1, var5_5, var6_6++, var8_8, false);
lbl149:
// 2 sources
if ((v0 = BHxNtpPlatSvcWin32Editor.class$com$tridium$platform$win32$BNtpServerWin32) != null) continue;
v0 = BHxNtpPlatSvcWin32Editor.class("[Lcom.tridium.platform.win32.BNtpServerWin32;", false);
} while (var7_7.next(v0));
this.writeServersTableFooter(var1_1, var5_5);
var5_5.w((Object)"</div>");
var5_5.println("<div style='padding:10px; text-align:center;'>");
this.refreshButton.write(var1_1);
if (!var4_4) {
this.saveButton.write(var1_1);
}
var5_5.println("</div>");
var5_5.println("</div>");
}
protected void writeServersTableHeader(HxOp hxOp, HtmlWriter htmlWriter) throws Exception {
htmlWriter.w((Object)"<table cellpadding='5'>");
htmlWriter.w((Object)"<tr>");
if (hxOp.canWrite()) {
htmlWriter.w((Object)"<th>");
htmlWriter.w((Object)"</th>");
}
htmlWriter.w((Object)"<th>");
htmlWriter.w((Object)LexiconText.make((Type)TYPE, (String)"NtpPlatformService.address.label").getText((Context)hxOp));
htmlWriter.w((Object)"</th>");
htmlWriter.w((Object)"<th>");
htmlWriter.w((Object)LexiconText.make((Type)TYPE, (String)"NtpPlatformServiceWin32.useSpecialPollInterval.label").getText((Context)hxOp));
htmlWriter.w((Object)"</th>");
htmlWriter.w((Object)"<th>");
htmlWriter.w((Object)LexiconText.make((Type)TYPE, (String)"NtpPlatformServiceWin32.fallback.label").getText((Context)hxOp));
htmlWriter.w((Object)"</th>");
htmlWriter.w((Object)"<th>");
htmlWriter.w((Object)LexiconText.make((Type)TYPE, (String)"NtpPlatformServiceWin32.peerMode.label").getText((Context)hxOp));
htmlWriter.w((Object)"</th>");
htmlWriter.w((Object)"</tr>");
}
protected void writeServersTableFooter(HxOp hxOp, HtmlWriter htmlWriter) throws Exception {
if (hxOp.canWrite()) {
htmlWriter.w((Object)"<tr><td colspan='5' align='center'>");
htmlWriter.w((Object)"<a href='javascript:").w((Object)this.handleAddServer.getInvokeCode(hxOp)).w((Object)"'>");
htmlWriter.w((Object)"<img border='0' src='module://icons/x16/add.png'/>");
htmlWriter.w((Object)"</a>");
htmlWriter.w((Object)"&nbsp;");
htmlWriter.w((Object)"<a href='javascript:").w((Object)this.handleDeleteServer.getInvokeCode(hxOp)).w((Object)"'>");
htmlWriter.w((Object)"<img border='0' src='module://icons/x16/delete.png'/>");
htmlWriter.w((Object)"</a>");
htmlWriter.w((Object)"&nbsp;");
htmlWriter.w((Object)"<a href='javascript:").w((Object)this.handleMoveServerUp.getInvokeCode(hxOp)).w((Object)"'>");
htmlWriter.w((Object)"<img border='0' src='module://icons/x16/arrowUp.png'/>");
htmlWriter.w((Object)"</a>");
htmlWriter.w((Object)"&nbsp;");
htmlWriter.w((Object)"<a href='javascript:").w((Object)this.handleMoveServerDown.getInvokeCode(hxOp)).w((Object)"'>");
htmlWriter.w((Object)"<img border='0' src='module://icons/x16/arrowDown.png'/>");
htmlWriter.w((Object)"</a>");
htmlWriter.w((Object)"</td></tr>");
}
htmlWriter.w((Object)"</table>");
}
protected void writeServerRow(HxOp hxOp, HtmlWriter htmlWriter, int n, BNtpServerWin32 bNtpServerWin32, boolean bl) throws Exception {
htmlWriter.w((Object)"<tr>");
if (hxOp.canWrite()) {
htmlWriter.w((Object)"<td>");
htmlWriter.w((Object)"<input type='checkbox' name='").w((Object)hxOp.scope("select_" + n)).w((Object)"'");
if (bl) {
htmlWriter.w((Object)" checked='checked'");
}
htmlWriter.w((Object)"/>");
htmlWriter.w((Object)"</td>");
htmlWriter.w((Object)"<td>");
htmlWriter.w((Object)"<input type='text' size='32'");
htmlWriter.w((Object)" ").attr("name", hxOp.scope("address_" + n));
htmlWriter.w((Object)" ").attr("value", bNtpServerWin32.getAddress());
htmlWriter.w((Object)"/>");
htmlWriter.w((Object)"</td>");
htmlWriter.w((Object)"<td>");
htmlWriter.w((Object)"<select ").attr("name", hxOp.scope("useSpecial_" + n)).w((Object)">");
htmlWriter.w((Object)"<option value='false'");
if (!bNtpServerWin32.getUseSpecialPollInterval()) {
htmlWriter.w((Object)" selected='selected'");
}
htmlWriter.w((Object)">").w((Object)BBoolean.FALSE.toString((Context)hxOp)).w((Object)"</option>");
htmlWriter.w((Object)"<option value='true'");
if (bNtpServerWin32.getUseSpecialPollInterval()) {
htmlWriter.w((Object)" selected='selected'");
}
htmlWriter.w((Object)">").w((Object)BBoolean.TRUE.toString((Context)hxOp)).w((Object)"</option>");
htmlWriter.w((Object)"</select>");
htmlWriter.w((Object)"</td>");
htmlWriter.w((Object)"<td>");
htmlWriter.w((Object)"<select ").attr("name", hxOp.scope("fallback_" + n)).w((Object)">");
htmlWriter.w((Object)"<option value='false'");
if (!bNtpServerWin32.getFallbackOnly()) {
htmlWriter.w((Object)" selected='selected'");
}
htmlWriter.w((Object)">").w((Object)BBoolean.FALSE.toString((Context)hxOp)).w((Object)"</option>");
htmlWriter.w((Object)"<option value='true'");
if (bNtpServerWin32.getFallbackOnly()) {
htmlWriter.w((Object)" selected='selected'");
}
htmlWriter.w((Object)">").w((Object)BBoolean.TRUE.toString((Context)hxOp)).w((Object)"</option>");
htmlWriter.w((Object)"</select>");
htmlWriter.w((Object)"</td>");
htmlWriter.w((Object)"<td>");
htmlWriter.w((Object)"<select ").attr("name", hxOp.scope("peerMode_" + n)).w((Object)">");
htmlWriter.w((Object)"<option value='0'");
if (bNtpServerWin32.getPeerMode() == BNtpMode.unspecified) {
htmlWriter.w((Object)" selected='selected'");
}
htmlWriter.w((Object)">").w((Object)BNtpMode.unspecified.toString((Context)hxOp)).w((Object)"</option>");
htmlWriter.w((Object)"<option value='1'");
if (bNtpServerWin32.getPeerMode() == BNtpMode.symmetricActive) {
htmlWriter.w((Object)" selected='selected'");
}
htmlWriter.w((Object)">").w((Object)BNtpMode.symmetricActive.toString((Context)hxOp)).w((Object)"</option>");
htmlWriter.w((Object)"<option value='3'");
if (bNtpServerWin32.getPeerMode() == BNtpMode.client) {
htmlWriter.w((Object)" selected='selected'");
}
htmlWriter.w((Object)">").w((Object)BNtpMode.client.toString((Context)hxOp)).w((Object)"</option>");
htmlWriter.w((Object)"</select>");
htmlWriter.w((Object)"</td>");
} else {
htmlWriter.w((Object)"<td>").safe(bNtpServerWin32.getAddress()).w((Object)"</td>");
htmlWriter.w((Object)"<td>").safe(bNtpServerWin32.get(BNtpServerWin32.useSpecialPollInterval).toString((Context)hxOp)).w((Object)"</td>");
htmlWriter.w((Object)"<td>").safe(bNtpServerWin32.get(BNtpServerWin32.fallbackOnly).toString((Context)hxOp)).w((Object)"</td>");
htmlWriter.w((Object)"<td>").safe(bNtpServerWin32.getPeerMode().toString((Context)hxOp)).w((Object)"</td>");
}
htmlWriter.w((Object)"</tr>");
}
protected void writeSyncPolicy(HxOp hxOp, HtmlWriter htmlWriter, boolean bl, boolean bl2, BNtpSyncPolicyWin32 bNtpSyncPolicyWin32) throws Exception {
htmlWriter.w((Object)"<select ").attr("name", hxOp.scope("syncPolicy.value"));
if (!hxOp.canWrite()) {
htmlWriter.w((Object)" disabled='disabled'");
}
htmlWriter.w((Object)">");
if (bl) {
htmlWriter.w((Object)"<option value='1' ");
if (bNtpSyncPolicyWin32 == BNtpSyncPolicyWin32.ntp) {
htmlWriter.w((Object)"selected='selected'");
}
htmlWriter.w('>');
htmlWriter.safe(BNtpSyncPolicyWin32.ntp.toString((Context)hxOp));
htmlWriter.w((Object)"</option>");
if (bl2) {
htmlWriter.w((Object)"<option value='2' ");
if (bNtpSyncPolicyWin32 == BNtpSyncPolicyWin32.domain || bNtpSyncPolicyWin32 == BNtpSyncPolicyWin32.none) {
htmlWriter.w((Object)"selected='selected'");
}
htmlWriter.w('>');
htmlWriter.safe(BNtpSyncPolicyWin32.domain.toString((Context)hxOp));
htmlWriter.w((Object)"</option>");
htmlWriter.w((Object)"<option value='3' ");
if (bNtpSyncPolicyWin32 == BNtpSyncPolicyWin32.both) {
htmlWriter.w((Object)"selected='selected'");
}
htmlWriter.w('>');
htmlWriter.safe(BNtpSyncPolicyWin32.both.toString((Context)hxOp));
htmlWriter.w((Object)"</option>");
}
} else {
htmlWriter.w((Object)"<option value='0' ");
htmlWriter.w((Object)"selected='selected'");
htmlWriter.w('>');
htmlWriter.safe(BNtpSyncPolicyWin32.none.toString((Context)hxOp));
htmlWriter.w((Object)"</option>");
}
htmlWriter.w((Object)"</select>");
}
protected BNtpServerWin32[] getTimeServers(HxOp hxOp) throws Exception {
Class clazz = class$com$tridium$platform$win32$BNtpServerWin32;
if (clazz == null) {
clazz = class$com$tridium$platform$win32$BNtpServerWin32 = BHxNtpPlatSvcWin32Editor.class("[Lcom.tridium.platform.win32.BNtpServerWin32;", false);
}
Array array = new Array(clazz);
int n = 0;
String string = hxOp.getFormValue("address_" + n);
while (string != null) {
BNtpServerWin32 bNtpServerWin32 = new BNtpServerWin32();
bNtpServerWin32.setAddress(string);
bNtpServerWin32.setUseSpecialPollInterval(hxOp.getFormValue("useSpecial_" + n).equals("true"));
bNtpServerWin32.setFallbackOnly(hxOp.getFormValue("fallback_" + n).equals("true"));
bNtpServerWin32.setPeerMode(BNtpMode.make(Integer.parseInt(hxOp.getFormValue("peerMode_" + n))));
array.add((Object)bNtpServerWin32);
string = hxOp.getFormValue("address_" + ++n);
}
return (BNtpServerWin32[])array.trim();
}
public BObject save(HxOp hxOp) throws Exception {
BNtpPlatformServiceWin32 bNtpPlatformServiceWin32 = (BNtpPlatformServiceWin32)hxOp.get();
BNtpServerWin32[] bNtpServerWin32Array = this.getTimeServers(hxOp);
String[] stringArray = new String[bNtpServerWin32Array.length];
HashSet hashSet = new HashSet();
int n = 0;
while (n < bNtpServerWin32Array.length) {
if (bNtpServerWin32Array[n].getAddress().trim().length() == 0) {
throw new LocalizableRuntimeException("platform", "NtpServerFE.nullAddress");
}
stringArray[n] = bNtpServerWin32Array[n].getServerString();
String string = bNtpServerWin32Array[n].getPropertyName(stringArray[n]);
if (hashSet.contains(string)) {
throw new LocalizableRuntimeException("platform", "NtpServerVectorFE.duplicateServer");
}
++n;
}
bNtpPlatformServiceWin32.getTimeServers().sync(stringArray);
bNtpPlatformServiceWin32.setEnabled(((BBoolean)this.enabledFe.save((BObject)bNtpPlatformServiceWin32.get(BNtpPlatformService.enabled), hxOp)).getBoolean());
bNtpPlatformServiceWin32.setSyncPolicy(BNtpSyncPolicyWin32.make(Integer.parseInt(hxOp.getFormValue("syncPolicy.value"))));
bNtpPlatformServiceWin32.getTimeServers().sync(stringArray);
bNtpPlatformServiceWin32.setMaxPosPhaseCorrection(((BInteger)this.maxPosPhaseCorrectionFe.save((BObject)bNtpPlatformServiceWin32.get(BNtpPlatformServiceWin32.maxPosPhaseCorrection), hxOp)).getInt());
bNtpPlatformServiceWin32.setMaxNegPhaseCorrection(((BInteger)this.maxNegPhaseCorrectionFe.save((BObject)bNtpPlatformServiceWin32.get(BNtpPlatformServiceWin32.maxNegPhaseCorrection), hxOp)).getInt());
bNtpPlatformServiceWin32.setMinPollInterval(((BInteger)this.minPollIntervalFe.save((BObject)bNtpPlatformServiceWin32.get(BNtpPlatformServiceWin32.minPollInterval), hxOp)).getInt());
bNtpPlatformServiceWin32.setMaxPollInterval(((BInteger)this.maxPollIntervalFe.save((BObject)bNtpPlatformServiceWin32.get(BNtpPlatformServiceWin32.maxPollInterval), hxOp)).getInt());
bNtpPlatformServiceWin32.setSpecialPollInterval(((BInteger)this.specialPollIntervalFe.save((BObject)bNtpPlatformServiceWin32.get(BNtpPlatformServiceWin32.specialPollInterval), hxOp)).getInt());
BSystemPlatformService bSystemPlatformService = (BSystemPlatformService)Sys.getService((Type)BSystemPlatformService.TYPE);
if (bSystemPlatformService.getLocalDaemonAccess() != BDaemonAccessLevel.restricted) {
bNtpPlatformServiceWin32.savePlatformServiceProperties();
}
return bNtpPlatformServiceWin32;
}
static /* synthetic */ Class class(String string, boolean bl) {
try {
Class<?> clazz = Class.forName(string);
if (!bl) {
clazz = clazz.getComponentType();
}
return clazz;
}
catch (ClassNotFoundException classNotFoundException) {
throw new NoClassDefFoundError(classNotFoundException.getMessage());
}
}
protected BHxNtpPlatSvcWin32Editor() {
this.registerEvent((Event)this.handleEnabledChanged);
this.handleAddServer = new HandleAddServer();
this.registerEvent((Event)this.handleAddServer);
this.handleDeleteServer = new HandleDeleteServer();
this.registerEvent((Event)this.handleDeleteServer);
this.handleMoveServerUp = new HandleMoveServerUp();
this.registerEvent((Event)this.handleMoveServerUp);
this.handleMoveServerDown = new HandleMoveServerDown();
this.registerEvent((Event)this.handleMoveServerDown);
this.enabledFe = HxBooleanHelper.makeFE("enabled", null);
this.maxPosPhaseCorrectionFe = HxViewHelper.makeFE("maxPosPhaseCorrection", (BObject)BNtpPlatformServiceWin32.maxPosPhaseCorrection.getDefaultValue(), (Context)BNtpPlatformServiceWin32.maxPosPhaseCorrection.getFacets());
this.maxNegPhaseCorrectionFe = HxViewHelper.makeFE("maxNegPhaseCorrection", (BObject)BNtpPlatformServiceWin32.maxNegPhaseCorrection.getDefaultValue(), (Context)BNtpPlatformServiceWin32.maxNegPhaseCorrection.getFacets());
this.minPollIntervalFe = HxViewHelper.makeFE("minPollInterval", (BObject)BNtpPlatformServiceWin32.minPollInterval.getDefaultValue(), (Context)BNtpPlatformServiceWin32.minPollInterval.getFacets());
this.maxPollIntervalFe = HxViewHelper.makeFE("maxPollInterval", (BObject)BNtpPlatformServiceWin32.maxPollInterval.getDefaultValue(), (Context)BNtpPlatformServiceWin32.maxPollInterval.getFacets());
this.specialPollIntervalFe = HxViewHelper.makeFE("specialPollInterval", (BObject)BNtpPlatformServiceWin32.specialPollInterval.getDefaultValue(), (Context)BNtpPlatformServiceWin32.specialPollInterval.getFacets());
}
static {
Class clazz = class$com$tridium$platform$hx$BHxNtpPlatSvcWin32Editor;
if (clazz == null) {
clazz = class$com$tridium$platform$hx$BHxNtpPlatSvcWin32Editor = BHxNtpPlatSvcWin32Editor.class("[Lcom.tridium.platform.hx.BHxNtpPlatSvcWin32Editor;", false);
}
TYPE = Sys.loadType((Class)clazz);
}
/*
* Illegal identifiers - consider using --renameillegalidents true
*/
private class HandleEnabledChanged
extends Command {
public String getDisplayName(HxOp hxOp) {
return "";
}
public void handle(HxOp hxOp) throws Exception {
String string = hxOp.scope("syncPolicySection");
HtmlWriter htmlWriter = hxOp.getHtmlWriter();
htmlWriter.w((Object)"var syncPolicySection = document.getElementById('").w((Object)string).w((Object)"');");
htmlWriter.w((Object)"syncPolicySection.innerHTML = \"");
BHxNtpPlatSvcWin32Editor.this.writeSyncPolicy(hxOp, htmlWriter, hxOp.getFormValue("enabled.value").equals("true"), hxOp.getFormValue("domainMember").equals("true"), BNtpSyncPolicyWin32.make(Integer.parseInt(hxOp.getFormValue("syncPolicy.value"))));
htmlWriter.w((Object)"\";");
}
public HandleEnabledChanged() {
super((BHxView)BHxNtpPlatSvcWin32Editor.this);
}
}
/*
* Illegal identifiers - consider using --renameillegalidents true
*/
private class HandleAddServer
extends Command {
public String getDisplayName(HxOp hxOp) {
return "";
}
public void handle(HxOp hxOp) throws Exception {
BNtpServerWin32[] bNtpServerWin32Array = BHxNtpPlatSvcWin32Editor.this.getTimeServers(hxOp);
String string = hxOp.scope("serversSection");
HtmlWriter htmlWriter = hxOp.getHtmlWriter();
htmlWriter.w((Object)"var serversSection = document.getElementById('").w((Object)string).w((Object)"');");
htmlWriter.w((Object)"serversSection.innerHTML = \"");
BHxNtpPlatSvcWin32Editor.this.writeServersTableHeader(hxOp, htmlWriter);
int n = 0;
while (n < bNtpServerWin32Array.length) {
BHxNtpPlatSvcWin32Editor.this.writeServerRow(hxOp, htmlWriter, n, bNtpServerWin32Array[n], false);
++n;
}
BHxNtpPlatSvcWin32Editor.this.writeServerRow(hxOp, htmlWriter, bNtpServerWin32Array.length, new BNtpServerWin32(), false);
BHxNtpPlatSvcWin32Editor.this.writeServersTableFooter(hxOp, htmlWriter);
htmlWriter.w((Object)"\";");
}
public HandleAddServer() {
super((BHxView)BHxNtpPlatSvcWin32Editor.this);
}
}
/*
* Illegal identifiers - consider using --renameillegalidents true
*/
private class HandleDeleteServer
extends Command {
public String getDisplayName(HxOp hxOp) {
return "";
}
public void handle(HxOp hxOp) throws Exception {
BNtpServerWin32[] bNtpServerWin32Array = BHxNtpPlatSvcWin32Editor.this.getTimeServers(hxOp);
String string = hxOp.scope("serversSection");
HtmlWriter htmlWriter = hxOp.getHtmlWriter();
htmlWriter.w((Object)"var serversSection = document.getElementById('").w((Object)string).w((Object)"');");
htmlWriter.w((Object)"serversSection.innerHTML = \"");
BHxNtpPlatSvcWin32Editor.this.writeServersTableHeader(hxOp, htmlWriter);
int n = 0;
int n2 = 0;
while (n2 < bNtpServerWin32Array.length) {
if (hxOp.getFormValue("select_" + n2) == null) {
BHxNtpPlatSvcWin32Editor.this.writeServerRow(hxOp, htmlWriter, n2 - n, bNtpServerWin32Array[n2], false);
} else {
++n;
}
++n2;
}
BHxNtpPlatSvcWin32Editor.this.writeServersTableFooter(hxOp, htmlWriter);
htmlWriter.w((Object)"\";");
}
public HandleDeleteServer() {
super((BHxView)BHxNtpPlatSvcWin32Editor.this);
}
}
/*
* Illegal identifiers - consider using --renameillegalidents true
*/
private class HandleMoveServerUp
extends Command {
public String getDisplayName(HxOp hxOp) {
return "";
}
public void handle(HxOp hxOp) throws Exception {
String[] stringArray = hxOp.getFormKeys();
int n = -1;
int n2 = 0;
while (n2 < stringArray.length) {
if (stringArray[n2].startsWith("select_")) {
if (n < 0) {
n = Integer.parseInt(stringArray[n2].substring(7));
} else {
return;
}
}
++n2;
}
if (n > 0) {
BNtpServerWin32[] bNtpServerWin32Array = BHxNtpPlatSvcWin32Editor.this.getTimeServers(hxOp);
BNtpServerWin32 bNtpServerWin32 = bNtpServerWin32Array[n - 1];
bNtpServerWin32Array[n - 1] = bNtpServerWin32Array[n];
bNtpServerWin32Array[n] = bNtpServerWin32;
String string = hxOp.scope("serversSection");
HtmlWriter htmlWriter = hxOp.getHtmlWriter();
htmlWriter.w((Object)"var serversSection = document.getElementById('").w((Object)string).w((Object)"');");
htmlWriter.w((Object)"serversSection.innerHTML = \"");
BHxNtpPlatSvcWin32Editor.this.writeServersTableHeader(hxOp, htmlWriter);
int n3 = 0;
while (n3 < bNtpServerWin32Array.length) {
BNtpServerWin32 bNtpServerWin322 = bNtpServerWin32Array[n3];
boolean bl = false;
if (n3 == n - 1) {
bl = true;
}
BHxNtpPlatSvcWin32Editor.this.writeServerRow(hxOp, htmlWriter, n3, bNtpServerWin322, bl);
++n3;
}
BHxNtpPlatSvcWin32Editor.this.writeServersTableFooter(hxOp, htmlWriter);
htmlWriter.w((Object)"\";");
}
}
public HandleMoveServerUp() {
super((BHxView)BHxNtpPlatSvcWin32Editor.this);
}
}
/*
* Illegal identifiers - consider using --renameillegalidents true
*/
private class HandleMoveServerDown
extends Command {
public String getDisplayName(HxOp hxOp) {
return "";
}
public void handle(HxOp hxOp) throws Exception {
String[] stringArray = hxOp.getFormKeys();
int n = -1;
int n2 = 0;
while (n2 < stringArray.length) {
if (stringArray[n2].startsWith("select_")) {
if (n < 0) {
n = Integer.parseInt(stringArray[n2].substring(7));
} else {
return;
}
}
++n2;
}
if (n >= 0 && hxOp.getFormValue("address_" + (n + 1)) != null) {
BNtpServerWin32[] bNtpServerWin32Array = BHxNtpPlatSvcWin32Editor.this.getTimeServers(hxOp);
BNtpServerWin32 bNtpServerWin32 = bNtpServerWin32Array[n + 1];
bNtpServerWin32Array[n + 1] = bNtpServerWin32Array[n];
bNtpServerWin32Array[n] = bNtpServerWin32;
String string = hxOp.scope("serversSection");
HtmlWriter htmlWriter = hxOp.getHtmlWriter();
htmlWriter.w((Object)"var serversSection = document.getElementById('").w((Object)string).w((Object)"');");
htmlWriter.w((Object)"serversSection.innerHTML = \"");
BHxNtpPlatSvcWin32Editor.this.writeServersTableHeader(hxOp, htmlWriter);
int n3 = 0;
while (n3 < bNtpServerWin32Array.length) {
BNtpServerWin32 bNtpServerWin322 = bNtpServerWin32Array[n3];
boolean bl = false;
if (n3 == n + 1) {
bl = true;
}
BHxNtpPlatSvcWin32Editor.this.writeServerRow(hxOp, htmlWriter, n3, bNtpServerWin322, bl);
++n3;
}
BHxNtpPlatSvcWin32Editor.this.writeServersTableFooter(hxOp, htmlWriter);
htmlWriter.w((Object)"\";");
}
}
public HandleMoveServerDown() {
super((BHxView)BHxNtpPlatSvcWin32Editor.this);
}
}
}
@@ -0,0 +1,197 @@
/*
* Decompiled with CFR 0.152.
*
* Could not load the following classes:
* javax.baja.hx.BHxView
* javax.baja.hx.HxOp
* javax.baja.io.HtmlWriter
* javax.baja.sys.BAbsTime
* javax.baja.sys.BFacets
* javax.baja.sys.BMonth
* javax.baja.sys.BObject
* javax.baja.sys.Context
* javax.baja.sys.Sys
* javax.baja.sys.Type
* javax.baja.timezone.BTimeZone
* javax.baja.util.LexiconText
*/
package com.tridium.platform.hx;
import com.tridium.platform.BPlatformServiceContainer;
import com.tridium.platform.BSystemPlatformService;
import com.tridium.platform.daemon.BDaemonAccessLevel;
import com.tridium.platform.hx.util.HxButtonHelper;
import com.tridium.platform.hx.util.HxMessageHelper;
import com.tridium.platform.hx.util.HxTimeZoneHelper;
import com.tridium.platform.hx.util.HxViewHelper;
import com.tridium.platform.qnx.BSystemPlatformServiceQnx;
import com.tridium.platform.win32.BSystemPlatformServiceNxs;
import com.tridium.platform.win32.BSystemPlatformServiceNxtFlash;
import java.util.HashMap;
import javax.baja.hx.BHxView;
import javax.baja.hx.HxOp;
import javax.baja.io.HtmlWriter;
import javax.baja.sys.BAbsTime;
import javax.baja.sys.BFacets;
import javax.baja.sys.BMonth;
import javax.baja.sys.BObject;
import javax.baja.sys.Context;
import javax.baja.sys.Sys;
import javax.baja.sys.Type;
import javax.baja.timezone.BTimeZone;
import javax.baja.util.LexiconText;
/*
* Illegal identifiers - consider using --renameillegalidents true
*/
public class BHxSystemDateTimeEditor
extends BHxView {
public static final BHxSystemDateTimeEditor INSTANCE = new BHxSystemDateTimeEditor();
public static final Type TYPE;
HxViewHelper systemTimeFE = HxViewHelper.makeFE("systemTime", (BObject)BAbsTime.DEFAULT, (Context)BFacets.make((String)"showTimeZone", (boolean)false));
HxViewHelper timeZoneFE;
HxButtonHelper refreshButton;
HxButtonHelper saveButton;
static /* synthetic */ Class class$com$tridium$platform$hx$BHxSystemDateTimeEditor;
static /* synthetic */ Class class$com$tridium$platform$BSystemPlatformService;
public Type getType() {
return TYPE;
}
public void write(HxOp hxOp) throws Exception {
hxOp.addJavaScript("module://platform/lib/BHxSystemPlatformServiceEditor.js");
BSystemPlatformService bSystemPlatformService = this.getSystemPlatformService(hxOp);
bSystemPlatformService.checkPropertiesLoaded();
bSystemPlatformService.poll();
HtmlWriter htmlWriter = hxOp.getHtmlWriter();
HxMessageHelper.writeMessage("SystemDateTimeEditor", hxOp);
boolean bl = false;
if (!hxOp.canWrite() || bSystemPlatformService.getLocalDaemonAccess() == BDaemonAccessLevel.restricted) {
bl = true;
}
boolean bl2 = bl;
this.systemTimeFE.setReadonly(bl2);
this.timeZoneFE.setReadonly(hxOp.canWrite() ^ true);
this.saveButton.setReadonly(hxOp.canWrite() ^ true);
BTimeZone bTimeZone = bSystemPlatformService.getTimeZone();
BAbsTime bAbsTime = BAbsTime.make((long)bSystemPlatformService.getSystemTime().getMillis(), (BTimeZone)bTimeZone);
htmlWriter.w((Object)"<input type='hidden' name='").w((Object)hxOp.scope("systemRestart")).println("' value='false'/>");
htmlWriter.w((Object)"<input type='hidden' name='").w((Object)hxOp.scope("systemReboot")).println("' value='false'/>");
htmlWriter.w((Object)"<input type='hidden' name='").w((Object)hxOp.scope("restartEnabled")).w((Object)"' value='");
if (hxOp.canWrite() && bSystemPlatformService.getAllowStationRestart()) {
htmlWriter.w((Object)"true");
} else {
htmlWriter.w((Object)"false");
}
htmlWriter.w((Object)"'/>");
htmlWriter.w((Object)"<input type='hidden' name='").w((Object)hxOp.scope("tzReboot")).w((Object)"' value='");
if (bSystemPlatformService instanceof BSystemPlatformServiceQnx || bSystemPlatformService instanceof BSystemPlatformServiceNxs || bSystemPlatformService instanceof BSystemPlatformServiceNxtFlash) {
htmlWriter.w((Object)"true");
} else {
htmlWriter.w((Object)"false");
}
htmlWriter.w((Object)"'/>");
htmlWriter.w((Object)"<table cellpadding='5'>");
htmlWriter.w((Object)"<tr>");
htmlWriter.w((Object)"<td><b>").w((Object)LexiconText.make((Type)TYPE, (String)"labels.system.systemTime").getText((Context)hxOp)).w((Object)"</b></td>");
htmlWriter.w((Object)"<td>");
this.systemTimeFE.write((BObject)bAbsTime, hxOp);
htmlWriter.w((Object)("&nbsp;" + bTimeZone.getShortDisplayName(bAbsTime.inDaylightTime(), null)));
htmlWriter.w((Object)"</td>");
htmlWriter.w((Object)"</tr>");
htmlWriter.w((Object)"<tr>");
htmlWriter.w((Object)"<td><b>").w((Object)LexiconText.make((Type)TYPE, (String)"labels.system.systemTimeZone").getText((Context)hxOp)).w((Object)"</b></td>");
htmlWriter.w((Object)"<td>");
this.timeZoneFE.write((BObject)bTimeZone, hxOp);
htmlWriter.w((Object)"</td>");
htmlWriter.w((Object)"</tr>");
htmlWriter.w((Object)"</table>");
htmlWriter.println("<div style='padding:10px; text-align:center;'>");
this.refreshButton.write(hxOp);
if (hxOp.canWrite()) {
HashMap<String, String> hashMap = new HashMap<String, String>();
if (bSystemPlatformService.getLocalDaemonAccess() != BDaemonAccessLevel.restricted) {
hashMap.put("onclick", "onSystemPlatformServiceSave(\"" + hxOp.scope("submit") + "\",\"" + this.getLexicon().getText("SystemPlatformServicePlugin.restartRequired.hxConfirmMessage") + "\",\"" + this.getLexicon().getText("SystemPlatformServicePlugin.rebootRequired.hxConfirmMessage") + "\")");
} else {
hashMap.put("onclick", "onSystemPlatformServiceSave(\"" + hxOp.scope("submit") + "\",\"" + this.getLexicon().getText("SystemPlatformServicePlugin.restartWillBeRequired.hxConfirmMessage") + "\",\"" + this.getLexicon().getText("SystemPlatformServicePlugin.rebootWillBeRequired.hxConfirmMessage") + "\")");
}
this.saveButton.write(hxOp, hashMap);
}
htmlWriter.println("</div>");
}
public BObject save(HxOp hxOp) throws Exception {
BSystemPlatformService bSystemPlatformService = this.getSystemPlatformService(hxOp);
BTimeZone bTimeZone = (BTimeZone)this.timeZoneFE.save((BObject)bSystemPlatformService.getTimeZone(), hxOp);
BAbsTime bAbsTime = (BAbsTime)this.systemTimeFE.save((BObject)bSystemPlatformService.getSystemTime(), hxOp);
bAbsTime = BAbsTime.make((int)bAbsTime.getYear(), (BMonth)bAbsTime.getMonth(), (int)bAbsTime.getDay(), (int)bAbsTime.getHour(), (int)bAbsTime.getMinute(), (int)0, (int)0, (BTimeZone)bTimeZone);
if (bSystemPlatformService.getLocalDaemonAccess() != BDaemonAccessLevel.restricted) {
bSystemPlatformService.setSystemTime(bAbsTime);
}
bSystemPlatformService.setTimeZone(bTimeZone);
bSystemPlatformService.savePlatformServiceProperties();
if (Boolean.valueOf(hxOp.getFormValue("systemReboot")).booleanValue()) {
if (bSystemPlatformService.getLocalDaemonAccess() != BDaemonAccessLevel.restricted) {
bSystemPlatformService.reboot();
HxMessageHelper.addMessage("SystemDateTimeEditor", LexiconText.make((String)"platform", (String)"SystemPlatformServiceEditor.systemReboot.hxMessage"), hxOp);
} else {
HxMessageHelper.addMessage("SystemDateTimeEditor", LexiconText.make((String)"platform", (String)"SystemPlatformServiceEditor.systemNeedsReboot.hxMessage"), hxOp);
}
} else if (Boolean.valueOf(hxOp.getFormValue("systemRestart")).booleanValue()) {
if (bSystemPlatformService.getLocalDaemonAccess() != BDaemonAccessLevel.restricted) {
bSystemPlatformService.restartStation();
HxMessageHelper.addMessage("SystemDateTimeEditor", LexiconText.make((String)"platform", (String)"SystemPlatformServiceEditor.systemRestart.hxMessage"), hxOp);
} else {
HxMessageHelper.addMessage("SystemDateTimeEditor", LexiconText.make((String)"platform", (String)"SystemPlatformServiceEditor.systemNeedsRestart.hxMessage"), hxOp);
}
}
return hxOp.get();
}
private final BSystemPlatformService getSystemPlatformService(HxOp hxOp) {
BObject bObject = hxOp.get();
if (bObject instanceof BSystemPlatformService) {
return (BSystemPlatformService)bObject;
}
if (bObject instanceof BPlatformServiceContainer) {
BPlatformServiceContainer bPlatformServiceContainer = (BPlatformServiceContainer)bObject;
Class clazz = class$com$tridium$platform$BSystemPlatformService;
if (clazz == null) {
clazz = class$com$tridium$platform$BSystemPlatformService = BHxSystemDateTimeEditor.class("[Lcom.tridium.platform.BSystemPlatformService;", false);
}
return (BSystemPlatformService)bPlatformServiceContainer.getChildren(clazz)[0];
}
throw new ClassCastException();
}
static /* synthetic */ Class class(String string, boolean bl) {
try {
Class<?> clazz = Class.forName(string);
if (!bl) {
clazz = clazz.getComponentType();
}
return clazz;
}
catch (ClassNotFoundException classNotFoundException) {
throw new NoClassDefFoundError(classNotFoundException.getMessage());
}
}
protected BHxSystemDateTimeEditor() {
HashMap<String, String> hashMap = new HashMap<String, String>();
hashMap.put("onChange", "onTimeZoneChanged(event)");
this.timeZoneFE = HxTimeZoneHelper.makeFE("timeZone", hashMap, (Context)BSystemPlatformService.timeZone.getFacets());
this.refreshButton = HxButtonHelper.makeRefresh();
this.saveButton = HxButtonHelper.makeSave();
}
static {
Class clazz = class$com$tridium$platform$hx$BHxSystemDateTimeEditor;
if (clazz == null) {
clazz = class$com$tridium$platform$hx$BHxSystemDateTimeEditor = BHxSystemDateTimeEditor.class("[Lcom.tridium.platform.hx.BHxSystemDateTimeEditor;", false);
}
TYPE = Sys.loadType((Class)clazz);
}
}
@@ -0,0 +1,907 @@
/*
* Decompiled with CFR 0.152.
*
* Could not load the following classes:
* javax.baja.data.BIDataValue
* javax.baja.hx.BHxView
* javax.baja.hx.HxOp
* javax.baja.io.HtmlWriter
* javax.baja.naming.BOrd
* javax.baja.naming.SlotPath
* javax.baja.sys.BAbsTime
* javax.baja.sys.BBoolean
* javax.baja.sys.BFacets
* javax.baja.sys.BInteger
* javax.baja.sys.BMonth
* javax.baja.sys.BObject
* javax.baja.sys.BRelTime
* javax.baja.sys.BString
* javax.baja.sys.BValue
* javax.baja.sys.Context
* javax.baja.sys.Sys
* javax.baja.sys.Type
* javax.baja.timezone.BTimeZone
* javax.baja.util.Lexicon
* javax.baja.util.LexiconText
*/
package com.tridium.platform.hx;
import com.tridium.platform.BEngineWatchdogPolicy;
import com.tridium.platform.BFilesystemAttributes;
import com.tridium.platform.BPlatformServiceContainer;
import com.tridium.platform.BSystemPlatformService;
import com.tridium.platform.daemon.BDaemonAccessLevel;
import com.tridium.platform.daemon.DaemonFileUtil;
import com.tridium.platform.hx.util.HxBooleanHelper;
import com.tridium.platform.hx.util.HxButtonHelper;
import com.tridium.platform.hx.util.HxMessageHelper;
import com.tridium.platform.hx.util.HxStringHelper;
import com.tridium.platform.hx.util.HxTimeZoneHelper;
import com.tridium.platform.hx.util.HxViewHelper;
import com.tridium.platform.hx.util.NotNullStringValidator;
import com.tridium.platform.hx.util.SimpleValidator;
import com.tridium.platform.qnx.BSystemPlatformServiceQnx;
import com.tridium.platform.qnx.BSystemPlatformServiceQnxJavelina;
import com.tridium.platform.qnx.BSystemPlatformServiceQnxLegacy;
import com.tridium.platform.qnx.BSystemPlatformServiceQnxNpm2xx;
import com.tridium.platform.qnx.BSystemPlatformServiceQnxNpm3xx;
import com.tridium.platform.qnx.BSystemPlatformServiceQnxNpm6xx;
import com.tridium.platform.qnx.BSystemPlatformServiceQnxTitan;
import com.tridium.platform.win32.BSystemPlatformServiceNxs;
import com.tridium.platform.win32.BSystemPlatformServiceNxtFlash;
import java.text.DecimalFormat;
import java.util.HashMap;
import java.util.Map;
import javax.baja.data.BIDataValue;
import javax.baja.hx.BHxView;
import javax.baja.hx.HxOp;
import javax.baja.io.HtmlWriter;
import javax.baja.naming.BOrd;
import javax.baja.naming.SlotPath;
import javax.baja.sys.BAbsTime;
import javax.baja.sys.BBoolean;
import javax.baja.sys.BFacets;
import javax.baja.sys.BInteger;
import javax.baja.sys.BMonth;
import javax.baja.sys.BObject;
import javax.baja.sys.BRelTime;
import javax.baja.sys.BString;
import javax.baja.sys.BValue;
import javax.baja.sys.Context;
import javax.baja.sys.Sys;
import javax.baja.sys.Type;
import javax.baja.timezone.BTimeZone;
import javax.baja.util.Lexicon;
import javax.baja.util.LexiconText;
/*
* Illegal identifiers - consider using --renameillegalidents true
*/
public class BHxSystemPlatformServiceEditor
extends BHxView {
public static final BHxSystemPlatformServiceEditor INSTANCE = new BHxSystemPlatformServiceEditor();
public static final Type TYPE;
private static Lexicon lex;
private static DecimalFormat mbFormat;
HxViewHelper localeFE;
HxViewHelper systemTimeFE;
HxViewHelper timeZoneFE;
HxViewHelper engineWatchdogPolicyFE;
HxViewHelper engineWatchdogTimeoutFE;
HxViewHelper stationAutoSaveFrequencyFE;
HxViewHelper stationSaveBackupCountFE;
HxViewHelper isStationAutoSaveEnabledFE;
HxButtonHelper refreshButton;
HxButtonHelper saveButton;
HxViewHelper failureRebootLimitFE;
HxViewHelper failureRebootLimitPeriodFE;
HxViewHelper ramDiskMinFreeFE;
HxViewHelper ramDiskSizeFE;
HxViewHelper javaHeapMinFreeFE;
HxViewHelper openFileDescriptorsMinFreeFE;
HxViewHelper freeRamMinFreeFE;
HxViewHelper diskSpaceMinFreeFE;
HxViewHelper minFileFreeFE;
HxViewHelper batteryPresentFE;
HxViewHelper enableScreenSaverFE;
HxViewHelper saveScreenAfterFE;
HxViewHelper cleanScreenDurationFE;
HxViewHelper tamperSwitchEnabledFE;
static /* synthetic */ Class class$com$tridium$platform$hx$BHxSystemPlatformServiceEditor;
static /* synthetic */ Class class$com$tridium$platform$BSystemPlatformService;
public Type getType() {
return TYPE;
}
public void write(HxOp hxOp) throws Exception {
Object object;
hxOp.addJavaScript("module://platform/lib/BHxSystemPlatformServiceEditor.js");
BSystemPlatformService bSystemPlatformService = this.getSystemPlatformService(hxOp);
bSystemPlatformService.checkPropertiesLoaded();
bSystemPlatformService.poll();
HtmlWriter htmlWriter = hxOp.getHtmlWriter();
HxMessageHelper.writeMessage("SystemPlatformServiceEditor", hxOp);
boolean bl = false;
if (!hxOp.canWrite() || bSystemPlatformService.getLocalDaemonAccess() == BDaemonAccessLevel.restricted) {
bl = true;
}
boolean bl2 = bl;
this.systemTimeFE.setReadonly(bl2);
this.localeFE.setReadonly(hxOp.canWrite() ^ true);
this.timeZoneFE.setReadonly(hxOp.canWrite() ^ true);
this.engineWatchdogPolicyFE.setReadonly(hxOp.canWrite() ^ true);
this.engineWatchdogTimeoutFE.setReadonly(hxOp.canWrite() ^ true);
this.isStationAutoSaveEnabledFE.setReadonly(hxOp.canWrite() ^ true);
this.stationAutoSaveFrequencyFE.setReadonly(hxOp.canWrite() ^ true);
this.stationSaveBackupCountFE.setReadonly(hxOp.canWrite() ^ true);
this.saveButton.setReadonly(hxOp.canWrite() ^ true);
if (bSystemPlatformService instanceof BSystemPlatformServiceQnx) {
this.failureRebootLimitFE.setReadonly(hxOp.canWrite() ^ true);
this.failureRebootLimitPeriodFE.setReadonly(hxOp.canWrite() ^ true);
this.ramDiskMinFreeFE.setReadonly(hxOp.canWrite() ^ true);
boolean bl3 = false;
if (!hxOp.canWrite() || bSystemPlatformService instanceof BSystemPlatformServiceQnxTitan) {
bl3 = true;
}
this.ramDiskSizeFE.setReadonly(bl3);
this.javaHeapMinFreeFE.setReadonly(hxOp.canWrite() ^ true);
this.openFileDescriptorsMinFreeFE.setReadonly(hxOp.canWrite() ^ true);
this.freeRamMinFreeFE.setReadonly(hxOp.canWrite() ^ true);
this.diskSpaceMinFreeFE.setReadonly(hxOp.canWrite() ^ true);
this.minFileFreeFE.setReadonly(hxOp.canWrite() ^ true);
if (bSystemPlatformService instanceof BSystemPlatformServiceQnxLegacy) {
this.batteryPresentFE.setReadonly(hxOp.canWrite() ^ true);
}
if (bSystemPlatformService instanceof BSystemPlatformServiceQnxJavelina) {
this.tamperSwitchEnabledFE.setReadonly(hxOp.canWrite() ^ true);
}
}
htmlWriter.w((Object)"<input type='hidden' name='").w((Object)hxOp.scope("operatorCanWrite")).println("' value='" + hxOp.canWrite() + "'/>");
htmlWriter.w((Object)"<input type='hidden' name='").w((Object)hxOp.scope("systemRestart")).println("' value='false'/>");
htmlWriter.w((Object)"<input type='hidden' name='").w((Object)hxOp.scope("systemReboot")).println("' value='false'/>");
htmlWriter.w((Object)"<input type='hidden' name='").w((Object)hxOp.scope("restartEnabled")).w((Object)"' value='");
if (hxOp.canWrite() && bSystemPlatformService.getAllowStationRestart()) {
htmlWriter.w((Object)"true");
} else {
htmlWriter.w((Object)"false");
}
htmlWriter.println("'/>");
htmlWriter.w((Object)"<input type='hidden' name='").w((Object)hxOp.scope("isStationAutoSaveEnabled")).w((Object)"' value='");
htmlWriter.w(bSystemPlatformService.getIsStationAutoSaveEnabled()).println("'/>");
htmlWriter.w((Object)"<input type='hidden' name='").w((Object)hxOp.scope("tzReboot")).w((Object)"' value='");
if (bSystemPlatformService instanceof BSystemPlatformServiceQnx || bSystemPlatformService instanceof BSystemPlatformServiceNxs || bSystemPlatformService instanceof BSystemPlatformServiceNxtFlash) {
htmlWriter.w((Object)"true");
} else {
htmlWriter.w((Object)"false");
}
htmlWriter.println("'/>");
htmlWriter.println("<table cellpadding='5'>");
htmlWriter.w((Object)"<tr>");
htmlWriter.w((Object)"<td><b>").w((Object)LexiconText.make((Type)TYPE, (String)"labels.system.name").getText((Context)hxOp)).w((Object)"</b></td>");
htmlWriter.w((Object)"<td>");
htmlWriter.safe(bSystemPlatformService.getStationName());
htmlWriter.w((Object)"</td>");
htmlWriter.println("</tr>");
htmlWriter.w((Object)"<tr>");
htmlWriter.w((Object)"<td><b>").w((Object)LexiconText.make((Type)TYPE, (String)"labels.system.host").getText((Context)hxOp)).w((Object)"</b></td>");
htmlWriter.w((Object)"<td>");
htmlWriter.safe(BOrd.toHost((BObject)bSystemPlatformService).getNavDisplayName(null));
htmlWriter.w((Object)"</td>");
htmlWriter.println("</tr>");
htmlWriter.w((Object)"<tr>");
htmlWriter.w((Object)"<td><b>").w((Object)LexiconText.make((Type)TYPE, (String)"labels.system.model").getText((Context)hxOp)).w((Object)"</b></td>");
htmlWriter.w((Object)"<td>");
htmlWriter.safe(bSystemPlatformService.getModel());
htmlWriter.w((Object)"</td>");
htmlWriter.println("</tr>");
htmlWriter.w((Object)"<tr>");
htmlWriter.w((Object)"<td><b>").w((Object)LexiconText.make((Type)TYPE, (String)"labels.system.hostId").getText((Context)hxOp)).w((Object)"</b></td>");
htmlWriter.w((Object)"<td>");
htmlWriter.safe(bSystemPlatformService.getHostId());
htmlWriter.w((Object)"</td>");
htmlWriter.println("</tr>");
htmlWriter.w((Object)"<tr>");
htmlWriter.w((Object)"<td><b>").w((Object)LexiconText.make((Type)TYPE, (String)"labels.system.niagaraVersion").getText((Context)hxOp)).w((Object)"</b></td>");
htmlWriter.w((Object)"<td>");
htmlWriter.safe(bSystemPlatformService.getNiagaraVersion());
htmlWriter.w((Object)"</td>");
htmlWriter.println("</tr>");
htmlWriter.w((Object)"<tr>");
htmlWriter.w((Object)"<td><b>").w((Object)LexiconText.make((Type)TYPE, (String)"labels.system.javaVmName").getText((Context)hxOp)).w((Object)"</b></td>");
htmlWriter.w((Object)"<td>");
htmlWriter.safe(bSystemPlatformService.getJavaVmName());
htmlWriter.w((Object)"</td>");
htmlWriter.println("</tr>");
htmlWriter.w((Object)"<tr>");
htmlWriter.w((Object)"<td><b>").w((Object)LexiconText.make((Type)TYPE, (String)"labels.system.javaVmVendor").getText((Context)hxOp)).w((Object)"</b></td>");
htmlWriter.w((Object)"<td>");
htmlWriter.safe(bSystemPlatformService.getJavaVmVendor());
htmlWriter.w((Object)"</td>");
htmlWriter.println("</tr>");
htmlWriter.w((Object)"<tr>");
htmlWriter.w((Object)"<td><b>").w((Object)LexiconText.make((Type)TYPE, (String)"labels.system.javaVmVersion").getText((Context)hxOp)).w((Object)"</b></td>");
htmlWriter.w((Object)"<td>");
htmlWriter.safe(bSystemPlatformService.getJavaVmVersion());
htmlWriter.w((Object)"</td>");
htmlWriter.println("</tr>");
htmlWriter.w((Object)"<tr>");
htmlWriter.w((Object)"<td><b>").w((Object)LexiconText.make((Type)TYPE, (String)"labels.system.osName").getText((Context)hxOp)).w((Object)"</b></td>");
htmlWriter.w((Object)"<td>");
htmlWriter.safe(bSystemPlatformService.getOsName());
htmlWriter.w((Object)"</td>");
htmlWriter.println("</tr>");
htmlWriter.w((Object)"<tr>");
htmlWriter.w((Object)"<td><b>").w((Object)LexiconText.make((Type)TYPE, (String)"labels.system.osArch").getText((Context)hxOp)).w((Object)"</b></td>");
htmlWriter.w((Object)"<td>");
htmlWriter.safe(bSystemPlatformService.getOsArch());
htmlWriter.w((Object)"</td>");
htmlWriter.println("</tr>");
htmlWriter.w((Object)"<tr>");
htmlWriter.w((Object)"<td><b>").w((Object)LexiconText.make((Type)TYPE, (String)"labels.system.osVersion").getText((Context)hxOp)).w((Object)"</b></td>");
htmlWriter.w((Object)"<td>");
htmlWriter.safe(bSystemPlatformService.getOsVersion());
htmlWriter.w((Object)"</td>");
htmlWriter.println("</tr>");
htmlWriter.w((Object)"<tr>");
htmlWriter.w((Object)"<td><b>").w((Object)LexiconText.make((Type)TYPE, (String)"labels.system.daemonPort").getText((Context)hxOp)).w((Object)"</b></td>");
htmlWriter.w((Object)"<td>");
htmlWriter.safe(Integer.toString(bSystemPlatformService.getLocalDaemonPort()));
htmlWriter.w((Object)"</td>");
htmlWriter.println("</tr>");
htmlWriter.w((Object)"<tr>");
htmlWriter.w((Object)"<td><b>").w((Object)LexiconText.make((Type)TYPE, (String)"labels.system.locale").getText((Context)hxOp)).w((Object)"</b></td>");
htmlWriter.w((Object)"<td>");
this.localeFE.write((BObject)bSystemPlatformService.get(BSystemPlatformService.locale), hxOp);
htmlWriter.w((Object)"</td>");
htmlWriter.println("</tr>");
BTimeZone bTimeZone = bSystemPlatformService.getTimeZone();
BAbsTime bAbsTime = BAbsTime.make((long)bSystemPlatformService.getSystemTime().getMillis(), (BTimeZone)bTimeZone);
htmlWriter.w((Object)"<tr>");
htmlWriter.w((Object)"<td><b>").w((Object)LexiconText.make((Type)TYPE, (String)"labels.system.systemTime").getText((Context)hxOp)).w((Object)"</b></td>");
htmlWriter.w((Object)"<td>");
this.systemTimeFE.write((BObject)bAbsTime, hxOp);
htmlWriter.w((Object)("&nbsp;" + bTimeZone.getShortDisplayName(bAbsTime.inDaylightTime(), null)));
htmlWriter.w((Object)"</td>");
htmlWriter.println("</tr>");
htmlWriter.w((Object)"<tr>");
htmlWriter.w((Object)"<td><b>").w((Object)LexiconText.make((Type)TYPE, (String)"labels.system.systemTimeZone").getText((Context)hxOp)).w((Object)"</b></td>");
htmlWriter.w((Object)"<td>");
this.timeZoneFE.write((BObject)bTimeZone, hxOp);
htmlWriter.w((Object)"</td>");
htmlWriter.println("</tr>");
htmlWriter.w((Object)"<tr>");
htmlWriter.w((Object)"<td><b>").w((Object)LexiconText.make((Type)TYPE, (String)"labels.system.engineWatchdogPolicy").getText((Context)hxOp)).w((Object)"</b></td>");
htmlWriter.w((Object)"<td>");
this.engineWatchdogPolicyFE.write((BObject)bSystemPlatformService.get(BSystemPlatformService.engineWatchdogPolicy), hxOp);
htmlWriter.w((Object)"</td>");
htmlWriter.println("</tr>");
htmlWriter.w((Object)"<tr>");
htmlWriter.w((Object)"<td><b>").w((Object)LexiconText.make((Type)TYPE, (String)"labels.system.engineWatchdogTimeout").getText((Context)hxOp)).w((Object)"</b></td>");
htmlWriter.w((Object)"<td>");
this.engineWatchdogTimeoutFE.write((BObject)bSystemPlatformService.get(BSystemPlatformService.engineWatchdogTimeout), hxOp);
htmlWriter.w((Object)"</td>");
htmlWriter.println("</tr>");
htmlWriter.w((Object)"<tr>");
htmlWriter.w((Object)"<td><b>").w((Object)LexiconText.make((Type)TYPE, (String)"labels.system.isStationAutoSaveEnabled").getText((Context)hxOp)).w((Object)"</b></td>");
htmlWriter.w((Object)"<td>");
this.isStationAutoSaveEnabledFE.write((BObject)bSystemPlatformService.get(BSystemPlatformService.isStationAutoSaveEnabled), hxOp);
htmlWriter.w((Object)"</td>");
htmlWriter.println("</tr>");
htmlWriter.w((Object)"<tr>");
htmlWriter.w((Object)"<td><b>").w((Object)LexiconText.make((Type)TYPE, (String)"labels.system.stationAutoSaveFrequency").getText((Context)hxOp)).w((Object)"</b></td>");
htmlWriter.w((Object)"<td>");
this.stationAutoSaveFrequencyFE.write((BObject)bSystemPlatformService.get(BSystemPlatformService.stationAutoSaveFrequency), hxOp);
htmlWriter.w((Object)"</td>");
htmlWriter.println("</tr>");
htmlWriter.w((Object)"<tr>");
htmlWriter.w((Object)"<td><b>").w((Object)LexiconText.make((Type)TYPE, (String)"labels.system.stationSaveBackupCount").getText((Context)hxOp)).w((Object)"</b></td>");
htmlWriter.w((Object)"<td>");
this.stationSaveBackupCountFE.write((BObject)bSystemPlatformService.get(BSystemPlatformService.stationSaveBackupCount), hxOp);
htmlWriter.w((Object)"</td>");
htmlWriter.println("</tr>");
htmlWriter.w((Object)"<tr>");
htmlWriter.w((Object)"<td><b>").w((Object)LexiconText.make((Type)TYPE, (String)"labels.system.numCpus").getText((Context)hxOp)).w((Object)"</b></td>");
htmlWriter.w((Object)"<td>");
htmlWriter.w(bSystemPlatformService.getNumCpus());
htmlWriter.w((Object)"</td>");
htmlWriter.println("</tr>");
htmlWriter.w((Object)"<tr>");
htmlWriter.w((Object)"<td><b>").w((Object)LexiconText.make((Type)TYPE, (String)"labels.system.currentCpuUsage").getText((Context)hxOp)).w((Object)"</b></td>");
htmlWriter.w((Object)"<td>");
htmlWriter.w(bSystemPlatformService.getCurrentCpuUsage()).w((Object)"%");
htmlWriter.w((Object)"</td>");
htmlWriter.println("</tr>");
htmlWriter.w((Object)"<tr>");
htmlWriter.w((Object)"<td><b>").w((Object)LexiconText.make((Type)TYPE, (String)"labels.system.overallCpuUsage").getText((Context)hxOp)).w((Object)"</b></td>");
htmlWriter.w((Object)"<td>");
htmlWriter.w(bSystemPlatformService.getOverallCpuUsage()).w((Object)"%");
htmlWriter.w((Object)"</td>");
htmlWriter.println("</tr>");
htmlWriter.w((Object)"<tr>");
htmlWriter.w((Object)"<td><b>").w((Object)LexiconText.make((Type)TYPE, (String)"labels.system.filesystem").getText((Context)hxOp)).w((Object)"</b></td>");
htmlWriter.w((Object)"<td>");
htmlWriter.w((Object)"<table cellpadding='5'>");
htmlWriter.w((Object)"<tr>");
htmlWriter.w((Object)"<td></td>");
htmlWriter.w((Object)"<td align='center'><b>").w((Object)LexiconText.make((Type)TYPE, (String)"labels.system.totalKb").getText((Context)hxOp)).w((Object)"</b></td>");
htmlWriter.w((Object)"<td align='center'><b>").w((Object)LexiconText.make((Type)TYPE, (String)"labels.system.freeKb").getText((Context)hxOp)).w((Object)"</b></td>");
htmlWriter.w((Object)"<td align='center'><b>").w((Object)LexiconText.make((Type)TYPE, (String)"labels.system.blockSize").getText((Context)hxOp)).w((Object)"</b></td>");
if (bSystemPlatformService instanceof BSystemPlatformServiceQnx) {
htmlWriter.w((Object)"<td align='center'><b>").w((Object)LexiconText.make((Type)TYPE, (String)"labels.system.currentFileCount").getText((Context)hxOp)).w((Object)"</b></td>");
htmlWriter.w((Object)"<td align='center'><b>").w((Object)LexiconText.make((Type)TYPE, (String)"labels.system.maxFileCount").getText((Context)hxOp)).w((Object)"</b></td>");
}
htmlWriter.w((Object)"</tr>");
Object object2 = bSystemPlatformService.getFilesystemAttributes().loadSlots().getProperties();
while (object2.next()) {
object = object2.property();
BFilesystemAttributes bFilesystemAttributes = (BFilesystemAttributes)object2.get();
htmlWriter.w((Object)"<tr>");
htmlWriter.w((Object)"<td><b>").w((Object)SlotPath.unescape((String)object.getName())).w((Object)"</b></td>");
htmlWriter.w((Object)"<td align='right'>");
htmlWriter.w((Object)DaemonFileUtil.kbFormat.format(bFilesystemAttributes.getTotalSpace()));
htmlWriter.w((Object)"</td>");
htmlWriter.w((Object)"<td align='right'>");
htmlWriter.w((Object)DaemonFileUtil.kbFormat.format(bFilesystemAttributes.getFreeSpace()));
htmlWriter.w((Object)"</td>");
htmlWriter.w((Object)"<td align='right'>");
htmlWriter.w((Object)DaemonFileUtil.byteFormat.format(bFilesystemAttributes.getBlockSize()));
htmlWriter.w((Object)"</td>");
if (bSystemPlatformService instanceof BSystemPlatformServiceQnx) {
String string = bFilesystemAttributes.getCurrentFileCount() < 0L ? this.getLexicon().getText("labels.system.fileCount.unavailable") : String.valueOf(bFilesystemAttributes.getCurrentFileCount());
String string2 = bFilesystemAttributes.getMaxFileCount() < 0L ? this.getLexicon().getText("labels.system.fileCount.unavailable") : String.valueOf(bFilesystemAttributes.getMaxFileCount());
htmlWriter.w((Object)"<td align='right'>");
htmlWriter.w((Object)string);
htmlWriter.w((Object)"</td>");
htmlWriter.w((Object)"<td align='right'>");
htmlWriter.w((Object)string2);
htmlWriter.w((Object)"</td>");
}
htmlWriter.w((Object)"</tr>");
}
htmlWriter.w((Object)"</table>");
htmlWriter.w((Object)"</td>");
htmlWriter.println("</tr>");
htmlWriter.w((Object)"<tr>");
htmlWriter.w((Object)"<td><b>").w((Object)LexiconText.make((Type)TYPE, (String)"labels.system.physicalMemory").getText((Context)hxOp)).w((Object)"</b></td>");
htmlWriter.w((Object)"<td>");
htmlWriter.w((Object)"<table cellpadding='5'>");
htmlWriter.w((Object)"<tr>");
htmlWriter.w((Object)"<td align='center'><b>").w((Object)LexiconText.make((Type)TYPE, (String)"labels.system.totalKb").getText((Context)hxOp)).w((Object)"</b></td>");
htmlWriter.w((Object)"<td align='center'><b>").w((Object)LexiconText.make((Type)TYPE, (String)"labels.system.freeKb").getText((Context)hxOp)).w((Object)"</b></td>");
htmlWriter.w((Object)"</tr>");
htmlWriter.w((Object)"<tr>");
htmlWriter.w((Object)"<td>").w((Object)DaemonFileUtil.kbFormat.format(bSystemPlatformService.getTotalPhysicalMemory())).w((Object)"</td>");
htmlWriter.w((Object)"<td>").w((Object)DaemonFileUtil.kbFormat.format(bSystemPlatformService.getFreePhysicalMemory())).w((Object)"</td>");
htmlWriter.w((Object)"</tr>");
htmlWriter.w((Object)"</table>");
htmlWriter.w((Object)"</td>");
htmlWriter.println("</tr>");
if (bSystemPlatformService instanceof BSystemPlatformServiceQnx) {
object2 = (BSystemPlatformServiceQnx)bSystemPlatformService;
object = null;
if (object2 instanceof BSystemPlatformServiceQnxLegacy) {
object = (BSystemPlatformServiceQnxLegacy)bSystemPlatformService;
}
htmlWriter.w((Object)"<tr>");
htmlWriter.w((Object)"<td><b>").w((Object)LexiconText.make((Type)TYPE, (String)"labels.system.qnx.serialNumber").getText((Context)hxOp)).w((Object)"</b></td>");
htmlWriter.w((Object)"<td>");
htmlWriter.w((Object)String.valueOf(((BSystemPlatformServiceQnx)object2).getSerialNumber()));
htmlWriter.w((Object)"</td>");
htmlWriter.println("</tr>");
htmlWriter.w((Object)"<tr>");
htmlWriter.w((Object)"<td><b>").w((Object)LexiconText.make((Type)TYPE, (String)"labels.system.qnx.hardwareRevision").getText((Context)hxOp)).w((Object)"</b></td>");
htmlWriter.w((Object)"<td>");
htmlWriter.w((Object)String.valueOf(((BSystemPlatformServiceQnx)object2).getHardwareRevision()));
htmlWriter.w((Object)"</td>");
htmlWriter.println("</tr>");
if (object != null) {
htmlWriter.w((Object)"<tr>");
htmlWriter.w((Object)"<td><b>").w((Object)LexiconText.make((Type)TYPE, (String)"labels.system.qnx.isJumperPresent").getText((Context)hxOp)).w((Object)"</b></td>");
htmlWriter.w((Object)"<td>");
htmlWriter.w((Object)String.valueOf(((BSystemPlatformServiceQnxLegacy)object).getIsJumperPresent()));
htmlWriter.w((Object)"</td>");
htmlWriter.println("</tr>");
htmlWriter.w((Object)"<tr>");
htmlWriter.w((Object)"<td><b>").w((Object)LexiconText.make((Type)TYPE, (String)"labels.system.qnx.isBatteryPresent").getText((Context)hxOp)).w((Object)"</b></td>");
htmlWriter.w((Object)"<td>");
this.batteryPresentFE.write((BObject)bSystemPlatformService.get(BSystemPlatformServiceQnxLegacy.isBatteryPresent), hxOp);
htmlWriter.w((Object)"</td>");
htmlWriter.println("</tr>");
}
htmlWriter.w((Object)"<tr>");
htmlWriter.w((Object)"<td><b>").w((Object)LexiconText.make((Type)TYPE, (String)"labels.system.failureRebootLimit").getText((Context)hxOp)).w((Object)"</b></td>");
htmlWriter.w((Object)"<td>");
this.failureRebootLimitFE.write((BObject)object2.get(BSystemPlatformServiceQnx.failureRebootLimit), hxOp);
htmlWriter.w((Object)"</td>");
htmlWriter.println("</tr>");
htmlWriter.w((Object)"<tr>");
htmlWriter.w((Object)"<td><b>").w((Object)LexiconText.make((Type)TYPE, (String)"labels.system.failureRebootLimitPeriod").getText((Context)hxOp)).w((Object)"</b></td>");
htmlWriter.w((Object)"<td>");
this.failureRebootLimitPeriodFE.write((BObject)object2.get(BSystemPlatformServiceQnx.failureRebootLimitPeriod), hxOp);
htmlWriter.w((Object)"</td>");
htmlWriter.println("</tr>");
htmlWriter.w((Object)"<table>");
htmlWriter.w((Object)"<tr>");
htmlWriter.w((Object)"<td width='206'><b>").w((Object)LexiconText.make((Type)TYPE, (String)"labels.system.qnx.ramDisk").getText((Context)hxOp)).w((Object)"</b></td>");
htmlWriter.w((Object)"<td>");
htmlWriter.w((Object)"<table cellpadding='5'>");
htmlWriter.w((Object)"<tr>");
htmlWriter.w((Object)"<td><b>").w((Object)LexiconText.make((Type)TYPE, (String)"labels.system.qnx.minFree").getText((Context)hxOp)).w((Object)"</b></td>");
htmlWriter.w((Object)"</tr>");
htmlWriter.w((Object)"<tr>");
htmlWriter.w((Object)"<td>");
this.ramDiskMinFreeFE.write((BObject)object2.get(BSystemPlatformServiceQnx.minFreeRamDiskPercentage), hxOp);
htmlWriter.w((Object)"</td>");
htmlWriter.w((Object)"</tr>");
htmlWriter.w((Object)"</table>");
htmlWriter.w((Object)"</td>");
htmlWriter.w((Object)"<td>");
htmlWriter.w((Object)"<table cellpadding='5'>");
htmlWriter.w((Object)"<tr>");
htmlWriter.w((Object)"<td><b>").w((Object)LexiconText.make((Type)TYPE, (String)"labels.system.qnx.size").getText((Context)hxOp)).w((Object)"</b></td>");
htmlWriter.w((Object)"</tr>");
htmlWriter.w((Object)"<tr>");
htmlWriter.w((Object)"<td>");
this.ramDiskSizeFE.write((BObject)BString.make((String)String.valueOf(((BInteger)object2.get(BSystemPlatformServiceQnx.ramDiskSize)).getInt())), hxOp);
htmlWriter.w((Object)"&nbsp;").w((Object)LexiconText.make((Type)TYPE, (String)"labels.system.qnx.ramDiskSizeUnits").getText((Context)hxOp));
htmlWriter.w((Object)"</td>");
htmlWriter.w((Object)"</tr>");
htmlWriter.w((Object)"</table>");
htmlWriter.w((Object)"</td>");
htmlWriter.w((Object)"<td>");
htmlWriter.w((Object)"</td>");
htmlWriter.w((Object)"<td>");
htmlWriter.w((Object)"<table cellpadding='5'>");
htmlWriter.w((Object)"<tr>");
htmlWriter.w((Object)"<td><b>").w((Object)LexiconText.make((Type)TYPE, (String)"labels.system.qnx.status").getText((Context)hxOp)).w((Object)"</b></td>");
htmlWriter.w((Object)"</tr>");
htmlWriter.w((Object)"<tr>");
if (((BSystemPlatformServiceQnx)object2).getLowRamDiskSpace()) {
htmlWriter.w((Object)"<td>").w((Object)LexiconText.make((Type)TYPE, (String)"labels.system.qnx.lowRamDiskSpace").getText((Context)hxOp)).w((Object)"</td>");
} else {
htmlWriter.w((Object)"<td>").w((Object)LexiconText.make((Type)TYPE, (String)"labels.system.qnx.ok").getText((Context)hxOp)).w((Object)"</td>");
}
htmlWriter.w((Object)"</tr>");
htmlWriter.w((Object)"</table>");
htmlWriter.w((Object)"</td>");
htmlWriter.w((Object)"</tr>");
htmlWriter.w((Object)"<tr>");
htmlWriter.w((Object)"<td><b>").w((Object)LexiconText.make((Type)TYPE, (String)"labels.system.qnx.javaHeap").getText((Context)hxOp)).w((Object)"</b></td>");
htmlWriter.w((Object)"<td>");
htmlWriter.w((Object)"<table cellpadding='5'>");
htmlWriter.w((Object)"<tr>");
htmlWriter.w((Object)"<td><b>").w((Object)LexiconText.make((Type)TYPE, (String)"labels.system.qnx.minFree").getText((Context)hxOp)).w((Object)"</b></td>");
htmlWriter.w((Object)"</tr>");
htmlWriter.w((Object)"<tr>");
htmlWriter.w((Object)"<td>");
this.javaHeapMinFreeFE.write((BObject)object2.get(BSystemPlatformServiceQnx.minFreeHeap), hxOp);
htmlWriter.w((Object)"&nbsp;").w((Object)LexiconText.make((Type)TYPE, (String)"labels.system.qnx.freeHeapUnits").getText((Context)hxOp));
htmlWriter.w((Object)"</td>");
htmlWriter.w((Object)"</tr>");
htmlWriter.w((Object)"</table>");
htmlWriter.w((Object)"</td>");
htmlWriter.w((Object)"<td>");
htmlWriter.w((Object)"<table cellpadding='5'>");
htmlWriter.w((Object)"<tr>");
htmlWriter.w((Object)"<td><b>").w((Object)LexiconText.make((Type)TYPE, (String)"labels.system.qnx.max").getText((Context)hxOp)).w((Object)"</b></td>");
htmlWriter.w((Object)"</tr>");
htmlWriter.w((Object)"<tr>");
htmlWriter.w((Object)"<td>").w(((BSystemPlatformServiceQnx)object2).getMaxHeap()).w((Object)"&nbsp;").w((Object)LexiconText.make((Type)TYPE, (String)"labels.system.qnx.freeHeapUnits").getText((Context)hxOp)).w((Object)"</td>");
htmlWriter.w((Object)"</tr>");
htmlWriter.w((Object)"</table>");
htmlWriter.w((Object)"</td>");
htmlWriter.w((Object)"<td>");
htmlWriter.w((Object)"<table cellpadding='5'>");
htmlWriter.w((Object)"<tr>");
htmlWriter.w((Object)"<td><b>").w((Object)LexiconText.make((Type)TYPE, (String)"labels.system.qnx.free").getText((Context)hxOp)).w((Object)"</b></td>");
htmlWriter.w((Object)"</tr>");
htmlWriter.w((Object)"<tr>");
htmlWriter.w((Object)"<td>").w(((BSystemPlatformServiceQnx)object2).getFreeHeap()).w((Object)"&nbsp;").w((Object)LexiconText.make((Type)TYPE, (String)"labels.system.qnx.freeHeapUnits").getText((Context)hxOp)).w((Object)"</td>");
htmlWriter.w((Object)"</tr>");
htmlWriter.w((Object)"</table>");
htmlWriter.w((Object)"</td>");
htmlWriter.w((Object)"<td>");
htmlWriter.w((Object)"<table cellpadding='5'>");
htmlWriter.w((Object)"<tr>");
htmlWriter.w((Object)"<td><b>").w((Object)LexiconText.make((Type)TYPE, (String)"labels.system.qnx.status").getText((Context)hxOp)).w((Object)"</b></td>");
htmlWriter.w((Object)"</tr>");
htmlWriter.w((Object)"<tr>");
if (((BSystemPlatformServiceQnx)object2).getLowHeap()) {
htmlWriter.w((Object)"<td>").w((Object)LexiconText.make((Type)TYPE, (String)"labels.system.qnx.lowHeap").getText((Context)hxOp)).w((Object)"</td>");
} else {
htmlWriter.w((Object)"<td>").w((Object)LexiconText.make((Type)TYPE, (String)"labels.system.qnx.ok").getText((Context)hxOp)).w((Object)"</td>");
}
htmlWriter.w((Object)"</tr>");
htmlWriter.w((Object)"</table>");
htmlWriter.w((Object)"</td>");
htmlWriter.w((Object)"</tr>");
htmlWriter.w((Object)"<tr>");
htmlWriter.w((Object)"<td><b>").w((Object)LexiconText.make((Type)TYPE, (String)"labels.system.qnx.fileDescriptors").getText((Context)hxOp)).w((Object)"</b></td>");
htmlWriter.w((Object)"<td>");
htmlWriter.w((Object)"<table cellpadding='5'>");
htmlWriter.w((Object)"<tr>");
htmlWriter.w((Object)"<td><b>").w((Object)LexiconText.make((Type)TYPE, (String)"labels.system.qnx.minFree").getText((Context)hxOp)).w((Object)"</b></td>");
htmlWriter.w((Object)"</tr>");
htmlWriter.w((Object)"<tr>");
htmlWriter.w((Object)"<td>");
this.openFileDescriptorsMinFreeFE.write((BObject)object2.get(BSystemPlatformServiceQnx.minFreeFileDescriptors), hxOp);
htmlWriter.w((Object)"</td>");
htmlWriter.w((Object)"</tr>");
htmlWriter.w((Object)"</table>");
htmlWriter.w((Object)"</td>");
htmlWriter.w((Object)"<td>");
htmlWriter.w((Object)"<table cellpadding='5'>");
htmlWriter.w((Object)"<tr>");
htmlWriter.w((Object)"<td><b>").w((Object)LexiconText.make((Type)TYPE, (String)"labels.system.qnx.maxOpen").getText((Context)hxOp)).w((Object)"</b></td>");
htmlWriter.w((Object)"</tr>");
htmlWriter.w((Object)"<tr>");
htmlWriter.w((Object)"<td>").w(((BSystemPlatformServiceQnx)object2).getMaxOpenFileDescriptors()).w((Object)"</td>");
htmlWriter.w((Object)"</tr>");
htmlWriter.w((Object)"</table>");
htmlWriter.w((Object)"</td>");
htmlWriter.w((Object)"<td>");
htmlWriter.w((Object)"<table cellpadding='5'>");
htmlWriter.w((Object)"<tr>");
htmlWriter.w((Object)"<td><b>").w((Object)LexiconText.make((Type)TYPE, (String)"labels.system.qnx.free").getText((Context)hxOp)).w((Object)"</b></td>");
htmlWriter.w((Object)"</tr>");
htmlWriter.w((Object)"<tr>");
htmlWriter.w((Object)"<td>").w(((BSystemPlatformServiceQnx)object2).getMaxOpenFileDescriptors() - ((BSystemPlatformServiceQnx)object2).getOpenFileDescriptors()).w((Object)"</td>");
htmlWriter.w((Object)"</tr>");
htmlWriter.w((Object)"</table>");
htmlWriter.w((Object)"</td>");
htmlWriter.w((Object)"<td>");
htmlWriter.w((Object)"<table cellpadding='5'>");
htmlWriter.w((Object)"<tr>");
htmlWriter.w((Object)"<td><b>").w((Object)LexiconText.make((Type)TYPE, (String)"labels.system.qnx.status").getText((Context)hxOp)).w((Object)"</b></td>");
htmlWriter.w((Object)"</tr>");
htmlWriter.w((Object)"<tr>");
if (((BSystemPlatformServiceQnx)object2).getTooManyOpenFiles()) {
htmlWriter.w((Object)"<td>").w((Object)LexiconText.make((Type)TYPE, (String)"labels.system.qnx.tooManyOpenFiles").getText((Context)hxOp)).w((Object)"</td>");
} else {
htmlWriter.w((Object)"<td>").w((Object)LexiconText.make((Type)TYPE, (String)"labels.system.qnx.ok").getText((Context)hxOp)).w((Object)"</td>");
}
htmlWriter.w((Object)"</tr>");
htmlWriter.w((Object)"</table>");
htmlWriter.w((Object)"</td>");
htmlWriter.w((Object)"</tr>");
htmlWriter.w((Object)"<tr>");
htmlWriter.w((Object)"<td><b>").w((Object)LexiconText.make((Type)TYPE, (String)"labels.system.qnx.physMemoryLimits").getText((Context)hxOp)).w((Object)"</b></td>");
htmlWriter.w((Object)"<td>");
htmlWriter.w((Object)"<table cellpadding='5'>");
htmlWriter.w((Object)"<tr>");
htmlWriter.w((Object)"<td><b>").w((Object)LexiconText.make((Type)TYPE, (String)"labels.system.qnx.minFree").getText((Context)hxOp)).w((Object)"</b></td>");
htmlWriter.w((Object)"</tr>");
htmlWriter.w((Object)"<tr>");
htmlWriter.w((Object)"<td>");
this.freeRamMinFreeFE.write((BObject)object2.get(BSystemPlatformServiceQnx.minFreePhysicalMemory), hxOp);
htmlWriter.w((Object)"&nbsp;").w((Object)LexiconText.make((Type)TYPE, (String)"labels.system.qnx.freePhysUnits").getText((Context)hxOp));
htmlWriter.w((Object)"</td>");
htmlWriter.w((Object)"</tr>");
htmlWriter.w((Object)"</table>");
htmlWriter.w((Object)"</td>");
htmlWriter.w((Object)"<td>");
htmlWriter.w((Object)"</td>");
htmlWriter.w((Object)"<td>");
htmlWriter.w((Object)"</td>");
htmlWriter.w((Object)"<td>");
htmlWriter.w((Object)"<table cellpadding='5'>");
htmlWriter.w((Object)"<tr>");
htmlWriter.w((Object)"<td><b>").w((Object)LexiconText.make((Type)TYPE, (String)"labels.system.qnx.status").getText((Context)hxOp)).w((Object)"</b></td>");
htmlWriter.w((Object)"</tr>");
htmlWriter.w((Object)"<tr>");
if (((BSystemPlatformServiceQnx)object2).getLowMemory()) {
htmlWriter.w((Object)"<td>").w((Object)LexiconText.make((Type)TYPE, (String)"labels.system.qnx.lowMemory").getText((Context)hxOp)).w((Object)"</td>");
} else {
htmlWriter.w((Object)"<td>").w((Object)LexiconText.make((Type)TYPE, (String)"labels.system.qnx.ok").getText((Context)hxOp)).w((Object)"</td>");
}
htmlWriter.w((Object)"</tr>");
htmlWriter.w((Object)"</table>");
htmlWriter.w((Object)"</td>");
htmlWriter.w((Object)"</tr>");
htmlWriter.w((Object)"<tr>");
htmlWriter.w((Object)"<td><b> ").w((Object)LexiconText.make((Type)TYPE, (String)"labels.system.qnx.diskSpace").getText((Context)hxOp)).w((Object)"</b></td>");
htmlWriter.w((Object)"<td>");
htmlWriter.w((Object)"<table cellpadding='5'>");
htmlWriter.w((Object)"<tr>");
htmlWriter.w((Object)"<td><b>").w((Object)LexiconText.make((Type)TYPE, (String)"labels.system.qnx.minFree").getText((Context)hxOp)).w((Object)"</b></td>");
htmlWriter.w((Object)"</tr>");
htmlWriter.w((Object)"<tr>");
htmlWriter.w((Object)"<td>");
this.diskSpaceMinFreeFE.write((BObject)object2.get(BSystemPlatformServiceQnx.minFreeDiskPercentage), hxOp);
htmlWriter.w((Object)"</td>");
htmlWriter.w((Object)"</tr>");
htmlWriter.w((Object)"</table>");
htmlWriter.w((Object)"</td>");
htmlWriter.w((Object)"<td>");
htmlWriter.w((Object)"</td>");
htmlWriter.w((Object)"<td>");
htmlWriter.w((Object)"</td>");
htmlWriter.w((Object)"<td>");
htmlWriter.w((Object)"<table cellpadding='5'>");
htmlWriter.w((Object)"<tr>");
htmlWriter.w((Object)"<td><b>").w((Object)LexiconText.make((Type)TYPE, (String)"labels.system.qnx.status").getText((Context)hxOp)).w((Object)"</b></td>");
htmlWriter.w((Object)"</tr>");
htmlWriter.w((Object)"<tr>");
if (((BSystemPlatformServiceQnx)object2).getLowDiskSpace()) {
htmlWriter.w((Object)"<td>").w((Object)LexiconText.make((Type)TYPE, (String)"labels.system.qnx.lowDiskSpace").getText((Context)hxOp)).w((Object)"</td>");
} else {
htmlWriter.w((Object)"<td>").w((Object)LexiconText.make((Type)TYPE, (String)"labels.system.qnx.ok").getText((Context)hxOp)).w((Object)"</td>");
}
htmlWriter.w((Object)"</tr>");
htmlWriter.w((Object)"</table>");
htmlWriter.w((Object)"</td>");
htmlWriter.w((Object)"</tr>");
htmlWriter.w((Object)"<tr>");
htmlWriter.w((Object)"<td><b> ").w((Object)LexiconText.make((Type)TYPE, (String)"labels.system.currentFileCount").getText((Context)hxOp)).w((Object)"</b></td>");
htmlWriter.w((Object)"<td>");
htmlWriter.w((Object)"<table cellpadding='5'>");
htmlWriter.w((Object)"<tr>");
htmlWriter.w((Object)"<td><b>").w((Object)LexiconText.make((Type)TYPE, (String)"labels.system.qnx.minFree").getText((Context)hxOp)).w((Object)"</b></td>");
htmlWriter.w((Object)"</tr>");
htmlWriter.w((Object)"<tr>");
htmlWriter.w((Object)"<td>");
this.minFileFreeFE.write((BObject)object2.get(BSystemPlatformServiceQnx.minAvailableFiles), hxOp);
htmlWriter.w((Object)"</td>");
htmlWriter.w((Object)"</tr>");
htmlWriter.w((Object)"</table>");
htmlWriter.w((Object)"</td>");
htmlWriter.w((Object)"<td>");
htmlWriter.w((Object)"</td>");
htmlWriter.w((Object)"<td>");
htmlWriter.w((Object)"</td>");
htmlWriter.w((Object)"<td>");
htmlWriter.w((Object)"<table cellpadding='5'>");
htmlWriter.w((Object)"<tr>");
htmlWriter.w((Object)"<td><b>").w((Object)LexiconText.make((Type)TYPE, (String)"labels.system.qnx.status").getText((Context)hxOp)).w((Object)"</b></td>");
htmlWriter.w((Object)"</tr>");
htmlWriter.w((Object)"<tr>");
if (((BSystemPlatformServiceQnx)object2).getLowAvailableFiles()) {
htmlWriter.w((Object)"<td>").w((Object)LexiconText.make((Type)TYPE, (String)"labels.system.qnx.lowFilesAvailable").getText((Context)hxOp)).w((Object)"</td>");
} else {
htmlWriter.w((Object)"<td>").w((Object)LexiconText.make((Type)TYPE, (String)"labels.system.qnx.ok").getText((Context)hxOp)).w((Object)"</td>");
}
htmlWriter.w((Object)"</tr>");
htmlWriter.w((Object)"</table>");
htmlWriter.w((Object)"</td>");
htmlWriter.w((Object)"</tr>");
htmlWriter.println("</table>");
if (bSystemPlatformService instanceof BSystemPlatformServiceQnxJavelina) {
htmlWriter.println("</table>");
htmlWriter.println("<table cellpadding='5'>");
htmlWriter.w((Object)"<tr>");
htmlWriter.w((Object)"<td width='201'><b>").w((Object)LexiconText.make((Type)TYPE, (String)"labels.system.qnx.tamperEnabled").getText((Context)hxOp)).w((Object)"</b></td>");
htmlWriter.w((Object)"<td>");
this.tamperSwitchEnabledFE.write((BObject)bSystemPlatformService.get(BSystemPlatformServiceQnxJavelina.tamperSwitchEnabled), hxOp);
htmlWriter.w((Object)"</td>");
htmlWriter.println("</tr>");
htmlWriter.w((Object)"<tr>");
htmlWriter.w((Object)"<td><b>").w((Object)LexiconText.make((Type)TYPE, (String)"labels.system.qnx.tamperSwitchOk").getText((Context)hxOp)).w((Object)"</b></td>");
htmlWriter.w((Object)"<td>");
htmlWriter.w((Object)String.valueOf(((BBoolean)bSystemPlatformService.get(BSystemPlatformServiceQnxJavelina.tamperSwitchOk)).getBoolean()));
htmlWriter.w((Object)"</td>");
htmlWriter.println("</tr>");
}
} else if (bSystemPlatformService instanceof BSystemPlatformServiceNxs || bSystemPlatformService instanceof BSystemPlatformServiceNxtFlash) {
object2 = (BSystemPlatformServiceNxs)bSystemPlatformService;
htmlWriter.w((Object)"<tr>");
htmlWriter.w((Object)"<td><b>").w((Object)LexiconText.make((Type)TYPE, (String)"labels.system.nxs.overlays").getText((Context)hxOp)).w((Object)"</b></td>");
htmlWriter.w((Object)"<td>");
htmlWriter.w((Object)"<table cellpadding='5'>");
htmlWriter.w((Object)"<tr>");
htmlWriter.w((Object)"<td></td>");
htmlWriter.w((Object)"<td align='center'><b>").w((Object)LexiconText.make((Type)TYPE, (String)"labels.system.nxs.overlayState").getText((Context)hxOp)).w((Object)"</b></td>");
htmlWriter.w((Object)"<td align='center'><b>").w((Object)LexiconText.make((Type)TYPE, (String)"labels.system.nxs.overlayCommand").getText((Context)hxOp)).w((Object)"</b></td>");
htmlWriter.w((Object)"<td align='center'><b>").w((Object)LexiconText.make((Type)TYPE, (String)"labels.system.nxs.overlayRamUsage").getText((Context)hxOp)).w((Object)"</b></td>");
htmlWriter.w((Object)"</tr>");
htmlWriter.w((Object)"<tr>");
htmlWriter.w((Object)"<td><b>").w((Object)LexiconText.make((Type)TYPE, (String)"labels.system.nxs.osOverlay").getText((Context)hxOp)).w((Object)"</b></td>");
htmlWriter.w((Object)"<td align='right'>");
htmlWriter.w((Object)((BSystemPlatformServiceNxs)object2).getOsOverlayState().toString((Context)hxOp));
htmlWriter.w((Object)"</td>");
htmlWriter.w((Object)"<td align='right'>");
htmlWriter.w((Object)((BSystemPlatformServiceNxs)object2).getOsOverlayCommand().toString((Context)hxOp));
htmlWriter.w((Object)"</td>");
htmlWriter.w((Object)"<td align='right'>");
htmlWriter.w((Object)mbFormat.format(((BSystemPlatformServiceNxs)object2).getOsOverlayRamUsage()));
htmlWriter.w((Object)"</td>");
htmlWriter.w((Object)"</tr>");
htmlWriter.w((Object)"<tr>");
htmlWriter.w((Object)"<td><b>").w((Object)LexiconText.make((Type)TYPE, (String)"labels.system.nxs.historyOverlay").getText((Context)hxOp)).w((Object)"</b></td>");
htmlWriter.w((Object)"<td align='right'>");
htmlWriter.w((Object)((BSystemPlatformServiceNxs)object2).getHistoryOverlayState().toString((Context)hxOp));
htmlWriter.w((Object)"</td>");
htmlWriter.w((Object)"<td align='right'>");
htmlWriter.w((Object)((BSystemPlatformServiceNxs)object2).getHistoryOverlayCommand().toString((Context)hxOp));
htmlWriter.w((Object)"</td>");
htmlWriter.w((Object)"<td align='right'>");
htmlWriter.w((Object)mbFormat.format(((BSystemPlatformServiceNxs)object2).getHistoryOverlayRamUsage()));
htmlWriter.w((Object)"</td>");
htmlWriter.w((Object)"</tr>");
htmlWriter.w((Object)"</table>");
htmlWriter.w((Object)"</td>");
htmlWriter.println("</tr>");
}
object2 = bSystemPlatformService.getFipsStatus();
if (object2 != null && !((String)object2).equals("")) {
htmlWriter.w((Object)"<tr>");
htmlWriter.w((Object)"<td><b>").w((Object)LexiconText.make((Type)TYPE, (String)"labels.system.fipsStatus").getText((Context)hxOp)).w((Object)"</b></td>");
htmlWriter.w((Object)"<td>");
htmlWriter.w(object2);
htmlWriter.w((Object)"</td>");
htmlWriter.println("</tr>");
}
htmlWriter.println("</table>");
htmlWriter.println("<div style='padding:10px; text-align:center;'>");
this.refreshButton.write(hxOp);
if (hxOp.canWrite()) {
object = new HashMap();
if (bSystemPlatformService.getLocalDaemonAccess() != BDaemonAccessLevel.restricted) {
object.put("onclick", "onSystemPlatformServiceSave(\"" + hxOp.scope("submit") + "\",\"" + this.getLexicon().getText("SystemPlatformServicePlugin.restartRequired.hxConfirmMessage") + "\",\"" + this.getLexicon().getText("SystemPlatformServicePlugin.rebootRequired.hxConfirmMessage") + "\")");
} else {
object.put("onclick", "onSystemPlatformServiceSave(\"" + hxOp.scope("submit") + "\",\"" + this.getLexicon().getText("SystemPlatformServicePlugin.restartWillBeRequired.hxConfirmMessage") + "\",\"" + this.getLexicon().getText("SystemPlatformServicePlugin.rebootWillBeRequired.hxConfirmMessage") + "\")");
}
this.saveButton.write(hxOp, (Map)object);
}
htmlWriter.println("</div>");
object = "executeOnload(\"" + hxOp.getPath() + "\");";
hxOp.addOnload((String)object);
}
public BObject save(HxOp hxOp) throws Exception {
BSystemPlatformService bSystemPlatformService = this.getSystemPlatformService(hxOp);
BTimeZone bTimeZone = (BTimeZone)this.timeZoneFE.save((BObject)bSystemPlatformService.getTimeZone(), hxOp);
BAbsTime bAbsTime = (BAbsTime)this.systemTimeFE.save((BObject)bSystemPlatformService.getSystemTime(), hxOp);
bAbsTime = BAbsTime.make((int)bAbsTime.getYear(), (BMonth)bAbsTime.getMonth(), (int)bAbsTime.getDay(), (int)bAbsTime.getHour(), (int)bAbsTime.getMinute(), (int)0, (int)0, (BTimeZone)bTimeZone);
if (bSystemPlatformService.getLocalDaemonAccess() != BDaemonAccessLevel.restricted) {
bSystemPlatformService.setSystemTime(bAbsTime);
}
bSystemPlatformService.setLocale(this.localeFE.save((BObject)bSystemPlatformService.get(BSystemPlatformService.locale), hxOp).toString());
bSystemPlatformService.setTimeZone(bTimeZone);
bSystemPlatformService.setEngineWatchdogPolicy((BEngineWatchdogPolicy)this.engineWatchdogPolicyFE.save((BObject)bSystemPlatformService.getEngineWatchdogPolicy(), hxOp));
bSystemPlatformService.setEngineWatchdogTimeout((BRelTime)this.engineWatchdogTimeoutFE.save((BObject)bSystemPlatformService.getEngineWatchdogTimeout(), hxOp));
bSystemPlatformService.setIsStationAutoSaveEnabled(((BBoolean)this.isStationAutoSaveEnabledFE.save((BObject)bSystemPlatformService.get(BSystemPlatformService.isStationAutoSaveEnabled), hxOp)).getBoolean());
if (bSystemPlatformService.getIsStationAutoSaveEnabled()) {
bSystemPlatformService.setStationAutoSaveFrequency((BRelTime)this.stationAutoSaveFrequencyFE.save((BObject)bSystemPlatformService.getStationAutoSaveFrequency(), hxOp));
bSystemPlatformService.setStationSaveBackupCount(((BInteger)this.stationSaveBackupCountFE.save((BObject)bSystemPlatformService.get(BSystemPlatformService.stationSaveBackupCount), hxOp)).getInt());
}
if (bSystemPlatformService instanceof BSystemPlatformServiceQnx) {
BSystemPlatformServiceQnxLegacy bSystemPlatformServiceQnxLegacy;
BSystemPlatformServiceQnx bSystemPlatformServiceQnx = (BSystemPlatformServiceQnx)bSystemPlatformService;
bSystemPlatformServiceQnx.setFailureRebootLimit(((BInteger)this.failureRebootLimitFE.save((BObject)BInteger.make((int)bSystemPlatformServiceQnx.getFailureRebootLimit()), hxOp)).getInt());
bSystemPlatformServiceQnx.setFailureRebootLimitPeriod((BRelTime)this.failureRebootLimitPeriodFE.save((BObject)bSystemPlatformServiceQnx.getFailureRebootLimitPeriod(), hxOp));
bSystemPlatformServiceQnx.setMinFreeRamDiskPercentage(((BInteger)this.ramDiskMinFreeFE.save((BObject)BInteger.make((int)bSystemPlatformServiceQnx.getMinFreeRamDiskPercentage()), hxOp)).getInt());
if (bSystemPlatformService instanceof BSystemPlatformServiceQnxLegacy) {
bSystemPlatformServiceQnxLegacy = (BSystemPlatformServiceQnxLegacy)bSystemPlatformService;
bSystemPlatformServiceQnxLegacy.setIsBatteryPresent(((BBoolean)this.batteryPresentFE.save((BObject)bSystemPlatformService.get(BSystemPlatformServiceQnxLegacy.isBatteryPresent), hxOp)).getBoolean());
}
if (!(bSystemPlatformService instanceof BSystemPlatformServiceQnxTitan)) {
bSystemPlatformServiceQnx.setRamDiskSize(Integer.valueOf(((BString)this.ramDiskSizeFE.save((BObject)BString.make((String)String.valueOf(bSystemPlatformServiceQnx.getRamDiskSize())), hxOp)).getString()));
}
bSystemPlatformServiceQnx.setMinFreeHeap(((BInteger)this.javaHeapMinFreeFE.save((BObject)BInteger.make((int)bSystemPlatformServiceQnx.getMinFreeHeap()), hxOp)).getInt());
bSystemPlatformServiceQnx.setMinFreeFileDescriptors(((BInteger)this.openFileDescriptorsMinFreeFE.save((BObject)BInteger.make((int)bSystemPlatformServiceQnx.getMinFreeFileDescriptors()), hxOp)).getInt());
bSystemPlatformServiceQnx.setMinFreePhysicalMemory(((BInteger)this.freeRamMinFreeFE.save((BObject)BInteger.make((int)bSystemPlatformServiceQnx.getMinFreePhysicalMemory()), hxOp)).getInt());
bSystemPlatformServiceQnx.setMinFreeDiskPercentage(((BInteger)this.diskSpaceMinFreeFE.save((BObject)BInteger.make((int)bSystemPlatformServiceQnx.getMinFreeDiskPercentage()), hxOp)).getInt());
bSystemPlatformServiceQnx.setMinAvailableFiles(((BInteger)this.minFileFreeFE.save((BObject)BInteger.make((int)bSystemPlatformServiceQnx.getMinAvailableFiles()), hxOp)).getInt());
if (bSystemPlatformService instanceof BSystemPlatformServiceQnxJavelina) {
bSystemPlatformServiceQnxLegacy = (BSystemPlatformServiceQnxJavelina)bSystemPlatformService;
((BSystemPlatformServiceQnxJavelina)bSystemPlatformServiceQnxLegacy).setTamperSwitchEnabled(((BBoolean)this.tamperSwitchEnabledFE.save((BObject)bSystemPlatformService.get(BSystemPlatformServiceQnxJavelina.tamperSwitchEnabled), hxOp)).getBoolean());
}
} else if (!(bSystemPlatformService instanceof BSystemPlatformServiceNxs)) {
// empty if block
}
bSystemPlatformService.savePlatformServiceProperties();
if (Boolean.valueOf(hxOp.getFormValue("systemReboot")).booleanValue()) {
if (bSystemPlatformService.getLocalDaemonAccess() != BDaemonAccessLevel.restricted) {
bSystemPlatformService.reboot();
HxMessageHelper.addMessage("SystemPlatformServiceEditor", LexiconText.make((String)"platform", (String)"SystemPlatformServiceEditor.systemReboot.hxMessage"), hxOp);
} else {
HxMessageHelper.addMessage("SystemPlatformServiceEditor", LexiconText.make((String)"platform", (String)"SystemPlatformServiceEditor.systemNeedsReboot.hxMessage"), hxOp);
}
} else if (Boolean.valueOf(hxOp.getFormValue("systemRestart")).booleanValue()) {
if (bSystemPlatformService.getLocalDaemonAccess() != BDaemonAccessLevel.restricted) {
bSystemPlatformService.restartStation();
HxMessageHelper.addMessage("SystemPlatformServiceEditor", LexiconText.make((String)"platform", (String)"SystemPlatformServiceEditor.systemRestart.hxMessage"), hxOp);
} else {
HxMessageHelper.addMessage("SystemPlatformServiceEditor", LexiconText.make((String)"platform", (String)"SystemPlatformServiceEditor.systemNeedsRestart.hxMessage"), hxOp);
}
}
return hxOp.get();
}
private final BSystemPlatformService getSystemPlatformService(HxOp hxOp) {
BObject bObject = hxOp.get();
if (bObject instanceof BSystemPlatformService) {
return (BSystemPlatformService)bObject;
}
if (bObject instanceof BPlatformServiceContainer) {
BPlatformServiceContainer bPlatformServiceContainer = (BPlatformServiceContainer)bObject;
Class clazz = class$com$tridium$platform$BSystemPlatformService;
if (clazz == null) {
clazz = class$com$tridium$platform$BSystemPlatformService = BHxSystemPlatformServiceEditor.class("[Lcom.tridium.platform.BSystemPlatformService;", false);
}
return (BSystemPlatformService)bPlatformServiceContainer.getChildren(clazz)[0];
}
throw new ClassCastException();
}
static /* synthetic */ Class class(String string, boolean bl) {
try {
Class<?> clazz = Class.forName(string);
if (!bl) {
clazz = clazz.getComponentType();
}
return clazz;
}
catch (ClassNotFoundException classNotFoundException) {
throw new NoClassDefFoundError(classNotFoundException.getMessage());
}
}
protected BHxSystemPlatformServiceEditor() {
HashMap<String, String> hashMap = new HashMap<String, String>();
hashMap.put("onChange", "onLocaleChanged(event)");
this.localeFE = HxStringHelper.makeFE("locale", hashMap, (SimpleValidator)NotNullStringValidator.INSTANCE, (Context)BSystemPlatformService.locale.getFacets());
this.systemTimeFE = HxViewHelper.makeFE("systemTime", (BObject)BAbsTime.DEFAULT, (Context)BFacets.make((String)"showTimeZone", (boolean)false));
hashMap = new HashMap();
hashMap.put("onChange", "onTimeZoneChanged(event)");
this.timeZoneFE = HxTimeZoneHelper.makeFE("timeZone", hashMap, (Context)BSystemPlatformService.timeZone.getFacets());
this.engineWatchdogPolicyFE = HxViewHelper.makeFE("engineWatchdogPolicy", (BObject)BEngineWatchdogPolicy.terminate, (Context)BSystemPlatformService.engineWatchdogPolicy.getFacets());
this.engineWatchdogTimeoutFE = HxViewHelper.makeFE("engineWatchdogTimeout", (BObject)BRelTime.DEFAULT, (Context)BSystemPlatformService.engineWatchdogTimeout.getFacets());
BFacets bFacets = BFacets.make((String[])new String[]{"trueText", "falseText"}, (BIDataValue[])new BString[]{BString.make((String)"%lexicon(platform:labels.system.isStationAutoSaveEnabled.true)%"), BString.make((String)"%lexicon(platform:labels.system.isStationAutoSaveEnabled.false)%")});
hashMap = new HashMap();
hashMap.put("onChange", "onEnableStationAutoSaveChanged(event)");
this.isStationAutoSaveEnabledFE = HxBooleanHelper.makeFE("isStationAutoSaveEnabled", hashMap, (Context)bFacets);
this.stationAutoSaveFrequencyFE = HxViewHelper.makeFE("stationAutoSaveFrequency", (BObject)BRelTime.DEFAULT, (Context)BSystemPlatformService.stationAutoSaveFrequency.getFacets());
this.stationSaveBackupCountFE = HxViewHelper.makeFE("stationSaveBackupCount", (BObject)BInteger.DEFAULT, null);
this.refreshButton = HxButtonHelper.makeRefresh();
this.saveButton = HxButtonHelper.makeSave();
BSystemPlatformService bSystemPlatformService = (BSystemPlatformService)Sys.getService((Type)BSystemPlatformService.TYPE);
if (bSystemPlatformService instanceof BSystemPlatformServiceQnx) {
this.failureRebootLimitFE = HxViewHelper.makeFE("failureRebootLimit", (BObject)BInteger.DEFAULT, (Context)BSystemPlatformServiceQnx.failureRebootLimit.getFacets());
this.failureRebootLimitPeriodFE = HxViewHelper.makeFE("failureRebootLimitPeriod", (BObject)BRelTime.DEFAULT, (Context)BSystemPlatformServiceQnx.failureRebootLimitPeriod.getFacets());
this.ramDiskMinFreeFE = HxViewHelper.makeFE("ramDiskMinFree", (BObject)BInteger.DEFAULT, (Context)BSystemPlatformServiceQnx.minFreeRamDiskPercentage.getFacets());
BFacets bFacets2 = BSystemPlatformServiceQnx.ramDiskSize.getFacets();
if (bSystemPlatformService instanceof BSystemPlatformServiceQnxTitan) {
bFacets2 = BSystemPlatformServiceQnxTitan.ramDiskSize.getFacets();
} else if (bSystemPlatformService instanceof BSystemPlatformServiceQnxJavelina) {
bFacets2 = BSystemPlatformServiceQnxJavelina.ramDiskSize.getFacets();
} else if (bSystemPlatformService instanceof BSystemPlatformServiceQnxNpm6xx) {
bFacets2 = BSystemPlatformServiceQnxNpm6xx.ramDiskSize.getFacets();
} else if (bSystemPlatformService instanceof BSystemPlatformServiceQnxNpm3xx) {
bFacets2 = BSystemPlatformServiceQnxNpm3xx.ramDiskSize.getFacets();
} else if (bSystemPlatformService instanceof BSystemPlatformServiceQnxNpm2xx) {
bFacets2 = BSystemPlatformServiceQnxNpm2xx.ramDiskSize.getFacets();
}
BFacets bFacets3 = BFacets.make((String)"fieldWidth", (int)11);
bFacets2 = BFacets.make((BFacets)bFacets2, (BFacets)bFacets3);
hashMap = new HashMap();
hashMap.put("onChange", "onRamDiskSizeChanged(event)");
this.ramDiskSizeFE = HxStringHelper.makeFE("ramDiskSize", hashMap, (SimpleValidator)NotNullStringValidator.INSTANCE, (Context)bFacets2);
this.javaHeapMinFreeFE = HxViewHelper.makeFE("javaHeapMinFree", (BObject)BInteger.DEFAULT, (Context)BSystemPlatformServiceQnx.minFreeHeap.getFacets());
this.openFileDescriptorsMinFreeFE = HxViewHelper.makeFE("openFileDescriptorsMinFree", (BObject)BInteger.DEFAULT, (Context)BSystemPlatformServiceQnx.minFreeFileDescriptors.getFacets());
this.freeRamMinFreeFE = HxViewHelper.makeFE("freeRamMinFree", (BObject)BInteger.DEFAULT, (Context)BSystemPlatformServiceQnx.minFreePhysicalMemory.getFacets());
this.diskSpaceMinFreeFE = HxViewHelper.makeFE("diskSpaceMinFree", (BObject)BInteger.DEFAULT, (Context)BSystemPlatformServiceQnx.minFreeDiskPercentage.getFacets());
this.minFileFreeFE = HxViewHelper.makeFE("minFileFree", (BObject)BInteger.DEFAULT, (Context)BSystemPlatformServiceQnx.minAvailableFiles.getFacets());
if (bSystemPlatformService instanceof BSystemPlatformServiceQnxLegacy) {
this.batteryPresentFE = HxBooleanHelper.makeFE("batteryPresent", (BValue)BBoolean.FALSE, bFacets);
}
if (bSystemPlatformService instanceof BSystemPlatformServiceQnxJavelina) {
this.tamperSwitchEnabledFE = HxBooleanHelper.makeFE("tamperSwitchEnabled", (BValue)BBoolean.DEFAULT, bFacets);
}
} else if (!(bSystemPlatformService instanceof BSystemPlatformServiceNxs)) {
// empty if block
}
}
static {
Class clazz = class$com$tridium$platform$hx$BHxSystemPlatformServiceEditor;
if (clazz == null) {
clazz = class$com$tridium$platform$hx$BHxSystemPlatformServiceEditor = BHxSystemPlatformServiceEditor.class("[Lcom.tridium.platform.hx.BHxSystemPlatformServiceEditor;", false);
}
TYPE = Sys.loadType((Class)clazz);
lex = Lexicon.make((String)"platform");
mbFormat = new DecimalFormat(lex.getText("Formats.mb"));
}
}
@@ -0,0 +1,523 @@
/*
* Decompiled with CFR 0.152.
*
* Could not load the following classes:
* javax.baja.data.BIDataValue
* javax.baja.hx.BHxView
* javax.baja.hx.HxOp
* javax.baja.io.HtmlWriter
* javax.baja.sys.BBoolean
* javax.baja.sys.BComplex
* javax.baja.sys.BFacets
* javax.baja.sys.BInteger
* javax.baja.sys.BObject
* javax.baja.sys.BSimple
* javax.baja.sys.BString
* javax.baja.sys.BVector
* javax.baja.sys.Context
* javax.baja.sys.Property
* javax.baja.sys.Sys
* javax.baja.sys.Type
* javax.baja.util.LexiconText
*/
package com.tridium.platform.hx;
import com.tridium.platform.hx.util.HxBooleanHelper;
import com.tridium.platform.hx.util.HxStringHelper;
import com.tridium.platform.hx.util.HxStringListHelper;
import com.tridium.platform.hx.util.HxViewHelper;
import com.tridium.platform.hx.util.TcpIpAddressValidator;
import com.tridium.platform.tcpip.BTcpIpAdapterSettings;
import java.util.HashMap;
import javax.baja.data.BIDataValue;
import javax.baja.hx.BHxView;
import javax.baja.hx.HxOp;
import javax.baja.io.HtmlWriter;
import javax.baja.sys.BBoolean;
import javax.baja.sys.BComplex;
import javax.baja.sys.BFacets;
import javax.baja.sys.BInteger;
import javax.baja.sys.BObject;
import javax.baja.sys.BSimple;
import javax.baja.sys.BString;
import javax.baja.sys.BVector;
import javax.baja.sys.Context;
import javax.baja.sys.Property;
import javax.baja.sys.Sys;
import javax.baja.sys.Type;
import javax.baja.util.LexiconText;
/*
* Illegal identifiers - consider using --renameillegalidents true
*/
public class BHxTcpIpAdapterEditor
extends BHxView {
public static final BHxTcpIpAdapterEditor INSTANCE = new BHxTcpIpAdapterEditor();
public static final Type TYPE;
private HxViewHelper domainEditor = HxStringHelper.makeFE("domain", null);
private HxViewHelper gatewayEditor = HxStringHelper.makeFE("gateway", TcpIpAddressValidator.INSTANCE, null);
private HxViewHelper ipAddressEditor = HxStringHelper.makeFE("ipAddress", TcpIpAddressValidator.INSTANCE, null);
private HxViewHelper subnetMaskEditor = HxStringHelper.makeFE("subnetMask", TcpIpAddressValidator.INSTANCE_SUBNET, null);
private HxViewHelper dhcpEnabledEditor;
private HxViewHelper adapterEnabledEditor;
private HxViewHelper dnsEditor;
private HxViewHelper ipv6EnabledEditor;
private HxViewHelper ipv6DhcpEnabledEditor;
private HxViewHelper ipv6AddressEditor = HxStringHelper.makeFE("ipv6Address", TcpIpAddressValidator.INSTANCEv6, null);
private HxViewHelper ipv6GatewayEditor = HxStringHelper.makeFE("ipv6Gateway", TcpIpAddressValidator.INSTANCEv6, null);
private HxViewHelper ipv6SubnetPrefixLengthEditor = HxStringHelper.makeFE("ipv6SubnetPrefixLength", null);
private HxViewHelper ipv6DnsEditor;
static /* synthetic */ Class class$com$tridium$platform$hx$BHxTcpIpAdapterEditor;
public Type getType() {
return TYPE;
}
public void write(HxOp hxOp) throws Exception {
BTcpIpAdapterSettings bTcpIpAdapterSettings = (BTcpIpAdapterSettings)hxOp.get();
hxOp.addJavaScript("module://platform/lib/BHxTcpIpAdapterEditor.js");
boolean bl = bTcpIpAdapterSettings.getIsAdapterEnabled();
boolean bl2 = bTcpIpAdapterSettings.getIsIpv6Supported();
boolean bl3 = bTcpIpAdapterSettings.getIsIpv6Enabled();
boolean bl4 = bTcpIpAdapterSettings.getCanDisableIpv6();
boolean bl5 = bTcpIpAdapterSettings.getCanDisableAdapter();
boolean bl6 = bTcpIpAdapterSettings.getCanUseDhcp();
boolean bl7 = bTcpIpAdapterSettings.getCanUseIpv6Dhcp();
boolean bl8 = hxOp.canWrite();
bTcpIpAdapterSettings.getHostSettings().lease();
bTcpIpAdapterSettings.getHostSettings().getComponentSpace().sync();
boolean bl9 = bTcpIpAdapterSettings.getHostSettings().getIsIPv6Readonly();
boolean bl10 = false;
if (!bl8 || !bl5) {
bl10 = true;
}
this.adapterEnabledEditor.setReadonly(bl10);
boolean bl11 = false;
if (!bl8 || bl9 || !bl2 || !bl4 || !bl && !bl5) {
bl11 = true;
}
this.ipv6EnabledEditor.setReadonly(bl11);
boolean bl12 = false;
if (!bl8 || !bl6 || !bl && !bl5) {
bl12 = true;
}
this.dhcpEnabledEditor.setReadonly(bl12);
boolean bl13 = false;
if (!bl8 || !bl && !bl5) {
bl13 = true;
}
this.ipAddressEditor.setReadonly(bl13);
boolean bl14 = false;
if (!bl8 || !bl && !bl5) {
bl14 = true;
}
this.subnetMaskEditor.setReadonly(bl14);
if (bTcpIpAdapterSettings.getUsesAdapterLevelSettings()) {
boolean bl15 = false;
if (!bl8 || !bl && !bl5) {
bl15 = true;
}
this.gatewayEditor.setReadonly(bl15);
boolean bl16 = false;
if (!bl8 || !bl && !bl5) {
bl16 = true;
}
this.dnsEditor.setReadonly(bl16);
boolean bl17 = false;
if (!bl8 || !bl && !bl5) {
bl17 = true;
}
this.domainEditor.setReadonly(bl17);
} else {
this.gatewayEditor.setReadonly(true);
this.dnsEditor.setReadonly(true);
this.domainEditor.setReadonly(true);
}
if (bTcpIpAdapterSettings.getIsIpv6Supported()) {
boolean bl18 = false;
if (!bl8 || bl9 || !bl && !bl5 || !bl2 || !bl3 && !bl4 || !bl7) {
bl18 = true;
}
this.ipv6DhcpEnabledEditor.setReadonly(bl18);
boolean bl19 = false;
if (!bl8 || bl9 || !bl && !bl5 || !bl2 || !bl3 && !bl4) {
bl19 = true;
}
this.ipv6AddressEditor.setReadonly(bl19);
boolean bl20 = false;
if (!bl8 || bl9 || !bl && !bl5 || !bl2 || !bl3 && !bl4) {
bl20 = true;
}
this.ipv6SubnetPrefixLengthEditor.setReadonly(bl20);
if (bTcpIpAdapterSettings.getUsesAdapterLevelSettings()) {
boolean bl21 = false;
if (!bl8 || bl9 || !bl && !bl5 || !bl2 || !bl3 && !bl4) {
bl21 = true;
}
this.ipv6GatewayEditor.setReadonly(bl21);
boolean bl22 = false;
if (!bl8 || bl9 || !bl && !bl5 || !bl2 || !bl3 && !bl4) {
bl22 = true;
}
this.ipv6DnsEditor.setReadonly(bl22);
} else {
this.ipv6GatewayEditor.setReadonly(true);
this.ipv6DnsEditor.setReadonly(true);
}
} else {
this.ipv6DhcpEnabledEditor.setReadonly(true);
this.ipv6AddressEditor.setReadonly(true);
this.ipv6SubnetPrefixLengthEditor.setReadonly(true);
}
HtmlWriter htmlWriter = hxOp.getHtmlWriter();
htmlWriter.w((Object)"<input type='hidden' name='").w((Object)hxOp.scope("operatorCanWrite.hidden")).w((Object)("' value='" + bl8)).println("'/>");
htmlWriter.w((Object)"<input type='hidden' name='").w((Object)hxOp.scope("adapterEnabled.hidden")).w((Object)("' value='" + bTcpIpAdapterSettings.getIsAdapterEnabled())).println("'/>");
htmlWriter.w((Object)"<input type='hidden' name='").w((Object)hxOp.scope("canDisableAdapter.hidden")).w((Object)("' value='" + bTcpIpAdapterSettings.getCanDisableAdapter())).println("'/>");
htmlWriter.w((Object)"<input type='hidden' name='").w((Object)hxOp.scope("canUseDhcp.hidden")).w((Object)("' value='" + bTcpIpAdapterSettings.getCanUseDhcp())).println("'/>");
htmlWriter.w((Object)"<input type='hidden' name='").w((Object)hxOp.scope("dhcpEnabled.hidden")).w((Object)("' value='" + bTcpIpAdapterSettings.getIsDhcpEnabled())).println("'/>");
htmlWriter.w((Object)"<input type='hidden' name='").w((Object)hxOp.scope("canUseIpv6Dhcp.hidden")).w((Object)("' value='" + bTcpIpAdapterSettings.getCanUseIpv6Dhcp())).println("'/>");
htmlWriter.w((Object)"<input type='hidden' name='").w((Object)hxOp.scope("ipv6DhcpEnabled.hidden")).w((Object)("' value='" + bTcpIpAdapterSettings.getIsIpv6DhcpEnabled())).println("'/>");
htmlWriter.w((Object)"<input type='hidden' name='").w((Object)hxOp.scope("ipv6Supported.hidden")).w((Object)("' value='" + bTcpIpAdapterSettings.getIsIpv6Supported())).println("'/>");
htmlWriter.w((Object)"<input type='hidden' name='").w((Object)hxOp.scope("canDisableIpv6.hidden")).w((Object)("' value='" + bTcpIpAdapterSettings.getCanDisableIpv6())).println("'/>");
htmlWriter.w((Object)"<input type='hidden' name='").w((Object)hxOp.scope("ipv6Enabled.hidden")).w((Object)("' value='" + bTcpIpAdapterSettings.getIsIpv6Enabled())).println("'/>");
htmlWriter.w((Object)"<input type='hidden' name='").w((Object)hxOp.scope("ipv6Readonly.hidden")).w((Object)("' value='" + bl9)).println("'/>");
htmlWriter.w((Object)"<input type='hidden' name='").w((Object)hxOp.scope("usesAdapterLevelSettings.hidden")).w((Object)("' value='" + bTcpIpAdapterSettings.getUsesAdapterLevelSettings())).println("'/>");
htmlWriter.w((Object)"<table cellpadding='5'>");
htmlWriter.w((Object)"<tr>");
htmlWriter.w((Object)"<td><b>").w((Object)LexiconText.make((Type)TYPE, (String)"TcpIpAdapterEditor.interfaceId").getText((Context)hxOp)).w((Object)"</b></td>");
htmlWriter.w((Object)"<td>").safe(bTcpIpAdapterSettings.getAdapterId(), false).w((Object)"</td>");
htmlWriter.println("</tr>");
htmlWriter.w((Object)"<tr>");
htmlWriter.w((Object)"<td><b>").w((Object)LexiconText.make((Type)TYPE, (String)"TcpIpAdapterEditor.interfaceDesc").getText((Context)hxOp)).w((Object)"</b></td>");
htmlWriter.w((Object)"<td>").safe(bTcpIpAdapterSettings.getDescription(), false).w((Object)"</td>");
htmlWriter.println("</tr>");
htmlWriter.w((Object)"<tr>");
htmlWriter.w((Object)"<td><b>").w((Object)LexiconText.make((Type)TYPE, (String)"TcpIpAdapterEditor.macAddress").getText((Context)hxOp)).w((Object)"</b></td>");
htmlWriter.w((Object)"<td>").safe(bTcpIpAdapterSettings.getMediaAccessControlAddress(), false).w((Object)"</td>");
htmlWriter.println("</tr>");
htmlWriter.w((Object)"<tr>");
htmlWriter.w((Object)"<td><b>").w((Object)LexiconText.make((Type)TYPE, (String)"TcpIpAdapterEditor.isAdapterEnabled").getText((Context)hxOp)).w((Object)"</b></td>");
htmlWriter.w((Object)"<td>");
this.adapterEnabledEditor.write((BObject)bTcpIpAdapterSettings.get(BTcpIpAdapterSettings.isAdapterEnabled), hxOp);
htmlWriter.w((Object)"</td>");
htmlWriter.println("</tr>");
htmlWriter.w((Object)"<tr>");
htmlWriter.w((Object)"<td><b>").w((Object)LexiconText.make((Type)TYPE, (String)"TcpIpAdapterEditor.isDhcpEnabled").getText((Context)hxOp)).w((Object)"</b></td>");
htmlWriter.w((Object)"<td>");
this.dhcpEnabledEditor.write((BObject)bTcpIpAdapterSettings.get(BTcpIpAdapterSettings.isDhcpEnabled), hxOp);
htmlWriter.w((Object)"</td>");
htmlWriter.println("</tr>");
if (bTcpIpAdapterSettings.getUsesAdapterLevelSettings()) {
htmlWriter.w((Object)"<tr>");
htmlWriter.w((Object)"<td><b>").w((Object)LexiconText.make((Type)TYPE, (String)"TcpIpAdapterEditor.domain").getText((Context)hxOp)).w((Object)"</b></td>");
htmlWriter.w((Object)"<td>");
this.domainEditor.write((BObject)bTcpIpAdapterSettings.get(BTcpIpAdapterSettings.domain), hxOp);
htmlWriter.w((Object)"</td>");
htmlWriter.println("</tr>");
}
htmlWriter.w((Object)"<tr>");
htmlWriter.w((Object)"<td><b>").w((Object)LexiconText.make((Type)TYPE, (String)"TcpIpAdapterEditor.ipAddress").getText((Context)hxOp)).w((Object)"</b></td>");
htmlWriter.w((Object)"<td>");
this.ipAddressEditor.write((BObject)bTcpIpAdapterSettings.get(BTcpIpAdapterSettings.ipAddress), hxOp);
htmlWriter.w((Object)"</td>");
htmlWriter.println("</tr>");
if (bTcpIpAdapterSettings.getUsesAdapterLevelSettings()) {
htmlWriter.w((Object)"<tr>");
htmlWriter.w((Object)"<td><b>").w((Object)LexiconText.make((Type)TYPE, (String)"TcpIpAdapterEditor.gateway").getText((Context)hxOp)).w((Object)"</b></td>");
htmlWriter.w((Object)"<td>");
this.gatewayEditor.write((BObject)bTcpIpAdapterSettings.get(BTcpIpAdapterSettings.defaultGateway), hxOp);
htmlWriter.w((Object)"</td>");
htmlWriter.println("</tr>");
}
htmlWriter.w((Object)"<tr>");
htmlWriter.w((Object)"<td><b>").w((Object)LexiconText.make((Type)TYPE, (String)"TcpIpAdapterEditor.subnetMask").getText((Context)hxOp)).w((Object)"</b></td>");
htmlWriter.w((Object)"<td>");
this.subnetMaskEditor.write((BObject)bTcpIpAdapterSettings.get(BTcpIpAdapterSettings.subnetMask), hxOp);
htmlWriter.w((Object)"</td>");
htmlWriter.println("</tr>");
if (bTcpIpAdapterSettings.getIsDhcpEnabled()) {
htmlWriter.w((Object)"<tr>");
htmlWriter.w((Object)"<td><b>").w((Object)LexiconText.make((Type)TYPE, (String)"TcpIpAdapterEditor.dhcpHost").getText((Context)hxOp)).w((Object)"</b></td>");
htmlWriter.w((Object)"<td>").safe(bTcpIpAdapterSettings.getDhcpHost(), false).w((Object)"</td>");
htmlWriter.println("</tr>");
htmlWriter.w((Object)"<tr>");
htmlWriter.w((Object)"<td><b>").w((Object)LexiconText.make((Type)TYPE, (String)"TcpIpAdapterEditor.dhcpLeaseGranted").getText((Context)hxOp)).w((Object)"</b></td>");
htmlWriter.w((Object)"<td>").safe(bTcpIpAdapterSettings.getDhcpLeaseGranted(), false).w((Object)"</td>");
htmlWriter.println("</tr>");
htmlWriter.w((Object)"<tr>");
htmlWriter.w((Object)"<td><b>").w((Object)LexiconText.make((Type)TYPE, (String)"TcpIpAdapterEditor.dhcpLeaseExpires").getText((Context)hxOp)).w((Object)"</b></td>");
htmlWriter.w((Object)"<td>").safe(bTcpIpAdapterSettings.getDhcpLeaseExpires(), false).w((Object)"</td>");
htmlWriter.println("</tr>");
}
if (bTcpIpAdapterSettings.getUsesAdapterLevelSettings()) {
htmlWriter.w((Object)"<tr>");
htmlWriter.w((Object)"<td><b>").w((Object)LexiconText.make((Type)TYPE, (String)"TcpIpAdapterEditor.dnsHostHx").getText((Context)hxOp)).w((Object)"</b></td>");
htmlWriter.w((Object)"<td>");
this.dnsEditor.write((BObject)bTcpIpAdapterSettings.getDnsHosts(), hxOp);
htmlWriter.w((Object)"</td>");
htmlWriter.println("</tr>");
}
htmlWriter.w((Object)"<tr>");
htmlWriter.w((Object)"<td><b>").w((Object)LexiconText.make((Type)TYPE, (String)"TcpIpAdapterEditor.isIpv6Supported").getText((Context)hxOp)).w((Object)"</b></td>");
if (bl2) {
htmlWriter.w((Object)"<td>").safe(LexiconText.make((Type)TYPE, (String)"TcpIpAdapterEditor.isIpv6Supported.true").getText((Context)hxOp), false).w((Object)"</td>");
} else {
htmlWriter.w((Object)"<td>").safe(LexiconText.make((Type)TYPE, (String)"TcpIpAdapterEditor.isIpv6Supported.false").getText((Context)hxOp), false).w((Object)"</td>");
}
htmlWriter.println("</tr>");
if (bl2 && !bl3 && bl4 || bl2 && bl3) {
htmlWriter.w((Object)"<tr>");
htmlWriter.w((Object)"<td><b>").w((Object)LexiconText.make((Type)TYPE, (String)"TcpIpAdapterEditor.isIpv6Enabled").getText((Context)hxOp)).w((Object)"</b></td>");
htmlWriter.w((Object)"<td>");
this.ipv6EnabledEditor.write((BObject)bTcpIpAdapterSettings.get(BTcpIpAdapterSettings.isIpv6Enabled), hxOp);
htmlWriter.w((Object)"</td>");
htmlWriter.println("</tr>");
if (bl7) {
htmlWriter.w((Object)"<tr>");
htmlWriter.w((Object)"<td><b>").w((Object)LexiconText.make((Type)TYPE, (String)"TcpIpAdapterEditor.isIpv6DhcpEnabled").getText((Context)hxOp)).w((Object)"</b></td>");
htmlWriter.w((Object)"<td>");
this.ipv6DhcpEnabledEditor.write((BObject)bTcpIpAdapterSettings.get(BTcpIpAdapterSettings.isIpv6DhcpEnabled), hxOp);
htmlWriter.w((Object)"</td>");
htmlWriter.println("</tr>");
}
}
if (bl2 && !bl3 && bl4 || bl2 && bl3) {
htmlWriter.w((Object)"<tr>");
htmlWriter.w((Object)"<td><b>").w((Object)LexiconText.make((Type)TYPE, (String)"TcpIpAdapterEditor.ipv6Address").getText((Context)hxOp)).w((Object)"</b></td>");
htmlWriter.w((Object)"<td>");
this.ipv6AddressEditor.write((BObject)bTcpIpAdapterSettings.get(BTcpIpAdapterSettings.ipv6Address), hxOp);
htmlWriter.w((Object)"</td>");
htmlWriter.println("</tr>");
if (bTcpIpAdapterSettings.getUsesAdapterLevelSettings()) {
htmlWriter.w((Object)"<tr>");
htmlWriter.w((Object)"<td><b>").w((Object)LexiconText.make((Type)TYPE, (String)"TcpIpAdapterEditor.ipv6Gateway").getText((Context)hxOp)).w((Object)"</b></td>");
htmlWriter.w((Object)"<td>");
this.ipv6GatewayEditor.write((BObject)bTcpIpAdapterSettings.get(BTcpIpAdapterSettings.ipv6DefaultGateway), hxOp);
htmlWriter.w((Object)"</td>");
htmlWriter.println("</tr>");
}
htmlWriter.w((Object)"<tr>");
htmlWriter.w((Object)"<td><b>").w((Object)LexiconText.make((Type)TYPE, (String)"TcpIpAdapterEditor.ipv6SubnetPrefixLength").getText((Context)hxOp)).w((Object)"</b></td>");
htmlWriter.w((Object)"<td>");
this.ipv6SubnetPrefixLengthEditor.write((BObject)BString.make((String)((BInteger)bTcpIpAdapterSettings.get(BTcpIpAdapterSettings.ipv6SubnetPrefixLength)).toString()), hxOp);
htmlWriter.w((Object)"</td>");
htmlWriter.println("</tr>");
}
if ((bl2 && !bl3 && bl4 || bl2 && bl3) && bl7 && !bTcpIpAdapterSettings.getIpv6DhcpHost().toString().trim().equalsIgnoreCase("n/a")) {
htmlWriter.w((Object)"<tr>");
htmlWriter.w((Object)"<td><b>").w((Object)LexiconText.make((Type)TYPE, (String)"TcpIpAdapterEditor.ipv6DhcpHost").getText((Context)hxOp)).w((Object)"</b></td>");
htmlWriter.w((Object)"<td>").safe(bTcpIpAdapterSettings.getIpv6DhcpHost(), false).w((Object)"</td>");
htmlWriter.println("</tr>");
htmlWriter.w((Object)"<tr>");
htmlWriter.w((Object)"<td><b>").w((Object)LexiconText.make((Type)TYPE, (String)"TcpIpAdapterEditor.ipv6DhcpLeaseGranted").getText((Context)hxOp)).w((Object)"</b></td>");
htmlWriter.w((Object)"<td>").safe(bTcpIpAdapterSettings.getIpv6DhcpLeaseGranted(), false).w((Object)"</td>");
htmlWriter.println("</tr>");
htmlWriter.w((Object)"<tr>");
htmlWriter.w((Object)"<td><b>").w((Object)LexiconText.make((Type)TYPE, (String)"TcpIpAdapterEditor.ipv6DhcpLeaseExpires").getText((Context)hxOp)).w((Object)"</b></td>");
htmlWriter.w((Object)"<td>").safe(bTcpIpAdapterSettings.getIpv6DhcpLeaseExpires(), false).w((Object)"</td>");
htmlWriter.println("</tr>");
}
if (bTcpIpAdapterSettings.getUsesAdapterLevelSettings() && bl2 && bl3) {
htmlWriter.w((Object)"<tr>");
htmlWriter.w((Object)"<td><b>").w((Object)LexiconText.make((Type)TYPE, (String)"TcpIpAdapterEditor.ipv6DnsHostHx").getText((Context)hxOp)).w((Object)"</b></td>");
htmlWriter.w((Object)"<td>");
this.ipv6DnsEditor.write((BObject)bTcpIpAdapterSettings.getIpv6DnsHosts(), hxOp);
htmlWriter.w((Object)"</td>");
htmlWriter.println("</tr>");
}
htmlWriter.w((Object)"</table>");
String string = "executeOnload(\"" + hxOp.getPath() + "\");";
hxOp.addOnload(string);
}
protected BSimple getPropertyValue(BComplex bComplex, Property property, HxViewHelper hxViewHelper, HxOp hxOp) throws Exception {
BSimple bSimple = (BSimple)bComplex.get(property);
if (!hxViewHelper.isReadonly() && hxViewHelper.isFormValueAvailable(hxOp)) {
return (BSimple)hxViewHelper.save((BObject)bSimple, hxOp);
}
return bSimple;
}
public boolean isIpv6EnabledSelected(HxOp hxOp) throws Exception {
BTcpIpAdapterSettings bTcpIpAdapterSettings = (BTcpIpAdapterSettings)hxOp.get();
return ((BBoolean)this.getPropertyValue((BComplex)bTcpIpAdapterSettings, BTcpIpAdapterSettings.isIpv6Enabled, this.ipv6EnabledEditor, hxOp)).getBoolean();
}
public String getAdapterIPValue(HxOp hxOp) throws Exception {
BTcpIpAdapterSettings bTcpIpAdapterSettings = (BTcpIpAdapterSettings)hxOp.get();
return ((BString)this.getPropertyValue((BComplex)bTcpIpAdapterSettings, BTcpIpAdapterSettings.ipAddress, this.ipAddressEditor, hxOp)).getString();
}
public String getAdapterSubnetMaskValue(HxOp hxOp) throws Exception {
BTcpIpAdapterSettings bTcpIpAdapterSettings = (BTcpIpAdapterSettings)hxOp.get();
return ((BString)this.getPropertyValue((BComplex)bTcpIpAdapterSettings, BTcpIpAdapterSettings.subnetMask, this.subnetMaskEditor, hxOp)).getString();
}
public boolean isAdapterEnabledSelected(HxOp hxOp) throws Exception {
BTcpIpAdapterSettings bTcpIpAdapterSettings = (BTcpIpAdapterSettings)hxOp.get();
return ((BBoolean)this.getPropertyValue((BComplex)bTcpIpAdapterSettings, BTcpIpAdapterSettings.isAdapterEnabled, this.adapterEnabledEditor, hxOp)).getBoolean();
}
public boolean isDhcpEnabledSelected(HxOp hxOp) throws Exception {
BTcpIpAdapterSettings bTcpIpAdapterSettings = (BTcpIpAdapterSettings)hxOp.get();
return ((BBoolean)this.getPropertyValue((BComplex)bTcpIpAdapterSettings, BTcpIpAdapterSettings.isDhcpEnabled, this.dhcpEnabledEditor, hxOp)).getBoolean();
}
public void validate(HxOp hxOp) throws Exception {
BTcpIpAdapterSettings bTcpIpAdapterSettings = (BTcpIpAdapterSettings)hxOp.get();
BBoolean bBoolean = BBoolean.make((boolean)bTcpIpAdapterSettings.getIsAdapterEnabled());
BBoolean bBoolean2 = BBoolean.make((boolean)bTcpIpAdapterSettings.getIsIpv6Enabled());
if (bTcpIpAdapterSettings.getCanDisableAdapter() && this.adapterEnabledEditor.isFormValueAvailable(hxOp)) {
bBoolean = (BBoolean)this.adapterEnabledEditor.save((BObject)bTcpIpAdapterSettings.get(BTcpIpAdapterSettings.isAdapterEnabled), hxOp);
}
if (bTcpIpAdapterSettings.getIsIpv6Supported() && bTcpIpAdapterSettings.getCanDisableIpv6() && this.ipv6EnabledEditor.isFormValueAvailable(hxOp)) {
bBoolean2 = (BBoolean)this.ipv6EnabledEditor.save((BObject)bTcpIpAdapterSettings.get(BTcpIpAdapterSettings.isIpv6Enabled), hxOp);
}
if (bBoolean.getBoolean()) {
BBoolean bBoolean3 = BBoolean.make((boolean)bTcpIpAdapterSettings.getIsDhcpEnabled());
BBoolean bBoolean4 = BBoolean.make((boolean)bTcpIpAdapterSettings.getIsIpv6DhcpEnabled());
if (bTcpIpAdapterSettings.getCanUseDhcp() && this.dhcpEnabledEditor.isFormValueAvailable(hxOp)) {
bBoolean3 = (BBoolean)this.dhcpEnabledEditor.save((BObject)bTcpIpAdapterSettings.get(BTcpIpAdapterSettings.isDhcpEnabled), hxOp);
}
if (bBoolean2.getBoolean() && bTcpIpAdapterSettings.getCanUseIpv6Dhcp() && this.ipv6DhcpEnabledEditor.isFormValueAvailable(hxOp)) {
bBoolean4 = (BBoolean)this.ipv6DhcpEnabledEditor.save((BObject)bTcpIpAdapterSettings.get(BTcpIpAdapterSettings.isIpv6DhcpEnabled), hxOp);
}
if (!bBoolean3.getBoolean()) {
if (this.ipAddressEditor.isFormValueAvailable(hxOp)) {
this.ipAddressEditor.validate((BObject)bTcpIpAdapterSettings.get(BTcpIpAdapterSettings.ipAddress), hxOp);
}
if (this.subnetMaskEditor.isFormValueAvailable(hxOp)) {
this.subnetMaskEditor.validate((BObject)bTcpIpAdapterSettings.get(BTcpIpAdapterSettings.subnetMask), hxOp);
}
}
if (bBoolean2.getBoolean() && !bBoolean4.getBoolean()) {
if (this.ipv6AddressEditor.isFormValueAvailable(hxOp)) {
this.ipv6AddressEditor.validate((BObject)bTcpIpAdapterSettings.get(BTcpIpAdapterSettings.ipv6Address), hxOp);
}
if (this.ipv6SubnetPrefixLengthEditor.isFormValueAvailable(hxOp)) {
this.ipv6SubnetPrefixLengthEditor.validate((BObject)bTcpIpAdapterSettings.get(BTcpIpAdapterSettings.ipv6SubnetPrefixLength), hxOp);
}
}
if (bTcpIpAdapterSettings.getUsesAdapterLevelSettings()) {
if (!bBoolean3.getBoolean()) {
if (this.domainEditor.isFormValueAvailable(hxOp)) {
this.domainEditor.validate((BObject)bTcpIpAdapterSettings.get(BTcpIpAdapterSettings.domain), hxOp);
}
if (this.dnsEditor.isFormValueAvailable(hxOp)) {
this.dnsEditor.validate((BObject)bTcpIpAdapterSettings.getDnsHosts(), hxOp);
}
if (this.gatewayEditor.isFormValueAvailable(hxOp)) {
this.gatewayEditor.validate((BObject)bTcpIpAdapterSettings.get(BTcpIpAdapterSettings.defaultGateway), hxOp);
}
}
if (bBoolean2.getBoolean() && !bBoolean4.getBoolean()) {
if (this.ipv6DnsEditor.isFormValueAvailable(hxOp)) {
this.ipv6DnsEditor.validate((BObject)bTcpIpAdapterSettings.getIpv6DnsHosts(), hxOp);
}
if (this.ipv6GatewayEditor.isFormValueAvailable(hxOp)) {
this.ipv6GatewayEditor.validate((BObject)bTcpIpAdapterSettings.get(BTcpIpAdapterSettings.ipv6DefaultGateway), hxOp);
}
}
}
}
}
public BObject save(HxOp hxOp) throws Exception {
BTcpIpAdapterSettings bTcpIpAdapterSettings = (BTcpIpAdapterSettings)hxOp.get();
if (bTcpIpAdapterSettings.getCanDisableAdapter() && this.adapterEnabledEditor.isFormValueAvailable(hxOp)) {
bTcpIpAdapterSettings.setIsAdapterEnabled(((BBoolean)this.adapterEnabledEditor.save((BObject)bTcpIpAdapterSettings.get(BTcpIpAdapterSettings.isAdapterEnabled), hxOp)).getBoolean());
}
if (bTcpIpAdapterSettings.getCanDisableIpv6() && this.ipv6EnabledEditor.isFormValueAvailable(hxOp)) {
bTcpIpAdapterSettings.setIsIpv6Enabled(((BBoolean)this.ipv6EnabledEditor.save((BObject)bTcpIpAdapterSettings.get(BTcpIpAdapterSettings.isIpv6Enabled), hxOp)).getBoolean());
}
if (bTcpIpAdapterSettings.getIsAdapterEnabled()) {
if (bTcpIpAdapterSettings.getCanUseDhcp() && this.dhcpEnabledEditor.isFormValueAvailable(hxOp)) {
bTcpIpAdapterSettings.setIsDhcpEnabled(((BBoolean)this.dhcpEnabledEditor.save((BObject)bTcpIpAdapterSettings.get(BTcpIpAdapterSettings.isDhcpEnabled), hxOp)).getBoolean());
}
if (bTcpIpAdapterSettings.getIsIpv6Enabled() && bTcpIpAdapterSettings.getCanUseIpv6Dhcp() && this.ipv6DhcpEnabledEditor.isFormValueAvailable(hxOp)) {
bTcpIpAdapterSettings.setIsIpv6DhcpEnabled(((BBoolean)this.ipv6DhcpEnabledEditor.save((BObject)bTcpIpAdapterSettings.get(BTcpIpAdapterSettings.isIpv6DhcpEnabled), hxOp)).getBoolean());
}
if (bTcpIpAdapterSettings.getUsesAdapterLevelSettings()) {
if (!bTcpIpAdapterSettings.getIsDhcpEnabled()) {
if (this.domainEditor.isFormValueAvailable(hxOp)) {
bTcpIpAdapterSettings.setDomain(this.domainEditor.save((BObject)bTcpIpAdapterSettings.get(BTcpIpAdapterSettings.domain), hxOp).toString());
}
if (this.dnsEditor.isFormValueAvailable(hxOp)) {
bTcpIpAdapterSettings.setDnsHosts((BVector)this.dnsEditor.save((BObject)bTcpIpAdapterSettings.getDnsHosts(), hxOp));
}
if (this.gatewayEditor.isFormValueAvailable(hxOp)) {
bTcpIpAdapterSettings.setDefaultGateway(this.gatewayEditor.save((BObject)bTcpIpAdapterSettings.get(BTcpIpAdapterSettings.defaultGateway), hxOp).toString());
}
}
if (bTcpIpAdapterSettings.getIsIpv6Enabled() && !bTcpIpAdapterSettings.getIsIpv6DhcpEnabled()) {
if (this.ipv6DnsEditor.isFormValueAvailable(hxOp)) {
bTcpIpAdapterSettings.setIpv6DnsHosts((BVector)this.ipv6DnsEditor.save((BObject)bTcpIpAdapterSettings.getIpv6DnsHosts(), hxOp));
}
if (this.ipv6GatewayEditor.isFormValueAvailable(hxOp)) {
bTcpIpAdapterSettings.setIpv6DefaultGateway(this.ipv6GatewayEditor.save((BObject)bTcpIpAdapterSettings.get(BTcpIpAdapterSettings.ipv6DefaultGateway), hxOp).toString());
}
}
}
if (!bTcpIpAdapterSettings.getIsDhcpEnabled()) {
if (this.ipAddressEditor.isFormValueAvailable(hxOp)) {
bTcpIpAdapterSettings.setIpAddress(this.ipAddressEditor.save((BObject)bTcpIpAdapterSettings.get(BTcpIpAdapterSettings.ipAddress), hxOp).toString());
}
if (this.subnetMaskEditor.isFormValueAvailable(hxOp)) {
bTcpIpAdapterSettings.setSubnetMask(this.subnetMaskEditor.save((BObject)bTcpIpAdapterSettings.get(BTcpIpAdapterSettings.subnetMask), hxOp).toString());
}
}
if (bTcpIpAdapterSettings.getIsIpv6Enabled() && !bTcpIpAdapterSettings.getIsIpv6DhcpEnabled()) {
if (this.ipv6AddressEditor.isFormValueAvailable(hxOp)) {
bTcpIpAdapterSettings.setIpv6Address(this.ipv6AddressEditor.save((BObject)bTcpIpAdapterSettings.get(BTcpIpAdapterSettings.ipv6Address), hxOp).toString());
}
if (this.ipv6SubnetPrefixLengthEditor.isFormValueAvailable(hxOp)) {
bTcpIpAdapterSettings.setIpv6SubnetPrefixLength(Integer.valueOf(this.ipv6SubnetPrefixLengthEditor.save((BObject)bTcpIpAdapterSettings.get(BTcpIpAdapterSettings.ipv6SubnetPrefixLength), hxOp).toString()));
}
}
}
return bTcpIpAdapterSettings;
}
static /* synthetic */ Class class(String string, boolean bl) {
try {
Class<?> clazz = Class.forName(string);
if (!bl) {
clazz = clazz.getComponentType();
}
return clazz;
}
catch (ClassNotFoundException classNotFoundException) {
throw new NoClassDefFoundError(classNotFoundException.getMessage());
}
}
protected BHxTcpIpAdapterEditor() {
BFacets bFacets = BFacets.make((String[])new String[]{"trueText", "falseText"}, (BIDataValue[])new BString[]{BString.make((String)"%lexicon(platform:TcpIpAdapterEditor.isDhcpEnabled.true)%"), BString.make((String)"%lexicon(platform:TcpIpAdapterEditor.isDhcpEnabled.false)%")});
BFacets bFacets2 = BFacets.make((String[])new String[]{"trueText", "falseText"}, (BIDataValue[])new BString[]{BString.make((String)"%lexicon(platform:TcpIpAdapterEditor.isIpv6DhcpEnabled.true)%"), BString.make((String)"%lexicon(platform:TcpIpAdapterEditor.isIpv6DhcpEnabled.false)%")});
BFacets bFacets3 = BFacets.make((String[])new String[]{"trueText", "falseText"}, (BIDataValue[])new BString[]{BString.make((String)"%lexicon(platform:TcpIpAdapterEditor.isIpv6Enabled.true)%"), BString.make((String)"%lexicon(platform:TcpIpAdapterEditor.isIpv6Enabled.false)%")});
BFacets bFacets4 = BFacets.make((String[])new String[]{"trueText", "falseText"}, (BIDataValue[])new BString[]{BString.make((String)"%lexicon(platform:TcpIpAdapterEditor.adapterEnabled.true)%"), BString.make((String)"%lexicon(platform:TcpIpAdapterEditor.adapterEnabled.false)%")});
HashMap<String, String> hashMap = new HashMap<String, String>();
hashMap.put("onChange", "onAdapterEnabledChanged(event)");
this.adapterEnabledEditor = HxBooleanHelper.makeFE("adapterEnabled", hashMap, (Context)bFacets4);
hashMap = new HashMap();
hashMap.put("onChange", "onIpv6EnabledChanged(event)");
this.ipv6EnabledEditor = HxBooleanHelper.makeFE("ipv6Enabled", hashMap, (Context)bFacets3);
hashMap = new HashMap();
hashMap.put("onChange", "onDhcpEnabledChanged(event)");
this.dhcpEnabledEditor = HxBooleanHelper.makeFE("dhcpEnabled", hashMap, (Context)bFacets);
hashMap = new HashMap();
hashMap.put("onChange", "onIpv6DhcpEnabledChanged(event)");
this.ipv6DhcpEnabledEditor = HxBooleanHelper.makeFE("ipv6DhcpEnabled", hashMap, (Context)bFacets2);
this.dnsEditor = HxStringListHelper.makeFE("dnsHosts", TcpIpAddressValidator.INSTANCE, null);
this.ipv6DnsEditor = HxStringListHelper.makeFE("ipv6DnsHosts", TcpIpAddressValidator.INSTANCEv6, null);
}
static {
Class clazz = class$com$tridium$platform$hx$BHxTcpIpAdapterEditor;
if (clazz == null) {
clazz = class$com$tridium$platform$hx$BHxTcpIpAdapterEditor = BHxTcpIpAdapterEditor.class("[Lcom.tridium.platform.hx.BHxTcpIpAdapterEditor;", false);
}
TYPE = Sys.loadType((Class)clazz);
}
}
@@ -0,0 +1,335 @@
/*
* Decompiled with CFR 0.152.
*
* Could not load the following classes:
* com.tridium.nre.util.IPAddressUtil
* javax.baja.data.BIDataValue
* javax.baja.hx.BHxView
* javax.baja.hx.HxOp
* javax.baja.io.HtmlWriter
* javax.baja.naming.OrdTarget
* javax.baja.sys.BBoolean
* javax.baja.sys.BFacets
* javax.baja.sys.BObject
* javax.baja.sys.BString
* javax.baja.sys.BVector
* javax.baja.sys.Context
* javax.baja.sys.LocalizableRuntimeException
* javax.baja.sys.SlotCursor
* javax.baja.sys.Sys
* javax.baja.sys.Type
* javax.baja.util.LexiconText
*/
package com.tridium.platform.hx;
import com.tridium.nre.util.IPAddressUtil;
import com.tridium.platform.hx.BHxTcpIpAdapterEditor;
import com.tridium.platform.hx.util.HostNameValidator;
import com.tridium.platform.hx.util.HxBooleanHelper;
import com.tridium.platform.hx.util.HxStringHelper;
import com.tridium.platform.hx.util.HxStringListHelper;
import com.tridium.platform.hx.util.HxViewHelper;
import com.tridium.platform.hx.util.TcpIpAddressValidator;
import com.tridium.platform.tcpip.BTcpIpAdapterSettings;
import com.tridium.platform.tcpip.BTcpIpHostSettings;
import java.util.HashMap;
import javax.baja.data.BIDataValue;
import javax.baja.hx.BHxView;
import javax.baja.hx.HxOp;
import javax.baja.io.HtmlWriter;
import javax.baja.naming.OrdTarget;
import javax.baja.sys.BBoolean;
import javax.baja.sys.BFacets;
import javax.baja.sys.BObject;
import javax.baja.sys.BString;
import javax.baja.sys.BVector;
import javax.baja.sys.Context;
import javax.baja.sys.LocalizableRuntimeException;
import javax.baja.sys.SlotCursor;
import javax.baja.sys.Sys;
import javax.baja.sys.Type;
import javax.baja.util.LexiconText;
/*
* Illegal identifiers - consider using --renameillegalidents true
*/
public class BHxTcpIpHostEditor
extends BHxView {
public static final BHxTcpIpHostEditor INSTANCE = new BHxTcpIpHostEditor();
public static final Type TYPE;
private HxViewHelper hostNameEditor = HxStringHelper.makeFE("hostName", HostNameValidator.INSTANCE, null);
private HxViewHelper niagaraUsesIpv6Editor;
private HxViewHelper domainEditor = HxStringHelper.makeFE("domain", null);
private HxViewHelper gatewayEditor = HxStringHelper.makeFE("gateway", TcpIpAddressValidator.INSTANCE_PERMIT_NULL, null);
private HxViewHelper dnsEditor = HxStringListHelper.makeFE("dnsHosts", TcpIpAddressValidator.INSTANCE_PERMIT_NULL, null);
private HxViewHelper ipv6GatewayEditor = HxStringHelper.makeFE("ipv6Gateway", TcpIpAddressValidator.INSTANCEv6_PERMIT_NULL, null);
private HxViewHelper ipv6DnsEditor = HxStringListHelper.makeFE("ipv6DnsHosts", TcpIpAddressValidator.INSTANCEv6_PERMIT_NULL, null);
static /* synthetic */ Class class$com$tridium$platform$hx$BHxTcpIpHostEditor;
public Type getType() {
return TYPE;
}
public void write(HxOp hxOp) throws Exception {
BTcpIpHostSettings bTcpIpHostSettings = (BTcpIpHostSettings)hxOp.get();
HtmlWriter htmlWriter = hxOp.getHtmlWriter();
boolean bl = false;
SlotCursor slotCursor = bTcpIpHostSettings.getAdapters().loadSlots().getProperties();
while (slotCursor.next()) {
BTcpIpAdapterSettings bTcpIpAdapterSettings = (BTcpIpAdapterSettings)slotCursor.get();
if (!bTcpIpAdapterSettings.getIsIpv6Supported()) continue;
bl = true;
break;
}
boolean bl2 = false;
if (hxOp.canWrite() && !bTcpIpHostSettings.getIsReadonly()) {
bl2 = true;
}
boolean bl3 = bl2;
this.hostNameEditor.setReadonly(bl3 ^ true);
this.domainEditor.setReadonly(bl3 ^ true);
if (!bTcpIpHostSettings.getUsesAdapterLevelSettings()) {
this.gatewayEditor.setReadonly(bl3 ^ true);
this.dnsEditor.setReadonly(bl3 ^ true);
} else {
this.gatewayEditor.setReadonly(true);
this.dnsEditor.setReadonly(true);
}
boolean bl4 = bTcpIpHostSettings.getIsIPv6Readonly();
if (bl) {
boolean bl5 = false;
if (!bl3 || bl4) {
bl5 = true;
}
this.ipv6GatewayEditor.setReadonly(bl5);
boolean bl6 = false;
if (!bl3 || bl4) {
bl6 = true;
}
this.ipv6DnsEditor.setReadonly(bl6);
this.niagaraUsesIpv6Editor.setReadonly(bl3 ^ true);
} else {
this.ipv6GatewayEditor.setReadonly(true);
this.ipv6DnsEditor.setReadonly(true);
this.niagaraUsesIpv6Editor.setReadonly(true);
}
htmlWriter.w((Object)"<table cellpadding='5'>");
htmlWriter.w((Object)"<tr>");
htmlWriter.w((Object)"<td><b>").w((Object)LexiconText.make((Type)TYPE, (String)"TcpIpHostEditor.hostName").getText((Context)hxOp)).w((Object)"</b></td>");
htmlWriter.w((Object)"<td>");
this.hostNameEditor.write((BObject)bTcpIpHostSettings.get(BTcpIpHostSettings.hostName), hxOp);
htmlWriter.w((Object)"</td>");
htmlWriter.w((Object)"</tr>");
if (bl) {
htmlWriter.w((Object)"<tr>");
htmlWriter.w((Object)"<td><b>").w((Object)LexiconText.make((Type)TYPE, (String)"TcpIpHostEditor.niagaraUsesIpv6").getText((Context)hxOp)).w((Object)"</b></td>");
htmlWriter.w((Object)"<td>");
this.niagaraUsesIpv6Editor.write((BObject)bTcpIpHostSettings.get(BTcpIpHostSettings.niagaraUsesIpv6), hxOp);
htmlWriter.w((Object)"</td>");
htmlWriter.w((Object)"</tr>");
}
if (!bTcpIpHostSettings.getUsesAdapterLevelSettings()) {
htmlWriter.w((Object)"<tr>");
htmlWriter.w((Object)"<td><b>").w((Object)LexiconText.make((Type)TYPE, (String)"TcpIpHostEditor.domain").getText((Context)hxOp)).w((Object)"</b></td>");
htmlWriter.w((Object)"<td>");
this.domainEditor.write((BObject)bTcpIpHostSettings.get(BTcpIpHostSettings.domain), hxOp);
htmlWriter.w((Object)"</td>");
htmlWriter.w((Object)"</tr>");
htmlWriter.w((Object)"<tr>");
htmlWriter.w((Object)"<td><b>").w((Object)LexiconText.make((Type)TYPE, (String)"TcpIpHostEditor.gateway").getText((Context)hxOp)).w((Object)"</b></td>");
htmlWriter.w((Object)"<td>");
this.gatewayEditor.write((BObject)bTcpIpHostSettings.get(BTcpIpHostSettings.defaultGateway), hxOp);
htmlWriter.w((Object)"</td>");
htmlWriter.w((Object)"</tr>");
htmlWriter.w((Object)"<tr>");
htmlWriter.w((Object)"<td><b>").w((Object)LexiconText.make((Type)TYPE, (String)"TcpIpHostEditor.dnsHostsHx").getText((Context)hxOp)).w((Object)"</b></td>");
htmlWriter.w((Object)"<td>");
this.dnsEditor.write((BObject)bTcpIpHostSettings.getDnsHosts(), hxOp);
htmlWriter.w((Object)"</td>");
htmlWriter.w((Object)"</tr>");
if (bl) {
htmlWriter.w((Object)"<tr>");
htmlWriter.w((Object)"<td><b>").w((Object)LexiconText.make((Type)TYPE, (String)"TcpIpHostEditor.ipv6Gateway").getText((Context)hxOp)).w((Object)"</b></td>");
htmlWriter.w((Object)"<td>");
this.ipv6GatewayEditor.write((BObject)bTcpIpHostSettings.get(BTcpIpHostSettings.ipv6DefaultGateway), hxOp);
htmlWriter.w((Object)"</td>");
htmlWriter.w((Object)"</tr>");
htmlWriter.w((Object)"<tr>");
htmlWriter.w((Object)"<td><b>").w((Object)LexiconText.make((Type)TYPE, (String)"TcpIpHostEditor.ipv6DnsHostsHx").getText((Context)hxOp)).w((Object)"</b></td>");
htmlWriter.w((Object)"<td>");
this.ipv6DnsEditor.write((BObject)bTcpIpHostSettings.getIpv6DnsHosts(), hxOp);
htmlWriter.w((Object)"</td>");
htmlWriter.w((Object)"</tr>");
}
}
htmlWriter.w((Object)"<tr>");
htmlWriter.w((Object)"<td><b>").w((Object)LexiconText.make((Type)TYPE, (String)"TcpIpHostEditor.interfaceCategory").getText((Context)hxOp)).w((Object)"</b></td>");
htmlWriter.w((Object)"<td>");
SlotCursor slotCursor2 = bTcpIpHostSettings.getAdapters().loadSlots().getProperties();
while (slotCursor2.next()) {
BTcpIpAdapterSettings bTcpIpAdapterSettings = (BTcpIpAdapterSettings)slotCursor2.get();
HxOp hxOp2 = hxOp.make(slotCursor2.slot().getName(), new OrdTarget((OrdTarget)hxOp, (BObject)bTcpIpAdapterSettings));
boolean bl7 = false;
if (!hxOp.canWrite() || bTcpIpHostSettings.getIsReadonly()) {
bl7 = true;
}
hxOp2.setReadonly(bl7);
BHxTcpIpAdapterEditor.INSTANCE.write(hxOp2);
htmlWriter.w((Object)"<br/>");
}
htmlWriter.w((Object)"</td>");
htmlWriter.w((Object)"</tr>");
htmlWriter.w((Object)"</table>");
}
public void validate(HxOp hxOp) throws Exception {
boolean bl = false;
int n = 0;
BTcpIpAdapterSettings bTcpIpAdapterSettings = null;
BTcpIpAdapterSettings bTcpIpAdapterSettings2 = null;
String string = null;
HashMap<String, BTcpIpAdapterSettings> hashMap = new HashMap<String, BTcpIpAdapterSettings>();
BTcpIpHostSettings bTcpIpHostSettings = (BTcpIpHostSettings)hxOp.get();
Object object = bTcpIpHostSettings.getAdapters().loadSlots().getProperties();
while (object.next()) {
bTcpIpAdapterSettings = (BTcpIpAdapterSettings)object.get();
HxOp hxOp2 = hxOp.make(object.slot().getName(), new OrdTarget((OrdTarget)hxOp, (BObject)bTcpIpAdapterSettings));
BHxTcpIpAdapterEditor.INSTANCE.validate(hxOp2);
if (!BHxTcpIpAdapterEditor.INSTANCE.isAdapterEnabledSelected(hxOp2)) continue;
++n;
if (bTcpIpAdapterSettings.getIsIpv6Supported() && BHxTcpIpAdapterEditor.INSTANCE.isIpv6EnabledSelected(hxOp2)) {
bl = true;
}
try {
string = IPAddressUtil.getIPv4NetworkPrefix((String)BHxTcpIpAdapterEditor.INSTANCE.getAdapterIPValue(hxOp2), (String)BHxTcpIpAdapterEditor.INSTANCE.getAdapterSubnetMaskValue(hxOp2));
}
catch (Exception exception) {
string = null;
}
if (string == null || (bTcpIpAdapterSettings2 = hashMap.put(string, bTcpIpAdapterSettings)) == null) continue;
throw new LocalizableRuntimeException("platform", "TcpIpHostEditor.duplicateNetworkPrefixes");
}
if (n == 0) {
throw new LocalizableRuntimeException("platform", "TcpIpHostEditor.noEnabledAdapters");
}
if (this.hostNameEditor.isFormValueAvailable(hxOp)) {
this.hostNameEditor.validate((BObject)bTcpIpHostSettings.get(BTcpIpHostSettings.hostName), hxOp);
}
if (this.niagaraUsesIpv6Editor != null && this.niagaraUsesIpv6Editor.isFormValueAvailable(hxOp)) {
this.niagaraUsesIpv6Editor.validate((BObject)bTcpIpHostSettings.get(BTcpIpHostSettings.niagaraUsesIpv6), hxOp);
}
if (!bTcpIpHostSettings.getUsesAdapterLevelSettings()) {
if (this.domainEditor.isFormValueAvailable(hxOp)) {
this.domainEditor.validate((BObject)bTcpIpHostSettings.get(BTcpIpHostSettings.domain), hxOp);
}
if (this.gatewayEditor.isFormValueAvailable(hxOp)) {
this.gatewayEditor.validate((BObject)bTcpIpHostSettings.get(BTcpIpHostSettings.defaultGateway), hxOp);
}
if (this.dnsEditor.isFormValueAvailable(hxOp)) {
this.dnsEditor.validate((BObject)bTcpIpHostSettings.getDnsHosts(), hxOp);
}
if (this.ipv6GatewayEditor != null && this.ipv6GatewayEditor.isFormValueAvailable(hxOp)) {
if (bl) {
this.ipv6GatewayEditor.validate((BObject)bTcpIpHostSettings.get(BTcpIpHostSettings.ipv6DefaultGateway), hxOp);
} else {
object = "";
try {
object = this.ipv6GatewayEditor.save((BObject)bTcpIpHostSettings.get(BTcpIpHostSettings.ipv6DefaultGateway), hxOp).toString();
}
catch (Exception exception) {}
if (((String)object).length() != 0) {
throw new LocalizableRuntimeException("platform", "TcpIpHostEditor.nonEmptyIPv6Gateway");
}
}
}
if (this.ipv6DnsEditor != null && this.ipv6DnsEditor.isFormValueAvailable(hxOp)) {
if (bl) {
this.ipv6DnsEditor.validate((BObject)bTcpIpHostSettings.getIpv6DnsHosts(), hxOp);
} else {
object = null;
try {
object = (BVector)this.ipv6DnsEditor.save((BObject)bTcpIpHostSettings.getIpv6DnsHosts(), hxOp);
}
catch (Exception exception) {}
if (object != null && object.getSlotCount() != 0) {
throw new LocalizableRuntimeException("platform", "TcpIpHostEditor.nonEmptyIPv6DNSHosts");
}
}
}
}
}
public BObject save(HxOp hxOp) throws Exception {
this.validate(hxOp);
BTcpIpHostSettings bTcpIpHostSettings = (BTcpIpHostSettings)hxOp.get();
if (bTcpIpHostSettings.getIsReadonly()) {
return bTcpIpHostSettings;
}
boolean bl = false;
SlotCursor slotCursor = bTcpIpHostSettings.getAdapters().loadSlots().getProperties();
while (slotCursor.next()) {
BTcpIpAdapterSettings bTcpIpAdapterSettings = (BTcpIpAdapterSettings)slotCursor.get();
HxOp hxOp2 = hxOp.make(slotCursor.slot().getName(), new OrdTarget((OrdTarget)hxOp, (BObject)bTcpIpAdapterSettings));
BHxTcpIpAdapterEditor.INSTANCE.save(hxOp2);
if (!bTcpIpAdapterSettings.getIsIpv6Supported() || !bTcpIpAdapterSettings.getIsIpv6Enabled()) continue;
bl = true;
}
if (this.hostNameEditor.isFormValueAvailable(hxOp)) {
bTcpIpHostSettings.setHostName(this.hostNameEditor.save((BObject)bTcpIpHostSettings.get(BTcpIpHostSettings.hostName), hxOp).toString());
}
if (bl) {
if (this.niagaraUsesIpv6Editor.isFormValueAvailable(hxOp)) {
bTcpIpHostSettings.setNiagaraUsesIpv6(((BBoolean)this.niagaraUsesIpv6Editor.save((BObject)bTcpIpHostSettings.get(BTcpIpHostSettings.niagaraUsesIpv6), hxOp)).getBoolean());
}
} else {
bTcpIpHostSettings.setNiagaraUsesIpv6(false);
}
if (!bTcpIpHostSettings.getUsesAdapterLevelSettings()) {
if (this.domainEditor.isFormValueAvailable(hxOp)) {
bTcpIpHostSettings.setDomain(this.domainEditor.save((BObject)bTcpIpHostSettings.get(BTcpIpHostSettings.domain), hxOp).toString());
}
if (this.gatewayEditor.isFormValueAvailable(hxOp)) {
bTcpIpHostSettings.setDefaultGateway(this.gatewayEditor.save((BObject)bTcpIpHostSettings.get(BTcpIpHostSettings.defaultGateway), hxOp).toString());
}
if (this.dnsEditor.isFormValueAvailable(hxOp)) {
bTcpIpHostSettings.setDnsHosts((BVector)this.dnsEditor.save((BObject)bTcpIpHostSettings.getDnsHosts(), hxOp));
}
if (bl) {
if (this.ipv6GatewayEditor.isFormValueAvailable(hxOp)) {
bTcpIpHostSettings.setIpv6DefaultGateway(this.ipv6GatewayEditor.save((BObject)bTcpIpHostSettings.get(BTcpIpHostSettings.ipv6DefaultGateway), hxOp).toString());
}
if (this.ipv6DnsEditor.isFormValueAvailable(hxOp)) {
bTcpIpHostSettings.setIpv6DnsHosts((BVector)this.ipv6DnsEditor.save((BObject)bTcpIpHostSettings.getIpv6DnsHosts(), hxOp));
}
}
}
return bTcpIpHostSettings;
}
static /* synthetic */ Class class(String string, boolean bl) {
try {
Class<?> clazz = Class.forName(string);
if (!bl) {
clazz = clazz.getComponentType();
}
return clazz;
}
catch (ClassNotFoundException classNotFoundException) {
throw new NoClassDefFoundError(classNotFoundException.getMessage());
}
}
protected BHxTcpIpHostEditor() {
BFacets bFacets = BFacets.make((String[])new String[]{"trueText", "falseText"}, (BIDataValue[])new BString[]{BString.make((String)"%lexicon(platform:TcpIpHostEditor.niagaraUsesIpv6.true)%"), BString.make((String)"%lexicon(platform:TcpIpHostEditor.niagaraUsesIpv6.false)%")});
this.niagaraUsesIpv6Editor = HxBooleanHelper.makeFE("niagaraUsesIpv6", new HashMap(), (Context)bFacets);
}
static {
Class clazz = class$com$tridium$platform$hx$BHxTcpIpHostEditor;
if (clazz == null) {
clazz = class$com$tridium$platform$hx$BHxTcpIpHostEditor = BHxTcpIpHostEditor.class("[Lcom.tridium.platform.hx.BHxTcpIpHostEditor;", false);
}
TYPE = Sys.loadType((Class)clazz);
}
}
@@ -0,0 +1,111 @@
/*
* Decompiled with CFR 0.152.
*
* Could not load the following classes:
* javax.baja.hx.BHxView
* javax.baja.hx.HxOp
* javax.baja.io.HtmlWriter
* javax.baja.naming.OrdTarget
* javax.baja.sys.BObject
* javax.baja.sys.Sys
* javax.baja.sys.Type
* javax.baja.util.Lexicon
* javax.baja.util.LexiconText
*/
package com.tridium.platform.hx;
import com.tridium.platform.BSystemPlatformService;
import com.tridium.platform.daemon.BDaemonAccessLevel;
import com.tridium.platform.hx.BHxTcpIpHostEditor;
import com.tridium.platform.hx.util.HxButtonHelper;
import com.tridium.platform.hx.util.HxMessageHelper;
import com.tridium.platform.tcpip.BTcpIpPlatformService;
import java.util.HashMap;
import javax.baja.hx.BHxView;
import javax.baja.hx.HxOp;
import javax.baja.io.HtmlWriter;
import javax.baja.naming.OrdTarget;
import javax.baja.sys.BObject;
import javax.baja.sys.Sys;
import javax.baja.sys.Type;
import javax.baja.util.Lexicon;
import javax.baja.util.LexiconText;
/*
* Illegal identifiers - consider using --renameillegalidents true
*/
public class BHxTcpIpPlatformServiceEditor
extends BHxView {
public static final BHxTcpIpPlatformServiceEditor INSTANCE = new BHxTcpIpPlatformServiceEditor();
public static final Type TYPE;
private HxButtonHelper refreshButton = HxButtonHelper.makeRefresh();
private HxButtonHelper saveButton = HxButtonHelper.makeSave();
static /* synthetic */ Class class$com$tridium$platform$hx$BHxTcpIpPlatformServiceEditor;
public Type getType() {
return TYPE;
}
public void write(HxOp hxOp) throws Exception {
hxOp.addJavaScript("module://platform/lib/BHxTcpIpPlatformServiceEditor.js");
BTcpIpPlatformService bTcpIpPlatformService = (BTcpIpPlatformService)hxOp.get();
bTcpIpPlatformService.checkPropertiesLoaded();
BSystemPlatformService bSystemPlatformService = (BSystemPlatformService)Sys.getService((Type)BSystemPlatformService.TYPE);
bSystemPlatformService.checkPropertiesLoaded();
boolean bl = false;
if (!hxOp.canWrite() || bSystemPlatformService.getLocalDaemonAccess() == BDaemonAccessLevel.restricted || bTcpIpPlatformService.getSettings().getIsReadonly()) {
bl = true;
}
boolean bl2 = bl;
HtmlWriter htmlWriter = hxOp.getHtmlWriter();
HxMessageHelper.writeMessage("TcpIpPlatformServiceEditor", hxOp);
HxOp hxOp2 = hxOp.make("settings", new OrdTarget((OrdTarget)hxOp, (BObject)bTcpIpPlatformService.getSettings()));
hxOp2.setReadonly(bl2);
BHxTcpIpHostEditor.INSTANCE.write(hxOp2);
htmlWriter.println("<div style='padding:10px; text-align:center;'>");
this.refreshButton.write(hxOp);
HashMap<String, String> hashMap = new HashMap<String, String>();
this.saveButton.setReadonly(bl2);
hashMap.put("onclick", "onTcpIpPlatformServiceSave(\"" + hxOp.scope("submit") + "\",\"" + Lexicon.make((String)"platform").getText("TcpIpPlatformServicePlugin.reboot.hxConfirmMessage") + "\")");
this.saveButton.write(hxOp, hashMap);
htmlWriter.println("</div>");
}
public BObject save(HxOp hxOp) throws Exception {
BTcpIpPlatformService bTcpIpPlatformService = (BTcpIpPlatformService)hxOp.get();
HxOp hxOp2 = hxOp.make("settings", new OrdTarget((OrdTarget)hxOp, (BObject)bTcpIpPlatformService.getSettings()));
BSystemPlatformService bSystemPlatformService = (BSystemPlatformService)Sys.getService((Type)BSystemPlatformService.TYPE);
if (bSystemPlatformService.getLocalDaemonAccess() != BDaemonAccessLevel.restricted && !bTcpIpPlatformService.getSettings().getIsReadonly()) {
BHxTcpIpHostEditor.INSTANCE.save(hxOp2);
bTcpIpPlatformService.savePlatformServiceProperties();
bSystemPlatformService.reboot();
HxMessageHelper.addMessage("TcpIpPlatformServiceEditor", LexiconText.make((String)"platform", (String)"TcpIpPlatformServicePlugin.reboot.hxMessage"), hxOp);
}
return bTcpIpPlatformService;
}
static /* synthetic */ Class class(String string, boolean bl) {
try {
Class<?> clazz = Class.forName(string);
if (!bl) {
clazz = clazz.getComponentType();
}
return clazz;
}
catch (ClassNotFoundException classNotFoundException) {
throw new NoClassDefFoundError(classNotFoundException.getMessage());
}
}
protected BHxTcpIpPlatformServiceEditor() {
}
static {
Class clazz = class$com$tridium$platform$hx$BHxTcpIpPlatformServiceEditor;
if (clazz == null) {
clazz = class$com$tridium$platform$hx$BHxTcpIpPlatformServiceEditor = BHxTcpIpPlatformServiceEditor.class("[Lcom.tridium.platform.hx.BHxTcpIpPlatformServiceEditor;", false);
}
TYPE = Sys.loadType((Class)clazz);
}
}
@@ -0,0 +1,124 @@
/*
* Decompiled with CFR 0.152.
*
* Could not load the following classes:
* javax.baja.sys.Property
* javax.baja.sys.Sys
* javax.baja.sys.Type
* javax.baja.web.BWebServlet
* javax.baja.web.WebOp
* javax.servlet.ServletOutputStream
*/
package com.tridium.platform.hx;
import com.tridium.platform.daemon.BDaemonSession;
import com.tridium.platform.daemon.BStationSurrogate;
import com.tridium.platform.daemon.LocalSessionUtil;
import java.io.EOFException;
import java.io.InputStream;
import java.io.InterruptedIOException;
import javax.baja.sys.Property;
import javax.baja.sys.Sys;
import javax.baja.sys.Type;
import javax.baja.web.BWebServlet;
import javax.baja.web.WebOp;
import javax.servlet.ServletOutputStream;
/*
* Illegal identifiers - consider using --renameillegalidents true
*/
public class BStationOutputServlet
extends BWebServlet {
public static final Property servletName = BStationOutputServlet.newProperty((int)0, (String)"stationOutput", null);
public static final Type TYPE;
static /* synthetic */ Class class$com$tridium$platform$hx$BStationOutputServlet;
public Type getType() {
return TYPE;
}
public Type[] getServiceTypes() {
return new Type[]{TYPE};
}
/*
* Enabled aggressive block sorting
* Enabled unnecessary exception pruning
* Enabled aggressive exception aggregation
*/
public void doGet(WebOp webOp) throws Exception {
BDaemonSession bDaemonSession = LocalSessionUtil.getLocalSession();
webOp.setContentType("text/plain");
if (bDaemonSession == null) {
webOp.getWriter().println(this.getLexicon().getText("StationOutputServlet.notAvailable"));
return;
}
ServletOutputStream servletOutputStream = webOp.getResponse().getOutputStream();
BStationSurrogate bStationSurrogate = BStationSurrogate.make(bDaemonSession, Sys.getStation().getStationName());
InputStream inputStream = bStationSurrogate.getStationOutput(false, false);
try {
int n = 4096;
byte[] byArray = new byte[n];
while (true) {
int n2;
block14: {
n2 = inputStream.read(byArray, 0, n);
if (n2 >= 0) break block14;
Object var7_10 = null;
try {
inputStream.close();
return;
}
catch (Exception exception) {}
return;
}
try {
if (n2 > 0) {
servletOutputStream.write(byArray, 0, n2);
}
}
catch (InterruptedIOException interruptedIOException) {
}
catch (EOFException eOFException) {
Object var7_11 = null;
try {}
catch (Exception exception) {}
inputStream.close();
return;
}
continue;
break;
}
}
catch (Throwable throwable) {
Object var7_12 = null;
try {}
catch (Exception exception) {}
inputStream.close();
throw throwable;
throw throwable;
}
}
static /* synthetic */ Class class(String string, boolean bl) {
try {
Class<?> clazz = Class.forName(string);
if (!bl) {
clazz = clazz.getComponentType();
}
return clazz;
}
catch (ClassNotFoundException classNotFoundException) {
throw new NoClassDefFoundError(classNotFoundException.getMessage());
}
}
static {
Class clazz = class$com$tridium$platform$hx$BStationOutputServlet;
if (clazz == null) {
clazz = class$com$tridium$platform$hx$BStationOutputServlet = BStationOutputServlet.class("[Lcom.tridium.platform.hx.BStationOutputServlet;", false);
}
TYPE = Sys.loadType((Class)clazz);
}
}
@@ -0,0 +1,195 @@
/*
* Decompiled with CFR 0.152.
*
* Could not load the following classes:
* com.tridium.file.types.text.BCertificateFile
* com.tridium.file.types.text.BLicenseFile
* javax.baja.file.BIFile
* javax.baja.hx.HxOp
* javax.baja.hx.table.Table
* javax.baja.hx.table.TableModel
* javax.baja.hx.table.TableRenderer
* javax.baja.io.HtmlWriter
* javax.baja.naming.BOrd
* javax.baja.naming.OrdTarget
* javax.baja.nre.util.Array
* javax.baja.sys.BObject
* javax.baja.sys.Context
* javax.baja.util.LexiconText
*/
package com.tridium.platform.hx;
import com.tridium.file.types.text.BCertificateFile;
import com.tridium.file.types.text.BLicenseFile;
import com.tridium.platform.license.CertificateInfo;
import com.tridium.platform.license.IFileInfo;
import com.tridium.platform.license.LicenseInfo;
import javax.baja.file.BIFile;
import javax.baja.hx.HxOp;
import javax.baja.hx.table.Table;
import javax.baja.hx.table.TableModel;
import javax.baja.hx.table.TableRenderer;
import javax.baja.io.HtmlWriter;
import javax.baja.naming.BOrd;
import javax.baja.naming.OrdTarget;
import javax.baja.nre.util.Array;
import javax.baja.sys.BObject;
import javax.baja.sys.Context;
import javax.baja.util.LexiconText;
/*
* Illegal identifiers - consider using --renameillegalidents true
*/
public class FileInfoTable {
protected String fieldName;
protected Renderer renderer;
static /* synthetic */ Class class$com$tridium$platform$license$IFileInfo;
public void write(BObject bObject, HxOp hxOp) throws Exception {
HxOp hxOp2 = hxOp.make(this.fieldName, new OrdTarget((OrdTarget)hxOp, bObject));
Table table = new Table((TableModel)new Model());
table.setHeaderVisible(false);
table.setRenderer((TableRenderer)this.renderer);
table.write(hxOp2);
}
public IFileInfo[] getSelected(HxOp hxOp) throws Exception {
HxOp hxOp2 = hxOp.make(this.fieldName, new OrdTarget((OrdTarget)hxOp, hxOp.get()));
String[] stringArray = hxOp2.getFormKeys();
Class clazz = class$com$tridium$platform$license$IFileInfo;
if (clazz == null) {
clazz = class$com$tridium$platform$license$IFileInfo = FileInfoTable.class("[Lcom.tridium.platform.license.IFileInfo;", false);
}
Array array = new Array(clazz);
int n = 0;
while (n < stringArray.length) {
BIFile bIFile;
if (stringArray[n].startsWith("_") && (bIFile = (BIFile)BOrd.make((String)hxOp2.getFormValue(stringArray[n])).get()) != null) {
if (bIFile instanceof BLicenseFile) {
array.add((Object)new LicenseInfo(bIFile));
} else if (bIFile instanceof BCertificateFile) {
array.add((Object)new CertificateInfo(bIFile));
}
}
++n;
}
return (IFileInfo[])array.trim();
}
static /* synthetic */ Class class(String string, boolean bl) {
try {
Class<?> clazz = Class.forName(string);
if (!bl) {
clazz = clazz.getComponentType();
}
return clazz;
}
catch (ClassNotFoundException classNotFoundException) {
throw new NoClassDefFoundError(classNotFoundException.getMessage());
}
}
private final /* synthetic */ void this() {
this.renderer = new Renderer();
}
public FileInfoTable(String string) {
this.this();
this.fieldName = string;
}
/*
* Illegal identifiers - consider using --renameillegalidents true
*/
public static class Model
extends TableModel {
private Array[] rows;
private LexiconText[] groupHeaders;
static /* synthetic */ Class class$com$tridium$platform$license$LicenseInfo;
static /* synthetic */ Class class$com$tridium$platform$license$CertificateInfo;
public boolean getGroupHeaderVisible() {
return false;
}
public int getGroupCount() {
return 2;
}
public String getGroupName(int n, HxOp hxOp) {
return this.groupHeaders[n].getText((Context)hxOp);
}
public int getColumnCount() {
return 2;
}
public String getColumnName(int n, HxOp hxOp) {
return " ";
}
public int getRowCount(int n) {
return this.rows[n].size();
}
public IFileInfo getInfoAt(int n, int n2) {
return (IFileInfo)this.rows[n].get(n2);
}
public Object getValueAt(int n, int n2, int n3, HxOp hxOp) {
return this.getInfoAt(n, n2).toString((Context)hxOp);
}
static /* synthetic */ Class class(String string, boolean bl) {
try {
Class<?> clazz = Class.forName(string);
if (!bl) {
clazz = clazz.getComponentType();
}
return clazz;
}
catch (ClassNotFoundException classNotFoundException) {
throw new NoClassDefFoundError(classNotFoundException.getMessage());
}
}
private final /* synthetic */ void this() {
Array[] arrayArray = new Array[2];
Class clazz = class$com$tridium$platform$license$LicenseInfo;
if (clazz == null) {
clazz = class$com$tridium$platform$license$LicenseInfo = Model.class("[Lcom.tridium.platform.license.LicenseInfo;", false);
}
arrayArray[0] = new Array(clazz);
Class clazz2 = class$com$tridium$platform$license$CertificateInfo;
if (clazz2 == null) {
clazz2 = class$com$tridium$platform$license$CertificateInfo = Model.class("[Lcom.tridium.platform.license.CertificateInfo;", false);
}
arrayArray[1] = new Array(clazz2);
this.rows = arrayArray;
this.groupHeaders = new LexiconText[]{LexiconText.make((String)"platform", (String)"LicensePlatformServicePlugin.licenseList.header"), LexiconText.make((String)"platform", (String)"LicensePlatformServicePlugin.certList.header")};
}
public Model() {
this.this();
this.rows[0].addAll((Object[])LicenseInfo.listLocal());
this.rows[1].addAll((Object[])CertificateInfo.listLocal());
}
}
public static class Renderer
extends TableRenderer {
public void writeCellValue(Object object, int n, int n2, int n3, HxOp hxOp) throws Exception {
HtmlWriter htmlWriter = hxOp.getHtmlWriter();
IFileInfo iFileInfo = ((Model)this.getModel()).getInfoAt(n, n2);
if (n3 == 0) {
htmlWriter.w((Object)"<input type='checkbox' ").attr("name", hxOp.scope("_" + n2)).w((Object)"'");
htmlWriter.w((Object)" value='").w((Object)iFileInfo.getFile().getFilePath()).w((Object)"'/>");
} else {
htmlWriter.w((Object)"<a href='").w((Object)iFileInfo.getFile().getNavOrd()).w((Object)"'>");
super.writeCellValue(object, n, n2, n3, hxOp);
htmlWriter.w((Object)"</a>");
}
}
}
}
@@ -0,0 +1,31 @@
/*
* Decompiled with CFR 0.152.
*
* Could not load the following classes:
* com.tridium.nre.util.IPAddressUtil
* javax.baja.sys.BSimple
* javax.baja.sys.Context
* javax.baja.sys.LocalizableRuntimeException
*/
package com.tridium.platform.hx.util;
import com.tridium.nre.util.IPAddressUtil;
import com.tridium.platform.hx.util.NotNullStringValidator;
import com.tridium.platform.hx.util.SimpleValidator;
import javax.baja.sys.BSimple;
import javax.baja.sys.Context;
import javax.baja.sys.LocalizableRuntimeException;
public class HostNameValidator
implements SimpleValidator {
public static HostNameValidator INSTANCE = new HostNameValidator();
public void checkValid(String string, BSimple bSimple, Context context) throws Exception {
NotNullStringValidator.INSTANCE.checkValid(string, bSimple, context);
String string2 = bSimple.toString();
if (string2.length() != 0 && !IPAddressUtil.isHostname((String)string2)) {
throw new LocalizableRuntimeException("platform", "validator.error.badHostName", (Object[])new String[]{string});
}
}
}
@@ -0,0 +1,114 @@
/*
* Decompiled with CFR 0.152.
*
* Could not load the following classes:
* javax.baja.hx.BHxFieldEditor
* javax.baja.hx.BHxView
* javax.baja.hx.HxOp
* javax.baja.io.HtmlWriter
* javax.baja.naming.OrdTarget
* javax.baja.sys.BBoolean
* javax.baja.sys.BFacets
* javax.baja.sys.BObject
* javax.baja.sys.BValue
* javax.baja.sys.Context
* javax.baja.util.BFormat
*/
package com.tridium.platform.hx.util;
import com.tridium.platform.hx.util.HxViewHelper;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import javax.baja.hx.BHxFieldEditor;
import javax.baja.hx.BHxView;
import javax.baja.hx.HxOp;
import javax.baja.io.HtmlWriter;
import javax.baja.naming.OrdTarget;
import javax.baja.sys.BBoolean;
import javax.baja.sys.BFacets;
import javax.baja.sys.BObject;
import javax.baja.sys.BValue;
import javax.baja.sys.Context;
import javax.baja.util.BFormat;
public class HxBooleanHelper
extends HxViewHelper {
private Map attrs;
public static HxViewHelper makeFE(String string, Context context) {
return HxBooleanHelper.makeFE(string, null, context);
}
public static HxViewHelper makeFE(String string, Map map, Context context) {
return new HxBooleanHelper(string, map == null ? new HashMap() : map, context == null ? BFacets.NULL : context.getFacets());
}
public static HxBooleanHelper makeFE(String string, BValue bValue, BFacets bFacets) {
return new HxBooleanHelper(string, (BHxView)BHxFieldEditor.makeFor((BObject)bValue, (Context)bFacets.getBase()), bFacets);
}
public void write(BObject bObject, HxOp hxOp) throws Exception {
HxOp hxOp2 = hxOp.make(this.fieldName, new OrdTarget((OrdTarget)hxOp, bObject));
hxOp2.mergeFacets(this.facets);
hxOp2.setReadonly(this.isReadonly());
BBoolean bBoolean = (BBoolean)bObject;
HtmlWriter htmlWriter = hxOp2.getHtmlWriter();
String string = BBoolean.toString((boolean)false, (Context)hxOp);
String string2 = BBoolean.toString((boolean)true, (Context)hxOp);
BObject bObject2 = hxOp2.getFacet("trueText");
BObject bObject3 = hxOp2.getFacet("falseText");
if (bObject2 != null) {
string2 = BFormat.format((String)bObject2.toString(), null, (Context)hxOp2);
}
if (bObject3 != null) {
string = BFormat.format((String)bObject3.toString(), null, (Context)hxOp2);
}
htmlWriter.w((Object)"<select ").attr("name", hxOp2.scope("value"));
if (!hxOp2.canWrite()) {
htmlWriter.w((Object)" disabled='disabled'");
}
Iterator iterator = this.attrs.keySet().iterator();
while (iterator.hasNext()) {
Object k = iterator.next();
htmlWriter.w((Object)" ").attr(k.toString(), this.attrs.get(k).toString());
}
htmlWriter.w((Object)">");
htmlWriter.w((Object)"<option value='false'");
if (!bBoolean.getBoolean()) {
htmlWriter.w((Object)" selected='selected'");
}
htmlWriter.w((Object)">").w((Object)string).w((Object)"</option>");
htmlWriter.w((Object)"<option value='true'");
if (bBoolean.getBoolean()) {
htmlWriter.w((Object)" selected='selected'");
}
htmlWriter.w((Object)">").w((Object)string2).w((Object)"</option>");
htmlWriter.w((Object)"</select>");
}
public BObject save(BObject bObject, HxOp hxOp) throws Exception {
HxOp hxOp2 = hxOp.make(this.fieldName, new OrdTarget((OrdTarget)hxOp, bObject));
String string = hxOp2.getFormValue("value");
return string.equals("true") ? BBoolean.TRUE : BBoolean.FALSE;
}
public boolean isFormValueAvailable(HxOp hxOp) {
boolean bl = false;
if (!this.isReadonly() && hxOp.make(this.fieldName, (OrdTarget)hxOp).getFormValue("value") != null) {
bl = true;
}
return bl;
}
protected HxBooleanHelper(String string, Map map, BFacets bFacets) {
super(string, null, bFacets);
this.attrs = map;
}
protected HxBooleanHelper(String string, BHxView bHxView, BFacets bFacets) {
super(string, bHxView, bFacets);
this.attrs = new HashMap();
}
}
@@ -0,0 +1,106 @@
/*
* Decompiled with CFR 0.152.
*
* Could not load the following classes:
* javax.baja.hx.HxOp
* javax.baja.io.HtmlWriter
* javax.baja.nre.util.TextUtil
* javax.baja.util.LexiconText
*/
package com.tridium.platform.hx.util;
import com.tridium.platform.hx.util.StringToObjectMap;
import java.util.Map;
import javax.baja.hx.HxOp;
import javax.baja.io.HtmlWriter;
import javax.baja.nre.util.TextUtil;
import javax.baja.util.LexiconText;
public class HxButtonHelper {
private boolean readonly;
private Map attrs;
public static HxButtonHelper makeRefresh() {
StringToObjectMap stringToObjectMap = new StringToObjectMap();
stringToObjectMap.put("onclick", "window.location.reload()");
stringToObjectMap.put("value", LexiconText.make((String)"platform", (String)"HxButtonHelper.refresh"));
stringToObjectMap.put("class", "button");
return new HxButtonHelper(stringToObjectMap);
}
public static HxButtonHelper makeSave() {
return HxButtonHelper.makeSave(null);
}
public static HxButtonHelper makeSave(Map map) {
StringToObjectMap stringToObjectMap = new StringToObjectMap();
stringToObjectMap.put("value", LexiconText.make((String)"platform", (String)"HxButtonHelper.save"));
stringToObjectMap.put("class", "button");
stringToObjectMap.put("type", "submit");
if (map != null) {
stringToObjectMap.putAll(map);
}
return new HxButtonHelper(stringToObjectMap);
}
public static HxButtonHelper make(LexiconText lexiconText) {
return HxButtonHelper.make(lexiconText, null);
}
public static HxButtonHelper make(LexiconText lexiconText, Map map) {
StringToObjectMap stringToObjectMap = new StringToObjectMap();
stringToObjectMap.put("value", lexiconText);
stringToObjectMap.put("class", "button");
if (map != null) {
stringToObjectMap.putAll(map);
}
return new HxButtonHelper(stringToObjectMap);
}
public void setReadonly(boolean bl) {
this.readonly = bl;
}
public boolean isReadonly() {
return this.readonly;
}
public void write(HxOp hxOp) throws Exception {
this.write(hxOp, null);
}
public void write(HxOp hxOp, Map map) throws Exception {
Object object;
HtmlWriter htmlWriter = hxOp.getHtmlWriter();
htmlWriter.w((Object)"<input ");
StringToObjectMap stringToObjectMap = new StringToObjectMap(this.attrs);
if (map != null) {
stringToObjectMap.putAll(map);
}
String string = stringToObjectMap.getString("class", "button");
htmlWriter.w((Object)"class='").w((Object)string).w((Object)"' ");
if (string.equals("button")) {
object = TextUtil.toLowerCase((String)stringToObjectMap.getString("type", "button"));
if (((String)object).equals("submit") && stringToObjectMap.containsKey("onclick")) {
object = "button";
}
htmlWriter.w((Object)"type='").w(object).w((Object)"' ");
}
object = stringToObjectMap.keySet().iterator();
while (object.hasNext()) {
String string2 = (String)object.next();
String string3 = TextUtil.toLowerCase((String)string2);
if (string3.equals("class") || string3.equals("disabled") || string3.equals("type")) continue;
htmlWriter.w((Object)string2).w((Object)"='").w((Object)stringToObjectMap.getString(string2, hxOp)).w((Object)"' ");
}
if (this.isReadonly()) {
htmlWriter.w((Object)"disabled='true' ");
}
htmlWriter.println("/>");
}
protected HxButtonHelper(Map map) {
this.attrs = map;
}
}
@@ -0,0 +1,74 @@
/*
* Decompiled with CFR 0.152.
*
* Could not load the following classes:
* javax.baja.gx.BColor
* javax.baja.hx.HxOp
* javax.baja.io.HtmlWriter
* javax.baja.sys.Context
* javax.baja.util.LexiconText
*/
package com.tridium.platform.hx.util;
import javax.baja.gx.BColor;
import javax.baja.hx.HxOp;
import javax.baja.io.HtmlWriter;
import javax.baja.sys.Context;
import javax.baja.util.LexiconText;
public class HxMessageHelper {
public static void addMessage(String string, LexiconText lexiconText, HxOp hxOp) {
HxMessageHelper.addMessage(string, null, lexiconText.getText((Context)hxOp), null, hxOp);
}
public static void appendMessage(String string, LexiconText lexiconText, HxOp hxOp) {
HxMessageHelper.appendMessage(string, lexiconText.getText((Context)hxOp), hxOp);
}
public static void addMessage(String string, String string2, LexiconText lexiconText, HxOp hxOp) {
HxMessageHelper.addMessage(string, string2, lexiconText.getText((Context)hxOp), null, hxOp);
}
public static void addMessage(String string, String string2, HxOp hxOp) {
HxMessageHelper.addMessage(string, null, string2, null, hxOp);
}
public static void appendMessage(String string, String string2, HxOp hxOp) {
String string3 = HxMessageHelper.getSessionAttribute(string, "message", null, hxOp);
string3 = string3 == null ? string2 : string3 + string2;
hxOp.getRequest().getSession().setAttribute(string + ".message", (Object)string3);
}
public static void addMessage(String string, String string2, String string3, BColor bColor, HxOp hxOp) {
hxOp.getRequest().getSession().setAttribute(string + ".message", (Object)string3);
if (string2 != null) {
hxOp.getRequest().getSession().setAttribute(string + ".icon", (Object)string2);
}
if (bColor != null) {
hxOp.getRequest().getSession().setAttribute(string + ".textColor", (Object)bColor.toHtmlString());
}
}
public static boolean writeMessage(String string, HxOp hxOp) throws Exception {
HtmlWriter htmlWriter = hxOp.getHtmlWriter();
String string2 = HxMessageHelper.getSessionAttribute(string, "message", null, hxOp);
String string3 = HxMessageHelper.getSessionAttribute(string, "icon", "local:|module://icons/x16/info.png", hxOp);
String string4 = HxMessageHelper.getSessionAttribute(string, "textColor", "#FF0000", hxOp);
if (string2 == null) {
return false;
}
htmlWriter.w((Object)"<div style='border-bottom: 1px solid black; padding:5px; background:#ccc; font-weight: bold; color:").w((Object)string4).w((Object)";'><img alt='' src='").w((Object)string3).w((Object)"'/>&nbsp;").w((Object)string2).w((Object)"</div>");
return true;
}
protected static String getSessionAttribute(String string, String string2, String string3, HxOp hxOp) {
String string4 = string + '.' + string2;
String string5 = (String)hxOp.getRequest().getSession().getAttribute(string4);
if (string5 == null) {
return string3;
}
hxOp.getRequest().getSession().removeAttribute(string4);
return string5;
}
}
@@ -0,0 +1,71 @@
/*
* Decompiled with CFR 0.152.
*
* Could not load the following classes:
* javax.baja.hx.BHxFieldEditor
* javax.baja.hx.BHxView
* javax.baja.hx.HxOp
* javax.baja.nre.util.Array
* javax.baja.sys.BFacets
* javax.baja.sys.BObject
* javax.baja.sys.BSimple
* javax.baja.sys.Context
*/
package com.tridium.platform.hx.util;
import com.tridium.platform.hx.util.HxViewHelper;
import com.tridium.platform.hx.util.SimpleValidator;
import javax.baja.hx.BHxFieldEditor;
import javax.baja.hx.BHxView;
import javax.baja.hx.HxOp;
import javax.baja.nre.util.Array;
import javax.baja.sys.BFacets;
import javax.baja.sys.BObject;
import javax.baja.sys.BSimple;
import javax.baja.sys.Context;
public class HxSimpleViewHelper
extends HxViewHelper {
protected Array validators;
public static HxSimpleViewHelper makeFE(String string, BSimple bSimple, SimpleValidator simpleValidator, Context context) {
return HxSimpleViewHelper.makeFE(string, bSimple, new SimpleValidator[]{simpleValidator}, context);
}
public static HxSimpleViewHelper makeFE(String string, BSimple bSimple, SimpleValidator[] simpleValidatorArray, Context context) {
return new HxSimpleViewHelper(string, (BHxView)BHxFieldEditor.makeFor((BObject)bSimple, (Context)context), simpleValidatorArray == null ? new SimpleValidator[]{} : simpleValidatorArray, context == null ? BFacets.NULL : context.getFacets());
}
public static HxSimpleViewHelper makeFE(String string, BSimple bSimple, Context context) {
return HxSimpleViewHelper.makeFE(string, bSimple, null, context);
}
public void addValidator(SimpleValidator simpleValidator) {
this.validators.add((Object)simpleValidator);
}
public BObject save(BObject bObject, HxOp hxOp) throws Exception {
BSimple bSimple = (BSimple)super.save(bObject, hxOp);
int n = 0;
while (n < this.validators.size()) {
((SimpleValidator)this.validators.get(n)).checkValid(this.fieldName, bSimple, (Context)hxOp);
++n;
}
return bSimple;
}
public void validate(BObject bObject, HxOp hxOp) throws Exception {
BSimple bSimple = (BSimple)super.save(bObject, hxOp);
int n = 0;
while (n < this.validators.size()) {
((SimpleValidator)this.validators.get(n)).checkValid(this.fieldName, bSimple, (Context)hxOp);
++n;
}
}
protected HxSimpleViewHelper(String string, BHxView bHxView, SimpleValidator[] simpleValidatorArray, BFacets bFacets) {
super(string, bHxView, bFacets);
this.validators = new Array((Object[])simpleValidatorArray);
}
}
@@ -0,0 +1,114 @@
/*
* Decompiled with CFR 0.152.
*
* Could not load the following classes:
* javax.baja.hx.HxOp
* javax.baja.io.HtmlWriter
* javax.baja.naming.OrdTarget
* javax.baja.sys.BFacets
* javax.baja.sys.BObject
* javax.baja.sys.BSimple
* javax.baja.sys.BString
* javax.baja.sys.Context
*/
package com.tridium.platform.hx.util;
import com.tridium.platform.hx.util.HxSimpleViewHelper;
import com.tridium.platform.hx.util.HxViewHelper;
import com.tridium.platform.hx.util.SimpleValidator;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import javax.baja.hx.HxOp;
import javax.baja.io.HtmlWriter;
import javax.baja.naming.OrdTarget;
import javax.baja.sys.BFacets;
import javax.baja.sys.BObject;
import javax.baja.sys.BSimple;
import javax.baja.sys.BString;
import javax.baja.sys.Context;
public class HxStringHelper
extends HxSimpleViewHelper {
private Map attrs;
public static HxViewHelper makeFE(String string, Context context) {
return HxStringHelper.makeFE(string, null, null, context);
}
public static HxViewHelper makeFE(String string, SimpleValidator simpleValidator, Context context) {
return HxStringHelper.makeFE(string, null, new SimpleValidator[]{simpleValidator}, context);
}
public static HxViewHelper makeFE(String string, SimpleValidator[] simpleValidatorArray, Context context) {
return HxStringHelper.makeFE(string, null, simpleValidatorArray, context);
}
public static HxViewHelper makeFE(String string, Map map, Context context) {
return HxStringHelper.makeFE(string, map, null, context);
}
public static HxViewHelper makeFE(String string, Map map, SimpleValidator simpleValidator, Context context) {
return HxStringHelper.makeFE(string, map, new SimpleValidator[]{simpleValidator}, context);
}
public static HxViewHelper makeFE(String string, Map map, SimpleValidator[] simpleValidatorArray, Context context) {
return new HxStringHelper(string, map == null ? new HashMap() : map, simpleValidatorArray == null ? new SimpleValidator[]{} : simpleValidatorArray, context == null ? BFacets.NULL : context.getFacets());
}
public void write(BObject bObject, HxOp hxOp) throws Exception {
HxOp hxOp2 = hxOp.make(this.fieldName, new OrdTarget((OrdTarget)hxOp, bObject));
hxOp2.mergeFacets(this.facets);
hxOp2.setReadonly(this.isReadonly());
BString bString = (BString)bObject;
HtmlWriter htmlWriter = hxOp2.getHtmlWriter();
int n = hxOp2.getFacets().geti("fieldWidth", 40);
htmlWriter.w((Object)"<input type='text' size='").w(n).w((Object)"'");
if (this.isReadonly() || !hxOp.canWrite()) {
htmlWriter.w((Object)" disabled='disabled'");
}
Iterator iterator = this.attrs.keySet().iterator();
while (iterator.hasNext()) {
Object k = iterator.next();
htmlWriter.w((Object)" ").attr(k.toString(), this.attrs.get(k).toString());
}
htmlWriter.w((Object)" ").attr("name", hxOp2.scope("value"));
htmlWriter.w((Object)" ").attr("value", bString.getString());
htmlWriter.w((Object)"/>");
}
public boolean isFormValueAvailable(HxOp hxOp) {
boolean bl = false;
if (!this.isReadonly() && hxOp.make(this.fieldName, (OrdTarget)hxOp).getFormValue("value") != null) {
bl = true;
}
return bl;
}
public BObject save(BObject bObject, HxOp hxOp) throws Exception {
HxOp hxOp2 = hxOp.make(this.fieldName, new OrdTarget((OrdTarget)hxOp, bObject));
BString bString = BString.make((String)hxOp2.getFormValue("value"));
int n = 0;
while (n < this.validators.size()) {
((SimpleValidator)this.validators.get(n)).checkValid(this.fieldName, (BSimple)bString, (Context)hxOp);
++n;
}
return bString;
}
public void validate(BObject bObject, HxOp hxOp) throws Exception {
HxOp hxOp2 = hxOp.make(this.fieldName, new OrdTarget((OrdTarget)hxOp, bObject));
BString bString = BString.make((String)hxOp2.getFormValue("value"));
int n = 0;
while (n < this.validators.size()) {
((SimpleValidator)this.validators.get(n)).checkValid(this.fieldName, (BSimple)bString, (Context)hxOp);
++n;
}
}
protected HxStringHelper(String string, Map map, SimpleValidator[] simpleValidatorArray, BFacets bFacets) {
super(string, null, simpleValidatorArray, bFacets);
this.attrs = map;
}
}
@@ -0,0 +1,120 @@
/*
* Decompiled with CFR 0.152.
*
* Could not load the following classes:
* javax.baja.hx.BHxFieldEditor
* javax.baja.hx.BHxView
* javax.baja.hx.HxOp
* javax.baja.naming.OrdTarget
* javax.baja.naming.SlotPath
* javax.baja.nre.util.Array
* javax.baja.nre.util.TextUtil
* javax.baja.sys.BComponent
* javax.baja.sys.BFacets
* javax.baja.sys.BObject
* javax.baja.sys.BSimple
* javax.baja.sys.BString
* javax.baja.sys.BValue
* javax.baja.sys.Context
* javax.baja.sys.SlotCursor
*/
package com.tridium.platform.hx.util;
import com.tridium.platform.hx.util.HxViewHelper;
import com.tridium.platform.hx.util.SimpleValidator;
import javax.baja.hx.BHxFieldEditor;
import javax.baja.hx.BHxView;
import javax.baja.hx.HxOp;
import javax.baja.naming.OrdTarget;
import javax.baja.naming.SlotPath;
import javax.baja.nre.util.Array;
import javax.baja.nre.util.TextUtil;
import javax.baja.sys.BComponent;
import javax.baja.sys.BFacets;
import javax.baja.sys.BObject;
import javax.baja.sys.BSimple;
import javax.baja.sys.BString;
import javax.baja.sys.BValue;
import javax.baja.sys.Context;
import javax.baja.sys.SlotCursor;
public class HxStringListHelper
extends HxViewHelper {
private Array itemValidators;
public static HxViewHelper makeFE(String string, Context context) {
return HxStringListHelper.makeFE(string, null, context);
}
public static HxViewHelper makeFE(String string, SimpleValidator simpleValidator, Context context) {
return HxStringListHelper.makeFE(string, new SimpleValidator[]{simpleValidator}, context);
}
public static HxViewHelper makeFE(String string, SimpleValidator[] simpleValidatorArray, Context context) {
return new HxStringListHelper(string, simpleValidatorArray == null ? new SimpleValidator[]{} : simpleValidatorArray, context);
}
public void addItemValidator(SimpleValidator simpleValidator) {
this.itemValidators.add((Object)simpleValidator);
}
public void write(BObject bObject, HxOp hxOp) throws Exception {
StringBuffer stringBuffer = new StringBuffer();
SlotCursor slotCursor = ((BComponent)bObject).loadSlots().getProperties();
while (slotCursor.next()) {
if (stringBuffer.length() > 0) {
stringBuffer.append(',');
}
stringBuffer.append(slotCursor.get().toString());
}
super.write((BObject)BString.make((String)stringBuffer.toString()), hxOp);
}
public BObject save(BObject bObject, HxOp hxOp) throws Exception {
BString bString = (BString)super.save(bObject, hxOp);
String[] stringArray = TextUtil.splitAndTrim((String)bString.toString(), (char)',');
BComponent bComponent = (BComponent)bObject;
bComponent.removeAll();
int n = 0;
while (n < stringArray.length) {
BString bString2 = BString.make((String)stringArray[n]);
int n2 = 0;
while (n2 < this.itemValidators.size()) {
((SimpleValidator)this.itemValidators.get(n2)).checkValid(this.fieldName, (BSimple)bString2, (Context)hxOp);
++n2;
}
bComponent.add(SlotPath.escape((String)stringArray[n]), (BValue)bString2);
++n;
}
return bComponent;
}
public boolean isFormValueAvailable(HxOp hxOp) {
boolean bl = false;
if (!this.isReadonly() && hxOp.make(this.fieldName, (OrdTarget)hxOp).getFormValue("value") != null) {
bl = true;
}
return bl;
}
public void validate(BObject bObject, HxOp hxOp) throws Exception {
BString bString = (BString)super.save(bObject, hxOp);
String[] stringArray = TextUtil.splitAndTrim((String)bString.toString(), (char)',');
int n = 0;
while (n < stringArray.length) {
BString bString2 = BString.make((String)stringArray[n]);
int n2 = 0;
while (n2 < this.itemValidators.size()) {
((SimpleValidator)this.itemValidators.get(n2)).checkValid(this.fieldName, (BSimple)bString2, (Context)hxOp);
++n2;
}
++n;
}
}
protected HxStringListHelper(String string, SimpleValidator[] simpleValidatorArray, Context context) {
super(string, (BHxView)BHxFieldEditor.makeFor((BObject)BString.DEFAULT, (Context)context), context == null ? BFacets.NULL : context.getFacets());
this.itemValidators = new Array((Object[])simpleValidatorArray);
}
}
@@ -0,0 +1,119 @@
/*
* Decompiled with CFR 0.152.
*
* Could not load the following classes:
* javax.baja.hx.HxOp
* javax.baja.io.HtmlWriter
* javax.baja.naming.OrdTarget
* javax.baja.nre.util.Array
* javax.baja.sys.BFacets
* javax.baja.sys.BObject
* javax.baja.sys.Context
* javax.baja.timezone.BTimeZone
* javax.baja.timezone.TimeZoneDatabase
*/
package com.tridium.platform.hx.util;
import com.tridium.platform.hx.util.HxViewHelper;
import com.tridium.platform.timezone.TimeZoneUtil;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import javax.baja.hx.HxOp;
import javax.baja.io.HtmlWriter;
import javax.baja.naming.OrdTarget;
import javax.baja.nre.util.Array;
import javax.baja.sys.BFacets;
import javax.baja.sys.BObject;
import javax.baja.sys.Context;
import javax.baja.timezone.BTimeZone;
import javax.baja.timezone.TimeZoneDatabase;
public class HxTimeZoneHelper
extends HxViewHelper {
private static BTimeZone[] sortedTimeZones = null;
private BTimeZone[] zones;
private Map attrs;
public static HxViewHelper makeFE(String string, Map map, Context context) {
return HxTimeZoneHelper.makeFE(string, map, HxTimeZoneHelper.getSortedTimeZones(), context);
}
public static HxViewHelper makeFE(String string, Context context) {
return HxTimeZoneHelper.makeFE(string, new HashMap(), HxTimeZoneHelper.getSortedTimeZones(), context);
}
public static HxViewHelper makeFE(String string, BTimeZone[] bTimeZoneArray, Context context) {
return HxTimeZoneHelper.makeFE(string, new HashMap(), bTimeZoneArray, context);
}
public static HxViewHelper makeFE(String string, Map map, BTimeZone[] bTimeZoneArray, Context context) {
return new HxTimeZoneHelper(string, map, bTimeZoneArray, context == null ? BFacets.NULL : context.getFacets());
}
private static final BTimeZone[] getSortedTimeZones() {
if (sortedTimeZones == null) {
Object[] objectArray = TimeZoneDatabase.get().getTimeZones();
Array array = new Array(objectArray);
array = array.sort(TimeZoneUtil.TZ_COMPARATOR);
sortedTimeZones = (BTimeZone[])array.trim();
}
return sortedTimeZones;
}
public void write(BObject bObject, HxOp hxOp) throws Exception {
HtmlWriter htmlWriter = hxOp.getHtmlWriter();
htmlWriter.w((Object)"<select name='").w((Object)hxOp.scope(this.fieldName)).w((Object)"' ");
if (this.isReadonly()) {
htmlWriter.w((Object)" disabled='disabled'");
}
Iterator iterator = this.attrs.keySet().iterator();
while (iterator.hasNext()) {
Object k = iterator.next();
htmlWriter.w((Object)" ").attr(k.toString(), this.attrs.get(k).toString());
}
htmlWriter.w((Object)"'>");
int n = 0;
while (n < this.zones.length) {
htmlWriter.w((Object)"<option value='").w((Object)this.zones[n].getId()).w((Object)"'");
if (bObject.equals((Object)this.zones[n])) {
htmlWriter.w((Object)" selected='selected'");
}
if (this.isReadonly() || !hxOp.canWrite()) {
htmlWriter.w((Object)" disabled='disabled'");
}
htmlWriter.w((Object)">");
htmlWriter.w((Object)this.zones[n]);
htmlWriter.w((Object)"</option>");
++n;
}
htmlWriter.w((Object)"</select>");
}
public BObject save(BObject bObject, HxOp hxOp) throws Exception {
String string = hxOp.getFormValue(this.fieldName);
int n = 0;
while (n < this.zones.length) {
if (this.zones[n].getId().equals(string)) {
return this.zones[n];
}
++n;
}
return null;
}
public boolean isFormValueAvailable(HxOp hxOp) {
boolean bl = false;
if (!this.isReadonly() && hxOp.make(this.fieldName, (OrdTarget)hxOp).getFormValue("value") != null) {
bl = true;
}
return bl;
}
protected HxTimeZoneHelper(String string, Map map, BTimeZone[] bTimeZoneArray, BFacets bFacets) {
super(string, null, bFacets);
this.zones = bTimeZoneArray;
this.attrs = map;
}
}
@@ -0,0 +1,74 @@
/*
* Decompiled with CFR 0.152.
*
* Could not load the following classes:
* javax.baja.hx.BHxFieldEditor
* javax.baja.hx.BHxView
* javax.baja.hx.HxOp
* javax.baja.naming.OrdTarget
* javax.baja.sys.BFacets
* javax.baja.sys.BObject
* javax.baja.sys.Context
*/
package com.tridium.platform.hx.util;
import javax.baja.hx.BHxFieldEditor;
import javax.baja.hx.BHxView;
import javax.baja.hx.HxOp;
import javax.baja.naming.OrdTarget;
import javax.baja.sys.BFacets;
import javax.baja.sys.BObject;
import javax.baja.sys.Context;
public class HxViewHelper {
protected BHxView view;
protected String fieldName;
protected BFacets facets;
protected boolean readonly;
public static HxViewHelper make(String string, BHxView bHxView, Context context) {
return new HxViewHelper(string, bHxView, null);
}
public static HxViewHelper makeFE(String string, BObject bObject, Context context) {
return new HxViewHelper(string, (BHxView)BHxFieldEditor.makeFor((BObject)bObject, (Context)context), context == null ? BFacets.NULL : context.getFacets());
}
public void write(BObject bObject, HxOp hxOp) throws Exception {
HxOp hxOp2 = hxOp.make(this.fieldName, new OrdTarget((OrdTarget)hxOp, bObject));
hxOp2.mergeFacets(this.facets);
hxOp2.setReadonly(this.isReadonly());
this.view.write(hxOp2);
}
public BObject save(BObject bObject, HxOp hxOp) throws Exception {
HxOp hxOp2 = hxOp.make(this.fieldName, new OrdTarget((OrdTarget)hxOp, bObject));
return this.view.save(hxOp2);
}
public void validate(BObject bObject, HxOp hxOp) throws Exception {
}
public boolean isFormValueAvailable(HxOp hxOp) {
throw new UnsupportedOperationException(this.getClass().getName() + ".isFormValueAvailable(HxOp) " + this.fieldName);
}
public boolean isReadonly() {
return this.readonly;
}
public void setReadonly(boolean bl) {
this.readonly = bl;
}
public String getFieldName() {
return this.fieldName;
}
protected HxViewHelper(String string, BHxView bHxView, BFacets bFacets) {
this.fieldName = string;
this.view = bHxView;
this.facets = bFacets == null ? BFacets.NULL : bFacets;
}
}
@@ -0,0 +1,31 @@
/*
* Decompiled with CFR 0.152.
*
* Could not load the following classes:
* javax.baja.sys.BSimple
* javax.baja.sys.BString
* javax.baja.sys.Context
* javax.baja.sys.LocalizableRuntimeException
*/
package com.tridium.platform.hx.util;
import com.tridium.platform.hx.util.SimpleValidator;
import javax.baja.sys.BSimple;
import javax.baja.sys.BString;
import javax.baja.sys.Context;
import javax.baja.sys.LocalizableRuntimeException;
public class NotNullStringValidator
implements SimpleValidator {
public static NotNullStringValidator INSTANCE = new NotNullStringValidator();
public void checkValid(String string, BSimple bSimple, Context context) throws Exception {
if (bSimple == null || ((BString)bSimple).toString().trim().length() == 0) {
throw new LocalizableRuntimeException("platform", "validator.error.notNull", (Object[])new String[]{string});
}
}
private NotNullStringValidator() {
}
}
@@ -0,0 +1,16 @@
/*
* Decompiled with CFR 0.152.
*
* Could not load the following classes:
* javax.baja.sys.BSimple
* javax.baja.sys.Context
*/
package com.tridium.platform.hx.util;
import javax.baja.sys.BSimple;
import javax.baja.sys.Context;
public interface SimpleValidator {
public void checkValid(String var1, BSimple var2, Context var3) throws Exception;
}
@@ -0,0 +1,116 @@
/*
* Decompiled with CFR 0.152.
*
* Could not load the following classes:
* javax.baja.nre.util.TextUtil
* javax.baja.sys.BObject
* javax.baja.sys.Context
* javax.baja.util.LexiconText
*/
package com.tridium.platform.hx.util;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.Map;
import java.util.Set;
import javax.baja.nre.util.TextUtil;
import javax.baja.sys.BObject;
import javax.baja.sys.Context;
import javax.baja.util.LexiconText;
/*
* Illegal identifiers - consider using --renameillegalidents true
*/
public class StringToObjectMap
extends HashMap {
private HashSet originalKeys;
public boolean containsKey(Object object) {
return super.containsKey(TextUtil.toLowerCase((String)((String)object)));
}
public Object get(Object object) {
return super.get(TextUtil.toLowerCase((String)((String)object)));
}
public Object put(Object object, Object object2) {
this.originalKeys.add((String)object);
return super.put(TextUtil.toLowerCase((String)((String)object)), object2);
}
public void putAll(Map map) {
if (map == null) {
return;
}
Iterator iterator = map.keySet().iterator();
while (iterator.hasNext()) {
String string = (String)iterator.next();
this.put(string, map.get(string));
}
}
public Set keySet() {
return (Set)this.originalKeys.clone();
}
public void clear() {
super.clear();
this.originalKeys.clear();
}
public Object remove(Object object) {
String string = TextUtil.toLowerCase((String)((String)object));
Iterator iterator = this.originalKeys.iterator();
while (iterator.hasNext()) {
String string2 = (String)iterator.next();
if (!string.equals(TextUtil.toLowerCase((String)string2))) continue;
this.originalKeys.remove(string2);
return super.remove(string);
}
return null;
}
public String getString(String string, Object object) {
return this.getString(string, object, null);
}
public String getString(String string, Object object, Context context) {
String string2 = TextUtil.toLowerCase((String)string);
return super.containsKey(string2) ? this.getString(super.get(string2), context) : this.getString(object, context);
}
private final String getString(Object object, Context context) {
if (object instanceof LexiconText) {
return ((LexiconText)object).getText(context);
}
if (object instanceof BObject) {
return ((BObject)object).toString(context);
}
return String.valueOf(object);
}
private final /* synthetic */ void this() {
this.originalKeys = new HashSet();
}
public StringToObjectMap() {
this.this();
}
public StringToObjectMap(int n) {
super(n);
this.this();
}
public StringToObjectMap(int n, float f) {
super(n, f);
this.this();
}
public StringToObjectMap(Map map) {
this.this();
this.putAll(map);
}
}
@@ -0,0 +1,75 @@
/*
* Decompiled with CFR 0.152.
*
* Could not load the following classes:
* com.tridium.nre.util.IPAddressUtil
* javax.baja.sys.BSimple
* javax.baja.sys.Context
* javax.baja.sys.LocalizableRuntimeException
*/
package com.tridium.platform.hx.util;
import com.tridium.nre.util.IPAddressUtil;
import com.tridium.platform.hx.util.NotNullStringValidator;
import com.tridium.platform.hx.util.SimpleValidator;
import javax.baja.sys.BSimple;
import javax.baja.sys.Context;
import javax.baja.sys.LocalizableRuntimeException;
/*
* Illegal identifiers - consider using --renameillegalidents true
*/
public class TcpIpAddressValidator
implements SimpleValidator {
public static TcpIpAddressValidator INSTANCE = new TcpIpAddressValidator(false, false);
public static TcpIpAddressValidator INSTANCE_SUBNET = new TcpIpAddressValidator(false, false, true);
public static TcpIpAddressValidator INSTANCEv6 = new TcpIpAddressValidator(true, false);
public static TcpIpAddressValidator INSTANCE_PERMIT_NULL = new TcpIpAddressValidator(false, true);
public static TcpIpAddressValidator INSTANCEv6_PERMIT_NULL = new TcpIpAddressValidator(true, true);
private boolean isIpv6;
private boolean allowNull;
private boolean isSubnet;
public void checkValid(String string, BSimple bSimple, Context context) throws Exception {
if (!this.allowNull) {
NotNullStringValidator.INSTANCE.checkValid(string, bSimple, context);
}
String string2 = bSimple.toString();
if (this.allowNull && string2.length() == 0) {
return;
}
if (!this.isIpv6) {
if (!this.isSubnet) {
if (!IPAddressUtil.isIpv4Address((String)string2)) {
throw new LocalizableRuntimeException("platform", "validator.error.badIpAddress", (Object[])new String[]{string});
}
} else if (!IPAddressUtil.isIpv4SubnetMask((String)string2)) {
throw new LocalizableRuntimeException("platform", "validator.error.badSubnetMask", (Object[])new String[]{string});
}
} else if (!IPAddressUtil.isIpv6Address((String)string2)) {
throw new LocalizableRuntimeException("platform", "validator.error.badIpv6Address", (Object[])new String[]{string});
}
}
private final /* synthetic */ void this() {
this.isIpv6 = false;
this.allowNull = false;
this.isSubnet = false;
}
private TcpIpAddressValidator() {
this(false, false);
}
private TcpIpAddressValidator(boolean bl, boolean bl2) {
this(bl, bl2, false);
}
private TcpIpAddressValidator(boolean bl, boolean bl2, boolean bl3) {
this.this();
this.isIpv6 = bl;
this.allowNull = bl2;
this.isSubnet = bl3;
}
}