• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

Configure custom properties of a Datasource in WebSphere 7 after creating it with Jython scripts

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am trying to configure the propertySet after creating the datasource with Jython script and after I save the properties will be out there twice. Once with the value that I set them to and once with the default value. I could run the code to remove all custom properties, but then I would have to go and set all 94 custom properties.

Is there a way to update the value of a custom property without putting 2 entries and removing all other custom properties?
I also have the option to copy the custom properties from another datasource that is already created, is that possible with Jython script?


 
Ranch Hand
Posts: 446
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Have you tried removing following code from your script. Unless you added it after your initial tests failed.

)
 
Curtis Pendleton
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Deepak Pant,

If I remove those lines of code from the script, then it will have duplicate entries for the custom properties that I add after that.

If I leave those lines of code in the script, then it will only have the properties that I have overridden when the script is complete, but all other properties will be removed.

What I want in the end is to have all existing properties on the data source, but change the values of the ones I need to change without having duplicates.
 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Curtis Pendleton wrote:I am trying to configure the propertySet after creating the datasource with Jython script and after I save the properties will be out there twice. Once with the value that I set them to and once with the default value. I could run the code to remove all custom properties, but then I would have to go and set all 94 custom properties.

Is there a way to update the value of a custom property without putting 2 entries and removing all other custom properties?
I also have the option to copy the custom properties from another datasource that is already created, is that possible with Jython script?



Hi there,

It took me quite a while to figure this one out, too. Hope you're not still waiting for an answer, but I'll post it anyway for other searchers.

The key is to use AdminConfig.getid('/.../J2EEResourcePropertySet:/') and AdminConfig.getid('/.../J2EEResourcePropertySet:/J2EEResourceProperty:propName/') to get the existing propertySet and/or property.

 
It sure was nice of your sister to lend us her car. Let's show our appreciation by sharing this tiny ad:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
    Bookmark Topic Watch Topic
  • New Topic