<?xml version="1.0" encoding="UTF-8" ?>
<!--
  ~ Copyright (c) DbVis Software AB. All Rights Reserved.
  -->

<!DOCTYPE DatabaseProfile SYSTEM "dbvis-defs.dtd">

<DatabaseProfile
        desc="Profile for Informix IDS"
        minver="9.5"
        extends="generic">

   <!-- =================================================================== -->
   <!-- Definition of the commands -->
   <!-- =================================================================== -->

   <Commands extends="true">
      <!-- =================================================================== -->
      <!-- Definition of the generic error handler (for all Commands). Its -->
      <!-- conditions will be evaluated with possible errors produced by each -->
      <!-- commands. If a match is found then the text in the <Message> -->
      <!-- element will be displayed in DbVisualizer. -->
      <!-- =================================================================== -->

      <OnError>
         <!--
           Need to explicitly check whether the connection has been interrupted
           outside DbVisualizer. The Informix driver thinks the connection is
           still live (Connection.isClosed() == false) even after method
           calls in the driver that apparantly cannot come through to the
           DB server.
         -->
         <If test="#result.getErrorCode() eq -79716" context="runtime">
            <Message>
               <![CDATA[
               Your Informix connection with the database server has been interrupted!
               Please <a href="connect" action="connect">connect</a> to re-establish the connection.
               ]]>
            </Message>
         </If>
      </OnError>

      <!--
        The "getTableNamesFor" command is used by Database getTableNamesFor().
        It must return table names for the catalog and schema named by
        the ${table_catalog} and ${table_catalog} variables in the first
        column.
      -->
      <Command id="informix.getTableNamesFor">
        <SQL>
          <![CDATA[
SELECT tabname
FROM  informix.systables
WHERE owner = '${table_schema}'
ORDER BY tabname
            ]]>
        </SQL>   
      </Command>

      <!--
        The "getColumnNamesFor" command is used by Database getColumnNamesFor().
        It must return column names for the catalog, schema and table named by
        the ${table_catalog}, ${table_catalog} and ${table_name} variables in
        the first column.
      -->
      <Command id="informix.getColumnNamesFor">
        <SQL>
          <![CDATA[
SELECT c.colname
FROM informix.syscolumns c, informix.systables t
WHERE t.tabid = c.tabid
  AND t.tabname = '${table_name}' AND t.owner = '${table_schema}'
ORDER BY c.colname
            ]]>
        </SQL>   
      </Command>


      <Command id="informix.getCatalogs">
         <SQL>
            <![CDATA[
SELECT
    *
FROM
    sysmaster:informix.sysdatabases
ORDER BY name
]]>
         </SQL>
      </Command>

      <Command id="informix.getTables">
         <SQL>
            <![CDATA[
SELECT
    '${catalog}' as tabcat,
    *
FROM
    informix.systables
WHERE
    tabtype   = 'T'
    and tabid > 99
    and owner like '${schema}'
    and tabname like '${table}'
ORDER BY
    tabname
            ]]>
         </SQL>
      </Command>

      <Command id="informix.getSystemTables">
         <SQL>
            <![CDATA[
SELECT
    *
FROM
    informix.systables
WHERE
    tabtype   = 'T'
    and tabid < 100
    and owner like '${schema}'
    and tabname like '${table}'
ORDER BY
    tabname
            ]]>
         </SQL>
      </Command>

      <Command id="informix.getViews">
         <SQL>
            <![CDATA[
SELECT
    *
FROM
    informix.systables
WHERE
    tabtype   = 'V'
    and tabid > 99
    and owner like '${schema}'
    and tabname like '${table}'
ORDER BY
    tabname
            ]]>
         </SQL>
      </Command>

      <Command id="informix.getSynonyms">
         <SQL>
            <![CDATA[
SELECT
    s.tabname synonym_name,
    s.owner synonym_owner,
    '' db_name,
    t.owner table_owner,
    t.tabname table_name,
    s.tabtype synonym_type
FROM
    informix.syssyntable c,
    informix.systables s,
    informix.systables t
WHERE
    s.tabid        = c.tabid
    and c.btabid   = t.tabid
    and s.tabtype in ('S', 'P')
UNION
SELECT
    s.tabname synonym_name,
    s.owner synonym_owner,
    c.dbname db_name,
    c.owner table_owner,
    c.tabname table_name,
    s.tabtype synonym_type
FROM
    informix.systables s,
    informix.syssyntable c
WHERE
    s.tabid = c.tabid
    and c.btabid is null
    and s.tabtype in ('S', 'P')
ORDER BY
    1
            ]]>
         </SQL>
      </Command>

      <Command id="informix.getTableTriggers">
         <SQL>
            <![CDATA[
SELECT
    tr.trigname,
    tr.owner,
    tr.trigid,
    case
       when tr.event in ('I', 'i') then 'insert'
       when tr.event in ('U', 'u') then 'update'
       when tr.event in ('D', 'd') then 'delete'
       else tr.event
    end event,
    t.owner tabowner,
    t.tabname,
    t.tabid,
    t.nrows,
    t.created
FROM
    informix.systriggers tr,
    informix.systables t
WHERE
    tr.tabid      = t.tabid
    and t.owner   = '${owner}'
    and t.tabname = '${table}'
ORDER BY
    tr.trigname
            ]]>
         </SQL>
      </Command>

     <Command id="informix.getProcPrivileges">
         <SQL>
            <![CDATA[
SELECT
    p.owner proc_schema,
    p.procname proc_name,
    a.grantor,
    a.grantee,
    'EXECUTE' privilege,
    'YES' is_grantable
FROM
    informix.sysprocedures p
JOIN
    informix.sysprocauth a
    ON p.procid = a.procid
WHERE
    p.procname = '${name}' AND p.owner = '${owner}' AND a.procauth = 'E'
UNION
SELECT
    p.owner proc_schemaa,
    p.procname proc_name,
    a.grantor,
    a.grantee,
    'EXECUTE' privilege,
    'NO' is_grantable
FROM
    informix.sysprocedures p
JOIN
    informix.sysprocauth a
    ON p.procid = a.procid
WHERE
    p.procname = '${name}' AND p.owner = '${owner}' AND a.procauth = 'e';            
            ]]>
         </SQL>
      </Command>

      <Command id="informix.getPrivileges">
         <SQL>
            <![CDATA[
SELECT
    t.owner table_schem,
    t.tabname table_name,
    a.grantor,
    a.grantee,
    'SELECT' privilege,
    'YES' is_grantable
FROM
    informix.systables t
JOIN
    informix.systabauth a
    ON t.tabid = a.tabid
WHERE
    t.tabname = '${name}' AND t.owner = '${owner}' AND a.tabauth LIKE '%S%'
UNION
SELECT
    t.owner table_schem,
    t.tabname table_name,
    a.grantor,
    a.grantee,
    'SELECT' privilege,
    'NO' is_grantable
FROM
    informix.systables t
JOIN
    informix.systabauth a
    ON t.tabid = a.tabid
WHERE
    t.tabname = '${name}' AND t.owner = '${owner}' AND a.tabauth LIKE '%s%'
UNION
SELECT
    t.owner table_schem,
    t.tabname table_name,
    a.grantor,
    a.grantee,
    'UPDATE' privilege,
    'YES' is_grantable
FROM
    informix.systables t
JOIN
    informix.systabauth a
    ON t.tabid = a.tabid
WHERE
    t.tabname = '${name}' AND t.owner = '${owner}' AND a.tabauth LIKE '%U%'
UNION
SELECT
    t.owner table_schem,
    t.tabname table_name,
    a.grantor,
    a.grantee,
    'UPDATE' privilege,
    'NO' is_grantable
FROM
    informix.systables t
JOIN
    informix.systabauth a
    ON t.tabid = a.tabid
WHERE
    t.tabname = '${name}' AND t.owner = '${owner}' AND a.tabauth LIKE '%u%'
UNION
SELECT
    t.owner table_schem,
    t.tabname table_name,
    a.grantor,
    a.grantee,
    'INSERT' privilege,
    'YES' is_grantable
FROM
    informix.systables t
JOIN
    informix.systabauth a
    ON t.tabid = a.tabid
WHERE
    t.tabname = '${name}' AND t.owner = '${owner}' AND a.tabauth LIKE '%I%'
UNION
SELECT
    t.owner table_schem,
    t.tabname table_name,
    a.grantor,
    a.grantee,
    'INSERT' privilege,
    'NO' is_grantable
FROM
    informix.systables t
JOIN
    informix.systabauth a
    ON t.tabid = a.tabid
WHERE
    t.tabname = '${name}' AND t.owner = '${owner}' AND a.tabauth LIKE '%i%'
UNION
SELECT
    t.owner table_schem,
    t.tabname table_name,
    a.grantor,
    a.grantee,
    'DELETE' privilege,
    'YES' is_grantable
FROM
    informix.systables t
JOIN
    informix.systabauth a
    ON t.tabid = a.tabid
WHERE
    t.tabname = '${name}' AND t.owner = '${owner}' AND a.tabauth LIKE '%D%'
UNION
SELECT
    t.owner table_schem,
    t.tabname table_name,
    a.grantor,
    a.grantee,
    'DELETE' privilege,
    'NO' is_grantable
FROM
    informix.systables t
JOIN
    informix.systabauth a
    ON t.tabid = a.tabid
WHERE
    t.tabname = '${name}' AND t.owner = '${owner}' AND a.tabauth LIKE '%d%'
UNION
SELECT
    t.owner table_schem,
    t.tabname table_name,
    a.grantor,
    a.grantee,
    'INDEX' privilege,
    'YES' is_grantable
FROM
    informix.systables t
JOIN
    informix.systabauth a
    ON t.tabid = a.tabid
WHERE
    t.tabname = '${name}' AND t.owner = '${owner}' AND a.tabauth LIKE '%X%'
UNION
SELECT
    t.owner table_schem,
    t.tabname table_name,
    a.grantor,
    a.grantee,
    'INDEX' privilege,
    'NO' is_grantable
FROM
    informix.systables t
JOIN
    informix.systabauth a
    ON t.tabid = a.tabid
WHERE
    t.tabname = '${name}' AND t.owner = '${owner}' AND a.tabauth LIKE '%x%'
UNION
SELECT
    t.owner table_schem,
    t.tabname table_name,
    a.grantor,
    a.grantee,
    'ALTER' privilege,
    'YES' is_grantable
FROM
    informix.systables t
JOIN
    informix.systabauth a
    ON t.tabid = a.tabid
WHERE
    t.tabname = '${name}' AND t.owner = '${owner}' AND a.tabauth LIKE '%A%'
UNION
SELECT
    t.owner table_schem,
    t.tabname table_name,
    a.grantor,
    a.grantee,
    'ALTER' privilege,
    'NO' is_grantable
FROM
    informix.systables t
JOIN
    informix.systabauth a
    ON t.tabid = a.tabid
WHERE
    t.tabname = '${name}' AND t.owner = '${owner}' AND a.tabauth LIKE '%a%'
UNION
SELECT
    t.owner table_schem,
    t.tabname table_name,
    a.grantor,
    a.grantee,
    'REFERENCES' privilege,
    'YES' is_grantable
FROM
    informix.systables t
JOIN
    informix.systabauth a
    ON t.tabid = a.tabid
WHERE
    t.tabname = '${name}' AND t.owner = '${owner}' AND a.tabauth LIKE '%R%'
UNION
SELECT
    t.owner table_schem,
    t.tabname table_name,
    a.grantor,
    a.grantee,
    'REFERENCES' privilege,
    'NO' is_grantable
FROM
    informix.systables t
JOIN
    informix.systabauth a
    ON t.tabid = a.tabid
WHERE
    t.tabname = '${name}' AND t.owner = '${owner}' AND a.tabauth LIKE '%r%'
            ]]>
         </SQL>
      </Command>

      <Command id="informix.getViewSource">
         <SQL>
            <![CDATA[
SELECT
    viewtext,
    v.seqno
FROM
    informix.systables t,
    sysviews v
WHERE
    t.tabid       = v.tabid
    and t.tabname = '${name}'
    and owner     = '${owner}'
ORDER BY
    v.seqno
            ]]>
         </SQL>
      </Command>

      <Command id="informix.getTriggers">
         <SQL>
            <![CDATA[
SELECT
    tr.trigname,
    tr.owner,
    tr.trigid,
    case
       when tr.event in ('I', 'i') then 'insert'
       when tr.event in ('U', 'u') then 'update'
       when tr.event in ('D', 'd') then 'delete'
       else tr.event
    end event,
    t.owner tabowner,
    t.tabname,
    t.tabid,
    t.nrows,
    t.created
FROM
    informix.systriggers tr,
    informix.systables t
WHERE
    tr.tabid = t.tabid
    AND t.tabname LIKE '${tableNamePattern}'
ORDER BY
    tr.trigname
            ]]>
         </SQL>
      </Command>

      <Command id="informix.getTriggerSource">
         <SQL>
            <![CDATA[
SELECT
    data,
    datakey,
    seqno
FROM
    informix.systrigbody
WHERE
    trigid       = ${trigid}
    and datakey in ('D', 'A')
ORDER BY
    datakey desc,
    seqno asc
            ]]>
         </SQL>
      </Command>
      
      <!-- Condition    "AND t.tabid >= 100" is introduced to exclude indexes on system tables  -->
      <Command id="informix.getIndexes">
         <SQL>
            <![CDATA[
SELECT
    i.idxname indexname,
    i.owner indexowner,
    i.idxtype type,
    i.clustered clustered,
    t.tabname,
    t.owner tabowner,
    t.ncols,
    t.nrows,
    t.created
FROM
    informix.sysindexes i,
    informix.systables t
WHERE
    i.tabid = t.tabid
    AND t.tabid >= 100
    AND i.idxname not in
    (
       SELECT
         c.idxname
       FROM
         informix.sysconstraints c
       WHERE
         c.tabid = t.tabid
       AND c.idxname is not null 
    )
    ${getIndexesCondition}
ORDER BY
    i.owner,
    i.idxname
            ]]>
         </SQL>
      </Command>

      <!-- Is this ugly or what? ;-) -->
      <Command id="informix.getIndexColumns">
         <SQL>
            <![CDATA[
select '1' position, c.colname  from informix.systables t, informix.sysindexes x, informix.syscolumns c
where t.tabid = x.tabid and x.tabid = c.tabid and c.colno = abs(x.part1) and
trim(x.idxname) = '${indexname}' and x.owner = '${indexowner}'
union
select '2' position, c.colname  from informix.systables t, informix.sysindexes x, informix.syscolumns c
where t.tabid = x.tabid and x.tabid = c.tabid and c.colno = abs(x.part2) and
trim(x.idxname) = '${indexname}' and x.owner = '${indexowner}'
union
select '3' position, c.colname  from informix.systables t, informix.sysindexes x, informix.syscolumns c
where t.tabid = x.tabid and x.tabid = c.tabid and c.colno = abs(x.part3) and
trim(x.idxname) = '${indexname}' and x.owner = '${indexowner}'
union
select '4' position, c.colname  from informix.systables t, informix.sysindexes x, informix.syscolumns c
where t.tabid = x.tabid and x.tabid = c.tabid and c.colno = abs(x.part4) and
trim(x.idxname) = '${indexname}' and x.owner = '${indexowner}'
union
select '5' position, c.colname  from informix.systables t, informix.sysindexes x, informix.syscolumns c
where t.tabid = x.tabid and x.tabid = c.tabid and c.colno = abs(x.part5) and
trim(x.idxname) = '${indexname}' and x.owner = '${indexowner}'
union
select '6' position, c.colname  from informix.systables t, informix.sysindexes x, informix.syscolumns c
where t.tabid = x.tabid and x.tabid = c.tabid and c.colno = abs(x.part6) and
trim(x.idxname) = '${indexname}' and x.owner = '${indexowner}'
union
select '7' position, c.colname  from informix.systables t, informix.sysindexes x, informix.syscolumns c
where t.tabid = x.tabid and x.tabid = c.tabid and c.colno = abs(x.part7) and
trim(x.idxname) = '${indexname}' and x.owner = '${indexowner}'
union
select '8' position, c.colname  from informix.systables t, informix.sysindexes x, informix.syscolumns c
where t.tabid = x.tabid and x.tabid = c.tabid and c.colno = abs(x.part8) and
trim(x.idxname) = '${indexname}' and x.owner = '${indexowner}'
union
select '9' position, c.colname  from informix.systables t, informix.sysindexes x, informix.syscolumns c
where t.tabid = x.tabid and x.tabid = c.tabid and c.colno = abs(x.part9) and
trim(x.idxname) = '${indexname}' and x.owner = '${indexowner}'
union
select '10' position, c.colname  from informix.systables t, informix.sysindexes x, informix.syscolumns c
where t.tabid = x.tabid and x.tabid = c.tabid and c.colno = abs(x.part10) and
trim(x.idxname) = '${indexname}' and x.owner = '${indexowner}'
union
select '11' position, c.colname  from informix.systables t, informix.sysindexes x, informix.syscolumns c
where t.tabid = x.tabid and x.tabid = c.tabid and c.colno = abs(x.part11) and
trim(x.idxname) = '${indexname}' and x.owner = '${indexowner}'
union
select '12' position, c.colname  from informix.systables t, informix.sysindexes x, informix.syscolumns c
where t.tabid = x.tabid and x.tabid = c.tabid and c.colno = abs(x.part12) and
trim(x.idxname) = '${indexname}' and x.owner = '${indexowner}'
union
select '13' position, c.colname  from informix.systables t, informix.sysindexes x, informix.syscolumns c
where t.tabid = x.tabid and x.tabid = c.tabid and c.colno = abs(x.part13) and
trim(x.idxname) = '${indexname}' and x.owner = '${indexowner}'
union
select '14' position, c.colname  from informix.systables t, informix.sysindexes x, informix.syscolumns c
where t.tabid = x.tabid and x.tabid = c.tabid and c.colno = abs(x.part14) and
trim(x.idxname) = '${indexname}' and x.owner = '${indexowner}'
union
select '15' position, c.colname  from informix.systables t, informix.sysindexes x, informix.syscolumns c
where t.tabid = x.tabid and x.tabid = c.tabid and c.colno = abs(x.part15) and
trim(x.idxname) = '${indexname}' and x.owner = '${indexowner}'
union
select '16' position, c.colname  from informix.systables t, informix.sysindexes x, informix.syscolumns c
where t.tabid = x.tabid and x.tabid = c.tabid and c.colno = abs(x.part16) and
trim(x.idxname) = '${indexname}' and x.owner = '${indexowner}'
            ]]>
         </SQL>
      </Command>

      <Command id="informix.getRoutines">
         <SQL>
            <If test="#util.isDatabaseVersionGTE(9)">
               <![CDATA[
SELECT
    procname,
    owner,
    procid,
    ifx_param_types(procid) param_types
FROM
    informix.sysprocedures
WHERE
    isproc = '${type}'
    AND mode IN ('D', 'O', 'R')
ORDER BY
    procname
               ]]>
            </If>
            <Else>
               <![CDATA[
SELECT
    procname,
    owner,
    procid,
    '' param_types
FROM
    informix.sysprocedures
WHERE
    mode IN ('D', 'O', 'R')
ORDER BY
    procname
               ]]>
            </Else>
         </SQL>
      </Command>

      <Command id="informix.getSystemRoutines">
         <SQL>
            <If test="#util.isDatabaseVersionGTE(9)">
               <![CDATA[
SELECT
    procname,
    owner,
    procid,
    ifx_param_types(procid) param_types
FROM
    informix.sysprocedures
WHERE
    isproc = '${type}'
    AND mode IN ('d', 'o', 'r', 'p', 'P')
ORDER BY
    procname
               ]]>
            </If>
            <Else>
               <![CDATA[
SELECT
    procname,
    owner,
    procid,
    '' param_types
FROM
    informix.sysprocedures
WHERE
    mode IN ('d', 'o', 'r', 'p', 'P')
ORDER BY
    procname
               ]]>
            </Else>
         </SQL>
      </Command>

      <Command id="informix.getRoutineSource">
         <SQL>
            <![CDATA[
SELECT
    data,
    seqno
FROM
    informix.sysprocbody
WHERE
    procid      = ${procid}
    and datakey = 'T'
ORDER BY
    seqno asc
            ]]>
         </SQL>
      </Command>

      <Command id="informix.getUsers">
         <SQL>
            <If test="#util.isDatabaseVersionGTE(10)">
               <![CDATA[
SELECT
    username user_name,
    defrole default_role
FROM
    informix.sysusers
WHERE
    usertype != 'G'
ORDER BY
    username
               ]]>
            </If>
            <Else>
               <![CDATA[
SELECT
    username user_name
FROM
    informix.sysusers
WHERE
    usertype != 'G'
ORDER BY
    username
               ]]>
            </Else>
         </SQL>
      </Command>

      <Command id="informix.getRoles">
         <SQL>
             <If test="#util.isDatabaseVersionGTE(10)">
               <![CDATA[
SELECT
    username group_name,
    defrole default_role
FROM
    informix.sysusers
WHERE
    usertype = 'G'
ORDER BY
    username
               ]]>
            </If>
            <Else>
               <![CDATA[
SELECT
    username group_name
FROM
    informix.sysusers
WHERE
    usertype = 'G'
ORDER BY
    username
               ]]>
            </Else>
         </SQL>
      </Command>

      <Command id="informix.getSequences">
         <SQL>
            <![CDATA[
SELECT
    t.tabname name,
    t.owner,
    s.*
FROM
    informix.syssequences s
JOIN
    informix.systables t
    ON
    t.tabid = s.tabid
ORDER BY
    t.tabname
            ]]>
         </SQL>
      </Command>

      <Command id="informix.getTypes">
         <SQL>
            <![CDATA[
SELECT
    name,
    owner,
    mode,
    type,
    maxlen,
    length,
    byvalue,
    cannothash,
    align,
    locator
FROM
    informix.sysxtdtypes
WHERE
    mode = '${type}'
ORDER BY
    name
            ]]>
         </SQL>
      </Command>

      <!-- ================================================================= -->
      <!-- DBA related commands requiring certain privileges in the database -->
      <!-- ================================================================= -->

      <Command id="informix.getServerInfo">
         <SQL>
            <![CDATA[
SELECT
    *
FROM
    sysmaster:informix.sysconfig
ORDER BY
    cf_name
            ]]>
         </SQL>
      </Command>

      <Command id="informix.getSessions">
         <SQL>
            <![CDATA[
SELECT
    sid,
    username,
    hostname,
    tty,
    extend(dbinfo('UTC_TO_DATETIME', connected), year to second) logintime
FROM
    sysmaster:informix.syssessions
ORDER BY
    sid
            ]]>
         </SQL>
      </Command>

      <Command id="informix.getSessionLocks">
         <SQL>
            <![CDATA[
SELECT
    owner,
    dbsname,
    tabname,
    rowidlk,
    keynum,
    type
FROM
    sysmaster:informix.syslocks,
    sysmaster:informix.syssessions
WHERE
    owner     = sid
    and owner = ${sid}
            ]]>
         </SQL>
      </Command>

      <Command id="informix.getSessionDiskIO">
         <SQL>
            <![CDATA[
SELECT
    syssesprof.sid,
    isreads,
    iswrites,
    isrewrites,
    isdeletes
FROM
    sysmaster:informix.syssesprof,
    sysmaster:informix.syssessions
WHERE
    syssesprof.sid      = syssessions.sid
    and syssessions.sid = ${sid}
            ]]>
         </SQL>
      </Command>

      <Command id="informix.getSpaces">
         <SQL>
            <![CDATA[
SELECT
    *
FROM
    sysmaster:informix.sysdbspaces
ORDER BY
    name
            ]]>
         </SQL>
      </Command>

      <Command id="informix.getSpacesSize">
         <SQL>
            <![CDATA[
SELECT
    name,
    count(*) chunks,
    sum(chksize) size,
    sum(nfree) free
FROM
    sysmaster:informix.syschunks,
    sysmaster:informix.sysdbspaces
WHERE
    syschunks.dbsnum = sysdbspaces.dbsnum
GROUP BY
    name
ORDER BY
    name
            ]]>
         </SQL>
      </Command>

      <Command id="informix.getSpacesChunks">
         <SQL>
            <![CDATA[
SELECT
    name,
    owner,
    fname,
    syschunks.dbsnum,
    chksize,
    nfree
FROM
    sysmaster:informix.syschunks,
    sysmaster:informix.sysdbspaces
WHERE
    syschunks.dbsnum = sysdbspaces.dbsnum
ORDER BY
    name
            ]]>
         </SQL>
      </Command>

      <Command id="informix.getChunks">
         <SQL>
            <![CDATA[
SELECT
    fname,
    chknum,
    chksize,
    is_offline,
    is_recovering,
    is_blobchunk,
    is_sbchunk,
    is_inconsistent
FROM
    sysmaster:informix.syschunks
WHERE
    dbsnum = ${dbsnum}
            ]]>
         </SQL>
      </Command>

   </Commands>

   <!-- =================================================================== -->
   <!-- Definition of the object actions that are used by the tree and views -->
   <!-- =================================================================== -->

   <ObjectsActionDef extends="false">

      <ActionGroup type="Databases">
         <Action id="informix-database-create" label="Create Database" reload="true"
                 resetcatalogs="true" icon="add">
            <Input label="New Database Name" name="newDatabase" style="text"/>
            <Input label="Location" name="location" style="list">
               <Values>
                  <Command>                    
                     <SQL>
                        <![CDATA[
select trim(name) from sysmaster:informix.sysdbspaces where name != 'sbspace' order by 1
                        ]]>
                     </SQL>
                  </Command>
               </Values>
            </Input>
            <Input label="Log Mode" name="logMode" style="radio">
               <Labels>None|ANSI|Buffered|Unbuffered</Labels>
               <Values>|with log mode ansi|with buffered log|with log</Values>
            </Input>
            <Command>
               <SQL><![CDATA[create database ${newDatabase} in ${location} ${logMode}]]></SQL>
            </Command>
            <Confirm>
               Confirm create of database ${newDatabase}?
            </Confirm>
            <Result>
               Database ${newDatabase} created!
            </Result>
         </Action>
      </ActionGroup>

      <ActionGroup type="Catalog">
         <Action id="informix-database-drop" label="Drop Database" reload="true"
                 resetcatalogs="true" icon="remove">
            <Input label="Database" style="text" editable="false">
               <Default>${catalog}</Default>
            </Input>
            <Command>
               <SQL>
                  <![CDATA[                  
database ${catalog};
close database;
drop database ${catalog};
database ${#db.loginDatabase};
                  ]]>
               </SQL></Command>
            <Confirm>
               Really drop database ${catalog}?
            </Confirm>
            <Result>
               database ${catalog} has been dropped!
            </Result>
         </Action>

         <Action id="informix-database-rename" label="Rename Database" reload="true" icon="rename">
            <Input label="Database" style="text" editable="false">
               <Default>${catalog}</Default>
            </Input>
            <Input label="New Database Name" name="newDatabase" style="text"/>
            <Command>
               <SQL>
                  <![CDATA[
database ${catalog};
close database;
rename database ${catalog} to ${newDatabase};
database ${#db.loginDatabase};
                  ]]>
               </SQL>
            </Command>
            <Confirm>
               Confirm rename of ${catalog} to ${newDatabase}?
            </Confirm>
            <Result>
               Database ${catalog} renamed to ${newDatabase}!
            </Result>
         </Action>
         <Action id="informix-schema-export" label="Export Database"
                 icon="export" reload="false"
                 class="schemaExport"
                 doclink="/doclink/export-schema"/>
      </ActionGroup>

      <ActionGroup type="Tables">
         <Action id="informix-tables-create-table" label="Create Table"
                 icon="add" reload="true"
                 class="tableCreate"
                 classargs="create"
                 doclink="/doclink/create-table"/>
         <Action id="informix-tables-import-table-data"
                 label="Import Table Data"
                 icon="import"
                 reload="true"
                 class="tableDataImport"
                 doclink="/doclink/import-table"/>
      </ActionGroup>

      <ActionGroup type="Table">
         <Action id="informix-tables-alter-table-new" label="Alter Table"
                 icon="edit" reload="true"
                 class="tableAlter"
                 classargs="alter"
                 doclink="/doclink/alter-table"/>

         <Action id="informix-table-rename" label="Rename Table" reload="true" icon="rename">
            <Input label="Schema" style="text" editable="false">
               <Default>${schema}</Default>
            </Input>
            <Input label="Table" style="text" editable="false">
               <Default>${objectname}</Default>
            </Input>
            <Input label="New Table Name" name="newTable" style="text"/>
            <Command>
               <SQL><![CDATA[rename table ${QBP}${schema}${QEP}.${QBP}${objectname}${QEP} to ${QB}${newTable}${QE}]]></SQL>
            </Command>
            <Confirm>
               Confirm rename of ${schema}.${objectname} to ${newTable}?
            </Confirm>
            <Result>
               Table ${schema}.${objectname} renamed to ${newTable}!
            </Result>
         </Action>

         <Action id="informix-table-clear" label="Empty Table" reload="true">
            <Input label="Schema" style="text" editable="false">
               <Default>${schema}</Default>
            </Input>
            <Input label="Table" style="text" editable="false">
               <Default>${objectname}</Default>
            </Input>
            <Input label="Use Command" name="useCommand" style="radio">
               <Values>TRUNCATE|DELETE</Values>
               <Default>TRUNCATE</Default>
            </Input>

            <SetVar name="_command" value="#useCommand.equals('TRUNCATE') ? 'truncate table' : 'delete from'"/>

            <Command>
               <SQL><![CDATA[${_command} ${QBP}${schema}${QEP}.${QBP}${objectname}${QEP}]]></SQL>
            </Command>
            <Confirm>
               Really remove all rows in table ${schema}.${objectname}?
            </Confirm>
            <Result>
               All rows in table ${schema}.${objectname} has been removed!
            </Result>
         </Action>

         <Action id="informix-table-drop" label="Drop Table" reload="true" icon="remove">
            <Input label="Schema" style="text" editable="false" >
               <Default>${schema}</Default>
            </Input>
            <Input label="Table" style="text" editable="false">
               <Default>${objectname}</Default>
            </Input>

            <Input label="Drop Dependent Object(s)" name="mode" style="radio"
                   tip="Automatically drop objects that depend on the table (such as views)">
               <Labels>(default)|Cascade|Restrict</Labels>
               <Values>|cascade|restrict</Values>
            </Input>
            <Command><SQL><![CDATA[drop table ${QBP}${schema}${QEP}.${QBP}${objectname}${QEP} ${mode}]]></SQL></Command>
            <Confirm>
               Really drop table ${schema}.${objectname}?
            </Confirm>
            <Result>
               Table ${schema}.${objectname} has been dropped!
            </Result>
         </Action>

         <Action id="informix-table-import-table-data" label="Import Table Data" icon="import"
                 class="tableDataImport"
                 doclink="/doclink/import-table"/>

         <Action id="informix-table-export" label="Export Table" icon="export"
                 class="tableExport"
                 doclink="/doclink/export-table"/>

         <Separator/>

         <Action id="informix-table-create-index" label="Create Index" reload="true">
            <Input label="Schema" style="text" editable="false">
               <Default>${schema}</Default>
            </Input>
            <Input label="Table" style="text" editable="false">
               <Default>${objectname}</Default>
            </Input>
            <Input label="Index Name" name="indexname" style="text"/>
            <Input label="Unique" name="unique" style="check">
               <Values>unique</Values>
            </Input>

            <Input label="Columns" style="separator"/>

            <Input name="columns" style="grid">
               <Arg name="output" value='${QBP}${columnname}${QEP}${_sortorder}'/>
               <Arg name="newline" value=", "/>

               <Input name="columnname" label="Column Name" style="list">
                  <Values column="4">
                     <Command idref="getColumnNamesFor">
                        <Input name="table_catalog" value="${catalog}"/>
                        <Input name="table_schema" value="${schema}"/>
                        <Input name="table_name" value="${objectname}"/>
                     </Command>
                  </Values>
                  <Default>${0}</Default>
               </Input>
               <Input name="sortorder" label="Sort Order" style="radio">
                  <Labels>ASC|DESC|Default</Labels>
                  <Values>ASC|DESC|</Values>
                  <Default>ASC</Default>
               </Input>
               <SetVar name="_sortorder" value='#sortorder.equals("") ? "" : " " + #sortorder'/>
            </Input>

            <SetVar name="_unique" value='#unique.equals("") ? "" : " " + #unique'/>
            <SetVar name="_columns" value='#columns.trim().equals("") ? "" : "(" + #columns + ")"'/>

            <Command>
               <SQL>
                  <![CDATA[create${_unique} index ${QB}${indexname}${QE} on ${QBP}${schema}${QEP}.${QBP}${objectname}${QEP} ${_columns}]]>
               </SQL>
            </Command>
            <Confirm>
               <![CDATA[Create index "${indexname}"?]]>
            </Confirm>
            <Result>
               <![CDATA[Index "${indexname}" created!]]>
            </Result>
         </Action>

         <Action id="informix-tabletrigger-create" label="Create Trigger" icon="add" reload="true"
                 doclink="/doclink/create-trigger">
            <Input label="Schema" style="text" editable="false">
               <Default>${schema}</Default>
            </Input>
            <Input label="Trigger" name="triggerName" style="text"/>
            <Input label="Trigger Time" name="triggerTime" style="radio">
               <Values>BEFORE|AFTER</Values>
               <Default>AFTER</Default>
            </Input>
            <Input label="Trigger Event" name="triggerEvent" style="radio">
               <Values>DELETE|INSERT|UPDATE</Values>
               <Default>INSERT</Default>
            </Input>
            <Input label="Table" style="text" editable="false">
               <Default>${objectname}</Default>
            </Input>
            <Input label="Source" style="separator"/>
            <Input name="source" style="text-editor">
               <Default><![CDATA[
    (insert into someTable (col1, col2) values(1, 2));]]>
               </Default>
            </Input>
            
            <Command exectype="asis">
               <SQL><![CDATA[
create trigger ${QB}${triggerName}${QE}
  ${triggerEvent}
  on ${QBP}${schema}${QEP}.${QBP}${objectname}${QEP} ${triggerTime} 
${source}]]>
               </SQL>
            </Command>
            <Result>
               <![CDATA[Trigger <b>${schema}.${triggerName}</b> created.]]>
            </Result>
         </Action>

         <Separator/>

         <Action id="informix-table-script" label="Script Table" icon="scriptObject"
                 class="sqlBuilder"
                 classargs="script-dialog,SELECT,SELECT *,INSERT,UPDATE,DELETE,CREATE,DROP"/>

      </ActionGroup>

      <ActionGroup type="SystemTable">
         <Action id="informix-systemtable-script" label="Script System Table" icon="scriptObject"
                 class="sqlBuilder"
                 classargs="script-dialog,SELECT,SELECT *"/>
      </ActionGroup>

      <ActionGroup type="View">
         <Action id="informix-view-drop" label="Drop View" reload="true" icon="remove">
            <Input label="Schema" style="text" editable="false">
               <Default>${schema}</Default>
            </Input>
            <Input label="View" style="text" editable="false">
               <Default>${objectname}</Default>
            </Input>
            <Input label="Mode" name="mode" style="radio">
               <Labels>(default)|Cascade|Restrict</Labels>
               <Values>|cascade|restrict</Values>
            </Input>
            <Command><SQL><![CDATA[drop view ${QBP}${schema}${QEP}.${QBP}${objectname}${QEP} ${mode}]]></SQL></Command>
            <Confirm>
               Really drop view ${schema}.${objectname}?
            </Confirm>
            <Result>
               View ${schema}.${objectname} has been dropped!
            </Result>
         </Action>

         <Action id="informix-view-export" label="Export View" icon="export"
                 class="viewExport"
                 doclink="/doclink/export-view"/>

         <Separator/>
         
         <Action id="informix-viewtrigger-create" label="Create Trigger" icon="add" reload="true"
                 doclink="/doclink/create-trigger">
            <Input label="Schema" style="text" editable="false">
               <Default>${schema}</Default>
            </Input>
            <Input label="Trigger" name="triggerName" style="text"/>
            <Input label="Trigger Time" name="triggerTime" style="radio" editable="false">
               <Values>INSTEAD OF</Values>
               <Default>INSTEAD OF</Default>
            </Input>
            <Input label="Trigger Event" name="triggerEvent" style="radio">
               <Values>DELETE|INSERT|UPDATE</Values>
               <Default>INSERT</Default>
            </Input>
            <Input label="View" style="text" editable="false">
               <Default>${objectname}</Default>
            </Input>
            <Input label="Source" style="separator"/>
            <Input name="source" style="text-editor">
               <Default><![CDATA[
    (insert into someTable (col1, col2) values(1, 2));]]>
               </Default>
            </Input>
            
            <Command exectype="asis">
               <SQL><![CDATA[
create trigger ${QB}${triggerName}${QE} 
  ${triggerTime} ${triggerEvent}
  on ${QBP}${schema}${QEP}.${QBP}${objectname}${QEP} 
  for each row
${source}]]>
               </SQL>
            </Command>
            <Result>
               <![CDATA[Trigger <b>${schema}.${triggerName}</b> created.]]>
            </Result>
         </Action>

         <Separator/>

         <Action id="informix-view-script" label="Script View" icon="scriptObject"
                 class="sqlBuilder"
                 classargs="script-dialog,SELECT,SELECT *,INSERT,UPDATE,DELETE,CREATE,DROP"/>

      </ActionGroup>

      <ActionGroup type="Index">
         <Action id="informix-index-drop" label="Drop Index" reload="true" icon="remove">
            <Input label="Schema" style="text" editable="false">
               <Default>${schema}</Default>
            </Input>
            <Input label="Index" style="text" editable="false">
               <Default>${objectname}</Default>
            </Input>
            <Command><SQL><![CDATA[drop index ${QBP}${schema}${QEP}.${QBP}${objectname}${QEP}]]></SQL></Command>
            <Confirm>
               Really drop index ${schema}.${objectname}?
            </Confirm>
            <Result>
               Index ${schema}.${objectname} dropped!
            </Result>
         </Action>

         <Action id="informix-index-rename" label="Rename Index" reload="true" icon="rename">
            <Input label="Schema" style="text" editable="false">
               <Default>${schema}</Default>
            </Input>
            <Input label="Index" style="text" editable="false">
               <Default>${objectname}</Default>
            </Input>
            <Input label="New Index Name" name="newIndex" style="text"/>
            <Command>
               <SQL><![CDATA[rename index ${QBP}${schema}${QEP}.${QBP}${objectname}${QEP} to ${QB}${newIndex}${QE}]]></SQL>
            </Command>
            <Confirm>
               Confirm rename of index ${schema}.${objectname} to ${newIndex}?
            </Confirm>
            <Result>
               Index ${objectname} renamed to ${newIndex}!
            </Result>
         </Action>

         <Action id="informix-index-enable" label="Enable Index" icon="enable">
            <Input label="Schema" style="text" editable="false">
               <Default>${schema}</Default>
            </Input>
            <Input label="Index" style="text" editable="false">
               <Default>${objectname}</Default>
            </Input>
            <Command>
               <SQL><![CDATA[set indexes ${QBP}${schema}${QEP}.${QBP}${objectname}${QEP} enabled]]></SQL>
            </Command>
            <Confirm>
               Enable index ${schema}.${objectname} ?
            </Confirm>
            <Result>
               Index ${schema}.${objectname} has been enabled!
            </Result>
         </Action>

         <Action id="informix-index-disable" label="Disable Index" icon="disable">
            <Input label="Schema" style="text" editable="false">
               <Default>${schema}</Default>
            </Input>
            <Input label="Index" style="text" editable="false">
               <Default>${objectname}</Default>
            </Input>
            <Command>
               <SQL><![CDATA[set indexes ${QBP}${schema}${QEP}.${QBP}${objectname}${QEP} disabled]]></SQL>
            </Command>
            <Confirm>
               Disable index ${schema}.${objectname} ?
            </Confirm>
            <Result>
               Index ${schema}.${objectname} has been disabled!
            </Result>
         </Action>

         <Separator/>

         <Action id="informix-index-script" label="Script Index" icon="scriptObject"
                 class="sqlBuilder"
                 classargs="script-dialog,CREATE,DROP"/>

      </ActionGroup>

      <ActionGroup type="Trigger">
         <Action id="informix-trigger-drop" label="Drop Trigger" reload="true" icon="remove">
            <Input label="Schema" style="text" editable="false">
               <Default>${schema}</Default>
            </Input>
            <Input label="Trigger" style="text" editable="false">
               <Default>${objectname}</Default>
            </Input>
            <Command><SQL><![CDATA[drop trigger ${QBP}${schema}${QEP}.${QBP}${objectname}${QEP}]]></SQL></Command>
            <Confirm>
               Really drop trigger ${schema}.${objectname}?
            </Confirm>
            <Result>
               Trigger ${schema}.${objectname} dropped!
            </Result>
         </Action>

         <Action id="informix-trigger-enable" label="Enable Trigger" icon="enable">
            <Input label="Schema" style="text" editable="false">
               <Default>${schema}</Default>
            </Input>
            <Input label="Trigger" style="text" editable="false">
               <Default>${objectname}</Default>
            </Input>
            <Command>
               <SQL><![CDATA[set triggers ${QBP}${schema}${QEP}.${QBP}${objectname}${QEP} enabled]]></SQL>
            </Command>
            <Confirm>
               Enable trigger ${schema}.${objectname} ?
            </Confirm>
            <Result>
               Trigger ${schema}.${objectname} has been enabled!
            </Result>
         </Action>

         <Action id="informix-trigger-disable" label="Disable Trigger" icon="disable">
            <Input label="Schema" style="text" editable="false">
               <Default>${schema}</Default>
            </Input>
            <Input label="Trigger" style="text" editable="false">
               <Default>${objectname}</Default>
            </Input>
            <Command>
               <SQL><![CDATA[set triggers ${QBP}${schema}${QEP}.${QBP}${objectname}${QEP} disabled]]></SQL>
            </Command>
            <Confirm>
               Disable trigger ${schema}.${objectname} ?
            </Confirm>
            <Result>
               Trigger ${schema}.${objectname} has been disabled!
            </Result>
         </Action>

         <Action id="informix-trigger-export" label="Export Trigger" icon="export"
                 class="triggerExport"
                 doclink="/doclink/export-code-object"/>

      </ActionGroup>

      <ActionGroup type="Procedures">
         <Action id="informix-procedures-create" label="Create Procedure" reload="true" icon="add"
                 doclink="/doclink/create-procedure">
            <Input label="Procedure Name" name="procedureName" style="text"/>

            <Input label="Parameters" style="separator"/>

            <Input name="parameters" style="grid">
               <Arg name="output" value="${direction} ${QB}${name}${QE} ${type}"/>
               <Arg name="newline" value=", "/>

               <Input name="name" label="Name" style="text">
                  <Default>parm</Default>
               </Input>
               <Input name="direction" label="Direction" style="list">
                  <Values>|INOUT|OUT</Values>
                  <Default>IN</Default>
               </Input>
               <Input name="type" label="Type" style="text">
                  <Default>VARCHAR(20)</Default>
               </Input>
            </Input>

            <SetVar name="_parameters" value='#parameters.trim().equals("") ? "()" : "(" + #parameters + ")"'/>
            <Command exectype="asis">
               <SQL>
                  <![CDATA[
CREATE PROCEDURE ${QB}${procedureName}${QE}
${_parameters}
BEGIN
  /* Procedure body */
END;
END PROCEDURE;
                  ]]>
               </SQL>
            </Command>
            <Confirm>
               Create procedure ${procedureName}?
            </Confirm>
            <Result>
               Procedure ${procedureName} created!
            </Result>
         </Action>
      </ActionGroup>
      
      <ActionGroup type="Procedure">
         <Action id="informix-procedure-drop" label="Drop Procedure" reload="true" icon="remove">
            <Input label="Schema" style="text" editable="false">
               <Default>${schema}</Default>
            </Input>
            <Input label="Procedure" style="text" editable="false">
               <Default>${objectname}</Default>
            </Input>
            <Command><SQL><![CDATA[drop procedure ${QBP}${schema}${QEP}.${QBP}${objectname}${QEP}]]></SQL></Command>
            <Confirm>
               Really drop procedure ${schema}.${objectname}?
            </Confirm>
            <Result>
               Procedure ${schema}.${objectname} dropped!
            </Result>
         </Action>

         <Action id="informix-procedure-export" label="Export Procedure" icon="export"
                 class="procedureExport"
                 doclink="/doclink/export-code-object"/>

         <Separator/>

         <Action id="informix-procedure-script" label="Script Procedure" icon="scriptObject"
                 class="sqlBuilder"
                 classargs="script-dialog,CALL,CREATE,DROP"/>

      </ActionGroup>

      <ActionGroup type="Functions">
         <Action id="informix-functions-create" label="Create Function" reload="true" icon="add"
                 doclink="/doclink/create-function">
            <Input label="Function Name" name="functionName" style="text"/>
            <Input label="Return Data Type" name="returns" style="text">
               <Default>VARCHAR(20)</Default>
            </Input>

            <Input label="Parameters" style="separator"/>

            <Input name="parameters" style="grid">
               <Arg name="output" value="${QB}${name}${QE} ${type}"/>
               <Arg name="newline" value=", "/>

               <Input name="name" label="Name" style="text">
                  <Default>parm</Default>
               </Input>
               <Input name="type" label="Type" style="text">
                  <Default>VARCHAR(20)</Default>
               </Input>
            </Input>

            <SetVar name="_parameters" value='#parameters.trim().equals("") ? "()" : "(" + #parameters + ")"'/>
            <Command exectype="asis">
               <SQL>
                  <![CDATA[
CREATE FUNCTION ${QB}${functionName}${QE}
${_parameters}
RETURNING ${returns}
  RETURN NULL;
END FUNCTION;
                  ]]>
               </SQL>
            </Command>
            <Confirm>
               Create function ${functionName}?
            </Confirm>
            <Result>
               Function ${functionName} created!
            </Result>
         </Action>
      </ActionGroup>
      
      <ActionGroup type="Function">
         <Action id="informix-function-drop" label="Drop Function" reload="true" icon="remove">
            <Input label="Schema" style="text" editable="false">
               <Default>${schema}</Default>
            </Input>
            <Input label="Function" style="text" editable="false">
               <Default>${objectname}</Default>
            </Input>
            <Command><SQL><![CDATA[drop function ${QBP}${schema}${QEP}.${QBP}${objectname}${QEP}(${informix.getRoutines.param_types})]]></SQL></Command>
            <Confirm>
               Really drop function ${schema}.${objectname}?
            </Confirm>
            <Result>
               Function ${schema}.${objectname} dropped!
            </Result>
         </Action>

         <Action id="informix-function-export" label="Export Function" icon="export"
                 class="functionExport"
                 doclink="/doclink/export-code-object"/>

         <Separator/>

         <Action id="informix-function-script" label="Script Function" icon="scriptObject"
                 class="sqlBuilder"
                 classargs="script-dialog,CALL,CREATE,DROP"/>
      </ActionGroup>

      <ActionGroup type="Sequences">
         <Action id="informix-sequences-create" label="Create Sequence" reload="true" icon="add">
            <Input label="Sequence Owner" name="owner" style="list">
               <Values>
                  <Command>
                     <SQL><![CDATA[select distinct trim(username) from informix.sysusers where usertype != 'G' order by 1]]></SQL>
                  </Command>
               </Values>
               <Default>${schema}</Default>
            </Input>
            <Input label="Sequence Name" name="sequenceName" style="text"/>
            <Input label="Start With" name="startWith" style="text">
               <Default>1</Default>
            </Input>
            <Input label="Increment By" name="increment" style="text">
               <Default>1</Default>
            </Input>
            <Input label="Cached Values" name="cache" style="text">
               <Default>20</Default>
            </Input>
            <Input label="Order" name="order" style="radio">
               <Values>Order|Noorder</Values>
               <Labels>Order|No Order</Labels>
               <Default>Noorder</Default>
            </Input>
            <Command><SQL><![CDATA[create sequence ${owner}.${QB}${sequenceName}${QE} start with ${startWith} increment by ${increment} nomaxvalue nominvalue cache ${cache} ${order}]]></SQL></Command>
            <Result>
               Sequence ${schema}.${sequenceName} created!
            </Result>
         </Action>
      </ActionGroup>

      <ActionGroup type="Sequence">
         <Action id="informix-sequence-drop" label="Drop Sequence" reload="true" icon="remove">
            <Input label="Schema" style="text" editable="false">
               <Default>${schema}</Default>
            </Input>
            <Input label="Sequence" style="text" editable="false">
               <Default>${objectname}</Default>
            </Input>
            <Command><SQL><![CDATA[drop sequence ${QBP}${schema}${QEP}.${QBP}${objectname}${QEP}]]></SQL></Command>
            <Confirm>
               Really drop sequence ${schema}.${objectname}?
            </Confirm>
            <Result>
               Sequence ${schema}.${objectname} dropped!
            </Result>
         </Action>

         <Action id="informix-sequence-rename" label="Rename Sequence" reload="true" icon="rename">
            <Input label="Schema" style="text" editable="false">
               <Default>${schema}</Default>
            </Input>
            <Input label="Sequence" style="text" editable="false">
               <Default>${objectname}</Default>
            </Input>
            <Input label="New Sequence Name" name="newSequence" style="text"/>
            <Command>
               <SQL><![CDATA[rename sequence ${QBP}${schema}${QEP}.${QBP}${objectname}${QEP} to ${QB}${newSequence}${QE}]]></SQL>
            </Command>
            <Confirm>
               Confirm rename of sequence ${objectname} to ${newSequence}?
            </Confirm>
            <Result>
               Sequence ${objectname} renamed to ${newSequence}!
            </Result>
         </Action>
      </ActionGroup>

      <ActionGroup type="Role">
         <Action id="informix-role-drop" label="Drop Role" reload="true" icon="remove">
            <Input label="Role" style="text" editable="false">
               <Default>${objectname}</Default>
            </Input>
            <Command><SQL><![CDATA[drop role ${QBP}${objectname}${QEP}]]></SQL></Command>
            <Confirm>
               Really drop role ${objectname}?
            </Confirm>
            <Result>
               Role ${objectname} has been dropped!
            </Result>
         </Action>
      </ActionGroup>

   </ObjectsActionDef>

   <!-- =================================================================== -->
   <!-- Definition of the database objects tree structure -->
   <!-- This def do not get any schema objects but present schema information -->
   <!-- for all nodes below catalogs i.e schema.objectname -->
   <!-- The getTables() call will also set the default catalog explicitly in the -->
   <!-- facade object for the catalog for which tables are going to be -->
   <!-- fetched. The reason is that the driver do not bother about the -->
   <!-- catalog argument to getTables() and instead determine the catalog -->
   <!-- from the default catalog setting. -->
   <!-- =================================================================== -->

   <ObjectsTreeDef extends="false">

      <GroupNode type="Databases" label="Databases">
         <DataNode type="Catalog" label="${informix.getCatalogs.TABLE_CAT}">
            <SetVar name="catalog" value="${informix.getCatalogs.TABLE_CAT}"/>
            <Command idref="informix.getCatalogs">
               <ProcessDataSet action="renamecolumn" index="name" value="TABLE_CAT"/>
               <ProcessDataSet action="trimcolumn" index="TABLE_CAT"/>
               <Filter index="TABLE_CAT" label="Name"/>
            </Command>

            <GroupNode type="Tables" label="Tables">
               <DataNode type="Table" label="${informix.getTables.TABLE_NAME}">
                  <SetVar name="schema" value="${informix.getTables.TABLE_SCHEM}"/>
                  <SetVar name="objectname" value="${informix.getTables.TABLE_NAME}"/>
                  <SetVar name="rowcount" value="true"/>
                  <SetVar name="acceptInQB" value="true"/>
                  <Command idref="informix.getTables">
                     <Input name="schema" value="%"/>
                     <Input name="table" value="%"/>
                     <ProcessDataSet action="renamecolumn" index="1" value="TABLE_CAT"/>
                     <ProcessDataSet action="renamecolumn" index="2" value="TABLE_NAME"/>
                     <ProcessDataSet action="renamecolumn" index="3" value="TABLE_SCHEM"/>
                     <Filter index="TABLE_SCHEM" label="Schema"/>
                  </Command>

                  <!-- Need to keep the objectname for the current table in
                       a new variable so that the viewers will be able to pick up
                       the correct input to display -->
                  <SetVar name="theTableName" value="${objectname}"/>

                  <GroupNode type="Columns" label="Columns">
                     <DataNode type="Column" label="${getColumnDefinitions.COLUMN_NAME}"
                               label1="${getColumnDefinitions.TYPE_NAME}"
                               isLeaf="true"
                               icon="#dataMap.get('getColumnDefinitions.IS_PRIMARY_KEY') eq true ? 'PrimaryKey' : 'Column'"
                               tip="#dataMap.get('getColumnDefinitions.IS_PRIMARY_KEY') eq true ? 'This is a primary key column' : ''">
                        <SetVar name="objectname" value="${getColumnDefinitions.COLUMN_NAME}"/>
                        <Command idref="getColumnDefinitions">
                           <Input name="schema" value="${schema}"/>
                           <Input name="objectname" value="${theTableName}"/>
                           <Input name="tableType" value="Table"/>
                           <Filter index="TYPE_NAME" label="Type"/>
                        </Command>
                     </DataNode>
                  </GroupNode>

                  <SetVar name="getIndexesCondition" value="and t.owner = '${schema}' and t.tabname = '${theTableName}'"/>

                  <GroupNode type="Indexes" label="Indexes">
                     <DataNode type="Index" label="${informix.getIndexes.indexname}"
                               label1="${informix.getIndexes.tabowner}.${informix.getIndexes.tabname}"
                               isLeaf="true">
                        <SetVar name="objectname" value="${informix.getIndexes.indexname}"/>
                        <SetVar name="schema" value="${informix.getIndexes.indexowner}"/>
                        <Command idref="informix.getIndexes">
                           <Input name="getIndexesCondition" value="${getIndexesCondition}"/>
                           <Filter index="tabname" label="Table Name"/>
                        </Command>
                     </DataNode>
                  </GroupNode>

                  <GroupNode type="Triggers" label="Triggers">
                     <DataNode type="Trigger" label="${informix.getTriggers.trigname}"
                               label1="${informix.getTriggers.event}: ${informix.getTriggers.tabowner}.${informix.getTriggers.tabname}"
                               isLeaf="true">
                        <SetVar name="schema" value="${informix.getTriggers.owner}"/>
                        <SetVar name="objectname" value="${informix.getTriggers.trigname}"/>
                        <Command idref="informix.getTriggers">
                           <Input name="tableNamePattern" value="${theTableName}"/>
                           <Filter index="tabname" label="Table Name"/>
                        </Command>
                     </DataNode>
                  </GroupNode>

                </DataNode>
            </GroupNode>

            <GroupNode type="SystemTables" label="System Tables">
               <DataNode type="SystemTable" label="${informix.getSystemTables.TABLE_NAME}"
                         label1="${informix.getSystemTables.TABLE_SCHEM}" isLeaf="true">
                  <SetVar name="schema" value="${informix.getSystemTables.TABLE_SCHEM}"/>
                  <SetVar name="objectname" value="${informix.getSystemTables.TABLE_NAME}"/>
                  <SetVar name="rowcount" value="true"/>
                  <SetVar name="acceptInQB" value="true"/>
                  <Command idref="informix.getSystemTables">
                     <Input name="schema" value="%"/>
                     <Input name="table" value="%"/>
                     <ProcessDataSet action="renamecolumn" index="1" value="TABLE_NAME"/>
                     <ProcessDataSet action="renamecolumn" index="2" value="TABLE_SCHEM"/>
                     <Filter index="TABLE_SCHEM" label="Schema"/>
                  </Command>
               </DataNode>
            </GroupNode>

            <GroupNode type="Views" label="Views">
               <DataNode type="View" label="${informix.getViews.TABLE_NAME}">
                  <SetVar name="schema" value="${informix.getViews.TABLE_SCHEM}"/>
                  <SetVar name="objectname" value="${informix.getViews.TABLE_NAME}"/>
                  <SetVar name="rowcount" value="true"/>
                  <SetVar name="acceptInQB" value="true"/>
                  <Command idref="informix.getViews">
                     <Input name="schema" value="%"/>
                     <Input name="table" value="%"/>
                     <ProcessDataSet action="renamecolumn" index="1" value="TABLE_NAME"/>
                     <ProcessDataSet action="renamecolumn" index="2" value="TABLE_SCHEM"/>
                     <Filter index="TABLE_SCHEM" label="Schema"/>
                  </Command>
                  
                  <!-- Need to keep the objectname for the current view in
                       a new variable so that the viewers will be able to pick up
                       the correct input to display -->
                  <SetVar name="theTableName" value="${objectname}"/>
                  
                  <GroupNode type="Columns" label="Columns">
                     <DataNode type="Column" label="${getColumnDefinitions.COLUMN_NAME}"
                               label1="${getColumnDefinitions.TYPE_NAME}"
                               isLeaf="true"
                               icon="#dataMap.get('getColumnDefinitions.IS_PRIMARY_KEY') eq true ? 'PrimaryKey' : 'Column'"
                               tip="#dataMap.get('getColumnDefinitions.IS_PRIMARY_KEY') eq true ? 'This is a primary key column' : ''">
                        <SetVar name="objectname" value="${getColumnDefinitions.COLUMN_NAME}"/>
                        <Command idref="getColumnDefinitions">
                           <Input name="schema" value="${schema}"/>
                           <Input name="objectname" value="${theTableName}"/>
                           <Input name="tableType" value="View"/>
                           <Filter index="TYPE_NAME" label="Type"/>
                        </Command>
                     </DataNode>
                  </GroupNode>

                  <GroupNode type="Triggers" label="Triggers">
                     <DataNode type="Trigger" label="${informix.getTriggers.trigname}"
                               label1="${informix.getTriggers.event}: ${informix.getTriggers.tabowner}.${informix.getTriggers.tabname}"
                               isLeaf="true">
                        <SetVar name="schema" value="${informix.getTriggers.owner}"/>
                        <SetVar name="objectname" value="${informix.getTriggers.trigname}"/>
                        <Command idref="informix.getTriggers">
                           <Input name="tableNamePattern" value="${theTableName}"/>
                           <Filter index="tabname" label="Table Name"/>
                        </Command>
                     </DataNode>
                  </GroupNode>
               </DataNode>
            </GroupNode>

            <GroupNode type="Synonyms" label="Synonyms">
               <DataNode type="Synonym" label="${informix.getSynonyms.synonym_name}"
                         label1="${informix.getSynonyms.table_owner}.${informix.getSynonyms.table_name}"
                         isLeaf="true">
                  <SetVar name="schema" value="${informix.getSynonyms.synonym_owner}"/>
                  <SetVar name="objectname" value="${informix.getSynonyms.synonym_name}"/>
                  <SetVar name="rowcount" value="true"/>
                  <SetVar name="acceptInQB" value="true"/>
                  <Command idref="informix.getSynonyms">
                     <Filter index="table_name" label="Table Name"/>
                  </Command>
               </DataNode>
            </GroupNode>

            <SetVar name="getIndexesCondition" value=""/>

            <GroupNode type="Indexes" label="Indexes">
               <DataNode type="Index" label="${informix.getIndexes.indexname}"
                         label1="${informix.getIndexes.tabowner}.${informix.getIndexes.tabname}"
                         isLeaf="true">
                  <SetVar name="schema" value="${informix.getIndexes.indexowner}"/>
                  <SetVar name="objectname" value="${informix.getIndexes.indexname}"/>
                  <Command idref="informix.getIndexes">
                     <Input name="getIndexesCondition" value=""/>
                     <Filter index="tabname" label="Table Name"/>
                  </Command>
               </DataNode>
            </GroupNode>

            <SetVar name="theTableName" value="%"/>
            <GroupNode type="Triggers" label="Triggers">
               <DataNode type="Trigger" label="${informix.getTriggers.trigname}"
                         label1="${informix.getTriggers.event}: ${informix.getTriggers.tabowner}.${informix.getTriggers.tabname}"
                         isLeaf="true">
                  <SetVar name="schema" value="${informix.getTriggers.owner}"/>
                  <SetVar name="objectname" value="${informix.getTriggers.trigname}"/>
                  <Command idref="informix.getTriggers">
                     <Input name="tableNamePattern" value="${theTableName}"/>
                     <Filter index="tabname" label="Table Name"/>
                  </Command>
               </DataNode>
            </GroupNode>

            <GroupNode type="Procedures" label="Procedures">
               <DataNode type="Procedure" label="${informix.getRoutines.procname} (${informix.getRoutines.param_types})"
                         isLeaf="true">
                  <SetVar name="schema" value="${informix.getRoutines.owner}"/>
                  <SetVar name="objectname" value="${informix.getRoutines.procname}"/>
                  <SetVar name="getDDLName" value="${informix.getRoutines.procname} (${informix.getRoutines.param_types})"/>
                  <Command idref="informix.getRoutines">
                     <Input name="type" value="t"/>
                  </Command>
               </DataNode>
            </GroupNode>

            <GroupNode type="SystemProcedures" label="System Procedures">
               <DataNode type="SystemProcedure" label="${informix.getSystemRoutines.procname} (${informix.getSystemRoutines.param_types})"
                         isLeaf="true">
                  <SetVar name="schema" value="${informix.getSystemRoutines.owner}"/>
                  <SetVar name="objectname" value="${informix.getSystemRoutines.procname}"/>
                  <Command idref="informix.getSystemRoutines">
                     <Input name="type" value="t"/>
                  </Command>
               </DataNode>
            </GroupNode>

             <If test="#util.isDatabaseVersionGTE(9)">
               <GroupNode type="Functions" label="Functions">
                  <DataNode type="Function" label="${informix.getRoutines.procname} (${informix.getRoutines.param_types})"
                            isLeaf="true">
                     <SetVar name="schema" value="${informix.getRoutines.owner}"/>
                     <SetVar name="objectname" value="${informix.getRoutines.procname}"/>
                     <SetVar name="getDDLName" value="${informix.getRoutines.procname} (${informix.getRoutines.param_types})"/>
                     <Command idref="informix.getRoutines">
                        <Input name="type" value="f"/>
                     </Command>
                  </DataNode>
               </GroupNode>

               <GroupNode type="SystemFunctions" label="System Functions">
                  <DataNode type="SystemFunction" label="${informix.getSystemRoutines.procname} (${informix.getSystemRoutines.param_types})"
                            isLeaf="true">
                     <SetVar name="schema" value="${informix.getSystemRoutines.owner}"/>
                     <SetVar name="objectname" value="${informix.getSystemRoutines.procname}"/>
                     <Command idref="informix.getSystemRoutines">
                        <Input name="type" value="f"/>
                     </Command>
                  </DataNode>
               </GroupNode>

               <GroupNode type="Sequences" label="Sequences">
                  <DataNode type="Sequence" label="${informix.getSequences.name}" isLeaf="true">
                     <SetVar name="schema" value="${informix.getSequences.owner}"/>
                     <SetVar name="objectname" value="${informix.getSequences.name}"/>
                     <Command idref="informix.getSequences">
                        <Filter index="owner" label="Schema"/>
                     </Command>
                  </DataNode>
               </GroupNode>

               <GroupNode type="DataTypes" label="Data Types" isLeaf="true"/>
            </If>

            <GroupNode type="Users" label="Users" isLeaf="false">
               <DataNode type="User" label="${informix.getUsers.user_name}" isLeaf="true">
                  <SetVar name="objectname" value="${informix.getUsers.user_name}"/>
                  <Command idref="informix.getUsers"/>
               </DataNode>
            </GroupNode>

            <GroupNode type="Roles" label="Roles" isLeaf="false">
               <DataNode type="Role" label="${informix.getRoles.group_name}" isLeaf="true">
                  <SetVar name="objectname" value="${informix.getRoles.group_name}"/>
                  <Command idref="informix.getRoles"/>
               </DataNode>
            </GroupNode>
         </DataNode>
      </GroupNode>

      <!-- ================================================================= -->
      <!-- DBA Nodes -->
      <!-- ================================================================= -->

      <GroupNode type="DBA" label="DBA Views">

         <GroupNode type="ServerInfo" label="Server Info" isLeaf="true"/>

         <GroupNode type="Sessions" label="Sessions">
            <DataNode type="Session" label="#${informix.getSessions.sid}"
                      label1="${informix.getSessions.username}"
                      isLeaf="true">
               <SetVar name="objectname" value="${informix.getSessions.sid}"/>
               <Command idref="informix.getSessions"/>
            </DataNode>
         </GroupNode>

         <GroupNode type="Spaces" label="Spaces">
            <DataNode type="Space" label="${informix.getSpaces.name}" isLeaf="true">
               <SetVar name="objectname" value="${informix.getSpaces.name}"/>
               <Command idref="informix.getSpaces"/>
            </DataNode>
         </GroupNode>

      </GroupNode>

   </ObjectsTreeDef>

   <!-- =================================================================== -->
   <!-- Definition of the database objects views -->
   <!-- =================================================================== -->

   <ObjectsViewDef extends="true">

      <ObjectView type="Databases">
         <DataView id="informix-databases-databases" icon="Databases" label="Databases" viewer="grid">
            <Command idref="informix.getCatalogs"/>
         </DataView>
      </ObjectView>

      <ObjectView type="Catalog">
         <DataView id="generic-catalog-tables" drop-on-condition="always"/>
         <DataView id="generic-catalog-references" drop-on-condition="always"/>
      </ObjectView>

      <ObjectView type="Tables">
         <DataView id="generic-tables-tables" drop-on-condition="always"/>
         <DataView id="generic-tables-references" drop-on-condition="always"/>

         <DataView id="informix-tables-tables" icon="Tables" label="Tables" viewer="grid">
            <Input name="menuItem" value="Open in New Tab...">
               <Input name="action" value="open-object-in-new-tab-command ${schema||owner}${object||tabname}"/>
            </Input>
            <Input name="menuItem" value="Open in Floating Tab...">
               <Input name="action" value="open-object-in-floating-tab-command ${schema||owner}${object||tabname}"/>
            </Input>
            <Input name="menuItem" value="Script: SELECT ALL">
               <Input name="command" value="select * from ${schema||owner}${object||tabname}"/>
            </Input>
            <Input name="menuItem" value="Script: DROP TABLE">
               <Input name="command" value="drop table ${schema||owner}${object||tabname}"/>
            </Input>

            <Command idref="informix.getTables">
               <Input name="schema" value="%"/>
               <Input name="table" value="%"/>
            </Command>
         </DataView>
         <DataView id="informix-tables-references" icon="References" label="References" viewer="tables-refs"
                   doclink="/doclink/show-references">
            <Command idref="informix.getTables">
               <Input name="schema" value="%"/>
               <Input name="table" value="%"/>
               <ProcessDataSet action="renamecolumn" index="tabcat" value="TABLE_CAT"/>
               <ProcessDataSet action="renamecolumn" index="owner" value="TABLE_SCHEM"/>
               <ProcessDataSet action="renamecolumn" index="tabname" value="TABLE_NAME"/>
            </Command>
         </DataView>
      </ObjectView>

      <ObjectView type="Table">
         <DataView id="generic-table-info" drop-on-condition="always"/>
         <DataView id="generic-table-grants" drop-on-condition="always"/>

         <DataView id="informix-table-info" icon="Info" label="Info" viewer="form" order-before="0">
            <Command idref="informix.getTables">
               <Input name="schema" value="${schema}"/>
               <Input name="table" value="${objectname}"/>
            </Command>
         </DataView>

         <DataView id="informix-table-grants" icon="TablePrivileges" label="Grants" viewer="grid">
            <Command idref="informix.getPrivileges">
               <Input name="owner" value="${schema}"/>
               <Input name="name" value="${objectname}"/>
            </Command>
         </DataView>

         <DataView id="generic-table-ddl" order-after="informix-table-grants">
            <Input name="formatSQL" value="true"/>
            <Message/>
         </DataView>

         <!-- Add the Trigger view -->
         <DataView id="informix-table-triggers" icon="Trigger" label="Triggers" viewer="form">
            <Command idref="informix.getTableTriggers">
               <Input name="owner" value="${schema}"/>
               <Input name="table" value="${objectname}"/>
               <Input name="catalog" value="${catalog}"/>
            </Command>
         </DataView>
      </ObjectView>

      <ObjectView type="Columns">
         <DataView id="generic-columns-columns" drop-on-condition="always"/>

         <DataView id="informix-columns-columns" icon="Columns" label="Columns" viewer="grid">
            <Command idref="getColumns">
               <Input name="catalog" value="${catalog}"/>
               <Input name="schema" value="${schema}"/>
               <Input name="objectname" value="${objectname}"/>
            </Command>
         </DataView>
      </ObjectView>

      <ObjectView type="Column">
         <DataView id="generic-column-column" drop-on-condition="always"/>

         <DataView id="informix-column-column" icon="Column" label="Column" viewer="node-form"/>
      </ObjectView>

      <ObjectView type="SystemTables">
         <DataView id="informix-systemtables-systemtables" icon="SystemTables" label="SystemTables" viewer="grid">
            <Input name="menuItem" value="Open in New Tab...">
               <Input name="action" value="open-object-in-new-tab-command ${schema||owner}${object||tabname}"/>
            </Input>
            <Input name="menuItem" value="Open in Floating Tab...">
               <Input name="action" value="open-object-in-floating-tab-command ${schema||owner}${object||tabname}"/>
            </Input>
            <Input name="menuItem" value="Script: SELECT ALL">
               <Input name="command" value="select * from ${schema||owner}${object||tabname}"/>
            </Input>

            <Command idref="informix.getSystemTables">
               <Input name="schema" value="%"/>
               <Input name="table" value="%"/>
            </Command>
         </DataView>
      </ObjectView>

      <ObjectView type="SystemTable">
         <DataView id="informix-systemtable-info" icon="Info" label="Info" viewer="form">
            <Command idref="informix.getSystemTables">
               <Input name="schema" value="${schema}"/>
               <Input name="table" value="${objectname}"/>
            </Command>
         </DataView>
         <DataView id="informix-systemtable-columns" icon="Columns" label="Columns" viewer="grid">
            <Command idref="getColumns">
               <Input name="catalog" value="${catalog}"/>
               <Input name="schema" value="${schema}"/>
               <Input name="objectname" value="${objectname}"/>
            </Command>
         </DataView>
         <DataView id="informix-systemtable-data" icon="Data" label="Data" viewer="table-data" doclink="/doclink/table-data">
            <Input name="editDisabled" value="true"/>
         </DataView>
         <DataView id="informix-systemtable-rowcount" icon="RowCount" label="Row Count" viewer="table-rowcount"/>
          <DataView id="informix-systemtable-grants" icon="TablePrivileges" label="Grants" viewer="grid">
            <Command idref="informix.getPrivileges">
               <Input name="owner" value="${schema}"/>
               <Input name="name" value="${objectname}"/>
            </Command>
         </DataView>
      </ObjectView>

      <ObjectView type="Views">
         <DataView id="informix-views-views" icon="Views" label="Views" viewer="grid">
            <Input name="menuItem" value="Open in New Tab...">
               <Input name="action" value="open-object-in-new-tab-command ${schema||owner}${object||tabname}"/>
            </Input>
            <Input name="menuItem" value="Open in Floating Tab...">
               <Input name="action" value="open-object-in-floating-tab-command ${schema||owner}${object||tabname}"/>
            </Input>
            <Input name="menuItem" value="Script: SELECT ALL">
               <Input name="command" value="select * from ${schema||owner}${object||tabname}"/>
            </Input>
            <Input name="menuItem" value="Script: DROP VIEW">
               <Input name="command" value="drop view ${schema||owner}${object||tabname}"/>
            </Input>

            <Command idref="informix.getViews">
               <Input name="schema" value="%"/>
               <Input name="table" value="%"/>
            </Command>
         </DataView>
      </ObjectView>

      <ObjectView type="View">
         <DataView id="informix-view-info" icon="Info" label="Info" viewer="form">
            <Command idref="informix.getViews">
               <Input name="schema" value="${schema}"/>
               <Input name="table" value="${objectname}"/>
            </Command>
         </DataView>
         <DataView id="informix-view-columns" icon="Columns" label="Columns" viewer="grid">
            <Command idref="getColumns">
               <Input name="catalog" value="${catalog}"/>
               <Input name="schema" value="${schema}"/>
               <Input name="objectname" value="${objectname}"/>
            </Command>
         </DataView>
         <DataView id="informix-view-data" icon="Data" label="Data" viewer="table-data" doclink="/doclink/table-data"/>
         <DataView id="informix-view-rowcount" icon="RowCount" label="Row Count" viewer="table-rowcount"/>
         <DataView id="informix-view-grants" icon="TablePrivileges" label="Grants" viewer="grid">
            <Command idref="informix.getPrivileges">
               <Input name="owner" value="${schema}"/>
               <Input name="name" value="${objectname}"/>
            </Command>
         </DataView>
         <DataView id="informix-view-ddl" icon="Source" label="DDL" viewer="ddl">
            <Input name="objectType" value="View"/>
            <Input name="formatSQL" value="true"/>
         </DataView>
      </ObjectView>

      <ObjectView type="Synonyms">
         <DataView id="informix-synonyms-synonyms" icon="Synonyms" label="Synonyms" viewer="grid">
            <Command idref="informix.getSynonyms"/>
         </DataView>
      </ObjectView>

      <ObjectView type="Synonym">
         <DataView id="informix-synonym-info" icon="Info" label="Info" viewer="node-form"/>
      </ObjectView>

      <ObjectView type="Indexes">
         <DataView id="generic-indexes-indexes" drop-on-condition="always"/>

         <DataView id="informix-indexes-indexes" icon="Indexes" label="Indexes" viewer="grid">
            <Command idref="informix.getIndexes">
               <Input name="getIndexesCondition" value="${getIndexesCondition}"/>
            </Command>
         </DataView>
      </ObjectView>

      <ObjectView type="Index">
         <DataView id="generic-index-columns" drop-on-condition="always"/>

         <DataView id="informix-index-columns" icon="Columns" label="Columns" viewer="grid">
            <Command idref="informix.getIndexColumns">
               <Input name="indexowner" value="${schema}"/>
               <Input name="indexname" value="${objectname}"/>
            </Command>
         </DataView>
         <DataView id="informix-index-ddl" icon="Source" label="DDL" viewer="ddl">
            <Input name="objectType" value="Index"/>
            <Input name="formatSQL" value="true"/>
         </DataView>
      </ObjectView>

      <ObjectView type="Triggers">
         <DataView id="informix-triggers-triggers" icon="Triggers" label="Triggers" viewer="grid">
            <Command idref="informix.getTriggers">
               <Input name="tableNamePattern" value="${theTableName}"/>
             </Command>
         </DataView>
      </ObjectView>

      <ObjectView type="Trigger">
         <DataView classargs="TRIGGER" id="informix-trigger-triggereditor" icon="SourceEditor" label="Trigger Editor" viewer="procedure-editor"
                   doclink="/doclink/edit-code-object"/>

         <DataView id="informix-trigger-info" icon="Info" label="Info" viewer="node-form"/>
<!--         
         <DataView type="Source" label="Source" viewer="text">
            <Input name="dataColumn" value="data"/>
            <Input name="formatSQL" value="true"/>

            <Command idref="informix.getTriggerSource">
               <Input name="trigid" value="${informix.getTriggers.trigid}"/>
            </Command>
         </DataView>
-->         
      </ObjectView>

      <ObjectView type="Functions">
         <DataView id="informix-functions-functions" icon="Functions" label="Functions" viewer="grid">
            <Command idref="informix.getRoutines">
               <Input name="type" value="f"/>
            </Command>
         </DataView>
      </ObjectView>

      <ObjectView type="SystemFunctions">
         <DataView id="informix-systemfunctions-systemfunctions" icon="SystemFunctions" label="System Functions" viewer="grid">
            <Command idref="informix.getSystemRoutines">
               <Input name="type" value="f"/>
            </Command>
         </DataView>
      </ObjectView>

      <ObjectView type="Function">
         <DataView classargs="FUNCTION" id="informix-function-functioneditor" icon="SourceEditor" label="Function Editor" viewer="procedure-editor"
                   doclink="/doclink/edit-code-object">
         </DataView>          
         <DataView id="informix-function-info" icon="Info" label="Info" viewer="node-form"/>
         <DataView id="informix-function-columns" icon="Columns" label="Columns" viewer="grid">
            <Command idref="getProcedureColumns">
               <Input name="catalog" value="${catalog}"/>
               <Input name="schema" value="${schema}"/>
               <Input name="objectname" value="${objectname}"/>
            </Command>
         </DataView>
<!--         
         <DataView type="Source" label="Source" viewer="text">
            <Input name="dataColumn" value="data"/>
            <Input name="formatSQL" value="false"/>

            <Command idref="informix.getRoutineSource">
               <Input name="procid" value="${informix.getRoutines.procid}"/>
            </Command>
         </DataView>
-->         
      </ObjectView>

      <ObjectView type="SystemFunction">
         <DataView id="informix-systemfunction-source" icon="Source" label="Source" viewer="text">
            <Input name="dataColumn" value="data"/>
            <Input name="formatSQL" value="false"/>

            <Command idref="informix.getRoutineSource">
               <Input name="procid" value="${informix.getSystemRoutines.procid}"/>
            </Command>
         </DataView>
         <DataView id="informix-systemfunction-info" icon="Info" label="Info" viewer="node-form"/>
         <DataView id="informix-systemfunction-columns" icon="Columns" label="Columns" viewer="grid">
            <Command idref="getProcedureColumns">
               <Input name="catalog" value="${catalog}"/>
               <Input name="schema" value="${schema}"/>
               <Input name="procedure" value="${objectname}"/>
            </Command>
         </DataView>
      </ObjectView>

      <ObjectView type="Procedures">
         <DataView id="generic-procedures-procedures" drop-on-condition="always"/>

         <DataView id="informix-procedures-procedures" icon="Procedures" label="Procedures" viewer="grid">
            <Command idref="informix.getRoutines">
               <Input name="type" value="t"/>
            </Command>
         </DataView>
      </ObjectView>

      <ObjectView type="SystemProcedures">
         <DataView id="informix-systemprocedures-systemprocedures" icon="SystemProcedures" label="System Procedures" viewer="grid">
            <Command idref="informix.getSystemRoutines">
               <Input name="type" value="t"/>
            </Command>
         </DataView>
      </ObjectView>

      <ObjectView type="Procedure">
         <DataView id="generic-procedure-columns" drop-on-condition="always"/>

         <DataView classargs="PROCEDURE" id="informix-procedure-procedureeditor" icon="SourceEditor" label="Procedure Editor" viewer="procedure-editor"
                   doclink="/doclink/edit-code-object"/>
         <DataView id="informix-procedure-info" icon="Info" label="Info" viewer="node-form"/>
         <DataView id="informix-procedure-columns" icon="Columns" label="Columns" viewer="grid">
            <Command idref="getProcedureColumns">
               <Input name="catalog" value="${catalog}"/>
               <Input name="schema" value="${schema}"/>
               <Input name="objectname" value="${objectname}"/>
            </Command>
         </DataView>
         <DataView id="informix-procedure-grants" icon="TablePrivileges" label="Grants" viewer="grid">
            <Command idref="informix.getProcPrivileges">
               <Input name="owner" value="${schema}"/>
               <Input name="name" value="${objectname}"/>
            </Command>
         </DataView>
         
<!--         
         <DataView type="Source" label="Source" viewer="text">
            <Input name="dataColumn" value="data"/>
            <Input name="formatSQL" value="false"/>

            <Command idref="informix.getRoutineSource">
               <Input name="procid" value="${informix.getRoutines.procid}"/>
            </Command>
         </DataView>
-->         
      </ObjectView>

      <ObjectView type="SystemProcedure">
         <DataView id="informix-systemprocedure-source" icon="Source" label="Source" viewer="text">
            <Input name="dataColumn" value="data"/>
            <Input name="formatSQL" value="false"/>

            <Command idref="informix.getRoutineSource">
               <Input name="procid" value="${informix.getSystemRoutines.procid}"/>
            </Command>
         </DataView>
         <DataView id="informix-systemprocedure-info" icon="Info" label="Info" viewer="node-form"/>
         <DataView id="informix-systemprocedure-columns" icon="Columns" label="Columns" viewer="grid">
            <Command idref="getProcedureColumns">
               <Input name="catalog" value="${catalog}"/>
               <Input name="schema" value="${schema}"/>
               <Input name="objectname" value="${objectname}"/>
            </Command>
         </DataView>
      </ObjectView>

      <ObjectView type="Sequences">
         <DataView id="informix-sequences-sequences" icon="Sequences" label="Sequences" viewer="grid">
            <Command idref="informix.getSequences"/>
         </DataView>
      </ObjectView>

      <ObjectView type="Sequence">
         <DataView id="informix-sequence-info" icon="Info" label="Info" viewer="node-form"/>
      </ObjectView>

      <ObjectView type="DataTypes">
         <DataView id="informix-datatypes-opaquetypes" icon="DataType" label="Opaque Types" viewer="grid">
            <Command idref="informix.getTypes">
               <Input name="type" value="B"/>
            </Command>
         </DataView>
         <DataView id="informix-datatypes-collectiontypes" icon="DataType" label="Collection Types" viewer="grid">
            <Command idref="informix.getTypes">
               <Input name="type" value="C"/>
            </Command>
         </DataView>
         <DataView id="informix-datatypes-distincttypes" icon="DataType" label="Distinct Types" viewer="grid">
            <Command idref="informix.getTypes">
               <Input name="type" value="D"/>
            </Command>
         </DataView>
      </ObjectView>

      <ObjectView type="Users">
         <DataView id="informix-users-users" icon="Users" label="Users" viewer="grid">
            <Command idref="informix.getUsers"/>
         </DataView>
      </ObjectView>

      <ObjectView type="User">
         <DataView id="informix-user-info" icon="Info" label="Info" viewer="node-form"/>
      </ObjectView>

      <ObjectView type="Roles">
         <DataView id="informix-roles-roles" icon="Roles" label="Roles" viewer="grid">
            <Command idref="informix.getRoles"/>
         </DataView>
      </ObjectView>

      <ObjectView type="Role">
         <DataView id="informix-role-info" icon="Info" label="Info" viewer="node-form"/>
      </ObjectView>

      <!-- DBA views -->

      <ObjectView type="ServerInfo">
         <DataView id="informix-serverinfo-serverinfo" icon="Info" label="Server Info" viewer="grid">
            <Command idref="informix.getServerInfo"/>
         </DataView>
      </ObjectView>

      <ObjectView type="Sessions">
         <DataView id="informix-sessions-sessions" icon="Sessions" label="Sessions" viewer="grid">
            <Command idref="informix.getSessions"/>
         </DataView>
      </ObjectView>

      <ObjectView type="Session">
         <DataView id="informix-session-info" icon="Info" label="Info" viewer="node-form"/>
         <DataView id="informix-session-locks" icon="Locks" label="Locks" viewer="grid">
            <Command idref="informix.getSessionLocks">
               <Input name="sid" value="${objectname}"/>
            </Command>
         </DataView>
         <DataView id="informix-session-diskio" icon="DiskIO" label="Disk I/O" viewer="grid">
            <Command idref="informix.getSessionDiskIO">
               <Input name="sid" value="${objectname}"/>
            </Command>
         </DataView>
      </ObjectView>

      <ObjectView type="Spaces">
         <DataView id="informix-spaces-spaces" icon="Spaces" label="Spaces" viewer="grid">
            <Command idref="informix.getSpaces"/>
         </DataView>
         <DataView id="informix-spaces-chunks" icon="Chunks" label="Chunks" viewer="grid">
            <Command idref="informix.getSpacesChunks"/>
         </DataView>
         <DataView id="informix-spaces-size" icon="Statistics" label="Size" viewer="grid">
            <Command idref="informix.getSpacesSize"/>
         </DataView>
      </ObjectView>

      <ObjectView type="Space">
         <DataView id="informix-space-info" icon="Info" label="Info" viewer="node-form"/>
         <DataView id="informix-space-chunks" icon="Chunks" label="Chunks" viewer="grid">
            <Command idref="informix.getChunks">
               <Input name="dbsnum" value="${informix.getSpaces.dbsnum}"/>
            </Command>
         </DataView>
      </ObjectView>

   </ObjectsViewDef>

</DatabaseProfile>
