3.0.4: 2012-03-05

net.sf.basedb.core
Class ItemSubtypeFileType

java.lang.Object
  extended by net.sf.basedb.core.BasicItem<D>
      extended by net.sf.basedb.core.BasicChildItem<ItemSubtypeFileTypeData>
          extended by net.sf.basedb.core.ItemSubtypeFileType
All Implemented Interfaces:
AccessControlled, Identifiable, UsableDataFileType

public class ItemSubtypeFileType
extends BasicChildItem<ItemSubtypeFileTypeData>
implements UsableDataFileType

This class represents a specific DataFileType that is associated with an item subtype.

Since:
3.0
Author:
Nicklas
Last modified
$Date $

Field Summary
private static QueryRuntimeFilter RUNTIME_FILTER
          This filter will only return items if the logged in user has generic read permission to item subtypes.
static Item TYPE
          The type of item represented by this class.
 
Constructor Summary
ItemSubtypeFileType(ItemSubtypeFileTypeData data)
          Creates a new member item from the given data.
 
Method Summary
 boolean getAllowMultiple()
          Check if more than one file of this type is allowed in a file set or not.
static ItemSubtypeFileType getById(DbControl dc, int id)
          Get a PlatformFileType object when you know the ID.
 DataFileType getDataFileType()
          Get the type of the file.
 ItemSubtype getItemSubtype()
          Get the item subtype.
(package private) static ItemSubtypeFileType getNew(DbControl dc, ItemSubtype subtype, DataFileType fileType)
          Create a new item linking a file type to an item subtype.
(package private)  Item getParentType()
          Get the type of item that is the parent of this item.
static ItemQuery<ItemSubtypeFileType> getQuery(ItemSubtype subtype)
          Get the file types that have been registered for a specific item subtype.
 Item getType()
          Get the type of item represented by the object.
 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.
 
Methods inherited from class net.sf.basedb.core.BasicChildItem
getPermissionForWriteDeleteAndCreate, getPluginPermissions, initPermissions
 
Methods inherited from class net.sf.basedb.core.BasicItem
addUsingItems, addUsingItems, checkPermission, equals, getData, getDbControl, getId, getPermissions, getSessionControl, getUsingItems, getVersion, hashCode, hasPermission, isDetached, isInDatabase, isUsed, onAfterCommit, onAfterInsert, onBeforeCommit, onRollback, setDbControl, setProjectDefaults, toString, toTransferable, validate
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

TYPE

public static final Item TYPE
The type of item represented by this class.

See Also:
Item.ITEMSUBTYPEFILETYPE, getType()

RUNTIME_FILTER

private static final QueryRuntimeFilter RUNTIME_FILTER
This filter will only return items if the logged in user has generic read permission to item subtypes.

Constructor Detail

ItemSubtypeFileType

ItemSubtypeFileType(ItemSubtypeFileTypeData data)
Creates a new member item from the given data.

Parameters:
data - the data.
Method Detail

getNew

static ItemSubtypeFileType getNew(DbControl dc,
                                  ItemSubtype subtype,
                                  DataFileType fileType)
Create a new item linking a file type to an item subtype.

Parameters:
dc -
subtype - The item subtype
fileType - The file type

getById

public static ItemSubtypeFileType getById(DbControl dc,
                                          int id)
                                   throws ItemNotFoundException,
                                          PermissionDeniedException,
                                          BaseException
Get a PlatformFileType object when you know the ID.

Parameters:
dc - The DbControl which will be used for permission checking and database access.
id - The ID of the item to load
Returns:
The PlatformFileType item
Throws:
ItemNotFoundException - If an item with the specified ID is not found
PermissionDeniedException - If the logged in user doesn't have Permission.READ permission to the item
BaseException - If there is another error

getQuery

public static ItemQuery<ItemSubtypeFileType> getQuery(ItemSubtype subtype)
Get the file types that have been registered for a specific item subtype.

Parameters:
subtype - An item subtype object or null to return items for all platforms
Returns:
A query returning ItemSubtypeFileType items

getType

public Item getType()
Description copied from interface: Identifiable
Get the type of item represented by the object. The returned value is one of the values defined in the Item enumeration.

Specified by:
getType in interface Identifiable
Returns:
A value indicating the type of item

getParentType

Item getParentType()
Description copied from class: BasicChildItem
Get the type of item that is the parent of this item.

Specified by:
getParentType in class BasicChildItem<ItemSubtypeFileTypeData>
Returns:
The item type of the parent item

getItemSubtype

public ItemSubtype getItemSubtype()
Get the item subtype.

Returns:
A subtype item

getDataFileType

public DataFileType getDataFileType()
Get the type of the file.

Specified by:
getDataFileType in interface UsableDataFileType
Returns:
A file set member type item

isRequired

public boolean isRequired()
Check if a file of this type is required or not. Note! The requirement is not enforced by the core. It should be used as a hint to client applications so they can create a proper GUI. To check if a FileSet contains all files that have been marked as required use FileSet.hasAllRequiredFiles().

Specified by:
isRequired in interface UsableDataFileType

setRequired

public void setRequired(boolean required)
Set the required flag for this file type.


getAllowMultiple

public boolean getAllowMultiple()
Check if more than one file of this type is allowed in a file set or not. Note! The requirement is not enforced by the core. It should be used as a hint to client applications so they can create a proper GUI.

Specified by:
getAllowMultiple in interface UsableDataFileType

setAllowMultiple

public void setAllowMultiple(boolean multiple)
Allow or disallow multiple files of this file type in a file set.


3.0.4: 2012-03-05