Package com.terminalfour.publish.data

The data package contains data objects relating to publish.

In general these are read-only equivalents of entities used throughout the Terminalfour application, although in some instances, transformations are carried out to better match to the tasks required during publish.

All standard data objects implement the IPDData interface, which provides a single default method called exists(). This default method always returns true.

The Publish API has been designed in such a way as to minimize the potential for NullPointerExceptions. As such, in cases where data objects cannot be found, a skeleton data object that implements the IPDNotFound interface is returned. This interface extends the IPDData interface and overrides the default exists method, altering it to instead return false.

Consider the instance where there is no Content Item in the application with an id of 5432456. Attempting to load the Content Item will result in the com.terminalfour.publish.data.PDContentListItem#NOT_FOUND instance being returned.

var contentItem = apis.getContent ().get (5432456); if (contentItem.exists ()) return "The Content item was found"; else return "The Content item could not be found";