com.endeca.portal.metadata.attributes
Class AttributeSetManager

java.lang.Object
  extended by com.endeca.portal.metadata.AbstractMetadataManager<AttributeSet>
      extended by com.endeca.portal.metadata.attributes.AttributeSetManager
All Implemented Interfaces:
MetadataManager<AttributeSet>

Deprecated.

@Deprecated
public class AttributeSetManager
extends AbstractMetadataManager<AttributeSet>

Encapsulates DB-interaction methods specific to attribute sets

Author:
Endeca Technologies, Inc.

Field Summary
static java.lang.String DEFAULT_CATCHALL_NAME
          Deprecated. Defines the default name for the "catchall" set
static java.lang.String FEATURE_CATCHALL
          Deprecated. Represents the "catchall" feature for attribute sets
static int MAX_ORDER_INDEX
          Deprecated. the order index (rel) to use if none is found or specified
static java.lang.String TYPE_ATTR_SET
          Deprecated. Represents the "type" value for an attribute set
static java.lang.String TYPE_ATTRIBUTE_MAPPING_PROPERTY
          Deprecated. Represents the "type" value for the attribute mapping property of an attribute set
static java.lang.String TYPE_DISPLAY_NAME_PROPERTY
          Deprecated. Represents the "type" value for the display name property of an attribute set
 
Method Summary
 AttributeSet addAttributeSet(java.lang.String attributeSetName, java.lang.String dataSourceId)
          Deprecated. Adds a new attribute set for a given data source
 java.util.List<AttributeSet> getAllAttributeSets()
          Deprecated. Returns all attribute set metadata objects
 AttributeSet getAttributeSetByFeature(java.lang.String dataSourceId, java.lang.String feature)
          Deprecated. Returns an attribute set by feature for a specified data source
 AttributeSet getAttributeSetById(long id)
          Deprecated. Returns an attribute set metadata object by ID
 AttributeSet getAttributeSetByName(java.lang.String dataSourceId, java.lang.String name)
          Deprecated. Returns an attribute set by name for a specified data source
 java.util.List<AttributeSet> getAttributeSetsByDataSource(java.lang.String dataSourceId)
          Deprecated. Returns a list of attribute display names associated with a given data source.
 AttributeSet getCatchallSet(java.lang.String dataSourceId)
          Deprecated. Returns the "catchall" set for a given data source
static AttributeSetManager getInstance()
          Deprecated. Gets a AttributeSetManager instance.
 AttributeSet getOrSetAttributeSetByFeature(java.lang.String dataSourceId, java.lang.String feature, AttributeSet defaultAttrSet)
          Deprecated. Returns an attribute set associated with a given data source, if it exists and writes (then returns) a specified record to the db otherwise
 AttributeSet getOrSetAttributeSetByName(java.lang.String dataSourceId, java.lang.String name, AttributeSet defaultAttrSet)
          Deprecated. Returns an attribute set associated with a given data source, if it exists and writes (then returns) a specified record to the db otherwise
 AttributeSet getOrSetCatchallSet(java.lang.String dataSourceId)
          Deprecated. Returns the "catchall" set for a given datasource, and creates a default one if it does not exist
 boolean hasProperties()
          Deprecated. Attribute Sets do have associated properties.
 AttributeSet objectFromMetadataRecord(com.endeca.portal.liferay.ext.metadata.model.MetadataRecord record)
          Deprecated. Given a base Liferay record, return a Metadata Object; subclasses must implement this method.
 AttributeSet persist(AttributeSet attrSet)
          Deprecated. Handles persistence processing for a single attribute set.
 java.util.List<AttributeSet> persist(java.util.List<AttributeSet> metadataObjectList)
          Deprecated. Handles persistence processing for the list of attribute sets.
<S extends MetadataProperty>
S
propertyFromMetadataPropertyRecord(com.endeca.portal.liferay.ext.metadata.model.MetadataPropertyRecord record)
          Deprecated. Returns the appropriate type of Metadata Property for the supplied base Liferay record.
 void removeAttributeSetById(long attributeSetId)
          Deprecated. Removes an attribute set by its ID
 MetadataPropertyQuery setupPropertyQuery(MetadataPropertyQuery propertyQuery)
          Deprecated. Called by getMetadataPropertyRecords and getProperties to massage the SQL query before execution.
 
