Once upon a time, a minor god decided to use the term "stylesheet".
Then God (The True and Only God) sayd : "Use XSL". Later God decided: "Use XSLT". And now He says "Use SiteXslt". In God I trust, so I obey.
This commit is contained in:
parent
c2b8dd795a
commit
2ddd370e5f
|
@ -1,6 +1,6 @@
|
||||||
<?xml version="1.0"?>
|
<?xml version="1.0"?>
|
||||||
<configuration xmlns="http://www.entrouvert.org/namespaces/expression/0.0">
|
<configuration xmlns="http://www.entrouvert.org/namespaces/expression/0.0">
|
||||||
<xsltFilePath>vhosts/system/xslt/site.xsl</xsltFilePath>
|
<siteXsltFilePath>vhosts/system/xslt/site.xsl</siteXsltFilePath>
|
||||||
<logFilePath>/var/log/expression.log</logFilePath>
|
<logFilePath>/var/log/expression.log</logFilePath>
|
||||||
<pidFilePath>expression.pid</pidFilePath>
|
<pidFilePath>expression.pid</pidFilePath>
|
||||||
<adminEmail>webmaster@localhost</adminEmail>
|
<adminEmail>webmaster@localhost</adminEmail>
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<?xml version="1.0"?>
|
<?xml version="1.0"?>
|
||||||
<abraraconfig schema="config.xsd">
|
<abraraconfig schema="config.xsd">
|
||||||
<xsltFilePath>vhosts/system/xslt/site.xsl</xsltFilePath>
|
<siteXsltFilePath>vhosts/system/xslt/site.xsl</siteXsltFilePath>
|
||||||
<serverAdmin>webmaster@localhost</serverAdmin>
|
<serverAdmin>webmaster@localhost</serverAdmin>
|
||||||
|
|
||||||
<virtualHost>
|
<virtualHost>
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<?xml version="1.0"?>
|
<?xml version="1.0"?>
|
||||||
<configuration xmlns="http://www.entrouvert.org/namespaces/expression/0.0">
|
<configuration xmlns="http://www.entrouvert.org/namespaces/expression/0.0">
|
||||||
<xsltFilePath>vhosts/system/xslt/site.xsl</xsltFilePath>
|
<siteXsltFilePath>vhosts/system/xslt/site.xsl</siteXsltFilePath>
|
||||||
<logFilePath>/var/log/expression.log</logFilePath>
|
<logFilePath>/var/log/expression.log</logFilePath>
|
||||||
<pidFilePath>expression.pid</pidFilePath>
|
<pidFilePath>expression.pid</pidFilePath>
|
||||||
<adminEmail>webmaster@localhost</adminEmail>
|
<adminEmail>webmaster@localhost</adminEmail>
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<?xml version="1.0"?>
|
<?xml version="1.0"?>
|
||||||
<configuration xmlns="http://www.entrouvert.org/namespaces/expression/0.0">
|
<configuration xmlns="http://www.entrouvert.org/namespaces/expression/0.0">
|
||||||
<xsltFilePath>vhosts/system/xslt/site.xsl</xsltFilePath>
|
<siteXsltFilePath>vhosts/system/xslt/site.xsl</siteXsltFilePath>
|
||||||
<logFilePath>/var/log/expression.log</logFilePath>
|
<logFilePath>/var/log/expression.log</logFilePath>
|
||||||
<pidFilePath>expression.pid</pidFilePath>
|
<pidFilePath>expression.pid</pidFilePath>
|
||||||
<adminEmail>webmaster@localhost</adminEmail>
|
<adminEmail>webmaster@localhost</adminEmail>
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<?xml version="1.0"?>
|
<?xml version="1.0"?>
|
||||||
<configuration xmlns="http://www.entrouvert.org/namespaces/expression/0.0">
|
<configuration xmlns="http://www.entrouvert.org/namespaces/expression/0.0">
|
||||||
<xsltFilePath>vhosts/system/xslt/site.xsl</xsltFilePath>
|
<siteXsltFilePath>vhosts/system/xslt/site.xsl</siteXsltFilePath>
|
||||||
<logFilePath>/var/log/expression.log</logFilePath>
|
<logFilePath>/var/log/expression.log</logFilePath>
|
||||||
<pidFilePath>expression.pid</pidFilePath>
|
<pidFilePath>expression.pid</pidFilePath>
|
||||||
<adminEmail>webmaster@localhost</adminEmail>
|
<adminEmail>webmaster@localhost</adminEmail>
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<?xml version="1.0"?>
|
<?xml version="1.0"?>
|
||||||
<configuration xmlns="http://www.entrouvert.org/namespaces/expression/0.0">
|
<configuration xmlns="http://www.entrouvert.org/namespaces/expression/0.0">
|
||||||
<xsltFilePath>vhosts/system/xslt/site.xsl</xsltFilePath>
|
<siteXsltFilePath>vhosts/system/xslt/site.xsl</siteXsltFilePath>
|
||||||
<logFilePath>/var/log/expression.log</logFilePath>
|
<logFilePath>/var/log/expression.log</logFilePath>
|
||||||
<pidFilePath>expression.pid</pidFilePath>
|
<pidFilePath>expression.pid</pidFilePath>
|
||||||
<adminEmail>webmaster@localhost</adminEmail>
|
<adminEmail>webmaster@localhost</adminEmail>
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<?xml version="1.0"?>
|
<?xml version="1.0"?>
|
||||||
<configuration xmlns="http://www.entrouvert.org/namespaces/expression/0.0">
|
<configuration xmlns="http://www.entrouvert.org/namespaces/expression/0.0">
|
||||||
<xsltFilePath>vhosts/system/xslt/site.xsl</xsltFilePath>
|
<siteXsltFilePath>vhosts/system/xslt/site.xsl</siteXsltFilePath>
|
||||||
<logFilePath>/var/log/expression.log</logFilePath>
|
<logFilePath>/var/log/expression.log</logFilePath>
|
||||||
<pidFilePath>expression.pid</pidFilePath>
|
<pidFilePath>expression.pid</pidFilePath>
|
||||||
<adminEmail>webmaster@localhost</adminEmail>
|
<adminEmail>webmaster@localhost</adminEmail>
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<?xml version="1.0"?>
|
<?xml version="1.0"?>
|
||||||
<configuration xmlns="http://www.entrouvert.org/namespaces/expression/0.0">
|
<configuration xmlns="http://www.entrouvert.org/namespaces/expression/0.0">
|
||||||
<xsltFilePath>vhosts/system/xslt/site.xsl</xsltFilePath>
|
<siteXsltFilePath>vhosts/system/xslt/site.xsl</siteXsltFilePath>
|
||||||
<logFilePath>/var/log/expression.log</logFilePath>
|
<logFilePath>/var/log/expression.log</logFilePath>
|
||||||
<pidFilePath>expression.pid</pidFilePath>
|
<pidFilePath>expression.pid</pidFilePath>
|
||||||
<adminEmail>webmaster@localhost</adminEmail>
|
<adminEmail>webmaster@localhost</adminEmail>
|
||||||
|
|
|
@ -84,7 +84,7 @@ class DataHolder(stations.AbstractStation):
|
||||||
_data = None
|
_data = None
|
||||||
_dataHolderInited = False
|
_dataHolderInited = False
|
||||||
_metadata = None
|
_metadata = None
|
||||||
_stylesheet = None
|
_xslt = None
|
||||||
defaultFileNameExtension = None
|
defaultFileNameExtension = None
|
||||||
mimeType = None
|
mimeType = None
|
||||||
mimeTypes = None
|
mimeTypes = None
|
||||||
|
@ -460,23 +460,22 @@ class DataHolder(stations.AbstractStation):
|
||||||
def getSimpleLabel(self):
|
def getSimpleLabel(self):
|
||||||
return _("Untitled Object #%s") % self.localId
|
return _("Untitled Object #%s") % self.localId
|
||||||
|
|
||||||
def getXslt(self):
|
def getSiteXslt(self):
|
||||||
if self._stylesheet is None:
|
if self._xslt is None:
|
||||||
xslAbsolutePath = self.getConfigAbsolutePath("yep:xsltFilePath", default = None)
|
xslAbsolutePath = self.getConfigAbsolutePath("yep:siteXsltFilePath", default = None)
|
||||||
if xslAbsolutePath is None:
|
if xslAbsolutePath is None:
|
||||||
self._stylesheet == "none"
|
self._xslt == "none"
|
||||||
else:
|
else:
|
||||||
stylesheetHolder = DataHolder(
|
xsltHolder = DataHolder(
|
||||||
pathFragment = xslAbsolutePath, previous = self, mimeType = "text/xml",
|
pathFragment = xslAbsolutePath, previous = self, mimeType = "text/xml",
|
||||||
isRootElder = True,
|
isRootElder = True,
|
||||||
containedFileSystem = filesystems.PartialFileSystem(xslAbsolutePath))
|
containedFileSystem = filesystems.PartialFileSystem(xslAbsolutePath))
|
||||||
import stylesheets
|
import stylesheets
|
||||||
stylesheetPrototype = stylesheetHolder.getRootElement()
|
xsltPrototype = xsltHolder.getRootElement()
|
||||||
self._stylesheet = stylesheets.StylesheetContext(
|
self._xslt = stylesheets.StylesheetContext(xsltPrototype, self, previous = self)
|
||||||
stylesheetPrototype, self, previous = self)
|
if self._xslt == "none":
|
||||||
if self._stylesheet == "none":
|
|
||||||
return None
|
return None
|
||||||
return self._stylesheet
|
return self._xslt
|
||||||
|
|
||||||
def getWebDavContentLength(self):
|
def getWebDavContentLength(self):
|
||||||
if self._data is None:
|
if self._data is None:
|
||||||
|
|
|
@ -296,9 +296,8 @@ class HttpRequestHandlerMixin:
|
||||||
errorDescription = errorElement.getDescription()
|
errorDescription = errorElement.getDescription()
|
||||||
if errorDescription:
|
if errorDescription:
|
||||||
xmlDocument = errorDescription.generateXmlDocument()
|
xmlDocument = errorDescription.generateXmlDocument()
|
||||||
stylesheet = station.getDataHolder().getXslt()
|
xslt = station.getDataHolder().getSiteXslt()
|
||||||
mimeType, styledData = station.generateXmlDocumentStyledData(
|
mimeType, styledData = station.generateXmlDocumentStyledData(xmlDocument, xslt)
|
||||||
xmlDocument, stylesheet)
|
|
||||||
if mimeType == "text/html":
|
if mimeType == "text/html":
|
||||||
data = styledData
|
data = styledData
|
||||||
return self.send_error(403, message, data)
|
return self.send_error(403, message, data)
|
||||||
|
@ -316,9 +315,8 @@ class HttpRequestHandlerMixin:
|
||||||
errorDescription = errorElement.getDescription()
|
errorDescription = errorElement.getDescription()
|
||||||
if errorDescription:
|
if errorDescription:
|
||||||
xmlDocument = errorDescription.generateXmlDocument()
|
xmlDocument = errorDescription.generateXmlDocument()
|
||||||
stylesheet = station.getDataHolder().getXslt()
|
xslt = station.getDataHolder().getSiteXslt()
|
||||||
mimeType, styledData = station.generateXmlDocumentStyledData(
|
mimeType, styledData = station.generateXmlDocumentStyledData(xmlDocument, xslt)
|
||||||
xmlDocument, stylesheet)
|
|
||||||
if mimeType == "text/html":
|
if mimeType == "text/html":
|
||||||
data = styledData
|
data = styledData
|
||||||
return self.send_error(400, message, data)
|
return self.send_error(400, message, data)
|
||||||
|
@ -333,9 +331,8 @@ class HttpRequestHandlerMixin:
|
||||||
errorDescription = errorElement.getDescription()
|
errorDescription = errorElement.getDescription()
|
||||||
if errorDescription:
|
if errorDescription:
|
||||||
xmlDocument = errorDescription.generateXmlDocument()
|
xmlDocument = errorDescription.generateXmlDocument()
|
||||||
stylesheet = station.getDataHolder().getXslt()
|
xslt = station.getDataHolder().getSiteXslt()
|
||||||
mimeType, styledData = station.generateXmlDocumentStyledData(
|
mimeType, styledData = station.generateXmlDocumentStyledData(xmlDocument, xslt)
|
||||||
xmlDocument, stylesheet)
|
|
||||||
if mimeType == "text/html":
|
if mimeType == "text/html":
|
||||||
data = styledData
|
data = styledData
|
||||||
return self.send_error(500, message, data)
|
return self.send_error(500, message, data)
|
||||||
|
@ -366,9 +363,8 @@ class HttpRequestHandlerMixin:
|
||||||
errorDescription = errorElement.getDescription()
|
errorDescription = errorElement.getDescription()
|
||||||
if errorDescription:
|
if errorDescription:
|
||||||
xmlDocument = errorDescription.generateXmlDocument()
|
xmlDocument = errorDescription.generateXmlDocument()
|
||||||
stylesheet = station.getDataHolder().getXslt()
|
xslt = station.getDataHolder().getSiteXslt()
|
||||||
mimeType, styledData = station.generateXmlDocumentStyledData(
|
mimeType, styledData = station.generateXmlDocumentStyledData(xmlDocument, xslt)
|
||||||
xmlDocument, stylesheet)
|
|
||||||
if mimeType == "text/html":
|
if mimeType == "text/html":
|
||||||
data = styledData
|
data = styledData
|
||||||
return self.send_error(404, message, data)
|
return self.send_error(404, message, data)
|
||||||
|
@ -388,9 +384,8 @@ class HttpRequestHandlerMixin:
|
||||||
errorDescription = errorElement.getDescription()
|
errorDescription = errorElement.getDescription()
|
||||||
if errorDescription:
|
if errorDescription:
|
||||||
xmlDocument = errorDescription.generateXmlDocument()
|
xmlDocument = errorDescription.generateXmlDocument()
|
||||||
stylesheet = station.getDataHolder().getXslt()
|
xslt = station.getDataHolder().getSiteXslt()
|
||||||
mimeType, styledData = station.generateXmlDocumentStyledData(
|
mimeType, styledData = station.generateXmlDocumentStyledData(xmlDocument, xslt)
|
||||||
xmlDocument, stylesheet)
|
|
||||||
if mimeType == "text/html":
|
if mimeType == "text/html":
|
||||||
data = styledData
|
data = styledData
|
||||||
if station.getConfigBoolean("yep:useHttpAuthentication", default = False):
|
if station.getConfigBoolean("yep:useHttpAuthentication", default = False):
|
||||||
|
@ -422,9 +417,8 @@ class HttpRequestHandlerMixin:
|
||||||
errorDescription = errorElement.getDescription()
|
errorDescription = errorElement.getDescription()
|
||||||
if errorDescription:
|
if errorDescription:
|
||||||
xmlDocument = errorDescription.generateXmlDocument()
|
xmlDocument = errorDescription.generateXmlDocument()
|
||||||
stylesheet = station.getDataHolder().getXslt()
|
xslt = station.getDataHolder().getSiteXslt()
|
||||||
mimeType, styledData = station.generateXmlDocumentStyledData(
|
mimeType, styledData = station.generateXmlDocumentStyledData(xmlDocument, xslt)
|
||||||
xmlDocument, stylesheet)
|
|
||||||
if mimeType == "text/html":
|
if mimeType == "text/html":
|
||||||
data = styledData
|
data = styledData
|
||||||
self.send_response(302, message)
|
self.send_response(302, message)
|
||||||
|
@ -453,9 +447,8 @@ class HttpRequestHandlerMixin:
|
||||||
errorDescription = errorElement.getDescription()
|
errorDescription = errorElement.getDescription()
|
||||||
if errorDescription:
|
if errorDescription:
|
||||||
xmlDocument = errorDescription.generateXmlDocument()
|
xmlDocument = errorDescription.generateXmlDocument()
|
||||||
stylesheet = station.getDataHolder().getXslt()
|
xslt = station.getDataHolder().getSiteXslt()
|
||||||
mimeType, styledData = station.generateXmlDocumentStyledData(
|
mimeType, styledData = station.generateXmlDocumentStyledData(xmlDocument, xslt)
|
||||||
xmlDocument, stylesheet)
|
|
||||||
if mimeType == "text/html":
|
if mimeType == "text/html":
|
||||||
data = styledData
|
data = styledData
|
||||||
self.send_response(201, message)
|
self.send_response(201, message)
|
||||||
|
|
|
@ -839,7 +839,7 @@ class AbstractStation(object):
|
||||||
command = environs.getVar("httpCommand")
|
command = environs.getVar("httpCommand")
|
||||||
if command == "GET":
|
if command == "GET":
|
||||||
xmlDocument = self.generateXmlDocument()
|
xmlDocument = self.generateXmlDocument()
|
||||||
stylesheet = self.getDataHolder().getXslt()
|
stylesheet = self.getDataHolder().getSiteXslt()
|
||||||
self.outputHttpHtmlDocument(xmlDocument, stylesheet)
|
self.outputHttpHtmlDocument(xmlDocument, stylesheet)
|
||||||
else:
|
else:
|
||||||
raise faults.PathNotFound(environs.getVar("currentStation"), "")
|
raise faults.PathNotFound(environs.getVar("currentStation"), "")
|
||||||
|
|
|
@ -106,8 +106,9 @@ class DbXmlContainerHolder(dataholders.DataHolder):
|
||||||
childNode.newProp("id", str(document.getID()))
|
childNode.newProp("id", str(document.getID()))
|
||||||
childNode.newProp("name", document.getName())
|
childNode.newProp("name", document.getName())
|
||||||
resultNode.addChild(childNode)
|
resultNode.addChild(childNode)
|
||||||
return DbXmlDocumentResult(
|
result = DbXmlDocumentResult(
|
||||||
resultNode, previous = self, uriPathFragment = self.uriPathFragment, owner = self)
|
resultNode, previous = self, uriPathFragment = self.uriPathFragment, owner = self)
|
||||||
|
return result
|
||||||
|
|
||||||
def getDbXmlNodeResultFromXpath(self, xpathExpression):
|
def getDbXmlNodeResultFromXpath(self, xpathExpression):
|
||||||
results = self.getResultFetchedFromXpath(xpathExpression, dbxml.XmlQueryContextPtr.ResultValues)
|
results = self.getResultFetchedFromXpath(xpathExpression, dbxml.XmlQueryContextPtr.ResultValues)
|
||||||
|
|
|
@ -275,7 +275,7 @@ You have been succesfully authenticated; click ok to go back to the service prov
|
||||||
enctype = "multipart/form-data", method = "post")))
|
enctype = "multipart/form-data", method = "post")))
|
||||||
htmlDocument = documents.newTemporaryHtmlDocument()
|
htmlDocument = documents.newTemporaryHtmlDocument()
|
||||||
htmlDocument.append(layout)
|
htmlDocument.append(layout)
|
||||||
stylesheet = self.getDataHolder().getXslt()
|
stylesheet = self.getDataHolder().getSiteXslt()
|
||||||
self.outputHttpHtmlDocument(htmlDocument, stylesheet)
|
self.outputHttpHtmlDocument(htmlDocument, stylesheet)
|
||||||
else:
|
else:
|
||||||
# Unknown protocol profile. We dont know what to do :
|
# Unknown protocol profile. We dont know what to do :
|
||||||
|
|
|
@ -247,7 +247,7 @@ provider.\
|
||||||
enctype = "multipart/form-data", method = "post")))
|
enctype = "multipart/form-data", method = "post")))
|
||||||
htmlDocument = documents.newTemporaryHtmlDocument()
|
htmlDocument = documents.newTemporaryHtmlDocument()
|
||||||
htmlDocument.append(layout)
|
htmlDocument.append(layout)
|
||||||
stylesheet = self.getDataHolder().getXslt()
|
stylesheet = self.getDataHolder().getSiteXslt()
|
||||||
self.outputHttpHtmlDocument(htmlDocument, stylesheet)
|
self.outputHttpHtmlDocument(htmlDocument, stylesheet)
|
||||||
else:
|
else:
|
||||||
# Unknown profile. We dont know what to do :
|
# Unknown profile. We dont know what to do :
|
||||||
|
|
|
@ -918,6 +918,9 @@ class DummyInstance(object):
|
||||||
def getRootElement(self):
|
def getRootElement(self):
|
||||||
return self._rootElement
|
return self._rootElement
|
||||||
|
|
||||||
|
def serialize(self):
|
||||||
|
return self._rootElement.serialize()
|
||||||
|
|
||||||
|
|
||||||
class Item(WidgetElement):
|
class Item(WidgetElement):
|
||||||
def generateHtmlContextControlCheckBoxesForm(
|
def generateHtmlContextControlCheckBoxesForm(
|
||||||
|
|
Reference in New Issue