Tag: AEM 6.3

Restrict access to links in Global navigation panel

We often have to tighten the link access in AEM to limit user access to only few links, like only Sites, Experience fragments.

 

For AEM 6.3 touch UI, if you wish to revoke access on a link in Global Navigation Panel, you will have to follow 2 steps:

  1. Revoke access on the icon that displays the link on Global Navigation Panel
  2. Revoke access on the link resource, so that you cannot access the URL from browser directly.

The following table lists both the icon path and resource that renders a link (Example: Sites, Projects, Screens etc). You would have to revoke read access on relevant paths to meet the customer needs.

Column details:

  • “Browser URL in AEM” is the URL that AEM redirects you to, when you click an item in Global navigation panel
  • “Node rendering the menu link”: Revoking read access on these nodes will assure that you cannot directly access the corresponding “Browser URL in AEM”
  • “Global Navigation Panel Icon”: Revoking read access on these nodes will assure that you cannot access the Menu item in Global Navigation Panel

Navigation Tab

Link Browser URL in AEM Node rendering the menu link Global Navigation Panel Icon
Projects /projects.html/content/projects /libs/cq/core/content/projects /libs/cq/core/content/nav/projects
Sites /sites.html/content /libs/wcm/core/content/sites /libs/cq/core/content/nav/sites
Experience fragments /aem/experience-fragments.html/content/experience-fragments /libs/cq/experience-fragments/content/experience-fragments /libs/cq/core/content/nav/experiencefragments
Screens /screens.html/content/screens /libs/screens/dcc/content/main /libs/cq/core/content/nav/screens
Assets
Files /assets.html/content/dam /libs/dam/gui/content/assets /libs/cq/core/content/nav/assets/files
Collections /libs/dam/gui/content/collections.html/content/dam/collections /libs/dam/gui/content/collections /libs/cq/core/content/nav/assets/collections
Shared links /libs/dam/gui/content/assets/mylinkshares.html /libs/dam/gui/content/assets/mylinkshares /libs/cq/core/content/nav/assets/links
Templates /libs/dam/gui/content/idsprint/templates.html/content/dam/templates /libs/dam/gui/content/idsprint/templates /libs/cq/core/content/nav/assets/templates
Catalogs /libs/dam/gui/content/idsprint/catalogs.html/content/dam/catalogs /libs/dam/gui/content/idsprint/catalogs /libs/cq/core/content/nav/assets/catalogs
Content Services
Apps /aem/apps.html/content/mobileapps /libs/mobileapps/admin/content/catalog /libs/cq/core/content/nav/contentservices/apps
Forms
Forms & documents /aem/forms.html/content/dam/formsanddocuments /libs/fd/fm/gui/content/forms /libs/cq/core/content/nav/forms/formsanddocuments
Themes /aem/forms.html/content/dam/formsanddocuments-themes /libs/fd/fm/gui/content/forms /libs/cq/core/content/nav/forms/themes
Personalization
Activities /libs/cq/personalization/touch-ui/content/activities.html /libs/cq/personalization/touch-ui/content/activities /libs/cq/core/content/nav/personalization/activities
Offers /libs/cq/personalization/touch-ui/content/offers.html /libs/cq/personalization/touch-ui/content/offers /libs/cq/core/content/nav/personalization/offers
Audiences /libs/cq/personalization/touch-ui/content/audiences.html /libs/cq/personalization/touch-ui/content/audiences /libs/cq/core/content/nav/personalization/audiences
Commerce
Catalogs /aem/catalogs.html/content/catalogs /libs/commerce/gui/content/catalogs /libs/cq/core/content/nav/commerce/catalogs
Products /aem/products.html/etc/commerce/products /libs/commerce/gui/content/products /libs/cq/core/content/nav/commerce/products
Collections /aem/collections.html/etc/commerce/collections /libs/commerce/gui/content/collections /libs/cq/core/content/nav/commerce/collections
Orders /aem/orders.html/etc/commerce/orders /libs/commerce/gui/content/orders /libs/cq/core/content/nav/commerce/orders
Communities
Sites /communities/sites /libs/social/console/content-shell3/sites /libs/cq/core/content/nav/communities/sites
Moderation /communities/moderation.html/content/sites /libs/social/moderation/content-shell3/admindashboard /libs/cq/core/content/nav/communities/moderation
Reports /communities/reports /libs/social/reporting/content-shell3/reports$1 /libs/cq/core/content/nav/communities/reports
Resources /communities/resources /libs/social/enablement/content-shell3/enablement-sites /libs/cq/core/content/nav/communities/resources
Groups /communities/groups.html/content /libs/social/members/content-shell3/groups /libs/cq/core/content/nav/communities/groups
Members /communities/members.html/content /libs/social/members/content-shell3/members /libs/cq/core/content/nav/communities/members

