public interface Media extends Referenceable, PackagePoolItem
The Media interface provides two different types of objects File
and Picture
which can
be distinguished by using the getType()
-method.
Depending on the type of data from the MediaStore you are working with, further information
and extensive API functionality regarding files can be drawn from one of the two interfaces.
IDProvider.DependentReleaseType, IDProvider.RevertType, IDProvider.UidType
HistoryProvider.RevisionProvider
Modifier and Type | Field and Description |
---|---|
static int |
FILE
Type of the media: FILE
|
static int |
PICTURE
Type of the media: PICTURE
|
static IDProvider.UidType |
UID_TYPE
Uid type, see
IDProvider.getUid() . |
BLOCKED, MODIFIED, UNMODIFIED
CHANGED, NEVER_RELEASED, RELEASED
ALL_REVISIONS, EVER_SINCE, UNTIL_NOW
Modifier and Type | Method and Description |
---|---|
File |
getFile(Language language)
Get the given media as a
File object in the language provided. |
String |
getFilename()
Get the filename of the current media.
|
Object |
getMediaContent(Language language)
|
String |
getName()
Deprecated.
since 4.1.10 - use
IDProvider.getUid() |
boolean |
getParseFile()
State if the media must be parsed during the generation (only
FILE ) |
Picture |
getPicture(Language language)
Get the given media as a
Picture object in the language provided. |
String |
getStoredUrl(Language language,
Resolution resolution)
Get the stored URL for this node and the provided combination of language and resolution.
|
int |
getType()
|
IDProvider.UidType |
getUidType()
Return
UID_TYPE . |
boolean |
isLanguageDependent()
Indicates whether this media is language dependent or not.
|
void |
makeLanguageDependent(Language... languages)
Makes this media language dependent.
|
void |
makeLanguageIndependent(Language toKeep)
Makes this media language independent.
|
void |
save()
Save all changes made to media object.
|
void |
setFilename(String filename)
Set the filename of the current media.
|
void |
setParseFile(boolean parseFile)
Set if the media must be parsed during the generation (only
FILE ) |
getReferenceName
addToPackage, getChangeState, getPackage, getPackageName, isAddable, isChangeable, isPackageItem, isSubscribedItem, removeFromPackage, setChangeState
contrastWith, getDisplayName, getId, getInRevision, getLanguageInfo, getLongID, getMeta, getMetaFormData, getParent, getReleasedBy, getReleaseRevision, getReleaseStatus, getRevision, getUid, hasMeta, hasUid, isInReleaseStore, isReleased, isReleaseSupported, moveChild, moveChild, release, release, revert, setDisplayName, setMeta, setMetaFormData, setUid
appendChild, appendChildBefore, delete, exportStoreElement, getChildCount, getChildIndex, getChildren, getChildren, getChildren, getChildren, getCreateWorkflowPermission, getDefinedPrincipalPermissions, getEditor, getElementType, getFirstChild, getIncomingReferences, getInheritedPrincipalPermissions, getLastChanged, getNextSibling, getOutgoingReferences, getPermission, getPermission, getPermission, getPreviousSibling, getProject, getReferences, getStore, getTreePermission, getWorkflowPermission, getWorkflowPermissions, getWriteLock, hasIncomingReferences, hasPermissions, importStoreElement, importStoreElements, inheritWorkflowPermission, isDeleted, isExportSupported, isFolder, isImportSupported, isLocked, isLockedOnServer, isLockSupported, isPermissionSupported, isWorkflowAllowed, isWorkflowSupported, refresh, removeAllWorkflowPermissions, removeChild, removePermission, removePermission, removePermission, removeWorkflowPermission, replaceChild, save, save, setInheritWorkflowPermission, setLock, setLock, setPermission, setPermission, setPermission, setWorkflowPermission, setWorkflowPermissions, setWriteLock, toXml, toXml, toXml
getColor, getTask, hasTask, removeTask, setColor, setTask
compareTo
asRevisionProvider, getHistory, getHistory
static final int FILE
static final int PICTURE
static final IDProvider.UidType UID_TYPE
IDProvider.getUid()
.int getType()
@NotNull @Deprecated String getName()
IDProvider.getUid()
getName
in interface StoreElement
boolean isLanguageDependent()
true
if this media is languagedependent, false
otherwisevoid makeLanguageIndependent(@NotNull Language toKeep)
toKeep
- is the one Language to keep when reducing to one single languagevoid makeLanguageDependent(Language... languages)
Picture
or File
) and description for every project language. languages
- to which of the project languages should data from the old (single) language be assigned?String getFilename()
void setFilename(String filename)
filename
- new filename of the mediaboolean getParseFile()
FILE
)true
if the file "must be parsed", false
otherwisevoid setParseFile(boolean parseFile)
FILE
)parseFile
- true
file "must be parsed", false
"must not be parsed"@Nullable Object getMediaContent(Language language)
language
- language of the mediaFile
or Picture
object or null
if current media is language dependent
but given language is not a project languagegetFile(de.espirit.firstspirit.access.Language)
,
getPicture(de.espirit.firstspirit.access.Language)
@Nullable Picture getPicture(@Nullable Language language)
Picture
object in the language provided.
Pass null
if this media object is language independent
.@Nullable File getFile(@Nullable Language language)
File
object in the language provided.
Pass null
if this media object is language independent
.void save()
save
in interface StoreElement
IOException
- connection problemsDuplicateReferenceNameException
- if a medium with this IDProvider.getUid()
already exists on
the serverStoreElement.save(String)
@NotNull IDProvider.UidType getUidType()
UID_TYPE
.getUidType
in interface IDProvider
IDProvider.hasUid()
@Nullable String getStoredUrl(@Nullable Language language, @Nullable Resolution resolution)
null
if no URL is (yet) stored.language
- Language to get the URL for - or null
for language independent media nodes.resolution
- Resolution to get the URL for - or null
for instances of type
FILE
.null
, if no URL is yet stored.NullPointerException
- if parameter language
is null
and this node is
language dependent
or parameter resolution
is null
and this node
is of type
PICTURE
.URLProperties.getStoredUrl(Media, Language, Resolution)
Copyright © 2021 e-Spirit AG. All Rights Reserved. Build 5.2.210210