Subversion Repositories SmartDukaan

Rev

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

Rev 323 Rev 326
Line 1... Line 1...
1
/**
1
/**
2
 * 
2
 * 
3
 */
3
 */
4
package in.shop2020.util;
4
package in.shop2020.util;
5
 
5
 
-
 
6
import in.shop2020.config.ConfigException;
-
 
7
import in.shop2020.thrift.clients.config.ConfigClient;
-
 
8
 
6
import java.util.logging.Logger;
9
import java.util.logging.Logger;
7
 
10
 
8
/**
11
/**
9
 * Utility functions and wrappers 
12
 * Utility functions and wrappers 
10
 * 
13
 * 
11
 * @author naveen
14
 * @author naveen
12
 *
15
 *
13
 */
16
 */
14
public class Utils {
17
public class Utils {
15
	
18
	
16
	// LOCAL	
-
 
17
	/**
-
 
18
	 * Path to XML definitions
-
 
19
	 */
-
 
20
	public static final String DEFINITIONS_SRC_PATH = 
-
 
21
		"/home/naveen/workspace/eclipse/webapp/src/xml/model/";
-
 
22
	
19
		
23
	/**
-
 
24
	 * Path to serialized Definition objects
-
 
25
	 *
20
		
26
	public static final String DEFINITIONS_DB_PATH = 
21
	public static String CONTENT_DB_PATH, DEFINITIONS_DB_PATH, MEDIA_DB_PATH, ENTITIES_DB_PATH, COMPARISONS_DB_PATH;
27
		"/home/naveen/workspace/eclipse/db/definitions/";
22
	public static String currentDir = System.getProperty("user.dir");
28
	
23
	
29
	/**
24
	static{
30
	 * Path to serialized Entity objects
-
 
31
	 *
-
 
32
	public static final String ENTITIES_DB_PATH = 
-
 
33
		"/home/naveen/workspace/eclipse/db/entities/";
-
 
34
 
25
 
-
 
26
		ConfigClient configClient = ConfigClient.getClient();
-
 
27
		
-
 
28
		try {  
35
	/**
29
			/**
36
	 * Path to serialized Entity objects
30
			 * Path to DB... will have lot of references
37
	 *
31
			 */
-
 
32
			CONTENT_DB_PATH = configClient.get("CONTENT_DB_PATH");
-
 
33
			MEDIA_DB_PATH = configClient.get("MEDIA_DB_PATH");
-
 
34
			DEFINITIONS_DB_PATH = configClient.get("DEFINITIONS_DB_PATH");
-
 
35
			ENTITIES_DB_PATH = configClient.get("ENTITIES_DB_PATH");
38
	public static final String COMPARISONS_DB_PATH = 
36
			COMPARISONS_DB_PATH = configClient.get("COMPARISIONS_DB_PATH");
-
 
37
			
-
 
38
		}catch(ConfigException ex){
-
 
39
			ex.printStackTrace();
-
 
40
			CONTENT_DB_PATH = "/var/lib/tomcat6/webapps/db/entities/";
-
 
41
			MEDIA_DB_PATH =	"/var/lib/tomcat6/webapps/db/media/";
-
 
42
			DEFINITIONS_DB_PATH =	"/var/lib/tomcat6/webapps/db/definitions/";
-
 
43
			ENTITIES_DB_PATH =  "/var/lib/tomcat6/webapps/db/entities/";
39
		"/home/naveen/workspace/eclipse/db/comparisons/";
44
			COMPARISONS_DB_PATH = "/var/lib/tomcat6/webapps/db/comparisons/";
-
 
45
			}
40
	*/
46
		}
-
 
47
	
41
	
48
	
-
 
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.
-
 
50
	/**
-
 
51
	 * Path to XML definitions
-
 
52
	 */
-
 
53
	public static final String DEFINITIONS_SRC_PATH = currentDir +  "/src/xml/model/";
42
	/**
54
	/**
43
	 * Path to where PPT files will be picked
55
	 * Path to where PPT files will be picked
44
	 */
56
	 */
45
	public static final String CONTENT_SRC_PPT_PATH = 
57
	public static final String CONTENT_SRC_PPT_PATH = currentDir + "/content/ppt/";
46
		"/home/naveen/workspace/eclipse/content/ppt/";
-
 
