Re: Caching results of SQL Queries?

2002-11-15 Thread Justin Fagnani-Bell
Jeremy,

  If you're doing the SQL queries in a custom component (generator, 
transformer) you can use Cocoon's caching system. Have you class 
implement Cachable, and in the generateValidity() method you can return 
an object with the last modification date of the database.

see :
http://xml.apache.org/cocoon/userdocs/concepts/caching.html

and the API docs for Cachable and CacheValidity.

-Justin


On Thursday, November 14, 2002, at 03:37  AM, Jeremy Quinn wrote:

Dear All,

I have a set of related Tables in MySQL, which are used to build part 
of a site I am working on.

We use SQL because of the related nature of the data, rather than any 
great need for dynamics.

My SQL queries are broken down into 'components' which are CIncluded 
into my documents from internal pipelines. Usually there are several 
components that use SQL queries in each document. (It is done this way 
to isolate the implementation of components from their useage as well 
as from the main sitemap).

The data seldom changes . is there any way I can force the 
internal pipelines to cache, without using the tricks like browser 
caching via the 'expires' header on the external pipeline?

Thanks for any suggestions.

regards Jeremy


-
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: URL Theory & Best Practices

2002-11-09 Thread Justin Fagnani-Bell

On Saturday, November 9, 2002, at 12:08  PM, Miles Elam wrote:


Tony Collen wrote:


Comments inline...

Miles Elam wrote:


But can't delivered types differ by the incoming client?


Yes, but a problem then arises when someone is using IE and they want 
a PDF, when your user-agent rules will only serve a PDF for FooCo PDF 
Browser 1.0.  IMO browsers should respect the mime-type header.  I 
believe the mime-type headers is very useful when you want to use 
something like a PHP script to send an image or a .tar.gz file.  In 
fact, it's essential for it to work, otherwise the browser interprets 
the data as garbage.

No, that's wasn't my intention at all.  If someone is using IE and 
they want a pdf (not a default expectation for that particular browser 
like html or xml), then the URL they would get directed to would be 
*.pdf. This is not the intrinsic resource.  You are explicitly asking 
for the PDF representation of that resource.

If the browser's default expectation is PDF (like in your FooCo PDF 
Browser 1.0 example), the trailing slash resource would give it PDF. 
However, it could still be pointed to *.pdf if you wanted to make it 
explicit.

This is very well put Miles, and was my intention with the previous 
email I wrote. Content negotiation and file extensions can (and IMO 
should) exist side-by-side. There is no precedent for a browser 
changing its accept header on a per-request basis, as someone 
suggested, not is there a way to specify this behavior in a hyper-link. 
If you have a link on a site that says "Click here for a PDF" then I 
would expect that the URI would end in .pdf, at least that's what makes 
the most sense to me.


In those cases where only PDF is available (common when it's not 
dynamically generated), I see no reason why the URI wouldn't be *.pdf.

Exactly.


This is where we differ slightly.  In my mind /a/b/ is the intrinsic 
resource.  /a/b/index.html is the explicit call for HTML 
represention of /a/b/.  If you redirect a client to /a/b/index.html 
and the client bookmarks it, they are bookmarking the HTML 
representation, not the intrinsic resource.

This is definitely where we differ. I don't see why an intrinsic 
resource should always end in a '/'. If /a/b.pdf is the PDF 
representation then why shouldn't /a/b be the intrinsic resource? The 
only reason I see why the trailing slash is recommended is because 
developers are used to having their URI space tied to their filesystem 
structure with a static server like Apache. The trailing slash, from 
our experience with filesystems,  indicates that something is a 
directory, that it has children. But in a URI a resource can be both a 
viewable resource and a container node at the same time. There's 
certainly nothing stopping /a/b/, /a/b, /a/b.pdf and /a/b/c.pdf from 
all being valid URI's in the same space. To me the trailing slash 
simple indicates that there's more to come at lower levels, and the 
absence of it means the resource is a leaf.

As for redirects, I don't see it being too much of a problem with more 
recent protocols. Also it should only happen when a visitor is being 
referred from an external page, since all the URL's in your site should 
be in the correct form. If you are linking to the intrinsic resource, I 
don't see the need for a redirect (as long as the browser correctly 
understands the mime-type header), so I don't see a problem with 
bookmarking.

- Miles

P.S.  Thank god for the mailing lists.  They actually encourages me to 
write down some of my thoughts.  Even they are off the mark more often 
than not...  Does this make email better than web or simply justify 
the need for more discussion on the web?

Here here. I say both, linear discussion is good, so is collaboration. 
A discussion board combined with a wiki would be awesome. Discuss a 
topic and collaborate on a document summing up the ideas at the same 
time. Hmm... Cocoon could do that :)

-Justin


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



Is anyone using cocoon.xconf files in Mounts?

2002-11-08 Thread Justin Fagnani-Bell
I'm having problems with Cocoon Mounts and using cocoon.xconf files in 
the mount sub-directories. I've posted about this a few times but 
haven't gotten a response, so I'm wondering if anyone out there is 
using mounts and cocoon.xconf files.

My problem is that I can't access JDBC datasources defined in the 
sub-cocoon.xconf files. I believe this is because to get a datasource 
you need to use a ComponentSelector, and I think the ComponentSelector 
for datasources doesn't have access to the components defined in the 
cocoon.xconf files in the Mounts.

I can't really find much documentation on this except for at the cocoon 
wiki where it just say this should be possible, and defining datasource 
is one of the reasons for having sub-cocoon.xconf files.

I'd love to hear if anyone has attempted this, whether or not you've 
succeeded or failed, because at this point it feels like I might be the 
only attempting this, and surely that can't be. There must be someone 
out there who's tried, one of the developers of this functionality 
maybe?

Thanks again, in advance, for any responses,
  Justin


-
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: URL Theory & Best Practices

2002-11-07 Thread Justin Fagnani-Bell
Tony,

  I've wrestled with similar problems for a while with my content 
management system, which uses a database for content and structure. I'm 
in the process of setting the system to use file extensions for the 
client to specify the file type and have Cocoon return that type. If 
they request /a.html, they get html, /a.pdf and they get pdf, and so 
on. This seems elegant, but it has problems when you consider the 
points covered in the slashforward article. Here's the compromise I've 
come up with so far, adapted to a filesystem like you're using. I'm 
still toying with these ideas, so i'd like to hear comments.

1) Instead of having directories with index.xml files, have a directory 
and an xml file with the same name at the same level.
so you have /a/b/ actually returning /a/b.xml. you could map a request 
for /a/b/index.html to /a/b.xml as well. This way you can add a leaf, 
and if you need to later add sub-nodes, and turn the leaf into a node, 
you just add a directory and some files underneath it.

