Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of github.com:Evolveum/midpoint
- Loading branch information
Showing
14 changed files
with
347 additions
and
198 deletions.
There are no files selected for viewing
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
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
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
56 changes: 56 additions & 0 deletions
56
...n/java/com/evolveum/midpoint/web/page/admin/certification/CertDefinitionSummaryPanel.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 |
---|---|---|
@@ -0,0 +1,56 @@ | ||
/* | ||
* Copyright (c) 2010-2016 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. | ||
*/ | ||
|
||
package com.evolveum.midpoint.web.page.admin.certification; | ||
|
||
import com.evolveum.midpoint.gui.api.GuiStyleConstants; | ||
import com.evolveum.midpoint.prism.PrismObject; | ||
import com.evolveum.midpoint.web.component.ObjectSummaryPanel; | ||
import com.evolveum.midpoint.xml.ns._public.common.common_3.AccessCertificationDefinitionType; | ||
import org.apache.wicket.model.IModel; | ||
|
||
import javax.xml.namespace.QName; | ||
|
||
/** | ||
* @author mederly | ||
*/ | ||
public class CertDefinitionSummaryPanel extends ObjectSummaryPanel<AccessCertificationDefinitionType> { | ||
|
||
public CertDefinitionSummaryPanel(String id, | ||
IModel<PrismObject<AccessCertificationDefinitionType>> model) { | ||
super(id, model); | ||
} | ||
|
||
@Override | ||
protected String getIconCssClass() { | ||
return GuiStyleConstants.CLASS_OBJECT_CERT_DEF_ICON; | ||
} | ||
|
||
@Override | ||
protected String getIconBoxAdditionalCssClass() { // TODO | ||
return "summary-panel-task"; // TODO | ||
} | ||
|
||
@Override | ||
protected String getBoxAdditionalCssClass() { // TODO | ||
return "summary-panel-task"; // TODO | ||
} | ||
|
||
@Override | ||
protected boolean isIdentifierVisible() { | ||
return false; | ||
} | ||
} |
101 changes: 101 additions & 0 deletions
101
...rc/main/java/com/evolveum/midpoint/web/page/admin/certification/DefinitionBasicPanel.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,101 @@ | ||
<!-- | ||
~ Copyright (c) 2010-2016 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="PageCertDefinition.name" class="col-md-4"/></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="PageCertDefinition.description" class="col-md-4"/></td> | ||
<td> | ||
<div class="col-md-6"> | ||
<textarea type="text" class="form-control input-sm" wicket:id="description"/> | ||
</div> | ||
</td> | ||
</tr> | ||
<tr> | ||
<td><wicket:message key="PageCertDefinition.owner" class="col-md-4"/></td> | ||
<td> | ||
<div class="col-md-6"> | ||
<div wicket:id="ownerRefChooser" > | ||
</div> | ||
</div> | ||
</td> | ||
</tr> | ||
<tr> | ||
<td><wicket:message key="PageCertDefinition.numberOfStages" class="col-md-4"/></td> | ||
<td><div wicket:id="numberOfStages" class="col-md-6"/></td> | ||
</tr> | ||
<tr> | ||
<td><wicket:message key="PageCertDefinition.outcomeStrategy"/></td> | ||
<td> | ||
<div class="col-xs-8"> | ||
<div class="row"> | ||
<div class="col-xs-9"> | ||
<select class="form-control input-sm" wicket:id="outcomeStrategy"/> | ||
<p>(<wicket:message key="PageCertDefinition.stopReviewOn"/> | ||
<span wicket:id="stopReviewOn"></span>)</p> | ||
</div> | ||
</div> | ||
</div> | ||
</td> | ||
</tr> | ||
<tr> | ||
<td><wicket:message key="StageDefinitionPanel.remediation"/></td> | ||
<td> | ||
<div class="col-xs-8"> | ||
<div class="row"> | ||
<div class="col-xs-9"> | ||
<select class="form-control input-sm" wicket:id="remediation"/> | ||
</div> | ||
</div> | ||
</div> | ||
</td> | ||
</tr> | ||
<!-- TODO visually separate definition and current status --> | ||
<!-- TODO do this in some "compressed" form to save space --> | ||
<!-- disabled for now | ||
<tr> | ||
<td><wicket:message key="PageCertDefinition.campaignsInReviewStage" class="col-md-4"/></td> | ||
<td><div wicket:id="campaignsInReviewStage" class="col-md-6"/></td> | ||
</tr> | ||
<tr> | ||
<td><wicket:message key="PageCertDefinition.campaignsTotal" class="col-md-4"/></td> | ||
<td><div wicket:id="campaignsTotal" class="col-md-6"/></td> | ||
</tr> --> | ||
<tr> | ||
<td><wicket:message key="PageCertDefinition.campaignLastStarted" class="col-md-4"/></td> | ||
<td><div wicket:id="campaignLastStarted" class="col-md-6"/></td> | ||
</tr> | ||
<tr> | ||
<td><wicket:message key="PageCertDefinition.campaignLastClosed" class="col-md-4"/></td> | ||
<td><div wicket:id="campaignLastClosed" class="col-md-6"/></td> | ||
</tr> | ||
</table> | ||
</div> | ||
</div> | ||
</wicket:panel> | ||
</html> |
151 changes: 151 additions & 0 deletions
151
...rc/main/java/com/evolveum/midpoint/web/page/admin/certification/DefinitionBasicPanel.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 |
---|---|---|
@@ -0,0 +1,151 @@ | ||
/* | ||
* Copyright (c) 2010-2016 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. | ||
*/ | ||
|
||
package com.evolveum.midpoint.web.page.admin.certification; | ||
|
||
import com.evolveum.midpoint.gui.api.component.BasePanel; | ||
import com.evolveum.midpoint.gui.api.util.WebComponentUtil; | ||
import com.evolveum.midpoint.web.component.util.VisibleEnableBehaviour; | ||
import com.evolveum.midpoint.web.page.admin.certification.dto.CertDefinitionDto; | ||
import com.evolveum.midpoint.web.page.admin.configuration.component.ChooseTypePanel; | ||
import com.evolveum.midpoint.web.page.admin.dto.ObjectViewDto; | ||
import com.evolveum.midpoint.xml.ns._public.common.common_3.AccessCertificationCaseOutcomeStrategyType; | ||
import com.evolveum.midpoint.xml.ns._public.common.common_3.AccessCertificationRemediationStyleType; | ||
import com.evolveum.midpoint.xml.ns._public.common.common_3.AccessCertificationResponseType; | ||
import com.evolveum.midpoint.xml.ns._public.common.common_3.UserType; | ||
import org.apache.wicket.markup.html.WebMarkupContainer; | ||
import org.apache.wicket.markup.html.basic.Label; | ||
import org.apache.wicket.markup.html.form.DropDownChoice; | ||
import org.apache.wicket.markup.html.form.EnumChoiceRenderer; | ||
import org.apache.wicket.markup.html.form.TextArea; | ||
import org.apache.wicket.markup.html.form.TextField; | ||
import org.apache.wicket.model.AbstractReadOnlyModel; | ||
import org.apache.wicket.model.IModel; | ||
import org.apache.wicket.model.Model; | ||
import org.apache.wicket.model.PropertyModel; | ||
|
||
import javax.xml.namespace.QName; | ||
import java.util.List; | ||
|
||
/** | ||
* @author mederly | ||
*/ | ||
|
||
public class DefinitionBasicPanel extends BasePanel<CertDefinitionDto> { | ||
|
||
private static final String ID_NAME = "name"; | ||
private static final String ID_DESCRIPTION = "description"; | ||
private static final String ID_OWNER = "owner"; | ||
private static final String ID_NUMBER_OF_STAGES = "numberOfStages"; | ||
private static final String ID_REVIEW_STAGE_CAMPAIGNS = "campaignsInReviewStage"; | ||
private static final String ID_CAMPAIGNS_TOTAL = "campaignsTotal"; | ||
private static final String ID_LAST_STARTED = "campaignLastStarted"; | ||
private static final String ID_LAST_CLOSED = "campaignLastClosed"; | ||
// private static final String ID_OWNER_VALUE_CONTAINER = "ownerValueContainer"; | ||
// private static final String ID_OWNER_INPUT = "ownerInput"; | ||
private static final String ID_OWNER_REF_CHOOSER = "ownerRefChooser"; | ||
private static final String ID_REMEDIATION = "remediation"; | ||
private static final String ID_OUTCOME_STRATEGY = "outcomeStrategy"; | ||
private static final String ID_STOP_REVIEW_ON = "stopReviewOn"; | ||
|
||
|
||
public DefinitionBasicPanel(String id, IModel<CertDefinitionDto> model) { | ||
super(id, model); | ||
initBasicInfoLayout(); | ||
} | ||
|
||
private void initBasicInfoLayout() { | ||
|
||
final TextField nameField = new TextField(ID_NAME, new PropertyModel<>(getModel(), CertDefinitionDto.F_NAME)); | ||
nameField.add(new VisibleEnableBehaviour() { | ||
@Override | ||
public boolean isEnabled() { | ||
return true; | ||
} | ||
}); | ||
add(nameField); | ||
|
||
final TextArea descriptionField = new TextArea(ID_DESCRIPTION, new PropertyModel<>(getModel(), CertDefinitionDto.F_DESCRIPTION)); | ||
descriptionField.add(new VisibleEnableBehaviour() { | ||
@Override | ||
public boolean isEnabled() { | ||
return true; | ||
} | ||
}); | ||
add(descriptionField); | ||
|
||
final WebMarkupContainer ownerRefChooser = createOwnerRefChooser(ID_OWNER_REF_CHOOSER); | ||
ownerRefChooser.setOutputMarkupId(true); | ||
add(ownerRefChooser); | ||
|
||
add(new Label(ID_NUMBER_OF_STAGES, new PropertyModel<>(getModel(), CertDefinitionDto.F_NUMBER_OF_STAGES))); | ||
|
||
DropDownChoice remediation = new DropDownChoice<>(ID_REMEDIATION, new Model<AccessCertificationRemediationStyleType>() { | ||
|
||
@Override | ||
public AccessCertificationRemediationStyleType getObject() { | ||
return getModel().getObject().getRemediationStyle(); | ||
} | ||
|
||
@Override | ||
public void setObject(AccessCertificationRemediationStyleType object) { | ||
getModel().getObject().setRemediationStyle(object); | ||
} | ||
}, WebComponentUtil.createReadonlyModelFromEnum(AccessCertificationRemediationStyleType.class), | ||
new EnumChoiceRenderer<AccessCertificationRemediationStyleType>(this)); | ||
add(remediation); | ||
|
||
DropDownChoice outcomeStrategy = | ||
new DropDownChoice<>(ID_OUTCOME_STRATEGY, | ||
new PropertyModel<AccessCertificationCaseOutcomeStrategyType>(getModel(), CertDefinitionDto.F_OUTCOME_STRATEGY), | ||
WebComponentUtil.createReadonlyModelFromEnum(AccessCertificationCaseOutcomeStrategyType.class), | ||
new EnumChoiceRenderer<AccessCertificationCaseOutcomeStrategyType>(this)); | ||
add(outcomeStrategy); | ||
|
||
Label stopReviewOn = new Label(ID_STOP_REVIEW_ON, new AbstractReadOnlyModel<String>() { | ||
@Override | ||
public String getObject() { | ||
List<AccessCertificationResponseType> stopOn = getModel().getObject().getStopReviewOn(); | ||
return CertMiscUtil.getStopReviewOnText(stopOn, getPageBase()); | ||
} | ||
}); | ||
add(stopReviewOn); | ||
|
||
// add(new Label(ID_REVIEW_STAGE_CAMPAIGNS, new PropertyModel<>(getModel(), CertDefinitionDto.F_NUMBER_OF_STAGES))); | ||
// add(new Label(ID_CAMPAIGNS_TOTAL, new PropertyModel<>(getModel(), CertDefinitionDto.F_NUMBER_OF_STAGES))); | ||
add(new Label(ID_LAST_STARTED, new PropertyModel<>(getModel(), CertDefinitionDto.F_LAST_STARTED))); | ||
add(new Label(ID_LAST_CLOSED, new PropertyModel<>(getModel(), CertDefinitionDto.F_LAST_CLOSED))); | ||
} | ||
|
||
private WebMarkupContainer createOwnerRefChooser(String id) { | ||
ChooseTypePanel tenantRef = new ChooseTypePanel(id, | ||
new PropertyModel<ObjectViewDto>(getModel(), CertDefinitionDto.F_OWNER)) { | ||
|
||
@Override | ||
protected boolean isSearchEnabled() { | ||
return true; | ||
} | ||
|
||
@Override | ||
protected QName getSearchProperty() { | ||
return UserType.F_NAME; | ||
} | ||
}; | ||
|
||
return tenantRef; | ||
} | ||
|
||
} |
Oops, something went wrong.