Package de.innovationgate.webgate.api

Examples of de.innovationgate.webgate.api.WGDatabase


        return _environment.getTransientForms();
    }

  @CodeCompletion
    public WGDatabase db(String key) throws WGException {
        WGDatabase db = _environment.fetchDB(resolveDBKey(key));
        if (db != null) {
            return _environment.openDB(db);
        }
       
        return null;
View Full Code Here


        return document.getDatabase();
    }
   
    @CodeCompletion
    public WGDatabase designdb() throws WGException {
        WGDatabase designDB = _designContext.getDesignDB();
        return _environment.openDB(designDB);
    }
View Full Code Here

    @CodeCompletion
    public WGHierarchicalDatabase hdb(String key) throws WGException {
       
        // Retrieve db via dbkey and wrap as hdb
        WGDatabase db = db(key);
        if (db != null) {
            return WGHierarchicalDatabase.getOrCreateInstance(db);
        }
       
        return null;
View Full Code Here

    return new Mail(smtpHost, username, password);
  }
 
  @CodeCompletion
  public Mail createmail() throws TMLException {
    WGDatabase db = getdocument().getDatabase()

      try {
            if (getwgacore().getMailConfig() != null){
                return new Mail(getwgacore().getMailConfig());
            }
View Full Code Here

        return new Login(username, password);
    }
   
    public String label(String containerName, String fileName, String key, List params, boolean usePlaceholder) {
        try {
            WGDatabase designDB = designdb();
            return label(designDB, containerName, fileName, key, params, usePlaceholder);
        }
        catch (WGException e) {
           getlog().error("Unable to open design db", e);
           return "(Error retrieving label)";
View Full Code Here

                dbKey = (String) idParts.get(0);
                id = (String) idParts.get(1);
            }
           
            // Get the design db. Either by dbkey in id, by parameter dbkey, by current design db of WebTML or just the current context db
            WGDatabase designDB;
            if (!WGUtils.isEmpty(dbKey)) {
                designDB = db(dbKey);
            }
            else {
                designDB = designdb();
            }
           
            if (designDB == null) {
                throw new TMLActionException("Could not open design db to load tmlscript action module, because it does not exist.");
            }
            if (!designDB.isSessionOpen()) {
                throw new TMLActionException("Could not open design db '" + designDB.getDbReference() + "' to load tmlscript action module, because  you have no access.");
            }
           
            WGCSSJSModule mod = designDB.getCSSJSModule(id, WGScriptModule.CODETYPE_TMLSCRIPT);
            if (mod == null) {
                return null;
            }
           
            TMLAction action =  TMLAction.buildActionFromScriptModule(mod);
            registerAction(action, id, designDB.getDbReference());
            return action;
           
        }
        catch (WGException e) {
           throw new TMLActionException("Could not open design db to load tmlscript action module", e);
View Full Code Here

                return null;
            }
        }
        else {
            // get file from filecontainer
            WGDatabase designDB = null;
                if (dbKey != null) {
                    designDB = db(dbKey);
                }
                else {
                  designDB = designdb();
                }
               
                if (designDB == null) {
                    addwarning("Unknown design db: " + dbKey);
                    return null;
                }
               
                // first try - lookup file container of designDB or explicit given db
                WGDocument container = designDB.getFileContainer(containerName);
                if (container == null) {
                  // second try - lookup file container in current context db
                  container = db().getFileContainer(containerName);
                 
                  if (container == null) {
View Full Code Here

          return null;
      }
     
      if (dbkey.startsWith("@")) {
          String pluginShortcut = dbkey.substring(1);
          WGDatabase designDB = getDesignContext().getDesignDB();
          if (designDB == null) {
              addwarning("Unable to allocate design database");
              return dbkey;
          }
         
          Map pluginShortcuts = (Map) designDB.getAttribute(WGACore.DBATTRIB_PLUGIN_SHORTCUTS);
          String pluginUniqueName = (String) pluginShortcuts.get(pluginShortcut);
          if (pluginUniqueName != null) {
              String pluginKey = plugindbkey(pluginUniqueName);
              if (pluginKey != null) {
                  return pluginKey;
View Full Code Here

        }
    }
   
    public List<WGDocumentCore> getDesignObjects(int type) {
        try {
            WGDatabase db = getDesignDB();
            if (db.getDesignProvider() != null) {
                return wrapCores(db.getDesignProvider().getDesignObjects(type));
            }
            else {
                return wrapCores(db.getCore().getDesignObjects(type));
            }
        }
        catch (WGException e) {
            WGFactory.getLogger().error("Error retrieving design from design database '" + _designDBKey + "'", e);
            return null;
View Full Code Here

        return openContentDB(key, request, false);
    }

    public WGDatabase openContentDB(String key, javax.servlet.http.HttpServletRequest request, boolean useMaster) throws WGException {

        WGDatabase db = this.contentdbs.get(key);
        if (db != null) {
            return openContentDB(db, request, useMaster);
        }
        else {
            return null;
View Full Code Here

TOP

Related Classes of de.innovationgate.webgate.api.WGDatabase

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.