Posts

Showing posts from October, 2018
https://www.itworldcanada.com/article/digital-transformation-company-veriday-says-there-is-a-growing-market-for-software-solution-provider-liferay-in-canada/409951

Top Two Liferay Reference Websites

http://www.opensource-techblog.com/complete-liferay-guide http://proliferay.com Liferay is built using the most popular Enterprise Java development stack these days, which is Spring on Hibernate. The web side of it uses JSPs and the Struts framework, which is from the days when Struts was the de facto Java web framework. The client side UI uses a JavaScript framework called AlloyUI, which is developed internally at Liferay and is built on the Yahoo YUI user interface library.  (written on 2012 tho)

Ajax

Image
Update a web page without reloading the page Request data from a server - after the page has loaded Receive data from a server - after the page has loaded Send data to a server - in the background http://www.opensource-techblog.com/2015/07/aui-ajax-in-liferay-portlet.html

node npm questions

As long as you have the latest version of npm, there is no need for upgrading node version when you try to run gulp deploy, if it throws an error regarding ruby scss (npm rebuild scss..), it is because Window os does not recognize ruby scss. So it needs an extra step to run npm rebuild scss. (It would not ask if you run the command on Linux)
Blockchain is a great tool that allows multiple parties to collaborate without having to trust each other. Transparency. Trust Correspondent Bank, Counterfeit (Drug...), Smart Contract, Vote What is my blockchain strategy? How can I build a blockchain? ( open API ex) Hyper ledger multi chain)

Running Vue app (Node app)

Before running an app, make sure that package.json includes scripts like the following "scripts": {    "serve": "vue-cli-service serve",    "build": "vue-cli-service build" }, so that, the following commands are recognized in cmd. npm run build : build a project for production npm run serve : open a default port (8080) and run a project (it invokes an implemented router and compile and deploy the projects to the server) --> Good thing about this is that the server detects changes in a project and apply them in real time.

2018 Oct 17 Start

Image
https://blockgeeks.com/guides/what-is-blockchain-technology/ https://cryptoslate.com/south-korean-company-awarded-fintech-security-patent/

GoGo Shell & What can be deleted in Liferay Instance

In Liferay Instance, remove 'state' in osgi & 'work' in tomcat to remove all histories. GoGoShell is for checking the current state of each jar files in modules. pen cmd as admin and type 'telnet localhost 11311' lb : list all the jar files with state stop 70 (jar file numner) / start 70 (uninstall 70 but for deletion, it would be better to delete jar file from module folder physically) )

Creating Vue.js app (node app) through Vue-cli

Image
The name "project" is default. Babel : JavaScript Compiler TypeScript : Typed superset of JavaScript  / object-oriented javascript / supplements the failure of object-oriented features such as strong type checking and compile-time error check TSLing (Linter) : TypeScript Linting Vuex : State management pattern + library for Vue.js application. It is designed for managing multiple components that share common state. Suitable for large-scale SPA due to the cost of more concept and boilerplate to understand. References https://spin.atomicobject.com/2017/06/05/tslint-linting-setup/ https://vuex.vuejs.org/

Initialization & Configuration for Liferay Setup on remote server

/ != /root /tmp is a location for temporary folder which has all permissions 777. It is a good place to import files from external system. /opt is where to keep custom or manual applications.(Liferay, DA) /home is where a user is Run to upload file to server (-r : recursively copy)  scp -r liferay-ce-portal-tomcat-7.0-ga5-20171018150113838.zip root@74.208.244.157:/tmp/ (ran it on Ubuntu) In Putty(terminal), go to /tmp apt-get update (refresh the repo) apt-get install unzip unzip xxx.zip mv liferay-ce-portal-7.0-ga5/ ../opt/  systemctl status mysql : to check mysql status systemctl start mysql  systemctl stop mysql Go into mysql server and  create database lportal character set utf8; exit ------------------------------------------------------------- For java (make sure it is not open jdk since it does not meet requirements for liferay) 1. Add the PPA add-apt-repository ppa:webupd8team/java (anywhere cuz it is global

PWA / SPA

Image
Progressive Web App is a hybrid of web and native apps. * Advantages - reliable : fast loading and works offline (caching the data) - fast - engagable - app-like Single Page Application * Advantages - less server required - independence of font-end development - no restriction of languages of bank-end services. Vue.js   is capable of creating SPA and PWA References https://medium.freecodecamp.org/progressive-web-apps-101-the-what-why-and-how-4aa5e9065ac2 https://www.bloomreach.com/en/blog/2018/07/what-is-a-single-page-application.html

JSON Web Token with REST Security

Image
# JWT (JSON Web Token) One of the main features of REST API is statelessness which means the server does not keep any client state (every HTTP Request happens in complete isolation), and this is where security issues arise as session for authentication and security is not used. Instead, REST API uses arbitrary tokens to authenticate clients. As one of the standard for creating tokens, JSON Web Token is used to authenticate on the web in general, not only for REST services. It pass the identity of authenticated users and carry all the user's claims, such as authorization data. Single Sign On is one of examples of JWT * Liferay DXP uses OAuth 2.0 which is also token-based authentication. References https://www.toptal.com/java/rest-security-with-jwt-spring-security-and-java https://jwt.io/introduction/ https://dev.liferay.com/discover/deployment/-/knowledge_base/7-1/securing-product

Request and Response Model Classes

Json payload to be sent to web service endpoint for user creation would be look like { "firstName" : "Claire" "lastName" : "Min" "email" : "test@test.com" "password" : "123" } Web service endpoint will accept the Jason payload and convert it into Java object which is used to persist into database. Since Spring Boot framework does all of conversions like Json/xml to Java or Java to Json/xml automatically, what needs to be done for the conversions is to create Java class that matches each fields (firstName, lastName, ...). * Method to handle HTTP Post Request ex ) In RestController, @PostMapping public String createUser(@RequestBody UserDetailsRequestModel userDetails) {} This method will be triggered when it receives HTTP Post request. In order for the method to read the body of the HTTP request, and convert the Json body into Java object(UserDetailsRequestModel), @RequestBody is needed.

DB Connection with App

Methods for each CRUD operations have been created in the Controller and spring annotations such as @RestController and @RequestMapping have been used to bind each method to appropriate HTTP method. Make them accept request parameters or JSON payload and work properly to CRUD users Enable an app to communicate with  MySQL Database * Update pom.xml Spring Data JPA is used to store information into MySQL Database (store Java object into MySQL) MySQL Connector is needed to connect an application to database. <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-data-jpa</artifactId> </dependency> <dependency> <groupId>mysql</groupId> <artifactId>mysql-connector-java</artifactId> </dependency> Once building the project with above two additional dependencies, Maven will go into its repository and take those two dependencies. It will download the correspon

Give and Take - Adam Grant

Image
"by encouraging us to expect the worst in others it brings out the worst in us: dreading the role of the chump, we are often loath to heed our nobler instincts." "You never know where somebody's going to end up. It's not just about building your reputation; it really is about being there for other people."
Look beyond

RESTful Web Service

Image
# HTTP Request and Response Once a web service is created, front-end will be able to communicate with the service by sending a HTTP request which contains information needed for specific operation to be performed by the web service. HTTP methods are used to specify how the information will be passed in the HTTP reqeust and which operation needs to be performed by the web service. Server side needs to know what type of contents a HTTP request carries in its body (XML or JSON...), so that they can convert it to Java object, and vice versa. HTTP headers include these information. HTTP headers - Content-Type : in request - Accept : in response # RESTful Web Service (API) -  Representational State Transfer (REST) is an architectural style * Advantages Client-Server: This constraint operates on the concept that the client and the server should be separate from each other and allowed to evolve individually. Stateless: REST APIs are stateless, meaning that calls ca

Virtual Private Servers (VPS)

Image
https://dzone.com/articles/hosting-java-web-applications- * Java is available only in VPS or dedicated hosting. (need to purchase VPS again...) http://www.hostjury.com/blog/view/482/godaddy-decides-removing-java-is-best-for-clients

MySQL Server Setup

Image
* MySQL Server Setup https://dev.mysql.com/downloads/windows/installer/8.0.html Download the bottom one (mysql-installer-community-8.0.12.0.msi) 1. Installation Open Installer, and install MySQL Server and MySQL Workbench through the Installer (If requirement is not fulfilled in 'Check Requirements' step, click 'Execute' below to resolve it, and move to next 2. Configuration Leave the default setup and finish configuration. (You can uncheck "Start the MySQL Server at System Startup".) * In case you choose "Use Strong Password Encrytion for Authentication" over "Use Legacy Authentication Method", the following entry should be added to MySQL configuration file (ex. my.ini) 2 [ mysqld ] default - authentication - plugin = mysql_native_password 3. Initializtion MySQL configuration file is required to run the server, and this file is auto-created in C:\ProgramData\MySQL\MySQL Server 8.0 during the installation