Skip to content

Commit a2e89c6

Browse files
first cut developer guide
1 parent 47077b6 commit a2e89c6

File tree

6 files changed

+129
-110
lines changed

6 files changed

+129
-110
lines changed

documentation/1.9/content/_index.md

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
1-
# Oracle WebLogic Server Deploy Tooling
1+
## WebLogic Deploy Tooling
22

3-
Many organizations are using WebLogic Server, with or without other Oracle Fusion Middleware components, to run their enterprise applications. As more and more organizations move toward Continuous Delivery of their applications, the importance of automated testing grows. Automating WebLogic Server domain creation and application deployment with hand-coded WLST scripts is challenging. After those scripts exist for a project, they must be maintained as the project evolves. The motivation for the Oracle WebLogic Server Deploy Tooling project is to remove the need for most users to write WLST scripts for routine domain creation and application deployment tasks. Instead, the project team can write a declarative, metadata model describing the domain and applications (with their dependent resources), and use one or more of the single-purpose tools provided that perform domain lifecycle operations based on the content of the model. The goal is to make it easy to stand up environments and perform domain lifecycle operations in a repeatable fashion based on a metadata model that can be treated as source and evolve as the project evolves.
3+
Many organizations are using WebLogic Server, with or without other Oracle Fusion Middleware components, to run their enterprise applications. As more and more organizations move toward Continuous Delivery of their applications, the importance of automated testing grows. Automating WebLogic Server domain creation and application deployment with hand-coded WLST scripts is challenging. After those scripts exist for a project, they must be maintained as the project evolves. WebLogic Deploy Tooling (WDT) removes the need for most users to write WLST scripts for routine domain creation and application deployment tasks. Instead, you can write a declarative, metadata model describing the domain and applications (with their dependent resources), and use one or more of the single-purpose tools that perform domain lifecycle operations based on the content of the model. This makes it easy to stand up environments and perform domain lifecycle operations in a repeatable fashion based on a metadata model that can be treated as source and evolve as the project evolves.
44

5-
## Features of the Oracle WebLogic Server Deploy Tooling
65

7-
Currently, the project provides several single-purpose tools, all exposed as shell scripts (both Windows and UNIX scripts are provided):
6+
WDT provides several single-purpose tools, all exposed as shell scripts (for both Windows and UNIX):
87

98
- The [Create Domain Tool]({{< relref "/create.md" >}}) (`createDomain`) understands how to create a domain and populate the domain with all resources and applications specified in the model.
109
- The [Update Domain Tool]({{< relref "/update.md" >}}) (`updateDomain`) understands how to update an existing domain and populate the domain with all resources and applications specified in the model, either in offline or online mode.
@@ -21,12 +20,12 @@ Currently, the project provides several single-purpose tools, all exposed as she
2120
As new use cases are discovered, new tools will likely be added to cover those operations but all will use the metadata model to describe what needs to be done.
2221

2322

24-
## Downloading and Installing the Software
23+
### Download and Install the Software
2524