Methods inherited from class com.endeca.portal.metadata.AbstractMetadataManager
getMetadataPropertyRecords, getObject, getObjectById, getObjects, getProperties, getProperty, handleObjectPropertyPersistence, objectsFromMetadataRecords, persistProperties, persistProperty, propertiesFromMetadataPropertyRecords, removeObjectById, removePropertyById
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TYPE_ATTR_SET

public static final java.lang.String TYPE_ATTR_SET
Deprecated. 
Represents the "type" value for an attribute set

See Also:
Constant Field Values

TYPE_DISPLAY_NAME_PROPERTY

public static final java.lang.String TYPE_DISPLAY_NAME_PROPERTY
Deprecated. 
Represents the "type" value for the display name property of an attribute set

See Also:
Constant Field Values

TYPE_ATTRIBUTE_MAPPING_PROPERTY

public static final java.lang.String TYPE_ATTRIBUTE_MAPPING_PROPERTY
Deprecated. 
Represents the "type" value for the attribute mapping property of an attribute set

See Also:
Constant Field Values

FEATURE_CATCHALL

public static final java.lang.String FEATURE_CATCHALL
Deprecated. 
Represents the "catchall" feature for attribute sets

See Also:
Constant Field Values

DEFAULT_CATCHALL_NAME

public static final java.lang.String DEFAULT_CATCHALL_NAME
Deprecated. 
Defines the default name for the "catchall" set

See Also:
Constant Field Values

MAX_ORDER_INDEX

public static final int MAX_ORDER_INDEX
Deprecated. 
the order index (rel) to use if none is found or specified

See Also:
Constant Field Values
Method Detail

getAttributeSetById

public AttributeSet getAttributeSetById(long id)
Deprecated. 
Returns an attribute set metadata object by ID

Parameters:
id - the attribute set ID
Returns:
the Attribute Set with the matching ID or null if none is found.

getAllAttributeSets

public java.util.List<AttributeSet> getAllAttributeSets()
Deprecated. 
Returns all attribute set metadata objects

Returns:
the complete list of attribute sets

getAttributeSetsByDataSource

public java.util.List<AttributeSet> getAttributeSetsByDataSource(java.lang.String dataSourceId)
Deprecated. 
Returns a list of attribute display names associated with a given data source. Note that this method always returns a catchall set; it will create one if it doesn't exist.

Parameters:
dataSourceId - the Data Source ID
Returns:
the list of attribute sets

getAttributeSetByName

public AttributeSet getAttributeSetByName(java.lang.String dataSourceId,
                                          java.lang.String name)
Deprecated. 
Returns an attribute set by name for a specified data source

Parameters:
dataSourceId - the Data Source ID
name - the name of the attribute set
Returns:
the attribute set object

getAttributeSetByFeature

public AttributeSet getAttributeSetByFeature(java.lang.String dataSourceId,
                                             java.lang.String feature)
Deprecated. 
Returns an attribute set by feature for a specified data source

Parameters:
dataSourceId - the Data Source ID
feature - the feature of the attribute set
Returns:
the attribute set object

getOrSetAttributeSetByName

public AttributeSet getOrSetAttributeSetByName(java.lang.String dataSourceId,
                                               java.lang.String name,
                                               AttributeSet defaultAttrSet)
                                        throws MetadataException
Deprecated. 
Returns an attribute set associated with a given data source, if it exists and writes (then returns) a specified record to the db otherwise

Parameters:
dataSourceId - the Data Source ID
name - the name of the attribute set
defaultAttrSet - the object to write if the attribute set was not found
Returns:
the attribute set that was created or retrieved
Throws:
MetadataException

getOrSetAttributeSetByFeature

public AttributeSet getOrSetAttributeSetByFeature(java.lang.String dataSourceId,
                                                  java.lang.String feature,
                                                  AttributeSet defaultAttrSet)
                                           throws MetadataException
Deprecated. 
Returns an attribute set associated with a given data source, if it exists and writes (then returns) a specified record to the db otherwise

Parameters:
dataSourceId - the Data Source ID
feature - the feature of the attribute set
defaultAttrSet - the object to write if the attribute set was not found
Returns:
the attribute set that was created or retrieved
Throws:
MetadataException

getCatchallSet

public AttributeSet getCatchallSet(java.lang.String dataSourceId)
Deprecated. 
Returns the "catchall" set for a given data source

Parameters:
dataSourceId - the Data Source ID
Returns:
the catchall set

getOrSetCatchallSet

public AttributeSet getOrSetCatchallSet(java.lang.String dataSourceId)
                                 throws MetadataException
