Many times before I was asked how to load data after successful
installation of
openwms.org.
Many people complained that they cannot display any data ... because
the database is still empty.
The simple answer is: It's up to you and your project how to do this
and what data to load!
Because:
a) Data in existing WMS projects is almost completely different to the
standard domain model that comes with
openwms.org.
Hence it is difficult to provide a general mechanism to load data. As
an extension we could consider to built a generic data
loader utility to support data loading as far as possible. But that's
not discussed so far.
b) These projects which start from scratch can basically rely on the
base structure that's given with
openwms.org but could extend this as
well.
In nearly every project the domain model is slighty different and
therefore it makes less sense to build a superb
tool that's generic enough to load all kind of data without any
modification. In most cases these tools are hard to customize
and less understandable.
But here are the good news about how we do data loading:
We are using OpenOffice Spreadsheet (also possible with MS Excel). A
spreadsheet is simple to extend and data is as easy to duplicate.
For registered developers we provide a sheet to load all the base
data, like LocationTypes, TransportUnitTypes, LocationGroups and
Locations.
Data of the CORE framework must be created manually using the GUI. Add
your roles, add your users. This is something that has to be done in
any project individually.
But you don't have to register if you only want to load data. So we
explain how we do it (example on LocationType):
1) The first row and columns reflect the database columns which have
to be loaded:
TYPE DESCRIPTION HEIGHT LENGTH WIDTH VERSION
2) After the last column we place a spreadsheet column that
concatenates a String and produces an INSERT statement:
=CONCATENATE("insert into ",Rules.B$3,"com_location_type
(id,entity_uid,c_type,description,height,length,width,c_version)
values
(",F2,",",F2,",'",A2,"','",B2,"',",C2,",",D2,",",E2,",",F2,");")
-> where Rules.B$3 refers to the database scheme. Remember inserting
the Primary Key and the Version column.
3) Thats it. Pull the last (function) column down to the end of the
sheet. This produces a lot of SQL/DDL INSERT statements.
4) Copy all generated INSERT statements to a sql worksheet and execute
it.