2) Redirect all urls to *not* end in a slash. I see the point of the 
article you've linked to, and agree with it, but the file extension is 
the only form of file meta data that's pretty standard. Ending all urls 
in slashes only works, in my opinion, if all the files are the same 
type, if not it's really nice to have a way of identifying the type 
from the url, not just the mime-type response header. So considering 
that any request is going to point to a leaf (or an error page), then I 
would redirect /a/b/ to /a/b.html

This way the extension isn't revealing the underlying technology of the 
site, but the type of file the client is expecting, and this goes for 
directories too.

The matchers would look something like this: (i might have this wrong)


  



  
  


Add matchers, or use selectors, for more file types.



-Justin


On Thursday, November 7, 2002, at 02:57  PM, Tony Collen wrote:

Apologies for the extra long post, but this has been bugging me for a 
while.

First, some background:

I'm attempting to put together a URL space using cocoon that will 
allow users to drop an XML file into a directory, say 
$TOMCAT_HOME/webapps/cocoon/documents/ and have it published.  This is 
easy enough:


   
   


So then I decide that for organization's sake, I want to allow people 
to create subdirectories under documents/ any number of levels deep, 
and still have cocoon publish them. This is also fairly simple:


   
   
   


However, later I realize that using file extensions is "bad".  Read 
http://www.alistapart.com/stories/slashforward/ for more info on this 
idea.
This creates problems with how I automatically generate content using 
Cocoon.  I want to allow people to create content arbitrarily deep in 
the documents/ directory, but I run into a bunch of questions.

Should trailing slashes always be used? I think so.
Therefore: Consider an HTTP request for "/a/b/c/".

   1. Is it a request for the discreet resource named "c" which is 
contained in "b"?
   2. Is it a request for the listing of all the contents of the "c" 
resource (which is in turn contained within "b")?
   3. Is this equivalent to a request for "/a/b/c"? 3b. Should 
a request for something w/o a trailing slash be redirected to the same 
URL, but with a trailing slash added?

Using the "best practice" of always having trailing slashes creates 
problems when mapping the virtual URL space to a physical directory 
structure.  Considering a request for "/a/b/c/", do I go into 
documents/a/b/c/ and generate from index.xml?  Or do I go to 
documents/a/b/ and generate from c.xml?  Having every "leaf" be a 
directory with an index.xml gets to be unmaintainable, IMO.

Likewise, do I generate from documents/a/b/d.xml or 
documents/a/b/d/index.xml for a request of "/a/b/d"?  Additionally, 
what should happen when there's a request for "/a/b/"?  Obviously, if 
the subdirectory "b" exists, it would not be correct to go to 
documents/a/ and look for b.xml.

Part of my reasoning behind all these questions lies in my quest for 
creating an uber-flexible "drop-in" directory structure where people 
can simply add their .xml files to the "documents" directory and have 
Cocoon automagically publish them, as I stated above.  The other 
reason for this is that I'm trying to devise a system which 
automatically creates navigation, as well. I've looked at the 
Bonebreaker example, and it's good, but has some limitations.  What if 
I don't want to use the naming scheme they have?

Oh well, thanks for listening to my ramblings, and hopefully I can get 
some light shed on this situation, as well as have a nifty autonavbar 
work eventually :)
Regards,
Tony


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

Re: Anyone? (was Re: More sub-sitemap questions)

2002-11-04 Thread Justin Fagnani-Bell
Hi,

  Sorry for reposting this yet again, and to both lists, but I haven't 
been able to find a solution to something that I think should work, (at 
least according to the cocoon wiki, which specifically mentions that 
one of the uses for mounts having their own cocoon.xxonf files is to 
define datasources).

The scenario is that I can access components defined in 
sub-cocoon.xconf files, but only if they don't require a 
ComponentSelector. If they require a ComponentSelector it can't find 
the component and I get errors.

On Thursday, October 31, 2002, at 09:38  AM, Justin Fagnani-Bell wrote:

So I still don't know the answer to this question, but while 
experimenting trying to find the answer I discovered that I can't 
access any components defined in a sub-cocoon.xconf that require a 
ComponentSelector, specifically a datasource.

I have one component that's defined in my sub-cocoon.xconf and takes a 
parameter that's the name of a datasource,

To clarify, it looks like this in cocoon.xconf:

  

  
  jdbc:mysql:///something
  someone
  somepass

  

  

  

The SQLNodeStore loads fine, the following code is in its parameterize 
method

I get an Excalibur error when that component tries to load the 
datasource. here's the code:

this.dataSourceName = params.getParameter("datasource","NodeDB");
debug("SQLNodeStore.parameterize(): dataSourceName="+dataSourceName);
ComponentSelector selector = (ComponentSelector) 
manager.lookup(DataSourceComponent.ROLE + "Selector");
this.datasource = (DataSourceComponent) 
selector.select(dataSourceName);

and here's the error from the log file:

DEBUG   (2002-10-31) 09:24.36:845   [cocoon  ](/projects/spectra/) 
Thread-5/SQLNodeStore: SQLNodeStore.parameterize(): 
dataSourceName=NodeDB
DEBUG   (2002-10-31) 09:24.36:845   [cocoon  ](/projects/spectra/) 
Thread-5/ExcaliburComponentSelector: UnnamedSelector: 
ComponentSelector could not find the component for hint: NodeDB

This all works fine if the components are defined in the main 
cocoon.xconf file. I know the sub-cocoon.xconf file is being read 
because I can load my SQLNodeStore component. I think what's happening 
is that there's a seperation between the two cocoon.xconf files, and 
when I load the ComponentSelector I'm getting a ComponentSelector for 
the main file, which doesn't have a datasource called NodeDB. Is this 
possible? If so, is this a bug, or do I need to do something > 
different?

Any help is much appreciated.

Thanks,
  Justin


On Tuesday, October 29, 2002, at 01:51  PM, Justin Fagnani-Bell wrote:

