Re: Cocoon 3.0 components

2013-06-20 Thread Francesco Chicchiriccò

On 19/06/2013 22:06, gelo1234 wrote:

I wonder if C2.2 flowscript request object can be followed here in C3:
http://cocoon.apache.org/2.2/blocks/flowscript/1.0/1383_1_1.html


Flowscript is not available in C3.

and we can use something like: {jexl:cocoon.request.serverName} or 
{jext:cocoon.request.header.host} ?


Is any info available about C3 request object ?


Basically, you can use JEXL [1] access to HttpServletRequest methods; 
some examples:


{jexl:cocoon.request.contextPath} - HttpServletRequest#getContextPath()

{jexl:cocoon.request.myparam} - HttpServletRequest#getParameter(myparam)

{jexl:cocoon.request.locale.language} - 
HttpServletRequest#getLocale()#getLanguage()


HTH
Regards.

[1] http://commons.apache.org/proper/commons-jexl/reference/syntax.html

--
Francesco Chicchiriccò

ASF Member, Apache Syncope PMC chair, Apache Cocoon PMC Member
http://people.apache.org/~ilgrosso/


-
To unsubscribe, e-mail: users-unsubscr...@cocoon.apache.org
For additional commands, e-mail: users-h...@cocoon.apache.org



Re: Cocoon 3.0 components

2013-06-20 Thread Francesco Chicchiriccò

On 19/06/2013 20:46, gelo1234 wrote:

Hi all,

I wonder if C3 still supports:


As you have already done, take [1] as general reference of what it is 
possible in C3 sitemaps.



1. matchers in sitemap.xmap ?

e.g.
map:matchers default=wildcard
map:matcher logger=sitemap.matcher.wildcard name=wildcard 
src=org.apache.cocoon.matching.WildcardURIMatcher/
map:matcher logger=sitemap.matcher.regexp name=regexp 
src=org.apache.cocoon.matching.RegexpURIMatcher/


C3 is actually full of matchers:  wildcard, equals, regexp, starts-with, 
ends-with, contains


map:match equals=...
matches exactly its argument

map:match pattern=...
is working the old way

map:match regexp=...
provides full regexp support

...and so on

Moreover, you can chain matchers (see named matcher and deep relative 
matcher samples from [1]).



2. selectors in sitemap.xmap ?


No.


e.g.
map:selectors default=browser
map:selector logger=sitemap.selector.browser name=browser 
src=org.apache.cocoon.selection.BrowserSelector



3. Is it possible to define cutom matchers/selectors ? Any examples ?


Hum, nice question (only about matchers. of course); never tried, but I 
don't think it would be easy. Basically, AFAIU the handling is delegated 
to MatchNode [2] that does not seem to be managing any kind of 
customization.



4. actions in sitemap.xmap ?

e.g.
map:actions
map:action logger=sitemap.action.request 
name=request src=org.apache.cocoon.acting.RequestParamAction/


No.


5.  map:mount uri-prefix= src=... check-reload=yes/ ?


You should have already found the answer to this: basically, you need 
more blocks.


I've got Cocoon site that hosts multiple www domains, all based on the 
same sitemap.xmap with map:mount uri-prefix= src=domain_X 
check-reload=yes/


so the configuration is as follows:

map:pipeline
  map:select type=cutomDomainSelector
   map:when test=domainA
map:mount uri-prefix= src=./domaina 
check-reload=yes/

   /map:when
   map:when test=domainB
 map:mount uri-prefix= src=./domainb 
check-reload=yes/

   /map:when
   /map:select
/map:pipeline

Is it still possible with C3 ? Or should I use some separate blocks 
config ?
The problem with separate blocks config is that I want to use empty 
URI (not different) for each site


So
site1: http://www.domainA.org/
site2: http://www.domainB.org/

NOT

http://www.some.org/domainA/
http://www.some.org/domainB/

under one C3 war (sitemap.xmap config).


I'd suggest to empower some reverse proxy in order to make things easier 
here.



And I would like to have a common block accessible from each site.


This is what blocks are meant for, in terms of modularity.

HTH
Regards.

[1] 
https://svn.apache.org/repos/asf/cocoon/cocoon3/trunk/cocoon-sample/src/main/resources/COB-INF/sitemap.xmap
[2] 
https://svn.apache.org/repos/asf/cocoon/cocoon3/trunk/cocoon-sitemap/src/main/java/org/apache/cocoon/sitemap/node/MatchNode.java


--
Francesco Chicchiriccò

ASF Member, Apache Syncope PMC chair, Apache Cocoon PMC Member
http://people.apache.org/~ilgrosso/


-
To unsubscribe, e-mail: users-unsubscr...@cocoon.apache.org
For additional commands, e-mail: users-h...@cocoon.apache.org



Re: Cocoon 3.0 components

2013-06-20 Thread Francesco Chicchiriccò

On 20/06/2013 09:07, Francesco Chicchiriccò wrote:

4. actions in sitemap.xmap ?

e.g.
map:actions
map:action logger=sitemap.action.request 
name=request src=org.apache.cocoon.acting.RequestParamAction/


No.


It looks I might be wrong [1]: Thorsten, could you provide some more 
information here?


Thanks.

[1] https://issues.apache.org/jira/browse/COCOON3-94

--
Francesco Chicchiriccò

ASF Member, Apache Syncope PMC chair, Apache Cocoon PMC Member
http://people.apache.org/~ilgrosso/


-
To unsubscribe, e-mail: users-unsubscr...@cocoon.apache.org
For additional commands, e-mail: users-h...@cocoon.apache.org



Re: Cocoon 3.0 components

2013-06-20 Thread Francesco Chicchiriccò

On 19/06/2013 21:18, gelo1234 wrote:

Sorry for the mistyping: s/cutom/custom.

One more question: I saw map:select ... in examples sitemap.xmap 
under map:match ...

Is it possible to put map:select ... straight under map:pipeline ?


No; if you like XSD, you can take a look at [1] to know exactly what 
element is allowed at what place.



And what param? to use to select hostname of the incoming Request ?

map:select value={jexl:cocoon.hostname.param} ?


Never tried directly; anyway this should be instead

map:select value={jexl:cocoon.request.serverName}

