couchdb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Robert Newson <rnew...@apache.org>
Subject Re: Import a Java Library into CouchDB JavaScript Validation Function
Date Wed, 19 Dec 2012 22:25:56 GMT
You might find a Java view server around, though evaluating Java
snippets is a bit of a black art, but no sane view server will permit
reading local files.

On 19 December 2012 22:22, Travis Paul <Tr@vispaul.me> wrote:
> AFAIK, this is not possible as validate_doc_update functions can only be
> written in javascript. (Maybe also Erlang? But I don't think so)
>
> You might want to use something like JSON schema for consistent client and
> server validation, as you can import  more javascript with CommonJS modules.
>
>
> On Wed, Dec 19, 2012 at 4:58 PM, KyleMarchant <kyle.marchant@agilex.com>wrote:
>
>> I would like to use a java library within a validation function for
>> accessing
>> an external properties file. Something like the following:
>>
>> importPackage(Packages.java.io);
>> importPackage(Packages.java.util);
>>
>> var file = new File(sPropertyFile);
>> var fis = new FileInputStream(file);
>>
>> var prop = new Properties();
>> prop.load(fis);
>> var field = prop.getProperty("FIELD1");
>>
>> Can anyone tell me if CouchDB allows the importing of Java Library
>> (Packages) and if so can you provide me instructions or an example of how
>> to
>> go about doing this?
>>
>> Much appreciated.
>> Kyle
>>
>>
>>
>> --
>> View this message in context:
>> http://couchdb-development.1959287.n2.nabble.com/Import-a-Java-Library-into-CouchDB-JavaScript-Validation-Function-tp7582437.html
>> Sent from the CouchDB Development mailing list archive at Nabble.com.
>>

Mime
View raw message