Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into feature/hibernate5
Browse files Browse the repository at this point in the history
  • Loading branch information
1azyman committed Dec 8, 2017
2 parents 8ca3973 + 1e12d31 commit 25da5b7
Show file tree
Hide file tree
Showing 37 changed files with 316 additions and 267 deletions.
Expand Up @@ -15,15 +15,15 @@ echo %BIN_DIR%
:gotHome

rem if script for start and stop exists
if exist "%BIN_DIR%\springboot.bat" goto okBoot
if exist "%BIN_DIR%\midpoint.bat" goto okBoot
echo %BIN_DIR%
echo The springboot.bat file is not in \bin directory or is no accessible
echo The midpoint.bat file is not in \bin directory or is no accessible
goto end
:okBoot

rem if start/stop out file exists
if not "%BOOT_OUT%" == "" goto okOut
set "BOOT_OUT=%MIDPOINT_HOME%\log\springboot.out"
set "BOOT_OUT=%MIDPOINT_HOME%\log\midpoint.out"
echo %BOOT_OUT%
:okOut

Expand Down
78 changes: 39 additions & 39 deletions dist/src/main/bin/springboot.sh → dist/src/main/bin/midpoint.sh
Expand Up @@ -50,11 +50,11 @@ if [ ! -d var ] ; then
fi

if [ -z "$BOOT_OUT" ] ; then
BOOT_OUT="$SCRIPT_PATH"../var/log/springboot.out
BOOT_OUT="$SCRIPT_PATH"../var/log/midpoint.out
fi

if [ -z "$SPRING_PID" ] ; then
SPRING_PID="$SCRIPT_PATH"../var/log/spring.pid
if [ -z "$PID_FILE" ] ; then
PID_FILE="$SCRIPT_PATH"../var/log/midpoint.pid
fi

[ -z "$MIDPOINT_HOME" ] && MIDPOINT_HOME=`cd "$SCRIPT_PATH../var" >/dev/null; pwd`
Expand Down Expand Up @@ -96,18 +96,18 @@ fi
# ----- Execute The Requested Command -----------------------------------------

#if [ $have_tty -eq 1 ]; then
# if [ ! -z "$SPRING_PID" ]; then
# echo "Using SPRING_PID: $SPRING_PID"
# if [ ! -z "$PID_FILE" ]; then
# echo "Using PID_FILE: $PID_FILE"
# fi
#fi

if [ "$1" = "start" ] ; then
if [ ! -z "$SPRING_PID" ]; then
if [ -f "$SPRING_PID" ]; then
if [ -s "$SPRING_PID" ]; then
if [ ! -z "$PID_FILE" ]; then
if [ -f "$PID_FILE" ]; then
if [ -s "$PID_FILE" ]; then
echo "Existing PID file found during start."
if [ -r "$SPRING_PID" ]; then
PID=`cat "$SPRING_PID"`
if [ -r "$PID_FILE" ]; then
PID=`cat "$PID_FILE"`
ps -p $PID >/dev/null 2>&1
if [ $? -eq 0 ] ; then
echo "Midpoint appears to still be running with PID $PID. Start aborted."
Expand All @@ -116,10 +116,10 @@ if [ "$1" = "start" ] ; then
exit 1
else
echo "Removing/clearing stale PID file."
rm -f "$SPRING_PID" >/dev/null 2>&1
rm -f "$PID_FILE" >/dev/null 2>&1
if [ $? != 0 ]; then
if [ -w "$SPRING_PID" ]; then
cat /dev/null > "$SPRING_PID"
if [ -w "$PID_FILE" ]; then
cat /dev/null > "$PID_FILE"
else
echo "Unable to remove or clear stale PID file. Start aborted."
exit 1
Expand All @@ -131,9 +131,9 @@ if [ "$1" = "start" ] ; then
exit 1
fi
else
rm -f "$SPRING_PID" >/dev/null 2>&1
rm -f "$PID_FILE" >/dev/null 2>&1
if [ $? != 0 ]; then
if [ ! -w "$SPRING_PID" ]; then
if [ ! -w "$PID_FILE" ]; then
echo "Unable to remove or write to empty PID file. Start aborted."
exit 1
fi
Expand All @@ -154,8 +154,8 @@ eval $_NOHUP "\"$_RUNJAVA\"" -jar $LOGGING_MANAGER $JAVA_OPTS \
>> "$BOOT_OUT" 2>&1 "&"


if [ ! -z "$SPRING_PID" ]; then
echo $! > "$SPRING_PID"
if [ ! -z "$PID_FILE" ]; then
echo $! > "$PID_FILE"
fi


