Map<String,Object> result = FastMap.newInstance();
GenericValue userLogin = (GenericValue) context.get("userLogin");
Locale locale = (Locale) context.get("locale");
Delegator delegator = dctx.getDelegator();
GetStoreOptionsRequestType req = null;
StoreThemeArrayType returnedAdvancedThemeArray = 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);
if (resp != null && "SUCCESS".equals(resp.getAck().toString())) {
result = ServiceUtil.returnSuccess(UtilProperties.getMessage(resource, "EbayStoreLoadAdvancedThemeSuccess", locale));
returnedAdvancedThemeArray = resp.getAdvancedThemeArray();
int i = 0;
List<Map<String,Object>> themeList = FastList.newInstance();
while (i < returnedAdvancedThemeArray.getThemeLength()) {
Map<String,Object> advanceTheme = FastMap.newInstance();
StoreThemeType storeThemeType = returnedAdvancedThemeArray.getTheme(i);
advanceTheme.put("storeThemeId",storeThemeType.getThemeID());
advanceTheme.put("storeThemeName",storeThemeType.getName());
themeList.add(advanceTheme);
i++;
}
result.put("storeThemeList", themeList);
int j = 0;
StoreColorSchemeType[] storeColorSchemeTypes = returnedAdvancedThemeArray.getGenericColorSchemeArray().getColorScheme();
List<Map<String,Object>> themeColorList = FastList.newInstance();
while (j < storeColorSchemeTypes.length) {
Map<String,Object> advanceColorTheme = FastMap.newInstance();
StoreColorSchemeType storeColorSchemeType = storeColorSchemeTypes[j];
advanceColorTheme.put("storeColorSchemeId", storeColorSchemeType.getColorSchemeID());