app/models/reference_analysis.rb
# validate that a requested WDL is both accessible and readable
validate that a requested WDL is both accessible and readable
validate that a requested WDL is both accessible and readable
def validate_wdl_accessibility
    [:analysis_wdl, :benchmark_wdl, :orchestration_wdl].each do |wdl_attr|
      if extract_wdl_keys(wdl_attr).size != 3
        errors.add(wdl_attr, "is not in the correct format.  The value for #{wdl_attr} must be in the form of :namespace/:name/:version")
      end
      wdl_namespace, wdl_name, wdl_version = extract_wdl_keys(wdl_attr)
      begin
        wdl = ApplicationController.fire_cloud_client.get_method(wdl_namespace, wdl_name, wdl_version)
        if !wdl['public']
          errors.add(wdl_attr, 'is not viewable by Unity.  Please make this WDL public before continuing.')
        end
      rescue => e
        errors.add(wdl_attr, 'is not viewable by Unity.  Please make this WDL public before continuing.')
      end
    end
  end
def validate_wdl_accessibility [ :analysis_wdl , :benchmark_wdl , :orchestration_wdl ] . each do | wdl_attr | if extract_wdl_keys ( wdl_attr ) . size != 3 errors . add ( wdl_attr , "is not in the correct format.  The value for #{wdl_attr} must be in the form of :namespace/:name/:version" ) end wdl_namespace , wdl_name , wdl_version = extract_wdl_keys ( wdl_attr ) begin wdl = ApplicationController . fire_cloud_client . get_method ( wdl_namespace , wdl_name , wdl_version ) if ! wdl [ 'public' ] errors . add ( wdl_attr , 'is not viewable by Unity.  Please make this WDL public before continuing.' ) end rescue => e errors . add ( wdl_attr , 'is not viewable by Unity.  Please make this WDL public before continuing.' ) end end end
validate that a requested WDL is both accessible and readable
validate that a requested WDL is both accessible and readable