/** * Method getTemplateName. * * @param id int * @return String * @see com.percussion.pso.restservice.support.IImportItemSystemInfo#getTemplateName(int) */ public String getTemplateName(int id) { initServices(); log.debug("Getting template name"); String templatename = null; // String templatename=templateNameMap.get(id); if (templatename == null) { try { IPSAssemblyTemplate template = aService.loadTemplate(new PSGuid(PSTypeEnum.TEMPLATE, id), false); templatename = template.getName(); } catch (PSAssemblyException e) { log.error("cannot get template for id " + id, e); templatename = String.valueOf(id); } } IPSAssemblyTemplate template = null; try { template = aService.loadTemplate(new PSGuid(PSTypeEnum.TEMPLATE, id), false); } catch (PSAssemblyException e) { log.error("Cannot find template with id " + id); } log.debug("Got template name"); return (template == null) ? Integer.toString(id) : template.getName(); }
/** * Method getSlotName. * * @param id int * @return String * @see com.percussion.pso.restservice.support.IImportItemSystemInfo#getSlotName(int) */ public String getSlotName(int id) { initServices(); log.debug("Getting slot name"); String slotname = slotNameMap.get(id); if (slotname == null) { IPSTemplateSlot slot; try { slot = aService.loadSlot(new PSGuid(PSTypeEnum.SLOT, id)); slotname = slot.getName(); } catch (Exception e) { log.debug("Cannot load slot " + id, e); slotname = String.valueOf(id); } } return slotname; }