Search in sources :

Example 26 with PageException

use of lucee.runtime.exp.PageException in project Lucee by lucee.

the class QueryImpl method readExternal.

public void readExternal(ObjectInput in) throws IOException {
    try {
        QueryImpl other = (QueryImpl) new CFMLExpressionInterpreter(false).interpret(ThreadLocalPageContext.get(), in.readUTF());
        this.arrCurrentRow = other.arrCurrentRow;
        this.columncount = other.columncount;
        this.columnNames = other.columnNames;
        this.columns = other.columns;
        this.exeTime = other.exeTime;
        this.generatedKeys = other.generatedKeys;
        this.cacheType = other.cacheType;
        this.name = other.name;
        this.recordcount = other.recordcount;
        this.sql = other.sql;
        this.updateCount = other.updateCount;
    } catch (PageException e) {
        throw new IOException(e.getMessage());
    }
}
Also used : PageException(lucee.runtime.exp.PageException) CFMLExpressionInterpreter(lucee.runtime.interpreter.CFMLExpressionInterpreter) IOException(java.io.IOException)

Example 27 with PageException

use of lucee.runtime.exp.PageException in project Lucee by lucee.

the class XMLConfigAdmin method updateClusterClass.

public void updateClusterClass(ClassDefinition cd) throws PageException {
    if (cd.getClassName() == null)
        cd = new ClassDefinitionImpl(ClusterNotSupported.class.getName(), null, null, null);
    Class clazz = null;
    try {
        clazz = cd.getClazz();
    } catch (Exception e) {
        throw Caster.toPageException(e);
    }
    if (!Reflector.isInstaneOf(clazz, Cluster.class) && !Reflector.isInstaneOf(clazz, ClusterRemote.class))
        throw new ApplicationException("class [" + clazz.getName() + "] does not implement interface [" + Cluster.class.getName() + "] or [" + ClusterRemote.class.getName() + "]");
    Element scope = _getRootElement("scope");
    setClass(scope, null, "cluster-", cd);
    ScopeContext.clearClusterScope();
}
Also used : ClassDefinitionImpl(lucee.transformer.library.ClassDefinitionImpl) ClusterNotSupported(lucee.runtime.type.scope.ClusterNotSupported) ApplicationException(lucee.runtime.exp.ApplicationException) Element(org.w3c.dom.Element) FunctionLibException(lucee.transformer.library.function.FunctionLibException) PageException(lucee.runtime.exp.PageException) ConverterException(lucee.runtime.converter.ConverterException) SecurityException(lucee.runtime.exp.SecurityException) TagLibException(lucee.transformer.library.tag.TagLibException) IOException(java.io.IOException) UnknownHostException(java.net.UnknownHostException) CFXTagException(lucee.runtime.cfx.CFXTagException) BundleException(org.osgi.framework.BundleException) SAXException(org.xml.sax.SAXException) UnsupportedEncodingException(java.io.UnsupportedEncodingException) ClassException(lucee.commons.lang.ClassException) DOMException(org.w3c.dom.DOMException) MalformedURLException(java.net.MalformedURLException) ExpressionException(lucee.runtime.exp.ExpressionException) ApplicationException(lucee.runtime.exp.ApplicationException) HTTPException(lucee.runtime.exp.HTTPException)

Example 28 with PageException

use of lucee.runtime.exp.PageException in project Lucee by lucee.

the class XMLConfigAdmin method restart.

/*private Resource getPatchDirectory(CFMLEngine engine) throws IOException {
    	//File f=engine.getCFMLEngineFactory().getResourceRoot();
    	Resource res = ResourcesImpl.getFileResourceProvider().getResource(engine.getCFMLEngineFactory().getResourceRoot().getAbsolutePath());
    	Resource pd = res.getRealResource("patches");
        if(!pd.exists())pd.mkdirs();
        return pd;
    }*/
/**
 * run update from cfml engine
 * @throws PageException
 */
public void restart(Password password) throws PageException {
    checkWriteAccess();
    ConfigServerImpl cs = (ConfigServerImpl) ConfigImpl.getConfigServer(config, password);
    CFMLEngineFactory factory = cs.getCFMLEngine().getCFMLEngineFactory();
    synchronized (factory) {
        try {
            cleanUp(factory);
            factory.restart(cs.getPassword());
        } catch (Exception e) {
            throw Caster.toPageException(e);
        }
    }
}
Also used : FunctionLibException(lucee.transformer.library.function.FunctionLibException) PageException(lucee.runtime.exp.PageException) ConverterException(lucee.runtime.converter.ConverterException) SecurityException(lucee.runtime.exp.SecurityException) TagLibException(lucee.transformer.library.tag.TagLibException) IOException(java.io.IOException) UnknownHostException(java.net.UnknownHostException) CFXTagException(lucee.runtime.cfx.CFXTagException) BundleException(org.osgi.framework.BundleException) SAXException(org.xml.sax.SAXException) UnsupportedEncodingException(java.io.UnsupportedEncodingException) ClassException(lucee.commons.lang.ClassException) DOMException(org.w3c.dom.DOMException) MalformedURLException(java.net.MalformedURLException) ExpressionException(lucee.runtime.exp.ExpressionException) ApplicationException(lucee.runtime.exp.ApplicationException) HTTPException(lucee.runtime.exp.HTTPException) CFMLEngineFactory(lucee.loader.engine.CFMLEngineFactory)

