Changeset 6898 for cows_wps


Ignore:
Timestamp:
27/05/10 23:10:00 (9 years ago)
Author:
astephen
Message:

many fixes

Location:
cows_wps/trunk/cows_wps
Files:
2 added
5 edited

Legend:

Unmodified
Added
Removed
  • cows_wps/trunk/cows_wps/controllers/jobviewer.py

    r6896 r6898  
    3434    def index(self): 
    3535        status_url = str(request.params.getone("status_url")) 
    36         job_xml = urllib.urlopen(status_url).read() 
     36#        job_id = str(request.params.getone("job_id")) 
     37        getter = urllib.urlopen(status_url) 
     38        job_xml = getter.read() 
     39        getter.close() 
    3740 
    3841        job_id = re.search("<JobID>(.*)</JobID>", job_xml).groups()[0] 
    3942 
     43        job_as_table = self._xmlToTable(job_xml) 
    4044        job_xml_encoded = self._htmlifyXML(job_xml) 
    41         job_as_table = self._xmlToTable(job_xml) 
    42         job_as_plots = "THERE ARE NOT PLOTS FOUND IN THIS OUTPUT." 
     45        job_as_plots = "There are no plots available in the outputs of this job." 
    4346 
    44         resp = """<div id="view_options" style="background: #dddddd; border:5px outset red; padding: 5px;"> 
    45                 <a href="javascript:switchViewTo('xml_view');">XML</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
    46                 <a href="javascript:switchViewTo('table_view');">Table</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
    47                 <a href="javascript:switchViewTo('plots_view');">Plots</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
     47        resp = """<div id="view_options" style="background: #EEF4FF; border: 2px outset blue; padding: 5px;"> 
     48                <a href="javascript:switchViewTo('table_view');">View as table</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
     49                <a href="javascript:switchViewTo('xml_view');">View as XML</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
     50                <a href="javascript:switchViewTo('plots_view');">View Plots (if available)</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
    4851</div> 
    49 <div id="view_container" style="background: white; border:5px outset red; padding: 5px;"> 
     52<div id="view_container" style="background: white; border: 2px outset blue; padding: 5px;"> 
    5053        <div id="view_contents"> 
     54                <div id="table_view" style="visibility: visible; height: auto;">%s</div> 
    5155                <div id="xml_view" style="visibility: hidden; height: 0px;">%s</div> 
    52                 <div id="table_view" style="visibility: hidden; height: 0px;">%s</div> 
    5356                <div id="plots_view" style="visibility: hidden; height: 0px;">%s</div> 
    54 </div>""" % (job_xml_encoded, job_as_table, job_as_plots) 
     57</div>""" % (job_as_table, job_xml_encoded, job_as_plots) 
    5558 
    5659        renderer = UIPageRenderer() 
     
    7174        items = ["JobID", "JobCompletionTimeDate", "JobDuration", "JobVolume", "RequestDescription", 
    7275                 "RequestType"] 
     76        mapped_names = ["Job ID", "Completion Time", "Job Duration", "Output Size (Bytes)",  
     77                        "Request Description", "Request Type"] 
    7378 
    74         resp = "<p><b>Details of job...</b></p>" 
     79        resp = "<h2>DETAILS</h2>" 
    7580 
    76         for i in items: 
    77             x = job_details.find("{http://www.opengeospatial.net/wps}" + i).text 
    78             resp += "<b>%s</b> = %s<br>" % (i, x.strip()) 
     81        for (i, item) in enumerate(items): 
     82            x = job_details.find("{http://www.opengeospatial.net/wps}" + item).text 
     83            resp += "<b>%s</b> = %s<br>" % (mapped_names[i], x.strip()) 
    7984 
    80         resp += "<h2>OUTPUTS</h2>" 
     85        file_items = ["FileSize"] 
     86        mapped_file_items = ["File Size (Bytes)"] 
     87 
     88        resp += "<h2>OUTPUTS</h2>The following file outputs are available from your job.<br>" 
    8189        for fnode in file_set_list: 
     90 
    8291            furl = fnode.find("{http://www.opengeospatial.net/wps}FileURL").text 
    83             resp += "%s = %s</br>" % ("DOWNLOAD", furl) 
     92            fname = furl.split("/")[-1] 
     93            len_fname = len(fname) 
     94 
     95            p = 70 
     96            padding = p - len_fname 
     97            if padding < 0: padding = 0 
     98 
     99#            fname = fname[:p] + (padding * "&nbsp") 
     100            resp += ('<br><kbd>%s [<a href="%s">Download</a>]</kbd>' + (padding * "&nbsp;")) % (fname, furl) 
     101#            resp += '<br><span style="width: 500px;">%s [<a href="%s">Download</a>]</span>' % (fname, furl) 
     102 
     103            for (i, file_item) in enumerate(file_items): 
     104                x = fnode.find("{http://www.opengeospatial.net/wps}" + file_item).text 
     105                resp += '%s Bytes' % x 
    84106 
    85107        return resp 
  • cows_wps/trunk/cows_wps/controllers/submitter.py

    r6896 r6898  
    11import os 
     2import re 
    23import glob 
    34import logging 
     5import urllib 
    46 
    57from pylons import request, response, session, tmpl_context as c 
    68from pylons.controllers.util import abort, redirect_to 
     9from routes import url_for 
    710 
    811 
     
    3740        # If quick process then just forward 
    3841        if async == False: 
    39             return redirect_to(wps_request_url) 
     42            base_url = "http://" + request.url[7:].split("/")[0] 
     43            full_url = base_url + wps_request_url 
     44            getter = urllib.urlopen(full_url) 
     45            xml = getter.read() 
     46            getter.close() 
     47            status_url = re.search('statusLocation="(.+?)"', xml).groups()[0] 
     48 
     49            jobviewer_url = url_for(controller='jobviewer', status_url = status_url)  
     50            return redirect_to(jobviewer_url) 
    4051 
    4152        # Now we are only dealing with async requests 
  • cows_wps/trunk/cows_wps/process_handler/validate_arguments.py

    r6124 r6898  
    145145 
    146146    date_time_value = dateutil.parser.parse(item) 
    147     return date_time_value 
     147    return date_time_value.isoformat() 
    148148 
    149149 
  • cows_wps/trunk/cows_wps/public/style/wps_ui.css

    r6125 r6898  
    6464.section_container { 
    6565        position: relative; 
    66         float: top; 
    6766        width: 100%; 
    6867} 
     
    7271        top: 0px; 
    7372        left: 20px; 
    74         background-image: url(../images/section_header_bg.png); 
    75         width: 357px; 
     73/*      background-image: url(../images/section_header_bg.png);*/ 
     74        background-color: #000077; 
     75        color: #ffffff; 
     76        min-width: 400px; 
    7677        height: 50px; 
    7778        z-index: 2; 
     
    9091        top: 25px; 
    9192        padding: 35px 10px 10px 10px; 
    92         background-color: #AAFFDD; 
     93        background-color: #0099FF; 
    9394        border-style: inset; 
    9495        border-color: #3333CC; 
  • cows_wps/trunk/cows_wps/templates/ui_template.html

    r6125 r6898  
    99        <script type="text/javascript" src="/js/ui/validate.js"></script> 
    1010        <script type="text/javascript" src="/js/ui/submit_utils.js"></script> 
     11        <script type="text/javascript" src="/js/ui/jobviewer_utils.js"></script> 
    1112 
    1213        <!-- A dummy init() function that does nothing, will be overloaded in bounding box required. --> 
Note: See TracChangeset for help on using the changeset viewer.