Directory structure
test
The source code directory structure is arranged as described below
media
This is a convenient default web application for storing products and merchants images as well as media bin contents
-dist : contains the build resulting media.war file
-WebContent : This is the representation of all sub directories required to the media bin. All those directories will have to be created in order to upload and read files if media web application is not used as the media bin
—bin : This is the media bin subdirectory which contains flash, files and images directory sub structures. At runtime when adding a new file, the merchant id will have its directory created under each sub directory.
—download : This is a convenient directory created to store digital products uploaded. If downloadable products are not free, this directory cannot be used as all downloads are exposed publicaly. See the media section on how to create a private download directory.
—images : Contains merchants branding images (logo, banner…) and products images uploaded from sm-central web application. At runtime when adding a new file, the merchant id will have its directory created under each sub directory.
schema
Contains HSQL db binaries ready to run as the default database. It also contain MySQL, Oracle and HSQL schemas and all scripts to create schemas under those databases.
-lib : directory containing database drivers. Actually contains HSQL db driver only. If Oracle or MySQL is used, drop the appropriate JDBC driver into this directory
—drivers : Should contain JDBC drivers
—other : Contains tools, actualy contains DDL Utils a useful tool that can be used to create schema representation for multiple databases reverse engineer, create the schema in the database and upload data sets
-other : Contains HSQL DB with the latest schema ready to be used for Shopizer, just run the .bat file (windows)
-sql : Contains sql files for supported databases
—data : necessary data set required to run Shopizer. Modules related data
—upgrade : data upgrade scripts following Shopizer versions. All upgrades need to be run incrementaly
sm-central
Shopizer administration web application
-bin : Eclipse binary directory
-conf : Configuration files specific to central web appliction
-src : Java source files
-lib : Libraries specific to central web application
-WebContent : jsp, html, images and xml deployment files, tiles configuration files, DWR configuration file
buy
sm-core
Common libraries and configuration files
-bin : Eclipse binary directory
-working : Ant binary directory
-lib : Contains all common Shopizer's libraries seperated by main sub components. A readme file in each sub directory describes the versions
—misc : Miscelaneous libraries,Apache libraries …
—hibernate : Specific to hibernate
—spring : Specific to Spring
—struts : Specific to Struts
—jax-ws : Specific to JAX-WS
—compile : Only required for compilation, are not distributed with the project
—axis : Axis libraries (required for shipping / payment integration)
-conf : All required configuration and templates files
—hibernate : Hibernate mapping files
—properties : System properties files
—resources : Resource bundles files
—spring : Spring configuration files, modules are defined in those directories. Can also be invoked using Spring annotations annotations
—templates : jasper report files, struts 2 freemarker templates files, email html templates
—–ireport-invoice : dedicated to invoice reports
—–jasperreports : other jasper reports files
—–mail : html email templates
—–other : other templates
—–xhtml : struts 2 freemarker overwriten ftl templates files
—–simple : struts 2 freemarker overwriten ftl templates files
-src : sm-core java source files
sm-shop
Shopping web application (store, shopping cart, invoices)
-bin : Eclipse binary directory
-conf : Configuration files specific to shop web appliction
-src : Java source files
-lib : Libraries specific to shop web application
-WebContent : jsp, html, images and xml deployment files, tiles configuration files, DWR configuration file
Any resource bundle to be used for a given store template need to be located in conf/resources
Configuration files
Configuration files reside in sm-core/conf/properties for the source distribution. For the distribution bundled with Jetty, configuration files reside in <jetty root>/conf
There are 3 important configuration files that may require custom configuration
systems.properties
The default database pool is configured to work with C3PO. It is possible to change the system to use DBCP or any other implementation or a server datasource as well.Both distributions are configured by default for HSQL db which can be launched from schema/other/hsqldb execution script. The system uses an smtp server for sending emails. If you don't have access to an smtp server, you can create a gmail account and use Google smtp server.
#Databases connections #DBCP org.apache.commons.dbcp.BasicDataSource #C3PO com.mchange.v2.c3p0.ComboPooledDataSource
database.pool.class=com.mchange.v2.c3p0.ComboPooledDataSource database.pool.min_size=5 database.pool.max_size=25 database.pool.timeout=100 database.pool.acquire_increment=1 database.hibernate.jdbc.batch_size=20 database.hibernate.cache.provider_class=com.opensymphony.oscache.hibernate.OSCacheProvidersearch.indexbase=./indexes#MySQL
The next section is for configuring the appropriate database. The system comes pre-configured for HSQL db but contains commented sections for other supported databases.
#Enables MySQL #database.driver=com.mysql.jdbc.Driver #database.jdbcUrl=jdbc:mysql://localhost:3306/SALESMANAGER #database.user=<mysql user> #database.password=<mysql password> #hibernate.dialect=org.hibernate.dialect.MySQL5Dialect
Enables HSQLDB
database.driver=org.hsqldb.jdbcDriver database.jdbcUrl=jdbc:hsqldb:hsql://localhost:9001/SALESMANAGER database.user=SA database.password= hibernate.dialect=org.hibernate.dialect.HSQLDialect
#Enables Oracle #database.driver=oracle.jdbc.driver.OracleDriver #database.jdbcUrl=jdbc:oracle:thin:@localhost:1521:XE #database.user=SALESMANAGER #database.password=<your password> #hibernate.dialect=org.hibernate.dialect.Oracle10gDialect #hibernate.dialect=org.hibernate.dialect.OracleDialect (non 10 g)
#jndi configuration #jndi-name=#NEED TO SPECIFYVALUE,UNCOMMENT JNDI AND COMMENT CONNECTION
The next section is for specifying the smtp server to be used for outgoing emails
#EmailsmailSender.protocol=smtp mailSender.host=<smtp host> mailSender.port=25 mailSender.username=<user name> mailSender.password=<password> mailSender.mail.smtp.auth=true mail.smtp.starttls.enable=false
struts.properties
Struts.properties contains all resource bundles used by default
struts.i18n.encoding=UTF-8 struts.custom.i18n.resources=resources,modules,messages,central,central-payment,central-catalog,central-orders,central-customer,cart-invoice,checkout,central-invoice,catalog struts.serve.static= truestruts.serve.static.browserCache=
sm-core-config.properties
This is the principal system configuration file. Jetty bundled distribution comes with this file perfectly configured. The source distribution needs some properties to be edited in order to determine server and medi bin path.
Configure your server hostname and which protocole will be used in the store area (http), shopping cart (usually https) and administration section (usualy https)
########################## #Properties to be edited ########################## core.domain.http.unsecure=http core.domain.http.secure=http core.domain.server=localhost:8080
The next important section contains media bin physical path in which files will be available and from which virtual url they will be available
#assumes medi web application will be used to serve media files core.store.mediaurl=/media #This is the media bin absolute path for storing branding images, product images and files (js, css, flash...) #This is the path where you will be dropping your war files core.bin.mediapath=c:/dev/apache-tomcat-6.0.20/webapps #the physical path to upload downloadable files #This is the absolute path where downloadable files will reside core.download.path=c:/dev/apache-tomcat-6.0.20/webapps/media/download
Another important section to understand is concerning the upload directives for media files
## Brandings ## ##-----------## #accepted file types core.**branding.cart**.contenttypes=image/pjpeg;image/gif;image/jpeg;image/jpg;image/png;image/tiff;image/x-png #max file size 100k core.branding.cart.maxfilesize=100000 #clean the dir before dropping the file core.branding.cart.cleanup=true #directory that will contain the file core.branding.cart.dirname=header #accepted file types core.**branding.banner**.contenttypes=image/pjpeg;image/gif;image/jpeg;image/jpg;image/png;image/tiff;image/x-png #max file size 100k core.branding.banner.maxfilesize=100000 #clean the dire before dropping the file core.branding.banner.cleanup=true #directory that will contain the file core.branding.banner.dirname=banner ## Products ## ##----------## #max product image file size 3MB core.product.image.maxfilesize=3145728 core.product.image.contenttypes=image/pjpeg;image/gif;image/jpeg;image/jpg;image/png;image/tiff;image/x-png #clean the dir before dropping the file core.product.image.cleanup=false core.product.image.maxwidth=700 core.product.image.maxheight=700 #virtual product (download) #8MB core.product.file.maxfilesize=8000000 core.product.file.downloadmaxdays=2 core.product.file.downloadmaxcount=5 core.product.image.small.prefix=small core.product.image.large.prefix=large #default image size (pixels) core.product.config.large.image.height=198 core.product.config.large.image.width=168 core.product.config.small.image.height=48 core.product.config.small.image.width=50 core.product.config.listing.image.height= core.product.config.listing.image.width=7080 ###media bin file types core.bin.images.contenttypes=image/vnd.microsoft.icon;image/gif;image/jpeg;image/pjpeg;image/jpg;image/png;image/tiff;image/x-png core.shockwaveformat=application/x-shockwave-flash core.bin.files.contenttypes=application/octet-stream;application/x-javascript;text/css;application/msword;application/pdf;application/vnd.ms powerpoint
Apache mod_proxy configuration
Here is the configuration to proxy a tomcat instance with Apache
########### #AJP Configuration to Tomcat ########### ProxyPass /shop ajp://127.0.0.1:8009/shop ProxyPassReverse /shop http://<your host name>/shop ProxyPass /central ajp://127.0.0.1:8009/central ProxyPassReverse /central http://<your host name>/central ProxyPass /media ajp://127.0.0.1:8009/media ProxyPassReverse /media http://<your host name>/media
########### #Recommended directory settings ########### <Directory /> Order Deny,Allow Deny from all Options FollowSymLinks AllowOverride None allow from 127.0.0.1 </Directory> RewriteEngine on