com.flexive.shared.content
Class FxContentVersionInfo

java.lang.Object
  extended by com.flexive.shared.content.FxContentVersionInfo
All Implemented Interfaces:
java.io.Serializable

public class FxContentVersionInfo
extends java.lang.Object
implements java.io.Serializable

Information about a content's existing versions

Author:
Markus Plesser (markus.plesser@flexive.com), UCS - unique computing solutions gmbh (http://www.ucs.at)
See Also:
Serialized Form

Nested Class Summary
(package private) static class FxContentVersionInfo.NewLifeCycleInfoImpl
          Temp.
static class FxContentVersionInfo.VersionData
           
static class FxContentVersionInfo.VersionSelector
          Selector for versions (helps with EL)
 
Constructor Summary
FxContentVersionInfo(long id, int minVersion, int maxVersion, int liveVersion, int lastModifiedVersion, java.util.Map<java.lang.Integer,FxContentVersionInfo.VersionData> versions)
          Ctor
 
Method Summary
 boolean containsVersion(FxPK pk)
          Check if the requested Pk's version exists
static FxContentVersionInfo createEmpty()
          Create an empty version info for new FxContent instances using the calling user as creator
 int getDistinctVersion(int version)
          Get the correct maximum or live version if version is version constant from FxPK
 long getId()
          Get the id of the instance
 int getLastModifiedVersion()
          Get the version that was changed most recently
 LifeCycleInfo getLifeCycleInfo(int version)
          Get the LifeCycleInfo for a requested version or null if the requested version does not exist
 int getLiveVersion()
          Get the live version.
 int getMaxVersion()
          Get the maximum existing version
 int getMinVersion()
          Get the minimum existing version
 long getStep(int version)
          Get the step id for a requested version or null if the requested version does not exist
 int getVersionCount()
          How many versions exist?
 FxContentVersionInfo.VersionData getVersionData(int version)
          Get the VersionData for a requested version or null if the requested version does not exist
 java.lang.Integer[] getVersions()
          Get an array for all available versions (sorted)
 FxContentVersionInfo.VersionSelector getVersionSelector()
          Get the version selector
 boolean hasLiveVersion()
          Does a live version exist for this content instance
 boolean isHasLiveVersion()
          Does a live version exist for this content instance (EL compatible variant)
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

FxContentVersionInfo

public FxContentVersionInfo(long id,
                            int minVersion,
                            int maxVersion,
                            int liveVersion,
                            int lastModifiedVersion,
                            java.util.Map<java.lang.Integer,FxContentVersionInfo.VersionData> versions)
Ctor

Parameters:
id - instance id
minVersion - minimum existing version
maxVersion - maximum existing version
liveVersion - live version (if not exists: -1)
lastModifiedVersion - version that has the latest modification date
versions - map of version,LifeCycleInfo entries
Method Detail

getId

public long getId()
Get the id of the instance

Returns:
id of the instance

getMinVersion

public int getMinVersion()
Get the minimum existing version

Returns:
minimum existing version

getMaxVersion

public int getMaxVersion()
Get the maximum existing version

Returns:
maximum existing version

getLiveVersion

public int getLiveVersion()
Get the live version. if no live version exists then -1 is returned

Returns:
live version or -1

hasLiveVersion

public boolean hasLiveVersion()
Does a live version exist for this content instance

Returns:
if a live version exists for this content instance

isHasLiveVersion

public boolean isHasLiveVersion()
Does a live version exist for this content instance (EL compatible variant)

Returns:
if a live version exists for this content instance
See Also:
hasLiveVersion()

getLastModifiedVersion

public int getLastModifiedVersion()
Get the version that was changed most recently

Returns:
version that was changed most recently

getVersions

public java.lang.Integer[] getVersions()
Get an array for all available versions (sorted)

Returns:
array for all available versions (sorted)

getVersionCount

public int getVersionCount()
How many versions exist?

Returns:
number of versions

getVersionSelector

public FxContentVersionInfo.VersionSelector getVersionSelector()
Get the version selector

Returns:
VersionSelector

getVersionData

public FxContentVersionInfo.VersionData getVersionData(int version)
Get the VersionData for a requested version or null if the requested version does not exist

Parameters:
version - the requested version
Returns:
VersionData for a requested version or null if the requested version does not exist

getLifeCycleInfo

public LifeCycleInfo getLifeCycleInfo(int version)
Get the LifeCycleInfo for a requested version or null if the requested version does not exist

Parameters:
version - the requested version
Returns:
LifeCycleInfo for a requested version or null if the requested version does not exist

getStep

public long getStep(int version)
Get the step id for a requested version or null if the requested version does not exist

Parameters:
version - the requested version
Returns:
step id for a requested version or null if the requested version does not exist

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

containsVersion

public boolean containsVersion(FxPK pk)
Check if the requested Pk's version exists

Parameters:
pk - primary key
Returns:
if the requested Pk's version exists

getDistinctVersion

public int getDistinctVersion(int version)
Get the correct maximum or live version if version is version constant from FxPK

Parameters:
version - the requested version
Returns:
distinct version

createEmpty

public static FxContentVersionInfo createEmpty()
Create an empty version info for new FxContent instances using the calling user as creator

Returns:
an empty version info for new FxContent instances