GenericValue userLogin = (GenericValue) context.get("userLogin");
Locale locale = (Locale) context.get("locale");
Delegator delegator = dctx.getDelegator();
GetStoreOptionsRequestType req = null;
StoreThemeArrayType returnedThemeArray = null;
GetStoreOptionsResponseType resp = null;
try {
if (context.get("productStoreId") != null) {
GetStoreOptionsCall call = new GetStoreOptionsCall(EbayStoreHelper.getApiContext((String)context.get("productStoreId"), locale, delegator));
req = new GetStoreOptionsRequestType();
resp = (GetStoreOptionsResponseType) call.execute(req);
StoreColorSchemeType storeFontColorSchemeType = null;
Map<String,Object> advanceFontTheme = FastMap.newInstance();
if (resp != null && "SUCCESS".equals(resp.getAck().toString())) {
returnedThemeArray = resp.getAdvancedThemeArray();
int i = 0;
List<Map<String,Object>> themeList = FastList.newInstance();
StoreColorSchemeType[] storeColorSchemeTypes = returnedThemeArray.getGenericColorSchemeArray().getColorScheme();
while (i < storeColorSchemeTypes.length) {
StoreColorSchemeType storeColorSchemeType = (StoreColorSchemeType) storeColorSchemeTypes[i];
StoreFontType storeFontType = storeColorSchemeType.getFont();
advanceFontTheme.put("storeFontTypeNameFaceColor",storeFontType.getNameColor());
int j = 0;
StoreFontFaceCodeType[] storeFontNameFaceCodeTypes = storeFontType.getNameFace().values();
List<Map<String,Object>> nameFaces = FastList.newInstance();
while (j < storeFontNameFaceCodeTypes.length) {
Map<String,Object> storeFontNameFaceCodeTypeMap = FastMap.newInstance();
StoreFontFaceCodeType storeFontNameFaceCodeType = (StoreFontFaceCodeType) storeFontNameFaceCodeTypes[j];
storeFontNameFaceCodeTypeMap.put("storeFontValue", storeFontNameFaceCodeType.value());
storeFontNameFaceCodeTypeMap.put("storeFontName", storeFontNameFaceCodeType.name());
nameFaces.add(storeFontNameFaceCodeTypeMap);
j++;
}
advanceFontTheme.put("storeFontTypeFontFaceList",nameFaces);
j = 0;
StoreFontSizeCodeType[] storeFontSizeCodeTypes = storeFontType.getNameSize().values();
List<Map<String,Object>> sizeFaces = FastList.newInstance();
while (j < storeFontSizeCodeTypes.length) {
Map<String,Object> storeFontSizeCodeTypeMap = FastMap.newInstance();
StoreFontSizeCodeType storeFontSizeCodeType = (StoreFontSizeCodeType) storeFontSizeCodeTypes[j];
storeFontSizeCodeTypeMap.put("storeFontSizeValue", storeFontSizeCodeType.value());
storeFontSizeCodeTypeMap.put("storeFontSizeName", storeFontSizeCodeType.name());
sizeFaces.add(storeFontSizeCodeTypeMap);
j++;
}
advanceFontTheme.put("storeFontTypeSizeFaceList", sizeFaces);
advanceFontTheme.put("storeFontTypeTitleColor", storeFontType.getTitleColor());
j = 0;
StoreFontFaceCodeType[] storeFontTypeTitleFaces = storeFontType.getTitleFace().values();
List<Map<String,Object>> titleFaces = FastList.newInstance();
while (j < storeFontTypeTitleFaces.length) {
Map<String,Object> storeFontTypeTitleFaceMap = FastMap.newInstance();
StoreFontFaceCodeType storeFontTypeTitleFace = (StoreFontFaceCodeType) storeFontTypeTitleFaces[j];
storeFontTypeTitleFaceMap.put("storeFontValue", storeFontTypeTitleFace.value());
storeFontTypeTitleFaceMap.put("storeFontName", storeFontTypeTitleFace.name());
titleFaces.add(storeFontTypeTitleFaceMap);
j++;
}
advanceFontTheme.put("storeFontTypeFontTitleList",titleFaces);
j = 0;
StoreFontSizeCodeType[] storeTitleSizeCodeTypes = storeFontType.getTitleSize().values();
List<Map<String,Object>> titleSizes = FastList.newInstance();
while (j < storeTitleSizeCodeTypes.length) {
Map<String,Object> storeFontSizeCodeTypeMap = FastMap.newInstance();
StoreFontSizeCodeType storeFontSizeCodeType = (StoreFontSizeCodeType) storeTitleSizeCodeTypes[j];
storeFontSizeCodeTypeMap.put("storeFontSizeValue", storeFontSizeCodeType.value());
storeFontSizeCodeTypeMap.put("storeFontSizeName", storeFontSizeCodeType.name());
titleSizes.add(storeFontSizeCodeTypeMap);
j++;
}
advanceFontTheme.put("storeFontSizeTitleList",titleSizes);
advanceFontTheme.put("storeFontTypeDescColor", storeFontType.getDescColor());
j = 0;
StoreFontFaceCodeType[] storeFontTypeDescFaces = storeFontType.getDescFace().values();
List<Map<String,Object>> descFaces = FastList.newInstance();
while (j < storeFontTypeDescFaces.length) {
Map<String,Object> storeFontTypeDescFaceMap = FastMap.newInstance();
StoreFontFaceCodeType storeFontTypeDescFace = (StoreFontFaceCodeType) storeFontTypeDescFaces[j];
storeFontTypeDescFaceMap.put("storeFontValue", storeFontTypeDescFace.value());
storeFontTypeDescFaceMap.put("storeFontName", storeFontTypeDescFace.name());
descFaces.add(storeFontTypeDescFaceMap);
j++;
}
advanceFontTheme.put("storeFontTypeFontDescList",descFaces);
j = 0;
StoreFontSizeCodeType[] storeDescSizeCodeTypes = storeFontType.getDescSize().values();
List<Map<String,Object>> descSizes = FastList.newInstance();
while (j < storeDescSizeCodeTypes.length) {
Map<String,Object> storeFontSizeCodeTypeMap = FastMap.newInstance();
StoreFontSizeCodeType storeFontSizeCodeType = (StoreFontSizeCodeType) storeDescSizeCodeTypes[j];
storeFontSizeCodeTypeMap.put("storeFontSizeValue", storeFontSizeCodeType.value());
storeFontSizeCodeTypeMap.put("storeFontSizeName", storeFontSizeCodeType.name());
descSizes.add(storeFontSizeCodeTypeMap);
j++;
}
advanceFontTheme.put("storeDescSizeList",descSizes);
i++;
}
result = ServiceUtil.returnSuccess("load store Basic Theme option data success..");
result.put("advanceFontTheme", advanceFontTheme);
} else {
EbayStoreHelper.createErrorLogMessage(userLogin, dctx.getDispatcher(), context.get("productStoreId").toString(), resp.getAck().toString(), "Get store option : retrieveStoreFontTheme", resp.getErrors(0).getLongMessage());
}
}
} catch (ApiException e) {
e.printStackTrace();
} catch (SdkSoapException e) {