Class AttributeValue

All Implemented Interfaces:
Cacheable, Observed, Retrievable, Serializable, ColumnAccessByName, ObjectModel, Persistent
Direct Known Subclasses:
AbstractMapAttribute, FreeFormAttribute, NonActivityAttribute, NumericProxyAttribute, SkipIndexStringAttribute, ValueProxyAttribute

public abstract class AttributeValue extends BaseAttributeValue implements Observed, Cacheable, Retrievable
DOCUMENT ME!
Version:
$id: AttributeValue.java $Revision$, 03-01-22 8:08:58 PM KST
Author:
Youngho Cho
  • Field Details

    • activitySet

      protected transient ActivitySet activitySet
      이 속성값을 저장하거나 변경할 때의 ActivitySet 이다.
    • chained

      protected transient boolean chained
      DOCUMENT ME!
  • Constructor Details

    • AttributeValue

      protected AttributeValue()
      Creates a new attributeValue. Do not do anything here. All initialization should be performed in init().
  • Method Details

    • getNewInstance

      public static final AttributeValue getNewInstance(Attribute attribute, Item item) throws TorqueException
      Creates, initializes and returns a new AttributeValue.
      Parameters:
      attribute - the Attribute
      item - Item object which this attributeValue is associated
      Returns:
      new AttributeValue instance
      Throws:
      TorqueException - 조회 중 오류가 발생한 경우
    • getNewInstance

      public static AttributeValue getNewInstance(AttributeValue value) throws TorqueException
      getNewInstance for AttributeValue update ( Chained Value 까지 모두 참조한다. )
      Parameters:
      value - 복사할 원본 AttributeValue
      Returns:
      새 AttributeValue
      Throws:
      TorqueException - 조회 중 오류가 발생한 경우
    • copy

      public AttributeValue copy(boolean deepcopy) throws TorqueException
      Makes a copy of this object. It creates a new object filling in the simple attributes. If the parameter deepcopy is true, it then fills all the association collections and sets the related objects to isNew=true.
      Overrides:
      copy in class BaseAttributeValue
      Parameters:
      deepcopy - whether to copy the associated objects.
      Throws:
      TorqueException - if retrieval of the associated objects fails
    • copy

      public AttributeValue copy(boolean deepcopy, Connection con) throws TorqueException
      Makes a copy of this object using connection. It creates a new object filling in the simple attributes. If the parameter deepcopy is true, it then fills all the association collections and sets the related objects to isNew=true.
      Overrides:
      copy in class BaseAttributeValue
      Parameters:
      deepcopy - whether to copy the associated objects.
      con - the database connection to read associated objects.
      Throws:
      TorqueException - if retrieval of the associated objects fails
    • loadResources

      public Object loadResources(ActivitySet activitySet) throws Exception
      Loads from database data specific for this Attribute including Name. These are data common to all Attribute instances with same id. Data retrieved here will then be used in setResources.
      Parameters:
      activitySet - specific activitySet
      Returns:
      Object containing Attribute resources which will be used in setResources.
      Throws:
      Exception - 처리 중 오류가 발생한 경우
    • setResources

      public void setResources(Object resources)
      This method is used by an Attribute instance to obtain specific resources such as option list for SelectOneAttribute. It may, for example put them into instance variables. Attributes may use common resources as-is or create it's own resources based on common, it should not, however, modify common resources since they will be used by other Attribute instances.
      Parameters:
      resources - Resources common for Attributes with the specified id.
    • init

      public void init() throws Exception
      Override this method if you need any initialization for this attr.
      Throws:
      Exception - Generic Exception
    • getUser

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

      public void setUser(EasyDeskUser user) throws TorqueException
      DOCUMENT ME!
      Parameters:
      user - 이 속성값과 관련된 사용자
      Throws:
      TorqueException - 조회 중 오류가 발생한 경우
    • getAttachment

      public Attachment getAttachment()
      Gets the Activity Attachment record associated with this AttributeValue It can only be retrieved after the save() method has been called since that is when it is generated.
      Returns:
      Activity Attachment
    • setAttachment

      public void setAttachment(Attachment attachment)
      DOCUMENT ME!
      Parameters:
      attachment - DOCUMENT ME!
    • setActivityDescription

      public void setActivityDescription(String string)
      Allows you to override the description for the activity that is generated when this attributevalue is saved.
      Parameters:
      string - activity 설명
    • getActivityDescription

      public String getActivityDescription() throws TorqueException
      extra info to save description in activity record
      Returns:
      activity 설명
      Throws:
      TorqueException - 조회 중 오류가 발생한 경우
    • getActivity

      public Activity getActivity()
      Gets the Activity record associated with this AttributeValue It can only be retrieved after the save() method has been called since that is when it is generated.
      Returns:
      저장 시 생성된 Activity
    • setActivity

      public void setActivity(Activity activity)
      DOCUMENT ME!
      Parameters:
      activity - DOCUMENT ME!
    • getTransactionId

      public Long getTransactionId()
      DOCUMENT ME!
      Returns:
      DOCUMENT ME!
    • setTransactionId

      public void setTransactionId(Long transactionId)
      DOCUMENT ME!
      Parameters:
      transactionId - DOCUMENT ME!
    • getOptionIdAsString

      public String getOptionIdAsString()
      Get the OptionId
      Returns:
      String
    • getOptionIdsAsString

      public String getOptionIdsAsString() throws TorqueException
      Get the current OptionIds as String
      Returns:
      String
      Throws:
      TorqueException - 조회 중 오류가 발생한 경우
    • getOptionIdsAsString

      public String getOptionIdsAsString(boolean includeDeleted) throws TorqueException
      option id 들을 문자열로 구한다.
      Parameters:
      includeDeleted - 삭제된 값을 포함할지 여부
      Returns:
      option id 문자열
      Throws:
      TorqueException - 조회 중 오류가 발생한 경우
    • getOptionIds

      public Integer[] getOptionIds() throws TorqueException
      Returns current Options Ids
      Returns:
      a Integer[] value
      Throws:
      TorqueException - if an error occurs
    • getOptionIds

      public Integer[] getOptionIds(boolean includeDeleted) throws TorqueException
      Returns current Options Ids
      Parameters:
      includeDeleted - 삭제된 값을 포함할지 여부
      Returns:
      a Integer[] value
      Throws:
      TorqueException - if an error occurs
    • setOptionId

      public void setOptionId(Integer optionId)
      Makes sure to set the Value as well, to make display of the option easier
      Overrides:
      setOptionId in class BaseAttributeValue
      Parameters:
      optionId - a Integer value
    • setOptionIdOnly

      protected void setOptionIdOnly(Integer optionId)
      option id 만 설정한다. 값이 바뀌면 변경 상태로 표시한다.
      Parameters:
      optionId - 설정할 option id
    • setOptionIds

      public void setOptionIds(Integer[] ids) throws TorqueException
      여러 option id 를 설정한다. MultifulStateAttribute 만 동작한다.
      Parameters:
      ids - 설정할 option id 배열
      Throws:
      TorqueException - 조회 중 오류가 발생한 경우
    • getOptionValues

      public String[] getOptionValues() throws TorqueException
      OptionId 에 설정된 값을 Option Name 값으로 구한다.
      Returns:
      Option Name array
      Throws:
      TorqueException
    • setOptionValues

      public void setOptionValues(String[] values) throws TorqueException
      option 이름들로 option id 를 찾아 설정한다.
      Parameters:
      values - option 이름 배열
      Throws:
      TorqueException - 조회 중 오류가 발생한 경우
    • getUserIds

      public Long[] getUserIds() throws TorqueException
      현재 설정된 user id 들을 구한다.
      Returns:
      a Long[] value
      Throws:
      TorqueException - if an error occurs
    • setUserId

      public void setUserId(Long userId)
      Makes sure to set the Value as well, to make display of the user easier
      Overrides:
      setUserId in class BaseAttributeValue
      Parameters:
      userId - a Integer value
    • setUserIdOnly

      protected void setUserIdOnly(Long userId)
      Makes sure to set the Value as well, to make display of the user easier
      Parameters:
      userId - a Integer value
    • setUserIds

      public void setUserIds(Long[] ids) throws TorqueException
      DOCUMENT ME!
      Parameters:
      ids - DOCUMENT ME!
      Throws:
      TorqueException - DOCUMENT ME!
    • getValues

      public String[] getValues() throws TorqueException
      삭제는 보이지 않는다.
      Returns:
      ChainedValue String Array
      Throws:
      TorqueException - 조회 중 오류가 발생한 경우
    • getValues

      public String[] getValues(boolean includeDeleted) throws TorqueException
      chain 된 모든 값을 구한다.
      Parameters:
      includeDeleted - 삭제된 값을 포함할지 여부
      Returns:
      all ChainedValue String Array 순서는 valueId 의 asc ordering 이다.
      Throws:
      TorqueException - 조회 중 오류가 발생한 경우
    • getValuesAsString

      public String getValuesAsString() throws TorqueException
      Deleted 를 포함하여 지금 object 부터의 value array 를 구한다. 잘못되었다. getValuesAsString(false, false) 가 되어야 한다.
      Returns:
      값들을 연결한 문자열
      Throws:
      TorqueException - 조회 중 오류가 발생한 경우
    • getValuesAsString

      public String getValuesAsString(boolean includeDeleted) throws TorqueException
      정렬은 valueId 로 되어 있다.
      Parameters:
      includeDeleted - 삭제된 값을 포함할지 여부
      Returns:
      값들을 연결한 문자열
      Throws:
      TorqueException - 조회 중 오류가 발생한 경우
    • setValues

      public void setValues(String[] values) throws TorqueException
      MultiValued 를 위한 setter 이다. MultiValued 는 한번 value 값이 db 에 입력되면 value 값은 변경이 안되고 단지 deleted or not 으로 처리된다.
      Parameters:
      values - can not be null
      Throws:
      TorqueException - 조회 중 오류가 발생한 경우
    • save

      public void save(Connection dbcon) throws Exception
      DOCUMENT ME!
      Specified by:
      save in interface Persistent
      Overrides:
      save in class BaseAttributeValue
      Parameters:
      dbcon - DOCUMENT ME!
      Throws:
      Exception - DOCUMENT ME!
    • getQueryKey

      public String getQueryKey()
      OID for AttributeValue
      Specified by:
      getQueryKey in interface Retrievable
      Returns:
      DOCUMENT ME!
    • needActivity

      public boolean needActivity(ActivitySet activitySet) throws TorqueException
      저장할 때 변경이 있어도 activity 를 필요로 하지 않는지
      Parameters:
      activitySet - 현재 처리중인 ActivitySet
      Returns:
      activity 가 필요하면 true (기본값 true)
      Throws:
      TorqueException - 조회 중 오류가 발생한 경우
    • alwaysNeedActivity

      public boolean alwaysNeedActivity(ActivitySet activitySet)
      저장할 때 변경이 없어도 기록을 위하여 activity 를 항상 필요로 하는지
      Parameters:
      activitySet - 현재 처리중인 ActivitySet
      Returns:
      항상 activity 가 필요하면 true (기본값 false)
    • setPrimitiveOptionIds

      public void setPrimitiveOptionIds(int[] ints) throws TorqueException
      DOCUMENT ME!
      Parameters:
      ints - DOCUMENT ME!
      Throws:
      TorqueException - DOCUMENT ME!
    • getPrimitiveOptionIds

      public int[] getPrimitiveOptionIds() throws TorqueException
      DOCUMENT ME!
      Returns:
      DOCUMENT ME!
      Throws:
      TorqueException - DOCUMENT ME!
    • setPrimitiveUserIds

      public void setPrimitiveUserIds(long[] ints) throws TorqueException
      DOCUMENT ME!
      Parameters:
      ints - DOCUMENT ME!
      Throws:
      TorqueException - DOCUMENT ME!
    • getPrimitiveUserIds

      public long[] getPrimitiveUserIds() throws TorqueException
      DOCUMENT ME!
      Returns:
      DOCUMENT ME!
      Throws:
      TorqueException - DOCUMENT ME!
    • getInputValue

      public String getInputValue()
      DOCUMENT ME!
      Returns:
      DOCUMENT ME!
    • setInputValue

      public void setInputValue(String value)
      DOCUMENT ME!
      Parameters:
      value - DOCUMENT ME!
    • setValue

      public void setValue(String value)
      Value 값이 Condition 값의 비교에 사용되기 때문에 Option Name 은 항상 database 에 저장된 Option Name 으로 Value 값이 설정되어야 한다.
      Overrides:
      setValue in class BaseAttributeValue
      Parameters:
      value - 설정할 값
    • setValueOnly

      protected void setValueOnly(String value)
      DOCUMENT ME!
      Parameters:
      value - DOCUMENT ME!
    • getNumericValues

      public Long[] getNumericValues() throws TorqueException
      DOCUMENT ME!
      Returns:
      DOCUMENT ME!
      Throws:
      TorqueException - DOCUMENT ME!
    • getNumericValues

      public Long[] getNumericValues(boolean includeDeleted) throws TorqueException
      DOCUMENT ME!
      Parameters:
      includeDeleted - DOCUMENT ME!
      Returns:
      DOCUMENT ME!
      Throws:
      TorqueException - DOCUMENT ME!
    • getNumericValuesAsString

      public String getNumericValuesAsString() throws TorqueException
      Get the current NumericValues as String 삭제되어 있는것이 포함되어 있다.
      Returns:
      String
      Throws:
      TorqueException - 조회 중 오류가 발생한 경우
    • getNumericValuesAsString

      public String getNumericValuesAsString(boolean includeDeleted) throws TorqueException
      숫자 값들을 문자열로 구한다.
      Parameters:
      includeDeleted - 삭제된 값을 포함할지 여부
      Returns:
      숫자 값들을 연결한 문자열
      Throws:
      TorqueException - 조회 중 오류가 발생한 경우
    • setNumericValue

      public void setNumericValue(Long v)
      Makes sure to set the Value as well
      Overrides:
      setNumericValue in class BaseAttributeValue
      Parameters:
      v - 설정할 값, null 이거나 음수이면 무시한다.
    • setNumericValueOnly

      protected void setNumericValueOnly(Long v)
      DOCUMENT ME!
      Parameters:
      v - DOCUMENT ME!
    • setNumericValues

      public void setNumericValues(Long[] numerics) throws TorqueException
      DOCUMENT ME!
      Parameters:
      numerics - DOCUMENT ME!
      Throws:
      TorqueException - DOCUMENT ME!
    • getChainedValue

      public AttributeValue getChainedValue(Depend depend) throws TorqueException
      Get the value of current chainedValue with same depend.
      Parameters:
      depend - 대상 Depend
      Returns:
      new value of chainedValue.
      Throws:
      TorqueException - 조회 중 오류가 발생한 경우
    • getChainedValue

      public AttributeValue getChainedValue(AttributeOption option)
      Get the value of current chainedValue.
      Parameters:
      option - 대상 AttributeOption
      Returns:
      value of chainedValue.
    • getChainedValue

      public AttributeValue getChainedValue()
      Get the value of current chainedValue.
      Returns:
      value of chainedValue.
    • setChainedValue

      public void setChainedValue(AttributeValue v)
      Set the value of chainedValue.
      Parameters:
      v - Value to assign to chainedValue.
    • getValueList

      public List<AttributeValue> getValueList() throws TorqueException
      This method returns a flat List of all AttributeValues that might be chained to this one. This AttributeValue will be first in the List.
      Returns:
      a List of AttributeValue's including deleted one
      Throws:
      TorqueException - 조회 중 오류가 발생한 경우
    • getValueList

      public List<AttributeValue> getValueList(boolean db) throws TorqueException
      This method returns a flat List of all AttributeValues that might be chained to this one. This AttributeValue will be first in the List.
      Parameters:
      db - if true get from database
      Returns:
      a List of AttributeValue's including deleted one
      Throws:
      TorqueException - 조회 중 오류가 발생한 경우
    • startActivitySet

      public void startActivitySet(ActivitySet activitySet)
      Enters this attribute value into a activitySet. All changes to a value must occur within a activitySet. The activitySet is cleared once the attribute value is saved.
      Parameters:
      activitySet - a ActivitySet value
    • endActivitySet

      protected void endActivitySet()
      DOCUMENT ME!
    • setProperties

      public void setProperties(AttributeValue attVal1) throws TorqueException
      DOCUMENT ME!
      Parameters:
      attVal1 - DOCUMENT ME!
      Throws:
      TorqueException - DOCUMENT ME!
    • hasAlreadyChained

      protected boolean hasAlreadyChained(AttributeValue value)
      동일한 속성값이 이미 Chained 되어 있는지 value 를 비교한다.
      Parameters:
      value - 비교할 AttributeValue
      Returns:
      true if already chain same value object ( see valueEquals method )
    • isSet

      public boolean isSet()
      값이 설정 되어 있는지 Chained 되어 있는 것 까지 판단한다.
      Returns:
      true/false including chained value
    • isSetOnly

      public boolean isSetOnly()
      값이 설정 되어 있는지 이 object 하나만 판단한다.
      Returns:
      true/false only for this object
    • hasValue

      public abstract boolean hasValue(Object checkValue) throws Exception
      DOCUMENT ME!
      Parameters:
      checkValue - DOCUMENT ME!
      Returns:
      DOCUMENT ME!
      Throws:
      Exception - DOCUMENT ME!
    • isModified

      public boolean isModified(AttributeValue value) throws TorqueException
      값이 동일한지 아니면 변경되었는지 비교한다.
      Parameters:
      value - 비교할 AttributeValue
      Returns:
      true/false return true when the value is not modified
      Throws:
      TorqueException - 조회 중 오류가 발생한 경우
    • getModuleAttribute

      public ModuleAttribute getModuleAttribute() throws TorqueException
      attributeValue 의 item, itemType, module 정보가 존재하여야 한다. 그러나 다중검색에서 module 또는 itemType 이 다중인 경우 처리가 아직 안된다
      Returns:
      ModuleAttribute or null
      Throws:
      TorqueException - 조회 중 오류가 발생한 경우
    • isQuickSearchAttribute

      public boolean isQuickSearchAttribute() throws TorqueException
      Deprecated.
      please use ModuleUserAttribute.getQuickSearch instead
      if the Attribute related to this value is marked as relevant to quick search in the module related to the Item related to this value.
      Returns:
      a boolean value
      Throws:
      TorqueException
    • getPossibleTransitionCount

      public AttributeValue.AccessEnum getPossibleTransitionCount(EasyDeskUser actor) throws Exception
      check user can change a state of this value access, edit 를 정의한다.
      Parameters:
      actor - 작업하는 사용자
      Returns:
      0 can not access, 1 accessable only, 2 editable
      Throws:
      Exception - 확인 중 오류가 발생한 경우
    • getPossibleTransitionCount

      public AttributeValue.AccessEnum getPossibleTransitionCount(String fromValue, EasyDeskUser actor) throws Exception
      check user can change a state of this value access, edit 를 정의한다. TODO : 별도 class 로 분리한다.
      Parameters:
      fromValue - 현재 값
      actor - 작업하는 사용자
      Returns:
      0 can not access, 1 accessable only, 2 editable
      Throws:
      Exception - 확인 중 오류가 발생한 경우
    • getLocalizedValue

      public CharSequence getLocalizedValue(String type) throws Exception
      text type attribute 의 경우에 value 와 실제 보여주는 value 가 다를 때 사용한다. fomatter 가 정의되어 있으면 formatter 를 적용하여 처리한다.

      pipeline type 은 DisplayedValue 가 각 동작조건에 따라서 다양하게 존재할 수 있기 때문에, 그것들을 구분하기 위하여 도입하였다. Default 는 "" 이다.

      적용되어 있는 것은 default 와 stripped 가 구현되어 있다.

      Parameters:
      type - pipeline type
      Returns:
      DOCUMENT ME!
      Throws:
      Exception - Generic Exception
    • getLocalizedValue

      public CharSequence getLocalizedValue(String type, Locale locale) throws Exception
      value 와 실제 보여주는 value 가 다를 때 사용한다. fomatter 가 정의되어 있으면 formatter 를 적용하여 처리한다.
      Parameters:
      type - pipeline type
      locale - 표시에 사용할 locale
      Returns:
      화면에 표시할 값
      Throws:
      Exception - Generic Exception
    • getLocalizedValue

      public CharSequence getLocalizedValue() throws Exception
      DOCUMENT ME!
      Returns:
      DOCUMENT ME!
      Throws:
      Exception - DOCUMENT ME!
    • getLocalizedValue

      public CharSequence getLocalizedValue(Locale locale) throws Exception
      DOCUMENT ME!
      Parameters:
      locale - DOCUMENT ME!
      Returns:
      DOCUMENT ME!
      Throws:
      Exception - DOCUMENT ME!
    • getLocalizedValues

      public CharSequence[] getLocalizedValues() throws Exception
      DOCUMENT ME!
      Returns:
      DOCUMENT ME!
      Throws:
      Exception - DOCUMENT ME!
    • getLocalizedValues

      public CharSequence[] getLocalizedValues(Locale locale) throws Exception
      DOCUMENT ME!
      Parameters:
      locale - DOCUMENT ME!
      Returns:
      DOCUMENT ME!
      Throws:
      Exception - DOCUMENT ME!
    • toString

      public String toString()
      DOCUMENT ME!
      Overrides:
      toString in class BaseAttributeValue
      Returns:
      DOCUMENT ME!
    • register

      public void register()
      Value 가 변할 때 행동을 등록한다.
      Specified by:
      register in interface Observed
    • getObserverOption

      public List<AttributeOption> getObserverOption(OptionRelationship relationShip) throws TorqueException
      관계(relationShip) 에 따라 이 값과 관련된 observer option 들을 구한다.
      Parameters:
      relationShip - 대상 OptionRelationship
      Returns:
      attributeOption list
      Throws:
      TorqueException - 조회 중 오류가 발생한 경우
    • performBefore

      public void performBefore() throws Exception
      Observer 를 실행
      Specified by:
      performBefore in interface Observed
      Throws:
      Exception - Observer 실행 중 오류가 발생한 경우
    • performAfter

      public void performAfter() throws Exception
      Value 가 변할 때 행동을 실행한다.
      Specified by:
      performAfter in interface Observed
      Throws:
      Exception - Observer 실행 중 오류가 발생한 경우
    • getRepository

      public File getRepository() throws TorqueException, IOException
      이 object 의 file repository 경로를 구한다. 현재는 구현되어 있지 않다.
      Returns:
      file repository path file of this object
      Throws:
      TorqueException - 조회 중 오류가 발생한 경우
      IOException - 입출력 중 오류가 발생한 경우
      UnsupportedOperationException - 항상 발생 (미구현)
    • getResource

      public File getResource(String name) throws TorqueException, IOException
      이름에 해당하는 resource 파일을 구한다. 현재는 구현되어 있지 않다.
      Parameters:
      name - resource 이름
      Returns:
      file
      Throws:
      TorqueException - 조회 중 오류가 발생한 경우
      IOException - 입출력 중 오류가 발생한 경우
      UnsupportedOperationException - 항상 발생 (미구현)
    • getRelativePath

      public String getRelativePath(String name) throws TorqueException, IOException
      이름에 해당하는 파일의 상대 경로를 구한다. 현재는 구현되어 있지 않다.
      Parameters:
      name - 파일 이름
      Returns:
      file
      Throws:
      TorqueException - 조회 중 오류가 발생한 경우
      IOException - 입출력 중 오류가 발생한 경우
      UnsupportedOperationException - 항상 발생 (미구현)
    • getRelativePath

      public String getRelativePath(String name, String variant) throws TorqueException, IOException
      이름과 variant 에 해당하는 파일의 상대 경로를 구한다. 현재는 구현되어 있지 않다.
      Parameters:
      name - 파일 이름
      variant - 파일 variant
      Returns:
      file
      Throws:
      TorqueException - 조회 중 오류가 발생한 경우
      IOException - 입출력 중 오류가 발생한 경우
      UnsupportedOperationException - 항상 발생 (미구현)
    • 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