|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.endeca.portal.metadata.AbstractMetadataManager<T>
T
- class of the metadata object managed by this managerpublic abstract class AbstractMetadataManager<T extends MetadataObject>
Central facade for managing low-level Metadata Objects and Properties. Each
extension of this class is responsible for managing objects of a
class that implements MetadataObject
.
Constructor Summary | |
---|---|
AbstractMetadataManager()
|
Method Summary | ||
---|---|---|
java.util.List<com.endeca.portal.liferay.ext.metadata.model.MetadataPropertyRecord> |
getMetadataPropertyRecords(MetadataPropertyQuery propertyQuery)
Retrieves the properties for a given object. |
|
T |
getObject(MetadataObjectQuery query)
Retrieves a Metadata Object from a Metadata Object Query. |
|
T |
getObjectById(long objectId)
Retrieves a Metadata Object by its object ID |
|
java.util.List<T> |
getObjects(MetadataObjectQuery query)
Retrieves a list of Metadata Objects from a Metadata Object Query |
|
|
getProperties(MetadataPropertyQuery query)
Retrieves a list of Metadata Properties from a Metadata Property Query |
|
|
getProperty(MetadataPropertyQuery query)
Retrieves a Metadata Property from a Metadata Property Query. |
|
void |
handleObjectPropertyPersistence(T sourceObject,
T returnObject)
Processes a Metadata Object's list of Metadata Properties during persistence. |
|
abstract boolean |
hasProperties()
Return true to indicate that this MetadataManager class works with MetadataObjects that have associated MetadataProperties. |
|
abstract T |
objectFromMetadataRecord(com.endeca.portal.liferay.ext.metadata.model.MetadataRecord record)
Given a base Liferay record, return a Metadata Object; subclasses must implement this method. |
|
java.util.List<T> |
objectsFromMetadataRecords(java.util.List<com.endeca.portal.liferay.ext.metadata.model.MetadataRecord> records)
Given a list of base Liferay records, return a list of Metadata Objects in the same order. |
|
java.util.List<T> |
persist(java.util.List<T> metadataObjectList)
Writes a list of Metadata Objects to the database. |
|
T |
persist(T metadataObject)
Persists a Metadata Object to the database |
|
|
persistProperties(java.util.List<S> metadataPropertyList)
Writes a list of Metadata Properties to the database. |
|
|
persistProperty(S metadataProperty)
Persists a Metadata Property to the database |
|
|
propertiesFromMetadataPropertyRecords(java.util.List<com.endeca.portal.liferay.ext.metadata.model.MetadataPropertyRecord> records)
Given a list of base Liferay records, return a list of Metadata Properties in the same order. |
|
abstract
|
propertyFromMetadataPropertyRecord(com.endeca.portal.liferay.ext.metadata.model.MetadataPropertyRecord record)
Given a base Liferay record, return a Metadata Property; subclasses must implement this method. |
|
void |
removeObjectById(long objectId)
Removes an Metadata Object by it's unique identifier, the object ID. |
|
void |
removePropertyById(long propertyId)
Removes an Metadata Property by it's unique identifier, the property ID |
|
MetadataPropertyQuery |
setupPropertyQuery(MetadataPropertyQuery propertyQuery)
Called by getMetadataPropertyRecords and getProperties to massage the SQL query before execution. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public AbstractMetadataManager()
Method Detail |
---|
public T getObjectById(long objectId)
objectId
- the object ID
public T getObject(MetadataObjectQuery query)
query
- the query
public java.util.List<T> getObjects(MetadataObjectQuery query)
query
- the query
public void removeObjectById(long objectId) throws MetadataException
objectId
- the object ID
MetadataException
public <S extends MetadataProperty> S getProperty(MetadataPropertyQuery query)
S
- class of the metadata property associated with the object managed by this managerquery
- the query
public <S extends MetadataProperty> java.util.List<S> getProperties(MetadataPropertyQuery query)
S
- class of the metadata property associated with the object managed by this managerquery
- the query
public void removePropertyById(long propertyId) throws MetadataException
propertyId
- the property ID
MetadataException
public T persist(T metadataObject) throws MetadataException
metadataObject
- the Metadata Object representing the record to be persisted
MetadataException
- if there was an error persisting the datapublic java.util.List<T> persist(java.util.List<T> metadataObjectList) throws MetadataException
metadataObjectList
- the list of Metadata Objects representing the records to be persisted
MetadataException
- if there was an error persisting the datapublic void handleObjectPropertyPersistence(T sourceObject, T returnObject) throws MetadataException, com.liferay.portal.SystemException
persist(MetadataObject)
and is
intended to be overridden by subclasses for special handling of the
Metadata Properties associated with the object being persisted. The
default behavior is to iterate over each property, call
persistProperty(MetadataProperty)
and add the result of the
property persistence to the return object.
sourceObject
- the object being persistedreturnObject
- the object that will be returned to the persistence caller
MetadataException
com.liferay.portal.SystemException
public <S extends MetadataProperty> S persistProperty(S metadataProperty) throws MetadataException
S
- an instance of a Metadata Property extensionmetadataProperty
- the Metadata Property representing the record to be persisted
MetadataException
- if there was an error persisting the datapublic <S extends MetadataProperty> java.util.List<S> persistProperties(java.util.List<S> metadataPropertyList) throws MetadataException
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 abstract T objectFromMetadataRecord(com.endeca.portal.liferay.ext.metadata.model.MetadataRecord record)
objectFromMetadataRecord
in interface MetadataManager<T extends MetadataObject>
record
- the base Liferay record
MetadataManager.objectFromMetadataRecord(MetadataRecord)
public java.util.List<T> objectsFromMetadataRecords(java.util.List<com.endeca.portal.liferay.ext.metadata.model.MetadataRecord> records)
records
- the list of base Liferay records
public abstract <S extends MetadataProperty> S propertyFromMetadataPropertyRecord(com.endeca.portal.liferay.ext.metadata.model.MetadataPropertyRecord record)
propertyFromMetadataPropertyRecord
in interface MetadataManager<T extends MetadataObject>
S
- an instance of a Metadata Property extensionrecord
- the base Liferay record
MetadataManager.propertyFromMetadataPropertyRecord(MetadataPropertyRecord)
public abstract boolean hasProperties()
public <S extends MetadataProperty> java.util.List<S> propertiesFromMetadataPropertyRecords(java.util.List<com.endeca.portal.liferay.ext.metadata.model.MetadataPropertyRecord> records)
S
- an instance of a Metadata Property extensionrecords
- the list of base Liferay records
public java.util.List<com.endeca.portal.liferay.ext.metadata.model.MetadataPropertyRecord> getMetadataPropertyRecords(MetadataPropertyQuery propertyQuery) throws MetadataQueryException
propertyQuery
-
MetadataQueryException
public MetadataPropertyQuery setupPropertyQuery(MetadataPropertyQuery propertyQuery)
propertyQuery
- the base query
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |