de.fh_mannheim.mm.dms.framework
Class Upload

java.lang.Object
  extended byde.fh_mannheim.mm.dms.framework.Upload
All Implemented Interfaces:
IElement
Direct Known Subclasses:
Bookmark, SearchResult

public class Upload
extends java.lang.Object
implements IElement

Discribes an upload order.

Version:
$Revision: 1.30 $
Author:
Jan Löffler, mail@jlsoft.de

Field Summary
static int FILESTATE_COUNT
           
static int FILESTATE_EXTERNAL
           
static int FILESTATE_MISSING
           
static int FILESTATE_OK
          Filestates
static int FILETYPE_ALL
           
static int FILETYPE_CHM
           
static int FILETYPE_COUNT
           
static int FILETYPE_DOC
           
static int FILETYPE_HTML
          Filetypes
static int FILETYPE_PDF
           
static int FILETYPE_PPT
           
static int FILETYPE_PS
           
static int FILETYPE_RAR
           
static int FILETYPE_RTF
           
static int FILETYPE_TXT
           
static int FILETYPE_XLS
           
static int FILETYPE_XML
           
static int FILETYPE_ZIP
           
static int LANGUAGE_COUNT
           
static int LANGUAGE_ENGLISH
          Languages
static int LANGUAGE_FRENCH
           
static int LANGUAGE_GERMAN
           
static int LANGUAGE_MULTILINGUAL
           
static int NEW_DAYRANGE
           
static int PRIORITY_COUNT
           
static int PRIORITY_HIGH
           
static int PRIORITY_LOW
          Priorities
static int PRIORITY_NORMAL
           
static int PRIORITY_REALTIME
           
static java.lang.String strEXTENSION_ALL
          File-Extensions
static java.lang.String strEXTENSION_BMP
           
static java.lang.String strEXTENSION_CHM
           
static java.lang.String strEXTENSION_CLASS
           
static java.lang.String strEXTENSION_CSS
           
static java.lang.String strEXTENSION_DOC
           
static java.lang.String strEXTENSION_GIF
          Optional filetypes
static java.lang.String strEXTENSION_HTM
           
static java.lang.String strEXTENSION_HTML
           
static java.lang.String strEXTENSION_JPG
           
static java.lang.String strEXTENSION_JS
           
static java.lang.String strEXTENSION_PDF
           
static java.lang.String strEXTENSION_PNG
           
static java.lang.String strEXTENSION_PPS
           
static java.lang.String strEXTENSION_PPT
           
static java.lang.String strEXTENSION_PS
           
static java.lang.String strEXTENSION_RAR
           
static java.lang.String strEXTENSION_RTF
           
static java.lang.String strEXTENSION_TXT
           
static java.lang.String strEXTENSION_XLS
           
static java.lang.String strEXTENSION_XML
           
static java.lang.String strEXTENSION_ZIP
           
static java.lang.String strUNKNOWN
          Description of public declarations
static int UNKNOWN
          UKNOWN is set as initial value for id of upload
 
Constructor Summary
Upload()
          Constructor.
Upload(int nID, java.lang.String strTitle, java.lang.String strFilename, java.lang.String strDescription, int nAuthorID, FormattedDate date, int nPriority, Category cat, int nLanguage)
          Constructor.
Upload(java.lang.String strTitle, java.lang.String strFilename, java.lang.String strDescription, int nAuthorID)
          Constructor.
 
Method Summary
 boolean equals(java.lang.Object other)
          Compares two Upload objects.
 int getAuthorID()
          Get ID of author.
 java.lang.String getAuthorname()
          Get author name.
static java.lang.String[] getAvailableLanguages()
          Get all available languages of files as text.
 Category getCategory()
          Get category of upload.
 java.lang.String getDescription()
          Get filedescription.
static java.lang.String getExtension(int nFiletype)
          Get extension of filetype.
 java.lang.String getFilename()
          Get filename.
 int getFiletype()
          Get filetype of file.
static int getFiletype(java.lang.String strFilename)
          Get filetype by filename.
static int getFiletypeByName(java.lang.String strFiletype)
          Get filetype by name.
 java.lang.String getFiletypeShortText()
          Get filetype of file as text.
static java.lang.String getFiletypeShortText(int nFiletype)
          Get filetype of file as text.
 java.lang.String getFiletypeText()
          Get filetype of file as text.
