Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

com.opencms.defaults.master
Class CmsMasterMedia  view CmsMasterMedia download CmsMasterMedia.java

java.lang.Object
  extended bycom.opencms.defaults.master.CmsMasterMedia

public class CmsMasterMedia
extends java.lang.Object

An instance of this module describes a modulemedia entry in the database. It carries a set of data to read and write.


Field Summary
static java.lang.String C_DEFAULT_MIMETYPE
          The default mimetype
static int C_MEDIA_TYPE_FILE
          Constant fro media type
static int C_MEDIA_TYPE_IMAGE
          Constant fro media type
private  java.lang.String m_description
          A description for the media
private  int m_height
          The height of this media
private  int m_id
          Primary key for the media data
private  int m_masterId
          Foreign key to the media master
private  byte[] m_media
          The content of the media
private  java.lang.String m_mimetype
          The mimetype of the media
private  java.lang.String m_name
          The filename of the media
private  int m_position
          The position of this media
private  int m_size
          The size of the media
private  java.lang.String m_title
          The title of the media
private  int m_type
          The mediatype of the media
private  int m_width
          The width of this media
 
Constructor Summary
CmsMasterMedia()
          Constructs a new instance with some default values.
CmsMasterMedia(int id, int masterId, int position, int width, int height, int size, java.lang.String mimetype, int type, java.lang.String title, java.lang.String name, java.lang.String description, byte[] media)
          Constructs a new instance with some default values.
CmsMasterMedia(int position, int width, int height, int size, java.lang.String mimetype, int type, java.lang.String title, java.lang.String name, java.lang.String description, byte[] media)
          Constructs a new instance with some default values.
 
Method Summary
static java.lang.String computeMimetype(com.opencms.file.CmsObject cms, java.lang.String filename)
          Convenience method to compute the mimetype with the extension of the filename (e.g.
 java.lang.String getDescription()
           
 int getHeight()
           
 int getId()
           
 int getMasterId()
           
 byte[] getMedia()
           
 java.lang.String getMimetype()
           
 java.lang.String getName()
           
 int getPosition()
           
 int getSize()
           
 java.lang.String getTitle()
           
 int getType()
           
 int getWidth()
           
 void setDescription(java.lang.String desc)
           
 void setHeight(int height)
           
 void setId(int id)
          Never set this on yourself! It will be computed by the mastermodule
 void setMasterId(int id)
          Never set this on yourself! It will be computed by the mastermodule
 void setMedia(byte[] media)
           
 void setMimetype(java.lang.String mimetype)
           
 void setName(java.lang.String name)
           
 void setPosition(int pos)
           
 void setSize(int size)
           
 void setTitle(java.lang.String title)
           
 void setType(int type)
           
 void setWidth(int width)
           
 java.lang.String toString()
          Returns a string representation of this instance.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

m_id

private int m_id
Primary key for the media data


m_masterId

private int m_masterId
Foreign key to the media master


m_position

private int m_position
The position of this media


m_width

private int m_width
The width of this media


m_height

private int m_height
The height of this media


m_size

private int m_size
The size of the media


m_mimetype

private java.lang.String m_mimetype
The mimetype of the media


m_type

private int m_type
The mediatype of the media


m_title

private java.lang.String m_title
The title of the media


m_name

private java.lang.String m_name
The filename of the media


m_description

private java.lang.String m_description
A description for the media


m_media

private byte[] m_media
The content of the media


C_MEDIA_TYPE_IMAGE

public static final int C_MEDIA_TYPE_IMAGE
Constant fro media type

See Also:
Constant Field Values

C_MEDIA_TYPE_FILE

public static final int C_MEDIA_TYPE_FILE
Constant fro media type

See Also:
Constant Field Values

C_DEFAULT_MIMETYPE

public static final java.lang.String C_DEFAULT_MIMETYPE
The default mimetype

See Also:
Constant Field Values
Constructor Detail

CmsMasterMedia

public CmsMasterMedia()
Constructs a new instance with some default values.


CmsMasterMedia

public CmsMasterMedia(int position,
                      int width,
                      int height,
                      int size,
                      java.lang.String mimetype,
                      int type,
                      java.lang.String title,
                      java.lang.String name,
                      java.lang.String description,
                      byte[] media)
Constructs a new instance with some default values.


CmsMasterMedia

public CmsMasterMedia(int id,
                      int masterId,
                      int position,
                      int width,
                      int height,
                      int size,
                      java.lang.String mimetype,
                      int type,
                      java.lang.String title,
                      java.lang.String name,
                      java.lang.String description,
                      byte[] media)
Constructs a new instance with some default values.

Method Detail

computeMimetype

public static java.lang.String computeMimetype(com.opencms.file.CmsObject cms,
                                               java.lang.String filename)
Convenience method to compute the mimetype with the extension of the filename (e.g. mypic.gif -> image/gif)


getId

public int getId()

getMasterId

public int getMasterId()

getPosition

public int getPosition()

getWidth

public int getWidth()

getHeight

public int getHeight()

getSize

public int getSize()

getMimetype

public java.lang.String getMimetype()

getType

public int getType()

getTitle

public java.lang.String getTitle()

getName

public java.lang.String getName()

getDescription

public java.lang.String getDescription()

getMedia

public byte[] getMedia()

setId

public void setId(int id)
Never set this on yourself! It will be computed by the mastermodule


setMasterId

public void setMasterId(int id)
Never set this on yourself! It will be computed by the mastermodule


setPosition

public void setPosition(int pos)

setWidth

public void setWidth(int width)

setHeight

public void setHeight(int height)

setSize

public void setSize(int size)

setMimetype

public void setMimetype(java.lang.String mimetype)

setType

public void setType(int type)

setTitle

public void setTitle(java.lang.String title)

setName

public void setName(java.lang.String name)

setDescription

public void setDescription(java.lang.String desc)

setMedia

public void setMedia(byte[] media)

toString

public java.lang.String toString()
Returns a string representation of this instance. Can be used for debugging.