Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
creating MultivalueContainerDetailsPanel class and using wicket:fragment
- Loading branch information
Showing
11 changed files
with
357 additions
and
66 deletions.
There are no files selected for viewing
26 changes: 26 additions & 0 deletions
26
...c/main/java/com/evolveum/midpoint/gui/impl/component/MultivalueContainerDetailsPanel.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,26 @@ | ||
<!-- | ||
~ Copyright (c) 2010-2018 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. | ||
--> | ||
<html xmlns="http://www.w3.org/1999/xhtml" | ||
xmlns:wicket="http://wicket.apache.org"> | ||
<body> | ||
<wicket:panel> | ||
<div wicket:id="displayName"/> | ||
<div wicket:id="specificContainers" /> | ||
<div class="container-fluid prism-object" wicket:id="basicPanel" /> | ||
<!-- <div class="container-fluid prism-object" wicket:id="activationPanel" /> --> | ||
</wicket:panel> | ||
</body> | ||
</html> |
134 changes: 134 additions & 0 deletions
134
...c/main/java/com/evolveum/midpoint/gui/impl/component/MultivalueContainerDetailsPanel.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,134 @@ | ||
/* | ||
* Copyright (c) 2010-2018 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.gui.impl.component; | ||
|
||
import java.util.ArrayList; | ||
import java.util.List; | ||
|
||
import javax.xml.namespace.QName; | ||
|
||
import org.apache.wicket.markup.html.WebMarkupContainer; | ||
import org.apache.wicket.model.AbstractReadOnlyModel; | ||
import org.apache.wicket.model.IModel; | ||
import org.apache.wicket.model.Model; | ||
|
||
import com.evolveum.midpoint.gui.api.component.BasePanel; | ||
import com.evolveum.midpoint.gui.api.component.DisplayNamePanel; | ||
import com.evolveum.midpoint.gui.api.util.WebComponentUtil; | ||
import com.evolveum.midpoint.gui.api.util.WebModelServiceUtils; | ||
import com.evolveum.midpoint.prism.Containerable; | ||
import com.evolveum.midpoint.prism.path.ItemPath; | ||
import com.evolveum.midpoint.task.api.Task; | ||
import com.evolveum.midpoint.util.logging.Trace; | ||
import com.evolveum.midpoint.util.logging.TraceManager; | ||
import com.evolveum.midpoint.web.component.assignment.AbstractAssignmentDetailsPanel; | ||
import com.evolveum.midpoint.web.component.assignment.AssignmentsUtil; | ||
import com.evolveum.midpoint.web.component.form.Form; | ||
import com.evolveum.midpoint.web.component.prism.ContainerValuePanel; | ||
import com.evolveum.midpoint.web.component.prism.ContainerValueWrapper; | ||
import com.evolveum.midpoint.web.component.prism.ContainerWrapper; | ||
import com.evolveum.midpoint.web.component.prism.ItemVisibility; | ||
import com.evolveum.midpoint.web.component.prism.ItemWrapper; | ||
import com.evolveum.midpoint.web.component.prism.PrismContainerPanel; | ||
import com.evolveum.midpoint.web.component.prism.PropertyOrReferenceWrapper; | ||
import com.evolveum.midpoint.web.model.ContainerWrapperFromObjectWrapperModel; | ||
import com.evolveum.midpoint.web.page.admin.PageAdminObjectDetails; | ||
import com.evolveum.midpoint.xml.ns._public.common.common_3.ActivationType; | ||
import com.evolveum.midpoint.xml.ns._public.common.common_3.AssignmentType; | ||
import com.evolveum.midpoint.xml.ns._public.common.common_3.ConstructionType; | ||
import com.evolveum.midpoint.xml.ns._public.common.common_3.ObjectReferenceType; | ||
import com.evolveum.midpoint.xml.ns._public.common.common_3.ObjectType; | ||
import com.evolveum.midpoint.xml.ns._public.common.common_3.OrgType; | ||
import com.evolveum.midpoint.xml.ns._public.common.common_3.PolicyRuleType; | ||
import com.evolveum.midpoint.xml.ns._public.common.common_3.SystemConfigurationType; | ||
|
||
/** | ||
* @author skublik | ||
*/ | ||
|
||
public abstract class MultivalueContainerDetailsPanel<C extends Containerable> extends BasePanel<ContainerValueWrapper<C>> { | ||
private static final long serialVersionUID = 1L; | ||
|
||
private final static String ID_DISPLAY_NAME = "displayName"; | ||
// private final static String ID_ACTIVATION_PANEL = "activationPanel"; | ||
private final static String ID_BASIC_PANEL = "basicPanel"; | ||
protected final static String ID_SPECIFIC_CONTAINERS = "specificContainers"; | ||
|
||
public MultivalueContainerDetailsPanel(String id, IModel<ContainerValueWrapper<C>> assignmentModel){ | ||
super(id, assignmentModel); | ||
} | ||
|
||
@Override | ||
protected void onInitialize() { | ||
super.onInitialize(); | ||
initLayout(); | ||
setOutputMarkupId(true); | ||
} | ||
|
||
protected abstract IModel<C> createDisplayNameModel(); | ||
|
||
protected QName getRelationForDisplayNamePanel() { | ||
return null; | ||
} | ||
|
||
protected IModel<String> getKindIntentLabelModelForDisplayNamePanel(){ | ||
return Model.of(""); | ||
} | ||
|
||
protected void initLayout(){ | ||
|
||
final IModel<C> displayNameModel = createDisplayNameModel(); | ||
|
||
DisplayNamePanel<C> displayNamePanel = new DisplayNamePanel<C>(ID_DISPLAY_NAME, displayNameModel) { | ||
|
||
@Override | ||
protected QName getRelation() { | ||
return getRelationForDisplayNamePanel(); | ||
} | ||
|
||
@Override | ||
protected IModel<String> getKindIntentLabelModel() { | ||
return getKindIntentLabelModelForDisplayNamePanel(); | ||
} | ||
|
||
}; | ||
|
||
displayNamePanel.setOutputMarkupId(true); | ||
add(displayNamePanel); | ||
|
||
add(getBasicContainerValuePanel(ID_BASIC_PANEL)); | ||
|
||
WebMarkupContainer specificContainers = new WebMarkupContainer(ID_SPECIFIC_CONTAINERS); | ||
specificContainers.setOutputMarkupId(true); | ||
add(specificContainers); | ||
|
||
createSpecificContainers(specificContainers); | ||
} | ||
|
||
protected abstract void createSpecificContainers(WebMarkupContainer specificContainers); | ||
|
||
protected <O extends ObjectType> ContainerValuePanel<C> getBasicContainerValuePanel(String idPanel){ | ||
Form form = new Form<>("form"); | ||
ItemPath itemPath = getModelObject().getPath(); | ||
return new ContainerValuePanel(idPanel, getModel(), true, form, | ||
itemWrapper -> getBasicTabVisibity(itemWrapper, itemPath), getPageBase()); | ||
} | ||
|
||
protected ItemVisibility getBasicTabVisibity(ItemWrapper itemWrapper, ItemPath parentAssignmentPath) { | ||
return ItemVisibility.AUTO; | ||
} | ||
|
||
} |
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
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
Oops, something went wrong.