|
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<SoftwareTypeData> net.sf.basedb.core.SoftwareType
public class SoftwareType
This class is used to represent the type of
Software
items in BASE. Currently, the only type
of software we keep information about is feature extraction software.
It is not possible for client applications to create new
software types or modify existing ones.
Software
Field Summary | |
---|---|
static String |
FEATURE_EXTRACTION
The id for the SoftwareType item representing the
softwaretype "feature extraction software". |
private 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 | |
---|---|
SoftwareType(SoftwareTypeData data)
Creates a new softwaretype. |
Method Summary | |
---|---|
static SoftwareType |
getById(DbControl dc,
int id)
Get a SoftwareType 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 ItemQuery<SoftwareType> |
getQuery()
Get a query configured to retrieve software types. |
ItemQuery<Software> |
getSoftware()
Get a query that returns all software of this type |
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: Software 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: there are any Software using this type
|
Software |
newSoftware()
Create a new Software item of 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 |
---|
private static final Item TYPE
ITEM.SOFTWARETYPE
,
getType()
public static final String FEATURE_EXTRACTION
SoftwareType
item representing the
softwaretype "feature extraction software".
Constructor Detail |
---|
SoftwareType(SoftwareTypeData data)
data
- the dataMethod Detail |
---|
public static SoftwareType getById(DbControl dc, int id) throws ItemNotFoundException, PermissionDeniedException, BaseException
SoftwareType
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
SoftwareType
item
ItemNotFoundException
- This exception is thrown if an
item with the specified ID is not found
PermissionDeniedException
- This exception is thrown if
the logged in user doesn't have READ
permission to the items
BaseException
- This exception is thrown if there is another
errorpublic static ItemQuery<SoftwareType> getQuery() throws BaseException
ItemQuery
object
BaseException
- If getting the query fails.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 Item getType()
Identifiable
Item
enumeration.
getType
in interface Identifiable
public 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
Software
using this type
isUsed
in class BasicItem<SoftwareTypeData>
BaseException
- If not able to tell if item is used or not.BasicItem.getUsingItems()
public Set<ItemProxy> getUsingItems()
Software
of this type
getUsingItems
in class BasicItem<SoftwareTypeData>
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<SoftwareTypeData>
granted
- Permissions that have been granted by the subclassdenied
- Permissions that have been denied by the subclass
BaseException
- If the permissions couldn't be initialisedpublic Software newSoftware() throws PermissionDeniedException, BaseException
Software
item of this type.
Software
item
DetachedItemException
- If this SoftwareType is detached from DbControl.
PermissionDeniedException
- This exception is thrown if
the logged in user doesn't have CREATE
permission for software items or USE
permission for this software type
BaseException
- This exception is thrown if there is another
errorpublic ItemQuery<Software> getSoftware()
ItemQuery
object
|
2.17.2: 2011-06-17 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |