Fog Creek Software
Discussion Board

Knowledge Base
Terry's Tips
Darren's Tips

Dynamic Article Creation?

I am very new to CD, having just downloaded it about 2 hours ago.  I am wondering if it is possible to for an application running on my system here to generate an article dynamically?  I would like to have a program that I wrote create a new article each day with a summary of all the Visual SourceSafe activities in my company.  That summary would be posted as a new article next time I published to the web server.  I paln on using the CD command-line publishing ability in the Windows scheduler to automatically pudate the web server once a day.

Is this sort of thing possible with CD?


Bennett Smith
Tuesday, September 2, 2003

Considering that the .cty file containing your site is actually just a Access MDB file (JET 4.0 engine actually) with a different extension, if you dig into the data structure in that database you should be able to do what you want.

Lasse Vågsæther Karlsen
Tuesday, September 2, 2003

Has anyone already done the "digging" necessary?  I took a quick look at the .cty file and it appears that there are three things one would need to understand in order to update the tables dynamically.

1. What is the format of the data stored in the sArticle field in the tblArticle table.  It is of type OLE Object.

2. What is the format of the oleFile field stored in the tblFiles table?

3. What is the algorithm used to generate the nCRC value in the tblFiles table?

I know it is possible to hack into these things myself and I could then create dynamic article content in CD.  I really would prefer if there were a set of APIs or an OLE automation object model that allowed me to access the articles.  That would be very helpful and might actually already exist within the code in CD.

Does anyone know if this exists?

Bennett Smith
Tuesday, September 2, 2003

The OLE fields in the CityDesk database simply contain Unicode text. They use the OLE format because it is unlimited length.

There is no automation interface.

For your specific application, why do you need to generate a CityDesk article? Write an HTML page using any tool you want, and put in on the web server wherever you want, and link to it from CityDesk...

Joel Spolsky
Tuesday, September 2, 2003

Thanks for the info on the OLE fields.  I was kind of suspecting that you might be just using them as a BLOB. 

Any tips on how to generate the CRC that appears in some fields?  What happens if I just leave the CRC set to zero?  Will it confuse the program or will it just happily assume the file has changed during the next publish cycle and generate a new CRC?

Also, that's a good point about just generating a separate page and placing it on the same site.  This is basically what I'm doing right now.  My hope was to be able to leverage the time ordering of articles that is possible with CD since that would make it very easy for people to look back through previous change sets.  Also, by publishing an article in this way it would be easy to have the same look to all pages without much work on my part.

The other area where dynamic publishing of articles might be helpful is when I write how-to articles.  These articles are created using XDocBook and I could create a stylesheet that transforms the output into an article for CD to publish the on-line version of the article.  I can still use Framemaker for XSL-FO to produce the PDF version of the article but could use CD for the on-line version.  Now that would be very cool indeed!

Bennett Smith
Wednesday, September 3, 2003

It's a CRC32. There's sample code in Visual Basic here:

Joel Spolsky
Wednesday, September 3, 2003

*  Recent Topics

*  Fog Creek Home