Good afternoon (in Cali),

  As I mentioned in my last email (anyone figure an answer yet? I 
haven't), I'm trying to keep all my Cocoon projects running live on 
my development server via auto mounting sub-sitemaps. The ability for 
each mount to have it's own cocoon.xconf file seems to be the last 
piece that makes this possible.

I setup datasources and some custom components in cocoon.xconf. My 
question is how are name conflicts dealt with if you have components 
with the same name in the main cocoon.xconf file and the sub 
cocoon.xconf file?

More specifically, if I have this in my code:

public void compose(ComponentManager manager) throws 
ComponentException {
super.compose(manager);
if (nodeStore == null) {
  this.nodeStore = (NodeStore)manager.lookup(NodeStore.ROLE);
}
}

and I have a NodeStore component defined in both cocoon.xconf files, 
is there any guarantee which component I will get? (the reason it 
matters is because my NodeStores are setup up to access different 
databases)

Thanks,
  Justin


-
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: Anyone? (was Re: More sub-sitemap questions)

2002-11-04 Thread Justin Fagnani-Bell
Hi,

  Sorry for reposting this yet again, and to both lists, but I haven't 
been able to find a solution to something that I think should work, (at 
least according to the cocoon wiki, which specifically mentions that 
one of the uses for mounts having their own cocoon.xxonf files is to 
define datasources).

The scenario is that I can access components defined in 
sub-cocoon.xconf files, but only if they don't require a 
ComponentSelector. If they require a ComponentSelector it can't find 
the component and I get errors.

On Thursday, October 31, 2002, at 09:38  AM, Justin Fagnani-Bell wrote:

So I still don't know the answer to this question, but while 
experimenting trying to find the answer I discovered that I can't 
access any components defined in a sub-cocoon.xconf that require a 
ComponentSelector, specifically a datasource.

I have one component that's defined in my sub-cocoon.xconf and takes a 
parameter that's the name of a datasource,

To clarify, it looks like this in cocoon.xconf:

  

  
  jdbc:mysql:///something
  someone
  somepass

  

  

  

The SQLNodeStore loads fine, the following code is in its parameterize 
method

I get an Excalibur error when that component tries to load the 
datasource. here's the code:

this.dataSourceName = params.getParameter("datasource","NodeDB");
debug("SQLNodeStore.parameterize(): dataSourceName="+dataSourceName);
ComponentSelector selector = (ComponentSelector) 
manager.lookup(DataSourceComponent.ROLE + "Selector");
this.datasource = (DataSourceComponent) 
selector.select(dataSourceName);

and here's the error from the log file:

DEBUG   (2002-10-31) 09:24.36:845   [cocoon  ](/projects/spectra/) 
Thread-5/SQLNodeStore: SQLNodeStore.parameterize(): 
dataSourceName=NodeDB
DEBUG   (2002-10-31) 09:24.36:845   [cocoon  ](/projects/spectra/) 
Thread-5/ExcaliburComponentSelector: UnnamedSelector: 
ComponentSelector could not find the component for hint: NodeDB

This all works fine if the components are defined in the main 
cocoon.xconf file. I know the sub-cocoon.xconf file is being read 
because I can load my SQLNodeStore component. I think what's happening 
is that there's a seperation between the two cocoon.xconf files, and 
when I load the ComponentSelector I'm getting a ComponentSelector for 
the main file, which doesn't have a datasource called NodeDB. Is this 
possible? If so, is this a bug, or do I need to do something > different?

Any help is much appreciated.

Thanks,
  Justin


On Tuesday, October 29, 2002, at 01:51  PM, Justin Fagnani-Bell wrote:

Good afternoon (in Cali),

  As I mentioned in my last email (anyone figure an answer yet? I 
haven't), I'm trying to keep all my Cocoon projects running live on 
my development server via auto mounting sub-sitemaps. The ability for 
each mount to have it's own cocoon.xconf file seems to be the last 
piece that makes this possible.

I setup datasources and some custom components in cocoon.xconf. My 
question is how are name conflicts dealt with if you have components 
with the same name in the main cocoon.xconf file and the sub 
cocoon.xconf file?

More specifically, if I have this in my code:

public void compose(ComponentManager manager) throws 
ComponentException {
super.compose(manager);
if (nodeStore == null) {
  this.nodeStore = (NodeStore)manager.lookup(NodeStore.ROLE);
}
}

and I have a NodeStore component defined in both cocoon.xconf files, 
is there any guarantee which component I will get? (the reason it 
matters is because my NodeStores are setup up to access different 
databases)

Thanks,
  Justin


-
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: dynamically choosing an action at runtime

2002-11-04 Thread Justin Fagnani-Bell
Josema,

  You don't have to include the parts of your pipeline that are the 
same in the  elements. You can just include the  
element, since it appears that you're not returning any parameters from 
your action, and then you won't have to duplicate the part that doesn't 
vary.

  An even better way would be to have a proxy Action class that 
dynamically loads a particular helps class depending on a parameter 
passed to it. Cocoon already includes something like this with 
ServerPagesAction, and you write the action in XSP.

Justin


On Monday, November 4, 2002, at 09:57  AM, Josema Alonso wrote:

Just use appropriate selector:
http://xml.apache.org/cocoon/userdocs/selectors/selectors.html


I already tried but haven't found a nice way of using them for this 
purpose.
I can make something like the pipeline below, but i have dozens of 
similar
cases and it doesn't seem like a good approach. Maybe I haven't 
understood
selectors well...


--
  
  
   

 
 
 
  
   
   
value="http://www.ascc.net/xml/schematron"/>
   
value="{1}/schematron/{1}-validator.xml"/>
   
   
   
value="net.josema.xmtrader.forms.xmldb.recordings.equipment.{1}Bean"/>
   
   
   
   
   
   
   
   
   
   
  
 
 
 
  
   
   
value="http://www.ascc.net/xml/schematron"/>
   
value="{1}/schematron/{1}-validator.xml"/>
   
   
   
value="net.josema.xmtrader.forms.xmldb.recordings.equipment.{1}Bean"/>
   
   
   
   
   
   
   
   
   
   
  
 

   
  



-
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: Accessing uri-prefix from within sub-sitemaps?

2002-11-04 Thread Justin Fagnani-Bell
Thanks for the reply Joerg,

I looked into your suggestion, but I don't quite see how to do it. For  
a project in development the URI will be something like:

 http://dev.myhost.com/projects/proj1/

and for a deployed project the URI will just be

http://somehost.com/

but after that the URI could contain any path, so I feel like checking  
if the URI starts with "/projects/*/" would be a hack and could cause  
problems if by chance the site contained a top level projects folder.  
I'm already passing either "projects/proj1" or "" (an empty string) to  
the stylesheet. I would just like to find a way to pass it to the  
sub-sitemap, from the main sitemap.

Anyway, this problem isn't that big of a deal, just a cleanliness issue  
really. I'm creating the development system so that there's a "deploy"  
button which will upload the site to the server, (like GoLive or  
Dreamweaver). Right now there's three things I need to do to any  
project folder, add the WEB-INF director, fix the sitemap to take away  
the "base" parameter, and add a correct cocoon.xconf file. I'm just  
looking to simplify the process. If anyone can help me on the  
cocoon.xconf problems I'm having I'd very much appreciate it. (I think  
it could be a bug see  
http://marc.theaimsgroup.com/?l=xml-cocoon-users&m=103592834813138&w=2 )

Thanks,
  Justin

ps. oh i made a mistake in my sitemap code below, the parameter line  
should be:



On Monday, November 4, 2002, at 11:51  AM, Joerg Heinicke wrote:

Hello Justin,

is it possible to use the RequestParamAction  
(http://xml.apache.org/cocoon/apidocs/org/apache/cocoon/acting/ 
RequestParamAction.html), to pass the {requestURI} to the stylesheet  
and to have there some logic to get the correct substring?

Regards,

Joerg

Justin Fagnani-Bell wrote:
Hi,
  I'm using sub-sitemaps now to host several projects at once in my  
development environment. I access the projects through a URL that  
looks like this - "http://localhost/projects/proj1";, and in the  
sub-sitemaps I have a XSLTransformer prepend a sitemap variable  
called base to the beginning of all absolute urls, so that all my  
links work. I end up entering the uri-prefix by hand, the matcher  
looks something like this:



  


What I would like to do is have "base" automatically set by accessing  
the uri-prefix set in the mount element on the main sitemap, then  
when I deploy the project, there's absoutely no changes that need to  
be made to the sub-sitemap. Is there a way to do this?
Thanks,
  Justin


-
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: Selecting serializer based on URI

2002-11-04 Thread Justin Fagnani-Bell
Werner,

  You'll need to use a selector to do this, parameter selector works  
well. Try something like this:

  
  
  



  
  



  
  



  
  


  



On Monday, November 4, 2002, at 10:40  AM, Werner Guttmann wrote:

Hi,

is it actually possible to select a serializer based on a regexp in the
URI, iow something similar to the following sitemap fragment


  
pattern="publish/instruction-controller.html">

src="xml/instruction-controller.xml" />

  
  


  


which I'd like to replace


  


src="xml/instruction-controller.xml" />

  
  


  


Trying this results into the following exception:

org.apache.avalon.framework.configuration.ConfigurationException: Type
'{1}' is not defined for 'serialize' at
file:/ms/user/g/guttmanw/workdir/build/expiry-webapp/ 
sitemap.xmap:488:32

Or am I approaching this in a wrong way anyhow ?

Werner


-
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: Pipeline vs Pipeline(S)

2002-10-31 Thread Justin Fagnani-Bell
From what I understand there isn't a whole lot of difference, but 
having separate pipelines allows you to use different pipeline 
implementations to allow for things like caching, logging, etc.

Justin

On Thursday, October 31, 2002, at 11:59  AM, Steven Punte wrote:

What the difference between

  
..
..
  

and

  
..
  

  
..
  

Thanks in advance:
Steve Punte
[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]>




Anyone? (was Re: More sub-sitemap questions)

2002-10-31 Thread Justin Fagnani-Bell
So I still don't know the answer to this question, but while 
experimenting trying to find the answer I discovered that I can't 
access any components defined in a sub-cocoon.xconf that require a 
ComponentSelector, specifically a datasource.

I have one component that's defined in my sub-cocoon.xconf and takes a 
parameter that's the name of a datasource, I get an Excalibur error 
when that component tries to load the datasource. here's the code:

this.dataSourceName = params.getParameter("datasource","NodeDB");
debug("SQLNodeStore.parameterize(): dataSourceName="+dataSourceName);
ComponentSelector selector = (ComponentSelector) 
manager.lookup(DataSourceComponent.ROLE + "Selector");
this.datasource = (DataSourceComponent) selector.select(dataSourceName);

and here's the error from the log file:

DEBUG   (2002-10-31) 09:24.36:845   [cocoon  ](/projects/spectra/) 
Thread-5/SQLNodeStore: SQLNodeStore.parameterize(): 
dataSourceName=NodeDB
DEBUG   (2002-10-31) 09:24.36:845   [cocoon  ](/projects/spectra/) 
Thread-5/ExcaliburComponentSelector: UnnamedSelector: ComponentSelector 
could not find the component for hint: NodeDB

This all works fine if the components are defined in the main 
cocoon.xconf file. I know the sub-cocoon.xconf file is being read 
because I can load my SQLNodeStore component. I think what's happening 
is that there's a seperation between the two cocoon.xconf files, and 
when I load the ComponentSelector I'm getting a ComponentSelector for 
the main file, which doesn't have a datasource called NodeDB. Is this 
possible? If so, is this a bug, or do I need to do something different?

Any help is much appreciated.

Thanks,
  Justin


On Tuesday, October 29, 2002, at 01:51  PM, Justin Fagnani-Bell wrote:

Good afternoon (in Cali),

  As I mentioned in my last email (anyone figure an answer yet? I 
haven't), I'm trying to keep all my Cocoon projects running live on my 
development server via auto mounting sub-sitemaps. The ability for 
each mount to have it's own cocoon.xconf file seems to be the last 
piece that makes this possible.

I setup datasources and some custom components in cocoon.xconf. My 
question is how are name conflicts dealt with if you have components 
with the same name in the main cocoon.xconf file and the sub 
cocoon.xconf file?

More specifically, if I have this in my code:

public void compose(ComponentManager manager) throws 
ComponentException {
super.compose(manager);
if (nodeStore == null) {
  this.nodeStore = (NodeStore)manager.lookup(NodeStore.ROLE);
}
}

and I have a NodeStore component defined in both cocoon.xconf files, 
is there any guarantee which component I will get? (the reason it 
matters is because my NodeStores are setup up to access different 
databases)

Thanks,
  Justin


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




More sub-sitemap questions

2002-10-29 Thread Justin Fagnani-Bell
Good afternoon (in Cali),

  As I mentioned in my last email (anyone figure an answer yet? I 
haven't), I'm trying to keep all my Cocoon projects running live on my 
development server via auto mounting sub-sitemaps. The ability for each 
mount to have it's own cocoon.xconf file seems to be the last piece 
that makes this possible.

I setup datasources and some custom components in cocoon.xconf. My 
question is how are name conflicts dealt with if you have components 
with the same name in the main cocoon.xconf file and the sub 
cocoon.xconf file?

More specifically, if I have this in my code:

public void compose(ComponentManager manager) throws 
ComponentException {
super.compose(manager);
if (nodeStore == null) {
  this.nodeStore = (NodeStore)manager.lookup(NodeStore.ROLE);
}
}

and I have a NodeStore component defined in both cocoon.xconf files, is 
there any guarantee which component I will get? (the reason it matters 
is because my NodeStores are setup up to access different databases)

Thanks,
  Justin


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



Accessing uri-prefix from within sub-sitemaps?

2002-10-28 Thread Justin Fagnani-Bell
Hi,

  I'm using sub-sitemaps now to host several projects at once in my 
development environment. I access the projects through a URL that looks 
like this - "http://localhost/projects/proj1";, and in the sub-sitemaps 
I have a XSLTransformer prepend a sitemap variable called base to the 
beginning of all absolute urls, so that all my links work. I end up 
entering the uri-prefix by hand, the matcher looks something like this:




  



What I would like to do is have "base" automatically set by accessing 
the uri-prefix set in the mount element on the main sitemap, then when 
I deploy the project, there's absoutely no changes that need to be made 
to the sub-sitemap. Is there a way to do this?

Thanks,
  Justin


-
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: Running command-line programs in a pipeline

2002-10-02 Thread Justin Fagnani-Bell

Peter,

You could certainly write your own serializer to do this. I haven't 
written a serializer, but I'm pretty sure the input needs to be SAX 
events, so the only ways you could use XSLT to output LaTeX is if you 
did the transformation within the serializer, or wrapped the LaTeX in 
XML.

Another solution would be to have an intermediary step where you 
transform into an XML dialect that your LaTeX serializer understands. 
This is how FOP works, and xsl:fo is the intermediary step. I would 
definitely see if you could use xsl:fo for this purpose so you don't 
have to reinvent the wheel.

As for calling the command line program you can use Runtime.exec() and 
write and read from the Process object that it returns. There are 
inherent scalability problems with this approach though. I'm not 
familiar with LaTeX, are you sure there aren't and Java based LaTeX 
tools?

Justin

On Wednesday, October 2, 2002, at 01:38  AM, Peter Flynn wrote:

> Is it possible to specify a pipeline which instantiates a non-SAX
> transformation (eg running some arbitrary commandline program on
> the pipeline content or a generated file and serving the result)?
>
> An example would be to transform XML to LaTeX with XSLT and then
> run LaTeX in order to serve DVI instead of PDF.
>
> ///Peter


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




What DTD's do you use for a plain site?

2002-09-28 Thread Justin Fagnani-Bell

What Doctypes are people using for general information to be displayed 
at HTML?

I'm doing a very simple site which will be mostly static HTML. The data 
is basically intended for presentation only, so there isn't much of a 
datatype I need to model, the only reason I'm going for cocoon is to 
swap out look and feel easily.

So far my experience with Cocoon has been with data I could come up 
with a logical XML dialect for. But for presentation orientated data I 
find myself just using html, which I know I shouldn't.

Any suggestions? I'm about to check out DocBook, but is that maybe 
overkill?

Thanks,
   Justin


-
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: PERFUME PROPOSAL: SOAP FOR COCOON

2002-09-23 Thread Justin Fagnani-Bell


On Sunday, September 22, 2002, at 08:54  PM, Steven Punte wrote:

>> PERFUME:
>>>
>>>   1)  The implementation of Perfume shall result
>>>   in three distinct Cocoon components:
>>>
>>>   a)  A generator that can receive a soap
>>>   message and turn it into an xml sax
>>>   stream.
>>
>> Why not use an Action? Then you could set sitemap variables, call 
>> other
>> actions, use an existing generator...
>
>   Please elaborate more here.  I've only written one action component 
> so far, that is used to set a sitemap
> variable. How would an action component take the place of a generator 
> component.

My first reason for not using a generator to handle the SOAP request is 
that it doesn't quite fit into the role of generators, I think the 
generator should be used to create the response.

But the real problem I see here is how to do something useful with the 
SOAP request. Once you receive the request you've go to do something 
with it. If all you have is a SOAPGenerator and a SOAPSerializer, then 
all you can so is put some transformers in between them to turn the 
request into a response. You wouldn't be able to do a whole lot unless 
you wrote your own transformer. With the built in transformers the most 
complex thing I could see doing in using an XSLTransformer and the an 
SQLTransformer to do a database lookup. If you want to perform some of 
the functions that are typically done with Actions or flowscript you'll 
need Actions.

If you had a SOAPAction though, you could take information about the 
soap request and place it into sitemap parameters, from there you could 
use those parameters with selectors to choose appropriate pieces of the 
pipeline.

It's kind of analogous to the difference between RequestGenerator and 
RequestParamAction. RequestGenerator is useful for using the request 
parameters and headers in the output, but RequestParamAction is what 
you normally use when you need to setup parts of your pipeline based on 
the request.

>>> b)  A serializer that can convert an xml
>>>   stream into a return soap message.
>>
>> Would the current XMLSerializer work for this? I'm not that familiar
>> with SOAP, but I was under the impression that it was xml documents
>> sent via HTTP.
>
>   This is an interesting question.  I have a sneaky feeling that
>   SOAP, especially originating from M$, has additional implied
>   requirements than simply XML (i.e. setting HTTP parameters).
>   It is just a suspicion at this point in time, and I'm hoping
>   some more experience developers can comment here.

I'm not aware of too many important HTTP response headers besides 
content-length, redirect-to, and mime-type. I'm not that knowledgeable 
about it though.

>>>   c)  A transformer that can act as a soap
>>>   client.  Incoming xml is transmitted
>>>   as a soap message, the pipe is blocked
>>>   until return or time out, and then the
>>>   received message is returned into the xml
>>>   sax stream.
>>
>> Sounds nice. You could keep the piece that transforms the sax stream
>> into soap separate from the soap client. That way you could just use 
>> an
>> xsl stylesheet, or any other transformer, to create the soap and it
>> would be more controllable by the end user.
>>
>> Another thought is to have a SOAPAction that does a similar thing, 
>> this
>> way you could receive a request, access a soap server, then setup the
>> pipeline based on the results of the soap request. And maybe there's
>> even a way to integrate this with flowscript so that flowscript can
>> perform actions based on incoming soap, or you could access a soap
>> service from within flowscript.
>
>   Where can I find out more about flowscript?

Got me. I followed the discussion of the dev list for a while, but I've 
never played with 2.1 and there's no doc that I've found yet. I guess 
download 2.1.

>>>   d)  It seems like the generator and serializer need
>>>   potentially an out-of-pipeline connection with
>>>   each other.  Or that some method of the 
>>> generator
>>>   conveying forward a soap related error to the
>>>   serializer is needed.
>>
>> If it was a soap action rather than generator it
> could set sitemap parameters, or fail.

