com.jalios.jcms.taglib
Class MediaTag
java.lang.Object
  
javax.servlet.jsp.tagext.TagSupport
      
com.jalios.jcms.taglib.MediaTag
- All Implemented Interfaces: 
 - Serializable, javax.servlet.jsp.tagext.IterationTag, javax.servlet.jsp.tagext.Tag
 
public class MediaTag
- extends javax.servlet.jsp.tagext.TagSupport
 
Print the HTML required to provide a media player for any file.
- Since:
 
  - jcms-6.1
 
- See Also:
 - Serialized Form
 
| 
Field Summary | 
static String | 
MEDIA_MAX_HEIGHT
 
          Request attribute name to retrieve the maximum height of the media file to be displayed. | 
static String | 
MEDIA_MAX_WIDTH
 
          Request attribute name to retrieve the maximum width of the media file to be displayed. | 
static String | 
MEDIA_PATH
 
          Request attribute name to retrieve the path of the media file to be displayed. | 
static String | 
REVISION
 
            | 
 
| Fields inherited from class javax.servlet.jsp.tagext.TagSupport | 
id, pageContext | 
 
| Fields inherited from interface javax.servlet.jsp.tagext.IterationTag | 
EVAL_BODY_AGAIN | 
 
| Fields inherited from interface javax.servlet.jsp.tagext.Tag | 
EVAL_BODY_INCLUDE, EVAL_PAGE, SKIP_BODY, SKIP_PAGE | 
 
 
 
| Methods inherited from class javax.servlet.jsp.tagext.TagSupport | 
doAfterBody, findAncestorWithClass, getId, getParent, getValue, getValues, release, removeValue, resetCustomAttributes, setId, setPageContext, setParent, setValue | 
 
| Methods inherited from class java.lang.Object | 
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait | 
 
REVISION
public static final String REVISION
- See Also:
 - Constant Field Values
 
MEDIA_PATH
public static final String MEDIA_PATH
- Request attribute name to retrieve the path of the media file to be displayed.
 
String path = (String) request.getAttribute(MediaTag.MEDIA_PATH);
- See Also:
 - Constant Field Values
 
 
MEDIA_MAX_WIDTH
public static final String MEDIA_MAX_WIDTH
- Request attribute name to retrieve the maximum width of the media file to be displayed.
 
int maxWidth = Util.toInt(request.getAttribute(MediaTag.MEDIA_MAX_WIDTH), 320);
- See Also:
 - Constant Field Values
 
 
MEDIA_MAX_HEIGHT
public static final String MEDIA_MAX_HEIGHT
- Request attribute name to retrieve the maximum height of the media file to be displayed.
 
int maxHeight = Util.toInt(request.getAttribute(MediaTag.MEDIA_MAX_HEIGHT), 240);
- See Also:
 - Constant Field Values
 
 
MediaTag
public MediaTag()
setFileDoc
public void setFileDoc(FileDocument fileDoc)
 
setPath
public void setPath(String path)
 
setFile
public void setFile(File file)
 
setMaxWidth
public void setMaxWidth(int width)
 
setMaxHeight
public void setMaxHeight(int height)
 
doStartTag
public int doStartTag()
               throws javax.servlet.jsp.JspException
- Specified by:
 doStartTag in interface javax.servlet.jsp.tagext.Tag- Overrides:
 doStartTag in class javax.servlet.jsp.tagext.TagSupport
 
- Throws:
 javax.servlet.jsp.JspException
 
doEndTag
public int doEndTag()
- Specified by:
 doEndTag in interface javax.servlet.jsp.tagext.Tag- Overrides:
 doEndTag in class javax.servlet.jsp.tagext.TagSupport
 
 
includeMediaTemplate
public void includeMediaTemplate()
                          throws javax.servlet.ServletException,
                                 IOException
- Include the JSP suitable to display the specified media.
- Throws:
 IOException
javax.servlet.ServletException
 
 
getMediaTemplatePath
public static String getMediaTemplatePath(String templateName,
                                          String mediaPath,
                                          String mediaContentType)
- Retrieve the path of the JSP suitable to display the specified media.
- Parameters:
 templateName - the name of the template to retrievemediaPath - the path of the media to display, relative to the webapp root (eg. upload/docs/myfile.ext)mediaContentType - the content type of the media to display (eg. image/jpeg)
- Returns:
 - the relative path of the Media JSP template to use to display the specified media
 
 
 
Copyright © 2001-2007 Jalios SA. All Rights Reserved.