Expand All @@ -178,10 +178,10 @@ elif [ "$1" = "stop" ] ; then
FORCE=1
fi

if [ ! -z "$SPRING_PID" ]; then
if [ -f "$SPRING_PID" ]; then
if [ -s "$SPRING_PID" ]; then
kill -0 `cat "$SPRING_PID"` >/dev/null 2>&1
if [ ! -z "$PID_FILE" ]; then
if [ -f "$PID_FILE" ]; then
if [ -s "$PID_FILE" ]; then
kill -0 `cat "$PID_FILE"` >/dev/null 2>&1
if [ $? -gt 0 ]; then
echo "PID file found but no matching process was found. Stop aborted."
exit 1
Expand All @@ -190,7 +190,7 @@ elif [ "$1" = "stop" ] ; then
echo "PID file is empty and has been ignored."
fi
else
echo "\$SPRING_PID was set but the specified file does not exist. Is Tomcat running? Stop aborted."
echo "\$PID_FILE was set but the specified file does not exist. Is Tomcat running? Stop aborted."
exit 1
fi
fi
Expand All @@ -200,23 +200,23 @@ elif [ "$1" = "stop" ] ; then
kill -15 `cat "$CATALINA_PID"` >/dev/null 2>&1
fi

if [ ! -z "$SPRING_PID" ]; then
if [ ! -z "$PID_FILE" ]; then
echo "Stopping midPoint"
kill -TERM `cat "$SPRING_PID"` >/dev/null 2>&1
kill -TERM `cat "$PID_FILE"` >/dev/null 2>&1
fi
# stop failed. Shutdown port disabled? Try a normal kill.


if [ ! -z "$SPRING_PID" ]; then
if [ -f "$SPRING_PID" ]; then
if [ ! -z "$PID_FILE" ]; then
if [ -f "$PID_FILE" ]; then
while [ $SLEEP -ge 0 ]; do

kill -0 `cat "$SPRING_PID"` >/dev/null 2>&1
kill -0 `cat "$PID_FILE"` >/dev/null 2>&1
if [ $? -gt 0 ]; then
rm -f "$SPRING_PID" >/dev/null 2>&1
rm -f "$PID_FILE" >/dev/null 2>&1
if [ $? != 0 ]; then
if [ -w "$SPRING_PID" ]; then
cat /dev/null > "$SPRING_PID"
if [ -w "$PID_FILE" ]; then
cat /dev/null > "$PID_FILE"
# If MidPoint has stopped don't try and force a stop with an empty PID file
FORCE=0
else
Expand All @@ -236,7 +236,7 @@ elif [ "$1" = "stop" ] ; then
echo "PID file was not removed."
fi
echo "To aid diagnostics a thread dump has been written to standard out."
kill -3 `cat "$SPRING_PID"`
kill -3 `cat "$PID_FILE"`
fi
SLEEP=`expr $SLEEP - 1 `
done
Expand All @@ -245,20 +245,20 @@ elif [ "$1" = "stop" ] ; then

KILL_SLEEP_INTERVAL=5
if [ $FORCE -eq 1 ]; then
if [ -z "$SPRING_PID" ]; then
echo "Kill failed: \$SPRING_PID not set"
if [ -z "$PID_FILE" ]; then
echo "Kill failed: \$PID_FILE not set"
else
if [ -f "$SPRING_PID" ]; then
PID=`cat "$SPRING_PID"`
if [ -f "$PID_FILE" ]; then
PID=`cat "$PID_FILE"`
echo "Killing midPoint with the PID: $PID"
kill -9 $PID
while [ $KILL_SLEEP_INTERVAL -ge 0 ]; do
kill -0 `cat "$SPRING_PID"` >/dev/null 2>&1
kill -0 `cat "$PID_FILE"` >/dev/null 2>&1
if [ $? -gt 0 ]; then
rm -f "$SPRING_PID" >/dev/null 2>&1
rm -f "$PID_FILE" >/dev/null 2>&1
if [ $? != 0 ]; then
if [ -w "$SPRING_PID" ]; then
cat /dev/null > "$SPRING_PID"
if [ -w "$PID_FILE" ]; then
cat /dev/null > "$PID_FILE"
else
echo "The PID file could not be removed."
fi
Expand Down
4 changes: 2 additions & 2 deletions dist/src/main/bin/start.bat
Expand Up @@ -13,13 +13,13 @@ set "MIDPOINT_HOME=%cd%\var"
echo %MIDPOINT_HOME%
:gotHome

if exist "%BIN_DIR%\springboot.bat" goto okHome
if exist "%BIN_DIR%\midpoint.bat" goto okHome
echo The MIDPOINT_HOME environment variable is not defined correctly
echo This environment variable is needed to run this program
goto end
:okHome

set "EXECUTABLE=%BIN_DIR%\springboot.bat"
set "EXECUTABLE=%BIN_DIR%\midpoint.bat"

rem Check that target executable exists
if exist "%EXECUTABLE%" goto okExec
Expand Down
2 changes: 1 addition & 1 deletion dist/src/main/bin/start.sh
Expand Up @@ -29,7 +29,7 @@ while [ -h "$PRG" ] ; do
done

PRGDIR=`dirname "$PRG"`
EXECUTABLE=springboot.sh
EXECUTABLE=midpoint.sh

if [ ! -x "$PRGDIR"/"$EXECUTABLE" ]; then
echo "Cannot find $PRGDIR/$EXECUTABLE"
Expand Down
4 changes: 2 additions & 2 deletions dist/src/main/bin/stop.bat
Expand Up @@ -13,13 +13,13 @@ set "MIDPOINT_HOME=%cd%\var"
echo %MIDPOINT_HOME%
:gotHome

if exist "%BIN_DIR%\springboot.bat" goto okHome
if exist "%BIN_DIR%\midpoint.bat" goto okHome
echo The MIDPOINT_HOME environment variable is not defined correctly
echo This environment variable is needed to run this program
goto end
:okHome

set "EXECUTABLE=%BIN_DIR%\springboot.bat"
set "EXECUTABLE=%BIN_DIR%\midpoint.bat"

rem Check that target executable exists
if exist "%EXECUTABLE%" goto okExec
Expand Down
2 changes: 1 addition & 1 deletion dist/src/main/bin/stop.sh
Expand Up @@ -29,7 +29,7 @@ while [ -h "$PRG" ] ; do
done

PRGDIR=`dirname "$PRG"`
EXECUTABLE=springboot.sh
EXECUTABLE=midpoint.sh

if [ ! -x "$PRGDIR"/"$EXECUTABLE" ]; then
echo "Cannot find $PRGDIR/$EXECUTABLE"
Expand Down
Expand Up @@ -21,7 +21,6 @@
import com.evolveum.midpoint.web.security.MidPointApplication;
import com.evolveum.midpoint.web.security.MidPointAuthWebSession;
import com.evolveum.midpoint.web.security.WebApplicationConfiguration;

import org.apache.commons.lang.StringUtils;
import org.apache.wicket.markup.html.panel.Panel;
import org.apache.wicket.model.IModel;
Expand Down
Expand Up @@ -63,7 +63,7 @@ protected String getSpecialButtonClass() {

@Override
public boolean isVisible() {
return !(numberOfButtons < 2);
return !(numberOfButtons <= 2);
}
});
add(inlineMenu);
Expand Down
Expand Up @@ -908,7 +908,9 @@ public List<AssignmentInfoDto> showAllAssignmentsPerformed(AjaxRequestTarget aja
Collection<EvaluatedConstruction> evaluatedConstructions = evaluatedConstructionsTriple
.getNonNegativeValues();
for (EvaluatedConstruction construction : evaluatedConstructions) {
assignmentInfoDtoSet.add(createAssignmentsPreviewDto(construction));
if (!construction.isWeak()) {
assignmentInfoDtoSet.add(createAssignmentsPreviewDto(construction));
}
}
}

Expand Down
Expand Up @@ -152,9 +152,10 @@ protected void onConfigure() {

String msg = ex.getMessage();
if (StringUtils.isEmpty(msg)) {
msg = getString("web.security.provider.unavailable");
msg = "web.security.provider.unavailable";
}

msg = getLocalizationService().translate(msg, null, getLocale(), msg);
error(msg);

httpSession.removeAttribute(WebAttributes.AUTHENTICATION_EXCEPTION);
Expand Down
Expand Up @@ -140,7 +140,7 @@ protected void createBreadcrumb() {
}

private void initLayout(){
DashboardSearchPanel dashboardSearchPanel = new DashboardSearchPanel(ID_SEARCH_PANEL, null);
DashboardSearchPanel dashboardSearchPanel = new DashboardSearchPanel(ID_SEARCH_PANEL);
List<String> searchPanelActions = Arrays.asList(AuthorizationConstants.AUTZ_UI_USERS_ALL_URL,
AuthorizationConstants.AUTZ_UI_USERS_URL, AuthorizationConstants.AUTZ_UI_RESOURCES_ALL_URL,
AuthorizationConstants.AUTZ_UI_RESOURCES_URL, AuthorizationConstants.AUTZ_UI_TASKS_ALL_URL,
Expand Down

0 comments on commit 25da5b7

Please sign in to comment.