return null;
}
public List<Map<String,Object>> syncAdItemTemplates() throws ApiException, SdkSoapException, SdkException {
GetDescriptionTemplatesRequestType req = null;
GetDescriptionTemplatesResponseType resp = null;
List<Map<String,Object>> temGroupList = FastList.newInstance();
GetDescriptionTemplatesCall call = new GetDescriptionTemplatesCall(this.apiContext);
req = new GetDescriptionTemplatesRequestType();
req.setCategoryID(this.catId);
resp = (GetDescriptionTemplatesResponseType) call.execute(req);
if (resp != null && "SUCCESS".equals(resp.getAck().toString())) {
DescriptionTemplateType[] descriptionTemplateTypeList = resp.getDescriptionTemplate();
Debug.logInfo("layout of category "+ this.catId +":"+ resp.getLayoutTotal(), module);
for (DescriptionTemplateType descTemplateType : descriptionTemplateTypeList) {
List<Map<String,Object>> templateList = null;
Map<String,Object> templateGroup = null;
if ("THEME".equals(String.valueOf(descTemplateType.getType()))) {
Map<String,Object> template = FastMap.newInstance();
template.put("TemplateId", String.valueOf(descTemplateType.getID()));
template.put("TemplateImageURL", descTemplateType.getImageURL());
template.put("TemplateName", descTemplateType.getName());
template.put("TemplateType", descTemplateType.getType());
// check group template by groupId
for (Map<String,Object> temGroup : temGroupList) {
if (temGroup.get("TemplateGroupId").equals(descTemplateType.getGroupID().toString())) {
templateGroup = temGroup;
break;
}
}
if (templateGroup == null) {
templateGroup = FastMap.newInstance();
templateList = FastList.newInstance();
templateGroup.put("TemplateGroupId", descTemplateType.getGroupID().toString());
templateList.add(template);
templateGroup.put("Templates", templateList);
temGroupList.add(templateGroup);
} else {
if (templateGroup.get("Templates") != null) {
templateList = (List<Map<String,Object>>) templateGroup.get("Templates");
templateList.add(template);
}
}
} else if ("Layout".equals(String.valueOf(descTemplateType.getType()))) {
}
}
ThemeGroupType[] themes = resp.getThemeGroup();
if (themes != null && temGroupList != null) {
for (Map<String,Object> temGroup : temGroupList) {
for (ThemeGroupType theme : themes) {
if (theme.getGroupID() == Integer.parseInt(temGroup.get("TemplateGroupId").toString())) {
if (theme != null) temGroup.put("TemplateGroupName", theme.getGroupName());