In 2.1 there was a HostSelector: 
http://cocoon.apache.org/2.1/userdocs/selectors.html

How to code that in C3 ?


I guess the only option available is with select.

Regards.

[1] 
https://svn.apache.org/repos/asf/cocoon/cocoon3/trunk/cocoon-sitemap/src/main/resources/cocoon-sitemap-1.0.xsd


--
Francesco Chicchiriccò

ASF Member, Apache Syncope PMC chair, Apache Cocoon PMC Member
http://people.apache.org/~ilgrosso/


-
To unsubscribe, e-mail: users-unsubscr...@cocoon.apache.org
For additional commands, e-mail: users-h...@cocoon.apache.org



Re: Cocoon 3.0 components

2013-06-20 Thread Thorsten Scherler
On 06/20/2013 09:15 AM, Francesco Chicchiriccò wrote:
 On 20/06/2013 09:07, Francesco Chicchiriccò wrote:
 4. actions in sitemap.xmap ?

 e.g.
 map:actions
 map:action logger=sitemap.action.request
 name=request src=org.apache.cocoon.acting.RequestParamAction/

 No.

 It looks I might be wrong [1]: Thorsten, could you provide some more
 information here?

 Thanks.

 [1] https://issues.apache.org/jira/browse/COCOON3-94


Action are working fine in c3 with some limitations
COCOON3-94 Bring back old school way of actions back to c3. Although it
is not 100% like we had in c2.x since the body of an action ATM is
ignore. http://svn.apache.org/viewvc?view=revisionrevision=1304459

http://svn.apache.org/viewvc/cocoon/cocoon3/trunk/cocoon-sample/src/main/resources/META-INF/cocoon/spring/cocoon-sample-sitemap-components.xml?view=markup

http://svn.apache.org/viewvc/cocoon/cocoon3/trunk/cocoon-sample/src/main/resources/COB-INF/sitemap.xmap?view=markup
518 map:pipeline
519 map:match pattern=error-handling/custom-error
520 map:act type=error-throwing /
521 map:generate src=sax-pipeline/simple.xml /
522 map:serialize type=xml /
523 /map:match
524 /map:pipeline
525 
526 map:pipeline
527 map:match
equals=error-handling/custom-error-per-pipeline-error-handling
528 map:act type=error-throwing /
529 map:generate src=sax-pipeline/simple.xml /
530 map:serialize type=xml /
531 /map:match
532 map:handle-errors
533 map:generate src=error-handling/501.xml /
534 map:serialize type=xhtml status-code=501 /
535 /map:handle-errors
536 /map:pipeline


However you can pass parameter though:
map:act type=http
  map:parameter name=Pragma value=no-cache/
  map:parameter name=Cache-Control value=no-cache/
/map:act

HTH

-- 
Thorsten Scherler scherler.at.gmail.com
codeBusters S.L. - web based systems
consulting, training and solutions

http://www.codebusters.es/



Re: Cocoon 3.0 components

2013-06-20 Thread gelo1234
Thanks for clarifying this.

Greetings,
Greg


2013/6/20 Thorsten Scherler scher...@gmail.com

  On 06/20/2013 09:15 AM, Francesco Chicchiriccò wrote:

 On 20/06/2013 09:07, Francesco Chicchiriccò wrote:

 4. actions in sitemap.xmap ?

 e.g.
 map:actions
 map:action logger=sitemap.action.request
 name=request src=org.apache.cocoon.acting.RequestParamAction/


 No.


 It looks I might be wrong [1]: Thorsten, could you provide some more
 information here?

 Thanks.

 [1] https://issues.apache.org/jira/browse/COCOON3-94


 Action are working fine in c3 with some limitations
 COCOON3-94 Bring back old school way of actions back to c3. Although it
 is not 100% like we had in c2.x since the body of an action ATM is ignore.
 http://svn.apache.org/viewvc?view=revisionrevision=1304459


 http://svn.apache.org/viewvc/cocoon/cocoon3/trunk/cocoon-sample/src/main/resources/META-INF/cocoon/spring/cocoon-sample-sitemap-components.xml?view=markup


 http://svn.apache.org/viewvc/cocoon/cocoon3/trunk/cocoon-sample/src/main/resources/COB-INF/sitemap.xmap?view=markup
   518 map:pipeline  519 map:match
 pattern=error-handling/custom-error  520 map:act
 type=error-throwing /  521 map:generate src=sax-pipeline/simple.xml
 /  522 map:serialize type=xml /  523 /map:match  524 /map:pipeline
  525
   526 map:pipeline  527 map:match
 equals=error-handling/custom-error-per-pipeline-error-handling  528 
 map:act
 type=error-throwing /  529 map:generate src=sax-pipeline/simple.xml
 /  530 map:serialize type=xml /  531 /map:match  532 
 map:handle-errors
  533 map:generate src=error-handling/501.xml /  534 map:serialize
 type=xhtml status-code=501 /  535 /map:handle-errors  536
 /map:pipeline
 However you can pass parameter though:
 map:act type=http
   map:parameter name=Pragma value=no-cache/
   map:parameter name=Cache-Control value=no-cache/
 /map:act

 HTH

 --
 Thorsten Scherler scherler.at.gmail.com
 codeBusters S.L. - web based systems
 consulting, training and solutions
 http://www.codebusters.es/




Re: Cocoon 3.0 components

2013-06-20 Thread gelo1234
 I've got Cocoon site that hosts multiple www domains, all based on the
 same sitemap.xmap with map:mount uri-prefix= src=domain_X
 check-reload=yes/

 so the configuration is as follows:

 map:pipeline
   map:select type=cutomDomainSelector
map:when test=domainA
 map:mount uri-prefix= src=./domaina
 check-reload=yes/
/map:when
map:when test=domainB
  map:mount uri-prefix= src=./domainb
 check-reload=yes/
/map:when
/map:select
 /map:pipeline

 Is it still possible with C3 ? Or should I use some separate blocks
 config ?
 The problem with separate blocks config is that I want to use empty URI
 (not different) for each site

 So
 site1: http://www.domainA.org/
 site2: http://www.domainB.org/

 NOT

 http://www.some.org/domainA/
 http://www.some.org/domainB/

 under one C3 war (sitemap.xmap config).


 I'd suggest to empower some reverse proxy in order to make things easier
 here.


