Damascus is a Liferay Blade tool extension for generating scaffoldings of Service builder portlet with CRUD functionality based on a configuration json file, base.json. For more detailed usage, please see https://github.com/yasuflatland-lf/damascus/wiki
The list of what Damascus automatically generate is as follows
- CRUD functionality with a model
- CRUD api / corresponding jsp pages
- Document & Library access field (if you have a corresponding field in base.json)
- Assets required field (if you have a corresponding field in base.json)
- Workflow
- Trashbox
- Search
- Comments
- Related assets
- Ratings
- Activities (The activities on the portlet will be recorded and visible on an activity portlet)
- Multiple service builder portlets at once
- Liferay 7.0 CE GA4 and Liferay DXP SP3 or higher versions.
- Java 1.8 or above
- gradle 3.0 or above need to be installed
- jpm needs to be installed. (instruction to install is as follows)
Mac
curl https://raw.githubusercontent.com/yasuflatland-lf/damascus/master/installers/global | sudo sh
Windows
- Download jpm (https://raw.githubusercontent.com/jpm4j/jpm4j.installers/master/dist/jpm-setup.exe) and install.
- Install damascus.jar with jpm as follows.
jpm install https://github.com/yasuflatland-lf/damascus/raw/master/latest/damascus.jar
- Run jpm remove damascus to uninstall damascus.
- Remove all files under
${user}/.damascus
folder. If you've modified files, please change them accordingly after regenerating configurations and templates. - Follow How to install section to install again
Let's make a Todo app with damascus
- Create a Liferay workspace with Blade cli or Liferay IDE / Liferay Developer Studio. For more details, please see https://dev.liferay.com/develop/tutorials/-/knowledge_base/7-0/blade-cli
- After creating Liferay workspace, navigate to under
modules
folder and rundamascus -init Todo -p com.liferay.sb.test -v 70
- Navigate to
todo
folder. You'll seebase.json
file is created. For detailed configuration, please see https://github.com/yasuflatland-lf/damascus/wiki Just for demonstration now, we'll create a scaffolding as it is. - Type
damascus -create
and damascus will create a scaffolding service and portlet according to the base.json file. - Start up your Liferay server and in the
Todo
folder, typeblade deploy
. Blade will run properly and service and portlet will be deployed.
- Clone this repository to your local. Please make sure you've already installed Gradle 3.0 or above and jpm.
- At the root directory, run
gradle assemble
thendamascus.jar
will be created under/build/libs/
directory. - If you've already installed damascus, uninstall it first with
jpm remove damascus
. Then install the your jar withjpm install ./damascus.jar
.
Please see more detailed settings here
Damascus is including lombok library, so annotation library for lombok needs to be properly installed on IDEs. Here are how to apply lombok to Eclipse / IntelliJ
- Download lombok https://projectlombok.org/download
- double click
lombok.jar
and select the directory whereeclipse.exe
exist - Run
gradle eclipse
at the project directory and restart IDE, and right click on the project and display context name, and choosegradle > Refresh gradle project
- Java files will be displayed properly without errors.
Preferences - Plugins
and search Lombok. Install the Lombok plugin.Preferences - Build, Execution, Deployment - Compiler - Annotation Processors
and checkEnable annotation processing
In terms of bugs, please post Github issues or send me a PR. To send me PR, please follow the process below.
- Fix bugs at your local
- Remove
${user}/.damascus
folder. - Run test locally with this command
gradle clean test
and confirm your fix pass all tests. - Send PR to /development repository. I'll create a fix brunch accordingly.
Contribution is always welcome! In terms of an Enhancement request, please follow the process below. If you wonder it's a complex feature, please create an issue first and let's discuss. In terms of simple enhancement, please follow steps below.
- After implemented your feature, please add a test as well. Spock test is preferable because it's more readable and flexible to add tests later on. To add tests, tests are separated by classes and in a test class, each test should be written each method basis.
- Run test locally with
gradle clean test
until your code pass all tests - Send a PR to /development branch. According to the status of Travis CI / Appveyor, I may create a feature branch and request you to make it pass the test on Travis CI / Appveyor environment.
- After all tests pass on Travis CI / Appveyor, will marge into development branch and relase into master at some points according to the impact of the code.
Damascus is named after "Damascus blade", which is a strong / sharp blade made out from Damascus steel and forged with a lost technology. Liferay has it's official development tool,"Blade", so I gave this name in hope of reinforcement or extension of Blade tool.