org.bibalex.daf.entities
Class Collection

java.lang.Object
  extended by org.bibalex.daf.entities.AdminModuleBase
      extended by org.bibalex.daf.entities.Collection

public class Collection
extends AdminModuleBase

Author:
shehab.kamal

Field Summary
private  java.lang.String collAbrevation
           
private  boolean collActive
           
private  boolean collAnyUser
           
private  boolean collAnyWorkstation
           
private  java.lang.String collComment
           
private  java.lang.String collDefaultPath
           
private  java.lang.String collName
           
private  int collPriority
           
private  DBConnection conn
           
private  int IcgID
           
private  int id
           
private  int OwnID
           
private  int PrjID
           
 
Constructor Summary
Collection()
          Class Constructor, empty constructor creates an empty object, used to create new Collections
Collection(DataTable table)
          Constructor, creates a new Collection Object using the Collection DataTable without hitting the database.
Collection(int collID)
          Constructor, creates a new Collection Object using the Collection ID, by retrieving the information from the database.
 
Method Summary
 OperationInfo add()
          Add new collection
 OperationInfo delete()
          delete collection
 OperationInfo deleteCascade()
          delete collection in cascade
 OperationInfo getBatches()
          Gets the batches of this collection.
static OperationInfo getByID(int recID)
          select collection
 java.lang.String getCollAbbrevation()
          get Collection Abbreviation
 boolean getCollActive()
          get Collection collActive
 boolean getCollAnyUser()
          get Collection CollAnyUser
 boolean getCollAnyWorkstation()
          get Collection CollAnyWorkstation
 java.lang.String getCollComment()
          get Collection Comment
 java.lang.String getCollDefaultPath()
          get Collection Default Path
 java.lang.String getCollName()
          get Collection Name
 int getCollPriority()
          get Collection Priority
 int getIcgID()
          get Collection In-Charge ID
 int getID()
          Gets the collection ID.
 int getOwnID()
          get Collection Owner ID
 int getPrjID()
          get Collection Project ID
 OperationInfo getUsers()
          select collection's Users
 OperationInfo getWorkStations()
          select collection's WorkStations
static OperationInfo loadAll()
          Load all collections
 void setCollAbbrevation(java.lang.String collAbrevationValue)
          set Collection Abbreviation
 void setCollActive(boolean collActiveValue)
          set Collection collActive
 void setCollAnyUser(boolean collAnyUserValue)
          set Collection CollAnyUser
 void setCollAnyWorkstation(boolean collAnyWorkstationValue)
          set Collection CollAnyWorkstation
 void setCollComment(java.lang.String collCommentValue)
          set Collection Comment
 void setCollDefaultPath(java.lang.String collDefaultPathValue)
          set Collection Default Path
 void setCollName(java.lang.String collNameValue)
          set Collection Name
 void setCollPriority(int collPriorityValue)
          set Collection Priority
 void setFieldsFromDataTable(DataTable table)
          Adjust the values of the Collection Object given a DataTable.
 void setIcgID(int IcgIDValue)
          set Collection InCharge ID
 void setID(int collectionID)
          Sets the collection ID
 void setOwnID(int OwnIDValue)
          set Collection Owner ID
 void setPrjID(int PrjIDValue)
          set Collection Project ID
 OperationInfo update()
          update collection
 OperationInfo updateUsers(java.lang.Object[] usersIDs)
          Updates the Users assigned to Work with this Collection (allowed Users).
 OperationInfo updateWorkStations(java.lang.Object[] wsIDs)
          Updates the Workstations assigned to Work with this Collection (allowed Workstations).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

conn

private DBConnection conn

id

private int id

collName

private java.lang.String collName

collAbrevation

private java.lang.String collAbrevation

collDefaultPath

private java.lang.String collDefaultPath

collComment

private java.lang.String collComment

OwnID

private int OwnID

PrjID

private int PrjID

IcgID

private int IcgID

collPriority

private int collPriority

collAnyUser

private boolean collAnyUser

collAnyWorkstation

private boolean collAnyWorkstation

collActive

private boolean collActive
Constructor Detail

Collection

public Collection()
Class Constructor, empty constructor creates an empty object, used to create new Collections


Collection

public Collection(int collID)
           throws java.lang.Exception
Constructor, creates a new Collection Object using the Collection ID, by retrieving the information from the database.

Parameters:
collID - The Collection ID in the database to use in creating and filling the Collection Information.
Throws:
java.lang.Exception - Object creation was not successfull.

Collection

public Collection(DataTable table)
           throws java.lang.Exception
Constructor, creates a new Collection Object using the Collection DataTable without hitting the database.

Parameters:
table - The table containig the Collection Information (a table with a single row, or the first row).
Throws:
java.lang.Exception - Object creation was not successfull.
Method Detail

setFieldsFromDataTable

public void setFieldsFromDataTable(DataTable table)
Adjust the values of the Collection Object given a DataTable.

Parameters:
table - The table containig the Collection Information (a table with a single row, or the first row).

loadAll

public static OperationInfo loadAll()
Load all collections

Returns:
OperationInfo (bool, DataTable)

getByID

public static OperationInfo getByID(int recID)
select collection

