Class Attribute

All Implemented Interfaces:
Cacheable, Artifactizable, Optionable<Attribute>, Identifiable<Integer>, Serializable, ColumnAccessByName, ObjectModel, Persistent

public class Attribute extends BaseAttribute implements Artifactizable, Optionable<Attribute>, Identifiable<Integer>, Cacheable
속성(Attribute) OM. 속성의 option, transition, condition, module/itemType mapping 을 관리한다.
Version:
$id: Attribute.java $Revision$, 03-02-22 11:30:05 AM KST
Author:
Youngho Cho
  • Constructor Details

    • Attribute

      public Attribute()
      새로운 Attribute 인스턴스를 생성한다.
  • Method Details

    • getId

      public Integer getId()
      Attribute id 를 구한다.
      Specified by:
      getId in interface Identifiable<Integer>
      Returns:
      attribute id
    • setId

      public void setId(Integer id)
      Identifiable implementation
      Specified by:
      setId in interface Identifiable<Integer>
      Parameters:
      id - The new Id of the entity
    • getParent

      public Attribute getParent()
      부모 Attribute 를 구한다.
      Specified by:
      getParent in interface Optionable<Attribute>
      Returns:
      parent attribute
    • setParent

      public void setParent(Attribute optionable)
      DOCUMENT ME!
      Specified by:
      setParent in interface Optionable<Attribute>
      Parameters:
      optionable - DOCUMENT ME!
    • getChildren

      public List<Attribute> getChildren()
    • getAttribute

      public Attribute getAttribute() throws TorqueException
      Optionable implements Optionable 을 형성하는 Attribute
      Specified by:
      getAttribute in interface Optionable<Attribute>
      Returns:
      attribute
      Throws:
      TorqueException - 조회 중 오류가 발생한 경우
    • getAttributeOption

      public AttributeOption getAttributeOption() throws TorqueException
      Optionable implements
      Specified by:
      getAttributeOption in interface Optionable<Attribute>
      Returns:
      attributeOption
      Throws:
      TorqueException - 조회 중 오류가 발생한 경우
    • getAttributeOption

      public AttributeOption getAttributeOption(Integer id) throws TorqueException
      Gets one of the options belonging to this attribute. if the PrimaryKey does not belong to an option in this attribute null is returned. 주어진 OptionId 의 Option 이 이 Attribute 에 속하는지를 검증하는 용도로도 사용된다. ( has(id...) 필요????)
      Parameters:
      id - a Integer value
      Returns:
      an AttributeOption value
      Throws:
      TorqueException - 조회 중 오류가 발생한 경우
    • getAttributeOptionByName

      public AttributeOption getAttributeOptionByName(String pathName) throws TorqueException
      Get an option in this attribute by String pathName. OptionAttribute 가 아니면 null 을 return ( 삭제된 AttributeOption 은 제외된댜.)
      Parameters:
      pathName - option 의 경로 이름
      Returns:
      attributeOption or null
      Throws:
      TorqueException - 조회 중 오류가 발생한 경우
    • getOrderedOptionOptionList

      protected List<OptionOption> getOrderedOptionOptionList(OptionRelationship optionRelationship) throws TorqueException
      Creates an ordered List of OptionOption which are children within this Attribute. The list is ordered according to the preferred order.
      Parameters:
      optionRelationship - 대상 OptionRelationship
      Returns:
      a List of OptionOption's
      Throws:
      TorqueException - 조회 중 오류가 발생한 경우
    • getTopAttributeOptions

      public List<AttributeOption> getTopAttributeOptions() throws TorqueException
      맨 상위 Option 들을 구한다.
      Returns:
      top AttributeOption list
      Throws:
      TorqueException - DOCUMENT ME!
    • getTopAttributeOptions

      protected List<AttributeOption> getTopAttributeOptions(boolean includeDeleted) throws TorqueException
      DOCUMENT ME!
      Parameters:
      includeDeleted - DOCUMENT ME!
      Returns:
      DOCUMENT ME!
      Throws:
      TorqueException - DOCUMENT ME!
    • getAttributeOptions

      protected List<AttributeOption> getAttributeOptions(OptionRelationship optionRelationship, AttributeOption parent, boolean includeDeleted) throws TorqueException
      DOCUMENT ME!
      Parameters:
      optionRelationship - DOCUMENT ME!
      parent - DOCUMENT ME!
      includeDeleted - DOCUMENT ME!
      Returns:
      DOCUMENT ME!
      Throws:
      TorqueException - DOCUMENT ME!
    • getAttributeOptions

      protected List<AttributeOption> getAttributeOptions(OptionRelationship optionRelationship, AttributeOption parent) throws TorqueException
      DOCUMENT ME!
      Parameters:
      optionRelationship - DOCUMENT ME!
      parent - DOCUMENT ME!
      Returns:
      DOCUMENT ME!
      Throws:
      TorqueException - DOCUMENT ME!
    • getAttributeOptions

      public List<AttributeOption> getAttributeOptions(boolean includeDeleted) throws TorqueException
      Get a list of all attribute options or just the ones that have not been marked as deleted.
      Parameters:
      includeDeleted - 삭제된 option 을 포함할지 여부
      Returns:
      AttributeOption 목록
      Throws:
      TorqueException - 조회 중 오류가 발생한 경우
    • getAttributeOptions

      public List<AttributeOption> getAttributeOptions(boolean includeDeleted, boolean firstChildOnly) throws TorqueException
      Get a list of all attribute options or just the ones that have not been marked as deleted.
      Parameters:
      includeDeleted - 삭제된 option 을 포함할지 여부
      firstChildOnly - 최상위 option 의 바로 아래 자식만 구할지 여부
      Returns:
      AttributeOption 목록
      Throws:
      TorqueException - 조회 중 오류가 발생한 경우
    • getAssociatedItemTypes

      public List<ItemType> getAssociatedItemTypes() throws TorqueException
      Refers to Global Item Types
      Returns:
      A list of global Item Types, this attribute is associated with including deleted one
      Throws:
      TorqueException
    • getAttributeOptionsAsName

      public List<String> getAttributeOptionsAsName() throws TorqueException
      삭제된 것을 포함한 모든 자손들의 OptionName List 를 구한다.
      Returns:
      list of option name
      Throws:
      TorqueException - 조회 중 오류가 발생한 경우
    • getTransition

      public Transition getTransition(String from, String to) throws TorqueException
      find transition which is set up in this attribute
      Parameters:
      from - from 값
      to - to 값
      Returns:
      transition which is matched from and to exactly.
      Throws:
      TorqueException - 조회 중 오류가 발생한 경우
    • getTransitionsExceptDefaultTranstion

      public List<Transition> getTransitionsExceptDefaultTranstion() throws TorqueException
      기본 transition(ANY --> option) 을 제외한 transition 목록을 구한다.
      Returns:
      기본 transition 을 제외한 Transition 목록
      Throws:
      TorqueException - 조회 중 오류가 발생한 경우
    • getTransitions

      public List<Transition> getTransitions() throws TorqueException
      이 Attribute 에 정의된 모든 Transition List 을 구한다.
      Overrides:
      getTransitions in class BaseAttribute
      Returns:
      transition list
      Throws:
      TorqueException - 조회 중 오류가 발생한 경우
    • findMatchingTransition

      public Transition findMatchingTransition(String fromValue, String toValue) throws TorqueException, IllegalArgumentException
      From --> To 가 일치하는 것을 찾는다. 정확히 일치하는 것이 없으면 ANY 를 처리한다. 동일한 경우 null Transition 에 Any To Any 가 정의되어 있고 Condition 이 Blocking 되어 있으면 정의된 Transition 에 한하여만 전이가 가능하다. 하지만 Any To Any 가 정의되어 있지 않거나 Condition 이 Blocking 되어 있지 않으면 정의되지 않은 모든 Transition 도 전이가 가능하다.
      Parameters:
      fromValue - from 값
      toValue - to 값
      Returns:
      transition which satisfied from and to including ANY if not satified than fresh instance will return, if from and to is same then null return
      Throws:
      TorqueException - 조회 중 오류가 발생한 경우
      IllegalArgumentException - optional attribute and from to state is not it's option then throws
    • getConditions

      public List<Condition> getConditions() throws TorqueException
      get all condition which is applied in this attribute as global
      Returns:
      conditions list
      Throws:
      TorqueException - 조회 중 오류가 발생한 경우
    • getConditions

      public List<Condition> getConditions(Attribute rAttribute) throws TorqueException
      get all active condition which is applied in this attribute for given attribute
      Parameters:
      rAttribute - 조건의 기준 attribute
      Returns:
      Condition 목록
      Throws:
      TorqueException - 조회 중 오류가 발생한 경우
    • getConditions

      public List<Condition> getConditions(Attribute rAttribute, boolean includeDeleted) throws TorqueException
      get all condition which is applied in this attribute for given attribute
      Parameters:
      rAttribute - 조건의 기준 attribute
      includeDeleted - 삭제된 Condition 을 포함할지 여부
      Returns:
      Condition 목록
      Throws:
      TorqueException - 조회 중 오류가 발생한 경우
    • getConditions

      public List<Condition> getConditions(Attribute rAttribute, Transition transition, boolean includeDeleted) throws TorqueException
      get all condition which is applied in this attribute for given attribute
      Parameters:
      rAttribute - 조건의 기준 attribute
      transition - 대상 transition
      includeDeleted - 삭제된 Condition 을 포함할지 여부
      Returns:
      Condition 목록
      Throws:
      TorqueException - 조회 중 오류가 발생한 경우
    • getConditions

      public List<Condition> getConditions(Attribute rAttribute, Transition transition, ItemType type, boolean includeDeleted) throws TorqueException
      get all condition which is applied in this attribute for given attribute
      Parameters:
      rAttribute - 조건의 기준 attribute
      transition - 대상 transition
      type - 대상 ItemType
      includeDeleted - 삭제된 Condition 을 포함할지 여부
      Returns:
      Condition 목록
      Throws:
      TorqueException - 조회 중 오류가 발생한 경우
    • getOptionable

      public Optionable<?> getOptionable(AttributeOption option) throws TorqueException
      find native om which is corresponding with option
      Parameters:
      option - DOCUMENT ME!
      Returns:
      Optionable OM Object
      Throws:
      TorqueException - DOCUMENT ME!
    • getParentChildAttributeOptions

      public List<ParentChildAttributeOption> getParentChildAttributeOptions() throws TorqueException
      This returns a list of ParentChildAttributeOption objects which have been populated with combined join data from OptionOption and the AttributeOption table.
      Returns:
      a List of ParentChildAttributeOption objects
      Throws:
      TorqueException - 조회 중 오류가 발생한 경우
    • getParentChildAttributeOptions

      public List<ParentChildAttributeOption> getParentChildAttributeOptions(OptionRelationship optionRelationship) throws TorqueException
      This returns a list of ParentChildAttributeOption objects which have been populated with combined join data from OptionOption and the AttributeOption table.
      Parameters:
      optionRelationship - 대상 OptionRelationship
      Returns:
      a List of ParentChildAttributeOption objects
      Throws:
      TorqueException - 조회 중 오류가 발생한 경우
    • getOrderedAttributeOptionList

      public List<AttributeOption> getOrderedAttributeOptionList(OptionRelationship optionRelationship) throws TorqueException
      Creates an ordered List of AttributeOptions which are children within this Attribute. The list is ordered according to the preferred order.
      Parameters:
      optionRelationship - 대상 OptionRelationship
      Returns:
      a List of AttributeOption's
      Throws:
      TorqueException - 조회 중 오류가 발생한 경우
    • save

      public void save() throws Exception
      Stores the object in the database. If the object is new, it inserts it; otherwise an update is performed.
      Specified by:
      save in interface Persistent
      Overrides:
      save in class BaseAttribute
      Throws:
      Exception - 저장 중 오류가 발생한 경우
    • hasModuleMappings

      public boolean hasModuleMappings() throws Exception
      이 attribute 가 module 에 mapping 되어 있는지 확인한다.
      Returns:
      Whether this attribute is mapped to any modules.
      Throws:
      Exception - 조회 중 오류가 발생한 경우
    • hasMapping

      public boolean hasMapping(Module module, ItemType itemType) throws Exception
      이 attribute 가 module 과 itemType 에 mapping 되어 있는지 확인한다.
      Parameters:
      module - null to ignore this criterion.
      itemType - null to ignore this criterion.
      Returns:
      Whether this attribute is already mapped to the specified Module and ItemType.
      Throws:
      Exception - 조회 중 오류가 발생한 경우
    • hasGlobalItemTypeMappings

      public boolean hasGlobalItemTypeMappings() throws Exception
      Refers to global issue types.
      Returns:
      Whether this attribute is mapped to any issue types.
      Throws:
      Exception - 처리 중 오류가 발생한 경우
      See Also:
    • hasGlobalMapping

      public boolean hasGlobalMapping(ItemType itemType) throws Exception
      Refers to global issue types.
      Parameters:
      itemType - A specific ItemType to find associated attributes for, or null to ignore this criterion.
      Returns:
      Whether there are any mappings for this attribute.
      Throws:
      Exception - 처리 중 오류가 발생한 경우
    • deleteModuleMappings

      public void deleteModuleMappings(Module module, EasyDeskUser user) throws Exception
      Delete mappings with module ( All Module : all modules, others each module ) and all item types.
      Parameters:
      module - All 이면 모든 module 에서 제거된다.
      user - actor
      Throws:
      Exception - 삭제 중 오류가 발생한 경우
    • deleteItemTypeMappings

      public void deleteItemTypeMappings(EasyDeskUser user) throws Exception
      Delete mappings with global item types.
      Parameters:
      user - actor
      Throws:
      Exception - 삭제 중 오류가 발생한 경우
    • getPermission

      public Permission getPermission()
      이 Attribute 와 관련된 권한을 구한다.
      Returns:
      DOCUMENT ME!
      Throws:
      TorqueException - DOCUMENT ME!
    • getArtifactType

      public ItemType getArtifactType() throws TorqueException
      fixed
      Specified by:
      getArtifactType in interface Artifactizable
      Returns:
      itemType
      Throws:
      TorqueException - 조회 중 오류가 발생한 경우
    • getValueFormatter

      public ValueFormatter getValueFormatter() throws TorqueException
      global attribute 의 ValueFormatter 를 구한다.
      Returns:
      ValueFormatter for global attribute
      Throws:
      TorqueException - 조회 중 오류가 발생한 경우
    • getValidator

      public EasyDeskValidator getValidator() throws TorqueException
      global attribute 의 validator 를 구한다. (ALL module, ALL itemType 에 대한 attribute 의 validator 이다.) TODO : DB 설정 Check
      Returns:
      Validator for global attribute if not defined always true validator
      Throws:
      TorqueException - 조회 중 오류가 발생한 경우
    • 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
    • toString

      public String toString()
      reformatting version
      Overrides:
      toString in class BaseAttribute