Class ItemSearchImpl

java.lang.Object
com.easydesk.om.BaseItem
com.easydesk.om.Item
com.easydesk.util.word.ItemSearchImpl
All Implemented Interfaces:
Cacheable, Identifiable<Long>, SearchConstants, ItemSearch, Serializable, ColumnAccessByName, ObjectModel, Persistent

public class ItemSearchImpl extends Item implements ItemSearch, SearchConstants
Multiple ModuleItemType 을 지원한다. TODO use torque fully
See Also:
  • Field Details

  • Constructor Details

  • Method Details

    • getLimit

      public int getLimit()
      DOCUMENT ME!
      Returns:
      DOCUMENT ME!
    • setLimit

      public void setLimit(int limit)
      DOCUMENT ME!
      Parameters:
      limit - DOCUMENT ME!
    • getResultsPerPage

      public int getResultsPerPage()
      DOCUMENT ME!
      Returns:
      DOCUMENT ME!
    • setResultsPerPage

      public void setResultsPerPage(int resultsPerPage)
      DOCUMENT ME!
      Parameters:
      resultsPerPage - DOCUMENT ME!
    • getOffset

      public int getOffset()
      DOCUMENT ME!
      Returns:
      DOCUMENT ME!
    • setOffset

      public void setOffset(int offset)
      DOCUMENT ME!
      Parameters:
      offset - DOCUMENT ME!
    • getLocale

      public Locale getLocale()
      DOCUMENT ME!
      Overrides:
      getLocale in class Item
      Returns:
      DOCUMENT ME!
    • getItemType

      public ItemType getItemType() throws TorqueException
      DOCUMENT ME!
      Overrides:
      getItemType in class BaseItem
      Returns:
      DOCUMENT ME!
      Throws:
      TorqueException - DOCUMENT ME!
    • save

      public void save() throws Exception
      ItemSearch 는 저장하지 않는다.
      Specified by:
      save in interface Persistent
      Overrides:
      save in class BaseItem
      Throws:
      Exception - always throw UnsupportedOperationException
    • setOutType

      public void setOutType(String outType)
      DOCUMENT ME!
      Parameters:
      outType - DOCUMENT ME!
    • getOutType

      public String getOutType()
      DOCUMENT ME!
      Returns:
      DOCUMENT ME!
    • filterItemType

      public void filterItemType(ItemType type)
      searchable mitList 의 itemType 을 filtering 한다.
      Parameters:
      type -
    • getSearcher

      public EasyDeskUser getSearcher()
      DOCUMENT ME!
      Specified by:
      getSearcher in interface ItemSearch
      Returns:
      DOCUMENT ME!
    • getSearchMITList

      public MITList getSearchMITList()
      이 검색 Object 의 MITList 를 구한다.
      Specified by:
      getSearchMITList in interface ItemSearch
      Returns:
      mitList
    • isXMITSearch

      public boolean isXMITSearch()
      MITList 가 존재하고, SingleModule 인지
      Specified by:
      isXMITSearch in interface ItemSearch
      Returns:
      true/false
    • isSingleItemTypeSearch

      public boolean isSingleItemTypeSearch()
      mitList 와는 상관없이 이 Object 이 SingleItemType Search 인지 확인
      Specified by:
      isSingleItemTypeSearch in interface ItemSearch
      Returns:
      true/false
    • isSingleModuleItemTypeSearch

      public boolean isSingleModuleItemTypeSearch()
      mitList 와는 상관없이 이 Object 이 SingleModuleItemType Search 인지 확인
      Specified by:
      isSingleModuleItemTypeSearch in interface ItemSearch
      Returns:
      true/false
    • has

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

      public void setItemListAttributeColumns(List<ModuleUserAttribute> rmuas)
      List of attributes to show with each item.
      Parameters:
      rmuas - a List of ModuleUserAttribute objects
    • getItemListAttributeColumns

      public List<ModuleUserAttribute> getItemListAttributeColumns()
      DOCUMENT ME!
      Returns:
      DOCUMENT ME!
    • getUserIdList

      public List getUserIdList()
      DOCUMENT ME!
      Returns:
      DOCUMENT ME!
    • getAllAvailableAttributeValuesMap

      public org.apache.commons.collections4.map.LinkedMap<String,AttributeValue> getAllAvailableAttributeValuesMap() throws TorqueException
      getAllAvailableAttributeValuesMap 의 현재 Implement 는 Logic 상 Bug 가 존재하는 것 같다. 지금의 검색은 속성들간에 AND Operation 이 동작하고 있다. 만약 두가지의 아이템유형 A, B 을 검색대상으로 하고 A 가 속성 X1, X2 를 B가 속성 X1, X3 를 가지고 있다고 할 때 두 아이템유형의 XQuery 에대하여 의미있는 것은 단지 X1 뿐이다. 만약 X2 나 X3 의 검색 조건을 입력한다면 이것은 대상이 둘중에 하나로만 해당되어 이것은 검색대상의 설정이 잘못된 것이다. 이것이 의미가 있으려면 각 속성간의 AND/OR Operation 을 선택할 수 있어야 한다. returns the list of attribute values for all attributes
      Returns:
      all attributeValues
      Throws:
      Exception
      TorqueException
    • getAllAvailableAttributeValuesMap

      public org.apache.commons.collections4.map.LinkedMap<String,AttributeValue> getAllAvailableAttributeValuesMap(boolean quickSearchOnly) throws TorqueException
      getAllAvailableAttributeValuesMap 의 현재 Implement 는 Logic 상 Bug 가 존재하는 것 같다. 지금의 검색은 속성들간에 AND Operation 이 동작하고 있다. 만약 두가지의 아이템유형 A, B 을 검색대상으로 하고 A 가 속성 X1, X2 를 B가 속성 X1, X3 를 가지고 있다고 할 때 두 아이템유형의 XQuery 에대하여 의미있는 것은 단지 X1 뿐이다. 만약 X2 나 X3 의 검색 조건을 입력한다면 이것은 대상이 둘중에 하나로만 해당되어 이것은 검색대상의 설정이 잘못된 것이다. 이것이 의미가 있으려면 각 속성간의 AND/OR Operation 을 선택할 수 있어야 한다. returns the list of attribute values for all attributes
      Parameters:
      quickSearchOnly -
      Returns:
      all attributeValues
      Throws:
      Exception
      TorqueException
    • getCommonAttributeValuesMap

      public org.apache.commons.collections4.map.LinkedMap<String,AttributeValue> getCommonAttributeValuesMap() throws TorqueException
      DOCUMENT ME!
      Returns:
      DOCUMENT ME!
      Throws:
      Exception - DOCUMENT ME!
      TorqueException
    • getCommonAttributeValuesMap

      public org.apache.commons.collections4.map.LinkedMap<String,AttributeValue> getCommonAttributeValuesMap(boolean quickSearchOnly) throws TorqueException
      DOCUMENT ME!
      Parameters:
      quickSearchOnly -
      Returns:
      DOCUMENT ME!
      Throws:
      Exception - DOCUMENT ME!
      TorqueException
    • internalGetAttributeValuesMap

      protected org.apache.commons.collections4.map.LinkedMap<String,AttributeValue> internalGetAttributeValuesMap(boolean quickSearchOnly, boolean commonOnly) throws TorqueException
      returns the list of attribute values for all attributes in the current module. if(commonOnly==true) return only attribute values which are commonly defined for all searched itemTypes.
      Parameters:
      quickSearchOnly -
      commonOnly -
      Returns:
      all attributeValues
      Throws:
      Exception
      TorqueException
    • getModuleAttributeValuesMap

      public org.apache.commons.collections4.map.LinkedMap<String,AttributeValue> getModuleAttributeValuesMap(boolean isActiveOnly) throws TorqueException
      Description copied from class: Item
      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 에 한정되지 않은 것에만 적용된다.
      Overrides:
      getModuleAttributeValuesMap in class Item
      Parameters:
      isActiveOnly - ingored query is always set false
      Returns:
      linkedMap
      Throws:
      TorqueException - 조회 중 오류가 발생한 경우
      See Also:
    • getModuleAttributeValuesMap

      public org.apache.commons.collections4.map.LinkedMap<String,AttributeValue> getModuleAttributeValuesMap(boolean quickSearchOnly, boolean isActiveOnly) throws TorqueException
      Parameters:
      quickSearchOnly -
      isActiveOnly -
      Returns:
      linkedMap
      Throws:
      TorqueException
      See Also:
    • getMITAttributeValuesMap

      public org.apache.commons.collections4.map.LinkedMap<String,AttributeValue> getMITAttributeValuesMap(boolean quickSearchOnly, 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
      Throws:
      TorqueException
    • getUserAttributes

      public List getUserAttributes() throws TorqueException
      Returns:
      The list of attributes of type "user" for the module(s) to search in.
      Throws:
      TorqueException
    • getLeafModuleOptions

      public List getLeafModuleOptions(Attribute attribute) throws TorqueException
      DOCUMENT ME!
      Parameters:
      attribute - DOCUMENT ME!
      Returns:
      DOCUMENT ME!
      Throws:
      Exception - DOCUMENT ME!
      TorqueException
    • getCommonOptionTree

      public List getCommonOptionTree(Attribute attribute) throws TorqueException
      DOCUMENT ME!
      Parameters:
      attribute - DOCUMENT ME!
      Returns:
      DOCUMENT ME!
      Throws:
      Exception - DOCUMENT ME!
      TorqueException
    • getSearchWords

      public String getSearchWords()
      Get the words for which to search.
      Returns:
      Value of searchWords.
    • setSearchWords

      public void setSearchWords(String v)
      Set the words for which to search.
      Parameters:
      v - Value to assign to searchWords.
    • getCommentQuery

      public String getCommentQuery()
      Get the value of commentQuery.
      Returns:
      value of commentQuery.
    • setCommentQuery

      public void setCommentQuery(String v)
      Set the value of commentQuery.
      Parameters:
      v - Value to assign to commentQuery.
    • getTextScopeForAll

      protected Integer[] getTextScopeForAll() throws TorqueException
      Sets the text search scope to all quick search text attributes.
      Throws:
      TorqueException
    • getTextScope

      public Integer[] getTextScope() throws TorqueException
      Get the value of textScope. if the scope is not set then all text attributes are returned. if there are no relevant text attributes null will be returned.
      Returns:
      value of textScope.
      Throws:
      TorqueException
    • setTextScope

      public void setTextScope(Integer[] v) throws Exception
      Set the value of textScope.
      Parameters:
      v - Value to assign to textScope.
      Throws:
      Exception
    • setPrimitiveTextScope

      public void setPrimitiveTextScope(int[] ints) throws Exception
      DOCUMENT ME!
      Parameters:
      ints - DOCUMENT ME!
      Throws:
      Exception - DOCUMENT ME!
    • getPrimitiveTextScope

      public int[] getPrimitiveTextScope() throws Exception
      DOCUMENT ME!
      Returns:
      DOCUMENT ME!
      Throws:
      Exception - DOCUMENT ME!
    • getMinId

      public String getMinId()
      Get the value of minId.
      Returns:
      value of minId.
    • setMinId

      public void setMinId(String v)
      Set the value of minId.
      Parameters:
      v - Value to assign to minId.
    • getMaxId

      public String getMaxId()
      Get the value of maxId.
      Returns:
      value of maxId.
    • setMaxId

      public void setMaxId(String v)
      Set the value of maxId.
      Parameters:
      v - Value to assign to maxId.
    • getMinDate

      public String getMinDate()
      Get the value of minDate.
      Returns:
      value of minDate.
    • setMinDate

      public void setMinDate(String newMinDate)
      Set the value of minDate.
      Parameters:
      newMinDate - Value to assign to minDate.
    • getMaxDate

      public String getMaxDate()
      Get the value of maxDate.
      Returns:
      value of maxDate.
    • setMaxDate

      public void setMaxDate(String newMaxDate)
      Set the value of maxDate.
      Parameters:
      newMaxDate - Value to assign to maxDate.
    • getMinVotes

      public int getMinVotes()
      Deprecated.
      use rangeQuery
      Get the value of minVotes.
      Returns:
      value of minVotes.
    • setMinVotes

      public void setMinVotes(int v)
      Deprecated.
      use rangeQuery
      Set the value of minVotes.
      Parameters:
      v - Value to assign to minVotes.
    • getStateChangeAttributeId

      public Integer getStateChangeAttributeId()
      Get the value of stateChangeAttributeId.
      Returns:
      value of stateChangeAttributeId.
    • setStateChangeAttributeId

      public void setStateChangeAttributeId(Integer v)
      Set the value of stateChangeAttributeId.
      Parameters:
      v - Value to assign to stateChangeAttributeId.
    • getStateChangeFromOptionId

      public Integer getStateChangeFromOptionId()
      Get the value of stateChangeFromOptionId.
      Returns:
      value of stateChangeFromOptionId.
    • setStateChangeFromOptionId

      public void setStateChangeFromOptionId(Integer v)
      Set the value of stateChangeFromOptionId.
      Parameters:
      v - Value to assign to stateChangeFromOptionId.
    • getStateChangeToOptionId

      public Integer getStateChangeToOptionId()
      Get the value of stateChangeToOptionId.
      Returns:
      value of stateChangeToOptionId.
    • setStateChangeToOptionId

      public void setStateChangeToOptionId(Integer v)
      Set the value of stateChangeToOptionId.
      Parameters:
      v - Value to assign to stateChangeToOptionId.
    • getStateChangeFromDate

      public String getStateChangeFromDate()
      Get the value of stateChangeFromDate.
      Returns:
      value of stateChangeFromDate.
    • setStateChangeFromDate

      public void setStateChangeFromDate(String fromDate)
      Set the value of stateChangeFromDate.
      Parameters:
      fromDate - Value to assign to stateChangeFromDate.
    • getStateChangeToDate

      public String getStateChangeToDate()
      Get the value of stateChangeToDate.
      Returns:
      value of stateChangeToDate.
    • setStateChangeToDate

      public void setStateChangeToDate(String toDate)
      Set the value of stateChangeToDate.
      Parameters:
      toDate - Value to assign to stateChangeToDate.
    • getSortAttributeId

      public Integer getSortAttributeId()
      Get the value of sortAttributeId.
      Returns:
      value of SortAttributeId.
    • setSortAttributeId

      public void setSortAttributeId(Integer v)
      Set the value of sortAttributeId.
      Parameters:
      v - Value to assign to sortAttributeId.
    • getSortPolarity

      public String getSortPolarity()
      Whether to do SQL sorting in DESC or ASC order (the default being the latter).
      Returns:
      value of sortPolarity.
    • setSortPolarity

      public void setSortPolarity(String v)
      Set the value of sortPolarity.
      Parameters:
      v - Value to assign to sortPolarity.
    • getType

      public String getType()
    • setType

      public void setType(String searchType)
      DOCUMENT ME!
      Parameters:
      searchType - DOCUMENT ME!
    • addUserCriteria

      public void addUserCriteria(String userId, String searchCriteria)
      Describe addUserSearch method here.
      Parameters:
      userId - a String represention of the PrimaryKey
      searchCriteria - a String either a String representation of an Attribute PrimaryKey, or the Strings "created_by" "any"
    • getALL_TEXT

      public Integer getALL_TEXT()
      DOCUMENT ME!
      Returns:
      DOCUMENT ME!
    • getQuickSearchDateAttributeValues

      public List<AttributeValue> getQuickSearchDateAttributeValues() throws TorqueException
      QuickSearch DateAttribute List 를 구한다.
      Returns:
      attribute list
      Throws:
      TorqueException
    • getQuickSearchNumberAttributeValues

      public List<AttributeValue> getQuickSearchNumberAttributeValues() throws TorqueException
      QuickSearch DateAttribute List 를 구한다.
      Returns:
      attribute list
      Throws:
      TorqueException
    • getDateAttributeValues

      protected List<AttributeValue> getDateAttributeValues(boolean quickSearchOnly) throws TorqueException
      DateAttribute List 를 구한다.
      Parameters:
      quickSearchOnly -
      Returns:
      attribute list
      Throws:
      TorqueException
    • getNumberAttributeValues

      protected List<AttributeValue> getNumberAttributeValues(boolean quickSearchOnly) throws TorqueException
      NumberAttribute List 를 구한다.
      Parameters:
      quickSearchOnly -
      Returns:
      attribute list
      Throws:
      TorqueException
    • getQuickSearchTextAttributeValues

      public List<AttributeValue> getQuickSearchTextAttributeValues() throws TorqueException
      QuickSearchOnly, ExcludePersonal Text Attribute 를 구한다.
      Throws:
      TorqueException
    • getTextAttributeValues

      public List<AttributeValue> getTextAttributeValues() throws TorqueException
      모든 Text AttributeValue 들을 구한다.
      Throws:
      TorqueException
    • getTextAttributeValues

      protected List<AttributeValue> getTextAttributeValues(boolean quickSearchOnly) throws TorqueException
      TextAttributeValues 만 구한다.
      Parameters:
      quickSearchOnly - or not
      Returns:
      List TextAttributeValues
      Throws:
      TorqueException
    • getQuickSearchOptionAttributeValues

      public List<AttributeValue> getQuickSearchOptionAttributeValues() throws TorqueException
      Returns OptionAttributes which have been marked for Quick search.
      Returns:
      a List value
      Throws:
      Exception - if an error occurs
      TorqueException
    • getOptionAttributeValues

      public List<AttributeValue> getOptionAttributeValues() throws TorqueException
      Returns OptionAttributes which have been marked for Quick search.
      Returns:
      a List value
      Throws:
      Exception - if an error occurs
      TorqueException
    • getOptionAttributeValues

      protected List<AttributeValue> getOptionAttributeValues(boolean quickSearchOnly) throws TorqueException
      Returns OptionAttributes which have been marked for Quick search.
      Parameters:
      quickSearchOnly -
      Returns:
      a List value
      Throws:
      Exception - if an error occurs
      TorqueException
    • parseDate

      public Date parseDate(String dateString, boolean addTwentyFourHours) throws ParseException
      Attempts to parse a atring as a date, first using ISO standard "yyyy-mm-dd". and then the locale-sepcific short date format, If it sees a ':' character in the date string then the string will be interpreted as a date and time. Throws a ParseException if the String does not contain a suitable format.
      Parameters:
      dateString - a String value
      addTwentyFourHours - if no time is given in the date string and this flag is true, then 24 hours - 1 msec will be added to the date.
      Returns:
      a Date value
      Throws:
      ParseException
    • getQueryResults

      Get a List of Items that match the criteria given by this SearchItem's searchWords and the quick search attribute values.
      Returns:
      a List value
      Throws:
      ComplexQueryException - too many join
      TorqueException - torque trouble
      IOException - search engine trouble
      ParseException - malformed input
    • getItemCount

      public int getItemCount(long[] lastMatchingItemIds) throws ComplexQueryException, TorqueException, IOException
      DOCUMENT ME!
      Parameters:
      lastMatchingItemIds - DOCUMENT ME!
      Returns:
      DOCUMENT ME!
      Throws:
      ComplexQueryException - DOCUMENT ME!
      Exception - DOCUMENT ME!
      TorqueException
      IOException
    • toString

      public String toString()
      Overrides:
      toString in class Item
      Returns:
      String representation for debugging
    • finalize

      protected void finalize() throws Throwable
      Called by the garbage collector to release any database resources associated with this query.
      Overrides:
      finalize in class Object
      Throws:
      Throwable
      See Also:
    • close

      public void close()
      Releases any managed resources associated with this search (e.g. database connections, etc.).
    • clear

      public void clear()
      DOCUMENT ME!
      Specified by:
      clear in interface Cacheable
      Overrides:
      clear in class Item