Skip to content

Commit

Permalink
Merge branch 'master' of github.com:Evolveum/midpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
1azyman committed Oct 3, 2023
2 parents 0e57753 + f62c1d8 commit 13b3dc3
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 21 deletions.
22 changes: 11 additions & 11 deletions dist/src/main/bin/ninja.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ BASE_DIR=$(cd "${SCRIPT_DIR}/.." && pwd -P)
: "${MIDPOINT_HOME:="${BASE_DIR}/var"}"

if [[ ! -f "${BASE_DIR}/lib/ninja.jar" ]]; then
echo "ERROR: ninja.jar not found in ${BASE_DIR}/lib directory"
echo "ERROR: ninja.jar not found in ${BASE_DIR}/lib directory" >&2
exit 1
fi

Expand All @@ -33,14 +33,14 @@ ENV_UNMAP_PREFIX="MP_UNSET_"
# Apply bin/setenv.sh if it exists. This setenv.sh does not depend on MIDPOINT_HOME.
# The script can either append or overwrite JAVA_OPTS, e.g. to set -Dmidpoint.nodeId.
if [[ -r "${SCRIPT_DIR}/setenv.sh" ]]; then
echo "Applying setenv.sh from ${SCRIPT_DIR} directory."
echo "Applying setenv.sh from ${SCRIPT_DIR} directory." >&2
# shellcheck disable=SC1091
. "${SCRIPT_DIR}/setenv.sh"
fi

# Apply $MIDPOINT_HOME/setenv.sh if it exists. This is flexible and related to chosen MIDPOINT_HOME.
if [[ -r "${MIDPOINT_HOME}/setenv.sh" ]]; then
echo "Applying setenv.sh from ${MIDPOINT_HOME} directory."
echo "Applying setenv.sh from ${MIDPOINT_HOME} directory." >&2
# shellcheck disable=SC1091
. "${MIDPOINT_HOME}/setenv.sh"
fi
Expand All @@ -55,20 +55,20 @@ fi

if [ "${MP_ENTRY_POINT:-}" != "" ]; then # /opt/midpoint-dirs-docker-entrypoint
if [ -e "${MP_ENTRY_POINT}" ]; then
echo "Processing ${MP_ENTRY_POINT} directory..."
echo "Processing ${MP_ENTRY_POINT} directory..." >&2
for i in $(find "${MP_ENTRY_POINT}" -mindepth 1 -maxdepth 1 -type d); do
l_name="$(basename "${i}")"
[ ! -e "${MIDPOINT_HOME}/${l_name}" ] && mkdir -p "${MIDPOINT_HOME}/${l_name}"
for s in $(find "${i}" -mindepth 1 -maxdepth 1 -type f -follow -exec basename \{\} \;); do
if [ ! -e "${MIDPOINT_HOME}/${l_name}/${s}" -a ! -e "${MIDPOINT_HOME}/${l_name}/${s}.done" ]; then
echo "COPY ${i}/${s} => ${MIDPOINT_HOME}/${l_name}/${s}"
echo "COPY ${i}/${s} => ${MIDPOINT_HOME}/${l_name}/${s}" >&2
cp "${i}/${s}" "${MIDPOINT_HOME}/${l_name}/${s}"
else
echo "SKIP: ${i}/${s}"
echo "SKIP: ${i}/${s}" >&2
fi
done
done
echo "- - - - - - - - - - - - - - - - - - - - -"
echo "- - - - - - - - - - - - - - - - - - - - -" >&2
unset l_name
fi
fi
Expand Down Expand Up @@ -108,7 +108,7 @@ if [ "${MP_NO_ENV_COMPAT:-}" != "1" ]; then
;;
*)
if [ "${db_port:-}" == "" -a "${REPO_URL:-}" == "" ]; then
echo "~~~~~ please supply JDBC port for your repository ~~~~~"
echo "~~~~~ please supply JDBC port for your repository ~~~~~" >&2
exit 1
fi
;;
Expand Down Expand Up @@ -142,7 +142,7 @@ while read line; do
[ "${_key: -5}" = ".FILE" ] && _key="${_key::$((${#_key} - 5))}_FILE"
###

echo "Processing variable (MAP) ... ${_key} .:. ${_val}"
echo "Processing variable (MAP) ... ${_key} .:. ${_val}" >&2

if [ "${_key:0:1}" = "." ]; then
JAVA_OPTS="${JAVA_OPTS:-} -D${_key:1}=\"${_val}\""
Expand All @@ -160,7 +160,7 @@ while read line; do
[ "${_key: -5}" = ".FILE" ] && _key="${_key::$((${#_key} - 5))}_FILE"
###

echo "Processing variable (UNMAP) ... ${_key} .:. ${_val}"
echo "Processing variable (UNMAP) ... ${_key} .:. ${_val}" >&2