47
	
-
 
48
	/**
58
	/**
49
	 * Path where exported HTML files are kept
59
	 * Path where exported HTML files are kept
50
	 */
60
	 */
51
	public static final String CONTENT_SRC_HTML_PATH = 
61
	public static final String CONTENT_SRC_HTML_PATH =	currentDir + "/content/html/";
52
		"/home/naveen/workspace/eclipse/content/html/";
-
 
53
 
-
 
54
	/**
62
	/**
55
	 * IR XML export path
63
	 * IR XML export path
56
	 */
64
	 */
57
	public static String EXPORT_IR_PATH = 
65
	public static final String EXPORT_IR_PATH = currentDir + "/export/ir/";
58
		"/home/naveen/workspace/eclipse/export/ir/";
66
	public static final String EXPORT_ENTITIES_PATH =	currentDir + "/export/html/entities/";
59
	
-
 
60
	// WEB
-
 
61
	public static final String CONTENT_DB_PATH =  
67
	public static final String EXPORT_DEFINITIONS_PATH =	currentDir + "/export/html/definitions/";
62
		"/var/lib/tomcat6/webapps/db/entities/";
68
	public static final String EXPORT_CATEGORY_HOMES_PATH = currentDir + "/export/html/category_homes/";
63
 
-
 
64
	public static final String MEDIA_DB_PATH =  
69
	public static final String EXPORT_DIFF_PATH =	currentDir + "/export/html/diff/";
65
		"/var/lib/tomcat6/webapps/db/media/";
-
 
66
	
70
	
67
	public static final String DEFINITIONS_DB_PATH = 
-
 
68
		"/var/lib/tomcat6/webapps/db/definitions/";
-
 
69
		
-
 
70
	public static final String ENTITIES_DB_PATH = 
-
 
71
		"/var/lib/tomcat6/webapps/db/entities/";
-
 
72
 
-
 
73
	public static final String COMPARISONS_DB_PATH = 
-
 
74
		"/var/lib/tomcat6/webapps/db/comparisons/";
-
 
75
	
71
	
76
	// Validation tool
-
 
77
	/** 
-
 
78
	public static final String CONTENT_DB_PATH = "./db/entities/";
-
 
79
	public static final String DEFINITIONS_DB_PATH = "./db/definitions/";
-
 
80
	public static final String ENTITIES_DB_PATH = "./db/entities/";
-
 
81
	public static final String CONTENT_SRC_PPT_PATH = "./ppt/";
-
 
82
	*/
-
 
83
 
-
 
84
	public static String VTL_SRC_PATH = "src/velocity/";
72
	public static String VTL_SRC_PATH = "src/velocity/";
85
	
73
	
86
	public static String EXPORT_ENTITIES_PATH = 
-
 
87
		"/home/naveen/workspace/eclipse/export/html/entities/";
-
 
88
	
-
 
89
	public static String EXPORT_DEFINITIONS_PATH = 
-
 
90
		"/home/naveen/workspace/eclipse/export/html/definitions/";
-
 
91
 
-
 
92
	public static String EXPORT_CATEGORY_HOMES_PATH = 
-
 
93
		"/home/naveen/workspace/eclipse/export/html/category_homes/";
-
 
94
 
-
 
95
	public static final String EXPORT_DIFF_PATH = 
-
 
96
		"/home/naveen/workspace/eclipse/export/html/diff/";
-
 
97
	
-
 
98
	public static long SNIPPETS_FEATURE_DEFINITIONID = 120081;
-
 
99
	
-
 
100
	/**
74
	/**
101
	 * Jython source path
75
	 * Jython source path
102
	 */
76
	 */
103
	public static String JYTHON_SRC_PATH = "src/jython/";
77
	public static String JYTHON_SRC_PATH = "src/jython/";
104
	
78
	
-
 
79
	public static long SNIPPETS_FEATURE_DEFINITIONID = 120081;
-
 
80
	
-
 
81
	
105
	/**
82
	/**
106
	 * Brand's feature definition, is not referred directly by content models
83
	 * Brand's feature definition, is not referred directly by content models
107
	 */
84
	 */
108
	public static final long BRAND_FEATURE_DEFINITION_ID = 120080;
85
	public static final long BRAND_FEATURE_DEFINITION_ID = 120080;
109
	
86