Wednesday, March 20, 2013

The Best Part of Couchdb

When you finally get some data in your database, you can use the best feature of the couch web  app. That is the map and reduce functions. In the first post I had you write a map function for the first script. That is all well and good, but with the web interface you can write functions to your heart's content and get immediate feedback. A good source to start this can be found in the Couchdb definitive guide, Cookbook for SQL jockeys chapter. I seem to refer to this every now and then, if I have not used Couch for a few weeks.

Instant gratification while working with a database! Who could ask for more?
 A quick overview:
If you have a dataview you can call it up  in the web interface.  From here you can see the result of your query.


To view the code for the view, click the 'View Code' arrow on the left side of the windo





Here you can see the code and mess around with it

 Your results will show in the window below after you hit the run button. If you like it, use the save as or save buttons. If you use Temporary view, you pretty much have a blank slate. But do save this when you are done, temporary functions really don't work well in the programming.


Wednesday, March 13, 2013

Short post on CQ5 and Couchdb

The long and short of making the next stage of the Couchdb site involved the inital setup before putting in pull down menus--think I sorta started in the middle there.

Having to put together a batch of static websites for a client, what is even worse is they are having me use CQ5 (the pre-Adobe version). If you ever have had the pleasure of using a template based webpage builder, imagine one that does not work very well, and gives very little access to code. I often want to kick my laptop and things of this nature. But that is the way it is.

Some days it works OK, other days, ugh. Today is one of the ugh days. You can almost make it work, then.....whoops there goes a section....somewhere.

Have some Wikipedia deadlines coming up too, not as bad, except I have no access to the client's production server. Works great on the test and development servers, then a glitch on production, which then involves Emailing setting files back and fourth.  Does not happen often, Have a small issue now, but we will live.

While I wait for CQ5 to do what it supposed to do, I shall do some writing.

The next concept is to make files containing company information and region information. These are key areas for this database. Now due to the type of database we are running, which is really a pile of files, it is possible to store different patterns of data on files in the same folder.

There then is a need for input of information on files for Region and Client, and make these different from files which hold course information. Build the files based on the first file and name them what  you want, I named them Region.html and Client.html, along with their respective .js files. If you have questions, let me know.

But  how to easily differentiate the files from one another?
in the previous post, in the code line 160, I added the term "level 3" for the course database. So did the same for clinets "level1" and regions "level 2". Now it is just a matter of searching for level 1, 2 or 3 to pull up the type of file you want.

Brief but understandable?

The next problem. Pull down menus taken from the Client and Region database!

Until then I will be drop kicking my laptop

Tuesday, March 5, 2013

Will get back

Work has been busy, getting part of the house fixed, and I worked the FIRST robotics Finger Lakes regional this past weekend.....
Need to put together the post on setting up for inputting clients and other things. Only one trick, but you should be able to figure it out.
Hope to have the pulldown info written in about two weeks