Package com.articulate.sigma.dataProc
Class Infrastructure
java.lang.Object
com.articulate.sigma.dataProc.Infrastructure
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionclassclassmaps are old string ID keys and new (SUMO) id valuesclass -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic Connectionstatic intstatic Infrastructurestatic boolean -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetAllowableValues(String subCategory, String rel) getAllowableValuesDB(String subCategory, String rel) getAllowedRelations(String subCategory) getAllowedRelationsDB(String subCategory) getCategories(String productType) getCategoriesDB(String productType) getProducts(Map<String, String> params) getProductsByTypeDB(String subCat) getProductsDB(Map<String, String> params) getSubCategories(String category) getSubCategoriesDB(String category) static voidinitOnce()static voidstatic voidprocessValue(String val, String funcID) process string measures into SUMO formatvoidproductCatJSONtoSUMO(String filenamep, String filenamec, String filenamem, String filenamept) Parse a sample of products and their categories formatted in a JSON.intvoidreadProducts(String filename, Infrastructure.Mappings mappings) A list of products can be very long so parse each JSON object individually so as to provide a status.static voidshowHelp()void
-
Field Details
-
initialized
public static boolean initialized -
inf
-
conn
-
funcIdCounter
public static int funcIdCounter -
relsForType
-
allowableValues
-
productTypes
-
productsByTypeNames
-
products
-
categories
-
parents
-
-
Constructor Details
-
Infrastructure
public Infrastructure()
-
-
Method Details
-
toSUMObyParent
- Throws:
SQLException
-
readProducts
A list of products can be very long so parse each JSON object individually so as to provide a status. -
processValue
process string measures into SUMO format- Throws:
SQLException
-
productCatJSONtoSUMO
public void productCatJSONtoSUMO(String filenamep, String filenamec, String filenamem, String filenamept) throws SQLException Parse a sample of products and their categories formatted in a JSON. Uses JSON API at http://alex-public-doc.s3.amazonaws.com/json_simple-1.1/index.html- Parameters:
filenamep- must be full pathfilenamec- must be full path- Throws:
SQLException
-
getProductTypes
-
getProductTypesDB
-
getCategories
-
getCategoriesDB
-
getSubCategories
-
getSubCategoriesDB
- Throws:
SQLException
-
getAllowedRelations
-
getAllowedRelationsDB
- Throws:
SQLException
-
getAllowableValues
-
getAllowableValuesDB
-
getProducts
-
getProductsByTypeDB
-
productCount
public int productCount()- Returns:
- a count of products
-
getProductsDB
- Parameters:
params- is a map of attribute value pairs of the features being searched for- Returns:
- a list of products
-
initOnce
public static void initOnce() -
initOnceDB
public static void initOnceDB() -
showHelp
public static void showHelp() -
main
-