Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/Evolveum/midpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
KaterynaHonchar committed Sep 11, 2018
2 parents 52621e1 + 62898ba commit a7d010f
Show file tree
Hide file tree
Showing 391 changed files with 4,877 additions and 8,589 deletions.
2 changes: 1 addition & 1 deletion build-system/pom.xml
Expand Up @@ -83,7 +83,7 @@
<activiti-spring.version>5.22.0</activiti-spring.version>
<commons-email.version>1.3</commons-email.version>
<xmlsec.version>2.0.6</xmlsec.version>
<connid.version>1.4.3.41</connid.version>
<connid.version>1.4.3.43</connid.version>
<jasper.version>6.5.0</jasper.version>
<derby.version>10.11.1.1</derby.version>
<wro4j.version>1.8.0</wro4j.version>
Expand Down
9 changes: 9 additions & 0 deletions gui/admin-gui/pom.xml
Expand Up @@ -145,6 +145,15 @@
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-transports-http</artifactId>
</dependency>

<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-actuator-autoconfigure</artifactId>
</dependency>

<dependency>
<groupId>org.webjars</groupId>
Expand Down
Expand Up @@ -163,8 +163,7 @@ private boolean isIdentifierVisible() {
// TODO: maybe move relation methods to subclass if we want this panel to be really reusable

private boolean isRelationVisible() {
QName relation = getRelation();
return relation != null && !QNameUtil.match(SchemaConstants.ORG_DEFAULT, relation);
return !WebComponentUtil.isDefaultRelation(getRelation());
}

private boolean isKindIntentVisible(IModel<String> kindIntentLabelModel) {
Expand Down
Expand Up @@ -18,24 +18,17 @@
import com.evolveum.midpoint.gui.api.page.PageBase;
import com.evolveum.midpoint.gui.api.util.WebComponentUtil;
import com.evolveum.midpoint.prism.delta.ObjectDelta;
import com.evolveum.midpoint.schema.constants.ObjectTypes;
import com.evolveum.midpoint.schema.constants.RelationTypes;
import com.evolveum.midpoint.schema.constants.SchemaConstants;
import com.evolveum.midpoint.schema.result.OperationResult;
import com.evolveum.midpoint.schema.util.ObjectTypeUtil;
import com.evolveum.midpoint.util.exception.SchemaException;
import com.evolveum.midpoint.util.logging.LoggingUtils;
import com.evolveum.midpoint.util.logging.Trace;
import com.evolveum.midpoint.util.logging.TraceManager;
import com.evolveum.midpoint.web.component.input.DropDownChoicePanel;
import com.evolveum.midpoint.web.component.input.RelationDropDownChoicePanel;
import com.evolveum.midpoint.web.component.util.VisibleEnableBehaviour;
import com.evolveum.midpoint.web.page.admin.configuration.component.EmptyOnChangeAjaxFormUpdatingBehavior;
import com.evolveum.midpoint.xml.ns._public.common.common_3.*;
import org.apache.commons.collections.CollectionUtils;
import org.apache.wicket.markup.html.WebMarkupContainer;
import org.apache.wicket.markup.html.panel.Fragment;
import org.apache.wicket.model.Model;

import javax.xml.namespace.QName;
import java.util.ArrayList;
Expand Down Expand Up @@ -94,8 +87,7 @@ protected ObjectDelta prepareDelta(){
Class classType = WebComponentUtil.qnameToClass(pageBase.getPrismContext(), getObjectType().getTypeQName());
delta = ObjectDelta.createEmptyModifyDelta(classType, "fakeOid", pageBase.getPrismContext());
AssignmentType newAssignment = new AssignmentType();
ObjectReferenceType ref = ObjectTypeUtil.createObjectRef(getAbstractRoleTypeObject());
ref.setRelation(getRelationValue());
ObjectReferenceType ref = ObjectTypeUtil.createObjectRef(getAbstractRoleTypeObject(), getRelationValue());
newAssignment.setTargetRef(ref);

pageBase.getPrismContext().adopt(newAssignment);
Expand Down
Expand Up @@ -19,24 +19,16 @@
import com.evolveum.midpoint.gui.api.util.WebComponentUtil;
import com.evolveum.midpoint.prism.delta.ObjectDelta;
import com.evolveum.midpoint.schema.constants.ObjectTypes;
import com.evolveum.midpoint.schema.constants.RelationTypes;
import com.evolveum.midpoint.schema.util.ObjectTypeUtil;
import com.evolveum.midpoint.task.api.Task;
import com.evolveum.midpoint.task.api.TaskCategory;
import com.evolveum.midpoint.util.exception.SchemaException;
import com.evolveum.midpoint.util.logging.LoggingUtils;
import com.evolveum.midpoint.util.logging.Trace;
import com.evolveum.midpoint.util.logging.TraceManager;
import com.evolveum.midpoint.web.page.admin.roles.AbstractRoleMemberPanel;
import com.evolveum.midpoint.xml.ns._public.common.common_3.ObjectReferenceType;
import com.evolveum.midpoint.xml.ns._public.common.common_3.ObjectType;
import org.apache.wicket.ajax.AjaxRequestTarget;
import org.apache.wicket.ajax.form.OnChangeAjaxBehavior;
import org.apache.wicket.markup.html.WebMarkupContainer;
import org.apache.wicket.markup.html.form.DropDownChoice;
import org.apache.wicket.markup.html.form.EnumChoiceRenderer;
import org.apache.wicket.model.IModel;
import org.apache.wicket.model.Model;

import javax.xml.namespace.QName;
import java.util.ArrayList;
Expand Down Expand Up @@ -93,8 +85,7 @@ protected void onUpdate(AjaxRequestTarget target) {
@Override
protected ObjectDelta prepareDelta(){
Class classType = WebComponentUtil.qnameToClass(getPageBase().getPrismContext(), getObjectType().getTypeQName());
ObjectReferenceType ref = ObjectTypeUtil.createObjectRef(getAbstractRoleTypeObject());
ref.setRelation(getRelationValue());
ObjectReferenceType ref = ObjectTypeUtil.createObjectRef(getAbstractRoleTypeObject(), getRelationValue());
return ObjectDelta.createModificationAddReference(classType, "fakeOid",
ObjectType.F_PARENT_ORG_REF, getPageBase().getPrismContext(),
ref.asReferenceValue());
Expand Down
Expand Up @@ -161,7 +161,9 @@ protected Map<String, AssignmentType> getSelectedAssignmentsMap(){
ShadowKindType kind = getKindValue();
String intent = getIntentValue();
selectedObjects.forEach(selectedObject -> {
assignmentList.put(selectedObject.getOid(), ObjectTypeUtil.createAssignmentWithConstruction(selectedObject.asPrismObject(), kind, intent));
assignmentList.put(selectedObject.getOid(),
ObjectTypeUtil.createAssignmentWithConstruction(
selectedObject.asPrismObject(), kind, intent, getPageBase().getPrismContext()));
});
return assignmentList;
}
Expand Down
Expand Up @@ -364,7 +364,7 @@ private QName getSelectedRelation(){
DropDownChoicePanel<RelationTypes> relationPanel = (DropDownChoicePanel<RelationTypes>) get(ID_RELATION_CONTAINER).get(ID_RELATION);
RelationTypes relation = relationPanel.getModel().getObject();
if (relation == null) {
return SchemaConstants.ORG_DEFAULT;
return WebComponentUtil.getDefaultRelationOrFail();
}
return relation.getRelation();
}
Expand Down
Expand Up @@ -30,7 +30,6 @@
import com.evolveum.midpoint.gui.api.util.ModelServiceLocator;
import com.evolveum.midpoint.gui.api.util.WebComponentUtil;
import com.evolveum.midpoint.gui.api.util.WebModelServiceUtils;
import com.evolveum.midpoint.gui.impl.page.admin.configuration.component.SystemConfigPanelNew;
import com.evolveum.midpoint.model.api.*;
import com.evolveum.midpoint.model.api.expr.MidpointFunctions;
import com.evolveum.midpoint.model.api.validator.ResourceValidator;
Expand All @@ -48,6 +47,7 @@
import com.evolveum.midpoint.repo.common.expression.ExpressionFactory;
import com.evolveum.midpoint.repo.common.expression.ExpressionVariables;
import com.evolveum.midpoint.report.api.ReportManager;
import com.evolveum.midpoint.schema.RelationRegistry;
import com.evolveum.midpoint.schema.constants.ExpressionConstants;
import com.evolveum.midpoint.schema.constants.SchemaConstants;
import com.evolveum.midpoint.schema.internals.InternalsConfig;
Expand Down Expand Up @@ -165,9 +165,7 @@
import javax.management.MBeanServer;
import javax.management.MBeanServerFactory;
import javax.management.ObjectName;
import javax.xml.namespace.QName;

import java.io.Serializable;
import java.util.*;

/**
Expand Down Expand Up @@ -358,7 +356,7 @@ protected Integer load() {
Task task = createSimpleTask(OPERATION_LOAD_WORK_ITEM_COUNT);
S_FilterEntryOrEmpty q = QueryBuilder.queryFor(WorkItemType.class, getPrismContext());
ObjectQuery query = QueryUtils.filterForAssignees(q, getPrincipal(),
OtherPrivilegesLimitationType.F_APPROVAL_WORK_ITEMS).build();
OtherPrivilegesLimitationType.F_APPROVAL_WORK_ITEMS, getRelationRegistry()).build();
return getModelService().countContainers(WorkItemType.class, query, null, task, task.getResult());
} catch (SchemaException | SecurityViolationException | ExpressionEvaluationException | ObjectNotFoundException | CommunicationException | ConfigurationException e) {
LoggingUtils.logExceptionAsWarning(LOGGER, "Couldn't load work item count", e);
Expand Down Expand Up @@ -472,6 +470,10 @@ public PrismContext getPrismContext() {
return getMidpointApplication().getPrismContext();
}

public RelationRegistry getRelationRegistry() {
return getMidpointApplication().getRelationRegistry();
}

public ExpressionFactory getExpressionFactory() {
return getMidpointApplication().getExpressionFactory();
}
Expand Down Expand Up @@ -1534,18 +1536,6 @@ protected List<SideBarMenuItem> createMenuItems() {
return menus;
}

// private MainMenuItem createSystemConfigurationItems() {
// MainMenuItem item = new MainMenuItem(GuiStyleConstants.CLASS_SYSTEM_CONFIGURATION_ICON_COLORED,
// createStringResource("PageAdmin.menu.top.configuration.basic.new"), PageSystemConfigurationNew.class);
//
// addMenuItem(item, "PageAdmin.menu.top.configuration.basic", SystemConfigPanelNew.class);
// addMenuItem(item, "PageAdmin.menu.top.configuration.objectPolicy", PageUsers.class);
// addMenuItem(item, "PageAdmin.menu.top.users.list", PageUsers.class);
//
// addUsersViewMenuItems(item.getItems());
//
// return item;
// }

private void createConfigurationMenu(SideBarMenuItem item) {
addMainMenuItem(item, "fa fa-bullseye", "PageAdmin.menu.top.configuration.bulkActions", PageBulkAction.class);
Expand All @@ -1559,53 +1549,40 @@ private void createConfigurationMenu(SideBarMenuItem item) {
PageDebugView.class, null, createVisibleDisabledBehaviorForEditMenu(PageDebugView.class));
debugs.getItems().add(menu);

MainMenuItem systemItemNew = addMainMenuItem(item, "fa fa-cog", "PageAdmin.menu.top.configuration.basic.new", null);
MainMenuItem systemItemNew = addMainMenuItem(item, "fa fa-cog", "PageAdmin.menu.top.configuration.basic", null);

addSystemMenuItemNew(systemItemNew, "PageAdmin.menu.top.configuration.basic",
PageSystemConfigurationNew.CONFIGURATION_TAB_BASIC);
addSystemMenuItemNew(systemItemNew, "PageAdmin.menu.top.configuration.objectPolicy",
PageSystemConfigurationNew.CONFIGURATION_TAB_OBJECT_POLICY);
addSystemMenuItemNew(systemItemNew, "PageAdmin.menu.top.configuration.globalPolicyRule",
PageSystemConfigurationNew.CONFIGURATION_TAB_GLOBAL_POLICY_RULE);
addSystemMenuItemNew(systemItemNew, "PageAdmin.menu.top.configuration.globalAccountSynchronization",
PageSystemConfigurationNew.CONFIGURATION_TAB_GLOBAL_ACCOUNT_SYNCHRONIZATION);
addSystemMenuItemNew(systemItemNew, "PageAdmin.menu.top.configuration.cleanupPolicy",
PageSystemConfigurationNew.CONFIGURATION_TAB_CLEANUP_POLICY);
addSystemMenuItemNew(systemItemNew, "PageAdmin.menu.top.configuration.notifications",
PageSystemConfigurationNew.CONFIGURATION_TAB_NOTIFICATION);
addSystemMenuItemNew(systemItemNew, "PageAdmin.menu.top.configuration.logging",
PageSystemConfigurationNew.CONFIGURATION_TAB_LOGGING);
addSystemMenuItemNew(systemItemNew, "PageAdmin.menu.top.configuration.profiling",
PageSystemConfigurationNew.CONFIGURATION_TAB_PROFILING);
addSystemMenuItemNew(systemItemNew, "PageAdmin.menu.top.configuration.adminGui",
PageSystemConfigurationNew.CONFIGURATION_TAB_ADMIN_GUI);
addSystemMenuItemNew(systemItemNew, "PageAdmin.menu.top.configuration.workflow",
PageSystemConfigurationNew.CONFIGURATION_TAB_WORKFLOW);
addSystemMenuItemNew(systemItemNew, "PageAdmin.menu.top.configuration.roleManagement",
PageSystemConfigurationNew.CONFIGURATION_TAB_ROLE_MANAGEMENT);
addSystemMenuItemNew(systemItemNew, "PageAdmin.menu.top.configuration.internals",
PageSystemConfigurationNew.CONFIGURATION_TAB_INTERNALS);
addSystemMenuItemNew(systemItemNew, "PageAdmin.menu.top.configuration.deploymentInformation",
PageSystemConfigurationNew.CONFIGURATION_TAB_DEPLOYMENT_INFORMATION);
addSystemMenuItemNew(systemItemNew, "PageAdmin.menu.top.configuration.accessCertification",
PageSystemConfigurationNew.CONFIGURATION_TAB_ACCESS_CERTIFICATION);
addSystemMenuItemNew(systemItemNew, "PageAdmin.menu.top.configuration.infrastructure",
PageSystemConfigurationNew.CONFIGURATION_TAB_INFRASTRUCTURE);
addSystemMenuItemNew(systemItemNew, "PageAdmin.menu.top.configuration.fullTextSearch",
PageSystemConfigurationNew.CONFIGURATION_TAB_FULL_TEXT_SEARCH);

MainMenuItem systemItem = addMainMenuItem(item, "fa fa-cog", "PageAdmin.menu.top.configuration.basic", null);

addSystemMenuItem(systemItem, "PageAdmin.menu.top.configuration.basic",
addSystemMenuItem(systemItemNew, "PageAdmin.menu.top.configuration.basic",
PageSystemConfiguration.CONFIGURATION_TAB_BASIC);
addSystemMenuItem(systemItem, "PageAdmin.menu.top.configuration.notifications",
addSystemMenuItem(systemItemNew, "PageAdmin.menu.top.configuration.objectPolicy",
PageSystemConfiguration.CONFIGURATION_TAB_OBJECT_POLICY);
addSystemMenuItem(systemItemNew, "PageAdmin.menu.top.configuration.globalPolicyRule",
PageSystemConfiguration.CONFIGURATION_TAB_GLOBAL_POLICY_RULE);
addSystemMenuItem(systemItemNew, "PageAdmin.menu.top.configuration.globalAccountSynchronization",
PageSystemConfiguration.CONFIGURATION_TAB_GLOBAL_ACCOUNT_SYNCHRONIZATION);
addSystemMenuItem(systemItemNew, "PageAdmin.menu.top.configuration.cleanupPolicy",
PageSystemConfiguration.CONFIGURATION_TAB_CLEANUP_POLICY);
addSystemMenuItem(systemItemNew, "PageAdmin.menu.top.configuration.notifications",
PageSystemConfiguration.CONFIGURATION_TAB_NOTIFICATION);
addSystemMenuItem(systemItem, "PageAdmin.menu.top.configuration.logging",
addSystemMenuItem(systemItemNew, "PageAdmin.menu.top.configuration.logging",
PageSystemConfiguration.CONFIGURATION_TAB_LOGGING);
addSystemMenuItem(systemItem, "PageAdmin.menu.top.configuration.profiling",
addSystemMenuItem(systemItemNew, "PageAdmin.menu.top.configuration.profiling",
PageSystemConfiguration.CONFIGURATION_TAB_PROFILING);
addSystemMenuItem(systemItem, "PageAdmin.menu.top.configuration.adminGui",
addSystemMenuItem(systemItemNew, "PageAdmin.menu.top.configuration.adminGui",
PageSystemConfiguration.CONFIGURATION_TAB_ADMIN_GUI);
addSystemMenuItem(systemItemNew, "PageAdmin.menu.top.configuration.workflow",
PageSystemConfiguration.CONFIGURATION_TAB_WORKFLOW);
addSystemMenuItem(systemItemNew, "PageAdmin.menu.top.configuration.roleManagement",
PageSystemConfiguration.CONFIGURATION_TAB_ROLE_MANAGEMENT);
addSystemMenuItem(systemItemNew, "PageAdmin.menu.top.configuration.internals",
PageSystemConfiguration.CONFIGURATION_TAB_INTERNALS);
addSystemMenuItem(systemItemNew, "PageAdmin.menu.top.configuration.deploymentInformation",
PageSystemConfiguration.CONFIGURATION_TAB_DEPLOYMENT_INFORMATION);
addSystemMenuItem(systemItemNew, "PageAdmin.menu.top.configuration.accessCertification",
PageSystemConfiguration.CONFIGURATION_TAB_ACCESS_CERTIFICATION);
addSystemMenuItem(systemItemNew, "PageAdmin.menu.top.configuration.infrastructure",
PageSystemConfiguration.CONFIGURATION_TAB_INFRASTRUCTURE);
addSystemMenuItem(systemItemNew, "PageAdmin.menu.top.configuration.fullTextSearch",
PageSystemConfiguration.CONFIGURATION_TAB_FULL_TEXT_SEARCH);

addMainMenuItem(item, "fa fa-archive", "PageAdmin.menu.top.configuration.internals", PageInternals.class);
addMainMenuItem(item, "fa fa-search", "PageAdmin.menu.top.configuration.repoQuery", PageRepositoryQuery.class);
Expand All @@ -1620,8 +1597,6 @@ private void addSystemMenuItem(MainMenuItem mainItem, String key, int tabIndex)
params.add(PageSystemConfiguration.SELECTED_TAB_INDEX, tabIndex);
MenuItem menu = new MenuItem(createStringResource(key), PageSystemConfiguration.class, params, null) {

private static final long serialVersionUID = 1L;

@Override
public boolean isMenuActive(WebPage page) {
if (!PageSystemConfiguration.class.equals(page.getClass())) {
Expand All @@ -1634,24 +1609,6 @@ public boolean isMenuActive(WebPage page) {
};
mainItem.getItems().add(menu);
}

private void addSystemMenuItemNew(MainMenuItem mainItem, String key, int tabIndex) {
PageParameters params = new PageParameters();
params.add(PageSystemConfigurationNew.SELECTED_TAB_INDEX, tabIndex);
MenuItem menu = new MenuItem(createStringResource(key), PageSystemConfigurationNew.class, params, null) {

@Override
public boolean isMenuActive(WebPage page) {
if (!PageSystemConfigurationNew.class.equals(page.getClass())) {
return false;
}

int index = getSelectedTabForNewConfiguration(page);
return tabIndex == index ? true : false;
}
};
mainItem.getItems().add(menu);
}

private MainMenuItem addMainMenuItem(SideBarMenuItem item, String icon, String key, Class<? extends PageBase> page) {
MainMenuItem mainItem = new MainMenuItem(icon, createStringResource(key), page);
Expand Down Expand Up @@ -1803,17 +1760,6 @@ private int getSelectedTabForConfiguration(WebPage page) {

return StringUtils.isNumeric(value) ? Integer.parseInt(value) : PageSystemConfiguration.CONFIGURATION_TAB_BASIC;
}

private int getSelectedTabForNewConfiguration(WebPage page) {
PageParameters params = page.getPageParameters();
StringValue val = params.get(PageSystemConfigurationNew.SELECTED_TAB_INDEX);
String value = null;
if (val != null && !val.isNull()) {
value = val.toString();
}

return StringUtils.isNumeric(value) ? Integer.parseInt(value) : PageSystemConfigurationNew.CONFIGURATION_TAB_BASIC;
}

private void createSelfServiceMenu(SideBarMenuItem menu) {
addMainMenuItem(menu, GuiStyleConstants.CLASS_ICON_DASHBOARD, "PageAdmin.menu.selfDashboard",
Expand Down

0 comments on commit a7d010f

Please sign in to comment.