com.endeca.portal.data.model
Class ModelUtil

java.lang.Object
  extended by com.endeca.portal.data.model.ModelUtil

public class ModelUtil
extends java.lang.Object

Class containing utility methods for converting various query result objects into a single record object.


Method Summary
static Assignment convert(com.endeca.mdex.conversation.Assignment assignment)
          Convert a 7-series assignment into a unified model assignment.
static Assignment convert(com.endeca.mdex.conversation.Assignment assignment, AttributeKeyConverter attributeKeyConverter)
          Convert a 7-series assignment into a unified model assignment.
static java.lang.Iterable<Record> convert(AttributeSettings uam, java.util.List<com.endeca.mdex.conversation.Record> csRecList)
          This method converts a list of conversation records to an iterable of uniform record model object.
static Record convert(AttributeSettings uam, com.endeca.mdex.conversation.Record csRec)
          Convenience converter for taking MDEX attributes and a discovery service record and converting it to a unified model object.
static Record convert(AttributeSettings uam, com.endeca.mdex.conversation.Record csRec, AttributeKeyConverter attributeKeyConverter)
           
static java.lang.Iterable<Record> convert(java.util.List<com.endeca.mdex.conversation.Record> csRecList)
          This method converts a list of conversation records to an iterable of uniform record model object.
static java.lang.Iterable<Record> convert(java.util.List<com.endeca.mdex.conversation.Record> csRecList, AttributeKeyConverter attributeKeyConverter)
           
static com.endeca.mdex.conversation.NavigationMenu convert(com.endeca.mdex.conversation.NavigationMenu navigationMenu, AttributeKeyConverter attributeKeyConverter, java.util.Locale currentLocale)
          Substitute locale specific attribute keys with default locale attribute keys using attributeKeyConverter passed
static Record convert(com.endeca.mdex.conversation.Record csRec)
          Convert a conversation service record with a null record spec.
static Record convert(com.endeca.mdex.conversation.Record csRec, AttributeKeyConverter attributeKeyConverter)
           
static Record convert(RecordSpec recordSpec, com.endeca.mdex.conversation.Record csRec)
          Converts a conversation service record into a uniform record model object.
static Record convert(RecordSpec recordSpec, com.endeca.mdex.conversation.Record csRec, AttributeKeyConverter attributeKeyConverter)
          Converts a conversation service record into a uniform record model object.
static com.endeca.mdex.conversation.ValueSearch convert(com.endeca.mdex.conversation.ValueSearch attributeValueSearch, AttributeKeyConverter attributeKeyConverter)
          Substitute old key values with new key values using attributeKeyConverter passed
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

convert

public static Record convert(com.endeca.mdex.conversation.Record csRec)
Convert a conversation service record with a null record spec. Should not be used widely, only in places which are temporarily using a record as a convenience.

Parameters:
csRec -
Returns:
- an equivalent record

convert

public static Record convert(com.endeca.mdex.conversation.Record csRec,
                             AttributeKeyConverter attributeKeyConverter)

convert

public static Record convert(AttributeSettings uam,
                             com.endeca.mdex.conversation.Record csRec)
Convenience converter for taking MDEX attributes and a discovery service record and converting it to a unified model object.

Parameters:
attributes - - MDEX attributes from the data source which created the discovery service record
csRec - - the record
Returns:
- an equivalent record

convert

public static Record convert(AttributeSettings uam,
                             com.endeca.mdex.conversation.Record csRec,
                             AttributeKeyConverter attributeKeyConverter)

convert

public static Record convert(RecordSpec recordSpec,
                             com.endeca.mdex.conversation.Record csRec)
Converts a conversation service record into a uniform record model object.

Parameters:
csRec - - the conversation service record to convert.
Returns:
- an equivalent record

convert

public static Record convert(RecordSpec recordSpec,
                             com.endeca.mdex.conversation.Record csRec,
                             AttributeKeyConverter attributeKeyConverter)
Converts a conversation service record into a uniform record model object. Substitute locale specific attribute keys values with default locale attribute keys using attributeKeyConverter passed

Parameters:
recordSpec -
csRec -
attributeKeyConverter -
Returns:

convert

public static Assignment convert(com.endeca.mdex.conversation.Assignment assignment)
Convert a 7-series assignment into a unified model assignment.

Parameters:
assignment - - the assignment to convert
Returns:
- An equivalent assignment object.

convert

public static Assignment convert(com.endeca.mdex.conversation.Assignment assignment,
                                 AttributeKeyConverter attributeKeyConverter)
Convert a 7-series assignment into a unified model assignment. Substitute locale specific attribute keys values with default locale attribute keys using attributeKeyConverter passed

Parameters:
assignment -
attributeKeyConverter -
Returns:

convert

public static java.lang.Iterable<Record> convert(java.util.List<com.endeca.mdex.conversation.Record> csRecList)
This method converts a list of conversation records to an iterable of uniform record model object.

Parameters:
csRecList -
Returns:
Iterable

convert

public static java.lang.Iterable<Record> convert(java.util.List<com.endeca.mdex.conversation.Record> csRecList,
                                                 AttributeKeyConverter attributeKeyConverter)

convert

public static java.lang.Iterable<Record> convert(AttributeSettings uam,
                                                 java.util.List<com.endeca.mdex.conversation.Record> csRecList)
This method converts a list of conversation records to an iterable of uniform record model object.

Parameters:
attributes -
csRecList -
Returns:
Iterable

convert

public static com.endeca.mdex.conversation.ValueSearch convert(com.endeca.mdex.conversation.ValueSearch attributeValueSearch,
                                                               AttributeKeyConverter attributeKeyConverter)
Substitute old key values with new key values using attributeKeyConverter passed

Parameters:
attributeValueSearch -
attributeKeyConverter -
Returns:

convert

public static com.endeca.mdex.conversation.NavigationMenu convert(com.endeca.mdex.conversation.NavigationMenu navigationMenu,
                                                                  AttributeKeyConverter attributeKeyConverter,
                                                                  java.util.Locale currentLocale)
Substitute locale specific attribute keys with default locale attribute keys using attributeKeyConverter passed

Parameters:
navigationMenu -
attributeKeyConverter -
Returns: