Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

com.RuntimeCollective.sitemap.bean
Class SimplePublishable  view SimplePublishable download SimplePublishable.java

java.lang.Object
  extended bycom.RuntimeCollective.permission.bean.SimplePermissible
      extended bycom.RuntimeCollective.sitemap.bean.SimplePublishable
All Implemented Interfaces:
com.RuntimeCollective.webapps.bean.EntityBean, com.RuntimeCollective.permission.bean.Permissible, com.RuntimeCollective.webapps.bean.PermissionBean, Publishable, java.io.Serializable
Direct Known Subclasses:
SimpleSiteLocation

public class SimplePublishable
extends com.RuntimeCollective.permission.bean.SimplePermissible
implements Publishable

A commodity class which implements all the basic functionality of Publishable, so we can spare duplicating lots of simple code.

It also now reuses SimplePermissible, to let you constrain the access to Publishable items.

This class should be subclassed to add more functionality.

Version:
$Id: SimplePublishable.java,v 1.21 2003/09/30 15:12:59 joe Exp $

Field Summary
protected  boolean AlwaysLive
          Is the object always live, thus ignoring GoLive and GoDead dates ?
static java.lang.String AND_STATUS
           
static java.lang.String DATABASE_TABLE
          The name of the database table for this bean type.
static java.lang.String ESC
           
protected  java.util.Date GoDeadDate
          When the object goes dead
protected  java.util.Date GoLiveDate
          When the object goes live
protected  boolean IsNew
          Is the object New ?
protected  boolean NeedApproval
          Whether the object need to be approved before going live.
static java.lang.String ORDER_BY_LAST_MOD_DATE
           
static java.lang.String SELECT_ID_FROM
           
protected  java.lang.String Status
          The status of this Publishable
protected  java.util.Date StatusLastModifiedDate
          When the object goes live
static java.lang.String WHERE_ALWAYS_LIVE
           
 
Fields inherited from class com.RuntimeCollective.permission.bean.SimplePermissible
DATABASE_PRULEMAP_TABLE, id, PermissionRuleIds
 
Fields inherited from interface com.RuntimeCollective.sitemap.bean.Publishable
STATUS_APPROVED, STATUS_ARCHIVED, STATUS_EDITED, STATUS_TO_BE_APPROVED
 
Fields inherited from interface com.RuntimeCollective.permission.bean.Permissible
EDIT_ACTION, VIEW_ACTION
 
Fields inherited from interface com.RuntimeCollective.webapps.bean.EntityBean
INTERFACE_BEAN, NULL_ID
 
Constructor Summary
SimplePublishable()
          Construct a new blank SimplePublishable, giving it a new unique ID.
SimplePublishable(int id)
          Get a current SimplePublishable from the RuntimeDataSource, given an id.
 
Method Summary
 void checkStillApproved()
           
 void delete()
          Delete this bean from the database.
 boolean getAlwaysLive()
          Get whether the object will be always live
 java.util.Date getGoDeadDate()
          Get the date bean when the object will go dead
 java.util.Date getGoLiveDate()
          Get the date bean when the object will go live
 boolean getIsNew()
          Get whether the object IsNew
 boolean getNeedApproval()
          Get whether the object will be always approved
 java.lang.String getStatus()
          Get the status of this Publishable
 java.util.Date getStatusLastModifiedDate()
          Get the date bean when the object will go live
static java.util.List getToBeApprovedPublishables()
          Get a list of all the publishables which are to be approved, ordered by lastModifiedDate (older first).
 boolean isAlwaysLive()
          Get whether the object will be always live
 boolean isApproved()
           
 boolean isArchived()
           
 boolean isEdited()
          Set/Check for possible statuses
 boolean isLive()
          Check whether the object is live right now
 boolean isNew()
          Get whether the object IsNew
 boolean isToBeApproved()
           
 void markAsApproved()
           
 void markAsArchived()
           
 void markAsEdited()
           
 void markAsToBeApproved()
           
 boolean needsApproval()
          Get whether the object will be always approved
 void publish(java.util.Date liveDate, java.util.Date deadDate)
          Publish this object on (only) one Publishable
 void save()
          Save this bean to the database.
 void saveArchivedData()
          Special save method which only saves the necessary data when archiving the publishable.
 void setAlwaysLive(boolean bool)
          Set whether the object will be always live
 void setGoDeadDate(java.util.Date date)
          Set the date bean when the object will go dead
 void setGoLiveDate(java.util.Date date)
          Set the date bean when the object will go live
 void setIsNew(boolean bool)
          Set whether the object IsNew
 void setNeedApproval(boolean bool)
          Set whether the object will be always approved
 void setStatus(java.lang.String status)
          Set the status of this Publishable
 void setStatusLastModifiedDate(java.util.Date date)
          Set the date bean when the object will go live
 
Methods inherited from class com.RuntimeCollective.permission.bean.SimplePermissible
canEdit, canPerformAction, canView, getActionPermissionRule, getActions, getAuthorisationPathForAction, getAuthorisationPathForAction, getId, loadRules, removeActionPermissionRule, saveRules, setActionPermissionRule, setId
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.RuntimeCollective.permission.bean.Permissible
canEdit, canPerformAction, canView, getActionPermissionRule, getActions, getAuthorisationPathForAction, getAuthorisationPathForAction, getId, setActionPermissionRule, setId
 

Field Detail

SELECT_ID_FROM

public static final java.lang.String SELECT_ID_FROM
See Also:
Constant Field Values

WHERE_ALWAYS_LIVE

public static final java.lang.String WHERE_ALWAYS_LIVE
See Also:
Constant Field Values

AND_STATUS

public static final java.lang.String AND_STATUS
See Also:
Constant Field Values

ORDER_BY_LAST_MOD_DATE

