Unable to get 'Cocoon-Libs' attribute from the Manifest

2003-06-10 Thread Collin VanDyck



I'm running Cocoon 2.0.4 on JDK1.4. I have an EAR 
application that includes two WARs. In each of my WARs I include the 
WEB-INF/lib jars and the WEB-INF/Manifest.mf, amongst others. When I 
deploy as a flattened or exploded application, everything works 
perfectly.

However, when I try and deploy the WARs and the EAR 
as a single file, I get an error.log entry:

FATAL_E (2003-06-10) 15:22.10:218 
[access] (Unknown-URI) Unknown-thread/CocoonServlet: Unable to get 'Cocoon-Libs' 
attribute from the Manifest

Now, there is a WEB-INF/Manifest.mf that mirrors 
that in the cocoon.war exactly. I don't understand why then I am getting 
that error, although I would like to :).

I use ant to create the EAR and WARs (note: the 
WARs are contained within the EAR, don't know if that matters to the problem at 
hand). In creating the WAR, the ant task also creates a META-INF directory 
with a Manifest.mf file in it that is empty, except for some "Generated by Ant" 
text at the top.

I sifted through some of the archives, and it seems 
that the solution I saw was to make sure that the Cocoon Manifest.mf was 
included in my Manifest.mf. I believe this is true, so it would be great 
if someone could point me in the right direction :)

thanks,
Collin




Re: passing argument into logicsheet?

2003-03-14 Thread Collin VanDyck
We do this by using an attribute:

logicsheet-ns:template-name param=paramValue/

Does that help?

In your logic sheet, under that template, you would access the value with
@param.


