Difference between revisions of "TranscludeFilter"

From ARK
Jump to: navigation, search
(Created page with "This method is used to return the results of a filter in a standard ARK results array. It can return the results of a saved filter or can be used to run a simple freetext search....")
 
(Example 1 - transcluding a saved filter as a table)
 
(6 intermediate revisions by one other user not shown)
Line 24: Line 24:
 
===Example===
 
===Example===
  
====Example 1 - getting a saved filter====
+
====Example 1 - transcluding a saved filter as a table====
  
http://your.ark.instance/api.php?req=getFilter&retftrset=3&handle=johndoe&passwd=johndoepassword&disp_mode=table
+
http://your.ark.instance/api.php?req=transcludeFilter&retftrset=3&handle=johndoe&passwd=johndoepassword&disp_mode=table
  
 
Example return (returned as HTML):
 
Example return (returned as HTML):
  
<iframe>
+
[[File:transcludedFilter.png|500px]]
<!DOCTYPE html
 
 
 
    PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
 
 
 
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
 
 
 
<html>
 
<head>
 
    <!-- title -->
 
    <title>leskernick - API</title>
 
   
 
    <!-- meta -->
 
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
 
   
 
    <!-- stylesheets -->
 
    <link href="skins/arkologik/stylesheets/ark_main.css" type="text/css" rel="stylesheet"  media="screen" />
 
    <link href="/~stuarteve/leskernick//skins/arkologik/stylesheets/ark_main_print.css" type="text/css" rel="stylesheet" media="print" />
 
    <link href="/~stuarteve/leskernick//skins/arkologik/stylesheets/lightbox.css" type="text/css" rel="stylesheet" />
 
    <link href="/~stuarteve/leskernick//skins/arkologik/images/ark_favicon.ico" rel="shortcut icon" />
 
   
 
    <!-- javascript libraries -->
 
    <script type="text/javascript" src="/~stuarteve/leskernick/lib/js/jquery.js"></script>
 
    <script type="text/javascript" src="/~stuarteve/leskernick/lib/js/php.js"></script>
 
    <script type="text/javascript" src="/~stuarteve/leskernick/lib/js/prototype.js"></script>
 
    <script type="text/javascript" src="/~stuarteve/leskernick/lib/js/scriptaculous.js?load=effects"></script>
 
   
 
    <!-- ARK javascript -->
 
    <script type="text/javascript" src="/~stuarteve/leskernick/js/js_functions.js"></script>
 
    <script type="text/javascript" src="/~stuarteve/leskernick/js/lightbox.js"></script>
 
    <script type="text/javascript" src="/~stuarteve/leskernick/js/livesearch.js"></script>
 
</head>
 
 
 
<body>
 
 
 
    <!-- THE MAIN AREA -->
 
    <div id="main" class="">
 
 
 
    <div class="result_tbl">
 
<table class="result_tbl">
 
<th><a href="/~stuarteve/leskernick/api.php?sort_type=asc&amp;sort_field=conf_field_hut_cd">Hut</a></th><th><a href="/~stuarteve/leskernick/api.php?sort_type=asc&amp;sort_field=conf_field_description">Notes</a></th><th><a href="/~stuarteve/leskernick/api.php?sort_type=asc&amp;sort_field=conf_field_direction">Door Direction</a></th><th><a href="/~stuarteve/leskernick/api.php?sort_type=asc&amp;sort_field=conf_field_huts_can_see">Number of Huts that Can See this Hut</a></th><th><a href="/~stuarteve/leskernick/api.php?sort_type=asc&amp;sort_field=conf_field_fcat">Type</a></th><th><a href="/~stuarteve/leskernick/api.php?sort_type=asc&amp;sort_field=conf_field_stoneworlds">Stone Worlds </a></th><tr><td><span class="data"><a href="/~stuarteve/leskernick/micro_view.php?item_key=hut_cd&amp;hut_cd=LK12_28" class="itemkey_link" >LK12_28</a></span></td><td><span class="data">A shaman's house? The counterpart to house 3?</span></td><td><span class="data">SW</span></td><td><span class="data">12</span></td><td><span class="data">House</span></td><td><span class="data"><a href="/~stuarteve/leskernick/data/files/webthumb_12.jpg" rel="lightbox[]" ><img src="/~stuarteve/leskernick/data/files/arkthumb_12.jpg" alt="file_image"/></a>
 
</span></td></tr>
 
<tr><td><span class="data"><a href="/~stuarteve/leskernick/micro_view.php?item_key=hut_cd&amp;hut_cd=LK12_3" class="itemkey_link" >LK12_3</a></span></td><td><span class="data">The 'Shaman's House'. One of the most northerly and the only house with a view of Rough Tor directly through it's doorway.
 
 
 
It is associated with a field-shrine/mini-tor to the south and has a small 'hidden' enclosure to the back of the house. SW says that it is hidden from all of the houses - although the viewshed analysis suggests otherwise...</span></td><td><span class="data">W</span></td><td><span class="data">26</span></td><td></td><td><span class="data"><a href="/~stuarteve/leskernick/data/files/webthumb_4.jpg" rel="lightbox[]" ><img src="/~stuarteve/leskernick/data/files/arkthumb_4.jpg" alt="file_image"/></a>
 
</span></td></tr>
 
</table>
 
</div>
 
 
 
    </div>
 
 
 
    <!-- end content WRAPPER -->
 
    </div>
 
 
 
 
 
    </body>
 
    </html>
 
</iframe>
 

Latest revision as of 16:44, 29 November 2013

This method is used to return the results of a filter in a standard ARK results array. It can return the results of a saved filter or can be used to run a simple freetext search.

Path

http://your.ark.instance/api.php?req=transcludeFilter

Arguments

  • ftype - The filtertype. Currently only a free text search can be undertaken using the API. If you want to run a free text search ftype needs to be set to 'ftx'. You will also need to send a src.
  • src - This is the free text phrase to search on. Normal Boolean Search (i.e. Google) parameters apply.

If you want to retrieve a previously saved filter (saved using the ARK web interface) use:

  • retftrset - this needs to be set to the numeric id of a saved filter. Current saved filters can be queried using the API method describeFilters().
  • disp_mode - this is the display mode of the filter results - how the HTML will be rendered. The possible options are: chat, table, text, thumb, map. If no disp_mode is specified the results will be returned in table view.

If anonymous logins are not enabled a username and password will need to be supplied:

  • handle - username
  • passwd - password

Example

Example 1 - transcluding a saved filter as a table

http://your.ark.instance/api.php?req=transcludeFilter&retftrset=3&handle=johndoe&passwd=johndoepassword&disp_mode=table

Example return (returned as HTML):

TranscludedFilter.png