2625
The Oracle WebLogic Server Deploy Tooling project repository is located at [`https://github.com/oracle/weblogic-deploy-tooling`](https://github.com/oracle/weblogic-deploy-tooling). Binary distributions of the `weblogic-deploy.zip` installer can be downloaded from the [GitHub Releases page](https://github.com/oracle/weblogic-deploy-tooling/releases). To install the software, simply unzip the `weblogic-deploy.zip` installer on a machine that has the desired versions of WebLogic Server installed. After being unzipped, the software is ready to use, just set the `JAVA_HOME` environment variable to point to a Java 7 or higher JDK and the shell scripts are ready to run.
2726

2827

29-
## Supported WLS Versions
28+
### Supported WLS Versions
3029

3130
For the supported WebLogic Server and JDK versions required to run WebLogic Server Deploy Tooling, see [Supported WLS Versions]({{< relref "/wls_versions.md" >}}).
3231

@@ -40,7 +39,7 @@ For the supported WebLogic Server and JDK versions required to run WebLogic Serv
4039

4140
## Developer Guide
4241

43-
For information for developers, see the [Developer Guide]({{< relref "/developer/developer_guide.md" >}}).
42+
For information for developers, see the [Developer Guide]({{< relref "/developer/_index.md" >}}).
4443

4544
## Known Issues
4645

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
+++
2+
title = "Developer Guide"
3+
date = 2019-02-22T15:27:54-05:00
4+
weight = 4
5+
chapter = true
6+
pre = "<b> </b>"
7+
+++
8+
9+
10+
# Developer Guide
11+
12+
The Developer Guide provides information for developers who want to understand or contribute to the code.
Lines changed: 31 additions & 103 deletions
Original file line numberDiff line numberDiff line change
@@ -1,58 +1,27 @@
1-
# Developer Guide
2-
3-
## Table of Contents
4-
- [Project Structure](#project-structure)
5-
- [Feature Implementation](#feature-implementation)
6-
- [Alias Definitions](#alias-definitions)
7-
- [Building WebLogic Deploy Tool](#building-weblogic-deploy-tool)
8-
9-
## Project Structure
10-
11-
This project is structured using the Standard Directory Layout for Maven projects, with two child modules, `core` and `installer`. In addition, there is a `samples` directory with example configurations, and the `site` directory containing project documentation.
12-
13-
The `core` module contains the main source code for the project. This includes Jython modules and Java classes, as well as typedef files, alias definitions, and the message bundle. There are unit tests related to this module.
14-
15-
Alias definitions are discussed in more detail [here](#alias-definitions).
16-
17-
The `installer` module builds the final installer ZIP file. It includes the assembly definitions, start scripts for each tool for Linux and Windows platforms, and configurations for variable injection and logging.
18-
19-
A single installer ZIP file is built under the `WLSDEPLOY_HOME/installer/target` directory.
20-
21-
There are detailed instructions for building the project [here](#building-weblogic-deploy-tool).
22-
23-
## Feature Implementation
24-
25-
This section describes how specific features of WebLogic Deploy Tooling are implemented in the source code.
26-
27-
### Creator and Deployer Class Hierarchies
28-
29-
The creation of individual folders and attributes within the `topology` section of the domain model is accomplished using subclasses of the Jython class `Creator`, in the module `wlsdeploy.tool.create.creator.py`. The `Creator` class provides base methods to recurse through nested folders in the domain model, create or update those folders, and set or update their attributes. Each subclass can override these methods to account for variations in behavior for different functional areas.
30-
31-
For example, the `SecurityProviderCreator` subclass overrides the method `_create_named_subtype_mbeans` with special processing to remove all existing security providers, and re-create them from the data in the model.
32-
33-
The update of folders and attributes in the `resources` section of the domain model follows a similar pattern, but the base class for these modules is `Deployer` in the module `wlsdeploy.tool.deploy.deployer.py`.
34-
35-
The class `TopologyUpdater` is a special subclass of `Deployer` that is used to update elements in the `topology` section after their initial creation.
36-
37-
## Alias Definitions
1+
---
2+
title: "Alias definitions"
3+
date: 2019-02-23T17:19:24-05:00
4+
draft: false
5+
weight: 3
6+
---
387

398
WebLogic Deploy Tool uses a set of JSON configuration files to map folders and attributes in the model to the corresponding WLST MBeans and their attributes. These mappings are referred as 'aliases' throughout the project code and documentation. Each element in the alias definition file has detailed properties that assist in this mapping.
409

4110
The model's folder and attribute names usually match the names of the corresponding elements in WLST. For cases where the names of WLST elements may change across WebLogic Server releases, the names should match the names in the 12.2.1.3 release. The unit test `AttributesTestCase` verifies that this convention is used, and identifies a few exceptions.
4211

4312
Attributes that are introduced after the 12.2.1.3 release should, in most cases, match the name of the first WebLogic Server release in which they appear. The unit test `AttributesTestCase` will ignore these for now, because they will not be present in the 12.2.1.3 alias structure.
44-
13+
4514
The alias definition files reside in the directory:
4615

4716
`$WLSDEPLOY_HOME/core/src/main/resources/oracle/weblogic/deploy/aliases/category_module`
4817

49-
Each definition file corresponds to a second-level folder within the model, such as `JDBCSystemResource`. Any elements below a second-level folder are defined in the file of that parent. For example, the model element `resources/JDBCSystemResource/JdbcResource/JDBCConnectionPoolParams` is described in `JDBCSystemResource.json`.
18+
Each definition file corresponds to a second-level folder within the model, such as `JDBCSystemResource`. Any elements below a second-level folder are defined in the file of that parent. For example, the model element `resources/JDBCSystemResource/JdbcResource/JDBCConnectionPoolParams` is described in `JDBCSystemResource.json`.
5019

5120
Top-level elements such as `topology` and `resources` are for organizational purposes, and are not represented in the alias definition files.
5221

5322
No elements in the `domainInfo` section of the model are represented in the alias definitions, because they don't correspond directly to WLST elements.
5423

55-
This example, from the file `JDBCSystemResource.json`, will be used as a reference in the descriptions below:
24+
This example, from the file `JDBCSystemResource.json`, will be used as a reference in the descriptions below:
5625

5726
```yaml
5827
{
@@ -68,19 +37,19 @@ This example, from the file `JDBCSystemResource.json`, will be used as a referen
6837
"wlst_type": "JDBCConnectionPoolParams",
6938
"folders": {},
7039
"attributes": {
71-
"CapacityIncrement": [ {"version": "[10,)",
72-
"wlst_mode": "both",
73-
"wlst_name": "CapacityIncrement",
74-
"wlst_path": "WP001",
75-
"value": {"default": "${None:1}"},
76-
"wlst_type": "integer",
40+
"CapacityIncrement": [ {"version": "[10,)",
41+
"wlst_mode": "both",
42+
"wlst_name": "CapacityIncrement",
43+
"wlst_path": "WP001",
44+
"value": {"default": "${None:1}"},
45+
"wlst_type": "integer",
7746
"get_method": "LSA"} ],
78-
"ConnectionCreationRetryFrequencySeconds": [ {"version": "[10,)",
79-
"wlst_mode": "both",
47+
"ConnectionCreationRetryFrequencySeconds": [ {"version": "[10,)",
48+
"wlst_mode": "both",
8049
"wlst_name": "ConnectionCreationRetryFrequencySeconds",
81-
"wlst_path": "WP001",
82-
"value": {"default": "${None:0}"},
83-
"wlst_type": "integer",
50+
"wlst_path": "WP001",
51+
"value": {"default": "${None:0}"},
52+
"wlst_type": "integer",
8453
"get_method": "LSA"} ]
8554
},
8655
"wlst_attributes_path": "WP001",
@@ -95,7 +64,7 @@ This example, from the file `JDBCSystemResource.json`, will be used as a referen
9564

9665
Notations similar to `${Jdbc:JDBC}Resource` appear throughout this example, and other alias definition files. It is shorthand for the common situation where a value is different between offline and online WLST. The value before the colon is used in offline processing, and the value after is used for online. In this example, the value for `wlst_type` is `JdbcResource` in offline, and `JDBCResource` in online. This notation can be used for values in most places in the model. It cannot be used for key values, such as `wlst_type`.
9766

98-
### Keys for Top Level and `folders` Elements
67+
### Keys for top level and `folders` elements
9968

10069
These JSON keys are applicable for the top-level element (such as `JDBCSystemResource`), and each of its nested `folders` elements (such as `JdbcResource` and `JdbcResource/JDBCConnectionPoolParams`.
10170

@@ -111,15 +80,15 @@ This value specifies how the tool will map the domain model element to one or mo
11180

11281
- `single-unpredictable` - this element represents a single MBean, but the MBean name must be derived at runtime.
11382

114-
- `multiple` - this element contains multiple named elements (such as `dataSource1`, `dataSource2`), and each represents a single MBean.
83+
- `multiple` - this element contains multiple named elements (such as `dataSource1`, `dataSource2`), and each represents a single MBean.
11584

11685
#### `folders`
11786

11887
Nested WLST MBean types for the current MBean are listed here. Each has a domain model type name, followed by its own JSON keyed elements.
119-
88+
12089
#### `wlst_attributes_path`
12190

122-
This key element specifies the name of the path expression used for navigating to the MBean attributes folder. The actual path expression is defined later in the `"wlst_paths": { }` element.
91+
This key element specifies the name of the path expression used for navigating to the MBean attributes folder. The actual path expression is defined later in the `"wlst_paths": { }` element.
12392

12493
#### `wlst_paths`
12594

@@ -136,9 +105,9 @@ Each child of an `attributes` element represents a single MBean attribute, and i
136105
#### `version`
137106

138107
This key element defines the applicable versions for a particular MBean attribute description. Maven versioning conventions are used to describe ranges and limits. For example:
139-
108+
140109
`"version": "[10,)"`
141-
110+
142111
Specifies that an MBean attribute description is relevant for WebLogic Server version 10 and later
143112

144113
#### `wlst_mode`
@@ -159,7 +128,7 @@ This key element specifies the data type used to read the WLST MBean attribute.
159128

160129
#### `get_method`
161130

162-
This key element specifies which method should be used for retrieving the value the MBean attribute. Valid values are:
131+
This key element specifies which method should be used for retrieving the value the MBean attribute. Valid values are:
163132

164133
- `GET` use the WLST get method to retrieve the value of the attribute
165134
- `LSA` use ls(type='a') to retrieve the value of the attribute
@@ -170,11 +139,11 @@ This key element specifies which method should be used for retrieving the value
170139
By default, an attribute is read write in both WLST and MODEL. This element is used to set an attribute to read-only. The two read-only attributes are `RO` and `ROD`. The latter indicates that the attribute is read-only and will not be written into the domain. However, it will be discovered by the discover tool into the model.
171140
#### `preferred_model_type`
172141

173-
This key element specifies the preferred data type that should be used to put data in the model during discovery. As an example, list values can be represented in the model as comma-separated text, such as `"value1, value2"`, or as a YAML list, such as `["value1", "value2"]`. If the list values can contain commas, it is preferred to use a YAML list.
142+
This key element specifies the preferred data type that should be used to put data in the model during discovery. As an example, list values can be represented in the model as comma-separated text, such as `"value1, value2"`, or as a YAML list, such as `["value1", "value2"]`. If the list values can contain commas, it is preferred to use a YAML list.
174143

175144
#### `wlst_path`
176145

177-
This key element specifies the name of the path expression used for navigating to the MBean attribute's folder. This name maps to an entry in the parent folder's `"wlst_paths": { }` list.
146+
This key element specifies the name of the path expression used for navigating to the MBean attribute's folder. This name maps to an entry in the parent folder's `"wlst_paths": { }` list.
178147

179148
#### `value`
180149

@@ -184,12 +153,12 @@ This key element is used to specify the default value of the MBean attribute. Fo
184153

185154
#### `set_method`
186155

187-
For cases where attributes cannot be set with simple types, it may be necessary to use a custom method to set the value. For example, most `Target` attributes require their values to be set as lists of MBeans, in online mode. This may be defined as:
156+
For cases where attributes cannot be set with simple types, it may be necessary to use a custom method to set the value. For example, most `Target` attributes require their values to be set as lists of MBeans, in online mode. This may be defined as:
188157

189158
```yaml
190159
"attributes": {
191160
"Target": [ {
192-
"set_method": "MBEAN.set_target_mbeans",
161+
"set_method": "MBEAN.set_target_mbeans",
193162
"set_mbean_type": "weblogic.management.configuration.TargetMBean"} ],
194163
},
195164
```
@@ -199,44 +168,3 @@ The method `set_target_mbeans` directs the tool to call the Jython method `attri
199168
#### `set_mbean_type`
200169

201170
When a `set_method` key is specified, it may be required to specify the MBean type for the set method to use (see the example under `set_method`).
202-
203-
## Building WebLogic Deploy Tool
204-
205-
### Prerequisite
206-
207-
You will need the following software installed in your local build environment
208-
209-
1. Oracle WebLogic Server installation version 12.2.1 and later
210-
2. JDK version 8
211-
3. Maven 3 and later
212-
213-
### Specifying the WLST location
214-
215-
Execution of the unit tests requires a WebLogic Server installation, because the tests must be run within WLST.
216-
217-
The WLST directory can be specified in one of two ways:
218-
219-
- Specify the `-Dunit-test-wlst-dir=<wlst-directory>` on the mvn command line.
220-
221-
- Create a file `.mvn/maven.config` file in the project directory, containing a single line with the `-Dunit-test-wlst-dir=<wlst-directory>` value. The `.mvn` directory contains a `maven.config-template` file that can be copied and used as a starting point.
222-
223-
In these cases, `<wlst-directory>` refers to the fully-qualified path to the WLST script (`wlst.sh` or `wlst.cmd`).
224-
225-
If you are using an IDE for development and building, creating a `maven-config` file will allow some Maven tasks to be performed within the IDE.
226-
227-
### Build Commands
228-
229-
If you are making changes to the project, you can build the project using this command line:
230-
231-
`mvn -Dunit-test-wlst-dir=<wlst-directory> clean install`
232-
233-
This will build the entire project and run the unit tests. Omit the `-Dunit-test-wlst-dir=` argument if you have created a `maven.config` file, as described above.
234-
235-
Another option for specifying the WLST directory is to set the environment variable WLST_DIR. It is not necessary to use both, and
236-
the -D setting will take precedence.
237-
238-
If you are not making changes and are only interested in building the latest version, then you can skip the unit tests, using this command line:
239-
240-
`mvn -DskipTests clean install`
241-
242-
The resulting installer ZIP file built is under the `WLSDEPLOY_HOME/installer/target` directory.

0 commit comments

Comments
 (0)