Package org.openbravo.model.ad.module

Examples of org.openbravo.model.ad.module.Module


    result.append("var calloutName='SL_Module_Minor_version';\n\n");
    result.append("var respuesta = new Array(");
    // do not change the name field, if the user just left it
    if (strChanged.equals(DEPENDENT_MODULE_FIELD)) {
      // get the minor version
      final Module dependsOnModule = OBDal.getInstance().get(Module.class, strModule);
      if (dependsOnModule.getVersion() != null) {
        result.append("new Array(\"" + MINOR_VERSION_FIELD + "\", \""
            + dependsOnModule.getVersion() + "\")");
      } else {
        result.append("new Array(\"" + MINOR_VERSION_FIELD + "\", \""
            + dependsOnModule.getVersion() + "\")");
      }
    }
    result.append(");");
    xmlDocument.setParameter("array", result.toString());
    xmlDocument.setParameter("frameName", "appFrame");
View Full Code Here


   * @param moduleId
   *          the id of the module used to find the dataset in the database
   * @return the found DataSet
   */
  public DataSet getDataSetByValueModule(String value, String moduleId) {
    final Module module = OBDal.getInstance().get(Module.class, moduleId);
    final OBCriteria<DataSet> obc = OBDal.getInstance().createCriteria(DataSet.class);
    obc.add(Expression.eq(DataSet.PROPERTY_MODULE, module));
    obc.add(Expression.eq(DataSet.PROPERTY_SEARCHKEY, value));
    final List<?> list = obc.list();
    Check.isTrue(list.size() <= 1,
View Full Code Here

   * @param moduleId
   *          the moduleId of the module to use for searching datasets
   * @return the list of found datasets
   */
  public List<DataSet> getDataSetsByModuleID(String moduleId) {
    final Module module = OBDal.getInstance().get(Module.class, moduleId);
    final OBCriteria<DataSet> obc = OBDal.getInstance().createCriteria(DataSet.class);
    obc.add(Expression.eq(DataSet.PROPERTY_MODULE, module));
    return obc.list();
  }
View Full Code Here

  private boolean failOnError = false;
  private String moduleJavaPackage;

  @Override
  protected void doExecute() {
    final Module module = getModule();

    final Database database = createDatabaseObject();

    if (getType().contains("database")) {
      log.info("Validating Database and Application Dictionary");
View Full Code Here

  }

  private void checkDepencyOnCore(Module module, SystemValidationResult result) {
    boolean coreModuleFound = false;
    for (ModuleDependency md : module.getModuleDependencyList()) {
      final Module dependentModule = findCoreModule(md.getDependentModule(), module.getId());
      if (dependentModule != null) {
        if (dependentModule.getId().equals(module.getId())) {
          result.addError(SystemValidationType.MODULE_ERROR,
              "Cycle in module dependencies with module " + module.getName());
          coreModuleFound = true; // prevents additional message
          break;
        }
        if (dependentModule.getId().equals("0")) {
          coreModuleFound = true;
          break;
        }
      }
    }
View Full Code Here

    if (module.getId().equals("0")) {
      return module;
    }

    for (ModuleDependency md : module.getModuleDependencyList()) {
      final Module depModule = findCoreModule(md.getDependentModule(), originalModuleId);
      if (depModule != null) {
        return depModule;
      }
    }
    return null;
View Full Code Here

    HashMap<String, CommercialModuleStatus> subscribedModules = getSubscribedModules();
    Iterator<String> iterator = subscribedModules.keySet().iterator();
    while (iterator.hasNext()) {
      String moduleId = iterator.next();
      if (subscribedModules.get(moduleId) == CommercialModuleStatus.EXPIRED) {
        Module module = OBDal.getInstance().get(Module.class, moduleId);
        if (module != null && module.getStatus().equals("A")) {
          result.add(module);
        }
      }
    }
    return result;
View Full Code Here

  /**
   * Creates a test module to work with it in later tests
   */
  public void testCreateModule() {
    setUserContext("0");
    Module module = OBProvider.getInstance().get(Module.class);
    module.setName("Test-table-names");
    module.setJavaPackage("org.openbravo.test.tablename");
    module.setVersion("1.0.0");
    module.setDescription("Testing dbprefixes");
    module.setInDevelopment(true);
    OBDal.getInstance().save(module);

    ModuleDBPrefix dbPrefix = OBProvider.getInstance().get(ModuleDBPrefix.class);
    dbPrefix.setName("TEST1");
    dbPrefix.setModule(module);
View Full Code Here

  /**
   * Creates a new module to test with
   */
  public void testCreateModule() {
    setUserContext("0");
    Module module = OBProvider.getInstance().get(Module.class);
    module.setName("Test-dbprefixes-names");
    module.setJavaPackage("org.openbravo.test.dbprefix");
    module.setVersion("1.0.0");
    module.setDescription("Testing dbprefixes");
    module.setInDevelopment(true);
    OBDal.getInstance().save(module);
  }
View Full Code Here

  // Tries to insert a valid or not valid and check it was inserted (if valid)
  // or not inserted (if not valid
  private void insertDBPrefix(String name, boolean isValid) {
    setUserContext("0");
    Module mod = getModule();
    ModuleDBPrefix dbPrefix = OBProvider.getInstance().get(ModuleDBPrefix.class);

    dbPrefix.setModule(mod);
    dbPrefix.setName(name);
View Full Code Here

TOP

Related Classes of org.openbravo.model.ad.module.Module

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.