Configuration

Many aspects of Scipio ERP can be configured to match your own needs. The configuration is generally handled by either properties files or data inside your database (seed data can be used to auto-install these configurations during your initial installation). Changes to the properties files will require a restart in order to take effect.


System memory

Memory allocation is set as parameters inside the start scripts:

  • /start.sh (Unix / Mac)
  • /start.bat (Windows)

The scripts rely on java to start the application. Memory can be allocated with the following launch options:

"%JAVA_HOME%\bin\java" -Xms128M -Xmx3512M -XX:MaxPermSize=1024m

The following parameters can be set:

  • Xms{number} – the initial memory size in bytes. This value must be a multiple of 1024 greater than 1 MB.
  • Xmx{number}  -the maximum size, in bytes, of the memory allocation pool. This value must a multiple of 1024 greater than 2 MB.
  • XX:MaxPermSize=${number} – permanent heap space (out of the memory allocated). The permanent space is where the classes, methods, internalized strings, and similar objects used by the VM are stored and never deallocated (hence the name).

We recommend to never allocate more than 3/4 of the available system memory to Scipio ERP.


Database Configuration

Scipio ERP has an embedded Derby database, so it can be run without setting up an external database. However, outside of development, we highly recommend to setup your external database before using Scipio ERP as a production system.

Scipio ERP is compatible to most relational databases and comes with full support of the following:

  • Derby (default)
  • MySQL
  • Advantage
  • MSSQL
  • PostgreSQL
  • Oracle
  • SAPDB
  • Firebird
  • MariaDB (Added: 2018-06-05)
  • HSQL

It is possible to run Scipio ERP with relational databases not listed above, but additional steps will be required.

To configure an external database:

  1. Download JDBC driver that matches your database version and put the *.jar file inside of /framework/entity/lib/jdbc. For MySQL & PostgreSQL there are ant tasks available to handle this step automatically:
    1. ant download-mySQL-JDBC
    2. ant download-PG-JDBC
  2. Update the datasource configuraton inside entityengine.xml (located in /framework/entity/config/). Look for the datasource that matches your own database type, i.e.:
    <datasource name="localpostgres"
     helper-class="org.ofbiz.entity.datasource.GenericHelperDAO"
     schema-name="public"
     field-type-name="postgres"
     check-on-start="true"
     add-missing-on-start="true"
     use-fk-initially-deferred="false"
     alias-view-columns="false"
     join-style="ansi"
     use-binary-type-for-blob="true"
     use-order-by-nulls="true"
     result-fetch-size="50"> <!-- Comment out the result-fetch-size attribute for jdbc driver versions older than 8.0.
     Not recommended to use those though. They are archived unsupported versions: http://jdbc.postgresql.org/download.html -->
     
     <read-data reader-name="tenant"/>
     <read-data reader-name="seed"/>
     <read-data reader-name="seed-initial"/>
     <read-data reader-name="demo"/>
     <read-data reader-name="ext"/>
     <read-data reader-name="ext-test"/>
     <read-data reader-name="ext-demo"/>
     <inline-jdbc
     jdbc-driver="org.postgresql.Driver"
     jdbc-uri="jdbc:postgresql://127.0.0.1/ofbiz"
     jdbc-username="postgres"
     jdbc-password="postgres"
     isolation-level="ReadCommitted"
     pool-minsize="2"
     pool-maxsize="250"
     time-between-eviction-runs-millis="600000"/><!-- Be warned that at this date (2009-09-20) the max_connections parameters in postgresql.conf
     is set by default to 100 by the initdb process see http://www.postgresql.org/docs/8.4/static/runtime-config-connection.html#GUC-MAX-CONNECTIONS-->
    
     <!-- <jndi-jdbc jndi-server-name="default" jndi-name="java:comp/env/jdbc/localpostgres" isolation-level="ReadCommitted"/>-->
     <!-- <jndi-jdbc jndi-server-name="default" jndi-name="comp/env/jdbc/xa/localpostgres" isolation-level="ReadCommitted"/> --> <!-- Orion Style JNDI name -->
     <!-- <jndi-jdbc jndi-server-name="localweblogic" jndi-name="PostgresDataSource"/> --> <!-- Weblogic Style JNDI name -->
     <!-- <jndi-jdbc jndi-server-name="default" jndi-name="jdbc/localpostgres" isolation-level="ReadCommitted"/> --> <!-- JRun4 Style JNDI name -->
     <!-- <tyrex-dataSource dataSource-name="localpostgres" isolation-level="ReadCommitted"/> -->
     </datasource> 

    In most cases it should be enough to update the URI, username and password. The datasource configuration matches the general Tomcat datasource definition – therefore it is possible to optimize the settings to your own needs.

  3. Update the default, default-no eca & test delegator settings inside the same file:
    <delegator name="default" entity-model-reader="main" entity-group-reader="main" entity-eca-reader="main" distributed-cache-clear-enabled="false">
     <group-map group-name="org.ofbiz" datasource-name="localderby"/>
     <group-map group-name="org.ofbiz.olap" datasource-name="localderbyolap"/>
     <group-map group-name="org.ofbiz.tenant" datasource-name="localderbytenant"/>
     </delegator>
     <delegator name="default-no-eca" entity-model-reader="main" entity-group-reader="main" entity-eca-reader="main" entity-eca-enabled="false" distributed-cache-clear-enabled="false">
     <group-map group-name="org.ofbiz" datasource-name="localderby"/>
     <group-map group-name="org.ofbiz.olap" datasource-name="localderbyolap"/>
     <group-map group-name="org.ofbiz.tenant" datasource-name="localderbytenant"/>
     </delegator>
    
     <!-- be sure that your default delegator (or the one you use) uses the same datasource for test. You must run "ant load-demo" before running "ant run-tests" -->
     <delegator name="test" entity-model-reader="main" entity-group-reader="main" entity-eca-reader="main">
     <group-map group-name="org.ofbiz" datasource-name="localderby"/>
     <group-map group-name="org.ofbiz.olap" datasource-name="localderbyolap"/>
     <group-map group-name="org.ofbiz.tenant" datasource-name="localderbytenant"/>
     </delegator>

    Replace the datasource-name for “org.ofbiz” with your own configuration name in all three places.


Default Settings

Various default settings can can be set that will work as a fallback unless defined otherwise. This includes: your default language, company name or currency settings. We highly recommend to configure these defaults on first-time installations. For configuration, edit the general.properties file located inside of framework/common/config:


# -- unique instance id (20 char max)
unique.instanceId=ofbiz1

# -- the default currency to use for prices, etc
currency.uom.id.default=USD

# These values override the _NA_ DEFAULT values in user preferences for the GLOBAL_PREFERENCES userPrefGroupTypeId
# -- the default organizationPartyId for used in dropdowns and reports
ORGANIZATION_PARTY=Company
# ID of the VisualTheme to use if there is no VISUAL_THEME UserPreference record for the current user (ie default value)
VISUAL_THEME=METRO

# -- the default decimal format for currency (used in UtilFormatOut.java)
currency.decimal.format=#,##0.00

# -- the default rounding for currency (used in OfbizCurrencyTransform.java)
# Scipio: Use 2 decimals
#currency.rounding.default=10
currency.rounding.default=2

# -- the default check scale for integer currency enabled (Y|N) (used in OfbizCurrencyTransform.java)
#When decimals are '00'
# -- Y if you want to display only x , example : 10
# -- N if you want to display x.00 , example : 10.00
currency.scale.enabled=N

# -- Properties fallback locale. Change this setting with caution. If you
# start getting "resource not found" exceptions, then there are
# properties missing in the locale you specified. This property does not
# control the default locale - the default locale is set in start.properties.
locale.properties.fallback=en

# -- Locales made available, separated by commas. This property controls
# which locales the user can select from. If this property is not used,
# then the user will be able to select from all the locales available
# in the JVM. The list below corresponds to the languages really available OOTB (2010-16-02)
#locales.available=ar,de,en,es,fr,hi,it,nl,pt,ro,ru,th,zh

# -- Time zones made available, separated by commas. This property controls
# which time zones the user can select from. If this property is not used,
# then the user will be able to select from all the time zones available
# in the JVM.
#timeZones.available=US/Eastern,US/Central,US/Mountain,US/Pacific,US/Alaska,US/Hawaii

# -- the default country for drop downs
country.geo.id.default=USA

# -- Available countries, separated by commas.This property controls
# which countries the user can select from. If this property is not used,
# then the user will be able to select from all the countries.
#countries.geo.id.available=USA

# -- the default trackingCodeId to use for Partner Managed Tracking Codes
partner.trackingCodeId.default=