Reverse Proxy would give the opposite effect - collecting into one URL from
multiple domain servers. I would like to have
only ONE backend server that serves as the origin for multiple domains.

With mod_jk/mod_proxy I can setup multiple workers for each domain but
where should I point them to serve my clients if having only one backend
server with C3 ?


Lets say I have a separate Cocoon block for each www domain. In C2.1 I had
a MAIN sitemap.xmap (Controller) that controlled which context to mount
upon different Hostname requests.

In C3 the only way I could achieve that is passing through with each
request INFO about Hostname value. That is not very elegant
solution. But I cannot find any other.

So either every map:match ... would need additional map:select ...:

 !--  e.g. the main / context --

   map:match pattern=
   map:select value={jexl:cocoon.request.hostName}
  map:when equals=domainA
map:generate src=files/domainA/homepage.xml /
map:transform src=files/xslt/homepage.xslt/
map:serialize /
  /map:when
  map:when equals=domainB
map:generate src=files/domainB/homepage.xml /
map:transform src=files/xslt/homepage.xslt/
map:serialize /
  /map:when
  /map:match

OR (a little bit more elegant and compact):

map:match pattern=
map:generate
src=files/{jexl:cocoon:request.hostName}/homepage.xml/
map:transform src=files/xslt/homepage.xslt/
map:serialize /
  /map:match

I don't want to handle 100 VMs with C3 app for each www domain. That would
be very resource-expensive config.

I would like to have only ONE C3 app for all www domains.

Greetings,
Greg


Re: Cocoon 3.0 components

2013-06-20 Thread Thorsten Scherler
On 06/20/2013 03:02 PM, gelo1234 wrote:

 I've got Cocoon site that hosts multiple www domains, all
 based on the same sitemap.xmap with map:mount uri-prefix=
 src=domain_X check-reload=yes/

 so the configuration is as follows:

 map:pipeline
   map:select type=cutomDomainSelector
map:when test=domainA
 map:mount uri-prefix=
 src=./domaina check-reload=yes/
/map:when
map:when test=domainB
  map:mount uri-prefix=
 src=./domainb check-reload=yes/
/map:when
/map:select
 /map:pipeline

 Is it still possible with C3 ? Or should I use some separate
 blocks config ?
 The problem with separate blocks config is that I want to use
 empty URI (not different) for each site

 So
 site1: http://www.domainA.org/
 site2: http://www.domainB.org/

 NOT

 http://www.some.org/domainA/
 http://www.some.org/domainB/

 under one C3 war (sitemap.xmap config).


 I'd suggest to empower some reverse proxy in order to make things
 easier here.


 Reverse Proxy would give the opposite effect - collecting into one URL
 from multiple domain servers. I would like to have
 only ONE backend server that serves as the origin for multiple domains.

 With mod_jk/mod_proxy I can setup multiple workers for each domain but
 where should I point them to serve my clients if having only one
 backend server with C3 ?


 Lets say I have a separate Cocoon block for each www domain. In C2.1 I
 had a MAIN sitemap.xmap (Controller) that controlled which context to
 mount upon different Hostname requests.

 In C3 the only way I could achieve that is passing through with each
 request INFO about Hostname value. That is not very elegant
 solution. But I cannot find any other.

 So either every map:match ... would need additional map:select ...:

  !--  e.g. the main / context --

map:match pattern=
map:select value={jexl:cocoon.request.hostName}
   map:when equals=domainA
 map:generate src=files/domainA/homepage.xml /
 map:transform src=files/xslt/homepage.xslt/
 map:serialize /
   /map:when
   map:when equals=domainB
 map:generate src=files/domainB/homepage.xml /
 map:transform src=files/xslt/homepage.xslt/
 map:serialize /
   /map:when
   /map:match

 OR (a little bit more elegant and compact):

 map:match pattern=
 map:generate
 src=files/{jexl:cocoon:request.hostName}/homepage.xml/
 map:transform src=files/xslt/homepage.xslt/
 map:serialize /
   /map:match

 I don't want to handle 100 VMs with C3 app for each www domain. That
 would be very resource-expensive config.

 I would like to have only ONE C3 app for all www domains.

so why not:

map:match pattern=
map:generate
src=servlet:{jexl:cocoon:request.hostName}/homepage.xml/
map:transform src=files/xslt/homepage.xslt/
map:serialize /
  /map:match

Or even simply create a new language interpreter (formally known as
module) which does the resolving. That has the benefit that you can use
full blown java and use spring config file to do the mapping or a simple
properties file.

salu2


 Greetings,
 Greg

  



-- 
Thorsten Scherler scherler.at.gmail.com
codeBusters S.L. - web based systems
consulting, training and solutions

http://www.codebusters.es/



Re: Cocoon 3.0 components

2013-06-20 Thread gelo1234
Any idea how to get HTTP Header named Host ? or any other HTTP Header value
? [1]

tried cocoon.request.header['Host'], cocoon.request.header.host without
effect

I managed to get only requestURL:

map:parameter name=host value={jexl:cocoon.request.requestURL}/

Greetings,
Greg

[1]
http://docs.oracle.com/javaee/6/api/javax/servlet/http/HttpServletRequest.html


2013/6/20 Francesco Chicchiriccò ilgro...@apache.org


  and we can use something like: {jexl:cocoon.request.**serverName} or
 {jext:cocoon.request.header.**host} ?

 Is any info available about C3 request object ?


 Basically, you can use JEXL [1] access to HttpServletRequest methods; some
 examples:

 {jexl:cocoon.request.**contextPath} - HttpServletRequest#**
 getContextPath()

 {jexl:cocoon.request.myparam} - HttpServletRequest#**
 getParameter(myparam)

 {jexl:cocoon.request.locale.**language} - HttpServletRequest#getLocale()*
 *#getLanguage()

 HTH
 Regards.

 [1] http://commons.apache.org/**proper/commons-jexl/reference/**
 syntax.htmlhttp://commons.apache.org/proper/commons-jexl/reference/syntax.html

 --
 Francesco Chicchiriccò

 ASF Member, Apache Syncope PMC chair, Apache Cocoon PMC Member
 http://people.apache.org/~**ilgrosso/http://people.apache.org/~ilgrosso/


 --**--**-
 To unsubscribe, e-mail: 
 users-unsubscribe@cocoon.**apache.orgusers-unsubscr...@cocoon.apache.org
 For additional commands, e-mail: users-h...@cocoon.apache.org




