use of com.evolveum.midpoint.prism.PrismContainer in project midpoint by Evolveum.
the class PageReports method runReportPerformed.
protected void runReportPerformed(AjaxRequestTarget target, ReportType report) {
RunReportPopupPanel runReportPopupPanel = new RunReportPopupPanel(getMainPopupBodyId(), report) {
private static final long serialVersionUID = 1L;
protected void runConfirmPerformed(AjaxRequestTarget target, ReportType reportType, PrismContainer<ReportParameterType> reportParam) {
OperationResult result = new OperationResult(OPERATION_RUN_REPORT);
try {
Task task = createSimpleTask(OPERATION_RUN_REPORT);
getReportManager().runReport(reportType.asPrismObject(), reportParam, task, result);
} catch (Exception ex) {
result.recordFatalError(ex);
} finally {
result.computeStatusIfUnknown();
}
showResult(result);
target.add(getFeedbackPanel(), get(createComponentPath(ID_MAIN_FORM)));
hideMainPopup(target);
}
;
};
showMainPopup(runReportPopupPanel, target);
}
use of com.evolveum.midpoint.prism.PrismContainer in project midpoint by Evolveum.
the class ReportTypeUtil method applyDefinition.
public static void applyDefinition(PrismObject<ReportType> report, PrismContext prismContext) throws SchemaException {
PrismContainer<ReportConfigurationType> configuration = report.findContainer(ReportType.F_CONFIGURATION);
if (configuration == null) {
//nothing to apply definitions on
return;
}
PrismContainer xmlSchema = report.findContainer(ReportType.F_CONFIGURATION_SCHEMA);
Element xmlSchemaElement = ObjectTypeUtil.findXsdElement(xmlSchema);
if (xmlSchemaElement == null) {
//no schema definition available
throw new SchemaException("Couldn't find schema for configuration in report type " + report + ".");
}
PrismSchema schema = ReportTypeUtil.parseReportConfigurationSchema(report, prismContext);
PrismContainerDefinition<ReportConfigurationType> definition = ReportTypeUtil.findReportConfigurationDefinition(schema);
if (definition == null) {
//no definition found for container
throw new SchemaException("Couldn't find definitions for report type " + report + ".");
}
configuration.applyDefinition(definition, true);
}
use of com.evolveum.midpoint.prism.PrismContainer in project midpoint by Evolveum.
the class WebComponentUtil method getContainerValue.
public static <T> T getContainerValue(PrismContainerValue object, QName containerName, Class<T> type) {
if (object == null) {
return null;
}
PrismContainer container = object.findContainer(containerName);
if (container == null || container.isEmpty()) {
return null;
}
PrismContainerValue containerValue = container.getValue();
if (containerValue == null || containerValue.isEmpty()) {
return null;
}
return (T) containerValue.getValue();
}
use of com.evolveum.midpoint.prism.PrismContainer in project midpoint by Evolveum.
the class WebComponentUtil method isActivationEnabled.
public static boolean isActivationEnabled(PrismObject object) {
Validate.notNull(object);
// this
PrismContainer activation = object.findContainer(UserType.F_ACTIVATION);
// activation...
if (activation == null) {
return false;
}
ActivationStatusType status = (ActivationStatusType) activation.getPropertyRealValue(ActivationType.F_ADMINISTRATIVE_STATUS, ActivationStatusType.class);
if (status == null) {
return false;
}
// todo imrove with activation dates...
return ActivationStatusType.ENABLED.equals(status);
}
use of com.evolveum.midpoint.prism.PrismContainer in project midpoint by Evolveum.
the class ReportTypeUtil method parseReportConfigurationSchema.
public static PrismSchema parseReportConfigurationSchema(PrismObject<ReportType> report, PrismContext context) throws SchemaException {
PrismContainer xmlSchema = report.findContainer(ReportType.F_CONFIGURATION_SCHEMA);
Element xmlSchemaElement = ObjectTypeUtil.findXsdElement(xmlSchema);
if (xmlSchemaElement == null) {
//no schema definition available
return null;
}
return PrismSchemaImpl.parse(xmlSchemaElement, true, "schema for " + report, context);
}
Aggregations