C3 and XSP equivalent

2012-04-02 Thread gelo1234
Hello,

We've been using Cocoon framework for years and are very happy with its
simplicity and RAD features.
Although we use very old version of Cocoon (2.0.5), it still satisfies us.
Unfortunately there are some bugs inside those old framework libs that we
cannot fix as well as some memory leaks
from libraries that are no longer in use. That's why we soon plan to
upgrade to the newest release of Cocoon.
And i have few questions related to that topic:

1. Is C3 stable enough to give it a try in a production ?

2. Is there any equivalent of XSP in C3 ?

The flexibility of XSP is very important to us in terms of introducing many
new/short changes
very fast to our web application. We just make a change and that's all -
cocoon engine recompiles the java-related
class and it is instantly available to us - no recompiling from our dev
team, no deployment, no app server restart no fuss at all!
It allows us for very rapid changes! That's exactly the kind of flexibility
we want to have in our dev environment.
And we were much worried when in next Cocoon releases the support for XSP
was abandoned. As far as i know
XSP became deprecated in C2.1.11 to be totally removed in C2.2.x and i
suppose in C3.
I didn't dig much into all the features of new Cocoon but it seems like in
C2.1/2.2 the best thing to use on the controller side
is Flowscript code. We were hesitating to switch from pure Java controller
code to Javascript/Flowscript
code because in my opinion the continuation mechanism is error-prone, yet
the developer must take care of many intricacies
around session/continuation expire times and so on. But the main reason for
us not to go for it was the language -
Javascript - NOT Java. Although if i get it right, you can just instantiate
any Java object and get access to any Java library available
around from Javascript, it is not as much flexible as java was in XSP.
Though it still doesn't require any recompiling!/redeployment phase
from  the dev team as i assume.
In C3 you can have Java controllers called and that is Good, but it does
require recompiling the Java
class and redeploy it on the server (and restart app server?). So it will
be much much SLOWER than just dynamic-recompiling by cocoon engine without
any server restart.
So i wonder if there is any mechanism on the controller side available in
C3 that enabled us to still use Java but doesn't require from us
recompiling java code/making redeployment/restarting the application server
?

3. Is Flowscript using some separate javascript engine like V8 ? Is it run
inside JVM as a dynamic language feature ?
Whats is a preferred method to be used as a logic controller in C3 -
Flowscript or Java ?

4. We don't want to go yet with C3 alpha-3 because it still uses old Xerces
and XML-API libs. We found out there are some issues with those old libs
under Tomcat 7 while working with bloated XML namespaces or handling some
SAX errors. They had led to some memory leaks in our environment.
I spotted on the changelog that you have just updated C3 beta to the newest
Xerces/XML-APIs. Thank you very much for this. I really appreciate that
important change. Can we have some light on when the beta is released ?

Greetings,
Greg


Re: C3 and XSP equivalent

2012-04-04 Thread gelo1234
Thank you Francesco for your reply. That clarified my Cocoon upgrade path
plan for the future.
I will be looking forward to seeing C3 beta released :)

I must say that you guys are doing a really great job with Cocoon. I didnt
find any other lightweight
XML/RESTful engine that is so flexible and easy to develop on.
jBoss 7 Community Edition is also in our consideration as an OSGi-based
very lightweight/modular Web Services engine and has really small footprint
but it still cannot beat C3 in terms of declarative way of handling XML
chain processing.
We tried also Apache Camel / CXF as another possible candidate to meet our
goals, but it
lacks some features. C3 looks like the best one.

We live in times when there is a tremendous pressure to deliver short-term
results/fixes and the price of introducing a new change must be very low.
In my opinion C3 fits that like anything else.
Thank you and please carry on with developing that wonderful piece of
software. I hope to see OSGi support soon :)

Greetings,
Greg


2012/4/4 Francesco Chicchiriccò ilgro...@apache.org

  Hi Greg,
 sorry for the delay: you will find my reply embedded below.

 Regards.


 On 02/04/2012 11:00, gelo1234 wrote:

 Hello,

 We've been using Cocoon framework for years and are very happy with its
 simplicity and RAD features.
 Although we use very old version of Cocoon (2.0.5), it still satisfies us.
 Unfortunately there are some bugs inside those old framework libs that we
 cannot fix as well as some memory leaks
 from libraries that are no longer in use. That's why we soon plan to
 upgrade to the newest release of Cocoon.
 And i have few questions related to that topic:

 1. Is C3 stable enough to give it a try in a production ?


 Stable enough to give a try? Yes.
 Ready for production? No, unless you have enough skills to dive inside the
 source code. There are C3-based projects in production out there, but
 latest release is alpha [1], and development version is still beta1.


 2. Is there any equivalent of XSP in C3 ?


 Not really. As you say below, XSP were already deprecated in C2.1.
 The only template mechanism available in C3 is StringTemplate [2] which is
 way less flexible (and error-prone) than XSP.


 The flexibility of XSP is very important to us in terms of introducing
 many new/short changes
 very fast to our web application. We just make a change and that's all -
 cocoon engine recompiles the java-related
 class and it is instantly available to us - no recompiling from our dev
 team, no deployment, no app server restart no fuss at all!
 It allows us for very rapid changes! That's exactly the kind of
 flexibility we want to have in our dev environment.
 And we were much worried when in next Cocoon releases the support for XSP
 was abandoned. As far as i know
 XSP became deprecated in C2.1.11 to be totally removed in C2.2.x and i
 suppose in C3.
 I didn't dig much into all the features of new Cocoon but it seems like in
 C2.1/2.2 the best thing to use on the controller side
 is Flowscript code. We were hesitating to switch from pure Java controller
 code to Javascript/Flowscript
 code because in my opinion the continuation mechanism is error-prone, yet
 the developer must take care of many intricacies
 around session/continuation expire times and so on. But the main reason
 for us not to go for it was the language -
 Javascript - NOT Java. Although if i get it right, you can just
 instantiate any Java object and get access to any Java library available
 around from Javascript, it is not as much flexible as java was in XSP.
 Though it still doesn't require any recompiling!/redeployment phase
 from  the dev team as i assume.
 In C3 you can have Java controllers called and that is Good, but it does
 require recompiling the Java
 class and redeploy it on the server (and restart app server?). So it will
 be much much SLOWER than just dynamic-recompiling by cocoon engine without
 any server restart.
 So i wonder if there is any mechanism on the controller side available in
 C3 that enabled us to still use Java but doesn't require from us
 recompiling java code/making redeployment/restarting the application server
 ?


 Sure: you can empower cocoon-maven-plugin [3] for this, or even setup
 something external like JRebel.


 3. Is Flowscript using some separate javascript engine like V8 ? Is it run
 inside JVM as a dynamic language feature ?
 Whats is a preferred method to be used as a logic controller in C3 -
 Flowscript or Java ?


 There is no support at all for Flowscript / continuations in C3.


  4. We don't want to go yet with C3 alpha-3 because it still uses old
 Xerces and XML-API libs. We found out there are some issues with those old
 libs under Tomcat 7 while working with bloated XML namespaces or handling
 some SAX errors. They had led to some memory leaks in our environment.
 I spotted on the changelog that you have just updated C3 beta to the
 newest Xerces/XML-APIs. Thank you very much for this. I really appreciate

Re: Forms and maps

2012-04-18 Thread gelo1234
Hello,

I would like to share my opinion on C3. I think that dropping support for
the most of native Cocoon components is a good step forward. As you see
trends now in enterprise applications, everybody from RedHat to Oracle
limits the amount of code from bare application server core engine making
it smaller, lighter and faster. As to additional components or modules they
are only supported if compliant with standards and mostly through separate
bundles/libraries or connectors.
There is 1 standard in Java world concerning Enterprise Java Apps - its
Java EE.
And C3 adheres to that standard through the strong RESTful Web Services
support. And I think the goal is to provide very light and fast web
services engine besides being robust integration platform. And in order to
stay competitive it must adhere to standards. Nobody will be interested in
developing non-standard components that are just equivalents of other
standard-compliant frameworks/bundles. Instead of writing its own versions
of additional components Cocoon should provide support for any necessary
standard on the market through the use of connectors/API to
components/technologies that are already used in other frameworks. That
reusability guarantees further development of the whole platform.
If you design your application by decoupling functionality among separate
services which is the concept of SOA, its very important to have very
loosely coupled components that can support any technology available on the
market. Its a nonsense and very error-prone trying to provide native
modules for any relevant technology.
And if some technology works better than other one, why not just use it?
It relates to Cocoon Forms and Wicket or JSF.
Any competitive platform now should be opened to any available technology
and should provide support for such one, while concentrating on its core
job - in case of Cocoon I presume it to be extensive XML processing and
RESTful Web Services.

According to my experience with Cocoon its a very robust platform in terms
of XML processing and data integration. And while we still use very old
release in production - 2.0.5, it still meets our goals by providing
functionality similar to today's ESB and a mix of WS-* (SOAP) and RESTful
Web Services. In case of web front-ends, we don't use any non-standard
compliant modules like Forms. Instead we use a bunch of open reliable
external libraries like JSTL, Velocity, Dojo, jQuery or jQuery Mobile to
build very satisfactory user-experience. We also make extensive use of
Google Maps through Google Maps API from Javascript/jQuery. We don't need
and don't want to use any non-standard Google Maps component from Cocoon.
Its all about the design of your app.

Greetings,
Greg
17-04-2012 22:50, Alberto abros...@ogs.trieste.it napisał(a):

 On 04/13/2012 07:18 PM, Mika M Lehtonen wrote:
  Interesting,
  I am also integrating maps into sites produced with Cocoon 2.1x. I
  have no answer to you but maybe we could collaborate on this issue?
  OpenLayers widget would be something!

 Just some considerations.
 I like very much cocoon, its philosophy, and the way to produce
 application with it and especially with forms. But we must remain
 realistic: in the last years the pace of the develop of cocoon is slow
 and the next release will be something different. For example, the
 integration with Wicket seems to be the sign that forms will not be more
 developed.
 Due to the fact that I don't know how to develop a new widget for
 cocoon, I was waiting for some clue or suggest to evaluate the effort
 needed.
 Unfortunately I have not received any answer so I'm considering to
 invest my time in another framework (Wicket) that can solve this kind
 problem and has a future more outlined.

 Ciao

 Alberto


 
  cheers,
  mika
 
 
  13.4.2012 20:03, Alberto kirjoitti:
  Hi,
 
  I'm using cocoon 2.1.12-dev and I'm facing how to include a map in
  cocoon forms.
  I have to do simple things from flowscript: load a kml url and receive
  the coordinates of an area selection.
  I'm considering to use OpenLayers or Google Maps. Looking sources I
  found already existing widget classes for GoogleMaps
  (org.apache.cocoon.forms.formmodel.GoogleMap) but it is undocumented and
  using it I have the following error: Non-existing component for this
  hint (Key='googlemap'). Moreover it seems it lacks methods to load a
  kml file.
 
  So, which is the best way to do it? The googlemap widget is working?
  I have to write a new widget following the document
  http://wiki.apache.org/cocoon/CocoonFormsCreatingWidgets?
 
  Any suggest is welcome
 
  Best regards
 
  Alberto
 
 
 
  -
  To unsubscribe, e-mail: users-unsubscr...@cocoon.apache.org
  For additional commands, e-mail: users-h...@cocoon.apache.org
 
 
 
 
  -
  To unsubscribe, e-mail: users-unsubscr...@cocoon.apache.org
  For additional 

Re: [C3] Sting template, passing argument to method

2012-10-05 Thread gelo1234
Andre,

In my opinion, if you are dealing with XML data, you should turn your eyes
into XSL[T] instead of ST.

Greetings,
Greg

2012/10/5 André Juffer andre.juf...@oulu.fi

 On 10/05/2012 09:30 AM, Francesco Chicchiriccò wrote:

 On 04/10/2012 08:53, André Juffer wrote:

 Hello,

 I am dealing with the following problem. A REST resource returns an
 (DTO) object called statistics (of type Statistics) holding various
 properties. With string template, each property can be inserted into
 an XML file, like

 A$statistics.propertyA$/A

 where the corresponding method on the Statistics object is
 getPropertyA().

 One of the properties requires an argument of type String, where the
 actual method signature is getNumberFor(String name). It returns an
 int. The name is obtained from a list of names obtained from the
 statistics objects as well. The idea is to iterate through the list of
 names and return a number (int) for each name.

 Thus, the XML code that I try to complete looks like:
 socials
$statistics.names: { name |
  social
name$name$/name
number$statistics.numberFor(**name)$/tribc:number
  /social
}$
 /socials

 The Statistics object holds among other things a MapString, Integer
 with the requested numbers.

 The line $statistics.numberFor(name)$ is however erroneous. I cannot
 pass the current value of name to the method in question.

 My question is now: How to pass a argument to a given method on an
 object using string template. The string template website did not give
 a clear answer, so maybe it is not even possible, or maybe I just
 completely overlooked it.

 Any help is appreciated.


 Hi André.
 I am not an ST expert at all, but I really think there is no support for
 generic method invocation on ST expressions: the only methods supported
 seem to ne related to properties, à la JavaBean.


 Yeah, that's what I thought.



 For your use case, I'd change a bit the application logic by providing a
 C3 REST controller that would act as a data conversion proxy between
 the sitemap and the actual REST resource you are currently dealing with.
 In this way you could query the external REST resource from the C3 REST
 controller body and prepare the data in a format that's suitable for ST.


 OK, I'll have a look at this. Alternatively, I may simply add a method to
 the DTO that returns an XML representation of the DTO. With ST, one would
 use then $statistics.asXml$ or something, but it appears that all  and 
 symbols are replaced with lt; and gt; which is not what I want of course.

 Thanks,
 Andre


 Regards.



 --
 Andre H. Juffer  | Phone: +358-8-553 1161
 Biocenter Oulu and   | Fax: +358-8-553-1141
 Department of Biochemistry   | Email: andre.juf...@oulu.fi
 University of Oulu, Finland  | WWW: 
 www.biochem.oulu.fi/**Biocomputing/http://www.biochem.oulu.fi/Biocomputing/
 StruBioCat   | WWW: www.strubiocat.oulu.fi
 Triacle Biocomputing | WWW: www.triacle-bc.com

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




Re: Modular database actions

2012-11-14 Thread gelo1234
3) I agree, XSP was very flexible and I do miss it in 2.2/3.x Cocoon. I
wonder what kind of limits did you find in XSP ?
Its pretty straightforward and very general in nature - you can put any
kind of Java and mixmatch with XML.
Its auto-compiled into Java classes so you don't have to redeploy
anything, while making quick change to the system.
It saves us a hell lot of time. Yet, you do have a full insight into Java
class source that was auto-generated from .xsp file.
Cocoon assists you with exact line number of problematic code while
debugging.
You also have full cache support of XSP files and thus blazingly fast
responses!
I find only advantages and no limits actually, notwithstanding the
model/view/controller code blending, but its a kind
of convention that you follow.

What I dislike in the recent versions of Cocoon is its strict adherence to
Spring framework and/or ORM/Hibernate. If you only use XML
as native data format and only need native SQL transactions, why should you
need any ORM ? ORM creates additional overhead
in the system, another layer of mapping between your business logic and
DB, another impedance mismatch.
If you really care about the performance, you need to consider very
carefully your persistence logic.
IMHO, we ought to have the option to use only those parts of API that we
actually need.

Greetings,
Greg

2012/11/14 Mika M Lehtonen m...@digikartta.net

 Hi,
 I am using ye old modular database actions which in my opinion is
 extremely handy tool.

 I was just wondering, how would I get some sort of a callback from e.g.
 insert/update action in order to tell the user that his/her data is saved?

 cheers,
 - mika -

 P.S. My two cents for the discussion, Is Cocoon dead?. I have build
 quite a large application with C2.1. I wanted to see, feel what it is like
 to use database actions, XSP, CForms and so on. This is what I observed.
 1) First of all. Developing an app without some sort of an IDE is pain in
 the ass. Debugging is almost impossible. No help with your code. No
 nothing.
 2) Modular database actions is something like I said, I like.
 3) XSP is super to some stage. I really like it, if taking its
 restrictions into account. Say anything, I still like it.
 4) CForms is a piece of shit hide behind nice curtains. Yeah, I know this
 is harsh to say. Still, it is something I banged my head against the wall
 all the time.
 5) Jxtemplate and its relatives is hieroglyphic jargon. I wouldn't
 recommended them to anyone.
 6) Flowscript. I never realized why.

 But the big question. How to do this all with C3. It's another kind of
 framework? Don't even try to do this?

 --**--**-
 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 zone now with 2.2 samples (besides 2.1 and 3.0)

2012-11-30 Thread gelo1234
Looks like C 3.0 samples need more tweaking:
http://cocoon.zones.apache.org/cocoon3/

Greetings,
-Greg

2012/11/30 Francesco Chicchiriccò ilgro...@apache.org

 Hi all, having found [1], I finally put the Cocoon 2.2 samples at [2]
 together with 2.1 and 3.0, already available there.

 I have also updated [3] for jail management instructions.

 Regards.

 [1] 
 http://mrhaki.blogspot.it/**2008/09/running-cocoon-22-**samples.htmlhttp://mrhaki.blogspot.it/2008/09/running-cocoon-22-samples.html
 [2] http://cocoon.zones.apache.**org/ http://cocoon.zones.apache.org/
 [3] 
 http://wiki.apache.org/cocoon/**JailManagementhttp://wiki.apache.org/cocoon/JailManagement

 --
 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 generators/aggregators/calling controllers/include/xslt questions

2012-12-01 Thread gelo1234
Thank you Thorsten,

That clarified a lot of things to me for now. I will take a deeper look
into C3.0 docs/samples.
Aggregators/Aggregation would be a nice generation-optional module? to add
into C3 in the future :)

What relates to JSF to be integrated within Cocoon, that would be a kind of
interesting feature
to have a look at.
My private opinion is though that I don't really like JSF, not the flow
model,
but backing beans/view integration part and most of its lifecycle
management.
I have to admit even Spring Web MVC is much more cleaner in my opinion.
I hate also the autogeneration of html (or other view layer format) by JSF.
You don't have full control over generated output, when you need to put
css/javascript/ajax/html snippets/tweaking
into some JSF custom attribute/element tags, not just like it is with RAW
html.
In JSF 2.2 Java EE spec finally introduced full support for HTML5, so you
can put things like:

input .jsf:id=... jsf:value=.../
not
h:inputText id=... value=.../

to fully exploit browser features and HTML5.
I do like Composite elements because you can use lots of custom templating
in output HTML.

But in summary there are more cons than pros in JSF for what I want to see
in a View part of MVC.

What I actually miss in C3.0 is that general type of Controller (in terms
of MVC). OK, you have
REST Controller, but not everybody wants to or not everywhere you need to
use RESTfull services.
In very old Cocoon (2.0?) there was XSP. That was a kind of such
controller, where you could put
some arbitrary Java code and enrich the data in the pipeline however you
wanted (call external
web services, get data from database, JMS, EJB, whatever). The fact it was
very general in nature
made it so robust (but for some it was rather a limitation and not very
clean technology in terms of separating
model/controller/view layers). Perhaps that's why it got deprecated in C2.1
or C2.2. But I do miss
that kind of general controller. What Cocoon always sucked at is database
handling.
Of course you can have spring/hibernate configuration and use it in REST
controller now, or
in some custom Aggregators. You can also use SQLTransformer and other kinds
of mixmatch
configs (without Hibernate because not everybody wants to use ORM), but
each one mentioned
has some drawbacks, depending on what you need. Well you can also use
database access
from flowscript in C2.1/2? But just a general controller would be a nice to
have, where you can
put all your persistence logic into (speaking in terms of JPA -
EntityManager, PersistenceContext etc.)

I tend to consider C3.0 now (from what you said) as a good element (that
play nicely) in the Java EE stack,
because it can be used as a separate library/component now without even a
need for a Java EE container or external servlet engine.
But I think the servlet-sitemap component is the most powerful concept in
Cocoon when it is used as a web framework.
I was looking for the appropriate ESB that would be as much flexible in
terms of routing/mediating as older
versions of Cocoon were and I didn't find such any. My opinion is that the
best advantage of Cocoon lays
in its routing/URL handling/RESTfull/pipelining features.
And as I see it now I would like Cocoon to be the main part in my system
(with its ROLE as a main Enterprise Service Bus) while other
Java EE components be used from inside or outside that ESB. I think about
that kind of architecture model.

Greetings,
-Greg



2012/12/1 Thorsten Scherler scher...@gmail.com

 On 12/01/2012 01:15 AM, gelo1234 wrote:
 
  Hello,
 
  I was trying to find some samples from current C3.0 implementation to
  know more
  about C3.0 but some information is absent.
 
  Perhaps someone here could answer that:
 
  In some old Cocoon release (2.x) there was a possibility to define
  multipart generators, something like:
 
  map:match=xxx
map:aggregate element=Page
map:part
  src=dir/file1.xml/
  a)
map:part
  src=dir/file2.xml/
  b)
map:part src=cocoon://call_some_match_generating_XML/ c)
map:part
  src=http://somedomain.com/file3.xml/ d)
/map:aggregate
...
  /map:match
 
  1. Is it still possible with C3.0 ? Especially c) option to call some
  sitemapservlet ?

 In general the aggregate has not been implemented in c3. However you can
 do the same with a xml file for you define the includes and the
 transform it with the include transformer. Regarding c) that is since
 2.2 servlet: you can find some docs around it.

 
  2. If i implement my own SAXGenerator can I use it as c) option here ?
  (How?):
  map:part type=my-custom/ ??

 not sure what you mean but I think the include example in the c3 samples
 will show you how to include.
 
  3. Is d) valid ?

 well that depend on so many different things. If you refer as is yes
 as construct. Actually all components work against urls. If you refer
 whether the outcome is valid xml - you can make sure with the neko html
 generator.
 
  4

Re: Cocoon 3.0 generators/aggregators/calling controllers/include/xslt questions

2012-12-01 Thread gelo1234
You can also have a look at Restlet framework (http://www.restlet.org/)
which I think could be a direct competitor to Cocoon,
but despite its powerful filtering/routing layers, the routes are defined
either in Java code or Spring-like way (too much verbose XML), which
is kind of headache :) to me when you just used to simple and clear sitemap
pipelines :)

That's why I think servlet-sitemap component of Cocoon is really what makes
Cocoon the most flexible/easy in terms of web programming.

Greetings,
-Greg


2012/12/1 gelo1234 gelo1...@gmail.com


 One more note:

 Typical ESBs don't describe the application structure! They only
 mediate/route messages between external services.
 You can use SCA model (typicall in SOA environment) which DOES
 support/describe/define application structure/architecture - like Apache
 Tuscany with its Assembly Model, but still I consider Tuscany to be less
 powerful and less flexible than Cocoon.

 Of course you can also go for BPM frameworks, where you can distincly
 define flows/workflows, processes in the system/application
 but in my opinion BPM should be used to optimize the business processes in
 the system when you already have some system
 architecture in place. BPM should not be used for _integration_ purposes.

 Thats why I really consider Cocoon to have features most wanted in terms
 of ESB and EAI.

 Greetings,
 -Greg


 2012/12/1 gelo1234 gelo1...@gmail.com


 Thank you Thorsten,

 That clarified a lot of things to me for now. I will take a deeper look
 into C3.0 docs/samples.
 Aggregators/Aggregation would be a nice generation-optional module? to
 add into C3 in the future :)

 What relates to JSF to be integrated within Cocoon, that would be a kind
 of interesting feature
 to have a look at.
 My private opinion is though that I don't really like JSF, not the flow
 model,
 but backing beans/view integration part and most of its lifecycle
 management.
 I have to admit even Spring Web MVC is much more cleaner in my opinion.
 I hate also the autogeneration of html (or other view layer format) by
 JSF.
 You don't have full control over generated output, when you need to put
 css/javascript/ajax/html snippets/tweaking
 into some JSF custom attribute/element tags, not just like it is with RAW
 html.
 In JSF 2.2 Java EE spec finally introduced full support for HTML5, so you
 can put things like:

 input .jsf:id=... jsf:value=.../
 not
 h:inputText id=... value=.../

 to fully exploit browser features and HTML5.
 I do like Composite elements because you can use lots of custom
 templating in output HTML.

 But in summary there are more cons than pros in JSF for what I want to
 see in a View part of MVC.

 What I actually miss in C3.0 is that general type of Controller (in terms
 of MVC). OK, you have
 REST Controller, but not everybody wants to or not everywhere you need to
 use RESTfull services.
 In very old Cocoon (2.0?) there was XSP. That was a kind of such
 controller, where you could put
 some arbitrary Java code and enrich the data in the pipeline however you
 wanted (call external
 web services, get data from database, JMS, EJB, whatever). The fact it
 was very general in nature
 made it so robust (but for some it was rather a limitation and not very
 clean technology in terms of separating
 model/controller/view layers). Perhaps that's why it got deprecated in
 C2.1 or C2.2. But I do miss
 that kind of general controller. What Cocoon always sucked at is
 database handling.
 Of course you can have spring/hibernate configuration and use it in REST
 controller now, or
 in some custom Aggregators. You can also use SQLTransformer and other
 kinds of mixmatch
 configs (without Hibernate because not everybody wants to use ORM), but
 each one mentioned
 has some drawbacks, depending on what you need. Well you can also use
 database access
 from flowscript in C2.1/2? But just a general controller would be a nice
 to have, where you can
 put all your persistence logic into (speaking in terms of JPA -
 EntityManager, PersistenceContext etc.)

 I tend to consider C3.0 now (from what you said) as a good element (that
 play nicely) in the Java EE stack,
 because it can be used as a separate library/component now without even a
 need for a Java EE container or external servlet engine.
 But I think the servlet-sitemap component is the most powerful concept in
 Cocoon when it is used as a web framework.
 I was looking for the appropriate ESB that would be as much flexible in
 terms of routing/mediating as older
 versions of Cocoon were and I didn't find such any. My opinion is that
 the best advantage of Cocoon lays
 in its routing/URL handling/RESTfull/pipelining features.
 And as I see it now I would like Cocoon to be the main part in my system
 (with its ROLE as a main Enterprise Service Bus) while other
 Java EE components be used from inside or outside that ESB. I think about
 that kind of architecture model.

 Greetings,
 -Greg




 2012/12/1 Thorsten Scherler scher

Re: Cocoon 3.0 generators/aggregators/calling controllers/include/xslt questions

2012-12-01 Thread gelo1234
One more note:

Typical ESBs don't describe the application structure! They only
mediate/route messages between external services.
You can use SCA model (typicall in SOA environment) which DOES
support/describe/define application structure/architecture - like Apache
Tuscany with its Assembly Model, but still I consider Tuscany to be less
powerful and less flexible than Cocoon.

Of course you can also go for BPM frameworks, where you can distincly
define flows/workflows, processes in the system/application
but in my opinion BPM should be used to optimize the business processes in
the system when you already have some system
architecture in place. BPM should not be used for _integration_ purposes.

Thats why I really consider Cocoon to have features most wanted in terms of
ESB and EAI.

Greetings,
-Greg

2012/12/1 gelo1234 gelo1...@gmail.com


 Thank you Thorsten,

 That clarified a lot of things to me for now. I will take a deeper look
 into C3.0 docs/samples.
 Aggregators/Aggregation would be a nice generation-optional module? to add
 into C3 in the future :)

 What relates to JSF to be integrated within Cocoon, that would be a kind
 of interesting feature
 to have a look at.
 My private opinion is though that I don't really like JSF, not the flow
 model,
 but backing beans/view integration part and most of its lifecycle
 management.
 I have to admit even Spring Web MVC is much more cleaner in my opinion.
 I hate also the autogeneration of html (or other view layer format) by JSF.
 You don't have full control over generated output, when you need to put
 css/javascript/ajax/html snippets/tweaking
 into some JSF custom attribute/element tags, not just like it is with RAW
 html.
 In JSF 2.2 Java EE spec finally introduced full support for HTML5, so you
 can put things like:

 input .jsf:id=... jsf:value=.../
 not
 h:inputText id=... value=.../

 to fully exploit browser features and HTML5.
 I do like Composite elements because you can use lots of custom templating
 in output HTML.

 But in summary there are more cons than pros in JSF for what I want to see
 in a View part of MVC.

 What I actually miss in C3.0 is that general type of Controller (in terms
 of MVC). OK, you have
 REST Controller, but not everybody wants to or not everywhere you need to
 use RESTfull services.
 In very old Cocoon (2.0?) there was XSP. That was a kind of such
 controller, where you could put
 some arbitrary Java code and enrich the data in the pipeline however you
 wanted (call external
 web services, get data from database, JMS, EJB, whatever). The fact it was
 very general in nature
 made it so robust (but for some it was rather a limitation and not very
 clean technology in terms of separating
 model/controller/view layers). Perhaps that's why it got deprecated in
 C2.1 or C2.2. But I do miss
 that kind of general controller. What Cocoon always sucked at is
 database handling.
 Of course you can have spring/hibernate configuration and use it in REST
 controller now, or
 in some custom Aggregators. You can also use SQLTransformer and other
 kinds of mixmatch
 configs (without Hibernate because not everybody wants to use ORM), but
 each one mentioned
 has some drawbacks, depending on what you need. Well you can also use
 database access
 from flowscript in C2.1/2? But just a general controller would be a nice
 to have, where you can
 put all your persistence logic into (speaking in terms of JPA -
 EntityManager, PersistenceContext etc.)

 I tend to consider C3.0 now (from what you said) as a good element (that
 play nicely) in the Java EE stack,
 because it can be used as a separate library/component now without even a
 need for a Java EE container or external servlet engine.
 But I think the servlet-sitemap component is the most powerful concept in
 Cocoon when it is used as a web framework.
 I was looking for the appropriate ESB that would be as much flexible in
 terms of routing/mediating as older
 versions of Cocoon were and I didn't find such any. My opinion is that the
 best advantage of Cocoon lays
 in its routing/URL handling/RESTfull/pipelining features.
 And as I see it now I would like Cocoon to be the main part in my system
 (with its ROLE as a main Enterprise Service Bus) while other
 Java EE components be used from inside or outside that ESB. I think about
 that kind of architecture model.

 Greetings,
 -Greg




 2012/12/1 Thorsten Scherler scher...@gmail.com

 On 12/01/2012 01:15 AM, gelo1234 wrote:
 
  Hello,
 
  I was trying to find some samples from current C3.0 implementation to
  know more
  about C3.0 but some information is absent.
 
  Perhaps someone here could answer that:
 
  In some old Cocoon release (2.x) there was a possibility to define
  multipart generators, something like:
 
  map:match=xxx
map:aggregate element=Page
map:part
  src=dir/file1.xml/
  a)
map:part
  src=dir/file2.xml/
  b)
map:part src=cocoon://call_some_match_generating_XML/ c)
map:part

Re: Generator with XMLFilterImpl

2012-12-06 Thread gelo1234
If you need to do this in generator why not writing your own Generator ?
that extends AbstractSAXGenerator ?
You can find example in:
cocoon-sample/src/main/java/org/apache/cocoon/sample/generation/

Greetings,
Greg

2012/12/6 Mansour Al Akeel mansour.alak...@gmail.com

 Javier, thank you for replying.
 For many additional reasons, I need to do this in a generator. It's
 not my call on this. So I need to connect the XMLFilterImpl to the
 Generator.
 I know it can be done, but looking for the simplest and cleanest way.


 On Thu, Dec 6, 2012 at 12:25 PM, Javier Puerto jpue...@gmail.com wrote:
  Hi Mansour,
 
  2012/12/6 Mansour Al Akeel mansour.alak...@gmail.com
 
  Hello all,
  I am using C2.2 for this project, and I need to add some functionality
  to the current file generator (ie, logging and warning for broken
  links). I know this can be done in a transformer,
  but since it's required in many places, I want it in the Generator.
 
 
  Since the generator, generates SAX events, the simplest way is to
  insert an XMLFilterImpl that does the logging, between the generator
  and the consumer. For example:
 
 
  I think that use a Transformer is the Cocoon way and simplest (no need of
  java code).
 
  map:pipeline match=myCustomFileGenerator/**
map:generator src={1}/
map:transform src=yourXSLT/
mao:serialize/
  /map:pipeline
 
  Then you can use from other pipelines in the same sitemap like this:
 
  map:pipeline match=my/service
map:generate
 src=cocoon:/myCustomFileGenerator/your/file/to/consume/

 
  From another block you can consume also with the sevlet: protocol, just
 add
  the name of the block with the service you want to consume:
  map:pipeline match=my/service
map:generate
  src=servlet:myBlock:/myCustomFileGenerator/your/file/to/consume/
 
 
 
  Currently:
 
  FileGenerator -- events --- XMLConsumer
 
  I need it to be:
 
  FileGenerator -- events -- XMLFilterImpl --- XMLConsumer
  OR
  FileGenerator -- events --- XMLConsumer -- XMLFilterImpl
 
  The issue is I couldn't find any example on connecting and setting up
  a filter between the generator and the consumer.
  Additionally, setting the contentHandler doesn't seem to have any
  effect. Currently this is what I have and the events are not passing
  through LinkValidator Filter.
 
 
  public class MyGenerator extends FileGenerator {
 
  @Override
  public void setup(SourceResolver resolver, Map objectModel,
 String
  src, Parameters parameters) throws ProcessingException, SAXException,
  IOException {
 
  super.setup(resolver, objectModel, src, parameters);
 
  LinkValidator validator = new
  LinkValidator(this.contentHandler);
 
  this.setContentHandler(validator);
 
  }
 
  @Override
  public void generate() throws IOException, SAXException,
  ProcessingException {
  super.generate();
  }
 
  }
 
 
  Thank you
 
 
  If you have implemented the XMLFilter already, you can easily transform
 into
  a Cocoon transformer, the interface is very similar.
 
  Salu2.
 
 
 
  -
  To unsubscribe, e-mail: users-unsubscr...@cocoon.apache.org
  For additional commands, e-mail: users-h...@cocoon.apache.org
 
 

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




Re: Generator with XMLFilterImpl

2012-12-06 Thread gelo1234
But you should really consider using Transformer as Jaxier suggested. Thats
what filters XML data in Cocoon so acts as a Filter.
If you need to do this in Java (write your own Transformer [Filter]), you
can take a look at one of the simplest Transformers
in Cocoon sources: CleaningTransformer

cocoon-sax/src/main/java/org/apache/cocoon/sax/component/CleaningTransformer.java

You just consume SAX events and generate new ones :)

Greetings,
Greg


2012/12/6 gelo1234 gelo1...@gmail.com


 If you need to do this in generator why not writing your own Generator ?
 that extends AbstractSAXGenerator ?
 You can find example in:
 cocoon-sample/src/main/java/org/apache/cocoon/sample/generation/

 Greetings,
 Greg


 2012/12/6 Mansour Al Akeel mansour.alak...@gmail.com

 Javier, thank you for replying.
 For many additional reasons, I need to do this in a generator. It's
 not my call on this. So I need to connect the XMLFilterImpl to the
 Generator.
 I know it can be done, but looking for the simplest and cleanest way.


 On Thu, Dec 6, 2012 at 12:25 PM, Javier Puerto jpue...@gmail.com wrote:
  Hi Mansour,
 
  2012/12/6 Mansour Al Akeel mansour.alak...@gmail.com
 
  Hello all,
  I am using C2.2 for this project, and I need to add some functionality
  to the current file generator (ie, logging and warning for broken
  links). I know this can be done in a transformer,
  but since it's required in many places, I want it in the Generator.
 
 
  Since the generator, generates SAX events, the simplest way is to
  insert an XMLFilterImpl that does the logging, between the generator
  and the consumer. For example:
 
 
  I think that use a Transformer is the Cocoon way and simplest (no need
 of
  java code).
 
  map:pipeline match=myCustomFileGenerator/**
map:generator src={1}/
map:transform src=yourXSLT/
mao:serialize/
  /map:pipeline
 
  Then you can use from other pipelines in the same sitemap like this:
 
  map:pipeline match=my/service
map:generate
 src=cocoon:/myCustomFileGenerator/your/file/to/consume/

 
  From another block you can consume also with the sevlet: protocol, just
 add
  the name of the block with the service you want to consume:
  map:pipeline match=my/service
map:generate
  src=servlet:myBlock:/myCustomFileGenerator/your/file/to/consume/
 
 
 
  Currently:
 
  FileGenerator -- events --- XMLConsumer
 
  I need it to be:
 
  FileGenerator -- events -- XMLFilterImpl --- XMLConsumer
  OR
  FileGenerator -- events --- XMLConsumer -- XMLFilterImpl
 
  The issue is I couldn't find any example on connecting and setting up
  a filter between the generator and the consumer.
  Additionally, setting the contentHandler doesn't seem to have any
  effect. Currently this is what I have and the events are not passing
  through LinkValidator Filter.
 
 
  public class MyGenerator extends FileGenerator {
 
  @Override
  public void setup(SourceResolver resolver, Map objectModel,
 String
  src, Parameters parameters) throws ProcessingException, SAXException,
  IOException {
 
  super.setup(resolver, objectModel, src, parameters);
 
  LinkValidator validator = new
  LinkValidator(this.contentHandler);
 
  this.setContentHandler(validator);
 
  }
 
  @Override
  public void generate() throws IOException, SAXException,
  ProcessingException {
  super.generate();
  }
 
  }
 
 
  Thank you
 
 
  If you have implemented the XMLFilter already, you can easily transform
 into
  a Cocoon transformer, the interface is very similar.
 
  Salu2.
 
 
 
  -
  To unsubscribe, e-mail: users-unsubscr...@cocoon.apache.org
  For additional commands, e-mail: users-h...@cocoon.apache.org
 
 

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





Re: using both Xalan and Saxon with C3

2012-12-06 Thread gelo1234
When you are paranoid;) about the performance, you can set many different
configs for xslt processors.

e.g. the one that uses compiled versions of XSL sheets - translets (XSLTC)
http://xml.apache.org/xalan-j/xsltc_usage.html
or the one that is faster because it doesn't use Request Parameters
or the one that is reused between concurrent transformations (e.g. xalan
can be used in this mode but it fails with very complex namespaces,
the latest release of xalan handles it correctly though :)
or the one that is the most robust but a bit slower (saxon?)

And use whatever one you want in any match of pipeline.

Greetings,
-Greg

2012/12/7 Mansour Al Akeel mansour.alak...@gmail.com

 Ok, I see what you mean now.

 Just out of curiosity, why would anyone need to use more than one xslt
 processor in one application ??

 Thank you.

 On Thu, Dec 6, 2012 at 2:50 AM, Robby Pelssers robby.pelss...@nxp.com
 wrote:
  You missed the point Mansour... I meant simultaneously in 1 pipeline.
 
  But thx for thinking along.
  Robby
 
  -Original Message-
  From: Mansour Al Akeel [mailto:mansour.alak...@gmail.com]
  Sent: Thursday, December 06, 2012 5:00 AM
  To: users@cocoon.apache.org
  Cc: d...@cocoon.apache.org
  Subject: Re: using both Xalan and Saxon with C3
 
  If I am not wrong, you can always change the implementation for the xslt
 processor in the final WAR file by setting:
 
  META-INF/services/javax.xml.transform.TransformerFactory
 
  This is simple and clean.
 
 
 
  On Wed, Dec 5, 2012 at 5:21 AM, Robby Pelssers robby.pelss...@nxp.com
 wrote:
  I did some investigation into this matter and the problem is in
  org.apache.cocoon.sax.component.XSLTTransformer
 
  It has two constructor methods:
 
  public XSLTTransformer(final URL source) {
  this(source, null);
  }
 
  And
 
  public XSLTTransformer(final URL source, final MapString, Object
 attributes) {
  super();
  this.loadXSLT(source, attributes);
  }
 
  So we can set attributes for the transformerfactory but not choose the
 implementation. First of all I see something in the code that makes no
 sense to me:
 
  /**
   * A generic transformer factory to parse XSLTs.
   */
  private static final SAXTransformerFactory TRAX_FACTORY =
  createNewSAXTransformerFactory();
 
  this always falls back to
 
  private static SAXTransformerFactory
 createNewSAXTransformerFactory() {
  return (SAXTransformerFactory) TransformerFactory.newInstance();
  }
 
 
  But on lines 148 to 157 I see following code.  If the attributes are
 not null and not empty we STILL use createNewSAXTransformerFactory.  So the
 else block seems like a complete waste here?!
 
 
  // XSLT has to be parsed
  SAXTransformerFactory transformerFactory;
  if (attributes != null  !attributes.isEmpty()) {
  transformerFactory = createNewSAXTransformerFactory();
  for (EntryString, Object attribute :
 attributes.entrySet()) {
  transformerFactory.setAttribute(attribute.getKey(),
 attribute.getValue());
  }
  } else {
  transformerFactory = TRAX_FACTORY;
  }
 
  Ideally I would like to see a third constructor method which would
  allow us to set  the factoryClassName of the
  Javax.xml.transform.TransformerFactory
 
  And default use:
 
  public static TransformerFactory newInstance(String factoryClassName,
  ClassLoader classLoader)  throws TransformerFactoryConfigurationError
 
  We could from Cocoon side default set this to be
 com.sun.org.apache.xalan.internal.xsltc.trax.TransformerFactoryImpl if
 the factoryClassName is null or empty.
 
  Just thinking out loud here...
 
  Robby
 
 
  -Original Message-
  From: Robby Pelssers [mailto:robby.pelss...@nxp.com]
  Sent: Tuesday, December 04, 2012 2:21 PM
  To: d...@cocoon.apache.org; users@cocoon.apache.org
  Subject: using both Xalan and Saxon with C3
 
  Hi guys,
 
  Just wondering how I would configure a C3 project so I could use both
  Xalan and Saxon from my sitemap and java
 
  I currently took the approach to just create a file
  META-INF/services/javax.xml.transform.TransformerFactory
  With following content:
  net.sf.saxon.TransformerFactoryImpl
 
  But I guess that restricts me to always use Saxon by default?
 
  Robby
 
  -
  To unsubscribe, e-mail: users-unsubscr...@cocoon.apache.org
  For additional commands, e-mail: users-h...@cocoon.apache.org
 
 
  -
  To unsubscribe, e-mail: users-unsubscr...@cocoon.apache.org
  For additional commands, e-mail: users-h...@cocoon.apache.org
 
 
 
 
  -
  To unsubscribe, e-mail: users-unsubscr...@cocoon.apache.org
  For additional commands, e-mail: users-h...@cocoon.apache.org
 

 

