public interface ArticleTransaction extends Article, IOTransaction
P.S! There are several attributes that needs to be set on this transaction object
before you can create a new article(call the IOTransaction.create()
method).
These attributes are:
Example: Article article = IOAPI.getAPI().getObjectFactory().createArticle(); ArticleTransaction at = (ArticleTransaction)article.lock(); Type state = IOAPI.getAPI().getTypeManager().getType(Type.ArticleStateType, FieldConstants.PUBLISHED); Type type = IOAPI.getAPI().getTypeManager().getType(Type.ArticleType, "normal"); at.setState(state); at.setType(type); at.setOwnerPublicationId(pubId); at.setHomeSectionId(sectionId); at.setElementText(FieldConstants.TITLE, "This is a test article."); at.create(); if(at.isLocked()){ at.release(); }
Article
Modifier and Type | Interface and Description |
---|---|
static class |
ArticleTransaction.Transition |
IOAtom.ObjectType
DEFAULT_RELATION_TYPE, HIDDEN_ARTICLE_PRIORITY, INLINE_RELATION_TYPE, MAIN_IN_TOPIC_PRIORITY
ID_INVALID, OBJECTTYPE_AGREEMENTINFO, OBJECTTYPE_ARTICLE, OBJECTTYPE_CATALOG, OBJECTTYPE_CATEGORY, OBJECTTYPE_ENTITY, OBJECTTYPE_FORUM, OBJECTTYPE_LAYOUT, OBJECTTYPE_MAX, OBJECTTYPE_MIN, OBJECTTYPE_PERSON, OBJECTTYPE_POOL, OBJECTTYPE_POSTING, OBJECTTYPE_PRESENTATION_FORUM, OBJECTTYPE_PRESENTATION_POSTING, OBJECTTYPE_PRESENTATION_THREAD, OBJECTTYPE_PROFILE, OBJECTTYPE_PUBLICATION, OBJECTTYPE_SECTION, OBJECTTYPE_THREAD, OBJECTTYPE_TOPIC, OBJECTTYPE_UNKNOWN, OBJECTTYPE_USERGROUP
Modifier and Type | Method and Description |
---|---|
MutableTagRelation |
add(Tag pTag)
Adds a
Tag to this article |
void |
addContentSummary(String pRelationType,
ContentSummary pContentSummary)
Add a ContentSummary to the supplied relation type.
|
boolean |
addReference(IORelation relation)
Deprecated.
use
addContentSummary(String, ContentSummary) instead |
boolean |
addReference(ReferenceEntity pEntity)
Deprecated.
use
addContentSummary(String, ContentSummary) instead |
void |
addRelativeURI(URI uri,
boolean pDefault)
/**
Add a relative uri for the article.
|
boolean |
addRoleKeeper(Person person,
Type roleType)
Adds a role keeper to this article.
|
boolean |
addRoleKeeper(Person person,
Type roleType,
String message)
Adds a role keeper to this article, with a message.
|
boolean |
addToPool(IORelation relation)
Adds an article to the given pool.
|
boolean |
addToPool(Pool pool)
Adds an article to the given pool.
|
boolean |
addToSection(Section pSection)
Adds this article to a section.
|
boolean |
getUpdateLastModified()
Indicate wether calling update() on this transaction will trigger a change to the last modification
date of the article.
|
void |
remove(Tag pTag)
Removes a
Tag from this article |
boolean |
removeAllReferences(ReferenceEntity pEntity)
Deprecated.
use
Article.getContentSummaries(String) and setContentSummaries(String, List) instead |
boolean |
removeAllReferences(ReferenceEntity pEntity,
Type[] pTypes)
Deprecated.
use
Article.getContentSummaries(String) and setContentSummaries(String, List) instead |
boolean |
removeArticleRelation(Article pArticle,
Type pType)
Deprecated.
use
Article.getContentSummaries(String) and setContentSummaries(String, List) instead |
boolean |
removeFromPool(Pool pool)
Removes an article from the given pool.
|
boolean |
removeFromSection(Section pSection)
Removes this article from a section.
|
void |
removeInlineImagesFromElement(String element,
int imageId)
Deprecated.
no replacement
|
void |
removeLocalHomeSection(Section pLocalHomeSection)
Removes the local home section for that article if present.
|
boolean |
removeReference(IORelation pRelation)
Deprecated.
use
Article.getContentSummaries(String) and setContentSummaries(String, List) instead |
boolean |
removeRoleKeeper(Person person)
Removes a role keeper from this article.
|
boolean |
removeRoleKeeper(Person person,
Type roleType)
Removes a role keeper from this article.
|
boolean |
removeRoleKeepers(IORelation[] roleKeepers) |
boolean |
replaceArticleRelations(Collection pRelations)
Deprecated.
use
Article.getContentSummaries(String) and setContentSummaries(String, List) instead |
void |
setActivateDate(Timestamp ad)
Sets the activation date of the article.
|
void |
setContentSummaries(String pElementName,
List<ContentSummary> pContentSummaries)
Sets the list of
content summaries for the article. |
void |
setCreationDate(Timestamp pCreationDate)
Sets the creation date of the article.
|
void |
setElementText(String name,
String value)
Deprecated.
use the
setField(String, FieldValue) or setFieldValue(String, Object) instead. |
void |
setExpireDate(Timestamp ed)
Sets the expire date of the article.
|
void |
setField(String pName,
FieldValue pValue)
Internally this method will call
setFieldValue(java.lang.String, java.lang.Object) with
FieldValue.getValue() . |
void |
setFieldValue(String pName,
Object pValue)
Sets an value for the specified field on this article.
|
void |
setFirstPublished(Timestamp pd)
Set the "first published" date of this article.
|
void |
setHomeSection(Section homeSection)
Sets the home section of this article.
|
void |
setHomeSectionId(int homeSectionId)
Sets the home section of this article.
|
void |
setLastModified(Timestamp pLastModified)
Sets the last modification date of the article.
|
void |
setLocalHomeSection(Section pLocalHomeSection)
Sets the local home section of this article.
|
void |
setLogging(boolean logging)
Sets whether or not this article should have a log entry created when it is modified.
|
void |
setPersonSummaries(List<PersonSummary> pPersonSummaries)
Sets/replaces all the
PersonSummary s of a content item. |
void |
setPriority(int priority)
Sets the priority of this article.
|
void |
setPublishDate(Timestamp pd)
Set the publish date of this article.
|
void |
setRelativeURI(URI uri)
Sets the relative part of the url.
|
void |
setSource(String source)
Set the source of this article.
|
void |
setSourceId(String sourceId)
Set the source id of this article.
|
void |
setState(Type state)
Set the state of the article.
|
void |
setStateChange(Timestamp sc)
Sets the time when the state of this article was last changed.
|
void |
setTitle(String title)
Sets the title of the article.
|
void |
setType(Type type)
Sets the type of this article
|
void |
setUpdateLastModified(boolean pValue)
Indicate wether or not this update should trigger an update of the last modified bit.
|
void |
update(ArticleTransaction.Transition pTransition)
Updates the article using the workflow defined by the given
ArticleTransaction.Transition |
void |
updateReference(IORelation pRelation)
Deprecated.
use
Article.getContentSummaries(String) and setContentSummaries(String, List) instead |
void |
validate()
Deprecated.
no replacement
|
void |
validateArticleType()
Deprecated.
no replacement
|
getActivateDate, getAgreementInfo, getArticleType, getAuthor, getAuthors, getCategories, getCategories, getContentId, getContentId, getContentSummaries, getContentSummaries, getCreationDate, getDefaultContentType, getElements, getElementText, getExpireDate, getField, getFieldValue, getFirstPublished, getHomeSection, getHomeSectionId, getLanguage, getLanguage, getLastEditedBy, getLastModified, getLayout, getLayoutId, getLocalHomeSection, getLocalHomeSections, getLocalUrl, getLocalUrls, getLogEntries, getOriginalState, getPersonRoleKeepers, getPersonSummaries, getPools, getPreviewToken, getPreviewUrl, getPrinted, getPriority, getPublicationIds, getPublishDate, getPublishedVariant, getReferenceEntities, getReferredEntities, getReferredEntities, getReferredPersons, getRelatedAPIArticles, getRelatedArticles, getRelativeURI, getRelativeURIs, getRelativeUrl, getRoleKeepers, getRoleKeepers, getSections, getSections, getSource, getSourceId, getState, getStateChange, getStrippedElementText, getTags, getTitle, getTopics, getType, getUrl, has, inPool, inSection, isAgreementRequired, isLive, isLive, isLogging, isStaged, parseField, toContentSummary
create, delete, getObject, release, setId, setOwnerPublicationId, update
breakAndLock, createTransaction, getChecksum, getHashKey, getId, getLockKeeper, getObjectType, getOwnerPublicationId, getProtectionDomain, getProtectionDomains, isLocked, isPreview, isValid, lock, lock, lock, lock, refresh
void setType(Type type) throws PersistentStoreException, NoSuchObjectException
type
- the typePersistentStoreException
- if an error occurs in the persistence layerNoSuchObjectException
- if trying to retrieve an object that does not existType
,
TypeManager
void setStateChange(Timestamp sc) throws PersistentStoreException, NoSuchObjectException
sc
- the new timePersistentStoreException
- if an error occurs in the persistence layerNoSuchObjectException
- if trying to retrieve an object that does not existvoid setPriority(int priority) throws PersistentStoreException, NoSuchObjectException
Article.getPriority()
for details on priorities.priority
- the new priorityPersistentStoreException
- if an error occurs in the persistence layerNoSuchObjectException
- if trying to retrieve an object that does not existvoid setCreationDate(Timestamp pCreationDate) throws PersistentStoreException, NoSuchObjectException, IllegalStateException
pCreationDate
- the new creation datePersistentStoreException
- if an error occurs in the persistence layerNoSuchObjectException
- if trying to retrieve an object that does not existIllegalStateException
- if called when updating an articlevoid setLastModified(Timestamp pLastModified) throws PersistentStoreException, NoSuchObjectException, IllegalStateException
pLastModified
- the new "last modified" datePersistentStoreException
- if an error occurs in the persistence layerNoSuchObjectException
- if trying to retrieve an object that does not existIllegalStateException
- if called when updating an articlevoid setActivateDate(Timestamp ad) throws PersistentStoreException, NoSuchObjectException
ad
- the new activation datePersistentStoreException
- if an error occurs in the persistence layerNoSuchObjectException
- if trying to retrieve an object that does not existvoid setExpireDate(Timestamp ed) throws PersistentStoreException, NoSuchObjectException
ed
- the new expire datePersistentStoreException
- if an error occurs in the persistence layerNoSuchObjectException
- if trying to retrieve an object that does not existvoid setPublishDate(Timestamp pd) throws PersistentStoreException, NoSuchObjectException
pd
- the new publish datePersistentStoreException
- if an error occurs in the persistence layerNoSuchObjectException
- if trying to retrieve an object that does not existvoid setFirstPublished(Timestamp pd) throws PersistentStoreException, NoSuchObjectException
pd
- the new first publish datePersistentStoreException
- if an error occurs in the persistence layerNoSuchObjectException
- if trying to retrieve an object that does not existIllegalStateException
- if called when updating an articlevoid setUpdateLastModified(boolean pValue)
boolean getUpdateLastModified()
void setState(Type state) throws PersistentStoreException, NoSuchObjectException
Article.getState()
for details on states.state
- the new statePersistentStoreException
- if an error occurs in the persistence layerNoSuchObjectException
- if trying to retrieve an object that does not existType
,
TypeManager
,
Article.getState()
void setSource(String source) throws PersistentStoreException, NoSuchObjectException
Article.getSource()
for details on article source.source
- the new sourcePersistentStoreException
- if an error occurs in the persistence layerNoSuchObjectException
- if trying to retrieve an object that does not existvoid setSourceId(String sourceId) throws PersistentStoreException, NoSuchObjectException
Article.getSourceId()
for details on article source.sourceId
- the source idPersistentStoreException
- if an error occurs in the persistence layerNoSuchObjectException
- if trying to retrieve an object that does not existvoid setTitle(String title) throws PersistentStoreException, NoSuchObjectException
setElementText(java.lang.String, java.lang.String)
with FieldConstants.TITLE
as key.title
- the new titlePersistentStoreException
- if an error occurs in the persistence layerNoSuchObjectException
- if trying to retrieve an object that does not exist@Deprecated void setElementText(String name, String value)
setField(String, FieldValue)
or setFieldValue(String, Object)
instead.Article.getElements()
for
details on elements.
Will be removed in next major release.name
- the element key to retrieve the text byArticle.getElements()
void setFieldValue(String pName, Object pValue)
application/xhtml
, the value will be validated for well-formedness.pName
- the mapped property to setpValue
- the value of the propertyIllegalArgumentException
- if there is no defined field with the given name for content type of the article.IllegalArgumentException
- if the field's content type is defined to be application/xhtml
and the value is not well-formed.IllegalArgumentException
- if the field name is null or empty string.void setField(String pName, FieldValue pValue)
setFieldValue(java.lang.String, java.lang.Object)
with
FieldValue.getValue()
. In addition it will also set any
field options set for the field.pName
- the mapped property to setpValue
- the value of the propertyIllegalArgumentException
- if there is no defined field with the given name for content type of the article.IllegalArgumentException
- if the field's content type is defined to be application/xhtml and the value is not well-formed.IllegalArgumentException
- if the field name is null or empty string.IllegalArgumentException
- if the value is null.void setRelativeURI(URI uri)
addRelativeURI(URI, boolean)
.
This can then be used to look up the article in the API by using ObjectLoader.getArticleByUrl(String, int)
.
getArticleByUrl expects the url to be url-encoded
E.g:
objectloader.getArticleByUrl("article123.ece", 21); objectloader.getArticleByUrl("A-Very-Cool-Article-Name-Here", 21);If this relative url is set, the presentation layer will use this value to find the Article object in the filter chain.
uri
- the url of this articlevoid addRelativeURI(URI uri, boolean pDefault)
ObjectLoader.getArticleByUrl(String, int)
.
This method expects the url to be url-encoded
E.g:
objectloader.getArticleByUrl("article123.ece", 21); objectloader.getArticleByUrl("A-Very-Cool-Article-Name-Here", 21);The article can have more than one relative uri. The article can be look up by any of them. If this relative url is set, the presentation layer will use this value to find the Article object in the filter chain.
uri
- the url of this articlepDefault
- Set this uri as the default uri for the
article. The article can only have one default uri, so setting
this to true will replace the current default uri.void setHomeSection(Section homeSection) throws PersistentStoreException, NoSuchObjectException
homeSection
- the section that this article will belong toPersistentStoreException
- if an error occurs in the persistence layerNoSuchObjectException
- if trying to retrieve an object that does not existvoid setLocalHomeSection(Section pLocalHomeSection) throws PersistentStoreException, NoSuchObjectException
pLocalHomeSection
- the local home section of the articlePersistentStoreException
- if an error occurs in the persistence layerNoSuchObjectException
- if trying to retrieve an object that does not existvoid removeLocalHomeSection(Section pLocalHomeSection) throws PersistentStoreException, NoSuchObjectException
pLocalHomeSection
- The section that needs to be removedPersistentStoreException
- if an error occurs in the persistence layerNoSuchObjectException
- if trying to retrieve an object that does not existvoid setHomeSectionId(int homeSectionId) throws PersistentStoreException, NoSuchObjectException
homeSectionId
- the id of the section that this article will belong toPersistentStoreException
- if an error occurs in the persistence layerNoSuchObjectException
- if trying to retrieve an object that does not existvoid validate() throws IOException, SAXException
IOException
SAXException
void validateArticleType()
void setLogging(boolean logging)
true
.logging
- true if a log entry should be created when this article is modified.void removeInlineImagesFromElement(String element, int imageId)
element
- from which inline images will be removedimageId
- the id of the image to removeboolean addToSection(Section pSection) throws PersistentStoreException, NoSuchObjectException
pSection
- the Section
to add toPersistentStoreException
- if an error occurs in the persistence layerNoSuchObjectException
- if trying to retrieve an object that does not existboolean removeFromSection(Section pSection) throws PersistentStoreException, NoSuchObjectException, IllegalOperationException
pSection
- the Section
to remove fromPersistentStoreException
- if an error occurs in the persistence layerNoSuchObjectException
- if trying to retrieve an object that does not existIllegalOperationException
- if the section is the home section of the article.boolean addToPool(Pool pool) throws PersistentStoreException, NoSuchObjectException, IllegalOperationException
pool
- the pool to add this article toPersistentStoreException
- if an error occurs in the persistence layerNoSuchObjectException
- if trying to retrieve an object that does not existIllegalOperationException
- if this user is not authorized to perform this actionboolean addToPool(IORelation relation) throws PersistentStoreException, NoSuchObjectException, IllegalOperationException
relation
- the pool to add this article toPersistentStoreException
- if an error occurs in the persistence layerNoSuchObjectException
- if trying to retrieve an object that does not existIllegalOperationException
- if this user is not authorized to perform this actionboolean removeFromPool(Pool pool) throws PersistentStoreException, NoSuchObjectException, IllegalOperationException
pool
- the pool to remove this article fromPersistentStoreException
- if an error occurs in the persistence layerNoSuchObjectException
- if trying to retrieve an object that does not existIllegalOperationException
- if this user is not authorized to perform this actionboolean addReference(ReferenceEntity pEntity) throws PersistentStoreException, NoSuchObjectException
addContentSummary(String, ContentSummary)
insteadpEntity
- the ReferenceEntity
to add to this articlefalse
alwaysUnsupportedOperationException
PersistentStoreException
- if an error occurs in the persistence layerNoSuchObjectException
- if trying to retrieve an object that does not existReferenceEntity
boolean addReference(IORelation relation) throws PersistentStoreException, NoSuchObjectException
addContentSummary(String, ContentSummary)
insteadrelation
- the ReferenceEntity
to add to this articlefalse
alwaysUnsupportedOperationException
PersistentStoreException
- if an error occurs in the persistence layerNoSuchObjectException
- if trying to retrieve an object that does not existReferenceEntity
void updateReference(IORelation pRelation)
Article.getContentSummaries(String)
and setContentSummaries(String, List)
insteadpRelation
- the relation to update.boolean removeAllReferences(ReferenceEntity pEntity) throws PersistentStoreException, NoSuchObjectException
Article.getContentSummaries(String)
and setContentSummaries(String, List)
insteadReferenceEntity
.pEntity
- the ReferenceEntity
to remove from this articletrue
if the refereneces are removed, otherwise false
.PersistentStoreException
- if an error occurs in the persistence layerNoSuchObjectException
- if trying to retrieve an object that does not existReferenceEntity
boolean removeAllReferences(ReferenceEntity pEntity, Type[] pTypes) throws PersistentStoreException, NoSuchObjectException
Article.getContentSummaries(String)
and setContentSummaries(String, List)
insteadReferenceEntity
. Possible types can be found by calling
TypeManager.getTypes(neo.xredsys.api.Type.Category)
.pEntity
- the ReferenceEntity
to remove references topTypes
- the types of references to removePersistentStoreException
- if an error occurs in the persistence layerNoSuchObjectException
- if trying to retrieve an object that does not existReferenceEntity
boolean removeReference(IORelation pRelation) throws PersistentStoreException, NoSuchObjectException
Article.getContentSummaries(String)
and setContentSummaries(String, List)
insteadReferenceEntity
and this article. Possible types can be found by calling
TypeManager.getTypes(neo.xredsys.api.Type.Category)
.pRelation
- the reference to removePersistentStoreException
- if an error occurs in the persistence layerNoSuchObjectException
- if trying to retrieve an object that does not existReferenceEntity
,
TypeManager
boolean removeArticleRelation(Article pArticle, Type pType) throws PersistentStoreException, NoSuchObjectException
Article.getContentSummaries(String)
and setContentSummaries(String, List)
insteadTypeManager.getTypes(neo.xredsys.api.Type.Category)
. Typical types are:
pArticle
- the article to remove from this articlepType
- the type of relation to remove from this articletrue
if the relation was removed, otherwise false
PersistentStoreException
- if an error occurs in the persistence layerNoSuchObjectException
- if trying to retrieve an object that does not existTypeManager
boolean replaceArticleRelations(Collection pRelations)
Article.getContentSummaries(String)
and setContentSummaries(String, List)
insteadvoid addContentSummary(String pRelationType, ContentSummary pContentSummary)
Article.toContentSummary()
method.pRelationType
- the relation type to add to. Cannot be null
. Should be a defined relation-type name
in the content-type resource.pContentSummary
- the content summary to add. Cannot be null
.Article.toContentSummary()
void setPersonSummaries(List<PersonSummary> pPersonSummaries)
PersonSummary
s of a content item.pPersonSummaries
- the person summaries to set.void setContentSummaries(String pElementName, List<ContentSummary> pContentSummaries)
content summaries
for the article.
Should only be called by the webservice.pElementName
- the name of the relation type. Cannot be null
.pContentSummaries
- the List
of content summaries
. Cannot be null
.Article.toContentSummary()
boolean addRoleKeeper(Person person, Type roleType) throws PersistentStoreException, NoSuchObjectException
Article.getRoleKeepers()
for details on role keepers.person
- the person to add as author of this articleroleType
- the type of role this person will be given on this articlePersistentStoreException
- if an error occurs in the persistence layerNoSuchObjectException
- if trying to retrieve an object that does not existTypeManager
boolean addRoleKeeper(Person person, Type roleType, String message) throws PersistentStoreException, NoSuchObjectException
Article.getRoleKeepers()
for details on role keepers.person
- the person to add as author of this articleroleType
- the type of role this person will be given on this articlemessage
- the message that will be attached to this relationPersistentStoreException
- if an error occurs in the persistence layerNoSuchObjectException
- if trying to retrieve an object that does not existTypeManager
boolean removeRoleKeeper(Person person, Type roleType) throws PersistentStoreException, NoSuchObjectException
Article.getRoleKeepers()
for details on role keepers.person
- the person to remove as author from this articleroleType
- the role the person in question will have removed from this articlePersistentStoreException
- if an error occurs in the persistence layerNoSuchObjectException
- if trying to retrieve an object that does not existTypeManager
boolean removeRoleKeeper(Person person) throws PersistentStoreException, NoSuchObjectException
Article.getRoleKeepers()
for details on role keepers.person
- the person to remove as author from this articlePersistentStoreException
- if an error occurs in the persistence layerNoSuchObjectException
- if trying to retrieve an object that does not existTypeManager
boolean removeRoleKeepers(IORelation[] roleKeepers) throws PersistentStoreException, NoSuchObjectException
void update(ArticleTransaction.Transition pTransition) throws PersistentStoreException, NoSuchObjectException, IllegalOperationException
ArticleTransaction.Transition
pTransition
- the transition to applyPersistentStoreException
NoSuchObjectException
IllegalOperationException
MutableTagRelation add(Tag pTag) throws IllegalArgumentException
Tag
to this articlepTag
- the Tag
to addIllegalArgumentException
- if the tag is already added© 1998- 2018 Stibo DX