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

Bài đăng

Đang hiển thị bài đăng từ 2015

[WIDGET] Multifield - Create a multi-fields panel to use with multifield

Layout: Config on dialog: <map                        jcr:primaryType="cq:Widget"                        fieldLabel="Field label"                        hideLabel="false"                        name="./map"                        xtype=" multifield ">                        <fieldConfig                            jcr:primaryType="cq:Widget"                            border="true"                            hideLabel="true"                            layout="form"                            padding="10px"                            width="1000"                            xtype=" multi-field-panel ">                            <items jcr:primaryType="cq:WidgetCollection">                                <lineHead                                    jcr:primaryType="cq:Widget&quo

[COMPONENT] CQ filter

Sling Request Invocation Chain     Implementing Sling Filters Registration of Filters Standard Servlet Filter (javax.servlet.Filter) Need to be registered as Service („manually“ or SlingFilter SCR Annotation) Order and FilterScopes can be defined Order defined by Serviceranking Filterscopes REQUEST COMPONENT ERROR INCLUDE * FORWARD * * FilterChain executes COMPONENT scope for these scopes as well. SCR Annotation @SlingFilter(scope = SlingFilterScope.COMPONENT, order = -10000, metatype = false) public class MyComponentFilter implements javax.servlet.Filter { @Override public void doFilter(ServletRequest pRequest, ServletResponse pResponse, FilterChain pChain) throws IOException, ServletException { // Implement Filter // continue with filter chaining pChain.doFilter(pRequest, pResponse); } } Filter Order Existing Filters might use the deprecated “filter.order” instead “service.ranking”. Existin

[COMPONENT] Set a CQ5 component to editable or not editable

Question: Is it posible if i want to set a cq5 component C editable in page A, but not editable in page B. Solution: You can set ComponentContext.BYPASS_COMPONENT_HANDLING_ON_INCLUDE_ATTRIBUTE before the include, and remove it after the include. slingRequest.setAttribute(ComponentContext. BYPASS_COMPONENT_HANDLING_ON_INCLUDE_ATTRIBUTE, true); <sling:include component C/> slingRequest.removeAttribute(ComponentContext. BYPASS_COMPONENT_HANDLING_ON_INCLUDE_ATTRIBUTE); Ref: https://dev.day.com/docs/en/cq/current/developing/boilerplates.html

[DATABASE] USE DATASOURCEPOOL WITHIN OSGI BUNDLE TO CONNECT MYSQL

Goal: Create a CQ/AEM project to connect mysql by Create project: mvn archetype:generate \    -DarchetypeRepository=http://repo.adobe.com/nexus/content/groups/public/ \    -DarchetypeGroupId=com.day.jcr.vault \    -DarchetypeArtifactId=multimodule-content-package-archetype \    -DarchetypeVersion=1.0.2 \    -DgroupId=mysqldemo \    -DartifactId=mysqldemo \    -Dversion=1.0-SNAPSHOT \    -Dpackage=com.mysqldemo \    -DappsFolderName=mysqldemo \    -DartifactName="Mysql Demo" \    -DcqVersion="5.6.1" \    -DpackageGroup="Mysql Demo" Update bundle pom: <dependency>            <groupId>com.day.commons</groupId>            <artifactId>day.commons.datasource.poolservice</artifactId>            <version>1.0.10</version>            <scope>provided</scope> </dependency> Update content pom: <dependencies> ...