space Baylys
Just practicing to pass the Turing test.
space
space
space
space
Developer for Hire!
space
addedValues Plugin
space

Home

What's new

Bayly.Root

Cornershop Plugin

Career

edutools Root

Enhancements

Interests

linguist Plugin

Manila

Patches

space

mainresponder

manilaData

manilamacros

manilaSuite

space
space

admin

backups

discuss

gems

getCanonicalSiteName

hierarchyPage

hosting

html

mail

member

members

news

plugins

prefs

referer

renderNewsPage

rpcHandlers

rpcUtils

search

sendMail

siteStructure

staticRendering

space
space

convertFilename

convertUrl

discussCallback

displayRenderButton

drawNavigatorWithFiltering

filters

getRelativePath

getSuffix

patchLocalURLs

renderHierarchyPage

renderHomePage

renderPage

space

storyList

space

system

Patches by Group

Papers

Sales

Sign My Guestbook

User(land) Relations.

Contact Address

Search Baylys

urlchains

space
Join Now
Login
space space space

manilaSuite.staticRendering.renderPage

Static rendering a number of pages can be extremely CPU intensive and can severely impact a servers responsiveness. This patch yields after each page is rendered for a time equal to the time taken to render the page.

Amended Script

on renderPage (relativePath, adrManilaSite, adrStaticSite=nil)
  «Render one page to a static server. relativePath is the path to the page relative to the site, as in /2000/03/10 or /resources/linux/programming. Returns a copy of the page table.
 unaltered lines omitted
  «Changes:
 unaltered lines omitted
 
  relativePath = string.popLeading (relativePath, '/') //the leading / is optional
 
  local (pt) //page table
  new (tableType, @pt)
 
  on setUpPageTable (adrTable, relPath)
 unaltered lines omitted
 
  setUpPageTable (@pt, relativePath)
 
  local (flHomePage = false)
  local (flCalendarPage = false)
  local (flSiteStructurePage = false)
 
  local (adrsubtable = log.addToGuestDatabase ("StaticRender", flHourlyRoll:true)) «06/08/07, 14:03:19 by DAB
  bundle «build log entry
  adrsubtable^.site = nameOf(adrManilaSite^) «06/08/07, 14:08:48 by DAB
  adrsubtable^.relativePath = relativePath «06/08/07, 14:08:53 by DAB
  adrsubtable^.ticks = clock.ticks() «06/08/07, 14:06:35 by DAB
 
  try «placed in a try 8/7/06, 2:13:58 PM by DAB
  bundle //handle rendering a home page
  if relativePath == "" or relativePath == "default" //it's the home page
  manilaSuite.staticRendering.renderHomePage ()
  flHomePage = true
  bundle //also render the most recent calendar page
  «try
  local (adrDay = mainResponder.calendar.getMostRecentAddress (adrManilaSite))
  local (year, month, day)
  day = nameOf (adrDay^)
  local (adrMonth = parentOf (adrDay^))
  month = nameOf (adrMonth^)
  local (adrYear = parentOf (adrMonth^))
  year = nameOf (adrYear^)
  local (archiveRelativePath = year + "/" + month + "/" + day)
  local (oldPta = @pt)
  local (t)
  new (tableType, @t)
  setUpPageTable (@t, archiveRelativePath)
  manilaSuite.staticRendering.renderCalendarPage ()
  html.setPageTableAddress (oldPta)
  bundle //also render the RSS file
  if manilaSuite.getNewsSitePref ("flSyndicate", adrManilaSite, true)
  local (oldPta = @pt)
  local (t)
  new (tableType, @t)
  setUpPageTable (@t, "xml/rss.xml")
  manilaSuite.staticRendering.renderBuiltinPage ("xml/rss.xml", adrManilaSite)
  html.setPageTableAddress (oldPta)
 
  bundle //handle rendering a calendar page
  if not flHomePage
  local (firstPart = string.nthField (relativePath, '/', 1))
  try
  number (firstPart)
  flCalendarPage = true
  if flCalendarPage
  manilaSuite.staticRendering.renderCalendarPage ()
 
  bundle //handle rendering a site structure page
  if not flHomePage and not flCalendarPage
  manilaSuite.staticRendering.renderHierarchyPage ()
 
  bundle //delete the page table address
  try {html.deletePageTableAddress ()}
 
  adrsubtable^.normalTermination = true «06/08/07, 14:08:36 by DAB
  adrsubtable^.ticks = clock.ticks() - adrsubtable^.ticks «06/08/07, 14:06:35 by DAB
 
  bundle //end the current rendering session -- if this is a single page session
  manilaSuite.staticRendering.endSinglePageSession (adrManilaSite)
  else
  local (err = tryError)
  adrsubtable^.ticks = clock.ticks() - adrsubtable^.ticks «06/08/07, 14:06:35 by DAB
  if err == "!" and pt.code == "302" //accesscontrol checks blew us away
 unaltered lines omitted
  else
  adrsubtable^.error =err «06/08/07, 14:08:40 by DAB
  adrsubtable^.pageTable = pt «06/08/07, 14:08:40 by DAB
  html.deletePageTableAddress ()
  try //end the current rendering session -- if this is a single page session
 unaltered lines omitted
  if err != "!"
 unaltered lines omitted
 
  return (pt) //return a copy of the page table
bundle //test code
  manilaSuite.staticRendering.renderPage ("", @jaketest2ManilaWebsite)

Relative to Frontier version 9.7b10