display/app/controllers/application_controller.rb
def pack_versions(source, pack_name, major_version = nil)
    pack_ns_path = "/public/#{source}/packs/#{pack_name}"
    versions = Cms::Ci.all(:params => {:nsPath       => pack_ns_path,
                                        :ciClassName  => 'mgmt.Version',
                                        :recursive    => true,
                                        :attr         => 'enabled:neq:false',
                                        :includeAltNs => Catalog::PacksController::ORG_VISIBILITY_ALT_NS_TAG})
    versions += Cms::Ci.all(:params => {:nsPath      => pack_ns_path,
                                         :ciClassName => 'mgmt.Version',
                                         :recursive   => true,
                                         :attr        => 'enabled:eq:false',
                                         :altNsTag    => Catalog::PacksController::ORG_VISIBILITY_ALT_NS_TAG,
                                         :altNs       => organization_ns_path})
    versions = versions.select {|v| v.ciName == major_version || v.ciName.start_with?("#{major_version}.")} if major_version.present?
    semver_sort(versions)
  end
# Returns only pack versions enabled for current org.
Returns only pack versions enabled for current org.
Returns only pack versions enabled for current org .
def pack_versions(source, pack_name, major_version = nil)
    pack_ns_path = "/public/#{source}/packs/#{pack_name}"
    versions = Cms::Ci.all(:params => {:nsPath       => pack_ns_path,
                                        :ciClassName  => 'mgmt.Version',
                                        :recursive    => true,
                                        :attr         => 'enabled:neq:false',
                                        :includeAltNs => Catalog::PacksController::ORG_VISIBILITY_ALT_NS_TAG})
    versions += Cms::Ci.all(:params => {:nsPath      => pack_ns_path,
                                         :ciClassName => 'mgmt.Version',
                                         :recursive   => true,
                                         :attr        => 'enabled:eq:false',
                                         :altNsTag    => Catalog::PacksController::ORG_VISIBILITY_ALT_NS_TAG,
                                         :altNs       => organization_ns_path})
    versions = versions.select {|v| v.ciName == major_version || v.ciName.start_with?("#{major_version}.")} if major_version.present?
    semver_sort(versions)
  end
def pack_versions ( source , pack_name , major_version = nil ) pack_ns_path = "/public/#{source}/packs/#{pack_name}" versions = Cms :: Ci . all ( :params => { :nsPath => pack_ns_path , :ciClassName => 'mgmt.Version' , :recursive => true , :attr => 'enabled:neq:false' , :includeAltNs => Catalog :: PacksController :: ORG_VISIBILITY_ALT_NS_TAG } ) versions += Cms :: Ci . all ( :params => { :nsPath => pack_ns_path , :ciClassName => 'mgmt.Version' , :recursive => true , :attr => 'enabled:eq:false' , :altNsTag => Catalog :: PacksController :: ORG_VISIBILITY_ALT_NS_TAG , :altNs => organization_ns_path } ) versions = versions . select { | v | v . ciName == major_version || v . ciName . start_with? ( "#{major_version}." ) } if major_version . present? semver_sort ( versions ) end
Returns only pack versions enabled for current org.
Returns only pack versions enabled for current org .
source
pack_name
major_version