Search in sources :

Example 1 with FailedOperationTypeType

use of com.evolveum.midpoint.xml.ns._public.common.common_3.FailedOperationTypeType in project midpoint by Evolveum.

the class ResourceContentPanel method getResultLabel.

private String getResultLabel(IModel<SelectableBean<ShadowType>> model) {
    OperationResultType result = getResult(model);
    if (result == null) {
        return "";
    }
    StringBuilder b = new StringBuilder(createStringResource("FailedOperationTypeType." + getShadow(model).getFailedOperationType()).getObject());
    b.append(":");
    b.append(createStringResource("OperationResultStatusType." + result.getStatus()).getObject());
    return b.toString();
}
Also used : OperationResultType(com.evolveum.midpoint.xml.ns._public.common.common_3.OperationResultType)

Example 2 with FailedOperationTypeType

use of com.evolveum.midpoint.xml.ns._public.common.common_3.FailedOperationTypeType in project midpoint by Evolveum.

the class PageAccounts method initSearchForm.

private void initSearchForm(Form searchForm) {
    BasicSearchPanel<AccountDetailsSearchDto> basicSearch = new BasicSearchPanel<AccountDetailsSearchDto>(ID_SEARCH_BASIC) {

        @Override
        protected IModel<String> createSearchTextModel() {
            return new PropertyModel<>(searchModel, AccountDetailsSearchDto.F_SEARCH_TEXT);
        }

        @Override
        protected void searchPerformed(AjaxRequestTarget target) {
            PageAccounts.this.searchPerformed(target);
        }

        @Override
        protected void clearSearchPerformed(AjaxRequestTarget target) {
            PageAccounts.this.clearSearchPerformed(target);
        }
    };
    basicSearch.setOutputMarkupId(true);
    searchForm.add(basicSearch);
    DropDownChoice failedOperationType = new DropDownChoice<>(ID_SEARCH_FAILED_OPERATION_TYPE, new PropertyModel<FailedOperationTypeType>(searchModel, AccountDetailsSearchDto.F_FAILED_OPERATION_TYPE), WebComponentUtil.createReadonlyModelFromEnum(FailedOperationTypeType.class), new EnumChoiceRenderer<FailedOperationTypeType>(this));
    failedOperationType.add(new OnChangeAjaxBehavior() {

        @Override
        protected void onUpdate(AjaxRequestTarget target) {
            searchPerformed(target);
        }
    });
    failedOperationType.setOutputMarkupId(true);
    failedOperationType.setNullValid(true);
    searchForm.add(failedOperationType);
    DropDownChoice kind = new DropDownChoice<>(ID_SEARCH_KIND, new PropertyModel<ShadowKindType>(searchModel, AccountDetailsSearchDto.F_KIND), WebComponentUtil.createReadonlyModelFromEnum(ShadowKindType.class), new EnumChoiceRenderer<ShadowKindType>(this));
    kind.add(new OnChangeAjaxBehavior() {

        @Override
        protected void onUpdate(AjaxRequestTarget target) {
            searchPerformed(target);
        }
    });
    kind.setOutputMarkupId(true);
    kind.setNullValid(true);
    searchForm.add(kind);
    DropDownChoice intent = new DropDownChoice<>(ID_SEARCH_INTENT, new PropertyModel<String>(searchModel, AccountDetailsSearchDto.F_INTENT), createIntentChoices(), new StringChoiceRenderer(null));
    intent.setNullValid(true);
    intent.add(new OnChangeAjaxBehavior() {

        @Override
        protected void onUpdate(AjaxRequestTarget target) {
            searchPerformed(target);
        }
    });
    intent.setOutputMarkupId(true);
    searchForm.add(intent);
    AutoCompleteTextField<String> objectClass = new AutoCompleteTextField<String>(ID_SEARCH_OBJECT_CLASS, new PropertyModel<String>(searchModel, AccountDetailsSearchDto.F_OBJECT_CLASS)) {

        @Override
        protected Iterator<String> getChoices(String input) {
            if (Strings.isEmpty(input)) {
                List<String> emptyList = Collections.emptyList();
                return emptyList.iterator();
            }
            AccountDetailsSearchDto dto = searchModel.getObject();
            List<QName> accountObjectClassList = dto.getObjectClassList();
            List<String> choices = new ArrayList<>(AUTO_COMPLETE_LIST_SIZE);
            for (QName s : accountObjectClassList) {
                if (s.getLocalPart().toLowerCase().startsWith(input.toLowerCase())) {
                    choices.add(s.getLocalPart());
                    if (choices.size() == AUTO_COMPLETE_LIST_SIZE) {
                        break;
                    }
                }
            }
            return choices.iterator();
        }
    };
    objectClass.add(AttributeModifier.replace("placeholder", createStringResource("PageAccounts.accounts.objectClass")));
    objectClass.setOutputMarkupId(true);
    objectClass.add(createObjectClassValidator());
    objectClass.add(new SearchFormEnterBehavior(basicSearch.getSearchButton()));
    searchForm.add(objectClass);
}
Also used : AccountDetailsSearchDto(com.evolveum.midpoint.web.page.admin.configuration.dto.AccountDetailsSearchDto) SearchFormEnterBehavior(com.evolveum.midpoint.web.util.SearchFormEnterBehavior) QName(javax.xml.namespace.QName) PropertyModel(org.apache.wicket.model.PropertyModel) ArrayList(java.util.ArrayList) OnChangeAjaxBehavior(org.apache.wicket.ajax.form.OnChangeAjaxBehavior) AjaxRequestTarget(org.apache.wicket.ajax.AjaxRequestTarget) AutoCompleteTextField(org.apache.wicket.extensions.ajax.markup.html.autocomplete.AutoCompleteTextField) DropDownChoice(org.apache.wicket.markup.html.form.DropDownChoice) BasicSearchPanel(com.evolveum.midpoint.web.component.BasicSearchPanel) StringChoiceRenderer(com.evolveum.midpoint.web.component.input.StringChoiceRenderer) ShadowKindType(com.evolveum.midpoint.xml.ns._public.common.common_3.ShadowKindType) FailedOperationTypeType(com.evolveum.midpoint.xml.ns._public.common.common_3.FailedOperationTypeType)

Example 3 with FailedOperationTypeType

use of com.evolveum.midpoint.xml.ns._public.common.common_3.FailedOperationTypeType in project midpoint by Evolveum.

the class ShadowIntegrityCheckResultHandler method checkOrFixShadowActivationConsistency.

// adapted from ProvisioningUtil
public void checkOrFixShadowActivationConsistency(ShadowCheckResult checkResult, PrismObject<ShadowType> shadow, boolean fix) {
    if (shadow == null) {
        // just for sure
        return;
    }
    ActivationType activation = shadow.asObjectable().getActivation();
    if (activation == null) {
        return;
    }
    FailedOperationTypeType failedOperation = shadow.asObjectable().getFailedOperationType();
    if (failedOperation == FailedOperationTypeType.ADD) {
        // in this case it's ok to have activation present
        return;
    }
    checkOrFixActivationItem(checkResult, shadow, activation.asPrismContainerValue(), ActivationType.F_ADMINISTRATIVE_STATUS);
    checkOrFixActivationItem(checkResult, shadow, activation.asPrismContainerValue(), ActivationType.F_EFFECTIVE_STATUS);
    checkOrFixActivationItem(checkResult, shadow, activation.asPrismContainerValue(), ActivationType.F_VALID_FROM);
    checkOrFixActivationItem(checkResult, shadow, activation.asPrismContainerValue(), ActivationType.F_VALID_TO);
    checkOrFixActivationItem(checkResult, shadow, activation.asPrismContainerValue(), ActivationType.F_VALIDITY_STATUS);
    checkOrFixActivationItem(checkResult, shadow, activation.asPrismContainerValue(), ActivationType.F_VALIDITY_CHANGE_TIMESTAMP);
    checkOrFixActivationItem(checkResult, shadow, activation.asPrismContainerValue(), ActivationType.F_LOCKOUT_STATUS);
    checkOrFixActivationItem(checkResult, shadow, activation.asPrismContainerValue(), ActivationType.F_LOCKOUT_EXPIRATION_TIMESTAMP);
}
Also used : ActivationType(com.evolveum.midpoint.xml.ns._public.common.common_3.ActivationType) FailedOperationTypeType(com.evolveum.midpoint.xml.ns._public.common.common_3.FailedOperationTypeType)

