I have a custom portlet with one dropdown item. Additionally i have a products.json file.
My Requirement
The dropdown shows the products and when the user clicks on a product, the corresponding details are fetched from the json file and displayed.
How do i do that ?
{
"products" : [
{
"id":"prod_1001",
"name":" iPhone 6",
"type":"Mobile",
"asset_tag":"<asset_tag>",
"serial_no":"34238941",
"cost_center":"",
"cpu_count":"2",
"cpu_socket":"8",
"cpu_name":"Intel",
"cpu_type":"core",
"cpu_speed_mhz":"2200",
"disk_gb":"64",
"ram_mb":"2048",
"first_discoverd_date":"",
"recent_discovery_date":"",
"service_start_date":"",
"warrent_expiry_date":"",
"ip_address":"10.10.10.1",
"lease_contract":"",
"lease_start_date":"",
"lease_end_date":"",
"location":"India",
"sku":"IPHONE-6",
"cost":"500",
"currency":"$",
"cpu":"",
"power_supply":"12v",
"hard_drive":"1",
"memory":[
{
"memory_type":"ram",
"sku":"RAM-4GB"
},
{
"memory_type":"Internal",
"sku":"INTERNAL-128GB"
}
],
"warranty_expiration":"",
"gps_location":"India",
"network_domain":"domain",
"network_segment":"segment",
"group":"Product",
"company":"Apple"
},
{
"id":"prod_1005",
"name":"Nokia",
"type":"Mobile",
"asset_tag":"<asset_tag>",
"serial_no":"34238941",
"cost_center":"",
"cpu_count":"2",
"cpu_socket":"8",
"cpu_name":"Intel",
"cpu_type":"core",
"cpu_speed_mhz":"2200",
"disk_gb":"32",
"ram_mb":"2048",
"first_discoverd_date":"",
"recent_discovery_date":"",
"service_start_date":"",
"warrent_expiry_date":"",
"ip_address":"10.10.10.1",
"lease_contract":"",
"lease_start_date":"",
"lease_end_date":"",
"location":"India",
"sku":"IPHONE-6",
"cost":"500",
"currency":"$",
"cpu":"",
"power_supply":"12v",
"hard_drive":"1",
"memory":[
{
"memory_type":"ram",
"sku":"RAM-4GB"
},
{
"memory_type":"Internal",
"sku":"INTERNAL-128GB"
}
],
"warranty_expiration":"",
"gps_location":"India",
"network_domain":"domain",
"network_segment":"segment",
"group":"Product",
"company":"Microsoft"
},