My component doesn't view when publish my page AEM

Avatar

Avatar

Ott0gi

Avatar

Ott0gi

Ott0gi

14-02-2019

Hi, I don't speak english very well, I have a simple component:

1691845_pastedImage_0.png

This component write name of client than give for a parameter on the URL, thus:

1691915_pastedImage_1.png

If I changed the value of parameter, change value in my div, it's OK, but when publish this page doesn't view my component:

1691916_pastedImage_2.png

What is happened? Any idea about this?

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar

Ott0gi

Avatar

Ott0gi

Ott0gi

21-02-2019

Hi everybody,

Thaks for your answers and your support. Finally,  I got it to work, I am new to the platform and I learned several things based on their comments, the problem of the script that I was not executing was because I needed to add the allowProxy property to true for my clientlibs folder. Well, I hope you continue to support me in the future that I have to see on the platform, special thanks to smacdonald2008 and gauravb10066713.

I see you soon. Greetings

Answers (22)

Answers (22)

Avatar

Avatar

smacdonald2008

Total Posts

12.7K

Likes

1.4K

Correct Reply

2.3K

Avatar

smacdonald2008

Total Posts

12.7K

Likes

1.4K

Correct Reply

2.3K
smacdonald2008

20-02-2019

There are a few issues with your component:

1 . Your component is not following a standard way of building HTL components. For example - you have not made use of a dialog. So when i set a value in a dialog, it's not rendering. I recommend that you re-design your component that follows how to build an AEM component that uses granite resource types for a component dialog:

Building Experience Manager Components using Granite/Coral Resource Types

2. I see that you have your HTML set via the script. The NULL was coming from the script - not AEM. I changed the logic to print this:

ASC22.png

It works -- see the output in the page:

ASC23.png

I deployed everything to PUB - and it works too:

ASC24.png

Please also watch the video too where we show a standard HTL that uses a Java WCMUsePojo working on the PUB instance.

Avatar

Avatar

Gaurav-Behl

MVP

Avatar

Gaurav-Behl

MVP

Gaurav-Behl
MVP

19-02-2019

Why does you custom js show up with /apps/WeRimac/..... path? How did you include it in the component/template? Did you use 'allowProxy=true' to get it rendered as '/etc.clientlibs' and not as /apps?

Probably you're not logged-in on publish server via Incognito mode and 'anonymous' user doesn't have access to '/apps' hence your js doesn't get picked up. You must see this error in console and error.log file

You may follow we-retail to understand how clientlibs are invoked and added to the page template.

Avatar

Avatar

smacdonald2008

Total Posts

12.7K

Likes

1.4K

Correct Reply

2.3K

Avatar

smacdonald2008

Total Posts

12.7K

Likes

1.4K

Correct Reply

2.3K
smacdonald2008

20-02-2019

I will look at this package.

Here is a video that shows you a custom component set in Author, deployed to PUB. Then you can see the results that are configured on Author and rendered in the PUBLISH instance:

Avatar

Avatar

Ott0gi

Avatar

Ott0gi

Ott0gi

20-02-2019

Ok partners, my packages(apps,content) is share th next URL:

AEM WeRimac - Google Drive

I wait his help. Thanks

Avatar

Avatar

Prince_Shivhare

Avatar

Prince_Shivhare

Prince_Shivhare

19-02-2019

As Scott Said, Could you please package all the content and code and upload it on drive so that we can look it. Also Can you please check the error.log in your publish instance. what error you are getting here.

Avatar

Avatar

smacdonald2008

Total Posts

12.7K

Likes

1.4K

Correct Reply

2.3K

Avatar

smacdonald2008

Total Posts

12.7K

Likes

1.4K

Correct Reply

2.3K
smacdonald2008

19-02-2019

Can you package up all of your code under /apps, /content, /etc. Place the package in Google Drive so the community can download and look at it. At this point, we need to look at it to see what is going on.

