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 Dec 8, 2017
2 parents 5d017d5 + e264c35 commit ebd8774
Show file tree
Hide file tree
Showing 21 changed files with 121 additions and 103 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 @@ -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
@@ -1,13 +1,12 @@
package com.evolveum.midpoint.web.page.self.component;

import com.evolveum.midpoint.gui.api.component.BasePanel;
import com.evolveum.midpoint.gui.api.util.WebComponentUtil;
import com.evolveum.midpoint.security.api.AuthorizationConstants;
import com.evolveum.midpoint.web.component.util.SimplePanel;
import com.evolveum.midpoint.web.page.admin.resources.PageResources;
import com.evolveum.midpoint.web.page.admin.server.PageTasks;
import com.evolveum.midpoint.web.page.admin.users.PageUsers;
import com.evolveum.midpoint.web.page.admin.users.dto.UsersDto;

import org.apache.poi.ss.formula.functions.T;
import org.apache.wicket.ajax.AjaxRequestTarget;
import org.apache.wicket.ajax.markup.html.AjaxLink;
Expand All @@ -28,31 +27,31 @@
/**
* Created by honchar.
*/
public class DashboardSearchPanel extends SimplePanel<T> {

private static final String ID_SEARCH_INPUT = "searchInput";
private static final String ID_SEARCH_BUTTON = "searchButton";
private static final String ID_LINK_LABEL = "linkLabel";
private static final String ID_SEARCH_TYPE_ITEM = "searchTypeItem";
private static final String ID_SEARCH_TYPES = "searchTypes";
private static final String ID_BUTTON_LABEL = "buttonLabel";
private static final String ID_SEARCH_FORM = "searchForm";
private static final List<String> SEARCH_TYPES = Arrays.asList(new String[]{
"User", "Resource", "Task"});
private static final int USER_INDEX = 0;
private static final int RESOURCE_INDEX = 1;
private static final int TASK_INDEX = 2;
public class DashboardSearchPanel extends BasePanel<T> {

private final String ID_SEARCH_INPUT = "searchInput";
private final String ID_SEARCH_BUTTON = "searchButton";
private final String ID_SEARCH_TYPE_ITEM = "searchTypeItem";
private final String ID_SEARCH_TYPES = "searchTypes";
private final String ID_BUTTON_LABEL = "buttonLabel";
private final String ID_SEARCH_FORM = "searchForm";
private List<String> SEARCH_TYPES;
private final int USER_INDEX = 0;
private final int RESOURCE_INDEX = 1;
private final int TASK_INDEX = 2;
private int selectedSearchType = 0;

public DashboardSearchPanel(String id) {
this(id, null);
}

public DashboardSearchPanel(String id, IModel<T> model) {
super(id, model);
super(id);
SEARCH_TYPES = Arrays.asList(
createStringResource("PageDashboard.search.users").getString(),
createStringResource("PageDashboard.search.resources").getString(),
createStringResource("PageDashboard.search.tasks").getString()
);

initLayout();
}

@Override
protected void initLayout() {
final Form searchForm = new com.evolveum.midpoint.web.component.form.Form(ID_SEARCH_FORM);
add(searchForm);
Expand All @@ -78,7 +77,7 @@ protected void initLayout() {
@Override
protected void onComponentTag(final ComponentTag tag) {
super.onComponentTag(tag);
tag.put("placeholder", createStringResource("SearchPanel.searchByName").getString());
tag.put("placeholder", createStringResource("PageDashboard.search.input").getString());
}
};
searchForm.add(searchInput);
Expand All @@ -102,10 +101,6 @@ protected void onSubmit(AjaxRequestTarget target, Form<?> form) {
searchForm.add(searchButton);
searchForm.setDefaultButton(searchButton);

// final WebMarkupContainer list = new WebMarkupContainer(ID_SEARCH_TYPES);
// list.setOutputMarkupId(true);


ListView<String> li = new ListView<String>(ID_SEARCH_TYPES, new IModel<List<String>>() {
@Override
public void detach() {
Expand All @@ -119,16 +114,16 @@ public List<String> getObject() {
@Override
public void setObject(List<String> list) {
}
})
{
}) {

@Override
protected void populateItem(final ListItem<String> item) {
@Override
protected void populateItem(final ListItem<String> item) {
final AjaxLink searchTypeLink = new AjaxLink(ID_SEARCH_TYPE_ITEM) {
@Override
public IModel<?> getBody() {
return new Model<String>(item.getModel().getObject());
}

@Override
public void onClick(AjaxRequestTarget target) {
selectedSearchType = accessibleSearchTypes.indexOf(item.getModelObject());
Expand Down Expand Up @@ -164,7 +159,4 @@ private void performSearch(String searchType, String text) {

}

protected IModel<String> createSearchTextModel() {
return (IModel) getModel();
}
}

This file was deleted.

Expand Up @@ -621,4 +621,9 @@ public boolean canBeDefinitionOf(PrismProperty<T> item) {
public boolean canBeDefinitionOf(PrismValue pvalue) {
return refinedAttributeDefinition.canBeDefinitionOf(pvalue);
}

@Override
public String toString() {
return String.valueOf(refinedAttributeDefinition) + ":" + layer;
}
}
Expand Up @@ -38,9 +38,10 @@ public WorkItemAllocationEvent(@NotNull LightweightIdentifierGenerator lightweig
@NotNull ChangeType changeType,
@NotNull WorkItemType workItem, @Nullable SimpleObjectRef assignee, @Nullable SimpleObjectRef initiator,
@Nullable WorkItemOperationInfo operationInfo, @Nullable WorkItemOperationSourceInfo sourceInfo,
@NotNull WfContextType workflowContext, @Nullable Duration timeBefore) {
@NotNull WfContextType workflowContext, @NotNull TaskType workflowTask,
@Nullable Duration timeBefore) {
super(lightweightIdentifierGenerator, changeType, workItem, assignee, initiator, operationInfo, sourceInfo,
workflowContext,null, timeBefore);
workflowContext, workflowTask, null, timeBefore);
}

@Override
Expand Down

0 comments on commit ebd8774

Please sign in to comment.