Re: zip-archive generator (reverse of zip-archive serializer)

2012-12-07 Thread gelo1234
I don't know about your use-case of zip-archive usage, but it looks like a
typical Data Integration scenario.
Perhaps you should take a look at Apache Camel:
http://camel.apache.org/zip-dataformat.html

Greetings,
-Greg

2012/12/7 Robby Pelssers robby.pelss...@nxp.com

 Hi guys,

 Not sure if we have a zip-archive generator already
 http://cocoon.apache.org/2.1/userdocs/ziparchive-serializer.html

 but it would be very cool to have one.  Let me explain the use case:

 !--
{1}: a URI pointing to a zip containing XML documents
 --
 map:match pattern=processzip/**
   map:generate src={1} type=zip/
   map:transform src=processfiles.xslt/
Now a lot of options
 - write results to disk
 - just serialize result
 - zip transformed files again
  ...
 /map:match

 So what should this ziparchive generator do?  It should let us peak into
 the ziparchive and return URI's for all entries

 zip:archive xmlns:zip=http://apache.org/cocoon/zip-archive/1.0;
   zip:entry
 name=jar:file:/C:/data/productinformation.zip!/products/PH3330L.xml/
   ...
   zip:entry name=jar:file:/C:/data/
 productinformation.zip!/packages/SOT669.xml/
...
 /zip:archive

 Or

 zip:archive xmlns:zip=http://apache.org/cocoon/zip-archive/1.0;
   zip:entry name=jar:
 http://www.mydomain.com/data/productinformation.zip!/products/PH3330L.xml
 /
   ...
   zip:entry name=jar:
 http://www.mydomain.com/data/productinformation.zip!/packages/SOT669.xml/
...
 /zip:archive


 So if you add a transformer in that pipeline you can use the XSLT document
 function to fetch the documents and process them individually.

 I'm only not sure about how to implement this efficiently. I  don't want
 to make requests in case of a HTTP URI:
 - 1 used by the ziparchive-generator to produce the XML above
 - 1 request per invocation of the document function

 So maybe caching can resolve this or are there better options?

 Robby



Re: Flowscript - delete file

2012-12-29 Thread gelo1234
Hi Peter,

file.delete() doesn't get executed in this case.

Its:
  if (!file.exists()) {
   throw new FileNotFoundException(filePath);

that line of code that triggers your Error message and file.delete() has
not been reached.

Greetings,
Greg




2012/12/29 Peter Sparkes pe...@didm.co.uk

  Hi Martin and Robby,

 Thank you both for your help, what I have ended up with is:

 importClass(Packages.java.io.File);
 importClass(Packages.java.io.FileNotFoundException);

 function deletefile() {

 //var filePath = cocoon.parameters[file];

 var filePath = D:/cocoon-2.1.11-wl/build/webapp/BB/xml/.xml;
 //for testing

 var file = new File(filePath);
  try {
 if (!file.exists()) {
throw new FileNotFoundException(filePath);
 }
 file.delete();
 cocoon.sendPage('deletefilesuccess',{file:filePath});
 } catch (e) {
 cocoon.sendPage('deletefileerror',{file:e});
 }
 }

 However, file.delete(); produces a syntax error.

 If I comment out file.delete(), the rest of the script works correctly:

- If .xml exists, deletefilesuccess is accessed
- If .xml does not exist, deletefileerror is accessed and I get:
Error File java.io.FileNotFoundException:
D:/cocoon-2.1.11-wl/build/webapp/BB/xml/.xml Not Found

 What's wrong with file.delete(); ?

 Regards

 Peter



 On 27/12/2012 18:35, Martin Heiden wrote:

 Hi Peter,

 Ok, I missed something:

  var xml_file = 
 Packages.java.io.File(D:\cocoon-2.1.11-wl\build\webapp\BB\xml + file + 
 .xml);

 should be:

  var xml_file = new 
 Packages.java.io.File(D:\cocoon-2.1.11-wl\build\webapp\BB\xml + file + 
 .xml);

 But you should try the function Robby sent to the list. It's much
 cleaner.

 Regards,

   Martin.


 Thursday, December 27, 2012, 6:12:08 PM, you wrote:

 PS Hi Martin

 PS Thanks for your suggestion, unfortunately I get the same  error. The 
 error log gives:

 PS ERROR (2012-12-27) 15:30.46:723 [flow] (/office/deletefile_) 
 PoolThread-4/JSErrorReporter:
 PS file:///D:/cocoon-2.1.11-wl/build/webapp/office/flow/deletefile.js, 
 line 13: missing name after .
 PS operator
 PS ERROR (2012-12-27) 15:30.46:723 [sitemap.handled-errors] 
 (/office/deletefile_)
 PS PoolThread-4/ErrorHandlerHelper: Sitemap: error calling function 
 'deletefile'
 PS  at map:call -
 PS file:///D:/cocoon-2.1.11-wl/build/webapp/office/sitemap.xmap:230:37
 PS  at map:mount -
 PS file:///D:/cocoon-2.1.11-wl/build/webapp/sitemap.xmap:783:90
 PS org.mozilla.javascript.EvaluatorException:
 PS file:///D:/cocoon-2.1.11-wl/build/webapp/office/flow/deletefile.js, 
 line 1: Compilation produced 1
 PS syntax errors.
 PS  at
 PS 
 org.apache.cocoon.components.flow.javascript.JSErrorReporter.runtimeError(JSErrorReporter.java:67)

 PS regards

 PS Peter


 PS On 27/12/2012 11:42, Martin Heiden wrote:

  Hi Peter,

 PS  //Delete file
 PS  Packages.java.io.File.xml_file.delete();

 Try

 xml_file.delete();

 You just have to add the full path to the class when you
 construct it. After this, the variable contains a reference and you
 can just use it.

 Regards,

Martin.


 Thursday, December 27, 2012, 10:28:31 AM, you wrote:

 PS Hi,

 PS I am trying to delete xml files using the following flowscript:

 PS function deletefile() {

 PS  //file to be deleted
 PS  var file =
 PS Packages.java.lang.String(cocoon.parameters[file]);

 PS  try {
 PS  // creating a link to the file to be deleted
 PS  var xml_file =
 PS Packages.java.io.File(D:\cocoon-2.1.11-wl\build\webapp\BB\xml + file
 PS + .xml);

 PS  //Delete file
 PS  Packages.java.io.File.xml_file.delete();

 PS  //  .txt file with OK message
 PS  cocoon.sendPage(success.txt, null);
 PS  }
 PS  catch(ex){
 PS  cocoon.log.error(ex);
 PS  // Smth. went wrong. Sending a error.txt file to the browser
 PScocoon.sendPage(error.txt, null);
 PS  }

 PS }

 PS and get Compilation produced 1 syntax errors

 PS The error log contains:

 PS ERROR deletefile.js, line 13: missing name after . 
 operator

 PS line 13 is:

 PS Packages.java.io.File.xml_file.delete();

 PS What I am doing wrong?

 PS Peter







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

   Ciao,
  Martin


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





Re: Multipage CForm using Ajax - Non ascii Characters

2013-01-14 Thread gelo1234
Ajax calls use default character encoding defined by HTTP 1.1 spec (which
iso-8859-1, not UTF-8). You have to encode BEFORE sending and decode AFTER
retrieving those strings.
Encode with encodeURIComponent, decode with decodeURIComponent (if
Javascript).

Greetings,
Greg


2013/1/14 Peter Sparkes pe...@didm.co.uk

  Hi

 Cocoon 2.11

 I have implemented a multipage CForm which uses Ajax. The form is based on
 the example at


 http://cocoon.zones.apache.org/cocoon21/samples/blocks/forms/do-multipage.flow

 The  form works fine except that it does not save non ascii characters
 correctly eg.

 É €  ç  £


 If I use one very long form without Ajax the above characters are
 correctly saved

 Help please, How can I fix this problem


 Peter



Re: Multipage CForm using Ajax - Non ascii Characters

2013-01-14 Thread gelo1234
Have you tried google this ? e.g.
http://cocoon.10839.n7.nabble.com/Binding-Encoding-with-CForms-Dojo-td57359.html
http://cocoon.apache.org/2.2/1366_1_1.html

Those clues should fix your problem.

Greetings,
-Greg


2013/1/14 Peter Sparkes pe...@didm.co.uk

  Hi Robby,

 Thanks for your reply.

 The problem is that I don't have any client side scripting. I am using
 CForms to allow the site owner to populate a database. The data is then
 used in a number of different xhtml pages.

 Kind regards

 Peter


 On 14/01/2013 15:55, Robby Pelssers wrote:

  Hi Peter,

 ** **

 No…encodeURIComponent should go in the client javascript.  

 And in flowscript you have to decode the parameter value again.  

 ** **

 importClass(Packages.java.net.URLDecoder);

 ** **

 var decodedvalue =
 URLDecoder.decode(cocoon.request.getParameter(“someparam”);

 ** **

 ** **

 Kind regards,

 Robby

 ** **

 ** **

 ** **

 *From:* Peter Sparkes [mailto:pe...@didm.co.uk pe...@didm.co.uk]
 *Sent:* Monday, January 14, 2013 4:45 PM
 *To:* users@cocoon.apache.org
 *Subject:* Re: Multipage CForm using Ajax - Non ascii Characters

 ** **

 Thanks Greg and Robby for your replies.

 Unfortunately I can't get it to work. I assume encodeURIComponent goes
 into the flowscript:

 function multipage() {
var lodgeId = cocoon.parameters.lodgeId;
cocoon.request.setAttribute(lodgeId, lodgeId);

var documentURI = cocoon.parameters[documentURI];
// parse the document to a DOM-tree
var document = loadDocument(documentURI);

//document = decodeURIComponent (document);

// get the documentURI parameter from the sitemap which contains the
 location of the form definition (model)
var definitionURI = cocoon.parameters[definitionURI];

//create new form
var form = new Form(definitionURI);

// get the documentURI parameter from the sitemap which contains the
 location of the binding file
 var bindingURI = cocoon.parameters[bindingURI];
 form.createBinding(bindingURI);

 // bind the document data to the form
 form.load(document);

 // show the form to the user until it is validated successfully
 form.showForm(lodgemul-display-pipeline.jx);

 // bind the form's data back to the document

 form.save(document);

 // save the DOM-tree back to an XML file,
 document = encodeURIComponent(document);
 saveDocument(document, documentURI);

 // show the xml generated from the form
 var success ='/BB/England/Devon/Bideford/'+ lodgeId+'.html';
 //cocoon.redirectTo('/office/' + lodgeno+'.htm');
 cocoon.sendPage(success);
 }

 document = encodeURIComponent(document);  produces the following error
 when I submit the completed form

 Can't find method org.apache.cocoon.xml.dom.DOMStreamer.stream(string).

 What am I doing wrong

 Peter

 On 14/01/2013 14:27, gelo1234 wrote:

   Ajax calls use default character encoding defined by HTTP 1.1 spec
 (which iso-8859-1, not UTF-8). You have to encode BEFORE sending and decode
 AFTER retrieving those strings.

 Encode with encodeURIComponent, decode with decodeURIComponent (if
 Javascript).

 Greetings,

 Greg 



 On 14/01/2013 14:22, Robby Pelssers wrote:

 You will probably need to encode the characters if you make an ajax call…*
 ***

  

 var  somevalue = encodeURIComponent(“this is a value to be
 encoded”);

  

 Robby

  

 *From:* Peter Sparkes [mailto:pe...@didm.co.uk pe...@didm.co.uk]
 *Sent:* Monday, January 14, 2013 3:18 PM
 *To:* Cocoon users
 *Subject:* Multipage CForm using Ajax - Non ascii Characters

  

 Hi

 Cocoon 2.11

 I have implemented a multipage CForm which uses Ajax. The form is based on
 the example at


 http://cocoon.zones.apache.org/cocoon21/samples/blocks/forms/do-multipage.flow

 The  form works fine except that it does not save non ascii characters
 correctly eg.

 É €  ç  £



 If I use one very long form without Ajax the above characters are
 correctly saved

 Help please, How can I fix this problem


 Peter 

 ** **





Re: Deployment scenarios for cocoon 3.0

2013-01-30 Thread gelo1234
Thank you for a quick response Francesco. It IS some option indeed.

But AFAIK Tomcat 7.0 loader is equivalent to Context reloadable attribute.
It just overwrites the global (Context) reloadable attribute that existed
also in previous Tomcat versions. Either the latter or the former brings
some drawbacks in terms of performance:

As [1] states: This feature is very useful during application development,
but it requires significant runtime overhead and is not recommended for use
on deployed production applications.

Reloading Tomcat deployed web app/context with Tomcat Manager also brings
some (although small) time period of your web app/context unavailability.
Taking into consideration the engine restart time that oscillates between 2
to 4 seconds in Tomcat 7.0, there is no big deal whether
you restart the Tomcat engine or reload the app with Tomcat Manager (if
there is only one web app/context running inside Tomcat).

I was wondering if there are some OSGi related techniques/mechanism in
Cocoon 3.0 that could help bring another version/release of a given
component and switch to that on demand on a live system.

But I guess its just the application server (not framework/library like
Cocoon issue), so for instance WebLogic got web app versioning feature [2]
or some OSGi-compliant app servers got native support for it. So the proper
solution would be for instance to use Cocoon custom components as OSGI
bundles inside an OSGI-compliant web application server.

Thank you for your tip on Tomcat config.

Greetings,
Greg

[2]
http://docs.oracle.com/cd/E13222_01/wls/docs90/programming/versioning.html




2013/1/30 Francesco Chicchiriccò ilgro...@apache.org

 On 30/01/2013 11:19, gelo1234 wrote:

 Hello,

 Im thinking about applying several urgent patches onto the running cocoon
 3.0 web app _without_ application server restart (be it Tomcat).

 Lets say I want to modify some code inside REST Controller
 (MyRestController).
 I presume that If I make some change in REST Controller class i wont be
 able just to replace jar/class files on running Tomcat and thats it. It
 will NOT pick up the changes.

 So lets say i create a new class flle (another version of REST Controller:
 MyRestController2) and upload that class/jar file to Tomcat, then change
 Cocoon sitemap.xmap to have a new class:

 controller:call controller=rest-controller select=com.foo.controller.
 **MyRestController2
 ...
 /controller:call

 and thats it ? Will Cocoon pick it up correctly WITHOUT Tomcat restart
 and use the new code ?

 Or yet I have to update/refresh somehow Spring context/configuration ?

 context:component-scan base-package=com.foo.**controller
 use-default-filters=false
 name-generator=org.apache.**cocoon.rest.controller.**
 ControllerBeanNameGenerator
 scope-resolver=org.apache.**cocoon.rest.controller.**
 ControllerBeanScopeResolver
 context:include-filter type=annotation
 expression=org.apache.cocoon.**rest.controller.annotation.**RESTController
 /
   /context:component-scan

 context:annotation-config /

 I know its NOT a good practice to hot deploy such code on a production
 servers but sometimes you just need fast update and cannot restart app
 server or use some 3rd party tools like Live Rebel etc.
 I don't want to introduce a new block with the new controller in cocoon
 app, because that would also be a valid option as i presume ?


 Hi Greg,
 given the constraints you define above, I would suggest to solve your
 problem at Tomcat level by empowering the reloadable attribute of
 classloaders [1].

 In this way you don't need to modify anything at Cocoon level.

 Regards.

 [1] 
 http://tomcat.apache.org/**tomcat-7.0-doc/config/loader.**htmlhttp://tomcat.apache.org/tomcat-7.0-doc/config/loader.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: A generator with sitemap parameter in C3

2013-02-11 Thread gelo1234
Ohh...ok that clarifies a problem a bit. So if the generator declaration
inside sitemap.xmap does NOT have src=.. attribute i won't get this piece
of code [1] executed:

if (this.source != null) {
Object attributesObj = configuration.get(attributes);
if (attributesObj != null  attributesObj instanceof Map) {
...
}

In case of the custom example given before:

map:generate type=some-custom
  ...
/map:generate

it does NOT have src attribute (Not every generator got src attribute). So
the question is still valid, how to get to those map:parameter .../
values in such case ? Simply by adding useless src= attribute to
map:generate .. e.g.

map:generate type=some-custom src=http://www.w3c.org; ?

or through the use of some Helper class? as it is in [2] (to Request
Parameters instead of map:parameter name=a
value=jexl:cocoon.request.a/) with HttpContextHelper - wonder if there
is any equivalent Helper class for Cocoon Sitemap :)


[1]
https://svn.apache.org/repos/asf/cocoon/cocoon3/trunk/cocoon-sax/src/main/java/org/apache/cocoon/sax/component/XSLTTransformer.java
[2]
https://svn.apache.org/repos/asf/cocoon/cocoon3/trunk/cocoon-servlet/src/main/java/org/apache/cocoon/servlet/component/RequestParametersGenerator.java

Greetings,
Greg




2013/2/11 Francesco Chicchiriccò ilgro...@apache.org

 On 11/02/2013 12:07, gelo1234 wrote:

 Question 1:
 Can we have some example of this one ?

 map:generate type=some-custom
map:parameter name=a value=1/
map:parameter name=b value=2/
 /map:generate

 I mean, how to get sitemap parameter value from Java Generator code ?
 btw. Request Parameters are obtained by the use of HttpContextHelper, is
 this correct ?


 No: you can access map:parameter elements from within Java code in the
 same way how this is done in the XSLTTransformer [1]: consider that
 source is the only pre-defined parameter you have in any pipeline
 component, mapped to the 'src' XML attribute.


  Question 2:
 What is the best (optimal) way to include XML content generated from
 servlet/controller?

 x:include  src=servlet:/.../

 If the servlet is calling a REST controller there are 2 invocations
 involved (one to gather data, the other one (with e.g. string-template) to
 actually serialize the data). Is there any way that REST controller could
 serialize the data itself ? without invoking another servlet/Page ?


 Not that I know: anyway I am using similar includes in different
 production environments with high load and I've experienced no troubles so
 far.


  Question 3:
 If the generator is included in some transformer phase (via x:include)
 does it still have access to original Request Parameters when invoked
 with:

 x:include ... src=servlet:/generate?par1=a**par2=b/

 or they are lost (original request params) and substituted by new ones
 (par1, par2 from the line above)?


 They are lost: you need to explicitly pass them though.

 Regards.

 [1] https://svn.apache.org/repos/**asf/cocoon/cocoon3/trunk/**
 cocoon-sax/src/main/java/org/**apache/cocoon/sax/component/**
 XSLTTransformer.javahttps://svn.apache.org/repos/asf/cocoon/cocoon3/trunk/cocoon-sax/src/main/java/org/apache/cocoon/sax/component/XSLTTransformer.java

 --
 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: A generator with sitemap parameter in C3

2013-02-11 Thread gelo1234
Thank you Francesco. That is what I was looking for!! :)

So the setup(...) has access to sitemap parameters :) Why not
setConfiguration(..) ?

Does call:
this.setup((MapString, Object) configuration)
strips off?/adds? some unwanted/additional data for sitemap-servlet
framework ?

As i recall setConfiguration is for Java only (without sitemap-servlet)
Cocoon use and setup is for standard sitemap-servlet ? Is that correct ?

Greetings,
Greg


2013/2/11 Francesco Chicchiriccò ilgro...@apache.org

  On 11/02/2013 13:27, gelo1234 wrote:

  Ohh...ok that clarifies a problem a bit. So if the generator
 declaration inside sitemap.xmap does NOT have src=.. attribute i won't
 get this piece of code [1] executed:

 if (this.source != null) {
 Object attributesObj = configuration.get(attributes);
 if (attributesObj != null  attributesObj instanceof Map) {
 ...
 }


  In case of the custom example given before:

 map:generate type=some-custom
   ...
  /map:generate

  it does NOT have src attribute (Not every generator got src attribute).
 So the question is still valid, how to get to those map:parameter .../
 values in such case ? Simply by adding useless src= attribute to
 map:generate .. e.g.

  map:generate type=some-custom src=http://www.w3c.org; ?

  or through the use of some Helper class? as it is in [2] (to Request
 Parameters instead of map:parameter name=a
 value=jexl:cocoon.request.a/) with HttpContextHelper - wonder if there
 is any equivalent Helper class for Cocoon Sitemap :)


 Hi,
 [2] injects HTTP request parameters as sitemap parameters: here's why the
 usage of HttpContextHelper.

 Let's suppose you want to implement a generator able to deal with:

 map:generate type=mycustom
   map:parameter name=customParam value=customValue/
 /map:generate

 Then you need to

 1. create class MyCustomGenerator extending AbstractSAXGenerator

 2. implement setup() and setConfiguration() - an example implementation
 could be

 @Override
 public void setConfiguration(final MapString, ? extends Object
 configuration) {
 this.setup((MapString, Object) configuration);
 }

 @Override
 public void setup(final MapString, Object parameters) {
 if (parameters == null) {
 return;
 }

 // do something with parameters.get(customParam)
 }

 3. add a file
 src/main/resources/META-INF/cocoon/spring/my-sitemap-components.xml with
 the following content:

 beans 
 xmlns=http://www.springframework.org/schema/beans;http://www.springframework.org/schema/beans

 xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance;http://www.w3.org/2001/XMLSchema-instance
xsi:schemaLocation=http://www.springframework.org/schema/beans

 http://www.springframework.org/schema/beans/spring-beans.xsd;

   bean name=generator:mycustom class=xx.yyy.MyCustomGenerator
 scope=prototype/

 /beans

 HTH

 Regards.

   [1]
 https://svn.apache.org/repos/asf/cocoon/cocoon3/trunk/cocoon-sax/src/main/java/org/apache/cocoon/sax/component/XSLTTransformer.java
  [2]
 https://svn.apache.org/repos/asf/cocoon/cocoon3/trunk/cocoon-servlet/src/main/java/org/apache/cocoon/servlet/component/RequestParametersGenerator.java

 2013/2/11 Francesco Chicchiriccò ilgro...@apache.org

 On 11/02/2013 12:07, gelo1234 wrote:

 Question 1:
 Can we have some example of this one ?

 map:generate type=some-custom
map:parameter name=a value=1/
map:parameter name=b value=2/
 /map:generate

 I mean, how to get sitemap parameter value from Java Generator code ?
 btw. Request Parameters are obtained by the use of HttpContextHelper, is
 this correct ?


  No: you can access map:parameter elements from within Java code in the
 same way how this is done in the XSLTTransformer [1]: consider that
 source is the only pre-defined parameter you have in any pipeline
 component, mapped to the 'src' XML attribute.


  Question 2:
 What is the best (optimal) way to include XML content generated from
 servlet/controller?

 x:include  src=servlet:/.../

 If the servlet is calling a REST controller there are 2 invocations
 involved (one to gather data, the other one (with e.g. string-template) to
 actually serialize the data). Is there any way that REST controller could
 serialize the data itself ? without invoking another servlet/Page ?


  Not that I know: anyway I am using similar includes in different
 production environments with high load and I've experienced no troubles so
 far.


  Question 3:
 If the generator is included in some transformer phase (via x:include)
 does it still have access to original Request Parameters when invoked
 with:

 x:include ... src=servlet:/generate?par1=apar2=b/

 or they are lost (original request params) and substituted by new ones
 (par1, par2 from the line above)?


  They are lost: you need to explicitly pass them though.

 Regards.

 [1]
 https://svn.apache.org/repos/asf/cocoon/cocoon3/trunk/cocoon-sax/src/main/java/org/apache/cocoon/sax

Re: from Cforms to Wicket

2013-02-18 Thread gelo1234
Why using CForms at all ? If you use XSLT you can transform dynamic XML
data into HTML5 native forms templates.

Greetings,
-Greg


2013/2/18 Mika M Lehtonen m...@digikartta.net

  Yep,
 sounds like a lot of work and like re-inventing the wheel..

 - mika -


 18.2.2013 10:47, Francesco Chicchiriccò kirjoitti:

 On 17/02/2013 20:08, Mika M Lehtonen wrote:

 Hi Francesco,
 let me tell you what I have now.
 I implemented a feedback web application for municipial use with C2.11.
 The app is built so that the administrator can create forms picking fields
 and controls he/she needs. These setting are saved into db. The end-user
 app reads these settings from db, creates XML definition and through XSL
 transforms these settings into valid Cforms definition/template and finally
 creates forms wanted out of this all.

 This is highly dynamic system where we also implemented special data model
 where horizontal tables are converted into vertical direction, that is,
 there is one row per fom field, not a column.

 I was warned about using C2.11 for this, but I wanted to use it anyway
 because I was familiar with it already. Now I would like to get rid of
 C2.11 but I really don't know how. I would like to switch into C3 but that
 is something I am not familiar with.

 I could go with the stream and use AJAX and like jQuery.. still i would
 have the same problem - how to create controls out of XML definition. So
 XML driven form platform is something I would prefer, you see, I would only
 need XSLT.

 I hope I made my needs little clearer.


 Yes, definitely.
 *
 *Basically, you need to dynamically build some web forms from an XML
 definition you get from an external source: let me say that this is a
 perfect suite for C2.1 (and C2.2) with CForms.

 Now, since you want to move away from C2.1 (and not for C2.2 I guess),
 you'd like to have some tools that, parsing the XML form definition
 generates a Wicket form, with all controls full featured.

 While this is perfectly feasible without C3 (I did something similar, even
 though limited, in Apache Syncope), I'd think you could empower the
 integration between C3 and Wicket for this purpose. Only, consider that
 there is nothing implemented yet in this respect, so you would be the first.

 Regards.

 17.2.2013 20:30, Francesco Chicchiriccò kirjoitti:

 On 15/02/2013 22:11, Mika M Lehtonen wrote:

 Hi,
 I have an application using dynamic Cforms (C2.11), that is, the Cforms
 definition and templates are created from dynamic XML through XSL.

 Can this be done with C3 and wickets?
 From somewhere I read about the fact that with Apache Wickets you don't
 need any XML..


 Hi Mika,
 what do you want to achieve exactly?

 Apache Wicket is a component-based framework for developing web
 applications: I know from their project site that the project claims a
 refreshing lack of XML, and I also know that Wicket fully supports form
 processing.

 From the other side, Cocoon 3.0 features Wicket integration (more details
 at [1]) that can help achieving some particular use cases.

 Regards.

 [1]
 http://cocoon.apache.org/3.0/reference/html-single/index.html#wicket-integration

  --
 Francesco Chicchiriccò

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





Re: from Cforms to Wicket

2013-02-18 Thread gelo1234
IMHO, any kind of *Forms* technology is not a viable solution today in the
long term. I wouldn't bet on XForms or any other non-standard/standard
framework/technology as long as you just don't want to play around with it.

The only valid standard today for View part of MVC/MVVP is ... HTML5.

Even Oracle found it right, by introducing HTML5 native tags that are
JSF-compatible (in JSF 2.2), not the JSF-only tags (as in JSF 2.1).

All big players: Oracle, IBM, Microsoft, Adobe have switched their
development
efforts to HTML5.

Greetings,
Greg





2013/2/18 Mika M Lehtonen m...@digikartta.net

 Yeah,
 I know what you mean. Most of the Xforms sites are dated back to 2002 or
 2003.. Sounds like a standard having glorious future behind..

 This betterForm still sounded proper for my purposes because it actually
 implements server-side approache of Xforms. So I could use Xforms
 definition for producing HTML-forms, if I understood right. It actually
 resembles a lot of Cforms with a difference that it seems to be under
 development taking contemporary challenges into account.

 But would I still need C3 (or C2.11 / C2.2)?

 I would like to get familiar with C3 if I only could figure out how to
 start.

 The biggest problem with C2.11, IMHO, was not having proper development
 tools to use. I ended up writing files with Notepad++. And I never realized
 how to do debugging..


 - mika -


 18.2.2013 10:48, Francesco Chicchiriccò kirjoitti:

  On 17/02/2013 21:57, Mika M Lehtonen wrote:

 How about some XForms implementation like this http://www.betterform.de?
 Sounds promising..


 I personally wouldn't bet much on XForms...

 Regards.



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




Re: from Cforms to Wicket

2013-02-18 Thread gelo1234
HTML5 in its basics is a superset of HTML4. If you don't use HTML5-specific
tags/spec you go well with old good HTML4.

The original issue was NOT whether to use HTML5 or old HTML, but whether to
use CForms or just raw XHTML/HTML (4 or 5) forms.

If you like to have HTML5 goodies in browsers that support it, just use
e.g. Cocoon Actions in Sitemap OR Advanced Sitemap Matchers OR in
REST-Controller by inspecting HTTP Headers return different Page that
generate a different Content (with XSLT) for IE8.

Greetings,
-Greg


2013/2/18 Mika M Lehtonen m...@digikartta.net

 Also HTML5 support for IE seems to be weak, even for IE9. There are still
 lot of people using IE8 or even older browser + lot of people in some sort
 of governmental offices using their own versions..
 We can't sell apps without IE-support, absolutely no way.

 http://people.mozilla.com/~**prouget/ie9/http://people.mozilla.com/~prouget/ie9/

 - mika -


 18.2.2013 14:45, Robby Pelssers kirjoitti:

  The only thing I wonder about is...

 Cocoon and neither XSLT2.0 support html5 serialization for all I know.
  So does someone using Cocoon already generate HTML5 content with Cocoon
 and how did you accomplish this.

 Cheers,
 Robby

 -Original Message-
 From: Mika M Lehtonen [mailto:m...@digikartta.net]
 Sent: Monday, February 18, 2013 1:42 PM
 To: users@cocoon.apache.org
 Subject: Re: from Cforms to Wicket

 Ok,
 thanks for your efforts. HTML5 it is, with or without C3.

 - mika -


 18.2.2013 14:25, Francesco Chicchiriccò kirjoitti:

 On 18/02/2013 13:09, Mika M Lehtonen wrote:

 Yeah,
 I know what you mean. Most of the Xforms sites are dated back to 2002
 or 2003.. Sounds like a standard having glorious future behind..

 This betterForm still sounded proper for my purposes because it
 actually implements server-side approache of Xforms. So I could use
 Xforms definition for producing HTML-forms, if I understood right. It
 actually resembles a lot of Cforms with a difference that it seems to
 be under development taking contemporary challenges into account.

 under development with latest release 4.1 dating 1 year back [1]

  But would I still need C3 (or C2.11 / C2.2)?

 It depends on you, and on how much effort do you want to put on this
 task.
 Anyway, not necessarily, even though Cocoon will help in you in the
 XML side if the job.

  I would like to get familiar with C3 if I only could figure out how
 to start.

 The biggest problem with C2.11, IMHO, was not having proper
 development tools to use. I ended up writing files with Notepad++.
 And I never realized how to do debugging..

 [1] 
 http://sourceforge.net/**projects/betterform/files/http://sourceforge.net/projects/betterform/files/

  18.2.2013 10:48, Francesco Chicchiriccò kirjoitti:

 On 17/02/2013 21:57, Mika M Lehtonen wrote:

 How about some XForms implementation like this
 http://www.betterform.de?
 Sounds promising..

 I personally wouldn't bet much on XForms...

 Regards.


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




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



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




Re: sitemap parameter in C3 (was Re: A generator with sitemap parameter in C3)

2013-02-18 Thread gelo1234
So value from any parameter name (not only source is available from
setConfiguration(...) configuration object :)

Thanks for clarifying this!

Greetings,
-Greg


2013/2/18 Thorsten Scherler scher...@gmail.com

 On 02/11/2013 01:55 PM, gelo1234 wrote:
  ...
  So the setup(...) has access to sitemap parameters :) Why not
  setConfiguration(..) ?
 
  Does call:
  this.setup((MapString, Object) configuration)
  strips off?/adds? some unwanted/additional data for sitemap-servlet
  framework ?
 
  As i recall setConfiguration is for Java only (without
  sitemap-servlet) Cocoon use and setup is for standard sitemap-servlet
  ? Is that correct ?
 

 No actually setConfiguration is for passing parameters from the sitemap
 to the component e.g. http://svn.apache.org/r1447255

 The setup() will be called when the pipeline setup is called, I think we
 should drop one since it is highly confusing.

 salu2

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

 http://www.codebusters.es/


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




Re: from Cforms to Wicket

2013-02-18 Thread gelo1234
IMHO if you are dealing with XML data, there are only two valid choices:
XSLT or XQuery.

Both can be used with Cocoon. XSLT is standard Cocoon supported (by
XSLTTransformer),
XQuery support for Cocoon exists in XQueryGenerator from eXistDB (
http://www.exist-db.org)

Whin one to use ? :) I prefer XSLT, but you can choose the other [1]. XSLT
has the best support in Cocoon.
XSLT is much simpler in my opinion and it enables us to generate ANY
Content/Transformation with XML data.
XSLT is pretty well supported in most IDEs, be it Eclipse or NetBeans.

Im not aware of any stack/framework that could be built on top of XSLT (as
a superset?). Actually XSLT is pretty much 4GL [2]. It is declarative in
its form so simple and yet with LEGO-like Cocoon sitemaps approach best
suited for very clean/RAD apps.

I also suggest taking a diversed approach to development with Cocoon. What
I mean by diversed is that you don't necessarily have to stick
to Cocoon tools only. In its 3.0 release Cocoon is considered to be used
across different development environments, even in its simplest form
as a library for e.g. Java EE or Spring application.
Personally I prefer to use it as a mediation proxy with ESB-like features
and use the right tools/frameworks for your job.
For me it means: Java on server, Javascript/HTML on the client.

Using Java on the client side in terms of Web app (as its with Wicket) is
IMHO very bad and ugly idea.
Other indirect uses of Java thats compiled into Javascript (like GWT,
Vaadin, Errai,) is also kind of obscure and heavy-weight.
I dare to claim they will loose its share in future HTML5 development.

Just use the right (and LIGHTWEIGHT ;) tool for your job :)

Greetings,
Greg

[1] www.w3.org/2006/Talks/0525-www2006-Kay.pdf
[2] http://en.wikipedia.org/wiki/Fourth-generation_programming_language



2013/2/18 Mika M Lehtonen m...@digikartta.net

  Yep,
 but as I started this chain, I stated that my problem is to convert my
 own defined dynamic XML into HTML4 (or HTML5) forms. I was looking
 something to replace Cforms (not just plain XSLT). I am also considering to
 move to C3 because as I stated earlier, developing without tools is hard.
 If I could take e.g. NetBeans and continue with that, I would be better off
 in the long run.

 I was considering Apache Wickets because some integration has been done
 with C3, but right now it doesn't seem to be a real option.

 HTML5 is still hype from my point of view.


 - mika -


 18.2.2013 15:50, gelo1234 kirjoitti:

  HTML5 in its basics is a superset of HTML4. If you don't use
 HTML5-specific tags/spec you go well with old good HTML4.

  The original issue was NOT whether to use HTML5 or old HTML, but whether
 to use CForms or just raw XHTML/HTML (4 or 5) forms.

  If you like to have HTML5 goodies in browsers that support it, just use
 e.g. Cocoon Actions in Sitemap OR Advanced Sitemap Matchers OR in
 REST-Controller by inspecting HTTP Headers return different Page that
 generate a different Content (with XSLT) for IE8.

  Greetings,
  -Greg


 2013/2/18 Mika M Lehtonen m...@digikartta.net

 Also HTML5 support for IE seems to be weak, even for IE9. There are still
 lot of people using IE8 or even older browser + lot of people in some sort
 of governmental offices using their own versions..
 We can't sell apps without IE-support, absolutely no way.

 http://people.mozilla.com/~prouget/ie9/

 - mika -


 18.2.2013 14:45, Robby Pelssers kirjoitti:

  The only thing I wonder about is...

 Cocoon and neither XSLT2.0 support html5 serialization for all I know.
  So does someone using Cocoon already generate HTML5 content with Cocoon
 and how did you accomplish this.

 Cheers,
 Robby

 -Original Message-
 From: Mika M Lehtonen [mailto:m...@digikartta.net]
 Sent: Monday, February 18, 2013 1:42 PM
 To: users@cocoon.apache.org
 Subject: Re: from Cforms to Wicket

 Ok,
 thanks for your efforts. HTML5 it is, with or without C3.

 - mika -


 18.2.2013 14:25, Francesco Chicchiriccò kirjoitti:

 On 18/02/2013 13:09, Mika M Lehtonen wrote:

 Yeah,
 I know what you mean. Most of the Xforms sites are dated back to 2002
 or 2003.. Sounds like a standard having glorious future behind..

 This betterForm still sounded proper for my purposes because it
 actually implements server-side approache of Xforms. So I could use
 Xforms definition for producing HTML-forms, if I understood right. It
 actually resembles a lot of Cforms with a difference that it seems to
 be under development taking contemporary challenges into account.

 under development with latest release 4.1 dating 1 year back [1]

  But would I still need C3 (or C2.11 / C2.2)?

 It depends on you, and on how much effort do you want to put on this
 task.
 Anyway, not necessarily, even though Cocoon will help in you in the
 XML side if the job.

  I would like to get familiar with C3 if I only could figure out how
 to start.

 The biggest problem with C2.11, IMHO, was not having proper
 development tools

Re: Cocoon 2.2 WebApp in JBoss 7

2013-03-08 Thread gelo1234
Hi Fawzib,

Looks like you are trying to deploy spectron.war as an OSGi
bundle/application, so you need OSGi-compatible META-INF/MANIFEST
file in every .jar

Greetings,
Greg


2013/3/8 Fawzib Rojas f_ro...@spectron-msim.com

 Anyone tried running a cocoon 2.2 webapp (war) in JBoss 7? I have run a
 simple cocoon 2.2 app (just says Cocoon 2.2 runs!) in Glassfish and Jetty8
 but is giving me an error in JBoss 7.1.1

 10:45:26,737 DEBUG 
 [org.jboss.osgi.framework.**internal.**AbstractFrameworkService]
 (MSC service thread 1-1) Starting: service jbosgi.Framework.ACTIVATOR in
 mode ON_DEMAND

 10:45:26,741 DEBUG [org.jboss.as.osgi] (MSC service thread 1-6) Starting:
 service jboss.osgi.deployment.**spectron.war in mode ACTIVE
 10:45:26,746 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-6)
 MSC1: Failed to start service jboss.osgi.deployment.**spectron.war:
 org.jboss.msc.service.**StartException in service jboss.osgi.deployment.*
 *spectron.war: JBAS011966: Failed to install deployment:
 [:1.0.0,location=spectron.war]
 at 
 org.jboss.as.osgi.deployment.**BundleInstallService.start(**BundleInstallService.java:100)

 at org.jboss.msc.service.**ServiceControllerImpl$**StartTask.startService(
 **ServiceControllerImpl.java:**1811) 
 [jboss-msc-1.0.2.GA.jar:1.0.2.**GAhttp://1.0.2.GA
 ]
 at org.jboss.msc.service.**ServiceControllerImpl$**StartTask.run(**
 ServiceControllerImpl.java:**1746) 
 [jboss-msc-1.0.2.GA.jar:1.0.2.**GAhttp://1.0.2.GA
 ]
 at java.util.concurrent.**ThreadPoolExecutor$Worker.**
 runTask(ThreadPoolExecutor.**java:886) [rt.jar:1.6.0_18]
 at 
 java.util.concurrent.**ThreadPoolExecutor$Worker.run(**ThreadPoolExecutor.java:908)
 [rt.jar:1.6.0_18]at java.lang.Thread.run(Thread.**java:619)
 [rt.jar:1.6.0_18]
 Caused by: java.lang.**IllegalArgumentException: Empty name segment is
 not allowed for 8
 at org.jboss.msc.service.**ServiceName.of(ServiceName.**java:85)
 [jboss-msc-1.0.2.GA.jar:1.0.2.**GA http://1.0.2.GA]
 at org.jboss.osgi.framework.**internal.BundleManager.**
 getServiceNameInternal(**BundleManager.java:245)
 at org.jboss.osgi.framework.**internal.BundleManager.**
 getServiceName(BundleManager.**java:234)
 at org.jboss.osgi.framework.**internal.**HostBundleInstalledService.**
 addService(**HostBundleInstalledService.**java:39)
 at org.jboss.osgi.framework.**internal.BundleManager.**
 installBundle(BundleManager.**java:392)
 at org.jboss.as.osgi.deployment.**BundleInstallService.start(**
 BundleInstallService.java:97)
 ... 5 more

 10:45:26,776 INFO  [org.jboss.as.server] (DeploymentScanner-threads - 2)
 JBAS015870: Deploy of deployment spectron.war was rolled back with
 failure message {JBAS014671: Failed services = {jboss.osgi.deployment.\
 **spectron.war\ = org.jboss.msc.service.**StartException in service
 jboss.osgi.deployment.\**spectron.war\: JBAS011966: Failed to install
 deployment: [:1.0.0,location=spectron.war]**}}

 10:45:26,783 ERROR [org.jboss.as.server.**deployment] (MSC service thread
 1-5) JBAS015892: Deployment unit processor org.jboss.as.jpa.processor.**
 PersistenceProviderProcessor@**43285f7a unexpectedly threw an exception
 during undeploy phase INSTALL of deployment spectron.war:
 java.lang.NullPointerException
 at org.jboss.as.jpa.processor.**PersistenceProviderProcessor.**
 allDeploymentModuleClassLoader**s(**PersistenceProviderProcessor.**
 java:138)
 at org.jboss.as.jpa.processor.**PersistenceProviderProcessor.**undeploy(**
 PersistenceProviderProcessor.**java:122)
 at org.jboss.as.server.**deployment.**DeploymentUnitPhaseService.**
 safeUndeploy(**DeploymentUnitPhaseService.**java:167)
 [jboss-as-server-7.1.1.Final.**jar:7.1.1.Final]
 at org.jboss.as.server.**deployment.**DeploymentUnitPhaseService.**stop(**
 DeploymentUnitPhaseService.**java:161) [jboss-as-server-7.1.1.Final.**
 jar:7.1.1.Final]
 at org.jboss.msc.service.**ServiceControllerImpl$**StopTask.stopService(**
 ServiceControllerImpl.java:**1911) 
 [jboss-msc-1.0.2.GA.jar:1.0.2.**GAhttp://1.0.2.GA
 ]
 at org.jboss.msc.service.**ServiceControllerImpl$**StopTask.run(**
 ServiceControllerImpl.java:**1874) 
 [jboss-msc-1.0.2.GA.jar:1.0.2.**GAhttp://1.0.2.GA
 ]
 at java.util.concurrent.**ThreadPoolExecutor$Worker.**
 runTask(ThreadPoolExecutor.**java:886) [rt.jar:1.6.0_18]
 at 
 java.util.concurrent.**ThreadPoolExecutor$Worker.run(**ThreadPoolExecutor.java:908)
 [rt.jar:1.6.0_18]
 at java.lang.Thread.run(Thread.**java:619) [rt.jar:1.6.0_18]

 10:45:26,862 INFO  [org.jboss.as.server.**deployment] (MSC service thread
 1-1) JBAS015877: Stopped deployment spectron.war in 84ms
 10:45:26,866 INFO  [org.jboss.as.controller] (DeploymentScanner-threads -
 2) JBAS014774: Service status report
 JBAS014777:   Services which failed to start:  service
 jboss.osgi.deployment.**spectron.war: org.jboss.msc.service.**StartException
 in service jboss.osgi.deployment.**spectron.war: JBAS011966: Failed to
 install deployment: [:1.0.0,location=spectron.war]
 10:45:26,874 ERROR 

Re: Cocoon 2.2 WebApp in JBoss 7

2013-03-08 Thread gelo1234
In every jar file :) But I don't think that such procedure will make your
app work. Apparently its not OSGi app :)

It looks to me that your jBoss is starting up in default OSGi mode or is
treating your war file as an OSGi bundle.

You can fix this:
1. either by removing OSGI-specific info in every jar file
(META-INF/MANIFEST.MF) - so jBoss wont recognize them as OSGi bundles
2. or comment out the OSGi subsystem in jBoss if you dont plan to use it at
all:
in jBoss standalone.xml file comment out:

subsystem xmlns=urn:jboss:domain:osgi:1.2 activation=lazy


/subsystem

or remove it and RESTART the jBoss server. Now your war file should be
recognized as a standard JEE war file.

Greetings,
-Greg


2013/3/8 Fawzib Rojas f_ro...@spectron-msim.com

  In every jar in the war archive? I hope not. Maybe another question:

 I'm putting the war in the standalone/deployments directory so it gets
 autodeployed. Is there a way to deploy in Jboss and tell it It is a war,
 not osgi bundle?


 On 3/8/2013 2:29 PM, gelo1234 wrote:

   Hi Fawzib,

 Looks like you are trying to deploy spectron.war as an OSGi
 bundle/application, so you need OSGi-compatible META-INF/MANIFEST
  file in every .jar

  Greetings,
 Greg


 2013/3/8 Fawzib Rojas f_ro...@spectron-msim.com

 Anyone tried running a cocoon 2.2 webapp (war) in JBoss 7? I have run a
 simple cocoon 2.2 app (just says Cocoon 2.2 runs!) in Glassfish and Jetty8
 but is giving me an error in JBoss 7.1.1

 10:45:26,737 DEBUG
 [org.jboss.osgi.framework.internal.AbstractFrameworkService] (MSC service
 thread 1-1) Starting: service jbosgi.Framework.ACTIVATOR in mode ON_DEMAND

 10:45:26,741 DEBUG [org.jboss.as.osgi] (MSC service thread 1-6) Starting:
 service jboss.osgi.deployment.spectron.war in mode ACTIVE
 10:45:26,746 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-6)
 MSC1: Failed to start service jboss.osgi.deployment.spectron.war:
 org.jboss.msc.service.StartException in service
 jboss.osgi.deployment.spectron.war: JBAS011966: Failed to install
 deployment: [:1.0.0,location=spectron.war]
 at
 org.jboss.as.osgi.deployment.BundleInstallService.start(BundleInstallService.java:100)

 at
 org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811)
 [jboss-msc-1.0.2.GA.jar:1.0.2.GA]
 at
 org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746)
 [jboss-msc-1.0.2.GA.jar:1.0.2.GA]
 at
 java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
 [rt.jar:1.6.0_18]
 at
 java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
 [rt.jar:1.6.0_18]at java.lang.Thread.run(Thread.java:619)
 [rt.jar:1.6.0_18]
 Caused by: java.lang.IllegalArgumentException: Empty name segment is not
 allowed for 8
 at org.jboss.msc.service.ServiceName.of(ServiceName.java:85)
 [jboss-msc-1.0.2.GA.jar:1.0.2.GA]
 at
 org.jboss.osgi.framework.internal.BundleManager.getServiceNameInternal(BundleManager.java:245)

 at
 org.jboss.osgi.framework.internal.BundleManager.getServiceName(BundleManager.java:234)

 at
 org.jboss.osgi.framework.internal.HostBundleInstalledService.addService(HostBundleInstalledService.java:39)

 at
 org.jboss.osgi.framework.internal.BundleManager.installBundle(BundleManager.java:392)

 at
 org.jboss.as.osgi.deployment.BundleInstallService.start(BundleInstallService.java:97)
 ... 5 more

 10:45:26,776 INFO  [org.jboss.as.server] (DeploymentScanner-threads - 2)
 JBAS015870: Deploy of deployment spectron.war was rolled back with
 failure message {JBAS014671: Failed services =
 {jboss.osgi.deployment.\spectron.war\ =
 org.jboss.msc.service.StartException in service
 jboss.osgi.deployment.\spectron.war\: JBAS011966: Failed to install
 deployment: [:1.0.0,location=spectron.war]}}

 10:45:26,783 ERROR [org.jboss.as.server.deployment] (MSC service thread
 1-5) JBAS015892: Deployment unit processor
 org.jboss.as.jpa.processor.PersistenceProviderProcessor@43285f7aunexpectedly 
 threw an exception during undeploy phase INSTALL of deployment
 spectron.war: java.lang.NullPointerException
 at
 org.jboss.as.jpa.processor.PersistenceProviderProcessor.allDeploymentModuleClassLoaders(PersistenceProviderProcessor.java:138)
 at
 org.jboss.as.jpa.processor.PersistenceProviderProcessor.undeploy(PersistenceProviderProcessor.java:122)
 at
 org.jboss.as.server.deployment.DeploymentUnitPhaseService.safeUndeploy(DeploymentUnitPhaseService.java:167)
 [jboss-as-server-7.1.1.Final.jar:7.1.1.Final]
 at
 org.jboss.as.server.deployment.DeploymentUnitPhaseService.stop(DeploymentUnitPhaseService.java:161)
 [jboss-as-server-7.1.1.Final.jar:7.1.1.Final]
 at
 org.jboss.msc.service.ServiceControllerImpl$StopTask.stopService(ServiceControllerImpl.java:1911)
 [jboss-msc-1.0.2.GA.jar:1.0.2.GA]
 at
 org.jboss.msc.service.ServiceControllerImpl$StopTask.run(ServiceControllerImpl.java:1874)
 [jboss-msc-1.0.2.GA.jar:1.0.2.GA]
 at
 java.util.concurrent.ThreadPoolExecutor$Worker.runTask

Re: Dom Transformer

2013-03-15 Thread gelo1234
The question is WHY you want to use DOM is still valid.

C (2 or 3) uses SAX or StaX per default and you can use it in a clean way.
I see no reason to use DOM.

Greetings,
-Greg


2013/3/15 Mansour Al Akeel mansour.alak...@gmail.com

 I have tags with id's like:

 some-section-tag id='109876_n00069  

 And those ids are used for links inside the document. They are linked
 from different sections.
 I like to transform the links and the ids to something that makes sense.
 Like,

 xref href=the-section-title-with-dashes-only  My Link Label/xref

 And

 The anchor

 some-section-tag id='the-section-title-with-dashes-only  

 I think this can be done is Stax, xslt or Sax, however, I am trying to
 do it in a clean way without any hacks.

 Do you have any suggestion ??



 On Fri, Mar 15, 2013 at 2:18 PM, gelo1234 gelo1...@gmail.com wrote:
  The question is WHY? you want DOM transformation in Cocoon environment ?
 
  Greetings,
  -Greg
 
 
  2013/3/15 Mansour Al Akeel mansour.alak...@gmail.com
 
  I know this may sound strange, but I like to create a transformation
 with
  DOM.
  I was able to see Stax and Sax transformation. I was not able to see
  one for DOM.
 
  Any advice ?? Examples ??
 
  -
  To unsubscribe, e-mail: users-unsubscr...@cocoon.apache.org
  For additional commands, e-mail: users-h...@cocoon.apache.org
 
 

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




Re: Dom Transformer

2013-03-15 Thread gelo1234
Seems reasonable. Although its a bit awkward idea.

Simplicity is the key ;)

Greetings,
-Greg


2013/3/15 Jos Snellings jos.snelli...@upperware.biz

 Not sure what your usage is, Mansour.

 If your program has to generate references to things that 'yet have to
 come' in the input stream, of course
 you get quickly into thinking 'DOM'-wise.

 - I believe Stax can bring outcome, but no experience with this.
 - I once wrote a 'SAX-recorder', so somefilter that records SAX-elements,
 but do not remember exactly what problem that solved, just that it worked.
 - it is possible to trap SAX-events and feed them into a JDom object.
   (I mean, if nothing else works).

 Cheers,
 Jos










 On Fri, Mar 15, 2013 at 8:01 PM, Mansour Al Akeel 
 mansour.alak...@gmail.com wrote:

 Jos, thank you. I though about this.
 The problem is, the documents I am processing had to go through a
 pipeline processing before I need to use DOM transformation on them.
 So a generator is not an option, and I am using C3.


 On Fri, Mar 15, 2013 at 2:58 PM, Jos Snellings
 jos.snelli...@upperware.biz wrote:
  You can, within a generator class, (C3),
  or within an xsp (C 2).
  Sometimes such things come in handy.
 
  If you mean, configure one from the sitemap, I see no uses.
 
  Cheers,
  Jos
 
 
  On Fri, Mar 15, 2013 at 7:05 PM, Mansour Al Akeel
  mansour.alak...@gmail.com wrote:
 
  I know this may sound strange, but I like to create a transformation
 with
  DOM.
  I was able to see Stax and Sax transformation. I was not able to see
  one for DOM.
 
  Any advice ?? Examples ??
 
  -
  To unsubscribe, e-mail: users-unsubscr...@cocoon.apache.org
  For additional commands, e-mail: users-h...@cocoon.apache.org
 
 
 
 
  --
  All generous minds have a horror of what are commonly called Facts.
 They
  are the brute beasts of the intellectual domain.
  -- Thomas Hobbes

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




 --
 All generous minds have a horror of what are commonly called Facts. They
 are the brute beasts of the intellectual domain.
 -- Thomas Hobbes
  http://www.brainyquote.com/quotes/quotes/t/thomashobb118630.html



Sample sitemap.xmap war

2013-05-09 Thread gelo1234
Trying to making things up with Cocoon 3-beta, I gave up.
Error points to not founding sitemap.xmap inside jar file in lib/ directory.
Trunk sources from 20130507.

Can somebody send here a simple sitemap web app with Cocoon 3-beta
as a war archive
(with WEB-INF/lib/_all_required_libs_for_c3-beta inside war)
ready to be deployed to e.g. Tomcat 7 ?

A simple web app is just reading HTML file from sitemap:

map:sitemap xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance;
xmlns:map=http://apache.org/cocoon/sitemap;
 xmlns:servlet=http://apache.org/cocoon/servlet;
xmlns:controller=http://apache.org/cocoon/controller;

  map:pipelines
!--  map:read ~~~ --
map:pipeline
  map:match pattern=
map:read src=overview.html /
  /map:match
/map:pipeline
   /map:pipelines
/map:sitemap

Greetings,
Greg


Re: Sample sitemap.xmap war

2013-05-10 Thread gelo1234
Many thanks Mansour,

I will take a deep look at it tonight.

Greetings,
Greg


2013/5/10 Mansour Al Akeel mansour.alak...@gmail.com

 This one contains 2 webapps. Did you have a look ??
 https://github.com/ilgrosso/cocoon3EmptyProject/tree/COCOON3-105

 I can not tell what is wrong, without an error message, but in order for
 the the block to deploy properly, the configuration should match the
 running mode. So if your spring configuration are under
 src/main/resources/META-INF/cocoon/spring/dev/

 then you need to let the webapp know that it's running in dev mode.




 On Thu, May 9, 2013 at 6:11 PM, gelo1234 gelo1...@gmail.com wrote:

 Trying to making things up with Cocoon 3-beta, I gave up.
 Error points to not founding sitemap.xmap inside jar file in lib/
 directory.
 Trunk sources from 20130507.

 Can somebody send here a simple sitemap web app with Cocoon 3-beta
 as a war archive
 (with WEB-INF/lib/_all_required_libs_for_c3-beta inside war)
 ready to be deployed to e.g. Tomcat 7 ?

 A simple web app is just reading HTML file from sitemap:

 map:sitemap xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance;
 xmlns:map=http://apache.org/cocoon/sitemap;
  xmlns:servlet=http://apache.org/cocoon/servlet;
 xmlns:controller=http://apache.org/cocoon/controller;

   map:pipelines
 !--  map:read ~~~ --
 map:pipeline
   map:match pattern=
 map:read src=overview.html /
   /map:match
 /map:pipeline
/map:pipelines
 /map:sitemap

 Greetings,
 Greg





Re: Sample sitemap.xmap war

2013-05-10 Thread gelo1234
Yes, I just want a single block (or none?:) with a sitemap.xmap which is
packaged as a war module and can be deployed to Tomcat 7.

sitemap.xmap just reads an XML file and serialize it

Greetings,
-Greg


Re: Sample sitemap.xmap war

2013-05-10 Thread gelo1234
Thanks, that clarifies a bit my scenario.


Greetings,
-Greg


2013/5/10 Francesco Chicchiriccò ilgro...@apache.org

 On 10/05/2013 15:52, gelo1234 wrote:

 Yes, I just want a single block (or none?:) with a sitemap.xmap which is
 packaged as a war module and can be deployed to Tomcat 7.


 With single block, you need the classic multi-module structure (parent +
 block module + webapp module).

 With no blocks you can take the example I've provided in my previous
 e-mail: I am using something similar in several production environments and
 it works like a charm.

 Regards.


 --
 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-19 Thread gelo1234
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 ?
And what param? to use to select hostname of the incoming Request ?

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

In 2.1 there was a HostSelector:
http://cocoon.apache.org/2.1/userdocs/selectors.html
How to code that in C3 ?

Greetings,
Greg



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


 Hi all,

 I wonder if C3 still supports:

 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/

 2. selectors in sitemap.xmap ?

 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 ?

 4. actions in sitemap.xmap ?

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


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


 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). And I would like to have a common
 block accessible from each site.

 Greetings,
 Greg



Re: Cocoon 3.0 components

2013-06-19 Thread gelo1234
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

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

Is any info available about C3 request object ?

-Greg


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

 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 ?
 And what param? to use to select hostname of the incoming Request ?

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

 In 2.1 there was a HostSelector:
 http://cocoon.apache.org/2.1/userdocs/selectors.html
 How to code that in C3 ?

 Greetings,
 Greg



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


 Hi all,

 I wonder if C3 still supports:

 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/

 2. selectors in sitemap.xmap ?

 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 ?

 4. actions in sitemap.xmap ?

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


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


 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). And I would like to have a common
 block accessible from each site.

 Greetings,
 Greg





Re: Sample sitemap.xmap war

2013-06-19 Thread gelo1234
Thanks Francesco. It works perfectly! The only thing i had to add is cocoon
snapshot repository to pom.xml.

Now I wonder how (without blocks) I should use subsequent URI paths

like:
http://localhost:/mywebapp-1.0-SNAPSHOT/test1/1.xml
http://localhost:/mywebapp-1.0-SNAPSHOT/test1/test2/1.xml
http://localhost:/mywebapp-1.0-SNAPSHOT/test1/test2/test3/1.xml

I would like to have a separate sitemap.xmap for each /test1, /test1/test2
and /test1/test2/test3 context ?
Is it possible WITHOUT blocks ?

In old Cocoon there was map:mount ... but in C3 it seems like its missing.

Greetings,
Greg



2013/5/11 Francesco Chicchiriccò ilgro...@apache.org

  Il 10/05/2013 19:18, gelo1234 ha scritto:

   I have followed the servlet-service config you mentioned but still no
 luck. I attach my war file here.
  Deployed to Tomcat 7 from web app module + c3 libs added to WEB-INF/lib
 and it does NOT work.

 Can you point where the error is ?

  Accessing: http://localhost:8080/mywebapp-1.0-SNAPSHOT/test.xml
  gives me XML error :(


 The WAR file attached is missing *a lot* of dependencies.

 I have added a branch to my empty C3 project on github [1]: see
 instructions there about how to build and run; you can, of course, deploy
 it to an external Tomcat 7 container.

 HTH
 Regards.

 [1] https://github.com/ilgrosso/cocoon3EmptyProject/tree/SINGLE_WAR

   2013/5/10 gelo1234 gelo1...@gmail.com

  Thanks, that clarifies a bit my scenario.

 2013/5/10 Francesco Chicchiriccò ilgro...@apache.org

 On 10/05/2013 15:52, gelo1234 wrote:

 Yes, I just want a single block (or none?:) with a sitemap.xmap which
 is packaged as a war module and can be deployed to Tomcat 7.


  With single block, you need the classic multi-module structure (parent
 + block module + webapp module).

 With no blocks you can take the example I've provided in my previous
 e-mail: I am using something similar in several production environments and
 it works like a charm.

 Regards.

 --
 Francesco Chicchiriccò

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




Re: Sample sitemap.xmap war

2013-06-19 Thread gelo1234
Nevermind my question. I digged a bit with code and found out It IS
possible. It just requires defining new bean in Spring.
Actually the bean name doesn't matter:

bean name=test1 class=org.apache.cocoon.servlet.XMLSitemapServlet
servlet:context mount-path=/test1
context-path=classpath:/classes/COB-INF/test1/
  /bean

  bean name=test2 class=org.apache.cocoon.servlet.XMLSitemapServlet
servlet:context mount-path=/test1/test2
context-path=classpath:/classes/COB-INF/test2/
  /bean

Greetings,
Greg


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

 Thanks Francesco. It works perfectly! The only thing i had to add is
 cocoon snapshot repository to pom.xml.

 Now I wonder how (without blocks) I should use subsequent URI paths

 like:
 http://localhost:/mywebapp-1.0-SNAPSHOT/test1/1.xml
 http://localhost:/mywebapp-1.0-SNAPSHOT/test1/test2/1.xml
 http://localhost:/mywebapp-1.0-SNAPSHOT/test1/test2/test3/1.xml

 I would like to have a separate sitemap.xmap for each /test1, /test1/test2
 and /test1/test2/test3 context ?
 Is it possible WITHOUT blocks ?

 In old Cocoon there was map:mount ... but in C3 it seems like its
 missing.

 Greetings,
 Greg



 2013/5/11 Francesco Chicchiriccò ilgro...@apache.org

  Il 10/05/2013 19:18, gelo1234 ha scritto:

   I have followed the servlet-service config you mentioned but still no
 luck. I attach my war file here.
  Deployed to Tomcat 7 from web app module + c3 libs added to WEB-INF/lib
 and it does NOT work.

 Can you point where the error is ?

  Accessing: http://localhost:8080/mywebapp-1.0-SNAPSHOT/test.xml
  gives me XML error :(


 The WAR file attached is missing *a lot* of dependencies.

 I have added a branch to my empty C3 project on github [1]: see
 instructions there about how to build and run; you can, of course, deploy
 it to an external Tomcat 7 container.

 HTH
 Regards.

 [1] https://github.com/ilgrosso/cocoon3EmptyProject/tree/SINGLE_WAR

   2013/5/10 gelo1234 gelo1...@gmail.com

  Thanks, that clarifies a bit my scenario.

 2013/5/10 Francesco Chicchiriccò ilgro...@apache.org

 On 10/05/2013 15:52, gelo1234 wrote:

 Yes, I just want a single block (or none?:) with a sitemap.xmap which
 is packaged as a war module and can be deployed to Tomcat 7.


  With single block, you need the classic multi-module structure (parent
 + block module + webapp module).

 With no blocks you can take the example I've provided in my previous
 e-mail: I am using something similar in several production environments and
 it works like a charm.

 Regards.

 --
 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 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 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 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 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
 org.apache.cocoon.sax.component.XSLTTransformer.setConfiguration

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 class

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




Re: XSLT import/include errors

2013-06-21 Thread gelo1234
OK, one more question. Is it possible with Saxon/Xalan in C3 to invoke
external Java function ?
I can't get it working:

xsl:stylesheet xmlns:xsl=http://www.w3.org/1999/XSL/Transform;
version=1.0
xmlns:utils=java:org.example.Utils
exclude-result-prefixes=utils

xsl:template match=Page

 xsl:variable name=fileName select=file/

 Root
   xsl:value-of select=utils:exists($fileName)/
 /Root
/xsl:template

/xsl:stylesheet

Tried Xalan, tried Saxon. Both generates some strange errors with XML
Document.

Greetings,
Greg


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

 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 gelo1...@gmail.com


 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-21 Thread gelo1234
Thanks for the tip. Unfortunately it doesn't work with:
Saxon-HE-9.5.0.2.jar :(

Greetings,
Greg


2013/6/21 Robby Pelssers robby.pelss...@the-future-group.com

  That is possible but the how-to part depends on the Saxon version you
 are using.  You will need to dive into how to write extension functions for
 that particular implementation.

  I used it a number of times with Saxon 8.7


 http://robbypelssers.blogspot.nl/2012/10/creating-unix-timestamp-with-xslt20.html


 http://robbypelssers.blogspot.nl/2011/09/power-of-apache-cocoon-xquery-and-xslt.html

  But i never tried with the latest version of Saxon which works
 differently.

  Robby
  --
 *Van:* gelo1234 [gelo1...@gmail.com]
 *Verzonden:* vrijdag 21 juni 2013 15:23
 *To:* Cocoon Users
 *Onderwerp:* Re: XSLT import/include errors

  OK, one more question. Is it possible with Saxon/Xalan in C3 to
 invoke external Java function ?
 I can't get it working:

 xsl:stylesheet xmlns:xsl=http://www.w3.org/1999/XSL/Transform;
 version=1.0
 xmlns:utils=java:org.example.Utils
 exclude-result-prefixes=utils

  xsl:template match=Page

   xsl:variable name=fileName select=file/

   Root
 xsl:value-of
 select=utils:exists($fileName)/
   /Root
  /xsl:template

  /xsl:stylesheet

  Tried Xalan, tried Saxon. Both generates some strange errors with XML
 Document.

  Greetings,
 Greg


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

  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 gelo1...@gmail.com


 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





  *The Future Group, dé maat in ondernemen*


   [image: The Future Group] http://www.the-future-group.com [image: The
 Future Group kantoor]   Röntgenlaan 27 | 2719 DX Zoetermeer [image:
 Mobiel nummer] 06 15879926  [image: Web-site]
 http://www.the-future-group.com [image: E-mail adres]
 robby.pelss...@the-future-group.com  [image: Telefoonnummer]   +31 (0)79
 - 363 2905 [image: LinkedIn account]   [image: Twitteraccount]
 http://twitter.com/futuregroup



Re: XSLT import/include errors

2013-06-21 Thread gelo1234
Looks like Saxon-HE doesn't support anymore calling Java functions that way:

http://saxon-xslt-and-xquery-processor.13853.n7.nabble.com/XSLT-2-0-Saxon-9-HE-and-call-java-functions-td4347.html

But there are available in PE and EE versions, huh

Greetings,
Greg



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

 Thanks for the tip. Unfortunately it doesn't work with:
 Saxon-HE-9.5.0.2.jar :(

 Greetings,
 Greg


 2013/6/21 Robby Pelssers robby.pelss...@the-future-group.com

  That is possible but the how-to part depends on the Saxon version you
 are using.  You will need to dive into how to write extension functions for
 that particular implementation.

  I used it a number of times with Saxon 8.7


 http://robbypelssers.blogspot.nl/2012/10/creating-unix-timestamp-with-xslt20.html


 http://robbypelssers.blogspot.nl/2011/09/power-of-apache-cocoon-xquery-and-xslt.html

  But i never tried with the latest version of Saxon which works
 differently.

  Robby
  --
 *Van:* gelo1234 [gelo1...@gmail.com]
 *Verzonden:* vrijdag 21 juni 2013 15:23
 *To:* Cocoon Users
 *Onderwerp:* Re: XSLT import/include errors

  OK, one more question. Is it possible with Saxon/Xalan in C3 to
 invoke external Java function ?
 I can't get it working:

 xsl:stylesheet xmlns:xsl=http://www.w3.org/1999/XSL/Transform;
 version=1.0
 xmlns:utils=java:org.example.Utils
 exclude-result-prefixes=utils

  xsl:template match=Page

   xsl:variable name=fileName select=file/

   Root
 xsl:value-of
 select=utils:exists($fileName)/
   /Root
  /xsl:template

  /xsl:stylesheet

  Tried Xalan, tried Saxon. Both generates some strange errors with XML
 Document.

  Greetings,
 Greg


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

  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 gelo1...@gmail.com


 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





  *The Future Group, dé maat in ondernemen*


   [image: The Future Group] http://www.the-future-group.com [image:
 The Future Group kantoor]   Röntgenlaan 27 | 2719 DX Zoetermeer [image:
 Mobiel nummer] 06 15879926  [image: Web-site]
 http://www.the-future-group.com [image: E-mail adres]
 robby.pelss...@the-future-group.com  [image: Telefoonnummer]   +31 (0)79
 - 363 2905 [image: LinkedIn account]   [image: Twitteraccount]
 http://twitter.com/futuregroup





Re: XSLT import/include errors

2013-06-21 Thread gelo1234
Solution: If you want to call Java functions freely from C3 XSLT, use older
Saxon implementation.
Version 9.1 works perfectly!

Greetings,
Greg


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

 Looks like Saxon-HE doesn't support anymore calling Java functions that
 way:


 http://saxon-xslt-and-xquery-processor.13853.n7.nabble.com/XSLT-2-0-Saxon-9-HE-and-call-java-functions-td4347.html

 But there are available in PE and EE versions, huh

 Greetings,
 Greg



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

 Thanks for the tip. Unfortunately it doesn't work with:
 Saxon-HE-9.5.0.2.jar :(

 Greetings,
 Greg


 2013/6/21 Robby Pelssers robby.pelss...@the-future-group.com

  That is possible but the how-to part depends on the Saxon version you
 are using.  You will need to dive into how to write extension functions for
 that particular implementation.

  I used it a number of times with Saxon 8.7


 http://robbypelssers.blogspot.nl/2012/10/creating-unix-timestamp-with-xslt20.html


 http://robbypelssers.blogspot.nl/2011/09/power-of-apache-cocoon-xquery-and-xslt.html

  But i never tried with the latest version of Saxon which works
 differently.

  Robby
  --
 *Van:* gelo1234 [gelo1...@gmail.com]
 *Verzonden:* vrijdag 21 juni 2013 15:23
 *To:* Cocoon Users
 *Onderwerp:* Re: XSLT import/include errors

  OK, one more question. Is it possible with Saxon/Xalan in C3 to
 invoke external Java function ?
 I can't get it working:

 xsl:stylesheet xmlns:xsl=http://www.w3.org/1999/XSL/Transform;
 version=1.0
 xmlns:utils=java:org.example.Utils
 exclude-result-prefixes=utils

  xsl:template match=Page

   xsl:variable name=fileName select=file/

   Root
 xsl:value-of
 select=utils:exists($fileName)/
   /Root
  /xsl:template

  /xsl:stylesheet

  Tried Xalan, tried Saxon. Both generates some strange errors with XML
 Document.

  Greetings,
 Greg


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

  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 gelo1...@gmail.com


 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





  *The Future Group, dé maat in ondernemen*


   [image: The Future Group] http://www.the-future-group.com [image:
 The Future Group kantoor]   Röntgenlaan 27 | 2719 DX Zoetermeer [image:
 Mobiel nummer] 06 15879926  [image: Web-site]
 http://www.the-future-group.com [image: E-mail adres]
 robby.pelss...@the-future-group.com  [image: Telefoonnummer]   +31
 (0)79 - 363 2905 [image: LinkedIn account]   [image: Twitteraccount]
 http://twitter.com/futuregroup






Re: XSLT import/include errors

2013-06-22 Thread gelo1234
Now when everything is up and working fine, the really ennoying part of C3
is caching imported/included XSL files.

Is there any way to invalidate that cache ? Or to turn if off ?

I wouldn't like to restart the application server every time I make a small
change inside imported/included XSL file :(

Greetings,
Greg


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

 Solution: If you want to call Java functions freely from C3 XSLT, use
 older Saxon implementation.
 Version 9.1 works perfectly!

 Greetings,
 Greg


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

 Looks like Saxon-HE doesn't support anymore calling Java functions that
 way:


 http://saxon-xslt-and-xquery-processor.13853.n7.nabble.com/XSLT-2-0-Saxon-9-HE-and-call-java-functions-td4347.html

 But there are available in PE and EE versions, huh

 Greetings,
 Greg



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

 Thanks for the tip. Unfortunately it doesn't work with:
 Saxon-HE-9.5.0.2.jar :(

 Greetings,
 Greg


 2013/6/21 Robby Pelssers robby.pelss...@the-future-group.com

  That is possible but the how-to part depends on the Saxon version you
 are using.  You will need to dive into how to write extension functions for
 that particular implementation.

  I used it a number of times with Saxon 8.7


 http://robbypelssers.blogspot.nl/2012/10/creating-unix-timestamp-with-xslt20.html


 http://robbypelssers.blogspot.nl/2011/09/power-of-apache-cocoon-xquery-and-xslt.html

  But i never tried with the latest version of Saxon which works
 differently.

  Robby
  --
 *Van:* gelo1234 [gelo1...@gmail.com]
 *Verzonden:* vrijdag 21 juni 2013 15:23
 *To:* Cocoon Users
 *Onderwerp:* Re: XSLT import/include errors

  OK, one more question. Is it possible with Saxon/Xalan in C3 to
 invoke external Java function ?
 I can't get it working:

 xsl:stylesheet xmlns:xsl=http://www.w3.org/1999/XSL/Transform;
 version=1.0
 xmlns:utils=java:org.example.Utils
 exclude-result-prefixes=utils

  xsl:template match=Page

   xsl:variable name=fileName select=file/

   Root
 xsl:value-of
 select=utils:exists($fileName)/
   /Root
  /xsl:template

  /xsl:stylesheet

  Tried Xalan, tried Saxon. Both generates some strange errors with XML
 Document.

  Greetings,
 Greg


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

  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 gelo1...@gmail.com


 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





  *The Future Group, dé maat in ondernemen*


   [image: The Future Group] http://www.the-future-group.com [image:
 The Future Group kantoor]   Röntgenlaan 27 | 2719 DX Zoetermeer [image:
 Mobiel nummer] 06 15879926  [image: Web-site]
 http://www.the-future-group.com [image: E-mail adres]
 robby.pelss...@the-future-group.com  [image: Telefoonnummer]   +31
 (0)79 - 363 2905 [image: LinkedIn account]   [image: Twitteraccount]
 http://twitter.com/futuregroup







Re: XSLT import/include errors

2013-06-22 Thread gelo1234
The same problem appears with Saxon (any version).

I think its rather C3 issue not XSLT engine.

Greetings,
Greg



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

 Hi Greg,

 Did you tried yourself with Saxon? I had caching issues with Xalan but
 never tried with Saxon before.

 Salu2.
 El 22/06/2013 10:34, gelo1234 gelo1...@gmail.com escribió:

 Now when everything is up and working fine, the really ennoying part of C3
 is caching imported/included XSL files.

 Is there any way to invalidate that cache ? Or to turn if off ?

 I wouldn't like to restart the application server every time I make a
 small change inside imported/included XSL file :(

 Greetings,
 Greg


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

 Solution: If you want to call Java functions freely from C3 XSLT, use
 older Saxon implementation.
 Version 9.1 works perfectly!

 Greetings,
 Greg


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

 Looks like Saxon-HE doesn't support anymore calling Java functions that
 way:


 http://saxon-xslt-and-xquery-processor.13853.n7.nabble.com/XSLT-2-0-Saxon-9-HE-and-call-java-functions-td4347.html

 But there are available in PE and EE versions, huh

 Greetings,
 Greg



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

 Thanks for the tip. Unfortunately it doesn't work with:
 Saxon-HE-9.5.0.2.jar :(

 Greetings,
 Greg


 2013/6/21 Robby Pelssers robby.pelss...@the-future-group.com

  That is possible but the how-to part depends on the Saxon version
 you are using.  You will need to dive into how to write extension 
 functions
 for that particular implementation.

  I used it a number of times with Saxon 8.7


 http://robbypelssers.blogspot.nl/2012/10/creating-unix-timestamp-with-xslt20.html


 http://robbypelssers.blogspot.nl/2011/09/power-of-apache-cocoon-xquery-and-xslt.html

  But i never tried with the latest version of Saxon which works
 differently.

  Robby
  --
 *Van:* gelo1234 [gelo1...@gmail.com]
 *Verzonden:* vrijdag 21 juni 2013 15:23
 *To:* Cocoon Users
 *Onderwerp:* Re: XSLT import/include errors

  OK, one more question. Is it possible with Saxon/Xalan in C3 to
 invoke external Java function ?
 I can't get it working:

 xsl:stylesheet xmlns:xsl=http://www.w3.org/1999/XSL/Transform;
 version=1.0
 xmlns:utils=java:org.example.Utils
 exclude-result-prefixes=utils

  xsl:template match=Page

   xsl:variable name=fileName select=file/

   Root
 xsl:value-of
 select=utils:exists($fileName)/
   /Root
  /xsl:template

  /xsl:stylesheet

  Tried Xalan, tried Saxon. Both generates some strange errors with
 XML Document.

  Greetings,
 Greg


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

  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 gelo1...@gmail.com


 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





  *The Future Group, dé maat in ondernemen*


   [image: The Future Group] http://www.the-future-group.com [image:
 The Future Group kantoor]   Röntgenlaan 27 | 2719 DX Zoetermeer [image:
 Mobiel nummer] 06 15879926  [image: Web-site]
 http://www.the-future-group.com [image: E-mail adres]
 robby.pelss...@the-future-group.com  [image: Telefoonnummer]   +31
 (0)79 - 363 2905 [image: LinkedIn account]   [image: Twitteraccount]
   http://twitter.com/futuregroup








Re: XSLT import/include errors

2013-06-22 Thread gelo1234
And of course I'm using noncaching pipeline :)

When I make a change in the main XSL file (that from sitemap), the change
is visible.
When I make a change in any of the imported/included (from main XSL) XSL
file, the change is not visible. Cocoon serves
the Content from cache.

Greetings,
Greg


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

 The same problem appears with Saxon (any version).

 I think its rather C3 issue not XSLT engine.

 Greetings,
 Greg



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

 Hi Greg,

 Did you tried yourself with Saxon? I had caching issues with Xalan but
 never tried with Saxon before.

 Salu2.
 El 22/06/2013 10:34, gelo1234 gelo1...@gmail.com escribió:

 Now when everything is up and working fine, the really ennoying part of
 C3 is caching imported/included XSL files.

 Is there any way to invalidate that cache ? Or to turn if off ?

 I wouldn't like to restart the application server every time I make a
 small change inside imported/included XSL file :(

 Greetings,
 Greg


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

 Solution: If you want to call Java functions freely from C3 XSLT, use
 older Saxon implementation.
 Version 9.1 works perfectly!

 Greetings,
 Greg


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

 Looks like Saxon-HE doesn't support anymore calling Java functions
 that way:


 http://saxon-xslt-and-xquery-processor.13853.n7.nabble.com/XSLT-2-0-Saxon-9-HE-and-call-java-functions-td4347.html

 But there are available in PE and EE versions, huh

 Greetings,
 Greg



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

 Thanks for the tip. Unfortunately it doesn't work with:
 Saxon-HE-9.5.0.2.jar :(

 Greetings,
 Greg


 2013/6/21 Robby Pelssers robby.pelss...@the-future-group.com

  That is possible but the how-to part depends on the Saxon version
 you are using.  You will need to dive into how to write extension 
 functions
 for that particular implementation.

  I used it a number of times with Saxon 8.7


 http://robbypelssers.blogspot.nl/2012/10/creating-unix-timestamp-with-xslt20.html


 http://robbypelssers.blogspot.nl/2011/09/power-of-apache-cocoon-xquery-and-xslt.html

  But i never tried with the latest version of Saxon which works
 differently.

  Robby
  --
 *Van:* gelo1234 [gelo1...@gmail.com]
 *Verzonden:* vrijdag 21 juni 2013 15:23
 *To:* Cocoon Users
 *Onderwerp:* Re: XSLT import/include errors

  OK, one more question. Is it possible with Saxon/Xalan in C3
 to invoke external Java function ?
 I can't get it working:

 xsl:stylesheet xmlns:xsl=http://www.w3.org/1999/XSL/Transform;
 version=1.0
 xmlns:utils=java:org.example.Utils
 exclude-result-prefixes=utils

  xsl:template match=Page

   xsl:variable name=fileName select=file/

   Root
 xsl:value-of
 select=utils:exists($fileName)/
   /Root
  /xsl:template

  /xsl:stylesheet

  Tried Xalan, tried Saxon. Both generates some strange errors with
 XML Document.

  Greetings,
 Greg


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

  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 gelo1...@gmail.com


 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





  *The Future Group, dé maat in ondernemen*


   [image: The Future Group] http://www.the-future-group.com [image:
 The Future Group kantoor]   Röntgenlaan 27 | 2719 DX Zoetermeer [image:
 Mobiel nummer] 06 15879926  [image: Web-site]
 http://www.the-future-group.com [image: E-mail adres]
 robby.pelss...@the-future-group.com  [image: Telefoonnummer]   +31
 (0)79 - 363 2905 [image: LinkedIn account]   [image: Twitteraccount]
   http://twitter.com/futuregroup









Re: CForms validation in Cocoon-2.1.12

2013-12-04 Thread gelo1234
Hello Barbara,

My pure guess: the problem might be with different Dojo version. Did you
check that there is exactly the same Dojo Toolkit between 2.1.11 and 2.1.12
?
When this is not the case, the next possible cause of error might be
generating unnecessary ?xml ... version=... header within your XML data
(in Ajax request?)


Greetings,
Greg




2013/12/4 Barbara Slupik barbara_slu...@wro.vectranet.pl

 Hello

 I am trying to upgrade from Cocoon-2.1.11 to Cocoon 2.1.12.

 I have a problem with CForms validation - the ! error icon
 validation-message.gif is not displayed. Dojo debug message is:

 DEBUG: dojo.widget.Parse: error: [Exception... Node cannot be inserted at
 the specified point in the hierarchy code: 3 nsresult: 0x80530003
 (NS_ERROR_DOM_HIERARCHY_REQUEST_ERR) location: 
 http://172.16.1.5/branch/_cocoon/resources/dojo/dojo.js Line: 173]

 My form definition:
 fd:field ...
   fd:validation
 fd:javascript
   if (my condition) {
 widget.setValidationError(new Packages.org.apache.cocoon.
 forms.validation.ValidationError(my error message,[],[true]));
 return false;
   }
   return true;
 /fd:javascript
   /fd:validation
 /fd:field

 My sitemap:
   map:transformers default=xsltc.../map:transformers

   map:match pattern=*-display
 map:generate type=jx src=forms/{1}_tmpl.xml
   map:parameter name=locale value={session-attr:locale}/
 /map:generate
 map:transform type=browser-update/
 map:transform type=i18nmap:parameter name=locale
 value={session-attr:locale}//map:transform
 map:transform type=xslt src=stylesheets/forms-styling.xsl
   map:parameter name=resources-uri
 value={request:contextPath}/_cocoon/resources/
   map:parameter name=dojo-locale value={session-attr:locale}/
 
   map:parameter name=dojo-debug value=true/
 /map:transform
 map:select type=ajax-request
   map:when test=true
 map:serialize type=xml/
   /map:when
   map:otherwise
 ...
 map:serialize type=html/
   /map:otherwise
 /map:select
   /map:match

 The same thing works in Cocoon-2.1.11. Changing default transformer to
 xslt does not make any difference.

 Does anyone know what is wrong with it and how to fix it?

 Thanks

 Barbara


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




cocoon-xml-2.0.4

2014-01-16 Thread gelo1234
Hello,

I wonder how to classify C3-beta dependency: cocoon-xml ?
Which project does that dependency belong to ?

As I got it right, it is NOT part of Cocoon 3.0-beta package ? Is it just a
separate jar file from Apache Maven repo ? Or a part or separate project
like Apache Commons ?

cocoon-sax (which is part of C3-beta) depends on cocoon-xml

Greetings,
Greg


Re: cocoon-xml-2.0.4

2014-01-16 Thread gelo1234
Hi Salu2,

Thanks for clarifying this.

Now I got interested in cocoon-osgi, but it seems like rather old stuff
(and uses old spring release).
Any plans to reactivate this subproject ? It would be awesome to see cocoon
integrated with
e.g. Karaf with Blueprint config.

Greetings,
Greg


2014/1/16 Javier Puerto jpue...@gmail.com

 Hi Greg,


 2014/1/16 gelo1234 gelo1...@gmail.com


 Hello,

 I wonder how to classify C3-beta dependency: cocoon-xml ?
 Which project does that dependency belong to ?


 It's part of Apache Cocoon subprojets.

 http://svn.apache.org/repos/asf/cocoon/subprojects/
 http://cocoon.apache.org/subprojects/



 As I got it right, it is NOT part of Cocoon 3.0-beta package ? Is it just
 a separate jar file from Apache Maven repo ? Or a part or separate project
 like Apache Commons ?


 It's part of Cocoon as libraries and are used by different releases like
 version 2.2.x. For maven you can use Apache repository.

 https://repository.apache.org/index.html#view-repositories




 cocoon-sax (which is part of C3-beta) depends on cocoon-xml

 Greetings,
 Greg


 Salu2.




Re: [C3] Can i18n transformer use an internal pipeline as bundle?

2014-01-17 Thread gelo1234
Hello Alberto,

Have you defined

map:match pattern=translations_*.properties

with:
map:generate type=service-consumer/ ?

Otherwise:
map:parameter name=bundle

value=servlet:/translations_{jexl:cocoon.request.lang}.properties /

will not work as expected.

Take a look at C3 samples sitemap.xmap [1] which shows correct definition
of service consumer.

Greetings,
Greg

[1]
http://svn.apache.org/repos/asf/cocoon/cocoon3/trunk/cocoon-sample/src/main/resources/COB-INF/sitemap.xmap


2014/1/17 Alberto Brosich abros...@ogs.trieste.it


 Hi,

 I'm migrating a 2.1 cocoon application to 3.0, using beta1-SNAPSHOT
 because I need the sql transformer.
 As I wrote in the subject, I'm need to specify an internal pipeline as
 bundle for the i18n transformer, because the properties file has to be
 derived from database. Using a plain file it works.
 I tried several urls using servlet: protocol, but without success.

 I have the following internal pipeline:
 map:match pattern=translations_*.properties

 and I tried several bundles urls like:
 map:parameter name=bundle value=servlet:/translations /
 or
 map:parameter name=bundle
 value=servlet:/translations_{jexl:cocoon.request.lang}.properties /

 The exception is:
 org.apache.cocoon.pipeline.SetupException:
 java.util.MissingResourceException: Can't find bundle for base name
 servlet:/translations, locale en

 What I doing wrong?

 Best regards

 Alberto


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




Re: [C3] Can i18n transformer use an internal pipeline as bundle?

2014-01-17 Thread gelo1234
Hello Alberto,

One more thing is that any map:transform or map:serialize must have:
type=servlet-service with servlet:/ protocol.

Greetings,
Greg


2014/1/17 gelo1234 gelo1...@gmail.com

 Hello Alberto,

 Have you defined

 map:match pattern=translations_*.properties

 with:
 map:generate type=service-consumer/ ?

 Otherwise:

 map:parameter name=bundle

 value=servlet:/translations_{jexl:cocoon.request.lang}.properties /

 will not work as expected.

 Take a look at C3 samples sitemap.xmap [1] which shows correct definition
 of service consumer.

 Greetings,
 Greg

 [1]
 http://svn.apache.org/repos/asf/cocoon/cocoon3/trunk/cocoon-sample/src/main/resources/COB-INF/sitemap.xmap


 2014/1/17 Alberto Brosich abros...@ogs.trieste.it


 Hi,

 I'm migrating a 2.1 cocoon application to 3.0, using beta1-SNAPSHOT
 because I need the sql transformer.
 As I wrote in the subject, I'm need to specify an internal pipeline as
 bundle for the i18n transformer, because the properties file has to be
 derived from database. Using a plain file it works.
 I tried several urls using servlet: protocol, but without success.

 I have the following internal pipeline:
 map:match pattern=translations_*.properties

 and I tried several bundles urls like:
 map:parameter name=bundle value=servlet:/translations /
 or
 map:parameter name=bundle
 value=servlet:/translations_{jexl:cocoon.request.lang}.properties /

 The exception is:
 org.apache.cocoon.pipeline.SetupException:
 java.util.MissingResourceException: Can't find bundle for base name
 servlet:/translations, locale en

 What I doing wrong?

 Best regards

 Alberto


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





Re: cocoon-xml-2.0.4

2014-01-17 Thread gelo1234
Thank you Javier :)

That is getting even more interesting to me. I mean osgi-compliance of
cocoon :) I will take a look at this port.

Greetings,
Greg

PS:
Do you use (english?) Xavier name too ?
I used to write my nick Gelo in mails, but afaik gelo means ice in
portuguese while im rather hot ;)





2014/1/17 Javier Puerto jpue...@gmail.com




 2014/1/16 gelo1234 gelo1...@gmail.com

 Hi Salu2,

 Thanks for clarifying this.

 Now I got interested in cocoon-osgi, but it seems like rather old stuff
 (and uses old spring release).
 Any plans to reactivate this subproject ? It would be awesome to see
 cocoon integrated with
 e.g. Karaf with Blueprint config.


 That should be great but unfortunately I don't know the status about osgi
 support. I don't know about osgi so I can't contribute about but I can help
 with the Apache Cocoon side :-). I remember that some Cocoon members talked
 about in the past ApacheCon 2012 in Sinsheim about integrate it with osgi.
 Maybe someone wants to contribute.

 There's an issue open in the Jira system with a patch, you could give it a
 try.

 https://issues.apache.org/jira/browse/COCOON3-87

 Regards (Salu2)

 PD: Salu2 is a Spanish phonetic word that means regards but it's
 written like l8ter. The original word is Saludos. ;-)


 Greetings,
 Greg


 2014/1/16 Javier Puerto jpue...@gmail.com

 Hi Greg,


 2014/1/16 gelo1234 gelo1...@gmail.com


 Hello,

 I wonder how to classify C3-beta dependency: cocoon-xml ?
 Which project does that dependency belong to ?


 It's part of Apache Cocoon subprojets.

 http://svn.apache.org/repos/asf/cocoon/subprojects/
 http://cocoon.apache.org/subprojects/



 As I got it right, it is NOT part of Cocoon 3.0-beta package ? Is it
 just a separate jar file from Apache Maven repo ? Or a part or separate
 project like Apache Commons ?


 It's part of Cocoon as libraries and are used by different releases like
 version 2.2.x. For maven you can use Apache repository.

 https://repository.apache.org/index.html#view-repositories




 cocoon-sax (which is part of C3-beta) depends on cocoon-xml

 Greetings,
 Greg


 Salu2.






Re: [C3] Can i18n transformer use an internal pipeline as bundle?

2014-01-17 Thread gelo1234
Hi Alberto,

Yes, servlet-service is used if acting as a transformer or a serializer. If
you use generator, there is no need to specify servlet-service.

I used servlet:/ protocol in many generator cases and from within
XIncludeTransformer (x:xinclude) but not as a map:parameter so far.

Greetings,
Greg


2014/1/17 Alberto Brosich abros...@ogs.trieste.it


 Hi Greg,

 I already took a look to the sample sitemap and I found the following
 example:

  map:match pattern=internal-only/simple-xml
 map:generate src=sax-pipeline/simple.xml /
 map:transform src=sax-pipeline/simple.xslt
   map:parameter name=myParam
 value=3-{jexl:cocoon.request.ssf} /
 /map:transform
 map:serialize type=xml /
   /map:match

   map:match pattern=ssf/local-internal-only
 map:generate src=servlet:/internal-only/simple-xml /
 map:serialize type=xml /
   /map:match

 Second match uses servlet: protocol. The internal-only/simple-xml
 match is used as source of data.
 So I supposed it is something similar to my needs. i18n bundle parameter
 needs a source of data, usually a file (better, a group of file, as
 java.util.ResourceBundle is). In this case no service-consumer or
 servlet-service are used.

 Reading the sample sitemap I understood that service-consumer and
 servlet-service are used when you want to use a match as transformer
 or serializer.

 I understood wrong?

 Regards

 Alberto



 On Fri, 2014-01-17 at 11:32 +0100, gelo1234 wrote:
  Hello Alberto,
 
 
  One more thing is that any map:transform or map:serialize must have:
  type=servlet-service with servlet:/ protocol.
 
 
 
  Greetings,
  Greg
 
 
 
  2014/1/17 gelo1234 gelo1...@gmail.com
  Hello Alberto,
 
 
  Have you defined
 
  map:match pattern=translations_*.properties
 
 
  with:
  map:generate type=service-consumer/ ?
 
 
  Otherwise:
 
  map:parameter name=bundle
 
 
 value=servlet:/translations_{jexl:cocoon.request.lang}.properties /
 
 
  will not work as expected.
 
 
  Take a look at C3 samples sitemap.xmap [1] which shows correct
  definition of service consumer.
 
 
  Greetings,
  Greg
 
  [1]
 
 http://svn.apache.org/repos/asf/cocoon/cocoon3/trunk/cocoon-sample/src/main/resources/COB-INF/sitemap.xmap
 
 
 
  2014/1/17 Alberto Brosich abros...@ogs.trieste.it
 
  Hi,
 
  I'm migrating a 2.1 cocoon application to 3.0, using
  beta1-SNAPSHOT
  because I need the sql transformer.
  As I wrote in the subject, I'm need to specify an
  internal pipeline as
  bundle for the i18n transformer, because the
  properties file has to be
  derived from database. Using a plain file it works.
  I tried several urls using servlet: protocol, but
  without success.
 
  I have the following internal pipeline:
  map:match pattern=translations_*.properties
 
  and I tried several bundles urls like:
  map:parameter name=bundle
  value=servlet:/translations /
  or
  map:parameter name=bundle
 
 value=servlet:/translations_{jexl:cocoon.request.lang}.properties /
 
  The exception is:
  org.apache.cocoon.pipeline.SetupException:
  java.util.MissingResourceException: Can't find bundle
  for base name
  servlet:/translations, locale en
 
  What I doing wrong?
 
  Best regards
 
  Alberto
 
 
 
 -
  To unsubscribe, e-mail:
  users-unsubscr...@cocoon.apache.org
  For additional commands, e-mail:
  users-h...@cocoon.apache.org
 
 
 
 
 



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




Re: [C3] Can i18n transformer use an internal pipeline as bundle?

2014-01-17 Thread gelo1234
Can you show here your full original Cocoon pipeline ? Do you store
property files content or property filenames inside db ?

Greetings,
Greg


2014/1/17 Alberto Brosich abros...@ogs.trieste.it


 Hi,

 I'm migrating a 2.1 cocoon application to 3.0, using beta1-SNAPSHOT
 because I need the sql transformer.
 As I wrote in the subject, I'm need to specify an internal pipeline as
 bundle for the i18n transformer, because the properties file has to be
 derived from database. Using a plain file it works.
 I tried several urls using servlet: protocol, but without success.

 I have the following internal pipeline:
 map:match pattern=translations_*.properties

 and I tried several bundles urls like:
 map:parameter name=bundle value=servlet:/translations /
 or
 map:parameter name=bundle
 value=servlet:/translations_{jexl:cocoon.request.lang}.properties /

 The exception is:
 org.apache.cocoon.pipeline.SetupException:
 java.util.MissingResourceException: Can't find bundle for base name
 servlet:/translations, locale en

 What I doing wrong?

 Best regards

 Alberto


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




Re: [C3] Can i18n transformer use an internal pipeline as bundle?

2014-01-17 Thread gelo1234
How about a workaround that puts those properties values into XSL params
and transform with standard XSLTransformer not i18nTransformer ?

Where do you need those properties in pipeline ?

Greetings,
Greg


2014/1/17 Alberto Brosich abros...@ogs.trieste.it


 Yes, it's really simple.
 The source file is an xml file with a sqltransformer query. The query is
 simple: just a select to a specific table (or view) with a where condition.
 Then an xsl transformer convert the xml to txt with a pair of key and
 value for every row.
 That's all.

 map:pipeline internal-only=true

   map:match pattern=translations_*.properties
 map:generate type=string-template
 src=files/dbdata.xml
 map:parameter name=table value=messages/
 map:parameter name=fields value=key_value,
 value/
 map:parameter name=condition
 value=lang_id='{map:1}'/
 map:parameter name=orderfields value=1/
 map:parameter name=rowcount value=10/
 /map:generate
 map:transform type=sql
 map:parameter name=use-connection
 value=dataSource /
 /map:transform
 map:transform src=stylesheets/sql2properties.xsl/
 map:serialize type=txt/
   /map:match


 This is a snip of the xsl stylesheet:

 xsl:template match=sql:row
 xsl:text
 xsl:value-of select=sql:key_value//xsl:text
 xsl:text=/xsl:text
 xsl:textxsl:value-of select=sql:value//xsl:text
 /xsl:template


 Alberto


 On Fri, 2014-01-17 at 15:30 +0100, gelo1234 wrote:
  Can you show here your full original Cocoon pipeline ? Do you store
  property files content or property filenames inside db ?
 
 
  Greetings,
  Greg
 
 
 
  2014/1/17 Alberto Brosich abros...@ogs.trieste.it
 
  Hi,
 
  I'm migrating a 2.1 cocoon application to 3.0, using
  beta1-SNAPSHOT
  because I need the sql transformer.
  As I wrote in the subject, I'm need to specify an internal
  pipeline as
  bundle for the i18n transformer, because the properties file
  has to be
  derived from database. Using a plain file it works.
  I tried several urls using servlet: protocol, but without
  success.
 
  I have the following internal pipeline:
  map:match pattern=translations_*.properties
 
  and I tried several bundles urls like:
  map:parameter name=bundle value=servlet:/translations /
  or
  map:parameter name=bundle
 
 value=servlet:/translations_{jexl:cocoon.request.lang}.properties /
 
  The exception is:
  org.apache.cocoon.pipeline.SetupException:
  java.util.MissingResourceException: Can't find bundle for base
  name
  servlet:/translations, locale en
 
  What I doing wrong?
 
  Best regards
 
  Alberto
 
 
 
 -
  To unsubscribe, e-mail: users-unsubscr...@cocoon.apache.org
  For additional commands, e-mail: users-h...@cocoon.apache.org
 
 
 



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




Re: [C3] Can i18n transformer use an internal pipeline as bundle?

2014-01-17 Thread gelo1234
OK, 100 xslt params would be too complicated as xslt params.

I have 2 more options though :)

1. Option with pure xml/xsl

How about making properties a raw xml data (with xml serializer, not txt),
e.g.

properties
  key1value1/key1
  key2value2/key2
  ...
  keyNvalueN/keyN
/properties

and in subsequent XSLT use:

xsl:variable name=properties select=/Root/properties/

and each parameter inserted with xsl:value-of select=$properties/keyX/ ?

With this approach, it is a matter of rewriting your XSL that generates
HTML.

2. Option with RESTController

Use generator to get properties out from database and put it inside
a Map, then call string-template to render XML/HTML with values
from Map:

map:match pattern=homepage
map:generate src=homepage.xhtml type=stringtemplate /
map:serialize type=html //map:match


map:match pattern=homepage.html
controller:call controller=rest-controller
select=HomepageController
  map:parameter name=lang value={jexl:cocoon.request.lang} /
/controller:call/map:match


@RESTControllerpublic class HomepageController implements Get {

@SitemapParameter
private String lang;

@RequestParameter
private String someParam;

public RestResponse doGet() throws Exception {

  // get properties out from database

  -- custom jdbc code here

  ResultSet rs = properties_from_db;

  // put it inside Map

  MapString, Object data = new HashMapString, Object();

  while (rs.hasNext()) {

  rs.next();

  data.put(rs.getString(key), rs.getString(value));

  }
  return new Page(servlet:/homepage, data);
}}



Greetings,
Greg



2014/1/17 Alberto Brosich abros...@ogs.trieste.it

 On Fri, 2014-01-17 at 16:44 +0100, gelo1234 wrote:
  How about a workaround that puts those properties values into XSL
  params and transform with standard XSLTransformer not
  i18nTransformer ?

 mmh, it seems quite complicated. The properties file is more than one
 hundred lines long. How can I pass all these properties?
 A choice could be a dynamic xslt, built querying the database. But can I
 specify a servlet: protocol in the src attribute of an xsl
 transformer? I think no.


 
 
  Where do you need those properties in pipeline ?

 I have a pipeline that produce an html page, querying a database.

 map:match pattern=homepage
   map:generate src=files/homepage.xml /
   map:transform type=sql
 map:parameter name=use-connection value=dataSource /
   /map:transform
   map:transform src=stylesheets/homepage-sql2xml.xsl/
   map:transform type=i18n
 map:parameter name=locale value={jexl:cocoon.request.lang} /
 map:parameter name=bundle value=COB-INF/files/translations /
   /map:transform
   map:transform src=stylesheets/homepage2html.xsl/
 etc...

 
 
 
  Greetings,
  Greg
 
 
 
  2014/1/17 Alberto Brosich abros...@ogs.trieste.it
 
  Yes, it's really simple.
  The source file is an xml file with a sqltransformer query.
  The query is simple: just a select to a specific table (or
  view) with a where condition.
  Then an xsl transformer convert the xml to txt with a pair of
  key and value for every row.
  That's all.
 
  map:pipeline internal-only=true
 
map:match pattern=translations_*.properties
  map:generate type=string-template
  src=files/dbdata.xml
  map:parameter name=table
  value=messages/
  map:parameter name=fields
  value=key_value, value/
  map:parameter name=condition
  value=lang_id='{map:1}'/
  map:parameter name=orderfields
  value=1/
  map:parameter name=rowcount
  value=10/
  /map:generate
  map:transform type=sql
  map:parameter name=use-connection
  value=dataSource /
  /map:transform
  map:transform src=stylesheets/sql2properties.xsl/
  map:serialize type=txt/
/map:match
 
 
  This is a snip of the xsl stylesheet:
 
  xsl:template match=sql:row
  xsl:text
  xsl:value-of select=sql:key_value//xsl:text
  xsl:text=/xsl:text
  xsl:textxsl:value-of
  select=sql:value//xsl:text
  /xsl:template
 
 
  Alberto
 
 
  On Fri, 2014-01-17 at 15:30 +0100, gelo1234 wrote:
   Can you show here your full original Cocoon pipeline ? Do
  you store
   property files content or property filenames inside db ?
  
  
   Greetings,
   Greg
  
  
  
   2014/1/17 Alberto Brosich abros...@ogs.trieste.it

Re: Adding EXSLT functions

2014-02-28 Thread gelo1234
Hi,

We have used EXSLT in C2 stylesheets without problems.
Here is an excerpt:

xsl:stylesheet xmlns:xsl=http://www.w3.org/1999/XSL/Transform;
version=1.0 xmlns:exslt=http://exslt.org/common;
...

xsl:if test=exslt:node-set($content)/checkboxes/checkbox[not(@selected)]
...

As far as memory serves, it worked seamlessly with Xalan and Saxon.

Greetings,
Greg



2014-02-28 13:12 GMT+01:00 Ellis Pritchard el...@nukinetics.com:

 Hi Chris,

 Not standard EXSLT functions, but I have loaded extension functions under
 2.1.

 I've just consulted my archives (2006!)...

 Firstly, I used a .xweb patch file patch Cocoon's servlet configuration,
 in order to pre-load my extension classes using Cocoon's load-class
 init-param; this was because doing it lazily at run-time created a
 class-loader race-condition under high load, which caused a random
 extension class to be called on production, and thus randomly fail with a
 NoSuchMethod exception, which was perplexing to say the least (so I mention
 this so you don't have the same problem!):

 ?xml version=1.0 encoding=UTF-8?
 xweb
 xpath=/web-app/servlet[servlet-name='Cocoon']/init-param[param-name='load-class']/param-value
 remove=/web-app/servlet[servlet-name='Cocoon']/init-param[param-name='load-class']/param-value/text()
 
 !-- pre-load classes used as XSLT extensions to prevent
 classloader race-condition under high load --
 com.xxx.xml.exslt.Dates
 com.xxx.xml.exslt.FileUtils
 /xweb

 etc.

 This goes into cocoon's src/confpatch directory as e.g. load-class.xweb
 and patches web.xml, unless you build it some other way.

 Then you just write a simple POJO with static methods to do your
 functionality, e.g. I had a little function for finding a local file-size:

 package com.xxx.xml.exslt;

 import java.io.File;

 public class FileUtils {

 /**
  * returns the size of a file rounded to the nearest Kilobyte.
  * @param fileName
  * @return the file size in KB, or 0 if file not accessible.
  */
 public static long Size(String fileName) {
  File file = new File(fileName);
  return ((file.length()+512)/1024);
 }
 }

 Then to use this from the XSL, you just declare a namespace with the full
 class name as the URI, and use the prefix and method name as you would use
 any other function e.g.:

 ?xml version=1.0 encoding=UTF-8?
 xsl:stylesheet
 xmlns:xsl=http://www.w3.org/1999/XSL/Transform;
 xmlns:file=com.xxx.xml.exslt.FileUtils

