Curriculum: an EAV based curriculum vitae
- SBT 0.10.0
- SBT web plugin
- jackson JSON
- Google Guava
Berkeley DB for persistence
EAV meta models are defined in
DataType.scalacontains all the predefined DataType currently supported by the models
Entity.scaladefine the Entity/Attribute meta models and their relationship. Entity provides method to create corresponding new instance.
Instance.scalais the default implementation of an instance, it stores the values of the attributes that are defined in the corresponding entity.
Persistent.scalais not yet used, and serves as storage for my random thoughts around persistent behavior.
curriculum/eav/service contains the basic layer of service
ModelLoaderis an xml loader of entity definitions, see
curriculum/domain/CurriculumVitaeModelsfor a sample model.
InstanceLoaderis an xml loader of instances, see
curriculum/domain/CurriculumVitaeModelsfor sample instances based on the previous models.
/EntityService` provides basic functionality around instance and model, such as basic repository
EAV sample case: Curriculum Vitae
Sample use case is in
curriculum/domain. It contains both model and instance definitions, and the web page used to
'curriculum/util' contains several utilities. The two most interestings are
to have a basic support for localization of models.
'curriculum/message' provides base classes for i18n of internal message bus. The messages posted in the 'local' bus are periodically fetched by the browser and displayed to the user.
Web and page rendering
Web support is provided by the use of scalatra (entry point
CurriculumFilter) and XML manipulation for page rendering.
Currently the page rendering is based on raw html (manipulated as xml). This has been done in order to:
- understand how to manipulate XML through scala: read, write, xpath, merge...
- since XML support is builtin in scala. A lot of data navigation issues is detected early at compilation.
Message and Queue
Message is a localized support the notificatin within the application. Currently the message queue is a one for all, with in-memory persistance. Plan is to add support for a standard queue system such as ActiveMQ (RabbitMQ would have been well suitable but it lacks an embedded support in Java).
Cluster support includes
- Simulation of node start by starting embedded netty server
- Round robin job distribution among started node
Plan is to move the cluster nodes and job queue to zookeeper.
- Add message display on a per session basis: "i trigger the search, i'm the only one that see its life events"
- Replace job/dispatch by an event bus, e.g. based on ActiveMQ/RabbitMQ
- Add instance rendering based on customized/user defined scaml templates
- Add session auth.
- Add persistence behavior
- Add scafold on instance on a per entity basis
- Add entity designer
- Replace object serialization by Protocol Buffer
tail -f logs/curriculum.log
switch to offline mode
unfortunately 'jackson-module-scala' seems to not work as is with scala 2.9.0-1...
git clone https://github.com/FasterXML/jackson-module-scala.git
in pom.xml edit packaging from 'bundle' to 'jar' and scala version from '2.8.0' to '2.9.0-1'
mvn -DaltDeploymentRepository=repo::default::file:../arnauld.github.com/maven2 clean install source:jar javadoc:jar deploy