Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

BrianKasingli
Community profile BrianKasingli Community Advisor
Senior AEM & Full Stack Software Engineer
London UK / Vancouver BC
37 BADGES
Community Advisor

Community Advisor

Learn more
Joined the community 21-10-2011 8:45:01 AM
Online
Top badges earned by BrianKasingli
Customize the badges you want to showcase on your profile
Re: Sling servlet with PUT method
Avatar
Coach
Community Advisor
BrianKasingli
Community Advisor

Likes

721 likes

Total Posts

659 posts

Correct reply

254 solutions
Top badges earned
Coach
Give back 600
Boost 500
Give Back 500
Give Back 400
View profile
BrianKasingli
- Adobe Experience Manager
@rgravisankar,You might not have your AEM configured to allow PUT methods, because all PUT methods are being filtered. From your local AEM, you need to configure the Apache Sling Referrer Filter.In OSGI configurations (http://localhost:4502/system/console/configMgr), locate “Apache Sling Referrer Filter”. Remove the PUT method from filters property.If you would like to test your Servlet via POSTMAN, you can follow this tutorial here -> https://sourcedcode.com/blog/aem/how-to-make-simple-http-pos...

Views

14

Likes

2

Replies

0
Re: I want to do a path check in Model Class
Avatar
Coach
Community Advisor
BrianKasingli
Community Advisor

Likes

721 likes

Total Posts

659 posts

Correct reply

254 solutions
Top badges earned
Coach
Give back 600
Boost 500
Give Back 500
Give Back 400
View profile
BrianKasingli
- Adobe Experience Manager
When you have a component with Sling Model backend, the currentPage object is returned to you via the context of where your component lives.Example AWhen the Sling Model calls currentPage, this is actually getting the current page of its contained page, in this case, it is the experience fragment itself. So when you are viewing the content fragment from a url like /content/experience-fragments/xf/test-1/master.html, this is expected. Example BWhen the Sling Model calls currentPage, this is actua...

Views

23

Likes

0

Replies

0
Re: How to access Design Dialogue Properties in Sling Model.
Avatar
Coach
Community Advisor
BrianKasingli
Community Advisor

Likes

721 likes

Total Posts

659 posts

Correct reply

254 solutions
Top badges earned
Coach
Give back 600
Boost 500
Give Back 500
Give Back 400
View profile
BrianKasingli
- Adobe Experience Manager
@saurabh_kumar_02,From the Sling Model Injectors, have you tried?@ScriptVariable private Design currentDesign; @ScriptVariable private Designer designer; @ScriptVariable private Design resourceDesign;You can find the entire list of Sling Model Injectors from here, https://sourcedcode.com/blog/aem/aem-sling-model-injectors-annotations-reference-guide

Views

37

Like

1

Replies

0
Re: Is there a way to get the page properties of absolute parent using Sightly?
Avatar
Coach
Community Advisor
BrianKasingli
Community Advisor

Likes

721 likes

Total Posts

659 posts

Correct reply

254 solutions
Top badges earned
Coach
Give back 600
Boost 500
Give Back 500
Give Back 400
View profile
BrianKasingli
- Adobe Experience Manager
Yeah sure, you can use sling model to get the parent Page object, and then use the page API from sightly to obtain such values.I am using constructor injection as the example below as this strategy can also reduce memory consumption of your application, https://sourcedcode.com/blog/aem/aem-sling-model-field-injection-vs-constructor-injection-memory-consumptionSightly: ${mycomponent.properties['jcr:title']}Sling Model:import com.day.cq.wcm.api.Page; import org.apache.sling.api.resource.Resource; ...

Views

25

Likes

2

Replies

1
Re: Error while building the project
Avatar
Coach
Community Advisor
BrianKasingli
Community Advisor

Likes

721 likes

Total Posts

659 posts

Correct reply

254 solutions
Top badges earned
Coach
Give back 600
Boost 500
Give Back 500
Give Back 400
View profile
BrianKasingli
- Adobe Experience Manager
This is probably because your maven module have the wrong :groupIDartifactIDversion. Please look at other pom.xml's in the same project and determin which configurations are missing.

Views

10

Like

1

Replies

0
Re: I bet it's been asked before...can we hide component in desktop view only
Avatar
Coach
Community Advisor
BrianKasingli
Community Advisor

Likes

721 likes

Total Posts

659 posts

Correct reply

254 solutions
Top badges earned
Coach
Give back 600
Boost 500
Give Back 500
Give Back 400
View profile
BrianKasingli
- Adobe Experience Manager
This can be easily achived with front-end, CSS media queries. Lets give you an example below where am showing the entire .cmp-slideshow component on mobile and tablet, but hide it on desktop and bigger screens. You can change the pixel's below to match your layout's configurations. Also be sure to write the code in CSS, SASS or LESS, if possible. This allows reuse of your CSS variables across your project, so that you don't need to repeat yourself with hardcoded pixel values. @media (min-width:320px) { /* mobile: screen higher than 320px */ .cmp-slideshow { display: block; } } @media (min-width:641px) { /* tablet: screen higher than 641px */ .cmp-slideshow { display: block; } } @media (min-width:961px) { /* desktop: screen higher than 961px */ .cmp-slideshow { display: none; } }

Views

64

Like

1

Replies

1
Re: onclick function in ui.frontend
Avatar
Coach
Community Advisor
BrianKasingli
Community Advisor

Likes

721 likes

Total Posts

659 posts

Correct reply

254 solutions
Top badges earned
Coach
Give back 600
Boost 500
Give Back 500
Give Back 400
View profile
BrianKasingli
- Adobe Experience Manager
Assuming that you are using the latest aem-project-archtype, ensure that you have all your imports are identified from the main.ts or main.js file. The out of the box main.ts file looks like this; aem-project-archetype/main.ts at develop · adobe/aem-project-archetype · GitHub

Views

47

Likes

3

Replies

0
Re: Content fragment not visible after create folder in tools - general - config browser
Avatar
Coach
Community Advisor
BrianKasingli
Community Advisor

Likes

721 likes

Total Posts

659 posts

Correct reply

254 solutions
Top badges earned
Coach
Give back 600
Boost 500
Give Back 500
Give Back 400
View profile
BrianKasingli
- Adobe Experience Manager
Let us try to debug your environment. Tell me what you can find from the error logs.Follow the steps in this blog and let me know, https://sourcedcode.com/blog/aem/development/basic-steps-to-debug-an-error-in-aem

Views

36

Like

1

Replies

0
Re: Content fragment not visible after create folder in tools - general - config browser
Avatar
Coach
Community Advisor
BrianKasingli
Community Advisor

Likes

721 likes

Total Posts

659 posts

Correct reply

254 solutions
Top badges earned
Coach
Give back 600
Boost 500
Give Back 500
Give Back 400
View profile
BrianKasingli
- Adobe Experience Manager
What do you see in CRX/DE?Can you try to create a new configuration site under http://localhost:4502/libs/granite/configurations/content/view.html/conf?

Views

42

Like

1

Replies

2
Re: Create user package with correct access
Avatar
Coach
Community Advisor
BrianKasingli
Community Advisor

Likes

721 likes

Total Posts

659 posts

Correct reply

254 solutions
Top badges earned
Coach
Give back 600
Boost 500
Give Back 500
Give Back 400
View profile
BrianKasingli
- Adobe Experience Manager
@VaishnaS1,a pretty handy tool that I use for ACS is https://github.com/Netcentric/accesscontroltool

Views

32

Like

1

Replies

0
Re: onclick on button
Avatar
Coach
Community Advisor
BrianKasingli
Community Advisor

Likes

721 likes

Total Posts

659 posts

Correct reply

254 solutions
Top badges earned
Coach
Give back 600
Boost 500
Give Back 500
Give Back 400
View profile
BrianKasingli
- Adobe Experience Manager
This should work:document.querySelector('.header__search').addEventListener('click', () => { alert('hi') });

Views

34

Like

1

Replies

0
Re: CSV file upload and populating data in a table
Avatar
Coach
Community Advisor
BrianKasingli
Community Advisor

Likes

721 likes

Total Posts

659 posts

Correct reply

254 solutions
Top badges earned
Coach
Give back 600
Boost 500
Give Back 500
Give Back 400
View profile
BrianKasingli
- Adobe Experience Manager
@ksh_20799,1. Architect the best location in the DAM where the CSV files will live; create documentation and reference this location.2. I suggest you to use a system user so you can access the CSV file from the dam from the sling model backend.3. Assuming that maybe in the future there may be more uses of CSVtoHTML, you can create a utils class called CsvUtils.java, which will have some methods in there like converCSVStringToHtml(); http://www.java2s.com/example/java/java.lang/convert-a-csv-stri...

Views

25

Like

1

Replies

0
Re: How to add default style of table plugin of RTE
Avatar
Coach
Community Advisor
BrianKasingli
Community Advisor

Likes

721 likes

Total Posts

659 posts

Correct reply

254 solutions
Top badges earned
Coach
Give back 600
Boost 500
Give Back 500
Give Back 400
View profile
BrianKasingli
- Adobe Experience Manager
@annkitaaggarwal,You can achieve this by using custom CSS. Target the first tr HTML block element with table tr:first-child, and change the background color to something like grey. Example below is a screenshot of what the table styles will look like. At the bottom of this response, you will find some code snippets to how we can achieve your requirement. With this in mind, you can take this example idea, and target the first-child tr, and give it a dotted border.// HTML id name 1 classes 2...

Views

21

Like

1

Replies

0
Re: How to Unit testing for doPost Servlet which contains HTTP Request
Avatar
Coach
Community Advisor
BrianKasingli
Community Advisor

Likes

721 likes

Total Posts

659 posts

Correct reply

254 solutions
Top badges earned
Coach
Give back 600
Boost 500
Give Back 500
Give Back 400
View profile
BrianKasingli
- Adobe Experience Manager
For JUNIT4 example, you can checkout this reference here, https://sourcedcode.com/blog/aem/aem-sling-servlet-osgi-r7-by-resource-type-unit-test-junit-4-with-examples

Views

76

Like

1

Replies

1
Re: Content fragment not visible after create folder in tools - general - config browser
Avatar
Coach
Community Advisor
BrianKasingli
Community Advisor

Likes

721 likes

Total Posts

659 posts

Correct reply

254 solutions
Top badges earned
Coach
Give back 600
Boost 500
Give Back 500
Give Back 400
View profile
BrianKasingli
- Adobe Experience Manager
@GS04 you can follow this tutorial on how to setup the content fragment models structure, https://www.youtube.com/watch?v=-Hn3UDJMc98 After creation of your content fragments model structure, you should be able to find the created-resources under the /conf/my-site/* folder.

Views

57

Like

1

Replies

4
Re: Execute a custom action after a page has been published.
Avatar
Coach
Community Advisor
BrianKasingli
Community Advisor

Likes

721 likes

Total Posts

659 posts

Correct reply

254 solutions
Top badges earned
Coach
Give back 600
Boost 500
Give Back 500
Give Back 400
View profile
BrianKasingli
- Adobe Experience Manager
You can achieve this by writing your own Event Handlers, Event Listeners, or Workflow Launchers https://aem.redquark.org/2018/10/day-14-eventing-in-aem.html

Views

50

Likes

3

Replies

0
Re: (Help ! )Reusable Component Policy For Styling ?
Avatar
Coach
Community Advisor
BrianKasingli
Community Advisor

Likes

721 likes

Total Posts

659 posts

Correct reply

254 solutions
Top badges earned
Coach
Give back 600
Boost 500
Give Back 500
Give Back 400
View profile
BrianKasingli
- Adobe Experience Manager
@chun-pin,You can utilise the granite/ui/components/coral/foundation/include, simply create one configuration, for example, margins, within your common namespace folder, as /apps/mybrand/dialogs/content/common/fields,and re-use them across your AEM project. Here's an example of how we identified one configuration for the richtext granite UI field, and had the entire project reference the same configurations.https://sourcedcode.com/blog/aem/dry-way-of-using-richtext-granite-ui-component-in-aem-fo...

Views

34

Likes

2

Replies

1
Re: Rich text editor is throwing error in AEM 6.4 when you make it part of any component
Avatar
Coach
Community Advisor
BrianKasingli
Community Advisor

Likes

721 likes

Total Posts

659 posts

Correct reply

254 solutions
Top badges earned
Coach
Give back 600
Boost 500
Give Back 500
Give Back 400
View profile
BrianKasingli
- Adobe Experience Manager
Can you share the TouchUI Dialogue .content.xml please; 

Views

60

Like

1

Replies

3
Re: After deploying new Bundle: Forgetting to Close Resolver when Opened, is it cleared?
Avatar
Coach
Community Advisor
BrianKasingli
Community Advisor

Likes

721 likes

Total Posts

659 posts

Correct reply

254 solutions
Top badges earned
Coach
Give back 600
Boost 500
Give Back 500
Give Back 400
View profile
BrianKasingli
- Adobe Experience Manager
@AEMWizard,I am afraid after when a new bundle have been deployed, the JVM is still running, which means that these threads are not closed. Restart your AEM to close all your open threads.@Asutosh_Jena_'s recommendation try-with-resource trick introduced in Java 7 will ensure that the session is closed after usage.

Views

42

Like

1

Replies

0
Re: Richtext spell check save data without p tags
Avatar
Coach
Community Advisor
BrianKasingli
Community Advisor

Likes

721 likes

Total Posts

659 posts

Correct reply

254 solutions
Top badges earned
Coach
Give back 600
Boost 500
Give Back 500
Give Back 400
View profile
BrianKasingli
- Adobe Experience Manager
Excellent, im glad that it worked out; unfortunately, there is no out of the box solution to fix this cause. A solution with javascript is just too troublesome.

Views

24

Like

1

Replies

1
Re: <p> in richtext in touch UI
Avatar
Coach
Community Advisor
BrianKasingli
Community Advisor

Likes

721 likes

Total Posts

659 posts

Correct reply

254 solutions
Top badges earned
Coach
Give back 600
Boost 500
Give Back 500
Give Back 400
View profile
BrianKasingli
- Adobe Experience Manager
Installation of a new paraformat option, and using Java Backend, Sling Model, we can text-transform the output, so that your Sightly HTL can render the output Html as expected. For the full tutorial you can find it here. https://sourcedcode.com/blog/aem/aem-richtext-remove-p-tag-removesingleparagraphcontainer-for-touch-ui

Views

87

Likes

0

Replies

0
Re: Sightly check the url validation using sling model
Avatar
Coach
Community Advisor
BrianKasingli
Community Advisor

Likes

721 likes

Total Posts

659 posts

Correct reply

254 solutions
Top badges earned
Coach
Give back 600
Boost 500
Give Back 500
Give Back 400
View profile
BrianKasingli
- Adobe Experience Manager
I suggest you to write all the business logic in the sling model itself. So that you would only need to call the getter from your Sling Model, and the transformed url will be the final string that you will be using for the Url output.

Views

49

Likes

2

Replies

0
Re: Richtext spell check save data without p tags
Avatar
Coach
Community Advisor
BrianKasingli
Community Advisor

Likes

721 likes

Total Posts

659 posts

Correct reply

254 solutions
Top badges earned
Coach
Give back 600
Boost 500
Give Back 500
Give Back 400
View profile
BrianKasingli
- Adobe Experience Manager
@AEMnewbie,There are many ways to tackle this problem, but here is one way to do it with Sling Models. For Touch UI, You can create a custom paraformat option in the AEM Touch UI, cq/gui/components/authoring/dialog/richtext, and then using Java Backend, Sling Model, to text-transform the output, so that your Sightly HTL can render the output Html as expected. For the full tutorial you can find it here.https://sourcedcode.com/blog/aem/aem-richtext-remove-p-tag-removesingleparagraphcontainer-for-t...

Views

37

Like

1

Replies

3
Re: embed property in client libs
Avatar
Coach
Community Advisor
BrianKasingli
Community Advisor

Likes

721 likes

Total Posts

659 posts

Correct reply

254 solutions
Top badges earned
Coach
Give back 600
Boost 500
Give Back 500
Give Back 400
View profile
BrianKasingli
- Adobe Experience Manager
You will find that only clientlib-a && clientlib-b only exist when calling clientlib-a.css because, the child properties for clientlib-b, "dependencies" or "embed" are to be ignored. This is how the clientlib resolving engine works; this is normal. Solution: create a new client library as the parent with the correct config for embed + dependencies of whatever you need. In the diagram, you can see clientlib-b, references to "dependencies" or "embed" is ignored. The output of the clientlib is with...

Views

102

Likes

2

Replies

1
Re: Image size should not exceed greater than 20kb
Avatar
Coach
Community Advisor
BrianKasingli
Community Advisor

Likes

721 likes

Total Posts

659 posts

Correct reply

254 solutions
Top badges earned
Coach
Give back 600
Boost 500
Give Back 500
Give Back 400
View profile
BrianKasingli
- Adobe Experience Manager
@Siddu9631,This is possible, what I would do is:1. Create a servlet (assetSizeServlet.class) that returns the size of any asset that lives in the DAM; servlet will only be used for the authoring environment.2. Create new jQuery Validation Plugin, JVP, which will ping the servlet, passing in the path of the image; this will return the size of the asset, and your JVP's JavaScript business logic will display an error message from the toolbar as prompt. This is an example of how a new JVP is created...

Views

57

Likes

2

Replies

0
Re: How to get current user session in osgi service?
Avatar
Coach
Community Advisor
BrianKasingli
Community Advisor

Likes

721 likes

Total Posts

659 posts

Correct reply

254 solutions
Top badges earned
Coach
Give back 600
Boost 500
Give Back 500
Give Back 400
View profile
BrianKasingli
- Adobe Experience Manager
@thatsmeadarsh,The best practice is to use a system user with the correct permissions to make such replication actions, but however, for your use case of acquiring the current, logged in user (from aem author), from a Sling Servlet, try using the code below:@Override protected void doGet(SlingHttpServletRequest request, SlingHttpServletResponse response) throws IOException { Session session = request.getResourceResolver().adaptTo(Session.class); String userId = Objects.requireNonNull(session).ge...

Views

165

Like

1

Replies

4
Re: Creating Components with Rounded Corners
Avatar
Coach
Community Advisor
BrianKasingli
Community Advisor

Likes

721 likes

Total Posts

659 posts

Correct reply

254 solutions
Top badges earned
Coach
Give back 600
Boost 500
Give Back 500
Give Back 400
View profile
BrianKasingli
- Adobe Experience Manager
@Pantego29,You can easily achieve this by adding this CSS property.card { border-radius: 0; }

Views

96

Like

1

Replies

0
Re: Download Button
Avatar
Coach
Community Advisor
BrianKasingli
Community Advisor

Likes

721 likes

Total Posts

659 posts

Correct reply

254 solutions
Top badges earned
Coach
Give back 600
Boost 500
Give Back 500
Give Back 400
View profile
BrianKasingli
- Adobe Experience Manager
@StrawHatM23,We need to undertand a bit more context of what you are talking about?Is this a custom component or a AEM WCM Core component? Which version of AEM are you referring to (the screenshot you provided looks like someone legacy). Is this touch UI or classic UI?

Views

103

Like

1

Replies

0
Re: How to create/add the new RTE custom plugin for email
Avatar
Coach
Community Advisor
BrianKasingli
Community Advisor

Likes

721 likes

Total Posts

659 posts

Correct reply

254 solutions
Top badges earned
Coach
Give back 600
Boost 500
Give Back 500
Give Back 400
View profile
BrianKasingli
- Adobe Experience Manager
I am glad the the first peice of the puzzle have been resolved. To add icon options for the RTE, please refer to this article on how to add style, https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager/rte-styles-and-edit-in-touch-ui-dialog/td-p/179543

Views

46

Likes

0

Replies

0
Re: AEM 6.2 TouchUI Unlock page functionality not working
Avatar
Coach
Community Advisor
BrianKasingli
Community Advisor

Likes

721 likes

Total Posts

659 posts

Correct reply

254 solutions
Top badges earned
Coach
Give back 600
Boost 500
Give Back 500
Give Back 400
View profile
BrianKasingli
- Adobe Experience Manager
I was having a similar issue on my AEM 6.5 instance, and this trick temporary solved the problem. However, now we need to get down to it, and understand why is it doing this, and add the code where necessary. Thanks!

Views

37

Like

1

Replies

0