Package com.easydesk.web.controller
Class ItemTypeAttributeAdminController
java.lang.Object
com.easydesk.web.controller.ItemTypeAttributeAdminController
@Screen("AdminItemTypeAttribute")
@Controller
public class ItemTypeAttributeAdminController
extends Object
Global ItemType 관리 화면(ItemTypeAdminController) 의 "AttributeGroup -> Attribute 목록"
(admin-item-type-attributes.html) 에서 Attribute 이름을 클릭하면 들어오는 ItemTypeAttribute
상세/관리 화면.
ModuleAttributeAdminController(Module 관리 쪽) 와 짝을 이루는 화면으로, ModuleAttribute 대신
ItemTypeAttribute, ModuleOption 대신 ItemTypeOption 을 다룬다는 점만 다르다. ItemTypeAttribute
는 AttributeGroup 과 무관하게 이미 등록되어 있어야만 존재한다 (core 의
AttributeFactory.getFactory(group).add(attribute) 가 group 이 ItemType 소유일 때 내부적으로
ItemTypeAttributeFactory 를 통해 만들어 준다). 그래서 admin-item-type-attributes.html 에서는
아직 Group 에 등록되지 않은(row.groupId == null) Attribute 는 링크를 걸지 않는다.
ModuleAttribute 와 달리 ItemTypeAttribute 는 REMOVED 대신 LOCKED 필드를 갖고(UNIQUE 는 없음),
ItemTypeOption 도 ModuleOption 과 달리 자체 LOCKED 필드를 갖는다. OptionAttribute 인 경우
ItemTypeOption 목록을 보여주고, core 에 새로 추가된 ItemTypeOptionFactory 로 이름만으로 추가할 수
있다 (AttributeOptionFactory 로 공유 AttributeOption 을 만들고/찾은 뒤,
ItemTypeOptionFactory.getFactory(itemTypeAttribute).add(option) 으로 이 ItemType 에 연결하는
2단계 - ModuleOptionFactory 와 동일한 패턴이지만, 이 factory 는 중복 체크를 직접 하지 않으므로
이 컨트롤러에서 itemTypeAttribute.getItemTypeOption(option) 으로 먼저 확인한다).
-
Constructor Summary
ConstructorsConstructorDescriptionItemTypeAttributeAdminController(org.springframework.context.MessageSource messageSource) -
Method Summary
Modifier and TypeMethodDescriptionaddOption(Integer typeId, Integer attributeId, Integer optionId, String groupName, Integer activeTab, HttpSession session, org.springframework.web.servlet.mvc.support.RedirectAttributes redirectAttributes) ItemTypeOption 추가.detail(Integer typeId, Integer attributeId, String groupName, Integer activeTab, HttpSession session, org.springframework.ui.Model model) update(Integer typeId, Integer attributeId, Boolean active, Boolean required, Boolean quickSearch, Boolean defaultTextFlag, Boolean dedupeCheck, Boolean locked, Integer order, String groupName, Integer activeTab, HttpSession session, org.springframework.web.servlet.mvc.support.RedirectAttributes redirectAttributes)
-
Constructor Details
-
ItemTypeAttributeAdminController
public ItemTypeAttributeAdminController(org.springframework.context.MessageSource messageSource)
-
-
Method Details
-
detail
@GetMapping("/admin/item-types/{typeId}/attributes/{attributeId}") public String detail(@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/item-types/{typeId}/attributes/{attributeId}/update") public String update(@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="locked",required=false) Boolean locked, @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/item-types/{typeId}/attributes/{attributeId}/options") public String addOption(@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) ItemTypeOption 추가. 이제 이름을 직접 입력받지 않고, 화면 dropdown 에서 고른 (이미 존재하는) AttributeOption 의 optionId 를 받아서 ItemTypeOptionFactory.getFactory(itemTypeAttribute).add(option) 으로 이 ItemType 에 연결만 한다 - core 의 AttributeOptionFactory(이름으로 새 AttributeOption을 만들거나 찾는 것)는 더 이상 여기서 쓰지 않는다 (Global Attribute 관리 화면에서만 새로 만든다).
-