xsl:template match=something
 Size = xsl:value-of select=file:Size($path)/
/xsl:template

 /xsl:stylesheet

 Hope that works for you: it's been a long long time since I did anything
 Cocoony...

 Ellis.

 On 27 Feb 2014, at 21:47, Christopher Schultz 
 ch...@christopherschultz.net wrote:

  Signed PGP part
  All,
 
  I've been successfully using EXSLT functions -- specifically, the
  date-and-time functions (http://exslt.org/date/index.html) -- for some
  years now and I was interested in using the seconds function. It
  turns out that the seconds function is not in the core functions and
  so for whatever reason, it's not been included in Xalan (I'm using
  Cocoon 2.1.11 which uses Xalan 2.7.1 by default).
 
  I've tried to download and use the date.seconds.xsl template and
  included Javascript and MSXML XSL templates with a mixture of
  xsl:import and xmlns:date declarations, but nothing seems to get the
  two working together.
 
  Has anyone ever manually-plugged an EXSLT function into Xalan? How did
  you do it?
 
  Thanks,
  -chris
 
 
  -
  To unsubscribe, e-mail: users-unsubscr...@cocoon.apache.org
  For additional commands, e-mail: users-h...@cocoon.apache.org
 


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




Re: Adding EXSLT functions

2014-02-28 Thread gelo1234
Chris, one more notice. Take a look at:
http://saxonica.com/documentation9.4-demo/html/extensions/exslt.html

