Texis Web Script source code for: /texis/site/demos/motorola.vs
Note: Click on links to view the documentation for HTML tags which are special to the Vortex compiler.
<!--------------------------------------------------------------------------
  Start of Vortex script
--------------------------------------------------------------------------->

<script language=vortex>

<!--------------------------------------------------------------------------
  Save variable values between calls
--------------------------------------------------------------------------->

<export $id url>
<export $author url userok>
<export $allfields url userok>
<export $maxhits url userok>
<uses demonav=demonav><!--simple look and feel module-->
<entryfunc=init>              <!-- init function for every invocation -->

<!-- --------------------------------------------------------------------- -->
<a name=init private>
  <sum "%s" $SERVER_ROOT "/texis"><db = $ret>  <!-- set the database -->
</a>

<!--------------------------------------------------------------------------
  The main entry point
--------------------------------------------------------------------------->

<a name=main PUBLIC>
  <hdr>
    <if $maxhits eq "">
      <$maxhits = 25>
    </if>
    <description>
    <the_form>

  <ftr>
</a>

<!--------------------------------------------------------------------------
  Common header macro  
--------------------------------------------------------------------------->

<a name=hdr>   
  <demolook title="Research Abstract Search">
</a>

<!--------------------------------------------------------------------------
  Common footer macro
--------------------------------------------------------------------------->

<a name=ftr>
  <br>
  <h6 align=right>Copyright © 1996 Thunderstone Software</h6>
  </demolook>
</a>

<!--------------------------------------------------------------------------
  Program description
--------------------------------------------------------------------------->

<a name=description>
  <center>
    <big>This database contains scientific research abstracts compiled by Motorola.</big>
  </center>
  <p>
</a>

<!--------------------------------------------------------------------------
  Display abstract
--------------------------------------------------------------------------->

<a name=content PUBLIC>
  <hdr>
      <sql max=1 "select Abstract,Title,Author,Source,Pubyear from motorola where id = $id">
        <sum "%s" $allfields " @0 w/.">
        <$markup = $ret>
        <table>
          <tr>
            <td valign=top><i><b>Title:</b></i></td><td>$Title</td>
          </tr>
          <tr>
            <td valign=top><i><b>Author:</b></i></td><td>$Author</td>
          </tr>
          <tr>
            <td valign=top><i><b>Source:</b></i></td><td>$Source</td>
          </tr>
          <if $Pubyear neq "">
            <tr>    
              <td><i><b>Published:</b></i></td><td>$Pubyear</td>
            </tr>
          </if>
        </table>
        <p>
        <table>
          <tr>
            <td colspan=2>
              <if $markup neq "">
                <fmt "%mIpH" $markup $Abstract><br><br>
              <else>
                $Abstract
              </if>
            </td>
          </tr>
        </table>        
      </sql>
    <form method=post action="$url/results.html">
      <input type=submit value="Find More Like This">
      <input type=hidden name=mltflag value=1>
    </form>
  <ftr>
</a>

<!--------------------------------------------------------------------------
  Display a list of hits
--------------------------------------------------------------------------->
<a name=makelist>
  <table>
    <tr>
      <td><i><b>Title: </b></i><a href="$url/content.html">$Title</a></td>
    </tr>
    <tr>
      <td><i><b>Authors: </b></i>$Author</td>
    </tr>
  </table>
  <p>
</a>

<!--------------------------------------------------------------------------
  Display a page of hits
--------------------------------------------------------------------------->

<a name=prevnext>
  <table width=100%>
    <tr>
      <!-- Display previous group of hits -->
      <if $forward gt 0>
        <td align=left>
          <if $loop gte $maxhits>
            <$forward = ($forward + 1)>
            <$forward = ($forward - $loop)>
          <else>
            <$forward = 0>
          </if>
          <form method=post action="$url/results.html">
            <input type=submit value="Previous">
            <input type=hidden name=forward value=$forward>
          </form>
        </td>
      </if>
      <!-- Display next group of hits -->
      <if $loop gt $maxhits>
        <td align=right>
          <$next = ($next - 1)>
          <$forward = $next>
          <form method=post action="$url/results.html">
            <input type=submit value="Next">
            <input type=hidden name=forward value=$forward>
          </form>
        </td>
      </if>        
    </tr>
  </table>
</a>

<!--------------------------------------------------------------------------
  Error handling function
--------------------------------------------------------------------------->

<a name=putmsg>
  <$pmflag = 1>
  <$author = "">
  <$allfields = "">
  <if $errnum eq 115>
    <center><h4>Your query was too general. Try again with more specific words.</h4></center>
  </if>
</a>

<!--------------------------------------------------------------------------
  Display results
--------------------------------------------------------------------------->

<a name=results PUBLIC>
  <hdr>
  <if $author neq "">
    <rex \alpha{2,} $author />
    <if $ret eq "">
      <$author = "">
     <else>
       <sum "%s " $ret>
       <$author = $ret>
     </if>
  </if>
  <if $allfields neq "">
    <rex \alpha{2,} $allfields />
    <if $ret eq "">
      <$allfields = "">
    <else>
      <sum "%s " $ret>
      <$allfields = $ret>
    </if>
  </if>
  <the_form>
  <if $forward eq "">
    <$forward = 0>
  </if>
  <$query=$allfields>
  <if $author eq "" and $allfields eq "">
    <br>
    <center><h4>No search parameters were entered. Try again.</h4></center>
  <else>       
    <if $mltflag eq 1>
      <sql null="" max=1 "select text2mm(Title\Author\Abstract\Cidxterm\Uidxterm) query,Title from motorola
                  where id = $id">
      </sql>
      <$mltflag = 0>
      <dl>
        <dt><big>Documents similar in content to:</big><dd>$Title
      </dl> 
    </if>
    <if $maxhits eq "">
      <$maxhits = 25>
    </if>
    <$usermax = $maxhits>
    <$maxhits = ($maxhits + 1)>
    <sql null="" skip=$forward max=$maxhits "select id,Title,Author from motorola
                where (Author likep $author
                and Title\Author\Abstract\Cidxterm\Uidxterm likep $query) ; ">
      <if $loop lt $usermax>
        <makelist>
      </if>
    </sql>
    <$maxhits = ($maxhits - 1)>
    <prevnext>
    <if $pmflag eq 1>
      <$pmflag = 0>
    <else>
      <if $id eq "">
        <center><h4>No matches for your Query were found.</h4></center>
      </if>
      <if $id neq "">
        <center><h4>Select a title to see more information on the paper</h4></center>
      </if>
    </if>
  </if>
  <ftr>
</a>

<!--------------------------------------------------------------------------
  The search form
--------------------------------------------------------------------------->

<a name=the_form>
  <center><h3>Research Abstract Search</h3></center>
  <form method=post action="$url/results.html">
    <br>
    <center>
      <table>
        <tr>
          <td>
            <pre>
              Author:        <input name=author value="$author">
              Key Terms:     <input name=allfields value="$allfields">
            </pre>
          </td>
        </tr>
      </table>      
    </center>
    <center>
       <table>
         <tr>
           <td>
           Show <input name=maxhits value="$maxhits" size=4> Titles
           </td>
           <td>
           <input type=submit value=Search>
           </td>
         </tr>
       </table>
    </center>
    <p>
    <center>Please enter your search terms in the appropriate boxes, and click the search button.</center>
  </form>
  <br>
</a>

<!--------------------------------------------------------------------------
  End of Vortex script
--------------------------------------------------------------------------->

</script>

Back to the Code Example List

The Source Viewer is also a Code Example.
Click Here to see its source.
Copyright © 1992-1999 Thunderstone Software
Copyright © 2024 Thunderstone Software LLC. All rights reserved.