aem

How to configure antisamy in cq 5.5?

人走茶凉 提交于 2019-11-30 16:00:23
I have cq 5.5 project. I want to Prevent XSS attacks. According this link cq provides integration with AntiSamy project. Please provide concrete steps for integration with AntiSamy because I really cannot find it. update Should I write code like this somewhere? import org.owasp.validator.html.*; Policy policy = Policy.getInstance(POLICY_FILE_LOCATION); AntiSamy as = new AntiSamy(); CleanResults cr = as.scan(dirtyInput, policy); MyUserDAO.storeUserProfile(cr.getCleanHTML()); // some custom function The XSS protection mechanism offered by CQ is already based on the AntiSamy Project. You only

AEM/CQ: Conditional CSS class on decoration tag

你。 提交于 2019-11-30 15:41:38
How can I dynamically set a CSS class on the wrapping decoration tag of an AEM6 Sightly component? I cannot set this CSS class on the component as it depends on the instance of the component, and I can't set it on the resource as the resource can be rendered on multiple pages and the CSS class differs depending on which page it is on. I've tried the following 3 techniques inside the JavaScript Use-API with no success: componentContext.getCssClassNames().add('test-class-1'); component.getHtmlTagAttributes().set('class', 'test-class-2');//throws an exception currentNode.setProperty('cq:cssClass'

external database with Adobe CQ5?

爷,独闯天下 提交于 2019-11-30 15:22:31
Is there any way to connect external data base like mysql can be connected to Adobe CQ5 ? JCR(Java Content Repository) in Adobe cq5 now by default connects to H2 database...how to make it use sql/mysql? Go to: /system/console/configMgr Open up: the JDBC Connections Pool configuration Enter all the standard JDBC config elements (username, password, driver, JDBC URI) Enter a Datasource Name (referred to below as yourDataSourceName) In your JSP or Servlet: <%@ page import="com.day.commons.datasource.poolservice.DataSourcePool" %> <%@ page import="javax.sql.DataSource" %> DataSourcePool dbService

Determine runmode in Adobe CQ

痴心易碎 提交于 2019-11-30 14:50:05
问题 How do I programmatically know which run-mode the instance is running? I created a custom tag that provides the config depending on the instance run-mode, but I can not determine the current run-mode. I found a method that returns a list of run-mods instance: SlingSettings settings = ...get from BundleContext... Set<String> currentRunModes = settings.getRunModes(); But I can not get the objects SlingSettings or BundleContext. How can I get these objects or perhaps there is another way to get

AEM6 component allowedChildren not working

橙三吉。 提交于 2019-11-30 05:21:35
问题 Using AEM6 i want to restrict the type of components in a parsys. I have a parsys in a page. i drag a custom component from the sidebar to the parsys page. The custom component also has a parsys. I can drag sidebar components into my component parsys. In the custom component parsys all the operations work as expected, drag, drop, reorder, delete. Using allowedChildren and / or allowedParents in the custom component and child parsys (.content.xml) has no effect, i can not restrict the type of

How to set a resource property

夙愿已清 提交于 2019-11-30 01:51:52
问题 I have a Sling Resource object. What is the best way to set or update its property? 回答1: It depends on the Sling version: Sling >= 2.3.0 (since CQ 5.6) Adapt your resource to ModifiableValueMap, use its put method and commit the resource resolver: ModifiableValueMap map = resource.adaptTo(ModifiableValueMap.class); map.put("property", "value"); resource.getResourceResolver().commit(); Sling < 2.3.0 (CQ 5.5 and earlier) Adapt your resource to PersistableValueMap, use its put and save methods:

external database with Adobe CQ5?

夙愿已清 提交于 2019-11-29 22:37:08
问题 Is there any way to connect external data base like mysql can be connected to Adobe CQ5 ? JCR(Java Content Repository) in Adobe cq5 now by default connects to H2 database...how to make it use sql/mysql? 回答1: Go to: /system/console/configMgr Open up: the JDBC Connections Pool configuration Enter all the standard JDBC config elements (username, password, driver, JDBC URI) Enter a Datasource Name (referred to below as yourDataSourceName) In your JSP or Servlet: <%@ page import="com.day.commons

AEM/CQ: Conditional CSS class on decoration tag

谁说我不能喝 提交于 2019-11-29 22:28:25
问题 How can I dynamically set a CSS class on the wrapping decoration tag of an AEM6 Sightly component? I cannot set this CSS class on the component as it depends on the instance of the component, and I can't set it on the resource as the resource can be rendered on multiple pages and the CSS class differs depending on which page it is on. I've tried the following 3 techniques inside the JavaScript Use-API with no success: componentContext.getCssClassNames().add('test-class-1'); component

AEM 6.0: Additional parameters when using data-sly-resource?

家住魔仙堡 提交于 2019-11-29 13:16:32
问题 I am trying to implement something which I hope is relatively straight forward... I have one component (lets call it the wrapper component) which contains another component (lets call it the inner component) inside it via the data-sly-resource tag: <div data-sly-resource="${ 'inner' @ resourceType='/projectname/components/inner' }"></div> I would like to pass in some additional parameters with this tag, specifically a parameter that can be picked up by sightly in the inner component template?

Getting Default Checked Checkbox in CQ5

落花浮王杯 提交于 2019-11-29 11:39:00
问题 I am trying to have a default checked checkbox on a component dialog when editing. Here are the properties on the field: jcr:primaryType: widget checked: true (boolean) *Documentation says this determines default checked status type: checkbox (string) *read this as a fix to making checkbox selections stick xtype: selection (string) name: ./foo (string) fieldValue: true (string) 回答1: Yes, it looks like the documentation is a little wonky. I did some experimenting, and this combination of