bb94f33c5db1430d54b36b31a50208bc956cbd60
[policy/engine.git] / POLICY-SDK-APP / src / main / webapp / app / policyApp / policy-models / Editor / PolicyTemplates / BRMSRawPolicyTemplate.html
1 <div ng-controller="brmsRawPolicyController">
2         <form>
3                 <div class="well">
4                         <div class="form-group row">
5                                 <div class="form-group col-sm-6">
6                                         <label>Policy Name:<sup><b>*</b></sup></label> <input type="text"
7                                                 class="form-control" ng-disabled="temp.policy.readOnly"
8                                                 ng-readonly="temp.policy.editPolicy"
9                                                 ng-model="temp.policy.policyName" required pattern="\S+"
10                                                 title="Enter Policy Name without any spaces and special characters and will accept _." />
11                                 </div>
12                                 <div class="form-group col-sm-6">
13                                         <label>Description:</label> <input type="text" class="form-control"
14                                                 ng-disabled="temp.policy.readOnly"
15                                                 ng-model="temp.policy.policyDescription" 
16                                                 title="Description field will accept any type of data."/>
17                                 </div>
18                         </div>
19                         <div class="form-group row">
20                                 <div class="form-group col-sm-3">
21                                         <label>Risk Type:<sup><b>*</b></sup></label> <select
22                                                 class="form-control" ng-disabled="temp.policy.readOnly"
23                                                 ng-model="temp.policy.riskType"
24                                                 ng-options="option for option in riskTypeDictionaryDatas track by option"
25                                                 required pattern="\S+" title="Select the dropdown value driven from RiskType (Safe Policy)Dictionary."></select>
26                                 </div>
27                                 <div class="form-group col-sm-3">
28                                         <label>Risk Level:<sup><b>*</b></sup></label> <select
29                                                 class="form-control" ng-disabled="temp.policy.readOnly"
30                                                 ng-model="temp.policy.riskLevel"
31                                                 required pattern="\S+" title="Select the dropdown Risk level value.">
32                                                 <option>1</option>
33                                                 <option>2</option>
34                                                 <option>3</option>
35                                                 <option>4</option>
36                                                 <option>5</option></select>
37                                 </div>
38                                 <div class="form-group col-sm-3">
39                                         <label>Guard:<sup><b>*</b></sup></label> <select
40                                                 class="form-control" ng-disabled="temp.policy.readOnly"
41                                                 ng-model="temp.policy.guard"
42                                                 required pattern="\S+" title="Select the dropdown Guard value.">
43                                                 <option>True</option>
44                                                 <option>False</option></select>
45                                 </div>
46                         </div>
47                         <div class="form-group row">
48                                 <div class="form-group col-sm-3">
49                                         <label>Time to Live Date:</label> <input type="text" id="ttlDate"
50                                                 class="form-control" name="ttlDate" ng-disabled="temp.policy.readOnly"
51                                                 ng-model="temp.policy.ttlDate" title="Select the date from calender onclick on the field."/>
52                                 </div>
53                                 <div class="form-group col-sm-3">
54                                         <label>Controller:<sup></sup></label> <select
55                                                 class="form-control" ng-disabled="temp.policy.readOnly"
56                                                 ng-model="temp.policy.brmsController"
57                                                 ng-options="option for option in brmsControllerDatas track by option" title="Select the dropdown value driven from BRMS Controller (BRMS)Dictionary."></select>
58                                 </div>
59                                 <div class="form-group col-sm-3">
60                                         <label>Dependencies:<sup></sup></label> <select
61                                                 class="form-control" multiple ng-disabled="temp.policy.readOnly"
62                                                 ng-model="temp.policy.brmsDependency"
63                                                 ng-options="option for option in brmsDependencyDatas track by option" title="Select the dropdown value driven from BRMS Dependency (BRMS)Dictionary."></select>
64                                 </div>
65                         </div>
66                 </div>
67                 <div class="well">
68                         <div class="form-group row">
69                                 <div class="form-group col-sm-2">
70                                         <label>Rule Attributes:<sup></sup></label>
71                                         <button type="button" class="btn btn-default"
72                                                 ng-disabled="temp.policy.readOnly" ng-click="addNewChoice()" title="onClick Rule Attribute row is added.">
73                                                 <i class="fa fa-plus"></i>
74                                         </button>
75                                 </div>
76                         </div>
77                         <div class="form-group row">
78                                 <div data-ng-repeat="choice in temp.policy.attributes">
79                                         <div class="form-group row" style="margin-left: 2%">
80                                                 <div class="form-group col-sm-3">
81                                                         <input type="text" class="form-control"
82                                                                 ng-disabled="temp.policy.readOnly" ng-model="choice.key" title="Enter the Rule Attribute Key without any spaces and special characters"
83                                                                 placeholder="Attribute Key" />
84                                                 </div>
85                                                 <div class="form-group col-sm-3">
86                                                         <input type="text" class="form-control"
87                                                                 ng-disabled="temp.policy.readOnly" ng-model="choice.value" title="Enter the Rule Attribute Value without any spaces and special characters"
88                                                                 placeholder="Attribute Value" />
89                                                 </div>
90                                                 <div class="form-group col-sm-1">
91                                                         <button type="button" class="btn btn-default" ng-show="$last"
92                                                                 ng-disabled="temp.policy.readOnly" ng-click="removeChoice()" title="onClick will remove the last row">
93                                                                 <i class="fa fa-minus"></i>
94                                                         </button>
95                                                 </div>
96                                         </div>
97                                 </div>
98                         </div>
99                 </div>
100                 <div class="well">
101                         <div class="form-group row">
102                                 <div class="form-group col-sm-12">
103                                         <label>Raw Rule:<sup><b>*</b></sup></label>
104                                         <textarea class="form-control"
105                                                 ng-model="temp.policy.configBodyData" title="Enter Valid BRMS Rule."
106                                                 ng-disabled="temp.policy.readOnly" style="height: 400px;" required></textarea>
107                                 </div>
108                         </div>
109                 </div>
110                 <div id="validate" style="width: 70%"></div>
111                 <br>
112                 <div class="modal-footer">
113                         <div>
114                                 <button class="btn btn-primary" herf="javascript:void(0)"
115                                         ng-disabled="temp.policy.readOnly"
116                                         ng-click="validatePolicy(temp.policy);" title="Validate the data entered in the Policy fields.">Validate</button>
117                                 <button class="btn btn-success" herf="javascript:void(0)"
118                                         ng-disabled="savebutton" ng-disabled="temp.policy.readOnly"
119                                         ng-click="saveBrmsRawPolicy(temp);" title="Save the Policy with validated data.">Save</button>
120                                 <button type="button" class="btn btn-default" ng-click="refresh();" title="Close the template.">Close</button>
121                         </div>
122                 </div>
123         </form>
124 </div>