Subversion Repositories bacoAlunos

Rev

Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed

package pt.estgp.estgweb.web.tags;

import org.apache.log4j.Logger;
import pt.estgp.estgweb.Globals;
import pt.utl.ist.berserk.logic.serviceManager.IServiceManager;
import pt.utl.ist.berserk.logic.serviceManager.ServiceManager;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.jsp.JspException;
import javax.servlet.jsp.JspWriter;
import javax.servlet.jsp.tagext.BodyTagSupport;

public class CanEditCourseUnitEvaluationTag extends BodyTagSupport
{

    private static final 1.5.0/docs/api/java/util/logging/Logger.html">Logger logger = 1.5.0/docs/api/java/util/logging/Logger.html">Logger.getLogger(CanEditCourseUnitEvaluationTag.class);
    private 1.5.0/docs/api/java/lang/String.html">String unitId;


    public 1.5.0/docs/api/java/lang/String.html">String getUnitId() {
        return unitId;
    }

    public void setUnitId(1.5.0/docs/api/java/lang/String.html">String unitId) {
        this.unitId = unitId;
    }

    public int doStartTag() throws JspException
    {
        if (go())
        {
            return EVAL_BODY_TAG;
        }
        else
            return SKIP_BODY;
    }

    public boolean go() throws JspException
    {
        if(!Globals.MODULE_STATUS_COURSEUNITEVALUATION)
            return false;
        try{
            IServiceManager sm = ServiceManager.getInstance();
            1.5.0/docs/api/java/lang/String.html">String[] names = new 1.5.0/docs/api/java/lang/String.html">String[]{"unitId"};
            5+0%2Fdocs%2Fapi+Object">Object[] args = new 5+0%2Fdocs%2Fapi+Object">Object[]{new 1.5.0/docs/api/java/lang/Long.html">Long(unitId)};

            1.5.0/docs/api/java/lang/Boolean.html">Boolean result = (1.5.0/docs/api/java/lang/Boolean.html">Boolean) sm.checkFilters(pt.estgp.estgweb.web.utils.RequestUtils.getRequester((HttpServletRequest)pageContext.getRequest(), (HttpServletResponse)pageContext.getResponse()), "SaveCourseUnitEvaluation", args, names);
            return result;
        } catch (1.5.0/docs/api/java/lang/Throwable.html">Throwable e) {
            logger.error(e,e);
            return false;
        }

    }

    public int doEndTag() throws JspException
    {
        if (go())
        {
            1.5.0/docs/api/java/lang/String.html">String toPage = bodyContent.getString().trim();
            JspWriter writer = pageContext.getOut();
            try
            {
                writer.write(toPage);
            }
            catch (1.5.0/docs/api/java/lang/Exception.html">Exception e)
            {
                logger.error(e, e);
                throw new JspException(e);
            }
        }
        // Continue processing this page
        return EVAL_PAGE;
    }


}