File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Websphere and the fly likes Configure custom properties of a Datasource in WebSphere 7 after creating it with Jython scripts Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Websphere
Bookmark "Configure custom properties of a Datasource in WebSphere 7 after creating it with Jython scripts" Watch "Configure custom properties of a Datasource in WebSphere 7 after creating it with Jython scripts" New topic
Author

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

Curtis Pendleton
Greenhorn

Joined: Jan 25, 2011
Posts: 2
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?


Deepak Pant
Ranch Hand

Joined: Feb 13, 2004
Posts: 445
Have you tried removing following code from your script. Unless you added it after your initial tests failed.

)
Curtis Pendleton
Greenhorn

Joined: Jan 25, 2011
Posts: 2
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.
Geert Pante
Greenhorn

Joined: Feb 03, 2011
Posts: 8
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.

 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Configure custom properties of a Datasource in WebSphere 7 after creating it with Jython scripts