<?xml version="1.0" encoding="utf-8"?>
<!-- If you are running a bot please visit this policy page outlining rules you must respect. http://www.livejournal.com/bots/ -->
<feed xmlns="http://www.w3.org/2005/Atom" xmlns:lj="http://www.livejournal.com">
  <id>urn:lj:livejournal.com:atom1:techciaran</id>
  <title>Ciaran's Tech Journal</title>
  <subtitle>Ciaran</subtitle>
  <author>
    <name>Ciaran</name>
  </author>
  <link rel="alternate" type="text/html" href="http://techciaran.livejournal.com/"/>
  <link rel="self" type="text/xml" href="http://techciaran.livejournal.com/data/atom"/>
  <updated>2005-01-31T13:29:01Z</updated>
  <lj:journal userid="5951828" username="techciaran" type="personal"/>
  <link rel="service.feed" type="application/x.atom+xml" href="http://techciaran.livejournal.com/data/atom" title="Ciaran's Tech Journal"/>
  <link rel="hub" href="http://pubsubhubbub.appspot.com/"/>
  <entry>
    <id>urn:lj:livejournal.com:atom1:techciaran:858</id>
    <link rel="alternate" type="text/html" href="http://techciaran.livejournal.com/858.html"/>
    <link rel="self" type="text/xml" href="http://techciaran.livejournal.com/data/atom/?itemid=858"/>
    <title>Some stuff.</title>
    <published>2005-01-31T13:19:33Z</published>
    <updated>2005-01-31T13:29:01Z</updated>
    <content type="html">I've made up a simple, non-database specific &lt;a href="http://matrix.theblob.org/weblog/weblog-schema.txt"&gt;schema&lt;/a&gt; for the weblogging system. I'd be grateful if you guys could look it over and see if there's anything obvious I'm missing. :) [quick note: stuff in ((double brackets)) are comments, stuff in &amp;lt;&lt;double chevrons="chevrons"&gt;&amp;gt; are items that don't actually exist in the table they're in but they do exist elsewhere in the schema, and starred items are the primary/composite keys for the table.]&lt;br /&gt;&lt;br /&gt;Here are my thoughts on the system...&lt;br /&gt;&lt;br /&gt;&lt;a name="cutid1"&gt;&lt;/a&gt;&lt;br /&gt;The &lt;a href="http://mpt.phrasewise.com/2003/05/02#a507"&gt;original spec&lt;/a&gt; (which I'm using as the spec for this system, so I'll be referencing it quite a lot) says that "&lt;i&gt;Each entry has a title, a category string, contents, time posted (auto-generated), and one or more objects (e.g. images).&lt;/i&gt;" It's this whole objects thing that interests me.&lt;br /&gt;&lt;br /&gt;So the way I'm thinking of doing it, and the way the schema is designed around, is that rather than the traditional model of an entry having a static text box for its main thing, the entry would - as mentioned above - have the ability to have multiple 'objects'. An object in the sense I'm thinking of would include things like text, images, link lists, and so on. Object types would probably be defined by using XML to allow developers to specify what the object type should consist of, and an additional code file that the system could call when it needs to display the object. This could be distributed and packaged up in an archive format (probably just .zip or .tar.gz, but I'm open to persuasion). When placed in the correct directory on the server, there would be an option in the interface to install it. Doing so would extract the files, enter the XML into the database, and basically set everything up so it can be used.&lt;br /&gt;&lt;br /&gt;I'm still at odds as to whether or not I would be using XML for the above, and if I do, whether I store it in the database as plain XML or &lt;a href="http://www.w3.org/XML/Binary/"&gt;binary XML&lt;/a&gt;. I think the latter question in somewhat academic as developers will only ever use the plain XML - the binary XML would solely be used in the database to speed up processing times. And, of course, binary XML can be converted to plain XML easily enough so it's not going to be a major disaster if the plain XML is lost somehow.&lt;br /&gt;&lt;br /&gt;Some other notes on the schema:&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;br /&gt;&lt;li&gt;Where they appear, "name" refers to the displayed name of whatever it refers to, and "short_name" is a name suitable for use in URLs or internally.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;The "short_title" field in tbl_entries is for use in permalinks. Unfortunately this means that it could never be changed from the starting value, which would probably be a bad move. The alternative is to have a table having three fields: &lt;b&gt;internal_entry_id&lt;/b&gt;, &lt;b&gt;short_title&lt;/b&gt;, and &lt;b&gt;default&lt;/b&gt;. That way, it could keep a complete history of the various short_titles used for that entry and automatically redirect the user to the most current one if they used an old permalink. Does this sound like something I should do?&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Objects would be able to be displayed either inline or as a separate section on the entry, and this setting would be specific to the entry, not the object. (I'll explain more about what that means in a bit.) When a particular entry's object is marked as being 'inline', I envisage that the object type code for whatever objects are in use on that entry would take that fact and look to see if that particular object has something along the lines of 'object &lt;i&gt;x&lt;/i&gt; goes here'. (however that may be for each object.)&lt;br /&gt;&lt;br /&gt;Wow, that's confusing. Let me give an example. Let's say you have an entry with three objects - 1 'text' type and 2 'image' types, and the first 'image' object is marked as inline for that entry. So, here's what happens when it's asked to display that entry:&lt;br /&gt;&lt;br /&gt;&lt;ol&gt;&lt;br /&gt;&lt;li&gt;The system grabs the entry from the database, along with the references to its objects.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;The system determines which objects are &lt;b&gt;not&lt;/b&gt; marked as inline, and iterates through those objects in the order determined by the 'order' field. Let's say the text has an order of 1, and the second image has an order of 2. (The first image doesn't matter as it's marked inline, so the order is ignored.)&lt;/li&gt;&lt;br /&gt;&lt;li&gt;The system asks the first object, the 'text' object, to render itself. It passes along the fact that the two images are inline.&lt;/li&gt;&lt;br /&gt;&lt;ol&gt;&lt;br /&gt;&lt;li&gt;The 'text' object code grabs the actual text it's meant to display from the database.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;The 'text' object code then looks to see if any of the inline objects are supposed to be used here. In the 'text' object code, I envisage this to be represented by a tag such as &lt;b&gt;&amp;lt;weblog:object shortName="picture" align="right" /&amp;gt;&lt;/b&gt;.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;If the 'text' object code determines that there are inline objects, and that these objects are actually marked as inline, then it calls back to the system to return the code to render the inline objects, one at a time. Let's say that the text references only the first image.&lt;/li&gt;&lt;br /&gt;&lt;ol&gt;&lt;br /&gt;&lt;li&gt;The system asks the second object, an 'image' object, to render itself. It passes along the fact that the first image is inline.&lt;/li&gt;&lt;br /&gt;&lt;ol&gt;&lt;br /&gt;&lt;li&gt;The 'image' object code grabs the details needed to display the image, and ignores the fact that the first image is inline because this particular object type doesn't know how to handle inline objects.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;The 'image' object code returns the code needed for the system to display the image.&lt;/li&gt;&lt;br /&gt;&lt;/ol&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;The system returns the code received to the 'text' object code.&lt;/li&gt;&lt;br /&gt;&lt;/ol&gt;&lt;br /&gt;&lt;li&gt;The 'text' object code receives the code given to it by the system and replaces the XML tags it saw with the output from the appropriate object, wrapped in whatever is needed by the module. This is where the '&lt;b&gt;align="right"&lt;/b&gt;' attribute above would take effect - it means nothing except to the 'text' object code.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;The 'text' object code returns the code needed for the system to render it.&lt;/li&gt;&lt;br /&gt;&lt;/ol&gt;&amp;lt;/li&amp;gt;&lt;br /&gt;&lt;li&gt;The system asks the third object, an 'image' object, to render itself. It passes along the fact that the first image is inline.&lt;/li&gt;&lt;br /&gt;&lt;ol&gt;&lt;br /&gt;&lt;li&gt;The 'image' object code grabs the details needed to display the image, and ignores the fact that the first image is inline because this particular object type doesn't know how to handle inline objects.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;The 'image' object code returns the code needed for the system to display the image.&lt;/li&gt;&lt;br /&gt;&lt;/ol&gt;&amp;lt;/li&amp;gt;&lt;br /&gt;&lt;li&gt;The system, seeing that its job is done, displays all the code.&lt;/li&gt;&lt;br /&gt;&lt;/ol&gt;&lt;br /&gt;&lt;br /&gt;And bingo, you have an entry where the first image is inline and the second is displayed after the text. I think that's a pretty good way of doing things. The only problem I saw while doing that was that there's no provision for templates in the above. That's obviously going to be important, so maybe internally I should use some sort of native XML that would be automatically converted by the code into whatever template was being used.&amp;lt;/li&amp;gt;&lt;/ul&gt;&lt;br /&gt;&lt;br /&gt;So, yeah. Congrats if you managed to get through all this and not have your socks bored off. :D&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;I really would like feedback on this if people are willing to read it. Thanks!</content>
  </entry>
  <entry>
    <id>urn:lj:livejournal.com:atom1:techciaran:615</id>
    <link rel="alternate" type="text/html" href="http://techciaran.livejournal.com/615.html"/>
    <link rel="self" type="text/xml" href="http://techciaran.livejournal.com/data/atom/?itemid=615"/>
    <title>Reposted from ciaran_h.</title>
    <published>2005-01-30T16:25:33Z</published>
    <updated>2005-01-30T16:26:42Z</updated>
    <content type="html">Some time ago I found &lt;a href="http://mpt.phrasewise.com/2003/05/02#a507"&gt;a rather cool proposed spec for the ultimate weblogging system&lt;/a&gt;, so I put it in my &lt;a href="http://theblob.org/desklinks/"&gt;DeskLinks&lt;/a&gt; bookmarks and forgot about it. Just now, I was browsing my bookmarks and saw it again, and I'm seriously considering writing some software that'll implement these points while still being small and tight. Or at least 90% of it, or so.&lt;br /&gt;&lt;br /&gt;Yeah, there are others out there - I even have &lt;a href="http://sourceforge.net/projects/blobjournal/"&gt;my own journalling software&lt;/a&gt; (which is in use in a couple of places - &lt;a href="http://theblob.org/journal/"&gt;my old journal&lt;/a&gt;, and &lt;a href="http://dmoz.theblob.org/dmoz/journal.cgi"&gt;the ODP Weblog&lt;/a&gt;), but it only implements four or five of these points, and while the code is indeed small, it's also a little messy in terms of how it works. In my defense, though, it was initially written when I was kind of learning Perl. Since then, it's had one almost total rewrite (which improved the code readability immensely) and another rewrite - though not as major - to implement the templating system.&lt;br /&gt;&lt;br /&gt;However, I still see bad things in the code (a minor example being that I set global variables in subroutines... *wince*), and rather than do anything else with this code and try to maintain compatibility and such, it'd be easier (not to mention more fun) to make a new blog system from scratch. That way, I can also put into practice somewhat better coding practices right from the start, as well as aiming towards the goals of the spec above.&lt;br /&gt;&lt;br /&gt;So, yeah. This could be fun.</content>
  </entry>
  <entry>
    <id>urn:lj:livejournal.com:atom1:techciaran:332</id>
    <link rel="alternate" type="text/html" href="http://techciaran.livejournal.com/332.html"/>
    <link rel="self" type="text/xml" href="http://techciaran.livejournal.com/data/atom/?itemid=332"/>
    <title>Yay, it's a new journal.</title>
    <published>2005-01-30T16:13:03Z</published>
    <updated>2005-01-30T16:13:03Z</updated>
    <content type="html">This journal is so that I (&lt;span class='ljuser ljuser-name_soph' lj:user='soph' style='white-space: nowrap;'&gt;&lt;a href='http://soph.livejournal.com/profile'&gt;&lt;img src='http://l-stat.livejournal.com/img/userinfo.gif' alt='[info]' width='17' height='17' style='vertical-align: bottom; border: 0; padding-right: 1px;' /&gt;&lt;/a&gt;&lt;a href='http://soph.livejournal.com/'&gt;&lt;b&gt;soph&lt;/b&gt;&lt;/a&gt;&lt;/span&gt;) can write technical stuff without worrying about anybody dropping off to sleep. :D&lt;br /&gt;&lt;br /&gt;Also, unlike my normal journal, this one will be fully public, not friends-only. So no need to reply here if you can't see any other entries, because if you can't see any others that's 'cuz there aren't any. ;)</content>
  </entry>
</feed>
