Subversion Repositories SmartDukaan

Rev

Rev 9461 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
9067 manish.sha 1
package in.shop2020.support.controllers;
2
 
9351 manish.sha 3
import java.io.IOException;
9067 manish.sha 4
import java.text.ParseException;
5
import java.text.SimpleDateFormat;
6
import java.util.ArrayList;
7
import java.util.Collection;
9284 manish.sha 8
import java.util.Collections;
9067 manish.sha 9
import java.util.Date;
10
import java.util.HashMap;
11
import java.util.List;
12
import java.util.Map;
13
 
14
import in.shop2020.googleadwords.AdwordsAdGroup;
15
import in.shop2020.googleadwords.AdwordsAdGroupAd;
16
import in.shop2020.googleadwords.AdwordsAdGroupStatus;
17
import in.shop2020.googleadwords.AdwordsAdKeyword;
18
import in.shop2020.googleadwords.AdwordsCampaign;
19
import in.shop2020.googleadwords.AdwordsCampaignStatus;
20
import in.shop2020.googleadwords.GoogleAdwordsService.Client;
21
import in.shop2020.googleadwords.GoogleAdwordsServiceException;
22
import in.shop2020.googleadwords.KeywordMatchType;
23
import in.shop2020.googleadwords.NetworkSettingType;
9230 manish.sha 24
import in.shop2020.model.v1.catalog.CatalogServiceException;
25
import in.shop2020.model.v1.catalog.Item;
26
import in.shop2020.model.v1.catalog.status;
9067 manish.sha 27
import in.shop2020.support.utils.ReportsUtils;
28
import in.shop2020.thrift.clients.AdwordsClient;
9230 manish.sha 29
import in.shop2020.thrift.clients.CatalogClient;
9351 manish.sha 30
import in.shop2020.thrift.clients.LogisticsClient;
9067 manish.sha 31
 
32
import javax.servlet.ServletContext;
33
import javax.servlet.http.HttpServletRequest;
34
import javax.servlet.http.HttpSession;
35
 
36
import org.apache.struts2.convention.annotation.InterceptorRef;
37
import org.apache.struts2.convention.annotation.InterceptorRefs;
38
import org.apache.struts2.convention.annotation.Result;
39
import org.apache.struts2.convention.annotation.Results;
40
import org.apache.struts2.interceptor.ServletRequestAware;
41
import org.apache.struts2.util.ServletContextAware;
42
import org.apache.thrift.TException;
43
import org.apache.thrift.transport.TTransportException;
44
import org.json.JSONObject;
45
import org.slf4j.Logger;
46
import org.slf4j.LoggerFactory;
47
 
9230 manish.sha 48
import adwords.axis.v201309.basicoperations.UpdateKeyword;
9067 manish.sha 49
import adwords.axis.v201309.basicoperations.AddAdGroups;
50
import adwords.axis.v201309.basicoperations.AddCampaigns;
51
import adwords.axis.v201309.basicoperations.AddKeywords;
52
import adwords.axis.v201309.basicoperations.AddTextAds;
9230 manish.sha 53
import adwords.axis.v201309.basicoperations.UpdateAdGroup;
54
import adwords.axis.v201309.basicoperations.UpdateCampaign;
9067 manish.sha 55
 
56
import com.opensymphony.xwork2.ActionSupport;
57
 
58
@InterceptorRefs({
59
    @InterceptorRef("defaultStack"),
60
    @InterceptorRef("login")
61
})
62
 
63
@Results({
64
    @Result(name="authfail", type="redirectAction", params = {"actionName" , "reports"}),
65
	@Result(name="redirect", type="redirectAction", location = "google-adwords",  params={"statusCode", "301"})
66
})
67
public class GoogleAdwordsController extends ActionSupport implements ServletRequestAware {
68
	/**
69
	 * 
70
	 */
71
	private static Logger logger = LoggerFactory.getLogger(GoogleAdwordsController.class);
72
	private static final long serialVersionUID = 5703456181320066690L;
73
	private HttpServletRequest request;
74
	private HttpSession session;
75
	private ServletContext context;
76
 
77
	private String errorMsg = "";
78
	private String successmsg = "";
79
	private String campaignId = "";
9230 manish.sha 80
	private String adgroupId = "";
81
	private String keywordId = "";
9067 manish.sha 82
	private JSONObject jsonData = null;
9230 manish.sha 83
	private JSONObject jsonCampaignData = null;
84
	private JSONObject jsonAdgroupData = null;
85
	private JSONObject jsonKeywordList = null;
86
	private JSONObject jsonKeywordData = null;
9435 manish.sha 87
	private JSONObject jsonCampaignList = null;
9230 manish.sha 88
 
9067 manish.sha 89
	private AdwordsCampaignStatus campStatus;
90
	private AdwordsAdGroupStatus adgrpStatus;
91
	private KeywordMatchType keywordMatchType1;
92
	private KeywordMatchType keywordMatchType2;
93
	private KeywordMatchType keywordMatchType3;
94
	private KeywordMatchType keywordMatchType4;
95
	private KeywordMatchType keywordMatchType5;
96
 
97
	private NetworkSettingType networkSettingType;
98
 
99
	private boolean googlesearchNetwork = false;
100
	private boolean displaynetwork = false;
101
	private boolean partnersearchNetwork = false;
102
	private int stocklinked = 0;
9461 manish.sha 103
	private int stocklinkedUpdate = 0;
9067 manish.sha 104
 
105
	private String adwordOpRadio;
106
	private String adwordAddRadio;
107
	private String campaignName;
108
	private String campaignStatus;
109
	private String startDate;
110
	private String endDate;
111
	private String campaignAmount;
112
	private String googleSearchNetwork;
113
	private String displayNetwork;
114
	private String partnerSearchNetwork;
115
	private String campaignList1;
116
	private String adgroupName;
117
	private String adgroupStatus;
118
	private String catalogItemId;
119
	private String bidAmount;
120
	private String stockLinked;
121
	private String campaignList2;
122
	private String adgroupList1;
123
	private String headline;
124
	private String description1;
125
	private String description2;
126
	private String url;
127
	private String displayUrl;
128
	private String campaignList3;
129
	private String adgroupList2;
130
	private String keyword1;
131
	private String keyword2;
132
	private String keyword3;
133
	private String keyword4;
134
	private String keyword5;
135
	private String bid1;
136
	private String bid2;
137
	private String bid3;
138
	private String bid4;
139
	private String bid5;
140
	private String matchType1;
141
	private String matchType2;
142
	private String matchType3;
143
	private String matchType4;
144
	private String matchType5;
9230 manish.sha 145
 
146
	private String adwordUpdateRadio;
147
	private String campaignListUpdate1;
148
	private String campaignNameUpdate;
149
	private String campaignStatusUpdate;
150
	private String campaignAmountUpdate;
151
	private String campaignListUpdate2;
152
	private String adgroupListUpdate1;
153
	private String adgroupNameUpdate;
154
	private String adgroupStatusUpdate;
155
	private String catalogItemIdUpdate;
156
	private String bidAmountUpdate;
9461 manish.sha 157
	private String stockLinkedUpdate;
9230 manish.sha 158
	private String campaignListUpdate3;
159
	private String adgroupListUpdate2;
160
	private String keywordListUpdate1;
161
	private String keywordUpdate;
162
	private String bidUpdate;
163
	private String matchTypeUpdate;
9435 manish.sha 164
 
9067 manish.sha 165
 
166
	public String index() {
167
		if(!ReportsUtils.canAccessReport((Long)session.getAttribute(ReportsUtils.ROLE), request.getServletPath()))
168
			return "authfail";
169
		checkForErrors();
170
		return "index";
171
	}
172
 
173
	public String create(){
174
		if(adwordOpRadio!=null && ("addOpRadio").equalsIgnoreCase(adwordOpRadio)){
175
			if(adwordAddRadio!=null && ("campaignRdo").equalsIgnoreCase(adwordAddRadio)){
176
				processCampaignStatus();
177
				SimpleDateFormat timestmapFormatForGoogle = new SimpleDateFormat("yyyyMMdd");
178
				String startdateStr = timestmapFormatForGoogle.format(new Date().getTime());
179
				String enddateStr = "20371230";
180
				if(startDate!=null && !startDate.isEmpty()){
181
					startdateStr = processedStartEndDate(startDate, timestmapFormatForGoogle);
182
				}
183
				if(endDate!=null && !endDate.isEmpty()){
184
					 enddateStr = processedStartEndDate(endDate, timestmapFormatForGoogle);
185
				}
186
				processNetworkSetting();
187
				Long budgetAmount = new Long(Long.parseLong(campaignAmount));
188
				boolean addCampaignResult = addAdwordsCampaign(campaignName, startdateStr, enddateStr, (long)(budgetAmount * Math.pow(10, 6)), campStatus.toString(), googlesearchNetwork, displaynetwork, partnersearchNetwork, networkSettingType);
189
				if(addCampaignResult){
190
					successmsg = "Adwords Campaign Added Successfully";
191
				}
192
			}
193
			if(adwordAddRadio!=null && ("adgroupRdo").equalsIgnoreCase(adwordAddRadio)){
194
				processAdGroupStatus();
195
				if(catalogItemId==null || ("").equalsIgnoreCase(catalogItemId)){
196
					catalogItemId="0";
197
				}
198
				processStockLinked();
199
				boolean addAdGroupResult = addAdwordsAdGroup(Long.parseLong(campaignList1), adgroupName, adgrpStatus.toString(), (long)(Double.parseDouble(bidAmount) * Math.pow(10, 6)), Long.parseLong(catalogItemId));
200
				if(addAdGroupResult){
201
					successmsg = "Adwords AdGroup Added Successfully";
202
				}
203
			}
204
			if(adwordAddRadio!=null && ("textAdRdo").equalsIgnoreCase(adwordAddRadio)){
205
				boolean addAdgroupAdResult = addAdwordsAdGroupAd();
206
				if(addAdgroupAdResult){
207
					successmsg = "Adwords AdGroup Text Ad Added Successfully";
208
				}
209
			}
210
			if(adwordAddRadio!=null && ("keywordRdo").equalsIgnoreCase(adwordAddRadio)){
211
				AdwordsAdGroup adgroup = getAdwordsAdgroup(Long.parseLong(adgroupList2));
212
				List<Map<String, String>> keywordDataList = new ArrayList<Map<String, String>>();
213
				if(keyword1 != null && !keyword1.isEmpty()){
214
					keywordMatchType1 = processAdKeywordMatchType(matchType1);
215
					if(bid1!=null && !bid1.isEmpty()){
216
						keywordDataList.add(getKeywordMap(keyword1,bid1,keywordMatchType1.toString()));
217
					}
218
					else{
219
						keywordDataList.add(getKeywordMap(keyword1,adgroup.getBidAmount()+"",keywordMatchType1.toString()));
220
					}
221
				}
222
				if(keyword2 != null && !keyword2.isEmpty()){
223
					keywordMatchType2 = processAdKeywordMatchType(matchType2);
224
					if(bid2!=null && !bid2.isEmpty()){
225
						keywordDataList.add(getKeywordMap(keyword2,bid2,keywordMatchType2.toString()));
226
					}
227
					else{
228
						keywordDataList.add(getKeywordMap(keyword2,adgroup.getBidAmount()+"",keywordMatchType2.toString()));
229
					}
230
				}
231
				if(keyword3 != null && !keyword3.isEmpty()){
232
					keywordMatchType3 = processAdKeywordMatchType(matchType3);
233
					if(bid3!=null && !bid3.isEmpty()){
234
						keywordDataList.add(getKeywordMap(keyword3,bid3,keywordMatchType3.toString()));
235
					}
236
					else{
237
						keywordDataList.add(getKeywordMap(keyword3,adgroup.getBidAmount()+"",keywordMatchType3.toString()));
238
					}
239
				}
240
				if(keyword4 != null && !keyword4.isEmpty()){
241
					keywordMatchType4 = processAdKeywordMatchType(matchType4);
242
					if(bid4!=null && !bid4.isEmpty()){
243
						keywordDataList.add(getKeywordMap(keyword4,bid4,keywordMatchType4.toString()));
244
					}
245
					else{
246
						keywordDataList.add(getKeywordMap(keyword4,adgroup.getBidAmount()+"",keywordMatchType4.toString()));
247
					}
248
				}
249
				if(keyword5 != null && !keyword5.isEmpty()){
250
					keywordMatchType5 = processAdKeywordMatchType(matchType5);
251
					if(bid5!=null && !bid5.isEmpty()){
252
						keywordDataList.add(getKeywordMap(keyword5,bid5,keywordMatchType5.toString()));
253
					}
254
					else{
255
						keywordDataList.add(getKeywordMap(keyword5,adgroup.getBidAmount()+"",keywordMatchType5.toString()));
256
					}
257
				}
258
				boolean addAdKeywordResult = addAdwordsAdKeyword(keywordDataList);
259
				if(addAdKeywordResult){
260
					successmsg = "Adwords AdGroup Ad Keyword Added Successfully";
261
				}
262
			}
263
		}
9230 manish.sha 264
		if(adwordOpRadio!=null && ("updateOpRadio").equalsIgnoreCase(adwordOpRadio)){
265
			if(adwordUpdateRadio!=null && ("campaignRdoUpdate").equalsIgnoreCase(adwordUpdateRadio)){
266
				boolean updateCamapaignResult = updateAdwordsCampaign();
267
				if(updateCamapaignResult){
268
					successmsg = "Adwords Campaign Updated Successfully";
269
				}
270
			}
271
			if(adwordUpdateRadio!=null && ("adgroupRdoUpdate").equalsIgnoreCase(adwordUpdateRadio)){
9461 manish.sha 272
				processStockLinkedUpdate();
9230 manish.sha 273
				boolean updateAdGroupResult = updateAdwordsAdGroup();
274
				if(updateAdGroupResult){
275
					successmsg = "Adwords AdGroup Updated Successfully";
276
				}
277
			}
278
			if(adwordUpdateRadio!=null && ("keywordRdoUpdate").equalsIgnoreCase(adwordUpdateRadio)){
279
				boolean updateKeywordResult = updateAdwordsAdKeyword();
280
				if(updateKeywordResult){
281
					successmsg = "Adwords AdKeyword Updated Successfully";
282
				}
283
			}
284
		}
9067 manish.sha 285
 
286
		return index();
287
	}
288
 
9435 manish.sha 289
	/*public String sendProductFeeds(){
9351 manish.sha 290
		//boolean sendFeedsResult = false;
291
		Product insertedProduct = null;
292
		if(cataLogItemId!=null && !("").equalsIgnoreCase(cataLogItemId)){
293
			List<Long> itemIdList = getEntityLogisticsEstimation(Long.parseLong(cataLogItemId));
294
			UserInformation userInformation = new UserInformation("8587366",
295
					"http://www.saholic.com",
296
					"adwords@shop2020.in", "adwords_shop2020");
297
			ContentFeedsHandler sample = new ContentFeedsHandler(userInformation,
298
					"https://content.googleapis.com/content/v1/");
299
			if(itemIdList!=null && itemIdList.size()>0){
300
				try {
301
					Item item = new CatalogClient().getClient().getItem(itemIdList.get(0));
302
					insertedProduct = sample.sendProductFeed(item);
303
				} catch (IOException e) {
304
					e.printStackTrace();
305
				} catch (TTransportException e) {
306
					e.printStackTrace();
307
				} catch (CatalogServiceException e) {
308
					e.printStackTrace();
309
				} catch (TException e) {
310
					e.printStackTrace();
311
				}
312
			}
313
			else{
314
				sentFeedResult = "Error: There is No Product avaliable for given Catalog Item Id.";
315
				return "output";
316
			}
317
		}
318
		if(insertedProduct!=null){
319
			if(insertedProduct.content!=null && insertedProduct.content.value.indexOf("Error:")>-1){
320
				sentFeedResult = insertedProduct.content.value;
321
				return "output";
322
			}
323
			sentFeedResult = "Product Feeds are sent Successfully and Product Details are Given Below:\nProduct Id- "
324
				+insertedProduct.externalId+" Product Title- "+insertedProduct.title;
325
			return "output";
326
		}
327
		else{
328
			sentFeedResult = "Some Error occured while sending feeds. Please contact concerned Team";
329
			return "output";
330
		}
9435 manish.sha 331
		if(sendFeedsResult){
9351 manish.sha 332
			successmsg = "Product Feeds are sent Successfully";
333
			return index();
334
		}
335
		else{
336
			errorMsg = "Some Error occured while sending feeds. Please contact concerned Team";
337
			return index();
9435 manish.sha 338
		}
339
	}*/
340
	/*
9351 manish.sha 341
	public List<Long> getEntityLogisticsEstimation(long productId){
342
    	List<Long> items=null; 
343
    	try {
344
    		LogisticsClient cl = new LogisticsClient();
345
            LogisticsService.Client client = cl.getClient();
346
            items = client.getEntityLogisticsEstimation(productId, "110001", DeliveryType.PREPAID );
347
        } catch (Exception e1) {
348
            System.out.println("Unable to get items by catalog item id"+e1.getMessage());
349
        }
350
        return items;
9435 manish.sha 351
    }*/
9351 manish.sha 352
 
9067 manish.sha 353
	public KeywordMatchType processAdKeywordMatchType(String value){
354
		return KeywordMatchType.findByValue(Integer.parseInt(value));
355
	}
356
 
357
	public AdwordsAdGroup getAdwordsAdgroup(long adgroupId){
358
		AdwordsAdGroup adgroup = new AdwordsAdGroup();
359
		try {
360
			adgroup = new AdwordsClient().getClient().getAdwordsAdGroupByAdGroupId(adgroupId);
361
		} catch (TTransportException e) {
362
			e.printStackTrace();
363
		} catch (GoogleAdwordsServiceException e) {
364
			e.printStackTrace();
365
		} catch (TException e) {
366
			e.printStackTrace();
367
		}
368
		return adgroup;
369
	}
370
 
371
	public Map<String, String> getKeywordMap(String keyword, String bid, String type){
372
		Map<String, String> keywordMap = new HashMap<String, String>();
373
		keywordMap.put("Text", keyword1);
374
		keywordMap.put("Type", type);
375
		double bidamount = Double.parseDouble(bid);
376
		bidamount = bidamount * Math.pow(10, 6);
377
		keywordMap.put("BidAmount", bidamount+"");
378
		return keywordMap;
379
	}
9435 manish.sha 380
 
9067 manish.sha 381
	public void processAdGroupStatus(){
382
		if(adgroupStatus!=null){
383
			if("1".equalsIgnoreCase(adgroupStatus)){
384
				adgrpStatus = AdwordsAdGroupStatus.ENABLED;
385
			}
386
			else if("2".equalsIgnoreCase(campaignStatus)){
387
				adgrpStatus = AdwordsAdGroupStatus.PAUSED;
388
			}
389
			else{
390
				campStatus = AdwordsCampaignStatus.DELETED;
391
			}
392
		}
393
	}
394
 
395
	public String processedStartEndDate(String dateString, SimpleDateFormat dateformat){
396
		SimpleDateFormat timestmapFormatRequest = new SimpleDateFormat("mm/dd/yyyy");
397
		String dateStr = "";
398
		try {
399
			Date date = timestmapFormatRequest.parse(dateString);
400
			dateStr = dateformat.format(date.getTime());
401
		} catch (ParseException e) {
402
			e.printStackTrace();
403
		}
404
		return dateStr;
405
	}
9435 manish.sha 406
 
9067 manish.sha 407
	public void processCampaignStatus(){
408
		if(campaignStatus!=null){
409
			if("1".equalsIgnoreCase(campaignStatus)){
410
				campStatus = AdwordsCampaignStatus.ACTIVE;
411
			}
412
			else if("2".equalsIgnoreCase(campaignStatus)){
413
				campStatus = AdwordsCampaignStatus.PAUSED;
414
			}
415
			else{
416
				campStatus = AdwordsCampaignStatus.DELETED;
417
			}
418
		}
419
	}
420
 
421
	public void processStockLinked(){
422
		if(stockLinked!=null && ("on").equalsIgnoreCase(stockLinked)){
423
			stocklinked = 1;
424
		}
425
	}
9461 manish.sha 426
 
427
	public void processStockLinkedUpdate(){
428
		if(stockLinkedUpdate!=null && ("on").equalsIgnoreCase(stockLinkedUpdate)){
429
			stocklinkedUpdate = 1;
430
		}
431
	}
432
 
9067 manish.sha 433
	public void processNetworkSetting(){
434
		if(googleSearchNetwork!=null && ("on").equalsIgnoreCase(googleSearchNetwork)){
435
			googlesearchNetwork = true;
436
		}
437
		if(displayNetwork!=null && ("on").equalsIgnoreCase(displayNetwork)){
438
			displaynetwork = true;
439
		}
440
		if(partnerSearchNetwork!=null && ("on").equalsIgnoreCase(partnerSearchNetwork)){
441
			partnersearchNetwork = true;
442
		}
443
 
444
		if(googlesearchNetwork && !displaynetwork && !partnersearchNetwork){
445
			networkSettingType = NetworkSettingType.GOOGLE_SEARCH_AND_SEARCH_NETWORK;
446
		}
447
		else if(googlesearchNetwork && displaynetwork && !partnersearchNetwork){
448
			networkSettingType = NetworkSettingType.SEARCH_AND_DISPLAY_NETWORK;
449
		}
450
		else if(googlesearchNetwork && !displaynetwork && partnersearchNetwork){
451
			networkSettingType = NetworkSettingType.SEARCH_AND_PARTNER_NETWORK;
452
		}
453
		else if(!googlesearchNetwork && displaynetwork && !partnersearchNetwork){
454
			networkSettingType = NetworkSettingType.DISPLAY_NETWORK;
455
		}
456
		else if(!googlesearchNetwork && displaynetwork && partnersearchNetwork){
457
			networkSettingType = NetworkSettingType.DISPLAY_AND_PARTNER_NETWORK;
458
		}
459
		else if(!googlesearchNetwork && !displaynetwork && partnersearchNetwork){
460
			networkSettingType = NetworkSettingType.GOOGLE_PARTNER_SEARCH_NETWORK;
461
		}
462
		else if(googlesearchNetwork && displaynetwork && partnersearchNetwork){
463
			networkSettingType = NetworkSettingType.ALL_AVALIABLE_SOURCES;
464
		}
465
 
466
	}
467
 
468
	public boolean addAdwordsCampaign(String name, String startDateStr, String endDateStr, 
469
			Long amount, String status, boolean googlesrchNtwrk, boolean displayntwrk, 
470
			boolean partnersrchNtwrk, NetworkSettingType networkType){
471
		Long campaignId = 0L;
472
		boolean retry = true;
473
		int attempt =0;
474
		while(retry && attempt<2){
475
			try{
476
				attempt = attempt+1;
477
				campaignId = AddCampaigns.runExample(name, status, startDateStr, endDateStr, amount, googlesrchNtwrk, displayntwrk, partnersrchNtwrk);
478
				retry = false;
479
				System.out.println("@@@@@ CampaignId...... "+campaignId);
480
			}
481
			catch (Exception e) {
482
				retry = true;
483
				logger.error("Error while requesting Google Adwords Campaign Service", e);
484
			}
485
		}
486
		if(campaignId==0L){
487
			addActionError("Error while processing Add Request for Google Campaign Service");
488
			return false;
489
		}
490
		try{
491
			SimpleDateFormat timestmapFormatForGoogle = new SimpleDateFormat("yyyymmdd");
492
			AdwordsCampaign campaign = new AdwordsCampaign();
493
			campaign.setCampaignId(campaignId);
494
			campaign.setName(name);
495
			campaign.setBudgetAmount(amount * Math.pow(10, -6));
496
			campaign.setNetworkType(networkType);
497
			campaign.setStartDate(timestmapFormatForGoogle.parse(startDateStr).getTime());
498
			campaign.setEndDate(timestmapFormatForGoogle.parse(endDateStr).getTime());
499
			campaign.setStatus(campStatus);
500
			new AdwordsClient().getClient().addAdwordsCampaign(campaign);
501
			return true;
502
		}
503
		catch(ParseException pe){
504
			addActionError("Unable to parse proper Data");
505
			logger.error("Error while parsing proper Data", pe);
506
		} catch (TTransportException e) {
9230 manish.sha 507
			addActionError("Unable to get Connection with Saholic Google Adowrds Services in addAdwordsCampaign Method");
508
			logger.error("Error while getting Connection with Saholic Google Adowrds Services in addAdwordsCampaign Method", e);
9067 manish.sha 509
		} catch (GoogleAdwordsServiceException e) {
9230 manish.sha 510
			addActionError("Unable to perform operations with Saholic Google Adowrds Services in addAdwordsCampaign Method");
511
			logger.error("Error while performing operations with Saholic Google Adowrds Services in addAdwordsCampaign Method", e);
9067 manish.sha 512
		} catch (TException e) {
9230 manish.sha 513
			addActionError("Unable to perform operations with Saholic Google Adowrds Services Client in addAdwordsCampaign Method");
514
			logger.error("Error while performing operations with Saholic Google Adowrds Services Client in addAdwordsCampaign Method", e);
9067 manish.sha 515
		}
516
 
517
		return false;
518
	}
519
 
520
	public boolean addAdwordsAdGroup(long campaignId, String name, String status, Long bidAmount, long catalogId){
521
		Long adGroupId = 0L;
522
		boolean retry = true;
523
		int attempt =0;
524
		while(retry && attempt < 2){
525
			try{
526
				attempt =attempt +1;
527
				adGroupId = AddAdGroups.runExample(campaignId, name, status, bidAmount);
528
				retry = false;
529
			}
530
			catch (Exception e) {
531
				retry = true;
532
				logger.error("Error while requesting Google Adwords AdGroup Service", e);
533
			}
534
		}
535
		if(adGroupId == 0L){
536
			addActionError("Error while processing Add Request for Google AdGroup Service");
537
			return false;
538
		}
539
		try{
540
			AdwordsAdGroup adgroup = new AdwordsAdGroup();
541
			adgroup.setAdgroupId(adGroupId);
542
			adgroup.setCampaignId(campaignId);
543
			adgroup.setCatalogItemId(catalogId);
544
			adgroup.setStatus(adgrpStatus);
545
			adgroup.setName(name);
546
			adgroup.setBidAmount(bidAmount * Math.pow(10, -6));
547
			adgroup.setStockLinked(stocklinked);
548
			new AdwordsClient().getClient().addAdwordsAdGroup(adgroup);
549
			return true;
550
		}
551
		catch (TTransportException e) {
9230 manish.sha 552
			addActionError("Unable to get Connection with Saholic Google Adowrds Services in addAdwordsAdGroup Method");
553
			logger.error("Error while getting Connection with Saholic Google Adowrds Services in addAdwordsAdGroup Method", e);
9067 manish.sha 554
		} catch (GoogleAdwordsServiceException e) {
9230 manish.sha 555
			addActionError("Unable to perform operations with Saholic Google Adowrds Services in addAdwordsAdGroup Method");
556
			logger.error("Error while performing operations with Saholic Google Adowrds Services in addAdwordsAdGroup Method", e);
9067 manish.sha 557
		} catch (TException e) {
9230 manish.sha 558
			addActionError("Unable to perform operations with Saholic Google Adowrds Services Client in addAdwordsAdGroup Method");
559
			logger.error("Error while performing operations with Saholic Google Adowrds Services Client in addAdwordsAdGroup Method", e);
9067 manish.sha 560
		}
561
		return false;
562
	}
563
 
564
	public boolean addAdwordsAdGroupAd(){
565
		Long adGroupAdId = 0L;
566
		int attempt =0;
567
		boolean retry = true;
9230 manish.sha 568
		if(description1.contains("#price")){
569
			description1 = description1.replace("#price", "Rs"+getTextAdItemPrice()+"#");
570
		}
571
		if(description1.length()>35){
572
			addActionError("Description1 length is greater than 35. Final String is given as.... "+description1);
573
			return false;
574
		}
9067 manish.sha 575
		while(retry && attempt<2){
576
			try{
577
				attempt = attempt+1;
578
				adGroupAdId = AddTextAds.runExample(Long.parseLong(adgroupList1), headline, description1, description2, url, displayUrl);
579
				retry = false;
580
			}
581
			catch (Exception e) {
582
				retry = true;
583
				logger.error("Error while requesting Google Adwords AdGroupAd Service", e);
584
			}
585
		}
586
		if(adGroupAdId == 0L){
587
			addActionError("Error while processing Add Request for Google AdGroupAd Service");
588
			return false;
589
		}
590
		try{
591
			AdwordsAdGroupAd adgroupad = new AdwordsAdGroupAd();
592
			adgroupad.setAdgroupadId(adGroupAdId);
593
			adgroupad.setCampaignId(Long.parseLong(campaignList2));
594
			adgroupad.setAdgroupId(Long.parseLong(adgroupList1));
595
			adgroupad.setDescription1(description1);
596
			adgroupad.setDescription2(description2);
597
			adgroupad.setHeadline(headline);
598
			adgroupad.setDisplayUrl(displayUrl);
599
			adgroupad.setUrl(url);
600
			new AdwordsClient().getClient().addAdwordsAdGroupAd(adgroupad);
601
			return true;
602
		}
603
		catch (TTransportException e) {
9230 manish.sha 604
			addActionError("Unable to get Connection with Saholic Google Adowrds Services in addAdwordsAdGroupAd Method");
605
			logger.error("Error while getting Connection with Saholic Google Adowrds Services in addAdwordsAdGroupAd Method", e);
9067 manish.sha 606
		} catch (GoogleAdwordsServiceException e) {
9230 manish.sha 607
			addActionError("Unable to perform operations with Saholic Google Adowrds Services in addAdwordsAdGroupAd Method");
608
			logger.error("Error while performing operations with Saholic Google Adowrds Services in addAdwordsAdGroupAd Method", e);
9067 manish.sha 609
		} catch (TException e) {
9230 manish.sha 610
			addActionError("Unable to perform operations with Saholic Google Adowrds Services Client in addAdwordsAdGroupAd Method");
611
			logger.error("Error while performing operations with Saholic Google Adowrds Services Client in addAdwordsAdGroupAd Method", e);
9067 manish.sha 612
		}
613
 
614
		return false;
615
	}
616
 
617
	public boolean addAdwordsAdKeyword(List<Map<String,String>> keywordDataList){
618
		List<Map<String,String>> adgroupDataList = new ArrayList<Map<String,String>>();
619
		int attempt =0;
620
		boolean retry = true;
621
		while(retry && attempt<2){
622
			try{
623
				attempt = attempt+1;
624
				adgroupDataList = AddKeywords.runExample(Long.parseLong(adgroupList2), keywordDataList);
625
				retry = false;
626
			}
627
			catch (Exception e) {
628
				retry = true;
629
				logger.error("Error while requesting Google Adwords AdGroup Criterion Service", e);
630
			}
631
		}
632
		if(adgroupDataList!=null && adgroupDataList.size()>0){
633
			try{
634
				AdwordsClient adwordsServiceClient = new AdwordsClient();
635
				Client client = adwordsServiceClient.getClient();
636
				for(Map<String,String> keywordMap : adgroupDataList){
637
					AdwordsAdKeyword adkeyword = new AdwordsAdKeyword();
638
					adkeyword.setAdgroupId(Long.parseLong(adgroupList2));
639
					adkeyword.setCampaignId(Long.parseLong(campaignList3));
640
					adkeyword.setCriterionId(Long.parseLong(keywordMap.get("CriterionId")));
641
					adkeyword.setText(keywordMap.get("Text"));
642
					adkeyword.setMatchType(KeywordMatchType.valueOf(keywordMap.get("Type")));
643
					adkeyword.setBidAmount( (Double.parseDouble(keywordMap.get("BidAmount"))) * (Math.pow(10, -6) ));
644
					client.addAdwordsAdKeyword(adkeyword);
645
				}
646
				return true;
647
			}
648
			catch (TTransportException e) {
9230 manish.sha 649
				addActionError("Unable to get Connection with Saholic Google Adowrds Services in addAdwordsAdKeyword Method");
650
				logger.error("Error while getting Connection with Saholic Google Adowrds Services in addAdwordsAdKeyword Method", e);
9067 manish.sha 651
			} catch (GoogleAdwordsServiceException e) {
9230 manish.sha 652
				addActionError("Unable to perform operations with Saholic Google Adowrds Services in addAdwordsAdKeyword Method");
653
				logger.error("Error while performing operations with Saholic Google Adowrds Services in addAdwordsAdKeyword Method", e);
9067 manish.sha 654
			} catch (TException e) {
9230 manish.sha 655
				addActionError("Unable to perform operations with Saholic Google Adowrds Services Client in addAdwordsAdKeyword Method");
656
				logger.error("Error while performing operations with Saholic Google Adowrds Services Client in addAdwordsAdKeyword Method", e);
9067 manish.sha 657
			}
658
		}
9230 manish.sha 659
		else{
660
			addActionError("Error while processing Add Request for Google AdGroupCriterion Service");
661
		}
9067 manish.sha 662
		return false;
663
	}
664
 
9230 manish.sha 665
	public boolean updateAdwordsCampaign(){
666
		AdwordsClient adwordsServiceClient = null;
667
		try {
668
			adwordsServiceClient = new AdwordsClient();
669
		} catch (TTransportException e) {
670
			addActionError("Unable to get Connection with Saholic Google Adowrds Services in updateAdwordsCampaign Method");
671
			logger.error("Error while getting Connection with Saholic Google Adowrds Services in updateAdwordsCampaign Method", e); 
672
		}
673
		if(adwordsServiceClient!=null){
674
			Client client = adwordsServiceClient.getClient();
675
			if(campaignListUpdate1!=null && !("-1").equalsIgnoreCase(campaignListUpdate1)){
676
				long amount= -1l;
677
				String status = "";
678
				String name = "";
679
				AdwordsCampaign campaign = null;
680
				try {
681
					campaign = client.getAdwordsCampaignByCampaignId(Long.parseLong(campaignListUpdate1));
682
				} catch (NumberFormatException e) {
683
					addActionError("Number Format Exception for CampaignId.."+campaignListUpdate1);
684
					logger.error("Number Format Exception for CampaignId.."+campaignListUpdate1, e);
685
				} catch (GoogleAdwordsServiceException e) {
686
					addActionError("Unable to perform operations with Saholic Google Adowrds Services in updateAdwordsCampaign Method while getting Data");
687
					logger.error("Error while performing operations with Saholic Google Adowrds Services in updateAdwordsCampaign Method while getting Data", e);
688
				} catch (TException e) {
689
					addActionError("Unable to perform operations with Saholic Google Adowrds Services Client in updateAdwordsCampaign Method while getting Data");
690
					logger.error("Error while performing operations with Saholic Google Adowrds Services Client in updateAdwordsCampaign Method while getting Data", e);
691
				}
692
				if(campaign!=null){
693
					if(campaignNameUpdate!=null && !("").equalsIgnoreCase(campaignNameUpdate)){
694
						if(!campaign.getName().equalsIgnoreCase(campaignNameUpdate)){
695
							campaign.setName(campaignNameUpdate);
696
							name = campaignNameUpdate;
697
						}
698
					}
9435 manish.sha 699
					if(campaign.getStatus().getValue()!=Integer.parseInt(campaignStatusUpdate)){
700
						campaign.setStatus(AdwordsCampaignStatus.findByValue(Integer.parseInt(campaignStatusUpdate)));
701
						status = AdwordsCampaignStatus.findByValue(Integer.parseInt(campaignStatusUpdate)).toString();
9230 manish.sha 702
					}
703
					if(campaignAmountUpdate!=null && !("").equalsIgnoreCase(campaignAmountUpdate)){
704
						if(campaign.getBudgetAmount()!=Double.parseDouble(campaignAmountUpdate)){
705
							campaign.setBudgetAmount(Double.parseDouble(campaignAmountUpdate));
706
							amount = (long)(Double.parseDouble(campaignAmountUpdate) * Math.pow(10, 6));
707
						}
708
					}
709
					Long updatedCampaignId = 0l;
9466 manish.sha 710
					if(!("").equalsIgnoreCase(name) || !("").equalsIgnoreCase(name) || amount!=-1l){
711
						try {
712
							updatedCampaignId = UpdateCampaign.runExample(Long.parseLong(campaignListUpdate1), status, name, amount);
713
						} catch (NumberFormatException e) {
714
							addActionError("Number Format Exception for CampaignId (Google End).."+campaignListUpdate1);
715
							logger.error("Number Format Exception for CampaignId (Google End).."+campaignListUpdate1, e);
716
						} catch (Exception e) {
717
							addActionError("Campaign Service Mutate Operation Exception ");
718
							logger.error("Error while Campaign Service Mutate Operation", e);
719
						}
9230 manish.sha 720
					}
721
					if(updatedCampaignId > 0l){
722
						campaign.setCampaignId(updatedCampaignId);
723
						try {
724
							client.updateAdwordsCampaign(campaign);
725
							return true;
726
						} catch (GoogleAdwordsServiceException e) {
727
							addActionError("Unable to perform operations with Saholic Google Adowrds Services in updateAdwordsCampaign Method while updating Data");
728
							logger.error("Error while performing operations with Saholic Google Adowrds Services in updateAdwordsCampaign Method while updating Data", e); 
729
						} catch (TException e) {
730
							addActionError("Unable to perform operations with Saholic Google Adowrds Services Client in updateAdwordsCampaign Method while updating Data");
731
							logger.error("Error while performing operations with Saholic Google Adowrds Services Client in updateAdwordsCampaign Method while updating Data", e);
732
						}
733
					}
734
					else{
9466 manish.sha 735
						addActionError("Either There is Nothing to Update for Campaign Or Some Error Occured");
9230 manish.sha 736
					}
737
				}
738
			}
739
		}
740
 
741
		return false;
742
	}
743
 
744
	public boolean updateAdwordsAdGroup(){
745
		AdwordsClient adwordsServiceClient = null;
746
		try {
747
			adwordsServiceClient = new AdwordsClient();
748
		} catch (TTransportException e) {
749
			e.printStackTrace();
750
		}
751
		if(adwordsServiceClient!=null){
752
			Client client = adwordsServiceClient.getClient();
753
			if(adgroupListUpdate1!=null && !("-1").equalsIgnoreCase(adgroupListUpdate1)){
754
				String name="";
755
				String status ="";
756
				long bidAmount = -1L;
9466 manish.sha 757
				boolean catalogItemIdChanged = false;
758
				boolean stockLinkedChanged = false;
9230 manish.sha 759
				AdwordsAdGroup adgroup = null;
760
				try {
761
					adgroup = client.getAdwordsAdGroupByAdGroupId(Long.parseLong(adgroupListUpdate1));
762
				} catch (NumberFormatException e) {
763
					addActionError("Number Format Exception for AdGroupId.."+adgroupListUpdate1);
764
					logger.error("Number Format Exception for AdGroupId.."+adgroupListUpdate1, e);
765
				} catch (GoogleAdwordsServiceException e) {
766
					addActionError("Unable to perform operations with Saholic Google Adowrds Services in updateAdwordsAdGroup Method while getting Data");
767
					logger.error("Error while performing operations with Saholic Google Adowrds Services in updateAdwordsAdGroup Method while getting Data", e);
768
				} catch (TException e) {
769
					addActionError("Unable to perform operations with Saholic Google Adowrds Services Client in updateAdwordsAdGroup Method while getting Data");
770
					logger.error("Error while performing operations with Saholic Google Adowrds Services Client in updateAdwordsAdGroup Method while getting Data", e);
771
				}
772
				if(adgroup!=null){
773
					if(adgroupNameUpdate!=null && !("").equalsIgnoreCase(adgroupNameUpdate)){
774
						if(!adgroup.getName().equalsIgnoreCase(adgroupNameUpdate)){
775
							adgroup.setName(adgroupNameUpdate);
776
							name = adgroupNameUpdate;
777
						}			
778
					}
9435 manish.sha 779
					if(adgroup.getStatus().getValue()!=Integer.parseInt(adgroupStatusUpdate)){
780
						adgroup.setStatus(AdwordsAdGroupStatus.findByValue(Integer.parseInt(adgroupStatusUpdate)));
781
						status = AdwordsAdGroupStatus.findByValue(Integer.parseInt(adgroupStatusUpdate)).toString();
9230 manish.sha 782
					}
783
					if(catalogItemIdUpdate!=null && !("").equalsIgnoreCase(catalogItemIdUpdate)){
784
						if(adgroup.getCatalogItemId()!= Long.parseLong(catalogItemIdUpdate)){
785
							adgroup.setCatalogItemId(Long.parseLong(catalogItemIdUpdate));
9466 manish.sha 786
							catalogItemIdChanged = true;
9230 manish.sha 787
						}
788
					}
789
					if(bidAmountUpdate!=null && !("").equalsIgnoreCase(bidAmountUpdate)){
790
						if(adgroup.getBidAmount()!=Double.parseDouble(bidAmountUpdate)){
791
							adgroup.setBidAmount(Double.parseDouble(bidAmountUpdate));
792
							bidAmount = (long) (Double.parseDouble(bidAmountUpdate) * Math.pow(10, 6));
793
						}
794
					}
9461 manish.sha 795
					if(stocklinkedUpdate!=adgroup.getStockLinked()){
796
						adgroup.setStockLinked(stocklinkedUpdate);
9466 manish.sha 797
						stockLinkedChanged = true;
9461 manish.sha 798
					}
9230 manish.sha 799
 
800
					Long updatedAdgroupId = 0l;
9466 manish.sha 801
					if(!("").equalsIgnoreCase(name) || !("").equalsIgnoreCase(name) || bidAmount != -1l){
802
						try {
803
							updatedAdgroupId = UpdateAdGroup.runExample(name, status, bidAmount, Long.parseLong(adgroupListUpdate1));
804
						} catch (NumberFormatException e) {
805
							addActionError("Number Format Exception for AdGroupId (Google End).."+adgroupListUpdate1);
806
							logger.error("Number Format Exception for AdGroupId (Google End).."+adgroupListUpdate1, e);
807
						} catch (Exception e) {
808
							addActionError("AdGroup Service Mutate Operation Exception ");
809
							logger.error("Error while AdGroup Service Mutate Operation", e);
810
						}
9230 manish.sha 811
					}
812
					if(updatedAdgroupId>0l){
813
						adgroup.setAdgroupId(updatedAdgroupId);
814
						try {
815
							client.updateAdwordsAdGroup(adgroup);
816
							return true;
817
						} catch (GoogleAdwordsServiceException e) {
818
							addActionError("Unable to perform operations with Saholic Google Adowrds Services in updateAdwordsAdGroup Method while updating Data");
819
							logger.error("Error while performing operations with Saholic Google Adowrds Services in updateAdwordsAdGroup Method while updating Data", e); 
820
						} catch (TException e) {
821
							addActionError("Unable to perform operations with Saholic Google Adowrds Services Client in updateAdwordsAdGroup Method while updating Data");
822
							logger.error("Error while performing operations with Saholic Google Adowrds Services Client in updateAdwordsAdGroup Method while updating Data", e);
823
						}
824
					}
825
					else{
9466 manish.sha 826
						if(catalogItemIdChanged || stockLinkedChanged){
827
							try {
828
								client.updateAdwordsAdGroup(adgroup);
829
								return true;
830
							} catch (GoogleAdwordsServiceException e) {
831
								addActionError("Unable to perform operations with Saholic Google Adowrds Services in updateAdwordsAdGroup Method while updating Data");
832
								logger.error("Error while performing operations with Saholic Google Adowrds Services in updateAdwordsAdGroup Method while updating Data", e); 
833
							} catch (TException e) {
834
								addActionError("Unable to perform operations with Saholic Google Adowrds Services Client in updateAdwordsAdGroup Method while updating Data");
835
								logger.error("Error while performing operations with Saholic Google Adowrds Services Client in updateAdwordsAdGroup Method while updating Data", e);
836
							}
837
						}
838
						else{
839
							addActionError("There is Nothing to Update for AdGroup at Google End(Local System Also) or Some Error Occured");
840
						}
9230 manish.sha 841
					}
842
				}
843
 
844
			}
845
		}
846
		return false;
847
	}
848
 
849
	public boolean updateAdwordsAdKeyword(){
850
		AdwordsClient adwordsServiceClient = null;
851
		try {
852
			adwordsServiceClient = new AdwordsClient();
853
		} catch (TTransportException e) {
854
			e.printStackTrace();
855
		}
856
		if(adwordsServiceClient!=null){
857
			Client client = adwordsServiceClient.getClient();
9435 manish.sha 858
			if(adgroupListUpdate2!=null && !("-1").equalsIgnoreCase(adgroupListUpdate2) && keywordListUpdate1!=null && !("-1").equalsIgnoreCase(keywordListUpdate1)){
9230 manish.sha 859
				String text = "";
860
				String type = "";
861
				long bidAmount = -1l;
862
				AdwordsAdKeyword adkeyword = null;
863
				try {
864
					adkeyword = client.getAdwordsAdKeywordByCriterionIdAndAdGroupId(Long.parseLong(keywordListUpdate1), Long.parseLong(adgroupListUpdate2));
865
				} catch (NumberFormatException e) {
866
					addActionError("Number Format Exception for AdGroupCriterionId.."+keywordListUpdate1+"..AdGroupId.."+adgroupListUpdate2);
867
					logger.error("Number Format Exception for AdGroupCriterionId.."+keywordListUpdate1+"..AdGroupId.."+adgroupListUpdate2, e);
868
				} catch (GoogleAdwordsServiceException e) {
869
					addActionError("Unable to perform operations with Saholic Google Adowrds Services in updateAdwordsAdKeyword Method while getting Data");
870
					logger.error("Error while performing operations with Saholic Google Adowrds Services in updateAdwordsAdKeyword Method while getting Data", e);
871
				} catch (TException e) {
872
					addActionError("Unable to perform operations with Saholic Google Adowrds Services Client in updateAdwordsAdKeyword Method while getting Data");
873
					logger.error("Error while performing operations with Saholic Google Adowrds Services Client in updateAdwordsAdKeyword Method while getting Data", e);
874
				}
875
 
876
				if(adkeyword!=null){
877
					if(keywordUpdate!=null && !("").equalsIgnoreCase(keywordUpdate)){
878
						if(!adkeyword.getText().equalsIgnoreCase(keywordUpdate)){
879
							adkeyword.setText(keywordUpdate);
880
							text = keywordUpdate;
881
						}
882
					}
883
					if(bidUpdate!=null && !("").equalsIgnoreCase(bidUpdate)){
884
						if(adkeyword.getBidAmount()!=Double.parseDouble(bidUpdate)){
885
							adkeyword.setBidAmount(Double.parseDouble(bidUpdate));
886
							bidAmount = (long) (Double.parseDouble(bidUpdate) * Math.pow(10, 6));
887
						}
888
					}
9435 manish.sha 889
					if(adkeyword.getMatchType().getValue()!= Integer.parseInt(matchTypeUpdate)){
890
						adkeyword.setMatchType(KeywordMatchType.findByValue(Integer.parseInt(matchTypeUpdate)));
891
						type = KeywordMatchType.findByValue(Integer.parseInt(matchTypeUpdate)).toString();
9230 manish.sha 892
					}
893
 
894
					Long updatedCriterionId = 0l;
9466 manish.sha 895
					if(!("").equalsIgnoreCase(text) || !("").equalsIgnoreCase(type) || bidAmount != -1l){
896
						try {
897
							updatedCriterionId = UpdateKeyword.runExample(Long.parseLong(adgroupListUpdate2), Long.parseLong(keywordListUpdate1), text, bidAmount, type);
898
						} catch (NumberFormatException e) {
899
							addActionError("Number Format Exception for AdGroupCriterionId.."+keywordListUpdate1+"..AdGroupId.."+adgroupListUpdate2+ "(Google End)..");
900
							logger.error("Number Format Exception for AdGroupCriterionId.."+keywordListUpdate1+"..AdGroupId.."+adgroupListUpdate2+ "(Google End)..", e);
901
						} catch (Exception e) {
902
							addActionError("AdGroup Crierion Service Mutate Operation Exception ");
903
							e.printStackTrace();
904
							logger.error("Error while AdGroup Crierion Service Mutate Operation", e);
905
						}
9230 manish.sha 906
					}
907
 
908
					if(updatedCriterionId>0l){
909
						adkeyword.setCriterionId(updatedCriterionId);
910
						try {
911
							client.updateAdwordsAdKeyword(adkeyword);
912
							return true;
913
						} catch (GoogleAdwordsServiceException e) {
914
							addActionError("Unable to perform operations with Saholic Google Adowrds Services in updateAdwordsAdKeyword Method while updating Data");
915
							logger.error("Error while performing operations with Saholic Google Adowrds Services in updateAdwordsAdKeyword Method while updating Data", e); 
916
						} catch (TException e) {
917
							addActionError("Unable to perform operations with Saholic Google Adowrds Services Client in updateAdwordsAdKeyword Method while updating Data");
918
							logger.error("Error while performing operations with Saholic Google Adowrds Services Client in updateAdwordsAdKeyword Method while updating Data", e);
919
						}
920
					}
921
					else{
9466 manish.sha 922
						addActionError("Either There is Nothing to Update for Keyword Or Some Error Occured");
9230 manish.sha 923
					}
924
 
925
				}
926
 
927
			}
928
		}
929
		return false;
930
	}
931
 
9067 manish.sha 932
	@Override
933
	public void setServletRequest(HttpServletRequest request) {
934
		this.request = request;
935
		this.session = request.getSession();
936
	}
937
 
938
	public String getCampaignId() {
939
		return campaignId;
940
	}
941
 
942
	public void setCampaignId(String campaignId) {
943
		this.campaignId = campaignId;
944
	}
945
 
946
	public String getErrorMsg(){
947
		return this.errorMsg;
948
	}
949
 
950
	public String getSuccessMessage(){
951
		return this.successmsg ;
952
	}
953
 
954
	public JSONObject getJsonData() {
955
		return jsonData;
956
	}
957
 
958
	public void setJsonData(JSONObject jsonData) {
959
		this.jsonData = jsonData;
960
	}
9230 manish.sha 961
 
962
	public JSONObject getJsonCampaignData() {
963
		return jsonCampaignData;
964
	}
9067 manish.sha 965
 
9230 manish.sha 966
	public void setJsonCampaignData(JSONObject jsonCampaignData) {
967
		this.jsonCampaignData = jsonCampaignData;
968
	}
969
 
970
	public JSONObject getJsonAdgroupData() {
971
		return jsonAdgroupData;
972
	}
973
 
974
	public void setJsonAdgroupData(JSONObject jsonAdgroupData) {
975
		this.jsonAdgroupData = jsonAdgroupData;
976
	}
977
 
9435 manish.sha 978
	public JSONObject getJsonCampaignList() {
979
		return jsonCampaignList;
980
	}
981
 
982
	public void setJsonCampaignList(JSONObject jsonCampaignList) {
983
		this.jsonCampaignList = jsonCampaignList;
984
	}
985
 
9230 manish.sha 986
	public String getKeywordId() {
987
		return keywordId;
988
	}
989
 
990
	public void setKeywordId(String keywordId) {
991
		this.keywordId = keywordId;
992
	}
993
 
994
	public String getAdgroupId() {
995
		return adgroupId;
996
	}
997
 
998
	public void setAdgroupId(String adgroupId) {
999
		this.adgroupId = adgroupId;
1000
	}
1001
 
1002
	public JSONObject getJsonKeywordList() {
1003
		return jsonKeywordList;
1004
	}
1005
 
1006
	public void setJsonKeywordList(JSONObject jsonKeywordList) {
1007
		this.jsonKeywordList = jsonKeywordList;
1008
	}
1009
 
1010
	public JSONObject getJsonKeywordData() {
1011
		return jsonKeywordData;
1012
	}
1013
 
1014
	public void setJsonKeywordData(JSONObject jsonKeywordData) {
1015
		this.jsonKeywordData = jsonKeywordData;
1016
	}
1017
 
1018
	public String getTextAdItemPrice(){
1019
		String itemPrice = "";
1020
		List<Item> itemList = new ArrayList<Item>();
1021
		try {
1022
			itemList = new CatalogClient().getClient().getItemsByCatalogId(Long.parseLong(catalogItemId));
1023
		} catch (NumberFormatException e) {
1024
			e.printStackTrace();
1025
		} catch (TTransportException e) {
1026
			e.printStackTrace();
1027
		} catch (CatalogServiceException e) {
1028
			e.printStackTrace();
1029
		} catch (TException e) {
1030
			e.printStackTrace();
1031
		}
9284 manish.sha 1032
		List<Long> itemPriceList = new ArrayList<Long>();
9230 manish.sha 1033
		for(Item item : itemList){
9284 manish.sha 1034
			itemPriceList.add((long)item.getSellingPrice());
9230 manish.sha 1035
		}
9284 manish.sha 1036
		if(itemPriceList!=null && itemPriceList.size()>0){
1037
			Collections.sort(itemPriceList);
1038
			itemPrice = itemPriceList.get(0).longValue()+"";
1039
		}
9351 manish.sha 1040
 
9230 manish.sha 1041
		return itemPrice;
1042
	}
9067 manish.sha 1043
	public String getAdgroupList(){
1044
		List<Map<String,String>> adgroupDataList = new ArrayList<Map<String,String>>();
1045
		Map<String, List<Map<String,String>>> mainMap = new HashMap<String, List<Map<String,String>>>();
1046
		List<AdwordsAdGroup> adgroupList =null;
1047
		try {
1048
			adgroupList = new AdwordsClient().getClient().getAdwordsAdGroupsByCampaignId(Long.parseLong(campaignId));
1049
		} catch (TTransportException e) {
1050
			e.printStackTrace();
1051
		} catch (GoogleAdwordsServiceException e) {
1052
			e.printStackTrace();
1053
		} catch (TException e) {
1054
			e.printStackTrace();
1055
		}
1056
		for(int i=0 ; i<adgroupList.size() ; i++){
1057
			AdwordsAdGroup adgroup = adgroupList.get(i);
1058
			Map<String,String> adgroupDataMap = new HashMap<String,String>();
1059
			adgroupDataMap.put("AdgroupId",adgroup.getAdgroupId()+"");
1060
			adgroupDataMap.put("Name", adgroup.getName());
1061
			adgroupDataList.add(adgroupDataMap);
1062
		}
1063
		mainMap.put("AdGroupData", adgroupDataList);
1064
		jsonData = new JSONObject(mainMap);
9351 manish.sha 1065
 
9067 manish.sha 1066
		return "output";
1067
	}
9230 manish.sha 1068
 
1069
	public String getKeywordList(){
1070
		List<Map<String,String>> adkeywordDataList = new ArrayList<Map<String,String>>();
1071
		Map<String, List<Map<String,String>>> mainMap = new HashMap<String, List<Map<String,String>>>();
1072
		List<AdwordsAdKeyword> adkeywordList = null;
1073
		try {
1074
			adkeywordList = new AdwordsClient().getClient().getAdwordsAdKeywordsByAdgroupId(Long.parseLong(adgroupId));
1075
		}
1076
		catch (TTransportException e) {
1077
			e.printStackTrace();
1078
		} catch (GoogleAdwordsServiceException e) {
1079
			e.printStackTrace();
1080
		} catch (TException e) {
1081
			e.printStackTrace();
1082
		}
1083
 
1084
		for(AdwordsAdKeyword adkeyword : adkeywordList){
1085
			Map<String,String> adkeywordDataMap = new HashMap<String,String>();
1086
			adkeywordDataMap.put("KeywordId", adkeyword.getCriterionId()+"");
1087
			adkeywordDataMap.put("Text", adkeyword.getText());
1088
			adkeywordDataList.add(adkeywordDataMap);
1089
		}
1090
		mainMap.put("AdKeywordData", adkeywordDataList);
1091
		jsonKeywordList = new JSONObject(mainMap);
1092
		return "output";
1093
	}
1094
 
1095
	public String getCampaignDetails(){
1096
		Map<String, String> campaignUnitDataMap = new HashMap<String, String>();
1097
		AdwordsCampaign campaign = null;
1098
		try {
1099
			campaign = new AdwordsClient().getClient().getAdwordsCampaignByCampaignId(Long.parseLong(campaignId));
1100
		} catch (NumberFormatException e) {
1101
			e.printStackTrace();
1102
		} catch (TTransportException e) {
1103
			e.printStackTrace();
1104
		} catch (GoogleAdwordsServiceException e) {
1105
			e.printStackTrace();
1106
		} catch (TException e) {
1107
			e.printStackTrace();
1108
		}
1109
 
1110
		if(campaign!=null){
1111
			campaignUnitDataMap.put("Name", campaign.getName());
1112
			campaignUnitDataMap.put("BudgetAmount", campaign.getBudgetAmount()+"");
1113
			campaignUnitDataMap.put("Status", campaign.getStatus().getValue()+"");
1114
		}
1115
		jsonCampaignData = new JSONObject(campaignUnitDataMap);
1116
		return "output";
1117
	}
1118
 
1119
	public String getAdGroupDetails(){
1120
		Map<String, String> adgroupUnitDataMap = new HashMap<String, String>();
1121
		AdwordsAdGroup adGroup = null;
1122
		try {
1123
			adGroup = new AdwordsClient().getClient().getAdwordsAdGroupByAdGroupId(Long.parseLong(adgroupId));
1124
		} catch (NumberFormatException e) {
1125
			e.printStackTrace();
1126
		} catch (TTransportException e) {
1127
			e.printStackTrace();
1128
		} catch (GoogleAdwordsServiceException e) {
1129
			e.printStackTrace();
1130
		} catch (TException e) {
1131
			e.printStackTrace();
1132
		}
1133
 
1134
		if(adGroup!=null){
1135
			adgroupUnitDataMap.put("Name", adGroup.getName());
1136
			adgroupUnitDataMap.put("BidAmount", adGroup.getBidAmount()+"");
1137
			adgroupUnitDataMap.put("Status", adGroup.getStatus().getValue()+"");
1138
			adgroupUnitDataMap.put("CatalogItemId", adGroup.getCatalogItemId()+"");
9461 manish.sha 1139
			adgroupUnitDataMap.put("StockLinked",adGroup.getStockLinked()+"");
9230 manish.sha 1140
		}
1141
		jsonAdgroupData = new JSONObject(adgroupUnitDataMap);
1142
		return "output";
1143
	}
1144
 
1145
	public String getKeywordDetails(){
1146
		Map<String, String> adkeywordUnitDataMap = new HashMap<String, String>();
1147
		AdwordsAdKeyword adKeyword = null;
1148
		try {
1149
			adKeyword = new AdwordsClient().getClient().getAdwordsAdKeywordByCriterionIdAndAdGroupId(Long.parseLong(keywordId), Long.parseLong(adgroupId));
1150
		} catch (NumberFormatException e) {
1151
			e.printStackTrace();
1152
		} catch (TTransportException e) {
1153
			e.printStackTrace();
1154
		} catch (GoogleAdwordsServiceException e) {
1155
			e.printStackTrace();
1156
		} catch (TException e) {
1157
			e.printStackTrace();
1158
		}
1159
 
1160
		if(adKeyword!=null){
1161
			adkeywordUnitDataMap.put("Text", adKeyword.getText());
1162
			adkeywordUnitDataMap.put("Bid", adKeyword.getBidAmount()+"");
1163
			adkeywordUnitDataMap.put("MatchType", adKeyword.getMatchType().getValue()+"");
1164
		}
1165
		jsonKeywordData = new JSONObject(adkeywordUnitDataMap);
1166
		return "output";
1167
	}
9067 manish.sha 1168
 
9435 manish.sha 1169
	public String getCampaigns(){
1170
 
1171
		 List<Map<String,String>> campaignDataList = new ArrayList<Map<String,String>>();
1172
		Map<String, List<Map<String,String>>> mainMap = new HashMap<String, List<Map<String,String>>>();
9067 manish.sha 1173
		List<AdwordsCampaign> campaignList =null;
1174
		try {
1175
			campaignList = new AdwordsClient().getClient().getAllAdwordsCampaigns();
1176
		} catch (TTransportException e) {
1177
			e.printStackTrace();
1178
		} catch (GoogleAdwordsServiceException e) {
1179
			e.printStackTrace();
1180
		} catch (TException e) {
1181
			e.printStackTrace();
1182
		}
9435 manish.sha 1183
		for(int i=0 ; i<campaignList.size() ; i++){
1184
			AdwordsCampaign campaign = campaignList.get(i);
1185
			Map<String,String> campaignDataMap = new HashMap<String,String>();
1186
			campaignDataMap.put("CampaignId",campaign.getCampaignId()+"");
1187
			campaignDataMap.put("Name", campaign.getName());
1188
			campaignDataList.add(campaignDataMap);
1189
		}
1190
		mainMap.put("CampaignData", campaignDataList);
1191
		jsonCampaignList = new JSONObject(mainMap);
1192
		/*
1193
		List<AdwordsCampaign> campaignList =null;
1194
		try {
1195
			campaignList = new AdwordsClient().getClient().getAllAdwordsCampaigns();
1196
		} catch (TTransportException e) {
1197
			e.printStackTrace();
1198
		} catch (GoogleAdwordsServiceException e) {
1199
			e.printStackTrace();
1200
		} catch (TException e) {
1201
			e.printStackTrace();
1202
		} */
1203
		return "output";
9067 manish.sha 1204
	}
1205
 
1206
	private boolean checkForErrors(){
1207
		Collection<String> actionErrors = getActionErrors();
1208
		if(actionErrors != null && !actionErrors.isEmpty()){
1209
			for (String str : actionErrors) {
1210
				errorMsg += "<BR/>" + str;
1211
			}
1212
			return true;
1213
		}
1214
		return false;
1215
	}
1216
 
1217
	public String getAdwordOpRadio() {
1218
		return adwordOpRadio;
1219
	}
1220
 
1221
	public void setAdwordOpRadio(String adwordOpRadio) {
1222
		this.adwordOpRadio = adwordOpRadio;
1223
	}
1224
 
1225
	public String getAdwordAddRadio() {
1226
		return adwordAddRadio;
1227
	}
1228
 
1229
	public void setAdwordAddRadio(String adwordAddRadio) {
1230
		this.adwordAddRadio = adwordAddRadio;
1231
	}
1232
 
1233
	public String getCampaignName() {
1234
		return campaignName;
1235
	}
1236
 
1237
	public void setCampaignName(String campaignName) {
1238
		this.campaignName = campaignName;
1239
	}
1240
 
1241
	public String getCampaignStatus() {
1242
		return campaignStatus;
1243
	}
1244
 
1245
	public void setCampaignStatus(String campaignStatus) {
1246
		this.campaignStatus = campaignStatus;
1247
	}
1248
 
1249
	public String getStartDate() {
1250
		return startDate;
1251
	}
1252
 
1253
	public void setStartDate(String startDate) {
1254
		this.startDate = startDate;
1255
	}
1256
 
1257
	public String getEndDate() {
1258
		return endDate;
1259
	}
1260
 
1261
	public void setEndDate(String endDate) {
1262
		this.endDate = endDate;
1263
	}
1264
 
1265
	public String getCampaignAmount() {
1266
		return campaignAmount;
1267
	}
1268
 
1269
	public void setCampaignAmount(String campaignAmount) {
1270
		this.campaignAmount = campaignAmount;
1271
	}
1272
 
1273
	public String getGoogleSearchNetwork() {
1274
		return googleSearchNetwork;
1275
	}
1276
 
1277
	public void setGoogleSearchNetwork(String googleSearchNetwork) {
1278
		this.googleSearchNetwork = googleSearchNetwork;
1279
	}
1280
 
1281
	public String getDisplayNetwork() {
1282
		return displayNetwork;
1283
	}
1284
 
1285
	public void setDisplayNetwork(String displayNetwork) {
1286
		this.displayNetwork = displayNetwork;
1287
	}
1288
 
1289
	public String getPartnerSearchNetwork() {
1290
		return partnerSearchNetwork;
1291
	}
1292
 
1293
	public void setPartnerSearchNetwork(String partnerSearchNetwork) {
1294
		this.partnerSearchNetwork = partnerSearchNetwork;
1295
	}
1296
 
1297
	public String getCampaignList1() {
1298
		return campaignList1;
1299
	}
1300
 
1301
	public void setCampaignList1(String campaignList1) {
1302
		this.campaignList1 = campaignList1;
1303
	}
1304
 
1305
	public String getAdgroupName() {
1306
		return adgroupName;
1307
	}
1308
 
1309
	public void setAdgroupName(String adgroupName) {
1310
		this.adgroupName = adgroupName;
1311
	}
1312
 
1313
	public String getAdgroupStatus() {
1314
		return adgroupStatus;
1315
	}
1316
 
1317
	public void setAdgroupStatus(String adgroupStatus) {
1318
		this.adgroupStatus = adgroupStatus;
1319
	}
1320
 
1321
	public String getCatalogItemId() {
1322
		return catalogItemId;
1323
	}
1324
 
1325
	public void setCatalogItemId(String catalogItemId) {
1326
		this.catalogItemId = catalogItemId;
1327
	}
1328
 
1329
	public String getBidAmount() {
1330
		return bidAmount;
1331
	}
1332
 
1333
	public void setBidAmount(String bidAmount) {
1334
		this.bidAmount = bidAmount;
1335
	}
1336
 
1337
	public String getCampaignList2() {
1338
		return campaignList2;
1339
	}
1340
 
1341
	public void setCampaignList2(String campaignList2) {
1342
		this.campaignList2 = campaignList2;
1343
	}
1344
 
1345
	public String getAdgroupList1() {
1346
		return adgroupList1;
1347
	}
1348
 
1349
	public void setAdgroupList1(String adgroupList1) {
1350
		this.adgroupList1 = adgroupList1;
1351
	}
1352
 
1353
	public String getHeadline() {
1354
		return headline;
1355
	}
1356
 
1357
	public void setHeadline(String headline) {
1358
		this.headline = headline;
1359
	}
1360
 
1361
	public String getDescription1() {
1362
		return description1;
1363
	}
1364
 
1365
	public void setDescription1(String description1) {
1366
		this.description1 = description1;
1367
	}
1368
 
1369
	public String getDescription2() {
1370
		return description2;
1371
	}
1372
 
1373
	public void setDescription2(String description2) {
1374
		this.description2 = description2;
1375
	}
1376
 
1377
	public String getUrl() {
1378
		return url;
1379
	}
1380
 
1381
	public void setUrl(String url) {
1382
		this.url = url;
1383
	}
1384
 
1385
	public String getDisplayUrl() {
1386
		return displayUrl;
1387
	}
1388
 
1389
	public void setDisplayUrl(String displayUrl) {
1390
		this.displayUrl = displayUrl;
1391
	}
1392
 
1393
	public String getCampaignList3() {
1394
		return campaignList3;
1395
	}
1396
 
1397
	public void setCampaignList3(String campaignList3) {
1398
		this.campaignList3 = campaignList3;
1399
	}
1400
 
1401
	public String getAdgroupList2() {
1402
		return adgroupList2;
1403
	}
1404
 
1405
	public void setAdgroupList2(String adgroupList2) {
1406
		this.adgroupList2 = adgroupList2;
1407
	}
1408
 
1409
	public String getKeyword1() {
1410
		return keyword1;
1411
	}
1412
 
1413
	public void setKeyword1(String keyword1) {
1414
		this.keyword1 = keyword1;
1415
	}
1416
 
1417
	public String getKeyword2() {
1418
		return keyword2;
1419
	}
1420
 
1421
	public void setKeyword2(String keyword2) {
1422
		this.keyword2 = keyword2;
1423
	}
1424
 
1425
	public String getKeyword3() {
1426
		return keyword3;
1427
	}
1428
 
1429
	public void setKeyword3(String keyword3) {
1430
		this.keyword3 = keyword3;
1431
	}
1432
 
1433
	public String getKeyword4() {
1434
		return keyword4;
1435
	}
1436
 
1437
	public void setKeyword4(String keyword4) {
1438
		this.keyword4 = keyword4;
1439
	}
1440
 
1441
	public String getKeyword5() {
1442
		return keyword5;
1443
	}
1444
 
1445
	public void setKeyword5(String keyword5) {
1446
		this.keyword5 = keyword5;
1447
	}
1448
 
1449
	public String getBid1() {
1450
		return bid1;
1451
	}
1452
 
1453
	public void setBid1(String bid1) {
1454
		this.bid1 = bid1;
1455
	}
1456
 
1457
	public String getBid2() {
1458
		return bid2;
1459
	}
1460
 
1461
	public void setBid2(String bid2) {
1462
		this.bid2 = bid2;
1463
	}
1464
 
1465
	public String getBid3() {
1466
		return bid3;
1467
	}
1468
 
1469
	public void setBid3(String bid3) {
1470
		this.bid3 = bid3;
1471
	}
1472
 
1473
	public String getBid4() {
1474
		return bid4;
1475
	}
1476
 
1477
	public void setBid4(String bid4) {
1478
		this.bid4 = bid4;
1479
	}
1480
 
1481
	public String getBid5() {
1482
		return bid5;
1483
	}
1484
 
1485
	public void setBid5(String bid5) {
1486
		this.bid5 = bid5;
1487
	}
1488
 
1489
	public String getMatchType1() {
1490
		return matchType1;
1491
	}
1492
 
1493
	public void setMatchType1(String matchType1) {
1494
		this.matchType1 = matchType1;
1495
	}
1496
 
1497
	public String getMatchType2() {
1498
		return matchType2;
1499
	}
1500
 
1501
	public void setMatchType2(String matchType2) {
1502
		this.matchType2 = matchType2;
1503
	}
1504
 
1505
	public String getMatchType3() {
1506
		return matchType3;
1507
	}
1508
 
1509
	public void setMatchType3(String matchType3) {
1510
		this.matchType3 = matchType3;
1511
	}
1512
 
1513
	public String getMatchType4() {
1514
		return matchType4;
1515
	}
1516
 
1517
	public void setMatchType4(String matchType4) {
1518
		this.matchType4 = matchType4;
1519
	}
1520
 
1521
	public String getMatchType5() {
1522
		return matchType5;
1523
	}
1524
 
1525
	public void setMatchType5(String matchType5) {
1526
		this.matchType5 = matchType5;
1527
	}
1528
 
1529
	public String getStockLinked() {
1530
		return stockLinked;
1531
	}
1532
 
1533
	public void setStockLinked(String stockLinked) {
1534
		this.stockLinked = stockLinked;
1535
	}
1536
 
9230 manish.sha 1537
	public String getAdwordUpdateRadio() {
1538
		return adwordUpdateRadio;
1539
	}
1540
 
1541
	public void setAdwordUpdateRadio(String adwordUpdateRadio) {
1542
		this.adwordUpdateRadio = adwordUpdateRadio;
1543
	}
1544
 
1545
	public String getCampaignListUpdate1() {
1546
		return campaignListUpdate1;
1547
	}
1548
 
1549
	public void setCampaignListUpdate1(String campaignListUpdate1) {
1550
		this.campaignListUpdate1 = campaignListUpdate1;
1551
	}
1552
 
1553
	public String getCampaignNameUpdate() {
1554
		return campaignNameUpdate;
1555
	}
1556
 
1557
	public void setCampaignNameUpdate(String campaignNameUpdate) {
1558
		this.campaignNameUpdate = campaignNameUpdate;
1559
	}
1560
 
1561
	public String getCampaignStatusUpdate() {
1562
		return campaignStatusUpdate;
1563
	}
1564
 
1565
	public void setCampaignStatusUpdate(String campaignStatusUpdate) {
1566
		this.campaignStatusUpdate = campaignStatusUpdate;
1567
	}
1568
 
1569
	public String getCampaignAmountUpdate() {
1570
		return campaignAmountUpdate;
1571
	}
1572
 
1573
	public void setCampaignAmountUpdate(String campaignAmountUpdate) {
1574
		this.campaignAmountUpdate = campaignAmountUpdate;
1575
	}
1576
 
1577
	public String getCampaignListUpdate2() {
1578
		return campaignListUpdate2;
1579
	}
1580
 
1581
	public void setCampaignListUpdate2(String campaignListUpdate2) {
1582
		this.campaignListUpdate2 = campaignListUpdate2;
1583
	}
1584
 
1585
	public String getAdgroupListUpdate1() {
1586
		return adgroupListUpdate1;
1587
	}
1588
 
1589
	public void setAdgroupListUpdate1(String adgroupListUpdate1) {
1590
		this.adgroupListUpdate1 = adgroupListUpdate1;
1591
	}
1592
 
1593
	public String getAdgroupNameUpdate() {
1594
		return adgroupNameUpdate;
1595
	}
1596
 
1597
	public void setAdgroupNameUpdate(String adgroupNameUpdate) {
1598
		this.adgroupNameUpdate = adgroupNameUpdate;
1599
	}
1600
 
1601
	public String getAdgroupStatusUpdate() {
1602
		return adgroupStatusUpdate;
1603
	}
1604
 
1605
	public void setAdgroupStatusUpdate(String adgroupStatusUpdate) {
1606
		this.adgroupStatusUpdate = adgroupStatusUpdate;
1607
	}
1608
 
1609
	public String getCatalogItemIdUpdate() {
1610
		return catalogItemIdUpdate;
1611
	}
1612
 
1613
	public void setCatalogItemIdUpdate(String catalogItemIdUpdate) {
1614
		this.catalogItemIdUpdate = catalogItemIdUpdate;
1615
	}
1616
 
1617
	public String getBidAmountUpdate() {
1618
		return bidAmountUpdate;
1619
	}
1620
 
1621
	public void setBidAmountUpdate(String bidAmountUpdate) {
1622
		this.bidAmountUpdate = bidAmountUpdate;
1623
	}
1624
 
9461 manish.sha 1625
	public String getStockLinkedUpdate() {
1626
		return stockLinkedUpdate;
1627
	}
1628
 
1629
	public void setStockLinkedUpdate(String stockLinkedUpdate) {
1630
		this.stockLinkedUpdate = stockLinkedUpdate;
1631
	}
1632
 
9230 manish.sha 1633
	public String getCampaignListUpdate3() {
1634
		return campaignListUpdate3;
1635
	}
1636
 
1637
	public void setCampaignListUpdate3(String campaignListUpdate3) {
1638
		this.campaignListUpdate3 = campaignListUpdate3;
1639
	}
1640
 
1641
	public String getAdgroupListUpdate2() {
1642
		return adgroupListUpdate2;
1643
	}
1644
 
1645
	public void setAdgroupListUpdate2(String adgroupListUpdate2) {
1646
		this.adgroupListUpdate2 = adgroupListUpdate2;
1647
	}
1648
 
1649
	public String getKeywordUpdate() {
1650
		return keywordUpdate;
1651
	}
1652
 
1653
	public void setKeywordUpdate(String keywordUpdate) {
1654
		this.keywordUpdate = keywordUpdate;
1655
	}
1656
 
1657
	public String getBidUpdate() {
1658
		return bidUpdate;
1659
	}
1660
 
1661
	public void setBidUpdate(String bidUpdate) {
1662
		this.bidUpdate = bidUpdate;
1663
	}
1664
 
1665
	public String getMatchTypeUpdate() {
1666
		return matchTypeUpdate;
1667
	}
1668
 
1669
	public void setMatchTypeUpdate(String matchTypeUpdate) {
1670
		this.matchTypeUpdate = matchTypeUpdate;
1671
	}
1672
 
1673
	public String getKeywordListUpdate1() {
1674
		return keywordListUpdate1;
1675
	}
1676
 
1677
	public void setKeywordListUpdate1(String keywordListUpdate1) {
1678
		this.keywordListUpdate1 = keywordListUpdate1;
1679
	}
1680
 
9067 manish.sha 1681
}