Expand my Community achievements bar.

SOLVED

Extended Journal Component not Working

Avatar

Level 2

Hi

Im using GitHub - Adobe-Marketing-Cloud/aem-scf-sample-components-extension: Sample package for AEM Social Co... to Extend a journal Component and customise it. However it is not working. These are the steps I have done

1. Installed the package after building

2. Added Subtitle field to the below as recommended (

  1. Add a property "subtitle" in your author and publish instance's /system/console/configMgr/com.adobe.cq.social.journal.client.endpoints.impl.JournalOperationsService

1276142_pastedImage_1.png

3. Added the 3 Clientlibs to the page

1. cq.ckeditor

2. cq.social.hbs.voting

3. cq.social.hbs.journal

Issue: When I write in the blog it doesnt save anything when i click on publish.

1276143_pastedImage_3.png

After refresh the page shows blank as before.

1276144_pastedImage_4.png

Can someone please help me in resolving the issue? One More thing when I put my code on debug the CustomJournalEntryComponent code does NOT get called at all.

1 Accepted Solution

Avatar

Correct answer by
Level 2

Just to keep the post updated I finally managed to find out a solution.

The etc/design must have the resourceType properly set in the correct path. My project structure was such that setting the paths via the design dialog was not sufficient. I have to find the path where this value was required to be set

View solution in original post

21 Replies

Avatar

Level 10

Does it work when you do not extend it?

Avatar

Employee

Hi Titli,

1. What's the AEM version, you are on?

2. Did you get any client side errors?

3. Anything in server logs?

4. To which page, you added clientlibs? Can you point me to the documentation, which you followed to add these?

5. Can you see the bundle to be resolved in your /system/console/bundles?

6. You seem to have your classic authoring on, have you tried it on publish instance?

-Rahul

Avatar

Level 2

Im using the sample component. GitHub - Adobe-Marketing-Cloud/aem-scf-sample-components-extension: Sample package for AEM Social Co...

This sample is provided as a example to extend and implement the Journal component. Thats what Im trying to do. The normal journal component works fine otherwise. Im extending the journal component thats inside libs/social as is given. Infact the sample project contains pages and an instruction which Im following.

Avatar

Level 2

1. AEM 6.1 with SP1 and communities latest feature pack

2. No client side error

3. I do see some errors on the log but thats related to the replication agent not being able to replicate. Thats coz my publish was down at that time.

4. I added the clientlibs to a page i made inside acme/en via the clientliblist component. (content/acme was already there as part of the project, i just made one more page with the same template)

5 Yes, bundle are all up and active

6. No i havent published it. But I dont see the point of it not working in the author environment, as all other components in the sample project work absolutely fine for me. (Ideas page)

Avatar

Level 2

Just to clarify the sample itself is not working for me and Im wondering why.

Avatar

Employee

The samples are verified to have worked with AEM >= 6.2. Let me try to reproduce issue inhouse and get back to you. It might take a few days.

Avatar

Level 2

okay... But in the meanwhile can you tell me how the java classes CustomJournalEntryComponent and the corresponding factory is connected to the component. For me in debug mode those classes arent getting called at all. I am getting the feeling that I must be missing some sort of configuration.

Avatar

Level 2

When I try in AEM 6.2  and on a fresh instance I get the following errors on the console

Uncaught ReferenceError: SCFValidator is not defined

site.js:2144 Uncaught ReferenceError: SCFValidator is not defined

journal.js:4261 Uncaught TypeError: Cannot read property 'validate' of undefined

site.js:2144 Uncaught ReferenceError: SCFValidator is not defined

    at Function.SCF.View.bindDataForms (site.js:2144)

    at HTMLFormElement.<anonymous> (site.js:1762)

    at Function.each (jquery.js:384)

    at jQuery.fn.init.each (jquery.js:136)

    at child.bindView (site.js:1761)

    at child.initialize (site.js:1602)

    at child.Backbone.View (backbone.js:987)

    at child [as constructor] (backbone.js:1531)

    at child [as constructor] (backbone.js:1531)

    at child [as constructor] (backbone.js:1531)

This page has the following libraries added cq.ckeditor, cq.social.hbs.voting, cq.social.hbs.journal

Avatar

Employee

To understand "how the java classes CustomJournalEntryComponent and the corresponding factory is connected to the component", I would encourage you to read documentation for server side customization[0].

If you are facing trouble with 6.2 too, I would suggest you to try a restart of your instance, if possible. Else, it's difficult to debug the issue without taking a look at your environment. I would suggest you to log a support ticket so that your environment can be analyzed and a it can solved for you.

[0] - Server-side Customization

Avatar

Level 2

I will surely go through it again. But what I essentially wanted to know was if there was any configuration required which is not mentioned in here. And I had tried the sample on a fresh instance just for test purposes. I actually need it for AEM 6.1. The sample just does not work for me. The backend classes are simply not getting called. They get called only for the ideation component and not for the custom blog component.

I'm stuck! Can you try it on 6.1 with sp1 and community feature pack installed?

Avatar

Employee

Just checked - It's working for me on 6.1 too. I had to take just three steps :

1. Add "subtitle" to whitelist in configMgr

2. Build and install content package from the repo.

3. Add Extended journal to the site and created ugc.

Can you check without adding any clientlibs?

Avatar

Level 2

Did you create any new page? Can you share the package with the component added?

Step 1 : I did it

Step 2: did it

Step 3:. Might differ from yours. I checked in the acme/en/newsblog  please share your package from 6.1 with the working component.

I will install it 

Avatar

Level 2

HI,

I tried out this component. there might have been some problem with the clientlibs. Now the data is getting save but when I open the entry the extended component does not get called. The default component entry_topic gets displayed.

For example if in

/apps/custom-blog/components/hbs/entry_topic/entry_topic.hbs

I change the following line

        <p class="scf-breadcrumb scf-quiet">{{i18n "Entries!!"}} &#187; <a href="{{pageInfo.basePageURL}}.html">{{i18n "Blog!!"}}</a> &#187; {{subject}}</p>

It does not get reflected in the page.

Can you check if thats happening for you too?

Avatar

Correct answer by
Level 2

Just to keep the post updated I finally managed to find out a solution.

The etc/design must have the resourceType properly set in the correct path. My project structure was such that setting the paths via the design dialog was not sufficient. I have to find the path where this value was required to be set

Avatar

Employee

Great job Titli. Unfortunately, I lost track of our discussion and this discussion went down in my stack. Sorry for the inconvenience that you might have faced, when I failed to respond to your earlier query.

-Rahul

Avatar

Level 2

Did you managed to find a solution to this?

I'm currently facing this issue where my extended entry_topic component isn't being reflected on my live site. Instead, its the default entry_topic.hbs file that's being referred to under /libs/social/journal/components/hbs/

Even when I update my custom entry_topic.hbs under /apps/ and change the data-scf-component attribute to the  new path of my entry_topic component, it still doesn't get picked up.

Avatar

Employee

Please refer Titli's reply, which is marked as correct answer and proceed accordinly!

Avatar

Level 2

The answer wasn't specific enough which is why I still asked my question. Exactly where under /etc/designs/ must we define the path to update the resourceType or the entryresourcetype property so that the entry_topic.hbs being referenced is not the one under /libs/

Avatar

Level 2

Exactly same problem. You can configure your entry topic, by updating the path in Design mode for your blog component. You will be able to edit and see the blog as per your extension. But now the list on the blog page is not coming. Let me know if this fixes your issue, and you also do no see the list on the blog list page.

Avatar

Level 1

Hi Titli,

I have the same problem. The blog component doesn't work. Not able to post any new blog. Can you please provide details on what properties you set with values. a screenshot showing the values will be much appreciated.

Thanks

Nihar