RE: Invoking Cocoon actions via JavaScript

2002-09-18 Thread Per Kreipke

> >Another thought:
> >
> >var action_xxx = eval("document.formName.cocoon-action-xxx");
> >
> 
> Won't something like 
> 
> document.formName['cocoon-action-xxx'] work? :-?

That's right. 

document.anycollectionname["objectname"] should work.

document.all, document.forms, 


-
Please check that your question  has not already been answered in the
FAQ before posting. 

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




RE: PHP

2002-09-12 Thread Per Kreipke

I thought it was in there already though it requires a little work to get it
running:

http://xml.apache.org/cocoon/userdocs/generators/php-generator.html

-Original Message-
Hi
Has anyone build PHP generator ? I've never build Cocoon from source and I'm
kind of scared to do that? Is there anyway I can incorporate PHP generator
in cocoon.jar without building it from source? Also are there any sample for
PHP in Cocoon
Sushil


-
Please check that your question  has not already been answered in the
FAQ before posting. 

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




RE: XSP bug: can get generate() to skip elements using java 'if's

2002-09-09 Thread Per Kreipke

Note: in xsp.xsl, the topmost non-xsp element is handled specially but this
error still occurs if you nest like this:


  
if (...) {
  
  }
  else
  {

...

}

  


The culprit is the . If I comment it out, the error doesn't
happen.

Per


