Re: Strange encoding problem using forms

2010-02-11 Thread Dominic Mitchell
On Thu, Feb 11, 2010 at 6:40 AM, Jos Snellings jos.snelli...@pandora.bewrote:

 The two tomcat versions on the machines are the same, but, can you
 please make a diff between the two server.xml under $CATALINA_HOME/conf?
 Just to be sure ...


The other thing to check are the system properties file.encoding and
sun.jnu.encoding.  I have seen the JVM take different values for
file.encoding depending on how it was started (by hand vs startup scripts).
You should be able to verify them using the StatusGenerator.

-Dom


Re: Notes on getting Cocoon 3.0.0-alpha-2 sample app running

2010-01-29 Thread Dominic Mitchell
You may want to look into getting nexus set up in order to avoid these kind
of problems. You can create a repository group which includes both central
and java.net. As a bonus you should see faster build times.

http://nexus.sonatype.org/

-Dom

On 28 Jan 2010 14:25, David Legg david.l...@searchevent.co.uk wrote:

Here are some notes I made while trying to get started with the Cocoon 3
alpha 2 sample apps running under Windows XP using Maven.

Hopefully it might help others like me starting down the C3 road and serve
as a record of the corrections needed to the current documentation ;-)

The place to go for documentation on running the sample apps is the Cocoon 3
download page [1].  The simplest way to get the sample app up and runnning
is to use Maven to do the heavy lifting.  As the documentation mentions
under the 'Maven 2 archetypes' heading you have to type the following line
to create the sample block: -

 mvn org.apache.maven.plugins:maven-archetype-plugin:1.0-alpha-7:create

  -DarchetypeGroupId=org.apache.cocoon.archetype-sample
-DarchetypeArtifactId=cocoon-archetype-sample
-DarchetypeVersion=3.0.0-alpha-2   -DgroupId=com.mycompany
-DartifactId=mysample
Note: you have to place everything on one line before pasting it into a
windows DOS box or else only the first line will get executed.

This should proceed correctly and a new directory will appear called
'mysample' which you should change into for the next part.

I tried typing 'mvn jetty:run' to execute the sample app but I kept getting
a couple of Maven dependency errors: -

 com.sun.jersey:jersey-core:jar:1.0.3
 com.sun.jersey:jersey-server:jar:1.0.3

Never having heard of Jersey[2] before (the new Restful API reference
implementation and not the place or the item of clothing!) I looked it up
and noticed the dependencies page[3] which led me to add the following to
the pom.xml file just below the packaging tag: -

repositories
 repository
  idmaven2-repository.dev.java.net/id
  nameJava.net Repository for Maven/name
  urlhttp://download.java.net/maven/2//url
  layoutdefault/layout
 /repository  repository
  idmaven-repository.dev.java.net/id
  nameJava.net Maven 1 Repository (legacy)/name
  urlhttp://download.java.net/maven/1/url
  layoutlegacy/layout
 /repository
/repositories

After this I could successfully run the sample app... but only after looking
in the correct URL ;-)  The documentation[1] gives the wrong one.  The Jetty
server is set up to actually run at http://localhost:

Hope this helps.

Regards,
David Legg


[1] http://cocoon.apache.org/3.0/download.html
[2] https://jersey.dev.java.net/
[3]
https://jersey.dev.java.net/source/browse/*checkout*/jersey/tags/jersey-1.0.3/jersey/dependencies.html

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


Re: character encoding of a HttpServletRequest

2010-01-11 Thread Dominic Mitchell
2010/1/10 Jos Snellings jos.snelli...@pandora.be

 This is not a specific cocoon issue, I believe. It probably has to do
 with Tomcat 5.5.27.
 request.setCharacterEncoding simply does not work; it does not change a
 thing.
 request.getCharacterEncoding returns nothing.


You have to call request.setCharacterEncoding() really early for it to have
any impact.  Your best bet is to look at spring's CharacterEncodingFilter.
You can add that to your web.xml to get the character set defined very early
on.

-Dom


Re: character encoding of a HttpServletRequest

2010-01-11 Thread Dominic Mitchell
On Mon, Jan 11, 2010 at 9:12 AM, Jos Snellings jos.snelli...@pandora.bewrote:

 Thanks, I will try CharacterEncodingFilter!
 I will lookup in the code were filtering takes place, because the
 problem is rather that it looks like the form data are filtered twice.

 In addition, do I remember right that there used to be a cocoon servlet
 setting,
init-param
param-nameform-encoding/param-name
param-valueUTF-8/param-value
/init-param

 Cheers, thanks for the hint. I will post the result... I will certainly
 not be the only person who is confronted with this problem.


There are so many places to set the encoding.  And just for fun, you can
have different encodings for query string parameters and form-data in the
body in the same request.  Sigh.

I've had good luck with
CharacterEncodingFilterhttp://static.springsource.org/spring/docs/2.5.6/api/org/springframework/web/filter/CharacterEncodingFilter.htmlthough.

-Dom


Re: character encoding of a HttpServletRequest

2010-01-11 Thread Dominic Mitchell
On Mon, Jan 11, 2010 at 10:34 AM, Jos Snellings jos.snelli...@pandora.bewrote:

 That is right!
 It is just a confusing situation :-(
 The filter works fine. The init() method of a generator does not give a
 chance to call setCharacterEncoding, as the parsing already happened.
 The good thing is that the code is already in spring, so, no new
 external dependencies. Maybe later on I add a
 tryToGuessEncodingFilter.


Trying to guess encodings isn't a good idea, in general.  About the only one
that can be reliably detected is UTF-8.  In past projects, I've done
something like this:

  String result;
  try {
result = new String(someBytes, UTF-8);
  catch (EncodingError e) {
result = new String(someBytes, Windows-1252);
  }

In my experience, Windows-1252 was a better guess than ISO-8859-1, as users
tend to paste in stuff from word documents with curly quotes.

-Dom


Re: problem showing pdf as text/plain with resourcereader

2009-12-29 Thread Dominic Mitchell
On Tue, Dec 29, 2009 at 10:16 AM, joao tiago a. m. viegas 
jtvie...@gmail.com wrote:

 oh thank you, but I'm not, if you'd read the message till the end you'd see
 there's:


 and if in the javascript function i change the function invocation for
 cocoon.processPipelineTo(pagesave,null,nullos);
 i get
 processPipelineTo is not a function


Doh.  Sorry.  I did miss that.  According to an example in the cocoon source
(sendpage.jshttp://svn.apache.org/repos/asf/cocoon/trunk/blocks/cocoon-core-sample/cocoon-core-main-sample/src/main/resources/COB-INF/flow/test/sendpage.js),
that is the correct invocation.  The only thing that might make a difference
is the type of nullos.  In the example, it's
org.apache.cocoon.util.NullOutputStream, whereas in your code it's
org.apache.cocoon.ant.NullOutputStream.  That may cause rhino to not
correctly match the method you're expecting.

One more thing to note: the example you post doesn't end in a call to
cocoon.sendPage(), so you'll likely get nothing coming back to the browser,
or an error.  Not sure which.

-Dom


Re: problem showing pdf as text/plain with resourcereader

2009-12-28 Thread Dominic Mitchell
On Thu, Dec 24, 2009 at 7:20 AM, joao tiago a. m. viegas jtvie...@gmail.com
 wrote:

 i want to wish everybody an Happy Christmas and an Astounding Happy New
 Year.

 in the meantime, somewhere in the lower left corner of Europe, in a cocoon
 2.1,

 i'm still on the flowscript issue and i can't figure out what is wrong with
 my code:

- i have this block inside the components section in the sitemap

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

- then i have this match

 map:match pattern=page.pdf
map:call function=invoicecontroller /
 /map:match

- and then i have this javascript file in javascript/flow.js with a
function

 function invoicecontroller()
 {
var nullos = new Packages.org.apache.cocoon.ant.NullOutputStream();
 processPipelineTo(pagesave,null,nullos);
 }

 ..now all i get is
 processPipelineTo is not defined.

 and if in the javascript function i change the function invocation for
 cocoon.processPipelineTo(pagesave,null,nullos);

 i get
 processPipelineTo is not a function

 can anybody tell me what am i missing here?


You're missing a cocoon. -- there's no global function called
processPipelineTo(), but there is one in the cocoon object.

-Dom


Re: Exception thrown by Cocoon

2009-12-13 Thread Dominic Mitchell
On Mon, Dec 14, 2009 at 3:40 AM, Chipmuns chipm...@gmail.com wrote:


 Hi , Could anyone help me on the exception thrown ? Have being try to trace
 what is the cause but cant pinpoint the real problem. Suspect could it be
 caused by tcp connection

 ClientAbortException:  java.net.SocketException: Broken pipe


That means the other end closed the connection before tomcat was done
writing to it.  The classic case of this is somebody hitting the “stop”
button in the browser.

-Dom


Re: Add custom servlet on cocoon 2.2.0 startup

2009-11-24 Thread Dominic Mitchell
2009/11/24 Gintare Ragaisiene gintare.ragaisi...@gmail.com

 Hi,

I need to initialize a servlet like

 public class TestServlet extends HttpServlet{

 @Override
 public void init(ServletConfig config) throws ServletException {
 super.init(config);

 System.out.println(TestServlet);
 }

 }

 on cocoon 2.2 startup.

 Some servlets is set up in cocoon_home/target/rct/webapp/WEB-INF/web.xml.
 If I edit that web.xml to add servlet, after server restart input disappear.


I *think* that you need to make your servlet into a Spring bean.  If you add
to your existing META-INF/cocoon/spring/servlet-service-framework.xml file:

  bean name=myservlet class=com.example.MyServlet
servlet:context mount-path=/myBlock1
context-path=blockcontext:/myBlock1//
  /bean

It may work.  I'm not too familiar with the servlet service framework, and I
haven't tested this.  :-(

-Dom


Re: [2.2] Configure logging for tests

2009-11-23 Thread Dominic Mitchell
On Mon, Nov 23, 2009 at 3:41 PM, Andreas Hartmann andr...@apache.orgwrote:

 Hi everyone,

 I'm using Cocoon 2.2.
 How do I configure the logging output for my unit tests?

 This tutorial helped me a lot for the web application, but it doesn't seem
 to work for the tests …
 http://happygiraffe.net/blog/2008/08/27/logging-in-cocoon-22/

 Thanks a lot for any hints!


That's because the tests aren't run inside a jetty container.  They're just
run inside JUnit.

The easiest way that I've found in the past is to create a file
src/main/resources/log4j.properties with the desired test logging setup.
 When the tests fire up, log4j auto-detects it because it'll be at the root
of the classpath.

If that fails, there are other options:

   - Set up a base class for all your tests, which has a setUp() which
   invokes 
PropertyConfigurator.configure(…)http://logging.apache.org/log4j/1.2/apidocs/org/apache/log4j/PropertyConfigurator.html#configure(java.lang.String)
   .
   - Set up maven to invoke the tests in a forked JVM, and pass in the
   log4j.configuration system property.  Look at the docs for the surefire
   
pluginhttp://maven.apache.org/plugins/maven-surefire-plugin/examples/system-properties.html
   .

-Dom


Re: Samples for Cocoon 2.2

2009-11-11 Thread Dominic Mitchell
On Wed, Nov 11, 2009 at 12:22 AM, Kamal Bhatt bh...@tt.com.au wrote:

  Hang on, when did Cocoon started being hosted on Git?  I was going to make
 the same suggestion with SVN:


 http://svn.apache.org/repos/asf/cocoon/tags/cocoon-2.2/cocoon-forms/cocoon-forms-1/cocoon-forms-sample/

 Which is where the website says the code is.


Sorry — it's not hosted on git.  It's just a git mirror of the svn code
base.  I mentioned it because you get a full history in about the same
amount of time as an svn checkout.

-Dom


Re: Samples for Cocoon 2.2

2009-11-10 Thread Dominic Mitchell
On Tue, Nov 10, 2009 at 7:19 PM, Peter Hargreaves pe...@pdh-online.infowrote:

 Hi Folks,

 I've followed the 2.2 tutorials and eventually came to this comment To
 have a
 feel for the power of CForms, take a look at the examples included included
 in the Forms block.

 I simply can't find out how to do this, I can't find out how to look at any
 samples under 2.2

 Assuming I'm just blind - could someone please give me a link or explain
 how
 best to explore the samples/examples when starting with 2.2


You have to download the cocoon 2.2 source code and build it yourself.  I
reckon that the easiest way to do so is to git clone git://
git.apache.org/cocoon.git and then ./build.sh  ./cocoon.sh.  That will
build, install and run the samples.

-Dom


Re: Deploying Cocoon 2.2 to tomcat

2009-11-04 Thread Dominic Mitchell
On Wed, Nov 4, 2009 at 10:34 AM, Glen Robson glen.rob...@llgc.org.ukwrote:

 I'm trying to deploy cocoon to tomcat but I seem to be getting a conflict
 with the packaging type and maven. If I want the cocoon RCL plugin to run
 then the package type needs to be jar but if I want to deploy to tomcat the
 package type needs to be war (in the pom.xml). I can get the code working if
 I use jetty as it doesn't seem to require a war package. The results after
 running mvn package with the package type set to war:


You need two modules: one for the block and one for the webapp (you will
probably also want a third, parent module to build them all in one shot).

Don't try to edit the block's and set it's packaging to a war.  This simply
won't work, as you've seen.  if you have a look at the tutorials, pay
particular attention to the last one on
deploymenthttp://cocoon.apache.org/2.2/1362_1_1.html
.

Using the cocoon-maven-plugin and jetty:run is (as far as I can see)
development time only.

-Dom


Re: User file uploads

2009-10-06 Thread Dominic Mitchell
On Mon, Oct 5, 2009 at 2:36 PM, Peter Flynn pfl...@ucc.ie wrote:

 I have a requirement for some of my users to upload documents to a Cocoon
 server. The files need to be managed by Apache and Tomcat afterwards, so
 using FTP/sftp won't work because those files will be owned by the user's
 userid, and I'd prefer not to start messing with the groups.

 There are a gazillion upload scripts in PHP, Java, Flash, Perl, etc, but
 before I reinvent any wheels, does anyone know of an upload facility written
 for a Cocoon server?


Cocoon does have upload handling facilities.  There are a couple, but last
time I needed to manage uploads, I used the *upload://formField* source,
which seemed to work well.  I believe that there's an example if you check
out the source and build the sample webapp.  Look in:

http://svn.apache.org/repos/asf/cocoon/trunk/blocks/cocoon-core-sample/cocoon-core-main-sample/src/main/resources/COB-INF/sources/

-Dom


Re: Where are {defaults:} set in cocoon 2.2

2009-09-26 Thread Dominic Mitchell
On Sat, Sep 26, 2009 at 7:06 PM, Steven D. Majewski sd...@virginia.eduwrote:

 Where are defaults set for the {defaults:} input module, now
 that there is no cocoon.xconf ?


Looking through the source code, I'd guess that you need to stuff something
like this into src/main/resources/META-INF/cocoon/avalon/defaults.xml:

components
  input-modules
component-instance
name=defaults
class=org.apache.cocoon.components.modules.input.DefaultsModule
  values
skindefaultSkin/skin
base-urlhttp://localhost:8080/cocoon/base-url
  /values
/component-instance
  /input-modules
/components


-Dom


Re: problems with Getting Started 2.2 [was: Starting out with Cocoon 2.2]

2009-09-23 Thread Dominic Mitchell
On Tue, Sep 22, 2009 at 9:58 PM, Steven D. Majewski sd...@virginia.eduwrote:

 We've been using Cocoon 2.1.* for some time now, but we haven't really been
 doing a proper build.
 We've been building the sample app, and using that as a development base,
 adding new pipelines
 and sitemaps, and eventually, removing the samples directory before
 deploying.

 I've started to look at 2.2, thinking it made more sense to learn the 2.2
 build process
 with Maven that to continue on 2.1, but I'm having so many problems just
 getting the
 getting started to work, that I'm having second thoughts.


Getting a good handle on maven is very useful, and will pay off not just for
Cocoon apps, but also for any other Java projects where you need a good
build system.

I recommend checking out Sonatype's “definitive guide to maven”:
http://www.sonatype.com/books/maven-book/reference/

I've gotten as far as Deploying a Cocoon application :
http://cocoon.apache.org/2.2/1362_1_1.html

 But I had to add a few extra maven steps to get that far.


  I had to do a 'mvn package' on myBlock1  myBlock2 to get the jars built,
  so that later do 'mvn install:install-file ... -Dfile=... '  to manage
  to get 'mvn jetty:run' to work without error.
  Perhaps these differences from the documented steps are due to Mac OS 10.5
  having a newer version of Maven installed:


Instead of mvn package you need to do mvn install.  That will tale care
of installing everything to your local repository automatically.
 install:install-file is only needed for 3rd party things that aren't in a
repository.

In fact, I've just realised that using install:install-file is the root
cause of your problems below.  I'm guessing that you only installed the jar
files, not the pom files.  Because of that, maven doesn't know about the
dependencies of the block when you try to pull them together in the webapp.
 Which is why you get the ClassNotFoundException below.


 mvn --version


 Apache Maven 2.2.0 (r788681; 2009-06-26 09:04:01-0400)
 Java version: 1.5.0_20
 Java home: /System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home
 Default locale: en_US, platform encoding: MacRoman
 OS name: mac os x version: 10.5.8 arch: i386 Family: unix


 Now, I'm up to trying to join the 2 blocks in a webapp.
 After adding the block dependencies to my pom.xml, 'mvn jetty:run' gives
 this warning:

 Could not instantiate listener
 org.springframework.web.context.ContextLoaderListener
 java.lang.ClassNotFoundException:
 org.springframework.web.context.ContextLoaderListener
 [ ... stack trace ... ]


 Searching the mailing list archives, I see this error mentioned as a result
 if you
 DON'T add block dependencies to an empty webapp, but I have added these
 dependencies
 to pom.xml ( and I've 'mvn install' -ed  myBlock1  myBlock2 )


  dependencies

dependency
groupIdedu.virginia.lib/groupId
artifactIdmyBlock1/artifactId
version1.0-SNAPSHOT/version
/dependency
dependency
groupIdedu.virginia.lib/groupId
artifactIdmyBlock2/artifactId
version1.0-SNAPSHOT/version
/dependency

  /dependencies



 Any idea about what else I'm missing ?


My first question would have been: are the dependencies correct?  What
happens if you run mvn dependency:tree in the webapp?  It should include
spring dependencies.

If it helps, I completed the tutorials and put them in github.  So you can
take a look and see what worked for me.

  http://github.com/happygiraffe/cocoon-sample


 Is the cocoon 2.2 documentation all wrong ?
 Or are these differences due to changes in maven and it's defaults ?


-Dom


Re: problems with Getting Started 2.2 [was: Starting out with Cocoon 2.2]

2009-09-23 Thread Dominic Mitchell
On Wed, Sep 23, 2009 at 8:22 AM, Dominic Mitchell d...@happygiraffe.netwrote:

 My first question would have been: are the dependencies correct?  What
 happens if you run mvn dependency:tree in the webapp?  It should include
 spring dependencies.


For reference, this is what I get when running mvn dependency:tree on the
webapp from the tutorial.

[INFO] [dependency:tree {execution: default-cli}]
[INFO] com.mycompany:myCocoonWebApp:war:1.0-SNAPSHOT
[INFO] +- com.mycompany:myBlock1:jar:1.0-SNAPSHOT:compile
[INFO] |  +- org.apache.cocoon:cocoon-core:jar:2.2.0:compile
[INFO] |  |  +-
org.apache.cocoon:cocoon-spring-configurator:jar:1.0.2:compile
[INFO] |  |  |  +- org.springframework:spring-core:jar:2.5.1:compile
[INFO] |  |  |  +- org.springframework:spring-context:jar:2.5.1:compile
[INFO] |  |  |  |  \- aopalliance:aopalliance:jar:1.0:compile
[INFO] |  |  |  +- org.springframework:spring-beans:jar:2.5.1:compile
[INFO] |  |  |  +- org.springframework:spring-aop:jar:2.5.1:compile
[INFO] |  |  |  \- org.springframework:spring-web:jar:2.5.1:compile
[INFO] |  |  +- org.apache.cocoon:cocoon-configuration-api:jar:1.0.2:compile
[INFO] |  |  +-
org.apache.cocoon:cocoon-pipeline-components:jar:1.0.0:compile
[INFO] |  |  |  +- org.apache.cocoon:cocoon-pipeline-impl:jar:1.0.0:compile
[INFO] |  |  |  |  +-
org.apache.cocoon:cocoon-pipeline-api:jar:1.0.0:compile
[INFO] |  |  |  |  |  \-
org.apache.excalibur.components:excalibur-xmlutil:jar:2.2.1:compile
[INFO] |  |  |  |  +-
org.apache.excalibur.containerkit:excalibur-instrument-api:jar:2.2.1:compile
[INFO] |  |  |  |  \- jakarta-regexp:jakarta-regexp:jar:1.4:compile
[INFO] |  |  |  +- org.apache.cocoon:cocoon-util:jar:1.0.0:compile
[INFO] |  |  |  \- org.apache.cocoon:cocoon-xml-api:jar:1.0.0:compile
[INFO] |  |  +- org.apache.cocoon:cocoon-sitemap-impl:jar:1.0.0:compile
[INFO] |  |  |  +- org.apache.cocoon:cocoon-sitemap-api:jar:1.0.0:compile
[INFO] |  |  |  +- commons-collections:commons-collections:jar:3.2:compile
[INFO] |  |  |  \- commons-jxpath:commons-jxpath:jar:1.2:compile
[INFO] |  |  | \- junit:junit:jar:3.8:compile
[INFO] |  |  +-
org.apache.cocoon:cocoon-sitemap-components:jar:1.0.0:compile
[INFO] |  |  +- org.apache.cocoon:cocoon-xml-resolver:jar:1.0.0:compile
[INFO] |  |  |  \- org.apache.cocoon:cocoon-xml-impl:jar:1.0.0:compile
[INFO] |  |  +- org.apache.cocoon:cocoon-thread-api:jar:1.0.0:compile
[INFO] |  |  |  \- concurrent:concurrent:jar:1.3.4:compile
[INFO] |  |  +- org.apache.cocoon:cocoon-xml-util:jar:1.0.0:compile
[INFO] |  |  +-
org.apache.excalibur.components:excalibur-pool-api:jar:2.2.1:compile
[INFO] |  |  |  \-
org.apache.avalon.framework:avalon-framework-api:jar:4.3.1:compile
[INFO] |  |  +-
org.apache.excalibur.containerkit:excalibur-logger:jar:2.2.1:compile
[INFO] |  |  +-
org.apache.excalibur.components:excalibur-store:jar:2.2.1:compile
[INFO] |  |  +-
org.apache.avalon.framework:avalon-framework-impl:jar:4.3.1:compile
[INFO] |  |  +- commons-io:commons-io:jar:1.3.1:compile
[INFO] |  |  +- commons-logging:commons-logging:jar:1.1:compile
[INFO] |  |  +- commons-jexl:commons-jexl:jar:1.0:compile
[INFO] |  |  +- xalan:xalan:jar:2.7.0:compile
[INFO] |  |  +- xerces:xercesImpl:jar:2.8.1:compile
[INFO] |  |  +- xml-apis:xml-apis:jar:1.3.02:compile
[INFO] |  |  +- xml-resolver:xml-resolver:jar:1.2:compile
[INFO] |  |  +- log4j:log4j:jar:1.2.14:compile
[INFO] |  |  +- org.apache.cocoon:cocoon-store-impl:jar:1.0.0:runtime
[INFO] |  |  |  \- net.sf.ehcache:ehcache:jar:1.2.4:runtime
[INFO] |  |  \- org.apache.cocoon:cocoon-thread-impl:jar:1.0.0:runtime
[INFO] |  +-
org.apache.cocoon:cocoon-servlet-service-components:jar:1.0.0:compile
[INFO] |  |  +-
org.apache.cocoon:cocoon-servlet-service-impl:jar:1.0.0:compile
[INFO] |  |  |  \-
org.apache.excalibur.components:excalibur-sourceresolve:jar:2.2.3:compile
[INFO] |  |  \- org.apache.cocoon:cocoon-linkrewriter-impl:jar:1.0.0:compile
[INFO] |  +- org.apache.cocoon:cocoon-template-impl:jar:1.1.0:compile
[INFO] |  |  +-
org.apache.cocoon:cocoon-expression-language-api:jar:1.0.0:compile
[INFO] |  |  \-
org.apache.cocoon:cocoon-expression-language-impl:jar:1.0.0:compile
[INFO] |  | \- commons-lang:commons-lang:jar:2.3:compile
[INFO] |  +- org.apache.cocoon:cocoon-flowscript-impl:jar:1.0.0:compile
[INFO] |  |  \- rhino:js:jar:1.6R7:compile
[INFO] |  \- org.apache.cocoon:cocoon-fop-impl:jar:1.0.0:compile
[INFO] | +- fop:fop:jar:0.20.5:compile
[INFO] | \- org.apache.cocoon:cocoon-batik-impl:jar:1.0.0:compile
[INFO] |+- batik:batik-awt-util:jar:1.6-1:compile
[INFO] |+- batik:batik-bridge:jar:1.6-1:compile
[INFO] |+- batik:batik-css:jar:1.6-1:compile
[INFO] |+- batik:batik-dom:jar:1.6-1:compile
[INFO] |+- batik:batik-ext:jar:1.6-1:compile
[INFO] ||  \- xml-apis:xmlParserAPIs:jar:2.0.2:compile
[INFO] |+- batik:batik-extension:jar:1.6-1:compile
[INFO] |+- batik:batik-gui-util:jar:1.6-1:compile
[INFO] |+- batik:batik-gvt:jar:1.6

Re: problems with Getting Started 2.2 [was: Starting out with Cocoon 2.2]

2009-09-23 Thread Dominic Mitchell
On Wed, Sep 23, 2009 at 5:03 PM, Steven D. Majewski sd...@virginia.eduwrote:

 myBlock1  myBlock2 seem to have all the right dependencies (and they work
 on their own),
 but myCocoonWebapp has only the jars from those two blocks:

 [INFO]
 
 [INFO] [dependency:tree {execution: default-cli}]
 [INFO] edu.virginia.lib:myCocoonWebApp:war:1.0.0
 [INFO] +- edu.virginia.lib:myBlock1:jar:1.0-SNAPSHOT:compile
 [INFO] \- edu.virginia.lib:myBlock2:jar:1.0-SNAPSHOT:compile
 [INFO]
 

 Obviously something is missing from the webapp, but I don't think I missed
 any steps in the tutorial. ( But as I noted in previous message, an earlier
 step or two seem to have been left out. )

 I guess I'll go read the maven docs and see if I can find a clue.


I think this is happening because you used mvn install:install-file
instead of mvn install.  That would only install the jar file, not the
POM.  Maven needs the POM accessible so it can work out the dependencies.
 That's why they're not showing up when you run mvn dependency:tree.

-Dom


Re: problems with Getting Started 2.2 [was: Starting out with Cocoon 2.2]

2009-09-23 Thread Dominic Mitchell
On Wed, Sep 23, 2009 at 7:22 PM, Steven D. Majewski sd...@virginia.eduwrote:


 I can create, 'mvn install'  'mvn jetty:run' both myBlock1  myBlock2.
 When I try to connect the two blocks as in
 http://cocoon.apache.org/2.2/1291_1_1.html,
 I get this error on either a jetty:run or an install:


 myBlock1$ mvn jetty:run
 [INFO] Scanning for projects...
 [INFO]
 
 [INFO] Building myBlock1
 [INFO]task-segment: [jetty:run]
 [INFO]
 
 [INFO] Preparing jetty:run
 [INFO] [resources:resources {execution: default-resources}]
 [WARNING] Using platform encoding (MacRoman actually) to copy filtered
 resources, i.e. build is platform dependent!
 [INFO] Copying 9 resources
 [INFO]
 
 [ERROR] BUILD ERROR
 [INFO]
 
 [INFO] Failed to resolve artifact.

 Missing:
 --
 1) edu.virginia.lib:myBlock2:jar:1.0-SNAPSHOT

  Try downloading the file manually from the project website.

  Then, install it using the command:
  mvn install:install-file -DgroupId=edu.virginia.lib
 -DartifactId=myBlock2 -Dversion=1.0-SNAPSHOT -Dpackaging=jar
 -Dfile=/path/to/file

  Alternatively, if you host your own repository you can deploy the file
 there:
  mvn deploy:deploy-file -DgroupId=edu.virginia.lib
 -DartifactId=myBlock2 -Dversion=1.0-SNAPSHOT -Dpackaging=jar
 -Dfile=/path/to/file -Durl=[url] -DrepositoryId=[id]

  Path to dependency:
1) edu.virginia.lib:myBlock1:jar:1.0.0
2) edu.virginia.lib:myBlock2:jar:1.0-SNAPSHOT

 --
 1 required artifact is missing.

 for artifact:
  edu.virginia.lib:myBlock1:jar:1.0.0

 from the specified remote repositories:
  central (http://repo1.maven.org/maven2)



 [INFO]
 
 [INFO] For more information, run Maven with the -e switch
 [INFO]
 
 [INFO] Total time: 2 seconds
 [INFO] Finished at: Wed Sep 23 14:10:58 EDT 2009
 [INFO] Final Memory: 17M/31M
 [INFO]
 




This means you need to run mvn install in myBlock2 first, because maven
can't find it in ~/.m2/repository.


 If I comment out the myBlock2 dependency in myBlock1/pom.xml which I just
 added:


  !--
dependency
groupIdedu.virginia.lib/groupId
artifactIdmyBlock2/artifactId
version1.0-SNAPSHOT/version
/dependency
  --

 it will run again.


Yes, because the project is now dependent only on things that are already
available through maven.


 Does the order of the dependencies in the pom matter ?
 ( Eclipse is appending new ones at the end of dependencies )


No, the order doesn't matter.  What matters is that maven can find the
dependencies in ~/.m2/repository, or in the central repository (
http://repo1.maven.org/maven2/)


 Maybe I should try skipping the Connect two blocks part
 and jump straight to trying to join them with the webapp.


No, keep plugging.  It'll work!  You just need to install myBlock2 first,
because myBlock1 depends on it being available.

Incidentally, this is one of the best reasons for having a parent POM, as
described at the bottom of the deploying tutorial.  The parent POM takes
care of building all the dependencies in the correct order.

-Dom


Re: problems with Getting Started 2.2 [was: Starting out with Cocoon 2.2]

2009-09-23 Thread Dominic Mitchell
On Wed, Sep 23, 2009 at 6:50 PM, Steven D. Majewski sd...@virginia.eduwrote:

 Thanks. Yes -- I saw that observation in the other message.
 However: it wouldn't build doing just a 'mvn install' on the blocks.


Was there a particular reason for the failure when you ran mvn install in
the blocks?


 I've just deleted my test code as well as ~/.m2  repository so I can start
 over clean,
 just in case one of my earlier failed attempts left someting in the
 repository
 that may be causing a problem.


I realise it's probably adding more complication at this point, but if you
delete ~/.m2/repository regularly, you might want to look at something like
nexus in order to speed up future downloads.

  http://nexus.sonatype.org/

-Dom


Re: problems with Getting Started 2.2 [was: Starting out with Cocoon 2.2]

2009-09-23 Thread Dominic Mitchell
On Wed, Sep 23, 2009 at 7:44 PM, Steven D. Majewski sd...@virginia.eduwrote:

 On Sep 23, 2009, at 2:36 PM, Robby Pelssers wrote:

  So if I understand you correctly you have one block depending on the
 other?

 Did you also add the dependency of myblock2 in the pom.xml of myblock1?


 Yes. ( And if I take that dependency out, it runs without complaint. )


I'm guessing that is happening by accident.  If you run mvn clean it'll
stop working.

The reason is that Cocoon extracts blocks into a work directory when it
starts up.  When you run through maven with jetty:run, that's in
target/work.  mvn clean removes the target/ directory, so it'll probably
stop it from working.

-Dom


Re: problems with Getting Started 2.2 [was: Starting out with Cocoon 2.2]

2009-09-23 Thread Dominic Mitchell
On Wed, Sep 23, 2009 at 7:57 PM, Steven D. Majewski sd...@virginia.eduwrote:

 On Sep 23, 2009, at 2:50 PM, Dominic Mitchell wrote:

  On Wed, Sep 23, 2009 at 7:44 PM, Steven D. Majewski sd...@virginia.edu
 wrote:
 On Sep 23, 2009, at 2:36 PM, Robby Pelssers wrote:

 So if I understand you correctly you have one block depending on the
 other?

 Did you also add the dependency of myblock2 in the pom.xml of myblock1?

 Yes. ( And if I take that dependency out, it runs without complaint. )

 I'm guessing that is happening by accident.  If you run mvn clean it'll
 stop working.



 [ with myBlock2 installed ]

  cd myBlock1
  mvn clean
  mvn jetty:run

 with that myBlock2 dependecy commented out:

 http://localhost:/myBlock1/
 http://localhost:/myBlock2/
 http://localhost:/myBlock1/callingBlock2

 all work.


Bah, I'm flummoxed by that.  :)

-Dom


Re: problems with Getting Started 2.2 [was: Starting out with Cocoon 2.2]

2009-09-23 Thread Dominic Mitchell
On Wed, Sep 23, 2009 at 9:18 PM, Steven D. Majewski sd...@virginia.eduwrote:

 Thank You!!

 Both 1.0.0 and 1.0-SNAPSHOT are mismatched in the documentation.
 I was following the instructions a little too exactly!

 I wondered about this mismatch at the time, but I thought that
 perhaps SNAPSHOT was a keyword directive of some sort
 ( like HEAD or PREV in subversion ) so I went ahead and blindly
 follower the directions.

 I was continuing to the myCocoonWebApp and was hitting the same
 complaint from maven. After setting all of the dependencies to
 use 1.0.0 , that also now works.


Doh.  This was something that I implicitly corrected when I did it, because
I'm used to maven.  Sorry I didn't spot it for you!

-Dom


Re: map:match question

2007-01-23 Thread Dominic Mitchell

Martin Holmes wrote:
I'm having trouble getting a match to trigger when the URL has a hash 
followed by a query string. This is my match pattern:


map:match pattern=article.htm

It works fine when the url is something like this:

...article.htm?id=EMLS3-2FITTNOCTsearchString=nocturne

but not if the URL is like this:

...article.htm#hit10?id=EMLS3-2FITTNOCTsearchString=nocturne

In other words, the presence of the #hit10 hash component in the url 
causes the match to fail. I've tried variations such as


article.htm | article.htm#*

but I can't get any of them to match.

What's the right way to do this?


Your URLs are constructed incorrectly.  Everything after the hash should 
never get sent to the server.  It's purely for use by the browser.  You 
need to set them up like this:


   .../article.htm?id=EMLS3-2FITTNOCTsearchString=nocturne#hit10

-Dom


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