Commits

Anonymous committed 5e2e8d4

Changes to templates for data moves. Minor changes to timeline and data endpoint for headers

Comments (0)

Files changed (6)

openletters/controllers/data.py

     '''
     def endpoint (self, author = '', correspondent = ''):
         
+            
         if author == "rdf":
-            response.headers['Content-Type'] = 'text/rdf+xml; charset=utf-8'
+            response.headers['Content-Type'] = 'application/rdf+xml; charset=utf-8'
             rdf = rdf_transform()
             return rdf.create_rdf_end()
         
                 return xml.endpoint_xml("simile")
             else:
                 return xml.endpoint_xml()
+        else:
+            return render("endpoint/index.html")
 
     def book (self):
         #response.headers['Content-Type'] = 'application/json'

openletters/controllers/timeline.py

 
 class TimelineController(BaseController):
     def index(self):
+        c.page_title = "Simile timeline of Charles Dickens's letters"
         return render('timeline/index.html')
 

openletters/templates/endpoint/index.html

+<html
+  xmlns:py="http://genshi.edgewall.org/"
+  xmlns:xi="http://www.w3.org/2001/XInclude"
+  py:strip=""
+  >
+
+  <py:def function="page_title">c.page_title</py:def>
+
+  <div py:def="content">
+    <h4>Endpoint</h4>
+
+    <p>
+    The endpoint that was here has now been moved with the latest version of the Open Correspondence site.<br /> 
+    The rdf can now be found at <a href="./endpoint/rdf">endpoint/rdf</a><br />
+    The json can now be found at <a href="./endpoint/json">endpoint/json</a><br />
+    The xml can now be found at <a href="./endpoint/xml">endpoint/xml</a><br />
+    </p>
+  </div>
+
+  <xi:include href="../layout.html" />
+</html>

openletters/templates/layout.html

       <li><a href="${url(controller='home', action='index')}">Home</a></li>
       <li><a href="${url('gallery')}">Gallery</a></li>
       <li><a href="${url(controller='letters', action='index')}">Letters</a></li>
-      <li><a href="${url(controller='data', action='endpoint')}">RDF Export</a></li>
+      <li><a href="${url(controller='data', action='endpoint')}">Endpoints</a></li>
       <!-- <li><a href="${url(controller='timeline', action='index')}">Timeline</a></li> -->
       <li><a href="${url('schema')}">Schema</a></li>
     </ul>

openletters/templates/timeline/index.html

   py:strip=""
   >
 
-  <py:def function="page_title">Timeline - Home</py:def>
+  <py:def function="page_title">c.page_title</py:def>
 
   <py:def function="optional_head">
     <script src="http://static.simile.mit.edu/timeline/api-2.3.0/timeline-api.js" type="text/javascript"></script>

openletters/transform/transform_xml.py

         return doc
     
     '''
-        Function to create xml for Simile timeline
+        Function to create xml for Simile timeline and xml endpoint
     '''
     def endpoint_xml (self, type = ''):
         
-        root = ET.Element("data", {'date-time-format': 'ISO 8601'})
+        if type =="simile":
+            root = ET.Element("data", {'date-time-format': 'ISO 8601'})
+        else:
+            root = ET.Element("data")
         
         letter = {}  
         letter = dbase.get_endpoint_rdf()