|
2.17.2: 2011-06-17 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sf.basedb.core.BasicItem<FileTypeData> net.sf.basedb.core.FileType
public class FileType
This class is used to represent the type of
File
items in BASE.
File
Field Summary | |
---|---|
static String |
EXTRAVALUE_DATA
The id for the FileType item representing a
file containing analysed extra value data. |
static String |
IMAGE
The id for the FileType item representing an
image file. |
static String |
PLATE
The id for the FileType item representing a
plate file. |
static String |
PLATE_MAPPING
The id for the FileType item representing a
plate mapping file. |
static String |
PRINT_MAP
The id for the FileType item representing a
print map file. |
static String |
PROTOCOL
The id for the FileType item representing a
protocol. |
static String |
RAW_DATA
The id for the FileType item representing a
raw data file. |
static String |
REPORTER
The id for the FileType item representing a
reporter file. |
static String |
REPORTER_MAP
The id for the FileType item representing a
reporter map file. |
static String |
SPOT_DATA
The id for the FileType item representing a
file containing analysed spot data. |
static String |
SPOT_IMAGES
The id for the FileType item representing a
spot images file. |
static Item |
TYPE
The type of item represented by this class. |
Fields inherited from interface net.sf.basedb.core.Nameable |
---|
MAX_DESCRIPTION_LENGTH, MAX_NAME_LENGTH |
Fields inherited from interface net.sf.basedb.core.SystemItem |
---|
MAX_SYSTEM_ID_LENGTH |
Constructor Summary | |
---|---|
FileType(FileTypeData data)
Creates a new filetype item from the given data. |
Method Summary | |
---|---|
static FileType |
getById(DbControl dc,
int id)
Get a FileType object when you know the ID. |
String |
getDescription()
Get the description for the item. |
Date |
getEntryDate()
Get the date that the item was registered in the database. |
String |
getName()
Get the name of the item. |
static PropertyFilter |
getPropertyFilter(String id)
Create a PropertyFilter object that can be used to
filter files by their file type: file.fileType = FileType |
static PropertyFilter |
getPropertyFilter(String id,
boolean temporary)
Create a PropertyFilter object that can be used to
filter files by their file type: file.fileType = FileType |
static ItemQuery<FileType> |
getQuery()
Get a query configured to retrieve FileType items. |
String |
getSystemId()
Get the system id for the item. |
Item |
getType()
Get the type of item represented by the object. |
Set<ItemProxy> |
getUsingItems()
Get all: File :s of this type
|
(package private) void |
initPermissions(int granted,
int denied)
Initialise the logged in user's permissions for this item. |
boolean |
isSystemItem()
Check if the item is a system item or not. |
boolean |
isUsed()
Check if: any file has been assigned this type |
void |
setDescription(String description)
Set the description for the item. |
void |
setName(String name)
Set the name of the item. |
Methods inherited from class net.sf.basedb.core.BasicItem |
---|
addUsingItems, addUsingItems, checkPermission, equals, getData, getDbControl, getId, getPermissions, getPluginPermissions, getSessionControl, getVersion, hashCode, hasPermission, isDetached, isInDatabase, onAfterCommit, onAfterInsert, onBeforeCommit, onRollback, setDbControl, setProjectDefaults, toString, toTransferable, validate |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface net.sf.basedb.core.Identifiable |
---|
getId, getVersion |
Methods inherited from interface net.sf.basedb.core.AccessControlled |
---|
checkPermission, getPermissions, hasPermission |
Field Detail |
---|
public static final Item TYPE
Item.FILETYPE
,
getType()
public static final String PROTOCOL
FileType
item representing a
protocol.
public static final String RAW_DATA
FileType
item representing a
raw data file.
public static final String PLATE_MAPPING
FileType
item representing a
plate mapping file.
public static final String REPORTER_MAP
FileType
item representing a
reporter map file.
public static final String PRINT_MAP
FileType
item representing a
print map file.
public static final String IMAGE
FileType
item representing an
image file.
public static final String SPOT_IMAGES
FileType
item representing a
spot images file.
public static final String REPORTER
FileType
item representing a
reporter file.
public static final String PLATE
FileType
item representing a
plate file.
public static final String SPOT_DATA
FileType
item representing a
file containing analysed spot data.
public static final String EXTRAVALUE_DATA
FileType
item representing a
file containing analysed extra value data.
Constructor Detail |
---|
FileType(FileTypeData data)
data
- the data.Method Detail |
---|
public static FileType getById(DbControl dc, int id) throws ItemNotFoundException, PermissionDeniedException, BaseException
FileType
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 load
FileType
item
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 items
BaseException
- If there is another errorpublic static ItemQuery<FileType> getQuery() throws BaseException
FileType
items.
ItemQuery
object
BaseException
- If getting the query fails.public static PropertyFilter getPropertyFilter(String id)
PropertyFilter
object that can be used to
filter files by their file type: file.fileType = FileType
id
- The id of the file type.
PropertyFilter
objectItemContext.setPropertyFilter(PropertyFilter)
public static PropertyFilter getPropertyFilter(String id, boolean temporary)
PropertyFilter
object that can be used to
filter files by their file type: file.fileType = FileType
id
- The id of the file type.temporary
- A flag indicating if the filter should be temporary or not
PropertyFilter
objectItemContext.setPropertyFilter(PropertyFilter)
public Item getType()
Identifiable
Item
enumeration.
getType
in interface Identifiable
public String getName()
Nameable
getName
in interface Nameable
String
with the name of the itempublic void setName(String name) throws PermissionDeniedException, InvalidDataException
Nameable
Nameable.MAX_NAME_LENGTH
constant.
setName
in interface Nameable
name
- The new name for the item
PermissionDeniedException
- If the logged in user doesn't
have write permission
InvalidDataException
- If the name is null or longer
than specified by the Nameable.MAX_NAME_LENGTH
constantpublic String getDescription()
Nameable
getDescription
in interface Nameable
String
with a description of the itempublic void setDescription(String description) throws PermissionDeniedException, InvalidDataException
Nameable
Nameable.MAX_DESCRIPTION_LENGTH
constant.
setDescription
in interface Nameable
description
- The new description for the item
PermissionDeniedException
- If the logged in user doesn't
have write permission
InvalidDataException
- If the description longer
than specified by the Nameable.MAX_DESCRIPTION_LENGTH
constantpublic String getSystemId()
SystemItem
getSystemId
in interface SystemItem
public boolean isSystemItem()
SystemItem
isSystemItem
in interface SystemItem
public Date getEntryDate()
Registered
getEntryDate
in interface Registered
public boolean isUsed() throws BaseException
isUsed
in class BasicItem<FileTypeData>
BaseException
- If there is an errorBasicItem.getUsingItems()
public Set<ItemProxy> getUsingItems()
File
:s of this type
getUsingItems
in class BasicItem<FileTypeData>
BasicItem.addUsingItems(Set, Item, org.hibernate.Query)
void initPermissions(int granted, int denied) throws BaseException
BasicItem
Subclasses that needs to check other keys or properties, such
as the OwnedItem
and SharedItem
should override
this method. The subclass should calculate additional permissions
to be granted or denied, and combine those with whatever was passed
as parameters. Use the binary OR operator ( | ) to combine
the permissions. Finally the subclass must call
super.initPermissions(granted, denied)
.
initPermissions
in class BasicItem<FileTypeData>
granted
- Permissions that have been granted by the subclassdenied
- Permissions that have been denied by the subclass
BaseException
- If the permissions couldn't be initialised
|
2.17.2: 2011-06-17 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |