Jython framework: Advanced use

This section provides help when choosing to manually create or edit the deployment configuration jython files used for a WebLogic deployment.

Configurable Objects

Please see the relevant menu items for each configurable object.

Adding attributes to configurable objects

You can add any supported WebLogic attributes for any of the above configurable objects using the following approach:

  1. Determine the attribute you want to configure. In the example we will use the Web Server Log file location for a managed server.
  2. In a WebLogic console, set the attribute required and save the configuration
  3. Go to the WebLogic config.xml file in the WEBLOGIC_DOMAIN_HOME/config directory
  4. Identify the hierarchy for the setting just made.
    <server>
        <name>ClusteredManagedServer1</name>
            ...
        <web-server>
          <name>GenericAdminServer</name>
          <web-server-log>
            <file-name>ClusteredManagedServer1/access.log</file-name>
            <rotation-type>byTime</rotation-type>
            <number-of-files-limited>false</number-of-files-limited>
            <log-file-format>extended</log-file-format>
          </web-server-log>
          ...
        </web-server>
       ...
      </server>
  5. We see the hierarchy is:
     <web-server>
          <web-server-log>
            <file-name>ClusteredManagedServer1/access.log</file-name>
            
  6. Next we remove the "-" in the names, capitalise each of the words, enclose the parameters in square brackets to give us the hierarchy:
            ['WebServer']['WebServerLog']['FileName'] = 'ClusteredManagedServer1/access.log'        
  7. Add this to our Jython configuration file for the managed server:
            ManagedServer1 = copy.deepcopy(ManagedServerTemplate)
            ManagedServer1['Name']='ClusteredManagedServer1'
            ...
            ManagedServer1['WebServer']['WebServerLog']['FileName'] = 'ClusteredManagedServer1/access.log'
            ...
  8. Apply this setting for any other targets you require, using data dictionary items if required:
            ManagedServer_1 = copy.deepcopy(ManagedServerTemplate)
            ManagedServer_1['Name']='@@managedServerName_1@@'
            ...
            ManagedServer_1['ListenAddress']='@@managedServerlistenAddress_1@@'
            ManagedServer_1['WebServer']['WebServerLog']['FileName'] = '@@managedServerName_1@@/access.log'
            ...

IMPORTANT

If you want to configure a property whose "parent" key is not created, you need first to initialise its "parent" key and assign a 'Type' to it.

Let's look at the next example, we want to change the severity level of the server logs and we find this in the configuration file:

<log>
    <logger-severity>Debug</logger-severity>
    <log-file-severity>Debug</log-file-severity>
    <stdout-severity>Debug</stdout-severity>
</log>

The configuration setting would be as follows:

ManagedServer_1['Log']['LoggerSeverity']='Debug'
ManagedServer_1['Log']['LogFileSeverity']='Debug'
ManagedServer_1['Log']['StdoutSeverity']='Debug'

But as the parent 'Log' is not referenced before in the file in any other configuration we need to initialise it and set a 'Type' key for it:

ManagedServer_1['Log']={}
ManagedServer_1['Log']['Type']='Log'
ManagedServer_1['Log']['LoggerSeverity']='Debug'
ManagedServer_1['Log']['LogFileSeverity']='Debug'
ManagedServer_1['Log']['StdoutSeverity']='Debug'

Generic project properties jython file (project.py)

As well as the usual environment py configuration file, a generic py configuration file can be created for the entired project and its different environments.

This file will always be overriden by the environment specific one.

The way of application is as follow:

  1. If a relative path (to the archive) to a py file has been set as a resource of a WebLogicDeployment task, this file will be used.
  2. If this resource is not set, the default value for it will be 'project.py' relative to the archive.