Package lumis.content.core
Class Content
- java.lang.Object
-
- lumis.content.core.Content
-
- All Implemented Interfaces:
Serializable
@StableMinor(version="14.1", sinceVersion="4.2") public class Content extends Object implements Serializable
A content entity object. A content may have its data specified in multiple locales.- Since:
- 4.2.0
- Version:
- $Revision: 24684 $ $Date: 2021-08-23 18:58:35 -0300 (Mon, 23 Aug 2021) $
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description Content()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ContentLocale
addContentLocale(Locale locale)
Adds a new locale specific content object in this content.ContentLocale
getContentLocale(Locale locale, boolean fallbackToDefaultLocale)
Returns the locale specific content object, for the given locale, optionally using the default locale.Collection<ContentLocale>
getContentLocales()
Returns the locale specific objects of this content.Locale
getDefaultLocale()
Returns the default locale for this content.String
getId()
Returns this content's identifier.String
getServiceInstanceId()
Returns the identifier of the service instance this content belongs to.String
getSourceId()
Returns the source this content belongs to.void
setDefaultLocale(Locale defaultLocale)
Sets the default locale for this content.void
setServiceInstanceId(String serviceInstanceId)
Sets the service instance this content belongs to.void
setSourceId(String sourceId)
Sets the source this content belongs to.
-
-
-
Method Detail
-
getId
public String getId()
Returns this content's identifier.- Returns:
- this content's identifier.
- Since:
- 4.2.0
-
getServiceInstanceId
public String getServiceInstanceId()
Returns the identifier of the service instance this content belongs to.- Returns:
- the identifier of the service instance this content belongs to.
- Since:
- 4.2.0
-
setServiceInstanceId
public void setServiceInstanceId(String serviceInstanceId)
Sets the service instance this content belongs to.- Parameters:
serviceInstanceId
- the service instance identifier.- Since:
- 4.2.0
-
getSourceId
public String getSourceId()
Returns the source this content belongs to.- Parameters:
sourceId
- the source identifier.- Since:
- 4.2.0
-
setSourceId
public void setSourceId(String sourceId)
Sets the source this content belongs to.- Parameters:
sourceId
- the source identifier.- Since:
- 4.2.0
-
getDefaultLocale
public Locale getDefaultLocale()
Returns the default locale for this content.- Returns:
- the default locale for this content, or
null
if this content has no default locale. - Since:
- 4.2.0
-
setDefaultLocale
public void setDefaultLocale(Locale defaultLocale)
Sets the default locale for this content.- Parameters:
defaultLocale
- the locale to set. May benull
to set that this content has no default locale.- Since:
- 4.2.0
-
getContentLocales
public Collection<ContentLocale> getContentLocales()
Returns the locale specific objects of this content.- Returns:
- the locale specific objects of this content.
- Since:
- 4.2.0
-
addContentLocale
public ContentLocale addContentLocale(Locale locale) throws PortalException
Adds a new locale specific content object in this content.- Parameters:
locale
- the locale.- Returns:
- the locale specific content object created.
- Throws:
PortalObjectAlreadyExistsException
- if this content already contains an object for the given locale.PortalException
- Since:
- 4.2.0
-
getContentLocale
public ContentLocale getContentLocale(Locale locale, boolean fallbackToDefaultLocale)
Returns the locale specific content object, for the given locale, optionally using the default locale.- Parameters:
locale
- the locale.fallbackToDefaultLocale
- if true, the default locale for this content will be used if no contentLocale for the specified locale exists.- Returns:
- the locale specific content object, or
null
if no object exists, according to the given parameters. - Since:
- 4.2.0
-
-