- Original Message -
From: Tsui, Alban [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Wednesday, March 05, 2003 12:12 PM
Subject: passing argument into logicsheet?


 Has anyone got any examples on using logicsheet?

 I would like to write a logicsheet to be used by my xsp but how would you
 pass an argument into a logicsheet?


 Alban


 This message may contain privileged and/or confidential information.  If
you
 have received this e-mail in error or are not the intended recipient, you
 may not use, copy, disseminate or distribute it; do not open any
 attachments, delete it immediately from your system and notify the sender
 promptly by e-mail that you have done so.  Thank you.

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



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



Transforming with XML in database

2003-03-14 Thread Collin VanDyck



We've got a database of XSLT documents, and I'd 
like to be able to selectively apply one of those transforms at some point in my 
pipeline.

We also generate XML from the database by extending 
AbstractSAXSource, and implementing a pseudo-protocol that calls 
it.

I'd like to be able to say something 
like:

match type="request" 
pattern="customTransform"
 map:generate 
src=""/
 map:transform 
src=""/
 
map:serialize
/match

All I really want to do is to grab the XML from the 
database, and shove it in the pipeline at the transform stage. Any tips on 
how to do this would be appreciated. I looked into extending an 
AbstractTransformer, but I don't think that's the way to go, as I'm not 
interested in the individual elements and events... I just want to run it thru 
an arbitrary stylesheet.

thanks!
Collin




amp; not decoding correctly in request parameter

2003-03-07 Thread Collin VanDyck
Hi,

I have an XSLT that generates a request to a cocoon XSP page.  It looks
something like this:


/template?inputName=templateIdamp;saveAttribute=entityId

However, when I get to the XSP page, and I try and figure out what the value
of saveAttribute is, using:

xsp:logic
String saveAttribute = (String)request.getParameter(saveAttribute);
/xsp:logic
saveAttribute is: xsp:exprsaveAttribute/xsp:expr
xsp:logic
/xsp:logic

saveAttribute at this point is always NULL.

Note that any parameter specified right after the '?' is decoded properly.
It seems to be a problem with the amp; as far as I can tell.

I can't understand why this is happening, as I have encoded urls with the
amp; before with no problem.  If someone could shed some light on this
subject, I would be most grateful.

thanks,
Collin



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



Error compiling sitemap

2003-03-04 Thread Collin VanDyck
Hi,

I've got a couple of sitemaps in my application, and I have just noticed
something which I cannot figure out.  I change the sitemap, and deploy to my
app server (JBoss).  When I request a resource that maps to the newly
changed sitemap, Cocoon pauses (compiling) and then comes back with a
compile error, which changes every time.  The strange thing, is that if I
wait 5-10 seconds, it works fine.  It is almost as if it halfway compiles it
the first time.

Has anyone had problems like this?  For all of my sitemaps, I have

check-reload=yes reload-method=synchron

Many thanks,
Collin


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



Re: Error compiling sitemap

2003-03-04 Thread Collin VanDyck
I figured it out... I was working on a new computer using jdk 1.4.1, and the
computer did not have the udpated xalan libraries in the endorsed directory.

http://xml.apache.org/security/install.html

thanks,
Collin


- Original Message -
From: Collin VanDyck [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Tuesday, March 04, 2003 10:00 AM
Subject: Error compiling sitemap


 Hi,

 I've got a couple of sitemaps in my application, and I have just noticed
 something which I cannot figure out.  I change the sitemap, and deploy to
my
 app server (JBoss).  When I request a resource that maps to the newly
 changed sitemap, Cocoon pauses (compiling) and then comes back with a
 compile error, which changes every time.  The strange thing, is that if I
 wait 5-10 seconds, it works fine.  It is almost as if it halfway compiles
it
 the first time.

 Has anyone had problems like this?  For all of my sitemaps, I have

 check-reload=yes reload-method=synchron

 Many thanks,
 Collin


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



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



Undeclared Prefix Issue

2003-02-26 Thread Collin VanDyck
I'm using XSPUtil.includeString() to bring in some external XML into my
source XML tree before I apply my transforms.  This involves me assigning
the XML to a string variable, and then including it as such:

String xmlString = xmlDataValue.getXMLData();
XSPUtil.includeString(xmlString ,this.manager, this.contentHandler);

This works beautifully when I am brining in XML without namespace prefixes.
However, much of the XML that we handle within our system consists of XSL
stylesheets, which of course carry the xsl: ...  prefix.  When I try and
bring that kind of XML into my XSP page as I am building the source tree, I
get the following error:

An error occurredorg.apache.cocoon.ProcessingExceptionUndeclared prefix in
name: xsl:style.org.apache.cocoon.ProcessingException: Exception in
ServerPagesGenerator.generate():
org.apache.avalon.framework.CascadingRuntimeException: Could not include
page-11null Original exception :
org.apache.avalon.framework.CascadingRuntimeException: Could not include
page at
org.apache.cocoon.components.language.markup.xsp.XSPUtil.includeInputSource(
XSPUtil.java:363) at
org.apache.cocoon.components.language.markup.xsp.XSPUtil.includeString(XSPUt
il.java:340) at
org.apache.cocoon.www.tasks.docs.preview.entity.stylesheet_xsp.generate(Z:\j
boss-3.0.4_tomcat-4.1.12\tomcat-4.1.x\work\MainEngine\localhost\admin\cocoon
-files\org/apache/cocoon/www/tasks/docs/preview/entity\stylesheet_xsp.java:4
36)
at
org.apache.cocoon.generation.ServerPagesGenerator.generate(ServerPagesGenera
tor.java:258) at

In my XSP, I have included the xsl namespace with the xsp:page attribute:

xmlns:xsl=http://www.w3.org/1999/XSL/Transform

but that still does not work.  I'd appreciate any input on how to be able to
bring in any valid xml.  I would rather use this XSP solution of using
XSPUtil than creating a sitemap aggregation setup.

Many thanks,
Collin



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



Re: Pass custom parameters into an XSP

2003-02-14 Thread Collin VanDyck



Hi

When I try this out, I get the following 
message:

org.apache.cocoon.www.tasks.docs.workflow.details_xsp should be declared 
abstract; it does not define method generate() in interface 
org.apache.cocoon.generation.Generator

In my first xsp:logic tag, this is the code that 
causes this error:


try {
String workflowIdStr = this.parameters.getParameter("workflowId");
} catch (ParameterException e) {

}

Any ideas?? Thanks again!

Collin

  - Original Message - 
  From: 
  Nathaniel Alfred 
  To: [EMAIL PROTECTED] 
  
  Sent: Wednesday, February 12, 2003 6:50 
  PM
  Subject: RE: Pass custom parameters into 
  an XSP
  
  
  Actually, you don't need to override 
  setup().
  The 
  base class ofthe XSP generated class already does that and provides 
  "protected Parameters parameters;"
  
  You 
  can use directly in xsp:logic
  
  String entityType = 
  this.parameters.getParameter("entityType");
  
  including the other nice features of 
  Parameterssuch asdefaulting and converting to int, boolean, and so 
  on.
  
-----Original Message-From: Collin VanDyck 
[mailto:[EMAIL PROTECTED]]Sent: Donnerstag, 13. Februar 
2003 00:04To: [EMAIL PROTECTED]Cc: David 
CummingsSubject: Re: Pass custom parameters into an 
XSP
Wow. I did not know you could use the XSP to 
override the setup method. That is VERY helpful. Thanks!!



  - Original Message - 
  From: 
  Marco Rolappe 
  
  To: [EMAIL PROTECTED] 
  
  Sent: Wednesday, February 12, 2003 
  5:59 PM
  Subject: AW: Pass custom parameters 
  into an XSP
  
  hi collin,
  
  with XSPs an easier alternative would be to pass your 'parameter' 
  as a request parameter.
  
  then you would:
  
  map:match pattern="edit.xml"
   map:generate type="serverpages" 
  src=""/
   map:serialize type="xml"/
  /map:match
  
  map:match pattern="edit/*"
   map:generate 
  src=""/
   ...
  /map:match
  
  then you can get the request parameter from within your XSP via the 
  request logicsheet (xsp-request:get-parameter) or via embedded 
  logic (request.getParameter ()).
  
  
  the other alternative; passing the parameter as a sitemap 
  parameter:
  
  map:match pattern="edit/*"
   map:generate type="serverpages" 
  src=""
   map:parameter name="entityType" 
  value="{1}"/
   /map:generate
   ...
  /map:match
  
  for this to work you have to embed the appropriate logic into your 
  XSP for retrieving that parameter; as your compiled XSP is a generator in 
  the end you accomplish this by overriding its setup() method and process 
  the parameter(s) there.
  
  just as a hint (take a look at the respective 
  sources/docs):
  
  xsp:page language="java" ...
  xsp:logic !-- must occur before 
  content so that it doesn't become part of content/generate() method 
  --
   public void setup (SourceResolver resolver, Map 
  objectModel, String src, Parameters params) throws ...
   {
   // process parameter(s) 
  here
   ...
  
   super.setup (resolver, objectModel, src, 
  params);
   }
  /xsp:logic
  
  !-- content here --
  /xsp:page
  
  HTH
  
-Ursprüngliche Nachricht-Von: 
[EMAIL PROTECTED] 
[mailto:[EMAIL PROTECTED]]Im 
Auftrag von Collin VanDyckGesendet: Mittwoch, 12. Februar 
2003 22:44An: [EMAIL PROTECTED]Betreff: 
Pass custom parameters into an XSP
Hello,

I am trying to figure out how I can pass in 
custom parameters into an already existing generator such as the 
XSP/serverpages generator. Here's my scenario:

I receive a request for 
/edit/page

Which matches /edit/*

So from this matcher, I have {1} == 
"page".. I want to pass this off to let's say 

/docs/xsp/edit/item.xsp as a 
parameter named "entityType"

So that in the XSP I can access the 
"entityType" variable.

I think I'm missing something obvious. If 
someone could point me into the right direction, I'd really appreciate 
it.

thanks,
Collin


  This message 
  is for the named person's use only. It may contain confidential, proprietary 
  or legally privileged information. No confidentiality or privilege is waived 
  or lost by any mistransmission. If you receive this message in error, please 
  notify the sender urgently and then immediately delete the message and any 
  copies o

Pass custom parameters into an XSP

2003-02-12 Thread Collin VanDyck



Hello,

I am trying to figure out how I can pass in custom 
parameters into an already existing generator such as the XSP/serverpages 
generator. Here's my scenario:

I receive a request for /edit/page

Which matches /edit/*

So from this matcher, I have {1} == "page".. I want 
to pass this off to let's say 

/docs/xsp/edit/item.xsp as a parameter named 
"entityType"

So that in the XSP I can access the "entityType" 
variable.

I think I'm missing something obvious. If someone 
could point me into the right direction, I'd really appreciate it.

thanks,
Collin




Re: Pass custom parameters into an XSP

2003-02-12 Thread Collin VanDyck



Wow. I did not know you could use the XSP to 
override the setup method. That is VERY helpful. Thanks!!



  - Original Message - 
  From: 
  Marco Rolappe 
  
  To: [EMAIL PROTECTED] 
  
  Sent: Wednesday, February 12, 2003 5:59 
  PM
  Subject: AW: Pass custom parameters into 
  an XSP
  
  hi 
  collin,
  
  with 
  XSPs an easier alternative would be to pass your 'parameter' as a request 
  parameter.
  
  then 
  you would:
  
  map:match pattern="edit.xml"
   map:generate type="serverpages" 
  src=""/
   map:serialize type="xml"/
  /map:match
  
  map:match pattern="edit/*"
   map:generate 
  src=""/
   ...
  /map:match
  
  then 
  you can get the request parameter from within your XSP via the request 
  logicsheet (xsp-request:get-parameter) or via embedded logic 
  (request.getParameter ()).
  
  
  the 
  other alternative; passing the parameter as a sitemap 
  parameter:
  
  map:match pattern="edit/*"
   map:generate type="serverpages" 
  src=""
   
  map:parameter name="entityType" 
  value="{1}"/
   /map:generate
   ...
  /map:match
  
  for 
  this to work you have to embed the appropriate logic into your XSP for 
  retrieving that parameter; as your compiled XSP is a generator in the end you 
  accomplish this by overriding its setup() method and process the parameter(s) 
  there.
  
  just 
  as a hint (take a look at the respective sources/docs):
  
  xsp:page language="java" ...
  xsp:logic !-- must occur before content 
  so that it doesn't become part of content/generate() method 
  --
   public void setup (SourceResolver resolver, Map 
  objectModel, String src, Parameters params) throws ...
   {
   
  // process parameter(s) 
  here
   
  ...
  
   
  super.setup (resolver, objectModel, src, 
  params);
   }
  /xsp:logic
  
  !-- content here --
  /xsp:page
  
  HTH
  
-Ursprüngliche Nachricht-Von: 
[EMAIL PROTECTED] 
[mailto:[EMAIL PROTECTED]]Im 
Auftrag von Collin VanDyckGesendet: Mittwoch, 12. Februar 
2003 22:44An: [EMAIL PROTECTED]Betreff: Pass 
custom parameters into an XSP
Hello,

I am trying to figure out how I can pass in 
custom parameters into an already existing generator such as the 
XSP/serverpages generator. Here's my scenario:

I receive a request for /edit/page

Which matches /edit/*

So from this matcher, I have {1} == "page".. I 
want to pass this off to let's say 

/docs/xsp/edit/item.xsp as a parameter 
named "entityType"

So that in the XSP I can access the 
"entityType" variable.

I think I'm missing something obvious. If 
someone could point me into the right direction, I'd really appreciate 
it.

thanks,
Collin




Using getLastModified() to implement browser caching

2003-01-30 Thread Collin VanDyck



Hi,

I've implemented a custom Reader to read file 
entities out of my database. Because these file entities span across 
multiple tables and are managed thru my J2EE container, I'd like to implement 
some browser-side caching to prevent excessive generation on the server 
side.

In my reader, which extends AbstractReader, I 
overrode 

 long 
getLastModified()

Which is being called correctly and does return the 
time correctly (derived upon file creation/modification using 
System.currentTimeMillis()).

However, the behavior I'm seeing is that whenever I 
request a resource that uses this reader to generate the byte data, the reader's 
getLastModified() method is first called, and then the generate() method is 
ALWAYS called.

It is my understanding that the browser would not 
further request the resource if its version was up to date with that of the 
server. I understand that every browser implementation is different, but 
I'm wonderig if I am doing something wrong. I would like for the reader 
not to have its generate() method called when not 
necessary. Is this the correct way to think about this?

I tested with the same result on IE6 and 
Phoenix0.5.

thanks,--
Collin




Re: Parsing multipart form data

2003-01-21 Thread Collin VanDyck
Geoff

Ok, everything is working now.  Strangely, I had in addition to my
cocoon-2.0.4.jar, a rogue cocoon-2.0.2 which I believe was getting deployed
first or with priority by my container.  Argh.  Thanks for your help!
Everything is working perfectly now.

Collin


- Original Message -
From: Geoff Howard [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Monday, January 20, 2003 7:27 PM
Subject: RE: Parsing multipart form data


 
  Hi Geoff,
 
  When I cast directly to FilePartArray I get a ClassCastException, which
I
  thought was due to Cocoon not receiving the init-param correctly.  Is
that
  normal?
 
  Collin

 That sounds right.  Change it back to FilePartArray of course.  So, back
to
 web.xml/cocoon version for the culprit?
 - Since you have three web.xml files (one per webapp), make sure you're
 changing the same one you're testing on (or all three).
 - Make sure you restart after modifying web.xml.
 - Confirm what version of cocoon you're using - how did you get 2.0.4?
What
 is the date of the main cocoon jar?

 Geoff

 
 
  - Original Message -
  From: Geoff Howard [EMAIL PROTECTED]
  To: [EMAIL PROTECTED]
  Sent: Monday, January 20, 2003 5:37 PM
  Subject: RE: Parsing multipart form data
 
 
   There you go - you've cast to FilePartFile - cast to FilePart
  (or directly
   to FilePartArray) and you're set.  We need another example at the Wiki
   (assuming that's where you got the concept from?) showing
FilePartArray.
  
   Should have thought of that first,
   Geoff
  
-Original Message-
From: Collin VanDyck [mailto:[EMAIL PROTECTED]]
Sent: Monday, January 20, 2003 5:22 PM
To: [EMAIL PROTECTED]
Subject: Re: Parsing multipart form data
   
   
Hi Geoff.
   
Here's really the only thing I'm doing with it right now.
   
FilePartFile fpf = (FilePartFile)request.get(file_content);
log.info(received file of name:  + fpf.getFileName());
   
thanks,--
Collin
   
   
   
   
   
   
- Original Message -
From: Geoff Howard [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Monday, January 20, 2003 5:32 PM
Subject: RE: Parsing multipart form data
   
   
 ah, that brings to mind another idea - send a snippet of your
action that
 deals with getting the FilePart...

 Geoff

  -Original Message-
  From: Collin VanDyck [mailto:[EMAIL PROTECTED]]
  Sent: Monday, January 20, 2003 5:02 PM
  To: [EMAIL PROTECTED]
  Subject: Re: Parsing multipart form data
 
 
  Here is my web.xml file. (It's long, so an apology in advance).
I
  hope this
  helps, and I really do appreciate everyone's help in this list.
 
  I commented out overwrite-uploads and set the autosave-uploads
to
  false, but
  I still get a FilePartFile instead of a FilePartArray.
 
  thanks,
  Collin
 
 
 
  ?xml version=1.0 encoding=UTF-8?
  !DOCTYPE web-app PUBLIC -//Sun Microsystems, Inc.//DTD Web
Application
  2.3//EN http://java.sun.com/dtd/web-app_2_3.dtd;
  web-app
  display-nameContentXML web app/display-name
  descriptionProvides the administration interface to the
  ContentXML
  System/description
  servlet
  servlet-nameCocoon2/servlet-name
  display-nameCocoon2/display-name
  descriptionThe main Cocoon2 servlet/description
  !--
  In cases you're facing class loader problems you can
alternatively
  use the following servlet-class instead of the normal one
 
servlet-classorg.apache.cocoon.servlet.ParanoidCocoonServlet/se
  rvlet-clas
  s
  --
 
  servlet-classorg.apache.cocoon.servlet.CocoonServlet/servlet-class
  !--
  This parameter points to the main configuration file for Cocoon.
  Note that the path is specified in absolute notation but
  it will be
  resolved relative to the servlets webapp context path
  --
  init-param
  param-nameconfigurations/param-name
  param-value/WEB-INF/cocoon.xconf/param-value
  /init-param
  !--
  This parameter tells cocoon to set the thread's context
  classloader
  to
  its own classloader. If you experience strange classloader
issues,
  try setting this parameter to true or using
  ParanoidCocoonServlet.
  --
  init-param
  param-nameinit-classloader/param-name
  param-valuefalse/param-value
  /init-param
  !--
  This parameter indicates the configuration file of the LogKit
management
  --
  init-param
  param-namelogkit-config/param-name
  param-value/WEB-INF/logkit.xconf/param-value
  /init-param
  !--
  This parameter indicates the category id of the logger from the
  LogKit
  configuration used by the CocoonServlet.
  --
  init-param
  param-nameservlet-logger/param-name
  param-valueaccess/param-value
  /init-param
  !--
  This parameter indicates the category id of the logger from

Parsing multipart form data

2003-01-20 Thread Collin VanDyck



Hi,

I'm trying to figure out the best way to parse 
multi-part form data. I have a page which submits to a certain URI which 
invokes an action. This action needs to parse the multi-part form data (in 
the request object I believe) and then pass that data off to my j2ee backend for 
processing.

My problem is that I do not see a way for me to 
create this MultipartParser or what not. The Cocoon request object does 
not as I understand it, provide a way for me to get the necessary data to create 
this parser (i.e. I need a HttpServletRequest), and since my editor does not 
implement the servlet interface, it does not receive the Request object from the 
servlet container as a parameter (i.e. doAction, etc).

I feel like I am possibly barking up the wrong tree 
here. Is the action the appropriate place to do this? Should I 
instead implement a matcher to find this request object?

thanks,
Collin

Collin VanDyckAOL: djtclYahoo: 
webcollin


Re: Parsing multipart form data

2003-01-20 Thread Collin VanDyck
Thanks Geoff

Well, yes, I actually started going thru the mail lists and found your link
below. It is helpful, but I cannot get some of the features to work.  I DO
have the FilePartFile bit working, though I would not like to store such
files on the disk.

I gave these two init params:

init-param
param-nameautosave-uploads/param-name
param-valuefalse/param-value
/init-param

init-param
param-nameoverwrite-uploads/param-name
param-valueallow/param-value
/init-param

I basically want to keep them in memory, and then use a FilePartArray to
save the file contents into the database, but I am having trouble with that.
Cocoon does not seem to be recognizing these parameters.  Incidentally, I am
using 2.0.4, and I built it under java1.4.

I put the init-params with the other init-params in web.xml, but strangely
did not see any places for it in the web.xml file as it existed.  I thouight
there would be placeholders for it, but I could not find them.  Anyways, I
might be missing something.  My main problem now is that when I submit a
file multiple times, it keeps renaming the file 0_[filename], 1_[filename],
etc..  I think my workaround will be to just delete the file once I am done
with it, but I would like to keep it in memory if at all possible.

Thanks  very much for your help!

Collin


- Original Message -
From: Geoff Howard [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Monday, January 20, 2003 4:01 PM
Subject: RE: Parsing multipart form data


 Have you seen this document yet?
 http://wiki.cocoondev.org/Wiki.jsp?page=FileUploadsWithCocoon. I'm sorry
if
 it's not written very clearly - I wrote it late at night sort of
 spontaneously.

 That gives some basic information on how cocoon handles things behind the
 scenes.  The important part in your case is that you don't need to do the
 multipart parsing - it's already done for you by the time your action gets
 on the scene.  You can then use the FilePart object to get the contents of
 the file via an InputStream and do whatever you want with it.

 If that doesn't help, give more of an idea of what you need to do on the
 backend.

 Geoff Howard

 -Original Message-
 From: Collin VanDyck [mailto:[EMAIL PROTECTED]]
 Sent: Monday, January 20, 2003 3:36 PM
 To: [EMAIL PROTECTED]
 Subject: Parsing multipart form data


 Hi,

 I'm trying to figure out the best way to parse multi-part form data.  I
have
 a page which submits to a certain URI which invokes an action.  This
action
 needs to parse the multi-part form data (in the request object I believe)
 and then pass that data off to my j2ee backend for processing.

 My problem is that I do not see a way for me to create this
MultipartParser
 or what not.  The Cocoon request object does not as I understand it,
provide
 a way for me to get the necessary data to create this parser (i.e. I need
a
 HttpServletRequest), and since my editor does not implement the servlet
 interface, it does not receive the Request object from the servlet
container
 as a parameter (i.e. doAction, etc).

 I feel like I am possibly barking up the wrong tree here.  Is the action
the
 appropriate place to do this?  Should I instead implement a matcher to
find
 this request object?

 thanks,
 Collin

 
 Collin VanDyck
 AOL: djtcl
 Yahoo: webcollin


 -
 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: Parsing multipart form data

2003-01-20 Thread Collin VanDyck
Here is my web.xml file. (It's long, so an apology in advance). I hope this
helps, and I really do appreciate everyone's help in this list.

I commented out overwrite-uploads and set the autosave-uploads to false, but
I still get a FilePartFile instead of a FilePartArray.

thanks,
Collin



?xml version=1.0 encoding=UTF-8?
!DOCTYPE web-app PUBLIC -//Sun Microsystems, Inc.//DTD Web Application
2.3//EN http://java.sun.com/dtd/web-app_2_3.dtd;
web-app
display-nameContentXML web app/display-name
descriptionProvides the administration interface to the ContentXML
System/description
servlet
servlet-nameCocoon2/servlet-name
display-nameCocoon2/display-name
descriptionThe main Cocoon2 servlet/description
!--
In cases you're facing class loader problems you can alternatively
use the following servlet-class instead of the normal one
servlet-classorg.apache.cocoon.servlet.ParanoidCocoonServlet/servlet-clas
s
--
servlet-classorg.apache.cocoon.servlet.CocoonServlet/servlet-class
!--
This parameter points to the main configuration file for Cocoon.
Note that the path is specified in absolute notation but it will be
resolved relative to the servlets webapp context path
--
init-param
param-nameconfigurations/param-name
param-value/WEB-INF/cocoon.xconf/param-value
/init-param
!--
This parameter tells cocoon to set the thread's context classloader to
its own classloader. If you experience strange classloader issues,
try setting this parameter to true or using ParanoidCocoonServlet.
--
init-param
param-nameinit-classloader/param-name
param-valuefalse/param-value
/init-param
!--
This parameter indicates the configuration file of the LogKit management
--
init-param
param-namelogkit-config/param-name
param-value/WEB-INF/logkit.xconf/param-value
/init-param
!--
This parameter indicates the category id of the logger from the LogKit
configuration used by the CocoonServlet.
--
init-param
param-nameservlet-logger/param-name
param-valueaccess/param-value
/init-param
!--
This parameter indicates the category id of the logger from the LogKit
management configuration for the Cocoon engine.
This logger is used for all components described in the cocoon.xconf
and sitemap.xmap file not having specified a logger with the
logger=... attribute in the component configuration file.
--
init-param
param-namecocoon-logger/param-name
param-valuecore/param-value
/init-param
!--
This parameter indicates the log level to use throughout startup of the
system.
As soon as the logkit.xconf the setting of the logkit.xconf configuration is
used instead! Only for startup and if the logkit.xconf is not
readable/available
this log level is of importance.
Available levels are:
DEBUG: prints all level of log messages.
INFO: prints all level of log messages except DEBUG ones.
WARN: prints all level of log messages except DEBUG and INFO ones.
ERROR: prints all level of log messages except DEBUG, INFO and WARN ones.
FATAL_ERROR: prints only log messages of this level
--
init-param
param-namelog-level/param-name
param-valueINFO/param-value
/init-param
!--
Allow reinstantiating (reloading) of the cocoon instance. If this is
set to yes or true, a new cocoon instance can be created using
the request parameter cocoon-reload.
--
init-param
param-nameallow-reload/param-name
param-valueyes/param-value
/init-param
!--
This parameter is used to list classes that should be loaded
at initialization time of the servlet.
Usually this classes are JDBC Drivers used
--
init-param
param-nameload-class/param-name
param-value
!-- For IBM WebSphere:
com.ibm.servlet.classloader.Handler --
!-- For Database Driver: --
org.hsqldb.jdbcDriver
!-- For parent ComponentManager sample:
org.apache.cocoon.samples.parentcm.Configurator
--
/param-value
/init-param
!--
This parameter allows to specify where Cocoon should put uploaded files.
The path specified can be either absolute or relative to the context
path of the servlet. On windows platform, absolute directory must start
with volume: C:\Path\To\Upload\Directory
The default directory is upload-dir in the work-directory
init-param
param-nameupload-directory/param-name
param-valueWEB-INF/work/upload-dir/param-value
/init-param
--
!--
Causes all files in multipart requests to be saved to upload-dir.
Default is true. Unsupported values will be interpreted as false.
--
init-param
param-nameautosave-uploads/param-name
param-valuefalse/param-value
/init-param
!--
Specify handling of name conflicts when saving uploaded files
to disk. Acceptable values are deny, allow, rename (default).
Files are renamed x_filename where x is an integer value incremented
to make the new filename unique.
init-param
param-nameoverwrite-uploads/param-name
param-valueallow/param-value
/init-param
--
!--
Specify maximum allowed size of the upload. Defaults to 10 Mb.
init-param
param-nameupload-max-size/param-name
param-value1000/param-value
/init-param
--
!--
This parameter allows to specify where Cocoon should create its page
and other objects cache. The path specified 

Re: Parsing multipart form data

2003-01-20 Thread Collin VanDyck
Hi Geoff.

Here's really the only thing I'm doing with it right now.

FilePartFile fpf = (FilePartFile)request.get(file_content);
log.info(received file of name:  + fpf.getFileName());

thanks,--
Collin






- Original Message -
From: Geoff Howard [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Monday, January 20, 2003 5:32 PM
Subject: RE: Parsing multipart form data


 ah, that brings to mind another idea - send a snippet of your action that
 deals with getting the FilePart...

 Geoff

  -Original Message-
  From: Collin VanDyck [mailto:[EMAIL PROTECTED]]
  Sent: Monday, January 20, 2003 5:02 PM
  To: [EMAIL PROTECTED]
  Subject: Re: Parsing multipart form data
 
 
  Here is my web.xml file. (It's long, so an apology in advance). I
  hope this
  helps, and I really do appreciate everyone's help in this list.
 
  I commented out overwrite-uploads and set the autosave-uploads to
  false, but
  I still get a FilePartFile instead of a FilePartArray.
 
  thanks,
  Collin
 
 
 
  ?xml version=1.0 encoding=UTF-8?
  !DOCTYPE web-app PUBLIC -//Sun Microsystems, Inc.//DTD Web Application
  2.3//EN http://java.sun.com/dtd/web-app_2_3.dtd;
  web-app
  display-nameContentXML web app/display-name
  descriptionProvides the administration interface to the ContentXML
  System/description
  servlet
  servlet-nameCocoon2/servlet-name
  display-nameCocoon2/display-name
  descriptionThe main Cocoon2 servlet/description
  !--
  In cases you're facing class loader problems you can alternatively
  use the following servlet-class instead of the normal one
  servlet-classorg.apache.cocoon.servlet.ParanoidCocoonServlet/se
  rvlet-clas
  s
  --
  servlet-classorg.apache.cocoon.servlet.CocoonServlet/servlet-class
  !--
  This parameter points to the main configuration file for Cocoon.
  Note that the path is specified in absolute notation but it will be
  resolved relative to the servlets webapp context path
  --
  init-param
  param-nameconfigurations/param-name
  param-value/WEB-INF/cocoon.xconf/param-value
  /init-param
  !--
  This parameter tells cocoon to set the thread's context classloader to
  its own classloader. If you experience strange classloader issues,
  try setting this parameter to true or using ParanoidCocoonServlet.
  --
  init-param
  param-nameinit-classloader/param-name
  param-valuefalse/param-value
  /init-param
  !--
  This parameter indicates the configuration file of the LogKit management
  --
  init-param
  param-namelogkit-config/param-name
  param-value/WEB-INF/logkit.xconf/param-value
  /init-param
  !--
  This parameter indicates the category id of the logger from the LogKit
  configuration used by the CocoonServlet.
  --
  init-param
  param-nameservlet-logger/param-name
  param-valueaccess/param-value
  /init-param
  !--
  This parameter indicates the category id of the logger from the LogKit
  management configuration for the Cocoon engine.
  This logger is used for all components described in the cocoon.xconf
  and sitemap.xmap file not having specified a logger with the
  logger=... attribute in the component configuration file.
  --
  init-param
  param-namecocoon-logger/param-name
  param-valuecore/param-value
  /init-param
  !--
  This parameter indicates the log level to use throughout startup of the
  system.
  As soon as the logkit.xconf the setting of the logkit.xconf
  configuration is
  used instead! Only for startup and if the logkit.xconf is not
  readable/available
  this log level is of importance.
  Available levels are:
  DEBUG: prints all level of log messages.
  INFO: prints all level of log messages except DEBUG ones.
  WARN: prints all level of log messages except DEBUG and INFO ones.
  ERROR: prints all level of log messages except DEBUG, INFO and WARN
ones.
  FATAL_ERROR: prints only log messages of this level
  --
  init-param
  param-namelog-level/param-name
  param-valueINFO/param-value
  /init-param
  !--
  Allow reinstantiating (reloading) of the cocoon instance. If this is
  set to yes or true, a new cocoon instance can be created using
  the request parameter cocoon-reload.
  --
  init-param
  param-nameallow-reload/param-name
  param-valueyes/param-value
  /init-param
  !--
  This parameter is used to list classes that should be loaded
  at initialization time of the servlet.
  Usually this classes are JDBC Drivers used
  --
  init-param
  param-nameload-class/param-name
  param-value
  !-- For IBM WebSphere:
  com.ibm.servlet.classloader.Handler --
  !-- For Database Driver: --
  org.hsqldb.jdbcDriver
  !-- For parent ComponentManager sample:
  org.apache.cocoon.samples.parentcm.Configurator
  --
  /param-value
  /init-param
  !--
  This parameter allows to specify where Cocoon should put uploaded files.
  The path specified can be either absolute or relative to the context
  path of the servlet. On windows platform, absolute directory must start
  with volume: C:\Path\To\Upload\Directory
  The default directory is upload-dir in the work-directory

Re: Parsing multipart form data

2003-01-20 Thread Collin VanDyck
Well, with regards to which web.xml file we are using. I am not sure why
this is the way it is, but we have three WAR files, right now exploded, so
they aren't archived (read: easy to modify).. Each of the WARs has its own
web.xml file with a web-app tag that deals with Cocoon for that web
application.

Does that sound reasonable?

Or would it be looking for the web.xml in the cocoon[something].jar?

Collin


- Original Message -
From: Geoff Howard [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Monday, January 20, 2003 5:32 PM
Subject: RE: Parsing multipart form data


 sounds to me like something is wrong with your web.xml (more below):

  Thanks Geoff
 
  Well, yes, I actually started going thru the mail lists and found
  your link
  below. It is helpful, but I cannot get some of the features to work.  I
DO
  have the FilePartFile bit working, though I would not like to store such
  files on the disk.
 
  I gave these two init params:
 
  init-param
  param-nameautosave-uploads/param-name
  param-valuefalse/param-value
  /init-param
 
  init-param
  param-nameoverwrite-uploads/param-name
  param-valueallow/param-value
  /init-param

 That looks fine... where did you put them?

  I basically want to keep them in memory, and then use a FilePartArray to
  save the file contents into the database, but I am having trouble
  with that.
  Cocoon does not seem to be recognizing these parameters.
  Incidentally, I am
  using 2.0.4, and I built it under java1.4.

 Ok, you should not have problems then.

 
  I put the init-params with the other init-params in web.xml,
  but strangely
  did not see any places for it in the web.xml file as it existed.
  I thouight
  there would be placeholders for it, but I could not find them.

 That's what I find weird.  They're all in web.xml as you can see here:

http://cvs.apache.org/viewcvs.cgi/*checkout*/xml-cocoon2/src/webapp/WEB-INF/
 web.xml?rev=1.8.2.5only_with_tag=cocoon_2_0_4

 Sanity check:
 - You did modify the web.xml in cocoon/WEB-INF/ right? (not the one the
one
 in the servlet container/Tomcat conf directory?)
 - Did you do a search for them using an editor?  If searching for the
string
 autosave-uploads is not turning anything up, something's wrong.
 - Did you restart the servlet container/cocoon?
 - How did you obtain 2.0.4? (you're sure it's not 2.0.3?)

  Anyways, I might be missing something.  My main problem now is that when
I
 submit a
  file multiple times, it keeps renaming the file 0_[filename],
  1_[filename],

 You are seeing the (what used to be) default behavior - uploads are
 autosaved to disk, and
 filename conflicts are renamed (bad race condition there at one point so
 beware).  This makes me think you're using 2.0.3?

  etc..  I think my workaround will be to just delete the file once
  I am done
  with it, but I would like to keep it in memory if at all possible.

 That works as well (actually I'd love to see a third option for
 autosave-uploads: temp which would delete the file after the servlet
 finishes processing.  Haven't been able to look into it yet (any
 volunteers?)

 
  Thanks  very much for your help!
 
  Collin

 No problem.

 Geoff


 -
 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: Parsing multipart form data

2003-01-20 Thread Collin VanDyck
Hi Geoff,

When I cast directly to FilePartArray I get a ClassCastException, which I
thought was due to Cocoon not receiving the init-param correctly.  Is that
normal?

Collin


- Original Message -
From: Geoff Howard [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Monday, January 20, 2003 5:37 PM
Subject: RE: Parsing multipart form data


 There you go - you've cast to FilePartFile - cast to FilePart (or directly
 to FilePartArray) and you're set.  We need another example at the Wiki
 (assuming that's where you got the concept from?) showing FilePartArray.

 Should have thought of that first,
 Geoff

  -Original Message-
  From: Collin VanDyck [mailto:[EMAIL PROTECTED]]
  Sent: Monday, January 20, 2003 5:22 PM
  To: [EMAIL PROTECTED]
  Subject: Re: Parsing multipart form data
 
 
  Hi Geoff.
 
  Here's really the only thing I'm doing with it right now.
 
  FilePartFile fpf = (FilePartFile)request.get(file_content);
  log.info(received file of name:  + fpf.getFileName());
 
  thanks,--
  Collin
 
 
 
 
 
 
  - Original Message -
  From: Geoff Howard [EMAIL PROTECTED]
  To: [EMAIL PROTECTED]
  Sent: Monday, January 20, 2003 5:32 PM
  Subject: RE: Parsing multipart form data
 
 
   ah, that brings to mind another idea - send a snippet of your
  action that
   deals with getting the FilePart...
  
   Geoff
  
-Original Message-
From: Collin VanDyck [mailto:[EMAIL PROTECTED]]
Sent: Monday, January 20, 2003 5:02 PM
To: [EMAIL PROTECTED]
Subject: Re: Parsing multipart form data
   
   
Here is my web.xml file. (It's long, so an apology in advance). I
hope this
helps, and I really do appreciate everyone's help in this list.
   
I commented out overwrite-uploads and set the autosave-uploads to
false, but
I still get a FilePartFile instead of a FilePartArray.
   
thanks,
Collin
   
   
   
?xml version=1.0 encoding=UTF-8?
!DOCTYPE web-app PUBLIC -//Sun Microsystems, Inc.//DTD Web
  Application
2.3//EN http://java.sun.com/dtd/web-app_2_3.dtd;
web-app
display-nameContentXML web app/display-name
descriptionProvides the administration interface to the ContentXML
System/description
servlet
servlet-nameCocoon2/servlet-name
display-nameCocoon2/display-name
descriptionThe main Cocoon2 servlet/description
!--
In cases you're facing class loader problems you can alternatively
use the following servlet-class instead of the normal one
servlet-classorg.apache.cocoon.servlet.ParanoidCocoonServlet/se
rvlet-clas
s
--
   
servlet-classorg.apache.cocoon.servlet.CocoonServlet/servlet-class
!--
This parameter points to the main configuration file for Cocoon.
Note that the path is specified in absolute notation but it will be
resolved relative to the servlets webapp context path
--
init-param
param-nameconfigurations/param-name
param-value/WEB-INF/cocoon.xconf/param-value
/init-param
!--
This parameter tells cocoon to set the thread's context classloader
to
its own classloader. If you experience strange classloader issues,
try setting this parameter to true or using ParanoidCocoonServlet.
--
init-param
param-nameinit-classloader/param-name
param-valuefalse/param-value
/init-param
!--
This parameter indicates the configuration file of the LogKit
  management
--
init-param
param-namelogkit-config/param-name
param-value/WEB-INF/logkit.xconf/param-value
/init-param
!--
This parameter indicates the category id of the logger from the
LogKit
configuration used by the CocoonServlet.
--
init-param
param-nameservlet-logger/param-name
param-valueaccess/param-value
/init-param
!--
This parameter indicates the category id of the logger from the
LogKit
management configuration for the Cocoon engine.
This logger is used for all components described in the cocoon.xconf
and sitemap.xmap file not having specified a logger with the
logger=... attribute in the component configuration file.
--
init-param
param-namecocoon-logger/param-name
param-valuecore/param-value
/init-param
!--
This parameter indicates the log level to use throughout
  startup of the
system.
As soon as the logkit.xconf the setting of the logkit.xconf
configuration is
used instead! Only for startup and if the logkit.xconf is not
readable/available
this log level is of importance.
Available levels are:
DEBUG: prints all level of log messages.
INFO: prints all level of log messages except DEBUG ones.
WARN: prints all level of log messages except DEBUG and INFO ones.
ERROR: prints all level of log messages except DEBUG, INFO and WARN
  ones.
FATAL_ERROR: prints only log messages of this level
--
init-param
param-namelog-level/param-name
param-valueINFO/param-value
/init-param

Logkit logger not working from within custom protocol

2003-01-15 Thread Collin VanDyck



Hi,

I've extended AbstractLoggable and implemented 
SourceFactory and Composable in order to create a protocol that will generate 
SAX events. When I retrieve the logger (this.getLogger()), I get null 
back, which means i have resorted to system.out.printlns to debug (yek). 
Does anyone also have this problem? I'm extremely new to Cocoon/Avalon, so 
any advice == much appreciated.

I'm running Cocoon on Win2k w/ Jboss3, 
Java1.4

thanks,--

Collin VanDyckAOL: djtclYahoo: 
webcollin


AbstractSAXSource constructor throwing java.lang.NullPointerException

2002-12-30 Thread Collin VanDyck



I've got a class that extends 
AbstractSAXSource. My class's constructor is called with the 
parameters:

Environment 
ComponentManager
Logger
and others...

The first time that this class is instantiated once 
the j2ee (Jboss) system has been started, it runs fine. No 
problem.

However, subsequent calls to instantiate the 
AbstractSAXSource result in a java.lang.NullPointerException. The 
frustrating thing is that that is all the information. It does not tell me 
what is null. I have checked each of the three parameters before 
calling the super-constructor (super == AbstractSAXSource), and all three 
parameters are not null.

Is there any way for me to get more information out 
of this? Wow, it's really frustrating. Has anyone here had problems 
like this?

Unfortunately, I am an avalon/cocoon newbie, 
and just inherited this application with little documentation. I 
would really appreciate any pointers you all could give me on how to resolve 
this problem.

thanks,
Collin


Collin VanDyckAOL: djtclYahoo: 
webcollin


java.lang.NullPointerException when initializing AbstractSAXSource

2002-12-30 Thread Collin VanDyck



I've got a class that extends 
AbstractSAXSource. My class's constructor is called with the 
parameters:

Environment 
ComponentManager
Logger
and others...

The first time that this class is instantiated once 
the j2ee (Jboss) system has been started, it runs fine. No 
problem.

However, subsequent calls to instantiate the 
AbstractSAXSource result in a java.lang.NullPointerException. The 
frustrating thing is that that is all the information. It does not tell me 
what is null. I have checked each of the three parameters before 
calling the super-constructor (super == AbstractSAXSource), and all three 
parameters are not null.

Is there any way for me to get more information out 
of this? Wow, it's really frustrating. Has anyone here had problems 
like this?

Unfortunately, I am an avalon/cocoon newbie, 
and just inherited this application with little documentation. I 
would really appreciate any pointers you all could give me on how to resolve 
this problem.

thanks,
Collin


Collin VanDyckAOL: djtclYahoo: 
webcollin


Re: java.lang.NullPointerException when initializing AbstractSAXSource

2002-12-30 Thread Collin VanDyck



Sorry about the double post guys. I had 
emailed from a different account and wasn't sure if it would show up or not, so 
I resent using the account from which I had registered to the list.

Collin


  - Original Message - 
  From: 
  Collin 
  VanDyck 
  To: [EMAIL PROTECTED] 
  
  Sent: Monday, December 30, 2002 12:50 
  PM
  Subject: java.lang.NullPointerException 
  when initializing AbstractSAXSource
  
  I've got a class that extends 
  AbstractSAXSource. My class's constructor is called with the 
  parameters:
  
  Environment 
  ComponentManager
  Logger
  and others...
  
  The first time that this class is instantiated 
  once the j2ee (Jboss) system has been started, it runs fine. No 
  problem.
  
  However, subsequent calls to instantiate the 
  AbstractSAXSource result in a java.lang.NullPointerException. The 
  frustrating thing is that that is all the information. It does not tell 
  me what is null. I have checked each of the three parameters 
  before calling the super-constructor (super == AbstractSAXSource), and all 
  three parameters are not null.
  
  Is there any way for me to get more information 
  out of this? Wow, it's really frustrating. Has anyone here had 
  problems like this?
  
  Unfortunately, I am an avalon/cocoon newbie, 
  and just inherited this application with little documentation. I 
  would really appreciate any pointers you all could give me on how to resolve 
  this problem.
  
  thanks,
  Collin
  
  
  Collin VanDyckAOL: djtclYahoo: 
  webcollin