static java.lang.String getFiletypeText(int nFiletype)
          Get filetype of file as text.
 int getID()
          Get ID of upload order.
 int getLanguage()
          Get language of file.
static int getLanguage(java.lang.String strLanguage)
          Get language by name.
 java.lang.String getLanguageText()
          Get language of file as text.
static java.lang.String getLanguageText(int nLanguage)
          Get language of file as text.
 java.lang.String getPath()
          Get path.
 int getPriority()
          Get priority of file.
static int getPriority(java.lang.String strPriority)
          Get priority by name.
 java.lang.String getPriorityText()
          Get priotity of file as text.
static java.lang.String getPriorityText(int nPriority)
          Get priority of file as text.
 FileSize getSize()
          Get size of file.
 FileSize getSize(UploadManager uplMgr)
          Get size of file.
 int getState()
          Get state of file.
 int getState(UploadManager uplMgr)
          Get state of file.
 java.lang.String getStateText()
          Get state of file as string.
static java.lang.String getStateText(int nState)
          Get state of file as text.
 java.lang.String getStateText(UploadManager uplMgr)
          Get state of file as string.
 java.lang.String getTitle()
          Get file title.
 FormattedDate getUploadDate()
          Get upload date.
 boolean isKnownLanguage()
          Is language of file a known language.
static boolean isKnownLanguage(int nLanguage)
          Is language of file a known language.
 boolean isNew()
          Is file new, e.g. younger than 2 weeks.
 boolean isOptionalFiletype()
          Is filetype of file a known filetype.
static boolean isOptionalFiletype(java.lang.String strFilename)
          Test if a file is valid as optional file for this project.
 boolean isURL()
          Is file local or on another server.
 boolean isValidFiletype()
          Is filetype of file a known filetype.
static boolean isValidFiletype(java.lang.String strFilename)
          Test if a file is valid for this project.
 void setAuthor(int nAuthorID)
          Set ID of author.
 void setAuthorname(java.lang.String strAuthorname)
          Set name of author.
 void setCategory(Category cat)
          Set category of upload.
 void setDescription(java.lang.String strDescription)
          Set filedescription of upload order.
 void setFilename(java.lang.String strFilename)
          Set filename of upload order.
 void setID(int nID)
          Set ID of upload order.
 void setLanguage(int nLanguage)
          Set language of upload.
 void setPriority(int nPriority)
          Set priority of upload.
 void setSize(int nSize)
          Set size of file.
 void setSize(UploadManager uplMgr)
          Set size of file.
 void setState(int nState)
          Set state of file.
 void setState(UploadManager uplMgr)
          Set state of file.
 void setTitle(java.lang.String strTitle)
          Set filetitle of upload order.
 void setUploadDate()
          Set actual date to upload order.
 void setUploadDate(FormattedDate date)
          Set date of upload order.
 org.w3c.dom.Element toElement(org.w3c.dom.Document doc)
          Write information of upload in a xml element.
 org.w3c.dom.Element toElement(org.w3c.dom.Element element, org.w3c.dom.Document doc)
          Write information of upload in a xml element.
 java.lang.String toString()
          Write information of uploadorder in a string.
 
Methods inherited from class java.lang.Object
getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

UNKNOWN

public static final int UNKNOWN
UKNOWN is set as initial value for id of upload

See Also:
Constant Field Values

FILESTATE_OK

public static final int FILESTATE_OK
Filestates

See Also:
Constant Field Values

FILESTATE_EXTERNAL

public static final int FILESTATE_EXTERNAL
See Also:
Constant Field Values

FILESTATE_MISSING

public static final int FILESTATE_MISSING
See Also:
Constant Field Values

FILESTATE_COUNT

public static final int FILESTATE_COUNT
See Also:
Constant Field Values

FILETYPE_HTML

public static final int FILETYPE_HTML
Filetypes

See Also:
Constant Field Values

FILETYPE_XML

public static final int FILETYPE_XML
See Also:
Constant Field Values

FILETYPE_DOC

public static final int FILETYPE_DOC
See Also:
Constant Field Values

FILETYPE_TXT

public static final int FILETYPE_TXT
See Also:
Constant Field Values

FILETYPE_RTF

public static final int FILETYPE_RTF
See Also:
Constant Field Values

FILETYPE_PPT

public static final int FILETYPE_PPT
See Also:
Constant Field Values