Tools Tab

Link Browser URL in AEM Node rendering the menu link Global Navigation Panel Icon
General
CRXDE Lite /crx/de/index.jsp /libs/cq/core/content/nav/tools/general/crxdelite
Search Forms /libs/cq/core/content/tools/customsearch/searchfacetformlister.html /libs/cq/core/content/tools/customsearch/searchfacetformlister /libs/cq/core/content/nav/tools/general/customsearchfacets
Tagging /libs/cq/tagging/gui/content/tags.html/etc/tags /libs/cq/tagging/gui/content/tags/etc/tags /libs/cq/core/content/nav/tools/general/tagging
Templates /libs/wcm/core/content/sites/templates.html/conf /libs/wcm/core/content/sites/templates /libs/cq/core/content/nav/tools/general/templates
Translation Configuration /libs/cq/translation/translationrules/contexts.html /libs/cq/translation/translationrules/contexts /libs/cq/core/content/nav/tools/general/translationRules
Components /libs/wcm/core/content/sites/components.html /libs/wcm/core/content/sites/components /libs/cq/core/content/nav/tools/general/components
Configuration Browser /libs/granite/configurations/content/view.html/conf /libs/granite/configurations/content/view/conf /libs/cq/core/content/nav/tools/general/configuration-browser
Workflow
Models /libs/cq/workflow/admin/console/content/models.html/etc/workflow/models /libs/cq/workflow/admin/console/content/models/etc/workflow/models /libs/cq/core/content/nav/tools/workflow/models
Instances /libs/cq/workflow/admin/console/content/instances.html /libs/cq/workflow/admin/console/content/instances /libs/cq/core/content/nav/tools/workflow/instances
Launchers /libs/cq/workflow/admin/console/content/launchers.html /libs/cq/workflow/admin/console/content/launchers /libs/cq/core/content/nav/tools/workflow/launchers
Archive /libs/cq/workflow/admin/console/content/archive.html /libs/cq/workflow/admin/console/content/archive /libs/cq/core/content/nav/tools/workflow/archive
Failures /libs/cq/workflow/admin/console/content/failures.html /libs/cq/workflow/admin/console/content/failures /libs/cq/core/content/nav/tools/workflow/failures
Operations
Web Console /system/console/configMgr Please use the steps on following link to provide access:
https://sling.apache.org/documentation/bundles/web-console-extensions.html
/libs/cq/core/content/nav/tools/operations/webconsole
Testing /libs/granite/testing/hobbes.html /libs/granite/testing/hobbes /libs/cq/core/content/nav/tools/operations/testing
Configuration /miscadmin /libs/wcm/core/content/misc /libs/cq/core/content/nav/tools/operations/configuration
Backup /libs/granite/backup/content/admin.html /libs/granite/backup/content/admin /libs/cq/core/content/nav/tools/operations/backup
Maintenance /libs/granite/operations/content/maintenance.html /libs/granite/operations/content/maintenance /libs/cq/core/content/nav/tools/operations/maintenance
Health Reports /libs/granite/operations/content/healthreports/healthreportlist.html /libs/granite/operations/content/healthreports/healthreportlist /libs/cq/core/content/nav/tools/operations/healthreports
Monitoring /libs/granite/operations/content/monitoring/page.html /libs/granite/operations/content/monitoring/page /libs/cq/core/content/nav/tools/operations/monitoring
Diagnosis /libs/granite/operations/content/diagnosis.html /libs/granite/operations/content/diagnosis /libs/cq/core/content/nav/tools/operations/diagnosis
Sites
Blueprints /libs/wcm/msm/gui/content/blueprintconfig.html /libs/wcm/msm/gui/content/blueprintconfig /libs/cq/core/content/nav/tools/sites/blueprints
Launches /libs/launches/content/launches.html /libs/launches/content/launches /libs/cq/core/content/nav/tools/sites/launches
ContextHub /etc/cloudsettings.html /etc/cloudsettings /libs/cq/core/content/nav/tools/sites/contexthub
Assets
Assets in left menu /libs/cq/core/content/nav/tools/assets
Metadata Profiles /libs/dam/gui/content/processingprofilepage/metadataprofiles.html /libs/dam/gui/content/processingprofilepage/metadataprofiles /libs/dam/gui/content/nav/tools/assets/metadata
Asset Reports /libs/dam/gui/content/reports/reportspage.html /libs/dam/gui/content/reports/reportspage /libs/dam/gui/content/nav/tools/assets/assetreports
Metadata Schemas /libs/dam/gui/content/metadataschemaeditor/schemalist.html /libs/dam/gui/content/metadataschemaeditor/schemalist /libs/dam/gui/content/nav/tools/assets/metadataschemas
Desktop Tools for AEM http://www.adobe.com/go/desktop-tools-for-aem /libs/dam/gui/content/nav/tools/assets/desktop-tools
Insights Configuration /libs/dam/gui/content/assetinsights/wizard/configure.html /libs/dam/gui/content/assetinsights/wizard/configure /libs/dam/gui/content/nav/tools/assets/configwizard
Resources
Documentation https://www.adobe.com/go/aem6_3_docs_en /libs/cq/core/content/nav/tools/resources/documentation
Developer Resources https://www.adobe.com/go/aem6_3_dev_en /libs/cq/core/content/nav/tools/resources/dev
Deployment
Replication /etc/replication.html /etc/replication /libs/cq/core/content/nav/tools/deployment/replication
Distribution /libs/granite/distribution/content/distribution.html /libs/granite/distribution/content/distribution /libs/cq/core/content/nav/tools/deployment/distribution
Packages /crx/packmgr Please use the steps on following link to revoke access:
https://helpx.adobe.com/experience-manager/kb/LimitAccessCRXandCRXDE.html
/libs/cq/core/content/nav/tools/deployment/packages
Package Share /crx/packageshare Please use the steps on following link to revoke access:
https://helpx.adobe.com/experience-manager/kb/LimitAccessCRXandCRXDE.html
/libs/cq/core/content/nav/tools/deployment/packageshare
Topology /libs/granite/topology/content/view.html /libs/granite/topology/content/view /libs/cq/core/content/nav/tools/deployment/topology
Offloading /libs/granite/offloading/content/view.html /libs/granite/offloading/content/view /libs/cq/core/content/nav/tools/deployment/offloading
Cloud Services /libs/cq/core/content/tools/cloudservices.html /libs/cq/core/content/tools/cloudservices /libs/cq/core/content/nav/tools/deployment/cloudservices
Security
Users /libs/granite/security/content/useradmin.html /libs/granite/security/content/useradmin /libs/cq/core/content/nav/tools/security/users
Groups /libs/granite/security/content/groupadmin.html /libs/granite/security/content/groupadmin /libs/cq/core/content/nav/tools/security/groups
OAuth Clients /libs/granite/oauth/content/clients.html /libs/granite/oauth/content/clients /libs/cq/core/content/nav/tools/security/oauth
Permissions /useradmin /libs/cq/security/content/admin /libs/cq/core/content/nav/tools/security/permissions
Commerce
Payment Methods /libs/commerce/gui/content/paymentmethods.html/etc/commerce/payment-methods /libs/commerce/gui/content/paymentmethods/etc/commerce/payment-methods /libs/cq/core/content/nav/tools/commerce/payment-methods
Shipping Methods /libs/commerce/gui/content/shippingmethods.html/etc/commerce/shipping-methods /libs/commerce/gui/content/shippingmethods/etc/commerce/shipping-methods /libs/cq/core/content/nav/tools/commerce/shipping-methods
Communities
Storage Configuration /communities/admin/defaultsrp /libs/social/console/content-shell3/defaultSrpConfig /libs/cq/core/content/nav/tools/communities/storageconfig
Component Guide /editor.html/content/community-components/en.html /content/community-components/en /libs/cq/core/content/nav/tools/communities/componentguide
Community Functions /communities/communityfunctions /libs/social/console/content-shell3/communityfunctions /libs/cq/core/content/nav/tools/communities/communityfunctions
Group Templates /communities/communitygrouptemplates /libs/social/console/content-shell3/communitygrouptemplates /libs/cq/core/content/nav/tools/communities/communitygrouptemplates
Community Badges /communities/badges /libs/social/gamification/content-shell3/badges /libs/cq/core/content/nav/tools/communities/badges
Sites Templates /communities/communitysitetemplates /libs/social/console/content-shell3/communitysitetemplates /libs/cq/core/content/nav/tools/communities/communitysitetemplates
Advertisements

Customizing AEM Toolbar

Adding new action to an AEM Assets Toolbar consists of 2 steps:

  1. Configure the new action for the toolbar
  2. Add a client library to execute some operation on clicking the action.

In the following example, we are adding ability to publish and unpublish assets from the Collection view.

Icons.PNG

Step 1: Resolving the location of toolbar in CRXDE.

A toolbar’s location can easily be resolved via its page URL.

  1. Copy the URL of the page.
  2. Replace “/mnt/overlay” with “/libs” to resolve toolbar’s path. In our current example:
    • Page URL: /mnt/overlay/dam/gui/content/collections/collectiondetails
    • Toolbar’s location: /libs/dam/gui/content/collections/collectiondetail

 

Step 2: Add the new action to the toolbar

  1. In CRXDE, locate the toolbar via the path resolved in Step-1.
  2. Browse to “<Toolbar’s path>/jcr:content/actions”.
  3. Overlay actions node in “/apps”. This is to ensure that the customization are only done in “/apps” and NOT “/libs”
  4. Add the new required action. In current example, we have copied publish and unpublish actions from:
    • Source:
      • /libs/dam/gui/content/assets/annotate/jcr:content/actions/selection/publish
      • /libs/dam/gui/content/assets/annotate/jcr:content/actions/selection/unpublish
    • Destination:
      • /apps/dam/gui/content/collections/collectiondetail/jcr:content/actions/selection/publish
      • /apps/dam/gui/content/collections/collectiondetail/jcr:content/actions/selection/unpublish
  5. Visit the Collections View. Select an asset. Notice that publish and unpublish actions would now be available. But, clicking on will execute any operation

 

Step 3: Add clientlibs to execute an operation via the newly added actions

  1. In CRXDE, locate the toolbar via the path resolved in Step-1.
  2. Browse to “<Toolbar’s path>/jcr:content/head/clientlibs”.
  3. Overlay clientlibs node in “/apps”. This is to ensure that the customization are only done in “/apps” and NOT “/libs”
  4. Add the required client library to the “categories” property of “/apps/dam/gui/content/collections/collectiondetail/jcr:content/head/clientlibs”
    • For the current example, we have added following client libraries:
      • dam.gui.admin.publishasset.coral
      • dam.gui.admin.unpublishasset.coral

Node View.PNG

Visit the Collections View. Select an asset. You should now be able to publish/unpublish an asset via Collection view 🙂

 

 

DS Annotations – dependency updates

With AEM 6.2, we can use the new Declarative Service annotations. These are improvements over Felix annotations. Adding the recommendation excerpt from Apache Felix website:

While the Apache Felix Maven SCR Plugin is a great tool (see below), for developing OSGi components using Declarative Services you should use the official annotations from the OSGi R6 specification. The development of the Apache Felix SCR Plugin is in maintenance mode.

The examples and dependencies have been verified on AEM 6.3 Instance

Maven dependency changes:

In order to use the new OSGi annotations, we need to add following dependencies to pom.xml.

 
     org.osgi
     osgi.core
     6.0.0
     provided
 
 
     org.osgi
     osgi.cmpn
     6.0.0
     provided
 
 
     org.osgi
     osgi.annotation
     6.0.1
     provided
 
 

Use latest version of maven-bundle-plugin (>=3.2.0)

For a project upgrading from Felix to DS annotations, you can remove following:

  • All Felix dependencies. Example:
    • org.apache.felix.scr.annotations
    • biz.aQute.bnd
  • Plugins
    • maven-scr-plugin: is required to resolve felix annotations at build time

Code changes:

