Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'access-certification' of github.com:Evolveum/midpoint i…
…nto access-certification Conflicts: gui/admin-gui/src/main/java/com/evolveum/midpoint/web/page/admin/certification/dto/CertDefinitionDto.java
- Loading branch information
Showing
6 changed files
with
299 additions
and
69 deletions.
There are no files selected for viewing
145 changes: 145 additions & 0 deletions
145
...rc/main/java/com/evolveum/midpoint/web/page/admin/certification/StageDefinitionPanel.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,145 @@ | ||
<!-- | ||
~ Copyright (c) 2010-2015 Evolveum | ||
~ | ||
~ Licensed under the Apache License, Version 2.0 (the "License"); | ||
~ you may not use this file except in compliance with the License. | ||
~ You may obtain a copy of the License at | ||
~ | ||
~ http://www.apache.org/licenses/LICENSE-2.0 | ||
~ | ||
~ Unless required by applicable law or agreed to in writing, software | ||
~ distributed under the License is distributed on an "AS IS" BASIS, | ||
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
~ See the License for the specific language governing permissions and | ||
~ limitations under the License. | ||
--> | ||
|
||
<!DOCTYPE html> | ||
<html xmlns:wicket="http://wicket.apache.org"> | ||
<wicket:panel> | ||
<div class="box box-success"> | ||
<div class="box-body no-padding"> | ||
<table class="table table-striped"> | ||
<tr> | ||
<td><wicket:message key="StageDefinitionPanel.stageName"/></td> | ||
<td> | ||
<div class="col-md-6"> | ||
<input type="text" class="form-control input-sm" wicket:id="name"/> | ||
</div> | ||
</td> | ||
</tr> | ||
<tr> | ||
<td><wicket:message key="StageDefinitionPanel.stageDescription"/></td> | ||
<td> | ||
<div class="col-md-6"> | ||
<textarea class="form-control input-sm" rows="2" wicket:id="description"/> | ||
</div> | ||
</td> | ||
</tr> | ||
<tr> | ||
<td><wicket:message key="StageDefinitionPanel.notifyBeforeDeadline"/></td> | ||
<td> | ||
<div class="col-md-6"> | ||
<input type="text" class="form-control input-sm" wicket:id="duration"/> | ||
</div> | ||
</td> | ||
</tr> | ||
<!--<tr>--> | ||
<!--<td><wicket:message key="StageDefinitionPanel.notifyWhenNoDecision"/></td>--> | ||
<!--<td>--> | ||
<!--<div class="col-md-6">--> | ||
<!--<input type="checkbox" wicket:id="notifyOnlyWhenNoDecision">--> | ||
<!--</div>--> | ||
<!--</td>--> | ||
<!--</tr>--> | ||
<!--<tr>--> | ||
<!--<td colspan="2"><wicket:message key="StageDefinitionPanel.reviewerSpecification"/></td>--> | ||
<!--</tr>--> | ||
<!--<tr>--> | ||
<!--<td><wicket:message key="StageDefinitionPanel.reviewerName"/></td>--> | ||
<!--<td>--> | ||
<!--<div class="col-md-6">--> | ||
<!--<input type="text" class="form-control input-sm" wicket:id="reviewerName"/>--> | ||
<!--</div>--> | ||
<!--</td>--> | ||
<!--</tr>--> | ||
<!--<tr>--> | ||
<!--<td><wicket:message key="StageDefinitionPanel.reviewerDescription"/></td>--> | ||
<!--<td>--> | ||
<!--<div class="col-md-6">--> | ||
<!--<textarea class="form-control input-sm" rows="2" wicket:id="reviewerDescription"/>--> | ||
<!--</div>--> | ||
<!--</td>--> | ||
<!--</tr>--> | ||
<!--<tr>--> | ||
<!--<td>--> | ||
<!--<label style="margin-right:30px;">--> | ||
<!--<input type="checkbox" wicket:id="useTargetOwner">--> | ||
<!--<wicket:message key="StageDefinitionPanel.reviewerUseTargetOwner"/>--> | ||
<!--</label>--> | ||
<!--</td>--> | ||
<!--<td>--> | ||
<!--<label style="margin-right:30px;">--> | ||
<!--<input type="checkbox" wicket:id="useTargetApprover">--> | ||
<!--<wicket:message key="StageDefinitionPanel.reviewerUseTargetApprover"/>--> | ||
<!--</label>--> | ||
<!--</td>--> | ||
<!--</tr>--> | ||
<!--<tr>--> | ||
<!--<td>--> | ||
<!--<label style="margin-right:30px;">--> | ||
<!--<input type="checkbox" wicket:id="useObjectOwner">--> | ||
<!--<wicket:message key="StageDefinitionPanel.reviewerUseObjectOwner"/>--> | ||
<!--</label>--> | ||
<!--</td>--> | ||
<!--<td>--> | ||
<!--<label style="margin-right:30px;">--> | ||
<!--<input type="checkbox" wicket:id="useObjectApprover">--> | ||
<!--<wicket:message key="StageDefinitionPanel.reviewerUseObjectApprover"/>--> | ||
<!--</label>--> | ||
<!--</td>--> | ||
<!--</tr>--> | ||
<!--<tr>--> | ||
<!--<td>--> | ||
<!--<label style="margin-right:30px;">--> | ||
<!--<input type="checkbox" wicket:id="useObjectManager">--> | ||
<!--<wicket:message key="StageDefinitionPanel.reviewerUseObjectManager"/>--> | ||
<!--</label>--> | ||
<!--</td>--> | ||
<!--<td>--> | ||
<!--</td>--> | ||
<!--</tr>--> | ||
<!--<tr>--> | ||
<!--<td><wicket:message key="StageDefinitionPanel.defaultReviewerRef"/></td>--> | ||
<!--<td>--> | ||
<!--<div class="col-md-6">--> | ||
<!--<div wicket:id="defaultReviewerRefContainer" class="row">--> | ||
<!--<div wicket:id="defaultReviewerRef" class="col-xs-9"/>--> | ||
<!--</div>--> | ||
<!--</div>--> | ||
<!--</td>--> | ||
<!--</tr>--> | ||
<!--<tr>--> | ||
<!--<td><wicket:message key="StageDefinitionPanel.additionalReviewerRef"/></td>--> | ||
<!--<td>--> | ||
<!--<div class="col-md-6">--> | ||
<!--<div wicket:id="additionalReviewerRefContainer" class="row">--> | ||
<!--<div wicket:id="additionalReviewerRef" class="col-xs-9"/>--> | ||
<!--</div>--> | ||
<!--</div>--> | ||
<!--</td>--> | ||
<!--</tr>--> | ||
<!--<tr>--> | ||
<!--<td><wicket:message key="StageDefinitionPanel.reviewerApprovalStrategy"/></td>--> | ||
<!--<td>--> | ||
<!--<div class="col-md-6">--> | ||
<!--<input type="checkbox" wicket:id="approvalStrategyCheckbox">--> | ||
<!--<input type="text" class="form-control input-sm" wicket:id="approvalStrategyInput"/>--> | ||
<!--</div>--> | ||
<!--</td>--> | ||
<!--</tr>--> | ||
</table> | ||
</div> | ||
</div> | ||
</wicket:panel> | ||
</html> |
68 changes: 68 additions & 0 deletions
68
...rc/main/java/com/evolveum/midpoint/web/page/admin/certification/StageDefinitionPanel.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,87 @@ | ||
package com.evolveum.midpoint.web.page.admin.certification; | ||
|
||
import com.evolveum.midpoint.web.component.util.SimplePanel; | ||
import com.evolveum.midpoint.web.component.util.VisibleEnableBehaviour; | ||
import com.evolveum.midpoint.web.page.admin.certification.dto.DefinitionScopeDto; | ||
import com.evolveum.midpoint.web.page.admin.certification.dto.StageDefinitionDto; | ||
import org.apache.wicket.markup.html.form.TextArea; | ||
import org.apache.wicket.markup.html.form.TextField; | ||
import org.apache.wicket.model.IModel; | ||
import org.apache.wicket.model.PropertyModel; | ||
|
||
import java.util.ArrayList; | ||
import java.util.List; | ||
|
||
/** | ||
* Created by Kate Honchar. | ||
*/ | ||
public class StageDefinitionPanel extends SimplePanel<StageDefinitionDto> { | ||
private static final String ID_NAME = "name"; | ||
private static final String ID_DESCRIPTION = "description"; | ||
private static final String ID_DURATION = "duration"; | ||
private static final String ID_NOTIFY_BEFORE_DEADLINE = "notifyBeforeDeadline"; | ||
private static final String ID_NOTIFY_ONLY_WHEN_NO_DECISION = "notifyOnlyWhenNoDecision"; | ||
private static final String ID_REVIEWER_NAME= "reviewerName"; | ||
private static final String ID_REVIEWER_DESCRIPTION = "reviewerDescription"; | ||
private static final String ID_USE_TARGET_OWNER = "useTargetOwner"; | ||
private static final String ID_USE_TARGET_APPROVER = "useTargetApprover"; | ||
private static final String ID_USE_OBJECT_OWNER = "useObjectOwner"; | ||
private static final String ID_USE_OBJECT_APPROVER = "useObjectApprover"; | ||
private static final String ID_USE_OBJECT_MANAGER = "useObjectManager"; | ||
private static final String ID_DEFAULT_REVIEWER_REF_CONTAINER = "defaultReviewerRefContainer"; | ||
private static final String ID_DEFAULT_REVIEWER_REF = "defaultReviewerRef"; | ||
private static final String ID_ADDITIONAL_REVIEWER_REF_CONTAINER = "additionalReviewerRefContainer"; | ||
private static final String ID_ADDITIONAL_REVIEWER_REF = "additionalReviewerRef"; | ||
private static final String ID_APPROVAL_STRATEGY_CHECKBOX = "approvalStrategyCheckbox"; | ||
private static final String ID_APPROVAL_STRATEGY_INPUT = "approvalStrategyInput"; | ||
|
||
public StageDefinitionPanel(String id, IModel<StageDefinitionDto> model) { | ||
super(id, model); | ||
} | ||
|
||
@Override | ||
protected void initLayout() { | ||
TextField nameField = new TextField(ID_NAME, new PropertyModel<>(getModel(), StageDefinitionDto.F_NAME)); | ||
add(nameField); | ||
|
||
TextArea descriptionField = new TextArea(ID_DESCRIPTION, new PropertyModel<>(getModel(), StageDefinitionDto.F_DESCRIPTION)); | ||
add(descriptionField); | ||
|
||
TextField durationField = new TextField(ID_DURATION, new PropertyModel<>(getModel(), StageDefinitionDto.F_DAYS)); | ||
add(durationField); | ||
|
||
TextField notifyBeforeDeadlineField = new TextField(ID_NOTIFY_BEFORE_DEADLINE, new IModel<String>() { | ||
@Override | ||
public String getObject() { | ||
List<Integer> list = getModelObject().getNotifyBeforeDeadline(); | ||
String notifyBeforeDeadlineValue = ""; | ||
for (Integer listItem : list){ | ||
notifyBeforeDeadlineValue += Integer.toString(listItem); | ||
if(list.indexOf(listItem) < list.size() - 1){ | ||
notifyBeforeDeadlineValue += ", "; | ||
} | ||
} | ||
return notifyBeforeDeadlineValue; | ||
} | ||
|
||
@Override | ||
public void setObject(String object) { | ||
List<Integer> list = new ArrayList<>(); | ||
String[] values = object.split(","); | ||
for (String value : values){ | ||
if (! value.trim().equals("")){ | ||
list.add(Integer.parseInt(value.trim())); | ||
} | ||
} | ||
} | ||
|
||
@Override | ||
public void detach() { | ||
|
||
} | ||
}); | ||
add(notifyBeforeDeadlineField); | ||
|
||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.