Subversion Repositories SmartDukaan

Rev

Rev 343 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 343 Rev 344
Line 4... Line 4...
4
package in.shop2020.util;
4
package in.shop2020.util;
5
 
5
 
6
import in.shop2020.config.ConfigException;
6
import in.shop2020.config.ConfigException;
7
import in.shop2020.thrift.clients.config.ConfigClient;
7
import in.shop2020.thrift.clients.config.ConfigClient;
8
 
8
 
-
 
9
import java.net.URL;
9
import java.util.logging.Logger;
10
import java.util.logging.Logger;
10
 
11
 
11
/**
12
/**
12
 * Utility functions and wrappers 
13
 * Utility functions and wrappers 
13
 * 
14
 * 
Line 17... Line 18...
17
public class Utils {
18
public class Utils {
18
	
19
	
19
		
20
		
20
		
21
		
21
	public static String CONTENT_DB_PATH, DEFINITIONS_DB_PATH, MEDIA_DB_PATH, ENTITIES_DB_PATH, COMPARISONS_DB_PATH;
22
	public static String CONTENT_DB_PATH, DEFINITIONS_DB_PATH, MEDIA_DB_PATH, ENTITIES_DB_PATH, COMPARISONS_DB_PATH;
-
 
23
	public static String EXPORT_IR_PATH, EXPORT_ENTITIES_PATH, EXPORT_DEFINITIONS_PATH, EXPORT_CATEGORY_HOMES_PATH,	EXPORT_DIFF_PATH, EXPORT_SOLR_PATH;
-
 
24
 
22
	public static String currentDir = System.getProperty("user.dir");
25
	public static String currentDir = System.getProperty("user.dir");
23
 
26
 
24
	static{
27
	static{
25
		
28
		
26
		try {
29
		try {
Line 32... Line 35...
32
			CONTENT_DB_PATH = configClient.get("CONTENT_DB_PATH");
35
			CONTENT_DB_PATH = configClient.get("CONTENT_DB_PATH");
33
			MEDIA_DB_PATH = configClient.get("MEDIA_DB_PATH");
36
			MEDIA_DB_PATH = configClient.get("MEDIA_DB_PATH");
34
			DEFINITIONS_DB_PATH = configClient.get("DEFINITIONS_DB_PATH");
37
			DEFINITIONS_DB_PATH = configClient.get("DEFINITIONS_DB_PATH");
35
			ENTITIES_DB_PATH = configClient.get("ENTITIES_DB_PATH");
38
			ENTITIES_DB_PATH = configClient.get("ENTITIES_DB_PATH");
36
			COMPARISONS_DB_PATH = configClient.get("COMPARISONS_DB_PATH");
39
			COMPARISONS_DB_PATH = configClient.get("COMPARISONS_DB_PATH");
-
 
40
 
37
			
41
 
-
 
42
			EXPORT_IR_PATH = configClient.get("EXPORT_IR_PATH");
-
 
43
			EXPORT_ENTITIES_PATH = configClient.get("EXPORT_ENTITIES_PATH");
-
 
44
			EXPORT_DEFINITIONS_PATH = configClient.get("EXPORT_DEFINITIONS_PATH");
-
 
45
			EXPORT_CATEGORY_HOMES_PATH = configClient.get("EXPORT_CATEGORY_HOMES_PATH");
-
 
46
			EXPORT_DIFF_PATH = configClient.get("EXPORT_DIFF_PATH");
-
 
47
			EXPORT_SOLR_PATH = configClient.get("EXPORT_SOLR_PATH");  
-
 
48
 
-
 
49
			JYTHON_SRC_PATH =  configClient.get("JYTHON_SRC_PATH");
38
		}catch(Exception ex){
50
		}catch(Exception ex){
39
			ex.printStackTrace();
51
			ex.printStackTrace();
40
			CONTENT_DB_PATH = "/var/lib/tomcat6/webapps/db/entities/";
52
			CONTENT_DB_PATH = "/var/lib/tomcat6/webapps/db/entities/";
41
			MEDIA_DB_PATH =	"/var/lib/tomcat6/webapps/db/media/";
53
			MEDIA_DB_PATH =	"/var/lib/tomcat6/webapps/db/media/";
42
			DEFINITIONS_DB_PATH =	"/var/lib/tomcat6/webapps/db/definitions/";
54
			DEFINITIONS_DB_PATH =	"/var/lib/tomcat6/webapps/db/definitions/";
43
			ENTITIES_DB_PATH =  "/var/lib/tomcat6/webapps/db/entities/";
55
			ENTITIES_DB_PATH =  "/var/lib/tomcat6/webapps/db/entities/";
44
			COMPARISONS_DB_PATH = "/var/lib/tomcat6/webapps/db/comparisons/";
56
			COMPARISONS_DB_PATH = "/var/lib/tomcat6/webapps/db/comparisons/";
-
 
57
 
-
 
58
			/**
-
 
59
			 * IR XML export path
-
 
60
			 */
