proj_name
stringclasses
131 values
relative_path
stringlengths
30
228
class_name
stringlengths
1
68
func_name
stringlengths
1
48
masked_class
stringlengths
78
9.82k
func_body
stringlengths
46
9.61k
len_input
int64
29
2.01k
len_output
int64
14
1.94k
total
int64
55
2.05k
relevant_context
stringlengths
0
38.4k
shopizer-ecommerce_shopizer
shopizer/sm-shop/src/main/java/com/salesmanager/shop/mapper/catalog/ReadableManufacturerMapper.java
ReadableManufacturerMapper
convert
class ReadableManufacturerMapper implements Mapper<Manufacturer, ReadableManufacturer> { @Override public ReadableManufacturer convert(Manufacturer source, MerchantStore store, Language language) {<FILL_FUNCTION_BODY>} private Optional<com.salesmanager.shop.model.catalog.manufacturer.ManufacturerDescription> ge...
if(language == null) { language = store.getDefaultLanguage(); } ReadableManufacturer target = new ReadableManufacturer(); Optional<com.salesmanager.shop.model.catalog.manufacturer.ManufacturerDescription> description = getDescription(source, language, target); description.ifPresent(target::se...
535
201
736
<no_super_class>
shopizer-ecommerce_shopizer
shopizer/sm-shop/src/main/java/com/salesmanager/shop/mapper/catalog/ReadableMinimalProductMapper.java
ReadableMinimalProductMapper
convert
class ReadableMinimalProductMapper implements Mapper<Product, ReadableMinimalProduct> { @Autowired private PricingService pricingService; @Autowired @Qualifier("img") private ImageFilePath imageUtils; @Override public ReadableMinimalProduct convert(Product source, MerchantStore store, Language language) {<F...
// TODO Auto-generated method stub ReadableMinimalProduct minimal = new ReadableMinimalProduct(); return this.merge(source, minimal, store, language);
1,259
44
1,303
<no_super_class>
shopizer-ecommerce_shopizer
shopizer/sm-shop/src/main/java/com/salesmanager/shop/mapper/catalog/ReadableProductAttributeMapper.java
ReadableProductAttributeMapper
convert
class ReadableProductAttributeMapper implements Mapper<ProductAttribute, ReadableProductAttributeEntity> { @Autowired private ReadableProductOptionMapper readableProductOptionMapper; @Autowired private ReadableProductOptionValueMapper readableProductOptionValueMapper; @Autowired private PricingService pricing...
ReadableProductAttributeEntity productAttribute = new ReadableProductAttributeEntity(); return merge(source, productAttribute, store, language);
584
35
619
<no_super_class>
shopizer-ecommerce_shopizer
shopizer/sm-shop/src/main/java/com/salesmanager/shop/mapper/catalog/ReadableProductImageMapper.java
ReadableProductImageMapper
merge
class ReadableProductImageMapper implements Mapper<ProductImage, ReadableImage> { @Inject @Qualifier("img") private ImageFilePath imageUtils; @Override public ReadableImage convert(ProductImage source, MerchantStore store, Language language) { ReadableImage destination = new ReadableImage(); return merge(s...
String contextPath = imageUtils.getContextPath(); destination.setImageName(source.getProductImage()); destination.setDefaultImage(source.isDefaultImage()); destination.setOrder(source.getSortOrder() != null ? source.getSortOrder().intValue() : 0); if (source.getImageType() == 1 && source.getProductIma...
138
317
455
<no_super_class>
shopizer-ecommerce_shopizer
shopizer/sm-shop/src/main/java/com/salesmanager/shop/mapper/catalog/ReadableProductOptionMapper.java
ReadableProductOptionMapper
merge
class ReadableProductOptionMapper implements Mapper<ProductOption, ReadableProductOptionEntity> { @Override public ReadableProductOptionEntity convert(ProductOption source, MerchantStore store, Language language) { ReadableProductOptionEntity destination = new ReadableProductOptionEntity(); return me...
ReadableProductOptionEntity readableProductOption = new ReadableProductOptionEntity(); if(language == null) { readableProductOption = new ReadableProductOptionFull(); List<com.salesmanager.shop.model.catalog.product.attribute.ProductOptionDescription> descriptions = new ArrayList<com.salesmanager.s...
273
376
649
<no_super_class>
shopizer-ecommerce_shopizer
shopizer/sm-shop/src/main/java/com/salesmanager/shop/mapper/catalog/ReadableProductOptionSetMapper.java
ReadableProductOptionSetMapper
convert
class ReadableProductOptionSetMapper implements Mapper<ProductOptionSet, ReadableProductOptionSet> { @Autowired private ReadableProductTypeMapper readableProductTypeMapper; @Override public ReadableProductOptionSet convert(ProductOptionSet source, MerchantStore store, Language language) {<FILL_FUNCTION_BODY>}...
ReadableProductOptionSet optionSource = new ReadableProductOptionSet(); return merge(source, optionSource, store, language);
942
35
977
<no_super_class>
shopizer-ecommerce_shopizer
shopizer/sm-shop/src/main/java/com/salesmanager/shop/mapper/catalog/ReadableProductOptionValueMapper.java
ReadableProductOptionValueMapper
merge
class ReadableProductOptionValueMapper implements Mapper<ProductOptionValue, ReadableProductOptionValue> { @Autowired @Qualifier("img") private ImageFilePath imageUtils; @Override public ReadableProductOptionValue merge(ProductOptionValue source, ReadableProductOptionValue destination, ...
ReadableProductOptionValue readableProductOptionValue = new ReadableProductOptionValue(); if(language == null) { readableProductOptionValue = new ReadableProductOptionValueFull(); List<com.salesmanager.shop.model.catalog.product.attribute.ProductOptionValueDescription> descriptions = new ArrayList<c...
300
494
794
<no_super_class>
shopizer-ecommerce_shopizer
shopizer/sm-shop/src/main/java/com/salesmanager/shop/mapper/catalog/ReadableProductTypeMapper.java
ReadableProductTypeMapper
merge
class ReadableProductTypeMapper implements Mapper<ProductType, ReadableProductType> { @Override public ReadableProductType convert(ProductType source, MerchantStore store, Language language) { ReadableProductType type = new ReadableProductType(); return this.merge(source, type, store, language); } @Override ...
Validate.notNull(source, "ProductType cannot be null"); Validate.notNull(destination, "ReadableProductType cannot be null"); return type(source, language);
595
51
646
<no_super_class>
shopizer-ecommerce_shopizer
shopizer/sm-shop/src/main/java/com/salesmanager/shop/mapper/catalog/ReadableProductVariationMapper.java
ReadableProductVariationMapper
optionValue
class ReadableProductVariationMapper implements Mapper<ProductVariation, ReadableProductVariation> { @Override public ReadableProductVariation convert(ProductVariation source, MerchantStore store, Language language) { ReadableProductVariation variation = new ReadableProductVariation(); return merge(source, var...
ReadableProductOptionValue value = new ReadableProductOptionValue(); value.setCode(val.getCode()); value.setId(val.getId()); ProductOptionValueDescription desc = optionValueDescription(val.getDescriptions(), language); if(desc!=null) { value.setName(desc.getName()); } return value;
578
99
677
<no_super_class>
shopizer-ecommerce_shopizer
shopizer/sm-shop/src/main/java/com/salesmanager/shop/mapper/catalog/product/PersistableProductAvailabilityMapper.java
PersistableProductAvailabilityMapper
merge
class PersistableProductAvailabilityMapper implements Mapper<PersistableProductInventory, ProductAvailability> { @Override public ProductAvailability convert(PersistableProductInventory source, MerchantStore store, Language language) { return this.merge(source, new ProductAvailability(), store, language); } @Ov...
try { destination.setRegion(Constants.ALL_REGIONS); destination.setProductQuantity(source.getQuantity()); destination.setProductQuantityOrderMin(1); destination.setProductQuantityOrderMax(1); if (source.getPrice() != null) { ProductPrice price = new ProductPrice(); price.setProductAvailab...
124
585
709
<no_super_class>
shopizer-ecommerce_shopizer
shopizer/sm-shop/src/main/java/com/salesmanager/shop/mapper/catalog/product/PersistableProductVariantGroupMapper.java
PersistableProductVariantGroupMapper
merge
class PersistableProductVariantGroupMapper implements Mapper<PersistableProductVariantGroup, ProductVariantGroup>{ @Autowired private ProductVariantService productVariantService; @Autowired private ProductVariantImageService productVariantImageService; @Override public ProductVariantGroup convert(Persistab...
Validate.notNull(source, "PersistableproductVariantGroup cannot be null"); Validate.notNull(store, "MerchantStore cannot be null"); Validate.notNull(language, "Language cannot be null"); Validate.notNull(source.getproductVariants(), "Product instances cannot be null"); if(destination == null) { des...
284
308
592
<no_super_class>
shopizer-ecommerce_shopizer
shopizer/sm-shop/src/main/java/com/salesmanager/shop/mapper/catalog/product/PersistableProductVariantMapper.java
PersistableProductVariantMapper
merge
class PersistableProductVariantMapper implements Mapper<PersistableProductVariant, ProductVariant> { @Autowired private ProductVariationService productVariationService; @Autowired private PersistableProductAvailabilityMapper persistableProductAvailabilityMapper; @Autowired private ProductService productServ...
// Long productVariation = source.getVariation(); Long productVariationValue = source.getVariationValue(); String productVariationCode = source.getVariationCode(); String productVariationValueCode = source.getVariationValueCode(); Optional<ProductVariation> variation = null; Optional<ProductVari...
195
1,114
1,309
<no_super_class>
shopizer-ecommerce_shopizer
shopizer/sm-shop/src/main/java/com/salesmanager/shop/mapper/catalog/product/ReadableProductVariantGroupMapper.java
ReadableProductVariantGroupMapper
convert
class ReadableProductVariantGroupMapper implements Mapper<ProductVariantGroup, ReadableProductVariantGroup> { @Autowired private ReadableProductVariantMapper readableProductVariantMapper; @Inject @Qualifier("img") private ImageFilePath imageUtils; @Override public ReadableProductVariantGroup convert(Produ...
Validate.notNull(source, "productVariantGroup cannot be null"); Validate.notNull(store, "MerchantStore cannot be null"); Validate.notNull(language, "Language cannot be null"); return this.merge(source, new ReadableProductVariantGroup(), store, language);
668
80
748
<no_super_class>
shopizer-ecommerce_shopizer
shopizer/sm-shop/src/main/java/com/salesmanager/shop/mapper/catalog/product/ReadableProductVariantMapper.java
ReadableProductVariantMapper
merge
class ReadableProductVariantMapper implements Mapper<ProductVariant, ReadableProductVariant> { @Autowired private ReadableProductVariationMapper readableProductVariationMapper; @Autowired private ReadableInventoryMapper readableInventoryMapper; @Inject @Qualifier("img") private ImageFilePath imagUtils; ...
Validate.notNull(source, "Product instance cannot be null"); Validate.notNull(source.getProduct(), "Product cannot be null"); if(destination == null) { destination = new ReadableProductVariant(); } destination.setSortOrder(source.getSortOrder() != null ? source.getSortOrder().intValue():0); des...
334
632
966
<no_super_class>
shopizer-ecommerce_shopizer
shopizer/sm-shop/src/main/java/com/salesmanager/shop/mapper/customer/ReadableCustomerMapper.java
ReadableCustomerMapper
merge
class ReadableCustomerMapper implements Mapper<Customer, ReadableCustomer> { @Override public ReadableCustomer convert(Customer source, MerchantStore store, Language language) { ReadableCustomer destination = new ReadableCustomer(); return this.merge(source, destination, store, language); } @Override public...
if(source.getId()!=null && source.getId()>0) { target.setId(source.getId()); } target.setEmailAddress(source.getEmailAddress()); if (StringUtils.isNotEmpty(source.getNick())) { target.setUserName(source.getNick()); } if (source.getDefaultLanguage()!= null) { target.setLanguage(source.getDefault...
117
1,436
1,553
<no_super_class>
shopizer-ecommerce_shopizer
shopizer/sm-shop/src/main/java/com/salesmanager/shop/mapper/inventory/PersistableProductPriceMapper.java
PersistableProductPriceMapper
merge
class PersistableProductPriceMapper implements Mapper<PersistableProductPrice, ProductPrice> { @Autowired private LanguageService languageService; @Autowired private ProductService productService; @Autowired private ProductAvailabilityService productAvailabilityService; @Override public ProductPrice convert...
Validate.notNull(source, "PersistableProductPrice cannot be null"); Validate.notNull(source.getSku(), "Product sku cannot be null"); try { if (destination == null) { destination = new ProductPrice(); } destination.setId(source.getId()); /** * Get product availability and verify the exi...
693
996
1,689
<no_super_class>
shopizer-ecommerce_shopizer
shopizer/sm-shop/src/main/java/com/salesmanager/shop/mapper/inventory/ReadableInventoryMapper.java
ReadableInventoryMapper
store
class ReadableInventoryMapper implements Mapper<ProductAvailability, ReadableInventory> { @Autowired private PricingService pricingService; @Autowired private ReadableMerchantStorePopulator readableMerchantStorePopulator; @Override public ReadableInventory convert(ProductAvailability source, MerchantStore stor...
if (language == null) { language = store.getDefaultLanguage(); } /* * ReadableMerchantStorePopulator populator = new * ReadableMerchantStorePopulator(); * populator.setCountryService(countryService); * populator.setZoneService(zoneService); */ return readableMerchantStorePopulator.populate(st...
1,039
110
1,149
<no_super_class>
shopizer-ecommerce_shopizer
shopizer/sm-shop/src/main/java/com/salesmanager/shop/mapper/optin/PersistableOptinMapper.java
PersistableOptinMapper
convert
class PersistableOptinMapper implements Mapper<PersistableOptin, Optin> { @Override public Optin convert(PersistableOptin source, MerchantStore store, Language language) {<FILL_FUNCTION_BODY>} @Override public Optin merge(PersistableOptin source, Optin destination, MerchantStore store, ...
Optin optinEntity = new Optin(); optinEntity.setCode(source.getCode()); optinEntity.setDescription(source.getDescription()); optinEntity.setOptinType(OptinType.valueOf(source.getOptinType())); optinEntity.setMerchant(store); return optinEntity;
118
94
212
<no_super_class>
shopizer-ecommerce_shopizer
shopizer/sm-shop/src/main/java/com/salesmanager/shop/mapper/optin/ReadableOptinMapper.java
ReadableOptinMapper
convert
class ReadableOptinMapper implements Mapper<Optin, ReadableOptin> { @Override public ReadableOptin convert(Optin source, MerchantStore store, Language language) {<FILL_FUNCTION_BODY>} @Override public ReadableOptin merge(Optin source, ReadableOptin destination, MerchantStore store, ...
ReadableOptin optinEntity = new ReadableOptin(); optinEntity.setCode(source.getCode()); optinEntity.setDescription(source.getDescription()); optinEntity.setOptinType(source.getOptinType().name()); return optinEntity;
116
80
196
<no_super_class>
shopizer-ecommerce_shopizer
shopizer/sm-shop/src/main/java/com/salesmanager/shop/mapper/order/ReadableOrderProductMapper.java
ReadableOrderProductMapper
merge
class ReadableOrderProductMapper implements Mapper<OrderProduct, ReadableOrderProduct> { @Autowired PricingService pricingService; @Autowired ProductService productService; @Autowired ReadableProductMapper readableProductMapper; @Inject @Qualifier("img") private ImageFilePath imageUtils; @Override publ...
Validate.notNull(source, "OrderProduct cannot be null"); Validate.notNull(target, "ReadableOrderProduct cannot be null"); Validate.notNull(store, "MerchantStore cannot be null"); Validate.notNull(language, "Language cannot be null"); target.setId(source.getId()); target.setOrderedQuantity(source.getProdu...
195
941
1,136
<no_super_class>
shopizer-ecommerce_shopizer
shopizer/sm-shop/src/main/java/com/salesmanager/shop/mapper/order/ReadableOrderTotalMapper.java
ReadableOrderTotalMapper
merge
class ReadableOrderTotalMapper implements Mapper<OrderTotal, ReadableOrderTotal> { @Autowired private PricingService pricingService; @Autowired private LabelUtils messages; @Override public ReadableOrderTotal convert(OrderTotal source, MerchantStore store, Language language) { ReadableOrderTotal destination ...
Validate.notNull(source, "OrderTotal must not be null"); Validate.notNull(target, "ReadableTotal must not be null"); Validate.notNull(store, "MerchantStore must not be null"); Validate.notNull(language, "Language must not be null"); Locale locale = LocaleUtils.getLocale(language); try { target.setCo...
153
330
483
<no_super_class>
shopizer-ecommerce_shopizer
shopizer/sm-shop/src/main/java/com/salesmanager/shop/mapper/tax/PersistableTaxClassMapper.java
PersistableTaxClassMapper
merge
class PersistableTaxClassMapper implements Mapper<PersistableTaxClass, TaxClass> { @Override public TaxClass convert(PersistableTaxClass source, MerchantStore store, Language language) { Validate.notNull(source, "PersistableTaxClass cannot be null"); Validate.notNull(store, "MerchantStore cannot be null"); Tax...
Validate.notNull(source, "PersistableTaxClass cannot be null"); Validate.notNull(destination, "TaxClass cannot be null"); Validate.notNull(store, "MerchantStore cannot be null"); destination.setCode(source.getCode()); if(source.getId()!=null && source.getId().longValue() > 0) { destination.setId(source...
202
150
352
<no_super_class>
shopizer-ecommerce_shopizer
shopizer/sm-shop/src/main/java/com/salesmanager/shop/mapper/tax/PersistableTaxRateMapper.java
PersistableTaxRateMapper
taxRate
class PersistableTaxRateMapper implements Mapper<PersistableTaxRate, TaxRate> { @Autowired private CountryService countryService; @Autowired private ZoneService zoneService; @Autowired private LanguageService languageService; @Autowired private TaxClassService taxClassService; @Override public TaxR...
//List<com.salesmanager.core.model.tax.taxrate.TaxRateDescription> descriptions = new ArrayList<com.salesmanager.core.model.tax.taxrate.TaxRateDescription>(); if(!CollectionUtils.isEmpty(source.getDescriptions())) { for(TaxRateDescription desc : source.getDescriptions()) { com.salesman...
707
339
1,046
<no_super_class>
shopizer-ecommerce_shopizer
shopizer/sm-shop/src/main/java/com/salesmanager/shop/mapper/tax/ReadableTaxClassMapper.java
ReadableTaxClassMapper
convert
class ReadableTaxClassMapper implements Mapper<TaxClass, ReadableTaxClass> { @Override public ReadableTaxClass convert(TaxClass source, MerchantStore store, Language language) {<FILL_FUNCTION_BODY>} @Override public ReadableTaxClass merge(TaxClass source, ReadableTaxClass destination, MerchantStore store, ...
ReadableTaxClass taxClass = new ReadableTaxClass(); taxClass.setId(source.getId()); taxClass.setCode(source.getCode()); taxClass.setName(source.getTitle()); taxClass.setStore(store.getCode()); return taxClass;
156
80
236
<no_super_class>
shopizer-ecommerce_shopizer
shopizer/sm-shop/src/main/java/com/salesmanager/shop/mapper/tax/ReadableTaxRateMapper.java
ReadableTaxRateMapper
convertDescription
class ReadableTaxRateMapper implements Mapper<TaxRate, ReadableTaxRate> { @Override public ReadableTaxRate convert(TaxRate source, MerchantStore store, Language language) { ReadableTaxRate taxRate = new ReadableTaxRate(); return this.merge(source, taxRate, store, language); } @Override public ReadableTaxRat...
ReadableTaxRateDescription d = new ReadableTaxRateDescription(); d.setDescription(desc.getDescription()); d.setName(desc.getName()); d.setLanguage(desc.getLanguage().getCode()); d.setDescription(desc.getDescription()); d.setId(desc.getId()); d.setTitle(desc.getTitle()); return d;
486
104
590
<no_super_class>
shopizer-ecommerce_shopizer
shopizer/sm-shop/src/main/java/com/salesmanager/shop/populator/PersistableAuditAspect.java
PersistableAuditAspect
afterReturning
class PersistableAuditAspect { private static final Logger LOGGER = LoggerFactory.getLogger(PersistableAuditAspect.class); @AfterReturning(value = "execution(* populate(..))", returning = "result") public void afterReturning(JoinPoint joinPoint, Object result) {<FILL_FUNCTION_BODY>} }
try { if(result instanceof Auditable) { Auditable entity = (Auditable)result; AuditSection audit = entity.getAuditSection(); if(entity.getAuditSection()==null) { audit = new AuditSection(); } audit.setDateModified(new Date()); Authentication auth = SecurityContext...
101
276
377
<no_super_class>
shopizer-ecommerce_shopizer
shopizer/sm-shop/src/main/java/com/salesmanager/shop/populator/catalog/PersistableCategoryPopulator.java
PersistableCategoryPopulator
populate
class PersistableCategoryPopulator extends AbstractDataPopulator<PersistableCategory, Category> { @Inject private CategoryService categoryService; @Inject private LanguageService languageService; public void setCategoryService(CategoryService categoryService) { this.categoryService = categoryService; } p...
try { Validate.notNull(target, "Category target cannot be null"); /* Validate.notNull(categoryService, "Requires to set CategoryService"); Validate.notNull(languageService, "Requires to set LanguageService");*/ target.setMerchantStore(store); target.setCode(source.getCode()); target.setSortOrder(sour...
499
1,037
1,536
<methods>public non-sealed void <init>() ,public java.util.Locale getLocale() ,public com.salesmanager.core.model.catalog.category.Category populate(com.salesmanager.shop.model.catalog.category.PersistableCategory, com.salesmanager.core.model.merchant.MerchantStore, com.salesmanager.core.model.reference.language.Langua...
shopizer-ecommerce_shopizer
shopizer/sm-shop/src/main/java/com/salesmanager/shop/populator/catalog/PersistableProductImagePopulator.java
PersistableProductImagePopulator
populate
class PersistableProductImagePopulator extends AbstractDataPopulator<PersistableImage, ProductImage> { private Product product; @Override public ProductImage populate(PersistableImage source, ProductImage target, MerchantStore store, Language language) throws ConversionException {<FILL_FUNCTION_BODY>} @Ove...
Validate.notNull(product,"Must set a product setProduct(Product)"); Validate.notNull(product.getId(),"Product must have an id not null"); Validate.notNull(source.getContentType(),"Content type must be set on persistable image"); target.setDefaultImage(source.isDefaultImage()); target.setImageType(sour...
150
171
321
<methods>public non-sealed void <init>() ,public java.util.Locale getLocale() ,public com.salesmanager.core.model.catalog.product.image.ProductImage populate(com.salesmanager.shop.model.catalog.product.PersistableImage, com.salesmanager.core.model.merchant.MerchantStore, com.salesmanager.core.model.reference.language.L...
shopizer-ecommerce_shopizer
shopizer/sm-shop/src/main/java/com/salesmanager/shop/populator/catalog/PersistableProductOptionPopulator.java
PersistableProductOptionPopulator
populate
class PersistableProductOptionPopulator extends AbstractDataPopulator<PersistableProductOption, ProductOption> { private LanguageService languageService; public LanguageService getLanguageService() { return languageService; } public void setLanguageService(LanguageService languageService) { this.languageS...
Validate.notNull(languageService, "Requires to set LanguageService"); try { target.setMerchantStore(store); target.setProductOptionSortOrder(source.getOrder()); target.setCode(source.getCode()); if(!CollectionUtils.isEmpty(source.getDescriptions())) { Set<com.salesmanager.core.model....
157
389
546
<methods>public non-sealed void <init>() ,public java.util.Locale getLocale() ,public com.salesmanager.core.model.catalog.product.attribute.ProductOption populate(com.salesmanager.shop.model.catalog.product.attribute.PersistableProductOption, com.salesmanager.core.model.merchant.MerchantStore, com.salesmanager.core.mod...
shopizer-ecommerce_shopizer
shopizer/sm-shop/src/main/java/com/salesmanager/shop/populator/catalog/PersistableProductOptionValuePopulator.java
PersistableProductOptionValuePopulator
populate
class PersistableProductOptionValuePopulator extends AbstractDataPopulator<PersistableProductOptionValue, ProductOptionValue> { private LanguageService languageService; public LanguageService getLanguageService() { return languageService; } public void setLanguageService(LanguageService languageService) {...
Validate.notNull(languageService, "Requires to set LanguageService"); try { target.setMerchantStore(store); target.setProductOptionValueSortOrder(source.getOrder()); target.setCode(source.getCode()); if(!CollectionUtils.isEmpty(source.getDescriptions())) { Set<com.salesmanager.cor...
166
398
564
<methods>public non-sealed void <init>() ,public java.util.Locale getLocale() ,public com.salesmanager.core.model.catalog.product.attribute.ProductOptionValue populate(com.salesmanager.shop.model.catalog.product.attribute.PersistableProductOptionValue, com.salesmanager.core.model.merchant.MerchantStore, com.salesmanage...
shopizer-ecommerce_shopizer
shopizer/sm-shop/src/main/java/com/salesmanager/shop/populator/catalog/PersistableProductReviewPopulator.java
PersistableProductReviewPopulator
populate
class PersistableProductReviewPopulator extends AbstractDataPopulator<PersistableProductReview, ProductReview> { private CustomerService customerService; private ProductService productService; private LanguageService languageService; public LanguageService getLanguageService() { return language...
Validate.notNull(customerService,"customerService cannot be null"); Validate.notNull(productService,"productService cannot be null"); Validate.notNull(languageService,"languageService cannot be null"); Validate.notNull(source.getRating(),"Rating cannot bot be null"); try { if(target==null) { ...
276
587
863
<methods>public non-sealed void <init>() ,public java.util.Locale getLocale() ,public com.salesmanager.core.model.catalog.product.review.ProductReview populate(com.salesmanager.shop.model.catalog.product.PersistableProductReview, com.salesmanager.core.model.merchant.MerchantStore, com.salesmanager.core.model.reference....
shopizer-ecommerce_shopizer
shopizer/sm-shop/src/main/java/com/salesmanager/shop/populator/catalog/ReadableCategoryPopulator.java
ReadableCategoryPopulator
populate
class ReadableCategoryPopulator extends AbstractDataPopulator<Category, ReadableCategory> { @Override public ReadableCategory populate(final Category source, final ReadableCategory target, final MerchantStore store, final Language language) throws ConversionException...
Validate.notNull(source, "Category must not be null"); target.setLineage(source.getLineage()); if (source.getDescriptions() != null && source.getDescriptions().size() > 0) { CategoryDescription description = source.getDescription(); if (source.getDescriptions().size()...
105
526
631
<methods>public non-sealed void <init>() ,public java.util.Locale getLocale() ,public com.salesmanager.shop.model.catalog.category.ReadableCategory populate(com.salesmanager.core.model.catalog.category.Category, com.salesmanager.core.model.merchant.MerchantStore, com.salesmanager.core.model.reference.language.Language)...
shopizer-ecommerce_shopizer
shopizer/sm-shop/src/main/java/com/salesmanager/shop/populator/catalog/ReadableFinalPricePopulator.java
ReadableFinalPricePopulator
populate
class ReadableFinalPricePopulator extends AbstractDataPopulator<FinalPrice, ReadableProductPrice> { private PricingService pricingService; public PricingService getPricingService() { return pricingService; } public void setPricingService(PricingService pricingService) { this.pricingService = pricingServ...
Validate.notNull(pricingService,"pricingService must be set"); try { target.setOriginalPrice(pricingService.getDisplayAmount(source.getOriginalPrice(), store)); if(source.isDiscounted()) { target.setDiscounted(true); target.setFinalPrice(pricingService.getDisplayAmount(source.getDiscountedPric...
180
186
366
<methods>public non-sealed void <init>() ,public java.util.Locale getLocale() ,public com.salesmanager.shop.model.catalog.product.ReadableProductPrice populate(com.salesmanager.core.model.catalog.product.price.FinalPrice, com.salesmanager.core.model.merchant.MerchantStore, com.salesmanager.core.model.reference.language...
shopizer-ecommerce_shopizer
shopizer/sm-shop/src/main/java/com/salesmanager/shop/populator/catalog/ReadableProductPricePopulator.java
ReadableProductPricePopulator
populate
class ReadableProductPricePopulator extends AbstractDataPopulator<ProductPrice, ReadableProductPrice> { private PricingService pricingService; public PricingService getPricingService() { return pricingService; } public void setPricingService(PricingService pricingService) { this.pricingService = pricing...
Validate.notNull(pricingService,"pricingService must be set"); Validate.notNull(source.getProductAvailability(),"productPrice.availability cannot be null"); Validate.notNull(source.getProductAvailability().getProduct(),"productPrice.availability.product cannot be null"); try { if(language == null...
361
642
1,003
<methods>public non-sealed void <init>() ,public java.util.Locale getLocale() ,public com.salesmanager.shop.model.catalog.product.ReadableProductPrice populate(com.salesmanager.core.model.catalog.product.price.ProductPrice, com.salesmanager.core.model.merchant.MerchantStore, com.salesmanager.core.model.reference.langua...
shopizer-ecommerce_shopizer
shopizer/sm-shop/src/main/java/com/salesmanager/shop/populator/catalog/ReadableProductReviewPopulator.java
ReadableProductReviewPopulator
populate
class ReadableProductReviewPopulator extends AbstractDataPopulator<ProductReview, ReadableProductReview> { @Override public ReadableProductReview populate(ProductReview source, ReadableProductReview target, MerchantStore store, Language language) throws ConversionException {<FILL_FUNCTION_BODY>} @Override ...
try { ReadableCustomerPopulator populator = new ReadableCustomerPopulator(); ReadableCustomer customer = new ReadableCustomer(); populator.populate(source.getCustomer(), customer, store, language); target.setId(source.getId()); target.setDate(DateUtil.formatDate(source.getReviewDate())); targe...
105
263
368
<methods>public non-sealed void <init>() ,public java.util.Locale getLocale() ,public com.salesmanager.shop.model.catalog.product.ReadableProductReview populate(com.salesmanager.core.model.catalog.product.review.ProductReview, com.salesmanager.core.model.merchant.MerchantStore, com.salesmanager.core.model.reference.lan...
shopizer-ecommerce_shopizer
shopizer/sm-shop/src/main/java/com/salesmanager/shop/populator/customer/CustomerBillingAddressPopulator.java
CustomerBillingAddressPopulator
populate
class CustomerBillingAddressPopulator extends AbstractDataPopulator<Customer, Address> { @Override public Address populate( Customer source, Address target, MerchantStore store, Language language ) throws ConversionException {<FILL_FUNCTION_BODY>} @Override protected Address createTarget()...
target.setCity(source.getBilling().getCity()); target.setCompany(source.getBilling().getCompany()); target.setFirstName(source.getBilling().getFirstName()); target.setLastName(source.getBilling().getLastName()); target.setPostalCode(source.getBilling().getPostalCode());...
94
271
365
<methods>public non-sealed void <init>() ,public java.util.Locale getLocale() ,public com.salesmanager.shop.model.customer.address.Address populate(com.salesmanager.core.model.customer.Customer, com.salesmanager.core.model.merchant.MerchantStore, com.salesmanager.core.model.reference.language.Language) throws com.sales...
shopizer-ecommerce_shopizer
shopizer/sm-shop/src/main/java/com/salesmanager/shop/populator/customer/CustomerDeliveryAddressPopulator.java
CustomerDeliveryAddressPopulator
populate
class CustomerDeliveryAddressPopulator extends AbstractDataPopulator<Customer, Address> { @Override public Address populate( Customer source, Address target, MerchantStore store, Language language ) throws ConversionException {<FILL_FUNCTION_BODY>} @Override protected Address createTarget(...
if(source.getDelivery()!=null){ if(StringUtils.isNotBlank( source.getDelivery().getCity() )){ target.setCity(source.getDelivery().getCity()); } if(StringUtils.isNotBlank( source.getDelivery().getCompany() )){ target.setCompany(source.getDelivery...
94
505
599
<methods>public non-sealed void <init>() ,public java.util.Locale getLocale() ,public com.salesmanager.shop.model.customer.address.Address populate(com.salesmanager.core.model.customer.Customer, com.salesmanager.core.model.merchant.MerchantStore, com.salesmanager.core.model.reference.language.Language) throws com.sales...
shopizer-ecommerce_shopizer
shopizer/sm-shop/src/main/java/com/salesmanager/shop/populator/customer/CustomerEntityPopulator.java
CustomerEntityPopulator
populate
class CustomerEntityPopulator extends AbstractDataPopulator<Customer, CustomerEntity> { @Override public CustomerEntity populate( final Customer source, final CustomerEntity target, final MerchantStore merchantStore, final Language language ) throws ConversionExc...
try { target.setId( source.getId() ); if(StringUtils.isNotBlank( source.getEmailAddress() )){ target.setEmailAddress( source.getEmailAddress() ); } if ( source.getBilling() != null ) { ...
106
739
845
<methods>public non-sealed void <init>() ,public java.util.Locale getLocale() ,public com.salesmanager.shop.model.customer.CustomerEntity populate(com.salesmanager.core.model.customer.Customer, com.salesmanager.core.model.merchant.MerchantStore, com.salesmanager.core.model.reference.language.Language) throws com.salesm...
shopizer-ecommerce_shopizer
shopizer/sm-shop/src/main/java/com/salesmanager/shop/populator/customer/PersistableCustomerBillingAddressPopulator.java
PersistableCustomerBillingAddressPopulator
populate
class PersistableCustomerBillingAddressPopulator extends AbstractDataPopulator<Address, Customer> { @Override public Customer populate( Address source, Customer target, MerchantStore store, Language language ) throws ConversionException {<FILL_FUNCTION_BODY>} @Override protected Customer c...
target.getBilling().setFirstName( source.getFirstName() ); target.getBilling().setLastName( source.getLastName() ); // lets fill optional data now if(StringUtils.isNotBlank( source.getAddress())){ target.getBilling().se...
99
313
412
<methods>public non-sealed void <init>() ,public java.util.Locale getLocale() ,public com.salesmanager.core.model.customer.Customer populate(com.salesmanager.shop.model.customer.address.Address, com.salesmanager.core.model.merchant.MerchantStore, com.salesmanager.core.model.reference.language.Language) throws com.sales...
shopizer-ecommerce_shopizer
shopizer/sm-shop/src/main/java/com/salesmanager/shop/populator/customer/PersistableCustomerOptionPopulator.java
PersistableCustomerOptionPopulator
populate
class PersistableCustomerOptionPopulator extends AbstractDataPopulator<PersistableCustomerOption, CustomerOption> { private LanguageService languageService; @Override public CustomerOption populate(PersistableCustomerOption source, CustomerOption target, MerchantStore store, Language language) throws Co...
Validate.notNull(languageService, "Requires to set LanguageService"); try { target.setCode(source.getCode()); target.setMerchantStore(store); target.setSortOrder(source.getOrder()); if(!StringUtils.isBlank(source.getType())) { target.setCustomerOptionType(source.getType()); } els...
159
437
596
<methods>public non-sealed void <init>() ,public java.util.Locale getLocale() ,public com.salesmanager.core.model.customer.attribute.CustomerOption populate(com.salesmanager.shop.model.customer.attribute.PersistableCustomerOption, com.salesmanager.core.model.merchant.MerchantStore, com.salesmanager.core.model.reference...
shopizer-ecommerce_shopizer
shopizer/sm-shop/src/main/java/com/salesmanager/shop/populator/customer/PersistableCustomerOptionValuePopulator.java
PersistableCustomerOptionValuePopulator
populate
class PersistableCustomerOptionValuePopulator extends AbstractDataPopulator<PersistableCustomerOptionValue, CustomerOptionValue> { private LanguageService languageService; @Override public CustomerOptionValue populate(PersistableCustomerOptionValue source, CustomerOptionValue target, MerchantStore store, L...
Validate.notNull(languageService, "Requires to set LanguageService"); try { target.setCode(source.getCode()); target.setMerchantStore(store); target.setSortOrder(source.getOrder()); if(!CollectionUtils.isEmpty(source.getDescriptions())) { Set<com.salesmanager.core.model.customer...
166
380
546
<methods>public non-sealed void <init>() ,public java.util.Locale getLocale() ,public com.salesmanager.core.model.customer.attribute.CustomerOptionValue populate(com.salesmanager.shop.model.customer.attribute.PersistableCustomerOptionValue, com.salesmanager.core.model.merchant.MerchantStore, com.salesmanager.core.model...
shopizer-ecommerce_shopizer
shopizer/sm-shop/src/main/java/com/salesmanager/shop/populator/customer/PersistableCustomerPopulator.java
PersistableCustomerPopulator
populate
class PersistableCustomerPopulator extends AbstractDataPopulator<Customer, PersistableCustomer> { @Override public PersistableCustomer populate(Customer source, PersistableCustomer target, MerchantStore store, Language language) throws ConversionException {<FILL_FUNCTION_BODY>} @Override protected Persist...
try { if(source.getBilling()!=null) { Address address = new Address(); address.setCity(source.getBilling().getCity()); address.setCompany(source.getBilling().getCompany()); address.setFirstName(source.getBilling().getFirstName()); address.setLastName(source.getBilling().getLastName())...
112
960
1,072
<methods>public non-sealed void <init>() ,public java.util.Locale getLocale() ,public com.salesmanager.shop.model.customer.PersistableCustomer populate(com.salesmanager.core.model.customer.Customer, com.salesmanager.core.model.merchant.MerchantStore, com.salesmanager.core.model.reference.language.Language) throws com.s...
shopizer-ecommerce_shopizer
shopizer/sm-shop/src/main/java/com/salesmanager/shop/populator/customer/PersistableCustomerReviewPopulator.java
PersistableCustomerReviewPopulator
populate
class PersistableCustomerReviewPopulator extends AbstractDataPopulator<PersistableCustomerReview, CustomerReview> { private CustomerService customerService; private LanguageService languageService; public LanguageService getLanguageService() { return languageService; } public void setLanguageService(Langua...
Validate.notNull(customerService,"customerService cannot be null"); Validate.notNull(languageService,"languageService cannot be null"); Validate.notNull(source.getRating(),"Rating cannot bot be null"); try { if(target==null) { target = new CustomerReview(); } if(source.getDate() == n...
213
501
714
<methods>public non-sealed void <init>() ,public java.util.Locale getLocale() ,public com.salesmanager.core.model.customer.review.CustomerReview populate(com.salesmanager.shop.model.customer.PersistableCustomerReview, com.salesmanager.core.model.merchant.MerchantStore, com.salesmanager.core.model.reference.language.Lan...
shopizer-ecommerce_shopizer
shopizer/sm-shop/src/main/java/com/salesmanager/shop/populator/customer/PersistableCustomerShippingAddressPopulator.java
PersistableCustomerShippingAddressPopulator
populate
class PersistableCustomerShippingAddressPopulator extends AbstractDataPopulator<Address, Customer> { @Override public Customer populate( Address source, Customer target, MerchantStore store, Language language ) throws ConversionException {<FILL_FUNCTION_BODY>} @Override protected Customer ...
if( target.getDelivery() == null){ Delivery delivery=new Delivery(); delivery.setFirstName( source.getFirstName()) ; delivery.setLastName( source.getLastName() ); if(StringUtils.isNotBlank( source.getAddres...
100
619
719
<methods>public non-sealed void <init>() ,public java.util.Locale getLocale() ,public com.salesmanager.core.model.customer.Customer populate(com.salesmanager.shop.model.customer.address.Address, com.salesmanager.core.model.merchant.MerchantStore, com.salesmanager.core.model.reference.language.Language) throws com.sales...
shopizer-ecommerce_shopizer
shopizer/sm-shop/src/main/java/com/salesmanager/shop/populator/customer/ReadableCustomerDeliveryAddressPopulator.java
ReadableCustomerDeliveryAddressPopulator
populate
class ReadableCustomerDeliveryAddressPopulator extends AbstractDataPopulator<Delivery, ReadableDelivery> { private CountryService countryService; private ZoneService zoneService; @Override public ReadableDelivery populate( Delivery source, ReadableDelivery target, MerchantStore store, Language language )...
if(countryService==null) { throw new ConversionException("countryService must be set"); } if(zoneService==null) { throw new ConversionException("zoneService must be set"); } target.setLatitude(source.getLatitude()); target.setLongitude(source.getLongitude()); if(StringUtils.isN...
220
723
943
<methods>public non-sealed void <init>() ,public java.util.Locale getLocale() ,public com.salesmanager.shop.model.customer.ReadableDelivery populate(com.salesmanager.core.model.common.Delivery, com.salesmanager.core.model.merchant.MerchantStore, com.salesmanager.core.model.reference.language.Language) throws com.salesm...
shopizer-ecommerce_shopizer
shopizer/sm-shop/src/main/java/com/salesmanager/shop/populator/customer/ReadableCustomerPopulator.java
ReadableCustomerPopulator
populate
class ReadableCustomerPopulator extends AbstractDataPopulator<Customer, ReadableCustomer> { @Override public ReadableCustomer populate(Customer source, ReadableCustomer target, MerchantStore store, Language language) throws ConversionException {<FILL_FUNCTION_BODY>} @Override protected ReadableCustomer cr...
try { if(target == null) { target = new ReadableCustomer(); } if(source.getId()!=null && source.getId()>0) { target.setId(source.getId()); } target.setEmailAddress(source.getEmailAddress()); if (StringUtils.isNotEmpty(source.getNick())) { target.setUserName(source.getNick()); ...
98
1,472
1,570
<methods>public non-sealed void <init>() ,public java.util.Locale getLocale() ,public com.salesmanager.shop.model.customer.ReadableCustomer populate(com.salesmanager.core.model.customer.Customer, com.salesmanager.core.model.merchant.MerchantStore, com.salesmanager.core.model.reference.language.Language) throws com.sale...
shopizer-ecommerce_shopizer
shopizer/sm-shop/src/main/java/com/salesmanager/shop/populator/customer/ReadableCustomerReviewPopulator.java
ReadableCustomerReviewPopulator
populate
class ReadableCustomerReviewPopulator extends AbstractDataPopulator<CustomerReview, ReadableCustomerReview> { @Override public ReadableCustomerReview populate(CustomerReview source, ReadableCustomerReview target, MerchantStore store, Language language) throws ConversionException {<FILL_FUNCTION_BODY>} @Override...
try { if(target==null) { target = new ReadableCustomerReview(); } if(source.getReviewDate() != null) { target.setDate(DateUtil.formatDate(source.getReviewDate())); } ReadableCustomer reviewed = new ReadableCustomer(); reviewed.setId(source.getReviewedCustomer().getId()); re...
108
470
578
<methods>public non-sealed void <init>() ,public java.util.Locale getLocale() ,public com.salesmanager.shop.model.customer.ReadableCustomerReview populate(com.salesmanager.core.model.customer.review.CustomerReview, com.salesmanager.core.model.merchant.MerchantStore, com.salesmanager.core.model.reference.language.Langua...
shopizer-ecommerce_shopizer
shopizer/sm-shop/src/main/java/com/salesmanager/shop/populator/manufacturer/PersistableManufacturerPopulator.java
PersistableManufacturerPopulator
populate
class PersistableManufacturerPopulator extends AbstractDataPopulator<PersistableManufacturer, Manufacturer> { private LanguageService languageService; @Override public Manufacturer populate(PersistableManufacturer source, Manufacturer target, MerchantStore store, Language language) throws ConversionExcept...
Validate.notNull(languageService, "Requires to set LanguageService"); try { target.setMerchantStore(store); target.setCode(source.getCode()); if(!CollectionUtils.isEmpty(source.getDescriptions())) { Set<com.salesmanager.core.model.catalog.product.manufacturer.ManufacturerDescription> de...
171
539
710
<methods>public non-sealed void <init>() ,public java.util.Locale getLocale() ,public com.salesmanager.core.model.catalog.product.manufacturer.Manufacturer populate(com.salesmanager.shop.model.catalog.manufacturer.PersistableManufacturer, com.salesmanager.core.model.merchant.MerchantStore, com.salesmanager.core.model.r...
shopizer-ecommerce_shopizer
shopizer/sm-shop/src/main/java/com/salesmanager/shop/populator/manufacturer/ReadableManufacturerPopulator.java
ReadableManufacturerPopulator
populateDescription
class ReadableManufacturerPopulator extends AbstractDataPopulator<com.salesmanager.core.model.catalog.product.manufacturer.Manufacturer, ReadableManufacturer> { @Override public ReadableManufacturer populate( com.salesmanager.core.model.catalog.product.manufacturer.Manufacturer source, ReadableMa...
if (description == null) { return null; } com.salesmanager.shop.model.catalog.manufacturer.ManufacturerDescription d = new com.salesmanager.shop.model.catalog.manufacturer.ManufacturerDescription(); d.setName(description.getName()); d.setDescription(description.getDescription()); ...
555
153
708
<methods>public non-sealed void <init>() ,public java.util.Locale getLocale() ,public com.salesmanager.shop.model.catalog.manufacturer.ReadableManufacturer populate(com.salesmanager.core.model.catalog.product.manufacturer.Manufacturer, com.salesmanager.core.model.merchant.MerchantStore, com.salesmanager.core.model.refe...
shopizer-ecommerce_shopizer
shopizer/sm-shop/src/main/java/com/salesmanager/shop/populator/order/OrderProductPopulator.java
OrderProductPopulator
populate
class OrderProductPopulator extends AbstractDataPopulator<ShoppingCartItem, OrderProduct> { private ProductService productService; private DigitalProductService digitalProductService; private ProductAttributeService productAttributeService; public ProductAttributeService getProductAttributeService() { retur...
Validate.notNull(productService,"productService must be set"); Validate.notNull(digitalProductService,"digitalProductService must be set"); Validate.notNull(productAttributeService,"productAttributeService must be set"); try { Product modelProduct = productService.getBySku(source.getSku(), store, lan...
575
1,087
1,662
<methods>public non-sealed void <init>() ,public java.util.Locale getLocale() ,public com.salesmanager.core.model.order.orderproduct.OrderProduct populate(com.salesmanager.core.model.shoppingcart.ShoppingCartItem, com.salesmanager.core.model.merchant.MerchantStore, com.salesmanager.core.model.reference.language.Languag...
shopizer-ecommerce_shopizer
shopizer/sm-shop/src/main/java/com/salesmanager/shop/populator/order/PersistableOrderApiPopulator.java
PersistableOrderApiPopulator
populate
class PersistableOrderApiPopulator extends AbstractDataPopulator<PersistableOrder, Order> { @Autowired private CurrencyService currencyService; @Autowired private CustomerService customerService; /* @Autowired private ShoppingCartService shoppingCartService; @Autowired private ProductService productService; @A...
/* Validate.notNull(currencyService,"currencyService must be set"); Validate.notNull(customerService,"customerService must be set"); Validate.notNull(shoppingCartService,"shoppingCartService must be set"); Validate.notNull(productService,"productService must be set"); Validate.notNull(productAttributeServ...
512
1,082
1,594
<methods>public non-sealed void <init>() ,public java.util.Locale getLocale() ,public com.salesmanager.core.model.order.Order populate(com.salesmanager.shop.model.order.v1.PersistableOrder, com.salesmanager.core.model.merchant.MerchantStore, com.salesmanager.core.model.reference.language.Language) throws com.salesmanag...
shopizer-ecommerce_shopizer
shopizer/sm-shop/src/main/java/com/salesmanager/shop/populator/order/PersistableOrderPopulator.java
PersistableOrderPopulator
populate
class PersistableOrderPopulator extends AbstractDataPopulator<PersistableOrder, Order> { private CustomerService customerService; private CountryService countryService; private CurrencyService currencyService; private ZoneService zoneService; private ProductService productService; private DigitalProductServ...
Validate.notNull(productService,"productService must be set"); Validate.notNull(digitalProductService,"digitalProductService must be set"); Validate.notNull(productAttributeService,"productAttributeService must be set"); Validate.notNull(customerService,"customerService must be set"); Validate.notNull(...
485
1,440
1,925
<methods>public non-sealed void <init>() ,public java.util.Locale getLocale() ,public com.salesmanager.core.model.order.Order populate(com.salesmanager.shop.model.order.v0.PersistableOrder, com.salesmanager.core.model.merchant.MerchantStore, com.salesmanager.core.model.reference.language.Language) throws com.salesmanag...
shopizer-ecommerce_shopizer
shopizer/sm-shop/src/main/java/com/salesmanager/shop/populator/order/PersistableOrderProductPopulator.java
PersistableOrderProductPopulator
populate
class PersistableOrderProductPopulator extends AbstractDataPopulator<PersistableOrderProduct, OrderProduct> { private ProductService productService; private DigitalProductService digitalProductService; private ProductAttributeService productAttributeService; public ProductAttributeService getProductAttributeS...
Validate.notNull(productService,"productService must be set"); Validate.notNull(digitalProductService,"digitalProductService must be set"); Validate.notNull(productAttributeService,"productAttributeService must be set"); try { Product modelProduct = productService.getById(source.getProduct().getId())...
323
1,082
1,405
<methods>public non-sealed void <init>() ,public java.util.Locale getLocale() ,public com.salesmanager.core.model.order.orderproduct.OrderProduct populate(com.salesmanager.shop.model.order.PersistableOrderProduct, com.salesmanager.core.model.merchant.MerchantStore, com.salesmanager.core.model.reference.language.Languag...
shopizer-ecommerce_shopizer
shopizer/sm-shop/src/main/java/com/salesmanager/shop/populator/order/ReadableOrderProductDownloadPopulator.java
ReadableOrderProductDownloadPopulator
populate
class ReadableOrderProductDownloadPopulator extends AbstractDataPopulator<OrderProductDownload, ReadableOrderProductDownload> { @Override public ReadableOrderProductDownload populate(OrderProductDownload source, ReadableOrderProductDownload target, MerchantStore store, Language language) throws ConversionExc...
try { target.setProductName(source.getOrderProduct().getProductName()); target.setDownloadCount(source.getDownloadCount()); target.setDownloadExpiryDays(source.getMaxdays()); target.setId(source.getId()); target.setFileName(source.getOrderProductFilename()); target.setOrderId(source.getOrderPro...
119
142
261
<methods>public non-sealed void <init>() ,public java.util.Locale getLocale() ,public com.salesmanager.shop.model.order.ReadableOrderProductDownload populate(com.salesmanager.core.model.order.orderproduct.OrderProductDownload, com.salesmanager.core.model.merchant.MerchantStore, com.salesmanager.core.model.reference.lan...
shopizer-ecommerce_shopizer
shopizer/sm-shop/src/main/java/com/salesmanager/shop/populator/order/ReadableOrderProductPopulator.java
ReadableOrderProductPopulator
populate
class ReadableOrderProductPopulator extends AbstractDataPopulator<OrderProduct, ReadableOrderProduct> { private ProductService productService; private PricingService pricingService; private ImageFilePath imageUtils; public ImageFilePath getimageUtils() { return imageUtils; } public void setimageUtils(Im...
Validate.notNull(productService,"Requires ProductService"); Validate.notNull(pricingService,"Requires PricingService"); Validate.notNull(imageUtils,"Requires imageUtils"); target.setId(source.getId()); target.setOrderedQuantity(source.getProductQuantity()); try { target.setPrice(pricingService.getDis...
278
837
1,115
<methods>public non-sealed void <init>() ,public java.util.Locale getLocale() ,public com.salesmanager.shop.model.order.ReadableOrderProduct populate(com.salesmanager.core.model.order.orderproduct.OrderProduct, com.salesmanager.core.model.merchant.MerchantStore, com.salesmanager.core.model.reference.language.Language) ...
shopizer-ecommerce_shopizer
shopizer/sm-shop/src/main/java/com/salesmanager/shop/populator/order/ReadableOrderSummaryPopulator.java
ReadableOrderSummaryPopulator
populate
class ReadableOrderSummaryPopulator extends AbstractDataPopulator<OrderTotalSummary, ReadableOrderTotalSummary> { private static final Logger LOGGER = LoggerFactory .getLogger(ReadableOrderSummaryPopulator.class); private PricingService pricingService; private LabelUtils messages; @Override public Read...
Validate.notNull(pricingService,"PricingService must be set"); Validate.notNull(messages,"LabelUtils must be set"); if(target==null) { target = new ReadableOrderTotalSummary(); } try { if(source.getSubTotal() != null) { target.setSubTotal(pricingService.getDisplayAmount(source.getSubTot...
259
400
659
<methods>public non-sealed void <init>() ,public java.util.Locale getLocale() ,public com.salesmanager.shop.model.order.ReadableOrderTotalSummary populate(com.salesmanager.core.model.order.OrderTotalSummary, com.salesmanager.core.model.merchant.MerchantStore, com.salesmanager.core.model.reference.language.Language) thr...
shopizer-ecommerce_shopizer
shopizer/sm-shop/src/main/java/com/salesmanager/shop/populator/order/ReadableOrderTotalPopulator.java
ReadableOrderTotalPopulator
populate
class ReadableOrderTotalPopulator extends AbstractDataPopulator<OrderTotal, ReadableOrderTotal> { private PricingService pricingService; private LabelUtils messages; @Override public ReadableOrderTotal populate(OrderTotal source, ReadableOrderTotal target, MerchantStore store, Language language) t...
Validate.notNull(pricingService,"PricingService must be set"); Validate.notNull(messages,"LabelUtils must be set"); Locale locale = LocaleUtils.getLocale(language); try { target.setCode(source.getOrderTotalCode()); target.setId(source.getId()); target.setModule(source.getModule()...
226
301
527
<methods>public non-sealed void <init>() ,public java.util.Locale getLocale() ,public com.salesmanager.shop.model.order.total.ReadableOrderTotal populate(com.salesmanager.core.model.order.OrderTotal, com.salesmanager.core.model.merchant.MerchantStore, com.salesmanager.core.model.reference.language.Language) throws com....
shopizer-ecommerce_shopizer
shopizer/sm-shop/src/main/java/com/salesmanager/shop/populator/order/ReadableShippingSummaryPopulator.java
ReadableShippingSummaryPopulator
populate
class ReadableShippingSummaryPopulator extends AbstractDataPopulator<ShippingSummary, ReadableShippingSummary> { private PricingService pricingService; @Override public ReadableShippingSummary populate(ShippingSummary source, ReadableShippingSummary target, MerchantStore store, Language language) throws C...
Validate.notNull(pricingService,"PricingService must be set"); Validate.notNull(source,"ShippingSummary cannot be null"); try { target.setShippingQuote(source.isShippingQuote()); target.setFreeShipping(source.isFreeShipping()); target.setHandling(source.getHandling()); target.setShipping(sou...
193
552
745
<methods>public non-sealed void <init>() ,public java.util.Locale getLocale() ,public com.salesmanager.shop.model.order.shipping.ReadableShippingSummary populate(com.salesmanager.core.model.shipping.ShippingSummary, com.salesmanager.core.model.merchant.MerchantStore, com.salesmanager.core.model.reference.language.Langu...
shopizer-ecommerce_shopizer
shopizer/sm-shop/src/main/java/com/salesmanager/shop/populator/order/ReadableShopOrderPopulator.java
ReadableShopOrderPopulator
populate
class ReadableShopOrderPopulator extends AbstractDataPopulator<ShopOrder, ReadableShopOrder> { @Override public ReadableShopOrder populate(ShopOrder source, ReadableShopOrder target, MerchantStore store, Language language) throws ConversionException {<FILL_FUNCTION_BODY>} @Override protected ReadableShopO...
//not that much is required //customer try { ReadableCustomer customer = new ReadableCustomer(); PersistableCustomer persistableCustomer = source.getCustomer(); customer.setEmailAddress(persistableCustomer.getEmailAddress()); if(persistableCustomer.getBilling()!=null) { Address ...
105
1,063
1,168
<methods>public non-sealed void <init>() ,public java.util.Locale getLocale() ,public com.salesmanager.shop.model.order.ReadableShopOrder populate(com.salesmanager.shop.model.order.ShopOrder, com.salesmanager.core.model.merchant.MerchantStore, com.salesmanager.core.model.reference.language.Language) throws com.salesman...
shopizer-ecommerce_shopizer
shopizer/sm-shop/src/main/java/com/salesmanager/shop/populator/order/ShoppingCartItemPopulator.java
ShoppingCartItemPopulator
populate
class ShoppingCartItemPopulator extends AbstractDataPopulator<PersistableOrderProduct, ShoppingCartItem> { private ProductService productService; private ProductAttributeService productAttributeService; private ShoppingCartService shoppingCartService; @Override public ShoppingCartItem populate(PersistableOrde...
Validate.notNull(productService, "Requires to set productService"); Validate.notNull(productAttributeService, "Requires to set productAttributeService"); Validate.notNull(shoppingCartService, "Requires to set shoppingCartService"); Product product = null; try { product = productService.getBySku(source.ge...
315
401
716
<methods>public non-sealed void <init>() ,public java.util.Locale getLocale() ,public com.salesmanager.core.model.shoppingcart.ShoppingCartItem populate(com.salesmanager.shop.model.order.PersistableOrderProduct, com.salesmanager.core.model.merchant.MerchantStore, com.salesmanager.core.model.reference.language.Language)...
shopizer-ecommerce_shopizer
shopizer/sm-shop/src/main/java/com/salesmanager/shop/populator/order/transaction/PersistablePaymentPopulator.java
PersistablePaymentPopulator
populate
class PersistablePaymentPopulator extends AbstractDataPopulator<PersistablePayment, Payment> { PricingService pricingService; @Override public Payment populate(PersistablePayment source, Payment target, MerchantStore store, Language language) throws ConversionException {<FILL_FUNCTION_BODY>} @Override p...
Validate.notNull(source,"PersistablePayment cannot be null"); Validate.notNull(pricingService,"pricingService must be set"); if(target == null) { target = new Payment(); } try { target.setAmount(pricingService.getAmount(source.getAmount())); target.setModuleName(source.getPaymentModule()); ...
176
241
417
<methods>public non-sealed void <init>() ,public java.util.Locale getLocale() ,public com.salesmanager.core.model.payments.Payment populate(com.salesmanager.shop.model.order.transaction.PersistablePayment, com.salesmanager.core.model.merchant.MerchantStore, com.salesmanager.core.model.reference.language.Language) throw...
shopizer-ecommerce_shopizer
shopizer/sm-shop/src/main/java/com/salesmanager/shop/populator/order/transaction/PersistableTransactionPopulator.java
PersistableTransactionPopulator
populate
class PersistableTransactionPopulator extends AbstractDataPopulator<PersistableTransaction, Transaction> { private OrderService orderService; private PricingService pricingService; @Override public Transaction populate(PersistableTransaction source, Transaction target, MerchantStore store, Language language) ...
Validate.notNull(source,"PersistableTransaction must not be null"); Validate.notNull(orderService,"OrderService must not be null"); Validate.notNull(pricingService,"OrderService must not be null"); if(target == null) { target = new Transaction(); } try { target.setAmount(pricingServi...
220
378
598
<methods>public non-sealed void <init>() ,public java.util.Locale getLocale() ,public com.salesmanager.core.model.payments.Transaction populate(com.salesmanager.shop.model.order.transaction.PersistableTransaction, com.salesmanager.core.model.merchant.MerchantStore, com.salesmanager.core.model.reference.language.Languag...
shopizer-ecommerce_shopizer
shopizer/sm-shop/src/main/java/com/salesmanager/shop/populator/order/transaction/ReadableTransactionPopulator.java
ReadableTransactionPopulator
populate
class ReadableTransactionPopulator extends AbstractDataPopulator<Transaction, ReadableTransaction> { private OrderService orderService; private PricingService pricingService; @Override public ReadableTransaction populate(Transaction source, ReadableTransaction target, MerchantStore store, Language language)...
Validate.notNull(source,"PersistableTransaction must not be null"); Validate.notNull(orderService,"OrderService must not be null"); Validate.notNull(pricingService,"OrderService must not be null"); if(target == null) { target = new ReadableTransaction(); } try { target.setAmount(pri...
219
276
495
<methods>public non-sealed void <init>() ,public java.util.Locale getLocale() ,public com.salesmanager.shop.model.order.transaction.ReadableTransaction populate(com.salesmanager.core.model.payments.Transaction, com.salesmanager.core.model.merchant.MerchantStore, com.salesmanager.core.model.reference.language.Language) ...
shopizer-ecommerce_shopizer
shopizer/sm-shop/src/main/java/com/salesmanager/shop/populator/references/ReadableCountryPopulator.java
ReadableCountryPopulator
populate
class ReadableCountryPopulator extends AbstractDataPopulator<Country, ReadableCountry> { @Override public ReadableCountry populate(Country source, ReadableCountry target, MerchantStore store, Language language) throws ConversionException {<FILL_FUNCTION_BODY>} @Override protected ReadableCountry createTarget()...
if(target==null) { target = new ReadableCountry(); } target.setId(new Long(source.getId())); target.setCode(source.getIsoCode()); target.setSupported(source.getSupported()); if(!CollectionUtils.isEmpty(source.getDescriptions())) { target.setName(source.getDescriptions().iterator().next().getNam...
101
298
399
<methods>public non-sealed void <init>() ,public java.util.Locale getLocale() ,public com.salesmanager.shop.model.references.ReadableCountry populate(com.salesmanager.core.model.reference.country.Country, com.salesmanager.core.model.merchant.MerchantStore, com.salesmanager.core.model.reference.language.Language) throws...
shopizer-ecommerce_shopizer
shopizer/sm-shop/src/main/java/com/salesmanager/shop/populator/references/ReadableZonePopulator.java
ReadableZonePopulator
populate
class ReadableZonePopulator extends AbstractDataPopulator<Zone, ReadableZone> { @Override public ReadableZone populate(Zone source, ReadableZone target, MerchantStore store, Language language) throws ConversionException {<FILL_FUNCTION_BODY>} @Override protected ReadableZone createTarget() { // TODO Auto-gen...
if(target==null) { target = new ReadableZone(); } target.setId(source.getId()); target.setCode(source.getCode()); target.setCountryCode(source.getCountry().getIsoCode()); if(!CollectionUtils.isEmpty(source.getDescriptions())) { for(ZoneDescription d : source.getDescriptions()) { if(d.getLan...
101
158
259
<methods>public non-sealed void <init>() ,public java.util.Locale getLocale() ,public com.salesmanager.shop.model.references.ReadableZone populate(com.salesmanager.core.model.reference.zone.Zone, com.salesmanager.core.model.merchant.MerchantStore, com.salesmanager.core.model.reference.language.Language) throws com.sale...
shopizer-ecommerce_shopizer
shopizer/sm-shop/src/main/java/com/salesmanager/shop/populator/shoppingCart/ShoppingCartDataPopulator.java
ShoppingCartDataPopulator
populate
class ShoppingCartDataPopulator extends AbstractDataPopulator<ShoppingCart,ShoppingCartData> { private static final Logger LOG = LoggerFactory.getLogger(ShoppingCartDataPopulator.class); private PricingService pricingService; private ShoppingCartCalculationService shoppingCartCalculationService; ...
Validate.notNull(shoppingCart, "Requires ShoppingCart"); Validate.notNull(language, "Requires Language not null"); int cartQuantity = 0; cart.setCode(shoppingCart.getShoppingCartCode()); Set<com.salesmanager.core.model.shoppingcart.ShoppingCartItem> items = shoppingCart.getLineItems(); ...
386
1,614
2,000
<methods>public non-sealed void <init>() ,public java.util.Locale getLocale() ,public com.salesmanager.shop.model.shoppingcart.ShoppingCartData populate(com.salesmanager.core.model.shoppingcart.ShoppingCart, com.salesmanager.core.model.merchant.MerchantStore, com.salesmanager.core.model.reference.language.Language) thr...
shopizer-ecommerce_shopizer
shopizer/sm-shop/src/main/java/com/salesmanager/shop/populator/store/PersistableMerchantStorePopulator.java
PersistableMerchantStorePopulator
populate
class PersistableMerchantStorePopulator extends AbstractDataPopulator<PersistableMerchantStore, MerchantStore> { @Inject private CountryService countryService; @Inject private ZoneService zoneService; @Inject private LanguageService languageService; @Inject private CurrencyService currencyService; @Inject pr...
Validate.notNull(source, "PersistableMerchantStore mst not be null"); if(target == null) { target = new MerchantStore(); } target.setCode(source.getCode()); if(source.getId()!=0) { target.setId(source.getId()); } if(store.getStoreLogo()!=null) { target.setStoreLogo(store.getStoreLogo()...
357
1,080
1,437
<methods>public non-sealed void <init>() ,public java.util.Locale getLocale() ,public com.salesmanager.core.model.merchant.MerchantStore populate(com.salesmanager.shop.model.store.PersistableMerchantStore, com.salesmanager.core.model.merchant.MerchantStore, com.salesmanager.core.model.reference.language.Language) throw...
shopizer-ecommerce_shopizer
shopizer/sm-shop/src/main/java/com/salesmanager/shop/populator/store/ReadableMerchantStorePopulator.java
ReadableMerchantStorePopulator
populate
class ReadableMerchantStorePopulator extends AbstractDataPopulator<MerchantStore, ReadableMerchantStore> { protected final Log logger = LogFactory.getLog(getClass()); @Autowired private CountryService countryService; @Autowired private ZoneService zoneService; @Autowired @Qualifier("img") private ImageFil...
Validate.notNull(countryService,"Must use setter for countryService"); Validate.notNull(zoneService,"Must use setter for zoneService"); if(target == null) { target = new ReadableMerchantStore(); } target.setId(source.getId()); target.setCode(source.getCode()); if(source.getDefaultLanguage() != n...
201
1,270
1,471
<methods>public non-sealed void <init>() ,public java.util.Locale getLocale() ,public com.salesmanager.shop.model.store.ReadableMerchantStore populate(com.salesmanager.core.model.merchant.MerchantStore, com.salesmanager.core.model.merchant.MerchantStore, com.salesmanager.core.model.reference.language.Language) throws c...
shopizer-ecommerce_shopizer
shopizer/sm-shop/src/main/java/com/salesmanager/shop/populator/store/ReadableMerchantStorePopulatorWithDetails.java
ReadableMerchantStorePopulatorWithDetails
populate
class ReadableMerchantStorePopulatorWithDetails extends ReadableMerchantStorePopulator { protected final Log logger = LogFactory.getLog(getClass()); @Override public ReadableMerchantStore populate(MerchantStore source, ReadableMerchantStore target, MerchantStore store, Language language) throws ConversionE...
target = super.populate(source, target, store, language); target.setTemplate(source.getStoreTemplate()); // TODO Add more as needed return target;
132
52
184
<methods>public non-sealed void <init>() ,public com.salesmanager.shop.model.store.ReadableMerchantStore populate(com.salesmanager.core.model.merchant.MerchantStore, com.salesmanager.shop.model.store.ReadableMerchantStore, com.salesmanager.core.model.merchant.MerchantStore, com.salesmanager.core.model.reference.languag...
shopizer-ecommerce_shopizer
shopizer/sm-shop/src/main/java/com/salesmanager/shop/populator/system/ReadableOptinPopulator.java
ReadableOptinPopulator
populate
class ReadableOptinPopulator extends AbstractDataPopulator<Optin, ReadableOptin> { @Override public ReadableOptin populate(Optin source, ReadableOptin target, MerchantStore store, Language language) throws ConversionException {<FILL_FUNCTION_BODY>} @Override protected ReadableOptin createTarget() { // TODO A...
Validate.notNull(store,"MerchantStore cannot be null"); Validate.notNull(source,"Optin cannot be null"); if(target==null) { target = new ReadableOptin(); } target.setCode(source.getCode()); target.setDescription(source.getDescription()); target.setEndDate(source.getEndDate()); target.setId(sou...
108
171
279
<methods>public non-sealed void <init>() ,public java.util.Locale getLocale() ,public com.salesmanager.shop.model.system.ReadableOptin populate(com.salesmanager.core.model.system.optin.Optin, com.salesmanager.core.model.merchant.MerchantStore, com.salesmanager.core.model.reference.language.Language) throws com.salesman...
shopizer-ecommerce_shopizer
shopizer/sm-shop/src/main/java/com/salesmanager/shop/populator/user/PersistableUserPopulator.java
PersistableUserPopulator
populate
class PersistableUserPopulator extends AbstractDataPopulator<PersistableUser, User> { @Inject private LanguageService languageService; @Inject private GroupService groupService; @Inject private MerchantStoreService merchantStoreService; @Inject @Named("passwordEncoder") private PasswordEncod...
Validate.notNull(source, "PersistableUser cannot be null"); Validate.notNull(store, "MerchantStore cannot be null"); if (target == null) { target = new User(); } target.setFirstName(source.getFirstName()); target.setLastName(source.getLastName()); target.setAdminEmail(source.getEmai...
178
527
705
<methods>public non-sealed void <init>() ,public java.util.Locale getLocale() ,public com.salesmanager.core.model.user.User populate(com.salesmanager.shop.model.user.PersistableUser, com.salesmanager.core.model.merchant.MerchantStore, com.salesmanager.core.model.reference.language.Language) throws com.salesmanager.core...
shopizer-ecommerce_shopizer
shopizer/sm-shop/src/main/java/com/salesmanager/shop/populator/user/ReadableUserPopulator.java
ReadableUserPopulator
populate
class ReadableUserPopulator extends AbstractDataPopulator<User, ReadableUser> { @Override public ReadableUser populate(User source, ReadableUser target, MerchantStore store, Language language) throws ConversionException {<FILL_FUNCTION_BODY>} @Override protected ReadableUser createTarget() { // TODO...
Validate.notNull(source, "User cannot be null"); if (target == null) { target = new ReadableUser(); } target.setFirstName(source.getFirstName()); target.setLastName(source.getLastName()); target.setEmailAddress(source.getAdminEmail()); target.setUserName(source.getAdminName()); ...
104
351
455
<methods>public non-sealed void <init>() ,public java.util.Locale getLocale() ,public com.salesmanager.shop.model.user.ReadableUser populate(com.salesmanager.core.model.user.User, com.salesmanager.core.model.merchant.MerchantStore, com.salesmanager.core.model.reference.language.Language) throws com.salesmanager.core.bu...
shopizer-ecommerce_shopizer
shopizer/sm-shop/src/main/java/com/salesmanager/shop/store/api/DefaultController.java
DefaultController
version
class DefaultController { @Autowired private Environment env; @GetMapping(value = "/") public @ResponseBody String version(Model model) {<FILL_FUNCTION_BODY>} }
return "{\"version\":\""+ env.getProperty("application-version") +"\", \"build\":\"" + env.getProperty("build.timestamp") + "\"}";
56
50
106
<no_super_class>
shopizer-ecommerce_shopizer
shopizer/sm-shop/src/main/java/com/salesmanager/shop/store/api/exception/FileUploadExceptionAdvice.java
FileUploadExceptionAdvice
handleFileException
class FileUploadExceptionAdvice { private static final Logger log = LoggerFactory.getLogger(FileUploadExceptionAdvice.class); @ExceptionHandler(MaxUploadSizeExceededException.class) @ResponseStatus(HttpStatus.PAYLOAD_TOO_LARGE) public @ResponseBody ErrorEntity handleFileException(Exception exceptio...
log.error(exception.getMessage(), exception); ErrorEntity errorEntity = new ErrorEntity(); String resultMessage = exception.getLocalizedMessage() != null ? exception.getLocalizedMessage() : exception.getMessage(); Optional.ofNullable(resultMessage) .ifPresent(errorEntit...
103
84
187
<no_super_class>
shopizer-ecommerce_shopizer
shopizer/sm-shop/src/main/java/com/salesmanager/shop/store/api/exception/RestErrorHandler.java
RestErrorHandler
handleServiceException
class RestErrorHandler { private static final Logger log = LoggerFactory.getLogger(RestErrorHandler.class); @RequestMapping(produces = "application/json") @ExceptionHandler(Exception.class) @ResponseStatus(HttpStatus.INTERNAL_SERVER_ERROR) public @ResponseBody ErrorEntity handleServiceExc...
log.error(exception.getMessage(), exception); Objects.requireNonNull(exception.getCause()); Throwable rootCause = exception.getCause(); while (rootCause.getCause() != null && rootCause.getCause() != rootCause) { rootCause = rootCause.getCause(); } Erro...
1,019
138
1,157
<no_super_class>
shopizer-ecommerce_shopizer
shopizer/sm-shop/src/main/java/com/salesmanager/shop/store/api/v0/store/StoreContactRESTController.java
StoreContactRESTController
contact
class StoreContactRESTController { @Inject private LanguageService languageService; @Inject private MerchantStoreService merchantStoreService; @Inject private EmailTemplatesUtils emailTemplatesUtils; private static final Logger LOGGER = LoggerFactory.getLogger(StoreContactRESTController.class); ...
AjaxResponse ajaxResponse = new AjaxResponse(); try { /** default routine **/ MerchantStore merchantStore = (MerchantStore)request.getAttribute(Constants.MERCHANT_STORE); if(merchantStore!=null) { if(!merchantStore.getCode().equals(store)) { merchantStore = null; } } if(m...
562
505
1,067
<no_super_class>
shopizer-ecommerce_shopizer
shopizer/sm-shop/src/main/java/com/salesmanager/shop/store/api/v0/system/SystemRESTController.java
SystemRESTController
deleteOptin
class SystemRESTController { private static final Logger LOGGER = LoggerFactory.getLogger(SystemRESTController.class); @Inject private ModuleConfigurationService moduleConfigurationService; /** * Creates or updates a configuration module. A JSON has to be created on the client side which represents * a...
AjaxResponse resp = new AjaxResponse(); try { LOGGER.debug("Delete optin : " + code); //moduleConfigurationService.createOrUpdateModule(json); response.setStatus(200); resp.setStatus(200); } catch(Exception e) { resp.setStatus(500); resp.setErrorMessage(e); response.sendError(50...
1,096
149
1,245
<no_super_class>
shopizer-ecommerce_shopizer
shopizer/sm-shop/src/main/java/com/salesmanager/shop/store/api/v1/configurations/CacheApi.java
CacheApi
clearCache
class CacheApi { private static final Logger LOGGER = LoggerFactory.getLogger(CacheApi.class); @Inject private StoreFacade storeFacade; @Inject private CacheUtils cache; @DeleteMapping(value = "/auth/cache/store/{storeId}/clear") public @ResponseBody ResponseEntity<String> clearCache(@PathVariable("st...
try { MerchantStore merchantStore = storeFacade.get(storeCode); StringBuilder key = new StringBuilder().append(merchantStore.getId()).append("_").append(cacheKey); if (StringUtils.isNotEmpty(cacheKey)) { cache.removeFromCache(key.toString()); } else { cache.remov...
138
162
300
<no_super_class>
shopizer-ecommerce_shopizer
shopizer/sm-shop/src/main/java/com/salesmanager/shop/store/api/v1/customer/AuthenticateCustomerApi.java
AuthenticateCustomerApi
authenticate
class AuthenticateCustomerApi { private static final Logger LOGGER = LoggerFactory.getLogger(AuthenticateCustomerApi.class); @Value("${authToken.header}") private String tokenHeader; @Inject private AuthenticationManager jwtCustomerAuthenticationManager; @Inject private JWTTokenUtil ...
//TODO SET STORE in flow // Perform the security Authentication authentication = null; try { //to be used when username and password are set authentication = jwtCustomerAuthenticationManager.authenticate( new Userna...
1,545
325
1,870
<no_super_class>
shopizer-ecommerce_shopizer
shopizer/sm-shop/src/main/java/com/salesmanager/shop/store/api/v1/customer/CustomerApi.java
CustomerApi
updateAuthUserAddress
class CustomerApi { private static final Logger LOGGER = LoggerFactory.getLogger(CustomerApi.class); @Inject private CustomerFacade customerFacade; @Autowired private UserFacade userFacade; /** Create new customer for a given MerchantStore */ @PostMapping("/private/customer") @ApiOperation(httpMethod...
Principal principal = request.getUserPrincipal(); String userName = principal.getName(); customerFacade.updateAddress(userName, customer, merchantStore);
1,897
47
1,944
<no_super_class>
shopizer-ecommerce_shopizer
shopizer/sm-shop/src/main/java/com/salesmanager/shop/store/api/v1/customer/ResetCustomerPasswordApi.java
ResetCustomerPasswordApi
passwordResetVerify
class ResetCustomerPasswordApi { private static final Logger LOGGER = LoggerFactory.getLogger(ResetCustomerPasswordApi.class); @Inject private com.salesmanager.shop.store.controller.customer.facade.v1.CustomerFacade customerFacade; /** * Request a reset password token * * @param merchantStore * @param l...
/** * Receives reset token Needs to validate if user found from token Needs * to validate if token has expired * * If no problem void is returned otherwise throw OperationNotAllowed * All of this in UserFacade */ customerFacade.verifyPasswordRequestToken(token, store);
834
87
921
<no_super_class>
shopizer-ecommerce_shopizer
shopizer/sm-shop/src/main/java/com/salesmanager/shop/store/api/v1/marketplace/MarketPlaceApi.java
MarketPlaceApi
signup
class MarketPlaceApi { @Autowired private MarketPlaceFacade marketPlaceFacade; @Autowired private UserFacade userFacade; @Inject private StoreFacade storeFacade; @Inject private LanguageUtils languageUtils; /** * Get a marketplace from storeCode returns market place details and * merchant store */ ...
ReadableUser user = null; try { // check if user exists user = userFacade.findByUserName(store.getEmail()); } catch (ResourceNotFoundException ignore) {//that is what will happen if user does not exists } if (user != null) { throw new OperationNotAllowedException( "User [" + store.getEmail()...
529
197
726
<no_super_class>
shopizer-ecommerce_shopizer
shopizer/sm-shop/src/main/java/com/salesmanager/shop/store/api/v1/order/OrderStatusHistoryApi.java
OrderStatusHistoryApi
list
class OrderStatusHistoryApi { @Inject private OrderFacade orderFacade; @Inject private AuthorizationUtils authorizationUtils; @RequestMapping(value = { "private/orders/{id}/history" }, method = RequestMethod.GET) @ResponseStatus(HttpStatus.OK) @ResponseBody public List<ReadableOrderStatusHistory> list(@PathV...
String user = authorizationUtils.authenticatedUser(); authorizationUtils.authorizeUser(user, Stream.of(Constants.GROUP_SUPERADMIN, Constants.GROUP_ADMIN, Constants.GROUP_ADMIN_ORDER, Constants.GROUP_ADMIN_RETAIL).collect(Collectors.toList()), merchantStore); return orderFacade.getReadableOrderHistory(id, m...
366
110
476
<no_super_class>
shopizer-ecommerce_shopizer
shopizer/sm-shop/src/main/java/com/salesmanager/shop/store/api/v1/order/OrderTotalApi.java
OrderTotalApi
calculateTotal
class OrderTotalApi { @Inject private ShoppingCartFacade shoppingCartFacade; @Inject private LabelUtils messages; @Inject private PricingService pricingService; @Inject private CustomerService customerService; @Inject private ShippingQuoteService shippingQuoteService; @Inject private OrderService orde...
try { ShoppingCart shoppingCart = shoppingCartFacade.getShoppingCartModel(code, merchantStore); if (shoppingCart == null) { response.sendError(404, "Cart code " + code + " does not exist"); return null; } ShippingSummary shippingSummary = null; // get shipping qu...
1,190
398
1,588
<no_super_class>
shopizer-ecommerce_shopizer
shopizer/sm-shop/src/main/java/com/salesmanager/shop/store/api/v1/payment/PaymentApi.java
PaymentApi
configure
class PaymentApi { private static final Logger LOGGER = LoggerFactory.getLogger(PaymentApi.class); @Autowired private PaymentService paymentService; /** * Get available payment modules * * @param merchantStore * @param language * @return */ @GetMapping("/private/modules/payment") @ApiOperation(htt...
try { List<IntegrationModule> modules = paymentService.getPaymentMethods(merchantStore); Map<String, IntegrationModule> map = modules.stream() .collect(Collectors.toMap(IntegrationModule::getCode, module -> module)); IntegrationModule config = map.get(configuration.getCo...
1,120
378
1,498
<no_super_class>
shopizer-ecommerce_shopizer
shopizer/sm-shop/src/main/java/com/salesmanager/shop/store/api/v1/product/ProductGroupApi.java
ProductGroupApi
addProductToGroup
class ProductGroupApi { @Inject private ProductService productService; @Inject private ProductItemsFacade productItemsFacade; private static final Logger LOGGER = LoggerFactory.getLogger(ProductGroupApi.class); @ResponseStatus(HttpStatus.OK) @PostMapping("/private/products/group") @ApiOperation(httpMeth...
Product product = null; try { // get the product product = productService.findOne(productId, merchantStore); if (product == null) { response.sendError(404, "Product not fount for id " + productId); return null; } } catch (Exception e) { LOGGER.error(...
1,764
196
1,960
<no_super_class>
shopizer-ecommerce_shopizer
shopizer/sm-shop/src/main/java/com/salesmanager/shop/store/api/v1/product/ProductInventoryApi.java
ProductInventoryApi
getByProductId
class ProductInventoryApi { @Autowired private ProductInventoryFacade productInventoryFacade; private static final Logger LOGGER = LoggerFactory.getLogger(ProductInventoryApi.class); @ResponseStatus(HttpStatus.CREATED) @RequestMapping(value = { "/private/product/{productId}/inventory" }, method = RequestMethod....
if(productId == null) { throw new RestApiException("Requires request parameter product id [/product/inventoty?productId"); } return productInventoryFacade.get(productId, merchantStore, language, page, count);
1,050
70
1,120
<no_super_class>
shopizer-ecommerce_shopizer
shopizer/sm-shop/src/main/java/com/salesmanager/shop/store/api/v1/product/ProductPriceApi.java
ProductPriceApi
save
class ProductPriceApi { @Autowired private ProductPriceFacade productPriceFacade;; private static final Logger LOGGER = LoggerFactory.getLogger(ProductApi.class); @ResponseStatus(HttpStatus.OK) @RequestMapping(value = { "/private/product/{sku}/inventory/{inventoryId}/price"}, method = RequestMethod.POST) ...
price.setSku(sku); Long id = productPriceFacade.save(price, merchantStore); return new Entity(id);
1,401
49
1,450
<no_super_class>
shopizer-ecommerce_shopizer
shopizer/sm-shop/src/main/java/com/salesmanager/shop/store/api/v1/product/ProductPropertySetApi.java
ProductPropertySetApi
list
class ProductPropertySetApi { @Autowired private ProductOptionSetFacade productOptionSetFacade; @ResponseStatus(HttpStatus.CREATED) @RequestMapping(value = { "/private/product/property/set" }, method = RequestMethod.POST) @ApiImplicitParams({ @ApiImplicitParam(name = "store", dataType = "String", defaultValue = ...
if(!StringUtils.isBlank(type)) { return productOptionSetFacade.list(merchantStore, language, type); } else { return productOptionSetFacade.list(merchantStore, language); }
1,108
66
1,174
<no_super_class>
shopizer-ecommerce_shopizer
shopizer/sm-shop/src/main/java/com/salesmanager/shop/store/api/v1/product/ProductRelationshipApi.java
ProductRelationshipApi
getAll
class ProductRelationshipApi { @Inject private ProductFacade productFacade; @Inject private StoreFacade storeFacade; @Inject private LanguageUtils languageUtils; @Inject private ProductService productService; @Inject private ProductReviewService productReviewService; private static final Logger LOGGER...
try { // product exist Product product = productService.getById(id); if (product == null) { response.sendError(404, "Product id " + id + " does not exists"); return null; } List<ReadableProduct> relatedItems = productFacade.relatedItems(merchantStore, prod...
1,669
176
1,845
<no_super_class>
shopizer-ecommerce_shopizer
shopizer/sm-shop/src/main/java/com/salesmanager/shop/store/api/v1/product/ProductReviewApi.java
ProductReviewApi
delete
class ProductReviewApi { @Inject private ProductCommonFacade productCommonFacade; @Inject private ProductService productService; @Inject private ProductReviewService productReviewService; private static final Logger LOGGER = LoggerFactory.getLogger(ProductReviewApi.class); @RequestMapping( value = ...
try { ProductReview prodReview = productReviewService.getById(reviewId); if (prodReview == null) { response.sendError(404, "Product review with id " + reviewId + " does not exist"); return; } if (prodReview.getProduct().getId().longValue() != id.longValue()) { resp...
1,627
216
1,843
<no_super_class>
shopizer-ecommerce_shopizer
shopizer/sm-shop/src/main/java/com/salesmanager/shop/store/api/v1/product/ProductTypeApi.java
ProductTypeApi
create
class ProductTypeApi { @Inject private ProductTypeFacade productTypeFacade; private static final Logger LOGGER = LoggerFactory.getLogger(ProductTypeApi.class); @GetMapping(value = "/private/product/types", produces = MediaType.APPLICATION_JSON_VALUE) @ApiOperation(httpMethod = "GET", value = "Get product types ...
Long id = productTypeFacade.save(type, merchantStore, language); Entity entity = new Entity(); entity.setId(id); return entity;
1,157
50
1,207
<no_super_class>
shopizer-ecommerce_shopizer
shopizer/sm-shop/src/main/java/com/salesmanager/shop/store/api/v1/references/ReferencesApi.java
ReferencesApi
measures
class ReferencesApi { private static final Logger LOGGER = LoggerFactory.getLogger(ReferencesApi.class); @Inject private StoreFacade storeFacade; @Inject private LanguageUtils languageUtils; @Inject private LanguageFacade languageFacade; @Inject private CountryFacade countryFacade; @Inject private Zo...
SizeReferences sizeReferences = new SizeReferences(); sizeReferences.setMeasures(Arrays.asList(MeasureUnit.values())); sizeReferences.setWeights(Arrays.asList(WeightUnit.values())); return sizeReferences;
472
66
538
<no_super_class>
shopizer-ecommerce_shopizer
shopizer/sm-shop/src/main/java/com/salesmanager/shop/store/api/v1/security/SecurityApi.java
SecurityApi
listPermissions
class SecurityApi { private static final Logger LOGGER = LoggerFactory.getLogger(SecurityApi.class); @Inject private PermissionService permissionService; @Inject private GroupService groupService; @ResponseStatus(HttpStatus.OK) @GetMapping({ "/private/{group}/permissions" }) @ApiOperation(httpMethod = "GET"...
Group g = null; try { g = groupService.findByName(group); if(g == null) { throw new ResourceNotFoundException("Group [" + group + "] does not exist"); } } catch (Exception e) { LOGGER.error("An error occured while getting group [" + group + "]",e); throw new ServiceRuntimeException("An error ...
495
242
737
<no_super_class>
shopizer-ecommerce_shopizer
shopizer/sm-shop/src/main/java/com/salesmanager/shop/store/api/v1/shipping/ShippingExpeditionApi.java
ShippingExpeditionApi
saveExpedition
class ShippingExpeditionApi { private static final Logger LOGGER = LoggerFactory.getLogger(ShippingExpeditionApi.class); @Autowired private AuthorizationUtils authorizationUtils; @Autowired private ShippingFacade shippingFacade; @RequestMapping(value = { "/private/shipping/expedition" }, method = RequestMet...
String user = authorizationUtils.authenticatedUser(); authorizationUtils.authorizeUser(user, Stream.of(Constants.GROUP_SUPERADMIN, Constants.GROUP_ADMIN, Constants.GROUP_SHIPPING, Constants.GROUP_ADMIN_RETAIL).collect(Collectors.toList()), merchantStore); shippingFacade.saveExpeditionConfiguration(expedit...
411
112
523
<no_super_class>
shopizer-ecommerce_shopizer
shopizer/sm-shop/src/main/java/com/salesmanager/shop/store/api/v1/system/ContactApi.java
ContactApi
contact
class ContactApi { @Inject private LanguageService languageService; @Inject private EmailTemplatesUtils emailTemplatesUtils; @PostMapping("/contact") @ApiOperation( httpMethod = "POST", value = "Sends an email contact us to store owner", notes = "", produces = "application/json") @...
Locale locale = languageService.toLocale(language, merchantStore); emailTemplatesUtils.sendContactEmail(contact, merchantStore, locale, request.getContextPath()); return new ResponseEntity<Void>(HttpStatus.OK);
210
61
271
<no_super_class>
shopizer-ecommerce_shopizer
shopizer/sm-shop/src/main/java/com/salesmanager/shop/store/api/v1/system/OptinApi.java
OptinApi
create
class OptinApi { private static final Logger LOGGER = LoggerFactory.getLogger(OptinApi.class); @Inject private OptinFacade optinFacade; /** Create new optin */ @PostMapping("/private/optin") @ApiOperation( httpMethod = "POST", value = "Creates an optin event type definition", notes = "",...
LOGGER.debug("[" + request.getUserPrincipal().getName() + "] creating optin [" + optin.getCode() + "]"); return optinFacade.create(optin, merchantStore, language);
236
57
293
<no_super_class>
shopizer-ecommerce_shopizer
shopizer/sm-shop/src/main/java/com/salesmanager/shop/store/api/v1/system/SearchToolsApi.java
SearchToolsApi
contact
class SearchToolsApi { private static final Logger LOGGER = LoggerFactory.getLogger(SearchToolsApi.class); @Inject private SearchFacade searchFacade; @Inject private UserFacade userFacade; @PostMapping("/private/system/search/index") @ApiOperation(httpMethod = "POST", value = "Indexes all products", notes = ...
// superadmin, admin and admin_catalogue String authenticatedUser = userFacade.authenticatedUser(); if (authenticatedUser == null) { throw new UnauthorizedException(); } Principal principal = request.getUserPrincipal(); String userName = principal.getName(); ReadableUser user = userFacade.findByUs...
201
311
512
<no_super_class>
shopizer-ecommerce_shopizer
shopizer/sm-shop/src/main/java/com/salesmanager/shop/store/api/v1/tax/TaxClassApi.java
TaxClassApi
exists
class TaxClassApi { private static final Logger LOGGER = LoggerFactory.getLogger(TaxClassApi.class); @Autowired private TaxFacade taxFacade; /** Create new tax class for a given MerchantStore */ @PostMapping("/private/tax/class") @ApiOperation(httpMethod = "POST", value = "Creates a taxClass", notes = "Require...
boolean exists = taxFacade.existsTaxClass(code, merchantStore, language); return new ResponseEntity<EntityExists>(new EntityExists(exists), HttpStatus.OK);
1,074
49
1,123
<no_super_class>
shopizer-ecommerce_shopizer
shopizer/sm-shop/src/main/java/com/salesmanager/shop/store/api/v1/tax/TaxRatesApi.java
TaxRatesApi
exists
class TaxRatesApi { private static final Logger LOGGER = LoggerFactory.getLogger(TaxRatesApi.class); @Autowired private TaxFacade taxFacade; /** Create new tax rate for a given MerchantStore */ @PostMapping("/private/tax/rate") @ApiOperation(httpMethod = "POST", value = "Creates a taxRate", notes = "Requires a...
boolean exists = taxFacade.existsTaxRate(code, merchantStore, language); return new ResponseEntity<EntityExists>(new EntityExists(exists), HttpStatus.OK);
1,078
49
1,127
<no_super_class>