com.xmlserv.app.shared
Class Image

java.lang.Object
  |
  +--com.xmlserv.app.shared.Image
Direct Known Subclasses:
DownloadImage

public class Image
extends java.lang.Object

Image abstraction. This class is used to manage images and related meta data. It contains basic information about an image (represented in the DB table images) such as the base filename (without path and extension), the preview image filename and mimetype. Additional information is dependend on an embedded Format object. When this is set, the relative path and filename as well as the mimetype can be retrieved.


Constructor Summary
Image()
          Create an empty Image.
Image(java.sql.Connection con, int id)
          Load image with given id from the DB.
Image(java.sql.Connection con, java.lang.String filename, int formatId)
          Create a new image object.
 
Method Summary
 java.lang.String getBasename()
           
 java.lang.String getBezeichnung()
           
 int getContentgroup()
           
 java.lang.String getDisplayname()
           
 java.lang.String getFilename()
          Return the filename.
 java.lang.String getFilePath()
          Get the complete filename including path.
 Format.Detail getFormat()
           
 int getId()
           
static org.jdom.Element getImageList(java.sql.Connection con, int rolegroup)
          Get a list of images for the given rolegroup.
 java.lang.String getKeywords()
           
 java.lang.String getMimetype()
           
 int getOrdering()
           
 int getRolegroup()
           
 java.lang.String getRolegroupname()
           
static org.jdom.Element listImages(java.sql.Connection con, int contentgroup)
           
static void main(java.lang.String[] args)
           
 void save(java.sql.Connection con, javax.servlet.http.HttpServletRequest req, SecurityManager securitymanager)
          Save the image to the DB.
 void setArtikelnr(java.lang.String artikelnr)
           
 void setBezeichnung(java.lang.String bezeichnung)
           
 void setContentgroup(int contentgroup)
           
 void setDisplayname(java.lang.String displayname)
           
 void setFilename(java.lang.String filename)
           
 void setFormat(Format.Detail format)
           
 void setKeywords(java.lang.String keywords)
           
 void setOrdering(int ordering)
           
 void setRolegroup(int rolegroup)
           
 void setRolegroupname(java.lang.String rolegroupname)
           
 org.jdom.Element toElement(java.sql.Connection con)
          Return this Image as a JDOM Element with name 'image' and attributes id, filename and rolegroup.
 org.jdom.Element toElement(java.sql.Connection con, boolean htmlText)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Image

public Image(java.sql.Connection con,
             int id)
      throws XMLServException
Load image with given id from the DB.

Image

public Image()
Create an empty Image.

Image

public Image(java.sql.Connection con,
             java.lang.String filename,
             int formatId)
      throws XMLServException
Create a new image object.
Method Detail

toElement

public org.jdom.Element toElement(java.sql.Connection con)
                           throws XMLServException
Return this Image as a JDOM Element with name 'image' and attributes id, filename and rolegroup.

toElement

public org.jdom.Element toElement(java.sql.Connection con,
                                  boolean htmlText)
                           throws XMLServException

getImageList

public static org.jdom.Element getImageList(java.sql.Connection con,
                                            int rolegroup)
                                     throws XMLServException
Get a list of images for the given rolegroup.
Parameters:
con - A Connection object.
rolegroup - The rolegroup. Set to 0 to get all images.

listImages

public static org.jdom.Element listImages(java.sql.Connection con,
                                          int contentgroup)
                                   throws XMLServException

save

public void save(java.sql.Connection con,
                 javax.servlet.http.HttpServletRequest req,
                 SecurityManager securitymanager)
          throws XMLServException,
                 java.sql.SQLException
Save the image to the DB.

getFilePath

public java.lang.String getFilePath()
Get the complete filename including path.

getId

public int getId()

getOrdering

public int getOrdering()

setOrdering

public void setOrdering(int ordering)

setArtikelnr

public void setArtikelnr(java.lang.String artikelnr)

getBasename

public java.lang.String getBasename()

getFilename

public java.lang.String getFilename()
Return the filename. If a format was specified, this includes the relative path and the extension for that format. Use getBasename() to get the base filename without directory/extension.

getMimetype

public java.lang.String getMimetype()

setFilename

public void setFilename(java.lang.String filename)

getDisplayname

public java.lang.String getDisplayname()

setDisplayname

public void setDisplayname(java.lang.String displayname)

getRolegroup

public int getRolegroup()

setRolegroup

public void setRolegroup(int rolegroup)

getRolegroupname

public java.lang.String getRolegroupname()

setRolegroupname

public void setRolegroupname(java.lang.String rolegroupname)

getContentgroup

public int getContentgroup()

setContentgroup

public void setContentgroup(int contentgroup)

getBezeichnung

public java.lang.String getBezeichnung()

setBezeichnung

public void setBezeichnung(java.lang.String bezeichnung)

getFormat

public Format.Detail getFormat()

setFormat

public void setFormat(Format.Detail format)

getKeywords

public java.lang.String getKeywords()

setKeywords

public void setKeywords(java.lang.String keywords)

main

public static void main(java.lang.String[] args)