Package com.easydesk.web.controller
Class ModuleSelectController
java.lang.Object
com.easydesk.web.controller.ModuleSelectController
로그인한 사용자가 Module 을 선택하고, 그 Module 에 실제로 등록된 ModuleItemType 목록을 본 뒤
"글쓰기" 화면으로 넘어가기 위한 진입 화면들.
ModuleAdminController#itemTypes() (admin 화면)는 ItemTypeEnum 전체를 훑어서 등록 여부를
회색으로 표시하는 관리자용 화면이지만, 여기서는 그와 달리 이 Module 에 실제로 등록된
ModuleItemType 만 보여준다 (module.getModuleItemTypes() 그대로 사용).
-
Constructor Summary
ConstructorsConstructorDescriptionModuleSelectController(org.springframework.context.MessageSource messageSource) -
Method Summary
Modifier and TypeMethodDescriptionitems(Long id, String pageParam, HttpSession session, org.springframework.ui.Model model) module-select 화면에서 active 한 Module 이름을 클릭했을 때 보여줄 Item 목록.itemView(Long moduleId, String uniqueId, HttpSession session, org.springframework.ui.Model model) module-items-list 화면에서 Unique-ID 를 클릭했을 때 보여줄 Item 상세 화면.moduleItemTypes(Long id, HttpSession session, org.springframework.ui.Model model) 선택한 Module 에 실제로 등록된 ModuleItemType 목록을 보여준다 (ItemTypeEnum 전체가 아님).selectModule(HttpSession session, org.springframework.ui.Model model) 전체 Module 목록을 보여준다.write(Long moduleId, Integer typeId, HttpSession session, org.springframework.ui.Model model) "글쓰기" 버튼의 목적지.
-
Constructor Details
-
ModuleSelectController
public ModuleSelectController(org.springframework.context.MessageSource messageSource)
-
-
Method Details
-
selectModule
@Screen("ModuleSelect") @GetMapping("/modules") public String selectModule(HttpSession session, org.springframework.ui.Model model) 전체 Module 목록을 보여준다. 각 row 의 "아이템 등록" 버튼을 누르면 moduleItemTypes() 화면으로 이동한다. -
moduleItemTypes
@Screen("ModuleItemTypes") @GetMapping("/modules/{moduleId}/item-types") public String moduleItemTypes(@PathVariable("moduleId") Long id, HttpSession session, org.springframework.ui.Model model) 선택한 Module 에 실제로 등록된 ModuleItemType 목록을 보여준다 (ItemTypeEnum 전체가 아님). 각 row 의 "글쓰기" 버튼은 write() 로 연결되는데, 아직 실제 작성 화면은 구현되지 않았다 (클릭하면 전역 에러 화면에서 "화면 준비중" 으로 안내된다 - 추후 요청 시 구현). -
items
@Screen("ModuleItemsList") @GetMapping("/modules/{moduleId}/items") public String items(@PathVariable("moduleId") Long id, @RequestParam(name="page",required=false) String pageParam, HttpSession session, org.springframework.ui.Model model) module-select 화면에서 active 한 Module 이름을 클릭했을 때 보여줄 Item 목록. 이 Module 에 등록된(REMOVED=false) Item 을 Torque 의 LargeSelect 로 한 페이지에 ITEMS_PER_PAGE(20) 건씩 나누어 보여준다. LargeSelect 는 세션에 보관한다 (ItemListState). page 파라미터 없이 들어오면 (목록 첫 진입) LargeSelect 를 새로 만들어 최신 데이터를 다시 조회하고, page 파라미터가 있으면 (페이지 이동) 세션에 있는 것을 그대로 써서 LargeSelect 가 메모리에 들고 있는 block 을 재사용한다. 전체 건수는 LargeSelect 가 아니라 따로 센 값을 쓴다 (이유는 ItemListState 참고). defaultText 는 각 Item 이 속한 ModuleItemType 의 getDefaultTextAttribute() (명시적으로 지정된 게 없으면 가장 우선순위 높은 text 속성) 로 "기본 텍스트" Attribute 를 구한 뒤, Item.getModuleAttributeValuesMap() 에서 그 값을 꺼내온다. -
itemView
@Screen("AdminItemView") @GetMapping("/modules/{moduleId}/items/{uniqueId}/view") public String itemView(@PathVariable("moduleId") Long moduleId, @PathVariable("uniqueId") String uniqueId, HttpSession session, org.springframework.ui.Model model) module-items-list 화면에서 Unique-ID 를 클릭했을 때 보여줄 Item 상세 화면. ItemManager.getItemById(uniqueId) 로 db 에서 Item 을 직접 조회한다 (module-items-list 는 Item 을 Artifactizable 경유가 아니라 직접 다루므로, ModuleAdminController#view() 처럼 getArtifact() 를 거치는 대신 uniqueId 로 바로 조회한다). 이후 ItemViewSupport 로 ModuleAdminController#view()/UserAdminController#view() 와 동일하게 admin-item-view 템플릿이 요구하는 groups 데이터를 만든다. "목록으로" 링크는 보고 있던 페이지로 돌아간다. -
write
@Screen("ModuleItemWrite") @GetMapping("/modules/{moduleId}/item-types/{typeId}/write") public String write(@PathVariable("moduleId") Long moduleId, @PathVariable("typeId") Integer typeId, HttpSession session, org.springframework.ui.Model model) "글쓰기" 버튼의 목적지. 실제 작성 화면은 아직 구현되지 않아서 일부러 예외를 던진다 - 전역 에러 화면(error.html)이 이를 잡아서 "화면 준비중" 으로 안내한다 (ModuleAdminController#remove() 의 스텁과 동일한 패턴).
-