Re: XSLT import/include errors

2013-06-20 Thread gelo1234
The latest Saxon got the same _global_ variable context scope and doesn't
allow overriding xsl:variables.
OK, I will fix that :)

Greetings,
Greg


2013/6/20 gelo1234 

>
> Thank you! I will try to bring back Saxon :)
>
> Greetings,
> Greg
>
>
> This was discused before in the mailing list [1], it's a two step process
>>
>> * Add saxon dependency to pom file. [2]
>>
>> I think it's better to try Saxon directly if you used to work with it.
>> Xalan is usually faster but as you have to migrate already made templates
>> from Saxon IMO it's better to switch the engine.
>>
>> [1] http://mvnrepository.com/artifact/net.sf.saxon/Saxon-HE
>> [2]
>> http://cocoon.markmail.org/message/mjuftsfwdxmnc5fn?q=saxon#query:saxon+page:1+mid:fe2faygf7jdfrzb3+state:results
>>
>>
>>
>


Re: XSLT import/include errors

2013-06-20 Thread gelo1234
Thank you! I will try to bring back Saxon :)

Greetings,
Greg


This was discused before in the mailing list [1], it's a two step process
>
> * Add saxon dependency to pom file. [2]
>
> I think it's better to try Saxon directly if you used to work with it.
> Xalan is usually faster but as you have to migrate already made templates
> from Saxon IMO it's better to switch the engine.
>
> [1] http://mvnrepository.com/artifact/net.sf.saxon/Saxon-HE
> [2]
> http://cocoon.markmail.org/message/mjuftsfwdxmnc5fn?q=saxon#query:saxon+page:1+mid:fe2faygf7jdfrzb3+state:results
>
>
>


Re: XSLT import/include errors

2013-06-20 Thread Javier Puerto
2013/6/20 gelo1234 

> Right, it was NOT Xalan, I used Saxon in my old config. Where could we
> change Xalan to Saxon in C3 ?
>

This was discused before in the mailing list [1], it's a two step process

* Add saxon dependency to pom file. [2]
* Create file META-INF/services/javax.xml.transform.TransformerFactory with
content:

net.sf.saxon.TransformerFactoryImpl

But you can't use both engines at the same time.


>
> 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 :)
>

I think it's better to try Saxon directly if you used to work with it.
Xalan is usually faster but as you have to migrate already made templates
from Saxon IMO it's better to switch the engine.

[1] http://mvnrepository.com/artifact/net.sf.saxon/Saxon-HE
[2]
http://cocoon.markmail.org/message/mjuftsfwdxmnc5fn?q=saxon#query:saxon+page:1+mid:fe2faygf7jdfrzb3+state:results


> Greetings,
> Greg
>
>
> 2013/6/20 Javier Puerto 
>
>>
>>
>>
>> 2013/6/20 gelo1234 
>>
>>> 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  cannot be inherited. The error
>>> said about the same  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  and
>>>  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 
>>>

 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.cat

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:
 in stylesheet file.xsl even though Ive got:


 


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

Greetings,
Greg

2013/6/20 Javier Puerto 

>
>
>
> 2013/6/20 gelo1234 
>
> 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
>
>


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 

>
>
>
> 2013/6/20 gelo1234 
>
>> 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  cannot be inherited. The error
>> said about the same  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  and
>>  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 
>>
>>>
>>> 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: s

Re: XSLT import/include errors

2013-06-20 Thread Javier Puerto
2013/6/20 gelo1234 

> 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  cannot be inherited. The error
> said about the same  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  and
>  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 
>
>>
>> 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.dep

Re: XSLT import/include errors

2013-06-20 Thread gelo1234
Resolved the issue with NullPointerException during Tomcat deploy process.
It seems like putting too many files/directories in WEB-INF/classes/COB-INF
makes Tomcat fail to deploy C3 app.

I moved block root context from: context-path="classpath:/classes/COB-INF/
to some other place:
context-path="file:/anythingNotWithingCLASSPATH/COB-INF/"

And now Tomcat deploys C3 app without problems.

Greetings,
Greg