EXSLT are available out of the box in Saxon 9.x EE/PE, you don't have to
include any exsl.xsl additionally. The problem is with Saxon HE, which is
by default used in C3 (2.2?).

The problem with 9.x HE Saxon release is also with calling Java functions
from XSLT. If you want that functionality, you either have to buy EE/PE
release or downgrade to older Saxon (7.x/8.x) which works fine with
Java/EXSL functions.

Greetings,
Greg


2014-02-28 17:53 GMT+01:00 gelo1234 gelo1...@gmail.com:

 Hi,

 We have used EXSLT in C2 stylesheets without problems.
 Here is an excerpt:

 xsl:stylesheet xmlns:xsl=http://www.w3.org/1999/XSL/Transform;
 version=1.0 xmlns:exslt=http://exslt.org/common;
 ...

 xsl:if
 test=exslt:node-set($content)/checkboxes/checkbox[not(@selected)]
 ...

 As far as memory serves, it worked seamlessly with Xalan and Saxon.

 Greetings,
 Greg



 2014-02-28 13:12 GMT+01:00 Ellis Pritchard el...@nukinetics.com:

 Hi Chris,

 Not standard EXSLT functions, but I have loaded extension functions under
 2.1.

 I've just consulted my archives (2006!)...

 Firstly, I used a .xweb patch file patch Cocoon's servlet configuration,
 in order to pre-load my extension classes using Cocoon's load-class
 init-param; this was because doing it lazily at run-time created a
 class-loader race-condition under high load, which caused a random
 extension class to be called on production, and thus randomly fail with a
 NoSuchMethod exception, which was perplexing to say the least (so I mention
 this so you don't have the same problem!):

 ?xml version=1.0 encoding=UTF-8?
 xweb
 xpath=/web-app/servlet[servlet-name='Cocoon']/init-param[param-name='load-class']/param-value
 remove=/web-app/servlet[servlet-name='Cocoon']/init-param[param-name='load-class']/param-value/text()
 
 !-- pre-load classes used as XSLT extensions to prevent
 classloader race-condition under high load --
 com.xxx.xml.exslt.Dates
 com.xxx.xml.exslt.FileUtils
 /xweb

 etc.

 This goes into cocoon's src/confpatch directory as e.g. load-class.xweb
 and patches web.xml, unless you build it some other way.

 Then you just write a simple POJO with static methods to do your
 functionality, e.g. I had a little function for finding a local file-size:

 package com.xxx.xml.exslt;

 import java.io.File;

 public class FileUtils {

 /**
  * returns the size of a file rounded to the nearest Kilobyte.
  * @param fileName
  * @return the file size in KB, or 0 if file not accessible.
  */
 public static long Size(String fileName) {
  File file = new File(fileName);
  return ((file.length()+512)/1024);
 }
 }

 Then to use this from the XSL, you just declare a namespace with the full
 class name as the URI, and use the prefix and method name as you would use
 any other function e.g.:

 ?xml version=1.0 encoding=UTF-8?
 xsl:stylesheet
 xmlns:xsl=http://www.w3.org/1999/XSL/Transform;
 xmlns:file=com.xxx.xml.exslt.FileUtils

xsl:template match=something
 Size = xsl:value-of select=file:Size($path)/
/xsl:template

 /xsl:stylesheet

 Hope that works for you: it's been a long long time since I did anything
 Cocoony...

 Ellis.

 On 27 Feb 2014, at 21:47, Christopher Schultz 
 ch...@christopherschultz.net wrote:

  Signed PGP part
  All,
 
  I've been successfully using EXSLT functions -- specifically, the
  date-and-time functions (http://exslt.org/date/index.html) -- for some
  years now and I was interested in using the seconds function. It
  turns out that the seconds function is not in the core functions and
  so for whatever reason, it's not been included in Xalan (I'm using
  Cocoon 2.1.11 which uses Xalan 2.7.1 by default).
 
  I've tried to download and use the date.seconds.xsl template and
  included Javascript and MSXML XSL templates with a mixture of
  xsl:import and xmlns:date declarations, but nothing seems to get the
  two working together.
 
  Has anyone ever manually-plugged an EXSLT function into Xalan? How did
  you do it?
 
  Thanks,
  -chris
 
 
  -
  To unsubscribe, e-mail: users-unsubscr...@cocoon.apache.org
  For additional commands, e-mail: users-h...@cocoon.apache.org
 


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





Re: URLResponse from Restcontroller with Hibernate circular relationships

2014-03-04 Thread gelo1234
Another kind of hack (if you cannot modify entity sources and they are
not external .xml files) would be setting all child objects' parent
references to null _before_ serializing that data.

Lets say you got: Author and Book entites with One-To-Many relationship.

You retrieve the entities from db and _before_ URLResponse, you modify
all Books entities with null reference to parent(Author) entity:


ListAuthor authors = hibernateDAO.getAllAuthors();

// make sure hibernate session is closed and authors objects are _detached_
// with full data structure - FetchType.EAGER

for (Author author: authors) {
  ListBook books = author.getBooks();
  for (Book book: books)
book.setAuthor(null);
}

Now you can safely call URLResponse with authors (they don't contain any
circular references anymore).

Greetings,
Greg



2014-03-04 23:00 GMT+01:00 gelo1234 gelo1...@gmail.com:

 Hi

 Can you debug where exactly a problem with circular references exists ?
 Is it during serialization of your data ? StringTemplate? IOUtils?

 Many serialization techniques/libs do have problems with such references,
 be it JAXB or GSON. For JAXB you can setup @Transient annotation.

 How about a quick fix, that removes one side of relationship in Hibernate
 entities making it uni-directional instead of bi-directional e.g. reverse
 side ?

 Greetings,
 Greg



 2014-03-04 22:29 GMT+01:00 Yahoo hansheinrichbr...@yahoo.de:

 I am using Hibernate 4.1.8-Final and cocoon 3.0.0-beta-1-SNAPSHOT.
 But why you ask?
 Am 03.03.2014 08:09, schrieb Francesco Chicchiriccò:

  On 03/03/2014 04:36, Yahoo wrote:

 I  am using cocoon RestController to present my Hibernate Mysql data in
 pdf files.
 The Hibernate structure has cirular relationships, so when I give the
 structure to the URLResponse there are endless StringBuilder calls.Do you
 have an idea how to solve this problem.One idea would be to present the
 data in an non Hibernate bean without cicular relationships. But may be
 there is an opportunity to avoid new beans.


 Hi,
 such problems arise every time JPA (or other persistence frameworks)
 entities are published (via REST in your case) without any transformation
 (the DTO pattern): I am afraid there is any cleaner solution than
 converting your Hibernate entities into something simpler.

 BTW: which version are you using?

 Regards.



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





Re: URLResponse from Restcontroller with Hibernate circular relationships

2014-03-04 Thread gelo1234
Yup, Lazy loading will cause problems in this scenario. How about making
Hibernate session readOnly ? :)

