Class ItemViewSupport

java.lang.Object
com.easydesk.web.support.ItemViewSupport

public final class ItemViewSupport extends Object
Item(Artifactizable#getArtifact() 의 결과) 하나를 "속성 보기/편집" 화면(admin-item-view)으로 보여주기 위한 공용 로직. item.getModuleItemType() 에 등록되어 있는(활성화된) AttributeGroup 목록을 순서대로 가져와서, 각 Group 에 등록된 Attribute 목록과 그 Item 의 AttributeValue 값을 화면용 view 데이터 (ItemViewGroup/ItemViewAttribute) 로 만든다. UserAdminController(User 상세) 와 ModuleAdminController(Module 상세) 둘 다 "Item 하나를 그대로 보여준다"는 점은 동일해서 여기로 뽑았다 (AttributeGroupAttributeSupport 와 같은 이유 - 컨트롤러마다 복붙해두면 한쪽만 고치고 다른쪽을 빼먹는 사고가 나기 쉽다).

편집

각 AttributeValue 의 Viewable.getComponentName() 으로 화면 component(widget) 를 정한다 (WIDGETS). component 별로 값이 바뀌면 바로 easydesk-spring-modules 의 ItemController (POST /modules/{moduleId}/items/{uniqueId}/values) 로 저장한다. input name 은 AttributeValue.getQueryKey() 이고, ItemController 와 같이 item.getModuleAttributeValuesMap() 의 AttributeValue 를 기준으로 한다 (그래야 queryKey 가 서로 맞는다).
  • Field Details

  • Method Details

    • getItemEditTarget

      public static ItemViewSupport.ItemEditTarget getItemEditTarget(Item item)
      화면에서 편집한 값을 저장할 대상. null 이면 (저장되지 않은 Item 등) 화면은 읽기 전용이다.
      Parameters:
      item - 화면에 보여줄 item
      Returns:
      편집 대상 정보
    • getItemViewGroups

      public static List<ItemViewSupport.ItemViewGroup> getItemViewGroups(Item item) throws Exception
      item 에 등록된 AttributeGroup 들을 title 로, 그 안의 Attribute/AttributeValue 를 list 로 보여주기 위한 view 데이터를 만든다.
      Parameters:
      item - Artifactizable#getArtifact() 로 얻은 item
      Returns:
      AttributeGroup 순서(PreferredOrder) 대로 정렬된 view 데이터 목록
      Throws:
      Exception