Ignore:
Timestamp:
2010-12-07T17:05:38+13:00 (13 years ago)
Author:
sjb48
Message:

FormatAction constructs message containing format string that is sent to the collection. The message knows the service, and if it is the browse service, then it also knows the classifer list number.

Location:
main/trunk/greenstone3/web/interfaces/oran
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone3/web/interfaces/oran/interfaceConfig.xml

    r23360 r23405  
    2222    <action name='s' class='SystemAction' xslt='system.xsl'/>
    2323
    24     <action name='f' class='FormatAction' xslt='formatString.xsl'/>
     24    <action name='f' class='FormatAction'/> <!-- xslt='formatString.xsl'/> -->
    2525
    2626    <action name='g' class='GeneralAction'>
  • main/trunk/greenstone3/web/interfaces/oran/js/gui_div.js

    r23360 r23405  
    1111    //console.log(formatStatement);
    1212
     13    // find collection name
     14
     15    var myurl = document.URL;
     16    console.log(myurl);
     17    var first = myurl.indexOf("&c")+3;
     18    var last = myurl.indexOf("&", first);
     19   
     20    var collection_name = myurl.substring(first,last); ///&c=(.*)&/.exec(myurl);
     21    console.log(collection_name);
     22
     23    first = myurl.indexOf("&s")+3;
     24    last = myurl.indexOf("&", first);
     25
     26    var service_name = myurl.substring(first,last);
     27    console.log(service_name);
     28
     29    var classifier_name = null;
     30
     31    if(service_name == "ClassifierBrowse")
     32    {
     33        first = myurl.indexOf("&cl")+4;
     34        last = myurl.indexOf("&", first);
     35
     36        classifier_name = myurl.substring(first,last);
     37        console.log(classifier_name);
     38    }
    1339
    1440    //var myurl = 'http://localhost:8080/greenstone3/format?a=s&sa=s&t='+formatStatement;
     
    1743
    1844    // How do I find out my collection name?
    19 
    20     $.post("http://localhost:8080/greenstone3/format?a=f", {data: formatStatement}, function(data) {
     45    var post_url = "http://localhost:8080/greenstone3/format?a=f&c=" + collection_name +"&s=" + service_name;
     46
     47    if(classifier_name != null)
     48        post_url = post_url + "&cl=" + classifier_name;
     49
     50    $.post(post_url, {data: formatStatement}, function(data) {
    2151        //$('.result').innerHTML = data; //html(data);
    2252        console.log("Success, we have received data");
  • main/trunk/greenstone3/web/interfaces/oran/transform/formatString.xsl

    r23360 r23405  
    1 <?xml version="1.0" encoding="ISO-8859-1"?>
     1<?xml version="1.0" encoding="UTF-8"?>
    22<xsl:stylesheet version="1.0"
    33  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    4   xmlns:java="http://xml.apache.org/xslt/java"
    5   extension-element-prefixes="java">
     4  xmlns:xslt="http://www.w3.org/1999/XSL/Transform"
     5  xmlns:gslib="http://www.greenstone.org/XSL/Library"
     6  xmlns:gsf="http://www.greenstone.org/greenstone3/schema/ConfigFormat"
     7  xmlns:util="http://org.greenstone.gsdl3.util.XSLTUtil"
     8  exclude-result-prefixes="util gslib gsf xslt">
     9
     10  <!-- extension-element-prefixes="java"> -->
    611
    712  <xsl:strip-space elements="*"/>
     
    241246  <!-- Main page generation -->
    242247
    243   <xsl:template match="page">
    244     <html>
     248  <xsl:template match="/">
     249    <!-- <html>
    245250      <head>
    246251    <title>
     
    249254      </head>
    250255      <body>
    251         <h2> This should be the format string (unmodified and html version) </h2>
     256        <h2> This should be the format string (unmodified and html version) </h2> -->
    252257        <!-- <xsl:value-of select="/page/pageResponse" disable-output-escaping="yes"/> -->
    253258        <xsl:call-template name="xml">
    254             <xsl:with-param name="fmt" select="/page/pageResponse"/>
     259            <xsl:with-param name="fmt" select="."/>
    255260        </xsl:call-template><xsl:text> </xsl:text>
    256261        <!-- <xsl:apply-templates select="/page/pageResponse" mode="xml"/> -->
    257       </body>
    258     </html>
    259   </xsl:template>
    260  
     262      <!-- </body>
     263    </html> -->
     264  </xsl:template>
     265 
     266  <!--
    261267  <xsl:template name="pageTitle">
    262268    <xsl:value-of select="java:org.greenstone.gsdl3.util.XSLTUtil.getInterfaceText($interface_name, /page/@lang, 'gsdl')"/>
    263   </xsl:template>
     269  </xsl:template> -->
    264270 
    265271</xsl:stylesheet>
Note: See TracChangeset for help on using the changeset viewer.