How to get link and other variables from groupjive stream

3 years 2 months ago #322624 by timstohr
Hi Kyle,
I am sorry but I have to ask now.

I am creating an activity using an AA and a customized trigger whenever I create an event (third party component) inside a group. This activity now has the correct asset groupjive.group.X,custom.event.[ID]. I can now simply fire a Group notification BUT I would need to input the link from the activity into the notification. I need to input the information in the screenshot (which I have taken from the AA that does the activity creation).

I am using the CB Groupjive - Stream Notification (filtered to the asset above)
Attachments:

Please Log in to join the conversation.

3 years 2 months ago #322636 by krileon
Don't know what you're asking. Your current configuration looks fine. The information available entirely depends on the trigger you are using. I've updated our trigger tutorial below with a new trigger parse showing all variables available to a trigger.

www.joomlapolis.com/documentation/279-community-builder/tutorials/18358-using-cb-triggers

If you're trying to pull source object information on the activity_onAfterCreateStreamActivity trigger for a 3rd party object then your situation is impossible. CB Activity has no clue what your 3rd party extension even is so it has no source object parsing for it. You would need to extend the core source object parsing template file below so it can be aware of what your event is otherwise the source object is just going to be the group.

/components/com_comprofiler/plugin/user/plug_cbactivity/templates/default/core/source.php


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in to join the conversation.

3 years 2 months ago #322638 by timstohr
Hi Kyle,
I can already create an activity when someone creates a third party event. I have included a custom trigger in the third party extension, and it has been working for years. What I want now is to make a notification from the activity that was created. So the idea is: Person creates event-> Activity is created inside group -> Groupjive Event Creation AA (similar to Groupjive Stream System Action but reacting on asset groupjive.group.X.custom.event.Y fires off a notification.
This notification needs to contain some of THE CONTENT of the activity created from the third party extension, notably the URL, The URL title and the media URL.
Which variables do I need to take? The trigger I use is the same that you use on your groupjive Stream Activity Notification: onAfterCreateStreamActivity

Please Log in to join the conversation.

3 years 2 months ago #322642 by krileon
Send the notification when the event is created like you're already doing for the activity. You'll then have access to all the same information as the activity did. If you try chaining Event > Activity > Notification it won't work. CB Activity won't have a clue what the $source object is so the Notification won't have the details you're asking for.

Which variables do I need to take? The trigger I use is the same that you use on your groupjive Stream Activity Notification: onAfterCreateStreamActivity

Again, read the tutorial. All the variables are there for you already. They are as follows.

$_PLUGINS->trigger( 'activity_onAfterCreateStreamActivity', array( $stream, $source, $row ) );

$stream = activity stream object
$source = target of the activity (e.g. could be group object or it could be nothing)
$row = activity object

$source is not going to be your Event object as explained above it is not coded to build objects from random extensions like your 3rd party event extensions.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in to join the conversation.

3 years 2 months ago #322658 by timstohr
Hi,
I think I know where we are misunderstanding each other. I am not talking about the upper variable itself, that is easy to find out of the documentation. I am talking about the values that are inside the variable (eg var2_id), I need to find those out. I understand now where the problem is. I will have a look at the databases and try to find out the names of the values like this.

Please Log in to join the conversation.

3 years 2 months ago #322659 by krileon
I can't tell you what those are for var2 when var2 can be anything. var2 is $source and $source is dependent on where the activity is being posted. If it's in a group var2 should be the group object, if it's on a profile then it should be the profile the post is being made to, if it's a custom activity stream it will be empty as CB Activity has to be aware of what the source is and parse for it. The template file provided in my previous reply can be used to extend $source with custom parsing.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in to join the conversation.

Moderators: beatnantkrileon
Time to create page: 0.431 seconds

Facebook Twitter LinkedIn