Grails using gridfs of mongo - plugins not matching - mongodb

My application needs to use mongodb for normal data storage and also to keep pretty large files. Hence I started with plugins for mongodb (for normal data storage) and gridfs (for large files).
I am using grails 2.3.4 and trying to figure out what is the issue with the plugins that are included for using both mongodb and gridfs.
I have been searching the entire internet (including stalkoverflow) to find out any plugins that co-exists but in vain. Because no matter I use what combination of the available plugins, it all shows errors saying compatibility issues.
I am using the driver mongo-java-driver-2.11.3.jar
I ended up trying all plugins currently available. My build-config file looks like this:
<<<
// compile ":mongodb:1.3.3"
// compile ":mongodb:1.0.0.GA"
// compile ":gorm-mongodb:0.5.4"
// compile ":zk-mongodb:1.1-M1"
compile ":mongodb-morphia:0.8.2"
compile ":mongo-file:1.1.1"
// compile ":mongodb-gridfs:0.5.beta"
>
I know that I am missing something here.
Has anybody used grails2.3.4 and mongodb with gridfs ?
Please help me out either by pointing the correct plugins or sending code snippets of working samples.
Thank you all in advance.

I had a similar problem when I used ":mongodb-gridfs:0.5.beta" as well. In fact, even when I tried to remove the plugin (via my IDE) it continued to error. I deleted plugins.mongodb-gridfs=0.5.beta from application.properties, and then my application could build again.
You shouldn't need a separate plugin to use GridFS, it's actually part of the MongoDB Java driver. You will, however, need to get to the lower-level API instead of using the default Grails GORM stuff - there's some info on how to do this here.
The GridFS API works in a slightly different way to the rest of the driver, but here's an example. To create the GridFS to work with, you'll need something like new GridFS(mongo.getDB(databaseName)).
I don't have a fully working example to show you, but I hope you can piece together what you need from those different examples.

I've been using webfs which has worked very well for us in the past. It's a lightweight grails plugin for managing files using Mongo's gridfs. See https://github.com/dlaidlaw/mongo-web-filesystem for more details.
I use the webfs plugin in our document management module for managing any type of documents, up to 250MB in size. Am using mongodb:1.2.0.
I've not tested it with Grails 2.3.4, but it works on 2.0, 2.1 and 2.2.

Related

What do you lose by ejecting a React app that was created using create-react-app?

I'm interested in using Hot Module Replacement with a newly created React app.
Facebook Incubator's create-react-app uses Webpack 2 which can be configured to support HMR, however in order to do so, one needs to "eject" the create-react-app project.
As the documentation points out, this is a "one way" operation and cannot be reversed.
If I'm to do this, I want to know what I might be giving up. I've been unable to locate any documentation that explains the potential drawbacks of ejecting.
The current configuration allows your project to get updates from create-react-app core team. Once you eject you no longer get this.
It's kind of like pulling in bootstrap css via CDN as opposed to downloading the source code and injecting it directly into your project.
If you want more control over your webpack, there are ways to configure/customize it without ejecting:
https://www.npmjs.com/package/custom-react-scripts

How to create an ATG store?

I have been studying ATG for about 4 months and now I am facing a problem: even going through the documentation I can't find any document that can clearly explain how I can create a new empty store.
I know that I need to have my database users and schemas, the application server scripts (I'm using weblogic) and the module in Eclipse. But I can't find anywhere how to create a new store, implement it from the beginning and see the result in the browser.
There is no such document for ATG. You either need to start from the Commerce Reference Store and customise that (in versions prior to ATG 11 would would strongly suggest not to use the CRS as your basis for a new site) or you can look at what the CRS executes for the runAssembler command, remove the CRS specific modules from that and then create, and include your own modules for the Storefront and your source code.
There is no empty store you can install and run. You have to build one. Or you can install CRS, which is not empty, but it is relatively straightforward to install and can be customized.
The documentation to follow:
http://docs.oracle.com/cd/E52191_02/CRS.11-1/ATGCRSInstall/ATGCRSInstall.pdf
https://www.sparkred.com/blog/installing-oracle-commerce-11-1-with-commerce-reference-store/
*

mongoQB for Codeigniter Implementation

Since I am already implementing the old version of mongodb from alexbilbie, but the current mongoDB driver newer than 1.3 for php is not compatible anymore except I am migrating to alexbilbie’s new library called mongoQB, anyone has experience with that or could give a sample procedure to integrate this mongoQB to codeigniter? I am scratching my head currently…
I know I could also use a native implementation of mongoDB to php but I have already made many models based on alexbilbie’s old version and it would be better for me to change syntax names than to rewriting all the models
I have forked mongoqb and modified it a bit to integrate it with codeigniter. You can find the library here mongoci

playframework testing - set up and tear down - how to?

I've started using playframwork (scala) and I'm writing some tests.
Before starting them I'd like to put in some mock data in my db (mongo) and later on when the tests are over remove this data.
I've got the code to put/remove this data but can't figure out how to consistently get this done before/after the tests are run.
I'm using the "specs2" testing library that comes with playframework but was unable to find any docs on how this can be done with specs.
Do you know how this can be done with specs? or can recommend another well known testing lib for playframework that I should use instead of specs?
I did not test it, but from the doc, Specs2 seems to support the Before/After approach: http://etorreborre.github.io/specs2/guide/org.specs2.guide.Structure.html#Before%2FAfter
You can find some running examples here on GitHub. It's from a pet project of mine, written in Scala with the Play Framork version 2.1.0.
The keypart is the following:
"Application" should {
"work from within a browser" in {
running(TestServer(3333), HTMLUNIT) { browser =>
This starts up the Play application on port 3333. Before this you can add the code for your test fixtures etc.
If you want the sytem to assign a free port for the tests, you can have a look here.

Birt now showing up tables in create data set form

I am trying to create a data set (BIRT) in eclipse. I tested connection with the data source. It is successful. But while trying to create data set, data set form does not show up tables in data base.
I even tried firing query anyways, but eclipse freezes then.
Please suggest, if anyone has encountered similar problem.
Thanks!
I found the solution to the problem. BIRT needs Informix Jdbc driver to be installed in a particular way. So even though java code was able to read and write from Informix, BIRT was getting stuck.
I thought driver can not be a problem as java classes were working fine with the same drivers.
Hope this helps.