Subversion Repositories SmartDukaan

Rev

Rev 3439 | Rev 3516 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 3439 Rev 3464
Line 11... Line 11...
11
import in.shop2020.ui.util.CatalogUploderToGAE;
11
import in.shop2020.ui.util.CatalogUploderToGAE;
12
import in.shop2020.ui.util.ComparisonStatsFetcher;
12
import in.shop2020.ui.util.ComparisonStatsFetcher;
13
import in.shop2020.ui.util.NewVUI;
13
import in.shop2020.ui.util.NewVUI;
14
import in.shop2020.ui.util.PriceInsertor;
14
import in.shop2020.ui.util.PriceInsertor;
15
import in.shop2020.ui.util.SpecialPageJSONConvertor;
15
import in.shop2020.ui.util.SpecialPageJSONConvertor;
-
 
16
import in.shop2020.utils.GmailUtils;
16
 
17
 
17
import java.io.File;
18
import java.io.File;
18
import java.io.IOException;
19
import java.io.IOException;
19
import java.util.ArrayList;
20
import java.util.ArrayList;
20
import java.util.Calendar;
21
import java.util.Calendar;
Line 22... Line 23...
22
import java.util.HashMap;
23
import java.util.HashMap;
23
import java.util.LinkedHashMap;
24
import java.util.LinkedHashMap;
24
import java.util.List;
25
import java.util.List;
25
import java.util.Map;
26
import java.util.Map;
26
 
27
 
-
 
28
import javax.mail.MessagingException;
-
 
29
 
27
import org.apache.commons.cli.CommandLine;
30
import org.apache.commons.cli.CommandLine;
28
import org.apache.commons.cli.CommandLineParser;
31
import org.apache.commons.cli.CommandLineParser;
29
import org.apache.commons.cli.HelpFormatter;
32
import org.apache.commons.cli.HelpFormatter;
30
import org.apache.commons.cli.Options;
33
import org.apache.commons.cli.Options;
31
import org.apache.commons.cli.ParseException;
34
import org.apache.commons.cli.ParseException;
Line 68... Line 71...
68
 
71
 
69
    /**
72
    /**
70
     * @param args
73
     * @param args
71
     * @throws Exception 
74
     * @throws Exception 
72
     */
75
     */
73
    public static void main(String[] args) throws Exception {
76
    public static void main(String[] args) throws Exception{
74
        ContentGenerationUtility cgu = new ContentGenerationUtility();
77
        ContentGenerationUtility cgu = new ContentGenerationUtility();
75
        //Load arguments
78
        //Load arguments
76
        cgu.loadArgs(args);
79
        cgu.loadArgs(args);
77
        //Call method based on arguments
80
        //Call method based on arguments
78
        cgu.callMethod();
81
        cgu.callMethod();
Line 120... Line 123...
120
    
123
    
121
    /**
124
    /**
122
     * Call method based on arguments
125
     * Call method based on arguments
123
     * @throws Exception
126
     * @throws Exception
124
     */
127
     */
125
    private void callMethod() throws Exception{
128
    private void callMethod(){
-
 
129
    	boolean isSuccess = false;
-
 
130
    	String logfile = "/tmp/content-from-cms.log";
126
    	if(UPDATE_TYPE.equals("CONTENT")){
131
    	if(UPDATE_TYPE.equals("CONTENT")){
-
 
132
    		logfile = "/tmp/content-from-cms.log";
-
 
133
    		try{
127
    		this.generateContent();	
134
    			this.generateContent();
-
 
135
    			isSuccess = true;
-
 
136
    		}catch (Exception e) {
-
 
137
    			e.printStackTrace();
-
 
138
			}
128
    	}
139
    	}
129
    	
140
    	
130
    	if(UPDATE_TYPE.equals("CATALOG")){
141
    	if(UPDATE_TYPE.equals("CATALOG")){
-
 
142
    		logfile = "/tmp/content-from-catalog.log";
-
 
143
    		try{
131
    		this.updatePrices();
144
    			this.updatePrices();
-
 
145
    			isSuccess = true;
-
 
146
    		}catch (Exception e) {
-
 
147
    			e.printStackTrace();
-
 
148
			}
132
    	}	
149
    	}
-
 
150
    	
-
 
151
    	GmailUtils gm = new GmailUtils();
-
 
152
		String[] sendTo = { "chandranshu.s@shop2020.in", "rajveer.singh@shop2020.in" };
-
 
153
		try {
-
 
154
			gm.sendSSLMessage(sendTo, "Content Generation Successful ? : " + isSuccess, "Content generation completed at time : " + Calendar.getInstance().getTime().toString(), "build@shop2020.in", "shop2020", logfile);
-
 
155
		} catch (MessagingException e) {
-
 
156
			// TODO Auto-generated catch block
-
 
157
			e.printStackTrace();
-
 
158
		}
133
    }
159
    }
134
    
160
    
135
 
161
 
136
    
162
    
137
	public boolean cleanDir(File dir, boolean deleteSelf) {
163
	public boolean cleanDir(File dir, boolean deleteSelf) {