Changeset 4999 for MILK


Ignore:
Timestamp:
18/02/09 17:33:23 (10 years ago)
Author:
cbyrom
Message:

Add trackback info RDF element to displayed atom docs - implementing
usage of new method, getTrackbackInfo() on Trackback controller +
fix a few issues with the genshi templates.

Location:
MILK/trunk/milk_server/milk_server
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • MILK/trunk/milk_server/milk_server/controllers/browse/retrieve.py

    r4998 r4999  
    1111from milk_server.lib import Utilities 
    1212from milk_server.lib.ndgInterface import ndgInterface  
     13from milk_server.controllers.trackback.trackback import TrackbackController 
    1314from ndg.common.src.lib.ETxmlView import et2html 
    1415from ndg.common.src.models import stubB, DIF, ndgObject 
     
    176177                           %(self.format, viewFormat)) 
    177178 
     179            # get name to pass to trackback rdf - make more general, if possible 
     180            # once the doc has been retrieved 
    178181            name=str(self.uri) 
    179182            if self.format=='xml': 
     
    212215                session['currentAtom'] = c.atom 
    213216                session.save() 
     217                name = c.atom.title 
    214218 
    215219            elif viewFormat == ndgObject.MOLES_DOC_TYPE: 
     
    239243                c.xml = et2html(ET.fromstring(x)) 
    240244                renderTemplate = 'content' 
    241              
     245 
     246            # set up trackback rdf tag 
     247            c.tbinfo = TrackbackController().getTrackBackInfo(self.uri, name) 
     248 
    242249            needed=0 
    243250            if 'lastViewed' not in session:  
  • MILK/trunk/milk_server/milk_server/controllers/trackback/trackback.py

    r4992 r4999  
    4040        whitelisting yet  
    4141        ''' 
    42          
    4342        err=0 
    4443         
     
    8382        return render('trackback',format='xml') 
    8483     
    85      
    86              
    8784 
    88     def __mytb(self,name): 
    89         ''' Get the trackback info for this page  
    90         (can't do it in Kid because it doesn't do substitutions in comments) ''' 
     85    def getTrackBackInfo(self, uri, name): 
     86        '''  
     87        Get the trackback info for the specified uri and name  
     88        @param uri: ndgURI representing doc 
     89        @param name: title of doc 
     90        @return rdf element representing trackback info 
     91        ''' 
    9192        s='''<!-- 
    9293        <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" 
     
    99100            trackback:ping="%s" /> 
    100101        </rdf:RDF> 
    101         -->'''%(self.uri,g.server+h.url_for(),name,g.server+h.url_for(controller="trackback")) 
     102        -->'''%(uri,g.server+h.url_for(),name,g.server+h.url_for(controller="trackback/trackback")) 
    102103        return s 
    103104 
  • MILK/trunk/milk_server/milk_server/templates/atom_editor/atom_editor.html

    r4984 r4999  
    4545                        <script type="text/javascript" src="$g.server/js/queueDeployments.js"/> 
    4646                </span> 
    47             <script py:if="g.correctionPosted" type="text/javascript"> 
     47            <script py:if="g.__dict__.has_key('correctionPosted')" type="text/javascript"> 
    4848                        window.onload = alert('$g.correctionPosted'); 
    4949                        <?python del g.correctionPosted ?> 
  • MILK/trunk/milk_server/milk_server/templates/atom_editor/atom_functions.html

    r4845 r4999  
    219219                            </span> 
    220220                            <tr> 
    221                         <td class="cellhead">Publication State:<span py:if="c.editLink" py:replace="helpIcon('pubState_help', 'tr')"/> 
     221                        <td class="cellhead">Publication State:<span py:if="editLink" py:replace="helpIcon('pubState_help', 'tr')"/> 
    222222                        </td> 
    223223                        <td py:if="editLink" class="column"> 
  • MILK/trunk/milk_server/milk_server/templates/atom_editor/layout.html

    r4837 r4999  
    2626    <div id="entirepage"> 
    2727      <div py:replace="header()"/> 
     28      ${Markup(c.tbinfo)} 
    2829 
    2930      <div id="logo"><img src="$g.LeftLogo" alt="$g.LeftAlt" /></div> 
  • MILK/trunk/milk_server/milk_server/templates/utils.html

    r4728 r4999  
    108108            <a href="javascript:;" title="Toggle help" onclick="toggleDiv(1,'$value','shown','hidden','$elementType'); return false;"> 
    109109            <img src="$g.helpIcon" alt="Toggle help" class="helpicon"/></a> 
    110        
    111110        </span> 
    112111    </span> 
Note: See TracChangeset for help on using the changeset viewer.