JAVA_OPTS="$(echo -n "${JAVA_OPTS:-}" | sed "s/ -D${_key}=\"[^\"]*\"//g;s/ -D${_key}=[^[:space:]]*//g")"
done < <(env | grep "^${ENV_UNMAP_PREFIX}")
Expand Down Expand Up @@ -210,7 +210,7 @@ done
# Technically we could do one exec, but then we can't quote -Dloader.path argument, because it
# would be empty and considered a class name by the "java -jar" command.
if [ -n "${JDBC_DRIVER:-}" ]; then
echo "Using JDBC driver path: ${JDBC_DRIVER}"
echo "Using JDBC driver path: ${JDBC_DRIVER}" >&2
eval "${_RUNJAVA}" ${JAVA_OPTS} "-Dloader.path=${JDBC_DRIVER}" -jar "${BASE_DIR}/lib/ninja.jar" -m "${MIDPOINT_HOME}" "$@"
else
eval "${_RUNJAVA}" ${JAVA_OPTS} -jar "${BASE_DIR}/lib/ninja.jar" -m "${MIDPOINT_HOME}" "$@"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ public class PageRoleAnalysis extends PageAdmin {
private static final String DOT_CLASS = PageRoleAnalysis.class.getName() + ".";
private static final String OP_DELETE_SESSION = DOT_CLASS + "deleteSession";
private static final String ID_MAIN_FORM = "mainForm";
private static final String ID_CHART_PANEL = "chartPanel";
private static final String ID_TABLE = "table";

public PageRoleAnalysis(PageParameters params) {
Expand All @@ -91,10 +92,6 @@ public PageRoleAnalysis(PageParameters params) {
protected void onInitialize() {
super.onInitialize();
initLayout();

RoleAnalysisChartPanel roleAnalysisChartPanel = new RoleAnalysisChartPanel("chartPanel");
roleAnalysisChartPanel.setOutputMarkupId(true);
add(roleAnalysisChartPanel);
}

private InlineMenuItem createDeleteInlineMenu() {
Expand Down Expand Up @@ -154,15 +151,19 @@ public IModel<String> getConfirmationMessageModel() {
}

protected void initLayout() {

Form<?> mainForm = new MidpointForm<>(ID_MAIN_FORM);
add(mainForm);

if (!isNativeRepo()) {
mainForm.add(new ErrorPanel(ID_TABLE,
() -> getString("PageRoleAnalysis.menu.nonNativeRepositoryWarning")));
mainForm.add(new ErrorPanel(ID_TABLE, createStringResource("RoleAnalysis.menu.nonNativeRepositoryWarning")));
add(new EmptyPanel(ID_CHART_PANEL));
return;
}

RoleAnalysisChartPanel roleAnalysisChartPanel = new RoleAnalysisChartPanel(ID_CHART_PANEL);
roleAnalysisChartPanel.setOutputMarkupId(true);
add(roleAnalysisChartPanel);

MainObjectListPanel<RoleAnalysisSessionType> table = new MainObjectListPanel<>(ID_TABLE, RoleAnalysisSessionType.class) {

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import org.apache.wicket.markup.repeater.RepeatingView;
import org.apache.wicket.model.IModel;
import org.apache.wicket.model.StringResourceModel;
import org.apache.wicket.util.string.StringValue;

import com.evolveum.midpoint.authentication.api.authorization.AuthorizationAction;
import com.evolveum.midpoint.authentication.api.authorization.PageDescriptor;
Expand All @@ -30,6 +31,7 @@
import com.evolveum.midpoint.gui.impl.component.icon.LayeredIconCssStyle;
import com.evolveum.midpoint.gui.impl.component.wizard.AbstractWizardPanel;
import com.evolveum.midpoint.gui.impl.component.wizard.WizardPanelHelper;
import com.evolveum.midpoint.gui.impl.error.ErrorPanel;
import com.evolveum.midpoint.gui.impl.page.admin.DetailsFragment;
import com.evolveum.midpoint.gui.impl.page.admin.assignmentholder.AssignmentHolderDetailsModel;
import com.evolveum.midpoint.gui.impl.page.admin.assignmentholder.PageAssignmentHolderDetails;
Expand All @@ -45,8 +47,6 @@
import com.evolveum.midpoint.web.util.OnePageParameterEncoder;
import com.evolveum.midpoint.xml.ns._public.common.common_3.*;

import org.apache.wicket.util.string.StringValue;

//TODO correct authorizations
@PageDescriptor(
urls = {
Expand Down Expand Up @@ -212,6 +212,15 @@ private boolean canShowWizard() {
}

protected DetailsFragment createDetailsFragment() {
if (!isNativeRepo()) {
return new DetailsFragment(ID_DETAILS_VIEW, ID_TEMPLATE_VIEW, PageRoleAnalysisSession.this) {
@Override
protected void initFragmentLayout() {
add(new ErrorPanel(ID_TEMPLATE,
createStringResource("RoleAnalysis.menu.nonNativeRepositoryWarning")));
}
};
}

if (canShowWizard()) {
setShowedByWizard(true);
Expand Down Expand Up @@ -271,7 +280,7 @@ protected void initFragmentLayout() {
Constructor<? extends AbstractWizardPanel> constructor = clazz.getConstructor(String.class, WizardPanelHelper.class);
AbstractWizardPanel wizard = constructor.newInstance(ID_TEMPLATE, createObjectWizardPanelHelper());
add(wizard);
} catch (NoSuchMethodException | InstantiationException | IllegalAccessException | InvocationTargetException e) {
} catch (NoSuchMethodException | InstantiationException | IllegalAccessException | InvocationTargetException ignored) {

}
}
Expand Down

0 comments on commit 13b3dc3

Please sign in to comment.