Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master'
Browse files Browse the repository at this point in the history
# Conflicts:
#	gui/admin-gui/src/main/java/com/evolveum/midpoint/gui/api/util/WebComponentUtil.java
#	gui/admin-gui/src/main/java/com/evolveum/midpoint/web/component/assignment/AbstractRoleAssignmentPanel.java
  • Loading branch information
mederly committed Sep 10, 2018
2 parents b39c93a + 175a57b commit 3ddbf52
Show file tree
Hide file tree
Showing 226 changed files with 4,460 additions and 8,393 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
1 change: 1 addition & 0 deletions dist/pom.xml
Expand Up @@ -53,6 +53,7 @@
<artifactId>admin-gui</artifactId>
<version>3.9-SNAPSHOT</version>
<type>war</type>
<classifier>executable</classifier>
</dependency>
<dependency>
<groupId>com.evolveum.midpoint.tools</groupId>
Expand Down
82 changes: 51 additions & 31 deletions gui/admin-gui/pom.xml
Expand Up @@ -104,35 +104,6 @@
</includes>
</testResource>
</testResources>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<version>${spring.boot.version}</version>
<configuration>
<fork>true</fork>
<skip>false</skip>
<jvmArguments>-Dserver.port=${server.port} -Dmidpoint.home=${midpoint.home} -Dmidpoint.schrodinger=${midpoint.schrodinger} -Djavax.net.ssl.trustStore=${javax.net.ssl.trustStore} -Djavax.net.ssl.trustStoreType=${javax.net.ssl.trustStoreType}</jvmArguments><!-- TODO question: CAN this argument be active by default, or should be there a different profile defined for this? -->
</configuration>
<executions>
<execution>
<goals>
<goal>repackage</goal>
</goals>
<configuration>
<layoutFactory implementation="com.evolveum.midpoint.tools.layout.MidPointWarLayoutFactory"/>
</configuration>
</execution>
</executions>
<dependencies>
<dependency>
<groupId>com.evolveum.midpoint</groupId>
<artifactId>midpoint-war-layout</artifactId>
<version>${project.version}</version>
</dependency>
</dependencies>
</plugin>
</plugins>
</build>

<dependencies>
Expand Down Expand Up @@ -220,6 +191,16 @@
<version>2.5.3</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-cas</artifactId>
<version>${spring.security.version}</version>
</dependency>
<dependency>
<groupId>org.jasig.cas.client</groupId>
<artifactId>cas-client-core</artifactId>
<version>3.5.0</version>
</dependency>
<dependency>
<groupId>org.webjars</groupId>
<artifactId>webjars-locator-core</artifactId>
Expand Down Expand Up @@ -901,13 +882,52 @@
<version>3.9-SNAPSHOT</version>
</dependency>
</dependencies>

<profiles>
<profile>
<id>tomcat</id>
<id>executable</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<version>${spring.boot.version}</version>
<configuration>
<fork>true</fork>
<skip>false</skip>
<jvmArguments>-Dserver.port=${server.port} -Dmidpoint.home=${midpoint.home} -Dmidpoint.schrodinger=${midpoint.schrodinger} -Djavax.net.ssl.trustStore=${javax.net.ssl.trustStore} -Djavax.net.ssl.trustStoreType=${javax.net.ssl.trustStoreType}</jvmArguments><!-- TODO question: CAN this argument be active by default, or should be there a different profile defined for this? -->
</configuration>
<executions>
<execution>
<goals>
<goal>repackage</goal>
</goals>
<configuration>
<classifier>executable</classifier>
<layoutFactory implementation="com.evolveum.midpoint.tools.layout.MidPointWarLayoutFactory"/>
</configuration>
</execution>
</executions>
<dependencies>
<dependency>
<groupId>com.evolveum.midpoint</groupId>
<artifactId>midpoint-war-layout</artifactId>
<version>${project.version}</version>
</dependency>
</dependencies>
</plugin>
</plugins>
</build>
</profile>

<profile>
<id>tomcat</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<dependencies>
<dependency>
<artifactId>jaxb-impl</artifactId>
Expand All @@ -924,8 +944,8 @@
<scope>runtime</scope>
</dependency>
</dependencies>

