cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Matt Kendall <matt_kend...@iname.com>
Subject Help with Component Configuration
Date Fri, 11 Nov 2005 23:15:43 GMT
I'm trying to write a component that will connect to CVS. I'm using a
component because I need to interact with it from several different
sitemap components, so I figured that this was easiest.

The problem I'm having is that Cocoon doesn't seem to pick up the
configuration that I'm placing in cocoon.xconf. The component seems to
get registered OK, but it doesn't get passed the configuration
information. As soon as I try to use the component, in an Action for
the moment, I errors due to an empty configuration object inside of
CVSComponentImpl.  If I do a toString on the configuration object, I
get "::<no value>:@-".

I'm really not sure what I'm doing wrong. Hopefully it's something
incredibly simple.

Here's the relevant bits:

===System===
Cocooon 2.1.7
Just testing with the default Jetty container for now.

===CVSComponent.java===
package com.pega.cocoon.components;
import org.apache.avalon.framework.component.Component;
public interface CVSComponent extends Component {
  public final static String ROLE = CVSComponent.class.getName();
  public boolean updateRepo(String repo);
}

===CVSComponentImpl.java===
package com.pega.cocoon.components;
import ...
public class CVSComponentImpl extends AbstractLogEnabled implements
		CVSComponent, Configurable, Initializable {

	public void configure(Configuration config) throws ConfigurationException {
		this.config = config;
	}

	public void initialize() throws Exception {
            //config.getChildren().length == 0 here.
	}

}

===user.xroles===
<role-list>
  <role name="com.pega.cocoon.components.CVSComponent"
    shorthand="cvs"
    default-class="com.pega.cocoon.components.CVSComponentImpl"/>
</role-list>

===cocoon.xconf===
<cocoon version="2.1" user-roles="/WEB-INF/user.xroles">
...
<cvs>
  <repo name="devcvs2411"
    hostname="devcvs"
    method="pserver"
    password="pegasys"
    port="2411"
    repository="/cvsroot/rules0402"
    user="kendm"
    localpath="D:/programs/cocoon/build/webapp/cvs"/>
 </cvs>
...
</cocoon>

Thanks!!
Matt

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


Mime
View raw message