Subversion Repositories SmartDukaan

Rev

Rev 9220 | Rev 9281 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 9220 Rev 9269
Line 1... Line 1...
1
package in.shop2020.serving.utils;
1
package in.shop2020.mobileapi.serving.utils;
2
 
2
 
3
import in.shop2020.metamodel.util.ContentPojo;
3
import in.shop2020.metamodel.util.ContentPojo;
4
import in.shop2020.metamodel.util.ProductPojo;
-
 
5
import in.shop2020.serving.pojos.MenuPojo;
-
 
6
import in.shop2020.storage.mongo.StorageManager;
4
import in.shop2020.storage.mongo.StorageManager;
-
 
5
import in.shop2020.metamodel.util.ProductPojo;
-
 
6
import in.shop2020.mobileapi.serving.pojos.MenuPojo;
7
 
7
 
8
import java.util.ArrayList;
8
import java.util.ArrayList;
9
import java.util.List;
9
import java.util.List;
10
 
10
 
11
import org.apache.commons.lang.StringUtils;
11
import org.apache.commons.lang.StringUtils;
Line 95... Line 95...
95
    }
95
    }
96
    
96
    
97
	
97
	
98
	public static ProductPojo getShortContent(long entityId){
98
	public static ProductPojo getShortContent(long entityId){
99
		ContentPojo cp = StorageManager.getById(StorageManager.views.siteContent, entityId, ContentPojo.class);
99
		ContentPojo cp = StorageManager.getById(StorageManager.views.siteContent, entityId, ContentPojo.class);
-
 
100
		ProductPojo pp = null;
-
 
101
		if(cp!=null){
100
		ProductPojo pp = new ProductPojo();
102
			pp = new ProductPojo();
101
		pp.setOfferText(cp.getOfferText());
103
			pp.setOfferText(cp.getOfferText());
102
		pp.setDescription(StringUtils.join(cp.getKeySpecs().subList(0, 3),", "));
104
			pp.setDescription(StringUtils.join(cp.getKeySpecs().subList(0, 3),", "));
103
		pp.setImageUrl(cp.getThumbnailImageUrl());
105
			pp.setImageUrl(cp.getThumbnailImageUrl());
-
 
106
			pp.setUrl(cp.getUrl());
104
		
107
			
105
		pp.setMrp(cp.getMrp());
108
			pp.setMrp(cp.getMrp());
106
		pp.setPrice(cp.getPrice());
109
			pp.setPrice(cp.getPrice());
107
		pp.setTitle(cp.getTitle());
110
			pp.setTitle(cp.getTitle());
108
 
111
		}
109
		return pp;
112
		return pp;
110
	}
113
	}
111
    
114
    
112
}
115
}