continuations

2006-02-13 Thread Jan Hoskens

Hi,

I have a flow in which I create a form. When this form is displayed, I 
like to keep the continuation to stay alive for as long as the user is 
filling in that form (which can take more than one hour, depends on how 
many times the user is refilling his cup of tea or coffee, and how many 
colleagues are passing by to have a nice chat with ;-) ). I'm thinking 
of something similar like daisy does 
(http://cocoondev.org/daisy/index.html, made by outerthought): sending a 
form which carries an internal frame that refreshes itself every x 
minutes. This frame will load a page which contains the original ID from 
the form continuation (by request). A small flowscript function will 
then call the continuationmanager and retrieve the WebContinuation. 
Getting the continuation from this object will trigger the 
WebContinuation to update its access time and thus it will stay alive.


Is this sensible? Has anyone else ever tried something alike or solved 
this another way? Any comments welcome!



Kind Regards,
Jan

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: continuations

2006-02-13 Thread Jan Hoskens


Gunter D'Hondt wrote:
done that trick also for a few sites but major problem here might consists 
that the client browser must have javascript enabled (to force the reload 
of the frame) and it must support frames (which is ugly) or iframes (which 
is IE only)
  
IFrames is a html 4.0 element and supported by more browsers (ie 3.0+, 
nn 6.0+, moz 1.0+, ff 1.0+ , op 4.0+),  besides this our customers 
mostly use IE 6 or up with javascript enabled (needed in other webapps 
we use).
can't you just always keep the continuations alive; so setting no session 
timeouts; or you might even temporarily store them yourself on a disk/db 
or whatever
  
If setting no timeouts, are continuations kept alive forever or will a 
default timeout setting be used? When will the continuation be set 
invalid so it can be removed from the cache? I'm not looking forward to 
writing my own continuation storage.


Kind Regards,
Jan


Regards,
Gunter D'Hondt


 




Jan Hoskens [EMAIL PROTECTED] 
13/02/2006 10:29

Please respond to
users@cocoon.apache.org


To
users@cocoon.apache.org
cc

Subject
continuations






Hi,

I have a flow in which I create a form. When this form is displayed, I 
like to keep the continuation to stay alive for as long as the user is 
filling in that form (which can take more than one hour, depends on how 
many times the user is refilling his cup of tea or coffee, and how many 
colleagues are passing by to have a nice chat with ;-) ). I'm thinking 
of something similar like daisy does 
(http://cocoondev.org/daisy/index.html, made by outerthought): sending a 
form which carries an internal frame that refreshes itself every x 
minutes. This frame will load a page which contains the original ID from 
the form continuation (by request). A small flowscript function will 
then call the continuationmanager and retrieve the WebContinuation. 
Getting the continuation from this object will trigger the 
WebContinuation to update its access time and thus it will stay alive.


Is this sensible? Has anyone else ever tried something alike or solved 
this another way? Any comments welcome!



Kind Regards,
Jan

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

  


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: continuations

2006-02-13 Thread Jan Hoskens





Gunter D'Hondt wrote:

  
I don't want my sessions/continuations to have long time-out periods for 

  
  security reasons. It's ok to have them log in again if their session is 
timed out 
  
  
after eg a half hour. But then again, when they are editing a form, this 

  
  might take some time, and the responsibility of keeping this form window 
  
  
open/uncommitted is completely on their side. So if they are off to 

  
  McDonalds during editing, it's their own decision to leave that window 
open.

this I don't understand coz you started this discussion with the fact that 
you want your continuations to stay alive long enough but you don't want 
to increase your session timeout?? the continuation might survive the 
container session but in my opinion this will be a confusing situation for 
the end user
  

I want my session to be eg only a half hour. So when users are just
browsing (not editing a form) and leave their pc for more than 30
minutes, they need to log in again. Besides this, when they are editing
a form, this might take a while, so when the form is presented, I want
the continuation to be extended as long as the form is on the users
screen/browser. This actually implies that the session will be extended
also. When the users stares at the form for a few hours, an iframe will
periodically contact the server, which automatically extends the
session time, and the continuation related with the form is accessed so
that it's time is extended too.

Kind Regards,
Jan




Re: Advice on site design - really close

2005-07-20 Thread Jan Hoskens

footh wrote:


I read about flow before and in fact I intended ot use
it once I got this supposedly basic part of the site
resolved.

Anyway, I re-read the documentation and I can't seem
to find out how it would help the situation described
below.  How can I use flow logic combine 5 pages that
require dynamic processing into one page?
 



There are several ways to do this. Take a look at the docs for: 
aggregating (sitemap element), cinclude or xinclude (transformers).


I'll give a small example:
- Let each request go through one sitemap matcher
- This matcher has either an aggregate:
   map:aggregate ... maybe defining a new surrouning parent element
  map:part here your different parts (menu/content/sidebars...)

  or read in a template page and use includes:
   map:generate src=template.xml/ (template contains include tags 
for each different part)
   map:transform type=cinclude/ (this step reads the include tags 
and calls the different pipes to include)


- each part for menu/sidebars/... can be processed by separate matchers 
in an internal-only pipeline


- each matcher can contain its own flowscript functions if needed(thus 
program/call anything you like), or you can produce general information 
in your template sitemap matcher (eg by action , own component or again 
flowscript, doesn't matter) and set these in your session or context so 
it's available within the different parts.


- the template matcher will then contain all the information and you can 
style this to any outputtype you want (probably just plain html). Just 
remember to leave your html styling and javascript in different files 
and include these.


When creating your own generator/components remember to make these 
reusable and that there is already a lot of funcionality available.


Kind regards,
Jan




--- Ralph Goers [EMAIL PROTECTED] wrote:

 


It sounds like you need to take a look at flowscript
or javaflow.

footh wrote:

   


I'm converting my site from pure JSP to Cocoon.

I've read lots of tutorials on Cocoon and I've come
really close to getting the site to work the way I
want but I've hit a few snags.

Basically, the site has a header, footer and two
sidebars with content in the middle.  In JSP, I
 


would
   


just have includes on every page for the header,
footer, etc.  However, in Cocoon, I was hoping I
 


could
   


have one template page that decided the layout.

I was able to create this model, mainly using this
tutorial:
 


http://www.cocooncenter.org/articles/navigation.html
   


I created an XSL stylesheet for the header, footer,
and two sidebars, along with associated XML content
files and imported those into a main stylesheet. 
Then, in the main stylesheet, I apply the templates

for the constant parts by using the document
 


function
   


in XSL, for ex:

xsl:apply-templates
select=document('..\menus\header.xml')/*/

For the main content on each page, I have separate
 


XML
   


files that, for now, are simply a dump of static
 


HTML
   


and I use the copy-of XSL tag to insert it into the
page.  Later, I'll make these XSP pages and
dynamically generate the content.

Here's where I've hit a couple issues.  The header,
footer and sidebars contain some dynamic content. 
 


For
   


example, if a person is logged in, the header will
show something different.  I was able to get around
this by passing in the remoteUser parameter to
 


the
   


stylesheet in the pipeline and then using
 


stylesheet
   


logic.  But, there's also other logic I will need
 


to
   

process that's a bit more complicated (ex. 
 


depending
   


on the user's role, etc).  With my current layout,
 


I
   


can't seem to find a way to add logic that can use
Java to these mostly static blocks.

I've tried aggregating, but that doesn't seem to
 


work
   


well with XSP.  Also, I'd like to not use cinclude
since I'd like to avoid including the other
 


elements
   


on every page like in JSP.

Might anyone have any suggestions for me out there?

Thanks a ton.

JF 





__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam
 

protection around 
   

http://mail.yahoo.com 

 


-
   


To unsubscribe, e-mail:
 


[EMAIL PROTECTED]
   


For additional commands, e-mail:
 


[EMAIL PROTECTED]
   




 



   


-
 


To unsubscribe, e-mail:
[EMAIL PROTECTED]
For additional commands, e-mail:
[EMAIL PROTECTED]


   






__ 
Yahoo! Mail 
Stay connected, organized, and protected. Take the tour: 
http://tour.mail.yahoo.com/mailtour.html 



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: 

Re: Javascript and xsp --- Possible bug??

2005-04-29 Thread Jan Hoskens
Is it somehow remotely possible that you are using an xml serializer to produce the html page(or 
xhtml)? Does the script tag appear as one element in your html page script .../ ?

If so, you might want to read this:
http://marc.theaimsgroup.com/?l=xml-cocoon-usersm=111088309324290w=2
In short: browsers expect an ending tag when you are sending html. So a possible solution is to have 
 some space between the start and end tag or just a ; for scripttags may do as well:

script ...; /script
Remember that most browsers don't support xhtml(read the link!) and are seeing the page as html in 
which case several elements MUST have ending tags.

Hope this helps.
Kind Regards,
Jan
Xoan wrote:
Hi all,
Thanks for the info, finally this works!
But I was a little disconcerted because, the first time I tried it
doesn't works.
When I tried the following code (all in the same line):
script language=javascript type=text/javascript
src=http://localhost:8080/exist/examples/Editor/library.js;/script
it doesn't function, but if I move the /script mark to the next line
it works fine!
It is that reasonable? What's the explanation for that behaviour?
Regards,
Xoan
2005/4/28, Xoan [EMAIL PROTECTED]:
Hi Phil and Nacho,
I was a little confused with the first Phil's reply, but now I think
that you've answered my doubt.
Tomorrow I'll tell you if it works.
Thanks a lot,
Xoan
2005/4/28, Philippe Guillard [EMAIL PROTECTED]:
Apologize map:flow language=javascript is for flowscript. In your
case you just add a pipeline anywhere in your sitemap containing
pipeline for XSP like this :
map:match pattern=*.js
   map:read mime-type=text/javascript src={1}.js/
/map:match
and i would put this in the XSP with relative path
script language=JavaScript type=text/javascript src=library.js/
Phil
Xoan wrote:

Hi Phil,
No, I'm a newbie in Cocoon and I don't have too clear all the process.
Where I have to put this entry? Before the map:generate for the xsp??
Thanks a lot
Xoan
2005/4/28, Philippe Guillard [EMAIL PROTECTED]:

Hi,
Probably your .js file is not red by Cocoon. Did you attach flowscript
to your sitemap with a  map:flow language=javascript entry?
Phil
Xoan wrote:


Hi all,
I'm trying to write a xsp with some javascript code. This code uses
functions defined in a .js file.
When I try the html part in a browser all works fine, but when I try
to use the same html code in a xsp seems that the following
instruction is not recognized:
script language=JavaScript type=text/javascript
src=http://localhost:8080/exist/examples/Editor/library.js;/script
as when I try to load it the following error appears:
Error function_defined_in_library.js is not defined.
=
?xml version=1.0?
xsp:page language=javascript xmlns:xsp=http://apache.org/xsp;
html xmlns=http://www.w3.org/1999/xhtml;
head
script language=JavaScript type=text/javascript
src=http://localhost:8080/exist/examples/Editor/library.js;/script
/head
body
script language=JavaScript type=text/javascript
a_call_to_a function_defined_in_library.js(param1', param2);
/script
/body
/html
/xsp:page
=
It is possible to call external javascript code in xsp's?
Any idea on what is happening?
Regards,
Xoan
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: [Auth-FW] Edit authentication/data nodes

2005-04-05 Thread Jan Hoskens
Hi,
When I first used cocoon, I had xsp's all around. If I remember correctly, I did something like this 
to get the value from the authentication session:

xsp:page
xmlns:xsp=http://apache.org/xsp;
xmlns:xsp-session-fw=http://apache.org/xsp/session-fw/1.0;
xsp:logic
	String email = xsp-session-fw:getxml  context=authentication 
path=/authentication/data/UserEmail/;
	String login = xsp-session-fw:getxml  context=authentication  path=/authentication/ID/;
/xsp:logic

email: xsp:expremail/xsp:expr user: xsp:exprlogin/xsp-expr
I never changed the value though and looking at the session-fw.xsl stylesheet, it seems that there 
isn't a way to set values. You may

Nowadays, I don't use xsp anymore. I now use flowscript to access the authenticationsession and pass 
it in my bizdata:

var bizdata = new Object();
var contextMan = null;
try
{
contextMan 
=cocoon.getComponent(Packages.org.apache.cocoon.webapps.session.ContextManager.ROLE);
var sessionContext = contextMan.getContext(authentication);
var id = documentFragment2String(sessionContext.getXML(/authentication/ID));
var userEmail = 
documentFragment2String(sessionContext.getXML(/authentication/data/UserEmail));
bizdata[id] = id;
bizdata[email] = userEmail;
cocoon.sendPage(mypage, bizdata);
}
finally
{
cocoon.releaseComponent(contextMan);
}   
Pay attention to some restrictions on the authenticationsession, there are some functions that are 
not available although the session interface does define them. Look at the api's to see what you can 
do with the authenticationsession: 
http://cocoon.apache.org/2.1/apidocs/org/apache/cocoon/webapps/authentication/context/AuthenticationContext.html

If you need to alter a lot of data in the session, you may want to consider adding a session context 
for this specific task alone (so not touching the authentication session):

contextManager 
=cocoon.getComponent(Packages.org.apache.cocoon.webapps.session.ContextManager.ROLE);
if (!contextManager.existsContext(Information))
{
contextManager.createContext(Information, null, null);
}
var sessionContext = contextManager.getContext(Information);
// showing how to set a result of a pipeline as xml in a sessioncontext
var pipelineUtil = 
cocoon.createObject(Packages.org.apache.cocoon.components.flow.util.PipelineUtil);
var document = pipelineUtil.processToDOM(mySessionSettingsToChange, null);
var documentFragment = document.createDocumentFragment();
documentFragment.appendChild(document.getDocumentElement().cloneNode(true));
sessionContext.setXML(Bestuur, documentFragment);
...
sessionContext.removeXML(...);
sessionContext.setAttribute(..., null);
...
If you don't want to use flowscript, the same can be done with the session tags:
session:createcontext name=Information/
session:setxml context=Information path=/mypath/
cinclude:include
xsp:attribute 
name=srcxsp:exprmyDynamicFormedPipelinePath/xsp:expr/xsp:attribute
/cinclude:include
/session:setxml

There are probably some more ways to do the same so you may want to look around 
a bit longer.
Kind regards,
Jan
Philippe Guillard wrote:
Hi,
I use Portal, so i use Auth-Fw, and want to change the data part for a 
user without asking him to sign-in again.

Lest's say i put nickname in the data section,
authentication
   IDfoo_id/ID
   datafoo_nickname/data
/authentication
and i want to afford the possibility for the user to change it's Nickname.
Is there a simple way?  Today i can get the nickname from Sitemap 
(InputModule), Flow, Java, XspSessionFw logicsheet, but i don't know a 
simple way to use the set functions.
AuthenticationFw/ SessionContext seems to be there to make session 
attributes manipulation easier, so i think i lack some understanding on it.

For the moment i just use the normal Session object doing this after 
the autentication node made in XSP:
authentication
   IDfoo_id/ID
   data/data
/authentication
xsp:logic
   session.setAttribute(nickname, foo_nickname); /xsp:logic
(i'm sad to mix these 2 things and i do not use the framework provided...)

Regards,
Phil
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: Pass a request paramter to a custom generator

2005-04-05 Thread Jan Hoskens
try
map:parameter name=schnirkel2 value={request-param:xfacename} /
that should work.
Look for inputmodules in the docs: 
http://wiki.apache.org/cocoon/InputModules?highlight=%28inputmodules%29

Kind Regards,
Jan
Mattom wrote:
hi all !
Sorry if i missed some documentation, but I after spending an hour on trial
and error...
How do i pass a request parameter to a custom generator in a pipeline ?
I tried (see schnirkel and schnirkel2), for a link that is:
viewGeneric.dhtml?xfacename=testit
map:match pattern=dynamic_content/viewGeneric.dhtml
  map:generate type=XFace
map:parameter name=XFaceName value=Versicherungsdaten /
map:parameter name=use-request-parameters value=true/
map:parameter name=schnirkel value={xfacename} /
map:parameter name=schnirkel2 value={request:xfacename} /
  /map:generate
thank you,
tom

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: [Auth-FW] Edit authentication/data nodes

2005-04-05 Thread Jan Hoskens
Philippe Guillard wrote:
Thanks a lot Jan,
Good idea to use another session context and not the one used by 
authentication framwork for the elements i need to save.  I also thought 
none of the set functions you shown here where available, i'll try.

Just one question reminds: doc says session framwork provides the 
session context that is XML data storage in the session, as i need to 
store a few parameters without hierarchy, i still wonder what is the 
advantage of using it instead of simply use sesion attributes 
(session.setAttribute(nickname, foo)) ?
As far as I know a sessioncontext is like a container in your session. Every application can have 
it's own 'private' space in the session to store it's objects. This way the authentication framework 
reserves the context 'authentication' for its needs. If you only need to store some global 
attributes, the user session will be enough. If you need xml storage or want to have separate spaces 
for different goals/apps you might want to use contexts.

Well that's my point of view of course, ;-)
Kind regards,
Jan
Regards,
Phil

Jan Hoskens wrote:
Hi,
When I first used cocoon, I had xsp's all around. If I remember 
correctly, I did something like this to get the value from the 
authentication session:

xsp:page
xmlns:xsp=http://apache.org/xsp;
xmlns:xsp-session-fw=http://apache.org/xsp/session-fw/1.0;
xsp:logic
String email = xsp-session-fw:getxml  context=authentication 
path=/authentication/data/UserEmail/;
String login = xsp-session-fw:getxml  context=authentication  
path=/authentication/ID/;
/xsp:logic

email: xsp:expremail/xsp:expr user: xsp:exprlogin/xsp-expr
I never changed the value though and looking at the session-fw.xsl 
stylesheet, it seems that there isn't a way to set values. You may

Nowadays, I don't use xsp anymore. I now use flowscript to access the 
authenticationsession and pass it in my bizdata:

var bizdata = new Object();
var contextMan = null;
try
{
contextMan 
=cocoon.getComponent(Packages.org.apache.cocoon.webapps.session.ContextManager.ROLE); 

var sessionContext = contextMan.getContext(authentication);
var id = 
documentFragment2String(sessionContext.getXML(/authentication/ID));
var userEmail = 
documentFragment2String(sessionContext.getXML(/authentication/data/UserEmail)); 

bizdata[id] = id;
bizdata[email] = userEmail;
cocoon.sendPage(mypage, bizdata);
}
finally
{
cocoon.releaseComponent(contextMan);
}  
Pay attention to some restrictions on the authenticationsession, there 
are some functions that are not available although the session 
interface does define them. Look at the api's to see what you can do 
with the authenticationsession: 
http://cocoon.apache.org/2.1/apidocs/org/apache/cocoon/webapps/authentication/context/AuthenticationContext.html 

If you need to alter a lot of data in the session, you may want to 
consider adding a session context for this specific task alone (so not 
touching the authentication session):

contextManager 
=cocoon.getComponent(Packages.org.apache.cocoon.webapps.session.ContextManager.ROLE); 

if (!contextManager.existsContext(Information))
{
contextManager.createContext(Information, null, null);
}
var sessionContext = contextManager.getContext(Information);
// showing how to set a result of a pipeline as xml in a sessioncontext
var pipelineUtil = 
cocoon.createObject(Packages.org.apache.cocoon.components.flow.util.PipelineUtil); 

var document = pipelineUtil.processToDOM(mySessionSettingsToChange, 
null);
var documentFragment = document.createDocumentFragment();
documentFragment.appendChild(document.getDocumentElement().cloneNode(true)); 

sessionContext.setXML(Bestuur, documentFragment);
...
sessionContext.removeXML(...);
sessionContext.setAttribute(..., null);
...
If you don't want to use flowscript, the same can be done with the 
session tags:

session:createcontext name=Information/
session:setxml context=Information path=/mypath/
cinclude:include
xsp:attribute 
name=srcxsp:exprmyDynamicFormedPipelinePath/xsp:expr/xsp:attribute 

/cinclude:include
/session:setxml
  
There are probably some more ways to do the same so you may want to 
look around a bit longer.

Kind regards,
Jan
Philippe Guillard wrote:
Hi,
I use Portal, so i use Auth-Fw, and want to change the data part for 
a user without asking him to sign-in again.

Lest's say i put nickname in the data section,
authentication
   IDfoo_id/ID
   datafoo_nickname/data
/authentication
and i want to afford the possibility for the user to change it's 
Nickname.

Is there a simple way?  Today i can get the nickname from Sitemap 
(InputModule), Flow, Java, XspSessionFw logicsheet, but i don't know 
a simple way to use the set functions.
AuthenticationFw/ SessionContext seems to be there to make session 
attributes manipulation easier, so i think i lack some understanding 
on it.

For the moment i just use the normal Session object doing this 
after the autentication node made in XSP

Re: Problem with stylesheets

2005-04-05 Thread Jan Hoskens
So everything's fine but the scripttags? They are not appearing in the html 
source?
A few things to check:
- it's possible that the xsl matcher doesn't match the correct namespace. If nothing is appearing 
between the head section, try to add the namespace in the forms stylesheet template(look in eg. 
forms-advanced-field-styling.xsl, add the xhtml namespace to the stylesheet (xmlns:xhtml=...) and 
use this in the element tag of the head matcher: match=xhtml:head)or remove your own namespace.

- you are serializing to xhtml, but it's very likely that you are sending xhtml that is viewed as 
html by browsers (real xhtml isn't supported by IE, read this thread: 
http://marc.theaimsgroup.com/?l=xml-cocoon-usersm=111088309324290w=2 ). Html is expecting endtags 
for scripts as wel as textareas, so if you result in script/  tags (which is fine for xhtml and 
xml), browsers may still choke on this.

Kind Regards,
Jan
Michel Erard wrote:
Hi, 

thanks for your mail.
it works now a bit better, but not yet perfect :-( 
In the sitemap I use this:

map:transform type=forms /
map:transform type=xalan src=stylesheets/layout.xsl /  
map:transform type=xalan src=resources/forms-samples-styling.xsl / 
map:serialize type=xhtml /

instead of the version in the block example (Multipage forms)
map:resources
!-- this will later become a virtual transformer --
   map:resource name=simple-page2html
  map:transform src=stylesheets/simple-page2html.xsl
 map:parameter name=contextPath value={request:contextPath}/
 map:parameter name=servletPath value={request:servletPath}/
 map:parameter name=sitemapURI value={request:sitemapURI}/
 map:parameter name=file value={file}/
 map:parameter name=remove value={../0}/
  /map:transform 
   /map:resource
/map:resources

map:call resource=simple-page2html
   map:parameter name=file value=forms/multipage_template.xml/
/map:call
map:transform src=stylesheets/forms-samples-styling.xsl/
map:serialize/
The layout of my page is now correct and the functionality is more or less 
correct. The form works fine but the js tags for the advanced fields are 
missing.
Best regards, 

Mike
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: Problem with stylesheets

2005-04-04 Thread Jan Hoskens
Maybe this is because the forms stylesheets try to match with a html document to add the styles and 
javascripts. When no html header element is found, the mentioned elements are not included in the 
final page. Look into the stylesheets templates to see where the scripts/styles are added.

One solution is to set the forms stylesheets at the end after you've transformed to the html 
elements. Another one is to customize the forms stylesheets to add the scripts/styles into a 
different element (create a stylesheet and import the forms stylesheets to make it easier).

Kind regards,
Jan
Michel Erard wrote:
Hello,
I've tried to aggregate the multi-page-form example into an existing 
application. Now I've the problem, that my styles.css file isnt found 
any longer and it doesn't add the javascripts for the popups from matt 
kruse to the page.

Does somebody see my fault?
Thanks
Mike
-
Pipelines:
map:pipelines
map:pipeline type=noncaching internal-only=true
map:act type=locale
   map:match pattern=*.form
  map:aggregate element=document
 map:part src=cocoon:/info/{1} /
 map:part src=cocoon:/header/{1} /
 map:part src=cocoon:/menu/{1} /
 map:part src=cocoon:/form/{1} /
  /map:aggregate
  !--map:transform type=xalan src=stylesheets/layout.xsl /--
  map:transform type=forms/
  map:transform type=xalan 
src=resources/forms-samples-styling.xsl /
  map:transform type=xalan 
src=resources/forms-advanced-field-styling.xsl /
 map:serialize type=xhtml /
   /map:match

   map:match pattern=info/*
  map:generate type=serverpages src=forms/info/info.xsp
 map:parameter name=context value={1} /
  /map:generate
  map:serialize type=xml /
   /map:match
   map:match pattern=header/*
  map:generate type=serverpages src=forms/menus/hmenu.xsp
 map:parameter name=context value={1} /
  /map:generate
  map:serialize type=xml /
   /map:match
   map:match pattern=menu/*
  map:generate type=serverpages src=forms/menus/vmenu.xsp
 map:parameter name=context value={1} /
  /map:generate
  map:serialize type=xml /
   /map:match
   map:match pattern=form/*
  map:generate src=forms/multipage_template.xml/
  map:serialize type=xml /
   /map:match
/map:act
 /map:pipeline
 
  map:pipeline

map:match pattern=do-*.flow
  map:call function=do_{1}/
/map:match
map:match pattern=*.continue
  map:call continuation={1}/
/map:match
map:match pattern=resources/**
  map:read src={0}/
/map:match 
   map:match pattern=*
   map:redirect-to uri={1}//
   /map:match

   map:match pattern=*/**
map:mount check-reload=yes src={1}/ uri-prefix={1}/
  /map:match
  /map:pipeline
  map:pipeline type=caching internal-only=false
map:match pattern=images/*.gif
   map:read mime-type=images/gif src=images/{1}.gif /
/map:match
map:match pattern=images/*.jpg
   map:read mime-type=images/jpeg src=images/{1}.jpg /
/map:match
map:match pattern=styles/*.css
   map:read mime-type=text/css src=styles/{1}.css /
/map:match
map:match pattern=scripts/*.js
   map:read mime-type=text/javascript src=scripts/{1}.js /
/map:match
  /map:pipeline
/map:pipelines
-
layout.xsl:
  xsl:template match=/
 xsl:apply-templates /
  /xsl:template
  xsl:template match=document
 html xmlns=http://www.w3.org/1999/xhtml; xml:lang=en lang=en
head
   titleElquerito/title
   meta http-eqoiv=Content-Type content=text/html; 
charset=ISO-8859-1 /
   meta http-eqoiv=Content-Script-Type 
content=text/javascript /
   link rel=stylesheet type=text/css 
href=styles/styles.css /
   script type=text/javascript language=Javascript1.5 
src=scripts/main.js;/script
/head

body
   table summary= border=0 class=main cellpadding=0 
cellspacing=0
  tr
 td style=background-image: url( 'images/logo.gif' ); 
height: 66px; width: 800px;/
 td align=right
table summary= border=0 cellpadding=0 
cellspacing=0
   tr nowrap=nowrap align=right
  tdxsl:copy-of 
select=/document/info/user-id//td
   /tr
   !--tr nowrap=nowrap align=right
  tdxsl:copy-of 
select=/document/info/role//td
   /tr--
   tr nowrap=nowrap align=right
  tdxsl:copy-of 

Re: textarea in xhtml

2005-03-15 Thread Jan Hoskens
Hi,
There's a little bit more you need to know about textarea and xhtml. Try to 
follow me on this one ;-)
If you are getting problems with a textarea under IE(or another browser) it's because you think you 
are serializing to xhtml but in fact you're sending plain html. First you need to know that IE 6 as 
it is now, doesn't support xhtml. If you're sending 'real' xhtml to IE it will ask the user to 
download the page. If you're not bothered by this IE problem, you can send xhtml by serializing to 
xml AND set the correct mime-type: application/xhtml+xml in that serializer (look at your 
serializers part in the sitemap, mime-type should be an attribute on your xhtml serializer tag). 
Firefox or other xhtml capable browsers will then see this page as xhtml and do render the textarea 
/ tag correctly.

What you're probably doing right now is setting everything correct to serve xhtml, serialize it as 
xhtml, but sending the wrong mime-type: text/html. This isn't a big problem as explained in [1] 
because xhtml 1.0 is almost the same as html except for eg that textarea tag. It's stated in html 
that there must be an end tag for textarea and because your page is viewed as text/html your browser 
chokes on textarea /. This means in every browser (also eg firefox) as they don't get the correct 
mime-type. But as said, the most used browser IE 6 isn't capable of rendering xhtml correctly.

So you'll need to do one of the following:
1) render as xhtml with correct mime type application/xhtml+xml BUT loose IE users (bad choice to me)
2) render as html, mime-type text/html (rewrite page(s)? ~ take a step back?)
3) render textarea's with a space: textarea /textarea and use xhtml with mime-type text/html 
(but maybe not that nice)

I'm not sure there's another way to solve this. I once thought of extending the xml serializer and 
somehow make sure the tags all have an end-tag, but Xalan (or whatever you are using) is serializing 
the xml output and doesn't have a setting not to collapse empty elements. (if I'm wrong, please do 
correct me!)

[1]http://www.w3.org/MarkUp/2004/xhtml-faq#texthtml
Kind Regards,
Jan
Derek Hohls wrote:
Gunter
That's strange - the output I get in my HTML forms page 
(in IE) looks like:

input type=text title=test value=2002-08-15 name=CalDate
ie there is no / at the end...
The input in the XML file is 
input type=text title=test value=2002-08-15 name=CalDate/
but admittedly there is no XSL step apart from the standard
copy tag match.  Maybe its your XSL that is the problem?  Can
you try and change to create: 
textarea name=mynote/

Derek

[EMAIL PROTECTED] 2005/03/15 11:42:50 AM 
Hi,
I've got the following problem inside a xslt running on Cocoon:
textarea name=mynote/textarea
which is serialized into textarea name=mynote /
and the problem with this is that browsers (likes IE6) do not
understand 
this syntax very well.

if I'm placing a space in between (textarea name=mynote
/textarea) 
then it's ok but this is not a nice workaround

Can I choose another serializer for this problem or are there any known
workarounds for this?
Regards,
Gunter D'Hondt
-
To unsubscribe, e-mail: [EMAIL PROTECTED] 
For additional commands, e-mail: [EMAIL PROTECTED] 

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: session context

2005-02-15 Thread Jan Hoskens
Ilja Smoli wrote:
Hi Jan
Im sorry Im  new to cocoon..
Im not sure I got this:
Eg: include the pipeline with your  sessiontransformer in your normal
document and xslt sets parameters in links. This way you can get  your
parameters easily with xpath expressions.
Can you please provide little example of this?
I have smth like this:
---
map:match pattern=internal/*
map:generate src=screens/{1}.xml/
map:transform type=session/
map:transform src=resources/simple-page2html.xsl
 /map:transform
map:transform type=encodeURL/
map:serialize/
  /map:match
--
and my screen is:
--
?xml version=1.0?
page
  titleHome/title
  content xmlns:session=http://apache.org/cocoon/session/1.0;
!-- THIS I understand (how to just display data from session context)--
session:getxml context=authentication path=//
 /content
 /page
--
but how to add params to links? This probably can be done in my xsl?
You're half way there. Starting from your example the easiest way to go is (according to me, of 
course) set your session stuff outside the content, you probably don't want to show every session 
element on the page, but just select some of them to eg. use in a link as a parameter. Think of the 
content tag as the one which will be transformed to a html page, and the other elements (title and 
session) as usefull resources for that content.

page
title.../title
session
!--do your session stuff here: getxml ... any context needed --
/session
content
  
   mylink to=sessionparamlink.html type=session/
/content
/page
then in your xsl:
xsl:template match=[EMAIL PROTECTED]'session']
a href=[EMAIL PROTECTED]/page/session/path_to_session}/
/xsl:template
in the a/ element I've used braces {}, these are shortcuts. You can do the 
same with
a
xsl:attribute name=href!--xsl:value-of  as you probably 
know--/xsl:attribute
/a
If you need your session stuff on each page (and maybe some other info as well) you might want to 
try includes. (This way you don't have to write the session stuff in each page.) Define one overal 
look page and include your content/info/session in that page:

page
cinclude:include src=cocoon:/internal/sessioninfo/
cinclude:include src=cocoon:/internal/someotherinfo/!-- things shared among pages, footers 
or whatever--
cinclude:include src=cocoon:/internal/{mypage}/!-- passed from sitemap --
/page

Transform with the cinclude transformer (look at the cocoon docs) and end up 
with something like:
page
sessioninfo /
someotherinfo /
content /
/page
and do the same thing in your final xsl: transform the content to html and use the info elements to 
add extra info.

This is of course one way to go, and there are many...
I always try to limit duplicated code, so when sessionstuff appears everywhere and has the same 
process in each page, try to extract that piece (eg as the last example).

Kind Regards,
Jan

Jan Hoskens [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
If you're only goal is to show the profile you stored in the session
context, you can retreive it
with the session transformer and then process the data there. Eg: include
the pipeline with your
sessiontransformer in your normal document and xslt sets parameters in
links. This way you can get
your parameters easily with xpath expressions. (at first thought, I would
prefer this instead of
passing parameters if you have to work with a complete xml structure)
If you want to edit the profile, I would suggest a combination of
flowscript/cforms. In the
flowscript retreive the base xml document from your session, create a form
and send it through a
form-display-pipeline.
Kind Regards,
Jan
Ilja Smoli wrote:
Thanks Jan!
I got the idea now...
Little problem that this ( {ID} ) will work only in pipeline which
exactly
uses auth handler..
Cause I have a bunch of pages to protect , I have one pipeline with
protect which uses then internal pipelines, but I think i can handle
this
problem..
Other question is can you please point me out on this:
I want to have like this (really common for webapps :-) ): after user
login,
have a session with user data (names, adresses etc...). This I can do
using
this auth fw and put everithing in session contexts. Problem actually
in
retrieving this data... Like to add parameters to links etc...
For docs I use xml, transformed through xsl...
For example I need a link like
a href=edit_form?username=get username from sessionEdit profile/a
Where it is better to do this?
In xsl like:
xsl:template match=editProfileLink
Here goes html code for this link with added params from session
 /xsl:template
or directly in xml doc?
Im confused about this :)
thx in advance...
Jan Hoskens [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]

When the user is authenticated, you can use {ID} and {ROLE} in your
sitemap

Re: cocoon 1.6, binding framework and cache...

2005-02-14 Thread Jan Hoskens
Christoph Hermann wrote:
Marc Salvetti schrieb:
Hello,

   map:match pattern=*cruise*
   map:call function=handleForm

   map:parameter name=documentURI
value=xdocs/planning/cruise{2}.xml/

When browsing, the cache system seems to get stuck on one of the docs
(ie : cruise1.xml) and from this moment, everytime the form is
called, it is binded to the same document, and the continuation ID
becomes invalid !
Anyone came across this kind of problem ?

Did you try {../2}?
Maybe the map:call adds one level to your sitemap (i don't know, just an 
Idea)

HTH
Christoph
That's not the problem here, parameters are using the same level as it's parent, so {2} should do 
the trick. When you say the cache system, do you mean the cocoon caching? Or are you testing a 
remote setup with possibly caching systems (eg proxies) in between? When calling the form, do you 
see an access line in your logs?

If cocoon caches the form use
map:pipeline type=noncaching
for your pipes that should not be cached. If a proxy or some caching system (between your cocoon and 
browser) hands a cached form, set your http-headers to non-caching:

map:act type=set-header
  map:parameter name=Pragma value=no-cache/
  map:parameter name=Expires value=-1/
  map:parameter name=Cache-control value=no-cache/
/map:act
If that's the real problem of course...
Kind Regards,
Jan
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: session context

2005-02-14 Thread Jan Hoskens
When the user is authenticated, you can use {ID} and {ROLE} in your sitemap:
!-- taken from 
http://cocoon.apache.org/2.1/developing/webapps/authentication.html
at the bottom --
map:match patternprotected
  map:act type=auth-protect  !-- protect the resource --
map:parameter name=handler value=myhandler/
!-- Append the ID of the user to the file name --
map:generate src=resource_{ID}.xml/
map:transform src=toHTML/
map:serialize/
  /map:act
/map:match
Pass it to an xsl stylesheet:
map:transform src=mysheet.xsl
map:parameter name=login value={ID} /
/map:transform
and in your stylesheet declare at toplevel:
xsl:stylesheet...
xsl:param name=login/
If needed: there are ways to get session xml in flowscript or jxtemplates, just give a sign if you 
need these (they are somewhere on the mail archives too).

Kind regards,
Jan
Ilja Smoli wrote:
Thx for reply
But as I understood authentication fw stores session object as xml
and i can not get attributes using {session:} :(
Bowe, Bastian [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
Never used session. But can't you use {session:username} as a
map:parameter/ for your map:transform type=xsl/ ?

-Original Message-
From: Ilja Smoli [mailto:[EMAIL PROTECTED]
Sent: Monday, February 14, 2005 2:33 PM
To: users@cocoon.apache.org
Subject: session context
Hi
I use authentification framework in cocoon 2.1.5...
I know that to get data out of session I can use
session:getxml... tag But what if i need this in XSL
stylesheet? Or for example in my xml page where i want to put
some value from session to link as query parameter? Smth like:
---
?xml version=1.0?
page
 titleHome/title
 content
 center
 a href='edit-form-person?user=HERE must go
username from session'Edit profile/abr/ 
Thx in advance...

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: session context

2005-02-14 Thread Jan Hoskens
If you're only goal is to show the profile you stored in the session context, you can retreive it 
with the session transformer and then process the data there. Eg: include the pipeline with your 
sessiontransformer in your normal document and xslt sets parameters in links. This way you can get 
your parameters easily with xpath expressions. (at first thought, I would prefer this instead of 
passing parameters if you have to work with a complete xml structure)

If you want to edit the profile, I would suggest a combination of flowscript/cforms. In the 
flowscript retreive the base xml document from your session, create a form and send it through a 
form-display-pipeline.

Kind Regards,
Jan
Ilja Smoli wrote:
Thanks Jan!
I got the idea now...
Little problem that this ( {ID} ) will work only in pipeline which exactly
uses auth handler..
Cause I have a bunch of pages to protect , I have one pipeline with
protect which uses then internal pipelines, but I think i can handle this
problem..
Other question is can you please point me out on this:
I want to have like this (really common for webapps :-) ): after user login,
have a session with user data (names, adresses etc...). This I can do using
this auth fw and put everithing in session contexts. Problem actually in
retrieving this data... Like to add parameters to links etc...
For docs I use xml, transformed through xsl...
For example I need a link like
a href=edit_form?username=get username from sessionEdit profile/a
Where it is better to do this?
In xsl like:
xsl:template match=editProfileLink
Here goes html code for this link with added params from session
  /xsl:template
or directly in xml doc?
Im confused about this :)
thx in advance...
Jan Hoskens [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
When the user is authenticated, you can use {ID} and {ROLE} in your
sitemap:
!-- taken from
http://cocoon.apache.org/2.1/developing/webapps/authentication.html
at the bottom --
map:match patternprotected
  map:act type=auth-protect  !-- protect the resource --
map:parameter name=handler value=myhandler/
!-- Append the ID of the user to the file name --
map:generate src=resource_{ID}.xml/
map:transform src=toHTML/
map:serialize/
  /map:act
/map:match
Pass it to an xsl stylesheet:
map:transform src=mysheet.xsl
map:parameter name=login value={ID} /
/map:transform
and in your stylesheet declare at toplevel:
xsl:stylesheet...
xsl:param name=login/
If needed: there are ways to get session xml in flowscript or jxtemplates,
just give a sign if you
need these (they are somewhere on the mail archives too).
Kind regards,
Jan
Ilja Smoli wrote:
Thx for reply
But as I understood authentication fw stores session object as xml
and i can not get attributes using {session:} :(
Bowe, Bastian [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
Never used session. But can't you use {session:username} as a
map:parameter/ for your map:transform type=xsl/ ?

-Original Message-
From: Ilja Smoli [mailto:[EMAIL PROTECTED]
Sent: Monday, February 14, 2005 2:33 PM
To: users@cocoon.apache.org
Subject: session context
Hi
I use authentification framework in cocoon 2.1.5...
I know that to get data out of session I can use
session:getxml... tag But what if i need this in XSL
stylesheet? Or for example in my xml page where i want to put
some value from session to link as query parameter? Smth like:
---
?xml version=1.0?
page
titleHome/title
content
center
a href='edit-form-person?user=HERE must go
username from session'Edit profile/abr/ 
Thx in advance...

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: Access UserId in a JX page without Authentication-handler

2005-02-07 Thread Jan Hoskens
gioni wrote:
Christoph Hermann wrote:
Hello,
on some pages i want to display a login-form wheter the User is logged 
in or not.
Therefore i need to know if the User is logged in. Is there a way i 
can do this when the page i server is not enclosed in a map:act 
type=auth-protect
?

I tried
${cocoon.session.getAttribute(org.apache.cocoon.webapps.session.context.SessionContext).get(authentication).getValueOfNode( 
authentication/ID)} and 
${cocoon.session.getAttribute(org.apache.cocoon.webapps.session.context.SessionContext).get(authentication).getValueOfNode( 
ID)} (found this with google) but none of these work.

These two lines will only work inside the auth-protect action because only then a sessioncontext 
named authentication is available. Whenever that action fails, the user is not logged in and the 
authentication handler mechanism will redirect you to a login page.

Are you aiming at a site where you can log in on every page and show more info/pages if you are 
logged in? You might want to consider using a guest user/role so that everyone visiting the site is 
automatically logged in, but with restrictions attached to that role/user (so show login form if 
id/role is guest/guest) and only when logging in as a real user/role more options/pages are available.

Do check if you're satisfied with the authentication framework and see if it 
suits your needs:
 http://cocoon.apache.org/2.1/developing/webapps/authentication.html
, remember that the framework isn't the perfect solution for every problem.
Kind Regards,
Jan
 

I use the contaioner authentication (with tomcat or jetty), and get the 
username in the flowscript simple using cocoon.request.getRemoteUser() 
this return the username when is called.

Bye Gioni
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: bit of brotherly help...

2005-01-27 Thread Jan Hoskens
beyaRecords wrote:
Hi,
I was just wondering if there are any cocoon heads out there who have 
access to an I.E browser on an windows platform that can tell me whether 
my site is visible when accessed from the browser?

http://www.beyarecords.com
Yes, I can see your site properly on my winxp with IE6 as well as on 
firefox!
If you view source in the browser, you will see that I have placed an 
external tag (test) around the html tag, and this tag picks up some xml 
info:

test xmlns:cinclude=http://apache.org/cocoon/include/1.0;
If I don't place the tag around the html tag I get:
html xmlns:cinclude=http://apache.org/cocoon/include/1.0;
When this happens none of the javascript will work in any browser on MAC 
OS X, but if I leave the tag in then nothing appears in an IE browser.

All xsl pages are being transformed as xsltc and the serialize type is 
xhtml.

What to do?
Well if you experience problems with namespaces popping up in your xhtml you can always remove all 
of them by extending the XMLSerializer:

public class XMLSerializer extends org.apache.cocoon.serialization.XMLSerializer
{
public void endPrefixMapping(String prefix) throws SAXException
{
// do nothing
}
public void startPrefixMapping(String prefix, String uri)
throws SAXException
{
// do nothing
}
}
This way no xmlns:cinclude=http://apache.org/cocoon/include/1.0; will bother 
your html page.
(I did the same to avoid pages with unreadable xml, containing dozens of xmlns 
on various elements)
Kind Regards,
Jan
regards
Uzo

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: bit of brotherly help...

2005-01-27 Thread Jan Hoskens
FYI: I use this declaration for my xhtml serialization:
map:serializer logger=sitemap.serializer.xhtml mime-type=text/html; charset=utf-8 name=xhtml 
pool-grow=2 pool-max=64 pool-min=10 src=org.mycompany.cocoon.serialization.XMLSerializer
 	doctype-public-//W3C//DTD XHTML 1.0 Strict//EN/doctype-public
 	doctype-systemhttp://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd/doctype-system
	encodingUTF-8/encoding
/map:serializer

Kind Regards,
Jan
beyaRecords wrote:
On 27 Jan 2005, at 10:43, Jan Hoskens wrote:
public class XMLSerializer extends 
org.apache.cocoon.serialization.XMLSerializer
{

public void endPrefixMapping(String prefix) throws SAXException
{
// do nothing
}
public void startPrefixMapping(String prefix, String uri)
throws SAXException
{
// do nothing
}
}

Hi Jan,
I like the sound of what you are saying but could you please expand on 
your explanation?

So I create my new XMLSerializer class but how do I call it into my 
sitemap?

many regards
Uzo
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: transformation from XML to excel only works with one element set

2005-01-27 Thread Jan Hoskens
You might want to try this:
 gmr:Cells
xsl:apply-templates select=page/content/rowset/row
xsl:with-param name=rowposition select=position()/
/xsl:apply-templates
 /gmr:Cells

and then use xsl:param name=rowposition/ where you need to set Row= instead of re-counting 
your rows every time. Also this: you might want to set your Row directly through a shortcut:
gmr:Cell Row={$rowposition} as the content of {} will be evaluated by xsl.

xsl:variable name=rownumberxsl:number level=any from=content
 count=row//xsl:variable
   xsl:attribute name=Row
  xsl:value-of select=$rownumber/
   /xsl:attribute

Didn't try this myself but think this might work.
Kind Regards,
Jan

Philipp Rech wrote:
Hello Cocooners,
[Cocoon Version 2.1.6]
i have the following xml file (see below) which is the result of a db querry
(from Cocoon)... when i transfrom it with the stylesheet (see below) using the
transfomer within Cocoon an excel sheet opens but with only one row in it (the
one with the last id) but i need all elements in diferent rows... so only the
last row element with the eventid2/eventid gets displayed but not both of
them... my guess was thet the first one is processed but is overwritten by the
last one (see my xml and xsl file below)
thank you very much!
phil
ps: i already asekd on the poi-user list but
got no reply...
here is my xml file:

?xml version=1.0 encoding=ISO-8859-1 ? 
page
content
rowset xmlns:sql=http://apache.org/cocoon/SQL/2.0;
xmlns=http://apache.org/cocoon/SQL/2.0;
 row
  eventid3/eventid 
  typeofcontrolControl Type A/typeofcontrol 
  trafficdirectionEntry/trafficdirection 
  checkpointBlue Border/checkpoint 
  klassificationilligal/klassification 
  checklocationblack sea/checklocation 
  guard_1Philipp/guard_1 
  guard_2Peter Pan/guard_2 
  objectionsmug/objection 
  dtg2005-01-01/dtg 
  locationblack sea/location 
  description/description 
  numberofpersons3/numberofpersons 
  observedYes/observed 
/row
row
  eventid2/eventid 
  typeofcontrolControl Type B/typeofcontrol 
  trafficdirectionLeave/trafficdirection 
  checkpointAirport/checkpoint 
  klassificationilligal entry/klassification 
  checklocationairport hall 2/checklocation 
  guard_1Philipp/guard_1 
  guard_2Stepht/guard_2 
  objectionilligal enrty/objection 
  dtg2005-01-12/dtg 
  locationairport somewhere/location 
  descriptionnone/description 
  numberofpersons1/numberofpersons 
  observedNo/observed 
  /row
   /rowset
  /content
  /page
-
 

here is my xsl file:
-
?xml version=1.0?
xsl:stylesheet version=1.0 xmlns:xsl=http://www.w3.org/1999/XSL/Transform;
  xmlns:sql=http://apache.org/cocoon/SQL/2.0;
 xmlns:gmr=http://www.gnome.org/gnumeric/v7; 
  xsl:template match=/
   gmr:Workbook xmlns:gmr=http://www.gnome.org/gnumeric/v7;
 gmr:Sheets
 gmr:Sheet DisplayFormulas=false HideZero=false HideGrid=false
HideColHeader=false HideRowHeader=false DisplayOutlines=true
OutlineSymbolsBelow=true OutlineSymbolsRight=true
 gmr:NameBIHS - Event Data/gmr:Name
 gmr:MaxCol2/gmr:MaxCol
 gmr:Cols DefaultSizePts=48
 gmr:ColInfo No=0 Unit=48 MarginA=2 MarginB=2
Count=7/
 /gmr:Cols
 gmr:Rows DefaultSizePts=12.8
gmr:RowInfo No=0 Unit=12.8 MarginA=0 MarginB=0 
Count=9/
gmr:RowInfo No=10 Unit=12.8 MarginA=1 MarginB=0 
Count=24/
 /gmr:Rows
 gmr:Cells
xsl:apply-templates/
 /gmr:Cells
/gmr:Sheet
 /gmr:Sheets
/gmr:Workbook
  /xsl:template

  xsl:template match=sql:eventid
 gmr:Cell Col=0 ValueType=60
  xsl:variable name=rownumberxsl:number level=any from=content
count=row//xsl:variable
  xsl:attribute name=Row
 xsl:value-of select=$rownumber/
  /xsl:attribute
   gmr:Content
		xsl:apply-templates/ 
	/gmr:Content
 /gmr:Cell
  /xsl:template
  
  
  xsl:template match=sql:typeofcontrol
 gmr:Cell Col=1 ValueType=60
  xsl:variable name=rownumberxsl:number level=any from=content
count=row//xsl:variable
  xsl:attribute name=Row
 xsl:value-of select=$rownumber/
  /xsl:attribute
   gmr:Content
		xsl:apply-templates/ 
	/gmr:Content
 /gmr:Cell
  /xsl:template

  xsl:template match=sql:trafficdirection
 gmr:Cell Col=2 ValueType=60
  xsl:variable name=rownumberxsl:number level=any from=content
count=row//xsl:variable
  xsl:attribute name=Row
 xsl:value-of select=$rownumber/
  /xsl:attribute
   gmr:Content
		xsl:apply-templates/ 
	/gmr:Content
 /gmr:Cell
  /xsl:template


  xsl:template match=sql:checkpoint 
 gmr:Cell Col=3 ValueType=60
  xsl:variable name=rownumberxsl:number level=any from=content
count=row//xsl:variable
  

Re: bit of brotherly help...

2005-01-27 Thread Jan Hoskens
Ok, I'll make it easy for you, just copy this:
package org.yourcompany.cocoon.serialization;
import org.xml.sax.SAXException;
/**
 * A simple serializer, extending XMLSerializer to avoid getting namespaces in
 * output. (Thus only overriding prefixmapping methods to do nothing.)
 *
 * This is most usefull for xhtml outputting.
 *
 */
public class XMLSerializer extends org.apache.cocoon.serialization.XMLSerializer
{
public void endPrefixMapping(String prefix) throws SAXException
{
// do nothing
}
public void startPrefixMapping(String prefix, String uri)
throws SAXException
{
// do nothing
}
}
Then compile with the following jars added to your buildpath:
  avalon-framework-api-4.2.0.jar
  avalon-framework-impl-4.2.0.jar
  cocoon-2.1.5.jar
  excalibur-sourceresolve-2.0.jar
  excalibur-xmlutil-1.0.jar
  excalibur-pool-1.2.jar
  regexp-1.3.jar
I don't know if you need them all (last one probably not, other's not sure as I have other 
transformers/serializers/generators as well). These files can be found in your cocoon/WEB-INF/lib 
directory, possibly with another version.

Kind Regards,
Jan
beyaRecords wrote:
On 27 Jan 2005, at 10:43, Jan Hoskens wrote:
public class XMLSerializer extends 
org.apache.cocoon.serialization.XMLSerializer
{

public void endPrefixMapping(String prefix) throws SAXException
{
// do nothing
}
public void startPrefixMapping(String prefix, String uri)
throws SAXException
{
// do nothing
}
}

Hi,
i'm gonna call this class from my own package as so:
package test
all I need to know is what package I need to import and what jar file it 
sits in? so:

package test
import ?
public class myXMLSerializer extends 
org.apache.cocoon.serialization.XMLSerializer

regards
Uzo
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: bit of brotherly help...

2005-01-27 Thread Jan Hoskens
At first sight, everything should be fine.
A few things you can check:
- your custom serializer doesn't contain any super.blablah(..)
- the mentioned pipeline is the correct one and is called on its own. No other pipelines 
calling/including this one? Try altering the page to be sure it's the correct one. Check your logs 
to see where the sitemap matches your request.
- restart the whole bunch (tomcat or whatever you're using) and clear the workdir if you're cocoon 
starts acting funny (can help sometimes)

I'm using the serializer myself (3 different sites now) and am experiencing no problems concerning 
xmlns namespaces.

Kind Regards,
Jan
beyaRecords wrote:

On 27 Jan 2005, at 12:26, beyaRecords wrote:
done and works a treat. many thanks.
Ok,
I have implemented the following:
map:serializer logger=sitemap.serializer.xhtml mime-type=text/html 
name=myxml pool-grow=2 pool-max=64 pool-min=10 
src=test.myXMLSerializer
doctype-public-//W3C//DTD XHTML 1.0 Transitional//EN/doctype-public

doctype-systemhttp://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd/doctype-system 

encodingISO-8859-1/encoding
/map:serializer

!-- = --
!-- Holding page --
!-- = --
map:match pattern=holding.xml
map:generate type=jx src=jx/holding.jx/
map:transform type=xsltc src=style/holding.xsl/
map:transform type=cinclude/
map:serialize type=myxml/
/map:match
And still when I view source in the browser I see:
*xmlns:cinclude=http://apache.org/cocoon/include/1.0*
what am I doing wrong here?
regards
Uzo

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: bit of brotherly help...

2005-01-27 Thread Jan Hoskens
beyaRecords wrote:
On 27 Jan 2005, at 14:13, Jan Hoskens wrote:
- your custom serializer doesn't contain any super.blablah(..)
- the mentioned pipeline is the correct one and is called on its own. 
No other pipelines calling/including this one? Try altering the page 
to be sure it's the correct one. Check your logs to see where the 
sitemap matches your request.
- restart the whole bunch (tomcat or whatever you're using) and clear 
the workdir if you're cocoon starts acting funny (can help sometimes)

Jan,
I have checked all that you mention and there is nothing out of place. 
h... puzzling!

Hmm yeah, you got me there... ;-)
If only I could meet that troublemaker head-on, grrr...
What about a simple test with a page containing nothing but a few xmlns namespaces, running it 
through the html serializer once, check if there are xmlns (there should be) and then replace that 
serialzer by your customserializer and check again(there should be none)?

btw, what version of cocoon are u using? (not that it should matter ...)
Kind Regards,
Jan
regards
Uzo
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: bit of brotherly help...

2005-01-27 Thread Jan Hoskens
beyaRecords wrote:
On 27 Jan 2005, at 15:25, Jan Hoskens wrote:
What about a simple test with a page containing nothing but a few 
xmlns namespaces, running it through the html serializer once, check 
if there are xmlns (there should be) and then replace that serialzer 
by your customserializer and check again(there should be none)?

btw, what version of cocoon are u using? (not that it should matter ...)

Jan,
firstly i am running cocoon 2.1.6. My xslt file is specified top and 
bottom as follows:

?xml version=1.0 encoding=ISO-8859-1?
xsl:stylesheet version=1.0
xmlns:cinclude=http://apache.org/cocoon/include/1.0;
xmlns:xsl=http://www.w3.org/1999/XSL/Transform;

xsl:template match=/
test

html

/html

/test
/xsl:template
   
xsl:template match=*
  xsl:element name={local-name()}
xsl:apply-templates select=@*|xmlns|node()/
  /xsl:element
/xsl:template

xsl:template match=@*|text() priority=-1
  xsl:copy/
/xsl:template

   
/xsl:stylesheet

Now, as you can see I have 2 xmlns declarations and only the cinclude 
one appears all the time. So I changed the serializer type to html as 
you suggested and the xmlns line was still in the final html output!! 
Should I send my sitemap, xsl, and jxt file to you to have a look?

Sure, send it, I'll take a look, I haven't got time to do it right away, but I can test it tomorrow 
if you like.

Kind Regards,
Jan
regards
Uzo
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: jxtemplate: cocoon.request.locale??

2005-01-20 Thread Jan Hoskens
The variables ${cocoon} and ${cocoon.request.locale} should have values.
(if I use them in my jx, I do get an object/locale) Are you using jx 
correctly (generator type=jx, or transformer)? Can you give more 
information regarding the context?

Kind Regards,
Jan
oceatoon wrote:
by looking at the content of ${cocoon} it seems that the request object in
that context is null??? where as the docs seem to specify it ??
Can someone confirm this? 
Thanks 
Tibor



Hi
I trying to retreive the value of my locale paramater in the url from
within jx but , with a url /url?locale=fr ${cocoon.request.locale} returns
nothing. It seems to be in the docs though. am I doing something wrong or
is it jx?
Thanks
Tibor


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: Another fw-auth question

2005-01-12 Thread Jan Hoskens
You're using the cocoon:raw protocol, this means no request-params are 
passed to your handler:

snip
You might be wondering why we explicitly pass the request parameters on 
to the internal pipeline call. Note that the authentication resource of 
the portalhandler is defined by cocoon:raw. By using this, no request 
parameter of the original request is passed on to the internal pipeline 
by default and therefore we have to define them explicitly. If you use 
cocoon: then the parameters of the form are by default passed on to the 
authentication resource and we could omit the parameter definition from 
above. But we feel that it is safer to explicitly define them.
/snip

at: http://cocoon.apache.org/2.1/developing/webapps/authentication.html
If you use cocoon:/ you're request parameters should be available in 
your xsp page.

On the other hand passing parameters to your handler should work also 
(so cocoon:raw can be used). But I see that your action is a bit wrong 
with parameter naming:

snip
map:act type=auth-login
 map:parameter name=handler value=auth-handler/
 map:parameter name=param_username value={request-param:username}/
...
/snip
the docs say:
snip
...The name of this parameter has to start with parameter_. ...
/snip
so try using map:parameter name=parameter_username value=.../ 
instead (change names of other parameters as well of course ) to pass 
the parameters, then use them in your xsp without the prefix parameter_.

I hope one of these remarks will solve your problem! ;-)
Kind Regards,
Jan
Jon Tonberg wrote:
Hello all
I apologise in advance for the length of this email, but I'm at the 
pulling hair out stage with this one. 

I wonder if anyone can help me out here - I'm having problems with 
authentication in Cocoon 2.1.6, (under Tomcat 4.1, Java 1.4.1).

In the past, I've successfully implemented sunrise authentication in 
previous versions of Cocoon (e.g. 2.0.4) but am struggling with one 
particular issue under 2.1.6.

I am using an XSP to implement my authentication handler.  My specific 
problem is that the handler match cannot read the {request-param:XXX} 
parameters or any sitemap parameters instantiated by the login match. 

The login match can see the request parameters POSTed from the login 
page, but if I then instantiate those as sitemap parameters, they cannot 
be read by the subsequent handler match.

Incidentally, if I hardcode the parameters in the handler match, the XSP 
runs correctly and authenticates using the hardcoded parameters, so it 
is not an XSP problem.  The XSP tries to pick up the sitemap parameters 
(e.g. username and password).  I have also tried to pick up the request 
object parameters from within the XSP - this does not work.

I don't remember having this issue with 2.0.4, but it's highly likely 
that I'm doing something silly here and just can't see it.  Any pointers 
would be very welcome - I've trawled the mailing list archives, docs and 
wiki but don't seem to be getting any further.

To illustrate, here are some relevant snippets from my sitemap: -
!-- AUTHENTICATION MANAGER --
authentication-manager
handlers
handler name=auth-handler
!-- login resource --
redirect-to uri=cocoon:/login-page/
!-- authentication resource --
authentication uri=cocoon:raw:/auth-user/
/handler
/handlers
/authentication-manager
map:pipeline internal-only=true
!-- USER AUTH HANDLER --
map:match pattern=auth-user
map:generate type=serverpages 
src=serverpages/auth-user.xsp

!-- PROBLEM - SITEMAP/REQUEST PARAMETERS ARE 
LOST AT THIS POINT --
!-- I'VE TRIED THREE DIFFERENT METHODS OF 
GETTING PARAMETERS TO
 THE XSP ...

 1. IF I HARD CODE THE PARAMETERS, THEN MY 
AUTHENTICATION
 WORKS --

!--map:parameter name=param_username 
value=XYZ/
map:parameter name=param_password 
value=XYZ/--
   
!-- 2. USING THIS METHOD, PARAMETERS REMAIN 
UNINSTANTIATED --

map:parameter name=param_username 
value={param_username}/
map:parameter name=param_password 
value={param_username}/
   
!-- 3. USING THIS METHOD, PARAMETERS REMAIN 
UNINSTANTIATED --

!--map:parameter name=param_username 
value={request-param:username}/
map:parameter name=param_password 
value={request-param:password}/--
/map:generate
map:serialize type=xml/
/map:match
/map:pipeline


map:pipeline
   
!-- LOGIN FORM --

map:match pattern=login-page
map:generate src=deployed/xml/login.xml/
 

Re: repeater widget and binding

2005-01-10 Thread Jan Hoskens
Have you looked at the samples that ship with cocoon?
There are a number of examples which use a repeater. Look for the Forms 
folder under your webapp: \samples\blocks\forms\ and browse the dirs 
there.

If the samples are not clear, try to ask more specific questions and 
include your own trials, that makes things easier to answer/react.

Kind Regards,
Jan
Murray Cassie wrote:
Hi all,
does anyone have an example and could send it for the
binding xml for form fields created by a repeater
widget?
Second question: if we use the repeater widget in the
definition file, can we specify different labels for
the repeated widgets? If available I would be thankful
for an example there.
Thanks and cheers
Cassie
__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Sessioncontext/authenticationcontext + JX

2005-01-06 Thread Jan Hoskens
Hi,
As I'm trying to reduce/replace my XSP pages (mainly) by switching to 
flow/jx I was experimenting on how I could grab some information from a 
sessioncontext and my authenticationcontext. I had an Info XSP page 
with a pipeline that's used by my overal page layout (think of user info 
that's visible at all times or are adapted while progressing through the 
site). In that page I called the xsp-session-fw:... sheet to 
accomplish this.

