Welcome to board, Liferer!
This doc was wrote to help you to configure your machine to start coding in our project!
We suppose that you're on a Liferay Machine with the liferay-portal's repository and other pre-configurations.
TBD
Check before if your
origin
repository is a fork project from Liferay and if yourupstream
is the original Liferay's project usingg remote -v
!
Update your fork with last commit from original project:
$ g co master && g pull upstream master && g push -f
Choose a alias for the solutions' repository by <NAME>
. eg: solution
or pt-liferay-solution
$ g remote add <NAME> [email protected]:pt-liferay-solutions/liferay-portal.git
Update the Raylife´s branch
$ git fetch solution raylife
Remember:
solution
is the alias choosen in the step before, notice to change if you choose other.
Create a new local branch to get the branch and choose your name by <BRANCH>
. eg: raylife
g co -b <BRANCH>
Notice that choose
raylife
as name of your new branch does not represent the realsolutions/raylife
that we fetched before.
Update your new branch with the real Raylife's branch
$ g rebase solution/raylife
Compare your log with the commit list in the Github Page
$ g log
If isn't equal, try this
$ g reset solutions/raylife --hard
PUF! Finally you have the most update Raylife's code! Let's continue!
After update so many thing we need to build the Liferay Portal!
$ cdt && ant clean && ant all
If you want change to Hypersonic to MySQL or forgot the credentials to access, you need do this below ;)
Delete the cache settings
$ cd ~/dev/bundles/master
$ rm -rf data elasticsearch7 osgi/state
Delete the settings file
$ rm portal-setup-wizard.properties
Up the project in Tomcat
$ catalina run
Up the MySQL on Docker
$ d-mysql8
Yes, strange command, right? I'm using custom alias!
Wait for it. After open (alone) the localhost:8080
in browser, you need to fill the mail field with [email protected]
and password with test
.
In database topic, click on (change) e choose MySQL. Replace the Username and Password fields with the you are using to up your database.
After fill everything correctly, click on Finish. At last, after load, restart the catalina
using Ctrl + C to down, and running the command above again, to up it.
All right!!! Sign in with [email protected]
and test
as password aaaandd WELCOME to Liferay Portal.
We have a remote web component to use in the Liferay Portal
$ cdt && cd modules/apps/site/site-insurance-site-initializer/remote-web-components/raylife-d2c-web/
Install the dependencies
$ yarn
Build the project to Liferay
$ yarn build:liferay
Up the server
$ yarn serve:liferay
If you open on localhost:5000
, you will see the project, but we need put it inside the Liferay Portal.
For us, it's important the path? localhost:5000/liferay/js
.
After Sign in on Liferay Portal, go to Global Menu (Grid icon) > Control Panel > System Settings and in Content and Data topic notice that there aren't a Widget Tool. We need deploy it to Liferay Portal
$ cdt && cd modules/apps/remote-web-component/remote-web-component-admin-web && gw clean deploy
Refrash the page and look the magic!
We need to add a configure entry to our remote web component started in the section above, so click on Add.
The next step it's fill the follow fields:
- Web Component Name (eg. d2c-web)
- Custom Element Name (with same Web Component Name)
- Web Component URL(s) (with files present on
localhost:5000/liferay/js
in the remote web component)- For more than one, click on + to open another field to put the other path
- Portlet Display Category (with same Web Component Name)
After click on Save you are able to use the Remote Web Component whenever it's up at localhost:5000
.
- Go to Global Menu (Grid icon) > Control Panel > Sites.
- Click on + blue icon.
- Select Raylife.
- The name field ALWAYS be
Raylife
.
Tcharam!
On URL, at the final, add get-a-quote
. In this page, edit, clicking on pencil icon at the top bar e search in Widgets for our new component. Drag and Drop it! Have fun!
TBD
TBD
Because programmers are lazy ;)
These custom settings need to be putting inside
~/.bashrc
.
To use catalina
for up and down our Liferay Portal
alias catalina="~/dev/bundles/master/tomcat-*/bin/catalina.sh"
To use, we need
$ catalina run
$ catalina stop
To up a MySQL in background inside Docker
alias d-mysql="d run -e MYSQL_ALLOW_EMPTY_PASSWORD=yes -e MYSQL_DATABASE=lportal -e MYSQL_PASSWORD=<PASSWORD> -e MYSQL_USER=<USER> -d --restart=always -p 3306:3306 mysql:5.7 --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci"
Remember to change
<PASSWORD>
and<USER>
with the credentials that you configure the Liferay Portal initialy.
To use, we need
$ d-mysql8