You can choose to update java files at once, or one-by-one.

  • Incase you wish to modify all files together, then remove felix dependencies and plugins. The IDE would now recognize all the files that need modifcation.
  • However, if you wish to change files one-by-one, then you can keep both DS and Felix dependencies in pom.xml. A bundle with both types of annotations would still be good. Once all the code changes are done, you should remove all felix dependencies.

How to identify the changes:

You can easily identify the files, by looking for package imports of “org.apache.felix.scr.annotations.*”.

We would be using the following packages instead:

  • org.osgi.service.component.annotations.*
  • org.osgi.service.metatype.annotations.*

For more details on code changes involved, please visit the specific links:

Verify annotation resolution

To verify if the DS annotation is generated:

  • decompile the jar created after mvn clean install
  • Check for the Service description available below /OSGI-INF/ folder

service-description.PNG

 

DS Annotations – Component, property and configurations

@Component Annotation

An component is a piece of code that is managed by OSGi container. The container would be responsible for its instantiation and management.

A component is activated only after all its service dependencies are satisfied by the container.

Attributes of a component: 

component-attributes.PNG

The above table have been noted from: https://www.knopflerfish.org/releases/5.2.0/docs/javadoc/org/osgi/service/component/annotations/Component.html

  • configurationPolicy: The attribute can hold following values of ConfigurationPolicy
    • IGNORE: Always allow the component configuration to be satisfied and do not use the corresponding Configuration object even if it is present.
    • OPTIONAL: Use the corresponding Configuration object if present but allow the component to be satisfied even if the corresponding Configuration object is not present.
    • REQUIRE: There must be a corresponding Configuration object for the component configuration to become satisfied.
  • factory: used to create a configuration factory. More implementation details are available on link.
  • name: The attribute doesn’t support special characters. If invalid, the component will not be registered.
  • property: A replacement for “@Properties felix annotation used at Class-level”.
  • service: registers component as a Service. More implementation details available on link.

Example:

To create a component, add @Component annotation to a class. Also, configure its attributes as per your need.

In the following example, we have:

  • @Activate annotation is used to mark a function which would be called when the component activates. The function can have any name.
  • @Deactivate annotation is used to mark a function which would be called when the component deactivates. The function can have any name.
  • Declared a custom property using property attribute.
    • The property value is read from componentContext in @Activate/@Deactivate methods.

More on defining property:

One may also need to declare multiple properties of a component. In such scenarios, declare an array of values for property attribute:

To define multiple values of a property, create each value as a separate element of the property Array.

 

 

Creating configurable properties

The annotations described in this section will help you to create Components whose configurations can be edited via OSGi console. To achieve the same:

  1. Create a separate or an inner interface which would hold configurations. In example, we have created Config interface.
  2. Add @ObjectClassDefinition annotation to the interface. Also, add desired attributes
    • name: The name would help you search the configuration in OSGi’s configuration manager.
  3. Add @Designate to the Component that would consume the configurations.  The ocd attribute should refer to the Configuration interface created in Step-2.
  4. Declare properties that you would like to configure via @AttributeDefinition
    • Following image maps annotation attributes with the OSGi UI.osgi.PNG
    • Please note that there are 2 ways to define default values:
      • defaultValue attribute of @AttributeDefinition: The value is displayed to the user, when he/she tries to configure the interface via Configuration manager. OSGi will NOT pick this default value, if no Configuration exists. Thus, when you install a bundle, the output would appear as:default-values.PNG
      • Specifying default value in variable declarartion: The value is displayed to the user, when he/she tries to configure the interface via Configuration manager. OSGi will pick this default value, even if no Configuration exists.

Also, note that we no longer need PropertiesUtil to resolve OSGi configurations. 🙂

Notes:

Via Declarative Services, the number of annotations have been reduced. For example: @Component annotation is used for:

  • Component
  • Service
  • Servlet
  • Filter etc..

All of the above can be created by utilizing attributes of @Component details. More details are available on specific links

 

 

Coral 3 – Granite UI components

There are few modifications to the way Granite UI components are configured for Coral 3 components. Example: radio, checkbox, multifield etc.

Sharing snippets for frequently used Granite UI components (verified on AEM 6.3):

Alert:

<readonlySelectedAlert
   granite:class="cmp-form-textfield-readonlyselected-alert"
   jcr:primaryType="nt:unstructured"
   sling:resourceType="granite/ui/components/coral/foundation/alert"
   size="S"
   text="Alert text"
   variant="warning"/>

