Expand my Community achievements bar.

Guidelines for the Responsible Use of Generative AI in the Experience Cloud Community.
SOLVED

From CollabUtils to SocialUtils to ... ?

Avatar

Level 5

Planning upgrade from CQ 5.6.1 to AEM 6.2 and we've got a considerable number of social components that we wrote from scratch heavily utilizing some now extremely deprecated packages/classes. The most common of which, I'm having trouble tracking down a replacement for: prepareUserGeneratedContent(); Found that it still exists in the 6.2 documentation but can't exactly use it how we're using it today in CQ 5.6.1... 

In the past we would create/get the UGC node from the path of the resource/page calling the servlet, once we had the UGC node, update the relevant custom properties, save the session, then return the result. 

I guess my question is what is the proper way to CRUD UGC in AEM 6.2 from a custom Java servlet?

I'm open to using OOTB components/classes to make this work instead of our custom implementation, but just need to know where to start to learn the right way of using the SRP API in 6.2. Any examples out there?

1 Accepted Solution

Avatar

Correct answer by
Employee

There are some code examples on github that might be useful

The beginnings of an "SRP Browser" tool: https://github.com/Adobe-Marketing-Cloud/aem-communities-srp-browser

A tool to migrate UGC from 5.x versions to the "common store" SRP approach in 6.1 and later: https://github.com/Adobe-Marketing-Cloud/aem-communities-ugc-migration

A repo for SRP tools, which currently contains one utility to clear out an ASRP report suite: https://github.com/Adobe-Marketing-Cloud/aem-communities-srp-tools

Code samples from the AEM Communities Lab at the 2016 Adobe Marketing Summit https://github.com/Adobe-Marketing-Cloud/communities-customize-sitepage

An example for customizing an SCF component: https://github.com/Adobe-Marketing-Cloud/aem-scf-sample-components-customize and this repo also has a custom search sample on a branch (not moved to master quite yet): https://github.com/Adobe-Marketing-Cloud/aem-scf-sample-components-customize/tree/custom-search

An example (somewhat stale) of extending the forum component to become an ideation component: https://github.com/Adobe-Marketing-Cloud/aem-scf-sample-components-extension/commits/master

View solution in original post

5 Replies

Avatar

Level 9

Hi Gdubz,

I'm going to move your question over to the AEM Communities forum in just a moment.

But first, you might want to reach out through your account representative to get help.

There are a few samples listed in the docs that do still use SocialUtils (though deprecated, it has not yet been removed).  (edit)Ah, you found prepareUserGeneratedContent() in SocialUtils, which is deprecated and being replaced with SocialResourceUtilities.  The method you mention is listed as "for internal use only".

Here are some doc links, if you've not yet found them :

  AEM Communities Overview

  Upgrading to AEM 6.2 Communities  (both the section on upgrading from 5.6.1 and upgrading with UGC)

  Social Component Framework

  Component, Function and Feature Essentials

  Coding Guidelines

- JK

Avatar

Level 5

Don't know why the link in my original post doesn't work anymore, but this is where I found "prepareUserGeneratedContent()":
https://docs.adobe.com/docs/en/aem/6-2/develop/ref/javadoc/com/adobe/cq/social/ugcbase/SocialUtils.h...)

It's a method we've been using since we built our site originally on CQ 5.5: 
https://docs.adobe.com/docs/en/cq/5-6-1/javadoc/com/day/cq/collab/commons/CollabUtil.html#prepareUse..., java.lang.String)

On the "Social Component Framework" page under the "Component Customization and Extension" section, those links to OperationExtension, SlingPostOperation, and OperationServices don't work. I can look them up in the javadocs, just thought I'd point that out, that they don't actually go anywhere or do anything. :(

I'll keep looking through the links you have provided for more information, thank you so much JK!

Avatar

Correct answer by
Employee

There are some code examples on github that might be useful

The beginnings of an "SRP Browser" tool: https://github.com/Adobe-Marketing-Cloud/aem-communities-srp-browser

A tool to migrate UGC from 5.x versions to the "common store" SRP approach in 6.1 and later: https://github.com/Adobe-Marketing-Cloud/aem-communities-ugc-migration

A repo for SRP tools, which currently contains one utility to clear out an ASRP report suite: https://github.com/Adobe-Marketing-Cloud/aem-communities-srp-tools

Code samples from the AEM Communities Lab at the 2016 Adobe Marketing Summit https://github.com/Adobe-Marketing-Cloud/communities-customize-sitepage

An example for customizing an SCF component: https://github.com/Adobe-Marketing-Cloud/aem-scf-sample-components-customize and this repo also has a custom search sample on a branch (not moved to master quite yet): https://github.com/Adobe-Marketing-Cloud/aem-scf-sample-components-customize/tree/custom-search

An example (somewhat stale) of extending the forum component to become an ideation component: https://github.com/Adobe-Marketing-Cloud/aem-scf-sample-components-extension/commits/master

Avatar

Level 9

Gdubz wrote...

On the "Social Component Framework" page under the "Component Customization and Extension" section, those links to OperationExtension, SlingPostOperation, and OperationServices don't work. I can look them up in the javadocs, just thought I'd point that out, that they don't actually go anywhere or do anything. :(

 

Thank You for pointing that out.  I fixed the links - they go to the client-customize and server-customize pages.

I'll keep looking through the links you have provided for more information, thank you so much JK!

Do check out what dwalling pointed out to you.

- JK

Avatar

Level 5

JK Kendall wrote...

Gdubz wrote...

On the "Social Component Framework" page under the "Component Customization and Extension" section, those links to OperationExtension, SlingPostOperation, and OperationServices don't work. I can look them up in the javadocs, just thought I'd point that out, that they don't actually go anywhere or do anything. :(

 

Thank You for pointing that out.  I fixed the links - they go to the client-customize and server-customize pages.

I'll keep looking through the links you have provided for more information, thank you so much JK!

Do check out what dwalling pointed out to you.

- JK

 

Thank you both, this is great stuff. I've got a lot of "learning how to do things the right way" ahead of me, as well as a bunch of code refactoring!