package Ġnet . nem eros a . on track . extension . scm . catalog . ui Ċ Ċ import Ġnet . nem eros a . on track . common . Document Ċ import Ġnet . nem eros a . on track . extension . scm . catalog . SC MC atalog Ċ import Ġnet . nem eros a . on track . extension . scm . catalog . SC MC atalog Entry Ċ import Ġnet . nem eros a . on track . extension . scm . catalog . SC MC atalog Export Service Ċ import Ġnet . nem eros a . on track . ui . controller . Abstract Resource Controller Ċ import Ġnet . nem eros a . on track . ui . resource . Resources Ċ import Ġorg . springframework . web . bind . annotation . GetMapping Ċ import Ġorg . springframework . web . bind . annotation . RequestMapping Ċ import Ġorg . springframework . web . bind . annotation . RestController Ċ import Ġorg . springframework . web . servlet . mvc . method . annotation . Mvc Uri Components Builder . on Ċ import Ġjavax . servlet . http . HttpServletResponse Ċ Ċ @ RestController Ċ @ RequestMapping (" extension / scm / catalog ") Ċ class ĠS CM Catalog Controller ( ĊĠĠĠĠĠĠĠ Ġprivate Ġval Ġsc m Catalog : ĠS CM Catalog , ĊĠĠĠĠĠĠĠ Ġprivate Ġval Ġsc m Catalog Export Service : ĠS CM Catalog Export Service Ċ ) Ġ: ĠAbstract Resource Controller () Ġ{ ĊĊĠĠĠ Ġ/** ĊĠĠĠĠ Ġ* ĠGets Ġthe Ġentries Ġof Ġthe Ġcatalog ĊĠĠĠĠ Ġ*/ ĊĠĠĠ Ġ@ GetMapping (" entries ") ĊĠĠĠ Ġfun Ġentries (): ĠResources < SC MC atalog Entry > Ġ= ĊĠĠĠĠĠĠĠĠĠĠĠ ĠResources . of ( ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġsc m Catalog . catalog Entries . toList (), ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġuri ( on ( SC MC atalog Controller :: class . java ). entries ()) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ) ĊĊĠĠĠ Ġ@ GetMapping (" export / csv ") ĊĠĠĠ Ġfun Ġexport As Csv ( response : ĠHttpServletResponse ): ĠDocument Ġ{ ĊĠĠĠĠĠĠĠ Ġ// ĠGets Ġthe Ġlist Ġof Ġall Ġentries ĊĠĠĠĠĠĠĠ Ġval Ġentries Ġ= Ġsc m Catalog . catalog Entries . toList () ĊĠĠĠĠĠĠĠ Ġ// ĠAttachment ĊĠĠĠĠĠĠĠ Ġresponse . add Header (" Content - Disposition ", Ġ" attachment ; Ġfilename = on track - scm - catalog . csv ") ĊĠĠĠĠĠĠĠ Ġ// ĠExport Ġas ĠCSV ĊĠĠĠĠĠĠĠ Ġreturn Ġsc m Catalog Export Service . export Catalog As CSV ( entries ) ĊĠĠĠ Ġ} Ċ Ċ }