Re: Cocoon 3.0 components

2013-06-20 Thread gelo1234
Can you provide me with some simple example of that new language
interpreter (module) ? :)

Greetings,
Greg



2013/6/20 Thorsten Scherler scher...@gmail.com

  On 06/20/2013 03:02 PM, gelo1234 wrote:


I've got Cocoon site that hosts multiple www domains, all based on the
 same sitemap.xmap with map:mount uri-prefix= src=domain_X
 check-reload=yes/

 so the configuration is as follows:

 map:pipeline
   map:select type=cutomDomainSelector
map:when test=domainA
 map:mount uri-prefix= src=./domaina
 check-reload=yes/
/map:when
map:when test=domainB
  map:mount uri-prefix= src=./domainb
 check-reload=yes/
/map:when
/map:select
 /map:pipeline

 Is it still possible with C3 ? Or should I use some separate blocks
 config ?
 The problem with separate blocks config is that I want to use empty URI
 (not different) for each site

 So
 site1: http://www.domainA.org/
 site2: http://www.domainB.org/

 NOT

 http://www.some.org/domainA/
 http://www.some.org/domainB/

 under one C3 war (sitemap.xmap config).


  I'd suggest to empower some reverse proxy in order to make things easier
 here.


  Reverse Proxy would give the opposite effect - collecting into one URL
 from multiple domain servers. I would like to have
  only ONE backend server that serves as the origin for multiple domains.

  With mod_jk/mod_proxy I can setup multiple workers for each domain but
 where should I point them to serve my clients if having only one backend
 server with C3 ?


  Lets say I have a separate Cocoon block for each www domain. In C2.1 I
 had a MAIN sitemap.xmap (Controller) that controlled which context to mount
 upon different Hostname requests.

 In C3 the only way I could achieve that is passing through with each
 request INFO about Hostname value. That is not very elegant
  solution. But I cannot find any other.

  So either every map:match ... would need additional map:select ...:

   !--  e.g. the main / context --

 map:match pattern=
 map:select value={jexl:cocoon.request.hostName}
   map:when equals=domainA
 map:generate src=files/domainA/homepage.xml /
 map:transform src=files/xslt/homepage.xslt/
 map:serialize /
   /map:when
   map:when equals=domainB
 map:generate src=files/domainB/homepage.xml /
 map:transform src=files/xslt/homepage.xslt/
 map:serialize /
   /map:when
/map:match

  OR (a little bit more elegant and compact):

 map:match pattern=
 map:generate
 src=files/{jexl:cocoon:request.hostName}/homepage.xml/
 map:transform src=files/xslt/homepage.xslt/
 map:serialize /
/map:match

  I don't want to handle 100 VMs with C3 app for each www domain. That
 would be very resource-expensive config.

 I would like to have only ONE C3 app for all www domains.


 so why not:

 map:match pattern=
 map:generate
 src=servlet:{jexl:cocoon:request.hostName}/homepage.xml/
 map:transform src=files/xslt/homepage.xslt/
 map:serialize /
/map:match

 Or even simply create a new language interpreter (formally known as
 module) which does the resolving. That has the benefit that you can use
 full blown java and use spring config file to do the mapping or a simple
 properties file.

 salu2


  Greetings,
 Greg





 --
 Thorsten Scherler scherler.at.gmail.com
 codeBusters S.L. - web based systems
 consulting, training and solutions
 http://www.codebusters.es/




Re: Cocoon 3.0 components

2013-06-20 Thread Francesco Chicchiriccò

On 20/06/2013 15:37, gelo1234 wrote:


Any idea how to get HTTP Header named Host ?


Doesn't jexl:cocoon.request.serverName work?


or any other HTTP Header value ? [1]

tried cocoon.request.header['Host'], cocoon.request.header.host 
without effect


I managed to get only requestURL:

map:parameter name=host value={jexl:cocoon.request.requestURL}/

Greetings,
Greg

[1] 
http://docs.oracle.com/javaee/6/api/javax/servlet/http/HttpServletRequest.html



2013/6/20 Francesco Chicchiriccò ilgro...@apache.org 
mailto:ilgro...@apache.org



and we can use something like:
{jexl:cocoon.request.serverName} or
{jext:cocoon.request.header.host} ?

Is any info available about C3 request object ?


Basically, you can use JEXL [1] access to HttpServletRequest
methods; some examples:

{jexl:cocoon.request.contextPath} -
HttpServletRequest#getContextPath()

{jexl:cocoon.request.myparam} -
HttpServletRequest#getParameter(myparam)

{jexl:cocoon.request.locale.language} -
HttpServletRequest#getLocale()#getLanguage()

HTH
Regards.

[1]
http://commons.apache.org/proper/commons-jexl/reference/syntax.html

-- 
Francesco Chicchiriccò


ASF Member, Apache Syncope PMC chair, Apache Cocoon PMC Member
http://people.apache.org/~ilgrosso/
http://people.apache.org/%7Eilgrosso/


-
To unsubscribe, e-mail: users-unsubscr...@cocoon.apache.org
mailto:users-unsubscr...@cocoon.apache.org
For additional commands, e-mail: users-h...@cocoon.apache.org
mailto:users-h...@cocoon.apache.org





--
Francesco Chicchiriccò

ASF Member, Apache Syncope PMC chair, Apache Cocoon PMC Member
http://people.apache.org/~ilgrosso/



Re: Cocoon 3.0 components

2013-06-20 Thread gelo1234
You meant Cocoon Spring Configurator Settings ?

Is it usable in spring config files only beans.../beans or within
sitemap.xmap also ?
Can you show the example usage of that settings in sitemap.xmap ?
Where do I define the namespace prefix for that Interpreter ?

Greetings,
Greg