To replace my xsp (I want to stick with jx/flow now) I thought of some 
possibilities like:
- write an action and set a variable (eg in request) containing an xml 
structure that will be included in the overal layout
- write a transformer/generator to create the xml structure.
- the info pipeline calls a flow to extract the info vars and a jx 
infopage includes these variables in an xml structure.

But at the end, I stumbled upon this (using jexl in a jx page):
	 
${cocoon.session.getAttribute(org.apache.cocoon.webapps.session.context.SessionContext).get(mycontextname).getValueOfNode(mypath)}
	 
${cocoon.session.getAttribute(org.apache.cocoon.webapps.authentication.components.DefaultAuthenticationManager/UserStatus).getHandler(VbAuthenticationHandler).getUserId()}

which works fine and I can use this in my overal page layout as this is 
a jx page with includes to fetch the actual page. (so I'm having one 
pipeline, the info-pipe, less than usual)

Now I'm posting this for several reasons:
1) you may have the same problem fetching the 
sessioncontext/authentication, so this may be interesting for you to use.
2) I'm wondering if I'm forgetting something here that makes this 
construction hazardous.
3) and finally: maybe it's interesting to have another variable 
cocoon.sessioncontext available to be able to create constructions 
such as: ${cocoon.sessioncontext.mycontextname.somepath} and maybe the 
same for authentication (but that one's a block, so I'm not sure).

