3aa0508d5eb93bf2b65387520170249ad1b0e452
[policy/engine.git] / POLICY-SDK-APP / src / main / webapp / app / policyApp / policy-models / Editor / PolicyTemplates / ActionPolicyTemplate.html
1 <div ng-controller="actionPolicyController">
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="well">
20                                 <div class="form-group row">
21                                         <div class="form-group col-sm-2">
22                                                 <label>Component Attributes:<sup><b>*</b></sup></label><br>
23                                                 <button type="button" class="btn btn-default"
24                                                         ng-disabled="temp.policy.readOnly" ng-click="addNewChoice()" title="onClick Component Attribute row is added.">
25                                                         <i class="fa fa-plus"></i>
26                                                 </button>
27                                         </div>
28                                 </div>
29                                 <div class="form-group row">
30                                         <div data-ng-repeat="choice in temp.policy.attributes">
31                                                 <div class="form-group row" style="margin-left: 2%">
32                                                         <div class="form-group col-sm-3">
33                                                                 <select class="form-control" ng-disabled="temp.policy.readOnly"
34                                                                         ng-model="choice.key"
35                                                                         ng-options="option for option in attributeDictionaryDatas track by option"
36                                                                         title="Select the dropdown value driven from Attribute (common)Dictionary.">
37                                                                         <option value="">{{choice.key}}</option>
38                                                                 </select>
39                                                         </div>
40                                                         <div class="form-group col-sm-3">
41                                                                 <input type="text" class="form-control"
42                                                                         ng-disabled="temp.policy.readOnly" ng-model="choice.value"
43                                                                         placeholder="Attribute Value" title="Enter the Attribute Value without any spaces and special characters"/>
44                                                         </div>
45                                                         <div class="form-group col-sm-1">
46                                                                 <button type="button" class="btn btn-default" ng-show="$last"
47                                                                         ng-disabled="temp.policy.readOnly" ng-click="removeChoice()" title="onClick will remove the last row">
48                                                                         <i class="fa fa-minus"></i>
49                                                                 </button>
50                                                         </div>
51                                                 </div>
52                                         </div>
53                                 </div>
54                         </div>
55                         <div class="well">
56                                 <label>Rule Algorithms:<sup><b></b></sup></label><br>
57                                 <div class="form-group row">
58                                         <div class="form-group col-sm-1">
59                                                 <button type="button" class="btn btn-default"
60                                                         ng-disabled="temp.policy.readOnly"
61                                                         ng-click="addNewRuleAlgorithm()" title="onClick Rule Algorithms row is added.">
62                                                         <i class="fa fa-plus"></i>
63                                                 </button>
64                                         </div>
65                                 </div>
66                                 <div class="form-group row">
67                                         <div
68                                                 data-ng-repeat="ruleAlgorithmschoice in temp.policy.ruleAlgorithmschoices">
69                                                 <div class="form-group row" style="margin-left: 2%">
70                                                 <div class="form-group col-sm-1">
71                                                         <label ng-model="ruleAlgorithmschoice.dynamicRuleAlgorithmLabels"
72                                                                 ng-disabled="temp.policy.readOnly"
73                                                                 name="dynamicRuleAlgorithmLabels">{{ruleAlgorithmschoice.id}}</label>
74                                                 </div>
75                                                 <div class="form-group col-sm-3">
76                                                         <select type="text" class="form-control"
77                                                                 ng-disabled="temp.policy.readOnly"
78                                                                 ng-model="ruleAlgorithmschoice.dynamicRuleAlgorithmField1"
79                                                                 ng-options="option for option in attributeDictionaryDatas track by option"
80                                                                 name="dynamicRuleAlgorithmField1" title="Select the dropdown value driven from Attribute (common)Dictionary.">
81                                                                 <option value="">{{ruleAlgorithmschoice.dynamicRuleAlgorithmField1}}</option>
82                                                         </select>
83                                                 </div>
84                                                 <div class="form-group col-sm-3">
85                                                         <select type="text" class="form-control"
86                                                                 ng-disabled="temp.policy.readOnly"
87                                                                 ng-model="ruleAlgorithmschoice.dynamicRuleAlgorithmCombo"
88                                                                 ng-options="option for option in functionDefinitionDatas"
89                                                                 name="dynamicRuleAlgorithmCombo" title="Select the dropdown value driven from FunctionDataType.">
90                                                                 <option value="">{{ruleAlgorithmschoice.dynamicRuleAlgorithmCombo}}</option>
91                                                         </select>
92                                                 </div>
93                                                 <div class="form-group col-sm-3">
94                                                         <input type="text" class="form-control"
95                                                                 ng-disabled="temp.policy.readOnly"
96                                                                 ng-model="ruleAlgorithmschoice.dynamicRuleAlgorithmField2"
97                                                                 name="dynamicRuleAlgorithmField2" title="Enter the Value without any spaces and special characters and for rule formation use A1, A2,..etc., based on above Rules."/>
98                                                 </div>
99                                                 <div class="form-group col-sm-1">
100                                                         <button type="button" class="btn btn-default" ng-show="$last"
101                                                                 ng-disabled="temp.policy.readOnly"
102                                                                 ng-click="removeRuleAlgorithm()" title="onClick will remove the last row">
103                                                                 <i class="fa fa-minus"></i>
104                                                         </button>
105                                                 </div>
106                                                 </div>
107                                         </div>
108                                 </div>
109                         </div>
110                         <div class="well">
111                                 <div class="form-group row">
112                                         <div class="form-group col-sm-6">
113                                                 <label>Action Performer:<sup><b>*</b></sup></label><BR> <select
114                                                         class="form-control" ng-disabled="temp.policy.readOnly"
115                                                         ng-model="temp.policy.actionPerformer" title="Select the Action Performer values from dropdown.">
116                                                         <option>PEP</option>
117                                                         <option>PDP</option>
118                                                 </select>
119                                         </div>
120                                         <div class="form-group col-sm-6">
121                                                 <label>Action Attribute:<sup><b>*</b></sup></label><br> <select
122                                                         class="form-control"
123                                                         ng-disabled="temp.policy.readOnly"
124                                                         ng-model="temp.policy.actionAttributeValue"
125                                                         ng-options="option for option in actionPolicyDictionaryDatas track by option" title="Select the dropdown value driven from Action (Action)Dictionary."></select>
126                                         </div>
127                                 </div>
128                         </div>
129                         <div id="validate" style="width: 70%"></div>
130                         <br>
131                         <div class="modal-footer">
132                                 <button class="btn btn-primary" herf="javascript:void(0)"
133                                         ng-disabled="temp.policy.readOnly"
134                                         ng-click="validatePolicy(temp.policy);" title="Validate the data entered in the Policy fields.">Validate</button>
135                                 <button class="btn btn-success" ng-disabled="savebutton"
136                                         herf="javascript:void(0)" ng-disabled="temp.policy.readOnly"
137                                         ng-click="saveActionPolicy(temp);" title="Save the Policy with validated data.">Save</button>
138                                 <button type="button" class="btn btn-default" ng-click="refresh();" title="Close the template.">Close</button>
139                         </div>
140         </form>
141 </div>