Posts

MVC Action Command

 We can create liferay mvc portlet in two ways .  1) Writing all lifecycle methods( render , action , resouce  ) in single portlet class If you have a small application that won’t be heavy on controller logic , you can put all your controller code in the -Portlet class 2) Will divide the controller into MVC Action Command classes, MVC Render Command classes, and MVC Resource Command classes. We are familiar with the first Approach . Lets explore  on the second approach .   We have two scenarios  1)   Creating new Action Command for our custom portlet .   --> Create new module project with mvc-portlet template  and project name "sample-portlet" --> create a action url in jsp  <portlet:actionURL  name="/samplePortlet/addEntity" var="addEntityURL" >                 <portlet:param name="Entity" value="1234" /> </portlet:actionURL> --> Create  SampleActionCommand class which extends  BaseMVCActionCommand Below impo

Liferay 7.3 scheduler Entry

 A scheduler serves to perform background tasks at certain defined intervals. StorageType Information we should first discuss the supported StorageTypes. Liferay has three supported StorageTypes: StorageType.MEMORY_CLUSTERED - This is the default storage type . This storage type combines two aspects, MEMORY and CLUSTERED. For MEMORY, Its not persisted in DB , but stored in Memory . For CLUSTERED, the job is cluster-aware meaning that  at any point of time job will run in only one node in the cluster. StorageType.MEMORY - No job information is persisted. The important part here is that you may miss some job runs in cases of outages.  And unlike in PERSISTED, when the server comes up the job will not run even though it was missed. Note that this storage type is not cluster-aware, so your job will run on every node in the cluster which could cause duplicate runs. StorageType.PERSISTED -Job details will be persisted in the database. If there is an outage and job did not trigger , when th