Andrew Stevens | 1 Jul 2007 02:30
Picon
Favicon

RE: Logged in user?


Does the request input module's {request:remoteUser} do what you need?
http://cocoon.apache.org/2.1/userdocs/concepts/modules-ref.html#RequestModule

Andrew.
--

-- 
http://pseudoq.sourceforge.net/
________________________________
> From: robin <at> gondolier.org.uk
> To: users <at> cocoon.apache.org
> Subject: Logged in user?
> Date: Wed, 27 Jun 2007 17:38:14 +0100
> 
> Is there an input module (or anything else) that would retrieve the user id from a Tomcat Realm (j_security_check)?
> Many thanks
> Robin Rigby
> robin <at> gondolier.org.uk
> http://www.gondolier.org.uk
> 07785 765017

_________________________________________________________________
Feel like a local wherever you go with BackOfMyHand.com
http://www.backofmyhand.com
Andrew Stevens | 1 Jul 2007 03:35
Picon
Favicon

RE: Cocoon database access strategy


> Date: Sun, 24 Jun 2007 11:14:38 +0200
> From: tobia.conforto <at> linux.it
> 
> Rob Frohwein wrote:
> > - query1.xml    using SqlTransformer on table1
> > - cleansql.xsl  rename 
> > - process1.xsl  reorganize
> > - query2.xsl    query different table
> > - cleansql.xsl  rename 
> > - process2.xsl  reorganize
> > ...
> >
> > It works, but is this the "right" approach?
> 
...
> 
> It works well, but it has some security and performance problems (more
> on that in a minute) so I'd like to know if there's a better approach.
> 
> One of the problems with the SQL Transformer, when used with XSLT in
> this fashion, is that it lacks support for prepared statements and
> parameters.  Without parameters ( in XSP) you have the
> same security problems you would have in badly written PHP:
> 
> 	SELECT ...
> 	FROM ...
> 	WHERE name = ''
> 
> You did think of this problem, didn't you? :) I can post my:addslashes()
(Continue reading)

Andrew Stevens | 1 Jul 2007 03:54
Picon
Favicon

RE: Cocoon database access strategy


