Module: UU::OS::Search

Extended by:
Search
Included in:
Search
Defined in:
uu_os-0.29.16/lib/uu/os/search.rb

Overview

UES Search service.

Constant Summary

PATH =

Service path

'ues/core/search/UESSearch'

Instance Method Summary (collapse)

Instance Method Details

- (Boolean) exists(object_uri)

This command checks the existence of an artifact or an aggregated object in the system. It doesn't check any business rules, so it never throws an application exception (system exceptions like web services connection problems can still occur). If the current user has an access to the territory specified in objectUri, the command returns true if there is an aggregated object or an artifact with UESURI object_uri. If false is returned in this case, it is safe to assume the UESURI is not used and it is free to use (Bear in mind this applies only in the moment of the command call. ). If the current user doesn't have an access to the territory or the territory doesn't exist, the command always returns false.

Parameters:

  • object_uri (String, UU::OS::UESURI)

    UESURI of an artifact or an aggregated object

Returns:

  • (Boolean)

    True if object exists, else false



28
29
30
31
32
33
34
# File 'uu_os-0.29.16/lib/uu/os/search.rb', line 28

def exists(object_uri)
  svc = UU::OS::REST::RemoteClient.new(Search)
  UU::OS::QoS::QoSHandler.auto_retry do
    res = svc.get('exists', object_uri)
    return (res == 'true') || (res == '"true"') 
  end
end