http://stackoverflow.com/questions/5800814/is-it-possible-to-detach-hibernate-entity-so-that-changes-to-object-are-not-aut


Greetings,
Greg


2014-03-05 4:52 GMT+01:00 Yahoo hansheinrichbr...@yahoo.de:

  Thanks Greg,That's the idea as long as I don't save the bean there is no
 problem
 with the database. And such methods I already use with Lazy loading
 between two requests.

 Am 04.03.2014 23:47, schrieb gelo1234:


 Another kind of hack (if you cannot modify entity sources and they are
 not external .xml files) would be setting all child objects' parent
 references to null _before_ serializing that data.

 Lets say you got: Author and Book entites with One-To-Many relationship.

  You retrieve the entities from db and _before_ URLResponse, you modify
  all Books entities with null reference to parent(Author) entity:


   ListAuthor authors = hibernateDAO.getAllAuthors();

  // make sure hibernate session is closed and authors objects are
 _detached_
  // with full data structure - FetchType.EAGER

  for (Author author: authors) {
ListBook books = author.getBooks();
for (Book book: books)
  book.setAuthor(null);
 }

  Now you can safely call URLResponse with authors (they don't contain any
 circular references anymore).

  Greetings,
 Greg



 2014-03-04 23:00 GMT+01:00 gelo1234 gelo1...@gmail.com:

  Hi

 Can you debug where exactly a problem with circular references exists ?
  Is it during serialization of your data ? StringTemplate? IOUtils?

  Many serialization techniques/libs do have problems with such
 references, be it JAXB or GSON. For JAXB you can setup @Transient
 annotation.

  How about a quick fix, that removes one side of relationship in
 Hibernate entities making it uni-directional instead of bi-directional e.g.
 reverse side ?

  Greetings,
 Greg



 2014-03-04 22:29 GMT+01:00 Yahoo hansheinrichbr...@yahoo.de:

 I am using Hibernate 4.1.8-Final and cocoon 3.0.0-beta-1-SNAPSHOT.
 But why you ask?
 Am 03.03.2014 08:09, schrieb Francesco Chicchiriccò:

  On 03/03/2014 04:36, Yahoo wrote:

 I  am using cocoon RestController to present my Hibernate Mysql data
 in pdf files.
 The Hibernate structure has cirular relationships, so when I give the
 structure to the URLResponse there are endless StringBuilder calls.Do you
 have an idea how to solve this problem.One idea would be to present the
 data in an non Hibernate bean without cicular relationships. But may be
 there is an opportunity to avoid new beans.


 Hi,
 such problems arise every time JPA (or other persistence frameworks)
 entities are published (via REST in your case) without any transformation
 (the DTO pattern): I am afraid there is any cleaner solution than
 converting your Hibernate entities into something simpler.

 BTW: which version are you using?

 Regards.



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







