You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lenya.apache.org by ja...@apache.org on 2006/06/23 15:06:48 UTC
svn commit: r416711 - in /lenya/branches/BRANCH_1_2_X/src:
java/org/apache/lenya/cms/cocoon/acting/HTMLFormSaveAction.java
webapp/lenya/usecases/edit/usecase-edit.xmap
webapp/lenya/xslt/authoring/edit/form-layout.xsl
Author: jann
Date: Fri Jun 23 06:06:47 2006
New Revision: 416711
URL: http://svn.apache.org/viewvc?rev=416711&view=rev
Log:
small improvment to the form editor i.e. to prevent th editor to jump to the top of the page if a new element is added
Modified:
lenya/branches/BRANCH_1_2_X/src/java/org/apache/lenya/cms/cocoon/acting/HTMLFormSaveAction.java
lenya/branches/BRANCH_1_2_X/src/webapp/lenya/usecases/edit/usecase-edit.xmap
lenya/branches/BRANCH_1_2_X/src/webapp/lenya/xslt/authoring/edit/form-layout.xsl
Modified: lenya/branches/BRANCH_1_2_X/src/java/org/apache/lenya/cms/cocoon/acting/HTMLFormSaveAction.java
URL: http://svn.apache.org/viewvc/lenya/branches/BRANCH_1_2_X/src/java/org/apache/lenya/cms/cocoon/acting/HTMLFormSaveAction.java?rev=416711&r1=416710&r2=416711&view=diff
==============================================================================
--- lenya/branches/BRANCH_1_2_X/src/java/org/apache/lenya/cms/cocoon/acting/HTMLFormSaveAction.java (original)
+++ lenya/branches/BRANCH_1_2_X/src/java/org/apache/lenya/cms/cocoon/acting/HTMLFormSaveAction.java Fri Jun 23 06:06:47 2006
@@ -134,6 +134,7 @@
XUpdateQuery xq = new XUpdateQueryImpl();
String editSelect = null;
+ String insertSelect = null;
Enumeration params = request.getParameterNames();
while (params.hasMoreElements()) {
String pname = (String) params.nextElement();
@@ -146,7 +147,7 @@
editSelect = pname.substring(5, pname.length() - 3);
getLogger().debug("Edit: " + editSelect);
}
-
+
// Make sure we are dealing with an xupdate statement,
// else skip
if (pname.indexOf("<xupdate:") == 0) {
@@ -202,6 +203,7 @@
if (!request.getParameter(pname).equals("null")) {
xupdateModifications = insertBefore(request
.getParameter(pname));
+ insertSelect = pname.substring(31,pname.length() - 3);
}
// insert-before: in case of image
} else if (pname.indexOf("xupdate:insert-before") > 0
@@ -214,6 +216,7 @@
if (!request.getParameter(pname).equals("null")) {
xupdateModifications = insertAfter(request
.getParameter(pname));
+ insertSelect = pname.substring(30,pname.length() - 3);
}
// insert-after: in case of image
} else if (pname.indexOf("xupdate:insert-after") > 0
@@ -224,6 +227,7 @@
&& pname.endsWith("/>.x")) {
xupdateModifications = remove(pname.substring(0,
pname.length() - 2));
+ insertSelect = pname.substring(24,pname.length() - 3);
} else if (pname.endsWith(">.y")) {
getLogger().debug("Don't handle this: " + pname);
} else {
@@ -302,6 +306,10 @@
if (editSelect != null) {
hmap.put("editSelect", editSelect);
}
+ if (insertSelect != null) {
+ hmap.put("insertSelect", insertSelect);
+ }
+
return hmap;
}
} catch (NullPointerException e) {
@@ -593,4 +601,4 @@
return xupdateModifications.substring(0, endOfFirstNode) + " " + ns
+ xupdateModifications.substring(endOfFirstNode);
}
-}
\ No newline at end of file
+}
Modified: lenya/branches/BRANCH_1_2_X/src/webapp/lenya/usecases/edit/usecase-edit.xmap
URL: http://svn.apache.org/viewvc/lenya/branches/BRANCH_1_2_X/src/webapp/lenya/usecases/edit/usecase-edit.xmap?rev=416711&r1=416710&r2=416711&view=diff
==============================================================================
--- lenya/branches/BRANCH_1_2_X/src/webapp/lenya/usecases/edit/usecase-edit.xmap (original)
+++ lenya/branches/BRANCH_1_2_X/src/webapp/lenya/usecases/edit/usecase-edit.xmap Fri Jun 23 06:06:47 2006
@@ -115,6 +115,7 @@
<map:parameter name="contextPrefix" value="{page-envelope:context-prefix}"/>
<map:parameter name="nodeid" value="{page-envelope:document-node-id}"/>
<map:parameter name="edit" value="{editSelect}"/>
+ <map:parameter name="insert" value="{insertSelect}"/>
<map:parameter name="wfevent" value="{request-param:lenya.event}"/>
</map:transform>
<map:call resource="style-cms-page"/>
Modified: lenya/branches/BRANCH_1_2_X/src/webapp/lenya/xslt/authoring/edit/form-layout.xsl
URL: http://svn.apache.org/viewvc/lenya/branches/BRANCH_1_2_X/src/webapp/lenya/xslt/authoring/edit/form-layout.xsl?rev=416711&r1=416710&r2=416711&view=diff
==============================================================================
--- lenya/branches/BRANCH_1_2_X/src/webapp/lenya/xslt/authoring/edit/form-layout.xsl (original)
+++ lenya/branches/BRANCH_1_2_X/src/webapp/lenya/xslt/authoring/edit/form-layout.xsl Fri Jun 23 06:06:47 2006
@@ -26,6 +26,7 @@
<xsl:param name="contextPrefix" select="'/lenya'"/>
<xsl:param name="edit" select="'No node selected yet'"/>
+<xsl:param name="insert" select="'No node selected yet'"/>
<xsl:param name="wfevent" select="'null'"/>
@@ -145,6 +146,33 @@
function goAnchor() {
document.location.hash = '<xsl:value-of select="$currentTagID"/>';
+ window.scrollBy(0, -150);
+ }
+ </script>
+ </xsl:if>
+
+ <xsl:variable name="currentNeighbourID">
+ <xsl:value-of select="substring-before(substring-after($insert, "@tagID='"), "'")"/>
+ </xsl:variable>
+ <xsl:if test="$currentNeighbourID != ''">
+ <script type="text/javascript">
+
+ function addLoadEvent(func) {
+ var oldonload = window.onload;
+ if (typeof window.onload != 'function') {
+ window.onload = func;
+ } else {
+ window.onload = function() {
+ oldonload();
+ func();
+ }
+ }
+ }
+
+ addLoadEvent(goAnchor);
+
+ function goAnchor() {
+ document.location.hash = '<xsl:value-of select="$currentNeighbourID"/>';
window.scrollBy(0, -150);
}
</script>
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@lenya.apache.org
For additional commands, e-mail: commits-help@lenya.apache.org
Re: form editor [was Re: svn commit: r416711]
Posted by Jann Forrer <ja...@id.unizh.ch>.
Jörn Nettingsmeier wrote:
[ ... ]
>>
>> Therfore i decided to do the first step in java in order to resolve
>> all includes and following all refs to their defs.
>> This class then generates the appropriate xslt-file.
>
> supporting only a subset of rng was a design decision to keep the
> prototype simple and get working results more quickly. it's by no means
> impossible (actually quite easy since xslt2 supports intermediary result
> trees) to support all internal and external refs with plain xsl code.
>
Nice to hear ....
> as to my choice of language, it may be hard to believe for anyone who
> has tried to solve nontrivial problems in xslt version 1, but
That's the reason why I did not even think of starting it with xslt ....
> xslt2/xpath2 is actually beautiful and very pleasant to use, mostly due
> to the fact that variables are no longer second-class citizens and can
> contain usable trees, and to the introduction of <xsl:function/>.
>
So, I need to dig into xslt2/xpath2 :-)
Jann
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lenya.apache.org
For additional commands, e-mail: dev-help@lenya.apache.org
Re: form editor [was Re: svn commit: r416711]
Posted by Jörn Nettingsmeier <po...@uni-duisburg.de>.
Jann Forrer wrote:
> Jörn Nettingsmeier wrote:
>> Jann Forrer wrote:
>>> Jörn Nettingsmeier wrote:
>>>>
>
> [ ... ]
>
>>
>>>> two problems are keeping me from releasing it:
>>>> * it got broken due to some recent svn changes, and i haven't had
>>>> the time to fix it.
>>>> * it is implemented in xsl 2.0 and would require to add the saxon-8
>>>> jar to lenya. i would like to use it everywhere instead of the old
>>>> trax one, but again i have not found the time to work on it.
>>>>
>>>> i think we should eventually try to create something like that for
>>>> lenya. the cforms editor is a nice example, but the downside of
>>>> cforms is that you need to modify so many different files, and most
>>>> of it is boilerplate stuff, so it would be nice to automate it.
>>>>
>>>> if you're interested, i can upload it somewhere, but as i said, it's
>>>> not in working order, although the foundation is usable i think.
>>>>
>>> I am very much interested in your work. Can you pack and send it by
>>> mail or maybe better adding an "enhancment" bug in the bugzilla and
>>> attach the file.
>>
>> it's here:
>> http://pol-serv1.politik.uni-duisburg-essen.de/~nettings/rng2cforms/
>> http://pol-serv1.politik.uni-duisburg-essen.de/~nettings/rng2cforms-0.0.1.tar.gz
>>
>
> Thank you for the pointer. I did download your work and will have a look
> at it as soon as possible ....
>
>>
>> start with reading rng2cforms.xsl, it's the main stylesheet that
>> includes all the others. iirc there is a comment on how to invoke it.
>> note that it only supports simple, russian-doll-style grammars atm -
>> no refs, no defines.
>>
>
> Therfore i decided to do the first step in java in order to resolve all
> includes and following all refs to their defs.
> This class then generates the appropriate xslt-file.
supporting only a subset of rng was a design decision to keep the
prototype simple and get working results more quickly. it's by no means
impossible (actually quite easy since xslt2 supports intermediary result
trees) to support all internal and external refs with plain xsl code.
as to my choice of language, it may be hard to believe for anyone who
has tried to solve nontrivial problems in xslt version 1, but
xslt2/xpath2 is actually beautiful and very pleasant to use, mostly due
to the fact that variables are no longer second-class citizens and can
contain usable trees, and to the introduction of <xsl:function/>.
regards,
jörn
--
"Open source takes the bullshit out of software."
- Charles Ferguson on TechnologyReview.com
--
Jörn Nettingsmeier, EDV-Administrator
Institut für Politikwissenschaft
Universität Duisburg-Essen, Standort Duisburg
Mail: pol-admin@uni-due.de, Telefon: 0203/379-2736
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lenya.apache.org
For additional commands, e-mail: dev-help@lenya.apache.org
Re: form editor [was Re: svn commit: r416711]
Posted by Jann Forrer <ja...@id.unizh.ch>.
Jörn Nettingsmeier wrote:
> Jann Forrer wrote:
>> Jörn Nettingsmeier wrote:
>>>
[ ... ]
>
>>> two problems are keeping me from releasing it:
>>> * it got broken due to some recent svn changes, and i haven't had the
>>> time to fix it.
>>> * it is implemented in xsl 2.0 and would require to add the saxon-8
>>> jar to lenya. i would like to use it everywhere instead of the old
>>> trax one, but again i have not found the time to work on it.
>>>
>>> i think we should eventually try to create something like that for
>>> lenya. the cforms editor is a nice example, but the downside of
>>> cforms is that you need to modify so many different files, and most
>>> of it is boilerplate stuff, so it would be nice to automate it.
>>>
>>> if you're interested, i can upload it somewhere, but as i said, it's
>>> not in working order, although the foundation is usable i think.
>>>
>> I am very much interested in your work. Can you pack and send it by
>> mail or maybe better adding an "enhancment" bug in the bugzilla and
>> attach the file.
>
> it's here:
> http://pol-serv1.politik.uni-duisburg-essen.de/~nettings/rng2cforms/
> http://pol-serv1.politik.uni-duisburg-essen.de/~nettings/rng2cforms-0.0.1.tar.gz
>
Thank you for the pointer. I did download your work and will have a look
at it as soon as possible ....
>
> start with reading rng2cforms.xsl, it's the main stylesheet that
> includes all the others. iirc there is a comment on how to invoke it.
> note that it only supports simple, russian-doll-style grammars atm - no
> refs, no defines.
>
Therfore i decided to do the first step in java in order to resolve all
includes and following all refs to their defs.
This class then generates the appropriate xslt-file.
> the package includes michael kay's saxon 8 for convenience, so i'm not
> putting it on an apache server atm, since there will probably be
> licensing issues.
>
> before anyone asks: it is absolutely impossible to do that kind of stuff
> in xstl1.0, so unless the xalan folk get up to speed, this will have to
> be out-of-tree...
>
Jann
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lenya.apache.org
For additional commands, e-mail: dev-help@lenya.apache.org
Re: form editor [was Re: svn commit: r416711]
Posted by Jörn Nettingsmeier <po...@uni-duisburg.de>.
Jann Forrer wrote:
> Jörn Nettingsmeier wrote:
>>
>> fwiw, i have some code lying around that will create a skeleton lenya
>> module with a form editor from a given (simple) rng grammar.
>>
>
> I was also thinking about generating a new module in 1.4.
> But up to know, I could only generate a xslt out of the schema. This
> xslt on the other hand generates a input field for all elements in an
> xml-file.
i generate all needed files from the schema in one pass. most stuff is
boilerplate code, but you always have all the schema information
available, so each file can be customized as you like.
>> two problems are keeping me from releasing it:
>> * it got broken due to some recent svn changes, and i haven't had the
>> time to fix it.
>> * it is implemented in xsl 2.0 and would require to add the saxon-8
>> jar to lenya. i would like to use it everywhere instead of the old
>> trax one, but again i have not found the time to work on it.
>>
>> i think we should eventually try to create something like that for
>> lenya. the cforms editor is a nice example, but the downside of cforms
>> is that you need to modify so many different files, and most of it is
>> boilerplate stuff, so it would be nice to automate it.
>>
>> if you're interested, i can upload it somewhere, but as i said, it's
>> not in working order, although the foundation is usable i think.
>>
> I am very much interested in your work. Can you pack and send it by mail
> or maybe better adding an "enhancment" bug in the bugzilla and attach
> the file.
it's here:
http://pol-serv1.politik.uni-duisburg-essen.de/~nettings/rng2cforms/
http://pol-serv1.politik.uni-duisburg-essen.de/~nettings/rng2cforms-0.0.1.tar.gz
start with reading rng2cforms.xsl, it's the main stylesheet that
includes all the others. iirc there is a comment on how to invoke it.
note that it only supports simple, russian-doll-style grammars atm - no
refs, no defines.
the package includes michael kay's saxon 8 for convenience, so i'm not
putting it on an apache server atm, since there will probably be
licensing issues.
before anyone asks: it is absolutely impossible to do that kind of stuff
in xstl1.0, so unless the xalan folk get up to speed, this will have to
be out-of-tree...
best,
jörn
--
"Open source takes the bullshit out of software."
- Charles Ferguson on TechnologyReview.com
--
Jörn Nettingsmeier, EDV-Administrator
Institut für Politikwissenschaft
Universität Duisburg-Essen, Standort Duisburg
Mail: pol-admin@uni-due.de, Telefon: 0203/379-2736
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lenya.apache.org
For additional commands, e-mail: dev-help@lenya.apache.org
Re: form editor [was Re: svn commit: r416711]
Posted by Jann Forrer <ja...@id.unizh.ch>.
Jörn Nettingsmeier wrote:
> Jann Forrer wrote:
>> Andreas Hartmann wrote:
>>> jann@apache.org wrote:
>>>> Author: jann
>>>> Date: Fri Jun 23 06:06:47 2006
>>>> New Revision: 416711
>>>>
>>>> URL: http://svn.apache.org/viewvc?rev=416711&view=rev
>>>> Log:
>>>> small improvment to the form editor i.e. to prevent th editor to
>>>> jump to the top of the page if a new element is added
>>>
>>> Hi Jann,
>>>
>>> thanks a lot for this improvement!
>>> Maybe we should file a bug that it can be applied to the trunk as well?
>>>
>> Yes, I will add the bug.
>>
>> BTW I once started to write a form editor which is schema based
>> similar to the approache described in
>> http://www.xml.com/pub/a/2003/04/30/editing.html
>> but at the moment i have no time to work on it and I am anyway not
>> sure whether it make sense to work on another (form) editor?
>
> fwiw, i have some code lying around that will create a skeleton lenya
> module with a form editor from a given (simple) rng grammar.
>
I was also thinking about generating a new module in 1.4.
But up to know, I could only generate a xslt out of the schema. This
xslt on the other hand generates a input field for all elements in an
xml-file.
> two problems are keeping me from releasing it:
> * it got broken due to some recent svn changes, and i haven't had the
> time to fix it.
> * it is implemented in xsl 2.0 and would require to add the saxon-8 jar
> to lenya. i would like to use it everywhere instead of the old trax one,
> but again i have not found the time to work on it.
>
> i think we should eventually try to create something like that for
> lenya. the cforms editor is a nice example, but the downside of cforms
> is that you need to modify so many different files, and most of it is
> boilerplate stuff, so it would be nice to automate it.
>
> if you're interested, i can upload it somewhere, but as i said, it's not
> in working order, although the foundation is usable i think.
>
I am very much interested in your work. Can you pack and send it by mail
or maybe better adding an "enhancment" bug in the bugzilla and attach
the file.
Jann
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lenya.apache.org
For additional commands, e-mail: dev-help@lenya.apache.org
form editor [was Re: svn commit: r416711]
Posted by Jörn Nettingsmeier <po...@uni-duisburg.de>.
Jann Forrer wrote:
> Andreas Hartmann wrote:
>> jann@apache.org wrote:
>>> Author: jann
>>> Date: Fri Jun 23 06:06:47 2006
>>> New Revision: 416711
>>>
>>> URL: http://svn.apache.org/viewvc?rev=416711&view=rev
>>> Log:
>>> small improvment to the form editor i.e. to prevent th editor to jump
>>> to the top of the page if a new element is added
>>
>> Hi Jann,
>>
>> thanks a lot for this improvement!
>> Maybe we should file a bug that it can be applied to the trunk as well?
>>
> Yes, I will add the bug.
>
> BTW I once started to write a form editor which is schema based similar
> to the approache described in
> http://www.xml.com/pub/a/2003/04/30/editing.html
> but at the moment i have no time to work on it and I am anyway not sure
> whether it make sense to work on another (form) editor?
fwiw, i have some code lying around that will create a skeleton lenya
module with a form editor from a given (simple) rng grammar.
two problems are keeping me from releasing it:
* it got broken due to some recent svn changes, and i haven't had the
time to fix it.
* it is implemented in xsl 2.0 and would require to add the saxon-8 jar
to lenya. i would like to use it everywhere instead of the old trax one,
but again i have not found the time to work on it.
i think we should eventually try to create something like that for
lenya. the cforms editor is a nice example, but the downside of cforms
is that you need to modify so many different files, and most of it is
boilerplate stuff, so it would be nice to automate it.
if you're interested, i can upload it somewhere, but as i said, it's not
in working order, although the foundation is usable i think.
--
"Open source takes the bullshit out of software."
- Charles Ferguson on TechnologyReview.com
--
Jörn Nettingsmeier, EDV-Administrator
Institut für Politikwissenschaft
Universität Duisburg-Essen, Standort Duisburg
Mail: pol-admin@uni-due.de, Telefon: 0203/379-2736
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lenya.apache.org
For additional commands, e-mail: dev-help@lenya.apache.org
Re: svn commit: r416711 - in /lenya/branches/BRANCH_1_2_X/src:
java/org/apache/lenya/cms/cocoon/acting/HTMLFormSaveAction.java webapp/lenya/usecases/edit/usecase-edit.xmap
webapp/lenya/xslt/authoring/edit/form-layout.xsl
Posted by Jann Forrer <ja...@id.unizh.ch>.
Andreas Hartmann wrote:
> jann@apache.org wrote:
>> Author: jann
>> Date: Fri Jun 23 06:06:47 2006
>> New Revision: 416711
>>
>> URL: http://svn.apache.org/viewvc?rev=416711&view=rev
>> Log:
>> small improvment to the form editor i.e. to prevent th editor to jump
>> to the top of the page if a new element is added
>
> Hi Jann,
>
> thanks a lot for this improvement!
> Maybe we should file a bug that it can be applied to the trunk as well?
>
Yes, I will add the bug.
BTW I once started to write a form editor which is schema based similar
to the approache described in
http://www.xml.com/pub/a/2003/04/30/editing.html
but at the moment i have no time to work on it and I am anyway not sure
whether it make sense to work on another (form) editor?
Jann
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lenya.apache.org
For additional commands, e-mail: dev-help@lenya.apache.org
Re: svn commit: r416711 - in /lenya/branches/BRANCH_1_2_X/src:
java/org/apache/lenya/cms/cocoon/acting/HTMLFormSaveAction.java webapp/lenya/usecases/edit/usecase-edit.xmap
webapp/lenya/xslt/authoring/edit/form-layout.xsl
Posted by Andreas Hartmann <an...@apache.org>.
jann@apache.org wrote:
> Author: jann
> Date: Fri Jun 23 06:06:47 2006
> New Revision: 416711
>
> URL: http://svn.apache.org/viewvc?rev=416711&view=rev
> Log:
> small improvment to the form editor i.e. to prevent th editor to jump to the top of the page if a new element is added
Hi Jann,
thanks a lot for this improvement!
Maybe we should file a bug that it can be applied to the trunk as well?
-- Andreas
--
Andreas Hartmann
Wyona Inc. - Open Source Content Management - Apache Lenya
http://www.wyona.com http://lenya.apache.org
andreas.hartmann@wyona.com andreas@apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lenya.apache.org
For additional commands, e-mail: dev-help@lenya.apache.org