2013/6/20 Thorsten Scherler scher...@gmail.com

  On 06/20/2013 03:42 PM, gelo1234 wrote:

  Can you provide me with some simple example of that new language
 interpreter (module) ? :)



 http://svn.apache.org/viewvc/cocoon/cocoon3/trunk/cocoon-sitemap/src/main/java/org/apache/cocoon/sitemap/expression/SettingsInterpreter.java?diff_format=hview=markup
 That is REALLY easy example, takes the spring defined settings and
 resolves its value. used in the sitemap like {global:org.apache.cocoon.mode}

 salu2


  Greetings,
 Greg



  2013/6/20 Thorsten Scherler scher...@gmail.com

   On 06/20/2013 03:02 PM, gelo1234 wrote:


I've got Cocoon site that hosts multiple www domains, all based on
 the same sitemap.xmap with map:mount uri-prefix= src=domain_X
 check-reload=yes/

 so the configuration is as follows:

 map:pipeline
   map:select type=cutomDomainSelector
map:when test=domainA
 map:mount uri-prefix= src=./domaina
 check-reload=yes/
/map:when
map:when test=domainB
  map:mount uri-prefix= src=./domainb
 check-reload=yes/
/map:when
/map:select
 /map:pipeline

 Is it still possible with C3 ? Or should I use some separate blocks
 config ?
 The problem with separate blocks config is that I want to use empty URI
 (not different) for each site

 So
 site1: http://www.domainA.org/
 site2: http://www.domainB.org/

 NOT

 http://www.some.org/domainA/
 http://www.some.org/domainB/

 under one C3 war (sitemap.xmap config).


  I'd suggest to empower some reverse proxy in order to make things
 easier here.


  Reverse Proxy would give the opposite effect - collecting into one URL
 from multiple domain servers. I would like to have
  only ONE backend server that serves as the origin for multiple domains.

  With mod_jk/mod_proxy I can setup multiple workers for each domain but
 where should I point them to serve my clients if having only one backend
 server with C3 ?


  Lets say I have a separate Cocoon block for each www domain. In C2.1 I
 had a MAIN sitemap.xmap (Controller) that controlled which context to mount
 upon different Hostname requests.

 In C3 the only way I could achieve that is passing through with each
 request INFO about Hostname value. That is not very elegant
  solution. But I cannot find any other.

  So either every map:match ... would need additional map:select ...:

   !--  e.g. the main / context --

 map:match pattern=
 map:select value={jexl:cocoon.request.hostName}
   map:when equals=domainA
 map:generate src=files/domainA/homepage.xml /
 map:transform src=files/xslt/homepage.xslt/
 map:serialize /
   /map:when
   map:when equals=domainB
 map:generate src=files/domainB/homepage.xml /
 map:transform src=files/xslt/homepage.xslt/
 map:serialize /
   /map:when
/map:match

  OR (a little bit more elegant and compact):

 map:match pattern=
 map:generate
 src=files/{jexl:cocoon:request.hostName}/homepage.xml/
 map:transform src=files/xslt/homepage.xslt/
 map:serialize /
/map:match

  I don't want to handle 100 VMs with C3 app for each www domain. That
 would be very resource-expensive config.

 I would like to have only ONE C3 app for all www domains.


  so why not:

 map:match pattern=
 map:generate
 src=servlet:{jexl:cocoon:request.hostName}/homepage.xml/
  map:transform src=files/xslt/homepage.xslt/
 map:serialize /
/map:match

  Or even simply create a new language interpreter (formally known as
 module) which does the resolving. That has the benefit that you can use
 full blown java and use spring config file to do the mapping or a simple
 properties file.

 salu2


  Greetings,
 Greg





 --
 Thorsten Scherler scherler.at.gmail.com
 codeBusters S.L. - web based systems
 consulting, training and solutions
 http://www.codebusters.es/




 --
 Thorsten Scherler scherler.at.gmail.com
 codeBusters S.L. - web based systems
 consulting, training and solutions
 http://www.codebusters.es/




XSLT import/include errors

2013-06-20 Thread gelo1234
It looks like XSLT also got cut in functionality in C3. I tried to rerun
old XSL stylesheets with new C3 and gave up.

The error says nothing meaningful:

exception-report class=org.apache.cocoon.pipeline.SetupException
timestamp=Thu, 20 Jun 2013 19:58:23 +0200messageImpossible to read
XSLT from 'javax.xml.transform.stream.StreamSource@cba24d', see nested
exception/messagecauseCould not compile
stylesheet/causestacktraceCausejavax.xml.transform.TransformerConfigurationException:
Could not compile stylesheet
at
com.sun.org.apache.xalan.internal.xsltc.trax.TransformerFactoryImpl.newTemplates(Unknown
Source)
at
org.apache.cocoon.sax.component.XSLTTransformer.load(XSLTTransformer.java:216)
at
org.apache.cocoon.sax.component.XSLTTransformer.load(XSLTTransformer.java:165)
at
org.apache.cocoon.sax.component.XSLTTransformer.setConfiguration(XSLTTransformer.java:264)
at
org.apache.cocoon.sitemap.InvocationImpl.installComponent(InvocationImpl.java:257)
at

It looks like there is a problem with xsl:import/xsl:include from the main
xsl stylesheet.
Moreover I found that when xsl:template match=RootElement is not in the
main XSL stylesheet the same error appears.

Can we switch on more debugging info what is wrong ?

Greetings,
Greg


Re: XSLT import/include errors

2013-06-20 Thread Javier Puerto
Hi Greg,

El 20/06/2013 20:00, gelo1234 gelo1...@gmail.com escribió:


 It looks like XSLT also got cut in functionality in C3. I tried to rerun
old XSL stylesheets with new C3 and gave up.

 The error says nothing meaningful:

 exception-report class=org.apache.cocoon.pipeline.SetupException
timestamp=Thu, 20 Jun 2013 19:58:23 +0200messageImpossible to read
XSLT from 'javax.xml.transform.stream.StreamSource@cba24d', see nested
exception/messagecauseCould not compile
stylesheet/causestacktraceCausejavax.xml.transform.TransformerConfigurationException:
Could not compile stylesheet
 at
com.sun.org.apache.xalan.internal.xsltc.trax.TransformerFactoryImpl.newTemplates(Unknown
Source)
 at