> The following XSP snippet will cause an ArrayIndexOutOfBoundsException in
> Cocoon 2.0.3 because the start of the outer element is never
> emitted to the
> SAX stream.
>
> XSP Snippet:
>
>
> 
>
>  
>   
> if (!request.isUserInRole("root"))
> {
>   Not authorized
> }
> else
> {
>   
> 
> 
>
>   
> }
>   
>  
>
> 
>
>
>
>
> Generated Java code:
>
> if (!request.isUserInRole("root"))
> {
>   xspAttr.addAttribute("", "security-error", "security-error",
> "CDATA", "Not
> authorized");
> }
> else
> {
>   this.contentHandler.startElement("", "page", "page", xspAttr);
>   xspAttr.clear();
>
> }
>
> this.contentHandler.endElement("", "page", "page");
>
>
>
> E.g. the start code for  isn't emitted. And I can't find a
> workaround:
> neither emitting characters or another element inside the 'if' makes it
> emit.
>
> Per
>
>
> -
> Please check that your question  has not already been answered in the
> FAQ before posting. 
>
> To unsubscribe, e-mail: <[EMAIL PROTECTED]>
> For additional commands, e-mail:   <[EMAIL PROTECTED]>
>
>


-
Please check that your question  has not already been answered in the
FAQ before posting. 

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




XSP bug: can get generate() to skip elements using java 'if's

2002-09-09 Thread Per Kreipke

The following XSP snippet will cause an ArrayIndexOutOfBoundsException in
Cocoon 2.0.3 because the start of the outer element is never emitted to the
SAX stream.

XSP Snippet:




 
  
if (!request.isUserInRole("root"))
{
  Not authorized
}
else
{
  


  
}
  
 






Generated Java code:

if (!request.isUserInRole("root"))
{
  xspAttr.addAttribute("", "security-error", "security-error", "CDATA", "Not
authorized");
}
else
{
  this.contentHandler.startElement("", "page", "page", xspAttr);
  xspAttr.clear();

}

this.contentHandler.endElement("", "page", "page");



E.g. the start code for  isn't emitted. And I can't find a workaround:
neither emitting characters or another element inside the 'if' makes it
emit.

Per


-
Please check that your question  has not already been answered in the
FAQ before posting. 

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




RE: [Q] Form posting sitemap pattern...

2002-09-04 Thread Per Kreipke

Lajos,

Wow. Very concise, thanks.

So, the tricks I missed were:

- nesting the validate action and the insert action, I had put them together
in an action-set instead. I actually knew better but that was dumb.

- [here's the kicker] the validator action gets called both when posting
_and_ when simply displaying the form.

- actions without any sub components to execute are pure code and can
actually 'populate' your pipeline (e.g. the way the validator stores stuff).
That's a _very_ handy trick. Will come in handy for setting request
params/globals.

Will try immediately,

Per

> Hi Per -
>
> If you were using the formval logicsheet and the FormValidatorAction,
> you'd have something like this:
>
>   
>
>value="context://newbook-def.xml"/>
> 
>
> 
> value="context://newbook-def.xml"/>
>  
> 
>
>
>
>
>   
>
> Here, the "newbook" pipeline is the action for your form and "books" is
> the pipeline for the display of books (not shown). When the "newbook"
> pipeline executes, the action "validator" tries to validate the posted
> form. If nothing was posted, or if the validation failed, execution
> drops outside that  block to the "addbook.xsp" page, which
> contains your form and which uses the formval logicsheet to access info
> on what failed during validation. If validation succeeds, then
> everything inside that  block gets executed which, as you can
> see, uses the DatabaseAddAction to insert the row in your database and
> then redirects the user to the "books" pipeline. Key to the
> DatabaseAddAction, FormValidatorAction and formval logicsheet is the
> descriptor file "newbook-def.xml". All these concepts are discussed in
> the Cocoon documentation.
>
> The main gotcha here is the formval logicsheet is a bit clumsy to use,
> as you have to make sure you not only display validation errors to the
> user, but repopulate valid fields with the data the user already entered.
>
> Regards,
>
> Lajos
>
> galatea.com
> Cocoon training, consulting & support
>
>
> Per Kreipke wrote:
>
> > I can't quite figure out what the right way is to use actions to handle
> > posting when there is an originating page, the form itself, a
> validator and
> > an action.
> >
> > Scenario:
> >
> > - The user has a page which displays a collection of items of some sort
> > (books).
> >   + page: books.xyz
> >
> > - clicking 'new' on the books page brings up a form for entering a new
> > book's details
> >   + page: newbook.xyz
> >
> > - posting the book's details should validate the book's details
> (must have a
> > title)
> >   + validator action: ValidateBook.java
> >
> > - Code adds the book to the book repository
> >   + add action: AddBook.java
> >
> >
> > Flows:
> >
> > books.xyz -> [new book] -> newbook.xyz -> [post]
> > -> ValidateBook -> [ok] -> AddBook -> books.xyz
> >
> >
> > books.xyz -> [new book] -> newbook.xyz -> [post]
> > -> ValidateBook -> [fail] -> newbook.xyz
> >
> >
> > Details:
> >
> > - to implement both flows above, I can't figure out what:
> >   + the 'action' target of the POST should be: books.xyz again,
> newbook.xyz?
> >   + what matcher to put the validate and add actions on
> >
> > Any help would be appreciated. A pointer to or an actual sample sitemap
> > snippet would be great.
> >
> > FYI, I'm not using XMLForm and I'm using 2.0.3
> >
> > Per
> >
> >
> > -
> > Please check that your question  has not already been answered in the
> > FAQ before posting. <http://xml.apache.org/cocoon/faq/index.html>
> >
> > To unsubscribe, e-mail: <[EMAIL PROTECTED]>
> > For additional commands, e-mail:   <[EMAIL PROTECTED]>
> >
> >
>
>
> --
>
>
>
>
> -
> Please check that your question  has not already been answered in the
> FAQ before posting. <http://xml.apache.org/cocoon/faq/index.html>
>
> To unsubscribe, e-mail: <[EMAIL PROTECTED]>
> For additional commands, e-mail:   <[EMAIL PROTECTED]>
>
>


-
Please check that your question  has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faq/index.html>

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




[Q] Form posting sitemap pattern...

2002-09-04 Thread Per Kreipke

I can't quite figure out what the right way is to use actions to handle
posting when there is an originating page, the form itself, a validator and
an action.

Scenario:

- The user has a page which displays a collection of items of some sort
(books).
  + page: books.xyz

- clicking 'new' on the books page brings up a form for entering a new
book's details
  + page: newbook.xyz

- posting the book's details should validate the book's details (must have a
title)
  + validator action: ValidateBook.java

- Code adds the book to the book repository
  + add action: AddBook.java


Flows:

books.xyz -> [new book] -> newbook.xyz -> [post]
-> ValidateBook -> [ok] -> AddBook -> books.xyz


books.xyz -> [new book] -> newbook.xyz -> [post]
-> ValidateBook -> [fail] -> newbook.xyz


Details:

- to implement both flows above, I can't figure out what:
  + the 'action' target of the POST should be: books.xyz again, newbook.xyz?
  + what matcher to put the validate and add actions on

Any help would be appreciated. A pointer to or an actual sample sitemap
snippet would be great.

FYI, I'm not using XMLForm and I'm using 2.0.3

Per


-
Please check that your question  has not already been answered in the
FAQ before posting. 

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




RE: sunRise For Dummies?

2002-08-31 Thread Per Kreipke

Mark,

I also bought the book and found it informative but! it only mentions the
sun* components in passing during the last chapter. It doesn't cover how to
use them. So, don't expect answers to your portal or sunrise auth questions
there.

However, searching this list throught the MARC archives helps, as does the
page Mark mentions.

Archives:
http://marc.theaimsgroup.com

Per

> Check out the following link:
>
> http://radio.weblogs.com/0103021/stories/2002/02/28/usingTheSunris
> eComponents.html
>
> And if you don't have Matthew's and Carsten's book
> "Cocoon: Buildinf XML Applications", get it!
>
> In addition to being a great technical book, it's also
> a fun read.
>
> /mde/
>
> Just my two cents
>
> __
> Do You Yahoo!?
> Yahoo! Finance - Get real-time stock quotes
> http://finance.yahoo.com
>
> -
> Please check that your question  has not already been answered in the
> FAQ before posting. 
>
> To unsubscribe, e-mail: <[EMAIL PROTECTED]>
> For additional commands, e-mail:   <[EMAIL PROTECTED]>
>
>


-
Please check that your question  has not already been answered in the
FAQ before posting. 

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




RE: CInclude bug???

2002-08-26 Thread Per Kreipke

> Incorrect.  This is a bug and the @select does work in Cocoon 2.1.x.

Ah.

> I have a fix on my local drive but I haven't submitted it yet.  Will do
> so very soon.

While you're at it, how about updating:

http://xml.apache.org/cocoon/userdocs/transformers/cinclude-transformer.html

on which I based my answer.

Per

> >>to make the long story short:
> >>
> >>the output has the whole xml file after the section of
> >>the xml file i want to include.
> >>
> >>i.e
> >>
> >> >>src="../../commons/contents/ATTRIBUTES.xml"
> >>select="data/AGE/*" />
> >>
> >>outputs:
> >>
> >>
> >> data   
> >>
> >>   
> >>   text 
> >>   data 
> >>
> >>
> >>Am i doin something wrong or is it a bug??
> >>
> >>
> >
> >Not a bug. CInclude does not support selecting just a portion of your XML
> >model (and neither does XInclude).
> >
> >E.g. your @select above does nothing.
> >
> >To do what you want to do, just add a XSLT tranformer _after_
> your CInclude,
> >then in that XSLT logic either:
> >
> >- match the elements you want with identity templates,
> >
> >- or, create a generic identity template and use empty matchers for the
> >elements you _don't_ want.
> >
> >XSLT makes a clean, generic filtering language.
> >
> >Note: Cocoon's FilterTransformer does something similar but in a very
> >restricted way (it basically only is used for paging through
> data models).
> >
> >Per
> >
> >
> >-
> >Please check that your question  has not already been answered in the
> >FAQ before posting. 
> >
> >To unsubscribe, e-mail: <[EMAIL PROTECTED]>
> >For additional commands, e-mail:   <[EMAIL PROTECTED]>
> >
> >
> >
> >
>
>
>
>
> -
> Please check that your question  has not already been answered in the
> FAQ before posting. 
>
> To unsubscribe, e-mail: <[EMAIL PROTECTED]>
> For additional commands, e-mail:   <[EMAIL PROTECTED]>
>
>


-
Please check that your question  has not already been answered in the
FAQ before posting. 

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




RE: CInclude bug???

2002-08-25 Thread Per Kreipke

Apurva,

I need more sleep: XInclude _does_ in fact allow you to subselect using
XPointer syntax.

See
http://xml.apache.org/cocoon/userdocs/transformers/xinclude-transformer.html

for details. Requires sitemap change.

> -Original Message-
> From: Per Kreipke [mailto:[EMAIL PROTECTED]]
> Sent: Sunday, August 25, 2002 11:41 PM
> To: [EMAIL PROTECTED]
> Subject: RE: CInclude bug???
>
>
> Apurva,
>
> > to make the long story short:
> >
> > the output has the whole xml file after the section of
> > the xml file i want to include.
> >
> > i.e
> >
> >  > src="../../commons/contents/ATTRIBUTES.xml"
> > select="data/AGE/*" />
> >
> > outputs:
> >
> > 
> >  data   
> >
> >
> >text 
> >data 
> > 
> >
> > Am i doin something wrong or is it a bug??
>
> Not a bug. CInclude does not support selecting just a portion of your XML
> model (and neither does XInclude).
>
> E.g. your @select above does nothing.
>
> To do what you want to do, just add a XSLT tranformer _after_
> your CInclude,
> then in that XSLT logic either:
>
> - match the elements you want with identity templates,
>
> - or, create a generic identity template and use empty matchers for the
> elements you _don't_ want.
>
> XSLT makes a clean, generic filtering language.
>
> Note: Cocoon's FilterTransformer does something similar but in a very
> restricted way (it basically only is used for paging through data models).
>
> Per
>
>
> -
> Please check that your question  has not already been answered in the
> FAQ before posting. <http://xml.apache.org/cocoon/faq/index.html>
>
> To unsubscribe, e-mail: <[EMAIL PROTECTED]>
> For additional commands, e-mail:   <[EMAIL PROTECTED]>
>
>


-
Please check that your question  has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faq/index.html>

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




RE: CInclude bug???

2002-08-25 Thread Per Kreipke

Apurva,

> to make the long story short:
>
> the output has the whole xml file after the section of
> the xml file i want to include.
>
> i.e
>
>  src="../../commons/contents/ATTRIBUTES.xml"
> select="data/AGE/*" />
>
> outputs:
>
> 
>  data   
>
>
>text 
>data 
> 
>
> Am i doin something wrong or is it a bug??

Not a bug. CInclude does not support selecting just a portion of your XML
model (and neither does XInclude).

E.g. your @select above does nothing.

To do what you want to do, just add a XSLT tranformer _after_ your CInclude,
then in that XSLT logic either:

- match the elements you want with identity templates,

- or, create a generic identity template and use empty matchers for the
elements you _don't_ want.

XSLT makes a clean, generic filtering language.

Note: Cocoon's FilterTransformer does something similar but in a very
restricted way (it basically only is used for paging through data models).

Per


-
Please check that your question  has not already been answered in the
FAQ before posting. 

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




RE: problem on preceding Axes

2002-08-21 Thread Per Kreipke

FYI, I've had no problem with them.

Also, this sounds like an XSL question. You might get better help on another
list

... but if you want help, post a code snippet.

Per

P.s. agree with you, cudos to the developers!

> Hi guys,
>
> I am actually using cocoon 2.0.3 tomcat 4.0.4 and W2000,
> proceding and proceding axes don't work correctly.
>
>
> Does anybody had the same problem?
> Do I have to change some configuration of the xml parser?
>
> Tanx in advance for you answer.
>
> and especially thanks to the cocoon community that works so hard
> and makes a
> great job providing us a very good tool.
>
> bye
>
> pino
>
>
> -
> Please check that your question  has not already been answered in the
> FAQ before posting. 
>
> To unsubscribe, e-mail: <[EMAIL PROTECTED]>
> For additional commands, e-mail:   <[EMAIL PROTECTED]>
>
>


-
Please check that your question  has not already been answered in the
FAQ before posting. 

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




RE: [Q] Classes not found...

2002-08-21 Thread Per Kreipke

Vadim replied:

>I've put a bunch of JARs in Tomcat 4's lib directory (as per the TC4 config
>how-to) but the classes aren't visible in my XSP page, Pizza keeps
>complaining.
>

Compiler needs to know were the JARs are located. All existing Java
compilers can work with *files* only.


>The reason they are there and not in C2's space is because the JARs are
>shared with other web apps.
>
>Does XSP have its own class loader that's fouling this up?
>

It has nothing to do with classloading. It's compiler classpath issue.
To solve it, specify all these JARs in extra-classpath.

extra-classpath will be appended to Java compiler's classpath, and Pizza
then will find these files.


>Any comments/ideas?
>

Here is an idea: write java compiler which does not depend on files but
can compile using classes loaded by classloader.

Vadim


-
Please check that your question  has not already been answered in the
FAQ before posting. 

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




[Q] Classes not found...

2002-08-21 Thread Per Kreipke

I've put a bunch of JARs in Tomcat 4's lib directory (as per the TC4 config
how-to) but the classes aren't visible in my XSP page, Pizza keeps
complaining.

The reason they are there and not in C2's space is because the JARs are
shared with other web apps.

Does XSP have its own class loader that's fouling this up?

Any comments/ideas?

Per


-
Please check that your question  has not already been answered in the
FAQ before posting. 

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




RE: Download Server - directory access denied

2002-08-20 Thread Per Kreipke

> It seems that absolute URLs are not a problem. The following examples
> give
> me an error page:
>
> URI:
>
> /../filename.jpg
> /download/../../filename.jpg
> /images/../../filename.jpg
>
> error page:
>
> HTTP Status 404 - /filename.jpg
>
> 
> 
>
> type Status report
>
> message /filename.jpg
>
> description The requested resource (/filename.jpg) is not available.
>
>
> 
> 
>
> Apache Tomcat/4.1.3
>
>
> Working URI:
>
> /download/../filename.jpg

Doesn't that simply mean that /filename.jpg isn't there? What if it was in
your root directory, outside of your webapp's space? Would it return?

What if you try /etc/passwd?

Or on Windows NT/2000, something in /winnt?

Per


-
Please check that your question  has not already been answered in the
FAQ before posting. 

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




RE: Download Server - directory access denied

2002-08-20 Thread Per Kreipke

> Wow! Great comment. I changed the URI to:
>
>   /download?file=../../../conf/web.xml
>
> and actually accessed the file. Is this a concern to anyone else?
>
> Thanks Per.

Sure.

It might be a concern to others, but doing it in the resolver would probably
break just about everything in C2: the resolver is used by the sitemap to
get relative URLs for every pipeline, matcher etc. And viewing the source
using the samples might use relative paths.

I suggest that you subclass the default reader (which is what you're using I
believe) and remove all string occurrences of '../' or '/..' or somesuch
before resolving. Then let the rest of the reader's code execute, thereby
returning 'invalid resource' errors when appropriate.

Note: You might want to remove the 'download' prefix on the  in
your sitemap and see if all of a sudden absolute URLs work too. Ouch if they
do.

Per


-
Please check that your question  has not already been answered in the
FAQ before posting. 

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




RE: Download Server - directory access denied

2002-08-20 Thread Per Kreipke

Note: not sure if this will happen, but passing the file name as a request,
you may want to make sure that it doesn't contain a sequence of '../' such
that the user is walking up your tree to get at some other resource outside
'download'. I'm not sure if the resolver prevents this automatically or not.

Per

> -Original Message-
> From: Matthew Hailstone [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, August 20, 2002 11:21 AM
> To: [EMAIL PROTECTED]
> Subject: RE: Download Server - directory access denied
>
>
> I see. So the  element, notwithstanding it is inside the
>  element, is actually still inside the
>  element's scope. From your comment, I suppose I
> should have known this because it follows the XSLT specification.
>
> Thanks again! That is very helpful to know.
>
> Matthew
>
> > >
> > >  
> > >  
> > >  
> > >
> >
> > 1> Entered match scope
> >
> > >  
> > >  
> > >
> >
> > 2> Entered act "request" scope
> >
> > >  
> > >---  section of change
> > ---
> > >  
> > >
> >
> > 3> Entered act "resource-exists" scope
> >
> > >  
> > >---  section of change
> > ---
> > >
> >
> > 3> About to exit act "resource-exists" scope
> >
> > >  
> > >
> >
> > 2> Again at act "request" scope
> >
> > >  
> > >  
> > >  
> > >
> >
> > 2> About to exit act "request" scope
> >
> > >  
> > >
> >
> > 1> About to exit match scope
> >
> > >  
> > >  
> > >
> > See at scopes of variables. Parameters are not separate entities but
> > belong to the parent tag (same as in XSLT).
> >
> > Vadim
> >
> >
>
> -
> Please check that your question  has not already been answered in the
> FAQ before posting. 
>
> To unsubscribe, e-mail: <[EMAIL PROTECTED]>
> For additional commands, e-mail:   <[EMAIL PROTECTED]>
>
>


-
Please check that your question  has not already been answered in the
FAQ before posting. 

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




RE: Using views

2002-08-20 Thread Per Kreipke

> Hi!
>
> I'm about to start using views. I'm trying to do something that I'm not
> sure can be done.
>
> Can I use  in views?

As far as I know, you can't tell cocoon to aggregate views. You can define a
view to reference a part of an aggregate.

> What for? Well, this way I would be able to add my side-menu XML
> elements after the content generation, but before the final
> transformation. I'm looking for a way to add content to *all* of my
> pages before their final transformation to HTML, without having to use
>  in every pipeline.

You could do this a couple of ways:

- in your content use CInclude to include a snippet from elsewhere.
Something like:

  
  ...

  ...


  ...
  


- or, even more general, just add another XSLT transform before the final
one:

  ...
   
   
   
  ...

In the XSLT, you'll need to copy all input elements to the output and graft
in your menu.

Per


-
Please check that your question  has not already been answered in the
FAQ before posting. 

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




RE: Packaging a cocoon web application

2002-08-19 Thread Per Kreipke

> >>There are provisions in build.xml to add parts into sitemap and
> >>cocoon.xconf files. Just see any of the *.xpipe, *.xconf, *.xmap files
> >>throughout the src/ directory. Add your own files, they will be picked
> >>up by build process.
> >>
> >>
> >
> >I've noticed those and wondered where/how the right place to put my code
> >would be to allow it to be merged in when building cocoon.war.
> >
> >E.g. where in the src tree (or out of it preferably) should I
> put my stuff
> >so that I can update with CVS, delete cocoon, start over, etc?
> >
>
> src/java or src/scratchpad. Then you can update from CVS, delete
> build/*, and re-compile without a problem.

You can mingle CVS repositories like that in the same space? E.g. our
directories reside among the Cocoon directories? Still seems awkward.

Per


-
Please check that your question  has not already been answered in the
FAQ before posting. 

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




RE: [Q] SourceWritingTransfomer + WriteableSources via POST?

2002-08-19 Thread Per Kreipke

Stephan,

I looked at the WebDAVSource*.java code.

- it's based on the org.apache.webdav.* packages. Presumably that's Slide's
client library? If not, which JAR please?

- I read the email about htpclient. That's too bad. I can just see the soap
now (the one on TV not the XML one) - "When Open Source goes bad: API
compliance and their spouses".


Thanks for the pointer. While it's definitely interesting for other stuff,
it's not what I was originally asking about: a WriteableSource that can do
POST. I'll keep looking.

Per

> > > > I can't quite find in the current source tree any other
> writeable source
> > > > other than the SlideSource or the FileSource.
> > > >
> > > > Is there already a WriteableSource that can POST to a HTTP resource?
> > > >
> > > > Or is there another built-in way to have Frontier POST data
> from some
> > > > sitemap component (e.g. XSP, generator, transformer, action)?
> > > >
> > > > Thanks for any pointers,
> > > >
> > > > Per
> > >
> > > Do you mean PUT instead of POST? Then yes, I have wrote a WebDAVSource
> > > some time ago, and removed because of some incompatibilities with
> > > the httpclient lib.
> >
> > - Do those incompats still exist? Would I just be banging my
> head needlessly
> > :-)?
> >
> > - It would presumably show me how to POST if I wanted to. I'm
> interested in
> > saving data by POSTing an XML snippet in text/xml form to a backend DB.
> >
> >
> > > I got never the time to test it, if you are interested:
> > >
> > > cvs -Q update -p -r1.2
> > > src/scratchpad/src/org/apache/cocoon/components/source/impl/WebDAV
> > > Source.java
> > >
> > > cvs -Q update -p -r1.1
> > > src/scratchpad/src/org/apache/cocoon/components/source/impl/WebDAV
> > > SourceFactory.java
> >
> > I'll definitely look if I'm not going to be stymied by the
> httpclient lib.
>
>
> You should take the httpclient from the Slide project. Reasons why Slide
> have his own copy of the lib can be found at
>
> http://www.mail-archive.com/slide-user%40jakarta.apache.org/msg02584.html
>
> Stephan.


-
Please check that your question  has not already been answered in the
FAQ before posting. 

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




RE: [Q] SourceWritingTransfomer + WriteableSources via POST?

2002-08-19 Thread Per Kreipke

> > I can't quite find in the current source tree any other writeable source
> > other than the SlideSource or the FileSource.
> >
> > Is there already a WriteableSource that can POST to a HTTP resource?
> >
> > Or is there another built-in way to have Frontier POST data from some
> > sitemap component (e.g. XSP, generator, transformer, action)?
> >
> > Thanks for any pointers,
> >
> > Per
>
> Do you mean PUT instead of POST? Then yes, I have wrote a WebDAVSource
> some time ago, and removed because of some incompatibilities with
> the httpclient lib.

- Do those incompats still exist? Would I just be banging my head needlessly
:-)?

- It would presumably show me how to POST if I wanted to. I'm interested in
saving data by POSTing an XML snippet in text/xml form to a backend DB.


> I got never the time to test it, if you are interested:
>
> cvs -Q update -p -r1.2
> src/scratchpad/src/org/apache/cocoon/components/source/impl/WebDAV
> Source.java
>
> cvs -Q update -p -r1.1
> src/scratchpad/src/org/apache/cocoon/components/source/impl/WebDAV
> SourceFactory.java

I'll definitely look if I'm not going to be stymied by the httpclient lib.

Per


-
Please check that your question  has not already been answered in the
FAQ before posting. 

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




[Q] SourceWritingTransfomer + WriteableSources via POST?

2002-08-19 Thread Per Kreipke

I can't quite find in the current source tree any other writeable source
other than the SlideSource or the FileSource.

Is there already a WriteableSource that can POST to a HTTP resource?

Or is there another built-in way to have Frontier POST data from some
sitemap component (e.g. XSP, generator, transformer, action)?

Thanks for any pointers,

Per


-
Please check that your question  has not already been answered in the
FAQ before posting. 

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




RE: Packaging a cocoon web application

2002-08-19 Thread Per Kreipke

Vadim

> There are provisions in build.xml to add parts into sitemap and
> cocoon.xconf files. Just see any of the *.xpipe, *.xconf, *.xmap files
> throughout the src/ directory. Add your own files, they will be picked
> up by build process.

I've noticed those and wondered where/how the right place to put my code
would be to allow it to be merged in when building cocoon.war.

E.g. where in the src tree (or out of it preferably) should I put my stuff
so that I can update with CVS, delete cocoon, start over, etc?

Your experience and suggestions appreciated,

Per


-
Please check that your question  has not already been answered in the
FAQ before posting. 

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




RE: XSP logicsheet for the ServletContext object

2002-08-16 Thread Per Kreipke

I just noticed that class XSPUtil (the implementing class for util taglib)
has the following function, which also shows how to get context info in
Java:

public static Object getContextAttribute(Map objectModel, String name)
{
Context context = ObjectModelHelper.getContext(objectModel);
return context.getAttribute(name);
}

In XSP (assuming XSPUtil class is already imported):



// objectModel is already a local var available to your XSP
String attr = XSPUtil.getContextAttribute(objectModel, "foo");

// If you want this for anything else
Context context = ObjectModelHelper.getContext(objectModel);


context.getAttribute("bar")



Per


-
Please check that your question  has not already been answered in the
FAQ before posting. 

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




RE: [Q] SunRise roles?

2002-08-16 Thread Per Kreipke

> > Ah, philosophy :-)
> >
> Yupp!
>
> Ok, I think we reached a state where it's difficult to say who is right
> and who is wrong.
>
> Personally, I think that the meaning of 'groups' and roles is mixed
> somewhere in the servlet spec. *My* understanding is that a person
> can be in several groups at a time but has at once time only exactly
> one role. This understanding might be right or wrong, doesn't matter,
> at least these are only words.
>
>
> >
> > 2. In your example, I think you're indicating that some roles
> are 'larger'
> > than others and that the larger ones contain the smaller ones. E.g. the
> > rights of the following roles from broadest to narrowest.
>
> No, I didn't want to indicate that. Roles may be disjunctive (I hope this
> is the right word).

Ok. That sounds like my second example.

> > > If you need this list of possibilities, I would suggest to not use the
> > > 'role' entry, but a 'roles' entry. The authentication framework
> > > is flexible
> > > and can handle this automatically.
> >
> > Right,  was something I mentioned earlier but it already does so?
> > That's news to me :-) How does it do so automatically? Where do I
> > start/look?
> >
> When a user is in the process of being authenticated, the framework calls
> the authentication pipeline of the handler. For a successful
> authentication,
> this pipeline returns the authentication XML. You can simple extend
> this XML, so that it has an additional  entry parallel to .
> So, you can return
> 
>
> 
>a,b,c
> 

Ok. I was putting it in the  section (the docs made me think that was
required, I'm glad it's not). And the  will still be accessible
through the getxml() calls/tags.

> > > So, the authentication framework fits nicely into the servlet
> > > role handling.
> >
> > Uh, I think I missed a leap somewhere :-)
> >
> > Can you please give me a pointer on what you mean? Are you talking about
> > returning  inside  and then selecting it when
> needed? Are you
> > saying that it can implement Realm based security? You lost me, sorry.
> >
> So, in your authentication resource, you have to fill the  entry,
> this can be done by calling the servlet api and getting the roles
> information
> from there.
> For testing against a role you have to write your own code/component.

Right, that I got.

In summary, to use the portal, I would need to stick to one role at a time
(e.g. in ). I simply extend the notion of  myself.

Thanks for your time,

Per


-
Please check that your question  has not already been answered in the
FAQ before posting. 

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




RE: [Q] SunRise roles?

2002-08-16 Thread Per Kreipke

Any comments on previous message?

Per

-
Please check that your question  has not already been answered in the
FAQ before posting. 

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




RE: [Q] SunRise roles?

2002-08-15 Thread Per Kreipke

Carsten,

Ah, philosophy :-)

> > I think that the restriction you describe (one role per user)
> > means that the
> > SunRise authentication is potentially mis-using the word 'role'. You're
> > using it to denote a profile name, nothing more. It'll never
> > really replace
> > (or integrate with) roles in the Servlet or permissions sense if it's
> > restricted to one role at a time.
> >
> No, I don't agree with your definition of 'role' - take acting as an
> example. A role in acting is one single role and not a bunch of possible
> roles an actor plays. - If an actor plays several persons he plays several
> roles but not a role with a comma separated list.

Just to provide some light hearted counter point, some of which relates to
Cocoon security:

- actors can play more than one role. Alec Guinness plays 8 of them in "Kind
Hearts and Coronets"

http://us.imdb.com/Title?0041546

- within a play, roles can play more than one role. Take any play within a
play where the characters play other characters.

- actors often direct the things they're in. Kenneth Branaugh, Kelsey
Grammer, etc.

> If you login into a system (and this is not related to Cocoon but to any
> system), you get a specific role with this login - you are either manager,
> administrator, user or guest - you are not at the same time manager and
> guest.
> That doesn't make sense.
>
> You can be either manager and guest, theoretically - but at one
> time you are
> only one of them. And you can switch your role.

Two comments:

1. you're saying that users can only inhabit one role within a set of
related roles. Let's say that's true.

The Servlet spec, however, clearly allows more than a single set of roles.

Examples:
level: [manager,contributor,guest]
status: [employee,consultant]
company: [client,internal]
shift: [morning,afternoon,night]

To denote the full set of roles that I inhabit, it would have to be similar
to:

{manager,employee,internal,afternoon}

E.g. multiple roles. Which the Servlet spec supports.


2. In your example, I think you're indicating that some roles are 'larger'
than others and that the larger ones contain the smaller ones. E.g. the
rights of the following roles from broadest to narrowest:

super > manager > contributor > reader > registered-guest > unregistered

Even if that wasn't your point, let me just say that (though perhaps not
ideal), there are two ways to model that set:

- each broader role includes the permissions of the next narrower one, and
adds to that set. Think nested circles in a Ven diagram, the typical way
people think about it. This way, as you mention, users have only need one
role at a time, and promotion means changing that role.

- or, each role is only the difference from any other set and the total set
of permissions is the union of all the roles you want. Think adjacent
circles in a Ven diagram. This way, users get a list of all the roles they
inhabit. In fact, they _are_ "at the same time manager and guest."

I agree, this is in fact _not_ such a good idea, that's really what
permissions are for, not roles, _but_ my point is that the Servlet spec
doesn't say how to do authentication and authorization, it just provides a
general mechanism, which SunRise is not currently expressive enough for.


> If you need this list of possibilities, I would suggest to not use the
> 'role' entry, but a 'roles' entry. The authentication framework
> is flexible
> and can handle this automatically.

Right,  was something I mentioned earlier but it already does so?
That's news to me :-) How does it do so automatically? Where do I
start/look?


> So, the authentication framework fits nicely into the servlet
> role handling.

Uh, I think I missed a leap somewhere :-)

Can you please give me a pointer on what you mean? Are you talking about
returning  inside  and then selecting it when needed? Are you
saying that it can implement Realm based security? You lost me, sorry.

Per


-
Please check that your question  has not already been answered in the
FAQ before posting. 

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




RE: [Q] SunRise roles?

2002-08-14 Thread Per Kreipke

> > > > Aside: if I return a list of comma separated roles could the
> > > > portal still be
> > > > made to work?
> > > >
> > > Yes, it should still work.
> >
> > The portal knows enough to tokenize the role string?
> >
> Rethinking about this, it's a little bit difficult.
> The portal uses the role name to build the profile, which means
> a profile for the role is used in this process.
> So the portal needs one role to build the profile.

Right. Sounds like it's a 'profile selector', not a true role (e.g. not a
group, or set of permissions, etc).

I can also understand the need for a simplification where each user gets
only one profile but couldn't one do something where the user's profile is
the union of all profiles from all their roles?

> > > > - I'm not clear why the SessionContextImpl doesn't implement
> > some of the
> > > > functions like getNodeList(String path).
> > > >
> > > Reason is simple: Lazy developer. Send a patch :)
> >
> >
> > It's not inherent in the fact that the 'sunRise' context spans the
> > authentication, request, response and application XML? There's no
> > problem in
> > your mind with returning NodeLists from across them?
> >
> Hmm, no - the Nodes itself have to be copied before, so the application
> can not accidentally change the nodes.

Ah, interesting, I had actually noticed that they were 'live' and was
thinking of using that fact. Clearly a no-no :-)

You mean: nodes have to be cloned to be returned in the list.

> > If not, I just might send that patch ;-)
>
> Great!

Time permitting ;-)

> > > > Thoughts for doing multiple roles:
> > > >
> > > > + comma separated list of roles inside  (yes, sounds
> > flaky doesn't
> > > > it).
> > > >
> > > It's not a nice solution, but should work.
> >
> > And you mentioned above that the portal will accept comma
> delimited roles
> > within  already (e.g. it isn't doing an equals() but some kind of
> > tokenization?
> >
> Ok, it will not work.
>
> > > > + add to the  section
> > > >
> > > Yes, this is the solution others use (afaik).
> >
> > Really? Others have done this? Anyone posted anything?
>
> I know customers of us which did this.

Ah.

> > > > Aside: what contexts (besides 'sunRise') is the
> > SessionContextImpl used
> > > > instead of SimpleSessionContext?
> > > >
> > > What do you mean? Why the SessionContextImpl is used instead of the
> > > SimpleSessionContext?
> >
> > Well, that is the question really. But I'm also curious if I use
> >  when I'm hitting SimpleSessionContext and when
> > I'm hitting
> > SessionContextImpl.
> >
> In fact, you don't have to distinguish - it makes no difference
> when using the context.

Sure, I understood that, the reason I'm asking is to determine whether or
not I need to do the NodeList work discussed above. E.g. if I don't need
anything from context ABC and XYZ and those are the only two that use
SessionContextImpl (which doesn't return NodeLists) then I may not bother
doing the work discussed above.

> One note about multiple roles:
>
> The authentication framework was designed with the idea that a user
> has only one role at a time. She is either admin, user or guest - but
> not all at the same time. Of course a user can have different roles
> over time.
> But a login specifies exactly one role for the duration of the session.
>
> If you look at a portal for example, this makes sense. You have a portal
> configuration for an admin and one for a usual user. At some point
> of time you have to decide what portal to display for the user - you
> can't display both or somehow combine them.
>
> So the "authentication/role" information should be seen as
> "current role" - it does not cover the possible roles the user could
> also have.
>
> If someone has a good idea on how to combine these efforts, let's do it.

I think the portal's needs are a separate question from correctly
implementing roles so that SunRise is actually a complete
login/authentication package.

If multiple roles aren't possible, for example, I'll have to use container
managed security to get multiple roles and then I won't have all the great
session and config management stuff you did.

I think that both needs can be met by:

- extending roles to allow multiple roles (either through comma separated
list of roles in current  schema or through a different
schema [e.g. ...])

- extending the  schema to identify which role determines
the profile to use in the portal. E.g.
foobar... That should be
a separate concern of just the portal code.

- lastly, integrating with container managed security would be a real nice
to have.

Comments?

Per


-
Please check that your question  has not already been answered in the
FAQ before posting. 

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




RE: [Q] SunRise roles?

2002-08-14 Thread Per Kreipke

Carsten,

I'm going to rush this next sentence out because I know that you're done for
the day and then I won't have ideas to work on while you're away :-), then
I'll reply to your previous note.


I think that the restriction you describe (one role per user) means that the
SunRise authentication is potentially mis-using the word 'role'. You're
using it to denote a profile name, nothing more. It'll never really replace
(or integrate with) roles in the Servlet or permissions sense if it's
restricted to one role at a time.



Now on to reply...

Per


-
Please check that your question  has not already been answered in the
FAQ before posting. 

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




RE: [Q] SunRise roles?

2002-08-14 Thread Per Kreipke

Sorry, previous reply was incomplete...

> > Follow up questions:
> >
> > - is there an equivalent call to
> HTTPServletRequest.isUserInRole() against
> > the authentication context?
> >
> No (not yet). From java code you can get the content of
> "/authentication/role"
> and test it against your value. From a pipeline, you have to get the
> role using "session:getxml" and then test it in a stylesheet...For such
> tests, I always wanted to add a "session:testxml"...
>
> > - From what I can tell, the SunRise code doesn't support the notion of
> > multiple roles per user. It makes the SunRise Authentication
> support not a
> > complete replacement for container security.  Perhaps that
> wasn't the goal
> > but it's something people will look for.
> >
> > What's the background for that? Do you think it could be overcome easily
> > (how?)?
> Yes, there are several solutions, as you pointed out below:
>
> >
> > Aside: if I return a list of comma separated roles could the
> > portal still be
> > made to work?
> >
> Yes, it should still work.

The portal knows enough to tokenize the role string?

> > - I'm not clear why the SessionContextImpl doesn't implement some of the
> > functions like getNodeList(String path).
> >
> Reason is simple: Lazy developer. Send a patch :)


It's not inherent in the fact that the 'sunRise' context spans the
authentication, request, response and application XML? There's no problem in
your mind with returning NodeLists from across them?

If not, I just might send that patch ;-)

> > Thoughts for doing multiple roles:
> >
> > + comma separated list of roles inside  (yes, sounds flaky doesn't
> > it).
> >
> It's not a nice solution, but should work.

And you mentioned above that the portal will accept comma delimited roles
within  already (e.g. it isn't doing an equals() but some kind of
tokenization?

> > + add to the  section
> >
> Yes, this is the solution others use (afaik).

Really? Others have done this? Anyone posted anything?

> > 
> >   per
> >   unused
> >   
> > 
> >   manager
> >   ibm
> >   admin
> > 
> >   
> > 
> >
> > But then I immediately ran into trouble trying to iterate over all the
> > nested s inside  since SessionContextImpl doesn't implement
> > some of the xpath functions.
>
> Again, this is only due to a lazy developer - you could implement them.

They're already in SimpleSessionContext, I'll copy that code.

> > Aside: what contexts (besides 'sunRise') is the SessionContextImpl used
> > instead of SimpleSessionContext?
> >
> What do you mean? Why the SessionContextImpl is used instead of the
> SimpleSessionContext?

Well, that is the question really. But I'm also curious if I use
 when I'm hitting SimpleSessionContext and when I'm hitting
SessionContextImpl.

Per


-
Please check that your question  has not already been answered in the
FAQ before posting. 

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




RE: [Q] SunRise roles?

2002-08-13 Thread Per Kreipke

> > Follow up questions:
> >
> > - is there an equivalent call to
> HTTPServletRequest.isUserInRole() against
> > the authentication context?
> >
> No (not yet). From java code you can get the content of
> "/authentication/role"
> and test it against your value. From a pipeline, you have to get the
> role using "session:getxml" and then test it in a stylesheet...For such
> tests, I always wanted to add a "session:testxml"...
>
> > - From what I can tell, the SunRise code doesn't support the notion of
> > multiple roles per user. It makes the SunRise Authentication
> support not a
> > complete replacement for container security.  Perhaps that
> wasn't the goal
> > but it's something people will look for.
> >
> > What's the background for that? Do you think it could be overcome easily
> > (how?)?
> Yes, there are several solutions, as you pointed out below:
>
> >
> > Aside: if I return a list of comma separated roles could the
> > portal still be
> > made to work?
> >
> Yes, it should still work.

The portal kn
>
> > - I'm not clear why the SessionContextImpl doesn't implement some of the
> > functions like getNodeList(String path).
> >
> Reason is simple: Lazy developer. Send a patch :)

It's not inherent in the fact that the 'sunRise' context spans the
authentication, request, response and application XML? There's no problem in
your mind with returning NodeLists from across them?

If not, I just might send that patch ;-)

> > Thoughts for doing multiple roles:
> >
> > + comma separated list of roles inside  (yes, sounds flaky doesn't
> > it).
> >
> It's not a nice solution, but should work.

And you mentioned above that the portal will accept comma delimited roles
within  already (e.g. it isn't doing an equals() but some kind of
tokenization?

> > + add to the  section
> >
> Yes, this is the solution others use (afaik).

Really? Others have done this? Anyone posted anything?

> > 
> >   per
> >   unused
> >   
> > 
> >   manager
> >   ibm
> >   admin
> > 
> >   
> > 
> >
> > But then I immediately ran into trouble trying to iterate over all the
> > nested s inside  since SessionContextImpl doesn't implement
> > some of the xpath functions.
>
> Again, this is only due to a lazy developer - you could implement them.

They're already in SimpleSessionContext, I'll copy that code.

> > Aside: what contexts (besides 'sunRise') is the SessionContextImpl used
> > instead of SimpleSessionContext?
> >
> What do you mean? Why the SessionContextImpl is used instead of the
> SimpleSessionContext?

Well, that is the question really but I'm also curious when I use
 when I'm hitting SimpleSessionContext and when I'm hitting
SessionContextImpl.

Per


-
Please check that your question  has not already been answered in the
FAQ before posting. 

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




[Q] SunRise AuthAction nitpicking...

2002-08-13 Thread Per Kreipke

I see most actions returning empty maps by using either the EMPTY_MAP
constant from the AbstractAction base class or creating their own
unmodifiable map using Collections.

But in AuthAction, the map is returned via:

map = new HashMap();

as does SunRise.createMap()

I'm not a Java expert so I just want to be sure that it's not a memory leak.
I'm sure it gets garbage collected but isn't it cheaper to return a final
static variable (EMPTY_MAP), especially since it happens on every request?

Per


-
Please check that your question  has not already been answered in the
FAQ before posting. 

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




RE: [Q] SunRise roles?

2002-08-13 Thread Per Kreipke

> > I can't figure out how or where the SunRise  part of
> > authentication is
> > used.
> >
> It is used in the (sunSpot) portal framework for generating
> the profile of a user. But apart from that it's not use.

Ok.

> > Can it be used in the AuthAction to limit access by roles?
> >
> You can write your own component for this, but afaik there
> is currently none already available.
>
> > Is there an example of using them someplace?
> >
> Besides the (big) portal code: I think, no.
>
> > When are all the users with a given role queried?
> >
> For a running system: never. Only the user management web
> application where you can add a new user, add roles etc.
> fetches all users for a given role to make them editable.

Ok.

Follow up questions:

- is there an equivalent call to HTTPServletRequest.isUserInRole() against
the authentication context?

- From what I can tell, the SunRise code doesn't support the notion of
multiple roles per user. It makes the SunRise Authentication support not a
complete replacement for container security.  Perhaps that wasn't the goal
but it's something people will look for.

What's the background for that? Do you think it could be overcome easily
(how?)?

Aside: if I return a list of comma separated roles could the portal still be
made to work?

- I'm not clear why the SessionContextImpl doesn't implement some of the
functions like getNodeList(String path).

Thoughts for doing multiple roles:

+ comma separated list of roles inside  (yes, sounds flaky doesn't
it).

+ add to the  section


  per
  unused
  

  manager
  ibm
  admin

  


But then I immediately ran into trouble trying to iterate over all the
nested s inside  since SessionContextImpl doesn't implement
some of the xpath functions.

Aside: what contexts (besides 'sunRise') is the SessionContextImpl used
instead of SimpleSessionContext?

Per


-
Please check that your question  has not already been answered in the
FAQ before posting. 

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




[Q] SunRise roles?

2002-08-12 Thread Per Kreipke

I can't figure out how or where the SunRise  part of authentication is
used.

Can it be used in the AuthAction to limit access by roles?

Is there an example of using them someplace?

When are all the users with a given role queried?

Per


-
Please check that your question  has not already been answered in the
FAQ before posting. 

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




RE: Authenticators call DB (or other) every request?

2002-08-02 Thread Per Kreipke

> > It looks to me like authenticator Actions query the database, dbxml,
> or
> > whatever on every
>
> login
>
> > request.

Ah. You're right below, I see now that the db-authentication is only called
on the login handler

> > - Is that really necessary once the session has been established?
> Probably.
>
> Of course, you want to verify password.

... but I thought this also, which is why I figured the DB was being queried
every time since any DB changes would need to be reflected immediately.

Of course, the 'protected' sample doesn't even use a password but I figure
you're speaking abstractly.

> PS Are you confusing authenticators with validators? See
> protected/sitemap.xmap.

Yes.

As for my other thread, any experience using container managed security with
Cocoon?

Per


-
Please check that your question  has not already been answered in the
FAQ before posting. 

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




Authenticators call DB (or other) every request?

2002-08-01 Thread Per Kreipke

It looks to me like authenticator Actions query the database, dbxml, or
whatever on every request.

- Is that really necessary once the session has been established? Probably.

- How expensive are people finding it to be?

Per


-
Please check that your question  has not already been answered in the
FAQ before posting. 

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




Security: integrating servlet security and Actions...

2002-08-01 Thread Per Kreipke

Is there an example where instead of using the sample authenticators
(DatabaseAuthenticatorAction, etc), Cocoon integrates with servlet security
(e.g. Principals, Roles, etc)?

Per


-
Please check that your question  has not already been answered in the
FAQ before posting. 

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




RE: Error handling in xsp:element...

2002-07-30 Thread Per Kreipke

> > If I do the following in an XSP, the CInclude transformer doesn't
> recognize
> > the cinclude:include element because it has no namespace associated
> with it.
> >
> > 
>
> This is incorrect.

Of course. I thought it might take it from the a parent XSP element but it
doesn't.

> >name="src">strURL
> > 
> >
> >
> > I had to change it to be:
> >
> >  > uri="http://apache.org/cocoon/include/1.0";>
>
> This is also not ok. Should be:
>
>  uri="http://apache.org/cocoon/include/1.0";>

Yep, you're right of course, copy/paste sloppiness.

> >name="src">strURL
> > 
> >
> >
> > In the second example, the condition where I forget to include both
> @prefix
> > and @uri, I get an error. But in the first example, there's no error
> even
> > though cinclude:include is an invalid XML element name without a
> namespace.
> >
> > xsp.xsl would need an extra check.
>
> It will not be efficient to do this, because this check must be made at
> run time, and every time. I guess you have not considered that this is
> possible:
>
>  uri="http://apache.org/cocoon/include/1.0";>
>   "incl" + "ude"
> 
[aside: is  a real thing?]

I see you're point. But I'm willing to let that case go for efficiency as
long as we protect the beginner from naiive mistakes like
name="cinclude:include". Just testing for ':' within @name would help
prevent highlight their error instead of doing nothing at all.

It turns out that the CIncludeTransformer (correctly) skips the element
completely (because the namespace URI isn't applied to the element) but when
you examine the XML, it's not at all apparent, especially if you've added
the cinclude namespace at the top. Instead, the cinclude:include element
continues to appear in the output, no matter what you do to the sitemap,
mistakenly thinking that the transformer isn't being executed.

Per


-
Please check that your question  has not already been answered in the
FAQ before posting. 

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




Error handling in xsp:element...

2002-07-30 Thread Per Kreipke

If I do the following in an XSP, the CInclude transformer doesn't recognize
the cinclude:include element because it has no namespace associated with it.


  strURL



I had to change it to be:

http://apache.org/cocoon/include/1.0";>
  strURL



In the second example, the condition where I forget to include both @prefix
and @uri, I get an error. But in the first example, there's no error even
though cinclude:include is an invalid XML element name without a namespace.

xsp.xsl would need an extra check.

Per


-
Please check that your question  has not already been answered in the
FAQ before posting. 

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




RE: jboss 3 + cocoon 2.0.3

2002-07-30 Thread Per Kreipke

Terry,

> Not sure if you got an answer, but I just got cocoon 2.0.3 + jboss 3.0.0
> + tomcat 4.0.3 running.
>
> I built the standard cocoon webapp (.war) into a .ear file and deployed
> from that.

It sounds like you simply renamed the .war to .ear. Is that what you meant
or did you specify a different build target?

Per


-
Please check that your question  has not already been answered in the
FAQ before posting. 

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




RE: How to switch to another resource if one resource is not available?

2002-07-30 Thread Per Kreipke

> > > That's very interesting. I don't recall ever seeing 'peer' 
> > > elements in the various sample sitemaps, only nested 
> > elements.
> > > 
> > > Does that also mean that one could do the following to selectively
> > read from
> > > an existing file or apply transforms?
> > > 
> > > 
> > >   
> > >   
> > > 
> > > 
> > >   
> > > 
> > >   
> > >   
> > > 
> > >   
> > >   
> > > 
> > > 
> > >   
> > >   
> > > 
> > 
> > Yes.
> > 
> > See lint.xmap
> 
> I don't see it in 2.0.3, is lint.xmap a 2.1 file? Will it work 
> under 2.0.3?

Forget it, I figured it out: you meant lint/sitemap.xmap

Per

-
Please check that your question  has not already been answered in the
FAQ before posting. 

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




RE: How to switch to another resource if one resource is not available?

2002-07-30 Thread Per Kreipke

> > That's very interesting. I don't recall ever seeing 'peer' 
> > elements in the various sample sitemaps, only nested 
> elements.
> > 
> > Does that also mean that one could do the following to selectively
> read from
> > an existing file or apply transforms?
> > 
> > 
> >   
> >   
> > 
> > 
> >   
> > 
> >   
> >   
> > 
> >   
> >   
> > 
> > 
> >   
> >   
> > 
> 
> Yes.
> 
> See lint.xmap

I don't see it in 2.0.3, is lint.xmap a 2.1 file? Will it work under 2.0.3?

Per




-
Please check that your question  has not already been answered in the
FAQ before posting. 

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




RE: How to switch to another resource if one resource is not available?

2002-07-29 Thread Per Kreipke

Vadim,

That's very interesting. I don't recall ever seeing 'peer' 
elements in the various sample sitemaps, only nested  elements.

Does that also mean that one could do the following to selectively read from
an existing file or apply transforms?


  
  


  

  
  

  
  


  
  



Per

> -Original Message-
> From: Vadim Gritsenko [mailto:[EMAIL PROTECTED]]
> Sent: Friday, July 26, 2002 11:47 PM
> To: [EMAIL PROTECTED]
> Subject: RE: How to switch to another resource if one resource is not
> available?
>
>
> > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
> >
> >
> > Finally got it! The {1} vs. {../1} thing was a little tricky to find
> out.
> > BTW: If both (jpg and svg) exist,  though both actions should be
> taken,
> > cocoon seems to prefer the svg. How is the conflict resoveld? Is any
>
> First encountered
>
> >  or  final and the rest ignored?
>
> And execution of the sitemap stops. Yes.
>
>
> Vadim
>
>
> >
> >   
> > 
> > 
> > 
> >   
> >   
> > 
> > 
> >   
> >
> >
> >
> > Joern
>
>
> -
> Please check that your question  has not already been answered in the
> FAQ before posting. 
>
> To unsubscribe, e-mail: <[EMAIL PROTECTED]>
> For additional commands, e-mail:   <[EMAIL PROTECTED]>
>
>


-
Please check that your question  has not already been answered in the
FAQ before posting. 

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




RE: battling with xsp-request

2002-07-29 Thread Per Kreipke

Seth,


Yep, that looked like the problem.

> Is there a guru on the list that can comment on this pattern?

I'm not one of those but I think I can help...

It's not clear from your code why you feel you need to do any initialization
at all, the following will work just fine:




http://apache.org/xsp";
xmlns:xsp-request="http://apache.org/xsp/request/2.0";>

  

  

  



As for your second example,



  
String s_name;

public void init() {
 s_name = 
 }
  

  
init();
  

  
getStoreName()
  



Both of the first two  blocks will appear in the static section
of the page's class and therefor init() perhaps wouldn't have been called.

If you feel like you need to do other initialization or protect access to
the value (your getStoreName() kind of came out of the blue), then I'd think
a better way would be to call init from within that function.

But you shouldn't need to, you can pass default values to
 instead.

Per


-
Please check that your question  has not already been answered in the
FAQ before posting. 

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




RE: InputModules, map:global-parameters

2002-07-23 Thread Per Kreipke

Barbara,

If you meant the section on global params, use Vadim's suggestions.

If you meant the InputModules, I believe they're in the scratchpad in 2.0.3.
I haven't used them or I'd tell you more :-)

Per.

> > From: Barbara Post [mailto:[EMAIL PROTECTED]]
> >
> > Reading this :
> > http://marc.theaimsgroup.com/?l=xml-cocoon-users&m=102499709113669&w=2
> > only with C 2.1
> >
> > What is the workaround for C 2.0.3 since I need to use a release
> version ?
> > :-/
> > Thanks a lot.
>
> Write an action "set-param". Call it first thing:
>
> 
> 
>   
>   ...
>
>   ... rest goes here ...
>
> 
> 
>
> It will be similar to global parameters but not so convenient.
>
>
> Vadim
>
>
> > Barbara
> >
>
>
> -
> Please check that your question  has not already been answered in the
> FAQ before posting. 
>
> To unsubscribe, e-mail: <[EMAIL PROTECTED]>
> For additional commands, e-mail:   <[EMAIL PROTECTED]>
>
>


-
Please check that your question  has not already been answered in the
FAQ before posting. 

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




RE: [Q] XScript...

2002-07-22 Thread Per Kreipke

> > A couple of questions about XScript 'language':
> > 
> > - I can't find much (ok, any) documentation about the history of this
> > component. What was/is it's purpose? I like it but it would be nice to
> > understand its creators' purposes.
> 
> I am no creator, won't comment.
> 
> 
> > - the XScriptObjectInlineXML
> 
> You meant XScriptObjectFromURL

Doh.

> > object doesn't use a Resolver so it only seems
> > to support the http protocol. Is that an oversight or by design?
> 
> Xscript wasn't maintained well; I already fixed several issues with it.
> This is just one more.

Ok.

> > - this seems similar to the abilities of some of the sunShine code.
> 
> Exactly. It overlaps with webapps.session a bit, although it is
> different. Session context can be accessed / manipulated in
> transformation stage only, while xscript works in generation stage, as
> logicsheet.
> 
> 
> > Does SunShine use XScript (not from my searches)?
> 
> No. They are completely independent (atm).
> 
> 
> > Is one or the other the
> > prefered method for manipulating XML snippets?
> 
> I'm thinking on unifying these two approaches; I'd like to make them
> share common variable space. Then, it will be two approaches, and
> difference will be in a stage - generation vs transformation, same
> difference we see in SQLTransformer vs ESQL logicsheet.

I agree. That was going to be my next email, just setting the stage :-)

Per

-
Please check that your question  has not already been answered in the
FAQ before posting. 

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




RE: return nodeset from action?

2002-07-18 Thread Per Kreipke

Peter,

Are you using XSP? Or your own generator?

If so, could you convert the NodeSet to SAX and insert it into the XML
stream? Then from XSL, you can get it back as a NodeSet via a global
.

Per

> >> Is it possible to return a parameter containing a NodeSet from a
> >Cocoon
> >> action?
> >
> > Not via sitemap. Request or session attributes will do.
>
> I was afraid of that.
>
> [snip]
>
> >>
> >> I suspect the problem is passing the parameter back via the sitemap.
> >
> >See http://nagoya.apache.org/bugzilla/show_bug.cgi?id=9916
> >
>
> The bug has my vote (2 of them!)  I think choice #3 is probably the way to
> go (either a or b).  I was somewhat expecting I might have to do
> this.  I'll
> look at seeing if I can pop the necessary data into the request
> and then get
> at it from the XSLT, but if it doesn't I may start to dig through this fix
> myself...


-
Please check that your question  has not already been answered in the
FAQ before posting. 

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




RE: XScript suggestions...

2002-07-18 Thread Per Kreipke

> Here are some thing I thought might make XScript a little more powerful:
>
> - 
>
>   Uses XPath to search the variable. [Does this require a DOM
> representation?]
>
> - 
>   
>   Only builds the content between if the xpath-expression returns true (or
> non-null?).

A mistake, I meant:




The original looks as if I'm testing an expression against the current
output XML, which might also be interesting but I'd imagine difficult to do
with SAX.

What I was trying to get at was testing for a value within a previous
XScript variable.

>
> - 
>  
>  
>  
>  
>   
>
> I mention these because I feel like the XSP taglibs are missing tags that
> allow branching and decisions. If there were some, then people who don't
> know Java might be able to write XSP.
>
> I know that it seems similar to processing that can be done with a
> Transformer step but it seems to me that there is no other way to do
> conditional aggregation without conditionally generating either content,
>  or  statements.
>
> Does this sound useful to anyone else?
>
> Per
>
>
> -
> Please check that your question  has not already been answered in the
> FAQ before posting. 
>
> To unsubscribe, e-mail: <[EMAIL PROTECTED]>
> For additional commands, e-mail:   <[EMAIL PROTECTED]>
>
>


-
Please check that your question  has not already been answered in the
FAQ before posting. 

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




XScript suggestions...

2002-07-18 Thread Per Kreipke


Here are some thing I thought might make XScript a little more powerful:

- 

  Uses XPath to search the variable. [Does this require a DOM
representation?]

- 
  

  Only builds the content between if the xpath-expression returns true (or
non-null?).

- 
 
 
 
 
  

I mention these because I feel like the XSP taglibs are missing tags that
allow branching and decisions. If there were some, then people who don't
know Java might be able to write XSP.

I know that it seems similar to processing that can be done with a
Transformer step but it seems to me that there is no other way to do
conditional aggregation without conditionally generating either content,
 or  statements.

Does this sound useful to anyone else?

Per


-
Please check that your question  has not already been answered in the
FAQ before posting. 

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




[Q] XScript...

2002-07-18 Thread Per Kreipke

A couple of questions about XScript 'language':

- I can't find much (ok, any) documentation about the history of this
component. What was/is it's purpose? I like it but it would be nice to
understand its creators' purposes.

- the XScriptObjectInlineXML object doesn't use a Resolver so it only seems
to support the http protocol. Is that an oversight or by design?

- this seems similar to the abilities of some of the sunShine code. Does
SunShine use XScript (not from my searches)? Is one or the other the
prefered method for manipulating XML snippets?

Per



-
Please check that your question  has not already been answered in the
FAQ before posting. 

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




RE: Conceptual difficulties

2002-07-16 Thread Per Kreipke

In summary:

- how/where would one store an XML snippet as (effectively) a singleton
object for use by all users?

Per


-
Please check that your question  has not already been answered in the
FAQ before posting. 

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




Conceptual difficulties

2002-07-16 Thread Per Kreipke

I feel like a newbie again.

It seems as if with every new page or problem I have a large set of choices
about where I can store information. But where I choose to store something
depends on its lifetime, cachability, granularity, etc.

In a typical servlet model, I understand the difference in lifetime and
scope between contexts (e.g. session, servlet, etc). But in Cocoon I don't.

I'm having trouble figuring out where to keep application vs. user level
settings in a web applicaton using Cocoon without every user getting a copy
of a global setting, etc. I think most of the confusion centers around the
repeated use of Source objects and Resolvers throughout C2.

Note: I've looked through a most of the C2 code (esp. sunshine) and still am
fuzzy on some basics. I've also looked through most of the documentation
both online and in the 2.0.3 build on my machine.

- is the Cocoon Source the same as the Source in Excalibur (doesn't seem so,
yet they both seem to be used)?

- does the resolver automatically cache the source object if possible, and
also watch for changes (it doesn't seem as if any of the Source's are
caching)?

- that is, is there little cost to requesting an XML file repeatedly?

- does it depend on which protocol (cocoon:, resource:, file:, context:,
...)?

- sitemap components have their own config info, and some have external
config info (e.g. ValidatorAction descriptor files). Are the external config
files automatically cached in memory and kept up to date if they change?
How: by simply using Source and a resolver?

- sitemap components are stored in and returned from pools, each potentially
with its own settings, etc. But is the pool a pool of _all_ components
together, separate pools for each component type (e.g. one for generators,
one for matchers), or separate pools for each specific component (e.g. a
pool of CIncludeTransformer's, each with their own default settings)?

- the sun* code expects config information directly in the sitemap instead
of a separate file. When using the compiled sitemap, that's a real nuisance.
Is there a way around that?

- when you access the application context in the sun* code, is it accessing
a single copy for everyone? Where is it actually stored?

- is there an architectural overview I've missed (it's not really covered by
the UML diagrams in the Dev section of the docs)?

Thanks in advance,
Per Kreipke


-
Please check that your question  has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faq/index.html>

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




[Q] How to turn off certain debug messages...

2002-07-15 Thread Per Kreipke

How can I turn off the 'core.store.janitor' logger that emits messages every
few seconds into core.log?

Per


-
Please check that your question  has not already been answered in the
FAQ before posting. 

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




RE: Redirects (again)...

2002-07-09 Thread Per Kreipke

Another thought:

- if I throw an exception in some step of the pipeline, could I configure an
error handler to do a redirect?

Per

> -Original Message-
> From: Per Kreipke [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, July 09, 2002 3:26 PM
> To: [EMAIL PROTECTED]
> Subject: Redirects (again)...
>
>
> As I understand it handling successful form posting in XSP (e.g. without
> actions) can't involve redirecting the user back to the calling page.
>
> E.g. given the following pages:
>
> index.html -> main page, lists all widgets
> form.html -> form to add a new widget
> doPost.xsp -> add the widget
>
> in most cases, you'd like doPost.xsp to redirect back to the
> index.html page
> on _success_ to show the new widget added to the list.
>
> However in Cocoon 2.0.X:
>
> - you can't redirect from an XSP file
>
> - map:redirect-to can't be used after some stage in the pipeline (what is
> that stage?)
>
>
> I understand how to use the form validator to redisplay form.html until
> input is correct but I don't quite know how to handle the post (without an
> Action).
>
>
> Hmm. I just remembered that I can use XSP to create an action. I
> just might
> struggle with that next.
>
> Any other suggestions are welcome,
>
> Per
>
>
> -
> Please check that your question  has not already been answered in the
> FAQ before posting. <http://xml.apache.org/cocoon/faq/index.html>
>
> To unsubscribe, e-mail: <[EMAIL PROTECTED]>
> For additional commands, e-mail:   <[EMAIL PROTECTED]>
>
>


-
Please check that your question  has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faq/index.html>

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




Redirects (again)...

2002-07-09 Thread Per Kreipke

As I understand it handling successful form posting in XSP (e.g. without
actions) can't involve redirecting the user back to the calling page.

E.g. given the following pages:

index.html -> main page, lists all widgets
form.html -> form to add a new widget
doPost.xsp -> add the widget

in most cases, you'd like doPost.xsp to redirect back to the index.html page
on _success_ to show the new widget added to the list.

However in Cocoon 2.0.X:

- you can't redirect from an XSP file

- map:redirect-to can't be used after some stage in the pipeline (what is
that stage?)


I understand how to use the form validator to redisplay form.html until
input is correct but I don't quite know how to handle the post (without an
Action).


Hmm. I just remembered that I can use XSP to create an action. I just might
struggle with that next.

Any other suggestions are welcome,

Per


-
Please check that your question  has not already been answered in the
FAQ before posting. 

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




RE: Howto select EVERY Image ending with *.gif ?

2002-07-09 Thread Per Kreipke

Good point, thanks. I thought he was asking about the gifs in subdirs :-o

Per

> -Original Message-
> From: Joerg Heinicke [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, July 09, 2002 1:08 PM
> To: [EMAIL PROTECTED]
> Subject: Re: Howto select EVERY Image ending with *.gif ?
> 
> 
> It only doesn't match on .gif without any directory. If he doesn't need 
> the filename specifically, the **.gif (he tested already??) is the 
> correct solution.
> 
> Joerg
> 
> Per Kreipke wrote:
> > I think the pattern you want is:
> > 
> > **/*.gif
> > 
> > == 'any .gif in any directory, no matter how deep'
> > 
> > Per
> 
> 
> -
> Please check that your question  has not already been answered in the
> FAQ before posting. <http://xml.apache.org/cocoon/faq/index.html>
> 
> To unsubscribe, e-mail: <[EMAIL PROTECTED]>
> For additional commands, e-mail:   <[EMAIL PROTECTED]>
> 
> 

-
Please check that your question  has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faq/index.html>

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




RE: Howto select EVERY Image ending with *.gif ?

2002-07-09 Thread Per Kreipke

I think the pattern you want is:

**/*.gif

== 'any .gif in any directory, no matter how deep'

Per

-Original Message-
From: Sascha Kulawik [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, July 09, 2002 12:59 PM
To: [EMAIL PROTECTED]
Subject: Howto select EVERY Image ending with *.gif ?


Hello,
Currently I havent resolved my problem to create a map for selecting every
image with *.gif.
The Problem occures on subdirectorys (without sitemap), that arent known by
name.
Example: If I select **.gif or */*.gif only one Directory is selected.
If I have some sitestructures with 2 or 4 Tree depth, I have to select the
images for all possible dephts.
*/*/*/*/*.gif and so on.
Is there a better Wildcard for selecting absolutely everything with the
ending *.gif ?
Thanks,
Sascha


-
Please check that your question  has not already been answered in the
FAQ before posting. 

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




Interpreted sitemap failing in 2.0.3

2002-07-02 Thread Per Kreipke

Can anyone help? Can't get interperted sitemap to run.

Thanks in advance, Per Kreipke

> > > I'm getting an error that a generator for type 'file' doesn't
> exist when
> > > inf fact (as in many examples) it refers to the calling sitemap
> > (the cocoon
> > > default map).
> > >
> > > Do I need to create a stand alone sitemap?
> >
> > Do you still have a map:generators section under you
> > map:components section un
> > your subsitemap? The interpreted sitemap may require an element,
> > even if it
> > is empty.
>
> I do and it is empty :-) THis is the whole section:
>
>
> 
> 
>  
>  
>  
>  
>  
>  
>   src="org.apache.cocoon.matching.SessionAttributeMatcher" />
>  
>
>  
>src="org.onclave.SessionCreateAction">
>us
>   
>  
> 


-
Please check that your question  has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faq/index.html>

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




[Q] How to create a cached XML object in memory...

2002-07-01 Thread Per Kreipke

OVERVIEW:
=
Cocoon uses Configurations from Avalon to abstract keeping common config
information in XML form and easily using and caching it in memory. However,
it doesn't quite serve my purposes (I think) because it actually converts
the XML into its internal format and doesn't allow XPath queries against it.

I'm beginning to suspect that there is no such object in C2 but rather
caching is a component service provided by another component. However, I
wish there already was some example of, say, a URLSource that was being
cached in a simple way that I could retrieve it on demand.

Specifically, each request will cause an XPath query against the XML and
portions of those results will be propagated to the sitemap. E.g. this will
all be handled by an Action.

REQUIREMENTS:
=
I have some information in an XML file which is common to the entire web app
(file is not tiny).

For speed, I was thinking of storing it in a servlet context attribute so
that it was accessible everywhere.

I want to be able to execute XPath queries against it.

Some of the attributes in the file need to be propa

The XML file may be changed and should be reloaded.

Among other things, I will want to stream the XPath results into the SAX
stream (much like ReadDOMTransformer).


SOLUTIONS:
==
1. Use Configurations.
- can be cached, etc.
- doesn't allow XPath queries

2. Use URLSource and add caching (note to self: check if it already is).
- how to add caching to an action (note to self: look at all the actions,
again)

3. ??


Thanks in advance for any pointers, feedback.

Per Kreipke


-
Please check that your question  has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faq/index.html>

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




RE: Is interpreted sitemap in 2.0.3

2002-07-01 Thread Per Kreipke

> On Monday 01 July 2002 03:07 pm, Per Kreipke wrote:
> > A question: does the interpreted sitemap not support mounted
> directories?
> >
> > I'm getting an error that a generator for type 'file' doesn't exist when
> > inf fact (as in many examples) it refers to the calling sitemap
> (the cocoon
> > default map).
> >
> > Do I need to create a stand alone sitemap?
>
> Do you still have a map:generators section under you
> map:components section un
> your subsitemap? The interpreted sitemap may require an element,
> even if it
> is empty.

I do and it is empty :-) THis is the whole section:




 
 
 
 
 
 
  
 

 
  
   us
  
 



-
Please check that your question  has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faq/index.html>

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




RE: Is interpreted sitemap in 2.0.3

2002-07-01 Thread Per Kreipke

Peter,

A question: does the interpreted sitemap not support mounted directories?

I'm getting an error that a generator for type 'file' doesn't exist when inf
fact (as in many examples) it refers to the calling sitemap (the cocoon
default map).

Do I need to create a stand alone sitemap?

Per

> -Original Message-----
> From: Per Kreipke [mailto:[EMAIL PROTECTED]]
> Sent: Monday, July 01, 2002 2:46 PM
> To: [EMAIL PROTECTED]
> Subject: RE: Is interpreted sitemap in 2.0.3
>
>
> > It is also in 2.0.3. If you look towards the bottom of
> > cocoon.xconf, there are
> > comments indicating what you need to do to enable it.
>
> Ah. Thank you. My bad, hadn't thought to look there.
>
> Per
>
>
> -
> Please check that your question  has not already been answered in the
> FAQ before posting. <http://xml.apache.org/cocoon/faq/index.html>
>
> To unsubscribe, e-mail: <[EMAIL PROTECTED]>
> For additional commands, e-mail:   <[EMAIL PROTECTED]>
>
>


-
Please check that your question  has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faq/index.html>

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




RE: Is interpreted sitemap in 2.0.3

2002-07-01 Thread Per Kreipke

> It is also in 2.0.3. If you look towards the bottom of 
> cocoon.xconf, there are 
> comments indicating what you need to do to enable it.

Ah. Thank you. My bad, hadn't thought to look there. 

Per


-
Please check that your question  has not already been answered in the
FAQ before posting. 

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




RE: Sitemap parameters from servlet init (e.g. from outside the sitemap)...

2002-06-24 Thread Per Kreipke

P.s. 

> - in Cocoon, does something already exist to get set sitemap 
> parameters from somewhere 'global' (hopefully from the init params)?

Or perhaps to/from the servlet context?

Per

-
Please check that your question  has not already been answered in the
FAQ before posting. 

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




Sitemap parameters from servlet init (e.g. from outside the sitemap)...

2002-06-24 Thread Per Kreipke

I'm looking a "Best Practice" suggestion.

In our sitemap, we get XML from another machine (e.g. backend server) like
this:

http://dataserver.onclave.com:1234/bin/get?foo"; />

However, developers need to point to their local machine. E.g.:

http://localhost/bin/get?foo"; />


This is just begging for a global sitemap parameter so that it becomes:

http://{server-port}/bin/get?foo"; />


Unfortunately, we're all in the same CVS archive, are changing the sitemap
fairly frequently, and I wouldn't want to have multiple copies of the
sitemap around which we then have to reset by hand every time.


- What is the right way to handle this in a servlet environment? I figure
it's to use the servlet init parameters. Yes?

- in Cocoon, does something already exist to get set sitemap parameters from
somewhere 'global' (hopefully from the init params)?


Thanks, Per


-
Please check that your question  has not already been answered in the
FAQ before posting. 

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




RE: Cocoon 2.0.3 problems...

2002-06-21 Thread Per Kreipke

P.s. Thank you, Vadim et al, for your help!

-
Please check that your question  has not already been answered in the
FAQ before posting. 

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




RE: Cocoon 2.0.3 problems...

2002-06-21 Thread Per Kreipke

Finally :-)

> Forgot to tell you one thing every newbie should do...
>
>DO THIS EVERY TIME YOU GET NEW VERSION OR UPDATE CVS
>
> 1) rm -rf $COCOON_HOME/build/cocoon
> 2) rm -rf $TOMCAT_HOME/work/cocoon

Yep, did those for the Nth time.

Then I decided to get the latest 1.3.X JDK and see if that helped and that
did it. I'm now using:

- JDK 1.3.1_03
- Tomcat 4.0.4 (release)
- Cocoon 2.0.3 (branch)

After install, cleaned the dirs mentioned above, rebuilt Cocoon

build.bat -Dinclude.webapp.libs=yes webapp-local

and the startup errors are gone.

I hope that this could solve other people's problems with bug # 9701 too.

Per


-
Please check that your question  has not already been answered in the
FAQ before posting. 

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




RE: Cocoon 2.0.3 problems...

2002-06-21 Thread Per Kreipke

Vadim,

Thanks.

> java version "1.3.1"
> Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.1-b24)
> Java HotSpot(TM) Client VM (build 1.3.1-b24, mixed mode)
>
>
> Win2k.

Did you have to do anything to make Excalibur pick up the JAXP parser?
E.g. -Dblahblah on the execution line or somesuch?

Here's what I think you've told me so far:

- you've built 2.0.3 as it is in CVS (any options?)
- you're using 2.0.3 with the JARs from CVS
- you're using TC4.0.4 as is
- you're on win2k

We couldn't be more similar :-) I'm stuck and have no idea which direction
to go from here. I'm not really interested in figuring out how to build my
own Excalibur, etc.

Per


-
Please check that your question  has not already been answered in the
FAQ before posting. 

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




RE: Cocoon 2.0.3 problems...

2002-06-21 Thread Per Kreipke

Or, is this a problem with the classloader and JAXP (the same problem that
was fixed in 2.1)? Details:

http://marc.theaimsgroup.com/?l=xml-cocoon-dev&m=102380326124346&w=2

Should this be moved back into 2.0.3?


> Stuart,
>
> > > I'm using 2.0.3 CVS all the time, never seen any NPE of this
> kind. Last
> > > time I ran C203 with T404 was yesterday, and still, no NPE.
> > >
> > >
> > > Vadim
> >
> > This sounds to me like this fault:
> >
> > 
> >
> > I'm fairly convinced there is something platform / VM specific going on
> > with 2.0.3, probably in the Excalibur classes.  What platforms / VMs are
> > you all running on?
> >
> > Stuart.
>
> Could be. I'd seen that note before but wasn't on the same (I'm win2k, JDK
> 1.3.1) platform. I agree that the problem seems to be the
> excalibur classes
> but in my case I'm wondering if it's a JAXP problem. Perhaps I need some
> system properties I don't know about.
>
> Vadim, what JDK are you using when you say that things are
> running for you?
>
> Per
>
>
> -
> Please check that your question  has not already been answered in the
> FAQ before posting. 
>
> To unsubscribe, e-mail: <[EMAIL PROTECTED]>
> For additional commands, e-mail:   <[EMAIL PROTECTED]>
>
>


-
Please check that your question  has not already been answered in the
FAQ before posting. 

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




RE: Cocoon 2.0.3 problems...

2002-06-21 Thread Per Kreipke

Stuart,

> > I'm using 2.0.3 CVS all the time, never seen any NPE of this kind. Last
> > time I ran C203 with T404 was yesterday, and still, no NPE.
> >
> >
> > Vadim
>
> This sounds to me like this fault:
>
>   
>
> I'm fairly convinced there is something platform / VM specific going on
> with 2.0.3, probably in the Excalibur classes.  What platforms / VMs are
> you all running on?
>
> Stuart.

Could be. I'd seen that note before but wasn't on the same (I'm win2k, JDK
1.3.1) platform. I agree that the problem seems to be the excalibur classes
but in my case I'm wondering if it's a JAXP problem. Perhaps I need some
system properties I don't know about.

Vadim, what JDK are you using when you say that things are running for you?

Per


-
Please check that your question  has not already been answered in the
FAQ before posting. 

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




RE: Cocoon 2.0.3 problems...

2002-06-20 Thread Per Kreipke

> 2.0.3 is in bug fix mode.

Ok. And I suppose the nightly builds are only of HEAD :-(

I've just found in the TC4.0.4 log a bunch of error messages from Cocoon's
startup:

Using parser: org.apache.avalon.excalibur.xml.JaxpParser
LogKitLogger: "Attempting to get Handler for:
org.apache.avalon.excalibur.xml.Parser"
Cocoon: Could not load parser, Cocoon object not created
ComponentException: Could not set up Component for role:
org.apache.avalon.excalibur.xml.Parser


That'll make a difference. But I"m not sure why it's failing. I followed the
TC4+C2 install instructions (e.g. I didn't do the stuff listed for TC4.0.3).

Per

-Original Message-
From: Per Kreipke [mailto:[EMAIL PROTECTED]]
Sent: Thursday, June 20, 2002 1:19 PM
To: [EMAIL PROTECTED]
Subject: RE: Cocoon 2.0.3 problems...


Vadim,
Why isn't there a 2.0.3 dist on the web site? I'm stuck: rebuilding C2
hasn't worked, TC4.0.4 hasn't worked. Any other suggestions?
> Are you using the avalon-framework-20020603.jar that came with
> 2.0.3 or are
> you using a later one as others have mentioned in bugzilla reports?
>
> Thanks.


Per


-
Please check that your question  has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faq/index.html>

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




RE: Cocoon 2.0.3 problems...

2002-06-20 Thread Per Kreipke

Vadim,

Why isn't there a 2.0.3 dist on the web site? I'm stuck: rebuilding C2
hasn't worked, TC4.0.4 hasn't worked. Any other suggestions?

> Are you using the avalon-framework-20020603.jar that came with
> 2.0.3 or are
> you using a later one as others have mentioned in bugzilla reports?
>
> Thanks.


Per


-
Please check that your question  has not already been answered in the
FAQ before posting. 

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




RE: Cocoon 2.0.3 problems...

2002-06-20 Thread Per Kreipke

Are you using the avalon-framework-20020603.jar that came with 2.0.3 or are
you using a later one as others have mentioned in bugzilla reports?

Thanks.

> -Original Message-
> From: Vadim Gritsenko [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, June 20, 2002 1:35 PM
> To: [EMAIL PROTECTED]
> Subject: RE: Cocoon 2.0.3 problems...
>
>
> > From: Per Kreipke [mailto:[EMAIL PROTECTED]]
> ...
> > > > > - During startup of C2 I get the following error:
> > > > >
> > > > > "Logging Error: Could not set up Cocoon Logger, will use screen
> > > > > instead"
> > > > >
> > > > > and the stack is:
> > > > > java.lang.NullPointerException
> > > > > at
> > > > > org.apache.avalon.framework.configuration.AbstractConfiguration.
> > > > > getAttribute(AbstractConfigurations.java:494)
> > > > > at
> > > > > org.apache.cocoon.util.log.CocoonTargetFactory.getFormatter(
> > > > > CocoonTarget Factory.java:142)
> > > >
> > > > No idea why you are getting this. Try cleaning up tomcat
> installation,
> > > > or, easier, install new one.
> > > >
> > > > > Thoughts?
> > > >
> > > > Get yourself tomcat 4.0.4.
> > > > :)
> > >
> > > Didn't make a difference, exact same error.
> > >
> > > Note: using JDK1.3.1, checked CLASSPATH, JAVA_HOME, etc.
> >
> > This problem doesn't have anything to do with this bug report does
> it?:
>
> I'm using 2.0.3 CVS all the time, never seen any NPE of this kind. Last
> time I ran C203 with T404 was yesterday, and still, no NPE.
>
>
> Vadim
>
>
> > http://nagoya.apache.org/bugzilla/show_bug.cgi?id=8875
> >
> > avalon-excalibur-20020402.jar doesn't include all data source class
> files
> >
> > --- Additional Comments From [EMAIL PROTECTED]  2002-06-17
> > 02:51 ---
> > File now is named avalon-excalibur-20020612.jar, it has
> J2eeDataSource, but
> > has
> > no InformixDataSource.
>
>
>
> -
> Please check that your question  has not already been answered in the
> FAQ before posting. <http://xml.apache.org/cocoon/faq/index.html>
>
> To unsubscribe, e-mail: <[EMAIL PROTECTED]>
> For additional commands, e-mail:   <[EMAIL PROTECTED]>
>
>


-
Please check that your question  has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faq/index.html>

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




RE: Cocoon 2.0.3 problems...

2002-06-20 Thread Per Kreipke

> I am  getting the exact same error,  running tomcat 3.3a..will try to
upgrade as well.

I'm actually glad to hear it :-) At least I'm not going crazy.

FYI: I've tried TC4.0.4 with C2.0.3 as both a WAR and a local webapp. Not
surprisingly, neither works.

Per


-
Please check that your question  has not already been answered in the
FAQ before posting. 

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




RE: Cocoon 2.0.3 problems...

2002-06-20 Thread Per Kreipke

Vadim,

> > > I'm sorry to do this but I'm about to ask a bunch of very newbie
> > > questions.
> > >
> > >
> > > I got a copy of the 2.0.3 branch last night, built it and had the
> > following
> > > (some ongoing) problems (in Tomcat 4.0.3):
> >
> > rm -rf $TOMCAT_HOME
> >
> > Go and get 4.0.4, less install steps and less problems for you.
>
> Got it.
>
> > > - During startup of C2 I get the following error:
> > >
> > > "Logging Error: Could not set up Cocoon Logger, will use screen
> > instead"
> > >
> > > and the stack is:
> > > java.lang.NullPointerException
> > > at
> > >
> > org.apache.avalon.framework.configuration.AbstractConfiguration.getAttri
> > bute
> > > (AbstractConfigurations.java:494)
> > > at
> > >
> > org.apache.cocoon.util.log.CocoonTargetFactory.getFormatter(CocoonTarget
> > Fact
> > > ory.java:142)
> > > ...
> >
> > No idea why you are getting this. Try cleaning up tomcat installation,
> > or, easier, install new one.
> > ...
> >
> > > Thoughts?
> >
> > Get yourself tomcat 4.0.4.
> > :)
>
> Didn't make a difference, exact same error.
>
> Note: using JDK1.3.1, checked CLASSPATH, JAVA_HOME, etc.

This problem doesn't have anything to do with this bug report does it?:



http://nagoya.apache.org/bugzilla/show_bug.cgi?id=8875

avalon-excalibur-20020402.jar doesn't include all data source class files

--- Additional Comments From [EMAIL PROTECTED]  2002-06-17
02:51 ---
File now is named avalon-excalibur-20020612.jar, it has J2eeDataSource, but
has
no InformixDataSource.



-
Please check that your question  has not already been answered in the
FAQ before posting. 

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




RE: Cocoon 2.0.3 problems...

2002-06-20 Thread Per Kreipke

> > I'm sorry to do this but I'm about to ask a bunch of very newbie
> > questions.
> > 
> > 
> > I got a copy of the 2.0.3 branch last night, built it and had the
> following
> > (some ongoing) problems (in Tomcat 4.0.3):
> 
> rm -rf $TOMCAT_HOME
> 
> Go and get 4.0.4, less install steps and less problems for you.

Got it.

> > - During startup of C2 I get the following error:
> > 
> > "Logging Error: Could not set up Cocoon Logger, will use screen
> instead"
> > 
> > and the stack is:
> > java.lang.NullPointerException
> > at
> >
> org.apache.avalon.framework.configuration.AbstractConfiguration.getAttri
> bute
> > (AbstractConfigurations.java:494)
> > at
> >
> org.apache.cocoon.util.log.CocoonTargetFactory.getFormatter(CocoonTarget
> Fact
> > ory.java:142)
> > ...
> 
> No idea why you are getting this. Try cleaning up tomcat installation,
> or, easier, install new one.
> ...
> 
> > Thoughts?
> 
> Get yourself tomcat 4.0.4.
> :)

Didn't make a difference, exact same error.

Note: using JDK1.3.1, checked CLASSPATH, JAVA_HOME, etc.

Per

-
Please check that your question  has not already been answered in the
FAQ before posting. 

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




RE: Parameters, their stack and cocoon: protocol....

2002-06-18 Thread Per Kreipke

> > > > - If I call another pipeline with an XSP file using the cocoon:
> > > > protocol, it
> > > > doesn't seem as if the caller's sitemap parameters are available
> > > > to any XSP
> > >
> > > _sitemap_ parameters are not available to _any_ XSP. Only parameters
> > > declared _on_ generator/transformer/action/matcher/selector are
> > > available to the component.
> >
> > Fine, you're saying that "sitemap parameters" are different than the
>
> "Sitemap parameters" which are available for substitution as {1},
> {name}, {../other}, etc, *are* different from the s on
> components.
>
> "Sitemap parameters" is a Stack of Maps, and every matcher/action adds
> one more Map to it, and it is removed as soon as matcher/action tag is
> closed. To navigate the stack, you have directory-like {../../1} syntax.

Ok. Got it.

> > map:parameters that are declared on gen/trans/action/match/select
> sections.
> >
> > Then let me ask: are the caller's parameters available to the callee
> below?
> >
> > > > the called pipeline. Is that true? E.g.
> > > >
> > > >   
> > > >   
> > > >  
> > > >  
> > > >   
> > > >
> > > >   
> > > >   
> > > > 
> > >
> > > Does this syntax exist? (too lazy to check source code...)
> >
> > First, should have been {1}.
> > Second, what syntax do you mean?
>
> Sorry, did not get at first.
>
> Parameter declared on the generator will be available *only* to this
> generator. What generator will do with it - it's a different question.

Ah. So they won't be available to the generator in the other matcher. Ok.

> In this particular case, this parameter will be used nowhere.

Well, I was hoping that the config.xsp would have it to do something with.
For example, the sitemap fragment for "config" could be used from different
parts of the sitemap with different values (e.g. different clients, etc).

I see your examples below for another way to do it. Will check them out,
thanks.

> > > > 
> > > >   
> > > >
> > > > in config.xsp, I can't get the value of {client} through
> > > > parameters.getParameter("client").
> >
> > > > - corollary: is the stack of parameters available to XSP file?
> > >
> > > No.
> >
> > Sigh.
>
> "Sitemap parameters", this stack of maps, will not exist once execution
> of sitemap is finished. And execution of XSP will not start before
> execution of sitemap is finished.

Now that's very interesting and important. I did not know that. Will remap
my synapses right away.

> > > > Or is there a
> > > > way of getting the parent of the parameters?
> > >
> > > Sorry, did not get this one.
> >
> > Can I (from XSP) ask for parameters.getParameter("../../client") for
> > example?
>
> No. You can ask only for parameters which are declared on XSP.

Right, got it now.

> Example 1:
>
> 
> 
>   
> 
>   
> 
>   
> 
>
> 
> 
>   
>   
> 
>
>
> Example 2:
>
> 
> 
>   
> 
>   
> 
>
> 
> 
>   
>   
> 

Thanks much. I'd done the same for another pipeline. Not sure why I didn't
think of it for this part :-)

Per


-
Please check that your question  has not already been answered in the
FAQ before posting. 

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




RE: Parameters, their stack and cocoon: protocol....

2002-06-18 Thread Per Kreipke

> > - If I call another pipeline with an XSP file using the cocoon:
> protocol, it
> > doesn't seem as if the caller's sitemap parameters are available to
> any XSP
>
> _sitemap_ parameters are not available to _any_ XSP. Only parameters
> declared _on_ generator/transformer/action/matcher/selector are
> available to the component.

Fine, you're saying that "sitemap parameters" are different than the
map:parameters that are declared on gen/trans/action/match/select sections.

Then let me ask: are the caller's parameters available to the callee below?

> > the called pipeline. Is that true? E.g.
> >
> >   
> >   
> >  
> >  
> >   
> >
> >   
> >   
> > 
>
> Does this syntax exist? (too lazy to check source code...)

First, should have been {1}.
Second, what syntax do you mean?

> > 
> >   
> >
> > in config.xsp, I can't get the value of {client} through
> > parameters.getParameter("client").

> > - corollary: is the stack of parameters available to XSP file?
>
> No.

Sigh.

> > Or is there a
> > way of getting the parent of the parameters?
>
> Sorry, did not get this one.

Can I (from XSP) ask for parameters.getParameter("../../client") for
example?


Per


-
Please check that your question  has not already been answered in the
FAQ before posting. 

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




RE: aggregation with different generators

2002-06-14 Thread Per Kreipke

> I would like to know if it's possible to use self-implemented
> generators inside an aggregation, something like:
>
> 
>src="http://scw_de:[EMAIL PROTECTED]:/BOLServlet
> /ProductService.uploadDocument">
> 

I've wanted to do the same thing but after looking through the sitemap's
code generator (sitemap.xsl), I don't think it's that easy.

However, you can just set up different pipelines or matchers to achieve some
of what you want:


   http://scw_de.uploadDocument"; />
   









Per


-
Please check that your question  has not already been answered in the
FAQ before posting. 

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




RE: What does really do?

2002-06-14 Thread Per Kreipke

Thanks, very good reminder. In documentation under 'Best Practices' or
'Sitemap Patterns' ;-)?

Yes, yes, I know, write it myself. If I only _knew_ anything useful.

Per


-
Please check that your question  has not already been answered in the
FAQ before posting. 

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




RE: What does really do?

2002-06-14 Thread Per Kreipke

> I think the only difference is that handle-errors
> are on per pipeline.
> so for different error handling, you need separate pipelines.

Aha.

> BTW, internal-only=true/false is already a very good reason for having
> several pipelines.

I agree, I've seen in the sitemap.xsl that processing can skip the
serialization step when you hook together pipelines.

For development, however, I can't actually look at internal pipelines if I
turn that feature on. So it's only going on for deployment.

Per


-
Please check that your question  has not already been answered in the
FAQ before posting. 

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




RE: What does really do?

2002-06-14 Thread Per Kreipke

John, Volker,

I was about to ask the same question.

> > Dear colleagues,
> >
> > does anybody know the difference between:
> >
> > 
> >   ...
> >   ...
> > 
> >
> > and
> >
> > 
> >   ...
> > 
> >
> > 
> >   ...
> > 

> http://xml.apache.org/cocoon/faq/faq-sitemap.html#faq-3

I re-read the entire user doc package last night and came across that
section but, with all due respect, that documentation doesn't explain the
benefits of one approach or the other.

Sure, one pipeline can be hidden but what other reasons exist for separating
into multiple pipelines? [Note: Volker's example didn't specify an internal
pipeline]

- for example, in the default sitemap (which is quite large), why are there
so many pipelines? Couldn't it be done with all the matchers inside one
pipeline?

- in there a performance difference?

- in cases where you aggregate XML parts using  and the
cocoon:/ protocol, are serializers skipped perhaps?

Thanks, Per.



-
Please check that your question  has not already been answered in the
FAQ before posting. 

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




map:aggregate fails to continue if any parts fail...

2002-05-31 Thread Per Kreipke

If any map:part fails to load, it seems as if the rest of the map:part's
aren't tried.

However, the parts that have succeeded up to that point are returned.

Is there a way to control that behavior? If not:

- is there a way to achieve what map:aggregate does a different way? Is
CInclude the equivalent? Or perhaps map:select?

- It seems to me that perhaps the proper behavior is for either the entire
pipeline to fail (or be caught by handle-errors) or for the pipeline to
continue processing, leaving out only the broken map:part.

Per


-
Please check that your question has not already been answered in the
FAQ before posting. 

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




RE: Cocoon & XHive

2002-04-18 Thread Per Kreipke

Arje,

There's a thread called on the cocoon-dev list about XIndice (contents
below) and how Rogier was about to test XHive instead:

Subject: (dbxml) Generator vs Source

"Hi,

As I understood the xmldb-generator is to be deprecated in favor of the
xmldb-source. I extended the xmldb-generator to be able to pass a depth
parameter, as happens in the directory-generator. Although this worked
reasonably well, we had a lot of performance issues and therefore are
currently testing another xml database (X-Hive) and this leaves me with the
following questions:
...

Rogier Peters"

and

"I don't really mean Xindice has performance problems.

We are currently working on a system tying together Apache Slide with
Xindice as a backend, and Xindice and Cocoon as a frontend.

To this end we wrote a connector for Slide-Xindice and a custom
XMLDB-generator between Xindice and Cocoon. It's most likely that those
connections are the problem, but basically keeping this system running for
more than a couple of days on a 1Gb machine is not possible, due to memory
leaks.

The site we're running has about 2000 xml content files and right now a
typical page with three level deep dynamic navigation, and starting out with
about 2 lines of xml, will take about 10 secs to render.

Regards,

Rogier Peters"



-
Please check that your question has not already been answered in the
FAQ before posting. 

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




RE: Help with form validation

2001-09-17 Thread Per Kreipke

> Sure, just have the same parameter names. You might even want to set
> your descriptor as default descriptor.

Where would I start to learn about this? Are 'descriptors' a velocity
template thing or a Cocoon2?

Per


-
Please check that your question has not already been answered in the
FAQ before posting. 

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




RE: [C2] Webapp directory for development...

2001-08-24 Thread Per Kreipke

I hate to do this, but I'm still confused. Can anyone help?

7/25/01:

Berin,

> > Should I simply extract the C2 WAR into a new directory, let Tomcat know
> > about it and work there until the app is done, then build it
> into a new WAR
> > and deploy it?
>
>
> This is the prefered development method.  WAR files are for deployment.

Thanks! That makes sense to me. Follow up questions, if I may.

1. I could start with the entire contents of the WAR. But I'm wondering if
the minimum set is:

- sitemap.xmap (and only the necessary portions of it)
- cocoon.xconf (leave as is)
- WEB-INF/web.xml (no changes)
- WEB-INF/lib (leave as is or modify according do documentation on required
libs)
- WEB-INF/db (drop if HSQL isn't needed)

I don't see that anything else is needed to start a new Cocoon based webapp.
It might be nice to have an Ant build target that builds a new directory
(similar to the WAR target) but simpler.


2. Can I create two webapp directories off of one copy of the Cocoon2
servlet? Related question: if I have two copies of all the JARs in the
WEB-INF/lib directory, are separate instances of each used (and is that a
waste of memory)?

Thanks, Per.




-
Please check that your question has not already been answered in the
FAQ before posting. 

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




RE: [C2] Webapp directory for development...

2001-07-25 Thread Per Kreipke

Berin,

> > Should I simply extract the C2 WAR into a new directory, let Tomcat know
> > about it and work there until the app is done, then build it
> into a new WAR
> > and deploy it?
>
>
> This is the prefered development method.  WAR files are for deployment.

Thanks! That makes sense to me. Follow up questions, if I may.

1. I could start with the entire contents of the WAR. But I'm wondering if
the minimum set is:

- sitemap.xmap (and only the necessary portions of it)
- cocoon.xconf (leave as is)
- WEB-INF/web.xml (no changes)
- WEB-INF/lib (leave as is or modify according do documentation on required
libs)
- WEB-INF/db (drop if HSQL isn't needed)

I don't see that anything else is needed to start a new Cocoon based webapp.
It might be nice to have an Ant build target that builds a new directory
(similar to the WAR target) but simpler.


2. Can I create two webapp directories off of one copy of the Cocoon2
servlet? Related question: if I have two copies of all the JARs in the
WEB-INF/lib directory, are separate instances of each used (and is that a
waste of memory)?

Thanks, Per.


-
Please check that your question has not already been answered in the
FAQ before posting. 

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




[C2] Webapp directory for development...

2001-07-25 Thread Per Kreipke

I've downloaded and built the Cocoon2 WAR file and successfully deployed it
in JBoss 2.2.2 + Tomcat 3.2.2.

However, I'm a little confused. I can't figure out where/how to develop a
new Cocoon based webapp. I figure I shouldn't have to compile a new WAR file
every time I add or change a file. Not to mention, the WAR gets undeployed
every time I restart the server, which removes the webapp's files.

Shouldn't I be able to define a new context and point it at the installed
Cocoon servlet? Or does this launch a separate Cocoon2 instance?

Should I simply extract the C2 WAR into a new directory, let Tomcat know
about it and work there until the app is done, then build it into a new WAR
and deploy it?

Or should I be using sub-sitemaps?

Lastly, is this a general enough question I can find the answer somewhere
else (e.g. the servlet 2.2 API docs)?

Thanks for your kind attention, Per.


-
Please check that your question has not already been answered in the
FAQ before posting. 

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