Avatar

Avatar

Ott0gi

Avatar

Ott0gi

Ott0gi

19-02-2019

Why does you custom js show up with /apps/WeRimac/..... path?

I saw that the components were created all the data that was created with their respective logic.

How did you include it in the component/template?

No, where is that path? Only, I have my component in my template.

1695084_pastedImage_6.png

Did you use 'allowProxy=true' to get it rendered as '/etc.clientlibs' and not as /apps?

No, Where do I put this? Above on this topic I put the properties that my cq: ClientLibraryFolder. I wait your answer thank you

Avatar

Avatar

Ott0gi

Avatar

Ott0gi

Ott0gi

19-02-2019

HI Aarun, Yeah my problem is JS Since it does not recognize the logic of the script that I have, but something strange has just happened to me, it worked on google chrome but in the other browsers it still has the same error, even in the incognito mode of google chrome:

Chrome(Normal), IT'S WORKED:

1694770_pastedImage_0.png

1695080_pastedImage_1.png

Chrome(incognito mode), IT DOESN'T WORKED:

1695081_pastedImage_2.png

Similar error on other browser(IE, firefox). Now, In my publish instance I see the tree where you indicate me but I do not have any file related to this:

1695083_pastedImage_4.png

What is the problem with my JS and how do I place my JS on the tree? Help me please.

Avatar

Avatar

Arun_Patidar

MVP

Total Posts

3.0K

Likes

1.1K

Correct Reply

840

Avatar

Arun_Patidar

MVP

Total Posts

3.0K

Likes

1.1K

Correct Reply

840
Arun_Patidar
MVP

19-02-2019

Hi,

The issue is with your js. Either JS file is not loaded or the old version of js file is cached either in AEM or browser.

Could you please check your ClientLibs and consolidated js (at /var/clientlibs)files on AEM Publish instance.

Avatar

Avatar

smacdonald2008

Total Posts

12.7K

Likes

1.4K

Correct Reply

2.3K

Avatar

smacdonald2008

Total Posts

12.7K

Likes

1.4K

Correct Reply

2.3K
smacdonald2008

19-02-2019

Also - try testing an HTL component by following this article. Put this onto Author then see if you can get it to work on PUB. Once you get this working on PUB - we will know your PUB system is not the issue.

Creating an Adobe Experience Manager 6.4 HTL component that uses the WCMUsePojo API

Avatar

Avatar

smacdonald2008

Total Posts

12.7K

Likes

1.4K

Correct Reply

2.3K

Avatar

smacdonald2008

Total Posts

12.7K

Likes

1.4K

Correct Reply

2.3K
smacdonald2008

19-02-2019

There still seems to be missing files. Please check in CRXDE lite on publisher that all of your component files are there.

Avatar

Avatar

Gaurav-Behl

MVP

Avatar

Gaurav-Behl

MVP

Gaurav-Behl
MVP

18-02-2019

Can you debug and see if your js file is getting loaded on the page?

Login to publish server and test if it works?

Avatar

Avatar

Ott0gi

Avatar

Ott0gi

Ott0gi

18-02-2019

gauravb41175071​, thx for your answer, the steps that you mention and I made them, show:

1694376_pastedImage_1.png

1694377_pastedImage_2.png

1694375_pastedImage_0.png

On option "more" I did do click on "replicate" for two packages and my bundle on http://localhost:4502/system/console/bundles​ it's OK. I createdmy project WeRimac using archetype version 15 on eclipse, then only I did do -PautoInstallPackage install, then my project appear in CRXDE, thus:

1694378_pastedImage_4.png

1694379_pastedImage_5.png

Via CXRDE, I create component "saludo" and all files of this, then I "build" of my package at localhost:4502/crx/packmgr, then "replicate" thanks to this I was able to see my component in the publish instance, because at the beginning of this topic, that was my problem.

