Skip to content

Issue #191 - Add filter description and configuration information to … #197

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Dec 11, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 39 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -1072,6 +1072,45 @@ A custom injector for the admin server SSL listen port is:
}
```

## Model Filters

WebLogic Deploy Tooling supports the use of model filters to manipulate the domain model. The Create Domain, Update Domain, and Deploy Applications Tools apply filters to the model after it is read, before it is validated and applied to the domain. The Discover Domain Tool applies filters to the model after it has been discovered, before the model is validated and written.

Model filters are written in Jython, and must be compatible with the version used in the corresponding version of WLST. A filter must implement the method filter_model(model), which accepts as a single argument the domain model as a Jython dictionary. This method can make any adjustments to the domain model that are required. Filters can be stored in any directory, as long as they can be accessed by WebLogic Deploy Tooling.

The following filter example (fix-password.py) sets the password for two attributes in the SecurityConfiguration WLST folder.

```python
def filter_model(model):
if model and 'topology' in model:
if 'SecurityConfiguration' in model['topology']:
model['topology']['SecurityConfiguration']['CredentialEncrypted'] = 'welcome1'
model['topology']['SecurityConfiguration']['NodeManagerPasswordEncrypted'] = 'welcome1'
print 'Replaced SecurityConfiguration password'
else:
print 'SecurityConfiguration not in the model'
```

Model filters are configured by creating a model_filters.json file in the WLSDEPLOY_HOME/lib directory. This file has separate sections for filters to be applied for specific tools.

This example configures two filters for the Create Domain Tool: fix-password.py and no-mail.py, and one filter for the Discover Domain tool.

```json
{
"create": [
{ "name": "fixPassword", "path": "/home/user/fix-password.py" },
{ "name": "noMail", "path": "/home/user/no-mail.py" }
],
"deploy": [
],
"discover": [
{ "name": "noMail", "path": "/home/user/no-mail.py" }
],
"update": [
]
}
```

## Samples

A sample of a model_variable_injector.json file and a custom injector json file are installed in the WLSDEPLOY/samples directory.
Expand Down