Package org.richfaces.component

Examples of org.richfaces.component.AbstractMediaOutput


    }

    // TODO use ResourceComponent or exchange object as argument?
    @PostConstructResource
    public void initialize() {
        AbstractMediaOutput uiMediaOutput = (AbstractMediaOutput) UIComponent.getCurrentComponent(FacesContext
            .getCurrentInstance());
        this.setCacheable(uiMediaOutput.isCacheable());
        this.setContentType(uiMediaOutput.getMimeType());
        this.userData = uiMediaOutput.getValue();
        this.contentProducer = uiMediaOutput.getCreateContent();
        this.lastModifiedExpression = uiMediaOutput.getValueExpression("lastModfied");
        this.expiresExpression = uiMediaOutput.getValueExpression("expires");
        this.timeToLiveExpression = uiMediaOutput.getValueExpression("timeToLive");
        this.fileName = uiMediaOutput.getFileName();
    }
View Full Code Here


     * @see org.ajax4jsf.renderkit.RendererBase#doEncodeEnd(javax.faces.context.ResponseWriter,
     * javax.faces.context.FacesContext, javax.faces.component.UIComponent)
     */
    @Override
    protected void doEncodeEnd(ResponseWriter writer, FacesContext context, UIComponent component) throws IOException {
        AbstractMediaOutput mmedia = (AbstractMediaOutput) component;
        String element = mmedia.getElement();

        if (null == element) {
            throw new FacesException(Messages.getMessage(Messages.NULL_ATTRIBUTE_ERROR, "element",
                component.getClientId(context)));
        }
View Full Code Here

     * javax.faces.context.FacesContext, javax.faces.component.UIComponent)
     */
    @Override
    protected void doEncodeBegin(ResponseWriter writer, FacesContext context, UIComponent component) throws IOException {

        AbstractMediaOutput mmedia = (AbstractMediaOutput) component;
        String element = mmedia.getElement();

        if (null == element) {
            throw new FacesException(Messages.getMessage(Messages.NULL_ATTRIBUTE_ERROR, "element",
                component.getClientId(context)));
        }

        String uriAttribute = mmedia.getUriAttribute();

        // Check for pre-defined attributes
        if (null == uriAttribute) {
            uriAttribute = URI_ATTRIBUTES.get(element);

            if (null == uriAttribute) {
                throw new FacesException(Messages.getMessage(Messages.NULL_ATTRIBUTE_ERROR, "uriAttribute",
                    component.getClientId(context)));
            }
        }

        writer.startElement(element, mmedia);
        getUtils().encodeId(context, component);

        StringBuilder uri = new StringBuilder(mmedia.getResource().getRequestPath());

        // Append parameters to resource Uri
        boolean haveQestion = uri.indexOf("?") >= 0;

        for (UIComponent child : component.getChildren()) {
View Full Code Here

     */

    // TODO use ResourceComponent or exchange object as argument?
    @PostConstructResource
    public void initialize() {
        AbstractMediaOutput uiMediaOutput = (AbstractMediaOutput) UIComponent.getCurrentComponent(FacesContext
            .getCurrentInstance());
        this.setCacheable(uiMediaOutput.isCacheable());
        this.setContentType(uiMediaOutput.getMimeType());
        this.userData = uiMediaOutput.getValue();
        this.contentProducer = uiMediaOutput.getCreateContent();
        this.lastModifiedExpression = uiMediaOutput.getValueExpression("lastModfied");
        this.expiresExpression = uiMediaOutput.getValueExpression("expires");
        this.timeToLiveExpression = uiMediaOutput.getValueExpression("timeToLive");
        this.fileName = uiMediaOutput.getFileName();
    }
View Full Code Here

TOP

Related Classes of org.richfaces.component.AbstractMediaOutput

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.