public class PlatformFileType extends BasicChildItem<PlatformFileTypeData> implements UsableDataFileType
DataFileType
that is part of a platform.Modifier and Type | Field and Description |
---|---|
private static QueryRuntimeFilter |
RUNTIME_FILTER
This filter will only return items if the logged in user has
generic read permission to platforms.
|
static Item |
TYPE
The type of item represented by this class.
|
Constructor and Description |
---|
PlatformFileType(PlatformFileTypeData data)
Creates a new member item from the given data.
|
Modifier and Type | Method and Description |
---|---|
boolean |
getAllowMultiple()
Check if more than one file of this type is allowed in a file set or not.
|
static PlatformFileType |
getById(DbControl dc,
int id)
Get a
PlatformFileType object when you know the ID. |
DataFileType |
getDataFileType()
Get the type of the file.
|
(package private) static PlatformFileType |
getNew(DbControl dc,
Platform platform,
PlatformVariant variant,
DataFileType fileType)
Create a new item linking a file type to a platform/variant.
|
(package private) Item |
getParentType()
Get the type of item that is the parent of this item.
|
Platform |
getPlatform()
Get the platform.
|
static ItemQuery<PlatformFileType> |
getQuery(Platform platform,
PlatformVariant variant,
boolean restrict)
Get the file types that have been registered for a specific platform
and variant.
|
Item |
getType()
Get the type of item represented by the object.
|
PlatformVariant |
getVariant()
Get the platform variant.
|
boolean |
isRequired()
Check if a file of this type is required or not.
|
void |
setAllowMultiple(boolean multiple)
Allow or disallow multiple files of this file type in a file set.
|
void |
setRequired(boolean required)
Set the required flag for this file type.
|
getPermissionForWriteDeleteAndCreate, getPluginPermissions, initPermissions
addUsingItems, addUsingItems, checkPermission, equals, getData, getDbControl, getId, getPermissions, getSessionControl, getUsingItems, getVersion, hashCode, hasPermission, isDetached, isInDatabase, isUsed, onAfterCommit, onAfterInsert, onBeforeCommit, onRollback, setDbControl, setProjectDefaults, toString, validate
public static final Item TYPE
Item.PLATFORMFILETYPE
,
getType()
private static final QueryRuntimeFilter RUNTIME_FILTER
PlatformFileType(PlatformFileTypeData data)
data
- the data.static PlatformFileType getNew(DbControl dc, Platform platform, PlatformVariant variant, DataFileType fileType)
dc
- platform
- The platformvariant
- The variant (optional)fileType
- The file typepublic static PlatformFileType getById(DbControl dc, int id) throws ItemNotFoundException, PermissionDeniedException, BaseException
PlatformFileType
object when you know the ID.dc
- The DbControl
which will be used for
permission checking and database access.id
- The ID of the item to loadPlatformFileType
itemItemNotFoundException
- If an item with the specified ID is not foundPermissionDeniedException
- If the logged in user doesn't have
Permission.READ
permission to the itemBaseException
- If there is another errorpublic static ItemQuery<PlatformFileType> getQuery(Platform platform, PlatformVariant variant, boolean restrict)
restrict
parameter is TRUE the query will
be restricted to return fewer items. It works like this:
platform
and
variant
is null
variant
is null, the query will return file
types the platform and all variants if restrict=false
. If
restrict=true
the query will only return items
registered directly with the platform
variant
isn't null, the query will return file
types that have been registered for that variant plus file
types registered with the platform if restrict=false
.
If restrict=true
the query will only return file types
registered for that particular variant.
platform
- A platform object or null to return items for
all platformsvariant
- A platform variant or null to return items for all
variantsrestrict
- Indicates if the query should be restricted to inlcude
fewer itemsPlatformFileType
itemspublic Item getType()
Identifiable
Item
enumeration.getType
in interface Identifiable
Item getParentType()
BasicChildItem
getParentType
in class BasicChildItem<PlatformFileTypeData>
public Platform getPlatform()
public PlatformVariant getVariant()
public DataFileType getDataFileType()
getDataFileType
in interface UsableDataFileType
public boolean isRequired()
FileSet
contains all files that have been marked as required
use FileSet.hasAllRequiredFiles()
.isRequired
in interface UsableDataFileType
public void setRequired(boolean required)
public boolean getAllowMultiple()
getAllowMultiple
in interface UsableDataFileType
public void setAllowMultiple(boolean multiple)