Accordian:

<accordion
    granite:class="js-cq-IPEPlugin-container"
    jcr:primaryType="nt:unstructured"
    sling:resourceType="granite/ui/components/coral/foundation/accordion"
    variant="quiet">
    <items jcr:primaryType="nt:unstructured">
        <source
           jcr:primaryType="nt:unstructured"
           jcr:title="Source"
           sling:resourceType="granite/ui/components/coral/foundation/container"
           maximized="{Boolean}true">
            <items jcr:primaryType="nt:unstructured">
                <allowupload
                    granite:class="js-cq-ImageEditor-allowUpload"
                    jcr:primaryType="nt:unstructured"
                    sling:resourceType="granite/ui/components/coral/foundation/form/checkbox"
                    checked="{Boolean}true"
                    deleteHint="{Boolean}false"
                    name="./allowUpload"
                    text="Allow asset upload from file system"
                    uncheckedValue="{Boolean}false"
                    value="{Boolean}true"/>
            </items>
           <parentConfig
               jcr:primaryType="nt:unstructured"
               active="{Boolean}true"/>
       </source>
       <orientation
               granite:class="js-cq-IPEPlugin-group"
               jcr:primaryType="nt:unstructured"
               jcr:title="Orientation"
               sling:resourceType="granite/ui/components/coral/foundation/container"
               maximized="{Boolean}true">
           <items jcr:primaryType="nt:unstructured">
               <rotate
                   jcr:primaryType="nt:unstructured"
                   jcr:title="Rotate"
                   sling:resourceType="cq/gui/components/authoring/dialog/inplaceediting/configuration/plugin"
                   features="right"
                   name="rotate"/>
               <flip
                   jcr:primaryType="nt:unstructured"
                   jcr:title="Flip"
                   sling:resourceType="cq/gui/components/authoring/dialog/inplaceediting/configuration/plugin"
                   features="horizontal,vertical"
                   name="flip"/>
           </items>
       </orientation>
       <crop
           granite:class="js-cq-IPEPlugin-group"
           jcr:primaryType="nt:unstructured"
           jcr:title="Cropping"
           sling:resourceType="granite/ui/components/coral/foundation/container"
           maximized="{Boolean}true">
           <items jcr:primaryType="nt:unstructured">
               <crop
                   jcr:primaryType="nt:unstructured"
                   jcr:title="Allow crop"
                   sling:resourceType="cq/gui/components/authoring/dialog/inplaceediting/configuration/plugin"
                   features="*"
                   name="crop"/>
                   <configWrapper
                       jcr:primaryType="nt:unstructured"
                       sling:resourceType="cq/gui/components/authoring/dialog/inplaceediting/configuration/wrapper"
                       configPath="./plugins/crop/aspectRatios">
                       <aspectratios
                           granite:class="cq-AspectRatio"
                           jcr:primaryType="nt:unstructured"
                           sling:resourceType="granite/ui/components/coral/foundation/form/multifield"
                           composite="{Boolean}true"
                           fieldLabel="Aspect ratios">
                           <field
                               granite:class="cq-AspectRatio-field"
                               jcr:primaryType="nt:unstructured"
                               sling:resourceType="granite/ui/components/coral/foundation/container"
                               name="./plugins/crop/aspectRatios">
                               <items jcr:primaryType="nt:unstructured">
                                   <name
                                       granite:class="cq-AspectRatio-name"
                                       jcr:primaryType="nt:unstructured"
                                       sling:resourceType="granite/ui/components/coral/foundation/form/textfield"
                                       fieldLabel="Name"
                                       name="name"/>
                                   <ratio
                                       granite:class="cq-AspectRatio-ratio"
                                       jcr:primaryType="nt:unstructured"
                                       sling:resourceType="granite/ui/components/coral/foundation/form/numberfield"
                                       fieldLabel="Ratio"
                                       min="0"
                                       name="ratio"
                                       step="0.0001"/>
                               </items>
                           </field>
                       </aspectratios>
                </configWrapper>
            </items>
        </crop>
    </items>
</accordion>

