Search in sources :

Example 1 with IFactoryCountryEnvLink

use of org.cerberus.crud.factory.IFactoryCountryEnvLink in project cerberus-source by cerberustesting.

the class UpdateCountryEnvParam method getCountryEnvironmentLinkFromParameter.

private List<CountryEnvLink> getCountryEnvironmentLinkFromParameter(HttpServletRequest request, ApplicationContext appContext, String system, String country, String environment, JSONArray json) throws JSONException {
    List<CountryEnvLink> ceiList = new ArrayList();
    IFactoryCountryEnvLink ceiFactory = appContext.getBean(IFactoryCountryEnvLink.class);
    for (int i = 0; i < json.length(); i++) {
        JSONObject tcsaJson = json.getJSONObject(i);
        boolean delete = tcsaJson.getBoolean("toDelete");
        String systemLink = tcsaJson.getString("systemLink");
        String countryLink = tcsaJson.getString("countryLink");
        String environmentLink = tcsaJson.getString("environmentLink");
        if (!delete) {
            CountryEnvLink cei = ceiFactory.create(system, country, environment, systemLink, countryLink, environmentLink);
            ceiList.add(cei);
        }
    }
    return ceiList;
}
Also used : CountryEnvLink(org.cerberus.crud.entity.CountryEnvLink) IFactoryCountryEnvLink(org.cerberus.crud.factory.IFactoryCountryEnvLink) JSONObject(org.json.JSONObject) ArrayList(java.util.ArrayList) IFactoryCountryEnvLink(org.cerberus.crud.factory.IFactoryCountryEnvLink)

Aggregations

ArrayList (java.util.ArrayList)1 CountryEnvLink (org.cerberus.crud.entity.CountryEnvLink)1 IFactoryCountryEnvLink (org.cerberus.crud.factory.IFactoryCountryEnvLink)1 JSONObject (org.json.JSONObject)1