Commit 8ac9e3f7 authored by kpandey's avatar kpandey

updated

git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@174932 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 03dfac5e
......@@ -38,7 +38,7 @@ import proteus.ecm.hibernate.dao.CategoryDAO;
import proteus.ecm.hibernate.dao.ProductDAO;
import proteus.ecm.hibernate.dao.SystemMasterDAO;
@Path("/category")
@Path("/{siteCode}/category")
public class CategoryService
{
@Context
......@@ -49,14 +49,17 @@ public class CategoryService
private CategoryCache categoryCache = new CategoryCache();
private ProductDAO productDao = new ProductDAO();
private ProductCache productCache = new ProductCache();
@PathParam("siteCode") String siteCode;
@GET
@Path("/")
@Produces({ "application/xml", "application/json" })
public List<ECMCategory> getCategories()
{
String cacheName = getCacheName();
String siteCode = getSiteCode();
//String siteCode = getSiteCode();
System.out.println("\n getCachedCategories");
List<ECMCategory> categories = categoryCache.getCachedCategories( cacheName );
if( categories == null )
......@@ -82,7 +85,7 @@ public class CategoryService
public ECMCategory getCategory(@PathParam("catCode") String catCode)
{
String cacheName = getCacheName();
String siteCode = getSiteCode();
//String siteCode = getSiteCode();
System.out.println("\n getCachedCategory");
ECMCategory category = categoryCache.getCachedCategory(catCode, cacheName);
if( category == null )
......@@ -109,7 +112,7 @@ public class CategoryService
public List<ECMSubCategory> getSubCategories(@PathParam("catCode") String catCode)
{
String cacheName = getCacheName();
String siteCode = getSiteCode();
//String siteCode = getSiteCode();
System.out.println("\n getCachedSubCategories(catCode) for " + siteCode);
List<ECMSubCategory> subCategories = categoryCache.getCachedSubCategories(catCode, cacheName);
if( subCategories == null )
......@@ -135,7 +138,7 @@ public class CategoryService
public List<ECMSubCategory> getSubCategories()
{
String cacheName = getCacheName();
String siteCode = getSiteCode();
//String siteCode = getSiteCode();
System.out.println("\n getCachedSubCategories()");
List<ECMSubCategory> subCategories = categoryCache.getCachedAllSubCategories( cacheName );
......@@ -161,7 +164,7 @@ public class CategoryService
public ECMSubCategory getSubCategory(@PathParam("scatCode") String scatCode)
{
String cacheName = getCacheName();
String siteCode = getSiteCode();
//String siteCode = getSiteCode();
System.out.println("\n getCachedSubCategory(scatCode)");
ECMSubCategory subCategory = categoryCache.getCachedSubCategory(scatCode, cacheName);
if( subCategory == null )
......@@ -190,7 +193,7 @@ public class CategoryService
{
JSONArray itemDetails = new JSONArray();
String cacheName = getCacheName();
String siteCode = getSiteCode();
//String siteCode = getSiteCode();
System.out.println("\n getItems(scatCode)");
List<ItemMaster> items = categoryCache.getCachedItems(siteCode, scatCode, cacheName);
......@@ -298,7 +301,7 @@ public class CategoryService
}
String cacheName = getCacheName();
String siteCode = getSiteCode();
//String siteCode = getSiteCode();
System.out.println("\n getTrendingItems()");
List<ItemMaster> trendItems = categoryCache.getCachedTrendingItems(siteCode, cacheName);
if (trendItems == null)
......@@ -338,7 +341,7 @@ public class CategoryService
public ItemDetails getItemDetail(@PathParam("itemCode") String itemCode) throws JSONException
{
String cacheName = getCacheName();
String siteCode = getSiteCode();
//String siteCode = getSiteCode();
String uniqueId = getUniqueId();
Boolean inCart = false;
Boolean inWishlist = false;
......@@ -392,7 +395,7 @@ public class CategoryService
//TODO - Need to implement logic for suggestions.
String cacheName = getCacheName();
String siteCode = getSiteCode();
//String siteCode = getSiteCode();
List<ItemDetails> itemDetails = null;
System.out.println("\n getItems(scatCode)");
List<ItemMaster> items = categoryCache.getCachedItems(siteCode, scatCode, cacheName);
......@@ -423,7 +426,7 @@ public class CategoryService
}
return itemDetails;
}
/*
private String getSiteCode()
{
HttpSession session = request.getSession();
......@@ -436,7 +439,7 @@ public class CategoryService
}
return null;
}
*/
private String getCacheName()
{
HttpSession session = request.getSession();
......@@ -492,7 +495,7 @@ public class CategoryService
{
JSONObject respObj = new JSONObject();
String cacheName = getCacheName();
String siteCode = getSiteCode();
//String siteCode = getSiteCode();
System.out.println("\n getSideMenus()");
try
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment