cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From solprovi...@apache.org
Subject Re: Protocols in Cocoon
Date Mon, 03 Mar 2008 00:54:57 GMT
You should not need to read Java source code.  Although many of the
protocols are missing explanations in the class API, the purpose of
each class can usually be discovered by reading the explanations of
the constructors.

All "Protocol Handlers" or "Source Factories" must be specified in the
<source-factories> element in:
FILE: build/webapp/WEB-INF/cocoon.xconf
Each  <component-instance> child element specifies the protocol in the
"name" attribute and the Java handler in the "class" attribute.  By
convention, the handler classes are called SomethingSourceFactory.
SourceFactories must return a Source; most return either a Source of
the same name as the Factory or one of the standard Excalibur Sources
e.g. FileSource or URLSource.

You should open cocoon.xconf to discover which protocols are currently
available and to add protocols.  Note the final entry with attribute
name="*" is used for Source requests using protocols not specified in
the file.  The default is URLSourceFactory which tries:
1. If protocol is "file:", create a FileSource.
2. Try to create a URLSource using java.net.URL.
3. If step 2 fails with MalformedURLException, try to create a FileSource.
Note this last step can cause errors on Microsoft Windows due to the
prefix before the colon (specifying the drive letter) being
interpreted as both the protocol and part of the address.
"C:\temp\example.xml" is assigned the protocol scheme "C" so
Source.getURI() returns "C://C:/temp/example.xml" rather than the
correct URI "file://C:/temp/example.xml".  The workaround is to always
specify the file: protocol.

Someone else should comment about Cocoon-2.2.  The Windows bug is in
Exclaibur's trunk and is likely to affect Cocoon-2.2.

solprovider

On 3/2/08, Mansour <mansour77@yahoo.com> wrote:
> thank you for your reply. Where can I find the ones in Cocoon2.2 and in
>  Cocoon 2.1 . How can I tell.
>  Do I have to read the source code to find out?
>
>  Alexander Daniel wrote:
>  > On 24.02.2008, at 06:30, Mansour wrote:
>  >> Is there a full documentation about all the protocols available in
>  >> Cocoon. I couldn't find any document on the Cocoon web site about
>  >> this subject. Protocols I am aware of:
>  >> implicit.
>  >> block:
>  >> blockcontext:
>  >> context:
>  >> resource:
>  >> servlet:
>  >> cocoon:
>  >>
>  >> I don't know what is the difference between each of them. Where can I
>  >> get this info?
>  >
>  > Unfortunately I am not aware of any full documentation of all the
>  > protocols. Some information can be found in the Cocoon Wiki [1].
>  >
>  > The Cocoon 2.1.11 samples configure following protocols in
>  > cocoon.xconf: all JDK standard protocols (e.g. http), blob, cached,
>  > cocoon, context, coplet, empty, file, module, qdox, repository,
>  > resource, slide, upload, webdav, xmldb, xmodule, zip. Javadocs for
>  > most of these can be found at [2].
>  >
>  > I assume that block, blockcontext and servlet were introduced with
>  > Cocoon 2.2.
>  >
>  > Alex
>  > [1] http://wiki.apache.org/cocoon/Protocols
>  > [2] http://cocoon.apache.org/2.1/apidocs/org/apache/cocoon/components/source/impl/package-summary.html

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


Mime
View raw message