CaCORE

 view release on metacpan or  search on metacpan

examples/EVStest.pl  view on Meta::CPAN


use LWP::UserAgent;
use HTTP::Request::Common;
use CaCORE::ApplicationService;
use CaCORE::EVS;

#
# ApplicationService is a utility classs that encapsulates webservice invocation to caCORE server.
# ApplicationService object follows the Singleton pattern, in that each program will ONLY contain one instance
# of such class.
# The URL being passed to the intance method is the service endpoint of the caCORE webservice.
# If no such URL is provided in the program, it will default to the caCORE production server, "http://cabio.nci.nih.gov/cacore30/ws/caCOREService"
#
my $appsvc = CaCORE::ApplicationService->instance("http://cabio.nci.nih.gov/cacore32/ws/caCOREService");

my $num2 = 0;

# test EVS 1: Search Metaphrase by Atom and Source
#
# This test case retrieves a MetaThesaurusConcept with a atom with code "1256-5501", and a source with abbrieviation "CSP2004"
#

examples/caBIOtest.pl  view on Meta::CPAN

use HTTP::Request::Common;
use CaCORE::ApplicationService;
use CaCORE::CaBIO;
use CaCORE::Security;
use CaCORE::CaDSR;

#
# ApplicationService is a utility classs that encapsulates webservice invocation to caCORE server.
# ApplicationService object follows the Singleton pattern, in that each program will ONLY contain one instance
# of such class.
# The URL being passed to the intance method is the service endpoint of the caCORE webservice.
# If no such URL is provided in the program, it will default to the caCORE production server, "http://cabio.nci.nih.gov/cacore30/ws/caCOREService"
#
my $appsvc = CaCORE::ApplicationService->instance("http://cabio.nci.nih.gov/cacore32/ws/caCOREService");

# test CaBIO 1: use ApplicationService
# 
# This test retrieves all Chromosomes whoses associated genes have a symbol of "NAT2" using the direct
# and basic search function of ApplicationService->queryObject
#
print "test CaBIO 1: use ApplicationService to search Gene given a gene symbol attribute\n";

examples/caDSRtest.pl  view on Meta::CPAN

use LWP::UserAgent;
use HTTP::Request::Common;
use CaCORE::ApplicationService;
use CaCORE::CaBIO;
use CaCORE::CaDSR;

#
# ApplicationService is a utility classs that encapsulates webservice invocation to caCORE server.
# ApplicationService object follows the Singleton pattern, in that each program will ONLY contain one instance
# of such class.
# The URL being passed to the intance method is the service endpoint of the caCORE webservice.
# If no such URL is provided in the program, it will default to the caCORE production server, "http://cabio.nci.nih.gov/cacore30/ws/caCOREService"
#
my $appsvc = CaCORE::ApplicationService->instance("http://cabio.nci.nih.gov/cacore32/ws/caCOREService");

