com.silverpeas.form.record
Class GenericRecordSet

java.lang.Object
  extended by com.silverpeas.form.record.GenericRecordSet
All Implemented Interfaces:
RecordSet, Serializable

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
GenericRecordSet(IdentifiedRecordTemplate recordTemplate)
          The generic record set is built upon a RecordTemplate.
 
Method Summary
 void clone(String originalExternalId, String originalComponentId, String cloneExternalId, String cloneComponentId, Map<String,String> attachmentIds)
          Clones the given DataRecord.
 void copy(ForeignPK fromPK, ForeignPK toPK, RecordTemplate toRecordTemplate, Map<String,String> oldAndNewFileIds)
           
 void delete(DataRecord record)
          Deletes the given DataRecord and set to null its id.
 void delete(String objectId)
           
 DataRecord getEmptyRecord()
          Returns an empty DataRecord built on the RecordTemplate.
protected  GenericRecordSetManager getGenericRecordSetManager()
          Gets an instance of a GenericRecordSet objects manager.
 DataRecord getRecord(String objectId)
          Returns the DataRecord with the given id.
 DataRecord getRecord(String objectId, String language)
          Returns the DataRecord with the given id.
 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(ForeignPK fromPK, ForeignPK toPK, RecordTemplate toRecordTemplate)
           
 void save(DataRecord record)
          Save the given DataRecord.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

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 interface RecordSet
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 interface RecordSet
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 interface RecordSet
Parameters:
objectId -
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 interface RecordSet
Parameters:
objectId -
language -
Returns:
the DataRecord with the given id.
Throws:
FormException - when the id is unknown.

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 interface RecordSet
Parameters:
record -
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 interface RecordSet
Throws:
FormException

delete

public void delete(DataRecord record)
            throws FormException
Deletes the given DataRecord and set to null its id.

Specified by:
delete in interface RecordSet
Parameters:
record -
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
Specified by:
delete in interface RecordSet
Throws:
FormException

move

public void move(ForeignPK fromPK,
                 ForeignPK toPK,
                 RecordTemplate toRecordTemplate)
          throws FormException
Specified by:
move in interface RecordSet
Throws:
FormException

copy

public void copy(ForeignPK fromPK,
                 ForeignPK toPK,
                 RecordTemplate toRecordTemplate,
                 Map<String,String> oldAndNewFileIds)
          throws FormException
Specified by:
copy in interface RecordSet
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 interface RecordSet
Throws:
FormException

merge

public void merge(String fromExternalId,
                  String fromComponentId,
                  String toExternalId,
                  String toComponentId,
                  Map<String,String> attachmentIds)
           throws FormException
Specified by:
merge in interface RecordSet
Throws:
FormException

getGenericRecordSetManager

protected GenericRecordSetManager getGenericRecordSetManager()
Gets an instance of a GenericRecordSet objects manager.

Returns:
a GenericRecordSetManager instance.


Copyright © 2016 Silverpeas. All Rights Reserved.