FILETYPE_PDF

public static final int FILETYPE_PDF
See Also:
Constant Field Values

FILETYPE_PS

public static final int FILETYPE_PS
See Also:
Constant Field Values

FILETYPE_XLS

public static final int FILETYPE_XLS
See Also:
Constant Field Values

FILETYPE_CHM

public static final int FILETYPE_CHM
See Also:
Constant Field Values

FILETYPE_ZIP

public static final int FILETYPE_ZIP
See Also:
Constant Field Values

FILETYPE_RAR

public static final int FILETYPE_RAR
See Also:
Constant Field Values

FILETYPE_ALL

public static final int FILETYPE_ALL
See Also:
Constant Field Values

FILETYPE_COUNT

public static final int FILETYPE_COUNT
See Also:
Constant Field Values

LANGUAGE_ENGLISH

public static final int LANGUAGE_ENGLISH
Languages

See Also:
Constant Field Values

LANGUAGE_GERMAN

public static final int LANGUAGE_GERMAN
See Also:
Constant Field Values

LANGUAGE_FRENCH

public static final int LANGUAGE_FRENCH
See Also:
Constant Field Values

LANGUAGE_MULTILINGUAL

public static final int LANGUAGE_MULTILINGUAL
See Also:
Constant Field Values

LANGUAGE_COUNT

public static final int LANGUAGE_COUNT
See Also:
Constant Field Values

PRIORITY_LOW

public static final int PRIORITY_LOW
Priorities

See Also:
Constant Field Values

PRIORITY_NORMAL

public static final int PRIORITY_NORMAL
See Also:
Constant Field Values

PRIORITY_HIGH

public static final int PRIORITY_HIGH
See Also:
Constant Field Values

PRIORITY_REALTIME

public static final int PRIORITY_REALTIME
See Also:
Constant Field Values

PRIORITY_COUNT

public static final int PRIORITY_COUNT
See Also:
Constant Field Values

NEW_DAYRANGE

public static final int NEW_DAYRANGE
See Also:
Constant Field Values

strUNKNOWN

public static final java.lang.String strUNKNOWN
Description of public declarations

See Also:
Constant Field Values

strEXTENSION_ALL

public static final java.lang.String strEXTENSION_ALL
File-Extensions

See Also:
Constant Field Values

strEXTENSION_DOC

public static final java.lang.String strEXTENSION_DOC
See Also:
Constant Field Values

strEXTENSION_HTM

public static final java.lang.String strEXTENSION_HTM
See Also:
Constant Field Values

strEXTENSION_HTML

public static final java.lang.String strEXTENSION_HTML
See Also:
Constant Field Values

strEXTENSION_PDF

public static final java.lang.String strEXTENSION_PDF
See Also:
Constant Field Values

strEXTENSION_PPS

public static final java.lang.String strEXTENSION_PPS
See Also:
Constant Field Values

strEXTENSION_PPT

public static final java.lang.String strEXTENSION_PPT
See Also:
Constant Field Values

strEXTENSION_PS

public static final java.lang.String strEXTENSION_PS
See Also:
Constant Field Values

strEXTENSION_RAR

public static final java.lang.String strEXTENSION_RAR
See Also:
Constant Field Values

strEXTENSION_RTF

public static final java.lang.String strEXTENSION_RTF
See Also:
Constant Field Values

strEXTENSION_TXT

public static final java.lang.String strEXTENSION_TXT
See Also:
Constant Field Values

strEXTENSION_XLS

public static final java.lang.String strEXTENSION_XLS
See Also:
Constant Field Values

strEXTENSION_XML

public static final java.lang.String strEXTENSION_XML
See Also:
Constant Field Values

strEXTENSION_ZIP

public static final java.lang.String strEXTENSION_ZIP
See Also:
Constant Field Values

strEXTENSION_CHM

public static final java.lang.String strEXTENSION_CHM
See Also:
Constant Field Values

strEXTENSION_GIF

public static final java.lang.String strEXTENSION_GIF
Optional filetypes

See Also:
Constant Field Values

strEXTENSION_JPG

public static final java.lang.String strEXTENSION_JPG
See Also:
Constant Field Values

strEXTENSION_CSS

public static final java.lang.String strEXTENSION_CSS
See Also:
Constant Field Values

strEXTENSION_PNG

public static final java.lang.String strEXTENSION_PNG
See Also:
Constant Field Values