public static final java.lang.String ORDER_BY_LAST_MOD_DATE
See Also:
Constant Field Values

ESC

public static final java.lang.String ESC
See Also:
Constant Field Values

DATABASE_TABLE

public static final java.lang.String DATABASE_TABLE
The name of the database table for this bean type.

See Also:
Constant Field Values

GoLiveDate

protected java.util.Date GoLiveDate
When the object goes live


GoDeadDate

protected java.util.Date GoDeadDate
When the object goes dead


AlwaysLive

protected boolean AlwaysLive
Is the object always live, thus ignoring GoLive and GoDead dates ?


NeedApproval

protected boolean NeedApproval
Whether the object need to be approved before going live. If not, ignores markAsEdited, markAsToBeApproved, and setStatus to anything other than STATUS_APPROVED or STATUS_ARCHIVED.

NOTE: Setting needApproval to false will not change the Publishable's status right away. It's possible to setNeedApproval(true), markAsEdited(), then setNeedApproval(false); the Publishable will then be have STATUS_EDITED, but cannot be put back into this state later.


Status

protected java.lang.String Status
The status of this Publishable


StatusLastModifiedDate

protected java.util.Date StatusLastModifiedDate
When the object goes live


IsNew

protected boolean IsNew
Is the object New ?

Constructor Detail

SimplePublishable

public SimplePublishable()
Construct a new blank SimplePublishable, giving it a new unique ID.


SimplePublishable

public SimplePublishable(int id)
Get a current SimplePublishable from the RuntimeDataSource, given an id.

Method Detail

save

public void save()
Save this bean to the database.

Specified by:
save in interface com.RuntimeCollective.permission.bean.Permissible

saveArchivedData

public void saveArchivedData()
Special save method which only saves the necessary data when archiving the publishable. This supposes the object has been already saved. The saved data is : Status, StatusLastModifiedDate.

Specified by:
saveArchivedData in interface Publishable

delete

public void delete()
Delete this bean from the database.

Specified by:
delete in interface com.RuntimeCollective.permission.bean.Permissible

setGoLiveDate

public void setGoLiveDate(java.util.Date date)
Set the date bean when the object will go live

Specified by:
setGoLiveDate in interface Publishable

getGoLiveDate

public java.util.Date getGoLiveDate()
Get the date bean when the object will go live

Specified by:
getGoLiveDate in interface Publishable

setGoDeadDate

public void setGoDeadDate(java.util.Date date)
Set the date bean when the object will go dead

Specified by:
setGoDeadDate in interface Publishable

getGoDeadDate

public java.util.Date getGoDeadDate()
Get the date bean when the object will go dead

Specified by:
getGoDeadDate in interface Publishable

publish

public void publish(java.util.Date liveDate,
                    java.util.Date deadDate)
Publish this object on (only) one Publishable

Specified by:
publish in interface Publishable

setAlwaysLive

public void setAlwaysLive(boolean bool)
Set whether the object will be always live

Specified by:
setAlwaysLive in interface Publishable

getAlwaysLive

public boolean getAlwaysLive()
Get whether the object will be always live

Specified by:
getAlwaysLive in interface Publishable

isAlwaysLive

public boolean isAlwaysLive()
Get whether the object will be always live

Specified by:
isAlwaysLive in interface Publishable

setNeedApproval

public void setNeedApproval(boolean bool)
Set whether the object will be always approved

Specified by:
setNeedApproval in interface Publishable

getNeedApproval

public boolean getNeedApproval()
Get whether the object will be always approved

Specified by:
getNeedApproval in interface Publishable

needsApproval

public boolean needsApproval()
Get whether the object will be always approved

Specified by:
needsApproval in interface Publishable

setStatus

public void setStatus(java.lang.String status)
Set the status of this Publishable

Specified by:
setStatus in interface Publishable

getStatus

public java.lang.String getStatus()
Get the status of this Publishable

Specified by:
getStatus in interface Publishable

setStatusLastModifiedDate

public void setStatusLastModifiedDate(java.util.Date date)
Set the date bean when the object will go live

Specified by:
setStatusLastModifiedDate in interface Publishable

getStatusLastModifiedDate

public java.util.Date getStatusLastModifiedDate()
Get the date bean when the object will go live

Specified by:
getStatusLastModifiedDate in interface Publishable

isEdited

public boolean isEdited()
Set/Check for possible statuses

Specified by:
isEdited in interface Publishable

isToBeApproved

public boolean isToBeApproved()
Specified by:
isToBeApproved in interface Publishable

isApproved

public boolean isApproved()
Specified by:
isApproved in interface Publishable

isArchived

public boolean isArchived()
Specified by:
isArchived in interface Publishable

markAsEdited

public void markAsEdited()
Specified by:
markAsEdited in interface Publishable

markAsToBeApproved

public void markAsToBeApproved()
Specified by:
markAsToBeApproved in interface Publishable

markAsApproved

public void markAsApproved()
Specified by:
markAsApproved in interface Publishable

markAsArchived

public void markAsArchived()
Specified by:
markAsArchived in interface Publishable

checkStillApproved

public void checkStillApproved()

setIsNew

public void setIsNew(boolean bool)
Set whether the object IsNew

Specified by:
setIsNew in interface Publishable

getIsNew

public boolean getIsNew()
Get whether the object IsNew

Specified by:
getIsNew in interface Publishable

isNew

public boolean isNew()
Get whether the object IsNew

Specified by:
isNew in interface Publishable

isLive

public boolean isLive()
Check whether the object is live right now

Specified by:
isLive in interface Publishable

getToBeApprovedPublishables

public static java.util.List getToBeApprovedPublishables()
Get a list of all the publishables which are to be approved, ordered by lastModifiedDate (older first).