org.apache.cocoon.sax.component.XSLTTransformer.load(XSLTTransformer.java:216)
 at
org.apache.cocoon.sax.component.XSLTTransformer.load(XSLTTransformer.java:165)
 at
org.apache.cocoon.sax.component.XSLTTransformer.setConfiguration(XSLTTransformer.java:264)
 at
org.apache.cocoon.sitemap.InvocationImpl.installComponent(InvocationImpl.java:257)
 at

 It looks like there is a problem with xsl:import/xsl:include from the
main xsl stylesheet.

You are right, seems to be a problem with the imports. I've used Imports
and includes with cocoo3 without problems, except that imported files are
cached and doesn't update running in RCL. The xslt engine is still xalan so
the templates should work like before except for the sources with cocoon:/
protocol that aren't supported.

 Moreover I found that when xsl:template match=RootElement is not in
the main XSL stylesheet the same error appears.

Could you send an example block to reproduce the issue?


 Can we switch on more debugging info what is wrong ?

You can edit the logback.xml file and set level to debug but the exception
comes from xalan. I suggest to look for sources loaded with cocoon:/ in
your code and substitute by servlet:/.


 Greetings,
 Greg

Salu2.


Re: XSLT import/include errors

2013-06-20 Thread gelo1234
Now Im lost. The Cocoon context doesn't work anymore. Restarting Tomcat
doesn't help. I tried to clean work directory, and still
NullPointerException.

Any idea what might be wrong ?
And how to switch off imported xslt caching ?

INFO: Starting Servlet Engine: Apache Tomcat/7.0.40
cze 20, 2013 8:43:28 PM org.apache.catalina.startup.HostConfig
deployDirectory
INFO: Deploying web application directory
/var/lib/tomcat/webapps/mywebapp-1.0-SNAPSHOT
cze 20, 2013 8:43:29 PM org.apache.catalina.core.ContainerBase
addChildInternal
SEVERE: ContainerBase.addChild: start:
org.apache.catalina.LifecycleException: Failed to start component
[StandardEngine[Catalina].StandardHost[localhost].StandardContext[/mywebapp-1.0-SNAPSHOT]]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:154)
at
org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901)
at
org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:633)
at
org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1114)
at
org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:1672)
at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.NullPointerException
at
org.apache.catalina.startup.ContextConfig.processAnnotationsFile(ContextConfig.java:2092)
at
org.apache.catalina.startup.ContextConfig.processAnnotationsFile(ContextConfig.java:2093)
at
org.apache.catalina.startup.ContextConfig.processAnnotationsFile(ContextConfig.java:2093)
at
org.apache.catalina.startup.ContextConfig.processAnnotationsFile(ContextConfig.java:2093)
at
org.apache.catalina.startup.ContextConfig.processAnnotationsFile(ContextConfig.java:2093)
at
org.apache.catalina.startup.ContextConfig.webConfig(ContextConfig.java:1300)
at
org.apache.catalina.startup.ContextConfig.configureStart(ContextConfig.java:878)
at
org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:369)
at
org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
at
org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90)
at
org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5269)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
... 11 more

cze 20, 2013 8:43:29 PM org.apache.catalina.startup.HostConfig
deployDirectory
SEVERE: Error deploying web application directory
/var/lib/tomcat/webapps/mywebapp-1.0-SNAPSHOT
java.lang.IllegalStateException: ContainerBase.addChild: start:
org.apache.catalina.LifecycleException: Failed to start component
[StandardEngine[Catalina].StandardHost[localhost].StandardContext[/mywebapp-1.0-SNAPSHOT]]
at
org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:904)
at
org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:633)
at
org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1114)
at
org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:1672)
at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)

Greetings,
Greg



2013/6/20 Javier Puerto jpue...@gmail.com

 Hi Greg,

 El 20/06/2013 20:00, gelo1234 gelo1...@gmail.com escribió:

 
 
  It looks like XSLT also got cut in functionality in C3. I tried to rerun
 old XSL stylesheets with new C3 and gave up.
 
  The error says nothing meaningful:
 
  exception-report class=org.apache.cocoon.pipeline.SetupException
 timestamp=Thu, 20 Jun 2013 19:58:23 +0200messageImpossible to read
 XSLT from 'javax.xml.transform.stream.StreamSource@cba24d', see nested
 exception/messagecauseCould not compile
 stylesheet/causestacktraceCausejavax.xml.transform.TransformerConfigurationException:
 Could not compile stylesheet
  at
 com.sun.org.apache.xalan.internal.xsltc.trax.TransformerFactoryImpl.newTemplates(Unknown
 Source)
  at
 org.apache.cocoon.sax.component.XSLTTransformer.load(XSLTTransformer.java:216)
  at
 org.apache.cocoon.sax.component.XSLTTransformer.load(XSLTTransformer.java:165)
  at
 

Re: XSLT import/include errors

2013-06-20 Thread gelo1234
OK, resolved the issue. Deleted xslt/ directory :/ and now its starting.
STRANGE!!

And also found that more detailed error info about not being able to
compile XSLT stylesheet was in Tomcat log.

It seems that with C3 xsl:variables../ cannot be inherited. The error
said about the same xsl:variable .../ being defined in 2 different places
:/
One place - in main XSL file and other one - in imported XSL file.

While it worked fine in C2.1. I use extensively xsl:template / and
xsl:variable ../ inheritance, now in C3 it makes XSLT not being compiled
:/

Greetings,
Greg