# test CaDSR 1 test
print "test CaDSR 1: retrieve caDSR object ObjectClass\n";
my $oc = new CaCORE::CaDSR::ObjectClass;
$oc->setWorkflowStatusName("RELEASED");
my @resultList;
eval{

html/ApplicationService.html  view on Meta::CPAN

	</ul>

</ul>
<!-- INDEX END -->

<hr />
<p>
</p>
<hr />
<h1><a name="applicationservice">ApplicationService</a></h1>
<p>CaCORE::ApplicationService is a utility class that encapsulates webservice invocation to caCORE server. ApplicationService object follows the Singleton pattern, in that each program will ONLY contain one instance of such class. The URL being passe...
<p>
</p>
<h2><a name="synopsis">Synopsis</a></h2>
<pre>
  <span class="keyword">my</span> <span class="variable">$appsvc</span> <span class="operator">=</span> <span class="variable">CaCORE::ApplicationService</span><span class="operator">-&gt;</span><span class="variable">instance</span><span class="oper...
        <span class="string">"http://cabio.nci.nih.gov/cacore32/ws/caCOREService"</span><span class="operator">);</span>
  <span class="keyword">my</span> <span class="variable">$gene</span> <span class="operator">=</span> <span class="variable">new</span> <span class="variable">CaCORE::CaBIO::Gene</span><span class="operator">;</span>
  <span class="variable">$gene</span><span class="operator">-&gt;</span><span class="variable">setSymbol</span><span class="operator">(</span><span class="string">"NAT2"</span><span class="operator">);</span>
  <span class="keyword">my</span> <span class="variable">@chromos</span> <span class="operator">=</span> <span class="variable">$appsvc</span><span class="operator">-&gt;</span><span class="variable">queryObject</span><span class="operator">(</span><...
</pre>
<p>
</p>
<h2><a name="operations">Operations</a></h2>
<p>The following methods are supported in CaCORE::ApplicationService:</p>
<ul>
<li>
<p><code>instance(url)</code>: returns the ApplicationService instance. &quot;url&quot; is the service endpoint to a caCORE server. Example url: &quot;http://cabio.nci.nih.gov/cacore30/ws/caCOREService&quot;.</p>
</li>
<li>
<p><code>queryObject(targetPath, sourceObject)</code>: invoke caCORE server to search for domain objects. This method returns at most 1000 objects because caCORE webservice automatically trims the result set to 1000 if actual result set is greater th...
</li>
<li>
<p><code>query(targetPath, sourceObject, startIndex, requestSize)</code>: invoke caCORE server to search for domain objects. Allows for specifying the return result set.</p>
</li>
</ul>
<p>Description of parameters used in the above functions:</p>
<ul>
<li>
<p><code>url</code>: the service endpoint to a caCORE server. Example url: &quot;http://cabio.nci.nih.gov/cacore30/ws/caCOREService&quot;.</p>
</li>
<li>
<p><code>targetPath</code>: can be either a fully qualified target object name, such as &quot;CaCORE::CaBIO::Gene&quot;; or a series of comma separated fully qualified object names indicating a navigational path, such as &quot;CaCORE::CaBIO::Taxon,Ca...
</li>
<li>
<p><code>sourceObject</code>: is the search criteria that specifies the search starting point.</p>
</li>
<li>
<p><code>startIndex</code> (for method &quot;query&quot; only): allows for control of the starting index of the result set. When presented, requestSize must also be present.</p>
</li>

html/searching.html  view on Meta::CPAN

</code>

<p>Note: these methods utlizes the ApplicationService->queryObject() method. The caCORE
server automatically trims the result set to 1000. More detail in the subsequent discussion.</p>

<h2><a name="AppSvc_Search">Advanced Search via ApplicationService Utility</a></h2>

<p><a href="ApplicationService.htm">ApplicationService</a> is a utility class that encapsulates webservice invocation to caCORE server.
ApplicationService object follows the Singleton pattern, in that each program will ONLY contain one instance
of such class.
The URL being passed to the <code>instance</code> method is the service endpoint of the caCORE webservice.
If no such URL is provided in the program, it will default to the caCORE production server,
"http://cabio.nci.nih.gov/cacore32/ws/caCOREService". The ApplicationService class exposes two methods:
queryObject and query for search. The ApplicationService is the fundamental class that all other search
methods utilize.</p>

<p>The following methods are supported in CaCORE::ApplicationService:</p>

<ul>
	<li>instance(url): returns the ApplicationService instance. "url" is the service endpoint to a caCORE server. Example url: "http://cabio.nci.nih.gov/cacore30/ws/caCOREService".
	<li>queryObject(targetPath, sourceObject): invoke caCORE server to search for domain objects. This method returns at most 1000 objects because caCORE webservice automatically trims the result set to 1000 if actual result set is greater than 1000.
	<li>query(targetPath, sourceObject, startIndex, requestSize): invoke caCORE server to search for domain objects. Allows for specifying the return result set.
</ul>

<p>Description of parameters used in the above functions:</p>
<ul>
    <li>url: the service endpoint to a caCORE server. Example url: "http://cabio.nci.nih.gov/cacore30/ws/caCOREService".
	<li>targetPath can be either a fully qualified target object name, such as "CaCORE::CaBIO::Gene"; or a series
	of comma separated fully qualified object names indicating a navigational path, such as
	"CaCORE::CaBIO::Taxon,CaCORE::CaBIO::Chromosome". This navigational path specifies the relationship to traverse
	when retrieving the target objects.
	<li>sourceObject is the search criteria that specifies the search starting point.
	<li>startIndex (for method "query" only), allows for control of the starting index of the result set. When presented,
	requestSize must also be present.
	<li>requestSize (for method "query" only), defines the requested size. Server trims the return result to the requested
	size before returns. If the result set is smaller than the requested size, the result set is returned without trimming.
	<li>For queryObject method, caCORE webservice automatically trims the result set to 1000 if actual result set is greater

lib/CaCORE/ApplicationService.pm  view on Meta::CPAN

1;

__END__

# Below is module documentation for ApplicationService

=pod

=head1 ApplicationService

CaCORE::ApplicationService is a utility class that encapsulates webservice invocation to caCORE server. ApplicationService object follows the Singleton pattern, in that each program will ONLY contain one instance of such class. The URL being passed t...

=head2 Synopsis

  my $appsvc = CaCORE::ApplicationService->instance(
  	"http://cabio.nci.nih.gov/cacore32/ws/caCOREService");
  my $gene = new CaCORE::CaBIO::Gene;
  $gene->setSymbol("NAT2");
  my @chromos = $appsvc->queryObject("CaCORE::CaBIO::Chromosome", $gene);

=head2 Operations

The following methods are supported in CaCORE::ApplicationService:

=over 1

=item *

C<instance(url)>: returns the ApplicationService instance. "url" is the service endpoint to a caCORE server. Example url: "http://cabio.nci.nih.gov/cacore30/ws/caCOREService".

=item *

C<queryObject(targetPath, sourceObject)>: invoke caCORE server to search for domain objects. This method returns at most 1000 objects because caCORE webservice automatically trims the result set to 1000 if actual result set is greater than 1000.

=item *

C<query(targetPath, sourceObject, startIndex, requestSize)>: invoke caCORE server to search for domain objects. Allows for specifying the return result set.

=back

Description of parameters used in the above functions:

=over 1

=item *

C<url>: the service endpoint to a caCORE server. Example url: "http://cabio.nci.nih.gov/cacore30/ws/caCOREService".

=item *

C<targetPath>: can be either a fully qualified target object name, such as "CaCORE::CaBIO::Gene"; or a series of comma separated fully qualified object names indicating a navigational path, such as "CaCORE::CaBIO::Taxon,CaCORE::CaBIO::Chromosome". Th...

=item *

C<sourceObject>: is the search criteria that specifies the search starting point.

=item *

 view all matches for this distribution
 view release on metacpan -  search on metacpan

( run in 0.640 second using v1.00-cache-2.02-grep-82fe00e-cpan-4673cadbf75 )