Project

General

Profile

Wiki » History » Revision 4

Revision 3 (Soh Keong, 06/11/2021 04:20 PM) → Revision 4/28 (Soh Keong, 06/11/2021 04:44 PM)

{{toc}} 

 h1. Specification 

 h1. Activity Diagram 
 !FlowChart.jpg! 

 h1. Programming Guide 

 h2. Jar version  

 |_. version |_. Description    | 
 | 1.0         | Init             | 

 h2. Jar File Download 

 "Jar": 

 h2. Database Table 

 <pre> 
 CREATE TABLE KEYWORD_PRODUCT ( 
	 KEYWORD_REF_NO INTEGER NOT NULL, 
	 KEYWORD VARCHAR(50) NOT NULL, 
	 STATUS VARCHAR(2) DEFAULT 'A',  
	 CREATE_DATETIME TIMESTAMP DEFAULT CURRENT_TIMESTAMP, 
	 MODIFY_DATETIME TIMESTAMP, 
	 PRIMARY KEY (KEYWORD_REF_NO)) 

 CREATE UNIQUE INDEX UI_PROD_KEYWORD ON KEYWORD_PRODUCT(KEYWORD) 
 </pre> 

 <pre> 
 CREATE TABLE KEYWORD_PRODUCT_PATTERN ( 
	 PRODUCT_REF_NO INTEGER NOT NULL, 
	 KEYWORD_REF_NO INTEGER NOT NULL, 
	 PRIORITY INTEGER, 
	 STATUS VARCHAR(2) DEFAULT 'A',  
	 CREATE_DATETIME TIMESTAMP DEFAULT CURRENT_TIMESTAMP, 
	 MODIFY_DATETIME TIMESTAMP, 
	 PRIMARY KEY (PRODUCT_REF_NO,KEYWORD_REF_NO)) 
	
 CREATE INDEX IX_KEYWORD_PRODUCT_PATTERN_PRIO ON KEYWORD_PRODUCT_PATTERN(PRIORITY) 
 CREATE INDEX IX_KEYWORD_PRODUCT_PATTERN_STATUS ON KEYWORD_PRODUCT_PATTERN(STATUS) 
 </pre> 

 <pre> 
 CREATE TABLE KEYWORD_SEARCH_PRODUCT ( 
	 PRODUCT_REF_NO INTEGER NOT NULL, 
	 SHOPPER_REF_NO INTEGER NOT NULL, 
	 SEARCH_TYPE VARCHAR(5) NOT NULL,  
	 CREATE_DATETIME TIMESTAMP DEFAULT CURRENT_TIMESTAMP, 
	 MODIFY_DATETIME TIMESTAMP, 
	 PRIMARY KEY (PRODUCT_REF_NO,SHOPPER_REF_NO,SEARCH_TYPE)) 
	
 CREATE INDEX IX_KEYWORD_SEARCH_PRODUCT_MODI ON KEYWORD_SEARCH_PRODUCT(MODIFY_DATETIME) 
 </pre> 

 <pre> 
 CREATE TABLE KEYWORD_SEARCH_PATTERN ( 
	 SHOPPER_REF_NO INTEGER NOT NULL, 
	 KEYWORD_REF_NO INTEGER NOT NULL, 
	 PRIORITY INTEGER NOT NULL, 
	 CREATE_DATETIME TIMESTAMP DEFAULT CURRENT_TIMESTAMP, 
	 MODIFY_DATETIME TIMESTAMP, 
	 PRIMARY KEY (SHOPPER_REF_NO, KEYWORD_REF_NO, PRIORITY)) 

 CREATE INDEX IX_KEYWORD_SEARCH_PATTERN_MODIFY ON KEYWORD_SEARCH_PATTERN(MODIFY_DATETIME) 
 </pre> 

 h1. Methods 

 h2. Maintenance  

 <pre> 
 com.cosway.keyword.service.KeywordService service = new com.cosway.keyword.service.KeywordService(); 
 </pre> 

 h3. Keyword 

 <pre> 
 boolean                added        = addKeyword(Connection conn, String keyword) 
 boolean                updated      = updateKeywordStatus(Connection conn, int keywordRefNo, String status) 
 Map<Integer, String> KeywordMap = getKeywordAInActiveMap(Connection conn)  
 Map<Integer, String> KeywordMap = getKeywordAllMap(Connection conn) 
 Map<Integer, String> KeywordMap = getKeywordPrefixMap(Connection conn, String search) 
 Map<Integer, String> KeywordMap = getKeywordwildcardMap(Connection conn, String search) 
 </pre> 

 h3. Product 

 <pre> 
 boolean                          added        = addProductKeyword(Connection conn, KeywordBean keyword) 
 boolean                          updated      = updateProductStatus(Connection conn, int productRefNo, String status) 
 Map<Integer, Set<KeywordBean>> productMap = getProductKeywordMap(Connection conn) 
 Set<KeywordBean>                 productSet = getProductKeywordSetByProductRefNo(Connection conn, int productRefNo) 
 Set<Integer>                     productSet = getProductSetByStatus(Connection conn, String status) 
 </pre> 

 h3. Add product Keyword 

 <pre> 
 boolean added = addProductPattern(Connection conn, PurchaseBean bean) 
 </pre> 

 h3. Search 

 <pre> 
 Set<Integer>            productSet = getProductListByType(Connection conn, SearchBean searchBean) 
 Map<Integer, Integer> productMap = getProductRefNoByLevel(Connection conn, SearchBean searchBean) 
 </pre>