there is two jython script....first one is for property file end with prop.py, this will supply the value to actual jyhon named "cutom_prop.py"....or you can do hard code these custom property value....
If you use property file then you can create N number of custom propery in few second....
main script will search for specific Datasource name and set the custom property value for that...
if you need multiple custom propery for different datasources then keep property file like(ds_name0,ds_name1,ds_name2)...same way for (custom_desc0,custom_desc1,custom_desc2)...so that just we can use for loop to set all the custom properties...
Variable ==>range(2)----on-----for a in range(2):----depends on how many you want to set....
===========================================================================
prop.py
==========
##############################DataSource Creation-Begin#############################
ds_name0="Client DataSource"
#---------------------------------------------------------------------------
custom_desc0="Determines whether the data source establishes read-only connections,By default this value is false."
custom_property0="readOnly"
custom_value0="true"
custom_type0="java.lang.Boolean"
custom_required0="false"
#**************************************************************************************
ds_name1="HOST
JDBC DataSource"
#---------------------------------------------------------------------------
custom_desc1="Determines whether the data source establishes read-only connections,By default this value is false."
custom_property1="readOnly"
custom_value1="true"
custom_type1="java.lang.Boolean"
custom_required1="false"
##############################################################################
cutom_prop.py
===========
import sys
import re
import
string
import time
import prop
##########################Custom properties for Datasources-Begin#######################
log_it ('Creating Custom properties for Datasources ...')
for a in range(2):
dataSource = AdminConfig.getid('/DataSource:"'+eval("prop.ds_name"+str(a))+'"/')
resourcePropertySet = AdminConfig.showAttribute(dataSource,'propertySet')
property = ['name',''+eval("prop.custom_property"+str(a))+'']
value = ['value',''+eval("prop.custom_value"+str(a))+'']
type = ['type',''+eval("prop.custom_type"+str(a))+'']
required = ['required',''+eval("prop.custom_required"+str(a))+'']
resourceProperty = [property,value,type,required]
AdminConfig.create('J2EEResourceProperty',resourcePropertySet,resourceProperty)
a=a+1
#endFor
log_it ('Saving Configuration ...')
AdminConfig.save( )
log_it ('OK')
#endDef
###########################Custom properties for Datasources-End#######################