Commit 9bdab9d6 authored by Raimbek Egemberdiev's avatar Raimbek Egemberdiev

рефакторинг, истребление вызовов на SynergyClientBean

parent ed7802ac
......@@ -69,8 +69,8 @@ public abstract class AbstractComponentConverter implements ComponentConverter {
} else if (field.getType().isAssignableFrom(AsFormData.class)) {
// common type
AsFormData data = asfData.getData(cmpId);
if (data != null) {
AsFormData fieldAsFormData = new AsFormData();
if (data != null) {
fieldAsFormData.setId(cmpId);
fieldAsFormData.setType(getType(annotation));
fieldAsFormData.setValue(data.getValue());
......@@ -82,9 +82,8 @@ public abstract class AbstractComponentConverter implements ComponentConverter {
fieldAsFormData.setLabel(data.getLabel());
fieldAsFormData.setUsername(data.getUsername());
fieldAsFormData.setData(data.getData());
field.set(asFormObject, fieldAsFormData);
}
field.set(asFormObject, fieldAsFormData);
} else {
throw new UnsupportedFieldTypeException("This type unsupported");
}
......
......@@ -5,6 +5,7 @@ import org.codehaus.jackson.annotate.JsonIgnoreProperties;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
/**
......@@ -87,4 +88,8 @@ public class AdvancedSearchParams {
public void setShowDeleted(boolean showDeleted) {
this.showDeleted = showDeleted;
}
public void setDynParams(String... params) {
setDynParams(Collections.singletonList(Arrays.asList(params)));
}
}
......@@ -51,6 +51,13 @@ public class AsFormData extends AsFormDataContainer {
return value;
}
public String getValue(String defaultValue) {
if (value == null) {
return defaultValue;
}
return value;
}
public void setValue(String value) {
this.value = value;
}
......@@ -59,6 +66,13 @@ public class AsFormData extends AsFormDataContainer {
return key;
}
public String getKey(String defaultValue) {
if (key == null) {
return defaultValue;
}
return key;
}
public void setKey(String key) {
this.key = key;
}
......
......@@ -39,6 +39,14 @@ public class AsFormDataContainer {
return null;
}
public String getValue(String cmpId, String defaultValue) {
String value = getValue(cmpId);
if (value == null) {
return defaultValue;
}
return value;
}
public String getKey(String cmpId) {
AsFormData data = getData(cmpId);
if (data != null) {
......@@ -47,6 +55,14 @@ public class AsFormDataContainer {
return null;
}
public String getKey(String cmpId, String defaultKey) {
String key = getKey(cmpId);
if (key == null) {
return defaultKey;
}
return key;
}
public List<AsFormData> getData() {
return data;
}
......
......@@ -58,4 +58,5 @@ public class AsFormWrapper extends AsFormDataContainer {
public void setVersion(String version) {
this.version = version;
}
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment