Fossil User Forum

Seeking Guidance on Custom Pages (extroot/CGI + XHTML/XForms)
Login

Seeking Guidance on Custom Pages (extroot/CGI + XHTML/XForms)

Seeking Guidance on Custom Pages (extroot/CGI + XHTML/XForms)

(1.3) By midijohnny on 2025-03-11 20:29:35 edited from 1.2 [link] [source]

Am I thinking correctly here - is it recommended and idiomatic to call 'fossil' from extroot CGI pages for customization purposes?

That is: run 'fossil server' to serve-up the front-end and then interact with the repository using the 'fossil' executable from within CGI?

BACKGROUND:

I am looking at customizing the "New Ticket" and related pages: ideally I want to use xforms for this, using xsltforms.
In order to do this, I'll need to use xhtml , as opposed to html5 , and add in a reference to an xslt at the top of my document.
Something like this:

<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet href="xsltforms-1.7/xsltforms.xsl" type="text/xsl"?>
<?xsltforms-options debug="no"?>
<html	
		lang="en"
		xmlns="http://www.w3.org/1999/xhtml" 
		xmlns:ht="http://www.w3.org/1999/xhtml"
		xmlns:xs="http://www.w3.org/2001/XMLSchema"
		xmlns:xf="http://www.w3.org/2002/xforms"   
		xmlns:ev="http://www.w3.org/2001/xml-events"
[...]

I should be ok to place the required xslt in the extroot directory for my fossil server as well as any default XML needed to pre-populate the form etc.

But since the standard extension point for the "New Ticket" page is a HTML-fragment, I don't think I will be able to use this directly. (right?)
If so: that's fine - I should be able build it as an 'external' page - also using the CGI/static extension mechanism.

Here's a running example of an XForms, and xforms-hands-on tutorial for additional context.
(Basically its client-side MVC, using XML to define behaviour declaratively, rather than having to use javascript directly).

(2.1) By Stephan Beal (stephan) on 2025-03-15 15:52:38 edited from 2.0 in reply to 1.3 [source]

Am I thinking correctly here - is it recommended and idiomatic to call 'fossil' from extroot CGI pages for customization purposes? That is: run 'fossil server' to serve-up the front-end and then interact with the repository using the 'fossil' executable from within CGI?

i don't know that it's common enough to call it "idiomatic," but otherwise yes. More commonly, in my experience, the CGIs are running behind fossil primarily (A) for deployment convenience, (B) to wrap them in the site's layout, reducing the amount of effort needed to implement the CGIs, and/or (C) to use the environment vars provided by extroot to ensure that the visiting user is one with certain permissions for the repo.

For example, the sqlite project uses a shared checklist to track the many steps involved in preparing a new release. That checklist is run behind extroot and can only be modified by a developer. The checklist app is actually independent of fossil, but (in this case) uses the extroot environment to determine whether edit access is permitted.

But since the standard extension point for the "New Ticket" page is a HTML-fragment, I don't think I will be able to use this directly. (right?)

It sounds like the answer is no, but we may hear contradicting views on that from other users.

If so: that's fine - I should be able build it as an 'external' page - also using the CGI/static extension mechanism.

Hypothetically, yes.

(3) By midijohnny on 2025-03-15 15:34:14 in reply to 2.0 [link] [source]

Thanks for this - I'll feedback to the forum should I manage to get something useful / demonstrative working.