| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263 |
- import random
- wlsUser = '<%= @wlsUser %>'
- password = '<%= @password %>'
- machine = '<%= @address %>'
- portNumber = '<%= @port %>'
-
- eisName = '<%= @adapterEntry %>'
- cfName = '<%= @adapterEntryValue %>'
- propertyName = '<%= @adapterEntryProperty %>'
- connectionFactoryInterface = '<%= @connectionFactoryInterface %>'
- appName = '<%= @adapterName %>'
- appPath = '<%= @adapterPath %>'
- planPath = '<%= @adapterPlanDir %>/<%= @adapterPlan %>'
- useStoreConfig = '<%= @useStoreConfig %>'
-
- moduleOverrideName=appName+'.rar'
- moduleDescriptorName='META-INF/weblogic-ra.xml'
- idRandom=random.randint(10000,100000)
- connectionInstance='ConnectionInstance_eis/wls/MyCF_JNDIName_'+str(idRandom)
- configProperty='ConfigProperty_ConnectionFactoryLocation_Value_'+str(idRandom)
- def makeDeploymentPlanVariable(wlstPlan, name, value, xpath, origin='planbased'):
-
- while wlstPlan.getVariableAssignment(name, moduleOverrideName, moduleDescriptorName):
- wlstPlan.destroyVariableAssignment(name, moduleOverrideName, moduleDescriptorName)
-
- while wlstPlan.getVariable(name):
- wlstPlan.destroyVariable(name)
-
- variableAssignment = wlstPlan.createVariableAssignment( name, moduleOverrideName, moduleDescriptorName )
- variableAssignment.setXpath( xpath )
- variableAssignment.setOrigin( origin )
- wlstPlan.createVariable( name, value )
-
-
- def main():
-
- edit()
- try:
- startEdit()
-
- myPlan=loadApplication(appPath, planPath)
-
- print '___ BEGIN change plan'
- makeDeploymentPlanVariable(myPlan, connectionInstance, eisName, '/weblogic-connector/outbound-resource-adapter/connection-definition-group/[connection-factory-interface="'+connectionFactoryInterface+'"]/connection-instance/[jndi-name="'+ eisName + '"]/jndi-name')
- makeDeploymentPlanVariable(myPlan, configProperty, cfName, '/weblogic-connector/outbound-resource-adapter/connection-definition-group/[connection-factory-interface="'+connectionFactoryInterface+'"]/connection-instance/[jndi-name="'+ eisName + '"]/connection-properties/properties/property/[name="'+propertyName+'"]/value')
- print '___ DONE change plan'
-
- myPlan.save();
- save();
- activate(block='true');
- except:
- stopEdit('y')
- if useStoreConfig != "true":
- connect(wlsUser,password,'t3://'+machine+':'+portNumber)
- else:
- connect(userConfigFile='<%= @userConfigFile %>', userKeyFile='<%= @userKeyFile %>', url='t3://'+machine+':'+portNumber)
- main()
|