Class GenericRecordSet
- java.lang.Object
-
- org.silverpeas.core.contribution.content.form.record.GenericRecordSet
-
- All Implemented Interfaces:
Serializable
,RecordSet
public class GenericRecordSet extends Object implements RecordSet, Serializable
The GenericRecordSet manage DataRecord built on a RecordTemplate and saved by the GenericRecordSetManager.- See Also:
DataRecord
, Serialized Form
-
-
Constructor Summary
Constructors Constructor Description GenericRecordSet(IdentifiedRecordTemplate recordTemplate)
The generic record set is built upon a RecordTemplate.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description void
clone(String originalExternalId, String originalComponentId, String cloneExternalId, String cloneComponentId, Map<String,String> attachmentIds)
Clones the given DataRecord.void
copy(ResourceReference fromPK, ResourceReference toPK, RecordTemplate toRecordTemplate, Map<String,String> oldAndNewFileIds)
void
delete(String objectId)
Deletes all form data for the given objectId in all languagesvoid
delete(String objectId, String language)
Deletes form data for the given objectId in the given language onlyvoid
delete(DataRecord record)
Deprecated.use delete(String objectId) instead.DataRecord
getEmptyRecord()
Returns an empty DataRecord built on the RecordTemplate.DataRecord
getRecord(String objectId)
Returns the DataRecord with the given id.DataRecord
getRecord(String objectId, String language)
Returns the DataRecord with the given id.List<DataRecord>
getRecords(String fieldName, String fieldValue)
RecordTemplate
getRecordTemplate()
Returns the RecordTemplate shared by all the DataRecord of this RecordSet.void
indexRecord(String recordId, String formName, FullIndexEntry indexEntry)
Index the given DataRecord into the indexEntry. formName looks like allFields (ie template filename allFields.xml without extension)void
merge(String fromExternalId, String fromComponentId, String toExternalId, String toComponentId, Map<String,String> attachmentIds)
void
move(ResourceReference fromPK, ResourceReference toPK, RecordTemplate toRecordTemplate)
void
save(DataRecord record)
Save the given DataRecord.
-
-
-
Constructor Detail
-
GenericRecordSet
public GenericRecordSet(IdentifiedRecordTemplate recordTemplate)
The generic record set is built upon a RecordTemplate.
-
-
Method Detail
-
getRecordTemplate
public RecordTemplate getRecordTemplate()
Returns the RecordTemplate shared by all the DataRecord of this RecordSet.- Specified by:
getRecordTemplate
in interfaceRecordSet
- Returns:
- the RecordTemplate shared by all the DataRecord of this RecordSet.
-
getEmptyRecord
public DataRecord getEmptyRecord() throws FormException
Returns an empty DataRecord built on the RecordTemplate. This record is not yet managed by this RecordSet. This is only an empty record which must be filled and saved in order to become a DataRecord of this RecordSet.- Specified by:
getEmptyRecord
in interfaceRecordSet
- Returns:
- an empty DataRecord.
- Throws:
FormException
-
getRecord
public DataRecord getRecord(String objectId) throws FormException
Returns the DataRecord with the given id.- Specified by:
getRecord
in interfaceRecordSet
- Returns:
- the DataRecord with the given id.
- Throws:
FormException
- when the id is unknown.
-
getRecord
public DataRecord getRecord(String objectId, String language) throws FormException
Returns the DataRecord with the given id.- Specified by:
getRecord
in interfaceRecordSet
- Returns:
- the DataRecord with the given id.
- Throws:
FormException
- when the id is unknown.
-
getRecords
public List<DataRecord> getRecords(String fieldName, String fieldValue) throws FormException
- Specified by:
getRecords
in interfaceRecordSet
- Throws:
FormException
-
save
public void save(DataRecord record) throws FormException
Save the given DataRecord. If the record id is null then the record is inserted in this RecordSet. Else the record is updated.- Specified by:
save
in interfaceRecordSet
- Throws:
FormException
- when the record doesn't have the required , when the record has an unknown id, when the insert or update fail.
-
indexRecord
public void indexRecord(String recordId, String formName, FullIndexEntry indexEntry) throws FormException
Description copied from interface:RecordSet
Index the given DataRecord into the indexEntry. formName looks like allFields (ie template filename allFields.xml without extension)- Specified by:
indexRecord
in interfaceRecordSet
- Throws:
FormException
-
delete
public void delete(DataRecord record) throws FormException
Deprecated.use delete(String objectId) instead.Deletes the given DataRecord and its associated data in all languages.- Specified by:
delete
in interfaceRecordSet
- Parameters:
record
- the record to delete entirely.- Throws:
FormException
- when the record doesn't have the required template., when the record has an unknown id, when the delete fail.
-
delete
public void delete(String objectId) throws FormException
Deletes all form data for the given objectId in all languages- Specified by:
delete
in interfaceRecordSet
- Throws:
FormException
-
delete
public void delete(String objectId, String language) throws FormException
Deletes form data for the given objectId in the given language only- Specified by:
delete
in interfaceRecordSet
- Throws:
FormException
-
move
public void move(ResourceReference fromPK, ResourceReference toPK, RecordTemplate toRecordTemplate) throws FormException
- Specified by:
move
in interfaceRecordSet
- Throws:
FormException
-
copy
public void copy(ResourceReference fromPK, ResourceReference toPK, RecordTemplate toRecordTemplate, Map<String,String> oldAndNewFileIds) throws FormException
- Specified by:
copy
in interfaceRecordSet
- Throws:
FormException
-
clone
public void clone(String originalExternalId, String originalComponentId, String cloneExternalId, String cloneComponentId, Map<String,String> attachmentIds) throws FormException
Description copied from interface:RecordSet
Clones the given DataRecord. Set to cloneExternalId its externalId and insert it.- Specified by:
clone
in interfaceRecordSet
- Throws:
FormException
-
-