Esempio n. 1
0
  /**
   * Saves the catalog Item information into database and the icon file into disk.
   *
   * @param catalogItemImpl
   * @throws CantPublishWalletInCatalogException
   */
  public void publishWallet(CatalogItemImpl catalogItemImpl)
      throws CantPublishWalletInCatalogException {
    try {
      DeveloperIdentity developer = catalogItemImpl.getDetailedCatalogItemImpl().getDeveloper();
      Language language =
          (Language) catalogItemImpl.getDetailedCatalogItemImpl().getDefaultLanguage();
      TranslatorIdentity translator =
          catalogItemImpl.getDetailedCatalogItemImpl().getDefaultLanguage().getTranslator();
      Skin skin = (Skin) catalogItemImpl.getDetailedCatalogItemImpl().getDefaultSkin();

      DesignerIdentity designer = skin.getDesigner();
      // I publish all the wallet info
      this.publishItemInDB(catalogItemImpl, developer, language, translator, skin, designer);

      // I save the icon file of the wallet and the skins.
      saveCatalogItemIconFile(catalogItemImpl);
      saveSkinImageFiles(skin);

    } catch (Exception exception) {
      exception.printStackTrace();
      throw new CantPublishWalletInCatalogException(
          CantPublishWalletInCatalogException.DEFAULT_MESSAGE,
          exception,
          "Publish Wallet",
          "Wallet Store");
    }
  }