Package com.easydesk.web.controller
Class ModuleAttributeAdminController
java.lang.Object
com.easydesk.web.controller.ModuleAttributeAdminController
@Screen("AdminModuleAttribute")
@Controller
public class ModuleAttributeAdminController
extends Object
Module 관리 화면(ModuleAdminController) 의 "AttributeGroup -> Attribute 목록"
(admin-module-attributes.html) 에서 Attribute 이름을 클릭하면 들어오는 ModuleAttribute 상세/관리 화면.
ModuleAttribute 는 (Module, ItemType, Attribute) 복합키를 갖는 엔티티로, AttributeGroup 과
무관하게 이미 등록되어 있어야만 존재한다 (core 의 AttributeFactory.getFactory(group).add(attribute)
가 등록 시 내부적으로 ModuleAttributeFactory 를 통해 만들어 준다 - AttributeAdminController/
ModuleAdminController 쪽 참고). 그래서 admin-module-attributes.html 에서는 아직 Group 에 등록되지 않은
(row.groupId == null) Attribute 는 링크를 걸지 않는다.
Global Attribute 의 admin-attribute-detail.html 과 짝을 이루는 화면이지만, 여기서 수정하는 필드는
localized/global/common/removed 가 아니라 ModuleAttribute 고유의 Property 들
(active/required/order/quickSearch/defaultTextFlag/dedupeCheck/unique) 이다. OptionAttribute 인
경우 ModuleOption 목록을 보여주고, 이름만으로 추가할 수 있다 (core 의 AttributeOptionFactory 로
공유 AttributeOption 을 만들고/찾고, ModuleAttribute#add(AttributeOption) 으로 이 Module/ItemType
에 연결하는 2단계 - ModuleOptionFactory 같은 별도 factory 클래스는 core 에 없다).
-
Constructor Summary
ConstructorsConstructorDescriptionModuleAttributeAdminController(org.springframework.context.MessageSource messageSource) -
Method Summary
Modifier and TypeMethodDescriptionaddOption(Long moduleId, Integer typeId, Integer attributeId, Integer optionId, String groupName, Integer activeTab, HttpSession session, org.springframework.web.servlet.mvc.support.RedirectAttributes redirectAttributes) ModuleOption 추가.detail(Long moduleId, Integer typeId, Integer attributeId, String groupName, Integer activeTab, HttpSession session, org.springframework.ui.Model model) update(Long moduleId, Integer typeId, Integer attributeId, Boolean active, Boolean required, Boolean quickSearch, Boolean defaultTextFlag, Boolean dedupeCheck, Boolean unique, Integer order, String groupName, Integer activeTab, HttpSession session, org.springframework.web.servlet.mvc.support.RedirectAttributes redirectAttributes)
-
Constructor Details
-
ModuleAttributeAdminController
public ModuleAttributeAdminController(org.springframework.context.MessageSource messageSource)
-
-
Method Details
-
detail
@GetMapping("/admin/modules/{moduleId}/item-types/{typeId}/attributes/{attributeId}") public String detail(@PathVariable("moduleId") Long moduleId, @PathVariable("typeId") Integer typeId, @PathVariable("attributeId") Integer attributeId, @RequestParam(value="groupName",required=false) String groupName, @RequestParam(value="tab",required=false,defaultValue="0") Integer activeTab, HttpSession session, org.springframework.ui.Model model) -
update
@PostMapping("/admin/modules/{moduleId}/item-types/{typeId}/attributes/{attributeId}/update") public String update(@PathVariable("moduleId") Long moduleId, @PathVariable("typeId") Integer typeId, @PathVariable("attributeId") Integer attributeId, @RequestParam(value="active",required=false) Boolean active, @RequestParam(value="required",required=false) Boolean required, @RequestParam(value="quickSearch",required=false) Boolean quickSearch, @RequestParam(value="defaultTextFlag",required=false) Boolean defaultTextFlag, @RequestParam(value="dedupeCheck",required=false) Boolean dedupeCheck, @RequestParam(value="unique",required=false) Boolean unique, @RequestParam(value="order",required=false) Integer order, @RequestParam(value="groupName",required=false) String groupName, @RequestParam(value="tab",required=false,defaultValue="0") Integer activeTab, HttpSession session, org.springframework.web.servlet.mvc.support.RedirectAttributes redirectAttributes) -
addOption
@PostMapping("/admin/modules/{moduleId}/item-types/{typeId}/attributes/{attributeId}/options") public String addOption(@PathVariable("moduleId") Long moduleId, @PathVariable("typeId") Integer typeId, @PathVariable("attributeId") Integer attributeId, @RequestParam(value="optionId",required=false) Integer optionId, @RequestParam(value="groupName",required=false) String groupName, @RequestParam(value="tab",required=false,defaultValue="0") Integer activeTab, HttpSession session, org.springframework.web.servlet.mvc.support.RedirectAttributes redirectAttributes) ModuleOption 추가. 이제 이름을 직접 입력받지 않고, 화면 dropdown 에서 고른 (이미 존재하는) AttributeOption 의 optionId 를 받아서 ModuleOptionFactory.getFactory(moduleAttribute).add(option) 으로 이 Module 에 연결만 한다 - core 의 AttributeOptionFactory(이름으로 새 AttributeOption을 만들거나 찾는 것)는 더 이상 여기서 쓰지 않는다 (Global Attribute 관리 화면에서만 새로 만든다).
-