############
# This script retrieves datasources information for LEM screen component
# Author: pdchhss
# Amendment history
# Version Modified by Modify date Description
#=================================================================
# 0.1 pdchhss 2009-Aug-07 Created.
############
#*** Initialization setction ***
############
import sys
import java
#-- datasource setting constants
LINE = java.lang.System.getProperty("line.separator")
PREFIX = "DS_"
TAB = " "
LEM_JNDI = "jdbc/lemportal"
CONF_URL = "URL"
CONF_AUTHEN_ALIAS = "authDataAlias"
CONF_JNDI = "jndiName"
############
#*** Predefined functions ***
############
#-- print the property as expected format
def printProperty(name,value):
if name != "" and value != "" :
print PREFIX + name + "=" + value
############
#*** Major Process ***
############
dss = AdminConfig.list('DataSource').split(LINE)
#-- print datasource information --
#-- loop through all datasources
for ds in dss:
jndi = AdminConfig.showAttribute(ds,CONF_JNDI)
#-- for ds setting for LEM, goes into detail
if jndi == LEM_JNDI:
d = AdminConfig.list('J2EEResourceProperty', ds).split(LINE)
for da in d:
n = AdminConfig.showAttribute(da,'name')
if n == CONF_URL:
printProperty(AdminConfig.showAttribute(da, 'name'),AdminConfig.showAttribute(da, 'value'))
authen = AdminConfig.showAttribute(ds, CONF_AUTHEN_ALIAS)
printProperty("userAlias", authen)
############
#*** End of Major Process ***
############
# This script retrieves datasources information for LEM screen component
# Author: pdchhss
# Amendment history
# Version Modified by Modify date Description
#=================================================================
# 0.1 pdchhss 2009-Aug-07 Created.
############
#*** Initialization setction ***
############
import sys
import java
#-- datasource setting constants
LINE = java.lang.System.getProperty("line.separator")
PREFIX = "DS_"
TAB = " "
LEM_JNDI = "jdbc/lemportal"
CONF_URL = "URL"
CONF_AUTHEN_ALIAS = "authDataAlias"
CONF_JNDI = "jndiName"
############
#*** Predefined functions ***
############
#-- print the property as expected format
def printProperty(name,value):
if name != "" and value != "" :
print PREFIX + name + "=" + value
############
#*** Major Process ***
############
dss = AdminConfig.list('DataSource').split(LINE)
#-- print datasource information --
#-- loop through all datasources
for ds in dss:
jndi = AdminConfig.showAttribute(ds,CONF_JNDI)
#-- for ds setting for LEM, goes into detail
if jndi == LEM_JNDI:
d = AdminConfig.list('J2EEResourceProperty', ds).split(LINE)
for da in d:
n = AdminConfig.showAttribute(da,'name')
if n == CONF_URL:
printProperty(AdminConfig.showAttribute(da, 'name'),AdminConfig.showAttribute(da, 'value'))
authen = AdminConfig.showAttribute(ds, CONF_AUTHEN_ALIAS)
printProperty("userAlias", authen)
############
#*** End of Major Process ***
############