Search in sources :

Example 1 with PolyStringTranslationType

use of com.evolveum.prism.xml.ns._public.types_3.PolyStringTranslationType in project midpoint by Evolveum.

the class ResourceSchemaHandlingPanel method getObjectTypeDisplayName.

private PolyStringType getObjectTypeDisplayName(ResourceObjectTypeDefinitionType resourceObjectTypeDefinitionType) {
    String displayName = resourceObjectTypeDefinitionType.getDisplayName();
    if (StringUtils.isNotBlank(displayName)) {
        return new PolyStringType(displayName);
    }
    PolyStringType polyStringType = new PolyStringType();
    PolyStringTranslationType translationType = new PolyStringTranslationType();
    translationType.setKey("feedbackMessagePanel.message.undefined");
    polyStringType.setTranslation(translationType);
    return polyStringType;
}
Also used : PolyStringType(com.evolveum.prism.xml.ns._public.types_3.PolyStringType) PolyStringTranslationType(com.evolveum.prism.xml.ns._public.types_3.PolyStringTranslationType)

Example 2 with PolyStringTranslationType

use of com.evolveum.prism.xml.ns._public.types_3.PolyStringTranslationType in project midpoint by Evolveum.

the class DefaultGuiConfigurationCompiler method createPolyStringType.

private PolyStringType createPolyStringType(String key) {
    PolyStringTranslationType translationType = new PolyStringTranslationType();
    translationType.setKey(key);
    PolyString polyString = new PolyString(null, null, translationType);
    return new PolyStringType(polyString);
}
Also used : PolyStringType(com.evolveum.prism.xml.ns._public.types_3.PolyStringType) PolyString(com.evolveum.midpoint.prism.polystring.PolyString) PolyStringTranslationType(com.evolveum.prism.xml.ns._public.types_3.PolyStringTranslationType)

Example 3 with PolyStringTranslationType

use of com.evolveum.prism.xml.ns._public.types_3.PolyStringTranslationType in project midpoint by Evolveum.

the class WebComponentUtil method createPolyFromOrigString.

@Contract("null, _ -> null; !null, _ -> !null")
public static PolyStringType createPolyFromOrigString(String str, String key) {
    if (str == null) {
        return null;
    }
    PolyStringType poly = new PolyStringType();
    poly.setOrig(str);
    if (StringUtils.isNotEmpty(key)) {
        PolyStringTranslationType translation = new PolyStringTranslationType();
        translation.setKey(key);
        poly.setTranslation(translation);
    }
    return poly;
}
Also used : PolyStringType(com.evolveum.prism.xml.ns._public.types_3.PolyStringType) PolyStringTranslationType(com.evolveum.prism.xml.ns._public.types_3.PolyStringTranslationType) Contract(org.jetbrains.annotations.Contract)

Example 4 with PolyStringTranslationType

use of com.evolveum.prism.xml.ns._public.types_3.PolyStringTranslationType in project midpoint by Evolveum.

the class SearchFactory method addSearchPropertyDef.

public static <C extends Containerable> void addSearchPropertyDef(PrismContainerDefinition<C> containerDef, ItemPath path, List<SearchItemDefinition> defs, String key) {
    PrismPropertyDefinition propDef = containerDef.findPropertyDefinition(path);
    if (propDef == null) {
        return;
    }
    SearchItemDefinition searchItem = new SearchItemDefinition(path, propDef, getAllowedValues(path));
    if (key != null) {
        PolyStringType displayName = new PolyStringType(propDef.getItemName().getLocalPart());
        PolyStringTranslationType translation = new PolyStringTranslationType();
        translation.setFallback(propDef.getItemName().getLocalPart());
        translation.setKey(key);
        displayName.setTranslation(translation);
        searchItem.setDisplayName(displayName);
    }
    defs.add(searchItem);
}
Also used : PolyStringType(com.evolveum.prism.xml.ns._public.types_3.PolyStringType) PolyStringTranslationType(com.evolveum.prism.xml.ns._public.types_3.PolyStringTranslationType)

Example 5 with PolyStringTranslationType

use of com.evolveum.prism.xml.ns._public.types_3.PolyStringTranslationType in project midpoint by Evolveum.

the class SearchBoxConfigurationHelper method setDisplay.

private void setDisplay(UserInterfaceFeatureType configuration, String orig, String labelKey, String helpKey) {
    if (configuration.getDisplay() == null) {
        DisplayType display = new DisplayType();
        configuration.setDisplay(display);
    }
    if (configuration.getDisplay().getLabel() == null) {
        DisplayType display = configuration.getDisplay();
        PolyStringType label = new PolyStringType(orig);
        PolyStringTranslationType translationLabel = new PolyStringTranslationType();
        translationLabel.setKey(labelKey);
        label.setTranslation(translationLabel);
        display.setLabel(label);
        configuration.setDisplay(display);
    }
    if (helpKey != null && configuration.getDisplay().getHelp() == null) {
        DisplayType display = configuration.getDisplay();
        PolyStringType help = new PolyStringType("");
        PolyStringTranslationType translationHelp = new PolyStringTranslationType();
        translationHelp.setKey(helpKey);
        help.setTranslation(translationHelp);
        display.setHelp(help);
        configuration.setDisplay(display);
    }
    if (configuration.getVisibility() == null) {
        configuration.setVisibility(UserInterfaceElementVisibilityType.AUTOMATIC);
    }
}
Also used : PolyStringType(com.evolveum.prism.xml.ns._public.types_3.PolyStringType) PolyStringTranslationType(com.evolveum.prism.xml.ns._public.types_3.PolyStringTranslationType)

Aggregations

PolyStringTranslationType (com.evolveum.prism.xml.ns._public.types_3.PolyStringTranslationType)19 PolyStringType (com.evolveum.prism.xml.ns._public.types_3.PolyStringType)16 StringLimitationResult (com.evolveum.midpoint.model.api.validator.StringLimitationResult)6 OperationResult (com.evolveum.midpoint.schema.result.OperationResult)6 LocalizableMessage (com.evolveum.midpoint.util.LocalizableMessage)5 PolyString (com.evolveum.midpoint.prism.polystring.PolyString)4 LocalizableMessageBuilder (com.evolveum.midpoint.util.LocalizableMessageBuilder)4 PrismObject (com.evolveum.midpoint.prism.PrismObject)2 ExpressionProfile (com.evolveum.midpoint.schema.expression.ExpressionProfile)2 LocalizableMessageListBuilder (com.evolveum.midpoint.util.LocalizableMessageListBuilder)2 SchemaException (com.evolveum.midpoint.util.exception.SchemaException)2 LimitationsType (com.evolveum.midpoint.xml.ns._public.common.common_3.LimitationsType)2 StringLimitType (com.evolveum.midpoint.xml.ns._public.common.common_3.StringLimitType)2 NotNull (org.jetbrains.annotations.NotNull)2 AutoCompleteTextPanel (com.evolveum.midpoint.gui.api.component.autocomplete.AutoCompleteTextPanel)1 StandardLoggerType (com.evolveum.midpoint.gui.impl.page.admin.configuration.component.StandardLoggerType)1 MutablePrismPropertyDefinition (com.evolveum.midpoint.prism.MutablePrismPropertyDefinition)1 PrimitiveType (com.evolveum.midpoint.prism.PrimitiveType)1 PrismContext (com.evolveum.midpoint.prism.PrismContext)1 PrismObjectDefinition (com.evolveum.midpoint.prism.PrismObjectDefinition)1