>   An alternate strategy is to require certain xml fragment(s), like an
>   error structure, be propagated forward from the generator to the
>   serializer.  Both strategies seem to require some participation on
>   the user.  I'm wondering if there is a more robust strategy.

Marcus' reply to your post is interesting. Like I said, I don't know 
much about soap, but if the response needs to formatted acording to the 
request then some

Re: PERFUME PROPOSAL: SOAP FOR COCOON

2002-09-21 Thread Justin Fagnani-Bell


On Saturday, September 21, 2002, at 05:37  PM, Steven Punte wrote:

> PERFUME:
>
>   1)  The implementation of Perfume shall result
>   in three distinct Cocoon components:
>
>   a)  A generator that can receive a soap
>   message and turn it into an xml sax
>   stream.

Why not use an Action? Then you could set sitemap variables, call other 
actions, use an existing generator...

>   b)  A serializer that can convert an xml
>   stream into a return soap message.

Would the current XMLSerializer work for this? I'm not that familiar 
with SOAP, but I was under the impression that it was xml documents 
sent via HTTP.


>   c)  A transformer that can act as a soap
>   client.  Incoming xml is transmitted
>   as a soap message, the pipe is blocked
>   until return or time out, and then the
>   received message is returned into the xml
>   sax stream.

Sounds nice. You could keep the piece that transforms the sax stream 
into soap separate from the soap client. That way you could just use an 
xsl stylesheet, or any other transformer, to create the soap and it 
would be more controllable by the end user.

Another thought is to have a SOAPAction that does a similar thing, this 
way you could receive a request, access a soap server, then setup the 
pipeline based on the results of the soap request. And maybe there's 
even a way to integrate this with flowscript so that flowscript can 
perform actions based on incoming soap, or you could access a soap 
service from within flowscript.

>   2)  The intended usage is:
>
>   a)  If one wishes to implement a soap service,
>   a pipeline beginning with the generator
>   and ending with the serializer is
>   constructed.
>
>   b)  If one wishes to implement a soap client,
>   a pipeline with the transformer is constructed.
>
>   3)  Construction:
>
>   It seems to me there are really two fundamental
>   modules to this effort: a module that converts
>   a sax stream to HTTP-SOAP, and a module that
>   convert HTTP-SOAP to an xml sax stream.  Both
>   modules are used twice in the overall project,
>   both being used in the transformer component.
>
>   4)  Issues:
>
>   a)  First, how does this proposal sound to you?
>   Is this the type of soap implementation you
>   would like to see?
>
>   b)  Are any of the existing cocoon soap related
>   software suitably reusable and appropriate
>   here.
>
>   c)  Is apache soap/axis suitable for use here?
>   My preliminary examination of these packages
>   are they overlap too much with existing
>   cocoon to be easily integrated.
>
>   d)  It seems like the generator and serializer need
>   potentially an out-of-pipeline connection with
>   each other.  Or that some method of the generator
>   conveying forward a soap related error to the
>   serializer is needed.

If it was a soap action rather than generator it could set sitemap 
parameters, or fail.

>   e)  Should WSDL be incorporate into this proposal?
>   Please someone correct me if I'm wrong, but
>   don't WSDL and XmlSchema do almost the same
>   thing?  It seems like most of WSDL was a early
>   solution before XmlSchema became ready. I think
>   ebXml also makes no reference to WSDL.
>
>   f)  Should the soap-client transformer be able to
>   execute multiple soap request to different
>   services and not just one action?  Probably so.

You could chain the transformers, or use an aggregator for this.


--Justin


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




Using Cocoon via the command line?

2002-08-27 Thread Justin Fagnani-Bell

I can't find any documentation on this, but how do you use Cocoon from 
the command line? I've buit a site that's going to be hosted on a plain 
old webserver and need to export the cocoon generated pages. I've been 
doing this with GoLive's download site feature, but I know there's a 
better way. I can find info about the CocoonCrawler in the API docs, but 
no user documentation on this.

Can someone point me to the right place, or explain how it's used? I'd 
be willing to add something to the Cocoon Wiki about this.

Thanks,
   Justin


-
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 Justin Fagnani-Bell

Igor,

   I think you can do what you want with a map:aggregrate, but not in 
every pipeline. Try somehting like this:


   
 
 
   
   
   


This will match every url and then aggregate it with your other 
matchers. Then just have all your other matchers start with "part/".

Of course, I've never used views, so I don't really know if it's easier 
or even possible with them.

Justin

On Tuesday, August 20, 2002, at 07:10 AM, Per Kreipke wrote:

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


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


-
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: FP and Cocoon2

2002-08-17 Thread Justin Fagnani-Bell

Vadim, fp was in Cocoon 1.x. It's a forms processing logicsheet that 
will update xml files.

Dwayne, I don't think FP made it to Cocoon 2.

Justin

On Friday, August 16, 2002, at 12:52 PM, Vadim Gritsenko wrote:

> Dwayne Kemp wrote:
>
>> Im using Cocoon 2.0.3 with Tomcat 4.0.1.
>> I have this code in my file...
>>
>> 
>> 
>> 
>> 
>> 
>>
>
> What's 'fp'? If this is some logicsheet, what is namespace? Cocoon 
> 2.0.3 does not have any logicsheet with prefix 'fp' by default. If it 
> is your own logicsheet, then it's an issue with it.
>
> Vadim
>
>
>> 
>>
>> Cocoon processes this but will not add to the external-item
>> neither will the redirect work.


-
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: Can cocoon write pdf to a file?

2002-08-15 Thread Justin Fagnani-Bell

Because what happens when someone then wants to do the same thing with a 
GIF, or HTML, or SWF?

An action that writes any resource to a file can be reused in different 
circumstances.

Justin

On Thursday, August 15, 2002, at 01:46 PM, Argyn Kuketayev wrote:

> > I can't think of any way to do this with the included Cocoon
> > components,
>
> why not to change FOPSerializer?
>
> e.g. make it write the file on hard disk, then in the output stream 
> will be only the URL to that file?
>


-
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: Can cocoon write pdf to a file?

2002-08-15 Thread Justin Fagnani-Bell


On Thursday, August 15, 2002, at 10:53 AM, kyle koss wrote:

> Is it possible for Cocoon to do an XML+XSL -> PDF transformation, but 
> instead of serving the PDF into the browser, writing it to a file?
>
> What I would like to do is, take information entered into a form on a 
> jsp page, turn it into an XML file, and then apply my XSL to it to 
> produce a PDF which is then stored to disk on the server.
>
> Can this be done using Cocoon, or would it be easier to just use FOP 
> embedded in a servlet? If it can be done, what do I have to do?

I can't think of any way to do this with the included Cocoon components, 
but you could write an action that does this. Create a matcher that does 
the XML+XSL->PDF transformation, then in an action access the url for 
that matcher and saves to a file. I forget if action can access a 
pipeline with in an action with something like 
resolver.resolve("cocoon:/pdf"), if not you'll have to use the 
java.net.url classes.

You could also write an action that actually loads the file, performs 
the transformation, serializes to PDF and writes the file, all 
configurable by sitemap parameters, but the action that saves a url to a 
file seem more generally usable, it could be a good addition to Cocoon.

Justin


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




cocoon-users@xml.apache.org

2002-08-10 Thread Justin Fagnani-Bell

Hi again,

this is a long post 

   I'm still working on HTML forms where the user (me for the moment:) is 
supposed to input HTML into a text area that will be stored in an XML 
format. I'm still having problems, so I haven't written a SUMMARY post...

My new problem occurred last night when I'm testing the system and I put 
in an anchor tag with a url that has request parameters... like this:

http://www.something.net/apage.jsp?p1=hi&p2=bye";>link