Does this make any sense?
Any comments are welcome!
Kind Regards,
Jan
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: Chaining

2005-01-06 Thread Jan Hoskens
Mark Donnelly wrote:
Sorry but my question was incorrectly stated.
A standard pipeline with a transform and a serialise will take care of the
problem I originally posted.
What Im wondering is if I need to do multiple transformations, ie transform
an XML doc using two or more different XSLT docs. and then
feed the results into various serialisers, how this is done?
What do you mean various serializers? You cannot send multiple responses 
back to a client. But if you want to be able to get the same page in 
different formats, you may want to use views (if I remember correctly):

map:view from-label=pdf name=pdf
map:transform src=stylesheets/page2pdf.xsl/
map:serialize type=fo2pdf/
/map:view
then in your pipe:
map:match...
	map:sometransformer label=pdf/ !-- this label says, you can have 
another view behind me using the from-label --
	map:serialize type=html/
/map:match

and call this with myURL?cocoon-view=pdf to get the pdf version. (look 
at http://cocoon.apache.org/2.1/userdocs/concepts/views.html for more info)

If you want to have some other pipeline executed eg: write some document 
to disk and send a reply with another pipe, you can use the following in 
your flow:

var pipelineUtil = 
cocoon.createObject(Packages.org.apache.cocoon.components.flow.util.PipelineUtil);
var document = pipelineUtil.processToDOM(mypipe, null);
(or processToSAX/processToStream)
cocoon.sendPage(otherpipe);

Is this what you're referring to? Or can you give a concrete example of 
what you're trying to do?

Kind Regards,
Jan

Mark
-Original Message-
From: Mark Donnelly [mailto:[EMAIL PROTECTED]
Sent: 06 January 2005 12:54
To: 'users@cocoon.apache.org'
Subject: Chaining
Hello,
Im looking to chain a number of 'actions' together:
1. Transform an XML document using XSLT to get XSL:FO
2. Put this XSL:FO into FOP to get pdf.
Im new to Cocoon and whilst Ive read a fair bit of the documentation, I
havent been able to fathom what a pipeline for this would look like. 
Ive got an idea of how to create each one independantly but not sure how to
take the output of 1. and feed it into 2. on the fly.

Any pointers would be appreciated.
Mark
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: Dynamic CInclude

2005-01-04 Thread Jan Hoskens
Gaston Martini wrote:
Hi,
We're using CInclude for caching purposes and we need to specify its
src attribute dinamically, i.e. the value of src is not known in
advance.
We tried some combinations with xsp:expr, with no luck. For example,
trying to output the entire cinclude:
xsp:exprtest/xsp:expr
with String test = cinclude:cached-include src=\cocoon:/some_pipeline\/,
results in '' and '' being translated to lt; and gt;:
lt;cinclude:cached-include src=\cocoon:/some_pipeline\/gt;
We also tried some other approaches, but nothing worked.
Any suggestions?
Thanks in advance,
Gaston  Martin.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

I use jx to do the following in my sitemap resource (page parameter is 
given by map:parameter):

cinclude:include src=cocoon:/${cocoon.parameters.page} /
Before switching to flow-jxtemplate combination I used xsp:
xsp:logic
String dir = mydir;
/xsp:logic	
cinclude:include
	xsp:attribute 
name=srccocoon:/xsp:exprdir/xsp:expr/file.xml/xsp:attribute
/cinclude:include

which worked fine.
Remember that the overall cocoon-way-of-thinking heads towards the 
flowscript(glue to your business-logic) and jxtemplate combination 
instead of xsp. (not that you have to do this of course ;-)

Kind Regards,
Jan
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: how to POST http to a servlet?

2005-01-03 Thread Jan Hoskens
Harry Stangel wrote:
How can I use Cocoon to POST (not GET) an http request to a servlet?
Best,
Harry
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

I use the following to post a request to my xreporter servlet:
map:generate type=wsproxy  	
src={global:xreporter-host}/reports?lang=en-USamp;user={session-context:authentication/authentication/ID}amp;dataSourceId={datasource}amp;reportId={reportid}{interaction} 

map:parameter name=wsproxy-method value=POST/
/map:generate
Kind Regards,
Jan
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: File system access in flowscript

2004-12-20 Thread Jan Hoskens
When accessing a file, you need to resolve it's uri. Resolving will 
suffix a path the same way as used in the sitemap.

eg: in your webapp's sitemap you use pages/mywelcomepage.xml
mywebapp/pages/mywelcomepage.xml
mywebapp/sitemap.xmap
then resolving will add the whole path /.../mywebapp/ in front of your 
relative path pages/mywelcomepage.xml.

I tend to use a simple function for this in my flowscript:
function resolveToFile(uri)
{
   var resolver = null;
   var filesource = null;
   try
   {
  resolver = 
cocoon.getComponent(Packages.org.apache.cocoon.environment.SourceResolver.ROLE);
  filesource = resolver.resolveURI(uri);
  var file = new java.io.File(new java.net.URI(filesource.getURI()));
  return file;
   }
   finally
   {
  if(filesource != null) resolver.release(filesource);
  cocoon.releaseComponent(resolver);
   }
}

Kind Regards,
Jan
Marc Salvetti wrote:
Hello,
i'm trying to access some of the xml files in my webapp directly from 
the flowscript for creation/deletion
i can't find a way to adress the correct directory of the servlet

i tried request:contextPath but it gives only a partial path, i also 
tried servletPath but it gives the uri of the calling page

what i'd like to do look like this :
   var path = contextPath + /cfm/xdocs/planning/cruise7.xml;
   var file = new Packages.java.io.File( path);
   if(!file.isFile()){print(file.getCanonicalPath());}
Does anyone have a working example of how to get the full path of the 
directory where my xml files are ?
Or maybe a better idea ? ;)

Thanks for any help,
Marc
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: Request parameters form flow script to jx

2004-12-19 Thread Jan Hoskens
First thing you need to do is check your version of Form.js. It should 
be something like

cocoon.load(resource://org/apache/cocoon/forms/flow/javascript/Form.js);
but may vary at the end with v2/Form.js or v3/Form.js.
If you're using v2, then you're definitely in trouble, as this version 
doesn't support passing of a bizdata object. Otherwise you can pass a 
bizdata as you would when using cocoon.sendPage():

var bizdata = { username : model.name };
formSuccess.showForm(registration-display-pipeline, bizdata);
then use it in your template with eg jexl: ${username}
In the future, v2 and v3 will likely be dropped. Hopefully they do pass 
some functionality to v1 when this happens.

Kind Regards,
Jan
angeloimm wrote:
Hi... yes i have read this sample; in the flow.script there is:
cocoon.load(resource://org/apache/cocoon/forms/flow/javascript/Form.js);
function registration() {
var form = new Form(forms/registration.xml);
// The showForm function will keep redisplaying the form until
// everything is valid
form.showForm(registration-display-pipeline);
var model = form.getModel();
var bizdata = { username : model.name }
cocoon.sendPage(registration-success-pipeline.jx, bizdata);
}
As you can see it send to registration-success-pipeline.jx the bizData 
object but this is done by using cocoon.sendPage; now i'ld like to do a 
similar thing but by using showForm and not sendPage this is what mi chief 
wants so i have thinked to do for example:
function registration() {
var form = new Form(forms/registration.xml);
// The showForm function will keep redisplaying the form until
// everything is valid
form.showForm(registration-display-pipeline);
var model = form.getModel();
var bizdata = { username : model.name };
cocoon.request.setAttribute( myBizData, bizData );
var formSuccess = new Form(forms/registration.xml);
formSuccess.showForm(registration-display-pipeline);
}
The problem is that in the jx file i'm not able to recover this attribute... 
how can i do?

-- Initial Header ---
From  : Jon Evans [EMAIL PROTECTED]
To  : [EMAIL PROTECTED]
Cc  : 
Date  : Fri, 17 Dec 2004 14:04:08 +
Subject : Re: Request parameters form flow script to jx


Hi,
On 17 Dec 2004, at 13:46, angeloimm wrote:

Hi... first of all thanks for your reply. Now... have you ever tried 
it? I have tried and i have an error that says: function expected 
instead of an Object so i can't go on this way. can you send a 
working sample?
Take a look at the registration sample 
http://localhost:/samples/blocks/forms/registration

It uses flow, and has a jx result page which displays your username 
with:

Registration was successful for ${username}!
Cheers,
Jon
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Regala e regalati Libero ADSL: 3 mesi gratis, navighi veloce e scarichi a 1.2 Mega. 
Abbonati subito senza costi di attivazione su http://www.libero.it


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: Invalid Continuation ID

2004-12-13 Thread Jan Hoskens

Upayavira wrote:
Jan Hoskens wrote:
I've let him log out of the system (even restart the browser) but he 
still got the same error on that one form, but not on the other 
forms. I cannot reproduce this error, but I guided the person through 
some basic tests by phone conversation. This way I could let him edit 
other forms and restart the whole process, but still with the same 
result. (I got to add that by phone, you're never really sure the 
person is doing what you think you've said ;-)) So I'm trying to 
think of some extra things to check or test and to contact the person 
again.

One immediate question is what is the continuation ID that is shown 
to be in error? If he sees the same continuation ID each time, you 
know his browser is playing up, because Cocoon couldn't be serving the 
same continuation ID.
Shame on me not to think of that (looked in detail at one error only)! 
You're right, the same ID is popping up on the errors (logged over 
several days). So it's definitely the browser requesting an old flow ID 
(it's IE , as you could have guessed).

So now I'll need to configure their IE correctly, update it or even 
better : convince them to use firefox ;-).

Thanks a lot Upayavira!
Regards,
Jan
Has he/could he try the same thing with a different browser? Firefox, 
for example? Or on a different PC?

Regards, Upayavira
Upayavira wrote:
Probably simple.
The continuation is a short lived object, maybe 30 minutes, or so.
He has a form, that contains the continuation ID. When he submits 
it, he gets that error. You try to fix something, he then tries to 
resubmit it, and gets the same error. Now, of course he would, he's 
still got the same continuation ID embedded within the form he's 
looking at.

What happens if he logs out of the site, goes back in and finds his 
way to the faulty form. Does it still not work?

Regards, Upayavira
Jan Hoskens wrote:
Hi all,
I have a site working with cocoon 2.1.5 and cforms. everything 
appears to be fine, but today someone tried to access a particular 
form and got the following exception:

ERROR   (2004-12-10) 11:21.46:174   [sitemap.handled-errors] 
(/voorbereidingen/2010/Vb1_1_1_0_13_01_2005/continue.html) 
Ajp13Processor[8013][9]/PipelineNode: The continuation ID 
705b073d862e2d657e5b352b113451130f534f24 is invalid.
org.apache.cocoon.components.flow.InvalidContinuationException: The 
continuation ID 705b073d862e2d657e5b352b113451130f534f24 is invalid.

I tried the same from my end, but I did not get the exception 
(never had this problem). Stranger still is that the person can 
edit/view other forms,  but that one form always results in the 
same error when he tries to submit it. As far as I can see all the 
forms work in a similar way, and thus I'm a bit confused. How can 
one continuation work fine, while another one doesn't? And taking 
into account that it does work with all other pc/browser 
combinations??

Every hint is welcome here!
Kind regards,
Jan


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: Invalid Continuation ID

2004-12-12 Thread Jan Hoskens
I've let him log out of the system (even restart the browser) but he 
still got the same error on that one form, but not on the other forms. I 
cannot reproduce this error, but I guided the person through some basic 
tests by phone conversation. This way I could let him edit other forms 
and restart the whole process, but still with the same result. (I got to 
add that by phone, you're never really sure the person is doing what you 
think you've said ;-)) So I'm trying to think of some extra things to 
check or test and to contact the person again.

Thanks for the reply,
Jan
Upayavira wrote:
Probably simple.
The continuation is a short lived object, maybe 30 minutes, or so.
He has a form, that contains the continuation ID. When he submits it, 
he gets that error. You try to fix something, he then tries to 
resubmit it, and gets the same error. Now, of course he would, he's 
still got the same continuation ID embedded within the form he's 
looking at.

What happens if he logs out of the site, goes back in and finds his 
way to the faulty form. Does it still not work?

Regards, Upayavira
Jan Hoskens wrote:
Hi all,
I have a site working with cocoon 2.1.5 and cforms. everything 
appears to be fine, but today someone tried to access a particular 
form and got the following exception:

ERROR   (2004-12-10) 11:21.46:174   [sitemap.handled-errors] 
(/voorbereidingen/2010/Vb1_1_1_0_13_01_2005/continue.html) 
Ajp13Processor[8013][9]/PipelineNode: The continuation ID 
705b073d862e2d657e5b352b113451130f534f24 is invalid.
org.apache.cocoon.components.flow.InvalidContinuationException: The 
continuation ID 705b073d862e2d657e5b352b113451130f534f24 is invalid.

I tried the same from my end, but I did not get the exception (never 
had this problem). Stranger still is that the person can edit/view 
other forms,  but that one form always results in the same error when 
he tries to submit it. As far as I can see all the forms work in a 
similar way, and thus I'm a bit confused. How can one continuation 
work fine, while another one doesn't? And taking into account that it 
does work with all other pc/browser combinations??

Every hint is welcome here!
Kind regards,
Jan
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Invalid Continuation ID

2004-12-10 Thread Jan Hoskens
Hi all,
I have a site working with cocoon 2.1.5 and cforms. everything appears 
to be fine, but today someone tried to access a particular form and got 
the following exception:

ERROR   (2004-12-10) 11:21.46:174   [sitemap.handled-errors] 
(/voorbereidingen/2010/Vb1_1_1_0_13_01_2005/continue.html) 
Ajp13Processor[8013][9]/PipelineNode: The continuation ID 
705b073d862e2d657e5b352b113451130f534f24 is invalid.
org.apache.cocoon.components.flow.InvalidContinuationException: The 
continuation ID 705b073d862e2d657e5b352b113451130f534f24 is invalid.

I tried the same from my end, but I did not get the exception (never had 
this problem). Stranger still is that the person can edit/view other 
forms,  but that one form always results in the same error when he tries 
to submit it. As far as I can see all the forms work in a similar way, 
and thus I'm a bit confused. How can one continuation work fine, while 
another one doesn't? And taking into account that it does work with all 
other pc/browser combinations??

Every hint is welcome here!
Kind regards,
Jan
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: Getting Authentication info

2004-12-09 Thread Jan Hoskens
Hi,
You can get your context-related sessions through the ContextManager:
http://cocoon.apache.org/2.1/apidocs/org/apache/cocoon/webapps/session/ContextManager.html
Here you can manage all your session context stuff through the 
SessionContext object:
http://cocoon.apache.org/2.1/apidocs/org/apache/cocoon/webapps/session/context/SessionContext.html

eg:
[1] In my flow I use the following to get information from the 
authentication session (or another context related session):

var contextMan = null;
try{
   contextMan 
=cocoon.getComponent(Packages.org.apache.cocoon.webapps.session.ContextManager.ROLE);
   var sessionContext = contextMan.getContext(authentication);
   var id = sessionContext.getValueOfNode(/authentication/ID);
   var myData = sessionContext.getXML(/authentication/data/myData);
}
finally{
   cocoon.releaseComponent(contextMan);
}   

[2] In my custom generator I can do the same by extending from a 
ServiceableGenerator (has a manager to lookup stuff like in the flow sample)
and basically do the same as the previous code:

public class myGenerator extends ServiceableGenerator{
   ContextManager contextManager = (ContextManager) 
this.manager.lookup(ContextManager.ROLE);
   SessionContext sessionContext = 
contextManager.getContext(authentication);
   String role = sessionContext.getValueOfNode(/authentication/role);
   DocumentFragment documentFragment = 
sessionContext.getXML(/authentication/data/mydata);
}

The same way you can create/manage your own context related sessions.
Kind regards,
Jan
angeloimm wrote:
Hi; i'll try to be as clear as possible because i have seen that before i have 
not been too clear :-)
I use the authenthication framework for log user; for this reason the framework 
creates the authentication session context; in this context there is an xml 
token so made:
?xml version=1.0 encoding=ISO-8859-1 ?
  authentication xmlns:sql=http://apache.org/cocoon/SQL/2.0; 
 IDcarmelo/ID
rolestatic value undefined/role 
   data 
  token 
	permesso id=PM-GR-1 / 
	permesso id=PM-GR-2 / 
	permesso id=PM-GR-3 / 
	permesso id=PM-GR-4 / 
	permesso id=PM-GU-1 / 
 /token 
 idutente1/idutente 
 usernamecarmelo/username 
 passwordcarmelo/password 
 nome/nome 
 cognome/cognome 
 email[EMAIL PROTECTED]/email 
 statoON/stato 
   /data 
/authentication
Now i'ld like to read this xml from a Java class. how can i do?
I have written this code:

import 
org.apache.cocoon.webapps.authentication.context.AuthenticationContextProvider;
import org.apache.cocoon.webapps.session.context.SessionContext;
import org.apache.cocoon.ProcessingException;
import org.apache.log4j.Logger;
/**
* pTitle: /p
*
* pDescription: /p
*
* pCopyright: Copyright (c) 2004/p
*
* pCompany: /p
*
* @author not attributable
* @version 1.0
*/
public class CocoonSesionTest {
 
 private static Logger log = Logger.getLogger( CocoonSesionTest.class.getName() );
 public CocoonSesionTest() {
 }

 public String getDocFrag(){
   AuthenticationContextProvider au = new AuthenticationContextProvider();
   log.info( $ au è: + au );
 try {
   log.info( Calling: au.getSessionContext(authentication).getXML(authentication).getNodeName() );
   if( au == null ){
 
 return Addirittura au era null;
   }
   SessionContext sc = au.getSessionContext(authentication);
   if( sc == null ){
 
 return Il session Context era null;
   }
   return Il valore di ID è: +sc.getValueOfNode( ID );
 }
 catch (ProcessingException ex) {
   
   log.error( ex );
   ex.printStackTrace();
   return null;
   }
 }
 
 public String toString(){
   
   return Sono il tuo CocoonSesionTest;
 }
}

I have tried to use it in a flowscript:
function buildUserHomePage() {
 log.info(--buildUserHomePage-- send loggedHome.jx);
 log.info( ## Calling test ### );
 var test = new CocoonSesionTest();
 if( test == null ){
 
   log.info( Era nullo );
 }else{
 
   log.info( Non era nullo e ho avuto: + test.toString()+ Ora vediamo il metodo );
   log.info( test.getDocFrag()  );
 }
 log.info( ## Test Called ### );
 cocoon.sendPage( loggedHome.pjx );
}

This function is called when the user i logged successfully; but i have this exception:
11:23:06,467 INFO  [Admin module] ## Calling test ###
11:23:06,828 INFO  [Admin module] Non era nullo e ho avuto: Sono il tuo CocoonSesionTest Ora vediamo il metodo
11:23:32,344 INFO  [CocoonSesionTest] $ au è: [EMAIL PROTECTED]
11:23:33,927 INFO  [CocoonSesionTest] Calling: au.getSessionContext(authentication).getXML(authentication).getNodeName()
11:25:06,219 INFO  [STDOUT] file:/C:/jboss-3.2.5/server/mySever/tmp/deploy/tmp8944NikkoCM.war/Admin/flow/admin.js, line 82: uncaught JavaScript exception: 
at buildUserHomePage 

forms v2

2004-12-08 Thread Jan Hoskens
Hi,
I'm currently using forms.js v2 for one of my sites. This because I need 
the ability to create a form with a Node, not with a URI. This did help 
me at that time, but now I need to pass some bizdata to the 
form.showForm() function and it seems like v2 does not have a bizdata 
parameter and leaves me stuck there.

A while ago Bruno mentioned that v2 will be deprecated in the future, so 
I would like to return to the normal Forms.js. How can I have the Form 
creation based on a node when using this version?

Kind Regards,
Jan
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: Manipulating the DOM in flowscript

2004-11-26 Thread Jan Hoskens
try this:
var root = document.getDocumentElement();
And then operate on that root eg:
var node = document.createElement(myelement);
root.insertBefore(node,root.getFirstChild());
root.appendChild(node);
Kind Regards,
Jan
Derek Hohls wrote:
Simple question; I need to extract/change data coming
from a Cform after it has been updated, but before
it is saved to file.  So, typically, it looks like this:
 var document = loadDocument(documentID); 
 form.load(document); 
 form.showForm(mypipe);
 form.save(document);

Now a call like:
 var keyNode = document.firstChild;
is valid, but a call like:
   var keyNode = document.firstChild.firstChild;
   if (keyNode != null) {
 document.insertBefore(keyNode,keyNode);
   }
gives an error for the insert operation.
org.w3c.dom.DOMException: NOT_FOUND_ERR: 
An attempt is made to reference a node in a context where it does not
exist.
(and simlar for other types of chnage operations, in fact)

So, how does one actually manipulate the document being 
returned  from the form?

Thanks
Derek
 


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Memory usage

2004-11-23 Thread Jan Hoskens
Hi,
I'm working with cocoon 2.1.5. Yesterday I had some problems rendering a 
pdf (fop). As I had some trouble before with memory usage, I know that 
I'll have to check the size of the memory again. But I didn't have any 
problems rendering pdf before. Now today I just restarted the tomcat and 
tried again. This time no problems with pdf rendering. So here's the 
question part:

- if the webapp is running for a longer period of time, will this affect 
memory usage a lot?
- I'm using fop to generate pdf, I already buillt in some mechanism to 
chop the larger xml files to smaller bits (ending page sequences sooner 
to free up memory) but are there perhaps better alternatives?
- do I need to upgrade to 2.1.6 (ie are there enhancements in memory 
usage/load)?

Kind Regards,
Jan
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: JXTemplate test condition

2004-11-22 Thread Jan Hoskens
You need to set the complete jexl expression in the curly braces , and 
if working with strings, I prefer .equals():

jx:when test=${value1.equals('1') and not(value2.equals('2'))}/
use and/or/not as operators (more on this at: 
http://java.sun.com/webservices/docs/1.0/tutorial/doc/JSTL4.html#65865)

Kind Regards,
Jan
oceatoon wrote:
pguillard wrote:
 

Hi,
Basic question but i can't find the answer: how to write a more complex
test condition in JXT exprerssion
   jx:choose
   jx:when test=${value1=='1'} and ${value2=='2'}
   or  jx:when test=${value1=='1'} amp;amp; ${value2=='2'}
   or jx:when test=${value1=='1' amp;amp; value2=='2'}
Regards,
Phil
   

This might simply be a syntax problem Phil, once you're in a ${} you can
manipulate all jx variable from the context
I haven't tried this but don't see why it wouldn't run   
jx:choose
jx:when test=${(value1=='1' amp;amp; value2=='2') || (value1=='1' and
$value2=='2')} 
   ...etc

Tibor
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


JXtemplate session-context

2004-11-10 Thread Jan Hoskens
Hi,
Is there a way to get session-context information in 
JXTemplateGenerator? I know there's a session, but what if I need to 
retrieve the ID from the authencation context? (context=authentication 
and path=authentication/ID)

Kind Regards,
Jan
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: JXtemplate session-context

2004-11-10 Thread Jan Hoskens
I know how to use flow/jxtemplate, but I was just wondering if I could 
get there without flow. It's a bit overhead to create an extra pipe to 
call a function and then only pass one extra piece of info retrieved 
from the session context to a display-pipeline.  This seems like making 
a simple page more difficult, if you know what I mean ;-)

Thanks for your reply Johannes,
Kind Regards,
Jan
Johannes Textor wrote:
Hi Jan,
afaik there is no way to do this directly in jxt. Anyway I think 
that's more a design decision than a lacking
feature, since you should not use jxt to do complex stuff - it's a 
mere formatting language. You can,
of course, retrieve this information in your flow script and pass it 
to jxt using normal template parameters.
(You can also pass complex objects like the complet authentication 
context, for example)

HTH, Johannes
Jan Hoskens wrote:
Hi,
Is there a way to get session-context information in 
JXTemplateGenerator? I know there's a session, but what if I need to 
retrieve the ID from the authencation context? 
(context=authentication and path=authentication/ID)

Kind Regards,
Jan
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


getComponent / Release Component

2004-11-04 Thread Jan Hoskens
Hi,
When editing my flowscript, I notice that there are some components that 
are used a lot.
Eg:

  var resolver = null;
  var filesource = null;
  try
  {
 resolver = 
cocoon.getComponent(Packages.org.apache.cocoon.environment.SourceResolver.ROLE);
 filesource = resolver.resolveURI(uri);
 return filesource.exists();
  }
  finally
  {
 if(filesource != null) resolver.release(filesource);
 cocoon.releaseComponent(resolver);
  }

Is it appropriate to declare these components that are used a lot as 
global variables? If I do set them globally, how do I release them?
Or are these getComponent/release couples no real threat to slow things 
down and am I only worried about code duplication?

Kind Regards,
Jan
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Forms, writing extra info

2004-11-03 Thread Jan Hoskens
Hi,
I have several cforms that connect to xml documents. These may contain 
default values. If a user changes a value, an attribute changed will be 
set on that value-element and on the document-element. To accomplish 
this, I have to set javascript bindings for each value looking like:

fb:javascript id=myvalue path=myvalue
   fb:load-form
   widget.setValue(jxpathPointer.getValue());
   /fb:load-form
   fb:save-form
   var formValue = widget.getValue() == null ? new 
java.lang.String(): new java.lang.String(widget.getValue());
   if ( !jxpathPointer.getValue().equals(formValue)){
   jxpathPointer.setValue(formValue);   
   jxpathContext.createPathAndSetValue(@changed, true);
   
jxpathContext.createPathAndSetValue(/document_root/@changed, true);
   }
   /fb:save-form
/fb:javascript

Is there a better way to do the same?
Kind Regards,
Jan
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: Forms, writing extra info

2004-11-03 Thread Jan Hoskens
Joerg Heinicke wrote:
On 03.11.2004 13:44, Jan Hoskens wrote:
If I leave out the old/new value test, it seems that it always gets 
saved.

That might be a different behaviour between binding to beans and XML. 
Don't know exactly though.

You mention event listeners/widgets. These are coupled to the form in 
flowscript or in the form definition (if I'm correct that is ;-) ). 
On that moment there's no connection with the data source. So I would 
have to create additional changed widgets for each value in order to 
set their value through a listener widget? The given code will set 
attributes (@changed) directly in the data source without a 
connection through a form widget.

I'm not quite sure what you're meaning

Yes, I meant additional widgets. Like myvalue and myvalue-changed, 
where myvalue-changed is set to true by the value-changed listener on 
myvalue. I guess it is a decision between more complex forms/easier JS 
in binding and easier forms/more complex JS in binding.
Ok, got it.
I'll have to look into it a bit deeper to find out which way to go. 
(I'll definitely keep that listener method in mind.;-))

Thanks Joerg.
Jan

Joerg
I have several cforms that connect to xml documents. These may 
contain default values. If a user changes a value, an attribute 
changed will be set on that value-element and on the 
document-element. To accomplish this, I have to set javascript 
bindings for each value looking like:

fb:javascript id=myvalue path=myvalue
   fb:load-form
   widget.setValue(jxpathPointer.getValue());
   /fb:load-form
   fb:save-form
   var formValue = widget.getValue() == null ? new 
java.lang.String(): new java.lang.String(widget.getValue());
   if ( !jxpathPointer.getValue().equals(formValue)){
   
jxpathPointer.setValue(formValue);  
jxpathContext.createPathAndSetValue(@changed, true);
   
jxpathContext.createPathAndSetValue(/document_root/@changed, 
true);
   }
   /fb:save-form
/fb:javascript

Is there a better way to do the same?

AFAIK the binding itself happens only on change, so you don't need 
to test for value change. So for updating the value and adding 
@changed you probably only need two binding specifications (without 
any JS/JXPath). It gets more complicated if you need the additional 
/document_root/@changed. But I would definitely move this out of 
binding into form logic, i.e. form definition. You can use some 
value-changed-listener-widgets, so you don't need to work with 
JXPath in JS at least.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: attribute class in input field...

2004-11-02 Thread Jan Hoskens
If you want to style your textfield, do it with
in template:
ft:widget .
  fi:styling class=myCSSClass/
/ft:widget
Kind Regards,
Jan
Roberto wrote:
Dear Sirs,
this is what I found in the form-field-styling.xsl file:
 
  xsl:template match=fi:field
input name=[EMAIL PROTECTED] mailto:[EMAIL PROTECTED]} id=[EMAIL PROTECTED] mailto:[EMAIL PROTECTED]} 
value={fi:value} title={fi:hint} type=text
  xsl:apply-templates select=. mode=styling/
/input
xsl:apply-templates select=. mode=common/
  /xsl:template
So what I need is to add a class name to my input field I thought to 
do something like that:
 
input name=[EMAIL PROTECTED] mailto:[EMAIL PROTECTED]} id=[EMAIL PROTECTED] 
mailto:[EMAIL PROTECTED]} class=[EMAIL PROTECTED] mailto:[EMAIL PROTECTED]} 
 value={fi:value} title={fi:hint} type=text
 
and then adding to my description file this: fd:field id=txtNome 
class=txt...
 
But obiusvoly dosn't work... Any suggestion on how to add a class (for 
my css file) to an input file?
 
 
Thanx in advance
Ciao
ROberto


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: Finally figured out the memory settings for Windows server

2004-11-02 Thread Jan Hoskens
I got tomcat running with the following environment variables (system vars):
CATALINA_OPTS = -Xmx512M -server -Xdebug 
-Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=n -Xnoagent 
-Djava.compiler=NONE
CATALINA_HOME = C:\app\Jakarta-Tomcat_4.1.29
TOMCAT_HOME = C:\app\Jakarta-Tomcat_4.1.29

This does set my memory correct.
(it has been a while sinds I set these though)
Kind Regards,
Jan
Schultz, Gary - COMM wrote:
I was unable to get CATALINA_OPTS to set the memory allocation for Tomcat. I
will continue to try to see if I can get it to work. I'm not running any
other Java apps outside of Tomcat, so this isn't as much of a concern.
Gary
-Original Message-
From: Robin Wyles [mailto:[EMAIL PROTECTED]
Sent: Tuesday, November 02, 2004 1:22 PM
To: [EMAIL PROTECTED]
Subject: Re: Finally figured out the memory settings for Windows server
AFAIK JAVA_OPTS affects the JVM as a whole... I think you can use 
CATALINA_OPTS to specifically set the memory allocation to Tomcat.

Robin
On 2 Nov 2004, at 11:20, Derek Hohls wrote:
 

Robin
OK, the hidden agenda here is that I actually need to
increase the memory for the JVM for non-Tomcat related
apps as well (e.g. XReporter, which runs under Phoenix).
Does JAVA_OPTS affect that as well?
Thanks
Derek
   

[EMAIL PROTECTED] 2004/11/02 10:17:45 AM 
 

Derek,
On 2 Nov 2004, at 07:42, Derek Hohls wrote:
   

Being the eternal optimist, I would like to ask if
anyone know how to do this for Tomcat 4.x there
is no Configure Tomcat on the Windows menu?
 

It's a while since I ran Tomcat under Windows, but I believe you can
set the JAVA_OPTS environment variable by editing the
tomcat_home/bin/catalina.bat e.g:
set JAVA_OPTS=-Xms128m -Xmx512m
Robin
   

 

[EMAIL PROTECTED] 2004/11/01 05:03:08 PM 
   

Thanks to all who provided assistance.
I figured it out for Windows server. Go to Start-Programs-Apache
Tomcat
5.0-Configure Tomcat. This will open up a dialog box to change
settings.
Click the middle tab, Java VM. There is a text area to add Java
Options.
After the last entry, -Xrs, add -Xmsvalue -Xmxvalue, where these
are the
minimum size and maximum size of memory usage for the Java virtual
machine
(JVM). Click Apply or OK, and restart the Tomcat service.
One of the reasons I didn't think of this originally is that Apache
Tomcat
5.0 was missing from Start-Programs on my development server. I like
 

to
   

test
in development before testing in production. Once I figured this out
 

I
   

reinstalled Tomcat on my development server, which placed Apache
 

Tomcat
   

5.0
in Start-Programs. From there I was able to set and test the memory
settings for the JVM in development, and eventually place these into
production. The XSP that hits the Oracle database now flies. I can
gather a
10947 record, 9.5 megabyte data stream quickly. It's an entirely new
web
site. It really performs well. I can't believe the improvement in
performance I received with the new memory settings.
The increased performance isn't only with Cocoon. Performance of our
ArcIMS
applications has increased considerably.
Once again, thanks to all who provided assistance.
Gary T. Schultz
Web Technical Administrator / GIS Coordinator
Wisconsin Department of Commerce
6th Floor
P.O. Box 7970
Madison, WI
1-608-266-1283

-Original Message-
From: Schultz, Gary - COMM [mailto:[EMAIL PROTECTED]
Sent: Friday, October 29, 2004 12:51 AM
To: '[EMAIL PROTECTED]'
Subject: Desperately seeking assistance and/or information on memory
setti ngs
I'm desperately seeking a real working solution to memory management
in
Java-Tomcat-Cocoon in Windows. I continue to run into low memory
errors. I
researched the Cocoon wiki, Java web sites and Tomcat web sites, but
none of
the solutions appears to work. I can't get Cocoon to use more than
 

the
   

default 64 MB of memory allotted by the JVM. I had initially gotten
Cocoon
to free up 50% of the available memory, so I had 64 Meg in use, with
around
30 Meg free. This initially help me with an XSP issue, but now when
 

I
   

check
Cocoon status I see that memory is getting low again, sometimes the
status
page will show just over 1 meg of free memory. My XSP no longer
 

works.
   

Our configuration:
2.4 GHz Xeon Processor Compaq server
2.5 Gigabytes RAM
Windows 2000 (5.00.2195 Service Pack 4)
J2SDK 1.4.2_03
Apache 2.0.49
Tomcat 5.0.18
Cocoon 2.1.5.1
I trying to sell Cocoon as a tool to help with a project at work. If
 

I
   

can't
get consistent results with the XSP, management will not go with
 

Cocoon
   

and
will turn to another solution. This will be a major set back for
greater use
of Cocoon in our agency. I'm also trying to sell other agencies in
Wisconsin
on the benefits of Cocoon, but this recent set back will only make
 

my
   

efforts more difficult.
Any assistance I can get is greatly appreciated. I would like to see
Cocoon
used for tasks other than a simple web publishing system. But the

Re: Finally figured out the memory settings for Windows server

2004-11-02 Thread Jan Hoskens
One other thingy: if you have tomcat installed, there may be a link in 
your start menu(depends on install version) but this isn't the same as 
running the startup.bat directly. (best to always use the latter)

Jan Hoskens wrote:
I got tomcat running with the following environment variables (system 
vars):

CATALINA_OPTS = -Xmx512M -server -Xdebug 
-Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=n 
-Xnoagent -Djava.compiler=NONE
CATALINA_HOME = C:\app\Jakarta-Tomcat_4.1.29
TOMCAT_HOME = C:\app\Jakarta-Tomcat_4.1.29

This does set my memory correct.
(it has been a while sinds I set these though)
Kind Regards,
Jan
Schultz, Gary - COMM wrote:
I was unable to get CATALINA_OPTS to set the memory allocation for 
Tomcat. I
will continue to try to see if I can get it to work. I'm not running any
other Java apps outside of Tomcat, so this isn't as much of a concern.

Gary
-Original Message-
From: Robin Wyles [mailto:[EMAIL PROTECTED]
Sent: Tuesday, November 02, 2004 1:22 PM
To: [EMAIL PROTECTED]
Subject: Re: Finally figured out the memory settings for Windows server
AFAIK JAVA_OPTS affects the JVM as a whole... I think you can use 
CATALINA_OPTS to specifically set the memory allocation to Tomcat.

Robin
On 2 Nov 2004, at 11:20, Derek Hohls wrote:
 

Robin
OK, the hidden agenda here is that I actually need to
increase the memory for the JVM for non-Tomcat related
apps as well (e.g. XReporter, which runs under Phoenix).
Does JAVA_OPTS affect that as well?
Thanks
Derek
  

[EMAIL PROTECTED] 2004/11/02 10:17:45 AM 


Derek,
On 2 Nov 2004, at 07:42, Derek Hohls wrote:
  

Being the eternal optimist, I would like to ask if
anyone know how to do this for Tomcat 4.x there
is no Configure Tomcat on the Windows menu?

It's a while since I ran Tomcat under Windows, but I believe you can
set the JAVA_OPTS environment variable by editing the
tomcat_home/bin/catalina.bat e.g:
set JAVA_OPTS=-Xms128m -Xmx512m
Robin
  



[EMAIL PROTECTED] 2004/11/01 05:03:08 PM 
  

Thanks to all who provided assistance.
I figured it out for Windows server. Go to Start-Programs-Apache
Tomcat
5.0-Configure Tomcat. This will open up a dialog box to change
settings.
Click the middle tab, Java VM. There is a text area to add Java
Options.
After the last entry, -Xrs, add -Xmsvalue -Xmxvalue, where these
are the
minimum size and maximum size of memory usage for the Java virtual
machine
(JVM). Click Apply or OK, and restart the Tomcat service.
One of the reasons I didn't think of this originally is that Apache
Tomcat
5.0 was missing from Start-Programs on my development server. I like

to
  

test
in development before testing in production. Once I figured this out

I
  

reinstalled Tomcat on my development server, which placed Apache

Tomcat
  

5.0
in Start-Programs. From there I was able to set and test the memory
settings for the JVM in development, and eventually place these into
production. The XSP that hits the Oracle database now flies. I can
gather a
10947 record, 9.5 megabyte data stream quickly. It's an entirely new
web
site. It really performs well. I can't believe the improvement in
performance I received with the new memory settings.
The increased performance isn't only with Cocoon. Performance of our
ArcIMS
applications has increased considerably.
Once again, thanks to all who provided assistance.
Gary T. Schultz
Web Technical Administrator / GIS Coordinator
Wisconsin Department of Commerce
6th Floor
P.O. Box 7970
Madison, WI
1-608-266-1283

-Original Message-
From: Schultz, Gary - COMM [mailto:[EMAIL PROTECTED]
Sent: Friday, October 29, 2004 12:51 AM
To: '[EMAIL PROTECTED]'
Subject: Desperately seeking assistance and/or information on memory
setti ngs
I'm desperately seeking a real working solution to memory management
in
Java-Tomcat-Cocoon in Windows. I continue to run into low memory
errors. I
researched the Cocoon wiki, Java web sites and Tomcat web sites, but
none of
the solutions appears to work. I can't get Cocoon to use more than

the
  

default 64 MB of memory allotted by the JVM. I had initially gotten
Cocoon
to free up 50% of the available memory, so I had 64 Meg in use, with
around
30 Meg free. This initially help me with an XSP issue, but now when

I
  

check
Cocoon status I see that memory is getting low again, sometimes the
status
page will show just over 1 meg of free memory. My XSP no longer

works.
  

Our configuration:
2.4 GHz Xeon Processor Compaq server
2.5 Gigabytes RAM
Windows 2000 (5.00.2195 Service Pack 4)
J2SDK 1.4.2_03
Apache 2.0.49
Tomcat 5.0.18
Cocoon 2.1.5.1
I trying to sell Cocoon as a tool to help with a project at work. If

I
  

can't
get consistent results with the XSP, management will not go with

Cocoon
  

and
will turn to another solution. This will be a major set back for
greater use
of Cocoon in our agency. I'm also trying to sell other agencies in
Wisconsin
on the benefits of Cocoon, but this recent set

Re: Xalan ESLT function date:date-add

2004-10-25 Thread Jan Hoskens
If you're trying to work with dates, you can use the java extensions in 
xalan. This way you can call any java stuff you need.

namespace to include:
xmlns:java=http://xml.apache.org/xslt/java;
xsl:variable name=locale 
select=java:java.util.Locale.new('nl','BE')/ !-- Class.new creates 
new instance --
xsl:variable name=currentCalendar 
select=java:java.util.Calendar.getInstance($locale)/ !-- static 
factory method --
xsl:variable name=currentDate select=java:getTime($currentCalendar)/
xsl:variable name=dateFormat 
select=java:java.text.DateFormat.getDateTimeInstance(java.text.DateFormat.MEDIUM, 
java.text.DateFormat.MEDIUM, $locale)/
xsl:variable name=TimeStamp select=java:format($dateFormat, 
$currentDate)/ !-- normal functions, first give object on which to 
perform the function, then arguments--

Kind Regards,
Jan
gerritjan wrote:
Hello,
This XSLT:
?xml version=1.0?
xsl:stylesheet version=1.0
xmlns:xsl=http://www.w3.org/1999/XSL/Transform;
xmlns:date=http://exslt.org/dates-and-times;
extension-element-prefixes=date xsl 
xsl:import href=date.add.function.xsl /
xsl:output method=xml/
xsl:param name=p_dagen_terug/
xsl:template match=onderwerpen
xsl:variable name=d1xsl:value-of 
select=date:date()//xsl:variable
xsl:variable name=d2xsl:value-of select=substring-before ($d1, 
'+02:00')//xsl:variable
xsl:variable name=d5xsl:value-of 
select=date:date-add($d2,'-P50D')//xsl:variable
basis
1
xsl:value-of select=$d1/
2
xsl:value-of select=$d2/
5
xsl:value-of select=$d5/
/basis
/xsl:template

/xsl:stylesheet
Gives this error;
org.apache.cocoon.ProcessingException: Failed to execute pipeline.: 
java.lang.RuntimeException: java.lang.RuntimeException: 
java.lang.NullPointerException

I'm not sure if Xalan supports this EXSLT function natively , but with 
'import' I was hoping to use this EXSLT function anyway
by the way: without the 'import' line I get the same error...
The 'imported' file is downloadable from www.exslt.org

*/_Gerritjan Koekkoek_/* 

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: Problems with submit-on-change for the calendar widget

2004-10-20 Thread Jan Hoskens
[EMAIL PROTECTED] wrote:
I'm having problems with getting the calendar widget to submit upon 
selecting a date. I've included the fi:styling 
submit-on-change=true / tag in the form template but this fails to 
submit the form. I've noticed that it does submit if you manually type 
a date in the input field so I guess its a problem with the 
javascript, any suggestions?

Thanks
Will
You can do a document.myformname.submit() after the calendar javascript.
One way to do this is by altering the calendar styling in 
form-calendar-styling.xsl or take a copy and use a different styling 
type. Then make sure that at the moment the input element is made and 
the onclick is set to open the calendar javascript, set the submit rule 
above, or even better copy the onclick value from fi:styling to the 
onclick in the input element, after the calendar:

   !-- This datestuff is taken from the original 
forms-calendar-styling.xsl and altered at the onclick attribute--
   xsl:template match=fi:field[fi:styling/@type='date-setOnClick']
   xsl:variable name=id select=generate-id()/
   xsl:variable name=format
   xsl:choose
   xsl:when 
test=fi:[EMAIL PROTECTED]'date']/fi:convertor/@pattern
   xsl:value-of 
select=fi:[EMAIL PROTECTED]'date']/fi:convertor/@pattern/
   /xsl:when
   xsl:otherwise-MM-dd/xsl:otherwise
   /xsl:choose
   /xsl:variable
   !-- regular input --
   input id=[EMAIL PROTECTED] name=[EMAIL PROTECTED] value={fi:value} 
title={normalize-space(fi:hint)} type=text
   xsl:apply-templates select=. mode=styling/
   /input
   !-- calendar popup, set the onClick stuff after calendar--
   a href=# name={$id} id={$id} 
onClick=forms_calendar.select(forms_getForm(this)['[EMAIL PROTECTED]'],'{$id}','{$format}');{fi:styling/@onClick}
   img src={$resources-uri}/cal.gif border=0 
alt=Calendar/
   /a
   !-- common stuff --
   xsl:apply-templates select=. mode=common/
   /xsl:template

use:
fi:styling type=date-setOnClick onClick=dowathever you like eg 
document.myformname.submit();/
and make sure you name your form element

(haven't really tested this submit, but think it should work;-)
Kind Regards,
jan

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: cocoon internal server error

2004-10-14 Thread Jan Hoskens
What you tried to do is access a component from the web. If you want to 
use other matchers in your sitemap in your current pipeline, try 
cocoon:/write.xslt. Look at the wiki's for more about protocols: 
http://wiki.apache.org/cocoon/Protocols

Kind Regards,
Jan
Janvier Majirus FANSI wrote:
hi all,
I use these pipelines within my sub-sitemap:
map:match pattern=write.xslt
   map:generate src=authorization2.xml/
   map:transform src=essai3.xslt/
   map:serialize type=xml/
/map:match
map:match pattern=test
map:generate src=maj.xml/
 map:transform src=http://localhost/cocoon/csysec/write.xslt;
   map:parameter name=use-request-parameters value=true/
 /map:transform
 map:serialize type=xml/
/map:match
the second pipeline use write.xslt, that is the result of the first 
one to complete.

Whenever  make request  http://localhost/cocoon/csysec/test?user=apache
Cocoon return an internal server error  with this message: You cannot 
lookup components on a disposed ComponentLocator

I used cocoon2.1.5.1.
Should anyone know what is wrong?
Any suggestion or remark is welcome.
regards
Majirus
_
Recevez par e-mail des émoticônes pour MSN Messenger 
http://g.msn.fr/FR1001/2275?url=http://www.msn.fr/ilovemessenger/premium/Default.asp?Ath=f 


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: Changing the cocoon default date format

2004-10-14 Thread Jan Hoskens
Do you mean entering a date in the webbrowser? When setting a date in 
the definition with  a specified format, this format is used for 
entering dates in the input fields of your browser. If you want your 
date format in your xml file (binded data source/destination) you need 
to set your binding formatting.

So
fd:field id=input
   fd:labelmylabel/fd:label
   fd:datatype base=date
   fd:convertor type=formatting
fd:patterns
fd:patterndd/MM//fd:pattern
  /fd:patterns
  /fd:convertor
  /fd:datatype
/fd:field
Would make you're browser inputfield accept the defined format (if this 
is what you needed, didn't it work? Also when specifying a pattern, try 
leaving out the style=long attribute.)

The next sample should set the date format in your xml file that was 
binded to your form:

fb:value id=input path=input
 fd:convertor datatype=date
  fd:patterns
   fd:patterndd/MM//fd:pattern
  
/fd:patterns
   /fd:convertor
  /fb:value

Hope this helps.
Kind Regards,
Jan
[EMAIL PROTECTED] wrote:
Hi ,
How can we change the cocoon default date format. cocoon is accepts 
MM/dd/YY. When we change the format as -mm-DD. Cocoon doesn't 
allows us to enter date in this format. 
 
We have the tried the following :

fd:field id=Date
  fd:labeli18n:text Date: /i18n:text/fd:label
  fd:datatype base=date
fd:converter type=formatting style=long
  fd:patterns
fd:pattern-mm-DD/fd:pattern
  /fd:patterns
/fd:converter
  /fd:datatype
  fd:validation /
/fd:field
 
Can any one please let us know where we are going wrong or any pointer 
to achieve the same would appreciated
Thanks in advance.
Regards,
Moin
 
 


Confidentiality Notice
The information contained in this electronic message and any 
attachments to this message are intended
for the exclusive use of the addressee(s) and may contain confidential 
or privileged information. If
you are not the intended recipient, please notify the sender at Wipro 
or [EMAIL PROTECTED] immediately
and destroy all copies of this message and any attachments.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: CForms currency convertor

2004-10-14 Thread Jan Hoskens
If your given xml tag is to be binded to your form, the convertor is in 
the right place.
If I remember correctly the convertors may be seen as follows:
Convertor in binding - datasource is in specified format
Convertor in definition - input in browser is in specified format

Try fd:pattern locale=it-IT , notice the - instead of _.
Then you should get the same result as when you leave the locale 
attribute out.
I'm not sure what you mean by your last sentence

snip
I remove locale attribue It work, but not in the format that I want.
/snip
How do you mean It work but not in your wanted format?
Kind Regards,
Jan
Ugo Cei wrote:
Il giorno 30/set/04, alle 10:32, Daniele Madama ha scritto:
Hi,
I have a problem with use of convertor in binding. My application 
retrieve
an xml with this tag

ammount60.20/ammount
in my form definition I define this widget
fd:field id=fromAmount required=false
  fd:datatype base=decimal/
  fd:label
i18n:textlabel.Da/i18n:text
  /fd:label
/fd:field
and in binding
fb:value id=fromAmount path=ammount
  fd:convertor datatype=decimal type=formatting variant=currency
fd:patterns
  fd:pattern locale=it_IT###,##0.00/fd:pattern
/fd:patterns
  /fd:convertor
/fb:value
This don't work fine, after load of form the associated input is 
empty; if
I remove locale attribue It work, but not in the format that I want.

Why did you put the convertor element in the binding? Have you tried 
putting it in the definition? I'm not even sure if defining it in the 
binding is supposed to work, but I might be wrong, I'm no CForms guru ;-)

Ugo

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: CForms: immediate validation of input fields

2004-10-14 Thread Jan Hoskens
If I am correct, all stuff happens server-side. The fd:javascript will 
happen at the same moment as the other validations (meaning sever-side, 
on-submit). If you really want to have a client-side validation, you  
can try to set some extra stuff in your template:

ft:widget id= ... fi:styling onchange=/ft:widget
The fi:styling attributes that are not used by the cform stylesheets 
will be copied into your html input element (ending up with input  
onchange=/). So you can set a javascript piece in which you validate 
your field in those attributes.

Kind Regards,
Jan
Jorg Heymans wrote:
fd:javascript should be your friend here i think.
http://cocoon.apache.org/2.1/userdocs/forms/validation.html
Philipp Rech wrote:
Hello Cocooners!
I have a CFrom with many fields and other input elements. Validation 
(based
on the Cforms validation tags) happens when i submit the form. So far so
good. Now is it possible (and how) to have Cforms validate user 
inputs right
away after one field is filled out? So can I call the validation not 
only on
submit but also when the user focuses (clicks on) the next field on the
page? Maybe through the Javascript onBlur event handler?

Thank you in advance!
philipp

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: CForms: immediate validation of input fields

2004-10-14 Thread Jan Hoskens
I think that they were aiming to support more browsers by leaving most 
actions on the server-side. Validation on server-side or client-side is, 
in the end, a difference of opinion as you said. So you're right to 
suggest a mechanism to choose between both. Like an attribute defining 
client-side or server-side on each widget, and one default setting. 
It's not there yet and I don't know if the developers are already 
discussing/implementing  this issue.

Kind Regards,
Jan
Gunter D'Hondt wrote:
CForms still doesn't have any clientside validations, which in my 
opinion is currently a huge disadvantage coz now you have to declare 
the specifications (datatype, required, format) in the form definition 
and again in your own clientside javascript stuff. It would be perfect 
that the CFormTemplateTransformer could automatically create those 
clientside javascript pieces or at least give a javascript-structure 
with the metadata of each field in it.

Regards,
Gunter D'Hondt.

*Jan Hoskens [EMAIL PROTECTED]*
14-10-2004 10:17
Please respond to
[EMAIL PROTECTED]

To
[EMAIL PROTECTED]
cc

Subject
Re: CForms: immediate validation of input fields




If I am correct, all stuff happens server-side. The fd:javascript will
happen at the same moment as the other validations (meaning sever-side,
on-submit). If you really want to have a client-side validation, you  
can try to set some extra stuff in your template:

ft:widget id= ... fi:styling onchange=/ft:widget
The fi:styling attributes that are not used by the cform stylesheets
will be copied into your html input element (ending up with input 
onchange=/). So you can set a javascript piece in which you validate
your field in those attributes.
Kind Regards,
Jan
Jorg Heymans wrote:
 fd:javascript should be your friend here i think.

 http://cocoon.apache.org/2.1/userdocs/forms/validation.html

 Philipp Rech wrote:

 Hello Cocooners!

 I have a CFrom with many fields and other input elements. Validation
 (based
 on the Cforms validation tags) happens when i submit the form. So 
far so
 good. Now is it possible (and how) to have Cforms validate user
 inputs right
 away after one field is filled out? So can I call the validation not
 only on
 submit but also when the user focuses (clicks on) the next field on the
 page? Maybe through the Javascript onBlur event handler?

 Thank you in advance!
 philipp



 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: Changing the cocoon default date format

2004-10-14 Thread Jan Hoskens
Global default dateformat setting? Not that I know of. I think they use 
the locale to determine the default dateformat. Not a setting somewhere.

You might want to look at class widgets 
http://wiki.apache.org/cocoon/TimLarson . With a class you can define 
(in ONE definition/binding/template)  a class widget and instantiate it 
multiple times. So you could create a class with a date widget and use 
several instances of that class. But you need to know that the binding 
will have to be the same. So every date element has to have the same 
bean/xml element to bind to, but they might be in different contexts.

fd:class id=dateClass
 fd:widgets
 fd:field id=date
fd:datatype base=date
  fd:convertor type=formatting
 fd:patterns
   fd:patterndd/MM//fd:pattern
 /fd:patterns
   /fd:convertor
  /fd:datatype
 /fd:field   
/fd:widgets
/fd:class

then instantiate with : fd:new id=dateClass/
binding goes the same, you may change it context, but the actual element 
binding path will be the same for each instance (it's in the class, 
remember):

fb:class id=dateClass
   fb:value id=date path=date/
/fb:class
fb:context path=somewhere
   fb:new id=dateClass/
/fb:context
There are some discussions for new stuff, including catalogs or 
repositories with widgets that you can easily reuse: 
http://wiki.apache.org/cocoon/WoodyScratchpad

Kind Regards,
Jan
Luca Garulli wrote:
Can I define a global date format avoiding to specifing it everytime
in definition  mapping?
Thanks.
bye,
Luca Garulli
OrienTechnologies.com
(the light ODBMS, all in one JDO solution)
On Thu, 14 Oct 2004 08:53:17 +0200, Jan Hoskens [EMAIL PROTECTED] wrote:
 

Do you mean entering a date in the webbrowser? When setting a date in
the definition with  a specified format, this format is used for
entering dates in the input fields of your browser. If you want your
date format in your xml file (binded data source/destination) you need
to set your binding formatting.
So
fd:field id=input
   fd:labelmylabel/fd:label
   fd:datatype base=date
   fd:convertor type=formatting
fd:patterns
fd:patterndd/MM//fd:pattern
  /fd:patterns
  /fd:convertor
  /fd:datatype
/fd:field
Would make you're browser inputfield accept the defined format (if this
is what you needed, didn't it work? Also when specifying a pattern, try
leaving out the style=long attribute.)
The next sample should set the date format in your xml file that was
binded to your form:
fb:value id=input path=input
 fd:convertor datatype=date
  fd:patterns
   fd:patterndd/MM//fd:pattern
/fd:patterns
   /fd:convertor
  /fb:value
Hope this helps.
Kind Regards,
Jan

[EMAIL PROTECTED] wrote:
   

Hi ,
How can we change the cocoon default date format. cocoon is accepts
MM/dd/YY. When we change the format as -mm-DD. Cocoon doesn't
allows us to enter date in this format.
We have the tried the following :
   fd:field id=Date
 fd:labeli18n:text Date: /i18n:text/fd:label
 fd:datatype base=date
   fd:converter type=formatting style=long
 fd:patterns
   fd:pattern-mm-DD/fd:pattern
 /fd:patterns
   /fd:converter
 /fd:datatype
 fd:validation /
   /fd:field
Can any one please let us know where we are going wrong or any pointer
to achieve the same would appreciated
Thanks in advance.
Regards,
Moin


Confidentiality Notice
The information contained in this electronic message and any
attachments to this message are intended
for the exclusive use of the addressee(s) and may contain confidential
or privileged information. If
you are not the intended recipient, please notify the sender at Wipro
or [EMAIL PROTECTED] immediately
and destroy all copies of this message and any attachments.
 

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
   

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: Changing the cocoon default date format

2004-10-14 Thread Jan Hoskens
The stuff on the TimLarson (class, new, union, struct) page is available 
in cocoon 2.1.5 (and up I guess;-)

Kind Regards,
Jan
Luca Garulli wrote:
On Thu, 14 Oct 2004 11:31:32 +0200, Jan Hoskens [EMAIL PROTECTED] wrote:
 

Global default dateformat setting? Not that I know of. I think they use
the locale to determine the default dateformat. Not a setting somewhere.
You might want to look at class widgets
http://wiki.apache.org/cocoon/TimLarson . With a class you can define
(in ONE definition/binding/template)  a class widget and instantiate it
multiple times. So you could create a class with a date widget and use
several instances of that class. But you need to know that the binding
will have to be the same. So every date element has to have the same
bean/xml element to bind to, but they might be in different contexts.
   

Thank you very much.
The custom widget definition may be very useful in many use cases!
From what version of Cocoon is available?
bye,
Luca Garulli
OrienTechnologies.com
(the light ODBMS, all in one JDO solution)
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: aggregate takes too much time

2004-10-11 Thread Jan Hoskens
Have you tried different options? Besides the sitemap aggregation there 
are also some include transformators available: the XInclude and  
CInclude may do the same as the aggregation.

Kind regards,
Jan
[EMAIL PROTECTED] wrote:
Hi all,
Aggregating xml in cocoon takes too much time.
I try to aggregate 10 xml files ( from filesystem: file:/// ) 
It takes about 4-7 seconds just to aggregate w/o transforming :(

Any other faster way to aggregate contents?
 


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: aggregate takes too much time

2004-10-11 Thread Jan Hoskens
Are you using very large documents? Do you have other pipeline 
structures in between the aggregation or afterwards that may slow things 
down? Why do you need to aggregate more than 10 documents at a time?

(Not sure I can help, but more info may be usefull for other readers too ;-)
Kind Regards,
Jan
[EMAIL PROTECTED] wrote:
XInclude is faster, but after several requests it slows down (don't know why)
CInclude is as slow as map:aggregate.
On Mon, 11 Oct 2004 08:30:01 +0200, Jan Hoskens [EMAIL PROTECTED] wrote:
 

Have you tried different options? Besides the sitemap aggregation there
are also some include transformators available: the XInclude and
CInclude may do the same as the aggregation.
Kind regards,
Jan
[EMAIL PROTECTED] wrote:
   

Hi all,
Aggregating xml in cocoon takes too much time.
I try to aggregate 10 xml files ( from filesystem: file:/// )
It takes about 4-7 seconds just to aggregate w/o transforming :(
Any other faster way to aggregate contents?
 


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: Boolean widget: accept int values

2004-09-29 Thread Jan Hoskens
You can always create a custom binding where you can map your own values 
to a boolean value and back.
Look at the docs: 
http://cocoon.apache.org/2.1/userdocs/forms/binding.html#fb%3Ajavascript

guess you need something like:
fb:javascript id=foo path=@foo
 fb:load-form
if (jxpathPointer.getValue() == 1)
widget.setValue(new java.lang.Boolean(true));
else
widget.setValue(new java.lang.Boolean(false));
 /fb:load-form
 fb:save-form
if (widget.getValue() == true)
jxpathPointer.setValue(1);
else
jxpathPointer.setValue(0);
 /fb:save-form
/fb:javascript
Note that this may contain errors, did no test for this.
Kind Regards,
Jan
[EMAIL PROTECTED] wrote:
Hi,
I'm currently developing my first cocoon form. I experienced that boolean
widgets don't accept int fields as input (when setting the value with a
binding).
Maybe it's a good idea to make boolean widgets also accept int fields as
input? (with value 0 as false, and value 1 as tru)
Regards,
Kees van dieren

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


CForms v2

2004-09-24 Thread Jan Hoskens
Hi,
I'm using forms.js v2 'cause I need the createForm with an element 
instead of uri. I just tried to use fd:submit buttons to be able to skip 
validation with certain submits.

Nothing's wrong there, but as I previously worked with html submits (see 
old way) and used the same name submit_action I could check the value 
of that request parameter to find out which button was pressed. Now with 
the fd:submit buttons, the name, id and values are set automatically 
so I don't have the same name in multiple buttons. I noticed however 
that there's something like form.submitId to retreive the buttonid 
that was pressed. This is only available (set)  in the forms.js v1 not 
in v2 or v3.

Is this normal? Shouldn't both other versions have the same funcionality?
As workaround I now check if a request parameter Cancel is given or not 
(as opposed to retreiving the submitId and checking it's value).

Old way:
input align=center name=submit_action type=submit value=Cancel/
input align=center name=submit_action type=submit value=Ok/
Check the request parameter submit_action for values Cancel or Ok
New way: fd:buttons give html:
input title= name=Cancel type=submit id=Cancel value=Cancel /
input title= name=Ok type=submit id=Ok value=Ok /
So for now I'm checking if request parameter Cancel exists (!= null)
because form.submitId is always undefined (using v2 , not v1!)
Kind Regards,
Jan
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: CForms v2

2004-09-24 Thread Jan Hoskens
Hmm, just saw another message concerning the forms.js versions: 
http://marc.theaimsgroup.com/?l=xml-cocoon-usersm=109595761120738w=2

Guess I was just a bit too jumpy to mail this
Jan
Jan Hoskens wrote:
Hi,
I'm using forms.js v2 'cause I need the createForm with an element 
instead of uri. I just tried to use fd:submit buttons to be able to 
skip validation with certain submits.

Nothing's wrong there, but as I previously worked with html submits 
(see old way) and used the same name submit_action I could check the 
value of that request parameter to find out which button was pressed. 
Now with the fd:submit buttons, the name, id and values are set 
automatically so I don't have the same name in multiple buttons. I 
noticed however that there's something like form.submitId to 
retreive the buttonid that was pressed. This is only available (set)  
in the forms.js v1 not in v2 or v3.

Is this normal? Shouldn't both other versions have the same funcionality?
As workaround I now check if a request parameter Cancel is given or 
not (as opposed to retreiving the submitId and checking it's value).

Old way:
input align=center name=submit_action type=submit value=Cancel/
input align=center name=submit_action type=submit value=Ok/
Check the request parameter submit_action for values Cancel or Ok
New way: fd:buttons give html:
input title= name=Cancel type=submit id=Cancel value=Cancel /
input title= name=Ok type=submit id=Ok value=Ok /
So for now I'm checking if request parameter Cancel exists (!= null)
because form.submitId is always undefined (using v2 , not v1!)
Kind Regards,
Jan
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: some doubts about developing with cocoon

2004-09-21 Thread Jan Hoskens
If your container is tomcat, then every webapp will be accessible 
through the name of its directory:
(war's will be unpacked so it's the same thing actually, I work with the 
dir version, not the war)
(Also note that tomcat can be substituted with almost any other 
container, I just used it here as an example)

eg: under webapps/cocoon you need to access your webapp through 
host:port/cocoon/.

You can rename the dir as you like and copy it as many times you need 
for different apps.

eg: webapps/mydirwithcocoon = host:port/mydirwithcocoon/
I suggest you create a lightweight cocoon: without docs and only the 
blocks you need.You'll end up with a sitemap, a WEB-INF dir with some 
config files and many jars. This is the webapp base you need (your 
application). This can be copied as many times as you like to different 
dirs(thus creating different applications).

You might want to consider other options as you're duplicating a lot of 
base stuff with the previous setting (the whole WEB-INF dir actually). 
Your cocoon main sitemap can mount subsitemaps anywhere on your 
filesystem. So you can also setup the main cocoon (thus the 
webapps/cocoon) and then mount a sitemap for each site you need.

eg: my sites are under dir /sites/ so I mount them in my main sitemap: 
a matcher for siteone/** mounts the first sitemap under /sites/siteone.

There are also some automount options: when you're sitedir with sitemap 
is under the main dir (webapps/cocoon) then it automatically gets 
mounted to that dir (see main sitemap)
To reach your webapp you need to type : host:port/cocoon/siteone/. 

If you would like to end up with a url like host:port/siteone you'll 
have to set cocoon as the default webapp under tomcat.
Normally the default webapp shows the tomcat infopage. To do this you'll 
need to configure tomcat properly (look at the tomcat docs).

Hope this helps,
Kind Regards,
Jan
Manuel Grau Aracil wrote:
- ENGLISH 
I've copied cocoon.war in my webapps directory and it works very well. But I
don't know how to develop my own application based in cocoon. I want to develop
my application in other directory of my webapps. How can I do this? It's enough
to copy cocoon/WEB-INF/ to the new directory? Thanks.
- SPANISH 
He copiado cocoon.war en mi carpeta webapps y funciona perfectamente. Pero no se
como desarrollar mi propia aplicación basada en cocoon. Quiero desarrollar mi
web en otro directorio dentro de webapps. ¿Como puedo hacerlo? ¿Es suficiente
con copiar cocoon/WEB-INF/ dentro del nuevo directorio o necesito algún fichero
más? Gracias.
-
Este correo ha sido enviado via MarcaMail - http://www.marca.net/
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: use tokens during flowscript call in a pipeline

2004-08-25 Thread Jan Hoskens
You are trying to access a parameter that's actually one level up, when 
going a level up you must use ../.
Try {../1}/{../2}/{tempname}

Sebastien Gabel wrote:
Hi !
I'm surprised.and I'm going to explain my problem ;
I would like to write a pipeline using action and flowscript :
map:match pattern=*/*/display-xml
 map:act type=create-xml
map:parameter name=file value={session-attr:curFile}/
map:parameter name=url value={request:reauestURI}/
 

= action makes  an extra level (tag in tags) but map:parameter should 
still use the level of the action
   map:match pattern=*
  map:act   !-- goes one level deeper (ie nesting) use {1}--
   map:parameter/   !-- still use the map:act level {1}--
   map:generate/   !-- use one level deeper too match 
{../1} --
   map:act   !-- goes another level deeper use {../1}--
   map:parameter/   !-- still use the map:act level 
{../1}--
   map:transform/   !-- use one level deeper too 
match {../../1} --
   /map:act
  /map:act
   /map:match

If tempname is introduced by first action, it's first level children 
will use it as {tempname}, when in second action use {../tempname} to go 
one level up

map:call function=goTo
 map:parameter name=filename value={1}/{2}/{tempname}/
/map:call
/map:act
/map:match
Ok my problem is here :
map:parameter name=filename value={1}/{2}/{tempname}/
{1} and {2} are not found but all work correctly  if I put them in static.
e.g {1}/{2} becomes dir1/dir2
Nevertheless, {tempname} (result from the action) is found.
My question is why tokens {1} and {2} are no available ?
what can I do to avoid that ?
Thank you very much for any advice.
Sebastien

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: XSP/output

2004-08-25 Thread Jan Hoskens
You probably want logging instead of plain output, to do this in XSP:
getLogger().debug(your message here);
Look for your logs under your cocoon/WEB-INF/logs directory. I guess it should 
pop-up in core.log or sitemap.log.
(You can also use .info() , .warn() and .error() with that getLogger() function)
Kind Regards,
Jan

Adriano Smith wrote:
If a System.out.println(\\) is given in an XSP where will the output 
be seen?br br br The java console does not print it. br How 
can the output be seen in java console?br 
http://ads.sify.com/RealMedia/ads/click_nx.ads/mail.sify.com/[EMAIL PROTECTED]

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: container-encoding vs. form-encoding... bug?

2004-08-23 Thread Jan Hoskens
You should set the container-encoding to ISO-8859-1 and leave the 
form-encoding as UTF-8. If I remember correctly, the container-encoding 
is a thing introduced with servlet api 2.3 while cocoon was coping with 
2.2 . The latter did pass everything in ISO and cocoon expects it to be 
ISO (will change probably in later cocoon versions). Remember to set 
your encoding in your serializers too (two places to look for! The 
element encoding AND attribute mime-type ):

map:serializer logger=sitemap.serializer.xhtml mime-type=text/html; 
charset=UTF-8 name=xhtml pool-grow=2 pool-max=64 pool-min=10 
src=org.apache.cocoon.serialization.XMLSerializer
 doctype-public-//W3C//DTD XHTML 1.0 
Strict//EN/doctype-public
 
doctype-systemhttp://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd/doctype-system
 encodingutf-8/encoding
 /map:serializer

Kind regards,
Jan
Mark Lundquist wrote:
Hi,
I'm using Cocoon 2.1.5.1 w/ Jetty 4.2.15.  xalan was throwing a 
SAXException trying to write a character (U2026, hellip) that's not 
reppresentable in the specified output encoding iso-8859-1.

I made sure I had xml:output encoding=UTF-8 everywhere, but the 
problem persisted.  Finally I figured out that I needed to check the 
encoding parameters in web.xml.  Sure enough, container-encoding and 
form-encoding were not set, and the comments indicate that they 
default to iso-8859-1.

So I set the container-encoding to UTF-8, and that didn't have any 
effect.  Only when I set form-encoding to UTF-8 did my problem go 
away.  The thing is, the character that was causing the problem isn't 
coming from the request!  I expected container-encoding to be the one 
that would effect the behavior I was seeing.

So, am I just not understanding something correctly?  Or is it a bug, 
and if so is it a problem with Cocoon or with Jetty?

Cheers,
Mark
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: authentication-manager and application load

2004-08-19 Thread Jan Hoskens
I've just tried a little test (I never worked with applications in 
authentication before)
This does work fine:

sitemap snippets:
authentication-manager
   handlers
   handler name=AuthenticationHandler
   redirect-to uri=cocoon:/login.html/
   authentication uri=cocoon:raw:/authenticate/
   applications
   application name=apptest
   load uri=cocoon:/test.xml/
   /application
   /applications
   /handler
   /handlers
/authentication-manager
   map:pipeline
  
   map:match pattern=test.xml
   map:generate src=test.xml/
   map:serialize type=xml/
   /map:match

   map:match pattern=**
   map:act type=auth-protect
   map:parameter name=handler 
value=AuthenticationHandler/
   map:parameter name=application value=apptest/
 ...
/map:act
/map:match
 /map:pipeline

the application file that's loaded with first match:
?xml version=1.0 encoding=utf-8 ?
test
   datadata/data
/test
Inside the protected area I used an xsp to quickly get the session content:
String test = xsp-session-fw:getxml context=authentication 
path=/application/test/data/;
   if ((test != null) amp;amp; (test != ))
   {
   spantest:xsp:exprtest/xsp:expr/span
   }

This gave me the data string correctly on my page.
If you need to know how the full session context authentication looks 
like, just do this:
   String test = xsp-session-fw:getxml context=authentication 
path=//;
Then (if you have your logs set correctly to debug, not error) there 
should be an entrance in your core.log file that shows something like:

DEBUG   (2004-08-19) 08:29.57:029   [core.session-manager] 
(/cocoon-2.1.5/site/index.html) 
http8080-Processor3/DefaultSessionManager: BEGIN getContextFragment 
name=authentication, path=/
DEBUG   (2004-08-19) 08:29.57:029   [core.session-manager] 
(/cocoon-2.1.5/site/index.html) 
http8080-Processor3/DefaultContextManager: BEGIN getContext 
name=authentication
DEBUG   (2004-08-19) 08:29.57:029   [core.session-manager] 
(/cocoon-2.1.5/site/index.html) 
http8080-Processor3/DefaultContextManager: END getContext 
[EMAIL PROTECTED]
DEBUG   (2004-08-19) 08:29.57:039   [core.session-manager] 
(/cocoon-2.1.5/site/index.html) 
http8080-Processor3/DefaultSessionManager: END getContextFragment 
documentFragment=?xml version=1.0 encoding=UTF-8?
authentication
IDuser/ID
rolerole/role
data
typecocoon.authentication/type
mediahtml/media
/authentication
application
test
   datadata/data
/test
/application

Hope this works for you.
Kind regards,
Jan
[EMAIL PROTECTED] wrote:
Hello Jan,
JH Getting, setting and saving application information
JH Analogue to the access of the authentication data a resource can access
JH its application data:
JH session:getxml context=authentication path=/application/username/
JH session:setxml context=authentication 
JH path=/application/shoppingcartitem1/item2//session:setxml

JH The path underlies the same restrictions and rules as always, but it has
JH to start with /application/.
Thanks. OK load data should be in authentication context but it isn't
there.
handler name=warsztat-auth
   redirect-to 
uri=cocoon://warsztat/users/login.html/
   authentication 
uri=cocoon:raw:/authenticate/
   applications
   application name=gdpl
   load 
uri=cocoon:/LoadUser/
   /application
   /applications
   /handler
LoadUser creates correct xml and is called for sure (changing pipeline
name causes error on login). But nothing producet by this pipeline is found
in authentication context. Help!
 


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: Variable name

2004-08-19 Thread Jan Hoskens
Why do you want that hyphen?
I would suggest to use normal java way of capitalization:
mailUser = hello;
Kind Regards,
Jan
Adriano Smith wrote:
Is there any way i can use variable names with a hyphen in 
Flowscript?br br something like br var mail-user=hello;br 
br I get an error when i tried this. br br Or is it possible to 
use the same in XSP? 
http://ads.sify.com/RealMedia/ads/click_nx.ads/mail.sify.com/[EMAIL PROTECTED] 


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: javascript in XSL

2004-08-17 Thread Jan Hoskens
If you want javascript libraries within your page the following should 
work:
script type=text/javascript language=JavaScript 
src=resources/AnchorPosition.js; /script

( ; because empty element may cause some problems)
If you still get the error ProcessingException, I suggest you leave your 
javascript tags out and see if you still get that error. The javascript 
tag should not give any problems except maybe for a resource not found 
when trying to load the .js file.

When such an error occurs, do check your logs, especially the 
sitemap.log (you've got your logs configured properly I guess?). That 
should give you more details about when and where that error pops up.

(try leaving the session transformer out, maybe that's the problem, or 
your stylesheet maybe, when passing variables/parameters to it?)

Kind Regards,
Jan
Siaw Ling Lo wrote:
hi,
the sitemap is:
map:match pattern=tree  
map:generate src=resources_bkup/tree.xml/
map:transform type=session/
map:transform src=stylesheets_bkup/tree.xsl/
map:transform type=encodeURL/
map:serialize/
/map:match
map:match pattern=*.js
map:read mime-type=text/javascript
src=resources/{1}.js/
/map:match
tree.js is in resources directory.
By the way, I always tried 
script type=text/javascript language=JavaScript
src=tree.jsvar
thisGetsIgnoredButdoNotRemove;/script

but still get the same error :
org.apache.cocoon.ProcessingException: Failed
to execute pipeline.: java.lang.RuntimeException:
java.lang.NullPointerException .
Thanks again,
Siaw Ling
==
From: KOZLOV Roman 
Subject: Re: javascript in XSL 
Date: Mon, 16 Aug 2004 04:35:45 -0700 

Hi,
What is your pipeline for this? Check it.
Siaw Ling Lo wrote:
 

hi,
I am using cocoon2 and trying to build a tree that
   

can
 

collapse and expand when click.
I tried various methods in getting the javascript to
work with XSL to display an XML but it just can't
   

work
 

- error: org.apache.cocoon.ProcessingException:
   

Failed
 

to execute pipeline.: java.lang.RuntimeException:
java.lang.NullPointerException .
The methods I tried including
1. script type=text/javascript src=tree.js /
   

in
 

html-head
2. embedding :
script type=text/javascript
   xsl:comment
   ![CDATA[
   x
   ]]
   /xsl:comment
/script
below are the XSL file with the 2nd approach and
corresponding XML file.
=
xsl:stylesheet version=1.0
xmlns:xsl=http://www.w3.org/1999/XSL/Transform
xsl:template match=tree
html
head
script type=text/javascript
   xsl:comment
   ![CDATA[
function clickOnEntity(entity) {
 if(entity.open == false) {
   expand(entity, true)
 }
 else {
   collapse(entity)
 }
 window.event.cancelBubble = true
}
function expand(entity) {
 var oImage
 oImage = entity.childNodes(0).all[image]
 oImage.src = entity.imageOpen
 for(i=0; i  entity.childNodes.length; i++) {
   if(entity.childNodes(i).tagName == DIV) {
 entity.childNodes(i).style.display = block
   }
 }
 entity.open = true
}
function collapse(entity) {
 var oImage
 var i
 oImage = entity.childNodes(0).all[image]
 oImage.src = entity.image
 // collapse and hide children
 for(i=0; i  entity.childNodes.length; i++) {
 if(entity.childNodes(i).tagName == DIV) {
   if(entity.id != folderTree)
entity.childNodes(i).style.display = none
   collapse(entity.childNodes(i))
 }
   }
 entity.open = false
}
function expandAll(entity) {
 var oImage
 var i
 expand(entity, false)
 // expand children
 for(i=0; i  entity.childNodes.length; i++) {
   if(entity.childNodes(i).tagName == DIV) {
 expandAll(entity.childNodes(i))
   }
 }
}
   ]]
   /xsl:comment
/script
/head
body
 xsl:apply-templates select=entity/
/body
/html
/xsl:template
xsl:template match=entity
 div onclick=window.event.cancelBubble =
true;clickOnEntity(this); onselectstart=return
false ondragstart=return false
 xsl:attribute name=imagexsl:value-of
select=image//xsl:attribute
 xsl:attribute name=imageOpenxsl:value-of
select=imageOpen//xsl:attribute
 xsl:attribute name=openfalse/xsl:attribute
 xsl:attribute name=idfxsl:value-of
select=@id//xsl:attribute
 xsl:attribute name=openfalse/xsl:attribute
 xsl:attribute name=STYLE
   padding-left: 20px;
   cursor: hand;
   xsl:if expr=depth(this)  2
 display: none;
   /xsl:if
 /xsl:attribute
   table border=0 cellspacing=0
   

cellpadding=0
 

 tr
   td valign=middle
 img border=0 id=image
   xsl:attribute name=SRC
 xsl:value-of select=image/
   /xsl:attribute
 /img
   /td
   td valign=middle nowrap=true
   xsl:attribute name=STYLE
 padding-left: 7px;
 font-family: Verdana;
 font-size: 11px;
 font-color: black;
   /xsl:attribute
   xsl:value-of select=description//td
 /tr
   /table
 xsl:apply-templates select=contents/entity/
 /div
/xsl:template
/xsl:stylesheet

Re: authentication-manager and application load

2004-08-17 Thread Jan Hoskens
When succesfully authenticated, a xml part should have been generated like:
authentication
 ID/
 role/
 data
some more fragments as you like
 /data
/authentication
Context of session is authentication
In xsp use:
xsp-session-fw:getxml context=authentication path=/authentication/ID/;
In flow use:
var contextMan = null;
try
{
   contextMan 
=cocoon.getComponent(Packages.org.apache.cocoon.webapps.session.ContextManager.ROLE);
   var sessionContext = contextMan.getContext(authentication);
   var id = 
documentFragment2String(sessionContext.getXML(/authentication/ID));
}
finally
   {
   cocoon.releaseComponent(contextMan);
   }   

It's in the same document as you found the other sentence under 
:(http://cocoon.apache.org/2.1/developing/webapps/authentication.html)

   snip
   Getting, setting and saving application information
Analogue to the access of the authentication data a resource can access 
its application data:

session:getxml context=authentication path=/application/username/
session:setxml context=authentication  
path=/application/shoppingcartitem1/item2//session:setxml
The path underlies the same restrictions and rules as always, but it has 
to start with /application/.

/snip
Kind Regards,
Jan
[EMAIL PROTECTED] wrote:
Hello ML users,
On a successful authentication the framework invokes for each
application of the handler the load resource (if present). The content or result of the 
load resource is stored into the session context.
For God sake what IS THE NAME of that context. I've tried root node of
generated XML with no effect.
authentication-manager
   handlers
   handler name=warsztat-auth
   redirect-to 
uri=cocoon://warsztat/users/login.html/
   authentication 
uri=cocoon:raw:/authenticate/
   applications
   application name=gdpl
   load 
uri=cocoon:/LoadUser/
   /application
   /applications
   /handler
   /handlers
   /authentication-manager
 

 


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: [cforms] struct and class display

2004-08-13 Thread Jan Hoskens
Whenever you have a union widget, you need a case widget that holds the 
id of the currently chosen unionpart (struct) in its valuefield. You 
might understand it better with a little example:

Lets say you have some heterogeneous repeater, some fields may contain 
input, other's just a value to show.
definition: (don't forget the fd:new id=myclass, I don't mention them 
here explicitly, but you do want to create an instance of course)
fd:class id=myclass
  fd:widgets
  !-- make sure to use a field widget with a selection list for 
the 'case' widget of the following union --
  fd:field id=input_type
 fd:datatype base=string/
  fd:selection-list
   fd:item value=no_input   !-- the value is the 
id of a struct below, this will make that struct visible if chosen --
   fd:labelNo input/fd:label !-- label not 
really needed if the select-widget isn't shown to user--
   /fd:item
   fd:item value=input
   fd:labelInput/fd:label
   /fd:item
   /fd:selection-list
   /fd:field
   fd:union case=input_type default=no_input 
id=input_union
   fd:widgets
   fd:struct id=no_input   !-- Notice the same 
id as above in the selection, this struct will simply show the field--
   fd:widgets
  fd:output id=some_output_field
 fd:datatype base=string/
   /fd:output
   /fd:widgets
   /fd:struct
   fd:struct id=input
   fd:widgets
   fd:field id=some_input_field!-- 
this will give an input field to change the value--
   fd:datatype base=string/
   /fd:field
   /fd:widgets
   /fd:struct
   /fd:widgets
   /fd:union
   /fd:widgets
   /fd:class

your template may look like:
ft:class id=myclass
   ft:widget id=input_typefi:styling 
type=hidden//ft:widget !-- I set the selection widget hidden, I 
want the source xml document data to make the choice--
   ft:union id=input_union
   ft:case id=no_input
   ft:struct id=no_input
   ft:widget id=some_output_field/ !-- non 
editable--
   /ft:case
   ft:case id=input
   ft:struct id=input
   ft:widget id=some_input_id/!-- edit field--
   /ft:struct
   /ft:case
   /ft:union
   /ft:class

let the binding field take care of the selection:
fb:class id=myclass
   fb:javascript id=input_type path=. direction=load
   fb:load-form
   var tmp = jxpathContext.getValue(@user_changable);
   if (tmp != null)
   {
   var userChangable = new java.lang.String(tmp);
   if (userChangable.equals(yes))   
   {
   widget.setValue(input);
   }else{
   widget.setValue(no_input);
   }
   }
 /fb:load-form
   /fb:javascript
   fb:union id=input_union path=.
   fb:case id=no_input path=.
   fb:struct id=no_input path=.
fb:value id=some_output_field/
   /fb:struct
   /fb:case
   fb:case id=input path=.
   fb:struct id=input path=.
   fb:value id=some_input_field path=./
   /fb:struct
   /fb:case
   /fb:union
   /fb:class

This may bind the xml data if you create a repeater which has an 
instance of the class:

some_list!-- repeater parent path--
  item user_changable=yesvalueA/item!-- surround (for 
this example) the fb:new with a fb:context path=item, so that the 
class works on item, @user_changable and the containing textnode--
   item user_changable=novalueB/item
/some_list

this will give an input field with valueA and an output field for valueB
Hope I minimized the typo's, it's a long bit of code ;-)
Kind Regards,
Jan
Stephane Delort wrote:
Hi,

well I can, now, access to the object in class, struct or union in my
 flowscript (see previous thread).

but then, the shame is that it does not display the form and I have a
 nullpointer exception error instead.
In my defintion file I have :
**
 ...
 fd:widgets
   fd:union id=start default= case=widget-id
 fd:datatype base=string/
 fd:widgets
   fd:new id=widgetClass/
 /fd:widgets
   /fd:union
   fd:class id=widgetClass
 fd:widgets
   fd:repeater id=inList 
 fd:widgets
   fd:union id=union case=widget-id
   

Re: passing sitemap parameters to XSP?

2004-08-11 Thread Jan Hoskens
xsp:page
String id = parameters.getParameter(id, defaultvalue);
/xsp:page
Kind Regards,
Jan
Lars Huttar wrote:
Dear Cocoonists,
I'm trying to pass sitemap parameters to an XSP page:
 map:match pattern=data/language-entry/*
   map:generate src=sources/language-entry.xsp type=serverpages
 map:parameter name=id value={1} /
   /map:generate
   map:serialize type=xml /
 /map:match
But in the xsp page, where I use xsp-request:get-parameter name=id/,
the result is nothing (empty string).
This makes sense, since the parameter I'm looking for is
not a request parameter, so xsp-request shouldn't find it.
But then, how DO I pick up sitemap parameters?
(If I am using the term sitemap parameter right?)
It is documented in various places, including the xsp.xsl
logicsheet, that parameters - parameters defined in the sitemap
is one of the Built-in parameters available for use in XSP. But
nowhere can I find how to access it/them.
Any help is appreciated!
You are probably wondering why I don't use a request parameter,
e.g.
 map:match pattern=data/language-entry/*
   map:generate src=sources/language-entry.xsp type=serverpages
 map:parameter name=id value={1} /
   /map:generate
   map:serialize type=xml /
 /map:match
instead of a sitemap parameter.
That is an option.
I've been avoiding it because it would mean that when it
comes to using that parameter as part of a filename, for reading
or writing, I would have to take extra steps to make sure
someone doesn't try to sneak in values like foo/../../etc
and try to get access to files they shouldn't.
Thanks,
Lars
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: passing sitemap parameters to XSP?

2004-08-11 Thread Jan Hoskens
Try this:
xsp:page language=java xmlns:xsp=http://apache.org/xsp;
xmlns:xsp-request=http://apache.org/xsp/request/2.0; 
xmlns:esql=http://apache.org/cocoon/SQL/v2;
language-entry
xsp:logicString id = parameters.getParameter(id, -1);/xsp:logic
classLanguage in Country/class
id
xsp:exprid/xsp:expr
/id
/language-entry
/xsp:page
Normally the page gets compiled and the language-entry is set as root 
element of the resulting page (after generation). Only at the time of 
generation the id parameter is known. If you're xsp:logic block is 
outside that 'user'-rootelement the contents will be class-level stuff 
and no parameters are available (more or less like static methods stuff, 
or member variables). When the page is constructed parameters are passed 
(ie class constructor gets parameters with it)

Do you know there are some pages at the wiki site about XSP?
These might help:
http://wiki.apache.org/cocoon/XSP
http://wiki.apache.org/cocoon/XSPSyntax
Kind Regards,
Jan
Lars Huttar wrote:
OK, I'm still struggling... I'm not used to putting raw
Java code in an XSP page.
I tried:
xsp:page language=java xmlns:xsp=http://apache.org/xsp;
xmlns:xsp-request=http://apache.org/xsp/request/2.0; 
xmlns:esql=http://apache.org/cocoon/SQL/v2;
 String id = parameters.getParameter(id, -1);
language-entry
classLanguage in Country/class
id
xsp:exprid/xsp:expr
/id
/language-entry
/xsp:page
and got the error:
org.apache.cocoon.ProcessingException: Language Exception:
org.apache.cocoon.components.language.LanguageException: Error compiling 
language_entry_xsp: ERROR
1 (org\apache\cocoon\www\cvsmount\ethnologue\sources\language_entry_xsp.java): ...
this.characters(\n\t\t\t); // start error (lines 325-325) id cannot be resolved
XSPObjectHelper.xspExpr(contentHandler, id); // end error this.characters(\n\t\t); 
... Line 325,
column 0: id cannot be resolved
Line 325 says
XSPObjectHelper.xspExpr(contentHandler, id);
I noticed that in language_entry_xsp.java, the
 String id = parameters.getParameter(id, -1);
code was nowhere to be found.
Then I tried it with xsp:logic around that code:
xsp:page language=java xmlns:xsp=http://apache.org/xsp;
xmlns:xsp-request=http://apache.org/xsp/request/2.0; 
xmlns:esql=http://apache.org/cocoon/SQL/v2;
 xsp:logicString id = parameters.getParameter(id, -1);/xsp:logic
language-entry
classLanguage in Country/class
id
xsp:exprid/xsp:expr
/id
/language-entry
/xsp:page
but this gave the error:
Original Exception: java.lang.NullPointerException
at
org.apache.cocoon.www.cvsmount.ethnologue.sources.language_entry_xsp.init(org.apache.cocoon.www.c
vsmount.ethnologue.sources.language_entry_xsp:239)
where line 239 is:
 String id = parameters.getParameter(id, -1);
No doubt I'm doing something wrong but don't know what else to
try.
Thanks again,
Lars
 

-Original Message-
From: Jan Hoskens [mailto:[EMAIL PROTECTED]
Sent: Wednesday, August 11, 2004 7:20 AM
To: [EMAIL PROTECTED]
Subject: Re: passing sitemap parameters to XSP?

xsp:page
String id = parameters.getParameter(id, defaultvalue);
/xsp:page
Kind Regards,
Jan
Lars Huttar wrote:
   

Dear Cocoonists,
I'm trying to pass sitemap parameters to an XSP page:
map:match pattern=data/language-entry/*
  map:generate src=sources/language-entry.xsp
 

type=serverpages
   

map:parameter name=id value={1} /
  /map:generate
  map:serialize type=xml /
/map:match
But in the xsp page, where I use xsp-request:get-parameter
 

name=id/,
   

the result is nothing (empty string).
This makes sense, since the parameter I'm looking for is
not a request parameter, so xsp-request shouldn't find it.
But then, how DO I pick up sitemap parameters?
(If I am using the term sitemap parameter right?)
It is documented in various places, including the xsp.xsl
logicsheet, that parameters - parameters defined in the sitemap
is one of the Built-in parameters available for use in XSP. But
nowhere can I find how to access it/them.
Any help is appreciated!
You are probably wondering why I don't use a request parameter,
e.g.
map:match pattern=data/language-entry/*
  map:generate src=sources/language-entry.xsp
 

type=serverpages
   

map:parameter name=id value={1} /
  /map:generate
  map:serialize type=xml /
/map:match
instead of a sitemap parameter.
That is an option.
I've been avoiding it because it would mean that when it
comes to using that parameter as part of a filename, for reading
or writing, I would have to take extra steps to make sure
someone doesn't try to sneak in values like foo/../../etc
and try to get access to files they shouldn't.
Thanks,
Lars

Re: Encoding problems

2004-08-03 Thread Jan Hoskens
You may want to take a look at the wiki page: 
http://wiki.apache.org/cocoon/RequestParameterEncoding
I had this problem a while ago: 
http://marc.theaimsgroup.com/?l=xml-cocoon-usersm=109100902605917w=2
I'm wondering what the best solution is and which encoding is preferred 
for handling special characters or when UTF-8 / ISO 8859-1 should/could 
be used.

Kind Regards,
Jan
[EMAIL PROTECTED] wrote:
FREDERIC MOSER wrote:
Hi,
I've got some encoding problems using the xhtml serializer, I don't
really understand .
(I use Mozilla on Win XP and my editor is set to use UTF-8)
Part 1:
---
I've got the following stylesheet:
-- 

?xml version=1.0 encoding=UTF-8?
xsl:stylesheet version=1.0
xmlns:xsl=http://www.w3.org/1999/XSL/Transform;
xsl:output method=xml version=1.0 encoding=UTF-8 
indent=no/
xsl:template match=/
html
head
titleplop/title
link rel=stylesheet type=text/css 
href=simple.css/
meta http-equiv=Content-Type content=text/html;
charset=UTF-8 /
/head
body
h1Monographie ééé/h1
div
form method=post action=ModifierMonographie
...
-- 

If I use : map:serialize type=html/, everything work but the browser
detect my encoding as IS0-8859-1 (because we can't encode HTML 4.01 as
UTF-8 I guess??)

Did you check in the components section of your sitemap.xmap how the 
serializers are configured?

To supply HTML using UTF-8 you could use
-- 

map:serializer name=html mime-type=text/html; charset=utf-8
logger=sitemap.serializer.html pool-grow=2
pool-max=64 pool-min=2
src=org.apache.cocoon.serialization.XMLSerializer
   doctype-public-//W3C//DTD XHTML 1.0 
Strict//EN/doctype-public 
doctype-systemhttp://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd/doctype-system 

   omit-xml-declarationyes/omit-xml-declaration
   omit-namespacesyes/omit-namespaces
   encodingUTF-8/encoding
   indentyes/indent
/map:serializer
-- 



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: Authentication and matchers

2004-07-30 Thread Jan Hoskens
Try {../1} with the second one (don't know if your  locale parameter 
needs this too, where does it come from? Needs to be {../../locale} if 
it comes from the same level as the 1)

This ../ is needed whenever you have an extra level in your pipeline. 
The action is such a level so use ../.to go up one level and get the 
parameter.

Kind Regards,
Jan
Ulf Sahlin wrote:
Hi!
I'm having some trouble with authentication and pattern matchers. Is there
some reason as to why this works:
map:match pattern=customer/*
 map:act type=auth-protect
   map:parameter name=handler value=customerhandler/
   map:match pattern=customer/overview.*
 map:call resource=generate-customer-overview/
 map:call resource=transform-customer-overview-{1}
   map:parameter name=locale value={../locale}/
 /map:call
 map:call resource=serialize-{1}/
   /map:match
 /map:act
/map:match
.. but this does not:
map:match pattern=customer/overview.*
 map:act type=auth-protect
   map:parameter name=handler value=customerhandler/
   map:call resource=generate-customer-overview/
   map:call resource=transform-customer-overview-{1}
 map:parameter name=locale value={../locale}/
   /map:call
   map:call resource=serialize-{1}/
 /map:act
/map:match
In the lower non-working version I'm getting errors about Cocoon not finding
the resource transform-customer-overview- (please note the trailing dash).
This would mean, the pattern * matcher value is lost? Normally, {1} would
translate into html or whatever carrier I'm using.
Best regards,
 Ulf Sahlin
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: map:redirect-to...

2004-07-30 Thread Jan Hoskens
Have you tried another action? Is it possible that the action doesn't 
return a success/failure value?

You may want to try an easy XSP action to verify that success/failure works:
?xml version=1.0 ?
xsp:page
   xmlns:xsp=http://apache.org/xsp;
   xmlns:action=http://apache.org/cocoon/action/1.0;
   xsp:logic
   action:set-success/ !-- or action:set-failure/--
  /xsp:logic
/xsp:action
Kind Regards,
Jan
Sonny Sukumar wrote:
Hey John,
Thanks for the advice.  I didn't get it to work, but I *did* spend a 
few hours on it and discovered something interesting.  Here's the 
steps I followed:

1.) I first introduced new internal redirects, commenting out the old 
ones:

map:match pattern=secure/doTest
 map:act type=perform-test
   !-- Test succeeded. --
   !--map:redirect-to uri=cocoon:/showTestSucceededPage/--
   map:redirect-to uri=cocoon:/myTestSucceeded/
 /map:act
 !-- Test failed. --
 !--map:redirect-to uri=cocoon:/showTestFailedPage/--
 map:redirect-to uri=cocoon:/myTestFailed/
/map:match
This actually works on the first request but not after that!  (Yes, 
I'm resetting the state of my db after each request so I can test this 
Cocoon stuff independently of that state.)

BTW, the new redirects go to extremely basic straight HTML pages for 
which the code is like 3 lines (htmlheadtitle.../title/head 
bodySome Text/body/html), and these simple pages are fetched 
with a simple map:read mime-type=html src=.../)

2.) So I comment out the new redirects, uncomment the old redirects, 
and try 1 more request:

map:match pattern=secure/doTest
 map:act type=perform-test
   !-- Test succeeded. --
   map:redirect-to uri=cocoon:/showTestSucceededPage/
   !--map:redirect-to uri=cocoon:/myTestSucceeded/--
 /map:act
 !-- Test failed. --
 map:redirect-to uri=cocoon:/showTestFailedPage/
 !--map:redirect-to uri=cocoon:/myTestFailed/--
/map:match
This request doesn't work (shows test failed instead of test 
succeeded), though I didn't really expect it to.

3.) So now I go back to how it was in Step 1--and then it works!  BUT 
only the FIRST time!

And I can repeat the above behavior over and over, getting it to work 
but only once.  So it seems like it might have something to do with 
pipeline setup or something...I just don't know.

BTW, simply reuploading the sitemap after Step 1 doesn't get it to 
work either.  I actually have to go through the 3 steps exactly as I 
mentioned.

Hopefully this sparks some insight?  I sure hope one of us can figure 
it out...this scenario can happen to anyone!

Sincerely,
Sonny
From: John L. Webber [EMAIL PROTECTED]
Reply-To: [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Subject: Re: map:redirect-to...
Date: Thu, 29 Jul 2004 09:18:43 +0200
Hi Sonny,
The only other thing I can suggest trying is to reproduce the bug 
with an alternate matcher, using different redirect resources and a 
different action. If the bug doesn't happen then, try swapping in 
your actual resources one at a time, and then your action. Something 
like:

map:match pattern=secure/reallySimpleTest
  map:act type=always-succeeds
map:redirect-to uri=cocoon:/pageExists1/
  /map:act
  map:redirect-to uri=cocoon:/pageExists2/
/map:match
If that works as expected (i.e. no bug), try replacing the first 
redirect with your actual redirect. Of course, you'll have to create 
the new resources first!

Good luck,
John
Sonny Sukumar wrote:
Hey John,
I took your advice and spent some time culling through sitemap.log 
and discovered that BOTH redirects are taking place when I use 
internal redirects...it's just that the test failed redirect 
happens second, so I always see that result page (even though the 
action's operations in modifying the database, etc. are performed 
successfully).

Why this happens is still a mystery to me, but here's the sitemap 
log info showing this:

INFO(2004-07-28) 10:47.42:387   [sitemap] (/secure/doTest) 
http8443-Processor2/RedirectToURINode: Redirecting to 
'cocoon:/showTestSucceededPage' at 
file:/usr/local/tomcat/webapps/cocoon/sitemap.xmap:1750:62

INFO(2004-07-28) 10:47.42:388   [sitemap] (/secure/doTest) 
http8443-Processor2/ForwardRedirector: Redirecting to 
'cocoon:/showTestSucceededPage'

INFO(2004-07-28) 10:47.42:711   [sitemap] (/secure/doTest) 
http8443-Processor2/RedirectToURINode: Redirecting to 
'cocoon:/showTestFailedPage' at 
file:/usr/local/tomcat/webapps/cocoon/sitemap.xmap:1755:68

INFO(2004-07-28) 10:47.42:712   [sitemap] (/secure/doTest) 
http8443-Processor2/ForwardRedirector: Redirecting to 
'cocoon:/showTestFailedPage'

So I then tried--just for the heck of it--putting an html serializer 
right after the first redirect like this:

map:match pattern=secure/doTest
 map:act type=perform-test
   !-- Test succeeded. --
   map:redirect-to uri=cocoon:/showTestSucceededPage/
   map:serialize type=html/
 /map:act
 !-- Test failed. --
 map:redirect-to uri=cocoon:/showTestFailedPage/
/map:match
And of course that didn't work either. :-)  Sooo...maybe there's a 

Re: Any convenient way to embed external pages?

2004-07-29 Thread Jan Hoskens
You're right, you can use it on any url but it does need valid xml as 
response.

Kind Regards,
Jan
taabpr wrote:
Jan Hoskens wrote:
To solve the first problem use the Web Service proxy generator in the 
Proxy block:

map:generate type=wsproxy src=
   map:parameter name=wsproxy-method value=POST/
/map:generate

Isn't it only for xml content?
   Tom
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


encoding problem

2004-07-28 Thread Jan Hoskens
Hi,
I'm currently facing the following problem: I've set the encoding in my 
serializers to ISO-8859-1 and checked the web.xml file (utf-8 is in 
comment, defaults to the ISO-8859-1)
Everything is ok (special chars in cforms offer no problem, saving the 
document with correct encoding) until I get an URI which contains 
special chars. When checking my logs I get the correct uri printed out, 
but the sitemap parameter takes the wrong encoding?:

snip
Current Sitemap Parameters:
LEVEL 1
PARAM: '0' VALUE: 'J??f.xml.html'
PARAM: '1' VALUE: 'J??f.xml.html'
DEBUG   (2004-07-28) 11:30.49:877   [sitemap] 
(/cocoon-2.1.5/site/J%E9%E9f.xml.html) 
http8080-Processor3/PreparableMatchNode: Matcher 'wildcard' matched 
prepared pattern '*.xml.html' at file:/d:/sources/site/sitemap.xmap:401:42
/snip

Why isn't the parameter in the correct encoding?Is there any other 
encoding option I need to set?

Would it better to use utf-8? Tried to change all encodings to utf-8 but 
got problems with browser showing the wrong encoding ISO-8859-1 (is that 
the content-type problem mentioned on the wiki:? 
http://wiki.apache.org/cocoon/RequestParameterEncoding)

I want to keep special chars in the uri because of the following:
   - users may enter any name to create a document (through cforms)
   - afterwards I want to list the different documents so they can 
be viewed/edited/
   - link to edit/view/ contains the document name

Kind Regards,
Jan
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: Any convenient way to embed external pages?

2004-07-28 Thread Jan Hoskens
To solve the first problem use the Web Service proxy generator in the 
Proxy block:

map:generate type=wsproxy src=
   map:parameter name=wsproxy-method value=POST/
/map:generate
taabpr wrote:
Hi all,
It is a little bit connected with my previous mail (html generator 
with 'post'), but much general question.
I have to embed some external content into existing page (a portlet) - 
to be more complex: they are forms with images.
So what I imaging is:
in sitemap:
   map:match pattern=integratedata/*
   map:call resource=http://external_location/{1}; /
   map:serialize/
   /map:match

So it takes care of all requests, + GET + POST.
Unfortunately it doesn't work with map:call.
My current solution is:
   map:match pattern=integratedata/data*
   map:generate type=html 
src=http://localhost:8080/xxx/data{1}?{request:queryString}/
   map:serialize type=html/
   /map:match

map:match pattern=integratedata/*.gif
   map:read mime-type=images/gif 
src=http://localhost:8080/xxx/{1}.gif/
   /map:match

Drawbacks:
1. I've to use GET method. How to move to POST?
2. Diferent matchers for different content.
3. When source changes I have to adjust to it (new reader, etc)
The first drawback could be really problem when form sends too much 
data - GET has limited uri.

Is there any way to simply achieve this? Any block?
Thanks,
   Tom

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: Problem using an External Javascript file (My FIRST question ... so I hope someone can help !)

2004-07-28 Thread Jan Hoskens

However, when I replace it with an external file, containing EXACTLY
the same details, Cocoon cannot find it (despite the inclusion of the
reader below).

A small remark: (hope u don't mind if I drop in)
If cocoon does not find the file, there should be a logging (sitemap.log 
or so) where you can find the uri that's being handled and where the 
sitemap matches, so you can find there why the file doesn't appear.
When the scripttag does appear at the browser but the script isn't 
loaded, try to load the script by typing the url in your browser, you'll 
be getting the file or an error (then again look in your sitemap.log 
where the sitemap matches.

Hope this helps a bit,
Kind regards,
Jan
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: Processing a particular pipeline before every other pipeline?

2004-07-28 Thread Jan Hoskens
Use the internal-only attribute:
map:pipelines
   map:pipeline internal-only=true 
  put every pipeline you don't want the user to access directly here
   /map:pipeline
   map:pipeline
   map:match pattern=**
do whatever you need as actions that's needed for each 
internal pipeline
map:redirect-to src=cocoon:/{1}/
   /map:match
   /map:pipeline
/map:pipelines

The redirect-to doesn't do a http redirect if you use the cocoon:/ 
protocol (see 
http://cocoon.apache.org/2.1/userdocs/concepts/redirection.html)
So every external request ends up in the second pipeline while the 
internal redirect sees the first pipeline and doesn't reach the second 
one if the first pipeline covers everything. Mind this last phrase! If 
you don't want to be cycling through your sitemap pipelines until a 
redirect exceeded error pops up! You can create a matcher at the end of 
the first line with pattern=** that tries to read default xml pages 
like this:

map:match pattern=**
   map:generate src=pages/{1}/
   map:serialize/
/map:match
This avoids the cycle and when not found, your error handler will come in.
Kind Regards,
Jan
David Swearingen wrote:
I need to run some cookie generation code (in a pipeline) before any 
of my web pages are processed.  That is, I've got several pipelines, 
but I want this particular pipeline to run before any of the others 
are executed.  Obviously, I don't want to have to modify every 
existing pipeline, and all subsequent new pipelines.  I imagine that 
this code will be an Action or XSP, but that's really besides the 
point: this is more of a pipeline question as I see it.
 
(I knew how to do this in Struts, but haven't seen anything like this 
so far in my first few months of using Cocoon.  In web applications 
I've written this type of thing is normally needed for authentication  
-- e.g. make sure every request goes through the authentication 
servlet before it hits any other servlet...) 
 
Does anyone know how to do this?
 
 

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: New wiki - impressions?

2004-07-05 Thread Jan Hoskens
David Crossley wrote:
Stephan Michels wrote:
 

I have the same impression. The content is much less readable.
   

In what way?
I gather colours and fonts and stuff can be customised.
Read the MoinMoin documentation.
 

I miss the navigation panel on the left side
   

Me too, but i don't think that we can have one
(i could be wrong).
 

It's possible, look at: http://moinmoin.wikiwikiweb.de/ThemeMarket
You'll find a leftsidebar there and probably some more interesting 
things on that wiki concerning layouting.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: New wiki - impressions?

2004-07-05 Thread Jan Hoskens
David Crossley wrote:
Jan Hoskens wrote:
 

David Crossley wrote:
   

Stephan Michels wrote:
 

I miss the navigation panel on the left side
   

Me too, but i don't think that we can have one
(i could be wrong).
 

It's possible, look at: http://moinmoin.wikiwikiweb.de/ThemeMarket
You'll find a leftsidebar there and probably some more interesting 
things on that wiki concerning layouting.
   

Great, someone with a constructive comment.
Please determine the configuration entries and we will
add them to the Cocoon config.
 

I'm no python/ moinmoin expert, but as far as I can see it's by using 
themes. Download the theme lefsidebar:
http://moinmoin.wikiwikiweb.de/ThemeMarket?action=AttachFiledo=gettarget=leftsidebar2.tar.gz
(on the theme pages given earlier, help on themes: 
http://moinmoin.wikiwikiweb.de/HelpOnThemes )
unpack under your moinmoin and set the default theme to the 
leftsidebar2 theme. This setting should be somewhere
in the configuration file moin_config.py under the option theme_default.
(configuration help: http://moinmoin.wikiwikiweb.de/HelpOnConfiguration)

I'm sure that whoever installed the moinmoin should be able to install 
it with no problems.

Kind Regards,
Jan
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: [CocoonForms] Disable Calendar

2004-06-21 Thread Jan Hoskens
The tag fi:styling type=date ../ is responsible for the layout on your
page. You can find the styling in the stylesheets that come with cforms. The
date styling in particular can be found in forms-calendar-styling.xsl.

You've got several options: create your own styling type, change the cforms
stylesheet itself or override it.
I have created my own stylesheet that includes the cforms stylesheet
forms-samples-styling.xsl this stylesheet on its own includes the other
cforms stylesheets. So I have my own types and override some of the cforms
by just using the same matcher. (I actually copied some templates from the
cforms sheets and adapted them to my needs)

Kind Regards,

Jan
- Original Message - 
From: Freddy [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Monday, June 21, 2004 11:26 AM
Subject: [CocoonForms] Disable Calendar


 Hi all!

 Just one small question: What do I have to do if I want to disable the
 calendar in woody-Forms. I have

fd:field id=birthdate
 fd:labelGeburtstag/fd:label
 fd:datatype base=date
   fd:convertor type=formatting variant=date
 fd:patterns
   fd:patterndd.MM./fd:pattern
 /fd:patterns
   /fd:convertor
 /fd:datatype
   /fd:field

 and my binding is::

 fi:labelString fields/fi:label
 fi:styling layout=columns/
 fi:items
ft:widget id=birthdate
fi:styling type=date format=dd.MM./
/ft:widget
ft:widget id=language/
 /fi:items

 And I get an Input-Field with a Calendar next to it. But I want to have
 it disabled.

 Thanks for your help

 Freddy




 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: match patern=/

2004-06-01 Thread Jan Hoskens
You should mention your port with your host (host:portnumber), something
like

http://localhost:8080/

should do the trick, if not, your port will be different, so look it up in
the configuration of your server (tomcat/jetty...)
Then make sure you're pointing to the correct webapp, under tomcat every
webapp has its directory and it's name is used
to access each webapp, so then you'll end up with:

http://localhost:8080/cocoon/
(if cocoon is your webapp name)

You may configure your server to default to your cocoon and omit the
cocoon/ part.

Kind Regards,
Jan

- Original Message - 
From: Perez Carmona, David [EMAIL PROTECTED]
To: Cocoon (E-mail) [EMAIL PROTECTED]
Sent: Tuesday, June 01, 2004 1:01 PM
Subject: match patern=/



 Hi all,

 I have a web application whose content is root.
 Also I have a matcher at the beginning of the pipeline that handles the
entry point

 map:match pattern=
 map:act src=my-action
 
 /map:act
 /map:match

 The problem is that I never enter inside the matcher (i.e. my-action is
never called) when I browse to http://localhost or http://localhost/.
 The response I get under IE6 is:
 Cannot find server or DNS error.

 After having debugged a little inside CocoonServlet.java, I discover that
the code is trying to redirect to http://localhost//

 This snippet in CocoonServlet.service() is the responsible:

 String uri = request.getServletPath(); // uri.equals() in my case
 if (uri == null) {
 uri = ;
 }
 String pathInfo = request.getPathInfo(); // pathInfo == null in my
case
 if (uri.length() == 0) { // uri == '' here
  String prefix = request.getRequestURI();
  if (prefix == null) {
 prefix = ;
  }

  res.sendRedirect(res.encodeRedirectURL(prefix + /)); //
res.sendRedirect(//) in my case
  return;
 }

 Why is the slash doubled?
 It is strange because I have never had problems with this, it used to work
before.
 Is this a known Cocoon bug?


 I'm working with Tomcat 4.1.18, Java 1.4.2_04, Windows 2003 Server, Cocoon
2.1.2

 *
 Este correo ha sido procesado por el Antivirus del Grupo FCC
 *

 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Large documents - OutOfMemoryError with Tomcat but not Jetty!!!

2004-06-01 Thread Jan Hoskens
I'm no expert in this, but what's your exact memory amount you've tried? I'm
using CATALINA_OPTS=-Xmx384M and that works fine with me, although my pdf
documents aren't that big. I also had a small problem that the tomcat that I
installed: it created a shortcut in my program files that did not start with
the correct parameters, you do need to start with the startup.bat /sh in the
bin directory to have that memory parameter in use.

I also switched to running my pdf stuff in a thread because fop takes a lot
of time.
When the xml doc is ready I call a thread in my flow that handles the fop
part while I send the user a page that tells him his request is handled and
that a link will appear on some page when the pdf is ready. This may give
some ideas, because you're mentioning the twenty minute waiting period.


Kind Regards,
Jan

- Original Message - 
From: [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Tuesday, June 01, 2004 2:18 PM
Subject: Large documents - OutOfMemoryError with Tomcat but not Jetty!!!


 I have a problem when using Cocoon to aggregate large amounts of content
 that is to be serialised as PDF.

 I have a set of pipelines that build a XML document that contains a set of
 xincludes which is then transformed using the xinclude transformer before
 conversion into XSL-FO and final serialisation to PDF. Using all the
 standard transformers - nothing extra, XML, XSLT, Xinclude but no XSP and
 the like.

 If I run this using Tomcat it works for small document sets (29) amounting
 to 218KB of XML and 43KB of PDF.

 If I run this using Tomcat for a large document set (1044) amounting to
 3.5MB of XML and 2.7MB of PDF then I get OutOfMemoryError messages in the
 logs (cocoon and tomcat) - see below.

 If I install a full version of Jetty I get outOfMemory errors too.

 However, if I run the same app within the version of Jetty that comes with
 Cocoon there is no problem


 *** Can anyone explain why the Jetty that comes with cocoon works while
 Tomcat does not??? 


 I have include system config's and log extracts from both cocoon and
tomcat
 at the end of this e-mail.


 I have tried all the various tricks with changing memory settings for JVM
 like:

 CATALINA_OPTS= -Xms128m -Xmx128m 

 But with no success. No out of memory errors, it just never finished after
 20 minutes waiting!

 I have also ensured that I use the FOP tuning tips to ensure best
recycling
 of memory.






 Server Configuration
 

 OS: Red Hat Linux - Advanced Server version 2.1

 HTTP Server: Apache httpd-2.0.48

 VM: Java 1.4.2_02-b03

 AppServer: Tomcat 4.1.30

 App: Cocoon 2.1.2




 cocoon/WEB-INF/logs/core.log
 

 WARN(2004-06-01) 10:49.01:190   [core.manager]

(/cocoon/RIU/Aggregate/Content/Documents/World/Former_Soviet_Union/Russia/Ru
 ssia.pdf) TP-Processor7/ExcaliburComponentManager: Attempted to release a
 org.apache.cocoon.components.treeprocessor.sitemap.ComponentsSelector but
 its handler could not be located.
 ERROR   (2004-06-01) 10:50.44:818   [core.store.janitor] (Unknown-URI)
 Unknown-thread/StoreJanitorImpl: OutOfMemoryError in freeMemory()
 ERROR   (2004-06-01) 10:51.07:636   [core.store.janitor] (Unknown-URI)
 Unknown-thread/StoreJanitorImpl: OutOfMemoryError in freeMemory()
 WARN(2004-06-01) 10:51.16:127   [core.manager]

(/cocoon/RIU/Aggregate/Content/Documents/World/Former_Soviet_Union/Russia/Ru
 ssia.pdf) TP-Processor7/ExcaliburComponentManager: Attempted to release a
 org.apache.cocoon.components.treeprocessor.sitemap.ComponentsSelector but
 its handler could not be located.
 ERROR   (2004-06-01) 10:52.34:308   [core.store.janitor] (Unknown-URI)
 Unknown-thread/StoreJanitorImpl: OutOfMemoryError in freeMemory()


 cocoon/WEB-INF/logs/error.log
 -

 ERROR   (2004-06-01) 10:50.44:819   [core.store.janitor] (Unknown-URI)
 Unknown-thread/StoreJanitorImpl: OutOfMemoryError in freeMemory()
 ERROR   (2004-06-01) 10:51.09:073   [core.store.janitor] (Unknown-URI)
 Unknown-thread/StoreJanitorImpl: OutOfMemoryError in freeMemory()
 ERROR   (2004-06-01) 10:52.34:309   [core.store.janitor] (Unknown-URI)
 Unknown-thread/StoreJanitorImpl: OutOfMemoryError in freeMemory()


 Tomcat/logs/localhost_log.2004-06-01.txt
 

 2004-06-01 10:51:15 StandardWrapperValve[Cocoon]: Servlet.service() for
 servlet Cocoon threw exception
 javax.servlet.ServletException: Servlet execution threw an exception
 at

org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Application
 FilterChain.java:269)
 at

org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterCh
 ain.java:193)
 at

org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.ja
 va:256)
 at

org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok
 eNext(StandardPipeline.java:643)
 at

org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
 at
 

Re: disabling widgets in CForms

2004-05-18 Thread Jan Hoskens



A while ago I created an extra template in my woody 
(cforms) to show/not show a group of widgets if a checkbox is clicked. It may 
give you something to begin with:

This template goes in your woody/cform stylesheet 
or create your own stylesheet and let this stylesheet include the other 
woody/cform stylesheets

!-- wi:group of type 
checkboxGroup: changes display settings to none resp. block if previous was 
resp. block or none, thus flipping its display state -- 
xsl:template 
match="wi:group[wi:styling/@type='checkboxGroup']" 
 xsl:variable name="value" 
select="wi:state/wi:*/wi:value"/ !-- 
copy the "state-widget" attribute for use in for-each 
-- xsl:variable name="state-widget" 
select="wi:state/wi:*/@id"/

 xsl:variable name="id" 
select="generate-id()"/ 
xsl:apply-templates 
select="wi:label/node()"/xsl:apply-templates 
select="text()"/ input 
type="checkbox" name="{$state-widget}" xsl:if test="$value = 
'true'"xsl:attribute 
name="checked"true/xsl:attribute/xsl:if/input 
xsl:if 
test="wi:items/*//wi:validation-message" 
span style="color:red; font-weight: 
bold"#160;!#160;/span 
/xsl:if

 !-- a div for 
each of the items -- xsl:for-each 
select="wi:items/wi:*" div 
id="{$id}_items_{position() - 1}"xsl:if 
test="not($value = 
@displayWhen)"xsl:attribute 
name="style"display:none/xsl:attribute/xsl:if 
xsl:apply-templates 
select="."/ 
/div /xsl:for-each 
/xsl:template

Use this to show the checkbox 
(template):

wi:groupwi:styling 
type="checkboxGroup"/wt:widget-label 
id="state"/wi:statewt:widget-label 
id="state"/: wt:widget 
id="state"//wi:statewi:itemswi:group 
displayWhen="false"wi:itemsName:wt:widget 
id="name"//wi:items/wi:group/wi:items/wi:group

definition:

wd:booleanfield 
id="state"wd:labelDo you want to give your 
name?/wd:label/wd:booleanfieldwd:field 
id="name"wd:datatype 
base="string"//wd:field

This should give you a textbox asking if you want 
to give your name, if checked a textfield should appear.

Note however, that this is just one way, you may 
accomplish the same by using _javascript_!

Kind Regards,
Jan


  - Original Message - 
  From: 
  Jakob Schwendner 
  To: [EMAIL PROTECTED] 
  Sent: Tuesday, May 18, 2004 8:39 AM
  Subject: disabling widgets in 
CForms
  
  Hi,
  
  Is there a way to disable groups of widgets in 
  CForms?
  
  My application:
  
  Payment:
  (x)Invoice
  ( )Credit Card
  
  CC Number
  CC Expiry
  
  There is a choice between invoice or CC payment. 
  In case the user
  selects Invoice payment the CC Number and CC 
  expiry field should
  not get validated and at best not even be 
  displayed. 
  Is there any preferred way to do this in 
  CForms?
  
  thanks for any suggestions.
  
  Jakob Schwendner--Public 
  ImageCreative Strategy  Production for Print, Online  
  Broadcast Media


Re: disabling widgets in CForms

2004-05-18 Thread Jan Hoskens



Just noticed that I forgot the _javascript_. This has 
to be included (in your header, or include it as woody-lib.js):

function woody_checkboxGroup(checkboxGroup, length){
for (var i = 
0; i  length; i++) {
var gr = 
document.getElementById(checkboxGroup + "_items_" + 
i);
if (gr.style.display == 
"none")
{
gr.style.display = "block";
}
else
{
gr.style.display = "none";
}
} 
}


  ----- Original Message - 
  From: 
  Jan Hoskens 
  
  To: [EMAIL PROTECTED] 
  Sent: Tuesday, May 18, 2004 9:02 AM
  Subject: Re: disabling widgets in 
  CForms
  
  A while ago I created an extra template in my 
  woody (cforms) to show/not show a group of widgets if a checkbox is clicked. 
  It may give you something to begin with:
  
  This template goes in your woody/cform stylesheet 
  or create your own stylesheet and let this stylesheet include the other 
  woody/cform stylesheets
  
  !-- wi:group of type 
  checkboxGroup: changes display settings to none resp. block if previous was 
  resp. block or none, thus flipping its display state 
  -- xsl:template 
  match="wi:group[wi:styling/@type='checkboxGroup']" 
   xsl:variable name="value" 
  select="wi:state/wi:*/wi:value"/ !-- 
  copy the "state-widget" attribute for use in for-each 
  -- xsl:variable name="state-widget" 
  select="wi:state/wi:*/@id"/
  
   xsl:variable name="id" 
  select="generate-id()"/ 
  xsl:apply-templates 
  select="wi:label/node()"/xsl:apply-templates 
  select="text()"/ input 
  type="checkbox" name="{$state-widget}" xsl:if test="$value = 
  'true'"xsl:attribute 
  name="checked"true/xsl:attribute/xsl:if/input 
  xsl:if 
  test="wi:items/*//wi:validation-message" 
  span style="color:red; font-weight: 
  bold"#160;!#160;/span 
  /xsl:if
  
   !-- a div for 
  each of the items -- xsl:for-each 
  select="wi:items/wi:*" 
  div id="{$id}_items_{position() - 1}"xsl:if 
  test="not($value = 
  @displayWhen)"xsl:attribute 
  name="style"display:none/xsl:attribute/xsl:if 
  xsl:apply-templates 
  select="."/ 
  /div /xsl:for-each 
  /xsl:template
  
  Use this to show the checkbox 
  (template):
  
  wi:groupwi:styling 
  type="checkboxGroup"/wt:widget-label 
  id="state"/wi:statewt:widget-label 
  id="state"/: wt:widget 
  id="state"//wi:statewi:itemswi:group 
  displayWhen="false"wi:itemsName:wt:widget 
  id="name"//wi:items/wi:group/wi:items/wi:group
  
  definition:
  
  wd:booleanfield 
  id="state"wd:labelDo you want to give your 
  name?/wd:label/wd:booleanfieldwd:field 
  id="name"wd:datatype 
  base="string"//wd:field
  
  This should give you a textbox asking if you want 
  to give your name, if checked a textfield should appear.
  
  Note however, that this is just one way, you may 
  accomplish the same by using _javascript_!
  
  Kind Regards,
  Jan
  
  
- Original Message - 
From: 
Jakob Schwendner 

To: [EMAIL PROTECTED] 
Sent: Tuesday, May 18, 2004 8:39 
AM
Subject: disabling widgets in 
CForms

Hi,

Is there a way to disable groups of widgets in 
CForms?

My application:

Payment:
(x)Invoice
( )Credit Card

CC Number
CC Expiry

There is a choice between invoice or CC 
payment. In case the user
selects Invoice payment the CC Number and CC 
expiry field should
not get validated and at best not even be 
displayed. 
Is there any preferred way to do this in 
CForms?

thanks for any suggestions.

Jakob Schwendner--Public 
ImageCreative Strategy  Production for Print, Online  
Broadcast Media


Cforms/woody group

2004-05-18 Thread Jan Hoskens
Hi,

I'm using cocoon 2.1.4 release.

When using a wi:group/ with woody(cforms) I want to have a label
wi:widget-label id=... For some reason, the label isn't shown, if I omit
the group I get all my labels (and fields) but when surrounding it with:

wi:group
...
wi:items
  wi:widget-label id=../
  /wi:items
/wi:group

The labels disappear.

Is this a bug? Is this fixed in cvs head?

Kind regards
Jan


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Getting additional user's information from session object (authentication framework problem)

2004-05-17 Thread Jan Hoskens



I'm using the authentication framework too, but to 
get something from the session, I use session-fw:

xmlns:xsp-session-fw=http://apache.org/xsp/session-fw/1.0

xsp:logic
String roleFrag = xsp-session-fw:getxml as="string" 
context="authentication" path="/authentication/role"/;
DocumentFragment nameFragment = (DocumentFragment)xsp-session-fw:getxml 
as="object" context="authentication" path="/authentication/data/name"/;

Stringname = new String();
for(int i = 0; ilt; 
nameFragment.getChildNodes().getLength(); i++){
 
nameString.append(nameFragment.getChildNodes().item(i).getNodeValue()); 

} 
/xsp:logic

You can find it at the wiki's: http://wiki.cocoondev.org/Wiki.jsp?page=XspSessionFw

Iuse  .. as="object" .. in the 
second variable because when I started using this, the .. as="string"  
only returned the first text node although the real text in an element may be 
split up in different text nodes. That's also why I have that for loop to append 
each text node to the string to obtain the full text. It's possible that this 
has been changed in the cvs head as I did mail it on this list and there was 
some response by the developer(s) of that logicsheet.

Kind Regards, 
Jan

  - Original Message - 
  From: 
  Mariusz 
  Wojcik 
  To: [EMAIL PROTECTED] 
  Sent: Sunday, May 16, 2004 7:53 PM
  Subject: Getting additional user's 
  information from session object (authentication framework problem)
  
  Hi 
  I'd like tokeep in sessionsome 
  additional information about users. My sunrise-user.xml file looks like 
  this:
  
  *sunrise_user.xml 
  **
  authenticationusersusernamecocoon/namepasswordcocoon/passwordrolecocoon/roledatanamehello/nameage12/age/data/user/users/authentication**
  
  I have no problem with getting ID, and role 
  content, but when I use session transformer to get name or ageI get this 
  result:
  
   session transformer result 
  *
  authenticationIDcocoon/IDrolecocoon/roledatausercocoon/user/datatypecocoon.authentication/typemediahtml/media/authenticationapplication
  *
  As you can see my data/data 
  elements, hasn't got name and age children... why 
  ?
  
  This is part ofmy_session_view.xsp 
  file:
  
  ***my_session_view.xsp 
  ***
  session:getxml context="authentication" 
  path="/"/session:getxml context="authentication" 
  path="/authentication/data/name"/
  
  
  
  At the sitemap's level I have tried to do it in 
  this way (but every time I get nothing). My pipeline is 
  auth-protect:
  
   sitemap 
  *
  map:transform 
  src="" parameter 
  name="user" 
  value="{/authentication/data/name}"//map:transform
  
  
  What I'm doing wrong ? How can I getaccess 
  to this additional data in xsp file, and in sitemap (I need them in sitemap 
  too :( ) ?
  
  
  greeting 
  mario
  


CForms radiobuttons

2004-05-13 Thread Jan Hoskens
Hi,

I'm coping with the following situation: a mix of radiobuttons and fields,
eg:

* option 1
* option 2 [textbox]
* [textbox]
* option 3 [listbox]

think of something like:

your favourite drink :
* milk
* wine, especially [chardonay] (textbox)
* coffee [with milk|with sugar| with milk and sugar] (listbox)
* [myowncreation] (just textbox, basically the same as second)

I'm not sure yet, but I'm thinking of creating a group-like structure in the
woody stylesheets and surrounding the fields with that group, taking their
id into the value field of the radiobuttons (with prefix radio_ to
identify the couples) and giving the group a unique name. (wel if it's all
possible, that is ;)

Is this the way to go, or is there already something alike in the cforms
core?
Are there other (better?) ways to do this?
Any ideas are welcome:)

Kind Regards,
Jan



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



[CForms][Woody] Calendar FYI

2004-05-05 Thread Jan Hoskens
I don't know if it's already said  done, but I'm working with cocoon
release 2.1.4 and there was a slight problem with the calendar. When using
the calendar under mozilla browsers, it shows at the top of the page, not at
the correct location (as in contrast to IE). I fixed this by simply setting
a px at the posititions in the mattkruse lib popup. Here's what I did to
fix it:

Go to the file mattkruse-lib/PopupWindow.js
Search for the function PopupWindow_showPopup(anchorname)

Look for the code:
 if (this.use_gebi) {
   document.getElementById(this.divName).style.left = this.x;
   document.getElementById(this.divName).style.top = this.y;

And add '+ px ' to the end of these lines. You'll probably want this on
each line where style.left = this.x occurs, but the calendar seems
to agree in the first condition (so I only showed you that one, yes I'm
lazy;-).

so you'll end up with:
 if (this.use_gebi) {
   document.getElementById(this.divName).style.left = this.x + px;
   document.getElementById(this.divName).style.top = this.y+ px;

Now this simple fix will let mozilla know the correct position for the
calendar popup, it just needed that measurement unit (that was easy, wasn't
it?).

I don't know if there's already a fix for this in the cvs head as I'm not
currently working with it, so use it/commit it if you want or let me know if
there's a newer version.

Kind Regards,
Jan


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Using JXTemplates\JXForms at the same time?

2004-04-30 Thread Jan Hoskens
As far as I know, JXTemplates are used to include data. It can do simple
things with passed data. From cocoon, some special objects available such as
request/session etc, and from flowscript, whatever you pass as bizzdata.
Logic is available to handle and format the data.

XSP however lets you program in xml. That's a big difference! You may use
XSP to display given data only, but you can use any java stuff you like by
importing the right packages.

The clue is that, most of the time, you don't want to program directly in
xml but just present data that comes from your flowscript. Any business
stuff (ie programming) should be called from within your flow, preferably by
just calling some objects (no heavy code in flow). Your results will be
passed and thus you only need to present it. Therefore JXTemplates are the
nicest solution as it has every handle you need nicely put in xml, as in
contrast to the more powerful, but mixed java/xml XSP solution.

This is, of course, an own opinion,

Kind Regards,
Jan

- Original Message - 
From: Derek Hohls [EMAIL PROTECTED]
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: Friday, April 30, 2004 1:38 PM
Subject: Re: Using JXTemplates\JXForms at the same time?


 Sorry, yes you will!, and thanks for making sense of this -
 obviously some use cases highlighting why JXTemplate
 is recommended (as opposed to XSP, which I think I
 'grok') will be helpful.  I guess the beauty of Cocoon is
 that it does not force a single path on you; as long as
 we can be clear as to what the pros and cons of the
 path options are, its OK.

 Derek

 PS can JXTemplate do everything XSP can, and then some,
 or is it the other way around?

  [EMAIL PROTECTED] 2004/04/30 01:16:33 PM 
 Derek Hohls wrote:

 Can either Thomas or Ugo why explain why JXTemplate
 is needed for building a form - can this not be done via
 XSP or XSLT?
 
 
 Does it have to be Thomas or Ugo? Will I do? ;-)

 JXTemplate is a 'template' language. As is XSP. So, you could use XSP
 in
 place of JXTemplate. Either of them accesses some in memory objects and

 fills in gaps in a template. But XSLT is a transformation language - it

 therefore can't access those in memory objects. In this case, the in
 memory objects are the form data.

 Generally though, JXTemplate I believe is more recommended, but XSP
 should certainly be able to do it.

 Good enough?

 Regards, Upayavira


 Thanks
 Derek
 
 Oh, and is there an example of the approach you adopt?
 
 
 
 [EMAIL PROTECTED] 2004/04/30 11:10:18 AM 
 
 
 Thomas Kjeldahl Nilsson wrote:
 
 
Question: Can I use some combination of JXForm\JXTemplate for
 
 
 this?
 
 
The problem is that I need JXTemplate for conditionals in
 
 
 building
 
 
the markup and content of the xml\html, but also I'd like to use
JXForms for the forms\interactive content.
 
 
 
 JXForms is dead. Since you are starting a new project, I suggest you
 grab 2.1.5-dev from CVS and start working with Cocoon Forms (which
 was
 called Woody in 2.1.4). This is *THE* only officially supported
 forms
 
 framework in Cocoon. Planned release date for 2.1.5 is around May
 14th.
 
 And yes, you can use it together with JXTemplate. I do it all the
 time.
 
  Ugo
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 
 



 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]


 -- 
 This message has been scanned for viruses and
 dangerous content by MailScanner, and is
 believed to be clean.
 MailScanner thanks transtec Computers for their support.


 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: jpath transformer

2004-04-23 Thread Jan Hoskens



I've not yet heard of a jpath transformer, where 
did you find it? I do know that there's an xsp logicsheet "jpath" that you may 
use, especially for
use with flow. There's another transformer which 
does jpath/jexl stuff, but that's the JXTemplateTransformer.

http://cocoon.apache.org/2.1/userdocs/flow/jpath.html
http://cocoon.apache.org/2.1/userdocs/flow/jxtemplate.html

Kind Regards,
Jan

  - Original Message - 
  From: 
  beyaNet 
  Consultancy 
  To: [EMAIL PROTECTED] 
  Sent: Thursday, April 22, 2004 2:22 
  PM
  Subject: jpath transformer
  Hi,could someone please inform me as to the correct usage 
  of the jpath transformer. Can I use it as I would an xslt transformer and and 
  declare a *.jpath file, which like its xsl counterpart, would handle styling 
  issues?For example, could I do the following:map:match 
  pattern="frame/*/*/*"map:generate 
  type="serverpages" src=""map:parameter 
  name="artistID" 
  value="{3}"//map:generatemap:transform 
  type="jpath" src=""serialize"//map:matchIf 
  so, does anyone have examples of a jpath transformation file I could have a 
  look at? And if you can declare an jpath transformation file, how can I get 
  objects and variables from my flowscript into 
it?Peter


Re: Passing parameters to aggregation parts

2004-04-23 Thread Jan Hoskens



When calling a pipeline, you can't pass parameters (As far as I know).I 
had the same problem a while ago. I then just passed the parameters 
asrequest parameters by 
callingsrc="". Another option is 
to setyour parameters in a session by invoking an action before 
generatinganything.
Though I also think it makes sense touse 
parameters with aggregate parts, maybe even for internal pipelines, but only 
resources seem
to accept parameters.(unless there are changes in 
the cvshead, I'm working with 2.1.4 release)There may have been a 
discussion about this topic on the dev maillist, if you want some more info it's 
worth a look.
Kind Regards,Jan

  - Original Message - 
  From: 
  Carlos Dias 
  To: [EMAIL PROTECTED] 
  Sent: Thursday, April 22, 2004 7:23 
  PM
  Subject: Passing parameters to 
  aggregation parts
  
  Hi,
  In my sitemap a have the following code 
  fragment:
  map:aggregate element="page"
   map:part 
  src="" strip-root="false"/ 
  map:part src="" 
  strip-root="false"  
  map:parameter name="user_id" value="{1}"/

  map:parameter name="app_id" value="{2}"/ 
  /map:part/map:aggregate
  
  When I try to access the "user_id" and "app_id" 
  inside the XSP file the values are null, but I 
  know that the values are not null. I never see an 
  example of passing parameters to the parts
  of an aggregation, but it seems to make 
  sense.
  
  Thanks in advance,
  Carlos Dias


Re: jpath transformer

2004-04-23 Thread Jan Hoskens



Ha, I see, did you read the javadocs? 
It states:
snip
Transformer implementation of the JPath XSP tag 
library. 
/snip

But the jpath transformer doesn't support every tag 
yet.
Anyways you're better off using the xsp 
logicsheet.

I also think you misinterpreted the jpath 
transformer. (what follows is what I think it does!) It doesn't take a template 
file and transform an xml like xslt. It does let you include variables comming 
from a flow. (it does not have a src attribute) In a flow you may pass beans and 
stuff and with jpath you can traverse that bean to show it on a page. Just take 
a look at thedocpage I gave you.

Am I making any sense? Or is my head so fuzzy I 
that I'm running way off.

Kind Regards,
Jan


  - Original Message - 
  From: 
  beyaNet 
  Consultancy 
  To: [EMAIL PROTECTED] 
  Sent: Friday, April 23, 2004 11:11 
  AM
  Subject: Re: jpath transformer
  Jan,the transformer I mentioned is:map:transformer 
  logger="sitemap.transformer.jpath" name="jpath" 
  src=""/PeterOn 
  23 Apr 2004, at 07:14, Jan Hoskens wrote:
  I've not yet heard of a 
jpath transformer, where did you find it? I do know that there's an xsp 
logicsheet "jpath" that you may use, especially 
foruse 
with flow. There's another transformer which does jpath/jexl stuff, but 
that's the JXTemplateTransformer.http://cocoon.apache.org/2.1/userdocs/flow/jpath.htmlhttp://cocoon.apache.org/2.1/userdocs/flow/jxtemplate.htmlKind 
Regards,Jan- 
Original Message -From: 
beyaNet 
Consultancy To: 
[EMAIL PROTECTED] 
Sent: 
Thursday, April 22, 2004 2:22 PMSubject: 
jpath transformerHi,could someone 
please inform me as to the correct usage of the jpath transformer. Can I use 
it as I would an xslt transformer and and declare a *.jpath file, which like 
its xsl counterpart, would handle styling issues?For example, could I do 
the following:map:match 
pattern="frame/*/*/*"map:generate type="serverpages" 
src=""map:parameter name="artistID" 
value="{3}"//map:generatemap:transform 
type="jpath" src=""serialize"//map:matchIf so, 
does anyone have examples of a jpath transformation file I could have a look 
at? And if you can declare an jpath transformation file, how can I get 
objects and variables from my flowscript into 
it?Peter


Re: ProblemspassingparameterstoXSP

2004-04-21 Thread Jan Hoskens
When calling another pipeline, you can't pass parameters (As far as I know).
I had the same problem a while ago. I then just passed the parameters as
request parameters by calling
src=cocoon:/Pipeline/mypage.jsp?firstparam={1}. Another option is to set
your parameters in a session by invoking an action before generating
anything.

Kind Regards,
Jan

- Original Message - 
From: Carlos Dias [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Tuesday, April 20, 2004 6:57 PM
Subject: Re: Problems passing parameters to XSP


 I already try it without the cocoon:/ protocol and works OK.
 The problem is that my generic pipeline for xsp doesn't support the
passing
 of parameters.
 In a previews email (with the same subject) I post my generic pipeline
 if you could give a look at that I will appreciate!

 CDias

 - Original Message -
 From: Hubert Trzewik [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Sent: Tuesday, April 20, 2004 6:06 PM
 Subject: Re: Problems passing parameters to XSP


  I just copied your code into my XSP page for testing, and it works..
  You sure, you have all the xsp:page things correct?
 
  ?xml version=1.0 encoding=UTF-16?
 
  xsp:page
language=java
xmlns:xsp=http://apache.org/xsp;
xmlns:util=http://apache.org/xsp/util/2.0;
  
 
  CustomContent
xsp:logic
  String app_id = util:get-sitemap-parameter name=app_id/;
  String user_id = util:get-sitemap-parameter name=user_id/;
  val1xsp:exprapp_id/xsp:expr/val1
 val2xsp:expruser_id/xsp:expr/val2
/xsp:logic
  /CustomContent
 
  /xsp:page
 
  --
  Are you sure, you have default generator type set to serverpages,
  because in your example attribute type is missing..
 
  Maybe you will try without cocoon:/ as a source of XSP at first..
 
  My sitemap fragment:
 
  map:match pattern=internal/test/*-*
map:generate type=serverpages src=serverpages/test.xsp
  map:parameter name=user_id value={1}/
  map:parameter name=app_id value={2}/
/map:generate
map:serialize type=xml/
  /map:match
 
 
   Hubert,
   Sorry, but that's wrong... you can call xsp:expr inside of a
 xsp:logic
   block.
   You can see this kind of things in all cocoon documentation
  You were right.. it works with xsp:expr inside xsp:logic block..
 
  
   CDias
   - Original Message -
   From: Hubert Trzewik [EMAIL PROTECTED]
   To: [EMAIL PROTECTED]
   Sent: Tuesday, April 20, 2004 4:53 PM
   Subject: Re: Problems passing parameters to XSP
  
  
   Hi,
  
   XSP:EXPR should be outside of XSP:LOGIC block..
  
   try:
  
   select
 xsp:logic
  String app_id = util:get-sitemap-parameter name=app_id/;
  String user_id = util:get-sitemap-parameter name=user_id/;
 /xsp:logic
   END OF XSP:LOGIC BLOCK MOVED HERE
  
  val1xsp:exprapp_id/xsp:expr/val1
  val2xsp:expruser_id/xsp:expr/val2
   /select
  
Hi,
I know that this is a very well documented subject, but I try it,
and
doesn't work.
   
My pipeline is:
   map:match pattern=test-*-*
map:generate src=cocoon:/select_bookmark_list.xsp
strip-root=false
 map:parameter name=user_id value={1}/
 map:parameter name=app_id value={2}/
/map:generate
map:serialize type=xml/
   /map:match
   
My xsp file is:
 select
  xsp:logic
   String app_id = util:get-sitemap-parameter name=app_id/;
   String user_id = util:get-sitemap-parameter name=user_id/;
   val1xsp:exprapp_id/xsp:expr/val1
   val2xsp:expruser_id/xsp:expr/val2
  /xsp:logic
 /select
   
The xsp can't pull the parameters. The result is an empty string. I
already try to use the parameters.getParameter(paramname)
but the problem is the same. Can anybody tell me what's wrong
here?!
   
Thanks,
Carlos Dias
   
  
  
   -
   To unsubscribe, e-mail: [EMAIL PROTECTED]
   For additional commands, e-mail: [EMAIL PROTECTED]
  
  
   -
   To unsubscribe, e-mail: [EMAIL PROTECTED]
   For additional commands, e-mail: [EMAIL PROTECTED]
  
  
 
 
  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]


 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: sitemap problem

2004-04-21 Thread Jan Hoskens
I'm using flow and I have the same configuration except for your
map:flow-interpreters tag. Try omitting that tag, maybe that helps.

Kind Regards,
Jan

- Original Message - 
From: Vlad Ali [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Tuesday, April 20, 2004 9:07 PM
Subject: sitemap problem


 hi

 i have error from cocoon:
 org.apache.avalon.framework.configuration.ConfigurationException: No
languages defined!

 in my sitemap i write :

 map:flow-interpreters default=javascript/

 map:flow language=javascript
   map:script src=flow/form_test.js/
 /map:flow

 and in cocoon.xconf i have

 component-instance

class=org.apache.cocoon.components.flow.javascript.fom.FOM_JavaScriptInterp
reter
 name=javascript
   load-on-

startupresource://org/apache/cocoon/components/flow/javascript/fom/fom_syst
em.js/load-
 on-startup
   reload-scriptstrue/reload-scripts
   check-time4000/check-time
   !--  debuggerenabled/debugger --  !-- JavaScript Debugger
support --
 /component-instance


 why i getting error?


 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: redirect problem with flowscript : No pipeline matched request: safe_user_area

2004-04-21 Thread Jan Hoskens



As found on http://cocoon.apache.org/2.1/userdocs/flow/api.html

To send: 
cocoon.sendPage("mypipeline", {} );

I think the function expects a biz data (bean) 
to be delivered (thus two parameters, not one), so just give 
{}.

To redirect: 
cocoon.redirectTo("mypipeline");

Kind Regards,
Jan

  - Original Message - 
  From: 
  beyaNet 
  Consultancy 
  To: [EMAIL PROTECTED] 
  Sent: Wednesday, April 21, 2004 2:31 
  AM
  Subject: redirect problem with flowscript 
  : No pipeline matched request: safe_user_area
  Hi,i have a flowscript funtion which does the 
  following:var user = null;importClass(Packages.test.User);var 
  newUser = new User();var msg = "";function 
  login() {while (user == null) {cocoon.sendPageAndWait("login.jx", 
  {"msg":msg});try 
  {user = 
  newUser.getUser(cocoon.request.get("username"), 
  cocoon.request.get("password") );break;}catch(e){msg 
  = "The username password combination you 
  entered does not exist. Please 
  retry.";}}cocoon.sendPage("safe_user_area");}So, 
  when a user has been accepted at login redirect them to safe_user_area. I have 
  tried cocoon.redirect(uri) but keep getting an error which says that the 
  redirect function does not exist, when it does! When am I being told that a 
  map pattern which exists, doesn'tmap:match 
  pattern="safe_user_area"map:aggregate 
  element="home"map:part 
  src=""/map:part 
  src=""/map:part 
  src=""/map:part 
  src=""//map:aggregatemap:transform 
  type="xslt" src=""/map:call 
  resource="serialize"/Peter


Re: Sendmail question

2004-04-21 Thread Jan Hoskens
Maybe you should consider another way (non XSP). I have some long-duration
tasks which include email a result to different addresses. I do this by
calling flowscript, setting everything up (configs/parameters) and then
launching a thread. At the end of this thread, I use java mail to send
emails. This way, the browser gets an immediate response (something like:
you're request is being processed), the thread launches and carries out
everything including sending mails. The result is afterwards still available
on a page which shows a directory where the result ends up.

Kind Regards,
Jan

- Original Message - 
From: Philippe Guillard [EMAIL PROTECTED]
To: users cocoon [EMAIL PROTECTED]
Sent: Wednesday, April 21, 2004 1:50 PM
Subject: Sendmail question


 Hi all,

 Question1:
 I'm using Sendmail logicsheet, works good exept serverpage generator
 takes 5/10 seconds for it. I don't have hosting and mail is sent from
 [EMAIL PROTECTED] like the samples from my Linux. I'd like to
 hear from people who have this in real environment with configured mail
 server.

 Question2:
 I plan to send sometimes hundreds of mail in a XSP Action launched by
 scheduler, i wonder how i should proceed to pool them.

 Best Regards,

 Phil



 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



  1   2   >