Bloody hotmail appears to have stripped out all my sql & xsl namespaced XML elements :-(
Anyone know how to disable this in the new "improved" interface?

> From: ats37 <at> hotmail.com
> Date: Sun, 1 Jul 2007 02:35:03 +0100
> 
> > Date: Sun, 24 Jun 2007 11:14:38 +0200
> > From: tobia.conforto <at> linux.it
> > 
> > Rob Frohwein wrote:
> > > - query1.xml    using SqlTransformer on table1
> > > - cleansql.xsl  rename 
> > > - process1.xsl  reorganize
> > > - query2.xsl    query different table
> > > - cleansql.xsl  rename 
> > > - process2.xsl  reorganize
> > > ...
> > >
> > > It works, but is this the "right" approach?
> > 
> ...
> > 
> > It works well, but it has some security and performance problems (more
> > on that in a minute) so I'd like to know if there's a better approach.
> > 
> > One of the problems with the SQL Transformer, when used with XSLT in
> > this fashion, is that it lacks support for prepared statements and
> > parameters.  Without parameters ( in XSP) you have the
> > same security problems you would have in badly written PHP:
(Continue reading)

Jasha Joachimsthal | 1 Jul 2007 12:45
Picon

RE: How can I delete the cache in Cocoon 2.1.4?

With a clear cache action you can clear (most) caches.

In the components:
<map:actions>
			<map:action name="clear-cache" logger="sitemap.action.clear-cache"
				src="org.apache.cocoon.acting.ClearCacheAction"/>
		</map:actions>

<!-- ... -->
In the pipelines:
		<map:pipeline type="noncaching" internal-only="false">
			<map:match pattern="clearcache.html">
				<map:act type="clear-cache">
					<map:generate src="status" type="status"/>
					<map:serialize type="xml"/>
				</map:act>
			</map:match>
		</map:pipeline>

Jasha Joachimsthal

---------

Hippo
Oosteinde 11
1017 WT Amsterdam
The Netherlands
+31 (0)20 5224466 

jasha <at> hippo.nl
(Continue reading)

Jasha Joachimsthal | 2 Jul 2007 09:12
Picon

Re: HSSFSerializer - Gnumeric XML

Chan Mei Theng wrote:
> Hi,
> 
>  
> 
> I wonder whether the Gnumeric XML supports multiple worksheets.
> 
> If yes, how to apply different templates to different worksheets ?
> 
>  
> 
> Anyway to specify the column header for a worksheet ?
> 

Hi,

See [1] for the documentation of the HSSFSerializer and its xml format.

[1] http://cocoon.apache.org/2.1/userdocs/xls-serializer.html

--

-- 

Jasha Joachimsthal

Hippo
Oosteinde 11
1017 WT Amsterdam
The Netherlands
+31 (0)20 5224466

(Continue reading)

Xtra | 2 Jul 2007 10:20
Picon

Removing xmlns: declarations from HTML

Hi All
 
I had a major blitz today on improving the HTML emitted from our Cocoon application, and have reduced the warnings on an average form page from over 70 to just 3, all concerned with xmlns:fi, xmlns:jx and xmlns:xi declarations being output into HTML.
 
I am using the default HTML serializer, with HTML 4.01 Transitional header. I have experimented with omit-result-prefixes, but these are declarations, not prefixes I want to remove.
 
I see too that the Cocoon 2.1.10 Forms Block examples behave the same.
 
Is there any way to remove these declarations?
 
Regards
 
Ron
 
Ard Schrijvers | 2 Jul 2007 10:25
Picon

RE: Cocoon database access strategy

Hello Andrew,

I am not sure, but I really do not understand your email? You are talking about caching the prepared
statement, but I do not get what you try to achieve with it...?

The sql transformer will never cache, because it does not implement CacheableProcessingComponent. IMO,
there is only one single way to cache the sql transformer properly but you would have to add your own cache
impl (if anybody interested I could explain, otherwiser i do not bother, but it is a combination of the
cached: protocol wrapper with a asynchronous get in which the result of the sql statement would be crc32
compared with the previous one: if different, the cachedentry should be kicked out, if not, keep the old
one). This way, you really do have cached pipelines in cocoon with the sql transformer....only drawback
is asynchronous get, which means that if the result is depending on the sql statement (like first INSERT)
then it is not possible (never imo)

Ard

> 
> 
> Bloody hotmail appears to have stripped out all my sql & xsl 
> namespaced XML elements :-(
> Anyone know how to disable this in the new "improved" interface?
> 
> > From: ats37 <at> hotmail.com
> > Date: Sun, 1 Jul 2007 02:35:03 +0100
> > 
> > > Date: Sun, 24 Jun 2007 11:14:38 +0200
> > > From: tobia.conforto <at> linux.it
> > > 
> > > Rob Frohwein wrote:
> > > > - query1.xml    using SqlTransformer on table1
> > > > - cleansql.xsl  rename 
> > > > - process1.xsl  reorganize
> > > > - query2.xsl    query different table
> > > > - cleansql.xsl  rename 
> > > > - process2.xsl  reorganize
> > > > ...
> > > >
> > > > It works, but is this the "right" approach?
> > > 
> > ...
> > > 
> > > It works well, but it has some security and performance 
> problems (more
> > > on that in a minute) so I'd like to know if there's a 
> better approach.
> > > 
> > > One of the problems with the SQL Transformer, when used 
> with XSLT in
> > > this fashion, is that it lacks support for prepared statements and
> > > parameters.  Without parameters ( in XSP) you have the
> > > same security problems you would have in badly written PHP:
> > > 
> > > 	SELECT ...
> > > 	FROM ...
> > > 	WHERE name = ''
> > > 
> > > You did think of this problem, didn't you? :) I can post 
> my:addslashes()
> > > if you want.  In any case you will agree that composing 
> queries this way
> > > is... "antiquated" at best.
> > > 
> > > The compiled query cannot be cached (as a prepared 
> statement would),
> > > because it changes with every request, and I fear the SQL 
> Transformer
> > > doesn't even try to cache it.
> > 
> > What about
> > 
> 
> substitute brackets with less than & greater than symbols as 
> appropriate...
> 
> (sql:execute-query xmlns:sql="http://apache.org/cocoon/SQL/2.0")
> (sql:query) 
> SELECT ...
> FROM ...
> WHERE name = ?
> (/sql:query)
> (sql:in-parameter nr="1")
> (xsl:attribute name="value")(xsl:value-of 
> select="$whatever"/)(/xsl:attribute)
> (/sql:in-parameter)
> (/sql:execute-query)
> 
> > ?  The in-parameter may change, but the query itself 
> doesn't so the prepared statement ought to cache it.
> > 
> > Admittedly, as written above you've got to supply the 
> in-parameter value as a map:parameter to the XSL transformer 
> rather than the SQL transformer, since it's not valid XML to 
> put elements inside attributes (so 
> 
> (sql:in-parameter nr="1" value="(sql:substitute-value 
> name="whatever"/)"/)
> 
> >isn't valid).  To work around that, we customised the 
> transformer so that in-parameter can take either a constant 
> value (in the value attribute) or the name of a supplied 
> parmeter (in a new "param" attribute) which is substituted in 
> the same fashion as substitute-value.  That shortens it to
>  
> (sql:query) 
>  SELECT ...
>  FROM ...
>  WHERE name = ?
> (/sql:query)
> (sql:in-parameter nr="1" param="whatever"/)
>  
> 
> Andrew.
> 
> _________________________________________________________________
> 100’s of Music vouchers to be won with MSN Music
> https://www.musicmashup.co.uk/index.html
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe <at> cocoon.apache.org
> For additional commands, e-mail: users-help <at> cocoon.apache.org
> 
> 
Ard Schrijvers | 2 Jul 2007 10:26
Picon

RE: Removing xmlns: declarations from HTML

You just mean namespaces? Take a look at the StripNameSpaceTransformer,
 
Ard
 

--

Hippo
Oosteinde 11
1017WT Amsterdam
The Netherlands
Tel  +31 (0)20 5224466
-------------------------------------------------------------
a.schrijvers <at> hippo.nl / http://www.hippo.nl
--------------------------------------------------------------

-----Original Message-----
From: Xtra [mailto:rmcnulty <at> xtra.co.nz]
Posted At: maandag 2 juli 2007 10:20
Posted To: Cocoon User List
Conversation: Removing xmlns: declarations from HTML
Subject: Removing xmlns: declarations from HTML

Hi All
 
I had a major blitz today on improving the HTML emitted from our Cocoon application, and have reduced the warnings on an average form page from over 70 to just 3, all concerned with xmlns:fi, xmlns:jx and xmlns:xi declarations being output into HTML.
 
I am using the default HTML serializer, with HTML 4.01 Transitional header. I have experimented with omit-result-prefixes, but these are declarations, not prefixes I want to remove.
 
I see too that the Cocoon 2.1.10 Forms Block examples behave the same.
 
Is there any way to remove these declarations?
 
Regards
 
Ron
 
Jasha Joachimsthal | 2 Jul 2007 10:54
Picon

Re: HSSFSerializer : XSL - Gnumeric

Chan Mei Theng wrote:
> Hi,
> 
>  
> 
> Based on the XML below, I would like to concate RegionCode into
> 
>             AD, AE, AF
> 
> and attach the concatenation into a cell in Excel.
> 
>  
> 
> How I should achieve this in XSL – Gnumeric ?
> 
>  
> 
> <?xml version="1.0" ?>
> 
> <Collection xmlns:xlink="http://www.w3.org/1999/xlink" name="POI Block 
> Samples">
> 
>   <Operator>testing</Operator>
> 
>   <Track>
> 
> <SalesRegions>
> 
> <SalesRegion>
> 
> <RegionCode>AD</RegionCode>
> 
> </SalesRegion>
> 
> <SalesRegion>
> 
> <RegionCode>AE</RegionCode>
> 
> </SalesRegion>
> 
> <SalesRegion>
> 
> <RegionCode>AF</RegionCode>
> 
> </SalesRegion>
> 
> </SalesRegions>
> 
> </Track>
> 

This is not a Cocoon question, but XSL. You can read more about XSL at 
http://www.w3schools.com/xsl/default.asp.

Stop mailing the Cocoon dev list with these questions. It is meant for 
the development of Cocoon, not for questions using Cocoon to develop 
your own Webapp.

--

-- 

Jasha Joachimsthal

Hippo
Oosteinde 11
1017 WT Amsterdam
The Netherlands
+31 (0)20 5224466

www.hippo.nl
Grzegorz Kossakowski | 2 Jul 2007 11:03
Picon
Favicon

Re: Removing xmlns: declarations from HTML

Ard Schrijvers pisze:
> You just mean namespaces? Take a look at the StripNameSpaceTransformer,
>  
> Ard
>  

We have FAQ: http://cocoon.apache.org/2.1/faq/faq-xslt.html but it is little outdated. Is
StripNameSpaceTransformer more efficient than XSL 
snippet showed in FAQ?

--

-- 
Grzegorz Kossakowski
http://reflectingonthevicissitudes.wordpress.com/

Gmane