How to Install/Add Bundles, Content Packages or Configurations at Runtime CRX in AEM/Adobe CQ5
Install Bundles, Content Packages or Configurations at Runtime
If you want to install additional packages into the CRX , Create install folder under the crx-quickstart.Put your bundles, content packages or configurations in install folder. It will pick up while instance start and install into the CRX repository. Packages will install into CRX in the alphabetic order.
References :
AEM Documentation
Adobe Community
You can define additional bundles based on run modes
for this you need to create install.<run mode> folder.for more information click here
AEM6 /Adobe CQ5 How to Add and Read Bundle / Service Configurations(String, Dropdown, Array/Multifield )
Adding Properties to the Bundle/ OSGI CQ Service
String / TextField
@Property(value = "GET")
static final String STRING_VAL = "string.textfield";
String Array / Multifield
@Property ( unbounded=PropertyUnbounded.ARRAY, value={"*"},label="Template paths",description="eg: /apps/devtools/templates/page-home" )
private static final String MUTIFIELD_EX = "multifield.test";
Boolean Field
@Property(boolValue={false}, label="Boolean values", description="Booealn test")
private static final String BOOLEN_TEST = "boolean_test";
Dropdown
@Property( options={
@PropertyOption(name="blue", value="color-blue"),
@PropertyOption(name="green", value="color-green"),
@PropertyOption(name="red", value="color-red"),
@PropertyOption(name="yellow", value="color-yellow"),
private static final String SELECTION_TEST = "dropdown.test";
Reading Properties of Bundle/ OSGI CQ Service
1) You to get the ConfigurationAdmin reference
@Reference
ConfigurationAdmin configAdmin;
2) Get Bundle Configuratinn
Configuration config = configAdmin.getConfiguration(this.getClass().getCanonicalName());
3) Get properties of conguration
Dictionary<?, ?> configProperties = config.getProperties();
4) Red Properties
Reading String/TextField
String texfiledValue = (String) configProperties.get( STRING_VAL );
Reading the Dropdown
String dropdownTest = (String) configProperties.get( SELECTION_TEST );
Reading Boolean
Boolean booealnTest = ( Boolean ) configProperties.get( BOOLEN_TEST );
Reading Array/Multifield
String[] multifieldVlaues = (String[]) configProperties.get( MUTIFIELD_EX );
for( String value : multifieldVlaues ){
out.println( value );
}
Subscribe to:
Posts (Atom)
-
How to Load TouchUI dialog Specific Clientlibs For touch UI dialog we can load specific client libs by using extraClientlibs property t...
-
Open package manager http://localhost:5632/crx/packmgr/index.jsp Click on the crate packge Enter package name ,versi...
-
1. Create a clientlibs node (nodeTypecq:ClientLibraryFolder) under the root node of the project. e.g. /apps/training Assign the foll...
-
Sample Code Snippet HTL(Sightly) Component Snippet <div data-sly-use.mapIterator="MapIterator"> <!--/* Get value o...
-
AEM CSRF Issue / Forbidden POST Call in AEM AEM providing CSRF Protection from 6.0 version on wards. if you are using granite.jquery d...