Skip to content

Commit

Permalink
Merge branch 'master' into feature/ad-connector-improvements-3.9
Browse files Browse the repository at this point in the history
  • Loading branch information
semancik committed Oct 3, 2018
2 parents 91485c2 + 61535ba commit 7752046
Show file tree
Hide file tree
Showing 29 changed files with 1,235 additions and 248 deletions.
7 changes: 7 additions & 0 deletions config/sql/_all/h2-3.9-all.sql
Expand Up @@ -596,6 +596,11 @@ CREATE TABLE m_generic_object (
oid VARCHAR(36) NOT NULL,
PRIMARY KEY (oid)
);
CREATE TABLE m_global_metadata (
name VARCHAR(255) NOT NULL,
value VARCHAR(255),
PRIMARY KEY (name)
);
CREATE TABLE m_lookup_table (
name_norm VARCHAR(255),
name_orig VARCHAR(255),
Expand Down Expand Up @@ -1157,4 +1162,6 @@ ALTER TABLE m_user
ALTER TABLE m_value_policy
ADD CONSTRAINT fk_value_policy FOREIGN KEY (oid) REFERENCES m_object;

INSERT INTO m_global_metadata VALUES ('databaseSchemaVersion', '3.9');

COMMIT;
8 changes: 8 additions & 0 deletions config/sql/_all/h2-upgrade-3.8-3.9.sql
Expand Up @@ -16,3 +16,11 @@ ALTER TABLE m_object_collection
ALTER TABLE m_acc_cert_campaign ADD COLUMN iteration INTEGER DEFAULT 1 NOT NULL;
ALTER TABLE m_acc_cert_case ADD COLUMN iteration INTEGER DEFAULT 1 NOT NULL;
ALTER TABLE m_acc_cert_wi ADD COLUMN iteration INTEGER DEFAULT 1 NOT NULL;

CREATE TABLE m_global_metadata (
name VARCHAR(255) NOT NULL,
value VARCHAR(255),
PRIMARY KEY (name)
);

INSERT INTO m_global_metadata VALUES ('databaseSchemaVersion', '3.9');
10 changes: 10 additions & 0 deletions config/sql/_all/mysql-3.9-all-utf8mb4.sql
Expand Up @@ -756,6 +756,14 @@ CREATE TABLE m_generic_object (
DEFAULT CHARACTER SET utf8mb4
COLLATE utf8mb4_bin
ENGINE = InnoDB;
CREATE TABLE m_global_metadata (
name VARCHAR(191) NOT NULL,
value VARCHAR(191),
PRIMARY KEY (name)
)
DEFAULT CHARACTER SET utf8
COLLATE utf8_bin
ENGINE = InnoDB;
CREATE TABLE m_lookup_table (
name_norm VARCHAR(191),
name_orig VARCHAR(191),
Expand Down Expand Up @@ -1365,6 +1373,8 @@ ALTER TABLE m_user
ALTER TABLE m_value_policy
ADD CONSTRAINT fk_value_policy FOREIGN KEY (oid) REFERENCES m_object (oid);

INSERT INTO m_global_metadata VALUES ('databaseSchemaVersion', '3.9');

# By: Ron Cordell - roncordell
# I didn't see this anywhere, so I thought I'd post it here. This is the script from Quartz to create the tables in a MySQL database, modified to use INNODB instead of MYISAM.

Expand Down
10 changes: 10 additions & 0 deletions config/sql/_all/mysql-3.9-all.sql
Expand Up @@ -756,6 +756,14 @@ CREATE TABLE m_generic_object (
DEFAULT CHARACTER SET utf8
COLLATE utf8_bin
ENGINE = InnoDB;
CREATE TABLE m_global_metadata (
name VARCHAR(255) NOT NULL,
value VARCHAR(255),
PRIMARY KEY (name)
)
DEFAULT CHARACTER SET utf8
COLLATE utf8_bin
ENGINE = InnoDB;
CREATE TABLE m_lookup_table (
name_norm VARCHAR(255),
name_orig VARCHAR(255),
Expand Down Expand Up @@ -1365,6 +1373,8 @@ ALTER TABLE m_user
ALTER TABLE m_value_policy
ADD CONSTRAINT fk_value_policy FOREIGN KEY (oid) REFERENCES m_object (oid);

INSERT INTO m_global_metadata VALUES ('databaseSchemaVersion', '3.9');

# By: Ron Cordell - roncordell
# I didn't see this anywhere, so I thought I'd post it here. This is the script from Quartz to create the tables in a MySQL database, modified to use INNODB instead of MYISAM.

Expand Down
11 changes: 11 additions & 0 deletions config/sql/_all/mysql-upgrade-3.8-3.9-utf8mb4.sql
Expand Up @@ -19,3 +19,14 @@ ALTER TABLE m_object_collection
ALTER TABLE m_acc_cert_campaign ADD COLUMN iteration INTEGER DEFAULT 1 NOT NULL;
ALTER TABLE m_acc_cert_case ADD COLUMN iteration INTEGER DEFAULT 1 NOT NULL;
ALTER TABLE m_acc_cert_wi ADD COLUMN iteration INTEGER DEFAULT 1 NOT NULL;

CREATE TABLE m_global_metadata (
name VARCHAR(191) NOT NULL,
value VARCHAR(191),
PRIMARY KEY (name)
)
DEFAULT CHARACTER SET utf8
COLLATE utf8_bin
ENGINE = InnoDB;

INSERT INTO m_global_metadata VALUES ('databaseSchemaVersion', '3.9');
11 changes: 11 additions & 0 deletions config/sql/_all/mysql-upgrade-3.8-3.9.sql
Expand Up @@ -19,3 +19,14 @@ ALTER TABLE m_object_collection
ALTER TABLE m_acc_cert_campaign ADD COLUMN iteration INTEGER DEFAULT 1 NOT NULL;
ALTER TABLE m_acc_cert_case ADD COLUMN iteration INTEGER DEFAULT 1 NOT NULL;
ALTER TABLE m_acc_cert_wi ADD COLUMN iteration INTEGER DEFAULT 1 NOT NULL;

CREATE TABLE m_global_metadata (
name VARCHAR(255) NOT NULL,
value VARCHAR(255),
PRIMARY KEY (name)
)
DEFAULT CHARACTER SET utf8
COLLATE utf8_bin
ENGINE = InnoDB;

INSERT INTO m_global_metadata VALUES ('databaseSchemaVersion', '3.9');
7 changes: 7 additions & 0 deletions config/sql/_all/oracle-3.9-all.sql
Expand Up @@ -592,6 +592,11 @@ CREATE TABLE m_generic_object (
oid VARCHAR2(36 CHAR) NOT NULL,
PRIMARY KEY (oid)
) INITRANS 30;
CREATE TABLE m_global_metadata (
name VARCHAR2(255 CHAR) NOT NULL,
value VARCHAR2(255 CHAR),
PRIMARY KEY (name)
) INITRANS 30;
CREATE TABLE m_lookup_table (
name_norm VARCHAR2(255 CHAR),
name_orig VARCHAR2(255 CHAR),
Expand Down Expand Up @@ -1152,6 +1157,8 @@ ALTER TABLE m_user
ALTER TABLE m_value_policy
ADD CONSTRAINT fk_value_policy FOREIGN KEY (oid) REFERENCES m_object;

INSERT INTO m_global_metadata VALUES ('databaseSchemaVersion', '3.9');

--
-- A hint submitted by a user: Oracle DB MUST be created as "shared" and the
-- job_queue_processes parameter must be greater than 2
Expand Down
10 changes: 9 additions & 1 deletion config/sql/_all/oracle-upgrade-3.8-3.9.sql
Expand Up @@ -15,4 +15,12 @@ ALTER TABLE m_object_collection

ALTER TABLE m_acc_cert_campaign ADD iteration NUMBER(10, 0) DEFAULT 1 NOT NULL;
ALTER TABLE m_acc_cert_case ADD iteration NUMBER(10, 0) DEFAULT 1 NOT NULL;
ALTER TABLE m_acc_cert_wi ADD iteration NUMBER(10, 0) DEFAULT 1 NOT NULL;
ALTER TABLE m_acc_cert_wi ADD iteration NUMBER(10, 0) DEFAULT 1 NOT NULL;

CREATE TABLE m_global_metadata (
name VARCHAR2(255 CHAR) NOT NULL,
value VARCHAR2(255 CHAR),
PRIMARY KEY (name)
) INITRANS 30;

INSERT INTO m_global_metadata VALUES ('databaseSchemaVersion', '3.9');
7 changes: 7 additions & 0 deletions config/sql/_all/postgresql-3.9-all.sql
Expand Up @@ -592,6 +592,11 @@ CREATE TABLE m_generic_object (
oid VARCHAR(36) NOT NULL,
PRIMARY KEY (oid)
);
CREATE TABLE m_global_metadata (
name VARCHAR(255) NOT NULL,
value VARCHAR(255),
PRIMARY KEY (name)
);
CREATE TABLE m_lookup_table (
name_norm VARCHAR(255),
name_orig VARCHAR(255),
Expand Down Expand Up @@ -1152,6 +1157,8 @@ ALTER TABLE IF EXISTS m_user
ALTER TABLE IF EXISTS m_value_policy
ADD CONSTRAINT fk_value_policy FOREIGN KEY (oid) REFERENCES m_object;

INSERT INTO m_global_metadata VALUES ('databaseSchemaVersion', '3.9');

-- Thanks to Patrick Lightbody for submitting this...
--
-- In your Quartz properties file, you'll need to set
Expand Down
8 changes: 8 additions & 0 deletions config/sql/_all/postgresql-upgrade-3.8-3.9.sql
Expand Up @@ -16,3 +16,11 @@ ALTER TABLE IF EXISTS m_object_collection
ALTER TABLE m_acc_cert_campaign ADD COLUMN iteration INT4 DEFAULT 1 NOT NULL;
ALTER TABLE m_acc_cert_case ADD COLUMN iteration INT4 DEFAULT 1 NOT NULL;
ALTER TABLE m_acc_cert_wi ADD COLUMN iteration INT4 DEFAULT 1 NOT NULL;

CREATE TABLE m_global_metadata (
name VARCHAR(255) NOT NULL,
value VARCHAR(255),
PRIMARY KEY (name)
);

INSERT INTO m_global_metadata VALUES ('databaseSchemaVersion', '3.9');
7 changes: 7 additions & 0 deletions config/sql/_all/sqlserver-3.9-all.sql
Expand Up @@ -592,6 +592,11 @@ CREATE TABLE m_generic_object (
oid NVARCHAR(36) COLLATE database_default NOT NULL,
PRIMARY KEY (oid)
);
CREATE TABLE m_global_metadata (
name NVARCHAR(255) COLLATE database_default NOT NULL,
value NVARCHAR(255) COLLATE database_default,
PRIMARY KEY (name)
);
CREATE TABLE m_lookup_table (
name_norm NVARCHAR(255) COLLATE database_default,
name_orig NVARCHAR(255) COLLATE database_default,
Expand Down Expand Up @@ -1152,6 +1157,8 @@ ALTER TABLE m_user
ALTER TABLE m_value_policy
ADD CONSTRAINT fk_value_policy FOREIGN KEY (oid) REFERENCES m_object;

INSERT INTO m_global_metadata VALUES ('databaseSchemaVersion', '3.9');

--# thanks to George Papastamatopoulos for submitting this ... and Marko Lahma for
--# updating it.
--#
Expand Down
10 changes: 9 additions & 1 deletion config/sql/_all/sqlserver-upgrade-3.8-3.9.sql
Expand Up @@ -15,4 +15,12 @@ ALTER TABLE m_object_collection

ALTER TABLE m_acc_cert_campaign ADD iteration INT DEFAULT 1 NOT NULL;
ALTER TABLE m_acc_cert_case ADD iteration INT DEFAULT 1 NOT NULL;
ALTER TABLE m_acc_cert_wi ADD iteration INT DEFAULT 1 NOT NULL;
ALTER TABLE m_acc_cert_wi ADD iteration INT DEFAULT 1 NOT NULL;

CREATE TABLE m_global_metadata (
name NVARCHAR(255) COLLATE database_default NOT NULL,
value NVARCHAR(255) COLLATE database_default,
PRIMARY KEY (name)
);

INSERT INTO m_global_metadata VALUES ('databaseSchemaVersion', '3.9');
Expand Up @@ -132,6 +132,7 @@ public String getObject() {

buildStringItem(sb, "PendingOperationPanel.resultStatus", op.getResultStatus());
buildStringItem(sb, "PendingOperationPanel.executionStatus", op.getExecutionStatus());
buildStringItem(sb, "PendingOperationPanel.operationReference", op.getAsynchronousOperationReference());
buildStringItem(sb, "PendingOperationPanel.attempt", op.getAttemptNumber());
buildStringItem(sb, "PendingOperationPanel.pendingOperationType", op.getType());
buildStringItem(sb, "PendingOperationPanel.lastAttemptTimestamp", WebComponentUtil.formatDate(op.getLastAttemptTimestamp()));
Expand Down
Expand Up @@ -556,10 +556,8 @@ private static <T extends AbstractRoleType> List<IColumn<SelectableBean<T>, Stri

String sortByDisplayName = null;
String sortByIdentifer = null;
if (OrgType.COMPLEX_TYPE.equals(type)) {
sortByDisplayName = AbstractRoleType.F_DISPLAY_NAME.getLocalPart();
sortByIdentifer = AbstractRoleType.F_IDENTIFIER.getLocalPart();
}
sortByDisplayName = AbstractRoleType.F_DISPLAY_NAME.getLocalPart();
sortByIdentifer = AbstractRoleType.F_IDENTIFIER.getLocalPart();
List<ColumnTypeDto<String>> columnsDefs = Arrays.asList(
new ColumnTypeDto<String>("AbstractRoleType.displayName",
sortByDisplayName,
Expand Down
Expand Up @@ -823,7 +823,7 @@ public void checkInputValue(AutoCompleteTextField input, AjaxRequestTarget targe
if (lookupTable != null) {

panel = new AutoCompleteTextPanel<String>(id, new LookupPropertyModel<>(getModel(),
baseExpression, lookupTable == null ? null : lookupTable.asObjectable()), type) {
baseExpression, lookupTable == null ? null : lookupTable.asObjectable()), String.class) {

@Override
public Iterator<String> getIterator(String input) {
Expand Down
Expand Up @@ -370,7 +370,15 @@ private void initRelationPanel(WebMarkupContainer parametersPanel){
parametersPanel.add(relationContainer);

List<QName> availableRelations = WebComponentUtil.getCategoryRelationChoices(AreaCategoryType.SELF_SERVICE, PageAssignmentShoppingCart.this);
relationContainer.add(new RelationDropDownChoicePanel(ID_RELATION, null, availableRelations, false));
relationContainer.add(new RelationDropDownChoicePanel(ID_RELATION, getRoleCatalogStorage().getSelectedRelation(),
availableRelations, false){
private static final long serialVersionUID = 1L;

@Override
protected void onValueChanged(AjaxRequestTarget target){
getRoleCatalogStorage().setSelectedRelation(getRelationValue());
}
});
}

private QName getRelationParameterValue(){
Expand Down
Expand Up @@ -27,6 +27,7 @@
import com.evolveum.midpoint.xml.ns._public.common.common_3.OrgType;
import com.evolveum.midpoint.xml.ns._public.common.common_3.UserType;

import javax.xml.namespace.QName;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
Expand All @@ -41,7 +42,7 @@ public class RoleCatalogStorage implements PageStorage, OrgTreeStateStorage {
*/
private Map<Integer, Search> roleCatalogSearchMap = new HashMap<>();

/**
/**<
* Paging DTO used in table on page {@link PageAssignmentShoppingCart}
*/

Expand All @@ -60,6 +61,7 @@ public class RoleCatalogStorage implements PageStorage, OrgTreeStateStorage {
private ObjectPaging roleCatalogPaging;
private int assignmentRequestLimit = -1;
private boolean inverse = false;
private QName selectedRelation = null;

public Search getSearch() {
return roleCatalogSearchMap.get(getDefaultTabIndex() < 0 ? 0 : getDefaultTabIndex());
Expand Down Expand Up @@ -222,6 +224,14 @@ public void setAssignmentRequestLimit(int assignmentRequestLimit) {
this.assignmentRequestLimit = assignmentRequestLimit;
}

public QName getSelectedRelation() {
return selectedRelation;
}

public void setSelectedRelation(QName selectedRelation) {
this.selectedRelation = selectedRelation;
}

@Override
public boolean isInverse(){
return inverse;
Expand Down
Expand Up @@ -4206,6 +4206,7 @@ TaskExecutionGroupConstraintType.details.newValue=New secondary execution group
PendingOperationPanel.pendingOperationType=Type:
PendingOperationPanel.resultStatus=Result status:
PendingOperationPanel.executionStatus=Execution status:
PendingOperationPanel.operationReference=Operation reference:
PendingOperationPanel.attempt=Attempt:
PendingOperationPanel.lastAttemptTimestamp=Last attempt:
PendingOperationPanel.completionTimestamp=Completed:
Expand Down
Expand Up @@ -21,6 +21,7 @@
import java.util.Iterator;
import java.util.List;

import com.evolveum.midpoint.schema.constants.ObjectTypes;
import com.evolveum.midpoint.schema.constants.SchemaConstants;
import com.evolveum.midpoint.schema.internals.InternalsConfig;
import com.evolveum.midpoint.xml.ns._public.common.common_3.*;
Expand Down Expand Up @@ -132,7 +133,7 @@ public <F extends ObjectType> void load(LensContext<F> context, String activityD

LensFocusContext<F> focusContext = context.getFocusContext();
if (focusContext != null) {
loadObjectCurrent(context, result);
loadObjectCurrent(context, task, result);

context.recomputeFocus();

Expand Down Expand Up @@ -352,8 +353,8 @@ public <F extends FocusType> void determineFocusContext(LensContext<F> context,
}
}

private <F extends ObjectType> void loadObjectCurrent(LensContext<F> context, OperationResult result) throws SchemaException, ObjectNotFoundException {
LensFocusContext<F> focusContext = context.getFocusContext();
private <O extends ObjectType> void loadObjectCurrent(LensContext<O> context, Task task, OperationResult result) throws SchemaException, ObjectNotFoundException, CommunicationException, ConfigurationException, SecurityViolationException, ExpressionEvaluationException {
LensFocusContext<O> focusContext = context.getFocusContext();
if (focusContext == null) {
// Nothing to load
return;
Expand All @@ -364,7 +365,7 @@ private <F extends ObjectType> void loadObjectCurrent(LensContext<F> context, Op
// already loaded
return;
}
ObjectDelta<F> objectDelta = focusContext.getDelta();
ObjectDelta<O> objectDelta = focusContext.getDelta();
if (objectDelta != null && objectDelta.isAdd() && focusContext.getExecutedDeltas().isEmpty()) {
//we're adding the focal object. No need to load it, it is in the delta
focusContext.setFresh(true);
Expand All @@ -380,13 +381,20 @@ private <F extends ObjectType> void loadObjectCurrent(LensContext<F> context, Op
if (StringUtils.isBlank(userOid)) {
throw new IllegalArgumentException("No OID in primary focus delta");
}

// Always load a complete object here, including the not-returned-by-default properties.
// This is temporary measure to make sure that the mappings will have all they need.
// See MID-2635
Collection<SelectorOptions<GetOperationOptions>> options =
SelectorOptions.createCollection(GetOperationOptions.createRetrieve(RetrieveOption.INCLUDE));
PrismObject<F> object = cacheRepositoryService.getObject(focusContext.getObjectTypeClass(), userOid, options, result);

PrismObject<O> object = null;
if (ObjectTypes.isClassManagedByProvisioning(focusContext.getObjectTypeClass())) {
object = provisioningService.getObject(focusContext.getObjectTypeClass(), userOid, SelectorOptions.createCollection(GetOperationOptions.createNoFetch()), task, result);
} else {

// Always load a complete object here, including the not-returned-by-default properties.
// This is temporary measure to make sure that the mappings will have all they need.
// See MID-2635
Collection<SelectorOptions<GetOperationOptions>> options =
SelectorOptions.createCollection(GetOperationOptions.createRetrieve(RetrieveOption.INCLUDE));
object = cacheRepositoryService.getObject(focusContext.getObjectTypeClass(), userOid, options, result);
}

focusContext.setLoadedObject(object);
focusContext.setFresh(true);
LOGGER.trace("Focal object loaded: {}", object);
Expand Down
2 changes: 1 addition & 1 deletion repo/repo-sql-impl/pom.xml
Expand Up @@ -50,7 +50,7 @@
<resource>
<directory>${project.basedir}/../../config/sql/_all</directory>
<includes>
<include>*-all.sql</include>
<include>*.sql</include>
</includes>
</resource>
</resources>
Expand Down

0 comments on commit 7752046

Please sign in to comment.