Not sure what you're trying to accomplish here but you can READ the file
from within the sitemap with flowscript:
<map:match pattern="configfile">
<map:call function="doSomeStuffWithConfigFile" />
</map:match>
In flowscript:
----------------------------------------------------
importClass(Packages.java.io.File);
Function doSomeStuffWithConfigFile() {
String pathToFile = ....; //hard code it OR
//you could configure some bean and do sth like ....
/**
var myBean = cocoon.getComponent("myBean");
var configFilePath = myBean.getConfigFilePath();
**/
File file = new File(pathToFile);
//...do some other stuff
}
----------------------------------------------------
Cheers,
Robby Pelssers
-----Original Message-----
From: Radaven [mailto:[email protected]]
Sent: Thursday, September 17, 2009 2:56 PM
To: [email protected]
Subject: Accessing resource from reader
Hi, I am working on my BarcodeImageReader which generates barcode image.
The
parameters of barcode are loaded from xml config file (saved on same
place
as other resources like jx templates, etc.).
How can I get to this file to have it as java.io.File? I guess I cannot
use
something like
File file = new File("barcode-cfg.xml");
Is there some getResource method or something like that available?
--
View this message in context:
http://www.nabble.com/Accessing-resource-from-reader-tp25490717p25490717
.html
Sent from the Cocoon - Users mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]