Esempio n. 1
0
  /*
   * Création de la liste des logiciels du produit à partir d'une liste de
   * logiciels.
   *
   * @param productSoftwares Liste des logiciels.
   */
  private List<Software> updateProductSoftwares(List<Software> productSoftwares) {
    List<Software> _productSoftwares = new ArrayList<Software>();

    if (null != productSoftwares) {
      String _name;
      String _version;
      for (Software _productSoftware : productSoftwares) {
        _name = _productSoftware.getName();
        _version = _productSoftware.getVersion();

        // Retreive software
        _productSoftware = _softwareModule.getSoftware(_name, _version);
        if (null == _productSoftware) {
          // New software
          _productSoftware = _softwareModule.addSoftware(_name, _version);
        } else {
          // Exiting component
        }

        _productSoftwares.add(_productSoftware);
      }
    }

    return _productSoftwares;
  }
Esempio n. 2
0
  private void updateProductSoftwares(Product _product, String[][] productSoftwares) {
    _product.setProductSoftwares(new ArrayList<Software>());

    if (null != productSoftwares) {
      Software _software;

      int _nbRow = productSoftwares[0].length;
      String _name;
      String _version;
      for (int _softwareRow = 0; _softwareRow < _nbRow; _softwareRow++) {
        _name = productSoftwares[1][_softwareRow];
        _version = productSoftwares[2][_softwareRow];

        // ServiceInterface _serviceInterface = new ServiceInterface();
        // Retreive software
        _software = _softwareModule.getSoftware(_name, _version);
        if (null == _software) {
          // New software
          _software = _softwareModule.addSoftware(_name, _version);
        } else {
          // Exiting component
        }

        _product.getProductSoftwares().add(_software);
      }
    }
  }