since ‎21-10-2011
Online
BrianKasingli
MVP
Re: Creating Custom meta data that displays page status (...
Avatar

BrianKasingli

MVP

BrianKasingli
- Adobe Experience Manager
Leo, there are a few properties that would or would NOT exist in a given cq:Page resource. for instance, if a page have never been replicated then cq:lastReplicationAction would not exist, therefore you can default the status to "not published". Assuming that you are providing a user-service user with the correct permissions, you will be able to see all the properties of a given resource using either the Sling API or Node API. Definitely have a look at how the data is received in the 3rd party A...

Views

22

Likes

0

Replies

0
Re: Add a new property
Avatar

BrianKasingli

MVP

BrianKasingli
- Adobe Experience Manager
@aemninja,There is no AEM out of the box curl command that allows you to update a sling resource inside of the crx/de, however, you can create a Sling Servlet that can accept specific parameters, which allows you to manipulate and change properties using the Sling CRUD API.Sling CRUD API - https://sling.apache.org/documentation/the-sling-engine/sling-api-crud-support.htmlThe servlet will accept parameters as "resourcePath", "prop", "val".example: [POST] /bin/my-site/update-resource [REQUEST-BODY...

Views

27

Like

1

Replies

0
Re: Creating Custom meta data that displays page status (...
Avatar

BrianKasingli

MVP

BrianKasingli
- Adobe Experience Manager
hmm, how is the 3rd party api accessing the content from your author? when you use something like model.json or infinity.json, you can see all the properties for a given resource.

Views

67

Likes

0

Replies

0
Re: Creating Custom meta data that displays page status (...
Avatar

BrianKasingli

MVP

BrianKasingli
- Adobe Experience Manager
@Manlosa,When you think of the AEM content architecture, the public-facing AEM environment, which is the publish instances, would only store activated resources. Therefore if your external service is reading data from an AEM publish instances, they will never be able to see these unpublished resources. If however, your third party service is directly accessing your AEM author instance, then they will be able to retrieve every cq:Page node, and read the cq:lastReplicationAction attribute. Definet...

Views

105

Like

1

Replies

4
Re: How to use onready function?
Avatar

BrianKasingli

MVP

BrianKasingli
- Adobe Experience Manager
By default, when you click on a field with a , by default, the webpage will try to make a request to the currentURL, and since it is the currentURL your page will refresh. To remove the default behavior of the input type = "submit", you would need to add some JavaScript to the button that is something called preventDefault. The preventDefault() method cancels the event if it is cancelable, meaning that the default action that belongs to the event will not occur.For example, this can be useful w...

Views

60

Like

1

Replies

0
Re: How to access dialog box value of text format in java...
Avatar

BrianKasingli

MVP

BrianKasingli
- Adobe Experience Manager
@ShagunMalik, There are many different ways to achieve this, but I will give you two options. (https://sourcedcode.com/blog/aem/with-htl-pass-data-from-aem-backend-to-javascript)1. Using HTL // HTL // JavaScript const article = document.querySelector('#tax-calculator'); article.dataset.year // "2020" article.dataset.taxCode // "3" article.dataset.calenderEndPoint // "https://ms.mysite.com/taxcalculator" 2. Using Sling Models and HTL // JAVA @Model(adaptables = { Resource.class }, defaultInjecti...

Views

63

Like

1

Replies

0
Re: Trying to Pass the parameters from sightly to the sli...
Avatar

BrianKasingli

MVP

BrianKasingli
- Adobe Experience Manager
@ashwinikhaple,Take a look at this article, where your answer is highlighted - https://sourcedcode.com/blog/aem/with-htl-pass-data-from-aem-backend-to-javascript

Views

69

Likes

3

Replies

0
Re: Unable to Run Dispatcher Flush Invalidate.cache
Avatar

BrianKasingli

MVP

BrianKasingli
- Adobe Experience Manager
@Mayukh007 have a look at this easy to follow the guide, https://sourcedcode.com/blog/aem/how-to-setup-the-aem-dispatcher-flush-agent- How is the /dispatcher/invalidate.cache generated- How do we securely allow only specific IP addresses to make a flush cache request?- How to configure a basic dispatcher flush agent on the AEM publish? As a quick test, please try: # The allowedClients section restricts the client IP addresses that are # allowed to issue activation requests. /allowedClients { # d...

Views

70

Like

1

Replies

0
Re: How to mock SlingSettingsService run modes in Junit5?
Avatar

BrianKasingli

MVP

BrianKasingli
- Adobe Experience Manager
@baw_gov,you can do something like this: @ExtendWith(AemContextExtension.class) public class ExampleTest { private final AemContext context = new AemContext(); Set mockRunModes = new TreeSet(); @Mock private SlingSettingsService slingSettingsService; @Before public void before() { when(slingSettingsService.getRunModes()).thenReturn(mockRunModes); } @Test public void testSomething() { mockRunModes.add("publish"); Resource resource = context.resourceResolver().getResource("/content/sample/en"); Pa...

Views

73

Like

1

Replies

0
Re: Can you set up folder level permissions for Assets HT...
Avatar

BrianKasingli

MVP

BrianKasingli
- Adobe Experience Manager
With POSTMAN you can do something like this:http://localhost:4502/api/assets/my-site/carouselFolder.jsonUse Basic Authentication, and after authentication, the "Authorization" value will be set In the header.I hope this helps.

Views

121

Likes

0

Replies

0
Re: Can you set up folder level permissions for Assets HT...
Avatar

BrianKasingli

MVP

BrianKasingli
- Adobe Experience Manager
@uafzal,One way, you can create an AEM user for each of your developers with ACL (read,write,delete) permissions to only allow specific folder path restrictions.

Views

143

Like

1

Replies

3
Re: how to keep old pages on publisher when move/rename
Avatar

BrianKasingli

MVP

BrianKasingli
- Adobe Experience Manager
@millionmeme,Making things simple and not changing the out-of-the-box AEM behavior, for your requirement, I would manually copy the page (CTRL+C), and then paste (CTRL+V) and rename the page (using the move tool, using the keyboard button "M"). Also, check with your SEO team member if having duplicated web pages on your AEM website is good practice or not.

Views

88

Like

1

Replies

0
Re: Content Fragment: Custom Content Reference Field Vali...
Avatar

BrianKasingli

MVP

BrianKasingli
- Adobe Experience Manager
Thank you Kautuk!

Views

96

Likes

0

Replies

0
Re: JSON Log
Avatar

BrianKasingli

MVP

BrianKasingli
- Adobe Experience Manager
For the ACS Commons JSON event logger solution, you can refer to this -> https://adobe-consulting-services.github.io/acs-aem-commons/features/json-event-logger/index.htmlAnd this article is useful as well, https://sling.apache.org/documentation/bundles/log-tracers.html#tracer-recording

Views

94

Like

1

Replies

0
Re: What is the best way to implement leaderboard in JCR?
Avatar

BrianKasingli

MVP

BrianKasingli
- Adobe Experience Manager
yes, this would be a custom implementation

Views

91

Likes

0

Replies

0
Re: What is the best way to implement leaderboard in JCR?
Avatar

BrianKasingli

MVP

BrianKasingli
- Adobe Experience Manager
@Adilmo If you plan to create your own leader board it would be a bunch of work. You would need front-end developers, back-end developers, and also an AEM architect. The front-end developers will focus on the aesthetics & business logic of how the leader board looks like which will be presented to the users via a JavaScript application. The backend developers will need to create API's exported in JSON for the JS application to consume. And lastly, the AEM architect may be involved in planning ou...

Views

111

Like

1

Replies

2
Re: Disable sub components from admin
Avatar

BrianKasingli

MVP

BrianKasingli
- Adobe Experience Manager
@lwang, there are three ways that I have done this in the past.1. Just making sure that your componentGroup is set to .hidden 2. Just making sure your sub-components have a unique componentGroup name, and then using the "cq:EditListenersConfig" configuration, to update the components list. 3. If your parent component is a parsys, then you can add policies to that parsys within editable templates!Options 1 or 2, a code deployment must be made if you want to enable or disable sub-components ...

Views

97

Like

1

Replies

1
Re: Content Fragment: Custom Content Reference Field Vali...
Avatar

BrianKasingli

MVP

BrianKasingli
- Adobe Experience Manager
@AEMRand It is possible, I have provided a solution, please take a look here -> https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager/ootb-validation-options-fo...}}In short, you can use JavaScript to append the "pattern" attribute to a given HTML element, from there it will enable HTML validation for the content fragment field itself; this is a regex pattern. Your client library should have a clientlib category of "dam.cfm.authoring.v2", so when you are on the cfm authoring ...

Views

128

Likes

2

Replies

3
Re: How to remove the wcmmode=disabled in Web URL?
Avatar

BrianKasingli

MVP

BrianKasingli
- Adobe Experience Manager
@Ted2007277,If you are in your publish environment, it might be because a developer has hardcoded ?wcmmode=disabled to be appended on to the target URI or link. ?wcmmode=disabled is actually never automatically appended to a target URI or link by AEM out of the box, so it might be done by a developer. Currently, only using the AEM site's edit mode, you can only access ?wcmmode=disabled when you hit the "view publish mode" from the drop-down options; "view publish mode" have been clicked on, the ...

Views

86

Like

1

Replies

0
Re: How to put defer attribute to AEM js libraries - to a...
Avatar

BrianKasingli

MVP

BrianKasingli
- Adobe Experience Manager
You can implement a custom implementation like https://github.com/nateyolles/aem-clientlib-async

Views

91

Likes

2

Replies

0
Re: Can we async or defer referencing Client side Libraries
Avatar

BrianKasingli

MVP

BrianKasingli
- Adobe Experience Manager
@JakeCham there are two scenarios.Scenario 1, where the client library has no dependenciesWith scenario one, simple implementation with no dependencies, you can simply call the absolute path to the client library, for example: Scenario 2, the client library has dependenciesthen like what the others say, nateyolle's solution looks like an option.

Views

96

Like

1

Replies

0
Re: Can we minify individual Client side Libraries
Avatar

BrianKasingli

MVP

BrianKasingli
- Adobe Experience Manager
Yes this is possible. For YUI COMPRESSOR FOR CSS MINIFICATION AND GCC FOR JS, refer to Adobe's own documentation, https://helpx.adobe.com/experience-manager/6-3/sites/developing/using/clientlibs.html#UsingPreprocessors

Views

98

Like

1

Replies

0
Re: osgi config to javascript
Avatar

BrianKasingli

MVP

BrianKasingli
- Adobe Experience Manager
@karthick1356,There are two ways.1. OSGI configuration data in Sightly, where your JavaScript will pickup configuration from there. An example implementation can be found here https://sourcedcode.com/blog/aem/with-htl-pass-data-from-aem-backend-to-javascript2. OSGI configuration data via Sling Servlet. You can create a servlet that can be utilized by the JavaScript business logic. An Ajax request should be sufficient to obtain the OSGI configuration data.

Views

93

Like

1

Replies

0
Re: data-sly-list iteration for a JsonArray
Avatar

BrianKasingli

MVP

BrianKasingli
- Adobe Experience Manager
try this, https://cqbasics.blogspot.com/2016/06/iterate-map-and-list-in-sightly-map-of.html

Views

106

Likes

0

Replies

0
Re: How to identify if URL contains editor.html in Sightly
Avatar

BrianKasingli

MVP

BrianKasingli
- Adobe Experience Manager
@saukaush,I recommend using the sightly data-sly-test with !wcmmode.disabled. This guarantees that when you view your webpage on the dispatcher web server, the block of code will never be shown. From the author, you can also append this a href param into the URL, ?wcmmode=disabled, and you will be able to see the page as if you are not on editor.html. ...custom code here

Views

117

Like

1

Replies

0
Re: How to identify if URL contains editor.html in Sightly
Avatar

BrianKasingli

MVP

BrianKasingli
- Adobe Experience Manager
When you are in edit mode, /editor.html or /cf# will exist. Can you share your window.location.href please?

Views

127

Likes

0

Replies

0
Re: data-sly-list iteration for a JsonArray
Avatar

BrianKasingli

MVP

BrianKasingli
- Adobe Experience Manager
You would need to serialize the JSON string to either a List or List. Once you return a valid List object to your slightly business logic, your code should work as expected. However, if your list looks something like List then that would also work as well. You ultimately just need to have a valid List object with valid item objects.

Views

160

Likes

3

Replies

1
Re: How to identify if URL contains editor.html in Sightly
Avatar

BrianKasingli

MVP

BrianKasingli
- Adobe Experience Manager
You can achieve this using Sightly or Javascript. if (window.href.location.indexOf('/editor.html/content') != -1) { alert('Editor'); } Author Mode

Views

181

Like

1

Replies

2
Re: How to add spacing between columns in AEM grid
Avatar

BrianKasingli

MVP

BrianKasingli
- Adobe Experience Manager
@LikesAEM,In a clean AEM project, you can manipulate the clientlib-grid/less/grid.less. Take a look at the latest AEM maven archtype project, https://github.com/adobe/aem-project-archetype/tree/98f3b4efa9834437881b31a336459abe6a89ad00/src/main/archetype/ui.apps/src/main/content/jcr_root/apps/__appId__/clientlibs/clientlib-grid/less

Views

142

Like

1

Replies

1
Re: fetch window URL and verify using data-sly-test
Avatar

BrianKasingli

MVP

BrianKasingli
- Adobe Experience Manager
With sling models, you can do something like this: (sightly example will be the next block of code. The key is to detect the runmode that contains author, slingSettingsService.getRunModes().contains("author")Sling Model: package com.mysite.core.models; import com.adobe.cq.export.json.ExporterConstants; import org.apache.sling.api.SlingHttpServletRequest; import org.apache.sling.api.resource.Resource; import org.apache.sling.models.annotations.DefaultInjectionStrategy; import org.apache.sling.mod...

Views

144

Likes

2

Replies

0