Re: URLResponse from Restcontroller with Hibernate circular relationships

2014-03-05 Thread gelo1234
Anyway I'm curious if you keep your Hibernate session _open_ between two
HTTP Requests (second is calling String-template servlet? until View is
completely rendered) ?
Do you use open-session-in-view pattern or any other ? Conversations
spanning several request-response cycles ?
https://community.jboss.org/wiki/OpenSessionInView

Greetings,
Greg


2014-03-05 4:52 GMT+01:00 Yahoo hansheinrichbr...@yahoo.de:

  Thanks Greg,That's the idea as long as I don't save the bean there is no
 problem
 with the database. And such methods I already use with Lazy loading
 between two requests.

 Am 04.03.2014 23:47, schrieb gelo1234:


 Another kind of hack (if you cannot modify entity sources and they are
 not external .xml files) would be setting all child objects' parent
 references to null _before_ serializing that data.

 Lets say you got: Author and Book entites with One-To-Many relationship.

  You retrieve the entities from db and _before_ URLResponse, you modify
  all Books entities with null reference to parent(Author) entity:


   ListAuthor authors = hibernateDAO.getAllAuthors();

  // make sure hibernate session is closed and authors objects are
 _detached_
  // with full data structure - FetchType.EAGER

  for (Author author: authors) {
ListBook books = author.getBooks();
for (Book book: books)
  book.setAuthor(null);
 }

  Now you can safely call URLResponse with authors (they don't contain any
 circular references anymore).

  Greetings,
 Greg



 2014-03-04 23:00 GMT+01:00 gelo1234 gelo1...@gmail.com:

  Hi

 Can you debug where exactly a problem with circular references exists ?
  Is it during serialization of your data ? StringTemplate? IOUtils?

  Many serialization techniques/libs do have problems with such
 references, be it JAXB or GSON. For JAXB you can setup @Transient
 annotation.

  How about a quick fix, that removes one side of relationship in
 Hibernate entities making it uni-directional instead of bi-directional e.g.
 reverse side ?

  Greetings,
 Greg



 2014-03-04 22:29 GMT+01:00 Yahoo hansheinrichbr...@yahoo.de:

 I am using Hibernate 4.1.8-Final and cocoon 3.0.0-beta-1-SNAPSHOT.
 But why you ask?
 Am 03.03.2014 08:09, schrieb Francesco Chicchiriccò:

  On 03/03/2014 04:36, Yahoo wrote:

 I  am using cocoon RestController to present my Hibernate Mysql data
 in pdf files.
 The Hibernate structure has cirular relationships, so when I give the
 structure to the URLResponse there are endless StringBuilder calls.Do you
 have an idea how to solve this problem.One idea would be to present the
 data in an non Hibernate bean without cicular relationships. But may be
 there is an opportunity to avoid new beans.


 Hi,
 such problems arise every time JPA (or other persistence frameworks)
 entities are published (via REST in your case) without any transformation
 (the DTO pattern): I am afraid there is any cleaner solution than
 converting your Hibernate entities into something simpler.

 BTW: which version are you using?

 Regards.



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







Re: URLResponse from Restcontroller with Hibernate circular relationships

2014-03-07 Thread gelo1234
Hi,

I think there is no common pattern. It solely depends on your usage
scenario. If you don't need to use a reverse side of  the relationship in
your business logic, I would recommend removing that part.
Mind some of the intricacies though e.g. if you remove the parent reference
field in child and not specify in parent that this column must _not_ be
null, you can get Exception with some persistence providers:
http://stackoverflow.com/questions/12755380/jpa-persisting-a-unidirectional-one-to-many-relationship-fails-with-eclipselin

Speaking from experience, Hibernate is very tolerant compared to e.g.
OpenJPA or EclipseLink

Greetings,
Greg


2014-03-07 10:15 GMT+01:00 Yahoo hansheinrichbr...@yahoo.de:

  Hello Greg,
 Your solution works fine.
 With a lot of Lazy Loading and circular relations
 I have the idea to include the decision which relations should be really
 loaded
 and which should be nulled
 in the Dao.Do you know if there is already a professional solution for
 this usage?


 Am 04.03.2014 23:47, schrieb gelo1234:


 Another kind of hack (if you cannot modify entity sources and they are
 not external .xml files) would be setting all child objects' parent
 references to null _before_ serializing that data.

 Lets say you got: Author and Book entites with One-To-Many relationship.

  You retrieve the entities from db and _before_ URLResponse, you modify
  all Books entities with null reference to parent(Author) entity:


   ListAuthor authors = hibernateDAO.getAllAuthors();

  // make sure hibernate session is closed and authors objects are
 _detached_
  // with full data structure - FetchType.EAGER

  for (Author author: authors) {
ListBook books = author.getBooks();
for (Book book: books)
  book.setAuthor(null);
 }

  Now you can safely call URLResponse with authors (they don't contain any
 circular references anymore).

  Greetings,
 Greg



 2014-03-04 23:00 GMT+01:00 gelo1234 gelo1...@gmail.com:

  Hi

 Can you debug where exactly a problem with circular references exists ?
  Is it during serialization of your data ? StringTemplate? IOUtils?

  Many serialization techniques/libs do have problems with such
 references, be it JAXB or GSON. For JAXB you can setup @Transient
 annotation.

  How about a quick fix, that removes one side of relationship in
 Hibernate entities making it uni-directional instead of bi-directional e.g.
 reverse side ?

  Greetings,
 Greg



 2014-03-04 22:29 GMT+01:00 Yahoo hansheinrichbr...@yahoo.de:

 I am using Hibernate 4.1.8-Final and cocoon 3.0.0-beta-1-SNAPSHOT.
 But why you ask?
 Am 03.03.2014 08:09, schrieb Francesco Chicchiriccò:

  On 03/03/2014 04:36, Yahoo wrote:

 I  am using cocoon RestController to present my Hibernate Mysql data
 in pdf files.
 The Hibernate structure has cirular relationships, so when I give the
 structure to the URLResponse there are endless StringBuilder calls.Do you
 have an idea how to solve this problem.One idea would be to present the
 data in an non Hibernate bean without cicular relationships. But may be
 there is an opportunity to avoid new beans.


 Hi,
 such problems arise every time JPA (or other persistence frameworks)
 entities are published (via REST in your case) without any transformation
 (the DTO pattern): I am afraid there is any cleaner solution than
 converting your Hibernate entities into something simpler.

 BTW: which version are you using?

 Regards.



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







Re: Feeding a Bean to the pipeline

2014-03-12 Thread gelo1234
Why JAXB/annotations didn't work ? Open-session problem ?


Greetings,
Greg

2014-03-12 12:14 GMT+01:00 Piratenvisier hansheinrichbr...@yahoo.de:

 I have to feed the Pipeline with the content of a Hibernate Bean.
 I tried with JAXB and and annotations. But I could not get the preferred
 result.
 Now I will try the XMLGenerator.
 Is there another possibility.

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




Re: Jexl in embedded Pipeline

2014-03-13 Thread gelo1234
With servlet-sitemaps Jexl can be used within any pipeline as {jexl:.}
value.

Please show example of your embedded pipeline ?

Greetings,
Greg


2014-03-13 11:09 GMT+01:00 Yahoo hansheinrichbr...@yahoo.de:

 How can I use Jexl in an embadded Pipline ?

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




Re: Jexl in embedded Pipeline

2014-03-13 Thread gelo1234
I got lost with your explanation :) It's a kind of awkward thing to me that
you are actually trying to do with that code.


Why not making it clean:

1. First you need a String-Template match to serialize the Hibernate bean
- output XML with final values

map:match pattern=hibernate/bean
map:generate src=bean.xml type=stringtemplate /
map:serialize type=xml //map:match

where bean.xml is your [input]

You can now feed angebot bean data into hibernate/bean pipe above (to get
it serialized):

map:match pattern=hibernate/{id}
controller:call controller=rest-controller select=BeanController
  map:parameter name=id value={map:id} /
/controller:call/map:match


@RESTControllerpublic class BeanController implements Get {

@SitemapParameter
private String id;

@RequestParameter
private String name;

// through injection or other way
HibernateDAO dao;


public RestResponse doGet() throws Exception {
MapString, Object data = new HashMapString, Object();
data.put(angebot, dao.getAngebotBean(id));
data.put(name, this.name);

return new Page(servlet:/hibernate/bean, data);
}}

At this point you got your Hibernate bean serialized (into XML data).

2. Second you can go for XSLT Transformer and transform XML into anything
you want

You don't need any JEXL here.


Greetings,
Greg




2014-03-13 13:30 GMT+01:00 Yahoo hansheinrichbr...@yahoo.de:

  I used the EmailPlainPipe from the distribution:
   byte[] bytes = (byte[]) parameters.get(input);
 XMLGenerator generator = new XMLGenerator(bytes);
 this.addComponent(generator);
 byte[] xsl = (byte[]) parameters.get(xsl);
 Source xslSource = new StreamSource(new ByteArrayInputStream(xsl));
 XSLTTransformer transformer = new XSLTTransformer(
 xslSource, new Date().getTime());
 // pass all parameter to the xslTransformer
 transformer.setParameters(parameters);
 this.addComponent(transformer);
 this.addComponent(TextSerializer.createPlainSerializer());
 super.setup(outputStream, parameters);
 where input is:
 ?xml version=1.0 encoding=UTF-8?
 angebot
   id$name$$angebot.id$/id
  anganz$angebot.anganz$/anganz
 angkurzbeschreibung$angebot.angkurzbeschreibung$/angkurzbeschreibung
 /angebot
 xsl is the identity
 angebot is a Hibernate Bean.
 how do feed the pipeline with this Bean that it is used  by Jexl to
 resolve the input String.


 Am 13.03.2014 12:55, schrieb gelo1234:

  With servlet-sitemaps Jexl can be used within any pipeline as
 {jexl:.} value.

  Please show example of your embedded pipeline ?

  Greetings,
 Greg


 2014-03-13 11:09 GMT+01:00 Yahoo hansheinrichbr...@yahoo.de:

 How can I use Jexl in an embadded Pipline ?

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






Re: Jexl in embedded Pipeline

2014-03-13 Thread gelo1234
I don't know about the attachments but a clean Cocoon3 extension for
sending emails you can find here:

https://github.com/alveolo/butterfly/blob/master/cocoon/src/test/java/org/alveolo/butterfly/test/cocoon/email/MailSerializerTest.java

Greetings,
Greg


2014-03-13 15:02 GMT+01:00 Piratenvisier hansheinrichbr...@yahoo.de:

  An application like this I use already.
 Thorsten Scherler made this email Application for me.
 The important point: I want to send an email and the Email Text and the
 attachements are produced by cocoon pipelines.
 This a an important part of my cocoon 2.10 application which I wanted to
 transfer to 3.0

 Am 13.03.2014 14:23, schrieb gelo1234:

  I got lost with your explanation :) It's a kind of awkward thing to me
 that you are actually trying to do with that code.


  Why not making it clean:

  1. First you need a String-Template match to serialize the Hibernate
 bean - output XML with final values

 map:match pattern=hibernate/bean
 map:generate src=bean.xml type=stringtemplate /
 map:serialize type=xml //map:match

 where bean.xml is your [input]

  You can now feed angebot bean data into hibernate/bean pipe above (to
 get it serialized):

 map:match pattern=hibernate/{id}
 controller:call controller=rest-controller select=BeanController
   map:parameter name=id value={map:id} /
 /controller:call/map:match

 @RESTControllerpublic class BeanController implements Get {

 @SitemapParameter
 private String id;

 @RequestParameter
 private String name;


 // through injection or other way

 HibernateDAO dao;


 public RestResponse doGet() throws Exception {
 MapString, Object data = new HashMapString, Object();
 data.put(angebot, dao.getAngebotBean(id));
 data.put(name, this.name);

 return new Page(servlet:/hibernate/bean, data);
 }}

  At this point you got your Hibernate bean serialized (into XML data).

  2. Second you can go for XSLT Transformer and transform XML into
 anything you want

  You don't need any JEXL here.


  Greetings,
 Greg




  2014-03-13 13:30 GMT+01:00 Yahoo hansheinrichbr...@yahoo.de:

  I used the EmailPlainPipe from the distribution:
   byte[] bytes = (byte[]) parameters.get(input);
 XMLGenerator generator = new XMLGenerator(bytes);
 this.addComponent(generator);
 byte[] xsl = (byte[]) parameters.get(xsl);
 Source xslSource = new StreamSource(new
 ByteArrayInputStream(xsl));
 XSLTTransformer transformer = new XSLTTransformer(
 xslSource, new Date().getTime());
 // pass all parameter to the xslTransformer
 transformer.setParameters(parameters);
 this.addComponent(transformer);
 this.addComponent(TextSerializer.createPlainSerializer());
 super.setup(outputStream, parameters);
 where input is:
 ?xml version=1.0 encoding=UTF-8?
 angebot
   id$name$$angebot.id$/id
  anganz$angebot.anganz$/anganz
 angkurzbeschreibung$angebot.angkurzbeschreibung$/angkurzbeschreibung
 /angebot
 xsl is the identity
 angebot is a Hibernate Bean.
 how do feed the pipeline with this Bean that it is used  by Jexl to
 resolve the input String.


 Am 13.03.2014 12:55, schrieb gelo1234:

  With servlet-sitemaps Jexl can be used within any pipeline as
 {jexl:.} value.

  Please show example of your embedded pipeline ?

  Greetings,
 Greg


 2014-03-13 11:09 GMT+01:00 Yahoo hansheinrichbr...@yahoo.de:

 How can I use Jexl in an embadded Pipline ?

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








Re: Jexl in embedded Pipeline

2014-03-14 Thread gelo1234
Cocoon 3 pipelines are either SAX or StAX events based so they operate upon
xml data. If you could feed XML into another pipeline component that's
fine. Just ask yourself if you really need Cocoon for the task you are
trying to complete.

Greetings,
Greg


2014-03-14 6:13 GMT+01:00 Yahoo hansheinrichbr...@yahoo.de:

  I found what I want todo. It's not  Jexl it's the VelocityEngine I need.
 Here is the example from spring mail.

MimeMessageHelper message = new MimeMessageHelper(mimeMessage);
 message.setTo(user.getEmailAddress());
 message.setFrom(webmas...@csonth.gov.uk 
 webmas...@csonth.gov.uk); *// could be parameterized...*
 Map model = new HashMap();
 model.put(user, user);
 String text = VelocityEngineUtils.mergeTemplateIntoString(
velocityEngine, com/dns/registration-confirmation.vm, model);
 message.setText(text, true);


 In my case the text comes from an inline Cocoon Pipeline.
 I could first import the template use the Velocity Engine and then give it
 to the Pipeline.
 or is there possibility to make the job done by the pipeline .

 Am 13.03.2014 19:34, schrieb gelo1234:

  I don't know about the attachments but a clean Cocoon3 extension for
 sending emails you can find here:


 https://github.com/alveolo/butterfly/blob/master/cocoon/src/test/java/org/alveolo/butterfly/test/cocoon/email/MailSerializerTest.java

  Greetings,
 Greg


 2014-03-13 15:02 GMT+01:00 Piratenvisier hansheinrichbr...@yahoo.de:

  An application like this I use already.
 Thorsten Scherler made this email Application for me.
 The important point: I want to send an email and the Email Text and the
 attachements are produced by cocoon pipelines.
 This a an important part of my cocoon 2.10 application which I wanted to
 transfer to 3.0

 Am 13.03.2014 14:23, schrieb gelo1234:

  I got lost with your explanation :) It's a kind of awkward thing to me
 that you are actually trying to do with that code.


  Why not making it clean:

  1. First you need a String-Template match to serialize the Hibernate
 bean - output XML with final values

 map:match pattern=hibernate/bean
 map:generate src=bean.xml type=stringtemplate /
 map:serialize type=xml //map:match

 where bean.xml is your [input]

  You can now feed angebot bean data into hibernate/bean pipe above (to
 get it serialized):

 map:match pattern=hibernate/{id}
 controller:call controller=rest-controller 
 select=BeanController
   map:parameter name=id value={map:id} /
 /controller:call/map:match

 @RESTControllerpublic class BeanController implements Get {

 @SitemapParameter
 private String id;

 @RequestParameter
 private String name;


 // through injection or other way

 HibernateDAO dao;


 public RestResponse doGet() throws Exception {
 MapString, Object data = new HashMapString, Object();
 data.put(angebot, dao.getAngebotBean(id));
 data.put(name, this.name);

 return new Page(servlet:/hibernate/bean, data);
 }}

  At this point you got your Hibernate bean serialized (into XML data).

  2. Second you can go for XSLT Transformer and transform XML into
 anything you want

  You don't need any JEXL here.


  Greetings,
 Greg




  2014-03-13 13:30 GMT+01:00 Yahoo hansheinrichbr...@yahoo.de:

  I used the EmailPlainPipe from the distribution:
   byte[] bytes = (byte[]) parameters.get(input);
 XMLGenerator generator = new XMLGenerator(bytes);
 this.addComponent(generator);
 byte[] xsl = (byte[]) parameters.get(xsl);
 Source xslSource = new StreamSource(new
 ByteArrayInputStream(xsl));
 XSLTTransformer transformer = new XSLTTransformer(
 xslSource, new Date().getTime());
 // pass all parameter to the xslTransformer
 transformer.setParameters(parameters);
 this.addComponent(transformer);
 this.addComponent(TextSerializer.createPlainSerializer());
 super.setup(outputStream, parameters);
 where input is:
 ?xml version=1.0 encoding=UTF-8?
 angebot
   id$name$$angebot.id$/id
  anganz$angebot.anganz$/anganz
 angkurzbeschreibung$angebot.angkurzbeschreibung$/angkurzbeschreibung
 /angebot
 xsl is the identity
 angebot is a Hibernate Bean.
 how do feed the pipeline with this Bean that it is used  by Jexl to
 resolve the input String.


 Am 13.03.2014 12:55, schrieb gelo1234:

  With servlet-sitemaps Jexl can be used within any pipeline as
 {jexl:.} value.

  Please show example of your embedded pipeline ?

  Greetings,
 Greg


 2014-03-13 11:09 GMT+01:00 Yahoo hansheinrichbr...@yahoo.de:

 How can I use Jexl in an embadded Pipline ?

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










Re: Accessing application/json message body of POST request

2014-03-17 Thread gelo1234
Hi Bardo,

Are you talking about REST in C3 (cocoon-rest dependency) ?

Have you tried annotating REST Resource with:

@Consumes(MediaType.APPLICATION_JSON)

?

e.g.

@Path(/orders)
@Consumes(MediaType.APPLICATION_JSON)public class OrderRestResource {
  [image: (2)]

private Settings settings;

private static MapInteger, Order orders = new HashMapInteger, Order();

@POST
public void createOrder(Order order) {
orders.put(order.id, order);
}

}





2014-03-16 20:36 GMT+01:00 Bardo Nelgen 
mailing.list.in...@bnnperformances.de:


 Hi all,

 has someone ever accessed the message body of a post request to cocoon
 which uses application/json as its content type?

 The same request is being handled without issues if posted as
 application/x-www-form-urlencoded.

 Though, as soon as the content type is changed to JSON, Cocoon appears to
 skip parsing the message body.

 Unfortunately it's not me making these POST calls; which is why just
 switching it is not an option.

 Is there some setting which can tell cocoon to simply continue parsing,
 either regardless of a post's content type (which, of course might raise
 security issues...) or explicitly for application/json ?

 Any suggestions are welcome.

 Regards,

 Bardo


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




Re: Accessing application/json message body of POST request

2014-03-17 Thread gelo1234
Sorry, my mail got cut in the middle.

So, you should place @Consumes annotation in REST Resource + all that
Spring config explained here:
https://cocoon.apache.org/3.0/reference/html-single/index.html#webapps.rest

AND

JSONProvider in spring config:
bean id=jsonProvider
class=org.apache.cxf.jaxrs.provider.json.JSONProvider  property
name=singleJaxbContext value=true / property name=extraClass
list valuepackage.to.class.Order/value /list /property /bean

This one is from Apache CXF but you can use any other (e.g. from Jersey).

Hope this helps.

Greetings,
Greg


2014-03-17 19:57 GMT+01:00 gelo1234 gelo1...@gmail.com:

 Hi Bardo,

 Are you talking about REST in C3 (cocoon-rest dependency) ?

 Have you tried annotating REST Resource with:

 @Consumes(MediaType.APPLICATION_JSON)

 ?

 e.g.

 @Path(/orders)
 @Consumes(MediaType.APPLICATION_JSON)public class OrderRestResource { 
[image: (2)]

 private Settings settings;

 private static MapInteger, Order orders = new HashMapInteger, Order();

 @POST
 public void createOrder(Order order) {
 orders.put(order.id, order);
 }

 }





 2014-03-16 20:36 GMT+01:00 Bardo Nelgen 
 mailing.list.in...@bnnperformances.de:


 Hi all,

 has someone ever accessed the message body of a post request to cocoon
 which uses application/json as its content type?

 The same request is being handled without issues if posted as
 application/x-www-form-urlencoded.

 Though, as soon as the content type is changed to JSON, Cocoon appears to
 skip parsing the message body.

 Unfortunately it's not me making these POST calls; which is why just
 switching it is not an option.

 Is there some setting which can tell cocoon to simply continue parsing,
 either regardless of a post's content type (which, of course might raise
 security issues...) or explicitly for application/json ?

 Any suggestions are welcome.

 Regards,

 Bardo


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





Re: calling a sitemap-snippet from within a program

2014-03-21 Thread gelo1234
Hi,

1. Yes, it's possible. Since all sitemap matching URL's are actually kind
of HTTP Servlets, you can just use any http client (e.g. Apache HttpClient)
to invoke the servlet and get the response (if that is outside Cocoon):

