Package org.displaytag.properties

Examples of org.displaytag.properties.MediaTypeEnum


        // this will force media type initialization
        MediaTypeEnum.registerMediaType("wpdf");
        ExportViewFactory factory = ExportViewFactory.getInstance();
        factory.registerExportView("wpdf", "org.displaytag.export.DefaultPdfExportView");
        MediaTypeEnum pdfMedia = MediaTypeEnum.fromName("wpdf");
        Assert.assertNotNull("Pdf export view not correctly registered.", pdfMedia);
        request.setParameter(mediaParameter, Integer.toString(pdfMedia.getCode()));

        WebResponse response = runner.getResponse(request);

        Assert.assertEquals("Expected a different content type.", "application/pdf", response.getContentType());
View Full Code Here


        if (tableTag == null)
        {
            throw new TagStructureException(getClass(), "caption", "table"); //$NON-NLS-1$ //$NON-NLS-2$
        }

        MediaTypeEnum currentMediaType = (MediaTypeEnum) this.pageContext.findAttribute(TableTag.PAGE_ATTRIBUTE_MEDIA);
        if (!MediaUtil.availableForMedia(this, currentMediaType))
        {
            return SKIP_BODY;
        }
View Full Code Here

            if (tableTag == null)
            {
                throw new TagStructureException(getClass(), "caption", "table"); //$NON-NLS-1$ //$NON-NLS-2$
            }

            MediaTypeEnum currentMediaType = (MediaTypeEnum) this.pageContext
                .findAttribute(TableTag.PAGE_ATTRIBUTE_MEDIA);
            if (currentMediaType != null && !MediaUtil.availableForMedia(this, currentMediaType))
            {
                return SKIP_BODY;
            }
View Full Code Here

        StringBuffer buffer = new StringBuffer(200);
        Iterator iterator = MediaTypeEnum.iterator();

        while (iterator.hasNext())
        {
            MediaTypeEnum currentExportType = (MediaTypeEnum) iterator.next();

            if (this.properties.getAddExport(currentExportType))
            {

                if (buffer.length() > 0)
                {
                    buffer.append(this.properties.getExportBannerSeparator());
                }

                exportHref.addParameter(encodeParameter(TableTagParameters.PARAMETER_EXPORTTYPE), currentExportType
                    .getCode());

                // export marker
                exportHref.addParameter(TableTagParameters.PARAMETER_EXPORTING, "1");
View Full Code Here

            log.warn(Messages.getString("ExportViewFactory.noclassdef" //$NON-NLS-1$
                , new Object[]{name, viewClassName, e.getMessage()}));
            return;
        }

        MediaTypeEnum media = MediaTypeEnum.registerMediaType(name);
        viewClasses.put(media, exportClass);

        if (log.isDebugEnabled())
        {
            log.debug(Messages.getString("ExportViewFactory.added", //$NON-NLS-1$
View Full Code Here

        if (tableTag == null)
        {
            throw new TagStructureException(getClass(), "caption", "table"); //$NON-NLS-1$ //$NON-NLS-2$
        }

        MediaTypeEnum currentMediaType = (MediaTypeEnum) this.pageContext.findAttribute(TableTag.PAGE_ATTRIBUTE_MEDIA);
        if (!MediaUtil.availableForMedia(this, currentMediaType))
        {
            return SKIP_BODY;
        }
View Full Code Here

            if (tableTag == null)
            {
                throw new TagStructureException(getClass(), "caption", "table"); //$NON-NLS-1$ //$NON-NLS-2$
            }

            MediaTypeEnum currentMediaType = (MediaTypeEnum) this.pageContext
                .findAttribute(TableTag.PAGE_ATTRIBUTE_MEDIA);
            if (currentMediaType != null && !MediaUtil.availableForMedia(this, currentMediaType))
            {
                return SKIP_BODY;
            }
View Full Code Here

     */
    public int doEndTag() throws JspException
    {
        TableTag tableTag = getTableTag();

        MediaTypeEnum currentMediaType = (MediaTypeEnum) this.pageContext.findAttribute(TableTag.PAGE_ATTRIBUTE_MEDIA);
        if (currentMediaType != null && !MediaUtil.availableForMedia(this, currentMediaType))
        {
            if (log.isDebugEnabled())
            {
                log.debug("skipping column body, currentMediaType=" + currentMediaType);
View Full Code Here

        if (tableTag.isEmpty() || !tableTag.isIncludedRow())
        {
            return SKIP_BODY;
        }

        MediaTypeEnum currentMediaType = (MediaTypeEnum) this.pageContext.findAttribute(TableTag.PAGE_ATTRIBUTE_MEDIA);
        if (!MediaUtil.availableForMedia(this, currentMediaType))
        {
            return SKIP_BODY;
        }
View Full Code Here

        if (tableTag == null)
        {
            throw new TagStructureException(getClass(), "footer", "table");
        }

        MediaTypeEnum currentMediaType = (MediaTypeEnum) this.pageContext.findAttribute(TableTag.PAGE_ATTRIBUTE_MEDIA);
        if (currentMediaType != null && !MediaUtil.availableForMedia(this, currentMediaType))
        {
            return SKIP_BODY;
        }
View Full Code Here

TOP

Related Classes of org.displaytag.properties.MediaTypeEnum

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.