INSTALLING JBC
Website and Java frontend to a Cloud database for booksellers.
Brought to you by:
jbookcloud,
kelagedart
JBC INSTALL
JBC is shorthand for JavaBookCloud which is currently based on the Homebase 2.3 version book database from www.abebooks.com. its purpose is to parse the native Access derived database, and translate it into a series of 'queries' (MySQL) on a webserver relational database, whose output is viewable to anyone connected to the server database. This makes it infinitely networkable and viewable from any device that supports java (just about anything).
But it doesnt have to be a 'viewer' that connects to it. It can be anything that can connect to the database. Such as a user independant website. Currenlty one is adapted to do exactly that. It is OSCommerce 2.3.3 adapted to booksellers - BOSC
HOMEBASE:
But first a word about Homebase:
Homebase was designed around 1998 by Rick Pura, one of the original founders of Advanced Book Exchange (ABE). It was designed with Visual Studio '97 using an MS ACCESS template, and the output file was changed from the default MDB extension to HBD. HBDATA.HBD to be precise. It is the actual database, and is not to be confused with EXPORTS, usually in TXT, CSV, or TAB format. Key concept here: Database is NOT export file. It is NOT Backup file either.
In the years ahead it was improved and modified a bit, until it became Homebase 2.3 Around 2004 or so users began to notice that Homebase was missing two key fields: Weight and Quantity. Some of us simply put both of those in our NOTES field. Many do not use them at all. Other databases sprang up to handle those deficiencies, and to deal with on other factor that Rick Pura in writing Homebase had never dreamed of: Amazon. Amazon has its own, and form a bibliographic perspective, uniquely dysfunctional field structure that can only degrade the quality of Homebase lisitngs seeking to meet all its requirments.
There are three ways to handle these 'deficiencies':
Ignore them. Amazon can be handled by butchering the database under ANOTHER instance of Homebase. In another directory. You can have as many Homebases running as your memory will permit. Or ability to keep track of.
Replace Homebase. There are a number of 'services' from the free to the absurdly expensive. Their main 'selling point' is that they promise a very high rate of acceptance on Amazon, as well as some other features such as price and/or data manipulation. This can be done with #1, but #2 is simpler.
Expand Homebase-Script/Wrapper. What scripting is, is taking the EXPORT of Homebase (in whatever desired format) and running it through another program (typically a SCRIPTING LANGUAGE such as Java or Perl) to make whatever changes are desired. With scripting one can do virtually everything expensive databases can do, and then some. You can change prices based on categories or keywords, you can fill in a date field from an estimate in the description field, or even from the internet itself. And you can even run other scripts that can run other programs, including other databases. (though in fairness it should be stated that to simplifiy things JBC and BOSC share the same database).
Originally JBC started off as a WRAPPER called BOOKBASE. In the sense that the DATABASE itrself was used as the source and was run under MS ACCESS in a modified form. This can still be done, but it was found to be more efficient to use the Exort as a scripting function, since it was no longer limited to the PC platform, or to the capabilites of ACCESS.
Further aspects of the above:
1. Homebase is a great starter database, and CAN be adapted to a great many situations unplanned for in its original design.
It is the first, and for a while the ONLY fully networkable database. The shher and enormous vaule of this feature may not be appreciated by those who only have or work with one machine. But it will hit you like a hammer the first time your zip drive fails in the moiddle of the database transfer from the laptop.
Its main limitation is that it is limited to the Win PC platform. We had it running under Ubuntu Linux PC, but have not been able to replicate it under fedora, or Debian. Hand editing UIEE exports to Amazon is dcertainly an option for the smaller listers. An indirect form of scripting, actually.
JBC and CATO Sr.
All others fee and free are either tethered to an OS (usually Win) or unable to network (without significant expense).
JBC is what we have been discussing.
CATO Sr., soon to be updated, is an impressive database with multiple functions that we hope to soon replace Homebase itself as the source of exports to feed JBC. It exports in HOMEBASE mode (as well as UIEE and CSV)! About the only database we have seen outside the JBC and its predecessor with Homebase TXT capability.
Cato Jr. is great for portable devices such as pads and cellphones, as it uses little memory and is very fast, not using a traditional database at all, though can export to Homebase. Senior is a bit slower, but uses a full java database called H2.
JBC-BOSC is based on free Open Source software.
It should be noted that #3 also includes something known as API calls. Here scripts interact directly with the systems of the aggtregate sites (rather than ones own local or remote sites). Mormlly this requires server software, but in theory if you install the software to install BOSC loacally (XAMPP) you can also talk directly to Amazon, eBay, and a host of other sites!. This is not a simple process however!!!
IMPORTANT!!!!!
The Homebase we are discussing here is HOMEBASE 2.3 - the OLDER VERSION.
Homebase 3 was a hastily assembled 'upgrade' unleashed ion the public without adequate testing and based on a totally different database model than 2.3. We do not use it, nor recommend it.
RECENTLY HOMEBASE 2.3 was 'upgraded' and without a change in its revision bumber.
The 'update' was supposed to make the site export to ABE compatible with SFTP (a silly requirement), but it is our understanding that it was created under a different set of software from the original, and that some 'issues' may arise from it. However the all important Export field structure should be the same, and we expect no performance penalties based on that factor. For the record we use the older HB2.3 and use the file generated on the 'Eport to ABE button' - it will create the file before the error message appears - and use that file to power scripts to send to all our sites that take FTP and SFTP.
BACK TO JBC:
Its important to extract, or move once extracted (with fiull directory structure) to a site thats easily accessible and comfortable to you. For many that will be C:\Documents and Settings[Your User Name]\Desktop
JBC does not use the registry, nor does it come when it is not called.
Java, however, does, so it might be worth using CTRL-ALT-DELETE on Win systems to make sure there are no Java residuals once you shut down JBC.
If so, let us know, and we will come up with a shutdown script or a fix.
ONCE all the files are copied to the direcdtory pay special attention to the file called PERSISTENCE.XML
This file needs to be EDITED correctly, and placed WITHIN the JAR zipfile. It should replace the one currently there inder the META-INF directory WITHIN the JBookCloud.jar file.
Modified From:
https://sourceforge.net/p/jbookcloud/discussion/bosc%3Fjbc/thread/a38a968f/
We must tell JBC where its database is, and how to connect to it.
BOSC should be installed FIRST for this to work smoothly.
JBookCloud.jar is actually a ZIP FILE.
Inside that zip file is a directory structure and files.
There is a directory called META-INF
INSIDE that is a file called PERSISTENCE.XML
You need to be able to edit that file. I use the FAR File Manager which does this effortlessly, so I have no clue how a regular Windows user would do this.
Myles uses a free program called Winrar. Winzip should also work! (7zip possibly...)
Inside the file, at the bottom is:
property name="javax.persistence.jdbc.url" value="jdbc:mysql://[Your domain]:3306/[Your MySQL database name]"/>
property name="javax.persistence.jdbc.password" value="[Your MySQL password]"/>
property name="javax.persistence.jdbc.driver" value="com.mysql.jdbc.Driver"/>
property name="javax.persistence.jdbc.user" value="[Your MySQL User Name"]>
property name="eclipselink.session.customizer" value="JPAEclipseLinkSessionCustomizer"/>
I have had to remove the first '<' since the forum software would try to translate that into XML. Not pretty.
Do NOT include brackets!
Your domain = localhost -if using a local desktop setup with XAMPP
= your domain name (www.mybookshop.com, etc some servers do not require www prefix) - if on a remote web host
Your MySQL password = NOT the one used to log into BOSC Admin Panel.
Your MySQL User Name = NOT the one used to log into BOSC Admin Panel.
In the original file should be a working copy that Myles uses. It will not work from your machine, but you can compare the syntax easier.
Once edited and paced corectly within the JAR file.
Create a file in the JBC directory called GO.BAT
In it put the single line:
java -jar "JBookCloud.jar"
This will fire up JBC.
If it comes up complaining about missing class files, make sure your Java install is up to date.
UPDATING JAVA:
Go to START/RUN/
Type CMD.exe
Hit RETURN
Type :
java -version
The result should be a screen that looks like this:
C:> java -version
java version "1.6.0_27"
OpenJDK Runtime Environment (IcedTea6 1.12.4) (6b27-1.12.4-1)
OpenJDK Client VM (build 20.0-b12, mixed mode, sharing)
(This is the latest Debian Wheezy version BTW - though 1.7 is available and will install as a .deb file!)
If that number is BELOW 1.6.0.24:
You need to update Java from here:
http://java.com/en/download/index.jsp
It will be Java 1.7+
If all is well you may still get an error now.
If you installed BOSC first LOCALLY according to:
https://sourceforge.net/p/jbookcloud/discussion/faq/thread/78f3e3a6/
You SHOULD HAVE in your PERSISTANCE.XML file the database name, user name and password from the DATABASE SECTION of when you installed BOSC, and the hostname SHOULD be localhost. (We will get to REMOTE HOSTS another day!) its important NOT TO CONFUSE the database login with the BOSC website login - they are two totally diffrent animals).
If these are correct, and you are using VISTA or higher go to /START/RUN
Type SERVICES.MSC and TURN OFF Universal Access Controls (UAC). If that fixes it there are permissions problems.
Myles may be able to help with that!
If not... java is not communicating with the database, and we need more details.
please send info on
Operating System
Java -version
persistence.XML (with personal info x'd out)
Now...
If JBC is installed LOCALLY WITHOUT BOSC...
You may need to fire up phpmyadmin locally:
http://localhost/phpmyadmin
Go to IMPORT
Search for and run the SQL files in the \SQL directory.
BookCloud.SQL is probably the most important one ( but it should not hurt to install the others - espeically if it is an update independant of the full JBC-BOSC packages. (It is important to remember that JBC and BOSC are actually TWO programs capable of working independantly of each other. I often forget....)
KEEP IN MIND that all instructions SO FAR are for local testing setups.
Setups on remote servers are more complex and require additional instructions.
In another installment!
(Linux users:
Install XAMPP to /opt
Using XAMPP for Linux.
The instructions are basically the same as for Win, but save alotta grief when editiing the persistence.xml file by using mc (midnight commander) and alkways remember that Linux is cAsE sensitive!
When firing up the XAMPP utils the web directory will be the /HTDOCS directory, not /var/www.
Make sure the native apache and mysql daemons are not running.)
I've been running BOSC and JBookCloud under Linux Mint 13. I have several questions. JBookCloud is an excellent replacement for Homebase, although a tad slow to load up. I notice that sometimes JBookCloud takes up almost 90% ram resources and a high CPU load after exiting. Just wondering if there is a shutdown script or fix other than using the system monitor to kill the java process. Secondly, would you consider incorporating Publication Place as another data entry field in JBookCloud? There is a PublishPlace field in the table "book" of in the MySQL database but this is empty unless you manually enter the data with via sql query or phpmyadmin. Thirdly, I'd like to see edition and publication place as display fields in BOSC and wonder what php files would have to be edited.
Thanks. And Merry Christimas to you and your kin.
Sincerely, Tadeusz Raczkowski
It may be Java garbage collecting prior to shutdown. Java, in general, is memory hungry. JPA (Java Persistence Architecture), which JBookCloud uses to manage the database records, is even more memory hungry. Is the 90% resource usage associated with the number of book records you have consulted in a session? If so, it is probably JPA and best may be left to perform its cleanup operations.
We'll make the publication place field visible in the next version of JBookCloud.
The visible fields in BOSC are those of OSCommece 2.3.3 (sometimes renamed e.g. manufacturer to author). BOSC copies the fields from the HB database to fields in OSC. You could modify the catalog/install/triggers.php to copy these fields to an appropriate OSC fields.
BOSC appreciates your feedback.
Last edit: Myles 2013-12-20
JBookCloud316 makes "published place" visible.
Dear Tad,
You may wish to consider putting a memory limitiation in your start
script such as;
java -Xmx512m -jar JBookCloud.jar
Java is notorious for going nuts if it cannot connect or if the
connection is dropped
A later version of Jbookcloud may help as I believe Myles has made
improvements to the Java coding there.
However, run that from a seperate directory (I use /opt for the main
directory for these programs).
You may need an exit script with a
killall java
in it to shut down. I have seen the problem in Windows, but there i have
dealt with it by using a script to monitor the CPU usage and forcing
the priority lower if it exceeded 50%.
Please note that the newest versions of JBookcloud need to be configured
a bit differently as a dbconnections.configuration replaces the
persistence.xml in the java container file. It defaults to a local H2
database instead of the remote MySQL necessary for BOSC. The h2 db is
currently being used to power Jebay, a mass uploader and editor for ebay
auctions.
I hope to be posting a new improved JBC-BOSC soon, as soon as some other
minor issues with a UIEE database import are worked out.
Myles is the java programmer but I handle the basics. I'll bring this up
with him tonight.
There some loose ends to tie up with JBC. And the full publisher details
is one of them.
On my own site which is a liightly older version of OSCommerce than
BOSC, I have the publisher details appended to the descriptions.
Are you using Homebase 2.3? If so I may be able to cobble up a perl
script to put the locations into BOSC. Either into the BOSC MySQL field,
or append it to the publisher field.
I will bring that too, up with myles. I usually handle the Perl stuff!
:)
Many thanks,
kel
On 12/18/2013 4:23 PM, Tadeusz Raczkowski wrote:
I notice that there is version 317 of JBookCloud. I'm currently using version 316. Are there any major changes in the 317 version.
Sorry for delay.
The email from the forum did not make it.
316 is an update to the UIEE import.
317 is I believe, an update to the export for jebay. Mainly for the UK site, where they seem to be returning to Article Attributes, as opposed the the Item Specifics used on the main US site.
Myles has been rather quiet the past week.
Hard at work!
I am trying to install BOSC on my webhost. I have followed the steps in the video, and the manual instructions using BOSC17. After a number of failed attempts I went to the OSCommerce website and manually loaded that. It worked. The message I keep getting is "Warning: mysql_connect() [function.mysql-connect]: Access denied for user 'root'@'localhost' (using password: NO) in /../.../public_html/.../includes/functions/database.php on line 19
Unable to connect to database server!
Help.
Vera
Make sure you understand that there are 3 different accounts to every website host.
Your business account and login (sometimes merged into the next)
Your host home account and login
Your Website (BOSC\OSC) website account and login
Your Database login, account and database name(s) for website(s).
Replace the JbookCloud in BOSC17 with the latest one here, v17.
In dbConneXion.Properties :
driver = com.mysql.jdbc.Driver
url = jdbc:mysql://millpondshoppe.com:3306/Your Database NAME
user = Your DATABASE user account name
password = Your DATABASE user account name
Make sure the data are consistent with the configure.php in /include
and /admin/include
Make sure to get back if it doesnt work!
Am I supposed to see the install page when installing the OSC portion of bosc, like you do for regular oscommerce?
Sorry for delay/
Yes, ideally you should install BOSC from the install.php in the install directory, just like OSC.
First, however - create the database.Just leave it empty.
No Problem! Thanks for being available. I'm feeling quite baffled. Maybe
I'm not explaining well. I have followed the steps from the video- created a database, changed the permissions, etc. I get an error message when I type in the link to get to the install page. I am stopped there by, I believe, a request for the JBC database, not the BOSC one. SO when you say create the database and leave it empty, does that mean the OSC one? I assume there will be two - one for BookCloud and one for BOSC?
Again, sorry for delay...
The thing to remember is that with BOSC both the JBC AND OSC databases
are merged together into one MySQL dtabase.
And these are on the main hosting server for bosc - though of course it can be localhost with XAMPP.
The database creaded for BOSC/OSC would be the one that JBC uses. The key differences are in the SQL files that forms links and triggers between the two merged databases.
That is why an installaion of pure OSC will not work woith JBC - as the site database is different....
Thanks!
It should be noted that historically, in the early phases, BOSC and JBC had differing databases, but but was soon realized that for the concept to really work JBC needed to be able to 'talk' to BOSC within the same database using MySQL 'triggers'.
JBC is first and foremost a 'communications' channel. It permits databases to communicate with each other via 'export files'. In the futrure this may possibly be streamlined to pull the data directly from databases via a Java process called JDBC, but this is a rather complex and time consuming strategy, and possibly a part of our 'things to do' projects.
The current approach may seem a little crude, and indeed it is, compared to some all-in-one packages. But the thing to remember is that once the program is set up, the only regular maintenance JBC-BOSC requires is updates, whch can be done manually or by scripts, depending on the host servers - and the variation between them indeed may disallow a 'one-size-fits-all' approach.
JBC currently only handles Homebase 2.3 and UIEE imports, particularly the subset of UIEE related to books. This will hopefully change if greater interest and assistance to the project advances over time.
Exports are configuarable through the Freemarker scripting language, incorporated as part of the JBC package.
Keep in mind that the currently released JBC is materially different from the JBC in JBC-BOSC.
It is essentially a fork away from BOSC though does support BOSC if the dbconnexion file is configured TO THE MYSQL SERVER rather than the default H2 internal database.
This is a continuous source of confusion.
JBC is the interface for TWO DIFFERENT databases.
And each must be configured to the database it is using.
In other words, for typical usage, there would be TWO separate installations of JBC.
One to run BOSC on a remote server. (Though it can be used locally with a LAMPP server such as XAMPP, WAMP, etc )
One to run the local utilities from its local H2 database.
The H2 database was a development of the need to edit and manipulate the database in real time. The problem with JBC-BOSC is that any major changes to the databse can take time to promulgate. MySQL can only do info changes or requests ('queries') at a rate of around 100 per second. For large databases it can be very slow.
HOWEVER, there is no alternative to using MySQL on real websites. OSCommerce/BOSC is written to support MySQL and not H2.
H2 is a Java database written for speed and the ability to quickly interface with the Java language protocols, and there are few remote hosting services that handle Java based websites. Java is UNRELATED to JavaScript which is found on all modern web browsers and most modern websites, irrespective of the type of database they use.
It is included as part of the newer JBC packages (as a seperate 'library') and the default is to connect to IT, rather than to MySQL.
This is because the JBC project is morphing.
The original prime focus was on BOSC.
We have it working in a manner comfortable to us (myself andf Myles) and at this point we are leaving further testing to new users such as yourself and anyone interested.
One thing that should be noted is the SCALE of the capacity we are testing this at. I use an inventory of 10,000 (with 20,000 entries). Myles uses 100,000.
We are very interested in ways to more easily modify the theming and structure of the BOSC website. For a while there was a very good theming/redesign tool that was JQery based, but an update to JQuery deprecated it and made it inoperable. There are basic JQ themes (around 20) built into BOSC, but they do not fully manipulate the default frame structure.
To do so would require the use of CSS and basic knowledge of the 960 grid structure which can be quite complex.
Once again, as stated before, OSC 2.3.1 (BOSC) cannot use the popular Simple Template System used on the older OSCommerce 2.2. For myself, I like the default rtemplate structure of the panels, because it is (IMHO) better structured for bookselling thyan the 'newer' Web 2.0 template design, which has a tendency to ignore perceptual psychology, and focus more on designer skills and toys rather than proven marketing methods.
Back to H2.
The newer JBC releases use H2, and here the aim is to tame a different beast: Ebay.
Ebay has been offering thousands of free listings each month - though it should be noted that the actual amound 'usable' is strictly determined by ones personal account 'selling limits' of dollars and items - which ever is lower. Every month you need to call them and bug them to increase those limits, which roughly start at 100 items (and I dont know the dollar amount).
JBC-H2 is a fast and flexible database, and its Freemarker utility give it the capacity to export into virtually any format imaginable. And one of those formats is the XML for the structure of eBay's formidable API which allows users to interface directly with eBay.
The process for doing this is not very simple, nor does it need to be - as simplification can handicap flexibility. And as we use it about once per month the extra time involved is far less than the cost of commercial services.
My own method (greatly simplifed is as follows):
1.Export all items from Homebase.
Create a new Catalogues.tab file if categories file does not exist - from HB Catalog export function.
Import the all files export in CATO.
Select the CATALOGS (individually) as well as any other prerequisit (such as price, keywords, date - from the fantastic filters selection there). EXPORT, and take note of where the export is and what it is called - renaming is advised.
Repeat step 3 for all desired catalogs and filters using CATO. Accumulate as many files as desired.
Shut down Cato if desired. FIRE UP JBC.
Flush the database (or reload JBC).
Go to CATALOGS and import the homebase Catalogs.tab file.
Now go to BOOKS and import the CATO catalog file.
Now go to books, and find the suitable eBay export file under TEMPLATES directory.
(you will likely need to spend a couple hours customizing this, after getting your eBay API key set - but once set up - it can be used indefinitely).
Export that file to a place where JEBAY can find.
Now FIRE UP JEBAY.
Import that file.
If all is well, there will be no errors. If any errors do present themselves it is critical to check the LOG file. Often it will be a minor error - and the line number will be give. Just edit the export file and re-import it and try again. This can be a little tedious, and perhaps encourage fixing errors or inconveniences in the main database such as inconvenient ampersands (that databases have a tendency to hate).
Highlight entries desired and make them 'LIVE'.
Ebay will often present some unusual errors, or present a page to include 'descriptions' or pics (we host our own pics). Ignore and proceed.
We normally repeat steps 5-8 for each category, but there is no reason why you should not experiment and import multiple CATO files into JBC.
And likewise export them in serial order.
There is a potential problem with European sites and even some categoies on the core sites as to changes in many of the book categories, as it appears that eBay may be returning to the old Article Attribute format depending on individual catalogs - NON-FICTION in particular. CHILDREN'S also for some sites. User input and assistance may be needed to address the problems encountered per site (core, .uk,.au, etc)