|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.endeca.portal.metadata.AbstractMetadataManager<AttributeSet> com.endeca.portal.metadata.attributes.AttributeSetManager
public class AttributeSetManager
Encapsulates DB-interaction methods specific to attribute sets
Field Summary | |
---|---|
static java.lang.String |
DEFAULT_CATCHALL_NAME
Defines the default name for the "catchall" set |
static java.lang.String |
FEATURE_CATCHALL
Represents the "catchall" feature for attribute sets |
static int |
MAX_ORDER_INDEX
the order index (rel) to use if none is found or specified |
static java.lang.String |
TYPE_ATTR_SET
Represents the "type" value for an attribute set |
static java.lang.String |
TYPE_ATTRIBUTE_MAPPING_PROPERTY
Represents the "type" value for the attribute mapping property of an attribute set |
static java.lang.String |
TYPE_DISPLAY_NAME_PROPERTY
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)
Adds a new attribute set for a given data source |
|
java.util.List<AttributeSet> |
getAllAttributeSets()
Returns all attribute set metadata objects |
|
AttributeSet |
getAttributeSetByFeature(java.lang.String dataSourceId,
java.lang.String feature)
Returns an attribute set by feature for a specified data source |
|
AttributeSet |
getAttributeSetById(long id)
Returns an attribute set metadata object by ID |
|
AttributeSet |
getAttributeSetByName(java.lang.String dataSourceId,
java.lang.String name)
Returns an attribute set by name for a specified data source |
|
java.util.List<AttributeSet> |
getAttributeSetsByDataSource(java.lang.String dataSourceId)
Returns a list of attribute display names associated with a given data source. |
|
AttributeSet |
getCatchallSet(java.lang.String dataSourceId)
Returns the "catchall" set for a given data source |
|
static AttributeSetManager |
getInstance()
Gets a AttributeSetManager instance. |
|
AttributeSet |
getOrSetAttributeSetByFeature(java.lang.String dataSourceId,
java.lang.String feature,
AttributeSet defaultAttrSet)
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)
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)
Returns the "catchall" set for a given datasource, and creates a default one if it does not exist |
|
|
getProperties(MetadataPropertyQuery query)
Retrieves a list of Metadata Properties from a Metadata Property Query |
|
void |
handleObjectPropertyPersistence(AttributeSet sourceObject,
AttributeSet returnObject)
Handles persistence processing for all properties associated with this object. |
|
AttributeSet |
objectFromMetadataRecord(com.endeca.portal.liferay.ext.metadata.model.MetadataRecord record)
Given a base Liferay record, return a Metadata Object; subclasses must implement this method. |
|
AttributeSet |
persist(AttributeSet attrSet)
Handles persistence processing for a single attribute sets. |
|
java.util.List<AttributeSet> |
persist(java.util.List<AttributeSet> metadataObjectList)
Handles persistence processing for the list of attribute sets. |
|
|
persistProperties(java.util.List<S> metadataPropertyList)
Writes a list of Metadata Properties to the database. |
|
|
propertyFromMetadataPropertyRecord(com.endeca.portal.liferay.ext.metadata.model.MetadataPropertyRecord record)
Returns the appropriate type of Metadata Property for the supplied base Liferay record. |
|
void |
removeAttributeSetById(long attributeSetId)
Removes an attribute set by its ID |
Methods inherited from class com.endeca.portal.metadata.AbstractMetadataManager |
---|
getObject, getObjectById, getObjects, getProperty, objectsFromMetadataRecords, persistProperty, propertiesFromMetadataPropertyRecords, removeObjectById, removePropertyById |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String TYPE_ATTR_SET
public static final java.lang.String TYPE_DISPLAY_NAME_PROPERTY
public static final java.lang.String TYPE_ATTRIBUTE_MAPPING_PROPERTY
public static final java.lang.String FEATURE_CATCHALL
public static final java.lang.String DEFAULT_CATCHALL_NAME
public static final int MAX_ORDER_INDEX
Method Detail |
---|
public AttributeSet getAttributeSetById(long id)
id
- the attribute set ID
public java.util.List<AttributeSet> getAllAttributeSets()
public java.util.List<AttributeSet> getAttributeSetsByDataSource(java.lang.String dataSourceId)
dataSourceId
- the Data Source ID
public AttributeSet getAttributeSetByName(java.lang.String dataSourceId, java.lang.String name)
dataSourceId
- the Data Source IDname
- the name of the attribute set
public AttributeSet getAttributeSetByFeature(java.lang.String dataSourceId, java.lang.String feature)
dataSourceId
- the Data Source IDfeature
- the feature of the attribute set
public AttributeSet getOrSetAttributeSetByName(java.lang.String dataSourceId, java.lang.String name, AttributeSet defaultAttrSet) throws MetadataException
dataSourceId
- the Data Source IDname
- the name of the attribute setdefaultAttrSet
- the object to write if the attribute set was not found
MetadataException
public AttributeSet getOrSetAttributeSetByFeature(java.lang.String dataSourceId, java.lang.String feature, AttributeSet defaultAttrSet) throws MetadataException
dataSourceId
- the Data Source IDfeature
- the feature of the attribute setdefaultAttrSet
- the object to write if the attribute set was not found
MetadataException
public AttributeSet getCatchallSet(java.lang.String dataSourceId)
dataSourceId
- the Data Source ID
public AttributeSet getOrSetCatchallSet(java.lang.String dataSourceId) throws MetadataException
dataSourceId
- the datasource
MetadataException
public AttributeSet addAttributeSet(java.lang.String attributeSetName, java.lang.String dataSourceId) throws MetadataException
attributeSetName
- the name of the attribute set to createdataSourceId
- the Data Source ID
MetadataException
public void removeAttributeSetById(long attributeSetId) throws MetadataException
attributeSetId
- the attribute set's ID
MetadataException
public void handleObjectPropertyPersistence(AttributeSet sourceObject, AttributeSet returnObject) throws MetadataException
handleObjectPropertyPersistence
in class AbstractMetadataManager<AttributeSet>
sourceObject
- the object being persistedreturnObject
- the object that will be returned to the persistence caller
MetadataException
AbstractMetadataManager.handleObjectPropertyPersistence(com.endeca.portal.metadata.MetadataObject, com.endeca.portal.metadata.MetadataObject)
public java.util.List<AttributeSet> persist(java.util.List<AttributeSet> metadataObjectList) throws MetadataException
persist
in class AbstractMetadataManager<AttributeSet>
metadataObjectList
- the list of Metadata Objects representing the records to be persisted
MetadataException
- if there was an error persisting the dataAbstractMetadataManager.persist(java.util.List)
public AttributeSet persist(AttributeSet attrSet) throws MetadataException
persist
in class AbstractMetadataManager<AttributeSet>
attrSet
- the Metadata Object representing the record to be persisted
MetadataException
- if there was an error persisting the dataAbstractMetadataManager.persist(com.endeca.portal.metadata.MetadataObject)
public <S extends MetadataProperty> java.util.List<S> persistProperties(java.util.List<S> metadataPropertyList) throws MetadataException
AbstractMetadataManager
persistProperties
in class AbstractMetadataManager<AttributeSet>
S
- an instance of a Metadata Property extensionmetadataPropertyList
- the list of Metadata Properties representing the records to be persisted
MetadataException
- if there was an error persisting the datapublic static AttributeSetManager getInstance()
public AttributeSet objectFromMetadataRecord(com.endeca.portal.liferay.ext.metadata.model.MetadataRecord record)
AbstractMetadataManager
objectFromMetadataRecord
in interface MetadataManager<AttributeSet>
objectFromMetadataRecord
in class AbstractMetadataManager<AttributeSet>
record
- the base Liferay record
MetadataManager.objectFromMetadataRecord(MetadataRecord)
public <S extends MetadataProperty> S propertyFromMetadataPropertyRecord(com.endeca.portal.liferay.ext.metadata.model.MetadataPropertyRecord record)
propertyFromMetadataPropertyRecord
in interface MetadataManager<AttributeSet>
propertyFromMetadataPropertyRecord
in class AbstractMetadataManager<AttributeSet>
S
- an instance of a Metadata Property extensionrecord
- the base Liferay record
MetadataManager.propertyFromMetadataPropertyRecord(MetadataPropertyRecord)
public <S extends MetadataProperty> java.util.List<S> getProperties(MetadataPropertyQuery query)
AbstractMetadataManager
getProperties
in class AbstractMetadataManager<AttributeSet>
S
- class of the metadata property associated with the object managed by this managerquery
- the query
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |