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 May 19, 2017
2 parents 3f5543a + c95dd29 commit 37e1aff
Show file tree
Hide file tree
Showing 227 changed files with 7,077 additions and 1,672 deletions.
2 changes: 2 additions & 0 deletions config/sql/midpoint/3.6/h2/h2-3.6.sql
Expand Up @@ -274,8 +274,10 @@ CREATE TABLE m_audit_event (
initiatorName VARCHAR(255),
initiatorOid VARCHAR(36),
message VARCHAR(1024),
nodeIdentifier VARCHAR(255),
outcome INTEGER,
parameter VARCHAR(255),
remoteHostAddress VARCHAR(255),
result VARCHAR(255),
sessionIdentifier VARCHAR(255),
targetName VARCHAR(255),
Expand Down
3 changes: 3 additions & 0 deletions config/sql/midpoint/3.6/h2/h2-upgrade-3.5-3.6.sql
Expand Up @@ -170,3 +170,6 @@ ALTER TABLE m_operation_execution
ADD CONSTRAINT fk_op_exec_owner
FOREIGN KEY (owner_oid)
REFERENCES m_object;

ALTER TABLE m_audit_event ADD COLUMN nodeIdentifier VARCHAR(255);
ALTER TABLE m_audit_event ADD COLUMN remoteHostAddress VARCHAR(255);
2 changes: 2 additions & 0 deletions config/sql/midpoint/3.6/mysql/mysql-3.6.sql
Expand Up @@ -338,8 +338,10 @@ CREATE TABLE m_audit_event (
initiatorName VARCHAR(255),
initiatorOid VARCHAR(36),
message VARCHAR(1024),
nodeIdentifier VARCHAR(255),
outcome INTEGER,
parameter VARCHAR(255),
remoteHostAddress VARCHAR(255),
result VARCHAR(255),
sessionIdentifier VARCHAR(255),
targetName VARCHAR(255),
Expand Down
3 changes: 3 additions & 0 deletions config/sql/midpoint/3.6/mysql/mysql-upgrade-3.5-3.6.sql
Expand Up @@ -195,3 +195,6 @@ ALTER TABLE m_operation_execution
ADD CONSTRAINT fk_op_exec_owner
FOREIGN KEY (owner_oid)
REFERENCES m_object (oid);

ALTER TABLE m_audit_event ADD COLUMN nodeIdentifier VARCHAR(255);
ALTER TABLE m_audit_event ADD COLUMN remoteHostAddress VARCHAR(255);
2 changes: 2 additions & 0 deletions config/sql/midpoint/3.6/oracle/oracle-3.6.sql
Expand Up @@ -277,8 +277,10 @@ CREATE TABLE m_audit_event (
initiatorName VARCHAR2(255 CHAR),
initiatorOid VARCHAR2(36 CHAR),
message VARCHAR2(1024 CHAR),
nodeIdentifier VARCHAR2(255 CHAR),
outcome NUMBER(10, 0),
parameter VARCHAR2(255 CHAR),
remoteHostAddress VARCHAR2(255 CHAR),
result VARCHAR2(255 CHAR),
sessionIdentifier VARCHAR2(255 CHAR),
targetName VARCHAR2(255 CHAR),
Expand Down
3 changes: 3 additions & 0 deletions config/sql/midpoint/3.6/oracle/oracle-upgrade-3.5-3.6.sql
Expand Up @@ -172,3 +172,6 @@ ALTER TABLE m_operation_execution
ADD CONSTRAINT fk_op_exec_owner
FOREIGN KEY (owner_oid)
REFERENCES m_object;

ALTER TABLE m_audit_event ADD (nodeIdentifier VARCHAR2(255 CHAR));
ALTER TABLE m_audit_event ADD (remoteHostAddress VARCHAR2(255 CHAR));
2 changes: 2 additions & 0 deletions config/sql/midpoint/3.6/postgresql/postgresql-3.6.sql
Expand Up @@ -274,8 +274,10 @@ CREATE TABLE m_audit_event (
initiatorName VARCHAR(255),
initiatorOid VARCHAR(36),
message VARCHAR(1024),
nodeIdentifier VARCHAR(255),
outcome INT4,
parameter VARCHAR(255),
remoteHostAddress VARCHAR(255),
result VARCHAR(255),
sessionIdentifier VARCHAR(255),
targetName VARCHAR(255),
Expand Down
Expand Up @@ -167,7 +167,13 @@ CREATE INDEX iOpExecInitiatorOid
CREATE INDEX iOpExecStatus
ON m_operation_execution (status);

CREATE INDEX iOpExecOwnerOid
ON m_operation_execution (owner_oid);

ALTER TABLE m_operation_execution
ADD CONSTRAINT fk_op_exec_owner
FOREIGN KEY (owner_oid)
REFERENCES m_object;

ALTER TABLE m_audit_event ADD COLUMN nodeIdentifier VARCHAR(255);
ALTER TABLE m_audit_event ADD COLUMN remoteHostAddress VARCHAR(255);
2 changes: 2 additions & 0 deletions config/sql/midpoint/3.6/sqlserver/sqlserver-3.6.sql
Expand Up @@ -274,8 +274,10 @@ CREATE TABLE m_audit_event (
initiatorName NVARCHAR(255) COLLATE database_default,
initiatorOid NVARCHAR(36) COLLATE database_default,
message NVARCHAR(1024) COLLATE database_default,
nodeIdentifier NVARCHAR(255) COLLATE database_default,
outcome INT,
parameter NVARCHAR(255) COLLATE database_default,
remoteHostAddress NVARCHAR(255) COLLATE database_default,
result NVARCHAR(255) COLLATE database_default,
sessionIdentifier NVARCHAR(255) COLLATE database_default,
targetName NVARCHAR(255) COLLATE database_default,
Expand Down
Expand Up @@ -82,8 +82,8 @@ DROP TABLE m_acc_cert_case_reference;
EXEC sp_rename 'm_acc_cert_case.currentStageNumber', 'stageNumber', 'COLUMN';
ALTER TABLE m_acc_cert_case DROP COLUMN currentStageOutcome;
ALTER TABLE m_acc_cert_case DROP COLUMN overallOutcome;
ALTER TABLE m_acc_cert_case ADD currentStageOutcome NVARCHAR(255);
ALTER TABLE m_acc_cert_case ADD outcome NVARCHAR(255);
ALTER TABLE m_acc_cert_case ADD currentStageOutcome NVARCHAR(255) COLLATE database_default;
ALTER TABLE m_acc_cert_case ADD outcome NVARCHAR(255) COLLATE database_default;

DROP TABLE m_acc_cert_decision;

Expand Down Expand Up @@ -171,3 +171,6 @@ ALTER TABLE m_operation_execution
ADD CONSTRAINT fk_op_exec_owner
FOREIGN KEY (owner_oid)
REFERENCES m_object;

ALTER TABLE m_audit_event ADD nodeIdentifier NVARCHAR(255) COLLATE database_default;
ALTER TABLE m_audit_event ADD remoteHostAddress NVARCHAR(255) COLLATE database_default;
Expand Up @@ -46,8 +46,8 @@ public void populateItem(Item<ICellPopulator<T>> cellItem, String componentId,
}

protected InputPanel createInputPanel(String componentId, final IModel<T> model) {
TextPanel textPanel = new TextPanel(componentId, new PropertyModel(model, getPropertyExpression()));
TextField textField = (TextField) textPanel.getBaseFormComponent(); // UGLY HACK
TextPanel<?> textPanel = new TextPanel<String>(componentId, new PropertyModel<>(model, getPropertyExpression()));
TextField<?> textField = (TextField<?>) textPanel.getBaseFormComponent(); // UGLY HACK
textField.add(new AjaxFormComponentUpdatingBehavior("blur") {
@Override
protected void onUpdate(AjaxRequestTarget target) {
Expand All @@ -58,6 +58,6 @@ protected void onUpdate(AjaxRequestTarget target) {
}

public void onBlur(AjaxRequestTarget target, IModel<T> model) {
// doing nothing; may be overriden in subclasses
// doing nothing; may be overridden in subclasses
}
}
Expand Up @@ -16,20 +16,17 @@

package com.evolveum.midpoint.web.component.progress;

import com.evolveum.midpoint.model.api.*;
import com.evolveum.midpoint.model.api.ModelExecuteOptions;
import com.evolveum.midpoint.model.api.ModelInteractionService;
import com.evolveum.midpoint.model.api.ModelService;
import com.evolveum.midpoint.model.api.context.ModelContext;
import com.evolveum.midpoint.prism.delta.ObjectDelta;
import com.evolveum.midpoint.schema.result.OperationResult;
import com.evolveum.midpoint.security.api.HttpConnectionInformation;
import com.evolveum.midpoint.security.api.SecurityEnforcer;
import com.evolveum.midpoint.security.api.SecurityUtil;
import com.evolveum.midpoint.task.api.Task;
import com.evolveum.midpoint.util.exception.CommunicationException;
import com.evolveum.midpoint.util.exception.ConfigurationException;
import com.evolveum.midpoint.util.exception.ExpressionEvaluationException;
import com.evolveum.midpoint.util.exception.ObjectAlreadyExistsException;
import com.evolveum.midpoint.util.exception.ObjectNotFoundException;
import com.evolveum.midpoint.util.exception.PolicyViolationException;
import com.evolveum.midpoint.util.exception.SchemaException;
import com.evolveum.midpoint.util.exception.SecurityViolationException;
import com.evolveum.midpoint.util.exception.*;
import com.evolveum.midpoint.util.logging.LoggingUtils;
import com.evolveum.midpoint.util.logging.Trace;
import com.evolveum.midpoint.util.logging.TraceManager;
Expand Down Expand Up @@ -166,29 +163,32 @@ private void executeChangesSync(Collection<ObjectDelta<? extends ObjectType>> de
private void executeChangesAsync(final Collection<ObjectDelta<? extends ObjectType>> deltas, final boolean previewOnly,
final ModelExecuteOptions options, final Task task, final OperationResult result, AjaxRequestTarget target,
final ModelService modelService, final ModelInteractionService modelInteractionService) {
final SecurityEnforcer enforcer = parentPage.getSecurityEnforcer();
final Authentication authentication = SecurityContextHolder.getContext().getAuthentication();
final SecurityEnforcer enforcer = parentPage.getSecurityEnforcer();
final Authentication authentication = SecurityContextHolder.getContext().getAuthentication();

asyncOperationResult = null;
asyncOperationResult = null;

clearProgressPanel();
startRefreshingProgressPanel(target);
showProgressPanel();
clearProgressPanel();
startRefreshingProgressPanel(target);
showProgressPanel();

progressPanel.setTask(task);
progressListener = new DefaultGuiProgressListener(parentPage, progressPanel.getModelObject());
Runnable execution = () -> {
progressPanel.setTask(task);
progressListener = new DefaultGuiProgressListener(parentPage, progressPanel.getModelObject());
final HttpConnectionInformation connInfo = SecurityUtil.getCurrentConnectionInformation();
Runnable execution = () -> {
try {
enforcer.storeConnectionInformation(connInfo);
enforcer.setupPreAuthenticatedSecurityContext(authentication);
progressPanel.recordExecutionStart();
if (previewOnly) {
previewResult = modelInteractionService.previewChanges(deltas, options, task, Collections.singleton(progressListener), result);
previewResult = modelInteractionService
.previewChanges(deltas, options, task, Collections.singleton(progressListener), result);
} else {
modelService.executeChanges(deltas, options, task, Collections.singleton(progressListener), result);
}
} catch (CommunicationException|ObjectAlreadyExistsException|ExpressionEvaluationException|
PolicyViolationException|SchemaException|SecurityViolationException|
ConfigurationException|ObjectNotFoundException|RuntimeException e) {
} catch (CommunicationException | ObjectAlreadyExistsException | ExpressionEvaluationException |
PolicyViolationException | SchemaException | SecurityViolationException |
ConfigurationException | ObjectNotFoundException | RuntimeException e) {
LoggingUtils.logUnexpectedException(LOGGER, "Error executing changes", e);
if (!result.isFatalError()) { // just to be sure the exception is recorded into the result
result.recordFatalError(e.getMessage(), e);
Expand Down
Expand Up @@ -54,7 +54,7 @@ public enum WhichObject {
OBJECT, TARGET
}

IColumn createTypeColumn(final WhichObject which, final PageBase page) {
<T extends CertCaseOrWorkItemDto> IColumn<T, String> createTypeColumn(final WhichObject which, final PageBase page) {
IColumn column;
column = new IconColumn<CertCaseOrWorkItemDto>(page.createStringResource("")) {
@Override
Expand Down Expand Up @@ -82,7 +82,7 @@ public void populateItem(Item<ICellPopulator<CertCaseOrWorkItemDto>> item, Strin
return column;
}

IColumn createObjectNameColumn(final PageBase page, final String headerKey) {
<T extends CertCaseOrWorkItemDto> IColumn<T, String> createObjectNameColumn(final PageBase page, final String headerKey) {
IColumn column;
column = new LinkColumn<CertCaseOrWorkItemDto>(page.createStringResource(headerKey),
SearchingUtils.OBJECT_NAME, CertCaseOrWorkItemDto.F_OBJECT_NAME) {
Expand All @@ -96,7 +96,7 @@ public void onClick(AjaxRequestTarget target, IModel<CertCaseOrWorkItemDto> rowM
return column;
}

IColumn createTargetNameColumn(final PageBase page, final String headerKey) {
<T extends CertCaseOrWorkItemDto> IColumn<T, String> createTargetNameColumn(final PageBase page, final String headerKey) {
IColumn column;
column = new LinkColumn<CertCaseOrWorkItemDto>(page.createStringResource(headerKey),
SearchingUtils.TARGET_NAME, CertCaseOrWorkItemDto.F_TARGET_NAME) {
Expand All @@ -110,12 +110,11 @@ public void onClick(AjaxRequestTarget target, IModel<CertCaseOrWorkItemDto> rowM
return column;
}

IColumn createConflictingNameColumn(final PageBase page, final String headerKey) {
return new PropertyColumn<CertCaseOrWorkItemDto, String>(page.createStringResource(headerKey),
CertCaseOrWorkItemDto.F_CONFLICTING_TARGETS);
<T extends CertCaseOrWorkItemDto> IColumn<T, String> createConflictingNameColumn(final PageBase page, final String headerKey) {
return new PropertyColumn<>(page.createStringResource(headerKey), CertCaseOrWorkItemDto.F_CONFLICTING_TARGETS);
}

public IColumn createDetailedInfoColumn(final PageBase page) {
<T extends CertCaseOrWorkItemDto> IColumn<T, String> createDetailedInfoColumn(final PageBase page) {
IColumn column;
column = new IconColumn<CertCaseOrWorkItemDto>(page.createStringResource("")) {

Expand Down
Expand Up @@ -144,7 +144,7 @@ private void initLayout() {
add(mainForm);
CertWorkItemDtoProvider provider = createProvider();
int itemsPerPage = (int) getItemsPerPage(UserProfileStorage.TableId.PAGE_CERT_DECISIONS_PANEL);
BoxedTablePanel table = new BoxedTablePanel(ID_DECISIONS_TABLE, provider, initColumns(),
BoxedTablePanel<CertWorkItemDto> table = new BoxedTablePanel<CertWorkItemDto>(ID_DECISIONS_TABLE, provider, initColumns(),
UserProfileStorage.TableId.PAGE_CERT_DECISIONS_PANEL, itemsPerPage) {

@Override
Expand Down Expand Up @@ -174,7 +174,7 @@ protected WebMarkupContainer createHeader(String headerId) {
private List<IColumn<CertWorkItemDto, String>> initColumns() {
List<IColumn<CertWorkItemDto, String>> columns = new ArrayList<>();

IColumn column;
IColumn<CertWorkItemDto, String> column;

column = new CheckBoxHeaderColumn<>();
columns.add(column);
Expand Down Expand Up @@ -356,7 +356,7 @@ public void clickPerformed(int id, AjaxRequestTarget target,
};
columns.add(column);

column = new DirectlyEditablePropertyColumn(
column = new DirectlyEditablePropertyColumn<CertWorkItemDto>(
createStringResource("PageCertDecisions.table.comment"),
CertWorkItemDto.F_COMMENT) {
@Override
Expand Down Expand Up @@ -458,6 +458,9 @@ private void recordActionPerformed(AjaxRequestTarget target, CertWorkItemDto wor
OperationResult result = new OperationResult(OPERATION_RECORD_ACTION);
try {
Task task = createSimpleTask(OPERATION_RECORD_ACTION);
if (response == null) {
response = workItemDto.getResponse();
}
// TODO work item ID
getCertificationService().recordDecision(
workItemDto.getCampaignRef().getOid(),
Expand Down
Expand Up @@ -80,6 +80,14 @@
<td><wicket:message key="PageAuditLogDetails.hostIdentifier" /></td>
<td><span wicket:id="hostIdentifier" /></td>
</tr>
<tr>
<td><wicket:message key="PageAuditLogDetails.nodeIdentifier" /></td>
<td><span wicket:id="nodeIdentifier" /></td>
</tr>
<tr>
<td><wicket:message key="PageAuditLogDetails.remoteHostAddress" /></td>
<td><span wicket:id="remoteHostAddress" /></td>
</tr>
<tr>
<td><wicket:message key="PageAuditLogDetails.channel" /></td>
<td><span wicket:id="channel" /></td>
Expand Down
Expand Up @@ -69,6 +69,8 @@ public class PageAuditLogDetails extends PageBase {
private static final String ID_PARAMETERS_TASK_IDENTIFIER = "taskIdentifier";
private static final String ID_PARAMETERS_TASK_OID = "taskOID";
private static final String ID_PARAMETERS_HOST_IDENTIFIER = "hostIdentifier";
private static final String ID_PARAMETERS_NODE_IDENTIFIER = "nodeIdentifier";
private static final String ID_PARAMETERS_REMOTE_HOST_ADDRESS = "remoteHostAddress";
private static final String ID_PARAMETERS_EVENT_INITIATOR = "initiatorRef";
private static final String ID_PARAMETERS_EVENT_TARGET = "targetRef";
private static final String ID_PARAMETERS_EVENT_TARGET_OWNER = "targetOwnerRef";
Expand Down Expand Up @@ -284,7 +286,15 @@ private void initEventPanel(WebMarkupContainer eventPanel){
hostIdentifier.setOutputMarkupId(true);
eventDetailsPanel.add(hostIdentifier);

final Label initiatorRef = new Label(ID_PARAMETERS_EVENT_INITIATOR,
final Label nodeIdentifier = new Label(ID_PARAMETERS_NODE_IDENTIFIER, new PropertyModel(recordModel, ID_PARAMETERS_NODE_IDENTIFIER));
nodeIdentifier.setOutputMarkupId(true);
eventDetailsPanel.add(nodeIdentifier);

final Label remoteHostAddress = new Label(ID_PARAMETERS_REMOTE_HOST_ADDRESS, new PropertyModel(recordModel, ID_PARAMETERS_REMOTE_HOST_ADDRESS));
remoteHostAddress.setOutputMarkupId(true);
eventDetailsPanel.add(remoteHostAddress);

final Label initiatorRef = new Label(ID_PARAMETERS_EVENT_INITIATOR,
new Model<>(WebModelServiceUtils.resolveReferenceName(recordModel.getObject().getInitiatorRef(), this,
createSimpleTask(ID_PARAMETERS_EVENT_INITIATOR),
new OperationResult(ID_PARAMETERS_EVENT_INITIATOR))));
Expand Down
Expand Up @@ -229,9 +229,9 @@ private void initParametersPanel(Form mainForm) {
changedItemPanel.setOutputMarkupId(true);
parametersPanel.add(changedItemPanel);

PropertyModel<String> hostIdentifierModel = new PropertyModel<String>(auditSearchDto,
PropertyModel<String> hostIdentifierModel = new PropertyModel<>(auditSearchDto,
AuditSearchDto.F_HOST_IDENTIFIER);
TextPanel<String> hostIdentifier = new TextPanel<String>(ID_HOST_IDENTIFIER, hostIdentifierModel);
TextPanel<String> hostIdentifier = new TextPanel<>(ID_HOST_IDENTIFIER, hostIdentifierModel);
hostIdentifier.getBaseFormComponent().add(new EmptyOnChangeAjaxFormUpdatingBehavior());
hostIdentifier.getBaseFormComponent().add(new EmptyOnBlurAjaxFormUpdatingBehaviour());
hostIdentifier.setOutputMarkupId(true);
Expand Down
Expand Up @@ -115,9 +115,8 @@ private void init(final PageParameters pageParameters) {
initLayout(result);
}

private UsernamePasswordAuthenticationToken authenticateUser(String username, String nonce, OperationResult result){
ConnectionEnvironment connEnv = new ConnectionEnvironment();
connEnv.setChannel(SchemaConstants.CHANNEL_GUI_SELF_REGISTRATION_URI);
private UsernamePasswordAuthenticationToken authenticateUser(String username, String nonce, OperationResult result) {
ConnectionEnvironment connEnv = ConnectionEnvironment.create(SchemaConstants.CHANNEL_GUI_SELF_REGISTRATION_URI);
try {
return getAuthenticationEvaluator().authenticate(connEnv, new NonceAuthenticationContext(username,
nonce, getResetPasswordPolicy().getNoncePolicy()));
Expand Down

0 comments on commit 37e1aff

Please sign in to comment.