Skip to content

Commit 144e847

Browse files
authored
Merge pull request #197 from oracle/Issue#191-add-filter-to-readme
Issue #191 - Add filter description and configuration information to …
2 parents eb6bf9f + 61c5db0 commit 144e847

File tree

1 file changed

+39
-0
lines changed

1 file changed

+39
-0
lines changed

README.md

+39
Original file line numberDiff line numberDiff line change
@@ -1072,6 +1072,45 @@ 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. 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.
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.
1095+
1096+
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.
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+
"update": [
1110+
]
1111+
}
1112+
```
1113+
10751114
## Samples
10761115

10771116
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)