2013/6/20 gelo1234 gelo1...@gmail.com


 Now Im lost. The Cocoon context doesn't work anymore. Restarting Tomcat
 doesn't help. I tried to clean work directory, and still
 NullPointerException.

 Any idea what might be wrong ?
 And how to switch off imported xslt caching ?

 INFO: Starting Servlet Engine: Apache Tomcat/7.0.40
 cze 20, 2013 8:43:28 PM org.apache.catalina.startup.HostConfig
 deployDirectory
 INFO: Deploying web application directory
 /var/lib/tomcat/webapps/mywebapp-1.0-SNAPSHOT
 cze 20, 2013 8:43:29 PM org.apache.catalina.core.ContainerBase
 addChildInternal
 SEVERE: ContainerBase.addChild: start:
 org.apache.catalina.LifecycleException: Failed to start component
 [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/mywebapp-1.0-SNAPSHOT]]
 at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:154)
 at
 org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901)
 at
 org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877)
 at
 org.apache.catalina.core.StandardHost.addChild(StandardHost.java:633)
 at
 org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1114)
 at
 org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:1672)
 at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
 at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
 at java.util.concurrent.FutureTask.run(Unknown Source)
 at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
 at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
 at java.lang.Thread.run(Unknown Source)
 Caused by: java.lang.NullPointerException
 at
 org.apache.catalina.startup.ContextConfig.processAnnotationsFile(ContextConfig.java:2092)
 at
 org.apache.catalina.startup.ContextConfig.processAnnotationsFile(ContextConfig.java:2093)
 at
 org.apache.catalina.startup.ContextConfig.processAnnotationsFile(ContextConfig.java:2093)
 at
 org.apache.catalina.startup.ContextConfig.processAnnotationsFile(ContextConfig.java:2093)
 at
 org.apache.catalina.startup.ContextConfig.processAnnotationsFile(ContextConfig.java:2093)
 at
 org.apache.catalina.startup.ContextConfig.webConfig(ContextConfig.java:1300)
 at
 org.apache.catalina.startup.ContextConfig.configureStart(ContextConfig.java:878)
 at
 org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:369)
 at
 org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
 at
 org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90)
 at
 org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5269)
 at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
 ... 11 more

 cze 20, 2013 8:43:29 PM org.apache.catalina.startup.HostConfig
 deployDirectory
 SEVERE: Error deploying web application directory
 /var/lib/tomcat/webapps/mywebapp-1.0-SNAPSHOT
 java.lang.IllegalStateException: ContainerBase.addChild: start:
 org.apache.catalina.LifecycleException: Failed to start component
 [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/mywebapp-1.0-SNAPSHOT]]
 at
 org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:904)
 at
 org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877)
 at
 org.apache.catalina.core.StandardHost.addChild(StandardHost.java:633)
 at
 org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1114)
 at
 org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:1672)
 at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
 at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
 at java.util.concurrent.FutureTask.run(Unknown Source)
 at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
 at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
 at java.lang.Thread.run(Unknown Source)

 Greetings,
 Greg



 2013/6/20 Javier Puerto jpue...@gmail.com

 Hi Greg,

 El 20/06/2013 20:00, gelo1234 gelo1...@gmail.com escribió:

 
 
  It looks like XSLT also got cut in functionality in C3. I tried to
 rerun old XSL stylesheets with new C3 and gave up.
 
  The error says nothing meaningful:
 
  exception-report 

Re: XSLT import/include errors

2013-06-20 Thread Javier Puerto
2013/6/20 gelo1234 gelo1...@gmail.com

 OK, resolved the issue. Deleted xslt/ directory :/ and now its starting.
 STRANGE!!


Yeah, computer's stuff. :)



 And also found that more detailed error info about not being able to
 compile XSLT stylesheet was in Tomcat log.

 It seems that with C3 xsl:variables../ cannot be inherited. The error
 said about the same xsl:variable .../ being defined in 2 different places
 :/
 One place - in main XSL file and other one - in imported XSL file.

 While it worked fine in C2.1. I use extensively xsl:template / and
 xsl:variable ../ inheritance, now in C3 it makes XSLT not being compiled
 :/


What version of C2.1 did you use? Maybe old Xalan? I've found the following
note in the Xalan documentation [1]:

Note that all top-level parameters and variables from all imported and
included stylesheets will be placed as direct children of the top-level
stylesheet in the AST. This done to make global variables truly global and
not just global in the stylesheet where it was declared.

You should avoid duplicate variable declarations, at the end of the page
it's explained how the forward references works. You could extract some
common variables to a XSLT template so you can use several templates
without collision.

 [1]: http://xml.apache.org/xalan-j/xsltc/xsl_variable_design.html


 Greetings,
 Greg



 2013/6/20 gelo1234 gelo1...@gmail.com


 Now Im lost. The Cocoon context doesn't work anymore. Restarting Tomcat
 doesn't help. I tried to clean work directory, and still
 NullPointerException.

 Any idea what might be wrong ?
 And how to switch off imported xslt caching ?

 INFO: Starting Servlet Engine: Apache Tomcat/7.0.40
 cze 20, 2013 8:43:28 PM org.apache.catalina.startup.HostConfig
 deployDirectory
 INFO: Deploying web application directory
 /var/lib/tomcat/webapps/mywebapp-1.0-SNAPSHOT
 cze 20, 2013 8:43:29 PM org.apache.catalina.core.ContainerBase
 addChildInternal
 SEVERE: ContainerBase.addChild: start:
 org.apache.catalina.LifecycleException: Failed to start component
 [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/mywebapp-1.0-SNAPSHOT]]
 at
 org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:154)
 at
 org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901)
 at
 org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877)
 at
 org.apache.catalina.core.StandardHost.addChild(StandardHost.java:633)
 at
 org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1114)
 at
 org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:1672)
 at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
 at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
 at java.util.concurrent.FutureTask.run(Unknown Source)
 at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
 at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
 at java.lang.Thread.run(Unknown Source)
 Caused by: java.lang.NullPointerException
 at
 org.apache.catalina.startup.ContextConfig.processAnnotationsFile(ContextConfig.java:2092)
 at
 org.apache.catalina.startup.ContextConfig.processAnnotationsFile(ContextConfig.java:2093)
 at
 org.apache.catalina.startup.ContextConfig.processAnnotationsFile(ContextConfig.java:2093)
 at
 org.apache.catalina.startup.ContextConfig.processAnnotationsFile(ContextConfig.java:2093)
 at
 org.apache.catalina.startup.ContextConfig.processAnnotationsFile(ContextConfig.java:2093)
 at
 org.apache.catalina.startup.ContextConfig.webConfig(ContextConfig.java:1300)
 at
 org.apache.catalina.startup.ContextConfig.configureStart(ContextConfig.java:878)
 at
 org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:369)
 at
 org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
 at
 org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90)
 at
 org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5269)
 at
 org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
 ... 11 more

 cze 20, 2013 8:43:29 PM org.apache.catalina.startup.HostConfig
 deployDirectory
 SEVERE: Error deploying web application directory
 /var/lib/tomcat/webapps/mywebapp-1.0-SNAPSHOT
 java.lang.IllegalStateException: ContainerBase.addChild: start:
 org.apache.catalina.LifecycleException: Failed to start component
 [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/mywebapp-1.0-SNAPSHOT]]
 at
 org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:904)
 at
 org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877)
 at
 org.apache.catalina.core.StandardHost.addChild(StandardHost.java:633)
 at
 org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1114)
 at
 

