Interface Media
- All Superinterfaces:
Comparable<StoreElement>
,HistoryProvider
,IDProvider
,PackagePoolItem
,Referenceable
,StoreElement
,Workflowable
This interface provides methods to handle a media object from the MediaStore.
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.
-
Nested Class Summary
Nested classes/interfaces inherited from interface de.espirit.firstspirit.storage.HistoryProvider
HistoryProvider.RevisionProvider
Nested classes/interfaces inherited from interface de.espirit.firstspirit.access.store.IDProvider
IDProvider.DependentReleaseType, IDProvider.RevertType, IDProvider.UidType
-
Field Summary
Modifier and TypeFieldDescriptionstatic final int
Type of the media: FILEstatic final int
Type of the media: PICTUREstatic final IDProvider.UidType
Uid type, seeIDProvider.getUid()
.Fields inherited from interface de.espirit.firstspirit.storage.HistoryProvider
ALL_REVISIONS, EVER_SINCE, UNTIL_NOW
Fields inherited from interface de.espirit.firstspirit.access.store.IDProvider
CHANGED, NEVER_RELEASED, RELEASED
Fields inherited from interface de.espirit.firstspirit.access.store.PackagePoolItem
BLOCKED, MODIFIED, UNMODIFIED
-
Method Summary
Modifier and TypeMethodDescription@Nullable File
Get the given media as aFile
object in the language provided.Get the filename of the current media.@Nullable Object
getMediaContent
(Language language) @NotNull String
getName()
Deprecated.boolean
State if the media must be parsed during the generation (onlyFILE
)@Nullable Picture
getPicture
(@Nullable Language language) Get the given media as aPicture
object in the language provided.@Nullable String
getStoredUrl
(@Nullable Language language, @Nullable Resolution resolution) Get the stored URL for this node and the provided combination of language and resolution.int
getType()
@NotNull IDProvider.UidType
ReturnUID_TYPE
.boolean
Indicates whether this media is language dependent or not.void
makeLanguageDependent
(Language... languages) Makes this media language dependent.void
makeLanguageIndependent
(@NotNull 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 (onlyFILE
)Methods inherited from interface java.lang.Comparable
compareTo
Methods inherited from interface de.espirit.firstspirit.storage.HistoryProvider
asRevisionProvider, getHistory, getHistory
Methods inherited from interface de.espirit.firstspirit.access.store.IDProvider
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
Methods inherited from interface de.espirit.firstspirit.access.store.PackagePoolItem
addToPackage, getChangeState, getPackage, getPackageName, isAddable, isChangeable, isPackageItem, isSubscribedItem, removeFromPackage, setChangeState
Methods inherited from interface de.espirit.firstspirit.access.store.Referenceable
getReferenceName
Methods inherited from interface de.espirit.firstspirit.access.store.StoreElement
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
Methods inherited from interface de.espirit.firstspirit.access.Workflowable
getColor, getTask, hasTask, removeTask, setColor, setTask
-
Field Details
-
FILE
static final int FILEType of the media: FILE- Since:
- 3.0
- See Also:
-
PICTURE
static final int PICTUREType of the media: PICTURE- Since:
- 3.0
- See Also:
-
UID_TYPE
Uid type, seeIDProvider.getUid()
.- Since:
- 4.0
-
-
Method Details
-
getType
int getType()- Returns:
- type of the media
- Since:
- 3.0
-
getName
Deprecated.since 4.1.10 - useIDProvider.getUid()
Get the unique name of the current media.- Specified by:
getName
in interfaceStoreElement
- Returns:
- unique name of the media
- Since:
- 3.0
-
isLanguageDependent
boolean isLanguageDependent()Indicates whether this media is language dependent or not.- Returns:
true
if this media is languagedependent,false
otherwise- Since:
- 3.0
-
makeLanguageIndependent
Makes this media language independent. Removes all language varieties (Images or Files and their descriptions) except for the one provided as an argument.- Parameters:
toKeep
- is the one Language to keep when reducing to one single language- Since:
- 5.2.1606
-
makeLanguageDependent
Makes this media language dependent. Creates one set of media content (Picture
orFile
) and description for every project language.
Every language provided in the parameter list will be filled with the current language-independent media content and description.- Parameters:
languages
- to which of the project languages should data from the old (single) language be assigned?- Since:
- 5.2.1606
-
getFilename
String getFilename()Get the filename of the current media.- Returns:
- filename of the media
- Since:
- 3.0
-
setFilename
Set the filename of the current media.- Parameters:
filename
- new filename of the media- Since:
- 3.0
-
getParseFile
boolean getParseFile()State if the media must be parsed during the generation (onlyFILE
)- Returns:
true
if the file "must be parsed",false
otherwise- Since:
- 3.0
-
setParseFile
void setParseFile(boolean parseFile) Set if the media must be parsed during the generation (onlyFILE
)- Parameters:
parseFile
-true
file "must be parsed",false
"must not be parsed"- Since:
- 3.0
-
getMediaContent
-
getPicture
Get the given media as aPicture
object in the language provided. Passnull
if this media object islanguage independent
. -
getFile
Get the given media as aFile
object in the language provided. Passnull
if this media object islanguage independent
. -
save
void save()Save all changes made to media object.- Specified by:
save
in interfaceStoreElement
- Throws:
DuplicateReferenceNameException
- if a medium with thisIDProvider.getUid()
already exists on the server- Since:
- 2.3
- See Also:
-
getUidType
ReturnUID_TYPE
.- Specified by:
getUidType
in interfaceIDProvider
- Returns:
- the unique identifier
- Since:
- 4.0
- See Also:
-
getStoredUrl
@Nullable @Nullable String getStoredUrl(@Nullable @Nullable Language language, @Nullable @Nullable Resolution resolution) Get the stored URL for this node and the provided combination of language and resolution. Returnsnull
if no URL is (yet) stored.- Parameters:
language
- Language to get the URL for - ornull
for language independent media nodes.resolution
- Resolution to get the URL for - ornull
for instances oftype
FILE
.- Returns:
- The stored URL or
null
, if no URL is yet stored. - Throws:
NullPointerException
- if parameterlanguage
isnull
and this node islanguage dependent
or parameterresolution
isnull
and this node is oftype
PICTURE
.- Since:
- 5.0.4
- See Also:
-
IDProvider.getUid()