Examples of WGDatabase


Examples of de.innovationgate.webgate.api.WGDatabase

            throw new HttpErrorException(HttpURLConnection.HTTP_INTERNAL_ERROR, "Retrieved AjaxInfo could not be restored. Check log for details.", null);
        }

        // fetch correct db for ajax (if designdb on include tag is present use
        // design db, if not use current db)
        WGDatabase ajaxDB = null;
        String ajaxDesignDBKey = ajaxInfo.getDesignDB();
        if (ajaxDesignDBKey != null) {
            // fetch design db
            try {
                ajaxDB = _core.openContentDB(ajaxDesignDBKey, request);
            }
            catch (WGUnavailableException e) {
                throw new HttpErrorException(HttpServletResponse.SC_SERVICE_UNAVAILABLE, "The website is currently unavailable", ajaxDesignDBKey);
            }
            catch (de.innovationgate.wgpublisher.AuthenticationException e) {
                throw new HttpErrorException(HttpServletResponse.SC_UNAUTHORIZED, e.getMessage(), null);
            }
            catch (AccessException e) {
                throw new HttpErrorException(HttpServletResponse.SC_FORBIDDEN, e.getMessage(), null);
            }

            if (ajaxDB == null) {
                throw new HttpErrorException(HttpServletResponse.SC_NOT_FOUND, "No database of key " + ajaxDesignDBKey, null);
            }
            else if (ajaxDB.isSessionOpen() == false) {
                throw new HttpErrorException(HttpServletResponse.SC_FORBIDDEN, "Database '" + ajaxDesignDBKey + "' could not be opened by ajaxCall.", null);
            }
        }
        else {
            ajaxDB = database;
        }

        // search for tml module
        tmlLib = (WGTMLModule) ajaxDB.getDesignObject(WGDocument.TYPE_TML, ajaxInfo.getTmlmodule(), ajaxInfo.getMediaKey());

        if (tmlLib == null) {
            throw new HttpErrorException(HttpServletResponse.SC_NOT_FOUND, "No WebTML layout '" + ajaxInfo.getTmlmodule() + "' for media key '" + ajaxInfo.getMediaKey() + "' available in app '" + ajaxDB.getDbReference() + "'", ajaxDB
                    .getDbReference());
        }

        return tmlLib;
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.