use of com.twinsoft.convertigo.beans.mobile.components.MobileSmartSource in project convertigo by convertigo.
the class MobilePickerComposite method getSmartSourceString.
public String getSmartSourceString() {
try {
Filter filter = getFilter();
String projectName = currentMC.getProject().getName();
MobileSmartSource cmss = MobileSmartSource.valueOf(currentSource);
String input = cmss == null ? "" : cmss.getInput();
String path = getModelPath();
String searchPath = "root";
int index = path.indexOf(searchPath);
if (index != -1) {
path = path.substring(index + searchPath.length());
}
SourceModel model = MobileSmartSource.emptyModel(filter);
model.setCustom(t_custom.getText());
model.setPrefix(t_prefix.getText());
model.setSuffix(t_suffix.getText());
model.setUseCustom(b_custom.getSelection());
model.setSourceData(getModelData());
model.setPath(path);
JSONObject jsonModel = model.toJson();
// System.out.println(jsonModel.toString(1));
MobileSmartSource nmss = new MobileSmartSource(filter, projectName, input, jsonModel);
// System.out.println(nmss.toJsonString(1));
return nmss.toJsonString();
} catch (Exception e) {
return "";
}
}
Aggregations