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();
}
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);
}
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);
}
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
}
}
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;
}
Aggregations