Package org.openbravo.erpCommon.modules

Examples of org.openbravo.erpCommon.modules.ImportModule


      } catch (final Exception e) {
        log4j.error(e);
        throw new ServletException(e);
      }
    } else {
      final ImportModule im = (ImportModule) vars.getSessionObject("InstallModule|ImportModule");
      module = im.getModule(recordId);
    }

    final ModuleDependency[] dependencies = module.getDependencies();
    final ModuleDependency[] includes = module.getIncludes();
View Full Code Here


      message.setMessage(Utility.messageBD(this, "MOD_OBX", vars.getLanguage()));

      printSearchFile(response, vars, message);

    } else {
      ImportModule im = new ImportModule(this, vars.getSessionValue("#sourcePath"), vars);
      try {
        if (im.isModuleUpdate(fi.getInputStream())) {
          vars.setSessionObject("ModuleManagementInstall|File", vars.getMultiFile("inpFile"));
          printPageInstall1(response, request, vars, null, true, fi.getInputStream(), new String[0]);
        } else {
          OBError message = im.getOBError(this);
          printSearchFile(response, vars, message);
        }
      } catch (Exception e) {
        log4j.error(e.getMessage(), e);
        throw new ServletException(e);
View Full Code Here

    VersionUtility.setPool(this);

    // Craete a new ImportModule instance which will be used to check
    // depencecies and to process the installation
    final ImportModule im = new ImportModule(this, vars.getSessionValue("#sourcePath"), vars);
    im.setInstallLocal(islocal);
    try {
      // check the dependenies and obtain the modules to install/update
      if (!islocal) {
        final String[] installableModules = { module != null ? module.getModuleVersionID() : "" };
        check = im.checkDependenciesId(installableModules, updateModules);
      } else {
        check = im.checkDependenciesFile(obx);
      }

      // Check commercial modules can be installed

      if (check) { // dependencies are statisfied, show modules to install
        // installOrig includes also the module to install
        final Module[] installOrig = im.getModulesToInstall();

        // check commercial modules and show error page if not allowed to install
        if (!checkCommercialModules(im, response, vars)) {
          return;
        }

        if (installOrig == null || installOrig.length == 0)
          discard[0] = "modulesToinstall";
        else {
          if (!islocal && module != null) {
            inst = new Module[installOrig.length - 1]; // to remove
            // the module
            // itself
            // check if the version for the selected module is the
            // selected one
            int j = 0;
            for (int i = 0; i < installOrig.length; i++) {
              found = installOrig[i].getModuleID().equals(module.getModuleID());
              if (found && !module.getModuleVersionID().equals(installOrig[i].getModuleVersionID())) {

                message = new OBError();
                message.setType("Warning");
                message.setTitle(Utility.messageBD(this, message.getType(), vars.getLanguage()));
                message.setMessage(module.getName()
                    + " "
                    + module.getVersionNo()
                    + " "
                    + Utility.messageBD(this, "OtherModuleVersionToinstallOrigall", vars
                        .getLanguage()) + " " + installOrig[i].getVersionNo());
              }
              if (found) {
                module = installOrig[i];
              } else {
                inst[j] = installOrig[i];
                j++;
              }

            }
          } else {
            inst = installOrig;
          }
        }
        upd = im.getModulesToUpdate();
        // after all the checks, save the ImportModule object in session
        // to take it in next steps
        vars.setSessionObject("InstallModule|ImportModule", im);
      } else { // Dependencies not satisfied, do not show continue button
        message = im.getCheckError();
        discard[5] = "discardContinue";
      }
      if (upd == null || upd.length == 0)
        discard[1] = "updateModules";
      if (inst == null || inst.length == 0)
View Full Code Here

      throws IOException, ServletException {
    Module[] inst = null;
    Module[] selected;

    // Obtain the session object with the modules to install/update
    final ImportModule im = (ImportModule) vars.getSessionObject("InstallModule|ImportModule");
    final Module[] installOrig = im.getModulesToInstall();
    final Module[] upd = im.getModulesToUpdate();

    final String adModuleId = vars.getStringParameter("inpModuleID"); // selected
    // module
    // to
    // install
    final boolean islocal = im.getIsLocal();

    if (!islocal) {
      selected = new Module[1];
      inst = new Module[installOrig.length == 0 ? 0 : adModuleId.equals("") ? installOrig.length
          : installOrig.length - 1]; // to
View Full Code Here

   * @throws IOException
   * @throws ServletException
   */
  private void printPageInstall3(HttpServletResponse response, VariablesSecureApp vars)
      throws IOException, ServletException {
    final ImportModule im = (ImportModule) vars.getSessionObject("InstallModule|ImportModule");
    final XmlDocument xmlDocument = xmlEngine.readXmlTemplate(
        "org/openbravo/erpCommon/ad_forms/ModuleManagement_InstallP4").createXmlDocument();
    xmlDocument.setParameter("directory", "var baseDirectory = \"" + strReplaceWith + "/\";\n");
    xmlDocument.setParameter("language", "defaultLang=\"" + vars.getLanguage() + "\";");
    xmlDocument.setParameter("theme", vars.getTheme());
    OBError message;
    if (im.getIsLocal())
      im.execute(((FileItem) vars.getSessionObject("ModuleManagementInstall|File"))
          .getInputStream());
    else
      im.execute();
    message = im.getOBError(this);

    {
      if (message != null) {
        xmlDocument.setParameter("messageType", message.getType());
        xmlDocument.setParameter("messageTitle", message.getTitle());
View Full Code Here

      log4j.debug("Output: ajaxreponse");

    response.setContentType("text/plain; charset=UTF-8");
    response.setHeader("Cache-Control", "no-cache");
    final PrintWriter out = response.getWriter();
    final ImportModule im = (ImportModule) vars.getSessionObject("InstallModule|ImportModule");
    final Module[] inst = im.getModulesToInstall();
    final Module[] upd = im.getModulesToUpdate();

    int i = 0;
    boolean found = false;
    String agreement = "";
    while (!found && inst != null && i < inst.length) {
View Full Code Here

TOP

Related Classes of org.openbravo.erpCommon.modules.ImportModule

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.