new download branch
This commit is contained in:
@@ -21,20 +21,21 @@ import org.ksoap2.transport.HttpTransportSE;
|
||||
import org.xmlpull.v1.XmlPullParser;
|
||||
import org.xmlpull.v1.XmlPullParserFactory;
|
||||
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.StringReader;
|
||||
import java.net.MalformedURLException;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
|
||||
import cpm.com.gskmtorange.LoginActivity;
|
||||
import cpm.com.gskmtorange.R;
|
||||
import cpm.com.gskmtorange.constant.CommonString;
|
||||
import cpm.com.gskmtorange.xmlGetterSetter.BrandMasterGetterSetter;
|
||||
import cpm.com.gskmtorange.xmlGetterSetter.CategoryMasterGetterSetter;
|
||||
import cpm.com.gskmtorange.xmlGetterSetter.DisplayMasterGetterSetter;
|
||||
import cpm.com.gskmtorange.xmlGetterSetter.JourneyPlanGetterSetter;
|
||||
import cpm.com.gskmtorange.xmlGetterSetter.MAPPINGT2PGetterSetter;
|
||||
import cpm.com.gskmtorange.xmlGetterSetter.MappingStockGetterSetter;
|
||||
import cpm.com.gskmtorange.xmlGetterSetter.SkuMasterGetterSetter;
|
||||
import cpm.com.gskmtorange.xmlHandlers.TableBean;
|
||||
import cpm.com.gskmtorange.xmlGetterSetter.SubCategoryMasterGetterSetter;
|
||||
import cpm.com.gskmtorange.xmlGetterSetter.TableBean;
|
||||
import cpm.com.gskmtorange.xmlHandlers.XMLHandlers;
|
||||
|
||||
public class DownloadActivity extends AppCompatActivity {
|
||||
@@ -51,6 +52,11 @@ public class DownloadActivity extends AppCompatActivity {
|
||||
JourneyPlanGetterSetter jcpgettersetter;
|
||||
SkuMasterGetterSetter skumastergettersetter;
|
||||
BrandMasterGetterSetter brandMasterGetterSetter;
|
||||
SubCategoryMasterGetterSetter subCategoryMasterGetterSetter;
|
||||
CategoryMasterGetterSetter categoryMasterGetterSetter;
|
||||
DisplayMasterGetterSetter displayMasterGetterSetter;
|
||||
MappingStockGetterSetter mappingStockGetterSetter;
|
||||
MAPPINGT2PGetterSetter mappingt2PGetterSetter;
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
@@ -251,22 +257,22 @@ public class DownloadActivity extends AppCompatActivity {
|
||||
result = (Object) envelope.getResponse();
|
||||
|
||||
if(result.toString()!=null){
|
||||
/* xpp.setInput(new StringReader(result.toString()));
|
||||
xpp.setInput(new StringReader(result.toString()));
|
||||
xpp.next();
|
||||
eventType = xpp.getEventType();
|
||||
skumastergettersetter =XMLHandlers.storeListXML(xpp, eventType);
|
||||
if(skumastergettersetter.getSku_cd().size()>0){
|
||||
String skutable = skumastergettersetter.getSku_master_table();
|
||||
if(skutable!=null){
|
||||
subCategoryMasterGetterSetter =XMLHandlers.subCategoryMasterXMLHandler(xpp, eventType);
|
||||
if(subCategoryMasterGetterSetter.getSUB_CATEGORY_ID().size()>0){
|
||||
String categorytable = subCategoryMasterGetterSetter.getTable_SUB_CATEGORY_MASTER();
|
||||
if(categorytable!=null){
|
||||
resultHttp = CommonString.KEY_SUCCESS;
|
||||
TableBean.setSkumastertable(skutable);
|
||||
TableBean.setSubCategoryMaster(categorytable);
|
||||
}
|
||||
}else{
|
||||
return "SKU_MASTER";
|
||||
return "SUB_CATEGORY_MASTER";
|
||||
}
|
||||
|
||||
data.value = 20;
|
||||
data.name = "Store Data Download";*/
|
||||
data.name = "SUB_CATEGORY_MASTER Data Download";
|
||||
}
|
||||
|
||||
publishProgress(data);
|
||||
@@ -290,22 +296,139 @@ public class DownloadActivity extends AppCompatActivity {
|
||||
result = (Object) envelope.getResponse();
|
||||
|
||||
if(result.toString()!=null){
|
||||
/* xpp.setInput(new StringReader(result.toString()));
|
||||
xpp.setInput(new StringReader(result.toString()));
|
||||
xpp.next();
|
||||
eventType = xpp.getEventType();
|
||||
skumastergettersetter =XMLHandlers.storeListXML(xpp, eventType);
|
||||
if(skumastergettersetter.getSku_cd().size()>0){
|
||||
String skutable = skumastergettersetter.getSku_master_table();
|
||||
categoryMasterGetterSetter =XMLHandlers.categoryMasterXMLHandler(xpp, eventType);
|
||||
if(categoryMasterGetterSetter.getCATEGORY_ID().size()>0){
|
||||
String skutable = categoryMasterGetterSetter.getTable_CATEGORY_MASTER();
|
||||
if(skutable!=null){
|
||||
resultHttp = CommonString.KEY_SUCCESS;
|
||||
TableBean.setSkumastertable(skutable);
|
||||
TableBean.setCategoryMaster(skutable);
|
||||
}
|
||||
}else{
|
||||
return "SKU_MASTER";
|
||||
return "CATEGORY_MASTER";
|
||||
}
|
||||
|
||||
data.value = 20;
|
||||
data.name = "Store Data Download";*/
|
||||
data.name = "CATEGORY_MASTER Data Download";
|
||||
}
|
||||
|
||||
publishProgress(data);
|
||||
|
||||
// DISPLAY_MASTER
|
||||
request = new SoapObject(CommonString.NAMESPACE,
|
||||
CommonString.METHOD_NAME_UNIVERSAL_DOWNLOAD);
|
||||
|
||||
request.addProperty("UserName", userId);
|
||||
request.addProperty("Type", "DISPLAY_MASTER");
|
||||
request.addProperty("cultureid", culture_id);
|
||||
|
||||
envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
|
||||
envelope.dotNet = true;
|
||||
envelope.setOutputSoapObject(request);
|
||||
|
||||
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
||||
|
||||
androidHttpTransport.call(
|
||||
CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
||||
result = (Object) envelope.getResponse();
|
||||
|
||||
if(result.toString()!=null){
|
||||
xpp.setInput(new StringReader(result.toString()));
|
||||
xpp.next();
|
||||
eventType = xpp.getEventType();
|
||||
displayMasterGetterSetter =XMLHandlers.displayMasterXMLHandler(xpp, eventType);
|
||||
if(displayMasterGetterSetter.getDISPLAY_ID().size()>0){
|
||||
String display_table = displayMasterGetterSetter.getTable_DISPLAY_MASTER();
|
||||
if(display_table!=null){
|
||||
resultHttp = CommonString.KEY_SUCCESS;
|
||||
TableBean.setDisplayMaster(display_table);
|
||||
}
|
||||
}else{
|
||||
return "DISPLAY_MASTER";
|
||||
}
|
||||
|
||||
data.value = 20;
|
||||
data.name = "DISPLAY_MASTER Data Download";
|
||||
}
|
||||
|
||||
publishProgress(data);
|
||||
|
||||
// MAPPING_STOCK
|
||||
request = new SoapObject(CommonString.NAMESPACE,
|
||||
CommonString.METHOD_NAME_UNIVERSAL_DOWNLOAD);
|
||||
|
||||
request.addProperty("UserName", userId);
|
||||
request.addProperty("Type", "MAPPING_STOCK");
|
||||
request.addProperty("cultureid", culture_id);
|
||||
|
||||
envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
|
||||
envelope.dotNet = true;
|
||||
envelope.setOutputSoapObject(request);
|
||||
|
||||
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
||||
|
||||
androidHttpTransport.call(
|
||||
CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
||||
result = (Object) envelope.getResponse();
|
||||
|
||||
if(result.toString()!=null){
|
||||
xpp.setInput(new StringReader(result.toString()));
|
||||
xpp.next();
|
||||
eventType = xpp.getEventType();
|
||||
mappingStockGetterSetter =XMLHandlers.mappingStockXMLHandler(xpp, eventType);
|
||||
if(mappingStockGetterSetter.getSKU_ID().size()>0){
|
||||
String stocktable = mappingStockGetterSetter.getTable_MAPPING_STOCK();
|
||||
if(stocktable!=null){
|
||||
resultHttp = CommonString.KEY_SUCCESS;
|
||||
TableBean.setMappingStock(stocktable);
|
||||
}
|
||||
}else{
|
||||
return "MAPPING_STOCK";
|
||||
}
|
||||
|
||||
data.value = 20;
|
||||
data.name = "MAPPING_STOCK Data Download";
|
||||
}
|
||||
|
||||
publishProgress(data);
|
||||
|
||||
// MAPPING_T2P
|
||||
request = new SoapObject(CommonString.NAMESPACE,
|
||||
CommonString.METHOD_NAME_UNIVERSAL_DOWNLOAD);
|
||||
|
||||
request.addProperty("UserName", userId);
|
||||
request.addProperty("Type", "MAPPING_T2P");
|
||||
request.addProperty("cultureid", culture_id);
|
||||
|
||||
envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
|
||||
envelope.dotNet = true;
|
||||
envelope.setOutputSoapObject(request);
|
||||
|
||||
androidHttpTransport = new HttpTransportSE(CommonString.URL);
|
||||
|
||||
androidHttpTransport.call(
|
||||
CommonString.SOAP_ACTION_UNIVERSAL, envelope);
|
||||
result = (Object) envelope.getResponse();
|
||||
|
||||
if(result.toString()!=null){
|
||||
xpp.setInput(new StringReader(result.toString()));
|
||||
xpp.next();
|
||||
eventType = xpp.getEventType();
|
||||
mappingt2PGetterSetter =XMLHandlers.mappingT2pXMLHandler(xpp, eventType);
|
||||
if(mappingt2PGetterSetter.getSTORE_ID().size()>0){
|
||||
String t2ptable = mappingt2PGetterSetter.getTable_MAPPING_T2P();
|
||||
if(t2ptable!=null){
|
||||
resultHttp = CommonString.KEY_SUCCESS;
|
||||
TableBean.setMappingT2p(t2ptable);
|
||||
}
|
||||
}else{
|
||||
return "MAPPING_T2P";
|
||||
}
|
||||
|
||||
data.value = 20;
|
||||
data.name = "MAPPING_T2P Data Download";
|
||||
}
|
||||
|
||||
publishProgress(data);
|
||||
|
||||
+48
@@ -0,0 +1,48 @@
|
||||
package cpm.com.gskmtorange.xmlGetterSetter;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
/**
|
||||
* Created by yadavendras on 29-12-2016.
|
||||
*/
|
||||
|
||||
public class CategoryMasterGetterSetter {
|
||||
|
||||
String table_CATEGORY_MASTER;
|
||||
|
||||
ArrayList<String> CATEGORY_ID = new ArrayList<>();
|
||||
ArrayList<String> CATEGORY = new ArrayList<>();
|
||||
ArrayList<String> CATEGORY_SEQUENCE = new ArrayList<>();
|
||||
|
||||
public String getTable_CATEGORY_MASTER() {
|
||||
return table_CATEGORY_MASTER;
|
||||
}
|
||||
|
||||
public void setTable_CATEGORY_MASTER(String table_CATEGORY_MASTER) {
|
||||
this.table_CATEGORY_MASTER = table_CATEGORY_MASTER;
|
||||
}
|
||||
|
||||
public ArrayList<String> getCATEGORY_ID() {
|
||||
return CATEGORY_ID;
|
||||
}
|
||||
|
||||
public void setCATEGORY_ID(String CATEGORY_ID) {
|
||||
this.CATEGORY_ID.add(CATEGORY_ID);
|
||||
}
|
||||
|
||||
public ArrayList<String> getCATEGORY() {
|
||||
return CATEGORY;
|
||||
}
|
||||
|
||||
public void setCATEGORY(String CATEGORY) {
|
||||
this.CATEGORY.add(CATEGORY);
|
||||
}
|
||||
|
||||
public ArrayList<String> getCATEGORY_SEQUENCE() {
|
||||
return CATEGORY_SEQUENCE;
|
||||
}
|
||||
|
||||
public void setCATEGORY_SEQUENCE(String CATEGORY_SEQUENCE) {
|
||||
this.CATEGORY_SEQUENCE.add(CATEGORY_SEQUENCE);
|
||||
}
|
||||
}
|
||||
+48
@@ -0,0 +1,48 @@
|
||||
package cpm.com.gskmtorange.xmlGetterSetter;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
/**
|
||||
* Created by yadavendras on 29-12-2016.
|
||||
*/
|
||||
|
||||
public class DisplayMasterGetterSetter {
|
||||
|
||||
String table_DISPLAY_MASTER;
|
||||
|
||||
ArrayList<String> DISPLAY_ID = new ArrayList<>();
|
||||
ArrayList<String> DISPLAY = new ArrayList<>();
|
||||
ArrayList<String> IMAGE_URL = new ArrayList<>();
|
||||
|
||||
public String getTable_DISPLAY_MASTER() {
|
||||
return table_DISPLAY_MASTER;
|
||||
}
|
||||
|
||||
public void setTable_DISPLAY_MASTER(String table_DISPLAY_MASTER) {
|
||||
this.table_DISPLAY_MASTER = table_DISPLAY_MASTER;
|
||||
}
|
||||
|
||||
public ArrayList<String> getDISPLAY_ID() {
|
||||
return DISPLAY_ID;
|
||||
}
|
||||
|
||||
public void setDISPLAY_ID(String DISPLAY_ID) {
|
||||
this.DISPLAY_ID.add(DISPLAY_ID);
|
||||
}
|
||||
|
||||
public ArrayList<String> getDISPLAY() {
|
||||
return DISPLAY;
|
||||
}
|
||||
|
||||
public void setDISPLAY(String DISPLAY) {
|
||||
this.DISPLAY.add(DISPLAY);
|
||||
}
|
||||
|
||||
public ArrayList<String> getIMAGE_URL() {
|
||||
return IMAGE_URL;
|
||||
}
|
||||
|
||||
public void setIMAGE_URL(String IMAGE_URL) {
|
||||
this.IMAGE_URL.add(IMAGE_URL);
|
||||
}
|
||||
}
|
||||
+48
@@ -0,0 +1,48 @@
|
||||
package cpm.com.gskmtorange.xmlGetterSetter;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
/**
|
||||
* Created by yadavendras on 29-12-2016.
|
||||
*/
|
||||
|
||||
public class MAPPINGT2PGetterSetter {
|
||||
|
||||
String table_MAPPING_T2P;
|
||||
|
||||
ArrayList<String> STORE_ID = new ArrayList<>();
|
||||
ArrayList<String> BRAND_ID = new ArrayList<>();
|
||||
ArrayList<String> DISPLAY_ID = new ArrayList<>();
|
||||
|
||||
public String getTable_MAPPING_T2P() {
|
||||
return table_MAPPING_T2P;
|
||||
}
|
||||
|
||||
public void setTable_MAPPING_T2P(String table_MAPPING_T2P) {
|
||||
this.table_MAPPING_T2P = table_MAPPING_T2P;
|
||||
}
|
||||
|
||||
public ArrayList<String> getSTORE_ID() {
|
||||
return STORE_ID;
|
||||
}
|
||||
|
||||
public void setSTORE_ID(String STORE_ID) {
|
||||
this.STORE_ID.add(STORE_ID);
|
||||
}
|
||||
|
||||
public ArrayList<String> getBRAND_ID() {
|
||||
return BRAND_ID;
|
||||
}
|
||||
|
||||
public void setBRAND_ID(String BRAND_ID) {
|
||||
this.BRAND_ID.add(BRAND_ID);
|
||||
}
|
||||
|
||||
public ArrayList<String> getDISPLAY_ID() {
|
||||
return DISPLAY_ID;
|
||||
}
|
||||
|
||||
public void setDISPLAY_ID(String DISPLAY_ID) {
|
||||
this.DISPLAY_ID.add(DISPLAY_ID);
|
||||
}
|
||||
}
|
||||
+75
@@ -0,0 +1,75 @@
|
||||
package cpm.com.gskmtorange.xmlGetterSetter;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
/**
|
||||
* Created by yadavendras on 29-12-2016.
|
||||
*/
|
||||
|
||||
public class MappingStockGetterSetter {
|
||||
|
||||
String table_MAPPING_STOCK;
|
||||
|
||||
ArrayList<String> KEYACCOUNT_ID = new ArrayList<>();
|
||||
ArrayList<String> STORETYPE_ID = new ArrayList<>();
|
||||
ArrayList<String> CLASS_ID = new ArrayList<>();
|
||||
ArrayList<String> SKU_ID = new ArrayList<>();
|
||||
ArrayList<String> MUST_HAVE = new ArrayList<>();
|
||||
ArrayList<String> MBQ = new ArrayList<>();
|
||||
|
||||
public String getTable_MAPPING_STOCK() {
|
||||
return table_MAPPING_STOCK;
|
||||
}
|
||||
|
||||
public void setTable_MAPPING_STOCK(String table_MAPPING_STOCK) {
|
||||
this.table_MAPPING_STOCK = table_MAPPING_STOCK;
|
||||
}
|
||||
|
||||
public ArrayList<String> getKEYACCOUNT_ID() {
|
||||
return KEYACCOUNT_ID;
|
||||
}
|
||||
|
||||
public void setKEYACCOUNT_ID(String KEYACCOUNT_ID) {
|
||||
this.KEYACCOUNT_ID.add(KEYACCOUNT_ID);
|
||||
}
|
||||
|
||||
public ArrayList<String> getSTORETYPE_ID() {
|
||||
return STORETYPE_ID;
|
||||
}
|
||||
|
||||
public void setSTORETYPE_ID(String STORETYPE_ID) {
|
||||
this.STORETYPE_ID.add(STORETYPE_ID);
|
||||
}
|
||||
|
||||
public ArrayList<String> getCLASS_ID() {
|
||||
return CLASS_ID;
|
||||
}
|
||||
|
||||
public void setCLASS_ID(String CLASS_ID) {
|
||||
this.CLASS_ID.add(CLASS_ID);
|
||||
}
|
||||
|
||||
public ArrayList<String> getSKU_ID() {
|
||||
return SKU_ID;
|
||||
}
|
||||
|
||||
public void setSKU_ID(String SKU_ID) {
|
||||
this.SKU_ID.add(SKU_ID);
|
||||
}
|
||||
|
||||
public ArrayList<String> getMUST_HAVE() {
|
||||
return MUST_HAVE;
|
||||
}
|
||||
|
||||
public void setMUST_HAVE(String MUST_HAVE) {
|
||||
this.MUST_HAVE.add(MUST_HAVE);
|
||||
}
|
||||
|
||||
public ArrayList<String> getMBQ() {
|
||||
return MBQ;
|
||||
}
|
||||
|
||||
public void setMBQ(String MBQ) {
|
||||
this.MBQ.add(MBQ);
|
||||
}
|
||||
}
|
||||
+58
@@ -0,0 +1,58 @@
|
||||
package cpm.com.gskmtorange.xmlGetterSetter;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
/**
|
||||
* Created by yadavendras on 29-12-2016.
|
||||
*/
|
||||
|
||||
public class SubCategoryMasterGetterSetter {
|
||||
|
||||
String table_SUB_CATEGORY_MASTER;
|
||||
|
||||
ArrayList<String> SUB_CATEGORY_ID = new ArrayList<>();
|
||||
ArrayList<String> SUB_CATEGORY = new ArrayList<>();
|
||||
ArrayList<String> CATEGORY_ID = new ArrayList<>();
|
||||
ArrayList<String> SUB_CATEGORY_SEQUENCE = new ArrayList<>();
|
||||
|
||||
|
||||
public String getTable_SUB_CATEGORY_MASTER() {
|
||||
return table_SUB_CATEGORY_MASTER;
|
||||
}
|
||||
|
||||
public void setTable_SUB_CATEGORY_MASTER(String table_SUB_CATEGORY_MASTER) {
|
||||
this.table_SUB_CATEGORY_MASTER = table_SUB_CATEGORY_MASTER;
|
||||
}
|
||||
|
||||
public ArrayList<String> getSUB_CATEGORY_ID() {
|
||||
return SUB_CATEGORY_ID;
|
||||
}
|
||||
|
||||
public void setSUB_CATEGORY_ID(String SUB_CATEGORY_ID) {
|
||||
this.SUB_CATEGORY_ID.add(SUB_CATEGORY_ID);
|
||||
}
|
||||
|
||||
public ArrayList<String> getSUB_CATEGORY() {
|
||||
return SUB_CATEGORY;
|
||||
}
|
||||
|
||||
public void setSUB_CATEGORY(String SUB_CATEGORY) {
|
||||
this.SUB_CATEGORY.add(SUB_CATEGORY);
|
||||
}
|
||||
|
||||
public ArrayList<String> getCATEGORY_ID() {
|
||||
return CATEGORY_ID;
|
||||
}
|
||||
|
||||
public void setCATEGORY_ID(String CATEGORY_ID) {
|
||||
this.CATEGORY_ID.add(CATEGORY_ID);
|
||||
}
|
||||
|
||||
public ArrayList<String> getSUB_CATEGORY_SEQUENCE() {
|
||||
return SUB_CATEGORY_SEQUENCE;
|
||||
}
|
||||
|
||||
public void setSUB_CATEGORY_SEQUENCE(String SUB_CATEGORY_SEQUENCE) {
|
||||
this.SUB_CATEGORY_SEQUENCE.add(SUB_CATEGORY_SEQUENCE);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,81 @@
|
||||
package cpm.com.gskmtorange.xmlGetterSetter;
|
||||
|
||||
/**
|
||||
* Created by yadavendras on 28-12-2016.
|
||||
*/
|
||||
|
||||
public class TableBean {
|
||||
|
||||
public static String JOURNEY_PLAN;
|
||||
public static String SKU_MASTER;
|
||||
public static String BRAND_MASTER;
|
||||
public static String SUB_CATEGORY_MASTER;
|
||||
public static String CATEGORY_MASTER;
|
||||
public static String DISPLAY_MASTER;
|
||||
public static String MAPPING_STOCK;
|
||||
public static String MAPPING_T2P;
|
||||
|
||||
public static String getJourneyPlan() {
|
||||
return JOURNEY_PLAN;
|
||||
}
|
||||
|
||||
public static void setJourneyPlan(String journeyPlan) {
|
||||
JOURNEY_PLAN = journeyPlan;
|
||||
}
|
||||
|
||||
public static String getSkuMaster() {
|
||||
return SKU_MASTER;
|
||||
}
|
||||
|
||||
public static void setSkuMaster(String skuMaster) {
|
||||
SKU_MASTER = skuMaster;
|
||||
}
|
||||
|
||||
public static String getBrandMaster() {
|
||||
return BRAND_MASTER;
|
||||
}
|
||||
|
||||
public static void setBrandMaster(String brandMaster) {
|
||||
BRAND_MASTER = brandMaster;
|
||||
}
|
||||
|
||||
public static String getSubCategoryMaster() {
|
||||
return SUB_CATEGORY_MASTER;
|
||||
}
|
||||
|
||||
public static void setSubCategoryMaster(String subCategoryMaster) {
|
||||
SUB_CATEGORY_MASTER = subCategoryMaster;
|
||||
}
|
||||
|
||||
public static String getCategoryMaster() {
|
||||
return CATEGORY_MASTER;
|
||||
}
|
||||
|
||||
public static void setCategoryMaster(String categoryMaster) {
|
||||
CATEGORY_MASTER = categoryMaster;
|
||||
}
|
||||
|
||||
public static String getDisplayMaster() {
|
||||
return DISPLAY_MASTER;
|
||||
}
|
||||
|
||||
public static void setDisplayMaster(String displayMaster) {
|
||||
DISPLAY_MASTER = displayMaster;
|
||||
}
|
||||
|
||||
public static String getMappingStock() {
|
||||
return MAPPING_STOCK;
|
||||
}
|
||||
|
||||
public static void setMappingStock(String mappingStock) {
|
||||
MAPPING_STOCK = mappingStock;
|
||||
}
|
||||
|
||||
public static String getMappingT2p() {
|
||||
return MAPPING_T2P;
|
||||
}
|
||||
|
||||
public static void setMappingT2p(String mappingT2p) {
|
||||
MAPPING_T2P = mappingT2p;
|
||||
}
|
||||
}
|
||||
@@ -1,36 +0,0 @@
|
||||
package cpm.com.gskmtorange.xmlHandlers;
|
||||
|
||||
/**
|
||||
* Created by yadavendras on 28-12-2016.
|
||||
*/
|
||||
|
||||
public class TableBean {
|
||||
|
||||
public static String JOURNEY_PLAN;
|
||||
public static String SKU_MASTER;
|
||||
public static String BRAND_MASTER;
|
||||
|
||||
public static String getJourneyPlan() {
|
||||
return JOURNEY_PLAN;
|
||||
}
|
||||
|
||||
public static void setJourneyPlan(String journeyPlan) {
|
||||
JOURNEY_PLAN = journeyPlan;
|
||||
}
|
||||
|
||||
public static String getSkuMaster() {
|
||||
return SKU_MASTER;
|
||||
}
|
||||
|
||||
public static void setSkuMaster(String skuMaster) {
|
||||
SKU_MASTER = skuMaster;
|
||||
}
|
||||
|
||||
public static String getBrandMaster() {
|
||||
return BRAND_MASTER;
|
||||
}
|
||||
|
||||
public static void setBrandMaster(String brandMaster) {
|
||||
BRAND_MASTER = brandMaster;
|
||||
}
|
||||
}
|
||||
@@ -6,10 +6,15 @@ import org.xmlpull.v1.XmlPullParserException;
|
||||
import java.io.IOException;
|
||||
|
||||
import cpm.com.gskmtorange.xmlGetterSetter.BrandMasterGetterSetter;
|
||||
import cpm.com.gskmtorange.xmlGetterSetter.CategoryMasterGetterSetter;
|
||||
import cpm.com.gskmtorange.xmlGetterSetter.DisplayMasterGetterSetter;
|
||||
import cpm.com.gskmtorange.xmlGetterSetter.FailureGetterSetter;
|
||||
import cpm.com.gskmtorange.xmlGetterSetter.JourneyPlanGetterSetter;
|
||||
import cpm.com.gskmtorange.xmlGetterSetter.LoginGetterSetter;
|
||||
import cpm.com.gskmtorange.xmlGetterSetter.MAPPINGT2PGetterSetter;
|
||||
import cpm.com.gskmtorange.xmlGetterSetter.MappingStockGetterSetter;
|
||||
import cpm.com.gskmtorange.xmlGetterSetter.SkuMasterGetterSetter;
|
||||
import cpm.com.gskmtorange.xmlGetterSetter.SubCategoryMasterGetterSetter;
|
||||
|
||||
/**
|
||||
* Created by yadavendras on 21-12-2016.
|
||||
@@ -254,4 +259,182 @@ public class XMLHandlers {
|
||||
}
|
||||
return brand;
|
||||
}
|
||||
|
||||
// SUB_CATEGORY_MASTER XML HANDLER
|
||||
public static SubCategoryMasterGetterSetter subCategoryMasterXMLHandler(XmlPullParser xpp,
|
||||
int eventType) {
|
||||
SubCategoryMasterGetterSetter category = new SubCategoryMasterGetterSetter();
|
||||
|
||||
try {
|
||||
while (xpp.getEventType() != XmlPullParser.END_DOCUMENT) {
|
||||
if (xpp.getEventType() == XmlPullParser.START_TAG) {
|
||||
if (xpp.getName().equals("META_DATA")) {
|
||||
category.setTable_SUB_CATEGORY_MASTER(xpp.nextText());
|
||||
}
|
||||
if (xpp.getName().equals("SUB_CATEGORY_ID")) {
|
||||
category.setSUB_CATEGORY_ID(xpp.nextText());
|
||||
}
|
||||
if (xpp.getName().equals("SUB_CATEGORY")) {
|
||||
category.setSUB_CATEGORY(xpp.nextText());
|
||||
}
|
||||
if (xpp.getName().equals("CATEGORY_ID")) {
|
||||
category.setCATEGORY_ID(xpp.nextText());
|
||||
}
|
||||
if (xpp.getName().equals("SUB_CATEGORY_SEQUENCE")) {
|
||||
category.setSUB_CATEGORY_SEQUENCE(xpp.nextText());
|
||||
}
|
||||
|
||||
}
|
||||
xpp.next();
|
||||
}
|
||||
} catch (XmlPullParserException e) {
|
||||
|
||||
e.printStackTrace();
|
||||
} catch (IOException e) {
|
||||
|
||||
e.printStackTrace();
|
||||
}
|
||||
return category;
|
||||
}
|
||||
|
||||
// CATEGORY_MASTER XML HANDLER
|
||||
public static CategoryMasterGetterSetter categoryMasterXMLHandler(XmlPullParser xpp,
|
||||
int eventType) {
|
||||
CategoryMasterGetterSetter category = new CategoryMasterGetterSetter();
|
||||
|
||||
try {
|
||||
while (xpp.getEventType() != XmlPullParser.END_DOCUMENT) {
|
||||
if (xpp.getEventType() == XmlPullParser.START_TAG) {
|
||||
if (xpp.getName().equals("META_DATA")) {
|
||||
category.setTable_CATEGORY_MASTER(xpp.nextText());
|
||||
}
|
||||
if (xpp.getName().equals("CATEGORY_ID")) {
|
||||
category.setCATEGORY_ID(xpp.nextText());
|
||||
}
|
||||
if (xpp.getName().equals("CATEGORY")) {
|
||||
category.setCATEGORY(xpp.nextText());
|
||||
}
|
||||
if (xpp.getName().equals("CATEGORY_SEQUENCE")) {
|
||||
category.setCATEGORY_SEQUENCE(xpp.nextText());
|
||||
}
|
||||
}
|
||||
xpp.next();
|
||||
}
|
||||
} catch (XmlPullParserException e) {
|
||||
|
||||
e.printStackTrace();
|
||||
} catch (IOException e) {
|
||||
|
||||
e.printStackTrace();
|
||||
}
|
||||
return category;
|
||||
}
|
||||
|
||||
// DISPLAY_MASTER XML HANDLER
|
||||
public static DisplayMasterGetterSetter displayMasterXMLHandler(XmlPullParser xpp,
|
||||
int eventType) {
|
||||
DisplayMasterGetterSetter display = new DisplayMasterGetterSetter();
|
||||
|
||||
try {
|
||||
while (xpp.getEventType() != XmlPullParser.END_DOCUMENT) {
|
||||
if (xpp.getEventType() == XmlPullParser.START_TAG) {
|
||||
if (xpp.getName().equals("META_DATA")) {
|
||||
display.setTable_DISPLAY_MASTER(xpp.nextText());
|
||||
}
|
||||
if (xpp.getName().equals("DISPLAY_ID")) {
|
||||
display.setDISPLAY_ID(xpp.nextText());
|
||||
}
|
||||
if (xpp.getName().equals("DISPLAY")) {
|
||||
display.setDISPLAY(xpp.nextText());
|
||||
}
|
||||
if (xpp.getName().equals("IMAGE_URL")) {
|
||||
display.setIMAGE_URL(xpp.nextText());
|
||||
}
|
||||
}
|
||||
xpp.next();
|
||||
}
|
||||
} catch (XmlPullParserException e) {
|
||||
|
||||
e.printStackTrace();
|
||||
} catch (IOException e) {
|
||||
|
||||
e.printStackTrace();
|
||||
}
|
||||
return display;
|
||||
}
|
||||
|
||||
// MAPPING_STOCK XML HANDLER
|
||||
public static MappingStockGetterSetter mappingStockXMLHandler(XmlPullParser xpp,
|
||||
int eventType) {
|
||||
MappingStockGetterSetter stock = new MappingStockGetterSetter();
|
||||
|
||||
try {
|
||||
while (xpp.getEventType() != XmlPullParser.END_DOCUMENT) {
|
||||
if (xpp.getEventType() == XmlPullParser.START_TAG) {
|
||||
if (xpp.getName().equals("META_DATA")) {
|
||||
stock.setTable_MAPPING_STOCK(xpp.nextText());
|
||||
}
|
||||
if (xpp.getName().equals("KEYACCOUNT_ID")) {
|
||||
stock.setKEYACCOUNT_ID(xpp.nextText());
|
||||
}
|
||||
if (xpp.getName().equals("STORETYPE_ID")) {
|
||||
stock.setSTORETYPE_ID(xpp.nextText());
|
||||
}
|
||||
if (xpp.getName().equals("CLASS_ID")) {
|
||||
stock.setCLASS_ID(xpp.nextText());
|
||||
}
|
||||
if (xpp.getName().equals("SKU_ID")) {
|
||||
stock.setSKU_ID(xpp.nextText());
|
||||
}
|
||||
if (xpp.getName().equals("MUST_HAVE")) {
|
||||
stock.setMUST_HAVE(xpp.nextText());
|
||||
}
|
||||
if (xpp.getName().equals("MBQ")) {
|
||||
stock.setMBQ(xpp.nextText());
|
||||
}
|
||||
}
|
||||
xpp.next();
|
||||
}
|
||||
} catch (XmlPullParserException e) {
|
||||
|
||||
e.printStackTrace();
|
||||
} catch (IOException e) {
|
||||
|
||||
e.printStackTrace();
|
||||
}
|
||||
return stock;
|
||||
}
|
||||
|
||||
// MAPPING_STOCK XML HANDLER
|
||||
public static MAPPINGT2PGetterSetter mappingT2pXMLHandler(XmlPullParser xpp,
|
||||
int eventType) {
|
||||
MAPPINGT2PGetterSetter t2p = new MAPPINGT2PGetterSetter();
|
||||
|
||||
try {
|
||||
while (xpp.getEventType() != XmlPullParser.END_DOCUMENT) {
|
||||
if (xpp.getEventType() == XmlPullParser.START_TAG) {
|
||||
if (xpp.getName().equals("META_DATA")) {
|
||||
t2p.setTable_MAPPING_T2P(xpp.nextText());
|
||||
}
|
||||
if (xpp.getName().equals("STORE_ID")) {
|
||||
t2p.setSTORE_ID(xpp.nextText());
|
||||
}
|
||||
if (xpp.getName().equals("BRAND_ID")) {
|
||||
t2p.setBRAND_ID(xpp.nextText());
|
||||
}
|
||||
if (xpp.getName().equals("DISPLAY_ID")) {
|
||||
t2p.setDISPLAY_ID(xpp.nextText());
|
||||
}
|
||||
}
|
||||
xpp.next();
|
||||
}
|
||||
} catch (XmlPullParserException e) {
|
||||
|
||||
e.printStackTrace();
|
||||
} catch (IOException e) {
|
||||
|
||||
e.printStackTrace();
|
||||
}
|
||||
return t2p;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user