# -- USPS address matching string - should be all lower case, no spaces, pipe delimited
usps.address.match=(^.*?p[\\. ]*o[\\. ]*box.*$)|(^.*?post.*?office.*?box.*$)|((^|(^.*? ))r[\\. ]*r[\\. ]*(( +)|([0-9#]+)).*$)|(^.*?rural.*?route.*$)

# -- general default 'fromEmailAddress' can be overridden in: EmailTemplateSetting
defaultFromEmailAddress=ofbiztest@example.com

# -- The default domainname used in the notification emails links
# as 'baseUrl' and 'baseSecureUrl' are set in the url.properties file. 

# -- mail notifications enabled (Y|N)
mail.notifications.enabled=N

# -- redirect all mail notifications to this address for testing
#mail.notifications.redirectTo=

# -- the default mail server to use
mail.smtp.relay.host=localhost

# -- SMTP Auth settings
#mail.smtp.auth.user=
#mail.smtp.auth.password=

# -- Additional Required Fields needed for Gmail and other non traditional smtp servers
# -- These added fields also work for Yahoo business mail for instance
# -- Gmail smtp port can be either 465 or 587
#mail.smtp.port=465
# -- Gmail requires StartTLS
#mail.smtp.starttls.enable=true

# -- Gmail requires a JSSE socket factory, the following socketFactory settings will override JavaMail's default socketFactory settings
# -- Port needs to be the same as mail.smtp.port
#mail.smtp.socketFactory.port=465
#mail.smtp.socketFactory.class=javax.net.ssl.SSLSocketFactory
#--Fallback [true|false] determines whether you will allow a non secure connection if you are unable to get a secure one
#mail.smtp.socketFactory.fallback=false

# -- how the address are matched with the CRM addresses
mail.address.caseInsensitive=N

# -- debug SMTP mail option enabled (Y|N)
mail.debug.on=N

# -- if some addresses fail the SMTP check using the RCPT TO: command then setting this property to false will abort sending the message
# to any recipients valid or not
mail.smtp.sendpartial=true

# -- HTTP upload settings
# -- directory used to temporarily store files that are larger than the configured size threshold (10K)
http.upload.max.sizethreshold=10240
# -- directory used to temporarily store files that are larger than the configured size threshold
http.upload.tmprepository=runtime/tmp
# -- max size in bytes (-1 for unlimited)
http.upload.max.size=-1

# -- spam header name and value to block incoming spam detected by external spam checker, configured for spam assin
mail.spam.name=X-Spam-Flag
mail.spam.value=YES

# -- Y if you want to display the multi-tenant textbox in the login page and install specify components which related to each tenant
multitenant=N


# Scipio: Global pagination defaults.
# NOTE: Some components have their own specific settings from stock Ofbiz. Also see the following files and properties:
# widget.properties - widget.form.defaultViewSize
# content.properties - viewSize

# Global default, used mainly for non-widget code. widget code usually uses widget.form.defaultViewSize as default instead.
record.paginate.defaultViewSize=20
# This is used when pagination is disabled. Sometimes it is really used in lookups in these cases, so don't make this an extreme value.
record.paginate.disabled.defaultViewSize=99999

# Scipio: Data generator services max records
data.generator.max.records = 50; 


URLs

Be aware that the following section contains information on how to “generate” urls, but does not affect other aspects of the application itself. If you must change the default port for the application, modify the connector settings inside of /framework/catalina/ofbiz-component.

For most production systems it is desirable to configure global URL settings that will influence the way URLs are generated inside the system. Within Scipio ERP there are two ways to configure URLs – globally within url.properties or by Website Entity definitions. The latter is only relevant if you intend to run multiple stores, so we are going to cover the global url configuration first.

Global URL Configuration

All configuration can be set inside of  /framework/webapp/config/url.properties:

# HTTPS Port (Secure port)
port.https.enabled=Y
port.https=8443
force.https.host=

# HTTP Port (Not Secure port)
port.http=8080
force.http.host=

# SCIPIO: if set to Y, the ports and hosts above have priority over the information in the current request when building links.
# Otherwise, they are only used as defaults/fallbacks, if request values not present/applicable.
# Default: N (current request values have priority)
# NOTE: the scipio default ("N") is different from the implicit stock Ofbiz default ("Y").
# NOTE: this does not control values from WebSite entity; currently WebSite entity always override values above AND from request.
override.request.host.port=

# Static Content URLs to make it easy to move the serving load for static content to other machines
# -- thse are for general content such as images, js & css files, or non-dynamic HTML files
content.url.prefix.secure=
content.url.prefix.standard=

# Here you can set the domain string to use for new cookies
cookie.domain=

# Exclude jsessionid for User-Agents (separated by comma's)
link.remove_lsessionid.user_agent_list = googlebot,yahoo,msnbot,mediapartners-google

# Should HTTP parameters sent to services require encryption?
# This is generally advised for more secure webapps as it makes it more difficult to spoof requests (XSRF) that change data. 
service.http.parameters.require.encrypted=Y

 

WebSite URL Configuration

If you want to set specific url settings for a single application, you can rely on WebSites to override the defaults. The configuration is similar, but has to be loaded into the database (either as seed data, or through the Admin – Import tools: https://localhost:8443/admin/control/EntityImport):

<?xml version="1.0" encoding="UTF-8"?><entity-engine-xml>
    <WebSite productStoreId="ScipioShop" siteName="SCIPIO Shop Web Site" visualThemeSelectorScript="component://common/webcommon/WEB-INF/actions/includes/GetWebSiteStoreVisualThemeId.groovy" visualThemeSetId="ECOMMERCE" webSiteId="ScipioWebStore"
             httpHost=""
             httpPort=""
             httpsHost=""
             httpsPort=""
             enableHttps=""
             standardContentPrefix="" 
             secureContentPrefix=""
             cookieDomain=""
    />
</entity-engine-xml>