strEXTENSION_BMP

public static final java.lang.String strEXTENSION_BMP
See Also:
Constant Field Values

strEXTENSION_JS

public static final java.lang.String strEXTENSION_JS
See Also:
Constant Field Values

strEXTENSION_CLASS

public static final java.lang.String strEXTENSION_CLASS
See Also:
Constant Field Values
Constructor Detail

Upload

public Upload()
Constructor.


Upload

public Upload(int nID,
              java.lang.String strTitle,
              java.lang.String strFilename,
              java.lang.String strDescription,
              int nAuthorID,
              FormattedDate date,
              int nPriority,
              Category cat,
              int nLanguage)
Constructor.

Parameters:
nID - ID of upload
strTitle - Title of file
strFilename - Filename
strDescription - Description of file
nAuthorID - ID of user
date - Date of upload
nPriority - Priority of upload
cat - Category of upload
nLanguage - Language of content

Upload

public Upload(java.lang.String strTitle,
              java.lang.String strFilename,
              java.lang.String strDescription,
              int nAuthorID)
Constructor.

Parameters:
strTitle - Title of file
strFilename - Filename
strDescription - Description of file
nAuthorID - ID of user
Method Detail

getAvailableLanguages

public static java.lang.String[] getAvailableLanguages()
Get all available languages of files as text.

Returns:
Languages as text

getExtension

public static java.lang.String getExtension(int nFiletype)
Get extension of filetype.

Parameters:
nFiletype - Filetype
Returns:
extension

getFiletypeByName

public static int getFiletypeByName(java.lang.String strFiletype)
Get filetype by name.

Parameters:
strFiletype - Filetype of upload
Returns:
Filetype

getFiletype

public static int getFiletype(java.lang.String strFilename)
Get filetype by filename.

Parameters:
strFilename - Filename of upload
Returns:
Filetype

getFiletypeText

public static java.lang.String getFiletypeText(int nFiletype)
Get filetype of file as text.

Parameters:
nFiletype - Filetype
Returns:
filetype

getFiletypeShortText

public static java.lang.String getFiletypeShortText(int nFiletype)
Get filetype of file as text.

Parameters:
nFiletype - Filetype
Returns:
filetype

getLanguage

public static int getLanguage(java.lang.String strLanguage)
Get language by name.

Parameters:
strLanguage - Language of upload
Returns:
Language

getLanguageText

public static java.lang.String getLanguageText(int nLanguage)
Get language of file as text.

Parameters:
nLanguage - Language
Returns:
Language

getPriority

public static int getPriority(java.lang.String strPriority)
Get priority by name.

Parameters:
strPriority - Priority of upload
Returns:
Priority

getPriorityText

public static java.lang.String getPriorityText(int nPriority)
Get priority of file as text.

Parameters:
nPriority - Priority
Returns:
Priority

getStateText

public static java.lang.String getStateText(int nState)
Get state of file as text.

Parameters:
nState - State
Returns:
State

isKnownLanguage

public static boolean isKnownLanguage(int nLanguage)
Is language of file a known language.

Parameters:
nLanguage - Language to check
Returns:
true, if language is known, otherwise return false

isValidFiletype

public static boolean isValidFiletype(java.lang.String strFilename)
Test if a file is valid for this project.

Parameters:
strFilename - Filename of upload
Returns:
true, if file is valid

isOptionalFiletype

public static boolean isOptionalFiletype(java.lang.String strFilename)
Test if a file is valid as optional file for this project.

Parameters:
strFilename - Filename of file
Returns:
true, if file is valid

equals

public boolean equals(java.lang.Object other)
Compares two Upload objects.

Parameters:
other - Upload to compare
Returns:
true, if equal

getAuthorID

public int getAuthorID()
Get ID of author.

Returns:
author ID

getAuthorname

public java.lang.String getAuthorname()
Get author name.

Returns:
name of author

getCategory

public Category getCategory()
Get category of upload.

Returns:
Category

getDescription

public java.lang.String getDescription()
Get filedescription.

Returns:
filedescription

getFilename

public java.lang.String getFilename()
Get filename.

Returns:
filename

getFiletype

public int getFiletype()
Get filetype of file.

Returns:
filetype

getFiletypeText

public java.lang.String getFiletypeText()
Get filetype of file as text.

Returns:
filetype

getFiletypeShortText

