|
|||||||||
| Home >> All >> com >> RuntimeCollective >> webapps >> [ bean overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
com.RuntimeCollective.webapps.bean
Class VersionedExtension

java.lang.Objectcom.RuntimeCollective.webapps.bean.VersionedExtension
- All Implemented Interfaces:
- Duplicable, EntityBean, java.io.Serializable, Versioned
- public class VersionedExtension
- extends java.lang.Object
- implements Versioned
- extends java.lang.Object
An extension which can be used to stick the Versioned behaviour to any Duplicable bean. This also adds a VersionNotes property to each version.
- Version:
- $Id: VersionedExtension.java,v 1.5 2003/09/30 15:13:10 joe Exp $
| Field Summary | |
static java.lang.String |
DATABASE_TABLE
|
private static java.lang.String |
DELETE_FROM
|
protected int |
duplicableId
The id of the Duplicable this VersionedExtension is for. |
private static java.lang.String |
EMPTY_STRING
|
private static java.lang.String |
ESC
|
private static java.lang.String |
FIELD_DUPLICABLE_ID
|
private static java.lang.String |
FIELD_VNOTES
|
private static java.lang.String |
FIELD_VREF
|
private static java.lang.String |
FIELD_VTAG
|
protected int |
id
|
private static java.lang.String |
SELECT_DATA
|
private static java.lang.String |
SELECT_ID
|
private static java.lang.String |
SELECT_ID_TAG
|
private static java.lang.String |
SPACE
|
protected java.lang.String |
versionNotes
|
protected int |
versionReference
The Reference of this Version, that is, the id of the first object in the family of versions. |
protected java.util.HashMap |
versionsCache
A HashMap of all version ids for this object, and their version tag. |
protected java.lang.String |
versionTag
|
private static java.lang.String |
WHERE_DUPLICABLE_ID
|
private static java.lang.String |
WHERE_ID
|
private static java.lang.String |
WHERE_VER_REF
|
| Fields inherited from interface com.RuntimeCollective.webapps.bean.Versioned |
ARCHIVED_TAG, LIVE_TAG, TRUNK_TAG |
| Fields inherited from interface com.RuntimeCollective.webapps.bean.EntityBean |
INTERFACE_BEAN, NULL_ID |
| Constructor Summary | |
VersionedExtension()
Constructs a new blank bean with a unique id. |
|
VersionedExtension(int id)
Gets a bean from the RuntimeDataSource, given an id. |
|
| Method Summary | |
Versioned |
createOrReplaceVersion(java.lang.String referenceVersionTag,
java.lang.String newVersionTag)
Create and save a new version of this object based on a existing one, and tag it with the specified tag. |
Duplicable |
customiseDuplicate(Duplicable duplicate)
This is not implemented - we *could* make VersionedExtension properly Duplicable... |
void |
delete()
Delete this bean from the database. |
Duplicable |
getDuplicable()
Gets the duplicable. |
static VersionedExtension |
getFor(Duplicable duplicable)
Gets the VersionedExtension for a particular duplicable, if one exists. |
int |
getId()
Get the unique id of this bean instance. |
static VersionedExtension |
getOrCreateFor(Duplicable duplicable)
Gets the VersionedExtension for a particular bean, or create a TRUNK_TAG VersionedExtension if there is none. |
Versioned |
getVersion(java.lang.String aVersionTag)
Get an existing version of this object. |
java.util.List |
getVersionList()
Get the List of all versions, in unspecified order. |
java.lang.String |
getVersionNotes()
|
int |
getVersionReference()
Get the Reference of this Version, that is, the id of the first object in the family of versions. |
java.lang.String |
getVersionTag()
Get the Tag of this Version. |
java.util.List |
getVersionTagList()
Get the List of all version tags for this VersionedExtension, ie for this Duplicable. |
Duplicable |
makeDuplicate()
This is not implemented - we *could* make VersionedExtension properly Duplicable... |
Duplicable |
makeDuplicate(int duplicateId)
This is not implemented - we *could* make VersionedExtension properly Duplicable... |
void |
populateAsTrunkOf(Duplicable duplicable)
This method, not often used, populates the Extension like it is the TRUNK of the given Duplicable. |
protected java.util.HashMap |
readVersionsCache()
Read from the database the list of VersionTags which exist for that VersionedExtension, that is for that Duplicable, really. |
protected void |
refreshVersionsCache(boolean allVersions)
Refresh the cache of VersionTags, for this object and all its versions |
void |
save()
Save this bean in the database. |
void |
setDuplicable(Duplicable duplicable)
Sets the duplicable. |
void |
setId(int id)
Set the unique id of this bean instance. |
void |
setVersionNotes(java.lang.String notes)
|
void |
setVersionReference(int reference)
Set the Reference of this Version, that is, the id of the first object in the family of versions. |
protected void |
setVersionsCache(java.util.HashMap map)
|
void |
setVersionTag(java.lang.String tag)
Set the Tag of this Version. |
java.lang.String |
toString()
Convert this Object to a human-readable String. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
SELECT_ID
private static final java.lang.String SELECT_ID
- See Also:
- Constant Field Values
WHERE_DUPLICABLE_ID
private static final java.lang.String WHERE_DUPLICABLE_ID
- See Also:
- Constant Field Values
DELETE_FROM
private static final java.lang.String DELETE_FROM
- See Also:
- Constant Field Values
WHERE_ID
private static final java.lang.String WHERE_ID
- See Also:
- Constant Field Values
SELECT_DATA
private static final java.lang.String SELECT_DATA
- See Also:
- Constant Field Values
SELECT_ID_TAG
private static final java.lang.String SELECT_ID_TAG
- See Also:
- Constant Field Values
WHERE_VER_REF
private static final java.lang.String WHERE_VER_REF
- See Also:
- Constant Field Values
ESC
private static final java.lang.String ESC
- See Also:
- Constant Field Values
EMPTY_STRING
private static final java.lang.String EMPTY_STRING
- See Also:
- Constant Field Values
SPACE
private static final java.lang.String SPACE
- See Also:
- Constant Field Values
DATABASE_TABLE
public static final java.lang.String DATABASE_TABLE
- See Also:
- Constant Field Values
FIELD_DUPLICABLE_ID
private static final java.lang.String FIELD_DUPLICABLE_ID
- See Also:
- Constant Field Values
FIELD_VTAG
private static final java.lang.String FIELD_VTAG
- See Also:
- Constant Field Values
FIELD_VREF
private static final java.lang.String FIELD_VREF
- See Also:
- Constant Field Values
FIELD_VNOTES
private static final java.lang.String FIELD_VNOTES
- See Also:
- Constant Field Values
id
protected int id
versionReference
protected int versionReference
- The Reference of this Version, that is,
the id of the first object in the family of versions.
versionTag
protected java.lang.String versionTag
versionNotes
protected java.lang.String versionNotes
versionsCache
protected java.util.HashMap versionsCache
- A HashMap of all version ids for this object, and their version tag.
duplicableId
protected int duplicableId
- The id of the Duplicable this VersionedExtension is for.
| Constructor Detail |
VersionedExtension
public VersionedExtension()
throws java.sql.SQLException
- Constructs a new blank bean with a unique id.
VersionedExtension
public VersionedExtension(int id)
throws java.sql.SQLException
- Gets a bean from the RuntimeDataSource, given an id.
| Method Detail |
setId
public void setId(int id)
- Description copied from interface:
EntityBean - Set the unique id of this bean instance.
- Specified by:
setIdin interfaceEntityBean
getId
public int getId()
- Description copied from interface:
EntityBean - Get the unique id of this bean instance.
- Specified by:
getIdin interfaceEntityBean
save
public void save()
- Save this bean in the database.
- Specified by:
savein interfaceEntityBean
delete
public void delete()
- Delete this bean from the database.
- Specified by:
deletein interfaceEntityBean
makeDuplicate
public Duplicable makeDuplicate()
- This is not implemented - we *could* make VersionedExtension properly Duplicable...
- Specified by:
makeDuplicatein interfaceDuplicable
makeDuplicate
public Duplicable makeDuplicate(int duplicateId)
- This is not implemented - we *could* make VersionedExtension properly Duplicable...
- Specified by:
makeDuplicatein interfaceDuplicable
customiseDuplicate
public Duplicable customiseDuplicate(Duplicable duplicate)
- This is not implemented - we *could* make VersionedExtension properly Duplicable...
- Specified by:
customiseDuplicatein interfaceDuplicable
setVersionReference
public void setVersionReference(int reference)
- Description copied from interface:
Versioned - Set the Reference of this Version, that is,
the id of the first object in the family of versions.
This should not really be called directly.
This Reference version should *not* be deleted, otherwise all other versions will get scattered.
- Specified by:
setVersionReferencein interfaceVersioned
getVersionReference
public int getVersionReference()
- Description copied from interface:
Versioned - Get the Reference of this Version, that is,
the id of the first object in the family of versions.
- Specified by:
getVersionReferencein interfaceVersioned
setVersionTag
public void setVersionTag(java.lang.String tag)
- Description copied from interface:
Versioned - Set the Tag of this Version.
This should not really be called directly.
- Specified by:
setVersionTagin interfaceVersioned
getVersionTag
public java.lang.String getVersionTag()
- Description copied from interface:
Versioned - Get the Tag of this Version.
- Specified by:
getVersionTagin interfaceVersioned
setVersionNotes
public void setVersionNotes(java.lang.String notes)
getVersionNotes
public java.lang.String getVersionNotes()
getVersionTagList
public java.util.List getVersionTagList()
- Get the List of all version tags for this VersionedExtension,
ie for this Duplicable.
- Specified by:
getVersionTagListin interfaceVersioned
getVersionList
public java.util.List getVersionList()
- Get the List of all versions, in unspecified order.
FIXME: this should be trickled up to the Versioned interface.
createOrReplaceVersion
public Versioned createOrReplaceVersion(java.lang.String referenceVersionTag, java.lang.String newVersionTag)
- Create and save a new version of this object based on a existing one,
and tag it with the specified tag. If a version with the newVersionTag
already exists, it will be overwritten - ie its id will be reused.
The reference version should already exist, otherwise this method will do nothing and return "null".
A version with the newVersionTag may or may not exist: if it doesn't, it will be created - if it does, it will be overwritten.Note the new/updated Duplicable and VersionedExtension are both saved.
- Specified by:
createOrReplaceVersionin interfaceVersioned
getVersion
public Versioned getVersion(java.lang.String aVersionTag)
- Get an existing version of this object.
The version should already exist. It is doesn't, then this method will do nothing and return "null".
- Specified by:
getVersionin interfaceVersioned
setVersionsCache
protected void setVersionsCache(java.util.HashMap map)
refreshVersionsCache
protected void refreshVersionsCache(boolean allVersions)
- Refresh the cache of VersionTags, for this object and all its versions
readVersionsCache
protected java.util.HashMap readVersionsCache()
- Read from the database the list of VersionTags which exist
for that VersionedExtension, that is for that Duplicable, really.
getDuplicable
public Duplicable getDuplicable()
- Gets the duplicable.
setDuplicable
public void setDuplicable(Duplicable duplicable)
- Sets the duplicable.
toString
public java.lang.String toString()
- Description copied from class:
java.lang.Object - Convert this Object to a human-readable String.
There are no limits placed on how long this String
should be or what it should contain. We suggest you
make it as intuitive as possible to be able to place
it into System.out.println() 55
and such.
It is typical, but not required, to ensure that this method never completes abruptly with a java.lang.RuntimeException.
This method will be called when performing string concatenation with this object. If the result is
null, string concatenation will instead use"null".The default implementation returns
getClass().getName() + "@" + Integer.toHexString(hashCode()).
getFor
public static VersionedExtension getFor(Duplicable duplicable)
- Gets the VersionedExtension for a particular duplicable, if one exists.
getOrCreateFor
public static VersionedExtension getOrCreateFor(Duplicable duplicable)
- Gets the VersionedExtension for a particular bean,
or create a TRUNK_TAG VersionedExtension if there is none.
NOTE: newly created VersionedExtension objects are NOT saved - you'll need to do that.
populateAsTrunkOf
public void populateAsTrunkOf(Duplicable duplicable)
- This method, not often used, populates the Extension
like it is the TRUNK of the given Duplicable.
This is called by getOrCreateFor when creating.
|
|||||||||
| Home >> All >> com >> RuntimeCollective >> webapps >> [ bean overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
JAVADOC
com.RuntimeCollective.webapps.bean.VersionedExtension