Search in sources :

Example 1 with CustomTag

use of com.allaire.cfx.CustomTag in project Lucee by lucee.

the class XMLConfigAdmin method verifyCFX.

public void verifyCFX(String name) throws PageException {
    CFXTagPool pool = config.getCFXTagPool();
    CustomTag ct = null;
    try {
        ct = pool.getCustomTag(name);
    } catch (CFXTagException e) {
        throw Caster.toPageException(e);
    } finally {
        if (ct != null)
            pool.releaseCustomTag(ct);
    }
}
Also used : CFXTagException(lucee.runtime.cfx.CFXTagException) CFXTagPool(lucee.runtime.cfx.CFXTagPool) CustomTag(com.allaire.cfx.CustomTag)

Example 2 with CustomTag

use of com.allaire.cfx.CustomTag in project Lucee by lucee.

the class CFXTag method doStartTag.

@Override
public int doStartTag() throws PageException {
    // RR SerialNumber sn = pageContext.getConfig().getSerialNumber();
    // if(sn.getVersion()==SerialNumber.VERSION_COMMUNITY)
    // throw new SecurityException("no access to this functionality with the "+sn.getStringVersion()+" version of Lucee");
    CFXTagPool pool = pageContext.getConfig().getCFXTagPool();
    CustomTag ct;
    try {
        ct = pool.getCustomTag(appendix);
    } catch (CFXTagException e) {
        throw Caster.toPageException(e);
    }
    Request req = new RequestImpl(pageContext, attributes);
    Response rsp = new ResponseImpl(pageContext, req.debug());
    try {
        ct.processRequest(req, rsp);
    } catch (Exception e) {
        throw Caster.toPageException(e);
    }
    pool.releaseCustomTag(ct);
    return SKIP_BODY;
}
Also used : Response(com.allaire.cfx.Response) CFXTagException(lucee.runtime.cfx.CFXTagException) CFXTagPool(lucee.runtime.cfx.CFXTagPool) Request(com.allaire.cfx.Request) CustomTag(com.allaire.cfx.CustomTag) RequestImpl(lucee.runtime.cfx.RequestImpl) ResponseImpl(lucee.runtime.cfx.ResponseImpl) PageException(lucee.runtime.exp.PageException) CFXTagException(lucee.runtime.cfx.CFXTagException)

Example 3 with CustomTag

use of com.allaire.cfx.CustomTag in project Lucee by lucee.

the class CFXTagPoolImpl method getCustomTag.

@Override
public synchronized CustomTag getCustomTag(String name) throws CFXTagException {
    name = name.toLowerCase();
    Object o = classes.get(name);
    if (o == null) {
        Set<String> set = classes.keySet();
        String names = ListUtil.arrayToList(set.toArray(new String[set.size()]), ",");
        throw new CFXTagException("there is no Custom Tag (CFX) with name [" + name + "], available Custom Tags are [" + names + "]");
    }
    CFXTagClass ctc = (CFXTagClass) o;
    CustomTag ct = ctc.newInstance();
    // if(!(o instanceof CustomTag))throw new CFXTagException("["+name+"] is not of type ["+CustomTag.class.getName()+"]");
    return ct;
}
Also used : CFXTagException(lucee.runtime.cfx.CFXTagException) CustomTag(com.allaire.cfx.CustomTag)

Aggregations

CustomTag (com.allaire.cfx.CustomTag)3 CFXTagException (lucee.runtime.cfx.CFXTagException)3 CFXTagPool (lucee.runtime.cfx.CFXTagPool)2 Request (com.allaire.cfx.Request)1 Response (com.allaire.cfx.Response)1 RequestImpl (lucee.runtime.cfx.RequestImpl)1 ResponseImpl (lucee.runtime.cfx.ResponseImpl)1 PageException (lucee.runtime.exp.PageException)1