Expand my Community achievements bar.

SOLVED

Promoting Launch Using Api

Avatar

Level 2

Hi,

I am trying to use LaunchManager Api to Promote the launch, but I am unable to set LaunchPromotion Parameters.

https://helpx.adobe.com/experience-manager/6-3/sites/developing/using/reference-materials/javadoc/co...

 

Code : 

Launch launch = res.adaptTo(Launch.class); // Launch Path

LaunchManager launchManager = res.adaptTo(LaunchManager.class); // LaunchManager object

launchManager.promoteLaunch(launch, launchParameters?);

 

if anyone has a sample code snippet, that would be helpful.

 

Thanks in advance.

1 Accepted Solution

Avatar

Correct answer by
Employee Advisor

@pmahiske19 

Here's the sample implementation for promoting a launch programmatically, which you can refer to:

 

https://github.com/terrabeata/promote-launch/blob/master/bundle/src/main/java/com/adobe/daycare/exam...

View solution in original post

4 Replies

Avatar

Employee Advisor

I believe you just have to create a new Java POJO class which will implement LaunchPromotionParameters interface. Implement the methods of the interface and pass the POJO object to the promoteLaunch method. 

Avatar

Level 2
LaunchPromotionParameters has all getters. I tried to get it using Impl but unable to do it. do we have any other option to get the LaunchPromotionParameters ?

Avatar

Employee Advisor

Just override those getters in your implementation class and pass the instance to the API method.

Avatar

Correct answer by
Employee Advisor

@pmahiske19 

Here's the sample implementation for promoting a launch programmatically, which you can refer to:

 

https://github.com/terrabeata/promote-launch/blob/master/bundle/src/main/java/com/adobe/daycare/exam...

The following has evaluated to null or missing: ==> liql("SELECT id, subject, body, depth, post_time, author.login, author.id, author.rank, metrics.views FROM messages WHERE topic.id = '${topicId}' AND is_solution = true").data.items[0] [in template "analytics-container" at line 82, column 31] ---- Tip: It's the final [] step that caused this error, not those before it. ---- Tip: If the failing expression is known to be legally refer to something that's sometimes null or missing, either specify a default value like myOptionalVar!myDefault, or use <#if myOptionalVar??>when-present<#else>when-missing. (These only cover the last step of the expression; to cover the whole expression, use parenthesis: (myOptionalVar.foo)!myDefault, (myOptionalVar.foo)?? ---- ---- FTL stack trace ("~" means nesting-related): - Failed at: #assign acceptedAnswer = liql("SELECT... [in template "analytics-container" at line 82, column 5] ----