Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b975205
commit 4582ce6
Showing
7 changed files
with
189 additions
and
19 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
23 changes: 23 additions & 0 deletions
23
...in/java/com/evolveum/midpoint/web/page/admin/users/component/MergeObjectDetailsPanel.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,23 @@ | ||
<?xml version="1.0" encoding="UTF-8" ?> | ||
<!-- | ||
~ 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. | ||
--> | ||
|
||
<wicket:panel xmlns:wicket="http://wicket.apache.org"> | ||
<div wicket:id="objectName" class="form-control input-sm" /> | ||
<div wicket:id="objectFullName" class="form-control input-sm" /> | ||
<div wicket:id="objectAssignmentsCount" class="form-control input-sm" /> | ||
<div wicket:id="objectProjectionsCount" class="form-control input-sm" /> | ||
</wicket:panel> |
81 changes: 81 additions & 0 deletions
81
...in/java/com/evolveum/midpoint/web/page/admin/users/component/MergeObjectDetailsPanel.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,81 @@ | ||
/** | ||
* 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.users.component; | ||
|
||
import com.evolveum.midpoint.gui.api.component.BasePanel; | ||
import com.evolveum.midpoint.prism.PrismObject; | ||
import com.evolveum.midpoint.prism.PrismReference; | ||
import com.evolveum.midpoint.prism.path.ItemPath; | ||
import com.evolveum.midpoint.web.component.prism.ObjectWrapper; | ||
import com.evolveum.midpoint.xml.ns._public.common.common_3.*; | ||
import org.apache.wicket.markup.html.basic.Label; | ||
import org.apache.wicket.model.IModel; | ||
|
||
import java.util.ArrayList; | ||
import java.util.List; | ||
|
||
/** | ||
* Created by honchar. | ||
*/ | ||
public class MergeObjectDetailsPanel<F extends FocusType> extends BasePanel<F> { | ||
private static final String ID_OBJECT_NAME = "objectName"; | ||
private static final String ID_OBJECT_FULLNAME = "objectFullName"; | ||
private static final String ID_OBJECT_ASSIGNMENTS_COUNT = "objectAssignmentsCount"; | ||
private static final String ID_OBJECT_PROJECTIONS_COUNT = "objectProjectionsCount"; | ||
|
||
private F mergeObject; | ||
|
||
public MergeObjectDetailsPanel(String id, F mergeObject, Class<F> type){ | ||
super(id); | ||
this.mergeObject = mergeObject; | ||
initLayout(type); | ||
} | ||
|
||
private void initLayout(Class<F> type){ | ||
setOutputMarkupId(true); | ||
Label nameLabel = new Label(ID_OBJECT_NAME, mergeObject.getName()); | ||
add(nameLabel); | ||
|
||
Label fullNameLabel; | ||
if (UserType.class.equals(type)){ | ||
fullNameLabel = new Label(ID_OBJECT_FULLNAME, ((UserType) mergeObject).getFullName()); | ||
} else { | ||
fullNameLabel = new Label(ID_OBJECT_FULLNAME, ((AbstractRoleType) mergeObject).getDisplayName()); | ||
} | ||
add(fullNameLabel); | ||
|
||
Label assignmentsCount = new Label(ID_OBJECT_ASSIGNMENTS_COUNT, getAssignmentsCount()); | ||
add(assignmentsCount); | ||
|
||
Label projectionsCount = new Label(ID_OBJECT_PROJECTIONS_COUNT, getProjectionsCount()); | ||
add(projectionsCount); | ||
|
||
} | ||
|
||
private int getProjectionsCount(){ | ||
if (mergeObject == null){ | ||
return 0; | ||
} | ||
List<ObjectReferenceType> referenceTypes = mergeObject.getLinkRef(); | ||
return referenceTypes == null ? 0 : referenceTypes.size(); | ||
} | ||
|
||
private int getAssignmentsCount(){ | ||
return mergeObject != null ? | ||
(mergeObject.getAssignment() != null ? mergeObject.getAssignment().size() : 0) | ||
: 0; | ||
} | ||
} |
55 changes: 46 additions & 9 deletions
55
...src/main/java/com/evolveum/midpoint/web/page/admin/users/component/MergeObjectsPanel.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 |
---|---|---|
@@ -1,10 +1,47 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head lang="en"> | ||
<meta charset="UTF-8"> | ||
<title></title> | ||
</head> | ||
<body> | ||
<?xml version="1.0" encoding="UTF-8" ?> | ||
<!-- | ||
~ 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. | ||
--> | ||
|
||
</body> | ||
</html> | ||
<wicket:panel xmlns:wicket="http://wicket.apache.org"> | ||
<!--<form wicket:id="mainForm" class="form-horizontal">--> | ||
<div class="row"> | ||
<!--<select wicket:id="mergeType"/>--> | ||
<!----> | ||
<!--<div wicket:id="infoHelperButton"/>--> | ||
</div> | ||
<div class="row"> | ||
<div wicket:id="mergeObjectDetailsPanel" class="col-md-3"/> | ||
<div class="icon"> | ||
<i class="fa fa-plus" style="font-size: 30px;"></i> | ||
</div> | ||
<div class="col-md-1 fa fa-plus"/> | ||
<div wicket:id="mergeWithObjectDetailsPanel" class="col-md-3"/> | ||
<div class="icon"> | ||
<i class="fa fa-arrow-right" style="font-size: 30px;"></i> | ||
</div> | ||
<!--<div wicket:id="mergeResultObjectDetailsPanel" class="col-md-3"/>--> | ||
</div> | ||
<wicket:child/> | ||
|
||
<!--<div class="main-button-bar">--> | ||
<!--<span class="button-group">--> | ||
<!--<a class="btn btn-default" wicket:id="back"/>--> | ||
<!--</span>--> | ||
<!--<a class="btn btn-primary" wicket:id="switchDirection"/>--> | ||
<!--<a class="btn btn-primary" wicket:id="merge"/>--> | ||
<!--</div>--> | ||
<!--</form>--> | ||
</wicket:panel> |
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