- Table of contents
- Specification
- Programming Guide
- Methods
Specification¶
Programming Guide¶
Jar version¶
version | Description |
---|---|
1.0 | Init |
1.3 | Fixed Connection issue |
1.3.1 | Removed extra printout |
Jar File Download¶
Test Link¶
https://202.129.164.38:9093/TestPage/page/keyword/addKeyword
Diagram¶
Database Table¶
CREATE TABLE KEYWORD_PRODUCT ( KEYWORD_REF_NO INTEGER NOT NULL, KEYWORD VARCHAR(50) NOT NULL, STATUS VARCHAR(2) DEFAULT 'A', CREATE_BY VARCHAR(15) NOT NULL, CREATE_DATETIME TIMESTAMP DEFAULT CURRENT_TIMESTAMP, MODIFY_BY VARCHAR(15), MODIFY_DATETIME TIMESTAMP, PRIMARY KEY (KEYWORD_REF_NO)) CREATE UNIQUE INDEX UI_PROD_KEYWORD ON KEYWORD_PRODUCT(KEYWORD)
CREATE TABLE KEYWORD_PRODUCT_PATTERN ( PRODUCT_REF_NO INTEGER NOT NULL, KEYWORD_REF_NO INTEGER NOT NULL, PRIORITY INTEGER NOT NULL, STATUS VARCHAR(2) DEFAULT 'A', CREATE_BY VARCHAR(15) NOT NULL, CREATE_DATETIME TIMESTAMP DEFAULT CURRENT_TIMESTAMP, MODIFY_BY VARCHAR(15), MODIFY_DATETIME TIMESTAMP, PRIMARY KEY (PRODUCT_REF_NO,KEYWORD_REF_NO,PRIORITY)) CREATE INDEX IX_KEYWORD_PRODUCT_PATTERN_STATUS ON KEYWORD_PRODUCT_PATTERN(STATUS)
CREATE TABLE KEYWORD_PRODUCT_PATTERN_AUDIT ( PRODUCT_REF_NO INTEGER NOT NULL, KEYWORD_REF_NO INTEGER NOT NULL, PRIORITY INTEGER NOT NULL, STATUS VARCHAR(2) DEFAULT 'A', CREATE_BY VARCHAR(15) NOT NULL, CREATE_DATETIME TIMESTAMP DEFAULT CURRENT_TIMESTAMP, MODIFY_BY VARCHAR(15), MODIFY_DATETIME TIMESTAMP, PRIMARY KEY (PRODUCT_REF_NO,KEYWORD_REF_NO,PRIORITY))
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) CREATE INDEX IX_KEYWORD_SEARCH_PRODUCT_ ON KEYWORD_SEARCH_PRODUCT(SHOPPER_REF_NO,SEARCH_TYPE)
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))
Methods¶
Keyword¶
com.cosway.keyword.service.KeywordService service = new com.cosway.keyword.service.KeywordService();
boolean added = service.addProductKeyword(Connection conn, KeywordBean keywordBean)
boolean updated = service.updateKeywordByRefNo(Connection conn, KeywordBean keywordBean)
KeywordBean
- Keyword -
- Status -
- User - Who perform the action
boolean updated = service.updateKeywordStatus(Connection conn, int keywordRefNo, String status)
KeywordBean = service.getKeywordBeanByRefNo();
int totalRecord = service.getKeywordActiveTotal(Connection conn)
int totalRecord = service.getTotalKeywordInActive(Connection conn)
int totalRecord = service.getTotalKeywordAll(Connection conn)
int totalRecord = service.getTotalKeywordPrefix(Connection conn, String search)
int totalRecord = service.getTotalKeywordwildcard(Connection conn, String search)
List<KeywordBean> keywordList = getKeywordActiveList(Connection conn, int startFrom, int totalRecord )
List<KeywordBean> keywordList = service.getKeywordAInActiveList(Connection conn, int startFrom, int totalRecord )
List<KeywordBean> keywordList = service.getKeywordAllList(Connection conn, int startFrom, int totalRecord )
List<KeywordBean> keywordList = service.getKeywordPrefixList(Connection conn, String search, int startFrom, int totalRecord )
List<KeywordBean> keywordList = service.getKeywordwildcardList(Connection conn, String search, int startFrom, int totalRecord )
NOTE : startFrom & totalRecord are optional field
Product¶
com.cosway.keyword.service.ProductService service = new com.cosway.keyword.service.ProductService();
boolean added = service.addProductKeyword(Connection conn, KeywordBean keyword)
boolean updated = service.updateProductStatus(Connection conn, int productRefNo, String status, String user)
boolean updated = service.updateProductStatus(Connection conn, int[] productRefNo, String status, String user)
boolean updated = service.updateAddProductKeywordByProductAndPriority(Connection conn, List<KeywordBean> beanList)
KeywordBean
- productRefNo -
- keywordRefNo -
- priority -
- User - Who perform the action
int totalRecord = service.getTotalProductKeyword(Connection conn)
int totalRecord = service.getTotalProductSetByStatus(Connection conn, String status)
Vector<KeywordBean> productSet = service.getProductKeywordSetByProductRefNo(Connection conn, int productRefNo)
Map<Integer, Vector<KeywordBean>> productMap = service.getProductKeywordMap(Connection conn, int startFrom, int totalRecord )
Vector<Integer> productSet = service.getProductSetByStatus(Connection conn, String status, int startFrom, int totalRecord )
NOTE : startFrom & totalRecord are optional field
- productRefNo -
- keywordRefNo -
- priority -
Add product Keyword¶
com.cosway.keyword.service.PurchaseService service = new com.cosway.keyword.service.PurchaseService();
boolean added = service.addProductPattern(Connection conn, PurchaseBean bean)
- productRefNo -
- searchType - com.cosway.keyword.constant.SearchType [A("All"), P("Purchase"), V("View"), C("Cart"), S("Search"), F("Favourite")]
- shopperRefNo -
Search¶
com.cosway.keyword.service.SearchService service = new com.cosway.keyword.service.SearchService();
Set<Integer> productSet = service.getProductListByType(Connection conn, SearchBean searchBean)
Set<Integer> productSet = service.getProductListByProduct(Connection conn, SearchBean searchBean)
Map<Integer, Integer> productMap = service.getProductRefNoByLevel(Connection conn, SearchBean searchBean)
By Type
- shopperRefNo -
- noOfRecords -
- searchType - com.cosway.keyword.constant.SearchType [A("All"), P("Purchase"), V("View"), C("Cart"), S("Search"), F("Favourite")]
By Level
- shopperRefNo -
- noOfRecords -
- level -
By Product
- productRefNo -
- noOfRecords -
- level - (By Level & Product only)
Updated by Soh Keong about 1 year ago ยท 28 revisions