Checkbox:

  • value: The submit value of the field when it is checked.
  • uncheckedValue: The submit value of the field when it is unchecked.
  • defaultChecked: Indicates if the checkbox is checked.
    warning:: When setting “defaultChecked” = “true”, you have to set the value of “uncheckedValue” so that the form values will be always populated.
    Otherwise Sling Post Servlet will remove the property from the form values, which makes the checkbox to be always checked.
<showDateFilter
    granite:class="cmp-form-option-item-active"
    jcr:primaryType="nt:unstructured"
    sling:resourceType="granite/ui/components/foundation/form/checkbox"
    name="./selected"
    text="Show Date Filter"
    uncheckedValue="{Boolean}false"
    defaultChecked="{Boolean}true"
    value="{Boolean}true"/>

Text:

<inputgroup
    jcr:primarytype="nt:unstructured"
    sling:resourcetype="granite/ui/components/coral/foundation/text"
    text="Some text"/>

Textfield:

<filterSectionText
    jcr:primaryType="nt:unstructured"
    sling:resourceType="granite/ui/components/coral/foundation/form/textfield"
    fieldLabel="Some Text"
    name="./someText"/>

TextArea:

<pathbrowser
    jcr:primarytype="nt:unstructured"
    sling:resourcetype="granite/ui/components/coral/foundation/form/pathbrowser"
fieldlabel="Path Browser"
name="./searchPath"
rootpath="/etc/tags">

Fileupload:

<upload granite:class="cq-wcm-fileupload"
    jcr:primaryType="nt:unstructured"
    sling:resourceType="granite/ui/components/coral/foundation/form/fileupload"     async="{Boolean}true"     autoStart="{Boolean}false"     multiple="{Boolean}false"     name="./image/file.sftmp"     sizeLimit="100000000"     text="Upload Image"     uploadUrl="will_be_replaced">
    <granite:data
        jcr:primaryType="nt:unstructured"
        cq-msm-lockable="./image"/>
</upload>

Pathbrowser:

<pathBrowser
    jcr:primaryType="nt:unstructured"
    sling:resourceType="granite/ui/components/coral/foundation/form/pathbrowser"
    fieldLabel="Path Browser"
    name="./searchPath"
    rootPath="/etc/tags"/>

Pathfield:

 <buttonLinkTo
    jcr:primaryType="nt:unstructured"
    sling:resourceType="granite/ui/components/coral/foundation/form/pathfield"
    fieldLabel="Link to"
    name="./buttonLinkTo"
    rootPath="/content"
    suffix=".html"/>

Datepicker:

<datepicker
    jcr:primaryType="nt:unstructured"
    sling:resourceType="granite/ui/components/coral/foundation/form/datepicker"
    displayedFormat="MM-DD-YYYY HH:mm"
    fieldLabel="datepicker"
    name="./datepicker"
    type="datetime"
    typeHint="Date"/>

Userpicker:

<userpicker
    jcr:primaryType="nt:unstructured"
    sling:resourceType="granite/ui/components/coral/foundation/form/userpicker"
    fieldLabel="User Picker"
    hideServiceUsers="{Boolean}true"
    impersonatesOnly="{Boolean}false"
    name="./user"/>

Select List:

					<listFrom
    granite:class="cmp-options--editor-type-v1"
    jcr:primaryType="nt:unstructured"
    sling:resourceType="granite/ui/components/coral/foundation/form/select"
    fieldLabel="List Item"
    name="./listItem">
    <items jcr:primaryType="nt:unstructured">
        <children
            jcr:primaryType="nt:unstructured"
            text="Child pages"
            value="children"/>
        <static
            jcr:primaryType="nt:unstructured"
            text="Fixed list"
            value="static"/>
        <search
            jcr:primaryType="nt:unstructured"
            text="Search"
            value="search"/>
        <tags
            jcr:primaryType="nt:unstructured"
            text="Tags"
            value="tags"/>
    </items>
 </listFrom>

Radio:

<radio
   jcr:primaryType="nt:unstructured"
   sling:resourceType="granite/ui/components/coral/foundation/form/radiogroup"
   name="./color"
   vertical="{Boolean}true"
   fieldLabel="Radio">
     <items jcr:primaryType="nt:unstructured">
         <op1
             jcr:primaryType="nt:unstructured"
             text="OP 1"
             value="op1"/>
         <op2
            jcr:primaryType="nt:unstructured"
            text="OP 2"
            value="op2"/>
     </items>
 </radio>

