Tuesday 1 February 2022

JavaScript - Single Line IF ELSE

properties['Value'] = (IsItMuted === true) ? 'On' : 'Off';  

The ? : is called a ternary operator and acts just like an if/else when used in an expression

var testValue= (props.brtUser === 'No') ? 'Promote to User' : 'Demote to Contact';

Use this <p>{testValue}</p>

Friday 7 January 2022

What is OSGI?

 OSGI Lifecycle

Since Liferay has adopted OSGI standards it is necessary for us to know basic's of OSGI.

OSGI-stands for  Open Services Gateway initiative.

OSGI is a Java framework for developing and deploying dynamic modular software applications. 

Basic OSGI Module Lifecycle

OSGI Lifecycle includes following states
  1. Installed
  2. Resolved
  3. Starting
  4. Active
  5. Stopping
  6. Uninstalled


1) Installed
The bundle has been installed into the OSGi container, but some required bundle dependencies is missing the bundle in this state can’t be start.

2) Resolved
When bundle is in resolved state means all the required 
dependencies is available.And bundle is ready to be started.

3) Starting
Bundle is being started and BundleActivator.start() method is 
executed.
Bundle with lazy activation policy stay in this state until one of 
class file is loaded.It is state between resolved and active.

4) Active 
The bundle is active and running.

5) Stopping
Bundle is being stopped & BundleActivator.stop() method is 
executed.After stopping state is complete it again enters in to resolved state,Once enter in resolved state it can again started.

6) Uninstalled
Bundle has been removed from OSGI container.