HttpClient client = new DefaultHttpClient();
HttpGet request = new HttpGet(http://www.test.com/servlet.xml;);
HttpResponse response = client.execute(request);
*// Get the response*
BufferedReader rd = new BufferedReader
  (new InputStreamReader(response.getEntity().getContent()));

String line = ;while ((line = rd.readLine()) != null) {
  ...
}


2. You can invoke any sitemap-servlet from within cocoon pipeline of course:
http://wiki.apache.org/cocoon/IntegrateAServlet

3. If you want to invoke sitemap-servlet from Cocoon API, first you need to
decide at which step that action need to be taken. If it's a Starter, you
can use XMLGenerator with given URL:

URL base = this.getClass().getResource(http://www.test.com/;);
PipelineSAXPipelineComponent pipeline = new
NonCachingPipelineSAXPipelineComponent();
pipeline.addComponent(new XMLGenerator(new URL(base, servlet.xml)));


If it's somewhere in the middle of the pipeline, you can use
IncludeTransformer that will call your servlet-service:

pipeline.addComponent(new XIncludeTransformer(servlet_calling_include.xml));


where:

servlet_calling_include.xml


data_from_servleti:include
src=servlet:/data/servlet//data_from_servlet


Hope that helps.

Greetings,
Greg



2014-03-21 9:14 GMT+01:00 Yahoo hansheinrichbr...@yahoo.de:


 Hello Greg,

 is it possible  to call a sitemap-snippet within a program an getting the
 respone inside a program?

 H.Braun

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




Re: Help needed moving from 2.1.11

2016-01-07 Thread gelo1234
Hi,

There is no need to configure it in any special way. All defaults are out
of the box and are mostly sane (what every developer needs).
C3 is considered to be more a RESTful framework not only a simple XML
distribution system.
Most sitemap.xmaps work ok.

We have taken some steps into moving our app from 2.0.5dev to 3.0 and with
some tweaking it worked fine! Check out the latest C3 snapshots from
repository.
There are sample artifacts for many-blocks and only one block configuration
(simple web app).

Greetings,
Greg


2016-01-07 10:18 GMT+01:00 Flynn, Peter :

> On 06/01/16 17:49, Mark H. Wood wrote:
> > When I first looked at Cocoon 3, I thought it was more like a return
> > to Cocoon's roots, clearing away a lot of stuff that had accumulated
> > and concentrating on the pipeline.
>
> I should have another look
>
> > It's quite true that, without intense study of what documentation
> > there is, it is very difficult to find any mention of how to configure
> > it with XML, but the XML configurator is still in there.
>
> Configuring it with XML would be useful (eg sitemap.xmap) but what I
> meant was that Cocoon primary task was (is?) to serve XML documents via
> XSLT as {text|xml|html|...}
>
>
> ///Peter
>
> -
> To unsubscribe, e-mail: users-unsubscr...@cocoon.apache.org
> For additional commands, e-mail: users-h...@cocoon.apache.org
>
>


Re: Help needed moving from 2.1.11

2016-01-07 Thread gelo1234
>> If I upgrade manually to Tomcat 8 it's going to break all the directory
>> changes and control software setups that RH-based systems expect, which
>> will create work for my ops and my staff because it will be different
>> from all the other Tomcat servers around here. Unfortunately.

> I understand. You should petition CentOS to provide newer Tomcat
>versions. Amazon Linux's package repos (yum-based, RHEL-compatible) all
>support up to Tomcat 8. Supporting only up to Tomcat 6 is ... deeply
>disappointing.

AFAIK, in standard C3 project template there is a Maven config to use Cargo
plugin,
to run ANY kind of Application Server/Container/Web Engine. There are
plenty options,
and of course Tomcat 8.x is one of them.
Go take a look:
https://codehaus-cargo.github.io/cargo/Home.html

Greetings,
Greg

2016-01-07 14:19 GMT+01:00 Christopher Schultz :

> Peter,
>
> On 1/6/16 11:59 AM, Flynn, Peter wrote:
> > On 06/01/16 14:18, Christopher Schultz wrote:
> >
> >> Moving from Tomcat 5 on (presumably) an older Java to a newer version
> >> should not be difficult at all. Is there a reason to move to Tomcat 6
> >> and not all the way up to Tomcat 8? Tomcat 6 will be EOL very soon.[1]
> >
> > Tomcat 6 is all that CentOS6 provides in their repos.
>
> Yeah, it's a shame they are about to be *3* versions behind. Sad.
>
> > Sadly we no longer have the luxury of time to build stuff from scratch.
>
> No need to build anything from scratch. Download the tarball and unpack.
> Installation is done. You can even run multiple versions side-by-side
> and switch back and forth changing nothing but an environment variable.
>
> >> If you are going to migrate, you may as well go all the way.
> >
> > Maybe one day.
> >
> >> My experience with a Cocoon-only deployment on Tomcat 5 moving all the
> >> way up to Tomcat 8 (I went version by version and wasted a whole lot of
> >> time doing so) was basically just drop the WAR file I already had into
> >> Tomcat's deployment directory and everything worked exactly as expected.
> >> (This included incremental upgrades from Java 1.5 to Java 1.8 as well).
> >
> > Yes, dropping my existing cocoon.war file into the new machine works
> > fine, just it's slow and I'm sure the .war file is full of cruft we
> > never use.
>
> Slow... how? Slow to start? Slow all over? Tomcat didn't get many more
> times more complicated between Tomcat 5 and Tomcat 6. It's not like
> upgrading from Windows 3.1 to Windows 95 (I chose that analogy to
> reinforce the idea that Tomcat 6 is oold).
>
> >> I have a relatively simple Cocoon deployment with only a few dozen
> >> matchers in my pipeline, and two or three separate sitemaps. I also have
> >> a custom RequestParameterModule, but of course that wouldn't be
> >> sensitive to a Tomcat upgrade.
> >
> > We have 34 directories, many with subdirectories; 47 sitemap.xmaps in
> > all. And 15GB of XML text.
>
> Shouldn't be a problem, assuming it's on the same hardware. Tomcat 7 is
> a lot more efficient and is missing some of the weirdness of Tomcat 6.
> Tomcat 8 is even better. Please reconsider.
>
> >> My advice would be to put the latest Java and the latest Tomcat on a
> >> test server and drop your existing application's WAR in there and test
> >> everything. I think you'll be pleasantly surprised at how painless it
> is.
> >
> > All that is done, fortunately. That part of it was never really a
> problem.
>
> Well, your original question was "I want to upgrade; any suggestions"?
> so I responded with suggestions. If you're already done the work... what
> are you actually asking?
>
> >> As for Cocoon upgrade suggestions, others have made those already in
> >> this thread. Honestly, if it were me, I'd upgrade Java/Tomcat first and
> >> make sure everything works, and then focus on upgrading Cocoon.
> >
> > If I upgrade manually to Tomcat 8 it's going to break all the directory
> > changes and control software setups that RH-based systems expect, which
> > will create work for my ops and my staff because it will be different
> > from all the other Tomcat servers around here. Unfortunately.
>
> I understand. You should petition CentOS to provide newer Tomcat
> versions. Amazon Linux's package repos (yum-based, RHEL-compatible) all
> support up to Tomcat 8. Supporting only up to Tomcat 6 is ... deeply
> disappointing.
>
> > It's a pity that Cocoon has strayed so far from its original task of
> > serving XML via XSLT. In fact it's not at all clear to me what problem
> > Cocoon 3 is intended to solve. At the moment it looks more like a
> > development playground or sandbox for Java architects (in itself a
> > valuable thing; I wish there were more of them) than a production
> > application solving a business or social requirement. It's basically way
> > too much Java and nowhere near enough XML.
>
> -chris
>
> -
> To unsubscribe, e-mail: users-unsubscr...@cocoon.apache.org

Re: Re: cocoon and cocoon-webapp together

2016-06-26 Thread gelo1234
Hello,

You have to use 3.0.0-beta-SNAPSHOT maven dependencies and all works
seamlessly.
I didn't have any problems building package (jar) and deploying to Tomcat.
Openshift shouldn't
have any issues either.

Btw. C3 development is stale now. Beta release hasn't been published
officially. Feel free to contribute.

Greetings,
Greg



2016-06-26 7:04 GMT+02:00 hansheinrichbraun <
hansheinrichbr...@yahoo.de.invalid>:

> 3.0.0-beta-1-SNAPSHOT thank you for yout quick reply which shows me there
> is still some life in cocoon.I am just testing another solution.bringing my
> private maven repository to openshift.And it worked already with my
> database dependency.So it seems that i can bring my local maven
> infrastructure to openshift it was a hazzle for me to bring these both
> together. i use cocoon as a rest service to produce pdf and emails maybe i
> will still meet some troubles with the rest function and with emails let's
> see
>
>
>
> Von meinem Samsung Galaxy Smartphone gesendet.
>
>  Ursprüngliche Nachricht 
> Von: warrell harries 
> Datum: 25.06.16 20:41 (GMT+01:00)
> An: users@cocoon.apache.org, Hans-Heinrich Braun <
> hansheinrichbr...@yahoo.de>
> Betreff: Re: cocoon and cocoon-webapp together
>
> What version of Cocoon? Use 2.12 and deploy the web app to Tomcat 7
>
> What's the problem with that?
>
> Best wishes
>
> Warrell
>
> On Sat, 25 Jun 2016, 17:58 Hans-Heinrich Braun,
>  wrote:
>
>> I am bringing my application to openshift.
>> It seems that i cannot integrate local dependencies in openshift.
>> So it try to make one maven project out of cocoon and cocoon-webapp.
>> But i didn't succeed after one day of trial.
>> Do somebody have an idea how to accomplish it,
>> Best regards
>> H.H.Braun
>>
>


Re: where to get cocoon 3.0.0-beta-1-SNAPSHOT

2016-02-08 Thread gelo1234
Hello Hans,

Have you tried official SVN and trunk? It's obviously what you want (
3.0.0-beta-1-SNAPSHOT):
http://svn.apache.org/viewvc/cocoon/cocoon3/trunk/pom.xml?view=markup

http://svn.apache.org/viewvc/cocoon/cocoon3/trunk/

Greetings,
Greg

2016-02-08 10:26 GMT+01:00 Hans-Heinrich Braun <hansheinrichbr...@yahoo.de>:

> I used cocoon 3.0.0-beta-1-SNAPSHOT for a Rest email distribution
> application starting with the emailpipeline Thorsten made for me.
> I want to change to a new system renewing all my java applications and saw
> i deleted the source 3.0.0-beta-1-SNAPSHOT and i cannot find in internet.
> Can you help me?
>
>
> --
> *Von:* gelo1234 <gelo1...@gmail.com>
> *An:* Cocoon Users <users@cocoon.apache.org>
> *Gesendet:* 11:31 Donnerstag, 7.Januar 2016
> *Betreff:* Re: Help needed moving from 2.1.11
>
> Hi,
>
> There is no need to configure it in any special way. All defaults are out
> of the box and are mostly sane (what every developer needs).
> C3 is considered to be more a RESTful framework not only a simple XML
> distribution system.
> Most sitemap.xmaps work ok.
>
> We have taken some steps into moving our app from 2.0.5dev to 3.0 and with
> some tweaking it worked fine! Check out the latest C3 snapshots from
> repository.
> There are sample artifacts for many-blocks and only one block
> configuration (simple web app).
>
> Greetings,
> Greg
>
>
> 2016-01-07 10:18 GMT+01:00 Flynn, Peter <pfl...@ucc.ie>:
>
> On 06/01/16 17:49, Mark H. Wood wrote:
> > When I first looked at Cocoon 3, I thought it was more like a return
> > to Cocoon's roots, clearing away a lot of stuff that had accumulated
> > and concentrating on the pipeline.
>
> I should have another look
>
> > It's quite true that, without intense study of what documentation
> > there is, it is very difficult to find any mention of how to configure
> > it with XML, but the XML configurator is still in there.
>
> Configuring it with XML would be useful (eg sitemap.xmap) but what I
> meant was that Cocoon primary task was (is?) to serve XML documents via
> XSLT as {text|xml|html|...}
>
>
> ///Peter
>
> -
> To unsubscribe, e-mail: users-unsubscr...@cocoon.apache.org
> For additional commands, e-mail: users-h...@cocoon.apache.org
>
>
>
>
>


Re: Possible Apache Cocoon trademark violation

2016-02-22 Thread gelo1234
Well, what relates to Cocoon, I have found a brand new baby called Cocoon:

https://cocoon.io/

Shall we not protect Apache Cocoon (R) (TM) ? :)

Greetings,
Greg


2016-02-22 13:08 GMT+01:00 Francesco Chicchiriccò :

> On 20/02/2016 23:38, Paul Foxworthy wrote:
>
>>
>> Hi,
>>
>> I thought I should tell you about this...
>>
>> A home 3D printer, the "Cocoon Create" is on the market in Australia. The
>> product is described on their website here:
>> http://www.cocooncreate.com.au . It's distributed by a company called
>> Winplus, and it was available at Aldi supermarkets last week.
>>
>> To my mind the style of the Cocoon Create logo is very similar to that of
>> the Apache Cocoon project. The "Cocoon" word is fairly generic and I doubt
>> you'd object to its use for a product that's not connected with Apache
>> Cocoon. The visual style is another matter. If the Project Management
>> Committee agrees, I suggest you ask Winplus to change the appearance of
>> their logo.
>>
>>
> Hi Paul,
> thanks for reporting.
>
> We will take this forward with the ASF legal team.
>
> Regards.
>
> --
> Francesco Chicchiriccò
>
> Tirasa - Open Source Excellence
> http://www.tirasa.net/
>
> Involved at The Apache Software Foundation:
> member, Syncope PMC chair, Cocoon PMC, Olingo PMC, CXF committer
> http://home.apache.org/~ilgrosso/
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@cocoon.apache.org
> For additional commands, e-mail: users-h...@cocoon.apache.org
>
>


Re: new mail archives interface

2016-05-18 Thread gelo1234
Well done! It's more readable now :)
Thanks.

Good Job!

Greetings,
-Greg

2016-05-19 4:24 GMT+02:00 David Crossley :

> At the recent ApacheCon conference, the new mail archives interface was
> unveiled.
>
> See https://lists.apache.org/
>
> See the mention at the weekly article "The Apache News Round-up"
> https://blogs.apache.org/foundation/entry/the_apache_news_round_up85
>
> -David
>
> -
> To unsubscribe, e-mail: users-unsubscr...@cocoon.apache.org
> For additional commands, e-mail: users-h...@cocoon.apache.org
>
>


Re: [2.1] cinclude using a pipeline as a generator source

2016-05-09 Thread gelo1234
Hello Chris,

>what would happen if I wanted to use a pipeline from
>a different sitemap in my URL? Something (conceptually) like this?
>
>Since I need to remove the "other-foo" to get this to work, how can I
>address it?

It depends on what version of Cocoon you are using.

If pre-block version, using // (two /) gets context from MAIN sitemap.xmap,
so you would have
to define match="other-foo" in the MAIN / context.

If you are using block version, you have to define a new block with Cocoon
and make a reference to this new block from the original one (connecting
two blocks).
Take a look at tutorials about Cocoon 2.2 blocks.
http://cocoon.apache.org/2.2/1291_1_1.html

Greetings,
Greg


2016-05-07 15:10 GMT+02:00 Christopher Schultz :

> Warrell,
>
> On 5/7/16 8:58 AM, Christopher Schultz wrote:
> > Warrell,
> >
> > Thanks for the quick reply!
> >
> > On 5/7/16 7:38 AM, warrell harries wrote:
> >> cocoon:// is understood as standard
> >
> > Awesome. I was hoping it would be something simple like that.
> >
> >> Use :/ to go relative to the root
> >
> > I'm having trouble configuring it properly, though.
> >
> > So, my original URL looks like this:
> >
> >> src="https://host/context/foo/bar/baz.html{$jsessionid}; />
> >
> > My sitemap is actually foo/sitemap.xmap, so it matches all the stuff in
> /foo
> >
> > When I change the URL to this:
> >
> >  
> >
> > I get this error:
> >
> > java.lang.RuntimeException: The current URI
> > (/foo/bar/baz.html;jsessionid=97079C2DC1E19B20F2BEB8303AECF74E) doesn't
> > start with given prefix (foo)
> >
> > If I remove the "extra" leading / :
> >
> >  
> >
> > I get this error:
> >
> > org.apache.cocoon.ResourceNotFoundException: No pipeline matched
> > request: foo/bar/baz.html;jsessionid=97079C2DC1E19B20F2BEB8303AECF74E
> >
> > If I use ./ like this:
> >
> >  
> >
> > I get this error:
> >
> > org.apache.cocoon.ResourceNotFoundException: No pipeline matched
> > request: ./foo/bar/baz.html;jsessionid=97079C2DC1E19B20F2BEB8303AECF74E
> >
> > I'm vry close. Just have to fix the speling, evidently ;)
>
> The last permutation ended up doing it:
>
>   
>
> So since the sitemap currently operating is "foo", the "foo" isn't
> necessary in the URL? This completely solves my problem but I have an
> academic question: what would happen if I wanted to use a pipeline from
> a different sitemap in my URL? Something (conceptually) like this?
>
>  
>
> Since I need to remove the "other-foo" to get this to work, how can I
> address it?
>
> Thanks,
> -chris
>
> >> On 7 May 2016 12:12, "Christopher Schultz" <
> ch...@christopherschultz.net
> >> > wrote:
> >>
> >> All,
> >>
> >> I've got a Cocoon setup with a pipeline whose transformer contains
> >> something like this:
> >>
> >>   https://my-app/get-some-data; />
> >>
> >> Now, the URL included there is actually coming from Cocoon, and
> actually
> >> I have a certificate that Java doesn't trust, so I get errors about
> PKI
> >> certification paths. I can "easily" solve that (and have been for
> some
> >> time, now) by specifying a truststore for the JVM process that
> contains
> >> my server's TLS certificate in it.
> >>
> >> I'd like to stop doing that for at least two reasons:
> >>
> >> 1. When my server certificate needs an update, I have to update my
> trust
> >> store and bounce Cocoon
> >> 2. It could be more efficient (no loopback HTTP request, no TLS
> >> handshake, etc.)
> >>
> >> Does cinclude understand Cocoon-relative paths?
> >>
> >> I'm looking for something like this:
> >>
> >>   
> >>
> >> Does something like that exist?
> >>
> >> Thanks,
> >> -chris
> >>
> >>
>  -
> >> To unsubscribe, e-mail: users-unsubscr...@cocoon.apache.org
> >> 
> >> For additional commands, e-mail: users-h...@cocoon.apache.org
> >> 
> >>
> >
> > -
> > To unsubscribe, e-mail: users-unsubscr...@cocoon.apache.org
> > For additional commands, e-mail: users-h...@cocoon.apache.org
> >
>
> -
> To unsubscribe, e-mail: users-unsubscr...@cocoon.apache.org
> For additional commands, e-mail: users-h...@cocoon.apache.org
>
>


Re: Cocoon 3 sitemap setup

2016-08-24 Thread gelo1234
Hi,

AFAIK there is no more direct sitemap mounting in C3. You have to make a
separate C3 module/block and "mount"/assign a context to it.
Then you can connect 2 or more Cocoon blocks together in order to share
some common servlet or functionality.

Take a look at Cocoon samples:
https://github.com/ilgrosso/cocoon3EmptyProject/tree/COCOON3-105

Greetings,
Greg

24.08.2016 13:21 "Artur Synowiec"  napisał(a):

> Hello,
>
> I need some help with setting up Cocoon 3 sitemap.
>
> I have used Cocoon 2.1 and 2.2 in the past and enjoyed the simplicity of
> the XML transformation
> using sitemap language.
>
> Now I would like to get a hand of Cocoon 3. I've successfully managed to
> integrate
> C3 pipeline processor with other Java applications (based on Spring Boot)
> but
> I would love to make it work again with sitemap. I can see a few examples
> on the web
> of people using C3 inside their apps but couldn't see any example of
> mounting a sitemap.xmap
>
> Ideally I would like to integrate it with a Spring Boot app and
> mount XMLSitemapServlet in there.
> I have managed to do it using a class implementing Spring's
> ServletContextInitializer but I'm getting this exception:
>
> java.lang.IllegalStateException: Received closing 'match' but there was
> no node to close.
> I think it could be something to do with creating a Spring bean
> of org.apache.cocoon.sitemap.node.SitemapNode/sitemap
> which is needed for SitemapNodeFactory's createNode() method.
>
> I would appreciate any help on this.
>
> Regards,
> Artur
>
>


Re: Re: Using absolute adresses in sitemap

2016-11-27 Thread gelo1234
Hello Hans,

You should try resolve absolute addresses within servlet or Java code, not
within sitemap. We define absolute addresses in sitemap as a map parameter
only in order to be resolved when Java code is being executed.. That is the
only way to get outside the cocoon context. As you know context:// always
points to ROOT directory _relative_ to current web context (webapp/context)
/ deployed JAR.

Greetings,
Greg

2016-11-28 8:01 GMT+01:00 hansheinrichbraun <
hansheinrichbr...@yahoo.de.invalid>:

> yes absolute adresses inside a jar are tried to be solved relative to the
> jars root
>
>
>
> Von meinem Samsung Galaxy Smartphone gesendet.
>
>  Ursprüngliche Nachricht 
> Von: Francesco Chicchiriccò 
> Datum: 26.11.16 12:32 (GMT+01:00)
> An: users@cocoon.apache.org
> Betreff: Re: Using absolute adresses in sitemap
>
> On 26/11/2016 10:23, hansheinrichbraun wrote:
> >
> > how can i use absolute adresses in the sitemap in cocoon 3.0
> > for example in src
>
> What do you mean exactly?
>
> --
> Francesco Chicchiriccò
>
> Tirasa - Open Source Excellence
> http://www.tirasa.net/
>
> Member at The Apache Software Foundation
> Syncope, Cocoon, Olingo, CXF, OpenJPA, PonyMail
> http://home.apache.org/~ilgrosso/
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@cocoon.apache.org
> For additional commands, e-mail: users-h...@cocoon.apache.org
>
>


Re: [2.1] Overzealous escaping of high Unicode code points

2017-06-21 Thread gelo1234
Hi Chris,

I suppose you cannot use 2 different encodings in 1 Serializer, so if you
changed
your Serializer config to be UTF16, you also have to use _external_ UTF16
encoded
CSS styles. Of couse you can define many different Serializer configs per
each pipeline.

By default common-lang/cocoon uses 2-byte char sequence as encoding base.
If you had UTF-8 and 32 bits, you would have 4 chars (each 8 bits), encoded
as 1 PAIR 2-bytes sequence.
if you switched to UTF-16, you would have 2 chars (each 16 bits), encoded
as 1 SINGLE 4-bytes sequence.

Greetings,
Greg


2017-06-20 22:14 GMT+02:00 Christopher Schultz <ch...@christopherschultz.net
>:

> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA256
>
> Greg,
>
> On 6/20/17 4:11 PM, Christopher Schultz wrote:
> > Greg,
> >
> > On 6/8/17 2:17 PM, gelo1234 wrote:
> >> Chris,
> >
> >> Even with C3 (cocoon 3.0 beta) unless you specify optional
> >> encoding in your Serializer config, you fallback to default
> >> UTF-8:
> >
> >> org.apache.cocoon.optional.servlet.components.sax.serializers.util
> >
> >>  public class ConfigurationUtils {
> >
> >> private ConfigurationUtils() { }
> >
> >> public static String getEncoding(Map<String, ? extends Object>
> >> configuration) { String encoding = (String)
> >> configuration.get("encoding");
> >
> >> if (encoding == null || "".equals(encoding)) { encoding =
> >> "UTF-8"; }
> >
> >> return encoding; } ...
> >
> > I would have expected the Unicode codepoint to be converted into a
> > single 4-byte UTF-8 byte without any &-encoding at all. It looks
> > like what I got was a pair of 2-byte characters with &-encoding.
> >
> > I'll try UTF-16 but my expectation is that it's going to get
> > worse, not better.
>
> Interestingly enough, my emojis are now showing (which I don't totally
> understand why!) but it looks like my CSS aren't being loaded. That's
> a separate problem I'll have to figure out for myself.
>
> In my own application, switching from commons-lang to commans-lang3
> HTML/XML escaping allowed me to use these 4-byte emojis and UTF-8
> together. I'm surprised that Cocoon can't do the same thing. (I think
> it comes down to exactly how the character-escaper makes its decisions).
>
> Thanks,
> - -chris
> -BEGIN PGP SIGNATURE-
> Comment: GPGTools - http://gpgtools.org
> Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/
>
> iQIzBAEBCAAdFiEEMmKgYcQvxMe7tcJcHPApP6U8pFgFAllJgiwACgkQHPApP6U8
> pFgJkRAAqiXn7DWNDN41m1V98aI5xWjTuoka0tKcadN1IUGemTZwipaXHtYQcois
> 6yuI3st31ZuanghIpRPcBu9pZzuHtOSBVSHZSIhDGqPwYgczScQ2LgnfMi6zwAdd
> j2LFlSWtKGjgCczV5Ok56PyMq1BEAOVw96vmF5xfXmpLAyNA/PvLKsncoW4pN+ES
> 1MQMm1aPwbmEpWz7ykReUzfauwBtL4rEX1wO3pl88m9Wq3x174AKHWs/a+4Z1Hdq
> 0CnxfrdTK50p7Ng+ECfnPwx8y1Em64lA7KKMuz2jTd0PnxlpZTAgO6lq8S7BdSeY
> H1lwBJojVT/+m2w8b9OC/XoyiAyiC/zIswQ3TSMA3ZC2SnCxxAXMTsmT49Ql+lyq
> 01JRCIVMitKeoKI4I4066oaBW91FpSSpZXX14XCHrMBtKnIJI+NxBnI++eQq8wdi
> ZdX3GzLF2zaPHvZMSz4DRskR1xKGLsAxZAukINW3AGrEAZ/GwbPd76ml3YJam5Yy
> R31u0kcRJl4z79pd1n46yxB66V10Rn5IkSMQ8R7uK/ht9wLi5T8bkeAoLjZFFoyq
> awmfQTbJzquXAtwjX99WKWEzviN2ph+P0h2rBInHnos5ud8IlLjcS7FmdxQ4DNOw
> Nirmj7cikxcr2Fn22pGQh6o3/Eph0lMf1d1HjUZ1C7SchEgsqrk=
> =0nTd
> -END PGP SIGNATURE-
>
> -
> To unsubscribe, e-mail: users-unsubscr...@cocoon.apache.org
> For additional commands, e-mail: users-h...@cocoon.apache.org
>
>


Re: [2.1] Overzealous escaping of high Unicode code points

2017-06-08 Thread gelo1234
Chris,

Even with C3 (cocoon 3.0 beta) unless you specify optional encoding in your
Serializer config, you fallback to default UTF-8:

org.apache.cocoon.optional.servlet.components.sax.serializers.util

public class ConfigurationUtils {

private ConfigurationUtils() {
}

public static String getEncoding(Map<String, ? extends Object>
configuration) {
String encoding = (String) configuration.get("encoding");

if (encoding == null || "".equals(encoding)) {
encoding = "UTF-8";
}

return encoding;
}
...

Greetings,
Greg


2017-06-08 20:11 GMT+02:00 gelo1234 <gelo1...@gmail.com>:

>
> It depends on what type of Serializer you use and what kind of Serlializer
> config you put into your sitemap?
>
> By default XMLSerializer/HTMLSerializer uses UTF-8 encoding. So instead of
> 1 UTF-16 char you got 2 chars UTF-8 encoded.
> Of cource there might be also issue with emoji charset, but I would first
> try to change encoding in Serliazer config (to be UTF-16).
>
> Greetings,
> -Greg
>
> 2017-06-07 10:43 GMT+02:00 Flynn, Peter <pfl...@ucc.ie>:
>
>> I had a related problem with 3–4 CJK characters being converted to their
>> 
<

Re: [2.1] Overzealous escaping of high Unicode code points

2017-06-08 Thread gelo1234
It depends on what type of Serializer you use and what kind of Serlializer
config you put into your sitemap?

By default XMLSerializer/HTMLSerializer uses UTF-8 encoding. So instead of
1 UTF-16 char you got 2 chars UTF-8 encoded.
Of cource there might be also issue with emoji charset, but I would first
try to change encoding in Serliazer config (to be UTF-16).

Greetings,
-Greg

2017-06-07 10:43 GMT+02:00 Flynn, Peter :

> I had a related problem with 3–4 CJK characters being converted to their
> 

Re: Migrating cocoon 2.1 project to 2.2

2018-10-04 Thread gelo1234
Hello Senthilkumar,

I think we have the 2-factor based problem here.

1 is that you use Xalan instead of Saxon in your Pipeline (error log shows
xalan package info not saxon)

2. is that it might adhere to Saxon version that you use. Old Saxon had
many features that new Saxon does NOT have unless you buy a license :)
Checkout different Saxon versions: http://saxon.sourceforge.net/

Old Saxon had many very nice features that now are only available  in
Saxon_PE/EE e.g. Saxon extensions (Java xsl support, etc.).

I suppose tokenize was out for some reason and only available in PE/EE? But
I might be wrong. Just a suggestion to take into account while hitting
against the wall.
Tokenize was part of xslt2.0, not xslt1.0 which is default for xalan in
default Cocoon config.

Greetings,
Greg


Re: Compatibility check

2018-09-11 Thread gelo1234
Tomcat9 and Java8 works fine with C3.0beta. Never tried C2.1.x

Greetings,
Greg



wt., 11 wrz 2018 o 11:24 Cédric Damioli  napisał(a):

> Hi,
>
> We use Cocoon 2.1.12 with Java 8 in production for years without any
> problems. Never tried Tomcat 9 yet, but any other versions worked well
> also, inclufind 8 and 8.5.
> No dependencies with OS as well.
>
> Regards,
> Cédric
>
> Le 11/09/2018 à 08:20, Thangavel, Senthil Kumar (LNG-CON) a écrit :
>
> HI,
>
> I am currently using Cocoon version 2.1. And I am planning to upgrade the
> tomcat container version to “9.0.11” and java version to 1.8. Will the
> Cocoon 2.1 version is compatible with the higher version of tomcat and
> java. Also does it have any dependency with OS? Please provide the expert
> advice.
>
>
>
> Regards,
>
> Senthilkumar.T
>
>
> --
> Cédric Damioli
> CMS - Java - Open Sourcewww.ametys.org
>
>


Re: Cocoon java function call Byte code verification failed

2019-02-05 Thread gelo1234
Hello Senthilkumar,

The problem is related to String Pool implementation that has changed in
the Java 8 spec. I suppose you were running the previous Java release (7,
6?) and switched now to Java 8?
Unfortunately you cannot use Java8 with the current Cocoon 2.1.11 stack
unless you change the Java compiler underneath or write your own
Classloader code to be compliant with the new String Pool
implementation used by Java8. The EASIEST way is to replace the current
Java compiler with NATIVE Java8 javac compiler inside Cocoon stack :) It
helped us get our Application "UNTOUCHED" onto Java 8 successfully :)

HERE is how:
1. Just look for "Programming languages" in WEB-INF/cocoon.xconf (old
config from Cocoon before Spring - from Avalon framework)


  

  
  
  

  
  






You have 3 options:
1. Standard Javac
2. Pizza (open source)
3. Jikes from IBM

We tried Pizza but without success, that is why we switched to Oracle Javac
- just drop down: tools.jar (from standard Java SDK) into
WEB-INF/lib and Java8 support is added :) No fuss no sweat :)

Greetings,
Greg


wt., 5 lut 2019 o 06:06 Thangavel, Senthil Kumar (LNG-CON)
 napisał(a):

