Chuyển đến nội dung chính

Bài đăng

Đang hiển thị bài đăng từ Tháng 2, 2014

[CQ FORM] Validation Form in CQ

Purpose: Provide an abstraction for managing the submission of statically defined HTML Forms. How to Use (v1.2.2+) To create a enable the Forms, create a new sling:OsgiConfig a OSGi component configuration: /apps/myapp/config/com.adobe.acs.commons.forms.impl.FormsRouterImpl <?xml version="1.0" encoding="UTF-8"?> <jcr:root xmlns:sling="http://sling.apache.org/jcr/sling/1.0" xmlns:cq="http://www.day.com/jcr/cq/1.0"    xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0"    jcr:primaryType="sling:OsgiConfig"    suffix="/submit/form" /> The property suffix will be used to identify and properly route Forms submissions. The Form API The Form abstraction is simple development abstraction for transporting data between the browser and AEM. The abstraction is broken into two part: The Form (Form.java) which represents the mutable Form state Th

[DAM] Custom DAM management / Add 'Alt' into images

Issue: We need, for each asset to be able to edit the ‘alt’ text. The ‘alt’ text must be used on the site each time an asset is displayed. When displaying an asset, the mechanism is the following : -       Get the Locale from the request -       When getting the asset, get the associated Alt property corresponding to the locale. -       Populate the alt attribute with this value. Resolution: To achieve this, we can customize the DAM Asset Editor. The AssetEditor is the form used to input asset properties and metadata. Below is a screenshot of a customized form with four “alt” input (for four different locales). The DAM uses the following nodes to render Asset Editor forms: -       /libs/dam/content/asseteditors/formitems -       /libs/dam/content/asseteditors/images/formitems -       /libs/dam/content/asseteditors/images/jpeg/formitems -       /libs/dam/content/asseteditors/image/tiff/formitems We must not modify these files as it is source files fo

[CQ FORM] Change default encoding in CQ configuration / UTF-8 in CQ Form

The issue: We might get encoding error while validate form in 2 cases: - Reload the form if validation fail. - Save form data into database. The solution: Go to system console management: /system/console/configMgr Search "Apache Sling Main Servlet" Set "UTF-8" in field "Default Parameter Encoding"