public abstract class PresentationArticleDecorator extends AbstractPresentationArticle
getUrl()
can be changed to add the article
title to the article URL. Note: If you plan to use Memcached
to cache articles, the decorator will need to be serializable.
Modifier and Type | Field and Description |
---|---|
static String |
CLASS_VERSION
The version of this class.
|
COM_ESCENIC_PRESENTATION_INTERNAL
Constructor and Description |
---|
PresentationArticleDecorator()
Constructs a empty
PresentationArticleDecorator . |
PresentationArticleDecorator(PresentationArticle pPresentationArticle)
Constructs a
PresentationArticleDecorator with the
PresentationArticle instance to decorate. |
Modifier and Type | Method and Description |
---|---|
String |
getActivatedDate(String formated,
Locale locale)
Returns a formatted String of the activation date.
|
Date |
getActivatedDateAsDate()
Returns the date this content item was activated.
|
AgreementInfo |
getAgreementInfo()
Returns this content item's agreement information or
null if the content item has no agreement. |
List |
getArticles()
Returns all the content items related to this content item.
|
List |
getArticles(Set pArticleTypes)
Returns all the content items of the specified types that is related to this content item.
|
String |
getArticleTypeName()
Returns the type of this content item (as defined in the
content-type resource). |
List |
getAuthors()
Returns all the authors of this content item.
|
String |
getCreatedDate(String formated,
Locale locale)
Returns a formatted String of the creation date.
|
Date |
getCreatedDateAsDate()
Returns the date this content item was created.
|
String |
getExpireDate(String formated,
Locale locale)
Returns a formatted date of when this content item is due to expire.
|
Date |
getExpireDateAsDate()
Returns the date on which this content item expired/will expire.
|
String |
getFieldElement(String pKey)
Gets the string value of the specified content item fields.
|
String |
getFieldElementDefaultValue(String pKey)
Default value of the content item text field.
|
List<String> |
getFieldNames()
Returns the names of all this content item's fields.
|
Map<String,PresentationProperty<?>> |
getFields()
Returns all the fields in this content item.
|
String |
getFirstPublishedDate(String formated,
Locale locale)
Returns a formatted date of when this content item was first published
The date will be formatted using the supplied format and locale.
|
Date |
getFirstPublishedDateAsDate()
Returns the date on which this content item was first published.
|
IOHashKey |
getHashKey()
Returns the hash key of this object.
|
Section |
getHomeSection()
Returns the home section of this content item.
|
int |
getId()
Returns the id of the presentation object
|
Map<String,PresentationElement> |
getInlineElements()
Returns a
Map of all inline elements for this content item. |
String |
getLastModifiedDate(String formated,
Locale locale)
Returns a formatted date of when this content item was last modified.
|
Date |
getLastModifiedDateAsDate()
Returns the date on which this content item was last modified.
|
Section |
getOwnerHomeSection()
Returns the owner home section of this content item.
|
String |
getOwnerUrl()
Returns the absolute URL of this content item in its owning home section.
|
Collection |
getPersons()
Returns all the persons related to this content item.
|
String |
getPreviewToken()
Returns the preview token
|
int |
getPriority()
The priority of this content item.
|
List<PresentationPerson> |
getProfilePersons()
Returns a list of all the persons related to this content item where the relation type is profile.
|
Publication |
getPublication()
Returns the publication this content item belongs to.
|
int |
getPublicationId()
Returns the database id of the publication this content item belongs to.
|
String |
getPublishedDate(String formated,
Locale locale)
Returns a formatted date of when this content item was last published
The date will be formatted using the supplied format and locale.
|
Date |
getPublishedDateAsDate()
Returns the date on which this content item was last published.
|
Map<String,PresentationElement> |
getRelatedElements()
Returns a Map from relation type to a
PresentationElement that holds the relations to this object. |
Set<PresentationElement> |
getRelatedElements(Set<String> pContentTypes)
Returns a Set of related PresentationElements of the given content types.
|
URI |
getRelativeURI()
Returns the URL of this content item relative to its section.
|
String |
getRelativeUrl()
Returns the URL of this content item relative to its section.
|
List |
getSectionsList()
Returns the sections this content item belongs to.
|
String |
getSource()
Returns the name of the external source of an imported content item.
|
String |
getSourceId()
Returns the id of the external source of an imported content item.
|
String |
getStateChangedDate(String formated,
Locale locale)
Returns a formatted date of when this content item's state was updated
The date will be formatted using the supplied format and locale.
|
Date |
getStateChangedDateAsDate()
Returns the date on which the state of this content item last changed.
|
String |
getStateName()
Returns the state of this content item.
|
List<PresentationTag> |
getTags()
Returns a List of presentation tags.
|
String |
getTitle()
Returns the title of this content item.
|
String |
getUrl()
Returns the absolute URL of this content item.
|
void |
initPresentationArticle(PresentationArticle pPresentationArticle)
Initializes the
PresentationArticleDecorator with the
PresentationArticle instance to decorate. |
boolean |
inSection(int pSectionId)
Check to see if the content item is in the given section.
|
boolean |
inSection(Section pSection)
Check to see if the content item is in the given section.
|
boolean |
isAgreementRequired()
Returns
true if an agreement is required to view this content item,
otherwise false . |
boolean |
isLive()
Returns
true if this content item is published and active and its home section is published,
otherwise false . |
boolean |
isOwner()
Returns
true if this content item is in its owning publication, false if
it is a cross-published content item that is being accessed from a foreign publication. |
boolean |
isPreview()
Checks whether the presentation article is a preview or not
returns true if the presentation article is a preview
|
protected PresentationProperty |
load(String pKey)
An extension point for subclasses in need of overriding one or more field values.
|
getActivatedDate, getActivatedDate, getActivatedDate, getArticleId, getArticlesCount, getArticlesCount, getAuthor, getAuthorsCount, getCreatedDate, getCreatedDate, getCreatedDate, getExpireDate, getExpireDate, getExpireDate, getFirstPublishedDate, getFirstPublishedDate, getFirstPublishedDate, getLastModifiedDate, getLastModifiedDate, getLastModifiedDate, getPersonsCount, getPublishedDate, getPublishedDate, getPublishedDate, getSections, getStateChangedDate, getStateChangedDate, getStateChangedDate
public static final String CLASS_VERSION
public PresentationArticleDecorator()
Constructs a empty PresentationArticleDecorator
. You have to
invoke initPresentationArticle(PresentationArticle)
before it
can be used to something.
public PresentationArticleDecorator(PresentationArticle pPresentationArticle)
Constructs a PresentationArticleDecorator
with the
PresentationArticle
instance to decorate.
IllegalArgumentException
- If invoked with 'null' as the argument.protected PresentationProperty load(String pKey) throws Exception
pKey
- The name of the field. The key will be in the same case as defined in the templates.PresentationProperty
representing the value of the field. This should never be null
Exception
- if loading the field failedpublic final void initPresentationArticle(PresentationArticle pPresentationArticle)
Initializes the PresentationArticleDecorator
with the
PresentationArticle
instance to decorate.
Can't set the PresentationArticle
more than once in each instance
of this decorator.
This method is also invoked from the constructor
PresentationArticleDecorator(PresentationArticle)
.
pPresentationArticle
- the PresentationArticle instance to decorate.IllegalStateException
- If invoked more than once.IllegalArgumentException
- If invoked with 'null' as the argument.public Date getActivatedDateAsDate()
PresentationArticle
public String getActivatedDate(String formated, Locale locale)
PresentationArticle
PresentationArticle.getActivatedDate()
instead.formated
- how the date will be formatted. The given string defined by SimpleDateFormat
E.G: "yyyy-MM-dd'T'HH:mm:ss.SSSZ".
If you do not supply a value (null
), the date is formatted specified by DateFormat.SHORT
.locale
- in which locale the date will be resolved.
If you do not supply a value (null
), the date is resolved with the server's default locale.public Date getCreatedDateAsDate()
PresentationArticle
public Date getExpireDateAsDate()
PresentationArticle
public Date getFirstPublishedDateAsDate()
PresentationArticle
public Date getLastModifiedDateAsDate()
PresentationArticle
public Date getPublishedDateAsDate()
PresentationArticle
PresentationArticle.getPublishedDate()
public Date getStateChangedDateAsDate()
PresentationArticle
public String getCreatedDate(String formated, Locale locale)
PresentationArticle
PresentationArticle.getCreatedDate()
instead.formated
- how the date will be formatted. The given string defined by SimpleDateFormat
E.G: "yyyy-MM-dd'T'HH:mm:ss.SSSZ".
If you do not supply a value (null
), the date is formatted specified by DateFormat.SHORT
.locale
- in which locale the date will be resolved.
If you do not supply a value (null
), the date is resolved with the server's default locale.public String getExpireDate(String formated, Locale locale)
PresentationArticle
PresentationArticle.getCreatedDate()
instead.formated
- how the date will be formatted. The given string defined by SimpleDateFormat
E.G: "yyyy-MM-dd'T'HH:mm:ss.SSSZ".
If you do not supply a value (null
), the date is formatted specified by DateFormat.SHORT
.locale
- in which locale the date will be resolved.
If you do not supply a value (null
), the date is resolved with the server's default locale.public String getFirstPublishedDate(String formated, Locale locale)
PresentationArticle
PresentationArticle.getFirstPublishedDate()
instead.formated
- how the date will be formatted. The given string defined by SimpleDateFormat
E.G: "yyyy-MM-dd'T'HH:mm:ss.SSSZ".
If you do not supply a value (null
), the date is formatted specified by DateFormat.SHORT
.locale
- in which locale the date will be resolved.
If you do not supply a value (null
), the date is resolved with the server's default locale.public String getLastModifiedDate(String formated, Locale locale)
PresentationArticle
PresentationArticle.getLastModifiedDate()
instead.formated
- how the date will be formatted. The given string defined by SimpleDateFormat
E.G: "yyyy-MM-dd'T'HH:mm:ss.SSSZ".
If you do not supply a value (null
), the date is formatted specified by DateFormat.SHORT
.locale
- in which locale the date will be resolved.
If you do not supply a value (null
), the date is resolved with the server's default locale.public String getPublishedDate(String formated, Locale locale)
PresentationArticle
PresentationArticle.getPublishedDate()
instead.formated
- how the date will be formatted. The given string defined by SimpleDateFormat
E.G: "yyyy-MM-dd'T'HH:mm:ss.SSSZ".
If you do not supply a value (null
), the date is formatted specified by DateFormat.SHORT
.locale
- in which locale the date will be resolved.
If you do not supply a value (null
), the date is resolved with the server's default locale.public String getStateChangedDate(String formated, Locale locale)
PresentationArticle
PresentationArticle.getStateChangedDate()
instead.formated
- how the date will be formatted. The given string defined by SimpleDateFormat
E.G: "yyyy-MM-dd'T'HH:mm:ss.SSSZ".
If you do not supply a value (null
), the date is formatted specified by DateFormat.SHORT
.locale
- in which locale the date will be resolved.
If you do not supply a value (null
), the date is resolved with the server's default locale.public String getArticleTypeName()
PresentationArticle
content-type
resource).public List getAuthors()
PresentationArticle
List
of neo.xredsys.api.Person
.public Section getHomeSection()
PresentationArticle
Section
sectionpublic Section getOwnerHomeSection()
PresentationArticle
public int getPriority()
PresentationArticle
public Publication getPublication()
PresentationArticle
public int getPublicationId()
PresentationArticle
public String getRelativeUrl()
PresentationArticle
article123.ece
.public URI getRelativeURI()
PresentationArticle
article123.ece
.public List getSectionsList()
PresentationArticle
public String getSource()
PresentationArticle
source
together with
PresentationArticle.getSourceId()
uniquely identifies the original source of the content item.public String getSourceId()
PresentationArticle
sourceId
together with
PresentationArticle.getSource()
uniquely identifies the original source of the content item.public String getTitle()
PresentationArticle
public List<PresentationTag> getTags()
PresentationArticle
public String getUrl()
PresentationArticle
public String getOwnerUrl()
PresentationArticle
PresentationArticle.getUrl()
, which returns the content item's URL in its current section.
For a cross-published content item both the section and publication components of the URL will
differ.public boolean isAgreementRequired()
PresentationArticle
true
if an agreement is required to view this content item,
otherwise false
.true
if this content item need an agreement, false
if not.public boolean isLive()
PresentationArticle
true
if this content item is published and active and its home section is published,
otherwise false
.public AgreementInfo getAgreementInfo()
PresentationArticle
null
if the content item has no agreement.public boolean inSection(int pSectionId)
PresentationArticle
pSectionId
- The sectionId to the section we will check.true
if the content item is in the section, false
otherwise.public boolean inSection(Section pSection)
PresentationArticle
pSection
- The section to check.true
if the content item is in the section, false
otherwise.public String getFieldElement(String pKey)
PresentationArticle
pKey
- The text field to get.public String getFieldElementDefaultValue(String pKey)
PresentationArticle
pKey
- The text field to get default value from.public Collection getPersons()
PresentationArticle
persons
related to this content itempublic List getArticles()
PresentationArticle
neo.xredsys.presentation.PresentationRelationArticle
public List getArticles(Set pArticleTypes)
PresentationArticle
pArticleTypes
- this is a Set
of the named content item types.neo.xredsys.presentation.PresentationRelationArticle
public Map<String,PresentationElement> getRelatedElements()
PresentationArticle
PresentationElement
that holds the relations to this object.PresentationElement
that holds the relations to this object.public Set<PresentationElement> getRelatedElements(Set<String> pContentTypes)
PresentationArticle
pContentTypes
- the content types to search forpublic Map<String,PresentationElement> getInlineElements()
PresentationArticle
Map
of all inline elements for this content item. The key of this map represents the ID of the inline
element.Map
of all inline elements for this content item.public String getStateName()
PresentationArticle
public IOHashKey getHashKey()
PresentationObject
public boolean isOwner()
PresentationArticle
true
if this content item is in its owning publication, false
if
it is a cross-published content item that is being accessed from a foreign publication.true
if the current content item is the owner, false
if not.public int getId()
PresentationObject
public List<String> getFieldNames()
PresentationArticle
content-types.xml
, and
in upper case letters.public Map<String,PresentationProperty<?>> getFields()
PresentationArticle
Object
s representing the fields depends upon field type as follows:
Field type | Java Object |
---|---|
BASIC | String |
NUMBER | a subclass of Number |
COMPLEX | Map |
BOOLEAN | Boolean |
ENUMERATION | a String or List of Strings |
URI | URI |
LINK | Link |
DATE | Date |
SCHEDULE | PresentationSchedule |
public boolean isPreview()
PresentationArticle
isPreview
in interface PresentationArticle
isPreview
in class AbstractPresentationArticle
true
if the current content item is preview, false
if not.public String getPreviewToken()
PresentationArticle
getPreviewToken
in interface PresentationArticle
getPreviewToken
in class AbstractPresentationArticle
public List<PresentationPerson> getProfilePersons()
PresentationArticle
© 1998- 2018 Stibo DX