Parameters:
recID - is the record to be selected
Returns:
OperationInfo (bool, DataTable) for the selected record

add

public OperationInfo add()
Add new collection

Specified by:
add in class AdminModuleBase
Returns:
OperationInfo (bool, DataTable) for the added record

delete

public OperationInfo delete()
delete collection

Specified by:
delete in class AdminModuleBase
Returns:
OperationInfo (bool, DataTable)

deleteCascade

public OperationInfo deleteCascade()
delete collection in cascade

Returns:
OperationInfo (bool, DataTable)

update

public OperationInfo update()
update collection

Specified by:
update in class AdminModuleBase
Returns:
OperationInfo (bool, DataTable) for the updated record

updateWorkStations

public OperationInfo updateWorkStations(java.lang.Object[] wsIDs)
Updates the Workstations assigned to Work with this Collection (allowed Workstations). This method deletes all assigned Workstations and re-assign them from scratch to the newly provided IDs even if it is the same original list or has minor changes..

Parameters:
wsIDs - An Object[] containing the Workstation IDs to Update with.
Returns:
OperationInfo to indicate weither the operation was successfull or not.

updateUsers

public OperationInfo updateUsers(java.lang.Object[] usersIDs)
Updates the Users assigned to Work with this Collection (allowed Users). This method deletes all assigned Users and re-assign them from scratch to the newly provided IDs even if it is the same original list or has minor changes..

Parameters:
usersIDs - An Object[] containing the User IDs to Update with.
Returns:
OperationInfo to indicate weither the operation was successfull or not.

getWorkStations

public OperationInfo getWorkStations()
select collection's WorkStations

Returns:
OperationInfo (bool, DataTable) for the collection's WorkStations

getUsers

public OperationInfo getUsers()
select collection's Users

Returns:
OperationInfo (bool, DataTable) for the collection's Users

getBatches

public OperationInfo getBatches()
Gets the batches of this collection.

Returns:
An OperationInfo whose result holds the batches of the job.

getID

public int getID()
Gets the collection ID.

Returns:
The ID of the current Instance Collection.

setID

public void setID(int collectionID)
Sets the collection ID

Parameters:
collectionID - The ID of the collection.

setCollName

public void setCollName(java.lang.String collNameValue)
set Collection Name

Parameters:
collNameValue - is the Collection name value

setCollAbbrevation

public void setCollAbbrevation(java.lang.String collAbrevationValue)
set Collection Abbreviation

Parameters:
collAbrevationValue - is the Collection Abbreviation value

setCollDefaultPath

public void setCollDefaultPath(java.lang.String collDefaultPathValue)
set Collection Default Path

Parameters:
collDefaultPathValue - is the Collection Default Path value

setCollComment

public void setCollComment(java.lang.String collCommentValue)
set Collection Comment

Parameters:
collCommentValue - is the Collection comment value

setOwnID

public void setOwnID(int OwnIDValue)
set Collection Owner ID

Parameters:
OwnIDValue - is the collection owner ID value

setPrjID

public void setPrjID(int PrjIDValue)
set Collection Project ID

Parameters:
PrjIDValue - is the collection project ID value

setIcgID

public void setIcgID(int IcgIDValue)
set Collection InCharge ID

Parameters:
IcgIDValue - is the collection in-charge ID value

setCollPriority

public void setCollPriority(int collPriorityValue)
set Collection Priority

Parameters:
collPriorityValue - is the Collection priority value

setCollAnyUser

public void setCollAnyUser(boolean collAnyUserValue)
set Collection CollAnyUser

Parameters:
collAnyUserValue - Set it to 1 when the collection is dedicated for any user, otherwise set it to 0

setCollAnyWorkstation

public void setCollAnyWorkstation(boolean collAnyWorkstationValue)
set Collection CollAnyWorkstation

Parameters:
collAnyWorkstationValue - Set to "1" when the collection is dedicated for any WorkStation, otherwise set it to 0

setCollActive

public void setCollActive(boolean collActiveValue)
set Collection collActive

Parameters:
collActiveValue - Set to 1 when the collection is active, otherwise Set it to 0

getCollName

public java.lang.String getCollName()
get Collection Name

Returns:
collName

getCollAbbrevation

public java.lang.String getCollAbbrevation()
get Collection Abbreviation

Returns:
collAbrevation

getCollDefaultPath

public java.lang.String getCollDefaultPath()
get Collection Default Path

Returns:
collDefaultPath

getCollComment

public java.lang.String getCollComment()
get Collection Comment

Returns:
collComment

getOwnID

public int getOwnID()
get Collection Owner ID

Returns:
collOwnID

getPrjID

public int getPrjID()
get Collection Project ID

Returns:
PrjID

getIcgID

public int getIcgID()
get Collection In-Charge ID

Returns:
IcgID

getCollPriority

public int getCollPriority()
get Collection Priority

Returns:
collPriority

getCollAnyUser

public boolean getCollAnyUser()
get Collection CollAnyUser

Returns:
collAnyUser

getCollAnyWorkstation

public boolean getCollAnyWorkstation()
get Collection CollAnyWorkstation

Returns:
collAnyWorkstation

getCollActive

public boolean getCollActive()
get Collection collActive

Returns:
collActive