Skip to content

Commit

Permalink
Merge branch 'feature/service-accounts' into feature/consistency-update
Browse files Browse the repository at this point in the history
  • Loading branch information
semancik committed Jul 23, 2018
2 parents 1adf106 + 0726190 commit 3280e9a
Show file tree
Hide file tree
Showing 101 changed files with 3,114 additions and 1,039 deletions.
Expand Up @@ -50,7 +50,7 @@ public abstract class AbstractAssignmentPopupTabPanel<O extends ObjectType> exte
private static final String DOT_CLASS = AbstractAssignmentPopupTabPanel.class.getName();

public AbstractAssignmentPopupTabPanel(String id, ObjectTypes type){
super(id, type);
super(id);
}

protected abstract Map<String, AssignmentType> getSelectedAssignmentsMap();
Expand Down
Expand Up @@ -15,6 +15,7 @@
-->

<wicket:panel xmlns:wicket="http://wicket.apache.org">
<div wicket:id="objectListPanel" />
<wicket:child />
<div wicket:id="objectListPanel" />
<div wicket:id="parametersPanel" />
</wicket:panel>
Expand Up @@ -15,13 +15,16 @@
*/
package com.evolveum.midpoint.gui.api.component;

import com.evolveum.midpoint.gui.api.model.LoadableModel;
import com.evolveum.midpoint.prism.query.ObjectQuery;
import com.evolveum.midpoint.schema.constants.ObjectTypes;
import com.evolveum.midpoint.web.component.util.SelectableBean;
import com.evolveum.midpoint.web.component.util.VisibleEnableBehaviour;
import com.evolveum.midpoint.xml.ns._public.common.common_3.ObjectType;
import org.apache.wicket.Component;
import org.apache.wicket.ajax.AjaxRequestTarget;
import org.apache.wicket.markup.html.WebMarkupContainer;
import org.apache.wicket.markup.html.panel.Fragment;
import org.apache.wicket.model.IModel;
import org.apache.wicket.model.Model;

Expand All @@ -35,24 +38,30 @@ public abstract class AbstractPopupTabPanel<O extends ObjectType> extends BasePa
private static final long serialVersionUID = 1L;

private static final String ID_OBJECT_LIST_PANEL = "objectListPanel";
private static final String ID_PARAMETERS_PANEL = "parametersPanel";
protected static final String ID_PARAMETERS_PANEL_FRAGMENT = "parametersPanelFragment";

protected ObjectTypes type;
protected List<O> preSelectedObjects = new ArrayList<>();

public AbstractPopupTabPanel(String id, ObjectTypes type){
public AbstractPopupTabPanel(String id){
super(id);
this.type = type;
}

@Override
protected void onInitialize(){
super.onInitialize();
setOutputMarkupId(true);
add(initObjectListPanel());
initParametersPanel();

Fragment parametersPanelFragment = new Fragment(ID_PARAMETERS_PANEL, ID_PARAMETERS_PANEL_FRAGMENT, this);
parametersPanelFragment.setOutputMarkupId(true);

initParametersPanel(parametersPanelFragment);
add(parametersPanelFragment);
}

private Component initObjectListPanel(){
PopupObjectListPanel<O> listPanel = new PopupObjectListPanel<O>(ID_OBJECT_LIST_PANEL, (Class)type.getClassDefinition(),
protected Component initObjectListPanel(){
PopupObjectListPanel<O> listPanel = new PopupObjectListPanel<O>(ID_OBJECT_LIST_PANEL, (Class)getObjectType().getClassDefinition(),
null, true, getPageBase(), getPreselectedObjects()) {

private static final long serialVersionUID = 1L;
Expand Down Expand Up @@ -87,7 +96,7 @@ public boolean isVisible(){
return listPanel;
}

protected abstract void initParametersPanel();
protected abstract void initParametersPanel(Fragment parametersPanel);

protected List<O> getPreselectedObjects(){
return preSelectedObjects;
Expand Down Expand Up @@ -119,7 +128,5 @@ protected boolean isObjectListPanelVisible(){
return true;
}

public ObjectTypes getType() {
return type;
}
protected abstract ObjectTypes getObjectType();
}
Expand Up @@ -29,6 +29,8 @@
import org.apache.wicket.markup.html.WebMarkupContainer;
import org.apache.wicket.markup.html.form.Form;
import org.apache.wicket.model.StringResourceModel;
import org.apache.wicket.protocol.http.ClientProperties;
import org.apache.wicket.protocol.http.WebSession;

import java.util.*;

Expand Down Expand Up @@ -123,6 +125,11 @@ public WebMarkupContainer createPanel(String panelId) {
protected void onSelectionPerformed(AjaxRequestTarget target){
tabLabelPanelUpdate(target);
}

@Override
protected ObjectTypes getObjectType(){
return ObjectTypes.ROLE;
}
};
}

Expand All @@ -147,6 +154,11 @@ protected void onSelectionPerformed(AjaxRequestTarget target){
tabLabelPanelUpdate(target);
}

@Override
protected ObjectTypes getObjectType(){
return ObjectTypes.ORG;
}

@Override
protected List<OrgType> getPreselectedObjects(){
return selectedOrgsList;
Expand Down Expand Up @@ -199,6 +211,11 @@ public WebMarkupContainer createPanel(String panelId) {
return new FocusTypeAssignmentPopupTabPanel(panelId, ObjectTypes.SERVICE){
private static final long serialVersionUID = 1L;

@Override
protected ObjectTypes getObjectType(){
return ObjectTypes.SERVICE;
}

@Override
protected void onSelectionPerformed(AjaxRequestTarget target){
tabLabelPanelUpdate(target);
Expand Down Expand Up @@ -260,11 +277,21 @@ protected void addPerformed(AjaxRequestTarget target, List newAssignmentsList) {
}

public int getWidth(){
return 900;
return 80;
}

public int getHeight(){
return 1200;
return 80;
}

@Override
public String getWidthUnit(){
return "%";
}

@Override
public String getHeightUnit(){
return "%";
}

public StringResourceModel getTitle(){
Expand Down
@@ -0,0 +1,74 @@
/*
* 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.api.component;

import com.evolveum.midpoint.gui.api.component.tabs.CountablePanelTab;
import com.evolveum.midpoint.schema.constants.ObjectTypes;
import com.evolveum.midpoint.schema.constants.RelationTypes;

/**
* Created by honchar
*/

import com.evolveum.midpoint.xml.ns._public.common.common_3.ObjectType;
import com.evolveum.midpoint.xml.ns._public.common.common_3.OrgType;
import org.apache.wicket.ajax.AjaxRequestTarget;
import org.apache.wicket.extensions.markup.html.tabs.ITab;
import org.apache.wicket.markup.html.WebMarkupContainer;

import java.util.ArrayList;
import java.util.List;

public abstract class ChooseMemberForOrgPopup<O extends ObjectType> extends ChooseMemberPopup<O, OrgType> {
private static final long serialVersionUID = 1L;

public ChooseMemberForOrgPopup(String id, List<RelationTypes> availableRelationList){
super(id, availableRelationList);
}

@Override
protected List<ITab> createAssignmentTabs() {
List<ITab> tabs = super.createAssignmentTabs();
tabs.add(new CountablePanelTab(getPageBase().createStringResource("chooseMemberForOrgPopup.otherTypesLabel"), null) {

private static final long serialVersionUID = 1L;

@Override
public WebMarkupContainer createPanel(String panelId) {
return new MultiTypesMemberPopupTabPanel(panelId, availableRelationList){
private static final long serialVersionUID = 1L;

@Override
protected void onSelectionPerformed(AjaxRequestTarget target){
tabLabelPanelUpdate(target);
}

@Override
protected OrgType getAbstractRoleTypeObject(){
return ChooseMemberForOrgPopup.this.getAssignmentTargetRefObject();
}
};
}

@Override
public String getCount() {
return Integer.toString(getTabPanelSelectedCount(getPanel()));
}
});
return tabs;
}

}

0 comments on commit 3280e9a

Please sign in to comment.