public java.lang.String getFiletypeShortText()
Get filetype of file as text.

Returns:
filetype

getID

public int getID()
Get ID of upload order.

Returns:
upload ID

getLanguage

public int getLanguage()
Get language of file.

Returns:
Language

getLanguageText

public java.lang.String getLanguageText()
Get language of file as text.

Returns:
Language

getPath

public java.lang.String getPath()
Get path.

Returns:
path

getPriority

public int getPriority()
Get priority of file.

Returns:
priority

getPriorityText

public java.lang.String getPriorityText()
Get priotity of file as text.

Returns:
Priority

getSize

public FileSize getSize()
Get size of file.

Returns:
size

getSize

public FileSize getSize(UploadManager uplMgr)
Get size of file.

Parameters:
uplMgr - Upload Manager
Returns:
size

getState

public int getState()
Get state of file.

Returns:
state

getState

public int getState(UploadManager uplMgr)
Get state of file.

Parameters:
uplMgr - Upload Manager
Returns:
state

getStateText

public java.lang.String getStateText()
Get state of file as string.

Returns:
state text

getStateText

public java.lang.String getStateText(UploadManager uplMgr)
Get state of file as string.

Parameters:
uplMgr - Upload Manager
Returns:
state text

getTitle

public java.lang.String getTitle()
Get file title.

Returns:
filetitle

getUploadDate

public FormattedDate getUploadDate()
Get upload date.

Returns:
date of upload

isKnownLanguage

public boolean isKnownLanguage()
Is language of file a known language.

Returns:
true, if language is known, otherwise return false

isValidFiletype

public boolean isValidFiletype()
Is filetype of file a known filetype.

Returns:
true, if filetype is known, otherwise return false

isNew

public boolean isNew()
Is file new, e.g. younger than 2 weeks.

Returns:
true, if file is new

isOptionalFiletype

public boolean isOptionalFiletype()
Is filetype of file a known filetype.

Returns:
true, if filetype is known, otherwise return false

isURL

public boolean isURL()
Is file local or on another server.

Returns:
true, if file is not local

setAuthor

public void setAuthor(int nAuthorID)
Set ID of author.

Parameters:
nAuthorID - ID of author

setAuthorname

public void setAuthorname(java.lang.String strAuthorname)
Set name of author.

Parameters:
strAuthorname - Name of author

setCategory

public void setCategory(Category cat)
Set category of upload.

Parameters:
cat - Category of upload

setDescription

public void setDescription(java.lang.String strDescription)
Set filedescription of upload order.

Parameters:
strDescription - Description of file

setFilename

public void setFilename(java.lang.String strFilename)
Set filename of upload order.

Parameters:
strFilename - Filename

setID

public void setID(int nID)
Set ID of upload order.

Parameters:
nID - Upload ID

setLanguage

public void setLanguage(int nLanguage)
Set language of upload.

Parameters:
nLanguage - Language of upload

setPriority

public void setPriority(int nPriority)
Set priority of upload.

Parameters:
nPriority - Priority of upload

setSize

public void setSize(int nSize)
Set size of file.

Parameters:
nSize - Filesize

setSize

public void setSize(UploadManager uplMgr)
Set size of file.

Parameters:
uplMgr - Upload Manager

setState

public void setState(int nState)
Set state of file.

Parameters:
nState - State of file

setState

public void setState(UploadManager uplMgr)
Set state of file.

Parameters:
uplMgr - Upload Manager

setTitle

public void setTitle(java.lang.String strTitle)
Set filetitle of upload order.

Parameters:
strTitle - Title of file

setUploadDate

public void setUploadDate()
Set actual date to upload order.


setUploadDate

public void setUploadDate(FormattedDate date)
Set date of upload order.

Parameters:
date - Date of upload

toElement

public org.w3c.dom.Element toElement(org.w3c.dom.Document doc)
Write information of upload in a xml element.

Specified by:
toElement in interface IElement
Parameters:
doc - XML Document
Returns:
element

toElement

public org.w3c.dom.Element toElement(org.w3c.dom.Element element,
                                     org.w3c.dom.Document doc)
Write information of upload in a xml element.

Specified by:
toElement in interface IElement
Parameters:
element - Root element
doc - XML Document
Returns:
element

toString

public java.lang.String toString()
Write information of uploadorder in a string.

Specified by:
toString in interface IElement
Returns:
information