Deprecated. 
Returns the "catchall" set for a given datasource, and creates a default one if it does not exist

Parameters:
dataSourceId - the datasource
Returns:
the catchall set
Throws:
MetadataException

addAttributeSet

public AttributeSet addAttributeSet(java.lang.String attributeSetName,
                                    java.lang.String dataSourceId)
                             throws MetadataException
Deprecated. 
Adds a new attribute set for a given data source

Parameters:
attributeSetName - the name of the attribute set to create
dataSourceId - the Data Source ID
Returns:
the persisted Attribute Set
Throws:
MetadataException

removeAttributeSetById

public void removeAttributeSetById(long attributeSetId)
                            throws MetadataException
Deprecated. 
Removes an attribute set by its ID

Parameters:
attributeSetId - the attribute set's ID
Throws:
MetadataException

persist

public java.util.List<AttributeSet> persist(java.util.List<AttributeSet> metadataObjectList)
                                     throws MetadataException
Deprecated. 
Handles persistence processing for the list of attribute sets. Sets the order of each AttributeSet and the order of each attribute in the set (via the "rel" field) prior to persistence.

Overrides:
persist in class AbstractMetadataManager<AttributeSet>
Parameters:
metadataObjectList - the list of Metadata Objects representing the records to be persisted
Returns:
the list persisted Metadata Objects
Throws:
MetadataException - if there was an error persisting the data
See Also:
AbstractMetadataManager.persist(java.util.List)

persist

public AttributeSet persist(AttributeSet attrSet)
                     throws MetadataException
Deprecated. 
Handles persistence processing for a single attribute set. Sets the order (via the "rel" field) of each attribute in the set prior to persistence.

Overrides:
persist in class AbstractMetadataManager<AttributeSet>
Parameters:
attrSet - the Metadata Object representing the record to be persisted
Returns:
the persisted Metadata Object
Throws:
MetadataException - if there was an error persisting the data
See Also:
AbstractMetadataManager.persist(com.endeca.portal.metadata.MetadataObject)

getInstance

public static AttributeSetManager getInstance()
Deprecated. 
Gets a AttributeSetManager instance. Currently creates a new instance every time, but could be modified to work from a singleton.

Returns:
the instance

objectFromMetadataRecord

public AttributeSet objectFromMetadataRecord(com.endeca.portal.liferay.ext.metadata.model.MetadataRecord record)
Deprecated. 
Description copied from class: AbstractMetadataManager
Given a base Liferay record, return a Metadata Object; subclasses must implement this method.

Specified by:
objectFromMetadataRecord in interface MetadataManager<AttributeSet>
Specified by:
objectFromMetadataRecord in class AbstractMetadataManager<AttributeSet>
Parameters:
record - the base Liferay record
Returns:
the Metadata Object
See Also:
MetadataManager.objectFromMetadataRecord(MetadataRecord)

propertyFromMetadataPropertyRecord

public <S extends MetadataProperty> S propertyFromMetadataPropertyRecord(com.endeca.portal.liferay.ext.metadata.model.MetadataPropertyRecord record)
Deprecated. 
Returns the appropriate type of Metadata Property for the supplied base Liferay record.

Specified by:
propertyFromMetadataPropertyRecord in interface MetadataManager<AttributeSet>
Specified by:
propertyFromMetadataPropertyRecord in class AbstractMetadataManager<AttributeSet>
Type Parameters:
S - an instance of a Metadata Property extension
Parameters:
record - the base Liferay record
Returns:
the Metadata Property
See Also:
MetadataManager.propertyFromMetadataPropertyRecord(MetadataPropertyRecord)

setupPropertyQuery

public MetadataPropertyQuery setupPropertyQuery(MetadataPropertyQuery propertyQuery)
Deprecated. 
Description copied from class: AbstractMetadataManager
Called by getMetadataPropertyRecords and getProperties to massage the SQL query before execution. The query passed in as argument specifies the parent's metadataObjectID and nothing more; subclasses can override to control ordering, additional filtering, or other criteria.

Overrides:
setupPropertyQuery in class AbstractMetadataManager<AttributeSet>
Parameters:
propertyQuery - the base query
Returns:
the modified query

hasProperties

public boolean hasProperties()
Deprecated. 
Attribute Sets do have associated properties.

Specified by:
hasProperties in class AbstractMetadataManager<AttributeSet>
Returns:
true to work with associated properties; false to bypass associated property code paths
See Also:
AbstractMetadataManager.hasProperties()