-
 
61
 
-
 
62
			EXPORT_IR_PATH = "/var/lib/tomcat6/webapps/export/ir/";
-
 
63
			EXPORT_ENTITIES_PATH =	"/var/lib/tomcat6/webapps/export/html/entities/";
-
 
64
			EXPORT_DEFINITIONS_PATH = "/var/lib/tomcat6/webapps/export/html/definitions/";
-
 
65
			EXPORT_CATEGORY_HOMES_PATH = "/var/lib/tomcat6/webapps/export/html/category_homes/";
-
 
66
			EXPORT_DIFF_PATH =	"/var/lib/tomcat6/webapps/export/html/diff/";
-
 
67
			EXPORT_SOLR_PATH =	"/var/lib/tomcat6/webapps/export/solr/";
-
 
68
 
-
 
69
			/*
-
 
70
			EXPORT_IR_PATH = currentDir + "/export/ir/";
-
 
71
			EXPORT_ENTITIES_PATH =	currentDir + "/export/html/entities/";
-
 
72
			EXPORT_DEFINITIONS_PATH =	currentDir + "/export/html/definitions/";
-
 
73
			EXPORT_CATEGORY_HOMES_PATH = currentDir + "/export/html/category_homes/";
-
 
74
			EXPORT_DIFF_PATH =	currentDir + "/export/html/diff/";
-
 
75
			EXPORT_SOLR_PATH = currentDir + "/export/solr/";
-
 
76
			*/
45
			}
77
		}
46
 
78
 
47
		}
79
		}
48
	
80
	
49
	//Next some paths are somewhat hardcoded need to check when gets time. But they will be used only first time and in utility classes.
81
	//Next some paths are somewhat hardcoded need to check when gets time. But they will be used only first time and in utility classes.
50
	/**
82
	/**
Line 57... Line 89...
57
	public static final String CONTENT_SRC_PPT_PATH = currentDir + "/content/ppt/";
89
	public static final String CONTENT_SRC_PPT_PATH = currentDir + "/content/ppt/";
58
	/**
90
	/**
59
	 * Path where exported HTML files are kept
91
	 * Path where exported HTML files are kept
60
	 */
92
	 */
61
	public static final String CONTENT_SRC_HTML_PATH =	currentDir + "/content/html/";
93
	public static final String CONTENT_SRC_HTML_PATH =	currentDir + "/content/html/";
62
	/**
-
 
63
	 * IR XML export path
-
 
64
	 */
-
 
65
	public static final String EXPORT_IR_PATH = currentDir + "/export/ir/";
-
 
66
	public static final String EXPORT_ENTITIES_PATH =	currentDir + "/export/html/entities/";
-
 
67
	public static final String EXPORT_DEFINITIONS_PATH =	currentDir + "/export/html/definitions/";
-
 
68
	public static final String EXPORT_CATEGORY_HOMES_PATH = currentDir + "/export/html/category_homes/";
-
 
69
	public static final String EXPORT_DIFF_PATH =	currentDir + "/export/html/diff/";
-
 
70
	
94
 
71
	public static final String EXPORT_SOLR_PATH = currentDir + "/export/solr/";
-
 
72
		
95
		
73
	public static String VTL_SRC_PATH = "src/velocity/";
96
	public static String VTL_SRC_PATH = "src/velocity/";
-
 
97
	public static String JYTHON_SRC_PATH = "src/jython/";
-
 
98
	
-
 
99
	//to be used in case of web
-
 
100
	//public static String JYTHON_SRC_PATH = Utils.class.getClassLoader().getResource("jython").getPath();
-
 
101
	
-
 
102
 
74
	
103
	
75
	/**
104
	/**
76
	 * Jython source path
105
	 * Jython source path
77
	 */
106
	 */
78
	public static String JYTHON_SRC_PATH = "src/jython/";
107
//	public static String JYTHON_SRC_PATH = "src/jython/";
-
 
108
 
79
	
109
	
80
	public static long SNIPPETS_FEATURE_DEFINITIONID = 120081;
110
	public static long SNIPPETS_FEATURE_DEFINITIONID = 120081;
81
	
111
	
82
	
112
	
83
	/**
113
	/**