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);
Map<String,Object> advanceFontTheme = FastMap.newInstance();
if (resp != null && "SUCCESS".equals(resp.getAck().toString())) {
returnedThemeArray = resp.getAdvancedThemeArray();
int i = 0;
StoreColorSchemeType[] storeColorSchemeTypes = returnedThemeArray.getGenericColorSchemeArray().getColorScheme();
while (i < storeColorSchemeTypes.length) {
StoreColorSchemeType storeColorSchemeType = storeColorSchemeTypes[i];
StoreFontType storeFontType = storeColorSchemeType.getFont();
advanceFontTheme.put("storeFontTypeNameFaceColor",storeFontType.getNameColor());
int j = 0;
storeFontType.getNameFace();
StoreFontFaceCodeType[] storeFontNameFaceCodeTypes = StoreFontFaceCodeType.values();
List<Map<String,Object>> nameFaces = FastList.newInstance();
while (j < storeFontNameFaceCodeTypes.length) {
Map<String,Object> storeFontNameFaceCodeTypeMap = FastMap.newInstance();
StoreFontFaceCodeType storeFontNameFaceCodeType = storeFontNameFaceCodeTypes[j];
storeFontNameFaceCodeTypeMap.put("storeFontValue", storeFontNameFaceCodeType.value());
storeFontNameFaceCodeTypeMap.put("storeFontName", storeFontNameFaceCodeType.name());
nameFaces.add(storeFontNameFaceCodeTypeMap);
j++;
}
advanceFontTheme.put("storeFontTypeFontFaceList",nameFaces);
j = 0;
storeFontType.getNameSize();
StoreFontSizeCodeType[] storeFontSizeCodeTypes = StoreFontSizeCodeType.values();
List<Map<String,Object>> sizeFaces = FastList.newInstance();
while (j < storeFontSizeCodeTypes.length) {
Map<String,Object> storeFontSizeCodeTypeMap = FastMap.newInstance();
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;
storeFontType.getTitleFace();
StoreFontFaceCodeType[] storeFontTypeTitleFaces = StoreFontFaceCodeType.values();
List<Map<String,Object>> titleFaces = FastList.newInstance();
while (j < storeFontTypeTitleFaces.length) {
Map<String,Object> storeFontTypeTitleFaceMap = FastMap.newInstance();
StoreFontFaceCodeType storeFontTypeTitleFace = storeFontTypeTitleFaces[j];
storeFontTypeTitleFaceMap.put("storeFontValue", storeFontTypeTitleFace.value());
storeFontTypeTitleFaceMap.put("storeFontName", storeFontTypeTitleFace.name());
titleFaces.add(storeFontTypeTitleFaceMap);
j++;
}
advanceFontTheme.put("storeFontTypeFontTitleList",titleFaces);
j = 0;
storeFontType.getTitleSize();
StoreFontSizeCodeType[] storeTitleSizeCodeTypes = StoreFontSizeCodeType.values();
List<Map<String,Object>> titleSizes = FastList.newInstance();
while (j < storeTitleSizeCodeTypes.length) {
Map<String,Object> storeFontSizeCodeTypeMap = FastMap.newInstance();
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;
storeFontType.getDescFace();
StoreFontFaceCodeType[] storeFontTypeDescFaces = StoreFontFaceCodeType.values();
List<Map<String,Object>> descFaces = FastList.newInstance();
while (j < storeFontTypeDescFaces.length) {
Map<String,Object> storeFontTypeDescFaceMap = FastMap.newInstance();
StoreFontFaceCodeType storeFontTypeDescFace = storeFontTypeDescFaces[j];
storeFontTypeDescFaceMap.put("storeFontValue", storeFontTypeDescFace.value());
storeFontTypeDescFaceMap.put("storeFontName", storeFontTypeDescFace.name());
descFaces.add(storeFontTypeDescFaceMap);
j++;
}
advanceFontTheme.put("storeFontTypeFontDescList",descFaces);
j = 0;
storeFontType.getDescSize();
StoreFontSizeCodeType[] storeDescSizeCodeTypes = StoreFontSizeCodeType.values();
List<Map<String,Object>> descSizes = FastList.newInstance();
while (j < storeDescSizeCodeTypes.length) {
Map<String,Object> storeFontSizeCodeTypeMap = FastMap.newInstance();
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(UtilProperties.getMessage(resource, "EbayStoreLoadBasicThemeSuccess", locale));
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) {