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
BedrockMission!

Learn More

View all

Sign in to view all badges

Java Deprecated Inheritance Feature

Avatar

Avatar
Validate 10
Level 4
Gdubz-57m2mu
Level 4

Likes

41 likes

Total Posts

123 posts

Correct Reply

9 solutions
Top badges earned
Validate 10
Validate 1
Boost 5
Boost 3
Boost 25
View profile

Avatar
Validate 10
Level 4
Gdubz-57m2mu
Level 4

Likes

41 likes

Total Posts

123 posts

Correct Reply

9 solutions
Top badges earned
Validate 10
Validate 1
Boost 5
Boost 3
Boost 25
View profile
Gdubz-57m2mu
Level 4

09-11-2016

Hi there!

I was attempting to recreate/experiment/learn more about the Social Component Framework and getting the following warning from Maven on build:

[WARNING] C:\Projects\my-project\core\src\main\java\com\sample-project\my-project\core\servlets\SetStatusOperation.java [1:1]:  Component com.sample-project.my-project.core.servlets.SetStatusOperation is using the deprecated inheritance feature and inherits from com.adobe.cq.social.scf.core.operations.AbstractSocialOperation. This feature will be removed in future versions.

From the following class[1]:

public class SetStatusOperation extends AbstractSocialOperation implements PostOperation { // ... }

I know it's just a warning, but since I'm just getting started with this now, I'm wondering if there's some new AbstractSocialOperation class we should be using?

For reference: I'm using AEM 6.2 with the latest Communities Feature Pack (FP1)[2]

[1] https://github.com/Adobe-Marketing-Cloud/aem-scf-sample-components-extension/blob/master/bundles/aem...
[2] https://repo.adobe.com/nexus/content/repositories/releases/com/adobe/cq/social/cq-socialcommunities-...

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar
Boost 5
Level 6
JK_Kendall
Level 6

Likes

36 likes

Total Posts

379 posts

Correct Reply

105 solutions
Top badges earned
Boost 5
Boost 3
Boost 25
Boost 10
Boost 1
View profile

Avatar
Boost 5
Level 6
JK_Kendall
Level 6

Likes

36 likes

Total Posts

379 posts

Correct Reply

105 solutions
Top badges earned
Boost 5
Boost 3
Boost 25
Boost 10
Boost 1
View profile
JK_Kendall
Level 6

10-11-2016

Hi Greg,

An updated TodoMVC example is available on GitHub (still a work in process).

"SCF+SRP implementation of ToDo MVC Demostrates how to develop a SCF+SRP component from scratch"

See the use of ResourceResolverFactory and SocialResourceProvider.

Be aware that the API docs available from docs.adobe.com reflect the 6.2 GA release (Communities 1.9.xxx).  The API docs for Communities feature packs (1.10.xxx) will be available through your dev environment (IDE).

We hope this is helpful.

- JK

Answers (3)

Answers (3)

Avatar

Avatar
Validate 10
Level 4
Gdubz-57m2mu
Level 4

Likes

41 likes

Total Posts

123 posts

Correct Reply

9 solutions
Top badges earned
Validate 10
Validate 1
Boost 5
Boost 3
Boost 25
View profile

Avatar
Validate 10
Level 4
Gdubz-57m2mu
Level 4

Likes

41 likes

Total Posts

123 posts

Correct Reply

9 solutions
Top badges earned
Validate 10
Validate 1
Boost 5
Boost 3
Boost 25
View profile
Gdubz-57m2mu
Level 4

10-11-2016

Sorry, one more missing method that has been deprecated but I can't find a replacement for:

boolean isResourceOwner(Resource resource)

Again, this is marked as INTERNAL_USE_ONLY on the SocialUtils Refactoring documentation[1] but I'm struggling to find an alternative to, or if there is a public method of a different name that will accomplish the same thing as what is provided in the sample customization code[2].

[1] https://docs.adobe.com/docs/en/aem/6-2/develop/communities/code-guide/socialutils.html
[2] https://github.com/Adobe-Marketing-Cloud/aem-scf-sample-components-customize/blob/master/scf-tasks-s...

Avatar

Avatar
Validate 10
Level 4
Gdubz-57m2mu
Level 4

Likes

41 likes

Total Posts

123 posts

Correct Reply

9 solutions
Top badges earned
Validate 10
Validate 1
Boost 5
Boost 3
Boost 25
View profile

Avatar
Validate 10
Level 4
Gdubz-57m2mu
Level 4

Likes

41 likes

Total Posts

123 posts

Correct Reply

9 solutions
Top badges earned
Validate 10
Validate 1
Boost 5
Boost 3
Boost 25
View profile
Gdubz-57m2mu
Level 4

10-11-2016

Wow, okay. Shortly after posting that, I stumbled across InternalSocialResourceUtilities[1] in the documentation and that appears to have the two of the three INTERNAL_USE_ONLY methods I mentioned in my last post. Still not sure what to do about mayPost(); though I guess I don't have to do that check and can just try to catch the error if it fails.

My question regarding the deprecated ModifyingResourceProvider still stands though.

[1] https://docs.adobe.com/docs/en/aem/6-2/develop/ref/javadoc/com/adobe/cq/social/srp/utilities/interna...

Avatar

Avatar
Validate 10
Level 4
Gdubz-57m2mu
Level 4

Likes

41 likes

Total Posts

123 posts

Correct Reply

9 solutions
Top badges earned
Validate 10
Validate 1
Boost 5
Boost 3
Boost 25
View profile

Avatar
Validate 10
Level 4
Gdubz-57m2mu
Level 4

Likes

41 likes

Total Posts

123 posts

Correct Reply

9 solutions
Top badges earned
Validate 10
Validate 1
Boost 5
Boost 3
Boost 25
View profile
Gdubz-57m2mu
Level 4

10-11-2016

Another deprecation warning I encountered:

The method create(ResourceResolver, String, Map<String,Object>) from the type ModifyingResourceProvider is deprecated.

This is from Line 108 of the TaskServiceImpl.java[1] example on the aem-scf-sample-components-customize github page[2]. It's using SocialResourceProvider (com.adobe.cq.social.srp.SocialResourceProvider), which I'm guessing extends/implements ModifyingResourceProvider (org.apache.sling.api.resource.ModifyingResourceProvider). Is there a recommended alternative or is Adobe updating their Communities API to address this deprecation?

One more issue I have after updating the dependencies in sample code from the github site above to work with AEM 6.2, looking at the SocialUtils Refactoring documentation[3]... I'm wondering why certain methods were made INTERNAL_USE_ONLY, specifically the ones used in the aforementioned sample project:

  • mayPost();
  • createUniqueNameHint();
  • generateRandomString();

If these have been removed because there's ONE other method that does the job of creating the UGC content, then please let me know!

Thanks!

[1] https://github.com/Adobe-Marketing-Cloud/aem-scf-sample-components-customize/blob/master/scf-tasks-s...
[2] https://github.com/Adobe-Marketing-Cloud/aem-scf-sample-components-customize
[3] https://docs.adobe.com/docs/en/aem/6-2/develop/communities/code-guide/socialutils.html