Class Item

All Implemented Interfaces:
Cacheable, Identifiable<Long>, Serializable, ColumnAccessByName, ObjectModel, Persistent
Direct Known Subclasses:
ItemSearchImpl

public class Item extends BaseItem implements Cacheable, Identifiable<Long>
DOCUMENT ME!
Version:
$id: Item.java $Revision$, 03-03-22 8:15:33 PM KST
Author:
YounghoCho
  • Field Details

  • Constructor Details

    • Item

      protected Item()
      new items are created only when the itemtype and module are known Or by the Peer when retrieving from db
    • Item

      protected Item(Module module, ItemType itemType) throws TorqueException
      Creates a new Item object.
      Parameters:
      module - item 이 속할 Module
      itemType - item 의 ItemType
      Throws:
      TorqueException - 생성 중 오류가 발생한 경우
  • Method Details

    • setId

      public void setId(Long id)
      Description copied from interface: Identifiable
      Sets the Id of the Identifiable Entity.
      Specified by:
      setId in interface Identifiable<Long>
      Parameters:
      id - The new Id of the entity
    • getId

      public Long getId()
      Description copied from interface: Identifiable
      Get the Id of the Identifiable Entity.
      Specified by:
      getId in interface Identifiable<Long>
      Returns:
      The Id of the entity.
    • getNewInstance

      public static Item getNewInstance(ModuleItemType rmit) throws TorqueException
      Gets an item associated to a Module TODO : 이 method 를 직접 부르지 않고 NewItemFactory 를 통해 사용한다.
      Parameters:
      rmit - item 이 속할 ModuleItemType
      Returns:
      새 item (기본값 적용)
      Throws:
      TorqueException - 생성 중 오류가 발생한 경우
    • getNewInstance

      public static Item getNewInstance(Module module, ItemType itemType) throws TorqueException
      Gets an item associated to a Module TODO : 이 method 를 직접 부르지 않고 NewItemFactory 를 통해 사용한다.
      Parameters:
      module - item 이 속할 Module
      itemType - item 의 ItemType
      Returns:
      새 item (기본값 적용)
      Throws:
      TorqueException - 생성 중 오류가 발생한 경우
    • getNewInstance

      public static Item getNewInstance(Module module, ItemType itemType, boolean applyDefaultValue) throws TorqueException
      Gets an item associated to a Module TODO : 검색 이외 에는 이 method 를 직접 부르지 않고 NewItemFactory 를 통해 사용한다.
      Parameters:
      module - item 이 속할 Module
      itemType - item 의 ItemType
      applyDefaultValue - 기본값을 적용할지 여부
      Returns:
      새 item
      Throws:
      TorqueException - 생성 중 오류가 발생한 경우
    • setModule

      public void setModule(Module module)
      DOCUMENT ME!
      Parameters:
      module - DOCUMENT ME!
    • getModule

      public Module getModule() throws TorqueException
      DOCUMENT ME!
      Returns:
      DOCUMENT ME!
      Throws:
      TorqueException - 조회 중 오류가 발생한 경우
    • getLocale

      public Locale getLocale()
      이 아이템의 Locale 을 구한다.
      Returns:
      locale
    • setLocale

      public void setLocale(Locale locale)
      DOCUMENT ME!
      Parameters:
      locale - DOCUMENT ME!
    • isCreator

      public boolean isCreator(EasyDeskUser user) throws Exception
      check getCreatedBy and anonymous
      Parameters:
      user - 확인할 사용자
      Returns:
      boolean
      Throws:
      Exception - 처리 중 오류가 발생한 경우
    • isTemplate

      public boolean isTemplate()
      Whether this item is an enter item template.
      Returns:
      true/false
    • has

      public boolean has(Attribute attribute) throws TorqueException
      FeatureDetection 이다. ModuleAttribute 를 가지고 있는지
      Parameters:
      attribute - 확인할 Attribute
      Returns:
      true/false which has ModuleAttribute ( FeatureDetection )
      Throws:
      TorqueException - 조회 중 오류가 발생한 경우
    • getModuleAttributeValuesMap

      public org.apache.commons.collections4.map.LinkedMap<String,AttributeValue> getModuleAttributeValuesMap() throws TorqueException
      Calls the overloaded version by passing 'true' so that only active attributes will be considered.

      MVC 로직 안에서 item 에 관련된 AttributeValue 를 처리할 때 항상 이 method 를 사용한다.

      Returns:
      active ModuleAttribute 의 { attribute 이름(대문자), AttributeValue } map
      Throws:
      TorqueException - 조회 중 오류가 발생한 경우
      See Also:
    • getModuleAttributeValuesMap

      public org.apache.commons.collections4.map.LinkedMap<String,AttributeValue> getModuleAttributeValuesMap(boolean isActiveOnly) throws TorqueException
      AttributeValues that are relevant to the item's current module. Empty AttributeValues that are relevant for the module, but have not been set for the item are included. The values are ordered according to the module's preference and it has not include user specific value. 사용상 주의 :

      ModuleAttributeValuesMap (MVC pipeline 안에서) VS AttributeValues (Search Process 에서)

      • ModuleAttributeValuesMap : Module 에 Assign 된 Item 이 가질 수 있는 속성들 (특정 사용자 값은 제외된다.)
      • AttributeValues : 일반적 Method , ItemSearch 등 Module 에 한정되지 않은 것에만 적용된다.
      Parameters:
      isActiveOnly - TRUE if only active attributes need to be considered and FALSE if both active and inactive attributes need to be considered ( ItemSearch 에서 사용 )
      Returns:
      linkedMap
      Throws:
      TorqueException - 조회 중 오류가 발생한 경우
      See Also:
    • getModuleItemType

      public ModuleItemType getModuleItemType() throws TorqueException
      The ModuleItemType related to this item's module and item type.
      Returns:
      a ModuleItemType if this item's module and item type are not null, otherwise return null.
      Throws:
      TorqueException - 조회 중 오류가 발생한 경우
    • getAttributeValuesMap

      public Map<String,AttributeValue> getAttributeValuesMap() throws TorqueException
      AttributeValues that are set for this Item Includes deleted AttributeValues if the attribute is MultipleAttribute type Except personals support info
      Returns:
      { attribute 이름, AttributeValue } map
      Throws:
      TorqueException - 조회 중 오류가 발생한 경우
    • getAttributeValues

      public List<AttributeValue> getAttributeValues(Criteria criteria) throws TorqueException
      item 의 AttributeValue 목록을 valueId 순서로 구한다. MultiValued 속성의 순서를 보장한다.
      Overrides:
      getAttributeValues in class BaseItem
      Parameters:
      criteria - 조회 조건
      Returns:
      AttributeValue 목록
      Throws:
      TorqueException - 조회 중 오류가 발생한 경우
    • getItemActivitySet

      public ItemActivitySet getItemActivitySet()
      이 item 의 ItemActivitySet 을 구한다.
      Returns:
      ItemActivitySet
    • getActivitySet

      public ActivitySet getActivitySet() throws TorqueException
      이 item 을 생성할 때 만들어진 ActivitySet 을 구한다.
      Returns:
      activitySet which was created by this item creation
      Throws:
      TorqueException - 조회 중 오류가 발생한 경우
    • getCreatedDate

      public Date getCreatedDate() throws Exception
      The date the item was created.
      Returns:
      a Date value
      Throws:
      TorqueException - if an error occurs
      Exception
    • getCreatedBy

      public EasyDeskUser getCreatedBy() throws Exception
      The user that created this artifact.
      Returns:
      a User value
      Throws:
      Exception - 처리 중 오류가 발생한 경우
    • getModuleAttribute

      public ModuleAttribute getModuleAttribute(Attribute attribute) throws TorqueException
      attribute 에 해당하는 ModuleAttribute 를 구한다.
      Parameters:
      attribute - 대상 Attribute
      Returns:
      moduleAttribute for input attribute
      Throws:
      TorqueException - 조회 중 오류가 발생한 경우
    • getModuleOption

      public ModuleOption getModuleOption(AttributeOption attributeOption) throws TorqueException
      attributeOption 에 해당하는 ModuleOption 을 구한다.
      Parameters:
      attributeOption - 대상 AttributeOption
      Returns:
      moduleOption for input attributeOption
      Throws:
      TorqueException - 조회 중 오류가 발생한 경우
    • hasValue

      public boolean hasValue(Attribute attribute) throws TorqueException
      이 아이템의 attribute 의 값을 가지고 있는지 확인한다. attributeValue.isSet() 의 short path 이다.
      Parameters:
      attribute - 확인할 Attribute
      Returns:
      값이 설정되어 있으면 true
      Throws:
      TorqueException - 조회 중 오류가 발생한 경우
    • hasValue

      public boolean hasValue(Attribute attribute, Object checkValue) throws Exception
      이 아이템의 attribute 의 값이 checkValue 를 가지고 있는지 확인한다.
      Parameters:
      attribute - 확인할 Attribute
      checkValue - 확인할 값
      Returns:
      checkValue 를 가지고 있으면 true
      Throws:
      Exception - 처리 중 오류가 발생한 경우
    • getAttributeValue

      public AttributeValue getAttributeValue(Attribute attribute) throws TorqueException
      아이템의 속성값을 구하는 단일 Method 모든 속성값은 이 Method 를 통하여 구하여져야 한다.
      Parameters:
      attribute - can not be null
      Returns:
      attributeValue of this item
      Throws:
      TorqueException - 조회 중 오류가 발생한 경우
    • getAttributeValue

      public AttributeValue getAttributeValue(Attribute attribute, EasyDeskUser user) throws TorqueException
      DOCUMENT ME!
      Parameters:
      attribute - DOCUMENT ME!
      user - DOCUMENT ME!
      Returns:
      DOCUMENT ME!
      Throws:
      TorqueException - DOCUMENT ME!
    • getUserAttributeValues

      public List<AttributeValue> getUserAttributeValues() throws TorqueException
      Returns attribute values for all user attributes.
      Returns:
      attributeValue list
      Throws:
      TorqueException - 조회 중 오류가 발생한 경우
    • getUserAttributeValues

      public List<AttributeValue> getUserAttributeValues(boolean includeDeleted) throws TorqueException
      Returns attribute values for all active user attributes which defined in ModuleItemType
      Parameters:
      includeDeleted - 삭제된 값을 포함할지 여부
      Returns:
      attributeValue list
      Throws:
      TorqueException - 조회 중 오류가 발생한 경우
    • getUserAttributeValues

      public List<AttributeValue> getUserAttributeValues(Attribute attribute) throws TorqueException
      Returns attribute values for all user attributes.
      Parameters:
      attribute - 대상 user attribute
      Returns:
      attributeValue list
      Throws:
      TorqueException - 조회 중 오류가 발생한 경우
    • getUserAttributeValues

      protected List<AttributeValue> getUserAttributeValues(List<Attribute> attributes, boolean includeDeleted) throws TorqueException
      user attribute 들의 값을 구한다.
      Parameters:
      attributes - user attribute 목록 (todo change to user attribute collection)
      includeDeleted - 삭제된 값을 포함할지 여부
      Returns:
      user attributeValue ids list for this item
      Throws:
      TorqueException - 조회 중 오류가 발생한 경우
    • getActivity

      public List<Activity> getActivity(EasyDeskUser user) throws TorqueException
      Returns list of Activity objects associated with this Item and new userid .
      Parameters:
      user - 대상 사용자 (new user id)
      Returns:
      activity list
      Throws:
      TorqueException - 조회 중 오류가 발생한 경우
    • getActivity

      public List<Activity> getActivity(EasyDeskUser user, Long activitySetId) throws TorqueException
      Returns list of Activity objects associated with this Item and new userid for activitySetId.
      Parameters:
      user - can be null
      activitySetId - 대상 ActivitySet id
      Returns:
      List activities
      Throws:
      TorqueException - 조회 중 오류가 발생한 경우
    • getActivity

      public List<Activity> getActivity(EasyDeskUser user, ActivitySetType activitySetType) throws TorqueException
      Returns list of Activity objects associated with this Item, new userid and acitivtySetType id
      Parameters:
      user - can be null
      activitySetType - Integer
      Returns:
      activity list
      Throws:
      TorqueException - 조회 중 오류가 발생한 경우
    • getActivity

      public List<Activity> getActivity(EasyDeskUser user, Attribute attribute, ActivitySetType activitySetType) throws TorqueException
      Returns list of Activity objects associated with this Item, new userid and attribute and acitivtySetType id
      Parameters:
      user - can be null
      attribute - 대상 Attribute
      activitySetType - 대상 ActivitySetType
      Returns:
      activity list
      Throws:
      TorqueException - 조회 중 오류가 발생한 경우
    • getActivity

      public List<Activity> getActivity(EasyDeskUser user, Attribute attribute, List<ActivitySetType> activitySetTypes) throws TorqueException
      Returns list of Activity objects associated with this Item, new userid and attribute and acitivtySetType id
      Parameters:
      user - can be null
      attribute - if null than all
      activitySetTypes - Integer
      Returns:
      activity list
      Throws:
      TorqueException - 조회 중 오류가 발생한 경우
    • getActivity

      public List<Activity> getActivity(EasyDeskUser user, List<Attribute> attributes, List<ActivitySetType> activitySetTypes) throws TorqueException
      Returns list of Activity objects associated with this Item, new userid and attribute and acitivtySetType id
      Parameters:
      user - can be null
      attributes - 대상 Attribute 목록
      activitySetTypes - 대상 ActivitySetType 목록
      Returns:
      activity list
      Throws:
      TorqueException - 조회 중 오류가 발생한 경우
    • getActivity

      public List<Activity> getActivity(EasyDeskUser user, List<Attribute> attributes, List<ActivitySetType> activitySetTypes, boolean exclude) throws TorqueException
      Returns list of Activity objects associated with this Item, new userid and attribute and acitivtySetType id
      Parameters:
      user - can be null
      attributes - 대상 Attribute 목록
      activitySetTypes - 대상 ActivitySetType 목록
      exclude - include null EndDate
      Returns:
      activity list
      Throws:
      TorqueException - 조회 중 오류가 발생한 경우
    • getLastActivitySet

      public ActivitySet getLastActivitySet() throws Exception
      The last activitySet to the item.
      Returns:
      last activitySet
      Throws:
      Exception - 처리 중 오류가 발생한 경우
    • getLastActivitySet

      public ActivitySet getLastActivitySet(Integer... typeIds) throws Exception
      The last modification made to the item which given activitySetTypes
      Parameters:
      typeIds - activitySetType ids array
      Returns:
      last activitySet
      Throws:
      Exception - 처리 중 오류가 발생한 경우
    • getLastActivitySet

      public ActivitySet getLastActivitySet(Attribute[] attributes, Integer... typeIds) throws Exception
      The last modification made to the item which given activitySetTypes
      Parameters:
      attributes - 대상 Attribute 배열
      typeIds - activitySetType ids array
      Returns:
      last activitySet
      Throws:
      Exception - 처리 중 오류가 발생한 경우
    • getLastActivitySet

      public ActivitySet getLastActivitySet(EasyDeskUser user, Integer typeId) throws Exception
      The last modification made to the item which given activitySetType
      Parameters:
      user - 대상 사용자
      typeId - activitySetType id
      Returns:
      last activitySet
      Throws:
      Exception - 처리 중 오류가 발생한 경우
    • getLastActivitySet

      public ActivitySet getLastActivitySet(EasyDeskUser user, Integer... typeIds) throws Exception
      The last modification made to the item which given activitySetType
      Parameters:
      user - 대상 사용자
      typeIds - activitySetType ids array
      Returns:
      last activitySet
      Throws:
      Exception - 처리 중 오류가 발생한 경우
    • updateLastActivitySet

      public void updateLastActivitySet(ActivitySet activitySet) throws Exception
      Item 의 update 시에 ItemActivitySet 을 update 한다.
      Parameters:
      activitySet - 마지막 ActivitySet
      Throws:
      Exception - 처리 중 오류가 발생한 경우
    • hasAssigned

      public boolean hasAssigned(Attribute attribute) throws Exception
      item 이 이미 attribute 에 assigned 되어 있는지
      Parameters:
      attribute - 확인할 user Attribute
      Returns:
      assigned 되어 있으면 true
      Throws:
      Exception - 처리 중 오류가 발생한 경우
    • isAssigned

      public boolean isAssigned(EasyDeskUser assignee, Attribute attribute) throws Exception
      사용자가 이미 assigned 되어 있는지 확인한다.
      Parameters:
      assignee - 확인할 사용자
      attribute - 확인할 user Attribute
      Returns:
      assigned 되어 있으면 true
      Throws:
      Exception - 처리 중 오류가 발생한 경우
    • assign

      public ActivitySet assign(ActivitySet activitySet, EasyDeskUser assignee, EasyDeskUser assigner, Attribute attribute) throws Exception
      Assigns user to item.
      Parameters:
      activitySet - 현재 처리중인 ActivitySet
      assignee - assign 받는 사용자
      assigner - assign 하는 사용자
      attribute - 대상 user Attribute
      Returns:
      ActivitySet
      Throws:
      Exception - 처리 중 오류가 발생한 경우
    • assign

      public ActivitySet assign(ActivitySet activitySet, EasyDeskUser assignee, EasyDeskUser assigner, Attribute attribute, Attachment attachment) throws Exception
      Assigns user to item.
      Parameters:
      activitySet - 현재 처리중인 ActivitySet
      assignee - assign 받는 사용자
      assigner - assign 하는 사용자
      attribute - 대상 user Attribute
      attachment - can be null
      Returns:
      ActivitySet
      Throws:
      Exception - 처리 중 오류가 발생한 경우
    • assign

      public ActivitySet assign(ActivitySet activitySet, String description, EasyDeskUser assignee, EasyDeskUser assigner, Attribute attribute, Attachment attachment) throws Exception
      Assigns user to item. Item 의 Status 가 assigned 가 아니면 Status 를 assgined 로 변경한다.
      Parameters:
      activitySet - 현재 처리중인 ActivitySet
      description - activity description can be null
      assignee - assign 받는 사용자
      assigner - assign 하는 사용자
      attribute - 대상 user Attribute
      attachment - can be null
      Returns:
      ActivitySet
      Throws:
      Exception - 처리 중 오류가 발생한 경우
    • deassign

      public ActivitySet deassign(ActivitySet activitySet, EasyDeskUser assignee, EasyDeskUser assigner, AttributeValue attVal, Attachment attachment) throws Exception
      Used to delete a user attribute value.
      Parameters:
      activitySet - 현재 처리중인 ActivitySet
      assignee - assign 이 해제되는 사용자
      assigner - assign 을 해제하는 사용자
      attVal - 삭제할 user AttributeValue
      attachment - can be null
      Returns:
      ActivitySet
      Throws:
      Exception - 처리 중 오류가 발생한 경우
    • getUsersToEmail

      protected Set<EasyDeskUser> getUsersToEmail(String[] action, Item item, Set<EasyDeskUser> users) throws Exception
      Returns the users which should be notified when this item is modified. The set contains those users associated with user attributes for this item, plus the creator of the item. TODO : Attribute 의 Action field 를 사용하지 않고 재 작성 필요.
      Parameters:
      action - TODO : Attribute 의 action field 는 사용하지 않는다.
      item - Usually a reference to this or a dependent item.
      users - The list of users to append to, or null to create a new list.
      Throws:
      Exception
    • getAllUsersToEmail

      public Set<EasyDeskUser> getAllUsersToEmail(String[] action) throws Exception
      Parameters:
      action -
      Returns:
      Throws:
      Exception
    • getAllDependencies

      public List<Depend> getAllDependencies() throws TorqueException
      Returns the combined output from getChildren() and getParents()
      Throws:
      TorqueException
    • getChildren

      public List<Depend> getChildren() throws TorqueException
      Returns list of child dependencies i.e., related to this item through the DEPEND table.
      Throws:
      TorqueException
    • getChildren

      public List<Depend> getChildren(boolean hideDeleted) throws TorqueException
      Returns list of child dependencies i.e., related to this item through the DEPEND table.
      Parameters:
      hideDeleted -
      Throws:
      TorqueException
    • getParents

      public List<Depend> getParents() throws TorqueException
      Returns list of parent dependencies i.e., related to this item through the DEPEND table.
      Throws:
      TorqueException
    • getParents

      public List<Depend> getParents(boolean hideDeleted) throws TorqueException
      Returns list of parent dependencies i.e., related to this item through the DEPEND table.
      Parameters:
      hideDeleted - hide deleted depend or not
      Returns:
      parents depend list
      Throws:
      TorqueException
    • getParents

      public List<Depend> getParents(boolean hideDeleted, Integer... dependTypeIds) throws TorqueException
      Returns list of parent dependencies i.e., related to this item through the DEPEND table.
      Parameters:
      hideDeleted - hide deleted depend or not
      dependTypeIds - array
      Returns:
      parents depend list
      Throws:
      TorqueException
    • save

      public void save(Connection dbConn) throws Exception
      DOCUMENT ME!
      Specified by:
      save in interface Persistent
      Overrides:
      save in class BaseItem
      Parameters:
      dbConn - DOCUMENT ME!
      Throws:
      Exception - DOCUMENT ME!
    • toString

      public String toString()
      Overrides:
      toString in class BaseItem
      Returns:
      String representation for debugging
    • getUniqueId

      public String getUniqueId() throws TorqueException
      Gets the UniqueId for this Item.
      Returns:
      unique id (예: PACS-1)
      Throws:
      TorqueException - 조회 중 오류가 발생한 경우
    • getUniqueId

      public static String getUniqueId(String prefix, String count)
      Gets the UniqueId for this Item.
      Parameters:
      prefix - moduleCode
      count - seq count in module
      Returns:
      prefix-count 형식의 unique id
    • getUniqueId

      public static String getUniqueId(String prefix, int count)
      Gets the UniqueId for this Item.
      Parameters:
      prefix - moduleCode
      count - seq count in module
      Returns:
      prefix-count 형식의 unique id
    • setUniqueId

      public void setUniqueId(String id)
      NoOp for intake's benefit
      Parameters:
      id - 사용하지 않는다.
    • getFederatedId

      public String getFederatedId() throws TorqueException
      DOCUMENT ME!
      Returns:
      DOCUMENT ME!
      Throws:
      TorqueException - DOCUMENT ME!
    • setFederatedId

      public void setFederatedId(String id)
      DOCUMENT ME!
      Parameters:
      id - DOCUMENT ME!
    • getMethodCache

      public MethodResultCache getMethodCache()
      Specified by:
      getMethodCache in interface Cacheable
      Returns:
      MethodResultCache
    • clear

      public void clear()
      Description copied from interface: Cacheable
      clear this Serializable instance cache
      Specified by:
      clear in interface Cacheable