Re: UTF-8 and Encoding Problems
Cool, thanks! Joerg Heinicke <[EMAIL PROTECTED]> 06/29/2004 09:04 PM Please respond to users To: [EMAIL PROTECTED] cc: Subject: Re: UTF-8 and Encoding Problems On 27.06.2004 22:28, Christopher Painter-Wakefield wrote: > I'm not familiar with that setting. Where does it live? http://cvs.apache.org/viewcvs.cgi/cocoon-2.1/src/webapp/WEB-INF/web.xml?annotate=1.19#350 Joerg
Re: UTF-8 and Encoding Problems
I'm not familiar with that setting. Where does it live? -Christopher Joerg Heinicke <[EMAIL PROTECTED]> 06/26/2004 10:27 AM Please respond to users To: [EMAIL PROTECTED] cc: Subject: Re: UTF-8 and Encoding Problems On 23.06.2004 23:44, Christopher Painter-Wakefield wrote: > Are you using Tomcat? If you do some searches, you'll probably turn up > other postings on this topic. I can't remember all the ins & outs, but > supposedly the browsers incorrectly supply encoding information in their > requests to Tomcat (ours were POST requests), and Tomcat by default assumes > ISO-8859-1 encoding for the submitted form data. This gives you garbage > data for anything outside plain ASCII, if your browser sends it in UTF-8. > I found some webapp filter class that works with Tomcat to coerce the > character encoding (or Tomcat's perception of the encoding) for all > requests to UTF-8, to match all of our pages and forms. I can send you our > filter and the web.xml entries separately; if you want them, just e-mail > me. There may be better solutions now with Tomcat 5, but we have just kept > on using this old filter, and it seems to do the trick. > > (Now that I think about it, I think this filter is/was supplied with the > Tomcat source distribution, maybe. Look for the SetCharacterEncodingFilter > class.) Wouldn't setting 'form-encoding' to UTF-8 do the same? Joerg - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: UTF-8 and Encoding Problems
Are you using Tomcat? If you do some searches, you'll probably turn up other postings on this topic. I can't remember all the ins & outs, but supposedly the browsers incorrectly supply encoding information in their requests to Tomcat (ours were POST requests), and Tomcat by default assumes ISO-8859-1 encoding for the submitted form data. This gives you garbage data for anything outside plain ASCII, if your browser sends it in UTF-8. I found some webapp filter class that works with Tomcat to coerce the character encoding (or Tomcat's perception of the encoding) for all requests to UTF-8, to match all of our pages and forms. I can send you our filter and the web.xml entries separately; if you want them, just e-mail me. There may be better solutions now with Tomcat 5, but we have just kept on using this old filter, and it seems to do the trick. (Now that I think about it, I think this filter is/was supplied with the Tomcat source distribution, maybe. Look for the SetCharacterEncodingFilter class.) -Christopher |-+> | | "Kist, Paul" | | | <[EMAIL PROTECTED]| | | com> | | || | | 06/23/2004 04:03 | | | PM | | | Please respond to| | | users| | || |-+> >--| | | | To: "'[EMAIL PROTECTED]'" <[EMAIL PROTECTED]> | | cc: | | Subject: UTF-8 and Encoding Problems | >--| Here's one I haven't seen before: I have an HTML form with the following input tag: The ’ is supposed to translate to this form of the single quote: ' However this string is being stored in the database, as well as the object bean, with jumbled up characters. Somewhere in the submit, the integrity of this character is being lost. I made some debug statements in the flowscript that handles the submit and this is the value of that radio button if it is selected: "PatientΓ??s Page" I tried also changing the ’ to the actual character itself, and the hex representation, but the same result happens.Has anyone seen anything like this and would know what is happening? -Paul -- Notice: This e-mail message, together with any attachments, contains information of Merck & Co., Inc. (One Merck Drive, Whitehouse Station, New Jersey, USA 08889), and/or its affiliates (which may be known outside the United States as Merck Frosst, Merck Sharp & Dohme or MSD and in Japan, as Banyu) that may be confidential, proprietary copyrighted and/or legally privileged. It is intended solely for the use of the individual or entity named on this message. If you are not the intended recipient, and have received this message in error, please notify us immediately by reply e-mail and then delete it from your system. -- - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Users history for session
We do something like this to create a "cookie crumb trail" through our application. Ours isn't a complete history, but instead a Stack that is truncated whenever the user re-visits a page already in the list. Anyway, we basically just keep a Stack variable with the request URIs in a session attribute, as you suggest. -Christopher |-+> | | "Craig | | | Christophersen" | | | <[EMAIL PROTECTED]| | | .com>| | || | | 06/23/2004 05:04 | | | PM | | | Please respond to| | | users| | || |-+> >--| | | | To: <[EMAIL PROTECTED]> | | cc: | | Subject: Users history for session | >--| I am tasked with making a way for a user to bring up a history of their use for a session such that they can link from it to any document they have viewed. Any direction on how to accomplish this? I cannot use cookies. Should I store each request uri as a session attribute? Craig Christophersen (406)496-6421 [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Edit xsp files in Eclipse with sunBow
Anthony, I am able to use this schema just fine with eclipse. At least, I get the content assistance when I start to type a tag like " | | anthony_herve| | | <[EMAIL PROTECTED]| | | eelance.fr> | | || | | 06/16/2004 08:37 AM | | | Please respond to users | | || |-+> >--| | | | To: [EMAIL PROTECTED] | | cc: | | Subject: Edit xsp files in Eclipse with sunBow | >--| Hello, I am trying to edit xsp files in Eclipse using the sunBow plugin. I have added in Window/Preferences/sunBow/XML Editor, in the Content-Assistant Schema Associations frame, the xsp file extension. For this file extension, I have configured an associated schema : - Namespace-Prefix : xsp - Schema : /home/ahe/Downloadedprograms/xsp.xsd Hereafter is the content of this xsd file : -- http://apache.org/xsp"; xmlns="http://apache.org/xsp";> -- I have then restarted Eclipse. When I open a xsp file, the xsp content is still not "recognized". Does someone know how to fix this ? Is sunBow relevant for xsp edition ? Thanks for your help. Regards. Anthony Hervé - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: dynamic query help
off the top of my head, start with this (easiest) to get it working. If it performs well, you can leave it like this, but for better performance take a look at http://cocoon.apache.org/2.1/userdocs/xsp/esql.html#Groups which will let you use a single join query to accomplish your goal. ... select id, area from ukareas order by area select county from county, navmap where navmap.cid = county.id and aid= order by county -Christopher |-+> | | Jason Lane | | | <[EMAIL PROTECTED]| | | >| | || | | 06/01/2004 09:51 | | | AM | | | Please respond to| | | users| | || |-+> >--| | | | To: [EMAIL PROTECTED] | | cc: | | Subject: dynamic query help | >--| Hi list, I have this ESQL query to my DB: select id, area from ukareas order by area This just returns the column rows "ID" and "AREA" I also have this table which maps tables ukareas and county create table navmap ( aid integer, cid integer, primary key (aid,cid), foreign key (id) references ukareas(id), foreign key (id) references county(id) ); I then have this query: select county from county, navmap where navmap.cid = county.id and aid= 'X ' order by county Where 'X' is the result of ukareas.id column, so essentially I'd like to do something like for (int i = 0; i < id.length; i++) { //where id = ukareas.id select county from county, navmap where navmap.cid = county.id and aid= 'id[i]' order by county } essentially I'd be outputing something like: South - East Surrey, Kent, etc... Anglia Norfolk, Suffolk, etc... I have a very, very rough idea of how I could do this but need some pointers. Many thanks all. Jason - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
C2.1.5 - build.sh bug
There is a bug in the build.sh build script. Sorry if this has been covered before; this is my first build of a 2.1.x system. The build.sh uses /bin/sh, which on Solaris and other traditional *nix is typically Bourne shell. The build.sh is not compatible with Bourne shell, however. I didn't check it for all errors, but the line export ANT_HOME=tools breaks Bourne shell. The correct syntax is ANT_HOME=tools export ANT_HOME Perhaps the INSTALL.txt should mention this, and some workarounds? I simply changed the build.sh to use /bin/bash, which works on my system. -Christopher - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Extending ESQL - how (if at all)
There are a couple of ways I think are easier to extend ESQL. In particular, I think it is useful to have all of your extensions in a separate place, outside the jar file. Otherwise, it is easy to lose track of the changes you have made. So one option is to bring the esql.xsl outside the jar, and change cocoon.xconf to point to the new location (I assume that it still works this way in 2.1, I am still using 2.0.x). To take it one step better, create your own stylesheet that contains your single template, and use to import the esql.xsl. Again, change cocoon.xconf to use your stylesheet. If you start getting a lot of these, you might consider creating a "wrapper" logicsheet. In essence you create a stylesheet with your own namespace, like "jeff.sql". The logicsheet defines or redefines templates as needed, and simply creates ESQL tags to re-use the esql functionality. You can have one template that merely passes forward to ESQL any tags that your logicsheet doesn't explicitly redefine. This has advantages and disadvantages; one disadvantage is that you have to copy over any named templates from ESQL that you need to make your custom templates work, e.g., "get-nested-string". In your case, you are using a couple of named templates, but I wonder if you could do a wrapper template like: ().getTime() I don't have the esql.xsl right in front of me, so I don't know if this works or not. If not, maybe ((java.sql.Timestamp)()).getTime(). You have to get a bit creative We have a logicsheet like this, that gives us various extended features. For instance, it handles all of the connection pool stuff, so that I don't have that explicitly in each of my XSP pages. I also used it to get a "short form" for update queries, e.g., update blah set blah = blah; and it does other stuff, too. If you are interested in this, here's a skeleton: xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xsp="http://apache.org/xsp" xmlns:esql="http://apache.org/cocoon/SQL/v2" xmlns:jeff.sql="http://jeff.org/jeff/sql" version="1.0" > match="@*|node()" priority="-1"> select="@*|node()"/> match="jeff.sql:*" priority="-0.9"> name="esql:{local-name()}"> select="@*|node()"/> "Jeff Jones" <[EMAIL PROTECTED]> 05/13/2004 03:25 PM Please respond to users To: <[EMAIL PROTECTED]> cc: Subject: Extending ESQL - how (if at all) Hello all. I'd like to use XSP/ESQL to retrieve a date from a database (might be Oracle or MySQL) in "Unix epoch" format, i.e. milliseconds since 1/1/1970. Unfortunately, that's not a format available in java.text.SimpleDateFormat, so it doesn't seem possible to retrieve it using the tag. I know that this could be done with a separate XSL transform, but for performance reasons, I'd prefer not to have to convert back to a Date object and then back to a String representation; I'd like to work with the Date object (actually java.sql.Timestamp) retrieved from the database. So I've tried adding this to esql.xsl: returns the value of the given column as milliseconds since the epoch. ="esql:row-results//esql:get-epoch|esql:call-results//esql:get-epoch"> .getTimestamp ().getTime() And here's the part of my XSP that uses the new tag: A few questions: 1. Apparently I'm missing a step somewhere, because I'm just getting the tag passed straight through when the pipeline runs. (Yes, everything else works.) I've restarted Tomcat, rebuilt the databases block, and copied the new databases-block.jar into WEB-INF/lib, to no avail. What do I need to do to get this change reflected in running code? 2. Am I doing this the hard way? Is there an easier solution that I'm missing? (Remember that I really don't want to do it in a separate transform, for performance reasons.) 3. If this actually is a worthwhile idea, how would I go about submitting it? (Details: Cocoon 2.1.4, Tomcat 4.1.29, Sun Java 1.4.2-b28 on SuSE Linux 9.0, kernel 2.4.21.) Thanks in advance for any help.
Re: Dynamic connection to the database
What are you using: ESQL, SQLTransformer, ...? For ESQL at least, and I imagine for SQL Transformer, you don't have to use a pool connection. You can dynamically provide the jdbc connection parameters. The downside is that you make a new connection on every request (unlike a traditional client-server application where your login session is maintained from page to page). Also, you have to maintain db accounts for everyone who needs to log in. We had a similar need in our application. I did an extension to ESQL that uses a java SQL parser to take apart each query, and rewrite it to add in the auditing information (after looking to see if the tables in question have the auditing fields), using the web app login name instead of a separate Oracle account. That way we can continue to use the pool connection. This was the hard way, but it does the job. -Christopher |-+---> | | Yves Vindevogel | | | <[EMAIL PROTECTED]| | | lements.be> | | | | | | 05/05/2004 05:37 AM | | | Please respond to | | | users | | | | |-+---> >--| | | | To: [EMAIL PROTECTED] | | cc: | | Subject: Dynamic connection to the database | >--| Hi, I need to keep track of who changes records in my database (I use postgres). I would like to make a connection to my database BUT always with a different username / password. In my config file, this is a fixed thing. Is there a way to do this ? Met vriendelijke groeten, Bien à vous, Kind regards, Yves Vindevogel Implements - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: document() in xsl:variable -> low performance
Thanks for all the input. Now to find a way to rework my code -Christopher Joerg Heinicke <[EMAIL PROTECTED]> 05/04/2004 04:04 AM Please respond to users To: [EMAIL PROTECTED] cc: Subject: Re: document() in xsl:variable -> low performance On 04.05.2004 03:37, Corin Moss wrote: > Hi There, > > I've not been following this thread as closely as I might, so someone might have already mentioned this: > > If you use a string() function on your document value as below: > > > > Then you will forevermore be accessing only the value, not the entire document :) > > Some might say it's a little hacky, but it is a simple fix which works. No, it's absolutely a good fix/work around. The explicite cast to string avoids the overhead of the RTF, especially because a RTF can only be used as string, not as node set: http://marc.theaimsgroup.com/?l=xml-cocoon-users&m=108360536625037&w=4 Joerg
Re: Vote: to unify, or not to unify
> [I don't want to barge in on things here or step on anybody's toes. My > intention is only to get some direction so I can help contribute to the > Cocoon documentation. Although I am a relative newbie any my Cocoon skills > are 1/1000th of the vets lingering around on this list, I think that's > exactly what qualifies me to help contribute to the user documentation.] I agree. I wrote docs when I was relatively new to Cocoon, which helped me learn more about Cocoon and the topics I was documenting, and let me write docs from the point of view of someone who didn't already understand all of the internals. We should encourage this! In the absence of a fourth choice, I'll vote for "C". My suggestion is, if you want to help out by writing documentation, write it on the topics that confuse(d) you. If enough folks did this, we'd have all the bases covered, and the consensus approach would emerge automatically. In an ideal world -Christopher
Re: AW: document() in xsl:variable -> low performance
> Sorry, if I'm not the first one asking, but is it possible to get these > lines out of your responses? Only if I copy your text manually, as I've done here. Sorry. Lotus Notes. -Christopher - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Better alternative to ESQL?
FWIW, that conversation did not include everyone using Cocoon and/or reading the list. It may be that the folks joining in the conversation were those with similar approaches. My attitude is the best tool for the job is the one that meets your needs. Since many of the tools recently mentioned were not available 1-2 years ago, we developed a lot of our own designs to tackle the same sorts of problems in our environment. We make heavy use of XSP, logicsheets, and ESQL. At this point our designs are pretty mature and, of course, are a custom fit for our needs. If you have established software that is working, you probably have a good idea where the most "pain" is - where the code is difficult to modify and extend, where you spend the most time, etc. Or you may be adding new features with very different requirements than before. In these cases, it is probably worth examining the new tools to see if they offer a solution to your particular problems. Otherwise, if it ain't broke In our case, I am interested in some of the tools that help with forms and form validation, which is an area we are very weak on, so I may examine these in the future. However, on site navigation, layouting, etc., I feel our designs are working very well, so I probably won't look for something else. Here's my vote for XSP: it is general-purpose, powerful, flexible, and extensible (with all of Java available to you). It doesn't solve a specific problem, but it can be used to solve almost any problem. -Christopher |-+> | | "Derek Hohls"| | | <[EMAIL PROTECTED]| | | a> | | || | | 05/03/2004 07:28 | | | AM | | | Please respond to| | | users| | || |-+> >--| | | | To: <[EMAIL PROTECTED]> | | cc: | | Subject: Better alternative to ESQL? | >--| There seems to be a very a strong "current of opinion" on the list at present (April 2004) saying that XSP is not really a suitable component of a "well archictectured" Cocoon application. My major use of it has been in the development of complex database reporting systems; using ESQL for the bulk of the work and adding in Java code to do any necessary non-SQL calculations. If the use of XSP (and, therefore, I assume, ESQL) is not espoused any longer, what is the "equivalent but better" methodology for tackling this type of work, and where is/are the corresponding examples/docs on the Cocoon sites? Thanks Derek PS Yes, I have looked at XReporter... - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: AW: document() in xsl:variable -> low performance
I read a little further on the bug reports, but I didn't understand everything. Does this only happen when using a custom URI such as "cocoon:/"? I'm wondering how difficult it would be to patch this in Xalan. Knowing nothing about it, of course, it is easy to assume it is easy. -Christopher |-+> | | "Nils" | | | <[EMAIL PROTECTED]| | | li.de> | | || | | 05/03/2004 10:33 | | | AM | | | Please respond to| | | users| | || |-+> >--| | | | To: <[EMAIL PROTECTED]> | | cc: | | Subject: AW: document() in xsl:variable -> low performance | >--| I tried a lot possibilities but I always get the same slow result. I tried to set $temp_lang with document() and to set $lang with $set_lang, same result. I'm right now restructuring my webpage :-((( Regards, Nils > -Ursprüngliche Nachricht- > Von: Christopher Painter-Wakefield [mailto:[EMAIL PROTECTED] > Gesendet: Montag, 3. Mai 2004 16:26 > An: [EMAIL PROTECTED] > Betreff: Re: document() in xsl:variable -> low performance > > > > > > > Ouch! I make heavy use of the document() function for > aggregation. Sitemap aggregation would be a pain to maintain, > because the stuff I need to aggregate comes rather late in > the pipeline (layout information), whereas the generation and > early transformation steps can vary a lot. XInclude/CInclude > could work, but I like the cleanness and flexibility of using > the document() function. > > Does it help any to take another variable on some subtree of > the variable? > > Does it make a difference if you use xsltc? > > -Christopher > > > > > |-+> > | | Joerg Heinicke | > | | <[EMAIL PROTECTED]| > | | mx.de> | > | || > | | 05/02/2004 05:50 | > | | PM | > | | Please respond to| > | | users| > | || > |-+> > > >- > -| > | >| > | To: [EMAIL PROTECTED] >| > | cc: >| > | Subject: Re: document() in xsl:variable -> low > performance| > > >- > -| > > > > > On 02.05.2004 23:37, Nils wrote: > > > Hello, > > > > In a stylesheet, I have this in the first line, outside of any > > template: > > > > > select="document('cocoon:/getxml')/context/lang"/> > > > > In the templates of this xsl I use the variable $lang about > 40 times. > > The procession of this stylesheet is very slow. > > > > When I reduce the use of the variable $lang to one or none, > it's very > fast. > > When I use "en" (without quotes) instead of > select="document('cocoon:/getxml')/context/lang"/> it's > very fast, as > well. > > > > --> Does that mean, that everytime I use $lang cocoon executes > > document('cocoon:/getxml') ?? > > Yes, that's a "feature" of Xalan. > http://issues.apache.org/bugzilla/show_bug.cgi?id=2425 > http://issues.apache.org/bugzilla/show_bug.cgi?id=4257 > > > --> How can I avoid that? > > Don't use document(). Include the document in the sitemap by > using sitemap aggregation (if it is a fixed number of
Re: document() in xsl:variable -> low performance
Ouch! I make heavy use of the document() function for aggregation. Sitemap aggregation would be a pain to maintain, because the stuff I need to aggregate comes rather late in the pipeline (layout information), whereas the generation and early transformation steps can vary a lot. XInclude/CInclude could work, but I like the cleanness and flexibility of using the document() function. Does it help any to take another variable on some subtree of the variable? Does it make a difference if you use xsltc? -Christopher |-+> | | Joerg Heinicke | | | <[EMAIL PROTECTED]| | | mx.de> | | || | | 05/02/2004 05:50 | | | PM | | | Please respond to| | | users| | || |-+> >--| | | | To: [EMAIL PROTECTED] | | cc: | | Subject: Re: document() in xsl:variable -> low performance | >--| On 02.05.2004 23:37, Nils wrote: > Hello, > > In a stylesheet, I have this in the first line, outside of any template: > > select="document('cocoon:/getxml')/context/lang"/> > > In the templates of this xsl I use the variable $lang about 40 times. The > procession of this stylesheet is very slow. > > When I reduce the use of the variable $lang to one or none, it's very fast. > When I use "en" (without quotes) instead of select="document('cocoon:/getxml')/context/lang"/> it's very fast, as well. > > --> Does that mean, that everytime I use $lang cocoon executes > document('cocoon:/getxml') ?? Yes, that's a "feature" of Xalan. http://issues.apache.org/bugzilla/show_bug.cgi?id=2425 http://issues.apache.org/bugzilla/show_bug.cgi?id=4257 > --> How can I avoid that? Don't use document(). Include the document in the sitemap by using sitemap aggregation (if it is a fixed number of known files) or x/cinclude. Joerg - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: xsp and selected option: HELP
Are you just trying to retain the selected option if there is an error on a different part of the form? I think you need to change this line: to instead be if (().equals()) { selected } -Christopher |-+> | | Jason Lane | | | <[EMAIL PROTECTED]| | | >| | || | | 04/30/2004 08:41 | | | AM | | | Please respond to| | | users| | || |-+> >--| | | | To: [EMAIL PROTECTED] | | cc: | | Subject: xsp and selected option: HELP | >--| HI list, I'm using XSP, ESQL/SQL and simple forms I guess, the problem is this, I have some select lists and I want to pass the "selected" attribute to the one the user selects: one two three In my site map I have: And my XSP : Please select select id, code from pcodeareas order by code I'm guessing that I could do this with a logic sheet? Or should I move this to woody / cforms? Many thanks all. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Deal with variable page content??????????????
I don't know which Cocoon technologies you are currently using, but this hsould be fairly straightforward in Java (using XSP). You can ask the request for a list of all parameters, and iterate through the list and take the appropriate actions. If you need help getting started with XSP, there is some good documentation on the Cocoon site. -Christopher |-+> | | "lechael"| | | <[EMAIL PROTECTED]| | | il.com> | | || | | 04/23/2004 02:14 | | | PM | | | Please respond to| | | users| | || |-+> >--| | | | To: <[EMAIL PROTECTED]> | | cc: | | Subject: Deal with variable page content?? | >--| Basically content of the page is generalized from the database. There are variable number of user inputs. Each input can be -textfields, radio, select list etc. Names of these inputs are inquired from database, and transformed by a xstl because I know all possible names of them. But I find it is difficult to retrieve these input because I don't know how many there are and what they are from the submitted page. Would anybody give me some idea Many thanks!!! - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: XSP and logicsheets namespaces inclusions
Olivier, we are using C2.0.3, and struggled with this problem for over a year. We have created many logicsheets, many of them using each other, and this problem was frequent and frustrating. The problem seems to be caused by some kind of race condition, and we learned we could reproduce it reliably by hitting the same (uncompiled) page twice quickly, i.e., the second request before the compilation is complete. The fix for us turned out to be a cocoon.xconf setting which was recently discussed on the list as buggy. :( The setting is the use-store setting for the xslt-processor. Apparently setting this to true improves performance, but is known to be buggy. Well, setting it to false fixed the bug for us. Please let me know if this works for you. - Christopher |-+> | | Olivier Billard | | | <[EMAIL PROTECTED]| | | r> | | | Sent by: news| | | <[EMAIL PROTECTED]| | | rg> | | || | || | | 04/20/2004 09:49 | | | AM | | | Please respond to| | | users| | || |-+> >--| | | | To: [EMAIL PROTECTED] | | cc: | | Subject: XSP and logicsheets namespaces inclusions | >--| Hi again, I have an XSP that includes some logicsheets. Some of these logicsheets also includes a logicsheet (xsp-request for example). But some times (10% of the time) after a restart of the server, a compilation error occurs, caused by the xsp-request logicsheet not beeing translated, and elements appearing in the java source of the XSP. Most of the time, the XSP compiles without any problem. What could be the problem ? Is it bad to use a logicsheet in another ? Is there a special order in declaring logicsheets namespaces ? Thanks, -- Olivier Billard - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: ESQl and Stored Procedures
Carlos, just for background, can you do a simple select or update query using ESQL? I ask only because you aren't getting a compile error, which you would normally expect when an appropriate class isn't available. What this reminds me of is what happens when the Oracle jdbc classes aren't loaded in the web application. The JDBC stuff (through some sort of black magic I don't know a lot about) figures out which class to load based on your db url and then goes to load it. Maybe that is where the error is coming from. If so, then you shouldn't be able to do a simple query either. If that is the case, then you need this section in your web.xml file: load-class oracle.jdbc.driver.OracleDriver I guess another possibility (which would also prevent simple queries) is if your pool is not set up correctly, e.g., it has an incorrect db url. If you are able to do simple queries, then it may be something more specific to doing a stored procedure call, which unfortunately I have no experience with (through ESQL, anyway). -Christopher |-+> | | "Carlos Dias"| | | <[EMAIL PROTECTED]>| | || | | 04/15/2004 02:12 | | | PM | | | Please respond to| | | users| | || |-+> >--| | | | To: <[EMAIL PROTECTED]> | | cc: | | Subject: ESQl and Stored Procedures | >--| Hi, I'm trying to use a stored procedure for making an update in an Oracle database. Here is the xsp+esql code: http://apache.org/xsp"; xmlns:xsp-request="http://apache.org/xsp/request/2.0"; xmlns:esql="http://apache.org/cocoon/SQL/v2";> java.lang.String sca String app_id = request.getParameter("app_id"); String user_id = request.getParameter("user_id"); if (app_id != null || user_id != null) { {call bookmark.update_bookmark_list(\ user_id,\ \ app_id)} } else { Parameters does not exists } I got the following result (in the web page): XML document must have a top level element. Error processing resource 'http://rasputin:9090/adslV3/cubenavigator/update_bookmark'. In the error.log: [core.program-generator] (/adslV3/cubenavigator/update_bookmark) http9090-Processor7/ProgramGeneratorImpl: The serverpage [file:/home/cdias/altaia/tomcat/webapps/adslV3/cubenavigator/generators/dynamic/xsp/update_bookmark_list.xsp] could not be preloaded, will be re-created (org.apache.cocoon.components.language.LanguageException: Unable to preload program org/apache/cocoon/www/cubenavigator/generators/dynamic/xsp/update_bookmark_list_xsp: org.apache.cocoon.components.language.LanguageException: Could not load class for program 'org/apache/cocoon/www/cubenavigator/generators/dynamic/xsp/update_bookmark_list_xsp' due to a java.lang.ClassNotFoundException: org.apache.cocoon.www.cubenavigator.generators.dynamic.xsp.update_bookmark_list_xsp) Can anybody tell me what's going on?! Thanks in advance, Carlos Dias - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: ESQl and Stored Procedures
No, the way he is using here is just fine. -Christopher |-+> | | Leon Widdershoven| | | <[EMAIL PROTECTED]> | | || | | 04/15/2004 02:14 | | | PM | | | Please respond to| | | users| | || |-+> >--| | | | To: [EMAIL PROTECTED] | | cc: | | Subject: Re: ESQl and Stored Procedures | >--| Could it be that the embedded in the block is the culprit? I read somwhere that that is not a wise combination. (which is logical as in an xsp:logic you don't need an xsp:expr). Please note: I did not try this, and have never used the esql:call. But it seems that all tags are closed - so this might just be it. You could in stead prepare all your calls in advance in a logic block and call on those strings when needed - outside of the logic block with . Just my 0.02c (and that's not much). Leon arlos Dias wrote: > Hi, > I'm trying to use a stored procedure for making an update in an Oracle > database. > Here is the xsp+esql code: > > > language="java" > xmlns:xsp="http://apache.org/xsp"; > xmlns:xsp-request="http://apache.org/xsp/request/2.0"; > xmlns:esql="http://apache.org/cocoon/SQL/v2";> > > > java.lang.String > > > > >sca > > > String app_id = request.getParameter("app_id"); > String user_id = request.getParameter("user_id"); > if (app_id != null || user_id != null) { > > > {call bookmark.update_bookmark_list( direction="in" type="String">\ >user_id,\ >\ >app_id)} > > > > > > > } > else { > Parameters does not exists > } > > > > > > > I got the following result (in the web page): > > XML document must have a top level element. Error processing resource > 'http://rasputin:9090/adslV3/cubenavigator/update_bookmark'. > > > In the error.log: > [core.program-generator] (/adslV3/cubenavigator/update_bookmark) > http9090-Processor7/ProgramGeneratorImpl: The serverpage > [file:/home/cdias/altaia/tomcat/webapps/adslV3/cubenavigator/generators/dynamic/xsp/update_bookmark_list.xsp] > could not be preloaded, will be re-created > (org.apache.cocoon.components.language.LanguageException: Unable to > preload program > org/apache/cocoon/www/cubenavigator/generators/dynamic/xsp/update_bookmark_list_xsp: > org.apache.cocoon.components.language.LanguageException: Could not > load class for program > 'org/apache/cocoon/www/cubenavigator/generators/dynamic/xsp/update_bookmark_list_xsp' > due to a java.lang.ClassNotFoundException: > org.apache.cocoon.www.cubenavigator.generators.dynamic.xsp.update_bookmark_list_xsp) > > Can anybody tell me what's going on?! > > Thanks in advance, > Carlos Dias - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Including Fragments
In general, all the XML tools require well-formed XML, even for fragments. The only way around it is to work in java, concatenating strings, and then running the whole string through the XML parser, which is silly to do without a pretty specific need. It would be a lot easier to use XSLT for this, and keep your headers & footers together for well-formedness. There are a zillion different approaches. Here's one: file:/static/test.body.xml The Body file:/static/test.layout.xsl http://www.w3.org/1999/XSL/Transform"; version="1.0"> -Christopher |-+> | | Garrick Dasbach | | | <[EMAIL PROTECTED]| | | ellion.com> | | || | | 04/14/2004 12:08 | | | PM | | | Please respond to| | | users| | || |-+> >--| | | | To: [EMAIL PROTECTED] | | cc: | | Subject: Including Fragments | >--| Hi, We are currently migrating our website from a pure JSP environment to Cocoon and have run into a problem. The majority of our webpages have a header and footer, both of which are fragments of xhtml documents, that we would like to include on each page. We have tried using the CInclude transformer to include these elements, but cocoon seems to be upset that the files are not well formed (see error message below). org.apache.cocoon.ProcessingException: Failed to execute pipeline.: file:/static/headerTest.html:6:1:org.xml.sax.SAXParseException: XML document structures must start and end within the same entity. We have also tried the XInclude transformer without success. Is there a way to include fragments of XHTML/XML documents in larger documents to create one well-formed document? I have included some sample code below. file:/static/test.html http://apache.org/cocoon/include/1.0";> The Body file:/static/headerTest.html file:/static/footerTest.html - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Sql type for request parameter with multiple values
I doubt it. If you are doing this using SQL actions or the like, you'll probably have to write your own action to do the conversion. Otherwise, consider using XSP+ESQL or XSP+SQL Transformer. However you cut it, it looks like you'll have to write some Java code. -Christopher |-+> | | "Carlos Dias"| | | <[EMAIL PROTECTED]>| | || | | 04/13/2004 02:26 | | | PM | | | Please respond to| | | users| | || |-+> >--| | | | To: <[EMAIL PROTECTED]> | | cc: | | Subject: Re: Sql type for request parameter with multiple values | >--| Thanks Christopher for the answer, but how can I convert the parameter enumeration to an array inside the sitemap?! Can I use the RequestParamAction action?! Thanks in advance, Carlos Dias ----- Original Message - From: "Christopher Painter-Wakefield" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Wednesday, April 07, 2004 8:03 PM Subject: Re: Sql type for request parameter with multiple values > > > > > I think you'll have to convert the request parameter enumeration to an > array, and then you should be able to use jdbc's setArray() > (...). But I've never tried this, so YMMV. > > -Christopher > > > > > |-+> > | | "Carlos Dias"| > | | <[EMAIL PROTECTED]>| > | || > | | 04/07/2004 01:07 | > | | PM | > | | Please respond to| > | | users| > | || > |-+> > >--- ---| > | | > | To: <[EMAIL PROTECTED]> | > | cc: | > | Subject: Sql type for request parameter with multiple values | > >--- ---| > > > > > Hi, > Here is my problem: > I want to pass a request parameter to an SQL Statement, but my problem is > that this parameter contains more that one value. > I want to know what is the sql type to use (the database is Oracle) in this > case. Can I use the ARRAY type?! > > Thanks in advance, > Carlos Dias > > > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Sql type for request parameter with multiple values
I think you'll have to convert the request parameter enumeration to an array, and then you should be able to use jdbc's setArray() (...). But I've never tried this, so YMMV. -Christopher |-+> | | "Carlos Dias"| | | <[EMAIL PROTECTED]>| | || | | 04/07/2004 01:07 | | | PM | | | Please respond to| | | users| | || |-+> >--| | | | To: <[EMAIL PROTECTED]> | | cc: | | Subject: Sql type for request parameter with multiple values | >--| Hi, Here is my problem: I want to pass a request parameter to an SQL Statement, but my problem is that this parameter contains more that one value. I want to know what is the sql type to use (the database is Oracle) in this case. Can I use the ARRAY type?! Thanks in advance, Carlos Dias - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: AW: HTML-Code from XML-File in XSL
Ah, you are having an XSL problem. If you look at what xsl:value-of does, it turns things into strings. What you want is to copy the contents, which can be done many different ways. In your immediate case, you can do in place of your value-of, and you should get better results. -Christopher |-+> | | Nils Köster | | | <[EMAIL PROTECTED]> | | || | | 04/05/2004 01:30 | | | PM | | | Please respond to| | | users| | || |-+> >--| | | | To: <[EMAIL PROTECTED]> | | cc: | | Subject: AW: HTML-Code from XML-File in XSL | >--| Upps, I tink my question was a little confusing, sorry about that! I have: + xml-file: TEXT TEXT TEXT http://somewhere";>LINK + xsl-template + Pipeline: 1. Generate XML 2. transform XSL 3. serialize HTML My output up to now is: TEXT TEXT TEXT LINK I dream of: TEXT TEXT TEXT http://somewhere";>LINK Can anyone give me a hint on how to achieve this? Thanx,nils - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Nils Köster - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Conditionnal esql-query ?
Because you can't :) Keep in mind what is really happening here. The ESQL logicsheet is turning all of this into java code. What kind of java code probably happens with the esql:query tag? Well, it probably needs to obtain a String which it can then pass into JDBC as the query, righ?. Now, try this in java: String query = if (...) { ... } else { ... } See the problem? However, the problem suggests the solution. You CAN do it, but only if you make your if/else into an expression, using the question mark operator, e.g., (id_blog_news == null) ? ... : ... Better, though is to just pull the entire query and if/else block outside the esql code, e.g., String sql; if (id_blog_news == null) { sql = "SELECT ."; } else { sql = } then you can do sql You can also put your if-else around the entire esql:execute-query block, that is, you can have one esql:connection around all of your individual queries, for what small savings in code that is. Finally, though, keep in mind that your dynamic SQL code potentially provides opportunities for hackers to modify your SQL in ways you did not intend by what they supply in the request parameters. So you might be better off going back to your first code that does an if/else around the whole SQL block, and using instead of inlining SQL using . -Christopher |-+> | | olivier demah| | | <[EMAIL PROTECTED]| | | com> | | || | | 04/05/2004 10:53 | | | AM | | | Please respond to| | | users| | || |-+> >--| | | | To: [EMAIL PROTECTED] | | cc: | | Subject: Conditionnal esql-query ? | >--| this one is not ok : String id_blog_user = request.getParameter("id_blog_user"); String id_blog_news = request.getParameter("id_blog_news"); if ( id_blog_user == null) { id_blog_user = ; } mblog_pg if (id_blog_news == null) { SELECT * FROM blog_news WHERE blog_news.id_blog_user = 'id_blog_user' } else { SELECT * FROM blog_news WHERE blog_news.id_blog_user = 'id_blog_user' AND id_blog_news = 'id_blog_news' } but why cant i just do a simple if just on the esql-query part ? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: HTML-Code from XML-File in XSL
What serializer are you using? If you use the default (html) serializer, the browser will display the html elements. If you use the xml serializer, you will see XML code in most browsers. -Christopher |-+> | | Nils Köster | | | <[EMAIL PROTECTED]> | | || | | 04/05/2004 06:15 | | | AM | | | Please respond to| | | users| | || |-+> >--| | | | To: <[EMAIL PROTECTED]> | | cc: | | Subject: HTML-Code from XML-File in XSL | >--| Hi, How can i generate and transform xml via xsl with displaying HTML-Code out of the XML properly in the browser. Actually it displays the html-code in the xml-file as source-code (escaped) in the Browser. Thanx, nils - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Nils Köster - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Xsl layout problem
Nicole, Try Callnumber: Displayname: Conferenze: and instead of use Some folks on this list will gripe at you if you post non-Cocoon-specific XSL questions, so you might want to try the Mulberry Tech XSL list for future inquiries: http://www.mulberrytech.com/xsl/xsl-list/ -Christopher |-+-> | | "Seyfritz Nicole | | | (MPI/ADB)"| | | <[EMAIL PROTECTED]| | | enovis.com> | | | | | | 04/05/2004 06:06 | | | AM| | | Please respond to | | | users | | | | |-+-> >--| | | | To: <[EMAIL PROTECTED]> | | cc: | | Subject: Xsl layout problem | >--| Hello, i have a problem with line breaks in xsl. first a part of my xml file: Callnumber: Displayname: Conferenze: and a prt of my xsl file: i want to have a line break after callnumber: , after Displayname and after Conference. But Callnumber,Dispalyname and Conferenze must be in one tag. How can i get there line breaks? thanks nicole seyfritz - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: XHTML/XSLT issue
:) Not sure how that happened, sorry! I wonder where those crept in from? You could try adding this template, although I am dubious it will work: and modify to Another possibility is that namespaces are getting attached to the attributes, although I've never seen it happen. In that case, you could replace ... with FWIW, I don't think the namespace declarations affect behavior on any of the common browsers. -Christopher Christopher, in all intents and purposes, the code you sent works, but there are a few instances where I am left with the following: i.e. an xmlns="" Anything we can do about those? Peter On 2 Apr 2004, at 17:23, Christopher Painter-Wakefield wrote: > > > > > I think maybe you are missing the context for the code that was > supplied. > It looks to me as if it was intended to be used within another > stylesheet > (e.g., "priority='-1'"). Here is a complete stylesheet that should > work if > you apply it as a separate transform (I tested it briefly): > > -cleanup.xsl--- > >xmlns:xsl="http://www.w3.org/1999/XSL/Transform"; > version="1.0" >> > > > > > > > > > > > > > --- > > If you want to not lose comments and that sort of thing, you may need > to > add templates, but this will copy everything that counts. > > -Christopher > > > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: XHTML/XSLT issue
I think maybe you are missing the context for the code that was supplied. It looks to me as if it was intended to be used within another stylesheet (e.g., "priority='-1'"). Here is a complete stylesheet that should work if you apply it as a separate transform (I tested it briefly): -cleanup.xsl--- http://www.w3.org/1999/XSL/Transform"; version="1.0" > --- If you want to not lose comments and that sort of thing, you may need to add templates, but this will copy everything that counts. -Christopher |-+> | | beyaNet | | | Consultancy | | | <[EMAIL PROTECTED]| | | .com>| | || | | 04/02/2004 11:08 | | | AM | | | Please respond to| | | users| | || |-+> >--| | | | To: [EMAIL PROTECTED] | | cc: | | Subject: Re: XHTML/XSLT issue | >--| Ugo, the code you sent even strips out all of the html and leaves only the values passed into the xslt page! All I want is to be able to strip out the xml code that appears within the html tags ;-) what do I need to do? Peter On 2 Apr 2004, at 15:54, Ugo Cei wrote: > > > > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
sitemap resources (was: Cocoon chapters for download)
This may be off-topic, but a line in Chapter 6 caught my eye: "Currently, the only place in Cocoon where you can use sitemap resources is for redirects." Is this a new restriction in C2.1? I'm currently using resources like macros in my clauses via in C2.0.3. I'd hate to have to rewrite my sitemap when we upgrade to 2.1! -Christopher |-+> | | "Matthew Langham"| | | <[EMAIL PROTECTED]| | | .de> | | || | | 03/31/2004 04:59 | | | AM | | | Please respond to| | | users| | || |-+> >--| | | | To: <[EMAIL PROTECTED]>, <[EMAIL PROTECTED]> | | cc: | | Subject: Cocoon chapters for download | >--| I have been in contact with SAMS, the publisher of our Cocoon book. They already provide a free download of Chapter 6 (A User's look at the Cocoon Architecture). They have now agreed to provide Chapter 1 (An Introduction to Internet Applications) as a free download. Chapter 1 basically details the history of building Internet/Web applications and outlines why Cocoon is the best choice when considering a platform today. Chapters 1 and 6 are available here: http://www.s-und-n.de/sunshine/ccos/CBA-Chapter1.pdf http://www.s-und-n.de/sunshine/ccos/CBA-Chapter6.pdf Currently the SAMS/NewRiders Site only has chapter 6. Enjoy. Matthew - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: session:getxml in esql Problem
I don't know the session context stuff, but I suspect if you look in the generated java code you'd see a lot of java code stuck in the middle of your query. The query can handle things like java_expr where java_expr evaluates sensibly to a String, but I suspect the does not create a simple expression, but probably more like several lines of code. -Christopher |-+> | | "Tuan Luu" | | | <[EMAIL PROTECTED]> | | || | | 03/31/2004 04:40 | | | AM | | | Please respond to| | | users| | || |-+> >--| | | | To: [EMAIL PROTECTED] | | cc: | | Subject: session:getxml in esql Problem | >--| hello I'd like to use values from the session context in an esql Statement (xsp) but it gives me errors. I saw in some mail postings that there was a problem with in esql in earlier Version of Cocoon. Is there any solution now? What I've tryed recently was: select * from sc where anwname='' This statement will lead to the error msg: full exception chain stacktrace Original Exception: org.apache.cocoon.components.language.LanguageException: Error compiling sc_promonat_res1_xsp: ERROR 1 (org/apache/cocoon/www/sc/overview/html/sc_promonat_res1_xsp.java): ... "context", "context", "CDATA", "proapplauswahl" // start error (lines 517-517) "Syntax error on token ";", ")" expected" ); // end error xspAttr.addAttribute( "", "path", ... -- +++ NEU bei GMX und erstmalig in Deutschland: TÜV-geprüfter Virenschutz +++ 100% Virenerkennung nach Wildlist. Infos: http://www.gmx.net/virenschutz - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: ESQL INSERT
1. Check your logs, perhaps the error message in one of them. You might also try removing your element; perhaps it is masking an exception that you'd otherwise see. 2. Make sure your pool, xsp, and esql setup is correct; can you do a simple SELECT query successfully in place of the INSERT? 3. You say the query works by hand; are you logging in using the same account as your pool user? Otherwise you might have a permissions problem. 4. Is the code below copied from your source? There is a missing left parenthesis on your column list. 5. Is TODAY() a function? You appear to be trying to insert the String 'TODAY()' into a date field. Just use bare TODAY() as you would in your SQL statement. -Christopher |-+> | | olivier demah| | | <[EMAIL PROTECTED]| | | com> | | || | | 03/30/2004 11:22 | | | AM | | | Please respond to| | | users| | || |-+> >--| | | | To: [EMAIL PROTECTED] | | cc: | | Subject: Re: ESQL INSERT | >--------------| Christopher Painter-Wakefield a e'crit : > > >Are you not seeing any error messages coming through? I suspect the >problem is that you have a SQL error, and if you look, you'll find it. You >should have gotten a SQL error previously. What output are you seeing in >your element? > > its empty ... i made another fix about the primary key. INSERT INTO blog_news id_blog_user,news_title,news_text,news_image,news_date_creation,news_date_modify) VALUES (id_blog_user, news_title, news_text, news_image, 'TODAY()',NULL); if i do it by hand its working... but not with ESQL - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: ESQL INSERT
Are you not seeing any error messages coming through? I suspect the problem is that you have a SQL error, and if you look, you'll find it. You should have gotten a SQL error previously. What output are you seeing in your element? |-+> | | olivier demah| | | <[EMAIL PROTECTED]| | | com> | | || | | 03/30/2004 10:50 | | | AM | | | Please respond to| | | users| | || |-+> >--| | | | To: [EMAIL PROTECTED] | | cc: | | Subject: Re: ESQL INSERT | >--| i've done those fixes, and i thantk you for this suggestion, but the ESQL INSERT still does not insert anything in my blog_news table. Christopher Painter-Wakefield a e'crit : > > >The immediate problem I see is in how you are passing your String >parameters into the SQL statement. The strings you are passing in do not >end up in the SQL statement with quotes around them (unless the user is >entering them on the form!), so the database is probably getting syntax >errors, which I think you should be seeing. You have two choices to fix >this: > >Each place you have an expression like news_title > >1. (potentially a security risk) change to >'news_title' > >2. (much better) change to > type="string">news_title > > > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: ESQL INSERT
The immediate problem I see is in how you are passing your String parameters into the SQL statement. The strings you are passing in do not end up in the SQL statement with quotes around them (unless the user is entering them on the form!), so the database is probably getting syntax errors, which I think you should be seeing. You have two choices to fix this: Each place you have an expression like news_title 1. (potentially a security risk) change to 'news_title' 2. (much better) change to news_title HTH -Christopher |-+> | | olivier demah| | | <[EMAIL PROTECTED]| | | com> | | || | | 03/30/2004 04:36 | | | AM | | | Please respond to| | | users| | || |-+> >--| | | | To: [EMAIL PROTECTED] | | cc: | | Subject: ESQL INSERT | >--| from a form i get my data i want logically insert in my database so i did the following , but nothing comes in my blog_news table String id_blog_user = request.getParameter("id_blog_user"); String id_blog_news = request.getParameter("id_blog_news"); String news_title = request.getParameter("news_title"); String news_text = request.getParameter("news_text"); String news_image = request.getParameter("news_image"); mblog_pg INSERT INTO blog_news (id_blog_news,id_blog_user,news_title,news_text,news_image,news_date_creation,news_date_modify) VALUES ('',id_blog_user, news_title, news_text, news_image, today,NULL); Database Error Added nothing done Regards. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: avoid setting the password in jdbc settings in cocoon.xconf
Here's some sample code of what I mean - with this code, you can pass in the dburl, username, and password from a form: xmlns:xsp="http://apache.org/xsp" xmlns:esql="http://apache.org/cocoon/SQL/v2" > request.getParameter("dburl") request.getParameter("username") request.getParameter("password") select count(*) from person Count: column="1"/> "Alex Kovacs" <[EMAIL PROTECTED]> 03/22/2004 07:38 PM Please respond to users To: <[EMAIL PROTECTED]> cc: Subject: RE: avoid setting the password in jdbc settings in cocoon.xconf Hi Christopher, > > I think the answer to both questions is, don't use database pooling :) I understand your point > > If you are using ESQL, all of these can be set dynamically by using java > and inside the appropriate elements. I imagine it is even > easier in SQL transformer. You'll have to pass in everything every time, > though, so you'll probably want some way to cache your user's password in > the session or some such, unless you have incredibly patient users... I will try it, however it would be good to have an example of how you define the connection for ESQL in an tag. Thanks, Alex
Re: avoid setting the password in jdbc settings in cocoon.xconf
I think the answer to both questions is, don't use database pooling :) If you are using ESQL, all of these can be set dynamically by using java and inside the appropriate elements. I imagine it is even easier in SQL transformer. You'll have to pass in everything every time, though, so you'll probably want some way to cache your user's password in the session or some such, unless you have incredibly patient users... -Christopher |-+> | | "Alex Kovacs"| | | <[EMAIL PROTECTED]| | | su.com.au> | | || | | 03/21/2004 07:06 | | | PM | | | Please respond to| | | users| | || |-+> >--| | | | To: <[EMAIL PROTECTED]> | | cc: | | Subject: avoid setting the password in jdbc settings in cocoon.xconf | >--| Hi, How is it possible to avoid setting the user/password for the jdbc connection in cocoon.xconf? This could be a security issue if the server sits in a DMZ. In addition, how is it possible to set a different programmatically if, say I want to change the database host, port or sid? Thanks, Alex - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: how do you set up your version control?
We keep our entire webapp in CVS, including the jars. We work with the project under Eclipse, using the Tomcat plugin. Eclipse does a terrific job with CVS. The only stuff we don't currently keep in CVS (but we want to eventually) are the Tomcat conf files and supporting libraries directories (e.g., common/endorsed). The advantage to keeping the jars under version control is pretty obvious once you start dealing with upgrades to various components, such as jdbc driver jar files, etc., or if you ever tweak resources stored in the cocoon.jar (e.g., logicsheets). We also have a few java classes, and having the entire project in Eclipse, we can modify the source in WEB-INF/src and have it automatically compile to WEB-INF/classes. In this case, only the source gets stored in CVS, and Eclipse recompiles the code whenever you check out modified source from CVS. This would require a little extra work if we built our .war file directly from CVS, but we use the Sysdeo Tomcat plug-in to build the .war file from Eclipse, and it gets the compiled stuff just fine. -Christopher |-+> | | Dan | | | <[EMAIL PROTECTED]| | | drice.net> | | || | | 03/17/2004 02:07 | | | PM | | | Please respond to| | | users| | || |-+> >--| | | | To: [EMAIL PROTECTED] | | cc: | | Subject: how do you set up your version control? | >--| Hi, How are people setting up version control (CVS, SVN) for their projects? Do you just keep your content (sitemap, config files, stylesheets, etc) under version control or do you keep the entire app, including the cocoon jars there too? Any suggestions in this area would be apprectiated. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: esql select max() | how to get result
either of these should work: |-+> | | [EMAIL PROTECTED]| | || | | 03/15/2004 01:37 | | | PM | | | Please respond to| | | users| | || |-+> >--| | | | To: [EMAIL PROTECTED] | | cc: | | Subject: esql select max() | how to get result | >--| hi people i try to run this sql query SELECT max(id_Elements) AS id_Elements FROM tblElements no record was found but i dont know hot to get the resutl in ... any hint i have try but without success thanx --stavros - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: cocoon alternative
Also check out Zope (http://www.zope.org/) for a non-java alternative. -Christopher |-+---> | | "Schultz, Gary -| | | COMM" | | | <[EMAIL PROTECTED]| | | tate.wi.us> | | | | | | 03/12/2004 10:01 AM | | | Please respond to | | | users | | | | |-+---> >--| | | | To: "'[EMAIL PROTECTED]'" <[EMAIL PROTECTED]> | | cc: | | Subject: RE: cocoon alternative | >--| Wafer Project http://waferproject.org/index.html has a feature comparison matrix for web application framework alternatives and links to the web sites of the different alternatives. Gary T. Schultz Web Technical Administrator / GIS Coordinator Wisconsin Department of Commerce 6th Floor P.O. Box 7970 Madison, WI 1-608-266-1283 -Original Message- From: Arnaud De Brem [mailto:[EMAIL PROTECTED] Sent: Friday, March 12, 2004 6:11 AM To: [EMAIL PROTECTED] Subject: cocoon alternative Hi, I have to make a presentation of Coccon and I have to present alternative solutions. Do you know alternative solutions ??? Thanks Arnaud De Brem - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: binding params in dynamic queries in ESQL
Well, for what it's worth, using Oracle's jdbc drivers and putting a second query in the esql:query block results in this error: java.sql.SQLException: ORA-00911: invalid character I separated the two queries using ";", which is presumably the invalid character Oracle is complaining about. I can't imagine any other way of separating the two queries. Any thoughts? I can't find anything in the java docs for java.sql.Connection.prepareStatement() that specifically forbids having multiple queries, so you may be right about it being driver dependent. Our app seems to be pretty safe from this particular attack, regardless. We actually run the query through another parser (too long to explain why) that results in only one query getting executed, regardless of what is in the query block (I had to work around this to get a good test and produce the exception noted above). I also looked hard (since I was looking) at every possible way I could mess with the query parameters to modify the way the SQL executes, but it appears that we do enough stuff to the request parameters (stripping quotes, parsing into integers, etc.) that there isn't much hacking possible. (Hopefully nobody will take this as a challenge, but notice I'm NOT listing any URLs for my app here!) Of course, all of our update/delete queries are using bound parameters! -Christopher Torsten Curdt <[EMAIL PROTECTED]> Sent by: news <[EMAIL PROTECTED]> 03/05/2004 09:15 PM Please respond to users To: [EMAIL PROTECTED] cc: Subject: Re: binding params in dynamic queries in ESQL > I thought that ESQL used JDBC prepared statements, regardless of whether > you have bound parameters; That's right > while it won't protect you fully, won't it throw > an exception if it receives two queries (which this attack results in)? AFAIK - not necessarily ...as with all JDBC stuff this probably depends on the driver implementation :-/ > Perhaps I'm wrong on this point. It isn't ideal, but if your dynamic SQL > is only doing selects, and only against data that isn't sensitive, then the > worst case scenario is perhaps an attack that slows your server down (and > the attacker would have to know a good deal about your schema to do that). > If I'm wrong about this JDBC behavior, then I probably need to look at some > stuff, too! I fear you are wrong... ...but please try and report back. In general: For a safe design request values should NEVER appear inside an esql:query tag except when surrounded by esql:parameter! cheers -- Torsten
Re: binding params in dynamic queries in ESQL
I thought that ESQL used JDBC prepared statements, regardless of whether you have bound parameters; while it won't protect you fully, won't it throw an exception if it receives two queries (which this attack results in)? Perhaps I'm wrong on this point. It isn't ideal, but if your dynamic SQL is only doing selects, and only against data that isn't sensitive, then the worst case scenario is perhaps an attack that slows your server down (and the attacker would have to know a good deal about your schema to do that). If I'm wrong about this JDBC behavior, then I probably need to look at some stuff, too! -Christopher |-+> | | Geoff Howard | | | <[EMAIL PROTECTED]| | | eb.com> | | || | | 03/05/2004 04:45 | | | PM | | | Please respond to| | | users| | || |-+> >--| | | | To: [EMAIL PROTECTED] | | cc: | | Subject: Re: binding params in dynamic queries in ESQL | >--| Geoff Howard wrote: > > How are you protecting against SQL Injection attacks? > select * from foo where foo.x = > '' > > if you take myVar in any way from a request parameter, what happens if > I pass in a value like bar=abc;delete%20from%20foo (try it on your app). Oops, changed my example without changing all references - myVar is supposed to be bar obviously. I don't have many soapboxes but this is one of them - I have inherited applications crippled by problems like this. Geoff - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: binding params in dynamic queries in ESQL
Rebecca, It might take some time to prove it, but I'm pretty sure you can't do what you are trying to do with ESQL. I've gotten pretty deep into the ESQL logicsheet, and it looks for specific tags in specific relationship to other tags, e.g., it will look for the esql:parameter tags as children of an esql:query tag. Since the logicsheet knows nothing of your java logic, it will generate parameter setting code for each esql:parameter tag, regardless of whether you manage to put logic around the tag to switch it on or off in the query itself. So whatever you do, you will get errors if you try to have a dynamic number of parameters in a single esql block, because the parameter setting code will not match the query. (The existence of the parameter tag creates java in more than one place, but your xsp:logic conditional java code will only be copied into the query area - assuming the logicsheet will even honor those blocks.) So, here are your choices as I see them: 1. Abandon parameter binding, and just build the SQL string dynamically (which is what we do with this situation) 2. Create a separate ESQL block for every possible combination of parameters, then choose which ESQL block to run via java logic 3. Extend/modify the ESQL logicsheet to meet your needs; you can get the esql.xsl out of your cocoon.jar file, modify it, then modify cocoon.xconf to point to your modified logicsheet 4. Don't use ESQL (would SQL transformer work for you?) Sorry I don't have an easy solution for you. -Christopher R Hunt <[EMAIL PROTECTED]To: [EMAIL PROTECTED] .edu>cc: Subject: binding params in dynamic queries in ESQL 03/05/2004 11:27 AM Please respond to users Thanks in advance for any help on this. I would like to build a SQL statement dynamically based on whether not not certain parameters have been sent, but also use bound parameters in my SQL query. I seem to be having troubles getting the parsing quite right. To give a better idea of what I'm trying to do, I've included my code from my first attempt: Thanks in advance, Rebecca - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: cocoon dont define class in XSP
How about java.util.Properties connInfo = new java.util.Properties(); instead? -Christopher |-+> | | Vlad Ali | | | <[EMAIL PROTECTED]| | | chtamt.ru> | | || | | 03/04/2004 01:45 | | | PM | | | Please respond to| | | users| | || |-+> >--| | | | To: [EMAIL PROTECTED] | | cc: | | Subject: cocoon dont define class in XSP | >--| Hi! there is some code in my XSP page : ... java.util.Properties connInfo = new Properties(); .. and cocoon generate error: "Properties cannot be resolved or is not a type" explain me pls, why? thx - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Passing values into an XSP logic sheet
Andrew, sorry I didn't reply to your previous mail - I got very busy yesterday. I looked at the files you sent, and I saw some things, but it looks like you've moved on. In your current posting, I think the problem is the order of execution. In your logicsheet, you are putting in code to look up the artist details in an xsp:logic block directly inside the xsp:page block. This puts all of that code at the class level, so it is executed when the page object is first instantiated. The code that provides the artistID for lookup, on the other hand, is inside the 'page' element, which means it is put in the generate() method of the page class, which gets called to generate the page. By the time it is called, though, all of your artist detail variables have already been set. Here's a rewrite/simplification that may help: 1. XSP Page (snippet) http://apache.org/xsp"; xmlns:artistDetails=" http://www.beyarecords.com/artistDetails/1.0"; xmlns:xlink="http://www.w3.org/1999/xlink"; xmlns:util="http://apache.org/xsp/util/2.0"; > int artistID = Integer.parseInt(); artistID ... 2. XSP Logic Sheet http://www.w3.org/1999/XSL/Transform"; xmlns:xsp="http://apache.org/xsp"; xmlns:util="http://apache.org/xsp/util/2.0"; xmlns:artistDetails="http://www.beyarecords.com/artistDetails/1.0"; version="1.0"> test.Artist test.Base64 int artistID = Integer.parseInt(); Artist artist = Artist.getArtist(artistID); String artist_name = artist.getArtistName(); artist_name ... -Christopher |-+> | | beyaNet | | | Consultancy | | | <[EMAIL PROTECTED]| | | .com>| | || | | 03/04/2004 08:26 | | | AM | | | Please respond to| | | users| | || |-+> >--| | | | To: [EMAIL PROTECTED] | | cc: | | Subject: Re: Passing values into an XSP logic sheet | >--| Hi, I am trying to pull a value in from my XSP page into an XSP Logicsheet. At the moment no value is being pulled in. What am I doing incorrectly? 1. XSP Page (snippet) http://apache.org/xsp"; xmlns:artistDetails=" http://www.beyarecords.com/artistDetails/1.0"; -- LOGICSHEET REF: xmlns:xlink="http://www.w3.org/1999/xlink"; xmlns:util="http://apache.org/xsp/util/2.0"; > int artistID = Integer.parseInt(); --VALUE PULLED IN FROM SITEMAP artistID --- VALUE HELD HERE 2. XSP Logic Sheet http://www.w3.org/1999/XSL/Transform"; xmlns:xsp="http://apache.org/xsp"; xmlns:util="http://apache.org/xsp/util/2.0"; xmlns:artistDetails="http://www.beyarecords.com/artistDetails/1.0"; -- LOGICSHEET REF: version="1.0"> test.Artist test.Base64 int artistID = Integer.parseInt(); -- WANT VALUE PULLED INTO HERE Artist artist = Artist.getArtist(artistID); int id = artist.getID(); String artist_name = artist.getArtistName(); String info = artist.getArtistInfo(); String basePhoto1 = Base64.encodeBytes(artist.getArtistPhoto1()); String basePhoto2 = Base64.encodeBytes(artist.getArtistPhoto2()); many thanks in advance On 3 Mar 2004, at 21:07, beyaNet Consultancy wrote: > Christopher, > thanks for your reply. I have implemented your solution but am getting > an error. I have attached both my XSP page and the XS
Re: Re[2]: Very strange IE problem
Thanks, we've tried that one too. I believe we get the same error. IE just doesn't want us to open that PDF, no matter how! -Christopher Bastian Breithaupt To: [EMAIL PROTECTED] <[EMAIL PROTECTED]cc: >Subject: Re: Re[2]: Very strange IE problem Sent by: [EMAIL PROTECTED] 03/03/2004 01:43 PM Please respond to users Christopher, thank you for the "please wait" code. About your IE stuff I found this, do not know exactly if it is related... http://archives.real-time.com/pipermail/cocoon-users/2000-December/008626.html it says: "Open Acrobat, go to Preferences and uncheck Web Browser integration. Now, when you attempt to get a PDF, you will be asked to either open it or save it." Regards, Bastian Am Mi, 2004-03-03 um 19.15 schrieb Christopher Painter-Wakefield: > > > Bastian, > > here's the essence of the code, implemented in XSP. We have a sitemap > entry that generates from this XSP whenever the URL is of a pattern > "/pleasewait/*". We can then do a pleasewait before any page we want by > simply putting "/pleasewait" in front of the usual URL. > > The key line is the one that adds a "refresh" header to the response, with > a timeout of zero. (This is the same mechanism that website use to > redirect you to a new URL, but usually with a timeout of 5-10 seconds.) > When this page loads (in every browser we've tried), it displays and then > immediately times out and calls the new URL. While it is waiting for a > response from the server, it is still displaying the Please Wait message, > usually along with a busy cursor. As soon as the new page is returned from > the server, it is displayed in the browser. > > -Christopher > > > > String thisURL = request.getRequestURI(); > String query = request.getQueryString(); > int start = thisURL.indexOf("/pleasewait"); > String newURL = thisURL.substring(0, start) + thisURL.substring(start > + "/pleasewait".length()); > newURL = response.encodeURL(newURL); > if (query != null) { > newURL = newURL + "?" + query; > } > response.addHeader("refresh", "0;URL=" + newURL); > > String message = request.getParameter("pwmsg"); > > > > Please Wait > > > Please Wait > > if (notEmpty(message)) { > message > } else { > We are requesting your information... > } > > > > > > > Bastian > Breithaupt To: [EMAIL PROTECTED] > Sent by: cc: >Subject: Re: Re[2]: Very strange IE problem > > 03/03/2004 12:52 > PM > Please respond to > users > > > > > > > A co-worker had a similar problem with IE calling a PDF from an applet, > which does not work either. So he interposes a html page with the link > to the pdf... Maybe these problems are related. > > And, by the way, could you tell something about the implementation of > the &q
Re: Re[2]: Very strange IE problem
Bastian, here's the essence of the code, implemented in XSP. We have a sitemap entry that generates from this XSP whenever the URL is of a pattern "/pleasewait/*". We can then do a pleasewait before any page we want by simply putting "/pleasewait" in front of the usual URL. The key line is the one that adds a "refresh" header to the response, with a timeout of zero. (This is the same mechanism that website use to redirect you to a new URL, but usually with a timeout of 5-10 seconds.) When this page loads (in every browser we've tried), it displays and then immediately times out and calls the new URL. While it is waiting for a response from the server, it is still displaying the Please Wait message, usually along with a busy cursor. As soon as the new page is returned from the server, it is displayed in the browser. -Christopher String thisURL = request.getRequestURI(); String query = request.getQueryString(); int start = thisURL.indexOf("/pleasewait"); String newURL = thisURL.substring(0, start) + thisURL.substring(start + "/pleasewait".length()); newURL = response.encodeURL(newURL); if (query != null) { newURL = newURL + "?" + query; } response.addHeader("refresh", "0;URL=" + newURL); String message = request.getParameter("pwmsg"); Please Wait Please Wait if (notEmpty(message)) { message } else { We are requesting your information... } Bastian Breithaupt To: [EMAIL PROTECTED] Sent by: cc: Subject: Re: Re[2]: Very strange IE problem 03/03/2004 12:52 PM Please respond to users A co-worker had a similar problem with IE calling a PDF from an applet, which does not work either. So he interposes a html page with the link to the pdf... Maybe these problems are related. And, by the way, could you tell something about the implementation of the "please wait" page? How does the page know when the generation process is ready? Thanks, Bastian Am Mi, 2004-03-03 um 18.25 schrieb Christopher Painter-Wakefield: > > > I don't know if this is related, but we have a similar problem with a page > that generates PDFs. The generation take a while, so we have a "please > wait" page that displays and does a refresh to get the generated page when > it is ready. IE won't open the PDF, and gives a strange error message. > This definitely only started happening recently (last six months, maybe?), > and we believe it is due to some security patch or other. However, > changing the security settings for IE to the most permissive doesn't fix > the problem. If we don't use the refresh page, the problem goes away. > > If anyone finds a workaround involving some change to IE settings or > whatever, please share it! > > -Christopher > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Re[2]: Very strange IE problem
I'm sorry, I don't understand your question. If I change the serializer to html, we'd get garbage at best, since the input XML is FO code. We have another page in the application that takes a long time to load because it retrieves a large amount of information from a remote system. That (html) page also uses the please wait mechanism, and has no problems on IE. -Christopher "Johnson" <[EMAIL PROTECTED]To: <[EMAIL PROTECTED]> b.tw>cc: Subject: Re: Re[2]: Very strange IE problem 03/03/2004 12:59 PM Please respond to users can't you see the genered pdf on server side, if you change the serializer to html,it ok? Johnson - Original Message - From: "Christopher Painter-Wakefield" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Thursday, March 04, 2004 1:49 AM Subject: Re: Re[2]: Very strange IE problem > > > > > Our problem doesn't seem to match what you describe; when the problem is > occurring, we can use the same browser window and surt to another system > where we can open a PDF just fine. > > Also, I forgot to mention that the problem only occurs when going against > non-SSL servers (e.g., Tomcat on our development workstations) or against > an SSL server with a test certificate (e.g., the test certificate generated > by mod-ssl for apache). Against an SSL server with a valid certificate, > the problem doesn't occur. > > -Christopher - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Re[2]: Very strange IE problem
Our problem doesn't seem to match what you describe; when the problem is occurring, we can use the same browser window and surt to another system where we can open a PDF just fine. Also, I forgot to mention that the problem only occurs when going against non-SSL servers (e.g., Tomcat on our development workstations) or against an SSL server with a test certificate (e.g., the test certificate generated by mod-ssl for apache). Against an SSL server with a valid certificate, the problem doesn't occur. -Christopher "Johnson" <[EMAIL PROTECTED]To: <[EMAIL PROTECTED]> b.tw>cc: Subject: Re: Re[2]: Very strange IE problem 03/03/2004 12:43 PM Please respond to users I met a familiar problem in pdf before,always happened when I open several times. when the ie can't open cocoon's pdf,it can't open other pdf too. I found not only cocoon's pdf,but also other pdf files open by ie. So I think the pdf's problem is some resource out. Just reboot then everything ok. So if you got the same problem"open several times and then the pdf disappear",and want to avoid this problem,try to enlarge your memery,it will be stable then before. best regards johnson - Original Message - From: "Christopher Painter-Wakefield" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Thursday, March 04, 2004 1:25 AM Subject: Re: Re[2]: Very strange IE problem > > > > > I don't know if this is related, but we have a similar problem with a page > that generates PDFs. The generation take a while, so we have a "please > wait" page that displays and does a refresh to get the generated page when > it is ready. IE won't open the PDF, and gives a strange error message. > This definitely only started happening recently (last six months, maybe?), > and we believe it is due to some security patch or other. However, > changing the security settings for IE to the most permissive doesn't fix > the problem. If we don't use the refresh page, the problem goes away. > > If anyone finds a workaround involving some change to IE settings or > whatever, please share it! > > -Christopher > > > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Re[2]: Very strange IE problem
I don't know if this is related, but we have a similar problem with a page that generates PDFs. The generation take a while, so we have a "please wait" page that displays and does a refresh to get the generated page when it is ready. IE won't open the PDF, and gives a strange error message. This definitely only started happening recently (last six months, maybe?), and we believe it is due to some security patch or other. However, changing the security settings for IE to the most permissive doesn't fix the problem. If we don't use the refresh page, the problem goes away. If anyone finds a workaround involving some change to IE settings or whatever, please share it! -Christopher |-+> | | "Johnson"| | | <[EMAIL PROTECTED]| | | b.tw>| | || | | 03/03/2004 12:12 | | | PM | | | Please respond to| | | users| | || |-+> >--| | | | To: <[EMAIL PROTECTED]>, "Andrey Almirov" <[EMAIL PROTECTED]> | | cc: | | Subject: Re: Re[2]: Very strange IE problem | >--| Take a break,I think it probably security probelm for ie6 because of MS system open several property by default,like active-x...,so it is easy attacked by virus hacker.. so from ie6 and oe6,MS close lots of unsafety feature,users must open it by themselves. so pls try to set the safety of ie6 to lowest,and open all feature closed by dedault,then try again. goodwiil Johnson - Original Message - From: "Andrey Almirov" <[EMAIL PROTECTED]> To: "Carmona Perez, David" <[EMAIL PROTECTED]> Sent: Thursday, March 04, 2004 12:55 AM Subject: Re[2]: Very strange IE problem > Hello Dear Cocoon users! > > CPD> Why don't you search in msdn.microsoft.com for IE bugs? > So, I found that it is some Microsoft's IE bug. > > BUT. I can not say to my customers that it is Microsoft bug. And > Microsoft have not patch for it yet. > > So I need to cure this problem somehow. > > We not some strange details, that say us that it is not pure IE > problem. > > 1. This error appears only when we have redirect to the pipeline. > 2. We have this error even we redirect from some servlet (not Cocoon > system). > 3. I saved the page which Cocoon generate (big page which leads to > IE error) as usual html page. And redirected to it. All works fine. > > >From 3. I concluded that this is Cocoon - IE strange not compatibility > > Does somebody have some ideas? > > Thanks in advance! > > CPD> > CPD> David > > CPD> -Mensaje original- > CPD> De: Andrey Almirov [mailto:[EMAIL PROTECTED] > CPD> Enviado el: jueves, 26 de febrero de 2004 17:21 > CPD> Para: [EMAIL PROTECTED] > CPD> Asunto: Very strange IE problem > > CPD> Hello, dear Cocoon users! > > CPD> I have 2 pipelines: A and B > > CPD> A pipeline: > > CPD> > CPD> > CPD> CPD> value="{request-param:command}"/> > CPD> > CPD> > CPD> > CPD> > CPD> > CPD> > CPD> > CPD> > CPD> > > CPD> When I visit A it just shows some button. When I click on > CPD> this button pipeline redirects to B. > > CPD> B is usial pipeline > > CPD> > CPD> > CPD> > CPD> > > CPD> where bigPage.xml *MUST* have the following properties: > CPD> 1. It musts have a big size. > CPD> 2. It musts load some css or script. > > CPD> The problem is that when A redirect to B sometime the error > CPD> "InternetExplorer cannot open the site > CPD> ... Operation aborted" > > CPD> Or just white screen appears. > > CPD> It happens on IE 6 only. > > CPD> Configuration: Windows Professional 2000, Tomcat 4.1.24, Cocoon 2.1.4 > > CPD> In attachment there are all needed files. > > CPD> In the experiments I have noted that this effect depends on > CPD> size of file, and on Inet speed. So I do > CPD> this experiment in localhost (Inet speed rather big) > > CPD> Thanks in advance. > > CPD> Andrey > > CPD> - > CPD> To unsubscribe, e-mail: [EMAIL PROTECTED] > CPD> For additional commands, e-mail: [EMAIL PROTECTED] > > > > > -- > Best regards, > Andreymailto:[EMAIL PROTECTED] > - To unsubscr
Re: Passing values into an XSP logic sheet
You can have your logicsheet code read it directly from the sitemap parameters, or for a more general solution pass it in through your template. I assume you are using ESQL? Then you need something like the following: logicsheet: select * from blah where id = XSP: int myID = [code to get parameter value here]; myID . HTH, Christopher |-+> | | <[EMAIL PROTECTED]| | | .com>| | || | | 03/03/2004 10:45 | | | AM | | | Please respond to| | | users| | || |-+> >--| | | | To: [EMAIL PROTECTED] | | cc: | | Subject: Passing values into an XSP logic sheet | >--| Hi, I have created a custom logic sheet for which I have a hard coded value which is used to pull data from a postgreSQL database. How can I pass a value into a logicsheet? At the moment the flow is: Generated HTML <-- stylesheet <-- XSP page <-- XSP Logicsheet. From the sitemap I can read the parameter I need into the XSP page, but how can I get it into the XSP Logicsheet? many thanks in advance Andrew - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [POLL] which Cocoon version / JDK version / Servlet Container are you using ?
COCOON: 2.0.3 JDK: 1.4.x (various) CONTAINER: Tomcat 4.1.27 PRO 1.4 for 2.2 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: ESQL update and select statements in the same map:match problem
You can create an XSP action, which is much easier than writing it in java, and you can still use ESQL. Add this namespace to your action: xmlns:action= "http://apache.org/cocoon/action/1.0"; Here's the sitemap entry: -Christopher |-+> | | [EMAIL PROTECTED]| | || | | 02/26/2004 04:31 | | | AM | | | Please respond to| | | users| | || |-+> >--| | | | To: [EMAIL PROTECTED] | | cc: | | Subject: Re: ESQL update and select statements in the same map:match problem | >--| On Wed, 25 Feb 2004, Geoff Howard wrote: > It's not a bug -- and I wouldn't recommend using a workaround like the > one below (which would probably work). Don't try to modify the data > model while it's being turned into sax (the job of the generator). > Other non-MVC friendly frameworks force this but Cocoon almost forces > you not to because of all the problems it can cause in real-world > applications. > > In your case, either use flow to call logic which modifies your database > (beyond scope of my response) or use an action. Actions and flow are > both guaranteed to execute before the pipeline is assembled and are > designed to be the place for data manipulation (with the exception of > the side-effect transformers like the SQLTransformer, also out of > scope). If you already have an xsp which does the job, turn it into an > xsp action and you're done. > thnx for the hint i have never touch flow until now so action is te solution i'll choose. but my xsp use ESQL to reach the connection pool an update the content is out there any example or doc, how to reach connection pool using java code ? --stavros > Geoff > > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Request parameters when method is post
Anna, reply with the non-working code, including the sitemap entry, and someone will surely spot the problem. -Christopher - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Request parameters when method is post
What method are you using to get your request parameters? It works just fine for me, using request.getParameter("param-name") in XSP. -Christopher |-+> | | Anna Bikkina | | | <[EMAIL PROTECTED]| | | com> | | || | | 02/25/2004 04:35 | | | PM | | | Please respond to| | | users| | || |-+> >--| | | | To: [EMAIL PROTECTED] | | cc: | | Subject: Request parameters when method is post | >--| Hi, I have a xsp form which passed parameters in the post. I cannot access these parameters when the method is post . When the method is get I can access the parameters. Did anyone find the same problem. Is there a way I can come out of it. Thanks, Anna. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: ESQL update and select statements in the same map:match problem
I don't know anything about the internal workings of the map:aggregate, but I would guess it is not waiting for the first part to complete before opening a connection for the second part. This would make sense, for performance reasons, and there is no particular reason for cocoon to expect the parts to be dependent on each other. So I don't think it is necessarily a bug, nor a caching mechanism, just that map:aggregate doesn't imply sequential processing. Just curious, should the map:aggregate have an "element" attribute specifying the root element for the combined output? Also, what does "strip-root='yes'" do? I couldn't find it in the documentation (http://cocoon.apache.org/2.1/userdocs/concepts/sitemap.html#Aggregating). You could probably make things sequential (and still achieve aggregation) by using either a cinclude transformer, or even more simply by using an XSLT transform step with the document() function, e.g., ... ... with a sitemap like or some such. -Christopher |-+> | | [EMAIL PROTECTED]| | || | | 02/25/2004 01:56 | | | PM | | | Please respond to| | | users| | || |-+> >--| | | | To: [EMAIL PROTECTED] | | cc: | | Subject: ESQL update and select statements in the same map:match problem | >--| hi people i have the folow code : where i call 2 .xsp 1. update_point.xsp where i update a record in my database 2. get_point.xsp where i get the updated record the problem is that this aggregation update the database record (i have check the content) but generate output (get_point) with the before update values is this a caching mechanism case, is it possible to bypass this problem or it's just a bug? --stavros - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: reusing a result set with esql
Adrian, I'm not familiar with RDF, and I can't say I have a clear picture of what you are trying to do, but I think you might be able to do everything you need in XSLT, after the XSP stage. I do a lot of cross-referencing between lists, etc., in an XSLT transform step after generating the raw data from the database. If you want to generate two different bits of output from a single database result, that is even easier. XSLT is very powerful for this type of thing. Good luck! -Christopher |-+> | | Adrian Petru | | | Dimulescu| | | | | || | | 02/18/2004 04:07 | | | PM | | | Please respond to| | | users| | || |-+> >--| | | | To: [EMAIL PROTECTED] | | cc: Christopher Painter-Wakefield <[EMAIL PROTECTED]> | | Subject: Re: reusing a result set with esql | >--| On Wednesday 18 February 2004 20:58, Christopher Painter-Wakefield wrote: > Could you be more specific on what it is you are trying to do? Perhaps we > can see a way to do it in one iteration. Well, I'm experimenting with XUL as frontend and Cocoon as backend. Mozilla XUL trees like RDF so I use Cocoon on the backend to generate it. When I want to generate the RDF/XML for a list of Partners, the RDF contains : * as many as there are rows (Partners) in the ResultSet. * then an in order to predicate the fact that those entities are part of a list. Every item of the is a _reference_ to the defined entity. Now that you mentioned it I realize that it is possible to not use references but textually include the entities in the . In my case that would work and I will use it tomorrow :) But if one wants to describe in the same RDF/XML several different lists or graphs of the same entities, using references becomes unavoidable. So iterating through the ResultSet several times also becomes necessary, I think. > If you are comfortable with logicsheets, then you might consider extending > the esql logicsheet yourself, and posting your extensions back to the > Cocoon developers. I am quite new to XSP/logicsheets but they seem so wonderfully simple; I'll take a look anyway to the esql logicsheet to see if I can make something of it. Best regards, Adrian. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: reusing a result set with esql
Could you be more specific on what it is you are trying to do? Perhaps we can see a way to do it in one iteration. If you are comfortable with logicsheets, then you might consider extending the esql logicsheet yourself, and posting your extensions back to the Cocoon developers. -Christopher |-+> | | Adrian Petru | | | Dimulescu| | | | | || | | 02/18/2004 02:45 | | | PM | | | Please respond to| | | users| | || |-+> >--| | | | To: [EMAIL PROTECTED] | | cc: | | Subject: RE: reusing a result set with esql | >--| Ok, I see your point, I must do it myself -- I was hoping there was a "bultin" way to do it. To me, it looks like a pretty basic functionality: for instance, generating an RDF/XML containing a list of rows: * first, generating all existing entities(rows) (=> one iteration) * then adding the sequence (another iteration needed) I don't see how that could be done in one iteration only. Thank you very much for taking the time to answer :) Adrian. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [once again] best way to set http header encoding
Yes, I agree, the http header should be set, particularly when already providing the content type meta tag. The header is much easier for downstream filters to read and change, if necessary, anyway. And the encoding info is very necessary when displaying text using extended character sets. -Christopher |-+> | | Jan Uyttenhove | | | <[EMAIL PROTECTED]| | | ume.com> | | || | | 02/17/2004 12:39 | | | PM | | | Please respond to| | | users| | || |-+> >--| | | | To: [EMAIL PROTECTED] | | cc: | | Subject: Re: [once again] best way to set http header encoding | >--| that makes sense The Tomcat changes/fixes related to this problem are released since Tomcat 5.0.15, and also ready for Tomcat 4.1.30 (not released yet, cvs version). This is however a rather tricky situation, and I think we should at least have the possibility to add the serializer encoding to the http header also, and possibly even make it the default behaviour (via a config option in web.xml?) Jan - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [once again] best way to set http header encoding
We also had a problem with Tomcat 4.1.29 and content-type. We backed up to 4.1.27, and are having no problems. Also, we've just started testing with Tomcat 5, and it looks like we don't have the problem with it. -Christopher |-+> | | Jan Uyttenhove | | | <[EMAIL PROTECTED]| | | ume.com> | | || | | 02/17/2004 05:00 | | | AM | | | Please respond to| | | users| | || |-+> >--| | | | To: [EMAIL PROTECTED] | | cc: | | Subject: Re: [once again] best way to set http header encoding | >--| allright If I find the time I'll provide a patch to this, because it is a very serious problem atm. I was investigating problem and solution already myself when you posted it to the maillist, because I can't work with the Apache directive, I will explain why. The default encoding in the header was added not 'that' long ago[1]. I'm using Tomcat 4.1.29 now, and it *does* set a default encoding to ISO-8859-1. So in a way you're lucky you're still using Tomcat 4.1.12, because with 4.1.29, the apache directive has no effect when connecting to Tomcat :-) This is why I'm looking for a good solution in Cocoon... We see and will see this issue more and more, as Bruno mentioned, but not only because of the browser implementation. In my opinion this is caused by the changes in this default encoding behaviour when using Tomcat. The very latest changes should change the behaviour again, so the upcoming Tomcat 4.1.30 should behave different again. I don't know what exactly the difference will be, this is wat the changelog for 4.1.30 says: " Restore the ability to explicitly set the charset to iso-latin-1. Now, you won't get the charset unless you ask for it (so no more Content-Type: image/gif; charset=iso-8859-1). However, if you call response.setCharacterEncoding("iso-9959-1"), you now get it in the response." So conclusion: Somewhere between Tomcat 4.1.12 en 4.1.27 the default encoding behaviour has changed (my guess is 4.1.17), and there's currently no way in Cocoon to set the http header encoding so it matches the encoding of the serializer (and meta tag). Anyone upgrading an old Tomcat will have this problem, unless using ISO-8859-1. The upcoming Tomcat 4.1.30 should change the behaviour again, but I'm not sure in what way. Jan [1] http://cvs.apache.org/viewcvs.cgi/jakarta-tomcat-connectors/coyote/src/java/org/apache/coyote/Response.java - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [once again] best way to set http header encoding
there may be no "best way". You can probably fix this issue at several different levels; Cocoon; Tomcat; Apache (if using it), etc. In Cocoon, the easiest would probably be an Action. It can be dirt simple. If you want to use an xsp-action, it could be something like this: xmlns:xsp="http://apache.org/xsp" xmlns:action="">"http://apache.org/cocoon/action/1.0"> response.setHeader("Content-Type", "text/html; charset=UTF-8"); sitemap entry (put in the pipeline for each matcher you want to set the encoding for): type="serverpages" src="">"path-to-action.xml"> It could work. -Christopher Stefan Burkard <[EMAIL PROTECTED]> Sent by: news <[EMAIL PROTECTED]> 02/16/2004 05:20 PM Please respond to users To: [EMAIL PROTECTED] cc: Subject: [once again] best way to set http header encoding [SORRY, ONCE AGAIN MY QUESTION, BECAUSE THERE WAS NO ANSWER] hi there i wonder that cocoons serializer just writes a meta-tag with the encoding in the html-page. it doesn't do this in the http-header. therefore apache set the http-header to his standard-encoding and "destroys" the correct encoding of the response, because most browsers ignore the meta-tag if the http-header-encoding is set. so i need to set the http-header-encoding with cocoon and ask you all, whats the best way to do this. are there any actions, logicsheets or something else? thanks and greetings stefan - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Cocoon XSP Documentation : Access to servlet object and core logicsheets
1. The request, context, and I believe the response object are declared and initialized for you, and can be used from any xsp:logic block. The request object is "request", etc. The session object is available from the request (request.getSession()), or is declared as "session" if you use the xsp-session logicsheet. These objects are Cocoon implementations, not the HttpServletRequest, etc. objects (look for Request, Session, etc. in the Cocoon API docs: http://cocoon.apache.org/2.1/apidocs/index.html You can learn a lot about the environment of an XSP program by looking at the class all XSP programs inherit from: XSPGenerator (again, see the API docs). You can also learn a lot by looking at the java source generated from your XSP pages (location varies depending on your servlet engine). I'm not sure where there might be good documentation on these kinds of basics, but perhaps one of the books available on Cocoon would help - just search Amazon for "Cocoon". 2. Some logicsheets are documented on the Cocoon documentation website (http://cocoon.apache.org/2.1/userdocs/xsp/index.html), but many are not. As with so many open source projects, documentation lags until volunteers make up the gap. (I wrote a couple - it was a good way to learn more about XSP and logicsheets.) For logicsheets not documented, your best bet is the source code. In this case, you want to look in your cocoon.jar file for the file "util.xsl", which is just an XSLT stylesheet that defines the elements you can use in your xsp program. Again, there may be better docs somewhere else, such as in a book or on the Cocoon wiki, which I am not so familiar with. Good luck! -Christopher I'm new to Cocoon, I browsed all the documentation distributed with Cocoon but I coundn't find how to access servlet object in XSP page. Question 1 -- how I cae access the various "request", "response", "session", "context" objects in an XSP logic? I couldn't find any official reference and I tried a lot as : ServletContext app = getServletContext(); Question 2 -- Someone knows if there is a documentation to the cocoon included logicsheet library (such as the 'util' used in the examples?, I means a complete API documentation or something like it). thank you in advance, Matteo -- people fall into 10 categories, who knows the binary and who doesn't - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Problems with custom taglib
As to your second question, you can't pass parameters dynamically from your xsp program (at runtime), if that's what you're hoping. You are creating an xml structure that your logicsheet can transform into XSP program code. You have all the power of XSLT to work with, but only *before* compilation. Within that, of course, you can create extremely parameterized code; for examples, look at the various cocoon built-in logicsheets. They have a number of standard templates for capturing various "parameters" from the XSP code. -Christopher - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Problems with custom taglib
To do a logicsheet, you need to keep in mind that what you are doing is creating an XSLT stylesheet to transform your code into valid XSP code. Your template certainly won't do that, because you are mixing class level logic (function definition) with method level logic (bare call to function) in the same template. If you use this template inside your page element, you'll have a function definition inside the generate() method of the final java code, which obviously won't compile. If you use the template outside your page element, you'll have a call to "getStr()" at the class level, outside any function, which obviously won't compile. What you want is a stylesheet that will put your function in at the class level (e.g., inside xsp:page, but outside any non-xsp elements), and your call to the function inside the method. So, try this instead: http://www.w3.org/1999/XSL/Transform"; xmlns:xsp="http://apache.org/xsp"; xmlns:byteConvert="http://www.beyarecords.com/conversion/byteConvert"; version="1.0"> private static String getStr() { String msg = "testing."; return msg; } getStr() If you want to create the getStr() method only when the byteConvert:convertByteArrayToImage template is used, then you can wrap the xsp:logic block in an xsl:if block: ... HTH -Christopher - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: XSP, "for" loop, XSP logicsheets
Are you saying that you want your logicsheet "my-logicsheet:do-with-i" to generate different XSP code depending on the value of i? That isn't possible, to my knowledge. If you just want to have a for-loop calling a template in a logicsheet, that's fine, but the logicsheet's XSLT templates cannot depend on the value of i (that value doesn't exist yet). You can create Java code to do a case statement or a bunch of if-else statements to vary the behavior based on the value of i. -Christopher "Hubert Trzewik \(Prosystel\)" <[EMAIL PROTECTED]> 01/26/2004 01:22 PM Please respond to users To: <[EMAIL PROTECTED]> cc: Subject: XSP, "for" loop, XSP logicsheets Is it possible to do something like this? for (int i=0; i i } The problem is, that I have working logicsheet and I need prepare a fragment tree to be processed by this logicsheet. So, my XSP in fact should ganarete (using pure Java) another XSP with XML Logicsheet 'statments' and that one should be finally processed (so we process twice) - but I'm not sure if it's a good way of solving problem. Any idea? -- Hubert Trzewik Prosystel Sp. z o.o. [EMAIL PROTECTED]
Re: Logicsheet not working, anyone help?
Nothing else catches my eye. Here's a couple of things to try: 1) Touch the source XSP (main.xsp) - sometimes logicsheet changes don't get picked up by Cocoon the way they are supposed to after just changing the logicsheet 2) Simplify the problem - strip the code down to the bare minimum to debug, for instance: a) modify your sitemap entry to serialize to XML after doing the server-pages generator step (strip out the XSLT step) b) strip your main.xsp to something like http://apache.org/xsp"; xmlns:abc="http://samspublishing.com/abc/1.0";> 3) look at the generated java source for your XSP page - under your Tomcat work directory good luck! -Christopher |-+> | | "Tommy Smith"| | | <[EMAIL PROTECTED]| | | .com>| | || | | 01/21/2004 10:28 | | | AM | | | Please respond to| | | users| | || |-+> >--| | | | To: [EMAIL PROTECTED] | | cc: | | Subject: Re: Logicsheet not working, anyone help? | >--| Thanks for the reply. I tried as you suggested, but still don't see any output from logicsheet. >From: Christopher Painter-Wakefield <[EMAIL PROTECTED]> >Reply-To: [EMAIL PROTECTED] >To: [EMAIL PROTECTED] >Subject: Re: Logicsheet not working, anyone help? >Date: Wed, 21 Jan 2004 09:57:20 -0500 > > > > > >I believe the problem is in your "catch-all" template in your logicsheet: > > > > > > > >because this is AFTER your template matching abc:datetime, and not at a >lower priority, it gets applied instead of your abc:datetime template. >Change the above template to have priority="-2" and you'll get better >results. > >-Christopher > > > > >|-+> >| | "Tommy Smith"| >| | <[EMAIL PROTECTED]| >| | .com>| >| || >| | 01/21/2004 09:46 | >| | AM | >| | Please respond to| >| | users| >| || >|-+> > > >--| > | > | > | To: [EMAIL PROTECTED] > | > | cc: > | > | Subject: Logicsheet not working, anyone help? > | > > >--| > > > > >Hi, > >I am trying to get my first logic sheet up and running but with little >success. > >I'm working through the Cocoon Developers Handbook. > >web page is rendered but not logicsheet output. > >Can anyone spot what is wrong? > >Sorry for the length of mail > >Logic sheet > > > xmlns:xsl="http://www.w3.org/1999/XSL/Transform"; > xmlns:xsp="http://apache.org/xsp"; > xmlns:abc="http://samspublishing.com/abc/1.0"; > version="1.0"> > > > > > > java.util.Date > > >Date now = new Date(); > > > > > > > The current time is now > > > > > > > > > > > > > > >main.xsp entry*** > > > > xmlns:xsp="http://apache.org/xsp"; > xmlns:abc="http://samspublishing.com/abc/1.0"; > > > > > > >Welcome to ABC Software > > Hello! > >
Re: Logicsheet not working, anyone help?
I believe the problem is in your "catch-all" template in your logicsheet: because this is AFTER your template matching abc:datetime, and not at a lower priority, it gets applied instead of your abc:datetime template. Change the above template to have priority="-2" and you'll get better results. -Christopher |-+> | | "Tommy Smith"| | | <[EMAIL PROTECTED]| | | .com>| | || | | 01/21/2004 09:46 | | | AM | | | Please respond to| | | users| | || |-+> >--| | | | To: [EMAIL PROTECTED] | | cc: | | Subject: Logicsheet not working, anyone help? | >--| Hi, I am trying to get my first logic sheet up and running but with little success. I'm working through the Cocoon Developers Handbook. web page is rendered but not logicsheet output. Can anyone spot what is wrong? Sorry for the length of mail Logic sheet http://www.w3.org/1999/XSL/Transform"; xmlns:xsp="http://apache.org/xsp"; xmlns:abc="http://samspublishing.com/abc/1.0"; version="1.0"> java.util.Date Date now = new Date(); The current time is now main.xsp entry*** http://apache.org/xsp"; xmlns:abc="http://samspublishing.com/abc/1.0"; > Welcome to ABC Software Hello! Welcome to the ABC Software support website. On this site, you will be able to submit support requests, track open requests and view your support contract bills. ... - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: [OT] Re: I'm searching for good tutorial about creating XSP l ogicsheets
:) Thanks. I was a bit grumpy in my previous reply, sorry to one and all. I too am frustrated at not being able to configure my client in the best way for mailing lists. Notes works best with other Notes users, which is the vast majority of my work e-mail, so I'm afraid I'll keep posting that "junk" at times. -Christopher More likely an idiot Notes admin who just figured out how to do sigs Anybody with any Netiquette knows anything over a couple of lines is annoying and a waste of bandwidth. Don't let that stop you from posting, Christopher...I'd rather be a bit annoyed than not having your help. Mark - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [OT] Re: I'm searching for good tutorial about creating XSP logicsheets
Sorry, my client is Lotus Notes, it does that instead of using quoting the former message with ">". No way to force the latter behavior. Is this reply better? If not, I suppose I could stop helping people on the mailing list, if it would make you feel better. -Christopher on Wed, 14 Jan 2004 12:13:42 -0500 Christopher Painter-Wakefield <[EMAIL PROTECTED]> wrote: will you stop sending this junk? Regards, Rufio -- 010 > XMMS now playing 0x97EB7818 001 > Abigor 111 > Universe Of Black Divine - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: I'm searching for good tutorial about creating XSP logicsheets
Are you familiar with XSLT? (If not, you will not get far making logicsheets!) Just think of an XSLT expression that transforms your XSP to create the XSP code you need. In your example, for instance (assuming foo-value and bar-variable are Java expressions): Result of doing something is Result of doing something else is is a very simple possibility. Result of doing something is Result of doing something else is is better. It's very simple; a logicsheet replaces the logicsheet tags with XSP code. In other words, every logicsheet is an XSLT that transforms an XSP program into another XSP program. Or put yet another way, in each step you are adding more and more xsp namespace code, while removing code in the namespace of the logicsheet. If you get stuck, put your XSP program and your logicsheet through a XSLT transform step (e.g., in XML Spy, or through Xalan), and look at the output. The output should be a correct XSP program. If not, you have a bug. -Christopher |-+--> | | "Hubert Trzewik| | | \(Prosystel\)" | | | <[EMAIL PROTECTED]| | | tel.com.pl>| | | | | | 01/14/2004 12:21 PM| | | Please respond to users| | | | |-+--> >--| | | | To: <[EMAIL PROTECTED]> | | cc: | | Subject: Re: I'm searching for good tutorial about creating XSP logicsheets | >--| I know this tutorial, but it's not enough. I'm trying to build my own logicsheet which could be used in XSP in this way: foo-value bar-variable now in logicsheet XSLT, how to do it properly to access entity1 and entity 2 in template
Re: I'm searching for good tutorial about creating XSP logicsheets
How about this: http://cocoon.apache.org/2.1/userdocs/xsp/logicsheet.html -Christopher |-+--> | | "Hubert Trzewik| | | \(Prosystel\)" | | | <[EMAIL PROTECTED]| | | tel.com.pl>| | | | | | 01/14/2004 12:04 PM| | | Please respond to users| | | | |-+--> >--| | | | To: <[EMAIL PROTECTED]> | | cc: | | Subject: I'm searching for good tutorial about creating XSP logicsheets | >--| I'm searching for good tutorial about creating XSP logicsheets. I could not found any interesting docs about creating own logicsheets on Wiki. Do you know any? -- Hubert Trzewik Prosystel Sp. z o.o. [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: XSP DTD
Somebody posted a simple XSP Schema for use with Sunbow, etc. not long ago. I grabbed it, but haven't tried it out yet. Here's a link: http://marc.theaimsgroup.com/?l=xml-cocoon-users&m=106680587116311&w=2 -Christopher |-+> | | Gianluca Sartori | | | <[EMAIL PROTECTED]| | | rg> | | || | | 01/14/2004 06:53 | | | AM | | | Please respond to| | | users| | || |-+> >--| | | | To: [EMAIL PROTECTED] | | cc: | | Subject: XSP DTD | >--| Hi, where can I find XSP and ESQL DTDs? I cannot find'em in the cocoon distribution. Thanks, Gianlica - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Problems with date and xsp
um, is your tag, in your code below. Put your xsp:logic block inside your addcomment block. Davide <[EMAIL PROTECTED]> 01/03/2004 03:02 PM Please respond to users To: [EMAIL PROTECTED] cc: Subject: Re: Problems with date and xsp Thanks a lot, but now the problem is: what is and where do I need to put it? You are instantiating your Date variable at the class level, when the page is instantiated. Cocoon re-uses the page object (just calling the generate() method each time), AFAIK. So you need to put your Date instantiation inside the generate() method by doing the logic block inside . That way you will get the current date each time the page is requested, instead of just the first time. -Christopher Davide <[EMAIL PROTECTED]> 01/03/2004 02:26 PM Please respond to users To: [EMAIL PROTECTED] cc: Subject: Problems with date and xsp Hi, i have some problems in getting the actual timestamp to put it into a db. My xsp is: xmlns:xsp="http://apache.org/xsp" xmlns:xsp-request="http://apache.org/xsp/request/2.0" xmlns:xsp-session-fw="http://apache.org/xsp/session-fw/1.0" xmlns:esql="http://apache.org/cocoon/SQL/v2"> java.util.Date now=new java.util.Date(); Add a comment images/logobg.gif css/main.css mcnavigator Insert into comments (User_ID, Comment_text, Commented_URL, Comment_Date, Comment_browser) values ( ' path="/authentication/ID"/>', '', '', 'new java.sql.Timestamp(now.getTime())', '') An error occurred Your comment has ben added; you can now close this window The problem is that every time i add a new record to the db using this xsp i notice that the time doesn't change. Any solution?? Best Regards, Davide - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Problems with date and xsp
You are instantiating your Date variable at the class level, when the page is instantiated. Cocoon re-uses the page object (just calling the generate() method each time), AFAIK. So you need to put your Date instantiation inside the generate() method by doing the logic block inside . That way you will get the current date each time the page is requested, instead of just the first time. -Christopher Davide <[EMAIL PROTECTED]> 01/03/2004 02:26 PM Please respond to users To: [EMAIL PROTECTED] cc: Subject: Problems with date and xsp Hi, i have some problems in getting the actual timestamp to put it into a db. My xsp is: xmlns:xsp="http://apache.org/xsp" xmlns:xsp-request="http://apache.org/xsp/request/2.0" xmlns:xsp-session-fw="http://apache.org/xsp/session-fw/1.0" xmlns:esql="http://apache.org/cocoon/SQL/v2"> java.util.Date now=new java.util.Date(); Add a comment images/logobg.gif css/main.css mcnavigator Insert into comments (User_ID, Comment_text, Commented_URL, Comment_Date, Comment_browser) values ( ' path="/authentication/ID"/>', '', '', 'new java.sql.Timestamp(now.getTime())', '') An error occurred Your comment has ben added; you can now close this window The problem is that every time i add a new record to the db using this xsp i notice that the time doesn't change. Any solution?? Best Regards, Davide - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: ESQL : creating dynamic elements ?
try this: String s1 = "junk"; String s2 = "stuff"; s1 s 2 -Christopher |-+> | | "julien bloit" | | | <[EMAIL PROTECTED]| | | am.fr> | | || | | 12/15/2003 10:30 | | | AM | | | Please respond to| | | users| | || |-+> >--| | | | To: <[EMAIL PROTECTED]> | | cc: | | Subject: ESQL : creating dynamic elements ? | >--| I'm building a database request using ESQL. Let's say I have a table with two columns in the table i'm requesting. This is the xsp snippet I use to get the results from the request : This works, but as I want this code to be dynamic in order to be used with other tables, I need my column element name (the currently static "" element) to be created with the requested column name. The same logic would apply for the 'name' attribute in the 'xsp:attribute' element. I don't know if this is possible, using the esql logicsheet. any ideas? Thank you, Julien - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: XML serializer; handling characters outside the encoding
Never mind. I just looked at the output with a different editor; it looks like the characters are getting put in as entity references. Not sure now what is going on, I'll have to investigate further. Perhaps my end user can't handle US-ASCII, either :( |-+> | | Christopher | | | Painter-Wakefield| | | <[EMAIL PROTECTED]| | | .edu>| | || | | 12/15/2003 10:28 | | | AM | | | Please respond to| | | users| | || |-+> >--| | | | To: [EMAIL PROTECTED] | | cc: | | Subject: XML serializer; handling characters outside the encoding | >--| I have a data consumer who is pulling XML from our Cocoon webapp. They couldn't handle UTF-8 on their end, so I gave them the option to pull data in US-ASCII encoding. However, when I did that, symbol characters such as Greek and math symbols got sent over even though they aren't in the encoding. When I saved a result from our system and opened it with XML Spy, it complained about these characters. On my consumer's end, it makes his software blow up. I'm not sure exactly how these characters are output (I don't have a good byte-level editor), but I assume it is doing some kind of double-character thing that creates bytes outside the range of defined characters for the encoding, or something similar. My question is, what should the behavior be when coping with characters outside the encoding, and where does the responsibility lie? My assumption would be that the XML serializer should take characters outside the encoding and turn them into entity references (Δ for greek delta, for instance). I am on C2.0.3, so maybe that has been done in a later release, but if not, should it? I am going to explore a change to the serializer for just that purpose, but if it has already been done, I'd like to grab the code for it. I'm assuming you can use character entities in any encoding, regardless of whether the characters thus specified have a code in that encoding. Thanks, Christopher - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
XML serializer; handling characters outside the encoding
I have a data consumer who is pulling XML from our Cocoon webapp. They couldn't handle UTF-8 on their end, so I gave them the option to pull data in US-ASCII encoding. However, when I did that, symbol characters such as Greek and math symbols got sent over even though they aren't in the encoding. When I saved a result from our system and opened it with XML Spy, it complained about these characters. On my consumer's end, it makes his software blow up. I'm not sure exactly how these characters are output (I don't have a good byte-level editor), but I assume it is doing some kind of double-character thing that creates bytes outside the range of defined characters for the encoding, or something similar. My question is, what should the behavior be when coping with characters outside the encoding, and where does the responsibility lie? My assumption would be that the XML serializer should take characters outside the encoding and turn them into entity references (Δ for greek delta, for instance). I am on C2.0.3, so maybe that has been done in a later release, but if not, should it? I am going to explore a change to the serializer for just that purpose, but if it has already been done, I'd like to grab the code for it. I'm assuming you can use character entities in any encoding, regardless of whether the characters thus specified have a code in that encoding. Thanks, Christopher - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: dynamic setting of encoding on serializer?
Thanks - that's a big help, although I may just take the path of least resistance and hand-configure for now :) -Christopher The fact that serializers don't accept parameters and don't have access to the objecmodel has come up before here and is indeed a pain. Can you maybe add a node to the xml using a stylesheet transformer (they do accept parameters), and then filter out this node in the serializer and remove it from the xml before you serialize to the client. Ofcourse for this to work you would need to override at least startdocument, enddocument, startelement and endelement to buffer the xml buildup before you modify it. Admitted, it's a Big Bodge(tm), but it works. Alternatively, there is a patch waiting for the 2.1x branch that is supposed to add parameters for the SVG serializer. Maybe you can have a look how it's done and generalize it to the 2.0.x branch for any serializer. Hope this helps Jorg - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
dynamic setting of encoding on serializer?
Is there any way to dynamically set the encoding of output on a serializer, specifically the XML serializer? I have a customer who is having trouble handing UTF-8 output from my application (he is using Lotus Notes), and would like me to supply a different encoding. I can just create a different serializer with the encoding he wants, but he might need to try more than one to get the desired result, and I don't want to create a thousand serializer entries in my sitemap just so I can handle every possible encoding (okay, I'm exaggerating). I looked at the source (C2.0.x) to see if I could create my own serializer to do this, but there appears to be no easy way; the serializer don't implement SitemapModelComponent, and thus don't get access to any of the usual objects (e.g., parameters, objectModel). Any thoughts? -Christopher - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: How to nest logicsheet tags of different libraries
Too bad. I guess you'll have to construct the String manually by iterating over the child nodes of the DocumentFragment yourself. Check out the API at http://java.sun.com/j2se/1.4.1/docs/api/org/w3c/dom/Node.html -Christopher |-+> | | "Stephanie | | | Zohner" | | || | || | | 12/10/2003 10:19 | | | AM | | | Please respond to| | | users| | || |-+> >--| | | | To: [EMAIL PROTECTED] | | cc: | | Subject: Re: How to nest logicsheet tags of different libraries | >--| Hi, > > > > > seems like it maybe should be using getNodeValue() instead of > getFirstChild().getNodeValue(), but I'm not familiar with the > xsp-session-fw stuff (I'm not on C2.1 yet). > > The obvious workaround would seem to be > > org.w3c.dom.DocumentFragment fragment = >path="/authentication/data/name"/>; > fragment.getNodeValue() This causes the String to be "null", because getNodevalue() returns null. :-( > > I also wonder what would happen if you did > > > > path="/authentication/data/name"/> > > This has the same effect as 'as=string' without the tag around. :-( > > which would wrap a String.valueOf() around the DocumentFragment. > > -Christopher > > > > |-+> > | | "Stephanie | > | | Zohner" | > | || | @gmx.at> | > | || > | | 12/10/2003 04:45 | > | | AM | > | | Please respond to| > | | users| > | || > |-+> > > >--| > | > | > | To: [EMAIL PROTECTED] > | > | cc: > | > | Subject: Re: How to nest logicsheet tags of different libraries > | > > >--| > > > > > Thanks a lot, that was the solution, however now I have another problem. > > path="/authentication/data/name"/> > > returns not the whole string, I put in the authentication context, but > only > the first 7 chars, or so . > For example, when I put "Stephanie Zohner" in the context, only "Stephan" > is > returned. > > I looked into the generated Java Code. This is the code fragment, that is > generated out of the Tag. > > XSPSessionFwHelper.getXML(this.manager, > String.valueOf("authentication"), > > String.valueOf("/authentication/data/name"))).getFirstChild().getNodeValue()) > > ); > > It takes only the first child node of the returned XML Fragment. However > "Stephanie Zohner" is shared among 3 child nodes.Taking only the first > node > results in extracting only the first of three parts of my name. > > This happens when I use the "as= 'string'". If I use "as= 'object'" I > would > get the entire string, but then again I get an eeption (as you have > predicted), because a String is expected by the my method and not an > DocumentFragment. > > Is it a bug, that only the first node is taken when using the attribute > ''as > = 'string''? > > Are there any work arounds? > > > Thanks in advance, > > Stephanie > > > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > -- +++ GMX - die erste Adresse für Mail, Message, More +++ Neu: Preissenkung für MMS und FreeMMS! http://www.gmx.net - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail
Re: How to nest logicsheet tags of different libraries
seems like it maybe should be using getNodeValue() instead of getFirstChild().getNodeValue(), but I'm not familiar with the xsp-session-fw stuff (I'm not on C2.1 yet). The obvious workaround would seem to be org.w3c.dom.DocumentFragment fragment = ; fragment.getNodeValue() I also wonder what would happen if you did which would wrap a String.valueOf() around the DocumentFragment. -Christopher |-+> | | "Stephanie | | | Zohner" | | || | || | | 12/10/2003 04:45 | | | AM | | | Please respond to| | | users| | || |-+> >--| | | | To: [EMAIL PROTECTED] | | cc: | | Subject: Re: How to nest logicsheet tags of different libraries | >--| Thanks a lot, that was the solution, however now I have another problem. returns not the whole string, I put in the authentication context, but only the first 7 chars, or so . For example, when I put "Stephanie Zohner" in the context, only "Stephan" is returned. I looked into the generated Java Code. This is the code fragment, that is generated out of the Tag. XSPSessionFwHelper.getXML(this.manager, String.valueOf("authentication"), String.valueOf("/authentication/data/name"))).getFirstChild().getNodeValue()) ); It takes only the first child node of the returned XML Fragment. However "Stephanie Zohner" is shared among 3 child nodes.Taking only the first node results in extracting only the first of three parts of my name. This happens when I use the "as= 'string'". If I use "as= 'object'" I would get the entire string, but then again I get an eeption (as you have predicted), because a String is expected by the my method and not an DocumentFragment. Is it a bug, that only the first node is taken when using the attribute ''as = 'string''? Are there any work arounds? Thanks in advance, Stephanie - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: How to nest logicsheet tags of different libraries
try instead. That should copy the into the output, where it will later get turned into some kind of java expression (hopefully!) by the xsp-session-fw logicsheet. However, I think you want to change your getxml tag as attribute to as="string", or else it looks like you will get an org.w3c.dom.DocumentFragment instead of String, and get an exception anyway! -Christopher Hi, I have big problems with my custom logicsheet, hopeyou can help: I would like to read the user name from the authentication context and use it as a parameter for a method call of my Helper Class. However, at the time the template wants to replace with the value from the authentication context, there is no (text) value. So that in the end, the XSP is transformed to: BlockerHelper.getInstance().setEditorName(); This throughs an exception, because a String value is expected as method parameter. Every hint is appreciated, Thanks Stephanie My xsp:page looks like this: http://apache.org/xsp"; xmlns:blocker="http://test.de/blocker"; xmlns:xsp-session-fw=" http://apache.org/xsp/session-fw/1.0";> The XSL-Template in my logicsheet looks like this: BlockerHelper.getInstance().setEditorName(); -- +++ GMX - die erste Adresse für Mail, Message, More +++ Neu: Preissenkung für MMS und FreeMMS! http://www.gmx.net - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: FW: Escaping in XSP Logic
I am not a Java expert! My guess, it looks like an encoding problem, perhaps due to your XML editor, or some oddity within the Cocoon pipeline. I tried this in my environment (C2.1, Tomcat, using Eclipse+Sunbow for coding) and it worked fine when I set the XSP source encoding to iso-8859-1. When I used UTF-8 encoding and the entity reference ç it worked fine. When I used UTF-8 encoding and put the ç directly in the code, I got a Cocoon processing exception (java.io.UTFDataFormatException): "Invalid byte 2 of 3-byte UTF-8 sequence". So my guess is that the Sunbow editor saved the code wrong for the encoding my XML is supposed to be using. Probably your best bet is to change your source file encoding to UTF-8, and use the entity reference. -Christopher |-+---> | | "Yves Vindevogel" | | | <[EMAIL PROTECTED]| | | lements.be> | | | | | | 12/04/2003 04:30 PM | | | Please respond to | | | users | | | | |-+---> >--| | | | To: <[EMAIL PROTECTED]> | | cc: | | Subject: FW: Escaping in XSP Logic | >--| nobody ? -Original Message- From: Yves Vindevogel [mailto:[EMAIL PROTECTED] Sent: woensdag 3 december 2003 19:21 To: [EMAIL PROTECTED] Subject: Escaping in XSP Logic Hi, I have this syntax ... String sMessageNoResultsOther = "Pas de produits qui commençent avec 1-...-9, ..." ; When I use the to put the string there, I lose my "ç". It's represented as "?". I have this with all characters from "Iso-8859-1" with "strange" chars. My XSP is declared with correct encoding Is there a way to avoid this, or to use escaping in xsp:logic ? I tried with ç but that's no help. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Logicsheet as condition
What you want to do should work fine. Instead of putting the ESQL code or whatever directly in the template, put it all in a function, then put the function call in the template. -Christopher |-+> | | [EMAIL PROTECTED]| | | .cz | | || | | 12/02/2003 06:46 | | | PM | | | Please respond to| | | users| | || |-+> >--| | | | To: [EMAIL PROTECTED] | | cc: | | Subject: Logicsheet as condition | >--| Hi all, I'm making a little project in cocoon and I have been cornered now (nothing unusal :)). I need to implement a permission control of user's actions (it means, that for example some users can create something, another users can just read somehing etc.). All is ok, but I don't know, how to check user's permissions in XSP. My idea is to write something as: if ( == true) { ... then do something, what are you allowed to (some XSP, calling another logicsheets etc.)... } or something like that: ... then do anything, what are you able to... The namespace "permission" is defined by a logicsheet, for example template "check" will look into SQL databaese, if the appropriate user has appropriate permission "user_can_write". I think, that it is relatively usual stuff and many of you have to write it almost every day... But when I tried to make it, following problems encountered: In the first case is a problem, that if template looks into db thru ESQL, it creates tons of java code, so it is no possible to compare with value as a normal variable, of course. In the second example I solve a problem, how to copy the inner content of template without changes to be consequently correctly evaluate by another logicsheets (my own other logicsheets, xsp logicsheet etc.) and virtual machine. Another possibility is to write a pure java class, it will look into db and will be return corresponding information. But how to use a connection pool of cocoon (and if possible without settings of concrete connection parameters, that are stored in the cocoon configuration file)? Don't you know a link to concrete examples? In user docs are just very general and non-concrete informations. What am I doing wrong, please? Or do you have another idea, how to solve my problem or some existing solution? Thanks a lot! osup - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Logicsheet with code inside
perhaps these docs will help: http://cocoon.apache.org/2.1/userdocs/xsp/logicsheet.html#Simple+XSP+Logicsheet+Example -Christopher [EMAIL PROTECTED] 12/01/2003 11:57 PM Please respond to users To: [EMAIL PROTECTED] cc: Subject: Logicsheet with code inside Hi, I'd like to do logicsheet, it should just copy of input code. Example: XSP script looks like: ... java code, using other logicsheet, simply anything ... XSL logisheet define should look like (I thought): or something like But nothing of the above doesn't work correctly (mainly calling other logicsheets, it seems). Do you know right way? Thanks a lot! - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: XSP logic if failing
You can't do String equality this way in Java. Try this instead: if (!("Manager".equals(type))) { ... } The = for Strings is an Object identity test, not a value comparison test. -Christopher |-+> | | "JD Daniels" | | | <[EMAIL PROTECTED]>| | || | | 11/20/2003 01:58 | | | PM | | | Please respond to| | | users| | || |-+> >--| | | | To: "Cocoon Users" <[EMAIL PROTECTED]> | | cc: | | Subject: XSP logic if failing | >--| String str=""; String type = session.getAttribute("userRole").toString(); if ( type != "Manager") { str=" AND tasks.assignedTo='" + session.getAttribute("userId") + "'"; } Tasks :: Role = type For some reason, this if block will ALWAYS fail... even when the session attribute IS Manager. (The xsp:attribute gets put into my page title, and "Manager" comes out properly.. but the if block stills fails... Any Ideas? JD - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: XSP with multiple logicsheet compilation errors
thanks! We'll look at it. Wish me luck :) |-+-> | | Vadim Gritsenko | | | <[EMAIL PROTECTED]| | | erizon.net> | | | | | | 11/14/2003 08:24 | | | AM| | | | |-+-> >--| | | | To: [EMAIL PROTECTED] | | cc: [EMAIL PROTECTED] | | Subject: Re: XSP with multiple logicsheet compilation errors | >------| Christopher Painter-Wakefield wrote: >Can someone who has worked on the >XSP generation code contact me and perhaps suggest some classes to look at, >which control the application of logicsheets to the XSP source? > Flow goes like this: * ServerPagesGenerator.setup() * ProgramGeneratorImpl.load() * ProgramGeneratorImpl.createResource() (synchronized) * ProgramGeneratorImpl.generateResource * AbstractMarkupLanguage.generateCode * LogicsheetCodeGenerator.generateCode Logicsheets are added during XML parsing/processing into XML pipe via: * TransformerChainBuilderFilter.startElement * AbstractMarkupLanguage.addLogicsheetsToGenerator * LogicsheetCodeGenerator.addLogicsheet Hope this helps to find you your issue; note that there is one synchronization point above which should prevent multithreading issues. If you find the root of your problem, patch or bug report is welcome :) PS Above is based on 2.0.5-dev, 2.0.3 is not much different Vadim - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
XSP with multiple logicsheet compilation errors
Sorry for the cross-posting; I wasn't sure who would best be able to answer. We are using C2.0.3 on Tomcat 4.1. If it is relevant, the problem most frequently happens on our servers which are Solaris 8, Apache 1.3.x, mod_jk. We keep having a problem occasionally in which logicsheets are not properly applied to our XSP's, resulting in uncompilable code. We so far cannot reproduce the problem reliably. It usually happens at the worst possible time (e.g., when we have just deployed new software to production, or during a demo). Sometimes the problem can be fixed by stopping and restarting the web application. Sometimes the problem can be fixed by mucking with the XSP source code, although I haven't found any reliable way to fix it. We make heavy use of logicsheets, and our logicsheets use other logicsheets, and so forth so that there is often quite a long chain of logicsheets that must be applied to generate our source, and I'm sure that contributes to the problem. However, the intermittent nature of the problem leads me to believe that it is a "bug" or at least shortcoming in the XSP generation code. A typical symptom of the problem is that some page will not compile, and when we go to look at the source code, the source has not transformed tags for one or more logicsheets (often ESQL). Instead, java code is generated that attempts to output the logicsheet tags. So, for instance, if you have code like: if ( == -1) { } it turns into: if ( this.contentHandler.startElement( "", "esql:get-int", "esql:get-int", xspAttr ); ... ) or something like that, and you can see why it wouldn't compile! Note that these pages do compile most times, so it isn't due to missing namespace declarations or anything like that. The problem doesn't appear to be due to any problems with our code - the same webapp code that compiled and ran fine on our workstation or on a test server will suddenly compile wrong on the production server, then fix itself as soon as we restart tomcat. Also, we have seen this happen both with the built-in esql logicsheet as well as our own logicsheets. Our best theory at this point (and it is only a theory - we don't know where in the code to even begin looking for this) is that when an uncompiled page is called twice quickly (as might happen on a production server), the two calls interfere with some shared queue or some such which informs the XSP generator which logicsheets to apply, and in which order. In other words, some shared structure which is not properly protected for a multi-threaded environment. The best evidence in favor of this theory, I think, is the fact that the bug doesn't happen regularly (say 1 time in 10 deployments), even on the exact same code. Anyway, does anyone have any ideas about this? I searched the archives and found nothing, but is this perhaps a known issue? Is it fixed in a newer version of Cocoon? (We do plan to move to C2.1, but have higher priorities right now; and since we can't reproduce the problem reliably, we can't quickly test "just to see" right now.) Can someone who has worked on the XSP generation code contact me and perhaps suggest some classes to look at, which control the application of logicsheets to the XSP source? Any help greatly appreciated. -Christopher - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: XSP and looping elements
This should work fine, although you may need to put around your for loop (inside ). Are you finding that it doesn't work? You could also put the for loop around your node. -Christopher |-+-> | | Joose Vettenranta | | | <[EMAIL PROTECTED]| | | chnika.com> | | | | | | 11/12/2003 02:23 PM | | | Please respond to users | | | | |-+-> >--| | | | To: [EMAIL PROTECTED] | | cc: | | Subject: Re: XSP and looping elements | >--| ma, 2003-10-27 kello 14:01, John L. Webber kirjoitti: > for (int i = 0; i < 10; ++i) { > > } Ok, this works, but, What if I want to loop ESQL-commands? x for (int i = 0; i < 10; i++) { SELECT NEXTVAL('list_id_seq') as id } Will make: http://apache.org/cocoon/XSPDoc/v1"; xmlns:esql="http://apache.org/cocoon/SQL/v2"; xmlns:xsp="http://apache.org/xsp";> x for (int i = 0; i < 10; i++) { And no SELECT-clauses to SQL-server.. So, howto loop SELECT-clause? - Joose > > Joose Vettenranta wrote: > > >Hi, > > > >how can I do this in XSP: > > > > > >for (int i=0; i<10; ++i) { > > > >} > > > > > >so that would be 10 times in XML-file. > > > >Using cocoon 2.1 > > > >- Joose > > > > > > -- Joose Vettenranta, Intertechnika Oy E-Mail: [EMAIL PROTECTED] WWW: http://www.intertechnika.com/ GSM: 044 561 0270 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Dynamic parameter for logicsheet
My previous answer was lacking in several respects. Here is a better one: you are expecting your query to end up with "id = 5", but that won't happen because your logicsheet is applied *before* the XSP is even turned into Java code. So there is no possible way that your logicsheet could obtain the value "5" from the java variable and do the substitution as you are expecting. Here is better code that will behave dynamically, and follows the "best practices" for ESQL: ... select * from section where id= ... -Christopher |-+> | | Otmar Vobejda| | | <[EMAIL PROTECTED]>| | || | | 11/09/2003 08:11 | | | PM | | | Please respond to| | | users| | || |-+> >--| | | | To: [EMAIL PROTECTED] | | cc: | | Subject: Dynamic parameter for logicsheet | >--| Hi people, I don't understand one thing: in XSP file I have this piece of code: String sectionId = 5; sectionId this "calls" template "section:edit" in logicsheet, which is defined: ... select * from section where id= ... It should send to SQL server query 'select * from section where id=5', But to ESQL it sends query 'select * from section where id=sectionId'. WHY??? And why to do it correctly? Thanx! osup - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Dynamic parameter for logicsheet
Remember, your logicsheet is an xslt stylesheet transforming one XSP file into another. When you do you are getting the text value of the node, which in this case is "sectionId". What you should be doing in your logicsheet is . -Christopher |-+> | | Otmar Vobejda| | | <[EMAIL PROTECTED]>| | || | | 11/09/2003 08:11 | | | PM | | | Please respond to| | | users| | || |-+> >--| | | | To: [EMAIL PROTECTED] | | cc: | | Subject: Dynamic parameter for logicsheet | >--| Hi people, I don't understand one thing: in XSP file I have this piece of code: String sectionId = 5; sectionId this "calls" template "section:edit" in logicsheet, which is defined: ... select * from section where id= ... It should send to SQL server query 'select * from section where id=5', But to ESQL it sends query 'select * from section where id=sectionId'. WHY??? And why to do it correctly? Thanx! osup - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Recursive reading from database
This should be fine. What is wrong? Does it cause compilation errors? Have you tried doing this and calling your testMethod() from within an xsp:logic block inside your page element? -Christopher |-+> | | Otmar Vobejda| | | <[EMAIL PROTECTED]>| | || | | 11/05/2003 05:40 | | | PM | | | Please respond to| | | users| | || |-+> >--| | | | To: [EMAIL PROTECTED] | | cc: | | Subject: Re: Recursive reading from database | >--| Maybe stupid question, but how to insert ESQL tags inside block? Next example is absolutly wrong: public void testMethod() { diplpool select id, name from test Empty Error! } - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Recursive reading from database
No, your functions must be defined within an xsp:logic block, which will protect them from being the top user element in xsp:page. The output won't occur until you call the function, which will be within your top user element. So you should be able to get the output you are expecting. I have had problems in the past doing output from user functions, due to some xspAttr variable or some such not being available. It seems to me that it was easy enough to fix, by passing the missing variable into the function call. If that won't work, you can always fall back on building a list in Java via recursion, and returning that from your function. Loop on the list in your main body to output. But you should be able to do output from your functions, with a little work. -Christopher Otmar Vobejda <[EMAIL PROTECTED]>To: [EMAIL PROTECTED] cc: 11/05/2003 03:48 Subject: Re: Recursive reading from database PM Please respond to users Thanx for your answer. I'm using mysql now and there is no similar feature as you said, I think. > ESQL elements don't have to be inside the top user element, at least in... Yes, it is maybe possible, that it can be outside the top user element, but if ESQL elements are generating some XML output, the top element of this output is taken as top user element and that's not good. If I want to use it recursively, it will generate uncorrect data. What i want to generate, can be something like this: blabla - bleble - - blibli - blublu blabla2 And what to do now... ? :) thanx osup - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Recursive reading from database
ESQL elements don't have to be inside the top user element, at least in C2.0. We use ESQL in user-defined functions all the time. This wasn't the case in C1, as it used local variables in the generate() method, but now all its variables are declared at the object level, and just initialized in the generate() method. I take it you are using a database other than Oracle? Oracle provides support for this kind of tree relationship in SQL (using the CONNECT BY clause). -Christopher |-+> | | Otmar Vobejda| | | <[EMAIL PROTECTED]>| | || | | 11/05/2003 04:47 | | | AM | | | Please respond to| | | users| | || |-+> >--| | | | To: [EMAIL PROTECTED] | | cc: | | Subject: Recursive reading from database | >--| Hi, i'm a beginner in the Cocoon domain and first problem, what I'd like to solve, is recursive reading from database. For example you have a table test(id int, parent int, name varchar), where parent attribute points to id attribute of parent rows and you need to read all the rows to the tree. for example something like this (excuse the syntax :): // recursive function public void readData (int parent) { select id, name from test where parent= $parent; for each result { print ($name); readData($id); } // start recursion: readData(null); But how to write in XSP, when methods need to be in root element and esql tags must be inside top user element (or how it is termed). Thank a lot for each your outline! osup - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: XSP/ESQL escaping
Yes, it is a pain, isn't it? XML just doesn't care to know about or deal with whitespace, and that really is a pain when whitespace IS content! To answer your question, it depends. If you just have a string (no XML markup in the database), then something like this is the easiest: String instring = ; java.util.StringTokenizer st = new java.util.StringTokenizer(instring, "\n", true); while (st.hasMoreTokens()) { String token = st.nextToken(); if ("\n".equals(token)) { } else { token } } If what is in your database contains XML markup, you'll need to do something more like this (mostly lifted from the ESQL logicsheet): String instring = ; instring.replaceAll("\n", ">br/>"); org.apache.cocoon.components.parser.Parser newParser = null; try { newParser = (org.apache.cocoon.components.parser.Parser) this.manager.lookup(org.apache.cocoon.components.parser.Parser.ROLE); InputSource __is = new InputSource(new StringReader(rawXML)); XSPUtil.include(__is, this.contentHandler, newParser); } catch (Exception e) { getLogger().error("Could not include page", e); } finally { if (newParser != null) this.manager.release((Component) newParser); } -Christopher Anders Forsgren <[EMAIL PROTECTED]> 11/04/2003 05:55 PM Please respond to users To: [EMAIL PROTECTED] cc: Subject: Re: XSP/ESQL escaping Sigh :( Feels like a lot of work to make a linebreak a tag...If I rephrase the question: What would be the simplest way of displaying the database strings with correct linebreaks in html (except using in the xsl)? thanks Anders
Re: XSP/ESQL escaping
Yes, you cannot use tags inside java strings in this fashion. When XSP sees this tag, it tries to insert a whole block of code to output the tag into the SAX output, which should give you a compilation error. I'm actually not certain how it is you are able to pass the results of esql:get-xml into a function call without getting compilation errors. The get-xml tag also turns into a whole block of code, not an expression which can be passed to a function. What version of Cocoon are you using? In C2.0.3, which I am using, you would be unable to do this, and you would be unable to do substitutions inside the returned XML. Instead, you'd have to get the results using get-string, do your substitutions (using < in place of <), then run the resulting String through an XML parser to get it into the SAX stream. (A good example of this is the code that implements get-xml in the ESQL logicsheet, which is in your cocoon jar file.) HTH. -Christopher |-+> | | Anders Forsgren | | | <[EMAIL PROTECTED]| | | rmers.com> | | || | | 11/04/2003 04:31 | | | PM | | | Please respond to| | | users| | || |-+> >--| | | | To: [EMAIL PROTECTED] | | cc: | | Subject: Re: XSP/ESQL escaping | >--| >Where and how is formatMessage() implemented? That is the code we really >need to see, I think. Thanks for your time The formatMessage is implemented above the problem in the xsp logic section, and it (currently) only does this : public string formatMessage(String message) { return instring.replaceAll("\n", ") } the problem area in the xsp, like I said looks like this formatMessage() The problem occurs when the xsp:expr contains tags (i.e. if I do the replace "\n" ---> "foo" , then all is well, but "\n" ---> "" will not work. ) rgds Anders > > > > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: XSP/ESQL escaping
Where and how is formatMessage() implemented? That is the code we really need to see, I think. We also use eclipse+tomcat 4+cocoon 2.0.x. For some classes of error (I'm not sure which ones), Eclipse suspends the thread for debugging, which might be causing the timeout you are experiencing. If you don't get a response in the expected time, go to the debug perspective and continue and suspended threads. That will produce the normal Cocoon error message page in your browser. (There might be a way of telling eclipse to ignore those exceptions, I haven't explored it.) -Christopher |-+> | | Anders Forsgren | | | <[EMAIL PROTECTED]| | | rmers.com> | | || | | 11/04/2003 02:41 | | | PM | | | Please respond to| | | users| | || |-+> >--| | | | To: [EMAIL PROTECTED] | | cc: | | Subject: XSP/ESQL escaping | >--| Hi I have a problem with escaping when retrieving database data in an xsp page. For each row in the resultset, the following xml is generated: formatDate() formatMessage() The formatMessage method will replace all line breaks (\n) with the tag , however in this context that will give a an error for some reason. If I replace the \n's with >br/< etc, then it works, so it's a document structure error obviously, but I don't see why it should be?. Also, which is the best way to develop xsp efficiently? I'm using eclipse/tomcat4/cocoon2.0 on windows, and with this configuration the requests time out when there is an error in either the code or structure of the xsp, not easily debugged. Even the not-so-helpful generated code error pages would be more helpful, but they only show up on rare occasions. Thanks for any help Anders > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [XSP] Java variables within tag attributes
maybe page |-+> | | Jan Wielgus | | | <[EMAIL PROTECTED]> | | || | | 11/01/2003 02:48 | | | PM | | | Please respond to| | | users| | || |-+> >--| | | | To: [EMAIL PROTECTED] | | cc: | | Subject: [XSP] Java variables within tag attributes | >--| Hello, I want to do something like this: I want to include a page in my main page depending on a request parameter: String page = ; if(page==null || page=="") page = "cocoon:/pagecontent/kategorien.xsp"; But then I have a problem. How can I pass the variable 'page' to the -tag?
Re: -problem (?)
I'm assuming this must be a logicsheet, because you can't run ESQL code outside XSP. So, what does your XSP code look like? -Christopher |-+> | | Jan Wielgus | | | <[EMAIL PROTECTED]> | | || | | 11/02/2003 02:19 | | | PM | | | Please respond to| | | users| | || |-+> >--| | | | To: [EMAIL PROTECTED] | | cc: | | Subject: -problem (?) | >--| Hello, I have a problem when using the tag. Here the code sniplet: Die Kategorie enthaelt Dokumente und kann nicht geloescht werden. Zurueck letterman delete * from kategorien where benutzer_id= and id= Die Kategorie wurde geloescht Zurueck The problem is, that the sql-query from the template "deleted" is not executed as if the esql-tags were ignored - in the output i see only "letterman select * from...". Is it so, because I'm using it quasi within the -block? If yes, what were the solution? My goal is to delete a selected row from db-table when the condition is fulfilled (also when the attribute "dokument-name" equals "keine"). Any help will be appreciated. Jan - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: ESQL problem
Your code looks correct to me, I can't imagine why there'd be a problem. I've never used (or even heard of) a pervasive database, but if you can write JDBC code that works against it, it ought to work in ESQL. Is your pool set up correctly? Do you log in with the same user as in your separate JDBC test? Can you tell from the generated java source if it is following the same steps you do in your own JDBC? If you put code in an block after the block, does that execute? Just out of curiosity, what does the pervasive line do? -Christopher |-+> | | Leszek Gawron| | | <[EMAIL PROTECTED]> | | || | | 10/30/2003 06:00 | | | AM | | | Please respond to| | | users| | || |-+> >--| | | | To: [EMAIL PROTECTED] | | cc: | | Subject: ESQL problem | >--| I have encountered something strange concerning ESQL. I am using Pervasive database. This is a ESQL code snippet: symfonia pervasive select * from xt where kod like '%ń%' String test = ; getLogger().error( test ); If you have a strange character in select statement - that's OK - it's a polish letter. The problem is: the query does not output any data. The same written in JDBC (off cocoon): PreparedStatement stmt = conn.prepareStatement("select * from xt where kod like '%ń%'"); stmt.execute(); ResultSet rs = stmt.getResultSet(); while ( rs.next() ) { System.out.println( rs.getString( "kod" ) ); } works just fine. I have checked the xsp java generated source - the polish letter is encoding using the same byte value so I do not get it what makes the difference. Comments anyone ? lg -- __ | / \ |Leszek Gawron// \\ \_\\ //_/ [EMAIL PROTECTED] _\\()//_ .'/()\'. Phone: +48(501)720812 / // \\ \ \\ // recursive: adj; see recursive | \__/ | - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Weird logicsheet problem
well, now that I look at it, I would expect this to fail. Again, look at where you are putting this code: at the class level. The String array filelist is being created at object instantiation time. The contextualize function is almost certainly not being called until *after* the filelist variable is created and initialized. Are you very familiar with java? Looking at the generated source code should help you with this kind of problem. Instead of creating a variable to hold on to your file list, why not instead create a function that you can then call whenever you need the filelist. That will avoid your timing issues, I think. String [] getFilelist() { return uploadDir.list(); } -Christopher |-+> | | "Johannes Becker"| | | <[EMAIL PROTECTED]| | | ail.com> | | || | | 10/28/2003 11:30 | | | AM | | | Please respond to| | | users| | || |-+> >--| | | | To: [EMAIL PROTECTED] | | cc: | | Subject: Re: Weird logicsheet problem | >--| Hi. this piece posted works almost fine: org.apache.cocoon.components.language.markup.xsp.XSPUtil org.apache.avalon.framework.context.ContextException public void contextualize(Context context) throws ContextException ( uploadDir = (File) context.get(Contstants.CONTEXT_UPLOAD_DIR); } String[] filelist = uploadDir.list(); The only problem: It always gives a nullpointer-exception, because the "uploadDir.list()" is empty (for some stupid reason). In my xsp's this code works fine. It gets all the names of the files(+directories) of the upload-directory I specified in the web.xml file (and in my case this directory isn't empty). Thanks Jonny - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]