Re: XSLT import/include errors

2013-06-20 Thread gelo1234
Right, it was NOT Xalan, I used Saxon in my old config. Where could we
change Xalan to Saxon in C3 ?

Now I've got another strange XSL error:
XML document structures must start and end within the same entity.

What could that mean??? :)

That Xalan is making me scratching my head against the wall :)

Greetings,
Greg


2013/6/20 Javier Puerto jpue...@gmail.com




 2013/6/20 gelo1234 gelo1...@gmail.com

 OK, resolved the issue. Deleted xslt/ directory :/ and now its starting.
 STRANGE!!


 Yeah, computer's stuff. :)



 And also found that more detailed error info about not being able to
 compile XSLT stylesheet was in Tomcat log.

 It seems that with C3 xsl:variables../ cannot be inherited. The error
 said about the same xsl:variable .../ being defined in 2 different places
 :/
 One place - in main XSL file and other one - in imported XSL file.

 While it worked fine in C2.1. I use extensively xsl:template / and
 xsl:variable ../ inheritance, now in C3 it makes XSLT not being compiled
 :/


 What version of C2.1 did you use? Maybe old Xalan? I've found the
 following note in the Xalan documentation [1]:

 Note that all top-level parameters and variables from all imported and
 included stylesheets will be placed as direct children of the top-level
 stylesheet in the AST. This done to make global variables truly global and
 not just global in the stylesheet where it was declared.

 You should avoid duplicate variable declarations, at the end of the page
 it's explained how the forward references works. You could extract some
 common variables to a XSLT template so you can use several templates
 without collision.

  [1]: http://xml.apache.org/xalan-j/xsltc/xsl_variable_design.html


 Greetings,
 Greg



 2013/6/20 gelo1234 gelo1...@gmail.com


 Now Im lost. The Cocoon context doesn't work anymore. Restarting Tomcat
 doesn't help. I tried to clean work directory, and still
 NullPointerException.

 Any idea what might be wrong ?
 And how to switch off imported xslt caching ?

 INFO: Starting Servlet Engine: Apache Tomcat/7.0.40
 cze 20, 2013 8:43:28 PM org.apache.catalina.startup.HostConfig
 deployDirectory
 INFO: Deploying web application directory
 /var/lib/tomcat/webapps/mywebapp-1.0-SNAPSHOT
 cze 20, 2013 8:43:29 PM org.apache.catalina.core.ContainerBase
 addChildInternal
 SEVERE: ContainerBase.addChild: start:
 org.apache.catalina.LifecycleException: Failed to start component
 [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/mywebapp-1.0-SNAPSHOT]]
 at
 org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:154)
 at
 org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901)
 at
 org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877)
 at
 org.apache.catalina.core.StandardHost.addChild(StandardHost.java:633)
 at
 org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1114)
 at
 org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:1672)
 at java.util.concurrent.Executors$RunnableAdapter.call(Unknown
 Source)
 at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
 at java.util.concurrent.FutureTask.run(Unknown Source)
 at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
 at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
 at java.lang.Thread.run(Unknown Source)
 Caused by: java.lang.NullPointerException
 at
 org.apache.catalina.startup.ContextConfig.processAnnotationsFile(ContextConfig.java:2092)
 at
 org.apache.catalina.startup.ContextConfig.processAnnotationsFile(ContextConfig.java:2093)
 at
 org.apache.catalina.startup.ContextConfig.processAnnotationsFile(ContextConfig.java:2093)
 at
 org.apache.catalina.startup.ContextConfig.processAnnotationsFile(ContextConfig.java:2093)
 at
 org.apache.catalina.startup.ContextConfig.processAnnotationsFile(ContextConfig.java:2093)
 at
 org.apache.catalina.startup.ContextConfig.webConfig(ContextConfig.java:1300)
 at
 org.apache.catalina.startup.ContextConfig.configureStart(ContextConfig.java:878)
 at
 org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:369)
 at
 org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
 at
 org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90)
 at
 org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5269)
 at
 org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
 ... 11 more

 cze 20, 2013 8:43:29 PM org.apache.catalina.startup.HostConfig
 deployDirectory
 SEVERE: Error deploying web application directory
 /var/lib/tomcat/webapps/mywebapp-1.0-SNAPSHOT
 java.lang.IllegalStateException: ContainerBase.addChild: start:
 org.apache.catalina.LifecycleException: Failed to start component
 [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/mywebapp-1.0-SNAPSHOT]]
  

Re: XSLT import/include errors

2013-06-20 Thread gelo1234
Yes, it must be that problem with current Xalan.

Strange thing is that some XSLT variables are predefined like: requestURI
(?!).

So I cannot use:
xsl:param name=requestURI/ in stylesheet file.xsl even though Ive got:

map:transformer src=file.xsl
 map:parameter name=requestURI value=/
/map:transformer

in sitemap.xmap. So requestURI is some GLOBAL variable ?

Greetings,
Greg

2013/6/20 Javier Puerto jpue...@gmail.com




 2013/6/20 gelo1234 gelo1...@gmail.com

 What version of C2.1 did you use? Maybe old Xalan? I've found the
 following note in the Xalan documentation [1]:

 Note that all top-level parameters and variables from all imported and
 included stylesheets will be placed as direct children of the top-level
 stylesheet in the AST. This done to make global variables truly global and
 not just global in the stylesheet where it was declared.

 You should avoid duplicate variable declarations, at the end of the page
 it's explained how the forward references works. You could extract some
 common variables to a XSLT template so you can use several templates
 without collision.

  [1]: http://xml.apache.org/xalan-j/xsltc/xsl_variable_design.html