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

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

parent ed7802ac
...@@ -69,8 +69,8 @@ public abstract class AbstractComponentConverter implements ComponentConverter { ...@@ -69,8 +69,8 @@ public abstract class AbstractComponentConverter implements ComponentConverter {
} else if (field.getType().isAssignableFrom(AsFormData.class)) { } else if (field.getType().isAssignableFrom(AsFormData.class)) {
// common type // common type
AsFormData data = asfData.getData(cmpId); AsFormData data = asfData.getData(cmpId);
if (data != null) {
AsFormData fieldAsFormData = new AsFormData(); AsFormData fieldAsFormData = new AsFormData();
if (data != null) {
fieldAsFormData.setId(cmpId); fieldAsFormData.setId(cmpId);
fieldAsFormData.setType(getType(annotation)); fieldAsFormData.setType(getType(annotation));
fieldAsFormData.setValue(data.getValue()); fieldAsFormData.setValue(data.getValue());
...@@ -82,9 +82,8 @@ public abstract class AbstractComponentConverter implements ComponentConverter { ...@@ -82,9 +82,8 @@ public abstract class AbstractComponentConverter implements ComponentConverter {
fieldAsFormData.setLabel(data.getLabel()); fieldAsFormData.setLabel(data.getLabel());
fieldAsFormData.setUsername(data.getUsername()); fieldAsFormData.setUsername(data.getUsername());
fieldAsFormData.setData(data.getData()); fieldAsFormData.setData(data.getData());
field.set(asFormObject, fieldAsFormData);
} }
field.set(asFormObject, fieldAsFormData);
} else { } else {
throw new UnsupportedFieldTypeException("This type unsupported"); throw new UnsupportedFieldTypeException("This type unsupported");
} }
......
...@@ -5,6 +5,7 @@ import org.codehaus.jackson.annotate.JsonIgnoreProperties; ...@@ -5,6 +5,7 @@ import org.codehaus.jackson.annotate.JsonIgnoreProperties;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Arrays; import java.util.Arrays;
import java.util.Collections;
import java.util.List; import java.util.List;
/** /**
...@@ -87,4 +88,8 @@ public class AdvancedSearchParams { ...@@ -87,4 +88,8 @@ public class AdvancedSearchParams {
public void setShowDeleted(boolean showDeleted) { public void setShowDeleted(boolean showDeleted) {
this.showDeleted = showDeleted; this.showDeleted = showDeleted;
} }
public void setDynParams(String... params) {
setDynParams(Collections.singletonList(Arrays.asList(params)));
}
} }
...@@ -51,6 +51,13 @@ public class AsFormData extends AsFormDataContainer { ...@@ -51,6 +51,13 @@ public class AsFormData extends AsFormDataContainer {
return value; return value;
} }
public String getValue(String defaultValue) {
if (value == null) {
return defaultValue;
}
return value;
}
public void setValue(String value) { public void setValue(String value) {
this.value = value; this.value = value;
} }
...@@ -59,6 +66,13 @@ public class AsFormData extends AsFormDataContainer { ...@@ -59,6 +66,13 @@ public class AsFormData extends AsFormDataContainer {
return key; return key;
} }
public String getKey(String defaultValue) {
if (key == null) {
return defaultValue;
}
return key;
}
public void setKey(String key) { public void setKey(String key) {
this.key = key; this.key = key;
} }
......
...@@ -39,6 +39,14 @@ public class AsFormDataContainer { ...@@ -39,6 +39,14 @@ public class AsFormDataContainer {
return null; 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) { public String getKey(String cmpId) {
AsFormData data = getData(cmpId); AsFormData data = getData(cmpId);
if (data != null) { if (data != null) {
...@@ -47,6 +55,14 @@ public class AsFormDataContainer { ...@@ -47,6 +55,14 @@ public class AsFormDataContainer {
return null; return null;
} }
public String getKey(String cmpId, String defaultKey) {
String key = getKey(cmpId);
if (key == null) {
return defaultKey;
}
return key;
}
public List<AsFormData> getData() { public List<AsFormData> getData() {
return data; return data;
} }
......
...@@ -58,4 +58,5 @@ public class AsFormWrapper extends AsFormDataContainer { ...@@ -58,4 +58,5 @@ public class AsFormWrapper extends AsFormDataContainer {
public void setVersion(String version) { public void setVersion(String version) {
this.version = 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