use of com.evolveum.prism.xml.ns._public.types_3.PolyStringType in project midpoint by Evolveum.
the class ReportCreateTaskHandler method saveReportOutputType.
private void saveReportOutputType(String filePath, ReportType reportType, Task task, OperationResult parentResult) throws Exception {
String fileName = FilenameUtils.getBaseName(filePath);
String reportOutputName = fileName + " - " + reportType.getExport().value();
ReportOutputType reportOutputType = new ReportOutputType();
prismContext.adopt(reportOutputType);
reportOutputType.setFilePath(filePath);
reportOutputType.setReportRef(MiscSchemaUtil.createObjectReference(reportType.getOid(), ReportType.COMPLEX_TYPE));
reportOutputType.setName(new PolyStringType(reportOutputName));
reportOutputType.setDescription(reportType.getDescription() + " - " + reportType.getExport().value());
reportOutputType.setExportType(reportType.getExport());
ObjectDelta<ReportOutputType> objectDelta = null;
Collection<ObjectDelta<? extends ObjectType>> deltas = new ArrayList<ObjectDelta<? extends ObjectType>>();
OperationResult subResult = null;
objectDelta = ObjectDelta.createAddDelta((PrismObject<ReportOutputType>) reportOutputType.asPrismObject());
deltas.add(objectDelta);
subResult = parentResult.createSubresult(ReportCreateTaskHandler.class.getName() + "createRepourtOutput");
modelService.executeChanges(deltas, null, task, subResult);
String outputOid = objectDelta.getOid();
LOGGER.debug("Created report output with OID {}", outputOid);
PrismProperty<String> outputOidProperty = prismContext.getSchemaRegistry().findPropertyDefinitionByElementName(ReportConstants.REPORT_OUTPUT_OID_PROPERTY_NAME).instantiate();
outputOidProperty.setRealValue(outputOid);
task.setExtensionPropertyImmediate(outputOidProperty, subResult);
subResult.computeStatus();
}
use of com.evolveum.prism.xml.ns._public.types_3.PolyStringType in project midpoint by Evolveum.
the class UcfUtil method addConnectorNames.
public static void addConnectorNames(ConnectorType connectorType, String frameworkPrefix, String bundle, String type, String version, ConnectorHostType hostType) {
StringBuilder connectorName = new StringBuilder();
connectorName.append(frameworkPrefix).append(" ");
connectorName.append(type);
connectorName.append(" v");
connectorName.append(version);
StringBuilder displayName = new StringBuilder(StringUtils.substringAfterLast(type, "."));
if (hostType != null) {
connectorName.append(" @");
connectorName.append(hostType.getName());
displayName.append(" @");
displayName.append(hostType.getName());
}
connectorType.setName(new PolyStringType(connectorName.toString()));
connectorType.setDisplayName(new PolyStringType(displayName.toString()));
}
use of com.evolveum.prism.xml.ns._public.types_3.PolyStringType in project midpoint by Evolveum.
the class PageSelfRegistration method initStaticFormLayout.
private void initStaticFormLayout(Form<?> mainForm) {
// feedback
FeedbackPanel feedback = new FeedbackPanel(ID_FEEDBACK, new ContainerFeedbackMessageFilter(PageSelfRegistration.this));
feedback.setOutputMarkupId(true);
mainForm.add(feedback);
WebMarkupContainer staticRegistrationForm = createMarkupContainer(ID_STATIC_FORM, new VisibleEnableBehaviour() {
private static final long serialVersionUID = 1L;
@Override
public boolean isVisible() {
return getSelfRegistrationConfiguration().getFormRef() == null;
}
}, mainForm);
TextPanel<String> firstName = new TextPanel<>(ID_FIRST_NAME, new PropertyModel<String>(userModel, UserType.F_GIVEN_NAME.getLocalPart() + ".orig") {
private static final long serialVersionUID = 1L;
@Override
public void setObject(String object) {
userModel.getObject().setGivenName(new PolyStringType(object));
}
});
initInputProperties(feedback, firstName);
staticRegistrationForm.add(firstName);
TextPanel<String> lastName = new TextPanel<>(ID_LAST_NAME, new PropertyModel<String>(userModel, UserType.F_FAMILY_NAME.getLocalPart() + ".orig") {
private static final long serialVersionUID = 1L;
@Override
public void setObject(String object) {
userModel.getObject().setFamilyName(new PolyStringType(object));
}
});
initInputProperties(feedback, lastName);
staticRegistrationForm.add(lastName);
TextPanel<String> email = new TextPanel<>(ID_EMAIL, new PropertyModel<String>(userModel, UserType.F_EMAIL_ADDRESS.getLocalPart()));
initInputProperties(feedback, email);
staticRegistrationForm.add(email);
createPasswordPanel(staticRegistrationForm);
}
use of com.evolveum.prism.xml.ns._public.types_3.PolyStringType in project midpoint by Evolveum.
the class ObjectPolicyDialogDto method preparePolicyConfig.
public ObjectPolicyConfigurationTypeDto preparePolicyConfig() {
ObjectPolicyConfigurationTypeDto newConfig = new ObjectPolicyConfigurationTypeDto();
newConfig.setConstraints(propertyConstraintsList);
newConfig.setType(type);
newConfig.setSubtype(subtype);
ObjectReferenceType ref = new ObjectReferenceType();
if (templateRef != null) {
ref.setOid(templateRef.getOid());
ref.setType(ObjectTemplateType.COMPLEX_TYPE);
ref.setTargetName(new PolyStringType(templateRef.getName()));
}
newConfig.setTemplateRef(ref);
return newConfig;
}
use of com.evolveum.prism.xml.ns._public.types_3.PolyStringType in project midpoint by Evolveum.
the class AssignmentEditorDto method setPrivilegeLimitationList.
public void setPrivilegeLimitationList(List<AssignmentsPreviewDto> privilegeLimitationList) {
if (newAssignment.getLimitTargetContent() == null) {
newAssignment.setLimitTargetContent(new AssignmentSelectorType());
}
List<ObjectReferenceType> referencesList = newAssignment.getLimitTargetContent().getTargetRef();
if (referencesList == null) {
referencesList = new ArrayList<>();
}
referencesList.clear();
for (AssignmentsPreviewDto previewDto : privilegeLimitationList) {
ObjectReferenceType ref = new ObjectReferenceType();
ref.setOid(previewDto.getTargetOid());
ref.setTargetName(new PolyStringType(previewDto.getTargetName()));
ref.setType(previewDto.getTargetType());
ref.setRelation(previewDto.getRelation());
referencesList.add(ref);
}
this.privilegeLimitationList = privilegeLimitationList;
}
Aggregations