Skip to content

Commit

Permalink
Merge branch 'features/full-text-search'
Browse files Browse the repository at this point in the history
  • Loading branch information
mederly committed Feb 24, 2017
2 parents a6ac499 + b2e5dd6 commit 19fd556
Show file tree
Hide file tree
Showing 75 changed files with 1,085 additions and 467 deletions.
11 changes: 11 additions & 0 deletions config/sql/midpoint/3.6/h2/h2-3.6.sql
Expand Up @@ -527,6 +527,12 @@ CREATE TABLE m_object_template (
PRIMARY KEY (oid)
);

CREATE TABLE m_object_text_info (
owner_oid VARCHAR(36) NOT NULL,
text VARCHAR(255) NOT NULL,
PRIMARY KEY (owner_oid, text)
);

CREATE TABLE m_org (
costCenter VARCHAR(255),
displayOrder INTEGER,
Expand Down Expand Up @@ -1145,6 +1151,11 @@ ADD CONSTRAINT fk_object_template
FOREIGN KEY (oid)
REFERENCES m_object;

ALTER TABLE m_object_text_info
ADD CONSTRAINT fk_object_text_info_owner
FOREIGN KEY (owner_oid)
REFERENCES m_object;

ALTER TABLE m_org
ADD CONSTRAINT fk_org
FOREIGN KEY (oid)
Expand Down
11 changes: 11 additions & 0 deletions config/sql/midpoint/3.6/h2/h2-upgrade-3.5-3.6.sql
Expand Up @@ -48,3 +48,14 @@ ALTER TABLE m_audit_ref_value
FOREIGN KEY (record_id)
REFERENCES m_audit_event;

CREATE TABLE m_object_text_info (
owner_oid VARCHAR(36) NOT NULL,
text VARCHAR(255) NOT NULL,
PRIMARY KEY (owner_oid, text)
);

ALTER TABLE m_object_text_info
ADD CONSTRAINT fk_object_text_info_owner
FOREIGN KEY (owner_oid)
REFERENCES m_object;

14 changes: 14 additions & 0 deletions config/sql/midpoint/3.6/mysql/mysql-3.6.sql
Expand Up @@ -663,6 +663,15 @@ CREATE TABLE m_object_template (
COLLATE utf8_bin
ENGINE = InnoDB;

CREATE TABLE m_object_text_info (
owner_oid VARCHAR(36) NOT NULL,
text VARCHAR(255) NOT NULL,
PRIMARY KEY (owner_oid, text)
)
DEFAULT CHARACTER SET utf8
COLLATE utf8_bin
ENGINE = InnoDB;

CREATE TABLE m_org (
costCenter VARCHAR(255),
displayOrder INTEGER,
Expand Down Expand Up @@ -1349,6 +1358,11 @@ ADD CONSTRAINT fk_object_template
FOREIGN KEY (oid)
REFERENCES m_object (oid);

ALTER TABLE m_object_text_info
ADD CONSTRAINT fk_object_text_info_owner
FOREIGN KEY (owner_oid)
REFERENCES m_object (oid);

ALTER TABLE m_org
ADD CONSTRAINT fk_org
FOREIGN KEY (oid)
Expand Down
13 changes: 13 additions & 0 deletions config/sql/midpoint/3.6/mysql/mysql-upgrade-3.5-3.6.sql
Expand Up @@ -57,3 +57,16 @@ ALTER TABLE m_audit_ref_value
FOREIGN KEY (record_id)
REFERENCES m_audit_event (id);

CREATE TABLE m_object_text_info (
owner_oid VARCHAR(36) NOT NULL,
text VARCHAR(255) NOT NULL,
PRIMARY KEY (owner_oid, text)
)
DEFAULT CHARACTER SET utf8
COLLATE utf8_bin
ENGINE = InnoDB;

ALTER TABLE m_object_text_info
ADD CONSTRAINT fk_object_text_info_owner
FOREIGN KEY (owner_oid)
REFERENCES m_object (oid);
11 changes: 11 additions & 0 deletions config/sql/midpoint/3.6/oracle/oracle-3.6.sql
Expand Up @@ -530,6 +530,12 @@ CREATE TABLE m_object_template (
PRIMARY KEY (oid)
) INITRANS 30;

CREATE TABLE m_object_text_info (
owner_oid VARCHAR2(36 CHAR) NOT NULL,
text VARCHAR2(255 CHAR) NOT NULL,
PRIMARY KEY (owner_oid, text)
) INITRANS 30;

CREATE TABLE m_org (
costCenter VARCHAR2(255 CHAR),
displayOrder NUMBER(10, 0),
Expand Down Expand Up @@ -1155,6 +1161,11 @@ ADD CONSTRAINT fk_object_template
FOREIGN KEY (oid)
REFERENCES m_object;

ALTER TABLE m_object_text_info
ADD CONSTRAINT fk_object_text_info_owner
FOREIGN KEY (owner_oid)
REFERENCES m_object;

ALTER TABLE m_org
ADD CONSTRAINT fk_org
FOREIGN KEY (oid)
Expand Down
11 changes: 11 additions & 0 deletions config/sql/midpoint/3.6/oracle/oracle-upgrade-3.5-3.6.sql
Expand Up @@ -48,3 +48,14 @@ ALTER TABLE m_audit_ref_value
ADD CONSTRAINT fk_audit_ref_value
FOREIGN KEY (record_id)
REFERENCES m_audit_event;

CREATE TABLE m_object_text_info (
owner_oid VARCHAR2(36 CHAR) NOT NULL,
text VARCHAR2(255 CHAR) NOT NULL,
PRIMARY KEY (owner_oid, text)
) INITRANS 30;

ALTER TABLE m_object_text_info
ADD CONSTRAINT fk_object_text_info_owner
FOREIGN KEY (owner_oid)
REFERENCES m_object;
11 changes: 11 additions & 0 deletions config/sql/midpoint/3.6/postgresql/postgresql-3.6.sql
Expand Up @@ -527,6 +527,12 @@ CREATE TABLE m_object_template (
PRIMARY KEY (oid)
);

CREATE TABLE m_object_text_info (
owner_oid VARCHAR(36) NOT NULL,
text VARCHAR(255) NOT NULL,
PRIMARY KEY (owner_oid, text)
);

CREATE TABLE m_org (
costCenter VARCHAR(255),
displayOrder INT4,
Expand Down Expand Up @@ -1145,6 +1151,11 @@ ADD CONSTRAINT fk_object_template
FOREIGN KEY (oid)
REFERENCES m_object;

ALTER TABLE m_object_text_info
ADD CONSTRAINT fk_object_text_info_owner
FOREIGN KEY (owner_oid)
REFERENCES m_object;

ALTER TABLE m_org
ADD CONSTRAINT fk_org
FOREIGN KEY (oid)
Expand Down
10 changes: 10 additions & 0 deletions config/sql/midpoint/3.6/postgresql/postgresql-upgrade-3.5-3.6.sql
Expand Up @@ -48,3 +48,13 @@ ALTER TABLE m_audit_ref_value
FOREIGN KEY (record_id)
REFERENCES m_audit_event;

CREATE TABLE m_object_text_info (
owner_oid VARCHAR(36) NOT NULL,
text VARCHAR(255) NOT NULL,
PRIMARY KEY (owner_oid, text)
);

ALTER TABLE m_object_text_info
ADD CONSTRAINT fk_object_text_info_owner
FOREIGN KEY (owner_oid)
REFERENCES m_object;
11 changes: 11 additions & 0 deletions config/sql/midpoint/3.6/sqlserver/sqlserver-3.6.sql
Expand Up @@ -527,6 +527,12 @@ CREATE TABLE m_object_template (
PRIMARY KEY (oid)
);

CREATE TABLE m_object_text_info (
owner_oid NVARCHAR(36) COLLATE database_default NOT NULL,
text NVARCHAR(255) COLLATE database_default NOT NULL,
PRIMARY KEY (owner_oid, text)
);

CREATE TABLE m_org (
costCenter NVARCHAR(255) COLLATE database_default,
displayOrder INT,
Expand Down Expand Up @@ -1145,6 +1151,11 @@ ADD CONSTRAINT fk_object_template
FOREIGN KEY (oid)
REFERENCES m_object;

ALTER TABLE m_object_text_info
ADD CONSTRAINT fk_object_text_info_owner
FOREIGN KEY (owner_oid)
REFERENCES m_object;

ALTER TABLE m_org
ADD CONSTRAINT fk_org
FOREIGN KEY (oid)
Expand Down
12 changes: 12 additions & 0 deletions config/sql/midpoint/3.6/sqlserver/sqlserver-upgrade-3.5-3.6.sql
Expand Up @@ -47,3 +47,15 @@ ALTER TABLE m_audit_ref_value
ADD CONSTRAINT fk_audit_ref_value
FOREIGN KEY (record_id)
REFERENCES m_audit_event;

CREATE TABLE m_object_text_info (
owner_oid NVARCHAR(36) COLLATE database_default NOT NULL,
text NVARCHAR(255) COLLATE database_default NOT NULL,
PRIMARY KEY (owner_oid, text)
);

ALTER TABLE m_object_text_info
ADD CONSTRAINT fk_object_text_info_owner
FOREIGN KEY (owner_oid)
REFERENCES m_object;

Expand Up @@ -40,10 +40,10 @@ public void setModel(ModelService model) {
public void init() {
LOGGER.info("Model post initialization.");

OperationResult mainResult = new OperationResult("Model Post Initialisation");
OperationResult mainResult = new OperationResult("Model Post Initialization");
try {
model.postInit(mainResult);
LOGGER.info("Model post initialization finished successful.");
LOGGER.info("Model post initialization finished successfully.");
} catch (Exception ex) {
LoggingUtils.logUnexpectedException(LOGGER, "Model post initialization failed", ex);
mainResult.recordFatalError("Model post initialization failed.", ex);
Expand Down
@@ -0,0 +1,53 @@
/*
* Copyright (c) 2010-2017 Evolveum
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package com.evolveum.midpoint.init;

import com.evolveum.midpoint.repo.api.RepositoryService;
import com.evolveum.midpoint.schema.result.OperationResult;
import com.evolveum.midpoint.util.logging.LoggingUtils;
import com.evolveum.midpoint.util.logging.Trace;
import com.evolveum.midpoint.util.logging.TraceManager;
import org.jetbrains.annotations.NotNull;

/**
* @author mederly
*/
public class RepoInitialSetup {

private static final Trace LOGGER = TraceManager.getTrace(RepoInitialSetup.class);

@NotNull private RepositoryService repositoryService;

public RepoInitialSetup(@NotNull RepositoryService repositoryService) {
this.repositoryService = repositoryService;
}

public void init() {
LOGGER.info("Repository post initialization.");

OperationResult result = new OperationResult(RepoInitialSetup.class.getName() + ".init");
try {
repositoryService.postInit(result);
LOGGER.info("Repository post initialization finished successfully.");
} catch (Exception ex) {
LoggingUtils.logUnexpectedException(LOGGER, "Repository post initialization failed", ex);
result.recordFatalError("Repository post initialization failed.", ex);
} finally {
result.computeStatus("Repository post initialization failed.");
}
}
}
4 changes: 4 additions & 0 deletions gui/admin-gui/src/main/webapp/WEB-INF/ctx-init.xml
Expand Up @@ -25,6 +25,10 @@
<bean name="infraInitialSetup" class="com.evolveum.midpoint.init.InfraInitialSetup" init-method="init">
</bean>

<bean id="repoInitialSetup" class="com.evolveum.midpoint.init.RepoInitialSetup" init-method="init">
<constructor-arg name="repositoryService" ref="repositoryService"/>
</bean>

<bean id="initialDataImport" class="com.evolveum.midpoint.init.InitialDataImport" init-method="init"
scope="singleton">
<property name="model" ref="modelController"/>
Expand Down
Expand Up @@ -37,7 +37,7 @@ public class ProfilingConfigurationManager {
private static final String APPENDER_IDM_PROFILE = "IDM-PROFILE_LOG";

/**
* In this method, we perform the check of systemConfiguration object, searching for any changes
* In this method, we perform the check of systemConfiguration object, searching for any data
* related to profilingConfiguration
* */
public static LoggingConfigurationType checkSystemProfilingConfiguration(PrismObject<SystemConfigurationType> systemConfigurationPrism){
Expand All @@ -48,9 +48,9 @@ public static LoggingConfigurationType checkSystemProfilingConfiguration(PrismOb
ProfilingConfigurationType profilingConfig = systemConfig.getProfilingConfiguration();
boolean isSubsystemConfig;

if(profilingConfig == null || !profilingConfig.isEnabled())
if (profilingConfig == null || !profilingConfig.isEnabled()) {
return systemConfig.getLogging();
else{
} else {
isSubsystemConfig = applySubsystemProfiling(systemConfig);
return applyProfilingConfiguration(systemConfigurationPrism, profilingConfig, isSubsystemConfig);
}
Expand All @@ -61,8 +61,8 @@ private static LoggingConfigurationType applyProfilingConfiguration(PrismObject<

LoggingConfigurationType loggingConfig = systemConfig.getLogging();

if(loggingConfig != null){
if(checkXsdBooleanValue(profilingConfig.isRequestFilter())){
if (loggingConfig != null) {
if (checkXsdBooleanValue(profilingConfig.isRequestFilter())) {
ClassLoggerConfigurationType requestFilterLogger = new ClassLoggerConfigurationType();
requestFilterLogger.setPackage(REQUEST_FILTER_LOGGER_CLASS_NAME);
requestFilterLogger.setLevel(LoggingLevelType.TRACE);
Expand All @@ -71,7 +71,7 @@ private static LoggingConfigurationType applyProfilingConfiguration(PrismObject<

loggingConfig.getClassLogger().add(requestFilterLogger);
}
if(subsystemProfiling){
if (subsystemProfiling) {
ClassLoggerConfigurationType subsystemLogger = new ClassLoggerConfigurationType();
subsystemLogger.setPackage(SUBSYSTEM_PROFILING_LOGGER);
subsystemLogger.setLevel(LoggingLevelType.DEBUG);
Expand All @@ -83,10 +83,10 @@ private static LoggingConfigurationType applyProfilingConfiguration(PrismObject<
}

LOGGER.info("Applying profiling configuration.");
return loggingConfig;
return loggingConfig;
}

private static boolean applySubsystemProfiling(SystemConfigurationType systemConfig){
private static boolean applySubsystemProfiling(SystemConfigurationType systemConfig) {
ProfilingConfigurationType profilingConfig = systemConfig.getProfilingConfiguration();

Map<ProfilingDataManager.Subsystem, Boolean> profiledSubsystems = new HashMap<>();
Expand Down
Expand Up @@ -34,9 +34,7 @@
@XmlType(name = "ObjectType", propOrder = {
})

public class ObjectType{


public class ObjectType {
public PrismObject asPrismObject(){
return null;
}
Expand Down

0 comments on commit 19fd556

Please sign in to comment.