> HI,
>
> I am currently running in to the below issue while executing my cocoon
> based web app.
>
> I use cocoon 2.1.11 version, Tomcat 9 and Java 8.
>
>
>
> Could some one help me in identifying the problem and possible fix. Thanks
> in advance.
>
>
>
> Caused by: org.apache.bcel.verifier.exc.StructuralCodeConstraintException: 
> Instruction GETFIELD constraint violated: Class 'java.lang.String' is 
> referenced, but cannot be loaded and resolved: 'VERIFIED_REJECTED
>
> full exception chain stacktrace
>
> org.apache.cocoon.ProcessingException: Sitemap: error calling function 
> 'idCheck'
>
> at  - 
> file:/C:/Users/IYAMPEAX/Desktop/LN/apache-tomcat-9.0.11/webapps/ROOT/tabula-rasa/sitemap.xmap:1463:34
>
> at  - 
> file:/C:/Users/IYAMPEAX/Desktop/LN/apache-tomcat-9.0.11/webapps/ROOT/tabula-rasa/sitemap.xmap:1479:32
>
> at  - 
> file:/C:/Users/IYAMPEAX/Desktop/LN/apache-tomcat-9.0.11/webapps/ROOT/tabula-rasa/sitemap.xmap:1146:34
>
> at  - 
> file:/C:/Users/IYAMPEAX/Desktop/LN/apache-tomcat-9.0.11/webapps/ROOT/tabula-rasa/sitemap.xmap:1141:67
>
> at  - 
> file:/C:/Users/IYAMPEAX/Desktop/LN/apache-tomcat-9.0.11/webapps/ROOT/sitemap.xmap:692:121
>
> at 
> org.apache.cocoon.ProcessingException.throwLocated(ProcessingException.java:113)
>
> at 
> org.apache.cocoon.components.treeprocessor.sitemap.CallFunctionNode.invoke(CallFunctionNode.java:141)
>
> at 
> org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:47)
>
> at 
> org.apache.cocoon.components.treeprocessor.sitemap.MatchNode.invoke(MatchNode.java:108)
>
> at 
> org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:69)
>
> at 
> org.apache.cocoon.components.treeprocessor.sitemap.PipelineNode.invoke(PipelineNode.java:143)
>
> at 
> org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:69)
>
> at 
> org.apache.cocoon.components.treeprocessor.sitemap.PipelinesNode.invoke(PipelinesNode.java:93)
>
> at 
> org.apache.cocoon.components.treeprocessor.ConcreteTreeProcessor.process(ConcreteTreeProcessor.java:235)
>
> at 
> org.apache.cocoon.components.treeprocessor.ConcreteTreeProcessor.buildPipeline(ConcreteTreeProcessor.java:193)
>
> at 
> org.apache.cocoon.components.source.impl.SitemapSource.init(SitemapSource.java:333)
>
> at 
> org.apache.cocoon.components.source.impl.SitemapSource.(SitemapSource.java:215)
>
> at 
> org.apache.cocoon.components.source.impl.SitemapSourceFactory.getSource(SitemapSourceFactory.java:68)
>
> at 
> org.apache.excalibur.source.impl.SourceResolverImpl.resolveURI(SourceResolverImpl.java:208)
>
> at 
> org.apache.cocoon.components.CocoonComponentManager.resolveURI(CocoonComponentManager.java:558)
>
> at 
> org.apache.cocoon.components.CocoonComponentManager.resolveURI(CocoonComponentManager.java:558)
>
> at 
> org.apache.cocoon.components.CocoonComponentManager.resolveURI(CocoonComponentManager.java:558)
>
> at 
> org.apache.cocoon.environment.AbstractEnvironment.resolveURI(AbstractEnvironment.java:554)
>
> at 
> org.apache.cocoon.environment.AbstractEnvironment.resolveURI(AbstractEnvironment.java:541)
>
> at 
> org.apache.cocoon.environment.wrapper.MutableEnvironmentFacade.resolveURI(MutableEnvironmentFacade.java:299)
>
> at 
> org.apache.cocoon.sitemap.ContentAggregator.setup(ContentAggregator.java:290)
>
> at 
> 

Re: Cocoon java function call Byte code verification failed

2019-02-05 Thread gelo1234
Hello,

What strikes me the most is the fact that old Cocoon 2.x works fine
(flawlessly) with OpenJDK 8 implementation :) It was a total shock!! for
us. Even though
you can't tell it is absolutely 100% compliant (someone should be writing
TCK for this), you still find Java revision to be 1.0!!! in byte-code
compiler recognition.
So it is actually running Java 1.0 not 8 if you want Cocoon to compile your
JSP/XSP pages :) - If you want to use java byte-compiling process by Cocoon
Engine (e.g. XSP)
Why?  Because there is a Cocoon-own implementation of Java Compiler
_HEADER_ which uses first revisions of Javac spec 1.0 spec :)   - very
SIMPLE javac implementation

setCookie_xsp.class: compiled Java class data, version 45.3(looks like
Java 1.0.2 from Sun:)
https://ldapwiki.com/wiki/Java%20Versions%20And%20Running%20Programs

Although if you compile your Java classes with standard Javac 8 Compiler
and place them into WEB-INF/lib (.jar) or WEB-INF/classes
you get the LATEST FULL version:
Config.class: compiled Java class data, version 52.0 (Java 1.8)

Unfortunately all those "beauties" were thrown out in the Cocoon3.0 :(
(even Cocoon 2.x doesn't have that kind of FLEXIBILITY and
interchangability of Java Compilers).
New releases were trimmed down to have only neccessary basic blocks of
functionality, but as you see OLD Cocoon can suprise everybody with its
"modern vision of PREDICTABLE
future requirements". And that is absolutely AWESOME! Brilliant!!! I'm so
disappointed that Continuations were thrown out as well as Jasper Engine 1
(JSP) that cannot inject its own code into "compilation Unit" - that is why
XSP is no longer supported. The programmers believed it was too COMPLICATED
to further manage that kind of Code. Jasper Engine 2 is also very small and
trimmed down to be as small as possible. Maybe it's right, but for some
reasons this might be a flaw in the Palette of available tools.

With the 1990's technology and software we could make our Computers fly to
the Moon and even beyond. With the current technology stack we cannot leave
the Earth Surface ;)
We made our Life simpler and more comfortable but in my opinion we lost
some bigger picture of what important is when it comes to Software.
Maybe I'm old protagonist yet a stubborn Backer of Simplicity in the World
(after da Vinci) but this trend to slim down every single piece of
component will head us into Lemmings world,
where every one of us is a hard working specie to achieve something that
could be achieved long long before the Computers were born, easier, faster
and wiser :)

But there is at least one good sign on the Horizon. Not everything is going
commercial and not everything Open-Source is getting slimmed down (for
addons you have to pay!).
If you take into the consideration that future Oracle Java updates/releases
will be commercial/paid only via subscriptions :( most of Open-Source World
is switching to OpenJDK now :)

Greetings,
Greg



wt., 5 lut 2019 o 11:56 gelo1234  napisał(a):

> Hello Senthilkumar,
>
> The problem is related to String Pool implementation that has changed in
> the Java 8 spec. I suppose you were running the previous Java release (7,
> 6?) and switched now to Java 8?
> Unfortunately you cannot use Java8 with the current Cocoon 2.1.11 stack
> unless you change the Java compiler underneath or write your own
> Classloader code to be compliant with the new String Pool
> implementation used by Java8. The EASIEST way is to replace the current
> Java compiler with NATIVE Java8 javac compiler inside Cocoon stack :) It
> helped us get our Application "UNTOUCHED" onto Java 8 successfully :)
>
> HERE is how:
> 1. Just look for "Programming languages" in WEB-INF/cocoon.xconf (old
> config from Cocoon before Spring - from Avalon framework)
>
> 
>   
> 
>   
>   
>value="org.apache.cocoon.components.classloader.ClassLoaderManagerImpl"/>
>
>   
>value="org.apache.cocoon.components.language.programming.java.Javac"/>
> 
>
> 
> 
> 
>
> You have 3 options:
> 1. Standard Javac
> 2. Pizza (open source)
> 3. Jikes from IBM
>
> We tried Pizza but without success, that is why we switched to Oracle
> Javac - just drop down: tools.jar (from standard Java SDK) into
> WEB-INF/lib and Java8 support is added :) No fuss no sweat :)
>
> Greetings,
> Greg
>
>
> wt., 5 lut 2019 o 06:06 Thangavel, Senthil Kumar (LNG-CON)
>  napisał(a):
>
>> HI,
>>
>> I am currently running in to the below issue while executing my cocoon
>> based web app.
>>
>> I use cocoon 2.1.11 version, Tomcat 9 and Java 8.
>>
>>
>>
>> Could some one help me in identifying the problem and possible fix.
>> Thanks in advance.
>>
>>
>>
>> Ca

Re: How to configure TraxProcessor in 2.2?

2019-12-09 Thread gelo1234
Mark,

Why do you need a Custom XSLT Processor other than Saxon actually?? Saxon
should do the right thing. Why wrapping it inside any "upper-level"
Transformer? It's getting kinda weird. You can always add a new Java class
to standard Cocoon Processors/Transformers.

https://mrhaki.blogspot.com/2008/09/use-saxon-in-cocoon-22.html

Greetings,
Greg


pon., 9 gru 2019 o 23:02 Mark H. Wood  napisał(a):

> On Thu, Dec 05, 2019 at 04:13:08PM +0100, Javier Puerto wrote:
> > I recommend you to use the Spring configuration. I never had this
> > requirement before but by the error message and the configuration
> fragment
> > that you have sent the NPE is caused because you are not passing an
> > instance of "org.dspace.saxon.ConfigurableTransformerFactory", you are
> > passing a String instead.
> >
> >  > value='org.dspace.saxon.ConfigurableTransformerFactory'/>
> >
> > IIRC you should change it to:
> > 
> >   
> > 
> >
> > The attribute "value" is for literal values. You can also define the bean
> > with an ID and then use the attribute "ref" with the ID of the bean.
> > I hope that helps.
>
> It would have made more sense for this to take a bean reference, but
> the Javadoc for TraxProcessor says that setTransformerFactory() takes
> a String argument.  That seems to be correct:  when I change it to a
> reference, I get:
>
> 09-Dec-2019 15:12:39.128 SEVERE [localhost-startStop-24]
> org.apache.catalina.cor
> e.StandardContext.listenerStart Exception sending context initialized
> event to l
> istener instance of class
> [org.springframework.web.context.ContextLoaderListener
> ]
> org.springframework.beans.factory.BeanCreationException: Error
> creating
> bean with name 'org.apache.excalibur.xml.xslt.XSLTProcessor/saxon' defined
> in Se
> rvletContext resource [/WEB-INF/spring/applicationContext.xml]:
> Initialization o
> f bean failed; nested exception is
> org.springframework.beans.ConversionNotSuppor
> tedException: Failed to convert property value of type
> 'org.dspace.saxon.Configu
> rableTransformerFactory' to required type 'java.lang.String' for property
> 'trans
> formerFactory'; nested exception is java.lang.IllegalStateException:
> Cannot conv
> ert value of type [org.dspace.saxon.ConfigurableTransformerFactory] to
> required
> type [java.lang.String] for property 'transformerFactory': no matching
> editors o
> r conversion strategy found
>
> When I change it back to the literal name of the class, the
> webapp. starts normally.  But it still errors out when it tries to run
> the XSLT transformer.
>
> It begins to look as though one can't really wire up TraxProcessor
> using Spring.  (By this I mean:  using Spring's normal 
>  etc.)  I'm guessing that it blows up because nothing has
> called #parameterize(Parameters), because #parameterize() knows how
> the properties must be set up and makes sure they are all sensible,
> and thus something was left unset.
>
> I tried adding
>
>   log4j.logger.org.apache.excalibur = DEBUG
>   log4j.logger.org.apache.avalon = DEBUG
>
> to our logging config. but it made no useful difference in the
> output.  I cannot see what paths are actually being consulted for
> Cocoon component configuration, but it seems that none of the places
> I've put my .xconf is one of them.
>
> > El mié., 4 dic. 2019 a las 22:46, Mark H. Wood ()
> escribió:
> >
> > > I'm using Cocoon 2.2.  I need to pass a custom XSLT transformer
> > > factory (that wraps Saxon's to configure it) to TraxProcessor, and the
> > > advice I've found in several places around the Web doesn't seem to be
> > > working:  my factory class never gets instantiated.
> > >
> > > I've got a file META-INF/cocoon/avalon/cocoon-core-saxon-xslt.xconf:
> > >
> > > 
> > > 
> > >> > class="org.apache.cocoon.components.xslt.TraxProcessor">
> > > 
> > >  > >
> value="org.dspace.saxon.ConfigurableTransformerFactory"/>
> > >   
> > > 
> > >
> > > I also tried copying it to WEB-INF/cocoon and it didnt' seem to work
> > > there either.
> > >
> > > I do have  and  in the Spring
> > > config.
> > >
> > > Is there some way to debug component configuration and see if the file
> > > is even being looked for (and where *is* configuration looking)?  The
> > > Cocoon site directs me to Excalibur, which directs me to Avalon, which
> > > says that Avalon is wound up and directs me back to Excalibur
> > >
> > >
> > >
> > > I've also tried to configure the thing using Spring:
> > >
> > >  > >   class='org.apache.cocoon.components.xslt.TraxProcessor'
> > >   init-method='initialize'
> > >   destroy-method='dispose'>
> > >   
> > >> >
>  value='org.dspace.saxon.ConfigurableTransformerFactory'/>
> > > 
> > >
> > > but so far I'm missing something:  TraxProcessor.sourceToSAX throws an
> > > NPE.  I'm probably not setting the parameters correctly -- there isn't
> > > a setter for use-store at all, for example.
> > >
> > > I've found any number of pages that tell me 

Re: How to configure TraxProcessor in 2.2?

2019-12-10 Thread gelo1234
Hi Mark,

I don't think this is the proper way to do this and if it's possible at
all. Extension functions are only available in commercial releases of Saxon
(PE and EE).
I'm afraid they are not available in open-source Saxon-HE. We were trying
to use Saxon-HE with Cocoon 3.0 and extension-functions without success.
You either have to use OLDER release of Saxon or pay for the license. I
know it's sad. I used to "such stupidites" since Oracle stopped releasing
free JDK :(
Hopefully we got OpenJDK.

Greetings,
Greg



wt., 10 gru 2019 o 21:19 Mark H. Wood  napisał(a):

> On Tue, Dec 10, 2019 at 12:10:41AM +0100, gelo1234 wrote:
> > Mark,
> >
> > Why do you need a Custom XSLT Processor other than Saxon actually?? Saxon
> > should do the right thing. Why wrapping it inside any "upper-level"
> > Transformer? It's getting kinda weird. You can always add a new Java
> class
> > to standard Cocoon Processors/Transformers.
>
> Because, as I said, I need to configure Saxon, and Saxon-HE can only
> be configured programmatically.  So, if I want to register an
> Integrated Extension Function, I have to gain access to the
> TransformerFactory being created somewhere in the bowels of Cocoon,
> get its Configuration, and call #registerExtensionFunction on that.
>
> To do this, I've created a class which extends TransformerFactoryImpl,
> added a @PostConstruct method (which Spring should call after
> instantiating the bean) to do the registration, and now I'm trying to
> tell Cocoon to use my factory instead of the one that
> javax.xml.transform.TransformerFactory will conjure up by default out
> of the service provider framework when Saxon is present.
>
> > https://mrhaki.blogspot.com/2008/09/use-saxon-in-cocoon-22.html
>
> I've seen that.  So far it hasn't helped.
>
> > Greetings,
> > Greg
> >
> >
> > pon., 9 gru 2019 o 23:02 Mark H. Wood  napisał(a):
> >
> > > On Thu, Dec 05, 2019 at 04:13:08PM +0100, Javier Puerto wrote:
> > > > I recommend you to use the Spring configuration. I never had this
> > > > requirement before but by the error message and the configuration
> > > fragment
> > > > that you have sent the NPE is caused because you are not passing an
> > > > instance of "org.dspace.saxon.ConfigurableTransformerFactory", you
> are
> > > > passing a String instead.
> > > >
> > > >  > > >
>  value='org.dspace.saxon.ConfigurableTransformerFactory'/>
> > > >
> > > > IIRC you should change it to:
> > > > 
> > > >   
> > > > 
> > > >
> > > > The attribute "value" is for literal values. You can also define the
> bean
> > > > with an ID and then use the attribute "ref" with the ID of the bean.
> > > > I hope that helps.
> > >
> > > It would have made more sense for this to take a bean reference, but
> > > the Javadoc for TraxProcessor says that setTransformerFactory() takes
> > > a String argument.  That seems to be correct:  when I change it to a
> > > reference, I get:
> > >
> > > 09-Dec-2019 15:12:39.128 SEVERE [localhost-startStop-24]
> > > org.apache.catalina.cor
> > > e.StandardContext.listenerStart Exception sending context initialized
> > > event to l
> > > istener instance of class
> > > [org.springframework.web.context.ContextLoaderListener
> > > ]
> > > org.springframework.beans.factory.BeanCreationException: Error
> > > creating
> > > bean with name 'org.apache.excalibur.xml.xslt.XSLTProcessor/saxon'
> defined
> > > in Se
> > > rvletContext resource [/WEB-INF/spring/applicationContext.xml]:
> > > Initialization o
> > > f bean failed; nested exception is
> > > org.springframework.beans.ConversionNotSuppor
> > > tedException: Failed to convert property value of type
> > > 'org.dspace.saxon.Configu
> > > rableTransformerFactory' to required type 'java.lang.String' for
> property
> > > 'trans
> > > formerFactory'; nested exception is java.lang.IllegalStateException:
> > > Cannot conv
> > > ert value of type [org.dspace.saxon.ConfigurableTransformerFactory] to
> > > required
> > > type [java.lang.String] for property 'transformerFactory': no matching
> > > editors o
> > > r conversion strategy found
> > >
> > > When I change it back to the literal name of the class, the
> > > webapp. starts normally.  But it still errors out when it tries to run
> > > the XSLT transformer.

Re: How to configure TraxProcessor in 2.2?

2019-12-11 Thread gelo1234
Wow, you Haka-Smart guy :) No need for a Saxon commercial licence anymore
with Saxon-HE :)
That was what we missed with new Saxon-HE :) Thanks! Good Job!
With C3 (Cocoon 3.0) you can use Java-only code with no cocoon-sitemap
config dependency :)

Such a little thing and I get a big smile on my mouth :)
Man, you made my day!!!

Greetings,
Greg



śr., 11 gru 2019 o 14:59 Mark H. Wood  napisał(a):

> On Tue, Dec 10, 2019 at 11:21:09PM +0100, gelo1234 wrote:
> > I don't think this is the proper way to do this and if it's possible at
> > all. Extension functions are only available in commercial releases of
> Saxon
> > (PE and EE).
> > I'm afraid they are not available in open-source Saxon-HE. We were trying
> > to use Saxon-HE with Cocoon 3.0 and extension-functions without success.
> > You either have to use OLDER release of Saxon or pay for the license.
>
> No.  Before trying this in Cocoon, I wrote a tiny test application,
> and it succeeded in defining integrated extension functions.
>
> https://github.com/mwoodiupui/confman-demo
>
> What one cannot do in Saxon-HE is register integrated extension
> functions using a configuration file, as one can in -PE or -EE.  This
> is why I need to do configuration in Java.
>
> > wt., 10 gru 2019 o 21:19 Mark H. Wood  napisał(a):
> >
> > > On Tue, Dec 10, 2019 at 12:10:41AM +0100, gelo1234 wrote:
> > > > Mark,
> > > >
> > > > Why do you need a Custom XSLT Processor other than Saxon actually??
> Saxon
> > > > should do the right thing. Why wrapping it inside any "upper-level"
> > > > Transformer? It's getting kinda weird. You can always add a new Java
> > > class
> > > > to standard Cocoon Processors/Transformers.
> > >
> > > Because, as I said, I need to configure Saxon, and Saxon-HE can only
> > > be configured programmatically.  So, if I want to register an
> > > Integrated Extension Function, I have to gain access to the
> > > TransformerFactory being created somewhere in the bowels of Cocoon,
> > > get its Configuration, and call #registerExtensionFunction on that.
> > >
> > > To do this, I've created a class which extends TransformerFactoryImpl,
> > > added a @PostConstruct method (which Spring should call after
> > > instantiating the bean) to do the registration, and now I'm trying to
> > > tell Cocoon to use my factory instead of the one that
> > > javax.xml.transform.TransformerFactory will conjure up by default out
> > > of the service provider framework when Saxon is present.
> > >
> > > > https://mrhaki.blogspot.com/2008/09/use-saxon-in-cocoon-22.html
> > >
> > > I've seen that.  So far it hasn't helped.
> > >
> > > > Greetings,
> > > > Greg
> > > >
> > > >
> > > > pon., 9 gru 2019 o 23:02 Mark H. Wood  napisał(a):
> > > >
> > > > > On Thu, Dec 05, 2019 at 04:13:08PM +0100, Javier Puerto wrote:
> > > > > > I recommend you to use the Spring configuration. I never had this
> > > > > > requirement before but by the error message and the configuration
> > > > > fragment
> > > > > > that you have sent the NPE is caused because you are not passing
> an
> > > > > > instance of "org.dspace.saxon.ConfigurableTransformerFactory",
> you
> > > are
> > > > > > passing a String instead.
> > > > > >
> > > > > >  > > > > >
> > >  value='org.dspace.saxon.ConfigurableTransformerFactory'/>
> > > > > >
> > > > > > IIRC you should change it to:
> > > > > > 
> > > > > >   
> > > > > > 
> > > > > >
> > > > > > The attribute "value" is for literal values. You can also define
> the
> > > bean
> > > > > > with an ID and then use the attribute "ref" with the ID of the
> bean.
> > > > > > I hope that helps.
> > > > >
> > > > > It would have made more sense for this to take a bean reference,
> but
> > > > > the Javadoc for TraxProcessor says that setTransformerFactory()
> takes
> > > > > a String argument.  That seems to be correct:  when I change it to
> a
> > > > > reference, I get:
> > > > >
> > > > > 09-Dec-2019 15:12:39.128 SEVERE [localhost-startStop-24]
> > > > > org.apache.catalina.cor
> &g

Re: How to configure TraxProcessor in 2.2?

2019-12-06 Thread gelo1234
Hi Mark,

Also make sure, you have that class:
org.dspace.saxon.ConfigurableTransformerFactory available on the CLASSPATH
(-> WEB-INF/lib/*.jar)
And a proper version/config for Saxon HE. Here is the guide:
https://stackoverflow.com/questions/22483436/using-saxon9-for-xslt-with-apache-cocoon-2-2

Greetings,
Greg


czw., 5 gru 2019 o 16:13 Javier Puerto  napisał(a):

> Hi Mark,
>
> I recommend you to use the Spring configuration. I never had this
> requirement before but by the error message and the configuration fragment
> that you have sent the NPE is caused because you are not passing an
> instance of "org.dspace.saxon.ConfigurableTransformerFactory", you are
> passing a String instead.
>
>  value='org.dspace.saxon.ConfigurableTransformerFactory'/>
>
> IIRC you should change it to:
> 
>   
> 
>
> The attribute "value" is for literal values. You can also define the bean
> with an ID and then use the attribute "ref" with the ID of the bean.
> I hope that helps.
>
> Salu2.
>
> El mié., 4 dic. 2019 a las 22:46, Mark H. Wood ()
> escribió:
>
>> I'm using Cocoon 2.2.  I need to pass a custom XSLT transformer
>> factory (that wraps Saxon's to configure it) to TraxProcessor, and the
>> advice I've found in several places around the Web doesn't seem to be
>> working:  my factory class never gets instantiated.
>>
>> I've got a file META-INF/cocoon/avalon/cocoon-core-saxon-xslt.xconf:
>>
>> 
>> 
>>   > class="org.apache.cocoon.components.xslt.TraxProcessor">
>> 
>> >value="org.dspace.saxon.ConfigurableTransformerFactory"/>
>>   
>> 
>>
>> I also tried copying it to WEB-INF/cocoon and it didnt' seem to work
>> there either.
>>
>> I do have  and  in the Spring
>> config.
>>
>> Is there some way to debug component configuration and see if the file
>> is even being looked for (and where *is* configuration looking)?  The
>> Cocoon site directs me to Excalibur, which directs me to Avalon, which
>> says that Avalon is wound up and directs me back to Excalibur
>>
>>
>>
>> I've also tried to configure the thing using Spring:
>>
>> >   class='org.apache.cocoon.components.xslt.TraxProcessor'
>>   init-method='initialize'
>>   destroy-method='dispose'>
>>   
>>   > value='org.dspace.saxon.ConfigurableTransformerFactory'/>
>> 
>>
>> but so far I'm missing something:  TraxProcessor.sourceToSAX throws an
>> NPE.  I'm probably not setting the parameters correctly -- there isn't
>> a setter for use-store at all, for example.
>>
>> I've found any number of pages that tell me Avalon configuration is
>> being replaced by Spring, but nothing practical on how to convert
>> Avalon configuration (such as the first sample above) to Spring, or
>> even how to write fresh Spring configuration for Cocoon components.
>> It would be nice to know how to do this even if I wind up using the
>> Avalon approach with the present task.
>>
>> --
>> Mark H. Wood
>> Lead Technology Analyst
>>
>> University Library
>> Indiana University - Purdue University Indianapolis
>> 755 W. Michigan Street
>> Indianapolis, IN 46202
>> 317-274-0749
>> www.ulib.iupui.edu
>>
>


Re: [CVE-2020-11991] Apache Cocoon security vulnerability

2020-09-11 Thread gelo1234
Hello Cedric,

Are external entities blocked also in XSLT?

Greetings,
Greg

pt., 11 wrz 2020 o 11:39 Cédric Damioli  napisał(a):

> [CVE-2020-11991] Apache Cocoon security vulnerability
>
> Severity: Important
>
> Vendor: The Apache Software Foundation
>
> Versions Affected: Apache Cocoon up to 2.1.12
>
> Description: When using the StreamGenerator, the code parse a
> user-provided XML.
>
> A specially crafted XML, including external system entities, could be used
> to access any file on the server system.
>
> Mitigation:
>
> The StreamGenerator now ignores external entities. 2.1.x users should
> upgrade to 2.1.13
>
> Example:
>
> With the following input :
>
>   "file:///etc/shadow"> ]>  John
>   an attacker got the content of
> /etc/shadow
>
> Credit: This issue was discovered by Nassim Asrir.
>
> Regards,
>
> --
> Cédric Damioli
>
>


Re: [ANN] Apache Cocoon 2.1.13 Released

2020-07-30 Thread gelo1234
No shit!!! Congratulations Apache Cocoon is back from Dead??? Great
news.

Can Cocoon 3.0 be finally released? If I recall C3.0 was in BETA that was
_never_ released. Only ALFA3 was released.

Greetings,
Greg

czw., 30 lip 2020 o 12:12 Cédric Damioli  napisał(a):

> Apache Cocoon 2.1.13 Released
> -
>
> The Apache Cocoon Community is proud to announce the new release
> of Apache Cocoon.
>
>
>
>Apache Cocoon is a web development framework built around the concept
>of separation of concerns (that is: allowing people to do their job
>without having to step on each other toes) and component-oriented web
>RAD.
>
>
>
>Cocoon implements these concepts around the notion of 'component
>pipelines' modelled after the 'process chain' concept where each
>worker specializes on a particular operation. This makes it possible
>to use a Lego(tm)-like approach in building web solutions where
>these components can be hooked together into pipelines without
>requiring further programming.
>
>
>
>We like to think at Cocoon as "web glue" for your web application
>development needs. But most important, a glue that can keep
>concerns separate and allow parallel evolution of the two sides,
>improving development pace and reducing the chance of conflicts.
>
>
>
> For more information about Apache Cocoon 2.1.13, please go to
> http://cocoon.apache.org
>
> Changes with Apache Cocoon 2.1.13
>
> *) Starting with 2.1.13 the minimum required Java version will be 1.6.
> [all]
>
> *) Cannot start Cocoon 2.1.12 on Windows [FC]
>
> *) Cannot build with Java 7 [FC]
>
> *) Use ImageIO instead of old com.sun.image.* package in ImageReader [FC]
>
> *) Apache license at the beginning cocoon's dojo widgets templates
> causes: dojo.widget.Parse: error: [FC]
>
> *) XSP not working with Java 8 [FC]
>
> *) Make XMLResourceBundle (and -Factory) more extensible [CD]
>
> *) XMLResourceBundles are not available outside a Request [CD]
>
> *) Escape accolades in i18n messages [CD]
>
> *) ContextSourceFactory calculates the path incorrectly when removing
> the protocol part [FC]
>
> *) XMLEncoder doesn't support Unicode surrogate pairs [FC]
>
> *) Content-Range and Range headers does not respect the HTTP spec [CD]
>
> *) Inconsistent Content-Length header for HEAD requests [CD]
>
> *) Cannot upload a file with name containing a '=' or a ';' [CD]
>
> *) Unsynchronized HashMap.put in ResourceReader and GeneratorSelector
> may lead to infinite loop. [AN]
>
> *) Update to poi-3.14 (requires Java 1.6) [AN]
>
> *) Update to fop-1.1 [AN]
>
> *) Update to commons-httpclient-3.1 [AN]
>
> *) XSP: Use javax.tools.JavaCompiler interface for Javac (available
> since Java 6). [AN]
>
> *) Core: Update to xalan-2.7.2 and add serializer-2.7.2 [AN]
>
> *) Enable 'java' to be found by the build and run shell scripts on a
> modern Mac OS X. [DC]
>
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@cocoon.apache.org
> For additional commands, e-mail: users-h...@cocoon.apache.org
>
>


Re: using cocoon 2.1 in the long-term, security concerns

2021-07-19 Thread gelo1234
Hello Vincent,

It depends on your future Strategy. Cocoon is very flexible. We've been
running Cocoon 3.0-beta in production with Tomcat9/10, Quarkus and even
Kubernetes 1.20 etc. No problems at all :)
with Java 8 :) We cannot switch to Java 11, because it's not compatible
with Cocoon libraries anymore :( That's the only obstacle.
Maybe someone could "update" cocoon stack to use Java 11 LTS JVM? Or now 17
LTS? :)

As long as it does its job, Cocoon is fine! Although the amount of
pipelines that are still in use in our Cocoon deployments decreased in
time.
We switched to Vue.js framework as frontend and Spring-Boot 2 as backend
technologies, all running on Kubernetes multi-clusters.
Both Vue and Spring-Boot 2 are very lightweight and suit our needs better
(to build Web-Portals) than Cocoon. Even though we still use Cocoon for
some integration stuff and fast
proxy/gateway to many "old" services or database access.

Greetings,
Greg


pon., 19 lip 2021 o 14:03 Vincent Neyt  napisał(a):

> Hi Cocoon users,
>
> I'd like to ask your opinion on the long-term security risks of running
> Cocoon on a server. The colleague responsible for the servers at my
> university is inquiring if the software I'm using for my website is up to
> date and is concerned that I'm using outdated software that could in the
> future pose a security risk.
>
> I'm using cocoon 2.1.11, which I could probably upgrade to 2.1.13 without
> many problems. But I'm concerned about the long-term, and wondering if it
> would perhaps be better to reprogram the website I've been working on for
> 10 years into eXist DB (which would be a huge time investment). I like
> cocoon very much and would love to continue using it if it's possible.
>
> I'm curious to hear your thoughts about using Cocoon 2.1 for the long
> term: will it still work well inside future versions of servlet containers
> like Tomcat? What about the java dependencies? And will cocoon 2.1 continue
> to put out updates when security risks are identified?
>
> thanks very much,
> Vincent
>


  1   2   >