Federico Piccinin wrote:
In a previous topic i've seen this piece of code used to add e new ContainmentModel.
ContainmentModel containmentModel = kernel.getModel(); URL blockURL = new URL("file:bin/BLOCK-INF/block.xml"); ContainmentModel block = containmentModel.addContainmentModel(blockURL);
Just for reference - the /BLOCK-INF/block.xml should not be referenced directly - instead you should be pointing your url to the directory containing this structure. Merlin will look for [url]/BLOCK-INF/block.xml automatically and the referenced directory will become an implicit classpath entry.
I'ts ok. It works fine.
Now I'm using jakarta fulcrum. I have multiple jar file, each file contains an entry BLOCK-INF/block.xml.
It's possible to add a containement model directly from a jar file?
Sure - if the jar file contains BLOCK-INF/block.xml then:
URL url = new URL("file:bin/latest-and-greatest.jar");
ContainmentModel block =
containmentModel.addContainmentModel( url );Alternatively you can create a standalone block definition that includes the jar file in the classloader directive.
URL url = new URL(
"http://www.dpml.net/merlin/tutorial/blocks/hello.block" );
ContainmentModel block =
containmentModel.addContainmentModel( url );Cheers, Steve.
--
|---------------------------------------| | Magic by Merlin | | Production by Avalon | | | | http://avalon.apache.org | |---------------------------------------|
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