Number field:

<radio jcr:primaryType="nt:unstructured"
    sling:resourceType="granite/ui/components/coral/foundation/form/radiogroup"
    name="./color"
    vertical="{Boolean}true"
    fieldLabel="Radio">
    <items jcr:primaryType="nt:unstructured">
        <op1  jcr:primaryType="nt:unstructured"
            text="OP 1"
            value="op1"/>
        <op2  jcr:primaryType="nt:unstructured"
            text="OP 2"
           value="op2"/>
   </items>
</radio>

Heading

<MainHeading
    jcr:primaryType="nt:unstructured"
    sling:resourceType="granite/ui/components/coral/foundation/heading"
    level="{Long}3"
    text="Main"/>

Multifield:

The attached snippet has been verified for:

  • Checkbox
  • Textfield
  • Pathbrowser
  • Pathfield
  • Datepicker
  • Select list
 <pages
     jcr:primaryType="nt:unstructured"
     sling:resourceType="granite/ui/components/coral/foundation/form/multifield"
     composite="{Boolean}true"
     fieldDescription="Click '+' to add a new page"
     fieldLabel="URLs">
     <field
         granite:clas="cmp-options--editor-item-multifield-composite-item coral-Well"
         jcr:primaryType="nt:unstructured"
         sling:resourceType="granite/ui/components/coral/foundation/container"
         name="./items">
         <items jcr:primaryType="nt:unstructured">
             <column
                 granite:clas="cmp-options--editor-item-multifield-composite-item coral-Well"
                 jcr:primaryType="nt:unstructured"
                 sling:resourceType="granite/ui/components/foundation/container">
                 <items jcr:primaryType="nt:unstructured">
                     <showDateFilter
                        granite:class="cmp-form-option-item-active"
                        jcr:primaryType="nt:unstructured"
                        sling:resourceType="granite/ui/components/foundation/form/checkbox"
                        name="./selected"
                        text="Show Date Filter"
                        uncheckedValue="{Boolean}false"
                        value="{Boolean}true"/>
                     <filterSectionText
                        jcr:primaryType="nt:unstructured"
                        sling:resourceType="granite/ui/components/coral/foundation/form/textfield"
                        fieldLabel="Some Text"
                        name="./someText"/>
                     <pathBrowser
                        jcr:primaryType="nt:unstructured"
                        sling:resourceType="granite/ui/components/coral/foundation/form/pathbrowser"
                        fieldLabel="Path Browser"
                        name="./searchPath"
                        rootPath="/etc/tags"/>
                     <buttonLinkTo
                        jcr:primaryType="nt:unstructured"
                        sling:resourceType="granite/ui/components/coral/foundation/form/pathfield"
                        fieldLabel="Link to"
                        name="./buttonLinkTo"
                        rootPath="/content"
                        suffix=".html"/>
                     <datepicker
                        jcr:primaryType="nt:unstructured"
                        sling:resourceType="granite/ui/components/coral/foundation/form/datepicker"
                        displayedFormat="MM-DD-YYYY HH:mm"
                        fieldLabel="datepicker"
                        name="./datepicker"
                        type="datetime"
                        typeHint="Date"/>
                    						<listFrom
                            granite:class="cmp-options--editor-type-v1"
                            jcr:primaryType="nt:unstructured"
                            sling:resourceType="granite/ui/components/coral/foundation/form/select"
                            fieldLabel="List Item"
                            name="./listItem">
                          <items jcr:primaryType="nt:unstructured">
                              <children
                                  jcr:primaryType="nt:unstructured"
                                  text="Child pages"
                                  value="children"/>
                              <static
                                  jcr:primaryType="nt:unstructured"
                                  text="Fixed list"
                                  value="static"/>
                        </items>
                    </listFrom>
                </items>
             </column>
         </items>
     </field>
 </pages>

More Granite UI components for Coral 3 are available at /libs/granite/ui/components/coral/foundation

Errors and resolution:

Error 1: Executing maven command, throws following error:

“The prefix “granite” for attribute “granite:class” associated with an element type “background-color-palette” is not bound.”

  • Resolution: Add following xml namespace to your content.xml

xmlns:granite=”http://www.adobe.com/jcr/granite/1.0&#8243;