Skip to content

Commit f995df2

Browse files
committed
Issue #191 - Add filter description and configuration information to README.md
1 parent e2b0063 commit f995df2

File tree

1 file changed

+37
-0
lines changed

1 file changed

+37
-0
lines changed

README.md

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1072,6 +1072,43 @@ A custom injector for the admin server SSL listen port is:
10721072
}
10731073
```
10741074

1075+
### Model Filters
1076+
1077+
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.
1078+
1079+
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. The method should make whatever adjustments are needed to the domain model. Filters can be stored in any directory, as long as they can be accessed by WebLogic Deploy Tooling.
1080+
1081+
The following filter example (fix-password.py) sets the password for two attributes in the SecurityConfiguration WLST folder.
1082+
1083+
```python
1084+
def filter_model(model):
1085+
if model and 'topology' in model:
1086+
if 'SecurityConfiguration' in model['topology']:
1087+
model['topology']['SecurityConfiguration']['CredentialEncrypted'] = 'welcome1'
1088+
model['topology']['SecurityConfiguration']['NodeManagerPasswordEncrypted'] = 'welcome1'
1089+
print 'Replaced SecurityConfiguration password'
1090+
else:
1091+
print 'SecurityConfiguration not in the model'
1092+
```
1093+
1094+
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. Filters in the "deploy" section are also applied for the Update Domain Tool.
1095+
1096+
This example deploys two filters for the Create Domain Tool: fix-password.py and no-mail.py, and one filter for the Discover Domain tool.
1097+
1098+
```json
1099+
{
1100+
"create": [
1101+
{ "name": "fixPassword", "path": "/home/user/fix-password.py" },
1102+
{ "name": "noMail", "path": "/home/user/no-mail.py" }
1103+
],
1104+
"deploy": [
1105+
],
1106+
"discover": [
1107+
{ "name": "noMail", "path": "/home/user/no-mail.py" }
1108+
]
1109+
}
1110+
```
1111+
10751112
## Samples
10761113

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

0 commit comments

Comments
 (0)