Examples of StoreType


Examples of com.ebay.soap.eBLBaseComponents.StoreType

    public static Map<String,Object> getEbayStoreOutput(DispatchContext dctx, Map<String,Object> context) {
        Locale locale = (Locale) context.get("locale");
        GenericValue userLogin = (GenericValue) context.get("userLogin");
        Delegator delegator = dctx.getDelegator();
        Map<String,Object> result = FastMap.newInstance();
        StoreType returnedStoreType = null;
        GetStoreRequestType req = new GetStoreRequestType();
        GetStoreResponseType resp =  null;

        String userLoginId = null;
        if (context.get("productStoreId") != null) {
            String partyId = null;
            try {
                List<GenericValue> productStoreRoles = delegator.findByAnd("ProductStoreRole", UtilMisc.toMap("productStoreId", context.get("productStoreId").toString(),"roleTypeId","EBAY_ACCOUNT"));
                if (productStoreRoles.size() != 0) {
                    partyId=  (String)productStoreRoles.get(0).get("partyId");
                    List<GenericValue> userLogins = delegator.findByAnd("UserLogin", UtilMisc.toMap("partyId", partyId));
                    if (userLogins.size() != 0) {
                        userLoginId = (String)userLogins.get(0).get("userLoginId");
                    }

                }
            } catch (GenericEntityException e1) {
                e1.printStackTrace();
            }
            Debug.logInfo("userLoginId is "+userLoginId+" and productStoreId is "+ context.get("productStoreId"), module);
            GetStoreCall call = new GetStoreCall(EbayStoreHelper.getApiContext((String)context.get("productStoreId"), locale, delegator));
            //call.setSite(EbayHelper.getSiteCodeType((String)context.get("productStoreId"), locale, delegator));
            call.setCategoryStructureOnly(false);
            call.setUserID(userLoginId);

            try {
                resp = (GetStoreResponseType)call.execute(req);
                if (resp != null && "SUCCESS".equals(resp.getAck().toString())) {
                    returnedStoreType  = resp.getStore();
                    result.put(ModelService.RESPONSE_MESSAGE, ModelService.RESPOND_SUCCESS);
                    //result.put(ModelService.SUCCESS_MESSAGE, UtilProperties.getMessage(resource, "EbayStoreLoadSuccess", locale));
                    // update product store in ofbiz
                    updateProductStore(dctx, context, returnedStoreType,(String) context.get("productStoreId"));
                    Map<String,Object> ebayResp = FastMap.newInstance();
                    ebayResp.put("storeName", returnedStoreType.getName());
                    ebayResp.put("storeUrl", returnedStoreType.getURL());
                    ebayResp.put("storeUrlPath", returnedStoreType.getURLPath());
                    String desc = returnedStoreType.getDescription();
                    if (desc != null) desc  =  desc.trim();
                    ebayResp.put("storeDesc", desc);

                    StoreLogoType logoType = returnedStoreType.getLogo();
                    ebayResp.put("storeLogoId", logoType.getLogoID());
                    ebayResp.put("storeLogoName", logoType.getName());
                    ebayResp.put("storeLogoURL", logoType.getURL());

                    StoreThemeType themeType = returnedStoreType.getTheme();
                    ebayResp.put("storeThemeId", themeType.getThemeID());
                    ebayResp.put("storeThemeName", themeType.getName());

                    StoreColorSchemeType colorSchemeType = themeType.getColorScheme();
                    ebayResp.put("storeColorSchemeId", colorSchemeType.getColorSchemeID());

                    StoreColorType colorType = colorSchemeType.getColor();
                    ebayResp.put("storeColorPrimary", colorType.getPrimary());
                    ebayResp.put("storeColorAccent", colorType.getAccent());
                    ebayResp.put("storeColorSecondary", colorType.getSecondary());

                    StoreFontType fontType = colorSchemeType.getFont();
                    ebayResp.put("storeDescColor", fontType.getDescColor());
                    ebayResp.put("storeNameColor", fontType.getNameColor());
                    ebayResp.put("storeTitleColor", fontType.getTitleColor());

                    if (fontType != null) {// basic & advance theme
                        String themeId = themeType.getThemeID().toString().concat("-").concat(colorSchemeType.getColorSchemeID().toString());
                        context.put("themeId", themeId);
                        Map<String,Object> results = retrieveThemeColorSchemeByThemeId(dctx, context);
                        if (results != null) {
                            Map<String,Object> storeFontScheme = UtilGenerics.checkMap(results.get("storeFontScheme"));
                            if (storeFontScheme != null) {
                                ebayResp.put("storeDescFontFace", storeFontScheme.get("storeFontTypeFontDescValue"));
                                ebayResp.put("storeDescSizeCode", storeFontScheme.get("storeDescSizeValue"));

                                ebayResp.put("storeNameFontFace", storeFontScheme.get("storeFontTypeFontFaceValue"));
                                ebayResp.put("storeNameFontFaceSize", storeFontScheme.get("storeFontTypeSizeFaceValue"));

                                ebayResp.put("storeTitleFontFace", storeFontScheme.get("storeFontTypeFontTitleValue"));
                                ebayResp.put("storeTitleFontFaceSize", storeFontScheme.get("storeFontSizeTitleValue"));
                            }
                        }
                    }

                    StoreHeaderStyleCodeType storeHeaderStyleCodeType = returnedStoreType.getHeaderStyle();
                    ebayResp.put("storeHeaderStyle", storeHeaderStyleCodeType.value());
                    StoreHeaderStyleCodeType[] storeHeaderStyleCodeList =  StoreHeaderStyleCodeType.values();
                    if (storeHeaderStyleCodeList != null) {
                        List<Map<String,Object>> storeHeaderStyleList  = FastList.newInstance();
                        int i=0;
                        while (i<storeHeaderStyleCodeList.length) {
                            Map<String,Object> storeHeaderStyleMap = FastMap.newInstance();
                            StoreHeaderStyleCodeType storeHeaderStyleCode = storeHeaderStyleCodeList[i];
                            storeHeaderStyleMap.put("storeHeaderStyleName", storeHeaderStyleCode.name());
                            storeHeaderStyleMap.put("storeHeaderStyleValue", storeHeaderStyleCode.value());
                            storeHeaderStyleList.add(storeHeaderStyleMap);
                            i++;
                        }
                        ebayResp.put("storeHeaderStyleList", storeHeaderStyleList);
                    }

                    ebayResp.put("storeHomePage", returnedStoreType.getHomePage().toString());

                    StoreItemListLayoutCodeType storeItemListLayoutCodeType = returnedStoreType.getItemListLayout();
                    ebayResp.put("storeItemLayoutSelected", storeItemListLayoutCodeType.value());
                    StoreItemListLayoutCodeType[] storeItemListLayoutCodeTypeList = StoreItemListLayoutCodeType.values();
                    if (storeItemListLayoutCodeTypeList != null) {
                        List<Map<String,Object>> storeItemListLayoutCodeList  = FastList.newInstance();
                        int i = 0;
                        while (i < storeItemListLayoutCodeTypeList.length) {
                            Map<String,Object> storeItemListLayoutCodeMap = FastMap.newInstance();
                            StoreItemListLayoutCodeType storeItemListLayoutCode = storeItemListLayoutCodeTypeList[i];
                            storeItemListLayoutCodeMap.put("storeItemLayoutName", storeItemListLayoutCode.name());
                            storeItemListLayoutCodeMap.put("storeItemLayoutValue", storeItemListLayoutCode.value());
                            storeItemListLayoutCodeList.add(storeItemListLayoutCodeMap);
                            i++;
                        }
                        ebayResp.put("storeItemLayoutList", storeItemListLayoutCodeList);
                    }
                    StoreItemListSortOrderCodeType storeItemListSortOrderCodeType = returnedStoreType.getItemListSortOrder();
                    ebayResp.put("storeItemSortOrderSelected", storeItemListSortOrderCodeType.value());
                    StoreItemListSortOrderCodeType[] storeItemListSortOrderCodeTypeList = StoreItemListSortOrderCodeType.values();
                    if (storeItemListSortOrderCodeTypeList != null) {
                        List<Map<String,Object>> storeItemSortOrderCodeList  = FastList.newInstance();
                        int i = 0;
                        while (i < storeItemListSortOrderCodeTypeList.length) {
                            Map<String,Object> storeItemSortOrderCodeMap = FastMap.newInstance();
                            StoreItemListSortOrderCodeType storeItemListLayoutCode = storeItemListSortOrderCodeTypeList[i];
                            storeItemSortOrderCodeMap.put("storeItemSortLayoutName", storeItemListLayoutCode.name());
                            storeItemSortOrderCodeMap.put("storeItemSortLayoutValue", storeItemListLayoutCode.value());
                            storeItemSortOrderCodeList.add(storeItemSortOrderCodeMap);
                            i++;
                        }
                        ebayResp.put("storeItemSortOrderList", storeItemSortOrderCodeList);
                    }

                    ebayResp.put("storeCustomHeader", returnedStoreType.getCustomHeader());
                    StoreCustomHeaderLayoutCodeType storeCustomHeaderLayoutCodeType = returnedStoreType.getCustomHeaderLayout();
                    ebayResp.put("storeCustomHeaderLayout", storeCustomHeaderLayoutCodeType.value());
                    StoreCustomHeaderLayoutCodeType[] storeCustomHeaderLayoutCodeTypeList = StoreCustomHeaderLayoutCodeType.values();
                    if (storeCustomHeaderLayoutCodeTypeList != null) {
                        List<Map<String,Object>> storeCustomHeaderLayoutList  = FastList.newInstance();
                        int i = 0;
                        while (i < storeCustomHeaderLayoutCodeTypeList.length) {
                            Map<String,Object> storeCustomHeaderLayoutMap = FastMap.newInstance();
                            StoreCustomHeaderLayoutCodeType StoreCustomHeaderLayoutCode = storeCustomHeaderLayoutCodeTypeList[i];
                            storeCustomHeaderLayoutMap.put("storeCustomHeaderLayoutName", StoreCustomHeaderLayoutCode.name());
                            storeCustomHeaderLayoutMap.put("storeCustomHeaderLayoutValue", StoreCustomHeaderLayoutCode.value());
                            storeCustomHeaderLayoutList.add(storeCustomHeaderLayoutMap);
                            i++;
                        }
                        ebayResp.put("storeCustomHeaderLayoutList", storeCustomHeaderLayoutList);
                    }

                    StoreCustomListingHeaderType storeCustomListingHeaderType = returnedStoreType.getCustomListingHeader();
                    if (storeCustomListingHeaderType != null) {
                        StoreCustomListingHeaderDisplayCodeType storeCustomListingHeaderDisplayCodeType = storeCustomListingHeaderType.getDisplayType();
                        ebayResp.put("isLogo", storeCustomListingHeaderType.isLogo());
                        ebayResp.put("isSearchBox", storeCustomListingHeaderType.isSearchBox());
                        ebayResp.put("isAddToFavoriteStores", storeCustomListingHeaderType.isAddToFavoriteStores());
                        ebayResp.put("isSignUpForStoreNewsletter", storeCustomListingHeaderType.isSignUpForStoreNewsletter());

                        ebayResp.put("storeCustomListingHeaderDisplayName", storeCustomListingHeaderDisplayCodeType.name());
                        ebayResp.put("storeCustomListingHeaderDisplayValue", storeCustomListingHeaderDisplayCodeType.value());
                        StoreCustomListingHeaderDisplayCodeType[] storeCustomListingHeaderDisplayCodeTypeList = StoreCustomListingHeaderDisplayCodeType.values();
                        if (storeCustomListingHeaderDisplayCodeTypeList != null) {
                            List<Map<String,Object>> storeCustomListingHeaderDisplayCodeList  = FastList.newInstance();
                            int i = 0;
                            while (i < storeCustomListingHeaderDisplayCodeTypeList.length) {
                                Map<String,Object> storeCustomListingHeaderDisplayCodeMap = FastMap.newInstance();
                                StoreCustomListingHeaderDisplayCodeType storeCustomListingHeaderDisplayCode = storeCustomListingHeaderDisplayCodeTypeList[i];
                                storeCustomListingHeaderDisplayCodeMap.put("storeCustomHeaderLayoutName", storeCustomListingHeaderDisplayCode.name());
                                storeCustomListingHeaderDisplayCodeMap.put("storeCustomHeaderLayoutValue", storeCustomListingHeaderDisplayCode.value());
                                storeCustomListingHeaderDisplayCodeList.add(storeCustomListingHeaderDisplayCodeMap);
                                i++;
                            }
                            ebayResp.put("storeCustomListingHeaderDisplayList", storeCustomListingHeaderDisplayCodeList);
                        }
                    }

                    //CustomListingHeader
                    MerchDisplayCodeType merchDisplayCodeType = returnedStoreType.getMerchDisplay();
                    ebayResp.put("storeMerchDisplay",merchDisplayCodeType.value());
                    MerchDisplayCodeType[] merchDisplayCodeTypeList = MerchDisplayCodeType.values();
                    if (merchDisplayCodeTypeList != null) {
                        List<Map<String,Object>> merchDisplayCodeList = FastList.newInstance();
                        int i = 0;
                        while (i < merchDisplayCodeTypeList.length) {
                            Map<String,Object> merchDisplayCodeMap = FastMap.newInstance();
                            MerchDisplayCodeType merchDisplayCode = merchDisplayCodeTypeList[i];
                            merchDisplayCodeMap.put("merchDisplayCodeName", merchDisplayCode.name());
                            merchDisplayCodeMap.put("merchDisplayCodeValue", merchDisplayCode.value());
                            merchDisplayCodeList.add(merchDisplayCodeMap);
                            i++;
                        }
                        ebayResp.put("storeMerchDisplayList",merchDisplayCodeList);
                    }

                    Calendar calendar = returnedStoreType.getLastOpenedTime();
                    ebayResp.put("storeLastOpenedTime", calendar.getTime().toString());
                    ebayResp.put("storeSubscriptionLevel", returnedStoreType.getSubscriptionLevel().value());
                    returnedStoreType.getSubscriptionLevel();
                    StoreSubscriptionLevelCodeType[] storeSubscriptionlevelList = StoreSubscriptionLevelCodeType.values();
                    if (storeSubscriptionlevelList != null) {
                        List<Map<String,Object>> storeSubscriptionLevelCodeList = FastList.newInstance();
                        int i = 0;
                        while (i < storeSubscriptionlevelList.length) {
View Full Code Here

Examples of com.ebay.soap.eBLBaseComponents.StoreType

        Map<String,Object> result = FastMap.newInstance();
        Locale locale = (Locale) context.get("locale");
        Delegator delegator = dctx.getDelegator();
        SetStoreRequestType req = null;
        SetStoreResponseType resp  = null;
        StoreType storeType = null;
        try {
            if (context.get("productStoreId") != null) {
                SetStoreCall  call = new SetStoreCall(EbayStoreHelper.getApiContext((String)context.get("productStoreId"), locale, delegator));
                req = new SetStoreRequestType();

                storeType = new StoreType();
                storeType.setName((String)context.get("storeName"));
                storeType.setDescription((String)context.get("storeDesc"));
                storeType.setURL((String)context.get("storeUrl"));
                storeType.setURLPath("");
                StoreLogoType storeLogo = new StoreLogoType();
                if (context.get("storeLogoURL") == null) {
                    if (context.get("storeLogoId") != null) storeLogo.setLogoID(Integer.parseInt((String)context.get("storeLogoId")));
                    storeLogo.setName((String)context.get("storeLogoName"));
                } else {
                    storeLogo.setURL((String)context.get("storeLogoURL"));
                }
                storeType.setLogo(storeLogo);

                StoreThemeType storeTheme = new StoreThemeType();
                StoreColorSchemeType storeColorScheme = null;
                StoreColorType storecolor = null;
                StoreFontType storeFont = null;
                if (context.get("themeType").equals("Advanced")) {
                    storeColorScheme = new StoreColorSchemeType();
                    if (context.get("storeAdvancedThemeColor") != null) storeColorScheme.setColorSchemeID(Integer.parseInt((String)context.get("storeAdvancedThemeColor")));

                    storecolor = new StoreColorType();
                    storecolor.setPrimary((String)context.get("storePrimaryColor"));
                    storecolor.setSecondary((String)context.get("storeSecondaryColor"));
                    storecolor.setAccent((String)context.get("storeAccentColor"));
                    storeColorScheme.setColor(storecolor);
                    storeTheme.setColorScheme(storeColorScheme);
                    storeTheme.setName(null);
                    storeTheme.setThemeID(Integer.parseInt((String)context.get("storeAdvancedTheme")));
                } else if (context.get("themeType").equals("Basic")) {
                    storeColorScheme = new StoreColorSchemeType();
                    if (context.get("storeBasicTheme")!=null) {
                        String storeBasicTheme = (String)context.get("storeBasicTheme");
                        String storeThemeId = null;
                        String storeColorSchemeId = null;
                        if (storeBasicTheme.indexOf("-") != -1) {
                            storeThemeId = storeBasicTheme.substring(0, storeBasicTheme.indexOf("-"));
                            storeColorSchemeId = storeBasicTheme.substring(storeBasicTheme.indexOf("-")+1);
                        }
                        if (storeColorSchemeId != null) storeColorScheme.setColorSchemeID(Integer.parseInt(storeColorSchemeId));

                        storecolor = new StoreColorType();
                        storecolor.setPrimary((String)context.get("storePrimaryColor"));
                        storecolor.setSecondary((String)context.get("storeSecondaryColor"));
                        storecolor.setAccent((String)context.get("storeAccentColor"));
                        storeColorScheme.setColor(storecolor);

                        storeFont = new StoreFontType();
                        storeFont.setNameColor((String)context.get("storeNameFontColor"));
                        storeFont.setNameFace(StoreFontFaceCodeType.valueOf((String)context.get("storeNameFont")));
                        storeFont.setNameSize(StoreFontSizeCodeType.valueOf((String)context.get("storeNameFontSize")));

                        storeFont.setTitleColor((String)context.get("storeTitleFontColor"));
                        storeFont.setTitleFace(StoreFontFaceCodeType.valueOf((String)context.get("storeTitleFont")));
                        storeFont.setTitleSize(StoreFontSizeCodeType.valueOf((String)context.get("storeTitleFontSize")));

                        storeFont.setDescColor((String)context.get("storeDescFontColor"));
                        storeFont.setDescFace(StoreFontFaceCodeType.valueOf((String)context.get("storeDescFont")));
                        storeFont.setDescSize(StoreFontSizeCodeType.valueOf((String)context.get("storeDescFontSize")));

                        storeColorScheme.setFont(storeFont);

                        storeTheme.setColorScheme(storeColorScheme);
                        storeTheme.setName(null);
                        storeTheme.setThemeID(Integer.parseInt(storeThemeId));
                    }
                }
                storeType.setTheme(storeTheme);
                storeType.setHeaderStyle(StoreHeaderStyleCodeType.valueOf((String)context.get("storeHeaderStyle")));
                storeType.setItemListLayout(StoreItemListLayoutCodeType.valueOf((String)context.get("storeItemLayout")));
                storeType.setItemListSortOrder(StoreItemListSortOrderCodeType.valueOf((String)context.get("storeItemSortOrder")));
                storeType.setMerchDisplay(MerchDisplayCodeType.valueOf((String)context.get("storeMerchDisplay")));
                storeType.setSubscriptionLevel(StoreSubscriptionLevelCodeType.valueOf((String)context.get("storeSubscriptionDisplay")));

                storeType.setCustomHeader((String)context.get("storeCustomHeader"));
                storeType.setCustomHeaderLayout(StoreCustomHeaderLayoutCodeType.valueOf((String)context.get("storeCustomHeaderLayout")));

                if ( storeType == null )
                      throw new SdkException("StoreType property is not set.");

                req.setStore(storeType);
View Full Code Here

Examples of com.ebay.soap.eBLBaseComponents.StoreType

            GetStoreCall call = new GetStoreCall(this.apiContext);
            GetStoreRequestType req = new GetStoreRequestType();
            GetStoreResponseType resp = null;
            resp = (GetStoreResponseType) call.execute(req);
            if (resp != null && "SUCCESS".equals(resp.getAck().toString())) {
                StoreType store = resp.getStore();
                StoreCustomCategoryArrayType categoriesArr = store.getCustomCategories();
                StoreCustomCategoryType[] cateogries = categoriesArr.getCustomCategory();
                for (StoreCustomCategoryType cat : cateogries) {
                    String categoryId = Long.toString(cat.getCategoryID());
                    catsMap.put(categoryId, cat);
                }
View Full Code Here

Examples of com.ebay.soap.eBLBaseComponents.StoreType

        Map<String,Object> result = FastMap.newInstance();
        Locale locale = (Locale) context.get("locale");
        Delegator delegator = dctx.getDelegator();
        SetStoreRequestType req = null;
        SetStoreResponseType resp  = null;
        StoreType storeType = null;
        try {
            if (context.get("productStoreId") != null) {
                SetStoreCall  call = new SetStoreCall(EbayStoreHelper.getApiContext((String)context.get("productStoreId"), locale, delegator));
                req = new SetStoreRequestType();

                storeType = new StoreType();
                storeType.setName((String)context.get("storeName"));
                storeType.setDescription((String)context.get("storeDesc"));
                storeType.setURL((String)context.get("storeUrl"));
                storeType.setURLPath("");
                StoreLogoType storeLogo = new StoreLogoType();
                if (context.get("storeLogoURL") == null) {
                    if (context.get("storeLogoId") != null) storeLogo.setLogoID(Integer.parseInt((String)context.get("storeLogoId")));
                    storeLogo.setName((String)context.get("storeLogoName"));
                } else {
                    storeLogo.setURL((String)context.get("storeLogoURL"));
                }
                storeType.setLogo(storeLogo);

                StoreThemeType storeTheme = new StoreThemeType();
                StoreColorSchemeType storeColorScheme = null;
                StoreColorType storecolor = null;
                StoreFontType storeFont = null;
                if (context.get("themeType").equals("Advanced")) {
                    storeColorScheme = new StoreColorSchemeType();
                    if (context.get("storeAdvancedThemeColor") != null) storeColorScheme.setColorSchemeID(Integer.parseInt((String)context.get("storeAdvancedThemeColor")));

                    storecolor = new StoreColorType();
                    storecolor.setPrimary((String)context.get("storePrimaryColor"));
                    storecolor.setSecondary((String)context.get("storeSecondaryColor"));
                    storecolor.setAccent((String)context.get("storeAccentColor"));
                    storeColorScheme.setColor(storecolor);
                    storeTheme.setColorScheme(storeColorScheme);
                    storeTheme.setName(null);
                    storeTheme.setThemeID(Integer.parseInt((String)context.get("storeAdvancedTheme")));
                } else if (context.get("themeType").equals("Basic")) {
                    storeColorScheme = new StoreColorSchemeType();
                    if (context.get("storeBasicTheme")!=null) {
                        String storeBasicTheme = (String)context.get("storeBasicTheme");
                        String storeThemeId = null;
                        String storeColorSchemeId = null;
                        if (storeBasicTheme.indexOf("-") != -1) {
                            storeThemeId = storeBasicTheme.substring(0, storeBasicTheme.indexOf("-"));
                            storeColorSchemeId = storeBasicTheme.substring(storeBasicTheme.indexOf("-")+1);
                        }
                        if (storeColorSchemeId != null) storeColorScheme.setColorSchemeID(Integer.parseInt(storeColorSchemeId));

                        storecolor = new StoreColorType();
                        storecolor.setPrimary((String)context.get("storePrimaryColor"));
                        storecolor.setSecondary((String)context.get("storeSecondaryColor"));
                        storecolor.setAccent((String)context.get("storeAccentColor"));
                        storeColorScheme.setColor(storecolor);

                        storeFont = new StoreFontType();
                        storeFont.setNameColor((String)context.get("storeNameFontColor"));
                        storeFont.setNameFace(StoreFontFaceCodeType.valueOf((String)context.get("storeNameFont")));
                        storeFont.setNameSize(StoreFontSizeCodeType.valueOf((String)context.get("storeNameFontSize")));

                        storeFont.setTitleColor((String)context.get("storeTitleFontColor"));
                        storeFont.setTitleFace(StoreFontFaceCodeType.valueOf((String)context.get("storeTitleFont")));
                        storeFont.setTitleSize(StoreFontSizeCodeType.valueOf((String)context.get("storeTitleFontSize")));

                        storeFont.setDescColor((String)context.get("storeDescFontColor"));
                        storeFont.setDescFace(StoreFontFaceCodeType.valueOf((String)context.get("storeDescFont")));
                        storeFont.setDescSize(StoreFontSizeCodeType.valueOf((String)context.get("storeDescFontSize")));

                        storeColorScheme.setFont(storeFont);

                        storeTheme.setColorScheme(storeColorScheme);
                        storeTheme.setName(null);
                        storeTheme.setThemeID(Integer.parseInt(storeThemeId));
                    }
                }
                storeType.setTheme(storeTheme);
                storeType.setHeaderStyle(StoreHeaderStyleCodeType.valueOf((String)context.get("storeHeaderStyle")));
                storeType.setItemListLayout(StoreItemListLayoutCodeType.valueOf((String)context.get("storeItemLayout")));
                storeType.setItemListSortOrder(StoreItemListSortOrderCodeType.valueOf((String)context.get("storeItemSortOrder")));
                storeType.setMerchDisplay(MerchDisplayCodeType.valueOf((String)context.get("storeMerchDisplay")));
                storeType.setSubscriptionLevel(StoreSubscriptionLevelCodeType.valueOf((String)context.get("storeSubscriptionDisplay")));

                storeType.setCustomHeader((String)context.get("storeCustomHeader"));
                storeType.setCustomHeaderLayout(StoreCustomHeaderLayoutCodeType.valueOf((String)context.get("storeCustomHeaderLayout")));

                if ( storeType == null )
                      throw new SdkException("StoreType property is not set.");

                req.setStore(storeType);
View Full Code Here

Examples of com.ebay.soap.eBLBaseComponents.StoreType

    public static Map<String,Object> getEbayStoreOutput(DispatchContext dctx, Map<String,Object> context) {
        Locale locale = (Locale) context.get("locale");
        GenericValue userLogin = (GenericValue) context.get("userLogin");
        Delegator delegator = dctx.getDelegator();
        Map<String,Object> result = FastMap.newInstance();
        StoreType returnedStoreType = null;
        GetStoreRequestType req = new GetStoreRequestType();
        GetStoreResponseType resp =  null;

        String userLoginId = null;
        if (context.get("productStoreId") != null) {
            String partyId = null;
            try {
                List<GenericValue> productStoreRoles = delegator.findByAnd("ProductStoreRole", UtilMisc.toMap("productStoreId", context.get("productStoreId").toString(),"roleTypeId","EBAY_ACCOUNT"));
                if (productStoreRoles.size() != 0) {
                    partyId=  (String)productStoreRoles.get(0).get("partyId");
                    List<GenericValue> userLogins = delegator.findByAnd("UserLogin", UtilMisc.toMap("partyId", partyId));
                    if (userLogins.size() != 0) {
                        userLoginId = (String)userLogins.get(0).get("userLoginId");
                    }

                }
            } catch (GenericEntityException e1) {
                e1.printStackTrace();
            }
            Debug.log("userLoginId is "+userLoginId+" and productStoreId is "+ context.get("productStoreId"));
            GetStoreCall call = new GetStoreCall(EbayStoreHelper.getApiContext((String)context.get("productStoreId"), locale, delegator));
            //call.setSite(EbayHelper.getSiteCodeType((String)context.get("productStoreId"), locale, delegator));
            call.setCategoryStructureOnly(false);
            call.setUserID(userLoginId);

            try {
                resp = (GetStoreResponseType)call.execute(req);
                if (resp != null && "SUCCESS".equals(resp.getAck().toString())) {
                    returnedStoreType  = resp.getStore();
                    result.put(ModelService.RESPONSE_MESSAGE, ModelService.RESPOND_SUCCESS);
                    //result.put(ModelService.SUCCESS_MESSAGE, UtilProperties.getMessage(resource, "EbayStoreLoadSuccess", locale));
                    // update product store in ofbiz
                    updateProductStore(dctx, context, returnedStoreType,(String) context.get("productStoreId"));
                    Map<String,Object> ebayResp = FastMap.newInstance();
                    ebayResp.put("storeName", returnedStoreType.getName());
                    ebayResp.put("storeUrl", returnedStoreType.getURL());
                    ebayResp.put("storeUrlPath", returnedStoreType.getURLPath());
                    String desc = returnedStoreType.getDescription();
                    if (desc != null) desc  =  desc.trim();
                    ebayResp.put("storeDesc", desc);

                    StoreLogoType logoType = returnedStoreType.getLogo();
                    ebayResp.put("storeLogoId", logoType.getLogoID());
                    ebayResp.put("storeLogoName", logoType.getName());
                    ebayResp.put("storeLogoURL", logoType.getURL());

                    StoreThemeType themeType = returnedStoreType.getTheme();
                    ebayResp.put("storeThemeId", themeType.getThemeID());
                    ebayResp.put("storeThemeName", themeType.getName());

                    StoreColorSchemeType colorSchemeType = themeType.getColorScheme();
                    ebayResp.put("storeColorSchemeId", colorSchemeType.getColorSchemeID());

                    StoreColorType colorType = colorSchemeType.getColor();
                    ebayResp.put("storeColorPrimary", colorType.getPrimary());
                    ebayResp.put("storeColorAccent", colorType.getAccent());
                    ebayResp.put("storeColorSecondary", colorType.getSecondary());

                    StoreFontType fontType = colorSchemeType.getFont();
                    ebayResp.put("storeDescColor", fontType.getDescColor());
                    ebayResp.put("storeNameColor", fontType.getNameColor());
                    ebayResp.put("storeTitleColor", fontType.getTitleColor());

                    if (fontType != null) {// basic & advance theme
                        String themeId = themeType.getThemeID().toString().concat("-").concat(colorSchemeType.getColorSchemeID().toString());
                        context.put("themeId", themeId);
                        Map<String,Object> results = retrieveThemeColorSchemeByThemeId(dctx, context);
                        if (results != null) {
                            Map<String,Object> storeFontScheme = UtilGenerics.checkMap(results.get("storeFontScheme"));
                            if (storeFontScheme != null) {
                                ebayResp.put("storeDescFontFace", storeFontScheme.get("storeFontTypeFontDescValue"));
                                ebayResp.put("storeDescSizeCode", storeFontScheme.get("storeDescSizeValue"));

                                ebayResp.put("storeNameFontFace", storeFontScheme.get("storeFontTypeFontFaceValue"));
                                ebayResp.put("storeNameFontFaceSize", storeFontScheme.get("storeFontTypeSizeFaceValue"));

                                ebayResp.put("storeTitleFontFace", storeFontScheme.get("storeFontTypeFontTitleValue"));
                                ebayResp.put("storeTitleFontFaceSize", storeFontScheme.get("storeFontSizeTitleValue"));
                            }
                        }
                    }

                    StoreHeaderStyleCodeType storeHeaderStyleCodeType = returnedStoreType.getHeaderStyle();
                    ebayResp.put("storeHeaderStyle", storeHeaderStyleCodeType.value());
                    StoreHeaderStyleCodeType[] storeHeaderStyleCodeList =  StoreHeaderStyleCodeType.values();
                    if (storeHeaderStyleCodeList != null) {
                        List<Map<String,Object>> storeHeaderStyleList  = FastList.newInstance();
                        int i=0;
                        while (i<storeHeaderStyleCodeList.length) {
                            Map<String,Object> storeHeaderStyleMap = FastMap.newInstance();
                            StoreHeaderStyleCodeType storeHeaderStyleCode = storeHeaderStyleCodeList[i];
                            storeHeaderStyleMap.put("storeHeaderStyleName", storeHeaderStyleCode.name());
                            storeHeaderStyleMap.put("storeHeaderStyleValue", storeHeaderStyleCode.value());
                            storeHeaderStyleList.add(storeHeaderStyleMap);
                            i++;
                        }
                        ebayResp.put("storeHeaderStyleList", storeHeaderStyleList);
                    }

                    ebayResp.put("storeHomePage", returnedStoreType.getHomePage().toString());

                    StoreItemListLayoutCodeType storeItemListLayoutCodeType = returnedStoreType.getItemListLayout();
                    ebayResp.put("storeItemLayoutSelected", storeItemListLayoutCodeType.value());
                    StoreItemListLayoutCodeType[] storeItemListLayoutCodeTypeList = StoreItemListLayoutCodeType.values();
                    if (storeItemListLayoutCodeTypeList != null) {
                        List<Map<String,Object>> storeItemListLayoutCodeList  = FastList.newInstance();
                        int i = 0;
                        while (i < storeItemListLayoutCodeTypeList.length) {
                            Map<String,Object> storeItemListLayoutCodeMap = FastMap.newInstance();
                            StoreItemListLayoutCodeType storeItemListLayoutCode = storeItemListLayoutCodeTypeList[i];
                            storeItemListLayoutCodeMap.put("storeItemLayoutName", storeItemListLayoutCode.name());
                            storeItemListLayoutCodeMap.put("storeItemLayoutValue", storeItemListLayoutCode.value());
                            storeItemListLayoutCodeList.add(storeItemListLayoutCodeMap);
                            i++;
                        }
                        ebayResp.put("storeItemLayoutList", storeItemListLayoutCodeList);
                    }
                    StoreItemListSortOrderCodeType storeItemListSortOrderCodeType = returnedStoreType.getItemListSortOrder();
                    ebayResp.put("storeItemSortOrderSelected", storeItemListSortOrderCodeType.value());
                    StoreItemListSortOrderCodeType[] storeItemListSortOrderCodeTypeList = StoreItemListSortOrderCodeType.values();
                    if (storeItemListSortOrderCodeTypeList != null) {
                        List<Map<String,Object>> storeItemSortOrderCodeList  = FastList.newInstance();
                        int i = 0;
                        while (i < storeItemListSortOrderCodeTypeList.length) {
                            Map<String,Object> storeItemSortOrderCodeMap = FastMap.newInstance();
                            StoreItemListSortOrderCodeType storeItemListLayoutCode = storeItemListSortOrderCodeTypeList[i];
                            storeItemSortOrderCodeMap.put("storeItemSortLayoutName", storeItemListLayoutCode.name());
                            storeItemSortOrderCodeMap.put("storeItemSortLayoutValue", storeItemListLayoutCode.value());
                            storeItemSortOrderCodeList.add(storeItemSortOrderCodeMap);
                            i++;
                        }
                        ebayResp.put("storeItemSortOrderList", storeItemSortOrderCodeList);
                    }

                    ebayResp.put("storeCustomHeader", returnedStoreType.getCustomHeader());
                    StoreCustomHeaderLayoutCodeType storeCustomHeaderLayoutCodeType = returnedStoreType.getCustomHeaderLayout();
                    ebayResp.put("storeCustomHeaderLayout", storeCustomHeaderLayoutCodeType.value());
                    StoreCustomHeaderLayoutCodeType[] storeCustomHeaderLayoutCodeTypeList = StoreCustomHeaderLayoutCodeType.values();
                    if (storeCustomHeaderLayoutCodeTypeList != null) {
                        List<Map<String,Object>> storeCustomHeaderLayoutList  = FastList.newInstance();
                        int i = 0;
                        while (i < storeCustomHeaderLayoutCodeTypeList.length) {
                            Map<String,Object> storeCustomHeaderLayoutMap = FastMap.newInstance();
                            StoreCustomHeaderLayoutCodeType StoreCustomHeaderLayoutCode = storeCustomHeaderLayoutCodeTypeList[i];
                            storeCustomHeaderLayoutMap.put("storeCustomHeaderLayoutName", StoreCustomHeaderLayoutCode.name());
                            storeCustomHeaderLayoutMap.put("storeCustomHeaderLayoutValue", StoreCustomHeaderLayoutCode.value());
                            storeCustomHeaderLayoutList.add(storeCustomHeaderLayoutMap);
                            i++;
                        }
                        ebayResp.put("storeCustomHeaderLayoutList", storeCustomHeaderLayoutList);
                    }

                    StoreCustomListingHeaderType storeCustomListingHeaderType = returnedStoreType.getCustomListingHeader();
                    if (storeCustomListingHeaderType != null) {
                        StoreCustomListingHeaderDisplayCodeType storeCustomListingHeaderDisplayCodeType = storeCustomListingHeaderType.getDisplayType();
                        ebayResp.put("isLogo", storeCustomListingHeaderType.isLogo());
                        ebayResp.put("isSearchBox", storeCustomListingHeaderType.isSearchBox());
                        ebayResp.put("isAddToFavoriteStores", storeCustomListingHeaderType.isAddToFavoriteStores());
                        ebayResp.put("isSignUpForStoreNewsletter", storeCustomListingHeaderType.isSignUpForStoreNewsletter());

                        ebayResp.put("storeCustomListingHeaderDisplayName", storeCustomListingHeaderDisplayCodeType.name());
                        ebayResp.put("storeCustomListingHeaderDisplayValue", storeCustomListingHeaderDisplayCodeType.value());
                        StoreCustomListingHeaderDisplayCodeType[] storeCustomListingHeaderDisplayCodeTypeList = StoreCustomListingHeaderDisplayCodeType.values();
                        if (storeCustomListingHeaderDisplayCodeTypeList != null) {
                            List<Map<String,Object>> storeCustomListingHeaderDisplayCodeList  = FastList.newInstance();
                            int i = 0;
                            while (i < storeCustomListingHeaderDisplayCodeTypeList.length) {
                                Map<String,Object> storeCustomListingHeaderDisplayCodeMap = FastMap.newInstance();
                                StoreCustomListingHeaderDisplayCodeType storeCustomListingHeaderDisplayCode = storeCustomListingHeaderDisplayCodeTypeList[i];
                                storeCustomListingHeaderDisplayCodeMap.put("storeCustomHeaderLayoutName", storeCustomListingHeaderDisplayCode.name());
                                storeCustomListingHeaderDisplayCodeMap.put("storeCustomHeaderLayoutValue", storeCustomListingHeaderDisplayCode.value());
                                storeCustomListingHeaderDisplayCodeList.add(storeCustomListingHeaderDisplayCodeMap);
                                i++;
                            }
                            ebayResp.put("storeCustomListingHeaderDisplayList", storeCustomListingHeaderDisplayCodeList);
                        }
                    }

                    //CustomListingHeader
                    MerchDisplayCodeType merchDisplayCodeType = returnedStoreType.getMerchDisplay();
                    ebayResp.put("storeMerchDisplay",merchDisplayCodeType.value());
                    MerchDisplayCodeType[] merchDisplayCodeTypeList = MerchDisplayCodeType.values();
                    if (merchDisplayCodeTypeList != null) {
                        List<Map<String,Object>> merchDisplayCodeList = FastList.newInstance();
                        int i = 0;
                        while (i < merchDisplayCodeTypeList.length) {
                            Map<String,Object> merchDisplayCodeMap = FastMap.newInstance();
                            MerchDisplayCodeType merchDisplayCode = merchDisplayCodeTypeList[i];
                            merchDisplayCodeMap.put("merchDisplayCodeName", merchDisplayCode.name());
                            merchDisplayCodeMap.put("merchDisplayCodeValue", merchDisplayCode.value());
                            merchDisplayCodeList.add(merchDisplayCodeMap);
                            i++;
                        }
                        ebayResp.put("storeMerchDisplayList",merchDisplayCodeList);
                    }

                    Calendar calendar = returnedStoreType.getLastOpenedTime();
                    ebayResp.put("storeLastOpenedTime", calendar.getTime().toString());
                    ebayResp.put("storeSubscriptionLevel", returnedStoreType.getSubscriptionLevel().value());
                    returnedStoreType.getSubscriptionLevel();
                    StoreSubscriptionLevelCodeType[] storeSubscriptionlevelList = StoreSubscriptionLevelCodeType.values();
                    if (storeSubscriptionlevelList != null) {
                        List<Map<String,Object>> storeSubscriptionLevelCodeList = FastList.newInstance();
                        int i = 0;
                        while (i < storeSubscriptionlevelList.length) {
View Full Code Here

Examples of com.ebay.soap.eBLBaseComponents.StoreType

    public static Map<String,Object> getEbayStoreOutput(DispatchContext dctx, Map<String,Object> context) {
        Locale locale = (Locale) context.get("locale");
        GenericValue userLogin = (GenericValue) context.get("userLogin");
        Delegator delegator = dctx.getDelegator();
        Map<String,Object> result = FastMap.newInstance();
        StoreType returnedStoreType = null;
        GetStoreRequestType req = new GetStoreRequestType();
        GetStoreResponseType resp =  null;

        String userLoginId = null;
        String password = null;
        if (context.get("productStoreId") != null) {
            String partyId = null;
            try {
                List<GenericValue> productStoreRoles = delegator.findByAnd("ProductStoreRole", UtilMisc.toMap("productStoreId", context.get("productStoreId").toString(),"roleTypeId","EBAY_ACCOUNT"));
                if (productStoreRoles.size() != 0) {
                    partyId=  (String)productStoreRoles.get(0).get("partyId");
                    List<GenericValue> userLogins = delegator.findByAnd("UserLogin", UtilMisc.toMap("partyId", partyId));
                    if (userLogins.size() != 0) {
                        userLoginId = (String)userLogins.get(0).get("userLoginId");
                        password = (String)userLogins.get(0).get("currentPassword");
                    }
                   
                }
            } catch (GenericEntityException e1) {
                e1.printStackTrace();
            }
            Debug.logInfo("userLoginId is "+userLoginId+" and productStoreId is "+ context.get("productStoreId"), module);
            GetStoreCall call = new GetStoreCall(EbayStoreHelper.getApiContext((String)context.get("productStoreId"), locale, delegator));
            //call.setSite(EbayHelper.getSiteCodeType((String)context.get("productStoreId"), locale, delegator));
            call.setCategoryStructureOnly(false);
            call.setUserID(userLoginId);

            try {
                resp = (GetStoreResponseType)call.execute(req);
                if (resp != null && "SUCCESS".equals(resp.getAck().toString())) {
                    returnedStoreType  = resp.getStore();
                    result.put(ModelService.RESPONSE_MESSAGE, ModelService.RESPOND_SUCCESS);
                    //result.put(ModelService.SUCCESS_MESSAGE, UtilProperties.getMessage(resource, "EbayStoreLoadSuccess", locale));
                    // update product store in ofbiz
                    updateProductStore(dctx, context, returnedStoreType,(String) context.get("productStoreId"));
                    Map<String,Object> ebayResp = FastMap.newInstance();
                    ebayResp.put("storeName", returnedStoreType.getName());
                    ebayResp.put("storeUrl", returnedStoreType.getURL());
                    ebayResp.put("storeUrlPath", returnedStoreType.getURLPath());
                    String desc = returnedStoreType.getDescription();
                    if (desc != null) desc  =  desc.trim();
                    ebayResp.put("storeDesc", desc);

                    StoreLogoType logoType = returnedStoreType.getLogo();
                    ebayResp.put("storeLogoId", logoType.getLogoID());
                    ebayResp.put("storeLogoName", logoType.getName());
                    ebayResp.put("storeLogoURL", logoType.getURL());

                    StoreThemeType themeType = returnedStoreType.getTheme();
                    ebayResp.put("storeThemeId", themeType.getThemeID());
                    ebayResp.put("storeThemeName", themeType.getName());

                    StoreColorSchemeType colorSchemeType = themeType.getColorScheme();
                    ebayResp.put("storeColorSchemeId", colorSchemeType.getColorSchemeID());

                    StoreColorType colorType = colorSchemeType.getColor();
                    ebayResp.put("storeColorPrimary", colorType.getPrimary());
                    ebayResp.put("storeColorAccent", colorType.getAccent());
                    ebayResp.put("storeColorSecondary", colorType.getSecondary());

                    StoreFontType fontType = colorSchemeType.getFont();
                    ebayResp.put("storeDescColor", fontType.getDescColor());
                    ebayResp.put("storeNameColor", fontType.getNameColor());
                    ebayResp.put("storeTitleColor", fontType.getTitleColor());

                    if (fontType != null) {// basic & advance theme
                        String themeId = themeType.getThemeID().toString().concat("-").concat(colorSchemeType.getColorSchemeID().toString());
                        context.put("themeId", themeId);
                        Map<String,Object> results = retrieveThemeColorSchemeByThemeId(dctx, context);
                        if (results != null) {
                            Map<String,Object> storeFontScheme = (Map<String,Object>) results.get("storeFontScheme");
                            if (storeFontScheme != null) {
                                ebayResp.put("storeDescFontFace", storeFontScheme.get("storeFontTypeFontDescValue"));
                                ebayResp.put("storeDescSizeCode", storeFontScheme.get("storeDescSizeValue"));

                                ebayResp.put("storeNameFontFace", storeFontScheme.get("storeFontTypeFontFaceValue"));
                                ebayResp.put("storeNameFontFaceSize", storeFontScheme.get("storeFontTypeSizeFaceValue"));

                                ebayResp.put("storeTitleFontFace", storeFontScheme.get("storeFontTypeFontTitleValue"));
                                ebayResp.put("storeTitleFontFaceSize", storeFontScheme.get("storeFontSizeTitleValue"));
                            }
                        }
                    }

                    StoreHeaderStyleCodeType storeHeaderStyleCodeType = returnedStoreType.getHeaderStyle();
                    ebayResp.put("storeHeaderStyle", storeHeaderStyleCodeType.value());
                    StoreHeaderStyleCodeType[] storeHeaderStyleCodeList =  storeHeaderStyleCodeType.values();
                    if (storeHeaderStyleCodeList != null) {
                        List<Map<String,Object>> storeHeaderStyleList  = FastList.newInstance();
                        int i=0;
                        while (i<storeHeaderStyleCodeList.length) {
                            Map<String,Object> storeHeaderStyleMap = FastMap.newInstance();
                            StoreHeaderStyleCodeType storeHeaderStyleCode = storeHeaderStyleCodeList[i];
                            storeHeaderStyleMap.put("storeHeaderStyleName", storeHeaderStyleCode.name());
                            storeHeaderStyleMap.put("storeHeaderStyleValue", storeHeaderStyleCode.value());
                            storeHeaderStyleList.add(storeHeaderStyleMap);
                            i++;
                        }
                        ebayResp.put("storeHeaderStyleList", storeHeaderStyleList);
                    }

                    ebayResp.put("storeHomePage", returnedStoreType.getHomePage().toString());

                    StoreItemListLayoutCodeType storeItemListLayoutCodeType = returnedStoreType.getItemListLayout();
                    ebayResp.put("storeItemLayoutSelected", storeItemListLayoutCodeType.value());
                    StoreItemListLayoutCodeType[] storeItemListLayoutCodeTypeList = storeItemListLayoutCodeType.values();
                    if (storeItemListLayoutCodeTypeList != null) {
                        List<Map<String,Object>> storeItemListLayoutCodeList  = FastList.newInstance();
                        int i = 0;
                        while (i < storeItemListLayoutCodeTypeList.length) {
                            Map<String,Object> storeItemListLayoutCodeMap = FastMap.newInstance();
                            StoreItemListLayoutCodeType storeItemListLayoutCode = storeItemListLayoutCodeTypeList[i];
                            storeItemListLayoutCodeMap.put("storeItemLayoutName", storeItemListLayoutCode.name());
                            storeItemListLayoutCodeMap.put("storeItemLayoutValue", storeItemListLayoutCode.value());
                            storeItemListLayoutCodeList.add(storeItemListLayoutCodeMap);
                            i++;
                        }
                        ebayResp.put("storeItemLayoutList", storeItemListLayoutCodeList);
                    }
                    StoreItemListSortOrderCodeType storeItemListSortOrderCodeType = returnedStoreType.getItemListSortOrder();
                    ebayResp.put("storeItemSortOrderSelected", storeItemListSortOrderCodeType.value());
                    StoreItemListSortOrderCodeType[] storeItemListSortOrderCodeTypeList = storeItemListSortOrderCodeType.values();
                    if (storeItemListSortOrderCodeTypeList != null) {
                        List<Map<String,Object>> storeItemSortOrderCodeList  = FastList.newInstance();
                        int i = 0;
                        while (i < storeItemListSortOrderCodeTypeList.length) {
                            Map<String,Object> storeItemSortOrderCodeMap = FastMap.newInstance();
                            StoreItemListSortOrderCodeType storeItemListLayoutCode = storeItemListSortOrderCodeTypeList[i];
                            storeItemSortOrderCodeMap.put("storeItemSortLayoutName", storeItemListLayoutCode.name());
                            storeItemSortOrderCodeMap.put("storeItemSortLayoutValue", storeItemListLayoutCode.value());
                            storeItemSortOrderCodeList.add(storeItemSortOrderCodeMap);
                            i++;
                        }
                        ebayResp.put("storeItemSortOrderList", storeItemSortOrderCodeList);
                    }

                    ebayResp.put("storeCustomHeader", returnedStoreType.getCustomHeader());
                    StoreCustomHeaderLayoutCodeType storeCustomHeaderLayoutCodeType = returnedStoreType.getCustomHeaderLayout();
                    ebayResp.put("storeCustomHeaderLayout", storeCustomHeaderLayoutCodeType.value());
                    StoreCustomHeaderLayoutCodeType[] storeCustomHeaderLayoutCodeTypeList = storeCustomHeaderLayoutCodeType.values();
                    if (storeCustomHeaderLayoutCodeTypeList != null) {
                        List<Map<String,Object>> storeCustomHeaderLayoutList  = FastList.newInstance();
                        int i = 0;
                        while (i < storeCustomHeaderLayoutCodeTypeList.length) {
                            Map<String,Object> storeCustomHeaderLayoutMap = FastMap.newInstance();
                            StoreCustomHeaderLayoutCodeType StoreCustomHeaderLayoutCode = storeCustomHeaderLayoutCodeTypeList[i];
                            storeCustomHeaderLayoutMap.put("storeCustomHeaderLayoutName", StoreCustomHeaderLayoutCode.name());
                            storeCustomHeaderLayoutMap.put("storeCustomHeaderLayoutValue", StoreCustomHeaderLayoutCode.value());
                            storeCustomHeaderLayoutList.add(storeCustomHeaderLayoutMap);
                            i++;
                        }
                        ebayResp.put("storeCustomHeaderLayoutList", storeCustomHeaderLayoutList);
                    }

                    StoreCustomListingHeaderType storeCustomListingHeaderType = returnedStoreType.getCustomListingHeader();
                    if (storeCustomListingHeaderType != null) {
                        StoreCustomListingHeaderDisplayCodeType storeCustomListingHeaderDisplayCodeType = storeCustomListingHeaderType.getDisplayType();
                        ebayResp.put("isLogo", storeCustomListingHeaderType.isLogo());
                        ebayResp.put("isSearchBox", storeCustomListingHeaderType.isSearchBox());
                        ebayResp.put("isAddToFavoriteStores", storeCustomListingHeaderType.isAddToFavoriteStores());
                        ebayResp.put("isSignUpForStoreNewsletter", storeCustomListingHeaderType.isSignUpForStoreNewsletter());

                        ebayResp.put("storeCustomListingHeaderDisplayName", storeCustomListingHeaderDisplayCodeType.name());
                        ebayResp.put("storeCustomListingHeaderDisplayValue", storeCustomListingHeaderDisplayCodeType.value());
                        StoreCustomListingHeaderDisplayCodeType[] storeCustomListingHeaderDisplayCodeTypeList = storeCustomListingHeaderDisplayCodeType.values();
                        if (storeCustomListingHeaderDisplayCodeTypeList != null) {
                            List<Map<String,Object>> storeCustomListingHeaderDisplayCodeList  = FastList.newInstance();
                            int i = 0;
                            while (i < storeCustomListingHeaderDisplayCodeTypeList.length) {
                                Map<String,Object> storeCustomListingHeaderDisplayCodeMap = FastMap.newInstance();
                                StoreCustomListingHeaderDisplayCodeType storeCustomListingHeaderDisplayCode = storeCustomListingHeaderDisplayCodeTypeList[i];
                                storeCustomListingHeaderDisplayCodeMap.put("storeCustomHeaderLayoutName", storeCustomListingHeaderDisplayCode.name());
                                storeCustomListingHeaderDisplayCodeMap.put("storeCustomHeaderLayoutValue", storeCustomListingHeaderDisplayCode.value());
                                storeCustomListingHeaderDisplayCodeList.add(storeCustomListingHeaderDisplayCodeMap);
                                i++;
                            }
                            ebayResp.put("storeCustomListingHeaderDisplayList", storeCustomListingHeaderDisplayCodeList);
                        }
                    }

                    //CustomListingHeader
                    MerchDisplayCodeType merchDisplayCodeType = returnedStoreType.getMerchDisplay();
                    ebayResp.put("storeMerchDisplay",merchDisplayCodeType.value());
                    MerchDisplayCodeType[] merchDisplayCodeTypeList = merchDisplayCodeType.values();
                    if (merchDisplayCodeTypeList != null) {
                        List<Map<String,Object>> merchDisplayCodeList = FastList.newInstance();
                        int i = 0;
                        while (i < merchDisplayCodeTypeList.length) {
                            Map<String,Object> merchDisplayCodeMap = FastMap.newInstance();
                            MerchDisplayCodeType merchDisplayCode = merchDisplayCodeTypeList[i];
                            merchDisplayCodeMap.put("merchDisplayCodeName", merchDisplayCode.name());
                            merchDisplayCodeMap.put("merchDisplayCodeValue", merchDisplayCode.value());
                            merchDisplayCodeList.add(merchDisplayCodeMap);
                            i++;
                        }
                        ebayResp.put("storeMerchDisplayList",merchDisplayCodeList);
                    }

                    Calendar calendar = returnedStoreType.getLastOpenedTime();
                    ebayResp.put("storeLastOpenedTime", calendar.getTime().toString());
                    ebayResp.put("storeSubscriptionLevel", returnedStoreType.getSubscriptionLevel().value());
                    StoreSubscriptionLevelCodeType[] storeSubscriptionlevelList = returnedStoreType.getSubscriptionLevel().values();
                    if (storeSubscriptionlevelList != null) {
                        List<Map<String,Object>> storeSubscriptionLevelCodeList = FastList.newInstance();
                        int i = 0;
                        while (i < storeSubscriptionlevelList.length) {
                            Map<String,Object> storeSubscriptionLevelCodeMap = FastMap.newInstance();
View Full Code Here

Examples of com.ebay.soap.eBLBaseComponents.StoreType

        Locale locale = (Locale) context.get("locale");
        Delegator delegator = dctx.getDelegator();
        SetStoreRequestType req = null;
        StoreThemeArrayType returnedThemeArray = null;
        SetStoreResponseType resp  = null;
        StoreType storeType = null;
        try {
            if (context.get("productStoreId") != null) {
                SetStoreCall  call = new SetStoreCall(EbayStoreHelper.getApiContext((String)context.get("productStoreId"), locale, delegator));
                req = new SetStoreRequestType();

                storeType = new StoreType();
                storeType.setName((String)context.get("storeName"));
                storeType.setDescription((String)context.get("storeDesc"));
                storeType.setURL((String)context.get("storeUrl"));
                storeType.setURLPath("");
                StoreLogoType storeLogo = new StoreLogoType();
                if (context.get("storeLogoURL") == null) {
                    if (context.get("storeLogoId") != null) storeLogo.setLogoID(Integer.parseInt((String)context.get("storeLogoId")));
                    storeLogo.setName((String)context.get("storeLogoName"));
                } else {
                    storeLogo.setURL((String)context.get("storeLogoURL"));
                }
                storeType.setLogo(storeLogo);

                StoreThemeType storeTheme = new StoreThemeType();
                StoreColorSchemeType storeColorScheme = null;
                StoreColorType storecolor = null;
                StoreFontType storeFont = null;
                if (context.get("themeType").equals("Advanced")) {
                    storeColorScheme = new StoreColorSchemeType();
                    if (context.get("storeAdvancedThemeColor") != null) storeColorScheme.setColorSchemeID(Integer.parseInt((String)context.get("storeAdvancedThemeColor")));

                    storecolor = new StoreColorType();
                    storecolor.setPrimary((String)context.get("storePrimaryColor"));
                    storecolor.setSecondary((String)context.get("storeSecondaryColor"));
                    storecolor.setAccent((String)context.get("storeAccentColor"));
                    storeColorScheme.setColor(storecolor);
                    storeTheme.setColorScheme(storeColorScheme);
                    storeTheme.setName(null);
                    storeTheme.setThemeID(Integer.parseInt((String)context.get("storeAdvancedTheme")));
                } else if (context.get("themeType").equals("Basic")) {
                    storeColorScheme = new StoreColorSchemeType();
                    if (context.get("storeBasicTheme")!=null) {
                        String storeBasicTheme = (String)context.get("storeBasicTheme");
                        String storeThemeId = null;
                        String storeColorSchemeId = null;
                        if (storeBasicTheme.indexOf("-") != -1) {
                            storeThemeId = storeBasicTheme.substring(0, storeBasicTheme.indexOf("-"));
                            storeColorSchemeId = storeBasicTheme.substring(storeBasicTheme.indexOf("-")+1);
                        }
                        if (storeColorSchemeId != null) storeColorScheme.setColorSchemeID(Integer.parseInt(storeColorSchemeId));

                        storecolor = new StoreColorType();
                        storecolor.setPrimary((String)context.get("storePrimaryColor"));
                        storecolor.setSecondary((String)context.get("storeSecondaryColor"));
                        storecolor.setAccent((String)context.get("storeAccentColor"));
                        storeColorScheme.setColor(storecolor);

                        storeFont = new StoreFontType();
                        storeFont.setNameColor((String)context.get("storeNameFontColor"));
                        storeFont.setNameFace(StoreFontFaceCodeType.valueOf((String)context.get("storeNameFont")));
                        storeFont.setNameSize(StoreFontSizeCodeType.valueOf((String)context.get("storeNameFontSize")));

                        storeFont.setTitleColor((String)context.get("storeTitleFontColor"));
                        storeFont.setTitleFace(StoreFontFaceCodeType.valueOf((String)context.get("storeTitleFont")));
                        storeFont.setTitleSize(StoreFontSizeCodeType.valueOf((String)context.get("storeTitleFontSize")));

                        storeFont.setDescColor((String)context.get("storeDescFontColor"));
                        storeFont.setDescFace(StoreFontFaceCodeType.valueOf((String)context.get("storeDescFont")));
                        storeFont.setDescSize(StoreFontSizeCodeType.valueOf((String)context.get("storeDescFontSize")));

                        storeColorScheme.setFont(storeFont);

                        storeTheme.setColorScheme(storeColorScheme);
                        storeTheme.setName(null);
                        storeTheme.setThemeID(Integer.parseInt(storeThemeId));
                    }
                }
                storeType.setTheme(storeTheme);
                storeType.setHeaderStyle(StoreHeaderStyleCodeType.valueOf((String)context.get("storeHeaderStyle")));
                storeType.setItemListLayout(StoreItemListLayoutCodeType.valueOf((String)context.get("storeItemLayout")));
                storeType.setItemListSortOrder(StoreItemListSortOrderCodeType.valueOf((String)context.get("storeItemSortOrder")));
                storeType.setMerchDisplay(MerchDisplayCodeType.valueOf((String)context.get("storeMerchDisplay")));
                storeType.setSubscriptionLevel(StoreSubscriptionLevelCodeType.valueOf((String)context.get("storeSubscriptionDisplay")));

                storeType.setCustomHeader((String)context.get("storeCustomHeader"));
                storeType.setCustomHeaderLayout(StoreCustomHeaderLayoutCodeType.valueOf((String)context.get("storeCustomHeaderLayout")));

                StoreCustomListingHeaderType storeCustomListingHeader = new StoreCustomListingHeaderType();

                if ( storeType == null )
                      throw new SdkException("StoreType property is not set.");
View Full Code Here

Examples of com.ebay.soap.eBLBaseComponents.StoreType

            GetStoreCall call = new GetStoreCall(this.apiContext);
            GetStoreRequestType req = new GetStoreRequestType();
            GetStoreResponseType resp = null;
            resp = (GetStoreResponseType) call.execute(req);
            if (resp != null && "SUCCESS".equals(resp.getAck().toString())) {
                StoreType store = resp.getStore();
                StoreCustomCategoryArrayType categoriesArr = store.getCustomCategories();
                StoreCustomCategoryType[] cateogries = categoriesArr.getCustomCategory();
                for (StoreCustomCategoryType cat : cateogries) {
                    String categoryId = Long.toString(cat.getCategoryID());
                    catsMap.put(categoryId, cat);
                }
View Full Code Here

Examples of com.ebay.soap.eBLBaseComponents.StoreType

    public static Map<String,Object> getEbayStoreOutput(DispatchContext dctx, Map<String,Object> context) {
        Locale locale = (Locale) context.get("locale");
        GenericValue userLogin = (GenericValue) context.get("userLogin");
        Delegator delegator = dctx.getDelegator();
        Map<String,Object> result = FastMap.newInstance();
        StoreType returnedStoreType = null;
        GetStoreRequestType req = new GetStoreRequestType();
        GetStoreResponseType resp =  null;

        String userLoginId = null;
        String password = null;
        if (context.get("productStoreId") != null) {
            String partyId = null;
            try {
                List<GenericValue> productStoreRoles = delegator.findByAnd("ProductStoreRole", UtilMisc.toMap("productStoreId", context.get("productStoreId").toString(),"roleTypeId","EBAY_ACCOUNT"));
                if (productStoreRoles.size() != 0) {
                    partyId=  (String)productStoreRoles.get(0).get("partyId");
                    List<GenericValue> userLogins = delegator.findByAnd("UserLogin", UtilMisc.toMap("partyId", partyId));
                    if (userLogins.size() != 0) {
                        userLoginId = (String)userLogins.get(0).get("userLoginId");
                        password = (String)userLogins.get(0).get("currentPassword");
                    }
                   
                }
            } catch (GenericEntityException e1) {
                e1.printStackTrace();
            }
            Debug.log("userLoginId is "+userLoginId+" and productStoreId is "+ context.get("productStoreId"));
            GetStoreCall call = new GetStoreCall(EbayStoreHelper.getApiContext((String)context.get("productStoreId"), locale, delegator));
            //call.setSite(EbayHelper.getSiteCodeType((String)context.get("productStoreId"), locale, delegator));
            call.setCategoryStructureOnly(false);
            call.setUserID(userLoginId);

            try {
                resp = (GetStoreResponseType)call.execute(req);
                if (resp != null && "SUCCESS".equals(resp.getAck().toString())) {
                    returnedStoreType  = resp.getStore();
                    result.put(ModelService.RESPONSE_MESSAGE, ModelService.RESPOND_SUCCESS);
                    //result.put(ModelService.SUCCESS_MESSAGE, UtilProperties.getMessage(resource, "EbayStoreLoadSuccess", locale));
                    // update product store in ofbiz
                    updateProductStore(dctx, context, returnedStoreType,(String) context.get("productStoreId"));
                    Map<String,Object> ebayResp = FastMap.newInstance();
                    ebayResp.put("storeName", returnedStoreType.getName());
                    ebayResp.put("storeUrl", returnedStoreType.getURL());
                    ebayResp.put("storeUrlPath", returnedStoreType.getURLPath());
                    String desc = returnedStoreType.getDescription();
                    if (desc != null) desc  =  desc.trim();
                    ebayResp.put("storeDesc", desc);

                    StoreLogoType logoType = returnedStoreType.getLogo();
                    ebayResp.put("storeLogoId", logoType.getLogoID());
                    ebayResp.put("storeLogoName", logoType.getName());
                    ebayResp.put("storeLogoURL", logoType.getURL());

                    StoreThemeType themeType = returnedStoreType.getTheme();
                    ebayResp.put("storeThemeId", themeType.getThemeID());
                    ebayResp.put("storeThemeName", themeType.getName());

                    StoreColorSchemeType colorSchemeType = themeType.getColorScheme();
                    ebayResp.put("storeColorSchemeId", colorSchemeType.getColorSchemeID());

                    StoreColorType colorType = colorSchemeType.getColor();
                    ebayResp.put("storeColorPrimary", colorType.getPrimary());
                    ebayResp.put("storeColorAccent", colorType.getAccent());
                    ebayResp.put("storeColorSecondary", colorType.getSecondary());

                    StoreFontType fontType = colorSchemeType.getFont();
                    ebayResp.put("storeDescColor", fontType.getDescColor());
                    ebayResp.put("storeNameColor", fontType.getNameColor());
                    ebayResp.put("storeTitleColor", fontType.getTitleColor());

                    if (fontType != null) {// basic & advance theme
                        String themeId = themeType.getThemeID().toString().concat("-").concat(colorSchemeType.getColorSchemeID().toString());
                        context.put("themeId", themeId);
                        Map<String,Object> results = retrieveThemeColorSchemeByThemeId(dctx, context);
                        if (results != null) {
                            Map<String,Object> storeFontScheme = (Map<String,Object>) results.get("storeFontScheme");
                            if (storeFontScheme != null) {
                                ebayResp.put("storeDescFontFace", storeFontScheme.get("storeFontTypeFontDescValue"));
                                ebayResp.put("storeDescSizeCode", storeFontScheme.get("storeDescSizeValue"));

                                ebayResp.put("storeNameFontFace", storeFontScheme.get("storeFontTypeFontFaceValue"));
                                ebayResp.put("storeNameFontFaceSize", storeFontScheme.get("storeFontTypeSizeFaceValue"));

                                ebayResp.put("storeTitleFontFace", storeFontScheme.get("storeFontTypeFontTitleValue"));
                                ebayResp.put("storeTitleFontFaceSize", storeFontScheme.get("storeFontSizeTitleValue"));
                            }
                        }
                    }

                    StoreHeaderStyleCodeType storeHeaderStyleCodeType = returnedStoreType.getHeaderStyle();
                    ebayResp.put("storeHeaderStyle", storeHeaderStyleCodeType.value());
                    StoreHeaderStyleCodeType[] storeHeaderStyleCodeList =  storeHeaderStyleCodeType.values();
                    if (storeHeaderStyleCodeList != null) {
                        List<Map<String,Object>> storeHeaderStyleList  = FastList.newInstance();
                        int i=0;
                        while (i<storeHeaderStyleCodeList.length) {
                            Map<String,Object> storeHeaderStyleMap = FastMap.newInstance();
                            StoreHeaderStyleCodeType storeHeaderStyleCode = storeHeaderStyleCodeList[i];
                            storeHeaderStyleMap.put("storeHeaderStyleName", storeHeaderStyleCode.name());
                            storeHeaderStyleMap.put("storeHeaderStyleValue", storeHeaderStyleCode.value());
                            storeHeaderStyleList.add(storeHeaderStyleMap);
                            i++;
                        }
                        ebayResp.put("storeHeaderStyleList", storeHeaderStyleList);
                    }

                    ebayResp.put("storeHomePage", returnedStoreType.getHomePage().toString());

                    StoreItemListLayoutCodeType storeItemListLayoutCodeType = returnedStoreType.getItemListLayout();
                    ebayResp.put("storeItemLayoutSelected", storeItemListLayoutCodeType.value());
                    StoreItemListLayoutCodeType[] storeItemListLayoutCodeTypeList = storeItemListLayoutCodeType.values();
                    if (storeItemListLayoutCodeTypeList != null) {
                        List<Map<String,Object>> storeItemListLayoutCodeList  = FastList.newInstance();
                        int i = 0;
                        while (i < storeItemListLayoutCodeTypeList.length) {
                            Map<String,Object> storeItemListLayoutCodeMap = FastMap.newInstance();
                            StoreItemListLayoutCodeType storeItemListLayoutCode = storeItemListLayoutCodeTypeList[i];
                            storeItemListLayoutCodeMap.put("storeItemLayoutName", storeItemListLayoutCode.name());
                            storeItemListLayoutCodeMap.put("storeItemLayoutValue", storeItemListLayoutCode.value());
                            storeItemListLayoutCodeList.add(storeItemListLayoutCodeMap);
                            i++;
                        }
                        ebayResp.put("storeItemLayoutList", storeItemListLayoutCodeList);
                    }
                    StoreItemListSortOrderCodeType storeItemListSortOrderCodeType = returnedStoreType.getItemListSortOrder();
                    ebayResp.put("storeItemSortOrderSelected", storeItemListSortOrderCodeType.value());
                    StoreItemListSortOrderCodeType[] storeItemListSortOrderCodeTypeList = storeItemListSortOrderCodeType.values();
                    if (storeItemListSortOrderCodeTypeList != null) {
                        List<Map<String,Object>> storeItemSortOrderCodeList  = FastList.newInstance();
                        int i = 0;
                        while (i < storeItemListSortOrderCodeTypeList.length) {
                            Map<String,Object> storeItemSortOrderCodeMap = FastMap.newInstance();
                            StoreItemListSortOrderCodeType storeItemListLayoutCode = storeItemListSortOrderCodeTypeList[i];
                            storeItemSortOrderCodeMap.put("storeItemSortLayoutName", storeItemListLayoutCode.name());
                            storeItemSortOrderCodeMap.put("storeItemSortLayoutValue", storeItemListLayoutCode.value());
                            storeItemSortOrderCodeList.add(storeItemSortOrderCodeMap);
                            i++;
                        }
                        ebayResp.put("storeItemSortOrderList", storeItemSortOrderCodeList);
                    }

                    ebayResp.put("storeCustomHeader", returnedStoreType.getCustomHeader());
                    StoreCustomHeaderLayoutCodeType storeCustomHeaderLayoutCodeType = returnedStoreType.getCustomHeaderLayout();
                    ebayResp.put("storeCustomHeaderLayout", storeCustomHeaderLayoutCodeType.value());
                    StoreCustomHeaderLayoutCodeType[] storeCustomHeaderLayoutCodeTypeList = storeCustomHeaderLayoutCodeType.values();
                    if (storeCustomHeaderLayoutCodeTypeList != null) {
                        List<Map<String,Object>> storeCustomHeaderLayoutList  = FastList.newInstance();
                        int i = 0;
                        while (i < storeCustomHeaderLayoutCodeTypeList.length) {
                            Map<String,Object> storeCustomHeaderLayoutMap = FastMap.newInstance();
                            StoreCustomHeaderLayoutCodeType StoreCustomHeaderLayoutCode = storeCustomHeaderLayoutCodeTypeList[i];
                            storeCustomHeaderLayoutMap.put("storeCustomHeaderLayoutName", StoreCustomHeaderLayoutCode.name());
                            storeCustomHeaderLayoutMap.put("storeCustomHeaderLayoutValue", StoreCustomHeaderLayoutCode.value());
                            storeCustomHeaderLayoutList.add(storeCustomHeaderLayoutMap);
                            i++;
                        }
                        ebayResp.put("storeCustomHeaderLayoutList", storeCustomHeaderLayoutList);
                    }

                    StoreCustomListingHeaderType storeCustomListingHeaderType = returnedStoreType.getCustomListingHeader();
                    if (storeCustomListingHeaderType != null) {
                        StoreCustomListingHeaderDisplayCodeType storeCustomListingHeaderDisplayCodeType = storeCustomListingHeaderType.getDisplayType();
                        ebayResp.put("isLogo", storeCustomListingHeaderType.isLogo());
                        ebayResp.put("isSearchBox", storeCustomListingHeaderType.isSearchBox());
                        ebayResp.put("isAddToFavoriteStores", storeCustomListingHeaderType.isAddToFavoriteStores());
                        ebayResp.put("isSignUpForStoreNewsletter", storeCustomListingHeaderType.isSignUpForStoreNewsletter());

                        ebayResp.put("storeCustomListingHeaderDisplayName", storeCustomListingHeaderDisplayCodeType.name());
                        ebayResp.put("storeCustomListingHeaderDisplayValue", storeCustomListingHeaderDisplayCodeType.value());
                        StoreCustomListingHeaderDisplayCodeType[] storeCustomListingHeaderDisplayCodeTypeList = storeCustomListingHeaderDisplayCodeType.values();
                        if (storeCustomListingHeaderDisplayCodeTypeList != null) {
                            List<Map<String,Object>> storeCustomListingHeaderDisplayCodeList  = FastList.newInstance();
                            int i = 0;
                            while (i < storeCustomListingHeaderDisplayCodeTypeList.length) {
                                Map<String,Object> storeCustomListingHeaderDisplayCodeMap = FastMap.newInstance();
                                StoreCustomListingHeaderDisplayCodeType storeCustomListingHeaderDisplayCode = storeCustomListingHeaderDisplayCodeTypeList[i];
                                storeCustomListingHeaderDisplayCodeMap.put("storeCustomHeaderLayoutName", storeCustomListingHeaderDisplayCode.name());
                                storeCustomListingHeaderDisplayCodeMap.put("storeCustomHeaderLayoutValue", storeCustomListingHeaderDisplayCode.value());
                                storeCustomListingHeaderDisplayCodeList.add(storeCustomListingHeaderDisplayCodeMap);
                                i++;
                            }
                            ebayResp.put("storeCustomListingHeaderDisplayList", storeCustomListingHeaderDisplayCodeList);
                        }
                    }

                    //CustomListingHeader
                    MerchDisplayCodeType merchDisplayCodeType = returnedStoreType.getMerchDisplay();
                    ebayResp.put("storeMerchDisplay",merchDisplayCodeType.value());
                    MerchDisplayCodeType[] merchDisplayCodeTypeList = merchDisplayCodeType.values();
                    if (merchDisplayCodeTypeList != null) {
                        List<Map<String,Object>> merchDisplayCodeList = FastList.newInstance();
                        int i = 0;
                        while (i < merchDisplayCodeTypeList.length) {
                            Map<String,Object> merchDisplayCodeMap = FastMap.newInstance();
                            MerchDisplayCodeType merchDisplayCode = merchDisplayCodeTypeList[i];
                            merchDisplayCodeMap.put("merchDisplayCodeName", merchDisplayCode.name());
                            merchDisplayCodeMap.put("merchDisplayCodeValue", merchDisplayCode.value());
                            merchDisplayCodeList.add(merchDisplayCodeMap);
                            i++;
                        }
                        ebayResp.put("storeMerchDisplayList",merchDisplayCodeList);
                    }

                    Calendar calendar = returnedStoreType.getLastOpenedTime();
                    ebayResp.put("storeLastOpenedTime", calendar.getTime().toString());
                    ebayResp.put("storeSubscriptionLevel", returnedStoreType.getSubscriptionLevel().value());
                    StoreSubscriptionLevelCodeType[] storeSubscriptionlevelList = returnedStoreType.getSubscriptionLevel().values();
                    if (storeSubscriptionlevelList != null) {
                        List<Map<String,Object>> storeSubscriptionLevelCodeList = FastList.newInstance();
                        int i = 0;
                        while (i < storeSubscriptionlevelList.length) {
                            Map<String,Object> storeSubscriptionLevelCodeMap = FastMap.newInstance();
View Full Code Here

Examples of com.ebay.soap.eBLBaseComponents.StoreType

        Locale locale = (Locale) context.get("locale");
        Delegator delegator = dctx.getDelegator();
        SetStoreRequestType req = null;
        StoreThemeArrayType returnedThemeArray = null;
        SetStoreResponseType resp  = null;
        StoreType storeType = null;
        try {
            if (context.get("productStoreId") != null) {
                SetStoreCall  call = new SetStoreCall(EbayStoreHelper.getApiContext((String)context.get("productStoreId"), locale, delegator));
                req = new SetStoreRequestType();

                storeType = new StoreType();
                storeType.setName((String)context.get("storeName"));
                storeType.setDescription((String)context.get("storeDesc"));
                storeType.setURL((String)context.get("storeUrl"));
                storeType.setURLPath("");
                StoreLogoType storeLogo = new StoreLogoType();
                if (context.get("storeLogoURL") == null) {
                    if (context.get("storeLogoId") != null) storeLogo.setLogoID(Integer.parseInt((String)context.get("storeLogoId")));
                    storeLogo.setName((String)context.get("storeLogoName"));
                } else {
                    storeLogo.setURL((String)context.get("storeLogoURL"));
                }
                storeType.setLogo(storeLogo);

                StoreThemeType storeTheme = new StoreThemeType();
                StoreColorSchemeType storeColorScheme = null;
                StoreColorType storecolor = null;
                StoreFontType storeFont = null;
                if (context.get("themeType").equals("Advanced")) {
                    storeColorScheme = new StoreColorSchemeType();
                    if (context.get("storeAdvancedThemeColor") != null) storeColorScheme.setColorSchemeID(Integer.parseInt((String)context.get("storeAdvancedThemeColor")));

                    storecolor = new StoreColorType();
                    storecolor.setPrimary((String)context.get("storePrimaryColor"));
                    storecolor.setSecondary((String)context.get("storeSecondaryColor"));
                    storecolor.setAccent((String)context.get("storeAccentColor"));
                    storeColorScheme.setColor(storecolor);
                    storeTheme.setColorScheme(storeColorScheme);
                    storeTheme.setName(null);
                    storeTheme.setThemeID(Integer.parseInt((String)context.get("storeAdvancedTheme")));
                } else if (context.get("themeType").equals("Basic")) {
                    storeColorScheme = new StoreColorSchemeType();
                    if (context.get("storeBasicTheme")!=null) {
                        String storeBasicTheme = (String)context.get("storeBasicTheme");
                        String storeThemeId = null;
                        String storeColorSchemeId = null;
                        if (storeBasicTheme.indexOf("-") != -1) {
                            storeThemeId = storeBasicTheme.substring(0, storeBasicTheme.indexOf("-"));
                            storeColorSchemeId = storeBasicTheme.substring(storeBasicTheme.indexOf("-")+1);
                        }
                        if (storeColorSchemeId != null) storeColorScheme.setColorSchemeID(Integer.parseInt(storeColorSchemeId));

                        storecolor = new StoreColorType();
                        storecolor.setPrimary((String)context.get("storePrimaryColor"));
                        storecolor.setSecondary((String)context.get("storeSecondaryColor"));
                        storecolor.setAccent((String)context.get("storeAccentColor"));
                        storeColorScheme.setColor(storecolor);

                        storeFont = new StoreFontType();
                        storeFont.setNameColor((String)context.get("storeNameFontColor"));
                        storeFont.setNameFace(StoreFontFaceCodeType.valueOf((String)context.get("storeNameFont")));
                        storeFont.setNameSize(StoreFontSizeCodeType.valueOf((String)context.get("storeNameFontSize")));

                        storeFont.setTitleColor((String)context.get("storeTitleFontColor"));
                        storeFont.setTitleFace(StoreFontFaceCodeType.valueOf((String)context.get("storeTitleFont")));
                        storeFont.setTitleSize(StoreFontSizeCodeType.valueOf((String)context.get("storeTitleFontSize")));

                        storeFont.setDescColor((String)context.get("storeDescFontColor"));
                        storeFont.setDescFace(StoreFontFaceCodeType.valueOf((String)context.get("storeDescFont")));
                        storeFont.setDescSize(StoreFontSizeCodeType.valueOf((String)context.get("storeDescFontSize")));

                        storeColorScheme.setFont(storeFont);

                        storeTheme.setColorScheme(storeColorScheme);
                        storeTheme.setName(null);
                        storeTheme.setThemeID(Integer.parseInt(storeThemeId));
                    }
                }
                storeType.setTheme(storeTheme);
                storeType.setHeaderStyle(StoreHeaderStyleCodeType.valueOf((String)context.get("storeHeaderStyle")));
                storeType.setItemListLayout(StoreItemListLayoutCodeType.valueOf((String)context.get("storeItemLayout")));
                storeType.setItemListSortOrder(StoreItemListSortOrderCodeType.valueOf((String)context.get("storeItemSortOrder")));
                storeType.setMerchDisplay(MerchDisplayCodeType.valueOf((String)context.get("storeMerchDisplay")));
                storeType.setSubscriptionLevel(StoreSubscriptionLevelCodeType.valueOf((String)context.get("storeSubscriptionDisplay")));

                storeType.setCustomHeader((String)context.get("storeCustomHeader"));
                storeType.setCustomHeaderLayout(StoreCustomHeaderLayoutCodeType.valueOf((String)context.get("storeCustomHeaderLayout")));

                StoreCustomListingHeaderType storeCustomListingHeader = new StoreCustomListingHeaderType();

                if ( storeType == null )
                      throw new SdkException("StoreType property is not set.");
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.