sk_SK
diff --git a/gui/admin-gui/src/main/resources/localization/Midpoint.properties b/gui/admin-gui/src/main/resources/localization/Midpoint.properties
index 748255fc0e7..048fecca6ae 100644
--- a/gui/admin-gui/src/main/resources/localization/Midpoint.properties
+++ b/gui/admin-gui/src/main/resources/localization/Midpoint.properties
@@ -2528,7 +2528,7 @@ SchemaHandlingStep.limitations.tooltip.maxOccurs=Maximum number of occurrences o
SchemaHandlingStep.limitations.tooltip.minOccurs=Minimum number of occurrences of the attribute. A value of zero means optional attribute, value of one means mandatory attribute. A value which is specified here overrides the value taken from resource schema.
SchemaHandlingStep.limitations.tooltip.other=TODO\: REMOVE THIS TOOLTIP
SchemaHandlingStep.limitations.tooltip.propertyAccess=The type of access which is allowed or denied.
-SchemaHandlingStep.mapping.tooltip.authoritative=Authoritative mappings both add are remove specified value. Non-authoritative mappings only add the value. E.g. if a role with an authoritative mapping is removed the value that the mapping implied is also removed. If a role with non-authoritative mapping is removed then the value remains.
+SchemaHandlingStep.mapping.tooltip.authoritative=Authoritative mappings both add and remove specified value. Non-authoritative mappings only add the value. E.g. if a role with an authoritative mapping is removed the value that the mapping implied is also removed. If a role with non-authoritative mapping is removed then the value remains.
SchemaHandlingStep.mapping.tooltip.channel=Limits application of this mapping only to specific channel. E.g. to changes coming from live sync, reconciliation or GUI. If the channel is listed then the mapping will be applied. If it is not then it will not be applied. If no channel is specified then no limitations apply and the mapping will be applied for all channels.
SchemaHandlingStep.mapping.tooltip.conditionLanguage=Programming language in which is the condition script written.
SchemaHandlingStep.mapping.tooltip.condition=The XML representation of mapping condition. This is the actual expression code that will be interpreted. Mapping sources are provided as input variables for the condition. If the condition returns true then the mapping will be applied. If it returns false then the mapping is ignored. Note that mappings that were true and that become false may result in removal of a value that was the result of the mapping while it was still true.
@@ -3001,7 +3001,7 @@ ChangePasswordPanel.enabled=Enabled
ChangePasswordPanel.legendMessage.selected= - Password will be changed
ChangePasswordPanel.legendMessage.propagated= - Automatic password propagation (based on policies defined in resources definitions)
ChangePasswordPanel.legendMessage.deselected= - Password will not be changed
-ChangePasswordPanel.helpInfo=This portion of the credentials dialog controls how the password change will be propagated to each individual system. The first line defines whether the password will be changes in the midPoint itself. Following lines represent each system for which the password can be changed. The password propagation is controlled by the icons:
- Password will be changed. Password for this system will be changed to the value specified in the password dialog above.
- Automatic password propagation. The password might be changed. Whether the password is changed or not depends on the policies set up by identity administrator. This usually means that the password will be changed if it makes sense for the current situation and settings. This is the reasonable default choice.)
- Password will not be changed for this system.
You can adjust the password propagation settings by clicking on the icons and thus fine-tune how the password change is propagated to each individual system.
+ChangePasswordPanel.helpInfo=This portion of the credentials dialog controls how the password change will be propagated to each individual system. The first line defines whether the password will be changes in the midPoint itself. Following lines represent each system for which the password can be changed. The password propagation is controlled by the icons:
- Password will be changed. Password for this system will be changed to the value specified in the password dialog above.
- Automatic password propagation. The password might be changed. Whether the password is changed or not depends on the policies set up by identity administrator. This usually means that the password will be changed if it makes sense for the current situation and settings. This is the reasonable default choice.
- Password will not be changed for this system.
You can adjust the password propagation settings by clicking on the icons and thus fine-tune how the password change is propagated to each individual system.
ChangePasswordPanel.helpPopupTitle=Password propagation help
PageBase.button.tooltip.clearSearch=Clear
mainForm.uploadTooLarge = Upload must be less than ${maxSize}.
@@ -3049,7 +3049,7 @@ operation.com.evolveum.midpoint.wf.impl.WfHook.invoke=Invoke (Workflow)
operation.com.evolveum.midpoint.model.impl.lens.ChangeExecutor.execute=Execute (Model)
operation.com.evolveum.midpoint.model.impl.lens.ChangeExecutor.execute.focus.UserType=Execute - user (Model)
operation.com.evolveum.midpoint.model.impl.lens.ChangeExecutor.executeDelta=Execute delta (Model)
-operation.com.evolveum.midpoint.task.api.Task.listSubtasksDeeply=List subtasts deeply (Task)
+operation.com.evolveum.midpoint.task.api.Task.listSubtasksDeeply=List subtasks deeply (Task)
operation.com.evolveum.midpoint.task.api.Task.listSubtasksRaw=List subtasks raw (Task)
operation.com.evolveum.midpoint.web.page.self.PageSelfCredentials.savePassword=Password is successfully changed
operation.com.evolveum.midpoint.web.page.self.PageRequestRole.save=Changes were successfully saved
@@ -3093,7 +3093,8 @@ SearchPanel.basic=Basic
ResourceContentResourcePanel.realSearch=(In fact) Searching by:
typedAssignablePanel.selectedOrgs=Orgs:
typedAssignablePanel.selectedResources=Resources:
-typedAssignablePanel.selectedRoles=Roles
+typedAssignablePanel.selectedRoles=Roles:
+typedAssignablePanel.selectedServices=Services:
SearchPanel.insertFilterXml=Insert filter xml (SearchFilterType)
autoRefreshPanel.refreshNow=Refresh now
autoRefreshPanel.resumeRefreshing=Resume refreshing
@@ -3131,3 +3132,6 @@ ExecuteChangesHandlerPanel.change=Change
ReportCreateHandlerPanel.downloadCreatedReport=Download created report
ReportCreateHandlerPanel.reportParameters=Report parameters
OperationResultPanel.showTask=(show task)
+PageResources.inlineMenuItem.test=Test
+PageRequestRole.title=Request a role
+
diff --git a/gui/admin-gui/src/main/resources/localization/Midpoint_en_US.properties b/gui/admin-gui/src/main/resources/localization/Midpoint_en_US.properties
index 6609fe1c66f..76fefa17760 100644
--- a/gui/admin-gui/src/main/resources/localization/Midpoint_en_US.properties
+++ b/gui/admin-gui/src/main/resources/localization/Midpoint_en_US.properties
@@ -101,7 +101,7 @@ AssignmentPreviewDialog.column.tenant=Tenant
AssignmentPreviewDialog.label=View direct & indirect assignments
AssignmentPreviewDialog.type.direct=Direct
AssignmentPreviewDialog.type.indirect=Indirect
-AssignmentTablePanel.menu.assign=Assign Resource Account
+AssignmentTablePanel.menu.assign=Assign
AssignmentTablePanel.menu.assignOrg=Assign Org.
AssignmentTablePanel.menu.assignRole=Assign Role
AssignmentTablePanel.menu.unassign=Unassign
diff --git a/infra/schema/src/main/java/com/evolveum/midpoint/schema/util/ResourceTypeUtil.java b/infra/schema/src/main/java/com/evolveum/midpoint/schema/util/ResourceTypeUtil.java
index 530862267d9..9be63fbbad8 100644
--- a/infra/schema/src/main/java/com/evolveum/midpoint/schema/util/ResourceTypeUtil.java
+++ b/infra/schema/src/main/java/com/evolveum/midpoint/schema/util/ResourceTypeUtil.java
@@ -520,6 +520,19 @@ public static boolean isForceLoadDependentShadow(ResourceObjectTypeDependencyTyp
public static boolean isDown(ResourceType resource){
return (resource.getOperationalState() != null && AvailabilityStatusType.DOWN == resource.getOperationalState().getLastAvailabilityStatus());
}
+
+ public static AvailabilityStatusType getLastAvailabilityStatus(ResourceType resource){
+ if (resource.getOperationalState() == null) {
+ return null;
+ }
+
+ if (resource.getOperationalState().getLastAvailabilityStatus() == null) {
+ return null;
+ }
+
+ return resource.getOperationalState().getLastAvailabilityStatus();
+
+ }
public static boolean isAvoidDuplicateValues(ResourceType resource) {
if (resource.getConsistency() == null) {
diff --git a/model/certification-impl/pom.xml b/model/certification-impl/pom.xml
index a12e19fb8af..23c5c5dbd81 100644
--- a/model/certification-impl/pom.xml
+++ b/model/certification-impl/pom.xml
@@ -99,10 +99,6 @@
org.springframework
spring-beans
-
- org.springframework.security
- spring-security-core
-
javax.annotation
javax.annotation-api
@@ -225,6 +221,15 @@
3.4-SNAPSHOT
test
+
+ org.springframework.security
+ spring-security-core
+
+ provided
+
junit
junit
diff --git a/model/notifications-impl/pom.xml b/model/notifications-impl/pom.xml
index b79ae175e5b..fb3f9ce44fd 100644
--- a/model/notifications-impl/pom.xml
+++ b/model/notifications-impl/pom.xml
@@ -136,11 +136,7 @@
javax.annotation
javax.annotation-api
-
- javax.xml.bind
- jaxb-api
-
-
+
org.testng
@@ -222,6 +218,12 @@
spring-test
test
+
+ javax.xml.bind
+ jaxb-api
+ test
+
+
diff --git a/model/report-impl/pom.xml b/model/report-impl/pom.xml
index b814e21173e..464396067a7 100644
--- a/model/report-impl/pom.xml
+++ b/model/report-impl/pom.xml
@@ -129,11 +129,6 @@
20060411
runtime
-
- org.hibernate
- hibernate-core
- compile
-
org.apache.cxf
diff --git a/model/report-impl/src/test/java/com/evolveum/midpoint/report/BasicReportTest.java b/model/report-impl/src/test/java/com/evolveum/midpoint/report/BasicReportTest.java
deleted file mode 100644
index 36ca073a2f8..00000000000
--- a/model/report-impl/src/test/java/com/evolveum/midpoint/report/BasicReportTest.java
+++ /dev/null
@@ -1,1516 +0,0 @@
-/*
- * Copyright (c) 2010-2014 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.report;
-
-import static com.evolveum.midpoint.test.IntegrationTestTools.display;
-import static org.testng.AssertJUnit.assertEquals;
-
-import java.io.BufferedReader;
-import java.io.File;
-import java.io.FileReader;
-import java.io.IOException;
-import java.io.InputStream;
-import java.sql.Timestamp;
-import java.util.ArrayList;
-import java.util.Calendar;
-import java.util.Collection;
-import java.util.Date;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import javax.xml.datatype.DatatypeFactory;
-import javax.xml.datatype.Duration;
-
-import net.sf.jasperreports.engine.JasperCompileManager;
-import net.sf.jasperreports.engine.JasperExportManager;
-import net.sf.jasperreports.engine.JasperFillManager;
-import net.sf.jasperreports.engine.JasperPrint;
-import net.sf.jasperreports.engine.JasperReport;
-import net.sf.jasperreports.engine.design.JasperDesign;
-import net.sf.jasperreports.engine.xml.JRXmlLoader;
-
-import org.apache.commons.codec.binary.Base64;
-import org.apache.commons.io.FileUtils;
-import org.apache.commons.lang.StringUtils;
-import org.hibernate.Session;
-import org.hibernate.SessionFactory;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.test.annotation.DirtiesContext;
-import org.springframework.test.context.ContextConfiguration;
-import org.testng.AssertJUnit;
-import org.testng.annotations.Test;
-import org.w3c.dom.Element;
-
-import com.evolveum.midpoint.audit.api.AuditEventType;
-import com.evolveum.midpoint.model.api.ModelService;
-import com.evolveum.midpoint.model.test.AbstractModelIntegrationTest;
-import com.evolveum.midpoint.prism.ItemDefinition;
-import com.evolveum.midpoint.prism.Objectable;
-import com.evolveum.midpoint.prism.PrismContainer;
-import com.evolveum.midpoint.prism.PrismContext;
-import com.evolveum.midpoint.prism.PrismObject;
-import com.evolveum.midpoint.prism.PrismObjectDefinition;
-import com.evolveum.midpoint.prism.delta.ObjectDelta;
-import com.evolveum.midpoint.prism.path.ItemPath;
-import com.evolveum.midpoint.prism.query.ObjectFilter;
-import com.evolveum.midpoint.prism.query.ObjectQuery;
-import com.evolveum.midpoint.prism.query.RefFilter;
-import com.evolveum.midpoint.prism.schema.SchemaRegistry;
-import com.evolveum.midpoint.prism.util.PrismAsserts;
-import com.evolveum.midpoint.prism.xml.XmlTypeConverter;
-import com.evolveum.midpoint.report.api.ReportManager;
-import com.evolveum.midpoint.report.impl.ReportCreateTaskHandler;
-import com.evolveum.midpoint.report.impl.ReportUtils;
-import com.evolveum.midpoint.schema.GetOperationOptions;
-import com.evolveum.midpoint.schema.SelectorOptions;
-import com.evolveum.midpoint.schema.result.OperationResult;
-import com.evolveum.midpoint.schema.util.MiscSchemaUtil;
-import com.evolveum.midpoint.task.api.Task;
-import com.evolveum.midpoint.test.util.TestUtil;
-import com.evolveum.midpoint.util.exception.CommunicationException;
-import com.evolveum.midpoint.util.exception.ConfigurationException;
-import com.evolveum.midpoint.util.exception.ObjectAlreadyExistsException;
-import com.evolveum.midpoint.util.exception.ObjectNotFoundException;
-import com.evolveum.midpoint.util.exception.SchemaException;
-import com.evolveum.midpoint.util.exception.SecurityViolationException;
-import com.evolveum.midpoint.util.logging.Trace;
-import com.evolveum.midpoint.util.logging.TraceManager;
-import com.evolveum.midpoint.xml.ns._public.common.common_3.ActivationType;
-import com.evolveum.midpoint.xml.ns._public.common.common_3.CleanupPolicyType;
-import com.evolveum.midpoint.xml.ns._public.common.common_3.ExportType;
-import com.evolveum.midpoint.xml.ns._public.common.common_3.MetadataType;
-import com.evolveum.midpoint.xml.ns._public.common.common_3.ObjectType;
-import com.evolveum.midpoint.xml.ns._public.common.common_3.OperationResultType;
-import com.evolveum.midpoint.xml.ns._public.common.common_3.OrientationType;
-import com.evolveum.midpoint.xml.ns._public.common.common_3.ReportFieldConfigurationType;
-import com.evolveum.midpoint.xml.ns._public.common.common_3.ReportOutputType;
-import com.evolveum.midpoint.xml.ns._public.common.common_3.ReportType;
-import com.evolveum.midpoint.xml.ns._public.common.common_3.RoleType;
-import com.evolveum.midpoint.xml.ns._public.common.common_3.SystemConfigurationType;
-import com.evolveum.midpoint.xml.ns._public.common.common_3.TaskType;
-import com.evolveum.midpoint.xml.ns._public.common.common_3.UserType;
-import com.evolveum.prism.xml.ns._public.query_3.OrderDirectionType;
-import com.evolveum.prism.xml.ns._public.types_3.ItemPathType;
-import com.evolveum.prism.xml.ns._public.types_3.PolyStringType;
-
-/**
- * @author garbika
- */
-@ContextConfiguration(locations = { "classpath:ctx-report-test-main.xml" })
-@DirtiesContext(classMode = DirtiesContext.ClassMode.AFTER_CLASS)
-public class BasicReportTest extends AbstractModelIntegrationTest {
-
- private static final String CLASS_NAME_WITH_DOT = BasicReportTest.class
- .getName() + ".";
- /*private static final String GET_REPORT = CLASS_NAME_WITH_DOT
- + "getReport";*/
- private static final String GET_REPORT_OUTPUT = CLASS_NAME_WITH_DOT
- + "getReportOutput";
- private static final String SEARCH_REPORT_OUTPUT = CLASS_NAME_WITH_DOT
- + "searchReportOutput";
- private static final String IMPORT_USERS = CLASS_NAME_WITH_DOT
- + "importUsers";
- private static final String CREATE_REPORT = CLASS_NAME_WITH_DOT
- + "test001CreateReport";
- private static final String CREATE_REPORT_FROM_FILE = CLASS_NAME_WITH_DOT
- + "test002CreateReportFromFile";
- private static final String COPY_REPORT_WITHOUT_DESIGN = CLASS_NAME_WITH_DOT
- + "test003CopyReportWithoutDesign";
- private static final String RUN_REPORT = CLASS_NAME_WITH_DOT
- + "test004RunReport";
- private static final String PARSE_OUTPUT_REPORT = CLASS_NAME_WITH_DOT
- + "test005ParseOutputReport";
- private static final String RUN_TASK = CLASS_NAME_WITH_DOT
- + "test006RunTask";
- private static final String COUNT_REPORT = CLASS_NAME_WITH_DOT
- + "test007CountReport";
- private static final String SEARCH_REPORT = CLASS_NAME_WITH_DOT
- + "test008SearchReport";
- private static final String MODIFY_REPORT = CLASS_NAME_WITH_DOT
- + "test009ModifyReport";
- private static final String DELETE_REPORT = CLASS_NAME_WITH_DOT
- + "test010DeleteReport";
- private static final String CLEANUP_REPORTS = CLASS_NAME_WITH_DOT
- + "test011CleanupReports";
- /*private static final String AUDIT_REPORT = CLASS_NAME_WITH_DOT
- + "test012AudtReportWithDeltas";*/
- private static final String CREATE_AUDITLOGS_REPORT_FROM_FILE = CLASS_NAME_WITH_DOT
- + "test013CreateAuditLogsReportFromFile";
- /*private static final String CREATE_AUDITLOGS_REPORT_WITH_DATASOURCE = CLASS_NAME_WITH_DOT
- + "test014CreateAuditLogsReportWithDatasource";*/
- private static final String CREATE_USERLIST_REPORT_FROM_FILE = CLASS_NAME_WITH_DOT
- + "test015CreateUserListReportFromFile";
- private static final String CREATE_RECONCILIATION_REPORT_FROM_FILE = CLASS_NAME_WITH_DOT
- + "test016CreateReconiciliationReportFromFile";
- private static final String GET_REPORT_DATA = CLASS_NAME_WITH_DOT
- + "test017GetReportData";
-
- private static final Trace LOGGER = TraceManager
- .getTrace(BasicReportTest.class);
-
-
- private static final String MIDPOINT_HOME = System.getProperty("midpoint.home");
-
- private static final File REPORTS_DIR = new File("src/test/resources/reports");
- private static final File STYLES_DIR = new File("src/test/resources/styles");
- private static final File COMMON_DIR = new File("src/test/resources/common");
-
- private static String EXPORT_DIR = MIDPOINT_HOME + "/export/";
-
- private static final File SYSTEM_CONFIGURATION_FILE = new File(COMMON_DIR + "/system-configuration.xml");
- private static final File ROLE_SUPERUSER_FILE = new File(COMMON_DIR + "/role-superuser.xml");
- private static final File USER_ADMINISTRATOR_FILE = new File(COMMON_DIR + "/user-administrator.xml");
- private static final File TASK_REPORT_FILE = new File(COMMON_DIR + "/task-report.xml");
- private static final File REPORTS_FOR_CLEANUP_FILE = new File(COMMON_DIR + "/report-outputs-for-cleanup.xml");
- private static final File TEST_REPORT_WITHOUT_DESIGN_FILE = new File(REPORTS_DIR + "/report-test-without-design.xml");
- private static final File TEST_REPORT_FILE = new File(REPORTS_DIR + "/report-test.xml");
- private static final File REPORT_DATASOURCE_TEST = new File(REPORTS_DIR + "/reportDataSourceTest.jrxml");
- private static final File STYLE_TEMPLATE_DEFAULT = new File(STYLES_DIR + "/midpoint_base_styles.jrtx");
- private static final File REPORT_AUDIT_TEST = new File(REPORTS_DIR + "/reportAuditLogs.jrxml");
- private static final File RECONCILIATION_REPORT_FILE = new File(REPORTS_DIR + "/reportReconciliation.xml");
- private static final File AUDITLOGS_REPORT_FILE = new File(REPORTS_DIR + "/reportAuditLogs.xml");
- //private static final File AUDITLOGS_WITH_DATASOURCE_REPORT_FILE = new File(REPORTS_DIR + "/reportAuditLogs-with-datasource.xml");
- private static final File USERLIST_REPORT_FILE = new File(REPORTS_DIR + "/reportUserList.xml");
- private static final File USERROLES_REPORT_FILE = new File(REPORTS_DIR + "/reportUserRoles.xml");
-
- private static final File CUSTOM_REPORT_FILE = new File(REPORTS_DIR + "/reportCustomDS.xml");
-
- private static final File USERACCOUNTS_REPORT_FILE = new File(REPORTS_DIR + "/reportUserAccounts.xml");
- private static final File USERORGS_REPORT_FILE = new File(REPORTS_DIR + "/reportUserOrgs.xml");
-
- private static final String REPORT_OID_001 = "00000000-3333-3333-0000-100000000001";
- private static final String REPORT_OID_002 = "00000000-3333-3333-0000-100000000002";
- private static final String TEST_REPORT_OID = "00000000-3333-3333-TEST-10000000000";
- private static final String TEST_WITHOUT_DESIGN_REPORT_OID = "00000000-3333-3333-TEST-20000000000";
- private static final String TASK_REPORT_OID = "00000000-3333-3333-TASK-10000000000";
- private static final String AUDITLOGS_REPORT_OID = "AUDITLOG-3333-3333-TEST-10000000000";
- private static final String RECONCILIATION_REPORT_OID = "RECONCIL-3333-3333-TEST-10000000000";
- private static final String USERLIST_REPORT_OID = "USERLIST-3333-3333-TEST-10000000000";
- //private static final String AUDITLOGS_DATASOURCE_REPORT_OID = "AUDITLOG-3333-3333-TEST-1DATASOURCE";
-
- @Autowired
- private PrismContext prismContext;
-
- @Autowired
- private ModelService modelService;
-
- @Autowired
- private ReportManager reportManager;
-
- @Autowired
- private ReportCreateTaskHandler reportHandler;
-
- @Autowired
- private SessionFactory sessionFactory;
-
- protected PrismObject userAdministrator;
-
- public BasicReportTest() {
- super();
- }
-
-
- @Override
- public void initSystem(Task initTask, OperationResult initResult)
- throws Exception {
-
- LOGGER.trace("initSystem");
- super.initSystem(initTask, initResult);
- modelService.postInit(initResult);
-
- OperationResult result = new OperationResult("System variables");
- // System Configuration
- try {
- repoAddObjectFromFile(SYSTEM_CONFIGURATION_FILE, SystemConfigurationType.class, result);
- } catch (ObjectAlreadyExistsException e) {
- LOGGER.trace("System configuration already exists in repository;");
- }
-
- // Users
- repoAddObjectFromFile(ROLE_SUPERUSER_FILE, RoleType.class, result);
- try {
- userAdministrator = repoAddObjectFromFile(USER_ADMINISTRATOR_FILE, UserType.class, result);
- } catch (ObjectAlreadyExistsException e) {
- LOGGER.trace("User administrator already exists in repository;");
- }
- login(userAdministrator);
-
- }
-
- protected Task createTask(String operationName) {
- Task task = taskManager.createTaskInstance(operationName);
- task.setOwner(userAdministrator);
- return task;
- }
- /*
- private PrismObject getReport(String reportOid) throws ObjectNotFoundException, SchemaException, SecurityViolationException, CommunicationException, ConfigurationException {
- Task task = taskManager.createTaskInstance(GET_REPORT);
- OperationResult result = task.getResult();
- PrismObject report = modelService.getObject(ReportType.class, reportOid, null, task, result);
- result.computeStatus();
- TestUtil.assertSuccess("getObject(Report) result not success", result);
- return report;
- }
- */
- private PrismObject getReportOutput(String reportOutputOid) throws ObjectNotFoundException, SchemaException, SecurityViolationException, CommunicationException, ConfigurationException {
- Task task = taskManager.createTaskInstance(GET_REPORT_OUTPUT);
- OperationResult result = task.getResult();
- PrismObject reportOutput = modelService.getObject(ReportOutputType.class, reportOutputOid, null, task, result);
- result.computeStatus();
- TestUtil.assertSuccess("getObject(ReportOutput) result not success", result);
- return reportOutput;
- }
-
- private List> searchReportOutput(String reportOid) throws ObjectNotFoundException, SchemaException, SecurityViolationException, CommunicationException, ConfigurationException {
- Task task = taskManager.createTaskInstance(SEARCH_REPORT_OUTPUT);
- OperationResult result = task.getResult();
- ObjectFilter filter = RefFilter.createReferenceEqual(ReportOutputType.F_REPORT_REF, ReportOutputType.class, prismContext, reportOid);
- ObjectQuery query = ObjectQuery.createObjectQuery(filter);
- List> reportOutputList = modelService.searchObjects(ReportOutputType.class, query, null, task, result);
- result.computeStatus();
- TestUtil.assertSuccess("getObject(Report) result not success", result);
- return reportOutputList;
- }
-
- private void importUsers(int from, int to) throws Exception {
- Task task = taskManager.createTaskInstance(IMPORT_USERS);
- OperationResult result = task.getResult();
- OperationResult subResult = null;
- for (int i=from; i<=to; i++)
- {
- UserType user = new UserType();
- prismContext.adopt(user);
- user.setName(new PolyStringType("User_" + Integer.toString(i)));
- ObjectDelta objectDelta = ObjectDelta.createAddDelta((PrismObject) user.asPrismObject());
- Collection> deltas = MiscSchemaUtil.createCollection(objectDelta);
- LOGGER.trace("insert user {}", user);
- subResult = result.createSubresult("User : " + user.getName().getOrig());
- modelService.executeChanges(deltas, null, task, subResult);
- subResult.computeStatus();
- TestUtil.assertSuccess("import user result not success", subResult);
- }
-
- Collection> options = SelectorOptions.createCollection(GetOperationOptions.createRaw());
- subResult = result.createSubresult("count users");
- int countUsers = modelService.countObjects(UserType.class, null, options, task, subResult);
- LOGGER.trace("count users {}: ", countUsers);
- assertEquals("Unexpected number of count users", to + 1, countUsers);
- result.computeStatus();
- }
-
- private Calendar create_2014_01_01_12_00_Calendar() {
- Calendar calendar = Calendar.getInstance();
- calendar.set(Calendar.YEAR, 2014);
- calendar.set(Calendar.MONTH, Calendar.JANUARY);
- calendar.set(Calendar.DAY_OF_MONTH, 1);
- calendar.set(Calendar.HOUR_OF_DAY, 12);
- calendar.set(Calendar.MINUTE, 0);
- calendar.set(Calendar.SECOND, 0);
- calendar.set(Calendar.MILLISECOND, 0);
-
- return calendar;
- }
-
- private Calendar create_2013_06_01_00_00_Calendar() {
- Calendar calendar = Calendar.getInstance();
- calendar.set(Calendar.YEAR, 2013);
- calendar.set(Calendar.MONTH, Calendar.JUNE);
- calendar.set(Calendar.DAY_OF_MONTH, 1);
- calendar.set(Calendar.HOUR_OF_DAY, 0);
- calendar.set(Calendar.MINUTE, 0);
- calendar.set(Calendar.SECOND, 0);
- calendar.set(Calendar.MILLISECOND, 0);
-
- return calendar;
- }
-
- private Calendar create_2013_07_01_00_00_Calendar() {
- Calendar calendar = Calendar.getInstance();
- calendar.set(Calendar.YEAR, 2013);
- calendar.set(Calendar.MONTH, Calendar.JULY);
- calendar.set(Calendar.DAY_OF_MONTH, 1);
- calendar.set(Calendar.HOUR_OF_DAY, 0);
- calendar.set(Calendar.MINUTE, 0);
- calendar.set(Calendar.SECOND, 0);
- calendar.set(Calendar.MILLISECOND, 0);
-
- return calendar;
- }
-
- private Calendar create_2013_08_01_00_00_Calendar() {
- Calendar calendar = Calendar.getInstance();
- calendar.set(Calendar.YEAR, 2013);
- calendar.set(Calendar.MONTH, Calendar.AUGUST);
- calendar.set(Calendar.DAY_OF_MONTH, 1);
- calendar.set(Calendar.HOUR_OF_DAY, 0);
- calendar.set(Calendar.MINUTE, 0);
- calendar.set(Calendar.SECOND, 0);
- calendar.set(Calendar.MILLISECOND, 0);
-
- return calendar;
- }
-
- private Duration createDuration(Calendar when, long now) throws Exception {
- long seconds = (now - when.getTimeInMillis()) / 1000;
- return DatatypeFactory.newInstance().newDuration("PT" + seconds + "S").negate();
- }
-
- private CleanupPolicyType createPolicy(Calendar when, long now) throws Exception {
- CleanupPolicyType policy = new CleanupPolicyType();
-
- Duration duration = createDuration(when, now);
- policy.setMaxAge(duration);
-
- return policy;
- }
-
-
- @Test
- public void test001CreateReport() throws Exception {
- // import vo for cycle cez usertype zrusit vsetky RTable
-
- final String TEST_NAME = "test001CreateReport";
- TestUtil.displayTestTile(this, TEST_NAME);
-
- ReportType reportType = new ReportType();
- prismContext.adopt(reportType);
-
- reportType.setOid(REPORT_OID_001);
-
- // description and name
- reportType.setName(new PolyStringType("Test report - Datasource1"));
- reportType.setDescription("TEST Report with DataSource parameter.");
-
- // file templates
- String template = FileUtils.readFileToString(REPORT_DATASOURCE_TEST, "UTF-8");
- LOGGER.info("tempalte: " + template);
- byte[] encodedTemplate = Base64.encodeBase64(template.getBytes());
- LOGGER.info("encoded tempalte: " + encodedTemplate);
- byte[] decoded = Base64.decodeBase64(encodedTemplate);
- LOGGER.info("decided: " + new String(decoded));
- assertEquals(template, new String(decoded));
-// ReportTemplateType reportTemplate = new ReportTemplateType();
-// reportTemplate.setAny(DOMUtil.parseDocument(template).getDocumentElement());
- reportType.setTemplate(encodedTemplate);
-
- String templateStyle = FileUtils.readFileToString(STYLE_TEMPLATE_DEFAULT, "UTF-8"); //readFile(STYLE_TEMPLATE_DEFAULT, StandardCharsets.UTF_8);
-// ReportTemplateStyleType reportTemplateStyle = new ReportTemplateStyleType();
-// reportTemplateStyle.setAny(DOMUtil.parseDocument(templateStyle).getDocumentElement());
- byte[] encodedTemplateStyle = Base64.encodeBase64(templateStyle.getBytes());
- reportType.setTemplateStyle(encodedTemplateStyle);
- LOGGER.info("tempalte style: " + templateStyle);
- LOGGER.info("encoded tempalte style: " + encodedTemplateStyle);
-/*
- String config_schema = FileUtils.readFileToString(REPORT_DATASOURCE_TEST, "UTF-8");
-
- ReportConfigurationType parameters = new ReportConfigurationType();
- parameters.getAny().add(arg0)
- reportType.setConfiguration(parameters);
-
- * reportType.s
- PrismContainer configuration = new PrismContainer(null);
- // object class
- reportType.setObjectClass(ObjectTypes.getObjectType(UserType.class)
- .getTypeQName());
-
- // object query
- ObjectPaging paging = ObjectPaging.createPaging(0, 10);
- ObjectQuery query = ObjectQuery.createObjectQuery(paging);
- QueryType queryType = QueryConvertor.createQueryType(query, prismContext);
- reportType.setQuery(queryType);
- // parameters
- List