I'm sorry to inform you, that you are not allowed to access this place.
Sorry, no edit mode for content type
Edit the save
or publish publish button of you browser/editor)
to commit your changes there.
Bug: when you use the create button, changes
will be saved, but the old values will be used to actually
create the document.
| Action | Data read from |
|
|
| using | |||
| Protection | initialize (optional) | ||
To:
Type:
Content-Type:
File upload
<xsl:stylesheet xmlns:d="http://www.askemos.org/2000/NameSpaceDSSSL" xmlns:editor="urn:editor" xmlns:mind="http://www.askemos.org/2000/CoreAPI" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<editor:state>
<body><html>
<head><title>Brussels 7th Mai 2003: From Legal Wordplay to Granted Software Patents</title>
</head>
<body bgcolor="white">
<h1>From Legal Wordplay to Granted Software Patents</h1>
<p>7th Mai 2003; Brussels, Dorint Hotel
<a href="<a href="http://swpat.ffii.org/termine/2003/europarl/05/07/index.en.html"">http://swpat.ffii.org/termine/2003/europarl/05/07/index.en.html"</a>
>[program]</a>.</p>
<p>Plenary "Civil Liberties under Overlapping Property Regimes"</p>
<img src="/A96911edb0812bd2b9ad3aca41d14f914" alt="photo from planary"/>
<p>Left to right:
Jörg F. Wittenberger,
Hartmuth Pilch,
MEP Piia-Noora Kauppi,
Prof. Lawrence Lessig,
Kiesewetter?</p>
</body>
</html></body>
<content-type>text/html</content-type>
<expression> (grove-root (current-node)) 
;;((sxpath '(p)) (current-node))</expression>
<to></to>
<type></type>
</editor:state>
<initial xmlns="urn:editor">
<body></body>
<content-type></content-type>
<expression></expression>
<to></to>
<type></type>
</initial>
<xsl:variable name="state">
<d:copy-of select="((sxpath '(state *)) (grove-root (current-node)))"></d:copy-of>
</xsl:variable>
<xsl:template match="request[@type="read"]">
<xsl:choose>
<d:when test="(not (service-level (me 'get 'id)))">
<html>
<head>
<title>access denied</title>
</head>
<body>
<h1>access denied</h1>
<p>I'm sorry to inform you,
that you are not allowed to access this place.</p>
</body>
</html>
</d:when>
<d:when test="(equal? (let ((dst (msg 'destination)))
(and (not (null? dst)) (car dst)))
"index.html")">
<xsl:choose>
<d:when test="
(match-element?
'output
(node-list-first (children (node-list-first
(select-elements
(xsl-variable "state") 'body)))))
">
<!--
This version is functionally equivalent to the next (at least
for the purpose here) and it's somewhat more readable.
Knowledge about optimizations in mechanism/tree.scm motivates
the more complicated form below. Reason: the "data" function
returns the string from a xml literal if applied to a node list
of just one literal. For a list of xml elements (like the
result of select-elements here) it will apply string-append
recursivly to compute the value. This is not nessesary, we know
there's just one string.
<d:copy-of
select='(xml-parse (data (select-elements
(xsl-variable "state") 'body)))' />
-->
<d:copy-of select="(node-list-first
(children (node-list-first
(select-elements
(xsl-variable "state") 'body))))"></d:copy-of>
</d:when>
<d:when test="(string=? (data (select-elements
(xsl-variable "state")
'content-type))
"text/xml")">
<d:copy-of select="
(xml-parse
(data (select-elements (xsl-variable "state") 'body)))"></d:copy-of>
</d:when>
<d:when test="(string=? (data (select-elements
(xsl-variable "state")
'content-type))
"text/html")">
<d:copy-of select="
(xml-parse (data (select-elements (xsl-variable "state") 'body))
mode: 'html)"></d:copy-of>
</d:when>
<xsl:otherwise>
<output method="text">
<xsl:attribute name="media-type">
<d:copy-of select="(data (select-elements
(xsl-variable "state") 'content-type))"></d:copy-of>
</xsl:attribute>
<d:copy-of select="(literal (data (node-list-first
(children (node-list-first
(select-elements
(xsl-variable "state") 'body))))))"></d:copy-of>
</output>
</xsl:otherwise>
</xsl:choose>
</d:when>
<d:when test="(is-meta-form? msg)">
<d:copy-of select="(message-body (metaview me msg))"></d:copy-of>
</d:when>
<d:when test="(equal? (data (form-field 'template (current-node)))
"expression")">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>softeyes web site</title>
<meta content="text/html" http-equiv="Content-Type"></meta>
</head>
<body bgcolor="white">
<h1>softeyes web site</h1>
<xsl:choose>
<d:when test="(member (data (select-elements
(xsl-variable "state")
'content-type))
'("text/xml" "text/html"))">
<d:form action="'()" method="post">
<input name="action" type="submit" value="save"></input>
<textarea cols="72" name="expression" rows="10">
<d:copy-of select="#CONTENT">
(literal
(data (children (select-elements (xsl-variable "state") 'expression))))
</d:copy-of>
</textarea>
</d:form>
<h2>Data:</h2>
<d:copy-of select="
(make element gi: 'pre
(literal (data (select-elements (xsl-variable "state") 'body))))"></d:copy-of>
<h2>Result:</h2>
<d:copy-of select="#CONTENT">
(make element gi: 'pre
(literal (xml-format
(guard
(exception (else (literal exception)))
((eval `(lambda (current-node grove-root)
,(read (data (select-elements (xsl-variable "state") 'expression)))))
(let ((value (xml-parse (data (select-elements (xsl-variable "state") 'body)))))
(lambda () value))
grove-root)))))
</d:copy-of>
</d:when>
<xsl:otherwise>
<p>Sorry, no edit mode for content type <d:copy-of select="#CONTENT">
(node-list
(literal "\""
(data (select-elements (xsl-variable "state") 'content-type))
"\" please use ")
(make element gi: 'a
attributes: `((href ,(read-locator (msg 'location-format)
(list "index.html" (me 'get 'id)))))
(literal "external editor"))
(literal "."))
</d:copy-of></p>
</xsl:otherwise>
</xsl:choose>
</body>
</html>
</d:when>
<xsl:otherwise>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>softeyes web site</title>
<meta content="text/html" http-equiv="Content-Type"></meta>
</head>
<body bgcolor="white">
<h1>softeyes web site</h1>
<d:form action="'()" method="post">
<input name="action" type="submit" value="save"></input>
<input name="action" type="submit" value="send"></input>
<input name="action" type="submit" value="create"></input>
<br></br>
<p>Edit the <d:a d:href="(read-locator (msg 'location-format)
(cons "index.html" (msg 'location)))">parsed version</d:a>.
<small>First save! You may use HTTP-PUT (behind the <code>save</code>
or publish <code>publish</code> button of you browser/editor)
to commit your changes there.</small>
Bug: when you use the <code>create</code> button, changes
will be saved, but the <em>old</em> values will be used to actually
create the document.</p>
<p><d:a d:href="
(read-locator (msg 'location-format)
(list body: "xmlns=urn:editor&template=expression"
(me 'get 'id)))
">expression</d:a>
-- <d:a d:href="
(read-locator (msg 'location-format)
(list body: "xmlns=mind" (me 'get 'id)))
">dbg</d:a>
.</p>
<p>
<!-- fold-links gibt eine Funktion mit zwei Parametern,
einem Kombinator und einem Initialwert. Der Kombinator
wird für alle Links auf den Link und den akkumulierten Initialwert
andgewendet, d.h. ergibt den neuen Initialwert für den nächsten Link.
Hier, im einfachsten Fall, wird als Kombinator 'cons' verwendet
und die leere Liste als Initalwert. Damit wird jeder Link
vor die Liste gehängt, mithin erhalten wir eine Liste aller Links.
Braucht man nur einige, dann ist 'cons' entsprechend zu ersetzen.
-->
<d:for-each select="((me 'fold-links) cons '())">
<d:a d:href="(read-locator (msg 'location-format)
(list (me (data (current-node)))))">
<d:copy-of select="(current-node)"></d:copy-of>
</d:a>
<br></br>
</d:for-each>
</p>
<d:form action="'()" method="post">
<table bgcolor="silver" border="0" cellpadding="5" cellspacing="1">
<thead>Create New Place</thead>
<tbody>
<tr>
<td>Action</td>
<td>
<input name="newaction" type="text" value="Af051fe01ba259f25aae185d500b3d6a2"></input>
</td>
<td>Data read from</td>
<td>
<d:input name="read" type="text" d:value="
(read-locator (msg 'location-format)
(list "index.html" (oid->string (me 'get 'id))))"></d:input>
</td>
</tr>
<tr>
<td colspan="4" valing="top">using
<textarea cols="50" name="body" rows="3"></textarea></td>
</tr>
<tr>
<td>Protection</td>
<td>
<input name="protection" type="text" value="Af051fe01ba259f25aae185d500b3d6a2"></input>
</td>
<td>initialize (optional)</td>
<td>
<input name="initialize" type="text" value=""></input>
</td>
</tr>
<tr>
<td colspan="2">
<input name="action" type="submit" value="new"></input>
</td>
</tr>
</tbody>
</table>
</d:form>
<p>
To: <input name="to" size="30" type="text"><xsl:attribute name="value"><d:copy-of select="(select-elements (xsl-variable "state") 'to)"></d:copy-of></xsl:attribute></input><br></br>
Type: <input name="type" size="30" type="text"><xsl:attribute name="value"><d:copy-of select="(select-elements (xsl-variable "state") 'type)"></d:copy-of></xsl:attribute></input><br></br><span>Content-Type: </span><input name="content-type" type="text"><xsl:attribute name="value"><d:copy-of select="(data (select-elements (xsl-variable "state")
'content-type))"></d:copy-of></xsl:attribute></input><br></br><xsl:choose><d:when test="
(match-element?
'output
(node-list-first (children (node-list-first
(select-elements
(xsl-variable "state") 'body)))))
"><img alt="picture content"><xsl:attribute name="src"><d:copy-of select="(read-locator
(msg 'location-format)
(list "index.html" (me 'get 'id)))"></d:copy-of></xsl:attribute></img><input name="body" type="hidden" value=""></input></d:when><xsl:otherwise><textarea cols="72" name="body" rows="25"><d:copy-of select="#CONTENT">
(literal
(let ((body (node-list-first
(select-elements (xsl-variable "state") 'body))))
(cond
((node-list-empty? body) "")
(else (data (children body))))))
</d:copy-of></textarea></xsl:otherwise></xsl:choose></p>
</d:form>
<p>
File upload
<d:form action="'()" enctype="multipart/form-data" method="post"><input name="body" type="file"></input><input name="action" type="submit" value="save"></input></d:form></p>
</body>
</html>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template match="request[@type="write"]">
<xsl:choose>
<d:when test="(not (or (service-level (me 'get 'id)) (error "privat property")))"></d:when>
<d:when test="(is-meta-form? msg)">
<d:copy-of select="(message-body (metactrl me msg))"></d:copy-of>
</d:when>
<xsl:otherwise>
<mind:reply>
<!--
TODO see that dsssl define's work to make that a bit more reader friendly.
-->
<d:copy-of select="#CONTENT">
(root
(let ((this-root (document-element (grove-root (current-node)))))
(make element
gi: (gi this-root) ns: (ns this-root)
attributes: (copy-attributes this-root)
(node-list-map
(lambda (node)
(cond
((match-element? 'state node)
(make element
gi: 'state ns: 'urn:editor
(cond
;; Direct write of the message body at "index.html".
((equal? (let ((dst (msg 'destination)))
(and (not (null? dst)) (car dst)))
"index.html")
(node-list-map
(lambda (n)
(if (eq? (gi n) 'body)
(make element
gi: (gi n) ns: (ns n) attributes: '()
(literal (msg 'mind-body)))
n))
(children node)))
;; The file upload box.
((and (node-list-empty?
(form-field 'content-type (current-node)))
(not (node-list-empty?
(form-field 'body (current-node)))))
(node-list-map
(lambda (n)
(if (eq? (gi n) 'body)
(form-field 'body (current-node))
n))
(children node)))
;; All form fields
(else
(node-list-map
(lambda (node)
(let ((ff (form-field (gi node) (current-node))))
(if (node-list-empty? ff) node ff)))
((sxpath '(state *)) (grove-root (current-node))))))))
(else node)))
;; The children of the root of the style sheet.
(children this-root)))))
</d:copy-of>
<d:if test="(equal? (data (form-field "action" (current-node))) "send")">
<mind:send>
<xsl:attribute name="type">
<d:copy-of select="(data (select-elements (xsl-variable "state") 'type))"></d:copy-of>
</xsl:attribute>
<to>
<d:copy-of select="(string-append (oid->string (msg 'dc-creator))
"/"
(data (select-elements (xsl-variable "state")
'to)))"></d:copy-of>
</to>
<Body>
<d:copy-of select="(xml-parse (data (node-list-first
(select-elements
(xsl-variable "state") 'body))))"></d:copy-of>
</Body>
</mind:send>
</d:if>
<d:if test="(equal? (data (form-field "action" (current-node))) "create")">
<mind:link name="last">
<mind:new>
<xsl:attribute name="action">
<d:copy-of select="(oid->string (me 'mind-action-document))"></d:copy-of>
</xsl:attribute>
<xsl:attribute name="protection">
<d:copy-of select="(right->string (me 'protection))"></d:copy-of>
</xsl:attribute>
<!--
<xsl:attribute name="initialize">true</xsl:attribute>-->
<d:copy-of select="#CONTENT">
((eval `(lambda (current-node grove-root)
,(read (data (select-elements (xsl-variable "state") 'expression)))))
(let ((value (xml-parse (data (select-elements (xsl-variable "state") 'body)))))
(lambda () value))
grove-root)
</d:copy-of>
</mind:new>
</mind:link>
</d:if>
<d:if test="
(equal? "new" (data (form-field 'action (current-node))))
">
<mind:link name="last">
<mind:new>
<xsl:attribute name="action">
<d:copy-of select="(data (form-field "newaction" (current-node)))"></d:copy-of>
</xsl:attribute>
<xsl:attribute name="protection">
<d:copy-of select="(data (form-field "protection" (current-node)))"></d:copy-of>
</xsl:attribute>
<xsl:attribute name="initialize">
<d:copy-of select="(data (form-field "initialize" (current-node)))"></d:copy-of>
</xsl:attribute>
<d:copy-of select="
(fetch (parsed-locator (data (form-field "read" (current-node))))
body: (xml-parse (data (children (document-element (form-field "body" (current-node)))))))
"></d:copy-of>
</mind:new>
</mind:link>
</d:if>
<mind:output method="xml"></mind:output>
</mind:reply>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
</xsl:stylesheet>
Diese Seite findet man von: overview, .
Letzte Modifikation:
Autor(en): jfw,
Dokument Nummer A67bb0753e1676f81983e0ecf3a15b391
geliefert an public
um Tue, 14 Oct 2008 09:59:40 +0200