2013/6/20 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  cannot be inherited. The error
> said about the same  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  and
>  inheritance, now in C3 it makes XSLT not being compiled
> :/
>
> Greetings,
> Greg
>
>
>
> 2013/6/20 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.Future

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  cannot be inherited. The error
said about the same  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  and
 inheritance, now in C3 it makes XSLT not being compiled
:/

Greetings,
Greg



2013/6/20 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 
>
>> Hi Greg,
>>
>> El 20/06/2013 20:00, "gelo1234"  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:
>> >
>> > > timestamp="Thu, 20 J

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 

> Hi Greg,
>
> El 20/06/2013 20:00, "gelo1234"  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:
> >
> >  timestamp="Thu, 20 Jun 2013 19:58:23 +0200">Impossible to read
> XSLT from 'javax.xml.transform.stream.StreamSource@cba24d', see nested
> exceptionCould not compile
> stylesheetjavax.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(Invocati

Re: XSLT import/include errors

2013-06-20 Thread Javier Puerto
Hi Greg,

El 20/06/2013 20:00, "gelo1234"  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:
>
> Impossible to read
XSLT from 'javax.xml.transform.stream.StreamSource@cba24d', see nested
exceptionCould not compile
stylesheetjavax.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 
> 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.


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:

Impossible to read
XSLT from 'javax.xml.transform.stream.StreamSource@cba24d', see nested
exceptionCould not compile
stylesheetjavax.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 

Re: Cocoon 3.0 components

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

Is it usable in spring config files only ... 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 

>  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=h&view=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 
>
>>   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 >>> check-reload="yes"/>

 so the configuration is as follows:

 
   

 >>> check-reload="yes"/>


  >>> check-reload="yes"/>


 

 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  would need additional :
>>
>>   
>>
>> 
>> 
>>   
>> 
>> 
>> 
>>   
>>   
>> 
>> 
>> 
>>   
>>
>>
>>  OR (a little bit more elegant and compact):
>>
>> 
>> > src="files/{jexl:cocoon:request.hostName}/homepage.xml"/>
>> 
>> 
>>
>>
>>  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:
>>
>> 
>> > src="servlet:{jexl:cocoon:request.hostName}/homepage.xml"/>
>>  
>> 
>>
>>
>>  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 
>> codeBusters S.L. - web based systems
>> 
>> http://www.codebusters.es/
>>
>>
>
>
> --
> Thorsten Scherler 
> codeBusters S.L. - web based systems
> 
> http://www.codebusters.es/
>
>


Re: Cocoon 3.0 components

2013-06-20 Thread Thorsten Scherler
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=h&view=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  >
>
> 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 > uri-prefix="" src="domain_X" check-reload="yes"/>
>>
>> so the configuration is as follows:
>>
>> 
>>   
>>
>> > src="./domaina" check-reload="yes"/>
>>
>>
>>  > src="./domainb" check-reload="yes"/>
>>
>>
>> 
>>
>> 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  would need additional > ...>:
>>
>>  
>>
>>
>>
>>   
>> 
>> 
>> 
>>   
>>   
>> 
>> 
>> 
>>   
>>   
>>
>> OR (a little bit more elegant and compact):
>>
>> 
>> > src="files/{jexl:cocoon:request.hostName}/homepage.xml"/>
>> 
>> 
>>   
>>
>> 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:
>
> 
>  src="servlet:{jexl:cocoon:request.hostName}/homepage.xml"/>
> 
> 
>   
>
> 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 http://scherler.at.gmail.com>>
> codeBusters S.L. - web based systems
> 
>
> http://www.codebusters.es/
>
>


-- 
Thorsten Scherler 
codeBusters S.L. - web based systems


http://www.codebusters.es/



Re: Cocoon 3.0 components

2013-06-20 Thread gelo1234
Yes. It works!! Thank you. I thought it was just a dummy example :)
That is what I need :)

Greetings,
Greg



2013/6/20 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:
>
> 
>
>  Greetings,
>  Greg
>
> [1]
> http://docs.oracle.com/javaee/6/api/javax/servlet/http/HttpServletRequest.html
>
>
> 2013/6/20 Francesco Chicchiriccò 
>
>>
>>  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
>>
>>
>
>
> --
> Francesco Chicchiriccò
>
> ASF Member, Apache Syncope PMC chair, Apache Cocoon PMC 
> Memberhttp://people.apache.org/~ilgrosso/
>
>


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:



Greetings,
Greg

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



2013/6/20 Francesco Chicchiriccò >



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






--
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
Can you provide me with some simple example of that new language
interpreter (module) ? :)

Greetings,
Greg



2013/6/20 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 >> check-reload="yes"/>
>>>
>>> so the configuration is as follows:
>>>
>>> 
>>>   
>>>
>>> >> check-reload="yes"/>
>>>
>>>
>>>  >> check-reload="yes"/>
>>>
>>>
>>> 
>>>
>>> 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  would need additional :
>
>   
>
> 
> 
>   
> 
> 
> 
>   
>   
> 
> 
> 
>   
>
>
>  OR (a little bit more elegant and compact):
>
> 
>  src="files/{jexl:cocoon:request.hostName}/homepage.xml"/>
> 
> 
>
>
>  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:
>
> 
>  src="servlet:{jexl:cocoon:request.hostName}/homepage.xml"/>
> 
> 
>
>
> 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 
> codeBusters S.L. - web based systems
> 
> 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:



Greetings,
Greg

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


2013/6/20 Francesco Chicchiriccò 

>
>  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-unsubscribe@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 03:02 PM, gelo1234 wrote:
>
> I've got Cocoon site that hosts multiple www domains, all
> based on the same sitemap.xmap with  src="domain_X" check-reload="yes"/>
>
> so the configuration is as follows:
>
> 
>   
>
>  src="./domaina" check-reload="yes"/>
>
>
>   src="./domainb" check-reload="yes"/>
>
>
> 
>
> 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  would need additional :
>
>  
>
>
>
>   
> 
> 
> 
>   
>   
> 
> 
> 
>   
>   
>
> OR (a little bit more elegant and compact):
>
> 
>  src="files/{jexl:cocoon:request.hostName}/homepage.xml"/>
> 
> 
>   
>
> 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:





  

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 
codeBusters S.L. - web based systems


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 > check-reload="yes"/>
>>
>> so the configuration is as follows:
>>
>> 
>>   
>>
>> > check-reload="yes"/>
>>
>>
>>  > check-reload="yes"/>
>>
>>
>> 
>>
>> 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  would need additional :

 

   
   
  



  
  



  
  

OR (a little bit more elegant and compact):





  

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 gelo1234
Thanks for clarifying this.

Greetings,
Greg


2013/6/20 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.
> 
>  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=revision&revision=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   519  pattern="error-handling/custom-error">  520  type="error-throwing" />  521  />  522   523   524 
>  525
>   526   527  equals="error-handling/custom-error-per-pipeline-error-handling">  528 
>  type="error-throwing" />  529  />  530   531   532 
> 
>  533   534  type="xhtml" status-code="501" />  535   536
> 
> However you can pass parameter though:
> 
>   
>   
> 
>
> HTH
>
> --
> Thorsten Scherler 
> codeBusters S.L. - web based systems
> 
> http://www.codebusters.es/
>
>


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.
>>> 
>>> >> 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=revision&revision=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 
519 
520 
521 
522 
523 
524 
525 
526 
527 
528 
529 
530 
531 
532 
533 
534 
535 
536 


However you can pass parameter though:

  
  


HTH

-- 
Thorsten Scherler 
codeBusters S.L. - web based systems


http://www.codebusters.es/



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  in examples sitemap.xmap 
under 

Is it possible to put  straight under  ?


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 ?

 ?


Never tried directly; anyway this should be instead



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 Francesco Chicchiriccò

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

4. actions in sitemap.xmap ?

e.g.

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 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.

src="org.apache.cocoon.matching.WildcardURIMatcher"/>
src="org.apache.cocoon.matching.RegexpURIMatcher"/>


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



matches exactly its argument


is working the "old" way


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.

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.

name="request" src="org.apache.cocoon.acting.RequestParamAction"/>


No.


5.   ?


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 check-reload="yes"/>


so the configuration is as follows:


  
   
check-reload="yes"/>

   
   
 check-reload="yes"/>

   
   


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