What am I doing wrong? because doesn't print "Juan" on my page. Help me please.

Avatar

Avatar

Gaurav-Behl

MVP

Avatar

Gaurav-Behl

MVP

Gaurav-Behl
MVP

18-02-2019

Login @ localhost:4502/crx/packmgr and

  • create a package of your source code  -- /apps/WeRimac & /conf/WeRimac and replicate it
  • create a package of content pages - /content/WeRimac and replicate it
  • check on author that your component is added to the page and it appears fine?

Login to localhost:4503/crx/de and validate that you can see source code package and content pages

Check if the component appears on page or not?  If the component is added to page in author and you replicate the content page, it should work in publish server as well.

In case of any issues, login with admin credentials on localhost:4503 and then test it and revert.

Avatar

Avatar

Ott0gi

Avatar

Ott0gi

Ott0gi

18-02-2019

smacdonald2008, I see tree at CRXDE, I have this:

1694168_pastedImage_0.png

1694169_pastedImage_1.png

1694170_pastedImage_2.png

Now, I do not see my component "saludo"  in this tree, I only see the "title" and the "image" under root, but because my component is shown in the publish instance.

How do I add my component to this tree in this instance?

Avatar

Avatar

smacdonald2008

Total Posts

12.7K

Likes

1.4K

Correct Reply

2.3K

Avatar

smacdonald2008

Total Posts

12.7K

Likes

1.4K

Correct Reply

2.3K
smacdonald2008

18-02-2019

On Publish - look at CRXDE lite, check the page props under /content<yourproject/YourPage. See if the properties are set properly. WHen you deploy your page - it should be deploying the page under /content with the props

Avatar

Avatar

Ott0gi

Avatar

Ott0gi

Ott0gi

18-02-2019

Hi smacdonald2008, thx for your answer, yeah I published all my project with my component on publish instance, I suppose than fine because my component is show in my page on publish instance, I change designed on my page and working in other project different to WeRetail, but I'm doing the same an my project now is called WeRimac:

Author instance(mode editor):

1694148_pastedImage_1.png

Publish instance:

1694149_pastedImage_2.png

Avatar

Avatar

smacdonald2008

Total Posts

12.7K

Likes

1.4K

Correct Reply

2.3K

Avatar

smacdonald2008

Total Posts

12.7K

Likes

1.4K

Correct Reply

2.3K
smacdonald2008

18-02-2019

As Praveen pointed out - looks like your component is not deployed on the AEM PUBLISH instance.

Create a package with all of your components under /app/yourProject and deploy to PUB. All components need to be on the PUB instance for them to be displayed in PUB.

Avatar

Avatar

Ott0gi

Avatar

Ott0gi

Ott0gi

18-02-2019

Sure, this is my code for file js.txt:

script.js

For file script.js:

$(document).ready(function() {

   $('#cliente').text('Juan');

});

For file saludo.html:

<sly data-sly-use.clientLib="/libs/granite/sightly/templates/clientlib.html"

     data-sly-call="${clientLib.js @ categories='htlajax'}"

data-sly-unwrap/>

<p data-sly-test="${properties.text}">Text property: ${properties.text}</p>

Felicidades Estimado: <div id="cliente"> </div>

Here structure files in my CRXDE, show properties for folder clientlibs:

1694101_pastedImage_5.png

My use case is write my name "Juan" in div with id="cliente" but I can't when publish my page, Any idea?

Avatar

Avatar

Gaurav-Behl

MVP

Avatar

Gaurav-Behl

MVP

Gaurav-Behl
MVP

15-02-2019

In the above screenshot for publish server url, you haven't passed the querystring. What is your use case?

could you share your code?

Avatar

Avatar

Ott0gi

Avatar

Ott0gi

Ott0gi

15-02-2019

How does it do that?

Avatar

Avatar

edubey

Avatar

edubey

edubey

14-02-2019

Make sure to deploy your component code to publish