fcf.module({
  name: "fcfDBControls:templates/externalRef-edit.hooks.js",
  dependencies: [],
  module: function(){
    return {
      //
      // void hookBeforeBuild(a_taskInfo)
      // The hook is executed before assembling the template arguments
      //
      // hookBeforeBuild: function(a_taskInfo) {
      // },

      //
      // void hookAfterBuild(a_taskInfo)
      // The hook is executed after assembling the template arguments
      //
      // hookAfterBuild: function(a_taskInfo) {
      // },

      //
      // void hookAfterBuild(a_taskInfo)
      // The hook is executed after building the template's system arguments
      //
      // hookAfterSystemBuild: function(a_taskInfo) {
      // },

      //
      // Object of hooks for programmatically populated arguments
      //
      hooksProgramableArgument: {
        _fields: (a_taskInfo) => {
          let projection = fcf.application.getProjections().get(a_taskInfo.args.projection);
          let refField   = projection.fieldsMap[a_taskInfo.args.refField];
          return [refField.refField];
        },
        _sourceProjection: (a_taskInfo)=>{
          let projection = fcf.application.getProjections().get(a_taskInfo.args.projection);
          let refField   = projection.fieldsMap[a_taskInfo.args.refField];
          return refField.projection;
        },
        blank: (a_taskInfo)=>{
          return "blank" in a_taskInfo.args ? a_taskInfo.args.blank :
                 a_taskInfo.args.notEmpty   ? false :
                 a_taskInfo.args.notNull    ? false :
                                              true;
        },
        enable: (a_taskInfo)=>{
          return "enable" in a_taskInfo.args ? a_taskInfo.args.enable :
                 a_taskInfo.args.readOnly    ? false :
                                               true;
        }
      },

      //
      // Object of the hooks preprocessing of the template arguments
      //
      // hooksBeforeArgument: {
      //   // 
      //   // @result Can return the value of an argument or Promise or undefined
      //   //
      //   "ARG_NAME": function(a_taskInfo) {
      //   }
      // },

      //
      // Object of the hooks postprocessing of the template arguments
      // hooksAfterArgument: {
      //   //
      //   // @result Can return the value of an argument or Promise or undefined
      //   //
      //   "ARG_NAME": function(a_taskInfo) {
      //   }
      // },
    };
  }
});