Example 4 with FailedOperationTypeType

use of com.evolveum.midpoint.xml.ns._public.common.common_3.FailedOperationTypeType in project midpoint by Evolveum.

the class ProvisioningUtil method checkShadowActivationConsistency.

public static void checkShadowActivationConsistency(PrismObject<ShadowType> shadow) {
    if (shadow == null) {
        // just for sure
        return;
    }
    ActivationType activation = shadow.asObjectable().getActivation();
    if (activation == null) {
        return;
    }
    FailedOperationTypeType failedOperation = shadow.asObjectable().getFailedOperationType();
    if (failedOperation == FailedOperationTypeType.ADD) {
        // in this case it's ok to have activation present
        return;
    }
    if (activation.getAdministrativeStatus() != null || activation.getEffectiveStatus() != null || activation.getValidFrom() != null || activation.getValidTo() != null || activation.getValidityStatus() != null || activation.getLockoutStatus() != null || activation.getLockoutExpirationTimestamp() != null || activation.getValidityChangeTimestamp() != null) {
        String m = "Unexpected content in shadow.activation for " + ObjectTypeUtil.toShortString(shadow) + ": " + activation;
        LOGGER.warn("{}", m);
    //throw new IllegalStateException(m);		// use only for testing
    }
}
Also used : ActivationType(com.evolveum.midpoint.xml.ns._public.common.common_3.ActivationType) FailedOperationTypeType(com.evolveum.midpoint.xml.ns._public.common.common_3.FailedOperationTypeType)

Example 5 with FailedOperationTypeType

use of com.evolveum.midpoint.xml.ns._public.common.common_3.FailedOperationTypeType in project midpoint by Evolveum.

the class ConsistencyTest method checkPostponedAccountWithAttributes.

private ShadowType checkPostponedAccountWithAttributes(String accountOid, String uid, String givenName, String sn, String cn, FailedOperationTypeType failedOperation, boolean modify, Task task, OperationResult parentResult) throws Exception {
    ShadowType failedAccountType = checkPostponedAccountBasic(accountOid, failedOperation, modify, parentResult);
    // assertNull(ResourceObjectShadowUtil.getAttributesContainer(faieldAccount).getIdentifier().getRealValue());
    assertAttributes(failedAccountType, uid, givenName, sn, cn);
    return failedAccountType;
}
Also used : ShadowType(com.evolveum.midpoint.xml.ns._public.common.common_3.ShadowType)

Aggregations

FailedOperationTypeType (com.evolveum.midpoint.xml.ns._public.common.common_3.FailedOperationTypeType)4 AccountDetailsSearchDto (com.evolveum.midpoint.web.page.admin.configuration.dto.AccountDetailsSearchDto)2 ActivationType (com.evolveum.midpoint.xml.ns._public.common.common_3.ActivationType)2 ShadowKindType (com.evolveum.midpoint.xml.ns._public.common.common_3.ShadowKindType)2 ShadowType (com.evolveum.midpoint.xml.ns._public.common.common_3.ShadowType)2 QName (javax.xml.namespace.QName)2 PolyStringNormalizer (com.evolveum.midpoint.prism.polystring.PolyStringNormalizer)1 S_AtomicFilterEntry (com.evolveum.midpoint.prism.query.builder.S_AtomicFilterEntry)1 BasicSearchPanel (com.evolveum.midpoint.web.component.BasicSearchPanel)1 StringChoiceRenderer (com.evolveum.midpoint.web.component.input.StringChoiceRenderer)1 SearchFormEnterBehavior (com.evolveum.midpoint.web.util.SearchFormEnterBehavior)1 OperationResultType (com.evolveum.midpoint.xml.ns._public.common.common_3.OperationResultType)1 ArrayList (java.util.ArrayList)1 AjaxRequestTarget (org.apache.wicket.ajax.AjaxRequestTarget)1 OnChangeAjaxBehavior (org.apache.wicket.ajax.form.OnChangeAjaxBehavior)1 AutoCompleteTextField (org.apache.wicket.extensions.ajax.markup.html.autocomplete.AutoCompleteTextField)1 DropDownChoice (org.apache.wicket.markup.html.form.DropDownChoice)1 PropertyModel (org.apache.wicket.model.PropertyModel)1