Search in sources :

Example 51 with PolyStringType

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();
}
Also used : PolyStringType(com.evolveum.prism.xml.ns._public.types_3.PolyStringType) ObjectType(com.evolveum.midpoint.xml.ns._public.common.common_3.ObjectType) PrismObject(com.evolveum.midpoint.prism.PrismObject) ArrayList(java.util.ArrayList) OperationResult(com.evolveum.midpoint.schema.result.OperationResult) ReportOutputType(com.evolveum.midpoint.xml.ns._public.common.common_3.ReportOutputType) ObjectDelta(com.evolveum.midpoint.prism.delta.ObjectDelta)

Example 52 with PolyStringType

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()));
}
Also used : PolyStringType(com.evolveum.prism.xml.ns._public.types_3.PolyStringType)

Example 53 with PolyStringType

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);
}
Also used : PolyStringType(com.evolveum.prism.xml.ns._public.types_3.PolyStringType) FeedbackPanel(org.apache.wicket.markup.html.panel.FeedbackPanel) TextPanel(com.evolveum.midpoint.web.component.input.TextPanel) ContainerFeedbackMessageFilter(org.apache.wicket.feedback.ContainerFeedbackMessageFilter) VisibleEnableBehaviour(com.evolveum.midpoint.web.component.util.VisibleEnableBehaviour) WebMarkupContainer(org.apache.wicket.markup.html.WebMarkupContainer)

Example 54 with PolyStringType

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;
}
Also used : PolyStringType(com.evolveum.prism.xml.ns._public.types_3.PolyStringType) ObjectReferenceType(com.evolveum.midpoint.xml.ns._public.common.common_3.ObjectReferenceType)

Example 55 with PolyStringType

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;
}
Also used : PolyStringType(com.evolveum.prism.xml.ns._public.types_3.PolyStringType) AssignmentsPreviewDto(com.evolveum.midpoint.web.page.admin.users.component.AssignmentsPreviewDto)

Aggregations

PolyStringType (com.evolveum.prism.xml.ns._public.types_3.PolyStringType)94 OperationResult (com.evolveum.midpoint.schema.result.OperationResult)28 PolyString (com.evolveum.midpoint.prism.polystring.PolyString)26 Test (org.testng.annotations.Test)23 UserType (com.evolveum.midpoint.xml.ns._public.common.common_3.UserType)20 ObjectReferenceType (com.evolveum.midpoint.xml.ns._public.common.common_3.ObjectReferenceType)14 SchemaException (com.evolveum.midpoint.util.exception.SchemaException)12 AssignmentType (com.evolveum.midpoint.xml.ns._public.common.common_3.AssignmentType)12 QName (javax.xml.namespace.QName)11 Task (com.evolveum.midpoint.task.api.Task)10 ShadowType (com.evolveum.midpoint.xml.ns._public.common.common_3.ShadowType)10 File (java.io.File)10 PrismObject (com.evolveum.midpoint.prism.PrismObject)9 OrgType (com.evolveum.midpoint.xml.ns._public.common.common_3.OrgType)8 ItemPath (com.evolveum.midpoint.prism.path.ItemPath)7 ArrayList (java.util.ArrayList)7 ResourceType (com.evolveum.midpoint.xml.ns._public.common.common_3.ResourceType)5 AbstractInternalModelIntegrationTest (com.evolveum.midpoint.model.impl.AbstractInternalModelIntegrationTest)4 ObjectAlreadyExistsException (com.evolveum.midpoint.util.exception.ObjectAlreadyExistsException)4 ObjectNotFoundException (com.evolveum.midpoint.util.exception.ObjectNotFoundException)4