    importPackage(Packages.de.elo.ix.client);

    //@include lib_Class.js
    //@include lib_sol.common.Config.js
    //@include lib_sol.common.SordUtils.js
    //@include lib_sol.common.RepoUtils.js
    //@include lib_sol.common.ix.ServiceBase.js

    var logger = sol.create("sol.Logger", { scope: "sol.contact.ix.services.ReportTemplates" });

    /**
     * Retrieves information about available report templates.
     *
     * The result can be filtered by the different reporting types (see `Configuration`).
     *
     * # Return value
     * This service returns an Array of Objects with informations about the found report templates:
     *
     *     {
     *       objId: "123",
     *       name: "My Report Template",
     *       desc: "Some description."
     *     }
     *
     * # Configuration
     *
     * |Property|Description|
     * |:------|:------|
     * |reporting.templateFolderId|Path or ID to the report template folder|
     * |reporting.types.%TYPE%.subfolder|Subfolder for report type|
     *
     * Types object has to contain one Object for every report type.
     *
     * @author JHR, ELO Digital Office GmbH
     * @version 1.0
     *
     * @eloix
     * @requires sol.common.Config
     * @requires sol.common.JsonUtils
     * @requires sol.common.SordUtils
     * @requires sol.common.RepoUtils
     * @requires sol.common.ix.RfUtils
     * @requires sol.common.ix.ServiceBase
     */
    sol.define("sol.contact.ix.services.ReportTemplates", {
      extend: "sol.common.ix.ServiceBase",

      /**
       * @cfg {Object} filter (optional) Additional filters which can be applied to the results
       * @cfg {String} filter.type (optional) If set, the available contact types will be filtered
       */

      initialize: function (config) {
        var me = this;
        me.$super("sol.common.ix.ServiceBase", "initialize", [config]);
        me.config = sol.create("sol.common.Config", { compose: "/contact/Configuration/contact.config" }).config;
      },

      /**
       * Retrieves the data as spezified in the constructor configuration.
       * @returns {Object[]} Array with contact types
       */
      process: function () {
        var me = this,
            reportTemplateSords, reportTemplates;

        reportTemplateSords = me.getTemplates();
        reportTemplates = me.convert(reportTemplateSords);

        return reportTemplates;
      },

      /**
       * @private
       * Retrieves all template Sord objects.
       * @param {String} type
       * @returns {de.elo.ix.client.Sord[]}
       */
      getTemplates: function () {
        var me = this,
            path = me.config.reporting.templateFolderId,
            searchConf = {},
            type;

        searchConf.includeFolders = false;
        searchConf.includeDocuments = true;
        searchConf.includeReferences = true;
        searchConf.sordZ = SordC.mbAllIndex;

        if (me.filter && me.filter.type) {
          type = me.filter.type;
          if (!me.config.reporting.types[type]) {
            throw "[" + me.$className + "] report type '" + type + "' is not supported/configured";
          }
          path += "/" + me.config.reporting.types[type].subfolder;
        } else {
          searchConf.recursive = true;
          searchConf.level = 2;
        }

        return sol.common.RepoUtils.findChildren(path, searchConf);
      },

      /**
       * @private
       * Converts from Sords to Objects
       * @param {de.elo.ix.client.Sord[]} reportTemplateSords
       * @returns {Object[]}
       */
      convert: function (reportTemplateSords) {
        var converted = [];
        if (reportTemplateSords) {
          reportTemplateSords.forEach(function (sord) {
            converted.push({
              objId: sord.id,
              name: sord.name,
              desc: sord.desc
            });
          });
        }
        return converted;
      }

    });

    /**
     * @member sol.contact.ix.services.GetContactTypes
     * @method RF_sol_contact_service_GetContactTypes
     * @static
     * @inheritdoc sol.common.ix.ServiceBase#RF_ServiceBaseName
     */
    function RF_sol_contact_service_ReportTemplates(iXSEContext, args) {
      logger.enter("RF_sol_contact_service_ReportTemplates", args);
      var rfUtils = sol.common.ix.RfUtils,
          config = rfUtils.parseAndCheckParams(iXSEContext, arguments.callee.name, args),
          service, result;

      service = sol.create("sol.contact.ix.services.ReportTemplates", config);
      result = rfUtils.stringify(service.process());
      logger.exit("RF_sol_contact_service_ReportTemplates", result);
      return result;
    }