|
|
|
import { shortcut, store } from '@core/core';
|
|
|
|
import { Vertical, Htape, Label, Left } from 'ui';
|
|
|
|
import { FormItemXtype } from '../components/form_item/form_item';
|
|
|
|
import { ConnectionJndiModelXtype, ConnectionJndiModel } from './connection_jndi.model';
|
|
|
|
import { ConnectionJNDI } from 'src/modules/crud/crud.typings';
|
|
|
|
import { CollapseXtype, EVENT_CHANGE } from 'src/modules/components/collapse/collapse';
|
|
|
|
|
|
|
|
export const ConnectionJndiXtype = 'dec.dcm.connection_jndi';
|
|
|
|
@shortcut(ConnectionJndiXtype)
|
|
|
|
@store(ConnectionJndiModelXtype)
|
|
|
|
export class ConnectionJdbc extends BI.Widget {
|
|
|
|
model: ConnectionJndiModel['model'];
|
|
|
|
|
|
|
|
advancedSet: any;
|
|
|
|
|
|
|
|
render() {
|
|
|
|
const connectionData = this.model.connectionSelectedOne.connectionData as ConnectionJNDI;
|
|
|
|
const { jndiName, contextHashtable, originalCharsetName } = connectionData;
|
|
|
|
|
|
|
|
return {
|
|
|
|
type: Vertical,
|
|
|
|
hgap: 15,
|
|
|
|
vgap: 15,
|
|
|
|
items: [
|
|
|
|
{
|
|
|
|
type: FormItemXtype,
|
|
|
|
nameWidth: 200,
|
|
|
|
name: BI.i18nText('Dec-Dcm_Connection_JNDI_Form_ConnectionName'),
|
|
|
|
value: jndiName,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
type: Htape,
|
|
|
|
height: 120,
|
|
|
|
items: [
|
|
|
|
{
|
|
|
|
el: {
|
|
|
|
type: Left,
|
|
|
|
items: [
|
|
|
|
{
|
|
|
|
type: Label,
|
|
|
|
cls: 'bi-font-bold',
|
|
|
|
textAlign: 'left',
|
|
|
|
text: BI.i18nText('Dec-Dcm_Connection_JNDI_Form_Connection'),
|
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
|
|
|
width: 200,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
type: Vertical,
|
|
|
|
bgap: 10,
|
|
|
|
items: [
|
|
|
|
{
|
|
|
|
type: FormItemXtype,
|
|
|
|
name: 'INTIAL_CONTEXT_FACTORY',
|
|
|
|
nameWidth: 200,
|
|
|
|
value: contextHashtable['java.naming.factory.initial'],
|
|
|
|
},
|
|
|
|
{
|
|
|
|
type: FormItemXtype,
|
|
|
|
name: 'PROVIDER_URL',
|
|
|
|
nameWidth: 200,
|
|
|
|
value: contextHashtable['java.naming.provider.url'],
|
|
|
|
},
|
|
|
|
{
|
|
|
|
type: FormItemXtype,
|
|
|
|
name: 'SECURITY_PRINCIPAL',
|
|
|
|
nameWidth: 200,
|
|
|
|
value: contextHashtable['java.naming.security.principal'],
|
|
|
|
},
|
|
|
|
{
|
|
|
|
type: FormItemXtype,
|
|
|
|
name: 'SECURITY_CREDENTIALS',
|
|
|
|
nameWidth: 200,
|
|
|
|
value: contextHashtable['java.naming.security.credentials'],
|
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
|
|
|
{
|
|
|
|
type: FormItemXtype,
|
|
|
|
nameWidth: 200,
|
|
|
|
name: BI.i18nText('Dec-Dcm_Connection_Form_OriginalCharsetName'),
|
|
|
|
value: originalCharsetName ? originalCharsetName : BI.i18nText('Dec-Dcm_Connection_Form_Auto'),
|
|
|
|
},
|
|
|
|
{
|
|
|
|
type: CollapseXtype,
|
|
|
|
width: 70,
|
|
|
|
name: BI.i18nText('Dec-Dcm_Connection_Form_Database_Advanced_Setting'),
|
|
|
|
listeners: [
|
|
|
|
{
|
|
|
|
eventName: EVENT_CHANGE,
|
|
|
|
action: (isCollapse: boolean) => {
|
|
|
|
this.advancedSet.setVisible(!isCollapse);
|
|
|
|
},
|
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
|
|
|
{
|
|
|
|
type: Vertical,
|
|
|
|
vgap: 15,
|
|
|
|
invisible: true,
|
|
|
|
ref: (_ref: any) => {
|
|
|
|
this.advancedSet = _ref;
|
|
|
|
},
|
|
|
|
items: [
|
|
|
|
{
|
|
|
|
type: FormItemXtype,
|
|
|
|
nameWidth: 200,
|
|
|
|
name: 'OBJECT_FACTORIES',
|
|
|
|
value: contextHashtable['java.naming.factory.object'],
|
|
|
|
},
|
|
|
|
{
|
|
|
|
type: FormItemXtype,
|
|
|
|
nameWidth: 200,
|
|
|
|
name: 'STATE_FACTORIES',
|
|
|
|
value: contextHashtable['java.naming.factory.state'],
|
|
|
|
},
|
|
|
|
{
|
|
|
|
type: FormItemXtype,
|
|
|
|
nameWidth: 200,
|
|
|
|
name: 'URL_PKG_PREFIXES',
|
|
|
|
value: contextHashtable['java.naming.factory.url.pkgs'],
|
|
|
|
},
|
|
|
|
{
|
|
|
|
type: FormItemXtype,
|
|
|
|
nameWidth: 200,
|
|
|
|
name: 'DNS_URL',
|
|
|
|
value: contextHashtable['java.naming.dns.url'],
|
|
|
|
},
|
|
|
|
{
|
|
|
|
type: FormItemXtype,
|
|
|
|
nameWidth: 200,
|
|
|
|
name: 'AUTHORITATIVE',
|
|
|
|
value: contextHashtable['java.naming.authoritative'],
|
|
|
|
},
|
|
|
|
{
|
|
|
|
type: FormItemXtype,
|
|
|
|
nameWidth: 200,
|
|
|
|
name: 'BATCHSIZE',
|
|
|
|
value: contextHashtable['java.naming.batchsize'],
|
|
|
|
},
|
|
|
|
{
|
|
|
|
type: FormItemXtype,
|
|
|
|
nameWidth: 200,
|
|
|
|
name: 'REFERRAL',
|
|
|
|
value: contextHashtable['java.naming.referral'],
|
|
|
|
},
|
|
|
|
{
|
|
|
|
type: FormItemXtype,
|
|
|
|
nameWidth: 200,
|
|
|
|
name: 'SECURITY_PROTOCOL',
|
|
|
|
value: contextHashtable['java.naming.security.protocol'],
|
|
|
|
},
|
|
|
|
{
|
|
|
|
type: FormItemXtype,
|
|
|
|
nameWidth: 200,
|
|
|
|
name: 'SECURITY_AUTHENTICATION',
|
|
|
|
value: contextHashtable['java.naming.security.authentication'],
|
|
|
|
},
|
|
|
|
{
|
|
|
|
type: FormItemXtype,
|
|
|
|
nameWidth: 200,
|
|
|
|
name: 'LANGUAGE',
|
|
|
|
value: contextHashtable['java.naming.language'],
|
|
|
|
},
|
|
|
|
{
|
|
|
|
type: FormItemXtype,
|
|
|
|
nameWidth: 200,
|
|
|
|
name: 'APPLET',
|
|
|
|
value: contextHashtable['java.naming.applet'],
|
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
|
|
|
],
|
|
|
|
};
|
|
|
|
}
|
|
|
|
}
|