Example 29 with PageException

use of lucee.runtime.exp.PageException in project Lucee by lucee.

the class XMLConfigAdmin method _hasRHExtensions.

private RHExtension _hasRHExtensions(ConfigImpl config, ExtensionDefintion ed) throws PageException {
    Element extensions = _getRootElement("extensions");
    // LuceeHandledExtensions
    Element[] children = XMLConfigWebFactory.getChildren(extensions, "rhextension");
    RHExtension tmp;
    try {
        for (int i = 0; i < children.length; i++) {
            tmp = new RHExtension(config, children[i]);
            if (tmp != null && ed.equals(tmp))
                return tmp;
        }
        return null;
    } catch (Exception e) {
        throw Caster.toPageException(e);
    }
}
Also used : RHExtension(lucee.runtime.extension.RHExtension) Element(org.w3c.dom.Element) FunctionLibException(lucee.transformer.library.function.FunctionLibException) PageException(lucee.runtime.exp.PageException) ConverterException(lucee.runtime.converter.ConverterException) SecurityException(lucee.runtime.exp.SecurityException) TagLibException(lucee.transformer.library.tag.TagLibException) IOException(java.io.IOException) UnknownHostException(java.net.UnknownHostException) CFXTagException(lucee.runtime.cfx.CFXTagException) BundleException(org.osgi.framework.BundleException) SAXException(org.xml.sax.SAXException) UnsupportedEncodingException(java.io.UnsupportedEncodingException) ClassException(lucee.commons.lang.ClassException) DOMException(org.w3c.dom.DOMException) MalformedURLException(java.net.MalformedURLException) ExpressionException(lucee.runtime.exp.ExpressionException) ApplicationException(lucee.runtime.exp.ApplicationException) HTTPException(lucee.runtime.exp.HTTPException)

Example 30 with PageException

use of lucee.runtime.exp.PageException in project Lucee by lucee.

the class XMLConfigWebFactory method toStruct.

private static Struct toStruct(String str) {
    Struct sct = new StructImpl();
    try {
        String[] arr = ListUtil.toStringArray(ListUtil.listToArrayRemoveEmpty(str, '&'));
        String[] item;
        for (int i = 0; i < arr.length; i++) {
            item = ListUtil.toStringArray(ListUtil.listToArrayRemoveEmpty(arr[i], '='));
            if (item.length == 2)
                sct.setEL(KeyImpl.init(URLDecoder.decode(item[0], true).trim()), URLDecoder.decode(item[1], true));
            else if (item.length == 1)
                sct.setEL(KeyImpl.init(URLDecoder.decode(item[0], true).trim()), "");
        }
    } catch (PageException ee) {
    }
    return sct;
}
Also used : PageException(lucee.runtime.exp.PageException) StructImpl(lucee.runtime.type.StructImpl) lucee.aprint(lucee.aprint) Struct(lucee.runtime.type.Struct)

Aggregations

PageException (lucee.runtime.exp.PageException)200 ApplicationException (lucee.runtime.exp.ApplicationException)56 IOException (java.io.IOException)54 Struct (lucee.runtime.type.Struct)49 StructImpl (lucee.runtime.type.StructImpl)37 ExpressionException (lucee.runtime.exp.ExpressionException)32 Resource (lucee.commons.io.res.Resource)30 SecurityException (lucee.runtime.exp.SecurityException)26 BundleException (org.osgi.framework.BundleException)26 MalformedURLException (java.net.MalformedURLException)25 Array (lucee.runtime.type.Array)21 Key (lucee.runtime.type.Collection.Key)17 PageRuntimeException (lucee.runtime.exp.PageRuntimeException)15 SAXException (org.xml.sax.SAXException)15 Entry (java.util.Map.Entry)14 ClassException (lucee.commons.lang.ClassException)14 DeprecatedException (lucee.runtime.exp.DeprecatedException)14 SMTPException (lucee.runtime.net.mail.SMTPException)13 ArrayImpl (lucee.runtime.type.ArrayImpl)13 Query (lucee.runtime.type.Query)13