Package com.oracle.content.sdk.model
Class Asset
java.lang.Object
com.oracle.content.sdk.model.AssetObject
com.oracle.content.sdk.model.AssetLinksObject
com.oracle.content.sdk.model.Asset
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
ContentItem
,DigitalAsset
Common base class for
ContentItem
and DigitalAsset
.- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected ContentDate
protected String
protected String
protected String
protected String
protected String
protected String
protected ContentDate
Fields inherited from class com.oracle.content.sdk.model.AssetLinksObject
links
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetBooleanField
(String fieldName) getContentItemField
(String fieldName) Get a Content Item reference if it is contained as a field in this content item, or null if there is no matching content item field.A representation of content type data which includes both "type" and "typeCategory" fields.Get created date for item.getDateField
(String fieldName) getDecimalField
(String fieldName) Get description for this item.getDigitalAssetField
(String fieldName) Get a Digital Asset if it is contained as a field in this content item, or null if there is no matching digital asset field.<T extends ContentField>
TgetFieldFromType
(String fieldName, FieldType type) A generic method that will return the content field given the specified type.getFieldFromValue
(String fieldName) This method will "guess" the field type based on the value of the field.getId()
Get the content item IdgetIntegerField
(String fieldName) getJsonField
(String fieldName) If applicable, a string representing the language.getLargeTextField
(String fieldName) getName()
Get the name of the content itemgetReferenceListField
(String fieldName) getReferenceListIds
(String fieldName) getSlug()
Get the slug for the item.getTextField
(String fieldName) Get whether the item is defined as translatablegetType()
Get raw value of the "type" value.Get raw value of the "typeCategory".Get updated date for item.boolean
This method checks the type field and will return true if it is a DigitalAsset type.boolean
Methods inherited from class com.oracle.content.sdk.model.AssetLinksObject
getLinks
-
Field Details
-
id
-
name
-
type
-
typeCategory
-
description
-
createdDate
-
updatedDate
-
language
-
fields
-
-
Constructor Details
-
Asset
public Asset()
-
-
Method Details
-
getTaxonomies
-
getType
Get raw value of the "type" value. To interpret this value in general it is better to usegetContentType()
- Returns:
- content type as a string
-
getTypeCategory
Get raw value of the "typeCategory". To interpret this value in general it is better to usegetContentType()
- Returns:
- content type category as a string
-
getContentType
A representation of content type data which includes both "type" and "typeCategory" fields. Use methods onAssetType
to determine more info.- Returns:
- content type representation
-
getDescription
Get description for this item.- Returns:
- description for item
-
getCreatedDate
Get created date for item.- Returns:
- Created date for item.
-
getUpdatedDate
Get updated date for item.- Returns:
- Update date for item.
-
isReferenceOnly
public boolean isReferenceOnly() -
getId
Get the content item Id- Returns:
- id
-
getName
Get the name of the content item- Returns:
- name
-
getSlug
Get the slug for the item.- Returns:
- item slug
-
isDigitalAsset
public boolean isDigitalAsset()This method checks the type field and will return true if it is a DigitalAsset type. Another method would be check if this object is an instanceofDigitalAsset
- Returns:
- true if type field is a "DigitalAsset"
-
getFileExtension
- Returns:
- file extension for digital assets or "contentItem"
-
getMimeType
- Returns:
- mimetype for digital assets or "contentItem"
-
getFileGroup
- Returns:
- fileGroup for digital assets (e.g. "Images") or "contentItem"
-
getLanguage
If applicable, a string representing the language.- Returns:
- string for language or null if not set
-
getTranslatable
Get whether the item is defined as translatable- Returns:
- true if translatable
-
getFieldFromValue
This method will "guess" the field type based on the value of the field. If you know the type of the field, you should always usegetFieldFromType(String, FieldType)
or the convenience methods that return specific values such asgetTextField(String)
- Parameters:
fieldName
- Field name in content item.- Returns:
- ContentField if exists, else null
-
getFieldFromType
A generic method that will return the content field given the specified type. For example, you could call it like this to get a the field for a content date:ContentFieldDate dateField = item.getFieldFromType("date_field", FieldType.DATE);
To get the value directly for common fields, use the convenience methods below. For example,getDateField(String)
- Type Parameters:
T
- the specific ContentField class- Parameters:
fieldName
- field name to matchtype
- The type of field expected- Returns:
- Specific ContentField derived class.
-
getDigitalAssetField
Get a Digital Asset if it is contained as a field in this content item, or null if there is no matching digital asset field.- Parameters:
fieldName
- field name to a digital asset- Returns:
DigitalAsset
object or null if not found
-
getContentItemField
Get a Content Item reference if it is contained as a field in this content item, or null if there is no matching content item field.- Parameters:
fieldName
- field name to a content item- Returns:
ContentItem
object or null if not found
-
getBooleanField
-
getIntegerField
-
getDecimalField
-
getTextField
-
getLargeTextField
-
getDateField
-
getJsonField
-
getReferenceListField
-
getReferenceListIds
-