Well, when I hit submit the form is supposed to come back filled out, 
but instead I get an error that states "the entity 'p2' must end with 
a ';'.

So I do some searching on on w3.org and sure enough URLs in XHTML have 
to use '&' instead of '&'. Arrgh, I know this will cause problems 
once people who are used to normal HTML start using this. I'm 
considering writing a filter that will escape illegal characters on the 
way in, and un-escape them going back to the user, but that seems like a 
bit of a pain and combined with the problems I'm having making people 
type XML compliant HTML in the first place I'm wondering if there's a 
completely different way I could do this.

I'm sure someone else out there has come across these problems before. 
It seems inevitable when building a webapp where users can edit some 
content, that uses XML on the backend. The users only marginally know 
HTML in the first place and can't be expected to always follow the rules 
correctly every time. The app after all, is supposed to be easy to use.

I would love to start some discussion on different ideas for handling 
these types of problems. They must be common among Cocoon users, and 
maybe we can come up with a set of solutions (HOW-TO's, Java helper 
classes, taglibs) to make life easier on Cocoon developers and end-users.

Here's my little list of requirements, issues, and assumptions when 
dealing with forms, user input, and xml.

1) My users are used to HTML, not XML
2) My users are not fail proof, and are probably prone to occasional 
mistakes
3) Ideally I want them to be able to input HTML(non XML compliant), 
plain text, or XML (not HTML, but any XML. this is actually preferred, 
but sometimes users are just entering a news item, or a BBS post, and it 
seems reasonable to allow them to use HTML for formatting rather than 
inventing my own xml dialect)
4) The data is going to be in an XML document/SAX stream at some point
   (either stored that way, or stored in a database and turned into xml 
through a generator)
5) sometimes I want to run xsl transformations on the data when it is 
output.
6) when editing the data, I'd like to have it appear exactly as the user 
typed
7) but i'd also like to have the ability to clean it up (as on option)
8) The browsers like HTML 4 much better than XHTML, therefore the pages 
I send them work better if I use the HTMLSerializer

Here are some problems I've encountered so far.

1) users don't follow XML rules very well (goes along with point 1)
2) the HTMLSerializer changes the users data by turning  into , 
etc
3) the XML Serializer changes the users data by turning 
 into , etc
4) bad user input will cause SAXExceptions if it's not enclosed in CDATA 
sections

(oh, to clarify here, I typically have two pages which show the data, 
one is the 'edit' page with the form, the other is where the data 
actually shows up, the 'viewing page', the HTMLserializer is no problem 
on the viewing page, just the editing page)

Some of these points interfere with some solutions. For example, I could 
wrap the data in a CDATA section to get around XML compliance, but then 
I wouldn't be able to run XSL transformations on it (correct me if I'm 
wrong anywhere). Maybe I could check if the data is xml compliant and 
wrap it only if it isn't.

Here are some ideas for solutions:

1) Create a new HTMLSerializer that can selectively determine which tags 
it will convert into HTML and which is will leave alone. This way you 
could specify that all textarea tags and their contents shouldn't be 
touched (I would think this would be a reasonable default feature anyway)
2) Create a jTidy like program that will turn HTML into XHTML, but work 
for fragments (jTidy seems to only output complete HTML documents)
3) Create a class that can find an XML error, and report it nicely back 
to the user so they can fix it. (I recall a demo with Cocoon 1.8.x that 
had something like this...)

Hmm, these three things might do it. the new serializer would work for 
editing, the Tidy-like class work work for either storing the data as 
xml, or just viewing it as xml. I think I have an idea on how to do the 
serializer, but it wouldn't rely on a transformer like the current one. 
I looked at the code for jTidy and there's a ton of classes, so I've yet 
to fully comprehend how it works, it might already be able to do what i 
want, and like I said I saw something similar to 3) a year or so ago...

ok, that's my thoughts...

Justin



---

Re: Keeping HTMLSerializer from altering markup?

2002-08-09 Thread Justin Fagnani-Bell

Hmmm... well I'm getting some strange things happening now. The cdata 
section is no longer working (i swear it worked :), and Chimera is not 
rendering things correctly anymore, it's acting like Mozilla.

When it was working the textarea tags were not escaped.

For now, I made a small hack (inserting some default text) so I can 
continue with my work and I'll revisit this ASAP.

Justin


On Friday, August 9, 2002, at 03:06 PM, Joerg Heinicke wrote:

> I wonder that this is working. The  will be 
> escaped because of CDATA section to <textarea></textarea> 
> when it's parsed and it shell be shown in the browser as text 
>  - but it should not work.
>
> That was what I expect. I tried to test it, but it was not possible for 
> me with the current Cocoon from CVS. In my sitemap there is written
>
> type="text/html" name="xhtml" pool-grow="2" pool-max="64" pool-min="2" 
> src="org.apache.cocoon.serialization.XMLSerializer">
>  -//W3C//DTD XHTML 1.0 Strict//EN
>  system>http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd
>  UTF-8
>  
>
>
> but every parameter is ignored: I get no doctype declarations and no 
> cdata sections (even when the comment  is removed).
>
> What's up with XMLSerializer??
>
> Regards,
>
> Joerg
>
>
>
> Justin Fagnani-Bell wrote:
>> Yes! finally.
>> Here's what I did. I added a  tag around my  tags in 
>> my stylesheet, then put > elements>cdata in my serializer definition. 
>> Now even when the textarea has no text the tag doesn't get touched. 
>> The browser just ignores the made up cdata tag and everythings fine.
>> I tried what you suggested, (adding > elements>textelement) but when the textarea 
>> contained just text (no markup) i'd get something like this: 
>> [CDATA[some text]] in the text field.
>> Thanks everyone.
>> --Justin
>
>
> -
> 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: Keeping HTMLSerializer from altering markup?

2002-08-09 Thread Justin Fagnani-Bell

Yes! finally.

Here's what I did. I added a  tag around my  tags in my 
stylesheet, then put cdata in my serializer definition. Now 
even when the textarea has no text the tag doesn't get touched. The 
browser just ignores the made up cdata tag and everythings fine.

I tried what you suggested, (adding textelement) but when the textarea 
contained just text (no markup) i'd get something like this: [CDATA[some 
text]] in the text field.

Thanks everyone.
--Justin


On Friday, August 9, 2002, at 07:57 AM, Geoff Howard wrote:

>> method, but what is cdata-section-elements? Could it be of use to me
>> here?
>
> cdata-section-elements is a declaration in xsl:output element of xsl 
> which
> allows you to cause the contents of an element to be surrounded by a
>  block, which causes the character data to pass through
> transformation untouched.  I use this when serializing page parts in XML
> that contain html and need further processing later.  Whether it will do
> what you want when used with HTMLSerializer I don't know, but it's 
> worth a
> shot.  Technically, the Serializer is only setting up the output method 
> of
> the xsl transformation engine (probably xalan, unless you've configured 
> it
> to use something else) and in XSL's view, cdata-section-elements is
> irrelevant to html output method.  Having said that, it will probably be
> dependant on the implementation and might work.  If you modify your
> serializer definition to the following:
>
>  src="org.apache.cocoon.serialization.HTMLSerializer">
>textarea
> 