</profile>

<profile>
<!-- can be used for development e.g. in Intellij Idea -->
<id>ide</id>
Expand Down
Expand Up @@ -22,6 +22,7 @@
import com.evolveum.midpoint.web.component.AjaxButton;
import com.evolveum.midpoint.web.component.TabbedPanel;
import com.evolveum.midpoint.web.component.dialog.Popupable;
import com.evolveum.midpoint.web.component.util.VisibleBehaviour;
import com.evolveum.midpoint.web.component.util.VisibleEnableBehaviour;
import com.evolveum.midpoint.xml.ns._public.common.common_3.*;
import org.apache.wicket.Component;
Expand Down Expand Up @@ -118,13 +119,11 @@ public boolean isEnabled(){
form.add(addButton);
}

private List<ITab> createAssignmentTabs() {
protected List<ITab> createAssignmentTabs() {
List<ITab> tabs = new ArrayList<>();
//TODO check authorization for each tab
VisibleEnableBehaviour authorization = new VisibleEnableBehaviour(){
};

tabs.add(new CountablePanelTab(getPageBase().createStringResource("ObjectTypes.ROLE"), authorization) {
tabs.add(new CountablePanelTab(getPageBase().createStringResource("ObjectTypes.ROLE"),
new VisibleBehaviour(() -> isTabVisible(ObjectTypes.ROLE))) {

private static final long serialVersionUID = 1L;

Expand Down Expand Up @@ -152,7 +151,8 @@ public String getCount() {
});

tabs.add(
new CountablePanelTab(getPageBase().createStringResource("ObjectTypes.ORG"), authorization) {
new CountablePanelTab(getPageBase().createStringResource("ObjectTypes.ORG"),
new VisibleBehaviour(() -> isTabVisible(ObjectTypes.ORG))) {

private static final long serialVersionUID = 1L;

Expand Down Expand Up @@ -186,7 +186,8 @@ public String getCount() {
});


tabs.add(new CountablePanelTab(createStringResource("TypedAssignablePanel.orgTreeView"), authorization) {
tabs.add(new CountablePanelTab(createStringResource("TypedAssignablePanel.orgTreeView"),
new VisibleBehaviour(() -> isTabVisible(ObjectTypes.ORG))) {

private static final long serialVersionUID = 1L;

Expand Down Expand Up @@ -214,7 +215,8 @@ public String getCount() {
});

tabs.add(
new CountablePanelTab(getPageBase().createStringResource("ObjectTypes.SERVICE"), authorization) {
new CountablePanelTab(getPageBase().createStringResource("ObjectTypes.SERVICE"),
new VisibleBehaviour(() -> isTabVisible(ObjectTypes.SERVICE))) {

private static final long serialVersionUID = 1L;

Expand Down Expand Up @@ -243,7 +245,8 @@ public String getCount() {
});

tabs.add(
new CountablePanelTab(getPageBase().createStringResource("ObjectTypes.RESOURCE"), authorization) {
new CountablePanelTab(getPageBase().createStringResource("ObjectTypes.RESOURCE"),
new VisibleBehaviour(() -> isTabVisible(ObjectTypes.RESOURCE))) {

private static final long serialVersionUID = 1L;

Expand All @@ -269,6 +272,15 @@ public String getCount() {
return tabs;
}

private boolean isTabVisible(ObjectTypes objectType){
List<ObjectTypes> availableObjectTypesList = getAvailableObjectTypesList();
return availableObjectTypesList == null || availableObjectTypesList.size() == 0 || availableObjectTypesList.contains(objectType);
}

protected List<ObjectTypes> getAvailableObjectTypesList(){
return WebComponentUtil.createAssignableTypesList();
}

private int getTabPanelSelectedCount(WebMarkupContainer panel){
if (panel != null && panel instanceof AbstractAssignmentPopupTabPanel){
return ((AbstractAssignmentPopupTabPanel) panel).getSelectedObjectsList().size();
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 Down Expand Up @@ -1539,18 +1538,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 @@ -1564,53 +1551,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 @@ -1625,8 +1599,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 @@ -1639,24 +1611,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 @@ -1808,17 +1762,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 3ddbf52

Please sign in to comment.