Skip to content

Commit

Permalink
case name localization (mid-5916)
Browse files Browse the repository at this point in the history
  • Loading branch information
KaterynaHonchar committed Dec 1, 2019
1 parent 710ae38 commit 6c78d37
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 20 deletions.
Expand Up @@ -111,7 +111,14 @@ private String getDefaultValue() {
throw new RestartResponseException(PageError.class);
}

return getStringRealValue(property != null ? property.getRealValue() : null);
if (property == null || property.getRealValue() == null){
return "";
}
if (property.getRealValue() instanceof PolyString){
return serviceLocator.getLocalizationService().translate((PolyString)property.getRealValue(),
serviceLocator.getLocale(),true);
}
return ((Object) property.getRealValue()).toString();
}

private String getExpressionValue(ExpressionType expressionType, String contextDesc, Task task, OperationResult result) throws SchemaException, ExpressionEvaluationException, ObjectNotFoundException, CommunicationException, ConfigurationException, SecurityViolationException {
Expand Down Expand Up @@ -151,15 +158,4 @@ public void setObject(String object) {
@Override
public void detach() {
}

private <T> String getStringRealValue(T value) {
if (value == null) {
return "";
}
if (value instanceof PolyString) {
return ((PolyString) value).getOrig();
}

return value.toString();
}
}
Expand Up @@ -38,21 +38,13 @@
import com.evolveum.midpoint.xml.ns._public.common.common_3.*;
import org.apache.commons.collections.CollectionUtils;
import org.apache.wicket.ajax.AjaxRequestTarget;
import org.apache.wicket.extensions.markup.html.repeater.data.grid.ICellPopulator;
import org.apache.wicket.extensions.markup.html.repeater.data.sort.SortOrder;
import org.apache.wicket.extensions.markup.html.repeater.data.table.AbstractColumn;
import org.apache.wicket.extensions.markup.html.repeater.data.table.IColumn;
import org.apache.wicket.extensions.markup.html.repeater.data.table.PropertyColumn;
import org.apache.wicket.extensions.markup.html.repeater.data.table.export.AbstractExportableColumn;
import org.apache.wicket.extensions.markup.html.repeater.util.SortParam;
import org.apache.wicket.markup.html.basic.Label;
import org.apache.wicket.markup.repeater.Item;
import org.apache.wicket.model.IModel;
import org.apache.wicket.model.Model;
import org.apache.wicket.request.mapper.parameter.PageParameters;

import javax.xml.datatype.XMLGregorianCalendar;
import javax.xml.namespace.QName;
import java.util.*;

/**
Expand Down

0 comments on commit 6c78d37

Please sign in to comment.