importPackage(Packages.de.elo.ix.jscript);
importPackage(Packages.de.elo.ix.scripting);

//@include lib_Class.js
//@include lib_sol.common.Config.js
//@include lib_sol.common.ix.DynKwlFindChildrenIterator.js

/**
 *
 * Dynamic keyword list that returns a list of the generator type: Company Reference.
 *
 * The list is returned as a table.
 *
 * |Name|Description|Example data|
 * |:-----|:------|:------|
 * |Short Description|COMPANY_REFERENCE_GEN|Kontakt-Verwaltung - Firmenzeichen|
 * |Description|-|Description of the counter (memo text)|
 *
 * @author JHR, ELO Digital Office GmbH
 * @version 1.0
 *
 * @requires sol.Logger
 * @requires sol.common.Config
 * @requires sol.common.ix.DynKwlFindChildrenIterator
 */
sol.define("sol.contact.ix.dynkwl.generators.ReferenceCompany", {
  extend: "sol.common.ix.DynKwlFindChildrenIterator",

  initialize: function (config) {
    var me = this;

    me.contactConfig = sol.create("sol.common.Config", { compose: "/contact/Configuration/contact.config" }).config;
    me.parentId = me.contactConfig.generators.templateFolderIds.companyReference;

    me.$super("sol.common.ix.DynKwlFindChildrenIterator", "initialize", [config]);
  },

  /**
   * @cfg
   * @inheritdoc
   */
  tableTitle: "Generators - Company Reference",

  /**
   * @cfg
   * @inheritdoc
   */
  tableKeyNames: ["COMPANY_REFERENCE_GEN", null],

  /**
   * @cfg
   * defined by initialize
   */
  parentId: null

});

/**
 * Implements a DynamicKeywordDataProvider for this keyword list that can be used by checkoutKeywordsDynamic.
 * @static
 * @member sol.contact.ix.dynkwl.generators.ReferenceCompany
  * @returns {DynamicKeywordDataProvider}
 */
function getDataIterator() {
  var log = sol.create("sol.Logger", { scope: "sol.contact.ix.dynkwl.generators.ReferenceCompany" }),
      iterator;
  try {
    log.info("DynamicKeywordList (");
    iterator = sol.create("sol.contact.ix.dynkwl.generators.ReferenceCompany", {});
    return new DynamicKeywordDataProvider(iterator);
  } finally {
    log.info(")getDataIterator");
  }
}