-
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: Keeping HTMLSerializer from altering markup?

2002-08-09 Thread Justin Fagnani-Bell

Thanks for the replies guys, unfortunately I'm still kinda stuck.

I tried the xhtml serializer (which is really an xml serializer) and the 
xml serializer They almost work, but not quite. First, Mozilla 1.0 won't 
render tables correctly ( bgcolor attribute, though Chimera renders 
fine) for some reason. More importantly they turn an empty set of tags 
(ie. ) into one tag () which is fine for 
most tags, but for textarea (in Mozilla at least) it causes the text 
field to be filled with the contents of the html file after the 
 tag to the end of file.

I'm not sure whether  is correct in XHTML. If it's not then 
this could probably be called a bug in an xhtml serializer, even though 
this makes sense in terms of xml. If it is correct (which i suspect) 
then it's a bug in Mozilla. Either way it's a PITA.

One solution might be to turn off combining empty tags in the xml 
serializer. Is there a way to do this? There's no docs on the 
cofiguration parameters for any of the serializers, and I'm a little 
confused by the source. It looks like XMLSerializer, and HTMLSerializer 
(through AbstractTextSerializer) get a transformer to do the conversion, 
and pass a bunch of parameters to it. I assume method is the xslt output 
method, but what is cdata-section-elements? Could it be of use to me 
here?

Another thing I tried was using a TextSerializer, with the mime-type set 
to text/html. I figured that for text output it wouldn't mess with the 
tags, only problem was that mozilla wouldn't render any of the tags, 
just the text. This is probably because of a namepsace or dtd issue and 
I'm gonna try to fix it.

Justin

oh yeah, on more thing that may be important. I'm using cocoon 2.0.1. It 
didn't include an xhtml entry in  so I copied it from 
2.0.3. If the serializers behave differently that could be an issue, but 
I don't think I can upgrade right now. I'll see.

On Friday, August 9, 2002, at 12:42 AM, KOZLOV Roman wrote:

> Hi,
>
> Just a question, if XHTML is XML then is it possible to use XML 
> serializer?
> If not, why?
>
> Roman
>
> Vadim Gritsenko wrote:
>
>>> From: Justin Fagnani-Bell [mailto:[EMAIL PROTECTED]]
>>>
>>> Hi list,
>>>
>>>   I have a page with a form generated by Cocoon. There's a textarea in
>>> the form where you can edit some xml (possibly xhtml). Because the
>> form
>>> is an HTML form I'm using an HTMLSerializer. But I want to keep the
>>> serializer from altering the markup in the textarea, because if it's
>>> xhtml content it will turn 's into 's. Then when the text is
>>> saved and you visit the form again, or view the page the text is on, I
>>> get a parsing error.



>> Try xhtml serializer, it comes with default sitemap.
>>
>> Vadim
>>


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




Keeping HTMLSerializer from altering markup?

2002-08-08 Thread Justin Fagnani-Bell

Hi list,

  I have a page with a form generated by Cocoon. There's a textarea in 
the form where you can edit some xml (possibly xhtml). Because the form 
is an HTML form I'm using an HTMLSerializer. But I want to keep the 
serializer from altering the markup in the textarea, because if it's 
xhtml content it will turn 's into 's. Then when the text is 
saved and you visit the form again, or view the page the text is on, I 
get a parsing error.

My xml fil looks somethng like this:


   
 
   Here's some text that will get messed up by HTMLSerializer
   
   Then I'll get an error.
 
   


I use an xslt template to turn this into my form that looks likt this:




I've tried a few things with no luck so far. I added a 
xmlns="http://www.w3.org/1999/xhtml"; attribute to the text element 
hoping that HTMLSerializer would then leave it alone, but my stylesheet 
won't copy the text now. I tried copying the xml serializer component in 
, renaming it "xhtml" and changing the mime-type to 
text/html, but the browser wouldn't render it.

(Along a similar line, I was trying to use jTidy to turn html into 
xhtml, in case the user didn't enter well-formed xml. But I'm dealing 
with html fragments and jTidy kept wraping everything in , 
etc...)

Any ideas?

Thanks,
   Justin


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




Initialization and background threads

2002-08-01 Thread Justin Fagnani-Bell

Hi List,

   The web app I'm developing with Cocoon needs to initialize a few 
things at startup and perform some tasks in the background like database 
cleanup, checking for mail, automating site updates. Is there a good way 
to integrate this with Cocoon?

For the initialization, I'm reading in an XML file to create resources 
available to my Cocoon components. I'd like to use the same parser 
configured for Cocoon. I've though about adding something like this to 
cocoon.xconf:


   load-class
   MyClass


and using a static initializer to perform the initialization and start 
the background thread, but I don't see how I could get access to the 
Cocoon environment. I'd like to be able to access components and 
resources through Cocoon.

Thanks,
   Justin


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

2002-08-01 Thread Justin Fagnani-Bell

Thanks,

> The sessionMode variable is particularly poorly documented and, if true,
> simply means that the session id will be appended to the URI.
>
> Regards,
> Sterling

If I'm using cookies for session management will it just maintain the 
session if sessionMode=true, or is sessionMode only for
URL encoded sessions?

Justin

> On Thu, 2002-08-01 at 10:47, Justin Fagnani-Bell wrote:
>> Is there any documentation on how to use either the Redirector passed 
>> to
>> Action.act() or the sitemap  tag? I've used 
>> redirect-to
>> successfully but I would still like some documentation to make sure I'm
>> doing things correctly. I can't find anything in the cocoon docs and 
>> the
>> api docs don't say much.
>>
>> I'd also like to use the Redirector object in Action, and I assume it
>> works the same (or that the class implementing the tag is a 
>> Redirector),
>> but I'd like to know more. What does sessionmode do?
>>
>> Any suggestions?
>>
>> Thanks,
>>Justin


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




How to use Redirector...

2002-08-01 Thread Justin Fagnani-Bell

Is there any documentation on how to use either the Redirector passed to 
Action.act() or the sitemap  tag? I've used redirect-to 
successfully but I would still like some documentation to make sure I'm 
doing things correctly. I can't find anything in the cocoon docs and the 
api docs don't say much.

I'd also like to use the Redirector object in Action, and I assume it 
works the same (or that the class implementing the tag is a Redirector), 
but I'd like to know more. What does sessionmode do?

Any suggestions?

Thanks,
   Justin


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