Examples of IConfig


Examples of de.mhus.lib.config.IConfig

     WebRequest req = new GetMethodWebRequest( app.getUri() + path );
     WebResponse res = getResponse( req );
     if ( res.getResponseCode() != 200 )
       return null;
     String content = res.getText();
     IConfig config = MConfigFactory.getInstance().toConfig(content);
     return config;
  }
View Full Code Here

Examples of de.mhus.lib.config.IConfig

   
    isFullWidth = config.getBoolean("fullwidth", false);
    isTitleInside = config.getBoolean("titleinside", false);
   
    try {
      IConfig cSource = config.getConfig("sources");
      if (cSource != null) {
        for ( IConfig srcConf : cSource.getConfigBundle()) {
          DataConnector con = getDataSource().createDataConnector(this,srcConf);
          if (con != null) {
            if (sources == null) sources = new HashMap<String,DataConnector>();
            sources.put(con.getTaskName(), con);
            con.addObserver(this);
View Full Code Here

Examples of de.mhus.lib.config.IConfig

      // return initializeConnection((CaoConnection) getActivator().getClazz(CdbConnection.class.getCanonicalName()).getConstructor(DbDriver.class,DbConfiguration.class).newInstance(this,form));
      // return initializeConnection(new DbCaoConnection(this,form));

      // MActivator acti = getActivator();
      MActivator acti = new MActivator(getClass().getClassLoader());
      IConfig cClassPath = config.getConfig("classpath");
      if (cClassPath != null) {
        DynamicClassLoader classLoader = new DynamicClassLoader(getName(),getClass().getClassLoader());
        classLoader.doSetupFromConfig(cClassPath);
        acti = new MActivator(classLoader);
      }
View Full Code Here

Examples of de.mhus.lib.config.IConfig

  private LinkedList<FormAction> actions = new LinkedList<FormAction>();
  private HashMap<String, FormAction> map = new HashMap<String, FormAction>();
 
  protected void doBuildChildren() throws Exception {
    // load actions
    IConfig cActions = config.getConfig("actions");
    if (cActions == null) return;
    for (IConfig action : cActions.getConfigBundle()) {
      FormAction a = new FormAction(this,action);
      actions.add(a);
      map.put(action.getName(),  a);
    }
  }
View Full Code Here

Examples of de.mhus.lib.config.IConfig

 
  @Override
  public NavigationNode getParent() {
   
    if (config != null) {
      IConfig cur = config.getParent();
      if (cur != null) {
        return new ConfigNavigationNode(cur);
      }
    }
    return null;
View Full Code Here

Examples of de.mhus.lib.config.IConfig

   * @throws Exception
   */
  public void createTable(DbConnection con) throws Exception {
   
      HashConfig cstr = new HashConfig();
      IConfig ctable = cstr.createConfig("table");
      ctable.setProperty("name", tableNameOrg);
     
      LinkedList<String> pk = new LinkedList<String>();
     
      for (Field f : fList) {
        IConfig cfield = ctable.createConfig("field");
        cfield.setProperty(Dialect.K_NAME, f.createName);
        cfield.setProperty(Dialect.K_TYPE, f.retDbType);
        cfield.setProperty(Dialect.K_SIZE, String.valueOf(f.size));
        cfield.setProperty(Dialect.K_DEFAULT, f.defValue);
          cfield.setProperty(Dialect.K_NOT_NULL, f.nullable ? "no" : "yes");
          LinkedList<String> cat = new LinkedList<String>();
          if (!f.isPersistent()) cat.add(Dialect.C_VIRTUAL);
          if (f.isPrimary) cat.add(Dialect.C_PRIMARY_KEY);
          if (f.ret.isEnum()) cat.add(Dialect.C_ENUMERATION);
          cfield.setProperty(Dialect.K_CATEGORIES, MString.join(cat.iterator(), ",") )// add primary key
        if (f.isPrimary && f.isPersistent()) pk.add(f.createName);
      }
     
      if (pk.size() > 0) {
        String pkNames = MString.join(pk.iterator(), ",");
        ctable.setProperty(Dialect.K_PRIMARY_KEY, pkNames);
      }
     
      // create index entries
      for (Entry<String, LinkedList<Field>> item : iIdx.entrySet()) {
        IConfig cindex = cstr.createConfig("index");
        String n = item.getKey();
        if (n.startsWith(DbIndex.UNIQUE)) {
          cindex.setString(Dialect.I_TYPE, Dialect.I_UNIQUE);
        }
        cindex.setString(Dialect.I_NAME, "idx_" + n);
        cindex.setString(Dialect.I_TABLE, tableNameOrg);
        StringBuffer fields = new StringBuffer();
        for (Field field : item.getValue()) {
          if (fields.length() > 0) fields.append(",");
          fields.append(field.createName);
        }
        cindex.setString(Dialect.I_FIELDS, fields.toString());
      }
     
      manager.getPool().getDialect().createStructure(cstr, con, manager.getCaoMetadata());
     
  }
View Full Code Here

Examples of de.mhus.lib.config.IConfig

   * @param form
   * @return
   * @throws CaoException
   */
  public CaoConnection createConnection(CaoForm form) throws CaoException {
    IConfig c = form.getConfig();
    if (c == null) c = getConfig();
    return createConnection(form.toUrl(true),c);
  }
View Full Code Here

Examples of de.mhus.lib.config.IConfig

   */
  protected abstract void initDefaultApplications();
 
  public synchronized IConfig getConfig() {
    if (config == null) {
      IConfig c = MSingleton.instance().getConfig().getConfig(DEFAULT_CONFIG);
      if (c != null) {
        log.t(getName(),"loaded default config",config);
        config = c.getConfig(getName());
      }
    }
    return config;
  }
View Full Code Here

Examples of de.mhus.lib.config.IConfig

   * Create all applications for the connection with help of the factories.
   *
   * @param con
   */
  private void createApplications(CaoConnection con) {
    IConfig c = con.getConfig();
    if (c!=null) {
      IConfig[] bundle = c.getConfigBundle("load_application");
      if (bundle.length == 0) {
        for (Entry<String, CaoApplicationFactory> factory : this.applications.entrySet()) {
          log.t(getName(),"Load Application",factory.getKey());
          CaoApplication app = factory.getValue().create(con);
          if (app != null) {
View Full Code Here

Examples of de.mhus.lib.config.IConfig

        MLog.w(clazz,t);
      }
    }
   
    // start the http server if configured
    IConfig cserver = config.getConfig("server");
    if (cserver != null) {
      if (cserver.getBoolean("enabled", false))
          manager.openServer(cserver);
        else
          manager.closeServer();
    }
  }
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.