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