You can use the AdminApp object to set configurations in an application. Some configuration settings are not available through the AdminApp object. This example uses the AdminConfig object to configure session manager for Web module in the application.
Using Jacl:
set deployment [$AdminConfig getid /Deployment:myApp/]
Example output:
myApp(cells/mycell/applications/myApp.ear/deployments/myApp:deployment.xml#Deployment_1)
Using Jacl:
set appDeploy [$AdminConfig showAttribute $deployment deployedObject] set modules [$AdminConfig showAttribute $appDeploy modules]
Example output:
(cells/mycell/applications/myApp.ear/deployments/myApp:deployment.xml#WebModuleDeployment_1) (cells/mycell/applications/myApp.ear/deployments/myApp:deployment.xml#EJBModuleDeployment_1) (cells/mycell/applications/myApp.ear/deployments/myApp:deployment.xml#WebModuleDeployment_2)
Using Jacl:
$AdminConfig attributes SessionManager
Example output:
"accessSessionOnTimeout Boolean" "allowSerializedSessionAccess Boolean" "context ServiceContext@" "defaultCookieSettings Cookie" "enable Boolean" "enableCookies Boolean" "enableProtocolSwitchRewriting Boolean" "enableSSLTracking Boolean" "enableSecurityIntegration Boolean" "enableUrlRewriting Boolean" "maxWaitTime Integer" "properties Property(TypedProperty)*" "sessionDRSPersistence DRSSettings" "sessionDatabasePersistence SessionDatabasePersistence" "sessionPersistenceMode ENUM(DATABASE, DATA_REPLICATION, NONE)" "tuningParams TuningParams"
Using Jacl:
set attr0 [list enable true] set attr1 [list enableSecurityIntegration true] set attr2 [list maxWaitTime 30] set attr3 [list sessionPersistenceMode NONE] set attr4 [list enableCookies true] set attr5 [list invalidationTimeout 45] set tuningParmsDetailList [list $attr5] set tuningParamsList [list tuningParams $tuningParmsDetailList] set pwdList [list password 95ee608] set userList [list userId Administrator] set dsNameList [list datasourceJNDIName jdbc/session] set dbPersistenceList [list $dsNameList $userList $pwdList] set sessionDBPersistenceList [list $dbPersistenceList] set sessionDBPersistenceList [list sessionDatabasePersistence $dbPersistenceList] set kuki [list maximumAge 1000] set cookie [list $kuki] set cookieSettings [list defaultCookieSettings $cookie] set sessionManagerDetailList [list $attr0 $attr1 $attr2 $attr3 $attr4 $cookieSettings $tuningParamsList $sessionDBPersistenceList] set sessionMgr [list sessionManagement $sessionManagerDetailList] set id [$AdminConfig create ApplicationConfig $appDeploy [list $sessionMgr] configs] set targetMappings [lindex [$AdminConfig showAttribute $appDeploy targetMappings] 0] set attrs [list config $id] $AdminConfig modify $targetMappings [list $attrs]This example sets four top level attributes in the session manager. You can modify the example to set other attributes in the seesion manager including the nested attributes in Cookie, DRSSettings, SessionDataPersistence, and TuningParms object types. To list the attributes for those object types, use the attribute command in AdminConfig object.
Example output using Jacl:
sessionManagement {{enableSecurityIntegration true} {maxWaitTime 30} {sessionPersistenceMode NONE} {enabled true}}
Using Jacl:
set nameAttr [list name myWebModuleConfig] set descAttr [list description "Web Module config post create"] set webAttrs [list $nameAttr $descAttr $sessionMgr]
Example output:
{name myWebModuleConfig} {description {Web Module config post create}} {sessionManagement {{enableSecurityIntegration true} {maxWaitTime 30} {sessionPersistenceMode NONE} {enabled true}}}
Using Jacl:
foreach module $modules { if {[regexp WebModuleDeployment $module] == 1} { $AdminConfig create WebModuleConfig $module $webAttrs set targetMappings lindex $AdminConfig showAttribute $module targetMappings 0 set attrs list config $moduleConfig $AdminConfig modify $targetMappings list $attrs } }
Example output:
myWebModuleConfig(cells/mycell/applications/myApp.ear/deployments/myApp:deployment.xml#WebModuleConfiguration_1)
If you do not specify the tuningParamsList attribute when you create the session manager, you will receive an error when you start the deployed application.
Using Jacl:
$AdminConfig save